cpu/msp430_common: Refactor cpu.{c,h}
Drop `__enable_irq()` and `__disable_irq()` and replace single remaining call of them with the standard IRQ API, as this is now equally fast.
This commit is contained in:
parent
c5c83cfe3c
commit
1a8defd209
@ -21,7 +21,7 @@
|
||||
__attribute__((naked)) void thread_yield_higher(void)
|
||||
{
|
||||
__asm__("push r2"); /* save SR */
|
||||
__disable_irq();
|
||||
irq_disable();
|
||||
|
||||
__save_context();
|
||||
|
||||
|
||||
@ -45,28 +45,6 @@ extern "C" {
|
||||
*/
|
||||
#define ISR(a,b) void __attribute__((naked, interrupt (a))) b(void)
|
||||
|
||||
/**
|
||||
* @brief Globally disable IRQs
|
||||
*/
|
||||
static inline void __attribute__((always_inline)) __disable_irq(void)
|
||||
{
|
||||
__asm__ __volatile__("bic %0, r2" : : "i"(GIE));
|
||||
/* this NOP is needed to handle a "delay slot" that all MSP430 MCUs
|
||||
impose silently after messing with the GIE bit, DO NOT REMOVE IT! */
|
||||
__asm__ __volatile__("nop");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Globally enable IRQs
|
||||
*/
|
||||
static inline void __attribute__((always_inline)) __enable_irq(void)
|
||||
{
|
||||
__asm__ __volatile__("bis %0, r2" : : "i"(GIE));
|
||||
/* this NOP is needed to handle a "delay slot" that all MSP430 MCUs
|
||||
impose silently after messing with the GIE bit, DO NOT REMOVE IT! */
|
||||
__asm__ __volatile__("nop");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief The current ISR state (inside or not)
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user