Skip to content

Commit 7c16a62

Browse files
committed
Rework Interrupt enum for MSP430
This also removes the `bare-metal` dependency from PACs created for MSP430, as requested in #455 (comment) Signed-off-by: Daniel Egger <[email protected]>
1 parent 3d1d618 commit 7c16a62

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2828
use the `msp430_rt::interrupt` attribute macro and `device.x` for interrupt
2929
support. The `INTERRUPT` array has been renamed `__INTERRUPT`.
3030

31+
- Documented the nature of the `Interrupt` enum on MSP430 and consequently
32+
removed all use of `bare-metal` from that architecture
33+
3134
- Don't generate pre Edition 2018 `extern crate` statements anymore
3235

3336
## [v0.17.0] - 2019-12-31

ci/script.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,6 @@ main() {
493493

494494
# test other targets (architectures)
495495
OTHER)
496-
echo '[dependencies.bare-metal]' >> $td/Cargo.toml
497-
echo 'version = "0.1.0"' >> $td/Cargo.toml
498-
499496
echo '[dependencies.msp430]' >> $td/Cargo.toml
500497
echo 'version = "0.2.2"' >> $td/Cargo.toml
501498

src/generate/interrupt.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,19 @@ pub fn render(
160160
(quote!(#[repr(u8)]), quote!(*#self_token as u8))
161161
};
162162

163+
if target == Target::Msp430 {
164+
let interrupt_enum = quote! {
165+
///Enumeration of all the interrupts. This enum is seldom used in application or library crates. It is present primarily for documenting the device's implemented interrupts.
166+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
167+
#enum_repr
168+
pub enum Interrupt {
169+
#variants
170+
}
171+
};
172+
173+
root.extend(interrupt_enum);
174+
}
175+
163176
let interrupt_enum = quote! {
164177
///Enumeration of all the interrupts
165178
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
@@ -176,7 +189,7 @@ pub fn render(
176189
}
177190
};
178191

179-
if target == Target::CortexM || target == Target::Msp430 {
192+
if target == Target::CortexM {
180193
root.extend(interrupt_enum);
181194
} else {
182195
mod_items.extend(quote! {

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,12 @@
106106
//! ```
107107
//!
108108
//! The resulting crate must provide an opt-in "rt" feature and depend on these crates:
109-
//! `bare-metal` v0.2.x, `msp430` v0.2.x, `msp430-rt` v0.2.x and `vcell` v0.1.x. Furthermore
109+
//! `msp430` v0.2.x, `msp430-rt` v0.2.x and `vcell` v0.1.x. Furthermore
110110
//! the "device" feature of `msp430-rt` must be enabled when the "rt" feature is enabled. The
111111
//! `Cargo.toml` of the device crate will look like this:
112112
//!
113113
//! ``` toml
114114
//! [dependencies]
115-
//! bare-metal = "0.2.0"
116115
//! msp430 = "0.2.0"
117116
//! vcell = "0.1.0"
118117
//!

0 commit comments

Comments
 (0)