post @waffle87 recommendations

This commit is contained in:
silvinor 2025-05-03 11:16:06 +10:00
parent 84aedd1872
commit b45d849da8
7 changed files with 205 additions and 49 deletions

View File

@ -23,12 +23,11 @@ void housekeeping_task_kb(void) {
oled_repaint_requested = true; oled_repaint_requested = true;
} }
} }
housekeeping_task_user();
} }
void suspend_wakeup_init_kb(void) { void suspend_wakeup_init_kb(void) {
suspend_wakeup_init_user();
oled_on(); oled_on();
suspend_wakeup_init_user();
} }
#endif // OLED_ENABLE #endif // OLED_ENABLE

View File

@ -4,13 +4,7 @@
// work on the Satisfaction75 // work on the Satisfaction75
#include "candypad.h" #include "candypad.h"
#include "oled_driver.h"
#include "keymap_introspection.h" #include "keymap_introspection.h"
#include <stdio.h> // needed for `snprintf`
#ifdef CONSOLE_ENABLE
# include "print.h"
# include "debug.h"
#endif
#ifdef OLED_ENABLE #ifdef OLED_ENABLE

View File

@ -14,18 +14,15 @@
# define I2C_DRIVER I2CD1 # define I2C_DRIVER I2CD1
/* Configure oled driver for the 128x32 oled */ /* Configure oled driver for the 128x32 oled */
# define OLED_DISPLAY_128X32
# define OLED_TIMEOUT (15 * 60 * 1000) // 15 minutes # define OLED_TIMEOUT (15 * 60 * 1000) // 15 minutes
# define OLED_BRIGHTNESS 128
# define OLED_UPDATE_INTERVAL 33 // ~30fps # define OLED_UPDATE_INTERVAL 33 // ~30fps
/* Font */ /* Font */
# define OLED_FONT_H "glcdfont.c" # define OLED_FONT_H "keyboards/binepad/candypad/glcdfont.c"
# define OLED_FONT_WIDTH 6 # define OLED_FONT_END 127
# define OLED_FONT_HEIGHT 8
#endif // OLED_ENABLE #endif // OLED_ENABLE
/* ---- Direct pins, for use in `matrix.c` (please read that file) ----- */ /* ---- Direct pins, for use in (custom) `matrix.c` (please read that file) ----- */
// *NB*: DIRECT_PINS_CUSTOM must match the MATRIX_ROWS / MATRIX_COLS matrix structure // *NB*: DIRECT_PINS_CUSTOM must match the MATRIX_ROWS / MATRIX_COLS matrix structure
// clang-format off // clang-format off
#define DIRECT_PINS_CUSTOM \ #define DIRECT_PINS_CUSTOM \

View File

