Major UART communication improvement

- the UART communication is improved based on UART Idle line detection interrupt
- an Rx ring buffer is used to manage the UART incoming data
- both Tx and Rx are efficiently handled using DMA
- fixed #1

Other:
- minor visual improvements
This commit is contained in:
EmanuelFeru
2020-06-21 23:09:27 +02:00
parent 9edd22b6b7
commit ee6ab3a886
9 changed files with 273 additions and 185 deletions

View File

@@ -35,14 +35,15 @@
#endif
/* =========================== Defines General =========================== */
// #define _BV(bit) (1 << (bit))
// #define ARRAYNUM(arr_nanme) (uint32_t)(sizeof(arr_nanme) / sizeof(*(arr_nanme)))
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max(a, b) (((a) > (b)) ? (a) : (b))
#define i2c_write i2c_writeBytes
#define i2c_read i2c_readBytes
#define delay_ms HAL_Delay
#define get_ms get_tick_count_ms
// #define _BV(bit) (1 << (bit))
#define ARRAY_LEN(x) (uint32_t)(sizeof(x) / sizeof(*(x)))
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max(a, b) (((a) > (b)) ? (a) : (b))
#define i2c_write i2c_writeBytes
#define i2c_read i2c_readBytes
#define delay_ms HAL_Delay
#define get_ms get_tick_count_ms
#define log_i printf // redirect the log_i debug function to printf
#ifdef BYPASS_CUBEMX_DEFINES
@@ -88,7 +89,6 @@
#endif
/* =========================== Defines MPU-6050 =========================== */
#define log_i printf // redirect the log_i debug function to printf
#define RAD2DEG 57.295779513082323 // RAD2DEG = 180/pi. Example: angle[deg] = angle[rad] * RAD2DEG
#define q30 1073741824 // 1073741824 = 2^30
#define ACCEL_ON (0x01)