diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-11-24 20:58:48 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-11-24 20:58:48 +0100 |
| commit | aaad8450e990f74c6b398aca9a6ec495720bf845 (patch) | |
| tree | 17452428d53110cf07e9ee06ec0c3b372a1dc02f /embassy-nxp | |
| parent | b9408f051080398f38e03f7d0d20bba860213064 (diff) | |
Use inline const for initializing arrays. (#3567)
Diffstat (limited to 'embassy-nxp')
| -rw-r--r-- | embassy-nxp/src/pint.rs | 16 |
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 | ||
| 55 | const NEW_PIN_INTERRUPT: PinInterrupt = PinInterrupt { | ||
| 56 | assigned: false, | ||
| 57 | waker: AtomicWaker::new(), | ||
| 58 | at_fault: false, | ||
| 59 | }; | ||
| 60 | const INTERUPT_COUNT: usize = 8; | 55 | const INTERUPT_COUNT: usize = 8; |
| 61 | static PIN_INTERRUPTS: Mutex<RefCell<[PinInterrupt; INTERUPT_COUNT]>> = | 56 | static 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 | ||
| 64 | fn next_available_interrupt() -> Option<usize> { | 66 | fn next_available_interrupt() -> Option<usize> { |
| 65 | critical_section::with(|cs| { | 67 | critical_section::with(|cs| { |
