1. 09 Mar, 2020 2 commits
    • Sven Greiner's avatar
      Revert change to delay_s() and make it busy wait again · 9444a533
      Sven Greiner authored
      There's no power saving (sleep) yet, but the more complex code is not as
      accurate and needs 10 bytes more than the simple busy wait.
      9444a533
    • Sven Greiner's avatar
      A second is not a second · ab57de77
      Sven Greiner authored
      delay_s() varies between 750 and 1000 ms. Not a big problem in our case
      because the delay is not very critical and just delays periodic events.
      So if everything is right the delay between these periodic events should
      be always of the same length. But let's document this.
      ab57de77
  2. 08 Mar, 2020 6 commits
  3. 07 Mar, 2020 5 commits
  4. 15 Jul, 2019 3 commits
  5. 14 Jul, 2019 1 commit
  6. 07 Jul, 2019 10 commits
  7. 16 Jan, 2019 2 commits
  8. 10 Jan, 2019 1 commit
  9. 08 Jan, 2019 2 commits
  10. 07 Jan, 2019 8 commits
    • Sven Greiner's avatar
      Remove fast press overflow handling · 4f5becbd
      Sven Greiner authored
      If we assume that the config case in the switch statement is reached
      before the user can tap a second time [1] there is no need to handle
      overflow of fast_presses in a separate if statement. Instead it is
      enough to set fast_presses to the current value minus one so that when a
      possible next press of the power switch increments the counter again
      this results in the same case.
      
      This saves 6 bytes of flash.
      
      [1] Which is unlikely because the execution time until this point is
      much shorter than human repetitive finger movement, so only button
      bouncing can be an issue and that would require other measures
      4f5becbd
    • Sven Greiner's avatar
      Fix #2: Add strobe mode · 584ac5d7
      Sven Greiner authored
      If users want a strobe mode, they usually want it for defence purposes.
      Thus it should be possible to enter it as fast as possible. If strobe is
      enabled (first option if STROBE is compiled) the flashlight always
      starts in a strobe mode. Then a single press of the power switch enters
      the usual UI.
      584ac5d7
    • Sven Greiner's avatar
      Set TIMSK0 explicitly · 26e59f4e
      Sven Greiner authored
      TIMSK0 is outside of lower 32 I/O registers and thus cannot be set via
      sbi. This saves 4 bytes of flash.
      26e59f4e
    • Sven Greiner's avatar
      Some comment cleanup · 88ac6455
      Sven Greiner authored
      88ac6455
    • Sven Greiner's avatar
      Fix #1: LVP skipped sometimes · 70fa3681
      Sven Greiner authored
      Set a flag in the interrupt handler instead of checking the current tick
      value.
      
      Requires additional 14 bytes of flash...
      70fa3681
    • Sven Greiner's avatar
      Move more global variables into registers · 82fa080d
      Sven Greiner authored
      Now we use registers in the function call area. But we don't use any
      functions with many arguments, so this is not a problem and saves 56
      bytes.
      82fa080d
    • Sven Greiner's avatar
      Make beacon brightness adjustable · 4c9c54e5
      Sven Greiner authored
      Costs 8 bytes of flash.
      4c9c54e5
    • Sven Greiner's avatar
      Add beacon mode · de750863
      Sven Greiner authored
      de750863