Fix Phase 1 skeleton: add build system, fix compilation errors

- Add CMakeLists.txt for project and all components
- Add idf_component.yml with TinyUSB dependency
- Create switch_stub.cpp implementation
- Fix app_task.h to match .cpp implementation (2-param signature)
- Fix led_stub.h/cpp class naming (DefaultLedStub)
- Fix midi_transport.cpp TinyUSB API usage (tud_midi_*)
- Move main.cpp to main/ directory
- Add sdkconfig.defaults for ESP32-S3
This commit is contained in:
2026-06-23 08:59:53 +00:00
parent db4b63c755
commit 458cb5060f
15 changed files with 234 additions and 200 deletions
+18 -4
View File
@@ -1,6 +1,8 @@
// hal/led_stub.h
// components/hal/led_stub.h
#pragma once
#include <cstdint>
class LedStub {
public:
virtual ~LedStub() {}
@@ -11,8 +13,6 @@ public:
// Helper function to map MIDI note to LED index
virtual uint8_t note_to_index(uint8_t note) {
// Default implementation - direct mapping
// Can be overridden by specific implementations
return note;
}
};
@@ -24,4 +24,18 @@ struct LedState {
uint8_t velocity; // Color/brightness (0-127)
uint32_t timestamp; // When state was set
bool active; // Current on/off state
};
};
// Default stub implementation
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;
};