diff options
author | Jack Humbert <jack.humb@gmail.com> | 2016-01-20 00:06:52 -0500 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2016-01-20 00:06:52 -0500 |
commit | eb61700912f1713ba27d34c23d7f07be66ee6513 (patch) | |
tree | 7781c85a3e67a3af34a31a09d6736f07b6a492fe /keyboard/planck | |
parent | 6e3c36360ed291b9ca2bd014571236308a933d0c (diff) |
better integrations
Diffstat (limited to 'keyboard/planck')
-rw-r--r-- | keyboard/planck/Makefile | 7 | ||||
-rw-r--r-- | keyboard/planck/keymaps/keymap_default.c | 8 | ||||
-rw-r--r-- | keyboard/planck/keymaps/keymap_lock.c | 60 | ||||
-rw-r--r-- | keyboard/planck/planck.h | 4 |
4 files changed, 25 insertions, 54 deletions
diff --git a/keyboard/planck/Makefile b/keyboard/planck/Makefile index fdf8c16400..7b06446d74 100644 --- a/keyboard/planck/Makefile +++ b/keyboard/planck/Makefile @@ -50,8 +50,7 @@ TMK_DIR = ../../tmk_core TARGET_DIR = . # # project specific files -SRC = planck.c \ - backlight.c +SRC = planck.c ifdef KEYMAP SRC := keymaps/keymap_$(KEYMAP).c $(SRC) @@ -124,9 +123,13 @@ COMMAND_ENABLE = yes # Commands for debug and configuration # NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work # BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = YES # MIDI controls +AUDIO_ENABLE = YES # Audio output on port C6 # UNICODE_ENABLE = YES # Unicode # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID +ifdef BACKLIGHT_ENABLE + SRC += backlight.c +endif # Optimize size but this may cause error "relocation truncated to fit" #EXTRALDFLAGS = -Wl,--relax 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 diff --git a/keyboard/planck/planck.h b/keyboard/planck/planck.h index 32c08f3b0b..e775ea7c62 100644 --- a/keyboard/planck/planck.h +++ b/keyboard/planck/planck.h @@ -3,7 +3,9 @@ #include "matrix.h" #include "keymap_common.h" -// #include "backlight.h" +#ifdef BACKLIGHT_ENABLE + #include "backlight.h" +#endif #include <stddef.h> #ifdef MIDI_ENABLE #include <keymap_midi.h> |