- Jan 07, 2019
-
-
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.
-
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.
-
Sven Greiner authored
-
Sven Greiner authored
Set a flag in the interrupt handler instead of checking the current tick value. Requires additional 14 bytes of flash...
-
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.
-
Sven Greiner authored
Costs 8 bytes of flash.
-
Sven Greiner authored
-
- Jan 05, 2019
-
-
Sven Greiner authored
Check fast_presses and state only once. Allows more deterministic transitions, but introduces a goto and increases flash size by 14 bytes.
-
Sven Greiner authored
Move common actions out of mode specific handler. Removes redundant code, but might not provide the same level of flexibility as before and might reduce readability. Saves 2 bytes of flash.
-
Sven Greiner authored
Just to make sure. We have enough free RAM at the moment.
-
Sven Greiner authored
-
- Jan 01, 2019
-
-
Sven Greiner authored
-
Sven Greiner authored
toggle_options() preserves the value of options if it returns. The compiler did not optimize the intermediate variable because it doesn't know that fact. This saves 4 bytes.
-
- Dec 28, 2018
-
-
Sven Greiner authored
Also make some tiny improvements to the Makefile related to fuses.
-
Sven Greiner authored
-
Sven Greiner authored
This allows more flexibility in choosing the brightness of blinking, currently used only to flicker at the current brightness for battery warning. Sadly due to additional calls to set low intensity for config mode this saves only 2 bytes of flash memory, but with some other parameters it is possible to save up to 6 bytes more.
-
Sven Greiner authored
Using ATOMIC_FORCEON saves 2 bytes compared the ATOMIC_RESTORESTATE because it does not need to save the previous state.
-
- Dec 27, 2018
-
-
Sven Greiner authored
-
Sven Greiner authored
-
- Dec 23, 2018
-
-
Sven Greiner authored
Thus all necessary delays fit into an uint8_t instead of uint16_t which saves 18 bytes in flash.
-
Sven Greiner authored
-
Sven Greiner authored
-
Sven Greiner authored
-
Sven Greiner authored
- Use dedicated delay_s() function - Move ticks into register
-
Sven Greiner authored
Now everything fits exactly in 1024 byte!
-
Sven Greiner authored
This is non-optimized code and too big for flash.
-
Sven Greiner authored
-
Sven Greiner authored
-
- Dec 22, 2018
-
-
Sven Greiner authored
As the datasheet tells us, fast PWM cannot reach zero duty cycle. D'oh!
-
Sven Greiner authored
This saves some bytes because it is not necessary anymore to address options in RAM.
-
Sven Greiner authored
10 kHz is too fast for the 7135 current regulator which requires at least ~5-8 µs to provide full current. With 2.3 kHz the shortes pulse (PWM level 5) is ~9 µs. This results in higher efficiency and should still be fast enough to not show visible flicker. The downside is that this might cause audible humming.
-
Sven Greiner authored
-
Sven Greiner authored
-
Sven Greiner authored
-
Sven Greiner authored
-
- Dec 21, 2018
-
-
Sven Greiner authored
-
Sven Greiner authored
-
Sven Greiner authored
-
Sven Greiner authored
-