From 6b2c3f5b16deae334928cbedf3bb3cc9467bee84 Mon Sep 17 00:00:00 2001 From: Brandon Ros Date: Tue, 22 Aug 2023 18:55:21 -0400 Subject: [PATCH] get rid of logs that work for defmt but not ci --- cyw43/src/bluetooth.rs | 22 +++------------------- cyw43/src/bus.rs | 9 ++------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/cyw43/src/bluetooth.rs b/cyw43/src/bluetooth.rs index 0289ff2a..20c99beb 100644 --- a/cyw43/src/bluetooth.rs +++ b/cyw43/src/bluetooth.rs @@ -25,15 +25,6 @@ pub(crate) async fn upload_bluetooth_firmware( for (index, &(dest_addr, num_fw_bytes)) in firmware_offsets.iter().enumerate() { let fw_bytes = &firmware[(fw_bytes_pointer)..(fw_bytes_pointer + num_fw_bytes)]; assert!(fw_bytes.len() == num_fw_bytes); - debug!( - "index = {}/{} dest_addr = {:08x} num_fw_bytes = {} fw_bytes_pointer = {} fw_bytes = {:02x}", - index, - firmware_offsets.len(), - dest_addr, - num_fw_bytes, - fw_bytes_pointer, - fw_bytes - ); let mut dest_start_addr = dest_addr; let mut aligned_data_buffer_index: usize = 0; // pad start @@ -42,10 +33,6 @@ pub(crate) async fn upload_bluetooth_firmware( let padded_dest_start_addr = round_down(dest_start_addr, 4); let memory_value = bus.bp_read32(padded_dest_start_addr).await; let memory_value_bytes = memory_value.to_le_bytes(); // TODO: le or be - debug!( - "pad start padded_dest_start_addr = {:08x} memory_value_bytes = {:02x}", - padded_dest_start_addr, memory_value_bytes - ); // Copy the previous memory value's bytes to the start for i in 0..num_pad_bytes as usize { aligned_data_buffer[aligned_data_buffer_index] = memory_value_bytes[i]; @@ -72,10 +59,6 @@ pub(crate) async fn upload_bluetooth_firmware( let padded_dest_end_addr = round_down(dest_end_addr, 4); let memory_value = bus.bp_read32(padded_dest_end_addr).await; let memory_value_bytes = memory_value.to_le_bytes(); // TODO: le or be - debug!( - "pad end padded_dest_end_addr = {:08x} memory_value_bytes = {:02x}", - padded_dest_end_addr, memory_value_bytes - ); // Append the necessary memory bytes to pad the end of aligned_data_buffer for i in offset..4 { aligned_data_buffer[aligned_data_buffer_index] = memory_value_bytes[i as usize]; @@ -86,11 +69,10 @@ pub(crate) async fn upload_bluetooth_firmware( // pad end alignment not needed } let buffer_to_write = &aligned_data_buffer[0..aligned_data_buffer_index as usize]; - //debug!("upload_bluetooth_firmware: dest_start_addr = {:x} dest_end_addr = {:x} aligned_data_buffer_index = {} buffer_to_write = {:02x}", dest_start_addr, dest_end_addr, aligned_data_buffer_index, buffer_to_write); assert!(dest_start_addr % 4 == 0); assert!(dest_end_addr % 4 == 0); assert!(aligned_data_buffer_index % 4 == 0); - // write in 0x40 chunks TODO: is this needed + // write in 0x40 chunks TODO: is this needed or can we write straight away let chunk_size = 0x40; for (i, chunk) in buffer_to_write.chunks(chunk_size).enumerate() { let offset = i * chunk_size; @@ -144,6 +126,7 @@ pub(crate) async fn bt_set_host_ready(bus: &mu } // TODO: use this +#[allow(dead_code)] pub(crate) async fn bt_set_awake(bus: &mut Bus) { debug!("bt_set_awake"); let old_val = bus.bp_read32(HOST_CTRL_REG_ADDR).await; @@ -161,6 +144,7 @@ pub(crate) async fn bt_toggle_intr(bus: &mut B } // TODO: use this +#[allow(dead_code)] pub(crate) async fn bt_set_intr(bus: &mut Bus) { debug!("bt_set_intr"); let old_val = bus.bp_read32(HOST_CTRL_REG_ADDR).await; diff --git a/cyw43/src/bus.rs b/cyw43/src/bus.rs index b08063a0..689f73ac 100644 --- a/cyw43/src/bus.rs +++ b/cyw43/src/bus.rs @@ -274,7 +274,7 @@ where async fn backplane_set_window(&mut self, addr: u32) { let new_window = addr & !BACKPLANE_ADDRESS_MASK; - + if new_window == self.backplane_window { return; } @@ -340,12 +340,7 @@ where let len = if func == FUNC_BACKPLANE { 2 } else { 1 }; self.status = self.spi.cmd_read(cmd, &mut buf[..len]).await; - - debug!( - "readn cmd = {:08x} addr = {:08x} len = {} buf = {:08x}", - cmd, addr, len, buf - ); - + // if we read from the backplane, the result is in the second word, after the response delay if func == FUNC_BACKPLANE { buf[1]