Skip to content

Commit

Permalink
修复背光时间
Browse files Browse the repository at this point in the history
  • Loading branch information
losehu committed Sep 22, 2024
1 parent 4bddc2a commit 20ff1f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/si.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ static void light_open() {
if(gEeprom.BACKLIGHT_TIME) {
light_time = (BACKLIGHT_MAP[gEeprom.BACKLIGHT_TIME-1]-1>=0?BACKLIGHT_MAP[gEeprom.BACKLIGHT_TIME-1]-1:0)*500;
BACKLIGHT_TurnOn();
}
}else
BACKLIGHT_TurnOff();

}

void WaitDisplay() {
Expand Down
2 changes: 1 addition & 1 deletion driver/backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void BACKLIGHT_InitHardware() {
PWMPLUS_CFG_COUNTER_EN_BITS_ENABLE |
0;
}
unsigned short BACKLIGHT_MAP[8]={1,11,21,41,121,241,481,0};
unsigned short BACKLIGHT_MAP[7]={11,21,41,121,241,481,0};

void BACKLIGHT_TurnOn(void) {
if (gEeprom.BACKLIGHT_TIME == 0) {
Expand Down
2 changes: 1 addition & 1 deletion driver/backlight.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void BACKLIGHT_TurnOff();
bool BACKLIGHT_IsOn();
void BACKLIGHT_SetBrightness(uint8_t brigtness);
uint8_t BACKLIGHT_GetBrightness(void);
extern unsigned short BACKLIGHT_MAP[8];
extern unsigned short BACKLIGHT_MAP[7];

#endif

0 comments on commit 20ff1f4

Please sign in to comment.