~sammyshp/flashlight-firmware/momentary-turbo

« back to all changes in this revision

Viewing changes to ToyKeeper/spaghetti-monster/anduril/ramp-mode.c

  • Committer: Sven Greiner
  • Author(s): SammysHP
  • Date: 2021-08-30 08:31:14 UTC
  • Revision ID: sven@sammyshp.de-20210830083114-dmt0fj6flhhd28ev
Allow turbo in momentary mode

Show diffs side-by-side

added added

removed removed

Lines of Context:
375
375
    #ifdef USE_MOMENTARY_MODE
376
376
    // 5 clicks: shortcut to momentary mode
377
377
    else if (event == EV_5clicks) {
 
378
        // Allow to use turbo in momentary mode. It is safe to overwrite
 
379
        // memorized_level because the only way to exit momentary mode is to
 
380
        // reboot the flashlight which restores memorized_level to the default
 
381
        // or EEPROM (but we don't write to EEPROM here).
 
382
        memorized_level = actual_level;
378
383
        set_level(0);
379
384
        set_state(momentary_state, 0);
380
385
        return MISCHIEF_MANAGED;