distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
BIND_LOW_LEVEL_INITIALIZER.h File Reference

BIND_LOW_LEVEL_INITIALIZER() macro. More...

Include dependency graph for BIND_LOW_LEVEL_INITIALIZER.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BIND_LOW_LEVEL_INITIALIZER(priority, function)   BIND_LOW_LEVEL_INITIALIZER_IMPLEMENTATION(priority, function, ".low_level_initializers.")
 Binds function as low-level initializer with specified priority. More...
 

Detailed Description

BIND_LOW_LEVEL_INITIALIZER() macro.

Author
Copyright (C) 2018-2019 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
License
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Macro Definition Documentation

◆ BIND_LOW_LEVEL_INITIALIZER

#define BIND_LOW_LEVEL_INITIALIZER (   priority,
  function 
)    BIND_LOW_LEVEL_INITIALIZER_IMPLEMENTATION(priority, function, ".low_level_initializers.")

Binds function as low-level initializer with specified priority.

Low-level initializers are executed after .bss and .data sections have been initialized, but before constructors for global and static objects. They are automatically executed in ascending order of priority. When there is a group of multiple low-level initializers with the same priority, the execution order within that group is unspecified.

Values of priority used internally by distortos:

  • 10 - main() thread and scheduler low-level initialization,
  • 20 - idle thread low-level initialization,
  • 30 - architecture low-level initialization,
  • 40 - chip low-level initialization,
  • 50 - peripherals low-level initialization,
  • 60 - board low-level initialization,
  • 70 - start of scheduling.
Parameters
[in]priorityis the priority of the low-level initializer, [0; 99]
[in]functionis the low-level initializer function