From 8b8b3947921fb6b2747398b32b63096214f53f36 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Fri, 22 Apr 2016 16:21:31 -0700 Subject: [PATCH] Hide FIFO hack inside StreamOutput. First step in a long refactor and evolution of the capture code. --- firmware/application/capture_thread.hpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/firmware/application/capture_thread.hpp b/firmware/application/capture_thread.hpp index 077731edd..d9977da07 100644 --- a/firmware/application/capture_thread.hpp +++ b/firmware/application/capture_thread.hpp @@ -38,8 +38,7 @@ using namespace hackrf::one; class StreamOutput { public: StreamOutput( - FIFO* const fifo - ) : fifo { fifo } + ) : fifo { reinterpret_cast*>(shared_memory.FIFO_HACK) } { } @@ -104,12 +103,7 @@ private: return false; } - auto fifo = reinterpret_cast*>(shared_memory.FIFO_HACK); - if( !fifo ) { - return false; - } - - StreamOutput stream { fifo }; + StreamOutput stream; while( !chThdShouldTerminate() ) { chEvtWaitAny(EVT_FIFO_HIGHWATER);