mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 16:25:16 +03:00
F.PORT added in receiver options
This commit is contained in:
parent
e716e747b0
commit
1034d851e2
6 changed files with 19 additions and 4 deletions
|
@ -165,13 +165,13 @@ void title(const char * s);
|
|||
|
||||
#define SUBMENU_NOTITLE(lines_count, ...) \
|
||||
MENU_TAB(__VA_ARGS__); \
|
||||
check(event, 0, nullptr, 0, mstate_tab, DIM(mstate_tab)-1, (lines_count)-HEADER_LINE);
|
||||
check(event, 0, nullptr, 0, mstate_tab, DIM(mstate_tab)-1, (lines_count)-HEADER_LINE)
|
||||
|
||||
#define SIMPLE_MENU_NOTITLE(tab, menu, lines_count) \
|
||||
check_simple(event, menu, tab, DIM(tab), (lines_count)-HEADER_LINE);
|
||||
check_simple(event, menu, tab, DIM(tab), (lines_count)-HEADER_LINE)
|
||||
|
||||
#define SIMPLE_SUBMENU_NOTITLE(lines_count) \
|
||||
check_submenu_simple(event, (lines_count)-HEADER_LINE);
|
||||
check_submenu_simple(event, (lines_count)-HEADER_LINE)
|
||||
|
||||
#define SUBMENU(name, lines_count, ...) \
|
||||
MENU_TAB(__VA_ARGS__); \
|
||||
|
|
|
@ -40,6 +40,7 @@ void onRxOptionsUpdateConfirm(const char * result)
|
|||
enum {
|
||||
ITEM_RECEIVER_TELEMETRY,
|
||||
ITEM_RECEIVER_PWM_RATE,
|
||||
ITEM_RECEIVER_SPORT_FPORT,
|
||||
ITEM_RECEIVER_PINMAP_FIRST
|
||||
};
|
||||
|
||||
|
@ -117,8 +118,15 @@ void menuModelReceiverOptions(event_t event)
|
|||
}
|
||||
break;
|
||||
|
||||
case ITEM_RECEIVER_SPORT_FPORT:
|
||||
reusableBuffer.hardwareAndSettings.receiverSettings.fport = editCheckBox(reusableBuffer.hardwareAndSettings.receiverSettings.fport, RECEIVER_OPTIONS_2ND_COLUMN, y, "F.Port", attr, event);
|
||||
if (attr && checkIncDec_Ret) {
|
||||
reusableBuffer.hardwareAndSettings.receiverSettings.dirty = true;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Pin
|
||||
// Pin
|
||||
{
|
||||
uint8_t pin = i - ITEM_RECEIVER_PINMAP_FIRST;
|
||||
if (pin < reusableBuffer.hardwareAndSettings.receiverSettings.outputsCount) {
|
||||
|
|
|
@ -123,6 +123,7 @@ class ReceiverSettings {
|
|||
uint8_t dirty;
|
||||
uint8_t telemetryDisabled;
|
||||
uint8_t pwmRate;
|
||||
uint8_t fport;
|
||||
uint8_t outputsCount;
|
||||
uint8_t outputsMapping[24];
|
||||
};
|
||||
|
|
|
@ -214,6 +214,8 @@ void Pxx2Pulses::setupReceiverSettingsFrame(uint8_t module)
|
|||
flag1 |= PXX2_RX_SETTINGS_FLAG1_TELEMETRY_DISABLED;
|
||||
if (reusableBuffer.hardwareAndSettings.receiverSettings.pwmRate)
|
||||
flag1 |= PXX2_RX_SETTINGS_FLAG1_FASTPWM;
|
||||
if (reusableBuffer.hardwareAndSettings.receiverSettings.fport)
|
||||
flag1 |= PXX2_RX_SETTINGS_FLAG1_FPORT;
|
||||
Pxx2Transport::addByte(flag1);
|
||||
uint8_t outputsCount = min<uint8_t>(24, reusableBuffer.hardwareAndSettings.receiverSettings.outputsCount);
|
||||
for (int i = 0; i < outputsCount; i++) {
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
#define PXX2_RX_SETTINGS_FLAG1_TELEMETRY_DISABLED (1 << 7)
|
||||
#define PXX2_RX_SETTINGS_FLAG1_READONLY (1 << 6)
|
||||
#define PXX2_RX_SETTINGS_FLAG1_FASTPWM (1 << 4)
|
||||
#define PXX2_RX_SETTINGS_FLAG1_FPORT (1 << 3)
|
||||
|
||||
#define PXX2_TX_SETTINGS_FLAG0_WRITE (1 << 6)
|
||||
#define PXX2_TX_SETTINGS_FLAG1_EXTERNAL_ANTENNA (1 << 3)
|
||||
|
|
|
@ -88,6 +88,9 @@ void processReceiverSettingsFrame(uint8_t module, uint8_t * frame)
|
|||
return;
|
||||
}
|
||||
|
||||
if (frame[4] & PXX2_RX_SETTINGS_FLAG1_FPORT)
|
||||
reusableBuffer.hardwareAndSettings.receiverSettings.fport = 1;
|
||||
|
||||
if (frame[4] & PXX2_RX_SETTINGS_FLAG1_FASTPWM)
|
||||
reusableBuffer.hardwareAndSettings.receiverSettings.pwmRate = 1;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue