1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

cpu/cortexm_common/irq_arch: fix irq_enable return type

This commit is contained in:
Francisco Molina 2020-05-04 08:39:58 +02:00
parent cb5cbe7431
commit 4ad3164599
No known key found for this signature in database
GPG Key ID: 3E94EAC3DBDEEDA8

View File

@ -19,8 +19,8 @@
*/ */
#ifndef _IRQ_ARCH_H #ifndef IRQ_ARCH_H
#define _IRQ_ARCH_H #define IRQ_ARCH_H
#include <stdint.h> #include <stdint.h>
#include "cpu_conf.h" #include "cpu_conf.h"
@ -35,6 +35,7 @@ extern "C" {
static inline __attribute__((always_inline)) unsigned int irq_disable(void) static inline __attribute__((always_inline)) unsigned int irq_disable(void)
{ {
uint32_t mask = __get_PRIMASK(); uint32_t mask = __get_PRIMASK();
__disable_irq(); __disable_irq();
return mask; return mask;
} }
@ -45,8 +46,10 @@ static inline __attribute__((always_inline)) unsigned int irq_disable(void)
static inline __attribute__((always_inline)) __attribute__((used)) unsigned int static inline __attribute__((always_inline)) __attribute__((used)) unsigned int
irq_enable(void) irq_enable(void)
{ {
unsigned result = __get_PRIMASK();
__enable_irq(); __enable_irq();
return __get_PRIMASK(); return result;
} }
/** /**
@ -70,5 +73,5 @@ static inline __attribute__((always_inline)) int irq_is_in(void)
} }
#endif #endif
#endif /* _IRQ_ARCH_H */ #endif /* IRQ_ARCH_H */
/** @} */ /** @} */