• Sven Greiner's avatar
    Remove fast press overflow handling · 39b35b75
    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
    39b35b75
rampinglight.c 13 KB