Commit Graph

459 Commits

Author SHA1 Message Date
43bac408c6 fl16: Remove MSOS2 descriptor
Signed-off-by: Daniel Schaefer <dhs@frame.work>
2023-12-01 10:55:19 +08:00
c6ba5ad0a2 DEBUG: Working BIOS hotkeys
Works from cold boot and from reboot in windows.

Signed-off-by: Daniel Schaefer <dhs@frame.work>
2023-11-27 12:55:38 +08:00
4264f90c84 fl16: Disable selective suspend
Causing too many issues

Signed-off-by: Daniel Schaefer <dhs@frame.work>
2023-11-24 14:48:15 +08:00
385ed1a291 fix selective suspend on RP2040
the tmk_core chibios protocol_pre_task does not
process any usb events when the host is in suspend.

I think there is a race condition where the usb_event_queue_task
will not be processed depending on when usb goes to sleep.
so we may fall into the
while (USB_DRIVER.state == USB_SUSPENDED) {
which comes directly from the hardware interrupt.
and never process pending events in
usb_event_queue_task();

Signed-off-by: Kieran Levin <ktl@frame.work>
2023-11-17 19:04:24 +08:00
0c31aa0d00 Add SelectiveSuspend MSOS2.0 descriptor
Signed-off-by: Daniel Schaefer <dhs@frame.work>
2023-11-17 19:04:24 +08:00
8fa6c6a564 Add Microsoft OS 2.0 capability descrciptor
Doesn't work yet, on Windows, because Windows will make a special
control request if it sees this.

On Linux lsusb shows it like this:

```
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x0048
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000000
      (Missing must-be-set LPM bit!)
  Platform Device Capability:
    bLength                28
    bDescriptorType        16
    bDevCapabilityType      5
    bReserved               0
    PlatformCapabilityUUID    {d8dd60df-4589-4cc7-9cd2-659d9e648a9f}
    CapabilityData[0]    0x00
    CapabilityData[1]    0x00
    CapabilityData[2]    0x03
    CapabilityData[3]    0x06
    CapabilityData[4]    0x48
    CapabilityData[5]    0x00
    CapabilityData[6]    0x01
    CapabilityData[7]    0x00
```

Signed-off-by: Daniel Schaefer <dhs@frame.work>
2023-11-17 19:04:24 +08:00
d25bf039cc Add BOS Descriptor (USB 2.0 Extended Dev Capability)
Signed-off-by: Daniel Schaefer <dhs@frame.work>
2023-11-17 19:04:24 +08:00
1fe412facf Merge remote-tracking branch 'upstream/develop' into fl16-sleep-fix 2023-07-21 08:34:44 +08:00
da2d2f947d quantum: remove direct quantum.h includes (#21507) 2023-07-16 23:42:56 +10:00
cc3f63e8e3 Merge remote-tracking branch 'upstream/master' into fl16-july-merge 2023-07-14 15:55:57 +08:00
30de598650 tmk_core: remove direct quantum.h includes (#21465) 2023-07-07 21:24:07 +10:00
5542f5ede1 Get rid of USB_LED_KANA and USB_LED_COMPOSE (#21366) 2023-06-27 09:15:33 +10:00
a87c74ebe1 [Bug] Fix non-functional S3 wakeup / resume from suspense (#19780)
* 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
2023-06-26 23:55:52 +02:00
3ebdb1258b Chibios USB: Take into account if host wants remote wakeup or not (#21287)
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.
2023-06-26 10:36:32 +02:00
aad5746682 Move protocol makefiles into their respective folders (#21332)
* Move protocol makefiles into their respective folders

* Fix USB-USB converter
2023-06-22 15:07:28 +01:00
06c5c02804 Disable specific warnings to mitigate compilation problems with KEEP_INTERMEDIATES=yes. (#20339) 2023-04-05 14:59:09 +10:00
4827822cdc fl16: Make dynamic serial number a little more generic
First step towards upstreaming.

Signed-off-by: Daniel Schaefer <dhs@frame.work>
2023-03-23 13:09:09 +08:00
cb290c4132 Merge remote-tracking branch 'upstream/master' into lotus-march2023 2023-03-22 02:54:55 +08:00
9030165550 Implement Airplane Radio Button
To toggle the system's "Airplane mode" via HID (disable WiFi and Bluetooth).

Add Keycode `KC_AIRPLANE_MODE` with alias `KC_AIRP`.
Needs to be enabled with `EXTRAKEY_ENABLE = yes`.

Signed-off-by: Daniel Schaefer <git@danielschaefer.me>
2023-03-02 18:30:42 +08:00
0152dd811d Move KC_MISSION_CONTROL/KC_LAUNCHPAD keycodes to core (#19884) 2023-02-19 18:59:50 +11:00
f0618a1d53 Remove IS_HOST_LED_ON and migrate usages (#19753) 2023-02-06 02:36:09 +00:00
944b6107e2 Fix midi after recent refactoring (#19723) 2023-01-31 01:02:17 +00:00
242b80c63f Move MIDI code out of tmk_core (#19704) 2023-01-30 18:47:50 +11:00
cf935d97ae Fix functions with empty params (#19647)
* Fix functions with empty params

* Found a bunch more
2023-01-20 16:21:17 +00:00
a1480478f8 fixup! lotus: Clean up serial number code 2023-01-17 13:48:56 +08:00
924ddf3296 lotus: Clean up serial number code
More close to upstreaming ready.

Signed-off-by: Daniel Schaefer <dhs@frame.work>
2023-01-17 11:29:52 +08:00
7acc3f4449 ChibiOS: Consolidate report sending code (#19607) 2023-01-16 17:54:26 -08:00
4b95cad37d fixup! lotus: Read serial number from flash 2023-01-16 22:30:08 +08:00
276a6005fd fixup! lotus: Read serial number from flash 2023-01-16 22:26:14 +08:00
eb90fa7be1 fixup! lotus: Read serial number from flash 2023-01-16 22:19:57 +08:00
84e018fecf lotus: Read serial number from flash
Signed-off-by: Daniel Schaefer <dhs@frame.work>
2023-01-16 17:56:52 +08:00
955829bfd0 Fix joystick build for ChibiOS (#19602)
`joystick_report_t` was renamed to `report_joystick_t`, but apparently
one place in the code was missed.
2023-01-15 23:29:29 +00:00
a92071494a usb_main.c: remove CH_KERNEL_MAJOR check (#19597) 2023-01-15 19:40:52 +11:00
1786932d9f [CI] Format code according to conventions (#19265) 2022-12-09 04:10:52 +11:00
a23333eb58 Return USB HID GET_REPORT requests (#14814)
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
Co-authored-by: Nick Brassel <nick@tzarc.org>
2022-12-09 04:08:36 +11:00
85ee55ff3b Detect host OS based on USB fingerprint (#18463)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Nick Brassel <nick@tzarc.org>
2022-12-09 03:45:30 +11:00
0d7edbbcbe Fixed NKRO issue caused by HID_SET_PROTOCOL on Chibios platform (#17588) 2022-12-09 02:56:36 +11:00
4540f52e98 Revert WB32 ISO workaround (#19224) 2022-12-03 09:07:16 +11:00
1e95f7be8f Joystick feature improvements (#19052) 2022-11-27 03:14:45 +11:00
6cc9513ab0 Digitizer feature improvements (#19034) 2022-11-12 23:28:11 +00:00
1ea54e5052 ChibiOS USB: Add a dummy IN callback to work around LLD bugs (#18811)
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.
2022-10-22 18:16:09 +01:00
f99b9ba270 Widen the ARM Cortex-M family support. Allow USB peripheral change. (#18767) 2022-10-19 17:17:49 +11:00
19e2dd742b LUFA: Consolidate report sending code (#18629) 2022-10-15 12:53:57 -04:00
2078a56369 Fix joystick functionality for ChibiOS and OTG (Blackpill) (#18631)
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
2022-10-13 10:28:49 +11:00
d6d6cdcb4f Make MIDI output endpoint use the out direction (#18654) 2022-10-09 21:08:27 +01:00
6dbbeea46a Refactor send_extra (#18615) 2022-10-06 19:35:01 -07:00
09d3e27710 Refactor more host code (programmable button & digitizer) (#18565) 2022-10-05 09:19:12 +11:00
6f13a76530 [Core] ChibiOS: Fix USB bus disconnect handling (#18566) 2022-10-02 15:35:33 +02:00
f80058d96e Start Bluetooth API (#18366) 2022-09-29 18:38:09 +01:00
be8907d634 Further refactoring of joystick feature (#18437) 2022-09-27 18:37:13 +10:00