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

Add new keyboard: vinhcatba/uncertainty #21142

Merged
merged 49 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
f760759
vinh: test fw for uncertainty (deprecated)
vinhcatba May 19, 2023
71fe607
v0.1: update base firmware with 2 layers, use bongo cat animation for…
vinhcatba May 26, 2023
fa454ea
v0.1: change directory
vinhcatba May 26, 2023
818c6fa
v0.1: cleanup
vinhcatba May 26, 2023
06e5851
v0.2: update layers
vinhcatba May 26, 2023
da179df
v0.3: add VIA support
vinhcatba May 27, 2023
9fe42a6
v0.3: add VIA support (continue)
vinhcatba May 27, 2023
d4cefb4
vinh: test fw for uncertainty (deprecated)
vinhcatba May 19, 2023
6605777
v0.1: update base firmware with 2 layers, use bongo cat animation for…
vinhcatba May 26, 2023
c342efa
v0.1: change directory
vinhcatba May 26, 2023
5046bc4
v0.1: cleanup
vinhcatba May 26, 2023
a816f70
v0.2: update layers
vinhcatba May 26, 2023
e2f0f89
v0.3: add VIA support
vinhcatba May 27, 2023
3d94ae1
v0.3: add VIA support (continue)
vinhcatba May 27, 2023
64477c5
Merge branch 'dev_uncertainty' of https://github.com/vinhcatba/qmk_fi…
vinhcatba May 27, 2023
e06da47
v0.3: change keyboard name, remove eeprom config save in VIA keymap
vinhcatba May 29, 2023
79e8897
cleanup for PR
vinhcatba Jun 6, 2023
48bd8fc
update readme
vinhcatba Jun 6, 2023
ef05f6d
vinh: test fw for uncertainty (deprecated)
vinhcatba May 19, 2023
0148d4e
v0.1: update base firmware with 2 layers, use bongo cat animation for…
vinhcatba May 26, 2023
1b31076
v0.1: change directory
vinhcatba May 26, 2023
dc377c0
v0.1: cleanup
vinhcatba May 26, 2023
278a6d7
v0.2: update layers
vinhcatba May 26, 2023
afd0169
v0.3: add VIA support
vinhcatba May 27, 2023
4b9c31d
v0.3: add VIA support (continue)
vinhcatba May 27, 2023
016ed63
vinh: test fw for uncertainty (deprecated)
vinhcatba May 19, 2023
67ee969
v0.1: update base firmware with 2 layers, use bongo cat animation for…
vinhcatba May 26, 2023
c3695a9
v0.1: change directory
vinhcatba May 26, 2023
5d2342d
v0.1: cleanup
vinhcatba May 26, 2023
0c2be5a
v0.3: change keyboard name, remove eeprom config save in VIA keymap
vinhcatba May 29, 2023
a3b0afe
cleanup for PR
vinhcatba Jun 6, 2023
615ee53
update readme
vinhcatba Jun 6, 2023
573e11a
add license to header files, update ws2812 driver and DI_PIN to info.…
vinhcatba Jun 6, 2023
35ebca7
merge last commit with origin
vinhcatba Jun 6, 2023
067aa5e
resovle PR suggestion for config.h, halconf.h, mcuconf.h
vinhcatba Jun 7, 2023
e2a21b5
update info.json regarding PR comment
vinhcatba Jun 7, 2023
41ee0e3
update bongo.h regarding PR comment
vinhcatba Jun 7, 2023
9ba31ee
add oled mode toggle
vinhcatba Jun 7, 2023
a63c32b
update readme.md, rules.mk regarding PR comment
vinhcatba Jun 7, 2023
781cda1
add submodule update
vinhcatba Jun 9, 2023
918771b
move oled handle to keyboard level
vinhcatba Jun 10, 2023
d228679
Update keyboards/vinhcatba/uncertainty/uncertainty.c
vinhcatba Jun 10, 2023
0236227
now using bongo as source file
vinhcatba Jun 11, 2023
8cfd875
Merge branch 'dev_uncertainty' of https://github.com/vinhcatba/qmk_fi…
vinhcatba Jun 11, 2023
e097c79
Apply suggestions from code review
vinhcatba Jul 4, 2023
5f9fa7f
move WPM_ENABLE and ENCODER_MAP_ENABLE to keymap level
vinhcatba Jul 4, 2023
26e05eb
Apply suggestions from code review
vinhcatba Jul 5, 2023
dac0c3b
Apply suggestions from code review
vinhcatba Aug 28, 2023
ac6d42f
Update keyboards/vinhcatba/uncertainty/config.h
vinhcatba Aug 30, 2023
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
506 changes: 506 additions & 0 deletions keyboards/vinhcatba/uncertainty/bongo.c

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions keyboards/vinhcatba/uncertainty/bongo.h
vinhcatba marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Copyright 2022 Parker Levin (@pedker)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

