qmk_firmware/platforms/chibios
Stefan Kerkmann 3f5dc47296
[Core] Use polled waiting on ChibiOS platforms that support it (#17607)
* Use polled waiting on platforms that support it

Due to context switching overhead waiting a very short amount of time on
a sleeping thread is often not accurate and in fact not usable for timing
critical usage i.e. in a driver. Thus we use polled waiting for ranges
in the us range on platforms that support it instead. The fallback is
the thread sleeping mechanism.

This includes:

* ARM platforms with CYCCNT register (ARMv7, ARMv8) this is
  incremented at CPU clock frequency
* GD32VF103 RISC-V port with CSR_MCYCLE register this is incremented at
  CPU clock frequency
* RP2040 ARMv6 port which uses the integrated timer peripheral which is
  incremented with a fixed 1MHz frequency

* Use wait_us() instead of chSysPolledDelayX

...as it is powered by busy waiting now.

* Add chibios waiting methods test bench
2022-07-11 15:17:05 +02:00
..
boards Update PM2040 I2C pins (#17578) 2022-07-07 09:33:11 +02:00
bootloaders [Core] Use polled waiting on ChibiOS platforms that support it (#17607) 2022-07-11 15:17:05 +02:00
converters Add kb2040 and sparkfun rp2040 converters (#17514) 2022-07-06 19:27:15 +01:00
drivers [Core] Use polled waiting on ChibiOS platforms that support it (#17607) 2022-07-11 15:17:05 +02:00
vendors/RP RP2040 emulated EEPROM. (#17519) 2022-07-02 15:18:50 +10:00
_pin_defs.h [Core] Add Raspberry Pi RP2040 support (#14877) 2022-06-30 13:19:27 +02:00
_timer.h Move tmk_core/common/<plat> (#13918) 2021-11-19 10:41:02 -08:00
_wait.c Move tmk_core/common/<plat> (#13918) 2021-11-19 10:41:02 -08:00
_wait.h [Core] Use polled waiting on ChibiOS platforms that support it (#17607) 2022-07-11 15:17:05 +02:00
atomic_util.h Move tmk_core/common/<plat> (#13918) 2021-11-19 10:41:02 -08:00
chibios_config.h [Core] Use polled waiting on ChibiOS platforms that support it (#17607) 2022-07-11 15:17:05 +02:00
flash.mk [Core] Add Raspberry Pi RP2040 support (#14877) 2022-06-30 13:19:27 +02:00
gd32v_compatibility.h Format code according to conventions (#16322) 2022-02-12 18:29:31 +00:00
gpio.h Refactor writePin to work with statements (#16738) 2022-03-27 15:07:25 -07:00
hardware_id.c Expose API for hardware unique ID (#16869) 2022-04-18 20:51:40 +10:00
platform.c Move tmk_core/common/<plat> (#13918) 2021-11-19 10:41:02 -08:00
platform.mk [Core] Update mpaland/printf to eyalroz/printf fork (#16163) 2022-07-07 09:27:50 +02:00
platform_deps.h Move tmk_core/common/<plat> (#13918) 2021-11-19 10:41:02 -08:00
sleep_led.c Format code according to conventions (#16322) 2022-02-12 18:29:31 +00:00
suspend.c Initial migration of suspend callbacks (#16067) 2022-02-05 05:10:00 +11:00
synchronization_util.c [Core] Use a mutex guard for split shared memory (#16647) 2022-04-19 20:56:16 +10:00
syscall-fallbacks.c Format code according to conventions (#16322) 2022-02-12 18:29:31 +00:00
timer.c ChibiOS 21.11.1 update. (#16251) 2022-03-07 21:04:22 +11:00
wait.c ChibiOS 21.11.1 update. (#16251) 2022-03-07 21:04:22 +11:00