]> rtime.felk.cvut.cz Git - arc.git/blob - examples/switch_node/Hooks.c
Starting 'pdur2' branch with copied content from remote repository.
[arc.git] / examples / switch_node / Hooks.c
1 /* -------------------------------- Arctic Core ------------------------------\r
2  * Arctic Core - the open source AUTOSAR platform http://arccore.com\r
3  *\r
4  * Copyright (C) 2009  ArcCore AB <contact@arccore.com>\r
5  *\r
6  * This source code is free software; you can redistribute it and/or modify it\r
7  * under the terms of the GNU General Public License version 2 as published by the\r
8  * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.\r
9  *\r
10  * This program is distributed in the hope that it will be useful, but\r
11  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
12  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
13  * for more details.\r
14  * -------------------------------- Arctic Core ------------------------------*/\r
15 \r
16 \r
17 \r
18 \r
19 \r
20 \r
21 \r
22 \r
23 #include "Os.h"\r
24 #include "Mcu.h"\r
25 #include <stdio.h>\r
26 #include <assert.h>\r
27 \r
28 //#define USE_LDEBUG_PRINTF // Uncomment this to turn debug statements on.\r
29 #include "debug.h"\r
30 \r
31 \r
32 \r
33 \r
34 /* Global hooks */\r
35 ProtectionReturnType ProtectionHook( StatusType FatalError ) {\r
36         LDEBUG_PRINTF("## ProtectionHook\n");\r
37         return PRO_KILLAPPL;\r
38 }\r
39 \r
40 void StartupHook( void ) {\r
41         LDEBUG_PRINTF("## StartupHook\n");\r
42 \r
43         LDEBUG_PRINTF("Sys clock %u Hz\n",(unsigned)McuE_GetSystemClock());\r
44 }\r
45 \r
46 void ShutdownHook( StatusType Error ) {\r
47         LDEBUG_PRINTF("## ShutdownHook\n");\r
48         while(1);\r
49 }\r
50 \r
51 void ErrorHook( StatusType Error ) {\r
52         DisableAllInterrupts();\r
53 \r
54         LDEBUG_PRINTF("## ErrorHook err=%d\n",Error);\r
55         while(1);\r
56 }\r
57 \r
58 void PreTaskHook( void ) {\r
59 //      dbg_printf("## PreTaskHook, taskid=%d\n",task);\r
60 }\r
61 \r
62 void PostTaskHook( void ) {\r
63 //      dbg_printf("## PostTaskHook, taskid=%d\n",task);\r
64 }\r