mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-07-01 01:57:52 +00:00
Fix all compilation issues (?)
This commit is contained in:
parent
f800b4f90b
commit
db442d81dd
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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++;
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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 )
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
@ -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:
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -223,7 +223,9 @@ uint16_t MT99XX_callback()
|
||||
{
|
||||
if(IS_BIND_DONE)
|
||||
{
|
||||
telemetry_set_input_sync(packet_period);
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(packet_period);
|
||||
#endif
|
||||
MT99XX_send_packet();
|
||||
}
|
||||
else
|
||||
|
@ -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
|
||||
|
@ -55,10 +55,12 @@
|
||||
#include <SPI.h>
|
||||
#include <EEPROM.h>
|
||||
HardwareTimer HWTimer2(2);
|
||||
HardwareTimer HWTimer3(3);
|
||||
#ifdef ENABLE_SERIAL
|
||||
HardwareTimer HWTimer3(3);
|
||||
void ISR_COMPB();
|
||||
#endif
|
||||
|
||||
void PPM_decode();
|
||||
void ISR_COMPB();
|
||||
extern "C"
|
||||
{
|
||||
void __irq_usart2(void);
|
||||
@ -1876,29 +1878,25 @@ 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();
|
||||
|
||||
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
|
||||
HWTimer3.setMode(TIMER_CH2, TIMER_OUTPUT_COMPARE); // Serial check
|
||||
TIMER3_BASE->SR = 0x1E5F & ~TIMER_SR_CC2IF; // Clear Timer3/Comp2 interrupt flag
|
||||
HWTimer3.attachInterrupt(TIMER_CH2,ISR_COMPB); // Assign function to Timer3/Comp2 interrupt
|
||||
TIMER3_BASE->DIER &= ~TIMER_DIER_CC2IE; // Disable Timer3/Comp2 interrupt
|
||||
HWTimer3.refresh(); // Refresh the timer's count, prescale, and overflow
|
||||
HWTimer3.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
|
||||
HWTimer3.setMode(TIMER_CH2, TIMER_OUTPUT_COMPARE); // Serial check
|
||||
TIMER3_BASE->SR = 0x1E5F & ~TIMER_SR_CC2IF; // Clear Timer3/Comp2 interrupt flag
|
||||
HWTimer3.attachInterrupt(TIMER_CH2,ISR_COMPB); // Assign function to Timer3/Comp2 interrupt
|
||||
TIMER3_BASE->DIER &= ~TIMER_DIER_CC2IE; // Disable Timer3/Comp2 interrupt
|
||||
HWTimer3.refresh(); // Refresh the timer's count, prescale, and overflow
|
||||
HWTimer3.resume();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -197,7 +197,9 @@ uint16_t NCC_callback()
|
||||
phase = NCC_BIND_TX2;
|
||||
return NCC_PACKET_INTERVAL - NCC_WRITE_WAIT;
|
||||
case NCC_TX3:
|
||||
telemetry_set_input_sync(NCC_PACKET_INTERVAL);
|
||||
#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);
|
||||
|
@ -109,7 +109,9 @@ uint16_t POTENSIC_callback()
|
||||
BIND_DONE;
|
||||
XN297_SetTXAddr(rx_tx_addr,5);
|
||||
}
|
||||
telemetry_set_input_sync(POTENSIC_PACKET_PERIOD);
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(POTENSIC_PACKET_PERIOD);
|
||||
#endif
|
||||
POTENSIC_send_packet();
|
||||
return POTENSIC_PACKET_PERIOD;
|
||||
}
|
||||
|
@ -355,7 +355,9 @@ uint16_t Q303_callback()
|
||||
{
|
||||
if(IS_BIND_DONE)
|
||||
{
|
||||
telemetry_set_input_sync(packet_period);
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(packet_period);
|
||||
#endif
|
||||
Q303_send_packet(0);
|
||||
}
|
||||
else
|
||||
|
@ -125,7 +125,9 @@ static uint16_t ReadREDPINE()
|
||||
}
|
||||
else
|
||||
{
|
||||
telemetry_set_input_sync(packet_period);
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(packet_period);
|
||||
#endif
|
||||
CC2500_SetTxRxMode(TX_EN);
|
||||
REDPINE_set_channel(hopping_frequency_no);
|
||||
CC2500_SetPower();
|
||||
|
@ -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:
|
||||
telemetry_set_input_sync(6800);
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(6800);
|
||||
#endif
|
||||
SFHSS_build_data_packet();
|
||||
SFHSS_send_packet();
|
||||
phase = SFHSS_DATA2;
|
||||
|
@ -63,8 +63,10 @@ void SHENQI_send_packet()
|
||||
}
|
||||
else
|
||||
{
|
||||
if(packet_count==1)
|
||||
telemetry_set_input_sync(3000+2508+6*1750);
|
||||
#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);
|
||||
|
@ -213,7 +213,9 @@ uint16_t SLT_callback()
|
||||
switch (phase)
|
||||
{
|
||||
case SLT_BUILD:
|
||||
telemetry_set_input_sync(sub_protocol==SLT_V1?20000:13730);
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(sub_protocol==SLT_V1?20000:13730);
|
||||
#endif
|
||||
SLT_build_packet();
|
||||
phase++;
|
||||
return SLT_TIMING_BUILD;
|
||||
|
@ -359,7 +359,9 @@ uint16_t symax_callback()
|
||||
}
|
||||
break;
|
||||
case SYMAX_DATA:
|
||||
telemetry_set_input_sync(SYMAX_PACKET_PERIOD);
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(SYMAX_PACKET_PERIOD);
|
||||
#endif
|
||||
SYMAX_send_packet(0);
|
||||
break;
|
||||
}
|
||||
|
@ -162,7 +162,9 @@ uint16_t ReadTRAXXAS()
|
||||
TRAXXAS_cyrf_data_config();
|
||||
phase++;
|
||||
case TRAXXAS_DATA:
|
||||
telemetry_set_input_sync(13940);
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(13940);
|
||||
#endif
|
||||
TRAXXAS_send_data_packet();
|
||||
break;
|
||||
}
|
||||
|
@ -76,34 +76,32 @@ 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)
|
||||
{ DEBUG_PIN_on; }
|
||||
else
|
||||
{ DEBUG_PIN_off; }
|
||||
#endif
|
||||
// Only record input Delay after a frame has really been received
|
||||
// Otherwise protocols with faster refresh rates then the TX sends (e.g. 3ms vs 6ms) will screw up the calcualtion
|
||||
inputRefreshRate = refreshRate;
|
||||
if (last_serial_input != 0)
|
||||
{
|
||||
cli(); // Disable global int due to RW of 16 bits registers
|
||||
inputDelay = TCNT1;
|
||||
sei(); // Enable global int
|
||||
//inputDelay = (inputDelay - last_serial_input)>>1;
|
||||
inputDelay -= last_serial_input;
|
||||
//if(inputDelay & 0x8000)
|
||||
// inputDelay = inputDelay - 0x8000;
|
||||
last_serial_input=0;
|
||||
}
|
||||
#else
|
||||
(void)refreshRate;
|
||||
#if defined(STM32_BOARD) && defined(DEBUG_PIN)
|
||||
static uint8_t c=0;
|
||||
if (c++%2==0)
|
||||
{ DEBUG_PIN_on; }
|
||||
else
|
||||
{ DEBUG_PIN_off; }
|
||||
#endif
|
||||
// Only record input Delay after a frame has really been received
|
||||
// Otherwise protocols with faster refresh rates then the TX sends (e.g. 3ms vs 6ms) will screw up the calcualtion
|
||||
inputRefreshRate = refreshRate;
|
||||
if (last_serial_input != 0)
|
||||
{
|
||||
cli(); // Disable global int due to RW of 16 bits registers
|
||||
inputDelay = TCNT1;
|
||||
sei(); // Enable global int
|
||||
//inputDelay = (inputDelay - last_serial_input)>>1;
|
||||
inputDelay -= last_serial_input;
|
||||
//if(inputDelay & 0x8000)
|
||||
// inputDelay = inputDelay - 0x8000;
|
||||
last_serial_input=0;
|
||||
}
|
||||
}
|
||||
#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
|
||||
|
@ -264,7 +264,9 @@ uint16_t ReadV2x2()
|
||||
case V202_DATA:
|
||||
if (packet_sent && NRF24L01_packet_ack() != PKT_ACKED)
|
||||
return V2X2_PACKET_CHKTIME;
|
||||
telemetry_set_input_sync(V2X2_PACKET_PERIOD);
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(V2X2_PACKET_PERIOD);
|
||||
#endif
|
||||
V2X2_send_packet(0);
|
||||
break;
|
||||
}
|
||||
|
@ -174,7 +174,9 @@ uint16_t V761_callback()
|
||||
}
|
||||
return 15730;
|
||||
case V761_DATA:
|
||||
telemetry_set_input_sync(V761_PACKET_PERIOD);
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(V761_PACKET_PERIOD);
|
||||
#endif
|
||||
V761_send_packet();
|
||||
break;
|
||||
}
|
||||
|
@ -112,7 +112,9 @@ uint16_t V911S_callback()
|
||||
{
|
||||
if(IS_BIND_DONE)
|
||||
{
|
||||
telemetry_set_input_sync(V911S_PACKET_PERIOD);
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(V911S_PACKET_PERIOD);
|
||||
#endif
|
||||
V911S_send_packet(0);
|
||||
}
|
||||
else
|
||||
|
@ -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(STM32_BOARD)
|
||||
#undef MULTI_SYNC
|
||||
#endif
|
||||
|
||||
#if not defined(MULTI_TELEMETRY)
|
||||
#if not defined(STM32_BOARD)
|
||||
#undef MULTI_SYNC
|
||||
#endif
|
||||
#undef MULTI_SYNC
|
||||
#undef MULTI_NAMES
|
||||
#endif
|
||||
|
||||
|
@ -232,7 +232,9 @@ uint16_t ReadWFLY()
|
||||
packet_count=0;
|
||||
phase++;
|
||||
case WFLY_DATA:
|
||||
telemetry_set_input_sync(5371);
|
||||
#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)
|
||||
|
@ -435,7 +435,9 @@ uint16_t WK_cb()
|
||||
{
|
||||
if (packet_sent == 0)
|
||||
{
|
||||
telemetry_set_input_sync(2800);
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(2800);
|
||||
#endif
|
||||
packet_sent = 1;
|
||||
if(sub_protocol == WK2801)
|
||||
WK_BuildPacket_2801();
|
||||
|
@ -156,7 +156,9 @@ uint16_t yd717_callback()
|
||||
{
|
||||
if(IS_BIND_DONE)
|
||||
{
|
||||
telemetry_set_input_sync(YD717_PACKET_PERIOD);
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(YD717_PACKET_PERIOD);
|
||||
#endif
|
||||
yd717_send_packet(0);
|
||||
}
|
||||
else
|
||||
|
@ -80,7 +80,9 @@ static void __attribute__((unused)) ZSX_init()
|
||||
|
||||
uint16_t ZSX_callback()
|
||||
{
|
||||
telemetry_set_input_sync(ZSX_PACKET_PERIOD);
|
||||
#ifdef MULTI_SYNC
|
||||
telemetry_set_input_sync(ZSX_PACKET_PERIOD);
|
||||
#endif
|
||||
if(IS_BIND_IN_PROGRESS)
|
||||
if(--bind_counter==0)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user