better simulator folder name

This commit is contained in:
rusefi 2017-04-10 10:00:42 -04:00
parent 25195c3093
commit fa07ec66b1
28 changed files with 2161 additions and 14 deletions

View File

@ -10,7 +10,7 @@ java -version
echo %date% %time% echo %date% %time%
echo build_current_bundle.bat: Building win32 functional tests echo build_current_bundle.bat: Building win32 functional tests
cd win32_functional_tests cd simulator
gcc -v gcc -v
make -v make -v
cd .. cd ..
@ -52,7 +52,7 @@ if not exist java_console_binary/rusefi_console.jar echo CONSOLE COMPILATION FAI
if not exist java_console_binary/rusefi_console.jar exit -1 if not exist java_console_binary/rusefi_console.jar exit -1
echo Building rusefi simulator echo Building rusefi simulator
cd win32_functional_tests cd simulator
mkdir out mkdir out
rm -rf build rm -rf build
@ -78,7 +78,7 @@ echo %folder%
mkdir %folder% mkdir %folder%
cp java_console_binary/rusefi_console.jar %folder% cp java_console_binary/rusefi_console.jar %folder%
cp win32_functional_tests/build/rusefi_simulator.exe %folder% cp simulator/build/rusefi_simulator.exe %folder%
cp firmware/tunerstudio/rusefi.ini %folder% cp firmware/tunerstudio/rusefi.ini %folder%
cp firmware/svnversion.h %folder% cp firmware/svnversion.h %folder%
@ -123,7 +123,7 @@ pwd
echo "Making rusefi_simulator.zip" echo "Making rusefi_simulator.zip"
pwd pwd
zip -j temp/rusefi_simulator.zip win32_functional_tests/build/rusefi_simulator.exe firmware/tunerstudio/rusefi.ini java_console_binary/rusefi_console.jar zip -j temp/rusefi_simulator.zip simulator/build/rusefi_simulator.exe firmware/tunerstudio/rusefi.ini java_console_binary/rusefi_console.jar
echo open ftp://u71977750-build:%RUSEFI_BUILD_FTP_PASS%@rusefi.com/ > ftp_commands.txt echo open ftp://u71977750-build:%RUSEFI_BUILD_FTP_PASS%@rusefi.com/ > ftp_commands.txt

View File

@ -26,14 +26,14 @@ rd /s /q %RUSEFI_SVN_W_PATH%\hardware
rd /s /q %RUSEFI_SVN_W_PATH%\java_console rd /s /q %RUSEFI_SVN_W_PATH%\java_console
rd /s /q %RUSEFI_SVN_W_PATH%\unit_tests rd /s /q %RUSEFI_SVN_W_PATH%\unit_tests
rd /s /q %RUSEFI_SVN_W_PATH%\misc rd /s /q %RUSEFI_SVN_W_PATH%\misc
rd /s /q %RUSEFI_SVN_W_PATH%\win32_functional_tests rd /s /q %RUSEFI_SVN_W_PATH%\simulator
cp -r firmware %RUSEFI_SVN_PATH% cp -r firmware %RUSEFI_SVN_PATH%
cp -r hardware %RUSEFI_SVN_PATH% cp -r hardware %RUSEFI_SVN_PATH%
cp -r java_console %RUSEFI_SVN_PATH% cp -r java_console %RUSEFI_SVN_PATH%
cp -r unit_tests %RUSEFI_SVN_PATH% cp -r unit_tests %RUSEFI_SVN_PATH%
cp -r misc %RUSEFI_SVN_PATH% cp -r misc %RUSEFI_SVN_PATH%
cp -r win32_functional_tests %RUSEFI_SVN_PATH% cp -r simulator %RUSEFI_SVN_PATH%
rem rm -f %RUSEFI_GIT_PATH%/readme.* rem rm -f %RUSEFI_GIT_PATH%/readme.*
rem rm -f %RUSEFI_GIT_PATH%/README.* rem rm -f %RUSEFI_GIT_PATH%/README.*
cp -r README.* %RUSEFI_SVN_PATH% cp -r README.* %RUSEFI_SVN_PATH%

View File

@ -1,5 +1,5 @@
zip -j rusefi_simulator.zip win32_functional_tests/build/rusefi_simulator.exe firmware/tunerstudio/rusefi.ini java_console_binary/rusefi_console.jar zip -j rusefi_simulator.zip simulator/build/rusefi_simulator.exe firmware/tunerstudio/rusefi.ini java_console_binary/rusefi_console.jar
echo user u71977750-build> ftpcmd.dat echo user u71977750-build> ftpcmd.dat
echo XXX >> ftpcmd.dat echo XXX >> ftpcmd.dat

View File

@ -15,13 +15,13 @@ rd /s /q %RUSEFI_GIT_PATH%\firmware
rd /s /q %RUSEFI_GIT_PATH%\hardware rd /s /q %RUSEFI_GIT_PATH%\hardware
rd /s /q %RUSEFI_GIT_PATH%\java_console rd /s /q %RUSEFI_GIT_PATH%\java_console
rd /s /q %RUSEFI_GIT_PATH%\unit_tests rd /s /q %RUSEFI_GIT_PATH%\unit_tests
rd /s /q %RUSEFI_GIT_PATH%\win32_functional_tests rd /s /q %RUSEFI_GIT_PATH%\simulator
cp -r firmware %RUSEFI_GIT_PATH% cp -r firmware %RUSEFI_GIT_PATH%
cp -r hardware %RUSEFI_GIT_PATH% cp -r hardware %RUSEFI_GIT_PATH%
cp -r java_console %RUSEFI_GIT_PATH% cp -r java_console %RUSEFI_GIT_PATH%
cp -r unit_tests %RUSEFI_GIT_PATH% cp -r unit_tests %RUSEFI_GIT_PATH%
cp -r win32_functional_tests %RUSEFI_GIT_PATH% cp -r simulator %RUSEFI_GIT_PATH%
rm -f %RUSEFI_GIT_PATH%/readme.* rm -f %RUSEFI_GIT_PATH%/readme.*
rm -f %RUSEFI_GIT_PATH%/README.* rm -f %RUSEFI_GIT_PATH%/README.*
cp -r README.* %RUSEFI_GIT_PATH% cp -r README.* %RUSEFI_GIT_PATH%

42
simulator/.cproject Normal file
View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.toolchain.gnu.cygwin.base.708884018">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.cygwin.base.708884018" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.Cygwin_PE" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration buildProperties="" id="cdt.managedbuild.toolchain.gnu.cygwin.base.708884018" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.cygwin.base.708884018.399281622" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.base.1622324288" name="cdt.managedbuild.toolchain.gnu.cygwin.base" superClass="cdt.managedbuild.toolchain.gnu.cygwin.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.Cygwin_PE" id="cdt.managedbuild.target.gnu.platform.cygwin.base.1248686809" name="Debug Platform" osList="win32" superClass="cdt.managedbuild.target.gnu.platform.cygwin.base"/>
<builder id="cdt.managedbuild.target.gnu.builder.cygwin.base.1348377632" managedBuildOn="false" name="Gnu Make Builder.Default" superClass="cdt.managedbuild.target.gnu.builder.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.base.1582437132" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.1785548679" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base.2026199438" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.base.264596926" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.base.1428225087" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base.98334676" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.base"/>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="win32_functional_tests.null.780571766" name="win32_functional_tests"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
</cproject>

27
simulator/.project Normal file
View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>win32_functional_tests</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>

259
simulator/Makefile Normal file
View File

