Skip to content

feat: add Redragon M901 Perdition (04d9:fc5e) - #291

Open
Blitzedzz-3 wants to merge 1 commit into
OpenMouse-Project:mainfrom
Blitzedzz-3:feat/redragon-m901
Open

Blitzedzz-3 wants to merge 1 commit into
OpenMouse-Project:mainfrom
Blitzedzz-3:feat/redragon-m901

Conversation

@Blitzedzz-3

@Blitzedzz-3 Blitzedzz-3 commented Nov 7, 2026 •

Copy link
Copy Markdown

Summary

Adds support for the Redragon M901 Perdition (04d9:fc5e), the M901-K-2 "Perdition4" variant — a wired Holtek mouse that runs the same RDCfg OEM firmware family and settings memory layout as the Redragon M612/M724.

  • New REDRAGON_M901_MODEL descriptor (src/redragon/m901.ts) reuses the shared Holtek transport and the 0xCFF DPI table.
  • RedragonModel.replyAddressBase covers the one wire difference found: this firmware answers a read with byte 3 = 0x60 + addressHigh, where the M612/M724 answer 0x32 + addressHigh.
  • buttons and lighting are now optional in the model descriptor. The M901 model leaves both unset because the physical side-button order and effect names are not verified on this unit, so the status omits the button editor and lighting card instead of writing guesses.
  • The existing Redragon registry entry serves 0xfc5e too.

Hardware verification

Tested on a real unit over hidraw (interface 2, 0xFFA0:0x01, feature report 2):

  • Full 0x0000-0x07ff settings dump: captures/redragon-m901/memory-dump.hex.
  • readStatus: 5 profiles, DPI stages 500 / 1000 / 2000 / 3000 / 6200, active profile 2.
  • Idempotent polling write and a DPI round trip (1000 -> 800 -> 1000) both read back; the settings memory was byte-identical to the dump afterwards.

Public references for the device and protocol:

  • dokutan/mouse_m908 lists 0x04d9:0xfc5e as M901-K-2 "Perdition4" with generic support.
  • ernesto-elsaesser/usb-mouse-config documents the same F2/F3/F5 framing, the 0x42/0x102/0x1b2/0x262/0x312 DPI blocks, the 20-slot keymap addresses and the 0xCFF DPI code table.

Details: docs/redragon-m901-testing.md.

Checks

  • npm run check (build + full test suite + pack dry run) passes: 3049 tests, 0 failed.
  • New tests: src/drivers/redragon/m901.test.ts (dispatch, read status, reply header, DPI codec, bracketed polling write, and the deliberate button/lighting omission).

Note

Add Redragon M901 Perdition (04d9:fc5e) support to Redragon driver

  • Adds the M901 model descriptor with wired transport, 5 DPI stages up to 12400 DPI, and its own read-reply address base in m901.ts; registers it in the Redragon catalogs in index.ts
  • Extends RedragonModel in holtek.ts with optional button, lighting, and reply-address base fields, and lets redragonDecodeRead validate non-default reply headers
  • M901 button and lighting layouts are unverified, so readStatus omits those fields and setButtonMapping/setLighting throw model-specific errors for the M901 in hid.ts
  • Includes a captured memory dump, hardware testing notes in redragon-m901-testing.md, and full client tests against a simulated M901 device in m901.test.ts
  • Behavioral Change: RedragonModel button/lighting fields are now optional; models without them return status without button or lighting data

Macroscope summarized 069f9dc.

@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b62a1cc and 069f9dc.

Files selected for processing: 8

  • captures/redragon-m901/memory-dump.hex
  • docs/redragon-m901-testing.md
  • src/drivers/redragon/hid.ts
  • src/drivers/redragon/m901.test.ts
  • src/drivers/registry.ts
  • src/redragon/holtek.ts
  • src/redragon/index.ts
  • src/redragon/m901.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added type: enhancement PR title category: enhancement area: protocol Protocol codecs and shared types area: drivers Device drivers and transport integration area: tests Protocol and driver tests area: captures Protocol captures and device evidence area: documentation Documentation labels Nov 7, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 7, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved at 069f9dc

Macroscope's review found this PR approvable — Adds M901 support for DPI, polling and profiles using the existing Holtek driver, backed by captured hardware data and round-trip evidence. Unverified button and lighting controls remain disabled, while existing models retain their protocol defaults.

Notes:

  • Your repo's Minimum Blocking Severity is Off, so correctness findings do not automatically block approval.

You can add or adjust custom eligibility rules. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: captures Protocol captures and device evidence area: documentation Documentation area: drivers Device drivers and transport integration area: protocol Protocol codecs and shared types area: tests Protocol and driver tests type: enhancement PR title category: enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant