diff --git a/include/led_stub.h b/include/led_stub.h index 87ce4cd..5537f37 100644 --- a/include/led_stub.h +++ b/include/led_stub.h @@ -35,8 +35,6 @@ private: bool initialized; uint32_t activity_off_time = 0; uint8_t saved_r = 0, saved_g = 0, saved_b = 0; - uint32_t heartbeat_time = 0; - uint8_t heartbeat_phase = 0; public: DefaultLedStub(); diff --git a/pre_build.py b/pre_build.py index 44255af..603e007 100644 --- a/pre_build.py +++ b/pre_build.py @@ -30,12 +30,15 @@ def patch_usb_ids(): '#define USB_PID 0x1001', '#define USB_PID 0x0103' ) - # Add manufacturer/product if not present + # Add or replace manufacturer/product if 'USB_MANUFACTURER' not in content: content = content.replace( '#define USB_PID 0x0103', - '#define USB_PID 0x0103\n#define USB_MANUFACTURER "Novation"\n#define USB_PRODUCT "Launchpad X"' + '#define USB_PID 0x0103\n#define USB_MANUFACTURER "JOC"\n#define USB_PRODUCT "JOC Midi"' ) + else: + content = content.replace('USB_MANUFACTURER "Novation"', 'USB_MANUFACTURER "JOC"') + content = content.replace('USB_PRODUCT "Launchpad X"', 'USB_PRODUCT "JOC Midi"') with open(pins_file, 'w') as f: f.write(content) diff --git a/src/led_stub.cpp b/src/led_stub.cpp index 4319482..8e4b3fb 100644 --- a/src/led_stub.cpp +++ b/src/led_stub.cpp @@ -294,19 +294,4 @@ void DefaultLedStub::update() { mux_ptr->show(); activity_off_time = 0; } - - // Heartbeat: pulse LED 9 slowly (amber) - if (now - heartbeat_time > 2000 && !activity_off_time) { - heartbeat_time = now; - heartbeat_phase = 1; - } - if (heartbeat_phase && !activity_off_time) { - uint8_t brightness = (heartbeat_phase < 100) ? (heartbeat_phase * 2) : (400 - heartbeat_phase * 2); - if (!led_states[9].active) { - mux_ptr->set_led_color(9, brightness, brightness / 4, 0); - mux_ptr->show(); - } - heartbeat_phase++; - if (heartbeat_phase > 200) heartbeat_phase = 0; - } }