Refactoring: OS access should be explicit #867

This commit is contained in:
rusefi 2019-07-04 03:57:21 -04:00
parent 0295c343b9
commit 83ad64eade
20 changed files with 30 additions and 18 deletions

View File

@ -60,6 +60,7 @@
*/ */
#include "global.h" #include "global.h"
#include "os_access.h"
#include "allsensors.h" #include "allsensors.h"
#include "tunerstudio.h" #include "tunerstudio.h"

View File

@ -19,6 +19,7 @@
#include "global.h" #include "global.h"
#if EFI_HD44780_LCD #if EFI_HD44780_LCD
#include "os_access.h"
#include "lcd_controller.h" #include "lcd_controller.h"
#include "lcd_HD44780.h" #include "lcd_HD44780.h"

View File

@ -21,6 +21,7 @@
*/ */
#include "global.h" #include "global.h"
#include "os_access.h"
#include "engine_configuration.h" #include "engine_configuration.h"
#include "fsio_impl.h" #include "fsio_impl.h"
#include "allsensors.h" #include "allsensors.h"

View File

@ -9,7 +9,6 @@
#define EVENT_REGISTRY_H_ #define EVENT_REGISTRY_H_
#include "global.h" #include "global.h"
#include "os_access.h"
#include "signal_executor.h" #include "signal_executor.h"
#include "fl_stack.h" #include "fl_stack.h"
#include "trigger_structure.h" #include "trigger_structure.h"

View File

@ -2,12 +2,11 @@
* @file error_handling.cpp * @file error_handling.cpp
* *
* @date Apr 1, 2014 * @date Apr 1, 2014
* @author Andrey Belomutskiy, (c) 2012-2018 * @author Andrey Belomutskiy, (c) 2012-2019
*/ */
#include "engine.h" #include "engine.h"
#include "io_pins.h" #include "os_access.h"
#if EFI_SIMULATOR || EFI_PROD_CODE #if EFI_SIMULATOR || EFI_PROD_CODE
//todo: move into simulator global //todo: move into simulator global

View File

@ -16,6 +16,7 @@
#include "global.h" #include "global.h"
#if EFI_FSIO #if EFI_FSIO
#include "os_access.h"
#include "fsio_core.h" #include "fsio_core.h"
#include "fsio_impl.h" #include "fsio_impl.h"

View File

@ -11,6 +11,8 @@
#if EFI_INTERNAL_FLASH #if EFI_INTERNAL_FLASH
#include "flash_main.h" #include "flash_main.h"
#include "eficonsole.h" #include "eficonsole.h"
#include "os_access.h"
#include "flash.h" #include "flash.h"
#include "engine_math.h" #include "engine_math.h"

View File

@ -26,6 +26,7 @@
#include "map.h" #include "map.h"
#if EFI_MAP_AVERAGING #if EFI_MAP_AVERAGING
#include "os_access.h"
#include "map_averaging.h" #include "map_averaging.h"
#include "trigger_central.h" #include "trigger_central.h"

View File

@ -16,9 +16,9 @@
#include "maf2map.h" #include "maf2map.h"
#include "config_engine_specs.h" #include "config_engine_specs.h"
//todo#if defined(HAS_OS_ACCESS) #if defined(HAS_OS_ACCESS)
//todo#error "Unexpected OS ACCESS HERE" #error "Unexpected OS ACCESS HERE"
//todo#endif #endif
#define rpmMin 500 #define rpmMin 500
#define rpmMax 8000 #define rpmMax 8000

View File

@ -25,6 +25,8 @@
#if EFI_SIGNAL_EXECUTOR_ONE_TIMER #if EFI_SIGNAL_EXECUTOR_ONE_TIMER
#include "os_access.h"
#include "microsecond_timer.h" #include "microsecond_timer.h"
#include "tunerstudio_configuration.h" #include "tunerstudio_configuration.h"
#include "rfiutil.h" #include "rfiutil.h"

View File

@ -21,6 +21,7 @@
#include "global.h" #include "global.h"
#include "engine.h" #include "engine.h"
#include "os_access.h"
#include "trigger_bmw.h" #include "trigger_bmw.h"
#include "trigger_chrysler.h" #include "trigger_chrysler.h"
#include "trigger_gm.h" #include "trigger_gm.h"

View File

@ -22,6 +22,7 @@
*/ */
#include "global.h" #include "global.h"
#include "os_access.h"
#if EFI_PROD_CODE #if EFI_PROD_CODE
#include <nvic.h> #include <nvic.h>
#endif #endif

View File

