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,37 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class LedStub {
|
||||
public:
|
||||
virtual ~LedStub() {}
|
||||
|
||||
virtual void begin() = 0;
|
||||
virtual void set_led_state(uint8_t note, uint8_t channel, uint8_t velocity) = 0;
|
||||
virtual void clear_all() = 0;
|
||||
|
||||
virtual uint8_t note_to_index(uint8_t note) {
|
||||
return note;
|
||||
}
|
||||
};
|
||||
|
||||
struct LedState {
|
||||
uint8_t note;
|
||||
uint8_t channel;
|
||||
uint8_t velocity;
|
||||
uint32_t timestamp;
|
||||
bool active;
|
||||
};
|
||||
|
||||
class DefaultLedStub : public LedStub {
|
||||
private:
|
||||
static const uint8_t NUM_LEDS = 10;
|
||||
LedState led_states[NUM_LEDS];
|
||||
bool initialized;
|
||||
|
||||
public:
|
||||
DefaultLedStub();
|
||||
void begin() override;
|
||||
void set_led_state(uint8_t note, uint8_t channel, uint8_t velocity) override;
|
||||
void clear_all() override;
|
||||
};
|
||||
Reference in New Issue
Block a user