fix(radio): race condition on pulse buffer (#6634)

This commit is contained in:
Raphael Coeffic
2025-10-14 20:42:41 +10:00
committed by GitHub
parent 2cbd995f35
commit dd029bc591
22 changed files with 73 additions and 6 deletions
+10
View File
@@ -262,6 +262,8 @@ class ProtoState
void applyConfigFromModel();
bool fifoFull() { return trsp.fifoFull(); }
protected:
void resetConfig(uint8_t version);
@@ -1159,6 +1161,13 @@ static void sendPulses(void* ctx, uint8_t* buffer, int16_t* channels,
p_state->sendFrame();
}
static bool txCompleted(void* ctx)
{
auto mod_st = (etx_module_state_t*)ctx;
auto p_state = (ProtoState*)mod_st->user_data;
return !p_state->fifoFull();
}
etx_proto_driver_t ProtoDriver = {
.protocol = PROTOCOL_CHANNELS_AFHDS3,
.init = initModule,
@@ -1167,6 +1176,7 @@ etx_proto_driver_t ProtoDriver = {
.processData = processTelemetryData,
.processFrame = nullptr,
.onConfigChange = nullptr,
.txCompleted = txCompleted,
};
} // namespace afhds3