mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-04 18:38:13 +00:00
Failsafe
This commit is contained in:
parent
fd4346cb64
commit
ed42bf311f
@ -14,27 +14,20 @@
|
||||
*/
|
||||
|
||||
#ifdef FAILSAFE_ENABLE
|
||||
#if FAILSAFE_THROTTLE_LOW < -125
|
||||
#undef FAILSAFE_THROTTLE_LOW
|
||||
#define FAILSAFE_THROTTLE_LOW -125
|
||||
#elif FAILSAFE_THROTTLE_LOW > 125
|
||||
#undef FAILSAFE_THROTTLE_LOW
|
||||
#define FAILSAFE_THROTTLE_LOW 125
|
||||
#endif
|
||||
//Convert from percentage to failsafe value
|
||||
#define FAILSAFE_THROTTLE_LOW_VAL (((FAILSAFE_THROTTLE_LOW+125)*1024)/125)
|
||||
#if FAILSAFE_THROTTLE_LOW_VAL == 0
|
||||
#if FAILSAFE_THROTTLE_LOW_VAL <= 0
|
||||
#undef FAILSAFE_THROTTLE_LOW_VAL
|
||||
#define FAILSAFE_THROTTLE_LOW_VAL 1
|
||||
#elif (FAILSAFE_THROTTLE_LOW_VAL) >= 2046
|
||||
#undef FAILSAFE_THROTTLE_LOW_VAL
|
||||
#define FAILSAFE_THROTTLE_LOW_VAL 2046
|
||||
#endif
|
||||
//#define FAILSAFE_THROTTLE_LOW_VAL FAILSAFE_THROTTLE_LOW
|
||||
void InitFailsafe()
|
||||
{
|
||||
for(uint8_t i=0;i<NUM_CHN;i++)
|
||||
Failsafe_data[i]=1024;
|
||||
Failsafe_data[THROTTLE]=FAILSAFE_THROTTLE_LOW_VAL; //0=-125%, 204=-100%
|
||||
Failsafe_data[THROTTLE]=(uint16_t)FAILSAFE_THROTTLE_LOW_VAL; //0=-125%, 204=-100%
|
||||
FAILSAFE_VALUES_on;
|
||||
#ifdef FAILSAFE_SERIAL_ONLY
|
||||
if(mode_select == MODE_SERIAL)
|
||||
|
@ -164,8 +164,8 @@
|
||||
//If you want to diasble failsafe globally comment the line below using "//".
|
||||
#define FAILSAFE_ENABLE
|
||||
|
||||
//Failsafe throttle low value.
|
||||
//Value between -125% and +125%
|
||||
//Failsafe throttle low value in percentage.
|
||||
//Value between -125% and +125%. Default -100.
|
||||
#define FAILSAFE_THROTTLE_LOW -100
|
||||
|
||||
//The radio using serial protocol can set failsafe data (ersky9x only for now).
|
||||
|
Loading…
x
Reference in New Issue
Block a user