Draft
Conversation
added 10 commits
March 11, 2026 12:42
Adds STM32/maple HAL layer (XInput, GPIO, serial, keyboard mode) and stm32pintester board configuration. App is linked at 0x08001000 with VECT_TAB_ADDR relocated to support a 4KB custom bootloader at 0x08000000.
Implement reboot_bootloader() via RAM magic (0xDEADBEEFCC00FFEE) for davidgfnet DFU bootloader. Fix RAM to 96KB with 8-byte reservation for reboot flags. Add dfu-util upload command to env.ini.
- Rename config from stm32pintester to jz-stm32-leverless - Rewrite button_mappings[] with 17 active pins verified via pintester (12 of 27 original pin assignments were wrong) - Fix PC12 (A button) stuck/unresponsive: maple framework was using PC12 as USB disconnect pin. Override with -DBOARD_USB_DISC_DEV=NULL - Add SOCD toggle combo (Start + Select + DPadUp cycles SOCD modes) - Add ButtonMappings.md with full mapping table - Set default mode to FGC (default_mode_config = 4)
Change the default vertical SOCD from SOCD_NEUTRAL to SOCD_DIR1_PRIORITY (Up wins over Down). SOCD toggle combo now cycles only the vertical pair (index 1), leaving horizontal always SOCD_NEUTRAL. The cycle now includes DIR1_PRIORITY: DIR1 → NEUTRAL → 2IP → 2IP_NO_REAC → DIR1.
Add pre-clear pass before GPIO reads so multiple pins mapped to the same BTN_* constant use OR semantics: any pressed pin sets the button true; no unpressed pin can overwrite it false. Without this, the last entry in button_mappings[] always wins, breaking secondary mappings. UpdateButtonState now only sets true; false is handled by the pre-clear. Same pattern applied to SwitchMatrixInput, DebouncedGpioButtonInput, DebouncedSwitchMatrixInput, and Pca9671Input for consistency.
setManualReportMode(true) prevents safeSendReport() from firing a blocking USB send on every button/axis setter call. Previously each of the ~21 setters triggered a full sendData() with two USB wait cycles, capping the effective loop rate at ~47Hz. With manual mode, setters only update the in-memory report struct and a single send() at the end of SendReport() does one USB transfer per frame (~1000Hz). Also add patch_usb_polling.py pre-build script to set bInterval=1 in the USBComposite usb_x360w.c endpoint descriptor, raising the USB host polling rate from 250Hz (bInterval=4) to 1000Hz (bInterval=1).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.