Move CaptureThread::static_fn into .cpp.

This commit is contained in:
Jared Boone 2016-06-21 12:15:57 -07:00
parent 264c19b312
commit 003ce4990d
2 changed files with 14 additions and 12 deletions

View File

@ -109,6 +109,19 @@ void CaptureThread::check_fifo_isr() {
}
}
msg_t CaptureThread::static_fn(void* arg) {
auto obj = static_cast<CaptureThread*>(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<File::Error> CaptureThread::run() {
StreamOutput stream { &config };

View File

@ -65,18 +65,7 @@ private:
std::function<void(File::Error)> error_callback;
static Thread* thread;
static msg_t static_fn(void* arg) {
auto obj = static_cast<CaptureThread*>(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<File::Error> run();
};