From ea109d622dffe7329fb70330f7ac52bc68336b80 Mon Sep 17 00:00:00 2001 From: Alvaro Prieto Date: Tue, 15 Dec 2015 20:58:52 -0800 Subject: [PATCH] Make heartbeat LED a shorter pulse (since we're using the blue LED) --- fw/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fw/main.c b/fw/main.c index cc40239..4bef6ed 100644 --- a/fw/main.c +++ b/fw/main.c @@ -17,7 +17,8 @@ #include "dac.h" #include "pwm.h" -#define BLINK_DELAY_MS (500) +#define LED_ON_MS (10) +#define LED_OFF_MS (990) volatile uint32_t tickMs = 0; __ALIGN_BEGIN USB_OTG_CORE_HANDLE USB_OTG_dev __ALIGN_END; @@ -42,17 +43,19 @@ int main(void) { // Disable line buffering on stdout setbuf(stdout, NULL); - nextBlink = tickMs + BLINK_DELAY_MS; + nextBlink = tickMs + LED_OFF_MS; for(;;) { consoleProcess(); if(tickMs > nextBlink) { - nextBlink = tickMs + BLINK_DELAY_MS; + if(blinkState) { GPIO_SetBits(GPIOD, GPIO_Pin_15); + nextBlink = tickMs + LED_ON_MS; } else { GPIO_ResetBits(GPIOD, GPIO_Pin_15); + nextBlink = tickMs + LED_OFF_MS; } blinkState ^= 1; }