newer version

This commit is contained in:
rusefi 2014-04-22 20:15:29 -05:00
parent bfec788027
commit 89850a25f0
53 changed files with 3637 additions and 3533 deletions

View File

@ -1,141 +1,156 @@
<?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.config.gnu.cygwin.exe.debug.530233040">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cygwin.exe.debug.530233040" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<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 artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cygwin.exe.debug.530233040" name="Debug" parent="cdt.managedbuild.config.gnu.cygwin.exe.debug">
<folderInfo id="cdt.managedbuild.config.gnu.cygwin.exe.debug.530233040." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.exe.debug.142029168" name="Cygwin GCC" superClass="cdt.managedbuild.toolchain.gnu.cygwin.exe.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.cygwin.exe.debug.1195576766" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.cygwin.exe.debug"/>
<builder buildPath="${workspace_loc:/unit_tests}/Debug" id="cdt.managedbuild.target.gnu.builder.cygwin.exe.debug.277211349" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.cygwin.exe.debug"/>
<tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.debug.1303365167" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.debug">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.993041368" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.870144749" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.debug.1825656332" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.debug">
<option id="gnu.cpp.compiler.cygwin.exe.debug.option.optimization.level.598398831" name="Optimization Level" superClass="gnu.cpp.compiler.cygwin.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.cygwin.exe.debug.option.debugging.level.2019038432" name="Debug Level" superClass="gnu.cpp.compiler.cygwin.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.other.other.1220149077" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fmessage-length=0" valueType="string"/>
<option id="gnu.cpp.compiler.option.include.paths.1280999160" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/test_basic_math&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/test_data_structures&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/engines&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/ext_algo/nmea&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/ext_algo&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/controllers_math&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/controllers_sensors&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/controllers_algo&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/util&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.1681941669" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug.259037498" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.cygwin.exe.debug.option.optimization.level.899787827" name="Optimization Level" superClass="gnu.c.compiler.cygwin.exe.debug.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.cygwin.exe.debug.option.debugging.level.600286923" name="Debug Level" superClass="gnu.c.compiler.cygwin.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="gnu.c.compiler.option.misc.other.1016166105" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0 -std=gnu99 -fgnu89-inline -Werror-implicit-function-declaration" valueType="string"/>
<option id="gnu.c.compiler.option.include.paths.811604738" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/test_basic_math&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/test_data_structures&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/engines&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/ext_algo/nmea&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/ext_algo&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/controllers_math&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/controllers_sensors&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/controllers_algo&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/util&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1693315995" superClass="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.debug.1531611540" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.debug"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.debug.1614744459" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.debug">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1957409246" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.cygwin.exe.release.615580757">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cygwin.exe.release.615580757" moduleId="org.eclipse.cdt.core.settings" name="Release">
<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 artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cygwin.exe.release.615580757" name="Release" parent="cdt.managedbuild.config.gnu.cygwin.exe.release">
<folderInfo id="cdt.managedbuild.config.gnu.cygwin.exe.release.615580757." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.exe.release.814666698" name="Cygwin GCC" superClass="cdt.managedbuild.toolchain.gnu.cygwin.exe.release">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.cygwin.exe.release.1299449901" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.cygwin.exe.release"/>
<builder buildPath="${workspace_loc:/unit_tests}/Release" id="cdt.managedbuild.target.gnu.builder.cygwin.exe.release.1095970666" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.cygwin.exe.release"/>
<tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.release.770682652" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.release">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.775261179" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.101933249" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.release.2008790765" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.release">
<option id="gnu.cpp.compiler.cygwin.exe.release.option.optimization.level.1530540669" name="Optimization Level" superClass="gnu.cpp.compiler.cygwin.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option id="gnu.cpp.compiler.cygwin.exe.release.option.debugging.level.1237567557" name="Debug Level" superClass="gnu.cpp.compiler.cygwin.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.330744446" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release.898041114" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release">
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.cygwin.exe.release.option.optimization.level.114808365" name="Optimization Level" superClass="gnu.c.compiler.cygwin.exe.release.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.cygwin.exe.release.option.debugging.level.715395708" name="Debug Level" superClass="gnu.c.compiler.cygwin.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1402954999" superClass="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.release.1597625643" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.release"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.release.1354105539" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.release">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1729844263" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="unit_tests.cdt.managedbuild.target.gnu.cygwin.exe.837710263" name="Executable" projectType="cdt.managedbuild.target.gnu.cygwin.exe"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.debug.530233040;cdt.managedbuild.config.gnu.cygwin.exe.debug.530233040.;cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.debug.1825656332;cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.1681941669">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.release.615580757;cdt.managedbuild.config.gnu.cygwin.exe.release.615580757.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release.898041114;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1402954999">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.release.615580757;cdt.managedbuild.config.gnu.cygwin.exe.release.615580757.;cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.release.2008790765;cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.330744446">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.debug.530233040;cdt.managedbuild.config.gnu.cygwin.exe.debug.530233040.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug.259037498;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1693315995">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope"/>
</cproject>
<?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.config.gnu.cygwin.exe.debug.530233040">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cygwin.exe.debug.530233040" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<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 artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cygwin.exe.debug.530233040" name="Debug" parent="cdt.managedbuild.config.gnu.cygwin.exe.debug">
<folderInfo id="cdt.managedbuild.config.gnu.cygwin.exe.debug.530233040." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.exe.debug.142029168" name="Cygwin GCC" superClass="cdt.managedbuild.toolchain.gnu.cygwin.exe.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.cygwin.exe.debug.1195576766" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.cygwin.exe.debug"/>
<builder buildPath="${workspace_loc:/unit_tests}/Debug" id="cdt.managedbuild.target.gnu.builder.cygwin.exe.debug.277211349" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.cygwin.exe.debug"/>
<tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.debug.1303365167" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.debug">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.993041368" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.870144749" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.debug.1825656332" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.debug">
<option id="gnu.cpp.compiler.cygwin.exe.debug.option.optimization.level.598398831" name="Optimization Level" superClass="gnu.cpp.compiler.cygwin.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.cygwin.exe.debug.option.debugging.level.2019038432" name="Debug Level" superClass="gnu.cpp.compiler.cygwin.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.other.other.1220149077" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fmessage-length=0" valueType="string"/>
<option id="gnu.cpp.compiler.option.include.paths.1280999160" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/test_basic_math&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/test_data_structures&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/engines&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/ext_algo/nmea&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/ext_algo&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/controllers_math&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/controllers_sensors&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/controllers_algo&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/controllers_trigger&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/util&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.1681941669" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug.259037498" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.cygwin.exe.debug.option.optimization.level.899787827" name="Optimization Level" superClass="gnu.c.compiler.cygwin.exe.debug.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.cygwin.exe.debug.option.debugging.level.600286923" name="Debug Level" superClass="gnu.c.compiler.cygwin.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="gnu.c.compiler.option.misc.other.1016166105" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0 -std=gnu99 -fgnu89-inline -Werror-implicit-function-declaration" valueType="string"/>
<option id="gnu.c.compiler.option.include.paths.811604738" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/test_basic_math&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/test_data_structures&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/engines&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/ext_algo/nmea&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/ext_algo&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/controllers_math&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/controllers_sensors&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/controllers_algo&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/controllers_trigger&quot;"/>
<listOptionValue builtIn="false" value="&quot;/cygdrive/c/stuff/rusefi_sourceforge/unit_tests/util&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1693315995" superClass="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.debug.1531611540" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.debug"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.debug.1614744459" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.debug">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1957409246" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="controllers_trigger/trigger_central.c|controllers_trigger/rpm_calculator.c|controllers_trigger/main_trigger_callback.cpp" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.cygwin.exe.release.615580757">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.cygwin.exe.release.615580757" moduleId="org.eclipse.cdt.core.settings" name="Release">
<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 artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.cygwin.exe.release.615580757" name="Release" parent="cdt.managedbuild.config.gnu.cygwin.exe.release">
<folderInfo id="cdt.managedbuild.config.gnu.cygwin.exe.release.615580757." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.cygwin.exe.release.814666698" name="Cygwin GCC" superClass="cdt.managedbuild.toolchain.gnu.cygwin.exe.release">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.cygwin.exe.release.1299449901" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.cygwin.exe.release"/>
<builder buildPath="${workspace_loc:/unit_tests}/Release" id="cdt.managedbuild.target.gnu.builder.cygwin.exe.release.1095970666" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.cygwin.exe.release"/>
<tool id="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.release.770682652" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.cygwin.exe.release">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.775261179" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.cygwin.base.101933249" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.cygwin.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.release.2008790765" name="Cygwin C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.release">
<option id="gnu.cpp.compiler.cygwin.exe.release.option.optimization.level.1530540669" name="Optimization Level" superClass="gnu.cpp.compiler.cygwin.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option id="gnu.cpp.compiler.cygwin.exe.release.option.debugging.level.1237567557" name="Debug Level" superClass="gnu.cpp.compiler.cygwin.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.330744446" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release.898041114" name="Cygwin C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release">
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.cygwin.exe.release.option.optimization.level.114808365" name="Optimization Level" superClass="gnu.c.compiler.cygwin.exe.release.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.cygwin.exe.release.option.debugging.level.715395708" name="Debug Level" superClass="gnu.c.compiler.cygwin.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1402954999" superClass="cdt.managedbuild.tool.gnu.c.compiler.input.cygwin"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.release.1597625643" name="Cygwin C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.cygwin.exe.release"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.release.1354105539" name="Cygwin C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.cygwin.exe.release">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1729844263" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="controllers_trigger/trigger_central.c|controllers_trigger/rpm_calculator.c|controllers_trigger/main_trigger_callback.cpp" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="unit_tests.cdt.managedbuild.target.gnu.cygwin.exe.837710263" name="Executable" projectType="cdt.managedbuild.target.gnu.cygwin.exe"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.debug.530233040;cdt.managedbuild.config.gnu.cygwin.exe.debug.530233040.;cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.debug.1825656332;cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.1681941669">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.release.615580757;cdt.managedbuild.config.gnu.cygwin.exe.release.615580757.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.release.898041114;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1402954999">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.release.615580757;cdt.managedbuild.config.gnu.cygwin.exe.release.615580757.;cdt.managedbuild.tool.gnu.cpp.compiler.cygwin.exe.release.2008790765;cdt.managedbuild.tool.gnu.cpp.compiler.input.cygwin.330744446">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.cygwin.exe.debug.530233040;cdt.managedbuild.config.gnu.cygwin.exe.debug.530233040.;cdt.managedbuild.tool.gnu.c.compiler.cygwin.exe.debug.259037498;cdt.managedbuild.tool.gnu.c.compiler.input.cygwin.1693315995">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/unit_tests"/>
</configuration>
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/unit_tests"/>
</configuration>
</storageModule>
</cproject>

View File

@ -1,27 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>unit_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>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>unit_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>

View File

