From 003ce4990d135a4e1c8027c06f2ee78978ca8a73 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Tue, 21 Jun 2016 12:15:57 -0700 Subject: [PATCH] Move CaptureThread::static_fn into .cpp. --- firmware/application/capture_thread.cpp | 13 +++++++++++++ firmware/application/capture_thread.hpp | 13 +------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/firmware/application/capture_thread.cpp b/firmware/application/capture_thread.cpp index 47ea252e..4de5cd53 100644 --- a/firmware/application/capture_thread.cpp +++ b/firmware/application/capture_thread.cpp @@ -109,6 +109,19 @@ void CaptureThread::check_fifo_isr() { } } +msg_t CaptureThread::static_fn(void* arg) { + auto obj = static_cast(arg); + const auto error = obj->run(); + if( error.is_valid() && obj->error_callback ) { + obj->error_callback(error.value()); + } else { + if( obj->success_callback ) { + obj->success_callback(); + } + } + return 0; +} + Optional CaptureThread::run() { StreamOutput stream { &config }; diff --git a/firmware/application/capture_thread.hpp b/firmware/application/capture_thread.hpp index 7fddd1f5..849a3131 100644 --- a/firmware/application/capture_thread.hpp +++ b/firmware/application/capture_thread.hpp @@ -65,18 +65,7 @@ private: std::function error_callback; static Thread* thread; - static msg_t static_fn(void* arg) { - auto obj = static_cast(arg); - const auto error = obj->run(); - if( error.is_valid() && obj->error_callback ) { - obj->error_callback(error.value()); - } else { - if( obj->success_callback ) { - obj->success_callback(); - } - } - return 0; - } + static msg_t static_fn(void* arg); Optional run(); };