summaryrefslogtreecommitdiffstats
path: root/keyboard/ergodox/keymaps/keymap_default.c
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2015-10-26 16:57:45 -0400
committerJack Humbert <jack.humb@gmail.com>2015-10-26 16:57:45 -0400
commit402122744c26704f378cda828d30bf11e8d6dabf (patch)
treec9834b5739f5534cf345e1467d2a34ae9f716e73 /keyboard/ergodox/keymaps/keymap_default.c
parent35a81f5b8b081e1607a7c04489b01f551c3213cc (diff)
ez with leds
Diffstat (limited to 'keyboard/ergodox/keymaps/keymap_default.c')
-rw-r--r--keyboard/ergodox/keymaps/keymap_default.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/keyboard/ergodox/keymaps/keymap_default.c b/keyboard/ergodox/keymaps/keymap_default.c
index 7b54b481ae..51ef6b4106 100644
--- a/keyboard/ergodox/keymaps/keymap_default.c
+++ b/keyboard/ergodox/keymaps/keymap_default.c
@@ -1,5 +1,6 @@
#include "ergodox.h"
#include "debug.h"
+#include "action_layer.h"
#define DEFAULT_LAYER 0
#define COLEMAK_LAYER 1
@@ -74,3 +75,56 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
}
return MACRO_NONE;
};
+
+
+void * matrix_init_user(void) {
+
+};
+
+void * matrix_scan_user(void) {
+ uint8_t layer = biton32(layer_state);
+
+ ergodox_board_led_off();
+ ergodox_left_led_1_off();
+ ergodox_left_led_2_off();
+ ergodox_left_led_3_off();
+ switch (layer) {
+ case 1:
+ // all
+ ergodox_left_led_1_on();
+ ergodox_left_led_2_on();
+ ergodox_left_led_3_on();
+ break;
+ case 2:
+ // blue
+ ergodox_left_led_2_on();
+ break;
+ case 8:
+ // blue and green
+ ergodox_left_led_2_on();
+ // break missed intentionally
+ case 3:
+ // green
+ ergodox_left_led_3_on();
+ break;
+ case 6:
+ ergodox_board_led_on();
+ // break missed intentionally
+ case 4:
+ case 5:
+ case 7:
+ // white
+ ergodox_left_led_1_on();
+ break;
+ case 9:
+ // white+green
+ ergodox_left_led_1_on();
+ ergodox_left_led_3_on();
+ break;
+ default:
+ // none
+ break;
+ }
+
+ mcp23018_status = ergodox_left_leds_update();
+};