@ -1,221 +1,228 @@
##############################################################################
# Build global options
# NOTE: Can be overridden externally.
#
PROJECT_DIR = ../firmware
#CHIBIOS = $(PROJECT_DIR)/chibios
# Compiler options here.
ifeq ($(USE_OPT),)
# -O2 is needed for mingw, without it there is a linking issue to isnanf?!?!
#USE_OPT = $(RFLAGS) -O2 -fgnu89-inline -ggdb -fomit-frame-pointer -falign-functions=16 -std=gnu99 -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
USE_OPT = -c -Wall -O2
endif
# C specific options here (added to USE_OPT).
ifeq ($(USE_COPT),)
USE_COPT = -std=gnu99 -fgnu89-inline
endif
# C++ specific options here (added to USE_OPT).
ifeq ($(USE_CPPOPT),)
USE_CPPOPT = -fno-rtti -fpermissive -fno-exceptions -fno-use-cxa-atexit
endif
# Enable this if you want the linker to remove unused code and data
ifeq ($(USE_LINK_GC),)
USE_LINK_GC = yes
endif
# If enabled, this option allows to compile the application in THUMB mode.
ifeq ($(USE_THUMB),)
USE_THUMB = no
endif
# Enable this if you want to see the full log while compiling.
ifeq ($(USE_VERBOSE_COMPILE),)
USE_VERBOSE_COMPILE = no
endif
#
# Build global options
##############################################################################
##############################################################################
# Architecture or project specific options
#
# List all default C defines here, like -D_DEBUG=1
DDEFS =
#
# Architecture or project specific options
##############################################################################
##############################################################################
# Project, sources and paths
#
# Define project name here
PROJECT = rusefi_test
#PROJECT_BOARD = OLIMEX_STM32_E407
#ifneq ($(PROJECT_BOARD),OLIMEX_STM32_E407)
# PROJECT_BOARD = ST_STM32F4_DISCOVERY
#endif
#DDEFS += -D$(PROJECT_BOARD)
# Imported source files and paths
include $(PROJECT_DIR)/util/util.mk
include $(PROJECT_DIR)/config/engines/engines.mk
include $(PROJECT_DIR)/controllers/algo/algo.mk
include $(PROJECT_DIR)/controllers/math/math.mk
include $(PROJECT_DIR)/controllers/sensors/sensors.mk
include test.mk
# Define linker script file here
#LDSCRIPT= config/system/STM32F407xG.ld
#LDSCRIPT= $(PORTLD)/STM32F407xG_CCM.ld
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = $(UTILSRC) \
$(CONTROLLERS_ALGO_SRC) \
$(CONTROLLERS_MATH_SRC) \
$(CONTROLLERS_SENSORS_SRC) \
$(ENGINES_SRC) \
$(TEST_SRC_C)
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CPPSRC = $(UTILSRC_CPP) \
$(CONTROLLERS_ALGO_SRC_CPP) \
$(ENGINES_SRC_CPP) \
$(TEST_SRC_CPP) \
main.cpp
# C sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACSRC =
# C++ sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACPPSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCPPSRC =
# List ASM source files here
ASMSRC = $(PORTASM)
INCDIR = . \
$(PROJECT_DIR)/util \
$(PROJECT_DIR)/config/engines \
$(PROJECT_DIR)/controllers/sensors \
$(PROJECT_DIR)/controllers/algo \
$(PROJECT_DIR)/controllers/math \
$(PROJECT_DIR)/ext_algo \
test_data_structures \
test_basic_math
#
# Project, sources and paths
##############################################################################
##############################################################################
# Compiler settings
#
#MCU = cortex-m4
ifeq ($(OS),Windows_NT)
TRGT = i686-pc-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
OD = $(TRGT)objdump
HEX = $(CP) -O ihex
BIN = $(CP) -O binary
# ARM-specific options here
AOPT =
# THUMB-specific options here
TOPT = -mthumb -DTHUMB
# Define C warning options here
CWARN = -Wall -Wextra -Wstrict-prototypes
# Define C++ warning options here
CPPWARN = -Wall -Wextra
#
# Compiler settings
##############################################################################
##############################################################################
# Start of default section
#
# List all default ASM defines here, like -D_DEBUG=1
DADEFS =
# List all default directories to look for include files here
DINCDIR =
# List the default directory to look for the libraries here
DLIBDIR =
# List all default libraries here
DLIBS = -static-libgcc -static-libstdc++
#
# End of default section
##############################################################################
##############################################################################
# Start of user section
#
# List all user C define here, like -D_DEBUG=1
UDEFS =
# 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
ULIBS = -lm
#
# End of user defines
##############################################################################
include rules.mk
##############################################################################
# Build global options
# NOTE: Can be overridden externally.
#
PROJECT_DIR = ../firmware
#CHIBIOS = $(PROJECT_DIR)/chibios
# Compiler options here.
ifeq ($(USE_OPT),)
# -O2 is needed for mingw, without it there is a linking issue to isnanf?!?!
#USE_OPT = $(RFLAGS) -O2 -fgnu89-inline -ggdb -fomit-frame-pointer -falign-functions=16 -std=gnu99 -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
USE_OPT = -c -Wall -O0 -ggdb -g3
endif
# C specific options here (added to USE_OPT).
ifeq ($(USE_COPT),)
USE_COPT = -std=gnu99 -fgnu89-inline
endif
# C++ specific options here (added to USE_OPT).
ifeq ($(USE_CPPOPT),)
USE_CPPOPT = -fno-rtti -fpermissive -fno-exceptions -fno-use-cxa-atexit
endif
# Enable this if you want the linker to remove unused code and data
ifeq ($(USE_LINK_GC),)
USE_LINK_GC = yes
endif
# If enabled, this option allows to compile the application in THUMB mode.
ifeq ($(USE_THUMB),)
USE_THUMB = no
endif
# Enable this if you want to see the full log while compiling.
ifeq ($(USE_VERBOSE_COMPILE),)
USE_VERBOSE_COMPILE = no
endif
#
# Build global options
##############################################################################
##############################################################################
# Architecture or project specific options
#
# List all default C defines here, like -D_DEBUG=1
DDEFS =
#
# Architecture or project specific options
##############################################################################
##############################################################################
# Project, sources and paths
#
# Define project name here
PROJECT = rusefi_test
#PROJECT_BOARD = OLIMEX_STM32_E407
#ifneq ($(PROJECT_BOARD),OLIMEX_STM32_E407)
# PROJECT_BOARD = ST_STM32F4_DISCOVERY
#endif
#DDEFS += -D$(PROJECT_BOARD)
# Imported source files and paths
include $(PROJECT_DIR)/util/util.mk
include $(PROJECT_DIR)/config/engines/engines.mk
include $(PROJECT_DIR)/controllers/algo/algo.mk
include $(PROJECT_DIR)/controllers/math/math.mk
include $(PROJECT_DIR)/controllers/sensors/sensors.mk
include test.mk
# Define linker script file here
#LDSCRIPT= config/system/STM32F407xG.ld
#LDSCRIPT= $(PORTLD)/STM32F407xG_CCM.ld
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = $(UTILSRC) \
$(CONTROLLERS_ALGO_SRC) \
$(CONTROLLERS_MATH_SRC) \
$(CONTROLLERS_SENSORS_SRC) \
$(ENGINES_SRC) \
$(PROJECT_DIR)/controllers/trigger/trigger_mazda.c \
$(PROJECT_DIR)/controllers/trigger/trigger_structure.c \
$(TEST_SRC_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/trigger/trigger_chrysler.cpp \
$(PROJECT_DIR)/controllers/trigger/trigger_gm.cpp \
$(PROJECT_DIR)/controllers/trigger/trigger_decoder.cpp \
$(ENGINES_SRC_CPP) \
$(CONTROLLERS_MATH_SRC_CPP) \
$(TEST_SRC_CPP) \
main.cpp
# C sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACSRC =
# C++ sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACPPSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCPPSRC =
# List ASM source files here
ASMSRC = $(PORTASM)
INCDIR = . \
$(PROJECT_DIR)/util \
$(PROJECT_DIR)/config/engines \
$(PROJECT_DIR)/controllers/sensors \
$(PROJECT_DIR)/controllers/algo \
$(PROJECT_DIR)/controllers/math \
$(PROJECT_DIR)/controllers/trigger \
$(PROJECT_DIR)/ext_algo \
test_data_structures \
test_basic_math
#
# Project, sources and paths
##############################################################################
##############################################################################
# Compiler settings
#
#MCU = cortex-m4
ifeq ($(OS),Windows_NT)
TRGT = i686-pc-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
OD = $(TRGT)objdump
HEX = $(CP) -O ihex
BIN = $(CP) -O binary
# ARM-specific options here
AOPT =
# THUMB-specific options here
TOPT = -mthumb -DTHUMB
# Define C warning options here
CWARN = -Wall -Wextra -Wstrict-prototypes
# Define C++ warning options here
CPPWARN = -Wall -Wextra
#
# Compiler settings
##############################################################################
##############################################################################
# Start of default section
#
# List all default ASM defines here, like -D_DEBUG=1
DADEFS =
# List all default directories to look for include files here
DINCDIR =
# List the default directory to look for the libraries here
DLIBDIR =
# List all default libraries here
DLIBS = -static-libgcc -static-libstdc++
#
# End of default section
##############################################################################
##############################################################################
# Start of user section
#
# List all user C define here, like -D_DEBUG=1
UDEFS =
# 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
ULIBS = -lm
#
# End of user defines
##############################################################################
include rules.mk

View File

@ -1,11 +1,11 @@
/**
* @file adc_inputs.h
*
* @date Dec 7, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef ADC_INPUTS_H_
#define ADC_INPUTS_H_
#endif /* ADC_INPUTS_H_ */
/**
* @file adc_inputs.h
*
* @date Dec 7, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef ADC_INPUTS_H_
#define ADC_INPUTS_H_
#endif /* ADC_INPUTS_H_ */

View File

@ -1,23 +1,22 @@
/**
* @file board.c
*
* @date Nov 15, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#include "boards.h"
float getVoltageDivided(int channel) {
return 0;
}
float getVoltage(int channel) {
return 0;
}
int getAdcValue(int channel) {
return 0;
}
/**
* @file board.c
*
* @date Nov 15, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#include "boards.h"
float getVoltageDivided(int channel) {
return 0;
}
float getVoltage(int channel) {
return 0;
}
int getAdcValue(int channel) {
return 0;
}

View File

@ -1,24 +1,24 @@
/*
* boards.h
*
* Created on: Nov 15, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef BOARDS_H_
#define BOARDS_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
float getVoltageDivided(int);
float getVoltage(int channel);
int getAdcValue(int channel);
#endif /* BOARDS_H_ */
/*
* boards.h
*
* Created on: Nov 15, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef BOARDS_H_
#define BOARDS_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
float getVoltageDivided(int);
float getVoltage(int channel);
int getAdcValue(int channel);
#endif /* BOARDS_H_ */

View File

@ -1,3 +1,3 @@
rm -rf .dep/
rm -rf build/
make
rm -rf .dep/
rm -rf build/
make

View File

@ -1,13 +1,20 @@
/*
* efifeatures.h
*
* Created on: Mar 7, 2014
* Author: Andrey
*/
#ifndef EFIFEATURES_H_
#define EFIFEATURES_H_
#define EFI_CLI_SUPPORT FALSE
#endif /* EFIFEATURES_H_ */
/*
* efifeatures.h
*
* Created on: Mar 7, 2014
* Author: Andrey
*/
#ifndef EFIFEATURES_H_
#define EFIFEATURES_H_
#define EFI_CLI_SUPPORT FALSE
#define EFI_SUPPORT_FORD_ASPIRE TRUE
#define EFI_SUPPORT_DODGE_NEON TRUE
#define EFI_SUPPORT_1995_FORD_INLINE_6 TRUE
#define EFI_SUPPORT_FORD_FIESTA TRUE
#define EFI_SUPPORT_NISSAN_PRIMERA TRUE
#endif /* EFIFEATURES_H_ */

View File

@ -1,23 +1,19 @@
/*
* @file global.h
*
* @date Nov 28, 2013
* @author pc
*/
#ifndef GLOBAL_H_
#define GLOBAL_H_
#include <time.h>
#include <string.h>
#define EFI_SUPPORT_FORD_ASPIRE TRUE
#define EFI_SUPPORT_DODGE_NEON TRUE
#define EFI_SUPPORT_1995_FORD_INLINE_6 TRUE
#define EFI_SUPPORT_FORD_FIESTA TRUE
#define EFI_SUPPORT_NISSAN_PRIMERA TRUE
#define TRUE 1
#define FALSE 0
#endif /* GLOBAL_H_ */
/*
* @file global.h
*
* @date Nov 28, 2013
* @author pc
*/
#ifndef GLOBAL_H_
#define GLOBAL_H_
#include <time.h>
#include <string.h>
#include "efitime.h"
#define TRUE 1
#define FALSE 0
#endif /* GLOBAL_H_ */

View File

@ -1,40 +1,40 @@
#!/bin/bash
echo "The PATH is ${PATH}"
cd "${WORKSPACE}"
echo "start in workspace ${PWD}"
cd firmware
echo "CD to ${PWD}"
rm -fR .dep
rm -fR build
make
if [ ! -f build/rusefi.hex ]; then
echo "Firmware compilation failed"
exit -1
fi
cd "${WORKSPACE}/win32_algo_tests"
echo "CD to ${PWD}"
rm -fR .dep
rm -fR build
make
if [ ! -f build/rusefi_test ]; then
echo "test compilation failed"
exit -1
fi
# we want to terminate if test fails
set -e
# invoke the tests - hopefully error code would be propagated?
build/rusefi_test
cd "${WORKSPACE}/java_console"
echo "CD to ${PWD}"
#JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64
#ant
#!/bin/bash
echo "The PATH is ${PATH}"
cd "${WORKSPACE}"
echo "start in workspace ${PWD}"
cd firmware
echo "CD to ${PWD}"
rm -fR .dep
rm -fR build
make
if [ ! -f build/rusefi.hex ]; then
echo "Firmware compilation failed"
exit -1
fi
cd "${WORKSPACE}/win32_algo_tests"
echo "CD to ${PWD}"
rm -fR .dep
rm -fR build
make
if [ ! -f build/rusefi_test ]; then
echo "test compilation failed"
exit -1
fi
# we want to terminate if test fails
set -e
# invoke the tests - hopefully error code would be propagated?
build/rusefi_test
cd "${WORKSPACE}/java_console"
echo "CD to ${PWD}"
#JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64
#ant

View File

@ -13,6 +13,7 @@
#include <stdarg.h>
#include "main.h"
#include "error_handling.h"
extern "C"
{
@ -28,10 +29,10 @@ extern "C"
#include "test_signal_executor.h"
#include "test_util.h"
#include "engine_configuration.h"
#include "test_trigger_decoder.h"
#include "engine_math.h"
}
#include "test_trigger_decoder.h"
static engine_configuration_s ec;
engine_configuration_s *engineConfiguration = &ec;
@ -40,8 +41,12 @@ static float absF(float value) {
return value > 0 ? value : -value;
}
uint64_t getTimeNowUs(void) {
return 0;
}
void assertEqualsM(char *msg, float expected, float actual) {
if (isnan(actual) && !isnan(expected)) {
if (cisnan(actual) && !cisnan(expected)) {
printf("Unexpected: %s %.4f while expected %.4f\r\n", msg, actual, expected);
exit(-1);
}
@ -86,6 +91,7 @@ static engine_configuration2_s ec2;
engine_configuration2_s *engineConfiguration2 = &ec2;
int main(void) {
testOverflow64Counter();
testInterpolate3d();
testFindIndex();
testInterpolate2d();
@ -111,15 +117,16 @@ int main(void) {
testPinHelper();
testSetTableValue();
printf("Success 20130319\r\n");
printf("Success 20130422\r\n");
// resizeMap();
return EXIT_SUCCESS;
}
void warning(char *msg, float value) {
printf("Warning: %s %f\r\n", msg, value);
int warning(obd_code_e code, const char *fmt, ...) {
printf("Warning: %s\r\n", fmt);
}
void firmwareError(const char *fmt, ...) {

View File

@ -1,58 +1,62 @@
/**
* @file main.h
* @brief Test version of main.h
*
* Created on: Oct 17, 2013
* Author: Andrey Belomutskiy (C) 2012-2013
*/
#ifndef MAIN_H_
#define MAIN_H_
#include <stdio.h>
#include <math.h>
#include "error_handling.h"
#ifdef __cplusplus
extern "C"
{
#endif
#include "efilib.h"
#include "global.h"
#include "boards.h"
#include "engines.h"
typedef int bool_t;
void chDbgAssert(int c, char *msg, void *arg);
void print(const char *fmt, ...);
#define TICKS_IN_MS 100
#define DEBUG_INTERPOLATION 1
#define chDbgCheck(x, y) chDbgAssert(x, y, NULL)
void assertEqualsM(char *msg, float expected, float actual);
void assertEquals(float expected, float actual);
void assertTrue(float actual);
void assertTrueM(char *msg, float actual);
void assertFalse(float actual);
void assertFalseM(char *msg, float actual);
float getIntakeAirTemperature(void);
float getCoolantTemperature(void);
float getVBatt(void);
float getMaf(void);
#define systicks2ms(x) (0)
#ifdef __cplusplus
}
#endif
#endif /* MAIN_H_ */
/**
* @file main.h
* @brief Test version of main.h
*
* Created on: Oct 17, 2013
* Author: Andrey Belomutskiy (C) 2012-2013
*/
#ifndef MAIN_H_
#define MAIN_H_
#include <stdio.h>
#include <math.h>
#ifdef __cplusplus
extern "C"
{
#endif
#define CH_FREQUENCY 1000
#include "global.h"
#include "error_handling.h"
#include "efilib.h"
#include "efitime.h"
#include "boards.h"
#include "engines.h"
typedef int bool_t;
void chDbgAssert(int c, char *msg, void *arg);
void print(const char *fmt, ...);
#define TICKS_IN_MS 100
#define DEBUG_INTERPOLATION 1
#define chDbgCheck(x, y) chDbgAssert(x, y, NULL)
void assertEqualsM(char *msg, float expected, float actual);
void assertEquals(float expected, float actual);
void assertTrue(float actual);
void assertTrueM(char *msg, float actual);
void assertFalse(float actual);
void assertFalseM(char *msg, float actual);
float getIntakeAirTemperature(void);
float getCoolantTemperature(void);
float getVBatt(void);
float getMaf(void);
#define systicks2ms(x) (0)
#ifdef __cplusplus
}
#endif
#endif /* MAIN_H_ */

View File

@ -1,8 +1,9 @@
junction controllers_algo ..\firmware\controllers\algo
junction controllers_math ..\firmware\controllers\math
junction engines ..\firmware\config\engines
junction controllers_sensors ..\firmware\controllers\sensors
junction util ..\firmware\util
junction ext_algo ..\firmware\ext_algo
junction controllers_algo ..\firmware\controllers\algo
junction controllers_math ..\firmware\controllers\math
junction controllers_trigger ..\firmware\controllers\trigger
junction engines ..\firmware\config\engines
junction controllers_sensors ..\firmware\controllers\sensors
junction util ..\firmware\util
junction ext_algo ..\firmware\ext_algo

View File

@ -1,176 +1,176 @@
/**
* @file map_resize.c
*
* @date Jan 12, 2014
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#include <stdio.h>
#include "fuel_math.h"
#include "interpolation.h"
#include "engines.h"
#include "engine_configuration.h"
#include "main.h"
#include "idle_controller.h"
#if 1
#define AD_LOAD_COUNT 16
#define AD_RPM_COUNT 16
static float ad_rpm_table[] = {/*0*/ 800.000000,
/*1*/ 1213.333374,
/*2*/ 1626.666748,
/*3*/ 2040.000000,
/*4*/ 2453.333496,
/*5*/ 2866.666748,
/*6*/ 3280.000000,
/*7*/ 3693.333496,
/*8*/ 4106.666992,
/*9*/ 4520.000000,
/*10*/ 4933.333496,
/*11*/ 5346.666992,
/*12*/ 5760.000000,
/*13*/ 6173.333496,
/*14*/ 6586.666992,
/*15*/ 7000.000000,
};;
static float ad_maf_table[] =
{/*0*/ 1.200000,
/*1*/ 1.413333,
/*2*/ 1.626667,
/*3*/ 1.840000,
/*4*/ 2.053333,
/*5*/ 2.266667,
/*6*/ 2.480000,
/*7*/ 2.693333,
/*8*/ 2.906667,
/*9*/ 3.120000,
/*10*/ 3.333333,
/*11*/ 3.546667,
/*12*/ 3.760000,
/*13*/ 3.973333,
/*14*/ 4.186667,
/*15*/ 4.400000,
};
static float ad_table[AD_LOAD_COUNT][AD_RPM_COUNT] = {
/* RPM 800.000000 1213.333374 1626.666748 2040.000000 2453.333496 2866.666748 3280.000000 3693.333496 4106.666992 4520.000000 4933.333496 5346.666992 5760.000000 6173.333496 6586.666992 7000.000000*/
/* Load 1.200000 */{ 0.662000, -7.730000, -16.722000, -23.139999, -29.398001, -31.268000, -32.108002, -30.436001, -30.896000, -26.656000, -24.704000, -25.108000, -25.132000, -25.459999, -25.459999, -25.459999},
/* Load 1.413333 */{ 0.546000, -7.662000, -16.882000, -23.482000, -29.520000, -31.323999, -32.108002, -30.656000, -30.468000, -26.879999, -24.746000, -24.742001, -29.032000, -25.562000, -25.562000, -25.562000},
/* Load 1.626667 */{ 0.584000, -7.870000, -16.714001, -23.025999, -29.542000, -31.166000, -32.175999, -30.540001, -30.268000, -26.416000, -24.134001, -25.007999, -24.698000, -26.167999, -26.167999, -26.167999},
/* Load 1.840000 */{ 0.584000, -7.658000, -16.714001, -23.254000, -29.351999, -30.978001, -32.141998, -30.874001, -30.896000, -26.507999, -24.558001, -24.389999, -25.761999, -35.492001, -35.492001, -35.492001},
/* Load 2.053333 */{ 0.584000, -7.862000, -16.538000, -23.254000, -29.232000, -31.296000, -32.520000, -30.142000, -30.388000, -25.903999, -24.370001, -24.082001, -24.792000, -24.351999, -24.351999, -24.351999},
/* Load 2.266667 */{ -1.364000, -7.726000, -16.806000, -23.254000, -29.639999, -31.006001, -32.298000, -30.912001, -29.882000, -26.392000, -24.664000, -27.233999, -25.374001, -25.417999, -25.417999, -25.417999},
/* Load 2.480000 */{ 1.364000, -10.490000, -16.705999, -22.441999, -28.101999, -30.238001, -32.363998, -30.719999, -30.896000, -26.608000, -24.664000, -24.431999, -24.500000, -25.510000, -25.510000, -25.510000},
/* Load 2.693333 */{ 9.864000, -10.416000, -11.680000, -19.150000, -25.754000, -27.936001, -32.554001, -30.656000, -30.153999, -27.184000, -25.252001, -22.812000, -24.452000, -25.219999, -25.219999, -25.219999},
/* Load 2.906667 */{ 9.866000, 5.452000, 2.854000, -17.212000, -17.552000, -20.688000, -25.660000, -27.809999, -27.691999, -27.224001, -25.882000, -25.360001, -26.100000, -27.992001, -27.992001, -27.992001},
/* Load 3.120000 */{ 9.864000, 5.452000, 2.854000, -0.342000, -12.526000, -16.218000, -21.364000, -27.590000, -25.780001, -24.170000, -24.664000, -25.584000, -26.490000, -31.968000, -31.968000, -31.968000},
/* Load 3.333333 */{ 9.864000, 5.516000, 2.854000, -0.226000, -2.738000, -3.816000, -11.924000, -18.808001, -21.038000, -21.538000, -21.209999, -22.228001, -25.046000, -25.156000, -25.156000, -25.156000},
/* Load 3.546667 */{ 9.866000, 5.518000, 2.854000, 0.000000, -3.022000, -3.816000, -6.428000, -7.788000, -19.426001, -20.860001, -19.966000, -21.030001, -21.396000, -21.570000, -21.570000, -21.570000},
/* Load 3.760000 */{ 9.864000, 5.516000, 2.772000, -0.226000, -2.732000, -3.500000, -6.798000, -8.102000, -8.660000, -9.500000, -11.788000, -20.132000, -20.072001, -20.510000, -20.510000, -20.510000},
/* Load 3.973333 */{ 9.864000, 5.518000, 2.854000, 0.000000, -2.880000, -3.816000, -6.420000, -8.320000, -8.426000, -8.532000, -11.470000, -11.442000, -13.610000, -12.022000, -12.022000, -12.022000},
/* Load 4.186667 */{ 9.750000, 5.518000, 2.604000, 0.000000, -2.880000, -3.654000, -6.050000, -6.888000, -8.372000, -9.364000, -11.764000, -11.732000, -11.864000, -12.376000, -12.376000, -12.376000},
/* Load 4.400000 */{ 0.350000, 5.590000, 0.502000, 0.910000, 0.864000, 0.954000, 1.324000, -7.436000, 1.170000, 1.054000, 2.058000, 2.098000, 2.636000, -12.352000, -12.352000, -12.352000}
};
//float getBaseAdvance(int rpm, float key) {
// // todo: use interpolation
// int rpm_index = findIndex(ad_rpm_table, AD_RPM_COUNT, rpm);
// rpm_index = max(rpm_index, 0);
// int maf_index = findIndex(ad_maf_table, AD_LOAD_COUNT, key);
// maf_index = max(maf_index, 0);
//
// return ad_table[rpm_index][maf_index];
//}
#define newRpmSize 16
#define newKeySize 16
static float newRpmBin[newRpmSize];
static float newKeyBin[newKeySize];
//static float *fuel_ptrs[FUEL_LOAD_COUNT];
//EngineConfiguration *engineConfiguration;
extern int needInterpolationLogging;
void resizeMap(void) {
// float keyMin = 1.2;
// float keyMax = 4.4;
//
// float rpmMin = 800;
// float rpmMax = 7000;
// for (int k = 0; k < FUEL_LOAD_COUNT; k++)
// fuel_ptrs[k] = engineConfiguration->fuelTable[k];
// for (int i = 0; i < FUEL_MAF_COUNT; i++)
// engineConfiguration->fuelKeyBins[i] = default_fuel_maf_bins[i];
// for (int i = 0; i < FUEL_RPM_COUNT; i++)
// engineConfiguration->fuelRpmBins[i] = default_fuel_rpm_bins[i];
// for (int k = 0; k < FUEL_MAF_COUNT; k++) {
// for (int r = 0; r < FUEL_RPM_COUNT; r++) {
// // todo: this is BAD, this needs to be fixed - TS table indexes are different from default indexes
// engineConfiguration->fuelTable[k][r] = default_fuel_table[r][k];
// }
// }
// assertEquals(15, interpolate3d(1.2, engineConfiguration->fuelKeyBins, FUEL_MAF_COUNT, 8000,
// engineConfiguration->fuelRpmBins,
// FUEL_RPM_COUNT, fuel_ptrs));
needInterpolationLogging = 0;
// printf("static float ad_maf_table[AD_LOAD_COUNT] = {");
// for (int i = 0; i < newKeySize; i++) {
// newKeyBin[i] = interpolate(0, keyMin, newKeySize - 1, keyMax, i);
// printf("/*%d*/ %f,\r\n", i, newKeyBin[i]);
// }
// printf("};\r\n");
//
// printf("static float ad_rpm_table[AD_RPM_COUNT] = {");
// for (int i = 0; i < newRpmSize; i++) {
// newRpmBin[i] = interpolate(0, rpmMin, newRpmSize - 1, rpmMax, i);
// printf("/*%d*/ %f,\r\n", i, newRpmBin[i]);
// }
// printf("};\r\n");
printf("static float ad_table[AD_RPM_COUNT][AD_LOAD_COUNT] = {\r\n");
printf("/* RPM\t\t");
for (int r = 0; r < newRpmSize; r++) {
float rpm = newRpmBin[r];
printf("\t%f", rpm);
}
printf("*/\r\n");
for (int k = 0; k < newKeySize; k++) {
float load = newKeyBin[k];
printf("/* Load %f */{", load);
for (int r = 0; r < newRpmSize; r++) {
float rpm = newRpmBin[r];
float v = ad_table[k][r];
printf("\t%f", v);
if (r != newRpmSize - 1)
printf(",");
}
printf("}");
if (k != newKeySize - 1)
printf(",");
printf("\r\n");
}
printf("};\r\n");
}
#endif
/**
* @file map_resize.c
*
* @date Jan 12, 2014
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#include <stdio.h>
#include "fuel_math.h"
#include "interpolation.h"
#include "engines.h"
#include "engine_configuration.h"
#include "main.h"
#include "idle_controller.h"
#if 1
#define AD_LOAD_COUNT 16
#define AD_RPM_COUNT 16
static float ad_rpm_table[] = {/*0*/ 800.000000,
/*1*/ 1213.333374,
/*2*/ 1626.666748,
/*3*/ 2040.000000,
/*4*/ 2453.333496,
/*5*/ 2866.666748,
/*6*/ 3280.000000,
/*7*/ 3693.333496,
/*8*/ 4106.666992,
/*9*/ 4520.000000,
/*10*/ 4933.333496,
/*11*/ 5346.666992,
/*12*/ 5760.000000,
/*13*/ 6173.333496,
/*14*/ 6586.666992,
/*15*/ 7000.000000,
};;
static float ad_maf_table[] =
{/*0*/ 1.200000,
/*1*/ 1.413333,
/*2*/ 1.626667,
/*3*/ 1.840000,
/*4*/ 2.053333,
/*5*/ 2.266667,
/*6*/ 2.480000,
/*7*/ 2.693333,
/*8*/ 2.906667,
/*9*/ 3.120000,
/*10*/ 3.333333,
/*11*/ 3.546667,
/*12*/ 3.760000,
/*13*/ 3.973333,
/*14*/ 4.186667,
/*15*/ 4.400000,
};
static float ad_table[AD_LOAD_COUNT][AD_RPM_COUNT] = {
/* RPM 800.000000 1213.333374 1626.666748 2040.000000 2453.333496 2866.666748 3280.000000 3693.333496 4106.666992 4520.000000 4933.333496 5346.666992 5760.000000 6173.333496 6586.666992 7000.000000*/
/* Load 1.200000 */{ 0.662000, -7.730000, -16.722000, -23.139999, -29.398001, -31.268000, -32.108002, -30.436001, -30.896000, -26.656000, -24.704000, -25.108000, -25.132000, -25.459999, -25.459999, -25.459999},
/* Load 1.413333 */{ 0.546000, -7.662000, -16.882000, -23.482000, -29.520000, -31.323999, -32.108002, -30.656000, -30.468000, -26.879999, -24.746000, -24.742001, -29.032000, -25.562000, -25.562000, -25.562000},
/* Load 1.626667 */{ 0.584000, -7.870000, -16.714001, -23.025999, -29.542000, -31.166000, -32.175999, -30.540001, -30.268000, -26.416000, -24.134001, -25.007999, -24.698000, -26.167999, -26.167999, -26.167999},
/* Load 1.840000 */{ 0.584000, -7.658000, -16.714001, -23.254000, -29.351999, -30.978001, -32.141998, -30.874001, -30.896000, -26.507999, -24.558001, -24.389999, -25.761999, -35.492001, -35.492001, -35.492001},
/* Load 2.053333 */{ 0.584000, -7.862000, -16.538000, -23.254000, -29.232000, -31.296000, -32.520000, -30.142000, -30.388000, -25.903999, -24.370001, -24.082001, -24.792000, -24.351999, -24.351999, -24.351999},
/* Load 2.266667 */{ -1.364000, -7.726000, -16.806000, -23.254000, -29.639999, -31.006001, -32.298000, -30.912001, -29.882000, -26.392000, -24.664000, -27.233999, -25.374001, -25.417999, -25.417999, -25.417999},
/* Load 2.480000 */{ 1.364000, -10.490000, -16.705999, -22.441999, -28.101999, -30.238001, -32.363998, -30.719999, -30.896000, -26.608000, -24.664000, -24.431999, -24.500000, -25.510000, -25.510000, -25.510000},
/* Load 2.693333 */{ 9.864000, -10.416000, -11.680000, -19.150000, -25.754000, -27.936001, -32.554001, -30.656000, -30.153999, -27.184000, -25.252001, -22.812000, -24.452000, -25.219999, -25.219999, -25.219999},
/* Load 2.906667 */{ 9.866000, 5.452000, 2.854000, -17.212000, -17.552000, -20.688000, -25.660000, -27.809999, -27.691999, -27.224001, -25.882000, -25.360001, -26.100000, -27.992001, -27.992001, -27.992001},
/* Load 3.120000 */{ 9.864000, 5.452000, 2.854000, -0.342000, -12.526000, -16.218000, -21.364000, -27.590000, -25.780001, -24.170000, -24.664000, -25.584000, -26.490000, -31.968000, -31.968000, -31.968000},
/* Load 3.333333 */{ 9.864000, 5.516000, 2.854000, -0.226000, -2.738000, -3.816000, -11.924000, -18.808001, -21.038000, -21.538000, -21.209999, -22.228001, -25.046000, -25.156000, -25.156000, -25.156000},
/* Load 3.546667 */{ 9.866000, 5.518000, 2.854000, 0.000000, -3.022000, -3.816000, -6.428000, -7.788000, -19.426001, -20.860001, -19.966000, -21.030001, -21.396000, -21.570000, -21.570000, -21.570000},
/* Load 3.760000 */{ 9.864000, 5.516000, 2.772000, -0.226000, -2.732000, -3.500000, -6.798000, -8.102000, -8.660000, -9.500000, -11.788000, -20.132000, -20.072001, -20.510000, -20.510000, -20.510000},
/* Load 3.973333 */{ 9.864000, 5.518000, 2.854000, 0.000000, -2.880000, -3.816000, -6.420000, -8.320000, -8.426000, -8.532000, -11.470000, -11.442000, -13.610000, -12.022000, -12.022000, -12.022000},
/* Load 4.186667 */{ 9.750000, 5.518000, 2.604000, 0.000000, -2.880000, -3.654000, -6.050000, -6.888000, -8.372000, -9.364000, -11.764000, -11.732000, -11.864000, -12.376000, -12.376000, -12.376000},
/* Load 4.400000 */{ 0.350000, 5.590000, 0.502000, 0.910000, 0.864000, 0.954000, 1.324000, -7.436000, 1.170000, 1.054000, 2.058000, 2.098000, 2.636000, -12.352000, -12.352000, -12.352000}
};
//float getBaseAdvance(int rpm, float key) {
// // todo: use interpolation
// int rpm_index = findIndex(ad_rpm_table, AD_RPM_COUNT, rpm);
// rpm_index = max(rpm_index, 0);
// int maf_index = findIndex(ad_maf_table, AD_LOAD_COUNT, key);
// maf_index = max(maf_index, 0);
//
// return ad_table[rpm_index][maf_index];
//}
#define newRpmSize 16
#define newKeySize 16
static float newRpmBin[newRpmSize];
static float newKeyBin[newKeySize];
//static float *fuel_ptrs[FUEL_LOAD_COUNT];
//EngineConfiguration *engineConfiguration;
extern int needInterpolationLogging;
void resizeMap(void) {
// float keyMin = 1.2;
// float keyMax = 4.4;
//
// float rpmMin = 800;
// float rpmMax = 7000;
// for (int k = 0; k < FUEL_LOAD_COUNT; k++)
// fuel_ptrs[k] = engineConfiguration->fuelTable[k];
// for (int i = 0; i < FUEL_MAF_COUNT; i++)
// engineConfiguration->fuelKeyBins[i] = default_fuel_maf_bins[i];
// for (int i = 0; i < FUEL_RPM_COUNT; i++)
// engineConfiguration->fuelRpmBins[i] = default_fuel_rpm_bins[i];
// for (int k = 0; k < FUEL_MAF_COUNT; k++) {
// for (int r = 0; r < FUEL_RPM_COUNT; r++) {
// // todo: this is BAD, this needs to be fixed - TS table indexes are different from default indexes
// engineConfiguration->fuelTable[k][r] = default_fuel_table[r][k];
// }
// }
// assertEquals(15, interpolate3d(1.2, engineConfiguration->fuelKeyBins, FUEL_MAF_COUNT, 8000,
// engineConfiguration->fuelRpmBins,
// FUEL_RPM_COUNT, fuel_ptrs));
needInterpolationLogging = 0;
// printf("static float ad_maf_table[AD_LOAD_COUNT] = {");
// for (int i = 0; i < newKeySize; i++) {
// newKeyBin[i] = interpolate(0, keyMin, newKeySize - 1, keyMax, i);
// printf("/*%d*/ %f,\r\n", i, newKeyBin[i]);
// }
// printf("};\r\n");
//
// printf("static float ad_rpm_table[AD_RPM_COUNT] = {");
// for (int i = 0; i < newRpmSize; i++) {
// newRpmBin[i] = interpolate(0, rpmMin, newRpmSize - 1, rpmMax, i);
// printf("/*%d*/ %f,\r\n", i, newRpmBin[i]);
// }
// printf("};\r\n");
printf("static float ad_table[AD_RPM_COUNT][AD_LOAD_COUNT] = {\r\n");
printf("/* RPM\t\t");
for (int r = 0; r < newRpmSize; r++) {
float rpm = newRpmBin[r];
printf("\t%f", rpm);
}
printf("*/\r\n");
for (int k = 0; k < newKeySize; k++) {
float load = newKeyBin[k];
printf("/* Load %f */{", load);
for (int r = 0; r < newRpmSize; r++) {
float rpm = newRpmBin[r];
float v = ad_table[k][r];
printf("\t%f", v);
if (r != newRpmSize - 1)
printf(",");
}
printf("}");
if (k != newKeySize - 1)
printf(",");
printf("\r\n");
}
printf("};\r\n");
}
#endif

View File

@ -1,13 +1,13 @@
/**
* @file map_resize.h
*
* @date Jan 12, 2014
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef MAP_RESIZE_H_
#define MAP_RESIZE_H_
void resizeMap(void);
#endif /* MAP_RESIZE_H_ */
/**
* @file map_resize.h
*
* @date Jan 12, 2014
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef MAP_RESIZE_H_
#define MAP_RESIZE_H_
void resizeMap(void);
#endif /* MAP_RESIZE_H_ */

View File

@ -1,6 +1,6 @@
In this folder we have a naive test set. I am not sure what is the best approach to tests in C (someone can educate me), but my approach is:
1) with a symlink linking some (only some, not all) folders of the firmware implementation, we can compile some files of the firmware as win32 code.
Please execute the 'makelinks.bat' file to get the links. On XP you might need to execute 'junction.exe' before exuting the .bat file.
In this folder we have a naive test set. I am not sure what is the best approach to tests in C (someone can educate me), but my approach is:
1) with a symlink linking some (only some, not all) folders of the firmware implementation, we can compile some files of the firmware as win32 code.
Please execute the 'makelinks.bat' file to get the links. On XP you might need to execute 'junction.exe' before exuting the .bat file.
2) we then compile & run the .exe, which is expected to say SUCCESS and not fail :)

