summaryrefslogtreecommitdiff
path: root/keyboard/ergodox/keymaps/keymap_default.c
diff options
context:
space:
mode:
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();
+};