From a6c4135e127ac1d14023101eb364d61fac7e9166 Mon Sep 17 00:00:00 2001 From: yincheng.zhong <634916154@qq.com> Date: 星期二, 06 二月 2024 11:54:15 +0800 Subject: [PATCH] 开发未完成 --- Src/OnChipDevices/ADC.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Src/OnChipDevices/ADC.c b/Src/OnChipDevices/ADC.c index 6c7261a..26863f4 100644 --- a/Src/OnChipDevices/ADC.c +++ b/Src/OnChipDevices/ADC.c @@ -42,12 +42,13 @@ static uint16_t bat_count = 0; if(bat_count++%600==0) { - MX_ADC_Init(); + READC_Init(); + HAL_Delay(30); adc_val = Get_ADC_Value(); MX_ADC_DeInit(); //temp_voltage = (float)Get_ADC_Value()/621; //(value/4096*3.3*2-3.5)/0.7 verfint_cal = *(__IO uint16_t *)(0X1FF80078); - bat_volt = 3*(float)verfint_cal/adc_val; + bat_volt = 3*(float)verfint_cal/adc_val-0.329; if(bat_volt>=3.0) { if(first) -- Gitblit v1.9.3