Commit 7ef70581 authored by 李俭双's avatar 李俭双

:beetle: fix:更换AD采集驱动文件

parent cb64ff16
......@@ -4,8 +4,9 @@
#include "cgc.h"
#include "gpio.h"
#include "isr.h"
#include "Analog\Analog_Signals.h"
uint8_t u8NewChNum[4] = {2, 3, 7, 5};
// uint8_t u8NewChNum[4] = {2, 3, 7, 5};
void RTC_ADC_Interrupt(void *msg)
{
......@@ -17,6 +18,7 @@ void RTE_ADC_Init(const uint8_t u8ChList[], uint8_t u8ChNum)
{
GPIO_InitTypeDef GPIO_InitStructure = {0};
ADC_InitTypeDef ADC_InitStructure = {0};
if(u8ChNum<=7)
{
......@@ -133,13 +135,13 @@ void RTE_ADC_Get_Conversion_Result(uint16_t *pu16Data, uint8_t u8ChNum)
uint8_t i;
if ((pu16Data != 0U) && (u8ChNum > 0U) && (u8ChNum <= 4U))
if ((pu16Data != 0U) && (u8ChNum > 0U) && (u8ChNum <= ADC_TOTAL_CH_NUMBER))
{
if (RTE_ADC_Get_Conversion_Status() == 0U)
{
for (i = 0U; i < u8ChNum; i++)
{
ADC_Converse(u8NewChNum[i], 1, pu16Data);
ADC_Converse((ADC_Channel_t)u8ADCChList[i], 1, pu16Data);
pu16Data++;
}
}
......
......@@ -4,6 +4,8 @@
#include <stdint.h>
extern const uint8_t u8ADCChList[];
#define ADC_RESOLUTION (4096U) /* 12bit ADC */
extern void RTE_ADC_Init(const uint8_t u8ChList[], uint8_t u8ChNum);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment