mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 16:25:16 +03:00
Get/SET Receiver settings frame
This commit is contained in:
parent
68df083394
commit
2ce141c7ae
8 changed files with 84 additions and 64 deletions
|
@ -88,6 +88,21 @@ void processGetHardwareInfoFrame(uint8_t module, uint8_t * frame)
|
|||
}
|
||||
}
|
||||
|
||||
void processReceiverSettingsFrame(uint8_t module, uint8_t * frame)
|
||||
{
|
||||
#warning "TODO This will be needed to ensure we are in the right menu"
|
||||
// if (moduleSettings[module].mode != MODULE_MODE_GET_HARDWARE_INFO) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
for (uint8_t pin=0; pin<24; pin++) {
|
||||
reusableBuffer.receiverSetup.channelMapping[pin] = frame[5 + pin];
|
||||
}
|
||||
|
||||
reusableBuffer.receiverSetup.state = 0xFF;
|
||||
moduleSettings[module].mode = MODULE_MODE_NORMAL;
|
||||
}
|
||||
|
||||
void processRegisterFrame(uint8_t module, uint8_t * frame)
|
||||
{
|
||||
if (moduleSettings[module].mode != MODULE_MODE_REGISTER) {
|
||||
|
@ -173,6 +188,10 @@ void processRadioFrame(uint8_t module, uint8_t * frame)
|
|||
processGetHardwareInfoFrame(module, frame);
|
||||
break;
|
||||
|
||||
case PXX2_TYPE_ID_RX_SETTINGS:
|
||||
processReceiverSettingsFrame(module, frame);
|
||||
break;
|
||||
|
||||
case PXX2_TYPE_ID_REGISTER:
|
||||
processRegisterFrame(module, frame);
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue