From d1fe24ad9f85768774ae50465c71f3757a33cc00 Mon Sep 17 00:00:00 2001 From: Gabriel Young Date: Sun, 19 Feb 2017 17:18:05 -0800 Subject: Allow customization of the number of tone keycodes and add example keymap --- keyboards/satan/keymaps/midi/Makefile | 21 ++++++++++++ keyboards/satan/keymaps/midi/config.h | 11 +++++++ keyboards/satan/keymaps/midi/keymap.c | 60 ++++++++++++++++++++++++++++++++++ keyboards/satan/keymaps/midi/readme.md | 1 + 4 files changed, 93 insertions(+) create mode 100644 keyboards/satan/keymaps/midi/Makefile create mode 100644 keyboards/satan/keymaps/midi/config.h create mode 100644 keyboards/satan/keymaps/midi/keymap.c create mode 100644 keyboards/satan/keymaps/midi/readme.md (limited to 'keyboards') diff --git a/keyboards/satan/keymaps/midi/Makefile b/keyboards/satan/keymaps/midi/Makefile new file mode 100644 index 000000000..5cbda96ce --- /dev/null +++ b/keyboards/satan/keymaps/midi/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # 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 = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/satan/keymaps/midi/config.h b/keyboards/satan/keymaps/midi/config.h new file mode 100644 index 000000000..e345d40c9 --- /dev/null +++ b/keyboards/satan/keymaps/midi/config.h @@ -0,0 +1,11 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +/* override number of MIDI tone keycodes (each octave adds 12 bytes) */ +#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/satan/keymaps/midi/keymap.c b/keyboards/satan/keymaps/midi/keymap.c new file mode 100644 index 000000000..ac9725933 --- /dev/null +++ b/keyboards/satan/keymaps/midi/keymap.c @@ -0,0 +1,60 @@ +#include "satan.h" + +// 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. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _ML 1 + +// readability +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | + * `-----------------------------------------------------------' + */ +[_BL] = KEYMAP_ANSI( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, TG(_ML), KC_RCTL), + +/* Keymap _ML: MIDI Layer + * ,------------------------------------------------------------------------. + * | Exit | | | | | | | | | | | | | | + * |------------------------------------------------------------------------| + * | Ch+ | | C# | D# | | F# | G# | A# | | C# | D# | | | | + * |------------------------------------------------------------------------| + * | Mod | C | D | E | F | G | A | B | C | D | E | F |>>OnStage| + * |------------------------------------------------------------------------| + * | Sustain |Oct-|Oct+|Mod-|Mod+| | | |Tns-|Tns+|Tns0| Sustain | + * |------------------------------------------------------------------------| + * | | | | All notes off | | | | | + * `------------------------------------------------------------------------' + * + * Foot switches: + * ,--------. ,--------. + * | | | | + * | | | | + * `--------' `--------' + */ +[_ML] = KEYMAP_ANSI( + TG(_ML), MI_VEL_1, MI_VEL_2, MI_VEL_3, MI_VEL_4, MI_VEL_5, MI_VEL_6, MI_VEL_7, MI_VEL_8, MI_VEL_9, MI_VEL_10, XXXXXXX, XXXXXXX, XXXXXXX, \ + MI_CHU, XXXXXXX, MI_Cs, MI_Ds, XXXXXXX, MI_Fs, MI_Gs, MI_As, XXXXXXX, MI_Cs_1, MI_Ds_1, XXXXXXX, XXXXXXX, XXXXXXX, \ + MI_MOD, MI_C, MI_D, MI_E, MI_F, MI_G, MI_A, MI_B, MI_C_1, MI_D_1, MI_E_1, MI_F_1, _______, \ + MI_SUS, MI_OCTD, MI_OCTU, MI_MODSD, MI_MODSU, XXXXXXX, XXXXXXX, XXXXXXX, MI_TRNSD, MI_TRNSU, MI_TRNS_0, MI_SUS, \ + _______, _______, _______, MI_OFF, _______, _______, _______, _______), +}; \ No newline at end of file diff --git a/keyboards/satan/keymaps/midi/readme.md b/keyboards/satan/keymaps/midi/readme.md new file mode 100644 index 000000000..87844a854 --- /dev/null +++ b/keyboards/satan/keymaps/midi/readme.md @@ -0,0 +1 @@ +# Satan GH60 layout demonstrating MIDI key mapping -- cgit v1.2.3 From ed15973a3ffff6e18e62f81654632b97961f18d2 Mon Sep 17 00:00:00 2001 From: Gabriel Young Date: Sun, 19 Feb 2017 17:45:08 -0800 Subject: Document size added by MIDI_ENABLE (~3800 bytes according to my experiments) satan/keymaps/midi MIDI_ENABLE = no text data bss dec hex filename 0 17080 0 17080 42b8 satan_midi.hex MIDI_ENABLE = yes #define MIDI_TONE_KEYCODE_OCTAVES 3 // default text data bss dec hex filename 0 20846 0 20846 516e satan_midi.hex MIDI_ENABLE = yes #define MIDI_TONE_KEYCODE_OCTAVES 2 // fewer octaves text data bss dec hex filename 0 20846 0 20846 516e satan_midi.hex --- keyboards/satan/keymaps/midi/Makefile | 2 +- keyboards/satan/keymaps/midi/config.h | 2 +- keyboards/satan/keymaps/midi/keymap.c | 2 ++ quantum/process_keycode/process_midi.c | 2 ++ quantum/template/config.h | 2 +- quantum/template/keymaps/default/Makefile | 2 +- 6 files changed, 8 insertions(+), 4 deletions(-) (limited to 'keyboards') diff --git a/keyboards/satan/keymaps/midi/Makefile b/keyboards/satan/keymaps/midi/Makefile index 5cbda96ce..4e2d9d2f7 100644 --- a/keyboards/satan/keymaps/midi/Makefile +++ b/keyboards/satan/keymaps/midi/Makefile @@ -9,7 +9,7 @@ CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # 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 +MIDI_ENABLE = yes # MIDI support (+3800) AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/satan/keymaps/midi/config.h b/keyboards/satan/keymaps/midi/config.h index e345d40c9..0dbdb5cbc 100644 --- a/keyboards/satan/keymaps/midi/config.h +++ b/keyboards/satan/keymaps/midi/config.h @@ -5,7 +5,7 @@ // place overrides here -/* override number of MIDI tone keycodes (each octave adds 12 bytes) */ +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ #define MIDI_TONE_KEYCODE_OCTAVES 2 #endif \ No newline at end of file diff --git a/keyboards/satan/keymaps/midi/keymap.c b/keyboards/satan/keymaps/midi/keymap.c index ac9725933..004690f41 100644 --- a/keyboards/satan/keymaps/midi/keymap.c +++ b/keyboards/satan/keymaps/midi/keymap.c @@ -32,6 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, TG(_ML), KC_RCTL), +#ifdef MIDI_ENABLE /* Keymap _ML: MIDI Layer * ,------------------------------------------------------------------------. * | Exit | | | | | | | | | | | | | | @@ -57,4 +58,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { MI_MOD, MI_C, MI_D, MI_E, MI_F, MI_G, MI_A, MI_B, MI_C_1, MI_D_1, MI_E_1, MI_F_1, _______, \ MI_SUS, MI_OCTD, MI_OCTU, MI_MODSD, MI_MODSU, XXXXXXX, XXXXXXX, XXXXXXX, MI_TRNSD, MI_TRNSU, MI_TRNS_0, MI_SUS, \ _______, _______, _______, MI_OFF, _______, _______, _______, _______), +#endif }; \ No newline at end of file diff --git a/quantum/process_keycode/process_midi.c b/quantum/process_keycode/process_midi.c index 9190fa047..5530ea97c 100644 --- a/quantum/process_keycode/process_midi.c +++ b/quantum/process_keycode/process_midi.c @@ -1,3 +1,5 @@ +#define MIDI_TONE_KEYCODE_OCTAVES 2 + #include "process_midi.h" #include "timer.h" diff --git a/quantum/template/config.h b/quantum/template/config.h index d0bee0d89..cd6dfa2c6 100644 --- a/quantum/template/config.h +++ b/quantum/template/config.h @@ -159,7 +159,7 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION -/* override number of MIDI tone keycodes (each octave adds 12 bytes) */ +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 #endif diff --git a/quantum/template/keymaps/default/Makefile b/quantum/template/keymaps/default/Makefile index f4671a9d1..24442db37 100644 --- a/quantum/template/keymaps/default/Makefile +++ b/quantum/template/keymaps/default/Makefile @@ -9,7 +9,7 @@ CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls +MIDI_ENABLE = no # MIDI support (+3800) AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -- cgit v1.2.3 From 64eecfc5303788bd82bf2fb466ec4a6f1bd0c028 Mon Sep 17 00:00:00 2001 From: Gabriel Young Date: Sun, 19 Feb 2017 22:23:06 -0800 Subject: fix typos in keymap --- keyboards/satan/keymaps/midi/keymap.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'keyboards') diff --git a/keyboards/satan/keymaps/midi/keymap.c b/keyboards/satan/keymaps/midi/keymap.c index 004690f41..397fe097b 100644 --- a/keyboards/satan/keymaps/midi/keymap.c +++ b/keyboards/satan/keymaps/midi/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | * |-----------------------------------------------------------| - * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | + * |Ctrl|Gui |Alt | Space |Alt |Gui |Midi|Ctrl | * `-----------------------------------------------------------' */ [_BL] = KEYMAP_ANSI( @@ -39,18 +39,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------------------------------------------------------------------------| * | Ch+ | | C# | D# | | F# | G# | A# | | C# | D# | | | | * |------------------------------------------------------------------------| - * | Mod | C | D | E | F | G | A | B | C | D | E | F |>>OnStage| + * | Mod | C | D | E | F | G | A | B | C | D | E | F | | * |------------------------------------------------------------------------| * | Sustain |Oct-|Oct+|Mod-|Mod+| | | |Tns-|Tns+|Tns0| Sustain | * |------------------------------------------------------------------------| * | | | | All notes off | | | | | * `------------------------------------------------------------------------' - * - * Foot switches: - * ,--------. ,--------. - * | | | | - * | | | | - * `--------' `--------' */ [_ML] = KEYMAP_ANSI( TG(_ML), MI_VEL_1, MI_VEL_2, MI_VEL_3, MI_VEL_4, MI_VEL_5, MI_VEL_6, MI_VEL_7, MI_VEL_8, MI_VEL_9, MI_VEL_10, XXXXXXX, XXXXXXX, XXXXXXX, \ -- cgit v1.2.3 From 525be99ee938aa6e48448d7dd6ea6e6fe50bb36d Mon Sep 17 00:00:00 2001 From: Gabriel Young Date: Sat, 25 Feb 2017 15:02:43 -0800 Subject: Split MIDI functionality into MIDI_BASIC and MIDI_ADVANCED MIDI_ENABLE = no text data bss dec hex filename 0 17080 0 17080 42b8 satan_midi.hex MIDI_ENABLE = yes MIDI_BASIC undefined MIDI_ADVANCED undefined text data bss dec hex filename 0 19494 0 19494 4c26 satan_midi.hex MIDI_ENABLE = yes #define MIDI_BASIC MIDI_ADVANCED undefined text data bss dec hex filename 0 19788 0 19788 4d4c satan_midi.hex MIDI_ENABLE = yes MIDI_BASIC undefined #define MIDI_ADVANCED text data bss dec hex filename 0 20846 0 20846 516e satan_midi.hex MIDI_ENABLE = yes #define MIDI_BASIC #define MIDI_ADVANCED text data bss dec hex filename 0 21140 0 21140 5294 satan_midi.hex --- build_keyboard.mk | 1 + keyboards/satan/keymaps/midi/config.h | 17 ++++++++++++++++- keyboards/satan/keymaps/midi/keymap.c | 4 ++-- quantum/process_keycode/process_midi.c | 9 ++++++--- quantum/process_keycode/process_music.c | 22 ++++++++++++++++++++++ quantum/quantum.c | 4 ++-- quantum/quantum_keycodes.h | 13 ++++++++++--- quantum/template/config.h | 17 +++++++++++++++++ tmk_core/protocol/lufa/lufa.c | 4 ++++ 9 files changed, 80 insertions(+), 11 deletions(-) (limited to 'keyboards') diff --git a/build_keyboard.mk b/build_keyboard.mk index 4a6fc0980..eea8d5919 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -141,6 +141,7 @@ endif ifeq ($(strip $(MIDI_ENABLE)), yes) OPT_DEFS += -DMIDI_ENABLE + SRC += $(QUANTUM_DIR)/process_keycode/process_music.c SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c endif diff --git a/keyboards/satan/keymaps/midi/config.h b/keyboards/satan/keymaps/midi/config.h index 0dbdb5cbc..59250b49e 100644 --- a/keyboards/satan/keymaps/midi/config.h +++ b/keyboards/satan/keymaps/midi/config.h @@ -3,7 +3,22 @@ #include "../../config.h" -// place overrides here +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +#define MIDI_ADVANCED /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ #define MIDI_TONE_KEYCODE_OCTAVES 2 diff --git a/keyboards/satan/keymaps/midi/keymap.c b/keyboards/satan/keymaps/midi/keymap.c index 397fe097b..349391c3b 100644 --- a/keyboards/satan/keymaps/midi/keymap.c +++ b/keyboards/satan/keymaps/midi/keymap.c @@ -32,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, TG(_ML), KC_RCTL), -#ifdef MIDI_ENABLE +#if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) /* Keymap _ML: MIDI Layer * ,------------------------------------------------------------------------. * | Exit | | | | | | | | | | | | | | @@ -51,6 +51,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { MI_CHU, XXXXXXX, MI_Cs, MI_Ds, XXXXXXX, MI_Fs, MI_Gs, MI_As, XXXXXXX, MI_Cs_1, MI_Ds_1, XXXXXXX, XXXXXXX, XXXXXXX, \ MI_MOD, MI_C, MI_D, MI_E, MI_F, MI_G, MI_A, MI_B, MI_C_1, MI_D_1, MI_E_1, MI_F_1, _______, \ MI_SUS, MI_OCTD, MI_OCTU, MI_MODSD, MI_MODSU, XXXXXXX, XXXXXXX, XXXXXXX, MI_TRNSD, MI_TRNSU, MI_TRNS_0, MI_SUS, \ - _______, _______, _______, MI_OFF, _______, _______, _______, _______), + _______, _______, _______, MI_ALLOFF, _______, _______, _______, _______), #endif }; \ No newline at end of file diff --git a/quantum/process_keycode/process_midi.c b/quantum/process_keycode/process_midi.c index 5530ea97c..161f04a24 100644 --- a/quantum/process_keycode/process_midi.c +++ b/quantum/process_keycode/process_midi.c @@ -1,6 +1,7 @@ -#define MIDI_TONE_KEYCODE_OCTAVES 2 - #include "process_midi.h" + +#if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) + #include "timer.h" static uint8_t tone_status[MIDI_TONE_COUNT]; @@ -161,7 +162,7 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) dprintf("midi channel %d\n", midi_config.channel); } return false; - case MI_OFF: + case MI_ALLOFF: if (record->event.pressed) { midi_send_cc(&midi_device, midi_config.channel, 0x7B, 0); dprintf("midi off\n"); @@ -209,3 +210,5 @@ bool process_midi(uint16_t keycode, keyrecord_t *record) return true; } + +#endif // MIDI_ADVANCED diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index 1e2648bff..ac906b628 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c @@ -17,6 +17,7 @@ static uint16_t music_sequence_interval = 100; bool process_music(uint16_t keycode, keyrecord_t *record) { + #ifdef AUDIO_ENABLE if (keycode == AU_ON && record->event.pressed) { audio_on(); return false; @@ -38,6 +39,7 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { } return false; } + #endif // AUDIO_ENABLE if (keycode == MU_ON && record->event.pressed) { music_on(); @@ -61,6 +63,7 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { return false; } + #ifdef AUDIO_ENABLE if (keycode == MUV_IN && record->event.pressed) { voice_iterate(); music_scale_user(); @@ -72,11 +75,14 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { music_scale_user(); return false; } + #endif // AUDIO_ENABLE if (music_activated) { if (keycode == KC_LCTL && record->event.pressed) { // Start recording + #ifdef AUDIO_ENABLE stop_all_notes(); + #endif music_sequence_recording = true; music_sequence_recorded = false; music_sequence_playing = false; @@ -85,7 +91,9 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { } if (keycode == KC_LALT && record->event.pressed) { // Stop recording/playing + #ifdef AUDIO_ENABLE stop_all_notes(); + #endif if (music_sequence_recording) { // was recording music_sequence_recorded = true; } @@ -95,7 +103,9 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { } if (keycode == KC_LGUI && record->event.pressed && music_sequence_recorded) { // Start playing + #ifdef AUDIO_ENABLE stop_all_notes(); + #endif music_sequence_recording = false; music_sequence_playing = true; music_sequence_position = 0; @@ -116,6 +126,7 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { } #define MUSIC_MODE_GUITAR + #ifdef AUDIO_ENABLE #ifdef MUSIC_MODE_CHROMATIC float freq = ((float)220.0)*pow(2.0, -5.0)*pow(2.0,(music_starting_note + record->event.key.col + music_offset)/12.0+(MATRIX_ROWS - record->event.key.row)); #elif defined(MUSIC_MODE_GUITAR) @@ -125,15 +136,20 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { #else float freq = ((float)220.0)*pow(2.0, -5.0)*pow(2.0,(music_starting_note + SCALE[record->event.key.col + music_offset])/12.0+(MATRIX_ROWS - record->event.key.row)); #endif + #endif // AUDIO_ENABLE if (record->event.pressed) { + #ifdef AUDIO_ENABLE play_note(freq, 0xF); if (music_sequence_recording) { music_sequence[music_sequence_count] = freq; music_sequence_count++; } + #endif } else { + #ifdef AUDIO_ENABLE stop_note(freq); + #endif } if (keycode < 0xFF) // ignores all normal keycodes, but lets RAISE, LOWER, etc through @@ -161,15 +177,19 @@ void music_on(void) { void music_off(void) { music_activated = 0; + #ifdef AUDIO_ENABLE stop_all_notes(); + #endif } __attribute__ ((weak)) void music_on_user() {} +#ifdef AUDIO_ENABLE __attribute__ ((weak)) void audio_on_user() {} +#endif __attribute__ ((weak)) void music_scale_user() {} @@ -178,8 +198,10 @@ void matrix_scan_music(void) { if (music_sequence_playing) { if ((music_sequence_timer == 0) || (timer_elapsed(music_sequence_timer) > music_sequence_interval)) { music_sequence_timer = timer_read(); + #ifdef AUDIO_ENABLE stop_note(music_sequence[(music_sequence_position - 1 < 0)?(music_sequence_position - 1 + music_sequence_count):(music_sequence_position - 1)]); play_note(music_sequence[music_sequence_position], 0xF); + #endif music_sequence_position = (music_sequence_position + 1) % music_sequence_count; } } diff --git a/quantum/quantum.c b/quantum/quantum.c index 4a6d0355f..83fa87708 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -150,10 +150,10 @@ bool process_record_quantum(keyrecord_t *record) { if (!( process_record_kb(keycode, record) && - #ifdef MIDI_ENABLE + #if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) process_midi(keycode, record) && #endif - #ifdef AUDIO_ENABLE + #if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) process_music(keycode, record) && #endif #ifdef TAP_DANCE_ENABLE diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 6d1438051..3b82b7208 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -2,7 +2,7 @@ #ifndef QUANTUM_KEYCODES_H #define QUANTUM_KEYCODES_H -#ifdef MIDI_ENABLE +#if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) #ifndef MIDI_TONE_KEYCODE_OCTAVES #define MIDI_TONE_KEYCODE_OCTAVES 3 #endif @@ -116,6 +116,12 @@ enum quantum_keycodes { #ifdef MIDI_ENABLE // Midi +#ifdef MIDI_BASIC + MI_ON, // send midi notes when music mode is enabled + MI_OFF, // don't send midi notes when music mode is enabled +#endif + +#ifdef MIDI_ADVANCED MIDI_TONE_MIN, #if MIDI_TONE_KEYCODE_OCTAVES > 0 @@ -321,7 +327,7 @@ enum quantum_keycodes { MI_CHD, // previous channel MI_CHU, // next channel - MI_OFF, // all notes off + MI_ALLOFF, // all notes off MI_SUS, // sustain MI_PORT, // portamento @@ -332,7 +338,8 @@ enum quantum_keycodes { MI_MOD, // modulation MI_MODSD, // decrease modulation speed MI_MODSU, // increase modulation speed -#endif +#endif // MIDI_ADVANCED +#endif // MIDI_ENABLE // Backlight functionality BL_0, diff --git a/quantum/template/config.h b/quantum/template/config.h index cd6dfa2c6..54db4f242 100644 --- a/quantum/template/config.h +++ b/quantum/template/config.h @@ -159,6 +159,23 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION +/* + * MIDI options + */ + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index bd2498057..651a0f347 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -1104,7 +1104,9 @@ void sysex_callback(MidiDevice * device, void setup_midi(void) { +#ifdef MIDI_ADVANCED midi_init(); +#endif midi_device_init(&midi_device); midi_device_set_send_func(&midi_device, usb_send_func); midi_device_set_pre_input_process_func(&midi_device, usb_get_midi); @@ -1180,8 +1182,10 @@ int main(void) #ifdef MIDI_ENABLE midi_device_process(&midi_device); +#ifdef MIDI_ADVANCED midi_task(); #endif +#endif #if defined(RGBLIGHT_ANIMATIONS) & defined(RGBLIGHT_ENABLE) rgblight_task(); -- cgit v1.2.3 From ea14ed122fb5c1b3be5f5d6edda9b39b151692e5 Mon Sep 17 00:00:00 2001 From: Gabriel Young Date: Sat, 25 Feb 2017 19:37:33 -0800 Subject: Add basic layer to sample MIDI keycap --- keyboards/satan/keymaps/midi/keymap.c | 23 ++++++++++++++++++++++- quantum/process_keycode/process_audio.c | 2 +- quantum/process_keycode/process_music.c | 3 ++- 3 files changed, 25 insertions(+), 3 deletions(-) (limited to 'keyboards') diff --git a/keyboards/satan/keymaps/midi/keymap.c b/keyboards/satan/keymaps/midi/keymap.c index 349391c3b..8378b4e4b 100644 --- a/keyboards/satan/keymaps/midi/keymap.c +++ b/keyboards/satan/keymaps/midi/keymap.c @@ -33,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, TG(_ML), KC_RCTL), #if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) -/* Keymap _ML: MIDI Layer +/* Keymap _ML: MIDI Layer (Advanced) * ,------------------------------------------------------------------------. * | Exit | | | | | | | | | | | | | | * |------------------------------------------------------------------------| @@ -52,5 +52,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { MI_MOD, MI_C, MI_D, MI_E, MI_F, MI_G, MI_A, MI_B, MI_C_1, MI_D_1, MI_E_1, MI_F_1, _______, \ MI_SUS, MI_OCTD, MI_OCTU, MI_MODSD, MI_MODSU, XXXXXXX, XXXXXXX, XXXXXXX, MI_TRNSD, MI_TRNSU, MI_TRNS_0, MI_SUS, \ _______, _______, _______, MI_ALLOFF, _______, _______, _______, _______), +#elif defined(MIDI_ENABLE) && defined(MIDI_BASIC) +/* Keymap _ML: MIDI Layer (Advanced) + * ,------------------------------------------------------------------------. + * | Exit | | | | | | | | | | | | | | + * |------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |------------------------------------------------------------------------| + * | | | | | | | | | | | | | | + * |------------------------------------------------------------------------| + * | |MuOn|MuOf|MiOn|MiOf| | | | | | | | + * |------------------------------------------------------------------------| + * | | | | | | | | | + * `------------------------------------------------------------------------' + */ + +[_ML] = KEYMAP_ANSI( + TG(_ML), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______), #endif }; \ No newline at end of file diff --git a/quantum/process_keycode/process_audio.c b/quantum/process_keycode/process_audio.c index 5b5da546e..d45242c9e 100644 --- a/quantum/process_keycode/process_audio.c +++ b/quantum/process_keycode/process_audio.c @@ -28,7 +28,7 @@ bool process_audio(uint16_t keycode, keyrecord_t *record) { { audio_on(); } - return false; + return false; } if (keycode == MUV_IN && record->event.pressed) { diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index a1e270df1..43bcf973e 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c @@ -142,7 +142,8 @@ bool process_music(uint16_t keycode, keyrecord_t *record) { if (keycode < 0xFF) // ignores all normal keycodes, but lets RAISE, LOWER, etc through return false; } - return true; + + return true; } bool is_music_on(void) { -- cgit v1.2.3 From a64ae1066250d3aafb6e9670bf617237ec4338e7 Mon Sep 17 00:00:00 2001 From: Gabriel Young Date: Sat, 25 Feb 2017 20:41:13 -0800 Subject: Update existing keymaps Update existing keymaps to enable MIDI_BASIC functionality. Also added an option MIDI_ENABLE_STRICT to be strict about keycode use (which also reduces memory footprint at runtime) --- keyboards/planck/keymaps/dbroqua/config.h | 29 +++++++++++++++++++++++ keyboards/planck/keymaps/default/config.h | 29 +++++++++++++++++++++++ keyboards/planck/keymaps/experimental/config.h | 23 ++++++++++++++++++ keyboards/planck/keymaps/impossible/config.h | 29 +++++++++++++++++++++++ keyboards/planck/keymaps/jeebak/config.h | 29 +++++++++++++++++++++++ keyboards/planck/keymaps/jhenahan/config.h | 23 ++++++++++++++++++ keyboards/planck/keymaps/premek/config.h | 29 +++++++++++++++++++++++ keyboards/planck/keymaps/sgoodwin/config.h | 29 +++++++++++++++++++++++ keyboards/planck/keymaps/smt/config.h | 29 +++++++++++++++++++++++ keyboards/planck/keymaps/thermal_printer/config.h | 23 ++++++++++++++++++ keyboards/planck/keymaps/unicode/config.h | 29 +++++++++++++++++++++++ keyboards/planck/keymaps/xyverz/config.h | 29 +++++++++++++++++++++++ keyboards/preonic/keymaps/CMD-Preonic/config.h | 29 +++++++++++++++++++++++ keyboards/preonic/keymaps/default/config.h | 29 +++++++++++++++++++++++ keyboards/preonic/keymaps/smt/config.h | 29 +++++++++++++++++++++++ keyboards/satan/keymaps/midi/config.h | 3 +++ keyboards/subatomic/keymaps/default/config.h | 29 +++++++++++++++++++++++ quantum/process_keycode/process_audio.c | 4 ++-- quantum/process_keycode/process_music.c | 2 +- quantum/process_keycode/process_music.h | 1 + quantum/quantum.c | 4 ++-- quantum/quantum_keycodes.h | 28 +++++++++++----------- quantum/template/config.h | 3 +++ 23 files changed, 472 insertions(+), 19 deletions(-) create mode 100644 keyboards/planck/keymaps/dbroqua/config.h create mode 100644 keyboards/planck/keymaps/default/config.h create mode 100644 keyboards/planck/keymaps/impossible/config.h create mode 100644 keyboards/planck/keymaps/jeebak/config.h create mode 100644 keyboards/planck/keymaps/premek/config.h create mode 100644 keyboards/planck/keymaps/sgoodwin/config.h create mode 100644 keyboards/planck/keymaps/smt/config.h create mode 100644 keyboards/planck/keymaps/unicode/config.h create mode 100644 keyboards/planck/keymaps/xyverz/config.h create mode 100644 keyboards/preonic/keymaps/CMD-Preonic/config.h create mode 100644 keyboards/preonic/keymaps/default/config.h create mode 100644 keyboards/preonic/keymaps/smt/config.h create mode 100644 keyboards/subatomic/keymaps/default/config.h (limited to 'keyboards') diff --git a/keyboards/planck/keymaps/dbroqua/config.h b/keyboards/planck/keymaps/dbroqua/config.h new file mode 100644 index 000000000..4c6158199 --- /dev/null +++ b/keyboards/planck/keymaps/dbroqua/config.h @@ -0,0 +1,29 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/default/config.h b/keyboards/planck/keymaps/default/config.h new file mode 100644 index 000000000..4c6158199 --- /dev/null +++ b/keyboards/planck/keymaps/default/config.h @@ -0,0 +1,29 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/experimental/config.h b/keyboards/planck/keymaps/experimental/config.h index cc093bee4..492490ca1 100644 --- a/keyboards/planck/keymaps/experimental/config.h +++ b/keyboards/planck/keymaps/experimental/config.h @@ -14,4 +14,27 @@ #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + #endif diff --git a/keyboards/planck/keymaps/impossible/config.h b/keyboards/planck/keymaps/impossible/config.h new file mode 100644 index 000000000..4c6158199 --- /dev/null +++ b/keyboards/planck/keymaps/impossible/config.h @@ -0,0 +1,29 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/jeebak/config.h b/keyboards/planck/keymaps/jeebak/config.h new file mode 100644 index 000000000..4c6158199 --- /dev/null +++ b/keyboards/planck/keymaps/jeebak/config.h @@ -0,0 +1,29 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/jhenahan/config.h b/keyboards/planck/keymaps/jhenahan/config.h index cd3adc41c..1e42b92b9 100644 --- a/keyboards/planck/keymaps/jhenahan/config.h +++ b/keyboards/planck/keymaps/jhenahan/config.h @@ -6,4 +6,27 @@ #define FORCE_NKRO #define WORKMAN_SOUND COLEMAK_SOUND +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + #endif diff --git a/keyboards/planck/keymaps/premek/config.h b/keyboards/planck/keymaps/premek/config.h new file mode 100644 index 000000000..4c6158199 --- /dev/null +++ b/keyboards/planck/keymaps/premek/config.h @@ -0,0 +1,29 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/sgoodwin/config.h b/keyboards/planck/keymaps/sgoodwin/config.h new file mode 100644 index 000000000..4c6158199 --- /dev/null +++ b/keyboards/planck/keymaps/sgoodwin/config.h @@ -0,0 +1,29 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/smt/config.h b/keyboards/planck/keymaps/smt/config.h new file mode 100644 index 000000000..4c6158199 --- /dev/null +++ b/keyboards/planck/keymaps/smt/config.h @@ -0,0 +1,29 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/thermal_printer/config.h b/keyboards/planck/keymaps/thermal_printer/config.h index 430b6493c..bcd098930 100644 --- a/keyboards/planck/keymaps/thermal_printer/config.h +++ b/keyboards/planck/keymaps/thermal_printer/config.h @@ -20,4 +20,27 @@ sei(); \ } while(0) +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + #endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/unicode/config.h b/keyboards/planck/keymaps/unicode/config.h new file mode 100644 index 000000000..4c6158199 --- /dev/null +++ b/keyboards/planck/keymaps/unicode/config.h @@ -0,0 +1,29 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/xyverz/config.h b/keyboards/planck/keymaps/xyverz/config.h new file mode 100644 index 000000000..4c6158199 --- /dev/null +++ b/keyboards/planck/keymaps/xyverz/config.h @@ -0,0 +1,29 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/preonic/keymaps/CMD-Preonic/config.h b/keyboards/preonic/keymaps/CMD-Preonic/config.h new file mode 100644 index 000000000..4c6158199 --- /dev/null +++ b/keyboards/preonic/keymaps/CMD-Preonic/config.h @@ -0,0 +1,29 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/preonic/keymaps/default/config.h b/keyboards/preonic/keymaps/default/config.h new file mode 100644 index 000000000..4c6158199 --- /dev/null +++ b/keyboards/preonic/keymaps/default/config.h @@ -0,0 +1,29 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/preonic/keymaps/smt/config.h b/keyboards/preonic/keymaps/smt/config.h new file mode 100644 index 000000000..4c6158199 --- /dev/null +++ b/keyboards/preonic/keymaps/smt/config.h @@ -0,0 +1,29 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/satan/keymaps/midi/config.h b/keyboards/satan/keymaps/midi/config.h index 59250b49e..8e10b04ec 100644 --- a/keyboards/satan/keymaps/midi/config.h +++ b/keyboards/satan/keymaps/midi/config.h @@ -7,6 +7,9 @@ * MIDI options */ +/* Prevent use of disabled MIDI features in the keymap */ +#define MIDI_ENABLE_STRICT 1 + /* enable basic MIDI features: - MIDI notes can be sent when in Music mode is on */ diff --git a/keyboards/subatomic/keymaps/default/config.h b/keyboards/subatomic/keymaps/default/config.h new file mode 100644 index 000000000..4c6158199 --- /dev/null +++ b/keyboards/subatomic/keymaps/default/config.h @@ -0,0 +1,29 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/quantum/process_keycode/process_audio.c b/quantum/process_keycode/process_audio.c index d45242c9e..71c0297ee 100644 --- a/quantum/process_keycode/process_audio.c +++ b/quantum/process_keycode/process_audio.c @@ -1,5 +1,5 @@ -#include "process_audio.h" #include "audio.h" +#include "process_audio.h" static float compute_freq_for_midi_note(uint8_t note) { @@ -43,7 +43,7 @@ bool process_audio(uint16_t keycode, keyrecord_t *record) { return false; } - return true + return true; } void process_audio_noteon(uint8_t note) { diff --git a/quantum/process_keycode/process_music.c b/quantum/process_keycode/process_music.c index 43bcf973e..4b86b91f0 100644 --- a/quantum/process_keycode/process_music.c +++ b/quantum/process_keycode/process_music.c @@ -42,7 +42,7 @@ static void music_noteoff(uint8_t note) { #endif } -static void music_all_notes_off(void) { +void music_all_notes_off(void) { #ifdef AUDIO_ENABLE process_audio_stop_all_notes(); #endif diff --git a/quantum/process_keycode/process_music.h b/quantum/process_keycode/process_music.h index 69913b276..a36514a44 100644 --- a/quantum/process_keycode/process_music.h +++ b/quantum/process_keycode/process_music.h @@ -14,6 +14,7 @@ void music_off(void); void music_on_user(void); void music_scale_user(void); +void music_all_notes_off(void); void matrix_scan_music(void); diff --git a/quantum/quantum.c b/quantum/quantum.c index 7a27a568a..a4a12061b 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -95,8 +95,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { void reset_keyboard(void) { clear_keyboard(); -#ifdef AUDIO_ENABLE - stop_all_notes(); +#if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_ENABLE_BASIC)) + music_all_notes_off(); shutdown_user(); #endif wait_ms(250); diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 3b82b7208..56228f276 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -1,8 +1,11 @@ - #ifndef QUANTUM_KEYCODES_H #define QUANTUM_KEYCODES_H -#if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED) +#ifndef MIDI_ENABLE_STRICT +#define MIDI_ENABLE_STRICT 0 +#endif + +#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_ADVANCED)) #ifndef MIDI_TONE_KEYCODE_OCTAVES #define MIDI_TONE_KEYCODE_OCTAVES 3 #endif @@ -113,18 +116,16 @@ enum quantum_keycodes { MUV_IN, MUV_DE, -#ifdef MIDI_ENABLE // Midi - -#ifdef MIDI_BASIC +#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) MI_ON, // send midi notes when music mode is enabled MI_OFF, // don't send midi notes when music mode is enabled #endif -#ifdef MIDI_ADVANCED +#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_ADVANCED)) MIDI_TONE_MIN, -#if MIDI_TONE_KEYCODE_OCTAVES > 0 +#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 0 MI_C = MIDI_TONE_MIN, MI_Cs, MI_Db = MI_Cs, @@ -144,7 +145,7 @@ enum quantum_keycodes { MI_B, #endif -#if MIDI_TONE_KEYCODE_OCTAVES > 1 +#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 1 MI_C_1, MI_Cs_1, MI_Db_1 = MI_Cs_1, @@ -164,7 +165,7 @@ enum quantum_keycodes { MI_B_1, #endif -#if MIDI_TONE_KEYCODE_OCTAVES > 2 +#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 2 MI_C_2, MI_Cs_2, MI_Db_2 = MI_Cs_2, @@ -184,7 +185,7 @@ enum quantum_keycodes { MI_B_2, #endif -#if MIDI_TONE_KEYCODE_OCTAVES > 3 +#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 3 MI_C_3, MI_Cs_3, MI_Db_3 = MI_Cs_3, @@ -204,7 +205,7 @@ enum quantum_keycodes { MI_B_3, #endif -#if MIDI_TONE_KEYCODE_OCTAVES > 4 +#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 4 MI_C_4, MI_Cs_4, MI_Db_4 = MI_Cs_4, @@ -224,7 +225,7 @@ enum quantum_keycodes { MI_B_4, #endif -#if MIDI_TONE_KEYCODE_OCTAVES > 5 +#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 5 MI_C_5, MI_Cs_5, MI_Db_5 = MI_Cs_5, @@ -244,7 +245,7 @@ enum quantum_keycodes { MI_B_5, #endif -#if MIDI_TONE_KEYCODE_OCTAVES > 5 +#if !MIDI_ENABLE_STRICT || MIDI_TONE_KEYCODE_OCTAVES > 5 MIDI_TONE_MAX = MI_B_5, #elif MIDI_TONE_KEYCODE_OCTAVES > 4 MIDI_TONE_MAX = MI_B_4, @@ -339,7 +340,6 @@ enum quantum_keycodes { MI_MODSD, // decrease modulation speed MI_MODSU, // increase modulation speed #endif // MIDI_ADVANCED -#endif // MIDI_ENABLE // Backlight functionality BL_0, diff --git a/quantum/template/config.h b/quantum/template/config.h index 54db4f242..7393097e1 100644 --- a/quantum/template/config.h +++ b/quantum/template/config.h @@ -163,6 +163,9 @@ along with this program. If not, see . * MIDI options */ +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + /* enable basic MIDI features: - MIDI notes can be sent when in Music mode is on */ -- cgit v1.2.3 From 976c856966841cd0be6e514c6365c73164f5b96d Mon Sep 17 00:00:00 2001 From: Gabriel Young Date: Sat, 25 Feb 2017 21:38:35 -0800 Subject: Update size estimates in the Makefile MIDI_ENABLE = no text data bss dec hex filename 0 17080 0 17080 42b8 satan_midi.hex MIDI_ENABLE = yes MIDI_BASIC undefined MIDI_ADVANCED undefined text data bss dec hex filename 0 19494 0 19494 4c26 satan_midi.hex +2414 bytes (vs. MIDI_ENABLE = no) MIDI_ENABLE = yes 0 20846 0 20846 516e satan_midi.hex +1352 bytes (vs. MIDI_ENABLE = yes, MIDI_BASIC off, MIDI_ADVANCED off) MIDI_ENABLE = yes #define MIDI_BASIC #define MIDI_ADVANCED text data bss dec hex filename 0 21292 0 21292 532c satan_midi.hex +1798 bytes (vs. MIDI_ENABLE = yes, MIDI_BASIC off, MIDI_ADVANCED off) Conclusion: +2400 to 4200, depending on config --- keyboards/satan/keymaps/midi/Makefile | 2 +- quantum/template/rules.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'keyboards') diff --git a/keyboards/satan/keymaps/midi/Makefile b/keyboards/satan/keymaps/midi/Makefile index 4e2d9d2f7..89c34b394 100644 --- a/keyboards/satan/keymaps/midi/Makefile +++ b/keyboards/satan/keymaps/midi/Makefile @@ -9,7 +9,7 @@ CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # 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 support (+3800) +MIDI_ENABLE = yes # MIDI support (+2400 to 4200, depending on config) AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/quantum/template/rules.mk b/quantum/template/rules.mk index bad3387bf..a1f9377d8 100644 --- a/quantum/template/rules.mk +++ b/quantum/template/rules.mk @@ -61,7 +61,7 @@ SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE ?= no # USB Nkey Rollover BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls +MIDI_ENABLE ?= no # MIDI support (+2400 to 4200, depending on config) UNICODE_ENABLE ?= no # Unicode BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE ?= no # Audio output on port C6 -- cgit v1.2.3 From 5ae0cfeef5134b8ba9d1f2bff0c105d4e18b064c Mon Sep 17 00:00:00 2001 From: Stephen Tudor Date: Thu, 9 Mar 2017 13:58:33 -0500 Subject: Add smt keymap for Satan 'GH60' --- keyboards/satan/keymaps/smt/Makefile | 21 ++++ keyboards/satan/keymaps/smt/keymap.c | 204 ++++++++++++++++++++++++++++++++++ keyboards/satan/keymaps/smt/readme.md | 1 + 3 files changed, 226 insertions(+) create mode 100644 keyboards/satan/keymaps/smt/Makefile create mode 100644 keyboards/satan/keymaps/smt/keymap.c create mode 100644 keyboards/satan/keymaps/smt/readme.md (limited to 'keyboards') diff --git a/keyboards/satan/keymaps/smt/Makefile b/keyboards/satan/keymaps/smt/Makefile new file mode 100644 index 000000000..2a7ff2779 --- /dev/null +++ b/keyboards/satan/keymaps/smt/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # 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 = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/satan/keymaps/smt/keymap.c b/keyboards/satan/keymaps/smt/keymap.c new file mode 100644 index 000000000..1dfa9495b --- /dev/null +++ b/keyboards/satan/keymaps/smt/keymap.c @@ -0,0 +1,204 @@ +#include "satan.h" + + +// Used for SHIFT_ESC +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +// 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. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK +}; + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) +#define ALT_GRV ALT_T(KC_GRV) // Tap for Backtick, hold for Alt + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _QWERTY: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space/Fn |Alt |Gui |Fn |Ctrl | + * `-----------------------------------------------------------' + */ +[_QWERTY] = KEYMAP_ANSI( + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \ + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_ENT, \ + KC_LCTL, KC_LGUI,KC_LALT, LT(_RAISE, KC_SPC), KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), + + /* Keymap _COLEMAK: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \ | + * |-----------------------------------------------------------| + * |CAPS | A| R| S| T| D| H| N| E| I| O| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| K| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space/Fn |Alt |Gui |Fn |Ctrl | + * `-----------------------------------------------------------' + */ +[_COLEMAK] = KEYMAP_ANSI( + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,KC_LBRC, KC_RBRC,KC_BSLS, \ + CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O ,KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_ENT, \ + KC_LCTL, KC_LGUI,KC_LALT, LT(_RAISE, KC_SPC), KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), + + /* Keymap _DVORAK: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]|Backsp | + * |-----------------------------------------------------------| + * |HypTb| '| ,| .| P| Y| F| G| C| R| L| /| =| \ | + * |-----------------------------------------------------------| + * |CtrlEsc| A| O| E| U| I| D| H| T| N| S| -|Return | + * |-----------------------------------------------------------| + * |Shift | ;| Q| J| K| X| B| M| W| V| Z|ShiftEnter| + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space/Fn |Alt |Gui |Fn |Ctrl | + * `-----------------------------------------------------------' + */ +[_DVORAK] = KEYMAP_ANSI( + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC,KC_BSPC, \ + HPR_TAB, KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, \ + CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, \ + KC_LSFT, KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, \ + KC_LCTL, KC_LGUI,KC_LALT, LT(_RAISE, KC_SPC), KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), + + /* Keymap _LOWER: Function Layer + * ,-----------------------------------------------------------. + * | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | + * |-----------------------------------------------------------| + * | |Hom| UP|End| | | | | | | |Vo-|Vo+| | + * |-----------------------------------------------------------| + * | |LFT| DN| RT| | |LFT| DN| UP| RT| |Pg+| | + * |-----------------------------------------------------------| + * | | | | | | | | | | |Pg-| | + * |-----------------------------------------------------------| + * | | |Prev| Play |Next| | | | + * `-----------------------------------------------------------' + */ +[_LOWER] = KEYMAP_ANSI( + KC_GRV ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_DEL, \ + _______,KC_HOME,KC_UP ,KC_END ,_______,_______,_______,_______,_______,_______,_______,KC_VOLD,KC_VOLU,_______, \ + _______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,KC_LEFT,KC_DOWN,KC_UP ,KC_RGHT,_______,KC_PGUP ,_______, \ + _______ ,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_PGDN ,_______, \ + _______,_______,KC_MPRV ,KC_MPLY ,KC_MNXT,_______,_______,_______), + + /* Keymap _RAISE: Function Layer + * ,-----------------------------------------------------------. + * | | | | | | | | | | | | | | RESET | + * |-----------------------------------------------------------| + * | | | | | | | | | | | |BL-|BL+|BL | + * |-----------------------------------------------------------| + * | | | | | | | |QWT|CLM|DVK| | | | + * |-----------------------------------------------------------| + * | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ +[_RAISE] = KEYMAP_ANSI( + #ifdef RGBLIGHT_ENABLE + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET , \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,BL_DEC ,BL_INC ,BL_TOGG, \ + _______,_______,_______,_______,_______,_______,_______,QWERTY ,COLEMAK,DVORAK ,_______,_______ ,_______, \ + _______ ,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______ ,_______, \ + _______,_______,_______ ,_______ ,_______,_______,_______,_______ + #else + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET , \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,BL_DEC ,BL_INC ,BL_TOGG, \ + _______,_______,_______,_______,_______,_______,_______,QWERTY ,COLEMAK,DVORAK ,_______,_______ ,_______, \ + _______ ,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ ,_______, \ + _______,_______,_______ ,_______ ,_______,_______,XXXXXXX,_______ + #endif + ) +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + } + return true; +} + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} diff --git a/keyboards/satan/keymaps/smt/readme.md b/keyboards/satan/keymaps/smt/readme.md new file mode 100644 index 000000000..7b706d601 --- /dev/null +++ b/keyboards/satan/keymaps/smt/readme.md @@ -0,0 +1 @@ +# smt's Satan GH60 layout -- cgit v1.2.3 From b19e34c81e3e16dc75a39cdc94300fb116c9254c Mon Sep 17 00:00:00 2001 From: Stephen Tudor Date: Fri, 10 Mar 2017 16:10:05 -0500 Subject: Forsake spacefn in favor of left shift tapdance. Move media controls. --- keyboards/satan/keymaps/smt/keymap.c | 49 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'keyboards') diff --git a/keyboards/satan/keymaps/smt/keymap.c b/keyboards/satan/keymaps/smt/keymap.c index 1dfa9495b..4ac016f21 100644 --- a/keyboards/satan/keymaps/smt/keymap.c +++ b/keyboards/satan/keymaps/smt/keymap.c @@ -24,10 +24,11 @@ enum planck_keycodes { #define XXXXXXX KC_NO // Custom macros +#define ALT_GRV ALT_T(KC_GRV) // Tap for Backtick, hold for Alt #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl -#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) -#define ALT_GRV ALT_T(KC_GRV) // Tap for Backtick, hold for Alt +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define SFT_RSE TD(KC_LSFT, OS(_RAISE)) // Double-tap for RAISE one-shot, otherwise Left Shift const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _QWERTY: (Base Layer) Default Layer @@ -40,15 +41,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | * |-----------------------------------------------------------| - * |Ctrl|Gui |Alt | Space/Fn |Alt |Gui |Fn |Ctrl | + * |Ctrl|Gui |Alt | Space |Alt |Gui |Fn |Ctrl | * `-----------------------------------------------------------' */ [_QWERTY] = KEYMAP_ANSI( F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \ CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_ENT, \ - KC_LCTL, KC_LGUI,KC_LALT, LT(_RAISE, KC_SPC), KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), + SFT_RSE, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_ENT, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), /* Keymap _COLEMAK: (Base Layer) Default Layer * ,-----------------------------------------------------------. @@ -60,15 +61,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * |Shift | Z| X| C| V| B| K| M| ,| .| /|Shift | * |-----------------------------------------------------------| - * |Ctrl|Gui |Alt | Space/Fn |Alt |Gui |Fn |Ctrl | + * |Ctrl|Gui |Alt | Space |Alt |Gui |Fn |Ctrl | * `-----------------------------------------------------------' */ [_COLEMAK] = KEYMAP_ANSI( F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,KC_LBRC, KC_RBRC,KC_BSLS, \ CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O ,KC_QUOT, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_ENT, \ - KC_LCTL, KC_LGUI,KC_LALT, LT(_RAISE, KC_SPC), KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), + SFT_RSE, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_ENT, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), /* Keymap _DVORAK: (Base Layer) Default Layer * ,-----------------------------------------------------------. @@ -80,35 +81,35 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * |Shift | ;| Q| J| K| X| B| M| W| V| Z|ShiftEnter| * |-----------------------------------------------------------| - * |Ctrl|Gui |Alt | Space/Fn |Alt |Gui |Fn |Ctrl | + * |Ctrl|Gui |Alt | Space |Alt |Gui |Fn |Ctrl | * `-----------------------------------------------------------' */ [_DVORAK] = KEYMAP_ANSI( F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC,KC_BSPC, \ HPR_TAB, KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, \ CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, \ - KC_LSFT, KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, \ - KC_LCTL, KC_LGUI,KC_LALT, LT(_RAISE, KC_SPC), KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), + SFT_RSE, KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), /* Keymap _LOWER: Function Layer * ,-----------------------------------------------------------. * | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | * |-----------------------------------------------------------| - * | |Hom| UP|End| | | | | | | |Vo-|Vo+| | + * | |Hom| UP|End| | | | | | | |BL-|BL+|BL | * |-----------------------------------------------------------| - * | |LFT| DN| RT| | |LFT| DN| UP| RT| |Pg+| | + * | |LFT| DN| RT| | |LFT| DN| UP| RT|Vo+|Pg+| | * |-----------------------------------------------------------| - * | | | | | | | | | | |Pg-| | + * | | | |Prv|Ply|Nxt| | | |Vo-|Pg-| | * |-----------------------------------------------------------| - * | | |Prev| Play |Next| | | | + * | | | | | | | | | * `-----------------------------------------------------------' */ [_LOWER] = KEYMAP_ANSI( KC_GRV ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_DEL, \ - _______,KC_HOME,KC_UP ,KC_END ,_______,_______,_______,_______,_______,_______,_______,KC_VOLD,KC_VOLU,_______, \ - _______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,KC_LEFT,KC_DOWN,KC_UP ,KC_RGHT,_______,KC_PGUP ,_______, \ - _______ ,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_PGDN ,_______, \ - _______,_______,KC_MPRV ,KC_MPLY ,KC_MNXT,_______,_______,_______), + _______,KC_HOME,KC_UP ,KC_END ,_______,_______,_______,_______,_______,_______,_______,BL_DEC ,BL_INC ,BL_TOGG, \ + _______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,KC_LEFT,KC_DOWN,KC_UP ,KC_RGHT,KC_VOLU,KC_PGUP ,_______, \ + KC_LSFT ,_______,_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,_______,_______,KC_VOLD,KC_PGDN ,_______, \ + _______,_______,_______ ,_______ ,_______,_______,_______,_______), /* Keymap _RAISE: Function Layer * ,-----------------------------------------------------------. @@ -126,15 +127,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = KEYMAP_ANSI( #ifdef RGBLIGHT_ENABLE _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET , \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,BL_DEC ,BL_INC ,BL_TOGG, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ _______,_______,_______,_______,_______,_______,_______,QWERTY ,COLEMAK,DVORAK ,_______,_______ ,_______, \ - _______ ,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______ ,_______, \ - _______,_______,_______ ,_______ ,_______,_______,_______,_______ + KC_LSFT ,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______ ,_______, \ + _______,_______,_______ ,_______ ,_______,_______,XXXXXXX,_______ #else _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET , \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,BL_DEC ,BL_INC ,BL_TOGG, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ _______,_______,_______,_______,_______,_______,_______,QWERTY ,COLEMAK,DVORAK ,_______,_______ ,_______, \ - _______ ,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ ,_______, \ + KC_LSFT ,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ ,_______, \ _______,_______,_______ ,_______ ,_______,_______,XXXXXXX,_______ #endif ) -- cgit v1.2.3 From 96bde794d8b922d71f11ec2e7eb1ba0bc0ba8d2d Mon Sep 17 00:00:00 2001 From: James Barrett Date: Sat, 11 Mar 2017 22:09:50 -0800 Subject: Update readme and default layout for TADA68 Add the default function layer mappings for the keyboard. Provide flashing instructions in the readme. --- .gitignore | 1 + keyboards/tada68/keymaps/default/keymap.c | 66 +++++------------------------- keyboards/tada68/keymaps/default/readme.md | 2 + keyboards/tada68/readme.md | 15 ++++++- 4 files changed, 26 insertions(+), 58 deletions(-) (limited to 'keyboards') diff --git a/.gitignore b/.gitignore index f66a961fd..6029afce4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .dep *.o +*.bin *.eep *.elf *.hex diff --git a/keyboards/tada68/keymaps/default/keymap.c b/keyboards/tada68/keymaps/default/keymap.c index da57c0343..f28116e0a 100644 --- a/keyboards/tada68/keymaps/default/keymap.c +++ b/keyboards/tada68/keymaps/default/keymap.c @@ -1,9 +1,5 @@ #include "tada68.h" - -// Used for SHIFT_ESC -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - // 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. // Layer names don't all need to be of the same length, obviously, and you can also skip them @@ -36,63 +32,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _FL: Function Layer * ,----------------------------------------------------------------. - * | | | | | | | | | | | | | | RESET| | + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | * |----------------------------------------------------------------| - * | | | | | | | | | | | |BL-|BL+|BL | | + * | | |Up | | | | | | | | | | | |Hme | * |----------------------------------------------------------------| - * | | | | | | | | | | | | | | + * | |<- |Dn | ->| | | | | | | | | |End | * |----------------------------------------------------------------| - * | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | | | | + * | | | |Bl-|BL |BL+| |VU-|VU+|MUT| |MouseL|MsU|Rck | * |----------------------------------------------------------------| - * | | | | | | | | | | | + * | | | | | | | |MsL|MsD|MsR | * `----------------------------------------------------------------' */ [_FL] = KEYMAP_ANSI( - #ifdef RGBLIGHT_ENABLE - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______, \ - _______,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______,_______,_______,_______, \ - _______,_______,_______, _______, _______,_______,_______,_______,_______, _______), - #else - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ - _______,_______,_______, _______, _______,_______,_______,_______,_______, _______), - #endif -}; - -/*enum function_id { - //SHIFT_ESC, + _______, KC_F1 ,KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_INS , \ + _______,_______,KC_UP, _______,_______,_______,_______,_______,_______,_______,_______, BL_DEC,BL_INC, BL_TOGG,KC_HOME, \ + _______,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______,_______,_______,_______,_______,_______,_______, _______,KC_END, \ + _______,_______,_______,BL_DEC, BL_TOGG,BL_INC, _______,KC_VOLD,KC_VOLU,KC_MUTE,_______,KC_BTN1, KC_MS_U, KC_BTN2, \ + _______,_______,_______, _______, _______,_______,_______,KC_MS_L,KC_MS_D, KC_MS_R), }; - -const uint16_t PROGMEM fn_actions[] = { - //[0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -}*/ diff --git a/keyboards/tada68/keymaps/default/readme.md b/keyboards/tada68/keymaps/default/readme.md index 36760d6b9..53412d7c2 100644 --- a/keyboards/tada68/keymaps/default/readme.md +++ b/keyboards/tada68/keymaps/default/readme.md @@ -1 +1,3 @@ # default TADA68 layout + +This layout replicates the default factory layout of the TADA68. diff --git a/keyboards/tada68/readme.md b/keyboards/tada68/readme.md index 552fdea52..dbe2fdca1 100644 --- a/keyboards/tada68/readme.md +++ b/keyboards/tada68/readme.md @@ -1,4 +1,15 @@ TADA68 keyboard firmware -====================== +======================== -TODO: to be updated. +1) from the keyboards/tada68 directory run: +``` +$ make flashbin +``` + +2) hit the reset button on the TADA, the lights will start flashing. + +3) You'll see a new drive on your computer called TADA68. Backup the original factory `FLASH.BIN` file thats inside it. + +4) Delete `FLASH.BIN` from the TADA drive and copy `tada68_default.bin` that was generated at the root of the qmk directory into the TADA drive. + +5) Hit ESC on the keyboard. The lights will stop flashing and your firmware is loaded! \ No newline at end of file -- cgit v1.2.3 From cf28f7bfdaf7a2e5f8734c0936f5e48b93c9353a Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Wed, 15 Mar 2017 23:07:29 -0400 Subject: Add custom keycap --- keyboards/planck/keymaps/khord/keymap.c | 318 ++++++++++++++++++++++++++++++++ 1 file changed, 318 insertions(+) create mode 100644 keyboards/planck/keymaps/khord/keymap.c (limited to 'keyboards') diff --git a/keyboards/planck/keymaps/khord/keymap.c b/keyboards/planck/keymaps/khord/keymap.c new file mode 100644 index 000000000..478e1f822 --- /dev/null +++ b/keyboards/planck/keymaps/khord/keymap.c @@ -0,0 +1,318 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include "planck.h" +#include "action_layer.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// 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. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _ADJUST 16 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Dylan's additions +#define C_A_DEL LALT(LCTL(KC_DEL)) +#define C_A_INS LALT(LCTL(KC_INS)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |TogOut| S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, + {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, C_A_INS, C_A_DEL} +} + + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(SONIC_RING); //plug in +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(ZELDA_PUZZLE); //music mode + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_NOTE_ARRAY(tone_plover, false, 0); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_plover_gb, false, 0); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif -- cgit v1.2.3 From 73a70a2c1c78a140ac506bbe8b91ff4a7eb70da4 Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Wed, 15 Mar 2017 23:09:17 -0400 Subject: Add Makefile --- keyboards/planck/keymaps/khord/Makefile | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 keyboards/planck/keymaps/khord/Makefile (limited to 'keyboards') diff --git a/keyboards/planck/keymaps/khord/Makefile b/keyboards/planck/keymaps/khord/Makefile new file mode 100644 index 000000000..457a3d01d --- /dev/null +++ b/keyboards/planck/keymaps/khord/Makefile @@ -0,0 +1,3 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif -- cgit v1.2.3 From 0c0a8ee187eb27faefe4391d978283a081896399 Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Thu, 16 Mar 2017 03:46:26 +0000 Subject: test --- keyboards/planck/keymaps/khord/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards') diff --git a/keyboards/planck/keymaps/khord/keymap.c b/keyboards/planck/keymaps/khord/keymap.c index 478e1f822..e6c90c26d 100644 --- a/keyboards/planck/keymaps/khord/keymap.c +++ b/keyboards/planck/keymaps/khord/keymap.c @@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = { {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT) }, {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, -- cgit v1.2.3 From 24d174595120aa6874604eed41db7ae02b26c9be Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Thu, 16 Mar 2017 12:24:31 -0400 Subject: add config.h for customization --- keyboards/planck/keymaps/khord/config.h | 90 +++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 keyboards/planck/keymaps/khord/config.h (limited to 'keyboards') diff --git a/keyboards/planck/keymaps/khord/config.h b/keyboards/planck/keymaps/khord/config.h new file mode 100644 index 000000000..5cf96bb88 --- /dev/null +++ b/keyboards/planck/keymaps/khord/config.h @@ -0,0 +1,90 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define MANUFACTURER Ortholinear Keyboards +#define PRODUCT The Planck Keyboard +#define DESCRIPTION A compact ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* Planck PCB default pin-out */ +#define MATRIX_ROW_PINS { D0, D5, B5, B6 } +#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 } +#define UNUSED_PINS + +#define AUDIO_VOICES + +#define BACKLIGHT_PIN B7 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#ifdef SUBPROJECT_rev3 + #include "rev3/config.h" +#endif +#ifdef SUBPROJECT_rev4 + #include "rev4/config.h" +#endif + +#endif -- cgit v1.2.3 From 0c8f71e3c7fe258e6e084d7eec018b89a499d014 Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Thu, 16 Mar 2017 12:44:56 -0400 Subject: test tap dance --- keyboards/planck/keymaps/khord/Makefile | 1 + keyboards/planck/keymaps/khord/config.h | 3 +++ keyboards/planck/keymaps/khord/keymap.c | 14 +++++++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'keyboards') diff --git a/keyboards/planck/keymaps/khord/Makefile b/keyboards/planck/keymaps/khord/Makefile index 457a3d01d..666161d1f 100644 --- a/keyboards/planck/keymaps/khord/Makefile +++ b/keyboards/planck/keymaps/khord/Makefile @@ -1,3 +1,4 @@ ifndef QUANTUM_DIR include ../../../../Makefile endif +TAP_DANCE_ENABLE = yes diff --git a/keyboards/planck/keymaps/khord/config.h b/keyboards/planck/keymaps/khord/config.h index 5cf96bb88..76a1f8832 100644 --- a/keyboards/planck/keymaps/khord/config.h +++ b/keyboards/planck/keymaps/khord/config.h @@ -62,6 +62,9 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) +/* Tap Dance */ +#define TAPPING_TERM 200 + /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/planck/keymaps/khord/keymap.c b/keyboards/planck/keymaps/khord/keymap.c index e6c90c26d..04b95c744 100644 --- a/keyboards/planck/keymaps/khord/keymap.c +++ b/keyboards/planck/keymaps/khord/keymap.c @@ -33,6 +33,18 @@ enum planck_keycodes { EXT_PLV }; +// Tap Dance Declarations +enum { + TD_ESC_CAPS = 0 +}; + +// Tap Dance Definitions +qk_tap_dance_action_t tape_dance_actions[] = { + //Tap once for Esc, twice for Caps Lock + [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS) + // Other declarations would go here, separated by commas, if you have them +}; + // Fillers to make layering more clear #define _______ KC_TRNS #define XXXXXXX KC_NO @@ -56,7 +68,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_QWERTY] = { {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {TD(TD_ESC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT) }, {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, -- cgit v1.2.3 From 6ca1c49d38ddc31c5fc9ef1c180849804fe358fd Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Thu, 16 Mar 2017 13:07:01 -0400 Subject: test fixes for tap dane --- keyboards/planck/keymaps/khord/config.h | 2 +- keyboards/planck/keymaps/khord/keymap.c | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'keyboards') diff --git a/keyboards/planck/keymaps/khord/config.h b/keyboards/planck/keymaps/khord/config.h index 76a1f8832..008f3a5c2 100644 --- a/keyboards/planck/keymaps/khord/config.h +++ b/keyboards/planck/keymaps/khord/config.h @@ -63,7 +63,7 @@ along with this program. If not, see . ) /* Tap Dance */ -#define TAPPING_TERM 200 +#define TAPPING_TERM 150 /* * Feature disable options diff --git a/keyboards/planck/keymaps/khord/keymap.c b/keyboards/planck/keymaps/khord/keymap.c index 04b95c744..50a5daa57 100644 --- a/keyboards/planck/keymaps/khord/keymap.c +++ b/keyboards/planck/keymaps/khord/keymap.c @@ -33,22 +33,15 @@ enum planck_keycodes { EXT_PLV }; +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + // Tap Dance Declarations enum { TD_ESC_CAPS = 0 }; -// Tap Dance Definitions -qk_tap_dance_action_t tape_dance_actions[] = { - //Tap once for Esc, twice for Caps Lock - [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS) - // Other declarations would go here, separated by commas, if you have them -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Dylan's additions #define C_A_DEL LALT(LCTL(KC_DEL)) #define C_A_INS LALT(LCTL(KC_INS)) @@ -328,3 +321,9 @@ void music_scale_user(void) } #endif + +// Tap Dance Definitions +const qk_tap_dance_action_t tape_dance_actions[] = { + //Tap once for Esc, twice for Caps Lock + [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS) +}; -- cgit v1.2.3 From c7cddfc539f111baeff51a2f7e6272701e0f0109 Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Thu, 16 Mar 2017 13:27:26 -0400 Subject: test td changes --- keyboards/planck/keymaps/khord/Makefile | 2 +- keyboards/planck/keymaps/khord/keymap.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'keyboards') diff --git a/keyboards/planck/keymaps/khord/Makefile b/keyboards/planck/keymaps/khord/Makefile index 666161d1f..f0ed9e8dc 100644 --- a/keyboards/planck/keymaps/khord/Makefile +++ b/keyboards/planck/keymaps/khord/Makefile @@ -1,4 +1,4 @@ +TAP_DANCE_ENABLE = yes ifndef QUANTUM_DIR include ../../../../Makefile endif -TAP_DANCE_ENABLE = yes diff --git a/keyboards/planck/keymaps/khord/keymap.c b/keyboards/planck/keymaps/khord/keymap.c index 50a5daa57..52467641a 100644 --- a/keyboards/planck/keymaps/khord/keymap.c +++ b/keyboards/planck/keymaps/khord/keymap.c @@ -178,6 +178,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; + +const qk_tap_dance_action_t tape_dance_actions[] = { + [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS) +}; + #ifdef AUDIO_ENABLE float tone_startup[][2] = SONG(SONIC_RING); //plug in @@ -321,9 +326,3 @@ void music_scale_user(void) } #endif - -// Tap Dance Definitions -const qk_tap_dance_action_t tape_dance_actions[] = { - //Tap once for Esc, twice for Caps Lock - [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS) -}; -- cgit v1.2.3 From 4b1d0c585977884faac28f1e7210bf528af46c9a Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Thu, 16 Mar 2017 17:36:31 +0000 Subject: remove const --- keyboards/planck/keymaps/khord/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards') diff --git a/keyboards/planck/keymaps/khord/keymap.c b/keyboards/planck/keymaps/khord/keymap.c index 52467641a..64185a148 100644 --- a/keyboards/planck/keymaps/khord/keymap.c +++ b/keyboards/planck/keymaps/khord/keymap.c @@ -179,7 +179,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const qk_tap_dance_action_t tape_dance_actions[] = { +qk_tap_dance_action_t tape_dance_actions[] = { [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS) }; -- cgit v1.2.3 From e03ddbe118740493a7adc59539c7edb47a98c799 Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Thu, 16 Mar 2017 18:13:53 +0000 Subject: tap dance working for esc and arrows --- keyboards/planck/keymaps/khord/keymap.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'keyboards') diff --git a/keyboards/planck/keymaps/khord/keymap.c b/keyboards/planck/keymaps/khord/keymap.c index 64185a148..6f19966f2 100644 --- a/keyboards/planck/keymaps/khord/keymap.c +++ b/keyboards/planck/keymaps/khord/keymap.c @@ -39,7 +39,11 @@ enum planck_keycodes { // Tap Dance Declarations enum { - TD_ESC_CAPS = 0 + ESC_CAP = 0, + LFT_HOM, + DWN_PDN, + UPP_PUP, + RGT_END }; // Dylan's additions @@ -60,10 +64,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = { - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {TD(TD_ESC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT) }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, + {TD(ESC_CAP), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)}, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, TD(LFT_HOM), TD(DWN_PDN), TD(UPP_PUP), TD(RGT_END) } }, /* Colemak @@ -179,8 +183,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -qk_tap_dance_action_t tape_dance_actions[] = { - [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS) +qk_tap_dance_action_t tap_dance_actions[] = { + [ESC_CAP] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS), + [LFT_HOM] = ACTION_TAP_DANCE_DOUBLE(KC_LEFT, KC_HOME), + [DWN_PDN] = ACTION_TAP_DANCE_DOUBLE(KC_DOWN, KC_PGDN), + [UPP_PUP] = ACTION_TAP_DANCE_DOUBLE(KC_UP, KC_PGUP), + [RGT_END] = ACTION_TAP_DANCE_DOUBLE(KC_RGHT, KC_END) }; #ifdef AUDIO_ENABLE -- cgit v1.2.3 From e123ed8d5f4837a424d8ad58bd8664a323a76f9b Mon Sep 17 00:00:00 2001 From: jprmesh Date: Wed, 15 Mar 2017 13:48:31 -0700 Subject: Added KC_KEYMAP macro for old style keymaps in Atreus62 --- keyboards/atreus62/atreus62.h | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'keyboards') diff --git a/keyboards/atreus62/atreus62.h b/keyboards/atreus62/atreus62.h index eacf5b451..ca5cda8a8 100644 --- a/keyboards/atreus62/atreus62.h +++ b/keyboards/atreus62/atreus62.h @@ -9,18 +9,34 @@ void promicro_bootloader_jmp(bool program); // The first section contains all of the arguements // The second converts the arguments into a two-dimensional array #define KEYMAP( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d \ ) \ { \ - { k00, k01, k02, k03, k04, k05, KC_NO, k06, k07, k08, k09, k0a, k0b }, \ - { k10, k11, k12, k13, k14, k15, KC_NO, k16, k17, k18, k19, k1a, k1b }, \ - { k20, k21, k22, k23, k24, k25, KC_NO, k26, k27, k28, k29, k2a, k2b }, \ - { k30, k31, k32, k33, k34, k35, k46, k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b, k4c, k4d } \ + { k00, k01, k02, k03, k04, k05, KC_NO, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, KC_NO, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k46, k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b, k4c, k4d } \ } -#endif \ No newline at end of file +// Used to create a keymap using only KC_ prefixed keys. +#define KC_KEYMAP( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4d \ +) \ +{ \ + { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_NO, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b }, \ + { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_NO, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b }, \ + { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_NO, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b }, \ + { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k46, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b }, \ + { KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45, KC_##k47, KC_##k48, KC_##k49, KC_##k4a, KC_##k4b, KC_##k4c, KC_##k4d } \ +} + +#endif -- cgit v1.2.3 From 3766f902a02da7e9355685c733f70bcff9fe5a12 Mon Sep 17 00:00:00 2001 From: Gabriel Young Date: Sat, 18 Mar 2017 15:38:03 -0700 Subject: boilerplate project created with new_project.sh --- keyboards/frosty_flake/Makefile | 3 + keyboards/frosty_flake/config.h | 162 +++++++++++++++++++++++ keyboards/frosty_flake/frosty_flake.c | 28 ++++ keyboards/frosty_flake/frosty_flake.h | 19 +++ keyboards/frosty_flake/keymaps/default/Makefile | 21 +++ keyboards/frosty_flake/keymaps/default/config.h | 8 ++ keyboards/frosty_flake/keymaps/default/keymap.c | 44 ++++++ keyboards/frosty_flake/keymaps/default/readme.md | 1 + keyboards/frosty_flake/readme.md | 28 ++++ keyboards/frosty_flake/rules.mk | 68 ++++++++++ 10 files changed, 382 insertions(+) create mode 100644 keyboards/frosty_flake/Makefile create mode 100644 keyboards/frosty_flake/config.h create mode 100644 keyboards/frosty_flake/frosty_flake.c create mode 100644 keyboards/frosty_flake/frosty_flake.h create mode 100644 keyboards/frosty_flake/keymaps/default/Makefile create mode 100644 keyboards/frosty_flake/keymaps/default/config.h create mode 100644 keyboards/frosty_flake/keymaps/default/keymap.c create mode 100644 keyboards/frosty_flake/keymaps/default/readme.md create mode 100644 keyboards/frosty_flake/readme.md create mode 100644 keyboards/frosty_flake/rules.mk (limited to 'keyboards') diff --git a/keyboards/frosty_flake/Makefile b/keyboards/frosty_flake/Makefile new file mode 100644 index 000000000..57b2ef62e --- /dev/null +++ b/keyboards/frosty_flake/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif diff --git a/keyboards/frosty_flake/config.h b/keyboards/frosty_flake/config.h new file mode 100644 index 000000000..9390feb94 --- /dev/null +++ b/keyboards/frosty_flake/config.h @@ -0,0 +1,162 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER You +#define PRODUCT frosty_flake +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 3 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D5 } +#define MATRIX_COL_PINS { F1, F0, B0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/frosty_flake/frosty_flake.c b/keyboards/frosty_flake/frosty_flake.c new file mode 100644 index 000000000..22979a451 --- /dev/null +++ b/keyboards/frosty_flake/frosty_flake.c @@ -0,0 +1,28 @@ +#include "frosty_flake.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/frosty_flake/frosty_flake.h b/keyboards/frosty_flake/frosty_flake.h new file mode 100644 index 000000000..90ea25ed9 --- /dev/null +++ b/keyboards/frosty_flake/frosty_flake.h @@ -0,0 +1,19 @@ +#ifndef FROSTY_FLAKE_H +#define FROSTY_FLAKE_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define KEYMAP( \ + k00, k01, k02, \ + k10, k11 \ +) \ +{ \ + { k00, k01, k02 }, \ + { k10, KC_NO, k11 }, \ +} + +#endif diff --git a/keyboards/frosty_flake/keymaps/default/Makefile b/keyboards/frosty_flake/keymaps/default/Makefile new file mode 100644 index 000000000..9d3df5964 --- /dev/null +++ b/keyboards/frosty_flake/keymaps/default/Makefile @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/frosty_flake/keymaps/default/config.h b/keyboards/frosty_flake/keymaps/default/config.h new file mode 100644 index 000000000..8893d122e --- /dev/null +++ b/keyboards/frosty_flake/keymaps/default/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/frosty_flake/keymaps/default/keymap.c b/keyboards/frosty_flake/keymaps/default/keymap.c new file mode 100644 index 000000000..1c9e33b64 --- /dev/null +++ b/keyboards/frosty_flake/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +#include "frosty_flake.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( /* Base */ + KC_A, KC_1, KC_H, \ + KC_TAB, KC_SPC \ +), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/frosty_flake/keymaps/default/readme.md b/keyboards/frosty_flake/keymaps/default/readme.md new file mode 100644 index 000000000..11bf4825f --- /dev/null +++ b/keyboards/frosty_flake/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for frosty_flake diff --git a/keyboards/frosty_flake/readme.md b/keyboards/frosty_flake/readme.md new file mode 100644 index 000000000..a32965061 --- /dev/null +++ b/keyboards/frosty_flake/readme.md @@ -0,0 +1,28 @@ +frosty_flake keyboard firmware +====================== + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme](/). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/frosty_flake folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default + +To build with the default keymap, simply run `make default`. + +### Other Keymaps + +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. + +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + +``` +$ make [default|jack|] +``` + +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/frosty_flake/rules.mk b/keyboards/frosty_flake/rules.mk new file mode 100644 index 000000000..bad3387bf --- /dev/null +++ b/keyboards/frosty_flake/rules.mk @@ -0,0 +1,68 @@ +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= yes # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 +FAUXCLICKY_ENABLE ?= no # Use buzzer to emulate clicky switches -- cgit v1.2.3 From 19fd20261b895a6848c8b15fd7365d5b87b7fd72 Mon Sep 17 00:00:00 2001 From: Gabriel Young Date: Sat, 18 Mar 2017 16:19:10 -0700 Subject: sketch out frosty flake matrix using custom matrix.c based on kitten paw --- keyboards/frosty_flake/config.h | 24 +++--- keyboards/frosty_flake/matrix.c | 167 ++++++++++++++++++++++++++++++++++++++++ keyboards/frosty_flake/rules.mk | 7 +- 3 files changed, 187 insertions(+), 11 deletions(-) create mode 100644 keyboards/frosty_flake/matrix.c (limited to 'keyboards') diff --git a/keyboards/frosty_flake/config.h b/keyboards/frosty_flake/config.h index 9390feb94..2575a52b1 100644 --- a/keyboards/frosty_flake/config.h +++ b/keyboards/frosty_flake/config.h @@ -24,13 +24,19 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6060 #define DEVICE_VER 0x0001 -#define MANUFACTURER You +#define MANUFACTURER Bathroom Epiphanies #define PRODUCT frosty_flake -#define DESCRIPTION A custom keyboard +#define DESCRIPTION Frosty Flake controller for the CM Storm Quick Fire Rapid + +/* + * Frosty Flake Rev. 20140521 made by Bathroom Ephiphanies + * Schematic is available at https://deskthority.net/w/images/a/a4/Frosty_Flake_Schematics.pdf + * + */ /* key matrix size */ -#define MATRIX_ROWS 2 -#define MATRIX_COLS 3 +#define MATRIX_ROWS 8 // Row0 to Row7 in the schematic +#define MATRIX_COLS 18 // ColA to ColR in the schematic /* * Keyboard Matrix Assignments @@ -42,13 +48,13 @@ along with this program. If not, see . * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) * */ -#define MATRIX_ROW_PINS { D0, D5 } -#define MATRIX_COL_PINS { F1, F0, B0 } -#define UNUSED_PINS +//#define MATRIX_ROW_PINS { D5, D4, D6, D2, D1, D0 } +//#define MATRIX_COL_PINS << n/a >> +//#define UNUSED_PINS { B0, C4, D3 } /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - +//#define DIODE_DIRECTION << n/a >> + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 diff --git a/keyboards/frosty_flake/matrix.c b/keyboards/frosty_flake/matrix.c new file mode 100644 index 000000000..21b0d9088 --- /dev/null +++ b/keyboards/frosty_flake/matrix.c @@ -0,0 +1,167 @@ +//TODO(gabe): customize for frosty flake + +/* + Copyright 2014 Ralf Schmitt + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif +static uint8_t debouncing = DEBOUNCING_DELAY; + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static uint8_t read_rows(void); +static void select_col(uint8_t col); + +inline uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +/* Column pin configuration + * + * col: 0 1 2 3 4 5 6 7 + * pin: PC7 PD5 PD3 PD1 PC2 PD6 PD4 PD2 + * + * Rrr pin configuration + * + * These rrrs uses one 74HC154 4 to 16 bit demultiplexer (low + * active), together with 2 rrrs driven directly from the micro + * controller, to control the 18 rrrs. The rrrs are driven from + * pins B6,5,4,3,2,1,0. + */ +void matrix_init(void) { + DDRC &= ~0b10000100; // Row input pins + DDRD &= ~0b01111110; + PORTC |= 0b10000100; + PORTD |= 0b01111110; + + DDRB |= 0b01111111; // Column output pins + + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + select_col(col); + _delay_us(3); + uint8_t rows = read_rows(); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1<. /* * Frosty Flake Rev. 20140521 made by Bathroom Ephiphanies - * Schematic is available at https://deskthority.net/w/images/a/a4/Frosty_Flake_Schematics.pdf + * Ported from the Bathroom Epiphanies TMK Firmware: + * https://github.com/BathroomEpiphanies/epiphanies_tmk_keyboard/tree/master/be_controllers * */ /* key matrix size */ -#define MATRIX_ROWS 8 // Row0 to Row7 in the schematic -#define MATRIX_COLS 18 // ColA to ColR in the schematic +#define MATRIX_ROWS 18 +#define MATRIX_COLS 8 /* * Keyboard Matrix Assignments diff --git a/keyboards/frosty_flake/keymaps/default/Makefile b/keyboards/frosty_flake/keymaps/default/Makefile index 9d3df5964..088766680 100644 --- a/keyboards/frosty_flake/keymaps/default/Makefile +++ b/keyboards/frosty_flake/keymaps/default/Makefile @@ -3,9 +3,9 @@ # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) +CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality diff --git a/keyboards/frosty_flake/keymaps/default/keymap.c b/keyboards/frosty_flake/keymaps/default/keymap.c index 1c9e33b64..e55355566 100644 --- a/keyboards/frosty_flake/keymaps/default/keymap.c +++ b/keyboards/frosty_flake/keymaps/default/keymap.c @@ -28,11 +28,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) void matrix_init_user(void) { - + debug_enable = true; } void matrix_scan_user(void) { - + if (matrix_is_modified()) + matrix_print(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -41,4 +42,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { void led_set_user(uint8_t usb_led) { -} +} \ No newline at end of file diff --git a/keyboards/frosty_flake/matrix.c b/keyboards/frosty_flake/matrix.c index 21b0d9088..70456ada3 100644 --- a/keyboards/frosty_flake/matrix.c +++ b/keyboards/frosty_flake/matrix.c @@ -1,5 +1,3 @@ -//TODO(gabe): customize for frosty flake - /* Copyright 2014 Ralf Schmitt @@ -26,16 +24,71 @@ #include "util.h" #include "matrix.h" +#ifndef CONFIG_SPECIFIC_H +#define CONFIG_SPECIFIC_H + +#define CONFIG_LED_IO \ + DDRB |= (1<<7); \ + DDRC |= (1<<5) | (1<<6); + +#define USB_LED_CAPS_LOCK_ON PORTC &= ~(1<<5) +#define USB_LED_CAPS_LOCK_OFF PORTC |= (1<<5) +#define USB_LED_NUM_LOCK_ON PORTB &= ~(1<<7) +#define USB_LED_NUM_LOCK_OFF PORTB |= (1<<7) +#define USB_LED_SCROLL_LOCK_ON PORTC &= ~(1<<6) +#define USB_LED_SCROLL_LOCK_OFF PORTC |= (1<<6) + +#define CONFIG_MATRIX_IO \ + /* Column output pins */ \ + DDRD |= 0b01111011; \ + /* Row input pins */ \ + DDRC &= ~0b10000000; \ + DDRB &= ~0b01111111; \ + PORTC |= 0b10000000; \ + PORTB |= 0b01111111; + +#define MATRIX_ROW_SCAN \ + (PINC&(1<<7) ? 0 : ((matrix_row_t)1<<0)) | \ + (PINB&(1<<5) ? 0 : ((matrix_row_t)1<<1)) | \ + (PINB&(1<<4) ? 0 : ((matrix_row_t)1<<2)) | \ + (PINB&(1<<6) ? 0 : ((matrix_row_t)1<<3)) | \ + (PINB&(1<<1) ? 0 : ((matrix_row_t)1<<4)) | \ + (PINB&(1<<2) ? 0 : ((matrix_row_t)1<<5)) | \ + (PINB&(1<<3) ? 0 : ((matrix_row_t)1<<6)) | \ + (PINB&(1<<0) ? 0 : ((matrix_row_t)1<<7)) + +#define MATRIX_ROW_SELECT \ + case 0: PORTD = (PORTD & ~0b01111011) | 0b00011011; break; \ + case 1: PORTD = (PORTD & ~0b01111011) | 0b01000011; break; \ + case 2: PORTD = (PORTD & ~0b01111011) | 0b01101010; break; \ + case 3: PORTD = (PORTD & ~0b01111011) | 0b01111001; break; \ + case 4: PORTD = (PORTD & ~0b01111011) | 0b01100010; break; \ + case 5: PORTD = (PORTD & ~0b01111011) | 0b01110001; break; \ + case 6: PORTD = (PORTD & ~0b01111011) | 0b01100001; break; \ + case 7: PORTD = (PORTD & ~0b01111011) | 0b01110000; break; \ + case 8: PORTD = (PORTD & ~0b01111011) | 0b01100000; break; \ + case 9: PORTD = (PORTD & ~0b01111011) | 0b01101000; break; \ + case 10: PORTD = (PORTD & ~0b01111011) | 0b00101011; break; \ + case 11: PORTD = (PORTD & ~0b01111011) | 0b00110011; break; \ + case 12: PORTD = (PORTD & ~0b01111011) | 0b00100011; break; \ + case 13: PORTD = (PORTD & ~0b01111011) | 0b01111000; break; \ + case 14: PORTD = (PORTD & ~0b01111011) | 0b00010011; break; \ + case 15: PORTD = (PORTD & ~0b01111011) | 0b01101001; break; \ + case 16: PORTD = (PORTD & ~0b01111011) | 0b00001011; break; \ + case 17: PORTD = (PORTD & ~0b01111011) | 0b00111011; break; + +#endif + #ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +# define DEBOUNCING_DELAY 0 #endif static uint8_t debouncing = DEBOUNCING_DELAY; static matrix_row_t matrix[MATRIX_ROWS]; static matrix_row_t matrix_debouncing[MATRIX_ROWS]; -static uint8_t read_rows(void); -static void select_col(uint8_t col); +static matrix_row_t scan_row(void); +static void select_row(uint8_t row); inline uint8_t matrix_rows(void) { return MATRIX_ROWS; @@ -45,58 +98,40 @@ inline uint8_t matrix_cols(void) { return MATRIX_COLS; } -/* Column pin configuration - * - * col: 0 1 2 3 4 5 6 7 - * pin: PC7 PD5 PD3 PD1 PC2 PD6 PD4 PD2 - * - * Rrr pin configuration - * - * These rrrs uses one 74HC154 4 to 16 bit demultiplexer (low - * active), together with 2 rrrs driven directly from the micro - * controller, to control the 18 rrrs. The rrrs are driven from - * pins B6,5,4,3,2,1,0. - */ void matrix_init(void) { - DDRC &= ~0b10000100; // Row input pins - DDRD &= ~0b01111110; - PORTC |= 0b10000100; - PORTD |= 0b01111110; - - DDRB |= 0b01111111; // Column output pins + CONFIG_MATRIX_IO; for (uint8_t i=0; i < MATRIX_ROWS; i++) { matrix[i] = 0; matrix_debouncing[i] = 0; } + matrix_init_quantum(); } uint8_t matrix_scan(void) { - for (uint8_t col = 0; col < MATRIX_COLS; col++) { - select_col(col); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + select_row(row); _delay_us(3); - uint8_t rows = read_rows(); - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + matrix_row_t row_scan = scan_row(); + for (uint8_t col = 0; col < MATRIX_COLS; col++) { bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1<. */ /* key matrix size */ -#define MATRIX_ROWS 18 -#define MATRIX_COLS 8 +#define MATRIX_ROWS 8 +#define MATRIX_COLS 18 /* * Keyboard Matrix Assignments diff --git a/keyboards/frosty_flake/frosty_flake.h b/keyboards/frosty_flake/frosty_flake.h index 767efcbd8..3b52df6ba 100644 --- a/keyboards/frosty_flake/frosty_flake.h +++ b/keyboards/frosty_flake/frosty_flake.h @@ -7,16 +7,6 @@ // The following is an example using the Planck MIT layout // The first section contains all of the arguements // The second converts the arguments into a two-dimensional array -#if 0 -#define KEYMAP( \ - k00, k01, k02, \ - k10, k11 \ -) \ -{ \ - { k00, k01, k02 }, \ - { k10, KC_NO, k11 }, \ -} -#endif /* Matrix col/row mapping @@ -36,38 +26,6 @@ | A4 | P2 | C6 | K6 | C0 | M3 | D0 | A1 | | O0 | K0 | L0 | | L6 | Q6 | | `-------------------------------------------------------------------------' `--------------' `-------------------' */ - -#define KEYMAP( \ - KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ - KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, KK1, KL1, KQ1, KQ0, \ - KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, KK5, KL5, KQ5, KO5, \ - KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, KK2, KL2, KQ2, \ - KN2, KI6, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, KK3, KL3, KQ3, KO3, \ - KA4, KP2, KC6, KK6, KC0, KM3, KD0, KA1, KO0, KK0, KL0, KL6, KQ6 \ -) \ -{ \ -/* 0 1 2 3 4 5 6 7 */ \ -/* A */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* B */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* C */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* D */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* E */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* F */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* G */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* H */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* I */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* J */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KJ6, KC_NO }, \ -/* K */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* L */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* M */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* N */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* O */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* P */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* Q */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ -/* R */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ -} - -#if 0 #define KEYMAP( \ KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, KK1, KL1, KQ1, KQ0, \ @@ -88,6 +46,5 @@ /* 6 */ { KC_NO, KB6, KC6, KC_NO, KE6, KF6, KG6, KH6, KI6, KJ6, KK6, KL6, KC_NO, KC_NO, KO6, KC_NO, KQ6, KR6 }, \ /* 7 */ { KA7, KB7, KC7, KD7, KE7, KF7, KG7, KH7, KI7, KJ7, KC_NO, KC_NO, KC_NO, KC_NO, KO7, KC_NO, KQ7, KR7 } \ } -#endif #endif diff --git a/keyboards/frosty_flake/keymaps/default/keymap.c b/keyboards/frosty_flake/keymaps/default/keymap.c index 90711732f..4383f7a8d 100644 --- a/keyboards/frosty_flake/keymaps/default/keymap.c +++ b/keyboards/frosty_flake/keymaps/default/keymap.c @@ -35,8 +35,7 @@ void matrix_init_user(void) { } void matrix_scan_user(void) { - if (matrix_is_modified()) - matrix_print(); + matrix_print(); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/frosty_flake/matrix.c b/keyboards/frosty_flake/matrix.c index 07b9f6dd6..f289f506a 100644 --- a/keyboards/frosty_flake/matrix.c +++ b/keyboards/frosty_flake/matrix.c @@ -1,5 +1,5 @@ /* - Copyright 2014 Ralf Schmitt + Copyright 2017 Gabriel Young This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,9 +24,6 @@ #include "util.h" #include "matrix.h" -#ifndef CONFIG_SPECIFIC_H -#define CONFIG_SPECIFIC_H - #define CONFIG_LED_IO \ DDRB |= (1<<7); \ DDRC |= (1<<5) | (1<<6); @@ -38,85 +35,40 @@ #define USB_LED_SCROLL_LOCK_ON PORTC &= ~(1<<6) #define USB_LED_SCROLL_LOCK_OFF PORTC |= (1<<6) -#define CONFIG_MATRIX_IO \ - /* Column output pins */ \ - DDRD |= 0b01111011; \ - /* Row input pins */ \ - DDRC &= ~0b10000000; \ - DDRB &= ~0b01111111; \ - PORTC |= 0b10000000; \ - PORTB |= 0b01111111; - -#define MATRIX_ROW_SCAN \ - (PINC&(1<<7) ? 0 : ((matrix_row_t)1<<0)) | \ - (PINB&(1<<5) ? 0 : ((matrix_row_t)1<<1)) | \ - (PINB&(1<<4) ? 0 : ((matrix_row_t)1<<2)) | \ - (PINB&(1<<6) ? 0 : ((matrix_row_t)1<<3)) | \ - (PINB&(1<<1) ? 0 : ((matrix_row_t)1<<4)) | \ - (PINB&(1<<2) ? 0 : ((matrix_row_t)1<<5)) | \ - (PINB&(1<<3) ? 0 : ((matrix_row_t)1<<6)) | \ - (PINB&(1<<0) ? 0 : ((matrix_row_t)1<<7)) - -#define MATRIX_ROW_SELECT \ - case 0: PORTD = (PORTD & ~0b01111011) | 0b00011011; break; \ - case 1: PORTD = (PORTD & ~0b01111011) | 0b01000011; break; \ - case 2: PORTD = (PORTD & ~0b01111011) | 0b01101010; break; \ - case 3: PORTD = (PORTD & ~0b01111011) | 0b01111001; break; \ - case 4: PORTD = (PORTD & ~0b01111011) | 0b01100010; break; \ - case 5: PORTD = (PORTD & ~0b01111011) | 0b01110001; break; \ - case 6: PORTD = (PORTD & ~0b01111011) | 0b01100001; break; \ - case 7: PORTD = (PORTD & ~0b01111011) | 0b01110000; break; \ - case 8: PORTD = (PORTD & ~0b01111011) | 0b01100000; break; \ - case 9: PORTD = (PORTD & ~0b01111011) | 0b01101000; break; \ - case 10: PORTD = (PORTD & ~0b01111011) | 0b00101011; break; \ - case 11: PORTD = (PORTD & ~0b01111011) | 0b00110011; break; \ - case 12: PORTD = (PORTD & ~0b01111011) | 0b00100011; break; \ - case 13: PORTD = (PORTD & ~0b01111011) | 0b01111000; break; \ - case 14: PORTD = (PORTD & ~0b01111011) | 0b00010011; break; \ - case 15: PORTD = (PORTD & ~0b01111011) | 0b01101001; break; \ - case 16: PORTD = (PORTD & ~0b01111011) | 0b00001011; break; \ - case 17: PORTD = (PORTD & ~0b01111011) | 0b00111011; break; - -#endif - #ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 0 +# define DEBOUNCING_DELAY 5 #endif static uint8_t debouncing = DEBOUNCING_DELAY; static matrix_row_t matrix[MATRIX_ROWS]; static matrix_row_t matrix_debouncing[MATRIX_ROWS]; -static matrix_row_t scan_row(void); -static void select_row(uint8_t row); - -inline uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} - -inline uint8_t matrix_cols(void) { - return MATRIX_COLS; -} +static matrix_row_t scan_col(void); +static void select_col(uint8_t row); void matrix_init(void) { - CONFIG_MATRIX_IO; - - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - - matrix_init_quantum(); + /* Row output pins */ + DDRD |= 0b01111011; + /* Column input pins */ + DDRC &= ~0b10000000; + DDRB &= ~0b01111111; + PORTC |= 0b10000000; + PORTB |= 0b01111111; + + for (uint8_t i=0; i < MATRIX_ROWS; i++) + matrix[i] = matrix_debouncing[i] = 0; + + matrix_init_quantum(); } uint8_t matrix_scan(void) { - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - select_row(row); + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + select_col(col); _delay_us(3); - matrix_row_t row_scan = scan_row(); - for (uint8_t col = 0; col < MATRIX_COLS; col++) { + matrix_row_t col_scan = scan_col(); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1<event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - debug_enable = true; -} - -void matrix_scan_user(void) { - matrix_print(); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} \ No newline at end of file +}; \ No newline at end of file diff --git a/keyboards/frosty_flake/readme.md b/keyboards/frosty_flake/readme.md index ef0e7492b..ff440e33b 100644 --- a/keyboards/frosty_flake/readme.md +++ b/keyboards/frosty_flake/readme.md @@ -1,7 +1,7 @@ frosty_flake keyboard firmware ====================== -This is the firmware for Rev. 20140521 of the Frosty Flake controller by [Bathroom Epiphanies](http://bathroomepiphanies.com/controllers/). +This is the firmware for Rev. 20140521 of the Frosty Flake controller by [Bathroom Epiphanies](http://bathroomepiphanies.com/controllers/), a replacement controller for the [Cooler Master Quick Fire Rapid](http://www.coolermaster.com/peripheral/keyboards/quickfirerapid/). The code was adapted from the [BathroomEpiphanies TMK Firmware](https://github.com/BathroomEpiphanies/epiphanies_tmk_keyboard/tree/master/be_controllers), but has been cleaned up to match the [schematic](https://deskthority.net/wiki/File:Frosty_Flake_Schematics.pdf) and gone through some minor refactoring for QMK. -- cgit v1.2.3 From b37f510f323b532360f38afb6f0bb29bc61eaab3 Mon Sep 17 00:00:00 2001 From: Gabriel Young Date: Sun, 19 Mar 2017 21:18:15 -0700 Subject: clean up config --- keyboards/frosty_flake/config.h | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'keyboards') diff --git a/keyboards/frosty_flake/config.h b/keyboards/frosty_flake/config.h index f03cecb3e..2c73f1074 100644 --- a/keyboards/frosty_flake/config.h +++ b/keyboards/frosty_flake/config.h @@ -36,39 +36,17 @@ along with this program. If not, see . */ /* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 18 +#define MATRIX_ROWS 8 // Row0 - Row7 in the schematic +#define MATRIX_COLS 18 // ColA - ColR in the schematic /* * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -//#define MATRIX_ROW_PINS { D5, D4, D6, D2, D1, D0 } -//#define MATRIX_COL_PINS << n/a >> -//#define UNUSED_PINS { B0, C4, D3 } - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -//#define DIODE_DIRECTION << n/a >> - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - + */ +#define UNUSED_PINS { B0, C4, D3 } /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCING_DELAY 5 -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ -- cgit v1.2.3 From 3399e392977f91b1993e1ac581ff5a054a45848b Mon Sep 17 00:00:00 2001 From: Stephen Tudor Date: Mon, 20 Mar 2017 07:26:28 -0400 Subject: Fix shift tap-dance (can't use one-shot layer) --- keyboards/satan/keymaps/smt/Makefile | 3 ++- keyboards/satan/keymaps/smt/keymap.c | 43 +++++++++--------------------------- 2 files changed, 12 insertions(+), 34 deletions(-) (limited to 'keyboards') diff --git a/keyboards/satan/keymaps/smt/Makefile b/keyboards/satan/keymaps/smt/Makefile index 2a7ff2779..afcd025e1 100644 --- a/keyboards/satan/keymaps/smt/Makefile +++ b/keyboards/satan/keymaps/smt/Makefile @@ -8,13 +8,14 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # 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 +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = yes # Enable tap dance ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/satan/keymaps/smt/keymap.c b/keyboards/satan/keymaps/smt/keymap.c index 4ac016f21..7f9e9c2d5 100644 --- a/keyboards/satan/keymaps/smt/keymap.c +++ b/keyboards/satan/keymaps/smt/keymap.c @@ -20,6 +20,10 @@ enum planck_keycodes { DVORAK }; +enum { + TD_SHIFT_RAISE = 0 +}; + #define _______ KC_TRNS #define XXXXXXX KC_NO @@ -28,7 +32,7 @@ enum planck_keycodes { #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift -#define SFT_RSE TD(KC_LSFT, OS(_RAISE)) // Double-tap for RAISE one-shot, otherwise Left Shift +#define SFT_RSE TD(TD_SHIFT_RAISE) // Double-tap for RAISE one-shot, otherwise Left Shift const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _QWERTY: (Base Layer) Default Layer @@ -170,36 +174,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -enum function_id { - SHIFT_ESC, +// Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + // Tap/hold once for Shift, tap twice for raise layer + [TD_SHIFT_RAISE] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, _RAISE) +// Other declarations would go here, separated by commas, if you have them }; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} -- cgit v1.2.3 From b10d95070831dde5801e930c615612dec3a6fd11 Mon Sep 17 00:00:00 2001 From: Stephen Tudor Date: Mon, 20 Mar 2017 07:43:24 -0400 Subject: Use normal backtick in ESC spot - I've mapped ESC to caps lock --- keyboards/satan/keymaps/smt/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'keyboards') diff --git a/keyboards/satan/keymaps/smt/keymap.c b/keyboards/satan/keymaps/smt/keymap.c index 7f9e9c2d5..1a2bc9769 100644 --- a/keyboards/satan/keymaps/smt/keymap.c +++ b/keyboards/satan/keymaps/smt/keymap.c @@ -49,7 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_QWERTY] = KEYMAP_ANSI( - F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \ CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ SFT_RSE, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_ENT, \ @@ -69,7 +69,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_COLEMAK] = KEYMAP_ANSI( - F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,KC_LBRC, KC_RBRC,KC_BSLS, \ CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O ,KC_QUOT, KC_ENT, \ SFT_RSE, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_ENT, \ @@ -89,7 +89,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_DVORAK] = KEYMAP_ANSI( - F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC,KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC,KC_BSPC, \ HPR_TAB, KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, \ CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, \ SFT_RSE, KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, \ @@ -109,7 +109,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ [_LOWER] = KEYMAP_ANSI( - KC_GRV ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_DEL, \ + _______,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_DEL, \ _______,KC_HOME,KC_UP ,KC_END ,_______,_______,_______,_______,_______,_______,_______,BL_DEC ,BL_INC ,BL_TOGG, \ _______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,KC_LEFT,KC_DOWN,KC_UP ,KC_RGHT,KC_VOLU,KC_PGUP ,_______, \ KC_LSFT ,_______,_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,_______,_______,KC_VOLD,KC_PGDN ,_______, \ -- cgit v1.2.3 From 34c5f8094e3a07dfff344f95b29407c9efaa0e4c Mon Sep 17 00:00:00 2001 From: Stephen Tudor Date: Mon, 20 Mar 2017 07:43:45 -0400 Subject: Remove tap-dance. Raise will be accessed via holding shift while lower is active --- keyboards/satan/keymaps/smt/Makefile | 1 - keyboards/satan/keymaps/smt/keymap.c | 32 +++++++++++--------------------- 2 files changed, 11 insertions(+), 22 deletions(-) (limited to 'keyboards') diff --git a/keyboards/satan/keymaps/smt/Makefile b/keyboards/satan/keymaps/smt/Makefile index afcd025e1..0c9ae824f 100644 --- a/keyboards/satan/keymaps/smt/Makefile +++ b/keyboards/satan/keymaps/smt/Makefile @@ -15,7 +15,6 @@ UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -TAP_DANCE_ENABLE = yes # Enable tap dance ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/satan/keymaps/smt/keymap.c b/keyboards/satan/keymaps/smt/keymap.c index 1a2bc9769..a21d3eb86 100644 --- a/keyboards/satan/keymaps/smt/keymap.c +++ b/keyboards/satan/keymaps/smt/keymap.c @@ -17,11 +17,9 @@ enum planck_keycodes { QWERTY = SAFE_RANGE, COLEMAK, - DVORAK -}; - -enum { - TD_SHIFT_RAISE = 0 + DVORAK, + LOWER, + RAISE }; #define _______ KC_TRNS @@ -32,7 +30,6 @@ enum { #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift -#define SFT_RSE TD(TD_SHIFT_RAISE) // Double-tap for RAISE one-shot, otherwise Left Shift const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap _QWERTY: (Base Layer) Default Layer @@ -52,7 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \ CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ - SFT_RSE, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_ENT, \ KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), /* Keymap _COLEMAK: (Base Layer) Default Layer @@ -72,7 +69,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,KC_LBRC, KC_RBRC,KC_BSLS, \ CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O ,KC_QUOT, KC_ENT, \ - SFT_RSE, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_ENT, \ KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), /* Keymap _DVORAK: (Base Layer) Default Layer @@ -92,7 +89,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC,KC_BSPC, \ HPR_TAB, KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, \ CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, \ - SFT_RSE, KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, \ + KC_LSFT, KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, \ KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), /* Keymap _LOWER: Function Layer @@ -112,7 +109,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_DEL, \ _______,KC_HOME,KC_UP ,KC_END ,_______,_______,_______,_______,_______,_______,_______,BL_DEC ,BL_INC ,BL_TOGG, \ _______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,KC_LEFT,KC_DOWN,KC_UP ,KC_RGHT,KC_VOLU,KC_PGUP ,_______, \ - KC_LSFT ,_______,_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,_______,_______,KC_VOLD,KC_PGDN ,_______, \ + RAISE ,_______,_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,_______,_______,KC_VOLD,KC_PGDN ,_______, \ _______,_______,_______ ,_______ ,_______,_______,_______,_______), /* Keymap _RAISE: Function Layer @@ -133,14 +130,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET , \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ _______,_______,_______,_______,_______,_______,_______,QWERTY ,COLEMAK,DVORAK ,_______,_______ ,_______, \ - KC_LSFT ,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______ ,_______, \ - _______,_______,_______ ,_______ ,_______,_______,XXXXXXX,_______ + _______ ,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______ ,_______, \ + _______,_______,_______ ,_______ ,_______,_______,_______,_______ #else _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET , \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ _______,_______,_______,_______,_______,_______,_______,QWERTY ,COLEMAK,DVORAK ,_______,_______ ,_______, \ - KC_LSFT ,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ ,_______, \ - _______,_______,_______ ,_______ ,_______,_______,XXXXXXX,_______ + _______ ,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ ,_______, \ + _______,_______,_______ ,_______ ,_______,_______,_______,_______ #endif ) }; @@ -173,10 +170,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; } - -// Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - // Tap/hold once for Shift, tap twice for raise layer - [TD_SHIFT_RAISE] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, _RAISE) -// Other declarations would go here, separated by commas, if you have them -}; -- cgit v1.2.3 From d7f2bd29646c585434a8f19e7b9df0d3a6ea7bef Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Mon, 20 Mar 2017 13:14:48 -0400 Subject: add pgup, pgdn, home, end --- keyboards/planck/keymaps/khord/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'keyboards') diff --git a/keyboards/planck/keymaps/khord/keymap.c b/keyboards/planck/keymaps/khord/keymap.c index 6f19966f2..b6adb603e 100644 --- a/keyboards/planck/keymaps/khord/keymap.c +++ b/keyboards/planck/keymaps/khord/keymap.c @@ -112,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | END | HOME |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' @@ -120,7 +120,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = { {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_END, KC_HOME, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, @@ -130,7 +130,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |PG DN |PG UP |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' @@ -138,7 +138,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = { {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGDN, KC_PGUP, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} }, -- cgit v1.2.3 From dce3847ebb900ffebd9038da255309cbac634170 Mon Sep 17 00:00:00 2001 From: Stephen Tudor Date: Mon, 20 Mar 2017 14:12:43 -0400 Subject: Use single _FUNC layer. Move RESET and base layout-changing keys to _FUNC. --- keyboards/satan/keymaps/smt/keymap.c | 55 ++++++++---------------------------- 1 file changed, 12 insertions(+), 43 deletions(-) (limited to 'keyboards') diff --git a/keyboards/satan/keymaps/smt/keymap.c b/keyboards/satan/keymaps/smt/keymap.c index a21d3eb86..d90849914 100644 --- a/keyboards/satan/keymaps/smt/keymap.c +++ b/keyboards/satan/keymaps/smt/keymap.c @@ -11,15 +11,12 @@ #define _QWERTY 0 #define _COLEMAK 1 #define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 +#define _FUNC 3 enum planck_keycodes { QWERTY = SAFE_RANGE, COLEMAK, - DVORAK, - LOWER, - RAISE + DVORAK }; #define _______ KC_TRNS @@ -50,7 +47,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \ CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_ENT, \ - KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_FUNC),KC_RCTL), /* Keymap _COLEMAK: (Base Layer) Default Layer * ,-----------------------------------------------------------. @@ -70,7 +67,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,KC_LBRC, KC_RBRC,KC_BSLS, \ CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O ,KC_QUOT, KC_ENT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM,KC_DOT, KC_SLSH, SFT_ENT, \ - KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_FUNC),KC_RCTL), /* Keymap _DVORAK: (Base Layer) Default Layer * ,-----------------------------------------------------------. @@ -90,55 +87,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { HPR_TAB, KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, \ CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, \ KC_LSFT, KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, \ - KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_LOWER),KC_RCTL), + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,MO(_FUNC),KC_RCTL), - /* Keymap _LOWER: Function Layer + /* Keymap _FUNC: Function Layer * ,-----------------------------------------------------------. * | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | * |-----------------------------------------------------------| - * | |Hom| UP|End| | | | | | | |BL-|BL+|BL | + * | |Hom| UP|End| | | |Qwt|Cmk|Dvk| |BL-|BL+|BL | * |-----------------------------------------------------------| * | |LFT| DN| RT| | |LFT| DN| UP| RT|Vo+|Pg+| | * |-----------------------------------------------------------| * | | | |Prv|Ply|Nxt| | | |Vo-|Pg-| | * |-----------------------------------------------------------| - * | | | | | | | | | + * |RESET| | | | | | | | * `-----------------------------------------------------------' */ -[_LOWER] = KEYMAP_ANSI( +[_FUNC] = KEYMAP_ANSI( _______,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_DEL, \ - _______,KC_HOME,KC_UP ,KC_END ,_______,_______,_______,_______,_______,_______,_______,BL_DEC ,BL_INC ,BL_TOGG, \ + _______,KC_HOME,KC_UP ,KC_END ,_______,_______,_______,QWERTY ,COLEMAK,DVORAK ,_______,BL_DEC ,BL_INC ,BL_TOGG, \ _______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,KC_LEFT,KC_DOWN,KC_UP ,KC_RGHT,KC_VOLU,KC_PGUP ,_______, \ - RAISE ,_______,_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,_______,_______,KC_VOLD,KC_PGDN ,_______, \ - _______,_______,_______ ,_______ ,_______,_______,_______,_______), - - /* Keymap _RAISE: Function Layer - * ,-----------------------------------------------------------. - * | | | | | | | | | | | | | | RESET | - * |-----------------------------------------------------------| - * | | | | | | | | | | | |BL-|BL+|BL | - * |-----------------------------------------------------------| - * | | | | | | | |QWT|CLM|DVK| | | | - * |-----------------------------------------------------------| - * | | F1|F2 | F3|F4 | F5| F6| F7| F8| | | | - * |-----------------------------------------------------------| - * | | | | | | | | | - * `-----------------------------------------------------------' - */ -[_RAISE] = KEYMAP_ANSI( - #ifdef RGBLIGHT_ENABLE - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET , \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ - _______,_______,_______,_______,_______,_______,_______,QWERTY ,COLEMAK,DVORAK ,_______,_______ ,_______, \ - _______ ,RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______ ,_______, \ - _______,_______,_______ ,_______ ,_______,_______,_______,_______ - #else - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET , \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ - _______,_______,_______,_______,_______,_______,_______,QWERTY ,COLEMAK,DVORAK ,_______,_______ ,_______, \ - _______ ,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ ,_______, \ - _______,_______,_______ ,_______ ,_______,_______,_______,_______ - #endif + _______ ,_______,_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,_______,_______,KC_VOLD,KC_PGDN ,_______, \ + RESET ,_______,_______ ,_______ ,_______,_______,_______,_______ ) }; -- cgit v1.2.3 From f0962bce505a7643abbd169868820715b86f97b7 Mon Sep 17 00:00:00 2001 From: ishtob Date: Wed, 22 Mar 2017 14:55:13 -0400 Subject: Add files via upload --- keyboards/lets_split/keymaps/OLED_sample/Makefile | 25 ++ keyboards/lets_split/keymaps/OLED_sample/config.h | 45 +++ keyboards/lets_split/keymaps/OLED_sample/keymap.c | 356 ++++++++++++++++++++++ 3 files changed, 426 insertions(+) create mode 100644 keyboards/lets_split/keymaps/OLED_sample/Makefile create mode 100644 keyboards/lets_split/keymaps/OLED_sample/config.h create mode 100644 keyboards/lets_split/keymaps/OLED_sample/keymap.c (limited to 'keyboards') diff --git a/keyboards/lets_split/keymaps/OLED_sample/Makefile b/keyboards/lets_split/keymaps/OLED_sample/Makefile new file mode 100644 index 000000000..90616d1f1 --- /dev/null +++ b/keyboards/lets_split/keymaps/OLED_sample/Makefile @@ -0,0 +1,25 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +ONEHAND_ENABLE = no # Enable one-hand typing + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/lets_split/keymaps/OLED_sample/config.h b/keyboards/lets_split/keymaps/OLED_sample/config.h new file mode 100644 index 000000000..353ea368c --- /dev/null +++ b/keyboards/lets_split/keymaps/OLED_sample/config.h @@ -0,0 +1,45 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#define USE_I2C +//#define USE_SERIAL +//#define MASTER_RIGHT +#define FLIP_HALF + +#define SSD1306OLED + + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 6 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + + + + +#ifdef SUBPROJECT_rev1 + #include "../../rev1/config.h" +#endif +#ifdef SUBPROJECT_rev2 + #include "../../rev2/config.h" +#endif \ No newline at end of file diff --git a/keyboards/lets_split/keymaps/OLED_sample/keymap.c b/keyboards/lets_split/keymaps/OLED_sample/keymap.c new file mode 100644 index 000000000..072b825ab --- /dev/null +++ b/keyboards/lets_split/keymaps/OLED_sample/keymap.c @@ -0,0 +1,356 @@ +#include "lets_split.h" +#include "bootloader.h" +#include "action_layer.h" +#include "eeconfig.h" +#include "tmk_core/protocol/lufa/LUFA-git/LUFA/Drivers/Peripheral/TWI.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +extern keymap_config_t keymap_config; + +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; + + +// 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. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, + BACKLIT, + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +//Macros +#define M_SAMPLE M(KC_SAMPLEMACRO) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = KEYMAP( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = KEYMAP( \ + _______, RESET, _______, M_SAMPLE, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + rgblight_mode(RGB_current_mode); + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + rgblight_mode(16); + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + rgblight_mode(15); + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + //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 + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif + RGB_current_mode = rgblight_config.mode; +} + +//SSD1306 OLED init and update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED +void matrix_master_OLED_init (void) { + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + iota_gfx_init(); // turns on the display +} + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} +#endif + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif + +/* + * Macro definition + */ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + switch (id) { + case KC_SAMPLEMACRO: + if (record->event.pressed){ + return MACRO (I(10), T(H), T(E), T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END); + } + + } + + return MACRO_NONE; +} -- cgit v1.2.3 From dfb5a0e8f413338363138dd6beb1701563e1021d Mon Sep 17 00:00:00 2001 From: ishtob Date: Wed, 22 Mar 2017 14:59:20 -0400 Subject: Delete Makefile --- keyboards/lets_split/rev2fliphalf/Makefile | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 keyboards/lets_split/rev2fliphalf/Makefile (limited to 'keyboards') diff --git a/keyboards/lets_split/rev2fliphalf/Makefile b/keyboards/lets_split/rev2fliphalf/Makefile deleted file mode 100644 index 4e2a6f00f..000000000 --- a/keyboards/lets_split/rev2fliphalf/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -ifndef MAKEFILE_INCLUDED - include ../../Makefile -endif \ No newline at end of file -- cgit v1.2.3 From 6167d7937c15f7fb68f50a48ce34df858f24d80f Mon Sep 17 00:00:00 2001 From: ishtob Date: Wed, 22 Mar 2017 14:59:32 -0400 Subject: Delete config.h --- keyboards/lets_split/rev2fliphalf/config.h | 91 ------------------------------ 1 file changed, 91 deletions(-) delete mode 100644 keyboards/lets_split/rev2fliphalf/config.h (limited to 'keyboards') diff --git a/keyboards/lets_split/rev2fliphalf/config.h b/keyboards/lets_split/rev2fliphalf/config.h deleted file mode 100644 index 1c45cf136..000000000 --- a/keyboards/lets_split/rev2fliphalf/config.h +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x3060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Wootpatoot -#define PRODUCT Lets Split v2 -#define DESCRIPTION A split keyboard for the cheap makers - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 8 -#define MATRIX_COLS 6 - -// wiring of each half -#define MATRIX_ROW_PINS { D7, E6, B4, B5 } -//#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } -#define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6 } //uncomment this line and comment line above if you need to reverse left-to-right key order - -//#define CATERINA_BOOTLOADER - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER -#define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -// #define NO_DEBUG - -/* disable print */ -// #define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - - -#endif \ No newline at end of file -- cgit v1.2.3 From d012b0110811595bed92d3a281ccc5480d0a4a86 Mon Sep 17 00:00:00 2001 From: ishtob Date: Wed, 22 Mar 2017 14:59:42 -0400 Subject: Delete rev2fliphalf.c --- keyboards/lets_split/rev2fliphalf/rev2fliphalf.c | 32 ------------------------ 1 file changed, 32 deletions(-) delete mode 100644 keyboards/lets_split/rev2fliphalf/rev2fliphalf.c (limited to 'keyboards') diff --git a/keyboards/lets_split/rev2fliphalf/rev2fliphalf.c b/keyboards/lets_split/rev2fliphalf/rev2fliphalf.c deleted file mode 100644 index c505d3a6e..000000000 --- a/keyboards/lets_split/rev2fliphalf/rev2fliphalf.c +++ /dev/null @@ -1,32 +0,0 @@ -#include "lets_split.h" - -#ifdef AUDIO_ENABLE - float tone_startup[][2] = SONG(STARTUP_SOUND); - float tone_goodbye[][2] = SONG(GOODBYE_SOUND); -#endif - -void matrix_init_kb(void) { - - #ifdef AUDIO_ENABLE - _delay_ms(20); // gets rid of tick - PLAY_NOTE_ARRAY(tone_startup, false, 0); - #endif - - // // green led on - // DDRD |= (1<<5); - // PORTD &= ~(1<<5); - - // // orange led on - // DDRB |= (1<<0); - // PORTB &= ~(1<<0); - - matrix_init_user(); -}; - -void shutdown_user(void) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_goodbye, false, 0); - _delay_ms(150); - stop_all_notes(); - #endif -} -- cgit v1.2.3 From a4bdd6d0845667422c9e42818cfc848bcd0807ee Mon Sep 17 00:00:00 2001 From: ishtob Date: Wed, 22 Mar 2017 14:59:54 -0400 Subject: Delete rev2fliphalf.h --- keyboards/lets_split/rev2fliphalf/rev2fliphalf.h | 28 ------------------------ 1 file changed, 28 deletions(-) delete mode 100644 keyboards/lets_split/rev2fliphalf/rev2fliphalf.h (limited to 'keyboards') diff --git a/keyboards/lets_split/rev2fliphalf/rev2fliphalf.h b/keyboards/lets_split/rev2fliphalf/rev2fliphalf.h deleted file mode 100644 index 7dc8e5ba8..000000000 --- a/keyboards/lets_split/rev2fliphalf/rev2fliphalf.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef REV2FLIPHALF_H -#define REV2FLIPHALF_H - -#include "../lets_split.h" - -//void promicro_bootloader_jmp(bool program); -#include "quantum.h" - -//void promicro_bootloader_jmp(bool program); - -#define KEYMAP( \ - k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \ - k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \ - k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \ - k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \ - ) \ - { \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k33, k34, k35 }, \ - { k40, k41, k42, k43, k44, k45 }, \ - { k50, k51, k52, k53, k54, k55 }, \ - { k60, k61, k62, k63, k64, k65 }, \ - { k70, k71, k72, k73, k74, k75 } \ - } - -#endif \ No newline at end of file -- cgit v1.2.3 From 3a7083d810441253404ac22dda259172b6f9b6de Mon Sep 17 00:00:00 2001 From: ishtob Date: Wed, 22 Mar 2017 15:00:00 -0400 Subject: Delete rules.mk --- keyboards/lets_split/rev2fliphalf/rules.mk | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 keyboards/lets_split/rev2fliphalf/rules.mk (limited to 'keyboards') diff --git a/keyboards/lets_split/rev2fliphalf/rules.mk b/keyboards/lets_split/rev2fliphalf/rules.mk deleted file mode 100644 index 80a942d06..000000000 --- a/keyboards/lets_split/rev2fliphalf/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -BACKLIGHT_ENABLE = no - -ifndef QUANTUM_DIR - include ../../../Makefile -endif -- cgit v1.2.3 From 423c68c210d73f6bb05c3e9f4a994833b12a524e Mon Sep 17 00:00:00 2001 From: ishtob Date: Wed, 22 Mar 2017 15:02:49 -0400 Subject: Merged Fliphalf, now defined in config, added OLED Can now use the following in the keymap config.h to call the flipped matrix ``` #define FLIPHALF ```--- keyboards/lets_split/rev2/rev2.c | 8 ++++++ keyboards/lets_split/rev2/rev2.h | 59 ++++++++++++++++++++++++++++++++++------ 2 files changed, 59 insertions(+), 8 deletions(-) (limited to 'keyboards') diff --git a/keyboards/lets_split/rev2/rev2.c b/keyboards/lets_split/rev2/rev2.c index c505d3a6e..8bfa171d0 100644 --- a/keyboards/lets_split/rev2/rev2.c +++ b/keyboards/lets_split/rev2/rev2.c @@ -5,6 +5,13 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND); #endif +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + void matrix_init_kb(void) { #ifdef AUDIO_ENABLE @@ -30,3 +37,4 @@ void shutdown_user(void) { stop_all_notes(); #endif } + diff --git a/keyboards/lets_split/rev2/rev2.h b/keyboards/lets_split/rev2/rev2.h index 990976de2..054731366 100644 --- a/keyboards/lets_split/rev2/rev2.h +++ b/keyboards/lets_split/rev2/rev2.h @@ -6,23 +6,66 @@ //void promicro_bootloader_jmp(bool program); #include "quantum.h" + +#ifdef USE_I2C +#include +#ifdef __AVR__ +#include +#include +#endif +#ifdef SSD1306OLED +extern bool iota_gfx_init(void); +extern void iota_gfx_task(void); +extern bool iota_gfx_off(void); +extern bool iota_gfx_on(void); +extern void iota_gfx_flush(void); +extern void iota_gfx_write_char(uint8_t c); +extern void iota_gfx_write(const char *data); +extern void iota_gfx_write_P(const char *data); +extern void iota_gfx_clear_screen(void); +#endif +#endif + //void promicro_bootloader_jmp(bool program); +#ifndef FLIP_HALF +//Standard Keymap #define KEYMAP( \ - k00, k01, k02, k03, k04, k05, k45, k44, k43, k42, k41, k40, \ - k10, k11, k12, k13, k14, k15, k55, k54, k53, k52, k51, k50, \ - k20, k21, k22, k23, k24, k25, k65, k64, k63, k62, k61, k60, \ - k30, k31, k32, k33, k34, k35, k75, k74, k73, k72, k71, k70 \ + k40, k41, k42, k43, k44, k45, k05, k04, k03, k02, k01, k00, \ + k50, k51, k52, k53, k54, k55, k15, k14, k13, k12, k11, k10, \ + k60, k61, k62, k63, k64, k65, k25, k24, k23, k22, k21, k20, \ + k70, k71, k72, k73, k74, k75, k35, k34, k33, k32, k31, k30 \ + ) \ + { \ + { k45, k44, k43, k42, k41, k40 }, \ + { k55, k54, k53, k52, k51, k50 }, \ + { k65, k64, k63, k62, k61, k60 }, \ + { k75, k74, k73, k72, k71, k70 }, \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 } \ + } + +#else +// Keymap with one side flipped +#define KEYMAP( \ + k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \ + k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \ + k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \ + k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \ ) \ { \ { k00, k01, k02, k03, k04, k05 }, \ { k10, k11, k12, k13, k14, k15 }, \ { k20, k21, k22, k23, k24, k25 }, \ { k30, k31, k32, k33, k34, k35 }, \ - { k40, k41, k42, k43, k44, k45 }, \ - { k50, k51, k52, k53, k54, k55 }, \ - { k60, k61, k62, k63, k64, k65 }, \ - { k70, k71, k72, k73, k74, k75 } \ + { k45, k44, k43, k42, k41, k40 }, \ + { k55, k54, k53, k52, k51, k50 }, \ + { k65, k64, k63, k62, k61, k60 }, \ + { k75, k74, k73, k72, k71, k70 } \ } +#endif + #endif \ No newline at end of file -- cgit v1.2.3 From 65317a3a020c0b0261849fb4c40d3aae175ac337 Mon Sep 17 00:00:00 2001 From: ishtob Date: Wed, 22 Mar 2017 15:04:11 -0400 Subject: Added OLED SSD1306 support to I2C --- keyboards/lets_split/common/glcdfont.c | 276 ++++++++++++++++++ keyboards/lets_split/i2c.c | 94 +++++- keyboards/lets_split/i2c.h | 20 +- keyboards/lets_split/matrix.c | 7 +- keyboards/lets_split/rules.mk | 15 +- keyboards/lets_split/split_util.c | 7 +- keyboards/lets_split/split_util.h | 2 + keyboards/lets_split/ssd1306.c | 508 +++++++++++++++++++++++++++++++++ 8 files changed, 908 insertions(+), 21 deletions(-) create mode 100644 keyboards/lets_split/common/glcdfont.c create mode 100644 keyboards/lets_split/ssd1306.c (limited to 'keyboards') diff --git a/keyboards/lets_split/common/glcdfont.c b/keyboards/lets_split/common/glcdfont.c new file mode 100644 index 000000000..6f88bd23a --- /dev/null +++ b/keyboards/lets_split/common/glcdfont.c @@ -0,0 +1,276 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font + +static const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, + 0x00, 0x18, 0x3C, 0x18, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, + 0x00, 0x18, 0x24, 0x18, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, + 0x30, 0x48, 0x3A, 0x06, 0x0E, + 0x26, 0x29, 0x79, 0x29, 0x26, + 0x40, 0x7F, 0x05, 0x05, 0x07, + 0x40, 0x7F, 0x05, 0x25, 0x3F, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, + 0x14, 0x22, 0x7F, 0x22, 0x14, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, + 0x06, 0x09, 0x7F, 0x01, 0x7F, + 0x00, 0x66, 0x89, 0x95, 0x6A, + 0x60, 0x60, 0x60, 0x60, 0x60, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, + 0x08, 0x04, 0x7E, 0x04, 0x08, + 0x10, 0x20, 0x7E, 0x20, 0x10, + 0x08, 0x08, 0x2A, 0x1C, 0x08, + 0x08, 0x1C, 0x2A, 0x08, 0x08, + 0x1E, 0x10, 0x10, 0x10, 0x10, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, + 0x30, 0x38, 0x3E, 0x38, 0x30, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, + 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, + 0x23, 0x13, 0x08, 0x64, 0x62, + 0x36, 0x49, 0x56, 0x20, 0x50, + 0x00, 0x08, 0x07, 0x03, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, + 0x08, 0x08, 0x3E, 0x08, 0x08, + 0x00, 0x80, 0x70, 0x30, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, + 0x00, 0x00, 0x60, 0x60, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, + 0x3E, 0x51, 0x49, 0x45, 0x3E, + 0x00, 0x42, 0x7F, 0x40, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, + 0x21, 0x41, 0x49, 0x4D, 0x33, + 0x18, 0x14, 0x12, 0x7F, 0x10, + 0x27, 0x45, 0x45, 0x45, 0x39, + 0x3C, 0x4A, 0x49, 0x49, 0x31, + 0x41, 0x21, 0x11, 0x09, 0x07, + 0x36, 0x49, 0x49, 0x49, 0x36, + 0x46, 0x49, 0x49, 0x29, 0x1E, + 0x00, 0x00, 0x14, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, + 0x14, 0x14, 0x14, 0x14, 0x14, + 0x00, 0x41, 0x22, 0x14, 0x08, + 0x02, 0x01, 0x59, 0x09, 0x06, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, + 0x7C, 0x12, 0x11, 0x12, 0x7C, + 0x7F, 0x49, 0x49, 0x49, 0x36, + 0x3E, 0x41, 0x41, 0x41, 0x22, + 0x7F, 0x41, 0x41, 0x41, 0x3E, + 0x7F, 0x49, 0x49, 0x49, 0x41, + 0x7F, 0x09, 0x09, 0x09, 0x01, + 0x3E, 0x41, 0x41, 0x51, 0x73, + 0x7F, 0x08, 0x08, 0x08, 0x7F, + 0x00, 0x41, 0x7F, 0x41, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, + 0x7F, 0x08, 0x14, 0x22, 0x41, + 0x7F, 0x40, 0x40, 0x40, 0x40, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, + 0x7F, 0x04, 0x08, 0x10, 0x7F, + 0x3E, 0x41, 0x41, 0x41, 0x3E, + 0x7F, 0x09, 0x09, 0x09, 0x06, + 0x3E, 0x41, 0x51, 0x21, 0x5E, + 0x7F, 0x09, 0x19, 0x29, 0x46, + 0x26, 0x49, 0x49, 0x49, 0x32, + 0x03, 0x01, 0x7F, 0x01, 0x03, + 0x3F, 0x40, 0x40, 0x40, 0x3F, + 0x1F, 0x20, 0x40, 0x20, 0x1F, + 0x3F, 0x40, 0x38, 0x40, 0x3F, + 0x63, 0x14, 0x08, 0x14, 0x63, + 0x03, 0x04, 0x78, 0x04, 0x03, + 0x61, 0x59, 0x49, 0x4D, 0x43, + 0x00, 0x7F, 0x41, 0x41, 0x41, + 0x02, 0x04, 0x08, 0x10, 0x20, + 0x00, 0x41, 0x41, 0x41, 0x7F, + 0x04, 0x02, 0x01, 0x02, 0x04, + 0x40, 0x40, 0x40, 0x40, 0x40, + 0x00, 0x03, 0x07, 0x08, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, + 0x7F, 0x28, 0x44, 0x44, 0x38, + 0x38, 0x44, 0x44, 0x44, 0x28, + 0x38, 0x44, 0x44, 0x28, 0x7F, + 0x38, 0x54, 0x54, 0x54, 0x18, + 0x00, 0x08, 0x7E, 0x09, 0x02, + 0x18, 0xA4, 0xA4, 0x9C, 0x78, + 0x7F, 0x08, 0x04, 0x04, 0x78, + 0x00, 0x44, 0x7D, 0x40, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, + 0x7C, 0x08, 0x04, 0x04, 0x78, + 0x38, 0x44, 0x44, 0x44, 0x38, + 0xFC, 0x18, 0x24, 0x24, 0x18, + 0x18, 0x24, 0x24, 0x18, 0xFC, + 0x7C, 0x08, 0x04, 0x04, 0x08, + 0x48, 0x54, 0x54, 0x54, 0x24, + 0x04, 0x04, 0x3F, 0x44, 0x24, + 0x3C, 0x40, 0x40, 0x20, 0x7C, + 0x1C, 0x20, 0x40, 0x20, 0x1C, + 0x3C, 0x40, 0x30, 0x40, 0x3C, + 0x44, 0x28, 0x10, 0x28, 0x44, + 0x4C, 0x90, 0x90, 0x90, 0x7C, + 0x44, 0x64, 0x54, 0x4C, 0x44, + 0x00, 0x08, 0x36, 0x41, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, + 0x3C, 0x26, 0x23, 0x26, 0x3C, + 0x1E, 0xA1, 0xA1, 0x61, 0x12, + 0x3A, 0x40, 0x40, 0x20, 0x7A, + 0x38, 0x54, 0x54, 0x55, 0x59, + 0x21, 0x55, 0x55, 0x79, 0x41, + 0x22, 0x54, 0x54, 0x78, 0x42, // a-umlaut + 0x21, 0x55, 0x54, 0x78, 0x40, + 0x20, 0x54, 0x55, 0x79, 0x40, + 0x0C, 0x1E, 0x52, 0x72, 0x12, + 0x39, 0x55, 0x55, 0x55, 0x59, + 0x39, 0x54, 0x54, 0x54, 0x59, + 0x39, 0x55, 0x54, 0x54, 0x58, + 0x00, 0x00, 0x45, 0x7C, 0x41, + 0x00, 0x02, 0x45, 0x7D, 0x42, + 0x00, 0x01, 0x45, 0x7C, 0x40, + 0x7D, 0x12, 0x11, 0x12, 0x7D, // A-umlaut + 0xF0, 0x28, 0x25, 0x28, 0xF0, + 0x7C, 0x54, 0x55, 0x45, 0x00, + 0x20, 0x54, 0x54, 0x7C, 0x54, + 0x7C, 0x0A, 0x09, 0x7F, 0x49, + 0x32, 0x49, 0x49, 0x49, 0x32, + 0x3A, 0x44, 0x44, 0x44, 0x3A, // o-umlaut + 0x32, 0x4A, 0x48, 0x48, 0x30, + 0x3A, 0x41, 0x41, 0x21, 0x7A, + 0x3A, 0x42, 0x40, 0x20, 0x78, + 0x00, 0x9D, 0xA0, 0xA0, 0x7D, + 0x3D, 0x42, 0x42, 0x42, 0x3D, // O-umlaut + 0x3D, 0x40, 0x40, 0x40, 0x3D, + 0x3C, 0x24, 0xFF, 0x24, 0x24, + 0x48, 0x7E, 0x49, 0x43, 0x66, + 0x2B, 0x2F, 0xFC, 0x2F, 0x2B, + 0xFF, 0x09, 0x29, 0xF6, 0x20, + 0xC0, 0x88, 0x7E, 0x09, 0x03, + 0x20, 0x54, 0x54, 0x79, 0x41, + 0x00, 0x00, 0x44, 0x7D, 0x41, + 0x30, 0x48, 0x48, 0x4A, 0x32, + 0x38, 0x40, 0x40, 0x22, 0x7A, + 0x00, 0x7A, 0x0A, 0x0A, 0x72, + 0x7D, 0x0D, 0x19, 0x31, 0x7D, + 0x26, 0x29, 0x29, 0x2F, 0x28, + 0x26, 0x29, 0x29, 0x29, 0x26, + 0x30, 0x48, 0x4D, 0x40, 0x20, + 0x38, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x38, + 0x2F, 0x10, 0xC8, 0xAC, 0xBA, + 0x2F, 0x10, 0x28, 0x34, 0xFA, + 0x00, 0x00, 0x7B, 0x00, 0x00, + 0x08, 0x14, 0x2A, 0x14, 0x22, + 0x22, 0x14, 0x2A, 0x14, 0x08, + 0x55, 0x00, 0x55, 0x00, 0x55, // #176 (25% block) missing in old code + 0xAA, 0x55, 0xAA, 0x55, 0xAA, // 50% block + 0xFF, 0x55, 0xFF, 0x55, 0xFF, // 75% block + 0x00, 0x00, 0x00, 0xFF, 0x00, + 0x10, 0x10, 0x10, 0xFF, 0x00, + 0x14, 0x14, 0x14, 0xFF, 0x00, + 0x10, 0x10, 0xFF, 0x00, 0xFF, + 0x10, 0x10, 0xF0, 0x10, 0xF0, + 0x14, 0x14, 0x14, 0xFC, 0x00, + 0x14, 0x14, 0xF7, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0xFF, + 0x14, 0x14, 0xF4, 0x04, 0xFC, + 0x14, 0x14, 0x17, 0x10, 0x1F, + 0x10, 0x10, 0x1F, 0x10, 0x1F, + 0x14, 0x14, 0x14, 0x1F, 0x00, + 0x10, 0x10, 0x10, 0xF0, 0x00, + 0x00, 0x00, 0x00, 0x1F, 0x10, + 0x10, 0x10, 0x10, 0x1F, 0x10, + 0x10, 0x10, 0x10, 0xF0, 0x10, + 0x00, 0x00, 0x00, 0xFF, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0xFF, 0x10, + 0x00, 0x00, 0x00, 0xFF, 0x14, + 0x00, 0x00, 0xFF, 0x00, 0xFF, + 0x00, 0x00, 0x1F, 0x10, 0x17, + 0x00, 0x00, 0xFC, 0x04, 0xF4, + 0x14, 0x14, 0x17, 0x10, 0x17, + 0x14, 0x14, 0xF4, 0x04, 0xF4, + 0x00, 0x00, 0xFF, 0x00, 0xF7, + 0x14, 0x14, 0x14, 0x14, 0x14, + 0x14, 0x14, 0xF7, 0x00, 0xF7, + 0x14, 0x14, 0x14, 0x17, 0x14, + 0x10, 0x10, 0x1F, 0x10, 0x1F, + 0x14, 0x14, 0x14, 0xF4, 0x14, + 0x10, 0x10, 0xF0, 0x10, 0xF0, + 0x00, 0x00, 0x1F, 0x10, 0x1F, + 0x00, 0x00, 0x00, 0x1F, 0x14, + 0x00, 0x00, 0x00, 0xFC, 0x14, + 0x00, 0x00, 0xF0, 0x10, 0xF0, + 0x10, 0x10, 0xFF, 0x10, 0xFF, + 0x14, 0x14, 0x14, 0xFF, 0x14, + 0x10, 0x10, 0x10, 0x1F, 0x00, + 0x00, 0x00, 0x00, 0xF0, 0x10, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, + 0x38, 0x44, 0x44, 0x38, 0x44, + 0xFC, 0x4A, 0x4A, 0x4A, 0x34, // sharp-s or beta + 0x7E, 0x02, 0x02, 0x06, 0x06, + 0x02, 0x7E, 0x02, 0x7E, 0x02, + 0x63, 0x55, 0x49, 0x41, 0x63, + 0x38, 0x44, 0x44, 0x3C, 0x04, + 0x40, 0x7E, 0x20, 0x1E, 0x20, + 0x06, 0x02, 0x7E, 0x02, 0x02, + 0x99, 0xA5, 0xE7, 0xA5, 0x99, + 0x1C, 0x2A, 0x49, 0x2A, 0x1C, + 0x4C, 0x72, 0x01, 0x72, 0x4C, + 0x30, 0x4A, 0x4D, 0x4D, 0x30, + 0x30, 0x48, 0x78, 0x48, 0x30, + 0xBC, 0x62, 0x5A, 0x46, 0x3D, + 0x3E, 0x49, 0x49, 0x49, 0x00, + 0x7E, 0x01, 0x01, 0x01, 0x7E, + 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, + 0x44, 0x44, 0x5F, 0x44, 0x44, + 0x40, 0x51, 0x4A, 0x44, 0x40, + 0x40, 0x44, 0x4A, 0x51, 0x40, + 0x00, 0x00, 0xFF, 0x01, 0x03, + 0xE0, 0x80, 0xFF, 0x00, 0x00, + 0x08, 0x08, 0x6B, 0x6B, 0x08, + 0x36, 0x12, 0x36, 0x24, 0x36, + 0x06, 0x0F, 0x09, 0x0F, 0x06, + 0x00, 0x00, 0x18, 0x18, 0x00, + 0x00, 0x00, 0x10, 0x10, 0x00, + 0x30, 0x40, 0xFF, 0x01, 0x01, + 0x00, 0x1F, 0x01, 0x01, 0x1E, + 0x00, 0x19, 0x1D, 0x17, 0x12, + 0x00, 0x3C, 0x3C, 0x3C, 0x3C, + 0x00, 0x00, 0x00, 0x00, 0x00 // #255 NBSP +}; +#endif // FONT5X7_H diff --git a/keyboards/lets_split/i2c.c b/keyboards/lets_split/i2c.c index 084c890c4..038f37a4b 100644 --- a/keyboards/lets_split/i2c.c +++ b/keyboards/lets_split/i2c.c @@ -48,7 +48,7 @@ void i2c_master_init(void) { // returns: 0 => success // 1 => error uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< ERROR_DISCONNECT_COUNT) { @@ -226,9 +227,7 @@ uint8_t matrix_scan(void) TXLED0; error_count = 0; } - matrix_scan_quantum(); - return ret; } diff --git a/keyboards/lets_split/rules.mk b/keyboards/lets_split/rules.mk index 0efa78550..ff159e0f0 100644 --- a/keyboards/lets_split/rules.mk +++ b/keyboards/lets_split/rules.mk @@ -1,7 +1,8 @@ SRC += matrix.c \ i2c.c \ split_util.c \ - serial.c + serial.c\ + ssd1306.c # MCU name #MCU = at90usb1287 @@ -73,15 +74,3 @@ USE_I2C ?= yes SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend CUSTOM_MATRIX = yes - -avrdude: build - ls /dev/tty* > /tmp/1; \ - echo "Reset your Pro Micro now"; \ - while [[ -z $$USB ]]; do \ - sleep 1; \ - ls /dev/tty* > /tmp/2; \ - USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \ - done; \ - avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex - -.PHONY: avrdude diff --git a/keyboards/lets_split/split_util.c b/keyboards/lets_split/split_util.c index 226dc1881..b87bae38b 100644 --- a/keyboards/lets_split/split_util.c +++ b/keyboards/lets_split/split_util.c @@ -21,8 +21,8 @@ static void setup_handedness(void) { #ifdef EE_HANDS isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); #else - // I2C_MASTER_RIGHT is deprecated use MASTER_RIGHT instead since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + // I2c_MASTER_RIGHT ish deprecate use MASTER_RIGHT instead since this works for both serial and i2c: + #if defined (I2C_MASTER_RIGHT) || defined (MASTER_RIGHT) isLeftHand = !has_usb(); #else isLeftHand = has_usb(); @@ -33,6 +33,9 @@ static void setup_handedness(void) { static void keyboard_master_setup(void) { #ifdef USE_I2C i2c_master_init(); +#ifdef SSD1306OLED + matrix_master_OLED_init (); +#endif #else serial_master_init(); #endif diff --git a/keyboards/lets_split/split_util.h b/keyboards/lets_split/split_util.h index 6b896679c..3ae76c209 100644 --- a/keyboards/lets_split/split_util.h +++ b/keyboards/lets_split/split_util.h @@ -19,4 +19,6 @@ void split_keyboard_setup(void); bool has_usb(void); void keyboard_slave_loop(void); +void matrix_master_OLED_init (void); + #endif diff --git a/keyboards/lets_split/ssd1306.c b/keyboards/lets_split/ssd1306.c new file mode 100644 index 000000000..c25a355bf --- /dev/null +++ b/keyboards/lets_split/ssd1306.c @@ -0,0 +1,508 @@ +#include "config.h" +#include "i2c.h" +#include +#include +#include +#include "print.h" +#include "lets_split.h" +#include "common/glcdfont.c" +#ifdef ADAFRUIT_BLE_ENABLE +#include "adafruit_ble.h" +#endif +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#endif +#include "sendchar.h" +#include "pincontrol.h" + +//assign the right code to your layers +#define _BASE 0 +#define _LOWER 8 +#define _RAISE 16 +#define _FNLAYER 64 +#define _NUMLAY 128 +#define _NLOWER 136 +#define _NFNLAYER 192 +#define _MOUSECURSOR 256 +#define _ADJUST 65560 + +// Set this to 1 to help diagnose early startup problems +// when testing power-on with ble. Turn it off otherwise, +// as the latency of printing most of the debug info messes +// with the matrix scan, causing keys to drop. +#define DEBUG_TO_SCREEN 0 + +// Controls the SSD1306 128x32 OLED display via i2c + +#define i2cAddress 0x3C + +#define DisplayHeight 32 +#define DisplayWidth 128 + +#define FontHeight 8 +#define FontWidth 6 + +#define MatrixRows (DisplayHeight / FontHeight) +#define MatrixCols (DisplayWidth / FontWidth) + +struct CharacterMatrix { + uint8_t display[MatrixRows][MatrixCols]; + uint8_t *cursor; + bool dirty; +}; + +static struct CharacterMatrix display; +//static uint16_t last_battery_update; +//static uint32_t vbat; +//#define BatteryUpdateInterval 10000 /* milliseconds */ +#define ScreenOffInterval 300000 /* milliseconds */ +#if DEBUG_TO_SCREEN +static uint8_t displaying; +#endif +static uint16_t last_flush; + +enum ssd1306_cmds { + DisplayOff = 0xAE, + DisplayOn = 0xAF, + + SetContrast = 0x81, + DisplayAllOnResume = 0xA4, + + DisplayAllOn = 0xA5, + NormalDisplay = 0xA6, + InvertDisplay = 0xA7, + SetDisplayOffset = 0xD3, + SetComPins = 0xda, + SetVComDetect = 0xdb, + SetDisplayClockDiv = 0xD5, + SetPreCharge = 0xd9, + SetMultiPlex = 0xa8, + SetLowColumn = 0x00, + SetHighColumn = 0x10, + SetStartLine = 0x40, + + SetMemoryMode = 0x20, + ColumnAddr = 0x21, + PageAddr = 0x22, + + ComScanInc = 0xc0, + ComScanDec = 0xc8, + SegRemap = 0xa0, + SetChargePump = 0x8d, + ExternalVcc = 0x01, + SwitchCapVcc = 0x02, + + ActivateScroll = 0x2f, + DeActivateScroll = 0x2e, + SetVerticalScrollArea = 0xa3, + RightHorizontalScroll = 0x26, + LeftHorizontalScroll = 0x27, + VerticalAndRightHorizontalScroll = 0x29, + VerticalAndLeftHorizontalScroll = 0x2a, +}; + + +// Write command sequence. +// Returns true on success. +static inline bool _send_cmd1(uint8_t cmd) { + bool res = false; + + if (i2c_start_write(i2cAddress)) { + xprintf("failed to start write to %d\n", i2cAddress); + goto done; + } + + if (i2c_master_write(0x0 /* command byte follows */)) { + print("failed to write control byte\n"); + + goto done; + } + + if (i2c_master_write(cmd)) { + xprintf("failed to write command %d\n", cmd); + goto done; + } + res = true; +done: + i2c_master_stop(); + return res; +} + +// Write 2-byte command sequence. +// Returns true on success +static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { + if (!_send_cmd1(cmd)) { + return false; + } + return _send_cmd1(opr); +} + +// Write 3-byte command sequence. +// Returns true on success +static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { + if (!_send_cmd1(cmd)) { + return false; + } + if (!_send_cmd1(opr1)) { + return false; + } + return _send_cmd1(opr2); +} + +#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} +#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} +#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} + +static void matrix_clear(struct CharacterMatrix *matrix); + +static void clear_display(void) { + matrix_clear(&display); + + // Clear all of the display bits (there can be random noise + // in the RAM on startup) + send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); + send_cmd3(ColumnAddr, 0, DisplayWidth - 1); + + if (i2c_start_write(i2cAddress)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < DisplayWidth; ++col) { + i2c_master_write(0); + } + } + + display.dirty = false; + +done: + i2c_master_stop(); +} + +#if DEBUG_TO_SCREEN +#undef sendchar +static int8_t capture_sendchar(uint8_t c) { + sendchar(c); + iota_gfx_write_char(c); + + if (!displaying) { + iota_gfx_flush(); + } + return 0; +} +#endif + +bool iota_gfx_init(void) { + bool success = false; + + send_cmd1(DisplayOff); + send_cmd2(SetDisplayClockDiv, 0x80); + send_cmd2(SetMultiPlex, DisplayHeight - 1); + + send_cmd2(SetDisplayOffset, 0); + + + send_cmd1(SetStartLine | 0x0); + send_cmd2(SetChargePump, 0x14 /* Enable */); + send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); + +/* Flips the display orientation 0 degrees + send_cmd1(SegRemap | 0x1); + send_cmd1(ComScanDec); +*/ +// the following Flip the display orientation 180 degrees */ + send_cmd1(SegRemap); + send_cmd1(ComScanInc); +//end flip + send_cmd2(SetComPins, 0x2); + send_cmd2(SetContrast, 0x8f); + send_cmd2(SetPreCharge, 0xf1); + send_cmd2(SetVComDetect, 0x40); + send_cmd1(DisplayAllOnResume); + send_cmd1(NormalDisplay); + send_cmd1(DeActivateScroll); + send_cmd1(DisplayOn); + + send_cmd2(SetContrast, 0); // Dim + + clear_display(); + + success = true; + + iota_gfx_flush(); + +#if DEBUG_TO_SCREEN + print_set_sendchar(capture_sendchar); +#endif + +done: + return success; +} + +bool iota_gfx_off(void) { + bool success = false; + + send_cmd1(DisplayOff); + success = true; + +done: + return success; +} + +bool iota_gfx_on(void) { + bool success = false; + + send_cmd1(DisplayOn); + success = true; + +done: + return success; +} + +static void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { + *matrix->cursor = c; + ++matrix->cursor; + + if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { + // We went off the end; scroll the display upwards by one line + memmove(&matrix->display[0], &matrix->display[1], + MatrixCols * (MatrixRows - 1)); + matrix->cursor = &matrix->display[MatrixRows - 1][0]; + memset(matrix->cursor, ' ', MatrixCols); + } +} + +static void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { + matrix->dirty = true; + + if (c == '\n') { + // Clear to end of line from the cursor and then move to the + // start of the next line + uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; + + while (cursor_col++ < MatrixCols) { + matrix_write_char_inner(matrix, ' '); + } + return; + } + + matrix_write_char_inner(matrix, c); +} + +void iota_gfx_write_char(uint8_t c) { + matrix_write_char(&display, c); +} + +static void matrix_write(struct CharacterMatrix *matrix, const char *data) { + const char *end = data + strlen(data); + while (data < end) { + matrix_write_char(matrix, *data); + ++data; + } +} + +void iota_gfx_write(const char *data) { + matrix_write(&display, data); +} + +static void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { + while (true) { + uint8_t c = pgm_read_byte(data); + if (c == 0) { + return; + } + matrix_write_char(matrix, c); + ++data; + } +} + +void iota_gfx_write_P(const char *data) { + matrix_write_P(&display, data); +} + +static void matrix_clear(struct CharacterMatrix *matrix) { + memset(matrix->display, ' ', sizeof(matrix->display)); + matrix->cursor = &matrix->display[0][0]; + matrix->dirty = true; +} + +void iota_gfx_clear_screen(void) { + matrix_clear(&display); +} + +static void matrix_render(struct CharacterMatrix *matrix) { + last_flush = timer_read(); + iota_gfx_on(); +#if DEBUG_TO_SCREEN + ++displaying; +#endif + + // Move to the home position + send_cmd3(PageAddr, 0, MatrixRows - 1); + send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); + + if (i2c_start_write(i2cAddress)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < MatrixCols; ++col) { + const uint8_t *glyph = font + (matrix->display[row][col] * (FontWidth - 1)); + + for (uint8_t glyphCol = 0; glyphCol < FontWidth - 1; ++glyphCol) { + uint8_t colBits = pgm_read_byte(glyph + glyphCol); + i2c_master_write(colBits); + } + + // 1 column of space between chars (it's not included in the glyph) + i2c_master_write(0); + } + } + + matrix->dirty = false; + +done: + i2c_master_stop(); +#if DEBUG_TO_SCREEN + --displaying; +#endif +} + +void iota_gfx_flush(void) { + matrix_render(&display); +} + +//#include "LUFA/Drivers/Peripheral/ADC.h" + +/* Returns the battery voltage; returns the number of millivolts +static uint32_t read_battery_voltage(void) { + if (last_battery_update == 0 || + timer_elapsed(last_battery_update) > BatteryUpdateInterval) { + ADC_Init(ADC_SINGLE_CONVERSION | ADC_PRESCALE_32); + ADC_SetupChannel(12); + vbat = 2 * 3.3 * ADC_GetChannelReading(ADC_REFERENCE_AVCC | ADC_CHANNEL12); + + last_battery_update = timer_read(); + } + return vbat; +} */ + +static void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +static void render_status_info(void) { +#if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } +#endif + + struct CharacterMatrix matrix; + + matrix_clear(&matrix); + matrix_write_P(&matrix, PSTR("USB: ")); +#ifdef PROTOCOL_LUFA + switch (USB_DeviceState) { + case DEVICE_STATE_Unattached: + matrix_write_P(&matrix, PSTR("Unattached")); + break; + case DEVICE_STATE_Suspended: + matrix_write_P(&matrix, PSTR("Suspended")); + break; + case DEVICE_STATE_Configured: + matrix_write_P(&matrix, PSTR("Connected")); + break; + case DEVICE_STATE_Powered: + matrix_write_P(&matrix, PSTR("Powered")); + break; + case DEVICE_STATE_Default: + matrix_write_P(&matrix, PSTR("Default")); + break; + case DEVICE_STATE_Addressed: + matrix_write_P(&matrix, PSTR("Addressed")); + break; + default: + matrix_write_P(&matrix, PSTR("Invalid")); + } +#endif + + // matrix_write_P(&matrix, (host_keyboard_leds() & (1< ScreenOffInterval) { + iota_gfx_off(); + } +} -- cgit v1.2.3 From 30f450749201b9584bc863cb08724d8f61f0463a Mon Sep 17 00:00:00 2001 From: ishtob Date: Wed, 22 Mar 2017 15:11:03 -0400 Subject: OLED code cleanup --- keyboards/lets_split/ssd1306.c | 52 +++++------------------------------------- 1 file changed, 6 insertions(+), 46 deletions(-) (limited to 'keyboards') diff --git a/keyboards/lets_split/ssd1306.c b/keyboards/lets_split/ssd1306.c index c25a355bf..a68165f83 100644 --- a/keyboards/lets_split/ssd1306.c +++ b/keyboards/lets_split/ssd1306.c @@ -209,14 +209,14 @@ bool iota_gfx_init(void) { send_cmd2(SetChargePump, 0x14 /* Enable */); send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); -/* Flips the display orientation 0 degrees +/// Flips the display orientation 0 degrees send_cmd1(SegRemap | 0x1); send_cmd1(ComScanDec); -*/ -// the following Flip the display orientation 180 degrees */ +/* +// the following Flip the display orientation 180 degrees send_cmd1(SegRemap); send_cmd1(ComScanInc); -//end flip +*/end flip send_cmd2(SetComPins, 0x2); send_cmd2(SetContrast, 0x8f); send_cmd2(SetPreCharge, 0xf1); @@ -379,21 +379,6 @@ void iota_gfx_flush(void) { matrix_render(&display); } -//#include "LUFA/Drivers/Peripheral/ADC.h" - -/* Returns the battery voltage; returns the number of millivolts -static uint32_t read_battery_voltage(void) { - if (last_battery_update == 0 || - timer_elapsed(last_battery_update) > BatteryUpdateInterval) { - ADC_Init(ADC_SINGLE_CONVERSION | ADC_PRESCALE_32); - ADC_SetupChannel(12); - vbat = 2 * 3.3 * ADC_GetChannelReading(ADC_REFERENCE_AVCC | ADC_CHANNEL12); - - last_battery_update = timer_read(); - } - return vbat; -} */ - static void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { if (memcmp(dest->display, source->display, sizeof(dest->display))) { @@ -438,18 +423,7 @@ static void render_status_info(void) { } #endif - // matrix_write_P(&matrix, (host_keyboard_leds() & (1< ERROR_DISCONNECT_COUNT) { -- cgit v1.2.3 From be0cfbb97e5577e331e327b4e729b1b4c4ccb54c Mon Sep 17 00:00:00 2001 From: ishtob Date: Wed, 22 Mar 2017 15:48:56 -0400 Subject: Update i2c.c --- keyboards/lets_split/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards') diff --git a/keyboards/lets_split/i2c.c b/keyboards/lets_split/i2c.c index 038f37a4b..f1a349168 100644 --- a/keyboards/lets_split/i2c.c +++ b/keyboards/lets_split/i2c.c @@ -48,7 +48,7 @@ void i2c_master_init(void) { // returns: 0 => success // 1 => error uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< success // 1 => error uint8_t i2c_master_start(uint8_t address) { - TWCR = (1<. #define USE_SERIAL -#define EE_HANDS +#define TAPPING_TERM 150 #undef RGBLED_NUM #define RGB_DI_PIN B0 -- cgit v1.2.3 From f3e3ff29a346bf917403672f8dbdf08c9f3a83f6 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Wed, 15 Mar 2017 16:34:57 -0400 Subject: Add Makefile in keymap dir --- keyboards/lets_split/keymaps/hexwire/Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'keyboards') diff --git a/keyboards/lets_split/keymaps/hexwire/Makefile b/keyboards/lets_split/keymaps/hexwire/Makefile index 1e3cebb14..1e5761278 100644 --- a/keyboards/lets_split/keymaps/hexwire/Makefile +++ b/keyboards/lets_split/keymaps/hexwire/Makefile @@ -1 +1,5 @@ RGBLIGHT_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif -- cgit v1.2.3 From e5c5902e95840876f1e51c3e8e0a93311676fa27 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Thu, 23 Mar 2017 08:46:10 -0400 Subject: Move keymap into config file --- .../lets_split/keymaps/hexwire/compact_keymap.h | 23 ---------------- keyboards/lets_split/keymaps/hexwire/config.h | 32 ++++++++++++++++++++++ keyboards/lets_split/keymaps/hexwire/keymap.c | 2 +- 3 files changed, 33 insertions(+), 24 deletions(-) delete mode 100644 keyboards/lets_split/keymaps/hexwire/compact_keymap.h (limited to 'keyboards') diff --git a/keyboards/lets_split/keymaps/hexwire/compact_keymap.h b/keyboards/lets_split/keymaps/hexwire/compact_keymap.h deleted file mode 100644 index d9d063fbf..000000000 --- a/keyboards/lets_split/keymaps/hexwire/compact_keymap.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef COMPACT_KEYMAP_H -#define COMPACT_KEYMAP_H - -#define COMPACT_KEYMAP( \ - k00, k01, k02, k03, k04, k05, k45, k44, k43, k42, k41, k40, \ - k10, k11, k12, k13, k14, k15, k55, k54, k53, k52, k51, k50, \ - k20, k21, k22, k23, k24, k25, k65, k64, k63, k62, k61, k60, \ - k30, k31, k32, k33, k34, k35, k75, k74, k73, k72, k71, k70 \ - ) \ - { \ - { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05 }, \ - { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15 }, \ - { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25 }, \ - { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35 }, \ - { KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45 }, \ - { KC_##k50, KC_##k51, KC_##k52, KC_##k53, KC_##k54, KC_##k55 }, \ - { KC_##k60, KC_##k61, KC_##k62, KC_##k63, KC_##k64, KC_##k65 }, \ - { KC_##k70, KC_##k71, KC_##k72, KC_##k73, KC_##k74, KC_##k75 } \ - } - -#define KC_ KC_TRNS - -#endif \ No newline at end of file diff --git a/keyboards/lets_split/keymaps/hexwire/config.h b/keyboards/lets_split/keymaps/hexwire/config.h index 11adbc454..38b57266a 100644 --- a/keyboards/lets_split/keymaps/hexwire/config.h +++ b/keyboards/lets_split/keymaps/hexwire/config.h @@ -30,9 +30,41 @@ along with this program. If not, see . #ifdef SUBPROJECT_rev1 #include "../../rev1/config.h" + #define COMPACT_KEYMAP( \ + k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \ + k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \ + k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \ + k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \ + ) \ + { \ + { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05 }, \ + { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15 }, \ + { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25 }, \ + { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35 }, \ + { KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45 }, \ + { KC_##k50, KC_##k51, KC_##k52, KC_##k53, KC_##k54, KC_##k55 }, \ + { KC_##k60, KC_##k61, KC_##k62, KC_##k63, KC_##k64, KC_##k65 }, \ + { KC_##k70, KC_##k71, KC_##k72, KC_##k73, KC_##k74, KC_##k75 } \ + } #endif #ifdef SUBPROJECT_rev2 #include "../../rev2/config.h" + #define COMPACT_KEYMAP( \ + k00, k01, k02, k03, k04, k05, k45, k44, k43, k42, k41, k40, \ + k10, k11, k12, k13, k14, k15, k55, k54, k53, k52, k51, k50, \ + k20, k21, k22, k23, k24, k25, k65, k64, k63, k62, k61, k60, \ + k30, k31, k32, k33, k34, k35, k75, k74, k73, k72, k71, k70 \ + ) \ + { \ + { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05 }, \ + { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15 }, \ + { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25 }, \ + { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35 }, \ + { KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45 }, \ + { KC_##k50, KC_##k51, KC_##k52, KC_##k53, KC_##k54, KC_##k55 }, \ + { KC_##k60, KC_##k61, KC_##k62, KC_##k63, KC_##k64, KC_##k65 }, \ + { KC_##k70, KC_##k71, KC_##k72, KC_##k73, KC_##k74, KC_##k75 } \ + } #endif #ifdef SUBPROJECT_rev2fliphalf #include "../../rev2fliphalf/config.h" diff --git a/keyboards/lets_split/keymaps/hexwire/keymap.c b/keyboards/lets_split/keymaps/hexwire/keymap.c index 796a1fcab..f8370490d 100644 --- a/keyboards/lets_split/keymaps/hexwire/keymap.c +++ b/keyboards/lets_split/keymaps/hexwire/keymap.c @@ -1,7 +1,6 @@ #include "lets_split.h" #include "action_layer.h" #include "eeconfig.h" -#include "compact_keymap.h" extern keymap_config_t keymap_config; @@ -25,6 +24,7 @@ enum custom_keycodes { ADJUST, }; +#define KC_ KC_TRNS #define _______ KC_TRNS #define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen -- cgit v1.2.3 From edfb50ea5616c9361e479ec41d1d2c3d72f2f51c Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Thu, 23 Mar 2017 09:42:32 -0400 Subject: Initial commit for Atreus50 with working audio --- keyboards/atreus50/Makefile | 3 + keyboards/atreus50/atreus50.c | 10 + keyboards/atreus50/atreus50.h | 36 ++++ keyboards/atreus50/config.h | 163 ++++++++++++++++ keyboards/atreus50/keymaps/default/Makefile | 6 + keyboards/atreus50/keymaps/default/keymap.c | 270 +++++++++++++++++++++++++++ keyboards/atreus50/keymaps/default/readme.md | 1 + keyboards/atreus50/readme.md | 25 +++ keyboards/atreus50/rules.mk | 81 ++++++++ 9 files changed, 595 insertions(+) create mode 100644 keyboards/atreus50/Makefile create mode 100644 keyboards/atreus50/atreus50.c create mode 100644 keyboards/atreus50/atreus50.h create mode 100644 keyboards/atreus50/config.h create mode 100644 keyboards/atreus50/keymaps/default/Makefile create mode 100644 keyboards/atreus50/keymaps/default/keymap.c create mode 100644 keyboards/atreus50/keymaps/default/readme.md create mode 100644 keyboards/atreus50/readme.md create mode 100644 keyboards/atreus50/rules.mk (limited to 'keyboards') diff --git a/keyboards/atreus50/Makefile b/keyboards/atreus50/Makefile new file mode 100644 index 000000000..57b2ef62e --- /dev/null +++ b/keyboards/atreus50/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif diff --git a/keyboards/atreus50/atreus50.c b/keyboards/atreus50/atreus50.c new file mode 100644 index 000000000..0ec63216f --- /dev/null +++ b/keyboards/atreus50/atreus50.c @@ -0,0 +1,10 @@ +#include "atreus50.h" + +void matrix_init_kb(void) { + + // Turn status LED on + //DDRE |= (1<<6); + PORTE |= (1<<6); + + matrix_init_user(); +}; \ No newline at end of file diff --git a/keyboards/atreus50/atreus50.h b/keyboards/atreus50/atreus50.h new file mode 100644 index 000000000..de06f255e --- /dev/null +++ b/keyboards/atreus50/atreus50.h @@ -0,0 +1,36 @@ +#ifndef ATREUS50_H +#define ATREUS50_H + +#include "quantum.h" + +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define KEYMAP( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, km0, km1, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, KC_NO, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, km0, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, km1, k36, k37, k38, k39, k3a, k3b } \ +} + +#define COMPACT_KEYMAP( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, km0, km1, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_NO, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b }, \ + { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_NO, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b }, \ + { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##km0, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b }, \ + { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##km1, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b } \ +} + +#define KC_ KC_TRNS + +#endif diff --git a/keyboards/atreus50/config.h b/keyboards/atreus50/config.h new file mode 100644 index 000000000..dedcc8cae --- /dev/null +++ b/keyboards/atreus50/config.h @@ -0,0 +1,163 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xBB80 +#define PRODUCT_ID 0x040D +#define DEVICE_VER 0x0001 +#define MANUFACTURER Hexwire +#define PRODUCT Atreus 50 Keyboard +#define DESCRIPTION Atreus layout with extra column + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 13 + +/* Planck PCB default pin-out */ +#define MATRIX_ROW_PINS { D3, D2, D1, D0 } +#define MATRIX_COL_PINS { D4, D7, E6, B4, B5, B6, B2, B3, B1, F7, F6, F5, F4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + + +/* ws2812 RGB LED */ +#define RGB_DI_PIN C6 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 12 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/atreus50/keymaps/default/Makefile b/keyboards/atreus50/keymaps/default/Makefile new file mode 100644 index 000000000..e8556d0d6 --- /dev/null +++ b/keyboards/atreus50/keymaps/default/Makefile @@ -0,0 +1,6 @@ +RGBLIGHT_ENABLE = no +AUDIO_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/atreus50/keymaps/default/keymap.c b/keyboards/atreus50/keymaps/default/keymap.c new file mode 100644 index 000000000..0a77613c5 --- /dev/null +++ b/keyboards/atreus50/keymaps/default/keymap.c @@ -0,0 +1,270 @@ +#include "atreus50.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef AUDIO_ENABLE + #include "audio.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. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _MOVEMENT 5 +#define _ADJUST 16 + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + MOVEMENT, + BACKLIT +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | - | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | Bksp |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, MO(_MOVEMENT), KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, MO(_MOVEMENT), KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | - | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = KEYMAP( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_MINS, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, \ + KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, MO(_MOVEMENT), KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +[_MOVEMENT] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_MUTE, KC_VOLD, KC_VOLU, KC_PERC, KC_CIRC, KC_AMPR, KC_UP, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_LEFT, KC_DOWN, KC_RIGHT, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDOWN, KC_PGUP, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Audoff|Aud on|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Musoff|Mus on| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = KEYMAP( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + +}; + +#ifdef AUDIO_ENABLE +float tone_startup[][2] = { + {NOTE_B5, 20}, + {NOTE_B6, 8}, + {NOTE_DS6, 20}, + {NOTE_B6, 8} +}; + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); + +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +}; + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif \ No newline at end of file diff --git a/keyboards/atreus50/keymaps/default/readme.md b/keyboards/atreus50/keymaps/default/readme.md new file mode 100644 index 000000000..e911968dd --- /dev/null +++ b/keyboards/atreus50/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default Preonic layout - largely based on the Planck's \ No newline at end of file diff --git a/keyboards/atreus50/readme.md b/keyboards/atreus50/readme.md new file mode 100644 index 000000000..f0be255a0 --- /dev/null +++ b/keyboards/atreus50/readme.md @@ -0,0 +1,25 @@ +Preonic keyboard firmware +====================== +DIY/Assembled compact ortholinear 50% keyboard by [Ortholinear Keyboards](http://ortholinearkeyboards.com). + +## Quantum MK Firmware + +For the full Quantum feature list, see [the parent readme.md](/readme.md). + +## Building + +Download or clone the whole firmware and navigate to the keyboards/preonic folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use `make dfu` to program your PCB once you hit the reset button. + +Depending on which keymap you would like to use, you will have to compile slightly differently. + +### Default +To build with the default keymap, simply run `make`. + +### Other Keymaps +Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap, create a file in the keymaps folder named `.c` and see keymap document (you can find in top readme.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: +``` +$ make KEYMAP=[default|jack|] +``` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/atreus50/rules.mk b/keyboards/atreus50/rules.mk new file mode 100644 index 000000000..7770ea2a2 --- /dev/null +++ b/keyboards/atreus50/rules.mk @@ -0,0 +1,81 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend + +avrdude: build + ls /dev/tty* > /tmp/1; \ + echo "Reset your Pro Micro now"; \ + while [[ -z $$USB ]]; do \ + sleep 1; \ + ls /dev/tty* > /tmp/2; \ + USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \ + done; \ + avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex + +.PHONY: avrdude -- cgit v1.2.3 From 0520341ce48e45ddb53a8b26f8710417af6279e6 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Thu, 23 Mar 2017 11:25:21 -0400 Subject: Cleanup keymap --- keyboards/atreus50/atreus50.c | 2 +- keyboards/atreus50/keymaps/default/keymap.c | 206 ++++++++++++--------------- keyboards/atreus50/keymaps/default/readme.md | 1 - 3 files changed, 94 insertions(+), 115 deletions(-) delete mode 100644 keyboards/atreus50/keymaps/default/readme.md (limited to 'keyboards') diff --git a/keyboards/atreus50/atreus50.c b/keyboards/atreus50/atreus50.c index 0ec63216f..225a51bcc 100644 --- a/keyboards/atreus50/atreus50.c +++ b/keyboards/atreus50/atreus50.c @@ -7,4 +7,4 @@ void matrix_init_kb(void) { PORTE |= (1<<6); matrix_init_user(); -}; \ No newline at end of file +}; diff --git a/keyboards/atreus50/keymaps/default/keymap.c b/keyboards/atreus50/keymaps/default/keymap.c index 0a77613c5..8ae096cd8 100644 --- a/keyboards/atreus50/keymaps/default/keymap.c +++ b/keyboards/atreus50/keymaps/default/keymap.c @@ -17,7 +17,7 @@ #define _MOVEMENT 5 #define _ADJUST 16 -enum preonic_keycodes { +enum custom_keycodes { QWERTY = SAFE_RANGE, COLEMAK, DVORAK, @@ -30,123 +30,103 @@ enum preonic_keycodes { // Fillers to make layering more clear #define _______ KC_TRNS #define XXXXXXX KC_NO +#define KC_X0 MT(MOD_LCTL, KC_ESC) // Hold for Left Ctrl, Tap for ESC +#define KC_X1 LOWER +#define KC_X2 RAISE +#define KC_X3 MO(_MOVEMENT) +#define KC_X4 MT(MOD_LSFT, KC_ENT) // Hold for Left Shift, Tap for Enter const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | - | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower |Space | Bksp |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = KEYMAP( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ - KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, MO(_MOVEMENT), KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Colemak - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | - | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = KEYMAP( \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS, \ - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ - KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, MO(_MOVEMENT), KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Dvorak - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | " | , | . | P | Y | F | G | C | R | L | - | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_DVORAK] = KEYMAP( \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_MINS, \ - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, \ - KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, MO(_MOVEMENT), KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Lower - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = KEYMAP( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Raise - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = KEYMAP( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -[_MOVEMENT] = KEYMAP( \ - KC_TILD, KC_EXLM, KC_MUTE, KC_VOLD, KC_VOLU, KC_PERC, KC_CIRC, KC_AMPR, KC_UP, KC_LPRN, KC_RPRN, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_LEFT, KC_DOWN, KC_RIGHT, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDOWN, KC_PGUP, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), + [_QWERTY] = COMPACT_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , + //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| + GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + ), + + [_COLEMAK] = COMPACT_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X0 , A , R , S , T , D , H , N , E , I , O ,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH, X4 , + //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| + GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + ), + + [_DVORAK] = COMPACT_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X0 , A , O , E , U , I , D , H , R , N , S ,SLSH, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , + //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| + GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + ), + + [_LOWER] = COMPACT_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL , F1 , F2 , F3 , F4 , F5 , F6 ,UNDS,PLUS,LCBR,RCBR,PIPE, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , F7 , F8 , F9 ,F10 ,F11 , F12 ,END , , , , , + //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| + , , , , , , , , , ,MNXT,VOLD,VOLU,MPLY + //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + ), + + [_RAISE] = COMPACT_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,EQL ,LBRC,RBRC,BSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , F7 , F8 , F9 ,F10 ,F11 , F12 ,NUHS,NUBS, , , , + //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| + , , , , , , , , , ,MNXT,VOLD,VOLU,MPLY + //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + ), + + [_MOVEMENT] = COMPACT_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR, UP ,LPRN,RPRN,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL , F1 , F2 , F3 , F4 , F5 , F6 ,LEFT,DOWN,RGHT,RCBR,PIPE, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , F7 , F8 , F9 ,F10 ,F11 , F12 ,END , , , , , + //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| + , , , , , , , ,PGDN,PGUP,MNXT,VOLD,VOLU,MPLY + //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + ), /* Adjust (Lower + Raise) - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Audoff|Aud on|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | |Voice-|Voice+|Musoff|Mus on| | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' + * |------+------+------+------+------+------. ,------+------+------+------+------+------| + * | | Reset| | | | | | | | | | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |Audoff|Aud on|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |Voice-|Voice+|Musoff|Mus on| | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' */ -[_ADJUST] = KEYMAP( \ - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) + [_ADJUST] = KEYMAP( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) }; @@ -267,4 +247,4 @@ void music_scale_user(void) PLAY_NOTE_ARRAY(music_scale, false, 0); } -#endif \ No newline at end of file +#endif diff --git a/keyboards/atreus50/keymaps/default/readme.md b/keyboards/atreus50/keymaps/default/readme.md deleted file mode 100644 index e911968dd..000000000 --- a/keyboards/atreus50/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default Preonic layout - largely based on the Planck's \ No newline at end of file -- cgit v1.2.3 From 63e47a642536ca7af22ef353cf7d19677f48b013 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Thu, 23 Mar 2017 12:23:20 -0400 Subject: Add RGB support for Let’s Split v1 --- keyboards/lets_split/keymaps/hexwire/config.h | 1 - keyboards/lets_split/rev1/config.h | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'keyboards') diff --git a/keyboards/lets_split/keymaps/hexwire/config.h b/keyboards/lets_split/keymaps/hexwire/config.h index 38b57266a..9c8c6d7f4 100644 --- a/keyboards/lets_split/keymaps/hexwire/config.h +++ b/keyboards/lets_split/keymaps/hexwire/config.h @@ -21,7 +21,6 @@ along with this program. If not, see . #define TAPPING_TERM 150 #undef RGBLED_NUM -#define RGB_DI_PIN B0 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 #define RGBLIGHT_HUE_STEP 8 diff --git a/keyboards/lets_split/rev1/config.h b/keyboards/lets_split/rev1/config.h index 2f5bde953..5fb87cf5d 100644 --- a/keyboards/lets_split/rev1/config.h +++ b/keyboards/lets_split/rev1/config.h @@ -63,6 +63,13 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 16 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + /* * Feature disable options * These options are also useful to firmware size reduction. -- cgit v1.2.3 From 8775a13658146b7ffc90ac20579c1996bd51e909 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Thu, 23 Mar 2017 14:46:58 -0400 Subject: Add RGB support --- keyboards/atreus50/config.h | 2 +- keyboards/atreus50/keymaps/default/Makefile | 4 ++-- keyboards/atreus50/keymaps/default/keymap.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'keyboards') diff --git a/keyboards/atreus50/config.h b/keyboards/atreus50/config.h index dedcc8cae..2e34e0f89 100644 --- a/keyboards/atreus50/config.h +++ b/keyboards/atreus50/config.h @@ -61,7 +61,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN C6 -#define RGBLIGHT_TIMER +#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 12 // Number of LEDs #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/atreus50/keymaps/default/Makefile b/keyboards/atreus50/keymaps/default/Makefile index e8556d0d6..d7b0fa7fd 100644 --- a/keyboards/atreus50/keymaps/default/Makefile +++ b/keyboards/atreus50/keymaps/default/Makefile @@ -1,5 +1,5 @@ -RGBLIGHT_ENABLE = no -AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = yes +AUDIO_ENABLE = no ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/atreus50/keymaps/default/keymap.c b/keyboards/atreus50/keymaps/default/keymap.c index 8ae096cd8..415405ec2 100644 --- a/keyboards/atreus50/keymaps/default/keymap.c +++ b/keyboards/atreus50/keymaps/default/keymap.c @@ -122,7 +122,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------------------------------------------------------------------------------------------' */ [_ADJUST] = KEYMAP( \ - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, RESET, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -- cgit v1.2.3 From 739249ff0d707a9702771236fcf22538e3a7106b Mon Sep 17 00:00:00 2001 From: Nicolas Guelpa Date: Fri, 24 Mar 2017 20:18:59 -0400 Subject: Adding different layer --- keyboards/xd60/keymaps/cheese/keymap.c | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 keyboards/xd60/keymaps/cheese/keymap.c (limited to 'keyboards') diff --git a/keyboards/xd60/keymaps/cheese/keymap.c b/keyboards/xd60/keymaps/cheese/keymap.c new file mode 100644 index 000000000..738009304 --- /dev/null +++ b/keyboards/xd60/keymaps/cheese/keymap.c @@ -0,0 +1,67 @@ +#include "xd60.h" +#include "action_layer.h" + +// Each layer gets a name for readability. +// The underscores don't mean anything - you can +// have a layer called STUFF or any other name. +// Layer names don't all need to be of the same +// length, and you can also skip them entirely +// and just use numbers. +#define _BL 0 +#define _FL 1 +#define _LS 2 +#define _RS 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |FN|Left|Up|Down|Right| + * `-----------------------------------------------------------' + */ + [_BL] = KEYMAP( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + MO(_FL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ + F(0), KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, F(1), F(1), F(1), \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FL), KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT), + +// Function Layer + [_FL] = KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_DEL, \ + KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_CALC, KC_INS, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \ + KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_APP, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_PGDN, KC_END), + +// Left Shift Layer + [_LS] = KEYMAP( + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CAPS, KC_CAPS, KC_CAPS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Right Shift Layer + [_RS] = KEYMAP( + KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + +// Custom Actions +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MODS(_LS, MOD_LSFT), + [1] = ACTION_LAYER_MODS(_RS, MOD_RSFT), +}; -- cgit v1.2.3 From c0a6c5f80601ed040be0adfe183c9b672aa7fa50 Mon Sep 17 00:00:00 2001 From: Nicolas Guelpa Date: Sun, 26 Mar 2017 15:07:19 -0400 Subject: fixing layout --- keyboards/xd60/keymaps/cheese/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keyboards') diff --git a/keyboards/xd60/keymaps/cheese/keymap.c b/keyboards/xd60/keymaps/cheese/keymap.c index 738009304..25919a41f 100644 --- a/keyboards/xd60/keymaps/cheese/keymap.c +++ b/keyboards/xd60/keymaps/cheese/keymap.c @@ -20,7 +20,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------| * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | * |-----------------------------------------------------------| - * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |FUNCTION| A| S| D| F| G| H| J| K| L| ;| '|Return| * |-----------------------------------------------------------| * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | * |-----------------------------------------------------------| -- cgit v1.2.3 From a89ee25db8eb57b902e0fc1a16166d16af0dc721 Mon Sep 17 00:00:00 2001 From: Nicolas Guelpa Date: Sun, 26 Mar 2017 15:16:55 -0400 Subject: Add files via upload --- keyboards/xd60/keymaps/cheese/base_layout.png | Bin 0 -> 23729 bytes keyboards/xd60/keymaps/cheese/fn_layout.png | Bin 0 -> 20690 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 keyboards/xd60/keymaps/cheese/base_layout.png create mode 100644 keyboards/xd60/keymaps/cheese/fn_layout.png (limited to 'keyboards') diff --git a/keyboards/xd60/keymaps/cheese/base_layout.png b/keyboards/xd60/keymaps/cheese/base_layout.png new file mode 100644 index 000000000..211c4c731 Binary files /dev/null and b/keyboards/xd60/keymaps/cheese/base_layout.png differ diff --git a/keyboards/xd60/keymaps/cheese/fn_layout.png b/keyboards/xd60/keymaps/cheese/fn_layout.png new file mode 100644 index 000000000..fe5ae99e0 Binary files /dev/null and b/keyboards/xd60/keymaps/cheese/fn_layout.png differ -- cgit v1.2.3 From a32436d5a16e1092d71b3185f17fda303d8333c6 Mon Sep 17 00:00:00 2001 From: Nicolas Guelpa Date: Sun, 26 Mar 2017 15:20:44 -0400 Subject: Create README.md --- keyboards/xd60/keymaps/cheese/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 keyboards/xd60/keymaps/cheese/README.md (limited to 'keyboards') diff --git a/keyboards/xd60/keymaps/cheese/README.md b/keyboards/xd60/keymaps/cheese/README.md new file mode 100644 index 000000000..8a5b97c03 --- /dev/null +++ b/keyboards/xd60/keymaps/cheese/README.md @@ -0,0 +1,13 @@ +# cheese's Layout +Customized xd60 keymap + +![Base Layout](base_layout.png "Base Layout") +![Fn Layout](fn_layout.png "Fn Layout") + +## Programming Instructions: +`cd` into keymap directory, `make dfu` + +## Features +- Media keys and movement keys setup like on the pok3r +- Lower right movement keys setup like on the fc660m (fn+direction for home/end/page up and down) +- Caps lock can be triggered by pressing both shift keys at the same time (and deactivated the same way) -- cgit v1.2.3 From b6b85ed41397440417106309bcf2b7ef2b617976 Mon Sep 17 00:00:00 2001 From: mattdibi Date: Tue, 28 Mar 2017 09:56:07 +0200 Subject: Added italian layout --- keyboards/ergodox/keymaps/italian/L0.PNG | Bin 0 -> 152470 bytes keyboards/ergodox/keymaps/italian/L1.PNG | Bin 0 -> 130416 bytes keyboards/ergodox/keymaps/italian/L2.PNG | Bin 0 -> 126006 bytes keyboards/ergodox/keymaps/italian/keymap.c | 223 ++++++++++++++++++++++++++++ keyboards/ergodox/keymaps/italian/readme.md | 15 ++ 5 files changed, 238 insertions(+) create mode 100644 keyboards/ergodox/keymaps/italian/L0.PNG create mode 100644 keyboards/ergodox/keymaps/italian/L1.PNG create mode 100644 keyboards/ergodox/keymaps/italian/L2.PNG create mode 100644 keyboards/ergodox/keymaps/italian/keymap.c create mode 100644 keyboards/ergodox/keymaps/italian/readme.md (limited to 'keyboards') diff --git a/keyboards/ergodox/keymaps/italian/L0.PNG b/keyboards/ergodox/keymaps/italian/L0.PNG new file mode 100644 index 000000000..491a4f388 Binary files /dev/null and b/keyboards/ergodox/keymaps/italian/L0.PNG differ diff --git a/keyboards/ergodox/keymaps/italian/L1.PNG b/keyboards/ergodox/keymaps/italian/L1.PNG new file mode 100644 index 000000000..17c5ffc67 Binary files /dev/null and b/keyboards/ergodox/keymaps/italian/L1.PNG differ diff --git a/keyboards/ergodox/keymaps/italian/L2.PNG b/keyboards/ergodox/keymaps/italian/L2.PNG new file mode 100644 index 000000000..c0aa9e9d3 Binary files /dev/null and b/keyboards/ergodox/keymaps/italian/L2.PNG differ diff --git a/keyboards/ergodox/keymaps/italian/keymap.c b/keyboards/ergodox/keymaps/italian/keymap.c new file mode 100644 index 000000000..e4c7a569c --- /dev/null +++ b/keyboards/ergodox/keymaps/italian/keymap.c @@ -0,0 +1,223 @@ +#include "ergodox.h" +#include "debug.h" +#include "action_layer.h" +#include "version.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + EPRM, + VRSN, + RGB_SLD +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | \ | 1 | 2 | 3 | 4 | 5 | ESC | | T2 | 6 | 7 | 8 | 9 | 0 | ' | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | TT1 | | TT1 | Y | U | I | O | P | è | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Caps | A | S | D | F | G |------| |------| H | J | K | L | ò | à | + * |--------+------+------+------+------+------| Alt | | Alt |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | ù |-/RShift| + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + break; + case 1: + if (record->event.pressed) { // For resetting EEPROM + eeconfig_init(); + } + break; + } + return MACRO_NONE; +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // dynamically generate these. + case EPRM: + if (record->event.pressed) { + eeconfig_init(); + } + return false; + break; + case VRSN: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + case RGB_SLD: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode(1); + #endif + } + return false; + break; + } + return true; +} + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodox/keymaps/italian/readme.md b/keyboards/ergodox/keymaps/italian/readme.md new file mode 100644 index 000000000..979ce0f5b --- /dev/null +++ b/keyboards/ergodox/keymaps/italian/readme.md @@ -0,0 +1,15 @@ +# ErgoDox EZ Default Configuration + +## Changelog + +* Dec 2016: + * Added LED keys + * Refreshed layout graphic, comes from http://configure.ergodox-ez.com now. +* Sep 22, 2016: + * Created a new key in layer 1 (bottom-corner key) that resets the EEPROM. +* Feb 2, 2016 (V1.1): + * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows). + +This is what we ship with out of the factory. :) The image says it all: + +![Default](default_firmware_v1.2-2.png) -- cgit v1.2.3 From 512eb5e1d5edd39e3e46f8201b57d8fd17084408 Mon Sep 17 00:00:00 2001 From: mattdibi Date: Tue, 28 Mar 2017 10:10:24 +0200 Subject: Updated readme --- keyboards/ergodox/keymaps/italian/readme.md | 79 +++++++++++++++++++++++++---- 1 file changed, 68 insertions(+), 11 deletions(-) (limited to 'keyboards') diff --git a/keyboards/ergodox/keymaps/italian/readme.md b/keyboards/ergodox/keymaps/italian/readme.md index 979ce0f5b..f9d012135 100644 --- a/keyboards/ergodox/keymaps/italian/readme.md +++ b/keyboards/ergodox/keymaps/italian/readme.md @@ -1,15 +1,72 @@ -# ErgoDox EZ Default Configuration +# ErgoDox Italian layout -## Changelog +## Layer 0 +```sh + + ,--------------------------------------------------. ,--------------------------------------------------. + | \ | 1 | 2 | 3 | 4 | 5 | ESC | | T2 | 6 | 7 | 8 | 9 | 0 | ' | + |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + | Tab | Q | W | E | R | T | TT1 | | TT1 | Y | U | I | O | P | è | + |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + | Caps | A | S | D | F | G |------| |------| H | J | K | L | ò | à | + |--------+------+------+------+------+------| Alt | | Alt |------+------+------+------+------+--------| + | LShift | Z | X | C | V | B | | | | N | M | , | . | ù |-/RShift| + `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | 0 bytes keyboards/ergodox/keymaps/italian/L1.PNG | Bin 130416 -> 0 bytes keyboards/ergodox/keymaps/italian/L2.PNG | Bin 126006 -> 0 bytes 3 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 keyboards/ergodox/keymaps/italian/L0.PNG delete mode 100644 keyboards/ergodox/keymaps/italian/L1.PNG delete mode 100644 keyboards/ergodox/keymaps/italian/L2.PNG (limited to 'keyboards') diff --git a/keyboards/ergodox/keymaps/italian/L0.PNG b/keyboards/ergodox/keymaps/italian/L0.PNG deleted file mode 100644 index 491a4f388..000000000 Binary files a/keyboards/ergodox/keymaps/italian/L0.PNG and /dev/null differ diff --git a/keyboards/ergodox/keymaps/italian/L1.PNG b/keyboards/ergodox/keymaps/italian/L1.PNG deleted file mode 100644 index 17c5ffc67..000000000 Binary files a/keyboards/ergodox/keymaps/italian/L1.PNG and /dev/null differ diff --git a/keyboards/ergodox/keymaps/italian/L2.PNG b/keyboards/ergodox/keymaps/italian/L2.PNG deleted file mode 100644 index c0aa9e9d3..000000000 Binary files a/keyboards/ergodox/keymaps/italian/L2.PNG and /dev/null differ -- cgit v1.2.3 From 71857ebc3f410b918481f4a6bbed93f1cb2eec65 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Tue, 28 Mar 2017 09:17:09 -0400 Subject: Move Atreus50 to hardwired directory and update README --- keyboards/atreus50/Makefile | 3 - keyboards/atreus50/atreus50.c | 10 - keyboards/atreus50/atreus50.h | 36 --- keyboards/atreus50/config.h | 163 -------------- keyboards/atreus50/keymaps/default/Makefile | 6 - keyboards/atreus50/keymaps/default/keymap.c | 250 --------------------- keyboards/atreus50/readme.md | 25 --- keyboards/atreus50/rules.mk | 81 ------- keyboards/handwired/atreus50/Makefile | 3 + keyboards/handwired/atreus50/atreus50.c | 10 + keyboards/handwired/atreus50/atreus50.h | 36 +++ keyboards/handwired/atreus50/config.h | 163 ++++++++++++++ .../handwired/atreus50/keymaps/default/Makefile | 6 + .../handwired/atreus50/keymaps/default/keymap.c | 250 +++++++++++++++++++++ keyboards/handwired/atreus50/readme.md | 16 ++ keyboards/handwired/atreus50/rules.mk | 81 +++++++ 16 files changed, 565 insertions(+), 574 deletions(-) delete mode 100644 keyboards/atreus50/Makefile delete mode 100644 keyboards/atreus50/atreus50.c delete mode 100644 keyboards/atreus50/atreus50.h delete mode 100644 keyboards/atreus50/config.h delete mode 100644 keyboards/atreus50/keymaps/default/Makefile delete mode 100644 keyboards/atreus50/keymaps/default/keymap.c delete mode 100644 keyboards/atreus50/readme.md delete mode 100644 keyboards/atreus50/rules.mk create mode 100644 keyboards/handwired/atreus50/Makefile create mode 100644 keyboards/handwired/atreus50/atreus50.c create mode 100644 keyboards/handwired/atreus50/atreus50.h create mode 100644 keyboards/handwired/atreus50/config.h create mode 100644 keyboards/handwired/atreus50/keymaps/default/Makefile create mode 100644 keyboards/handwired/atreus50/keymaps/default/keymap.c create mode 100644 keyboards/handwired/atreus50/readme.md create mode 100644 keyboards/handwired/atreus50/rules.mk (limited to 'keyboards') diff --git a/keyboards/atreus50/Makefile b/keyboards/atreus50/Makefile deleted file mode 100644 index 57b2ef62e..000000000 --- a/keyboards/atreus50/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -ifndef MAKEFILE_INCLUDED - include ../../Makefile -endif diff --git a/keyboards/atreus50/atreus50.c b/keyboards/atreus50/atreus50.c deleted file mode 100644 index 225a51bcc..000000000 --- a/keyboards/atreus50/atreus50.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "atreus50.h" - -void matrix_init_kb(void) { - - // Turn status LED on - //DDRE |= (1<<6); - PORTE |= (1<<6); - - matrix_init_user(); -}; diff --git a/keyboards/atreus50/atreus50.h b/keyboards/atreus50/atreus50.h deleted file mode 100644 index de06f255e..000000000 --- a/keyboards/atreus50/atreus50.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef ATREUS50_H -#define ATREUS50_H - -#include "quantum.h" - -// The first section contains all of the arguements -// The second converts the arguments into a two-dimensional array -#define KEYMAP( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, km0, km1, k36, k37, k38, k39, k3a, k3b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05, KC_NO, k06, k07, k08, k09, k0a, k0b }, \ - { k10, k11, k12, k13, k14, k15, KC_NO, k16, k17, k18, k19, k1a, k1b }, \ - { k20, k21, k22, k23, k24, k25, km0, k26, k27, k28, k29, k2a, k2b }, \ - { k30, k31, k32, k33, k34, k35, km1, k36, k37, k38, k39, k3a, k3b } \ -} - -#define COMPACT_KEYMAP( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, km0, km1, k36, k37, k38, k39, k3a, k3b \ -) \ -{ \ - { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_NO, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b }, \ - { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_NO, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b }, \ - { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##km0, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b }, \ - { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##km1, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b } \ -} - -#define KC_ KC_TRNS - -#endif diff --git a/keyboards/atreus50/config.h b/keyboards/atreus50/config.h deleted file mode 100644 index 2e34e0f89..000000000 --- a/keyboards/atreus50/config.h +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright 2012 Jun Wako - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xBB80 -#define PRODUCT_ID 0x040D -#define DEVICE_VER 0x0001 -#define MANUFACTURER Hexwire -#define PRODUCT Atreus 50 Keyboard -#define DESCRIPTION Atreus layout with extra column - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 13 - -/* Planck PCB default pin-out */ -#define MATRIX_ROW_PINS { D3, D2, D1, D0 } -#define MATRIX_COL_PINS { D4, D7, E6, B4, B5, B6, B2, B3, B1, F7, F6, F5, F4 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE -/* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE - - -/* ws2812 RGB LED */ -#define RGB_DI_PIN C6 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 12 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 - - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* disable action features */ -//#define NO_ACTION_LAYER -//#define NO_ACTION_TAPPING -//#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/atreus50/keymaps/default/Makefile b/keyboards/atreus50/keymaps/default/Makefile deleted file mode 100644 index d7b0fa7fd..000000000 --- a/keyboards/atreus50/keymaps/default/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -RGBLIGHT_ENABLE = yes -AUDIO_ENABLE = no - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/atreus50/keymaps/default/keymap.c b/keyboards/atreus50/keymaps/default/keymap.c deleted file mode 100644 index 415405ec2..000000000 --- a/keyboards/atreus50/keymaps/default/keymap.c +++ /dev/null @@ -1,250 +0,0 @@ -#include "atreus50.h" -#include "action_layer.h" -#include "eeconfig.h" -#ifdef AUDIO_ENABLE - #include "audio.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. -// Layer names don't all need to be of the same length, obviously, and you can also skip them -// entirely and just use numbers. -#define _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _MOVEMENT 5 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - MOVEMENT, - BACKLIT -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_X0 MT(MOD_LCTL, KC_ESC) // Hold for Left Ctrl, Tap for ESC -#define KC_X1 LOWER -#define KC_X2 RAISE -#define KC_X3 MO(_MOVEMENT) -#define KC_X4 MT(MOD_LSFT, KC_ENT) // Hold for Left Shift, Tap for Enter - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' - ), - - [_COLEMAK] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , R , S , T , D , H , N , E , I , O ,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH, X4 , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' - ), - - [_DVORAK] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , O , E , U , I , D , H , R , N , S ,SLSH, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' - ), - - [_LOWER] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL , F1 , F2 , F3 , F4 , F5 , F6 ,UNDS,PLUS,LCBR,RCBR,PIPE, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , F7 , F8 , F9 ,F10 ,F11 , F12 ,END , , , , , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - , , , , , , , , , ,MNXT,VOLD,VOLU,MPLY - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' - ), - - [_RAISE] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,EQL ,LBRC,RBRC,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , F7 , F8 , F9 ,F10 ,F11 , F12 ,NUHS,NUBS, , , , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - , , , , , , , , , ,MNXT,VOLD,VOLU,MPLY - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' - ), - - [_MOVEMENT] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR, UP ,LPRN,RPRN,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL , F1 , F2 , F3 , F4 , F5 , F6 ,LEFT,DOWN,RGHT,RCBR,PIPE, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , F7 , F8 , F9 ,F10 ,F11 , F12 ,END , , , , , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - , , , , , , , ,PGDN,PGUP,MNXT,VOLD,VOLU,MPLY - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' - ), - -/* Adjust (Lower + Raise) - * |------+------+------+------+------+------. ,------+------+------+------+------+------| - * | | Reset| | | | | | | | | | | Del | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | |Audoff|Aud on|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | |Voice-|Voice+|Musoff|Mus on| | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | - * `-------------------------------------------------------------------------------------------------' - */ - [_ADJUST] = KEYMAP( \ - _______, RESET, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ) - -}; - -#ifdef AUDIO_ENABLE -float tone_startup[][2] = { - {NOTE_B5, 20}, - {NOTE_B6, 8}, - {NOTE_DS6, 20}, - {NOTE_B6, 8} -}; - -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); - -float tone_goodbye[][2] = SONG(GOODBYE_SOUND); - -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); -#endif - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_qwerty, false, 0); - #endif - persistant_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_colemak, false, 0); - #endif - persistant_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_dvorak, false, 0); - #endif - persistant_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - return false; - break; - } - return true; -}; - -void matrix_init_user(void) { - #ifdef AUDIO_ENABLE - startup_user(); - #endif -} - -#ifdef AUDIO_ENABLE - -void startup_user() -{ - _delay_ms(20); // gets rid of tick - PLAY_NOTE_ARRAY(tone_startup, false, 0); -} - -void shutdown_user() -{ - PLAY_NOTE_ARRAY(tone_goodbye, false, 0); - _delay_ms(150); - stop_all_notes(); -} - -void music_on_user(void) -{ - music_scale_user(); -} - -void music_scale_user(void) -{ - PLAY_NOTE_ARRAY(music_scale, false, 0); -} - -#endif diff --git a/keyboards/atreus50/readme.md b/keyboards/atreus50/readme.md deleted file mode 100644 index f0be255a0..000000000 --- a/keyboards/atreus50/readme.md +++ /dev/null @@ -1,25 +0,0 @@ -Preonic keyboard firmware -====================== -DIY/Assembled compact ortholinear 50% keyboard by [Ortholinear Keyboards](http://ortholinearkeyboards.com). - -## Quantum MK Firmware - -For the full Quantum feature list, see [the parent readme.md](/readme.md). - -## Building - -Download or clone the whole firmware and navigate to the keyboards/preonic folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use `make dfu` to program your PCB once you hit the reset button. - -Depending on which keymap you would like to use, you will have to compile slightly differently. - -### Default -To build with the default keymap, simply run `make`. - -### Other Keymaps -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap, create a file in the keymaps folder named `.c` and see keymap document (you can find in top readme.md) and existent keymap files. - -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: -``` -$ make KEYMAP=[default|jack|] -``` -Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/atreus50/rules.mk b/keyboards/atreus50/rules.mk deleted file mode 100644 index 7770ea2a2..000000000 --- a/keyboards/atreus50/rules.mk +++ /dev/null @@ -1,81 +0,0 @@ - - -# MCU name -#MCU = at90usb1287 -MCU = atmega32u4 - -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# change to "no" to disable the options, or define them in the Makefile in -# the appropriate keymap folder that will get included automatically -# -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= yes # Commands for debug and configuration -NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality -MIDI_ENABLE ?= no # MIDI controls -AUDIO_ENABLE ?= no # Audio output on port C6 -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend - -avrdude: build - ls /dev/tty* > /tmp/1; \ - echo "Reset your Pro Micro now"; \ - while [[ -z $$USB ]]; do \ - sleep 1; \ - ls /dev/tty* > /tmp/2; \ - USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \ - done; \ - avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex - -.PHONY: avrdude diff --git a/keyboards/handwired/atreus50/Makefile b/keyboards/handwired/atreus50/Makefile new file mode 100644 index 000000000..57b2ef62e --- /dev/null +++ b/keyboards/handwired/atreus50/Makefile @@ -0,0 +1,3 @@ +ifndef MAKEFILE_INCLUDED + include ../../Makefile +endif diff --git a/keyboards/handwired/atreus50/atreus50.c b/keyboards/handwired/atreus50/atreus50.c new file mode 100644 index 000000000..225a51bcc --- /dev/null +++ b/keyboards/handwired/atreus50/atreus50.c @@ -0,0 +1,10 @@ +#include "atreus50.h" + +void matrix_init_kb(void) { + + // Turn status LED on + //DDRE |= (1<<6); + PORTE |= (1<<6); + + matrix_init_user(); +}; diff --git a/keyboards/handwired/atreus50/atreus50.h b/keyboards/handwired/atreus50/atreus50.h new file mode 100644 index 000000000..de06f255e --- /dev/null +++ b/keyboards/handwired/atreus50/atreus50.h @@ -0,0 +1,36 @@ +#ifndef ATREUS50_H +#define ATREUS50_H + +#include "quantum.h" + +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define KEYMAP( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, km0, km1, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, KC_NO, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, KC_NO, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, km0, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, km1, k36, k37, k38, k39, k3a, k3b } \ +} + +#define COMPACT_KEYMAP( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, km0, km1, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_NO, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b }, \ + { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_NO, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b }, \ + { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##km0, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b }, \ + { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##km1, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b } \ +} + +#define KC_ KC_TRNS + +#endif diff --git a/keyboards/handwired/atreus50/config.h b/keyboards/handwired/atreus50/config.h new file mode 100644 index 000000000..2e34e0f89 --- /dev/null +++ b/keyboards/handwired/atreus50/config.h @@ -0,0 +1,163 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xBB80 +#define PRODUCT_ID 0x040D +#define DEVICE_VER 0x0001 +#define MANUFACTURER Hexwire +#define PRODUCT Atreus 50 Keyboard +#define DESCRIPTION Atreus layout with extra column + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 13 + +/* Planck PCB default pin-out */ +#define MATRIX_ROW_PINS { D3, D2, D1, D0 } +#define MATRIX_COL_PINS { D4, D7, E6, B4, B5, B6, B2, B3, B1, F7, F6, F5, F4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + + +/* ws2812 RGB LED */ +#define RGB_DI_PIN C6 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +#endif diff --git a/keyboards/handwired/atreus50/keymaps/default/Makefile b/keyboards/handwired/atreus50/keymaps/default/Makefile new file mode 100644 index 000000000..d7b0fa7fd --- /dev/null +++ b/keyboards/handwired/atreus50/keymaps/default/Makefile @@ -0,0 +1,6 @@ +RGBLIGHT_ENABLE = yes +AUDIO_ENABLE = no + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/handwired/atreus50/keymaps/default/keymap.c b/keyboards/handwired/atreus50/keymaps/default/keymap.c new file mode 100644 index 000000000..415405ec2 --- /dev/null +++ b/keyboards/handwired/atreus50/keymaps/default/keymap.c @@ -0,0 +1,250 @@ +#include "atreus50.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef AUDIO_ENABLE + #include "audio.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. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _MOVEMENT 5 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + MOVEMENT, + BACKLIT +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +#define KC_X0 MT(MOD_LCTL, KC_ESC) // Hold for Left Ctrl, Tap for ESC +#define KC_X1 LOWER +#define KC_X2 RAISE +#define KC_X3 MO(_MOVEMENT) +#define KC_X4 MT(MOD_LSFT, KC_ENT) // Hold for Left Shift, Tap for Enter + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = COMPACT_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , + //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| + GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + ), + + [_COLEMAK] = COMPACT_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X0 , A , R , S , T , D , H , N , E , I , O ,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH, X4 , + //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| + GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + ), + + [_DVORAK] = COMPACT_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + X0 , A , O , E , U , I , D , H , R , N , S ,SLSH, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , + //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| + GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT + //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + ), + + [_LOWER] = COMPACT_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL , F1 , F2 , F3 , F4 , F5 , F6 ,UNDS,PLUS,LCBR,RCBR,PIPE, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , F7 , F8 , F9 ,F10 ,F11 , F12 ,END , , , , , + //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| + , , , , , , , , , ,MNXT,VOLD,VOLU,MPLY + //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + ), + + [_RAISE] = COMPACT_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,EQL ,LBRC,RBRC,BSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , F7 , F8 , F9 ,F10 ,F11 , F12 ,NUHS,NUBS, , , , + //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| + , , , , , , , , , ,MNXT,VOLD,VOLU,MPLY + //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + ), + + [_MOVEMENT] = COMPACT_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR, UP ,LPRN,RPRN,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL , F1 , F2 , F3 , F4 , F5 , F6 ,LEFT,DOWN,RGHT,RCBR,PIPE, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , F7 , F8 , F9 ,F10 ,F11 , F12 ,END , , , , , + //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| + , , , , , , , ,PGDN,PGUP,MNXT,VOLD,VOLU,MPLY + //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + ), + +/* Adjust (Lower + Raise) + * |------+------+------+------+------+------. ,------+------+------+------+------+------| + * | | Reset| | | | | | | | | | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |Audoff|Aud on|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |Voice-|Voice+|Musoff|Mus on| | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + _______, RESET, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) + +}; + +#ifdef AUDIO_ENABLE +float tone_startup[][2] = { + {NOTE_B5, 20}, + {NOTE_B6, 8}, + {NOTE_DS6, 20}, + {NOTE_B6, 8} +}; + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); + +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_colemak, false, 0); + #endif + persistant_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_dvorak, false, 0); + #endif + persistant_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +}; + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} + +#endif diff --git a/keyboards/handwired/atreus50/readme.md b/keyboards/handwired/atreus50/readme.md new file mode 100644 index 000000000..0c24f67db --- /dev/null +++ b/keyboards/handwired/atreus50/readme.md @@ -0,0 +1,16 @@ +Handwired Atreus50 +================== + +This firmware is for a Handwired Atreus50 using an Arduino Pro Micro. + +## Pinout + +The following pins are used: +- Columns 1-13: D4, D7, E6, B4, B5, B6, B2, B3, B1, F7, F6, F5, F4 +- Rows 1-4: D3, D2, D1, D0 + +## Compiling and loading the firmware + +To build the firmware, run `make`. + +To flash the firemware onto the microcontroller, run `make avrdude`, and press the reset button. diff --git a/keyboards/handwired/atreus50/rules.mk b/keyboards/handwired/atreus50/rules.mk new file mode 100644 index 000000000..7770ea2a2 --- /dev/null +++ b/keyboards/handwired/atreus50/rules.mk @@ -0,0 +1,81 @@ + + +# MCU name +#MCU = at90usb1287 +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= yes # Commands for debug and configuration +NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality +MIDI_ENABLE ?= no # MIDI controls +AUDIO_ENABLE ?= no # Audio output on port C6 +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend + +avrdude: build + ls /dev/tty* > /tmp/1; \ + echo "Reset your Pro Micro now"; \ + while [[ -z $$USB ]]; do \ + sleep 1; \ + ls /dev/tty* > /tmp/2; \ + USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \ + done; \ + avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex + +.PHONY: avrdude -- cgit v1.2.3