32 lines
830 B
C
32 lines
830 B
C
/*************************************************************************************************
|
|
**Filename: adc.c
|
|
**Version :
|
|
**Author :
|
|
**Date :
|
|
**Description:
|
|
**
|
|
*************************************************************************************************/
|
|
#include "adc.h"
|
|
#include "mcu_bsp.h"
|
|
#include "gpadc.h"
|
|
/*************************************************************************************************
|
|
* Function Name:
|
|
* Description :
|
|
* Arguments :
|
|
* Return Value :
|
|
*************************************************************************************************/
|
|
uint8_t Get_Battery_Value()
|
|
{
|
|
GPADC_channel_sel(ADCGP_CH);
|
|
GPADC_start(cal_battery_value);
|
|
syd_nosleep((bool)true,SYD_NOSLEEP_ADC);
|
|
if(connect_flag)
|
|
{
|
|
BLE_NotifyBatteryLevel();
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|