Mirror with some correction

Dependencies:   mbed FastIO FastPWM USBDevice

Revision:
93:177832c29041
Parent:
92:f264fbaa1be5
Child:
94:0476b3e2b996
--- a/main.cpp	Thu Dec 14 00:20:20 2017 +0000
+++ b/main.cpp	Sun Jan 28 00:33:38 2018 +0000
@@ -1431,6 +1431,9 @@
         // add myself to the list of polled outputs for periodic updates
         if (numPolledPwm < countof(polledPwm))
             polledPwm[numPolledPwm++] = this;
+            
+        // set 5ms (200Hz) cycle time
+        p.getUnit()->period(0.005f);
 
         // set the initial value
         set(initVal);
@@ -1486,8 +1489,8 @@
 uint64_t polledPwmTotalTime, polledPwmRunCount;
 void pollPwmUpdates()
 {
-    // if it's been at least 25ms since the last update, do another update
-    if (polledPwmTimer.read_us() >= 25000)
+    // if it's been at least 7.5ms since the last update, do another update
+    if (polledPwmTimer.read_us() >= 7500)
     {
         // time the run for statistics collection
         IF_DIAG(