Add VID/PID to build flags for ESP32 core + stronger visual indicators
- Set USB VID/PID via ESP32 core build flags (may work better than TinyUSB API) - Heartbeat on LED 9 (amber pulse every 2s) confirms device is alive - SysEx flashes ALL LEDs white for 200ms - Regular MIDI flashes LED 0 white for 50ms
This commit is contained in:
@@ -55,6 +55,7 @@ void AppTask::process_midi_event(const MidiEvent& event) {
|
||||
uint8_t cin = event.channel;
|
||||
uint8_t packet[3] = {event.data1, event.data2, 0};
|
||||
process_sysex_packet(packet, cin);
|
||||
led_driver->flash_sysex();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+28
-4
@@ -277,20 +277,44 @@ void DefaultLedStub::flash_activity() {
|
||||
}
|
||||
}
|
||||
|
||||
// Flash LED 0 white
|
||||
mux_ptr->set_led_color(0, 255, 255, 255);
|
||||
// Flash ALL LEDs white for SysEx (more visible), LED 0 for regular MIDI
|
||||
for (int i = 0; i < NUM_LEDS; i++) {
|
||||
mux_ptr->set_led_color(i, 255, 255, 255);
|
||||
}
|
||||
mux_ptr->show();
|
||||
activity_off_time = now + 30;
|
||||
activity_off_time = now + 50;
|
||||
}
|
||||
|
||||
void DefaultLedStub::flash_sysex() {
|
||||
if (!initialized || !mux_ptr) return;
|
||||
for (int i = 0; i < NUM_LEDS; i++) {
|
||||
mux_ptr->set_led_color(i, 255, 255, 255);
|
||||
}
|
||||
mux_ptr->show();
|
||||
activity_off_time = millis() + 200;
|
||||
}
|
||||
|
||||
void DefaultLedStub::update() {
|
||||
if (!initialized || !mux_ptr) return;
|
||||
|
||||
// Turn off activity flash after 30ms
|
||||
// Turn off activity flash
|
||||
uint32_t now = millis();
|
||||
if (activity_off_time > 0 && now >= activity_off_time) {
|
||||
mux_ptr->set_led_color(0, saved_r, saved_g, saved_b);
|
||||
mux_ptr->show();
|
||||
activity_off_time = 0;
|
||||
}
|
||||
|
||||
// Heartbeat: pulse LED 9 slowly so we know device is alive
|
||||
if (now - heartbeat_time > 2000) {
|
||||
heartbeat_time = now;
|
||||
heartbeat_phase = 1;
|
||||
}
|
||||
if (heartbeat_phase) {
|
||||
uint8_t brightness = (heartbeat_phase < 100) ? (heartbeat_phase * 2) : (400 - heartbeat_phase * 2);
|
||||
mux_ptr->set_led_color(9, brightness, brightness / 4, 0);
|
||||
mux_ptr->show();
|
||||
heartbeat_phase++;
|
||||
if (heartbeat_phase > 200) heartbeat_phase = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user