1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\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
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
14 * -------------------------------- Arctic Core ------------------------------*/
\r
29 #define USE_LDEBUG_PRINTF 1
\r
32 /* Notification callback from channel 0 */
\r
33 void MyPwmNotificationRoutine(void) {
\r
34 static uint32 count = 0;
\r
35 static uint32 highcount = 0;
\r
36 static uint32 lowcount = 0;
\r
37 Pwm_OutputStateType outputState = Pwm_GetOutputState(PWM_CHANNEL_1);
\r
39 if (outputState == PWM_HIGH) {
\r
50 ProtectionReturnType ProtectionHook( StatusType FatalError ) {
\r
51 LDEBUG_PRINTF("## ProtectionHook\n");
\r
52 return PRO_KILLAPPL;
\r
55 void StartupHook( void ) {
\r
56 LDEBUG_PRINTF("## StartupHook\n");
\r
58 uint32_t sys_freq = McuE_GetSystemClock();
\r
60 LDEBUG_PRINTF("Sys clock %d Hz\n",sys_freq);
\r
63 void ShutdownHook( StatusType Error ) {
\r
64 LDEBUG_PRINTF("## ShutdownHook\n");
\r
68 void ErrorHook( StatusType Error ) {
\r
69 DisableAllInterrupts();
\r
71 LDEBUG_PRINTF("## ErrorHook err=%d\n",Error);
\r
75 void PreTaskHook( void ) {
\r
81 // LDEBUG_PRINTF("## PreTaskHook, taskid=%d\n",task);
\r
84 void PostTaskHook( void ) {
\r
90 // LDEBUG_PRINTF("## PostTaskHook, taskid=%d\n",task);
\r
94 struct OsHooks os_conf_global_hooks = {
\r
95 .StartupHook = StartupHook,
\r
96 .ProtectionHook = ProtectionHook,
\r
97 .ShutdownHook = ShutdownHook,
\r
98 .ErrorHook = ErrorHook,
\r
99 .PreTaskHook = PreTaskHook,
\r
100 .PostTaskHook = PostTaskHook
\r