1.电池检测优化

This commit is contained in:
payton 2024-01-04 16:12:59 +08:00
parent 49d8eefe2e
commit 080b5344d3
2 changed files with 8 additions and 2 deletions

View File

@ -562,8 +562,8 @@ void UserMainProc(void)
#endif #endif
/* move adc cal here */ // /* move adc cal here */
system("sh /usr/share/adc/adc.sh"); // system("sh /usr/share/adc/adc.sh");
UserMainProc_Init(); UserMainProc_Init();

View File

@ -180,6 +180,8 @@ UINT32 sf_get_max_value(UINT32 *_ValueList)
} }
void sf_adc_init(void) void sf_adc_init(void)
{ {
/* move adc cal here */
system("sh /usr/share/adc/adc.sh");
if (adc_open(ADC_CH_VOLDET_BATTERY) != 0) { if (adc_open(ADC_CH_VOLDET_BATTERY) != 0) {
SLOGE("Can't open ADC channel for battery voltage detection\r\n"); SLOGE("Can't open ADC channel for battery voltage detection\r\n");
@ -686,7 +688,11 @@ signed int sf_battery_value_fast_get(void)
UIMenuStoreInfo *puiPara = sf_app_ui_para_get(); UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
SINT32 ret = FAIL; SINT32 ret = FAIL;
static UINT8 getBatAdcFlg = 0;
if(getBatAdcFlg)
return SUCCESS;
getBatAdcFlg = 1;
//if((sf_get_mode_flag() == 0) || (needCheckFirst == TRUE)) //if((sf_get_mode_flag() == 0) || (needCheckFirst == TRUE))
{ {
//printf("[%s:%d]ConfigureModeFlag=%d,needCheckFirst=%d\n",__FUNCTION__,__LINE__,sf_get_mode_flag(),needCheckFirst); //printf("[%s:%d]ConfigureModeFlag=%d,needCheckFirst=%d\n",__FUNCTION__,__LINE__,sf_get_mode_flag(),needCheckFirst);