Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "non-standard" interrupts and exceptions #211

Closed
wants to merge 17 commits into from
Closed
Prev Previous commit
Next Next commit
Use riscv_pac macros in example
romancardenas committed Jul 18, 2024
commit 5322a51dcd9c229067ac1089cbc9ab8b4495929e
7 changes: 4 additions & 3 deletions riscv-peripheral/examples/e310x.rs
Original file line number Diff line number Diff line change
@@ -3,9 +3,10 @@
//! peripheral definitions for a target.
use riscv_pac::result::{Error, Result};
use riscv_pac::{ExternalInterruptNumber, HartIdNumber, InterruptNumber, PriorityNumber};
use riscv_pac::{pac_enum, ExternalInterruptNumber};

#[repr(u16)]
#[pac_enum(unsafe HartIdNumber)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum HartId {
H0 = 0,
@@ -31,7 +32,6 @@ unsafe impl HartIdNumber for HartId {
}

#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u16)]
pub enum Interrupt {
WATCHDOG = 1,
RTC = 2,
@@ -108,8 +108,9 @@ unsafe impl InterruptNumber for Interrupt {

unsafe impl ExternalInterruptNumber for Interrupt {}

#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u8)]
#[pac_enum(unsafe PriorityNumber)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum Priority {
P0 = 0,
P1 = 1,