From 66deb5e24dfa3c6a5b491f1045145ea78a15c8a3 Mon Sep 17 00:00:00 2001 From: Toyomasa Watarai Date: Fri, 16 Aug 2013 21:06:51 +0900 Subject: [PATCH 1/2] Added LPC1114 support and fixed hard fault --- libraries/tests/mbed/timeout/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/tests/mbed/timeout/main.cpp b/libraries/tests/mbed/timeout/main.cpp index c3181de354..64bff0fb27 100644 --- a/libraries/tests/mbed/timeout/main.cpp +++ b/libraries/tests/mbed/timeout/main.cpp @@ -11,6 +11,9 @@ DigitalOut out(PTB1); #elif defined(TARGET_LPC812) DigitalOut out(P0_12); +#elif defined(TARGET_LPC1114) +DigitalOut out(LED2); + #else DigitalOut out(p5); #endif @@ -22,15 +25,18 @@ void toggleOff (void); void toggleOn (void) { out = 1; led = 1; + timer.detach(); timer.attach_us(toggleOff, 10000); } void toggleOff(void) { out = 0; led = 0; + timer.detach(); timer.attach_us(toggleOn, 30000); } int main() { toggleOn(); + while(1); } From c26d2a990daa8ec00cb30b9c0cfbd2da5b2c5d11 Mon Sep 17 00:00:00 2001 From: Toyomasa Watarai Date: Fri, 16 Aug 2013 21:47:42 +0900 Subject: [PATCH 2/2] Removed detach() call in test case --- libraries/tests/mbed/timeout/main.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/libraries/tests/mbed/timeout/main.cpp b/libraries/tests/mbed/timeout/main.cpp index 64bff0fb27..7f46886efa 100644 --- a/libraries/tests/mbed/timeout/main.cpp +++ b/libraries/tests/mbed/timeout/main.cpp @@ -25,14 +25,12 @@ void toggleOff (void); void toggleOn (void) { out = 1; led = 1; - timer.detach(); timer.attach_us(toggleOff, 10000); } void toggleOff(void) { out = 0; led = 0; - timer.detach(); timer.attach_us(toggleOn, 30000); }