Fix all compilation issues (?)

This commit is contained in:
pascallanger 2019-11-11 19:15:39 +01:00
parent f800b4f90b
commit db442d81dd
56 changed files with 204 additions and 103 deletions

View File

@ -321,7 +321,9 @@ uint16_t ReadAFHDS2A()
packet_type = AFHDS2A_PACKET_STICKS;
phase = AFHDS2A_DATA;
case AFHDS2A_DATA:
#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;

View File

@ -127,7 +127,9 @@ uint16_t ASSAN_callback()
phase=ASSAN_DATA2;
return 2000;
case ASSAN_DATA2:
#ifdef MULTI_SYNC
telemetry_set_input_sync(12000);
#endif
case ASSAN_DATA3:
ASSAN_send_packet();
phase++; // DATA 3 or 4

View File

@ -299,7 +299,9 @@ uint16_t BUGSMINI_callback()
phase = BUGSMINI_BIND1;
return BUGSMINI_PACKET_INTERVAL - BUGSMINI_WRITE_WAIT;
case BUGSMINI_DATA1:
#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);

View File

@ -284,7 +284,9 @@ uint16_t BAYANG_callback()
{
if(packet_count==0)
{
#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++;

View File

@ -385,7 +385,9 @@ uint16_t ReadBUGS(void)
break;
case BUGS_DATA_1:
#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);

View File

@ -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
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
return packet_period;
}
else if (bind_counter == 0)

View File

@ -781,7 +781,9 @@ static uint16_t cflie_callback()
break;
case CFLIE_DATA:
#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) {

View File

@ -139,7 +139,9 @@ uint16_t CG023_callback()
{
if(IS_BIND_DONE)
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
CG023_send_packet(0);
}
else

View File

@ -229,7 +229,9 @@ uint16_t CX10_callback()
}
break;
case CX10_DATA:
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
CX10_Write_Packet(0);
break;
}

View File

@ -258,7 +258,9 @@ static uint16_t __attribute__((unused)) CORONA_build_packet()
uint16_t ReadCORONA()
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(22000);
#endif
// Tune frequency if it has been changed
if ( prev_option != option )
{

View File

@ -114,7 +114,9 @@ uint16_t DM002_callback()
{
if(IS_BIND_DONE)
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(DM002_PACKET_PERIOD);
#endif
DM002_send_packet(0);
}
else

View File

@ -455,7 +455,9 @@ uint16_t ReadDsm()
DSM_set_sop_data_crc();
return 10000;
case DSM_CH1_WRITE_A:
#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:

View File

@ -272,7 +272,9 @@ uint16_t devo_callback()
static uint8_t txState=0;
if (txState == 0)
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(2400);
#endif
txState = 1;
DEVO_BuildPacket();
CYRF_WriteDataPacket(packet);

View File

@ -288,7 +288,9 @@ uint16_t E01X_callback()
}
else
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
E01X_send_packet(0);
}
return packet_period;

View File

@ -152,7 +152,9 @@ uint16_t ESKY150_callback()
{
if(IS_BIND_DONE)
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(ESKY150_SENDING_PACKET_PERIOD);
#endif
ESKY150_send_packet();
}
else

View File

@ -136,7 +136,9 @@ uint16_t ESKY_callback()
{
if(IS_BIND_DONE)
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(ESKY_PACKET_PERIOD);
#endif
ESKY_send_packet(0);
}
else

View File

@ -189,7 +189,9 @@ uint16_t FQ777_callback()
}
else
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(FQ777_PACKET_PERIOD);
#endif
FQ777_send_packet(0);
}
return FQ777_PACKET_PERIOD;

View File

@ -188,7 +188,9 @@ uint16_t FY326_callback()
return FY326_PACKET_CHKTIME;
break;
case FY326_DATA:
#ifdef MULTI_SYNC
telemetry_set_input_sync(FY326_PACKET_PERIOD);
#endif
FY326_send_packet(0);
break;
}

View File

