cdc_acm uart_fifo_fill sample app doesn't comply with the documentation #11455
The documentation in
This function is expected to be called from UART interrupt handler (ISR), if uart_irq_tx_ready() returns true. Result of calling this function not from an ISR is undefined (hardware-dependent). Likewise, not calling this function from an ISR if uart_irq_tx_ready() returns true may lead to undefined behavior, e.g. infinite interrupt loops.
Yet the USB CDC ACM sample app doesn't do this:
Assuming the documentation is correct, writing non-compliant sample apps confuses beginners and lead to bad code.
Same applies to uart_fifo_read.
Please correct the sample app.
@kulve the UART API documentation only applies to real, physical UARTs. Here we are using the UART API to interface with a virtual UART. What we can do is send a PR to the UART documentation that explicitly states that the calling contexts are not applicable for virtual UARTs. Would you like to give it a go and send a PR?