aboutsummaryrefslogtreecommitdiff
path: root/keyboards
diff options
context:
space:
mode:
authorConor Burns <mail@conor-burns.com>2021-07-20 22:07:53 +0200
committerGitHub <noreply@github.com>2021-07-20 13:07:53 -0700
commit81cac8eec66ab98d5091e5b704215dc96fe830d4 (patch)
tree168828fe5430f1235f4f76b5a0638d9fe9b05db6 /keyboards
parentc1ba35363d4f7d76d63173312a0785401c6bff9f (diff)
downloadqmk_firmware-81cac8eec66ab98d5091e5b704215dc96fe830d4.tar.gz
qmk_firmware-81cac8eec66ab98d5091e5b704215dc96fe830d4.zip
[Keyboard] 0xcb 1337 - Added keymap "conor" and fixed some minor stuff (#12744)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/0xcb/1337/1337.c7
-rw-r--r--keyboards/0xcb/1337/1337.h2
-rw-r--r--keyboards/0xcb/1337/config.h22
-rw-r--r--keyboards/0xcb/1337/gfxfont.c3
-rw-r--r--keyboards/0xcb/1337/keymaps/conor/keymap.c185
-rw-r--r--keyboards/0xcb/1337/keymaps/conor/rules.mk1
-rw-r--r--keyboards/0xcb/1337/keymaps/default/keymap.c66
-rw-r--r--keyboards/0xcb/1337/keymaps/jakob/keymap.c66
-rw-r--r--keyboards/0xcb/1337/keymaps/via/keymap.c66
-rw-r--r--keyboards/0xcb/1337/readme.md12
10 files changed, 334 insertions, 96 deletions
diff --git a/keyboards/0xcb/1337/1337.c b/keyboards/0xcb/1337/1337.c
index 142c24639..85781209b 100644
--- a/keyboards/0xcb/1337/1337.c
+++ b/keyboards/0xcb/1337/1337.c
@@ -21,13 +21,6 @@ void eeconfig_init_kb(void) {
21 backlight_enable(); 21 backlight_enable();
22 backlight_level(5); 22 backlight_level(5);
23#endif 23#endif
24#ifdef RGBLIGHT_ENABLE
25 rgblight_enable();
26 rgblight_sethsv(0, 255, 255);
27#ifdef RGBLIGHT_ANIMATIONS
28 rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 2);
29#endif
30#endif
31 24
32 eeconfig_update_kb(0); 25 eeconfig_update_kb(0);
33 eeconfig_init_user(); 26 eeconfig_init_user();
diff --git a/keyboards/0xcb/1337/1337.h b/keyboards/0xcb/1337/1337.h
index 7de5365d8..e1f238c12 100644
--- a/keyboards/0xcb/1337/1337.h
+++ b/keyboards/0xcb/1337/1337.h
@@ -26,6 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
26 * The second converts the arguments into a two-dimensional array which 26 * The second converts the arguments into a two-dimensional array which
27 * represents the switch matrix. 27 * represents the switch matrix.
28 */ 28 */
29// clang-format off
29 #define LAYOUT( \ 30 #define LAYOUT( \
30 KA1, KA2, KA3, \ 31 KA1, KA2, KA3, \
31 KB1, KB2, KB3, \ 32 KB1, KB2, KB3, \
@@ -36,3 +37,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
36 { KB1, KB2, KB3 }, \ 37 { KB1, KB2, KB3 }, \
37 { KC1, KC2, KC3 } \ 38 { KC1, KC2, KC3 } \
38 } 39 }
40// clang-format on
diff --git a/keyboards/0xcb/1337/config.h b/keyboards/0xcb/1337/config.h
index 6d25e49cc..21332c558 100644
--- a/keyboards/0xcb/1337/config.h
+++ b/keyboards/0xcb/1337/config.h
@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
17#pragma once 17#pragma once
18 18
19#include "config_common.h" 19#include "config_common.h"
20// clang-format off
20 21
21/* USB Device descriptor parameter */ 22/* USB Device descriptor parameter */
22#define VENDOR_ID 0xCB00 23#define VENDOR_ID 0xCB00
@@ -47,19 +48,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
47 48
48#define RGB_DI_PIN D3 49#define RGB_DI_PIN D3
49#ifdef RGB_DI_PIN 50#ifdef RGB_DI_PIN
50 #define RGBLED_NUM 5 51 #define RGBLED_NUM 4
51 #define RGBLIGHT_HUE_STEP 8 52 #define RGBLIGHT_HUE_STEP 8
52 #define RGBLIGHT_SAT_STEP 8 53 #define RGBLIGHT_SAT_STEP 8
53 #define RGBLIGHT_VAL_STEP 8 54 #define RGBLIGHT_VAL_STEP 8
54 #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ 55 #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
55 #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ 56 #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
56 // #define RGBLIGHT_ANIMATIONS 57 #define RGBLIGHT_ANIMATIONS /* comment this and uncomment the lines below to save space */
57 #define RGBLIGHT_EFFECT_BREATHING 58 // #define RGBLIGHT_EFFECT_BREATHING
58 #define RGBLIGHT_EFFECT_SNAKE 59 // #define RGBLIGHT_EFFECT_SNAKE
59 #define RGBLIGHT_EFFECT_STATIC_GRADIENT 60 // #define RGBLIGHT_EFFECT_STATIC_GRADIENT
60 #define RGBLIGHT_EFFECT_RAINBOW_SWIRL 61 // #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
61 #define RGBLIGHT_EFFECT_RAINBOW_MOOD 62 // #define RGBLIGHT_EFFECT_RAINBOW_MOOD
63 /* default setup after eeprom reset */
64 #define RGBLIGHT_DEFAULT_MODE RGBLIGHT_EFFECT_BREATHING + 2
65 #define RGBLIGHT_DEFAULT_HUE 152
66 #define RGBLIGHT_DEFAULT_SAT 232
67 #define RGBLIGHT_DEFAULT_VAR 255
68 #define RGBLIGHT_DEFAULT_SPD 2
62#endif 69#endif
70// clang-format on
63 71
64/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ 72/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
65#define DEBOUNCE 5 73#define DEBOUNCE 5
diff --git a/keyboards/0xcb/1337/gfxfont.c b/keyboards/0xcb/1337/gfxfont.c
index 4e7940b64..b78e359c7 100644
--- a/keyboards/0xcb/1337/gfxfont.c
+++ b/keyboards/0xcb/1337/gfxfont.c
@@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17#include "progmem.h" 17#include "progmem.h"
18 18// clang-format off
19static const unsigned char font[] PROGMEM = { 19static const unsigned char font[] PROGMEM = {
20 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 20 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
21 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, 21 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00,
@@ -274,3 +274,4 @@ static const unsigned char font[] PROGMEM = {
274 0x07, 0x07, 0x0F, 0x0F, 0x1E, 0x3E, 274 0x07, 0x07, 0x0F, 0x0F, 0x1E, 0x3E,
275 0x3C, 0x7C, 0x70, 0xC0, 0x80, 0x00, 275 0x3C, 0x7C, 0x70, 0xC0, 0x80, 0x00,
276}; 276};
277// clang-format on
diff --git a/keyboards/0xcb/1337/keymaps/conor/keymap.c b/keyboards/0xcb/1337/keymaps/conor/keymap.c
new file mode 100644
index 000000000..e9d8756b1
--- /dev/null
+++ b/keyboards/0xcb/1337/keymaps/conor/keymap.c
@@ -0,0 +1,185 @@
1/*
2Copyright 2021 0xCB - Conor Burns
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17#include QMK_KEYBOARD_H
18// clang-format off
19enum layer_names {
20 _HOME,
21 _MISC,
22 _RGB,
23 _BLED
24};
25
26const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
27[_HOME] = LAYOUT(
28 KC_MPRV, KC_MNXT, KC_MPLY,
29 KC_PGUP, KC_PGDN, TO(3),
30 KC_HOME, KC_END, TO(1)
31),
32[_MISC] = LAYOUT(
33 _______, _______, _______,
34 _______, _______, TO(0),
35 _______, _______, TO(2)
36),
37[_RGB] = LAYOUT(
38 RGB_HUI, RGB_HUD, RGB_MOD,
39 RGB_SAI, RGB_SAD, TO(1),
40 RGB_SPI, RGB_SPD, TO(3)
41),
42[_BLED] = LAYOUT(
43 BL_STEP, BL_BRTG, BL_TOGG,
44 BL_ON, BL_OFF, TO(2),
45 BL_INC, BL_DEC, TO(0)
46)
47};
48// clang-format on
49
50/* rotary encoder (SW3) - add more else if blocks for more granular layer control */
51#ifdef ENCODER_ENABLE
52bool encoder_update_user(uint8_t index, bool clockwise) {
53 if (IS_LAYER_ON(_RGB)) {
54 #ifdef RGBLIGHT_ENABLE
55 if (clockwise) {
56 rgblight_increase_val();
57 } else {
58 rgblight_decrease_val();
59 }
60 #endif
61 } else if (IS_LAYER_ON(_BLED)) {
62 if (clockwise) {
63 backlight_increase();
64 } else {
65 backlight_decrease();
66 }
67 } else {
68 if (clockwise) {
69 tap_code(KC_VOLU);
70 } else {
71 tap_code(KC_VOLD);
72 }
73 }
74 return true;
75}
76#endif
77
78/* oled stuff :) */
79#ifdef OLED_DRIVER_ENABLE
80uint16_t startup_timer;
81
82oled_rotation_t oled_init_user(oled_rotation_t rotation) {
83 startup_timer = timer_read();
84 return rotation;
85}
86
87static void render_logo(void) {
88 static const char PROGMEM raw_logo[] = {
89 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
90 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 64,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 64,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
91 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128, 0, 0, 0, 0, 0, 0, 1, 2, 4, 2, 1, 1, 1, 1, 1, 1,255, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 1, 1, 1, 1, 1, 1, 2, 4, 2, 1, 0, 0, 0, 0, 0, 0,128, 0, 0, 0,
92 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5,248, 5, 2, 0, 0, 0, 0, 0, 0,128,192,192,224,224,112,120, 56, 63, 28, 14, 14, 14,254, 14, 14, 30, 28, 63, 56,120,112,224,224,192,128, 0, 0, 0, 0, 0, 0, 0, 2, 5,248, 5, 2, 0,
93 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64,160, 19,162, 66, 66, 66, 66, 66, 66, 66,255,255,255, 0, 0, 0,252,254,254,192,192,192,192,255, 0, 0, 0, 62, 62, 60, 60, 0, 0, 1,255,255,255, 66, 66, 66, 66, 66, 66, 66,162, 19,160, 64, 0,
94 0, 0, 0,128, 64, 64, 64,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,128,192, 64, 64,192,128, 0, 0,192, 64, 64,192,128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,192, 64,192, 0, 0, 0, 0, 0,128,192, 64, 64,192,128, 0, 0,128,192, 64, 64,192,128, 0, 0, 64, 64, 64, 64, 64,192, 0, 0, 0, 0, 0,249, 8, 8, 8, 8, 8, 8, 8, 8,127,255,255,192,128,128, 15, 31, 31, 1, 1, 1, 1,255, 0, 0, 0, 30, 30, 14, 14,128,192,192,255,255,127, 8, 8, 8, 8, 8, 8, 8, 8,249, 0, 0, 0,
95 0, 0, 31, 49, 64, 78, 64, 49, 31, 0, 0, 97, 22, 8, 22, 97, 0, 0, 31, 49, 96, 64, 64, 96, 32, 0, 0,127, 68, 68,100, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 64,127, 64, 64, 0, 0, 0, 32,100, 68, 68,110, 59, 0, 0, 32,100, 68, 68,110, 59, 0, 0, 0, 0, 0,126, 3, 1, 0, 0, 0, 8, 20, 35, 20, 8, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 7, 7, 15,254, 30, 28, 28, 28,255, 28, 28, 28, 30,254, 15, 7, 3, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 10, 17, 10, 4, 0,
96 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 40, 68, 40, 16, 16, 16, 16, 16, 16, 31, 0, 0, 16, 40, 71, 40, 16, 0, 0, 31, 16, 16, 16, 16, 16, 16, 40, 68, 40, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
97 };
98 oled_write_raw_P(raw_logo, sizeof(raw_logo));
99}
100static void render_logo_font(void) {
101 static const char PROGMEM qmk_logo[] = {
102 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xCB, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0xCB, 0xCB, 0xCB, 0x9C, 0x9D, 0xCB, 0xCB,
103 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xCB, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xCB, 0xCB, 0xBB, 0xBC, 0xBD, 0xBE, 0xCB,
104 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xCB, 0x88, 0x89, 0x8A, 0x8B, 0x8A, 0x8B, 0x8C, 0x8D, 0xCB, 0xCB, 0xDB, 0xDC, 0xDD, 0xDE, 0xCB,
105 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xCB, 0xA8, 0xA9, 0xAA, 0xAB, 0xAA, 0xAB, 0xAC, 0xAD, 0xCB, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF, 0x00
106 };
107
108 oled_write_P(qmk_logo, false);
109}
110/* Shows the name of the current layer and locks for the host (CAPS etc.) */
111static void render_info(void) {
112 oled_write_P(PSTR("Layer: "), false);
113
114 switch (get_highest_layer(layer_state)) {
115 case _HOME:
116 oled_write_ln_P(PSTR("HOME"), false);
117 break;
118 case _MISC:
119 oled_write_ln_P(PSTR("MISC"), false);
120 break;
121 case _RGB:
122 oled_write_ln_P(PSTR("RGB"), false);
123 break;
124 case _BLED:
125 oled_write_ln_P(PSTR("Backlight"), false);
126 break;
127 default:
128 oled_write_ln_P(PSTR("Undefined"), false);
129 }
130 led_t led_state = host_keyboard_led_state();
131 oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
132 oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
133 oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
134}
135static void render_rgbled_status(bool) {
136 char string[4];
137 if (RGBLIGHT_MODES > 1 && rgblight_is_enabled() && get_highest_layer(layer_state) == _RGB) {
138 uint16_t m = rgblight_get_mode();
139 string[3] = '\0';
140 string[2] = '0' + m % 10;
141 string[1] = ( m /= 10) % 10 ? '0' + (m) % 10 : (m / 10) % 10 ? '0' : ' ';
142 string[0] = m / 10 ? '0' + m / 10 : ' ';
143 oled_write_P(PSTR("Conf:"), false);
144 oled_write(string, false);
145 uint16_t h = rgblight_get_hue()/RGBLIGHT_HUE_STEP;
146 string[3] = '\0';
147 string[2] = '0' + h % 10;
148 string[1] = ( h /= 10) % 10 ? '0' + (h) % 10 : (h / 10) % 10 ? '0' : ' ';
149 string[0] = h / 10 ? '0' + h / 10 : ' ';
150 oled_write_P(PSTR(","), false);
151 oled_write(string, false);
152 uint16_t s = rgblight_get_sat()/RGBLIGHT_SAT_STEP;
153 string[3] = '\0';
154 string[2] = '0' + s % 10;
155 string[1] = ( s /= 10) % 10 ? '0' + (s) % 10 : (s / 10) % 10 ? '0' : ' ';
156 string[0] = s / 10 ? '0' + s / 10 : ' ';
157 oled_write_P(PSTR(","), false);
158 oled_write(string, false);
159 uint16_t v = rgblight_get_val()/RGBLIGHT_VAL_STEP;
160 string[3] = '\0';
161 string[2] = '0' + v % 10;
162 string[1] = ( v /= 10) % 10 ? '0' + (v) % 10 : (v / 10) % 10 ? '0' : ' ';
163 string[0] = v / 10 ? '0' + v / 10 : ' ';
164 oled_write_P(PSTR(","), false);
165 oled_write(string, false);
166 oled_write_ln_P(PSTR("\n MOD HUE SAT VAR"), false);
167 } else {
168 oled_write_ln_P(PSTR("\n"), false);
169 }
170}
171void oled_task_user(void) {
172 static bool finished_timer = false;
173 if (!finished_timer && (timer_elapsed(startup_timer) < 1000)) {
174 render_logo();
175 } else {
176 if (!finished_timer) {
177 oled_clear();
178 finished_timer = true;
179 }
180 render_info();
181 render_rgbled_status(true);
182 render_logo_font();
183 }
184}
185#endif
diff --git a/keyboards/0xcb/1337/keymaps/conor/rules.mk b/keyboards/0xcb/1337/keymaps/conor/rules.mk
new file mode 100644
index 000000000..1e5b99807
--- /dev/null
+++ b/keyboards/0xcb/1337/keymaps/conor/rules.mk
@@ -0,0 +1 @@
VIA_ENABLE = yes
diff --git a/keyboards/0xcb/1337/keymaps/default/keymap.c b/keyboards/0xcb/1337/keymaps/default/keymap.c
index 596ffabcc..5c231298c 100644
--- a/keyboards/0xcb/1337/keymaps/default/keymap.c
+++ b/keyboards/0xcb/1337/keymaps/default/keymap.c
@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17#include QMK_KEYBOARD_H 17#include QMK_KEYBOARD_H
18#include <stdio.h> 18// clang-format off
19
20enum layer_names { 19enum layer_names {
21 _HOME, 20 _HOME,
22 _MISC, 21 _MISC,
@@ -46,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
46 BL_INC, BL_DEC, TO(0) 45 BL_INC, BL_DEC, TO(0)
47) 46)
48}; 47};
49 48// clang-format on
50 49
51/* rotary encoder (SW3) - add more else if blocks for more granular layer control */ 50/* rotary encoder (SW3) - add more else if blocks for more granular layer control */
52#ifdef ENCODER_ENABLE 51#ifdef ENCODER_ENABLE
@@ -100,10 +99,10 @@ static void render_logo(void) {
100} 99}
101static void render_logo_font(void) { 100static void render_logo_font(void) {
102 static const char PROGMEM qmk_logo[] = { 101 static const char PROGMEM qmk_logo[] = {
103 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xCB, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0xCB, 0xCB, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 102 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4,
104 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xCB, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xCB, 0xCB, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 103 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4,
105 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xCB, 0x88, 0x89, 0x8A, 0x8B, 0x8A, 0x8B, 0x8C, 0x8D, 0xCB, 0xCB, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 104 0x88, 0x89, 0x8A, 0x8B, 0x8A, 0x8B, 0x8C, 0x8D, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0,
106 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xCB, 0xA8, 0xA9, 0xAA, 0xAB, 0xAA, 0xAB, 0xAC, 0xAD, 0xCB, 0xCB, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0x00 105 0xA8, 0xA9, 0xAA, 0xAB, 0xAA, 0xAB, 0xAC, 0xAD, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0x00
107 }; 106 };
108 107
109 oled_write_P(qmk_logo, false); 108 oled_write_P(qmk_logo, false);
@@ -133,24 +132,41 @@ static void render_info(void) {
133 oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); 132 oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
134 oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); 133 oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
135} 134}
136static void render_rgbled_status(bool full) { 135static void render_rgbled_status(bool) {
137#ifdef RGBLIGHT_ENABLE 136 char string[4];
138 char buf[30]; 137 if (RGBLIGHT_MODES > 1 && rgblight_is_enabled() && get_highest_layer(layer_state) == _RGB) {
139 if (RGBLIGHT_MODES > 1 && rgblight_is_enabled() && get_highest_layer(layer_state) == _RGB) { 138 uint16_t m = rgblight_get_mode();
140 if (full) { 139 string[3] = '\0';
141 snprintf(buf, sizeof(buf), "RGB mode %2d: %d,%d,%d \n", 140 string[2] = '0' + m % 10;
142 rgblight_get_mode(), 141 string[1] = ( m /= 10) % 10 ? '0' + (m) % 10 : (m / 10) % 10 ? '0' : ' ';
143 rgblight_get_hue()/RGBLIGHT_HUE_STEP, 142 string[0] = m / 10 ? '0' + m / 10 : ' ';
144 rgblight_get_sat()/RGBLIGHT_SAT_STEP, 143 oled_write_P(PSTR("Conf:"), false);
145 rgblight_get_val()/RGBLIGHT_VAL_STEP); 144 oled_write(string, false);
146 } else { 145 uint16_t h = rgblight_get_hue()/RGBLIGHT_HUE_STEP;
147 snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode()); 146 string[3] = '\0';
148 } 147 string[2] = '0' + h % 10;
149 oled_write(buf, false); 148 string[1] = ( h /= 10) % 10 ? '0' + (h) % 10 : (h / 10) % 10 ? '0' : ' ';
150 } else { 149 string[0] = h / 10 ? '0' + h / 10 : ' ';
151 oled_write_ln_P(PSTR("\n"), false); 150 oled_write_P(PSTR(","), false);
152 } 151 oled_write(string, false);
153#endif 152 uint16_t s = rgblight_get_sat()/RGBLIGHT_SAT_STEP;
153 string[3] = '\0';
154 string[2] = '0' + s % 10;
155 string[1] = ( s /= 10) % 10 ? '0' + (s) % 10 : (s / 10) % 10 ? '0' : ' ';
156 string[0] = s / 10 ? '0' + s / 10 : ' ';
157 oled_write_P(PSTR(","), false);
158 oled_write(string, false);
159 uint16_t v = rgblight_get_val()/RGBLIGHT_VAL_STEP;
160 string[3] = '\0';
161 string[2] = '0' + v % 10;
162 string[1] = ( v /= 10) % 10 ? '0' + (v) % 10 : (v / 10) % 10 ? '0' : ' ';
163 string[0] = v / 10 ? '0' + v / 10 : ' ';
164 oled_write_P(PSTR(","), false);
165 oled_write(string, false);
166 oled_write_ln_P(PSTR("\n MOD HUE SAT VAR"), false);
167 } else {
168 oled_write_ln_P(PSTR("\n"), false);
169 }
154} 170}
155void oled_task_user(void) { 171void oled_task_user(void) {
156 static bool finished_timer = false; 172 static bool finished_timer = false;
diff --git a/keyboards/0xcb/1337/keymaps/jakob/keymap.c b/keyboards/0xcb/1337/keymaps/jakob/keymap.c
index 14427ee6d..f4a5c3cb4 100644
--- a/keyboards/0xcb/1337/keymaps/jakob/keymap.c
+++ b/keyboards/0xcb/1337/keymaps/jakob/keymap.c
@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17#include QMK_KEYBOARD_H 17#include QMK_KEYBOARD_H
18#include <stdio.h> 18// clang-format off
19
20enum layer_names { 19enum layer_names {
21 _HOME, 20 _HOME,
22 _MISC, 21 _MISC,
@@ -46,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
46 BL_INC, BL_DEC, TO(0) 45 BL_INC, BL_DEC, TO(0)
47) 46)
48}; 47};
49 48// clang-format on
50 49
51/* rotary encoder (SW3) - add more else if blocks for more granular layer control */ 50/* rotary encoder (SW3) - add more else if blocks for more granular layer control */
52#ifdef ENCODER_ENABLE 51#ifdef ENCODER_ENABLE
@@ -100,10 +99,10 @@ static void render_logo(void) {
100} 99}
101static void render_logo_font(void) { 100static void render_logo_font(void) {
102 static const char PROGMEM qmk_logo[] = { 101 static const char PROGMEM qmk_logo[] = {
103 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xCB, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0xCB, 0xCB, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 102 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4,
104 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xCB, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xCB, 0xCB, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 103 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4,
105 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xCB, 0x88, 0x89, 0x8A, 0x8B, 0x8A, 0x8B, 0x8C, 0x8D, 0xCB, 0xCB, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 104 0x88, 0x89, 0x8A, 0x8B, 0x8A, 0x8B, 0x8C, 0x8D, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0,
106 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xCB, 0xA8, 0xA9, 0xAA, 0xAB, 0xAA, 0xAB, 0xAC, 0xAD, 0xCB, 0xCB, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0x00 105 0xA8, 0xA9, 0xAA, 0xAB, 0xAA, 0xAB, 0xAC, 0xAD, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0x00
107 }; 106 };
108 107
109 oled_write_P(qmk_logo, false); 108 oled_write_P(qmk_logo, false);
@@ -133,24 +132,41 @@ static void render_info(void) {
133 oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); 132 oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
134 oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); 133 oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
135} 134}
136static void render_rgbled_status(bool full) { 135static void render_rgbled_status(bool) {
137#ifdef RGBLIGHT_ENABLE 136 char string[4];
138 char buf[30]; 137 if (RGBLIGHT_MODES > 1 && rgblight_is_enabled() && get_highest_layer(layer_state) == _RGB) {
139 if (RGBLIGHT_MODES > 1 && rgblight_is_enabled() && get_highest_layer(layer_state) == _RGB) { 138 uint16_t m = rgblight_get_mode();
140 if (full) { 139 string[3] = '\0';
141 snprintf(buf, sizeof(buf), "RGB mode %2d: %d,%d,%d \n", 140 string[2] = '0' + m % 10;
142 rgblight_get_mode(), 141 string[1] = ( m /= 10) % 10 ? '0' + (m) % 10 : (m / 10) % 10 ? '0' : ' ';
143 rgblight_get_hue()/RGBLIGHT_HUE_STEP, 142 string[0] = m / 10 ? '0' + m / 10 : ' ';
144 rgblight_get_sat()/RGBLIGHT_SAT_STEP, 143 oled_write_P(PSTR("Conf:"), false);
145 rgblight_get_val()/RGBLIGHT_VAL_STEP); 144 oled_write(string, false);
146 } else { 145 uint16_t h = rgblight_get_hue()/RGBLIGHT_HUE_STEP;
147 snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode()); 146 string[3] = '\0';
148 } 147 string[2] = '0' + h % 10;
149 oled_write(buf, false); 148 string[1] = ( h /= 10) % 10 ? '0' + (h) % 10 : (h / 10) % 10 ? '0' : ' ';
150 } else { 149 string[0] = h / 10 ? '0' + h / 10 : ' ';
151 oled_write_ln_P(PSTR("\n"), false); 150 oled_write_P(PSTR(","), false);
152 } 151 oled_write(string, false);
153#endif 152 uint16_t s = rgblight_get_sat()/RGBLIGHT_SAT_STEP;
153 string[3] = '\0';
154 string[2] = '0' + s % 10;
155 string[1] = ( s /= 10) % 10 ? '0' + (s) % 10 : (s / 10) % 10 ? '0' : ' ';
156 string[0] = s / 10 ? '0' + s / 10 : ' ';
157 oled_write_P(PSTR(","), false);
158 oled_write(string, false);
159 uint16_t v = rgblight_get_val()/RGBLIGHT_VAL_STEP;
160 string[3] = '\0';
161 string[2] = '0' + v % 10;
162 string[1] = ( v /= 10) % 10 ? '0' + (v) % 10 : (v / 10) % 10 ? '0' : ' ';
163 string[0] = v / 10 ? '0' + v / 10 : ' ';
164 oled_write_P(PSTR(","), false);
165 oled_write(string, false);
166 oled_write_ln_P(PSTR("\n MOD HUE SAT VAR"), false);
167 } else {
168 oled_write_ln_P(PSTR("\n"), false);
169 }
154} 170}
155void oled_task_user(void) { 171void oled_task_user(void) {
156 static bool finished_timer = false; 172 static bool finished_timer = false;
diff --git a/keyboards/0xcb/1337/keymaps/via/keymap.c b/keyboards/0xcb/1337/keymaps/via/keymap.c
index 596ffabcc..5c231298c 100644
--- a/keyboards/0xcb/1337/keymaps/via/keymap.c
+++ b/keyboards/0xcb/1337/keymaps/via/keymap.c
@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17#include QMK_KEYBOARD_H 17#include QMK_KEYBOARD_H
18#include <stdio.h> 18// clang-format off
19
20enum layer_names { 19enum layer_names {
21 _HOME, 20 _HOME,
22 _MISC, 21 _MISC,
@@ -46,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
46 BL_INC, BL_DEC, TO(0) 45 BL_INC, BL_DEC, TO(0)
47) 46)
48}; 47};
49 48// clang-format on
50 49
51/* rotary encoder (SW3) - add more else if blocks for more granular layer control */ 50/* rotary encoder (SW3) - add more else if blocks for more granular layer control */
52#ifdef ENCODER_ENABLE 51#ifdef ENCODER_ENABLE
@@ -100,10 +99,10 @@ static void render_logo(void) {
100} 99}
101static void render_logo_font(void) { 100static void render_logo_font(void) {
102 static const char PROGMEM qmk_logo[] = { 101 static const char PROGMEM qmk_logo[] = {
103 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xCB, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0xCB, 0xCB, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 102 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4,
104 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xCB, 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xCB, 0xCB, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 103 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4,
105 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xCB, 0x88, 0x89, 0x8A, 0x8B, 0x8A, 0x8B, 0x8C, 0x8D, 0xCB, 0xCB, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 104 0x88, 0x89, 0x8A, 0x8B, 0x8A, 0x8B, 0x8C, 0x8D, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0,
106 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xCB, 0xA8, 0xA9, 0xAA, 0xAB, 0xAA, 0xAB, 0xAC, 0xAD, 0xCB, 0xCB, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0x00 105 0xA8, 0xA9, 0xAA, 0xAB, 0xAA, 0xAB, 0xAC, 0xAD, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0x00
107 }; 106 };
108 107
109 oled_write_P(qmk_logo, false); 108 oled_write_P(qmk_logo, false);
@@ -133,24 +132,41 @@ static void render_info(void) {
133 oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); 132 oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
134 oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); 133 oled_write_ln_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
135} 134}
136static void render_rgbled_status(bool full) { 135static void render_rgbled_status(bool) {
137#ifdef RGBLIGHT_ENABLE 136 char string[4];
138 char buf[30]; 137 if (RGBLIGHT_MODES > 1 && rgblight_is_enabled() && get_highest_layer(layer_state) == _RGB) {
139 if (RGBLIGHT_MODES > 1 && rgblight_is_enabled() && get_highest_layer(layer_state) == _RGB) { 138 uint16_t m = rgblight_get_mode();
140 if (full) { 139 string[3] = '\0';
141 snprintf(buf, sizeof(buf), "RGB mode %2d: %d,%d,%d \n", 140 string[2] = '0' + m % 10;
142 rgblight_get_mode(), 141 string[1] = ( m /= 10) % 10 ? '0' + (m) % 10 : (m / 10) % 10 ? '0' : ' ';
143 rgblight_get_hue()/RGBLIGHT_HUE_STEP, 142 string[0] = m / 10 ? '0' + m / 10 : ' ';
144 rgblight_get_sat()/RGBLIGHT_SAT_STEP, 143 oled_write_P(PSTR("Conf:"), false);
145 rgblight_get_val()/RGBLIGHT_VAL_STEP); 144 oled_write(string, false);
146 } else { 145 uint16_t h = rgblight_get_hue()/RGBLIGHT_HUE_STEP;
147 snprintf(buf, sizeof(buf), "[%2d] ", rgblight_get_mode()); 146 string[3] = '\0';
148 } 147 string[2] = '0' + h % 10;
149 oled_write(buf, false); 148 string[1] = ( h /= 10) % 10 ? '0' + (h) % 10 : (h / 10) % 10 ? '0' : ' ';
150 } else { 149 string[0] = h / 10 ? '0' + h / 10 : ' ';
151 oled_write_ln_P(PSTR("\n"), false); 150 oled_write_P(PSTR(","), false);
152 } 151 oled_write(string, false);
153#endif 152 uint16_t s = rgblight_get_sat()/RGBLIGHT_SAT_STEP;
153 string[3] = '\0';
154 string[2] = '0' + s % 10;
155 string[1] = ( s /= 10) % 10 ? '0' + (s) % 10 : (s / 10) % 10 ? '0' : ' ';
156 string[0] = s / 10 ? '0' + s / 10 : ' ';
157 oled_write_P(PSTR(","), false);
158 oled_write(string, false);
159 uint16_t v = rgblight_get_val()/RGBLIGHT_VAL_STEP;
160 string[3] = '\0';
161 string[2] = '0' + v % 10;
162 string[1] = ( v /= 10) % 10 ? '0' + (v) % 10 : (v / 10) % 10 ? '0' : ' ';
163 string[0] = v / 10 ? '0' + v / 10 : ' ';
164 oled_write_P(PSTR(","), false);
165 oled_write(string, false);
166 oled_write_ln_P(PSTR("\n MOD HUE SAT VAR"), false);
167 } else {
168 oled_write_ln_P(PSTR("\n"), false);
169 }
154} 170}
155void oled_task_user(void) { 171void oled_task_user(void) {
156 static bool finished_timer = false; 172 static bool finished_timer = false;
diff --git a/keyboards/0xcb/1337/readme.md b/keyboards/0xcb/1337/readme.md
index da54eb78f..8fef5be7b 100644
--- a/keyboards/0xcb/1337/readme.md
+++ b/keyboards/0xcb/1337/readme.md
@@ -3,16 +3,16 @@
3Macro keypad 3Macro keypad
4 4
5* Keyboard Maintainer: [Conor Burns](https://github.com/conor-burns) 5* Keyboard Maintainer: [Conor Burns](https://github.com/conor-burns)
6* Hardware Supported: https://github.com/conor-burns/0xcb-1337 6* Hardware Supported: https://github.com/0xcb-dev/0xcb-1337
7* Hardware Availability: Soon on tindie or order your own parts - the hardware in the repo is Open Source :D 7* Hardware Availability: On [tindie](https://www.tindie.com/products/0xcb/0xcb-1337-a-customizable-macro-keyboard-with-qmk/) or order your own parts - the hardware in the repo is Open Source :D
8* PCB renders :) 8* PCB renders :)
9 9
10![](https://github.com/Conor-Burns/0xcb-1337/blob/main/PCB/top.png) 10![](https://github.com/0xCB-dev/0xcb-1337/blob/main/PCB/rev3.0/top.png)
11 11
12![](https://github.com/Conor-Burns/0xcb-1337/blob/main/PCB/bottom.png) 12![](https://github.com/0xCB-dev/0xcb-1337/blob/main/PCB/rev3.0/bottom.png)
13 13
14 14More Pictures [here](https://0xcb.dev/1337/)
15To go to bootloader press row 0 col 0 key (top left) while plugging in the board. 15To go to bootloader press row 0 col 0 key (top left) while plugging in the board. (Or press the reset button on V2.0 and v3.0)
16 16
17Make example for this keyboard (after setting up your build environment): 17Make example for this keyboard (after setting up your build environment):
18 18