Fix AMS spinning icon showing on all trays for AMS units with ID >= 128 #8399
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.
Problem
Users reported that AMS Lite position 2 (A2) shows a persistent spinning RFID reading icon, even when no reading operation is active or when using external spools. Investigation revealed this affects AMS units with ID >= 128 (including N3S and some AMS Lite configurations).
Root Cause
The bit checking logic in
StatusPanel.cppwas using a single bit position for all trays within an AMS unit whenams_id >= 128:This formula meant:
When the firmware indicated any tray in an AMS unit was being read, all 4 trays would show the spinning animation simultaneously, rather than just the specific tray being read.
Solution
Updated the bit calculation to check individual tray reading bits, consistent with the pattern used for regular AMS units (ID < 128):
This formula now assigns unique bit positions:
Impact
Testing Notes
This fix assumes the firmware provides individual tray reading bits at the calculated positions. Hardware testing with A1 printer + AMS Lite is recommended to verify the fix resolves the reported issue.
Fixes #4575 (if issue number exists)
Original prompt
Fixes #8363
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.