Currently the return value of write is broken, it never returns the

previous frame even when present.

This happens because a slice of length 64 is always passed to Frame::new
from within the `abort_pending_mailbox` function, causing `Frame::new`
to return None.

The fix is to take a subslice of length `data_length`.
This commit is contained in:
Hans Josephsen 2024-09-22 12:30:38 +02:00
parent 233905e18c
commit e2d2b0f362
2 changed files with 2 additions and 1 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ Cargo.lock
third_party
/Cargo.toml
out/
.zed

View File

@ -200,7 +200,7 @@ impl Registers {
if header_reg.rtr().bit() {
F::new_remote(id, len as usize)
} else {
F::new(id, &data)
F::new(id, &data[0..(len as usize)])
}
} else {
// Abort request failed because the frame was already sent (or being sent) on