Skip to content

Commit 6e7eced

Browse files
committed
Enable SRXL2 ESC build behind USE_SRXL2_ESC
The SRXL2 ESC driver implementation was guarded by USE_SERIAL, a macro that is not defined anywhere in INAV. As a result srxl2_esc.c always compiled the empty stub: the driver never opened a port, never sent throttle and never read telemetry, so the feature was dead code on every target. Introduce a dedicated USE_SRXL2_ESC feature macro (defined for targets with more than 512 KB flash) and gate the driver and the pwmCompleteMotorUpdate() call on it instead of the non-existent USE_SERIAL. Verified by building SPEEDYBEEF405WING (real implementation now compiled and linked) and SITL. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GroYFi23gHDgj43xrTAVaY
1 parent 5d935a0 commit 6e7eced

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/drivers/srxl2_esc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
#include "io/serial.h"
3737

38-
#if defined(USE_SERIAL)
38+
#if defined(USE_SRXL2_ESC)
3939

4040
#define SRXL2_ESC_BAUDRATE 115200
4141
#define SRXL2_ESC_FRAME_TIMEOUT_US 500

src/main/fc/fc_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ void taskRunRealtimeCallbacks(timeUs_t currentTimeUs)
10421042
afatfs_poll();
10431043
#endif
10441044

1045-
#if defined(USE_DSHOT) || defined(USE_SERIAL)
1045+
#if defined(USE_DSHOT) || defined(USE_SRXL2_ESC)
10461046
pwmCompleteMotorUpdate();
10471047
#endif
10481048

src/main/target/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@
214214
#define USE_34CHANNELS
215215
#define MAX_MIXER_PROFILE_COUNT 2
216216
#define USE_SMARTPORT_MASTER
217+
#define USE_SRXL2_ESC
217218
#ifdef USE_GPS
218219
#define USE_GEOZONE
219220
#define MAX_GEOZONES_IN_CONFIG 63

0 commit comments

Comments
 (0)