From a4005ade77daa0cfe3fdac88973f72912dceb835 Mon Sep 17 00:00:00 2001 From: Paul Mathieu Date: Sat, 20 Mar 2021 21:27:36 -0700 Subject: [PATCH] dsp: small refactor --- dsp/main.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dsp/main.c b/dsp/main.c index fd4cae3..f001c8e 100644 --- a/dsp/main.c +++ b/dsp/main.c @@ -27,34 +27,34 @@ int main() { while(1) { uint8_t c = uart_read(uart0); - uint16_t period; + uint16_t period = 0; if (c == 'c') { led0->output = 1; period = 1493; // C4, 262.63 Hz, maybe - uart_writen(uart0, "C4\r\n", 4); + log("C4\r\n"); } else if (c == 'd') { period = 1330; // D4, 293.66 Hz, maybe - uart_writen(uart0, "D4\r\n", 4); + log("D4\r\n"); led0->output = 2; } else if (c == 'e') { period = 1185; // E4, 329.63 Hz, maybe - uart_writen(uart0, "E4\r\n", 4); + log("E4\r\n"); led0->output = 4; } else if (c == 'f') { period = 1119; // F4, 249.23 Hz, maybe - uart_writen(uart0, "F4\r\n", 4); + log("F4\r\n"); led0->output = 8; } else if (c == 'g') { period = 996; // G4, 392.00 Hz, maybe - uart_writen(uart0, "G4\r\n", 4); + log("G4\r\n"); led0->output = 16; } else if (c == 'a') { period = 887; // A4, 440.00 Hz, maybe - uart_writen(uart0, "A4\r\n", 4); + log("A4\r\n"); led0->output = 32; } else if (c == 'b') { period = 791; // B4, 493.88 Hz, maybe - uart_writen(uart0, "B4\r\n", 4); + log("B4\r\n"); led0->output = 64; } else { led0->output = 37;