Prevent multiple-starts on a thread from causing panic
This commit is contained in:
parent
2374a47182
commit
6f52a25c2b
|
@ -31,6 +31,9 @@ Release template (copy/paste this for new release):
|
|||
### Added
|
||||
- DAC with Lua #5601
|
||||
|
||||
### Fixed
|
||||
- Changing idle stepper settings causes kernel panic
|
||||
|
||||
## October 2023 "Day 591"
|
||||
|
||||
### Breaking Changes
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue