Repository navigation
Conversation
On boards whose ESC connector can also be a UART's TX, the firmware reports the connector in MSP2_INAV_ESC_SRXL2_STATUS and has esc_srxl2_connector. With the protocol set to SRXL2 the Outputs tab offers it, off by default, names the UART behind it, and its messages count the connector as motor 1. The Ports tab lists that UART as "SRXL2 via ESC connector", locked, while the connector carries the ESC; a UART with a function stays editable, and the Outputs tab says the connector stays unused until it is cleared. The board applies the option and the protocol at startup, so the count of open ports describes it by the saved values, and while the checkbox differs the tab says to save and reboot, whichever way it was changed.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoOffer the board ESC connector for Spektrum Smart ESC
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo
1.
|
|
Configurator test build ready — commit Download build artifacts for PR #2814 Available platforms (scroll to the Artifacts section at the bottom of the run page):
|
The lock waited for the connector setting and then looked at the functions the port was loaded with, so one picked in the row meanwhile survived on a row shown as locked and was saved. It now looks at the row as it stands.
SonarCloud put srxl2UpdateVisibility() at a cognitive complexity of 33 once the connector was in it. The connector row, the warning and the port count are now three small functions, and the nested ternary on the count is gone. Nothing shown changes.
The firmware drives four, the ESC connector counting as one, and refuses to arm with a port left over. The tab counted four open ports for the motors and gave no reason for the refusal; it now says what is wrong.
portRowHasFunction() moves to module scope, as it needs nothing of the tab's, and the setting check uses an optional chain. Nothing shown changes.
|
|
Closing this together with iNavFlight/inav#12087. Its replacement, iNavFlight/inav#12143, puts any UART's TX or RX on an output pad, and #2833 is its Configurator side: a Pins column in the Ports tab instead of the ESC connector toggle in Outputs. |



The Configurator side of iNavFlight/inav#12087, which lets a Spektrum Smart ESC run on the ESC connector of the few boards that can route a UART's TX there (NEXUS, NEXUS X/XR, Vantac RF007). It was asked for in iNavFlight/inav#11184.
What changes
MSP2_INAV_ESC_SRXL2_STATUS: reads the board's connectors that the firmware appends (a count, then the serial port identifier behind each). Older firmware sends none, and then nothing below appears.esc_srxl2_connector, off by default. The SRXL2 texts then describe both routes, count the connector as motor 1 when the board uses it, and warn when the connector's UART has a function in Ports, because the firmware then leaves the connector unused.Tested
npm test: 290 of 291 pass. The one failure, "unused MZTC writes remain unused and conservatively blocked", fails the same way on maintenance-10.x.Screenshots (SITL, UART2 standing in for the connector)
Outputs tab, the connector in use:
The toggle turned off and not saved yet:
Ports tab, UART2 locked while it carries the ESC: