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
|
### Added
|
||||||
- DAC with Lua #5601
|
- DAC with Lua #5601
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Changing idle stepper settings causes kernel panic
|
||||||
|
|
||||||
## October 2023 "Day 591"
|
## October 2023 "Day 591"
|
||||||
|
|
||||||
### Breaking Changes
|
### Breaking Changes
|
||||||
|
|
|
@ -19,6 +19,7 @@ class ThreadController : public chibios_rt::BaseStaticThread<TStackSize>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
const tprio_t m_prio;
|
const tprio_t m_prio;
|
||||||
|
bool m_started = false;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Override this function to implement your controller's thread's behavior.
|
// Override this function to implement your controller's thread's behavior.
|
||||||
|
@ -44,6 +45,10 @@ public:
|
||||||
*/
|
*/
|
||||||
void start()
|
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