Convert to PlatformIO/Arduino format
- Replace ESP-IDF structure with PlatformIO (platformio.ini) - Move source files to src/ and include/ - Move libraries to lib/ directory - Replace FreeRTOS with Arduino task/vTaskDelay - Use Arduino MIDI library instead of raw TinyUSB - Dual-core: MIDI on core 0, controller on core 1
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include "midi_transport.h"
|
||||
#include "led_stub.h"
|
||||
#include "switch_stub.h"
|
||||
|
||||
struct PadMapping {
|
||||
uint8_t physical_switch;
|
||||
uint8_t midi_channel;
|
||||
uint8_t midi_note;
|
||||
uint8_t led_index;
|
||||
};
|
||||
|
||||
class AppTask {
|
||||
public:
|
||||
AppTask(LedStub* led, SwitchStub* sw, UsbMidiTransport* midi);
|
||||
|
||||
void begin();
|
||||
void update();
|
||||
|
||||
private:
|
||||
LedStub* led_driver;
|
||||
SwitchStub* switch_driver;
|
||||
UsbMidiTransport* midi_transport;
|
||||
|
||||
static const uint8_t NUM_PADS = 10;
|
||||
PadMapping pad_mapping[NUM_PADS];
|
||||
bool last_switch_state[NUM_PADS];
|
||||
|
||||
void process_midi_event(const MidiEvent& event);
|
||||
void process_switch_event(uint8_t switch_id, bool pressed);
|
||||
};
|
||||
Reference in New Issue
Block a user