2018-09-16 20:10:06 -07:00
|
|
|
/*
|
|
|
|
* @file common_headers.h
|
|
|
|
*
|
2018-12-25 13:06:24 -08:00
|
|
|
* Header file shared between firmware, simulator and unit_tests
|
|
|
|
*
|
2018-09-16 20:10:06 -07:00
|
|
|
* @date Sep 16, 2018
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2018-09-16 20:10:06 -07:00
|
|
|
*/
|
|
|
|
|
2020-03-28 16:49:36 -07:00
|
|
|
#pragma once
|
2018-09-16 20:10:06 -07:00
|
|
|
|
2023-10-31 06:30:58 -07:00
|
|
|
#include <rusefi/true_false.h>
|
2022-09-05 01:09:59 -07:00
|
|
|
|
2019-04-04 20:03:32 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
#define EXTERNC extern "C"
|
|
|
|
#else
|
|
|
|
#define EXTERNC
|
|
|
|
#endif
|
|
|
|
|
2018-09-16 20:10:06 -07:00
|
|
|
#include "efifeatures.h"
|
2018-12-08 13:06:14 -08:00
|
|
|
#include "rusefi_types.h"
|
2024-01-10 09:57:33 -08:00
|
|
|
#include "efi_quote.h"
|
2018-09-16 20:10:06 -07:00
|
|
|
|
|
|
|
#include <math.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "auto_generated_enums.h"
|
2021-07-12 18:21:43 -07:00
|
|
|
#include "auto_generated_commonenum.h"
|
2021-10-23 19:07:07 -07:00
|
|
|
#include "auto_generated_enginetypes.h"
|
2018-09-16 20:10:06 -07:00
|
|
|
#include "efilib.h"
|
|
|
|
#include "efitime.h"
|
|
|
|
|
2024-01-10 09:57:33 -08:00
|
|
|
// FIRMWARE_ID is only used to display custom nicer board names to the user in console window and error message
|
|
|
|
#ifndef FIRMWARE_ID
|
|
|
|
#define FIRMWARE_ID QUOTE(SHORT_BOARD_NAME)
|
|
|
|
#endif
|
|
|
|
|
2018-09-16 20:10:06 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
#include "datalogging.h"
|
2019-09-18 18:38:45 -07:00
|
|
|
#include "cli_registry.h"
|
2018-09-16 20:10:06 -07:00
|
|
|
#endif /* __cplusplus */
|
2023-06-11 20:36:38 -07:00
|
|
|
|
|
|
|
#define EXPECTED_REMAINING_STACK 128
|
|
|
|
|
2024-05-05 12:38:21 -07:00
|
|
|
#define EFI_CONFIGURATION_STORAGE (EFI_STORAGE_INT_FLASH == TRUE) || (EFI_STORAGE_MFS == TRUE)
|
|
|
|
|
2023-06-24 23:08:53 -07:00
|
|
|
// see also validateStack
|
|
|
|
#define hasLotsOfRemainingStack() (getCurrentRemainingStack() > EXPECTED_REMAINING_STACK)
|
2024-03-24 19:06:58 -07:00
|
|
|
|
|
|
|
// this macro helps locate all board API methods
|
2024-07-09 18:04:46 -07:00
|
|
|
// todo: dup of BOARD_WEAK?
|
2024-03-24 19:06:58 -07:00
|
|
|
#define PUBLIC_API_WEAK __attribute__((weak))
|