View File

@ -1,168 +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 ***
# 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

@ -1,13 +1,13 @@
/**
* @file settings.h
*
* @date Feb 13, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef SETTINGS_H_
#define SETTINGS_H_
#endif /* SETTINGS_H_ */
/**
* @file settings.h
*
* @date Feb 13, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef SETTINGS_H_
#define SETTINGS_H_
#endif /* SETTINGS_H_ */

View File

@ -1,14 +1,15 @@
TEST_SRC_C = boards.c \
test_data_structures/test_engine_math.c \
test_event_registry.c \
test_basic_math/test_find_index.c \
test_basic_math/test_interpolation_3d.c \
test_fuel_map.c \
test_idle_controller.c \
test_trigger_decoder.c \
test_sensors.c \
test_signal_executor.c
TEST_SRC_CPP = test_util.cpp
TEST_SRC_C = boards.c \
test_data_structures/test_engine_math.c \
test_basic_math/test_find_index.c \
test_basic_math/test_interpolation_3d.c \
test_idle_controller.c \
test_sensors.c
TEST_SRC_CPP = test_util.cpp \
test_data_structures/test_event_registry.cpp \
test_trigger_decoder.cpp \
test_fuel_map.cpp \
test_signal_executor.cpp

View File

@ -1,120 +1,120 @@
/*
* test_find_index.c
*
* Created on: Oct 30, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
#include "engine_math.h"
#include "main.h"
#include "interpolation.h"
#include <stdio.h>
#include "engine_configuration.h"
void testFindIndex(void) {
printf("*************************************************** testFindIndex\r\n");
float array[] = { 1, 2, 3, 4, 5 };
int size = 4;
int result;
printf("To the left\r\n");
result = findIndex(array, size, -1.0);
assertEquals(-1, result);
printf("To the right4\r\n");
result = findIndex(array, size, 10.0);
assertEquals(3, result);
printf("To the right5\r\n");
result = findIndex(array, 5, 10.0);
assertEquals(4, result);
printf("On the edge\r\n");
result = findIndex(array, size, 4.0);
assertEquals(3, result);
printf("Another1\r\n");
result = findIndex(array, size, 3.9);
assertEquals(2, result);
printf("Another2\r\n");
result = findIndex(array, size, 4.1);
assertEquals(3, result);
printf("Another3\r\n");
result = findIndex(array, size, 2);
assertEquals(1, result);
printf("Left edge1\r\n");
result = findIndex(array, size, 1);
assertEquals(0, result);
printf("Left edge2\r\n");
result = findIndex(array, size, 1.1);
assertEquals(0, result);
printf("Middle\r\n");
result = findIndex(array, size, 3);
assertEquals(2, result);
size = 5; // now test with off array size
printf("Middle2\r\n");
result = findIndex(array, size, 4);
assertEquals(3, result);
printf("Middle2\r\n");
result = findIndex(array, size, 3.1);
assertEquals(2, result);
}
//static float getValue2(float key, float maf) {
//
//}
void testInterpolate2d(void) {
printf("*************************************************** testInterpolate2d\r\n");
float bins4[] = { 1, 2, 3, 4 };
float values4[] = { 1, 20, 30, 400 };
int size = 4;
int result;
printf("Left size\r\n");
result = interpolate2d(0, bins4, values4, size);
assertEquals(1, result);
printf("Right size\r\n");
result = interpolate2d(10, bins4, values4, size);
assertEquals(400, result);
printf("Middle1\r\n");
result = interpolate2d(3, bins4, values4, size);
assertEquals(30, result);
printf("Middle1\r\n");
result = interpolate2d(3.5, bins4, values4, size);
assertEquals(215, result);
}
static engine_configuration_s engineConfiguration;
void testSetTableValue(void) {
printf("*************************************************** testSetTableValue\r\n");
for (int i = 0; i < CLT_CURVE_SIZE; i++) {
engineConfiguration.cltFuelCorrBins[i] = -40 + i * 10;
engineConfiguration.cltFuelCorr[i] = 1;
}
assertEquals(1, engineConfiguration.cltFuelCorr[0]);
setTableValue(engineConfiguration.cltFuelCorrBins, engineConfiguration.cltFuelCorr, CLT_CURVE_SIZE, -40, 1.5);
assertEquals(1.5, engineConfiguration.cltFuelCorr[0]);
setTableValue(engineConfiguration.cltFuelCorrBins, engineConfiguration.cltFuelCorr, CLT_CURVE_SIZE, -50, 1.4);
assertEquals(1.4, engineConfiguration.cltFuelCorr[0]);
}
/*
* test_find_index.c
*
* Created on: Oct 30, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
#include "engine_math.h"
#include "main.h"
#include "interpolation.h"
#include <stdio.h>
#include "engine_configuration.h"
void testFindIndex(void) {
printf("*************************************************** testFindIndex\r\n");
float array[] = { 1, 2, 3, 4, 5 };
int size = 4;
int result;
printf("To the left\r\n");
result = findIndex(array, size, -1.0);
assertEquals(-1, result);
printf("To the right4\r\n");
result = findIndex(array, size, 10.0);
assertEquals(3, result);
printf("To the right5\r\n");
result = findIndex(array, 5, 10.0);
assertEquals(4, result);
printf("On the edge\r\n");
result = findIndex(array, size, 4.0);
assertEquals(3, result);
printf("Another1\r\n");
result = findIndex(array, size, 3.9);
assertEquals(2, result);
printf("Another2\r\n");
result = findIndex(array, size, 4.1);
assertEquals(3, result);
printf("Another3\r\n");
result = findIndex(array, size, 2);
assertEquals(1, result);
printf("Left edge1\r\n");
result = findIndex(array, size, 1);
assertEquals(0, result);
printf("Left edge2\r\n");
result = findIndex(array, size, 1.1);
assertEquals(0, result);
printf("Middle\r\n");
result = findIndex(array, size, 3);
assertEquals(2, result);
size = 5; // now test with off array size
printf("Middle2\r\n");
result = findIndex(array, size, 4);
assertEquals(3, result);
printf("Middle2\r\n");
result = findIndex(array, size, 3.1);
assertEquals(2, result);
}
//static float getValue2(float key, float maf) {
//
//}
void testInterpolate2d(void) {
printf("*************************************************** testInterpolate2d\r\n");
float bins4[] = { 1, 2, 3, 4 };
float values4[] = { 1, 20, 30, 400 };
int size = 4;
int result;
printf("Left size\r\n");
result = interpolate2d(0, bins4, values4, size);
assertEquals(1, result);
printf("Right size\r\n");
result = interpolate2d(10, bins4, values4, size);
assertEquals(400, result);
printf("Middle1\r\n");
result = interpolate2d(3, bins4, values4, size);
assertEquals(30, result);
printf("Middle1\r\n");
result = interpolate2d(3.5, bins4, values4, size);
assertEquals(215, result);
}
static engine_configuration_s engineConfiguration;
void testSetTableValue(void) {
printf("*************************************************** testSetTableValue\r\n");
for (int i = 0; i < CLT_CURVE_SIZE; i++) {
engineConfiguration.cltFuelCorrBins[i] = -40 + i * 10;
engineConfiguration.cltFuelCorr[i] = 1;
}
assertEquals(1, engineConfiguration.cltFuelCorr[0]);
setTableValue(engineConfiguration.cltFuelCorrBins, engineConfiguration.cltFuelCorr, CLT_CURVE_SIZE, -40, 1.5);
assertEquals(1.5, engineConfiguration.cltFuelCorr[0]);
setTableValue(engineConfiguration.cltFuelCorrBins, engineConfiguration.cltFuelCorr, CLT_CURVE_SIZE, -50, 1.4);
assertEquals(1.4, engineConfiguration.cltFuelCorr[0]);
}

View File

@ -1,15 +1,15 @@
/*
* test_find_index.h
*
* Created on: Oct 30, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef TEST_FIND_INDEX_H_
#define TEST_FIND_INDEX_H_
void testFindIndex(void);
void testInterpolate2d(void);
void testSetTableValue(void);
#endif /* TEST_FIND_INDEX_H_ */
/*
* test_find_index.h
*
* Created on: Oct 30, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef TEST_FIND_INDEX_H_
#define TEST_FIND_INDEX_H_
void testFindIndex(void);
void testInterpolate2d(void);
void testSetTableValue(void);
#endif /* TEST_FIND_INDEX_H_ */

