1 /* -------------------------------- Arctic Core ------------------------------
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
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>.
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
14 * -------------------------------- Arctic Core ------------------------------*/
28 #define USE_DEBUG_PRINT 1
31 /* Notification callback from channel 0 */
32 void MyPwmNotificationRoutine(void) {
33 static uint32 count = 0;
34 static uint32 highcount = 0;
35 static uint32 lowcount = 0;
36 Pwm_OutputStateType outputState = Pwm_GetOutputState(PWM_CHANNEL_1);
38 if (outputState == PWM_HIGH) {
49 ProtectionReturnType ProtectionHook( StatusType FatalError ) {
50 dbg_printf("## ProtectionHook\n");
54 void StartupHook( void ) {
55 dbg_printf("## StartupHook\n");
57 uint32_t sys_freq = McuE_GetSystemClock();
59 dbg_printf("Sys clock %d Hz\n",sys_freq);
62 void ShutdownHook( StatusType Error ) {
63 dbg_printf("## ShutdownHook\n");
67 void ErrorHook( StatusType Error ) {
68 DisableAllInterrupts();
70 dbg_printf("## ErrorHook err=%d\n",Error);
74 void PreTaskHook( void ) {
80 // dbg_printf("## PreTaskHook, taskid=%d\n",task);
83 void PostTaskHook( void ) {
89 // dbg_printf("## PostTaskHook, taskid=%d\n",task);
93 struct OsHooks os_conf_global_hooks = {
94 .StartupHook = StartupHook,
95 .ProtectionHook = ProtectionHook,
96 .ShutdownHook = ShutdownHook,
97 .ErrorHook = ErrorHook,
98 .PreTaskHook = PreTaskHook,
99 .PostTaskHook = PostTaskHook