fix(simulator): Crash if SBUS chosen as external module type (#3683)

This commit is contained in:
Michael
2023-06-15 10:30:03 +10:00
committed by GitHub
parent 5288441a82
commit 27b6f7cc6d
+3 -1
View File
@@ -140,7 +140,9 @@ static void sbusSendPulses(void* ctx, uint8_t* buffer, int16_t* channels, uint8_
auto drv_ctx = modulePortGetCtx(mod_st->tx);
// TODO: check if the port has an inverter and use it instead
drv->setPolarity(drv_ctx, GET_SBUS_POLARITY(module));
if(drv->setPolarity)
drv->setPolarity(drv_ctx, GET_SBUS_POLARITY(module));
drv->sendBuffer(drv_ctx, buffer, p_data - buffer);
// SBUS_PERIOD is not a constant! It can be set from UI