705515791547ff3b63a0edc29e8ea1f3142ae20c
- Author
- Pavle Portic <pavle.portic@tilda.center>
- Committer
- Pavle Portic <pavle.portic@tilda.center>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/keyboards/ergodox_infinity/config.h b/keyboards/ergodox_infinity/config.h
2index a64f3f4a13946de024ce00d8c818e07c9f7c27ab..54174ed7d7786b1e7cc052d48120b47e8aedb76f 100644
3--- a/keyboards/ergodox_infinity/config.h
4+++ b/keyboards/ergodox_infinity/config.h
5@@ -71,7 +71,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
6 #define SERIAL_LINK_BAUD 562500
7 #define SERIAL_LINK_THREAD_PRIORITY (NORMALPRIO - 1)
8
9-#define VISUALIZER_USER_DATA_SIZE 16
10+#define VISUALIZER_USER_DATA_SIZE 32
11+
12 /*
13 * Feature disable options
14 * These options are also useful to firmware size reduction.
15diff --git a/keyboards/ergodox_infinity/ergodox_infinity.h b/keyboards/ergodox_infinity/ergodox_infinity.h
16index 79f01b1849a7163de1856a552625c8016ed9a4b9..48f775c8402f31c7c31a610088bc2f5d3044deff 100644
17--- a/keyboards/ergodox_infinity/ergodox_infinity.h
18+++ b/keyboards/ergodox_infinity/ergodox_infinity.h
19@@ -80,6 +80,18 @@ inline void ergodox_led_all_set(uint8_t n) {
20 ergodox_right_led_3_set(n);
21 }
22
23+// Calculator functions
24+void ergodox_calc_init(void);
25+void ergodox_calc_append_number(uint8_t n);
26+void ergodox_calc_push(void);
27+void ergodox_calc_pop(void);
28+void ergodox_calc_dot(void);
29+void ergodox_calc_add(void);
30+void ergodox_calc_sub(void);
31+void ergodox_calc_mul(void);
32+void ergodox_calc_div(void);
33+void ergodox_calc_sqrt(void);
34+
35 /*
36 * LEFT HAND: LINES 88-95
37 * RIGHT HAND: LINES 97-104
38diff --git a/keyboards/ergodox_infinity/gfxconf.h b/keyboards/ergodox_infinity/gfxconf.h
39index ca338399d31b02cd78a908410dec89bd6d161863..933fef351f4e3b90355ee49c51ca14cbf8015c5b 100644
40--- a/keyboards/ergodox_infinity/gfxconf.h
41+++ b/keyboards/ergodox_infinity/gfxconf.h
42@@ -22,6 +22,314 @@
43 #ifndef _GFXCONF_H
44 #define _GFXCONF_H
45
46+// <<<<<<< HEAD
47+
48+// ///////////////////////////////////////////////////////////////////////////
49+// // GOS - One of these must be defined, preferably in your Makefile //
50+// ///////////////////////////////////////////////////////////////////////////
51+// //#define GFX_USE_OS_CHIBIOS TRUE
52+// //#define GFX_USE_OS_FREERTOS FALSE
53+// // #define GFX_FREERTOS_USE_TRACE FALSE
54+// //#define GFX_USE_OS_WIN32 FALSE
55+// //#define GFX_USE_OS_LINUX FALSE
56+// //#define GFX_USE_OS_OSX FALSE
57+// //#define GFX_USE_OS_ECOS FALSE
58+// //#define GFX_USE_OS_RAWRTOS FALSE
59+// //#define GFX_USE_OS_ARDUINO FALSE
60+// //#define GFX_USE_OS_KEIL FALSE
61+// //#define GFX_USE_OS_CMSIS FALSE
62+// //#define GFX_USE_OS_RAW32 FALSE
63+// // #define INTERRUPTS_OFF() optional_code
64+// // #define INTERRUPTS_ON() optional_code
65+// // These are not defined by default for some reason
66+// #define GOS_NEED_X_THREADS FALSE
67+// #define GOS_NEED_X_HEAP FALSE
68+
69+// // Options that (should where relevant) apply to all operating systems
70+ // #define GFX_NO_INLINE FALSE
71+// // #define GFX_COMPILER GFX_COMPILER_UNKNOWN
72+// // #define GFX_CPU GFX_CPU_UNKNOWN
73+// // #define GFX_OS_HEAP_SIZE 0
74+// // #define GFX_OS_NO_INIT FALSE
75+// // #define GFX_OS_INIT_NO_WARNING FALSE
76+// // #define GFX_OS_PRE_INIT_FUNCTION myHardwareInitRoutine
77+// // #define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRoutine
78+// // #define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitRoutine
79+
80+
81+// ///////////////////////////////////////////////////////////////////////////
82+// // GDISP //
83+// ///////////////////////////////////////////////////////////////////////////
84+// #define GFX_USE_GDISP TRUE
85+
86+// //#define GDISP_NEED_AUTOFLUSH FALSE
87+// //#define GDISP_NEED_TIMERFLUSH FALSE
88+// //#define GDISP_NEED_VALIDATION TRUE
89+// //#define GDISP_NEED_CLIP TRUE
90+// #define GDISP_NEED_CIRCLE TRUE
91+// #define GDISP_NEED_ELLIPSE TRUE
92+// #define GDISP_NEED_ARC TRUE
93+// #define GDISP_NEED_ARCSECTORS TRUE
94+// #define GDISP_NEED_CONVEX_POLYGON TRUE
95+// //#define GDISP_NEED_SCROLL FALSE
96+// #define GDISP_NEED_PIXELREAD TRUE
97+// #define GDISP_NEED_CONTROL TRUE
98+// //#define GDISP_NEED_QUERY FALSE
99+// //#define GDISP_NEED_MULTITHREAD FALSE
100+// //#define GDISP_NEED_STREAMING FALSE
101+// #define GDISP_NEED_TEXT TRUE
102+// // #define GDISP_NEED_TEXT_WORDWRAP FALSE
103+// // #define GDISP_NEED_ANTIALIAS FALSE
104+// // #define GDISP_NEED_UTF8 FALSE
105+ // #define GDISP_NEED_TEXT_KERNING TRUE
106+// // #define GDISP_INCLUDE_FONT_UI1 FALSE
107+// // #define GDISP_INCLUDE_FONT_UI2 FALSE // The smallest preferred font.
108+// // #define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE
109+// // #define GDISP_INCLUDE_FONT_DEJAVUSANS10 FALSE
110+// // #define GDISP_INCLUDE_FONT_DEJAVUSANS12 FALSE
111+// // #define GDISP_INCLUDE_FONT_DEJAVUSANS16 FALSE
112+// // #define GDISP_INCLUDE_FONT_DEJAVUSANS20 FALSE
113+// // #define GDISP_INCLUDE_FONT_DEJAVUSANS24 FALSE
114+// // #define GDISP_INCLUDE_FONT_DEJAVUSANS32 FALSE
115+ // #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12 TRUE
116+// // #define GDISP_INCLUDE_FONT_FIXED_10X20 FALSE
117+ // #define GDISP_INCLUDE_FONT_FIXED_7X14 TRUE
118+ // #define GDISP_INCLUDE_FONT_FIXED_5X8 TRUE
119+// // #define GDISP_INCLUDE_FONT_DEJAVUSANS12_AA FALSE
120+// // #define GDISP_INCLUDE_FONT_DEJAVUSANS16_AA FALSE
121+// // #define GDISP_INCLUDE_FONT_DEJAVUSANS20_AA FALSE
122+// // #define GDISP_INCLUDE_FONT_DEJAVUSANS24_AA FALSE
123+// // #define GDISP_INCLUDE_FONT_DEJAVUSANS32_AA FALSE
124+// // #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA FALSE
125+// // #define GDISP_INCLUDE_USER_FONTS FALSE
126+
127+// //#define GDISP_NEED_IMAGE FALSE
128+// // #define GDISP_NEED_IMAGE_NATIVE FALSE
129+// // #define GDISP_NEED_IMAGE_GIF FALSE
130+// // #define GDISP_NEED_IMAGE_BMP FALSE
131+// // #define GDISP_NEED_IMAGE_BMP_1 FALSE
132+// // #define GDISP_NEED_IMAGE_BMP_4 FALSE
133+// // #define GDISP_NEED_IMAGE_BMP_4_RLE FALSE
134+// // #define GDISP_NEED_IMAGE_BMP_8 FALSE
135+// // #define GDISP_NEED_IMAGE_BMP_8_RLE FALSE
136+// // #define GDISP_NEED_IMAGE_BMP_16 FALSE
137+// // #define GDISP_NEED_IMAGE_BMP_24 FALSE
138+// // #define GDISP_NEED_IMAGE_BMP_32 FALSE
139+// // #define GDISP_NEED_IMAGE_JPG FALSE
140+// // #define GDISP_NEED_IMAGE_PNG FALSE
141+// // #define GDISP_NEED_IMAGE_ACCOUNTING FALSE
142diff --git a/keyboards/ergodox_infinity/keymaps/raging/keymap.c b/keyboards/ergodox_infinity/keymaps/raging/keymap.c
143new file mode 100644
144index 0000000000000000000000000000000000000000..cbca77a9ed81f7fd3b427566026896959be80635
145--- /dev/null
146+++ b/keyboards/ergodox_infinity/keymaps/raging/keymap.c
147@@ -0,0 +1,183 @@
148+#include QMK_KEYBOARD_H
149+/* #include "debug.h" */
150+/* #include "action_layer.h" */
151+/* #include "version.h" */
152+
153+#define BASE 0 // default layer
154+#define QWER 1 // qwerty layout
155+#define FN 2 // function
156+#define NUM 3 // numpad
157+
158+#define _____ KC_TRNS
159+#define XXXXX KC_NO
160+
161+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
162+ /* Keymap 0: Base Colemak layer
163+ *
164+ * ,--------------------------------------------------. ,--------------------------------------------------.
165+ * | ` | 1 | 2 | 3 | 4 | 5 | = | | = | 6 | 7 | 8 | 9 | 0 | - |
166+ * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
167+ * | Del | Q | W | F | P | G | ( | | [ | J | L | U | Y | ; | ' |
168+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
169+ * |Esc/Ctrl| A | R | S | T | D |------| |------| H | N | E | I | O | Enter |
170+ * |--------+------+------+------+------+------| ) | | ] |------+------+------+------+------+--------|
171+ * | LShift | Z | X | C | V | B | | | | K | M | , | . | \ | RShift |
172+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
173+ * | | | | LAlt | LMeta| | / | | | | |
174+ * `----------------------------------' ,-------------. ,-------------. `----------------------------------'
175+ * | Esc | SLck | | | NUM |
176+ * ,------|------|------| |------+------+------.
177+ * | | | QWER | | QWER | | |
178+ * | Space| FN |------| |------| FN | Enter|
179+ * | | | Caps | | PScr | | |
180+ * `--------------------' `--------------------'
181+ */
182+ [BASE] = KEYMAP(
183+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL,
184+ KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_LPRN,
185+ KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D,
186+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_RPRN,
187+ XXXXX, XXXXX, XXXXX, KC_LALT, KC_LGUI,
188+ KC_ESC, KC_SLCK,
189+ TG(QWER),
190+ KC_SPC, MO(FN), KC_CAPS,
191+
192+ KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
193+ KC_LBRC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_QUOT,
194+ KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT,
195+ KC_RBRC, KC_K, KC_M, KC_COMM, KC_DOT, KC_BSLS, KC_RSFT,
196+ KC_SLSH, XXXXX, XXXXX, XXXXX, XXXXX,
197+ XXXXX, TG(NUM),
198+ TG(QWER),
199+ KC_PSCR, MO(FN), KC_BSPC
200+ ),
201+
202+ /* Keymap 1: QWERTY Layer
203+ *
204+ * ,--------------------------------------------------. ,--------------------------------------------------.
205+ * | ` | 1 | 2 | 3 | 4 | 5 | = | | = | 6 | 7 | 8 | 9 | 0 | - |
206+ * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
207+ * | Del | Q | W | E | R | T | ( | | [ | Y | U | I | O | P | ' |
208+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
209+ * |Esc/Ctrl| A | S | D | F | G |------| |------| H | J | K | L | ; | Enter |
210+ * |--------+------+------+------+------+------| ) | | ] |------+------+------+------+------+--------|
211+ * | LShift | Z | X | C | V | B | | | | N | M | , | . | \ | RShift |
212+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
213+ * | | | | | Space| | / | | | | |
214+ * `----------------------------------' ,-------------. ,-------------. `----------------------------------'
215+ * | Esc | SLck | | | NUM |
216+ * ,------|------|------| |------+------+------.
217+ * | | | QWER | | QWER | | |
218+ * | Space| LAlt |------| |------| FN | Enter|
219+ * | | | Caps | | Pscr | | |
220+ * `--------------------' `--------------------'
221+ */
222+ [QWER] = KEYMAP(
223+ _____, _____, _____, _____, _____, _____, _____,
224+ _____, KC_Q, KC_W, KC_E, KC_R, KC_T, _____,
225+ _____, KC_A, KC_S, KC_D, KC_F, KC_G,
226+ _____, KC_Z, KC_X, KC_C, KC_V, KC_B, _____,
227+ _____, _____, _____, _____, KC_SPC,
228+ _____, _____,
229+ _____,
230+ _____, _____, _____,
231+
232+ _____, _____, _____, _____, _____, _____, _____,
233+ _____, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT,
234+ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
235+ _____, KC_N, KC_M, _____, _____, _____, _____,
236+ KC_SLSH, _____, _____, _____, _____,
237+ _____, _____,
238+ _____,
239+ _____, _____, _____
240+ ),
241+
242+ /* Keymap 2: Function Layer
243+ *
244+ * ,--------------------------------------------------. ,--------------------------------------------------.
245+ * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | |
246+ * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
247diff --git a/keyboards/ergodox_infinity/keymaps/raging/readme.md b/keyboards/ergodox_infinity/keymaps/raging/readme.md
248new file mode 100644
249index 0000000000000000000000000000000000000000..e28b2f085615ab28d7f99a3e54b454afa9ce7125
250--- /dev/null
251+++ b/keyboards/ergodox_infinity/keymaps/raging/readme.md
252@@ -0,0 +1,4 @@
253+# ErgoDox EZ Colemak Configuration
254+
255+Colemak layout with same layers as default ergodox ez keymap.
256+
257diff --git a/keyboards/ergodox_infinity/keymaps/raging/rules.mk b/keyboards/ergodox_infinity/keymaps/raging/rules.mk
258new file mode 100644
259index 0000000000000000000000000000000000000000..5f20f1e6d24c055d81f19b7c3689347b7b2057ba
260--- /dev/null
261+++ b/keyboards/ergodox_infinity/keymaps/raging/rules.mk
262@@ -0,0 +1,14 @@
263+#
264+# rules.mk
265+# pavle, 2017-03-24 15:39
266+#
267+BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
268+MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
269+EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
270+CONSOLE_ENABLE ?= no # Console for debug(+400)
271+COMMAND_ENABLE ?= no # Commands for debug and configuration
272+CUSTOM_MATRIX ?= no # Custom matrix file for the ErgoDox EZ
273+SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
274+NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
275+UNICODE_ENABLE ?= yes # Unicode
276+ONEHAND_ENABLE ?= no # Allow swapping hands of keyboard
277diff --git a/keyboards/ergodox_infinity/visualizer.c b/keyboards/ergodox_infinity/visualizer.c
278index 4b16021abcd9da4a013452d23a8579fc25c0f767..d925b0cb4e2065d694bedecebb55dea48b93a94d 100644
279--- a/keyboards/ergodox_infinity/visualizer.c
280+++ b/keyboards/ergodox_infinity/visualizer.c
281@@ -33,15 +33,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
282 #include "system/serial_link.h"
283 #include "default_animations.h"
284
285+#define STACK_SIZE 10
286+
287 static const uint32_t logo_background_color = LCD_COLOR(0x00, 0x00, 0xFF);
288 static const uint32_t initial_color = LCD_COLOR(0, 0, 0);
289
290-static const uint32_t led_emulation_colors[4] = {
291- LCD_COLOR(0, 0, 0),
292- LCD_COLOR(255, 255, 255),
293- LCD_COLOR(84, 255, 255),
294- LCD_COLOR(168, 255, 255),
295-};
296+/* static const uint32_t led_emulation_colors[4] = { */
297+ /* LCD_COLOR(0, 0, 0), */
298+ /* LCD_COLOR(255, 255, 255), */
299+ /* LCD_COLOR(84, 255, 255), */
300+ /* LCD_COLOR(168, 255, 255), */
301+/* }; */
302
303 static uint32_t next_led_target_color = 0;
304
305@@ -52,12 +54,19 @@ typedef enum {
306 } lcd_state_t;
307
308 static lcd_state_t lcd_state = LCD_STATE_INITIAL;
309+static double local_stack[STACK_SIZE];
310+static uint8_t sp;
311+static bool buffer_old = false;
312+static bool buffer_preserve = false;
313+static uint8_t exponent = 0;
314
315 typedef struct {
316 uint8_t led_on;
317 uint8_t led1;
318 uint8_t led2;
319 uint8_t led3;
320+ double buffer;
321+ double stack[2];
322 } visualizer_user_data_t;
323
324 // Don't access from visualization function, use the visualizer state instead
325@@ -66,6 +75,8 @@ static visualizer_user_data_t user_data_keyboard = {
326 .led1 = LED_BRIGHTNESS_HI,
327 .led2 = LED_BRIGHTNESS_HI,
328 .led3 = LED_BRIGHTNESS_HI,
329+ .buffer = 0,
330+ .stack = {0},
331 };
332
333 _Static_assert(sizeof(visualizer_user_data_t) <= VISUALIZER_USER_DATA_SIZE,
334@@ -75,12 +86,12 @@ _Static_assert(sizeof(visualizer_user_data_t) <= VISUALIZER_USER_DATA_SIZE,
335
336
337 // The color animation animates the LCD color when you change layers
338-static keyframe_animation_t one_led_color = {
339- .num_frames = 1,
340- .loop = false,
341- .frame_lengths = {gfxMillisecondsToTicks(0)},
342- .frame_functions = {lcd_backlight_keyframe_set_color},
343-};
344+/* static keyframe_animation_t one_led_color = { */
345+ /* .num_frames = 1, */
346+ /* .loop = false, */
347+ /* .frame_lengths = {gfxMillisecondsToTicks(0)}, */
348+ /* .frame_functions = {lcd_backlight_keyframe_set_color}, */
349+/* }; */
350
351 bool swap_led_target_color(keyframe_animation_t* animation, visualizer_state_t* state) {
352 uint32_t temp = next_led_target_color;
353@@ -90,174 +101,195 @@ bool swap_led_target_color(keyframe_animation_t* animation, visualizer_state_t*
354 }
355
356 // The color animation animates the LCD color when you change layers
357-static keyframe_animation_t two_led_colors = {
358- .num_frames = 2,
359- .loop = true,
360- .frame_lengths = {gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(0)},
361- .frame_functions = {lcd_backlight_keyframe_set_color, swap_led_target_color},
362-};
363+/* static keyframe_animation_t two_led_colors = { */
364+ /* .num_frames = 2, */
365+ /* .loop = true, */
366+ /* .frame_lengths = {gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(0)}, */
367+ /* .frame_functions = {lcd_backlight_keyframe_set_color, swap_led_target_color}, */
368+/* }; */
369
370 // The LCD animation alternates between the layer name display and a
371 // bitmap that displays all active layers
372-static keyframe_animation_t lcd_bitmap_animation = {
373+/* static keyframe_animation_t lcd_bitmap_animation = { */
374+ /* .num_frames = 1, */
375+ /* .loop = false, */
376+ /* .frame_lengths = {gfxMillisecondsToTicks(0)}, */
377+ /* .frame_functions = {lcd_keyframe_display_layer_bitmap}, */
378+/* }; */
379+
380+/* static keyframe_animation_t lcd_bitmap_leds_animation = { */
381diff --git a/quantum/visualizer/lcd_backlight.c b/quantum/visualizer/lcd_backlight.c
382index 6cd996f75e5f076d108a7631b20e7c62017eeba8..822d232ae32c70df0d0af8030ddfdc350965a4f5 100644
383--- a/quantum/visualizer/lcd_backlight.c
384+++ b/quantum/visualizer/lcd_backlight.c
385@@ -1,26 +1,26 @@
386 /*
387-The MIT License (MIT)
388+ The MIT License (MIT)
389
390-Copyright (c) 2016 Fred Sundvik
391+ Copyright (c) 2016 Fred Sundvik
392
393-Permission is hereby granted, free of charge, to any person obtaining a copy
394-of this software and associated documentation files (the "Software"), to deal
395-in the Software without restriction, including without limitation the rights
396-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
397-copies of the Software, and to permit persons to whom the Software is
398-furnished to do so, subject to the following conditions:
399+ Permission is hereby granted, free of charge, to any person obtaining a copy
400+ of this software and associated documentation files (the "Software"), to deal
401+ in the Software without restriction, including without limitation the rights
402+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
403+ copies of the Software, and to permit persons to whom the Software is
404+ furnished to do so, subject to the following conditions:
405
406-The above copyright notice and this permission notice shall be included in all
407-copies or substantial portions of the Software.
408+ The above copyright notice and this permission notice shall be included in all
409+ copies or substantial portions of the Software.
410
411-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
412-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
413-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
414-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
415-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
416-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
417-SOFTWARE.
418-*/
419+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
420+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
421+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
422+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
423+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
424+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
425+ SOFTWARE.
426+ */
427
428 #include "lcd_backlight.h"
429 #include <math.h>
430@@ -73,10 +73,10 @@ void lcd_backlight_color(uint8_t hue, uint8_t saturation, uint8_t intensity) {
431 float intensity_f = (float)intensity / 255.0f;
432 intensity_f *= (float)current_brightness / 255.0f;
433 hsi_to_rgb(hue_f, saturation_f, intensity_f, &r, &g, &b);
434- current_hue = hue;
435- current_saturation = saturation;
436- current_intensity = intensity;
437- lcd_backlight_hal_color(r, g, b);
438+ current_hue = hue;
439+ current_saturation = saturation;
440+ current_intensity = intensity;
441+ lcd_backlight_hal_color(r, g, b);
442 }
443
444 void lcd_backlight_brightness(uint8_t b) {
445diff --git a/quantum/visualizer/lcd_keyframes.c b/quantum/visualizer/lcd_keyframes.c
446index 75eb457001c321f65bd799ea292e8c5655c389a2..a4a9e6c24e91f358b51f9122dd03bb7561e4750c 100644
447--- a/quantum/visualizer/lcd_keyframes.c
448+++ b/quantum/visualizer/lcd_keyframes.c
449@@ -16,6 +16,7 @@
450
451 #include "lcd_keyframes.h"
452 #include <string.h>
453+#include <math.h>
454 #include "action_util.h"
455 #include "led.h"
456 #include "resources/resources.h"
457@@ -109,24 +110,24 @@ static void get_led_state_string(char* output, visualizer_state_t* state) {
458 uint8_t pos = 0;
459
460 if (state->status.leds & (1u << USB_LED_NUM_LOCK)) {
461- memcpy(output + pos, "NUM ", 4);
462- pos += 4;
463+ memcpy(output + pos, "NUM ", 4);
464+ pos += 4;
465 }
466 if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) {
467- memcpy(output + pos, "CAPS ", 5);
468- pos += 5;
469+ memcpy(output + pos, "CAPS ", 5);
470+ pos += 5;
471 }
472 if (state->status.leds & (1u << USB_LED_SCROLL_LOCK)) {
473- memcpy(output + pos, "SCRL ", 5);
474- pos += 5;
475+ memcpy(output + pos, "SCRL ", 5);
476+ pos += 5;
477 }
478 if (state->status.leds & (1u << USB_LED_COMPOSE)) {
479- memcpy(output + pos, "COMP ", 5);
480- pos += 5;
481+ memcpy(output + pos, "COMP ", 5);
482+ pos += 5;
483 }
484 if (state->status.leds & (1u << USB_LED_KANA)) {
485- memcpy(output + pos, "KANA", 4);
486- pos += 4;
487+ memcpy(output + pos, "KANA", 4);
488+ pos += 4;
489 }
490 output[pos] = 0;
491 }
492@@ -186,3 +187,81 @@ bool lcd_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* st
493 gdispSetPowerMode(powerOn);
494 return false;
495 }
496+
497+static void format_double_bitmap_string(double n, char* buffer) {
498+ char *save = buffer; // Save pointer to the beginning of the string
499+ bool neg = false;
500+ if (n < 0) { // If number is negative, make it positive
501+ n *= -1;
502+ neg = true;
503+ }
504+
505+ uint64_t i = roundf(n * 10000); // Round to a maximum of 4 decimal places
506+ uint64_t f = i % 10000; // Save frraction to separate variable
507+ bool frac = false; // Save if the fraction was 0
508+ if (f != 0)
509+ frac = true;
510+ i /= 10000;
511+
512+ while (( (f % 10) == 0) && frac) { // Skip trailing zeros in fraction
513+ f /= 10;
514+ }
515+ while (f != 0) { // Loop through fraction and add digits to the buffer
516+ *buffer = (f % 10) + '0';
517+ ++buffer;
518+ f /= 10;
519+ }
520+ if (frac && i == 0) { // Add '.0' if the integer is 0
521+ *buffer = '.';
522+ ++buffer;
523+ *buffer = '0';
524+ ++buffer;
525+ } else if (frac) { // Add decimal point if the integer is not 0
526+ *buffer = '.';
527+ ++buffer;
528+ } else if (i == 0) { // If the fraction and integer are 0 write a 0 to the buffer and return
529+ *buffer = '0';
530+ ++buffer;
531+ *buffer = 0;
532+ return;
533+ }
534+ while (i != 0) { // Loop through the integer and add digits to the buffer
535+ *buffer = (i % 10) + '0';
536+ ++buffer;
537+ i /= 10;
538+ }
539+ if (neg) { // If the number was negative add a '-'
540+ *buffer = '-';
541+ ++buffer;
542+ }
543+ *buffer = 0;
544+ --buffer;
545+
546+ while (save < buffer) { // Reverse number string
547+ char tmp = *buffer;
548+ *buffer = *save;
549diff --git a/quantum/visualizer/lcd_keyframes.h b/quantum/visualizer/lcd_keyframes.h
550index 2e912b4c73d27ee703ee053a8e046331ffcec801..233222897dffb5fda5ce818b213d136d9fed0212 100644
551--- a/quantum/visualizer/lcd_keyframes.h
552+++ b/quantum/visualizer/lcd_keyframes.h
553@@ -35,5 +35,7 @@ bool lcd_keyframe_draw_logo(keyframe_animation_t* animation, visualizer_state_t*
554 bool lcd_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
555 bool lcd_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);
556
557+bool lcd_keyframe_display_rpn_stack(keyframe_animation_t* animation, visualizer_state_t* state);
558+
559
560 #endif /* QUANTUM_VISUALIZER_LCD_KEYFRAMES_H_ */
561diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c
562index 5b4d8d603ec6b332eb76d7bce176a5d9201d3701..9d4180c11856436353ea72003ed1201ec9644bf0 100644
563--- a/quantum/visualizer/visualizer.c
564+++ b/quantum/visualizer/visualizer.c
565@@ -66,7 +66,13 @@ static visualizer_keyboard_status_t current_status = {
566 .mods = 0xFF,
567 .suspended = false,
568 #ifdef VISUALIZER_USER_DATA_SIZE
569- .user_data = {0}
570+ .user_data.led_on = 0,
571+ .user_data.led1 = 0,
572+ .user_data.led2 = 0,
573+ .user_data.led3 = 0,
574+ .user_data.buffer = 0,
575+ .user_data.stack[0] = 0,
576+ .user_data.stack[1] = 0,
577 #endif
578 };
579
580@@ -80,7 +86,7 @@ static bool same_status(visualizer_keyboard_status_t* status1, visualizer_keyboa
581 && status1->backlight_level == status2->backlight_level
582 #endif
583 #ifdef VISUALIZER_USER_DATA_SIZE
584- && memcmp(status1->user_data, status2->user_data, VISUALIZER_USER_DATA_SIZE) == 0
585+ && memcmp(&status1->user_data, &status2->user_data, VISUALIZER_USER_DATA_SIZE) == 0
586 #endif
587 ;
588 }
589@@ -256,12 +262,18 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
590 .mods = 0xFF,
591 .leds = 0xFFFFFFFF,
592 .suspended = false,
593- #ifdef BACKLIGHT_ENABLE
594- .backlight_level = 0,
595- #endif
596- #ifdef VISUALIZER_USER_DATA_SIZE
597- .user_data = {0},
598- #endif
599+ #ifdef VISUALIZER_USER_DATA_SIZE
600+ .user_data.led_on = 0,
601+ .user_data.led1 = 0,
602+ .user_data.led2 = 0,
603+ .user_data.led3 = 0,
604+ .user_data.buffer = 0,
605+ .user_data.stack[0] = 0,
606+ .user_data.stack[1] = 0,
607+ #endif
608+ #ifdef BACKLIGHT_ENABLE
609+ .backlight_level = 0,
610+ #endif
611 };
612
613 visualizer_state_t state = {
614@@ -269,6 +281,7 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
615 .current_lcd_color = 0,
616 #ifdef LCD_ENABLE
617 .font_fixed5x8 = gdispOpenFont("fixed_5x8"),
618+ .font_fixed7x14 = gdispOpenFont("fixed_7x14"),
619 .font_dejavusansbold12 = gdispOpenFont("DejaVuSansBold12")
620 #endif
621 };
622@@ -437,13 +450,13 @@ uint8_t visualizer_get_mods() {
623 if (!has_oneshot_mods_timed_out()) {
624 mods |= get_oneshot_mods();
625 }
626-#endif
627+#endif
628 return mods;
629 }
630
631 #ifdef VISUALIZER_USER_DATA_SIZE
632 void visualizer_set_user_data(void* u) {
633- memcpy(user_data, u, VISUALIZER_USER_DATA_SIZE);
634+ memcpy(&user_data, u, VISUALIZER_USER_DATA_SIZE);
635 }
636 #endif
637
638@@ -479,7 +492,7 @@ void visualizer_update(uint32_t default_state, uint32_t state, uint8_t mods, uin
639 .suspended = current_status.suspended,
640 };
641 #ifdef VISUALIZER_USER_DATA_SIZE
642- memcpy(new_status.user_data, user_data, VISUALIZER_USER_DATA_SIZE);
643+ memcpy(&new_status.user_data, user_data, VISUALIZER_USER_DATA_SIZE);
644 #endif
645 if (!same_status(¤t_status, &new_status)) {
646 changed = true;
647diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h
648index 90ecdcbaea56c3e85d72d71d1c6813b0392bc460..a5bc7795692e52cfb36912b37148c536be2c37d1 100644
649--- a/quantum/visualizer/visualizer.h
650+++ b/quantum/visualizer/visualizer.h
651@@ -67,6 +67,15 @@ void draw_emulator(void);
652
653 struct keyframe_animation_t;
654
655+typedef struct {
656+ uint8_t led_on;
657+ uint8_t led1;
658+ uint8_t led2;
659+ uint8_t led3;
660+ double buffer;
661+ double stack[2];
662+} visualizer_keyboad_user_data_t;
663+
664 typedef struct {
665 uint32_t layer;
666 uint32_t default_layer;
667@@ -77,7 +86,7 @@ typedef struct {
668 uint8_t backlight_level;
669 #endif
670 #ifdef VISUALIZER_USER_DATA_SIZE
671- uint8_t user_data[VISUALIZER_USER_DATA_SIZE];
672+ visualizer_keyboad_user_data_t user_data;
673 #endif
674 } visualizer_keyboard_status_t;
675
676@@ -97,6 +106,7 @@ typedef struct visualizer_state_t {
677 uint32_t prev_lcd_color;
678 #ifdef LCD_ENABLE
679 font_t font_fixed5x8;
680+ font_t font_fixed7x14;
681 font_t font_dejavusansbold12;
682 #endif
683 } visualizer_state_t;
684diff --git a/readme.md b/readme.md
685index b08c675e4e8c7e28df05bfdeba0a4e4471eecf32..9f46a78f12ad87635232e451351d103dd558189c 100644
686--- a/readme.md
687+++ b/readme.md
688@@ -33,3 +33,10 @@ QMK is developed and maintained by Jack Humbert of OLKB with contributions from
689 ## Official Website
690
691 [qmk.fm](https://qmk.fm) is the official website of QMK, where you can find links to this page, the documentation, and the keyboards supported by QMK.
692+
693+## RPN calculator
694+
695diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
696index 11715cf3468ae0a63efda5c5ae1a3b9a4530780f..794fcb247c42f86cf86dd790acdb79144c26dfa9 100644
697--- a/tmk_core/chibios.mk
698+++ b/tmk_core/chibios.mk
699@@ -197,6 +197,8 @@ endif
700
701 DEBUG = gdb
702
703+SERIAL = "mk20dx256vlh7"
704+
705 DFU_ARGS ?=
706 ifneq ("$(SERIAL)","")
707 DFU_ARGS += -S $(SERIAL)