pwm period is now 200us instead of the default 20ms veml6040 config is now AF_BIT | TRIG_BIT

Dependencies:   mbed MMA8451Q USBDevice WakeUp vt100

Fork of afero_node_suntory_2017_06_15 by Orefatoi

Revision:
6:88cc04eb613a
Parent:
5:9d5c7ee80f3b
Child:
21:d03c7bbb9f37
--- a/afLib/afLib.cpp	Tue Feb 28 02:09:06 2017 +0000
+++ b/afLib/afLib.cpp	Wed Mar 22 23:39:41 2017 +0000
@@ -150,6 +150,10 @@
  * complete one attribute operation.
  */
 void afLib::loop(void) {
+    if (isIdle())
+    {
+        deathWish.attach(&afLib::kick_the_bucket,10);
+    }
     if (isIdle() && (queueGet(&_request.messageType, &_request.requestId, &_request.attrId, &_request.valueLen,
                               &_request.p_value) == afSUCCESS)) {
         switch (_request.messageType) {
@@ -427,6 +431,7 @@
     if (_interrupts_pending > 0) {
         switch (_state) {
             case STATE_IDLE:
+                //deathWish.attach(&afLib::kick_the_bucket,10);
                 onStateIdle();
                 return;
 
@@ -457,12 +462,20 @@
             updateIntsPending(1);
         } else if (syncRetries >= MAX_SYNC_RETRIES) {
             SERIAL_PRINT_DBG_ASR("No response from ASR-1 - does profile have MCU enabled?\n");
+#if defined(TARGET_KL25Z)
+            wtd.kick_the_bucket();
+#endif //TARGET_KL25Z
             syncRetries = 0;
             _state = STATE_IDLE;
         }
     }
 }
 
+void afLib::kick_the_bucket()
+{
+    wtd.kick_the_bucket();
+}
+
 /**
  * onStateIdle
  *