View File

@ -1,70 +1,70 @@
/*
* Created on: Oct 17, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
/**
* @file test_interpolation_3d.c
*/
#include "test_interpolation_3d.h"
#include <stdio.h>
#include <stdlib.h>
#include "interpolation.h"
#include "main.h"
float rpmBins[5] = { 100, 200, 300, 400, 500 };
float mafBins[4] = { 1, 2, 3, 4 };
float map0[4] = { 1, 2, 3, 4 };
float map1[4] = { 2, 3, 4, 5 };
float map2[4] = { 3, 4, 200, 300 };
float map3[4] = { 4, 200, 500, 600 };
float map4[4] = { 4, 200, 500, 600 };
float *map[5] = { map0, map1, map2, map3, map4 };
static float getValue(float rpm, float maf) {
return interpolate3d(rpm, rpmBins, 5, maf, mafBins, 4, map);
}
void testInterpolate3d(void) {
printf("*************************************************** testInterpolate3d\r\n");
float dwell;
printf("*** no interpolation here 1\r\n");
dwell = getValue(100, 2);
assertEquals(2, dwell);
printf("*** no interpolation here 2\r\n");
dwell = getValue(200, 4);
assertEquals(5, dwell);
printf("*** rpm interpolated value expected1\r\n");
dwell = getValue(150, 2);
assertEquals(2.5, dwell);
printf("*** rpm interpolated value expected2\r\n");
dwell = getValue(250, 3);
assertEquals(102, dwell);
printf("*** both rpm and maf interpolated value expected\r\n");
dwell = getValue(335.3, 3.551);
assertEquals(361, dwell);
printf("*** both rpm and maf interpolated value expected 2\r\n");
dwell = getValue(410.01, 2.012);
assertEquals(203.6, dwell);
printf("*** both rpm and maf interpolated value expected 3\r\n");
dwell = getValue(1000000, 1000);
assertEquals(600, dwell);
printf("*** both rpm and maf interpolated value expected 4\r\n");
dwell = getValue(410.01, -1);
assertEquals(4, dwell);
dwell = getValue(-1, -1);
assertEquals(1, dwell);
}
/*
* Created on: Oct 17, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
/**
* @file test_interpolation_3d.c
*/
#include "test_interpolation_3d.h"
#include <stdio.h>
#include <stdlib.h>
#include "interpolation.h"
#include "main.h"
float rpmBins[5] = { 100, 200, 300, 400, 500 };
float mafBins[4] = { 1, 2, 3, 4 };
float map0[4] = { 1, 2, 3, 4 };
float map1[4] = { 2, 3, 4, 5 };
float map2[4] = { 3, 4, 200, 300 };
float map3[4] = { 4, 200, 500, 600 };
float map4[4] = { 4, 200, 500, 600 };
float *map[5] = { map0, map1, map2, map3, map4 };
static float getValue(float rpm, float maf) {
return interpolate3d(rpm, rpmBins, 5, maf, mafBins, 4, map);
}
void testInterpolate3d(void) {
printf("*************************************************** testInterpolate3d\r\n");
float dwell;
printf("*** no interpolation here 1\r\n");
dwell = getValue(100, 2);
assertEquals(2, dwell);
printf("*** no interpolation here 2\r\n");
dwell = getValue(200, 4);
assertEquals(5, dwell);
printf("*** rpm interpolated value expected1\r\n");
dwell = getValue(150, 2);
assertEquals(2.5, dwell);
printf("*** rpm interpolated value expected2\r\n");
dwell = getValue(250, 3);
assertEquals(102, dwell);
printf("*** both rpm and maf interpolated value expected\r\n");
dwell = getValue(335.3, 3.551);
assertEquals(361, dwell);
printf("*** both rpm and maf interpolated value expected 2\r\n");
dwell = getValue(410.01, 2.012);
assertEquals(203.6, dwell);
printf("*** both rpm and maf interpolated value expected 3\r\n");
dwell = getValue(1000000, 1000);
assertEquals(600, dwell);
printf("*** both rpm and maf interpolated value expected 4\r\n");
dwell = getValue(410.01, -1);
assertEquals(4, dwell);
dwell = getValue(-1, -1);
assertEquals(1, dwell);
}

