Rework DSM2/X support, auto protocol selection for DSM2
Support more than 31 protocols for the multi module. Breaks existing multi eeproms, need to reselect protocols
This commit is contained in:
+15
-1
@@ -661,7 +661,9 @@ PACK(struct ModuleData {
|
||||
int8_t frameLength;
|
||||
} ppm;
|
||||
NOBACKUP(struct {
|
||||
uint8_t rfProtocol:6; // can be changed to rfProtocol if rfProtocol gets more bits, currently 6 bits used
|
||||
uint8_t rfProtocolExtra:2;
|
||||
uint8_t spare:3;
|
||||
uint8_t customProto:1;
|
||||
uint8_t autoBindMode:1;
|
||||
uint8_t lowPowerMode:1;
|
||||
int8_t optionValue;
|
||||
@@ -673,6 +675,18 @@ PACK(struct ModuleData {
|
||||
uint8_t spare3;
|
||||
} pxx);
|
||||
};
|
||||
|
||||
// Helper functions to set both of the rfProto protocol at the same time
|
||||
inline uint8_t getMultiProtocol()
|
||||
{
|
||||
return ((uint8_t) (rfProtocol & 0x0f)) + (multi.rfProtocolExtra << 4);
|
||||
}
|
||||
|
||||
inline void setMultiProtocol(uint8_t proto)
|
||||
{
|
||||
rfProtocol = (uint8_t) (proto & 0x0f);
|
||||
multi.rfProtocolExtra = (proto & 0x30) >> 4;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user