Skip to content

Commit

Permalink
Fix all compilation issues (?)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascallanger committed Nov 11, 2019
1 parent f800b4f commit db442d8
Show file tree
Hide file tree
Showing 56 changed files with 204 additions and 103 deletions.
4 changes: 3 additions & 1 deletion Multiprotocol/AFHDS2A_a7105.ino
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,9 @@ uint16_t ReadAFHDS2A()
packet_type = AFHDS2A_PACKET_STICKS;
phase = AFHDS2A_DATA;
case AFHDS2A_DATA:
telemetry_set_input_sync(3850);
#ifdef MULTI_SYNC
telemetry_set_input_sync(3850);
#endif
AFHDS2A_build_packet(packet_type);
if((A7105_ReadReg(A7105_00_MODE) & 0x01)) // Check if something has been received...
data_rx=0;
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/ASSAN_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ uint16_t ASSAN_callback()
phase=ASSAN_DATA2;
return 2000;
case ASSAN_DATA2:
telemetry_set_input_sync(12000);
#ifdef MULTI_SYNC
telemetry_set_input_sync(12000);
#endif
case ASSAN_DATA3:
ASSAN_send_packet();
phase++; // DATA 3 or 4
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/BUGSMINI_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ uint16_t BUGSMINI_callback()
phase = BUGSMINI_BIND1;
return BUGSMINI_PACKET_INTERVAL - BUGSMINI_WRITE_WAIT;
case BUGSMINI_DATA1:
telemetry_set_input_sync(BUGSMINI_PACKET_INTERVAL);
#ifdef MULTI_SYNC
telemetry_set_input_sync(BUGSMINI_PACKET_INTERVAL);
#endif
if( NRF24L01_ReadReg(NRF24L01_07_STATUS) & _BV(NRF24L01_07_RX_DR))
{ // RX fifo data ready => read only 12 bytes to not overwrite channel change flag
XN297_ReadPayload(packet, 12);
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/Bayang_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ uint16_t BAYANG_callback()
{
if(packet_count==0)
{
telemetry_set_input_sync((option & BAYANG_OPTION_FLAG_TELEMETRY)?5*BAYANG_PACKET_PERIOD:2*BAYANG_PACKET_PERIOD);
#ifdef MULTI_SYNC
telemetry_set_input_sync((option & BAYANG_OPTION_FLAG_TELEMETRY)?5*BAYANG_PACKET_PERIOD:2*BAYANG_PACKET_PERIOD);
#endif
BAYANG_send_packet(0);
}
packet_count++;
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/Bugs_a7105.ino
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,9 @@ uint16_t ReadBUGS(void)
break;

case BUGS_DATA_1:
telemetry_set_input_sync(BUGS_PACKET_PERIOD);
#ifdef MULTI_SYNC
telemetry_set_input_sync(BUGS_PACKET_PERIOD);
#endif
A7105_SetPower();
BUGS_build_packet(0);
A7105_WriteReg(A7105_03_FIFOI, BUGS_FIFO_SIZE_TX);
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/CABELL_nrf224l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,9 @@ uint16_t CABELL_callback()
if (IS_BIND_DONE)
{
CABELL_send_packet(0); // packet_period is set/adjusted in CABELL_send_packet
telemetry_set_input_sync(packet_period);
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
return packet_period;
}
else if (bind_counter == 0)
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/CFlie_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,9 @@ static uint16_t cflie_callback()
break;

case CFLIE_DATA:
telemetry_set_input_sync(CFLIE_PACKET_PERIOD);
#ifdef MULTI_SYNC
telemetry_set_input_sync(CFLIE_PACKET_PERIOD);
#endif
// if (Model.proto_opts[PROTOOPTS_TELEMETRY] == TELEM_ON_CRTPLOG) {
// update_telemetry_crtplog();
// } else if (Model.proto_opts[PROTOOPTS_TELEMETRY] == TELEM_ON_ACKPKT) {
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/CG023_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ uint16_t CG023_callback()
{
if(IS_BIND_DONE)
{
telemetry_set_input_sync(packet_period);
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
CG023_send_packet(0);
}
else
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/CX10_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ uint16_t CX10_callback()
}
break;
case CX10_DATA:
telemetry_set_input_sync(packet_period);
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
CX10_Write_Packet(0);
break;
}
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/Corona_cc2500.ino
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ static uint16_t __attribute__((unused)) CORONA_build_packet()

uint16_t ReadCORONA()
{
telemetry_set_input_sync(22000);
#ifdef MULTI_SYNC
telemetry_set_input_sync(22000);
#endif
// Tune frequency if it has been changed
if ( prev_option != option )
{
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/DM002_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ uint16_t DM002_callback()
{
if(IS_BIND_DONE)
{
telemetry_set_input_sync(DM002_PACKET_PERIOD);
#ifdef MULTI_SYNC
telemetry_set_input_sync(DM002_PACKET_PERIOD);
#endif
DM002_send_packet(0);
}
else
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/DSM_cyrf6936.ino
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,9 @@ uint16_t ReadDsm()
DSM_set_sop_data_crc();
return 10000;
case DSM_CH1_WRITE_A:
telemetry_set_input_sync(11000); // Always request 11ms spacing even if we don't use half of it in 22ms mode
#ifdef MULTI_SYNC
telemetry_set_input_sync(11000); // Always request 11ms spacing even if we don't use half of it in 22ms mode
#endif
case DSM_CH1_WRITE_B:
case DSM_CH2_WRITE_A:
case DSM_CH2_WRITE_B:
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/Devo_cyrf6936.ino
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ uint16_t devo_callback()
static uint8_t txState=0;
if (txState == 0)
{
telemetry_set_input_sync(2400);
#ifdef MULTI_SYNC
telemetry_set_input_sync(2400);
#endif
txState = 1;
DEVO_BuildPacket();
CYRF_WriteDataPacket(packet);
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/E01X_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ uint16_t E01X_callback()
}
else
{
telemetry_set_input_sync(packet_period);
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
E01X_send_packet(0);
}
return packet_period;
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/ESky150_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ uint16_t ESKY150_callback()
{
if(IS_BIND_DONE)
{
telemetry_set_input_sync(ESKY150_SENDING_PACKET_PERIOD);
#ifdef MULTI_SYNC
telemetry_set_input_sync(ESKY150_SENDING_PACKET_PERIOD);
#endif
ESKY150_send_packet();
}
else
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/ESky_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ uint16_t ESKY_callback()
{
if(IS_BIND_DONE)
{
telemetry_set_input_sync(ESKY_PACKET_PERIOD);
#ifdef MULTI_SYNC
telemetry_set_input_sync(ESKY_PACKET_PERIOD);
#endif
ESKY_send_packet(0);
}
else
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/FQ777_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ uint16_t FQ777_callback()
}
else
{
telemetry_set_input_sync(FQ777_PACKET_PERIOD);
#ifdef MULTI_SYNC
telemetry_set_input_sync(FQ777_PACKET_PERIOD);
#endif
FQ777_send_packet(0);
}
return FQ777_PACKET_PERIOD;
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/FY326_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ uint16_t FY326_callback()
return FY326_PACKET_CHKTIME;
break;
case FY326_DATA:
telemetry_set_input_sync(FY326_PACKET_PERIOD);
#ifdef MULTI_SYNC
telemetry_set_input_sync(FY326_PACKET_PERIOD);
#endif
FY326_send_packet(0);
break;
}
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/FlySky_a7105.ino
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ uint16_t ReadFlySky()
}
else
{
telemetry_set_input_sync(packet_period);
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
flysky_build_packet(0);
A7105_WriteData(21, hopping_frequency[hopping_frequency_no & 0x0F]);
A7105_SetPower();
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/Flyzone_a7105.ino
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ uint16_t ReadFlyzone()
if(phase>19)
{
phase=0;
telemetry_set_input_sync(20*1500);
#ifdef MULTI_SYNC
telemetry_set_input_sync(20*1500);
#endif
flyzone_build_packet();
A7105_WriteData(8, hopping_frequency[0]);
A7105_SetPower();
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/FrSkyD_cc2500.ino
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ uint16_t ReadFrSky_2way()
{
if (state == FRSKY_DATA1)
{
telemetry_set_input_sync(9000);
#ifdef MULTI_SYNC
telemetry_set_input_sync(9000);
#endif
len = CC2500_ReadReg(CC2500_3B_RXBYTES | CC2500_READ_BURST) & 0x7F;
if (len && len<=(0x11+3))// 20bytes
{
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/FrSkyV_cc2500.ino
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ uint16_t ReadFRSKYV()
{
if(IS_BIND_DONE)
{ // Normal operation
telemetry_set_input_sync(9006);
#ifdef MULTI_SYNC
telemetry_set_input_sync(9006);
#endif
uint8_t chan = FRSKYV_calc_channel();
CC2500_Strobe(CC2500_SIDLE);
if (option != prev_option)
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/FrSkyX_cc2500.ino
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ uint16_t ReadFrSkyX()
state++; //FRSKY_DATA1
break;
case FRSKY_DATA5:
telemetry_set_input_sync(9000);
#ifdef MULTI_SYNC
telemetry_set_input_sync(9000);
#endif
#if defined TELEMETRY
telemetry_link=1; //Send telemetry out anyway
#endif
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/GD00X_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ uint16_t GD00X_callback()
if(--bind_counter==0)
BIND_DONE;
GD00X_send_packet();
telemetry_set_input_sync(packet_period);
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
return packet_period;
}

Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/GW008_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ uint16_t GW008_callback()
return 5000;
break;
case GW008_DATA:
telemetry_set_input_sync(GW008_PACKET_PERIOD);
#ifdef MULTI_SYNC
telemetry_set_input_sync(GW008_PACKET_PERIOD);
#endif
GW008_send_packet(0);
break;
}
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/H8_3D_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ uint16_t H8_3D_callback()
{
if(IS_BIND_DONE)
{
telemetry_set_input_sync(packet_period);
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
H8_3D_send_packet(0);
}
else
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/HOTT_cc2500.ino
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ uint16_t ReadHOTT()
/* Work cycle: 10ms */
case HOTT_DATA1:
//TX
telemetry_set_input_sync(HOTT_PACKET_PERIOD);
#ifdef MULTI_SYNC
telemetry_set_input_sync(HOTT_PACKET_PERIOD);
#endif
HOTT_tune_freq();
HOTT_tune_chan_fast();
HOTT_data_packet();
Expand Down
8 changes: 6 additions & 2 deletions Multiprotocol/Hisky_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ uint16_t hisky_cb()
phase=6;
break;
case 7: // build packet
telemetry_set_input_sync(5000);
#ifdef MULTI_SYNC
telemetry_set_input_sync(5000);
#endif
#ifdef FAILSAFE_ENABLE
if(IS_FAILSAFE_VALUES_on && hopping_frequency_no==0)
{ // send failsafe every 100ms
Expand Down Expand Up @@ -218,7 +220,9 @@ uint16_t hisky_cb()
break;
case 7:
//Build normal packet
telemetry_set_input_sync(9000);
#ifdef MULTI_SYNC
telemetry_set_input_sync(9000);
#endif
build_ch_data();
break;
case 8:
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/Hitec_cc2500.ino
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ uint16_t ReadHITEC()
case HITEC_PREP:
if ( prev_option == option )
{ // No user frequency change
telemetry_set_input_sync(HITEC_PACKET_PERIOD);
#ifdef MULTI_SYNC
telemetry_set_input_sync(HITEC_PACKET_PERIOD);
#endif
HITEC_change_chan_fast();
hopping_frequency_no++;
if(hopping_frequency_no>=rf_ch_num)
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/Hontai_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ uint16_t HONTAI_callback()
}
else
{
telemetry_set_input_sync(packet_period);
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
HONTAI_send_packet(0);
}

Expand Down
2 changes: 2 additions & 0 deletions Multiprotocol/Hubsan_a7105.ino
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ uint16_t ReadHubsan()
case DATA_4:
case DATA_5:
if( txState == 0) { // send packet
#ifdef MULTI_SYNC
telemetry_set_input_sync(10000);
#endif
#ifdef HUBSAN_HUB_TELEMETRY
rfMode = A7105_TX;
#endif
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/J6Pro_cyrf6936.ino
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ uint16_t ReadJ6Pro()
cyrf_datainit();
phase = J6PRO_CHAN_1;
case J6PRO_CHAN_1:
telemetry_set_input_sync(24550);
#ifdef MULTI_SYNC
telemetry_set_input_sync(24550);
#endif
//Keep transmit power updated
CYRF_SetPower(0x28);
j6pro_build_data_packet();
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/KF606_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ static void __attribute__((unused)) KF606_init()

uint16_t KF606_callback()
{
telemetry_set_input_sync(KF606_PACKET_PERIOD);
#ifdef MULTI_SYNC
telemetry_set_input_sync(KF606_PACKET_PERIOD);
#endif
if(IS_BIND_IN_PROGRESS)
if(--bind_counter==0)
{
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/KN_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ uint16_t kn_callback()
case KN_PHASE_SENDING:
if(packet_sent >= packet_count)
{
telemetry_set_input_sync(seed);
#ifdef MULTI_SYNC
telemetry_set_input_sync(seed);
#endif
packet_sent = 0;
hopping_frequency_no++;
if(hopping_frequency_no >= KN_RF_CH_COUNT) hopping_frequency_no = 0;
Expand Down
4 changes: 3 additions & 1 deletion Multiprotocol/MJXQ_nrf24l01.ino
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,9 @@ uint16_t MJXQ_callback()
{
if(IS_BIND_DONE)
{
telemetry_set_input_sync(MJXQ_PACKET_PERIOD);
#ifdef MULTI_SYNC
telemetry_set_input_sync(MJXQ_PACKET_PERIOD);
#endif
MJXQ_send_packet(0);
}
else
Expand Down
Loading

0 comments on commit db442d8

Please sign in to comment.