summaryrefslogtreecommitdiff
path: root/keyboards/preonic
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2022-06-27 16:38:28 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2022-06-27 16:38:28 +0200
commit98b9909429aea0869f7a6f2f44ab386a4a3ff094 (patch)
treee1080a61bb89a75edc70818489f8044adf597c48 /keyboards/preonic
parentb610965fd6d851484025166fb255078b1c809261 (diff)
parentfa3dd373b4925734d9843ae6014349069ffec353 (diff)
downloadqmk_firmware-98b9909429aea0869f7a6f2f44ab386a4a3ff094.tar.gz
qmk_firmware-98b9909429aea0869f7a6f2f44ab386a4a3ff094.zip
Merge branch 'master' into taamas
Diffstat (limited to 'keyboards/preonic')
-rw-r--r--keyboards/preonic/config.h7
-rw-r--r--keyboards/preonic/keymaps/arkag/rules.mk2
-rw-r--r--keyboards/preonic/keymaps/badger/keymap.c2
-rw-r--r--keyboards/preonic/keymaps/default/keymap.c2
-rw-r--r--keyboards/preonic/keymaps/dlaroe/rules.mk2
-rw-r--r--keyboards/preonic/keymaps/era1112/config.h60
-rw-r--r--keyboards/preonic/keymaps/era1112/keymap.c365
-rw-r--r--keyboards/preonic/keymaps/era1112/readme.md8
-rw-r--r--keyboards/preonic/keymaps/era1112/rules.mk26
-rw-r--r--keyboards/preonic/keymaps/uqs/keymap.c117
-rw-r--r--keyboards/preonic/keymaps/uqs/rules.mk14
-rw-r--r--keyboards/preonic/keymaps/via/keymap.c2
-rw-r--r--keyboards/preonic/preonic.c20
-rw-r--r--keyboards/preonic/rev1/config.h5
-rw-r--r--keyboards/preonic/rev1/rules.mk10
-rw-r--r--keyboards/preonic/rev2/config.h5
-rw-r--r--keyboards/preonic/rev2/rules.mk10
-rw-r--r--keyboards/preonic/rev3/config.h7
-rw-r--r--keyboards/preonic/rev3/rev3.c3
-rw-r--r--keyboards/preonic/rev3/rules.mk11
-rw-r--r--keyboards/preonic/rev3_drop/config.h2
-rw-r--r--keyboards/preonic/rev3_drop/rev3_drop.c3
-rw-r--r--keyboards/preonic/rev3_drop/rules.mk5
23 files changed, 635 insertions, 53 deletions
diff --git a/keyboards/preonic/config.h b/keyboards/preonic/config.h
index dfd0a8439a..6bcfa26380 100644
--- a/keyboards/preonic/config.h
+++ b/keyboards/preonic/config.h
@@ -15,8 +15,7 @@ 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
+#pragma once
#include "config_common.h"
@@ -76,7 +75,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
-//#define NO_ACTION_MACRO
-//#define NO_ACTION_FUNCTION
-
-#endif
diff --git a/keyboards/preonic/keymaps/arkag/rules.mk b/keyboards/preonic/keymaps/arkag/rules.mk
index 671da6f94d..5b87801fca 100644
--- a/keyboards/preonic/keymaps/arkag/rules.mk
+++ b/keyboards/preonic/keymaps/arkag/rules.mk
@@ -1,4 +1,4 @@
-BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite
+BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = no
STENO_ENABLE = no
EXTRAKEY_ENABLE = yes
diff --git a/keyboards/preonic/keymaps/badger/keymap.c b/keyboards/preonic/keymaps/badger/keymap.c
index 495cf28c45..761beb861f 100644
--- a/keyboards/preonic/keymaps/badger/keymap.c
+++ b/keyboards/preonic/keymaps/badger/keymap.c
@@ -14,7 +14,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// if not REV3, just compile the default keymaps
-#ifndef REV3_CONFIG_H
+#ifndef KEYBOARD_preonic_rev3
#include "../default/keymap.c"
#else
diff --git a/keyboards/preonic/keymaps/default/keymap.c b/keyboards/preonic/keymaps/default/keymap.c
index f99a6953c6..ef7614393d 100644
--- a/keyboards/preonic/keymaps/default/keymap.c
+++ b/keyboards/preonic/keymaps/default/keymap.c
@@ -157,7 +157,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_ADJUST] = LAYOUT_preonic_grid(
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
- _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL,
+ _______, QK_BOOT, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL,
_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______,
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
diff --git a/keyboards/preonic/keymaps/dlaroe/rules.mk b/keyboards/preonic/keymaps/dlaroe/rules.mk
index 38fb7375c0..4a62771e70 100644
--- a/keyboards/preonic/keymaps/dlaroe/rules.mk
+++ b/keyboards/preonic/keymaps/dlaroe/rules.mk
@@ -4,7 +4,7 @@
# 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 = lite # Enable Bootmagic Lite
+BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
diff --git a/keyboards/preonic/keymaps/era1112/config.h b/keyboards/preonic/keymaps/era1112/config.h
new file mode 100644
index 0000000000..86cc6135e5
--- /dev/null
+++ b/keyboards/preonic/keymaps/era1112/config.h
@@ -0,0 +1,60 @@
+// Copyright 2022 Era James(@Era1112)
+// SPDX - License - Identifier: GPL - 2.0 - or -later
+
+#pragma once
+
+
+//----------- Default statements -----------//
+//------------------------------------------//
+#define MUSIC_MASK (keycode < 0xFF)
+
+/*
+ * MIDI options
+ */
+
+/* enable basic MIDI features:
+ - MIDI notes can be sent when in Music mode is on
+*/
+#define MIDI_BASIC
+
+/* enable advanced MIDI features:
+ - MIDI notes can be added to the keymap
+ - Octave shift and transpose
+ - Virtual sustain, portamento, and modulation wheel
+ - etc.
+*/
+#define MIDI_ADVANCED
+
+/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
+//#define MIDI_TONE_KEYCODE_OCTAVES 2
+
+
+//----------- Added statements -------------//
+//------------------------------------------//
+#define TAPPING_TERM 200 // For tapdances
+
+// Commented to see if it helps stalls on clicky mode #define DYNAMIC_MACRO_NO_NESTING // Improve dynamic macro stability
+#ifdef AUDIO_ENABLE
+ #define AUDIO_INIT_DELAY // to make startup audio work
+ #define STARTUP_SONG SONG(PREONIC_SOUND)
+ #define AUDIO_CLICKY // enable clicky mode
+
+ // Clicky mode parameters
+ #define AUDIO_CLICKY_FREQ_MIN 65.0f // Default 65
+ #define AUDIO_CLICKY_FREQ_DEFAULT 800.0f // Default 440
+ #define AUDIO_CLICKY_FREQ_MAX 1500.0f // Defaul 1500
+ #define AUDIO_CLICKY_FREQ_RANDOMNESS 1.0f // Default 0.05
+ #define AUDIO_CLICKY_DELAY_DURATION 0.1f // Default 1
+#endif //AUDIO_ENABLE
+
+#define RGBLIGHT_SLEEP // RGB lights turn off when host sleeps
+
+// Firmware minimization
+
+// Commented to see if it helps stalls on clicky mode
+// #define NO_ACTION_ONESHOT
+// #undef LOCKING_SUPPORT_ENABLE
+// #undef LOCKING_RESYNC_ENABLE
+// #define NO_MUSIC_MODE
+// #define LAYER_STATE_8BIT // Limits keymap to 8 layers
+// #undef RGBLIGHT_ANIMATIONS // Removes rgb animations
diff --git a/keyboards/preonic/keymaps/era1112/keymap.c b/keyboards/preonic/keymaps/era1112/keymap.c
new file mode 100644
index 0000000000..4031f998db
--- /dev/null
+++ b/keyboards/preonic/keymaps/era1112/keymap.c
@@ -0,0 +1,365 @@
+// Copyright 2022 Era James(@Era1112)
+// SPDX - License - Identifier: GPL - 2.0 - or -later
+
+#include QMK_KEYBOARD_H // Default statement
+
+#define HSV_RETRO_CONSOLE 36, 150, 255 //HSV_YELLOW = 43, 255, 255
+
+
+//----------- RGB Default Settings -----------//
+//--------------------------------------------//
+#ifdef RGBLIGHT_ENABLE
+
+void keyboard_post_init_user(void) {
+ rgblight_enable_noeeprom(); // Enables RGB, without saving settings
+ rgblight_sethsv_noeeprom(HSV_RETRO_CONSOLE);
+ rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
+}
+
+#endif // RGBLIGHT_ENABLE
+
+//----------- Layer names -----------//
+//-----------------------------------//
+enum preonic_layers {
+ _QWERTY,
+ _LOWER,
+ _RAISE,
+ _ADJUST,
+};
+
+
+//----------- Sounds -----------//
+//------------------------------//
+#ifdef AUDIO_ENABLE
+
+ float capslockToggleSound[][2] = SONG(STARTUP_SOUND);
+ float dynamicBufferRecordSound[][2] = SONG(STARTUP_SOUND);
+ float dynamicBufferFullSound[][2] = SONG(GOODBYE_SOUND);
+
+#endif // AUDIO_ENABLE
+
+
+//----------- Called when dynamic buffer full -----------//
+//-------------------------------------------------------//
+void backlight_toggle(void) {
+#ifdef AUDIO_ENABLE
+
+ PLAY_SONG(dynamicBufferFullSound);
+
+#endif // AUDIO_ENABLE
+}
+
+
+//----------- Tapdance prelims -----------//
+//----------------------------------------//
+typedef enum {
+ TD_NONE,
+ TD_UNKNOWN,
+ TD_1_TAP,
+ TD_1_HOLD,
+ TD_2_TAP,
+ TD_2_HOLD,
+} td_state_t;
+
+typedef struct {
+ bool is_press_action;
+ td_state_t state;
+} td_tap_t;
+
+td_state_t cur_dance(qk_tap_dance_state_t* state);
+
+/* Return an integer that corresponds to what kind of tap dance should be executed.
+ *
+ * How to figure out tap dance state: interrupted and pressed.
+ *
+ * Interrupted: If the state of a dance dance is "interrupted", that means that another key has been hit
+ * under the tapping term. This is typically indicitive that you are trying to "tap" the key.
+ *
+ * Pressed: Whether or not the key is still being pressed. If this value is true, that means the tapping term
+ * has ended, but the key is still being pressed down. This generally means the key is being "held".
+ *
+ * One thing that is currenlty not possible with qmk software in regards to tap dance is to mimic the "permissive hold"
+ * feature. In general, advanced tap dances do not work well if they are used with commonly typed letters.
+ * For example "A". Tap dances are best used on non-letter keys that are not hit while typing letters.
+ *
+ * Good places to put an advanced tap dance:
+ * z,q,x,j,k,v,b, any function key, home/end, comma, semi-colon
+ *
+ * Criteria for "good placement" of a tap dance key:
+ * Not a key that is hit frequently in a sentence
+ * Not a key that is used frequently to double tap, for example 'tab' is often double tapped in a terminal, or
+ * in a web form. So 'tab' would be a poor choice for a tap dance.
+ * Letters used in common words as a double. For example 'p' in 'pepper'. If a tap dance function existed on the
+ * letter 'p', the word 'pepper' would be quite frustating to type.
+ *
+ * For the third point, there does exist the 'TD_DOUBLE_SINGLE_TAP', however this is not fully tested
+ *
+ */
+td_state_t cur_dance(qk_tap_dance_state_t* state) {
+ if (state->count == 1) {
+ if (state->interrupted || !state->pressed) {
+ return TD_1_TAP;
+ // Key has not been interrupted, but the key is still held. Means you want to send a 'HOLD'.
+ } else {
+ return TD_1_HOLD;
+ }
+ } else if (state->count == 2) {
+ // TD_DOUBLE_SINGLE_TAP is to distinguish between typing "pepper", and actually wanting a double tap
+ // action when hitting 'pp'. Suggested use case for this return value is when you want to send two
+ // keystrokes of the key, and not the 'double tap' action/macro.
+ if (state->pressed) return TD_2_HOLD;
+ else return TD_2_TAP;
+ } else {
+ return TD_UNKNOWN;
+ }
+}
+
+
+//----------- 2tap capslock --------------//
+//----------------------------------------//
+void twoCapsLock_finished(qk_tap_dance_state_t* state, void* user_data);
+void twoCapsLock_reset(qk_tap_dance_state_t* state, void* user_data);
+
+static td_tap_t twoCapsLock_tap_state = {
+ .is_press_action = true,
+ .state = TD_NONE
+};
+
+void twoCapsLock_finished(qk_tap_dance_state_t* state, void* user_data) {
+ twoCapsLock_tap_state.state = cur_dance(state);
+ switch (twoCapsLock_tap_state.state) {
+ case TD_NONE: register_code(KC_LSFT); break;
+ case TD_UNKNOWN: register_code(KC_LSFT); break;
+ case TD_1_TAP: register_code(KC_LSFT); break;
+ case TD_1_HOLD: register_code(KC_LSFT); break;
+ case TD_2_TAP:
+ register_code(KC_CAPS);
+#ifdef AUDIO_ENABLE
+ PLAY_SONG(capslockToggleSound);
+#endif // AUDIO_ENABLE
+ break;
+ case TD_2_HOLD: register_code(KC_LSFT); break;
+ }
+}
+
+void twoCapsLock_reset(qk_tap_dance_state_t* state, void* user_data) {
+ switch (twoCapsLock_tap_state.state) {
+ case TD_UNKNOWN: unregister_code(KC_LSFT); break;
+ case TD_NONE: unregister_code(KC_LSFT); break;
+ case TD_1_TAP: unregister_code(KC_LSFT); break;
+ case TD_1_HOLD: unregister_code(KC_LSFT); break;
+ case TD_2_TAP:
+ unregister_code(KC_CAPS);
+#ifdef AUDIO_ENABLE
+ PLAY_SONG(capslockToggleSound);
+#endif // AUDIO_ENABLE
+ break;
+ case TD_2_HOLD: unregister_code(KC_LSFT); break;
+ }
+ twoCapsLock_tap_state.state = TD_NONE;
+}
+
+
+//----------- Rotary Encoder --------------//
+//----------------------------------------//
+bool encoder_update_user(uint8_t index, bool clockwise) {
+ if (layer_state_is(_QWERTY)) {
+ if (clockwise) {
+ tap_code(KC_WH_U);
+ } else {
+ tap_code(KC_WH_D);
+ }
+ }
+ else if (layer_state_is(_LOWER)) {
+ if (clockwise) {
+ tap_code16(S(KC_F3));
+ } else {
+ tap_code(KC_F3);
+ }
+ } else if (layer_state_is(_RAISE)) {
+ if (clockwise) {
+ tap_code16(C(KC_Z));
+ } else {
+ tap_code16(C(KC_Y));
+ }
+ }
+ return false;
+}
+
+//----------- Custom keycodes ------------//
+//----------------------------------------//
+enum {
+ TD_2_CAPSLOCK
+};
+
+enum custom_keycodes {
+ CU_BLNKON = SAFE_RANGE,
+ CU_BLNKOFF,
+ CU_RGBON,
+ CU_RGBOFF,
+ ENC_MODE
+};
+
+static bool blinky = false; // Track blinky behavior on/off for keycode
+
+qk_tap_dance_action_t tap_dance_actions[] = {
+ [TD_2_CAPSLOCK] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, twoCapsLock_finished, twoCapsLock_reset)
+};
+
+
+//----------- Intercepts and overrides ------------//
+//-------------------------------------=-----------//
+bool process_record_user(uint16_t keycode, keyrecord_t* record) {
+ switch (keycode) {
+ // Turn RGB LEDs off
+ case CU_RGBOFF:
+
+ // If pressed
+ if (record->event.pressed) {
+ rgblight_sethsv_noeeprom(HSV_OFF);
+ return true;
+
+ // If released
+ } else {
+ return true;
+ }
+
+ // Turn RGB LEDs on
+ case CU_RGBON:
+
+ // If pressed
+ if (record->event.pressed) {
+ rgblight_sethsv_noeeprom(HSV_RETRO_CONSOLE);
+ return true;
+
+ // If released
+ } else {
+ return true;
+ }
+
+ // Turn blinky LEDs off
+ case CU_BLNKOFF:
+
+ // If pressed
+ if (record->event.pressed) {
+ blinky = false;
+ return true;
+
+ // If released
+ } else {
+ return true;
+ }
+
+ // Turn blinky LEDs on
+ case CU_BLNKON:
+
+ // If pressed
+ if (record->event.pressed) {
+ blinky = true;
+ return true;
+
+ // If released
+ } else {
+ return true;
+ }
+
+ // Sound when Dynamic recording started
+ case DYN_REC_START1:
+
+ // If pressed
+ if (record->event.pressed) {
+ #ifdef AUDIO_ENABLE
+ PLAY_SONG(dynamicBufferRecordSound);
+ #endif // AUDIO_ENABLE
+ return true; // Let QMK send the press/release events
+
+ // If released
+ } else {
+ return true; // Let QMK send the press/release events
+ }
+
+ // Sound when Dynamic recording stopped
+ case DYN_REC_STOP:
+
+ // If pressed
+ if (record->event.pressed) {
+ #ifdef AUDIO_ENABLE
+ PLAY_SONG(dynamicBufferFullSound);
+ #endif // AUDIO_ENABLE
+ return true; // Let QMK send the enter press/release events
+
+ // If released
+ } else {
+ return true; // Let QMK send the press/release events
+ }
+
+ // Encoder Click
+ case ENC_MODE:
+ if (record->event.pressed) {
+ if (layer_state_is(_QWERTY)) {
+ tap_code(KC_BTN1);
+ return false;
+ } else if (layer_state_is(_LOWER)) {
+ return false;
+ } else if (layer_state_is(_RAISE)) {
+ return false;
+ }
+ }
+
+
+ // Adds blinks if blinky is on
+ default:
+ if (blinky == true) {
+ rgblight_toggle();
+ }
+
+ return true; // Process all other keycodes normally
+
+ }
+}
+
+
+//----------- Keymap ------------//
+//-------------------------------//
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ // main layer
+ [_QWERTY] = LAYOUT_ortho_5x12 (
+ // (Non-disabled top row), uncomment and replace if you want preonic-style instead of planck-style
+ // KC_MINS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ 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_ENT,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TD(TD_2_CAPSLOCK),
+ ENC_MODE, KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
+ ),
+
+ // lower key
+ [_LOWER] = LAYOUT_ortho_5x12 (
+ DYN_MACRO_PLAY1, DYN_REC_START1, DYN_REC_STOP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
+ KC_BSPC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_QUOT, KC_GRV, KC_LCBR, KC_RCBR, KC_TRNS,
+ KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_TRNS, KC_BSLS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_ADJUST), KC_HOME, KC_PGDN, KC_PGUP, KC_END
+ ),
+
+ // raise key
+ [_RAISE] = LAYOUT_ortho_5x12 (
+ DYN_MACRO_PLAY1, DYN_REC_START1, DYN_REC_STOP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL,
+ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_DQUO, KC_TILD, KC_LBRC, KC_RBRC, KC_TRNS,
+ KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_UNDS, KC_PLUS , KC_TRNS, KC_PIPE, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(_ADJUST), KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_F24
+ ),
+
+ // hardware adjust layer, raise+lower
+ [_ADJUST] = LAYOUT_ortho_5x12 (
+ AU_ON, AU_OFF, CK_ON, CK_OFF, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+
+ CU_RGBON, CU_RGBOFF, CU_BLNKON, CU_BLNKOFF, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
+ )
+
+};
diff --git a/keyboards/preonic/keymaps/era1112/readme.md b/keyboards/preonic/keymaps/era1112/readme.md
new file mode 100644
index 0000000000..76775b85aa
--- /dev/null
+++ b/keyboards/preonic/keymaps/era1112/readme.md
@@ -0,0 +1,8 @@
+A preonic keymap that includes:
+- doubletap tapdance for caps lock
+- rotary encoder
+- macro record/playback
+- light on/off
+- sound on/off
+- blink-on-keypress w/ on/off keystroke
+- beep-on-keypress w/ on/off keystroke (this has stability issues when typing fast, still trying to remediate) \ No newline at end of file
diff --git a/keyboards/preonic/keymaps/era1112/rules.mk b/keyboards/preonic/keymaps/era1112/rules.mk
new file mode 100644
index 0000000000..4e83382dad
--- /dev/null
+++ b/keyboards/preonic/keymaps/era1112/rules.mk
@@ -0,0 +1,26 @@
+## Copyright 2022 Era James (@Era1112)
+## SPDX-License-Identifier: GPL-2.0-or-later
+
+# DEFAULT STATEMENTS
+# ==================
+
+SRC += muse.c
+
+
+# ADDED STATEMENTS
+# ================
+
+AUDIO_ENABLE = yes # Audio output on
+TAP_DANCE_ENABLE = yes # For double-tap tapdances
+DYNAMIC_MACRO_ENABLE = yes # For dynamuic macros
+RGBLIGHT_ENABLE = yes # For RGB lighting functions
+ENCODER_ENABLE = yes # For Rotary encoders
+
+
+# Firmware minimization
+# Commented to see if it helps stalls on clicky mode
+CONSOLE_ENABLE = no
+#LTO_ENABLE = yes
+SPACE_CADET_ENABLE = no
+GRAVE_ESC_ENABLE = no
+MAGIC_ENABLE = no
diff --git a/keyboards/preonic/keymaps/uqs/keymap.c b/keyboards/preonic/keymaps/uqs/keymap.c
new file mode 100644
index 0000000000..ec22890388
--- /dev/null
+++ b/keyboards/preonic/keymaps/uqs/keymap.c
@@ -0,0 +1,117 @@
+// Copyright 2022 Ulrich Spörlein (@uqs)
+// SPDX-License-Identifier: GPL-2.0-or-later
+// vi:et sw=4 cc=5,15,25,35,45,55,65:
+
+#include "uqs.h"
+
+/*
+ * My custom layout macro that allows for easy diff(1) operations between
+ * various keyboards. It probably doesn't make sense to you.
+ */
+#define LAYOUT_uqs( \
+ k00, k01, k02, k03, k04, k05, \
+ k10, k11, k12, k13, k14, k15, \
+ k20, k21, k22, k23, k24, k25, \
+ k30, k31, k32, k33, k34, k35, \
+ k43, k44, \
+ k40, k41, k42, \
+ k06, k07, k08, k09, k0a, k0b, \
+ k16, k17, k18, k19, k1a, k1b, \
+ k26, k27, k28, k29, k2a, k2b, \
+ k36, k37, k38, k39, k3a, k3b, \
+ k46, k48, \
+ k49, k4a, k4b \
+) \
+LAYOUT_preonic_2x2u( \
+ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
+ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
+ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
+ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \
+ k40, k41, k42, k43, k44, k46, k48, k49, k4a, k4b \
+)
+
+// clang-format off
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [L_QWER] = LAYOUT_uqs(
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T,
+ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B,
+
+ /*thumb*/ LT_EXTD_ESC, KC_SPC,
+ /*aux*/ KC_NO, KC_LGUI, KC_LALT,
+ KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS,
+ KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
+ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
+ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
+ /*thumb*/ KC_ENT, LT_NUM_BSPC,
+ /*aux*/ MO(L_FUNC), KC_NO, KC_NO
+ ),
+ [L_EXTD] = LAYOUT_uqs(
+ KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5,
+ _______, KC_BTN1, KC_SCTAB, KC_PGUP, KC_CTAB, KC_LEAD,
+ _______, OSM_GUI, OSM_ALT, OSM_SFT, OSM_CTL, KC_RALT,
+ _______, ALT_TAB, MS_WHUP, MS_WHDN, KC_PGDN, INS_HARD,
+ /*thumb*/ _______, _______,
+ /*aux*/ _______, _______, _______,
+ /* ^^^^ can't be used */
+ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12,
+ KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_INS, KC_NO,
+ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_DEL, KC_NO,
+ WIN_LEFT, WIN_DN, WIN_UP, WIN_RGHT, KC_PSTE, KC_NO,
+ /*thumb*/ _______, KC_BSPC,
+ /*aux*/ _______, _______, KC_ENTER
+ /* ^^^^ use these */
+ ),
+
+ [L_NUM] = LAYOUT_uqs(
+ KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5,
+ _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC,
+ _______, KC_SCLN, KC_COLN, KC_LCBR, KC_LPRN, KC_LBRC,
+ _______, KC_CIRC, KC_AMPR, KC_RCBR, KC_RPRN, KC_RBRC,
+ /*thumb*/ KC_ESC, _______,
+ /*aux*/ _______, _______, _______,
+ /* ^^^^ use these */
+ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12,
+ KC_EQUAL, KC_7, KC_8, KC_9, KC_KP_PLUS,_______,
+ KC_KP_ASTERISK,KC_4,KC_5, KC_6, MINS_UNDSCR,_______,
+ KC_COMM, KC_1, KC_2, KC_3, KC_KP_SLASH,KC_KP_ENTER, // Enter here, because thumb is occupied
+ /*thumb*/ _______, _______,
+ /*aux*/ KC_0, KC_KP_DOT, _______
+ /* ^^^^ can't be used */
+ ),
+
+ [L_FUNC] = LAYOUT_uqs(
+ _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ _______, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO,
+ _______, KC_LGUI, KC_LALT, KC_LSFT, KC_LCTL, KC_NO,
+ _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ /*thumb*/ _______, _______,
+ /*aux*/ _______, _______, _______,
+ /* ^^^^ use these */
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F10, KC_NO,
+ KC_SLCK, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO,
+ KC_PAUS, KC_F1, KC_F2, KC_F3, KC_F12, KC_NO,
+ /*thumb*/ _______, _______,
+ /*aux*/ _______, _______, _______
+ /* ^^^^ can't be used */
+ ),
+
+ [L_MOUSE] = LAYOUT_uqs(
+ KC_NO, _______, _______, _______, _______, _______,
+ KC_NO, KC_NO, KC_BTN2, KC_BTN3, KC_BTN1, KC_VOLU,
+ KC_NO, KC_NO, KC_ACL0, KC_ACL1, KC_ACL2, KC_VOLD,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE,
+ /*thumb*/ _______, _______,
+ /*aux*/ _______, _______, _______,
+ /* ^^^^ can't be used */
+ _______, _______, _______, _______, _______, _______,
+ _______, _______, KC_MS_UP, MS_WHUP, _______, _______,
+ MS_WHLEFT,KC_MS_L, KC_MS_D, KC_MS_R, MS_WHRGHT,_______,
+ _______, MS_WHDN, KC_BTN3, KC_BTN4, KC_BTN5, _______,
+ /*thumb*/ KC_BTN1, KC_BTN2,
+ /*aux*/ KC_NO, KC_NO, KC_NO
+ /* use these ^^^^ */
+ ),
+};
diff --git a/keyboards/preonic/keymaps/uqs/rules.mk b/keyboards/preonic/keymaps/uqs/rules.mk
new file mode 100644
index 0000000000..ca99fa107c
--- /dev/null
+++ b/keyboards/preonic/keymaps/uqs/rules.mk
@@ -0,0 +1,14 @@
+LTO_ENABLE=no
+AUDIO_ENABLE=no
+ENCODER_ENABLE=no
+
+# Broken with gcc >6, see https://github.com/qmk/qmk_firmware/issues/6753
+# (yes, different option, but I suspect the code has moved around)
+# This produces working firmware on Arch Linux with GCC 11, but is still broken
+# on Debian with 8.3.1
+RGBLIGHT_ENABLE=no
+RGB_MATRIX_ENABLE=no
+
+# not required, but helps on debian where there is a soft/hard float confusion.
+# but see above, gcc 8.3.1 still fucks up the firmware.
+USE_FPU=no
diff --git a/keyboards/preonic/keymaps/via/keymap.c b/keyboards/preonic/keymaps/via/keymap.c
index fe62441049..40d5340d9a 100644
--- a/keyboards/preonic/keymaps/via/keymap.c
+++ b/keyboards/preonic/keymaps/via/keymap.c
@@ -105,7 +105,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_ADJUST] = LAYOUT_preonic_grid(
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
- _______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL,
+ _______, QK_BOOT, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL,
_______, _______, MU_MOD, AU_ON, AU_OFF, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, MU_ON, MU_OFF, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
diff --git a/keyboards/preonic/preonic.c b/keyboards/preonic/preonic.c
index 16c99d9a80..2b56805202 100644
--- a/keyboards/preonic/preonic.c
+++ b/keyboards/preonic/preonic.c
@@ -7,3 +7,23 @@ const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_preonic_grid(
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
);
+
+#ifdef ENCODER_ENABLE
+bool encoder_update_kb(uint8_t index, bool clockwise) {
+ if (!encoder_update_user(index, clockwise)) { return false; }
+ if (get_highest_layer(layer_state) > 0) {
+ if (clockwise) {
+ tap_code_delay(KC_VOLU, 10);
+ } else {
+ tap_code_delay(KC_VOLD, 10);
+ }
+ } else {
+ if (clockwise) {
+ tap_code(KC_PGDN);
+ } else {
+ tap_code(KC_PGUP);
+ }
+ }
+ return true;
+}
+#endif
diff --git a/keyboards/preonic/rev1/config.h b/keyboards/preonic/rev1/config.h
index 76b6465909..a1091b10ed 100644
--- a/keyboards/preonic/rev1/config.h
+++ b/keyboards/preonic/rev1/config.h
@@ -15,12 +15,9 @@ 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 REV1_CONFIG_H
-#define REV1_CONFIG_H
+#pragma once
#include "config_common.h"
#define DEVICE_VER 0x0001
#define PRODUCT_ID 0x67F3
-
-#endif \ No newline at end of file
diff --git a/keyboards/preonic/rev1/rules.mk b/keyboards/preonic/rev1/rules.mk
index 5cc5be7f7b..026f39123f 100644
--- a/keyboards/preonic/rev1/rules.mk
+++ b/keyboards/preonic/rev1/rules.mk
@@ -5,22 +5,18 @@ MCU = atmega32u4
BOOTLOADER = atmel-dfu
# 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
+# change yes to no to disable
#
-BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite
+BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
-NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE = no # Enable N-Key Rollover
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
AUDIO_ENABLE = yes # Audio output
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
-
LAYOUTS = ortho_5x12
LTO_ENABLE = yes
diff --git a/keyboards/preonic/rev2/config.h b/keyboards/preonic/rev2/config.h
index 29fc091848..a62fed4850 100644
--- a/keyboards/preonic/rev2/config.h
+++ b/keyboards/preonic/rev2/config.h
@@ -15,12 +15,9 @@ 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 REV2_CONFIG_H
-#define REV2_CONFIG_H
+#pragma once
#include "config_common.h"
#define DEVICE_VER 0x0002
#define PRODUCT_ID 0x67F3
-
-#endif \ No newline at end of file
diff --git a/keyboards/preonic/rev2/rules.mk b/keyboards/preonic/rev2/rules.mk
index 9d3bef39f1..ba0e8d864a 100644
--- a/keyboards/preonic/rev2/rules.mk
+++ b/keyboards/preonic/rev2/rules.mk
@@ -5,22 +5,18 @@ MCU = atmega32u4
BOOTLOADER = qmk-dfu
# 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
+# change yes to no to disable
#
-BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite
+BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
-NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE = no # Enable N-Key Rollover
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
AUDIO_ENABLE = yes # Audio output
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
-
LAYOUTS = ortho_5x12
LTO_ENABLE = yes
diff --git a/keyboards/preonic/rev3/config.h b/keyboards/preonic/rev3/config.h
index 420e7e5413..efa32d5916 100644
--- a/keyboards/preonic/rev3/config.h
+++ b/keyboards/preonic/rev3/config.h
@@ -15,8 +15,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef REV3_CONFIG_H
-#define REV3_CONFIG_H
+#pragma once
/* USB Device descriptor parameter */
#define DEVICE_VER 0x0003
@@ -90,8 +89,6 @@
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
-//#define NO_ACTION_MACRO
-//#define NO_ACTION_FUNCTION
/*
* WS2812 Underglow Matrix options
@@ -107,5 +104,3 @@
#define WS2812_PWM_PAL_MODE 1
#define WS2812_DMA_STREAM STM32_DMA1_STREAM2
#define WS2812_DMA_CHANNEL 2
-
-#endif
diff --git a/keyboards/preonic/rev3/rev3.c b/keyboards/preonic/rev3/rev3.c
index 7ccff70611..4739a1d2d8 100644
--- a/keyboards/preonic/rev3/rev3.c
+++ b/keyboards/preonic/rev3/rev3.c
@@ -58,4 +58,7 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
{{5, 8}, {4, 8}, {3, 8}, {2, 8}, {1, 8}, {0, 8}},
{{5, 9}, {4, 9}, {3, 9}, {2, 9}, {1, 9}, {0, 9}},
};
+# ifdef ENCODER_MAP_ENABLE
+const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0};
+# endif
#endif
diff --git a/keyboards/preonic/rev3/rules.mk b/keyboards/preonic/rev3/rules.mk
index b89945642b..5f511ee5db 100644
--- a/keyboards/preonic/rev3/rules.mk
+++ b/keyboards/preonic/rev3/rules.mk
@@ -6,24 +6,19 @@ BOARD = QMK_PROTON_C
BOOTLOADER = stm32-dfu
# 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
+# change yes to no to disable
#
-BOOTMAGIC_ENABLE = lite # Enable Bootmagic Lite
+BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug
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
+NKRO_ENABLE = yes # Enable N-Key Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
AUDIO_ENABLE = yes # Audio output
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
WS2812_DRIVER = pwm
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
-#SLEEP_LED_ENABLE = yes
-
# Do not enable RGB_MATRIX_ENABLE together with RGBLIGHT_ENABLE
RGB_MATRIX_ENABLE = no
RGB_MATRIX_DRIVER = WS2812
diff --git a/keyboards/preonic/rev3_drop/config.h b/keyboards/preonic/rev3_drop/config.h
index 1a0605e739..813675eb84 100644
--- a/keyboards/preonic/rev3_drop/config.h
+++ b/keyboards/preonic/rev3_drop/config.h
@@ -91,8 +91,6 @@
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
-//#define NO_ACTION_MACRO
-//#define NO_ACTION_FUNCTION
/*
* WS2812 Underglow Matrix options
diff --git a/keyboards/preonic/rev3_drop/rev3_drop.c b/keyboards/preonic/rev3_drop/rev3_drop.c
index 0b3f452c44..279f367876 100644
--- a/keyboards/preonic/rev3_drop/rev3_drop.c
+++ b/keyboards/preonic/rev3_drop/rev3_drop.c
@@ -58,4 +58,7 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
{{5, 8}, {4, 8}, {3, 8}, {2, 8}, {1, 8}, {0, 8}},
{{5, 9}, {4, 9}, {3, 9}, {2, 9}, {1, 9}, {0, 9}},
};
+# ifdef ENCODER_MAP_ENABLE
+const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {0};
+# endif
#endif
diff --git a/keyboards/preonic/rev3_drop/rules.mk b/keyboards/preonic/rev3_drop/rules.mk
index 8ab62afe21..3d0e376081 100644
--- a/keyboards/preonic/rev3_drop/rules.mk
+++ b/keyboards/preonic/rev3_drop/rules.mk
@@ -12,10 +12,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug
COMMAND_ENABLE = yes # Commands for debug and configuration
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE = yes # USB Nkey Rollover
+NKRO_ENABLE = yes # Enable N-Key Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
AUDIO_ENABLE = yes # Audio output