void draw_bongo(bool minimal);
30 changes: 30 additions & 0 deletions keyboards/vinhcatba/uncertainty/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2023 Vinh Le (@vinhcatba)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

/* WS2812 driver config specifically for STM32F401 */
// DI pin = PB1, which is AF02, TIM3_CH4 (table 9 in datasheet)
#define RGBLIGHT_LED_MAP { 2, 3, 4, 5, 6, 0, 1, 7, 8, 9, 10, 11, 12, 13} // index 5 = CAPS; index 6 = NUM
vinhcatba marked this conversation as resolved.
Show resolved Hide resolved

#define WS2812_PWM_DRIVER PWMD3 // TIM3
#define WS2812_PWM_CHANNEL 4 // CH4
#define WS2812_PWM_PAL_MODE 2 // AF2

#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA1 Stream 2 for TIM3_UP (table 28 in reference manual)
#define WS2812_DMA_CHANNEL 5 // DMA Channel 5 for TIM3_UP (table 28 in reference manual)


#define I2C1_CLOCK_SPEED 400000
#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_16_9

/* eeprom i2c driver config */
#define EXTERNAL_EEPROM_I2C_BASE_ADDRESS 0b10100000
#define EXTERNAL_EEPROM_BYTE_COUNT 4096
#define EXTERNAL_EEPROM_PAGE_SIZE 32
#define EXTERNAL_EEPROM_WRITE_TIME 10
//#define EEPROM_I2C_24LC32

/* OLED config */
#define OLED_UPDATE_INTERVAL 100
#define OLED_BRIGHTNESS 200
11 changes: 11 additions & 0 deletions keyboards/vinhcatba/uncertainty/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2023 Vinh Le (@vinhcatba)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once

#undef HAL_USE_PWM
#define HAL_USE_PWM TRUE

#undef HAL_USE_I2C
#define HAL_USE_I2C TRUE

