LED: Introduce LED blinking pattern code

It might be useful to display some different blinking patterns to
indicate specific system state (such as DFU mode vs. regular firmware)
This commit is contained in:
Harald Welte
2017-03-06 16:58:00 +01:00
parent 054216d94d
commit abba8a8d85
6 changed files with 295 additions and 255 deletions

View File

@@ -177,10 +177,9 @@ extern int main(void)
uint8_t isUsbConnected = 0;
unsigned int i = 0;
LED_Configure(LED_NUM_RED);
LED_Configure(LED_NUM_GREEN);
LED_Set(LED_NUM_RED);
led_init();
led_blink(LED_GREEN, BLINK_3O_30F);
led_blink(LED_RED, BLINK_3O_30F);
/* Enable watchdog for 500ms, with no window */
WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT |
@@ -243,8 +242,6 @@ extern int main(void)
}
} else if (isUsbConnected == 0) {
TRACE_INFO("USB is now configured\n\r");
LED_Set(LED_NUM_GREEN);
LED_Clear(LED_NUM_RED);
isUsbConnected = 1;
}