diff --git a/Multiprotocol/DSM_cyrf6936.ino b/Multiprotocol/DSM_cyrf6936.ino index 8d96bc1..f8a1af3 100644 --- a/Multiprotocol/DSM_cyrf6936.ino +++ b/Multiprotocol/DSM_cyrf6936.ino @@ -298,7 +298,7 @@ uint16_t DSM_callback() #define DSM_READ_DELAY 600 // Time before write to check read phase, and switch channels. Was 400 but 600 seems what the 328p needs to read a packet #if defined DSM_TELEMETRY uint8_t rx_phase; - uint8_t len; + uint8_t length; #endif uint8_t start; //debugln("P=%d",phase); @@ -474,15 +474,15 @@ uint16_t DSM_callback() if((rx_phase & 0x07) == 0x02) { // good data (complete with no errors) CYRF_WriteRegister(CYRF_07_RX_IRQ_STATUS, 0x80); // need to set RXOW before data read - len=CYRF_ReadRegister(CYRF_09_RX_COUNT); - if(len>TELEMETRY_BUFFER_SIZE-2) - len=TELEMETRY_BUFFER_SIZE-2; - CYRF_ReadDataPacketLen(packet_in+1, len); + length=CYRF_ReadRegister(CYRF_09_RX_COUNT); + if(length>TELEMETRY_BUFFER_SIZE-2) + length=TELEMETRY_BUFFER_SIZE-2; + CYRF_ReadDataPacketLen(packet_in+1, length); #ifdef DSM_DEBUG_FWD_PGM //debug(" %02X", packet_in[1]); if(packet_in[1]==9) { - for(uint8_t i=0;i