You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
invalid narrowing conversion from "int" to "unsigned char"
It is apparent that R and G are swapped, generally it should follow RGB, not GRB, and also you see G (or g) shifts 16 bits, not 8 which it is supposed to, as for R (or r) it shifts 8. so basically, these are backwards.
I was messing around and saw LED_Action() commented out and wondered why
#if PIN_EXISTS(LCD_LED)
//LED_Action();
#endif
so I enabled that pin, and stumbled upon this error.
one possible fix is
- struct { uint8_t g, r, b; } led_data[LED_NUM];
for (uint8_t i = 0; i < LED_NUM; i++) {
switch (RGB_Scale) {
case RGB_SCALE_R10_G7_B5:
- led_data[i] = { luminance * 7/10, luminance * 10/10, luminance * 5/10 };+ struct { uint32_t g, r, b; } led_data[LED_NUM];
for (uint8_t i = 0; i < LED_NUM; i++) {
switch (RGB_Scale) {
case RGB_SCALE_R10_G7_B5:
+ led_data[i] = { luminance * (u_int)7/10, luminance * (u_int)10/10, luminance * (u_int)5/10 };
I would also like to point out this code:
// LED initializationvoidLED_Configuration() {
SET_OUTPUT(LCD_LED_PIN);
}
It is unused, so chime in if anyone has experience in this area so I can test this properly
Bug Timeline
opened #26552 but the issue was closed without the PR I created being merged
Expected behavior
should not give error for invalid conversion
Actual behavior
gives error for invalid conversion
Steps to Reproduce
make sure you define HAS_DWIN_E3V2 -- i.e. DWIN_LCD_PROUI
inside pins_(YOUR_BOARD).h -- i.e. Marlin\src\pins\stm32f1\pins_CREALITY_V4.h
add #define LCD_LED_PIN EXP3_02_PIN -- or any pin
go to encoder.cpp and you will see the error
Version 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
A ZIP file containing your Configuration.h and Configuration_adv.h.
Additional information & file uploads
No response
I may be able to test this at some point using #26946
The text was updated successfully, but these errors were encountered:
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"
It is apparent that R and G are swapped, generally it should follow RGB, not GRB, and also you see G (or g) shifts 16 bits, not 8 which it is supposed to, as for R (or r) it shifts 8. so basically, these are backwards. 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
I would also like to point out this code:
It is unused, so chime in if anyone has experience in this area so I can test this properly
Bug Timeline
opened #26552 but the issue was closed without the PR I created being merged
Expected behavior
should not give error for invalid conversion
Actual behavior
gives error for invalid conversion
Steps to Reproduce
HAS_DWIN_E3V2
-- i.e.DWIN_LCD_PROUI
#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
I may be able to test this at some point using #26946
The text was updated successfully, but these errors were encountered: