diff --git a/firmware/main.c b/firmware/main.c index 26525eb..c46a45e 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -65,6 +65,7 @@ void do_mode0(void) { sound_on = true; motor_on = true; init_mic(); + init_leds(); timer_set(&mytimer, 10); }; @@ -128,6 +129,7 @@ void do_mode1(void) { ModeChanged = false; tone = 1000; music_setNote(tone, 0); + init_leds(); led_off(LED_L | LED_R); }; if (btn_state(BTNST_SUP, BTN_LEFT)) { @@ -158,6 +160,7 @@ void do_mode2(void) { ModeChanged = false; music_setNote(NOTE_PAUSE, 4); //mute timer_set(&mytimer, 10); + init_leds(); led_off(LED_L | LED_R); set_motor(MOTOR_OFF); } @@ -204,6 +207,7 @@ void do_mode3(void) { static timer_t mytimer; static bool blink; if (ModeChanged) { + init_leds(); ModeChanged = false; music_setNote(NOTE_PAUSE, 4); //mute set_motor(MOTOR_OFF); @@ -251,6 +255,7 @@ void do_mode4(void) { static timer_t mytimer; static bool blink; if (ModeChanged) { + init_leds(); music_setNote(NOTE_PAUSE, 0); ModeChanged = false; timer_set(&mytimer, 10); @@ -300,6 +305,7 @@ void do_mode5(void) { if (ModeChanged) { //init after mode change ModeChanged = false; + set_motor(MOTOR_OFF); ADMUX = (1<