@ -168,7 +168,9 @@ uint16_t ReadFlySky()
}
else
{
#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();

View File

@ -55,7 +55,9 @@ uint16_t ReadFlyzone()
if(phase>19)
{
phase=0;
#ifdef MULTI_SYNC
telemetry_set_input_sync(20*1500);
#endif
flyzone_build_packet();
A7105_WriteData(8, hopping_frequency[0]);
A7105_SetPower();

View File

@ -153,7 +153,9 @@ uint16_t ReadFrSky_2way()
{
if (state == FRSKY_DATA1)
{
#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
{

View File

@ -117,7 +117,9 @@ uint16_t ReadFRSKYV()
{
if(IS_BIND_DONE)
{ // Normal operation
#ifdef MULTI_SYNC
telemetry_set_input_sync(9006);
#endif
uint8_t chan = FRSKYV_calc_channel();
CC2500_Strobe(CC2500_SIDLE);
if (option != prev_option)

View File

@ -304,7 +304,9 @@ uint16_t ReadFrSkyX()
state++; //FRSKY_DATA1
break;
case FRSKY_DATA5:
#ifdef MULTI_SYNC
telemetry_set_input_sync(9000);
#endif
#if defined TELEMETRY
telemetry_link=1; //Send telemetry out anyway
#endif

View File

@ -208,7 +208,9 @@ uint16_t GD00X_callback()
if(--bind_counter==0)
BIND_DONE;
GD00X_send_packet();
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
return packet_period;
}

View File

@ -139,7 +139,9 @@ uint16_t GW008_callback()
return 5000;
break;
case GW008_DATA:
#ifdef MULTI_SYNC
telemetry_set_input_sync(GW008_PACKET_PERIOD);
#endif
GW008_send_packet(0);
break;
}

View File

@ -178,7 +178,9 @@ uint16_t H8_3D_callback()
{
if(IS_BIND_DONE)
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
H8_3D_send_packet(0);
}
else

View File

@ -275,7 +275,9 @@ uint16_t ReadHOTT()
/* Work cycle: 10ms */
case HOTT_DATA1:
//TX
#ifdef MULTI_SYNC
telemetry_set_input_sync(HOTT_PACKET_PERIOD);
#endif
HOTT_tune_freq();
HOTT_tune_chan_fast();
HOTT_data_packet();

View File

@ -151,7 +151,9 @@ uint16_t hisky_cb()
phase=6;
break;
case 7: // build packet
#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
@ -218,7 +220,9 @@ uint16_t hisky_cb()
break;
case 7:
//Build normal packet
#ifdef MULTI_SYNC
telemetry_set_input_sync(9000);
#endif
build_ch_data();
break;
case 8:

View File

@ -259,7 +259,9 @@ uint16_t ReadHITEC()
case HITEC_PREP:
if ( prev_option == option )
{ // No user frequency change
#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)

View File

@ -243,7 +243,9 @@ uint16_t HONTAI_callback()
}
else
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
HONTAI_send_packet(0);
}

View File

@ -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

View File

@ -201,7 +201,9 @@ uint16_t ReadJ6Pro()
cyrf_datainit();
phase = J6PRO_CHAN_1;
case J6PRO_CHAN_1:
#ifdef MULTI_SYNC
telemetry_set_input_sync(24550);
#endif
//Keep transmit power updated
CYRF_SetPower(0x28);
j6pro_build_data_packet();

View File

@ -86,7 +86,9 @@ static void __attribute__((unused)) KF606_init()
uint16_t KF606_callback()
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(KF606_PACKET_PERIOD);
#endif
if(IS_BIND_IN_PROGRESS)
if(--bind_counter==0)
{

View File

@ -320,7 +320,9 @@ uint16_t kn_callback()
case KN_PHASE_SENDING:
if(packet_sent >= packet_count)
{
#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;

View File

@ -328,7 +328,9 @@ uint16_t MJXQ_callback()
{
if(IS_BIND_DONE)
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(MJXQ_PACKET_PERIOD);
#endif
MJXQ_send_packet(0);
}
else

View File

@ -223,7 +223,9 @@ uint16_t MT99XX_callback()
{
if(IS_BIND_DONE)
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
MT99XX_send_packet();
}
else

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_REVISION 0
#define VERSION_PATCH_LEVEL 43
#define VERSION_PATCH_LEVEL 44
//******************
// Protocols

View File

@ -55,10 +55,12 @@
#include <SPI.h>
#include <EEPROM.h>
HardwareTimer HWTimer2(2);
#ifdef ENABLE_SERIAL
HardwareTimer HWTimer3(3);
void ISR_COMPB();
#endif
void PPM_decode();
void ISR_COMPB();
extern "C"
{
void __irq_usart2(void);
@ -1876,20 +1878,15 @@ void modules_reset()
void init_HWTimer()
{
HWTimer2.pause(); // Pause the timer2 while we're configuring it
TIMER2_BASE->PSC = 35; // 36-1;for 72 MHZ /0.5sec/(35+1)
TIMER2_BASE->ARR = 0xFFFF; // Count until 0xFFFF
HWTimer2.setMode(TIMER_CH1, TIMER_OUTPUT_COMPARE); // Main scheduler
//HWTimer2.setMode(TIMER_CH2, TIMER_OUTPUT_COMPARE); // Serial check
TIMER2_BASE->SR = 0x1E5F & ~TIMER_SR_CC2IF; // Clear Timer2/Comp2 interrupt flag
//HWTimer2.attachInterrupt(TIMER_CH2,ISR_COMPB); // Assign function to Timer2/Comp2 interrupt
TIMER2_BASE->DIER &= ~TIMER_DIER_CC2IE; // Disable Timer2/Comp2 interrupt
HWTimer2.refresh(); // Refresh the timer's count, prescale, and overflow
HWTimer2.resume();
#ifdef ENABLE_SERIAL
HWTimer3.pause(); // Pause the timer3 while we're configuring it
TIMER3_BASE->PSC = 35; // 36-1;for 72 MHZ /0.5sec/(35+1)
TIMER3_BASE->ARR = 0xFFFF; // Count until 0xFFFF
@ -1899,6 +1896,7 @@ void modules_reset()
TIMER3_BASE->DIER &= ~TIMER_DIER_CC2IE; // Disable Timer3/Comp2 interrupt
HWTimer3.refresh(); // Refresh the timer's count, prescale, and overflow
HWTimer3.resume();
#endif
}
#endif

View File

@ -197,7 +197,9 @@ uint16_t NCC_callback()
phase = NCC_BIND_TX2;
return NCC_PACKET_INTERVAL - NCC_WRITE_WAIT;
case NCC_TX3:
#ifdef MULTI_SYNC
telemetry_set_input_sync(NCC_PACKET_INTERVAL);
#endif
if( NRF24L01_ReadReg(NRF24L01_07_STATUS) & _BV(NRF24L01_07_RX_DR))
{ // RX fifo data ready
NRF24L01_ReadPayload(packet, NCC_RX_PACKET_LEN);

View File

@ -109,7 +109,9 @@ uint16_t POTENSIC_callback()
BIND_DONE;
XN297_SetTXAddr(rx_tx_addr,5);
}
#ifdef MULTI_SYNC
telemetry_set_input_sync(POTENSIC_PACKET_PERIOD);
#endif
POTENSIC_send_packet();
return POTENSIC_PACKET_PERIOD;
}

View File

@ -355,7 +355,9 @@ uint16_t Q303_callback()
{
if(IS_BIND_DONE)
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
Q303_send_packet(0);
}
else

View File

@ -125,7 +125,9 @@ static uint16_t ReadREDPINE()
}
else
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(packet_period);
#endif
CC2500_SetTxRxMode(TX_EN);
REDPINE_set_channel(hopping_frequency_no);
CC2500_SetPower();

View File

@ -235,7 +235,9 @@ uint16_t ReadSFHSS()
#define SFHSS_PACKET_PERIOD 6800
#define SFHSS_DATA2_TIMING 1625 // Adjust this value between 1600 and 1650 if your RX(s) are not operating properly
case SFHSS_DATA1:
#ifdef MULTI_SYNC
telemetry_set_input_sync(6800);
#endif
SFHSS_build_data_packet();
SFHSS_send_packet();
phase = SFHSS_DATA2;

View File

@ -63,8 +63,10 @@ void SHENQI_send_packet()
}
else
{
#ifdef MULTI_SYNC
if(packet_count==1)
telemetry_set_input_sync(3000+2508+6*1750);
#endif
LT8900_SetAddress(rx_tx_addr,4);
packet[1]=255-convert_channel_8b(RUDDER);
packet[2]=255-convert_channel_16b_limit(THROTTLE,0x60,0xA0);

View File

@ -213,7 +213,9 @@ uint16_t SLT_callback()
switch (phase)
{
case SLT_BUILD:
#ifdef MULTI_SYNC
telemetry_set_input_sync(sub_protocol==SLT_V1?20000:13730);
#endif
SLT_build_packet();
phase++;
return SLT_TIMING_BUILD;

View File

@ -359,7 +359,9 @@ uint16_t symax_callback()
}
break;
case SYMAX_DATA:
#ifdef MULTI_SYNC
telemetry_set_input_sync(SYMAX_PACKET_PERIOD);
#endif
SYMAX_send_packet(0);
break;
}

View File

@ -162,7 +162,9 @@ uint16_t ReadTRAXXAS()
TRAXXAS_cyrf_data_config();
phase++;
case TRAXXAS_DATA:
#ifdef MULTI_SYNC
telemetry_set_input_sync(13940);
#endif
TRAXXAS_send_data_packet();
break;
}

View File

@ -76,9 +76,9 @@ static void multi_send_header(uint8_t type, uint8_t len)
Serial_write(len);
}
#ifdef MULTI_SYNC
static void telemetry_set_input_sync(uint16_t refreshRate)
{
#ifdef MULTI_SYNC
#if defined(STM32_BOARD) && defined(DEBUG_PIN)
static uint8_t c=0;
if (c++%2==0)
@ -100,10 +100,8 @@ static void telemetry_set_input_sync(uint16_t refreshRate)
// inputDelay = inputDelay - 0x8000;
last_serial_input=0;
}
#else
(void)refreshRate;
#endif
}
#endif
#ifdef MULTI_SYNC
static void mult_send_inputsync()
@ -1311,9 +1309,4 @@ ISR(TIMER0_OVF_vect)
#endif // BASH_SERIAL
#else
void telemetry_set_input_sync(uint16_t refreshRate)
{
(void)refreshRate;
}
#endif // TELEMETRY

View File

@ -264,7 +264,9 @@ uint16_t ReadV2x2()
case V202_DATA:
if (packet_sent && NRF24L01_packet_ack() != PKT_ACKED)
return V2X2_PACKET_CHKTIME;
#ifdef MULTI_SYNC
telemetry_set_input_sync(V2X2_PACKET_PERIOD);
#endif
V2X2_send_packet(0);
break;
}

