mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-04-14 12:13:45 +02:00
17 lines
461 B
C++
17 lines
461 B
C++
#include "OpenIrisTasks.hpp"
|
|
|
|
void restart_the_board(void* arg)
|
|
{
|
|
esp_restart();
|
|
}
|
|
|
|
void OpenIrisTasks::ScheduleRestart(const int milliseconds)
|
|
{
|
|
esp_timer_handle_t timerHandle;
|
|
constexpr esp_timer_create_args_t args = {.callback = &restart_the_board, .arg = nullptr, .name = "restartBoard"};
|
|
|
|
if (const auto result = esp_timer_create(&args, &timerHandle); result == ESP_OK)
|
|
{
|
|
esp_timer_start_once(timerHandle, milliseconds);
|
|
}
|
|
} |