rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
common_headers.h
Go to the documentation of this file.
1/*
2 * @file common_headers.h
3 *
4 * Header file shared between firmware, simulator and unit_tests
5 *
6 * @date Sep 16, 2018
7 * @author Andrey Belomutskiy, (c) 2012-2020
8 */
9
10#pragma once
11
12#include <rusefi/true_false.h>
13
14#ifdef __cplusplus
15#define EXTERNC extern "C"
16#else
17#define EXTERNC
18#endif
19
20#include "efifeatures.h"
21#include "rusefi_types.h"
22#include "efi_quote.h"
23
24#include <cmath>
25#include <stdio.h>
26
27#include "auto_generated_enums.h"
31#include "efilib.h"
32#include "efitime.h"
33
34// FIRMWARE_ID is only used to display custom nicer board names to the user in console window and error message
35#ifndef FIRMWARE_ID
36#define FIRMWARE_ID QUOTE(SHORT_BOARD_NAME)
37#endif
38
39#ifdef __cplusplus
40#include "datalogging.h"
41#include "cli_registry.h"
42#endif /* __cplusplus */
43
44#define EXPECTED_REMAINING_STACK 128
45
46#define EFI_CONFIGURATION_STORAGE (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE) || (EFI_STORAGE_SD == TRUE)
47
48#define hasLotsOfRemainingStack() (getCurrentRemainingStack() > EXPECTED_REMAINING_STACK)
49
50// this macro helps locate all board Public API methods
51// DEPRECATED that's a bad pattern - weak linking is extremely fragile, we risk changing method signature
52// and loosing magic
53// open question what's best way?
54//
55// better option one: listeners
56// better option two: required per-board method, like what we do for getWarningLedPin() etc
57#define PUBLIC_API_WEAK __attribute__((weak))
Command-line interface commands registry.
Buffered console output stream header.