~toykeeper/flashlight-firmware/trunk

« back to all changes in this revision

Viewing changes to ToyKeeper/spaghetti-monster/fsm-misc.c

  • Committer: Selene ToyKeeper
  • Date: 2023-08-24 23:08:01 UTC
  • mto: (188.22.175 anduril2)
  • mto: This revision was merged to the branch mainline in revision 250.
  • Revision ID: bzr@toykeeper.net-20230824230801-ntwen6fxhnzcoxhd
added channel mode per strobe mode, and made FSM channel mode more flexible,
and fixed issue in tactical mode where strobes wouldn't stop on button release

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    #ifdef BLINK_CHANNEL
36
36
    // channel is set per blink, to prevent issues
37
37
    // if another mode interrupts us (like a config menu)
38
 
    uint8_t old_channel = CH_MODE;
 
38
    uint8_t old_channel = channel_mode;
39
39
    #endif
40
40
 
41
41
    for (; num>0; num--) {
45
45
        #endif
46
46
        set_level(BLINK_BRIGHTNESS);
47
47
        #ifdef BLINK_CHANNEL
48
 
            CH_MODE = old_channel;
 
48
            channel_mode = old_channel;
49
49
        #endif
50
50
        nice_delay_ms(ontime);
51
51
 
54
54
        #endif
55
55
        set_level(0);
56
56
        #ifdef BLINK_CHANNEL
57
 
            CH_MODE = old_channel;
 
57
            channel_mode = old_channel;
58
58
        #endif
59
59
        nice_delay_ms(BLINK_SPEED * 3 / 12);
60
60
    }