stmhal: Only use BASEPRI irq stuff if Cortex is M3 or higher.
This commit is contained in:
parent
f7697ff393
commit
dd7d2e0810
@ -34,6 +34,8 @@ static inline mp_uint_t query_irq(void) {
|
|||||||
|
|
||||||
// enable_irq and disable_irq are defined inline in mpconfigport.h
|
// 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
|
// irqs with a priority value greater or equal to "pri" will be disabled
|
||||||
// "pri" should be between 1 and 15 inclusive
|
// "pri" should be between 1 and 15 inclusive
|
||||||
static inline uint32_t raise_irq_pri(uint32_t pri) {
|
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);
|
__set_BASEPRI(basepri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
MP_DECLARE_CONST_FUN_OBJ(pyb_wfi_obj);
|
MP_DECLARE_CONST_FUN_OBJ(pyb_wfi_obj);
|
||||||
MP_DECLARE_CONST_FUN_OBJ(pyb_disable_irq_obj);
|
MP_DECLARE_CONST_FUN_OBJ(pyb_disable_irq_obj);
|
||||||
MP_DECLARE_CONST_FUN_OBJ(pyb_enable_irq_obj);
|
MP_DECLARE_CONST_FUN_OBJ(pyb_enable_irq_obj);
|
||||||
|
Loading…
Reference in New Issue
Block a user