@ -0,0 +1,259 @@
##############################################################################
# Build global options
# NOTE: Can be overridden externally.
#
# Compiler options here.
ifeq ($(USE_OPT),)
# this config if debugging is needed, but the binary is about 50M
# USE_OPT = -Wall -ggdb -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers -Wno-error=write-strings -Wno-error=strict-aliasing
# USE_OPT = -Wall -O0 -ggdb -g3 -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers -Wno-error=write-strings
# this config producec a smaller binary file
USE_OPT = -Wall -O2 -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers -Wno-error=write-strings -Wno-error=strict-aliasing
ifeq ($(OS),Windows_NT)
else
USE_OPT += -m32
endif
endif
# C specific options here (added to USE_OPT).
ifeq ($(USE_COPT),)
USE_COPT =
endif
# C++ specific options here (added to USE_OPT).
ifeq ($(USE_CPPOPT),)
USE_CPPOPT = -fno-rtti
endif
# Enable this if you want the linker to remove unused code and data.
ifeq ($(USE_LINK_GC),)
USE_LINK_GC = yes
endif
# Linker extra options here.
ifeq ($(USE_LDOPT),)
USE_LDOPT =
endif
# Enable this if you want link time optimizations (LTO)
ifeq ($(USE_LTO),)
USE_LTO = no
endif
# Enable this if you want to see the full log while compiling.
ifeq ($(USE_VERBOSE_COMPILE),)
USE_VERBOSE_COMPILE = no
endif
# If enabled, this option makes the build process faster by not compiling
# modules not used in the current configuration.
ifeq ($(USE_SMART_BUILD),)
USE_SMART_BUILD = yes
endif
#
# Build global options
##############################################################################
##############################################################################
# Architecture or project specific options
#
#
# Architecture or project specific options
##############################################################################
##############################################################################
# Project, sources and paths
#
# Define project name here
PROJECT = rusefi_simulator
PROJECT_DIR = ../firmware
# Imported source files and paths
CHIBIOS = ../firmware/ChibiOS3
# Startup files.
# HAL-OSAL files (optional).
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/hal/boards/simulator/board.mk
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
# RTOS files (optional).
include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/rt/ports/SIMIA32/compilers/GCC/port.mk
# Other files (optional).
include $(CHIBIOS)/os/hal/lib/streams/streams.mk
include $(CHIBIOS)/os/various/shell/shell.mk
ifeq ($(OS),Windows_NT)
include ${CHIBIOS}/os/hal/ports/simulator/win32/platform.mk
else
include ${CHIBIOS}/os/hal/ports/simulator/posix/platform.mk
endif
include $(PROJECT_DIR)/util/util.mk
include $(PROJECT_DIR)/config/engines/engines.mk
include $(PROJECT_DIR)/controllers/algo/algo.mk
include $(PROJECT_DIR)/controllers/core/core.mk
include $(PROJECT_DIR)/controllers/math/math.mk
include $(PROJECT_DIR)/controllers/sensors/sensors.mk
include $(PROJECT_DIR)/controllers/trigger/trigger.mk
include $(PROJECT_DIR)/controllers/system/system.mk
include $(PROJECT_DIR)/console/console.mk
include $(PROJECT_DIR)/console/binary/tunerstudio.mk
include $(PROJECT_DIR)/development/development.mk
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = ${PORTSRC} \
${KERNSRC} \
${HALSRC} \
${PLATFORMSRC} \
$(SYSTEMSRC) \
$(CONSOLESRC) \
$(CONTROLLERS_ALGO_SRC) \
$(CONTROLLERS_CORE_SRC) \
$(CONTROLLERS_SENSORS_SRC) \
$(ENGINES_SRC) \
$(BOARDSRC) \
$(CHIBIOS)/os/hal/lib/streams/memstreams.c \
$(CHIBIOS)/os/hal/lib/streams/chprintf.c \
$(CHIBIOS)/os/various/shell.c \
$(UTILSRC) \
main.c
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CPPSRC = $(UTILSRC_CPP) \
$(CONTROLLERS_ALGO_SRC_CPP) \
$(PROJECT_DIR)/controllers/settings.cpp \
$(PROJECT_DIR)/controllers/engine_controller.cpp \
$(PROJECT_DIR)/controllers/error_handling.cpp \
$(PROJECT_DIR)/development/sensor_chart.cpp \
$(TRIGGER_SRC_CPP) \
$(TRIGGER_DECODERS_SRC_CPP) \
$(SYSTEMSRC_CPP) \
$(TUNERSTUDIO_SRC_CPP) \
$(CONSOLE_SRC_CPP) \
$(CONTROLLERS_SENSORS_SRC_CPP) \
$(CONTROLLERS_CORE_SRC_CPP) \
$(CONTROLLERS_MATH_SRC_CPP) \
$(DEV_SIMULATOR_SRC_CPP) \
$(ENGINES_SRC_CPP) \
simulator/rusEfiFunctionalTest.cpp \
simulator/framework.cpp \
simulator/boards.cpp \
$(PROJECT_DIR)/controllers/map_averaging.cpp \
$(PROJECT_DIR)/development/trigger_emulator.cpp \
$(TEST_SRC_CPP)
# List ASM source files here
ASMSRC = $(PORTASM)
INCDIR = . \
$(PORTINC) \
$(KERNINC) \
$(OSALINC) \
$(HALINC) \
$(PLATFORMINC) \
$(BOARDINC) \
$(PROJECT_DIR)/util \
$(PROJECT_DIR)/console \
$(PROJECT_DIR)/console/binary \
$(PROJECT_DIR)/console/fl_binary \
$(PROJECT_DIR)/config/engines \
$(PROJECT_DIR)/ext_algo \
$(PROJECT_DIR)/controllers \
$(PROJECT_DIR)/hw_layer/algo \
$(PROJECT_DIR)/development \
$(PROJECT_DIR)/controllers/algo \
$(PROJECT_DIR)/controllers/core \
$(PROJECT_DIR)/controllers/math \
$(PROJECT_DIR)/controllers/sensors \
$(PROJECT_DIR)/controllers/system \
$(PROJECT_DIR)/controllers/trigger \
$(PROJECT_DIR)/controllers/trigger/decoders \
${CHIBIOS}/os/various \
$(CHIBIOS)/os/hal/lib/streams \
simulator
# List ASM source files here
ASMSRC =
ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
#
# Project, sources and paths
##############################################################################
##############################################################################
# Compiler settings
#
ifeq ($(OS),Windows_NT)
# base 32-bit Cygwin is needed with mingw64 32-bit version
# Cygwin64 would not debug if used with mingw64 32-bit version
TRGT = i686-w64-mingw32-
else
TRGT =
endif
CC = $(TRGT)gcc
CPPC = $(TRGT)g++
# Enable loading with g++ only if you need C++ runtime support.
# NOTE: You can use C++ even without C++ support if you are careful. C++
# runtime support makes code size explode.
#LD = $(TRGT)gcc
LD = $(TRGT)g++
CP = $(TRGT)objcopy
AS = $(TRGT)gcc -x assembler-with-cpp
AR = $(TRGT)ar
OD = $(TRGT)objdump
SZ = $(TRGT)size
BIN = $(CP) -O binary
COV = gcov
# Define C warning options here
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes
# Define C++ warning options here
CPPWARN = -Wall -Wextra -Wundef
#
# Compiler settings
##############################################################################
##############################################################################
# Start of user section
#
# List all user C define here, like -D_DEBUG=1
UDEFS = -DSIMULATOR
# Define ASM defines here
UADEFS =
# List all user directories here
UINCDIR =
# List the user directory to look for the libraries here
ULIBDIR =
# List all user libraries here
ifeq ($(OS),Windows_NT)
ULIBS = -lws2_32 -static
else
ULIBS =
endif
#
# End of user defines
##############################################################################
RULESPATH = $(CHIBIOS)/os/common/startup/SIMIA32/compilers/GCC
include $(RULESPATH)/rules.mk

501
simulator/chconf.h Normal file
View File

