mixer_interrupt branch merged to trunk

timers on stock board should be more accurate
This commit is contained in:
bsongis
2012-06-18 13:38:31 +00:00
parent 963b07439b
commit 342b643661
9 changed files with 233 additions and 120 deletions
+6
View File
@@ -204,6 +204,12 @@ void setupPulsesPPM(uint8_t proto)
uint8_t p = (proto == PROTO_PPM16 ? 16 : 8) + (g_model.ppmNCH * 2); //Channels *2
uint16_t q = (g_model.ppmDelay*50+300)*2; // Stoplen *2
uint32_t rest = 22500u*2 - q; // Minimum Framelen=22.5ms
#if defined(PCBV4)
OCR5A = (uint16_t)0x7d * (45+g_model.ppmFrameLength-g_timeMainLast-2/*1ms*/);
TCNT5 = 0;
#endif
rest += (int32_t(g_model.ppmFrameLength))*1000;
for (uint8_t i=(proto==PROTO_PPM16) ? p-8 : 0; i<p; i++) {
#ifdef PPM_CENTER_ADJUSTABLE