Port from ppm42ms branch

This commit is contained in:
bsongis
2012-06-07 09:56:11 +00:00
parent 88cd8e4027
commit 17409f04ed
3 changed files with 30 additions and 55 deletions
+2 -2
View File
@@ -159,8 +159,8 @@ void setupPulsesPPM() // Don't enable interrupts through here
else
pwmptr->PWM_CH_NUM[3].PWM_CMR &= ~0x00000200 ; // CPOL
uint16_t rest = 22500u * 2; //Minimum Framelen=22.5 ms
rest += (int16_t(g_model.ppmFrameLength)) * 1000;
uint32_t rest = 22500u * 2; //Minimum Framelen=22.5 ms
rest += (int32_t(g_model.ppmFrameLength)) * 1000;
for (uint32_t i = 0; i < p; i++) { //NUM_CHNOUT
int16_t v = limit((int16_t)-PPM_range, g_chans512[i], (int16_t)PPM_range) + 2*PPM_CENTER;
rest -= (v);