-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Adding support for InkHUD joystick navigation for the Seeed Wio Tracker L1 E-ink #8678
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
base: develop
Are you sure you want to change the base?
Conversation
settings->joystick.enabled setting added and SETTINGS_VERSION incremented by one in InkHUD/Persistence.h in seeed_wio_tracker_L1_eink/nicheGraphics.h enable joystick and disable "Next Tile" menu item in implement prevTile and prevApplet functions in InkHUD/WindowManager.h,cpp and InkHUD/InkHUD.h,cpp onStickCenterShort, onStickCenterLong, onStickUp, onStickDown, onStickLeft, and onStickRight functions added to: - InkHUD/InkHUD.h,cpp - InkHUD/Events.h,cpp - InkHUD/Applet.h change navigation actions in InkHUD/Events.cpp events based on whether the joystick is enabled or not in seeed_wio_tracker_L1_eink/nicheGraphics.h connect joystick events to the new joystick handler functions
Both the joystick center short press and the user button short press can be used to advance through the Tips applet. dismiss notifications with any joystick input
allows menu navigation including a back button
add joystick.aligned and joystick.alignment to InkHUD/Persistence.h for storing alignment status and relative angle create AlignStick applet that prompts the user for a joystick input and rotates the controls to align with the screen AlignStick applet is run after the tips applet if the joystick is enabled and not aligned add menu item for opening the AlignStick applet
|
Tested it out and it works great. resolves #8161 IMG_4513.compressed.mp4 |
There was a problem hiding this 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 adds comprehensive joystick navigation support for the Seeed Wio Tracker L1 E-ink device. The implementation extends the existing button input system to handle a 5-way joystick (4 directions + center press) while maintaining backward compatibility with devices that only have buttons.
Key changes:
- Created
TwoButtonExtendedclass that mirrorsTwoButtonfunctionality with added support for 4-directional joystick inputs - Added joystick input handlers throughout InkHUD architecture with directional rotation logic based on screen orientation
- Implemented
AlignStickAppletfor calibrating joystick orientation to the screen
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
variants/nrf52840/seeed_wio_tracker_L1_eink/nicheGraphics.h |
Configures joystick hardware wiring and connects handlers to InkHUD |
src/graphics/niche/Inputs/TwoButtonExtended.h |
Header for extended input class supporting joystick directions |
src/graphics/niche/Inputs/TwoButtonExtended.cpp |
Implementation of joystick input handling with interrupt-driven detection |
src/graphics/niche/InkHUD/WindowManager.h |
Declares prev navigation methods |
src/graphics/niche/InkHUD/WindowManager.cpp |
Implements backward navigation for tiles and applets |
src/graphics/niche/InkHUD/Persistence.h |
Adds persistent settings for joystick enable/alignment |
src/graphics/niche/InkHUD/InkHUD.h |
Declares joystick event handlers |
src/graphics/niche/InkHUD/InkHUD.cpp |
Implements joystick rotation transformation logic |
src/graphics/niche/InkHUD/Events.h |
Declares joystick event methods |
src/graphics/niche/InkHUD/Events.cpp |
Routes joystick events to appropriate applets |
src/graphics/niche/InkHUD/Applet.h |
Adds virtual joystick handler methods to base class |
src/graphics/niche/InkHUD/Applets/System/Tips/TipsApplet.h |
Declares joystick input handler |
src/graphics/niche/InkHUD/Applets/System/Tips/TipsApplet.cpp |
Updates tips text for joystick navigation |
src/graphics/niche/InkHUD/Applets/System/Notification/NotificationApplet.h |
Declares joystick handlers |
src/graphics/niche/InkHUD/Applets/System/Notification/NotificationApplet.cpp |
Implements dismiss on any joystick input |
src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.h |
Declares joystick navigation methods and previous page tracking |
src/graphics/niche/InkHUD/Applets/System/Menu/MenuApplet.cpp |
Implements joystick menu navigation including back button |
src/graphics/niche/InkHUD/Applets/System/Menu/MenuAction.h |
Adds ALIGN_JOYSTICK menu action |
src/graphics/niche/InkHUD/Applets/System/AlignStick/AlignStickApplet.h |
Header for joystick alignment calibration applet |
src/graphics/niche/InkHUD/Applets/System/AlignStick/AlignStickApplet.cpp |
Implements visual calibration UI with arrow graphics |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return; | ||
|
|
||
| // Find the index of the applet currently shown on the tile | ||
| uint8_t appletIndex = -1; |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable appletIndex is initialized to -1 but has type uint8_t (unsigned). This will wrap to 255. Use int8_t or a signed integer type instead, or initialize to a value like UINT8_MAX and check against that.
| } | ||
|
|
||
| // Confirm that we did find the applet | ||
| assert(appletIndex != (uint8_t)-1); |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comparing unsigned appletIndex to (uint8_t)-1 (255). While this works, it's clearer to use 255 or UINT8_MAX for unsigned comparisons, or switch to a signed type.
Made additions to InkHUD for navigating with the joystick on the Seeed Wio Tracker L1 E-ink
Key changes:
seeed_wio_tracker_L1_eink/nicheGraphics.hto enable joystick navigation and connect joystick events to InkHUD handlersTwoButtonExtendedmirrors the functionalityTwoButtonbut with additional joystick specific functionsInkHUDwith matching events inEventsprevAppletandprevTiletoWindowManagerAppletand handle joystick inputs inTipsApplet,NotificationApplet, andMenu AppletAlignStickAppletfor aligning the joystick to the screen (accessible through the menu)MenuAppletstores previous page data for navigating backwards through the menuAlign Joystick Applet:
🤝 Attestations
We have only tested our changes on the Seeed Wio Tracker L1 E-ink by setting the
settings->joystick.enableto true and false to confirm that navigation with and without a joystick still works properly.