Skip to content

Commit 3492b4d

Browse files
committed
intermediate commit: do not merge
first step towards dynamic rx/tx swap for CRSF RX serial
1 parent 5dde706 commit 3492b4d

4 files changed

Lines changed: 26 additions & 1 deletion

File tree

src/main/config/parameter_group_ids.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@
132132
#define PG_GEOZONE_CONFIG 1042
133133
#define PG_GEOZONES 1043
134134
#define PG_GEOZONE_VERTICES 1044
135-
#define PG_INAV_END PG_GEOZONE_VERTICES
135+
#define PG_CRSFRXPORT_CONFIG 1045
136+
#define PG_INAV_END PG_CRSFRXPORT_CONFIG
136137

137138
// OSD configuration (subject to change)
138139
//#define PG_OSD_FONT_CONFIG 2047

src/main/fc/config.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ PG_RESET_TEMPLATE(beeperConfig_t, beeperConfig,
131131
.pwmMode = SETTING_BEEPER_PWM_MODE_DEFAULT,
132132
);
133133

134+
PG_REGISTER_WITH_RESET_TEMPLATE(crsfRxPortConfig_t, crsfRxPortConfig, PG_CRSFRXPORT_CONFIG, 1);
135+
136+
PG_RESET_TEMPLATE(crsfRxPortConfig_t, crsfRxPortConfig,
137+
.swap = 0,
138+
.preferred_swap = 0
139+
);
140+
134141
PG_REGISTER_WITH_RESET_TEMPLATE(adcChannelConfig_t, adcChannelConfig, PG_ADC_CHANNEL_CONFIG, 0);
135142

136143
PG_RESET_TEMPLATE(adcChannelConfig_t, adcChannelConfig,

src/main/fc/config.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ typedef struct beeperConfig_s {
9494

9595
PG_DECLARE(beeperConfig_t, beeperConfig);
9696

97+
typedef struct CrsfRxPortConfig_s {
98+
bool swap;
99+
bool preferred_swap;
100+
} crsfRxPortConfig_t;
101+
102+
PG_DECLARE(crsfRxPortConfig_t, crsfRxPortConfig);
103+
97104
typedef struct adcChannelConfig_s {
98105
uint8_t adcFunctionChannel[ADC_FUNCTION_COUNT];
99106
} adcChannelConfig_t;

src/main/fc/settings.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4249,6 +4249,16 @@ groups:
42494249
default_value: OFF
42504250
description: "Allows disabling PWM mode for beeper on some targets. Switch from ON to OFF if the external beeper sound is weak. Do not switch from OFF to ON without checking if the board supports PWM beeper mode"
42514251

4252+
- name: PG_CRSFRXPORT_CONFIG
4253+
type: crsfRxPortConfig_t
4254+
headers: [ "fc/config.h" ]
4255+
members:
4256+
- name: crsf_rx_swap
4257+
field: swap
4258+
type: bool
4259+
default_value: OFF
4260+
description: "Swaps rx/tx for CRSF RX uart"
4261+
42524262
- name: PG_POWER_LIMITS_CONFIG
42534263
type: powerLimitsConfig_t
42544264
headers: ["flight/power_limits.h"]

0 commit comments

Comments
 (0)