mbed library sources. Supersedes mbed-src.

Dependents:   SPIne CH_Communicatuin_Test CH_Communicatuin_Test2 MCP_SPIne ... more

Fork of mbed-dev-f303 by Ben Katz

Revision:
174:b96e65c34a4d
Parent:
163:74e0ce7f98e8
diff -r e131a1973e81 -r b96e65c34a4d platform/mbed_board.c
--- a/platform/mbed_board.c	Fri Sep 15 14:59:18 2017 +0100
+++ b/platform/mbed_board.c	Mon Oct 02 15:33:19 2017 +0100
@@ -30,39 +30,22 @@
 #if !defined (NRF51_H) && !defined(TARGET_EFM32)
     core_util_critical_section_enter();
 #endif
-#if   (DEVICE_ERROR_RED == 1)
-    gpio_t led_red; gpio_init_out(&led_red, LED_RED);
-#elif (DEVICE_ERROR_PATTERN == 1)
-    gpio_t led_1; gpio_init_out(&led_1, LED1);
-    gpio_t led_2; gpio_init_out(&led_2, LED2);
-    gpio_t led_3; gpio_init_out(&led_3, LED3);
-    gpio_t led_4; gpio_init_out(&led_4, LED4);
-#endif
+    gpio_t led_err; gpio_init_out(&led_err, LED1);
 
     while (1) {
-#if   (DEVICE_ERROR_RED == 1)
-        gpio_write(&led_red, 1);
-
-#elif (DEVICE_ERROR_PATTERN == 1)
-        gpio_write(&led_1, 1);
-        gpio_write(&led_2, 0);
-        gpio_write(&led_3, 0);
-        gpio_write(&led_4, 1);
-#endif
-
-        wait_ms(150);
+        for (int i = 0; i < 4; ++i) {
+            gpio_write(&led_err, 1);
+            wait_ms(150);
+            gpio_write(&led_err, 0);
+            wait_ms(150);
+        }
 
-#if   (DEVICE_ERROR_RED == 1)
-        gpio_write(&led_red, 0);
-
-#elif (DEVICE_ERROR_PATTERN == 1)
-        gpio_write(&led_1, 0);
-        gpio_write(&led_2, 1);
-        gpio_write(&led_3, 1);
-        gpio_write(&led_4, 0);
-#endif
-
-        wait_ms(150);
+        for (int i = 0; i < 4; ++i) {
+            gpio_write(&led_err, 1);
+            wait_ms(400);
+            gpio_write(&led_err, 0);
+            wait_ms(400);
+        }
     }
 }