diff --git a/drv/lpc55-gpio/src/main.rs b/drv/lpc55-gpio/src/main.rs index 03fb031af7..8957477320 100644 --- a/drv/lpc55-gpio/src/main.rs +++ b/drv/lpc55-gpio/src/main.rs @@ -55,7 +55,7 @@ struct ServerImpl<'a> { inputmux: &'a device::inputmux::RegisterBlock, } -impl ServerImpl <'_> { +impl ServerImpl<'_> { fn set_pin_direction(&self, port: usize, pin: usize, dir: Direction) { match dir { Direction::Input => self.gpio.dirclr[port] @@ -64,7 +64,6 @@ impl ServerImpl <'_> { .write(|w| unsafe { w.dirsetp().bits(1 << pin) }), } } - } impl idl::InOrderPinsImpl for ServerImpl<'_> { @@ -174,7 +173,8 @@ impl idl::InOrderPinsImpl for ServerImpl<'_> { syscon.enable_clock(Peripheral::Mux); syscon.leave_reset(Peripheral::Mux); unsafe { - self.inputmux.pintsel[pint_slot as usize].write(|w| w.bits(pin as u32)); + self.inputmux.pintsel[pint_slot as usize] + .write(|w| w.bits(pin as u32)); } syscon.disable_clock(Peripheral::Mux); @@ -289,7 +289,6 @@ impl idl::InOrderPinsImpl for ServerImpl<'_> { let status = self.pint.ist.read().bits() & pint_mask; Ok(status) } - } impl NotificationHandler for ServerImpl<'_> { diff --git a/drv/lpc55-sprot-server/src/main.rs b/drv/lpc55-sprot-server/src/main.rs index dbf7f94b50..db56a0f88a 100644 --- a/drv/lpc55-sprot-server/src/main.rs +++ b/drv/lpc55-sprot-server/src/main.rs @@ -56,9 +56,7 @@ use drv_sprot_api::{ }; use lpc55_pac as device; use ringbuf::{ringbuf, ringbuf_entry}; -use userlib::{ - sys_irq_control, sys_recv_notification, task_slot, UnwrapLite, -}; +use userlib::{sys_irq_control, sys_recv_notification, task_slot, UnwrapLite}; mod handler; diff --git a/task/button-api/src/lib.rs b/task/button-api/src/lib.rs index 8914a49983..9a0e2d1f7a 100644 --- a/task/button-api/src/lib.rs +++ b/task/button-api/src/lib.rs @@ -6,8 +6,8 @@ #![no_std] -use userlib::{sys_send, FromPrimitive}; use derive_idol_err::IdolError; +use userlib::{sys_send, FromPrimitive}; #[derive(Copy, Clone, Debug, FromPrimitive, IdolError, counters::Count)] pub enum ButtonError { diff --git a/task/button/build.rs b/task/button/build.rs index a62e30c36b..1127157906 100644 --- a/task/button/build.rs +++ b/task/button/build.rs @@ -3,8 +3,8 @@ // file, You can obtain one at https://mozilla.org/MPL/2.0/. use anyhow::Result; -use idol::{server::ServerStyle, CounterSettings}; use build_lpc55pins::PinConfig; +use idol::{server::ServerStyle, CounterSettings}; use serde::Deserialize; #[derive(Deserialize)] diff --git a/task/button/src/main.rs b/task/button/src/main.rs index 7ade1a96af..1db0316639 100644 --- a/task/button/src/main.rs +++ b/task/button/src/main.rs @@ -21,7 +21,9 @@ use idol_runtime::{ // use serde::Deserialize; // use zerocopy::AsBytes; use crate::idl::INCOMING_SIZE; -use userlib::{set_timer_relative, sys_set_timer, task_slot, UnwrapLite, sys_irq_control}; +use userlib::{ + set_timer_relative, sys_irq_control, sys_set_timer, task_slot, UnwrapLite, +}; // Time is in approximate ms const ON_DELAY: u32 = 1 * 1000; @@ -222,9 +224,6 @@ impl NotificationHandler for ButtonServer { #[export_name = "main"] fn main() -> ! { - // XXX Safety, if all else fails, then waiting a minute longer after reset - // may help us get a debugger in there. - // hl::sleep_for(60000); let mut buffer = [0u8; INCOMING_SIZE]; let gpio_driver = GPIO.get_task_id(); diff --git a/task/hiffy/src/lpc55.rs b/task/hiffy/src/lpc55.rs index b202cd7eeb..ea6d4f0e2d 100644 --- a/task/hiffy/src/lpc55.rs +++ b/task/hiffy/src/lpc55.rs @@ -244,7 +244,16 @@ fn gpio_configure( let task = GPIO.get_task_id(); let gpio = drv_lpc55_gpio_api::Pins::from(task); - gpio.iocon_configure(pin, alt, mode, slew, invert, digimode, opendrain, PintSlot::None); + gpio.iocon_configure( + pin, + alt, + mode, + slew, + invert, + digimode, + opendrain, + PintSlot::None, + ); Ok(0) }