cyw43: Reuse buf to reduce stack usage
This commit is contained in:
parent
5220453d85
commit
a75007f5cc
1 changed files with 3 additions and 5 deletions
|
@ -242,13 +242,12 @@ where
|
||||||
cmd,
|
cmd,
|
||||||
iface,
|
iface,
|
||||||
}) => {
|
}) => {
|
||||||
self.send_ioctl(kind, cmd, iface, unsafe { &*iobuf }).await;
|
self.send_ioctl(kind, cmd, iface, unsafe { &*iobuf }, &mut buf).await;
|
||||||
self.check_status(&mut buf).await;
|
self.check_status(&mut buf).await;
|
||||||
}
|
}
|
||||||
Either3::Second(packet) => {
|
Either3::Second(packet) => {
|
||||||
trace!("tx pkt {:02x}", Bytes(&packet[..packet.len().min(48)]));
|
trace!("tx pkt {:02x}", Bytes(&packet[..packet.len().min(48)]));
|
||||||
|
|
||||||
let mut buf = [0; 512];
|
|
||||||
let buf8 = slice8_mut(&mut buf);
|
let buf8 = slice8_mut(&mut buf);
|
||||||
|
|
||||||
// There MUST be 2 bytes of padding between the SDPCM and BDC headers.
|
// There MUST be 2 bytes of padding between the SDPCM and BDC headers.
|
||||||
|
@ -480,9 +479,8 @@ where
|
||||||
self.sdpcm_seq != self.sdpcm_seq_max && self.sdpcm_seq_max.wrapping_sub(self.sdpcm_seq) & 0x80 == 0
|
self.sdpcm_seq != self.sdpcm_seq_max && self.sdpcm_seq_max.wrapping_sub(self.sdpcm_seq) & 0x80 == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn send_ioctl(&mut self, kind: IoctlType, cmd: u32, iface: u32, data: &[u8]) {
|
async fn send_ioctl(&mut self, kind: IoctlType, cmd: u32, iface: u32, data: &[u8], buf: &mut [u32; 512]) {
|
||||||
let mut buf = [0; 512];
|
let buf8 = slice8_mut(buf);
|
||||||
let buf8 = slice8_mut(&mut buf);
|
|
||||||
|
|
||||||
let total_len = SdpcmHeader::SIZE + CdcHeader::SIZE + data.len();
|
let total_len = SdpcmHeader::SIZE + CdcHeader::SIZE + data.len();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue