diff options
| author | Cole Markham <github@themarkhams.us> | 2018-04-18 23:57:24 -0500 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-04-19 00:57:24 -0400 |
| commit | b4bdebab9a48546160465d64000724a07617054e (patch) | |
| tree | 418021491d61b5c6039383d7bcdcd7d449d4dbe7 /keyboards/meira | |
| parent | 3d3c093173f6e9a838671bd7484b3a11dc564c1a (diff) | |
| download | qmk_firmware-b4bdebab9a48546160465d64000724a07617054e.tar.gz qmk_firmware-b4bdebab9a48546160465d64000724a07617054e.zip | |
Meira updates for bluetooth and audio (#2731)
* Add audio output
* Update Miera to fix bluetooth issues, bootloader definition.
* Added keymap with audio example
* Cleanup Meira audio code
Diffstat (limited to 'keyboards/meira')
| -rw-r--r-- | keyboards/meira/config.h | 4 | ||||
| -rw-r--r-- | keyboards/meira/featherble/config.h | 4 | ||||
| -rw-r--r-- | keyboards/meira/featherble/rules.mk | 2 | ||||
| -rw-r--r-- | keyboards/meira/keymaps/cole/config.h | 31 | ||||
| -rw-r--r-- | keyboards/meira/keymaps/cole/keymap.c | 253 | ||||
| -rw-r--r-- | keyboards/meira/keymaps/cole/readme.md | 1 | ||||
| -rw-r--r-- | keyboards/meira/keymaps/cole/rules.mk | 2 | ||||
| -rw-r--r-- | keyboards/meira/keymaps/default/config.h | 10 | ||||
| -rw-r--r-- | keyboards/meira/keymaps/default/keymap.c | 11 | ||||
| -rw-r--r-- | keyboards/meira/meira.c | 20 | ||||
| -rw-r--r-- | keyboards/meira/meira.h | 1 | ||||
| -rw-r--r-- | keyboards/meira/promicro/rules.mk | 13 | ||||
| -rw-r--r-- | keyboards/meira/rules.mk | 39 |
13 files changed, 347 insertions, 44 deletions
diff --git a/keyboards/meira/config.h b/keyboards/meira/config.h index b9bdd426a..5e9dd6837 100644 --- a/keyboards/meira/config.h +++ b/keyboards/meira/config.h | |||
| @@ -35,11 +35,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 35 | /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ | 35 | /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ |
| 36 | #define DIODE_DIRECTION CUSTOM_MATRIX | 36 | #define DIODE_DIRECTION CUSTOM_MATRIX |
| 37 | 37 | ||
| 38 | #ifdef BACKLIGHT_ENABLE | ||
| 38 | #define BACKLIGHT_LEVELS 10 | 39 | #define BACKLIGHT_LEVELS 10 |
| 39 | #define BACKLIGHT_PWM_MAP {2, 4, 8, 16, 40, 55, 70, 128, 200, 255} | 40 | #define BACKLIGHT_PWM_MAP {2, 4, 8, 16, 40, 55, 70, 128, 200, 255} |
| 41 | #endif | ||
| 40 | 42 | ||
| 43 | #ifdef RGBLIGHT_ENABLE | ||
| 41 | #define RGB_DI_PIN D3 | 44 | #define RGB_DI_PIN D3 |
| 42 | #define RGBLIGHT_TIMER | 45 | #define RGBLIGHT_TIMER |
| 43 | #define RGBLED_NUM 15 // Number of LEDs | 46 | #define RGBLED_NUM 15 // Number of LEDs |
| 47 | #endif | ||
| 44 | 48 | ||
| 45 | #endif | 49 | #endif |
diff --git a/keyboards/meira/featherble/config.h b/keyboards/meira/featherble/config.h index ea26bedfa..b7cdfe8bd 100644 --- a/keyboards/meira/featherble/config.h +++ b/keyboards/meira/featherble/config.h | |||
| @@ -36,6 +36,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 36 | #define LED_EN_PIN D2 | 36 | #define LED_EN_PIN D2 |
| 37 | #define UNUSED_PINS | 37 | #define UNUSED_PINS |
| 38 | 38 | ||
| 39 | #define QMK_SPEAKER B5 | ||
| 40 | #define B5_AUDIO | ||
| 41 | #define AUDIO_VOICES | ||
| 42 | |||
| 39 | #define CATERINA_BOOTLOADER | 43 | #define CATERINA_BOOTLOADER |
| 40 | 44 | ||
| 41 | 45 | ||
diff --git a/keyboards/meira/featherble/rules.mk b/keyboards/meira/featherble/rules.mk index 3f32ba890..e27608983 100644 --- a/keyboards/meira/featherble/rules.mk +++ b/keyboards/meira/featherble/rules.mk | |||
| @@ -1,3 +1,3 @@ | |||
| 1 | BLUETOOTH_ENABLE = yes | 1 | BLUETOOTH_ENABLE = yes |
| 2 | F_CPU = 8000000 | 2 | F_CPU = 8000000 |
| 3 | 3 | BLUETOOTH = AdafruitBLE | |
diff --git a/keyboards/meira/keymaps/cole/config.h b/keyboards/meira/keymaps/cole/config.h new file mode 100644 index 000000000..90c490e83 --- /dev/null +++ b/keyboards/meira/keymaps/cole/config.h | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | /* Copyright 2017 Cole Markham, WoodKeys.click | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef CONFIG_USER_H | ||
| 18 | #define CONFIG_USER_H | ||
| 19 | |||
| 20 | #include "../../config.h" | ||
| 21 | |||
| 22 | // place overrides here | ||
| 23 | #define MUSIC_MASK (keycode != KC_NO) | ||
| 24 | #ifdef AUDIO_ENABLE | ||
| 25 | #define STARTUP_SONG SONG(IMPERIAL_MARCH) | ||
| 26 | // Disable music mode to keep the firmware size down | ||
| 27 | #define NO_MUSIC_MODE | ||
| 28 | |||
| 29 | #endif | ||
| 30 | |||
| 31 | #endif | ||
diff --git a/keyboards/meira/keymaps/cole/keymap.c b/keyboards/meira/keymaps/cole/keymap.c new file mode 100644 index 000000000..b1c230d92 --- /dev/null +++ b/keyboards/meira/keymaps/cole/keymap.c | |||
| @@ -0,0 +1,253 @@ | |||
| 1 | /* Copyright 2017 Cole Markham | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | #include "meira.h" | ||
| 17 | #include "lighting.h" | ||
| 18 | |||
| 19 | #ifdef RGBLIGHT_ENABLE | ||
| 20 | //Following line allows macro to read current RGB settings | ||
| 21 | extern rgblight_config_t rgblight_config; | ||
| 22 | #endif | ||
| 23 | |||
| 24 | #define _QWERTY 0 | ||
| 25 | #define _COLEMAK 1 | ||
| 26 | #define _DVORAK 2 | ||
| 27 | #define _LOWER 3 | ||
| 28 | #define _RAISE 4 | ||
| 29 | #define _ADJUST 16 | ||
| 30 | |||
| 31 | |||
| 32 | #ifndef BLUETOOTH_ENABLE | ||
| 33 | #define OUT_BT KC_TRNS | ||
| 34 | #endif | ||
| 35 | |||
| 36 | enum custom_keycodes { | ||
| 37 | QWERTY = SAFE_RANGE, | ||
| 38 | LOWER, | ||
| 39 | RAISE, | ||
| 40 | ADJUST, | ||
| 41 | }; | ||
| 42 | |||
| 43 | // define variables for reactive RGB | ||
| 44 | bool TOG_STATUS = false; | ||
| 45 | int RGB_current_mode; | ||
| 46 | |||
| 47 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 48 | /* Qwerty | ||
| 49 | * ,-----------------------------------------------------------------------------------. | ||
| 50 | * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | | ||
| 51 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 52 | * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | | ||
| 53 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 54 | * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | | ||
| 55 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 56 | * |Adjust| Ctrl | Ctrl | Alt |Lower | Cmd |Space |Raise | Left | Down | Up |Right | | ||
| 57 | * `-----------------------------------------------------------------------------------' | ||
| 58 | */ | ||
| 59 | [_QWERTY] = KEYMAP( \ | ||
| 60 | KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ | ||
| 61 | KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ | ||
| 62 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ | ||
| 63 | ADJUST, KC_LCTL, KC_LALT, KC_LALT, LOWER, KC_LGUI, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | ||
| 64 | ), | ||
| 65 | |||
| 66 | /* Lower | ||
| 67 | * ,-----------------------------------------------------------------------------------. | ||
| 68 | * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | | ||
| 69 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 70 | * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | | ||
| 71 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 72 | * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | | ||
| 73 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 74 | * | | | | | | | | Next | Vol- | Vol+ | Play | | ||
| 75 | * `-----------------------------------------------------------------------------------' | ||
| 76 | */ | ||
| 77 | [_LOWER] = KEYMAP( \ | ||
| 78 | _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ | ||
| 79 | KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ | ||
| 80 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, KC_QUOT, \ | ||
| 81 | _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ | ||
| 82 | ), | ||
| 83 | |||
| 84 | /* Raise | ||
| 85 | * ,-----------------------------------------------------------------------------------. | ||
| 86 | * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | ||
| 87 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 88 | * | ` | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | | ||
| 89 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 90 | * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | | ||
| 91 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 92 | * | | | | | | | | Home | PgUp | PgDn | End | | ||
| 93 | * `-----------------------------------------------------------------------------------' | ||
| 94 | */ | ||
| 95 | [_RAISE] = KEYMAP( \ | ||
| 96 | _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ | ||
| 97 | KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ | ||
| 98 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ | ||
| 99 | _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ | ||
| 100 | ), | ||
| 101 | |||
| 102 | /* Adjust (Lower + Raise) | ||
| 103 | * ,-----------------------------------------------------------------------------------. | ||
| 104 | * | | Reset| | | | | | | | | | Del | | ||
| 105 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 106 | * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | | ||
| 107 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 108 | * | | | | | | | | | | | | | | ||
| 109 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 110 | * | | | | | | | | | | | | | ||
| 111 | * `-----------------------------------------------------------------------------------' | ||
| 112 | */ | ||
| 113 | [_ADJUST] = KEYMAP( \ | ||
| 114 | RESET, _______, _______, KC_MRWD, KC_MPLY, KC_MFFD, KC_PSCR, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, \ | ||
| 115 | BL_STEP, RGB_MOD, _______, AU_ON, AU_OFF, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 116 | BL_TOGG, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 117 | _______, KC_PSCR, _______, _______, _______, _______, _______, _______, _______, OUT_AUTO, OUT_USB, OUT_BT \ | ||
| 118 | ) | ||
| 119 | }; | ||
| 120 | |||
| 121 | const uint16_t PROGMEM fn_actions[] = { | ||
| 122 | |||
| 123 | }; | ||
| 124 | |||
| 125 | // Setting ADJUST layer RGB back to default | ||
| 126 | void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { | ||
| 127 | if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { | ||
| 128 | #ifdef RGBLIGHT_ENABLE | ||
| 129 | rgblight_mode(RGB_current_mode); | ||
| 130 | #endif | ||
| 131 | layer_on(layer3); | ||
| 132 | } else { | ||
| 133 | layer_off(layer3); | ||
| 134 | } | ||
| 135 | } | ||
| 136 | |||
| 137 | const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) | ||
| 138 | { | ||
| 139 | // MACRODOWN only works in this function | ||
| 140 | switch(id) { | ||
| 141 | case 0: | ||
| 142 | if (record->event.pressed) { | ||
| 143 | register_code(KC_RSFT); | ||
| 144 | } else { | ||
| 145 | unregister_code(KC_RSFT); | ||
| 146 | } | ||
| 147 | break; | ||
| 148 | } | ||
| 149 | return MACRO_NONE; | ||
| 150 | }; | ||
| 151 | |||
| 152 | |||
| 153 | void matrix_init_user(void) { | ||
| 154 | |||
| 155 | } | ||
| 156 | |||
| 157 | void matrix_scan_user(void) { | ||
| 158 | |||
| 159 | } | ||
| 160 | |||
| 161 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 162 | switch (keycode) { | ||
| 163 | case LOWER: | ||
| 164 | if (record->event.pressed) { | ||
| 165 | //not sure how to have keyboard check mode and set it to a variable, so my work around | ||
| 166 | //uses another variable that would be set to true after the first time a reactive key is pressed. | ||
| 167 | if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false | ||
| 168 | } else { | ||
| 169 | TOG_STATUS = !TOG_STATUS; | ||
| 170 | #ifdef RGBLIGHT_ENABLE | ||
| 171 | rgblight_mode(16); | ||
| 172 | #endif | ||
| 173 | } | ||
| 174 | layer_on(_LOWER); | ||
| 175 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
| 176 | } else { | ||
| 177 | #ifdef RGBLIGHT_ENABLE | ||
| 178 | rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change | ||
| 179 | #endif | ||
| 180 | TOG_STATUS = false; | ||
| 181 | layer_off(_LOWER); | ||
| 182 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
| 183 | } | ||
| 184 | return false; | ||
| 185 | break; | ||
| 186 | case RAISE: | ||
| 187 | if (record->event.pressed) { | ||
| 188 | //not sure how to have keyboard check mode and set it to a variable, so my work around | ||
| 189 | //uses another variable that would be set to true after the first time a reactive key is pressed. | ||
| 190 | if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false | ||
| 191 | } else { | ||
| 192 | TOG_STATUS = !TOG_STATUS; | ||
| 193 | #ifdef RGBLIGHT_ENABLE | ||
| 194 | rgblight_mode(15); | ||
| 195 | #endif | ||
| 196 | } | ||
| 197 | layer_on(_RAISE); | ||
| 198 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
| 199 | } else { | ||
| 200 | #ifdef RGBLIGHT_ENABLE | ||
| 201 | rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change | ||
| 202 | #endif | ||
| 203 | layer_off(_RAISE); | ||
| 204 | TOG_STATUS = false; | ||
| 205 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
| 206 | } | ||
| 207 | return false; | ||
| 208 | break; | ||
| 209 | case ADJUST: | ||
| 210 | // FIXME add RGB feedback | ||
| 211 | if (record->event.pressed) { | ||
| 212 | layer_on(_ADJUST); | ||
| 213 | } else { | ||
| 214 | layer_off(_ADJUST); | ||
| 215 | } | ||
| 216 | return false; | ||
| 217 | break; | ||
| 218 | case BL_TOGG: | ||
| 219 | #ifdef BACKLIGHT_ENABLE | ||
| 220 | if (record->event.pressed) { | ||
| 221 | print("Enabling backlight\n"); | ||
| 222 | backlight_init_ports(); | ||
| 223 | } | ||
| 224 | #endif | ||
| 225 | return false; | ||
| 226 | break; | ||
| 227 | case BL_STEP: | ||
| 228 | if (record->event.pressed) { | ||
| 229 | #ifdef BACKLIGHT_ENABLE | ||
| 230 | backlight_step(); | ||
| 231 | #endif | ||
| 232 | |||
| 233 | } | ||
| 234 | return false; | ||
| 235 | break; | ||
| 236 | //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released | ||
| 237 | #ifdef RGBLIGHT_ENABLE | ||
| 238 | case RGB_MOD: | ||
| 239 | if (record->event.pressed) { | ||
| 240 | rgblight_mode(RGB_current_mode); | ||
| 241 | rgblight_step(); | ||
| 242 | RGB_current_mode = rgblight_config.mode; | ||
| 243 | } | ||
| 244 | return false; | ||
| 245 | break; | ||
| 246 | #endif | ||
| 247 | } | ||
| 248 | return true; | ||
| 249 | } | ||
| 250 | |||
| 251 | void led_set_user(uint8_t usb_led) { | ||
| 252 | |||
| 253 | } | ||
diff --git a/keyboards/meira/keymaps/cole/readme.md b/keyboards/meira/keymaps/cole/readme.md new file mode 100644 index 000000000..be8404881 --- /dev/null +++ b/keyboards/meira/keymaps/cole/readme.md | |||
| @@ -0,0 +1 @@ | |||
| # The default keymap for meira | |||
diff --git a/keyboards/meira/keymaps/cole/rules.mk b/keyboards/meira/keymaps/cole/rules.mk new file mode 100644 index 000000000..8f8d53e57 --- /dev/null +++ b/keyboards/meira/keymaps/cole/rules.mk | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | AUDIO_ENABLE = yes # Audio output on port C6 | ||
| 2 | EXTRAFLAGS+=-flto # -4-7k \ No newline at end of file | ||
diff --git a/keyboards/meira/keymaps/default/config.h b/keyboards/meira/keymaps/default/config.h index 97210115b..5f5844a70 100644 --- a/keyboards/meira/keymaps/default/config.h +++ b/keyboards/meira/keymaps/default/config.h | |||
| @@ -20,5 +20,15 @@ | |||
| 20 | #include "../../config.h" | 20 | #include "../../config.h" |
| 21 | 21 | ||
| 22 | // place overrides here | 22 | // place overrides here |
| 23 | #define MUSIC_MASK (keycode != KC_NO) | ||
| 24 | #ifdef AUDIO_ENABLE | ||
| 25 | #define STARTUP_SONG SONG(PLANCK_SOUND) | ||
| 26 | // #define STARTUP_SONG SONG(NO_SOUND) | ||
| 27 | |||
| 28 | #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ | ||
| 29 | SONG(COLEMAK_SOUND), \ | ||
| 30 | SONG(DVORAK_SOUND) \ | ||
| 31 | } | ||
| 32 | #endif | ||
| 23 | 33 | ||
| 24 | #endif | 34 | #endif |
diff --git a/keyboards/meira/keymaps/default/keymap.c b/keyboards/meira/keymaps/default/keymap.c index dd55859a5..4bbd014cb 100644 --- a/keyboards/meira/keymaps/default/keymap.c +++ b/keyboards/meira/keymaps/default/keymap.c | |||
| @@ -37,6 +37,17 @@ enum custom_keycodes { | |||
| 37 | ADJUST, | 37 | ADJUST, |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | #ifdef AUDIO_ENABLE | ||
| 41 | |||
| 42 | float tone_my_startup[][2] = SONG(ODE_TO_JOY); | ||
| 43 | float tone_my_goodbye[][2] = SONG(ROCK_A_BYE_BABY); | ||
| 44 | |||
| 45 | float tone_qwerty[][2] = SONG(QWERTY_SOUND); | ||
| 46 | float tone_dvorak[][2] = SONG(DVORAK_SOUND); | ||
| 47 | float tone_colemak[][2] = SONG(COLEMAK_SOUND); | ||
| 48 | |||
| 49 | #endif /* AUDIO_ENABLE */ | ||
| 50 | |||
| 40 | // define variables for reactive RGB | 51 | // define variables for reactive RGB |
| 41 | bool TOG_STATUS = false; | 52 | bool TOG_STATUS = false; |
| 42 | int RGB_current_mode; | 53 | int RGB_current_mode; |
diff --git a/keyboards/meira/meira.c b/keyboards/meira/meira.c index 2ae53e00a..3ff62a080 100644 --- a/keyboards/meira/meira.c +++ b/keyboards/meira/meira.c | |||
| @@ -22,30 +22,10 @@ | |||
| 22 | 22 | ||
| 23 | extern void backlight_set(uint8_t level); | 23 | extern void backlight_set(uint8_t level); |
| 24 | 24 | ||
| 25 | #ifdef AUDIO_ENABLE | ||
| 26 | float tone_startup[][2] = SONG(STARTUP_SOUND); | ||
| 27 | float tone_goodbye[][2] = SONG(GOODBYE_SOUND); | ||
| 28 | #endif | ||
| 29 | |||
| 30 | |||
| 31 | void shutdown_user(void) { | ||
| 32 | #ifdef AUDIO_ENABLE | ||
| 33 | PLAY_NOTE_ARRAY(tone_goodbye, false, 0); | ||
| 34 | _delay_ms(150); | ||
| 35 | stop_all_notes(); | ||
| 36 | #endif | ||
| 37 | } | ||
| 38 | |||
| 39 | |||
| 40 | void matrix_init_kb(void) | 25 | void matrix_init_kb(void) |
| 41 | { | 26 | { |
| 42 | debug_enable=true; | 27 | debug_enable=true; |
| 43 | print("meira matrix_init_kb\n"); | 28 | print("meira matrix_init_kb\n"); |
| 44 | #ifdef AUDIO_ENABLE | ||
| 45 | _delay_ms(20); // gets rid of tick | ||
| 46 | PLAY_NOTE_ARRAY(tone_startup, false, 0); | ||
| 47 | #endif | ||
| 48 | |||
| 49 | 29 | ||
| 50 | #ifdef ISSI_ENABLE | 30 | #ifdef ISSI_ENABLE |
| 51 | issi_init(); | 31 | issi_init(); |
diff --git a/keyboards/meira/meira.h b/keyboards/meira/meira.h index 35c5ba419..8cdcd09fe 100644 --- a/keyboards/meira/meira.h +++ b/keyboards/meira/meira.h | |||
| @@ -54,6 +54,7 @@ void reset_keyboard_kb(void); | |||
| 54 | 54 | ||
| 55 | #define LAYOUT_ortho_4x12 KEYMAP | 55 | #define LAYOUT_ortho_4x12 KEYMAP |
| 56 | #define KC_LAYOUT_ortho_4x12 KC_KEYMAP | 56 | #define KC_LAYOUT_ortho_4x12 KC_KEYMAP |
| 57 | #define LAYOUT_kc_ortho_4x12 KC_KEYMAP | ||
| 57 | 58 | ||
| 58 | #endif | 59 | #endif |
| 59 | 60 | ||
diff --git a/keyboards/meira/promicro/rules.mk b/keyboards/meira/promicro/rules.mk index 3c81f1b34..22e49971f 100644 --- a/keyboards/meira/promicro/rules.mk +++ b/keyboards/meira/promicro/rules.mk | |||
| @@ -1 +1,14 @@ | |||
| 1 | # Processor frequency. | ||
| 2 | # This will define a symbol, F_CPU, in all source code files equal to the | ||
| 3 | # processor frequency in Hz. You can then use this symbol in your source code to | ||
| 4 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done | ||
| 5 | # automatically to create a 32-bit value in your source code. | ||
| 6 | # | ||
| 7 | # This will be an integer division of F_USB below, as it is sourced by | ||
| 8 | # F_USB after it has run through any CPU prescalers. Note that this value | ||
| 9 | # does not *change* the processor frequency - it should merely be updated to | ||
| 10 | # reflect the processor speed set externally so that the code can use accurate | ||
| 11 | # software delays. | ||
| 12 | F_CPU = 16000000 | ||
| 13 | |||
| 1 | BLUETOOTH_ENABLE = no | 14 | BLUETOOTH_ENABLE = no |
diff --git a/keyboards/meira/rules.mk b/keyboards/meira/rules.mk index e898146ab..d3e45fc8d 100644 --- a/keyboards/meira/rules.mk +++ b/keyboards/meira/rules.mk | |||
| @@ -4,19 +4,6 @@ SRC += matrix.c TWIlib.c issi.c lighting.c | |||
| 4 | #MCU = at90usb1286 | 4 | #MCU = at90usb1286 |
| 5 | MCU = atmega32u4 | 5 | MCU = atmega32u4 |
| 6 | 6 | ||
| 7 | # Processor frequency. | ||
| 8 | # This will define a symbol, F_CPU, in all source code files equal to the | ||
| 9 | # processor frequency in Hz. You can then use this symbol in your source code to | ||
| 10 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done | ||
| 11 | # automatically to create a 32-bit value in your source code. | ||
| 12 | # | ||
| 13 | # This will be an integer division of F_USB below, as it is sourced by | ||
| 14 | # F_USB after it has run through any CPU prescalers. Note that this value | ||
| 15 | # does not *change* the processor frequency - it should merely be updated to | ||
| 16 | # reflect the processor speed set externally so that the code can use accurate | ||
| 17 | # software delays. | ||
| 18 | F_CPU = 16000000 | ||
| 19 | |||
| 20 | 7 | ||
| 21 | # | 8 | # |
| 22 | # LUFA specific | 9 | # LUFA specific |
| @@ -37,6 +24,12 @@ ARCH = AVR8 | |||
| 37 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | 24 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. |
| 38 | F_USB = $(F_CPU) | 25 | F_USB = $(F_CPU) |
| 39 | 26 | ||
| 27 | # Bootloader | ||
| 28 | # This definition is optional, and if your keyboard supports multiple bootloaders of | ||
| 29 | # different sizes, comment this out, and the correct address will be loaded | ||
| 30 | # automatically (+60). See bootloader.mk for all options. | ||
| 31 | BOOTLOADER = caterina | ||
| 32 | |||
| 40 | # Interrupt driven control endpoint task(+60) | 33 | # Interrupt driven control endpoint task(+60) |
| 41 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | 34 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT |
| 42 | 35 | ||
| @@ -54,10 +47,10 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 | |||
| 54 | # change yes to no to disable | 47 | # change yes to no to disable |
| 55 | # | 48 | # |
| 56 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | 49 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) |
| 57 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | 50 | MOUSEKEY_ENABLE = no # Mouse keys(+4700) |
| 58 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | 51 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) |
| 59 | CONSOLE_ENABLE = yes # Console for debug(+400) | 52 | CONSOLE_ENABLE = no # Console for debug(+400) |
| 60 | COMMAND_ENABLE = yes # Commands for debug and configuration | 53 | COMMAND_ENABLE = no # Commands for debug and configuration |
| 61 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 54 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
| 62 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 55 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
| 63 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 56 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
| @@ -74,13 +67,13 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be di | |||
| 74 | 67 | ||
| 75 | CUSTOM_MATRIX = yes | 68 | CUSTOM_MATRIX = yes |
| 76 | 69 | ||
| 77 | ifeq ($(strip $(ISSI_ENABLE)), yes) | 70 | #ifeq ($(strip $(ISSI_ENABLE)), yes) |
| 78 | TMK_COMMON_DEFS += -DISSI_ENABLE | 71 | # TMK_COMMON_DEFS += -DISSI_ENABLE |
| 79 | endif | 72 | #endif |
| 80 | 73 | # | |
| 81 | ifeq ($(strip $(WATCHDOG_ENABLE)), yes) | 74 | #ifeq ($(strip $(WATCHDOG_ENABLE)), yes) |
| 82 | TMK_COMMON_DEFS += -DWATCHDOG_ENABLE | 75 | # TMK_COMMON_DEFS += -DWATCHDOG_ENABLE |
| 83 | endif | 76 | #endif |
| 84 | 77 | ||
| 85 | DEFAULT_FOLDER = meira/promicro | 78 | DEFAULT_FOLDER = meira/promicro |
| 86 | LAYOUTS = ortho_4x12 | 79 | LAYOUTS = ortho_4x12 |