@ -0,0 +1,501 @@
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @file templates/chconf.h
* @brief Configuration file template.
* @details A copy of this file must be placed in each project directory, it
* contains the application specific kernel settings.
*
* @addtogroup config
* @details Kernel related settings and hooks.
* @{
*/
#ifndef _CHCONF_H_
#define _CHCONF_H_
#define CHPRINTF_USE_FLOAT TRUE
/*===========================================================================*/
/**
* @name System timers settings
* @{
*/
/*===========================================================================*/
/**
* @brief System time counter resolution.
* @note Allowed values are 16 or 32 bits.
*/
#define CH_CFG_ST_RESOLUTION 32
/**
* @brief System tick frequency.
* @details Frequency of the system timer that drives the system ticks. This
* setting also defines the system tick time unit.
*/
#define CH_CFG_ST_FREQUENCY 100000
/**
* @brief Time delta constant for the tick-less mode.
* @note If this value is zero then the system uses the classic
* periodic tick. This value represents the minimum number
* of ticks that is safe to specify in a timeout directive.
* The value one is not valid, timeouts are rounded up to
* this value.
*/
#define CH_CFG_ST_TIMEDELTA 0
/** @} */
/*===========================================================================*/
/**
* @name Kernel parameters and options
* @{
*/
/*===========================================================================*/
/**
* @brief Round robin interval.
* @details This constant is the number of system ticks allowed for the
* threads before preemption occurs. Setting this value to zero
* disables the preemption for threads with equal priority and the
* round robin becomes cooperative. Note that higher priority
* threads can still preempt, the kernel is always preemptive.
* @note Disabling the round robin preemption makes the kernel more compact
* and generally faster.
* @note The round robin preemption is not supported in tickless mode and
* must be set to zero in that case.
*/
#define CH_CFG_TIME_QUANTUM 20
/**
* @brief Managed RAM size.
* @details Size of the RAM area to be managed by the OS. If set to zero
* then the whole available RAM is used. The core memory is made
* available to the heap allocator and/or can be used directly through
* the simplified core memory allocator.
*
* @note In order to let the OS manage the whole RAM the linker script must
* provide the @p __heap_base__ and @p __heap_end__ symbols.
* @note Requires @p CH_CFG_USE_MEMCORE.
*/
#define CH_CFG_MEMCORE_SIZE 0x20000
/**
* @brief Idle thread automatic spawn suppression.
* @details When this option is activated the function @p chSysInit()
* does not spawn the idle thread. The application @p main()
* function becomes the idle thread and must implement an
* infinite loop.
*/
#define CH_CFG_NO_IDLE_THREAD FALSE
/** @} */
/*===========================================================================*/
/**
* @name Performance options
* @{
*/
/*===========================================================================*/
/**
* @brief OS optimization.
* @details If enabled then time efficient rather than space efficient code
* is used when two possible implementations exist.
*
* @note This is not related to the compiler optimization options.
* @note The default is @p TRUE.
*/
#define CH_CFG_OPTIMIZE_SPEED TRUE
/** @} */
/*===========================================================================*/
/**
* @name Subsystem options
* @{
*/
/*===========================================================================*/
/**
* @brief Time Measurement APIs.
* @details If enabled then the time measurement APIs are included in
* the kernel.
*
* @note The default is @p TRUE.
*/
#define CH_CFG_USE_TM FALSE
/**
* @brief Threads registry APIs.
* @details If enabled then the registry APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
#define CH_CFG_USE_REGISTRY TRUE
/**
* @brief Threads synchronization APIs.
* @details If enabled then the @p chThdWait() function is included in
* the kernel.
*
* @note The default is @p TRUE.
*/
#define CH_CFG_USE_WAITEXIT TRUE
/**
* @brief Semaphores APIs.
* @details If enabled then the Semaphores APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
#define CH_CFG_USE_SEMAPHORES TRUE
/**
* @brief Semaphores queuing mode.
* @details If enabled then the threads are enqueued on semaphores by
* priority rather than in FIFO order.
*
* @note The default is @p FALSE. Enable this if you have special
* requirements.
* @note Requires @p CH_CFG_USE_SEMAPHORES.
*/
#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
/**
* @brief Mutexes APIs.
* @details If enabled then the mutexes APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
#define CH_CFG_USE_MUTEXES TRUE
/**
* @brief Enables recursive behavior on mutexes.
* @note Recursive mutexes are heavier and have an increased
* memory footprint.
*
* @note The default is @p FALSE.
* @note Requires @p CH_CFG_USE_MUTEXES.
*/
#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
/**
* @brief Conditional Variables APIs.
* @details If enabled then the conditional variables APIs are included
* in the kernel.
*
* @note The default is @p TRUE.
* @note Requires @p CH_CFG_USE_MUTEXES.
*/
#define CH_CFG_USE_CONDVARS TRUE
/**
* @brief Conditional Variables APIs with timeout.
* @details If enabled then the conditional variables APIs with timeout
* specification are included in the kernel.
*
* @note The default is @p TRUE.
* @note Requires @p CH_CFG_USE_CONDVARS.
*/
#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
/**
* @brief Events Flags APIs.
* @details If enabled then the event flags APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
#define CH_CFG_USE_EVENTS TRUE
/**
* @brief Events Flags APIs with timeout.
* @details If enabled then the events APIs with timeout specification
* are included in the kernel.
*
* @note The default is @p TRUE.
* @note Requires @p CH_CFG_USE_EVENTS.
*/
#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
/**
* @brief Synchronous Messages APIs.
* @details If enabled then the synchronous messages APIs are included
* in the kernel.
*
* @note The default is @p TRUE.
*/
#define CH_CFG_USE_MESSAGES TRUE
/**
* @brief Synchronous Messages queuing mode.
* @details If enabled then messages are served by priority rather than in
* FIFO order.
*
* @note The default is @p FALSE. Enable this if you have special
* requirements.
* @note Requires @p CH_CFG_USE_MESSAGES.
*/
#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
/**
* @brief Mailboxes APIs.
* @details If enabled then the asynchronous messages (mailboxes) APIs are
* included in the kernel.
*
* @note The default is @p TRUE.
* @note Requires @p CH_CFG_USE_SEMAPHORES.
*/
#define CH_CFG_USE_MAILBOXES TRUE
/**
* @brief I/O Queues APIs.
* @details If enabled then the I/O queues APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
#define CH_CFG_USE_QUEUES TRUE
/**
* @brief Core Memory Manager APIs.
* @details If enabled then the core memory manager APIs are included
* in the kernel.
*
* @note The default is @p TRUE.
*/
#define CH_CFG_USE_MEMCORE TRUE
/**
* @brief Heap Allocator APIs.
* @details If enabled then the memory heap allocator APIs are included
* in the kernel.
*
* @note The default is @p TRUE.
* @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
* @p CH_CFG_USE_SEMAPHORES.
* @note Mutexes are recommended.
*/
#define CH_CFG_USE_HEAP TRUE
/**
* @brief Memory Pools Allocator APIs.
* @details If enabled then the memory pools allocator APIs are included
* in the kernel.
*
* @note The default is @p TRUE.
*/
#define CH_CFG_USE_MEMPOOLS TRUE
/**
* @brief Dynamic Threads APIs.
* @details If enabled then the dynamic threads creation APIs are included
* in the kernel.
*
* @note The default is @p TRUE.
* @note Requires @p CH_CFG_USE_WAITEXIT.
* @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
*/
#define CH_CFG_USE_DYNAMIC TRUE
/** @} */
/*===========================================================================*/
/**
* @name Debug options
* @{
*/
/*===========================================================================*/
/**
* @brief Debug option, kernel statistics.
*
* @note The default is @p FALSE.
*/
#define CH_DBG_STATISTICS FALSE
/**
* @brief Debug option, system state check.
* @details If enabled the correct call protocol for system APIs is checked
* at runtime.
*
* @note The default is @p FALSE.
*/
#define CH_DBG_SYSTEM_STATE_CHECK FALSE
/**
* @brief Debug option, parameters checks.
* @details If enabled then the checks on the API functions input
* parameters are activated.
*
* @note The default is @p FALSE.
*/
#define CH_DBG_ENABLE_CHECKS FALSE
/**
* @brief Debug option, consistency checks.
* @details If enabled then all the assertions in the kernel code are
* activated. This includes consistency checks inside the kernel,
* runtime anomalies and port-defined checks.
*
* @note The default is @p FALSE.
*/
#define CH_DBG_ENABLE_ASSERTS FALSE
/**
* @brief Debug option, trace buffer.
* @details If enabled then the context switch circular trace buffer is
* activated.
*
* @note The default is @p FALSE.
*/
#define CH_DBG_ENABLE_TRACE FALSE
/**
* @brief Debug option, stack checks.
* @details If enabled then a runtime stack check is performed.
*
* @note The default is @p FALSE.
* @note The stack check is performed in a architecture/port dependent way.
* It may not be implemented or some ports.
* @note The default failure mode is to halt the system with the global
* @p panic_msg variable set to @p NULL.
*/
#define CH_DBG_ENABLE_STACK_CHECK FALSE
/**
* @brief Debug option, stacks initialization.
* @details If enabled then the threads working area is filled with a byte
* value when a thread is created. This can be useful for the
* runtime measurement of the used stack.
*
* @note The default is @p FALSE.
*/
#define CH_DBG_FILL_THREADS FALSE
/**
* @brief Debug option, threads profiling.
* @details If enabled then a field is added to the @p thread_t structure that
* counts the system ticks occurred while executing the thread.
*
* @note The default is @p FALSE.
* @note This debug option is not currently compatible with the
* tickless mode.
*/
#define CH_DBG_THREADS_PROFILING TRUE
/** @} */
/*===========================================================================*/
/**
* @name Kernel hooks
* @{
*/
/*===========================================================================*/
/**
* @brief Threads descriptor structure extension.
* @details User fields added to the end of the @p thread_t structure.
*/
#define CH_CFG_THREAD_EXTRA_FIELDS \
/* Add threads custom fields here.*/
/**
* @brief Threads initialization hook.
* @details User initialization code added to the @p chThdInit() API.
*
* @note It is invoked from within @p chThdInit() and implicitly from all
* the threads creation APIs.
*/
#define CH_CFG_THREAD_INIT_HOOK(tp) { \
/* Add threads initialization code here.*/ \
}
/**
* @brief Threads finalization hook.
* @details User finalization code added to the @p chThdExit() API.
*
* @note It is inserted into lock zone.
* @note It is also invoked when the threads simply return in order to
* terminate.
*/
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
/* Add threads finalization code here.*/ \
}
/**
* @brief Context switch hook.
* @details This hook is invoked just before switching between threads.
*/
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
/* Context switch code here.*/ \
}
/**
* @brief Idle thread enter hook.
* @note This hook is invoked within a critical zone, no OS functions
* should be invoked from here.
* @note This macro can be used to activate a power saving mode.
*/
#define CH_CFG_IDLE_ENTER_HOOK() { \
}
/**
* @brief Idle thread leave hook.
* @note This hook is invoked within a critical zone, no OS functions
* should be invoked from here.
* @note This macro can be used to deactivate a power saving mode.
*/
#define CH_CFG_IDLE_LEAVE_HOOK() { \
}
/**
* @brief Idle Loop hook.
* @details This hook is continuously invoked by the idle thread loop.
*/
#define CH_CFG_IDLE_LOOP_HOOK() { \
/* Idle loop code here.*/ \
}
/**
* @brief System tick event hook.
* @details This hook is invoked in the system tick handler immediately
* after processing the virtual timers queue.
*/
#define CH_CFG_SYSTEM_TICK_HOOK() { \
/* System tick event code here.*/ \
}
/**
* @brief System halt hook.
* @details This hook is invoked in case to a system halting error before
* the system is halted.
*/
#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
/* System halt code here.*/ \
}
/** @} */
/*===========================================================================*/
/* Port-specific settings (override port settings defaulted in chcore.h). */
/*===========================================================================*/
#endif /* _CHCONF_H_ */
/** @} */

