]> rtime.felk.cvut.cz Git - arc.git/blob - examples/simple/config/Os_Cfg.c
c0ae401cfdb2807461792827a06ec9dc5868d0ef
[arc.git] / examples / simple / config / Os_Cfg.c
1 /* -------------------------------- Arctic Core ------------------------------
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com
3  *
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>
5  *
6  * This source code is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 as published by the
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13  * for more details.
14  * -------------------------------- Arctic Core ------------------------------*/
15
16 #include <stdlib.h>\r
17 #include <stdint.h>
18 #include "Platform_Types.h"
19 #include "Os.h"                         // includes Os_Cfg.h
20 #include "os_config_macros.h"\r
21 #include "kernel.h"\r
22 #include "kernel_offset.h"\r
23 #include "alist_i.h"\r
24 #include "Mcu.h"\r
25 \r
26 extern void dec_exception( void );\r
27
28 OsTickType OsTickFreq = 1000;
29 \r
30 // atleast 1\r
31 #define SERVICE_CNT 1\r
32
33
34 #if ( OS_SC3 == STD_ON) || (  OS_SC4==STD_ON)\r
35 GEN_TRUSTEDFUNCTIONS_LIST\r
36 \r
37 //--- APPLICATIONS ----\r
38 \r
39 GEN_APPLICATION_HEAD {\r
40 \r
41         GEN_APPLICATON( 0,\r
42                                         "application_1",\r
43                                         true,\r
44                                         NULL,NULL,NULL , 0,0,0,0,0,0 )\r
45 };\r
46 #endif
47 \r
48 // --- RESOURCES ---\r
49 \r
50 GEN_RESOURCE_HEAD {\r
51         GEN_RESOURCE(RES_SCHEDULER,RESOURCE_TYPE_STANDARD,0,0,0),               // Standard resource..\r
52 };\r
53 \r
54 //--- TASKS ----\r
55 \r
56 DECLARE_STACK(OsIdle,PRIO_STACK_SIZE);\r
57 DECLARE_STACK(etask_1,PRIO_STACK_SIZE);\r
58 DECLARE_STACK(etask_2,PRIO_STACK_SIZE);\r
59 DECLARE_STACK(btask_3,PRIO_STACK_SIZE);\r
60 \r
61 GEN_TASK_HEAD {\r
62         GEN_ETASK(      OsIdle,\r
63                                 0,\r
64                                 true/*auto*/,\r
65                                 NULL/*tm*/,\r
66                                 APPLICATION_ID_application_1/*app*/,\r
67                                 NULL/*rsrc*/),\r
68 \r
69         GEN_ETASK(      etask_1,\r
70                                 1,\r
71                                 true/*auto*/,\r
72                                 NULL/*tm*/,\r
73                                 APPLICATION_ID_application_1/*app*/,\r
74                                 NULL/*rsrc*/),\r
75 \r
76         GEN_ETASK(      etask_2,\r
77                                 2,\r
78                                 true/*auto*/,\r
79                                 NULL/*tm*/,\r
80                                 APPLICATION_ID_application_1/*app*/,\r
81                                 NULL/*rsrc*/),\r
82 \r
83 \r
84         GEN_BTASK(      btask_3,\r
85                                 3,\r
86                                 false/*auto*/,\r
87                                 NULL/*tm*/,\r
88                                 APPLICATION_ID_application_1/*app*/,\r
89                                 NULL/*rsrc*/),\r
90 };\r
91 \r
92 GEN_PCB_LIST()\r
93 \r
94 // --- INTERRUPTS ---\r
95 \r
96 uint8_t os_interrupt_stack[OS_INTERRUPT_STACK_SIZE] __attribute__ ((aligned (0x10)));\r
97
98 GEN_IRQ_VECTOR_TABLE_HEAD {};
99 GEN_IRQ_ISR_TYPE_TABLE_HEAD {};
100 GEN_IRQ_PRIORITY_TABLE_HEAD {};
101 \r
102 // --- COUNTERS ---\r
103 GEN_COUNTER_HEAD {\r
104         GEN_COUNTER(    COUNTER_ID_OsTick,
105                                         "COUNTER_ID_OsTick",
106                                         COUNTER_TYPE_HARD,\r
107                                         COUNTER_UNIT_NANO,\r
108                                         0xffff,1,1,0 ),\r
109 };
110
111 CounterType Os_Arc_OsTickCounter = COUNTER_ID_OsTick;
112 \r
113 // --- MESSAGES ---\r
114 \r
115 // --- ALARMS ---\r
116 #define ALARM_USE\r
117
118 GEN_ALARM_AUTOSTART( 0, ALARM_AUTOSTART_ABSOLUTE, 100, 10, OSDEFAULTAPPMODE );
119 \r
120 GEN_ALARM_HEAD {\r
121         GEN_ALARM(      0,"Alarm1",COUNTER_ID_OsTick,
122                                 GEN_ALARM_AUTOSTART_NAME(0),\r
123                                 ALARM_ACTION_SETEVENT, TASK_ID_etask_1, 2, 0 ),\r
124 };\r
125 \r
126 // --- SCHEDULETABLES ---\r
127 \r
128 // --- HOOKS ---\r
129 \r
130 GEN_HOOKS( StartupHook, ProtectionHook, ShutdownHook, ErrorHook, PreTaskHook, PostTaskHook )\r
131 \r
132 \r
133 \r
134 // --- MISC ---\r
135 \r
136 uint32 os_dbg_mask = \\r
137         D_MASTER_PRINT |\\r
138         D_ISR_MASTER_PRINT |\\r
139         D_RAMLOG |\\r
140     D_ISR_RAMLOG | D_TASK | D_ALARM;\r
141 \r
142 \r
143 // | D_ALARM | D_TASK;\r
144 \r
145 \r
146 #include "os_config_funcs.h"\r
147 \r
148 \r
149 \r
150 \r
151 \r
152 \r
153 \r
154 \r
155 \r