Major UART communication improvement

- the UART communication is improved based on UART Idle line detection interrupt
- both Tx and Rx are efficiently handled using DMA

Other:
- minor visual improvements
This commit is contained in:
EmanuelFeru
2020-06-21 23:07:01 +02:00
parent e9d74bea29
commit 1e7bf7cd90
11 changed files with 312 additions and 183 deletions

View File

@@ -16,6 +16,7 @@
#include "systick.h"
#include "i2c_it.h"
#include "config.h"
#include "util.h"
/*!
\brief this function handles NMI exception
@@ -121,6 +122,20 @@ void SysTick_Handler(void)
delay_decrement();
}
/*!
\brief this function handles the USART1 interrupt request
\param[in] none
\param[out] none
\retval none
*/
void USART1_IRQHandler(void)
{
if(RESET != usart_interrupt_flag_get(USART1, USART_INT_FLAG_IDLE)) { // Check for IDLE line interrupt
usart_flag_clear(USART1, USART_FLAG_IDLE); // Clear IDLE line flag (otherwise it will continue to enter interrupt)
usart_rx_check(); // Check for data to process
}
}
/*!
\brief this function handles I2C0 event interrupt request exception
\param[in] none