Skip to content

Commit b3c7363

Browse files
committed
zephyr: uart: Conditionalize irq handling for alloc
Currently, the IRQ handling code requires a SpinMutex which is only available with Arc, which requires allocation. Disable this use of the driver in this situation. Signed-off-by: David Brown <[email protected]>
1 parent 173942a commit b3c7363

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

zephyr/src/device/uart.rs

+3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ use core::ptr;
1313

1414
use super::Unique;
1515

16+
#[cfg(CONFIG_RUST_ALLOC)]
1617
mod irq;
18+
#[cfg(CONFIG_RUST_ALLOC)]
1719
pub use irq::UartIrq;
1820

1921
/// A wrapper around a UART device on Zephyr.
@@ -123,6 +125,7 @@ impl Uart {
123125

124126
/// Convert into an IRQ one. The parameters `WS` and `RS` set the size of the rings for write
125127
/// and read respectively.
128+
#[cfg(CONFIG_RUST_ALLOC)]
126129
pub unsafe fn into_irq<const WS: usize, const RS: usize>(self) -> Result<UartIrq<WS, RS>> {
127130
UartIrq::new(self)
128131
}

0 commit comments

Comments
 (0)