diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 1a4de99..e33b83f 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 1 #define VERSION_REVISION 6 -#define VERSION_PATCH_LEVEL 43 +#define VERSION_PATCH_LEVEL 44 //****************** // Protocols //****************** @@ -238,16 +238,17 @@ struct PPM_Parameters // Telemetry -enum MultiPacketTypes { - MULTI_TELEMETRY_STATUS = 1, - MULTI_TELEMETRY_SPORT = 2, - MULTI_TELEMETRY_HUB = 3, - MULTI_TELEMETRY_DSM = 4, - MULTI_TELEMETRY_DSMBIND = 5, - MULTI_TELEMETRY_AFHDS2A = 6, - MULTI_TELEMETRY_CONFIG = 7, - MULTI_TELEMETRY_SYNC = 8, - MULTI_TELEMETRY_SPORT_POLLING = 9, +enum MultiPacketTypes +{ + MULTI_TELEMETRY_STATUS = 1, + MULTI_TELEMETRY_SPORT = 2, + MULTI_TELEMETRY_HUB = 3, + MULTI_TELEMETRY_DSM = 4, + MULTI_TELEMETRY_DSMBIND = 5, + MULTI_TELEMETRY_AFHDS2A = 6, + MULTI_TELEMETRY_CONFIG = 7, + MULTI_TELEMETRY_SYNC = 8, + MULTI_TELEMETRY_SPORT_POLLING = 9, }; // Macros diff --git a/Multiprotocol/Multiprotocol.ino b/Multiprotocol/Multiprotocol.ino index b4e8f57..8c6a7d1 100644 --- a/Multiprotocol/Multiprotocol.ino +++ b/Multiprotocol/Multiprotocol.ino @@ -1537,7 +1537,12 @@ static uint32_t random_id(uint16_t address, uint8_t create_new) if(discard_frame==1) { #ifdef STM32_BOARD - timer.detachInterrupt(TIMER_CH2); // Disable interrupt on ch2 + //For whatever reason the line below does not stop the interrupt to be called + //timer.detachInterrupt(TIMER_CH2); // Disable interrupt on ch2 + //So I'm pushing the comparator out (32ms from now) so it does not come to interfer + uint16_t OCR1B; + OCR1B=TCNT1; + timer.setCompare(TIMER_CH2,OCR1B); #else CLR_TIMSK1_OCIE1B; // Disable interrupt on compare B match #endif @@ -1561,7 +1566,9 @@ static uint32_t random_id(uint16_t address, uint8_t create_new) { // Timer1 compare B interrupt discard_frame=1; #ifdef STM32_BOARD - timer.detachInterrupt(TIMER_CH2); // Disable interrupt on ch2 + //For whatever reason the line below does not stop the interrupt to be called + //timer.detachInterrupt(TIMER_CH2); // Disable interrupt on ch2 + //So I leave the comparator as it is (32ms from now) so it does not come to interfer debugln("Bad frame timer"); #else CLR_TIMSK1_OCIE1B; // Disable interrupt on compare B match