From 0faa18eab996c2cfcc5da0b60b702f52335c5854 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 15 Apr 2016 23:38:21 -0400 Subject: audio enable stored in eeprom --- keyboard/planck/keymaps/default/keymap.c | 7 ++++++- keyboard/preonic/Makefile | 4 ++-- keyboard/preonic/keymaps/default/keymap.c | 12 +++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) (limited to 'keyboard') diff --git a/keyboard/planck/keymaps/default/keymap.c b/keyboard/planck/keymaps/default/keymap.c index 56092d04f..3f34ba412 100644 --- a/keyboard/planck/keymaps/default/keymap.c +++ b/keyboard/planck/keymaps/default/keymap.c @@ -135,7 +135,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_AD] = { {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, - {_______, _______, _______, _______, _______, _______, _______, M(M_QW), M(M_CM), M(M_DV), _______, _______}, + {_______, _______, _______, _______, M(6), _______, _______, M(M_QW), M(M_CM), M(M_DV), _______, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} } @@ -231,6 +231,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) unregister_code(KC_RSFT); } break; + case 6: + if (record->event.pressed) { + audio_toggle(); + } + break; } return MACRO_NONE; }; diff --git a/keyboard/preonic/Makefile b/keyboard/preonic/Makefile index 664aff732..e48052c82 100644 --- a/keyboard/preonic/Makefile +++ b/keyboard/preonic/Makefile @@ -139,8 +139,8 @@ COMMAND_ENABLE = yes # Commands for debug and configuration # SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend # 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 +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 # RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with MIDI at the same time. diff --git a/keyboard/preonic/keymaps/default/keymap.c b/keyboard/preonic/keymaps/default/keymap.c index 784670784..3da69c215 100644 --- a/keyboard/preonic/keymaps/default/keymap.c +++ b/keyboard/preonic/keymaps/default/keymap.c @@ -59,11 +59,11 @@ const uint16_t PROGMEM fn_actions[] = { }; float start_up[][2] = { - {440.0*pow(2.0,(67)/12.0), 600}, - {440.0*pow(2.0,(64)/12.0), 400}, - {440.0*pow(2.0,(55)/12.0), 400}, - {440.0*pow(2.0,(60)/12.0), 400}, - {440.0*pow(2.0,(64)/12.0), 1000}, + {440.0*pow(2.0,(67)/12.0), 4}, + {440.0*pow(2.0,(64)/12.0), 8}, + {440.0*pow(2.0,(55)/12.0), 8}, + {440.0*pow(2.0,(60)/12.0), 8}, + {440.0*pow(2.0,(64)/12.0), 10}, }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) @@ -76,8 +76,10 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) #ifdef BACKLIGHT_ENABLE backlight_step(); #endif + audio_toggle(); } else { unregister_code(KC_RSFT); + play_notes(&start_up, 5, false); } break; } -- cgit v1.2.3