aboutsummaryrefslogtreecommitdiff
path: root/keyboards/mechmini/v1/v1.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/mechmini/v1/v1.c')
-rw-r--r--keyboards/mechmini/v1/v1.c60
1 files changed, 6 insertions, 54 deletions
diff --git a/keyboards/mechmini/v1/v1.c b/keyboards/mechmini/v1/v1.c
index 508d60c78..2c910d965 100644
--- a/keyboards/mechmini/v1/v1.c
+++ b/keyboards/mechmini/v1/v1.c
@@ -16,61 +16,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#include "v1.h" 18#include "v1.h"
19#include <avr/pgmspace.h>
20#include "action_layer.h"
21#include "i2c.h"
22#include "quantum.h"
23#include "rgblight.h"
24 19
25// for keyboard subdirectory level init functions 20void matrix_init_kb(void) { matrix_init_user(); }
26// @Override
27void matrix_init_kb(void) {
28 // call user level keymaps, if any
29 matrix_init_user();
30}
31 21
32#ifdef RGBLIGHT_ENABLE 22__attribute__ ((weak))
33extern rgblight_config_t rgblight_config; 23void matrix_init_user(void) {}
34 24
35// custom RGB driver 25void matrix_scan_kb(void) { matrix_scan_user(); }
36void rgblight_set(void) {
37 if (!rgblight_config.enable) {
38 for (uint8_t i=0; i<RGBLED_NUM; i++) {
39 led[i].r = 0;
40 led[i].g = 0;
41 led[i].b = 0;
42 }
43 }
44 26
45 i2c_init(); 27__attribute__ ((weak))
46 i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); 28void matrix_scan_user(void) {}
47}
48
49bool rgb_init = false;
50
51void matrix_scan_kb(void) {
52 // if LEDs were previously on before poweroff, turn them back on
53 if (rgb_init == false && rgblight_config.enable) {
54 i2c_init();
55 i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
56 rgb_init = true;
57 }
58
59 rgblight_task();
60#else
61void matrix_scan_kb(void) {
62#endif
63 matrix_scan_user();
64 /* Nothing else for now. */
65}
66
67__attribute__((weak)) // overridable
68void matrix_init_user(void) {
69
70}
71
72
73__attribute__((weak)) // overridable
74void matrix_scan_user(void) {
75
76}