summaryrefslogtreecommitdiffstats
path: root/keyboard/planck/keymaps
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2016-01-20 00:06:52 -0500
committerJack Humbert <jack.humb@gmail.com>2016-01-20 00:06:52 -0500
commiteb61700912f1713ba27d34c23d7f07be66ee6513 (patch)
tree7781c85a3e67a3af34a31a09d6736f07b6a492fe /keyboard/planck/keymaps
parent6e3c36360ed291b9ca2bd014571236308a933d0c (diff)
better integrations
Diffstat (limited to 'keyboard/planck/keymaps')
-rw-r--r--keyboard/planck/keymaps/keymap_default.c8
-rw-r--r--keyboard/planck/keymaps/keymap_lock.c60
2 files changed, 17 insertions, 51 deletions
diff --git a/keyboard/planck/keymaps/keymap_default.c b/keyboard/planck/keymaps/keymap_default.c
index 49670dafd3..a9c2a06813 100644
--- a/keyboard/planck/keymaps/keymap_default.c
+++ b/keyboard/planck/keymaps/keymap_default.c
@@ -2,7 +2,9 @@
// this is the style you want to emulate.
#include "planck.h"
-#include "backlight.h"
+#ifdef BACKLIGHT_ENABLE
+ #include "backlight.h"
+#endif
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// 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)
case 0:
if (record->event.pressed) {
register_code(KC_RSFT);
- backlight_step();
+ #ifdef BACKLIGHT_ENABLE
+ backlight_step();
+ #endif
} else {
unregister_code(KC_RSFT);
}
diff --git a/keyboard/planck/keymaps/keymap_lock.c b/keyboard/planck/keymaps/keymap_lock.c
index 7a99b57c9d..0deb212cc7 100644
--- a/keyboard/planck/keymaps/keymap_lock.c
+++ b/keyboard/planck/keymaps/keymap_lock.c
@@ -1,8 +1,10 @@
#include "keymap_common.h"
-// #include "backlight.h"
+#ifdef BACKLIGHT_ENABLE
+ #include "backlight.h"
+#endif
#include "action_layer.h"
#include "keymap_midi.h"
-#include "beeps.h"
+#include "audio.h"
#include <avr/boot.h>
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)
play_notes(&walk_up, 3, false);
// play_note(440, 20);
// register_code(KC_RSFT);
- // backlight_set(BACKLIGHT_LEVELS);
+ #ifdef BACKLIGHT_ENABLE
+ backlight_set(BACKLIGHT_LEVELS);
+ #endif
default_layer_and(0);
default_layer_or((1<<5));
@@ -118,17 +122,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
// register_code(hextokeycode((lock & 0x0F)));
// unregister_code(hextokeycode((lock & 0x0F)));
- // note(0+12, 20);
- // note(0+24, 20);
} else {
unregister_code(KC_RSFT);
play_notes(&walk_dn, 3, false);
- // backlight_set(0);
+ #ifdef BACKLIGHT_ENABLE
+ backlight_set(0);
+ #endif
default_layer_and(0);
default_layer_or(0);
- // note(0+24, 20);
- // note(0, 20);
- // play_note(4, 20);
}
break;
}
@@ -149,44 +150,5 @@ float start_up[][2] = {
void * matrix_init_user(void) {
init_notes();
-
play_notes(&start_up, 9, false);
- // play_note(((double)261.6*3)*pow(2.0,(36)/12.0), 0xF);
- // _delay_ms(50);
-
- // play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF);
- // _delay_ms(25);
- // stop_note(((double)261.6*3)*pow(2.0,(48)/12.0));
-
- // play_note(((double)261.6*3)*pow(2.0,(48)/12.0), 0xF);
- // _delay_ms(25);
- // stop_note(((double)261.6*3)*pow(2.0,(48)/12.0));
-
-
- // stop_note(((double)261.6*3)*pow(2.0,(36)/12.0));
-
-
- // play_note(((double)261.6*3)*pow(2.0,(62)/12.0), 0xF);
- // _delay_ms(50);
- // stop_note(((double)261.6*3)*pow(2.0,(62)/12.0));
-
-
- // play_note(((double)261.6*3)*pow(2.0,(64)/12.0), 0xF);
- // _delay_ms(50);
- // stop_note(((double)261.6*3)*pow(2.0,(64)/12.0));
-
-}
-
-
-// void * matrix_scan_user(void) {
-// if (layer_state & (1<<2)) {
-// if (!playing_notes)
-// play_notes(&start_up, 9, true);
-// } else if (layer_state & (1<<3)) {
-// if (!playing_notes)
-// play_notes(&start_up, 9, true);
-// } else {
-// if (playing_notes)
-// stop_all_notes();
-// }
-// } \ No newline at end of file
+} \ No newline at end of file