ADC_DMA in other file than main
Dear everyone,
I'm trying to use ADC in DMA mode, inside other file (a library).
My ADC.H
/*
* ADC.h
*/
#include "stdlib.h"
#include "stdio.h"
#include "string.h"
#include "stm32f1xx_hal.h"
#include "stm32f1xx_hal_conf.h"
//-----------------------------------------
void ADC_init(void);
void ADC_traitement(void);My ADC.C
/*
* ADC.c
*
*/
#include "ADC.h"
extern ADC_HandleTypeDef hadc1;
extern DMA_HandleTypeDef hdma_adc1;
extern volatile uint32_t *pADC_raw_value[14];
//---------------------------------------------------------------
void ADC_init()
{
HAL_ADCEx_Calibration_Start(&hadc1);
HAL_ADC_Start_DMA(&hadc1, &pADC_raw_value, 14);
}
//---------------------------------------------------------------
void ADC_traitement()
{
}
//---------------------------------------------------------------
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
{
ADC_traitement();
}
//----------------------------------------------------------------The code can be compiled without error but i have a question because, in spide of my value is an pointer AND extern, the value "pADC_raw_value[14]" can't be accessible in my main.
The problem is a problem of C language, the miskate could me enormous, i'm tired sorry...
