Pixel 6 pulses on MIDI Clock beat (0xF8) - all on Core 0

- Detect 0xF8 in midi_transport.cpp (runs on Core 0)
- Every 24th tick = beat, flash pixel 6 white
- Instant-on, quadratic fade over 80ms, restore to dim
- All FastLED calls stay on Core 0, no cross-core conflict
This commit is contained in:
ash
2026-07-02 08:37:36 +00:00
parent 76a584a5ef
commit 748d2ef99f
3 changed files with 36 additions and 1 deletions
+8
View File
@@ -2,6 +2,8 @@
#include <Arduino.h>
#include "Adafruit_TinyUSB.h"
volatile uint32_t midi_tick_count = 0;
static Adafruit_USBD_MIDI usb_midi;
UsbMidiTransport::UsbMidiTransport() : initialized(false) {
@@ -51,6 +53,12 @@ void UsbMidiTransport::update() {
while (usb_midi.available()) {
uint8_t packet[4];
if (usb_midi.readPacket(packet)) {
uint8_t cin = packet[0] & 0x0F;
if (cin == 0x0F) {
if (packet[1] == 0xF8) midi_tick_count++;
continue;
}
MidiEvent event;
parse_midi_packet(packet, 4, event);