#include_next <halconf.h>
170 changes: 170 additions & 0 deletions keyboards/vinhcatba/uncertainty/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
{
"manufacturer": "Vinh Le",
"keyboard_name": "Uncertainty",
"maintainer": "vinhcatba",
"development_board": "blackpill_f401",
"diode_direction": "COL2ROW",
"encoder": {
"rotary": [
{"pin_a": "A13", "pin_b": "A14"}
]
},
"features": {
"bootmagic": true,
"command": false,
"console": false,
"wpm": true,
"encoder": true,
"extrakey": true,
"mousekey": true,
"nkro": true,
"rgblight": true,
"oled": true
},
"matrix_pins": {
"cols": ["A15", "B3", "B4", "B5", "B8", "B9", "B0", "A7", "A6", "A5", "A4", "A3", "A2", "A1", "A0", "C15", "C14", "C13"],
"rows": ["B12", "B13", "B14", "B15", "A8", "A10"]
},
"rgblight": {
"animations": {
"alternating": true,
"breathing": true,
"christmas": true,
"knight": true,
"rainbow_mood": true,
"rainbow_swirl": true,
"rgb_test": true,
"snake": true,
"static_gradient": true,
"twinkle": true
},
"brightness_steps": 10,
"layers": {
"enabled": true,
"override_rgb": true
},
"led_count": 14,
"max_brightness": 255,
"sleep": true
},
"url": "",
"usb": {
"device_version": "1.0.0",
"pid": "0x0000",
"vid": "0x564C"
},
"ws2812": {
"driver": "pwm",
"pin": "B1"
},
"layouts": {
"LAYOUT": {
"layout": [
{"label": "0,0", "matrix": [0, 0], "x": 1.25, "y": 0},
{"label": "0,1", "matrix": [0, 1], "x": 2.25, "y": 0},
{"label": "0,2", "matrix": [0, 2], "x": 3.25, "y": 0},
{"label": "0,3", "matrix": [0, 3], "x": 4.25, "y": 0},
{"label": "0,4", "matrix": [0, 4], "x": 5.25, "y": 0},
{"label": "0,5", "matrix": [0, 5], "x": 6.25, "y": 0},
{"label": "0,6", "matrix": [0, 6], "x": 7.25, "y": 0},
{"label": "0,7", "matrix": [0, 7], "x": 8.25, "y": 0},
{"label": "0,8", "matrix": [0, 8], "x": 9.25, "y": 0},
{"label": "0,9", "matrix": [0, 9], "x": 10.25, "y": 0},
{"label": "0,10", "matrix": [0, 10], "x": 11.25, "y": 0},
{"label": "0,11", "matrix": [0, 11], "x": 12.25, "y": 0},
{"label": "0,12", "matrix": [0, 12], "x": 13.25, "y": 0},
{"label": "0,13", "matrix": [0, 13], "x": 14.25, "y": 0},
{"label": "0,14", "matrix": [0, 14], "x": 15.25, "y": 0},
{"label": "0,15", "matrix": [0, 15], "x": 16.25, "y": 0},
{"label": "0,16", "matrix": [0, 16], "x": 17.25, "y": 0},
{"label": "0,17", "matrix": [0, 17], "x": 18.25, "y": 0},
{"label": "1,17", "matrix": [1, 17], "x": 19.25, "y": 0},
{"label": "1,0", "matrix": [1, 0], "x": 1.25, "y": 1},
{"label": "1,1", "matrix": [1, 1], "x": 2.25, "y": 1},
{"label": "1,2", "matrix": [1, 2], "x": 3.25, "y": 1},
{"label": "1,3", "matrix": [1, 3], "x": 4.25, "y": 1},
{"label": "1,4", "matrix": [1, 4], "x": 5.25, "y": 1},
{"label": "1,5", "matrix": [1, 5], "x": 6.25, "y": 1},
{"label": "1,6", "matrix": [1, 6], "x": 7.25, "y": 1},
{"label": "1,7", "matrix": [1, 7], "x": 8.25, "y": 1},
{"label": "1,8", "matrix": [1, 8], "x": 9.25, "y": 1},
{"label": "1,9", "matrix": [1, 9], "x": 10.25, "y": 1},
{"label": "1,10", "matrix": [1, 10], "x": 11.25, "y": 1},
{"label": "1,11", "matrix": [1, 11], "x": 12.25, "y": 1},
{"label": "1,12", "matrix": [1, 12], "x": 13.25, "y": 1},
{"label": "1,13", "matrix": [1, 13], "x": 14.25, "y": 1, "w": 2},
{"label": "1,14", "matrix": [1, 14], "x": 16.25, "y": 1},
{"label": "1,15", "matrix": [1, 15], "x": 17.25, "y": 1},
{"label": "1,16", "matrix": [1, 16], "x": 18.25, "y": 1},
{"label": "3,17", "matrix": [3, 17], "x": 19.25, "y": 1},
{"label": "2,0", "matrix": [2, 0], "x": 0, "y": 1.75},
{"label": "2,1", "matrix": [2, 1], "x": 1.25, "y": 2, "w": 1.5},
{"label": "2,2", "matrix": [2, 2], "x": 2.75, "y": 2},
{"label": "2,3", "matrix": [2, 3], "x": 3.75, "y": 2},
{"label": "2,4", "matrix": [2, 4], "x": 4.75, "y": 2},
{"label": "2,5", "matrix": [2, 5], "x": 5.75, "y": 2},
{"label": "2,6", "matrix": [2, 6], "x": 6.75, "y": 2},
{"label": "2,7", "matrix": [2, 7], "x": 7.75, "y": 2},
{"label": "2,8", "matrix": [2, 8], "x": 8.75, "y": 2},
{"label": "2,9", "matrix": [2, 9], "x": 9.75, "y": 2},
{"label": "2,10", "matrix": [2, 10], "x": 10.75, "y": 2},
{"label": "2,11", "matrix": [2, 11], "x": 11.75, "y": 2},
{"label": "2,12", "matrix": [2, 12], "x": 12.75, "y": 2},
{"label": "2,13", "matrix": [2, 13], "x": 13.75, "y": 2},
{"label": "2,14", "matrix": [2, 14], "x": 14.75, "y": 2, "w": 1.5},
{"label": "2,15", "matrix": [2, 15], "x": 16.25, "y": 2},
{"label": "2,16", "matrix": [2, 16], "x": 17.25, "y": 2},
{"label": "2,17", "matrix": [2, 17], "x": 18.25, "y": 2},
{"label": "4,17", "matrix": [4, 17], "x": 19.25, "y": 2, "h": 2},
{"label": "3,0", "matrix": [3, 0], "x": 0, "y": 3},
{"label": "3,1", "matrix": [3, 1], "x": 1.25, "y": 3, "w": 1.75},
{"label": "3,2", "matrix": [3, 2], "x": 3, "y": 3},
{"label": "3,3", "matrix": [3, 3], "x": 4, "y": 3},
{"label": "3,4", "matrix": [3, 4], "x": 5, "y": 3},
{"label": "3,5", "matrix": [3, 5], "x": 6, "y": 3},
{"label": "3,6", "matrix": [3, 6], "x": 7, "y": 3},
{"label": "3,7", "matrix": [3, 7], "x": 8, "y": 3},
{"label": "3,8", "matrix": [3, 8], "x": 9, "y": 3},
{"label": "3,9", "matrix": [3, 9], "x": 10, "y": 3},
{"label": "3,10", "matrix": [3, 10], "x": 11, "y": 3},
{"label": "3,11", "matrix": [3, 11], "x": 12, "y": 3},
{"label": "3,12", "matrix": [3, 12], "x": 13, "y": 3},
{"label": "3,13", "matrix": [3, 13], "x": 14, "y": 3, "w": 2.25},
{"label": "3,14", "matrix": [3, 14], "x": 16.25, "y": 3},
{"label": "3,15", "matrix": [3, 15], "x": 17.25, "y": 3},
{"label": "3,16", "matrix": [3, 16], "x": 18.25, "y": 3},
{"label": "4,0", "matrix": [4, 0], "x": 0, "y": 4},
{"label": "4,1", "matrix": [4, 1], "x": 1.25, "y": 4, "w": 2.25},
{"label": "4,2", "matrix": [4, 2], "x": 3.5, "y": 4},
{"label": "4,3", "matrix": [4, 3], "x": 4.5, "y": 4},
{"label": "4,4", "matrix": [4, 4], "x": 5.5, "y": 4},
{"label": "4,5", "matrix": [4, 5], "x": 6.5, "y": 4},
{"label": "4,6", "matrix": [4, 6], "x": 7.5, "y": 4},
{"label": "4,7", "matrix": [4, 7], "x": 8.5, "y": 4},
{"label": "4,8", "matrix": [4, 8], "x": 9.5, "y": 4},
{"label": "4,9", "matrix": [4, 9], "x": 10.5, "y": 4},
{"label": "4,10", "matrix": [4, 10], "x": 11.5, "y": 4},
{"label": "4,11", "matrix": [4, 11], "x": 12.5, "y": 4},
{"label": "4,12", "matrix": [4, 12], "x": 13.5, "y": 4, "w": 1.75},
{"label": "4,13", "matrix": [4, 13], "x": 15.25, "y": 4},
{"label": "4,14", "matrix": [4, 14], "x": 16.25, "y": 4},
{"label": "4,15", "matrix": [4, 15], "x": 17.25, "y": 4},
{"label": "4,16", "matrix": [4, 16], "x": 18.25, "y": 4},
{"label": "5,17", "matrix": [5, 17], "x": 19.25, "y": 4, "h": 2},
{"label": "5,0", "matrix": [5, 0], "x": 0, "y": 5},
{"label": "5,1", "matrix": [5, 1], "x": 1.25, "y": 5, "w": 1.25},
{"label": "5,2", "matrix": [5, 2], "x": 2.5, "y": 5, "w": 1.25},
{"label": "5,3", "matrix": [5, 3], "x": 3.75, "y": 5, "w": 1.25},
{"label": "5,6", "matrix": [5, 6], "x": 5, "y": 5, "w": 6.25},
{"label": "5,7", "matrix": [5, 7], "x": 11.25, "y": 5},
{"label": "5,10", "matrix": [5, 10], "x": 12.25, "y": 5},
{"label": "5,11", "matrix": [5, 11], "x": 13.25, "y": 5},
{"label": "5,12", "matrix": [5, 12], "x": 14.25, "y": 5},
{"label": "5,13", "matrix": [5, 13], "x": 15.25, "y": 5},
{"label": "5,14", "matrix": [5, 14], "x": 16.25, "y": 5},
{"label": "5,15", "matrix": [5, 15], "x": 17.25, "y": 5},
{"label": "5,16", "matrix": [5, 16], "x": 18.25, "y": 5}
]
}
}
}
89 changes: 89 additions & 0 deletions keyboards/vinhcatba/uncertainty/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// Copyright 2023 Vinh Le (@vinhcatba)
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/* 0
* ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┐
* │ Esc │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │PrtScn│ Del │ Home │ End │ PgUp │ PgDn │
* ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┴──────┼──────┼──────┼──────┼──────┤
* │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ Bksp │ # Lk │ / │ * │ - │
* ┌──────┼──────┴───┬──┴───┬──┴───┬──┴───┬──┴───┬──┴───┬──┴───┬──┴───┬──┴───┬──┴───┬──┴───┬──┴───┬──┴───┬─────────┼──────┼──────┼──────┼──────┤
* │ Mute │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │ 7 │ 8 │ 9 │ │
* ├──────┼──────────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴─────────┼──────┼──────┼──────┤ + |
* │ Null │ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ 4 │ 5 │ 6 │ |
* ├──────┼────────────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴─┬────┴───────┬──────┼──────┤──────┼──────┼──────┤
* │ Null │ Shft │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Shft │ Up │ 1 │ 2 │ 3 │ │
* ├──────┼───────┬──────┴┬─────┴─┬────┴──────┴──────┴──────┴──────┴──────┴─────┬┴─────┬┴─────┬┴─────┬──────┼──────┼──────┼──────┼──────┤ Entr |
* │ Null │ Ctrl │ Gui │ Alt │ Space │ Alt │ Fn │ Ctrl │ Left │ Down │ Right│ 0 │ . │ │
* └──────┴───────┴───────┴───────┴─────────────────────────────────────────────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘
*/
[0] = LAYOUT(
KC_ESC, 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_PSCR, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN,
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
KC_MUTE, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_CALC, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6,
C(KC_V), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,
C(KC_C), KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT
),
[1] = LAYOUT(
QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS , KC_SCRL, _______, _______, EE_CLR ,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
OLED_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, _______, _______, _______,
_______, _______, _______, _______, _______ , _______, _______, _______,RGB_RMOD, RGB_VAD, RGB_MOD, _______, _______
)
};

