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 committed 2017-03-06 16:58:00 +01:00
1 parent 054216d94d
commit abba8a8d85
6 files changed
+295 -255

No files matched your search

+2 -5
View File
@@ -121,9 +121,8 @@ extern int main(void)
enum confNum last_simtrace_config = simtrace_config;
unsigned int i = 0;
LED_Configure(LED_NUM_RED);
LED_Configure(LED_NUM_GREEN);
LED_Set(LED_NUM_RED);
led_init();
led_blink(LED_RED, BLINK_3O_5F);
/* Enable watchdog for 500ms, with no window */
WDT_Enable(WDT, WDT_MR_WDRSTEN | WDT_MR_WDDBGHLT | WDT_MR_WDIDLEHLT |
@@ -195,8 +194,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;
}
+3 -6
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;
}