mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-12-25 12:53:15 +00:00
By default, keep respecting the THR_KILL functionality (CH14)
This commit is contained in:
@@ -208,7 +208,7 @@ static void __attribute__((unused)) DSM_build_data_packet(uint8_t upper)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(DSM_THROTTLE_KILL_CH) && not defined(DSM_X_PLUS)
|
||||
#if defined(DSM_THROTTLE_KILL_CH)
|
||||
uint16_t kill_ch=Channel_data[DSM_THROTTLE_KILL_CH-1];
|
||||
#endif
|
||||
for (uint8_t i = 0; i < 7; i++)
|
||||
@@ -224,7 +224,7 @@ static void __attribute__((unused)) DSM_build_data_packet(uint8_t upper)
|
||||
{
|
||||
/* Spektrum own remotes transmit normal values during bind and actually use this (e.g. Nano CP X) to
|
||||
select the transmitter mode (e.g. computer vs non-computer radio), so always send normal output */
|
||||
#if defined(DSM_THROTTLE_KILL_CH) && not defined(DSM_X_PLUS)
|
||||
#if defined(DSM_THROTTLE_KILL_CH)
|
||||
if(idx==CH1 && kill_ch<=604)
|
||||
{//Activate throttle kill only if channel is throttle and DSM_THROTTLE_KILL_CH below -50%
|
||||
if(kill_ch<CHANNEL_MIN_100) // restrict val to 0...400
|
||||
@@ -257,7 +257,7 @@ static void __attribute__((unused)) DSM_build_data_packet(uint8_t upper)
|
||||
// CH13-16 lower frame, and Ch17-20 upper. We only do lower right now, since MM cannot handle more than 16ch
|
||||
// Channel value is 9 bits, and upper 2 bits is the X-Plus channel (CH13..CH16).
|
||||
value >>= 2; // Convert to 9 bits
|
||||
value |= (XP_CH << 11) | (x_plus_ch << 9); // CH13 (4bits), XPlus Ch (2 bits), Value (9 bits)
|
||||
value |= (XP_CH << 11) | (x_plus_ch << 9); // constant 12 (4 bits), XPlus Ch (2 bits), Value (9 bits)
|
||||
x_plus_ch = (x_plus_ch + 1) % 4; // only 0..3
|
||||
} else
|
||||
#endif
|
||||
|
||||
@@ -294,9 +294,9 @@
|
||||
//The DSM protocol is using by default the Spektrum throw of 1100..1900us @100% and 1000..2000us @125%.
|
||||
// For more throw, 1024..1976us @100% and 904..2096us @125%, remove the "//" on the line below. Be aware that too much throw can damage some UMX servos. To achieve standard throw in this mode use a channel weight of 84%.
|
||||
//#define DSM_MAX_THROW
|
||||
|
||||
//Some models (X-Vert, Blade 230S...) require a special value to instant stop the motor(s).
|
||||
// You can disable this feature by adding "//" on the line below. You have to specify which channel (14 by default) will be used to kill the throttle channel.
|
||||
|
||||
// If the channel 14 is above -50% the throttle is untouched but if it is between -50% and -100%, the throttle output will be forced between -100% and -150%.
|
||||
// For example, a value of -80% applied on channel 14 will instantly kill the motors on the X-Vert.
|
||||
#define DSM_THROTTLE_KILL_CH 14
|
||||
@@ -304,7 +304,7 @@
|
||||
//Enable DSM Forward Programming
|
||||
#define DSM_FWD_PGM
|
||||
|
||||
//Enable X-Plus channels, Ch13-16.. if Enabled, will ignore the DSM_THROTTLE_KILL_CH feature
|
||||
//Enable X-Plus channels, Ch13-16.. if Enabled, will still respect the DSM_THROTTLE_KILL_CH feature
|
||||
#define DSM_X_PLUS
|
||||
|
||||
/**************************/
|
||||
|
||||
Reference in New Issue
Block a user