FOME-Tech / fome-fw

Free Open Motorsports ECU
https://www.fome.tech
Other
46 stars 23 forks source link

KnockController: fix knock retard logic #377

Closed nmschulte closed 7 months ago

nmschulte commented 7 months ago

fixes #246


use method to determine maximum retard, versus the member which is unused (in favor of max knock retard table)

mck1117 commented 7 months ago

the member is set in onFastCallback(), no?

mck1117 commented 7 months ago

Doing it in onFastCallback() also avoids doing a potentially expensive table lookup in the hot path that gets called for every ignition event.

rusefillc commented 7 months ago

@nmschulte any interest to TDD? maybe test proving issue as first PR and flipping text while fixing in another PR?

nmschulte commented 7 months ago

@nmschulte any interest to TDD? maybe test proving issue as first PR and flipping text while fixing in another PR?

That's a good idea; I need to learn more about ChibiOS and the firmware architecture at large before I can go much further. Will close this PR as it's not the right solution.

rusefillc commented 7 months ago

That's a good idea; I need to learn more about ChibiOS and the firmware architecture at large before I can go much further.

Zero ChibiOS at https://github.com/FOME-Tech/fome-fw/tree/master/unit_tests yet extremely useful!