summaryrefslogtreecommitdiffstats
path: root/tmk_core/protocol/chibios
Commit message (Collapse)AuthorAgeFilesLines
* Joystick feature improvements (#19052)Ryan2022-11-271-2/+2
|
* ChibiOS USB: Add a dummy IN callback to work around LLD bugs (#18811)Sergey Vlasov2022-10-221-5/+15
| | | | | | | | | | | | | | | | In #18631 some IN notification callbacks that were doing nothing were removed, which should be a valid thing to do (ChibiOS HAL checks the `in_cb` and `out_cb` pointers for being non-NULL before invoking those optional callbacks). However, it turned out that some less popular USB LLDs (KINETIS and MIMXRT1062) have their own checks for those pointers, and (incorrectly) skip the ChibiOS callback handling when those pointers are NULL, which breaks the code for the `USB_USE_WAIT` configuration option (the waiting thread never gets resumed if the corresponding callback pointer is NULL). Add those dummy callbacks again (but use a single function for all of them instead of individual ones for each endpoint); this restores the KINETIS and MIMXRT1062 boards to the working state while the LLDs are getting fixed.
* Widen the ARM Cortex-M family support. Allow USB peripheral change. (#18767)Nick Brassel2022-10-192-4/+7
|
* Fix joystick functionality for ChibiOS and OTG (Blackpill) (#18631)Ryan2022-10-132-120/+80
| | | Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
* Refactor `send_extra` (#18615)Ryan2022-10-062-6/+3
|
* Refactor more host code (programmable button & digitizer) (#18565)Ryan2022-10-052-10/+3
|
* [Core] ChibiOS: Fix USB bus disconnect handling (#18566)Stefan Kerkmann2022-10-022-1/+3
|
* Further refactoring of joystick feature (#18437)Ryan2022-09-271-51/+3
|
* Adjust `EXTRAKEY_ENABLE` ifdefs for `send_extra()` (#18249)Ryan2022-09-021-2/+2
|
* Simplify extrakeys sending at the host driver level (#18230)Ryan2022-09-022-16/+3
| | | | | | | | | * Simplify extrakeys sending at the host driver level * There are two arguments here * Wrong syntax * Adjust keyboards which use a custom host driver
* [Core] `STM32_USB_USE_OTG1` => `USB_ENDPOINTS_ARE_REORDERABLE` (#17647)Nick Brassel2022-08-041-16/+14
|
* [Core] Add Raspberry Pi RP2040 support (#14877)Stefan Kerkmann2022-06-301-52/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Check for ongoing transfers on the OUT endpoint (#16974)Stefan Kerkmann2022-05-141-1/+1
| | | | | | | | | | | | | | | | ...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.
* [CI] Format code according to conventions (#16914)QMK Bot2022-04-221-2/+2
|
* Chibios USB protocol: allow overriding RAW Capacity (#16339)dexter932022-04-221-2/+6
|
* Fixed usb read loops not reading until timeout (#16827)Sascha2022-04-101-3/+3
| | | * the size variable was redeclared (hiding the variable of the outside scope) and therefore the while check was always false, so the compiler just removed the do while loop, but it would be better to read all data and only exit the task, after this is done
* Format code according to conventions (#16322)QMK Bot2022-02-124-20/+52
|
* ChibiOS: add support for HID Programmable Buttons (#15787)Thomas Weißschuh2022-02-042-1/+31
| | | | | | | | | | * ChibiOS: add support for HID Programmable Buttons Fixes #15596 * Enable SHARED_ENDPOINT when PROGRAMMABLE_BUTTON is enabled The Programmable Button driver expects the shared EP to be enabled. So enforce this invariant.
* [Core] ChibiOS: shorten USB disconnect state on boot to 50ms (#15805)Stefan Kerkmann2022-01-101-1/+1
|
* Add missing virtser_init() to ChibiOS code (#15356)Ryan2021-11-301-0/+2
|
* Update to ChibiOS 20.3.4, support builds against trunk (#14208)Nick Brassel2021-11-031-1/+11
| | | | | | | | | | | | | | | | | | | * 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.
* Fixup #15029 (#15031)Nick Brassel2021-11-021-2/+2
|
* Revert to old init order for host driver (#15029)Joel Challis2021-11-021-3/+3
| | | * Partially revert 14888
* Begin to carve out platform/protocol API - Migrate keyboard_* calls (#14888)Joel Challis2021-10-241-12/+3
|
* Merge remote-tracking branch 'origin/master' into developQMK Bot2021-10-231-0/+11
|\
| * Check usb transmit status in send_extra() (#14643)Dasky2021-10-231-0/+11
| |
* | Remove SERIAL_LINK feature (#14727)Joel Challis2021-10-071-19/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove SERIAL_LINK * more stale paths in doxygen-todo * Fix * More refs * Update testing docs * Update doxygen-todo Co-authored-by: Ryan <fauxpark@gmail.com> Co-authored-by: Ryan <fauxpark@gmail.com>
* | Purge uGFX. (#14720)Nick Brassel2021-10-071-14/+0
| | | | | | | | | | | | | | * Purge uGFX. * Remove remnants of visualizer. * Remove remnants of uGFX.
* | Added power tracking api (#12691)Purdea Andrei2021-09-302-1/+17
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | * Add power tracking API to lufa and chibios targets * power.c: Pass through power state to the notify function * power: added notify_power_state_change_user too. * making it pass the PR linter * Add a POWER_STATE_NO_INIT state, that we start in before calling power_init(); * Rename *power* to *usb_power* * removing stray newline * Rename usb_power* to usb_device_state* * Update quantum/usb_device_state.h Co-authored-by: Drashna Jaelre <drashna@live.com> * Fix comment * usb_device_state.h: Don't include quantum.h, only the necessary headers. Co-authored-by: Drashna Jaelre <drashna@live.com>
* Begin to carve out platform/protocol API - Single main loop (#13843)Joel Challis2021-08-181-37/+29
| | | | | * Begin to carve out platform/protocol API * Fix up after rebase
* Digitizer HID interface : absolute coordinates for mouse cursor (#12851)a-chol2021-08-182-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add digitizer HID interface for setting the mouse cursor position at absolute screen coordinates. Tested on Pro Micro, Proton C and Blackpill. * Update docs/feature_digitizer.md Co-authored-by: Ryan <fauxpark@gmail.com> * Update tmk_core/protocol/usb_descriptor.c Co-authored-by: Ryan <fauxpark@gmail.com> * Add missing copyrights Add V-USB support * Add support for digitizer dedicated endpoint for lufa and chibios. Fix formatting issues Move digitizer_task definition to the feature's base implementation file * Run cformat on modified files * Change digitizer report usage to Digitizer instead of Pen to avoid pointer disappearing on Windows. * Update tmk_core/protocol/vusb/vusb.c Co-authored-by: Ryan <fauxpark@gmail.com> * Run cformat from docker image * Remove send_digitizer from host_driver_t and instead rely on the declaration being the interface to the implementation in each HW-specific usb implementation. * Fix build : send_digitizer shouldn't be static in vusb and add weak-linkage implementation for tests without usb implementation * Change digitizer user interface to match pointing device's * Update documentation with new API Co-authored-by: a-chol <nothing@none.com> Co-authored-by: Ryan <fauxpark@gmail.com>
* Trigger a wakeup after USB Reset on ChibiOS. (#12831)Joakim Tufvegren2021-08-041-0/+7
| | | | | After a USB Reset event the device must, according to the spec wake up from any suspend state, so the Configured event that arrives afterwards should be interpreted as an implicit wakeup.
* Remove the #10088 hotfix for Teensy 3.1-like Input:Club keyboards (#12870)Joakim Tufvegren2021-08-041-1/+1
| | | | | | | | | | | | | | | | * Remove the #10088 hotfix for K20x MCU:s. It seems to _cause_ the issue it intended to solve there. * Cleaner way of removing #10088 hotfix. Now only affects Ergodox Infinity, Whitefox and K-type, though. Switches over Ergodox Infinity to the `IC_TEENSY_3_1` board, since that was a nice place to implement the `restart_usb_driver` override. However, I would guess this issue is present for other K20x/Teensy 3.1 boards as well... * Fix comment regarding `IC_TEENSY_3_1` for all keyboards using it.
* Fix alignment of USB out report buffer 2 -> 4 (#13838)a_p_u_r_o2021-08-021-1/+1
|
* Avoid LTO conficts on arm_atsam (#13676)Joel Challis2021-07-241-1/+1
|
* [Core] ChibiOS fix O3 and LTO breakage of extra keys and joystick (#12819)Stefan Kerkmann2021-06-061-17/+17
|
* Fixup housekeeping from being invoked twice per loop. (#12933)Nick Brassel2021-05-181-2/+1
|
* eeprom driver: Refactor where eeprom driver initialisation (and EEPROM ↵Purdea Andrei2021-04-251-13/+0
| | | | emulation initialisation) occurs to make it non-target-specific. (#12671)
* Merge remote-tracking branch 'origin/master' into developQMK Bot2021-04-251-2/+2
|\
| * Format code according to conventions (#12681)github-actions[bot]2021-04-251-2/+2
| | | | | | Co-authored-by: QMK Bot <hello@qmk.fm>
* | Merge remote-tracking branch 'origin/master' into developQMK Bot2021-04-252-16/+27
|\|
| * Fix how USB queue overflow is handled in chibios. (#12576)Purdea Andrei2021-04-252-16/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix how USB queue overflow is handled in chibios. This commit reverts PR 12472 (commit c823fe2d3f23ed090e36ce39beed4c448298bd2f), and it implements the original intent of the commit in a better way. The original intent of the above mentioned commit was to not deadlock the keyboard when console is enabled, and hid_listen is not started. The above mentioned commit had a few drawbacks: 1) When a lot of data was printed to the console, the queue would get full, and drop data, even if hid_listen was running. (For example having matrix debug enabled just didn't work right at all) 2) I believe the function in which this was implemented is used by all other USB endpoints, so with the above change, overflow, and data loss could happen in other important functions of QMK as well. This commit implements deadlock prevention in a slightly similar way to how it's done on AVR. There is an additional static local variable, that memorizes whether the console has timeouted before. If we are in the timeouted=false state, then we send the character normally with a 5ms timeout. If it does time out, then hid_listen is likely not running, and future characters should not be sent with a timeout, but those characters should still be sent if there is space in the queue. The difference between the AVR implementation and this one is that the AVR implementation checks the queue state directly, but this implementation instead attempts to write the character with a zero timeout. If it fails, then we remain in the timeouted=true state, if it succeeds, then hid_listen started removing data from the queue, so we can go out of the timeouted=true state. * Added comment explaining the timeouted logic to console flow control. * Console flow control: refactor chibios flowcontrol code to make it more readable, and rename the timeouted variable to timed_out on both chibios and lufa. Changed comments to says timed_out is an approximation of listener_disconnected, to make it clear that it's not the same thing * fix typo
* | Merge remote-tracking branch 'origin/master' into developQMK Bot2021-04-101-11/+11
|\|
| * Format code according to conventions (#12540)github-actions[bot]2021-04-101-11/+11
| | | | | | Co-authored-by: QMK Bot <hello@qmk.fm>
* | Merge remote-tracking branch 'origin/master' into developQMK Bot2021-04-101-1/+13
|\|
| * ChibiOS USB driver: prevent deadlock with CONSOLE_ENABLE = yes (#12472)Michael Stapelberg2021-04-101-1/+13
| | | | | | | | | | | | | | | | | | Before this commit, attaching an ARM-based (i.e. ChibiOS-based) keyboard that uses CONSOLE_ENABLE = yes and produces debug messages would deadlock the keyboard unless one was running hid_listen. With this commit, dead-locking writes to the queue are detected and prevented. fixes #5631
* | Refactor of USB code within split_common (#11890)Joel Challis2021-02-281-0/+21
|/ | | | | | | | | | | * Initial refactor of usb code within split_common * Add headers * Correct disable condition * Format * Align func name
* Format code according to conventions (#11905)github-actions[bot]2021-02-151-1/+1
| | | Co-authored-by: QMK Bot <hello@qmk.fm>
* Refactor platform logic within print.h (#11863)Joel Challis2021-02-141-7/+0
| | | | | | | | | | | | | | | | | | | | | | | * Remove GCC check from debug * Remove platform logic from common.mk * Refactor platform logic within print.h * restore debug.c format * headers * Rename function pointer type * review comments * Update tmk_core/common/printf.c Co-authored-by: Nick Brassel <nick@tzarc.org> * Format Co-authored-by: Nick Brassel <nick@tzarc.org>
* Address wake from sleep instability (#11450)Joshua Diamond2021-02-021-0/+11
| | | | | | | | | | | | | | | | | | | | | * resolve race condition between suspend and wake in LUFA * avoid multiple calls to suspend_power_down() / suspend_wakeup_init() * Remove duplicate suspend_power_down_kb() call * pause on wakeup to wait for USB state to settle * need the repeated suspend_power_down() (that's where the sleep is) * more efficient implementation * fine tune the pause after sending wakeup * speculative chibios version of pause-after-wake * make wakeup delay configurable, and adjust value * better location for wakeup delay