@ -4,6 +4,7 @@
#include "progmem.h" #include "progmem.h"
/* based on https://lexus2k.github.io/ssd1306/ssd1306__fonts_8c_source.html, chars 32 - 127 */ /* based on https://lexus2k.github.io/ssd1306/ssd1306__fonts_8c_source.html, chars 32 - 127 */
/* generated and tested on https://joric.github.io/qle/ */
// clang-format off // clang-format off
static const unsigned char PROGMEM font[] = { static const unsigned char PROGMEM font[] = {
0xFF, 0x81, 0x81, 0x81, 0x81, 0xFF, 0xFF, 0x81, 0x81, 0x81, 0x81, 0xFF,
@ -38,7 +39,7 @@ static const unsigned char PROGMEM font[] = {
0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00,
0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00,
0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // by @lexus2k form here down
0x00, 0x00, 0x00, 0x2F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2F, 0x00, 0x00,
0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00,
0x00, 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, 0x14, 0x7F, 0x14, 0x7F, 0x14,

View File

@ -15,46 +15,215 @@
"extrakey": true, "extrakey": true,
"mousekey": true, "mousekey": true,
"nkro": true, "nkro": true,
"encoder": true "encoder": true,
"oled": true
}, },
"diode_direction": "COL2ROW", "diode_direction": "COL2ROW",
"matrix_pins": { "matrix_pins": {
"cols": ["GP15", "GP14", "GP13", "GP10"], "cols": [
"rows": ["GP12", "GP9", "GP7", "GP6", "GP5", null] "GP15",
"GP14",
"GP13",
"GP10"
],
"rows": [
"GP12",
"GP9",
"GP7",
"GP6",
"GP5",
null
]
}, },
"encoder": { "encoder": {
"rotary": [ "rotary": [
{"pin_a": "GP28", "pin_b": "GP27"}, {
{"pin_a": "GP1", "pin_b": "GP2"} "pin_a": "GP28",
"pin_b": "GP27"
},
{
"pin_a": "GP1",
"pin_b": "GP2"
}
] ]
}, },
"layouts": { "layouts": {
"LAYOUT": { "LAYOUT": {
"layout": [ "layout": [
{ "matrix": [0, 0], "label": "Num Lock", "x": 0, "y": 1}, {
{ "matrix": [0, 1], "label": "/", "x": 1, "y": 1}, "matrix": [
{ "matrix": [0, 2], "label": "*", "x": 2, "y": 1}, 5,
{ "matrix": [0, 3], "label": "-", "x": 3, "y": 1}, 0
],
{ "matrix": [1, 0], "label": "7", "x": 0, "y": 2}, "label": "",
{ "matrix": [1, 1], "label": "8", "x": 1, "y": 2}, "x": 2,
{ "matrix": [1, 2], "label": "9", "x": 2, "y": 2}, "y": 0
{ "matrix": [1, 3], "label": "+", "x": 3, "y": 2, "h": 2}, },
{
{ "matrix": [2, 0], "label": "4", "x": 0, "y": 3}, "matrix": [
{ "matrix": [2, 1], "label": "5", "x": 1, "y": 3}, 5,
{ "matrix": [2, 2], "label": "6", "x": 2, "y": 3}, 1
],
{ "matrix": [3, 0], "label": "1", "x": 0, "y": 4}, "label": "",
{ "matrix": [3, 1], "label": "2", "x": 1, "y": 4}, "x": 3,
{ "matrix": [3, 2], "label": "3", "x": 2, "y": 4}, "y": 0
{ "matrix": [3, 3], "label": "Enter", "x": 3, "y": 4, "h": 2}, },
{
{ "matrix": [4, 0], "label": "0", "x": 0, "y": 5, "w": 2}, "matrix": [
{ "matrix": [4, 2], "label": ".", "x": 2, "y": 5}, 0,
0
{ "matrix": [5, 0], "label": "", "x": 2, "y": 0}, ],
{ "matrix": [5, 1], "label": "", "x": 3, "y": 0} "label": "Num Lock",
"x": 0,
"y": 1
},
{
"matrix": [
0,
1
],
"label": "/",
"x": 1,
"y": 1
},
{
"matrix": [
0,
2
],
"label": "*",
"x": 2,
"y": 1
},
{
"matrix": [
0,
3
],
"label": "-",
"x": 3,
"y": 1
},
{
"matrix": [
1,
0
],
"label": "7",
"x": 0,
"y": 2
},
{
"matrix": [
1,
1
],
"label": "8",
"x": 1,
"y": 2
},
{
"matrix": [
1,
2
],
"label": "9",
"x": 2,
"y": 2
},
{
"matrix": [
1,
3
],
"label": "+",
"x": 3,
"y": 2,
"h": 2
},
{
"matrix": [
2,
0
],
"label": "4",
"x": 0,
"y": 3
},
{
"matrix": [
2,
1
],
"label": "5",
"x": 1,
"y": 3
},
{
"matrix": [
2,
2
],
"label": "6",
"x": 2,
"y": 3
},
{
"matrix": [
3,
0
],
"label": "1",
"x": 0,
"y": 4
},
{
"matrix": [
3,
1
],
"label": "2",
"x": 1,
"y": 4
},
{
"matrix": [
3,
2
],
"label": "3",
"x": 2,
"y": 4
},
{
"matrix": [
3,
3
],
"label": "Enter",
"x": 3,
"y": 4,
"h": 2
},
{
"matrix": [
4,
0
],
"label": "0",
"x": 0,
"y": 5,
"w": 2
},
{
"matrix": [
4,
2
],
"label": ".",
"x": 2,
"y": 5
}
] ]
} }
} }

View File

@ -26,4 +26,4 @@ Enter the bootloader in 3 ways:
* **Bootmagic reset**: Hold down the key at (0:0) in the matrix (the top left key) and plug in the keyboard * **Bootmagic reset**: Hold down the key at (0:0) in the matrix (the top left key) and plug in the keyboard
* **Physical reset button**: Briefly press the PCB button located on the back of the PCB * **Physical reset button**: Briefly press the PCB button located on the back of the PCB
* **Keycode in layout**: Press the key mapped to `QK_BOOT` or `RESET` if it is available * **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available

View File

@ -3,10 +3,6 @@
CUSTOM_MATRIX = yes CUSTOM_MATRIX = yes
OLED_ENABLE = yes
OLED_DRIVER = ssd1306
OLED_TRANSPORT = i2c
SRC += matrix.c \ SRC += matrix.c \
candypad_oled.c candypad_oled.c