Files
OpenIris-ESPIDF/components/OpenIrisTasks/OpenIrisTasks/OpenIrisTasks.cpp
Lorow b7bae7fb3e Add Proof of concept switching between UVC and Wi-Fi streaming based on the presence of Wi-Fi creds, rewrite restart task to esp_timer
TODO: Think about letting people set the mode explicitly so the board comes online faster
2025-05-20 23:09:06 +02:00

19 lines
458 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);
}
}