/*----------------------------------------------------------------------------- * Alarm % !alarm::NAME % descriptor * * This alarm does % if alarm::ACTION == "ACTIVATETASK" then %the activation of task % !alarm::ACTION_S::TASK elsif alarm::ACTION == "SETEVENT" then %a set of event % !alarm::ACTION_S::EVENT % to task % !alarm::ACTION_S::TASK elsif alarm::ACTION == "ALARMCALLBACK" then %a callback of function % !alarm::ACTION_S::ALARMCALLBACKNAME %_callback% end if % */ % let action := alarm::ACTION let action_s := alarm::ACTION_S let action_name := alarm::NAME template action_descriptor % #define OS_START_SEC_CONST_UNSPECIFIED #include "tpl_memmap.h" CONST(tpl_alarm_static, OS_CONST) % !alarm::NAME %_static = { { /* pointer to counter */ &% !alarm::COUNTER %_counter_desc, /* pointer to the expiration */ tpl_raise_alarm #if (WITH_ID == YES) /* id of the alarm for tracing */ , % !alarm::NAME %_id #endif #if WITH_OSAPPLICATION == YES /* OS application id */ , % if AUTOSAR then if OS::SCALABILITYCLASS >= 3 then !alarm::APPLICATION%_id% end if end if % #endif }, /* action of the alarm */ (tpl_action *)&% !alarm::NAME %_action }; #define OS_STOP_SEC_CONST_UNSPECIFIED #include "tpl_memmap.h" #define OS_START_SEC_VAR_UNSPECIFIED #include "tpl_memmap.h" VAR(tpl_time_obj, OS_VAR) % !alarm::NAME %_alarm_desc = { /* pointer to the static part */ (tpl_time_obj_static *)&% !alarm::NAME %_static, /* next alarm */ NULL, /* prev alarm */ NULL,% if alarm::AUTOSTART then % /* cycle */ % !alarm::AUTOSTART_S::CYCLETIME %, /* date */ % !alarm::AUTOSTART_S::ALARMTIME %, /* State of the alarm */ ALARM_AUTOSTART% else % /* cycle */ 0, /* date */ 0, /* State of the alarm */ ALARM_SLEEP% end if % }; #define OS_STOP_SEC_VAR_UNSPECIFIED #include "tpl_memmap.h"