Fixed timer starting

This commit is contained in:
dario 2023-09-27 09:54:40 +02:00
parent 2948c9203e
commit 430b8b8947
2 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@
#ifdef STA_RTOS_WATCHDOG_ENABLE
#include <sta/debug/assert.hpp>
#include <sta/debug/debug.hpp>
#include <sta/lang.hpp>
#include <sta/rtos/defs.hpp>
#include <sta/rtos/system/events.hpp>

View File

@ -12,7 +12,7 @@ namespace sta {
running_{false}
{
// Pass an anonymous function as the callback which will invoke the currently registered callback.
timer_id_ = osTimerNew(timeoutHandler, osTimerOnce, arg, &timer_attr_);
timer_id_ = osTimerNew(timeoutHandler, osTimerOnce, this, &timer_attr_);
STA_ASSERT_MSG(timer_id_ != NULL, "Failed to create timer!");
}