diff options
author | Damien George <damien.p.george@gmail.com> | 2015-12-04 12:13:57 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-12-04 12:13:57 +0000 |
commit | 9aaf888b420101fd01c9455f20fda7a09ce8d93d (patch) | |
tree | 398addf08ac724845a44b5bf835f558d81971ba5 | |
parent | dd7d2e0810b6835d4798c315fb53d2f552a07e9d (diff) |
cc3200: Add __get_BASEPRI and __set_BASEPRI inline function definitions.
-rw-r--r-- | cc3200/hal/cc3200_asm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cc3200/hal/cc3200_asm.h b/cc3200/hal/cc3200_asm.h index 37e828c83..dcaaf57e1 100644 --- a/cc3200/hal/cc3200_asm.h +++ b/cc3200/hal/cc3200_asm.h @@ -68,6 +68,18 @@ static inline void __set_PRIMASK(uint32_t priMask) { } __attribute__(( always_inline )) +static inline uint32_t __get_BASEPRI(void) { + uint32_t result; + __asm volatile ("mrs %0, basepri" : "=r" (result)); + return(result); +} + +__attribute__(( always_inline )) +static inline void __set_BASEPRI(uint32_t value) { + __asm volatile ("msr basepri, %0" : : "r" (value) : "memory"); +} + +__attribute__(( always_inline )) static inline void enable_irq(mp_uint_t state) { __set_PRIMASK(state); } |