Bugs: fixed telemetry disable compilation error

This commit is contained in:
Pascal Langer 2018-10-11 17:58:07 +02:00
parent 5cf8d8d263
commit b40e7d6e97
4 changed files with 19 additions and 10 deletions

View File

@ -427,14 +427,16 @@ uint16_t ReadBUGS(void)
if (!(mode & 0x01)) if (!(mode & 0x01))
{ {
A7105_ReadData(16); A7105_ReadData(16);
v_lipo1=packet[10] == 0xff ? 0xff : 0x00; // Voltage in this case is only an alert on level good or bad. #if defined(BUGS_HUB_TELEMETRY)
RX_RSSI=packet[3]; v_lipo1=packet[10] == 0xff ? 0xff : 0x00; // Voltage in this case is only an alert on level good or bad.
// Read TX RSSI RX_RSSI=packet[3];
int16_t temp=256-(A7105_ReadReg(A7105_1D_RSSI_THOLD)*8)/5; // Value from A7105 is between 8 for maximum signal strength to 160 or less // Read TX RSSI
if(temp<0) temp=0; int16_t temp=256-(A7105_ReadReg(A7105_1D_RSSI_THOLD)*8)/5; // Value from A7105 is between 8 for maximum signal strength to 160 or less
else if(temp>255) temp=255; if(temp<0) temp=0;
TX_RSSI=temp; else if(temp>255) temp=255;
telemetry_link=1; TX_RSSI=temp;
telemetry_link=1;
#endif
} }
phase = BUGS_DATA_1; phase = BUGS_DATA_1;
packet_period = BUGS_DELAY_POST_RX; packet_period = BUGS_DELAY_POST_RX;

View File

@ -259,6 +259,7 @@ static void __attribute__((unused)) CX10_initialize_txid()
uint16_t initCX10(void) uint16_t initCX10(void)
{ {
BIND_IN_PROGRESS; // autobind protocol
if(sub_protocol==CX10_BLUE) if(sub_protocol==CX10_BLUE)
{ {
packet_length = CX10A_PACKET_SIZE; packet_length = CX10A_PACKET_SIZE;
@ -282,7 +283,6 @@ uint16_t initCX10(void)
} }
CX10_initialize_txid(); CX10_initialize_txid();
CX10_init(); CX10_init();
BIND_IN_PROGRESS; // autobind protocol
return CX10_INITIAL_WAIT+packet_period; return CX10_INITIAL_WAIT+packet_period;
} }

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_REVISION 1 #define VERSION_REVISION 1
#define VERSION_PATCH_LEVEL 1 #define VERSION_PATCH_LEVEL 2
//****************** //******************
// Protocols // Protocols
@ -68,6 +68,7 @@ enum PROTOCOLS
PROTO_HITEC = 39, // =>CC2500 PROTO_HITEC = 39, // =>CC2500
PROTO_WFLY = 40, // =>CYRF6936 PROTO_WFLY = 40, // =>CYRF6936
PROTO_BUGS = 41, // =>A7105 PROTO_BUGS = 41, // =>A7105
PROTO_TEST = 63, // =>NRF24L01
}; };
enum Flysky enum Flysky

View File

@ -1187,6 +1187,12 @@ static void protocol_init()
remote_callback = cflie_callback; remote_callback = cflie_callback;
break; break;
#endif #endif
#if defined(TEST_NRF24L01_INO)
case PROTO_TEST:
next_callback=initTest();
remote_callback = Test_callback;
break;
#endif
#endif #endif
} }
} }