Send CaptureThread error into app-local message queue.

This commit is contained in:
Jared Boone 2016-06-21 11:04:10 -07:00
parent 76c5fe96af
commit cfaa44b02a
5 changed files with 42 additions and 17 deletions

View file

@ -77,9 +77,11 @@ Thread* CaptureThread::thread = nullptr;
CaptureThread::CaptureThread(
std::unique_ptr<Writer> writer,
size_t write_size,
size_t buffer_count
size_t buffer_count,
std::function<void(File::Error)>&& error_callback
) : config { write_size, buffer_count },
writer { std::move(writer) }
writer { std::move(writer) },
error_callback { std::move(error_callback) }
{
// Need significant stack for FATFS
thread = chThdCreateFromHeap(NULL, 1024, NORMALPRIO + 10, CaptureThread::static_fn, this);
@ -94,10 +96,6 @@ CaptureThread::~CaptureThread() {
}
}
const Optional<File::Error>& CaptureThread::error() const {
return last_error;
}
void CaptureThread::check_fifo_isr() {
// TODO: Prevent over-signalling by transmitting a set of
// flags from the baseband core.