AutosarOS
CfgGenMacros.h File Reference

Macros used for generation of system. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OS_CONFIG_HOOK_STARTUP
 Enable StartupHook. More...
 
#define OS_CONFIG_HOOK_SHUTDOWN
 Enable ShutdownHook. More...
 
#define OS_CONFIG_HOOK_PRE_TASK
 Enable PreTaskHook. More...
 
#define OS_CONFIG_HOOK_POST_TASK
 Enable PostTaskHook. More...
 
#define OS_CONFIG_HOOK_ERROR
 Enable ErrorHook. More...
 
#define OS_CONFIG_HOOK_PROTECTION
 Enable ProtectionHook. More...
 
#define OS_CONFIG_EXTENDED
 Enable extended mode. More...
 
#define OS_CONFIG_MAX_ERROR_PARAM
 Configure number of parameters saved for error information. More...
 
#define OS_CONFIG_STACK_MONITORING
 Configure stack monitoring. More...
 
#define OS_CONFIG_SYSTEM_STACK(Size)
 Specify size of system stack. More...
 
#define OS_CONFIG_TASK_BEGIN
 Beginning of task definitions. More...
 
#define OS_CONFIG_TASK_DEF(Name, Prio, StackSize, NumberOfActivations, Autostart, TaskType, TaskSchedule, Res, Events)
 Task definition. More...
 
#define OS_CONFIG_TASK_END
 Ending of task definitions. More...
 
#define TASK_COUNT
 Count of tasks defined. More...
 
#define OS_CONFIG_INT_BEGIN
 Beginning of interrupt definitions. More...
 
#define OS_CONFIG_INT_DEF(Name, Prio)
 Interrupt definition. More...
 
#define OS_CONFIG_INT_END
 Ending of interrupt definitions. More...
 
#define OS_CONFIG_RESOURCE_BEGIN
 Beginning of resource definitions. More...
 
#define OS_CONFIG_RESOURCE_DEF(Name, Prio)
 Resource definition. More...
 
#define OS_CONFIG_RESOURCE_END
 End of resource definitions. More...
 
#define RESOURCE_COUNT
 Count of resources defined. More...
 
#define OS_CONFIG_INTERNAL_RESOURCE_BEGIN
 Beginning of internal resource definitions. More...
 
#define OS_CONFIG_INTERNAL_RESOURCE_DEF(Name, Prio)
 Internal resource definition. More...
 
#define OS_CONFIG_INTERNAL_RESOURCE_END
 End of internal resource definitions. More...
 
#define OS_CONFIG_COUNTER_BEGIN
 Begin of counter definitions. More...
 
#define OS_CONFIG_COUNTER_DEF(Name, MaxAllowedValue, MinCycle, TicksPerBase, Type, SecondsPerTick)
 Counter definition. More...
 
#define OS_CONFIG_COUNTER_END
 End of counter definitions. More...
 
#define COUNTER_COUNT
 Count of counters defined. More...
 
#define OS_CONFIG_ALARM_BEGIN
 Begin of alarm definitions. More...
 
#define OS_CONFIG_ALARM_DEF(Name, Base, AutoStart, Event, Type, Action, Expiration, Cycle)
 Alarm definition. More...
 
#define OS_CONFIG_ALARM_END
 End of alarm definitions. More...
 
#define ALARM_COUNT
 Count of alarm defined. More...
 
#define OS_CONFIG_ALARM_CALLBACK(Name)
 Definition of alarm callback. More...
 
#define OS_CONFIG_SCHEDULE_TABLE_BEGIN
 Beginning of schedule tables definitions. More...
 
#define OS_CONFIG_SCHEDULE_TABLE_DEF_BEGIN(Name, Counter, AutoStart, Cyclic, FinalDelay)
 Beginning schedule table definition. More...
 
#define OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINTS_BEGIN(NumExpiryPoints)
 Beginning of expiry points definition. More...
 
#define OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINT_DEF_BEGIN(Offset, NumTaskActions, NumEventActions)
 Beginning of expiry point definition. More...
 
#define OS_CONFIG_SCHEDULE_TABLE_TASK_ACTIONS_BEGIN
 Beginning of task actions definitions. More...
 
#define OS_CONFIG_SCHEDULE_TABLE_TASK_ACTION_DEF(Task)
 Definition of task action. More...
 
#define OS_CONFIG_SCHEDULE_TABLE_TASK_ACTIONS_END
 Ending of task actions definitions. More...
 
#define OS_CONFIG_SCHEDULE_TABLE_EVENT_ACTIONS_BEGIN
 Beginning of event actions definitions. More...
 
