rustfmt...

This commit is contained in:
i509VCB 2025-03-13 22:26:06 -05:00
parent e0cdc356cc
commit 9531b7422b
No known key found for this signature in database
GPG Key ID: 3E860D038915EF88
4 changed files with 18 additions and 52 deletions

View File

@ -107,11 +107,7 @@ fn generate_code() {
}
// Generate timers
for peripheral in METADATA
.peripherals
.iter()
.filter(|p| p.name.starts_with("TIM"))
{
for peripheral in METADATA.peripherals.iter().filter(|p| p.name.starts_with("TIM")) {
let name = Ident::new(&peripheral.name, Span::call_site());
let timers = &*TIMERS;
@ -225,8 +221,7 @@ fn time_driver(singletons: &[String], cfgs: &mut CfgSet) {
// TODO: 32-bit timers are not considered yet
[
// 16-bit, 2 channel
"TIMG0", "TIMG1", "TIMG2", "TIMG3",
// 16-bit, 2 channel with shadow registers
"TIMG0", "TIMG1", "TIMG2", "TIMG3", // 16-bit, 2 channel with shadow registers
"TIMG4", "TIMG5", "TIMG6", "TIMG7", // 16-bit, 4 channel
"TIMG14", // 16-bit with QEI
"TIMG8", "TIMG9", "TIMG10", "TIMG11", // Advanced timers

View File

@ -7,13 +7,12 @@ use core::task::{Context, Poll};
use embassy_hal_internal::{impl_peripheral, into_ref, Peripheral, PeripheralRef};
use embassy_sync::waitqueue::AtomicWaker;
use crate::pac::gpio::vals::*;
use crate::pac::gpio::{self};
#[cfg(all(feature = "rt", feature = "mspm0c110x"))]
use crate::pac::interrupt;
use crate::pac::{
self,
gpio::{self, vals::*},
};
use crate::pac::{self};
/// Represents a digital input or output level.
#[derive(Debug, Eq, PartialEq, Clone, Copy)]
@ -88,9 +87,7 @@ impl<'d> Flex<'d> {
into_ref!(pin);
// Pin will be in disconnected state.
Self {
pin: pin.map_into(),
}
Self { pin: pin.map_into() }
}
/// Set the pin's pull.
@ -974,14 +971,7 @@ impl<'d> Future for InputFuture<'d> {
waker.register(cx.waker());
// The interrupt handler will mask the interrupt if the event has occurred.
if self
.pin
.block()
.cpu_int()
.ris()
.read()
.dio(self.pin.bit_index())
{
if self.pin.block().cpu_int().ris().read().dio(self.pin.bit_index()) {
return Poll::Ready(());
}

View File

@ -1,10 +1,6 @@
#![no_std]
// Doc feature labels can be tested locally by running RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc
#![cfg_attr(
docsrs,
feature(doc_auto_cfg, doc_cfg_hide),
doc(cfg_hide(doc, docsrs))
)]
#![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg_hide), doc(cfg_hide(doc, docsrs)))]
// This mod MUST go first, so that the others see its macros.
pub(crate) mod fmt;
@ -40,6 +36,7 @@ pub(crate) mod _generated {
}
// Reexports
pub(crate) use _generated::gpio_pincm;
pub use _generated::{peripherals, Peripherals};
pub use embassy_hal_internal::{into_ref, Peripheral, PeripheralRef};
#[cfg(feature = "unstable-pac")]
@ -48,8 +45,6 @@ pub use mspm0_metapac as pac;
pub(crate) use mspm0_metapac as pac;
pub use crate::_generated::interrupt;
pub(crate) use _generated::gpio_pincm;
/// `embassy-mspm0` global configuration.
#[non_exhaustive]

View File

@ -1,19 +1,13 @@
use core::{
cell::{Cell, RefCell},
sync::atomic::{compiler_fence, AtomicU32, Ordering},
task::Waker,
};
use core::cell::{Cell, RefCell};
use core::sync::atomic::{compiler_fence, AtomicU32, Ordering};
use core::task::Waker;
use critical_section::{CriticalSection, Mutex};
use embassy_time_driver::Driver;
use embassy_time_queue_utils::Queue;
use mspm0_metapac::{
interrupt,
tim::{
vals::{Cm, Cvae, CxC, EvtCfg, PwrenKey, Ratio, Repeat, ResetKey},
Counterregs16, Tim,
},
};
use mspm0_metapac::interrupt;
use mspm0_metapac::tim::vals::{Cm, Cvae, CxC, EvtCfg, PwrenKey, Ratio, Repeat, ResetKey};
use mspm0_metapac::tim::{Counterregs16, Tim};
use crate::peripherals;
use crate::timer::SealedTimer;
@ -244,18 +238,10 @@ impl TimxDriver {
}
fn trigger_alarm(&self, cs: CriticalSection) {
let mut next = self
.queue
.borrow(cs)
.borrow_mut()
.next_expiration(self.now());
let mut next = self.queue.borrow(cs).borrow_mut().next_expiration(self.now());
while !self.set_alarm(cs, next) {
next = self
.queue
.borrow(cs)
.borrow_mut()
.next_expiration(self.now());
next = self.queue.borrow(cs).borrow_mut().next_expiration(self.now());
}
}