diff options
author | Nick Brassel <nick@tzarc.org> | 2021-11-03 08:26:40 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-03 08:26:40 +1100 |
commit | 5da04fb45b0d5cddc6f49f88ea9c6a4037ef82ce (patch) | |
tree | 6fb7eafbbbef1278200421290659a13d208d7c31 /tmk_core | |
parent | 387edab52b1c1ab7585c4c1a11d997a6a90a505c (diff) | |
download | qmk_firmware-5da04fb45b0d5cddc6f49f88ea9c6a4037ef82ce.tar.gz qmk_firmware-5da04fb45b0d5cddc6f49f88ea9c6a4037ef82ce.zip |
Update to ChibiOS 20.3.4, support builds against trunk (#14208)
* Add support for building against ChibiOS svn/trunk.
* Swap to 21.6.x
* Update to latest branch revision as released version is broken.
* Updated configs.
* Conf updates.
* Updated ChibiOS
* Convert STM32L422 to actual L422 ChibiOS platform.
* Downgrade to 20.3.4 as ChibiOS 21.6.x is being aborted.
* Rollback L422-based boards.
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/chibios.mk | 24 | ||||
-rw-r--r-- | tmk_core/protocol/chibios/usb_main.c | 12 |
2 files changed, 30 insertions, 6 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index 957a25922..6b298732c 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk | |||
@@ -42,6 +42,11 @@ ifeq ($(strip $(MCU)), risc-v) | |||
42 | PLATFORM_MK = $(CHIBIOS_CONTRIB)/os/hal/ports/GD/GD32VF103/platform.mk | 42 | PLATFORM_MK = $(CHIBIOS_CONTRIB)/os/hal/ports/GD/GD32VF103/platform.mk |
43 | else | 43 | else |
44 | # ARM Support | 44 | # ARM Support |
45 | CHIBIOS_PORT ?= | ||
46 | ifeq ("$(CHIBIOS_PORT)","") | ||
47 | CHIBIOS_PORT = ARMv$(ARMV)-M | ||
48 | endif | ||
49 | |||
45 | # Startup files. Try a few different locations, for compability with old versions and | 50 | # Startup files. Try a few different locations, for compability with old versions and |
46 | # for things hardware in the contrib repository | 51 | # for things hardware in the contrib repository |
47 | STARTUP_MK = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_$(MCU_STARTUP).mk | 52 | STARTUP_MK = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_$(MCU_STARTUP).mk |
@@ -52,15 +57,24 @@ else | |||
52 | endif | 57 | endif |
53 | endif | 58 | endif |
54 | 59 | ||
55 | # Compability with old version | 60 | # Port files. Try a few different locations, for compability with old versions and |
56 | PORT_V = $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v$(ARMV)m.mk | 61 | # for things hardware in the contrib repository |
62 | PORT_V = $(CHIBIOS)/os/common/ports/$(CHIBIOS_PORT)/compilers/GCC/mk/port.mk | ||
57 | ifeq ("$(wildcard $(PORT_V))","") | 63 | ifeq ("$(wildcard $(PORT_V))","") |
58 | PORT_V = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v$(ARMV)m.mk | 64 | PORT_V = $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v$(ARMV)m.mk |
65 | ifeq ("$(wildcard $(PORT_V))","") | ||
66 | PORT_V = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v$(ARMV)m.mk | ||
67 | endif | ||
59 | endif | 68 | endif |
60 | 69 | ||
61 | RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC | 70 | # Rules location. Try a few different locations, for compability with old versions and |
71 | # for things hardware in the contrib repository | ||
72 | RULESPATH = $(CHIBIOS)/os/common/ports/$(CHIBIOS_PORT)/compilers/GCC | ||
62 | ifeq ("$(wildcard $(RULESPATH)/rules.mk)","") | 73 | ifeq ("$(wildcard $(RULESPATH)/rules.mk)","") |
63 | RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC | 74 | RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC |
75 | ifeq ("$(wildcard $(RULESPATH)/rules.mk)","") | ||
76 | RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC | ||
77 | endif | ||
64 | endif | 78 | endif |
65 | endif | 79 | endif |
66 | 80 | ||
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 3b16a0ff7..a7db3e3ab 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c | |||
@@ -71,7 +71,12 @@ uint8_t keyboard_protocol __attribute__((aligned(2))) = 1; | |||
71 | uint8_t keyboard_led_state = 0; | 71 | uint8_t keyboard_led_state = 0; |
72 | volatile uint16_t keyboard_idle_count = 0; | 72 | volatile uint16_t keyboard_idle_count = 0; |
73 | static virtual_timer_t keyboard_idle_timer; | 73 | static virtual_timer_t keyboard_idle_timer; |
74 | static void keyboard_idle_timer_cb(void *arg); | 74 | |
75 | #if CH_KERNEL_MAJOR >= 7 | ||
76 | static void keyboard_idle_timer_cb(struct ch_virtual_timer *, void *arg); | ||
77 | #elif CH_KERNEL_MAJOR <= 6 | ||
78 | static void keyboard_idle_timer_cb(void *arg); | ||
79 | #endif | ||
75 | 80 | ||
76 | report_keyboard_t keyboard_report_sent = {{0}}; | 81 | report_keyboard_t keyboard_report_sent = {{0}}; |
77 | #ifdef MOUSE_ENABLE | 82 | #ifdef MOUSE_ENABLE |
@@ -774,7 +779,12 @@ void kbd_sof_cb(USBDriver *usbp) { (void)usbp; } | |||
774 | 779 | ||
775 | /* Idle requests timer code | 780 | /* Idle requests timer code |
776 | * callback (called from ISR, unlocked state) */ | 781 | * callback (called from ISR, unlocked state) */ |
782 | #if CH_KERNEL_MAJOR >= 7 | ||
783 | static void keyboard_idle_timer_cb(struct ch_virtual_timer *timer, void *arg) { | ||
784 | (void)timer; | ||
785 | #elif CH_KERNEL_MAJOR <= 6 | ||
777 | static void keyboard_idle_timer_cb(void *arg) { | 786 | static void keyboard_idle_timer_cb(void *arg) { |
787 | #endif | ||
778 | USBDriver *usbp = (USBDriver *)arg; | 788 | USBDriver *usbp = (USBDriver *)arg; |
779 | 789 | ||
780 | osalSysLockFromISR(); | 790 | osalSysLockFromISR(); |