Skip to content

Commit 90fe7dc

Browse files
committed
v0.7.0
1 parent e28e46b commit 90fe7dc

File tree

92 files changed

+555
-641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+555
-641
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## [Unreleased]
44

5+
## [v0.7.0] - 2021-10-03
6+
7+
* Update cortex-m to 0.7 and cortex-m-rt to 0.7
8+
* Now implements new cortex-m InterruptNumber trait
9+
510
## [v0.6.0] - 2021-10-03
611

712
* Update stm32-rs to 0.14.0
@@ -37,7 +42,8 @@
3742

3843
* Initial release
3944

40-
[Unreleased]: https://github.com/adamgreig/stm32ral/compare/v0.6.0...HEAD
45+
[Unreleased]: https://github.com/adamgreig/stm32ral/compare/v0.7.0...HEAD
46+
[v0.7.0]: https://github.com/adamgreig/stm32ral/compare/v0.6.0...v0.7.0
4147
[v0.6.0]: https://github.com/adamgreig/stm32ral/compare/v0.5.0...v0.6.0
4248
[v0.5.0]: https://github.com/adamgreig/stm32ral/compare/v0.4.1...v0.5.0
4349
[v0.4.1]: https://github.com/adamgreig/stm32ral/compare/v0.4.0...v0.4.1

Cargo.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ edition = "2018"
1414
exclude = ["/stm32-rs"]
1515

1616
# Change version in stm32ral.py, not in Cargo.toml!
17-
version = "0.6.0"
17+
version = "0.7.0"
1818

1919
[package.metadata.docs.rs]
2020
features = ["doc"]
@@ -23,16 +23,15 @@ targets = []
2323

2424
[dependencies]
2525
# Change dependency versions in stm32ral.py, not here!
26-
bare-metal = "0.2.5"
27-
external_cortex_m = { package = "cortex-m", version = "0.6.4" }
28-
cortex-m-rt = { version = "0.6.13", optional = true }
26+
external_cortex_m = { package = "cortex-m", version = "0.7.3" }
27+
cortex-m-rt = { version = ">=0.6.15,<0.8", optional = true }
2928

3029
[features]
30+
default = ["rt"]
3131
rt = ["cortex-m-rt/device"]
3232
inline-asm = ["external_cortex_m/inline-asm"]
3333
rtfm = ["rtic"]
3434
rtic = []
35-
default = []
3635
nosync = []
3736
doc = []
3837
armv6m = []

