Fixed bug about auto shutdown.

This commit is contained in:
xiaojiazhu 2023-11-09 14:45:56 +08:00
parent 105521f234
commit 3e1ec06d9c
2 changed files with 14 additions and 1 deletions

View File

@ -376,7 +376,7 @@ UINT32 DrvKey_DetNormalKey(void)
// }
if (gpio_getPin(GPIO_KEY_DATAREADY)) {
uiKeyCode |= FLGKEY_DATAREADY;
// uiKeyCode |= FLGKEY_DATAREADY;
}
#endif
/*
@ -387,6 +387,10 @@ UINT32 DrvKey_DetNormalKey(void)
}
*/
DBG_IND("KEY= %08x\r\n", uiKeyCode);
if (0 != uiKeyCode)
{
sf_set_auto_off_time(0);
}
// DBG_DUMP("KEY= %d\r\n", gpio_getPin(GPIO_KEY_LEFT));
DrvKey_DetKeyDelay();

View File

@ -4,6 +4,7 @@
#include <kwrap/debug.h>
#include "sf_sd_common.h"
#include "sf_commu_mcu_reg.h"
#include "sf_common.h"
/**************************************************************
* static variables
@ -36,6 +37,14 @@ static void task_msgbox_timer_cb(lv_task_t* task)
// LV_PLUGIN_STRING_ID_STRID_PLEASE_INSERT_SD
if(LV_PLUGIN_STRING_ID_STRING_ENTER_WORK == msgID)
{
UINT16 autoOffTime = sf_get_auto_off_time();
if (autoOffTime < 160)
{
lv_task_del(msgbox_timer);
msgbox_timer = NULL;
lv_msgbox_start_auto_close(msgbox, 0);
return;
}
const lv_plugin_string_t* string = lv_plugin_get_string(msgID);
if(string){