#define OS_CONFIG_SCHEDULE_TABLE_EVENT_ACTION_DEF(Task, Event)
 Definition of event action. More...
 
#define OS_CONFIG_SCHEDULE_TABLE_EVENT_ACTIONS_END
 Ending of event actions definitions. More...
 
#define OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINT_DEF_END
 Ending of expiry point definition. More...
 
#define OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINTS_END
 Ending of expiry points definitions. More...
 
#define OS_CONFIG_SCHEDULE_TABLE_DEF_END
 Ending of schedule table definition. More...
 
#define OS_CONFIG_SCHEDULE_TABLE_END
 End of schedule table definitions. More...
 

Detailed Description

Macros used for generation of system.

Date
2019-09-02
Author
Pascal Romahn

Definition in file CfgGenMacros.h.

Macro Definition Documentation

◆ ALARM_COUNT

#define ALARM_COUNT

Count of alarm defined.

Definition at line 402 of file CfgGenMacros.h.

◆ COUNTER_COUNT

#define COUNTER_COUNT

Count of counters defined.

Definition at line 363 of file CfgGenMacros.h.

◆ OS_CONFIG_ALARM_BEGIN

#define OS_CONFIG_ALARM_BEGIN

Begin of alarm definitions.

Definition at line 368 of file CfgGenMacros.h.

◆ OS_CONFIG_ALARM_CALLBACK

#define OS_CONFIG_ALARM_CALLBACK (   Name)

Definition of alarm callback.

Define a callback function to be used with an alarm of ALARM_ACTION_CALLBACK type. The definition must must be made before the alarm is defined.

Parameters
NameName of the callback function

Definition at line 412 of file CfgGenMacros.h.

◆ OS_CONFIG_ALARM_DEF

#define OS_CONFIG_ALARM_DEF (   Name,
  Base,
  AutoStart,
  Event,
  Type,
  Action,
  Expiration,
  Cycle 
)

Alarm definition.

Define an alarm.

The value of Action must be according to the type of the alarm.
If Type is ALARM_ACTION_TASK, Action must be the task to be activated.
If Type is ALARM_ACTION_EVENT, Action must be the task of which the Event should be set.
If Type is ALARM_ACTION_CALLBACK, Action must be a pointer to the callback function.
If Type is ALARM_ACTION_COUNTER, Action must be the counter to be incremented.

Parameters
NameName of the alarm
BaseCounter used as alarm base
AutoStartSet alarm to autostart
EventEvent to set (only applicable when Type is ALARM_ACTION_EVENT)
TypeType of alarm (see alarmActionType_e)
ActionAction to be performed
ExpirationExpiration value of alarm (must be between zero and the maximum allowed value of the base)
CycleCycle of the alarm (must be zero or between minCycle and maximum allowed value of the base)

Definition at line 392 of file CfgGenMacros.h.

◆ OS_CONFIG_ALARM_END

#define OS_CONFIG_ALARM_END

End of alarm definitions.

Definition at line 397 of file CfgGenMacros.h.

◆ OS_CONFIG_COUNTER_BEGIN

#define OS_CONFIG_COUNTER_BEGIN

Begin of counter definitions.

Definition at line 341 of file CfgGenMacros.h.

◆ OS_CONFIG_COUNTER_DEF

#define OS_CONFIG_COUNTER_DEF (   Name,
  MaxAllowedValue,
  MinCycle,
  TicksPerBase,
  Type,
  SecondsPerTick 
)

Counter definition.

Parameters
NameName of the counter
MaxAllowedValueMaximum allowed counter value
MinCycleSmallest allowed value for the cycle-parameter of cyclic alarms
TicksPerBaseNumber of ticks required to reach a counter-specific unit
TypeType of the counter in counterType_e
SecondsPerTickTime of one counter tick in seconds

Definition at line 353 of file CfgGenMacros.h.

◆ OS_CONFIG_COUNTER_END

#define OS_CONFIG_COUNTER_END

End of counter definitions.

Definition at line 358 of file CfgGenMacros.h.

◆ OS_CONFIG_EXTENDED

#define OS_CONFIG_EXTENDED

Enable extended mode.

If set to true the system will be compiled in extended mode with extended error checks enabled.

Definition at line 180 of file CfgGenMacros.h.

◆ OS_CONFIG_HOOK_ERROR

#define OS_CONFIG_HOOK_ERROR

Enable ErrorHook.

If defined and set to true the ErrorHook() will be called when a system service returns StatusType not equal E_OK. It will also be called when an alarm expires and an error is detected during task activation or event setting. It will not be called if a system service called from the ErrorHook does not return E_OK.

