mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-07-13 02:07:53 +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
|
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,
|
normal = 0,
|
||||||
bind = 1,
|
bind = 1,
|
||||||
|
setFailSafe = 2,
|
||||||
unBind = 127
|
unBind = 127
|
||||||
} RxMode;
|
} RxMode;
|
||||||
uint8_t reserved = 0;
|
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.RxMode = CABELL_RxTxPacket_t::RxMode_t::unBind;
|
||||||
TxPacket.option = option & (~CABELL_OPTION_MASK_CHANNEL_REDUCTION); //remove channel reduction if in unBind mode
|
TxPacket.option = option & (~CABELL_OPTION_MASK_CHANNEL_REDUCTION); //remove channel reduction if in unBind mode
|
||||||
} else {
|
} 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.option = (bindMode) ? (option & (~CABELL_OPTION_MASK_CHANNEL_REDUCTION)) : option; //remove channel reduction if in bind mode
|
||||||
}
|
}
|
||||||
TxPacket.reserved = 0;
|
TxPacket.reserved = 0;
|
||||||
|
@ -176,8 +176,9 @@ enum FY326
|
|||||||
};
|
};
|
||||||
enum CABELL
|
enum CABELL
|
||||||
{
|
{
|
||||||
CABELL_V3 = 0,
|
CABELL_V3 = 0,
|
||||||
CABELL_UNBIND = 7
|
CABELL_SET_FAIL_SAFE = 6,
|
||||||
|
CABELL_UNBIND = 7
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NONE 0
|
#define NONE 0
|
||||||
@ -537,8 +538,9 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
|
|||||||
FY326 0
|
FY326 0
|
||||||
FY319 1
|
FY319 1
|
||||||
sub_protocol==CABELL
|
sub_protocol==CABELL
|
||||||
CABELL_V3 0,
|
CABELL_V3 0,
|
||||||
CABELL_UNBIND 7
|
CABELL_SET_FAIL_SAFE 6,
|
||||||
|
CABELL_UNBIND 7
|
||||||
|
|
||||||
Power value => 0x80 0=High/1=Low
|
Power value => 0x80 0=High/1=Low
|
||||||
Stream[3] = option_protocol;
|
Stream[3] = option_protocol;
|
||||||
|
@ -291,6 +291,7 @@ const PPM_Parameters PPM_prot[15]= {
|
|||||||
PPM_SBUS
|
PPM_SBUS
|
||||||
MODE_CABELL
|
MODE_CABELL
|
||||||
CABELL_V3
|
CABELL_V3
|
||||||
|
CABELL_SET_FAIL_SAFE
|
||||||
CABELL_UNBIND
|
CABELL_UNBIND
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user