Skip to content

Commit 2344f90

Browse files
committed
refactor(test_runner): use "alternate" hexadecimal formatting
Ditto.
1 parent 00cc2e8 commit 2344f90

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/r3_test_runner/src/targets/jlink.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ impl DebugProbe for Fe310JLinkDebugProbe {
115115
let mut cmd = String::new();
116116
writeln!(cmd, "r").unwrap();
117117
for (path, (_, offset)) in section_files.iter().zip(regions.iter()) {
118-
writeln!(cmd, "loadbin \"{}\" 0x{offset:08x}", path.display()).unwrap();
118+
writeln!(cmd, "loadbin \"{}\" {offset:#08x}", path.display()).unwrap();
119119
}
120-
writeln!(cmd, "setpc 0x{entry:x}").unwrap();
120+
writeln!(cmd, "setpc {entry:#x}").unwrap();
121121
writeln!(cmd, "g").unwrap();
122122
writeln!(cmd, "q").unwrap();
123123

src/r3_test_runner/src/targets/kflash.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl DebugProbe for KflashDebugProbe {
213213
log::debug!("Programming the region {} of {}", i + 1, regions.len());
214214
if region.1 < 0x80000000 {
215215
log::debug!(
216-
"Starting address (0x{:x}) is out of range, ignoreing",
216+
"Starting address ({:#x}) is out of range, ignoreing",
217217
region.1
218218
);
219219
continue;
@@ -222,7 +222,7 @@ impl DebugProbe for KflashDebugProbe {
222222
}
223223

224224
// Boot the program
225-
log::debug!("Booting from 0x{entry:08x}");
225+
log::debug!("Booting from {entry:#08x}");
226226
boot(&mut self.serial, entry as u32).await?;
227227

228228
// Now, pass the channel to the caller
@@ -371,7 +371,7 @@ async fn flash_dataframe(
371371
let chunk_addr = address + (i * CHUNK_LEN) as u32;
372372

373373
log::debug!(
374-
"Programming the range {:?}/{:?} at 0x{chunk_addr:x} ({}%)",
374+
"Programming the range {:?}/{:?} at {chunk_addr:#x} ({}%)",
375375
(i * CHUNK_LEN)..(i * CHUNK_LEN + chunk.len()),
376376
data.len(),
377377
i * CHUNK_LEN * 100 / data.len(),

src/r3_test_runner/src/targets/probe_rs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ pub async fn attach_rtt(
169169
.await
170170
.unwrap();
171171
if let Some(x) = addr {
172-
log::debug!("Found the RTT header at 0x{x:x}");
172+
log::debug!("Found the RTT header at {x:#x}");
173173
probe_rs_rtt::ScanRegion::Exact(x as u32)
174174
} else {
175175
probe_rs_rtt::ScanRegion::Ram

src/r3_test_runner/src/targets/rp_pico.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ async fn program_and_run_by_picoboot(exe: &std::path::Path) -> Result<()> {
233233
log::debug!("Transfering the image");
234234
for (region_data, region_addr) in loadable_code.regions.iter() {
235235
log::debug!(
236-
" ... 0x{region_addr:08x}..=0x{:08x}",
236+
" ... {region_addr:#08x}..={:#08x}",
237237
region_addr + region_data.len() as u64 - 1
238238
);
239239

@@ -261,7 +261,7 @@ async fn program_and_run_by_picoboot(exe: &std::path::Path) -> Result<()> {
261261
}
262262

263263
log::debug!(
264-
"Rebooting RP2040 to start execution at 0x{:08x}",
264+
"Rebooting RP2040 to start execution at {:#08x}",
265265
loadable_code.entry
266266
);
267267

src/r3_test_runner/src/targets/slip.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ enum FrameExtractorAction {
3232

3333
#[derive(thiserror::Error, Debug, Clone, Copy)]
3434
pub enum FrameExtractorProtocolError {
35-
#[error("Expected SLIP escape, got 0x{0:x}")]
35+
#[error("Expected SLIP escape, got {0:#02x}")]
3636
InvalidEscape(u8),
3737
}
3838

@@ -54,7 +54,7 @@ impl FrameExtractorState {
5454
Ok(Some(FrameExtractorAction::StartFrame))
5555
}
5656
_ => {
57-
log::trace!("Ignoring 0x{b:?} outside a frame");
57+
log::trace!("Ignoring {b:#02x} outside a frame");
5858
Ok(None)
5959
}
6060
},

0 commit comments

Comments
 (0)