]> rtime.felk.cvut.cz Git - arc.git/blob - examples/pwm_node2/Hooks.c
Starting 'pdur2' branch with copied content from remote repository.
[arc.git] / examples / pwm_node2 / 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 /* Global hooks */\r
34 ProtectionReturnType ProtectionHook( StatusType FatalError ) {\r
35         LDEBUG_FPUTS("## ProtectionHook\n");\r
36         return PRO_KILLAPPL;\r
37 }\r
38 \r
39 void StartupHook( void ) {\r
40         LDEBUG_FPUTS("## StartupHook\n");\r
41 \r
42         LDEBUG_PRINTF("Sys clock %u Hz\n",(unsigned)McuE_GetSystemClock());\r
43 }\r
44 \r
45 void ShutdownHook( StatusType Error ) {\r
46         LDEBUG_FPUTS("## ShutdownHook\n");\r
47         while(1);\r
48 }\r
49 \r
50 void ErrorHook( StatusType Error ) {\r
51         DisableAllInterrupts();\r
52 \r
53         LDEBUG_PRINTF("## ErrorHook err=%d\n",Error);\r
54         while(1);\r
55 }\r
56 \r
57 void PreTaskHook( void ) {\r
58 //      LDEBUG_PRINTF("## PreTaskHook, taskid=%d\n",task);\r
59 }\r
60 \r
61 void PostTaskHook( void ) {\r
62 //      LDEBUG_PRINTF("## PostTaskHook, taskid=%d\n",task);\r
63 }\r