mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-07-12 09:47:54 +00:00
Added sub-protocol for setting failsafe values
This commit is contained in:
parent
b67e0ec6a7
commit
90c50293df
@ -50,6 +50,7 @@ typedef struct {
|
||||
enum RxMode_t : uint8_t { // Note bit 8 is used to indicate if the packet is the first of 2 on the channel. Mask out this bit before using the enum
|
||||
normal = 0,
|
||||
bind = 1,
|
||||
setFailSafe = 2,
|
||||
unBind = 127
|
||||
} RxMode;
|
||||
uint8_t reserved = 0;
|
||||
@ -108,7 +109,11 @@ static void __attribute__((unused)) CABELL_send_packet(uint8_t bindMode)
|
||||
TxPacket.RxMode = CABELL_RxTxPacket_t::RxMode_t::unBind;
|
||||
TxPacket.option = option & (~CABELL_OPTION_MASK_CHANNEL_REDUCTION); //remove channel reduction if in unBind mode
|
||||
} else {
|
||||
TxPacket.RxMode = (bindMode) ? CABELL_RxTxPacket_t::RxMode_t::bind : CABELL_RxTxPacket_t::RxMode_t::normal;
|
||||
if (sub_protocol == CABELL_SET_FAIL_SAFE) {
|
||||
TxPacket.RxMode = CABELL_RxTxPacket_t::RxMode_t::setFailSafe;
|
||||
} else {
|
||||
TxPacket.RxMode = (bindMode) ? CABELL_RxTxPacket_t::RxMode_t::bind : CABELL_RxTxPacket_t::RxMode_t::normal;
|
||||
}
|
||||
TxPacket.option = (bindMode) ? (option & (~CABELL_OPTION_MASK_CHANNEL_REDUCTION)) : option; //remove channel reduction if in bind mode
|
||||
}
|
||||
TxPacket.reserved = 0;
|
||||
|
@ -176,8 +176,9 @@ enum FY326
|
||||
};
|
||||
enum CABELL
|
||||
{
|
||||
CABELL_V3 = 0,
|
||||
CABELL_UNBIND = 7
|
||||
CABELL_V3 = 0,
|
||||
CABELL_SET_FAIL_SAFE = 6,
|
||||
CABELL_UNBIND = 7
|
||||
};
|
||||
|
||||
#define NONE 0
|
||||
@ -537,8 +538,9 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
|
||||
FY326 0
|
||||
FY319 1
|
||||
sub_protocol==CABELL
|
||||
CABELL_V3 0,
|
||||
CABELL_UNBIND 7
|
||||
CABELL_V3 0,
|
||||
CABELL_SET_FAIL_SAFE 6,
|
||||
CABELL_UNBIND 7
|
||||
|
||||
Power value => 0x80 0=High/1=Low
|
||||
Stream[3] = option_protocol;
|
||||
|
@ -291,6 +291,7 @@ const PPM_Parameters PPM_prot[15]= {
|
||||
PPM_SBUS
|
||||
MODE_CABELL
|
||||
CABELL_V3
|
||||
CABELL_SET_FAIL_SAFE
|
||||
CABELL_UNBIND
|
||||
*/
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user