aboutsummaryrefslogtreecommitdiff
path: root/keyboards/dekunukem
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2021-02-16 18:10:43 +0000
committerQMK Bot <hello@qmk.fm>2021-02-16 18:10:43 +0000
commitd565586e46895603d82cf6a85304caa1bcf0e8d0 (patch)
tree92d9c18e95670c3f2fbbeb7ffdafdf48f5a77198 /keyboards/dekunukem
parent65326f7d1fb057587ddd76bbe8d0ef64d7aee87c (diff)
parentac33dc12dacee480eba67462d985cb4dc7589c7f (diff)
downloadqmk_firmware-d565586e46895603d82cf6a85304caa1bcf0e8d0.tar.gz
qmk_firmware-d565586e46895603d82cf6a85304caa1bcf0e8d0.zip
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'keyboards/dekunukem')
-rw-r--r--keyboards/dekunukem/duckypad/config.h11
-rw-r--r--keyboards/dekunukem/duckypad/duckypad.c4
-rw-r--r--keyboards/dekunukem/duckypad/duckypad.h12
-rw-r--r--keyboards/dekunukem/duckypad/keymaps/m4cs/keymap.c186
-rw-r--r--keyboards/dekunukem/duckypad/keymaps/m4cs/readme.md4
-rw-r--r--keyboards/dekunukem/duckypad/keymaps/m4cs/sysinfo.py78
-rw-r--r--keyboards/dekunukem/duckypad/keymaps/via/keymap.c73
-rw-r--r--keyboards/dekunukem/duckypad/keymaps/via/rules.mk3
8 files changed, 317 insertions, 54 deletions
diff --git a/keyboards/dekunukem/duckypad/config.h b/keyboards/dekunukem/duckypad/config.h
index 9abfd0bd7..2f1b2ef32 100644
--- a/keyboards/dekunukem/duckypad/config.h
+++ b/keyboards/dekunukem/duckypad/config.h
@@ -22,9 +22,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
22 22
23#include "config_common.h" 23#include "config_common.h"
24 24
25#define VENDOR_ID 0xFEED 25#define VENDOR_ID 0x444E // "DN"
26#define PRODUCT_ID 0x0B91 26#define PRODUCT_ID 0x4450 // "DP"
27#define DEVICE_VER 0x0001 27#define DEVICE_VER 0x0001 // 1.0
28#define MANUFACTURER dekuNukem 28#define MANUFACTURER dekuNukem
29#define PRODUCT duckyPad 29#define PRODUCT duckyPad
30 30
@@ -37,10 +37,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
37#define RGBLED_NUM 15 37#define RGBLED_NUM 15
38#define DRIVER_LED_TOTAL 15 38#define DRIVER_LED_TOTAL 15
39 39
40#ifdef RGB_MATRIX_ENABLE
41
40#define RGB_MATRIX_KEYPRESSES 42#define RGB_MATRIX_KEYPRESSES
41#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_REACTIVE_SIMPLE 43#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_REACTIVE_SIMPLE
42#define RGB_MATRIX_STARTUP_HUE 221 44#define RGB_MATRIX_STARTUP_HUE 221
43 45
46
47#endif
48
44#define I2C1_SCL 8 49#define I2C1_SCL 8
45#define I2C1_SDA 9 50#define I2C1_SDA 9
46 51
diff --git a/keyboards/dekunukem/duckypad/duckypad.c b/keyboards/dekunukem/duckypad/duckypad.c
index 831a42a04..5cadebd95 100644
--- a/keyboards/dekunukem/duckypad/duckypad.c
+++ b/keyboards/dekunukem/duckypad/duckypad.c
@@ -20,6 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20 20
21#include "duckypad.h" 21#include "duckypad.h"
22 22
23#ifdef RGB_MATRIX_ENABLE
24
23led_config_t g_led_config = { { 25led_config_t g_led_config = { {
24 { 2, 1, 0, 3, 4, 5, 8, 7, 6, 9, 10, 11, 14, 13, 12, NO_LED, NO_LED } 26 { 2, 1, 0, 3, 4, 5, 8, 7, 6, 9, 10, 11, 14, 13, 12, NO_LED, NO_LED }
25}, { 27}, {
@@ -42,6 +44,8 @@ led_config_t g_led_config = { {
42 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 44 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
43} }; 45} };
44 46
47#endif
48
45void keyboard_pre_init_kb(void) { 49void keyboard_pre_init_kb(void) {
46 setPinOutput(A0); 50 setPinOutput(A0);
47 writePinHigh(A0); 51 writePinHigh(A0);
diff --git a/keyboards/dekunukem/duckypad/duckypad.h b/keyboards/dekunukem/duckypad/duckypad.h
index abde7aac6..984eb9cda 100644
--- a/keyboards/dekunukem/duckypad/duckypad.h
+++ b/keyboards/dekunukem/duckypad/duckypad.h
@@ -24,9 +24,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
24 24
25#define LAYOUT( \ 25#define LAYOUT( \
26 k00, k01, k02, \ 26 k00, k01, k02, \
27 k10, k11, k12, \ 27 k03, k04, k05, \
28 k20, k21, k22, \ 28 k06, k07, k08, \
29 k30, k31, k32, \ 29 k09, k010, k011, \
30 k40, k41, k42, \ 30 k012, k013, k014, \
31 kDown, kUp \ 31 k015, k016 \
32) {{k00, k01, k02, k10, k11, k12, k20, k21, k22, k30, k31, k32, k40, k41, k42, kDown, kUp}} 32) {{k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, k013, k014, k015, k016}}
diff --git a/keyboards/dekunukem/duckypad/keymaps/m4cs/keymap.c b/keyboards/dekunukem/duckypad/keymaps/m4cs/keymap.c
index 2ce15d7e7..80b188a48 100644
--- a/keyboards/dekunukem/duckypad/keymaps/m4cs/keymap.c
+++ b/keyboards/dekunukem/duckypad/keymaps/m4cs/keymap.c
@@ -21,25 +21,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
21#include QMK_KEYBOARD_H 21#include QMK_KEYBOARD_H
22 22
23#include "stdio.h" 23#include "stdio.h"
24#include <unistd.h> 24#include "raw_hid.h"
25#include <string.h> 25#include <string.h>
26#include <stdlib.h>
27#include <math.h>
26 28
27#define LOGO_SIZE 384 29#define LOGO_SIZE 384
28 30
29bool rgbToggled = false; 31bool rgbToggled = false;
30bool altToggled = false; 32bool altToggled = false;
33bool sysToggled = false;
31 34
32enum layer_codes { 35enum layer_codes {
33 RGB_LAYER = SAFE_RANGE, 36 RGB_LAYER = SAFE_RANGE,
34 ALT_LAYER 37 ALT_LAYER,
35}; 38 SYS_LAYER,
36 39 CLOCK_TOGGLE
37enum my_keycodes {
38 Z0 = SAFE_RANGE, Z1, Z2,
39 Z3, Z4, Z5,
40 Z6, Z7, Z8,
41 Z9, Z10, Z11,
42 Z12, Z13, Z14
43}; 40};
44 41
45#define MAC_1 LCTL(LALT(KC_MINS)) 42#define MAC_1 LCTL(LALT(KC_MINS))
@@ -65,6 +62,14 @@ enum my_keycodes {
65#define _DEFAULT 0 62#define _DEFAULT 0
66#define _RGB 1 63#define _RGB 1
67#define _ALT 2 64#define _ALT 2
65#define _SYS 3
66
67float cpuFreq = 0;
68int memPerc = 0;
69int gpuLoad = 0;
70int temp = 0;
71int hour = 0;
72int minute = 0;
68 73
69 74
70const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 75const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@@ -78,7 +83,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
78 |=========================================| 83 |=========================================|
79 | Macro 4 | Macro 5 | Macro 6 | 84 | Macro 4 | Macro 5 | Macro 6 |
80 |=========================================| ,---------------------. 85 |=========================================| ,---------------------.
81 | Macro 7 | Macro 8 | Macro 9 | | RGB Menu | Alt Menu | 86 | Macro 7 | Macro 8 | Sys. Info | | RGB Menu | Alt Menu |
82 `=========================================' `--------------------' 87 `=========================================' `--------------------'
83 */ 88 */
84 [_DEFAULT] = LAYOUT( 89 [_DEFAULT] = LAYOUT(
@@ -86,7 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
86 KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, 91 KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP,
87 MAC_1, MAC_2, MAC_3, 92 MAC_1, MAC_2, MAC_3,
88 MAC_4, MAC_5, MAC_6, 93 MAC_4, MAC_5, MAC_6,
89 MAC_7, MAC_8, MAC_9, 94 CLOCK_TOGGLE, MAC_8, SYS_LAYER,
90 RGB_LAYER, ALT_LAYER 95 RGB_LAYER, ALT_LAYER
91 ), 96 ),
92 /* 97 /*
@@ -120,7 +125,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
120 |=========================================| 125 |=========================================|
121 | Macro 13 | Macro 14 | Macro 15 | 126 | Macro 13 | Macro 14 | Macro 15 |
122 |=========================================| ,----------------------. 127 |=========================================| ,----------------------.
123 | Macro 16 | Macro 17 | Macro 18 | | Norm Menu | Alt Menu | 128 | Macro 16 | Macro 17 | Sys. Info | | Norm Menu | Alt Menu |
124 `=========================================' `---------------------' 129 `=========================================' `---------------------'
125 */ 130 */
126 [_ALT] = LAYOUT( 131 [_ALT] = LAYOUT(
@@ -128,24 +133,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
128 KC_UNDO, KC_CUT, KC_COPY, 133 KC_UNDO, KC_CUT, KC_COPY,
129 KC_PASTE, KC_FIND, KC_PSCR, 134 KC_PASTE, KC_FIND, KC_PSCR,
130 MAC_13, MAC_14, MAC_15, 135 MAC_13, MAC_14, MAC_15,
131 MAC_16, MAC_17, MAC_18, 136 CLOCK_TOGGLE, MAC_17, SYS_LAYER,
137 RGB_LAYER, ALT_LAYER
138 ),
139 [_SYS] = LAYOUT(
140 KC_NO, KC_NO, KC_NO,
141 KC_NO, KC_NO, KC_NO,
142 KC_NO, KC_NO, KC_NO,
143 KC_NO, KC_NO, KC_NO,
144 CLOCK_TOGGLE, KC_NO, SYS_LAYER,
132 RGB_LAYER, ALT_LAYER 145 RGB_LAYER, ALT_LAYER
133 ) 146 )
134}; 147};
135 148
136static void render_logo(void) { 149static void render_logo(void) {
137 static const char PROGMEM ducky_logo[LOGO_SIZE] = { 150 static const char PROGMEM raw_logo[] = {
138 0, 0, 0, 0,128,128,128,128,128, 0, 0,252,252,252, 0, 0, 0,128,128,128, 0, 0, 0, 0, 0,128,128,128, 0, 0, 0, 0, 0,128,128,128,128,128, 0, 0, 0, 0, 0,252,252,252, 0, 0, 0, 0, 0,128,128,128,128,128,128, 0, 0, 0, 0, 0, 0,128,128,128,128, 0,248,248,248, 56, 56, 56, 56, 56, 56,120,240,224,192, 0, 0,128,128,128,128,128,128, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128,128,128, 0, 0,252,252,252, 0, 0, 0, 0, 0,232, 24, 24,232, 0, 24, 48, 48, 24, 0,232, 24, 24,232, 0, 0, 151 0, 0, 0, 0,128,128,128,128,128, 0, 0,252,252,252, 0, 0, 0,128,128,128, 0, 0, 0, 0, 0,128,128,128, 0, 0, 0, 0, 0,128,128,128,128,128, 0, 0, 0, 0, 0,252,252,252, 0, 0, 0, 0, 0,128,128,128,128,128,128, 0, 0, 0, 0, 0, 0,128,128,128,128, 0,248,248,248, 56, 56, 56, 56, 56, 56,120,240,224,192, 0, 0,128,128,128,128,128,128, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128,128,128, 0, 0,252,252,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
139 0,248,254,255,143, 7, 3, 3, 3, 7,142,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0,255,255,255, 0,248,254,255,143, 7, 3, 3, 3, 3,143, 7, 2, 0, 0,255,255,255,240,120,252,254,231,131, 1, 0, 1, 7, 63,254,240,192, 0,224,252,127, 31, 3, 0, 0,255,255,255,112,112,112,112,112,112, 56, 63, 31, 15,193,231,243,115, 51, 51, 51, 55,255,255,252, 0, 0,248,254,255,143, 7, 3, 3, 3, 7,142,255,255,255, 0, 0, 0, 0, 0, 21,127,127,252,252,252,253,253,252,252,252,255,255,255, 0, 0, 152 0,248,254,255,143, 7, 3, 3, 3, 7,142,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0,255,255,255, 0,248,254,255,143, 7, 3, 3, 3, 3,143, 7, 2, 0, 0,255,255,255,240,120,252,254,231,131, 1, 0, 1, 7, 63,254,240,192, 0,224,252,127, 31, 3, 0, 0,255,255,255,112,112,112,112,112,112, 56, 63, 31, 15,193,231,243,115, 51, 51, 51, 55,255,255,252, 0, 0,248,254,255,143, 7, 3, 3, 3, 7,142,255,255,255, 0, 0, 0, 0,192,240,240, 96, 48, 48, 0, 12, 12,134,198,230,126, 60, 0, 0, 0,
140 0, 0, 3, 7, 15, 15, 14, 14, 14, 7, 3, 15, 15, 15, 0, 0, 0, 3, 7, 15, 15, 14, 14, 6, 3, 15, 15, 15, 0, 0, 3, 7, 7, 15, 14, 14, 14, 14, 7, 7, 2, 0, 0, 15, 15, 15, 0, 0, 0, 1, 3, 15, 15, 12,136,224,224,224,247,127,127, 31, 3, 0, 0, 0, 0, 0, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 15, 14, 14, 14, 6, 3, 15, 15, 15, 0, 0, 0, 3, 7, 15, 15, 14, 14, 14, 7, 3, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 7, 11, 3, 11, 7, 11, 7, 7, 31, 0, 0 153 0, 0, 3, 7, 15, 15, 14, 14, 14, 7, 3, 15, 15, 15, 0, 0, 0, 3, 7, 15, 15, 14, 14, 6, 3, 15, 15, 15, 0, 0, 3, 7, 7, 15, 14, 14, 14, 14, 7, 7, 2, 0, 0, 15, 15, 15, 0, 0, 0, 1, 3, 15, 15, 12,136,224,224,224,247,127,127, 31, 3, 0, 0, 0, 0, 0, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 15, 14, 14, 14, 6, 3, 15, 15, 15, 0, 0, 0, 3, 7, 15, 15, 14, 14, 14, 7, 3, 15, 15, 15, 0, 0, 0, 12, 15, 7, 0, 0, 0, 12, 14, 15, 15, 13, 13, 12, 12, 0, 0, 0, 0,
141 }; 154 };
142 oled_write_raw_P(ducky_logo, LOGO_SIZE); 155 oled_write_raw_P(raw_logo, sizeof(raw_logo));
143} 156}
144 157
145char* make_menu_text(void){ 158char* make_menu_text(void){
146 char *s = malloc((30 * 3) * sizeof(*s)); 159 char *s = malloc((30 * 4) * sizeof(*s));
147 int width = 3; 160 int width = 3;
148 sprintf(s, "%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s", 161 snprintf(s, 120, "%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s",
149 width, MT_0_0, width, MT_0_1, width, MT_0_2, 162 width, MT_0_0, width, MT_0_1, width, MT_0_2,
150 width, MT_0_3, width, MT_0_4, width, MT_0_5, 163 width, MT_0_3, width, MT_0_4, width, MT_0_5,
151 width, MT_0_6, width, MT_0_7, width, MT_0_8, 164 width, MT_0_6, width, MT_0_7, width, MT_0_8,
@@ -156,10 +169,10 @@ char* make_menu_text(void){
156}; 169};
157 170
158char* make_rgb_text(void){ 171char* make_rgb_text(void){
159 char *s = malloc((30 * 3) * sizeof(*s)); 172 char *s = malloc((30 * 4) * sizeof(*s));
160 int width = 3; 173 int width = 3;
161 sprintf( 174 snprintf(
162 s, "%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s", 175 s, 120, "%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s",
163 width, MT_1_0, width, MT_1_1, width, MT_1_2, 176 width, MT_1_0, width, MT_1_1, width, MT_1_2,
164 width, MT_1_3, width, MT_1_4, width, MT_1_5, 177 width, MT_1_3, width, MT_1_4, width, MT_1_5,
165 width, MT_1_6, width, MT_1_7, width, MT_1_8, 178 width, MT_1_6, width, MT_1_7, width, MT_1_8,
@@ -170,10 +183,10 @@ char* make_rgb_text(void){
170}; 183};
171 184
172char* make_alt_text(void){ 185char* make_alt_text(void){
173 char *s = malloc((30 * 3) * sizeof(*s)); 186 char *s = malloc((30 * 4) * sizeof(*s));
174 int width = 3; 187 int width = 3;
175 sprintf( 188 snprintf(
176 s, "%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s", 189 s, 120, "%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s\n%-*s %-*s %-*s",
177 width, MT_2_0, width, MT_2_1, width, MT_2_2, 190 width, MT_2_0, width, MT_2_1, width, MT_2_2,
178 width, MT_2_3, width, MT_2_4, width, MT_2_5, 191 width, MT_2_3, width, MT_2_4, width, MT_2_5,
179 width, MT_2_6, width, MT_2_7, width, MT_2_8, 192 width, MT_2_6, width, MT_2_7, width, MT_2_8,
@@ -183,23 +196,87 @@ char* make_alt_text(void){
183 return s; 196 return s;
184}; 197};
185 198
199char* make_sys_info_text(void) {
200 char *s = malloc((30 * 5) * sizeof(*s));
201 snprintf(s, 150, " cpu: %.1fGHz\n mem: %d%%\n gpu: %d%%\n temp: %dC\n time: %d:%d", cpuFreq, memPerc, gpuLoad, temp, hour, minute);
202 return s;
203};
204
205
186void oled_task_user(void) { 206void oled_task_user(void) {
187 render_logo(); 207 if (!sysToggled) {
188 oled_set_cursor(0,3); 208 render_logo();
189 if (rgbToggled) { 209 oled_set_cursor(0,3);
190 char *s = make_rgb_text(); 210 if (rgbToggled) {
191 oled_write_ln_P(s, false); 211 char *s = make_rgb_text();
192 free(s); 212 oled_write_ln(s, false);
193 } else if (altToggled) { 213 free(s);
194 char *s = make_alt_text(); 214 } else if (altToggled) {
195 oled_write_ln_P(s, false); 215 char *s = make_alt_text();
196 free(s); 216 oled_write_ln(s, false);
197 } else { 217 free(s);
198 char *s = make_menu_text(); 218 } else {
199 oled_write_ln_P(s, false); 219 char *s = make_menu_text();
200 free(s); 220 oled_write_ln(s, false);
221 free(s);
222 }
201 } 223 }
202} 224};
225
226int concat(int a, int b) {
227 char s1[20];
228 char s2[20];
229 sprintf(s1, "%d", a);
230 sprintf(s2, "%d", b);
231 strcat(s1, s2);
232 int c = atoi(s1);
233
234 return c;
235};
236
237void raw_hid_receive(uint8_t *data, uint8_t length) {
238 if (sysToggled) {
239 oled_clear();
240 render_logo();
241 int i;
242 int stepper = 0;
243 int toWrite;
244 for (i=0; i < length; i++) {
245 if (data[i] != 13) {
246 toWrite = concat(toWrite, data[i]);
247 } else {
248 switch (stepper) {
249 case 0:
250 cpuFreq = floor(100*toWrite)/10000;
251 break;
252 case 1:
253 memPerc = toWrite / 10;
254 break;
255 case 2:
256 gpuLoad = toWrite;
257 break;
258 case 3:
259 temp = toWrite;
260 break;
261 case 4:
262 hour = toWrite;
263 break;
264 case 5:
265 minute = toWrite;
266 break;
267 default:
268 break;
269 }
270 toWrite = 0;
271 stepper++;
272 }
273 }
274 oled_set_cursor(0,3);
275 char *s = make_sys_info_text();
276 oled_write_ln(s, false);
277 free(s);
278 }
279};
203 280
204bool process_record_user(uint16_t keycode, keyrecord_t *record) { 281bool process_record_user(uint16_t keycode, keyrecord_t *record) {
205 switch (keycode) { 282 switch (keycode) {
@@ -208,10 +285,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
208 if (rgbToggled) { 285 if (rgbToggled) {
209 rgbToggled = false; 286 rgbToggled = false;
210 altToggled = false; 287 altToggled = false;
288 sysToggled = false;
289 oled_clear();
211 layer_clear(); 290 layer_clear();
212 } else { 291 } else {
213 rgbToggled = true; 292 rgbToggled = true;
214 altToggled = false; 293 altToggled = false;
294 sysToggled = false;
215 layer_on(_RGB); 295 layer_on(_RGB);
216 } 296 }
217 } 297 }
@@ -221,16 +301,34 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
221 if (altToggled) { 301 if (altToggled) {
222 rgbToggled = false; 302 rgbToggled = false;
223 altToggled = false; 303 altToggled = false;
304 sysToggled = false;
305 oled_clear();
224 layer_clear(); 306 layer_clear();
225 } else { 307 } else {
226 rgbToggled = false; 308 rgbToggled = false;
309 sysToggled = false;
227 altToggled = true; 310 altToggled = true;
228 layer_on(_ALT); 311 layer_on(_ALT);
229 } 312 }
230 } 313 }
231 return false; 314 return false;
315 case SYS_LAYER:
316 if (record->event.pressed) {
317 if (sysToggled) {
318 rgbToggled = false;
319 altToggled = false;
320 sysToggled = false;
321 oled_clear();
322 layer_clear();
323 } else {
324 rgbToggled = false;
325 sysToggled = true;
326 altToggled = false;
327 layer_on(_SYS);
328 }
329 }
232 default: 330 default:
233 return true; 331 return true;
234 } 332 }
235 return false; 333 return false;
236} 334};
diff --git a/keyboards/dekunukem/duckypad/keymaps/m4cs/readme.md b/keyboards/dekunukem/duckypad/keymaps/m4cs/readme.md
index 42fae0044..50c06cf42 100644
--- a/keyboards/dekunukem/duckypad/keymaps/m4cs/readme.md
+++ b/keyboards/dekunukem/duckypad/keymaps/m4cs/readme.md
@@ -16,10 +16,12 @@ To change the menu, edit the `MT_X_XX` values in `config.h`. The sytax is as fol
16 16
17The macros currently just map to Ctrl + Alt + (Different Keys) right now. I have them launching certain shortcuts. I recommend you change these and add your shortcuts to match your shortcut manager. 17The macros currently just map to Ctrl + Alt + (Different Keys) right now. I have them launching certain shortcuts. I recommend you change these and add your shortcuts to match your shortcut manager.
18 18
19To get sysinfo working, run `pip3 install psutil GPUtil` and then `python sysinfo.py`. Now when pressing the bottom right key, you will get an info screen with your updated system info.
20
19### Need Help? 21### Need Help?
20 22
21Contact me on discord: macs#0420 23Contact me on discord: macs#0420
22 24
23or join the duckyPad Discord and find me in there :) 25or join the duckyPad Discord and find me in there :)
24 26
25https://discord.gg/ADtrCjf \ No newline at end of file 27https://discord.gg/ADtrCjf
diff --git a/keyboards/dekunukem/duckypad/keymaps/m4cs/sysinfo.py b/keyboards/dekunukem/duckypad/keymaps/m4cs/sysinfo.py
new file mode 100644
index 000000000..04cf343ea
--- /dev/null
+++ b/keyboards/dekunukem/duckypad/keymaps/m4cs/sysinfo.py
@@ -0,0 +1,78 @@
1
2###
3# M4cs Keymap for dekuNukem/duckyPad QMK firmware
4
5# Copyright (C) 2020 Max Bridgland
6
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19###
20
21
22import hid
23import time
24import string
25import psutil
26import GPUtil
27import datetime
28
29vendor_id = 0x444E
30product_id = 0x4450
31
32usage_page = 0xFF60
33usage = 0x61
34
35device_interfaces = hid.enumerate(vendor_id, product_id)
36raw_hid_interfaces = [i for i in device_interfaces if i['usage_page'] == usage_page and i['usage'] == usage]
37
38if len(raw_hid_interfaces) == 0:
39 print('Couldnt find any interfaces')
40 exit()
41
42interface = hid.device()
43interface.open_path(raw_hid_interfaces[0]['path'])
44print("Manufacturer: %s" % interface.get_manufacturer_string())
45print("Product: %s" % interface.get_product_string())
46time.sleep(0.05)
47while True:
48 time.sleep(0.75)
49 cpufreq = psutil.cpu_freq()
50 currFreq = int(cpufreq.current)
51 svmem = psutil.virtual_memory()
52 memPerc = int(svmem.percent * 10)
53 gpus = GPUtil.getGPUs()
54 gpu = gpus[0]
55 load = int(gpu.load*100)
56 temp = int(gpu.temperature)
57 data = [0]
58 for x in str(currFreq):
59 data.append(int(x))
60 data.append(13)
61 for x in str(memPerc):
62 data.append(int(x))
63 data.append(13)
64 for x in str(load):
65 data.append(int(x))
66 data.append(13)
67 for x in str(temp):
68 data.append(int(x))
69 data.append(13)
70 now_hour = datetime.datetime.now().strftime("%I")
71 now_min = datetime.datetime.now().strftime("%M")
72 data.append(int(now_hour[0]))
73 data.append(int(now_hour[1]))
74 data.append(13)
75 data.append(int(now_min[0]))
76 data.append(int(now_min[1]))
77 data.append(13)
78 interface.write(data)
diff --git a/keyboards/dekunukem/duckypad/keymaps/via/keymap.c b/keyboards/dekunukem/duckypad/keymaps/via/keymap.c
new file mode 100644
index 000000000..5d11b6d6c
--- /dev/null
+++ b/keyboards/dekunukem/duckypad/keymaps/via/keymap.c
@@ -0,0 +1,73 @@
1/*
2
3Via Keymap for dekuNukem/duckyPad QMK firmware
4
5Copyright (C) 2020 Max Bridgland
6
7This program is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 3 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#include QMK_KEYBOARD_H
22
23#define LOGO_SIZE 384
24
25
26const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
27 LAYOUT(
28 KC_KP_1, KC_KP_2, KC_KP_3,
29 KC_KP_4, KC_KP_5, KC_KP_6,
30 KC_KP_7, KC_KP_8, KC_KP_9,
31 KC_TRNS, KC_KP_0, KC_TRNS,
32 KC_TRNS, KC_TRNS, KC_TRNS,
33 KC_TRNS, KC_TRNS
34 ),
35 LAYOUT(
36 KC_TRNS, KC_TRNS, KC_TRNS,
37 KC_TRNS, KC_TRNS, KC_TRNS,
38 KC_TRNS, KC_TRNS, KC_TRNS,
39 KC_TRNS, KC_TRNS, KC_TRNS,
40 KC_TRNS, KC_TRNS, KC_TRNS,
41 KC_TRNS, KC_TRNS
42 ),
43 LAYOUT(
44 KC_TRNS, KC_TRNS, KC_TRNS,
45 KC_TRNS, KC_TRNS, KC_TRNS,
46 KC_TRNS, KC_TRNS, KC_TRNS,
47 KC_TRNS, KC_TRNS, KC_TRNS,
48 KC_TRNS, KC_TRNS, KC_TRNS,
49 KC_TRNS, KC_TRNS
50 ),
51 LAYOUT(
52 KC_TRNS, KC_TRNS, KC_TRNS,
53 KC_TRNS, KC_TRNS, KC_TRNS,
54 KC_TRNS, KC_TRNS, KC_TRNS,
55 KC_TRNS, KC_TRNS, KC_TRNS,
56 KC_TRNS, KC_TRNS, KC_TRNS,
57 KC_TRNS, KC_TRNS
58 ),
59};
60
61static void render_logo(void) {
62 static const char PROGMEM ducky_logo[LOGO_SIZE] = {
63 0, 0, 0, 0,128,128,128,128,128, 0, 0,252,252,252, 0, 0, 0,128,128,128, 0, 0, 0, 0, 0,128,128,128, 0, 0, 0, 0, 0,128,128,128,128,128, 0, 0, 0, 0, 0,252,252,252, 0, 0, 0, 0, 0,128,128,128,128,128,128, 0, 0, 0, 0, 0, 0,128,128,128,128, 0,248,248,248, 56, 56, 56, 56, 56, 56,120,240,224,192, 0, 0,128,128,128,128,128,128, 0, 0, 0, 0, 0, 0, 0, 0,128,128,128,128,128, 0, 0,252,252,252, 0, 0, 0, 0, 0,232, 24, 24,232, 0, 24, 48, 48, 24, 0,232, 24, 24,232, 0, 0,
64 0,248,254,255,143, 7, 3, 3, 3, 7,142,255,255,255, 0, 0, 0,255,255,255, 0, 0, 0, 0, 0,255,255,255, 0,248,254,255,143, 7, 3, 3, 3, 3,143, 7, 2, 0, 0,255,255,255,240,120,252,254,231,131, 1, 0, 1, 7, 63,254,240,192, 0,224,252,127, 31, 3, 0, 0,255,255,255,112,112,112,112,112,112, 56, 63, 31, 15,193,231,243,115, 51, 51, 51, 55,255,255,252, 0, 0,248,254,255,143, 7, 3, 3, 3, 7,142,255,255,255, 0, 0, 0, 0, 0, 21,127,127,252,252,252,253,253,252,252,252,255,255,255, 0, 0,
65 0, 0, 3, 7, 15, 15, 14, 14, 14, 7, 3, 15, 15, 15, 0, 0, 0, 3, 7, 15, 15, 14, 14, 6, 3, 15, 15, 15, 0, 0, 3, 7, 7, 15, 14, 14, 14, 14, 7, 7, 2, 0, 0, 15, 15, 15, 0, 0, 0, 1, 3, 15, 15, 12,136,224,224,224,247,127,127, 31, 3, 0, 0, 0, 0, 0, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 15, 14, 14, 14, 6, 3, 15, 15, 15, 0, 0, 0, 3, 7, 15, 15, 14, 14, 14, 7, 3, 15, 15, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 7, 11, 3, 11, 7, 11, 7, 7, 31, 0, 0
66 };
67 oled_write_raw_P(ducky_logo, LOGO_SIZE);
68}
69
70void oled_task_user(void) {
71 render_logo();
72}
73
diff --git a/keyboards/dekunukem/duckypad/keymaps/via/rules.mk b/keyboards/dekunukem/duckypad/keymaps/via/rules.mk
new file mode 100644
index 000000000..5085d50a0
--- /dev/null
+++ b/keyboards/dekunukem/duckypad/keymaps/via/rules.mk
@@ -0,0 +1,3 @@
1VIA_ENABLE = yes
2RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
3RGB_MATRIX_ENABLE = no