make leds blink

This commit is contained in:
twobit 2013-09-05 10:59:21 +02:00
parent e738617529
commit 56114f7be1

View File

@ -112,10 +112,21 @@ static void mix_mario(void) {
uint8_t p = order[row];
uint8_t n;
static uint8_t prev_n;
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]);
}
prev_n = n;
n = pgm_read_byte(&patterns[p][1][note]);
if (n == 0) osc[1] = 0;