From 65f8ed3e551d8b643e50d61d15ee8556287840ec Mon Sep 17 00:00:00 2001 From: twobit Date: Thu, 5 Sep 2013 11:04:24 +0200 Subject: [PATCH] change blink --- firmware/apps/mariotheme.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/firmware/apps/mariotheme.c b/firmware/apps/mariotheme.c index ef0bf55..d2ff580 100644 --- a/firmware/apps/mariotheme.c +++ b/firmware/apps/mariotheme.c @@ -112,19 +112,13 @@ static void mix_mario(void) { uint8_t p = order[row]; uint8_t n; - static uint8_t prev_n; + static uint8_t prev_n = 0; n = pgm_read_byte(&patterns[p][0][note]); if (n == 0) osc[0] = 0; - else { - // toggle leds on every new beep - if (n != prev_n) { - led_inv(LEFT); - led_inv(RIGHT); - } - osc[0] += pgm_read_word(&freq[n]); - } + osc[0] += pgm_read_word(&freq[n]); + if (n != prev_n) led_set(RIGHT, (n > 0)); prev_n = n;