增加获取电压电流数据的方法

This commit is contained in:
不吃油炸鸡
2025-09-15 10:34:40 +08:00
parent a3b9fbbbe7
commit 4591fb2590
2 changed files with 8 additions and 1 deletions

View File

@@ -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

View File

@@ -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 */