HAL ADC DMA & UART variable casting question
NUCLEO-F411RE
I have ADC1 to DMA in a circular buffer 4 samples long (ADC_VAL). I then use a TIM1 interrupt to send the contents via UART to a PC.
int16_t ADC_VAL[4];
...
HAL_ADC_STart_DMA(&hadc1, (uint32_t *)ADC_VAL, 4);
/* TIM1 callback */
void HAL_TIM_periodElapsedCallback(TIM_HandleTypeDef *htim)
{
HAL_UART_Transmit(&huart2, (uint8_t *)ADC_VAL, 16, 10);
}
Should I have declared ADC_VAL as a uint32_t ?
