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.

@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
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.

None yet

4 participants