Skip to content

Commit 96f6ee5

Browse files
committed
intermediate commit: do not merge
first step towards dynamic rx/tx swap for CRSF RX serial
1 parent 9bb689a commit 96f6ee5

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

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
@@ -4244,6 +4244,16 @@ groups:
42444244
default_value: OFF
42454245
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"
42464246

4247+
- name: PG_CRSFRXPORT_CONFIG
4248+
type: crsfRxPortConfig_t
4249+
headers: [ "fc/config.h" ]
4250+
members:
4251+
- name: crsf_rx_swap
4252+
field: swap
4253+
type: bool
4254+
default_value: OFF
4255+
description: "Swaps rx/tx for CRSF RX uart"
4256+
42474257
- name: PG_POWER_LIMITS_CONFIG
42484258
type: powerLimitsConfig_t
42494259
headers: ["flight/power_limits.h"]

0 commit comments

Comments
 (0)