No "Telemetry lost" during BIND mode

This commit is contained in:
Bertrand Songis
2019-08-23 09:26:16 +02:00
parent edb4f9a966
commit 6c27c60319
8 changed files with 50 additions and 35 deletions
+3 -3
View File
@@ -18,8 +18,8 @@
* GNU General Public License for more details.
*/
#ifndef _MODULES_H_
#define _MODULES_H_
#ifndef _MODULES_HELPERS_H_
#define _MODULES_HELPERS_H_
#include "bitfield.h"
#include "definitions.h"
@@ -479,4 +479,4 @@ inline void removePXX2ReceiverIfEmpty(uint8_t moduleIdx, uint8_t receiverIdx)
}
}
#endif // _MODULES_H_
#endif // _MODULES_HELPERS_H_
+25 -6
View File
@@ -29,12 +29,6 @@
#include "modules_helpers.h"
#include "ff.h"
#if NUM_MODULES > 1
#define IS_RANGECHECK_ENABLE() (moduleState[0].mode == MODULE_MODE_RANGECHECK || moduleState[1].mode == MODULE_MODE_RANGECHECK)
#else
#define IS_RANGECHECK_ENABLE() (moduleState[0].mode == MODULE_MODE_RANGECHECK)
#endif
#if defined(PCBSKY9X) && defined(DSM2)
#define DSM2_BIND_TIMEOUT 255 // 255*11ms
extern uint8_t dsm2BindTimer;
@@ -404,5 +398,30 @@ inline void SEND_FAILSAFE_1S()
// for channels not set previously to HOLD or NOPULSE
void setCustomFailsafe(uint8_t moduleIndex);
inline bool isModuleInRangeCheckMode()
{
if (moduleState[0].mode == MODULE_MODE_RANGECHECK)
return true;
#if NUM_MODULES > 1
if (moduleState[1].mode == MODULE_MODE_RANGECHECK)
return true;
#endif
return false;
}
inline bool isModuleInBeepMode()
{
if (moduleState[0].mode >= MODULE_MODE_BEEP_FIRST)
return true;
#if NUM_MODULES > 1
if (moduleState[1].mode >= MODULE_MODE_BEEP_FIRST)
return true;
#endif
return false;
}
#endif // _PULSES_H_