NetBurner 3.5.6
PDF Version
nbrtos_cm7.h
1
#ifndef __NBRTOS_CM7_H
2
#define __NBRTOS_CM7_H
3
/*NB_REVISION*/
4
5
/*NB_COPYRIGHT*/
6
7
// Macros expectdy by core CM functions
8
#ifndef __STATIC_INLINE
9
#define __STATIC_INLINE static inline
10
#endif
11
#ifndef __INLINE
12
#define __INLINE inline
13
#endif
14
#ifndef __ASM
15
#define __ASM __asm
16
#endif
17
#include <core_cm7.h>
18
19
#define SCB_ICSR_REG (*((uint32_t *)0xE000ED04UL))
20
#define SCB_ICSR_PENDSVSET_BIT (0x10000000);
21
22
extern
volatile
uint32_t critical_count;
23
24
#define USER_ENTER_CRITICAL() \
25
{ \
26
asm("cpsid i"); \
27
critical_count++; \
28
}
29
30
#define USER_EXIT_CRITICAL() \
31
{ \
32
if (--critical_count <= 0) { asm("cpsie i"); } \
33
}
34
35
//#define OS_TASK_SW() { SCB_ICSR_REG = SCB_ICSR_PENDSVSET_BIT; }
36
//#define OSIntCtxSw() { SCB_ICSR_REG = SCB_ICSR_PENDSVSET_BIT; }
37
38
extern
"C"
39
{
40
void
UCosSetup();
41
}
42
void
UCosBegin();
43
44
#endif
/* ----- #ifndef __NBRTOS_CM7_H ----- */