src/stm32f0/stm32f0x0/interrupts.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate bare_metal;
21
#[cfg(feature = "rt")]
32
extern "C" {
43
fn WWDG();
@@ -85,8 +84,8 @@ pub static __INTERRUPTS: [Vector; 32] = [
8584
];
8685

8786
/// Available interrupts for this device
88-
#[repr(u8)]
89-
#[derive(Clone, Copy)]
87+
#[repr(u16)]
88+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
9089
#[allow(non_camel_case_types)]
9190
pub enum Interrupt {
9291
/// 0: Window Watchdog interrupt
@@ -146,9 +145,9 @@ pub enum Interrupt {
146145
/// 31: USB global interrupt
147146
USB = 31,
148147
}
149-
unsafe impl bare_metal::Nr for Interrupt {
150-
#[inline]
151-
fn nr(&self) -> u8 {
152-
*self as u8
148+
unsafe impl external_cortex_m::interrupt::InterruptNumber for Interrupt {
149+
#[inline(always)]
150+
fn number(self) -> u16 {
151+
self as u16
153152
}
154153
}

src/stm32f0/stm32f0x1/interrupts.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate bare_metal;
21
#[cfg(feature = "rt")]
32
extern "C" {
43
fn WWDG();
@@ -89,8 +88,8 @@ pub static __INTERRUPTS: [Vector; 32] = [
8988
];
9089

9190
/// Available interrupts for this device
92-
#[repr(u8)]
93-
#[derive(Clone, Copy)]
91+
#[repr(u16)]
92+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
9493
#[allow(non_camel_case_types)]
9594
pub enum Interrupt {
9695
/// 0: Window Watchdog interrupt
@@ -158,9 +157,9 @@ pub enum Interrupt {
158157
/// 31: USB global interrupt
159158
USB = 31,
160159
}
161-
unsafe impl bare_metal::Nr for Interrupt {
162-
#[inline]
163-
fn nr(&self) -> u8 {
164-
*self as u8
160+
unsafe impl external_cortex_m::interrupt::InterruptNumber for Interrupt {
161+
#[inline(always)]
162+
fn number(self) -> u16 {
163+
self as u16
165164
}
166165
}

src/stm32f0/stm32f0x2/interrupts.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate bare_metal;
21
#[cfg(feature = "rt")]
32
extern "C" {
43
fn WWDG();
@@ -87,8 +86,8 @@ pub static __INTERRUPTS: [Vector; 32] = [
8786
];
8887

8988
/// Available interrupts for this device
90-
#[repr(u8)]
91-
#[derive(Clone, Copy)]
89+
#[repr(u16)]
90+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
9291
#[allow(non_camel_case_types)]
9392
pub enum Interrupt {
9493
/// 0: Window Watchdog interrupt
@@ -156,9 +155,9 @@ pub enum Interrupt {
156155
/// 31: USB global interrupt
157156
USB = 31,
158157
}
159-
unsafe impl bare_metal::Nr for Interrupt {
160-
#[inline]
161-
fn nr(&self) -> u8 {
162-
*self as u8
158+
unsafe impl external_cortex_m::interrupt::InterruptNumber for Interrupt {
159+
#[inline(always)]
160+
fn number(self) -> u16 {
161+
self as u16
163162
}
164163
}

src/stm32f0/stm32f0x8/interrupts.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate bare_metal;
21
#[cfg(feature = "rt")]
32
extern "C" {
43
fn WWDG();
@@ -89,8 +88,8 @@ pub static __INTERRUPTS: [Vector; 32] = [
8988
];
9089

9190
/// Available interrupts for this device
92-
#[repr(u8)]
93-
#[derive(Clone, Copy)]
91+
#[repr(u16)]
92+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
9493
#[allow(non_camel_case_types)]
9594
pub enum Interrupt {
9695
/// 0: Window Watchdog interrupt
@@ -158,9 +157,9 @@ pub enum Interrupt {
158157
/// 31: USB global interrupt
159158
USB = 31,
160159
}
161-
unsafe impl bare_metal::Nr for Interrupt {
162-
#[inline]
163-
fn nr(&self) -> u8 {
164-
*self as u8
160+
unsafe impl external_cortex_m::interrupt::InterruptNumber for Interrupt {
161+
#[inline(always)]
162+
fn number(self) -> u16 {
163+
self as u16
165164
}
166165
}

src/stm32f1/stm32f100/interrupts.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate bare_metal;
21
#[cfg(feature = "rt")]
32
extern "C" {
43
fn WWDG();
@@ -162,8 +161,8 @@ pub static __INTERRUPTS: [Vector; 60] = [
162161
];
163162

164163
/// Available interrupts for this device
165-
#[repr(u8)]
166-
#[derive(Clone, Copy)]
164+
#[repr(u16)]
165+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
167166
#[allow(non_camel_case_types)]
168167
pub enum Interrupt {
169168
/// 0: Window Watchdog interrupt
@@ -273,9 +272,9 @@ pub enum Interrupt {
273272
/// 59: DMA2 Channel4 and DMA2 Channel5 global interrupt
274273
DMA2_Channel4_5 = 59,
275274
}
276-
unsafe impl bare_metal::Nr for Interrupt {
277-
#[inline]
278-
fn nr(&self) -> u8 {
279-
*self as u8
275+
unsafe impl external_cortex_m::interrupt::InterruptNumber for Interrupt {
276+
#[inline(always)]
277+
fn number(self) -> u16 {
278+
self as u16
280279
}
281280
}

src/stm32f1/stm32f101/interrupts.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate bare_metal;
21
#[cfg(feature = "rt")]
32
extern "C" {
43
fn WWDG();
@@ -167,8 +166,8 @@ pub static __INTERRUPTS: [Vector; 60] = [
167166
];
168167

169168
/// Available interrupts for this device
170-
#[repr(u8)]
171-
#[derive(Clone, Copy)]
169+
#[repr(u16)]
170+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
172171
#[allow(non_camel_case_types)]
173172
pub enum Interrupt {
174173
/// 0: Window Watchdog interrupt
@@ -292,9 +291,9 @@ pub enum Interrupt {
292291
/// 59: DMA2 Channel4 and DMA2
293292
DMA2_Channel4_5 = 59,
294293
}
295-
unsafe impl bare_metal::Nr for Interrupt {
296-
#[inline]
297-
fn nr(&self) -> u8 {
298-
*self as u8
294+
unsafe impl external_cortex_m::interrupt::InterruptNumber for Interrupt {
295+
#[inline(always)]
296+
fn number(self) -> u16 {
297+
self as u16
299298
}
300299
}

src/stm32f1/stm32f102/interrupts.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate bare_metal;
21
#[cfg(feature = "rt")]
32
extern "C" {
43
fn WWDG();
@@ -171,8 +170,8 @@ pub static __INTERRUPTS: [Vector; 60] = [
171170
];
172171

173172
/// Available interrupts for this device
174-
#[repr(u8)]
175-
#[derive(Clone, Copy)]
173+
#[repr(u16)]
174+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
176175
#[allow(non_camel_case_types)]
177176
pub enum Interrupt {
178177
/// 0: Window Watchdog interrupt
@@ -296,9 +295,9 @@ pub enum Interrupt {
296295
/// 59: DMA2 Channel4 and DMA2 Channel5 global interrupt
297296
DMA2_Channel4_5 = 59,
298297
}
299-
unsafe impl bare_metal::Nr for Interrupt {
300-
#[inline]
301-
fn nr(&self) -> u8 {
302-
*self as u8
298+
unsafe impl external_cortex_m::interrupt::InterruptNumber for Interrupt {
299+
#[inline(always)]
300+
fn number(self) -> u16 {
301+
self as u16
303302
}
304303
}

src/stm32f1/stm32f103/interrupts.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate bare_metal;
21
#[cfg(feature = "rt")]
32
extern "C" {
43
fn WWDG();
@@ -168,8 +167,8 @@ pub static __INTERRUPTS: [Vector; 60] = [
168167
];
169168

170169
/// Available interrupts for this device
171-
#[repr(u8)]
172-
#[derive(Clone, Copy)]
170+
#[repr(u16)]
171+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
173172
#[allow(non_camel_case_types)]
174173
pub enum Interrupt {
175174
/// 0: Window Watchdog interrupt
@@ -291,9 +290,9 @@ pub enum Interrupt {
291290
/// 59: DMA2 Channel4 and DMA2 Channel5 global interrupt
292291
DMA2_Channel4_5 = 59,
293292
}
294-
unsafe impl bare_metal::Nr for Interrupt {
295-
#[inline]
296-
fn nr(&self) -> u8 {
297-
*self as u8
293+
unsafe impl external_cortex_m::interrupt::InterruptNumber for Interrupt {
294+
#[inline(always)]
295+
fn number(self) -> u16 {
296+
self as u16
298297
}
299298
}

0 commit comments

Comments
 (0)