diff --git a/Power_Pico/Core/Inc/adc.h b/Power_Pico/Core/Inc/adc.h index 9b9b77c..cd2cc96 100644 --- a/Power_Pico/Core/Inc/adc.h +++ b/Power_Pico/Core/Inc/adc.h @@ -70,6 +70,8 @@ void MX_ADC1_Init(void); /* USER CODE BEGIN Prototypes */ +void get_global_val_cur(float *valtage, float *current, uint8_t *cur_unit); + /* USER CODE END Prototypes */ #ifdef __cplusplus diff --git a/Power_Pico/Core/Src/adc.c b/Power_Pico/Core/Src/adc.c index eb05476..867d576 100644 --- a/Power_Pico/Core/Src/adc.c +++ b/Power_Pico/Core/Src/adc.c @@ -193,5 +193,10 @@ void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle) } /* USER CODE BEGIN 1 */ - +void get_global_val_cur(float *valtage, float *current, uint8_t *cur_unit) +{ + *valtage = global_valtage; + *current = global_current; + *cur_unit = global_cur_unit; +} /* USER CODE END 1 */