Core Base Classes for the Light Endpoints
Dependents: mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more
Diff: ErrorHandler.cpp
- Revision:
- 71:90bf61bc3727
- Parent:
- 70:055ebf51f6ad
- Child:
- 72:46c94966311b
--- a/ErrorHandler.cpp Mon Mar 03 22:27:08 2014 +0000 +++ b/ErrorHandler.cpp Mon Mar 03 22:39:48 2014 +0000 @@ -18,16 +18,6 @@ #include "ErrorHandler.h" - // Memory statistics macro - #define MEM_STATS(x) \ - int s##x=0;\ - int *h##x = new int [1];\ - this->m_pc->printf("\r\nMEMORY: stack: 0x%08x heap: 0x%08x avail: %d bytes\r\n", &s##x, h##x, &s##x-h##x);\ - if (h##x > &s##x)\ - error("collision\n");\ - delete [] h##x;\ - __nop() - // Annunciations DigitalOut led1(LED1); DigitalOut led2(LED2); @@ -39,7 +29,19 @@ PwmOut g (p24); PwmOut b (p25); -// close down connections +// Memory statistics macro +#ifdef ENABLE_MEMORY_DEBUG + #define MEM_STATS(x) \ + int s##x=0;\ + int *h##x = new int [1];\ + this->m_pc->printf("\r\nMEMORY: stack: 0x%08x heap: 0x%08x avail: %d bytes\r\n", &s##x, h##x, &s##x-h##x);\ + if (h##x > &s##x)\ + error("collision\n");\ + delete [] h##x;\ + __nop(); +#endif + + // close down connections extern void closedown(int code); // default constructor @@ -201,11 +203,11 @@ // blink an LED void ErrorHandler::blinkLED(DigitalOut led) { - this->m_led_mutex->lock(); + //this->m_led_mutex->lock(); led = 1; wait_ms(BLINK_TIME); led = 0; - this->m_led_mutex->unlock(); + //this->m_led_mutex->unlock(); } // blink the Transport TX LED