aboutsummaryrefslogtreecommitdiffstats
path: root/tmk_core/protocol/chibios/chibios.c
Commit message (Collapse)AuthorAgeFilesLines
* [Core] suspend: suppress wake up keypress (#23389)Stefan Kerkmann2025-11-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * suspend: suppress wake up keypress Waking the host from suspend is done by pressing any key on the keyboard, the regular key codes assigned to the keys are not important and must not be sent - otherwise they usually end up in password prompts as ghost characters that have to be deleted again. This commit adds suppression for all keys pressed at the time of wake up. Once a key is released it functions as a regular key again. Signed-off-by: Stefan Kerkmann <karlk90@pm.me> * suspend: update wake up matrix after wake up delay If USB_SUSPEND_WAKEUP_DELAY is set, the keyboard sleeps during wake up - which can be up to multiple seconds. To handle key presses and releases in that time frame we have to handle the following cases: 1. Key not pressed before suspend, and not pressed after wakeup → do nothing (normal case). 2. Key not pressed before suspend, but pressed after wakeup → set the wakeup_matrix bit to 1 (so that the press and release events would be suppressed). 3. Key pressed before suspend, but not pressed after wakeup → do nothing (the release event will be generated on the first matrix_task() call after the wakeup). 4. Key pressed before suspend, and still pressed after wakeup → do nothing (the release event will be generated some time later). Signed-off-by: Stefan Kerkmann <karlk90@pm.me> Co-authored-by: Sergey Vlasov <sigprof@gmail.com> * keyboards: anavi: macropad8: disable snake and rgb_test effects ...to shrink the binary size.
* Align sleep_led logic (#25395)Joel Challis2025-06-271-3/+0
|
* Add raw_hid support to host driver (#25255)Joel Challis2025-05-121-1/+11
|
* Align ChibiOS `USB_WAIT_FOR_ENUMERATION` implementation (#25184)Joel Challis2025-04-221-13/+4
|
* [Core] `usb_device_state`: consolidate usb state handling across ↵Stefan Kerkmann2024-10-181-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implementations (#24258) * usb_device_state: add idle_rate, led and protocol Previously all usb drivers and platform implementations (expect for our oddball atsam) tracked the same two global variables: - keyboard_protocol: to indicate if we are in report or boot protocol - keyboard_idle: for the idle_rate of the keyboard endpoint And a local variable that was exposed trough some indirection: - keyboard_led_state: for the currently set indicator leds (caps lock etc.) These have all been moved into the usb_device_state struct wich is accessible by getters and setters. This reduces code duplication and centralizes the state management across platforms and drivers. Signed-off-by: Stefan Kerkmann <karlk90@pm.me> * usb_device_state: reset protocol on reset The usb hid specification section 7.2.6 states: When initialized, all devices default to report protocol. However the host should not make any assumptions about the device’s state and should set the desired protocol whenever initializing a device. Thus on reset we should always do exactly that. Signed-off-by: Stefan Kerkmann <karlk90@pm.me> * keyboards: fix oversize warnings Signed-off-by: Stefan Kerkmann <karlk90@pm.me> --------- Signed-off-by: Stefan Kerkmann <karlk90@pm.me>
* Change suspend condition check order on ChibiOS (#24020)Drashna Jaelre2024-07-041-1/+1
|
* Fix WAIT_FOR_USB handling (#23598)Joel Challis2024-04-241-1/+6
|
* Remove midi_ep_task from ChibiOS (#23162)Robin Carlier2024-03-291-7/+0
| | | Co-authored-by: Joel Challis <git@zvecr.com>
* Refactor vusb to protocol use pre/post task (#14944)Joel Challis2024-03-141-13/+0
|
* [Core] Refactor ChibiOS USB endpoints to be fully async (#21656)Stefan Kerkmann2024-02-281-6/+10
|
* Separate 6KRO and NKRO report structs (#22267)Ryan2023-10-231-1/+2
|
* Revert changes to ChibiOS Suspend Code (#21830)Drashna Jaelre2023-08-271-16/+35
| | | | | | | | | | | | | | | | | | | | | * Partially revert #19780 * Finish * Get teensy 3.5/3.6 board files too * fix lint issue * Revert "[Bug] Restore usb suspend wakeup delay (#21676)" This reverts commit e8e989fd7ad7c10e725e50ae8b0a4426e09f7f30. * Apply suggestions from code review Co-authored-by: Joel Challis <git@zvecr.com> --------- Co-authored-by: Joel Challis <git@zvecr.com>
* [Bug] Restore usb suspend wakeup delay (#21676)Stefan Kerkmann2023-08-031-23/+8
| | | | | | | | | * Respect USB_SUSPEND_WAKEUP_DELAY on wakeup This delay wasn't honored after removing `restart_usb_driver` from the suspend and wakeup handling. It is now re-introduced in the appropriate spot, namely after issuing a remote wakeup to a sleeping host. * Remove old, unused and commented testing code
* [Bug] Fix non-functional S3 wakeup / resume from suspense (#19780)Stefan Kerkmann2023-06-261-13/+9
| | | | | | | | | | | | | | | | | | | | * Update ChibiOS-Contrib for USB suspend fixes * Remove S3 wakup workaround ChibiOS OTGv1 driver has a remote wakeup bug that prevents the device to resume it's operation. 02516cbc24647f522eee975e69cc0c8a925470eb introduced a hotfix that forcefully restarted the usb driver as a workaround. This workaround broke multiple boards which do not use this driver / peripheral. With the update of ChibiOS this hotfix is now obsolete. * Remove restart_usb_driver overrides they are no longer necessary as the workaround is not needed anymore for stm32f4 * Remove unused RP_USB_USE_SOF_INTR defines The SOF interrupt is enabled dynamically by the RP2040 usb driver
* Chibios USB: Take into account if host wants remote wakeup or not (#21287)Purdea Andrei2023-06-261-1/+3
| | | | | | | | | | | | | | | According to the USB 2.0 spec, remote wakeup should be disabled by default, and should only be enabled if the host explicitly requests it. The chibios driver code already takes care of storing this information, and returning it on GET_STATUS requests. However our application code has been ignoring it so far. This is a USB compliance issue, but also a bug that causes trouble in some cases: On RP2040 targets this has been causing problems if a key is held down while the keyboard is plugged in. The keyboard would fail to enumerate until all keys are released. With this change that behavior is fixed. Note that for LUFA targets this is already done correctly.
* Refactor `send_extra` (#18615)Ryan2022-10-071-1/+1
|
* Refactor more host code (programmable button & digitizer) (#18565)Ryan2022-10-051-3/+1
|
* Simplify extrakeys sending at the host driver level (#18230)Ryan2022-09-021-3/+2
| | | | | | | | | * Simplify extrakeys sending at the host driver level * There are two arguments here * Wrong syntax * Adjust keyboards which use a custom host driver
* Format code according to conventions (#16322)QMK Bot2022-02-121-3/+5
|
* ChibiOS: add support for HID Programmable Buttons (#15787)Thomas Weißschuh2022-02-041-1/+2
| | | | | | | | | | * 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.
* 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
|
* 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-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-0/+255
* Begin to carve out platform/protocol API * Fix up after rebase