]> git.donarmstrong.com Git - qmk_firmware.git/blob - keyboards/bigswitch/bigswitch.c
[Keyboard] Snagpad Configurator bugfix and readme refactor (#6381)
[qmk_firmware.git] / keyboards / bigswitch / bigswitch.c
1 /*
2 Copyright 2018 QMK Contributors
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 */
17 #include "bigswitch.h"
18
19 volatile uint8_t runonce = true;
20 static uint16_t my_timer;
21
22 __attribute__ ((weak))
23 void matrix_init_user(void) {
24   my_timer = timer_read();
25 }
26
27 __attribute__ ((weak))
28 void matrix_scan_user(void) {
29 #if defined(RGBLIGHT_ENABLE)
30   if (runonce && timer_elapsed(my_timer) > 1000) {
31     runonce = false;
32     rgblight_sethsv_noeeprom(0x0, 0xff, 0x80);
33     rgblight_mode_noeeprom(9);
34     rgblight_enable_noeeprom();
35   }
36 #endif
37 }