Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/main/io/motor_srxl2.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,14 @@ static void srxl2ProcessEsc(srxl2Esc_t *e, timeMs_t now)
{
srxl2DrainRx(e);

// A frame handled in the line above stamps itself with a time taken after the one this
// cycle began with. Left alone, the unsigned difference against that older stamp wraps,
// the reading it just brought reads as 49 days old, and the telemetry is thrown away
// until the next frame arrives. Measured on an Avian: about one frame in a hundred, and
// with the ESC answering roughly twice a second, up to a second of telemetry lost each
// time. So the time is taken again, now that everything received has been accounted for
now = millis();

/* A deferred baud change completes as soon as the broadcast has left. */
if (e->baudSwitchPending && isSerialTransmitBufferEmpty(e->port)) {
serialSetBaudRate(e->port, SRXL2_BAUD_HIGH);
Expand Down
Loading