A PPM driver for the K64F that uses the CMT module

Revision:
1:9b1734761ce3
Parent:
0:04365c9c9994
--- a/PPMout.cpp	Fri Sep 02 11:48:31 2016 +0000
+++ b/PPMout.cpp	Fri Sep 02 16:01:52 2016 +0000
@@ -27,6 +27,9 @@
 
     // Constrain channel
     channel = PIN(channel, 0, (CHANNELS-1));
+    
+    // Correction
+    channel = (channel*2 + 1)%CHANNELS;
 
     // Calculate new step value
     int steps = (int) (RANGE_STEPS*value + ZERO_STEPS);