Closed SteveCEvans closed 2 weeks ago
Do you want to test this code? You can flash it directly from Betaflight Configurator:
#13589
(this pull request number) in the Select commit
field of the Configurator firmware flasher tab (you need to Enable expert mode
, Show release candidates
and Development
).WARNING: It may be unstable. Use only for testing!
@SteveCEvans you have 2 instances of motorConfig()->dev.useDshotTelemetry in dshot.c line 162 - initDshotTelemetry, maybe they also need replace with useDshotTelemetry
No, as initDshotTelemetry()
is only called from init()
just after the config is read, and not thereafter. The issue here was caused by motorConfig()->dev.useDshotTelemetry
being read when dshot_bidir
changed the value after everything was initialised. Reading the value during initialisation is OK. Note that rpmFilterInit()
is called not just on initial initialisation, but also when the profile
command is issued so that was causing an issue.
No, as
initDshotTelemetry()
is only called frominit()
just after the config is read, and not thereafter. The issue here was caused bymotorConfig()->dev.useDshotTelemetry
being read whendshot_bidir
changed the value after everything was initialised. Reading the value during initialisation is OK. Note thatrpmFilterInit()
is called not just on initial initialisation, but also when theprofile
command is issued so that was causing an issue.
Right, it is a job to get into and understand the source code :-)
Fixes #13581
motorConfig()->dev.useDshotTelemetry
was being referenced many times in the code and if the value was changed then uninitialised filters would be used etc. This PR uses the value cached upon initialisation of DSHOT, stored inuseDshotTelemetry
.