Test fix for WDT reset issue
This commit is contained in:
parent
9ec34310d2
commit
8fe0a53764
|
@ -602,6 +602,16 @@ namespace ratgdo {
|
|||
counter.value.rolling_code_counter.value->subscribe([=](uint32_t state) { defer("rolling_code_counter", [=] { f(state); }); });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RATGDOComponent::defer(std::function<void()> &&f) {
|
||||
App.scheduler.set_timeout(this, "", 0, [=](){ f(); App.feed_wdt();});
|
||||
}
|
||||
|
||||
void RATGDOComponent::defer(const std::string &name, std::function<void()> &&f) {
|
||||
App.scheduler.set_timeout(this, name, 0, [=](){ f(); App.feed_wdt();});
|
||||
}
|
||||
|
||||
void RATGDOComponent::subscribe_opening_duration(std::function<void(float)>&& f)
|
||||
{
|
||||
this->opening_duration.subscribe([=](float state) { defer("opening_duration", [=] { f(state); }); });
|
||||
|
|
|
@ -166,6 +166,9 @@ namespace ratgdo {
|
|||
void subscribe_sync_failed(std::function<void(bool)>&& f);
|
||||
void subscribe_learn_state(std::function<void(LearnState)>&& f);
|
||||
|
||||
|
||||
void defer(std::function<void()> &&f);
|
||||
void defer(const std::string &name, std::function<void()> &&f);
|
||||
protected:
|
||||
RATGDOStore isr_store_ {};
|
||||
protocol::Protocol* protocol_;
|
||||
|
|
Loading…
Reference in New Issue