/* USER CODE BEGIN 0 */
void myPrintf(const char *p)
{
uint32_t strlength1=0;
uint32_t strlength2=0;
const char *helpStartTextpointer=p;
strlength1=0;
strlength2=strlen(p);
while(*p)
{
strlength1++;
*p++;
}
if (strlength1==strlength2 ){
if(HAL_UART_Transmit_DMA(&huart2, (uint8_t *) helpStartTextpointer, strlength2)!=HAL_OK)
{
Error_Handler();
}
}
}
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc){
adc_value=HAL_ADC_GetValue(&hadc1);
sprintf(buffer,"%d",adc_value);
myPrintf(buffer);
}
/* USER CODE BEGIN 2 */
HAL_TIM_Base_Start(&htim3);
HAL_ADC_Start_IT(&hadc1);
/* USER CODE END 2 */