uranyumx
Advanced Member level 4
Hello,
I successfully convert analog signals into digital with ADC DMA mode. But when ADC is converting the analog signals, the functions in while loop are not working. It looks like that while loop is not operating. Do you have suggestions about the solution?
I successfully convert analog signals into digital with ADC DMA mode. But when ADC is converting the analog signals, the functions in while loop are not working. It looks like that while loop is not operating. Do you have suggestions about the solution?
Code:
volatile uint8_t convCompleted = 0;
int main(void)
...
HAL_ADC_Start_DMA(&hadc1, (uint32_t*)ADCReadings_Evoked,50000);
while(!convCompleted);
HAL_ADC_Stop_DMA(&hadc1);
while (1)
/* USER CODE BEGIN 3 */
HAL_GPIO_WritePin(Led_GPIO_Port, Led_Pin, GPIO_PIN_RESET);
HAL_Delay(1000);
HAL_GPIO_WritePin(Led_GPIO_Port, Led_Pin, GPIO_PIN_SET);