Fork to support REVB hardware.

Dependents:   C027_BootTest_revb C027_EthernetSniffTest C027_M3_SerialEcho C027_HelloWorld_revb ... more

Fork of C027 by u-blox

Files at this revision

API Documentation at this revision

Comitter:
mazgch
Date:
Sun Nov 10 18:44:53 2013 +0000
Parent:
10:bc9e2eb5daa8
Child:
12:31fb5ff9fef5
Commit message:
better blinky in case of errors

Changed in this revision

C027.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/C027.cpp	Wed Nov 06 10:23:53 2013 +0000
+++ b/C027.cpp	Sun Nov 10 18:44:53 2013 +0000
@@ -8,14 +8,24 @@
 
 void mbed_die(void)
 {
+#ifdef C027_REVA
+    DigitalOut led(A0);
+#else
     DigitalOut led(LED);
-    for (;;)
+#endif
+    led = 0;
+    // Send SOS in Morse Code: // "... --- ...  "
+    const char sos[] = "=.=.=...===.===.===...=.=.=......"; 
+    const int  dot = 100; // length of the dot in milliseconds (typical: 50-100 ms)
+    // lengths of symbols: 
+    // di         =   dot 
+    // dah        = 3 dot 
+    // char space = 3 dot 
+    // word space = 6 dot 
+    for (int i = 0; /* nothing */; i = sos[i+1] ? i+1 : 0)
     {
-        // nothing to do here
-        led = 0;
-        wait_ms(200);
-        led = 1;
-        wait_ms(200);
+        led = (sos[i] == '=');
+        wait_ms(dot);
     }
 }