1.优化插入usb后电池检测
This commit is contained in:
parent
17e4f3c679
commit
3fa420de0c
|
@ -931,7 +931,11 @@ THREAD_RETTYPE sf_battery_check_thread(void *arg)
|
|||
{
|
||||
THREAD_ENTRY();
|
||||
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
||||
|
||||
if(sf_is_usb_flag()){
|
||||
printf("[%s:%d]usb power\n", __FUNCTION__, __LINE__);
|
||||
THREAD_RETURN(0);
|
||||
}
|
||||
else {
|
||||
if(sf_is_battery_low(1, 0) == TRUE)
|
||||
{
|
||||
printf("[%s:%d]power off because low battery\n", __FUNCTION__, __LINE__);
|
||||
|
@ -956,6 +960,7 @@ THREAD_RETTYPE sf_battery_check_thread(void *arg)
|
|||
printf("[%s:%d] e \n", __FUNCTION__, __LINE__);
|
||||
THREAD_RETURN(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void sf_battery_thread_init(void)
|
||||
|
@ -971,7 +976,7 @@ void sf_battery_thread_init(void)
|
|||
|
||||
vos_flag_create(&FLG_ID_SF_BSTTERY, NULL, "FLG_ID_SF_BSTTERY");
|
||||
/*thread creat*/
|
||||
s_handle_batt = vos_task_create(sf_battery_check_thread, NULL, "sf_battery_check_thread", 18, 2048);
|
||||
s_handle_batt = vos_task_create(sf_battery_check_thread, NULL, "sf_battery_check_thread", 18, 4096);
|
||||
vos_task_resume(s_handle_batt);
|
||||
printf("[%s:%d] e\n", __FUNCTION__, __LINE__);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user