mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Merge remote-tracking branch 'upstream/master'
Conflicts: firmware/application/audio_thread.cpp firmware/application/event_m0.cpp firmware/application/time.cpp firmware/baseband-tx/clock_recovery.cpp firmware/baseband/stream_input.hpp firmware/common/message.hpp
This commit is contained in:
commit
c8d37e215b
@ -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
|
||||
);
|
||||
|
||||
}
|
||||
|
@ -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"
|
@ -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 <cstdint>
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
|
||||
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<uint8_t[]>(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<uint8_t[]> data;
|
||||
FIFO<uint8_t> fifo;
|
||||
|
Loading…
Reference in New Issue
Block a user