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:
@@ -1,6 +1,8 @@
|
||||
// hal/switch_stub.h
|
||||
// components/hal/switch_stub.h
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
class SwitchStub {
|
||||
public:
|
||||
virtual ~SwitchStub() {}
|
||||
@@ -21,4 +23,19 @@ struct SwitchState {
|
||||
bool previous_state; // Previous state (for debounce)
|
||||
uint32_t last_change_time; // Timestamp of last state change
|
||||
uint32_t debounce_time; // Debounce time in ms
|
||||
};
|
||||
};
|
||||
|
||||
// Default stub implementation
|
||||
class DefaultSwitchStub : public SwitchStub {
|
||||
private:
|
||||
static const uint8_t NUM_SWITCHES = 10;
|
||||
SwitchState switch_states[NUM_SWITCHES];
|
||||
bool initialized;
|
||||
|
||||
public:
|
||||
DefaultSwitchStub();
|
||||
void begin() override;
|
||||
bool is_pressed(uint8_t switch_id) override;
|
||||
void configure_switch(uint8_t switch_id, uint8_t gpio_pin) override;
|
||||
void set_debounce_time(uint32_t time_ms) override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user