System Management code

Dependencies:   mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP

Fork of SystemManagement by Martin Deng

Revision:
38:8efacce315ae
Parent:
36:0afc0fc8f86b
--- a/Libs/IMD/IMD.cpp	Thu Jan 22 07:59:48 2015 +0000
+++ b/Libs/IMD/IMD.cpp	Sat Feb 07 08:54:51 2015 +0000
@@ -2,11 +2,14 @@
 #include <math.h>
 #include "pinmap.h"
 
-static IMD* instance[4] = { 0 };    // Access member from static frame, one IMD permitted per timer module (4 total IMD objects)
+
+const float ZERO_HZ_TIMEOUT = 0.21;     // Time (sec) that must pass without an edge to call it 0 Hz, set to greater than the longest expected pulse width
+const float EXTRA = 0.02;               // Margin on the IMD PWM limits
 
-const uint32_t PCLK = 24000000;     // Timer counting clock = 24Mhz
+const uint32_t PCLK = 24000000;         // Timer counting clock = 24Mhz
 const uint32_t TIMEOUT_TICKS = PCLK*ZERO_HZ_TIMEOUT;    // Zeroing timeout in clock ticks = seconds * PCLK
-const float EXTRA = 0.01;           // Margin on the IMD PWM limits
+
+static IMD* instance[4] = { 0 };        // Access member from static frame, one IMD permitted per timer module (4 total IMD objects)
 
 // Interrupt functions, must be static context
 void tim0_IRQ() {