AutosarOS
|
Macros used for generation of system. More...
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... | |
Macros used for generation of system.
Definition in file CfgGenMacros.h.
#define ALARM_COUNT |
Count of alarm defined.
Definition at line 402 of file CfgGenMacros.h.
#define COUNTER_COUNT |
Count of counters defined.
Definition at line 363 of file CfgGenMacros.h.
#define OS_CONFIG_ALARM_BEGIN |
Begin of alarm definitions.
Definition at line 368 of file CfgGenMacros.h.
#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.
Name | Name of the callback function |
Definition at line 412 of file CfgGenMacros.h.
#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.
Name | Name of the alarm |
Base | Counter used as alarm base |
AutoStart | Set alarm to autostart |
Event | Event to set (only applicable when Type is ALARM_ACTION_EVENT) |
Type | Type of alarm (see alarmActionType_e) |
Action | Action to be performed |
Expiration | Expiration value of alarm (must be between zero and the maximum allowed value of the base) |
Cycle | Cycle of the alarm (must be zero or between minCycle and maximum allowed value of the base) |
Definition at line 392 of file CfgGenMacros.h.
#define OS_CONFIG_ALARM_END |
End of alarm definitions.
Definition at line 397 of file CfgGenMacros.h.
#define OS_CONFIG_COUNTER_BEGIN |
Begin of counter definitions.
Definition at line 341 of file CfgGenMacros.h.
#define OS_CONFIG_COUNTER_DEF | ( | Name, | |
MaxAllowedValue, | |||
MinCycle, | |||
TicksPerBase, | |||
Type, | |||
SecondsPerTick | |||
) |
Counter definition.
Name | Name of the counter |
MaxAllowedValue | Maximum allowed counter value |
MinCycle | Smallest allowed value for the cycle-parameter of cyclic alarms |
TicksPerBase | Number of ticks required to reach a counter-specific unit |
Type | Type of the counter in counterType_e |
SecondsPerTick | Time of one counter tick in seconds |
Definition at line 353 of file CfgGenMacros.h.
#define OS_CONFIG_COUNTER_END |
End of counter definitions.
Definition at line 358 of file CfgGenMacros.h.
#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.
#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.
#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.
#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.
#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.
#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.
#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.
#define OS_CONFIG_INT_BEGIN |
Beginning of interrupt definitions.
Definition at line 272 of file CfgGenMacros.h.
#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!
Name | Name of the interrupt |
Prio | Priority of the interrupt (0 for Cat. 1 ISR; >0 for Cat. 2 ISR) |
Definition at line 290 of file CfgGenMacros.h.
#define OS_CONFIG_INT_END |
Ending of interrupt definitions.
Definition at line 295 of file CfgGenMacros.h.
#define OS_CONFIG_INTERNAL_RESOURCE_BEGIN |
Beginning of internal resource definitions.
Definition at line 323 of file CfgGenMacros.h.
#define OS_CONFIG_INTERNAL_RESOURCE_DEF | ( | Name, | |
Prio | |||
) |
Internal resource definition.
Name | Name of the resource |
Prio | Ceiling priority of the resource |
Definition at line 331 of file CfgGenMacros.h.
#define OS_CONFIG_INTERNAL_RESOURCE_END |
End of internal resource definitions.
Definition at line 336 of file CfgGenMacros.h.
#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.
Definition at line 195 of file CfgGenMacros.h.
#define OS_CONFIG_RESOURCE_BEGIN |
Beginning of resource definitions.
Definition at line 300 of file CfgGenMacros.h.
#define OS_CONFIG_RESOURCE_DEF | ( | Name, | |
Prio | |||
) |
Resource definition.
Name | Name of resource |
Prio | Ceiling priority of resource |
Definition at line 308 of file CfgGenMacros.h.
#define OS_CONFIG_RESOURCE_END |
End of resource definitions.
Definition at line 313 of file CfgGenMacros.h.
#define OS_CONFIG_SCHEDULE_TABLE_BEGIN |
Beginning of schedule tables definitions.
Definition at line 417 of file CfgGenMacros.h.
#define OS_CONFIG_SCHEDULE_TABLE_DEF_BEGIN | ( | Name, | |
Counter, | |||
AutoStart, | |||
Cyclic, | |||
FinalDelay | |||
) |
Beginning schedule table definition.
Name | Name of the schedule table |
Counter | Counter driving the schedule table |
AutoStart | Set schedule table to autostart |
Cyclic | Set schedule table to cyclic |
FinalDelay | Delay applied after the final expiry point |
Definition at line 428 of file CfgGenMacros.h.
#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.
#define OS_CONFIG_SCHEDULE_TABLE_END |
End of schedule table definitions.
Definition at line 541 of file CfgGenMacros.h.
#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.
#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.
#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.
#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.
Offset | Offset of the expiry point |
NumTaskActions | Number of task actions to create for expiry point |
NumEventActions | Number of event actions to create for expiry point |
Definition at line 458 of file CfgGenMacros.h.
#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.
#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.
NumExpiryPoints | Number of expiry points to create for schedule table |
Definition at line 443 of file CfgGenMacros.h.
#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.
#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.
Task | Task to activate |
Definition at line 478 of file CfgGenMacros.h.
#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.
#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.
#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:
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.
#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.
Size | Size of the stack created |
Definition at line 232 of file CfgGenMacros.h.
#define OS_CONFIG_TASK_BEGIN |
Beginning of task definitions.
Definition at line 237 of file CfgGenMacros.h.
#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).
Name | Name of task |
Prio | Static priority of task |
StackSize | Size of task stack in bytes (maximum of UINT16_MAX) |
NumberOfActivations | Number of times the task can be activated. Must be at least 1. |
Autostart | Set task to autostart (OsTaskAutostart) |
TaskType | Type of task (OsTaskType) |
TaskSchedule | Type of task scheduling (OsTaskSchedule) |
Res | Internal resource assigned to task |
Events | Events for this task (only applicable if TaskType equals EXTENDED) |
Definition at line 257 of file CfgGenMacros.h.
#define OS_CONFIG_TASK_END |
Ending of task definitions.
Definition at line 262 of file CfgGenMacros.h.
#define RESOURCE_COUNT |
Count of resources defined.
Definition at line 318 of file CfgGenMacros.h.
#define TASK_COUNT |
Count of tasks defined.
Definition at line 267 of file CfgGenMacros.h.