commit
cbcf0abe62
@ -0,0 +1,157 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#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 Ortholinear Keyboards
|
||||
#define PRODUCT The Atomic Keyboard
|
||||
#define DESCRIPTION A compact ortholinear keyboard
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 15
|
||||
|
||||
/*
|
||||
* 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 COLS (int []){ F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7, D3, D2, D1 }
|
||||
#define ROWS (int []){ D0, D5, B5, B6, B3 }
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCE 5
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* 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 B
|
||||
//#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
|
@ -0,0 +1,457 @@
|
||||
#include "atomic.h"
|
||||
#include "action_layer.h"
|
||||
#include "eeconfig.h"
|
||||
#include "led.h"
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
#include "audio.h"
|
||||
#include "song_list.h"
|
||||
#endif
|
||||
|
||||
#define LAYER_QWERTY 0
|
||||
#define LAYER_COLEMAK 1
|
||||
#define LAYER_DVORAK 2
|
||||
#define LAYER_LOWER 3
|
||||
#define LAYER_RAISE 4
|
||||
#define LAYER_ADJUST 5
|
||||
#define LAYER_FUNCTION 6
|
||||
#define LAYER_MUSIC 7
|
||||
|
||||
#define MACRO_QWERTY 0
|
||||
#define MACRO_COLEMAK 1
|
||||
#define MACRO_DVORAK 2
|
||||
#define MACRO_LOWER 3
|
||||
#define MACRO_RAISE 4
|
||||
#define MACRO_FUNCTION 5
|
||||
#define MACRO_TIMBRE_1 6
|
||||
#define MACRO_TIMBRE_2 7
|
||||
#define MACRO_TIMBRE_3 8
|
||||
#define MACRO_TIMBRE_4 9
|
||||
#define MACRO_TEMPO_U 10
|
||||
#define MACRO_TEMPO_D 11
|
||||
#define MACRO_TONE_DEFAULT 12
|
||||
#define MACRO_MUSIC_ON 13
|
||||
#define MACRO_MUSIC_OFF 14
|
||||
#define MACRO_AUDIO_ON 15
|
||||
#define MACRO_AUDIO_OFF 16
|
||||
|
||||
#define M_QWRTY M(MACRO_QWERTY)
|
||||
#define M_COLMK M(MACRO_COLEMAK)
|
||||
#define M_DVORK M(MACRO_DVORAK)
|
||||
#define M_LOWER M(MACRO_LOWER)
|
||||
#define M_RAISE M(MACRO_RAISE)
|
||||
#define M_FUNCT M(MACRO_FUNCTION)
|
||||
#define TIMBR_1 M(MACRO_TIMBRE_1)
|
||||
#define TIMBR_2 M(MACRO_TIMBRE_2)
|
||||
#define TIMBR_3 M(MACRO_TIMBRE_3)
|
||||
#define TIMBR_4 M(MACRO_TIMBRE_4)
|
||||
#define TMPO_UP M(MACRO_TEMPO_U)
|
||||
#define TMPO_DN M(MACRO_TEMPO_D)
|
||||
#define TMPO_DF M(MACRO_TONE_DEFAULT)
|
||||
|
||||
|
||||
#define MUS_ON M(MACRO_MUSIC_ON)
|
||||
#define MUS_OFF M(MACRO_MUSIC_OFF)
|
||||
#define AUD_OFF M(MACRO_AUDIO_OFF)
|
||||
#define AUD_ON M(MACRO_AUDIO_ON)
|
||||
|
||||
|
||||
#define _______ KC_TRNS
|
||||
#define ___T___ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
/* QWERTY
|
||||
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
|
||||
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | DEL |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
|
||||
* | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | XXXXXX . ENTER | PG UP |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
|
||||
* | LSHIFT | Z | X | C | V | B | N | M | , | . | / | XXXXXX . RSHIFT | UP | PG DN |
|
||||
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
|
||||
* | LCTRL | LWIN | FN | LALT | RAISED | XXXXXX . SPACE | LOWER | RALT | HOME | END | RCTRL | LEFT | DOWN | RIGHT |
|
||||
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[LAYER_QWERTY] = { /* QWERTY */
|
||||
{ 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, XXXXXXX },
|
||||
{ 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_DEL },
|
||||
{ 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, XXXXXXX, KC_PGUP },
|
||||
{ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, KC_UP, KC_PGDN },
|
||||
{ KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_RAISE, KC_SPC, XXXXXXX, M_LOWER, KC_RALT, KC_HOME, KC_END, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT },
|
||||
},
|
||||
|
||||
/* COLEMAK
|
||||
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
|
||||
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||
* | TAB | Q | W | F | P | G | J | L | U | Y | ; | [ | ] | \ | DEL |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
|
||||
* | CAPS | A | R | S | T | D | H | N | E | I | O | ' | XXXXXX . ENTER | PG UP |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
|
||||
* | LSHIFT | Z | X | C | V | B | K | M | , | . | / | XXXXXX . RSHIFT | UP | PG DN |
|
||||
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
|
||||
* | LCTRL | LWIN | FN | LALT | RAISED | XXXXXX . SPACE | LOWER | RALT | HOME | END | RCTRL | LEFT | DOWN | RIGHT |
|
||||
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
[LAYER_COLEMAK] = { /* COLEMAK */
|
||||
{ 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_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL },
|
||||
{ KC_CAPS, 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_ENT, KC_PGUP },
|
||||
{ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN },
|
||||
{ KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_RAISE, KC_SPC, XXXXXXX, M_LOWER, KC_RALT, KC_HOME, KC_END, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT },
|
||||
},
|
||||
|
||||
/* DVORAK
|
||||
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
|
||||
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||
* | TAB | ' | , | . | P | Y | F | G | C | R | L | [ | ] | \ | DEL |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
|
||||
* | CAPS | A | O | E | U | I | D | H | T | N | S | / | XXXXXX . ENTER | PG UP |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
|
||||
* | LSHIFT | ; | Q | J | K | X | B | M | W | V | Z | XXXXXX . RSHIFT | UP | PG DN |
|
||||
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
|
||||
* | LCTRL | LWIN | FN | LALT | RAISED | XXXXXX . SPACE | LOWER | RALT | HOME | END | RCTRL | LEFT | DOWN | RIGHT |
|
||||
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
[LAYER_DVORAK] = { /* DVORAK */
|
||||
{ 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_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL },
|
||||
{ KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, KC_ENT, KC_ENT, KC_PGUP },
|
||||
{ KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN },
|
||||
{ KC_LCTL, KC_LGUI, M_FUNCT, KC_LALT, M_RAISE, KC_SPC, XXXXXXX, M_LOWER, KC_RALT, KC_HOME, KC_END, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT },
|
||||
},
|
||||
|
||||
|
||||
[LAYER_LOWER] = { /* LOWERED */
|
||||
{ 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, ___T___, ___T___ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______, _______ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
|
||||
},
|
||||
|
||||
[LAYER_RAISE] = { /* RAISED */
|
||||
{ KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___, ___T___ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______, _______ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
|
||||
},
|
||||
|
||||
[LAYER_FUNCTION] = { /* FUNCTION */
|
||||
{ KC_NLCK, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___, ___T___ },
|
||||
{ KC_SLCK, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_PAUS, KC_PSCR },
|
||||
{ KC_CAPS, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_ACL0, KC_ACL2, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, ___T___, ___T___, KC_WH_U },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D },
|
||||
{ _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R },
|
||||
},
|
||||
|
||||
[LAYER_ADJUST] = { /* ADJUST */
|
||||
{ _______, TIMBR_1, TIMBR_2, TIMBR_3, TIMBR_4, TMPO_UP, TMPO_DN, TMPO_DF, _______, MUS_ON, MUS_OFF, AUD_ON, AUD_OFF, ___T___, ___T___ },
|
||||
{ _______, M_QWRTY, M_COLMK, M_DVORK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______ },
|
||||
{ _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, ___T___, ___T___, _______, _______ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
|
||||
},
|
||||
|
||||
[LAYER_MUSIC] = {
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______, _______ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
|
||||
},
|
||||
};
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
|
||||
float tone_my_startup[][2] = SONG(ODE_TO_JOY);
|
||||
float tone_my_goodbye[][2] = SONG(ROCK_A_BYE_BABY);
|
||||
|
||||
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
||||
float tone_dvorak[][2] = SONG(COLEMAK_SOUND);
|
||||
float tone_colemak[][2] = SONG(DVORAK_SOUND);
|
||||
|
||||
float tone_audio_on[][2] = SONG(CLOSE_ENCOUNTERS_5_NOTE);
|
||||
float tone_music_on[][2] = SONG(DOE_A_DEER);
|
||||
float tone_caps_on[][2] = SONG(CAPS_LOCK_ON_SOUND);
|
||||
float tone_caps_off[][2] = SONG(CAPS_LOCK_OFF_SOUND);
|
||||
float tone_numlk_on[][2] = SONG(NUM_LOCK_ON_SOUND);
|
||||
float tone_numlk_off[][2] = SONG(NUM_LOCK_OFF_SOUND);
|
||||
float tone_scroll_on[][2] = SONG(SCROLL_LOCK_ON_SOUND);
|
||||
float tone_scroll_off[][2] = SONG(SCROLL_LOCK_OFF_SOUND);
|
||||
|
||||
#endif /* AUDIO_ENABLE */
|
||||
|
||||
/*
|
||||
void update_quad_layer(uint8_t layer1, uint8_t layer2, uint8_t layer3, uint8_t layer4, bool order)
|
||||
{
|
||||
if (order)
|
||||
{
|
||||
if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2))
|
||||
{
|
||||
layer_on(layer3);
|
||||
}
|
||||
else
|
||||
{
|
||||
layer_off(layer3);
|
||||
layer_off(layer4);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2))
|
||||
{
|
||||
layer_on(layer4);
|
||||
}
|
||||
else
|
||||
{
|
||||
layer_off(layer3);
|
||||
layer_off(layer4);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void persistant_default_layer_set(uint16_t default_layer)
|
||||
{
|
||||
eeconfig_write_default_layer(default_layer);
|
||||
default_layer_set(default_layer);
|
||||
}
|
||||
|
||||
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 MACRO_QWERTY:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
persistant_default_layer_set(1UL<<LAYER_QWERTY);
|
||||
PLAY_NOTE_ARRAY(tone_qwerty, false, STACCATO);
|
||||
}
|
||||
break;
|
||||
|
||||
case MACRO_COLEMAK:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
persistant_default_layer_set(1UL<<LAYER_COLEMAK);
|
||||
PLAY_NOTE_ARRAY(tone_colemak, false, STACCATO);
|
||||
}
|
||||
break;
|
||||
|
||||
case MACRO_DVORAK:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
persistant_default_layer_set(1UL<<LAYER_DVORAK);
|
||||
PLAY_NOTE_ARRAY(tone_dvorak, false, STACCATO);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case MACRO_LOWER:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
layer_on(LAYER_LOWER);
|
||||
update_tri_layer(LAYER_LOWER, LAYER_RAISE, LAYER_ADJUST);
|
||||
}
|
||||
else
|
||||
{
|
||||
layer_off(LAYER_LOWER);
|
||||
update_tri_layer(LAYER_LOWER, LAYER_RAISE, LAYER_ADJUST);
|
||||
}
|
||||
break;
|
||||
|
||||
case MACRO_RAISE:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
layer_on(LAYER_RAISE);
|
||||
update_tri_layer(LAYER_LOWER, LAYER_RAISE, LAYER_ADJUST);
|
||||
}
|
||||
else
|
||||
{
|
||||
layer_off(LAYER_RAISE);
|
||||
update_tri_layer(LAYER_LOWER, LAYER_RAISE, LAYER_ADJUST);
|
||||
}
|
||||
break;
|
||||
|
||||
case MACRO_FUNCTION:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
layer_on(LAYER_FUNCTION);
|
||||
}
|
||||
else
|
||||
{
|
||||
layer_off(LAYER_FUNCTION);
|
||||
}
|
||||
break;
|
||||
|
||||
case MACRO_TIMBRE_1:
|
||||
if (record->event.pressed) set_timbre(TIMBRE_12);
|
||||
break;
|
||||
|
||||
case MACRO_TIMBRE_2:
|
||||
if (record->event.pressed) set_timbre(TIMBRE_25);
|
||||
break;
|
||||
|
||||
case MACRO_TIMBRE_3:
|
||||
if (record->event.pressed) set_timbre(TIMBRE_50);
|
||||
break;
|
||||
|
||||
case MACRO_TIMBRE_4:
|
||||
if (record->event.pressed) set_timbre(TIMBRE_75);
|
||||
break;
|
||||
|
||||
case MACRO_TEMPO_U:
|
||||
if (record->event.pressed) increase_tempo(10);
|
||||
break;
|
||||
|
||||
case MACRO_TEMPO_D:
|
||||
if (record->event.pressed) decrease_tempo(10);
|
||||
break;
|
||||
|
||||
case MACRO_TONE_DEFAULT:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
set_timbre(TIMBRE_DEFAULT);
|
||||
set_tempo(TEMPO_DEFAULT);
|
||||
}
|
||||
break;
|
||||
|
||||
case MACRO_AUDIO_OFF:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
#ifdef AUDIO_ENABLE
|
||||
audio_off();
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
case MACRO_AUDIO_ON:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
#ifdef AUDIO_ENABLE
|
||||
audio_on();
|
||||
PLAY_NOTE_ARRAY(tone_audio_on, false, STACCATO);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
case MACRO_MUSIC_ON:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_music_on, false, STACCATO);
|
||||
layer_on(LAYER_MUSIC);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
case MACRO_MUSIC_OFF:
|
||||
if (record->event.pressed)
|
||||
{
|
||||
#ifdef AUDIO_ENABLE
|
||||
layer_off(LAYER_MUSIC);
|
||||
stop_all_notes();
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
|
||||
uint8_t starting_note = 0x0C;
|
||||
int offset = 7;
|
||||
|
||||
|
||||
void process_action_user(keyrecord_t *record)
|
||||
{
|
||||
if (IS_LAYER_ON(LAYER_MUSIC))
|
||||
{
|
||||
if (record->event.pressed)
|
||||
{
|
||||
play_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)), 0xF);
|
||||
}
|
||||
else
|
||||
{
|
||||
stop_note(((double)220.0)*pow(2.0, -4.0)*pow(2.0,(starting_note + SCALE[record->event.key.col + offset])/12.0+(MATRIX_ROWS - record->event.key.row)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void matrix_init_user(void)
|
||||
{
|
||||
init_notes();
|
||||
play_startup_tone();
|
||||
println("Matrix Init");
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led)
|
||||
{
|
||||
static uint8_t old_usb_led = 0;
|
||||
|
||||
if ((usb_led & (1<<USB_LED_CAPS_LOCK)) && !(old_usb_led & (1<<USB_LED_CAPS_LOCK)))
|
||||
{
|
||||
// If CAPS LK LED is turning on...
|
||||
PLAY_NOTE_ARRAY(tone_caps_on, false, LEGATO);
|
||||
}
|
||||
else if (!(usb_led & (1<<USB_LED_CAPS_LOCK)) && (old_usb_led & (1<<USB_LED_CAPS_LOCK)))
|
||||
{
|
||||
// If CAPS LK LED is turning off...
|
||||
PLAY_NOTE_ARRAY(tone_caps_off, false, LEGATO);
|
||||
}
|
||||
else if ((usb_led & (1<<USB_LED_NUM_LOCK)) && !(old_usb_led & (1<<USB_LED_NUM_LOCK)))
|
||||
{
|
||||
// If NUM LK LED is turning on...
|
||||
PLAY_NOTE_ARRAY(tone_numlk_on, false, LEGATO);
|
||||
}
|
||||
else if (!(usb_led & (1<<USB_LED_NUM_LOCK)) && (old_usb_led & (1<<USB_LED_NUM_LOCK)))
|
||||
{
|
||||
// If NUM LED is turning off...
|
||||
PLAY_NOTE_ARRAY(tone_numlk_off, false, LEGATO);
|
||||
}
|
||||
else if ((usb_led & (1<<USB_LED_SCROLL_LOCK)) && !(old_usb_led & (1<<USB_LED_SCROLL_LOCK)))
|
||||
{
|
||||
// If SCROLL LK LED is turning on...
|
||||
PLAY_NOTE_ARRAY(tone_scroll_on, false, LEGATO);
|
||||
}
|
||||
else if (!(usb_led & (1<<USB_LED_SCROLL_LOCK)) && (old_usb_led & (1<<USB_LED_SCROLL_LOCK)))
|
||||
{
|
||||
// If SCROLL LED is turning off...
|
||||
PLAY_NOTE_ARRAY(tone_scroll_off, false, LEGATO);
|
||||
}
|
||||
old_usb_led = usb_led;
|
||||
}
|
||||
|
||||
|
||||
void play_startup_tone()
|
||||
{
|
||||
PLAY_NOTE_ARRAY(tone_my_startup, false, STACCATO);
|
||||
}
|
||||
|
||||
void play_goodbye_tone()
|
||||
{
|
||||
PLAY_NOTE_ARRAY(tone_my_goodbye, false, STACCATO);
|
||||
_delay_ms(2000);
|
||||
}
|
||||
|
||||
#endif /* AUDIO_ENABLE */
|
@ -0,0 +1,17 @@
|
||||
BOOTMAGIC_ENABLE = yes # 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 = yes # 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
|
||||
|
||||
CONFIG_H = keymaps/$(KEYMAP)/config.h
|
@ -1,69 +0,0 @@
|
||||
#include "atomic.h"
|
||||
|
||||
#define _QW 0
|
||||
#define _LW 1
|
||||
#define _RS 2
|
||||
#define _FN 3
|
||||
|
||||
#define _______ KC_TRNS
|
||||
#define ___T___ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
/*
|
||||
* .---------------------------------------------------------------------------------------------------------------------- 2u ------------.
|
||||
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | XXXXXX . BACKSP |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | DEL |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ------------+--------|
|
||||
* | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | XXXXXX . ENTER | PG UP |
|
||||
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+- 2u ---------------------+--------|
|
||||
* | LSHIFT | Z | X | C | V | B | N | M | , | . | / | XXXXXX . RSHIFT | UP | PG DN |
|
||||
* |--------+--------+--------+--------+--------+- 2u ------------+--------+--------+--------+--------+-----------------+--------+--------|
|
||||
* | LCTRL | LWIN | FN | LALT | RAISED | XXXXXX . SPACE | LOWER | RALT | HOME | END | RCTRL | LEFT | DOWN | RIGHT |
|
||||
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_QW] = { /* QWERTY */
|
||||
{ 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, XXXXXXX },
|
||||
{ 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_DEL },
|
||||
{ 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, XXXXXXX, KC_PGUP },
|
||||
{ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, KC_UP, KC_PGDN },
|
||||
{ KC_LCTL, KC_LGUI, MO(_FN), KC_LALT, MO(_RS), KC_SPC, XXXXXXX, MO(_LW), KC_RALT, KC_HOME, KC_END, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT },
|
||||
},
|
||||
[_LW] = { /* LOWERED */
|
||||
{ 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, ___T___, ___T___ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______, _______ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
|
||||
},
|
||||
[_RS] = { /* RAISED */
|
||||
{ KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___, ___T___ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, _______, _______ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
|
||||
},
|
||||
[_FN] = { /* FUNCTION */
|
||||
{ KC_NLCK, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ___T___, ___T___ },
|
||||
{ KC_SLCK, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_PAUS, KC_PSCR },
|
||||
{ KC_CAPS, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_ACL0, KC_ACL2, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, ___T___, ___T___, KC_WH_U },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ___T___, ___T___, KC_MS_U, KC_WH_D },
|
||||
{ _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R },
|
||||
},
|
||||
};
|
||||
|
||||
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:
|
||||
return MACRODOWN(TYPE(KC_T), END);
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
@ -1,34 +1,2 @@
|
||||
# The Default Planck Layout
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_QW] = { /* 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 },
|
||||
{M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||
},
|
||||
[_CM] = { /* 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 },
|
||||
{M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||
},
|
||||
[_DV] = { /* 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 },
|
||||
{M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||
},
|
||||
[_RS] = { /* 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_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
|
||||
{KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS},
|
||||
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
||||
},
|
||||
[_LW] = { /* 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_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
|
||||
{KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS},
|
||||
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
||||
}
|
||||
};
|
@ -0,0 +1 @@
|
||||
AUDIO_ENABLE = yes
|
@ -1,34 +1 @@
|
||||
# The Default Planck Layout
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_QW] = { /* 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 },
|
||||
{M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||
},
|
||||
[_CM] = { /* 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 },
|
||||
{M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||
},
|
||||
[_DV] = { /* 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 },
|
||||
{M(0), KC_LCTL, KC_LALT, KC_LGUI, MO(_LW), KC_SPC, KC_SPC, MO(_RS), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||
},
|
||||
[_RS] = { /* 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_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
|
||||
{KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS},
|
||||
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
||||
},
|
||||
[_LW] = { /* 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_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
|
||||
{KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), DF(_DV), RESET, KC_TRNS},
|
||||
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
||||
}
|
||||
};
|
||||
# The default Preonic layout - largely based on the Planck's
|
@ -0,0 +1 @@
|
||||
AUDIO_ENABLE = yes
|
@ -0,0 +1,217 @@
|
||||
#ifndef MUSICAL_NOTES_H
|
||||
#define MUSICAL_NOTES_H
|
||||
|
||||
// Tempo Placeholder
|
||||
#define TEMPO_DEFAULT 100
|
||||
|
||||
|
||||
#define SONG(notes...) { notes }
|
||||
|
||||
|
||||
// Note Types
|
||||
#define MUSICAL_NOTE(note, duration) {(NOTE##note), duration}
|
||||
#define WHOLE_NOTE(note) MUSICAL_NOTE(note, 64)
|
||||
#define HALF_NOTE(note) MUSICAL_NOTE(note, 32)
|
||||
#define QUARTER_NOTE(note) MUSICAL_NOTE(note, 16)
|
||||
#define EIGHTH_NOTE(note) MUSICAL_NOTE(note, 8)
|
||||
#define SIXTEENTH_NOTE(note) MUSICAL_NOTE(note, 4)
|
||||
|
||||
#define WHOLE_DOT_NOTE(note) MUSICAL_NOTE(note, 64+32)
|
||||
#define HALF_DOT_NOTE(note) MUSICAL_NOTE(note, 32+16)
|
||||
#define QUARTER_DOT_NOTE(note) MUSICAL_NOTE(note, 16+8)
|
||||
#define EIGHTH_DOT_NOTE(note) MUSICAL_NOTE(note, 8+4)
|
||||
#define SIXTEENTH_DOT_NOTE(note) MUSICAL_NOTE(note, 4+2)
|
||||
|
||||
// Note Type Shortcuts
|
||||
#define M__NOTE(note, duration) MUSICAL_NOTE(note, duration)
|
||||
#define W__NOTE(n) WHOLE_NOTE(n)
|
||||
#define H__NOTE(n) HALF_NOTE(n)
|
||||
#define Q__NOTE(n) QUARTER_NOTE(n)
|
||||
#define E__NOTE(n) EIGHTH_NOTE(n)
|
||||
#define S__NOTE(n) SIXTEENTH_NOTE(n)
|
||||
#define WD_NOTE(n) WHOLE_DOT_NOTE(n)
|
||||
#define HD_NOTE(n) HALF_DOT_NOTE(n)
|
||||
#define QD_NOTE(n) QUARTER_DOT_NOTE(n)
|
||||
#define ED_NOTE(n) EIGHTH_DOT_NOTE(n)
|
||||
#define SD_NOTE(n) SIXTEENTH_DOT_NOTE(n)
|
||||
|
||||
// Note Styles
|
||||
// Staccato makes sure there is a rest between each note. Think: TA TA TA
|
||||
// Legato makes notes flow together. Think: TAAA
|
||||
#define STACCATO 0.01
|
||||
#define LEGATO 0
|
||||
|
||||
// Note Timbre
|
||||
// Changes how the notes sound
|
||||
#define TIMBRE_12 0.125
|
||||
#define TIMBRE_25 0.250
|
||||
#define TIMBRE_50 0.500
|
||||
#define TIMBRE_75 0.750
|
||||
#define TIMBRE_DEFAULT TIMBRE_50
|
||||
|
||||
|
||||
// Notes - # = Octave
|
||||
|
||||
#define NOTE_REST 0.00
|
||||
|
||||
/* These notes are currently bugged
|
||||
#define NOTE_C0 16.35
|
||||
#define NOTE_CS0 17.32
|
||||
#define NOTE_D0 18.35
|
||||
#define NOTE_DS0 19.45
|
||||
#define NOTE_E0 20.60
|
||||
#define NOTE_F0 21.83
|
||||
#define NOTE_FS0 23.12
|
||||
#define NOTE_G0 24.50
|
||||
#define NOTE_GS0 25.96
|
||||
#define NOTE_A0 27.50
|
||||
#define NOTE_AS0 29.14
|
||||
#define NOTE_B0 30.87
|
||||
#define NOTE_C1 32.70
|
||||
#define NOTE_CS1 34.65
|
||||
#define NOTE_D1 36.71
|
||||
#define NOTE_DS1 38.89
|
||||
#define NOTE_E1 41.20
|
||||
#define NOTE_F1 43.65
|
||||
#define NOTE_FS1 46.25
|
||||
#define NOTE_G1 49.00
|
||||
#define NOTE_GS1 51.91
|
||||
#define NOTE_A1 55.00
|
||||
#define NOTE_AS1 58.27
|
||||
*/
|
||||
|
||||
#define NOTE_B1 61.74
|
||||
#define NOTE_C2 65.41
|
||||
#define NOTE_CS2 69.30
|
||||
#define NOTE_D2 73.42
|
||||
#define NOTE_DS2 77.78
|
||||
#define NOTE_E2 82.41
|
||||
#define NOTE_F2 87.31
|
||||
#define NOTE_FS2 92.50
|
||||
#define NOTE_G2 98.00
|
||||
#define NOTE_GS2 103.83
|
||||
#define NOTE_A2 110.00
|
||||
#define NOTE_AS2 116.54
|
||||
#define NOTE_B2 123.47
|
||||
#define NOTE_C3 130.81
|
||||
#define NOTE_CS3 138.59
|
||||
#define NOTE_D3 146.83
|
||||
#define NOTE_DS3 155.56
|
||||
#define NOTE_E3 164.81
|
||||
#define NOTE_F3 174.61
|
||||
#define NOTE_FS3 185.00
|
||||
#define NOTE_G3 196.00
|
||||
#define NOTE_GS3 207.65
|
||||
#define NOTE_A3 220.00
|
||||
#define NOTE_AS3 233.08
|
||||
#define NOTE_B3 246.94
|
||||
#define NOTE_C4 261.63
|
||||
#define NOTE_CS4 277.18
|
||||
#define NOTE_D4 293.66
|
||||
#define NOTE_DS4 311.13
|
||||
#define NOTE_E4 329.63
|
||||
#define NOTE_F4 349.23
|
||||
#define NOTE_FS4 369.99
|
||||
#define NOTE_G4 392.00
|
||||
#define NOTE_GS4 415.30
|
||||
#define NOTE_A4 440.00
|
||||
#define NOTE_AS4 466.16
|
||||
#define NOTE_B4 493.88
|
||||
#define NOTE_C5 523.25
|
||||
#define NOTE_CS5 554.37
|
||||
#define NOTE_D5 587.33
|
||||
#define NOTE_DS5 622.25
|
||||
#define NOTE_E5 659.26
|
||||
#define NOTE_F5 698.46
|
||||
#define NOTE_FS5 739.99
|
||||
#define NOTE_G5 783.99
|
||||
#define NOTE_GS5 830.61
|
||||
#define NOTE_A5 880.00
|
||||
#define NOTE_AS5 932.33
|
||||
#define NOTE_B5 987.77
|
||||
#define NOTE_C6 1046.50
|
||||
#define NOTE_CS6 1108.73
|
||||
#define NOTE_D6 1174.66
|
||||
#define NOTE_DS6 1244.51
|
||||
#define NOTE_E6 1318.51
|
||||
#define NOTE_F6 1396.91
|
||||
#define NOTE_FS6 1479.98
|
||||
#define NOTE_G6 1567.98
|
||||
#define NOTE_GS6 1661.22
|
||||
#define NOTE_A6 1760.00
|
||||
#define NOTE_AS6 1864.66
|
||||
#define NOTE_B6 1975.53
|
||||
#define NOTE_C7 2093.00
|
||||
#define NOTE_CS7 2217.46
|
||||
#define NOTE_D7 2349.32
|
||||
#define NOTE_DS7 2489.02
|
||||
#define NOTE_E7 2637.02
|
||||
#define NOTE_F7 2793.83
|
||||
#define NOTE_FS7 2959.96
|
||||
#define NOTE_G7 3135.96
|
||||
#define NOTE_GS7 3322.44
|
||||
#define NOTE_A7 3520.00
|
||||
#define NOTE_AS7 3729.31
|
||||
#define NOTE_B7 3951.07
|
||||
#define NOTE_C8 4186.01
|
||||
#define NOTE_CS8 4434.92
|
||||
#define NOTE_D8 4698.64
|
||||
#define NOTE_DS8 4978.03
|
||||
#define NOTE_E8 5274.04
|
||||
#define NOTE_F8 5587.65
|
||||
#define NOTE_FS8 5919.91
|
||||
#define NOTE_G8 6271.93
|
||||
#define NOTE_GS8 6644.88
|
||||
#define NOTE_A8 7040.00
|
||||
#define NOTE_AS8 7458.62
|
||||
#define NOTE_B8 7902.13
|
||||
|
||||
// Flat Aliases
|
||||
#define NOTE_DF0 NOTE_CS0
|
||||
#define NOTE_EF0 NOTE_DS0
|
||||
#define NOTE_GF0 NOTE_FS0
|
||||
#define NOTE_AF0 NOTE_GS0
|
||||
#define NOTE_BF0 NOTE_AS0
|
||||
#define NOTE_DF1 NOTE_CS1
|
||||
#define NOTE_EF1 NOTE_DS1
|
||||
#define NOTE_GF1 NOTE_FS1
|
||||
#define NOTE_AF1 NOTE_GS1
|
||||
#define NOTE_BF1 NOTE_AS1
|
||||
#define NOTE_DF2 NOTE_CS2
|
||||
#define NOTE_EF2 NOTE_DS2
|
||||
#define NOTE_GF2 NOTE_FS2
|
||||
#define NOTE_AF2 NOTE_GS2
|
||||
#define NOTE_BF2 NOTE_AS2
|
||||
#define NOTE_DF3 NOTE_CS3
|
||||
#define NOTE_EF3 NOTE_DS3
|
||||
#define NOTE_GF3 NOTE_FS3
|
||||
#define NOTE_AF3 NOTE_GS3
|
||||
#define NOTE_BF3 NOTE_AS3
|
||||
#define NOTE_DF4 NOTE_CS4
|
||||
#define NOTE_EF4 NOTE_DS4
|
||||
#define NOTE_GF4 NOTE_FS4
|
||||
#define NOTE_AF4 NOTE_GS4
|
||||
#define NOTE_BF4 NOTE_AS4
|
||||
#define NOTE_DF5 NOTE_CS5
|
||||
#define NOTE_EF5 NOTE_DS5
|
||||
#define NOTE_GF5 NOTE_FS5
|
||||
#define NOTE_AF5 NOTE_GS5
|
||||
#define NOTE_BF5 NOTE_AS5
|
||||
#define NOTE_DF6 NOTE_CS6
|
||||
#define NOTE_EF6 NOTE_DS6
|
||||
#define NOTE_GF6 NOTE_FS6
|
||||
#define NOTE_AF6 NOTE_GS6
|
||||
#define NOTE_BF6 NOTE_AS6
|
||||
#define NOTE_DF7 NOTE_CS7
|
||||
#define NOTE_EF7 NOTE_DS7
|
||||
#define NOTE_GF7 NOTE_FS7
|
||||
#define NOTE_AF7 NOTE_GS7
|
||||
#define NOTE_BF7 NOTE_AS7
|
||||
#define NOTE_DF8 NOTE_CS8
|
||||
#define NOTE_EF8 NOTE_DS8
|
||||
#define NOTE_GF8 NOTE_FS8
|
||||
#define NOTE_AF8 NOTE_GS8
|
||||
#define NOTE_BF8 NOTE_AS8
|
||||
|
||||
|
||||
#endif
|
@ -0,0 +1,101 @@
|
||||
#include "musical_notes.h"
|
||||
|
||||
#ifndef SONG_LIST_H
|
||||
#define SONG_LIST_H
|
||||
|
||||
#define ODE_TO_JOY \
|
||||
Q__NOTE(_E4), Q__NOTE(_E4), Q__NOTE(_F4), Q__NOTE(_G4), \
|
||||
Q__NOTE(_G4), Q__NOTE(_F4), Q__NOTE(_E4), Q__NOTE(_D4), \
|
||||
Q__NOTE(_C4), Q__NOTE(_C4), Q__NOTE(_D4), Q__NOTE(_E4), \
|
||||
QD_NOTE(_E4), E__NOTE(_D4), H__NOTE(_D4),
|
||||
|
||||
#define ROCK_A_BYE_BABY \
|
||||
QD_NOTE(_B4), E__NOTE(_D4), Q__NOTE(_B5), \
|
||||
H__NOTE(_A5), Q__NOTE(_G5), \
|
||||
QD_NOTE(_B4), E__NOTE(_D5), Q__NOTE(_G5), \
|
||||
H__NOTE(_FS5),
|
||||
|
||||
#define CLOSE_ENCOUNTERS_5_NOTE \
|
||||
Q__NOTE(_D5), \
|
||||
Q__NOTE(_E5), \
|
||||
Q__NOTE(_C5), \
|
||||
Q__NOTE(_C4), \
|
||||
Q__NOTE(_G4),
|
||||
|
||||
#define DOE_A_DEER \
|
||||
QD_NOTE(_C4), E__NOTE(_D4), \
|
||||
QD_NOTE(_E4), E__NOTE(_C4), \
|
||||
Q__NOTE(_E4), Q__NOTE(_C4), \
|
||||
Q__NOTE(_E4),
|
||||
|
||||
#define GOODBYE_SOUND \
|
||||
E__NOTE(_E7), \
|
||||
E__NOTE(_A6), \
|
||||
ED_NOTE(_E6),
|
||||
|
||||
#define STARTUP_SOUND \
|
||||
ED_NOTE(_E7 ), \
|
||||
E__NOTE(_CS7), \
|
||||
E__NOTE(_E6 ), \
|
||||
E__NOTE(_A6 ), \
|
||||
M__NOTE(_CS7, 20),
|
||||
|
||||
#define QWERTY_SOUND \
|
||||
E__NOTE(_GS6 ), \
|
||||
E__NOTE(_A6 ), \
|
||||
S__NOTE(_REST), \
|
||||
Q__NOTE(_E7 ),
|
||||
|
||||
#define COLEMAK_SOUND \
|
||||
E__NOTE(_GS6 ), \
|
||||
E__NOTE(_A6 ), \
|
||||
S__NOTE(_REST), \
|
||||
ED_NOTE(_E7 ), \
|
||||
S__NOTE(_REST), \
|
||||
ED_NOTE(_GS7 ),
|
||||
|
||||
#define DVORAK_SOUND \
|
||||
E__NOTE(_GS6 ), \
|
||||
E__NOTE(_A6 ), \
|
||||
S__NOTE(_REST), \
|
||||
E__NOTE(_E7 ), \
|
||||
S__NOTE(_REST), \
|
||||
E__NOTE(_FS7 ), \
|
||||
S__NOTE(_REST), \
|
||||
E__NOTE(_E7 ),
|
||||
|
||||
#define MUSIC_SCALE_SOUND \
|
||||
E__NOTE(_A5 ), \
|
||||
E__NOTE(_B5 ), \
|
||||
E__NOTE(_CS6), \
|
||||
E__NOTE(_D6 ), \
|
||||
E__NOTE(_E6 ), \
|
||||
E__NOTE(_FS6), \
|
||||
E__NOTE(_GS6), \
|
||||
E__NOTE(_A6 ),
|
||||
|
||||
#define CAPS_LOCK_ON_SOUND \
|
||||
E__NOTE(_A3), \
|
||||
E__NOTE(_B3),
|
||||
|
||||
#define CAPS_LOCK_OFF_SOUND \
|
||||
E__NOTE(_B3), \
|
||||
E__NOTE(_A3),
|
||||
|
||||
#define SCROLL_LOCK_ON_SOUND \
|
||||
E__NOTE(_D4), \
|
||||
E__NOTE(_E4),
|
||||
|
||||
#define SCROLL_LOCK_OFF_SOUND \
|
||||
E__NOTE(_E4), \
|
||||
E__NOTE(_D4),
|
||||
|
||||
#define NUM_LOCK_ON_SOUND \
|
||||
E__NOTE(_D5), \
|
||||
E__NOTE(_E5),
|
||||
|
||||
#define NUM_LOCK_OFF_SOUND \
|
||||
E__NOTE(_E5), \
|
||||
E__NOTE(_D5),
|
||||
|
||||
#endif
|
@ -0,0 +1,6 @@
|
||||
`eeprom_reset.hex` is to reset the eeprom on the Atmega32u4, like this:
|
||||
|
||||
dfu-programmer atmega32u4 erase
|
||||
dfu-programmer atmega32u4 flash --eeprom eeprom-reset.bin
|
||||
|
||||
You'll need to reflash afterwards, because DFU requires the flash to be erased before messing with the eeprom.
|
@ -0,0 +1,9 @@
|
||||
:10000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
|
||||
:10001000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0
|
||||
:10002000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0
|
||||
:10003000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0
|
||||
:10004000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0
|
||||
:10005000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0
|
||||
:10006000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA0
|
||||
:10007000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF90
|
||||
:00000001FF
|
@ -0,0 +1,36 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <util/delay.h>
|
||||
#include "matrix.h"
|
||||
#include "bootloader.h"
|
||||
#include "debug.h"
|
||||
#include "keymap.h"
|
||||
#include "host.h"
|
||||
#include "action_layer.h"
|
||||
#include "eeconfig.h"
|
||||
#include "magic.h"
|
||||
|
||||
keymap_config_t keymap_config;
|
||||
|
||||
void magic(void)
|
||||
{
|
||||
/* check signature */
|
||||
if (!eeconfig_is_enabled()) {
|
||||
eeconfig_init();
|
||||
}
|
||||
|
||||
/* debug enable */
|
||||
debug_config.raw = eeconfig_read_debug();
|
||||
|
||||
/* keymap config */
|
||||
keymap_config.raw = eeconfig_read_keymap();
|
||||
|
||||
#ifdef NKRO_ENABLE
|
||||
keyboard_nkro = keymap_config.nkro;
|
||||
#endif
|
||||
|
||||
uint8_t default_layer = 0;
|
||||
default_layer = eeconfig_read_default_layer();
|
||||
default_layer_set((uint32_t)default_layer);
|
||||
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
#ifndef MAGIC_H
|
||||
#define MAGIC_H
|
||||
|
||||
void magic(void);
|
||||
|
||||
#endif
|
Loading…
Reference in new issue