diff options
author | Damien George <damien.p.george@gmail.com> | 2015-12-04 12:13:12 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-12-04 12:13:12 +0000 |
commit | dd7d2e0810b6835d4798c315fb53d2f552a07e9d (patch) | |
tree | d60be881d1b3489487b56adbfda6c11c97cc8e22 | |
parent | f7697ff393fa60e2b9adea31960ca17afc1d2ab7 (diff) |
stmhal: Only use BASEPRI irq stuff if Cortex is M3 or higher.
-rw-r--r-- | stmhal/irq.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/stmhal/irq.h b/stmhal/irq.h index 878ef460b..bf8c1fcd9 100644 --- a/stmhal/irq.h +++ b/stmhal/irq.h @@ -34,6 +34,8 @@ static inline mp_uint_t query_irq(void) { // enable_irq and disable_irq are defined inline in mpconfigport.h +#if __CORTEX_M >= 0x03 + // irqs with a priority value greater or equal to "pri" will be disabled // "pri" should be between 1 and 15 inclusive static inline uint32_t raise_irq_pri(uint32_t pri) { @@ -53,6 +55,8 @@ static inline void restore_irq_pri(uint32_t basepri) { __set_BASEPRI(basepri); } +#endif + MP_DECLARE_CONST_FUN_OBJ(pyb_wfi_obj); MP_DECLARE_CONST_FUN_OBJ(pyb_disable_irq_obj); MP_DECLARE_CONST_FUN_OBJ(pyb_enable_irq_obj); |