Skip to content

Commit

Permalink
zephyr: uart: Conditionalize irq handling for alloc
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
d3zd3z committed Dec 11, 2024
1 parent 173942a commit b3c7363
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions zephyr/src/device/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ use core::ptr;

use super::Unique;

#[cfg(CONFIG_RUST_ALLOC)]
mod irq;
#[cfg(CONFIG_RUST_ALLOC)]
pub use irq::UartIrq;

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

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

0 comments on commit b3c7363

Please sign in to comment.