From 3a1d2b7f90b4003f454e8516b141b38c3c883a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=90=83=E6=B2=B9=E7=82=B8=E9=B8=A1?= <1425962791@qq.com> Date: Wed, 25 Mar 2026 15:59:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AC=A6=E5=8F=B7bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- software/Power_Pico/Core/Src/adc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/software/Power_Pico/Core/Src/adc.c b/software/Power_Pico/Core/Src/adc.c index 9ed1be6..2fe6769 100644 --- a/software/Power_Pico/Core/Src/adc.c +++ b/software/Power_Pico/Core/Src/adc.c @@ -231,16 +231,16 @@ static void Data_Monitor_Update(uint16_t vol_adc, uint16_t cur_adc, uint16_t ref // 2. 计算电流 (单位: 10nA) // I_uA = ADC_Value * SCALE_XXX // I_10nA = I_uA * 100 - uint64_t current_10na = 0; + int64_t current_10na = 0; switch (range) { case LOW_CUR: - current_10na = (uint64_t)((float)(cur_adc-ref_adc) * SCALE_LOW * 100.0f); + current_10na = (int64_t)((float)(cur_adc-ref_adc) * SCALE_LOW * 100.0f); break; case MID_CUR: - current_10na = (uint64_t)((float)(cur_adc-ref_adc) * SCALE_MID * 100.0f); + current_10na = (int64_t)((float)(cur_adc-ref_adc) * SCALE_MID * 100.0f); break; case HIGH_CUR: - current_10na = (uint64_t)((float)(cur_adc-ref_adc) * SCALE_HIGH * 100.0f); + current_10na = (int64_t)((float)(cur_adc-ref_adc) * SCALE_HIGH * 100.0f); break; }