feat(sync): added periodicDelay function to threads

This commit is contained in:
@CarlWachter
2024-06-16 10:44:24 +02:00
committed by carlwachter
parent e03f624c5b
commit 40727728d0
2 changed files with 34 additions and 1 deletions

View File

@@ -128,6 +128,14 @@ namespace sta
*/
void sleep(uint32_t ticks);
/**
* @brief Sleep until next period. Sets itself to WAITING if the watchdog is enabled, preventing
* the watchdog from restarting this thread.
*
* @param frequency
*/
void periodicDelay(uint32_t frequency);
#ifdef STA_CAN_BUS_ENABLE
/**
* @brief Set the ID of the CAN bus this thread is associated with.
@@ -216,6 +224,7 @@ namespace sta
uint32_t canID_;
#endif // STA_TACOS_WATCHDOG_ENABLED
bool terminate_;
uint32_t previous_tick_;
};
}
}