diff options
author | Jack Humbert <jack.humb@gmail.com> | 2015-10-22 13:37:45 -0400 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2015-10-22 13:37:45 -0400 |
commit | c966e7982c4fa42d7dae6b4f4dca6966b695a973 (patch) | |
tree | eb08b6591c19c6e47f387ee444a3894ef974aff3 /keyboard/planck/keymaps/keymap_lock.c | |
parent | 40148c430e76f8632cf96a1fda96e2dfa594975c (diff) |
bluetooth
Diffstat (limited to 'keyboard/planck/keymaps/keymap_lock.c')
-rw-r--r-- | keyboard/planck/keymaps/keymap_lock.c | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/keyboard/planck/keymaps/keymap_lock.c b/keyboard/planck/keymaps/keymap_lock.c index 4fe2e0a2bf..b844d1cdab 100644 --- a/keyboard/planck/keymaps/keymap_lock.c +++ b/keyboard/planck/keymaps/keymap_lock.c @@ -2,7 +2,7 @@ #include "backlight.h" #include "action_layer.h" #include "keymap_midi.h" -#include "beeps.h" +#include <avr/boot.h> const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = { /* Qwerty */ @@ -53,6 +53,16 @@ const uint16_t PROGMEM fn_actions[] = { }; +uint16_t hextokeycode(int hex) { + if (hex == 0x0) { + return KC_0; + } else if (hex < 0xA) { + return KC_1 + (hex - 0x1); + } else { + return KC_A + (hex - 0xA); + } +} + const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function @@ -64,6 +74,35 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) backlight_set(BACKLIGHT_LEVELS); default_layer_and(0); default_layer_or((1<<5)); + + uint8_t low = boot_lock_fuse_bits_get(0x0000); + uint8_t high = boot_lock_fuse_bits_get(0x0003); + uint8_t ext = boot_lock_fuse_bits_get(0x0002); + uint8_t lock = boot_lock_fuse_bits_get(0x0001); + + register_code(hextokeycode((low & 0xF0) >> 4)); + unregister_code(hextokeycode((low & 0xF0) >> 4)); + register_code(hextokeycode((low & 0x0F))); + unregister_code(hextokeycode((low & 0x0F))); + + + register_code(hextokeycode((high & 0xF0) >> 4)); + unregister_code(hextokeycode((high & 0xF0) >> 4)); + register_code(hextokeycode((high & 0x0F))); + unregister_code(hextokeycode((high & 0x0F))); + + + register_code(hextokeycode((ext & 0xF0) >> 4)); + unregister_code(hextokeycode((ext & 0xF0) >> 4)); + register_code(hextokeycode((ext & 0x0F))); + unregister_code(hextokeycode((ext & 0x0F))); + + + register_code(hextokeycode((lock & 0xF0) >> 4)); + unregister_code(hextokeycode((lock & 0xF0) >> 4)); + register_code(hextokeycode((lock & 0x0F))); + unregister_code(hextokeycode((lock & 0x0F))); + // note(0+12, 20); // note(0+24, 20); } else { |