From a498f22a7ed0525aa87373a6bcd6968674531005 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 4 Apr 2023 20:20:58 +1000 Subject: [PATCH 1/9] Disable -Wtautological-compare to mitigate compilation problems. --- platforms/chibios/drivers/audio_dac_basic.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platforms/chibios/drivers/audio_dac_basic.c b/platforms/chibios/drivers/audio_dac_basic.c index 5f0cbf8f8418..4ea23a2158e7 100644 --- a/platforms/chibios/drivers/audio_dac_basic.c +++ b/platforms/chibios/drivers/audio_dac_basic.c @@ -19,6 +19,10 @@ #include "ch.h" #include "hal.h" +// Need to disable GCC's "tautological-compare" warning for this file, as it causes issues when running `KEEP_INTERMEDIATES=yes`. Corresponding pop at the end of the file. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wtautological-compare" + /* Audio Driver: DAC @@ -247,3 +251,5 @@ void audio_driver_start(void) { } gptStartContinuous(&AUDIO_STATE_TIMER, 2U); } + +#pragma GCC diagnostic pop From 44834ffd3393eccf1d6db6ef9e206a76a0c4e069 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 4 Apr 2023 20:32:31 +1000 Subject: [PATCH 2/9] Disable -Wmaybe-uninitialized to mitigate compilation problems. --- tmk_core/protocol/usb_hid/override_wiring.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tmk_core/protocol/usb_hid/override_wiring.c b/tmk_core/protocol/usb_hid/override_wiring.c index adc6645f8eb4..11c799231791 100644 --- a/tmk_core/protocol/usb_hid/override_wiring.c +++ b/tmk_core/protocol/usb_hid/override_wiring.c @@ -2,7 +2,13 @@ * To keep Timer0 for common/timer.c override arduino/wiring.c. */ #define __DELAY_BACKWARD_COMPATIBLE__ + +// Need to disable GCC's "maybe-uninitialized" warning for this file, as it causes issues when running `KEEP_INTERMEDIATES=yes`. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #include +#pragma GCC diagnostic pop + #include "platforms/timer.h" From cba6027d718032d873bef3a203056f3059078666 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 4 Apr 2023 20:40:25 +1000 Subject: [PATCH 3/9] Fix misc build. --- keyboards/hazel/bad_wings/keymaps/default/config.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/keyboards/hazel/bad_wings/keymaps/default/config.h b/keyboards/hazel/bad_wings/keymaps/default/config.h index bd395ec9e5d2..2d9e21274f6f 100644 --- a/keyboards/hazel/bad_wings/keymaps/default/config.h +++ b/keyboards/hazel/bad_wings/keymaps/default/config.h @@ -5,12 +5,11 @@ #define TAPPING_TERM 200 #define PERMISSIVE_HOLD -#define IGNORE_MOD_TAP_INTERRUPT #define TAPPING_FORCE_HOLD #define TAPPING_TERM_PER_KEY #define ONESHOT_TAP_TOGGLE 10 #define ONESHOT_TIMEOUT 500 #define DOUBLE_TAP_SHIFT_TURNS_ON_CAPS_WORD #define CIRQUE_PINNACLE_TAP_ENABLE -#define CIRQUE_PINNACLE_POSITION_MODE CIRQUE_PINNACLE_ABSOLUTE_MODE -#define CIRQUE_DEVICE_GESTURES_SCROLL_ENABLE \ No newline at end of file +#define CIRQUE_PINNACLE_POSITION_MODE CIRQUE_PINNACLE_ABSOLUTE_MODE +#define CIRQUE_DEVICE_GESTURES_SCROLL_ENABLE From 8a5a77a055a5161b4bf1716a92dbebe6d5e65a17 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 4 Apr 2023 20:48:34 +1000 Subject: [PATCH 4/9] Fix misc build. --- keyboards/mechlovin/mechlovin9/rev3/info.json | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/mechlovin/mechlovin9/rev3/info.json b/keyboards/mechlovin/mechlovin9/rev3/info.json index d5da28d3eddf..f5efcc1f6a9a 100644 --- a/keyboards/mechlovin/mechlovin9/rev3/info.json +++ b/keyboards/mechlovin/mechlovin9/rev3/info.json @@ -16,6 +16,7 @@ "rows": ["B12", "B13", "B14", "B15", "A1"], "cols": ["B11", "B10", "B2", "B1", "B0", "A6", "A5", "A4", "A3", "C13", "B7", "B6", "B5", "B4", "B3"] }, + "diode_direction": "COL2ROW", "indicators": { "caps_lock": "B9" } From 370e09d0cea51650328ccafa85d180169e599806 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 4 Apr 2023 20:50:55 +1000 Subject: [PATCH 5/9] Disable -Wtautological-compare to mitigate compilation problems. --- platforms/chibios/drivers/audio_dac_additive.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platforms/chibios/drivers/audio_dac_additive.c b/platforms/chibios/drivers/audio_dac_additive.c index 68ce13788ec4..d29147ca3b9e 100644 --- a/platforms/chibios/drivers/audio_dac_additive.c +++ b/platforms/chibios/drivers/audio_dac_additive.c @@ -19,6 +19,10 @@ #include #include +// Need to disable GCC's "tautological-compare" warning for this file, as it causes issues when running `KEEP_INTERMEDIATES=yes`. Corresponding pop at the end of the file. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wtautological-compare" + /* Audio Driver: DAC @@ -335,3 +339,5 @@ void audio_driver_start(void) { active_tones_snapshot_length = 0; state = OUTPUT_SHOULD_START; } + +#pragma GCC diagnostic pop From add42e42cbf8976c4025abe1a696c4d3ee249846 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 4 Apr 2023 20:56:50 +1000 Subject: [PATCH 6/9] Fix misc build. --- keyboards/splitkb/kyria/info.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/keyboards/splitkb/kyria/info.json b/keyboards/splitkb/kyria/info.json index 72490079629c..f70e8e3bb223 100644 --- a/keyboards/splitkb/kyria/info.json +++ b/keyboards/splitkb/kyria/info.json @@ -9,5 +9,8 @@ "development_board": "elite_c", "split": { "enabled": true + }, + "build": { + "lto": true } } From 2596ccd448f17715f25a23198b2aa5a418484127 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Wed, 5 Apr 2023 07:34:14 +1000 Subject: [PATCH 7/9] Hoist warning ignore to wait.h --- platforms/avr/_wait.h | 4 ++++ tmk_core/protocol/usb_hid/override_wiring.c | 7 ++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/platforms/avr/_wait.h b/platforms/avr/_wait.h index c1a598a428a8..39cbf618d213 100644 --- a/platforms/avr/_wait.h +++ b/platforms/avr/_wait.h @@ -15,7 +15,11 @@ */ #pragma once +// Need to disable GCC's "maybe-uninitialized" warning for this file, as it causes issues when running `KEEP_INTERMEDIATES=yes`. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #include +#pragma GCC diagnostic pop // http://ww1.microchip.com/downloads/en/devicedoc/atmel-0856-avr-instruction-set-manual.pdf // page 22: Table 4-2. Arithmetic and Logic Instructions diff --git a/tmk_core/protocol/usb_hid/override_wiring.c b/tmk_core/protocol/usb_hid/override_wiring.c index 11c799231791..159e549511ee 100644 --- a/tmk_core/protocol/usb_hid/override_wiring.c +++ b/tmk_core/protocol/usb_hid/override_wiring.c @@ -3,11 +3,7 @@ */ #define __DELAY_BACKWARD_COMPATIBLE__ -// Need to disable GCC's "maybe-uninitialized" warning for this file, as it causes issues when running `KEEP_INTERMEDIATES=yes`. -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" -#include -#pragma GCC diagnostic pop +#include #include "platforms/timer.h" @@ -32,3 +28,4 @@ void init(void) { timer_init(); } + \ No newline at end of file From b9b174d5916441faa3284cd11f81d20bc3a10769 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Wed, 5 Apr 2023 08:39:51 +1000 Subject: [PATCH 8/9] Remove added newlines. --- tmk_core/protocol/usb_hid/override_wiring.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tmk_core/protocol/usb_hid/override_wiring.c b/tmk_core/protocol/usb_hid/override_wiring.c index 159e549511ee..e61e699eb009 100644 --- a/tmk_core/protocol/usb_hid/override_wiring.c +++ b/tmk_core/protocol/usb_hid/override_wiring.c @@ -2,9 +2,7 @@ * To keep Timer0 for common/timer.c override arduino/wiring.c. */ #define __DELAY_BACKWARD_COMPATIBLE__ - #include - #include "platforms/timer.h" @@ -28,4 +26,3 @@ void init(void) { timer_init(); } - \ No newline at end of file From 44e05d066b35d3f25f7e2739d2e3fb69fe36b901 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Wed, 5 Apr 2023 14:06:47 +1000 Subject: [PATCH 9/9] Review comments. --- tmk_core/protocol/usb_hid/override_wiring.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tmk_core/protocol/usb_hid/override_wiring.c b/tmk_core/protocol/usb_hid/override_wiring.c index e61e699eb009..40bb574d7d6c 100644 --- a/tmk_core/protocol/usb_hid/override_wiring.c +++ b/tmk_core/protocol/usb_hid/override_wiring.c @@ -2,7 +2,7 @@ * To keep Timer0 for common/timer.c override arduino/wiring.c. */ #define __DELAY_BACKWARD_COMPATIBLE__ -#include +#include "wait.h" #include "platforms/timer.h" @@ -16,11 +16,11 @@ unsigned long micros(void) } void delay(unsigned long ms) { - _delay_ms(ms); + wait_ms(ms); } void delayMicroseconds(unsigned int us) { - _delay_us(us); + wait_us(us); } void init(void) {