forked from Traumflug/Teacup_Firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpu.h
41 lines (27 loc) · 896 Bytes
/
cpu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef _CPU_H
#define _CPU_H
#if defined __AVR__
#include <avr/interrupt.h>
#elif defined __ARMEL__
#include "cmsis-lpc11xx.h" // For __ASM().
/** Enable interrupts.
This enables interrupts by clearing the I-bit in the CPSR.
Code copied from MBED, __enable_irq(), in file
mbed/libraries/mbed/targets/cmsis/core_cmFunc.h.
*/
static void sei(void) __attribute__ ((always_inline));
inline void sei(void) {
__ASM volatile ("cpsie i" ::: "memory");
}
/** Disable interrupts.
This disables interrupts by setting the I-bit in the CPSR.
Code copied from MBED, __disable_irq(), in file
mbed/libraries/mbed/targets/cmsis/core_cmFunc.h.
*/
static void cli(void) __attribute__ ((always_inline));
inline void cli(void) {
__ASM volatile ("cpsid i" ::: "memory");
}
#endif /* __AVR__, __ARMEL__ */
void cpu_init(void);
#endif /* _CPU_H */