View File

@ -1,16 +1,16 @@
/*
* Created on: Oct 17, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
/**
* @file test_interpolation_3d.h
*/
#ifndef TEST_INTERPOLATION_3D_H_
#define TEST_INTERPOLATION_3D_H_
void testInterpolate3d(void);
#endif /* TEST_INTERPOLATION_3D_H_ */
/*
* Created on: Oct 17, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
/**
* @file test_interpolation_3d.h
*/
#ifndef TEST_INTERPOLATION_3D_H_
#define TEST_INTERPOLATION_3D_H_
void testInterpolate3d(void);
#endif /* TEST_INTERPOLATION_3D_H_ */

View File

@ -1,13 +1,22 @@
/*
* test_event_registry.h
*
* Created on: Nov 27, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef TEST_EVENT_REGISTRY_H_
#define TEST_EVENT_REGISTRY_H_
void testEventRegistry(void);
#endif /* TEST_EVENT_REGISTRY_H_ */
/*
* test_event_registry.h
*
* Created on: Nov 27, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef TEST_EVENT_REGISTRY_H_
#define TEST_EVENT_REGISTRY_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void testEventRegistry(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* TEST_EVENT_REGISTRY_H_ */

View File

@ -1,27 +1,27 @@
/*
* @file test_engine_math.c
*
* Created on: Nov 14, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
#include "test_engine_math.h"
#include "main.h"
#include "engine_math.h"
#include "engine_configuration.h"
extern engine_configuration_s *engineConfiguration;
extern engine_configuration2_s *engineConfiguration2;
void testEngineMath(void) {
printf("*************************************************** testEngineMath\r\n");
engineConfiguration->rpmMultiplier = 0.5;
assertEqualsM("600 RPM", 5000, getOneDegreeTime(600) * 180);
assertEqualsM("6000 RPM", 500, getOneDegreeTime(6000) * 180);
}
float getMap(void) {
return 0;
}
/*
* @file test_engine_math.c
*
* Created on: Nov 14, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
#include "test_engine_math.h"
#include "main.h"
#include "engine_math.h"
#include "engine_configuration.h"
extern engine_configuration_s *engineConfiguration;
extern engine_configuration2_s *engineConfiguration2;
void testEngineMath(void) {
printf("*************************************************** testEngineMath\r\n");
engineConfiguration->rpmMultiplier = 0.5;
assertEqualsM("600 RPM", 5000, getOneDegreeTime(600) * 180);
assertEqualsM("6000 RPM", 500, getOneDegreeTime(6000) * 180);
}
float getMap(void) {
return 0;
}

View File

@ -1,13 +1,13 @@
/*
* @file test_engine_math.h
*
* Created on: Nov 14, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef TEST_ENGINE_MATH_H_
#define TEST_ENGINE_MATH_H_
void testEngineMath(void);
#endif /* TEST_ENGINE_MATH_H_ */
/*
* @file test_engine_math.h
*
* Created on: Nov 14, 2013
* Author: Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef TEST_ENGINE_MATH_H_
#define TEST_ENGINE_MATH_H_
void testEngineMath(void);
#endif /* TEST_ENGINE_MATH_H_ */

View File

