cancel
Showing results for 
Search instead for 
Did you mean: 

Can you send a message over UART in a callback function?

JAlle.2
Associate II

I am implementing the conversion complete callback function for the ADC and am trying to send a message over UART when this completes. However, it does not seem to want to work. I have independently verified that both the callback function is being called and the send_message function works correctly. I am using the CubeIDE to generate code for me. Take a look at the code below

void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)

{

send_message((uint8_t*)"Hello there");

}

void send_message(uint8_t* message)

{

HAL_UART_Transmit(&huart1, message, strlen((char*)message), 1000);

}

Any help is much appreciated. Thanks

0 REPLIES 0