diff --git a/firmware/application/event_m0.cpp b/firmware/application/event_m0.cpp index 90e1cb34d..24861a19e 100644 --- a/firmware/application/event_m0.cpp +++ b/firmware/application/event_m0.cpp @@ -60,7 +60,6 @@ CH_IRQ_HANDLER(M4Core_IRQHandler) { MessageHandlerMap EventDispatcher::message_map_; Thread* EventDispatcher::thread_event_loop = nullptr; -Thread* EventDispatcher::thread_record = nullptr; EventDispatcher::EventDispatcher( ui::Widget* const top_widget, @@ -133,10 +132,6 @@ void EventDispatcher::dispatch(const eventmask_t events) { handle_lcd_frame_sync(); } - if( events & EVT_MASK_ENCODER ) { - handle_encoder(); - } - if( events & EVT_MASK_TOUCH ) { handle_touch(); } @@ -285,4 +280,5 @@ void EventDispatcher::init_message_queues() { new (&shared_memory.application_queue) MessageQueue( shared_memory.application_queue_data, SharedMemory::application_queue_k ); + } diff --git a/firmware/baseband-tx/clock_recovery.cpp b/firmware/baseband-tx/clock_recovery.cpp deleted file mode 100644 index 17cb5c70f..000000000 --- a/firmware/baseband-tx/clock_recovery.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. - * - * This file is part of PortaPack. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include "clock_recovery.hpp" diff --git a/firmware/baseband/stream_input.hpp b/firmware/baseband/stream_input.hpp index e82214776..cb4bbe4e1 100644 --- a/firmware/baseband/stream_input.hpp +++ b/firmware/baseband/stream_input.hpp @@ -22,22 +22,26 @@ #ifndef __STREAM_INPUT_H__ #define __STREAM_INPUT_H__ -#include "portapack_shared_memory.hpp" - +#include "message.hpp" #include "fifo.hpp" +#include "lpc43xx_cpp.hpp" +using namespace lpc43xx; + #include #include #include class StreamInput { public: - StreamInput(const size_t K, CaptureConfig& config) : - K { K }, + StreamInput(CaptureConfig* const config) : + config { config }, + K { config->write_size_log2 + config->buffer_count_log2 }, + event_bytes_mask { (1UL << config->write_size_log2) - 1 }, data { std::make_unique(1UL << K) }, fifo { data.get(), K } { - config.fifo = &fifo; + config->fifo = &fifo; } size_t write(const void* const data, const size_t length) { @@ -48,17 +52,16 @@ public: if( (bytes_written & event_bytes_mask) < (last_bytes_written & event_bytes_mask) ) { creg::m4txevent::assert(); } + config->baseband_bytes_received += length; + config->baseband_bytes_dropped = config->baseband_bytes_received - bytes_written; return written; } - uint64_t written() const { - return bytes_written; - } - private: + CaptureConfig* const config; const size_t K; - const uint64_t event_bytes_mask = (1ULL << (K - 2)) - 1; + const uint64_t event_bytes_mask; uint64_t bytes_written = 0; std::unique_ptr data; FIFO fifo;