aboutsummaryrefslogtreecommitdiff
path: root/keyboards/infinity60/led_controller.c
diff options
context:
space:
mode:
authorjpetermans <tibcmhhm@gmail.com>2017-04-06 16:27:51 -0700
committerjpetermans <tibcmhhm@gmail.com>2017-04-06 16:27:51 -0700
commitaf13e9a12d64f74873e5bf429fdedcda37b3036a (patch)
tree5836346f81d5dc6fbf4ed354f968a3a02c921b54 /keyboards/infinity60/led_controller.c
parent56be3007570a3b6b2e2f78f500cea4fb22430459 (diff)
downloadqmk_firmware-af13e9a12d64f74873e5bf429fdedcda37b3036a.tar.gz
qmk_firmware-af13e9a12d64f74873e5bf429fdedcda37b3036a.zip
Moved led page arrays to keymap.c and added keymap header to define
individual led addresses
Diffstat (limited to 'keyboards/infinity60/led_controller.c')
-rw-r--r--keyboards/infinity60/led_controller.c51
1 files changed, 1 insertions, 50 deletions
diff --git a/keyboards/infinity60/led_controller.c b/keyboards/infinity60/led_controller.c
index c5303a3e7..9579bc08b 100644
--- a/keyboards/infinity60/led_controller.c
+++ b/keyboards/infinity60/led_controller.c
@@ -171,6 +171,7 @@ static THD_FUNCTION(LEDthread, arg) {
171 171
172 // process 'msg' here 172 // process 'msg' here
173 switch(msg) { 173 switch(msg) {
174//TODO: make this generic and able to turn on/off any address and loop through all(or current) pages
174 case LED_MSG_CAPS_ON: 175 case LED_MSG_CAPS_ON:
175 // turn caps on on pages 1 and 2 176 // turn caps on on pages 1 and 2
176 is31_write_register(0, CAPS_LOCK_LED_ADDRESS, 0xFF); 177 is31_write_register(0, CAPS_LOCK_LED_ADDRESS, 0xFF);
@@ -238,48 +239,6 @@ static THD_FUNCTION(LEDthread, arg) {
238 } 239 }
239} 240}
240 241
241//These relate to the LED map above, row and column
242//0x24 = first byte (CA1) of PWM page, 0x34 is 17th byte (CA2)
243/* LED game mode */
244const uint8_t led_game[72] = {
245 0x24,
246 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
247 0x34,
248 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
249 0x44,
250 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
251 0x54,
252 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
253 0x64,
254 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
255 0x74,
256 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
257 0x84,
258 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
259 0x94,
260 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
261};
262
263/* ALL LEDs */
264const uint8_t led_all[72] = {
265 0x24,
266 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
267 0x34,
268 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
2690x44,
270 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
271 0x54,
272 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
273 0x64,
274 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
275 0x74,
276 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
277 0x84,
278 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
279 0x94,
280 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
281};
282
283/* ============= 242/* =============
284 * hook into TMK 243 * hook into TMK
285 * ============= */ 244 * ============= */
@@ -315,14 +274,6 @@ void led_controller_init(void) {
315 is31_write_register(IS31_FUNCTIONREG, IS31_REG_BREATHCTRL1, (3<<4)|3); 274 is31_write_register(IS31_FUNCTIONREG, IS31_REG_BREATHCTRL1, (3<<4)|3);
316 is31_write_register(IS31_FUNCTIONREG, IS31_REG_BREATHCTRL2, IS31_REG_BREATHCTRL2_ENABLE|3); 275 is31_write_register(IS31_FUNCTIONREG, IS31_REG_BREATHCTRL2, IS31_REG_BREATHCTRL2_ENABLE|3);
317 276
318 /* Write pages */
319 for(i=0; i<8; i++) {
320 is31_write_data(1,(uint8_t *)(led_game+(9*i)),9);
321 chThdSleepMilliseconds(5);
322 is31_write_data(2,(uint8_t *)(led_all+(9*i)),9);
323 chThdSleepMilliseconds(5);
324 }
325
326 // clean up the capslock LED 277 // clean up the capslock LED
327 is31_write_register(1, CAPS_LOCK_LED_ADDRESS, 0); 278 is31_write_register(1, CAPS_LOCK_LED_ADDRESS, 0);
328 is31_write_register(2, CAPS_LOCK_LED_ADDRESS, 0); 279 is31_write_register(2, CAPS_LOCK_LED_ADDRESS, 0);