piotr022 / UV_K5_playground

425 stars 66 forks source link

[Feature Request] Longer ABR time #63

Open SirioSechi opened 1 year ago

SirioSechi commented 1 year ago

Hi Currently in the menu ABR (settings for the time of the backlignt) is OFF; 1; 2; 3; 4; 5. My proposition is to give more time until 10 seconds, such: OFF; 2; 4; 6; 8; 10.

Thank you.

Tunas1337 commented 1 year ago

@SirioSechi This is now possible with a uvmod-kitchen patch: https://github.com/amnemonic/Quansheng_UV-K5_Firmware/blob/main/uvmod_kitchen/mod_double_abr_values.py

tywtyw2002 commented 1 year ago

The backlight is controlled by following code.

// Enable backlight function.
  uVar1 = ABR_time;
  if (uVar1 != 0) {
    set_bit(&GPIO_PORTB,6);
    uVar1 = ABR_time;
    screen_timer = uVar1 * 2 + 1; //tick seems 0.5s
  }
// turn off backlight, in somewhere of main loop.
      timeleft = screen_timer?;
      screen_timer = timeleft -1;
      if ((timeleft !=0) && screen_timer == 0 ) {
        clear_bit(&GPIO_PORTB,6);
      }

Another possible solution for backlight control is to mask out the turn off code section and create a separate function to handle the backlight's shutdown. In this case, we could get more control for backlight. Such as

SirioSechi commented 12 months ago

Is it possible to integrate it by default in all new versions? I think it is a useful improvement.