Skip to content

Commit

Permalink
fix deps
Browse files Browse the repository at this point in the history
  • Loading branch information
playfulFence committed Aug 1, 2024
1 parent 2ee1763 commit ce2377f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
6 changes: 3 additions & 3 deletions esp-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ xtensa-lx = { version = "0.9.0", optional = true }
# corresponding feature.
esp32 = { version = "0.32.0", features = ["critical-section", "rt"], optional = true }
esp32c2 = { version = "0.21.0", features = ["critical-section", "rt"], optional = true }
esp32c3 = { path = "../../esp-pacs/esp32c3", features = ["critical-section", "rt"], optional = true }
esp32c6 = { path = "../../esp-pacs/esp32c6", features = ["critical-section", "rt"], optional = true }
esp32c3 = { version = "0.24.0", features = ["critical-section", "rt"], optional = true }
esp32c6 = { version = "0.15.0", features = ["critical-section", "rt"], optional = true }
esp32h2 = { version = "0.11.0", features = ["critical-section", "rt"], optional = true }
esp32s2 = { version = "0.23.0", features = ["critical-section", "rt"], optional = true }
esp32s3 = { path = "../../esp-pacs/esp32s3", features = ["critical-section", "rt"], optional = true }
esp32s3 = { version = "0.27.0", features = ["critical-section", "rt"], optional = true }

[target.'cfg(target_arch = "riscv32")'.dependencies]
esp-riscv-rt = { version = "0.9.0", path = "../esp-riscv-rt" }
Expand Down
21 changes: 16 additions & 5 deletions esp-hal/src/interrupt/riscv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,10 @@ mod classic {
/// priority of interrupts 1 - 15.
pub unsafe fn set_priority(_core: Cpu, which: CpuInterrupt, priority: Priority) {
let intr = &*crate::peripherals::INTERRUPT_CORE0::PTR;
intr.cpu_int_pri(which as usize).read().map().bits(priority as u32);
intr.cpu_int_pri(which as usize)
.read()
.map()
.bits(priority as u32);
}

/// Clear a CPU interrupt
Expand All @@ -596,7 +599,9 @@ mod classic {
#[inline]
pub(super) unsafe extern "C" fn get_priority(cpu_interrupt: CpuInterrupt) -> Priority {
let intr = &*crate::peripherals::INTERRUPT_CORE0::PTR;
core::mem::transmute::<u8, Priority>(intr.cpu_int_pri(cpu_interrupt as usize).read().map().bits())
core::mem::transmute::<u8, Priority>(
intr.cpu_int_pri(cpu_interrupt as usize).read().map().bits(),
)
}
#[no_mangle]
#[link_section = ".trap"]
Expand Down Expand Up @@ -725,7 +730,11 @@ mod plic {
#[inline]
pub(super) unsafe extern "C" fn get_priority(cpu_interrupt: CpuInterrupt) -> Priority {
let plic = &*crate::peripherals::PLIC_MX::PTR;
let prio = plic.mxint_pri(cpu_interrupt as usize).read().cpu_mxint_pri().bits();
let prio = plic
.mxint_pri(cpu_interrupt as usize)
.read()
.cpu_mxint_pri()
.bits();
core::mem::transmute::<u8, Priority>(prio as u8)
}
#[no_mangle]
Expand All @@ -740,7 +749,8 @@ mod plic {
let prev_interrupt_priority = plic.mxint_thresh().read().cpu_mxint_thresh().bits();
if interrupt_priority < 15 {
// leave interrupts disabled if interrupt is of max priority.
plic.mxint_thresh().write(|w| w.cpu_mxint_thresh().bits(interrupt_priority + 1));
plic.mxint_thresh()
.write(|w| w.cpu_mxint_thresh().bits(interrupt_priority + 1));
unsafe {
riscv::interrupt::enable();
}
Expand All @@ -752,7 +762,8 @@ mod plic {
pub(super) unsafe extern "C" fn _restore_priority(stored_prio: u32) {
riscv::interrupt::disable();
let plic = &*crate::peripherals::PLIC_MX::PTR;
plic.mxint_thresh().write(|w| w.cpu_mxint_thresh().bits(stored_prio as u8));
plic.mxint_thresh()
.write(|w| w.cpu_mxint_thresh().bits(stored_prio as u8));
}
}

Expand Down

0 comments on commit ce2377f

Please sign in to comment.