Commit Graph
32 Commits
Author SHA1 Message Date
Stefan Kerkmann 77d960cce3 Disable clang-format for stage2_bootloaders (#17516) 2022-06-30 20:07:54 +01:00
Stefan KerkmannandNick Brassel d717396708 [Core] Add Raspberry Pi RP2040 support (#14877)
* Disable RESET keycode because of naming conflicts

* Add Pico SDK as submodule

* Add RP2040 build support to QMK

* Adjust USB endpoint structs for RP2040

* Add RP2040 bootloader and double-tap reset routine

* Add generic and pro micro RP2040 boards

* Add RP2040 onekey keyboard

* Add WS2812 PIO DMA enabled driver and documentation

Supports regular and open-drain output configuration. RP2040 GPIOs are
sadly not 5V tolerant, so this is a bit use-less or needs extra hardware
or you take the risk to fry your hardware.

* Adjust SIO Driver for RP2040

* Adjust I2C Driver for RP2040

* Adjust SPI Driver for RP2040

* Add PIO serial driver and documentation

* Add general RP2040 documentation

* Apply suggestions from code review

Co-authored-by: Nick Brassel <nick@tzarc.org>

Co-authored-by: Nick Brassel <nick@tzarc.org>
2022-06-30 13:19:27 +02:00
Stefan Kerkmann 9aa9155e88 [Core] Mark GD32VF103 as ChibiOS-Contrib (#17444) 2022-06-23 08:37:40 +10:00
Stefan Kerkmann 6a81cb44f2 [Fix] Fix compilation warning for non-split keebs after #17423 (#17439) 2022-06-21 09:31:20 +10:00
Stefan Kerkmann 2703ecc9e9 [BUG] Fix deadlocks on disconnected secondary half (#17423) 2022-06-21 08:24:53 +10:00
Stefan Kerkmann fe680a8568 [Core] Split ChibiOS usart split driver in protocol and hardware driver part (#16669) 2022-06-18 08:04:17 +10:00
Stefan Kerkmann 6d67e9df4b [Core] Allow usage of ChibiOS's SIO driver for split keyboards (#15907) 2022-06-17 22:06:44 +02:00
Stefan Kerkmann e89478eb0f [Core] Update C standard to GNU11, C++ to GNU++14 (#17114) 2022-06-06 08:47:22 +10:00
Stefan Kerkmann 4c48760558 Apply EXPECT_REPORT and EXPECT_EMPTY_REPORT (#17311)
...convenience macros to test cases that where missed during #17284
2022-06-05 20:06:05 +01:00
Stefan Kerkmann 4d107feca9 Check for ongoing transfers on the OUT endpoint (#16974)
...when attempting to start a receiving USB transfer. Previously, we would
check on the IN endpoint which is the transmitting part of the USB endpoint.
This is wrong and lead to two USB transfers being started immediately
after each other in case of e.g. RAW HID endpoints:

1. When finishing an OUT transfer the low level USB driver calls the out_cb
callback, which in turn initiates another OUT transfer by calling
qmkusbDataReceived.

2. When the raw hid receive channel runs empty inside the raw_hid task,
another OUT transfer is started to potentially fill the channel again. This
happens by calling ibnotify.

Both events occur directly after each other, thus triggering the bug.
2022-05-14 23:17:14 +01:00
Stefan KerkmannandSergey Vlasov b1681fb6a1 [Core] Allow usage of AVRs minimal printf library (#16266)
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
2022-04-22 18:13:31 +10:00
Stefan Kerkmann 7712a286dc [Core] Use a mutex guard for split shared memory (#16647) 2022-04-19 20:56:16 +10:00
Stefan Kerkmann 147e57fd59 [QP] Check BPP capabilities before loading the palette (#16863) 2022-04-17 08:30:51 +10:00
Stefan Kerkmann 119abc4375 Refactor writePin to work with statements (#16738) 2022-03-27 15:07:25 -07:00
Stefan Kerkmann 7e669421f8 Rename TICK to TICK_EVENT to prevent naming conflicts (#16649) 2022-03-14 20:06:21 +00:00
Stefan Kerkmann 2bface8f89 Add flash target for UF2 bootloaders (#16525) 2022-03-07 08:59:06 -08:00
Stefan Kerkmann 156f0561f2 [Core] Squeeze AVR some more with -mrelax and -mcall-prologues (#16269) 2022-02-26 19:05:03 -08:00
Stefan Kerkmann be59e8af2b Deprecate split transactions status field (#16023) 2022-01-26 21:13:27 -08:00
Stefan Kerkmann 5470e4a8ad [Core] ChibiOS: shorten USB disconnect state on boot to 50ms (#15805) 2022-01-10 15:01:20 -08:00
Stefan Kerkmann 8b865a9d64 [Core] Don't send keyboard reports that propagate no changes to the host (#14065) 2021-12-14 10:40:18 -08:00
Stefan Kerkmann c1297ceb97 [Core] Remove matrix_is_modified() and debounce_is_active() (#15349) 2021-11-29 08:22:10 -08:00
Stefan Kerkmann ca5670762b Fix HOLD_ON_OTHER_KEY_PRESS after #11059 (#15307)
that broke compilation because of a typo: KEYPRESS should have been
KEY_PRESS
2021-11-28 05:54:51 +11:00
Stefan KerkmannandNick Brassel a24bdccee0 [Tests] Increase QMK test coverage take 2 (#15269)
* Add per-test keymaps

* Add better trace and info logs for failed unit-tests

* Add layer state assertion with tracing message

* Use individual test binaries configuration options

* Add basic qmk functionality tests

* Add tap hold configurations tests

* Add auto shift tests

Co-authored-by: Nick Brassel <nick@tzarc.org>
2021-11-23 13:31:01 +11:00
Stefan KerkmannandNick Brassel b6054c0206 [Tests] Increase QMK test coverage (#13789)
* Add per-test keymaps

* Add better trace and info logs for failed unit-tests

* Add layer state assertion with tracing message

* Use individual test binaries configuration options

* Add basic qmk functionality tests

* Add tap hold configurations tests

* Add auto shift tests

* `qmk format-c

* Fix tests

Co-authored-by: Nick Brassel <nick@tzarc.org>
2021-11-23 08:15:04 +11:00
Stefan Kerkmann 5c2052fd47 [Core] RISC-V toolchain and picolibc fixes (#15109)
* [Core] Fix RISC-V toolchain installation

The risc-v toolchain is only available on distributions based on Debian 11+
so we check for their availability before installing them.

* [Core] Fix heap symbols and syscalls for picolibc

picolibc internally uses __heap_start and __heap_end instead of the
defacto chibios linker script standard __heap_base__ and __heap_end__
therefore we introduce these symbols as an alias. Usually all memory
used within QMK is statically allocated, but some algorithms make usage
of malloc and friends.

Also the timeval struct is not defined by picolibc for syscalls, therefore it
is declared as stub.
2021-11-20 20:04:16 +00:00
Stefan Kerkmann e50867d52d [Core] Add support for RISC-V builds and GD32VF103 MCU (#12508)
* Add support for RISC-V builds and GD32VF103 MCU

* Add toolchain selection in chibios.mk based on the mcu selected in
mcu_selection.mk
* Reorder and added comments to chibios.mk to have a streamlined makefile
* Add GD32VF103 mcu to possible targets for QMK.
* Add STM32 compatibility for GD32VF103 MCU, this is hacky but more efficent
  then rewriting every driver.
* Add GigaDevice DFU bootloader as flash target, please note that
  dfu-util of at least version 0.10 is needed.
* Add analog driver compatibility
* Add apa102 bitbang driver compatibility
* Add ws2812 bitbang driver compatibility
* Add eeprom in flash emulation compatibility
* Allow faster re-builds with ccache

* Add SiPeed Longan Nano to platform files

* Add SiPeed Longan Nano Onekeys

* Make quine compatible with other bootloaders

* Support builds with picolibc

* Add risc-v toolchain to arch and debian/ubuntu scripts
2021-10-18 16:23:20 +11:00
Stefan Kerkmann efde8d657a Use opendrain pin with external pullup again (#14474) 2021-09-17 12:12:20 +01:00
Stefan Kerkmann 04bc74d8f5 Switch split_common to CRC subsystem (#13418) 2021-07-02 22:28:32 +01:00
Stefan KerkmannandNick Brassel 117bff17ba [Core] Unite half-duplex and full-duplex serial drivers (#13081)
* Unite half-duplex and full-duplex serial driver.

* Add full duplex operation mode to the interrupt based driver
* Delete DMA UART based full duplex driver
* The new driver targets #11930

* Fix freezes with failing transactions in half-duplex

* Increase default serial TX/RX buffer size to 128 bytes

* Correctly use bool instead of size_t

Co-authored-by: Nick Brassel <nick@tzarc.org>
2021-07-02 08:24:08 +10:00
Stefan Kerkmann ef92c9ee2c Add CRC8 calculation subsystem to quantum (#12641)
* Intended usage is data validation in split transport code.
* Default space efficient algorithm.
* Opt-in fast table based algorithmn with #define CRC8_USE_TABLE switch.
* Define switches for size and speed optimized versions, the default is size
  optimized by using uint_least8_t as datatype for calculations.
  * #define CRC8_OPTIMIZE_SPEED uses uint_fast8_t as datatype for
    calculations, this only affects 32-bit Archs like ARM and RISC-V.
* Placeholder crc_init() function for hardware backed crc calculation,
  not implemented yet.
2021-06-18 00:09:43 +01:00
Stefan Kerkmann 49fd3c0760 [Core] ChibiOS fix O3 and LTO breakage of extra keys and joystick (#12819) 2021-06-06 22:16:55 -07:00
Stefan Kerkmann d9610120de Add Full-duplex serial driver for ARM boards (#9842) 2021-05-26 20:37:54 -07:00