mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-01-13 01:23:38 +00:00
Move CaptureThread::static_fn into .cpp.
This commit is contained in:
parent
264c19b312
commit
003ce4990d
@ -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 };
|
||||
|
||||
|
@ -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();
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user