important bugfix for host osal

This commit is contained in:
Robin Müller 2020-12-02 00:58:13 +01:00
parent 73d3defe9f
commit 8ad30d489a

View File

@ -89,6 +89,10 @@ ReturnValue_t PeriodicTask::sleepFor(uint32_t ms) {
} }
void PeriodicTask::taskFunctionality() { void PeriodicTask::taskFunctionality() {
for (const auto& object: objectList) {
object->initializeAfterTaskCreation();
}
std::chrono::milliseconds periodChrono(static_cast<uint32_t>(period*1000)); std::chrono::milliseconds periodChrono(static_cast<uint32_t>(period*1000));
auto currentStartTime { auto currentStartTime {
std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::duration_cast<std::chrono::milliseconds>(
@ -101,9 +105,8 @@ void PeriodicTask::taskFunctionality() {
if(terminateThread.load()) { if(terminateThread.load()) {
break; break;
} }
for (ObjectList::iterator it = objectList.begin(); for (const auto& object: objectList) {
it != objectList.end(); ++it) { object->performOperation();
(*it)->performOperation();
} }
if(not delayForInterval(&currentStartTime, periodChrono)) { if(not delayForInterval(&currentStartTime, periodChrono)) {
sif::warning << "PeriodicTask: " << taskName << sif::warning << "PeriodicTask: " << taskName <<