forked from rusefi/rusefi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.h
59 lines (45 loc) · 1.44 KB
/
global.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* @file global.h
*
* Global utility header file for firmware
*
* Simulator and unit tests have their own version of this header
*
* @date May 27, 2013
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#pragma once
// todo: remove this from here and rely on os_access.h. unfortunately hal.h includes ch.h :(
#include <hal.h>
// *** IMPORTANT *** from painful experience we know that common_headers.h has to be included AFTER hal.h
// *** https://github.com/rusefi/rusefi/issues/1007 ***
#include "common_headers.h"
#include "single_timer_executor.h"
// for US_TO_NT_MULTIPLIER
#include "mpu_util.h"
#include <sys/types.h>
#ifdef __cplusplus
#include "eficonsole.h"
#include <ch.hpp>
#endif /* __cplusplus */
/* definition to expand macro then apply to pragma message */
#define VALUE_TO_STRING(x) #x
#define VALUE(x) VALUE_TO_STRING(x)
#define VAR_NAME_VALUE(var) #var "=" VALUE(var)
#define CORE_CLOCK STM32_SYSCLK
//#pragma message(VAR_NAME_VALUE(CORE_CLOCK))
/**
* project-wide default thread stack size
* See also PORT_INT_REQUIRED_STACK
* See getRemainingStack()
* See CountFreeStackSpace()
* See "threadsinfo" command cmd_threads
*/
#ifndef UTILITY_THREAD_STACK_SIZE
#define UTILITY_THREAD_STACK_SIZE 400
#endif /* UTILITY_THREAD_STACK_SIZE */
// see also validateStack
#define getCurrentRemainingStack() getRemainingStack(chThdGetSelfX())
#define EFI_ERROR_CODE 0xffffffff
#include "global_port.h"
#define UNIT_TEST_BUSY_WAIT_CALLBACK() {}