@ -7,6 +7,7 @@
*/ */
#include "global.h" #include "global.h"
#include "os_access.h"
#include "trigger_central.h" #include "trigger_central.h"
#include "trigger_decoder.h" #include "trigger_decoder.h"

View File

@ -25,6 +25,7 @@
*/ */
#include "global.h" #include "global.h"
#include "os_access.h"
#include "engine_sniffer.h" #include "engine_sniffer.h"
#include "adc_inputs.h" #include "adc_inputs.h"

View File

@ -23,6 +23,7 @@
#include "global.h" #include "global.h"
#if HAL_USE_ADC #if HAL_USE_ADC
#include "os_access.h"
#include "engine.h" #include "engine.h"
#include "adc_inputs.h" #include "adc_inputs.h"

View File

@ -7,7 +7,7 @@
#include "global.h" #include "global.h"
int getRemainingStack(Thread *otp) { EXTERNC int getRemainingStack(Thread *otp) {
return 9999; return 9999;
} }

View File

@ -32,7 +32,7 @@ extern uint32_t __main_stack_base__;
typedef struct port_intctx intctx_t; typedef struct port_intctx intctx_t;
int getRemainingStack(thread_t *otp) { EXTERNC int getRemainingStack(thread_t *otp) {
#if CH_DBG_ENABLE_STACK_CHECK #if CH_DBG_ENABLE_STACK_CHECK
// this would dismiss coverity warning - see http://rusefi.com/forum/viewtopic.php?f=5&t=655 // this would dismiss coverity warning - see http://rusefi.com/forum/viewtopic.php?f=5&t=655
@ -59,7 +59,7 @@ int getRemainingStack(thread_t *otp) {
extern uint32_t CSTACK$$Base; /* symbol created by the IAR linker */ extern uint32_t CSTACK$$Base; /* symbol created by the IAR linker */
extern uint32_t IRQSTACK$$Base; /* symbol created by the IAR linker */ extern uint32_t IRQSTACK$$Base; /* symbol created by the IAR linker */
int getRemainingStack(thread_t *otp) { EXTERNC int getRemainingStack(thread_t *otp) {
#if CH_DBG_ENABLE_STACK_CHECK #if CH_DBG_ENABLE_STACK_CHECK
int remainingStack; int remainingStack;
if (ch.dbg.isr_cnt > 0) { if (ch.dbg.isr_cnt > 0) {

View File

@ -29,7 +29,7 @@ extern uint32_t __main_stack_base__;
typedef struct port_intctx intctx_t; typedef struct port_intctx intctx_t;
int getRemainingStack(thread_t *otp) { EXTERNC int getRemainingStack(thread_t *otp) {
#if CH_DBG_ENABLE_STACK_CHECK #if CH_DBG_ENABLE_STACK_CHECK
// this would dismiss coverity warning - see http://rusefi.com/forum/viewtopic.php?f=5&t=655 // this would dismiss coverity warning - see http://rusefi.com/forum/viewtopic.php?f=5&t=655
@ -57,7 +57,7 @@ int getRemainingStack(thread_t *otp) {
extern uint32_t CSTACK$$Base; /* symbol created by the IAR linker */ extern uint32_t CSTACK$$Base; /* symbol created by the IAR linker */
extern uint32_t IRQSTACK$$Base; /* symbol created by the IAR linker */ extern uint32_t IRQSTACK$$Base; /* symbol created by the IAR linker */
int getRemainingStack(thread_t *otp) { EXTERNC int getRemainingStack(thread_t *otp) {
#if CH_DBG_ENABLE_STACK_CHECK #if CH_DBG_ENABLE_STACK_CHECK
int remainingStack; int remainingStack;
if (ch.dbg.isr_cnt > 0) { if (ch.dbg.isr_cnt > 0) {

View File

@ -18,17 +18,18 @@ extern "C"
#include <ch.h> #include <ch.h>
#include <hal.h> #include <hal.h>
#include "chprintf.h" #include "chprintf.h"
#ifdef __cplusplus
}
#endif /* __cplusplus */
#include "io_pins.h" #include "io_pins.h"
/* /*
* Stack debugging * Stack debugging
* See also getMaxUsedStack() * See also getMaxUsedStack()
*/ */
int getRemainingStack(thread_t *otp); EXTERNC int getRemainingStack(thread_t *otp);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#define HAS_OS_ACCESS #define HAS_OS_ACCESS

View File

@ -9,7 +9,6 @@
#define PID_H_ #define PID_H_
#include "global.h" #include "global.h"
#include "os_access.h"
#include "engine_configuration_generated_structures.h" #include "engine_configuration_generated_structures.h"
#if EFI_PROD_CODE || EFI_SIMULATOR #if EFI_PROD_CODE || EFI_SIMULATOR