mirror of
https://github.com/No-Chicken/Power-Pico.git
synced 2026-04-03 13:02:36 +08:00
增加获取电压电流数据的方法
This commit is contained in:
@@ -70,6 +70,8 @@ void MX_ADC1_Init(void);
|
|||||||
|
|
||||||
/* USER CODE BEGIN Prototypes */
|
/* USER CODE BEGIN Prototypes */
|
||||||
|
|
||||||
|
void get_global_val_cur(float *valtage, float *current, uint8_t *cur_unit);
|
||||||
|
|
||||||
/* USER CODE END Prototypes */
|
/* USER CODE END Prototypes */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -193,5 +193,10 @@ void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* USER CODE BEGIN 1 */
|
/* 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 */
|
/* USER CODE END 1 */
|
||||||
|
|||||||
Reference in New Issue
Block a user