-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
[BUG] LED control in encoder.cpp - invalid narrowing conversion #26552
Comments
- struct { uint8_t g, r, b; } led_data[LED_NUM];
+ struct { uint32_t g, r, b; } led_data[LED_NUM];
So you want to use 4 bytes for each of R,G and B that can only be 0-255 and fits with in a single byte?? |
That error is saying you're converting from a signed 1+byte (depending on arch) type to an unsigned byte type. I don't think converting to a |
well no, i tried different things and that was the first which cleared the error. if it were me making the choice then definitely not, but something else. its just an example of how to think, not what to think. |
Greetings from the Marlin AutoBot! Disclaimer: This is an open community project with lots of activity and limited |
Closing since you’ve opened a PR. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Did you test the latest
bugfix-2.1.x
code?Yes, and the problem still exists.
Bug Description
invalid narrowing conversion from "int" to "unsigned char"
I was messing around and saw
LED_Action()
commented out and wondered whyso I enabled that pin, and stumbled upon this error.
one possible fix is
Bug Timeline
could be older, only noticed it now
Expected behavior
should not give error for invalid conversion
Actual behavior
gives error for invalid conversion
Steps to Reproduce
#define LCD_LED_PIN EXP3_02_PIN
-- or any pinVersion of Marlin Firmware
bugfix-2.1.x
Printer model
Aquila
Electronics
No response
LCD/Controller
No response
Other add-ons
No response
Bed Leveling
None
Your Slicer
None
Host Software
None
Don't forget to include
Configuration.h
andConfiguration_adv.h
.Additional information & file uploads
No response
The text was updated successfully, but these errors were encountered: