[Taranis] DSM2 BIND code
This commit is contained in:
+7
-4
@@ -124,10 +124,11 @@ audioQueue audio;
|
||||
|
||||
#if defined(DSM2)
|
||||
// TODO move elsewhere
|
||||
bool s_bind_mode = false;
|
||||
bool s_rangecheck_mode = false;
|
||||
uint8_t dsm2Flag = 0;
|
||||
#if !defined(PCBTARANIS)
|
||||
uint8_t s_bind_allowed = 255;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
uint8_t heartbeat;
|
||||
|
||||
@@ -3449,21 +3450,23 @@ void doMixerCalculations()
|
||||
|
||||
#if defined(DSM2)
|
||||
static uint8_t count_dsm_range = 0;
|
||||
if (s_rangecheck_mode)
|
||||
if (dsm2Flag & (DSM2_BIND_FLAG | DSM2_RANGECHECK_FLAG)) {
|
||||
if (++count_dsm_range >= 200) {
|
||||
AUDIO_PLAY(AU_FRSKY_CHEEP);
|
||||
count_dsm_range = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PXX)
|
||||
static uint8_t count_pxx = 0;
|
||||
for (uint8_t i = 0; i < NUM_MODULES; i++) {
|
||||
if((pxxFlag[i] & PXX_SEND_RANGECHECK) || (pxxFlag[i] & PXX_SEND_RXNUM))
|
||||
if (pxxFlag[i] & (PXX_SEND_RANGECHECK | PXX_SEND_RXNUM)) {
|
||||
if (++count_pxx >= 250) {
|
||||
AUDIO_PLAY(AU_FRSKY_CHEEP);
|
||||
count_pxx = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user