Skip to content

Conversation

@RudolphRiedel
Copy link
Contributor

Requirements

Extui Display

Description

This is a fix for the previous pull request, sorry.
This time the code below really is what I entered to be included here.
And of course I tried it before committing it.

Benefits

Prevents a blacked-out display buy making sure the brightness level is at least 1.

Related Issues

None.

@sl1pkn07
Copy link
Contributor

sl1pkn07 commented Apr 22, 2020

ops. sometimes vscode and "cntrl+S" not works together :/

sorry for the noise

value 1 seems is too low with some screens (no backlight). with 11 (with 10 also no backlight) seems is the minimun value

@RudolphRiedel
Copy link
Contributor Author

Do you have an example for a screen that would not turn on the backlight with a value below 11?

@sl1pkn07
Copy link
Contributor

sl1pkn07 commented Apr 22, 2020

i not mean not turn on with value below 11, simply i say the screen is completely dark with 1 to 10 (no ligth, no not possible saw the interface), but with 11 the light is darker, and can able to see the interface

@RudolphRiedel
Copy link
Contributor Author

Same thing - but with what display is that happening?

@sl1pkn07
Copy link
Contributor

sl1pkn07 commented Apr 22, 2020

the fysetc TFT81050 touch eve 5"

@RudolphRiedel
Copy link
Contributor Author

I checked the schematic or the TFT81050 and it uses a MP3202.
I found some bad news for you: "The PWM signal used in Figure 7 should be 1KHz or below due to the soft-start function"
So, the 10kHz fix for the audio output is not really an option for this display.
It obviously works but it may in return shorten the lifetime of the backlight.

My display is using an IS31BL3506A which has in its Datasheet:
"Recommended PWM frequency is in the range of 500Hz ~ 500kHz. So as to guarantee a reasonably good dimming effect, the minimum duty cycle should be about 1%"

Well, if 11 works with this display, go ahead and change the value, I guess a little brighter than the allowable minimum on some displays still is better than ending up with a complete dark backlight for other displays.

@sl1pkn07
Copy link
Contributor

sl1pkn07 commented Apr 22, 2020

sic

tested with the audio defaults, the brightness dimer in this TFT is not a option (for the sound). also the bightness level with 11 is highest than before (more ligth). so, should be back to 1 if work in the most TFT EVE in the market. but not in this

@GerogeFu any troughts?

@thinkyhead thinkyhead merged commit f263787 into MarlinFirmware:bugfix-2.0.x Apr 22, 2020
@RudolphRiedel
Copy link
Contributor Author

Hmm.

screen_data.InterfaceSettingsScreen.brightness = constrain((value * 128UL) / 0xFFFF, 1, 11);

Is this just me or limits this the value to 1...11?
A valid use for constrain() in this context would be with min = 11 and max = 128.
But since the math already limits the upper value to 128, and the max() macro already is in place,
this would be fine: max(11, (value * 128UL) / 0xFFFF);

@sl1pkn07
Copy link
Contributor

sl1pkn07 commented Apr 23, 2020

the brightness dim has been disabled for the fysetc panel so the PWM can be leave to the default, so the level 11 can be rid and set to 1

unles anyone do any for solve the sound problem when dim withour damage the light in near future (by seting the pwm value over the electronics can handle)

greetings

@RudolphRiedel
Copy link
Contributor Author

Just go with: max(11, (value * 128UL) / 0xFFFF);
This is only marginally brighter on my display than 1.

@RudolphRiedel RudolphRiedel deleted the bugfix-2.0.x_extui branch April 23, 2020 14:47
jmp0x0000 pushed a commit to jmp0x0000/Marlin that referenced this pull request Aug 7, 2020
njibhu pushed a commit to njibhu/Marlin that referenced this pull request Aug 24, 2020
HairingX pushed a commit to HairingX/Marlin that referenced this pull request Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants