summaryrefslogtreecommitdiff
path: root/keyboards/sofle
diff options
context:
space:
mode:
authorjack <0x6A73@pm.me>2024-01-23 06:51:31 -0700
committerGitHub <noreply@github.com>2024-01-23 13:51:31 +0000
commite446366326c67071d3afbc4cbfbaa8d8db7bf0cd (patch)
tree4bf2c538f17e362fb8a5c12b8e4c6de2f89fff20 /keyboards/sofle
parent2c3d0126bae9bd70a4b6746be83e4b91f8fbb5d9 (diff)
Fixup sofle (#22934)
* initial * Update keyboards/sofle/info.json Co-authored-by: Joel Challis <git@zvecr.com> * Update keyboards/sofle/info.json Co-authored-by: Drashna Jaelre <drashna@live.com> --------- Co-authored-by: Joel Challis <git@zvecr.com> Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/sofle')
-rw-r--r--keyboards/sofle/info.json117
-rw-r--r--[-rwxr-xr-x]keyboards/sofle/keyhive/config.h0
-rw-r--r--keyboards/sofle/keyhive/info.json13
-rw-r--r--[-rwxr-xr-x]keyboards/sofle/keyhive/readme.md0
-rw-r--r--[-rwxr-xr-x]keyboards/sofle/keyhive/rules.mk17
-rw-r--r--keyboards/sofle/keymaps/default/keymap.c163
-rw-r--r--keyboards/sofle/keymaps/default/readme.md8
-rw-r--r--keyboards/sofle/keymaps/default/rules.mk6
-rw-r--r--keyboards/sofle/keymaps/via/config.h50
-rw-r--r--keyboards/sofle/keymaps/via/keymap.c29
-rw-r--r--keyboards/sofle/keymaps/via/oled.c85
-rw-r--r--keyboards/sofle/keymaps/via/readme.md2
-rw-r--r--keyboards/sofle/keymaps/via/rules.mk7
-rw-r--r--keyboards/sofle/readme.md2
-rw-r--r--keyboards/sofle/rev1/info.json13
-rw-r--r--keyboards/sofle/rev1/readme.md2
-rw-r--r--keyboards/sofle/rev1/rev1.c87
-rw-r--r--keyboards/sofle/rev1/rules.mk3
-rw-r--r--keyboards/sofle/rules.mk2
-rw-r--r--keyboards/sofle/sofle.c89
20 files changed, 238 insertions, 457 deletions
diff --git a/keyboards/sofle/info.json b/keyboards/sofle/info.json
new file mode 100644
index 0000000000..91fdfd38be
--- /dev/null
+++ b/keyboards/sofle/info.json
@@ -0,0 +1,117 @@
1{
2 "keyboard_name": "Sofle",
3 "features": {
4 "bootmagic": true,
5 "extrakey": true,
6 "mousekey": true,
7 "nkro": true,
8 "encoder": true,
9 "oled": true
10 },
11 "build": {
12 "lto": true
13 },
14 "usb": {
15 "vid": "0xFC32"
16 },
17 "diode_direction": "COL2ROW",
18 "qmk": {
19 "tap_keycode_delay": 10
20 },
21 "split": {
22 "enabled": true,
23 "soft_serial_pin": "D2",
24 "transport": {
25 "sync": {
26 "matrix_state": true
27 }
28 }
29 },
30 "ws2812": {
31 "pin": "D3"
32 },
33 "rgblight": {
34 "led_count": 72,
35 "split_count": [36, 36],
36 "sleep": true
37 },
38 "rgb_matrix": {
39 "driver": "ws2812",
40 "split_count": [36, 36],
41 "sleep": true,
42 "layout": [
43 {"x": 96, "y": 40, "flags": 8},
44 {"x": 16, "y": 20, "flags": 2},
45 {"x": 48, "y": 10, "flags": 2},
46 {"x": 80, "y": 18, "flags": 2},
47 {"x": 88, "y": 60, "flags": 2},
48 {"x": 56, "y": 57, "flags": 2},
49 {"x": 24, "y": 60, "flags": 2},
50 {"matrix": [4, 0], "x": 32, "y": 57, "flags": 4},
51 {"matrix": [3, 0], "x": 0, "y": 48, "flags": 4},
52 {"matrix": [2, 0], "x": 0, "y": 36, "flags": 4},
53 {"matrix": [1, 0], "x": 0, "y": 24, "flags": 4},
54 {"matrix": [0, 0], "x": 0, "y": 12, "flags": 4},
55 {"matrix": [0, 1], "x": 16, "y": 12, "flags": 4},
56 {"matrix": [1, 1], "x": 16, "y": 24, "flags": 4},
57 {"matrix": [2, 1], "x": 16, "y": 36, "flags": 4},
58 {"matrix": [3, 1], "x": 16, "y": 48, "flags": 4},
59 {"matrix": [4, 1], "x": 48, "y": 55, "flags": 4},
60 {"matrix": [4, 2], "x": 64, "y": 57, "flags": 4},
61 {"matrix": [3, 2], "x": 32, "y": 45, "flags": 4},
62 {"matrix": [2, 2], "x": 32, "y": 33, "flags": 4},
63 {"matrix": [1, 2], "x": 32, "y": 21, "flags": 4},
64 {"matrix": [0, 2], "x": 32, "y": 9, "flags": 4},
65 {"matrix": [0, 3], "x": 48, "y": 7, "flags": 4},
66 {"matrix": [1, 3], "x": 48, "y": 19, "flags": 4},
67 {"matrix": [2, 3], "x": 48, "y": 31, "flags": 4},
68 {"matrix": [3, 3], "x": 48, "y": 43, "flags": 4},
69 {"matrix": [4, 3], "x": 80, "y": 59, "flags": 4},
70 {"matrix": [4, 4], "x": 96, "y": 64, "flags": 4},
71 {"matrix": [3, 4], "x": 64, "y": 45, "flags": 4},
72 {"matrix": [2, 4], "x": 64, "y": 33, "flags": 4},
73 {"matrix": [1, 4], "x": 64, "y": 21, "flags": 4},
74 {"matrix": [0, 4], "x": 64, "y": 9, "flags": 4},
75 {"matrix": [0, 5], "x": 80, "y": 10, "flags": 4},
76 {"matrix": [1, 5], "x": 80, "y": 22, "flags": 4},
77 {"matrix": [2, 5], "x": 80, "y": 34, "flags": 4},
78 {"matrix": [3, 5], "x": 80, "y": 47, "flags": 4},
79 {"x": 128, "y": 40, "flags": 8},
80 {"x": 208, "y": 20, "flags": 2},
81 {"x": 176, "y": 10, "flags": 2},
82 {"x": 144, "y": 18, "flags": 2},
83 {"x": 136, "y": 60, "flags": 2},
84 {"x": 168, "y": 57, "flags": 2},
85 {"x": 200, "y": 60, "flags": 2},
86 {"matrix": [9, 0], "x": 192, "y": 57, "flags": 4},
87 {"matrix": [8, 0], "x": 224, "y": 48, "flags": 4},
88 {"matrix": [7, 0], "x": 224, "y": 36, "flags": 4},
89 {"matrix": [6, 0], "x": 224, "y": 24, "flags": 4},
90 {"matrix": [5, 0], "x": 224, "y": 12, "flags": 4},
91 {"matrix": [5, 1], "x": 208, "y": 12, "flags": 4},
92 {"matrix": [6, 1], "x": 208, "y": 24, "flags": 4},
93 {"matrix": [7, 1], "x": 208, "y": 36, "flags": 4},
94 {"matrix": [8, 1], "x": 208, "y": 48, "flags": 4},
95 {"matrix": [9, 1], "x": 176, "y": 55, "flags": 4},
96 {"matrix": [9, 2], "x": 160, "y": 57, "flags": 4},
97 {"matrix": [8, 2], "x": 192, "y": 45, "flags": 4},
98 {"matrix": [7, 2], "x": 192, "y": 33, "flags": 4},
99 {"matrix": [6, 2], "x": 192, "y": 21, "flags": 4},
100 {"matrix": [5, 2], "x": 192, "y": 9, "flags": 4},
101 {"matrix": [5, 3], "x": 176, "y": 7, "flags": 4},
102 {"matrix": [6, 3], "x": 176, "y": 19, "flags": 4},
103 {"matrix": [7, 3], "x": 176, "y": 31, "flags": 4},
104 {"matrix": [8, 3], "x": 176, "y": 43, "flags": 4},
105 {"matrix": [9, 3], "x": 144, "y": 59, "flags": 4},
106 {"matrix": [9, 4], "x": 128, "y": 64, "flags": 4},
107 {"matrix": [8, 4], "x": 160, "y": 45, "flags": 4},
108 {"matrix": [7, 4], "x": 160, "y": 33, "flags": 4},
109 {"matrix": [6, 4], "x": 160, "y": 21, "flags": 4},
110 {"matrix": [5, 4], "x": 160, "y": 9, "flags": 4},
111 {"matrix": [5, 5], "x": 144, "y": 10, "flags": 4},
112 {"matrix": [6, 5], "x": 144, "y": 22, "flags": 4},
113 {"matrix": [7, 5], "x": 144, "y": 34, "flags": 4},
114 {"matrix": [8, 5], "x": 144, "y": 47, "flags": 4}
115 ]
116 }
117}
diff --git a/keyboards/sofle/keyhive/config.h b/keyboards/sofle/keyhive/config.h
index cda0be789e..cda0be789e 100755..100644
--- a/keyboards/sofle/keyhive/config.h
+++ b/keyboards/sofle/keyhive/config.h
diff --git a/keyboards/sofle/keyhive/info.json b/keyboards/sofle/keyhive/info.json
index ae7c4a1935..8c76e875b0 100644
--- a/keyboards/sofle/keyhive/info.json
+++ b/keyboards/sofle/keyhive/info.json
@@ -1,14 +1,11 @@
1{ 1{
2 "keyboard_name": "Sofle", 2 "keyboard_name": "Sofle",
3 "manufacturer": "Keyhive", 3 "manufacturer": "Keyhive",
4 "development_board": "elite_c",
4 "usb": { 5 "usb": {
5 "vid": "0xFC32",
6 "pid": "0x1287", 6 "pid": "0x1287",
7 "device_version": "0.0.2" 7 "device_version": "0.0.2"
8 }, 8 },
9 "ws2812": {
10 "pin": "D3"
11 },
12 "rgblight": { 9 "rgblight": {
13 "hue_steps": 10, 10 "hue_steps": 10,
14 "led_count": 74, 11 "led_count": 74,
@@ -21,14 +18,12 @@
21 "cols": ["B6", "B2", "B3", "B1", "F7", "F6", null], 18 "cols": ["B6", "B2", "B3", "B1", "F7", "F6", null],
22 "rows": ["C6", "D7", "E6", "B4", "B5"] 19 "rows": ["C6", "D7", "E6", "B4", "B5"]
23 }, 20 },
24 "diode_direction": "COL2ROW",
25 "encoder": { 21 "encoder": {
26 "rotary": [ 22 "rotary": [
27 {"pin_a": "F5", "pin_b": "F4"} 23 {"pin_a": "F5", "pin_b": "F4"}
28 ] 24 ]
29 }, 25 },
30 "split": { 26 "split": {
31 "soft_serial_pin": "D2",
32 "encoder": { 27 "encoder": {
33 "right": { 28 "right": {
34 "rotary": [ 29 "rotary": [
@@ -44,17 +39,11 @@
44 }, 39 },
45 "transport": { 40 "transport": {
46 "sync": { 41 "sync": {
47 "matrix_state": true,
48 "oled": true, 42 "oled": true,
49 "wpm": true 43 "wpm": true
50 } 44 }
51 } 45 }
52 }, 46 },
53 "qmk": {
54 "tap_keycode_delay": 10
55 },
56 "processor": "atmega32u4",
57 "bootloader": "atmel-dfu",
58 "layouts": { 47 "layouts": {
59 "LAYOUT": { 48 "LAYOUT": {
60 "layout": [ 49 "layout": [
diff --git a/keyboards/sofle/keyhive/readme.md b/keyboards/sofle/keyhive/readme.md
index 3847dfe6bb..3847dfe6bb 100755..100644
--- a/keyboards/sofle/keyhive/readme.md
+++ b/keyboards/sofle/keyhive/readme.md
diff --git a/keyboards/sofle/keyhive/rules.mk b/keyboards/sofle/keyhive/rules.mk
index 00719ebea0..6e7633bfe0 100755..100644
--- a/keyboards/sofle/keyhive/rules.mk
+++ b/keyboards/sofle/keyhive/rules.mk
@@ -1,16 +1 @@
1# Build Options # This file intentionally left blank
2# change yes to no to disable
3#
4BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
5MOUSEKEY_ENABLE = no # Mouse keys
6EXTRAKEY_ENABLE = yes # Audio control and System control
7CONSOLE_ENABLE = no # Console for debug
8COMMAND_ENABLE = no # Commands for debug and configuration
9NKRO_ENABLE = yes # Enable N-Key Rollover
10BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
11RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
12AUDIO_ENABLE = no # Audio output
13ENCODER_ENABLE = yes
14LTO_ENABLE = yes
15SPLIT_KEYBOARD = yes
16OLED_ENABLE = yes
diff --git a/keyboards/sofle/keymaps/default/keymap.c b/keyboards/sofle/keymaps/default/keymap.c
index 377b4498e6..37996c3e41 100644
--- a/keyboards/sofle/keymaps/default/keymap.c
+++ b/keyboards/sofle/keymaps/default/keymap.c
@@ -1,3 +1,5 @@
1// Copyright 2023 QMK
2// SPDX-License-Identifier: GPL-2.0-or-later
1#include QMK_KEYBOARD_H 3#include QMK_KEYBOARD_H
2 4
3enum sofle_layers { 5enum sofle_layers {
@@ -10,16 +12,14 @@ enum sofle_layers {
10}; 12};
11 13
12enum custom_keycodes { 14enum custom_keycodes {
13 KC_QWERTY = SAFE_RANGE, 15 KC_QWERTY = QK_USER,
14 KC_COLEMAK, 16 KC_COLEMAK,
15 KC_PRVWD, 17 KC_PRVWD,
16 KC_NXTWD, 18 KC_NXTWD,
17 KC_LSTRT, 19 KC_LSTRT,
18 KC_LEND, 20 KC_LEND
19 KC_DLINE
20}; 21};
21 22
22
23const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 23const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
24/* 24/*
25 * QWERTY 25 * QWERTY
@@ -42,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
42 KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, 42 KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
43 KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, 43 KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
44 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXXX,KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, 44 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXXX,KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
45 KC_LGUI,KC_LALT,KC_LCTL, MO(_LOWER), KC_ENT, KC_SPC, MO(_RAISE), KC_RCTL, KC_RALT, KC_RGUI 45 KC_LGUI,KC_LALT,KC_LCTL, TL_LOWR, KC_ENT, KC_SPC, TL_UPPR, KC_RCTL, KC_RALT, KC_RGUI
46), 46),
47/* 47/*
48 * COLEMAK 48 * COLEMAK
@@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
65 KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, 65 KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
66 KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, 66 KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
67 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXXX,KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, 67 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MUTE, XXXXXXX,KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
68 KC_LGUI,KC_LALT,KC_LCTL,MO(_LOWER), KC_ENT, KC_SPC, MO(_RAISE), KC_RCTL, KC_RALT, KC_RGUI 68 KC_LGUI,KC_LALT,KC_LCTL,TL_LOWR, KC_ENT, KC_SPC, TL_UPPR, KC_RCTL, KC_RALT, KC_RGUI
69), 69),
70/* LOWER 70/* LOWER
71 * ,-----------------------------------------. ,-----------------------------------------. 71 * ,-----------------------------------------. ,-----------------------------------------.
@@ -104,9 +104,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
104 */ 104 */
105[_RAISE] = LAYOUT( 105[_RAISE] = LAYOUT(
106 _______, _______ , _______ , _______ , _______ , _______, _______, _______ , _______, _______ , _______ ,_______, 106 _______, _______ , _______ , _______ , _______ , _______, _______, _______ , _______, _______ , _______ ,_______,
107 _______, KC_INS, KC_PSCR, KC_APP, XXXXXXX, XXXXXXX, KC_PGUP, KC_PRVWD, KC_UP, KC_NXTWD,KC_DLINE, KC_BSPC, 107 _______, KC_INS, KC_PSCR, KC_APP, XXXXXXX, XXXXXXX, KC_PGUP, KC_PRVWD, KC_UP, KC_NXTWD,C(KC_BSPC), KC_BSPC,
108 _______, KC_LALT, KC_LCTL, KC_LSFT, XXXXXXX, KC_CAPS, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_BSPC, 108 _______, KC_LALT, KC_LCTL, KC_LSFT, XXXXXXX, KC_CAPS, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_BSPC,
109 _______,KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, XXXXXXX, _______, _______, XXXXXXX, KC_LSTRT, XXXXXXX, KC_LEND, XXXXXXX, _______, 109 _______, C(KC_Z), C(KC_X), C(KC_C), C(KC_V), XXXXXXX, _______, _______, XXXXXXX, KC_LSTRT, XXXXXXX, KC_LEND, XXXXXXX, _______,
110 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ 110 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
111), 111),
112/* ADJUST 112/* ADJUST
@@ -132,86 +132,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
132 ) 132 )
133}; 133};
134 134
135#ifdef OLED_ENABLE
136
137static void render_logo(void) {
138 static const char PROGMEM qmk_logo[] = {
139 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
140 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
141 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0
142 };
143
144 oled_write_P(qmk_logo, false);
145}
146
147static void print_status_narrow(void) {
148 // Print current mode
149 oled_write_P(PSTR("\n\n"), false);
150 oled_write_ln_P(PSTR("MODE"), false);
151 oled_write_ln_P(PSTR(""), false);
152 if (keymap_config.swap_lctl_lgui) {
153 oled_write_ln_P(PSTR("MAC"), false);
154 } else {
155 oled_write_ln_P(PSTR("WIN"), false);
156 }
157
158 switch (get_highest_layer(default_layer_state)) {
159 case _QWERTY:
160 oled_write_ln_P(PSTR("Qwrt"), false);
161 break;
162 case _COLEMAK:
163 oled_write_ln_P(PSTR("Clmk"), false);
164 break;
165 default:
166 oled_write_P(PSTR("Undef"), false);
167 }
168 oled_write_P(PSTR("\n\n"), false);
169 // Print current layer
170 oled_write_ln_P(PSTR("LAYER"), false);
171 switch (get_highest_layer(layer_state)) {
172 case _COLEMAK:
173 case _QWERTY:
174 oled_write_P(PSTR("Base\n"), false);
175 break;
176 case _RAISE:
177 oled_write_P(PSTR("Raise"), false);
178 break;
179 case _LOWER:
180 oled_write_P(PSTR("Lower"), false);
181 break;
182 case _ADJUST:
183 oled_write_P(PSTR("Adj\n"), false);
184 break;
185 default:
186 oled_write_ln_P(PSTR("Undef"), false);
187 }
188 oled_write_P(PSTR("\n\n"), false);
189 led_t led_usb_state = host_keyboard_led_state();
190 oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock);
191}
192
193oled_rotation_t oled_init_user(oled_rotation_t rotation) {
194 if (is_keyboard_master()) {
195 return OLED_ROTATION_270;
196 }
197 return rotation;
198}
199
200bool oled_task_user(void) {
201 if (is_keyboard_master()) {
202 print_status_narrow();
203 } else {
204 render_logo();
205 }
206 return false;
207}
208
209#endif
210
211layer_state_t layer_state_set_user(layer_state_t state) {
212 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
213}
214
215bool process_record_user(uint16_t keycode, keyrecord_t *record) { 135bool process_record_user(uint16_t keycode, keyrecord_t *record) {
216 switch (keycode) { 136 switch (keycode) {
217 case KC_QWERTY: 137 case KC_QWERTY:
@@ -298,73 +218,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
298 } 218 }
299 } 219 }
300 break; 220 break;
301 case KC_DLINE:
302 if (record->event.pressed) {
303 register_mods(mod_config(MOD_LCTL));
304 register_code(KC_BSPC);
305 } else {
306 unregister_mods(mod_config(MOD_LCTL));
307 unregister_code(KC_BSPC);
308 }
309 break;
310 case KC_COPY:
311 if (record->event.pressed) {
312 register_mods(mod_config(MOD_LCTL));
313 register_code(KC_C);
314 } else {
315 unregister_mods(mod_config(MOD_LCTL));
316 unregister_code(KC_C);
317 }
318 return false;
319 case KC_PASTE:
320 if (record->event.pressed) {
321 register_mods(mod_config(MOD_LCTL));
322 register_code(KC_V);
323 } else {
324 unregister_mods(mod_config(MOD_LCTL));
325 unregister_code(KC_V);
326 }
327 return false;
328 case KC_CUT:
329 if (record->event.pressed) {
330 register_mods(mod_config(MOD_LCTL));
331 register_code(KC_X);
332 } else {
333 unregister_mods(mod_config(MOD_LCTL));
334 unregister_code(KC_X);
335 }
336 return false;
337 break;
338 case KC_UNDO:
339 if (record->event.pressed) {
340 register_mods(mod_config(MOD_LCTL));
341 register_code(KC_Z);
342 } else {
343 unregister_mods(mod_config(MOD_LCTL));
344 unregister_code(KC_Z);
345 }
346 return false;
347 } 221 }
348 return true; 222 return true;
349} 223}
350
351#ifdef ENCODER_ENABLE
352
353bool encoder_update_user(uint8_t index, bool clockwise) {
354 if (index == 0) {
355 if (clockwise) {
356 tap_code(KC_VOLU);
357 } else {
358 tap_code(KC_VOLD);
359 }
360 } else if (index == 1) {
361 if (clockwise) {
362 tap_code(KC_PGDN);
363 } else {
364 tap_code(KC_PGUP);
365 }
366 }
367 return true;
368}
369
370#endif
diff --git a/keyboards/sofle/keymaps/default/readme.md b/keyboards/sofle/keymaps/default/readme.md
index 6d6dea228c..879513af06 100644
--- a/keyboards/sofle/keymaps/default/readme.md
+++ b/keyboards/sofle/keymaps/default/readme.md
@@ -1,12 +1,10 @@
1![SofleKeyboard default keymap](https://github.com/josefadamcik/SofleKeyboard/raw/master/Images/soflekeyboard.png) 1![SofleKeyboard default keymap](https://i.imgur.com/MZxVvm9.png)
2![SofleKeyboard adjust layer](https://github.com/josefadamcik/SofleKeyboard/raw/master/Images/soflekeyboard_layout_adjust.png) 2![SofleKeyboard adjust layer](https://i.imgur.com/f5sKy0I.png)
3
4 3
5# Default keymap for Sofle Keyboard 4# Default keymap for Sofle Keyboard
6 5
7Layout in [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/#/gists/76efb423a46cbbea75465cb468eef7ff) and [adjust layer](http://www.keyboard-layout-editor.com/#/gists/4bcf66f922cfd54da20ba04905d56bd4) 6Layout in [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/#/gists/76efb423a46cbbea75465cb468eef7ff) and [adjust layer](http://www.keyboard-layout-editor.com/#/gists/4bcf66f922cfd54da20ba04905d56bd4)
8 7
9
10Features: 8Features:
11 9
12- Symmetric modifiers (CMD/Super, Alt/Opt, Ctrl, Shift) 10- Symmetric modifiers (CMD/Super, Alt/Opt, Ctrl, Shift)
@@ -15,5 +13,3 @@ Features:
15- Modes for Mac vs Linux/Win support -> different order of modifiers and different action shortcuts on the "UPPER" layer (the red one in the image). Designed to simplify transtions when switching between operating systems often. 13- Modes for Mac vs Linux/Win support -> different order of modifiers and different action shortcuts on the "UPPER" layer (the red one in the image). Designed to simplify transtions when switching between operating systems often.
16- The OLED on master half shows selected mode and caps lock state and is rotated. 14- The OLED on master half shows selected mode and caps lock state and is rotated.
17- Left encoder controls volume up/down/mute. Right encoder PGUP/PGDOWN. 15- Left encoder controls volume up/down/mute. Right encoder PGUP/PGDOWN.
18
19
diff --git a/keyboards/sofle/keymaps/default/rules.mk b/keyboards/sofle/keymaps/default/rules.mk
index ab79c07969..7c9bf212a6 100644
--- a/keyboards/sofle/keymaps/default/rules.mk
+++ b/keyboards/sofle/keymaps/default/rules.mk
@@ -1,5 +1 @@
1 TRI_LAYER_ENABLE = yes
2OLED_ENABLE = yes
3ENCODER_ENABLE = yes
4CONSOLE_ENABLE = no
5EXTRAKEY_ENABLE = yes
diff --git a/keyboards/sofle/keymaps/via/config.h b/keyboards/sofle/keymaps/via/config.h
deleted file mode 100644
index c70c410f77..0000000000
--- a/keyboards/sofle/keymaps/via/config.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/* Copyright 2020 Josef Adamcik
2 * Modification for VIA support and RGB underglow by Jens Bonk-Wiltfang
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20/* By default left side is selected as master,
21see https://docs.qmk.fm/#/feature_split_keyboard?id=setting-handedness
22for more options. */
23
24#if defined(KEYBOARD_sofle_rev1)
25// Add RGB underglow and top facing lighting
26# define WS2812_DI_PIN D3
27# define RGBLIGHT_LED_COUNT 72
28# define RGBLED_SPLIT \
29 { 36, 36 }
30# ifdef RGB_MATRIX_ENABLE
31# define RGB_MATRIX_LED_COUNT RGBLIGHT_LED_COUNT
32# define RGB_MATRIX_SPLIT RGBLED_SPLIT
33# define SPLIT_TRANSPORT_MIRROR
34# else
35# define RGBLIGHT_EFFECT_BREATHING
36# define RGBLIGHT_EFFECT_RAINBOW_MOOD
37# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
38# define RGBLIGHT_EFFECT_SNAKE
39# define RGBLIGHT_EFFECT_KNIGHT
40# define RGBLIGHT_EFFECT_CHRISTMAS
41# define RGBLIGHT_EFFECT_STATIC_GRADIENT
42# define RGBLIGHT_EFFECT_RGB_TEST
43# define RGBLIGHT_EFFECT_ALTERNATING
44# define RGBLIGHT_EFFECT_TWINKLE
45# define RGBLIGHT_LIMIT_VAL 120
46# define RGBLIGHT_HUE_STEP 10
47# define RGBLIGHT_SAT_STEP 17
48# define RGBLIGHT_VAL_STEP 17
49# endif
50#endif
diff --git a/keyboards/sofle/keymaps/via/keymap.c b/keyboards/sofle/keymaps/via/keymap.c
index 21717a7a6c..8207f35fd9 100644
--- a/keyboards/sofle/keymaps/via/keymap.c
+++ b/keyboards/sofle/keymaps/via/keymap.c
@@ -1,22 +1,21 @@
1 /* Copyright 2020 Josef Adamcik 1 /* Copyright 2020 Josef Adamcik
2 * Modification for VIA support and RGB underglow by Jens Bonk-Wiltfang 2 * Modification for VIA support and RGB underglow by Jens Bonk-Wiltfang
3 * 3 *
4 * This program is free software: you can redistribute it and/or modify 4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by 5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or 6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version. 7 * (at your option) any later version.
8 * 8 *
9 * This program is distributed in the hope that it will be useful, 9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18#include QMK_KEYBOARD_H 18#include QMK_KEYBOARD_H
19#include "oled.c"
20 19
21#ifdef ENCODER_MAP_ENABLE 20#ifdef ENCODER_MAP_ENABLE
22const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { 21const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
diff --git a/keyboards/sofle/keymaps/via/oled.c b/keyboards/sofle/keymaps/via/oled.c
deleted file mode 100644
index 74f06cedc5..0000000000
--- a/keyboards/sofle/keymaps/via/oled.c
+++ /dev/null
@@ -1,85 +0,0 @@
1 /* Copyright 2020 Josef Adamcik
2 * Modification for VIA support and RGB underglow by Jens Bonk-Wiltfang
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18//Sets up what the OLED screens display.
19
20#ifdef OLED_ENABLE
21
22static void render_logo(void) {
23 static const char PROGMEM qmk_logo[] = {
24 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
25 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
26 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0
27 };
28
29 oled_write_P(qmk_logo, false);
30}
31
32static void print_status_narrow(void) {
33 // Print current mode
34 oled_write_P(PSTR("\n\n"), false);
35
36 switch (get_highest_layer(layer_state)) {
37 case 0:
38 oled_write_ln_P(PSTR("Qwrt"), false);
39 break;
40 case 1:
41 oled_write_ln_P(PSTR("Clmk"), false);
42 break;
43 default:
44 oled_write_P(PSTR("Mod\n"), false);
45 break;
46 }
47 oled_write_P(PSTR("\n\n"), false);
48 // Print current layer
49 oled_write_ln_P(PSTR("LAYER"), false);
50 switch (get_highest_layer(layer_state)) {
51 case 0:
52 case 1:
53 oled_write_P(PSTR("Base\n"), false);
54 break;
55 case 2:
56 oled_write_P(PSTR("Raise"), false);
57 break;
58 case 3:
59 oled_write_P(PSTR("Lower"), false);
60 break;
61 default:
62 oled_write_ln_P(PSTR("Undef"), false);
63 }
64 oled_write_P(PSTR("\n\n"), false);
65 led_t led_usb_state = host_keyboard_led_state();
66 oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock);
67}
68
69oled_rotation_t oled_init_user(oled_rotation_t rotation) {
70 if (is_keyboard_master()) {
71 return OLED_ROTATION_270;
72 }
73 return rotation;
74}
75
76bool oled_task_user(void) {
77 if (is_keyboard_master()) {
78 print_status_narrow();
79 } else {
80 render_logo();
81 }
82 return false;
83}
84
85#endif
diff --git a/keyboards/sofle/keymaps/via/readme.md b/keyboards/sofle/keymaps/via/readme.md
index 8470c69bcf..e0a87253e6 100644
--- a/keyboards/sofle/keymaps/via/readme.md
+++ b/keyboards/sofle/keymaps/via/readme.md
@@ -2,7 +2,6 @@
2 2
3Layout in [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/#/gists/76efb423a46cbbea75465cb468eef7ff) and [adjust layer](http://www.keyboard-layout-editor.com/#/gists/4bcf66f922cfd54da20ba04905d56bd4) 3Layout in [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/#/gists/76efb423a46cbbea75465cb468eef7ff) and [adjust layer](http://www.keyboard-layout-editor.com/#/gists/4bcf66f922cfd54da20ba04905d56bd4)
4 4
5
6Features: 5Features:
7 6
8- Symmetric modifiers (CMD/Super, Alt/Opt, Ctrl, Shift) 7- Symmetric modifiers (CMD/Super, Alt/Opt, Ctrl, Shift)
@@ -11,4 +10,3 @@ Features:
11- Left encoder controls volume up/down/mute. Right encoder PGUP/PGDOWN. 10- Left encoder controls volume up/down/mute. Right encoder PGUP/PGDOWN.
12- Via support 11- Via support
13- RGB underglow support 12- RGB underglow support
14
diff --git a/keyboards/sofle/keymaps/via/rules.mk b/keyboards/sofle/keymaps/via/rules.mk
index c8ca49919c..2c37cfdddd 100644
--- a/keyboards/sofle/keymaps/via/rules.mk
+++ b/keyboards/sofle/keymaps/via/rules.mk
@@ -1,8 +1,3 @@
1OLED_ENABLE = yes
2ENCODER_ENABLE = yes
3CONSOLE_ENABLE = no
4EXTRAKEY_ENABLE = yes
5VIA_ENABLE = yes 1VIA_ENABLE = yes
6LTO_ENABLE = yes 2RGB_MATRIX_ENABLE = yes
7RGBLIGHT_ENABLE = yes
8ENCODER_MAP_ENABLE = yes 3ENCODER_MAP_ENABLE = yes
diff --git a/keyboards/sofle/readme.md b/keyboards/sofle/readme.md
index 27071e6f33..7e8ef215c2 100644
--- a/keyboards/sofle/readme.md
+++ b/keyboards/sofle/readme.md
@@ -1,6 +1,6 @@
1# Sofle Keyboard 1# Sofle Keyboard
2 2
3![SofleKeyboard version 1](https://raw.githubusercontent.com/josefadamcik/SofleKeyboard/master/Images/IMG_20200126_114622.jpg) 3![SofleKeyboard version 1](https://i.imgur.com/S5GTKth.jpeg)
4 4
5Sofle is 6×4+5 keys column-staggered split keyboard. Based on Lily58, Corne and Helix keyboards. 5Sofle is 6×4+5 keys column-staggered split keyboard. Based on Lily58, Corne and Helix keyboards.
6 6
diff --git a/keyboards/sofle/rev1/info.json b/keyboards/sofle/rev1/info.json
index 5ab71ff1e3..20548d6baf 100644
--- a/keyboards/sofle/rev1/info.json
+++ b/keyboards/sofle/rev1/info.json
@@ -1,10 +1,9 @@
1{ 1{
2 "keyboard_name": "Sofle",
3 "manufacturer": "JosefAdamcik", 2 "manufacturer": "JosefAdamcik",
4 "url": "https://github.com/josefadamcik/SofleKeyboard", 3 "url": "https://github.com/josefadamcik/SofleKeyboard",
5 "maintainer": "Josef Adamcik <josef.adamcik@gmail.com>", 4 "maintainer": "Josef Adamcik <josef.adamcik@gmail.com>",
5 "development_board": "promicro",
6 "usb": { 6 "usb": {
7 "vid": "0xFC32",
8 "pid": "0x0287", 7 "pid": "0x0287",
9 "device_version": "0.0.1" 8 "device_version": "0.0.1"
10 }, 9 },
@@ -12,14 +11,12 @@
12 "cols": ["F6", "F7", "B1", "B3", "B2", "B6"], 11 "cols": ["F6", "F7", "B1", "B3", "B2", "B6"],
13 "rows": ["C6", "D7", "E6", "B4", "B5"] 12 "rows": ["C6", "D7", "E6", "B4", "B5"]
14 }, 13 },
15 "diode_direction": "COL2ROW",
16 "encoder": { 14 "encoder": {
17 "rotary": [ 15 "rotary": [
18 {"pin_a": "F5", "pin_b": "F4", "resolution": 2} 16 {"pin_a": "F5", "pin_b": "F4", "resolution": 2}
19 ] 17 ]
20 }, 18 },
21 "split": { 19 "split": {
22 "soft_serial_pin": "D2",
23 "encoder": { 20 "encoder": {
24 "right": { 21 "right": {
25 "rotary": [ 22 "rotary": [
@@ -28,14 +25,6 @@
28 } 25 }
29 } 26 }
30 }, 27 },
31 "tapping": {
32 "term": 100
33 },
34 "qmk": {
35 "tap_keycode_delay": 10
36 },
37 "processor": "atmega32u4",
38 "bootloader": "caterina",
39 "layouts": { 28 "layouts": {
40 "LAYOUT": { 29 "LAYOUT": {
41 "layout": [ 30 "layout": [
diff --git a/keyboards/sofle/rev1/readme.md b/keyboards/sofle/rev1/readme.md
index 629d568e60..1d229030c4 100644
--- a/keyboards/sofle/rev1/readme.md
+++ b/keyboards/sofle/rev1/readme.md
@@ -1,6 +1,6 @@
1# Sofle Keyboard 1# Sofle Keyboard
2 2
3![SofleKeyboard version 1](https://raw.githubusercontent.com/josefadamcik/SofleKeyboard/master/Images/IMG_20200126_114622.jpg) 3![SofleKeyboard version 1](https://i.imgur.com/S5GTKth.jpeg)
4 4
5Sofle is 6×4+5 keys column-staggered split keyboard. Based on Lily58, Corne and Helix keyboards. 5Sofle is 6×4+5 keys column-staggered split keyboard. Based on Lily58, Corne and Helix keyboards.
6 6
diff --git a/keyboards/sofle/rev1/rev1.c b/keyboards/sofle/rev1/rev1.c
deleted file mode 100644
index df0f23a26c..0000000000
--- a/keyboards/sofle/rev1/rev1.c
+++ /dev/null
@@ -1,87 +0,0 @@
1/* Copyright 2021 Carlos Martins
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "quantum.h"
18
19#ifdef RGB_MATRIX_ENABLE
20 // Physical Layout
21 // Columns
22 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13
23 // ROWS
24 // 12 13 22 23 32 33 33 32 23 22 13 12 0
25 // 02 03 04 04 03 02
26 // 11 14 21 24 31 34 34 31 24 21 14 11 1
27 // 01 01
28 // 10 15 20 25 30 35 35 30 25 20 15 10 2
29 //
30 // 09 16 19 26 29 36 36 29 26 19 16 09 3
31 //
32 // 08 17 18 27 28 28 27 18 17 08 4
33 // 07 06 05 05 06 07
34
35led_config_t g_led_config = {
36 {
37 { 11, 12, 21, 22, 31, 32 },
38 { 10, 13, 20, 23, 30, 33 },
39 { 9, 14, 19, 24, 29, 34},
40 { 8, 15, 18, 25, 28, 35},
41 { 7, 16, 17, 26, 27, NO_LED },
42 { 47, 48, 57, 58, 67, 68},
43 { 46, 49, 56, 59, 66, 69},
44 { 45, 50, 55, 60, 65, 70},
45 { 44, 51, 54, 61, 64, 71},
46 { 43, 52, 53, 62, 63, NO_LED }
47 },
48 {
49 // Left side underglow
50 {96, 40}, {16, 20}, {48, 10}, {80, 18}, {88, 60}, {56, 57}, {24,60},
51 // Left side Matrix
52 {32, 57}, { 0, 48}, { 0, 36}, { 0, 24}, { 0, 12},
53 {16, 12}, {16, 24}, {16, 36}, {16, 48}, {48, 55},
54 {64, 57}, {32, 45}, {32, 33}, {32, 21}, {32, 9},
55 {48, 7}, {48, 19}, {48, 31}, {48, 43}, {80, 59},
56 {96, 64}, {64, 45}, {64, 33}, {64, 21}, {64, 9},
57 {80, 10}, {80, 22}, {80, 34}, {80, 47},
58
59
60 // Right side underglow
61 {128, 40}, {208, 20}, {176, 10}, {144, 18}, {136, 60}, {168, 57}, {200,60},
62 // Right side Matrix
63 {192, 57}, {224, 48}, {224, 36}, {224, 24}, {224, 12},
64 {208, 12}, {208, 24}, {208, 36}, {208, 48}, {176, 55},
65 {160, 57}, {192, 45}, {192, 33}, {192, 21}, {192, 9},
66 {176, 7}, {176, 19}, {176, 31}, {176, 43}, {144, 59},
67 {128, 64}, {160, 45}, {160, 33}, {160, 21}, {160, 9},
68 {144, 10}, {144, 22}, {144, 34}, {144, 47},
69 },
70 {
71 LED_FLAG_INDICATOR, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
72 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
73 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
74 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
75 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
76 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
77 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
78 LED_FLAG_INDICATOR, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,
79 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
80 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
81 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
82 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
83 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
84 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT
85 }
86};
87#endif
diff --git a/keyboards/sofle/rev1/rules.mk b/keyboards/sofle/rev1/rules.mk
index 5ec06e9609..6e7633bfe0 100644
--- a/keyboards/sofle/rev1/rules.mk
+++ b/keyboards/sofle/rev1/rules.mk
@@ -1,2 +1 @@
1ENCODER_ENABLE = yes # This file intentionally left blank
2OLED_ENABLE = yes
diff --git a/keyboards/sofle/rules.mk b/keyboards/sofle/rules.mk
index e03eb21a90..a7307c3499 100644
--- a/keyboards/sofle/rules.mk
+++ b/keyboards/sofle/rules.mk
@@ -1,3 +1 @@
1SPLIT_KEYBOARD = yes
2DEFAULT_FOLDER = sofle/rev1 DEFAULT_FOLDER = sofle/rev1
3SWAP_HANDS_ENABLE = yes
diff --git a/keyboards/sofle/sofle.c b/keyboards/sofle/sofle.c
index bd3f3e157c..3f88e2b5ba 100644
--- a/keyboards/sofle/sofle.c
+++ b/keyboards/sofle/sofle.c
@@ -1,3 +1,5 @@
1// Copyright 2023 QMK
2// SPDX-License-Identifier: GPL-2.0-or-later
1#include "quantum.h" 3#include "quantum.h"
2 4
3#ifdef SWAP_HANDS_ENABLE 5#ifdef SWAP_HANDS_ENABLE
@@ -44,3 +46,90 @@ const uint8_t PROGMEM encoder_hand_swap_config[NUM_ENCODERS] = {1, 0};
44# endif 46# endif
45 47
46#endif 48#endif
49
50#ifdef OLED_ENABLE
51oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
52 if (is_keyboard_master()) {
53 return OLED_ROTATION_270;
54 }
55 return rotation;
56}
57
58static void render_logo(void) {
59 static const char PROGMEM qmk_logo[] = {
60 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
61 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
62 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0
63 };
64 oled_write_P(qmk_logo, false);
65}
66
67void print_status_narrow(void) {
68 oled_write_P(PSTR("\n\n"), false);
69 switch (get_highest_layer(layer_state)) {
70 case 0:
71 oled_write_ln_P(PSTR("Qwrt"), false);
72 break;
73 case 1:
74 oled_write_ln_P(PSTR("Clmk"), false);
75 break;
76 default:
77 oled_write_P(PSTR("Mod\n"), false);
78 break;
79 }
80 oled_write_P(PSTR("\n\n"), false);
81 oled_write_ln_P(PSTR("LAYER"), false);
82 switch (get_highest_layer(layer_state)) {
83 case 0:
84 case 1:
85 oled_write_P(PSTR("Base\n"), false);
86 break;
87 case 2:
88 oled_write_P(PSTR("Raise"), false);
89 break;
90 case 3:
91 oled_write_P(PSTR("Lower"), false);
92 break;
93 default:
94 oled_write_ln_P(PSTR("Undef"), false);
95 }
96 oled_write_P(PSTR("\n\n"), false);
97 led_t led_usb_state = host_keyboard_led_state();
98 oled_write_ln_P(PSTR("CPSLK"), led_usb_state.caps_lock);
99}
100
101bool oled_task_kb(void) {
102 if (!oled_task_user()) {
103 return false;
104 }
105 if (is_keyboard_master()) {
106 print_status_narrow();
107 } else {
108 render_logo();
109 }
110 return true;
111}
112
113#endif
114
115#ifdef ENCODER_ENABLE
116bool encoder_update_kb(uint8_t index, bool clockwise) {
117 if (!encoder_update_user(index, clockwise)) {
118 return false;
119 }
120 if (index == 0) {
121 if (clockwise) {
122 tap_code(KC_VOLU);
123 } else {
124 tap_code(KC_VOLD);
125 }
126 } else if (index == 1) {
127 if (clockwise) {
128 tap_code(KC_PGDN);
129 } else {
130 tap_code(KC_PGUP);
131 }
132 }
133 return true;
134}
135#endif