Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChibiOS: Decouple USB events from the USB interrupt handler #10437

Merged
merged 1 commit into from
Jan 31, 2021

Conversation

tzarc
Copy link
Member

@tzarc tzarc commented Sep 25, 2020

Description

Struck a bit of an issue when using backlight and an external EEPROM -- the backlight handler issues a read which can eventually trigger a thread suspension.... the problem is, this is done from within an interrupt handler:
image

Attempting a thread suspension triggers an unhandled exception and the MCU subsequently locks up.
This PR pushes the event handling to the main keyboard loop.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@tzarc tzarc requested a review from a team September 25, 2020 04:23
@tzarc
Copy link
Member Author

tzarc commented Sep 25, 2020

This was triggered on the Djinn prototype -- whenever backlight was enabled with the SPI EEPROM at the same time, bootup of the keyboard would lock up every single time.
Disabling backlight, or using the transient EEPROM would allow the keyboard to boot.

@tzarc
Copy link
Member Author

tzarc commented Sep 25, 2020

Testing requested: suspend handling.

@tzarc tzarc self-assigned this Sep 25, 2020
@tzarc
Copy link
Member Author

tzarc commented Sep 25, 2020

Looks as if this isn't happy if it's running on slave side of a split.
Never mind, hadn't updated both sides at the same time.

Added some cleanup and initialisation code as well, working fine on both sides of the split.

@tzarc tzarc force-pushed the decouple-usb-events branch 2 times, most recently from f2a9692 to c60e06c Compare September 25, 2020 08:02
@tzarc tzarc marked this pull request as ready for review October 5, 2020 01:27
@tzarc tzarc force-pushed the decouple-usb-events branch from c60e06c to e946d82 Compare October 22, 2020 03:33
@tzarc tzarc force-pushed the decouple-usb-events branch from e946d82 to 295d2bf Compare October 24, 2020 02:50
@tzarc tzarc force-pushed the decouple-usb-events branch from 295d2bf to de9d810 Compare November 9, 2020 23:25
@noroadsleft noroadsleft deleted the branch qmk:develop November 28, 2020 20:02
@tzarc tzarc reopened this Nov 28, 2020
@tzarc tzarc force-pushed the decouple-usb-events branch from de9d810 to 2f8202b Compare December 2, 2020 22:32
@tzarc tzarc force-pushed the decouple-usb-events branch from 2f8202b to 0d16562 Compare December 16, 2020 11:00
@drashna drashna requested a review from a team December 17, 2020 04:58
@tzarc tzarc merged commit db11a2a into qmk:develop Jan 31, 2021
@tzarc tzarc deleted the decouple-usb-events branch January 31, 2021 21:19
BorisTestov pushed a commit to BorisTestov/qmk_firmware that referenced this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants