threads: rotary: [#46] use new Event

This commit is contained in:
Vasily Davydov 2023-05-18 23:34:48 +03:00
parent c5692fd5ba
commit 6d80c979d8

View File

@ -70,13 +70,13 @@ Rotary::~Rotary()
void Rotary::taskFunction()
{
auto action_from_rotary_isr = ThreadCommon::RotaryAction::Idle;
Event * p_e= new Event(Event::EventType::Rotary, action_from_rotary_isr);
Event data(Event::EventType::Rotary, action_from_rotary_isr);
for (;;)
{
xQueueReceive(*p_rotary_isr_q, &action_from_rotary_isr, portMAX_DELAY);
p_e->setDataOf(Event::EventType::Rotary, action_from_rotary_isr);
_qm->send<Event>(ThreadCommon::QueueManager::master_event_all, p_e, 10);
data.setEvent(Event::EventType::Rotary, action_from_rotary_isr);
_qm->send<Event>(ThreadCommon::QueueManager::master_event_all, &data, 10);
}
}