View File

@ -174,7 +174,9 @@ uint16_t V761_callback()
}
return 15730;
case V761_DATA:
#ifdef MULTI_SYNC
telemetry_set_input_sync(V761_PACKET_PERIOD);
#endif
V761_send_packet();
break;
}

View File

@ -112,7 +112,9 @@ uint16_t V911S_callback()
{
if(IS_BIND_DONE)
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(V911S_PACKET_PERIOD);
#endif
V911S_send_packet(0);
}
else

View File

@ -323,6 +323,8 @@
#if not defined(HOTT_FW_TELEMETRY) && not defined(DSM_TELEMETRY) && not defined(SPORT_TELEMETRY) && not defined(HUB_TELEMETRY) && not defined(HUBSAN_HUB_TELEMETRY) && not defined(BUGS_HUB_TELEMETRY) && not defined(NCC1701_HUB_TELEMETRY) && not defined(BAYANG_HUB_TELEMETRY) && not defined(CABELL_HUB_TELEMETRY) && not defined(AFHDS2A_HUB_TELEMETRY) && not defined(AFHDS2A_FW_TELEMETRY) && not defined(MULTI_TELEMETRY) && not defined(MULTI_STATUS) && not defined(HITEC_HUB_TELEMETRY) && not defined(HITEC_FW_TELEMETRY) && not defined(SCANNER_TELEMETRY) && not defined(FRSKY_RX_TELEMETRY) && not defined(AFHDS2A_RX_TELEMETRY)
#undef TELEMETRY
#undef INVERT_TELEMETRY
#undef MULTI_TELEMETRY
#undef MULTI_STATUS
#endif
#endif
@ -330,10 +332,12 @@
#define SPORT_SEND
#endif
#if not defined(MULTI_TELEMETRY)
#if not defined(STM32_BOARD)
#if not defined(STM32_BOARD)
#undef MULTI_SYNC
#endif
#if not defined(MULTI_TELEMETRY)
#undef MULTI_SYNC
#endif
#undef MULTI_NAMES
#endif

View File

@ -232,7 +232,9 @@ uint16_t ReadWFLY()
packet_count=0;
phase++;
case WFLY_DATA:
#ifdef MULTI_SYNC
telemetry_set_input_sync(5371);
#endif
start=micros();
while ((uint8_t)((uint8_t)micros()-(uint8_t)start) < 200)
if((CYRF_ReadRegister(CYRF_02_TX_CTRL) & 0x80) == 0x00)

View File

@ -435,7 +435,9 @@ uint16_t WK_cb()
{
if (packet_sent == 0)
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(2800);
#endif
packet_sent = 1;
if(sub_protocol == WK2801)
WK_BuildPacket_2801();

View File

@ -156,7 +156,9 @@ uint16_t yd717_callback()
{
if(IS_BIND_DONE)
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(YD717_PACKET_PERIOD);
#endif
yd717_send_packet(0);
}
else

View File

@ -80,7 +80,9 @@ static void __attribute__((unused)) ZSX_init()
uint16_t ZSX_callback()
{
#ifdef MULTI_SYNC
telemetry_set_input_sync(ZSX_PACKET_PERIOD);
#endif
if(IS_BIND_IN_PROGRESS)
if(--bind_counter==0)
{