Something went wrong. Try again.
Opensource firmware for NRF52840 Pro Micro that copycats the Steam Controller 2 Puck and adds an Xbox and Switch mode
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829#include "status_led.h"#include <Arduino.h>
#define WAKE_LED_OFF ((WAKE_LED_ON)==HIGH ? LOW : HIGH)#define PULSE_MS 500u // wake flash duration
static unsigned long g_pulseMs = 0;static bool g_lit = false;
static void ledWrite(int level){ digitalWrite(WAKE_LED_PIN_A, level); digitalWrite(WAKE_LED_PIN_B, level);}
void ledInit(){ pinMode(WAKE_LED_PIN_A, OUTPUT); pinMode(WAKE_LED_PIN_B, OUTPUT); ledWrite(WAKE_LED_OFF);}
void ledWakePulse(){ g_pulseMs = millis(); g_lit = true; ledWrite(WAKE_LED_ON); // light immediately at the remoteWakeup() call site, not on the next loop}
void ledTask(){ if (g_lit && millis()-g_pulseMs >= PULSE_MS){ g_lit = false; ledWrite(WAKE_LED_OFF); }}