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 ------------------------------*/
26 #include "counter_i.h"
\r
28 struct counter_obj_s;
\r
30 typedef enum alarm_action_type_e {
\r
31 ALARM_ACTION_ACTIVATETASK=0,
\r
32 ALARM_ACTION_SETEVENT,
\r
33 ALARM_ACTION_ALARMCALLBACK, /* Only class 1 */
\r
34 ALARM_ACTION_INCREMENTCOUNTER, /* SWS OS302 */
\r
35 } alarm_action_type_t;
\r
38 typedef struct alarm_action_s {
\r
39 alarm_action_type_t type;
\r
41 EventMaskType event_id;
\r
42 CounterType counter_id;
\r
45 typedef struct alarm_autostart_s {
\r
49 uint32 appmode_mask;
\r
50 } alarm_autostart_t;
\r
52 typedef struct alarm_obj_s {
\r
55 /* Reference to counter */
\r
56 struct counter_obj_s *counter;
\r
58 CounterType counter_id;
\r
59 /* cycle, 0 = no cycle */
\r
62 uint32 appmode_mask;
\r
64 alarm_autostart_t autostart;
\r
68 /* if the alarm is active or not */
\r
74 // Action attributes when alarm expires.
\r
75 alarm_action_t action;
\r
77 alarm_action_type_t action_type;
\r
78 TaskType action_pid;
\r
79 EventMaskType action_event;
\r
80 CounterType action_counter;
\r
82 /* List of alarms connected to the same counter */
\r
83 SLIST_ENTRY(alarm_obj_s) alarm_list;
\r
84 /* TODO: OS242, callback in scalability class 1 only..*/
\r
92 #endif /*ALARM_I_H_*/
\r