Definition at line 164 of file CfgGenMacros.h.

◆ OS_CONFIG_HOOK_POST_TASK

#define OS_CONFIG_HOOK_POST_TASK

Enable PostTaskHook.

If defined and set to true the PostTaskHook() will be called before a task leaves the running state.

Definition at line 152 of file CfgGenMacros.h.

◆ OS_CONFIG_HOOK_PRE_TASK

#define OS_CONFIG_HOOK_PRE_TASK

Enable PreTaskHook.

If defined and set to true the PreTaskHook() will be called after a new task enters the running state.

Definition at line 144 of file CfgGenMacros.h.

◆ OS_CONFIG_HOOK_PROTECTION

#define OS_CONFIG_HOOK_PROTECTION

Enable ProtectionHook.

If defined and set to true the ProtectionHook() will be called when any of the protection facilities (e.g. stack monitoring) detects an error.

Definition at line 172 of file CfgGenMacros.h.

◆ OS_CONFIG_HOOK_SHUTDOWN

#define OS_CONFIG_HOOK_SHUTDOWN

Enable ShutdownHook.

If defined and set to true the ShutdownHook() will be called on system shutdown.

Definition at line 136 of file CfgGenMacros.h.

◆ OS_CONFIG_HOOK_STARTUP

#define OS_CONFIG_HOOK_STARTUP

Enable StartupHook.

If defined and set to true the StartupHook() will be called on system startup.

Definition at line 129 of file CfgGenMacros.h.

◆ OS_CONFIG_INT_BEGIN

#define OS_CONFIG_INT_BEGIN

Beginning of interrupt definitions.

Definition at line 272 of file CfgGenMacros.h.

◆ OS_CONFIG_INT_DEF

#define OS_CONFIG_INT_DEF (   Name,
  Prio 
)

Interrupt definition.

This will create a new interrupt and declare its ISR. Each interrupt will need a function ISR(Name).

The name must correspond to an interrupt vector of the processor. The priority is only used for resource management and does not correspond to the priorities used in handling the interrupt vectors. Category 1 ISRs must have have a priority of zero. Priority of category 2 ISRs must be at least one.

If the interrupt is triggered and the currently executed task has a higher priority the ISR will not be executed. Note that in this case interrupts will be skipped not deferred!

Parameters
NameName of the interrupt
PrioPriority of the interrupt (0 for Cat. 1 ISR; >0 for Cat. 2 ISR)

Definition at line 290 of file CfgGenMacros.h.

◆ OS_CONFIG_INT_END

#define OS_CONFIG_INT_END

Ending of interrupt definitions.

Definition at line 295 of file CfgGenMacros.h.

◆ OS_CONFIG_INTERNAL_RESOURCE_BEGIN

#define OS_CONFIG_INTERNAL_RESOURCE_BEGIN

Beginning of internal resource definitions.

Definition at line 323 of file CfgGenMacros.h.

◆ OS_CONFIG_INTERNAL_RESOURCE_DEF

#define OS_CONFIG_INTERNAL_RESOURCE_DEF (   Name,
  Prio 
)

Internal resource definition.

Parameters
NameName of the resource
PrioCeiling priority of the resource

Definition at line 331 of file CfgGenMacros.h.

◆ OS_CONFIG_INTERNAL_RESOURCE_END

#define OS_CONFIG_INTERNAL_RESOURCE_END

End of internal resource definitions.

Definition at line 336 of file CfgGenMacros.h.

◆ OS_CONFIG_MAX_ERROR_PARAM

#define OS_CONFIG_MAX_ERROR_PARAM

Configure number of parameters saved for error information.

Configure the number of parameters saved for error information. Additional parameters will not be saved.

If set to zero only the service ID will be saved.

If undefined or set to values below zero no information will be saved.

Note
While possible to only save the service ID or even nothing at all the system is not conforming to the OSEK standard in that configuration.

Definition at line 195 of file CfgGenMacros.h.

◆ OS_CONFIG_RESOURCE_BEGIN

#define OS_CONFIG_RESOURCE_BEGIN

Beginning of resource definitions.

Definition at line 300 of file CfgGenMacros.h.

◆ OS_CONFIG_RESOURCE_DEF

#define OS_CONFIG_RESOURCE_DEF (   Name,
  Prio 
)

Resource definition.

Parameters
NameName of resource
PrioCeiling priority of resource

Definition at line 308 of file CfgGenMacros.h.

◆ OS_CONFIG_RESOURCE_END

#define OS_CONFIG_RESOURCE_END

End of resource definitions.

Definition at line 313 of file CfgGenMacros.h.