2
simulator/clean.bat Normal file
View File

@ -0,0 +1,2 @@
rm -rf .dep
rm -rf build

4
simulator/compile.bat Normal file
View File

@ -0,0 +1,4 @@
rem this is about CygWin colon issue, .dep files are invalid because of that
rem rm -rf .dep
rm -f build/rusefi_simulator.exe
make

365
simulator/halconf.h Normal file
View File

@ -0,0 +1,365 @@
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* @file templates/halconf.h
* @brief HAL configuration header.
* @details HAL configuration file, this file allows to enable or disable the
* various device drivers from your application. You may also use
* this file in order to override the device drivers default settings.
*
* @addtogroup HAL_CONF
* @{
*/
#ifndef _HALCONF_H_
#define _HALCONF_H_
/*#include "mcuconf.h"*/
/**
* @brief Enables the TM subsystem.
*/
#if !defined(HAL_USE_TM) || defined(__DOXYGEN__)
#define HAL_USE_TM FALSE
#endif
/**
* @brief Enables the PAL subsystem.
*/
#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
#define HAL_USE_PAL TRUE
#endif
/**
* @brief Enables the ADC subsystem.
*/
#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
#define HAL_USE_ADC FALSE
#endif
/**
* @brief Enables the CAN subsystem.
*/
#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
#define HAL_USE_CAN FALSE
#endif
/**
* @brief Enables the DAC subsystem.
*/
#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
#define HAL_USE_DAC FALSE
#endif
/**
* @brief Enables the EXT subsystem.
*/
#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
#define HAL_USE_EXT FALSE
#endif
/**
* @brief Enables the GPT subsystem.
*/
#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
#define HAL_USE_GPT FALSE
#endif
/**
* @brief Enables the I2C subsystem.
*/
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
#define HAL_USE_I2C FALSE
#endif
/**
* @brief Enables the I2S subsystem.
*/
#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
#define HAL_USE_I2S FALSE
#endif
/**
* @brief Enables the ICU subsystem.
*/
#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
#define HAL_USE_ICU FALSE
#endif
/**
* @brief Enables the MAC subsystem.
*/
#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
#define HAL_USE_MAC FALSE
#endif
/**
* @brief Enables the MMC_SPI subsystem.
*/
#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
#define HAL_USE_MMC_SPI FALSE
#endif
/**
* @brief Enables the PWM subsystem.
*/
#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
#define HAL_USE_PWM FALSE
#endif
/**
* @brief Enables the RTC subsystem.
*/
#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
#define HAL_USE_RTC FALSE
#endif
/**
* @brief Enables the SDC subsystem.
*/
#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
#define HAL_USE_SDC FALSE
#endif
/**
* @brief Enables the SERIAL subsystem.
*/
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
#define HAL_USE_SERIAL TRUE
#endif
/**
* @brief Enables the SERIAL over USB subsystem.
*/
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
#define HAL_USE_SERIAL_USB FALSE
#endif
/**
* @brief Enables the SPI subsystem.
*/
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
#define HAL_USE_SPI FALSE
#endif
/**
* @brief Enables the UART subsystem.
*/
#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
#define HAL_USE_UART FALSE
#endif
/**
* @brief Enables the USB subsystem.
*/
#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
#define HAL_USE_USB FALSE
#endif
/**
* @brief Enables the WDG subsystem.
*/
#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
#define HAL_USE_WDG FALSE
#endif
/*===========================================================================*/
/* ADC driver related settings. */
/*===========================================================================*/
/**
* @brief Enables synchronous APIs.
* @note Disabling this option saves both code and data space.
*/
#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
#define ADC_USE_WAIT TRUE
#endif
/**
* @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
* @note Disabling this option saves both code and data space.
*/
#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
#define ADC_USE_MUTUAL_EXCLUSION TRUE
#endif
/*===========================================================================*/
/* CAN driver related settings. */
/*===========================================================================*/
/**
* @brief Sleep mode related APIs inclusion switch.
*/
#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
#define CAN_USE_SLEEP_MODE TRUE
#endif
/*===========================================================================*/
/* I2C driver related settings. */
/*===========================================================================*/
/**
* @brief Enables the mutual exclusion APIs on the I2C bus.
*/
#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
#define I2C_USE_MUTUAL_EXCLUSION TRUE
#endif
/*===========================================================================*/
/* MAC driver related settings. */
/*===========================================================================*/
/**
* @brief Enables an event sources for incoming packets.
*/
#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
#define MAC_USE_ZERO_COPY FALSE
#endif
/**
* @brief Enables an event sources for incoming packets.
*/
#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
#define MAC_USE_EVENTS TRUE
#endif
/*===========================================================================*/
/* MMC_SPI driver related settings. */
/*===========================================================================*/
/**
* @brief Delays insertions.
* @details If enabled this options inserts delays into the MMC waiting
* routines releasing some extra CPU time for the threads with
* lower priority, this may slow down the driver a bit however.
* This option is recommended also if the SPI driver does not
* use a DMA channel and heavily loads the CPU.
*/
#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
#define MMC_NICE_WAITING TRUE
#endif
/*===========================================================================*/
/* SDC driver related settings. */
/*===========================================================================*/
/**
* @brief Number of initialization attempts before rejecting the card.
* @note Attempts are performed at 10mS intervals.
*/
#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
#define SDC_INIT_RETRY 100
#endif
/**
* @brief Include support for MMC cards.
* @note MMC support is not yet implemented so this option must be kept
* at @p FALSE.
*/
#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
#define SDC_MMC_SUPPORT FALSE
#endif
/**
* @brief Delays insertions.
* @details If enabled this options inserts delays into the MMC waiting
* routines releasing some extra CPU time for the threads with
* lower priority, this may slow down the driver a bit however.
*/
#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
#define SDC_NICE_WAITING TRUE
#endif
/*===========================================================================*/
/* SERIAL driver related settings. */
/*===========================================================================*/
/**
* @brief Default bit rate.
* @details Configuration parameter, this is the baud rate selected for the
* default configuration.
*/
#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
#define SERIAL_DEFAULT_BITRATE 38400
#endif
/**
* @brief Serial buffers size.
* @details Configuration parameter, you can change the depth of the queue
* buffers depending on the requirements of your application.
* @note The default is 16 bytes for both the transmission and receive
* buffers.
*/
#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
#define SERIAL_BUFFERS_SIZE 32
#endif
/*===========================================================================*/
/* SPI driver related settings. */
/*===========================================================================*/
/**
* @brief Enables synchronous APIs.
* @note Disabling this option saves both code and data space.
*/
#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
#define SPI_USE_WAIT TRUE
#endif
/**
* @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
* @note Disabling this option saves both code and data space.
*/
#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
#define SPI_USE_MUTUAL_EXCLUSION TRUE
#endif
/*===========================================================================*/
/* UART driver related settings. */
/*===========================================================================*/
/**
* @brief Enables synchronous APIs.
* @note Disabling this option saves both code and data space.
*/
#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__)
#define UART_USE_WAIT FALSE
#endif
/**
* @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs.
* @note Disabling this option saves both code and data space.
*/
#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
#define UART_USE_MUTUAL_EXCLUSION FALSE
#endif
/*===========================================================================*/
/* USB driver related settings. */
/*===========================================================================*/
/**
* @brief Enables synchronous APIs.
* @note Disabling this option saves both code and data space.
*/
#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
#define USB_USE_WAIT FALSE
#endif
#endif /* _HALCONF_H_ */
/** @} */

186
simulator/main.c Normal file
View File

@ -0,0 +1,186 @@
/*
ChibiOS/RT - Copyright (C) 2006-2013 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "main.h"
#include "chprintf.h"
#include "rusEfiFunctionalTest.h"
#include "framework.h"
#define CONSOLE_WA_SIZE THD_WORKING_AREA_SIZE(4096)
bool main_loop_started = false;
static thread_t *cdtp;
//static thread_t *shelltp1;
//static thread_t *shelltp2;
#define cputs(msg) chMsgSend(cdtp, (msg_t)msg)
void printToWin32Console(char *p) {
cputs(p);
}
TestStream testStream;
/*
* Console print server done using synchronous messages. This makes the access
* to the C printf() thread safe and the print operation atomic among threads.
* In this example the message is the zero terminated string itself.
*/
THD_FUNCTION(console_thread, arg) {
(void) arg;
while (!chThdShouldTerminateX()) {
thread_t *tp = chMsgWait();
puts((char *) chMsgGet(tp));
fflush(stdout);
chMsgRelease(tp, MSG_OK);
}
}
extern int isSerialOverTcpReady;
/**
* @brief Shell termination handler.
*
* @param[in] id event id.
*/
static void termination_handler(eventid_t id) {
chThdSleepMilliseconds(10);
cputs("Init: shell on SD1 terminated");
chSysLock();
chOQResetI(&SD1.oqueue);
chSysUnlock();
// todo: 2nd port for TS
// if (shelltp2 && chThdTerminated(shelltp2)) {
// chThdWait(shelltp2);
// shelltp2 = NULL;
// chThdSleepMilliseconds(10);
// cputs("Init: shell on SD2 terminated");
// chSysLock();
// chOQResetI(&SD2.oqueue);
// chSysUnlock();
// }
}
static event_listener_t sd1fel, sd2fel;
/**
* @brief SD1 status change handler.
*
* @param[in] id event id.
*/
static void sd1_handler(eventid_t id) {
eventflags_t flags;
(void) id;
flags = chEvtGetAndClearFlags(&sd1fel);
if ((flags & CHN_CONNECTED)) {
cputs("Init: connection on SD1");
isSerialOverTcpReady = TRUE;
}
if (flags & CHN_DISCONNECTED) {
cputs("Init: disconnection on SD1");
isSerialOverTcpReady = FALSE;
chSysLock();
chIQResetI(&SD1.iqueue);
chSysUnlock();
}
}
/**
* @brief SD2 status change handler.
*
* @param[in] id event id.
*/
static void sd2_handler(eventid_t id) {
eventflags_t flags;
(void) id;
flags = chEvtGetAndClearFlags(&sd2fel);
if ((flags & CHN_CONNECTED)) {
cputs("Init: connection on SD2");
}
if (flags & CHN_DISCONNECTED) {
cputs("Init: disconnection on SD2");
chSysLock();
chIQResetI(&SD2.iqueue);
chSysUnlock();
}
}
static evhandler_t fhandlers[] = { termination_handler, sd1_handler, sd2_handler };
/*------------------------------------------------------------------------*
* Simulator main. *
*------------------------------------------------------------------------*/
int main(void) {
initTestStream(&testStream);
/*
* System initializations.
* - HAL initialization, this also initializes the configured device drivers
* and performs the board-specific initializations.
* - Kernel initialization, the main() function becomes a thread and the
* RTOS is active.
*/
halInit();
chSysInit();
/*
* Serial ports (simulated) initialization.
*/
sdStart(&SD1, NULL);
sdStart(&SD2, NULL);
/*
* Console thread started.
*/
cdtp = chThdCreateFromHeap(NULL, CONSOLE_WA_SIZE, NORMALPRIO + 1, console_thread, NULL);
/*
* Initializing connection/disconnection events.
*/
cputs("Shell service started on SD1, SD2");
cputs(" - Listening for connections on SD1");
chEvtRegister(chnGetEventSource(&SD1), &sd1fel, 1);
cputs(" - Listening for connections on SD2");
chEvtRegister(chnGetEventSource(&SD2), &sd2fel, 2);
rusEfiFunctionalTest();
/*
* Events servicing loop.
*/
while (!chThdShouldTerminateX()) {
chEvtDispatch(fhandlers, chEvtWaitOne(ALL_EVENTS));
printPendingMessages();
chThdSleepMilliseconds(100);
}
/*
* Clean simulator exit.
*/
chEvtUnregister(chnGetEventSource(&SD1), &sd1fel);
chEvtUnregister(chnGetEventSource(&SD2), &sd2fel);
return 0;
}

10
simulator/main.h Normal file
View File

@ -0,0 +1,10 @@
#include "global.h"
#define hwPortname(x) "N/A"
#ifdef __cplusplus
#include "datalogging.h"
#include "eficonsole.h"
#include "cli_registry.h"
#endif

2
simulator/make_clean.bat Normal file
View File

@ -0,0 +1,2 @@
make clean
make 2> err > log

5
simulator/make_run.bat Normal file
View File

@ -0,0 +1,5 @@
make
cd build
rusefi_simulator.exe

168
simulator/rules.mk Normal file
View File

@ -0,0 +1,168 @@
# ARM Cortex-Mx common makefile scripts and rules.
# Output directory and files
ifeq ($(BUILDDIR),)
BUILDDIR = build
endif
ifeq ($(BUILDDIR),.)
BUILDDIR = build
endif
OUTFILES = $(BUILDDIR)/$(PROJECT)
# Automatic compiler options
OPT = $(USE_OPT)
COPT = $(USE_COPT)
CPPOPT = $(USE_CPPOPT)
ifeq ($(USE_LINK_GC),yes)
OPT += -ffunction-sections -fdata-sections -fno-common
endif
# Source files groups and paths
ifeq ($(USE_THUMB),yes)
TCSRC += $(CSRC)
TCPPSRC += $(CPPSRC)
else
ACSRC += $(CSRC)
ACPPSRC += $(CPPSRC)
endif
ASRC = $(ACSRC)$(ACPPSRC)
TSRC = $(TCSRC)$(TCPPSRC)
SRCPATHS = $(sort $(dir $(ASMXSRC)) $(dir $(ASMSRC)) $(dir $(ASRC)) $(dir $(TSRC)))
# Various directories
OBJDIR = $(BUILDDIR)/obj
LSTDIR = $(BUILDDIR)/lst
# Object files groups
ACOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ACSRC:.c=.o)))
ACPPOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ACPPSRC:.cpp=.o)))
TCOBJS = $(addprefix $(OBJDIR)/, $(notdir $(TCSRC:.c=.o)))
TCPPOBJS = $(addprefix $(OBJDIR)/, $(notdir $(TCPPSRC:.cpp=.o)))
ASMOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ASMSRC:.s=.o)))
ASMXOBJS = $(addprefix $(OBJDIR)/, $(notdir $(ASMXSRC:.S=.o)))
OBJS = $(ASMXOBJS) $(ASMOBJS) $(ACOBJS) $(TCOBJS) $(ACPPOBJS) $(TCPPOBJS)
# Paths
IINCDIR = $(patsubst %,-I%,$(INCDIR) $(DINCDIR) $(UINCDIR))
LLIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR))
# Macros
DEFS = $(DDEFS) $(UDEFS)
ADEFS = $(DADEFS) $(UADEFS)
# Libs
LIBS = $(DLIBS) $(ULIBS)
# Various settings
#MCFLAGS = -mcpu=$(MCU)
ODFLAGS = -x --syms
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS)
ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS)
CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.c=.lst)) $(DEFS)
CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS)
ifeq ($(USE_LINK_GC),yes)
LDFLAGS = $(MCFLAGS) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections $(LLIBDIR)
else
LDFLAGS = $(MCFLAGS) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch $(LLIBDIR)
endif
# Generate dependency information
CFLAGS += -MD -MP -MF .dep/$(@F).d
CPPFLAGS += -MD -MP -MF .dep/$(@F).d
# Paths where to search for sources
VPATH = $(SRCPATHS)
#
# Makefile rules
#
all: $(OBJS) $(OUTFILES) MAKE_ALL_RULE_HOOK
MAKE_ALL_RULE_HOOK:
$(OBJS): | $(BUILDDIR)
$(BUILDDIR) $(OBJDIR) $(LSTDIR):
ifneq ($(USE_VERBOSE_COMPILE),yes)
@echo Compiler Options
@echo $(CPPC) -c $(CPPFLAGS) -I. $(IINCDIR) main.cpp -o main.o
@echo
endif
mkdir -p $(OBJDIR)
mkdir -p $(LSTDIR)
$(ACPPOBJS) : $(OBJDIR)/%.o : %.cpp Makefile
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(CPPC) -c $(CPPFLAGS) $(AOPT) -I. $(IINCDIR) $< -o $@
else
@echo Compiling $(<F)
@$(CPPC) -c $(CPPFLAGS) $(AOPT) -I. $(IINCDIR) $< -o $@
endif
$(TCPPOBJS) : $(OBJDIR)/%.o : %.cpp Makefile
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(CPPC) -c $(CPPFLAGS) $(TOPT) -I. $(IINCDIR) $< -o $@
else
@echo Compiling $(<F)
@$(CPPC) -c $(CPPFLAGS) $(TOPT) -I. $(IINCDIR) $< -o $@
endif
$(ACOBJS) : $(OBJDIR)/%.o : %.c Makefile
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(CC) -c $(CFLAGS) $(AOPT) -I. $(IINCDIR) $< -o $@
else
@echo Compiling $(<F)
@$(CC) -c $(CFLAGS) $(AOPT) -I. $(IINCDIR) $< -o $@
endif
$(TCOBJS) : $(OBJDIR)/%.o : %.c Makefile
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(CC) -c $(CFLAGS) $(TOPT) -I. $(IINCDIR) $< -o $@
else
@echo Compiling $(<F)
@$(CC) -c $(CFLAGS) $(TOPT) -I. $(IINCDIR) $< -o $@
endif
$(ASMOBJS) : $(OBJDIR)/%.o : %.s Makefile
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(AS) -c $(ASFLAGS) -I. $(IINCDIR) $< -o $@
else
@echo Compiling $(<F)
@$(AS) -c $(ASFLAGS) -I. $(IINCDIR) $< -o $@
endif
$(ASMXOBJS) : $(OBJDIR)/%.o : %.S Makefile
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(CC) -c $(ASXFLAGS) $(TOPT) -I. $(IINCDIR) $< -o $@
else
@echo Compiling $(<F)
@$(CC) -c $(ASXFLAGS) $(TOPT) -I. $(IINCDIR) $< -o $@
endif
$(BUILDDIR)/$(PROJECT): $(OBJS)
ifeq ($(USE_VERBOSE_COMPILE),yes)
@echo
$(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
else
@echo Linking $@
@$(LD) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
endif
clean:
@echo Cleaning
-rm -fR .dep $(BUILDDIR)
@echo Done
#
# Include the dependency files, should be the last of the makefile
#
-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
# *** EOF ***

View File

@ -0,0 +1,13 @@
/**
* @file adc_inputs.h
*
* @date Dec 7, 2013
* @author Andrey Belomutskiy, (c) 2012-2016
*/
#ifndef ADC_INPUTS_H_
#define ADC_INPUTS_H_
#include "adc_math.h"
#endif /* ADC_INPUTS_H_ */

View File

@ -0,0 +1,20 @@
/**
* @file board.cpp
*
* @date Nov 15, 2013
* @author Andrey Belomutskiy, (c) 2012-2016
*/
#include "main.h"
#include "boards.h"
#include "engine.h"
#include "adc_math.h"
#include "engine_sniffer.h"
static LoggingWithStorage logger("simulator board");
extern engine_configuration_s *engineConfiguration;
extern Engine *engine;
int getAdcValue(const char *msg, int hwChannel) {
return engine->engineState.mockAdcState.getMockAdcValue(hwChannel);
}

View File

@ -0,0 +1,34 @@
#ifndef BOARDS_FT_H_
#define BOARDS_FT_H_
#define ADC_LOGIC_TPS 0
#define ADC_LOGIC_AFR 0
#define ADC_LOGIC_MAF 0
#define ADC_LOGIC_MAP 0
#define ADC_CHANNEL_VREF 0
#define ADC_CHANNEL_VBATT 0
#define ADC_LOGIC_INTAKE_AIR 0
#define ADC_LOGIC_COOLANT 0
#define CONSOLE_PORT (&SD1)
#define TS_SIMULATOR_PORT (&SD2)
/**
* This implementation writes to both windows console and console port
*/
#define EFI_CONSOLE_UART_DEVICE (&testStream)
int getAdcValue(const char *msg, int channel);
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* BOARDS_FT_H_ */

View File

@ -0,0 +1,91 @@
/*
* efifeatures.h
*
* @date Mar 7, 2014
* @author Andrey Belomutskiy, (c) 2012-2016
*/
#ifndef EFIFEATURES_H_
#define EFIFEATURES_H_
#define EFI_ENABLE_ASSERTS TRUE
#define EFI_ENABLE_MOCK_ADC TRUE
#define EFI_PRINTF_FUEL_DETAILS TRUE
#define EFI_GPIO TRUE
#define EFI_FSIO TRUE
#define CONSOLE_MAX_ACTIONS 256
#define EFI_SIMULATOR TRUE
#define EFI_PROD_CODE FALSE
#define EFI_MAP_AVERAGING TRUE
#define EFI_ALTERNATOR_CONTROL FALSE
#define EFI_SUPPORT_DODGE_NEON TRUE
#define EFI_SUPPORT_FORD_ASPIRE TRUE
#define EFI_SUPPORT_FORD_FIESTA TRUE
#define EFI_SUPPORT_NISSAN_PRIMERA TRUE
#define EFI_SUPPORT_1995_FORD_INLINE_6 TRUE
#define EFI_ENGINE_AUDI_AAN FALSE
#define EFI_ENGINE_SNOW_BLOWER FALSE
/**
* simulator works via self-stimulation which works via trigger emulation
*/
#define EFI_EMULATE_POSITION_SENSORS TRUE
#define EFI_SIGNAL_EXECUTOR_SLEEP TRUE
#define EFI_INTERNAL_ADC FALSE
#define EFI_EGT FALSE
#define EFI_SHAFT_POSITION_INPUT TRUE
#define EFI_UART_ECHO_TEST_MODE FALSE
#define EFI_ENGINE_CONTROL TRUE
#define EFI_IDLE_CONTROL FALSE
#define EFI_HIP_9011 FALSE
#define EFI_ELECTRONIC_THROTTLE_BODY FALSE
#define EFI_AUX_PID FALSE
#define EFI_HAS_RESET FALSE
#define EXTREME_TERM_LOGGING FALSE
#define DEBUG_FUEL FALSE
#define EFI_FUEL_PUMP FALSE
#define DEBUG_WAVE FALSE
#define EFI_DEFAILED_LOGGING FALSE
#define EFI_ENGINE_SNIFFER TRUE
#define FUEL_MATH_EXTREME_LOGGING FALSE
#define EFI_ANALOG_SENSORS TRUE
#define EFI_INTERNAL_FLASH FALSE
#define EFI_RTC FALSE
#define EFI_MALFUNCTION_INDICATOR FALSE
#define EFI_HD44780_LCD FALSE
#define EFI_WAVE_ANALYZER FALSE
#define EFI_PWM_TESTER FALSE
#define TRIGGER_EXTREME_LOGGING FALSE
#define SPARK_EXTREME_LOGGING FALSE
#define DEBUG_PWM FALSE
#define EFI_SIGNAL_EXECUTOR_ONE_TIMER FALSE
#define EFI_TUNER_STUDIO_VERBOSE FALSE
#define EFI_FILE_LOGGING FALSE
#define EFI_WARNING_LED FALSE
#define EFI_VEHICLE_SPEED FALSE
#define EFI_SENSOR_CHART TRUE
#define EFI_HISTOGRAMS FALSE
#define EFI_TUNER_STUDIO TRUE
/**
* This is the size of the MemoryStream used by chvprintf
*/
#define INTERMEDIATE_LOGGING_BUFFER_SIZE 2000
#endif /* EFIFEATURES_H_ */

View File

@ -0,0 +1,79 @@
/**
* @file framework.cpp
*
* @date Sep 25, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "main.h"
#include "framework.h"
efitick_t getTimeNowNt(void) {
return getTimeNowUs() * US_TO_NT_MULTIPLIER;
}
efitimeus_t getTimeNowUs(void) {
return chVTGetSystemTimeX() * (1000000 / CH_CFG_ST_FREQUENCY);
}
// todo; reduce code duplication with prod code?
efitimems_t currentTimeMillis(void) {
return chVTGetSystemTimeX() / 1000;
}
// todo; reduce code duplication with prod code?
efitimesec_t getTimeNowSeconds(void) {
return currentTimeMillis() / CH_CFG_ST_FREQUENCY;
}
int getRusEfiVersion(void) {
return 239;
}
static size_t wt_writes(void *ip, const uint8_t *bp, size_t n) {
printToWin32Console((char*)bp);
return CONSOLE_PORT->vmt->write(CONSOLE_PORT, bp, n);
}
static size_t wt_reads(void *ip, uint8_t *bp, size_t n) {
return CONSOLE_PORT->vmt->read(CONSOLE_PORT, bp, n);
}
static msg_t wt_putt(void *instance, uint8_t b, systime_t time) {
return CONSOLE_PORT->vmt->putt(CONSOLE_PORT, b, time);
}
static msg_t wt_gett(void *instance, systime_t time) {
return CONSOLE_PORT->vmt->gett(CONSOLE_PORT, time);
}
static size_t wt_writet(void *instance, const uint8_t *bp,
size_t n, systime_t time) {
return CONSOLE_PORT->vmt->writet(CONSOLE_PORT, bp, n, time);
}
static size_t wt_readt(void *instance, uint8_t *bp, size_t n, systime_t time) {
return CONSOLE_PORT->vmt->readt(CONSOLE_PORT, bp, n, time);
}
static char putMessageBuffer[2];
static msg_t wt_put(void *ip, uint8_t b) {
putMessageBuffer[0] = b;
putMessageBuffer[1] = 0;
printToWin32Console((char*)putMessageBuffer);
// cputs("wt_put");
return CONSOLE_PORT->vmt->put(CONSOLE_PORT, b);
}
static msg_t wt_get(void *ip) {
// cputs("wt_get");
//return 0;
return CONSOLE_PORT->vmt->get(CONSOLE_PORT);
}
static const struct Win32TestStreamVMT vmt = { wt_writes, wt_reads, wt_put, wt_get, wt_putt, wt_gett, wt_writet, wt_readt };
void initTestStream(TestStream *ts) {
ts->vmt = &vmt;
}

View File

@ -0,0 +1,21 @@
/**
* @file framework.h
*
* @date Sep 25, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef FRAMEWORK_H_
#define FRAMEWORK_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void initTestStream(TestStream *ts);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* FRAMEWORK_H_ */

View File

@ -0,0 +1,115 @@
#define DEFAULT_ENGINE_TYPE FORD_ESCORT_GT
#include <ch.h>
#include <hal.h>
#include <time.h>
#include <math.h>
#include "efifeatures.h"
#if EFI_SIMULATOR
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#endif
#include "rusefi_enums.h"
#include "auto_generated_enums.h"
#include "obd_error_codes.h"
#include "error_handling.h"
#include "boards.h"
#include "efilib.h"
#include "efitime.h"
#define EFI_UNIT_TEST FALSE
#define hasFatalError() (FALSE)
#define US_TO_NT_MULTIPLIER 100
#define ALWAYS_INLINE
#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)
#ifndef GLOBAL_FT_H_
#define GLOBAL_FT_H_
#define EFI_ERROR_CODE 0xffffffff
#define DL_OUTPUT_BUFFER 9000
#define CCM_OPTIONAL
#include "rusefi_enums.h"
#define EFI_CUSTOM_PANIC_METHOD 1
// project-wide default thread stack size
#define UTILITY_THREAD_STACK_SIZE 1384
/**
* @brief @p Win32TestStream virtual methods table.
*/
struct Win32TestStreamVMT {
_base_channel_methods
};
typedef struct {
const struct Win32TestStreamVMT *vmt;
} TestStream;
extern TestStream testStream;
//##define TRUE 1
//#define FALSE 0
#endif /* GLOBAL_FT_H_ */
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void printToWin32Console(char *p);
int systicks2ms(int systicks);
int getRemainingStack(thread_t *otp);
// todo: move somewhere else?
bool lockAnyContext(void);
void unlockAnyContext(void);
void applyNewConfiguration(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
/**
* number of SysClock ticks in one ms
*/
#define TICKS_IN_MS (CH_FREQUENCY / 1000)
#define hal_lld_get_counter_value() 0
#define EXTERN_ENGINE extern Engine *engine; \
extern engine_configuration_s *engineConfiguration; \
extern board_configuration_s *boardConfiguration; \
extern persistent_config_s *config; \
extern persistent_config_container_s persistentState; \
extern EnginePins enginePins
#define DECLARE_ENGINE_PARAMETER_F void
#define DECLARE_ENGINE_PARAMETER_S
#define PASS_ENGINE_PARAMETER_F
#define PASS_ENGINE_PARAMETER
#define CONFIG(x) persistentState.persistentConfiguration.engineConfiguration.x
#define ENGINE(x) engine->x
#define TRIGGER_SHAPE(x) engine->triggerCentral.triggerShape.x

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -0,0 +1,171 @@
/**
* @file rusEfiFunctionalTest.cpp
*
* @date Mar 1, 2014
* @author Andrey Belomutskiy, (c) 2012-2016
*/
#include "global.h"
#include "boards.h"
#include "rusEfiFunctionalTest.h"
#include "console_io.h"
#include "eficonsole.h"
#include "engine_configuration.h"
#include "rusefi_enums.h"
#include "pwm_generator_logic.h"
#include "trigger_central.h"
#include "datalogging.h"
#include "algo.h"
#include "rpm_calculator.h"
#include "engine_sniffer.h"
#include "status_loop.h"
#include "trigger_emulator_algo.h"
#include "main_trigger_callback.h"
#include "allsensors.h"
#include "sensor_chart.h"
#include "injector_central.h"
#include "engine.h"
#include "tunerstudio.h"
#include "trigger_emulator.h"
#include "engine_controller.h"
#include "map_averaging.h"
#include "memstreams.h"
#include <chprintf.h>
#define DEFAULT_SIM_RPM 1200
#define DEFAULT_SNIFFER_THR 2500
EXTERN_ENGINE;
extern WaveChart waveChart;
static LoggingWithStorage sharedLogger("simulator");
void outputPinRegisterExt2(const char *msg, OutputPin *output, brain_pin_e brainPin, pin_output_mode_e *outputMode) {
}
int getRemainingStack(thread_t *otp) {
return 99999;
}
void idleDebug(const char *msg, percent_t value) {
}
float getMap(void) {
return getRawMap();
}
static void runChprintfTest() {
static MemoryStream testStream;
static char testBuffer[200];
msObjectInit(&testStream, (uint8_t *) testBuffer, sizeof(testBuffer), 0);
// it's a very, very long and mostly forgotten story how this became our %f precision format
testStream.eos = 0; // reset
chprintf((BaseSequentialStream*)&testStream, "%f/%.4f/%.4f", 0.239f, 239.932, 0.1234);
testStream.buffer[testStream.eos] = 0;
#define FLOAT_STRING_EXPECTED "0.23/239.9320/0.1234"
if (strcmp(FLOAT_STRING_EXPECTED, testBuffer) != 0) {
firmwareError(OBD_PCM_Processor_Fault, "chprintf test: got %s while %s", testBuffer, FLOAT_STRING_EXPECTED);
}
{
LoggingWithStorage testLogging("test");
appendFloat(&testLogging, 1.23, 5);
appendFloat(&testLogging, 1.234, 2);
#define FLOAT_STRING_EXPECTED2 "1.230001.23"
if (strcmp(FLOAT_STRING_EXPECTED2, testLogging.buffer) != 0) {
firmwareError(OBD_PCM_Processor_Fault, "chprintf test2: got %s while %s", testLogging.buffer, FLOAT_STRING_EXPECTED2);
}
}
}
void rusEfiFunctionalTest(void) {
printToWin32Console("Running version:");
printToWin32Console("TODO");
initIntermediateLoggingBuffer();
initErrorHandling();
engine->setConfig(config);
initializeConsole(&sharedLogger);
initStatusLoop();
initDataStructures(PASS_ENGINE_PARAMETER_F);
// todo: reduce code duplication with initEngineContoller
resetConfigurationExt(NULL, DEFAULT_ENGINE_TYPE PASS_ENGINE_PARAMETER);
prepareShapes(PASS_ENGINE_PARAMETER_F);
initAlgo(&sharedLogger, engineConfiguration);
commonInitEngineController(&sharedLogger);
initRpmCalculator(&sharedLogger, engine);
#if EFI_SENSOR_CHART || defined(__DOXYGEN__)
initSensorChart();
#endif /* EFI_SENSOR_CHART */
initTriggerCentral(&sharedLogger, engine);
initTriggerEmulator(&sharedLogger, engine);
#if EFI_MAP_AVERAGING || defined(__DOXYGEN__)
initMapAveraging(&sharedLogger, engine);
#endif /* EFI_MAP_AVERAGING */
initMainEventListener(&sharedLogger, engine);
startStatusThreads();
runChprintfTest();
initPeriodicEvents(PASS_ENGINE_PARAMETER_F);
setTriggerEmulatorRPM(DEFAULT_SIM_RPM, engine);
engineConfiguration->engineSnifferRpmThreshold = DEFAULT_SNIFFER_THR;
}
void printPendingMessages(void) {
updateDevConsoleState();
waveChart.publishIfFull();
}
int isSerialOverTcpReady;
int maxNesting = 0;
bool isCommandLineConsoleReady(void) {
return isSerialOverTcpReady;
}
void applyNewConfiguration(void) {
}
void onFatalError(const char *msg, const char * file, int line) {
printf("onFatalError %s %s%d", msg, file, line);
exit(-1);
}
void logMsg(const char *format, ...) {
// FILE * fp;
// fp = fopen ("simulator.log", "a");
//
// va_list(args);
// va_start(args, format);
// vfprintf(fp, format, args);
//
// fclose(fp);
}
SerialDriver * getConsoleChannel(void) {
return (SerialDriver *)EFI_CONSOLE_UART_DEVICE;
}

View File

@ -0,0 +1,24 @@
/**
* @file rusEfiFunctionalTest.h
*
* @date Mar 1, 2014
* @author Andrey Belomutskiy, (c) 2012-2016
*/
#ifndef RUSEFIFUNCTIONALTEST_H_
#define RUSEFIFUNCTIONALTEST_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void rusEfiFunctionalTest(void);
void printPendingMessages(void);
void logMsg(const char *fmt, ...);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* RUSEFIFUNCTIONALTEST_H_ */

View File

@ -0,0 +1,6 @@
// this is less important for simulator
#ifndef VCS_VERSION
#define VCS_VERSION "simulator"
#endif