2 Copyright 2018 QMK Contributors
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.
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.
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/>.
17 #include "bigswitch.h"
19 volatile uint8_t runonce = true;
20 static uint16_t my_timer;
22 __attribute__ ((weak))
23 void matrix_init_user(void) {
24 my_timer = timer_read();
27 __attribute__ ((weak))
28 void matrix_scan_user(void) {
29 #if defined(RGBLIGHT_ENABLE)
30 if (runonce && timer_elapsed(my_timer) > 1000) {
32 rgblight_sethsv_noeeprom(0x0, 0xff, 0x80);
33 rgblight_mode_noeeprom(9);
34 rgblight_enable_noeeprom();