diff options
Diffstat (limited to 'keyboard/planck/keymaps')
| -rw-r--r-- | keyboard/planck/keymaps/keymap_default.c | 8 | ||||
| -rw-r--r-- | keyboard/planck/keymaps/keymap_lock.c | 60 |
2 files changed, 17 insertions, 51 deletions
diff --git a/keyboard/planck/keymaps/keymap_default.c b/keyboard/planck/keymaps/keymap_default.c index 49670dafd..a9c2a0681 100644 --- a/keyboard/planck/keymaps/keymap_default.c +++ b/keyboard/planck/keymaps/keymap_default.c | |||
| @@ -2,7 +2,9 @@ | |||
| 2 | // this is the style you want to emulate. | 2 | // this is the style you want to emulate. |
| 3 | 3 | ||
| 4 | #include "planck.h" | 4 | #include "planck.h" |
| 5 | #include "backlight.h" | 5 | #ifdef BACKLIGHT_ENABLE |
| 6 | #include "backlight.h" | ||
| 7 | #endif | ||
| 6 | 8 | ||
| 7 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | 9 | // Each layer gets a name for readability, which is then used in the keymap matrix below. |
| 8 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | 10 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. |
| @@ -58,7 +60,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | |||
| 58 | case 0: | 60 | case 0: |
| 59 | if (record->event.pressed) { | 61 | if (record->event.pressed) { |
| 60 | register_code(KC_RSFT); | 62 | register_code(KC_RSFT); |
| 61 | backlight_step(); | 63 | #ifdef BACKLIGHT_ENABLE |
| 64 | backlight_step(); | ||
| 65 | #endif | ||
| 62 | } else { | 66 | } else { |
| 63 | unregister_code(KC_RSFT); | 67 | unregister_code(KC_RSFT); |
| 64 | } | 68 | } |
diff --git a/keyboard/planck/keymaps/keymap_lock.c b/keyboard/planck/keymaps/keymap_lock.c index 7a99b57c9..0deb212cc 100644 --- a/keyboard/planck/keymaps/keymap_lock.c +++ b/keyboard/planck/keymaps/keymap_lock.c | |||
| @@ -1,8 +1,10 @@ | |||
| 1 | #include "keymap_common.h" | 1 | #include "keymap_common.h" |
| 2 | // #include "backlight.h" | 2 | #ifdef BACKLIGHT_ENABLE |
| 3 | #include "backlight.h" | ||
| 4 | #endif | ||
| 3 | #include "action_layer.h" | 5 | #include "action_layer.h" |
| 4 | #include "keymap_midi.h" | 6 | #include "keymap_midi.h" |
| 5 | #include "beeps.h" | 7 | #include "audio.h" |
| 6 | #include <avr/boot.h> | 8 | #include <avr/boot.h> |
| 7 | 9 | ||
| 8 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 10 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
| @@ -86,7 +88,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | |||
| 86 | play_notes(&walk_up, 3, false); | 88 | play_notes(&walk_up, 3, false); |
| 87 | // play_note(440, 20); | 89 | // play_note(440, 20); |
| 88 | // register_code(KC_RSFT); | 90 | // register_code(KC_RSFT); |
| 89 | // backlight_set(BACKLIGHT_LEVELS); | 91 | #ifdef BACKLIGHT_ENABLE |
| 92 | backlight_set(BACKLIGHT_LEVELS); | ||
| 93 | #endif | ||
| 90 | default_layer_and(0); | 94 | default_layer_and(0); |
| 91 | default_layer_or((1<<5)); | 95 | default_layer_or((1<<5)); |
| 92 | 96 | ||
| @@ -118,17 +122,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | |||
| 118 | // register_code(hextokeycode((lock & 0x0F))); | 122 | // register_code(hextokeycode((lock & 0x0F))); |
| 119 | // unregister_code(hextokeycode((lock & 0x0F))); | 123 | // unregister_code(hextokeycode((lock & 0x0F))); |
| 120 | 124 | ||
| 121 | // note(0+12, 20); | ||
| 122 | // note(0+24, 20); | ||
| 123 | } else { | 125 | } else { |
| 124 | unregister_code(KC_RSFT); | 126 | unregister_code(KC_RSFT); |
| 125 | play_notes(&walk_dn, 3, false); | 127 | play_notes(&walk_dn, 3, false); |
| 126 | // backlight_set(0); | 128 | #ifdef BACKLIGHT_ENABLE |
| 129 | backlight_set(0); | ||
| 130 | #endif | ||
| 127 | default_layer_and(0); | 131 | default_layer_and(0); |
| 128 | default_layer_or(0); | 132 | default_layer_or(0); |
| 129 | // note(0+24, 20); | ||
| 130 | // note(0, 20); | ||
| 131 | // play_note(4, 20); | ||
| 132 | } | 133 | } |
| 133 | break; | 134 | break; |
| 134 | } | 135 | } |
| @@ -149,44 +150,5 @@ float start_up[][2] = { | |||
| 149 | 150 | ||
| 150 | void * matrix_init_user(void) { | 151 | void * matrix_init_user(void) { |
| 151 | init_notes(); | 152 | init_notes(); |
| 152 | |||
| 153 | play_notes(&start_up, 9, false); | 153 | play_notes(&start_up, 9, false); |
| 154 | // play_note(((double)261.6*3)*pow(2.0,(36)/12.0), 0xF); | 154 | } \ No newline at end of file |
| 155 | // _delay_ms(50); | ||
| 156 | |||
| 157 | // play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF); | ||
| 158 | // _delay_ms(25); | ||
| 159 | // stop_note(((double)261.6*3)*pow(2.0,(48)/12.0)); | ||
| 160 | |||
| 161 | // play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF); | ||
| 162 | // _delay_ms(25); | ||
| 163 | // stop_note(((double)261.6*3)*pow(2.0,(48)/12.0)); | ||
| 164 | |||
| 165 | |||
| 166 | // stop_note(((double)261.6*3)*pow(2.0,(36)/12.0)); | ||
| 167 | |||
| 168 | |||
| 169 | // play_note(((double)261.6*3)*pow(2.0,(62)/12.0), 0xF); | ||
| 170 | // _delay_ms(50); | ||
| 171 | // stop_note(((double)261.6*3)*pow(2.0,(62)/12.0)); | ||
| 172 | |||
| 173 | |||
| 174 | // play_note(((double)261.6*3)*pow(2.0,(64)/12.0), 0xF); | ||
| 175 | // _delay_ms(50); | ||
| 176 | // stop_note(((double)261.6*3)*pow(2.0,(64)/12.0)); | ||
| 177 | |||
| 178 | } | ||
| 179 | |||
| 180 | |||
| 181 | // void * matrix_scan_user(void) { | ||
| 182 | // if (layer_state & (1<<2)) { | ||
| 183 | // if (!playing_notes) | ||
| 184 | // play_notes(&start_up, 9, true); | ||
| 185 | // } else if (layer_state & (1<<3)) { | ||
| 186 | // if (!playing_notes) | ||
| 187 | // play_notes(&start_up, 9, true); | ||
| 188 | // } else { | ||
| 189 | // if (playing_notes) | ||
| 190 | // stop_all_notes(); | ||
| 191 | // } | ||
| 192 | // } \ No newline at end of file | ||