@ -1,15 +1,24 @@
/*
* test_fuel_map.h
*
* Created on: Nov 6, 2013
* Author: pc
*/
#ifndef TEST_FUEL_MAP_H_
#define TEST_FUEL_MAP_H_
void testFuelMap(void);
void testAngleResolver(void);
void testPinHelper(void);
#endif /* TEST_FUEL_MAP_H_ */
/*
* test_fuel_map.h
*
* Created on: Nov 6, 2013
* Author: pc
*/
#ifndef TEST_FUEL_MAP_H_
#define TEST_FUEL_MAP_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void testFuelMap(void);
void testAngleResolver(void);
void testPinHelper(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* TEST_FUEL_MAP_H_ */

View File

@ -1,17 +1,17 @@
/*
* test_idle_controller.c
*
* Created on: Oct 17, 2013
* Author: Andrey
*/
#include <stdio.h>
void idleDebug(char *msg, int value) {
printf("%s\r\n", msg);
}
void isCranking(void) {
return;
}
/*
* test_idle_controller.c
*
* Created on: Oct 17, 2013
* Author: Andrey
*/
#include <stdio.h>
void idleDebug(char *msg, int value) {
printf("%s\r\n", msg);
}
void isCranking(void) {
return;
}

View File

@ -1,7 +1,7 @@
#ifndef TEST_IDLE_CONTROLLER_H
#define TEST_IDLE_CONTROLLER_H
void idleDebug(char *msg, int value);
void isCranking(void);
#endif
#ifndef TEST_IDLE_CONTROLLER_H
#define TEST_IDLE_CONTROLLER_H
void idleDebug(char *msg, int value);
void isCranking(void);
#endif

View File

@ -1,35 +1,52 @@
/**
* @file test_sensors.c
*
* @date Dec 7, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#include "main.h"
#include "thermistors.h"
#include "map.h"
static ThermistorConf tc;
static void testMapDecoding() {
assertEqualsM("denso 0 volts", -6.64, getMAPValueHonda_Denso183(0));
assertEquals(31.244, getMAPValueHonda_Denso183(1));
assertEqualsM("MPX_4250 0 volts", 8, getMAPValueMPX_4250(0));
assertEquals(58.4, getMAPValueMPX_4250(1));
}
void testSensors(void) {
print("************************************************** testSensors\r\n");
testMapDecoding();
setThermistorConfiguration(&tc, 32, 9500, 75, 2100, 120, 1000);
prepareThermistorCurve(&tc);
assertEquals(-0.003, tc.s_h_a);
assertEquals(0.001, tc.s_h_b);
assertEquals(0.0, tc.s_h_c);
float t = convertResistanceToKelvinTemperature(2100, &tc);
assertEquals(75 + KELV, t);
}
/**
* @file test_sensors.c
*
* @date Dec 7, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#include "main.h"
#include "thermistors.h"
#include "allsensors.h"
static ThermistorConf tc;
static void testMapDecoding(void) {
assertEqualsM("denso 0 volts", -6.64, getMAPValueHonda_Denso183(0));
assertEquals(31.244, getMAPValueHonda_Denso183(1));
assertEqualsM("MPX_4250 0 volts", 8, getMAPValueMPX_4250(0));
assertEquals(58.4, getMAPValueMPX_4250(1));
}
void testTpsRateOfChange(void) {
print("************************************************** testTpsRateOfChange\r\n");
saveTpsState(0, 0);
saveTpsState(CH_FREQUENCY, 50);
assertEquals(50, getTpsRateOfChange());
saveTpsState(2 * CH_FREQUENCY, 50);
assertEquals(0, getTpsRateOfChange());
saveTpsState(3 * CH_FREQUENCY, 75);
assertEquals(25, getTpsRateOfChange());
}
void testSensors(void) {
print("************************************************** testSensors\r\n");
testMapDecoding();
testTpsRateOfChange();
setThermistorConfiguration(&tc, 32, 9500, 75, 2100, 120, 1000);
prepareThermistorCurve(&tc);
assertEquals(-0.003, tc.s_h_a);
assertEquals(0.001, tc.s_h_b);
assertEquals(0.0, tc.s_h_c);
float t = convertResistanceToKelvinTemperature(2100, &tc);
assertEquals(75 + KELV, t);
}

View File

@ -1,13 +1,13 @@
/**
* @file test_sensors.h
*
* @date Dec 7, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef TEST_SENSORS_H_
#define TEST_SENSORS_H_
void testSensors(void);
#endif /* TEST_SENSORS_H_ */
/**
* @file test_sensors.h
*
* @date Dec 7, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef TEST_SENSORS_H_
#define TEST_SENSORS_H_
void testSensors(void);
#endif /* TEST_SENSORS_H_ */

View File

@ -1,13 +1,23 @@
/**
* @file test_signal_executor.h
*
* @date Nov 28, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef TEST_SIGNAL_EXECUTOR_H_
#define TEST_SIGNAL_EXECUTOR_H_
void testSignalExecutor(void);
#endif /* TEST_SIGNAL_EXECUTOR_H_ */
/**
* @file test_signal_executor.h
*
* @date Nov 28, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef TEST_SIGNAL_EXECUTOR_H_
#define TEST_SIGNAL_EXECUTOR_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void testSignalExecutor(void);
int getRevolutionCounter(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* TEST_SIGNAL_EXECUTOR_H_ */

View File

@ -1,13 +1,13 @@
/**
* @file test_trigger_decoder.h
*
* @date Dec 24, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef TEST_TRIGGER_DECODER_H_
#define TEST_TRIGGER_DECODER_H_
void testTriggerDecoder(void);
#endif /* TEST_TRIGGER_DECODER_H_ */
/**
* @file test_trigger_decoder.h
*
* @date Dec 24, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef TEST_TRIGGER_DECODER_H_
#define TEST_TRIGGER_DECODER_H_
void testTriggerDecoder(void);
#endif /* TEST_TRIGGER_DECODER_H_ */

View File

@ -1,278 +1,294 @@
/**
* @file test_util.c
*
* @date Dec 8, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#include <string.h>
#include "test_util.h"
#include "cyclic_buffer.h"
#include "main.h"
#include "histogram.h"
#include "malfunction_central.h"
#include "eficonsole_logic.h"
#include "nmea.h"
static cyclic_buffer sb;
void testCyclicBuffer(void) {
print("*************************************** testCyclicBuffer\r\n");
sb.add(10);
assertEquals(10, sb.sum(3));
sb.add(2);
assertEquals(12, sb.sum(2));
}
void testHistogram(void) {
print("******************************************* testHistogram\r\n");
initHistogramsModule();
assertEquals(80, histogramGetIndex(239));
assertEquals(223, histogramGetIndex(239239));
assertEquals(364, histogramGetIndex(239239239));
histogram_s h;
initHistogram(&h, "test");
int result[5];
assertEquals(0, hsReport(&h, result));
hsAdd(&h, 10);
assertEquals(1, hsReport(&h, result));
assertEquals(10, result[0]);
// let's add same value one more time
hsAdd(&h, 10);
assertEquals(2, hsReport(&h, result));
assertEquals(10, result[0]);
assertEquals(10, result[1]);
hsAdd(&h, 10);
hsAdd(&h, 10);
hsAdd(&h, 10);
hsAdd(&h, 1000);
hsAdd(&h, 100);
assertEquals(5, hsReport(&h, result));
assertEquals(5, result[0]);
assertEquals(10, result[1]);
assertEquals(10, result[2]);
assertEquals(100, result[3]);
// values are not expected to be exactly the same, it's the shape what matters
assertEquals(1011, result[4]);
}
static void testMalfunctionCentralRemoveNonExistent() {
print("******************************************* testMalfunctionCentralRemoveNonExistent\r\n");
initMalfunctionCentral();
// this should not crash
removeError(OBD_Engine_Coolant_Temperature_Circuit_Malfunction);
}
static void testMalfunctionCentralSameElementAgain() {
initMalfunctionCentral();
print("******************************************* testMalfunctionCentralSameElementAgain\r\n");
error_codes_set_s localCopy;
addError(OBD_Engine_Coolant_Temperature_Circuit_Malfunction);
addError(OBD_Engine_Coolant_Temperature_Circuit_Malfunction);
getErrorCodes(&localCopy);
assertEquals(1, localCopy.count);
}
static void testMalfunctionCentralRemoveFirstElement() {
initMalfunctionCentral();
print("******************************************* testMalfunctionCentralRemoveFirstElement\r\n");
error_codes_set_s localCopy;
obd_code_e firstElement = OBD_Engine_Coolant_Temperature_Circuit_Malfunction;
addError(firstElement);
obd_code_e secondElement = OBD_Intake_Air_Temperature_Circuit_Malfunction;
addError(secondElement);
getErrorCodes(&localCopy);
assertEquals(2, localCopy.count);
// let's remove first element - code
removeError(firstElement);
getErrorCodes(&localCopy);
assertEquals(1, localCopy.count);
assertEquals(secondElement, localCopy.error_codes[0]);
}
void testMalfunctionCentral(void) {
testMalfunctionCentralRemoveNonExistent();
testMalfunctionCentralSameElementAgain();
testMalfunctionCentralRemoveFirstElement();
print("******************************************* testMalfunctionCentral\r\n");
initMalfunctionCentral();
error_codes_set_s localCopy;
// on start-up error storage should be empty
getErrorCodes(&localCopy);
assertEquals(0, localCopy.count);
obd_code_e code = OBD_Engine_Coolant_Temperature_Circuit_Malfunction;
// let's add one error and validate
addError(code);
getErrorCodes(&localCopy);
assertEqualsM("count #1", 1, localCopy.count);
assertEquals(code, localCopy.error_codes[0]);
// let's remove value which is not in the collection
removeError((obd_code_e)22);
// element not present - nothing to removed
assertEquals(1, localCopy.count);
assertEquals(code, localCopy.error_codes[0]);
code = OBD_Intake_Air_Temperature_Circuit_Malfunction;
addError(code);
getErrorCodes(&localCopy);
// todo: assertEquals(2, localCopy.count);
for (int code = 0; code < 100; code++) {
addError((obd_code_e) code);
}
getErrorCodes(&localCopy);
assertEquals(MAX_ERROR_CODES_COUNT, localCopy.count);
// now we have full array and code below present
removeError(code);
getErrorCodes(&localCopy);
assertEquals(MAX_ERROR_CODES_COUNT - 1, localCopy.count);
}
static int lastInteger = -1;
static int lastInteger2 = -1;
static void testEchoI(int param) {
lastInteger = param;
}
static void testEchoII(int param, int param2) {
lastInteger = param;
lastInteger2 = param2;
}
static char *lastFirst = NULL;
static char *lastThird = NULL;
static void testEchoSSS(char *first, char *second, char *third) {
lastFirst = first;
lastThird = third;
}
#define UNKNOWN_COMMAND "dfadasdasd"
static loc_t GPSdata;
static char nmeaMessage[1000];
void testGpsParser(void) {
print("******************************************* testGpsParser\r\n");
strcpy(nmeaMessage, "");
gps_location(&GPSdata, nmeaMessage);
// we need to pass a mutable string, not a constant because the parser would be modifying the string
strcpy(nmeaMessage, "$GPRMC,173843,A,3349.896,N,11808.521,W,000.0,360.0,230108,013.4,E*69");
gps_location(&GPSdata, nmeaMessage);
assertEqualsM("1 valid", 4, GPSdata.quality);
assertEqualsM("1 latitude", 3349.896, GPSdata.latitude);
assertEqualsM("1 longitude", 11808.521, GPSdata.longitude);
assertEqualsM("1 speed", 0, GPSdata.speed);
// assertEqualsM("1 altitude", 0, GPSdata.altitude); // GPRMC not overwrite altitude
assertEqualsM("1 course", 360, GPSdata.course);
strcpy(nmeaMessage, "$GPGGA,111609.14,5001.27,N,3613.06,E,3,08,0.0,10.2,M,0.0,M,0.0,0000*70");
gps_location(&GPSdata, nmeaMessage);
assertEqualsM("2 valid", 3, GPSdata.quality); // see field details
assertEqualsM("2 latitude", 50.0212, GPSdata.latitude);
assertEqualsM("2 longitude", 36.2177, GPSdata.longitude);
assertEqualsM("2 speed", 0, GPSdata.speed);
assertEqualsM("2 altitude", 10.2, GPSdata.altitude);
// assertEqualsM("2 course", 0, GPSdata.course); // GPGGA not overwrite course
strcpy(nmeaMessage, "$GPRMC,111609.14,A,5001.27,N,3613.06,E,11.2,0.0,261206,0.0,E*50");
gps_location(&GPSdata, nmeaMessage);
assertEqualsM("3 valid", 4, GPSdata.quality);
assertEqualsM("3 latitude", 5001.27, GPSdata.latitude);
assertEqualsM("3 longitude", 3613.06, GPSdata.longitude);
assertEqualsM("3 speed", 11.2, GPSdata.speed);
// assertEqualsM("3 altitude", 0, GPSdata.altitude); // GPRMC not overwrite altitude
assertEqualsM("3 course", 0, GPSdata.course);
assertEqualsM("3 GPS yy",2006, GPSdata.GPStm.tm_year+1900);
assertEqualsM("3 GPS mm",12, GPSdata.GPStm.tm_mon);
assertEqualsM("3 GPS yy",26, GPSdata.GPStm.tm_mday);
assertEqualsM("3 GPS hh",11, GPSdata.GPStm.tm_hour);
assertEqualsM("3 GPS mm",16, GPSdata.GPStm.tm_min);
assertEqualsM("3 GPS ss",9, GPSdata.GPStm.tm_sec);
// check again first one
// we need to pass a mutable string, not a constant because the parser would be modifying the string
strcpy(nmeaMessage, "$GPRMC,173843,A,3349.896,N,11808.521,W,000.0,360.0,230108,013.4,E*69");
gps_location(&GPSdata, nmeaMessage);
assertEqualsM("4 valid", 4, GPSdata.quality);
assertEqualsM("4 latitude", 3349.896, GPSdata.latitude);
assertEqualsM("4 longitude", 11808.521, GPSdata.longitude);
assertEqualsM("4 speed", 0, GPSdata.speed);
assertEqualsM("4 course", 360, GPSdata.course);
}
// this buffer is needed because on Unix you would not be able to change static char constants
static char buffer[300];
void testConsoleLogic(void) {
print("******************************************* testConsoleLogic\r\n");
resetConsoleActions();
helpCommand();
char *ptr = validateSecureLine(UNKNOWN_COMMAND);
assertEquals(0, strcmp(UNKNOWN_COMMAND, ptr));
assertEquals(10, tokenLength(UNKNOWN_COMMAND));
// handling invalid token should work
strcpy(buffer, "sdasdafasd asd");
handleConsoleLine(buffer);
print("\r\naddConsoleActionI\r\n");
addConsoleActionI("echoi", testEchoI);
strcpy(buffer, "echoi 239");
handleConsoleLine(buffer);
assertEquals(239, lastInteger);
print("\r\naddConsoleActionII\r\n");
addConsoleActionII("echoii", testEchoII);
strcpy(buffer, "echoii 22 239");
handleConsoleLine(buffer);
assertEquals(22, lastInteger);
assertEquals(239, lastInteger2);
print("\r\addConsoleActionSSS\r\n");
addConsoleActionSSS("echosss", testEchoSSS);
strcpy(buffer, "echosss 111 222 333");
handleConsoleLine(buffer);
assertEquals(111, atoi(lastFirst));
assertEquals(333, atoi(lastThird));
//addConsoleActionSSS("GPS", testGpsParser);
}
/**
* @file test_util.c
*
* @date Dec 8, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#include <string.h>
#include "test_util.h"
#include "cyclic_buffer.h"
#include "main.h"
#include "histogram.h"
#include "malfunction_central.h"
#include "eficonsole_logic.h"
#include "nmea.h"
#include "efilib2.h"
static cyclic_buffer sb;
void testOverflow64Counter(void) {
print("*************************************** testOverflow64Counter\r\n");
Overflow64Counter o;
assertEquals(0, o.get());
o.offer(10);
assertEquals(10, o.get());
o.offer(20);
assertEquals(20, o.get());
o.offer(0); // overflow
assertEquals(4294967296, o.get());
}
void testCyclicBuffer(void) {
print("*************************************** testCyclicBuffer\r\n");
sb.add(10);
assertEquals(10, sb.sum(3));
sb.add(2);
assertEquals(12, sb.sum(2));
}
void testHistogram(void) {
print("******************************************* testHistogram\r\n");
initHistogramsModule();
assertEquals(80, histogramGetIndex(239));
assertEquals(223, histogramGetIndex(239239));
assertEquals(364, histogramGetIndex(239239239));
histogram_s h;
initHistogram(&h, "test");
int result[5];
assertEquals(0, hsReport(&h, result));
hsAdd(&h, 10);
assertEquals(1, hsReport(&h, result));
assertEquals(10, result[0]);
// let's add same value one more time
hsAdd(&h, 10);
assertEquals(2, hsReport(&h, result));
assertEquals(10, result[0]);
assertEquals(10, result[1]);
hsAdd(&h, 10);
hsAdd(&h, 10);
hsAdd(&h, 10);
hsAdd(&h, 1000);
hsAdd(&h, 100);
assertEquals(5, hsReport(&h, result));
assertEquals(5, result[0]);
assertEquals(10, result[1]);
assertEquals(10, result[2]);
assertEquals(100, result[3]);
// values are not expected to be exactly the same, it's the shape what matters
assertEquals(1011, result[4]);
}
static void testMalfunctionCentralRemoveNonExistent() {
print("******************************************* testMalfunctionCentralRemoveNonExistent\r\n");
initMalfunctionCentral();
// this should not crash
removeError(OBD_Engine_Coolant_Temperature_Circuit_Malfunction);
}
static void testMalfunctionCentralSameElementAgain() {
initMalfunctionCentral();
print("******************************************* testMalfunctionCentralSameElementAgain\r\n");
error_codes_set_s localCopy;
addError(OBD_Engine_Coolant_Temperature_Circuit_Malfunction);
addError(OBD_Engine_Coolant_Temperature_Circuit_Malfunction);
getErrorCodes(&localCopy);
assertEquals(1, localCopy.count);
}
static void testMalfunctionCentralRemoveFirstElement() {
initMalfunctionCentral();
print("******************************************* testMalfunctionCentralRemoveFirstElement\r\n");
error_codes_set_s localCopy;
obd_code_e firstElement = OBD_Engine_Coolant_Temperature_Circuit_Malfunction;
addError(firstElement);
obd_code_e secondElement = OBD_Intake_Air_Temperature_Circuit_Malfunction;
addError(secondElement);
getErrorCodes(&localCopy);
assertEquals(2, localCopy.count);
// let's remove first element - code
removeError(firstElement);
getErrorCodes(&localCopy);
assertEquals(1, localCopy.count);
assertEquals(secondElement, localCopy.error_codes[0]);
}
void testMalfunctionCentral(void) {
testMalfunctionCentralRemoveNonExistent();
testMalfunctionCentralSameElementAgain();
testMalfunctionCentralRemoveFirstElement();
print("******************************************* testMalfunctionCentral\r\n");
initMalfunctionCentral();
error_codes_set_s localCopy;
// on start-up error storage should be empty
getErrorCodes(&localCopy);
assertEquals(0, localCopy.count);
obd_code_e code = OBD_Engine_Coolant_Temperature_Circuit_Malfunction;
// let's add one error and validate
addError(code);
getErrorCodes(&localCopy);
assertEqualsM("count #1", 1, localCopy.count);
assertEquals(code, localCopy.error_codes[0]);
// let's remove value which is not in the collection
removeError((obd_code_e)22);
// element not present - nothing to removed
assertEquals(1, localCopy.count);
assertEquals(code, localCopy.error_codes[0]);
code = OBD_Intake_Air_Temperature_Circuit_Malfunction;
addError(code);
getErrorCodes(&localCopy);
// todo: assertEquals(2, localCopy.count);
for (int code = 0; code < 100; code++) {
addError((obd_code_e) code);
}
getErrorCodes(&localCopy);
assertEquals(MAX_ERROR_CODES_COUNT, localCopy.count);
// now we have full array and code below present
removeError(code);
getErrorCodes(&localCopy);
assertEquals(MAX_ERROR_CODES_COUNT - 1, localCopy.count);
}
static int lastInteger = -1;
static int lastInteger2 = -1;
static void testEchoI(int param) {
lastInteger = param;
}
static void testEchoII(int param, int param2) {
lastInteger = param;
lastInteger2 = param2;
}
static char *lastFirst = NULL;
static char *lastThird = NULL;
static void testEchoSSS(char *first, char *second, char *third) {
lastFirst = first;
lastThird = third;
}
#define UNKNOWN_COMMAND "dfadasdasd"
static loc_t GPSdata;
static char nmeaMessage[1000];
void testGpsParser(void) {
print("******************************************* testGpsParser\r\n");
strcpy(nmeaMessage, "");
gps_location(&GPSdata, nmeaMessage);
// we need to pass a mutable string, not a constant because the parser would be modifying the string
strcpy(nmeaMessage, "$GPRMC,173843,A,3349.896,N,11808.521,W,000.0,360.0,230108,013.4,E*69");
gps_location(&GPSdata, nmeaMessage);
assertEqualsM("1 valid", 4, GPSdata.quality);
assertEqualsM("1 latitude", 3349.896, GPSdata.latitude);
assertEqualsM("1 longitude", 11808.521, GPSdata.longitude);
assertEqualsM("1 speed", 0, GPSdata.speed);
// assertEqualsM("1 altitude", 0, GPSdata.altitude); // GPRMC not overwrite altitude
assertEqualsM("1 course", 360, GPSdata.course);
strcpy(nmeaMessage, "$GPGGA,111609.14,5001.27,N,3613.06,E,3,08,0.0,10.2,M,0.0,M,0.0,0000*70");
gps_location(&GPSdata, nmeaMessage);
assertEqualsM("2 valid", 3, GPSdata.quality); // see field details
assertEqualsM("2 latitude", 50.0212, GPSdata.latitude);
assertEqualsM("2 longitude", 36.2177, GPSdata.longitude);
assertEqualsM("2 speed", 0, GPSdata.speed);
assertEqualsM("2 altitude", 10.2, GPSdata.altitude);
// assertEqualsM("2 course", 0, GPSdata.course); // GPGGA not overwrite course
strcpy(nmeaMessage, "$GPRMC,111609.14,A,5001.27,N,3613.06,E,11.2,0.0,261206,0.0,E*50");
gps_location(&GPSdata, nmeaMessage);
assertEqualsM("3 valid", 4, GPSdata.quality);
assertEqualsM("3 latitude", 5001.27, GPSdata.latitude);
assertEqualsM("3 longitude", 3613.06, GPSdata.longitude);
assertEqualsM("3 speed", 11.2, GPSdata.speed);
// assertEqualsM("3 altitude", 0, GPSdata.altitude); // GPRMC not overwrite altitude
assertEqualsM("3 course", 0, GPSdata.course);
assertEqualsM("3 GPS yy",2006, GPSdata.GPStm.tm_year+1900);
assertEqualsM("3 GPS mm",12, GPSdata.GPStm.tm_mon);
assertEqualsM("3 GPS yy",26, GPSdata.GPStm.tm_mday);
assertEqualsM("3 GPS hh",11, GPSdata.GPStm.tm_hour);
assertEqualsM("3 GPS mm",16, GPSdata.GPStm.tm_min);
assertEqualsM("3 GPS ss",9, GPSdata.GPStm.tm_sec);
// check again first one
// we need to pass a mutable string, not a constant because the parser would be modifying the string
strcpy(nmeaMessage, "$GPRMC,173843,A,3349.896,N,11808.521,W,000.0,360.0,230108,013.4,E*69");
gps_location(&GPSdata, nmeaMessage);
assertEqualsM("4 valid", 4, GPSdata.quality);
assertEqualsM("4 latitude", 3349.896, GPSdata.latitude);
assertEqualsM("4 longitude", 11808.521, GPSdata.longitude);
assertEqualsM("4 speed", 0, GPSdata.speed);
assertEqualsM("4 course", 360, GPSdata.course);
}
// this buffer is needed because on Unix you would not be able to change static char constants
static char buffer[300];
void testConsoleLogic(void) {
print("******************************************* testConsoleLogic\r\n");
resetConsoleActions();
helpCommand();
char *ptr = validateSecureLine(UNKNOWN_COMMAND);
assertEquals(0, strcmp(UNKNOWN_COMMAND, ptr));
assertEquals(10, tokenLength(UNKNOWN_COMMAND));
// handling invalid token should work
strcpy(buffer, "sdasdafasd asd");
handleConsoleLine(buffer);
print("\r\naddConsoleActionI\r\n");
addConsoleActionI("echoi", testEchoI);
strcpy(buffer, "echoi 239");
handleConsoleLine(buffer);
assertEquals(239, lastInteger);
print("\r\naddConsoleActionII\r\n");
addConsoleActionII("echoii", testEchoII);
strcpy(buffer, "echoii 22 239");
handleConsoleLine(buffer);
assertEquals(22, lastInteger);
assertEquals(239, lastInteger2);
print("\r\addConsoleActionSSS\r\n");
addConsoleActionSSS("echosss", testEchoSSS);
strcpy(buffer, "echosss 111 222 333");
handleConsoleLine(buffer);
assertEquals(111, atoi(lastFirst));
assertEquals(333, atoi(lastThird));
//addConsoleActionSSS("GPS", testGpsParser);
}

View File

@ -1,30 +1,31 @@
/**
* @file test_cyclic_buffer.h
*
* @date Dec 8, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef TEST_CYCLIC_BUFFER_H_
#define TEST_CYCLIC_BUFFER_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void testCyclicBuffer(void);
void testHistogram(void);
void testMalfunctionCentral(void);
void testConsoleLogic(void);
void testGpsParser(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* TEST_CYCLIC_BUFFER_H_ */
/**
* @file test_cyclic_buffer.h
*
* @date Dec 8, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef TEST_CYCLIC_BUFFER_H_
#define TEST_CYCLIC_BUFFER_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void testCyclicBuffer(void);
void testOverflow64Counter(void);
void testHistogram(void);
void testMalfunctionCentral(void);
void testConsoleLogic(void);
void testGpsParser(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* TEST_CYCLIC_BUFFER_H_ */

View File

@ -1,42 +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>
<?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>

View File

@ -1,27 +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>
<?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>

View File

@ -1,256 +1,259 @@
##############################################################################
# Build global options
# NOTE: Can be overridden externally.
#
PROJECT_DIR = ../firmware
#CHIBIOS = $(PROJECT_DIR)/chibios
# Compiler options here.
ifeq ($(USE_OPT),)
# this config if debugging is needed, but the binary is about 30M
# USE_OPT = -c -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 = -c -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
endif
# C specific options here (added to USE_OPT).
ifeq ($(USE_COPT),)
USE_COPT = -std=gnu99 -fgnu89-inline
endif
# C++ specific options here (added to USE_OPT).
ifeq ($(USE_CPPOPT),)
USE_CPPOPT = -fno-rtti -fpermissive -fno-exceptions -fno-use-cxa-atexit
endif
# Enable this if you want the linker to remove unused code and data
ifeq ($(USE_LINK_GC),)
USE_LINK_GC = yes
endif
# If enabled, this option allows to compile the application in THUMB mode.
ifeq ($(USE_THUMB),)
USE_THUMB = no
endif
# Enable this if you want to see the full log while compiling.
ifeq ($(USE_VERBOSE_COMPILE),)
USE_VERBOSE_COMPILE = no
endif
#
# Build global options
##############################################################################
##############################################################################
# Architecture or project specific options
#
# List all default C defines here, like -D_DEBUG=1
DDEFS =
#
# Architecture or project specific options
##############################################################################
##############################################################################
# Project, sources and paths
#
# Define project name here
PROJECT = rusefi_simulator
#PROJECT_BOARD = OLIMEX_STM32_E407
#ifneq ($(PROJECT_BOARD),OLIMEX_STM32_E407)
# PROJECT_BOARD = ST_STM32F4_DISCOVERY
#endif
#DDEFS += -D$(PROJECT_BOARD)
CHIBIOS = ../firmware/chibios
# Imported source files and paths
include $(PROJECT_DIR)/util/util.mk
include $(PROJECT_DIR)/config/engines/engines.mk
include $(PROJECT_DIR)/controllers/algo/algo.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_util/console_util.mk
include $(CHIBIOS)/boards/simulator/board.mk
include ${CHIBIOS}/os/hal/hal.mk
include ${CHIBIOS}/os/hal/platforms/Win32/platform.mk
include ${CHIBIOS}/os/ports/GCC/SIMIA32/port.mk
include ${CHIBIOS}/os/kernel/kernel.mk
# Define linker script file here
#LDSCRIPT= config/system/STM32F407xG.ld
#LDSCRIPT= $(PORTLD)/STM32F407xG_CCM.ld
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = ${PORTSRC} \
${KERNSRC} \
${TESTSRC} \
${HALSRC} \
${PLATFORMSRC} \
$(TRIGGERSRC) \
$(SYSTEMSRC) \
$(CONSOLESRC) \
$(CONSOLEUTILSRC) \
$(CONTROLLERS_ALGO_SRC) \
$(CONTROLLERS_MATH_SRC) \
$(CONTROLLERS_SENSORS_SRC) \
$(ENGINES_SRC) \
$(BOARDSRC) \
${CHIBIOS}/os/various/chprintf.c \
${CHIBIOS}/os/various/memstreams.c \
$(UTILSRC) \
simulator/rusEfiFunctionalTest.c \
$(PROJECT_DIR)/controllers/settings.c \
simulator/boards.c \
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) \
$(CONTROLLERSSRC_CPP) \
$(SYSTEMSRC_CPP) \
$(ENGINES_SRC_CPP) \
$(TEST_SRC_CPP)
# C sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACSRC =
# C++ sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACPPSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCPPSRC =
# List ASM source files here
ASMSRC = $(PORTASM)
INCDIR = . \
$(PORTINC) $(KERNINC) $(TESTINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) \
$(PROJECT_DIR)/util \
$(PROJECT_DIR)/console \
$(PROJECT_DIR)/console_util \
$(PROJECT_DIR)/config/engines \
$(PROJECT_DIR)/ext_algo \
$(PROJECT_DIR)/controllers \
$(PROJECT_DIR)/controllers/sensors \
$(PROJECT_DIR)/controllers/system \
$(PROJECT_DIR)/hw_layer/algo \
$(PROJECT_DIR)/controllers/algo \
$(PROJECT_DIR)/controllers/math \
$(PROJECT_DIR)/controllers/math \
$(PROJECT_DIR)/controllers/trigger \
${CHIBIOS}/os/various \
simulator
#
# Project, sources and paths
##############################################################################
##############################################################################
# Compiler settings
#
#MCU = cortex-m4
ifeq ($(OS),Windows_NT)
TRGT = i686-pc-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
OD = $(TRGT)objdump
HEX = $(CP) -O ihex
BIN = $(CP) -O binary
# ARM-specific options here
AOPT =
# THUMB-specific options here
TOPT = -mthumb -DTHUMB
# Define C warning options here
CWARN = -Wall -Wextra -Wstrict-prototypes
# Define C++ warning options here
CPPWARN = -Wall -Wextra
#
# Compiler settings
##############################################################################
##############################################################################
# Start of default section
#
# List all default ASM defines here, like -D_DEBUG=1
DADEFS =
# List all default directories to look for include files here
DINCDIR =
# List the default directory to look for the libraries here
DLIBDIR =
# List all default libraries here
DLIBS = -static-libgcc -static-libstdc++ -lws2_32
#
# End of default section
##############################################################################
##############################################################################
# Start of user section
#
# List all user C define here, like -D_DEBUG=1
UDEFS =
# 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
ULIBS = -lm
#
# End of user defines
##############################################################################
include rules.mk
##############################################################################
# Build global options
# NOTE: Can be overridden externally.
#
PROJECT_DIR = ../firmware
#CHIBIOS = $(PROJECT_DIR)/chibios
# Compiler options here.
ifeq ($(USE_OPT),)
# this config if debugging is needed, but the binary is about 30M
# USE_OPT = -c -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 = -c -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
endif
# C specific options here (added to USE_OPT).
ifeq ($(USE_COPT),)
USE_COPT = -std=gnu99 -fgnu89-inline
endif
# C++ specific options here (added to USE_OPT).
ifeq ($(USE_CPPOPT),)
USE_CPPOPT = -fno-rtti -fpermissive -fno-exceptions -fno-use-cxa-atexit
endif
# Enable this if you want the linker to remove unused code and data
ifeq ($(USE_LINK_GC),)
USE_LINK_GC = yes
endif
# If enabled, this option allows to compile the application in THUMB mode.
ifeq ($(USE_THUMB),)
USE_THUMB = no
endif
# Enable this if you want to see the full log while compiling.
ifeq ($(USE_VERBOSE_COMPILE),)
USE_VERBOSE_COMPILE = no
endif
#
# Build global options
##############################################################################
##############################################################################
# Architecture or project specific options
#
# List all default C defines here, like -D_DEBUG=1
DDEFS =
#
# Architecture or project specific options
##############################################################################
##############################################################################
# Project, sources and paths
#
# Define project name here
PROJECT = rusefi_simulator
#PROJECT_BOARD = OLIMEX_STM32_E407
#ifneq ($(PROJECT_BOARD),OLIMEX_STM32_E407)
# PROJECT_BOARD = ST_STM32F4_DISCOVERY
#endif
#DDEFS += -D$(PROJECT_BOARD)
CHIBIOS = ../firmware/chibios
# Imported source files and paths
include $(PROJECT_DIR)/util/util.mk
include $(PROJECT_DIR)/config/engines/engines.mk
include $(PROJECT_DIR)/controllers/algo/algo.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_util/console_util.mk
include $(CHIBIOS)/boards/simulator/board.mk
include ${CHIBIOS}/os/hal/hal.mk
include ${CHIBIOS}/os/hal/platforms/Win32/platform.mk
include ${CHIBIOS}/os/ports/GCC/SIMIA32/port.mk
include ${CHIBIOS}/os/kernel/kernel.mk
# Define linker script file here
#LDSCRIPT= config/system/STM32F407xG.ld
#LDSCRIPT= $(PORTLD)/STM32F407xG_CCM.ld
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = ${PORTSRC} \
${KERNSRC} \
${TESTSRC} \
${HALSRC} \
${PLATFORMSRC} \
$(TRIGGER_SRC) \
$(SYSTEMSRC) \
$(CONSOLESRC) \
$(CONSOLEUTILSRC) \
$(CONTROLLERS_ALGO_SRC) \
$(CONTROLLERS_MATH_SRC) \
$(CONTROLLERS_SENSORS_SRC) \
$(ENGINES_SRC) \
$(BOARDSRC) \
${CHIBIOS}/os/various/chprintf.c \
${CHIBIOS}/os/various/memstreams.c \
$(UTILSRC) \
simulator/rusEfiFunctionalTest.c \
simulator/boards.c \
$(PROJECT_DIR)/emulation/analog_chart.c \
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 \
$(TRIGGER_SRC_CPP) \
$(SYSTEMSRC_CPP) \
$(CONTROLLERS_MATH_SRC_CPP) \
$(ENGINES_SRC_CPP) \
$(TEST_SRC_CPP)
# C sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACSRC =
# C++ sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
ACPPSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCSRC =
# C sources to be compiled in THUMB mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
# option that results in lower performance and larger code size.
TCPPSRC =
# List ASM source files here
ASMSRC = $(PORTASM)
INCDIR = . \
$(PORTINC) $(KERNINC) $(TESTINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) \
$(PROJECT_DIR)/util \
$(PROJECT_DIR)/console \
$(PROJECT_DIR)/console_util \
$(PROJECT_DIR)/config/engines \
$(PROJECT_DIR)/ext_algo \
$(PROJECT_DIR)/controllers \
$(PROJECT_DIR)/controllers/sensors \
$(PROJECT_DIR)/controllers/system \
$(PROJECT_DIR)/hw_layer/algo \
$(PROJECT_DIR)/emulation \
$(PROJECT_DIR)/controllers/algo \
$(PROJECT_DIR)/controllers/math \
$(PROJECT_DIR)/controllers/math \
$(PROJECT_DIR)/controllers/trigger \
${CHIBIOS}/os/various \
simulator
#
# Project, sources and paths
##############################################################################
##############################################################################
# Compiler settings
#
#MCU = cortex-m4
ifeq ($(OS),Windows_NT)
TRGT = i686-pc-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
OD = $(TRGT)objdump
HEX = $(CP) -O ihex
BIN = $(CP) -O binary
# ARM-specific options here
AOPT =
# THUMB-specific options here
TOPT = -mthumb -DTHUMB
# Define C warning options here
CWARN = -Wall -Wextra -Wstrict-prototypes
# Define C++ warning options here
CPPWARN = -Wall -Wextra
#
# Compiler settings
##############################################################################
##############################################################################
# Start of default section
#
# List all default ASM defines here, like -D_DEBUG=1
DADEFS =
# List all default directories to look for include files here
DINCDIR =
# List the default directory to look for the libraries here
DLIBDIR =
# List all default libraries here
DLIBS = -static-libgcc -static-libstdc++ -lws2_32
#
# End of default section
##############################################################################
##############################################################################
# Start of user section
#
# List all user C define here, like -D_DEBUG=1
UDEFS =
# 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
ULIBS = -lm
#
# End of user defines
##############################################################################
include rules.mk

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +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
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

