1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-16 04:45:17 +03:00

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:
Arne Schwabe 2016-10-03 22:46:54 +02:00
parent c592fed9f1
commit c055e93247
23 changed files with 198 additions and 182 deletions

View file

@ -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;
}
});
/*