Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for Preonic rev 3 #3449

Merged
merged 3 commits into from
Jul 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions keyboards/preonic/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)

/* ws2812 RGB LED */
#define RGB_DI_PIN D1
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 28 // Number of LEDs
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17

/*
* Feature disable options
* These options are also useful to firmware size reduction.
Expand Down
16 changes: 8 additions & 8 deletions keyboards/preonic/keymaps/CMD-Preonic/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite| Ctrl | Alt | GUI |Lower | Space | Raise| - | = | [ | ] |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT_preonic_mit( \
[_QWERTY] = LAYOUT_preonic_1x2uC( \
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, 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_BSLASH, \
LT(_RAISE, KC_ENT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
Expand All @@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite| Ctrl | Alt | GUI |Lower | Space | Raise| - | = | [ | ] |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = LAYOUT_preonic_mit( \
[_COLEMAK] = LAYOUT_preonic_1x2uC( \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, _______, \
_______, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
Expand All @@ -86,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite| Ctrl | Alt | GUI |Lower | Space | Raise| - | = | [ | ] |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = LAYOUT_preonic_mit( \
[_DVORAK] = LAYOUT_preonic_1x2uC( \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______, \
_______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, _______, \
Expand All @@ -107,7 +107,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite| Ctrl | Alt | XXX | Lower | Space | Raise| - | = | [ | ] |
* `-----------------------------------------------------------------------------------'
*/
[_GAME] = LAYOUT_preonic_mit( \
[_GAME] = LAYOUT_preonic_1x2uC( \
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, 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_BSLASH,\
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
Expand All @@ -128,7 +128,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | 0 | 0 | . | Enter| Lower| Space | Raise| - | = | [ | ] |
* `-----------------------------------------------------------------------------------'
*/
[_NUMPAD] = LAYOUT_preonic_mit( \
[_NUMPAD] = LAYOUT_preonic_1x2uC( \
KC_ESC, KC_PSLS, KC_PAST, KC_PMNS, _______, _______, _______, _______, _______, _______, _______, _______, \
KC_P7, KC_P8, KC_P9, KC_PPLS, _______, _______, _______, _______, _______, _______, _______, _______, \
KC_P4, KC_P5, KC_P6, KC_PPLS, _______, _______, _______, _______, _______, _______, _______, _______, \
Expand All @@ -148,7 +148,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Vol- | | | | | | | + | Enter| 0 | . |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT_preonic_mit( \
[_LOWER] = LAYOUT_preonic_1x2uC( \
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, \
KC_MUTE, KC_BSPC, KC_UP, KC_DEL, KC_WWW_FORWARD, KC_BTN1, KC_MS_U, KC_BTN2, KC_PSLS, KC_P7, KC_P8, KC_P9, \
_______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_WWW_REFRESH, KC_MS_L, KC_MS_D, KC_MS_R, KC_PAST, KC_P4, KC_P5, KC_P6, \
Expand All @@ -169,7 +169,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT_preonic_mit( \
[_RAISE] = LAYOUT_preonic_1x2uC( \
KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
_______, KC_BSPC, KC_PGUP, KC_DEL, _______, _______, _______, KC_PGUP, KC_UP, _______, _______, _______, \
_______, KC_HOME, KC_PGDN, KC_END, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, \
Expand All @@ -190,7 +190,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | Reset | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT_preonic_mit( \
[_ADJUST] = LAYOUT_preonic_1x2uC( \
_______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, _______, _______, _______, _______, _______, \
_______, RESET, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, _______, KC_DEL, \
_______, _______, _______, AU_ON, AU_OFF, MI_ON, MI_OFF, QWERTY, COLEMAK, DVORAK, _______, _______, \
Expand Down
14 changes: 7 additions & 7 deletions keyboards/preonic/keymaps/blake-newman/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | | Alt | Ctrl | Shift|
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT_preonic_mit( \
[_QWERTY] = LAYOUT_preonic_1x2uC( \
KC_GRV, KC_1, KC_2, KC_5, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
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_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
Expand All @@ -72,7 +72,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | | Alt | Ctrl | Shift|
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = LAYOUT_preonic_mit( \
[_COLEMAK] = LAYOUT_preonic_1x2uC( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
Expand All @@ -93,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | | Alt | Ctrl | Shift|
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = LAYOUT_preonic_mit( \
[_DVORAK] = LAYOUT_preonic_1x2uC( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
Expand All @@ -114,7 +114,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | 0 | . | Ctrl | Shift|
* `-----------------------------------------------------------------------------------'
*/
[_NUMPAD] = LAYOUT_preonic_mit( \
[_NUMPAD] = LAYOUT_preonic_1x2uC( \
KC_ESC, _______, _______, KC_PGDN, KC_PGUP, KC_END, KC_HOME, _______, KC_PSLS, KC_PAST, KC_PMNS, KC_DEL, \
KC_TAB, _______, KC_UP, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_BSPC, \
KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_P4, KC_P5, KC_P6, _______, KC_QUOT, \
Expand All @@ -136,7 +136,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite| Ctrl | Alt | GUI |Lower | Enter |Raise | | Alt | Ctrl | Shift|
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT_preonic_mit( \
[_LOWER] = LAYOUT_preonic_1x2uC( \
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_ESC, _______, KC_UP, _______, _______, _______, _______, KC_UNDS, KC_MINS, KC_PLUS, KC_EQL, KC_BSPC, \
KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_BSLS, \
Expand All @@ -157,7 +157,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite| Ctrl | Alt | GUI |Lower | Enter |Raise | | Alt | Ctrl | Shift|
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT_preonic_mit( \
[_RAISE] = LAYOUT_preonic_1x2uC( \
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_ESC, _______, KC_UP, _______, _______, _______, _______, KC_MINS, KC_UNDS, KC_EQL, KC_PLUS, KC_BSPC, \
KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, KC_PIPE, \
Expand All @@ -178,7 +178,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT_preonic_mit( \
[_ADJUST] = LAYOUT_preonic_1x2uC( \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,LALT(KC_PSCR), LCTL(KC_PSCR), KC_PSCR, \
KC_CAPS, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, NUMPAD, KC_INS, \
Expand Down
84 changes: 84 additions & 0 deletions keyboards/preonic/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include QMK_KEYBOARD_H
#include "muse.h"

enum preonic_layers {
_QWERTY,
Expand Down Expand Up @@ -211,13 +212,96 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#ifdef BACKLIGHT_ENABLE
backlight_step();
#endif
#ifdef __AVR__
PORTE &= ~(1<<6);
#endif
} else {
unregister_code(KC_RSFT);
#ifdef __AVR__
PORTE |= (1<<6);
#endif
}
return false;
break;
}
return true;
};

bool muse_mode = false;
uint8_t last_muse_note = 0;
uint16_t muse_counter = 0;
uint8_t muse_offset = 70;
uint16_t muse_tempo = 50;

void encoder_update(bool clockwise) {
if (muse_mode) {
if (IS_LAYER_ON(_RAISE)) {
if (clockwise) {
muse_offset++;
} else {
muse_offset--;
}
} else {
if (clockwise) {
muse_tempo+=1;
} else {
muse_tempo-=1;
}
}
} else {
if (clockwise) {
register_code(KC_PGDN);
unregister_code(KC_PGDN);
} else {
register_code(KC_PGUP);
unregister_code(KC_PGUP);
}
}
}

void dip_update(uint8_t index, bool active) {
switch (index) {
case 0:
if (active) {
layer_on(_ADJUST);
} else {
layer_off(_ADJUST);
}
break;
case 1:
if (active) {
muse_mode = true;
} else {
muse_mode = false;
#ifdef AUDIO_ENABLE
stop_all_notes();
#endif
}
}
}

void matrix_scan_user(void) {
#ifdef AUDIO_ENABLE
if (muse_mode) {
if (muse_counter == 0) {
uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
if (muse_note != last_muse_note) {
stop_note(compute_freq_for_midi_note(last_muse_note));
play_note(compute_freq_for_midi_note(muse_note), 0xF);
last_muse_note = muse_note;
}
}
muse_counter = (muse_counter + 1) % muse_tempo;
}
#endif
}

bool music_mask_user(uint16_t keycode) {
switch (keycode) {
case RAISE:
case LOWER:
return false;
default:
return true;
}
}
1 change: 1 addition & 0 deletions keyboards/preonic/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SRC += muse.c
10 changes: 5 additions & 5 deletions keyboards/preonic/keymaps/dlaroe/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Ctrl | GUI | \ | Alt |Lower | Space |Raise | [ | - | = | ] |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT_preonic_mit( \
[_QWERTY] = LAYOUT_preonic_1x2uC( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
KC_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_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
Expand All @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Ctrl | GUI | \ | Alt |Lower | Space |Raise | Left | Down | Up | Right |
* `-----------------------------------------------------------------------------------'
*/
[_ARROW] = LAYOUT_preonic_mit( \
[_ARROW] = LAYOUT_preonic_1x2uC( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
KC_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_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
Expand All @@ -85,7 +85,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | 0 | | [ | - | + | ] |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT_preonic_mit( \
[_LOWER] = LAYOUT_preonic_1x2uC( \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
KC_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_4, KC_5, KC_6, KC_DOT, KC_ASTR, \
Expand All @@ -106,7 +106,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | App | | | | Ins | | Home | PGDN | PGUP | End |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT_preonic_mit( \
[_RAISE] = LAYOUT_preonic_1x2uC( \
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_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL,
KC_DEL, KC_WH_U, KC_BTN2, KC_MS_U, KC_BTN1, QWERTY, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PIPE, KC_GRV,
Expand All @@ -127,7 +127,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite| | | | | Play/Pause | | BL_T |BL_DEC|BL_INC|BL_ST |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT_preonic_mit( \
[_ADJUST] = LAYOUT_preonic_1x2uC( \
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
LALT(LCTL(KC_INS)), QWERTY, _______, _______, RESET, M(0), _______, MAGIC_TOGGLE_NKRO, _______, _______, _______, LALT(LCTL(KC_DEL)),
KC_CAPS, ARROW, _______, AU_ON, AU_OFF, _______, AG_SWAP, AG_NORM, KC_PSCR, KC_SLCK, KC_PAUS, _______,
Expand Down
Loading