mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-25 07:10:43 -04:00
Formatted code (#1007)
* Updated style * Updated files * fixed new line * Updated spacing * File fix WIP * Updated to clang 13 * updated comment style * Removed old comment code
This commit is contained in:
parent
7aca7ce74d
commit
033c4e9a5b
599 changed files with 70746 additions and 66896 deletions
|
@ -28,85 +28,85 @@
|
|||
#include "io.hpp"
|
||||
|
||||
class BufferExchange {
|
||||
public:
|
||||
BufferExchange(CaptureConfig* const config);
|
||||
BufferExchange(ReplayConfig* const config);
|
||||
~BufferExchange();
|
||||
public:
|
||||
BufferExchange(CaptureConfig* const config);
|
||||
BufferExchange(ReplayConfig* const config);
|
||||
~BufferExchange();
|
||||
|
||||
BufferExchange(const BufferExchange&) = delete;
|
||||
BufferExchange(BufferExchange&&) = delete;
|
||||
BufferExchange& operator=(const BufferExchange&) = delete;
|
||||
BufferExchange& operator=(BufferExchange&&) = delete;
|
||||
BufferExchange(const BufferExchange&) = delete;
|
||||
BufferExchange(BufferExchange&&) = delete;
|
||||
BufferExchange& operator=(const BufferExchange&) = delete;
|
||||
BufferExchange& operator=(BufferExchange&&) = delete;
|
||||
|
||||
#if defined(LPC43XX_M0)
|
||||
bool empty() const {
|
||||
return fifo_buffers_for_application->is_empty();
|
||||
}
|
||||
bool empty() const {
|
||||
return fifo_buffers_for_application->is_empty();
|
||||
}
|
||||
|
||||
StreamBuffer* get() {
|
||||
return get(fifo_buffers_for_application);
|
||||
}
|
||||
|
||||
StreamBuffer* get_prefill() {
|
||||
return get_prefill(fifo_buffers_for_application);
|
||||
}
|
||||
StreamBuffer* get() {
|
||||
return get(fifo_buffers_for_application);
|
||||
}
|
||||
|
||||
bool put(StreamBuffer* const p) {
|
||||
return fifo_buffers_for_baseband->in(p);
|
||||
}
|
||||
|
||||
bool put_app(StreamBuffer* const p) {
|
||||
return fifo_buffers_for_application->in(p);
|
||||
}
|
||||
StreamBuffer* get_prefill() {
|
||||
return get_prefill(fifo_buffers_for_application);
|
||||
}
|
||||
|
||||
bool put(StreamBuffer* const p) {
|
||||
return fifo_buffers_for_baseband->in(p);
|
||||
}
|
||||
|
||||
bool put_app(StreamBuffer* const p) {
|
||||
return fifo_buffers_for_application->in(p);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(LPC43XX_M4)
|
||||
bool empty() const {
|
||||
return fifo_buffers_for_baseband->is_empty();
|
||||
}
|
||||
bool empty() const {
|
||||
return fifo_buffers_for_baseband->is_empty();
|
||||
}
|
||||
|
||||
StreamBuffer* get() {
|
||||
return get(fifo_buffers_for_baseband);
|
||||
}
|
||||
StreamBuffer* get() {
|
||||
return get(fifo_buffers_for_baseband);
|
||||
}
|
||||
|
||||
bool put(StreamBuffer* const p) {
|
||||
return fifo_buffers_for_application->in(p);
|
||||
}
|
||||
bool put(StreamBuffer* const p) {
|
||||
return fifo_buffers_for_application->in(p);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void handle_isr() {
|
||||
if( obj ) {
|
||||
obj->check_fifo_isr();
|
||||
}
|
||||
}
|
||||
static void handle_isr() {
|
||||
if (obj) {
|
||||
obj->check_fifo_isr();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
//CaptureConfig* const config_capture;
|
||||
//ReplayConfig* const config_replay;
|
||||
FIFO<StreamBuffer*>* fifo_buffers_for_baseband { nullptr };
|
||||
FIFO<StreamBuffer*>* fifo_buffers_for_application { nullptr };
|
||||
Thread* thread { nullptr };
|
||||
static BufferExchange* obj;
|
||||
|
||||
enum {
|
||||
CAPTURE,
|
||||
REPLAY
|
||||
} direction { };
|
||||
private:
|
||||
// CaptureConfig* const config_capture;
|
||||
// ReplayConfig* const config_replay;
|
||||
FIFO<StreamBuffer*>* fifo_buffers_for_baseband{nullptr};
|
||||
FIFO<StreamBuffer*>* fifo_buffers_for_application{nullptr};
|
||||
Thread* thread{nullptr};
|
||||
static BufferExchange* obj;
|
||||
|
||||
void check_fifo_isr() {
|
||||
if (!empty())
|
||||
wakeup_isr();
|
||||
}
|
||||
enum {
|
||||
CAPTURE,
|
||||
REPLAY
|
||||
} direction{};
|
||||
|
||||
void wakeup_isr() {
|
||||
auto thread_tmp = thread;
|
||||
if( thread_tmp ) {
|
||||
thread = nullptr;
|
||||
chSchReadyI(thread_tmp);
|
||||
}
|
||||
}
|
||||
void check_fifo_isr() {
|
||||
if (!empty())
|
||||
wakeup_isr();
|
||||
}
|
||||
|
||||
StreamBuffer* get(FIFO<StreamBuffer*>* fifo);
|
||||
|
||||
StreamBuffer* get_prefill(FIFO<StreamBuffer*>* fifo);
|
||||
void wakeup_isr() {
|
||||
auto thread_tmp = thread;
|
||||
if (thread_tmp) {
|
||||
thread = nullptr;
|
||||
chSchReadyI(thread_tmp);
|
||||
}
|
||||
}
|
||||
|
||||
StreamBuffer* get(FIFO<StreamBuffer*>* fifo);
|
||||
|
||||
StreamBuffer* get_prefill(FIFO<StreamBuffer*>* fifo);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue