Prevent multiple-starts on a thread from causing panic #265

This commit is contained in:
Matthew Kennedy 2023-10-12 16:08:53 -07:00
parent 5e01450fee
commit b8c715719a
2 changed files with 7 additions and 1 deletions

View File

@ -49,6 +49,7 @@ Release template (copy/paste this for new release):
- Always operate in "two wire" mode for batch fuel, fixing batch firing order #23
- Fix "Toyota 3 Tooth Cam" VVT mode (1JZ, 2JZ, 1G, etc) actually works now #237
- Fix autotune while TS project is in AFR mode - corrections now made properly for target AFR table values
- Changing idle stepper settings causes kernel panic #265
## May 2023 Release

View File

@ -19,6 +19,7 @@ class ThreadController : public chibios_rt::BaseStaticThread<TStackSize>
{
private:
const tprio_t m_prio;
bool m_started = false;
protected:
// Override this function to implement your controller's thread's behavior.
@ -44,6 +45,10 @@ public:
*/
void start()
{
chibios_rt::BaseStaticThread<TStackSize>::start(m_prio);
if (!m_started)
{
m_started = true;
chibios_rt::BaseStaticThread<TStackSize>::start(m_prio);
}
}
};