Skip to content

Commit dd7d2e0

Browse files
committed
stmhal: Only use BASEPRI irq stuff if Cortex is M3 or higher.
1 parent f7697ff commit dd7d2e0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

stmhal/irq.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ static inline mp_uint_t query_irq(void) {
3434

3535
// enable_irq and disable_irq are defined inline in mpconfigport.h
3636

37+
#if __CORTEX_M >= 0x03
38+
3739
// irqs with a priority value greater or equal to "pri" will be disabled
3840
// "pri" should be between 1 and 15 inclusive
3941
static inline uint32_t raise_irq_pri(uint32_t pri) {
@@ -53,6 +55,8 @@ static inline void restore_irq_pri(uint32_t basepri) {
5355
__set_BASEPRI(basepri);
5456
}
5557

58+
#endif
59+
5660
MP_DECLARE_CONST_FUN_OBJ(pyb_wfi_obj);
5761
MP_DECLARE_CONST_FUN_OBJ(pyb_disable_irq_obj);
5862
MP_DECLARE_CONST_FUN_OBJ(pyb_enable_irq_obj);

0 commit comments

Comments
 (0)