rusefi/simulator/simulator/global.h

84 lines
1.4 KiB
C
Raw Normal View History

2018-09-16 17:28:23 -07:00
/*
* @file global.h
*
* Global header file for win32 or posix simulator
*
* @date May 27, 2013
2018-12-25 13:06:24 -08:00
* @author Andrey Belomutskiy, (c) 2012-2018
2018-09-16 17:28:23 -07:00
*/
#ifndef GLOBAL_H_
#define GLOBAL_H_
2015-07-10 06:01:56 -07:00
#include <hal.h>
2018-09-16 17:28:23 -07:00
#include <stdlib.h>
2015-07-10 06:01:56 -07:00
#include <time.h>
2018-09-16 20:10:06 -07:00
#include "common_headers.h"
2017-03-31 01:36:51 -07:00
2015-07-10 06:01:56 -07:00
#include "boards.h"
2018-09-16 19:00:14 -07:00
#ifdef __cplusplus
#include "chprintf.h"
#include "cli_registry.h"
#include "eficonsole.h"
#endif /* __cplusplus */
2018-11-01 12:57:50 -07:00
#define efiSetPadMode(msg, brainPin, mode) {}
2017-03-23 17:59:14 -07:00
#define EFI_UNIT_TEST FALSE
2016-04-01 17:02:26 -07:00
2017-03-23 17:59:14 -07:00
#define hasFatalError() (FALSE)
2016-04-01 17:02:26 -07:00
2015-07-10 06:01:56 -07:00
#define US_TO_NT_MULTIPLIER 100
2017-03-23 17:59:14 -07:00
#define ALWAYS_INLINE
2015-07-10 06:01:56 -07:00
#define US2NT(x) (US_TO_NT_MULTIPLIER * (x))
#define NT2US(x) ((x) / US_TO_NT_MULTIPLIER)
// need to fight 32bit int overflow
#define MY_US2ST(x) ((x) / 10)
#define EFI_ERROR_CODE 0xffffffff
#define DL_OUTPUT_BUFFER 9000
#define CCM_OPTIONAL
#define EFI_CUSTOM_PANIC_METHOD 1
// project-wide default thread stack size
#define UTILITY_THREAD_STACK_SIZE 1384
extern BaseChannel serialAdapterInstance;
2015-07-10 06:01:56 -07:00
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void printToConsole(char *p);
2018-09-16 19:00:14 -07:00
2019-02-23 09:33:49 -08:00
#define getCurrentRemainingStack() getRemainingStack(chThdGetSelfX())
2016-04-01 17:02:26 -07:00
int getRemainingStack(thread_t *otp);
2015-07-10 06:01:56 -07:00
// todo: move somewhere else?
2016-04-01 17:02:26 -07:00
bool lockAnyContext(void);
2015-07-10 06:01:56 -07:00
void unlockAnyContext(void);
void applyNewConfiguration(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#define hal_lld_get_counter_value() 0
2018-09-16 17:28:23 -07:00
#endif /* GLOBAL_H_ */
2018-09-16 19:00:14 -07:00