aboutsummaryrefslogtreecommitdiff
path: root/embassy-nxp/src
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-11-24 20:58:48 +0100
committerGitHub <[email protected]>2024-11-24 20:58:48 +0100
commitaaad8450e990f74c6b398aca9a6ec495720bf845 (patch)
tree17452428d53110cf07e9ee06ec0c3b372a1dc02f /embassy-nxp/src
parentb9408f051080398f38e03f7d0d20bba860213064 (diff)
Use inline const for initializing arrays. (#3567)
Diffstat (limited to 'embassy-nxp/src')
-rw-r--r--embassy-nxp/src/pint.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/embassy-nxp/src/pint.rs b/embassy-nxp/src/pint.rs
index 3313f91a6..809be4bff 100644
--- a/embassy-nxp/src/pint.rs
+++ b/embassy-nxp/src/pint.rs
@@ -52,14 +52,16 @@ impl PinInterrupt {
52 } 52 }
53} 53}
54 54
55const NEW_PIN_INTERRUPT: PinInterrupt = PinInterrupt {
56 assigned: false,
57 waker: AtomicWaker::new(),
58 at_fault: false,
59};
60const INTERUPT_COUNT: usize = 8; 55const INTERUPT_COUNT: usize = 8;
61static PIN_INTERRUPTS: Mutex<RefCell<[PinInterrupt; INTERUPT_COUNT]>> = 56static PIN_INTERRUPTS: Mutex<RefCell<[PinInterrupt; INTERUPT_COUNT]>> = Mutex::new(RefCell::new(
62 Mutex::new(RefCell::new([NEW_PIN_INTERRUPT; INTERUPT_COUNT])); 57 [const {
58 PinInterrupt {
59 assigned: false,
60 waker: AtomicWaker::new(),
61 at_fault: false,
62 }
63 }; INTERUPT_COUNT],
64));
63 65
64fn next_available_interrupt() -> Option<usize> { 66fn next_available_interrupt() -> Option<usize> {
65 critical_section::with(|cs| { 67 critical_section::with(|cs| {