-
At the moment, the wrapper implementation of modm::Thread inside the freeRtos module is useless, because the modm::rtos::Thread::Thread(uint32_t priority,
uint16_t stackDepth,
const char* name)
{
xTaskCreate(
&wrapper,
name ? name : "anon",
(stackDepth / 4) + 1,
this,
priority,
&this->handle);
} This makes no real sense to me, the constructor should be empty. Because Task can be created dynamically (will malloc anyways at the point of construction) one should be able to declare Threads without running them - and run them at a later stage in the programm (interrupt controlled for example) respectively |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
modm inherited the wrappers from a now defunct code base by @roboterclubaachen in 2008, where they were used to abstract a common interface for I don't like these classes, I think the abstraction is very shallow and doesn't add much value. So if you want to change it, feel free to open a PR, however, it's perhaps better to use the FreeRTOS API directly and just ignore this abstraction. |
Beta Was this translation helpful? Give feedback.
-
Well.ok :) |
Beta Was this translation helpful? Give feedback.
-
I think it would make sense to implement the I'm probably also not the first person to come up with this idea, so there's likely already something out there? |
Beta Was this translation helpful? Give feedback.
modm inherited the wrappers from a now defunct code base by @roboterclubaachen in 2008, where they were used to abstract a common interface for
std::thread
and whatever FreeRTOS API was available back then, so that embedded code could run on the desktop with less modification.I don't like these classes, I think the abstraction is very shallow and doesn't add much value. So if you want to change it, feel free to open a PR, however, it's perhaps better to use the FreeRTOS API directly and just ignore this abstraction.