From c585f3d4eaf5a4dfb303d8273e6450245f7d844f Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Sat, 23 Apr 2016 17:28:31 -0700 Subject: [PATCH] Rename EVT_FIFO_HIGHWATER -> EVT_MASK_CAPTURE_THREAD. --- firmware/application/capture_thread.hpp | 7 +++---- firmware/application/event_m0.hpp | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/firmware/application/capture_thread.hpp b/firmware/application/capture_thread.hpp index 357c7720..68806f58 100644 --- a/firmware/application/capture_thread.hpp +++ b/firmware/application/capture_thread.hpp @@ -78,7 +78,7 @@ public: if( thread_tmp ) { thread = nullptr; chThdTerminate(thread_tmp); - chEvtSignal(thread_tmp, EVT_FIFO_HIGHWATER); + chEvtSignal(thread_tmp, EVT_MASK_CAPTURE_THREAD); const auto success = chThdWait(thread_tmp); if( !success ) { @@ -91,13 +91,12 @@ public: // TODO: Prevent over-signalling by transmitting a set of // flags from the baseband core. if( thread ) { - chEvtSignalI(thread, EVT_FIFO_HIGHWATER); + chEvtSignalI(thread, EVT_MASK_CAPTURE_THREAD); } } private: static constexpr size_t write_size = 16384; - static constexpr eventmask_t EVT_FIFO_HIGHWATER = 1; const std::string file_path; std::unique_ptr> write_buffer; @@ -117,7 +116,7 @@ private: StreamOutput stream; while( !chThdShouldTerminate() ) { - chEvtWaitAny(EVT_FIFO_HIGHWATER); + chEvtWaitAny(EVT_MASK_CAPTURE_THREAD); while( stream.available() >= write_buffer->size() ) { if( !transfer(stream, write_buffer.get()) ) { diff --git a/firmware/application/event_m0.hpp b/firmware/application/event_m0.hpp index 414a3a62..34b988e8 100644 --- a/firmware/application/event_m0.hpp +++ b/firmware/application/event_m0.hpp @@ -43,6 +43,7 @@ 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: