Core Base Classes for the Light Endpoints

Dependencies:   BufferedSerial

Dependents:   mbed_mqtt_endpoint_ublox_ethernet mbed_mqtt_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_cellular mbed_nsp_endpoint_ublox_ethernet ... more

Revision:
143:1388cb37c27e
Parent:
142:b7a75144b0f1
Child:
144:e4d24c2c8f18
--- a/ExternalLEDLight.cpp	Mon Mar 31 20:37:35 2014 +0000
+++ b/ExternalLEDLight.cpp	Tue Apr 01 22:25:46 2014 +0000
@@ -17,6 +17,10 @@
  */
  
  #include "ExternalLEDLight.h"
+ 
+ #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) {
@@ -50,15 +54,23 @@
         if (this->m_state == 0) {
             // just turn the LED off
             *(this->m_led) = 0;
+#ifdef COPCAR_PERSONALITY
+            _ext_led_extra_pwm = 0;
+#endif
         }
         else {
             // turn the LED on - but re-adjust for the current dim setting:
             //  - if the dimming is set to 0, then lets go ahead and make the light full bright...
             //  - otherwise we wont see the transition change. 
-            if (this->m_dim == 0.0)
+            if (this->m_dim == 0.0) {
                 *(this->m_led) = 1;
-            else
+#ifdef COPCAR_PERSONALITY
+                _ext_led_extra_pwm = 1;
+#endif
+            }
+            else {
                 *(this->m_led) = this->m_dim;
+            }
         }
     }
  }
\ No newline at end of file