]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - keyboards/bigswitch/bigswitch.c
[Keyboard] Fix XD96 info.json (#6309)
[qmk_firmware.git] / keyboards / bigswitch / bigswitch.c
index 05935f2e9e7e5b6a67fa60988bcd51d682423fa5..32f9f7fab82aa8849246914251f38a3d213fe9e0 100644 (file)
@@ -16,7 +16,22 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 #include "bigswitch.h"
 
+volatile uint8_t runonce = true;
+static uint16_t my_timer;
+
+__attribute__ ((weak))
 void matrix_init_user(void) {
-  rgblight_enable();
-  rgblight_mode(9);
+  my_timer = timer_read();
+}
+
+__attribute__ ((weak))
+void matrix_scan_user(void) {
+#if defined(RGBLIGHT_ENABLE)
+  if (runonce && timer_elapsed(my_timer) > 1000) {
+    runonce = false;
+    rgblight_sethsv_noeeprom(0x0, 0xff, 0x80);
+    rgblight_mode_noeeprom(9);
+    rgblight_enable_noeeprom();
+  }
+#endif
 }