2015-07-10 06:01:56 -07:00
|
|
|
/*
|
|
|
|
* @file global.h
|
|
|
|
*
|
2018-12-24 19:17:13 -08:00
|
|
|
* Global utility header file for firmware
|
2018-09-16 17:28:23 -07:00
|
|
|
*
|
2018-12-24 19:57:36 -08:00
|
|
|
* Simulator and unit tests have their own version of this header
|
|
|
|
*
|
2015-07-10 06:01:56 -07:00
|
|
|
* @date May 27, 2013
|
2020-01-13 18:57:43 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2020-01-26 10:58:47 -08:00
|
|
|
#pragma once
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-07-05 16:00:44 -07:00
|
|
|
// todo: remove this from here and rely on os_access.h. unfortunately hal.h includes ch.h :(
|
2015-07-10 06:01:56 -07:00
|
|
|
#include <hal.h>
|
2019-11-13 19:02:13 -08:00
|
|
|
// *** IMPORTANT *** from painful experience we know that common_headers.h has to be included AFTER hal.h
|
|
|
|
// *** https://github.com/rusefi/rusefi/issues/1007 ***
|
2019-11-12 20:18:48 -08:00
|
|
|
#include "common_headers.h"
|
2024-02-16 15:59:09 -08:00
|
|
|
#include "single_timer_executor.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2020-11-18 11:17:00 -08:00
|
|
|
// for US_TO_NT_MULTIPLIER
|
|
|
|
#include "mpu_util.h"
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2018-09-16 20:10:06 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
#include "eficonsole.h"
|
2021-05-16 22:42:56 -07:00
|
|
|
#include <ch.hpp>
|
2018-09-16 20:10:06 -07:00
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2018-09-16 19:00:14 -07:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
/* 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)
|
|
|
|
|
2019-05-05 07:26:16 -07:00
|
|
|
#define CORE_CLOCK STM32_SYSCLK
|
|
|
|
//#pragma message(VAR_NAME_VALUE(CORE_CLOCK))
|
|
|
|
|
|
|
|
|
2019-02-23 09:12:34 -08:00
|
|
|
/**
|
|
|
|
* project-wide default thread stack size
|
|
|
|
* See also PORT_INT_REQUIRED_STACK
|
|
|
|
* See getRemainingStack()
|
2020-12-11 07:33:00 -08:00
|
|
|
* See CountFreeStackSpace()
|
2020-08-01 18:31:23 -07:00
|
|
|
* See "threadsinfo" command cmd_threads
|
2019-02-23 09:12:34 -08:00
|
|
|
*/
|
2019-03-30 14:41:46 -07:00
|
|
|
#ifndef UTILITY_THREAD_STACK_SIZE
|
2015-07-10 06:01:56 -07:00
|
|
|
#define UTILITY_THREAD_STACK_SIZE 400
|
2019-03-30 14:41:46 -07:00
|
|
|
#endif /* UTILITY_THREAD_STACK_SIZE */
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2023-06-24 23:08:53 -07:00
|
|
|
// see also validateStack
|
2020-08-02 07:52:52 -07:00
|
|
|
#define getCurrentRemainingStack() getRemainingStack(chThdGetSelfX())
|
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
#define EFI_ERROR_CODE 0xffffffff
|
|
|
|
|
2023-07-04 20:45:10 -07:00
|
|
|
#include "global_port.h"
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2020-06-17 05:42:37 -07:00
|
|
|
#define UNIT_TEST_BUSY_WAIT_CALLBACK() {}
|