Skip to content

Commit

Permalink
Exclude interrupt vector table from host build
Browse files Browse the repository at this point in the history
I need a way to exclude the vector table from being linked into the
build script.  Was going to try target_arch = "arm" and realized that
it's possible for the host arch to be "arm" too.

Since the firmware is built with target_os = "none" and the build script
is built on a non-bare-metal system, I went with this as the extra
filter. It seems to be working.
  • Loading branch information
summivox authored and mciantyre committed Aug 21, 2023
1 parent ca7e87b commit c15e2de
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [Unreleased]

Exclude the interrupt vector table when we're building for a target with an
operating system. This ensures you can build imxrt-ral in different contexts,
like build scripts.

## [0.5.2] 2023-08-02

Add missing register fields:
Expand Down
2 changes: 1 addition & 1 deletion raltool/src/generate/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ name."#
}
}

#[cfg(feature = "rt")]
#[cfg(all(feature = "rt", target_os = "none"))]
mod _vectors {
extern "C" {
#(fn #names();)*
Expand Down
2 changes: 1 addition & 1 deletion src/imxrt1011.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
self as u16
}
}
#[cfg(feature = "rt")]
#[cfg(all(feature = "rt", target_os = "none"))]
mod _vectors {
extern "C" {
fn DMA0();
Expand Down
2 changes: 1 addition & 1 deletion src/imxrt1015.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
self as u16
}
}
#[cfg(feature = "rt")]
#[cfg(all(feature = "rt", target_os = "none"))]
mod _vectors {
extern "C" {
fn DMA0_DMA16();
Expand Down
2 changes: 1 addition & 1 deletion src/imxrt1021.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
self as u16
}
}
#[cfg(feature = "rt")]
#[cfg(all(feature = "rt", target_os = "none"))]
mod _vectors {
extern "C" {
fn DMA0_DMA16();
Expand Down
2 changes: 1 addition & 1 deletion src/imxrt1051.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
self as u16
}
}
#[cfg(feature = "rt")]
#[cfg(all(feature = "rt", target_os = "none"))]
mod _vectors {
extern "C" {
fn DMA0_DMA16();
Expand Down
2 changes: 1 addition & 1 deletion src/imxrt1052.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
self as u16
}
}
#[cfg(feature = "rt")]
#[cfg(all(feature = "rt", target_os = "none"))]
mod _vectors {
extern "C" {
fn DMA0_DMA16();
Expand Down
2 changes: 1 addition & 1 deletion src/imxrt1061.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
self as u16
}
}
#[cfg(feature = "rt")]
#[cfg(all(feature = "rt", target_os = "none"))]
mod _vectors {
extern "C" {
fn DMA0_DMA16();
Expand Down
2 changes: 1 addition & 1 deletion src/imxrt1062.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
self as u16
}
}
#[cfg(feature = "rt")]
#[cfg(all(feature = "rt", target_os = "none"))]
mod _vectors {
extern "C" {
fn DMA0_DMA16();
Expand Down
2 changes: 1 addition & 1 deletion src/imxrt1064.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
self as u16
}
}
#[cfg(feature = "rt")]
#[cfg(all(feature = "rt", target_os = "none"))]
mod _vectors {
extern "C" {
fn DMA0_DMA16();
Expand Down
2 changes: 1 addition & 1 deletion src/imxrt1176_cm4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
self as u16
}
}
#[cfg(feature = "rt")]
#[cfg(all(feature = "rt", target_os = "none"))]
mod _vectors {
extern "C" {
fn DMA0_DMA16();
Expand Down
2 changes: 1 addition & 1 deletion src/imxrt1176_cm7.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt {
self as u16
}
}
#[cfg(feature = "rt")]
#[cfg(all(feature = "rt", target_os = "none"))]
mod _vectors {
extern "C" {
fn DMA0_DMA16();
Expand Down

0 comments on commit c15e2de

Please sign in to comment.