fix: pxx2 can transport 24 channels (#4871)
This commit is contained in:
@@ -472,7 +472,7 @@ void Pxx2Pulses::setupReceiverSettingsFrame(uint8_t module, int16_t* channels, u
|
|||||||
if (reusableBuffer.hardwareAndSettings.receiverSettings.sbus24)
|
if (reusableBuffer.hardwareAndSettings.receiverSettings.sbus24)
|
||||||
flag1 |= PXX2_RX_SETTINGS_FLAG1_SBUS24;
|
flag1 |= PXX2_RX_SETTINGS_FLAG1_SBUS24;
|
||||||
Pxx2Transport::addByte(flag1);
|
Pxx2Transport::addByte(flag1);
|
||||||
uint8_t outputsCount = min<uint8_t>(24, reusableBuffer.hardwareAndSettings.receiverSettings.outputsCount);
|
uint8_t outputsCount = min<uint8_t>(PXX2_MAX_CHANNELS, reusableBuffer.hardwareAndSettings.receiverSettings.outputsCount);
|
||||||
for (int i = 0; i < outputsCount; i++) {
|
for (int i = 0; i < outputsCount; i++) {
|
||||||
Pxx2Transport::addByte(reusableBuffer.hardwareAndSettings.receiverSettings.outputsMapping[i]);
|
Pxx2Transport::addByte(reusableBuffer.hardwareAndSettings.receiverSettings.outputsMapping[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,8 @@
|
|||||||
|
|
||||||
#define PXX2_AUTH_REFUSED_FLAG 0xA5
|
#define PXX2_AUTH_REFUSED_FLAG 0xA5
|
||||||
|
|
||||||
|
#define PXX2_MAX_CHANNELS 24
|
||||||
|
|
||||||
// Channel mapping constants
|
// Channel mapping constants
|
||||||
#define CH_ENABLE_SPORT 4
|
#define CH_ENABLE_SPORT 4
|
||||||
#define CH_ENABLE_SBUS 5
|
#define CH_ENABLE_SBUS 5
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ static void processReceiverSettingsFrame(uint8_t module, const uint8_t * frame)
|
|||||||
if (frame[4] & PXX2_RX_SETTINGS_FLAG1_SBUS24)
|
if (frame[4] & PXX2_RX_SETTINGS_FLAG1_SBUS24)
|
||||||
destination->sbus24 = 1;
|
destination->sbus24 = 1;
|
||||||
|
|
||||||
uint8_t outputsCount = min<uint8_t>(16, frame[0] - 4);
|
uint8_t outputsCount = min<uint8_t>(PXX2_MAX_CHANNELS, frame[0] - 4);
|
||||||
destination->outputsCount = outputsCount;
|
destination->outputsCount = outputsCount;
|
||||||
for (uint8_t pin = 0; pin < outputsCount; pin++) {
|
for (uint8_t pin = 0; pin < outputsCount; pin++) {
|
||||||
destination->outputsMapping[pin] = frame[5 + pin];
|
destination->outputsMapping[pin] = frame[5 + pin];
|
||||||
|
|||||||
Reference in New Issue
Block a user