jerpelea commented on code in PR #16466:
URL: https://github.com/apache/nuttx/pull/16466#discussion_r2139921657
##########
include/nuttx/serial/serial.h:
##########
@@ -123,14 +123,25 @@
/* This structure defines one serial I/O buffer.
* The serial infrastructure will initialize the 'sem' field but all other
* fields must be initialized by the caller of uart_register().
+ *
+ * Maximum buffer size is reduced to 8 bits on architectures where 16bit
Review Comment:
I think it would be better to put something more generic in there.
Additionally, I'll copy the comment about the buffer size to help for
USARTn_RX/TXBUFSIZE.
##########
drivers/serial/Kconfig-usart:
##########
@@ -130,13 +132,15 @@ menu "USART1 Configuration"
config USART1_RXBUFSIZE
int "Receive buffer size"
+ default 128 if ARCH_LD_16BIT_NOT_ATOMIC
default 256
Review Comment:
Can be done but that would affect other architectures as well which is
something I wanted to avoid. Also, using 255 feels dangerous when the
underlying type is uint8_t. Might lead to bugs where expression like (x
+ 1 > size) never evaluates to true. Not that I see any such code in
current sources, but if the default value should change for all
architectures, I would rather use 252 out of abundance of caution.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]