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: ExternalLEDLight.cpp
- Revision:
- 144:e4d24c2c8f18
- Parent:
- 143:1388cb37c27e
- Child:
- 192:54b758a8eaaa
diff -r 1388cb37c27e -r e4d24c2c8f18 ExternalLEDLight.cpp --- a/ExternalLEDLight.cpp Tue Apr 01 22:25:46 2014 +0000 +++ b/ExternalLEDLight.cpp Wed Apr 02 00:43:37 2014 +0000 @@ -18,9 +18,9 @@ #include "ExternalLEDLight.h" - #ifdef COPCAR_PERSONALITY - PwmOut _ext_led_extra_pwm(EXT_LED_PIN_COPCAR); - #endif + //#ifdef COPCAR_PERSONALITY + // PwmOut _ext_led_extra_pwm(EXT_LED_PIN_COPCAR); + //#endif // default constructor ExternalLEDLight::ExternalLEDLight(PwmOut *led,ErrorHandler *error_handler) : BaseClass(error_handler,NULL) { @@ -32,6 +32,7 @@ // destructor ExternalLEDLight::~ExternalLEDLight() { + if (this->m_led != NULL) delete this->m_led; } // turn the light on @@ -54,9 +55,9 @@ if (this->m_state == 0) { // just turn the LED off *(this->m_led) = 0; -#ifdef COPCAR_PERSONALITY - _ext_led_extra_pwm = 0; -#endif +//#ifdef COPCAR_PERSONALITY +// _ext_led_extra_pwm = 0; +//#endif } else { // turn the LED on - but re-adjust for the current dim setting: @@ -64,9 +65,9 @@ // - otherwise we wont see the transition change. if (this->m_dim == 0.0) { *(this->m_led) = 1; -#ifdef COPCAR_PERSONALITY - _ext_led_extra_pwm = 1; -#endif +//#ifdef COPCAR_PERSONALITY +// _ext_led_extra_pwm = 1; +//#endif } else { *(this->m_led) = this->m_dim;