Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
365b863578 | ||
|
5b22ddf526 | ||
|
c776c1ce82 | ||
|
ccaacde4d6 | ||
|
5836d1a06a | ||
|
fd359e23e8 | ||
|
4aef0318aa | ||
|
8209304904 | ||
|
6bbe2366ec | ||
|
3be81a2daf |
@@ -34,7 +34,11 @@ ifeq ($(strip $(AUDIO_ENABLE)), yes)
|
||||
OPT_DEFS += -DAUDIO_ENABLE
|
||||
MUSIC_ENABLE := 1
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
|
||||
SRC += $(QUANTUM_DIR)/audio/audio.c
|
||||
ifeq ($(PLATFORM),AVR)
|
||||
SRC += $(QUANTUM_DIR)/audio/audio.c
|
||||
else
|
||||
SRC += $(QUANTUM_DIR)/audio/audio_arm.c
|
||||
endif
|
||||
SRC += $(QUANTUM_DIR)/audio/voices.c
|
||||
SRC += $(QUANTUM_DIR)/audio/luts.c
|
||||
endif
|
||||
@@ -151,6 +155,9 @@ endif
|
||||
ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
|
||||
ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
|
||||
CIE1931_CURVE = yes
|
||||
endif
|
||||
ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
|
||||
OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@@ -3,11 +3,35 @@
|
||||
#define _______ KC_TRNS
|
||||
|
||||
enum keyboard_layers {
|
||||
_BL,
|
||||
_FL,
|
||||
_CL
|
||||
_BL,
|
||||
_FL,
|
||||
_CL
|
||||
};
|
||||
|
||||
enum custom_keycodes {
|
||||
S_BSKTC = SAFE_RANGE,
|
||||
S_ODEJY,
|
||||
S_RCKBY,
|
||||
S_DOEDR,
|
||||
S_SCALE,
|
||||
S_ONEUP,
|
||||
S_COIN,
|
||||
S_SONIC,
|
||||
S_ZELDA
|
||||
};
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
float song_basketcase[][2] = SONG(BASKET_CASE);
|
||||
float song_ode_to_joy[][2] = SONG(ODE_TO_JOY);
|
||||
float song_rock_a_bye_baby[][2] = SONG(ROCK_A_BYE_BABY);
|
||||
float song_doe_a_deer[][2] = SONG(DOE_A_DEER);
|
||||
float song_scale[][2] = SONG(MUSIC_SCALE_SOUND);
|
||||
float song_coin[][2] = SONG(COIN_SOUND);
|
||||
float song_one_up[][2] = SONG(ONE_UP_SOUND);
|
||||
float song_sonic_ring[][2] = SONG(SONIC_RING);
|
||||
float song_zelda_puzzle[][2] = SONG(ZELDA_PUZZLE);
|
||||
#endif
|
||||
|
||||
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Layer 0: Default Layer
|
||||
* ,-----------------------------------------------------------.
|
||||
@@ -33,11 +57,71 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \
|
||||
_______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
|
||||
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, MO(_FL), _______),
|
||||
_______,_______,_______, _______, _______, _______, MO(_FL), _______),
|
||||
[_CL] = KEYMAP(
|
||||
BL_STEP,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,\
|
||||
BL_STEP,S_BSKTC,S_ODEJY,S_RCKBY,S_DOEDR,S_SCALE,S_ONEUP,S_COIN, S_SONIC,S_ZELDA,_______,_______,_______,_______,_______,\
|
||||
_______, _______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, \
|
||||
_______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
|
||||
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, MO(_FL), _______)
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case S_BSKTC:
|
||||
if (record->event.pressed) {
|
||||
stop_all_notes();
|
||||
PLAY_SONG(song_basketcase);
|
||||
}
|
||||
return false;
|
||||
case S_ODEJY:
|
||||
if (record->event.pressed) {
|
||||
stop_all_notes();
|
||||
PLAY_SONG(song_ode_to_joy);
|
||||
}
|
||||
return false;
|
||||
case S_RCKBY:
|
||||
if (record->event.pressed) {
|
||||
stop_all_notes();
|
||||
PLAY_SONG(song_rock_a_bye_baby);
|
||||
}
|
||||
return false;
|
||||
case S_DOEDR:
|
||||
if (record->event.pressed) {
|
||||
stop_all_notes();
|
||||
PLAY_SONG(song_doe_a_deer);
|
||||
}
|
||||
return false;
|
||||
case S_SCALE:
|
||||
if (record->event.pressed) {
|
||||
stop_all_notes();
|
||||
PLAY_SONG(song_scale);
|
||||
}
|
||||
return false;
|
||||
case S_ONEUP:
|
||||
if (record->event.pressed) {
|
||||
stop_all_notes();
|
||||
PLAY_SONG(song_one_up);
|
||||
}
|
||||
return false;
|
||||
case S_COIN:
|
||||
if (record->event.pressed) {
|
||||
stop_all_notes();
|
||||
PLAY_SONG(song_coin);
|
||||
}
|
||||
return false;
|
||||
case S_SONIC:
|
||||
if (record->event.pressed) {
|
||||
stop_all_notes();
|
||||
PLAY_SONG(song_sonic_ring);
|
||||
}
|
||||
return false;
|
||||
case S_ZELDA:
|
||||
if (record->event.pressed) {
|
||||
stop_all_notes();
|
||||
PLAY_SONG(song_zelda_puzzle);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@
|
||||
void backlight_init_ports(void) {
|
||||
printf("backlight_init_ports()\n");
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
palSetPadMode(GPIOB, 8, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOB, 8, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPad(GPIOB, 8);
|
||||
#endif
|
||||
}
|
||||
@@ -41,13 +41,8 @@ void backlight_set(uint8_t level) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void led_init_ports() {
|
||||
printf("led_init_ports()\n");
|
||||
palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
printf("led_init_ports()\n");
|
||||
printf("led_set_kb(%d)\n", usb_led);
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||
// Turn capslock on
|
||||
palSetPad(GPIOB, 7);
|
||||
|
@@ -11,7 +11,7 @@
|
||||
|
||||
/* Clueboard 60%
|
||||
*
|
||||
* Column pins are input with internal pull-down.
|
||||
* Column pins are input with internal pull-down.
|
||||
* Row pins are output and strobe with high.
|
||||
* Key is high or 1 when it turns on.
|
||||
*
|
||||
@@ -68,13 +68,10 @@ void matrix_init(void) {
|
||||
palSetPadMode(GPIOA, 15, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOA, 10, PAL_MODE_INPUT_PULLDOWN);
|
||||
|
||||
memset(matrix, 0, MATRIX_ROWS);
|
||||
memset(matrix_debouncing, 0, MATRIX_COLS);
|
||||
|
||||
/* Setup capslock */
|
||||
// palSetPadMode(GPIOB, 7, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
// palClearPad(GPIOB, 7);
|
||||
memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t));
|
||||
memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_row_t));
|
||||
|
||||
palClearPad(GPIOB, 7); // Turn off capslock
|
||||
matrix_init_quantum();
|
||||
}
|
||||
|
||||
@@ -84,20 +81,20 @@ uint8_t matrix_scan(void) {
|
||||
|
||||
// strobe col { PA2, PA3, PA6, PB14, PB15, PA8, PA9, PA7, PB3, PB4, PC14, PC15, PC13, PB5, PB6 }
|
||||
switch (col) {
|
||||
case 0: palSetPad(GPIOA, 2); break;
|
||||
case 1: palSetPad(GPIOA, 3); break;
|
||||
case 2: palSetPad(GPIOA, 6); break;
|
||||
case 3: palSetPad(GPIOB, 14); break;
|
||||
case 4: palSetPad(GPIOB, 15); break;
|
||||
case 5: palSetPad(GPIOA, 8); break;
|
||||
case 6: palSetPad(GPIOA, 9); break;
|
||||
case 7: palSetPad(GPIOA, 7); break;
|
||||
case 8: palSetPad(GPIOB, 3); break;
|
||||
case 9: palSetPad(GPIOB, 4); break;
|
||||
case 10: palSetPad(GPIOC, 15); break;
|
||||
case 11: palSetPad(GPIOC, 14); break;
|
||||
case 12: palSetPad(GPIOC, 13); break;
|
||||
case 13: palSetPad(GPIOB, 5); break;
|
||||
case 0: palSetPad(GPIOA, 2); break;
|
||||
case 1: palSetPad(GPIOA, 3); break;
|
||||
case 2: palSetPad(GPIOA, 6); break;
|
||||
case 3: palSetPad(GPIOB, 14); break;
|
||||
case 4: palSetPad(GPIOB, 15); break;
|
||||
case 5: palSetPad(GPIOA, 8); break;
|
||||
case 6: palSetPad(GPIOA, 9); break;
|
||||
case 7: palSetPad(GPIOA, 7); break;
|
||||
case 8: palSetPad(GPIOB, 3); break;
|
||||
case 9: palSetPad(GPIOB, 4); break;
|
||||
case 10: palSetPad(GPIOC, 15); break;
|
||||
case 11: palSetPad(GPIOC, 14); break;
|
||||
case 12: palSetPad(GPIOC, 13); break;
|
||||
case 13: palSetPad(GPIOB, 5); break;
|
||||
case 14: palSetPad(GPIOB, 6); break;
|
||||
}
|
||||
|
||||
@@ -115,20 +112,20 @@ uint8_t matrix_scan(void) {
|
||||
|
||||
// unstrobe col { PA2, PA3, PA6, PB14, PB15, PA8, PA9, PA7, PB3, PB4, PC15, PC14, PC13, PB5, PB6 }
|
||||
switch (col) {
|
||||
case 0: palClearPad(GPIOA, 2); break;
|
||||
case 1: palClearPad(GPIOA, 3); break;
|
||||
case 2: palClearPad(GPIOA, 6); break;
|
||||
case 3: palClearPad(GPIOB, 14); break;
|
||||
case 4: palClearPad(GPIOB, 15); break;
|
||||
case 5: palClearPad(GPIOA, 8); break;
|
||||
case 6: palClearPad(GPIOA, 9); break;
|
||||
case 7: palClearPad(GPIOA, 7); break;
|
||||
case 8: palClearPad(GPIOB, 3); break;
|
||||
case 9: palClearPad(GPIOB, 4); break;
|
||||
case 10: palClearPad(GPIOC, 15); break;
|
||||
case 11: palClearPad(GPIOC, 14); break;
|
||||
case 12: palClearPad(GPIOC, 13); break;
|
||||
case 13: palClearPad(GPIOB, 5); break;
|
||||
case 0: palClearPad(GPIOA, 2); break;
|
||||
case 1: palClearPad(GPIOA, 3); break;
|
||||
case 2: palClearPad(GPIOA, 6); break;
|
||||
case 3: palClearPad(GPIOB, 14); break;
|
||||
case 4: palClearPad(GPIOB, 15); break;
|
||||
case 5: palClearPad(GPIOA, 8); break;
|
||||
case 6: palClearPad(GPIOA, 9); break;
|
||||
case 7: palClearPad(GPIOA, 7); break;
|
||||
case 8: palClearPad(GPIOB, 3); break;
|
||||
case 9: palClearPad(GPIOB, 4); break;
|
||||
case 10: palClearPad(GPIOC, 15); break;
|
||||
case 11: palClearPad(GPIOC, 14); break;
|
||||
case 12: palClearPad(GPIOC, 13); break;
|
||||
case 13: palClearPad(GPIOB, 5); break;
|
||||
case 14: palClearPad(GPIOB, 6); break;
|
||||
}
|
||||
|
||||
@@ -138,6 +135,7 @@ uint8_t matrix_scan(void) {
|
||||
debouncing_time = timer_read();
|
||||
}
|
||||
}
|
||||
|
||||
if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
|
||||
for (int row = 0; row < MATRIX_ROWS; row++) {
|
||||
matrix[row] = 0;
|
||||
|
@@ -50,5 +50,5 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||
CUSTOM_MATRIX = yes # Custom matrix file
|
||||
#AUDIO_ENABLE = yes
|
||||
AUDIO_ENABLE = yes
|
||||
# SERIAL_LINK_ENABLE = yes
|
||||
|
86
keyboards/dz60/keymaps/60_plus_arrows/keymap.c
Normal file
86
keyboards/dz60/keymaps/60_plus_arrows/keymap.c
Normal file
@@ -0,0 +1,86 @@
|
||||
#include "dz60.h"
|
||||
|
||||
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
|
||||
|
||||
#define ______ KC_TRNS
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Qwerty
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | FN |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | Alt | Cmd | Space | Cmd | RAlt | L | D | R |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
KEYMAP_2_SHIFTS(
|
||||
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,
|
||||
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_UP, MO(1),
|
||||
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT
|
||||
),
|
||||
|
||||
/* FN Layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | Esc | BL- | BL+ | BL | | | |RESET| | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | |RBGM | | | | | | | | | | Val+ | Val- |RBGTOG|
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | Hue+| Hue-| Sat+| Sat-| | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | | Ctrl| |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
KEYMAP_DIRECTIONAL(
|
||||
KC_ESC, BL_TOGG, BL_STEP, BL_DEC, BL_INC, ______, ______, RESET, ______, ______, ______, ______, ______, ______, ______,
|
||||
______, RGB_MOD, ______, ______, ______, ______, ______, ______, ______, ______, ______, RGB_VAI, RGB_VAD, RGB_TOG,
|
||||
______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, ______, ______, ______, ______, ______, ______, ______,
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_RCTL, ______,
|
||||
______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______
|
||||
),
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
@@ -7,7 +7,7 @@
|
||||
"height": 5,
|
||||
"layouts": {
|
||||
"KEYMAP": {
|
||||
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0.5, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":14, "y":1, "w":1.5}, {"x":0.75, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":14, "y":2, "w":2.25}, {"x":1.25, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":13, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0.25, "y":4, "w":1.25}, {"x":1.5, "y":4, "w":1.25}, {"x":2.75, "y":4, "w":1.25}, {"x":9, "y":4, "w":6.25}, {"x":10.25, "y":4, "w":1.25}, {"x":11.5, "y":4, "w":1.25}, {"x":12.75, "y":4, "w":1.25}, {"x":14, "y":4, "w":1.25}]
|
||||
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"iso", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":5}, {"x":9, "y":4}, {"x":10, "y":4}, {"label":"Win", "x":11, "y":4, "w":1.5}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"|", "x":13.75, "y":5}]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,6 +12,8 @@ extern inline void ergodox_right_led_2_off(void);
|
||||
extern inline void ergodox_right_led_3_off(void);
|
||||
extern inline void ergodox_right_led_off(uint8_t led);
|
||||
|
||||
extern inline void ergodox_led_all_off(void);
|
||||
|
||||
void ergodox_led_init(void);
|
||||
void ergodox_blink_all_leds(void);
|
||||
|
||||
|
@@ -20,4 +20,7 @@
|
||||
#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
|
||||
#define ONESHOT_TAP_TOGGLE 2
|
||||
|
||||
#undef PRODUCT
|
||||
#define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine
|
||||
|
||||
#endif
|
||||
|
@@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_EQUAL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS),
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(_DIABLO),
|
||||
KC_BSPACE, KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
OSM(MOD_LSFT), LCTL_T(KC_Z),KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD),
|
||||
KC_LSFT, LCTL_T(KC_Z),KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD),
|
||||
LT(_SYMB,KC_GRAVE),KC_QUOTE, KC_LGUI, KC_LBRACKET,KC_RBRACKET,
|
||||
|
||||
ALT_T(KC_APPLICATION), KC_LGUI,
|
||||
@@ -96,7 +96,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS),
|
||||
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(_DIABLO),
|
||||
KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D,
|
||||
OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD),
|
||||
KC_LSFT, LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD),
|
||||
LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET,
|
||||
ALT_T(KC_APP), KC_LGUI,
|
||||
KC_HOME,
|
||||
@@ -139,7 +139,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS),
|
||||
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(_DIABLO),
|
||||
KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I,
|
||||
OSM(MOD_LSFT), LCTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(_GAMEPAD),
|
||||
KC_LSFT, LCTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(_GAMEPAD),
|
||||
LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET, KC_RBRACKET,
|
||||
ALT_T(KC_APP), KC_LEAD,
|
||||
KC_HOME,
|
||||
@@ -182,7 +182,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS),
|
||||
KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, TG(_DIABLO),
|
||||
KC_BSPC, KC_A, KC_S, KC_H, KC_T, KC_G,
|
||||
OSM(MOD_LSFT), LCTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V, TG(_GAMEPAD),
|
||||
KC_LSFT, LCTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V, TG(_GAMEPAD),
|
||||
LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET,
|
||||
ALT_T(KC_APP), KC_LEAD,
|
||||
KC_HOME,
|
||||
|
@@ -62,8 +62,8 @@ void matrix_init(void)
|
||||
palSetPadMode(GPIOC, 11, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOD, 0, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
|
||||
memset(matrix, 0, MATRIX_ROWS);
|
||||
memset(matrix_debouncing, 0, LOCAL_MATRIX_ROWS);
|
||||
memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t));
|
||||
memset(matrix_debouncing, 0, LOCAL_MATRIX_ROWS * sizeof(matrix_row_t));
|
||||
|
||||
matrix_init_quantum();
|
||||
}
|
||||
|
@@ -60,8 +60,8 @@ void matrix_init(void)
|
||||
palSetPadMode(GPIOC, 5, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOD, 0, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
#endif
|
||||
memset(matrix, 0, MATRIX_ROWS);
|
||||
memset(matrix_debouncing, 0, MATRIX_ROWS);
|
||||
memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t));
|
||||
memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t));
|
||||
|
||||
matrix_init_quantum();
|
||||
}
|
||||
|
212
keyboards/jj40/backlight.c
Normal file
212
keyboards/jj40/backlight.c
Normal file
@@ -0,0 +1,212 @@
|
||||
/**
|
||||
* Backlighting code for PS2AVRGB boards (ATMEGA32A)
|
||||
* Kenneth A. (github.com/krusli | krusli.me)
|
||||
*/
|
||||
|
||||
#include "backlight.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
#include "backlight_custom.h"
|
||||
#include "breathing_custom.h"
|
||||
|
||||
// DEBUG
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// Port D: digital pins of the AVR chipset
|
||||
#define NUMLOCK_PORT (1 << 1) // 1st pin of Port D (digital)
|
||||
#define CAPSLOCK_PORT (1 << 2) // 2nd pin
|
||||
#define BACKLIGHT_PORT (1 << 4) // 4th pin
|
||||
#define SCROLLLOCK_PORT (1 << 6) // 6th pin
|
||||
|
||||
#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64
|
||||
#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default
|
||||
|
||||
#define TIMER_PRESCALE_MASK 0x07 ///< Timer Prescaler Bit-Mask
|
||||
|
||||
#define PWM_MAX 0xFF
|
||||
#define TIMER_TOP 255 // 8 bit PWM
|
||||
|
||||
extern backlight_config_t backlight_config;
|
||||
|
||||
/**
|
||||
* References
|
||||
* Port Registers: https://www.arduino.cc/en/Reference/PortManipulation
|
||||
* TCCR1A: https://electronics.stackexchange.com/questions/92350/what-is-the-difference-between-tccr1a-and-tccr1b
|
||||
* Timers: http://www.avrbeginners.net/architecture/timers/timers.html
|
||||
* 16-bit timer setup: http://sculland.com/ATmega168/Interrupts-And-Timers/16-Bit-Timer-Setup/
|
||||
* PS2AVRGB firmware: https://github.com/showjean/ps2avrU/tree/master/firmware
|
||||
*/
|
||||
|
||||
// @Override
|
||||
// turn LEDs on and off depending on USB caps/num/scroll lock states.
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
|
||||
// turn on
|
||||
DDRD |= NUMLOCK_PORT;
|
||||
PORTD |= NUMLOCK_PORT;
|
||||
} else {
|
||||
// turn off
|
||||
DDRD &= ~NUMLOCK_PORT;
|
||||
PORTD &= ~NUMLOCK_PORT;
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
|
||||
DDRD |= CAPSLOCK_PORT;
|
||||
PORTD |= CAPSLOCK_PORT;
|
||||
} else {
|
||||
DDRD &= ~CAPSLOCK_PORT;
|
||||
PORTD &= ~CAPSLOCK_PORT;
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
|
||||
DDRD |= SCROLLLOCK_PORT;
|
||||
PORTD |= SCROLLLOCK_PORT;
|
||||
} else {
|
||||
DDRD &= ~SCROLLLOCK_PORT;
|
||||
PORTD &= ~SCROLLLOCK_PORT;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
|
||||
// sets up Timer 1 for 8-bit PWM
|
||||
void timer1PWMSetup(void) { // NOTE ONLY CALL THIS ONCE
|
||||
// default 8 bit mode
|
||||
TCCR1A &= ~(1 << 1); // cbi(TCCR1A,PWM11); <- set PWM11 bit to HIGH
|
||||
TCCR1A |= (1 << 0); // sbi(TCCR1A,PWM10); <- set PWM10 bit to LOW
|
||||
|
||||
// clear output compare value A
|
||||
// outb(OCR1AH, 0);
|
||||
// outb(OCR1AL, 0);
|
||||
|
||||
// clear output comparator registers for B
|
||||
OCR1BH = 0; // outb(OCR1BH, 0);
|
||||
OCR1BL = 0; // outb(OCR1BL, 0);
|
||||
}
|
||||
|
||||
bool is_init = false;
|
||||
void timer1Init(void) {
|
||||
// timer1SetPrescaler(TIMER1PRESCALE)
|
||||
// set to DIV/64
|
||||
(TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | TIMER1PRESCALE;
|
||||
|
||||
// reset TCNT1
|
||||
TCNT1H = 0; // outb(TCNT1H, 0);
|
||||
TCNT1L = 0; // outb(TCNT1L, 0);
|
||||
|
||||
// TOIE1: Timer Overflow Interrupt Enable (Timer 1);
|
||||
TIMSK |= _BV(TOIE1); // sbi(TIMSK, TOIE1);
|
||||
|
||||
is_init = true;
|
||||
}
|
||||
|
||||
void timer1UnInit(void) {
|
||||
// set prescaler back to NONE
|
||||
(TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | 0x00; // TIMERRTC_CLK_STOP
|
||||
|
||||
// disable timer overflow interrupt
|
||||
TIMSK &= ~_BV(TOIE1); // overflow bit?
|
||||
|
||||
setPWM(0);
|
||||
|
||||
is_init = false;
|
||||
}
|
||||
|
||||
|
||||
// handle TCNT1 overflow
|
||||
//! Interrupt handler for tcnt1 overflow interrupt
|
||||
ISR(TIMER1_OVF_vect, ISR_NOBLOCK)
|
||||
{
|
||||
// sei();
|
||||
// handle breathing here
|
||||
#ifdef BACKLIGHT_BREATHING
|
||||
if (is_breathing()) {
|
||||
custom_breathing_handler();
|
||||
}
|
||||
#endif
|
||||
|
||||
// TODO call user defined function
|
||||
}
|
||||
|
||||
// enable timer 1 PWM
|
||||
// timer1PWMBOn()
|
||||
void timer1PWMBEnable(void) {
|
||||
// turn on channel B (OC1B) PWM output
|
||||
// set OC1B as non-inverted PWM
|
||||
TCCR1A |= _BV(COM1B1);
|
||||
TCCR1A &= ~_BV(COM1B0);
|
||||
}
|
||||
|
||||
// disable timer 1 PWM
|
||||
// timer1PWMBOff()
|
||||
void timer1PWMBDisable(void) {
|
||||
TCCR1A &= ~_BV(COM1B1);
|
||||
TCCR1A &= ~_BV(COM1B0);
|
||||
}
|
||||
|
||||
void enableBacklight(void) {
|
||||
DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output
|
||||
PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high
|
||||
}
|
||||
|
||||
void disableBacklight(void) {
|
||||
// DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input
|
||||
PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low
|
||||
}
|
||||
|
||||
void startPWM(void) {
|
||||
timer1Init();
|
||||
timer1PWMBEnable();
|
||||
enableBacklight();
|
||||
}
|
||||
|
||||
void stopPWM(void) {
|
||||
timer1UnInit();
|
||||
disableBacklight();
|
||||
timer1PWMBDisable();
|
||||
}
|
||||
|
||||
void b_led_init_ports(void) {
|
||||
/* turn backlight on/off depending on user preference */
|
||||
#if BACKLIGHT_ON_STATE == 0
|
||||
// DDRx register: sets the direction of Port D
|
||||
// DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input
|
||||
PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low
|
||||
#else
|
||||
DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output
|
||||
PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high
|
||||
#endif
|
||||
|
||||
timer1PWMSetup();
|
||||
startPWM();
|
||||
|
||||
#ifdef BACKLIGHT_BREATHING
|
||||
breathing_enable();
|
||||
#endif
|
||||
}
|
||||
|
||||
void b_led_set(uint8_t level) {
|
||||
if (level > BACKLIGHT_LEVELS) {
|
||||
level = BACKLIGHT_LEVELS;
|
||||
}
|
||||
|
||||
setPWM((int)(TIMER_TOP * (float) level / BACKLIGHT_LEVELS));
|
||||
}
|
||||
|
||||
// called every matrix scan
|
||||
void b_led_task(void) {
|
||||
// do nothing for now
|
||||
}
|
||||
|
||||
void setPWM(uint16_t xValue) {
|
||||
if (xValue > TIMER_TOP) {
|
||||
xValue = TIMER_TOP;
|
||||
}
|
||||
OCR1B = xValue; // timer1PWMBSet(xValue);
|
||||
}
|
||||
|
||||
#endif // BACKLIGHT_ENABLE
|
15
keyboards/jj40/backlight_custom.h
Normal file
15
keyboards/jj40/backlight_custom.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Backlighting code for PS2AVRGB boards (ATMEGA32A)
|
||||
* Kenneth A. (github.com/krusli | krusli.me)
|
||||
*/
|
||||
|
||||
#ifndef BACKLIGHT_CUSTOM_H
|
||||
#define BACKLIGHT_CUSTOM_H
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
void b_led_init_ports(void);
|
||||
void b_led_set(uint8_t level);
|
||||
void b_led_task(void);
|
||||
void setPWM(uint16_t xValue);
|
||||
|
||||
#endif // BACKLIGHT_CUSTOM_H
|
140
keyboards/jj40/breathing_custom.h
Normal file
140
keyboards/jj40/breathing_custom.h
Normal file
@@ -0,0 +1,140 @@
|
||||
/**
|
||||
* Breathing effect code for PS2AVRGB boards (ATMEGA32A)
|
||||
* Works in conjunction with `backlight.c`.
|
||||
*
|
||||
* Code adapted from `quantum.c` to register with the existing TIMER1 overflow
|
||||
* handler in `backlight.c` instead of setting up its own timer.
|
||||
* Kenneth A. (github.com/krusli | krusli.me)
|
||||
*/
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
#ifdef BACKLIGHT_BREATHING
|
||||
|
||||
#include "backlight_custom.h"
|
||||
|
||||
#ifndef BREATHING_PERIOD
|
||||
#define BREATHING_PERIOD 6
|
||||
#endif
|
||||
|
||||
#define breathing_min() do {breathing_counter = 0;} while (0)
|
||||
#define breathing_max() do {breathing_counter = breathing_period * 244 / 2;} while (0)
|
||||
|
||||
// TODO make this share code with quantum.c
|
||||
|
||||
#define BREATHING_NO_HALT 0
|
||||
#define BREATHING_HALT_OFF 1
|
||||
#define BREATHING_HALT_ON 2
|
||||
#define BREATHING_STEPS 128
|
||||
|
||||
static uint8_t breathing_period = BREATHING_PERIOD;
|
||||
static uint8_t breathing_halt = BREATHING_NO_HALT;
|
||||
static uint16_t breathing_counter = 0;
|
||||
|
||||
static bool breathing = false;
|
||||
|
||||
bool is_breathing(void) {
|
||||
return breathing;
|
||||
}
|
||||
|
||||
// See http://jared.geek.nz/2013/feb/linear-led-pwm
|
||||
static uint16_t cie_lightness(uint16_t v) {
|
||||
if (v <= 5243) // if below 8% of max
|
||||
return v / 9; // same as dividing by 900%
|
||||
else {
|
||||
uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare
|
||||
// to get a useful result with integer division, we shift left in the expression above
|
||||
// and revert what we've done again after squaring.
|
||||
y = y * y * y >> 8;
|
||||
if (y > 0xFFFFUL) // prevent overflow
|
||||
return 0xFFFFU;
|
||||
else
|
||||
return (uint16_t) y;
|
||||
}
|
||||
}
|
||||
|
||||
void breathing_enable(void) {
|
||||
breathing = true;
|
||||
breathing_counter = 0;
|
||||
breathing_halt = BREATHING_NO_HALT;
|
||||
// interrupt already registered
|
||||
}
|
||||
|
||||
void breathing_pulse(void) {
|
||||
if (get_backlight_level() == 0)
|
||||
breathing_min();
|
||||
else
|
||||
breathing_max();
|
||||
breathing_halt = BREATHING_HALT_ON;
|
||||
// breathing_interrupt_enable();
|
||||
breathing = true;
|
||||
}
|
||||
|
||||
void breathing_disable(void) {
|
||||
breathing = false;
|
||||
// backlight_set(get_backlight_level());
|
||||
b_led_set(get_backlight_level()); // custom implementation of backlight_set()
|
||||
}
|
||||
|
||||
void breathing_self_disable(void)
|
||||
{
|
||||
if (get_backlight_level() == 0)
|
||||
breathing_halt = BREATHING_HALT_OFF;
|
||||
else
|
||||
breathing_halt = BREATHING_HALT_ON;
|
||||
}
|
||||
|
||||
void breathing_toggle(void) {
|
||||
if (is_breathing())
|
||||
breathing_disable();
|
||||
else
|
||||
breathing_enable();
|
||||
}
|
||||
|
||||
void breathing_period_set(uint8_t value)
|
||||
{
|
||||
if (!value)
|
||||
value = 1;
|
||||
breathing_period = value;
|
||||
}
|
||||
|
||||
void breathing_period_default(void) {
|
||||
breathing_period_set(BREATHING_PERIOD);
|
||||
}
|
||||
|
||||
void breathing_period_inc(void)
|
||||
{
|
||||
breathing_period_set(breathing_period+1);
|
||||
}
|
||||
|
||||
void breathing_period_dec(void)
|
||||
{
|
||||
breathing_period_set(breathing_period-1);
|
||||
}
|
||||
|
||||
/* To generate breathing curve in python:
|
||||
* from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)]
|
||||
*/
|
||||
static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
// Use this before the cie_lightness function.
|
||||
static inline uint16_t scale_backlight(uint16_t v) {
|
||||
return v / BACKLIGHT_LEVELS * get_backlight_level();
|
||||
}
|
||||
|
||||
void custom_breathing_handler(void) {
|
||||
uint16_t interval = (uint16_t) breathing_period * 244 / BREATHING_STEPS;
|
||||
// resetting after one period to prevent ugly reset at overflow.
|
||||
breathing_counter = (breathing_counter + 1) % (breathing_period * 244);
|
||||
uint8_t index = breathing_counter / interval % BREATHING_STEPS;
|
||||
|
||||
if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) ||
|
||||
((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1)))
|
||||
{
|
||||
// breathing_interrupt_disable();
|
||||
}
|
||||
|
||||
setPWM(cie_lightness(scale_backlight((uint16_t) pgm_read_byte(&breathing_table[index]) * 0x0101U)));
|
||||
}
|
||||
|
||||
#endif // BACKLIGHT_BREATHING
|
||||
#endif // BACKLIGHT_ENABLE
|
@@ -34,8 +34,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
#define BACKLIGHT_PIN B6
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
#define BACKLIGHT_LEVELS 12
|
||||
// #define BACKLIGHT_BREATHING // works, but BL_TOGG might not work
|
||||
|
||||
#define TAPPING_TOGGLE 3
|
||||
|
||||
@@ -45,7 +45,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// The RGB_DI_PIN value seems to be shared between all PS2AVRGB boards.
|
||||
// The same pin is used on the JJ40, at least.
|
||||
#define RGBLED_NUM 5
|
||||
#define RGB_DI_PIN E2
|
||||
#define RGB_DI_PIN E2 // NOTE: for PS2AVRGB boards, underglow commands are sent via I2C to 0xB0.
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
|
||||
/* key combination for command */
|
||||
|
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
|
||||
Modified 2018 Kenneth A. <github.com/krusli>
|
||||
|
||||
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,8 +25,34 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "i2c.h"
|
||||
|
||||
// custom RGB driver
|
||||
#include "backlight.h"
|
||||
#include "backlight_custom.h"
|
||||
|
||||
extern rgblight_config_t rgblight_config;
|
||||
|
||||
// for keyboard subdirectory level init functions
|
||||
// @Override
|
||||
void matrix_init_kb(void) {
|
||||
// call user level keymaps, if any
|
||||
// matrix_init_user();
|
||||
}
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
/// Overrides functions in `quantum.c`
|
||||
void backlight_init_ports(void) {
|
||||
b_led_init_ports();
|
||||
}
|
||||
|
||||
void backlight_task(void) {
|
||||
b_led_task();
|
||||
}
|
||||
|
||||
void backlight_set(uint8_t level) {
|
||||
b_led_set(level);
|
||||
}
|
||||
#endif
|
||||
|
||||
// custom RGB driver
|
||||
void rgblight_set(void) {
|
||||
if (!rgblight_config.enable) {
|
||||
for (uint8_t i=0; i<RGBLED_NUM; i++) {
|
||||
@@ -39,8 +66,15 @@ void rgblight_set(void) {
|
||||
i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
bool rgb_init = false;
|
||||
void matrix_scan_user(void) {
|
||||
rgblight_task();
|
||||
/* Nothing else for now. */
|
||||
// if LEDs were previously on before poweroff, turn them back on
|
||||
if (rgb_init == false && rgblight_config.enable) {
|
||||
i2c_init();
|
||||
i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
|
||||
rgb_init = true;
|
||||
}
|
||||
|
||||
rgblight_task();
|
||||
/* Nothing else for now. */
|
||||
}
|
||||
|
@@ -23,6 +23,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "keycode.h"
|
||||
#include "action.h"
|
||||
|
||||
void matrix_init_user(void); // TODO port this to other PS2AVRGB boards
|
||||
|
||||
#define KEYMAP_GRID( \
|
||||
K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
|
||||
K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
|
||||
|
@@ -1,20 +1,3 @@
|
||||
/*
|
||||
Copyright 2017 Luiz Ribeiro <luizribeiro@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/>.
|
||||
*/
|
||||
|
||||
#include "jj40.h"
|
||||
#include "action_layer.h"
|
||||
|
||||
|
8
keyboards/jj40/keymaps/krusli/config.h
Normal file
8
keyboards/jj40/keymaps/krusli/config.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
#endif
|
@@ -1,20 +1,3 @@
|
||||
/*
|
||||
Copyright 2017 Luiz Ribeiro <luizribeiro@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/>.
|
||||
*/
|
||||
|
||||
#include "jj40.h"
|
||||
#include "action_layer.h"
|
||||
|
||||
@@ -62,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
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, _______, _______,_______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
||||
BL_TOGG, BL_STEP, BL_BRTG, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
||||
),
|
||||
|
||||
/* Raise
|
||||
@@ -73,13 +56,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | F7 | F8 | F9 | F10 | F11 | F12 | RGB | RGB | RGB | RGB |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | RGB | RGB | RGB | RGB | | | Next | Vol- | Vol+ | Play |
|
||||
* | RGB | RGB | RGB | RGB | | | | 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, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, _______, \
|
||||
_______, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
||||
RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
||||
)
|
||||
};
|
||||
|
@@ -29,6 +29,9 @@ static uint8_t debouncing = DEBOUNCE;
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
|
||||
void matrix_set_row_status(uint8_t row);
|
||||
uint8_t bit_reverse(uint8_t x);
|
||||
|
||||
void matrix_init(void) {
|
||||
// all outputs for rows high
|
||||
DDRB = 0xFF;
|
||||
@@ -47,18 +50,8 @@ void matrix_init(void) {
|
||||
matrix[row] = 0x00;
|
||||
matrix_debouncing[row] = 0x00;
|
||||
}
|
||||
}
|
||||
|
||||
void matrix_set_row_status(uint8_t row) {
|
||||
DDRB = (1 << row);
|
||||
PORTB = ~(1 << row);
|
||||
}
|
||||
|
||||
uint8_t bit_reverse(uint8_t x) {
|
||||
x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa);
|
||||
x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc);
|
||||
x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0);
|
||||
return x;
|
||||
matrix_init_quantum(); // missing from original port by Luiz
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void) {
|
||||
@@ -93,11 +86,30 @@ uint8_t matrix_scan(void) {
|
||||
}
|
||||
}
|
||||
|
||||
matrix_scan_user();
|
||||
matrix_scan_quantum(); // also missing in original PS2AVRGB implementation
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// Looping keyboard code goes here
|
||||
// This runs every cycle (a lot)
|
||||
matrix_scan_user();
|
||||
};
|
||||
|
||||
// declarations
|
||||
void matrix_set_row_status(uint8_t row) {
|
||||
DDRB = (1 << row);
|
||||
PORTB = ~(1 << row);
|
||||
}
|
||||
|
||||
uint8_t bit_reverse(uint8_t x) {
|
||||
x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa);
|
||||
x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc);
|
||||
x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0);
|
||||
return x;
|
||||
}
|
||||
|
||||
inline matrix_row_t matrix_get_row(uint8_t row) {
|
||||
return matrix[row];
|
||||
}
|
||||
|
@@ -36,11 +36,13 @@ MOUSEKEY_ENABLE = no
|
||||
EXTRAKEY_ENABLE = yes
|
||||
CONSOLE_ENABLE = no
|
||||
COMMAND_ENABLE = yes
|
||||
BACKLIGHT_ENABLE = no
|
||||
|
||||
BACKLIGHT_ENABLE = yes
|
||||
BACKLIGHT_CUSTOM_DRIVER = yes
|
||||
|
||||
RGBLIGHT_ENABLE = yes
|
||||
RGBLIGHT_CUSTOM_DRIVER = yes
|
||||
DISABLE_WS2812 = yes # TODO check if this is necessary
|
||||
# DISABLE_WS2812 = no
|
||||
|
||||
KEY_LOCK_ENABLE = yes
|
||||
|
||||
@@ -51,7 +53,7 @@ OPT_DEFS = -DDEBUG_LEVEL=0
|
||||
|
||||
# custom matrix setup
|
||||
CUSTOM_MATRIX = yes
|
||||
SRC = matrix.c i2c.c
|
||||
SRC = matrix.c i2c.c backlight.c
|
||||
|
||||
# programming options
|
||||
PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
|
||||
|
@@ -119,7 +119,7 @@ section at the end of this file).
|
||||
* device is powered from the USB bus.
|
||||
*/
|
||||
// max power draw with maxed white underglow measured at 120 mA (peaks)
|
||||
#define USB_CFG_MAX_BUS_POWER 150
|
||||
#define USB_CFG_MAX_BUS_POWER 100
|
||||
/* Set this variable to the maximum USB bus power consumption of your device.
|
||||
* The value is in milliamperes. [It will be divided by two since USB
|
||||
* communicates power requirements in units of 2 mA.]
|
||||
|
@@ -49,8 +49,8 @@ void matrix_init(void)
|
||||
palSetPadMode(GPIOB, 1, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOB, 0, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
|
||||
memset(matrix, 0, MATRIX_ROWS);
|
||||
memset(matrix_debouncing, 0, MATRIX_ROWS);
|
||||
memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t));
|
||||
memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t));
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
|
@@ -42,8 +42,8 @@ void matrix_init(void)
|
||||
palSetPadMode(GPIOD, 1, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOD, 4, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
|
||||
memset(matrix, 0, MATRIX_ROWS);
|
||||
memset(matrix_debouncing, 0, MATRIX_ROWS);
|
||||
memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t));
|
||||
memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t));
|
||||
|
||||
matrix_init_quantum();
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
#define USE_SERIAL
|
||||
// #define USE_I2C
|
||||
#undef USE_I2C
|
||||
|
||||
/* Select hand configuration */
|
||||
|
||||
@@ -71,4 +71,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define STARTUP_SONG SONG(ZELDA_TREASURE)
|
||||
#endif
|
||||
|
||||
#undef PRODUCT
|
||||
#ifdef KEYBOARD_orthodox_rev1
|
||||
#define PRODUCT Drashna Hacked Orthodox Rev.1
|
||||
#elif KEYBOARD_orthodox_rev3
|
||||
#define PRODUCT Drashna Hacked Orthodox Rev.3
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -32,42 +32,30 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
#ifdef FAUXCLICKY_ENABLE
|
||||
float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A6, 2); // (_D4, 0.25);
|
||||
float fauxclicky_released_note[2] = MUSICAL_NOTE(_A6, 2); // (_C4, 0.125);
|
||||
float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 2); // (_C4, 0.25);
|
||||
#define AUD_ON FC_ON
|
||||
#define AUD_OFF FC_OFF
|
||||
#else
|
||||
#define AUD_ON AU_ON
|
||||
#define AUD_OFF AU_OFF
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = KEYMAP(\
|
||||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
|
||||
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
|
||||
OSM(MOD_LSFT),CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \
|
||||
KC_LSFT,CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \
|
||||
),
|
||||
|
||||
[_COLEMAK] = KEYMAP(\
|
||||
KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
|
||||
KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
|
||||
OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \
|
||||
KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \
|
||||
),
|
||||
|
||||
[_DVORAK] = KEYMAP(\
|
||||
KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
|
||||
KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \
|
||||
OSM(MOD_LSFT), CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \
|
||||
KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \
|
||||
),
|
||||
[_WORKMAN] = KEYMAP(\
|
||||
KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
|
||||
KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \
|
||||
OSM(MOD_LSFT), CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \
|
||||
KC_LSFT,CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \
|
||||
),
|
||||
|
||||
[_LOWER] = KEYMAP(\
|
||||
@@ -84,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_ADJUST] = KEYMAP(\
|
||||
KC_MAKE,KC_RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
RGB_SMOD,RGB_HUI, _______, AUD_ON, AUD_OFF, AG_NORM, _______, _______, _______, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, _______, \
|
||||
RGB_SMOD,RGB_HUI, KC_FXCL, AUD_ON, AUD_OFF, AG_NORM, _______, _______, _______, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, _______, \
|
||||
KC_RGB_T,RGB_HUD, MU_ON, MU_OFF, MU_TOG, MU_MOD, _______, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY \
|
||||
)
|
||||
|
||||
|
@@ -1,7 +1,11 @@
|
||||
CONSOLE_ENABLE = no
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # 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
|
||||
TAP_DANCE_ENABLE = no
|
||||
RGBLIGHT_ENABLE = yes
|
||||
AUDIO_ENABLE = no
|
||||
MOUSEKEY_ENABLE = no
|
||||
AUDIO_ENABLE = yes
|
||||
NKRO_ENABLE = yes
|
||||
FAUXCLICKY_ENABLE = no
|
||||
USE_I2C = no
|
||||
|
@@ -10,7 +10,7 @@
|
||||
"width": 12,
|
||||
"height": 5,
|
||||
"layouts": {
|
||||
"LAYOUT_preonic_mit": {
|
||||
"KEYMAP": {
|
||||
"key_count": 59,
|
||||
"layout": [
|
||||
{ "w": 1, "x": 0, "y": 0 },
|
||||
@@ -138,4 +138,4 @@
|
||||
{ "w": 1, "x": 11, "y": 4 } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
3
keyboards/tada68/keymaps/stephengrier/config.h
Executable file
3
keyboards/tada68/keymaps/stephengrier/config.h
Executable file
@@ -0,0 +1,3 @@
|
||||
#include "../../config.h"
|
||||
|
||||
#define BACKLIGHT_BREATHING
|
52
keyboards/tada68/keymaps/stephengrier/keymap.c
Executable file
52
keyboards/tada68/keymaps/stephengrier/keymap.c
Executable file
@@ -0,0 +1,52 @@
|
||||
#include "tada68.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 _FL 1
|
||||
|
||||
#define _______ KC_TRNS
|
||||
|
||||
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| [| ]| \ |Del |
|
||||
* |----------------------------------------------------------------|
|
||||
* |FN | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp|
|
||||
* |----------------------------------------------------------------|
|
||||
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn|
|
||||
* |----------------------------------------------------------------|
|
||||
* |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig |
|
||||
* `----------------------------------------------------------------'
|
||||
*/
|
||||
[_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_GRV, \
|
||||
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, \
|
||||
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_ENT,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,KC_UP,KC_PGDN, \
|
||||
KC_LCTL, KC_LALT,KC_LGUI, KC_SPC, KC_RALT,MO(_FL),KC_RCTRL, KC_LEFT,KC_DOWN,KC_RGHT),
|
||||
|
||||
/* Keymap _FL: Function Layer
|
||||
* ,----------------------------------------------------------------.
|
||||
* | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins |
|
||||
* |----------------------------------------------------------------|
|
||||
* | | |Up | | | | | |UP | | | | | |Hme |
|
||||
* |----------------------------------------------------------------|
|
||||
* | |<- |Dn | ->| | | |<- |Dn | ->| | | |End |
|
||||
* |----------------------------------------------------------------|
|
||||
* | | |BR |Bl-|BL |BL+| |VU-|VU+|MUT| | McL|MsU|McR |
|
||||
* |----------------------------------------------------------------|
|
||||
* | | | | | | | |MsL|MsD|MsR |
|
||||
* `----------------------------------------------------------------'
|
||||
*/
|
||||
[_FL] = 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_INS , \
|
||||
_______,_______, KC_UP,_______,_______, _______,_______,_______, KC_UP,_______,_______,_______,_______, _______,KC_HOME, \
|
||||
_______,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______,_______,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______, _______,KC_END, \
|
||||
_______,_______,BL_BRTG,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),
|
||||
};
|
15
keyboards/tada68/keymaps/stephengrier/readme.md
Executable file
15
keyboards/tada68/keymaps/stephengrier/readme.md
Executable file
@@ -0,0 +1,15 @@
|
||||
# stephengrier's TADA68 layout
|
||||
|
||||
This layout mostly replicates the default ANSI layout of the TADA68 but with a
|
||||
few modifications to suit my tastes.
|
||||
|
||||
The modifications from the default keymap are:
|
||||
|
||||
* Replaced capslock with a second function key
|
||||
* Swapped the left ALT and Win keys to be more like the Mac layout
|
||||
* Added an arrow key cluster on the IJKL keys
|
||||
* Fn+x toggles backlight breathing mode
|
||||
|
||||
With this keymap backlight breathing mode can be enabled/disabled with Fn+x.
|
||||
This is not supported at all in the default keymap.
|
||||
|
21
keyboards/tada68/keymaps/stephengrier/rules.mk
Normal file
21
keyboards/tada68/keymaps/stephengrier/rules.mk
Normal file
@@ -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
|
@@ -47,8 +47,9 @@ void matrix_init(void)
|
||||
palSetPadMode(GPIOC, 10, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOC, 11, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
|
||||
memset(matrix, 0, MATRIX_ROWS);
|
||||
memset(matrix_debouncing, 0, MATRIX_ROWS);
|
||||
memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t));
|
||||
memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t));
|
||||
|
||||
matrix_init_quantum();
|
||||
}
|
||||
|
||||
|
0
keyboards/xd60/keymaps/krusli/HHKB-like.txt
Normal file
0
keyboards/xd60/keymaps/krusli/HHKB-like.txt
Normal file
62
keyboards/xd60/keymaps/krusli/keymap.c
Normal file
62
keyboards/xd60/keymaps/krusli/keymap.c
Normal file
@@ -0,0 +1,62 @@
|
||||
#include "xd60.h"
|
||||
#include "action_layer.h"
|
||||
|
||||
/* HHKB-like layout for standard 60% layout with split RShift and split backspace */
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
// 0: Base Layer
|
||||
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_BSLS, KC_GRV, \
|
||||
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_BSPC, \
|
||||
KC_LCTL, 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, \
|
||||
KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, F(0), \
|
||||
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, F(0), KC_RCTL, KC_RCTL),
|
||||
|
||||
// 1: Function Layer
|
||||
/* Layer HHKB: HHKB mode (HHKB Fn)
|
||||
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
|
||||
| Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
|
||||
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
|
||||
| Caps | | | | | | | | Psc | Slk | Pus | Up | | Backs | |
|
||||
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
|
||||
| | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter | | |
|
||||
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
|
||||
| | | | | | | + | - | End | PgD | Dow | | | | |
|
||||
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
|
||||
|
||||
|------+------+----------------------+------+------+
|
||||
| **** | **** | ******************** | **** | **** |
|
||||
|------+------+----------------------+------+------+
|
||||
*/
|
||||
KEYMAP(
|
||||
RESET, 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_F13, KC_F14, \
|
||||
KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \
|
||||
KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_NO, KC_ENT, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(0), KC_TRNS, KC_TRNS),
|
||||
};
|
||||
|
||||
// Custom Actions
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay
|
||||
};
|
||||
|
||||
// Macros
|
||||
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;
|
||||
};
|
||||
|
||||
// Loop
|
||||
void matrix_scan_user(void) {
|
||||
// Empty
|
||||
};
|
2
keyboards/xd60/keymaps/krusli/readme.md
Normal file
2
keyboards/xd60/keymaps/krusli/readme.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# krusli's HHKB-style keymap for the XD60
|
||||
HHKB-style keymap for the XD60. The board was not built with split backspace but still has Backspace and |\\ swapped.
|
@@ -58,7 +58,7 @@ MSG_SUBMODULE_DIRTY = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \
|
||||
Some git sub-modules are out of date or modified, please consider runnning:$(BOLD)\n\
|
||||
make git-submodule\n\
|
||||
You can ignore this warning if you are not compiling any ChibiOS keyboards,\n\
|
||||
or if you have modified the ChibiOS libraries yourself. \n\n
|
||||
or if you have modified the ChibiOS libraries yourself. \n\n$(NO_COLOR)
|
||||
MSG_NO_CMP = $(ERROR_COLOR)Error:$(NO_COLOR)$(BOLD) cmp command not found, please install diffutils\n$(NO_COLOR)
|
||||
|
||||
define GENERATE_MSG_MAKE_KB
|
||||
|
@@ -18,7 +18,6 @@
|
||||
#include "ch.h"
|
||||
#include "hal.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "print.h"
|
||||
#include "keymap.h"
|
||||
|
@@ -53,127 +53,127 @@
|
||||
|
||||
// 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_12 0.125f
|
||||
#define TIMBRE_25 0.250f
|
||||
#define TIMBRE_50 0.500f
|
||||
#define TIMBRE_75 0.750f
|
||||
#define TIMBRE_DEFAULT TIMBRE_50
|
||||
|
||||
// Notes - # = Octave
|
||||
|
||||
#define NOTE_REST 0.00
|
||||
#define NOTE_REST 0.00f
|
||||
|
||||
/* 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_C0 16.35f
|
||||
#define NOTE_CS0 17.32f
|
||||
#define NOTE_D0 18.35f
|
||||
#define NOTE_DS0 19.45f
|
||||
#define NOTE_E0 20.60f
|
||||
#define NOTE_F0 21.83f
|
||||
#define NOTE_FS0 23.12f
|
||||
#define NOTE_G0 24.50f
|
||||
#define NOTE_GS0 25.96f
|
||||
#define NOTE_A0 27.50f
|
||||
#define NOTE_AS0 29.14f
|
||||
#define NOTE_B0 30.87f
|
||||
#define NOTE_C1 32.70f
|
||||
#define NOTE_CS1 34.65f
|
||||
#define NOTE_D1 36.71f
|
||||
#define NOTE_DS1 38.89f
|
||||
#define NOTE_E1 41.20f
|
||||
#define NOTE_F1 43.65f
|
||||
#define NOTE_FS1 46.25f
|
||||
#define NOTE_G1 49.00f
|
||||
#define NOTE_GS1 51.91f
|
||||
#define NOTE_A1 55.00f
|
||||
#define NOTE_AS1 58.27f
|
||||
*/
|
||||
|
||||
#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
|
||||
#define NOTE_B1 61.74f
|
||||
#define NOTE_C2 65.41f
|
||||
#define NOTE_CS2 69.30f
|
||||
#define NOTE_D2 73.42f
|
||||
#define NOTE_DS2 77.78f
|
||||
#define NOTE_E2 82.41f
|
||||
#define NOTE_F2 87.31f
|
||||
#define NOTE_FS2 92.50f
|
||||
#define NOTE_G2 98.00f
|
||||
#define NOTE_GS2 103.83f
|
||||
#define NOTE_A2 110.00f
|
||||
#define NOTE_AS2 116.54f
|
||||
#define NOTE_B2 123.47f
|
||||
#define NOTE_C3 130.81f
|
||||
#define NOTE_CS3 138.59f
|
||||
#define NOTE_D3 146.83f
|
||||
#define NOTE_DS3 155.56f
|
||||
#define NOTE_E3 164.81f
|
||||
#define NOTE_F3 174.61f
|
||||
#define NOTE_FS3 185.00f
|
||||
#define NOTE_G3 196.00f
|
||||
#define NOTE_GS3 207.65f
|
||||
#define NOTE_A3 220.00f
|
||||
#define NOTE_AS3 233.08f
|
||||
#define NOTE_B3 246.94f
|
||||
#define NOTE_C4 261.63f
|
||||
#define NOTE_CS4 277.18f
|
||||
#define NOTE_D4 293.66f
|
||||
#define NOTE_DS4 311.13f
|
||||
#define NOTE_E4 329.63f
|
||||
#define NOTE_F4 349.23f
|
||||
#define NOTE_FS4 369.99f
|
||||
#define NOTE_G4 392.00f
|
||||
#define NOTE_GS4 415.30f
|
||||
#define NOTE_A4 440.00f
|
||||
#define NOTE_AS4 466.16f
|
||||
#define NOTE_B4 493.88f
|
||||
#define NOTE_C5 523.25f
|
||||
#define NOTE_CS5 554.37f
|
||||
#define NOTE_D5 587.33f
|
||||
#define NOTE_DS5 622.25f
|
||||
#define NOTE_E5 659.26f
|
||||
#define NOTE_F5 698.46f
|
||||
#define NOTE_FS5 739.99f
|
||||
#define NOTE_G5 783.99f
|
||||
#define NOTE_GS5 830.61f
|
||||
#define NOTE_A5 880.00f
|
||||
#define NOTE_AS5 932.33f
|
||||
#define NOTE_B5 987.77f
|
||||
#define NOTE_C6 1046.50f
|
||||
#define NOTE_CS6 1108.73f
|
||||
#define NOTE_D6 1174.66f
|
||||
#define NOTE_DS6 1244.51f
|
||||
#define NOTE_E6 1318.51f
|
||||
#define NOTE_F6 1396.91f
|
||||
#define NOTE_FS6 1479.98f
|
||||
#define NOTE_G6 1567.98f
|
||||
#define NOTE_GS6 1661.22f
|
||||
#define NOTE_A6 1760.00f
|
||||
#define NOTE_AS6 1864.66f
|
||||
#define NOTE_B6 1975.53f
|
||||
#define NOTE_C7 2093.00f
|
||||
#define NOTE_CS7 2217.46f
|
||||
#define NOTE_D7 2349.32f
|
||||
#define NOTE_DS7 2489.02f
|
||||
#define NOTE_E7 2637.02f
|
||||
#define NOTE_F7 2793.83f
|
||||
#define NOTE_FS7 2959.96f
|
||||
#define NOTE_G7 3135.96f
|
||||
#define NOTE_GS7 3322.44f
|
||||
#define NOTE_A7 3520.00f
|
||||
#define NOTE_AS7 3729.31f
|
||||
#define NOTE_B7 3951.07f
|
||||
#define NOTE_C8 4186.01f
|
||||
#define NOTE_CS8 4434.92f
|
||||
#define NOTE_D8 4698.64f
|
||||
#define NOTE_DS8 4978.03f
|
||||
#define NOTE_E8 5274.04f
|
||||
#define NOTE_F8 5587.65f
|
||||
#define NOTE_FS8 5919.91f
|
||||
#define NOTE_G8 6271.93f
|
||||
#define NOTE_GS8 6644.88f
|
||||
#define NOTE_A8 7040.00f
|
||||
#define NOTE_AS8 7458.62f
|
||||
#define NOTE_B8 7902.13f
|
||||
|
||||
// Flat Aliases
|
||||
#define NOTE_DF0 NOTE_CS0
|
||||
|
@@ -53,6 +53,24 @@
|
||||
E__NOTE(_CS4), E__NOTE(_B4), QD_NOTE(_AS4), \
|
||||
E__NOTE(_AS4), E__NOTE(_AS4), QD_NOTE(_B4),
|
||||
|
||||
#define CLUEBOARD_SOUND \
|
||||
HD_NOTE(_C3), HD_NOTE(_D3), HD_NOTE(_E3), HD_NOTE(_F3), HD_NOTE(_G3), HD_NOTE(_A4), HD_NOTE(_B4), HD_NOTE(_C4)
|
||||
/*
|
||||
HD_NOTE(_G3), HD_NOTE(_E3), HD_NOTE(_C3), \
|
||||
Q__NOTE(_E3), Q__NOTE(_C3), Q__NOTE(_G3), \
|
||||
Q__NOTE(_E3)
|
||||
*/
|
||||
/*
|
||||
HD_NOTE(_C3), HD_NOTE(_G3), HD_NOTE(_E3), \
|
||||
Q__NOTE(_G3), Q__NOTE(_E3), Q__NOTE(_G3), \
|
||||
Q__NOTE(_F3)
|
||||
*/
|
||||
|
||||
#define BASKET_CASE \
|
||||
QD_NOTE(_G3), E__NOTE(_F3), E__NOTE(_E3), Q__NOTE(_F3), M__NOTE(_G3, 8+32), Q__NOTE(_REST), \
|
||||
Q__NOTE(_B4), Q__NOTE(_C4), Q__NOTE(_B4), E__NOTE(_A4), Q__NOTE(_G3), M__NOTE(_G3, 8+32), Q__NOTE(_REST), \
|
||||
Q__NOTE(_B4), Q__NOTE(_C4), Q__NOTE(_B4), E__NOTE(_A4), Q__NOTE(_G3), Q__NOTE(_G3), Q__NOTE(_G3), Q__NOTE(_G3), E__NOTE(_A4), E__NOTE(_C4), QD_NOTE(_B4), HD_NOTE(_B4)
|
||||
|
||||
#define STARTUP_SOUND \
|
||||
E__NOTE(_E6), \
|
||||
E__NOTE(_A6), \
|
||||
|
@@ -138,13 +138,13 @@ void reset_keyboard(void) {
|
||||
clear_keyboard();
|
||||
#if defined(MIDI_ENABLE) && defined(MIDI_BASIC)
|
||||
process_midi_all_notes_off();
|
||||
#endif
|
||||
#endif
|
||||
#if defined(AUDIO_ENABLE)
|
||||
music_all_notes_off();
|
||||
uint16_t timer_start = timer_read();
|
||||
PLAY_SONG(goodbye_song);
|
||||
shutdown_user();
|
||||
while(timer_elapsed(timer_start) < 250)
|
||||
while(timer_elapsed(timer_start) < 250)
|
||||
wait_ms(1);
|
||||
stop_all_notes();
|
||||
#else
|
||||
@@ -885,6 +885,7 @@ void backlight_set(uint8_t level) {}
|
||||
|
||||
uint8_t backlight_tick = 0;
|
||||
|
||||
#ifndef BACKLIGHT_CUSTOM_DRIVER
|
||||
void backlight_task(void) {
|
||||
if ((0xFFFF >> ((BACKLIGHT_LEVELS - get_backlight_level()) * ((BACKLIGHT_LEVELS + 1) / 2))) & (1 << backlight_tick)) {
|
||||
#if BACKLIGHT_ON_STATE == 0
|
||||
@@ -905,9 +906,12 @@ void backlight_task(void) {
|
||||
}
|
||||
backlight_tick = backlight_tick + 1 % 16;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BACKLIGHT_BREATHING
|
||||
#error "Backlight breathing only available with hardware PWM. Please disable."
|
||||
#ifndef BACKLIGHT_CUSTOM_DRIVER
|
||||
#error "Backlight breathing only available with hardware PWM. Please disable."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#else // pwm through timer
|
||||
@@ -935,6 +939,7 @@ static inline void set_pwm(uint16_t val) {
|
||||
OCR1x = val;
|
||||
}
|
||||
|
||||
#ifndef BACKLIGHT_CUSTOM_DRIVER
|
||||
__attribute__ ((weak))
|
||||
void backlight_set(uint8_t level) {
|
||||
if (level > BACKLIGHT_LEVELS)
|
||||
@@ -952,6 +957,7 @@ void backlight_set(uint8_t level) {
|
||||
}
|
||||
|
||||
void backlight_task(void) {}
|
||||
#endif // BACKLIGHT_CUSTOM_DRIVER
|
||||
|
||||
#ifdef BACKLIGHT_BREATHING
|
||||
|
||||
|
@@ -94,4 +94,4 @@ void backlight_level(uint8_t level)
|
||||
uint8_t get_backlight_level(void)
|
||||
{
|
||||
return backlight_config.level;
|
||||
}
|
||||
}
|
||||
|
@@ -30,6 +30,15 @@ PROGMEM const char secret[][64] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef FAUXCLICKY_ENABLE
|
||||
float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A6, 2); // (_D4, 0.25);
|
||||
float fauxclicky_released_note[2] = MUSICAL_NOTE(_A6, 2); // (_C4, 0.125);
|
||||
#else
|
||||
float fauxclicky_pressed[][2] = SONG(E__NOTE(_A6)); // change to your tastes
|
||||
float fauxclicky_released[][2] = SONG(E__NOTE(_A6)); // change to your tastes
|
||||
#endif
|
||||
bool faux_click_enabled = true;
|
||||
|
||||
#ifdef TAP_DANCE_ENABLE
|
||||
//define diablo macro timer variables
|
||||
static uint16_t diablo_timer[4];
|
||||
@@ -222,11 +231,22 @@ void persistent_default_layer_set(uint16_t default_layer) {
|
||||
// Defines actions tor my global custom keycodes. Defined in drashna.h file
|
||||
// Then runs the _keymap's recod handier if not processed here
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
||||
|
||||
#ifdef CONSOLE_ENABLE
|
||||
xprintf("KL: row: %u, column: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed);
|
||||
#endif
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
if (faux_click_enabled) {
|
||||
if (record->event.pressed) {
|
||||
PLAY_SONG(fauxclicky_pressed);
|
||||
} else {
|
||||
stop_note(NOTE_A6);
|
||||
PLAY_SONG(fauxclicky_released);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (keycode) {
|
||||
case KC_QWERTY:
|
||||
if (record->event.pressed) {
|
||||
@@ -295,7 +315,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
#if !(defined(KEYBOARD_orthodox_rev1) || defined(KEYBOARD_ergodox_ez))
|
||||
#if !(defined(KEYBOARD_orthodox_rev1) || defined(KEYBOARD_orthodox_rev3) || defined(KEYBOARD_ergodox_ez))
|
||||
case KC_OVERWATCH:
|
||||
if (record->event.pressed) {
|
||||
is_overwatch = !is_overwatch;
|
||||
@@ -460,11 +480,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
" AUDIO_ENABLE=yes"
|
||||
#else
|
||||
" AUDIO_ENABLE=no"
|
||||
#endif
|
||||
#ifdef FAUXCLICKY_ENABLE
|
||||
" FAUXCLICKY_ENABLE=yes"
|
||||
#else
|
||||
" FAUXCLICKY_ENABLE=no"
|
||||
#endif
|
||||
SS_TAP(X_ENTER));
|
||||
}
|
||||
@@ -499,6 +514,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case KC_FXCL:
|
||||
if (!record->event.pressed) {
|
||||
faux_click_enabled = !faux_click_enabled;
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case KC_RGB_T: // Because I want the option to go back to normal RGB mode rather than always layer indication
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
if (record->event.pressed) {
|
||||
|
@@ -101,6 +101,7 @@ enum userspace_custom_keycodes {
|
||||
KC_SECRET_3,
|
||||
KC_SECRET_4,
|
||||
KC_SECRET_5,
|
||||
KC_FXCL,
|
||||
NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes
|
||||
};
|
||||
|
||||
@@ -133,4 +134,12 @@ enum {
|
||||
|
||||
#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
|
||||
|
||||
#ifdef FAUXCLICKY_ENABLE
|
||||
#define AUD_ON FC_ON
|
||||
#define AUD_OFF FC_OFF
|
||||
#else
|
||||
#define AUD_ON AU_ON
|
||||
#define AUD_OFF AU_OFF
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user