◆ OS_CONFIG_SCHEDULE_TABLE_BEGIN

#define OS_CONFIG_SCHEDULE_TABLE_BEGIN

Beginning of schedule tables definitions.

Definition at line 417 of file CfgGenMacros.h.

◆ OS_CONFIG_SCHEDULE_TABLE_DEF_BEGIN

#define OS_CONFIG_SCHEDULE_TABLE_DEF_BEGIN (   Name,
  Counter,
  AutoStart,
  Cyclic,
  FinalDelay 
)

Beginning schedule table definition.

Parameters
NameName of the schedule table
CounterCounter driving the schedule table
AutoStartSet schedule table to autostart
CyclicSet schedule table to cyclic
FinalDelayDelay applied after the final expiry point

Definition at line 428 of file CfgGenMacros.h.

◆ OS_CONFIG_SCHEDULE_TABLE_DEF_END

#define OS_CONFIG_SCHEDULE_TABLE_DEF_END

Ending of schedule table definition.

This is the end of the schedule table definition. This is the counterpart to OS_CONFIG_SCHEDULE_TABLE_DEF_BEGIN.

Definition at line 536 of file CfgGenMacros.h.

◆ OS_CONFIG_SCHEDULE_TABLE_END

#define OS_CONFIG_SCHEDULE_TABLE_END

End of schedule table definitions.

Definition at line 541 of file CfgGenMacros.h.

◆ OS_CONFIG_SCHEDULE_TABLE_EVENT_ACTION_DEF

#define OS_CONFIG_SCHEDULE_TABLE_EVENT_ACTION_DEF (   Task,
  Event 
)

Definition of event action.

Defines an event action for the expiry point causing the specified event being set for the task once the offset of the expiry point is reached by the schedule table.

Definition at line 504 of file CfgGenMacros.h.

◆ OS_CONFIG_SCHEDULE_TABLE_EVENT_ACTIONS_BEGIN

#define OS_CONFIG_SCHEDULE_TABLE_EVENT_ACTIONS_BEGIN

Beginning of event actions definitions.

This starts the definition of an expiry points event actions and must therefore be place between OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINT_DEF_BEGIN and OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINT_DEF_END.

This and OS_CONFIG_SCHEDULE_TABLE_EVENT_ACTIONS_END should be omitted if no event actions are defined.

Definition at line 496 of file CfgGenMacros.h.

◆ OS_CONFIG_SCHEDULE_TABLE_EVENT_ACTIONS_END

#define OS_CONFIG_SCHEDULE_TABLE_EVENT_ACTIONS_END

Ending of event actions definitions.

This ends the definition of an expiry points event actions and is the counterpart to OS_CONFIG_SCHEDULE_TABLE_EVENT_ACTIONS_BEGIN.

Definition at line 512 of file CfgGenMacros.h.

◆ OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINT_DEF_BEGIN

#define OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINT_DEF_BEGIN (   Offset,
  NumTaskActions,
  NumEventActions 
)

Beginning of expiry point definition.

This starts the definition of a single expiry point and must therefore be placed between OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINTS_BEGIN and OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINTS_END.

Note
While this implementation allows both the task actions and the event actions to be zero at the same time the system does not conform to the AUTOSAR standard in that configuration.
Parameters
OffsetOffset of the expiry point
NumTaskActionsNumber of task actions to create for expiry point
NumEventActionsNumber of event actions to create for expiry point

Definition at line 458 of file CfgGenMacros.h.

◆ OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINT_DEF_END

#define OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINT_DEF_END

Ending of expiry point definition.

This ends the definition of an expiry point. This is the counterpart to OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINT_DEF_BEGIN

Definition at line 520 of file CfgGenMacros.h.

◆ OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINTS_BEGIN

#define OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINTS_BEGIN (   NumExpiryPoints)

Beginning of expiry points definition.

This starts the definition of expiry point of a schedule table and must therefore be placed between OS_CONFIG_SCHEDULE_TABLE_DEF_BEGIN and OS_CONFIG_SCHEDULE_TABLE_DEF_END.

The individual schedule points must defined in ascending order. Only one expiry point per offset is allowed per schedule table.

Each schedule table needs at least one expiry point.

Parameters
NumExpiryPointsNumber of expiry points to create for schedule table

Definition at line 443 of file CfgGenMacros.h.

◆ OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINTS_END

#define OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINTS_END

Ending of expiry points definitions.

This ends the list of expiry points of the schedule table. This is the counterpart to OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINTS_BEGIN.

Definition at line 528 of file CfgGenMacros.h.

