diff --git a/src/pulses_avr.cpp b/src/pulses_avr.cpp index 61d130ac9..13f0c7e31 100644 --- a/src/pulses_avr.cpp +++ b/src/pulses_avr.cpp @@ -49,7 +49,7 @@ uint16_t nextMixerEndTime = 0; #define BAD_DATA 0x47 #endif -uint8_t s_current_protocol = 255; +uint8_t s_current_protocol[1] = { 255 }; uint8_t s_pulses_paused = 0; uint16_t B3_comp_value; @@ -80,7 +80,7 @@ void startPulses() #endif #if defined(SIMU) - s_current_protocol = g_model.protocol; + s_current_protocol[0] = g_model.protocol; #else setupPulses(); #endif // SIMU @@ -107,10 +107,10 @@ ISR(TIMER1_COMPA_vect) //2MHz pulse generation (BLOCKING ISR) // Call setupPulses only after REST pulse had been sent. // Must do this before toggle PORTB to keep timing accurate - if (IS_DSM2_SERIAL_PROTOCOL(s_current_protocol) || *((uint16_t*)pulses2MHzRPtr) == 0) { + if (IS_DSM2_SERIAL_PROTOCOL(s_current_protocol[0]) || *((uint16_t*)pulses2MHzRPtr) == 0) { setupPulses(); // does not sei() for setupPulsesPPM heartbeat |= HEART_TIMER_PULSES; - if (IS_PXX_PROTOCOL(s_current_protocol) || IS_DSM2_PROTOCOL(s_current_protocol)) { + if (IS_PXX_PROTOCOL(s_current_protocol[0]) || IS_DSM2_PROTOCOL(s_current_protocol[0])) { // !PPM protocols interrupts don't need COMPA return; } @@ -118,7 +118,7 @@ ISR(TIMER1_COMPA_vect) //2MHz pulse generation (BLOCKING ISR) #if !defined(PCBGRUVIN9X) // Original bitbang for PPM - if (s_current_protocol != PROTO_NONE) { + if (s_current_protocol[0] != PROTO_NONE) { if (g_ppmPulsePolarity) { PORTB |= (1<