Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed CANBuffer Watchdog MODSERIAL mbed-rtos xbeeRelay IAP
Fork of SystemManagement by
Diff: Libs/IMD/IMD.cpp
- Revision:
- 38:8efacce315ae
- Parent:
- 36:0afc0fc8f86b
diff -r 2207b58b9a7f -r 8efacce315ae Libs/IMD/IMD.cpp
--- 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() {
