Exemplo n.º 1
0
void USART1_IRQHandler(void) {
	/* Check if interrupt was because data is received */
	if (USART1->SR & USART_SR_RXNE) {
		#ifdef TM_USART1_USE_CUSTOM_IRQ
			/* Call user function */
			TM_USART1_ReceiveHandler(USART1->DR);
		#else
			/* Put received data into internal buffer */
			TM_USART_INT_InsertToBuffer(&TM_USART1, USART1->DR);
		#endif
	}
}
Exemplo n.º 2
0
void USART1_IRQHandler(void) {
	//Check if interrupt was because data is received
	if (USART_GetITStatus(USART1, USART_IT_RXNE)) {
		#ifdef TM_USART1_USE_CUSTOM_IRQ
			//Call user function
			TM_USART1_ReceiveHandler(USART1->DR);
		#else
			//Put received data into internal buffer
			TM_USART_InsertToBuffer(0, USART1->DR);
		#endif
	}
}
void USART1_IRQHandler(void) {
	/* Check if interrupt was because data is received */
	if (USART1->USART_STATUS_REG & USART_ISR_RXNE) {
#ifdef TM_USART1_USE_CUSTOM_IRQ
		/* Call user function */
		TM_USART1_ReceiveHandler(USART_READ_DATA(USART1));
#else
		/* Put received data into internal buffer */
		TM_USART_INT_InsertToBuffer(&TM_USART1, USART_READ_DATA(USART1));
#endif
	}
	
	/* Clear all USART flags */
	TM_USART_INT_ClearAllFlags(USART1, IRQ_USART1);
}