From 6d80c979d82e68817dbe24abab3cf63679164b49 Mon Sep 17 00:00:00 2001 From: Vasily Davydov Date: Thu, 18 May 2023 23:34:48 +0300 Subject: [PATCH] threads: rotary: [#46] use new Event --- source/shoh/src/threads/rotary/Rotary.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/shoh/src/threads/rotary/Rotary.cpp b/source/shoh/src/threads/rotary/Rotary.cpp index a161c5b..7baa5f3 100644 --- a/source/shoh/src/threads/rotary/Rotary.cpp +++ b/source/shoh/src/threads/rotary/Rotary.cpp @@ -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(ThreadCommon::QueueManager::master_event_all, p_e, 10); + data.setEvent(Event::EventType::Rotary, action_from_rotary_isr); + _qm->send(ThreadCommon::QueueManager::master_event_all, &data, 10); } }