Can you send a message over UART in a callback function?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2020-12-16 5:27 AM
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
Labels:
- Labels:
-
UART-USART
This discussion is locked. Please start a new topic to ask your question.
0 REPLIES 0
