AVR SD Safety Framework 1.0.0
Loading...
Searching...
No Matches
Task Manager Defines

Defines types and attributes used by Task Managers. More...

Files

file  define_memory_sections.h
 Defines for placing functions in specific memory sections.
file  define_schedule_entry.h
 Defines type for Task scheduling.

Data Structures

struct  scheduleEntry_t
 Defines a schedule entry containing a task function pointer and its duration. More...

Macros

#define INIT3_SECTION
 Defines compiler-specific attributes for placing a function in the .init3 memory section.

Typedefs

typedef void(* task_t) (void)
 Defines a function pointer type for tasks.

Detailed Description

Defines types and attributes used by Task Managers.

Macro Definition Documentation

◆ INIT3_SECTION

#define INIT3_SECTION

Defines compiler-specific attributes for placing a function in the .init3 memory section.

This macro is used to define the attributes used to place a function in the .init3 section, and to prevent the function from being removed during optimization, even if it is declared static and not called anywhere.

Note

The .initN sections are used to define the startup code from reset until the start of main(). These are all subparts of the .text section. The purpose of these sections is to allow for more specific placement of code within a program.

Note

The .init0, .init1, .init3 and .init5 to .init8 memory sections are unused by default.

Note

The .init2 memory section initializes the Stack Pointer and sets the zero register (the compiler assumes R1 in the CPU is zero).

Note

The .init4 memory section copies the contents of the .data section in Flash to RAM and zeroes out the .bss section.

Note

The .init9 memory section jumps to the main() function.

Warning

While in the .init3 memory section, accessing or modifying uninitialized global variables located in .data or .bss sections can lead to undefined behavior or ECC errors.

Warning
Standard library functions may rely on an initialized C runtime environment. It is recommended to avoid calling library functions that depend on the runtime environment in the .init3 memory section.

Typedef Documentation

◆ task_t

typedef void(* task_t) (void)

Defines a function pointer type for tasks.

This type represents a function pointer to a task in the Task Layer intended for scheduling. Each task is a self-contained decision-maker that utilizes services provided by the Middleware Layer to interact with hardware resources and takes no inputs.

The function pointer is deliberately defined without input parameters to enhance simplicity and promote functional safety. This design avoids the use of void pointers, which necessitate type casting and could undermine type safety. Instead, task-specific configurations are implemented using predefined macros, thereby ensuring both type safety and reliability in task operations.