◆ OS_CONFIG_SCHEDULE_TABLE_TASK_ACTION_DEF

#define OS_CONFIG_SCHEDULE_TABLE_TASK_ACTION_DEF (   Task)

Definition of task action.

Defines a task activation action for the expiry point causing the task to be activated once the offset of the expiry point is reached by the schedule table.

Parameters
TaskTask to activate

Definition at line 478 of file CfgGenMacros.h.

◆ OS_CONFIG_SCHEDULE_TABLE_TASK_ACTIONS_BEGIN

#define OS_CONFIG_SCHEDULE_TABLE_TASK_ACTIONS_BEGIN

Beginning of task actions definitions.

This starts the definition of an expiry points task actions and must therefore be place between OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINT_DEF_BEGIN and OS_CONFIG_SCHEDULE_TABLE_EXPIRY_POINT_DEF_END.

This and OS_CONFIG_SCHEDULE_TABLE_TASK_ACTIONS_END should be omitted if no task actions are defined.

Definition at line 468 of file CfgGenMacros.h.

◆ OS_CONFIG_SCHEDULE_TABLE_TASK_ACTIONS_END

#define OS_CONFIG_SCHEDULE_TABLE_TASK_ACTIONS_END

Ending of task actions definitions.

This ends the definition of an expiry points task actions and is the counterpart to OS_CONFIG_SCHEDULE_TABLE_TASK_ACTIONS_BEGIN.

Definition at line 486 of file CfgGenMacros.h.

◆ OS_CONFIG_STACK_MONITORING

#define OS_CONFIG_STACK_MONITORING

Configure stack monitoring.

Stack monitoring will check for task stack overrun on context switch. If a overrun is detected the ProtectionHook() is called with E_OS_STACKFAULT if configured. Otherwise ShutdownOS() will be called with E_OS_STACKFAULT.

The following values are possible:

  • If not configured or set to 0 stack monitoring is disabled and related variables and code are removed to conserve memory.
  • If set to >= 1 stack monitoring is performed by calculating the difference between the current stack pointer and the stack base. Note that this will only detect overruns if the stack pointer is still outside the stack region during the context switch.
  • If set to >= 2 an additional marker will be placed above the stack top. This allows to detect overruns even if the stack pointer was moved back into the stack region before the context switch but requires additional memory.
  • If set to >= 3 the stack will be initialized with 0xBE. This allows to analyze the memory sections during debugging.

For values above zero the current and maximum stack use will be saved in the task structure task_s.

Note that the above settings are only applied to task stacks. Stack monitoring for the system stack is always enabled and will always use the marker method.

Definition at line 223 of file CfgGenMacros.h.

◆ OS_CONFIG_SYSTEM_STACK

#define OS_CONFIG_SYSTEM_STACK (   Size)

Specify size of system stack.

Specify the size of the system stack in bytes. The stack will be used during ISRs.

Parameters
SizeSize of the stack created

Definition at line 232 of file CfgGenMacros.h.

◆ OS_CONFIG_TASK_BEGIN

#define OS_CONFIG_TASK_BEGIN

Beginning of task definitions.

Definition at line 237 of file CfgGenMacros.h.

◆ OS_CONFIG_TASK_DEF

#define OS_CONFIG_TASK_DEF (   Name,
  Prio,
  StackSize,
  NumberOfActivations,
  Autostart,
  TaskType,
  TaskSchedule,
  Res,
  Events 
)

Task definition.

This will create a new task and all required data structures. Each task will need a function TASK(Name).

Note
While it is possible to configure the maximum number of activations for tasks of type EXTENDED to be higher than 0 the system does not conform to the AUTOSAR standard in that case.
Parameters
NameName of task
PrioStatic priority of task
StackSizeSize of task stack in bytes (maximum of UINT16_MAX)
NumberOfActivationsNumber of times the task can be activated. Must be at least 1.
AutostartSet task to autostart (OsTaskAutostart)
TaskTypeType of task (OsTaskType)
TaskScheduleType of task scheduling (OsTaskSchedule)
ResInternal resource assigned to task
EventsEvents for this task (only applicable if TaskType equals EXTENDED)

Definition at line 257 of file CfgGenMacros.h.

◆ OS_CONFIG_TASK_END

#define OS_CONFIG_TASK_END

Ending of task definitions.

Definition at line 262 of file CfgGenMacros.h.

◆ RESOURCE_COUNT

#define RESOURCE_COUNT

Count of resources defined.

Definition at line 318 of file CfgGenMacros.h.

◆ TASK_COUNT

#define TASK_COUNT

Count of tasks defined.

Definition at line 267 of file CfgGenMacros.h.