Refactoring: OS access should be explicit #867

This commit is contained in:
rusefi 2019-07-03 21:48:04 -04:00
parent aaae4a2278
commit b81c60cf3e
29 changed files with 51 additions and 21 deletions

View File

@ -6,6 +6,7 @@
*/
#include "global.h"
#include "os_access.h"
#include "tunerstudio_io.h"
#include "console_io.h"
#include "engine.h"

View File

@ -23,7 +23,7 @@
#include <stdarg.h>
#include "global.h"
#include <chprintf.h>
#include "os_access.h"
#include "eficonsole.h"
#include "console_io.h"
#include "svnversion.h"

View File

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

View File

@ -12,7 +12,6 @@
#if EFI_SIMULATOR || EFI_PROD_CODE
//todo: move into simulator global
#include "memstreams.h"
#include <chprintf.h>
static MemoryStream warningStream;
static MemoryStream firmwareErrorMessageStream;
#endif /* EFI_SIMULATOR || EFI_PROD_CODE */

View File

@ -22,6 +22,7 @@
*/
#include "global.h"
#include "os_access.h"
#if EFI_SENSOR_CHART
#include "sensor_chart.h"
#endif

View File

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

View File

@ -12,6 +12,7 @@
*/
#include "global.h"
#include "os_access.h"
#include "event_queue.h"
#include "efitime.h"
#include "rfiutil.h"

View File

@ -9,6 +9,7 @@
*/
#include "global.h"
#include "os_access.h"
#include "pwm_generator_logic.h"
#include "pwm_generator.h"
#include "error_handling.h"

View File

@ -2,6 +2,7 @@
* @author Matthew Kennedy, (c) 2017
*/
#include "global.h"
#include "os_access.h"
#include "oil_pressure.h"
#include "interpolation.h"
#include "analog_input.h"

View File

@ -12,6 +12,7 @@
#include "engine.h"
#include "rpm_calculator.h"
#include "os_access.h"
#include "trigger_central.h"
#include "engine_configuration.h"

View File

@ -6,6 +6,8 @@
*/
#include "engine_math.h"
#include "os_access.h"
#include "utlist.h"
#include "event_queue.h"
#include "rfiutil.h"

View File

@ -19,6 +19,8 @@
*/
#include "global.h"
#include "os_access.h"
#include "obd_error_codes.h"
#include "trigger_decoder.h"

View File

@ -7,6 +7,7 @@
*/
#include "global.h"
#include "os_access.h"
#include "poten.h"
#include "eficonsole.h"
#include "pin_repository.h"

View File

@ -7,6 +7,7 @@
#include "sensor_chart.h"
#include "global.h"
#include "os_access.h"
#include "engine.h"
#include "rpm_calculator.h"

View File

@ -23,6 +23,7 @@
*/
#include "global.h"
#include "os_access.h"
#if EFI_PERF_METRICS

View File

@ -12,6 +12,7 @@
*/
#include "global.h"
#include "os_access.h"
#include "wave_analyzer.h"
#include "eficonsole.h"
#include "data_buffer.h"

View File

@ -23,6 +23,9 @@ extern "C"
// todo: remove these two from here and rely on os_access.h
#include <ch.h>
#include <hal.h>
#include "chprintf.h"
#include "common_headers.h"
#include "io_pins.h"
// this is about MISRA not liking 'time.h'. todo: figure out something
#if defined __GNUC__
@ -36,17 +39,12 @@ typedef unsigned int time_t;
#define ALWAYS_INLINE INLINE
#endif
#include "common_headers.h"
#include "io_pins.h"
#ifdef __cplusplus
#include "cli_registry.h"
#include "eficonsole.h"
#endif /* __cplusplus */
#include "chprintf.h"
/* definition to expand macro then apply to pragma message */
#define VALUE_TO_STRING(x) #x
@ -112,12 +110,6 @@ typedef unsigned int time_t;
#define getCurrentRemainingStack() getRemainingStack(chThdGetSelfX())
/*
* Stack debugging
* See also getMaxUsedStack()
*/
int getRemainingStack(thread_t *otp);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -12,6 +12,7 @@
*/
#include "global.h"
#include "os_access.h"
#include "microsecond_timer.h"
#include "scheduler.h"
#include "rfiutil.h"

View File

@ -14,7 +14,6 @@
#include "pin_repository.h"
#include "eficonsole.h"
#include "memstreams.h"
#include "chprintf.h"
#include "drivers/gpio/gpio_ext.h"
#ifndef BOARD_EXT_PINREPOPINS

View File

@ -9,6 +9,7 @@
#include <string.h>
#include <time.h>
#include "global.h"
#include "os_access.h"
#include "rfiutil.h"
#include "rtc_helper.h"

View File

@ -13,8 +13,6 @@
#include "usbconsole.h"
#include "usbcfg.h"
#include "efifeatures.h"
static bool isUsbSerialInitialized = false;

View File

@ -8,6 +8,7 @@
*/
#include "global.h"
#include "os_access.h"
#include "rusefi.h"
#include "mpu_util.h"

View File

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

View File

@ -105,6 +105,7 @@
*/
#include "global.h"
#include "os_access.h"
#include "trigger_structure.h"
#include "hardware.h"
#include "engine_controller.h"

View File

@ -33,7 +33,7 @@
#include "global.h"
#if ! EFI_UNIT_TEST
#include "chprintf.h"
#include "os_access.h"
#include "chmtx.h"
#include "memstreams.h"
#include "console_io.h"

View File

@ -9,6 +9,7 @@
*/
#include "pid.h"
#include "os_access.h"
#include "math.h"
Pid::Pid() {

View File

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

View File

@ -21,7 +21,6 @@
#include <string.h>
#include "global.h"
#include "rfiutil.h"
/*
not used, not sure if we still need it. I guess we will remove it in 2015
@ -57,6 +56,7 @@
#if !EFI_UNIT_TEST
#include "os_access.h"
#include "rfiutil.h"
void chVTSetAny(virtual_timer_t *vtp, systime_t time, vtfunc_t vtfunc, void *par) {
bool wasLocked = lockAnyContext();

13
unit_tests/os_access.h Normal file
View File

@ -0,0 +1,13 @@
/*
* os_access.h
*
* It's probably a sign of a problem that this file is needed.
*
* Created on: Jul 3, 2019
* @author Andrey Belomutskiy, (c) 2012-2019
*/
#ifndef OS_ACCESS_H_
#define OS_ACCESS_H_
#endif /* OS_ACCESS_H_ */