Skip to content

Conversation

@HiFiPhile
Copy link
Collaborator

@HiFiPhile HiFiPhile commented Oct 5, 2025

Describe the PR

  • HID_USAGE_DIGITIZER_TIP_SWITCH and HID_USAGE_DIGITIZER_IN_RANGE are usage but not page, resulting Driver Error Code: code 10 "A non constant main item was declaired without a corresponding usage" on Windows (MSFT made declaired typo)

  • send_stylus_touch in hid_task without waiting for button event is really bad, on Windows it locks the cursor to top left once the USB port is connected.

@Copilot Copilot AI review requested due to automatic review settings October 5, 2025 17:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes HID stylus descriptor and example implementation issues that cause Windows driver errors and cursor locking problems.

  • Corrects HID stylus descriptor usage declarations that were causing Windows "Driver Error Code: code 10"
  • Refactors stylus touch handling in hid_composite example to prevent cursor locking on Windows
  • Integrates stylus touch logic into the existing button-driven HID report system

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/class/hid/hid_device.h Fixed HID stylus descriptor to use HID_USAGE instead of HID_USAGE_PAGE for tip switch and in-range usages
examples/device/hid_composite/src/main.c Refactored stylus touch handling from automatic periodic sending to button-driven reports within send_hid_report function

@HiFiPhile HiFiPhile changed the title Fix HIS stylus descriptor and hid_composite example Fix HID stylus descriptor and hid_composite example Oct 5, 2025
@hathach
Copy link
Owner

hathach commented Oct 6, 2025

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, thank you

@hathach hathach merged commit e72a9eb into hathach:master Oct 6, 2025
110 of 111 checks passed
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.

2 participants