Hello having some troubles with arrays and functions. I want to have a function that can take arrays of variable length. Using the code below i get an error telling me: “mismatched types [E0308]:
expected &[u8], found array of 5 elements”
Calling the function:
let data: [u8; 5] = [0x0a, 0x00, 0x00, 0x00, 0x00]; let mut retdata: [u8; 5]; spi1sendreceive(data, retdata, 5);
fn spi1sendreceive(data: &[u8], ret: &mut [u8], len: u8 )
Any pointers to how to solve this would be welcome.