From dbc2a5c9eaf6c9961c6bf0de29c88f856b125ca5 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Sun, 19 Jun 2016 11:20:45 -0700 Subject: [PATCH] Hide CaptureThread event mask, only used internally. --- firmware/application/capture_thread.cpp | 6 +++--- firmware/application/capture_thread.hpp | 2 ++ firmware/application/event_m0.hpp | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/firmware/application/capture_thread.cpp b/firmware/application/capture_thread.cpp index 50ed7a27..726076bc 100644 --- a/firmware/application/capture_thread.cpp +++ b/firmware/application/capture_thread.cpp @@ -92,7 +92,7 @@ CaptureThread::CaptureThread( CaptureThread::~CaptureThread() { if( thread ) { chThdTerminate(thread); - chEvtSignal(thread, EVT_MASK_CAPTURE_THREAD); + chEvtSignal(thread, event_mask_loop_wake); chThdWait(thread); thread = nullptr; } @@ -108,7 +108,7 @@ void CaptureThread::check_fifo_isr() { const auto fifo = StreamOutput::fifo_buffers_full; if( fifo ) { if( !fifo->is_empty() ) { - chEvtSignalI(thread, EVT_MASK_CAPTURE_THREAD); + chEvtSignalI(thread, event_mask_loop_wake); } } } @@ -125,7 +125,7 @@ Optional CaptureThread::run() { } stream.release_buffer(buffer); } else { - chEvtWaitAny(EVT_MASK_CAPTURE_THREAD); + chEvtWaitAny(event_mask_loop_wake); } } diff --git a/firmware/application/capture_thread.hpp b/firmware/application/capture_thread.hpp index 6842982c..2b35423e 100644 --- a/firmware/application/capture_thread.hpp +++ b/firmware/application/capture_thread.hpp @@ -57,6 +57,8 @@ public: static void check_fifo_isr(); private: + static constexpr auto event_mask_loop_wake = EVENT_MASK(0); + CaptureConfig config; std::unique_ptr writer; Optional last_error; diff --git a/firmware/application/event_m0.hpp b/firmware/application/event_m0.hpp index 6c716488..0344905d 100644 --- a/firmware/application/event_m0.hpp +++ b/firmware/application/event_m0.hpp @@ -44,7 +44,6 @@ constexpr auto EVT_MASK_SWITCHES = EVENT_MASK(3); constexpr auto EVT_MASK_ENCODER = EVENT_MASK(4); constexpr auto EVT_MASK_TOUCH = EVENT_MASK(5); constexpr auto EVT_MASK_APPLICATION = EVENT_MASK(6); -constexpr auto EVT_MASK_CAPTURE_THREAD = EVENT_MASK(7); class EventDispatcher { public: