When using Rx interrupt, I transmit the data to another place via SPI during the interrupt. However, while this process occurs when there is a delay in the main loop, the process does not occur when there is no delay in the main loop.
What would be the reason?
Kind regards
void HAL_UARTEx_RxEventCallback(UART_HandleTypeDef *huart, uint16_t Size){
HAL_UARTEx_ReceiveToIdle_IT(&huart3, RxBuffer,RxBufferSize);
size1=Size;
send(1,RxBuffer,size1);
}
while (1)
{
if(getSn_SR(1)==SOCK_ESTABLISHED){
if((size = getSn_RX_RSR(1)) > 0){
recv(1, TxBuffer, size);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1,GPIO_PIN_SET);
HAL_UART_Transmit_DMA(&huart3, TxBuffer,size);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1,GPIO_PIN_RESET);
size=0;}}
// HAL_Delay(100);
}
When it enters the interface, I want it to return to the main loop without doing the operation there and I want to give priority to that side.