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

Timb: young man dyi testing #22

Draft
wants to merge 2 commits into
base: young_man_diy-sofle-f072_onboard
Choose a base branch
from
Draft
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
26 changes: 20 additions & 6 deletions keyboards/young_man_diy/sofle/f072_onboard/keyboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
]
},
"features": {
"console": true,
"debug": true,
"bootmagic": true,
"encoder": true,
"extrakey": true,
Expand All @@ -25,6 +27,20 @@
"processor": "STM32F072",
"rgb_matrix": {
"driver": "ws2812",
"default": {
"animation": "breathing",
"hue": 152,
"sat": 232,
"speed": 50
},
"animations": {
"band_sat": true,
"band_spiral_val": true,
"breathing": true,
"cycle_all": true,
"cycle_left_right": true,
"raindrops": true
},
"layout": [
{"x": 96, "y": 40, "flags": 8},
{"x": 16, "y": 20, "flags": 2},
Expand Down Expand Up @@ -102,11 +118,6 @@
"sleep": true,
"split_count": [36, 36]
},
"rgblight": {
"led_count": 72,
"sleep": true,
"split_count": [36, 36]
},
"split": {
"enabled": true,
"matrix_pins": {
Expand All @@ -121,7 +132,10 @@
},
"transport": {
"sync": {
"matrix_state": true
"matrix_state": true,
"oled": true,
"modifiers": true,
"wpm": true
},
"watchdog": true
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#include QMK_KEYBOARD_H

enum Layers {
_BASE,
_LOWER,
_RAISE,
_ADJUST,
};

#ifdef OLED_ENABLE
static void render_logo(void) {
static const char PROGMEM qmk_logo[] = {
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94,
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4,
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00
};

oled_write_P(qmk_logo, false);
}

static void render_status(void) {
// Host Keyboard Layer Status
oled_write_P(PSTR("Layer\n"), false);
oled_write_P(PSTR("-----\n"), false);
switch (get_highest_layer(layer_state)) {
case _BASE:
oled_write_P(PSTR("Base \n"), false);
break;
case _LOWER:
oled_write_P(PSTR("Lower\n"), false);
break;
case _RAISE:
oled_write_P(PSTR("Raise\n"), false);
break;
case _ADJUST:
oled_write_P(PSTR("Adjust\n"), false);
break;
default:
oled_write_P(PSTR("Undef\n"), false);
}
}

oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return OLED_ROTATION_270;
}

bool oled_task_kb(void) {
if (!oled_task_user()) {
return false;
}

if (is_keyboard_master()) {
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
} else {
render_logo();
}

return true;
}
#endif