9078001404
- 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
34 lines
721 B
C++
34 lines
721 B
C++
#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);
|
|
};
|