View File

@ -1,312 +1,312 @@
/*
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.
*/
/**
* @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 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 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
/*===========================================================================*/
/* 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 64 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
#endif /* _HALCONF_H_ */
/** @} */
/*
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.
*/
/**
* @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 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 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
/*===========================================================================*/
/* 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 64 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
#endif /* _HALCONF_H_ */
/** @} */

View File

@ -1,189 +1,189 @@
/*
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"
#define SHELL_WA_SIZE THD_WA_SIZE(4096)
#define CONSOLE_WA_SIZE THD_WA_SIZE(4096)
static Thread *cdtp;
//static Thread *shelltp1;
//static Thread *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.
*/
static msg_t console_thread(void *arg) {
(void) arg;
while (!chThdShouldTerminate()) {
Thread *tp = chMsgWait();
puts((char *) chMsgGet(tp));
fflush(stdout);
chMsgRelease(tp, RDY_OK);
}
return 0;
}
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();
// if (shelltp2 && chThdTerminated(shelltp2)) {
// chThdWait(shelltp2);
// shelltp2 = NULL;
// chThdSleepMilliseconds(10);
// cputs("Init: shell on SD2 terminated");
// chSysLock();
// chOQResetI(&SD2.oqueue);
// chSysUnlock();
// }
}
static EventListener sd1fel, sd2fel;
/**
* @brief SD1 status change handler.
*
* @param[in] id event id.
*/
static void sd1_handler(eventid_t id) {
flagsmask_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) {
flagsmask_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);
EventListener tel;
/*
* 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 (!chThdShouldTerminate()) {
chEvtDispatch(fhandlers, chEvtWaitOne(ALL_EVENTS));
printPendingMessages();
chThdSleepMilliseconds(100);
}
/*
* Clean simulator exit.
*/
chEvtUnregister(chnGetEventSource(&SD1), &sd1fel);
chEvtUnregister(chnGetEventSource(&SD2), &sd2fel);
return 0;
}
int systicks2ms(int systicks) {
return systicks / TICKS_IN_MS;
}
/*
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"
#define SHELL_WA_SIZE THD_WA_SIZE(4096)
#define CONSOLE_WA_SIZE THD_WA_SIZE(4096)
static Thread *cdtp;
//static Thread *shelltp1;
//static Thread *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.
*/
static msg_t console_thread(void *arg) {
(void) arg;
while (!chThdShouldTerminate()) {
Thread *tp = chMsgWait();
puts((char *) chMsgGet(tp));
fflush(stdout);
chMsgRelease(tp, RDY_OK);
}
return 0;
}
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();
// if (shelltp2 && chThdTerminated(shelltp2)) {
// chThdWait(shelltp2);
// shelltp2 = NULL;
// chThdSleepMilliseconds(10);
// cputs("Init: shell on SD2 terminated");
// chSysLock();
// chOQResetI(&SD2.oqueue);
// chSysUnlock();
// }
}
static EventListener sd1fel, sd2fel;
/**
* @brief SD1 status change handler.
*
* @param[in] id event id.
*/
static void sd1_handler(eventid_t id) {
flagsmask_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) {
flagsmask_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);
EventListener tel;
/*
* 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 (!chThdShouldTerminate()) {
chEvtDispatch(fhandlers, chEvtWaitOne(ALL_EVENTS));
printPendingMessages();
chThdSleepMilliseconds(100);
}
/*
* Clean simulator exit.
*/
chEvtUnregister(chnGetEventSource(&SD1), &sd1fel);
chEvtUnregister(chnGetEventSource(&SD2), &sd2fel);
return 0;
}
int systicks2ms(int systicks) {
return systicks / TICKS_IN_MS;
}

