#define ADC_BUF_LEN 12000
void myprintf(const char *fmt, ...) {
static char buffer[ADC_BUF_LEN];
va_list args;
va_start(args, fmt);
vsnprintf(buffer, sizeof(buffer), fmt, args);
va_end(args);
int len = strlen(buffer);
HAL_UART_Transmit(&huart2, (uint64_t*)buffer, len, -1);
}
HAL_ADC_Start_DMA(&hadc1, (uint16_t*)adc_buf, ADC_BUF_LEN);
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) {
for (int i = 0; i < ADC_BUF_LEN; ) {
myprintf("%i\r\n", adc_buf[i]);
i++;
}