#ifdef ENCODER_MAP_ENABLE
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[1] = { ENCODER_CCW_CW(KC_BRID, KC_BRIU) }
};
#endif // endif ENCODER_MAP_ENABLE

#ifdef RGBLIGHT_ENABLE
# define HSV_PASTEL_BLUE 150, 155, 51

const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
{0, 1, HSV_PASTEL_BLUE} // Light 1 LED, starting with LED 0
);

const rgblight_segment_t PROGMEM my_numlock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
{1, 1, HSV_PASTEL_BLUE} // Light 1 LED, starting with LED 1
);

const rgblight_segment_t PROGMEM indicators_off_layer[] = RGBLIGHT_LAYER_SEGMENTS(
{0, 2, HSV_OFF} // Turn off 2 LEDs, starting with LED 0
);

// Now define the array of layers. Later layers take precedence
const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
indicators_off_layer,
my_capslock_layer,
my_numlock_layer
);

bool led_update_user(led_t led_state) {
rgblight_set_layer_state(1, led_state.caps_lock);
rgblight_set_layer_state(2, led_state.num_lock);
return true;
}

void keyboard_post_init_user(void) {
// debug_enable=true;
// debug_matrix=true;

// Enable the LED layers
rgblight_layers = my_rgb_layers;
rgblight_set_layer_state(0, 1);
rgblight_set_effect_range(2, 12);
rgblight_enable();
}
#endif // endif RGBLIGHT_ENABLE


1 change: 1 addition & 0 deletions keyboards/vinhcatba/uncertainty/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ENCODER_MAP_ENABLE = yes
Loading