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
|
|
|
|
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"
|
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"
|
2018-09-16 20:10:06 -07:00
|
|
|
#include "efilib.h"
|
|
|
|
#include "efitime.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2020-11-11 16:06:04 -08:00
|
|
|
#include "engine_ptr.h"
|
2018-09-16 20:10:06 -07:00
|
|
|
#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 */
|
|
|
|
|
2019-09-01 08:59:39 -07:00
|
|
|
/**
|
2019-12-17 05:56:08 -08:00
|
|
|
* reference to configuration parameter.
|
2019-09-01 08:59:39 -07:00
|
|
|
*/
|
2019-06-17 09:18:55 -07:00
|
|
|
#define DISPLAY_CONFIG(x) x
|
2019-09-01 08:59:39 -07:00
|
|
|
/**
|
|
|
|
* The main annotation of live data - reference to dynamic state variable
|
|
|
|
* See also 'TS_GET_STRUCT'
|
2019-12-17 05:56:08 -08:00
|
|
|
* The advantage of Live Data is that there is no need to copy data into tsOutputChannels structure - Live Data is reading exactly
|
|
|
|
* the same data as actual runtime logic. It's also important to have annotations of the View as close to actual implementation as possible
|
|
|
|
* to increase the changes of those being in sync.
|
|
|
|
*
|
|
|
|
* One day Live Data could be replace with a Domain Specific Language
|
|
|
|
* One day all Live Data could be provided to TS without data copy to tsOutputChannels - the idea is to have a virtual tsOutputChannels
|
|
|
|
* where rusEfi would pull data from different memory ranges depending on the requested offset, more or less virtual pages. This could depend
|
|
|
|
* on the TS bugfix described in https://github.com/rusefi/rusefi/issues/794?
|
|
|
|
*
|
2019-09-01 08:59:39 -07:00
|
|
|
*/
|
2019-06-17 09:18:55 -07:00
|
|
|
#define DISPLAY_FIELD(x) x
|
2019-09-01 08:59:39 -07:00
|
|
|
/**
|
|
|
|
* Advanced tag to access fields within data structures
|
|
|
|
* "running.fuel" variable would be referenced as DISPLAY_PREFIX(running).DISPLAY_FIELD(fuel)
|
|
|
|
*/
|
|
|
|
#define DISPLAY_PREFIX(x) x
|
|
|
|
|
|
|
|
/**
|
|
|
|
* we use this 'DISPLAY' macro if value is not used by C++ code in current context and we want to hide it from compiler
|
|
|
|
*/
|
2019-06-17 18:37:11 -07:00
|
|
|
#define DISPLAY(x)
|
2019-06-17 09:18:55 -07:00
|
|
|
|
2019-06-27 03:47:13 -07:00
|
|
|
#define DISPLAY_TAG(x)
|
2019-09-01 08:59:39 -07:00
|
|
|
/**
|
|
|
|
* Just a human-readable comment. '_' underscore symbols become spaces. EOL is handled as new line.
|
|
|
|
*/
|
2019-06-17 09:18:55 -07:00
|
|
|
#define DISPLAY_TEXT(x)
|
2019-08-31 21:45:36 -07:00
|
|
|
#define DISPLAY_STATE(x)
|
2019-09-01 08:59:39 -07:00
|
|
|
/**
|
|
|
|
* Reference to one of 'output' channels/standard gauges.
|
|
|
|
*/
|
2019-06-17 09:18:55 -07:00
|
|
|
#define DISPLAY_SENSOR(x) {}
|
2019-06-18 20:23:30 -07:00
|
|
|
#define DISPLAY_IF(x) x
|
2019-06-17 09:18:55 -07:00
|
|
|
|
2020-05-22 13:36:37 -07:00
|
|
|
#ifndef FIRMWARE_ID
|
|
|
|
#define FIRMWARE_ID "source"
|
|
|
|
#endif
|
|
|
|
|