-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathestamosRTOS_MCU.h
More file actions
89 lines (65 loc) · 2.49 KB
/
estamosRTOS_MCU.h
File metadata and controls
89 lines (65 loc) · 2.49 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
///////////////////////////////////////////////////////////////////////////////////////////////////
// estamosRTOS is distributed under the DWYWADC license (Do Whatever You Want And Don't Complain).
//
// By using estamosRTOS, you agree to the following terms:
//
// - Do whatever you want and don't complain.
//
// enjoy!
//
// Copyright © 2017-2018, Eduardo Corpeño
////////////////////////////////////////////////////////////////////////////////////////////////////
DO NOT USE NON-PREPROCESSOR CODE IN THIS FILE!
ONLY USE #define, #ifdef, #else, and so on.
DO NOT USE typedef, char, uint8_t, int func(int), and so on.
DO NOT USE C CODE!
THIS FILE IS SEEN BY THE PREPROCESSOR TO DEFINE SYMBOLS
FOR BOTH THE C COMPILER AND THE ASSEMBLER!!!
*/
#ifndef ESTAMOSRTOS_MCU_H
#define ESTAMOSRTOS_MCU_H
// Uncomment the following line to enable debug mode
// #define ESTAMOSRTOS_DEBUG
// ... or the following line to only enable logic analyzer signals
//#define ESTAMOSRTOS_LOGIC_ANALYZER
// Specific MCU definition
#ifndef MCU_STM32F303X8
#define MCU_STM32F303X8
#endif
#ifdef ESTAMOSRTOS_DEBUG
#ifndef ESTAMOSRTOS_LOGIC_ANALYZER
#define ESTAMOSRTOS_LOGIC_ANALYZER
#endif
#endif
// State size in 32 bit words, NOT in bytes
#define STATE_SIZE 16U
// Stack size in 32 bit words, NOT in bytes
#ifndef ESTAMOSRTOS_STACK_SIZE
#define ESTAMOSRTOS_STACK_SIZE (STATE_SIZE * 4U)
#endif // ESTAMOSRTOS_STACK_SIZE
#define STACK_SIZE ESTAMOSRTOS_STACK_SIZE
// These two symbols need to be defined in estamosRTOS_asm.s with the same values!!!!
#define ESTAMOSRTOS_MUTEX_LOCKED 1
#define ESTAMOSRTOS_MUTEX_UNLOCKED 0
// These two symbols need to be defined in estamosRTOS_asm.s with the same values!!!!
//#define ESTAMOSRTOS_TICKS_TO_SCHEDULER (400)
#define ESTAMOSRTOS_TICKS_TO_SCHEDULER (10000)
// SVC code definitions for system calls, including yield operation.
#define SVC_KILL 0x11
#define SVC_YIELD 0x22
#define SVC_MISC 0x33
#ifdef EXIT_SUCCESS
#define ESTAMOSRTOS_EXIT_SUCCESS EXIT_SUCCESS
#else
#define ESTAMOSRTOS_EXIT_SUCCESS 0
#endif
#ifdef EXIT_FAILURE
#define ESTAMOSRTOS_EXIT_FAILURE EXIT_FAILURE
#else
#define ESTAMOSRTOS_EXIT_FAILURE 1
#endif
#endif // ESTAMOSRTOS_MCU_H
////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright © 2017-2018, Eduardo Corpeño
////////////////////////////////////////////////////////////////////////////////////////////////////