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: Light.cpp
- Revision:
- 160:24337c83dd1d
- Parent:
- 146:8c05a119d9d4
- Child:
- 167:2529c18d0eb1
--- a/Light.cpp Mon Jun 30 22:17:32 2014 +0000 +++ b/Light.cpp Tue Jul 01 17:12:18 2014 +0000 @@ -39,7 +39,9 @@ this->m_forward = true; // setup the blinking thread + #ifdef ENABLE_THREADS this->m_blinking_thread = NULL; + #endif this->m_is_blinking = false; // Setup Philips Light if enabled @@ -136,17 +138,21 @@ // start blinking thread void Light::startBlinkingThread() { + #ifdef ENABLE_THREADS if (this->m_blinking_thread == NULL) this->m_blinking_thread = new Thread(blinking_action); + #endif } // stop blinking thread void Light::stopBlinkingThread() { + #ifdef ENABLE_THREADS if (this->m_blinking_thread != NULL) { this->m_blinking_thread->terminate(); delete this->m_blinking_thread; } this->m_blinking_thread = NULL; + #endif } // update our blinking sequencing to properly mesh with the lights current state