View File

@ -1,31 +1,2 @@
#include "global.h"
#include "boards.h"
#include "eficonsole.h"
#include "efilib.h"
#include "datalogging.h"
#include "error_handling.h"
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void printToWin32Console(char *p);
int systicks2ms(int systicks);
// todo: move somewhere else?
void lockAnyContext(void);
void unlockAnyContext(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
#include "global.h"

View File

@ -1,168 +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 ***
# 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

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

View File

@ -1,57 +1,57 @@
/**
* @file board.c
*
* @date Nov 15, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#include "main.h"
#include "boards.h"
#include "engine_configuration.h"
#include "adc_math.h"
static Logging logger;
extern engine_configuration_s *engineConfiguration;
//float getVoltageDivided(int channel) {
// return 0;
//}
//
static float fakeAdcValues[16];
int getAdcValue(int hwChannel) {
return fakeAdcValues[hwChannel];
}
static void setVoltage(int hwChannel, float voltage) {
scheduleMsg(&logger, "fake voltage: channel %d value %f", hwChannel, voltage);
fakeAdcValues[hwChannel] = voltsToAdc(voltage);
}
static void setCltVoltage(float voltage) {
setVoltage(engineConfiguration->cltAdcChannel, voltage);
}
static void setIatVoltage(float voltage) {
setVoltage(engineConfiguration->iatAdcChannel, voltage);
}
static void setMafVoltage(float voltage) {
setVoltage(engineConfiguration->mafAdcChannel, voltage);
}
static void setAfrVoltage(float voltage) {
setVoltage(engineConfiguration->afrSensor.afrAdcChannel, voltage);
}
void initFakeBoard(void) {
initLogging(&logger, "simulator board");
addConsoleActionF("set_fake_clt_voltage", setCltVoltage);
addConsoleActionF("set_fake_iat_voltage", setIatVoltage);
addConsoleActionF("set_fake_maf_voltage", setMafVoltage);
addConsoleActionF("set_fake_afr_voltage", setAfrVoltage);
}
/**
* @file board.c
*
* @date Nov 15, 2013
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#include "main.h"
#include "boards.h"
#include "engine_configuration.h"
#include "adc_math.h"
static Logging logger;
extern engine_configuration_s *engineConfiguration;
//float getVoltageDivided(int channel) {
// return 0;
//}
//
static float fakeAdcValues[16];
int getAdcValue(int hwChannel) {
return fakeAdcValues[hwChannel];
}
static void setVoltage(int hwChannel, float voltage) {
scheduleMsg(&logger, "fake voltage: channel %d value %f", hwChannel, voltage);
fakeAdcValues[hwChannel] = voltsToAdc(voltage);
}
static void setCltVoltage(float voltage) {
setVoltage(engineConfiguration->cltAdcChannel, voltage);
}
static void setIatVoltage(float voltage) {
setVoltage(engineConfiguration->iatAdcChannel, voltage);
}
static void setMafVoltage(float voltage) {
setVoltage(engineConfiguration->mafAdcChannel, voltage);
}
static void setAfrVoltage(float voltage) {
setVoltage(engineConfiguration->afrSensor.afrAdcChannel, voltage);
}
void initFakeBoard(void) {
initLogging(&logger, "simulator board");
addConsoleActionF("set_fake_clt_voltage", setCltVoltage);
addConsoleActionF("set_fake_iat_voltage", setIatVoltage);
addConsoleActionF("set_fake_maf_voltage", setMafVoltage);
addConsoleActionF("set_fake_afr_voltage", setAfrVoltage);
}

View File

@ -1,23 +1,32 @@
#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 DELEGATE (&SD1)
#define EFI_CONSOLE_UART_DEVICE (&testStream)
//float getVoltageDivided(int);
int getAdcValue(int channel);
void initFakeBoard(void);
#endif /* BOARDS_FT_H_ */
#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 DELEGATE (&SD1)
#define EFI_CONSOLE_UART_DEVICE (&testStream)
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
//float getVoltageDivided(int);
int getAdcValue(int channel);
void initFakeBoard(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* BOARDS_FT_H_ */

View File

@ -1,13 +1,24 @@
/*
* efifeatures.h
*
* Created on: Mar 7, 2014
* Author: Andrey
*/
#ifndef EFIFEATURES_H_
#define EFIFEATURES_H_
#endif /* EFIFEATURES_H_ */
/*
* efifeatures.h
*
* Created on: Mar 7, 2014
* Author: Andrey
*/
#ifndef EFIFEATURES_H_
#define EFIFEATURES_H_
#define EFI_SIMULATOR TRUE
#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_SIGNAL_EXECUTOR_SLEEP TRUE
#define EFI_WAVE_CHART TRUE
#endif /* EFIFEATURES_H_ */

View File

@ -1,163 +1,174 @@
/**
* @file rusEfiFunctionalTest.c
*
* @date Mar 1, 2014
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#include "global.h"
#include "rusEfiFunctionalTest.h"
#include "eficonsole.h"
#include "engine_configuration.h"
#include "rusefi_enums.h"
#include "pwm_generator_logic.h"
#include "wave_math.h"
#include "boards.h"
#include "trigger_central.h"
#include "datalogging.h"
#include "algo.h"
#include "rpm_calculator.h"
#include "wave_chart.h"
#include "status_loop.h"
#include "trigger_emulator_algo.h"
#include "main_trigger_callback.h"
#include "allsensors.h"
extern WaveChart waveChart;
static engine_configuration_s ec;
static engine_configuration2_s ec2;
engine_configuration_s * engineConfiguration = &ec;
engine_configuration2_s *engineConfiguration2 = &ec2;
void setOutputPinValue(io_pin_e pin, int logicValue) {
}
int isInjectionEnabled(void) {
return TRUE;
}
//void initOutputSignal(OutputSignal *signal, io_pin_e ioPin) {
//
//}
void idleDebug(char *msg, int value) {
}
float getMap(void) {
return 0;
}
static int primaryWheelState = FALSE;
static int secondaryWheelState = FALSE;
static void triggerEmulatorCallback(PwmConfig *state, int stateIndex) {
int newPrimaryWheelState = state->multiWave.waves[0].pinStates[stateIndex];
int newSecondaryWheelState = state->multiWave.waves[1].pinStates[stateIndex];
if (primaryWheelState != newPrimaryWheelState) {
primaryWheelState = newPrimaryWheelState;
hwHandleShaftSignal(primaryWheelState ? SHAFT_PRIMARY_UP : SHAFT_PRIMARY_DOWN);
}
if (secondaryWheelState != newSecondaryWheelState) {
secondaryWheelState = newSecondaryWheelState;
hwHandleShaftSignal(secondaryWheelState ? SHAFT_SECONDARY_UP : SHAFT_SECONDARY_DOWN);
}
// print("hello %d\r\n", chTimeNow());
}
void rusEfiFunctionalTest(void) {
initializeConsole();
initFakeBoard();
initStatusLoop();
resetConfigurationExt(FORD_ASPIRE_1996, engineConfiguration, engineConfiguration2);
initThermistors();
initAlgo();
initRpmCalculator();
initTriggerEmulatorLogic(triggerEmulatorCallback);
initMainEventListener();
initTriggerCentral();
}
void printPendingMessages(void) {
printPending();
if (getFullLog()) {
printSensors();
finishStatusLine();
publishChartIfFull(&waveChart);
}
}
static size_t wt_writes(void *ip, const uint8_t *bp, size_t n) {
printToWin32Console((char*)bp);
return DELEGATE->vmt->write(DELEGATE, bp, n);
}
static size_t wt_reads(void *ip, uint8_t *bp, size_t n) {
return DELEGATE->vmt->read(DELEGATE, bp, n);
}
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 DELEGATE->vmt->put(DELEGATE, b);
}
static msg_t wt_get(void *ip) {
// cputs("wt_get");
//return 0;
return DELEGATE->vmt->get(DELEGATE);
}
static const struct Win32TestStreamVMT vmt = { wt_writes, wt_reads, wt_put, wt_get };
void initTestStream(TestStream *ts) {
ts->vmt = &vmt;
}
int isSerialOverTcpReady;
int is_serial_ready(void) {
return isSerialOverTcpReady;
}
void onFatalError(const char *msg, char * file, int line) {
printf("onFatalError %s %s%d", msg, file, line);
exit(-1);
}
int warning(const char *fmt, ...) {
printf("Warning: %s\r\n", fmt);
return 0;
}
void firmwareError(const char *fmt, ...) {
fatal3((char*)fmt, __FILE__, __LINE__);
}
int hasFatalError(void) {
return false;
}
int getVersion(void) {
return 239;
}
/**
* @file rusEfiFunctionalTest.c
*
* @date Mar 1, 2014
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#include "global.h"
#include "rusEfiFunctionalTest.h"
#include "eficonsole.h"
#include "engine_configuration.h"
#include "rusefi_enums.h"
#include "pwm_generator_logic.h"
#include "wave_math.h"
#include "boards.h"
#include "trigger_central.h"
#include "datalogging.h"
#include "algo.h"
#include "rpm_calculator.h"
#include "wave_chart.h"
#include "status_loop.h"
#include "trigger_emulator_algo.h"
#include "main_trigger_callback.h"
#include "allsensors.h"
#include "analog_chart.h"
extern WaveChart waveChart;
static persistent_config_s config;
static engine_configuration2_s ec2;
engine_configuration_s * engineConfiguration = &config.engineConfiguration;
board_configuration_s *boardConfiguration = &config.boardConfiguration;
engine_configuration2_s *engineConfiguration2 = &ec2;
void setOutputPinValue(io_pin_e pin, int logicValue) {
}
int isInjectionEnabled(void) {
return TRUE;
}
//void initOutputSignal(OutputSignal *signal, io_pin_e ioPin) {
//
//}
void idleDebug(char *msg, int value) {
}
float getMap(void) {
return 0;
}
static int primaryWheelState = FALSE;
static int secondaryWheelState = FALSE;
static void triggerEmulatorCallback(PwmConfig *state, int stateIndex) {
int newPrimaryWheelState = state->multiWave.waves[0].pinStates[stateIndex];
int newSecondaryWheelState = state->multiWave.waves[1].pinStates[stateIndex];
if (primaryWheelState != newPrimaryWheelState) {
primaryWheelState = newPrimaryWheelState;
hwHandleShaftSignal(primaryWheelState ? SHAFT_PRIMARY_UP : SHAFT_PRIMARY_DOWN);
}
if (secondaryWheelState != newSecondaryWheelState) {
secondaryWheelState = newSecondaryWheelState;
hwHandleShaftSignal(secondaryWheelState ? SHAFT_SECONDARY_UP : SHAFT_SECONDARY_DOWN);
}
// print("hello %d\r\n", chTimeNow());
}
void rusEfiFunctionalTest(void) {
initializeConsole();
initFakeBoard();
initStatusLoop();
resetConfigurationExt(FORD_ASPIRE_1996, engineConfiguration, engineConfiguration2, boardConfiguration);
initThermistors();
initAlgo();
initRpmCalculator();
initAnalogChart();
initTriggerEmulatorLogic(triggerEmulatorCallback);
initMainEventListener();
initTriggerCentral();
}
void printPendingMessages(void) {
printPending();
if (getFullLog()) {
printState(getCrankEventCounter());
finishStatusLine();
publishChartIfFull(&waveChart);
}
}
static size_t wt_writes(void *ip, const uint8_t *bp, size_t n) {
printToWin32Console((char*)bp);
return DELEGATE->vmt->write(DELEGATE, bp, n);
}
static size_t wt_reads(void *ip, uint8_t *bp, size_t n) {
return DELEGATE->vmt->read(DELEGATE, bp, n);
}
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 DELEGATE->vmt->put(DELEGATE, b);
}
static msg_t wt_get(void *ip) {
// cputs("wt_get");
//return 0;
return DELEGATE->vmt->get(DELEGATE);
}
static const struct Win32TestStreamVMT vmt = { wt_writes, wt_reads, wt_put, wt_get };
void initTestStream(TestStream *ts) {
ts->vmt = &vmt;
}
int isSerialOverTcpReady;
int is_serial_ready(void) {
return isSerialOverTcpReady;
}
void onFatalError(const char *msg, char * file, int line) {
printf("onFatalError %s %s%d", msg, file, line);
exit(-1);
}
int warning(obd_code_e code, const char *fmt, ...) {
printf("Warning: %s\r\n", fmt);
return 0;
}
void firmwareError(const char *fmt, ...) {
fatal3((char*)fmt, __FILE__, __LINE__);
}
int hasFatalError(void) {
return false;
}
void chDbgPanic3(const char *msg, char * file, int line) {
onFatalError(msg, file, line);
}
uint64_t getTimeNowUs(void) {
return chTimeNow() * (1000000 / CH_FREQUENCY);
}
int getRusEfiVersion(void) {
return 239;
}

View File

@ -1,15 +1,15 @@
/**
* @file rusEfiFunctionalTest.h
*
* @date Mar 1, 2014
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef RUSEFIFUNCTIONALTEST_H_
#define RUSEFIFUNCTIONALTEST_H_
void rusEfiFunctionalTest(void);
void initTestStream(TestStream *ts);
void printPendingMessages(void);
#endif /* RUSEFIFUNCTIONALTEST_H_ */
/**
* @file rusEfiFunctionalTest.h
*
* @date Mar 1, 2014
* @author Andrey Belomutskiy, (c) 2012-2013
*/
#ifndef RUSEFIFUNCTIONALTEST_H_
#define RUSEFIFUNCTIONALTEST_H_
void rusEfiFunctionalTest(void);
void initTestStream(TestStream *ts);
void printPendingMessages(void);
#endif /* RUSEFIFUNCTIONALTEST_H_ */

View File

@ -1,2 +1,2 @@
int getVersion(void);
int getRusEfiVersion(void);