Merge pull request #4252 from kpfleming/assert-empty-buffer-buffereduart

stm32: Assert in BufferedUart that the buffers are not empty.
This commit is contained in:
Dario Nieuwenhuis 2025-05-27 15:17:29 +00:00 committed by GitHub
commit aab043b0f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -457,8 +457,10 @@ impl<'d> BufferedUart<'d> {
info.rcc.enable_and_reset();
assert!(!tx_buffer.is_empty());
let len = tx_buffer.len();
unsafe { state.tx_buf.init(tx_buffer.as_mut_ptr(), len) };
assert!(!rx_buffer.is_empty());
let len = rx_buffer.len();
unsafe { state.rx_buf.init(rx_buffer.as_mut_ptr(), len) };