For channel mapping testing
This commit is contained in:
@@ -1065,8 +1065,21 @@ void menuModelSetup(event_t event)
|
|||||||
case ITEM_MODEL_INTERNAL_MODULE_RECEIVER_1_RANGE:
|
case ITEM_MODEL_INTERNAL_MODULE_RECEIVER_1_RANGE:
|
||||||
case ITEM_MODEL_INTERNAL_MODULE_RECEIVER_2_RANGE:
|
case ITEM_MODEL_INTERNAL_MODULE_RECEIVER_2_RANGE:
|
||||||
{
|
{
|
||||||
lcdDrawTextAlignedLeft(y, TR_CHANNELRANGE);
|
//TODO have a proper channel assignement screen, section bellow is just for tests
|
||||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, "Ch 1 - 8",0);
|
uint8_t useUpperChannels;
|
||||||
|
uint8_t receiverIdx = CURRENT_RECEIVER_EDITED(k);
|
||||||
|
|
||||||
|
if (memcmp(&g_model.moduleData[INTERNAL_MODULE].pxx2.receivers[receiverIdx].channelMapping, DEFAULT_CHANNEL_MAPPING, sizeof(uint64_t)) == 0)
|
||||||
|
useUpperChannels = 0;
|
||||||
|
else
|
||||||
|
useUpperChannels = 1;
|
||||||
|
|
||||||
|
useUpperChannels = editCheckBox(useUpperChannels, MODEL_SETUP_2ND_COLUMN, y, INDENT "Use CH9-16", attr, event);
|
||||||
|
|
||||||
|
if (useUpperChannels)
|
||||||
|
memcpy(&g_model.moduleData[INTERNAL_MODULE].pxx2.receivers[receiverIdx].channelMapping, CH9TO16_CHANNEL_MAPPING, sizeof(uint64_t));
|
||||||
|
else
|
||||||
|
memcpy(&g_model.moduleData[INTERNAL_MODULE].pxx2.receivers[receiverIdx].channelMapping, DEFAULT_CHANNEL_MAPPING, sizeof(uint64_t));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#define PXX2_FLAG0_FAILSAFE (1 << 6)
|
#define PXX2_FLAG0_FAILSAFE (1 << 6)
|
||||||
|
|
||||||
const uint8_t DEFAULT_CHANNEL_MAPPING[] = {0x12, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
|
const uint8_t DEFAULT_CHANNEL_MAPPING[] = {0x12, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
|
||||||
|
const uint8_t CH9TO16_CHANNEL_MAPPING[] = {0x89, 0xAB, 0xCD, 0xEF, 0x12, 0x23, 0x45, 0x67};
|
||||||
|
|
||||||
class ModuleFifo : public Fifo<uint8_t, 32> {
|
class ModuleFifo : public Fifo<uint8_t, 32> {
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user