mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 16:55:36 +03:00
Fix USART total bytes waiting when tx/rx buffer sizes are not equal.
Avoid using % operator. Allow buffer sizes that are not powers of two.
This commit is contained in:
parent
27ae6fdb72
commit
9b81dea320
2 changed files with 21 additions and 10 deletions
|
@ -17,8 +17,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// FIXME since serial ports can be used for any function these buffer sizes probably need normalising.
|
||||
// Code is optimal when buffer sizes are powers of 2 due to use of % and / operators.
|
||||
// Since serial ports can be used for any function these buffer sizes probably need normalising.
|
||||
#define UART1_RX_BUFFER_SIZE 256
|
||||
#define UART1_TX_BUFFER_SIZE 192
|
||||
#define UART2_RX_BUFFER_SIZE 256
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue