diff options
| author | Joel Challis <git@zvecr.com> | 2022-07-31 22:15:01 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-31 22:15:01 +0100 |
| commit | 98d5c77521961fa19d0ff81e941e78997d96dfb0 (patch) | |
| tree | 9592758a1d9c8d104b4a2981bed702c719dc7a71 /keyboards/lets_split | |
| parent | f7aaed1b57d264a983d4890ce6ada930ce2f6368 (diff) | |
Remove legacy AVR ssd1306 driver (#17864)
Diffstat (limited to 'keyboards/lets_split')
| -rw-r--r-- | keyboards/lets_split/keymaps/OLED_sample/config.h | 58 | ||||
| -rw-r--r-- | keyboards/lets_split/keymaps/OLED_sample/keymap.c | 415 | ||||
| -rw-r--r-- | keyboards/lets_split/keymaps/OLED_sample/readme.md | 25 | ||||
| -rw-r--r-- | keyboards/lets_split/keymaps/OLED_sample/rules.mk | 22 |
4 files changed, 0 insertions, 520 deletions
diff --git a/keyboards/lets_split/keymaps/OLED_sample/config.h b/keyboards/lets_split/keymaps/OLED_sample/config.h deleted file mode 100644 index 6aa909d284..0000000000 --- a/keyboards/lets_split/keymaps/OLED_sample/config.h +++ /dev/null | |||
| @@ -1,58 +0,0 @@ | |||
| 1 | /* | ||
| 2 | This is the c configuration file for the keymap | ||
| 3 | |||
| 4 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
| 5 | Copyright 2015 Jack Humbert | ||
| 6 | |||
| 7 | This program is free software: you can redistribute it and/or modify | ||
| 8 | it under the terms of the GNU General Public License as published by | ||
| 9 | the Free Software Foundation, either version 2 of the License, or | ||
| 10 | (at your option) any later version. | ||
| 11 | |||
| 12 | This program is distributed in the hope that it will be useful, | ||
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | GNU General Public License for more details. | ||
| 16 | |||
| 17 | You should have received a copy of the GNU General Public License | ||
| 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef CONFIG_USER_H | ||
| 22 | #define CONFIG_USER_H | ||
| 23 | |||
| 24 | #include "../../config.h" | ||
| 25 | |||
| 26 | /* Use I2C or Serial, not both */ | ||
| 27 | |||
| 28 | #define USE_I2C | ||
| 29 | //#define USE_SERIAL | ||
| 30 | |||
| 31 | /* Select hand configuration */ | ||
| 32 | |||
| 33 | #define MASTER_LEFT | ||
| 34 | // #define MASTER_RIGHT | ||
| 35 | // #define EE_HANDS | ||
| 36 | #define FLIP_HALF | ||
| 37 | |||
| 38 | #define SSD1306OLED | ||
| 39 | //#define OLED_ROTATE180 | ||
| 40 | |||
| 41 | #define TAPPING_FORCE_HOLD | ||
| 42 | #define TAPPING_TERM 100 | ||
| 43 | |||
| 44 | #ifdef SUBPROJECT_rev1 | ||
| 45 | #include "../../rev1/config.h" | ||
| 46 | #endif | ||
| 47 | #ifdef SUBPROJECT_rev2 | ||
| 48 | #include "../../rev2/config.h" | ||
| 49 | #endif | ||
| 50 | |||
| 51 | #undef RGBLED_NUM | ||
| 52 | #define RGBLIGHT_ANIMATIONS | ||
| 53 | #define RGBLED_NUM 6 | ||
| 54 | #define RGBLIGHT_HUE_STEP 10 | ||
| 55 | #define RGBLIGHT_SAT_STEP 17 | ||
| 56 | #define RGBLIGHT_VAL_STEP 17 | ||
| 57 | |||
| 58 | #endif | ||
diff --git a/keyboards/lets_split/keymaps/OLED_sample/keymap.c b/keyboards/lets_split/keymaps/OLED_sample/keymap.c deleted file mode 100644 index a34d5a32be..0000000000 --- a/keyboards/lets_split/keymaps/OLED_sample/keymap.c +++ /dev/null | |||
| @@ -1,415 +0,0 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | #include <LUFA/Drivers/Peripheral/TWI.h> | ||
| 3 | #ifdef SSD1306OLED | ||
| 4 | #include "ssd1306.h" | ||
| 5 | #endif | ||
| 6 | |||
| 7 | extern keymap_config_t keymap_config; | ||
| 8 | |||
| 9 | //Following line allows macro to read current RGB settings | ||
| 10 | extern rgblight_config_t rgblight_config; | ||
| 11 | |||
| 12 | |||
| 13 | // Each layer gets a name for readability, which is then used in the keymap matrix below. | ||
| 14 | // The underscores don't mean anything - you can have a layer called STUFF or any other name. | ||
| 15 | // Layer names don't all need to be of the same length, obviously, and you can also skip them | ||
| 16 | // entirely and just use numbers. | ||
| 17 | #define _QWERTY 0 | ||
| 18 | #define _COLEMAK 1 | ||
| 19 | #define _DVORAK 2 | ||
| 20 | #define _LOWER 3 | ||
| 21 | #define _RAISE 4 | ||
| 22 | #define _ADJUST 16 | ||
| 23 | |||
| 24 | enum custom_keycodes { | ||
| 25 | QWERTY = SAFE_RANGE, | ||
| 26 | COLEMAK, | ||
| 27 | DVORAK, | ||
| 28 | LOWER, | ||
| 29 | RAISE, | ||
| 30 | ADJUST, | ||
| 31 | BACKLIT, | ||
| 32 | RGBLED_TOGGLE, | ||
| 33 | RGBLED_STEP_MODE, | ||
| 34 | RGBLED_INCREASE_HUE, | ||
| 35 | RGBLED_DECREASE_HUE, | ||
| 36 | RGBLED_INCREASE_SAT, | ||
| 37 | RGBLED_DECREASE_SAT, | ||
| 38 | RGBLED_INCREASE_VAL, | ||
| 39 | RGBLED_DECREASE_VAL, | ||
| 40 | M_SAMPLE | ||
| 41 | }; | ||
| 42 | |||
| 43 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 44 | |||
| 45 | /* Qwerty | ||
| 46 | * ,-----------------------------------------------------------------------------------. | ||
| 47 | * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | | ||
| 48 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 49 | * | Esc | A | S | D | F | G | H | J | K | L | ; | " | | ||
| 50 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 51 | * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | | ||
| 52 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 53 | * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | | ||
| 54 | * `-----------------------------------------------------------------------------------' | ||
| 55 | */ | ||
| 56 | [_QWERTY] = LAYOUT( \ | ||
| 57 | KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ | ||
| 58 | KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ | ||
| 59 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ | ||
| 60 | ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | ||
| 61 | ), | ||
| 62 | |||
| 63 | /* Colemak | ||
| 64 | * ,-----------------------------------------------------------------------------------. | ||
| 65 | * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | | ||
| 66 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 67 | * | Esc | A | R | S | T | D | H | N | E | I | O | " | | ||
| 68 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 69 | * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | | ||
| 70 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 71 | * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | | ||
| 72 | * `-----------------------------------------------------------------------------------' | ||
| 73 | */ | ||
| 74 | [_COLEMAK] = LAYOUT( \ | ||
| 75 | KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ | ||
| 76 | KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ | ||
| 77 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ | ||
| 78 | ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | ||
| 79 | ), | ||
| 80 | |||
| 81 | /* Dvorak | ||
| 82 | * ,-----------------------------------------------------------------------------------. | ||
| 83 | * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | | ||
| 84 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 85 | * | Esc | A | O | E | U | I | D | H | T | N | S | / | | ||
| 86 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 87 | * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | | ||
| 88 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 89 | * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | | ||
| 90 | * `-----------------------------------------------------------------------------------' | ||
| 91 | */ | ||
| 92 | [_DVORAK] = LAYOUT( \ | ||
| 93 | KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ | ||
| 94 | KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ | ||
| 95 | KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ | ||
| 96 | ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | ||
| 97 | ), | ||
| 98 | |||
| 99 | /* Lower | ||
| 100 | * ,-----------------------------------------------------------------------------------. | ||
| 101 | * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | | ||
| 102 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 103 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | | ||
| 104 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 105 | * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | | ||
| 106 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 107 | * | | | | | | | | Next | Vol- | Vol+ | Play | | ||
| 108 | * `-----------------------------------------------------------------------------------' | ||
| 109 | */ | ||
| 110 | [_LOWER] = LAYOUT( \ | ||
| 111 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ | ||
| 112 | KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ | ||
| 113 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ | ||
| 114 | _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ | ||
| 115 | ), | ||
| 116 | |||
| 117 | /* Raise | ||
| 118 | * ,-----------------------------------------------------------------------------------. | ||
| 119 | * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | ||
| 120 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 121 | * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | | ||
| 122 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 123 | * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | | ||
| 124 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 125 | * | | | | | | | | Next | Vol- | Vol+ | Play | | ||
| 126 | * `-----------------------------------------------------------------------------------' | ||
| 127 | */ | ||
| 128 | [_RAISE] = LAYOUT( \ | ||
| 129 | KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ | ||
| 130 | KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ | ||
| 131 | _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ | ||
| 132 | _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ | ||
| 133 | ), | ||
| 134 | |||
| 135 | /* Adjust (Lower + Raise) | ||
| 136 | * ,-----------------------------------------------------------------------------------. | ||
| 137 | * | | Reset| | | | | | | | | | Del | | ||
| 138 | * |------+------+------+------+------+-------------+------+------+------+------+------| | ||
| 139 | * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | | ||
| 140 | * |------+------+------+------+------+------|------+------+------+------+------+------| | ||
| 141 | * | | | | | | | | | | | | | | ||
| 142 | * |------+------+------+------+------+------+------+------+------+------+------+------| | ||
| 143 | * | | | | | | | | | | | | | ||
| 144 | * `-----------------------------------------------------------------------------------' | ||
| 145 | */ | ||
| 146 | [_ADJUST] = LAYOUT( \ | ||
| 147 | _______, RESET, _______, M_SAMPLE, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ | ||
| 148 | _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ | ||
| 149 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ | ||
| 150 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ | ||
| 151 | ) | ||
| 152 | |||
| 153 | |||
| 154 | }; | ||
| 155 | |||
| 156 | |||
| 157 | #ifdef AUDIO_ENABLE | ||
| 158 | |||
| 159 | float tone_startup[][2] = SONG(STARTUP_SOUND); | ||
| 160 | float tone_qwerty[][2] = SONG(QWERTY_SOUND); | ||
| 161 | float tone_dvorak[][2] = SONG(DVORAK_SOUND); | ||
| 162 | float tone_colemak[][2] = SONG(COLEMAK_SOUND); | ||
| 163 | float tone_plover[][2] = SONG(PLOVER_SOUND); | ||
| 164 | float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); | ||
| 165 | float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); | ||
| 166 | float tone_goodbye[][2] = SONG(GOODBYE_SOUND); | ||
| 167 | #endif | ||
| 168 | |||
| 169 | // define variables for reactive RGB | ||
| 170 | bool TOG_STATUS = false; | ||
| 171 | int RGB_current_mode; | ||
| 172 | |||
| 173 | void persistent_default_layer_set(uint16_t default_layer) { | ||
| 174 | eeconfig_update_default_layer(default_layer); | ||
| 175 | default_layer_set(default_layer); | ||
| 176 | } | ||
| 177 | |||
| 178 | // Setting ADJUST layer RGB back to default | ||
| 179 | void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { | ||
| 180 | if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { | ||
| 181 | rgblight_mode(RGB_current_mode); | ||
| 182 | layer_on(layer3); | ||
| 183 | } else { | ||
| 184 | layer_off(layer3); | ||
| 185 | } | ||
| 186 | } | ||
| 187 | |||
| 188 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
| 189 | switch (keycode) { | ||
| 190 | case QWERTY: | ||
| 191 | if (record->event.pressed) { | ||
| 192 | #ifdef AUDIO_ENABLE | ||
| 193 | PLAY_SONG(tone_qwerty); | ||
| 194 | #endif | ||
| 195 | persistent_default_layer_set(1UL<<_QWERTY); | ||
| 196 | } | ||
| 197 | return false; | ||
| 198 | break; | ||
| 199 | case COLEMAK: | ||
| 200 | if (record->event.pressed) { | ||
| 201 | #ifdef AUDIO_ENABLE | ||
| 202 | PLAY_SONG(tone_colemak); | ||
| 203 | #endif | ||
| 204 | persistent_default_layer_set(1UL<<_COLEMAK); | ||
| 205 | } | ||
| 206 | return false; | ||
| 207 | break; | ||
| 208 | case DVORAK: | ||
| 209 | if (record->event.pressed) { | ||
| 210 | #ifdef AUDIO_ENABLE | ||
| 211 | PLAY_SONG(tone_dvorak); | ||
| 212 | #endif | ||
| 213 | persistent_default_layer_set(1UL<<_DVORAK); | ||
| 214 | } | ||
| 215 | return false; | ||
| 216 | break; | ||
| 217 | case LOWER: | ||
| 218 | if (record->event.pressed) { | ||
| 219 | //not sure how to have keyboard check mode and set it to a variable, so my work around | ||
| 220 | //uses another variable that would be set to true after the first time a reactive key is pressed. | ||
| 221 | if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false | ||
| 222 | } else { | ||
| 223 | TOG_STATUS = !TOG_STATUS; | ||
| 224 | rgblight_mode(16); | ||
| 225 | } | ||
| 226 | layer_on(_LOWER); | ||
| 227 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
| 228 | } else { | ||
| 229 | rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change | ||
| 230 | TOG_STATUS = false; | ||
| 231 | layer_off(_LOWER); | ||
| 232 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
| 233 | } | ||
| 234 | return false; | ||
| 235 | break; | ||
| 236 | case RAISE: | ||
| 237 | if (record->event.pressed) { | ||
| 238 | //not sure how to have keyboard check mode and set it to a variable, so my work around | ||
| 239 | //uses another variable that would be set to true after the first time a reactive key is pressed. | ||
| 240 | if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false | ||
| 241 | } else { | ||
| 242 | TOG_STATUS = !TOG_STATUS; | ||
| 243 | rgblight_mode(15); | ||
| 244 | } | ||
| 245 | layer_on(_RAISE); | ||
| 246 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
| 247 | } else { | ||
| 248 | rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change | ||
| 249 | layer_off(_RAISE); | ||
| 250 | TOG_STATUS = false; | ||
| 251 | update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); | ||
| 252 | } | ||
| 253 | return false; | ||
| 254 | break; | ||
| 255 | case BACKLIT: | ||
| 256 | if (record->event.pressed) { | ||
| 257 | register_code(KC_RSFT); | ||
| 258 | #ifdef BACKLIGHT_ENABLE | ||
| 259 | backlight_step(); | ||
| 260 | #endif | ||
| 261 | } else { | ||
| 262 | unregister_code(KC_RSFT); | ||
| 263 | } | ||
| 264 | return false; | ||
| 265 | break; | ||
| 266 | //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 | ||
| 267 | case RGB_MOD: | ||
| 268 | if (record->event.pressed) { | ||
| 269 | rgblight_mode(RGB_current_mode); | ||
| 270 | rgblight_step(); | ||
| 271 | RGB_current_mode = rgblight_config.mode; | ||
| 272 | } | ||
| 273 | return false; | ||
| 274 | break; | ||
| 275 | case M_SAMPLE: | ||
| 276 | if (record->event.pressed){ | ||
| 277 | SEND_STRING("hello world"); | ||
| 278 | } | ||
| 279 | return false; | ||
| 280 | } | ||
| 281 | return true; | ||
| 282 | } | ||
| 283 | |||
| 284 | void matrix_init_user(void) { | ||
| 285 | #ifdef AUDIO_ENABLE | ||
| 286 | startup_user(); | ||
| 287 | #endif | ||
| 288 | RGB_current_mode = rgblight_config.mode; | ||
| 289 | } | ||
| 290 | |||
| 291 | //SSD1306 OLED init and update loop, make sure to add #define SSD1306OLED in config.h | ||
| 292 | #ifdef SSD1306OLED | ||
| 293 | void matrix_master_OLED_init (void) { | ||
| 294 | TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); | ||
| 295 | iota_gfx_init(); // turns on the display | ||
| 296 | } | ||
| 297 | |||
| 298 | void matrix_scan_user(void) { | ||
| 299 | iota_gfx_task(); // this is what updates the display continuously | ||
| 300 | } | ||
| 301 | #endif | ||
| 302 | |||
| 303 | #ifdef AUDIO_ENABLE | ||
| 304 | |||
| 305 | void startup_user() | ||
| 306 | { | ||
| 307 | _delay_ms(20); // gets rid of tick | ||
| 308 | PLAY_SONG(tone_startup); | ||
| 309 | } | ||
| 310 | |||
| 311 | void shutdown_user() | ||
| 312 | { | ||
| 313 | PLAY_SONG(tone_goodbye); | ||
| 314 | _delay_ms(150); | ||
| 315 | stop_all_notes(); | ||
| 316 | } | ||
| 317 | |||
| 318 | void music_on_user(void) | ||
| 319 | { | ||
| 320 | music_scale_user(); | ||
| 321 | } | ||
| 322 | |||
| 323 | void music_scale_user(void) | ||
| 324 | { | ||
| 325 | PLAY_SONG(music_scale); | ||
| 326 | } | ||
| 327 | |||
| 328 | #endif | ||
| 329 | |||
| 330 | void matrix_update(struct CharacterMatrix *dest, | ||
| 331 | const struct CharacterMatrix *source) { | ||
| 332 | if (memcmp(dest->display, source->display, sizeof(dest->display))) { | ||
| 333 | memcpy(dest->display, source->display, sizeof(dest->display)); | ||
| 334 | dest->dirty = true; | ||
| 335 | } | ||
| 336 | } | ||
| 337 | |||
| 338 | //assign the right code to your layers for OLED display | ||
| 339 | #define L_BASE 0 | ||
| 340 | #define L_LOWER 8 | ||
| 341 | #define L_RAISE 16 | ||
| 342 | #define L_FNLAYER 64 | ||
| 343 | #define L_NUMLAY 128 | ||
| 344 | #define L_NLOWER 136 | ||
| 345 | #define L_NFNLAYER 192 | ||
| 346 | #define L_MOUSECURSOR 256 | ||
| 347 | #define L_ADJUST 65560 | ||
| 348 | |||
| 349 | void iota_gfx_task_user(void) { | ||
| 350 | #if DEBUG_TO_SCREEN | ||
| 351 | if (debug_enable) { | ||
| 352 | return; | ||
| 353 | } | ||
| 354 | #endif | ||
| 355 | |||
| 356 | struct CharacterMatrix matrix; | ||
| 357 | |||
| 358 | matrix_clear(&matrix); | ||
| 359 | matrix_write_P(&matrix, PSTR("USB: ")); | ||
| 360 | #ifdef PROTOCOL_LUFA | ||
| 361 | switch (USB_DeviceState) { | ||
| 362 | case DEVICE_STATE_Unattached: | ||
| 363 | matrix_write_P(&matrix, PSTR("Unattached")); | ||
| 364 | break; | ||
| 365 | case DEVICE_STATE_Suspended: | ||
| 366 | matrix_write_P(&matrix, PSTR("Suspended")); | ||
| 367 | break; | ||
| 368 | case DEVICE_STATE_Configured: | ||
| 369 | matrix_write_P(&matrix, PSTR("Connected")); | ||
| 370 | break; | ||
| 371 | case DEVICE_STATE_Powered: | ||
| 372 | matrix_write_P(&matrix, PSTR("Powered")); | ||
| 373 | break; | ||
| 374 | case DEVICE_STATE_Default: | ||
| 375 | matrix_write_P(&matrix, PSTR("Default")); | ||
| 376 | break; | ||
| 377 | case DEVICE_STATE_Addressed: | ||
| 378 | matrix_write_P(&matrix, PSTR("Addressed")); | ||
| 379 | break; | ||
| 380 | default: | ||
| 381 | matrix_write_P(&matrix, PSTR("Invalid")); | ||
| 382 | } | ||
| 383 | #endif | ||
| 384 | |||
| 385 | // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below | ||
| 386 | |||
| 387 | char buf[40]; | ||
| 388 | snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); | ||
| 389 | matrix_write_P(&matrix, PSTR("\n\nLayer: ")); | ||
| 390 | switch (layer_state) { | ||
| 391 | case L_BASE: | ||
| 392 | matrix_write_P(&matrix, PSTR("Default")); | ||
| 393 | break; | ||
| 394 | case L_RAISE: | ||
| 395 | matrix_write_P(&matrix, PSTR("Raise")); | ||
| 396 | break; | ||
| 397 | case L_LOWER: | ||
| 398 | matrix_write_P(&matrix, PSTR("Lower")); | ||
| 399 | break; | ||
| 400 | case L_ADJUST: | ||
| 401 | matrix_write_P(&matrix, PSTR("ADJUST")); | ||
| 402 | break; | ||
| 403 | default: | ||
| 404 | matrix_write(&matrix, buf); | ||
| 405 | } | ||
| 406 | |||
| 407 | // Host Keyboard LED Status | ||
| 408 | char led[40]; | ||
| 409 | snprintf(led, sizeof(led), "\n%s %s %s", | ||
| 410 | (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? "NUMLOCK" : " ", | ||
| 411 | (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? "CAPS" : " ", | ||
| 412 | (host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? "SCLK" : " "); | ||
| 413 | matrix_write(&matrix, led); | ||
| 414 | matrix_update(&display, &matrix); | ||
| 415 | } | ||
diff --git a/keyboards/lets_split/keymaps/OLED_sample/readme.md b/keyboards/lets_split/keymaps/OLED_sample/readme.md deleted file mode 100644 index 02888855b8..0000000000 --- a/keyboards/lets_split/keymaps/OLED_sample/readme.md +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | SSD1306 OLED Display via I2C | ||
| 2 | ====== | ||
| 3 | |||
| 4 | Features | ||
| 5 | -------- | ||
| 6 | |||
| 7 | Some features supported by the firmware: | ||
| 8 | |||
| 9 | |||
| 10 | * I2C connection between the two halves is required as the OLED display will use this connection as well. Note this | ||
| 11 | requires pull-up resistors on the data and clock lines. | ||
| 12 | * OLED display will connect from either side | ||
| 13 | |||
| 14 | |||
| 15 | Wiring | ||
| 16 | ------ | ||
| 17 | |||
| 18 | |||
| 19 | Work in progress... | ||
| 20 | |||
| 21 | |||
| 22 | OLED Configuration | ||
| 23 | ------------------------------- | ||
| 24 | |||
| 25 | Work in progress... | ||
diff --git a/keyboards/lets_split/keymaps/OLED_sample/rules.mk b/keyboards/lets_split/keymaps/OLED_sample/rules.mk deleted file mode 100644 index e1716e0c02..0000000000 --- a/keyboards/lets_split/keymaps/OLED_sample/rules.mk +++ /dev/null | |||
| @@ -1,22 +0,0 @@ | |||
| 1 | SRC += ssd1306.c | ||
| 2 | |||
| 3 | # Build Options | ||
| 4 | # change to "no" to disable the options, or define them in the Makefile in | ||
| 5 | # the appropriate keymap folder that will get included automatically | ||
| 6 | # | ||
| 7 | BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite | ||
| 8 | MOUSEKEY_ENABLE = no # Mouse keys | ||
| 9 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 10 | CONSOLE_ENABLE = no # Console for debug | ||
| 11 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 12 | NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 13 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 14 | MIDI_ENABLE = no # MIDI controls | ||
| 15 | AUDIO_ENABLE = no # Audio output on port C6 | ||
| 16 | UNICODE_ENABLE = no # Unicode | ||
| 17 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | ||
| 18 | RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. | ||
| 19 | SWAP_HANDS_ENABLE = no # Enable one-hand typing | ||
| 20 | |||
| 21 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 22 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
