threads: relay: [#46] use new Event

This commit is contained in:
Vasily Davydov 2023-05-18 23:32:27 +03:00
parent 23dda8ba74
commit c5692fd5ba
2 changed files with 15 additions and 23 deletions

View File

@ -87,16 +87,10 @@ void Relay::taskFunction()
}
}
void Relay::parseEvent(Event* d)
void Relay::parseEvent(Event* e)
{
for (uint8_t i = Event::ExternalTemp; i <= Event::SetPoint; i++)
{
EventRawData rd = d->getDataOf(static_cast<Event::EventType>(i));
if(rd == ERROR_RETURN)
{
continue;
}
switch(i /* EventType */)
EventRawData rd = e->getData();
switch(e->getType() /* EventType */)
{
case Event::ExternalTemp:
ext_temp = rd;
@ -108,8 +102,6 @@ void Relay::parseEvent(Event* d)
assert(0);
break;
}
}
}
void Relay::utilizeEventData()

View File

@ -51,7 +51,7 @@ private:
RelayDevice relays [2] = {{0, 24, 0},
{0, 26, 1}};
void parseEvent(Event * d);
void parseEvent(Event * e);
int8_t setpoint, ext_temp;
};