more rustfmt-related fixes

This commit is contained in:
bunnie 2024-01-15 00:43:52 +08:00
parent 9b05964e5e
commit 0c50581e9c
4 changed files with 10 additions and 5 deletions

View file

@ -92,7 +92,7 @@ impl LoadedProg {
pio_sm: &mut PioSharedState, pio_sm: &mut PioSharedState,
) -> Result<Self, PioError> { ) -> Result<Self, PioError> {
let offset = pio_sm.add_program(&program)?; let offset = pio_sm.add_program(&program)?;
Ok({ LoadedProg { program, offset: offset as usize, entry_point: None } }) Ok(LoadedProg { program, offset: offset as usize, entry_point: None })
} }
pub fn load_with_entrypoint( pub fn load_with_entrypoint(
@ -101,7 +101,7 @@ impl LoadedProg {
pio_sm: &mut PioSharedState, pio_sm: &mut PioSharedState,
) -> Result<Self, PioError> { ) -> Result<Self, PioError> {
let offset = pio_sm.add_program(&program)?; let offset = pio_sm.add_program(&program)?;
Ok({ LoadedProg { program, offset: offset as usize, entry_point: Some(entry_point) } }) Ok(LoadedProg { program, offset: offset as usize, entry_point: Some(entry_point) })
} }
pub fn entry(&self) -> usize { pub fn entry(&self) -> usize {

View file

@ -85,15 +85,18 @@ pub fn basic_tests(pl230: &mut Pl230) -> bool {
report_api("progress as baseptr[2]", unsafe { cc_struct.channels.as_ptr().read() }.control); report_api("progress as baseptr[2]", unsafe { cc_struct.channels.as_ptr().read() }.control);
timeout += 1; timeout += 1;
} }
#[rustfmt::skip]
unsafe {core::arch::asm!( unsafe {
#[rustfmt::skip]
core::arch::asm!(
".word 0x500F", ".word 0x500F",
"nop", "nop",
"nop", "nop",
"nop", "nop",
"nop", "nop",
"nop", "nop",
); } );
}
// manual flushing, as a sanity check of cache flush if needed // manual flushing, as a sanity check of cache flush if needed
/* /*

View file

@ -170,6 +170,7 @@ fn handle_console_irq(_irq_no: usize, arg: *mut usize) {
pub struct OutputWriter {} pub struct OutputWriter {}
#[allow(dead_code)]
impl OutputWriter { impl OutputWriter {
pub fn putc(&self, c: u8) { pub fn putc(&self, c: u8) {
#[cfg(feature = "cramium-fpga")] #[cfg(feature = "cramium-fpga")]

View file

@ -1,4 +1,5 @@
#![cfg_attr(rustfmt, rustfmt_skip)] // don't format generated files
#![allow(dead_code)] #![allow(dead_code)]
use core::convert::TryInto; use core::convert::TryInto;
#[cfg(feature="std")] #[cfg(feature="std")]