auto-sync

This commit is contained in:
rusefi 2014-08-29 10:44:55 -04:00
parent c8ca527b38
commit 4e25f6cbfc
359 changed files with 0 additions and 37322 deletions

View File

@ -1,372 +0,0 @@
<?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="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug.1943399423">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug.1943399423" 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.MakeErrorParser" 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.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="rusefi" buildArtefactType="org.eclipse.cdt.cross.arm.gnu.buildArtefactType.application" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.cross.arm.gnu.buildArtefactType.application" description="" id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug.1943399423" name="Debug" parent="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug">
<folderInfo id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug.1943399423." name="/" resourcePath="">
<toolChain id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.toolchain.debug.747823419" name="ARM Windows GCC (Sourcery G++ Lite)" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.toolchain.debug">
<option id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.option.debugging.level.2128888061" name="Debug level" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.option.debugging.level" value="org.eclipse.cdt.cross.arm.gnu.base.option.debugging.level.max" valueType="enumerated"/>
<option id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.option.addtools.createlisting.1809317580" name="Create Extended Listing" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.option.addtools.createlisting" value="false" valueType="boolean"/>
<targetPlatform id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.platform.debug.568472866" isAbstract="false" name="Windows Platform" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.platform.debug"/>
<builder buildPath="${workspace_loc:/chibios_template/Debug}" id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.builder.debug.479710089" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="ARM Windows GNU Make builder (Sourcery Lite Bare)" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.builder.debug"/>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.assembler.debug.1465123421" name="ARM Sourcery Windows GCC Assembler" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.assembler.debug">
<inputType id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.assembler.base.input.1266531692" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.assembler.base.input"/>
</tool>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.c.compiler.debug.1498722775" name="ARM Sourcery Windows GCC C Compiler" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.c.compiler.debug">
<option id="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.optimization.level.1147268579" name="Optimization level" superClass="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.optimization.level" value="org.eclipse.cdt.cross.arm.gnu.base.option.optimization.level.optimize" valueType="enumerated"/>
<option id="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.include.paths.395281450" name="Include paths (-I)" superClass="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/serial_over_usb}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/lcd}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/ext}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/ext_algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/various}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/util}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/console}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/console/tunerstudio}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config/engines}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config/boards}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/core}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/trigger}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/sensors}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/system}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/math}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/console_util}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/emulation}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/emulation/test}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/emulation/hw_layer}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/flash}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/russianefi}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/russianefi/algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/russianefi/ckp}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/russianefi/adc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config/system}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/splib}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/kernel/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/boards/ST_STM32F4_DISCOVERY}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/TIMv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/I2Cv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/RTCv2}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/OTGv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/GPIOv2}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32F4xx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/SPIv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/USARTv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/GCC/ARMCMx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/GCC/ARMCMx/STM32F4xx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/common/ARMCMx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/common/ARMCMx/CMSIS/include}&quot;"/>
</option>
<option id="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.other.otherflags.720321025" name="Other flags" superClass="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.other.otherflags" value="-fgnu89-inline -c -fmessage-length=0 -Werror=switch -Werror=type-limits -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable" valueType="string"/>
<option id="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.misc.std.32943169" name="Language Standard" superClass="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.misc.std" value="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.misc.std.gnu99" valueType="enumerated"/>
<option id="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.preprocessor.def.1323722868" name="Defined symbols (-D)" superClass="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.preprocessor.def" valueType="definedSymbols">
<listOptionValue builtIn="false" value="CORTEX_USE_FPU=TRUE"/>
</option>
<option id="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.optimization.flags.368011225" name="Other optimization flags" superClass="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.optimization.flags" value="-mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant" valueType="string"/>
<inputType id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.c.compiler.base.input.250064833" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.c.compiler.base.input"/>
</tool>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.cpp.compiler.debug.866330458" name="ARM Sourcery Windows GCC C++ Compiler" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.cpp.compiler.debug">
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.optimization.level.1285714959" name="Optimization level" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.optimization.level" value="org.eclipse.cdt.cross.arm.gnu.base.option.optimization.level.none" valueType="enumerated"/>
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.include.paths.356693673" name="Include paths (-I)" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/serial_over_usb}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/lcd}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/ext}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/ext_algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/various}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/util}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/console}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/console/tunerstudio}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config/engines}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config/boards}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/core}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/trigger}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/sensors}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/system}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/math}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/console_util}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/emulation}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/emulation/test}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/emulation/hw_layer}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/flash}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/stm32f4}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/russianefi}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/russianefi/algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/russianefi/ckp}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/russianefi/adc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config/system}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/splib}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/kernel/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/boards/ST_STM32F4_DISCOVERY}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/TIMv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/I2Cv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/RTCv2}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/OTGv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/GPIOv2}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32F4xx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/SPIv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/USARTv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/GCC/ARMCMx/STM32F4xx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/GCC/ARMCMx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/common/ARMCMx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/common/ARMCMx/CMSIS/include}&quot;"/>
</option>
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.other.otherflags.1439013659" name="Other flags" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.other.otherflags" value="-c -fmessage-length=0 -std=c++11 -Werror=write-strings -Werror=switch" valueType="string"/>
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.preprocessor.def.1500938905" name="Defined symbols (-D)" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
<listOptionValue builtIn="false" value="CORTEX_USE_FPU=TRUE"/>
</option>
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.optimization.flags.1776181591" name="Other optimization flags" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.optimization.flags" value="-mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant" valueType="string"/>
<inputType id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.cpp.compiler.base.input.1939416167" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.cpp.compiler.base.input"/>
</tool>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.c.linker.debug.369587711" name="ARM Sourcery Windows GCC C Linker" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.c.linker.debug"/>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.cpp.linker.debug.790854990" name="ARM Sourcery Windows GCC C++ Linker" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.cpp.linker.debug">
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.gcsections.1692062869" name="Remove unused sections (-Xlinker --gc-sections)" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.gcsections" value="true" valueType="boolean"/>
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.scriptfile.1659638949" name="Script file (-T)" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.scriptfile" value="${workspace_loc}\\${ProjName}\config\system\STM32F407xG_CCM.ld" valueType="string"/>
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.libs.266038076" name="Libraries (-l)" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.libs"/>
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.paths.1546594065" name="Library search path (-L)" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.paths"/>
<inputType id="org.eclipse.cdt.cross.arm.gnu.cpp.linker.input.214430349" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.archiver.base.99249388" name="ARM Sourcery Windows GCC Archiver" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.archiver.base"/>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.createflash.debug.283274370" name="ARM Sourcery Windows GNU Create Flash Image" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.createflash.debug"/>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.createlisting.debug.104214053" name="ARM Sourcery Windows GNU Create Listing" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.createlisting.debug"/>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.printsize.debug.1812095247" name="ARM Sourcery Windows GNU Print Size" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.printsize.debug"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="chibios/boards/simulator|chibios/os/ports/GCC/SIMIA32|chibios/os/hal/platforms/Win32|chibios/boards/OLIMEX_STM32_E407" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.release.1422617130">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.release.1422617130" 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.MakeErrorParser" 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.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="rusefi" buildArtefactType="org.eclipse.cdt.cross.arm.gnu.buildArtefactType.application" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.cross.arm.gnu.buildArtefactType.application" description="" id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.release.1422617130" name="Release" parent="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.release">
<folderInfo id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.release.1422617130." name="/" resourcePath="">
<toolChain id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.toolchain.release.614122032" name="ARM Windows GCC (Sourcery G++ Lite)" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.toolchain.release">
<option id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.option.debugging.level.447783356" name="Debug level" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.option.debugging.level" value="org.eclipse.cdt.cross.arm.gnu.base.option.debugging.level.none" valueType="enumerated"/>
<targetPlatform id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.platform.release.1559197737" isAbstract="false" name="Windows Platform" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.platform.release"/>
<builder buildPath="${workspace_loc:/chibios_template/Release}" id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.builder.release.845491162" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="ARM Windows GNU Make builder (Sourcery Lite Bare)" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.builder.release"/>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.assembler.release.1527944975" name="ARM Sourcery Windows GCC Assembler" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.assembler.release">
<inputType id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.assembler.base.input.1359572999" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.assembler.base.input"/>
</tool>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.c.compiler.release.431693497" name="ARM Sourcery Windows GCC C Compiler" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.c.compiler.release">
<option id="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.optimization.level.329705686" name="Optimization level" superClass="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.optimization.level" value="org.eclipse.cdt.cross.arm.gnu.base.option.optimization.level.optimize" valueType="enumerated"/>
<option id="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.include.paths.1664205045" name="Include paths (-I)" superClass="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/console/algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/ext}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/ext_algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/util}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config/engines}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config/boards}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config/system}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/console}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/console_util}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/math}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/sensors}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/core}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/system}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/trigger}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/emulation}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/emulation/hw_layer}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/lcd}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/serial_over_usb}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/boards/ST_STM32F4_DISCOVERY}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/kernel/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/various}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/RTCv2}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/OTGv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/I2Cv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/GPIOv2}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32F4xx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/SPIv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/TIMv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/USARTv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/GCC/ARMCMx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/GCC/ARMCMx/STM32F4xx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/common/ARMCMx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/common/ARMCMx/CMSIS/include}&quot;"/>
</option>
<option id="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.optimization.flags.536959381" name="Other optimization flags" superClass="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.optimization.flags" value="-mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant" valueType="string"/>
<option id="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.other.otherflags.1251184343" name="Other flags" superClass="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.other.otherflags" value="-c -fmessage-length=0 -Werror-implicit-function-declaration" valueType="string"/>
<option id="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.misc.std.1869635512" name="Language Standard" superClass="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.misc.std" value="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.misc.std.gnu99" valueType="enumerated"/>
<option id="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.preprocessor.def.2018981424" name="Defined symbols (-D)" superClass="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.preprocessor.def" valueType="definedSymbols">
<listOptionValue builtIn="false" value="CORTEX_USE_FPU=TRUE"/>
</option>
<option id="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.other.verbose.342060604" name="Verbose (-v)" superClass="org.eclipse.cdt.cross.arm.gnu.c.compiler.option.other.verbose" value="false" valueType="boolean"/>
<inputType id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.c.compiler.base.input.1479270851" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.c.compiler.base.input"/>
</tool>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.cpp.compiler.release.487461954" name="ARM Sourcery Windows GCC C++ Compiler" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.cpp.compiler.release">
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.optimization.level.74521503" name="Optimization level" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.optimization.level" value="org.eclipse.cdt.cross.arm.gnu.base.option.optimization.level.optimize" valueType="enumerated"/>
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.other.verbose.1350766121" name="Verbose (-v)" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.other.verbose" value="false" valueType="boolean"/>
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.include.paths.346409971" name="Include paths (-I)" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/serial_over_usb}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/lcd}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/ext}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/ext_algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/various}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/util}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/console}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/console/tunerstudio}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config/engines}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config/boards}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/core}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/trigger}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/sensors}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/system}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/controllers/math}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/console_util}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/emulation}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/emulation/test}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/emulation/hw_layer}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/hw_layer/flash}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/russianefi}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/russianefi/algo}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/russianefi/ckp}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/russianefi/adc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/config/system}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/splib}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/kernel/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/boards/ST_STM32F4_DISCOVERY}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/src}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/include}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/TIMv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/I2Cv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/RTCv2}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/OTGv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/GPIOv2}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32F4xx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/SPIv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/hal/platforms/STM32/USARTv1}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/GCC/ARMCMx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/GCC/ARMCMx/STM32F4xx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/common/ARMCMx}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/chibios/os/ports/common/ARMCMx/CMSIS/include}&quot;"/>
</option>
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.preprocessor.def.104404165" name="Defined symbols (-D)" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
<listOptionValue builtIn="false" value="CORTEX_USE_FPU=TRUE"/>
</option>
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.optimization.flags.514837677" name="Other optimization flags" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.compiler.option.optimization.flags" value="-mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fsingle-precision-constant" valueType="string"/>
<inputType id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.cpp.compiler.base.input.815685204" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.cpp.compiler.base.input"/>
</tool>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.c.linker.release.1692652942" name="ARM Sourcery Windows GCC C Linker" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.c.linker.release"/>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.cpp.linker.release.1996687940" name="ARM Sourcery Windows GCC C++ Linker" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.cpp.linker.release">
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.gcsections.317072174" name="Remove unused sections (-Xlinker --gc-sections)" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.gcsections" value="true" valueType="boolean"/>
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.scriptfile.1008873450" name="Script file (-T)" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.scriptfile" value="${workspace_loc}\\${ProjName}\config\system\STM32F407xG_CCM.ld" valueType="string"/>
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.libs.855505987" name="Libraries (-l)" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.libs"/>
<option id="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.paths.1314593101" name="Library search path (-L)" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.link.option.paths"/>
<inputType id="org.eclipse.cdt.cross.arm.gnu.cpp.linker.input.253018751" superClass="org.eclipse.cdt.cross.arm.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.archiver.base.1966213403" name="ARM Sourcery Windows GCC Archiver" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.archiver.base"/>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.createflash.release.966302019" name="ARM Sourcery Windows GNU Create Flash Image" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.createflash.release"/>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.createlisting.release.881059662" name="ARM Sourcery Windows GNU Create Listing" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.createlisting.release"/>
<tool id="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.printsize.release.1131501965" name="ARM Sourcery Windows GNU Print Size" superClass="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.printsize.release"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="chibios/boards/simulator|chibios/os/ports/GCC/SIMIA32|chibios/os/hal/platforms/Win32|chibios/boards/OLIMEX_STM32_E407" 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="chibios_template.org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.391826329" name="ARM Cross Target Application" projectType="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.release.1422617130;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.release.1422617130.;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.c.compiler.release.431693497;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.c.compiler.base.input.1479270851">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.cross.arm.gnu.ARM_CS_GCCWinManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug.1943399423;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug.1943399423.;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.assembler.debug.1465123421;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.assembler.base.input.1266531692">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.cross.arm.gnu.ARM_CS_GCCWinManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug.1943399423;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug.1943399423.;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.cpp.compiler.debug.866330458;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.cpp.compiler.base.input.1939416167">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.cross.arm.gnu.ARM_CS_GCCWinManagedMakePerProjectProfileCPP"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.release.1422617130;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.release.1422617130.;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.cpp.compiler.release.487461954;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.cpp.compiler.base.input.815685204">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.cross.arm.gnu.ARM_CS_GCCWinManagedMakePerProjectProfileCPP"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug.1943399423;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.debug.1943399423.;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.c.compiler.debug.1498722775;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.c.compiler.base.input.250064833">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.cross.arm.gnu.ARM_CS_GCCWinManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.release.1422617130;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.release.1422617130.;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.elf.assembler.release.1527944975;org.eclipse.cdt.cross.arm.gnu.sourcery.windows.assembler.base.input.1359572999">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.cross.arm.gnu.ARM_CS_GCCWinManagedMakePerProjectProfileC"/>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/firmware"/>
</configuration>
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/firmware"/>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cproject>

View File

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>chibios_template</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>
<filteredResources>
<filter>
<id>1381697360903</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-iar</arguments>
</matcher>
</filter>
<filter>
<id>1381675425786</id>
<name>chibios/os/ports</name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-IAR</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

File diff suppressed because it is too large Load Diff

View File

@ -1,194 +0,0 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.5 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="no"/>
<detaileddescription title=""/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

View File

@ -1,311 +0,0 @@
##############################################################################
# Build global options
# NOTE: Can be overridden externally.
#
PROJECT_DIR = .
CHIBIOS = chibios
# Compiler options here.
ifeq ($(USE_OPT),)
USE_OPT = $(RFLAGS) -O1 -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
endif
# C specific options here (added to USE_OPT).
ifeq ($(USE_COPT),)
USE_COPT =
endif
# C++ specific options here (added to USE_OPT).
ifeq ($(USE_CPPOPT),)
USE_CPPOPT = -std=c++11 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -Werror=write-strings
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 = yes
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
#
USE_FPU = yes
# Enables the use of FPU on Cortex-M4.
# Enable this if you really want to use the STM FWLib.
ifeq ($(USE_FPU),)
USE_FPU = no
endif
# Enable this if you really want to use the STM FWLib.
ifeq ($(USE_FWLIB),)
USE_FWLIB = no
endif
# 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
#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 $(CHIBIOS)/boards/$(PROJECT_BOARD)/board.mk
include $(CHIBIOS)/os/hal/platforms/STM32F4xx/platform.mk
include $(CHIBIOS)/os/hal/hal.mk
include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F4xx/port.mk
include $(CHIBIOS)/os/kernel/kernel.mk
include $(CHIBIOS)/os/various/cpp_wrappers/kernel.mk
include $(CHIBIOS)/os/various/fatfs_bindings/fatfs.mk
include console/tunerstudio/tunerstudio.mk
include ext/ext.mk
include hw_layer/hw_layer.mk
include emulation/emulation.mk
include controllers/controllers.mk
include $(PROJECT_DIR)/util/util.mk
include $(PROJECT_DIR)/config/engines/engines.mk
include $(PROJECT_DIR)/controllers/algo/algo.mk
include $(PROJECT_DIR)/controllers/core/core.mk
include $(PROJECT_DIR)/controllers/math/math.mk
include $(PROJECT_DIR)/controllers/sensors/sensors.mk
include $(PROJECT_DIR)/controllers/system/system.mk
include $(PROJECT_DIR)/controllers/trigger/trigger.mk
include $(PROJECT_DIR)/console/console.mk
include $(PROJECT_DIR)/console_util/console_util.mk
# Define linker script file here
LDSCRIPT= config/system/STM32F407xG_CCM.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) \
$(VARIOUSSRC) \
chibios/os/various/chprintf.c \
chibios/os/various/memstreams.c \
chibios/os/various/chrtclib.c \
$(UTILSRC) \
$(ENGINES_SRC) \
$(CONSOLESRC) \
$(CONSOLEUTILSRC) \
$(HALSRC) \
$(EMULATIONSRC) \
$(HW_LAYERSRC) \
$(CONTROLLERSSRC) \
$(CONTROLLERS_ALGO_SRC) \
$(CONTROLLERS_CORE_SRC) \
$(CONTROLLERS_MATH_SRC) \
$(CONTROLLERS_SENSORS_SRC) \
$(PLATFORMSRC) \
$(BOARDSRC) \
$(FATFSSRC) \
$(TRIGGER_SRC) \
$(SYSTEMSRC)
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CPPSRC = $(CHCPPSRC) \
$(TRIGGER_SRC_CPP) \
$(TRIGGER_DECODERS_SRC_CPP) \
$(EMULATIONSRC_CPP) \
$(CONTROLLERS_ALGO_SRC_CPP) \
$(SYSTEMSRC_CPP) \
$(ENGINES_SRC_CPP) \
$(HW_LAYER_SRC_CPP) \
$(TUNERSTUDIO_SRC_CPP) \
$(CONSOLE_SRC_CPP) \
$(CONTROLLERS_SENSORS_SRC_CPP) \
$(CONTROLLERS_SRC_CPP) \
$(UTILSRC_CPP) \
$(CONTROLLERS_CORE_SRC_CPP) \
$(CONTROLLERS_MATH_SRC_CPP) \
rusefi.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 = $(PORTINC) $(KERNINC) $(TESTINC) \
$(HALINC) $(PLATFORMINC) $(BOARDINC) \
$(CHCPPINC) \
$(CHIBIOS)/os/various \
config/system \
config/engines \
config/boards \
config \
chibios/os/various \
ext \
ext_algo \
util \
console_util \
console \
console/tunerstudio \
hw_layer \
hw_layer/serial_over_usb \
hw_layer/algo \
hw_layer/lcd \
hw_layer/stm32f4 \
emulation \
emulation/hw_layer \
emulation/test \
controllers \
controllers/sensors \
controllers/system \
controllers/algo \
controllers/core \
controllers/math \
controllers/trigger
#
# Project, sources and paths
##############################################################################
##############################################################################
# Compiler settings
#
MCU = cortex-m4
#TRGT = arm-elf-
TRGT = arm-none-eabi-
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 =
#
# 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
##############################################################################
ifeq ($(USE_FPU),yes)
USE_OPT += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant
USE_CPPOPT += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant
DDEFS += -DCORTEX_USE_FPU=TRUE
else
DDEFS += -DCORTEX_USE_FPU=FALSE
endif
ifeq ($(USE_FWLIB),yes)
include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
CSRC += $(STM32SRC)
INCDIR += $(STM32INC)
USE_OPT += -DUSE_STDPERIPH_DRIVER
endif
include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk

View File

@ -1,172 +0,0 @@
os/hal/hal.mk
os/hal/include/adc.h
os/hal/include/can.h
os/hal/include/ext.h
os/hal/include/gpt.h
os/hal/include/hal.h
os/hal/include/i2c.h
os/hal/include/icu.h
os/hal/include/io_block.h
os/hal/include/io_channel.h
os/hal/include/mac.h
os/hal/include/mii.h
os/hal/include/mmcsd.h
os/hal/include/mmc_spi.h
os/hal/include/pal.h
os/hal/include/pwm.h
os/hal/include/rtc.h
os/hal/include/sdc.h
os/hal/include/serial.h
os/hal/include/serial_usb.h
os/hal/include/spi.h
os/hal/include/tm.h
os/hal/include/uart.h
os/hal/include/usb.h
os/hal/platforms/STM32/can_lld.c
os/hal/platforms/STM32/can_lld.h
os/hal/platforms/STM32/ext_lld.c
os/hal/platforms/STM32/ext_lld.h
os/hal/platforms/STM32/GPIOv2/pal_lld.c
os/hal/platforms/STM32/GPIOv2/pal_lld.h
os/hal/platforms/STM32/i2s_lld.c
os/hal/platforms/STM32/i2s_lld.h
os/hal/platforms/STM32/mac_lld.c
os/hal/platforms/STM32/mac_lld.h
os/hal/platforms/STM32/OTGv1/stm32_otg.h
os/hal/platforms/STM32/OTGv1/usb_lld.c
os/hal/platforms/STM32/OTGv1/usb_lld.h
os/hal/platforms/STM32/RTCv2/rtc_lld.c
os/hal/platforms/STM32/RTCv2/rtc_lld.h
os/hal/platforms/STM32/sdc_lld.c
os/hal/platforms/STM32/sdc_lld.h
os/hal/platforms/STM32/SPIv1/spi_lld.c
os/hal/platforms/STM32/SPIv1/spi_lld.h
os/hal/platforms/STM32/stm32.h
os/hal/platforms/STM32/TIMv1/gpt_lld.c
os/hal/platforms/STM32/TIMv1/gpt_lld.h
os/hal/platforms/STM32/TIMv1/icu_lld.c
os/hal/platforms/STM32/TIMv1/icu_lld.h
os/hal/platforms/STM32/TIMv1/pwm_lld.c
os/hal/platforms/STM32/TIMv1/pwm_lld.h
os/hal/platforms/STM32/TIMv1/stm32_tim.h
os/hal/platforms/STM32/USARTv1/serial_lld.c
os/hal/platforms/STM32/USARTv1/serial_lld.h
os/hal/platforms/STM32/USARTv1/uart_lld.c
os/hal/platforms/STM32/USARTv1/uart_lld.h
os/hal/platforms/STM32F4xx/adc_lld.c
os/hal/platforms/STM32F4xx/adc_lld.h
os/hal/platforms/STM32F4xx/ext_lld_isr.c
os/hal/platforms/STM32F4xx/ext_lld_isr.h
os/hal/platforms/STM32F4xx/hal_lld.c
os/hal/platforms/STM32F4xx/hal_lld.h
os/hal/platforms/STM32F4xx/platform.dox
os/hal/platforms/STM32F4xx/platform.mk
os/hal/platforms/STM32F4xx/stm32f2xx.h
os/hal/platforms/STM32F4xx/stm32f4xx.h
os/hal/platforms/STM32F4xx/stm32_dma.c
os/hal/platforms/STM32F4xx/stm32_dma.h
os/hal/platforms/STM32F4xx/stm32_isr.h
os/hal/platforms/STM32F4xx/stm32_rcc.h
os/hal/src/adc.c
os/hal/src/can.c
os/hal/src/ext.c
os/hal/src/gpt.c
os/hal/src/hal.c
os/hal/src/i2c.c
os/hal/src/icu.c
os/hal/src/mac.c
os/hal/src/mmcsd.c
os/hal/src/mmc_spi.c
os/hal/src/pal.c
os/hal/src/pwm.c
os/hal/src/rtc.c
os/hal/src/sdc.c
os/hal/src/serial.c
os/hal/src/serial_usb.c
os/hal/src/spi.c
os/hal/src/tm.c
os/hal/src/uart.c
os/hal/src/usb.c
os/kernel/include/ch.h
os/kernel/include/chbsem.h
os/kernel/include/chcond.h
os/kernel/include/chdebug.h
os/kernel/include/chdynamic.h
os/kernel/include/chevents.h
os/kernel/include/chfiles.h
os/kernel/include/chheap.h
os/kernel/include/chinline.h
os/kernel/include/chlists.h
os/kernel/include/chmboxes.h
os/kernel/include/chmemcore.h
os/kernel/include/chmempools.h
os/kernel/include/chmsg.h
os/kernel/include/chmtx.h
os/kernel/include/chqueues.h
os/kernel/include/chregistry.h
os/kernel/include/chschd.h
os/kernel/include/chsem.h
os/kernel/include/chstreams.h
os/kernel/include/chsys.h
os/kernel/include/chthreads.h
os/kernel/include/chvt.h
os/kernel/kernel.mk
os/kernel/src/chcond.c
os/kernel/src/chdebug.c
os/kernel/src/chdynamic.c
os/kernel/src/chevents.c
os/kernel/src/chheap.c
os/kernel/src/chlists.c
os/kernel/src/chmboxes.c
os/kernel/src/chmemcore.c
os/kernel/src/chmempools.c
os/kernel/src/chmsg.c
os/kernel/src/chmtx.c
os/kernel/src/chqueues.c
os/kernel/src/chregistry.c
os/kernel/src/chschd.c
os/kernel/src/chsem.c
os/kernel/src/chsys.c
os/kernel/src/chthreads.c
os/kernel/src/chvt.c
os/ports/common/ARMCMx/CMSIS/include/arm_common_tables.h
os/ports/common/ARMCMx/CMSIS/include/arm_math.h
os/ports/common/ARMCMx/CMSIS/include/core_cm0.h
os/ports/common/ARMCMx/CMSIS/include/core_cm0plus.h
os/ports/common/ARMCMx/CMSIS/include/core_cm3.h
os/ports/common/ARMCMx/CMSIS/include/core_cm4.h
os/ports/common/ARMCMx/CMSIS/include/core_cm4_simd.h
os/ports/common/ARMCMx/CMSIS/include/core_cmFunc.h
os/ports/common/ARMCMx/CMSIS/include/core_cmInstr.h
os/ports/common/ARMCMx/CMSIS/readme.txt
os/ports/common/ARMCMx/nvic.c
os/ports/common/ARMCMx/nvic.h
os/ports/GCC/ARMCMx/chcore.c
os/ports/GCC/ARMCMx/chcore.h
os/ports/GCC/ARMCMx/chcore_v7m.c
os/ports/GCC/ARMCMx/chcore_v7m.h
os/ports/GCC/ARMCMx/chtypes.h
os/ports/GCC/ARMCMx/crt0.c
os/ports/GCC/ARMCMx/rules.mk
os/ports/GCC/ARMCMx/STM32F4xx/cmparams.h
os/ports/GCC/ARMCMx/STM32F4xx/port.mk
os/ports/GCC/ARMCMx/STM32F4xx/vectors.c
os/ports/IAR/ARMCMx/chcore.c
os/ports/IAR/ARMCMx/chcore.h
os/ports/IAR/ARMCMx/chcoreasm_v6m.s
os/ports/IAR/ARMCMx/chcoreasm_v7m.s
os/ports/IAR/ARMCMx/chcore_v6m.c
os/ports/IAR/ARMCMx/chcore_v6m.h
os/ports/IAR/ARMCMx/chcore_v7m.c
os/ports/IAR/ARMCMx/chcore_v7m.h
os/ports/IAR/ARMCMx/chtypes.h
os/ports/IAR/ARMCMx/cstartup.s
os/ports/IAR/ARMCMx/STM32F4xx/cmparams.h
os/ports/IAR/ARMCMx/STM32F4xx/vectors.s
os/various/chprintf.c
os/various/chprintf.h
os/various/fatfs_diskio.c
os/various/fatfs_syscall.c
os/various/memstreams.c
os/various/memstreams.h
os/various/various.mk

View File

@ -1,111 +0,0 @@
Index: boards/ST_STM32F4_DISCOVERY/board.h
===================================================================
--- boards/ST_STM32F4_DISCOVERY/board.h (revision 2723)
+++ boards/ST_STM32F4_DISCOVERY/board.h (working copy)
@@ -27,6 +27,7 @@
#define BOARD_ST_STM32F4_DISCOVERY
#define BOARD_NAME "STMicroelectronics STM32F4-Discovery"
+#define STM32_LSECLK 32768
/*
* Board oscillators-related settings.
Index: os/kernel/src/chdebug.c
===================================================================
--- os/kernel/src/chdebug.c (revision 2723)
+++ os/kernel/src/chdebug.c (working copy)
@@ -114,7 +114,7 @@
void dbg_check_lock(void) {
if ((dbg_isr_cnt != 0) || (dbg_lock_cnt != 0))
- chDbgPanic("SV#4");
+ chDbgPanic("SV#4 misplaced chSysLock()");
dbg_enter_lock();
}
@@ -138,7 +138,7 @@
void dbg_check_lock_from_isr(void) {
if ((dbg_isr_cnt <= 0) || (dbg_lock_cnt != 0))
- chDbgPanic("SV#6");
+ chDbgPanic("SV#6 misplaced chSysLockFromIsr");
dbg_enter_lock();
}
@@ -193,7 +193,7 @@
void chDbgCheckClassI(void) {
if ((dbg_isr_cnt < 0) || (dbg_lock_cnt <= 0))
- chDbgPanic("SV#10");
+ chDbgPanic("SV#10 misplaced I-class function");
}
/**
@@ -268,10 +268,11 @@
*
* @param[in] msg the pointer to the panic message string
*/
+
+void chDbgPanic3(const char *msg, char * file, int line);
+
void chDbgPanic(const char *msg) {
-
- dbg_panic_msg = msg;
- chSysHalt();
+ chDbgPanic3(msg, __FILE__, __LINE__);
}
#endif /* CH_DBG_ENABLED */
Index: os/ports/GCC/ARMCMx/chcore_v7m.h
===================================================================
--- os/ports/GCC/ARMCMx/chcore_v7m.h (revision 2723)
+++ os/ports/GCC/ARMCMx/chcore_v7m.h (working copy)
@@ -36,6 +36,8 @@
#ifndef _CHCORE_V7M_H_
#define _CHCORE_V7M_H_
+#include "chdebug.h"
+
/*===========================================================================*/
/* Port constants. */
/*===========================================================================*/
@@ -486,6 +488,8 @@
#define port_wait_for_interrupt()
#endif
+void chDbgStackOverflowPanic(Thread *otp);
+
/**
* @brief Performs a context switch between two threads.
* @details This is the most critical code in any port, this function
@@ -502,7 +506,7 @@
#define port_switch(ntp, otp) { \
register struct intctx *r13 asm ("r13"); \
if ((stkalign_t *)(r13 - 1) < otp->p_stklimit) \
- chDbgPanic("stack overflow"); \
+ chDbgStackOverflowPanic(otp); \
_port_switch(ntp, otp); \
}
#endif
Index: os/ports/GCC/ARMCMx/rules.mk
===================================================================
--- os/ports/GCC/ARMCMx/rules.mk (revision 2723)
+++ os/ports/GCC/ARMCMx/rules.mk (working copy)
@@ -60,7 +60,7 @@
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)
+CPPFLAGS = $(MCFLAGS) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS)
ifeq ($(USE_LINK_GC),yes)
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections $(LLIBDIR)
else
@@ -113,7 +113,7 @@
$(BUILDDIR) $(OBJDIR) $(LSTDIR):
ifneq ($(USE_VERBOSE_COMPILE),yes)
@echo Compiler Options
- @echo $(CC) -c $(CFLAGS) -I. $(IINCDIR) main.c -o main.o
+ @echo $(CPPC) -c $(CPPFLAGS) -I. $(IINCDIR) main.cpp -o main.o -llibstd++
@echo
endif
mkdir -p $(OBJDIR)

View File

@ -1,2 +0,0 @@
rd /s /q .dep
rd /s /q build

View File

@ -1,7 +0,0 @@
rem make, gcc, Windows and Cygwin combined have some issue with spaces or colons in paths, that's a workaround
rem that's more or less 'make clean'
rd /s /q .dep
rd /s /q build
# that's 'make' with some extra utilities
compile.bat

View File

@ -1,44 +0,0 @@
@echo off
rm -rf .dep/
rm -rf build\rusefi.hex
call update_version.bat
echo Starting compilation
rem the important piece
make
rem cd build
rem if not exist rusefi.hex echo "compilation failed"
rem if not exist rusefi.hex exit -1
rem cd ..
if errorlevel 1 goto error
echo Build complete success.
rem svn info > ../firmware_binary/version.txt
rem cp config/features.h ../firmware_binary
rem cp build/rusefi.hex ../firmware_binary
rem cp build/rusefi.elf ../firmware_binary
rem cp tunerstudio/rusefi.ini ../firmware_binary
rem cd ../firmware_binary
rem del firmaware_binary.zip
rem 7z a firmaware_binary.zip rusefi.hex rusefi.ini features.h flash.bat
rem cd ../firmware
cd build
rem Generate human-readable version of the .map memory usage report
java -jar ../../java_tools/gcc_map_reader.jar > ../../firmware_binary/rusefi_ram_report.txt
cd ..
rem file, let's program the board right away
flash.bat
exit
:error
echo Compilation failed

View File

@ -1,234 +0,0 @@
/**
* @file arro_board.h
*
* This file contents a configuration of default ecu board. Pinout and other.
* TODO: most of the pins should get configurable
*
*
* @date Nov 14, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
* @author frig
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ARRO_BOARD_H_
#define ARRO_BOARD_H_
#define STM32_ICU_USE_TIM1 TRUE // wave input
#define STM32_ICU_USE_TIM2 TRUE // primary position sensor
#define STM32_ICU_USE_TIM3 TRUE // secondary position sensor
#define STM32_ICU_USE_TIM4 FALSE
#define STM32_ICU_USE_TIM5 FALSE
#define STM32_ICU_USE_TIM8 FALSE
#define STM32_ICU_USE_TIM9 TRUE // wave input
// todo: switch to continues ADC conversion for slow ADC?
#define EFI_INTERNAL_SLOW_ADC_PWM &PWMD8
// todo: switch to continues ADC conversion for fast ADC?
#define EFI_INTERNAL_FAST_ADC_PWM &PWMD4
#define STM32_PWM_USE_TIM1 FALSE
#define STM32_PWM_USE_TIM2 FALSE
#define STM32_PWM_USE_TIM3 FALSE
//
#define STM32_PWM_USE_TIM4 TRUE // fast adc
#define STM32_PWM_USE_TIM5 FALSE
#define STM32_PWM_USE_TIM8 TRUE // slow adc
#define STM32_PWM_USE_TIM9 FALSE
#define STM32_SPI_USE_SPI1 TRUE
#define STM32_SPI_USE_SPI2 FALSE // external ADC
#define STM32_SPI_USE_SPI3 TRUE // potentiometer
#define STM32_CAN_USE_CAN1 TRUE
#define STM32_CAN_USE_CAN2 TRUE
#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
#define EFI_CAN_DEVICE CAND2
#define EFI_CAN_RX_AF 9
#define EFI_CAN_TX_AF 9
//#define EFI_CAN_DEVICE CAND1
//#define EFI_CAN_RX_AF 9
//#define EFI_CAN_TX_AF 9
/**
* This section is for bottom-left corner SPI
*/
//#define SPI_CS1_PORT GPIOE
//#define SPI_CS1_PIN 13
//#define SPI_CS2_PORT GPIOE
//#define SPI_CS2_PIN 14
//#define SPI_CS3_PORT GPIOE
//#define SPI_CS3_PIN 15
//#define SPI_CS4_PORT GPIOD
//#define SPI_CS4_PIN 10
//#define SPI_SD_MODULE_PORT GPIOD
//#define SPI_SD_MODULE_PIN 11
#define EFI_SPI1_SCK_PORT GPIOB
#define EFI_SPI1_SCK_PIN 3
#define EFI_SPI1_MISO_PORT GPIOB
#define EFI_SPI1_MISO_PIN 4
#define EFI_SPI1_MOSI_PORT GPIOB
#define EFI_SPI1_MOSI_PIN 5
#define EFI_SPI1_AF 5
#define EFI_SPI2_SCK_PORT GPIOB
#define EFI_SPI2_SCK_PIN 13
#define EFI_SPI2_MISO_PORT GPIOB
#define EFI_SPI2_MISO_PIN 14
#define EFI_SPI2_MOSI_PORT GPIOB
#define EFI_SPI2_MOSI_PIN 15
#define EFI_SPI2_AF 5
/**
* This section is for right-side center SPI
*/
// this is pointing into the sky for now - conflict with I2C
#define SPI_CS2_PORT GPIOH
// this is pointing into the sky for now - conflict with I2C
#define SPI_CS2_PIN 0
#define SPI_CS4_PORT GPIOD
#define SPI_CS4_PIN 3
#define SPI_SD_MODULE_PORT GPIOD
#define SPI_SD_MODULE_PIN 4
#define EFI_SPI3_SCK_PORT GPIOB
#define EFI_SPI3_SCK_PIN 3
#define EFI_SPI3_MISO_PORT GPIOB
#define EFI_SPI3_MISO_PIN 4
#define EFI_SPI3_MOSI_PORT GPIOB
#define EFI_SPI3_MOSI_PIN 5
#define EFI_SPI3_AF 6
#define MMC_CARD_SPI SPID3
#define EFI_I2C_SCL_PORT GPIOB
#define EFI_I2C_SCL_PIN 6
#define EFI_I2C_SDA_PORT GPIOB
#define EFI_I2C_SDA_PIN 7
#define EFI_I2C_AF 4
/**
* Patched version of ChibiOS/RT support extra details in the system error messages
*/
#define EFI_CUSTOM_PANIC_METHOD TRUE
/*
* 10 channel board is (from left to right):
* ADC 15 PC5 TPS
* ADC 14 PC4 MAP
* ADC 7 PA7 IAT
* ADC 6 PA6 CLT
* ADC 5 PA5 TIM2_CH1
* ADC 4 PA4
* ADC 3 PA3
* ADC 2 PA2
* ADC 1 PA1 vBatt
* ADC 0 PA0 MAF
*/
#define ADC_LOGIC_TPS_2 ADC_CHANNEL_IN0
#define ADC_CHANNEL_VREF ADC_CHANNEL_IN14
/**
* currently ChibiOS uses only first and second channels of each timer for input capture
*
* So, our options are:
*
* TIM2_CH1
* PA5
*
* TIM4_CH1
* PB6
* PD12
*
* TIM9_CH1
* PE5
*/
//#define ETB_CONTROL_LINE_1_PORT GPIOE
//#define ETB_CONTROL_LINE_1_PIN 0
//
//#define ETB_CONTROL_LINE_2_PORT GPIOB
//#define ETB_CONTROL_LINE_2_PIN 8
//#define CONSOLE_PORT GPIOB
//#define CONSOLE_TX_PIN 10
//#define CONSOLE_RX_PIN 11
/**
* Here we define the pinout for the human-readable protocol via UART, TunerStudio pinout is defined separately
*/
//#define EFI_CONSOLE_TX_PORT GPIOD
//#define EFI_CONSOLE_TX_PIN 8
//#define EFI_CONSOLE_RX_PORT GPIOD
//#define EFI_CONSOLE_RX_PIN 9
//#define EFI_CONSOLE_AF 7
#define EFI_CONSOLE_UART_DEVICE (&SD3)
#define EFI_CONSOLE_TX_PORT GPIOC
#define EFI_CONSOLE_TX_PIN 10
#define EFI_CONSOLE_RX_PORT GPIOC
#define EFI_CONSOLE_RX_PIN 11
#define EFI_CONSOLE_AF 7
//#define TS_SERIAL_TX_PORT GPIOD
//#define TS_SERIAL_TX_PIN 8
//#define TS_SERIAL_RX_PORT GPIOD
//#define TS_SERIAL_RX_PIN 9
//#define TS_SERIAL_AF 7
#define TS_SERIAL_TX_PORT GPIOC
#define TS_SERIAL_TX_PIN 10
#define TS_SERIAL_RX_PORT GPIOC
#define TS_SERIAL_RX_PIN 11
#define TS_SERIAL_AF 7
#define LED_WARNING_PORT GPIOD
#define LED_WARNING_PIN GPIOD_LED3
#define LED_RUNNING_STATUS_PORT GPIOD
#define LED_RUNNING_STATUS_PIN GPIOD_LED4
#define LED_ERROR_PORT GPIOD
#define LED_ERROR_PIN GPIOD_LED5
#define LED_COMMUNICATION_PORT GPIOD
#define LED_COMMUNICATION_PIN GPIOD_LED6
#define EFI_SIGNAL_EXECUTOR_SLEEP FALSE
#define EFI_SIGNAL_EXECUTOR_ONE_TIMER TRUE
#define EFI_SIGNAL_EXECUTOR_HW_TIMER FALSE
// USART1 -> check defined STM32_SERIAL_USE_USART1
// For GPS we have USART1. We can start with PB7 USART1_RX and PB6 USART1_TX
#define GPS_SERIAL_DEVICE &SD1
#define GPS_SERIAL_SPEED 38400
#define CONSOLE_MODE_SWITCH_PORT GPIOB
#define CONSOLE_MODE_SWITCH_PIN 1
#define CONFIG_RESET_SWITCH_PORT GPIOD
#define CONFIG_RESET_SWITCH_PIN 6
#endif /*ARRO_BOARD_H_*/

View File

@ -1,31 +0,0 @@
/**
* @file board.h
* Board configuration. Only general confuration, and including custom configs
*
* @date Nov 14, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
* @author frig
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BOARD_H_
#define BOARD_H_
#define EFI_BOARD_ARRO TRUE
#if EFI_BOARD_ARRO
#include "arro_board.h"
#endif
#endif /*BOARD_H_*/

View File

@ -1,136 +0,0 @@
/**
* @file efifeatures.h
*
* @brief In this header we can configure which firmware modules are used.
*
* @date Aug 29, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef EFIFEATURES_H_
#define EFIFEATURES_H_
#define EFI_USE_CCM TRUE
//#define EFI_UART_ECHO_TEST_MODE TRUE
#define EFI_USE_UART_FOR_CONSOLE FALSE
/**
* Build-in logic analyzer support. Logic analyzer viewer is one of the java console panes.
*/
#define EFI_WAVE_ANALYZER TRUE
//#define SERIAL_SPEED (8 * 115200)
//#define SERIAL_SPEED (2 * 115200)
#define SERIAL_SPEED 115200
/**
* TunerStudio support.
*/
#define EFI_TUNER_STUDIO TRUE
/**
* TunerStudio debug output
*/
#define EFI_TUNER_STUDIO_VERBOSE TRUE
#define EFI_DEFAILED_LOGGING FALSE
/**
* Dev console support.
*/
#define EFI_CLI_SUPPORT TRUE
#define EFI_INTERNAL_FLASH TRUE
/**
* Usually you need shaft position input, but maybe you do not need it?
*/
#define EFI_SHAFT_POSITION_INPUT TRUE
#define EFI_ANALOG_INPUTS TRUE
/**
* Maybe we are just sniffing what's going on?
*/
#define EFI_ENGINE_CONTROL TRUE
#define EFI_SPEED_DENSITY TRUE
/**
* MCP42010 digital potentiometer support. This could be useful if you are stimulating some
* stock ECU
*/
//#define EFI_POTENTIOMETER FALSE
#define EFI_POTENTIOMETER TRUE
#define EFI_INTERNAL_ADC TRUE
#define EFI_DENSO_ADC FALSE
#define EFI_CAN_SUPPORT FALSE
#define EFI_HD44780_LCD TRUE
#define EFI_IDLE_CONTROL TRUE
#define EFI_FUEL_PUMP TRUE
#define EFI_ENGINE_EMULATOR TRUE
#define EFI_EMULATE_POSITION_SENSORS TRUE
/**
* This macros is used to hide pieces of the code from unit tests, so it only makes sense in folders exposed to the tests project.
* This macros is NOT about taking out logging in general.
*/
#define EFI_PROD_CODE TRUE
/**
* Do we need Malfunction Indicator blinking logic?
*/
#define EFI_MALFUNCTIONAL_INDICATOR TRUE
/**
* Do we need file logging (like SD card) logic?
*/
#define EFI_FILE_LOGGING TRUE
/**
* While we embed multiple PnP configurations into the same firmware binary, these marcoses give us control
* over which configurations go into the binary
*/
#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_WAVE_CHART TRUE
#define EFI_HISTOGRAMS TRUE
#define EFI_ANALOG_CHART TRUE
#if defined __GNUC__
#define EFI_PERF_METRICS TRUE
#define DL_OUTPUT_BUFFER 9000
#else
#define EFI_PERF_METRICS FALSE
#define DL_OUTPUT_BUFFER 9000
#endif
/**
* Do we need GPS logic?
*/
#define EFI_UART_GPS TRUE
//#define EFI_UART_GPS FALSE
//#define EFI_ELECTRONIC_THROTTLE_BODY TRUE
#define EFI_ELECTRONIC_THROTTLE_BODY FALSE
#define EFI_MALFUNCTION_INDICATOR TRUE
//#define EFI_MALFUNCTION_INDICATOR FALSE
#define EFI_MAP_AVERAGING TRUE
//#define EFI_MAP_AVERAGING FALSE
#endif /* EFIFEATURES_H_ */

View File

@ -1,33 +0,0 @@
/**
* @file GY6_139QMB.cpp
* @brief 139qmb default engine configuration
*
* @date Feb 13, 2014
* @author rus084
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "main.h"
#include "GY6_139QMB.h"
void setGy6139qmbDefaultEngineConfiguration(engine_configuration_s *engineConfiguration) {
engineConfiguration->rpmHardLimit = 9000;
engineConfiguration->crankingSettings.crankingRpm = 800;
engineConfiguration->analogInputDividerCoefficient = 1.52;
engineConfiguration->algorithm = LM_MAP;
engineConfiguration->globalTriggerAngleOffset = 15;
engineConfiguration->analogChartMode = AC_MAP;
engineConfiguration->cylindersCount = 1;
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
engineConfiguration->firingOrder = FO_ONE_CYLINDER;
/**
* We treat the trigger as 1/0 toothed wheel
*/
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL;
engineConfiguration->triggerConfig.customTotalToothCount = 1;
engineConfiguration->triggerConfig.customSkippedToothCount = 0;
engineConfiguration->triggerConfig.customIsSynchronizationNeeded = false;
//todo engineConfiguration2->triggerShape.needSecondTriggerInput = false;
}

View File

@ -1,16 +0,0 @@
/*
* @file GY6_139QMB.h
*
* @date 13 feb 2014 y.
* @author rus084
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef GY6_139QMB_H_
#define GY6_139QMB_H_
#include "engine_configuration.h"
void setGy6139qmbDefaultEngineConfiguration(engine_configuration_s *engineConfiguration);
#endif /* GY6_139QMB_H_ */

View File

@ -1,15 +0,0 @@
/**
* @file MiniCooperR50.cpp
*
* MINI_COOPER_R50 = 13
*
* @date Apr 9, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "MiniCooperR50.h"
void setMiniCooperR50(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->triggerConfig.triggerType = TT_MINI_COOPER_R50;
}

View File

@ -1,16 +0,0 @@
/*
* @file MiniCooperR50.h
*
* @date Apr 9, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef MINICOOPERR50_H_
#define MINICOOPERR50_H_
#include "main.h"
#include "engine_configuration.h"
void setMiniCooperR50(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
#endif /* MINICOOPERR50_H_ */

View File

@ -1,47 +0,0 @@
/**
* @file audi_aan.cpp
* @brief Audo AAN default engine configuration
*
* @date Nov 24, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "main.h"
#if EFI_ENGINE_AUDI_AAN || defined(__DOXYGEN__)
#include "engine_controller.h"
extern engine_configuration2_s engineConfiguration2;
static void configureShaftPositionEmulatorShapeWhat(PwmConfig *state) {
/**
* One signal per cam shaft revolution
*/
int pinStates0[] = { 1, 0 };
float switchTimes[] = { 0.8, 1 };
int *pinStates[2] = { pinStates0 };
weComplexInit("distributor", state, 0, 2, switchTimes, 1, pinStates);
}
void setDefaultEngineConfiguration(EngineConfiguration *engineConfiguration) {
engineConfiguration2.shaftPositionEventCount = 2;
}
#endif /* EFI_ENGINE_AUDI_AAN */

View File

@ -1,16 +0,0 @@
/**
* @file audi_aan.h
* @brief Audo AAN default engine configuration
*
* @date Nov 24, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef AUDI_AAN_H_
#define AUDI_AAN_H_
#if EFI_ENGINE_AUDI_AAN
#endif /* EFI_ENGINE_AUDI_AAN */
#endif /* AUDI_AAN_H_ */

View File

@ -1,31 +0,0 @@
/**
* @file citroenBerlingoTU3JP.cpp
*
* CITROEN_TU3JP: engine_type 15
*
* This config overrides some values of the default configuration which is set by setDefaultConfiguration() method
*
*
* @date Apr 15, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "citroenBerlingoTU3JP.h"
void setCitroenBerlingoTU3JPConfiguration(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->engineType = CITROEN_TU3JP;
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL_60_2;
// set_cranking_injection_mode 0
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
// set_injection_mode 2
engineConfiguration->injectionMode = IM_BATCH;
// set_ignition_mode 2
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
// set_firing_order 2
engineConfiguration->firingOrder = FO_1_THEN_3_THEN_4_THEN2;
}

View File

@ -1,15 +0,0 @@
/**
* @file citroenBerlingoTU3JP.h
*
* @date Apr 15, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef CITROENBERLINGOTU3JP_H_
#define CITROENBERLINGOTU3JP_H_
#include "engine_configuration.h"
void setCitroenBerlingoTU3JPConfiguration(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
#endif /* CITROENBERLINGOTU3JP_H_ */

View File

@ -1,108 +0,0 @@
/**
* @file dodge_neon.cpp
*
* DODGE_NEON_1995 = 2
*
* This config overrides some values of the default configuration which is set by setDefaultConfiguration() method
*
* @date Dec 16, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "main.h"
#if EFI_SUPPORT_DODGE_NEON || defined(__DOXYGEN__)
#include "dodge_neon.h"
#include "engine_configuration.h"
#include "thermistors.h"
#include "engine_math.h"
void setDodgeNeonEngineConfiguration(engine_configuration_s *engineConfiguration,
board_configuration_s *boardConfiguration) {
engineConfiguration->triggerConfig.triggerType = TT_DODGE_NEON;
engineConfiguration->algorithm = LM_TPS;
// set_rpm_hard_limit 4000
engineConfiguration->rpmHardLimit = 4000; // yes, 4k. let's play it safe for now
// set_cranking_rpm 550
engineConfiguration->crankingSettings.crankingRpm = 550;
// since CLT is not wired up yet let's just use same value for min and max
// set_cranking_fuel_max 6 40
engineConfiguration->crankingSettings.coolantTempMaxC = 37.7; // 6ms at 37.7C
engineConfiguration->crankingSettings.fuelAtMaxTempMs = 6;
// set_cranking_fuel_min 6 -40
engineConfiguration->crankingSettings.coolantTempMinC = -40; // 6ms at -40C
engineConfiguration->crankingSettings.fuelAtMinTempMs = 6;
// set_whole_fuel_map 3
setWholeFuelMap(engineConfiguration, 3);
// set_cranking_injection_mode 0
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
// set_injection_mode 1
engineConfiguration->injectionMode = IM_SEQUENTIAL;
// set_ignition_mode 2
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
// set_firing_order 2
engineConfiguration->firingOrder = FO_1_THEN_3_THEN_4_THEN2;
// set_global_trigger_offset_angle 497
engineConfiguration->globalTriggerAngleOffset = 497;
// set_ignition_offset 350
engineConfiguration->ignitionOffset = 350;
// set_injection_offset 510
engineConfiguration->injectionOffset = 510;
// set_cranking_charge_angle 70
engineConfiguration->crankingChargeAngle = 7;
// set_cranking_timing_angle 0
engineConfiguration->crankingTimingAngle = 0;
// Frankenstein: low side - inj #1: PC14
// Frankenstein: low side - inj #2: PC15
// Frankenstein: low side - inj #3: PE6
// Frankenstein: low side - inj #4: PC13
// Frankenstein: low side - inj #5: PE4
// Frankenstein: low side - inj #6: PE5
// Frankenstein: low side - inj #7: PE2
// Frankenstein: low side - inj #8: PE3
// Frankenstein: low side - inj #9: PE0
// Frankenstein: low side - inj #10: PE1
// Frankenstein: low side - inj #11: PB8
// Frankenstein: low side - inj #12: PB9
boardConfiguration->injectionPins[0] = GPIOB_9; // Frankenstein: low side - inj #12
boardConfiguration->injectionPins[1] = GPIOB_8; // Frankenstein: low side - inj #11
boardConfiguration->injectionPins[2] = GPIOE_3; // Frankenstein: low side - inj #8
boardConfiguration->injectionPins[3] = GPIOE_5; // Frankenstein: low side - inj #6
boardConfiguration->fuelPumpPin = GPIOC_13; // Frankenstein: low side - inj #4
boardConfiguration->fuelPumpPinMode = OM_DEFAULT;
// set_injection_pin_mode 0
boardConfiguration->injectionPinMode = OM_DEFAULT;
// Frankenstein: high side #1: PE8
// Frankenstein: high side #2: PE10
boardConfiguration->ignitionPins[0] = GPIOE_8; // Frankenstein: high side #1
boardConfiguration->ignitionPins[1] = GPIO_NONE;
boardConfiguration->ignitionPins[2] = GPIOE_10; // // Frankenstein: high side #2
// set_ignition_pin_mode 0
boardConfiguration->ignitionPinMode = OM_DEFAULT;
setThermistorConfiguration(&engineConfiguration->cltThermistorConf, 0, 32500, 30, 7550, 100, 700);
engineConfiguration->cltThermistorConf.bias_resistor = 2700;
engineConfiguration->analogChartFrequency = 7;
}
#endif /* EFI_SUPPORT_DODGE_NEON */

View File

@ -1,21 +0,0 @@
/**
* @file dodge_neon.h
* @brief 1995 Dodge Neon default engine configuration
*
* @date Dec 16, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef DODGE_NEON_H_
#define DODGE_NEON_H_
#if EFI_SUPPORT_DODGE_NEON
#include "engine_configuration.h"
void setDodgeNeonEngineConfiguration(engine_configuration_s *engineConfiguration,
board_configuration_s *boardConfiguration);
#endif /* EFI_SUPPORT_DODGE_NEON */
#endif /* DODGE_NEON_H_ */

View File

@ -1,20 +0,0 @@
ENGINES_SRC =
ENGINES_SRC_CPP = $(PROJECT_DIR)/config/engines/ford_aspire.cpp \
$(PROJECT_DIR)/config/engines/MiniCooperR50.cpp \
$(PROJECT_DIR)/config/engines/audi_aan.cpp \
$(PROJECT_DIR)/config/engines/ford_escort_gt.cpp \
$(PROJECT_DIR)/config/engines/citroenBerlingoTU3JP.cpp \
$(PROJECT_DIR)/config/engines/dodge_neon.cpp \
$(PROJECT_DIR)/config/engines/ford_fiesta.cpp \
$(PROJECT_DIR)/config/engines/ford_1995_inline_6.cpp \
$(PROJECT_DIR)/config/engines/nissan_primera.cpp \
$(PROJECT_DIR)/config/engines/mazda_miata_nb.cpp \
$(PROJECT_DIR)/config/engines/honda_accord.cpp \
$(PROJECT_DIR)/config/engines/snow_blower.cpp \
$(PROJECT_DIR)/config/engines/GY6_139QMB.cpp \
$(PROJECT_DIR)/config/engines/rover_v8.cpp \
$(PROJECT_DIR)/config/engines/mazda_323.cpp \
$(PROJECT_DIR)/config/engines/saturn_ion.cpp \
$(PROJECT_DIR)/config/engines/mitsubishi.cpp

View File

@ -1,116 +0,0 @@
/**
* @file ford_1995_inline_6.cpp
* @brief Default engine configuration for a 1995 Ford inline 6 engine
*
* http://rusefi.com/forum/viewtopic.php?f=3&t=469
*
* This config overrides some values of the default configuration which is set by setDefaultConfiguration() method
*
* FORD_INLINE_6_1995 = 7
*
* @date Feb 12, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "main.h"
#include "ford_1995_inline_6.h"
#include "engine_math.h"
#include "allsensors.h"
#if EFI_SUPPORT_1995_FORD_INLINE_6 || defined(__DOXYGEN__)
/**
* @brief Default values for persistent properties
*/
void setFordInline6(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->cylindersCount = 6;
setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
engineConfiguration->ignitionMode = IM_ONE_COIL;
engineConfiguration->firingOrder = FO_1_THEN_5_THEN_3_THEN_6_THEN_2_THEN_4;
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
engineConfiguration->injectionMode = IM_BATCH;
/**
* 0.5ms dweel time just to be sure it would fit within camshaft revolution, dwell is not controlled by us anyway
*/
setConstantDwell(engineConfiguration, 0.5);
/**
* We treat the trigger as 6/0 toothed wheel
*/
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL;
engineConfiguration->triggerConfig.customTotalToothCount = 6;
engineConfiguration->triggerConfig.customSkippedToothCount = 0;
engineConfiguration->triggerConfig.customIsSynchronizationNeeded = false;
engineConfiguration->globalTriggerAngleOffset = 0;
engineConfiguration->ignitionOffset = 13;
setThermistorConfiguration(&engineConfiguration->cltThermistorConf, -10.0, 160310.0, 60.0, 7700.0, 120.0, 1180.0);
engineConfiguration->cltThermistorConf.bias_resistor = 2700;
setThermistorConfiguration(&engineConfiguration->iatThermistorConf, -10.0, 160310.0, 60.0, 7700.0, 120.0, 1180.0);
engineConfiguration->iatThermistorConf.bias_resistor = 2700;
// 12ch analog board pinout:
// input channel 3 is PA7, that's ADC7
// input channel 5 is PA4, that's ADC4
// input channel 6 is PA3, that's ADC3
// input channel 7 is PA2, that's ADC2
// input channel 8 is PA1, that's ADC1
// input channel 9 is PA0, that's ADC0
// input channel 10 is PC3, that's ADC13
// input channel 12 is PC1, that's ADC11
memset(boardConfiguration->adcHwChannelEnabled, 0, sizeof(boardConfiguration->adcHwChannelEnabled));
boardConfiguration->adcHwChannelEnabled[1] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[2] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[3] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[4] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[7] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[11] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[15] = ADC_FAST;
engineConfiguration->tpsAdcChannel = EFI_ADC_4;
engineConfiguration->iatAdcChannel = EFI_ADC_2;
engineConfiguration->cltAdcChannel = EFI_ADC_1;
engineConfiguration->afrSensor.afrAdcChannel = EFI_ADC_11;
engineConfiguration->map.sensor.sensorType = MT_MPX4250;
engineConfiguration->map.sensor.hwChannel = EFI_ADC_15;
engineConfiguration->baroSensor.sensorType = MT_MPX4250;
engineConfiguration->baroSensor.hwChannel = EFI_ADC_7;
// 6 channel output board
// output 1 is PB9
// output 3 is PE3
// output 5 is PC13
// output 6 is PC15
boardConfiguration->fuelPumpPin = GPIOC_13;
boardConfiguration->injectionPins[0] = GPIOB_9;
boardConfiguration->injectionPins[1] = GPIOE_3;
boardConfiguration->ignitionPins[0] = GPIOC_15;
boardConfiguration->injectionPins[2] = GPIO_NONE;
boardConfiguration->fanPin = GPIO_NONE;
engineConfiguration->tpsMin = convertVoltageTo10bitADC(1.250);
engineConfiguration->tpsMax = convertVoltageTo10bitADC(4.538);
// engineConfiguration->vBattAdcChannel = 0; //
// engineConfiguration->mafAdcChannel = 1;
boardConfiguration->triggerInputPins[0] = GPIOA_8;
boardConfiguration->triggerInputPins[1] = GPIOA_5;
boardConfiguration->logicAnalyzerPins[0] = GPIOC_6;
boardConfiguration->logicAnalyzerPins[1] = GPIOE_7;
}
#endif /* EFI_SUPPORT_1995_FORD_INLINE_6 */

View File

@ -1,15 +0,0 @@
/*
* @file ford_1995_inline_6.h
*
* @date Feb 12, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef FORD_1995_INLINE_6_H_
#define FORD_1995_INLINE_6_H_
#include "engine_configuration.h"
void setFordInline6(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
#endif /* FORD_1995_INLINE_6_H_ */

View File

@ -1,161 +0,0 @@
/**
* @file ford_aspire.cpp
* @brief 1996 Ford Aspire default engine configuration
*
* FORD_ASPIRE_1996 = 3
*
* @date Sep 9, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "main.h"
#include "ford_aspire.h"
#include "allsensors.h"
#include "engine_math.h"
#include "advance_map.h"
#include "engine_configuration.h"
#if EFI_SUPPORT_FORD_ASPIRE || defined(__DOXYGEN__)
/**
* This is just the default map which is stored into flash memory in case flash is empty
* The convenient way to override these default would be to tune this map using TunerStudio software
* with which rusEfi is integrated
*/
static float default_fuel_table[FUEL_LOAD_COUNT][FUEL_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 */{ 1.542000, 1.547600, 1.551867, 1.570000, 1.550000, 0.908666, 0.794800, 0.775200, 0.791733, 0.800000, 0.798667, 0.805733, 0.810000, 0.810000, 0.810000, 0.810000},
/* Load 1.413333 */{ 1.532133, 1.565325, 1.551244, 1.552773, 1.546018, 0.802089, 0.810000, 0.788507, 0.808898, 0.744987, 0.701378, 0.711404, 0.744667, 0.810000, 0.810000, 0.810000},
/* Load 1.626667 */{ 1.543600, 1.545573, 1.555956, 1.545973, 1.415333, 0.115288, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000},
/* Load 1.840000 */{ 1.538800, 1.741893, 1.558426, 1.591440, 1.228773, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000},
/* Load 2.053333 */{ 2.322933, 3.439928, 2.818523, 2.242266, 2.125839, 1.194041, 0.488959, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000},
/* Load 2.266667 */{ 7.696667, 5.957510, 4.700978, 3.879200, 3.099600, 2.403111, 2.458666, 1.790979, 2.190533, 2.074667, 1.368887, 1.287556, 0.000000, 0.000000, 0.000000, 0.000000},
/* Load 2.480000 */{ 14.330001, 8.710773, 6.558134, 5.491520, 5.117494, 4.308798, 3.185521, 3.339520, 2.883200, 2.840399, 2.643334, 2.505092, 2.296640, 0.000000, 0.000000, 0.000000},
/* Load 2.693333 */{ 21.354004, 15.415981, 10.953371, 8.779520, 5.866481, 5.038577, 5.113254, 4.395565, 4.537200, 3.559386, 3.828622, 3.147404, 3.377706, 2.780000, 2.780000, 2.780000},
/* Load 2.906667 */{ 20.020401, 16.311201, 17.209972, 15.600482, 10.950183, 7.773465, 6.243252, 7.400613, 6.672044, 6.133946, 5.529999, 4.769466, 4.528134, 4.010000, 4.010000, 4.010000},
/* Load 3.120000 */{ 18.264000, 15.464134, 15.595227, 15.395760, 12.987042, 13.339199, 8.897678, 8.927333, 8.032880, 6.769040, 5.823335, 6.413146, 6.089281, 5.730000, 5.730000, 5.730000},
/* Load 3.333333 */{ 17.414667, 15.366401, 15.187378, 15.338401, 15.306623, 15.386889, 14.470800, 11.941733, 10.985557, 9.956400, 9.019111, 8.441555, 7.515199, 6.900000, 6.900000, 6.900000},
/* Load 3.546667 */{ 17.005333, 15.372302, 15.188160, 15.278268, 15.325876, 15.561645, 15.638906, 15.415441, 13.630393, 10.918774, 11.508314, 10.660010, 9.551816, 9.230000, 9.230000, 9.230000},
/* Load 3.760000 */{ 16.978800, 15.360346, 15.170587, 15.301680, 15.331520, 15.684401, 15.810480, 15.702454, 15.828107, 15.114964, 14.666001, 11.908847, 12.046723, 9.230000, 9.230000, 9.230000},
/* Load 3.973333 */{ 16.975599, 15.343084, 15.305715, 15.287172, 15.288801, 15.484089, 15.928854, 15.780366, 15.669041, 15.836693, 16.123335, 15.054674, 14.972587, 14.610000, 14.610000, 14.610000},
/* Load 4.186667 */{ 16.961868, 15.368391, 15.210348, 15.290641, 15.263707, 15.485778, 15.827333, 15.802435, 15.677885, 15.827120, 15.997155, 16.027468, 15.478480, 15.190000, 15.190000, 15.190000},
/* Load 4.400000 */{ 17.010000, 15.250000, 15.680000, 15.440000, 15.270000, 15.470000, 15.800000, 15.730000, 15.600000, 15.790000, 16.120001, 16.110001, 15.630000, 15.150000, 15.150000, 15.150000}
};
static float default_timing_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}
};
static void setDefaultMaps(engine_configuration_s *engineConfiguration) {
setFuelLoadBin(engineConfiguration, 1.2, 4.4);
setFuelRpmBin(engineConfiguration, 800, 7000);
setTimingLoadBin(engineConfiguration, 1.2, 4.4);
setTimingRpmBin(engineConfiguration, 800, 7000);
for (int k = 0; k < FUEL_LOAD_COUNT; k++) {
for (int r = 0; r < FUEL_RPM_COUNT; r++) {
engineConfiguration->fuelTable[k][r] = default_fuel_table[k][r];
}
}
for (int k = 0; k < AD_LOAD_COUNT; k++) {
for (int r = 0; r < AD_RPM_COUNT; r++) {
engineConfiguration->ignitionTable[k][r] = default_timing_table[k][r];
}
}
}
void setFordAspireEngineConfiguration(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->tpsMin = 100;
engineConfiguration->tpsMax = 750;
engineConfiguration->rpmHardLimit = 7000;
/**
* 18K Ohm @ -20C
* 2.1K Ohm @ 24C
* 1K Ohm @ 49C
*/
setThermistorConfiguration(&engineConfiguration->cltThermistorConf, -20, 18000, 23.8889, 2100, 48.8889, 1000);
engineConfiguration->cltThermistorConf.bias_resistor = 3300; // that's my custom resistor value!
engineConfiguration->crankingSettings.coolantTempMaxC = 65; // 8ms at 65C
engineConfiguration->crankingSettings.fuelAtMaxTempMs = 8;
engineConfiguration->crankingSettings.coolantTempMinC = 0; // 20ms at 0C
engineConfiguration->crankingSettings.fuelAtMinTempMs = 15;
// engineConfiguration->ignitionPinMode = OM_INVERTED;
engineConfiguration->cylindersCount = 4;
engineConfiguration->displacement = 1.3;
// Denso 195500-2110
engineConfiguration->injectorFlow = 119.8;
engineConfiguration->firingOrder = FO_1_THEN_3_THEN_4_THEN2;
engineConfiguration->globalTriggerAngleOffset = 175;
engineConfiguration->ignitionOffset = 98 - 11;
engineConfiguration->injectionOffset = 59;
setDefaultMaps(engineConfiguration);
// set_cranking_rpm 550
engineConfiguration->crankingSettings.crankingRpm = 550;
// set_cranking_charge_angle 70
engineConfiguration->crankingChargeAngle = 70;
// set_cranking_timing_angle 37
engineConfiguration->crankingTimingAngle = 37;
setSingleCoilDwell(engineConfiguration);
engineConfiguration->ignitionMode = IM_ONE_COIL;
engineConfiguration->triggerConfig.triggerType = TT_FORD_ASPIRE;
boardConfiguration->injectionPins[4] = GPIO_NONE;
boardConfiguration->injectionPins[5] = GPIO_NONE;
engineConfiguration->HD44780width = 20;
engineConfiguration->HD44780height = 4;
// Frankenstein analog input #1: adc1
// Frankenstein analog input #2: adc3
// Frankenstein analog input #3: adc13
// Frankenstein analog input #4: adc11
// Frankenstein analog input #5: adc
// Frankenstein analog input #6: adc
// Frankenstein analog input #7: adc
// Frankenstein analog input #8: adc
// Frankenstein analog input #9: adc
// Frankenstein analog input #10: adc
// Frankenstein analog input #11: adc
// Frankenstein analog input #12: adc
engineConfiguration->tpsAdcChannel = EFI_ADC_3;
engineConfiguration->vBattAdcChannel = EFI_ADC_0;
engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
engineConfiguration->mafAdcChannel = EFI_ADC_1;
engineConfiguration->cltAdcChannel = EFI_ADC_11;
// engineConfiguration->iatAdcChannel =
engineConfiguration->map.sensor.sensorType = MT_DENSO183;
}
#endif /* EFI_SUPPORT_FORD_ASPIRE */

View File

@ -1,19 +0,0 @@
/**
* @file ford_aspire.h
* @brief 1996 Ford Aspire default engine configuration
*
* @date Aug 30, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*
* http://rusefi.com/forum/viewtopic.php?t=375
*
*/
#ifndef FORD_ASPIRE_H_
#define FORD_ASPIRE_H_
#include "engine_configuration.h"
void setFordAspireEngineConfiguration(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
#endif /* FORD_ASPIRE_H_ */

View File

@ -1,162 +0,0 @@
/**
* @file ford_escort_gt.cpp
*
* FORD_ESCORT_GT = 14
*
* @date Apr 11, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "ford_escort_gt.h"
#include "engine_math.h"
static void setDefaultCrankingFuel(engine_configuration_s *engineConfiguration) {
// todo: set cranking parameters method based on injectors and displacement?
// since CLT is not wired up yet let's just use same value for min and max
// set_cranking_fuel_max 6 40
engineConfiguration->crankingSettings.coolantTempMaxC = 37.7; // 6ms at 37.7C
engineConfiguration->crankingSettings.fuelAtMaxTempMs = 6;
// set_cranking_fuel_min 6 -40
engineConfiguration->crankingSettings.coolantTempMinC = -40; // 6ms at -40C
engineConfiguration->crankingSettings.fuelAtMinTempMs = 6;
}
static void common079721_2351(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->cylindersCount = 4;
engineConfiguration->firingOrder = FO_1_THEN_3_THEN_4_THEN2;
boardConfiguration->fuelPumpPin = GPIO_NONE; // fuel pump is not controlled by ECU on this engine
// set_cranking_injection_mode 0
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
// set_injection_mode 2
engineConfiguration->injectionMode = IM_BATCH;
// Frankenstein analog input #1: adc1
// Frankenstein analog input #2: adc3
// Frankenstein analog input #3: adc13
// Frankenstein analog input #4: adc11
// Frankenstein analog input #5: adc
// Frankenstein analog input #6: adc
// Frankenstein analog input #7: adc
// Frankenstein analog input #8: adc
// Frankenstein analog input #9: adc
// Frankenstein analog input #10: adc
// Frankenstein analog input #11: adc
// Frankenstein analog input #12: adc
engineConfiguration->mafAdcChannel = EFI_ADC_1;
engineConfiguration->tpsAdcChannel = EFI_ADC_3;
engineConfiguration->cltAdcChannel = EFI_ADC_11;
}
void setMiata1990(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->triggerConfig.triggerType = TT_FORD_ESCORT_GT;
common079721_2351(engineConfiguration, boardConfiguration);
// Frankenstein: high side #1 is PE8
// Frankenstein: high side #2 is PE10
// Frankenstein: high side #3 is PE12
// Frankenstein: high side #4 is PE14
// Frankenstein: high side #5 is PC9
// Frankenstein: high side #6 is PC7
boardConfiguration->ignitionPins[0] = GPIOE_12; // Frankenstein: high side #3
boardConfiguration->ignitionPins[1] = GPIOE_14; // Frankenstein: high side #4
boardConfiguration->ignitionPins[2] = GPIO_NONE;
boardConfiguration->ignitionPins[3] = GPIO_NONE;
boardConfiguration->ignitionPinMode = OM_DEFAULT;
// Frankenstein: low side - inj #1: PC14
// Frankenstein: low side - inj #2: PC15
// Frankenstein: low side - inj #3: PE6
// Frankenstein: low side - inj #4: PC13
// Frankenstein: low side - inj #5: PE4
// Frankenstein: low side - inj #6: PE5
// Frankenstein: low side - inj #7: PE2
// Frankenstein: low side - inj #8: PE3
// Frankenstein: low side - inj #9: PE0
// Frankenstein: low side - inj #10: PE1
// Frankenstein: low side - inj #11: PB8
// Frankenstein: low side - inj #12: PB9
boardConfiguration->injectionPins[0] = GPIOB_9; // Frankenstein: low side - inj #12
boardConfiguration->injectionPins[1] = GPIOB_8; // Frankenstein: low side - inj #11
boardConfiguration->injectionPins[2] = GPIO_NONE;
boardConfiguration->injectionPins[3] = GPIO_NONE;
boardConfiguration->injectionPins[4] = GPIO_NONE;
boardConfiguration->injectionPins[5] = GPIO_NONE;
boardConfiguration->injectionPinMode = OM_DEFAULT;
// todo: idleValvePin
}
void setFordEscortGt(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->triggerConfig.triggerType = TT_FORD_ESCORT_GT;
common079721_2351(engineConfiguration, boardConfiguration);
// set_global_trigger_offset_angle 256
engineConfiguration->globalTriggerAngleOffset = 256;
// set_ignition_offset 170
engineConfiguration->ignitionOffset = 170;
// set_injection_offset 510
engineConfiguration->injectionOffset = 59;
setSingleCoilDwell(engineConfiguration);
engineConfiguration->ignitionMode = IM_ONE_COIL;
boardConfiguration->triggerSimulatorPinModes[0] = OM_OPENDRAIN;
boardConfiguration->triggerSimulatorPinModes[1] = OM_OPENDRAIN;
// Frankenstein: high side #1 is PE8
// Frankenstein: high side #2 is PE10
// Frankenstein: high side #3 is PE12
// Frankenstein: high side #4 is PE14
// Frankenstein: high side #5 is PC9
// Frankenstein: high side #6 is PC7
boardConfiguration->ignitionPins[0] = GPIOE_12; // Frankenstein: high side #3
boardConfiguration->ignitionPins[1] = GPIO_NONE;
boardConfiguration->ignitionPins[2] = GPIO_NONE;
boardConfiguration->ignitionPins[3] = GPIO_NONE;
boardConfiguration->ignitionPinMode = OM_DEFAULT;
// set_whole_fuel_map 3
setWholeFuelMap(engineConfiguration, 3);
setDefaultCrankingFuel(engineConfiguration);
}
/**
* set_engine_type 20
*/
void setMiata1994(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->triggerConfig.triggerType = TT_MAZDA_MIATA_NA;
engineConfiguration->displacement = 1.839;
boardConfiguration->triggerSimulatorPins[0] = GPIOD_2; // 2G - YEL/BLU
boardConfiguration->triggerSimulatorPins[1] = GPIOB_3; // 2E - WHT - four times
boardConfiguration->triggerSimulatorPinModes[0] = OM_OPENDRAIN;
boardConfiguration->triggerSimulatorPinModes[1] = OM_OPENDRAIN;
boardConfiguration->triggerInputPins[0] = GPIO_NONE;
boardConfiguration->triggerInputPins[1] = GPIO_NONE;
boardConfiguration->is_enabled_spi_1 = false;
boardConfiguration->is_enabled_spi_2 = false;
boardConfiguration->is_enabled_spi_3 = false;
setDefaultCrankingFuel(engineConfiguration);
}
void setMiata1996(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
setDefaultCrankingFuel(engineConfiguration);
}

View File

@ -1,23 +0,0 @@
/**
* @file ford_escort_gt.h
* @brief 1993 Ford Escort GT engine configuration. The US Escort.
*
* @date Oct 31, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*
* http://rusefi.com/forum/viewtopic.php?t=537
* Injectors: Denso 195500-2180, 230-265cc (?), tan, 13.9 ohms
*/
#ifndef FORD_ESCORT_GT_H_
#define FORD_ESCORT_GT_H_
#include "engine_configuration.h"
void setFordEscortGt(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
// todo: maybe it's time to rename this file to Miata NA? Miata? Mazda?
void setMiata1990(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
void setMiata1994(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
void setMiata1996(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
#endif /* FORD_ESCORT_GT_H_ */

View File

@ -1,29 +0,0 @@
/**
* @file ford_fiesta.cpp
* @brief European 1990 Ford Fiesta
*
* FORD_FIESTA = 4
*
* @date Nov 22, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "main.h"
#if EFI_SUPPORT_FORD_FIESTA || defined(__DOXYGEN__)
#include "ford_fiesta.h"
#include "engine_configuration.h"
#include "engine_math.h"
void setFordFiestaDefaultEngineConfiguration(engine_configuration_s *engineConfiguration) {
engineConfiguration->rpmHardLimit = 7000;
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL_36_1;
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
engineConfiguration->firingOrder = FO_1_THEN_3_THEN_4_THEN2;
}
#endif /* EFI_SUPPORT_FORD_FIESTA */

View File

@ -1,17 +0,0 @@
/**
* @file ford_fiesta.h
*
* @date Nov 22, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef FORD_FIESTA_H_
#define FORD_FIESTA_H_
#if EFI_SUPPORT_FORD_FIESTA || defined(__DOXYGEN__)
#include "engine_configuration.h"
void setFordFiestaDefaultEngineConfiguration(engine_configuration_s *engineConfiguration);
#endif /* EFI_SUPPORT_FORD_FIESTA */
#endif /* FORD_FIESTA_H_ */

View File

@ -1,203 +0,0 @@
/**
* @file honda_accord.cpp
*
* 1995 Honda Accord EX
* http://rusefi.com/wiki/index.php?title=Vehicle:Honda_Accord_1995
* http://rusefi.com/forum/viewtopic.php?f=3&t=621
*
* engine_type 6
* engine_type 17
*
* @date Jan 12, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "main.h"
#include "trigger_decoder.h"
#include "thermistors.h"
#include "honda_accord.h"
#include "engine_math.h"
static void setHondaAccordConfigurationCommon(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->map.sensor.sensorType = MT_DENSO183;
engineConfiguration->ignitionMode = IM_ONE_COIL;
engineConfiguration->injectionMode = IM_BATCH;
engineConfiguration->idleMode = IM_MANUAL;
engineConfiguration->HD44780height = 4;
engineConfiguration->cylindersCount = 4;
engineConfiguration->displacement = 2.156;
// Keihin 06164-P0A-A00
engineConfiguration->injectorFlow = 248;
// engineConfiguration->algorithm = LM_SPEED_DENSITY;
// I want to start with a simple Alpha-N
engineConfiguration->algorithm = LM_TPS;
setFuelLoadBin(engineConfiguration, 0, 100);
setTimingLoadBin(engineConfiguration, 0, 100);
engineConfiguration->crankingSettings.coolantTempMaxC = 65; // 8ms at 65C
engineConfiguration->crankingSettings.fuelAtMaxTempMs = 8;
engineConfiguration->crankingSettings.coolantTempMinC = 0; // 20ms at 0C
engineConfiguration->crankingSettings.fuelAtMinTempMs = 15;
/**
* 18K Ohm @ -20C
* 2.1K Ohm @ 24C
* 100 Ohm @ 120C
*/
setThermistorConfiguration(&engineConfiguration->cltThermistorConf, -20.0, 18000.0, 23.8889, 2100.0, 120.0, 100.0);
engineConfiguration->cltThermistorConf.bias_resistor = 1500; // same as OEM ECU
setThermistorConfiguration(&engineConfiguration->iatThermistorConf, -20.0, 18000.0, 23.8889, 2100.0, 120.0, 100.0);
engineConfiguration->iatThermistorConf.bias_resistor = 1500; // same as OEM ECU
// set_cranking_charge_angle 35
engineConfiguration->crankingChargeAngle = 70;
// set_cranking_timing_angle 0
engineConfiguration->crankingTimingAngle = 45;
// set_global_trigger_offset_angle 34
engineConfiguration->globalTriggerAngleOffset = 34;
// set_rpm_hard_limit 4000
engineConfiguration->rpmHardLimit = 4000; // yes, 4k. let's play it safe for now
// set_cranking_rpm 2000
engineConfiguration->crankingSettings.crankingRpm = 500;
// set_ignition_offset 350
// engineConfiguration->ignitionOffset = 350;
// set_injection_offset 510
// engineConfiguration->injectionOffset = 510;
/**
* ADC inputs:
*
* Inp1/ADC12 PC2: CLT
* Inp2/ADC11 PC1: AIT/IAT
* Inp3/ADC0 PA0: MAP
* Inp4/ADC13 PC3: AFR
* Inp6/ADC1 PA1: TPS
* Inp12/ADC14 PC4: VBatt
*/
memset(boardConfiguration->adcHwChannelEnabled, 0, sizeof(boardConfiguration->adcHwChannelEnabled));
boardConfiguration->adcHwChannelEnabled[0] = ADC_FAST; // ADC0 - PA0 - MAP
boardConfiguration->adcHwChannelEnabled[1] = ADC_SLOW; // TPS
boardConfiguration->adcHwChannelEnabled[2] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[3] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[4] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[6] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[11] = ADC_SLOW; // IAT
boardConfiguration->adcHwChannelEnabled[12] = ADC_SLOW; // CLT
boardConfiguration->adcHwChannelEnabled[13] = ADC_SLOW; // AFR
boardConfiguration->adcHwChannelEnabled[14] = ADC_SLOW; // VBatt
/**
* D14/W10 O2 Sensor
*/
engineConfiguration->afrSensor.afrAdcChannel = EFI_ADC_13;
/**
* VBatt
*/
engineConfiguration->vBattAdcChannel = EFI_ADC_14;
engineConfiguration->vbattDividerCoeff = ((float) (8.2 + 33)) / 8.2 * 2;
// todo engineConfiguration->afrSensor.afrAdcChannel = 14;
/**
* MAP D17/W5
*/
engineConfiguration->map.sensor.hwChannel = EFI_ADC_0;
/**
* TPS D11/W11
*/
engineConfiguration->tpsAdcChannel = EFI_ADC_1;
/**
* IAT D15/W7
*/
engineConfiguration->iatAdcChannel = EFI_ADC_11;
/**
* CLT D13/W9
*/
engineConfiguration->cltAdcChannel = EFI_ADC_12;
/**
* Outputs
*/
// Frankenso low out #:
// Frankenso low out #:
// Frankenso low out #:
// Frankenso low out #:
// Frankenso low out #5: PE3
// Frankenso low out #6: PE4
// Frankenso low out #7: PE1 (do not use with discovery!)
// Frankenso low out #:
// Frankenso low out #9: PB9
// Frankenso low out #10: PE0 (do not use with discovery!)
// Frankenso low out #11: PB8
// Frankenso low out #12: PB7
boardConfiguration->idleValvePin = GPIOE_5;
boardConfiguration->o2heaterPin = GPIOC_13;
boardConfiguration->injectionPins[0] = GPIOB_8;
boardConfiguration->injectionPins[1] = GPIOB_9;
boardConfiguration->injectionPins[2] = GPIOE_1;
boardConfiguration->injectionPins[3] = GPIOB_7;
boardConfiguration->ignitionPins[0] = GPIOE_4;
boardConfiguration->ignitionPins[1] = GPIO_NONE;
boardConfiguration->ignitionPins[2] = GPIO_NONE;
boardConfiguration->ignitionPins[3] = GPIO_NONE;
boardConfiguration->fuelPumpPin = GPIOE_3;
boardConfiguration->fuelPumpPinMode = OM_DEFAULT;
boardConfiguration->gps_rx_pin = GPIO_NONE;
boardConfiguration->gps_tx_pin = GPIO_NONE;
boardConfiguration->HD44780_rs = GPIOE_7;
boardConfiguration->HD44780_e = GPIOE_9;
boardConfiguration->HD44780_db4 = GPIOE_11;
boardConfiguration->HD44780_db5 = GPIOE_13;
boardConfiguration->HD44780_db6 = GPIOE_15;
boardConfiguration->HD44780_db7 = GPIOB_10;
boardConfiguration->logicAnalyzerPins[1] = GPIO_NONE;
boardConfiguration->idleSolenoidFrequency = 500;
}
void setHondaAccordConfigurationTwoWires(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->engineType = HONDA_ACCORD_CD_TWO_WIRES;
engineConfiguration->triggerConfig.triggerType = TT_HONDA_ACCORD_CD_TWO_WIRES;
setHondaAccordConfigurationCommon(engineConfiguration, boardConfiguration);
}
void setHondaAccordConfigurationThreeWires(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->engineType = HONDA_ACCORD_CD;
engineConfiguration->triggerConfig.triggerType = TT_HONDA_ACCORD_CD;
setHondaAccordConfigurationCommon(engineConfiguration, boardConfiguration);
}
void setHondaAccordConfigurationDip(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->engineType = HONDA_ACCORD_CD_DIP;
engineConfiguration->triggerConfig.triggerType = TT_HONDA_ACCORD_CD_DIP;
setHondaAccordConfigurationCommon(engineConfiguration, boardConfiguration);
}

View File

@ -1,17 +0,0 @@
/**
* @file honda_accord.h
*
* @date Jan 12, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef HONDA_ACCORD_H_
#define HONDA_ACCORD_H_
#include "engine_configuration.h"
void setHondaAccordConfigurationTwoWires(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
void setHondaAccordConfigurationThreeWires(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
void setHondaAccordConfigurationDip(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
#endif /* HONDA_ACCORD_H_ */

View File

@ -1,20 +0,0 @@
/**
* @file mazda_323.cpp
*
* @date Mar 8, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "mazda_323.h"
void setMazda323EngineConfiguration(engine_configuration_s *engineConfiguration) {
engineConfiguration->cylindersCount = 4;
engineConfiguration->displacement = 1.6;
engineConfiguration->ignitionMode = IM_ONE_COIL;
/**
* We treat the trigger as 4/0 toothed wheel
*/
// setToothedWheelConfiguration(engineConfiguration, 4, 0);
}

View File

@ -1,21 +0,0 @@
/**
* @file mazda_323.h
*
* 90-94 Mazda 323 (1.6l SOHC)
* 90-93 Ford Festiva (1.3l SOHC)
*
* http://rusefi.com/forum/viewtopic.php?f=3&t=498
*
* @date Mar 8, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef MAZDA_323_H_
#define MAZDA_323_H_
#include "main.h"
#include "engine_configuration.h"
void setMazda323EngineConfiguration(engine_configuration_s *engineConfiguration);
#endif /* MAZDA_323_H_ */

View File

@ -1,79 +0,0 @@
/**
* @file mazda_miata_nb.cpp
*
* MAZDA_MIATA_NB = 9
*
* @date Feb 18, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "mazda_miata_nb.h"
#include "thermistors.h"
void setMazdaMiataNbEngineConfiguration(engine_configuration_s *engineConfiguration,
board_configuration_s *boardConfiguration) {
// set_rpm_hard_limit 3000
engineConfiguration->rpmHardLimit = 3000; // yes, 3k. let's play it safe for now
engineConfiguration->triggerConfig.triggerType = TT_MAZDA_MIATA_NB;
engineConfiguration->globalTriggerAngleOffset = 276;
// set_cranking_injection_mode 0
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
// set_injection_mode 1
engineConfiguration->injectionMode = IM_SEQUENTIAL;
// set_ignition_mode 2
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
// set_firing_order 2
engineConfiguration->firingOrder = FO_1_THEN_3_THEN_4_THEN2;
setThermistorConfiguration(&engineConfiguration->cltThermistorConf, 0, 32500, 30, 7550, 100, 700);
engineConfiguration->cltThermistorConf.bias_resistor = 2700;
setThermistorConfiguration(&engineConfiguration->iatThermistorConf, -10, 160310, 60, 7700, 120.00, 1180);
engineConfiguration->iatThermistorConf.bias_resistor = 2700;
engineConfiguration->tpsAdcChannel = EFI_ADC_3; // 15 is the old value
engineConfiguration->vBattAdcChannel = EFI_ADC_0; // 1 is the old value
// engineConfiguration->map.channel = 1;
engineConfiguration->mafAdcChannel = EFI_ADC_1;
engineConfiguration->cltAdcChannel = EFI_ADC_11;
engineConfiguration->iatAdcChannel = EFI_ADC_13;
engineConfiguration->afrSensor.afrAdcChannel = EFI_ADC_2;
boardConfiguration->idleValvePin = GPIOE_0;
boardConfiguration->idleValvePinMode = OM_DEFAULT;
boardConfiguration->fuelPumpPin = GPIOC_14; // Frankenstein: low side - inj #4
boardConfiguration->fuelPumpPinMode = OM_DEFAULT;
boardConfiguration->injectionPins[0] = GPIOB_9; // Frankenstein: low side - inj #12
boardConfiguration->injectionPins[1] = GPIOB_8; // Frankenstein: low side - inj #11
boardConfiguration->injectionPins[2] = GPIOE_3; // Frankenstein: low side - inj #8
boardConfiguration->injectionPins[3] = GPIOE_5; // Frankenstein: low side - inj #6
boardConfiguration->injectionPins[4] = GPIO_NONE;
boardConfiguration->injectionPins[5] = GPIO_NONE;
boardConfiguration->injectionPinMode = OM_DEFAULT;
boardConfiguration->ignitionPins[0] = GPIOE_10; // Frankenstein: high side #1
boardConfiguration->ignitionPins[1] = GPIO_NONE;
boardConfiguration->ignitionPins[2] = GPIOC_9; // // Frankenstein: high side #2
boardConfiguration->ignitionPins[3] = GPIO_NONE;
boardConfiguration->ignitionPinMode = OM_INVERTED;
boardConfiguration->malfunctionIndicatorPin = GPIOE_1;
boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;
boardConfiguration->fanPin = GPIOE_6;
boardConfiguration->fanPinMode = OM_DEFAULT;
boardConfiguration->electronicThrottlePin1 = GPIO_NONE;
boardConfiguration->idleSwitchPin = GPIO_NONE;
// set_whole_fuel_map 3
setWholeFuelMap(engineConfiguration, 3);
// 10 deg before TDC is default timing
}

View File

@ -1,16 +0,0 @@
/**
* @file mazda_miata_nb.h
*
* @date Feb 18, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef MAZDA_MIATA_NB_H_
#define MAZDA_MIATA_NB_H_
#include "main.h"
#include "engine_configuration.h"
void setMazdaMiataNbEngineConfiguration(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
#endif /* MAZDA_MIATA_NB_H_ */

View File

@ -1,97 +0,0 @@
/**
* @file mitsubishi.cpp
*
* MITSU_4G93 16
*
* @date Aug 5, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "mitsubishi.h"
#include "allsensors.h"
void setMitsubishiConfiguration(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
engineConfiguration->engineType = MITSU_4G93;
engineConfiguration->triggerConfig.triggerType = TT_MITSU;
engineConfiguration->cylindersCount = 4;
engineConfiguration->displacement = 1.800;
// set_ignition_mode 2
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
engineConfiguration->firingOrder = FO_1_THEN_3_THEN_4_THEN2;
// set_global_trigger_offset_angle 671
engineConfiguration->globalTriggerAngleOffset = 671;
// set_cranking_rpm 550
engineConfiguration->crankingSettings.crankingRpm = 550;
// set_cranking_charge_angle 70
engineConfiguration->crankingChargeAngle = 70;
// set_cranking_timing_angle 715
engineConfiguration->crankingTimingAngle = 715;
// set_whole_fuel_map 3
setWholeFuelMap(engineConfiguration, 3);
// since CLT is not wired up yet let's just use same value for min and max
// set_cranking_fuel_max 6 40
engineConfiguration->crankingSettings.coolantTempMaxC = 37.7; // 6ms at 37.7C
engineConfiguration->crankingSettings.fuelAtMaxTempMs = 6;
// set_cranking_fuel_min 6 -40
engineConfiguration->crankingSettings.coolantTempMinC = -40; // 6ms at -40C
engineConfiguration->crankingSettings.fuelAtMinTempMs = 6;
// /**
// * 29150 Ohm @ 40C
// * 10160 Ohm @ 70C
// * 1270 Ohm @ 150C
// */
// setThermistorConfiguration(&engineConfiguration->cltThermistorConf, 40, 29150, 70, 10160, 150, 1270);
/**
* 18K Ohm @ -20C
* 2.1K Ohm @ 24C
* 294 Ohm @ 80C
* http://www.rexbo.eu/hella/coolant-temperature-sensor-6pt009107121?c=100334&at=3130
*/
setThermistorConfiguration(&engineConfiguration->cltThermistorConf, -20, 18000, 23.8889, 2100, 80, 294);
engineConfiguration->cltThermistorConf.bias_resistor = 2700;
// Frankenstein: low side - inj #1: PC14
// Frankenstein: low side - inj #2: PC15
// Frankenstein: low side - inj #3: PE6
// Frankenstein: low side - inj #4: PC13
// Frankenstein: low side - inj #5: PE4
// Frankenstein: low side - inj #6: PE5
// Frankenstein: low side - inj #7: PE2
// Frankenstein: low side - inj #8: PE3
// Frankenstein: low side - inj #9: PE0
// Frankenstein: low side - inj #10: PE1
// Frankenstein: low side - inj #11: PB8
// Frankenstein: low side - inj #12: PB9
boardConfiguration->injectionPins[0] = GPIOB_9; // Frankenstein: low side - inj #12
boardConfiguration->injectionPins[1] = GPIOB_8; // Frankenstein: low side - inj #11
boardConfiguration->injectionPins[2] = GPIOE_3; // Frankenstein: low side - inj #8
boardConfiguration->injectionPins[3] = GPIOE_5; // Frankenstein: low side - inj #6
// Frankenstein: high side #1: PE8
// Frankenstein: high side #2: PE10
boardConfiguration->ignitionPins[0] = GPIOE_8; // Frankenstein: high side #1
boardConfiguration->ignitionPins[1] = GPIO_NONE;
boardConfiguration->ignitionPins[2] = GPIOE_10; // // Frankenstein: high side #2
boardConfiguration->ignitionPins[3] = GPIO_NONE;
engineConfiguration->HD44780width = 20;
engineConfiguration->HD44780height = 4;
initEgoSensor(&engineConfiguration->afrSensor, ES_Innovate_MTX_L);
}

View File

@ -1,16 +0,0 @@
/**
* @file mitsubishi.h
*
* @date Aug 5, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef MITSUBISHI_H_
#define MITSUBISHI_H_
#include "main.h"
#include "engine_configuration.h"
void setMitsubishiConfiguration(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
#endif /* MITSUBISHI_H_ */

View File

@ -1,19 +0,0 @@
/**
* @file nissan_primera.cpp
*
* engine_type 5
*
* @date Oct 14, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "main.h"
#if EFI_SUPPORT_NISSAN_PRIMERA || defined(__DOXYGEN__)
#include "nissan_primera.h"
void setNissanPrimeraEngineConfiguration(engine_configuration_s *engineConfiguration) {
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL_60_2;
}
#endif /* EFI_SUPPORT_NISSAN_PRIMERA */

View File

@ -1,21 +0,0 @@
/**
* @file nissan_primera.h
*
* @date Oct 14, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "efifeatures.h"
#ifndef NISSAN_PRIMERA_H_
#define NISSAN_PRIMERA_H_
#if EFI_SUPPORT_NISSAN_PRIMERA
#include "engine_configuration.h"
void setNissanPrimeraEngineConfiguration(engine_configuration_s *engineConfiguration);
#endif /* EFI_SUPPORT_NISSAN_PRIMERA */
#endif /* NISSAN_PRIMERA_H_ */

View File

@ -1,70 +0,0 @@
/**
* @file rover_v8.cpp
*
* V8, firing order 18436572
*
* This config overrides some values of the default configuration which is set by setDefaultConfiguration() method
*
* ROVER_V8 = 10
*
* @date Jun 27, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "main.h"
#include "rover_v8.h"
void setRoverv8(engine_configuration_s *engineConfiguration,
board_configuration_s *boardConfiguration) {
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL_36_1;
engineConfiguration->displacement = 3.528;
engineConfiguration->cylindersCount = 8;
engineConfiguration->firingOrder = FO_1_8_4_3_6_5_7_2;
// set_rpm_hard_limit 4000
engineConfiguration->rpmHardLimit = 4000; // yes, 4k. let's play it safe for now
// set_cranking_rpm 550
engineConfiguration->crankingSettings.crankingRpm = 550;
// set_whole_fuel_map 3
setWholeFuelMap(engineConfiguration, 3);
// set_cranking_injection_mode 0
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
// set_injection_mode 1
engineConfiguration->injectionMode = IM_SEQUENTIAL;
// set_ignition_mode 2
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
// Frankenstein: low side - inj #1: PC14
// Frankenstein: low side - inj #2: PC15
// Frankenstein: low side - inj #3: PE6
// Frankenstein: low side - inj #4: PC13
// Frankenstein: low side - inj #5: PE4
// Frankenstein: low side - inj #6: PE5
// Frankenstein: low side - inj #7: PE2
// Frankenstein: low side - inj #8: PE3
// Frankenstein: low side - inj #9: PE0
// Frankenstein: low side - inj #10: PE1
// Frankenstein: low side - inj #11: PB8
// Frankenstein: low side - inj #12: PB9
boardConfiguration->injectionPins[0] = GPIOB_9; // Frankenstein: low side - inj #12
boardConfiguration->injectionPins[1] = GPIOB_8; // Frankenstein: low side - inj #11
boardConfiguration->injectionPins[2] = GPIOE_3; // Frankenstein: low side - inj #8
boardConfiguration->injectionPins[3] = GPIOE_5; // Frankenstein: low side - inj #6
boardConfiguration->fuelPumpPin = GPIOC_13; // Frankenstein: low side - inj #4
boardConfiguration->fuelPumpPinMode = OM_DEFAULT;
// set_injection_pin_mode 0
boardConfiguration->injectionPinMode = OM_DEFAULT;
}

View File

@ -1,15 +0,0 @@
/**
* @file rover_v8.h
*
* @date Jun 27, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef ROVER_V8_H_
#define ROVER_V8_H_
#include "engine_configuration.h"
void setRoverv8(engine_configuration_s *engineConfiguration,
board_configuration_s *boardConfiguration);
#endif /* ROVER_V8_H_ */

View File

@ -1,17 +0,0 @@
/**
* @file saturn_ion.cpp
*
* SATURN_ION_2004 = 12
*
* 7x GM DIS trigger
*
* @date Mar 28, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "saturn_ion.h"
void setSaturnIonEngineConfiguration(engine_configuration_s *engineConfiguration) {
engineConfiguration->triggerConfig.triggerType = TT_GM_7X;
}

View File

@ -1,25 +0,0 @@
/**
* @file saturn_ion.h
*
* @date Mar 28, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef SATURN_ION_H_
#define SATURN_ION_H_
#include "engine_configuration.h"
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void setSaturnIonEngineConfiguration(engine_configuration_s *engineConfiguration);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* SATURN_ION_H_ */

View File

@ -1,9 +0,0 @@
/**
* @file snow_blower.cpp
* @brief Default configuration of a single-cylinder engine
*
* @date Sep 9, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "main.h"

View File

@ -1,29 +0,0 @@
/**
* @file snow_blower.h
* @brief Default configuration of a single-cylinder engine
* @date Sep 8, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef SNOW_BLOWER_H_
#define SNOW_BLOWER_H_
#if EFI_ENGINE_SNOW_BLOWER
#define NUMBER_OF_CYLINDERS 1
#define EFI_ENGINE_ID "Snow Blower"
#define RPM_MULT (1)
#define getCoolantTemperature() 0
#define getIntakeAirTemperature() 0
#define getMaf() 0
#define getTPS() 0
#define getAfr() 0
#endif /* EFI_ENGINE_SNOW_BLOWER */
#endif /* SNOW_BLOWER_H_ */

View File

@ -1,186 +0,0 @@
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
2011,2012,2013 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/RT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
---
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes ChibiOS/RT, without being obliged to provide
the source code for any proprietary components. See the file exception.txt
for full details of how and when the exception can be applied.
*/
/*
* ST32F407xG memory setup.
*/
__main_stack_size__ = 0x0600;
__process_stack_size__ = 0x0600;
MEMORY
{
flash : org = 0x08000000, len = 1M
ram : org = 0x20000000, len = 112k
ethram : org = 0x2001C000, len = 16k
ccmram : org = 0x10000000, len = 64k
}
__ram_start__ = ORIGIN(ram);
__ram_size__ = LENGTH(ram);
__ram_end__ = __ram_start__ + __ram_size__;
ENTRY(ResetHandler)
SECTIONS
{
. = 0;
_text = .;
startup : ALIGN(16) SUBALIGN(16)
{
KEEP(*(vectors))
} > flash
constructors : ALIGN(4) SUBALIGN(4)
{
PROVIDE(__init_array_start = .);
KEEP(*(SORT(.init_array.*)))
KEEP(*(.init_array))
PROVIDE(__init_array_end = .);
} > flash
destructors : ALIGN(4) SUBALIGN(4)
{
PROVIDE(__fini_array_start = .);
KEEP(*(.fini_array))
KEEP(*(SORT(.fini_array.*)))
PROVIDE(__fini_array_end = .);
} > flash
.text : ALIGN(16) SUBALIGN(16)
{
*(.text.startup.*)
*(.text)
*(.text.*)
*(.rodata)
*(.rodata.*)
*(.glue_7t)
*(.glue_7)
*(.gcc*)
} > flash
.ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} > flash
.ARM.exidx : {
PROVIDE(__exidx_start = .);
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
PROVIDE(__exidx_end = .);
} > flash
.eh_frame_hdr :
{
*(.eh_frame_hdr)
} > flash
.eh_frame : ONLY_IF_RO
{
*(.eh_frame)
} > flash
.textalign : ONLY_IF_RO
{
. = ALIGN(8);
} > flash
_etext = .;
_textdata = _etext;
.stacks :
{
. = ALIGN(8);
__main_stack_base__ = .;
. += __main_stack_size__;
. = ALIGN(8);
__main_stack_end__ = .;
__process_stack_base__ = .;
__main_thread_stack_base__ = .;
. += __process_stack_size__;
. = ALIGN(8);
__process_stack_end__ = .;
__main_thread_stack_end__ = .;
} > ram
.ccm (NOLOAD) :
{
PROVIDE(_cmm_start = .);
. = ALIGN(4);
*(.bss.mainthread.*)
. = ALIGN(4);
*(.bss._idle_thread_wa)
. = ALIGN(4);
*(.bss.rlist)
. = ALIGN(4);
*(.bss.vtlist)
. = ALIGN(4);
*(.bss.endmem)
. = ALIGN(4);
*(.bss.nextmem)
. = ALIGN(4);
*(.bss.default_heap)
. = ALIGN(4);
*(.ccm)
. = ALIGN(4);
*(.ccm.*)
. = ALIGN(4);
PROVIDE(_cmm_end = .);
} > ccmram
.data :
{
. = ALIGN(4);
PROVIDE(_data = .);
*(.data)
. = ALIGN(4);
*(.data.*)
. = ALIGN(4);
*(.ramtext)
. = ALIGN(4);
PROVIDE(_edata = .);
} > ram AT > flash
.bss :
{
. = ALIGN(4);
PROVIDE(_bss_start = .);
*(.bss)
. = ALIGN(4);
*(.bss.*)
. = ALIGN(4);
*(COMMON)
. = ALIGN(4);
PROVIDE(_bss_end = .);
} > ram
}
PROVIDE(end = .);
_end = .;
__heap_base__ = _end;
__heap_end__ = __ram_end__;

View File

@ -1,575 +0,0 @@
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
2011,2012 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/RT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
---
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes ChibiOS/RT, without being obliged to provide
the source code for any proprietary components. See the file exception.txt
for full details of how and when the exception can be applied.
*/
/**
* @file templates/chconf.h
* @brief Configuration file template.
* @details A copy of this file must be placed in each project directory, it
* contains the application specific kernel settings.
*
* @addtogroup config
* @details Kernel related settings and hooks.
* @{
*/
#ifndef _CHCONF_H_
#define _CHCONF_H_
#define chDbgCheck(c, func) { \
if (!(c)) \
chDbgPanic3(__QUOTE_THIS(func)"()", __FILE__, __LINE__); \
}
#define PORT_IDLE_THREAD_STACK_SIZE 1024
#define PORT_INT_REQUIRED_STACK 768
#define CHPRINTF_USE_FLOAT TRUE
/**
* number of ticks per second
*
* 8000 rpm equals 133Hz of crankshaft
* that's 266Hz camshaft
* for timing measures we need 95760 Hz precision
*/
#define CH_FREQUENCY 1000
/*===========================================================================*/
/**
* @name Kernel parameters and options
* @{
*/
/*===========================================================================*/
/**
* @brief System tick frequency.
* @details Frequency of the system timer that drives the system ticks. This
* setting also defines the system tick time unit.
*/
#if !defined(CH_FREQUENCY) || defined(__DOXYGEN__)
#define CH_FREQUENCY 1000
#endif
/**
* @brief Round robin interval.
* @details This constant is the number of system ticks allowed for the
* threads before preemption occurs. Setting this value to zero
* disables the preemption for threads with equal priority and the
* round robin becomes cooperative. Note that higher priority
* threads can still preempt, the kernel is always preemptive.
*
* @note Disabling the round robin preemption makes the kernel more compact
* and generally faster.
*/
#if !defined(CH_TIME_QUANTUM) || defined(__DOXYGEN__)
#define CH_TIME_QUANTUM 20
#endif
/**
* @brief Managed RAM size.
* @details Size of the RAM area to be managed by the OS. If set to zero
* then the whole available RAM is used. The core memory is made
* available to the heap allocator and/or can be used directly through
* the simplified core memory allocator.
*
* @note In order to let the OS manage the whole RAM the linker script must
* provide the @p __heap_base__ and @p __heap_end__ symbols.
* @note Requires @p CH_USE_MEMCORE.
*/
#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__)
#define CH_MEMCORE_SIZE 0
#endif
/**
* @brief Idle thread automatic spawn suppression.
* @details When this option is activated the function @p chSysInit()
* does not spawn the idle thread automatically. The application has
* then the responsibility to do one of the following:
* - Spawn a custom idle thread at priority @p IDLEPRIO.
* - Change the main() thread priority to @p IDLEPRIO then enter
* an endless loop. In this scenario the @p main() thread acts as
* the idle thread.
* .
* @note Unless an idle thread is spawned the @p main() thread must not
* enter a sleep state.
*/
#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__)
#define CH_NO_IDLE_THREAD FALSE
#endif
/** @} */
/*===========================================================================*/
/**
* @name Performance options
* @{
*/
/*===========================================================================*/
/**
* @brief OS optimization.
* @details If enabled then time efficient rather than space efficient code
* is used when two possible implementations exist.
*
* @note This is not related to the compiler optimization options.
* @note The default is @p TRUE.
*/
#if !defined(CH_OPTIMIZE_SPEED) || defined(__DOXYGEN__)
#define CH_OPTIMIZE_SPEED TRUE
#endif
/** @} */
/*===========================================================================*/
/**
* @name Subsystem options
* @{
*/
/*===========================================================================*/
/**
* @brief Threads registry APIs.
* @details If enabled then the registry APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
#if !defined(CH_USE_REGISTRY) || defined(__DOXYGEN__)
#define CH_USE_REGISTRY TRUE
#endif
/**
* @brief Threads synchronization APIs.
* @details If enabled then the @p chThdWait() function is included in
* the kernel.
*
* @note The default is @p TRUE.
*/
#if !defined(CH_USE_WAITEXIT) || defined(__DOXYGEN__)
#define CH_USE_WAITEXIT TRUE
#endif
/**
* @brief Semaphores APIs.
* @details If enabled then the Semaphores APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
#if !defined(CH_USE_SEMAPHORES) || defined(__DOXYGEN__)
#define CH_USE_SEMAPHORES TRUE
#endif
/**
* @brief Semaphores queuing mode.
* @details If enabled then the threads are enqueued on semaphores by
* priority rather than in FIFO order.
*
* @note The default is @p FALSE. Enable this if you have special requirements.
* @note Requires @p CH_USE_SEMAPHORES.
*/
#if !defined(CH_USE_SEMAPHORES_PRIORITY) || defined(__DOXYGEN__)
#define CH_USE_SEMAPHORES_PRIORITY FALSE
#endif
/**
* @brief Atomic semaphore API.
* @details If enabled then the semaphores the @p chSemSignalWait() API
* is included in the kernel.
*
* @note The default is @p TRUE.
* @note Requires @p CH_USE_SEMAPHORES.
*/
#if !defined(CH_USE_SEMSW) || defined(__DOXYGEN__)
#define CH_USE_SEMSW TRUE
#endif
/**
* @brief Mutexes APIs.
* @details If enabled then the mutexes APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
#if !defined(CH_USE_MUTEXES) || defined(__DOXYGEN__)
#define CH_USE_MUTEXES TRUE
#endif
/**
* @brief Conditional Variables APIs.
* @details If enabled then the conditional variables APIs are included
* in the kernel.
*
* @note The default is @p TRUE.
* @note Requires @p CH_USE_MUTEXES.
*/
#if !defined(CH_USE_CONDVARS) || defined(__DOXYGEN__)
#define CH_USE_CONDVARS TRUE
#endif
/**
* @brief Conditional Variables APIs with timeout.
* @details If enabled then the conditional variables APIs with timeout
* specification are included in the kernel.
*
* @note The default is @p TRUE.
* @note Requires @p CH_USE_CONDVARS.
*/
#if !defined(CH_USE_CONDVARS_TIMEOUT) || defined(__DOXYGEN__)
#define CH_USE_CONDVARS_TIMEOUT TRUE
#endif
/**
* @brief Events Flags APIs.
* @details If enabled then the event flags APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
#if !defined(CH_USE_EVENTS) || defined(__DOXYGEN__)
#define CH_USE_EVENTS TRUE
#endif
/**
* @brief Events Flags APIs with timeout.
* @details If enabled then the events APIs with timeout specification
* are included in the kernel.
*
* @note The default is @p TRUE.
* @note Requires @p CH_USE_EVENTS.
*/
#if !defined(CH_USE_EVENTS_TIMEOUT) || defined(__DOXYGEN__)
#define CH_USE_EVENTS_TIMEOUT TRUE
#endif
/**
* @brief Synchronous Messages APIs.
* @details If enabled then the synchronous messages APIs are included
* in the kernel.
*
* @note The default is @p TRUE.
*/
#if !defined(CH_USE_MESSAGES) || defined(__DOXYGEN__)
#define CH_USE_MESSAGES TRUE
#endif
/**
* @brief Synchronous Messages queuing mode.
* @details If enabled then messages are served by priority rather than in
* FIFO order.
*
* @note The default is @p FALSE. Enable this if you have special requirements.
* @note Requires @p CH_USE_MESSAGES.
*/
#if !defined(CH_USE_MESSAGES_PRIORITY) || defined(__DOXYGEN__)
#define CH_USE_MESSAGES_PRIORITY FALSE
#endif
/**
* @brief Mailboxes APIs.
* @details If enabled then the asynchronous messages (mailboxes) APIs are
* included in the kernel.
*
* @note The default is @p TRUE.
* @note Requires @p CH_USE_SEMAPHORES.
*/
#if !defined(CH_USE_MAILBOXES) || defined(__DOXYGEN__)
#define CH_USE_MAILBOXES TRUE
#endif
/**
* @brief I/O Queues APIs.
* @details If enabled then the I/O queues APIs are included in the kernel.
*
* @note The default is @p TRUE.
*/
#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__)
#define CH_USE_QUEUES TRUE
#endif
/**
* @brief Core Memory Manager APIs.
* @details If enabled then the core memory manager APIs are included
* in the kernel.
*
* @note The default is @p TRUE.
*/
#if !defined(CH_USE_MEMCORE) || defined(__DOXYGEN__)
#define CH_USE_MEMCORE TRUE
#endif
/**
* @brief Heap Allocator APIs.
* @details If enabled then the memory heap allocator APIs are included
* in the kernel.
*
* @note The default is @p TRUE.
* @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or
* @p CH_USE_SEMAPHORES.
* @note Mutexes are recommended.
*/
#if !defined(CH_USE_HEAP) || defined(__DOXYGEN__)
#define CH_USE_HEAP TRUE
#endif
/**
* @brief C-runtime allocator.
* @details If enabled the the heap allocator APIs just wrap the C-runtime
* @p malloc() and @p free() functions.
*
* @note The default is @p FALSE.
* @note Requires @p CH_USE_HEAP.
* @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the
* appropriate documentation.
*/
#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
#define CH_USE_MALLOC_HEAP FALSE
#endif
/**
* @brief Memory Pools Allocator APIs.
* @details If enabled then the memory pools allocator APIs are included
* in the kernel.
*
* @note The default is @p TRUE.
*/
#if !defined(CH_USE_MEMPOOLS) || defined(__DOXYGEN__)
#define CH_USE_MEMPOOLS TRUE
#endif
/**
* @brief Dynamic Threads APIs.
* @details If enabled then the dynamic threads creation APIs are included
* in the kernel.
*
* @note The default is @p TRUE.
* @note Requires @p CH_USE_WAITEXIT.
* @note Requires @p CH_USE_HEAP and/or @p CH_USE_MEMPOOLS.
*/
#if !defined(CH_USE_DYNAMIC) || defined(__DOXYGEN__)
#define CH_USE_DYNAMIC TRUE
#endif
/** @} */
/*===========================================================================*/
/**
* @name Debug options
* @{
*/
/*===========================================================================*/
/**
* @brief Debug option, system state check.
* @details If enabled the correct call protocol for system APIs is checked
* at runtime.
*
* @note The default is @p FALSE.
*/
#if !defined(CH_DBG_SYSTEM_STATE_CHECK) || defined(__DOXYGEN__)
#define CH_DBG_SYSTEM_STATE_CHECK TRUE
#endif
/**
* @brief Debug option, parameters checks.
* @details If enabled then the checks on the API functions input
* parameters are activated.
*
* @note The default is @p FALSE.
*/
#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXYGEN__)
#define CH_DBG_ENABLE_CHECKS TRUE
#endif
/**
* @brief Debug option, consistency checks.
* @details If enabled then all the assertions in the kernel code are
* activated. This includes consistency checks inside the kernel,
* runtime anomalies and port-defined checks.
*
* @note The default is @p FALSE.
*/
#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXYGEN__)
#define CH_DBG_ENABLE_ASSERTS TRUE
#endif
/**
* @brief Debug option, trace buffer.
* @details If enabled then the context switch circular trace buffer is
* activated.
*
* @note The default is @p FALSE.
*/
#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXYGEN__)
#define CH_DBG_ENABLE_TRACE FALSE
#endif
/**
* @brief Debug option, stack checks.
* @details If enabled then a runtime stack check is performed.
*
* @note The default is @p FALSE.
* @note The stack check is performed in a architecture/port dependent way.
* It may not be implemented or some ports.
* @note The default failure mode is to halt the system with the global
* @p panic_msg variable set to @p NULL.
*/
#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXYGEN__)
#define CH_DBG_ENABLE_STACK_CHECK TRUE
#endif
/**
* @brief Debug option, stacks initialization.
* @details If enabled then the threads working area is filled with a byte
* value when a thread is created. This can be useful for the
* runtime measurement of the used stack.
*
* @note The default is @p FALSE.
*/
#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXYGEN__)
#define CH_DBG_FILL_THREADS FALSE
#endif
/**
* @brief Debug option, threads profiling.
* @details If enabled then a field is added to the @p Thread structure that
* counts the system ticks occurred while executing the thread.
*
* @note The default is @p TRUE.
* @note This debug option is defaulted to TRUE because it is required by
* some test cases into the test suite.
*/
#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXYGEN__)
#define CH_DBG_THREADS_PROFILING TRUE
#endif
/** @} */
/*===========================================================================*/
/**
* @name Kernel hooks
* @{
*/
/*===========================================================================*/
/**
* @brief Threads descriptor structure extension.
* @details User fields added to the end of the @p Thread structure.
*/
#if !defined(THREAD_EXT_FIELDS) || defined(__DOXYGEN__)
#define THREAD_EXT_FIELDS \
void *activeStack; \
int remainingStack; \
/* Add threads custom fields here.*/
#endif
/**
* @brief Threads initialization hook.
* @details User initialization code added to the @p chThdInit() API.
*
* @note It is invoked from within @p chThdInit() and implicitly from all
* the threads creation APIs.
*/
#if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__)
#define THREAD_EXT_INIT_HOOK(tp) { \
/* Add threads initialization code here.*/ \
}
#endif
/**
* @brief Threads finalization hook.
* @details User finalization code added to the @p chThdExit() API.
*
* @note It is inserted into lock zone.
* @note It is also invoked when the threads simply return in order to
* terminate.
*/
#if !defined(THREAD_EXT_EXIT_HOOK) || defined(__DOXYGEN__)
#define THREAD_EXT_EXIT_HOOK(tp) { \
/* Add threads finalization code here.*/ \
}
#endif
/**
* @brief Context switch hook.
* @details This hook is invoked just before switching between threads.
*/
#if !defined(THREAD_CONTEXT_SWITCH_HOOK) || defined(__DOXYGEN__)
#define THREAD_CONTEXT_SWITCH_HOOK(ntp, otp) { \
/* System halt code here.*/ \
}
#endif
/**
* @brief Idle Loop hook.
* @details This hook is continuously invoked by the idle thread loop.
*/
#if !defined(IDLE_LOOP_HOOK) || defined(__DOXYGEN__)
#define IDLE_LOOP_HOOK() { \
/* Idle loop code here.*/ \
}
#endif
/**
* @brief System tick event hook.
* @details This hook is invoked in the system tick handler immediately
* after processing the virtual timers queue.
*/
#if !defined(SYSTEM_TICK_EVENT_HOOK) || defined(__DOXYGEN__)
#define SYSTEM_TICK_EVENT_HOOK() { \
/* System tick event code here.*/ \
}
#endif
/**
* @brief System halt hook.
* @details This hook is invoked in case to a system halting error before
* the system is halted.
*/
#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
#if CH_DBG_ENABLED
#define SYSTEM_HALT_HOOK() { \
print("FATAL %s\r\n", dbg_panic_msg); \
chThdSleepMilliseconds(100); \
/* System halt code here.*/ \
}
#endif
#endif
/** @} */
/*===========================================================================*/
/* Port-specific settings (override port settings defaulted in chcore.h). */
/*===========================================================================*/
#define CORTEX_USE_FPU TRUE
#endif /* _CHCONF_H_ */
/** @} */

View File

@ -1,349 +0,0 @@
/*
ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
2011,2012 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
ChibiOS/RT is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
ChibiOS/RT is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
---
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes ChibiOS/RT, without being obliged to provide
the source code for any proprietary components. See the file exception.txt
for full details of how and when the exception can be applied.
*/
/**
* @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 TRUE
#endif
/**
* @brief Enables the CAN subsystem.
*/
#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
#define HAL_USE_CAN TRUE
#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 TRUE
#endif
/**
* @brief Enables the I2C subsystem.
*/
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
#define HAL_USE_I2C TRUE
#endif
/**
* @brief Enables the ICU subsystem.
*/
#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
#define HAL_USE_ICU TRUE
#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 TRUE
#endif
/**
* @brief Enables the PWM subsystem.
*/
#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
#define HAL_USE_PWM TRUE
#endif
/**
* @brief Enables the RTC subsystem.
*/
#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
#define HAL_USE_RTC TRUE
#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 TRUE
#endif
/**
* @brief Enables the SPI subsystem.
*/
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
#define HAL_USE_SPI TRUE
#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 TRUE
#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_EVENTS) || defined(__DOXYGEN__)
#define MAC_USE_EVENTS TRUE
#endif
/*===========================================================================*/
/* MMC_SPI driver related settings. */
/*===========================================================================*/
/**
* @brief Block size for MMC transfers.
*/
#if !defined(MMC_SECTOR_SIZE) || defined(__DOXYGEN__)
#define MMC_SECTOR_SIZE 512
#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.
* 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
/**
* @brief Number of positive insertion queries before generating the
* insertion event.
*/
#if !defined(MMC_POLLING_INTERVAL) || defined(__DOXYGEN__)
#define MMC_POLLING_INTERVAL 10
#endif
/**
* @brief Interval, in milliseconds, between insertion queries.
*/
#if !defined(MMC_POLLING_DELAY) || defined(__DOXYGEN__)
#define MMC_POLLING_DELAY 10
#endif
/**
* @brief Uses the SPI polled API for small data transfers.
* @details Polled transfers usually improve performance because it
* saves two context switches and interrupt servicing. Note
* that this option has no effect on large transfers which
* are always performed using DMAs/IRQs.
*/
#if !defined(MMC_USE_SPI_POLLING) || defined(__DOXYGEN__)
#define MMC_USE_SPI_POLLING 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 16
#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,272 +0,0 @@
/*
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.
*/
/*
* STM32F4xx drivers configuration.
* The following settings override the default settings present in
* the various device driver implementation headers.
* Note that the settings for each driver only have effect if the whole
* driver is enabled in halconf.h.
*
* IRQ priorities:
* 15...0 Lowest...Highest.
*
* DMA priorities:
* 0...3 Lowest...Highest.
*/
#define STM32F4xx_MCUCONF
#include "boards.h"
#include "efifeatures.h"
#include "rusefi_enums.h"
/*
* HAL driver system settings.
*/
#define STM32_NO_INIT FALSE
#define STM32_HSI_ENABLED TRUE
#define STM32_LSI_ENABLED TRUE
#define STM32_HSE_ENABLED TRUE
// change this 'FALSE to TRUE if you have the LSE 32768 quarts
#define STM32_LSE_ENABLED FALSE
#define STM32_CLOCK48_REQUIRED TRUE
#define STM32_SW STM32_SW_PLL
#define STM32_PLLSRC STM32_PLLSRC_HSE
#ifdef OLIMEX_STM32_E407
#define STM32_PLLM_VALUE 12
#else
#define STM32_PLLM_VALUE 8
#endif
#define STM32_PLLN_VALUE 336
#define STM32_PLLP_VALUE 2
#define STM32_PLLQ_VALUE 7
#define STM32_HPRE STM32_HPRE_DIV1
#define STM32_PPRE1 STM32_PPRE1_DIV4
#define STM32_PPRE2 STM32_PPRE2_DIV2
#if STM32_LSE_ENABLED
#define STM32_RTCSEL STM32_RTCSEL_LSE
#else
#define STM32_RTCSEL STM32_RTCSEL_LSI
#endif
#define STM32_RTCPRE_VALUE 8
#define STM32_MCO1SEL STM32_MCO1SEL_HSI
#define STM32_MCO1PRE STM32_MCO1PRE_DIV1
#define STM32_MCO2SEL STM32_MCO2SEL_SYSCLK
#define STM32_MCO2PRE STM32_MCO2PRE_DIV5
#define STM32_I2SSRC STM32_I2SSRC_CKIN
#define STM32_PLLI2SN_VALUE 192
#define STM32_PLLI2SR_VALUE 5
//#define STM32_VOS STM32_VOS_HIGH
#define STM32_PVD_ENABLE FALSE
#define STM32_PLS STM32_PLS_LEV0
/*
* ADC driver system settings.
*/
#define STM32_ADC_ADCPRE ADC_CCR_ADCPRE_DIV4
#define STM32_ADC_USE_ADC1 TRUE // slow ADC
#define STM32_ADC_USE_ADC2 TRUE // fast ADC
#define STM32_ADC_USE_ADC3 FALSE
#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(2, 4)
#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 2)
#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 1)
#define STM32_ADC_ADC1_DMA_PRIORITY 2
#define STM32_ADC_ADC2_DMA_PRIORITY 2
#define STM32_ADC_ADC3_DMA_PRIORITY 2
#define STM32_ADC_IRQ_PRIORITY 6
#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 6
#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 6
#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 6
/*
* CAN driver system settings.
*/
#define STM32_CAN_CAN1_IRQ_PRIORITY 11
#define STM32_CAN_CAN2_IRQ_PRIORITY 11
/*
* EXT driver system settings.
*/
#define STM32_EXT_EXTI0_IRQ_PRIORITY 6
#define STM32_EXT_EXTI1_IRQ_PRIORITY 6
#define STM32_EXT_EXTI2_IRQ_PRIORITY 6
#define STM32_EXT_EXTI3_IRQ_PRIORITY 6
#define STM32_EXT_EXTI4_IRQ_PRIORITY 6
#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6
#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6
#define STM32_EXT_EXTI16_IRQ_PRIORITY 6
#define STM32_EXT_EXTI17_IRQ_PRIORITY 15
#define STM32_EXT_EXTI18_IRQ_PRIORITY 6
#define STM32_EXT_EXTI19_IRQ_PRIORITY 6
#define STM32_EXT_EXTI20_IRQ_PRIORITY 6
#define STM32_EXT_EXTI21_IRQ_PRIORITY 15
#define STM32_EXT_EXTI22_IRQ_PRIORITY 15
/*
* GPT driver system settings.
*/
#define STM32_GPT_USE_TIM1 FALSE
#define STM32_GPT_USE_TIM2 FALSE
#define STM32_GPT_USE_TIM3 FALSE
#define STM32_GPT_USE_TIM4 FALSE
#define STM32_GPT_USE_TIM5 TRUE
#define STM32_GPT_USE_TIM6 FALSE
#define STM32_GPT_USE_TIM7 FALSE
#define STM32_GPT_USE_TIM8 FALSE
#define STM32_GPT_USE_TIM9 FALSE
#define STM32_GPT_USE_TIM11 FALSE
#define STM32_GPT_USE_TIM12 FALSE
#define STM32_GPT_USE_TIM14 FALSE
#define STM32_GPT_TIM1_IRQ_PRIORITY 7
#define STM32_GPT_TIM2_IRQ_PRIORITY 7
#define STM32_GPT_TIM3_IRQ_PRIORITY 7
#define STM32_GPT_TIM4_IRQ_PRIORITY 7
#define STM32_GPT_TIM5_IRQ_PRIORITY 3
#define STM32_GPT_TIM6_IRQ_PRIORITY 7
#define STM32_GPT_TIM7_IRQ_PRIORITY 7
#define STM32_GPT_TIM8_IRQ_PRIORITY 7
#define STM32_GPT_TIM9_IRQ_PRIORITY 7
#define STM32_GPT_TIM11_IRQ_PRIORITY 7
#define STM32_GPT_TIM12_IRQ_PRIORITY 7
#define STM32_GPT_TIM14_IRQ_PRIORITY 7
/*
* I2C driver system settings.
*/
#define STM32_I2C_USE_I2C1 TRUE
#define STM32_I2C_USE_I2C2 FALSE
#define STM32_I2C_USE_I2C3 FALSE
#define STM32_I2C_I2C2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
#define STM32_I2C_I2C2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
#define STM32_I2C_I2C3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
#define STM32_I2C_I2C3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
#define STM32_I2C_I2C1_IRQ_PRIORITY 5
#define STM32_I2C_I2C2_IRQ_PRIORITY 5
#define STM32_I2C_I2C3_IRQ_PRIORITY 5
#define STM32_I2C_I2C1_DMA_PRIORITY 3
#define STM32_I2C_I2C2_DMA_PRIORITY 3
#define STM32_I2C_I2C3_DMA_PRIORITY 3
#define STM32_I2C_I2C1_DMA_ERROR_HOOK() chSysHalt()
#define STM32_I2C_I2C2_DMA_ERROR_HOOK() chSysHalt()
#define STM32_I2C_I2C3_DMA_ERROR_HOOK() chSysHalt()
/*
* ICU driver system settings.
*/
#define STM32_ICU_TIM1_IRQ_PRIORITY 7
#define STM32_ICU_TIM2_IRQ_PRIORITY 7
#define STM32_ICU_TIM3_IRQ_PRIORITY 7
#define STM32_ICU_TIM4_IRQ_PRIORITY 7
#define STM32_ICU_TIM5_IRQ_PRIORITY 7
#define STM32_ICU_TIM8_IRQ_PRIORITY 7
#define STM32_ICU_TIM9_IRQ_PRIORITY 7
/*
* MAC driver system settings.
*/
#define STM32_MAC_TRANSMIT_BUFFERS 2
#define STM32_MAC_RECEIVE_BUFFERS 4
#define STM32_MAC_BUFFERS_SIZE 1522
#define STM32_MAC_PHY_TIMEOUT 100
#define STM32_MAC_ETH1_CHANGE_PHY_STATE TRUE
#define STM32_MAC_ETH1_IRQ_PRIORITY 13
#define STM32_MAC_IP_CHECKSUM_OFFLOAD 0
/*
* PWM driver system settings.
*/
#define STM32_PWM_USE_ADVANCED FALSE
#define STM32_PWM_TIM1_IRQ_PRIORITY 7
#define STM32_PWM_TIM2_IRQ_PRIORITY 7
#define STM32_PWM_TIM3_IRQ_PRIORITY 7
#define STM32_PWM_TIM4_IRQ_PRIORITY 7
#define STM32_PWM_TIM5_IRQ_PRIORITY 7
#define STM32_PWM_TIM8_IRQ_PRIORITY 7
#define STM32_PWM_TIM9_IRQ_PRIORITY 7
/*
* SERIAL driver system settings.
*/
#define STM32_SERIAL_USE_USART1 TRUE
#define STM32_SERIAL_USE_USART2 TRUE
#define STM32_SERIAL_USE_USART3 TRUE
#define STM32_SERIAL_USE_UART4 FALSE
#define STM32_SERIAL_USE_UART5 FALSE
#define STM32_SERIAL_USE_USART6 FALSE
#define STM32_SERIAL_USART1_PRIORITY 12
#define STM32_SERIAL_USART2_PRIORITY 12
#define STM32_SERIAL_USART3_PRIORITY 12
#define STM32_SERIAL_UART4_PRIORITY 12
#define STM32_SERIAL_UART5_PRIORITY 12
#define STM32_SERIAL_USART6_PRIORITY 12
/*
* SPI driver system settings.
*/
#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0)
#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3)
#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0)
#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
#define STM32_SPI_SPI1_DMA_PRIORITY 1
#define STM32_SPI_SPI2_DMA_PRIORITY 1
#define STM32_SPI_SPI3_DMA_PRIORITY 1
#define STM32_SPI_SPI1_IRQ_PRIORITY 10
#define STM32_SPI_SPI2_IRQ_PRIORITY 10
#define STM32_SPI_SPI3_IRQ_PRIORITY 10
#define STM32_SPI_DMA_ERROR_HOOK(spip) chDbgCheck(TRUE, "STM32_SPI_DMA_ERROR_HOOK")
/*
* UART driver system settings.
*/
#define STM32_UART_USE_USART1 FALSE
#define STM32_UART_USE_USART2 FALSE
#define STM32_UART_USE_USART3 TRUE
#define STM32_UART_USE_USART6 FALSE
#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7)
#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
#define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
#define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
#define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2)
#define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7)
#define STM32_UART_USART1_IRQ_PRIORITY 12
#define STM32_UART_USART2_IRQ_PRIORITY 12
#define STM32_UART_USART3_IRQ_PRIORITY 12
#define STM32_UART_USART6_IRQ_PRIORITY 12
#define STM32_UART_USART1_DMA_PRIORITY 0
#define STM32_UART_USART2_DMA_PRIORITY 0
#define STM32_UART_USART3_DMA_PRIORITY 0
#define STM32_UART_USART6_DMA_PRIORITY 0
#define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt()
/*
* USB driver system settings.
*/
#define STM32_USB_USE_OTG1 TRUE
#define STM32_USB_USE_OTG2 FALSE
#define STM32_USB_OTG1_IRQ_PRIORITY 14
#define STM32_USB_OTG2_IRQ_PRIORITY 14
#define STM32_USB_OTG1_RX_FIFO_SIZE 512
#define STM32_USB_OTG2_RX_FIFO_SIZE 1024
#define STM32_USB_OTG_THREAD_PRIO LOWPRIO
#define STM32_USB_OTG_THREAD_STACK_SIZE 1024
#define STM32_USB_OTGFIFO_FILL_BASEPRI 0

View File

@ -1,6 +0,0 @@
CONSOLESRC = $(PROJECT_DIR)/console/eficonsole.c \
$(PROJECT_DIR)/console/console_io.c
CONSOLE_SRC_CPP = $(PROJECT_DIR)/console/status_loop.cpp

View File

@ -1,245 +0,0 @@
/**
* @file console_io.c
*
* @date Dec 29, 2012
* @author Andrey Belomutskiy, (c) 2012-2014
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "main.h"
#include "console_io.h"
#if EFI_PROD_CODE
extern SerialUSBDriver SDU1;
#include "usbcfg.h"
#include "usbconsole.h"
#endif
#include "rfiutil.h"
int lastWriteSize;
int lastWriteActual;
static bool isSerialConsoleStarted = false;
static EventListener consoleEventListener;
/**
* @brief Reads a whole line from the input channel.
*
* @param[in] chp pointer to a @p BaseChannel object
* @param[in] line pointer to the line buffer
* @param[in] size buffer maximum length
* @return The operation status.
* @retval TRUE the channel was reset or CTRL-D pressed.
* @retval FALSE operation successful.
*/
static bool getConsoleLine(BaseSequentialStream *chp, char *line, unsigned size) {
char *p = line;
while (TRUE) {
if (!isConsoleReady()) {
// we better do not read from USB serial before it is ready
chThdSleepMilliseconds(10);
continue;
}
short c = (short) chSequentialStreamGet(chp);
if (isSerialOverUart()) {
uint32_t flags;
chSysLock()
;
flags = chEvtGetAndClearFlagsI(&consoleEventListener);
chSysUnlock()
;
if (flags & SD_OVERRUN_ERROR) {
// firmwareError("serial overrun");
}
}
#if EFI_UART_ECHO_TEST_MODE
/**
* That's test code - let's test connectivity
*/
consolePutChar((uint8_t) c);
continue;
#endif
if (c < 0 || c == 4) {
return TRUE;
}
if (c == 8) {
if (p != line) {
// backspace
consolePutChar((uint8_t) c);
consolePutChar(0x20);
consolePutChar((uint8_t) c);
p--;
}
continue;
}
if (c == '\r') {
consolePutChar('\r');
consolePutChar('\n');
*p = 0;
return false;
}
if (c < 0x20) {
continue;
}
if (p < line + size - 1) {
consolePutChar((uint8_t) c);
*p++ = (char) c;
}
}
}
// todo: this is ugly as hell!
static char consoleInput[] = " ";
void (*console_line_callback)(char *);
static bool is_serial_over_uart;
bool isSerialOverUart(void) {
return is_serial_over_uart;
}
static THD_WORKING_AREA(consoleThreadStack, 2 * UTILITY_THREAD_STACK_SIZE);
static msg_t consoleThreadThreadEntryPoint(void *arg) {
(void) arg;
chRegSetThreadName("console thread");
while (TRUE) {
bool end = getConsoleLine((BaseSequentialStream*) getConsoleChannel(), consoleInput, sizeof(consoleInput));
if (end) {
// firmware simulator is the only case when this happens
continue;
}
(console_line_callback)(consoleInput);
}
#if defined __GNUC__
return false;
#endif
}
#if EFI_PROD_CODE
static SerialConfig serialConfig = { SERIAL_SPEED, 0, USART_CR2_STOP1_BITS | USART_CR2_LINEN, 0 };
SerialDriver * getConsoleChannel(void) {
if (isSerialOverUart()) {
return (SerialDriver *) EFI_CONSOLE_UART_DEVICE;
} else {
return (SerialDriver *) &SDU1;
}
}
bool isConsoleReady(void) {
if (isSerialOverUart()) {
return isSerialConsoleStarted;
} else {
return is_usb_serial_ready();
}
}
#endif /* EFI_PROD_CODE */
void consolePutChar(int x) {
chSequentialStreamPut(getConsoleChannel(), (uint8_t )(x));
}
// 10 seconds
#define CONSOLE_WRITE_TIMEOUT 10000
void consoleOutputBuffer(const uint8_t *buf, int size) {
lastWriteSize = size;
#if !EFI_UART_ECHO_TEST_MODE
lastWriteActual = chnWriteTimeout(getConsoleChannel(), buf, size, CONSOLE_WRITE_TIMEOUT);
// if (r != size)
// firmwareError("Partial console write");
#endif /* EFI_UART_ECHO_TEST_MODE */
}
void startConsole(void (*console_line_callback_p)(char *)) {
console_line_callback = console_line_callback_p;
#if EFI_PROD_CODE
palSetPadMode(CONSOLE_MODE_SWITCH_PORT, CONSOLE_MODE_SWITCH_PIN, PAL_MODE_INPUT_PULLUP);
is_serial_over_uart = GET_CONSOLE_MODE_VALUE() == EFI_USE_UART_FOR_CONSOLE;
if (isSerialOverUart()) {
/*
* Activates the serial using the driver default configuration (that's 38400)
* it is important to set 'NONE' as flow control! in terminal application on the PC
*/
sdStart(EFI_CONSOLE_UART_DEVICE, &serialConfig);
// cannot use pin repository here because pin repository prints to console
palSetPadMode(EFI_CONSOLE_RX_PORT, EFI_CONSOLE_RX_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF));
palSetPadMode(EFI_CONSOLE_TX_PORT, EFI_CONSOLE_TX_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF));
isSerialConsoleStarted = TRUE;
chEvtRegisterMask((EventSource *) chnGetEventSource(EFI_CONSOLE_UART_DEVICE), &consoleEventListener, 1);
} else {
usb_serial_start();
}
#endif /* EFI_PROD_CODE */
chThdCreateStatic(consoleThreadStack, sizeof(consoleThreadStack), NORMALPRIO, consoleThreadThreadEntryPoint, NULL);
}
extern cnt_t dbg_isr_cnt;
/**
* @return TRUE if already in locked context
*/
bool lockAnyContext(void) {
int alreadyLocked = isLocked();
if (alreadyLocked)
return TRUE;
if (isIsrContext()) {
chSysLockFromIsr()
;
} else {
chSysLock()
;
}
return false;
}
bool lockOutputBuffer(void) {
return lockAnyContext();
}
void unlockAnyContext(void) {
if (isIsrContext()) {
chSysUnlockFromIsr()
;
} else {
chSysUnlock()
;
}
}
void unlockOutputBuffer(void) {
unlockAnyContext();
}

View File

@ -1,44 +0,0 @@
/**
* @file console_io.h
*
* @date Dec 29, 2012
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#pragma once
#ifndef CONSOLE_IO_H_
#define CONSOLE_IO_H_
#include <ch.h>
#include <hal.h>
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#include "efifeatures.h"
#include "boards.h"
#define GET_CONSOLE_MODE_VALUE() palReadPad(CONSOLE_MODE_SWITCH_PORT, CONSOLE_MODE_SWITCH_PIN)
#define SHOULD_INGORE_FLASH() (palReadPad(CONFIG_RESET_SWITCH_PORT, CONFIG_RESET_SWITCH_PIN) == 0)
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
SerialDriver * getConsoleChannel(void);
void consolePutChar(int x);
void consoleOutputBuffer(const uint8_t *buf, int size);
void startConsole(void (*console_line_callback_p)(char *));
bool isConsoleReady(void);
bool isSerialOverUart(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* CONSOLE_IO_H_ */

View File

@ -1,174 +0,0 @@
/**
* @file eficonsole.c
* @brief Console package entry point code
*
*
* @date Nov 15, 2012
* @author Andrey Belomutskiy, (c) 2012-2014
*
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdarg.h>
#include <stdbool.h>
#include "main.h"
#include <chprintf.h>
#include "eficonsole.h"
#include "console_io.h"
#include "svnversion.h"
static Logging logger;
static char fatalErrorMessage[200];
void fatal3(char *msg, char *file, int line) {
strcpy(fatalErrorMessage, msg);
#if EFI_CUSTOM_PANIC_METHOD
chDbgPanic3(fatalErrorMessage, file, line);
#else
chDbgPanic(fatalErrorMessage);
#endif
}
static void myfatal(void) {
chDbgCheck(0, "my fatal");
}
static void myerror(void) {
firmwareError("firmwareError: %d", getRusEfiVersion());
}
static void sayNothing(void) {
/**
* @see EngineState#TS_PROTOCOL_TAG
* this empty response is part of protocol check
* todo: make this logic smarter?
*/
}
static void sayHello(void) {
printMsg(&logger, "*** rusEFI (c) Andrey Belomutskiy, 2012-2014. All rights reserved.");
printMsg(&logger, "rusEFI v%d@%s", getRusEfiVersion(), VCS_VERSION);
printMsg(&logger, "*** Chibios Kernel: %s", CH_KERNEL_VERSION);
printMsg(&logger, "*** Compiled: " __DATE__ " - " __TIME__ "");
printMsg(&logger, "COMPILER=%s", __VERSION__);
printMsg(&logger, "CH_FREQUENCY=%d", CH_FREQUENCY);
#ifdef SERIAL_SPEED
printMsg(&logger, "SERIAL_SPEED=%d", SERIAL_SPEED);
#endif
#ifdef CORTEX_MAX_KERNEL_PRIORITY
printMsg(&logger, "CORTEX_MAX_KERNEL_PRIORITY=%d", CORTEX_MAX_KERNEL_PRIORITY);
#endif
#ifdef STM32_ADCCLK
printMsg(&logger, "STM32_ADCCLK=%d", STM32_ADCCLK);
printMsg(&logger, "STM32_TIMCLK1=%d", STM32_TIMCLK1);
printMsg(&logger, "STM32_TIMCLK2=%d", STM32_TIMCLK2);
printMsg(&logger, "STM32_PCLK1=%d", STM32_PCLK1);
printMsg(&logger, "STM32_PCLK2=%d", STM32_PCLK2);
#endif
printMsg(&logger, "PORT_IDLE_THREAD_STACK_SIZE=%d", PORT_IDLE_THREAD_STACK_SIZE);
printMsg(&logger, "CH_DBG_ENABLE_ASSERTS=%d", CH_DBG_ENABLE_ASSERTS);
printMsg(&logger, "CH_DBG_ENABLED=%d", CH_DBG_ENABLED);
printMsg(&logger, "CH_DBG_SYSTEM_STATE_CHECK=%d", CH_DBG_SYSTEM_STATE_CHECK);
printMsg(&logger, "CH_DBG_ENABLE_STACK_CHECK=%d", CH_DBG_ENABLE_STACK_CHECK);
#ifdef EFI_WAVE_ANALYZER
printMsg(&logger, "EFI_WAVE_ANALYZER=%d", EFI_WAVE_ANALYZER);
#endif
#ifdef EFI_TUNER_STUDIO
printMsg(&logger, "EFI_TUNER_STUDIO=%d", EFI_TUNER_STUDIO);
#else
printMsg(&logger, "EFI_TUNER_STUDIO=%d", 0);
#endif
#ifdef EFI_SIGNAL_EXECUTOR_SLEEP
printMsg(&logger, "EFI_SIGNAL_EXECUTOR_SLEEP=%d", EFI_SIGNAL_EXECUTOR_SLEEP);
#endif
#ifdef EFI_SIGNAL_EXECUTOR_HW_TIMER
printMsg(&logger, "EFI_SIGNAL_EXECUTOR_HW_TIMER=%d", EFI_SIGNAL_EXECUTOR_HW_TIMER);
#endif
printMsg(&logger, "EFI_SHAFT_POSITION_INPUT=%d", EFI_SHAFT_POSITION_INPUT);
printMsg(&logger, "EFI_INTERNAL_ADC=%d", EFI_INTERNAL_ADC);
// printSimpleMsg(&logger, "", );
// printSimpleMsg(&logger, "", );
/**
* Time to finish output. This is needed to avoid mix-up of this methods output and console command confirmation
*/
chThdSleepMilliseconds(5);
}
/**
* This methods prints all threads and their total times
*/
static void cmd_threads(void) {
#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__)
static const char *states[] = { THD_STATE_NAMES };
Thread *tp;
print(" addr stack prio refs state time\r\n");
tp = chRegFirstThread();
do {
print("%.8lx [%.8lx] %4lu %4lu %9s %lu %s\r\n", (uint32_t) tp, 0,
(uint32_t) tp->p_prio, (uint32_t) (tp->p_refs - 1),
states[tp->p_state], (uint32_t) tp->p_time, tp->p_name);
tp = chRegNextThread(tp);
} while (tp != NULL );
#endif
}
/**
* This methods prints the message to whatever is configured as our primary console
*/
void print(const char *format, ...) {
#if !EFI_UART_ECHO_TEST_MODE
if (!isConsoleReady()) {
return;
}
va_list ap;
va_start(ap, format);
chvprintf((BaseSequentialStream*)getConsoleChannel(), format, ap);
va_end(ap);
#endif /* EFI_UART_ECHO_TEST_MODE */
}
void initializeConsole(void) {
initIntermediateLoggingBuffer();
initConsoleLogic();
startConsole(&handleConsoleLine);
initLogging(&logger, "console");
sayHello();
addConsoleAction("test", sayNothing);
addConsoleAction("hello", sayHello);
#if EFI_HAS_RESET
addConsoleAction("reset", scheduleReset);
#endif
addConsoleAction("fatal", myfatal);
addConsoleAction("error", myerror);
addConsoleAction("threadsinfo", cmd_threads);
}

View File

@ -1,25 +0,0 @@
/**
* @file eficonsole.h
* @brief Console package entry point header
*
* @date Nov 15, 2012
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#pragma once
#ifndef RFICONSOLE_H_
#define RFICONSOLE_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void initializeConsole(void);
void print(const char *fmt, ...);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* RFICONSOLE_H_ */

View File

@ -1,442 +0,0 @@
/**
* @file status_loop.cpp
* @brief Human-readable protocol status messages
*
* http://rusefi.com/forum/viewtopic.php?t=263 Dev console overview
* http://rusefi.com/forum/viewtopic.php?t=210 Commands overview
*
*
* @date Mar 15, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "main.h"
#include "status_loop.h"
#include "ec2.h"
#include "adc_inputs.h"
#if EFI_WAVE_ANALYZER
#include "wave_analyzer.h"
#endif
#include "trigger_central.h"
#include "engine_state.h"
#include "io_pins.h"
#include "mmc_card.h"
#include "console_io.h"
#include "malfunction_central.h"
#include "speed_density.h"
#include "advance_map.h"
#if EFI_TUNER_STUDIO
#include "tunerstudio.h"
#endif /* EFI_TUNER_STUDIO */
#include "fuel_math.h"
#include "main_trigger_callback.h"
#include "engine_math.h"
#include "idle_thread.h"
#include "engine_configuration.h"
#include "rfiutil.h"
#include "svnversion.h"
#include "engine.h"
#include "lcd_controller.h"
#include "fuel_math.h"
#if EFI_PROD_CODE
// todo: move this logic to algo folder!
#include "rtc_helper.h"
#include "lcd_HD44780.h"
#include "rusefi.h"
#include "pin_repository.h"
#include "flash_main.h"
#endif
extern Engine engine;
// this 'true' value is needed for simulator
static volatile bool fullLog = true;
int warningEnabled = TRUE;
//int warningEnabled = FALSE;
extern engine_configuration_s * engineConfiguration;
extern engine_configuration2_s * engineConfiguration2;
extern board_configuration_s *boardConfiguration;
#define FULL_LOGGING_KEY "fl"
#if EFI_PROD_CODE || EFI_SIMULATOR
static Logging logger;
static void setWarningEnabled(int value) {
warningEnabled = value;
}
#endif /* EFI_PROD_CODE || EFI_SIMULATOR */
#if EFI_FILE_LOGGING
static Logging fileLogger;
#endif /* EFI_FILE_LOGGING */
static void reportSensorF(const char *caption, float value, int precision) {
#if EFI_PROD_CODE || EFI_SIMULATOR
debugFloat(&logger, caption, value, precision);
#endif /* EFI_PROD_CODE || EFI_SIMULATOR */
#if EFI_FILE_LOGGING
debugFloat(&fileLogger, caption, value, precision);
#endif /* EFI_FILE_LOGGING */
}
static void reportSensorI(const char *caption, int value) {
#if EFI_PROD_CODE || EFI_SIMULATOR
debugInt(&logger, caption, value);
#endif /* EFI_PROD_CODE || EFI_SIMULATOR */
#if EFI_FILE_LOGGING
debugInt(&fileLogger, caption, value);
#endif /* EFI_FILE_LOGGING */
}
static const char* boolean2string(int value) {
return value ? "YES" : "NO";
}
void printSensors(void) {
#if EFI_FILE_LOGGING
resetLogging(&fileLogger);
#endif /* EFI_FILE_LOGGING */
// current time, in milliseconds
int nowMs = currentTimeMillis();
float sec = ((float) nowMs) / 1000;
reportSensorF("time", sec, 3);
reportSensorI("rpm", getRpm());
reportSensorF("maf", getMaf(), 2);
if (engineConfiguration->hasMapSensor) {
reportSensorF(getCaption(LP_MAP), getMap(), 2);
reportSensorF("map_r", getRawMap(), 2);
}
reportSensorF("baro", getBaroPressure(), 2);
reportSensorF("afr", getAfr(), 2);
reportSensorF("vref", getVRef(), 2);
reportSensorF("vbatt", getVBatt(), 2);
reportSensorF("TRG_0_DUTY", getTriggerDutyCycle(0), 2);
reportSensorF("TRG_1_DUTY", getTriggerDutyCycle(1), 2);
reportSensorF(getCaption(LP_THROTTLE), getTPS(), 2);
if (engineConfiguration->hasCltSensor) {
reportSensorF(getCaption(LP_ECT), getCoolantTemperature(), 2);
}
reportSensorF(getCaption(LP_IAT), getIntakeAirTemperature(), 2);
// debugFloat(&logger, "tch", getTCharge1(tps), 2);
#if EFI_FILE_LOGGING
appendPrintf(&fileLogger, "\r\n");
appendToLog(fileLogger.buffer);
#endif /* EFI_FILE_LOGGING */
}
void printState(int currentCkpEventCounter) {
#if EFI_SHAFT_POSITION_INPUT
printSensors();
int rpm = getRpm();
debugInt(&logger, "ckp_c", currentCkpEventCounter);
// debugInt(&logger, "idl", getIdleSwitch());
// debugFloat(&logger, "table_spark", getAdvance(rpm, getMaf()), 2);
float engineLoad = getEngineLoad();
float baseFuel = getBaseFuel(&engine, rpm);
debugFloat(&logger, "fuel_base", baseFuel, 2);
// debugFloat(&logger, "fuel_iat", getIatCorrection(getIntakeAirTemperature()), 2);
// debugFloat(&logger, "fuel_clt", getCltCorrection(getCoolantTemperature()), 2);
debugFloat(&logger, "fuel_lag", getInjectorLag(getVBatt()), 2);
debugFloat(&logger, "fuel", getRunningFuel(baseFuel, &engine, rpm), 2);
debugFloat(&logger, "timing", getAdvance(rpm, engineLoad), 2);
// float map = getMap();
// float fuel = getDefaultFuel(rpm, map);
// debugFloat(&logger, "d_fuel", fuel, 2);
#endif /* EFI_SHAFT_POSITION_INPUT */
}
#define INITIAL_FULL_LOG TRUE
//#define INITIAL_FULL_LOG FALSE
static char LOGGING_BUFFER[700];
volatile int needToReportStatus = FALSE;
static int prevCkpEventCounter = -1;
static Logging logger2;
static void printStatus(void) {
needToReportStatus = TRUE;
}
/**
* Time when the firmware version was reported last time, in seconds
* TODO: implement a request/response instead of just constantly sending this out
*/
static systime_t timeOfPreviousPrintVersion = (systime_t) -1;
#if EFI_PROD_CODE
static void printOutPin(const char *pinName, brain_pin_e hwPin) {
appendPrintf(&logger, "outpin%s%s@%s%s", DELIMETER, pinName,
hwPortname(hwPin), DELIMETER);
}
#endif /* EFI_PROD_CODE */
static void printInfo(systime_t nowSeconds) {
/**
* we report the version every 4 seconds - this way the console does not need to
* request it and we will display it pretty soon
*/
if (overflowDiff(nowSeconds, timeOfPreviousPrintVersion) < 4) {
return;
}
timeOfPreviousPrintVersion = nowSeconds;
appendPrintf(&logger, "rusEfiVersion%s%d@%s %s%s", DELIMETER, getRusEfiVersion(), VCS_VERSION,
getConfigurationName(engineConfiguration),
DELIMETER);
#if EFI_PROD_CODE
printOutPin(WC_CRANK1, boardConfiguration->triggerInputPins[0]);
printOutPin(WC_CRANK2, boardConfiguration->triggerInputPins[1]);
printOutPin(WA_CHANNEL_1, boardConfiguration->logicAnalyzerPins[0]);
printOutPin(WA_CHANNEL_2, boardConfiguration->logicAnalyzerPins[1]);
for (int i = 0; i < engineConfiguration->cylindersCount; i++) {
// todo: extract method?
io_pin_e pin = (io_pin_e) ((int) SPARKOUT_1_OUTPUT + i);
printOutPin(getPinName(pin), boardConfiguration->ignitionPins[i]);
pin = (io_pin_e) ((int) INJECTOR_1_OUTPUT + i);
printOutPin(getPinName(pin), boardConfiguration->injectionPins[i]);
}
#endif
}
static systime_t timeOfPreviousReport = (systime_t) -1;
extern char errorMessageBuffer[200];
/**
* @brief Sends all pending data to dev console
*/
void updateDevConsoleState(void) {
if (!isConsoleReady()) {
return;
}
// looks like this is not needed anymore
// checkIfShouldHalt();
printPending();
#if EFI_PROD_CODE
// todo: unify with simulator!
if (hasFirmwareError()) {
printMsg(&logger, "firmware error: %s", errorMessageBuffer);
warningEnabled = FALSE;
chThdSleepMilliseconds(200);
return;
}
#endif
#if EFI_PROD_CODE
pokeAdcInputs();
#endif
if (!fullLog) {
return;
}
systime_t nowSeconds = getTimeNowSeconds();
printInfo(nowSeconds);
int currentCkpEventCounter = getCrankEventCounter();
if (prevCkpEventCounter == currentCkpEventCounter && timeOfPreviousReport == nowSeconds) {
return;
}
timeOfPreviousReport = nowSeconds;
prevCkpEventCounter = currentCkpEventCounter;
printState(currentCkpEventCounter);
#if EFI_WAVE_ANALYZER
printWave(&logger);
#endif
printLine(&logger);
}
#if EFI_PROD_CODE
/*
* command example:
* sfm 3500 400
* that would be 'show fuel for rpm 3500 maf 4.0'
*/
static void showFuelMap2(float rpm, float engineLoad) {
float baseFuel = getBaseTableFuel((int) rpm, engineLoad);
float iatCorrection = getIatCorrection(getIntakeAirTemperature());
float cltCorrection = getCltCorrection(getCoolantTemperature());
float injectorLag = getInjectorLag(getVBatt());
scheduleMsg(&logger2, "rpm=%f engineLoad=%f", rpm, engineLoad);
scheduleMsg(&logger2, "baseFuel=%f", baseFuel);
scheduleMsg(&logger2, "iatCorrection=%f cltCorrection=%f injectorLag=%f", iatCorrection, cltCorrection,
injectorLag);
float value = getRunningFuel(baseFuel, &engine, (int) rpm);
scheduleMsg(&logger2, "injection pulse width: %f", value);
}
static void showFuelMap(void) {
showFuelMap2((float) getRpm(), getEngineLoad());
}
#endif /* EFI_PROD_CODE */
static THD_WORKING_AREA(lcdThreadStack, UTILITY_THREAD_STACK_SIZE);
static void lcdThread(void) {
chRegSetThreadName("lcd");
while (true) {
#if EFI_HD44780_LCD
updateHD44780lcd();
#endif
chThdSleepMilliseconds(boardConfiguration->lcdThreadPeriod);
}
}
static THD_WORKING_AREA(tsThreadStack, UTILITY_THREAD_STACK_SIZE);
#if EFI_TUNER_STUDIO
void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels) {
#if EFI_SHAFT_POSITION_INPUT
int rpm = getRpm();
#else
int rpm = 0;
#endif
float tps = getTPS();
float coolant = getCoolantTemperature();
float intake = getIntakeAirTemperature();
float engineLoad = getEngineLoad();
float baseFuel = getBaseTableFuel((int) rpm, engineLoad);
tsOutputChannels->rpm = rpm;
tsOutputChannels->coolant_temperature = coolant;
tsOutputChannels->intake_air_temperature = intake;
tsOutputChannels->throttle_positon = tps;
tsOutputChannels->mass_air_flow = getMaf();
tsOutputChannels->air_fuel_ratio = getAfr();
tsOutputChannels->v_batt = getVBatt();
tsOutputChannels->tpsADC = getTPS10bitAdc();
tsOutputChannels->atmospherePressure = getBaroPressure();
tsOutputChannels->manifold_air_pressure = getMap();
tsOutputChannels->checkEngine = hasErrorCodes();
#if EFI_PROD_CODE
tsOutputChannels->needBurn = getNeedToWriteConfiguration();
tsOutputChannels->hasSdCard = isSdCardAlive();
tsOutputChannels->isFuelPumpOn = getOutputPinValue(FUEL_PUMP_RELAY);
tsOutputChannels->isFanOn = getOutputPinValue(FAN_RELAY);
tsOutputChannels->isO2HeaterOn = getOutputPinValue(O2_HEATER);
tsOutputChannels->ignition_enabled = engineConfiguration->isIgnitionEnabled;
tsOutputChannels->injection_enabled = engineConfiguration->isInjectionEnabled;
tsOutputChannels->cylinder_cleanup_enabled = engineConfiguration->isCylinderCleanupEnabled;
tsOutputChannels->secondTriggerChannelEnabled = engineConfiguration->secondTriggerChannelEnabled;
tsOutputChannels->isCltError = !isValidCoolantTemperature(getCoolantTemperature());
tsOutputChannels->isIatError = !isValidIntakeAirTemperature(getIntakeAirTemperature());
#endif
tsOutputChannels->tCharge = getTCharge(rpm, tps, coolant, intake);
tsOutputChannels->sparkDwell = getSparkDwellMs(rpm);
tsOutputChannels->pulseWidth = getRunningFuel(baseFuel, &engine, rpm);
tsOutputChannels->crankingFuel = getCrankingFuel();
}
extern TunerStudioOutputChannels tsOutputChannels;
#endif /* EFI_TUNER_STUDIO */
static void tsStatusThread(void *arg) {
chRegSetThreadName("tuner s");
while (true) {
#if EFI_TUNER_STUDIO
// sensor state for EFI Analytics Tuner Studio
updateTunerStudioState(&tsOutputChannels);
#endif /* EFI_TUNER_STUDIO */
chThdSleepMilliseconds(boardConfiguration->tunerStudioThreadPeriod);
}
}
void initStatusLoop(void) {
#if EFI_PROD_CODE || EFI_SIMULATOR
initLoggingExt(&logger, "status loop", LOGGING_BUFFER, sizeof(LOGGING_BUFFER));
#endif /* EFI_PROD_CODE || EFI_SIMULATOR */
setFullLog(INITIAL_FULL_LOG);
addConsoleActionI(FULL_LOGGING_KEY, setFullLog);
addConsoleActionI("warn", setWarningEnabled);
#if EFI_PROD_CODE
initLogging(&logger2, "main event handler");
addConsoleActionFF("fuelinfo2", showFuelMap2);
addConsoleAction("fuelinfo", showFuelMap);
addConsoleAction("status", printStatus);
#endif /* EFI_PROD_CODE */
#if EFI_FILE_LOGGING
initLogging(&fileLogger, "file logger");
#endif /* EFI_FILE_LOGGING */
}
void startStatusThreads(void) {
// todo: refactoring needed, this file should probably be split into pieces
chThdCreateStatic(lcdThreadStack, sizeof(lcdThreadStack), NORMALPRIO, (tfunc_t) lcdThread, (void*) NULL);
chThdCreateStatic(tsThreadStack, sizeof(tsThreadStack), NORMALPRIO, (tfunc_t) tsStatusThread, (void*) NULL);
}
void setFullLog(int value) {
print("Setting full logging: %s\r\n", boolean2string(value));
printMsg(&logger, "%s%d", FULL_LOGGING_KEY, value);
fullLog = value;
}
bool getFullLog(void) {
return fullLog;
}

View File

@ -1,30 +0,0 @@
/**
* @file status_loop.h
*
* @date Mar 15, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef CONSOLE_LOOP_H_
#define CONSOLE_LOOP_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void printState(int currentCkpEventCounter);
void initStatusLoop(void);
void updateDevConsoleState(void);
bool getFullLog(void);
void printSensors(void);
void setFullLog(int value);
void startStatusThreads(void);
void sayOsHello(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* CONSOLE_LOOP_H_ */

View File

@ -1,526 +0,0 @@
/**
* @file tunerstudio.cpp
* @brief Integration with EFI Analytics Tuner Studio software
*
* todo: merge this file with tunerstudio_algo.c?
*
* @date Aug 26, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "main.h"
#include "engine_state.h"
#include "tunerstudio.h"
#include "main_trigger_callback.h"
#include "flash_main.h"
#include "tunerstudio_algo.h"
#include "tunerstudio_configuration.h"
#include "malfunction_central.h"
#include "console_io.h"
#include "crc.h"
#if EFI_TUNER_STUDIO
#if EFI_PROD_CODE
#include "pin_repository.h"
#include "usbconsole.h"
#include "map_averaging.h"
extern SerialUSBDriver SDU1;
#define CONSOLE_DEVICE &SDU1
#define TS_SERIAL_UART_DEVICE &SD3
//#define TS_SERIAL_SPEED 115200
#define TS_SERIAL_SPEED 38400
static SerialConfig tsSerialConfig = { TS_SERIAL_SPEED, 0, USART_CR2_STOP1_BITS | USART_CR2_LINEN, 0 };
#endif /* EFI_PROD_CODE */
#define MAX_PAGE_ID 0
#define PAGE_0_SIZE 5928
#define TS_OUTPUT_SIZE 116
// in MS, that's 10 seconds
#define TS_READ_TIMEOUT 10000
#define PROTOCOL "001"
BaseChannel * getTsSerialDevice(void) {
#if EFI_PROD_CODE
if (isSerialOverUart()) {
// if console uses UART then TS uses USB
return (BaseChannel *) &SDU1;
} else {
return (BaseChannel *) TS_SERIAL_UART_DEVICE;
}
#else
return (BaseChannel *) TS_SIMULATOR_PORT;
#endif
}
static Logging logger;
extern persistent_config_s configWorkingCopy;
extern persistent_config_container_s persistentState;
static efitimems_t previousWriteReportMs = 0;
static int ts_serail_ready(void) {
#if EFI_PROD_CODE
if (isSerialOverUart()) {
// TS uses USB when console uses serial
return is_usb_serial_ready();
} else {
// TS uses serial when console uses USB
return TRUE;
}
#else
return TRUE;
#endif
}
static THD_WORKING_AREA(TS_WORKING_AREA, UTILITY_THREAD_STACK_SIZE);
static int tsCounter = 0;
//static TunerStudioWriteValueRequest writeValueRequest;
//static TunerStudioWriteChunkRequest writeChunkRequest;
extern TunerStudioOutputChannels tsOutputChannels;
extern TunerStudioState tsState;
extern engine_configuration_s *engineConfiguration;
extern board_configuration_s *boardConfiguration;
static void printStats(void) {
#if EFI_PROD_CODE
if (!isSerialOverUart()) {
scheduleMsg(&logger, "TS RX on %s%d/TX on %s%d", portname(TS_SERIAL_RX_PORT), TS_SERIAL_RX_PIN,
portname(TS_SERIAL_TX_PORT), TS_SERIAL_TX_PIN);
}
#endif /* EFI_PROD_CODE */
scheduleMsg(&logger, "TunerStudio total/error counter=%d/%d H=%d / O counter=%d size=%d / P=%d / B=%d", tsCounter, tsState.errorCounter, tsState.queryCommandCounter, tsState.outputChannelsCommandCounter,
sizeof(tsOutputChannels), tsState.readPageCommandsCounter, tsState.burnCommandCounter);
scheduleMsg(&logger, "TunerStudio W counter=%d / C = %d / P = %d / current page %d", tsState.writeValueCommandCounter, tsState.writeChunkCommandCounter,
tsState.pageCommandCounter, tsState.currentPageId);
scheduleMsg(&logger, "page size=%d", sizeof(engine_configuration_s));
// scheduleMsg(&logger, "analogChartFrequency %d",
// (int) (&engineConfiguration->analogChartFrequency) - (int) engineConfiguration);
//
// int fuelMapOffset = (int) (&engineConfiguration->fuelTable) - (int) engineConfiguration;
// scheduleMsg(&logger, "fuelTable %d", fuelMapOffset);
//
// int offset = (int) (&boardConfiguration->o2heaterPin) - (int) engineConfiguration;
// scheduleMsg(&logger, "o2heaterPin %d", offset);
//
// offset = (int) (&boardConfiguration->idleSolenoidFrequency) - (int) engineConfiguration;
// scheduleMsg(&logger, "idleSolenoidFrequency %d", offset);
}
void tunerStudioWriteData(const uint8_t * buffer, int size) {
chSequentialStreamWrite(getTsSerialDevice(), buffer, size);
}
void tunerStudioDebug(const char *msg) {
#if EFI_TUNER_STUDIO_VERBOSE
scheduleMsg(&logger, "%s", msg);
printStats();
#endif
}
char *getWorkingPageAddr(int pageIndex) {
switch (pageIndex) {
case 0:
return (char*) &configWorkingCopy.engineConfiguration;
// case 1:
// return (char*) &configWorkingCopy.boardConfiguration;
// case 2: // fuelTable
// case 3: // ignitionTable
// case 4: // veTable
// case 5: // afrTable
// return (char*) &configWorkingCopy.engineConfiguration + PAGE_0_SIZE + (pageIndex - 2) * 1024;
}
return NULL;
}
int getTunerStudioPageSize(int pageIndex) {
switch (pageIndex) {
case 0:
return PAGE_0_SIZE;
// case 1:
// return sizeof(configWorkingCopy.boardConfiguration);
// case 2:
// case 3:
// case 4:
// return 1024;
}
return 0;
}
void handlePageSelectCommand(ts_response_format_e mode, uint16_t pageId) {
tsState.pageCommandCounter++;
tsState.currentPageId = pageId;
scheduleMsg(&logger, "page %d selected", tsState.currentPageId);
tsSendResponse(mode, NULL, 0);
}
/**
* This command is needed to make the whole transfer a bit faster
* @note See also handleWriteValueCommand
*/
void handleWriteChunkCommand(ts_response_format_e mode, short offset, short count, void *content) {
tsState.writeChunkCommandCounter++;
scheduleMsg(&logger, "receiving page %d chunk offset %d size %d", tsState.currentPageId, offset, count);
if (offset > getTunerStudioPageSize(tsState.currentPageId)) {
scheduleMsg(&logger, "ERROR offset %d", offset);
tunerStudioError("ERROR: out of range");
offset = 0;
}
if (count > getTunerStudioPageSize(tsState.currentPageId)) {
tunerStudioError("ERROR: unexpected count");
scheduleMsg(&logger, "ERROR count %d", count);
count = 0;
}
uint8_t * addr = (uint8_t *) (getWorkingPageAddr(tsState.currentPageId) + offset);
memcpy(addr, content, count);
tsSendResponse(mode, NULL, 0);
}
/**
* 'Write' command receives a single value at a given offset
* @note Writing values one by one is pretty slow
*/
void handleWriteValueCommand(ts_response_format_e mode, uint16_t page, uint16_t offset, uint8_t value) {
tsState.writeValueCommandCounter++;
tsState.currentPageId = page;
//tunerStudioDebug("got W (Write)"); // we can get a lot of these
#if EFI_TUNER_STUDIO_VERBOSE
// scheduleMsg(&logger, "Page number %d\r\n", pageId); // we can get a lot of these
#endif
// int size = sizeof(TunerStudioWriteValueRequest);
// scheduleMsg(&logger, "Reading %d\r\n", size);
if (offset > getTunerStudioPageSize(tsState.currentPageId)) {
tunerStudioError("ERROR: out of range2");
scheduleMsg(&logger, "ERROR offset %d", offset);
offset = 0;
return;
}
efitimems_t nowMs = currentTimeMillis();
if (nowMs - previousWriteReportMs > 5) {
previousWriteReportMs = nowMs;
scheduleMsg(&logger, "page %d offset %d: value=%d", tsState.currentPageId, offset, value);
}
getWorkingPageAddr(tsState.currentPageId)[offset] = value;
// scheduleMsg(&logger, "va=%d", configWorkingCopy.boardConfiguration.idleValvePin);
}
static void sendErrorCode(void) {
tunerStudioWriteCrcPacket(TS_RESPONSE_CRC_FAILURE, NULL, 0);
}
void handlePageReadCommand(ts_response_format_e mode, uint16_t pageId, uint16_t offset, uint16_t count) {
tsState.readPageCommandsCounter++;
tunerStudioDebug("got R (Read page)");
tsState.currentPageId = pageId;
#if EFI_TUNER_STUDIO_VERBOSE
scheduleMsg(&logger, "Page requested: page %d offset=%d count=%d", (int)tsState.currentPageId, offset, count);
#endif
if (tsState.currentPageId > MAX_PAGE_ID) {
scheduleMsg(&logger, "invalid Page number %x", tsState.currentPageId);
// something is not right here
tsState.currentPageId = 0;
tunerStudioError("ERROR: invalid page");
return;
}
int size = getTunerStudioPageSize(tsState.currentPageId);
if (size < offset + count) {
scheduleMsg(&logger, "invalid offset/count %d/%d", offset, count);
sendErrorCode();
return;
}
const uint8_t *addr = (const uint8_t *) (getWorkingPageAddr(tsState.currentPageId) + offset);
tsSendResponse(mode, addr, count);
#if EFI_TUNER_STUDIO_VERBOSE
scheduleMsg(&logger, "Sending %d done", count);
#endif
}
/**
* 'Burn' command is a command to commit the changes
*/
void handleBurnCommand(ts_response_format_e mode, uint16_t page) {
efitimems_t nowMs = currentTimeMillis();
tsState.burnCommandCounter++;
tunerStudioDebug("got B (Burn)");
tsState.currentPageId = page;
#if EFI_TUNER_STUDIO_VERBOSE
// pointless since we only have one page now
// scheduleMsg(&logger, "Page number %d", tsState.currentPageId);
#endif
// todo: how about some multi-threading?
memcpy(&persistentState.persistentConfiguration, &configWorkingCopy, sizeof(persistent_config_s));
#if EFI_INTERNAL_FLASH
setNeedToWriteConfiguration();
#endif
incrementGlobalConfigurationVersion();
tunerStudioWriteCrcPacket(TS_RESPONSE_BURN_OK, NULL, 0);
scheduleMsg(&logger, "burned in (ms): %d", currentTimeMillis() - nowMs);
}
static TunerStudioReadRequest readRequest;
static short int pageIn;
static bool handlePlainCommand(uint8_t command) {
if (command == TS_HELLO_COMMAND) {
scheduleMsg(&logger, "Got naked Query command");
handleQueryCommand(TS_PLAIN);
return true;
} else if (command == 't' || command == 'T') {
handleTestCommand();
return true;
} else if (command == TS_PAGE_COMMAND) {
int recieved = chSequentialStreamRead(getTsSerialDevice(), (uint8_t *)&pageIn, sizeof(pageIn));
// todo: validate 'recieved' value
handlePageSelectCommand(TS_PLAIN, pageIn);
return true;
} else if (command == TS_READ_COMMAND) {
//scheduleMsg(&logger, "Got naked READ PAGE???");
int recieved = chSequentialStreamRead(getTsSerialDevice(), (uint8_t *)&readRequest, sizeof(readRequest));
if (recieved != sizeof(readRequest)) {
// todo: handler error
return true;
}
handlePageReadCommand(TS_PLAIN, readRequest.page, readRequest.offset, readRequest.count);
return true;
} else if (command == TS_OUTPUT_COMMAND) {
//scheduleMsg(&logger, "Got naked Channels???");
handleOutputChannelsCommand(TS_PLAIN);
return true;
} else if (command == 'F') {
tunerStudioDebug("not ignoring F");
tunerStudioWriteData((const uint8_t *) PROTOCOL, strlen(PROTOCOL));
return true;
} else {
return false;
}
}
static bool isKnownCommand(char command) {
return command == TS_HELLO_COMMAND || command == TS_READ_COMMAND || command == TS_OUTPUT_COMMAND
|| command == TS_PAGE_COMMAND || command == TS_BURN_COMMAND || command == TS_SINGLE_WRITE_COMMAND
|| command == TS_CHUNK_WRITE_COMMAND;
}
static uint8_t firstByte;
static uint8_t secondByte;
#define CRC_VALUE_SIZE 4
// todo: double-check this
#define CRC_WRAPPING_SIZE 7
/**
* we use 'blockingFactor = 256' in rusefi.ini
* todo: should we just do (256 + CRC_WRAPPING_SIZE) ?
*/
static uint8_t crcIoBuffer[300];
static msg_t tsThreadEntryPoint(void *arg) {
(void) arg;
chRegSetThreadName("tunerstudio thread");
int wasReady = false;
while (true) {
int isReady = ts_serail_ready();
if (!isReady) {
chThdSleepMilliseconds(10);
wasReady = false;
continue;
}
if (!wasReady) {
wasReady = TRUE;
// scheduleSimpleMsg(&logger, "ts channel is now ready ", hTimeNow());
}
tsCounter++;
int recieved = chSequentialStreamRead(getTsSerialDevice(), &firstByte, 1);
if (recieved != 1) {
tunerStudioError("ERROR: no command");
continue;
}
// scheduleMsg(&logger, "Got first=%x=[%c]", firstByte, firstByte);
if (handlePlainCommand(firstByte))
continue;
recieved = chSequentialStreamRead(getTsSerialDevice(), &secondByte, 1);
if (recieved != 1) {
tunerStudioError("ERROR: no second");
continue;
}
// scheduleMsg(&logger, "Got secondByte=%x=[%c]", secondByte, secondByte);
uint32_t incomingPacketSize = firstByte * 256 + secondByte;
if (incomingPacketSize == 0 || incomingPacketSize > (sizeof(crcIoBuffer) - CRC_WRAPPING_SIZE)) {
scheduleMsg(&logger, "TunerStudio: invalid size: %d", incomingPacketSize);
tunerStudioError("ERROR: size");
sendErrorCode();
continue;
}
recieved = chnReadTimeout(getTsSerialDevice(), crcIoBuffer, 1, MS2ST(TS_READ_TIMEOUT));
if (recieved != 1) {
tunerStudioError("ERROR: did not receive command");
continue;
}
char command = crcIoBuffer[0];
if (!isKnownCommand(command)) {
scheduleMsg(&logger, "unexpected command %x", command);
sendErrorCode();
continue;
}
// scheduleMsg(&logger, "TunerStudio: reading %d+4 bytes(s)", incomingPacketSize);
recieved = chnReadTimeout(getTsSerialDevice(), (uint8_t * ) (crcIoBuffer + 1), incomingPacketSize + CRC_VALUE_SIZE - 1,
MS2ST(TS_READ_TIMEOUT));
int expectedSize = incomingPacketSize + CRC_VALUE_SIZE - 1;
if (recieved != expectedSize) {
scheduleMsg(&logger, "got ONLY %d for packet size %d/%d for command %c", recieved, incomingPacketSize,
expectedSize, command);
tunerStudioError("ERROR: not enough");
continue;
}
uint32_t expectedCrc = *(uint32_t*) (crcIoBuffer + incomingPacketSize);
expectedCrc = SWAP_UINT32(expectedCrc);
uint32_t actualCrc = crc32(crcIoBuffer, incomingPacketSize);
if (actualCrc != expectedCrc) {
scheduleMsg(&logger, "TunerStudio: CRC %x %x %x %x", crcIoBuffer[incomingPacketSize + 0],
crcIoBuffer[incomingPacketSize + 1], crcIoBuffer[incomingPacketSize + 2],
crcIoBuffer[incomingPacketSize + 3]);
scheduleMsg(&logger, "TunerStudio: command %c actual CRC %x/expected %x", crcIoBuffer[0], actualCrc,
expectedCrc);
tunerStudioError("ERROR: CRC issue");
continue;
}
// scheduleMsg(&logger, "TunerStudio: P00-07 %x %x %x %x %x %x %x %x", crcIoBuffer[0], crcIoBuffer[1],
// crcIoBuffer[2], crcIoBuffer[3], crcIoBuffer[4], crcIoBuffer[5], crcIoBuffer[6], crcIoBuffer[7]);
int success = tunerStudioHandleCrcCommand(crcIoBuffer, incomingPacketSize);
if (!success)
print("got unexpected TunerStudio command %x:%c\r\n", command, command);
}
#if defined __GNUC__
return 0;
#endif
}
void syncTunerStudioCopy(void) {
memcpy(&configWorkingCopy, &persistentState.persistentConfiguration, sizeof(persistent_config_s));
}
void startTunerStudioConnectivity(void) {
initLogging(&logger, "tuner studio");
if (sizeof(engine_configuration_s) != getTunerStudioPageSize(0))
firmwareError("TS page size mismatch: %d/%d", sizeof(engine_configuration_s), getTunerStudioPageSize(0));
if (sizeof(TunerStudioOutputChannels) != TS_OUTPUT_SIZE)
firmwareError("TS outputs size mismatch: %d/%d", sizeof(TunerStudioOutputChannels), TS_OUTPUT_SIZE);
memset(&tsState, 0, sizeof(tsState));
#if EFI_PROD_CODE
if (isSerialOverUart()) {
print("TunerStudio over USB serial");
usb_serial_start();
} else {
print("TunerStudio over USART");
mySetPadMode("tunerstudio rx", TS_SERIAL_RX_PORT, TS_SERIAL_RX_PIN, PAL_MODE_ALTERNATE(TS_SERIAL_AF));
mySetPadMode("tunerstudio tx", TS_SERIAL_TX_PORT, TS_SERIAL_TX_PIN, PAL_MODE_ALTERNATE(TS_SERIAL_AF));
sdStart(TS_SERIAL_UART_DEVICE, &tsSerialConfig);
}
#endif /* EFI_PROD_CODE */
syncTunerStudioCopy();
addConsoleAction("tsinfo", printStats);
chThdCreateStatic(TS_WORKING_AREA, sizeof(TS_WORKING_AREA), NORMALPRIO, tsThreadEntryPoint, NULL);
}
/**
* Adds size to the beginning of a packet and a crc32 at the end. Then send the packet.
*/
void tunerStudioWriteCrcPacket(const uint8_t command, const void *buf, const uint16_t size) {
// todo: max size validation
*(uint16_t *) crcIoBuffer = SWAP_UINT16(size + 1); // packet size including command
*(uint8_t *) (crcIoBuffer + 2) = command;
if (size != 0)
memcpy(crcIoBuffer + 3, buf, size);
// CRC on whole packet
uint32_t crc = crc32((void *) (crcIoBuffer + 2), (uint32_t) (size + 1));
*(uint32_t *) (crcIoBuffer + 2 + 1 + size) = SWAP_UINT32(crc);
// scheduleMsg(&logger, "TunerStudio: CRC command %x size %d", command, size);
tunerStudioWriteData(crcIoBuffer, size + 2 + 1 + 4); // with size, command and CRC
}
#endif /* EFI_TUNER_STUDIO */

View File

@ -1,55 +0,0 @@
/**
* @file tunerstudio.h
*
* @date Aug 26, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef TUNERSTUDIO_H_
#define TUNERSTUDIO_H_
#include "tunerstudio_configuration.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
void startTunerStudioConnectivity(void);
void syncTunerStudioCopy(void);
void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels);
void tunerStudioWriteCrcPacket(const uint8_t command, const void *buf, const uint16_t size);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#if defined __GNUC__
// GCC
#define pre_packed
#define post_packed __attribute__((packed))
#else
// IAR
#define pre_packed __packed
#define post_packed
#endif
typedef pre_packed struct
post_packed {
short int offset;
short int count;
} TunerStudioWriteChunkRequest;
typedef pre_packed struct
post_packed {
short int page;
short int offset;
short int count;
} TunerStudioReadRequest;
typedef pre_packed struct
post_packed {
short int offset;
unsigned char value;
} TunerStudioWriteValueRequest;
#endif /* TUNERSTUDIO_H_ */

View File

@ -1,3 +0,0 @@
TUNERSTUDIO_SRC_CPP = $(PROJECT_DIR)/console/tunerstudio/tunerstudio_algo.cpp \
$(PROJECT_DIR)/console/tunerstudio/tunerstudio.cpp

View File

@ -1,160 +0,0 @@
/**
* @file tunerstudio_algo.cpp
* @brief Tuner Studio plain protocol implementation
*
* This implementation would not happen without the documentation
* provided by Jon Zeeff (jon@zeeff.com)
*
* Tuner Studio has a really simple protocol, a minimal implementation
* capable of displaying current engine state on the gauges would
* require only two commands: queryCommand and ochGetCommand
*
* queryCommand:
* Communication initialization command. TunerStudio sends a single byte H
* ECU response:
* One of the known ECU id strings. We are using "MShift v0.01" id string.
*
* ochGetCommand:
* Request for output channels state.TunerStudio sends a single byte O
* ECU response:
* A snapshot of output channels as described in [OutputChannels] section of the .ini file
* The length of this block is 'ochBlockSize' property of the .ini file
*
* These two commands are enough to get working gauges. In order to start configuring the ECU using
* tuner studio, three more commands should be implemented:
*
* todo: merge this file with tunerstudio.c?
*
*
* @date Oct 22, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include "tunerstudio_algo.h"
#include "tunerstudio_configuration.h"
#include "engine_configuration.h"
#include "tunerstudio.h"
#include "svnversion.h"
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE (!FALSE)
#endif
TunerStudioState tsState;
TunerStudioOutputChannels tsOutputChannels;
/**
* this is a local copy of the configuration. Any changes to this copy
* have no effect until this copy is explicitly propagated to the main working copy
*/
persistent_config_s configWorkingCopy;
void tunerStudioError(const char *msg) {
tunerStudioDebug(msg);
tsState.errorCounter++;
}
int tunerStudioHandleCrcCommand(uint8_t *data, int incomingPacketSize) {
char command = data[0];
data++;
if (command == TS_HELLO_COMMAND) {
tunerStudioDebug("got CRC Query");
handleQueryCommand(TS_CRC);
} else if (command == TS_OUTPUT_COMMAND) {
handleOutputChannelsCommand(TS_CRC);
} else if (command == TS_PAGE_COMMAND) {
uint16_t page = *(uint16_t *) data;
handlePageSelectCommand(TS_CRC, page);
} else if (command == TS_CHUNK_WRITE_COMMAND) {
uint16_t offset = *(uint16_t *) data;
uint16_t count = *(uint16_t *) (data + 2);
handleWriteChunkCommand(TS_CRC, offset, count, data + 4);
} else if (command == TS_SINGLE_WRITE_COMMAND) {
uint16_t page = *(uint16_t *) data;
uint16_t offset = *(uint16_t *) (data + 2);
uint8_t value = data[4];
handleWriteValueCommand(TS_CRC, page, offset, value);
} else if (command == TS_BURN_COMMAND) {
uint16_t page = *(uint16_t *) data;
handleBurnCommand(TS_CRC, page);
} else if (command == TS_READ_COMMAND) {
uint16_t page = *(uint16_t *) data;
uint16_t offset = *(uint16_t *) (data + 2);
uint16_t count = *(uint16_t *) (data + 4);
handlePageReadCommand(TS_CRC, page, offset, count);
} else if (command == 't' || command == 'T') {
handleTestCommand();
} else if (command == 'F') {
tunerStudioDebug("ignoring F");
/**
* http://www.msextra.com/forums/viewtopic.php?f=122&t=48327
* Response from TS support: This is an optional command *
* "The F command is used to find what ini. file needs to be loaded in TunerStudio to match the controller.
* If you are able to just make your firmware ignore the command that would work.
* Currently on some firmware versions the F command is not used and is just ignored by the firmware as a unknown command."
*/
} else {
tunerStudioError("ERROR: ignoring unexpected command");
return FALSE;
}
return TRUE;
}
void tsSendResponse(ts_response_format_e mode, const uint8_t * buffer, int size) {
if (mode == TS_CRC) {
tunerStudioWriteCrcPacket(TS_RESPONSE_OK, buffer, size);
} else {
if (size > 0)
tunerStudioWriteData(buffer, size);
}
}
/**
* Query with CRC takes place while re-establishing connection
* Query without CRC takes place on TunerStudio startup
*/
void handleQueryCommand(ts_response_format_e mode) {
tsState.queryCommandCounter++;
tunerStudioDebug("got H (queryCommand)");
tsSendResponse(mode, (const uint8_t *) TS_SIGNATURE, strlen(TS_SIGNATURE) + 1);
}
/**
* @brief 'Output' command sends out a snapshot of current values
*/
void handleOutputChannelsCommand(ts_response_format_e mode) {
tsState.outputChannelsCommandCounter++;
// this method is invoked too often to print any debug information
tsSendResponse(mode, (const uint8_t *) &tsOutputChannels, sizeof(TunerStudioOutputChannels));
}
void handleTestCommand(void) {
/**
* this is NOT a standard TunerStudio command, this is my own
* extension of the protocol to simplify troubleshooting
*/
tunerStudioDebug("got T (Test)");
tunerStudioWriteData((const uint8_t *)VCS_VERSION, sizeof(VCS_VERSION));
/**
* Please note that this response is a magic constant used by dev console for protocol detection
* @see EngineState#TS_PROTOCOL_TAG
*/
tunerStudioWriteData((const uint8_t *) " ts_p_alive\r\n", 8);
}

View File

@ -1,74 +0,0 @@
/**
* @file tunerstudio_algo.h
*
* @date Oct 22, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef TUNERSTUDIO_ALGO_H_
#define TUNERSTUDIO_ALGO_H_
#define TS_SIGNATURE "MShift v0.01"
#include <stdint.h>
// http://en.wikipedia.org/wiki/Endianness
#define SWAP_UINT16(x) ((x) << 8) | ((x) >> 8)
#define SWAP_UINT32(x) (((x) >> 24) & 0xff) | (((x) << 8) & 0xff0000) | (((x) >> 8) & 0xff00) | (((x) << 24) & 0xff000000)
// response codes
#define TS_RESPONSE_OK 0x00
#define TS_RESPONSE_BURN_OK 0x04
#define TS_RESPONSE_CRC_FAILURE 0x82
typedef enum {
TS_PLAIN = 0,
TS_CRC = 1
} ts_response_format_e;
typedef struct {
int queryCommandCounter;
int outputChannelsCommandCounter;
int readPageCommandsCounter;
int burnCommandCounter;
int pageCommandCounter;
int writeValueCommandCounter;
int writeChunkCommandCounter;
int errorCounter;
// this field is in the end to simply aligning situation
short currentPageId;
} TunerStudioState;
int tunerStudioHandleCrcCommand(uint8_t *data, int incomingPacketSize);
void handleTestCommand(void);
void handleQueryCommand(ts_response_format_e mode);
void tsSendResponse(ts_response_format_e mode, const uint8_t * buffer, int size);
void handleOutputChannelsCommand(ts_response_format_e mode);
char *getWorkingPageAddr(int pageIndex);
int getTunerStudioPageSize(int pageIndex);
void handleWriteValueCommand(ts_response_format_e mode, uint16_t page, uint16_t offset, uint8_t value);
void handleWriteChunkCommand(ts_response_format_e mode, short offset, short count, void *content);
void handlePageSelectCommand(ts_response_format_e mode, uint16_t pageId);
void handlePageReadCommand(ts_response_format_e mode, uint16_t pageId, uint16_t offset, uint16_t count);
void handleBurnCommand(ts_response_format_e mode, uint16_t page);
void tunerStudioWriteData(const uint8_t * buffer, int size);
void tunerStudioDebug(const char *msg);
void tunerStudioError(const char *msg);
#define TS_HELLO_COMMAND 'H'
#define TS_OUTPUT_COMMAND 'O'
#define TS_READ_COMMAND 'R'
#define TS_PAGE_COMMAND 'P'
#define TS_SINGLE_WRITE_COMMAND 'W'
#define TS_CHUNK_WRITE_COMMAND 'C'
#define TS_BURN_COMMAND 'B'
#endif /* TUNERSTUDIO_ALGO_H_ */

View File

@ -1,62 +0,0 @@
/*
* @file tunerstudio_configuration.h
* @brief Tuner Studio connectivity configuration
*
* In this file the configuration of TunerStudio is defined
*
* @date Oct 22, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef TUNERSTUDIO_CONFIGURATION_H_
#define TUNERSTUDIO_CONFIGURATION_H_
/**
* please be aware that current "stable" version of TunerStudio does not
* support 'float' (F32) type. You would need a beta version to handle floats
*/
typedef struct {
// primary instrument cluster gauges
int rpm; // size 4, offset 0
float coolant_temperature; // size 4, offset 4
float intake_air_temperature; // size 4, offset 8
float throttle_positon; // size 4, offset 12
float mass_air_flow; // size 4, offset 16
float air_fuel_ratio; // size 4, offset 20
float fuel_load; // size 4, offset 24
float v_batt; // size 4, offset 28
short int tpsADC; // size 2, offset 32
short int alignment; // size 2, offset 34
float atmospherePressure; // size 4, offset 36
float manifold_air_pressure; // size 4, offset 40
float crankingFuel;
int tpsVolrage;
float tCharge; // 52
float inj_adv; // 56
float sparkDwell; // 60
float pulseWidth; // 64
float warmUpEnrich; // 68
/**
* Yes, I do not really enjoy packing bits into integers but we simply have too many boolean flags and I cannot
* water 4 bytes per trafic - I want gauges to work as fast as possible
*/
unsigned int hasSdCard : 1; // bit 0
unsigned int ignition_enabled : 1; // bit 1
unsigned int injection_enabled : 1; // bit 2
unsigned int cylinder_cleanup_enabled : 1; // bit 3
unsigned int cylinder_cleanup : 1; // bit 4
unsigned int isFuelPumpOn : 1; // bit 5
unsigned int isFanOn : 1; // bit 6
unsigned int isO2HeaterOn : 1; // bit 7
unsigned int checkEngine : 1; // bit 8
unsigned int needBurn : 1; // bit 9
unsigned int secondTriggerChannelEnabled : 1; // bit 10
int unused2;
unsigned int isTpsError : 1; // bit 0
unsigned int isCltError : 1; // bit 1
unsigned int isMapError : 1; // bit 2
unsigned int isIatError : 1; // bit 3
int unused[8];
} TunerStudioOutputChannels;
#endif /* TUNERSTUDIO_CONFIGURATION_H_ */

View File

@ -1,3 +0,0 @@
CONSOLEUTILSRC = $(PROJECT_DIR)/console_util/datalogging.c \
$(PROJECT_DIR)/console_util/rfiutil.c

View File

@ -1,414 +0,0 @@
/**
* @file datalogging.c
* @brief Buffered console output stream code
*
* Here we have a memory buffer and method related to
* printing messages into this buffer. The purpose of the
* buffer is to allow fast, non-blocking, thread-safe logging.
*
* The idea is that each interrupt handler would have it's own logging buffer. You can add
* stuff into this buffer without any locking since it's you own buffer, and once you get
* the whole message you invoke the scheduleLogging() method which appends your local content
* into the global logging buffer, from which it is later dispatched to the console by our
* main console thread.
*
* @date Feb 25, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*
*/
#include <stdbool.h>
#include "main.h"
#include "rfiutil.h"
#include "chprintf.h"
#include "chmtx.h"
#include "memstreams.h"
#include "console_io.h"
/**
* This is the size of the MemoryStream used by chvprintf
*/
#define INTERMEDIATE_LOGGING_BUFFER_SIZE 2000
// we use this magic constant to make sure it's not just a random non-zero int in memory
#define MAGIC_LOGGING_FLAG 45234441
/**
* This is the buffer into which all the data providers write
*/
static char pendingBuffer[DL_OUTPUT_BUFFER] CCM_OPTIONAL
;
/**
* We copy all the pending data into this buffer once we are ready to push it out
*/
static char outputBuffer[DL_OUTPUT_BUFFER];
static MemoryStream intermediateLoggingBuffer;
static uint8_t intermediateLoggingBufferData[INTERMEDIATE_LOGGING_BUFFER_SIZE] CCM_OPTIONAL
;
//todo define max-printf-buffer
static bool intermediateLoggingBufferInited = FALSE;
static int validateBuffer(Logging *logging, uint32_t extraLen, const char *text) {
if (logging->buffer == NULL) {
firmwareError("Logging not initialized: %s", logging->name);
return TRUE;
}
if (remainingSize(logging) < extraLen + 1) {
strcpy(logging->SMALL_BUFFER, "Logging buffer overflow: ");
strcat(logging->SMALL_BUFFER, logging->name);
strcat(logging->SMALL_BUFFER, "/");
strcat(logging->SMALL_BUFFER, text);
firmwareError(logging->SMALL_BUFFER);
// unlockOutputBuffer();
// resetLogging(logging);
return TRUE;
}
return FALSE;
}
void append(Logging *logging, const char *text) {
efiAssertVoid(text != NULL, "append NULL");
uint32_t extraLen = strlen(text);
int errcode = validateBuffer(logging, extraLen, text);
if (errcode) {
return;
}
strcpy(logging->linePointer, text);
logging->linePointer += extraLen;
}
/**
* @note This method if fast because it does not validate much, be sure what you are doing
*/
void appendFast(Logging *logging, const char *text) {
// todo: fix this implementation? this would be a one-pass implementation instead of a two-pass
// char c;
// char *s = (char *) text;
// do {
// c = *s++;
// *logging->linePointer++ = c;
// } while (c != '\0');
int extraLen = strlen(text);
strcpy(logging->linePointer, text);
logging->linePointer += extraLen;
}
static void vappendPrintfI(Logging *logging, const char *fmt, va_list arg) {
intermediateLoggingBuffer.eos = 0; // reset
chvprintf((BaseSequentialStream *) &intermediateLoggingBuffer, fmt, arg);
intermediateLoggingBuffer.buffer[intermediateLoggingBuffer.eos] = 0; // need to terminate explicitly
append(logging, (char *) intermediateLoggingBufferData);
}
void vappendPrintf(Logging *logging, const char *fmt, va_list arg) {
efiAssertVoid(getRemainingStack(chThdSelf()) > 16, "stack#5b");
if (!intermediateLoggingBufferInited) {
firmwareError("intermediateLoggingBufferInited not inited!");
return;
}
int is_locked = isLocked();
int icsr_vectactive = isIsrContext();
if (is_locked) {
vappendPrintfI(logging, fmt, arg);
} else {
if (icsr_vectactive == 0) {
chSysLock()
;
vappendPrintfI(logging, fmt, arg);
chSysUnlock()
;
} else {
chSysLockFromIsr()
;
vappendPrintfI(logging, fmt, arg);
chSysUnlockFromIsr()
;
}
}
}
void appendPrintf(Logging *logging, const char *fmt, ...) {
efiAssertVoid(getRemainingStack(chThdSelf()) > 16, "stack#4");
va_list ap;
va_start(ap, fmt);
vappendPrintf(logging, fmt, ap);
va_end(ap);
}
// todo: this method does not really belong to this file
char* getCaption(LoggingPoints loggingPoint) {
switch (loggingPoint) {
case LP_RPM:
return "RPM";
case LP_THROTTLE:
return "TP";
case LP_IAT:
return "MAT";
case LP_ECT:
return "CLT";
// case LP_SECONDS:
// return "SecL";
case LP_MAF:
return "MAF";
case LP_MAP:
return "MAP";
case LP_MAP_RAW:
return "MAP_R";
default:
firmwareError("No such loggingPoint");
return NULL;
}
}
/*
// todo: this method does not really belong to this file
static char* get2ndCaption(int loggingPoint) {
switch (loggingPoint) {
case LP_RPM:
return "RPM";
case LP_THROTTLE:
return "%";
case LP_IAT:
return "°F";
case LP_ECT:
return "°F";
case LP_SECONDS:
return "s";
case LP_MAP:
return "MAP";
case LP_MAF:
return "MAF";
}
firmwareError("No such loggingPoint");
return NULL;
}
*/
void initLoggingExt(Logging *logging, const char *name, char *buffer, int bufferSize) {
print("Init logging %s\r\n", name);
logging->name = name;
logging->buffer = buffer;
logging->bufferSize = bufferSize;
resetLogging(logging);
logging->isInitialized = MAGIC_LOGGING_FLAG;
}
int isInitialized(Logging *logging) {
return logging->isInitialized == MAGIC_LOGGING_FLAG;
}
void initLogging(Logging *logging, const char *name) {
initLoggingExt(logging, name, logging->DEFAULT_BUFFER, sizeof(logging->DEFAULT_BUFFER));
}
void debugInt(Logging *logging, const char *caption, int value) {
append(logging, caption);
append(logging, DELIMETER);
appendPrintf(logging, "%d%s", value, DELIMETER);
}
void appendFloat(Logging *logging, float value, int precision) {
/**
* todo: #1 this implementation is less than perfect
* todo: #2 The only way to avoid double promotion would probably be using *float instead of float
* See also http://stackoverflow.com/questions/5522051/printing-a-float-in-c-while-avoiding-variadic-parameter-promotion-to-double
*/
switch (precision) {
case 1:
appendPrintf(logging, "%..10f", value);
break;
case 2:
appendPrintf(logging, "%..100f", value);
break;
case 3:
appendPrintf(logging, "%..1000f", value);
break;
case 4:
appendPrintf(logging, "%..10000f", value);
break;
case 5:
appendPrintf(logging, "%..100000f", value);
break;
case 6:
appendPrintf(logging, "%..1000000f", value);
break;
default:
appendPrintf(logging, "%f", value);
}
}
void debugFloat(Logging *logging, const char *caption, float value, int precision) {
append(logging, caption);
append(logging, DELIMETER);
appendFloat(logging, value, precision);
append(logging, DELIMETER);
}
static char header[16];
/**
* this method should invoked on the main thread only
*/
static void printWithLength(char *line) {
/**
* this is my way to detect serial port transmission errors
* following code is functionally identical to
* print("line:%d:%s\r\n", len, line);
* but it is faster because it outputs the whole buffer, not single characters
* We need this optimization because when we output larger chunks of data like the wave_chart:
* When we work with actual hardware, it is faster to invoke 'chSequentialStreamWrite' for the
* whole buffer then to invoke 'chSequentialStreamPut' once per character.
*/
int len = strlen(line);
strcpy(header, "line:");
char *p = header + strlen(header);
p = itoa10(p, len);
*p++ = ':';
*p++ = '\0';
p = line;
p += len;
*p++ = '\r';
*p++ = '\n';
if (!isConsoleReady())
return;
consoleOutputBuffer((const uint8_t *) header, strlen(header));
consoleOutputBuffer((const uint8_t *) line, p - line);
}
void printLine(Logging *logging) {
printWithLength(logging->buffer);
resetLogging(logging);
}
void appendMsgPrefix(Logging *logging) {
appendPrintf(logging, "msg%s", DELIMETER);
}
void appendMsgPostfix(Logging *logging) {
append(logging, DELIMETER);
}
void resetLogging(Logging *logging) {
char *buffer = logging->buffer;
if (buffer == NULL) {
firmwareError("Null buffer: %s", logging->name);
return;
}
logging->linePointer = buffer;
}
/**
* This method would output a simple console message immediately.
* This method should only be invoked on main thread because only the main thread can write to the console
*/
void printMsg(Logging *logger, const char *fmt, ...) {
// resetLogging(logging); // I guess 'reset' is not needed here?
appendMsgPrefix(logger);
va_list ap;
va_start(ap, fmt);
vappendPrintf(logger, fmt, ap);
va_end(ap);
append(logger, DELIMETER);
printLine(logger);
}
void scheduleMsg(Logging *logging, const char *fmt, ...) {
resetLogging(logging); // todo: is 'reset' really needed here?
appendMsgPrefix(logging);
va_list ap;
va_start(ap, fmt);
vappendPrintf(logging, fmt, ap);
va_end(ap);
appendMsgPostfix(logging);
scheduleLogging(logging);
}
// todo: remove this method, replace with 'scheduleMsg'
void scheduleIntValue(Logging *logging, const char *msg, int value) {
resetLogging(logging);
append(logging, msg);
append(logging, DELIMETER);
appendPrintf(logging, "%d", value);
append(logging, DELIMETER);
scheduleLogging(logging);
}
void scheduleLogging(Logging *logging) {
// this could be done without locking
int newLength = strlen(logging->buffer);
bool alreadyLocked = lockOutputBuffer();
// I hope this is fast enough to operate under sys lock
int curLength = strlen(pendingBuffer);
if (curLength + newLength >= DL_OUTPUT_BUFFER) {
/**
* if no one is consuming the data we have to drop it
* this happens in case of serial-over-USB, todo: find a better solution
*
*/
// strcpy(fatalMessage, "datalogging.c: output buffer overflow: ");
// strcat(fatalMessage, logging->name);
// fatal(fatalMessage);
if (!alreadyLocked) {
unlockOutputBuffer();
}
resetLogging(logging);
return;
}
strcat(pendingBuffer, logging->buffer);
if (!alreadyLocked) {
unlockOutputBuffer();
}
resetLogging(logging);
}
uint32_t remainingSize(Logging *logging) {
return logging->bufferSize - loggingSize(logging);
}
/**
* This method actually sends all the pending data to the communication layer
*/
void printPending(void) {
lockOutputBuffer();
// we cannot output under syslock, so another buffer
strcpy(outputBuffer, pendingBuffer);
pendingBuffer[0] = 0; // reset pending buffer
unlockOutputBuffer();
if (strlen(outputBuffer) > 0) {
printWithLength(outputBuffer);
}
}
void initIntermediateLoggingBuffer(void) {
msObjectInit(&intermediateLoggingBuffer, intermediateLoggingBufferData, INTERMEDIATE_LOGGING_BUFFER_SIZE, 0);
intermediateLoggingBufferInited = TRUE;
}

View File

@ -1,108 +0,0 @@
/**
* @file datalogging.h
* @brief Buffered console output stream header
*
* @date Feb 25, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef DATALOGGING_H_
#define DATALOGGING_H_
#include "global.h"
#include <stdarg.h>
#define DELIMETER ","
typedef enum {
LP_RPM = 0,
LP_ECT = 1,
LP_IAT = 2,
LP_THROTTLE = 3,
LP_THROTTLE_ADC = 4,
LP_MAP = 5,
LP_MAP_RAW = 6,
LP_MAF = 7,
LP_TRG_CH0_DUTY = 8,
LP_TRG_CH1_DUTY = 9,
// LP_SECONDS,
LP_COUNT = 9
} LoggingPoints;
// todo: migrate to external buffer so that different instances have different
// size of buffers?
typedef struct {
const char *name;
char SMALL_BUFFER[40];
// todo: explicitly default buffer externally so that we do not have default_buffer where we do not need it?
char DEFAULT_BUFFER[200];
char *buffer;
char *linePointer;
int bufferSize;
volatile int isInitialized;
} Logging;
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
bool lockOutputBuffer(void);
void unlockOutputBuffer(void);
void initIntermediateLoggingBuffer(void);
uint32_t remainingSize(Logging *logging);
#define loggingSize(logging) ((int) (logging)->linePointer - (int) ((logging)->buffer))
int isInitialized(Logging *logging);
void initLogging(Logging *logging, const char *name);
void initLoggingExt(Logging *logging, const char *name, char *buffer, int bufferSize);
void debugInt(Logging *logging, const char *caption, int value);
void logInt(Logging *logging, LoggingPoints loggingPoint, int value);
void debugFloat(Logging *logging, const char *text, float value, int precision);
void logFloat(Logging *logging, LoggingPoints loggingPoint, float value);
void appendFloat(Logging *logging, float value, int precision);
void resetLogging(Logging *logging);
void printLine(Logging *logging);
void appendMsgPrefix(Logging *logging);
void appendMsgPostfix(Logging *logging);
void scheduleMsg(Logging *logging, const char *fmt, ...);
void printMsg(Logging *logging, const char *fmt, ...);
char* getCaption(LoggingPoints loggingPoint);
void appendPrintf(Logging *logging, const char *fmt, ...);
void vappendPrintf(Logging *logging, const char *fmt, va_list arg);
void append(Logging *logging, const char *text);
void appendFast(Logging *logging, const char *text);
/**
* this method copies the line into the intermediate buffer for later output by
* the main thread
*/
void scheduleLogging(Logging *logging);
void scheduleIntValue(Logging *logging, const char *msg, int value);
/**
* this should only be invoked by the 'main' thread in order to keep the console safe
*/
void printPending(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* DATALOGGING_H_ */

View File

@ -1,113 +0,0 @@
/**
* @file rfiutil.c
* @brief Number to string conversion code
*
* @date Nov 15, 2012
* @author Andrey Belomutskiy, (c) 2012-2014
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <string.h>
#include "main.h"
#include "rfiutil.h"
/*
not used, not sure if we still need it. I guess we will remove it in 2015
int mylog10(int param) {
if (param < 10)
return 0;
if (param < 100)
return 1;
if (param < 1000)
return 2;
if (param < 10000)
return 3;
if (param < 100000)
return 4;
if (param < 1000000)
return 5;
if (param < 10000000)
return 6;
if (param < 100000000)
return 7;
#warning This would be better without recursion
return mylog10(param / 10) + 1;
}
*/
char hexChar(int v) {
v = v & 0xF;
if (v < 10)
return (char)('0' + v);
return 'A' - 10 + v;
}
// todo: why does it not compile if I make this function 'inline'?
int isIsrContext(void) {
/**
* Unfortunately ChibiOS has two versions of methods for different
* contexts.
*/
return dbg_isr_cnt > 0;
}
int isLocked(void) {
return dbg_lock_cnt > 0;
}
void chVTSetAny(virtual_timer_t *vtp, systime_t time, vtfunc_t vtfunc, void *par) {
if (isIsrContext()) {
bool wasLocked = lockAnyContext();
/**
* todo: this could be simplified once we migrate to ChibiOS 3.0
* See http://www.chibios.org/dokuwiki/doku.php?id=chibios:howtos:porting_from_2_to_3
*/
if (chVTIsArmedI(vtp))
chVTResetI(vtp);
chVTSetI(vtp, time, vtfunc, par);
if (!wasLocked)
chSysUnlockFromIsr()
;
} else {
chSysLock()
;
if (chVTIsArmedI(vtp))
chVTResetI(vtp);
chVTSetI(vtp, time, vtfunc, par);
chSysUnlock()
;
}
}
/**
* @brief This function knows how to print a histogram_s summary
*/
void printHistogram(Logging *logging, histogram_s *histogram) {
#if EFI_HISTOGRAMS
int report[5];
int len = hsReport(histogram, report);
resetLogging(logging);
appendMsgPrefix(logging);
appendPrintf(logging, "histogram %s *", histogram->name);
for (int i = 0; i < len; i++)
appendPrintf(logging, "%d ", report[i]);
appendPrintf(logging, "*");
appendMsgPostfix(logging);
scheduleLogging(logging);
#endif /* EFI_HISTOGRAMS */
}

View File

@ -1,31 +0,0 @@
/*
* @file rfiutil.h
* @brief Number to string conversion header
*
* @date Nov 15, 2012
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef RFIUTIL_H_
#define RFIUTIL_H_
#include "global.h"
#include "histogram.h"
#include "datalogging.h"
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
char hexC(int v);
int isIsrContext(void);
int isLocked(void);
void chVTSetAny(virtual_timer_t *vtp, systime_t time, vtfunc_t vtfunc, void *par);
void printHistogram(Logging *logging, histogram_s *histogram);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* RFIUTIL_H_ */

View File

@ -1,41 +0,0 @@
/**
* @file PwmTester.cpp
* This is a tool to measure rusEfi PWM generation quality
*
* @date Apr 29, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "main.h"
#include "PwmTester.h"
#include "EfiWave.h"
#include "pwm_generator_logic.h"
#include "engine_configuration.h"
#include "pwm_generator.h"
static Logging logger;
static SimplePwm pwmTest[5];
extern board_configuration_s *boardConfiguration;
static void startPwmTest(int freq) {
scheduleMsg(&logger, "running pwm test @%d", freq);
// PD13, GPIO_NONE because pin is initialized elsewhere already
startSimplePwm(&pwmTest[0], "tester", LED_WARNING, 10, 0.5f);
// currently this is PB9 by default - see boardConfiguration->injectionPins
startSimplePwm(&pwmTest[1], "tester", INJECTOR_1_OUTPUT, freq / 1.3333333333, 0.5f);
// currently this is PB8 by default
startSimplePwm(&pwmTest[2], "tester", INJECTOR_2_OUTPUT, freq / 1000, 0.5f);
// currently this is PE3 by default
startSimplePwm(&pwmTest[3], "tester", INJECTOR_3_OUTPUT, freq, 0.5);
// currently this is PE5 by default
startSimplePwm(&pwmTest[4], "tester", INJECTOR_4_OUTPUT, freq / 33.33333333333, 0.5);
}
void initPwmTester(void) {
initLogging(&logger, "pwm test");
addConsoleActionI("pwmtest", startPwmTest);
// un-comment this to start pwm test on start up startPwmTest(1000);
}

View File

@ -1,12 +0,0 @@
/**
* @file PwmTester.h
*
* @date Apr 29, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef PWMTESTER_H_
#define PWMTESTER_H_
void initPwmTester(void);
#endif /* PWMTESTER_H_ */

View File

@ -1,48 +0,0 @@
/**
* @file OutputSignalArray.cpp
*
* @date Mar 20, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "OutputSignalList.h"
OutputSignalList::OutputSignalList() {
clear();
}
void OutputSignalList::clear() {
size = 0;
}
int OutputSignalList::getSize() {
return size;
}
OutputSignal * OutputSignalList::add(io_pin_e ioPin) {
if (size == OUTPUT_SIGNAL_MAX_SIZE) {
firmwareError("Too many signals, adding %d", ioPin);
return NULL;
}
OutputSignal *signal = &signals[size++];
initOutputSignal(signal, ioPin);
return signal;
}

View File

@ -1,44 +0,0 @@
/*
* @file OutputSignalList.h
*
* @date Mar 20, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OUTPUTSIGNALLIST_H_
#define OUTPUTSIGNALLIST_H_
#include "signal_executor.h"
#include "io_pins.h"
// todo: this value is too low for 6 cyl engine, get it back to 60
#define OUTPUT_SIGNAL_MAX_SIZE 90
class OutputSignalList {
public:
OutputSignalList();
void clear();
OutputSignal * add(io_pin_e ioPin);
int getSize();
private:
int size;
OutputSignal signals[OUTPUT_SIGNAL_MAX_SIZE];
};
#endif /* OUTPUTSIGNALLIST_H_ */

View File

@ -1,64 +0,0 @@
/**
* @file accel_enrichment.cpp
* @brief Acceleration enrichment calculator
*
* @date Apr 21, 2014
* @author Dmitry Sidin
* @author Andrey Belomutskiy (c) 2012-2014
*/
#include "main.h"
#include "trigger_central.h"
#include "accel_enrichment.h"
#include "engine_state.h"
#include "engine_math.h"
#include "signal_executor.h"
extern Engine engine;
static AccelEnrichmemnt instance;
void AccelEnrichmemnt::updateDiffEnrichment(engine_configuration_s *engineConfiguration, float engineLoad) {
for (int i = 3; i == 1; i--)
engineLoadD[i] = engineLoadD[i - 1];
engineLoadD[0] = engineLoad;
diffEnrichment = ((3 * (engineLoadD[0] - engineLoadD[1]) + (engineLoadD[2] - engineLoadD[3])) / 4)
* (engineConfiguration->diffLoadEnrichmentCoef);
}
float AccelEnrichmemnt::getDiffEnrichment() {
return diffEnrichment;
}
AccelEnrichmemnt::AccelEnrichmemnt() {
for (int i = 0; i < 4; i++)
engineLoadD[i] = 0;
diffEnrichment = 0;
}
float getAccelEnrichment(void) {
return instance.getDiffEnrichment();
}
#if EFI_PROD_CODE
static THD_WORKING_AREA(aeThreadStack, UTILITY_THREAD_STACK_SIZE);
extern engine_configuration_s *engineConfiguration;
static msg_t DiffEnrichmentThread(int param) {
chRegSetThreadName("Diff Enrichment");
while (TRUE) {
instance.updateDiffEnrichment(engineConfiguration, getEngineLoad());
chThdSleepMilliseconds(100);
}
#if defined __GNUC__
return -1;
#endif
}
void initDiffEnrichment(void) {
chThdCreateStatic(aeThreadStack, sizeof(aeThreadStack), LOWPRIO, (tfunc_t) DiffEnrichmentThread, NULL);
}
#endif

View File

@ -1,31 +0,0 @@
/**
* @file accel_enrichment.h
* @brief Acceleration enrichment calculator
*
* @date Apr 21, 2014
* @author Dmitry Sidin
* @author Andrey Belomutskiy (c) 2012-2014
*/
#ifndef ACC_ENRICHMENT_H_
#define ACC_ENRICHMENT_H_
#include "engine_configuration.h"
class AccelEnrichmemnt {
public:
AccelEnrichmemnt();
void updateDiffEnrichment(engine_configuration_s *engineConfiguration,
float engineLoad);
float getDiffEnrichment(void);
private:
float engineLoadD[4];
float diffEnrichment;
};
void initDiffEnrichment(void);
float getAccelEnrichment(void);
#endif /* ACC_ENRICHMENT_H_ */

View File

@ -1,54 +0,0 @@
/**
* @file advance_map.c
*
* @date Mar 27, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "main.h"
#include "advance_map.h"
#include "interpolation.h"
// that's for 'max' function
#include "idle_controller.h"
#include "engine_configuration.h"
#include "engine_math.h"
extern engine_configuration_s *engineConfiguration;
//extern engine_configuration2_s *engineConfiguration2;
static Map3D1616 advanceMap;
float getBaseAdvance(int rpm, float engineLoad) {
efiAssert(!cisnan(engineLoad), "invalid el", NAN);
efiAssert(!cisnan(engineLoad), "invalid rpm", NAN);
return advanceMap.getValue(engineLoad, engineConfiguration->ignitionLoadBins, (float)rpm,
engineConfiguration->ignitionRpmBins);
}
float getAdvance(int rpm, float engineLoad) {
float angle;
if (isCrankingR(rpm)) {
angle = engineConfiguration->crankingTimingAngle;
} else {
angle = getBaseAdvance(rpm, engineLoad);
}
return fixAngle(angle + engineConfiguration->ignitionOffset);
}
void prepareTimingMap(void) {
advanceMap.init(engineConfiguration->ignitionTable);
}

View File

@ -1,26 +0,0 @@
/*
* @file advance_map.h
*
* @date Mar 27, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef ADVANCE_H_
#define ADVANCE_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#define AD_LOAD_COUNT 16
#define AD_RPM_COUNT 16
float getAdvance(int rpm, float engineLoad);
void prepareTimingMap(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ADVANCE_H_ */

View File

@ -1,48 +0,0 @@
/*
* @file algo.cpp
*
* @date Mar 2, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "global.h"
#include "algo.h"
#include "advance_map.h"
#include "fuel_math.h"
#include "wave_chart.h"
#include "settings.h"
#include "signal_executor.h"
#include "speed_density.h"
WaveChart waveChart;
void initDataStructures(engine_configuration_s *engineConfiguration) {
prepareFuelMap();
prepareTimingMap();
initSpeedDensity(engineConfiguration);
}
void initAlgo(engine_configuration_s *engineConfiguration) {
#if EFI_PROD_CODE || EFI_SIMULATOR
initSettings();
initSignalExecutor();
#endif
#if EFI_WAVE_CHART
initWaveChart(&waveChart);
#endif
}

View File

@ -1,25 +0,0 @@
/*
* @file algo.h
*
* @date Mar 2, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef ALGO_H_
#define ALGO_H_
#include "engine_configuration.h"
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void initDataStructures(engine_configuration_s *engineConfiguration);
void initAlgo(engine_configuration_s *engineConfiguration);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ALGO_H_ */

View File

@ -1,17 +0,0 @@
CONTROLLERS_ALGO_SRC = $(PROJECT_DIR)/controllers/algo/map_adjuster.c \
$(PROJECT_DIR)/controllers/algo/signal_executor.c \
$(PROJECT_DIR)/controllers/algo/malfunction_central.c \
$(PROJECT_DIR)/controllers/algo/idle_controller.c \
$(PROJECT_DIR)/controllers/algo/wave_chart.c \
$(PROJECT_DIR)/controllers/algo/nmea.c
CONTROLLERS_ALGO_SRC_CPP = $(PROJECT_DIR)/controllers/algo/OutputSignalArray.cpp \
$(PROJECT_DIR)/controllers/algo/advance_map.cpp \
$(PROJECT_DIR)/controllers/algo/fuel_math.cpp \
$(PROJECT_DIR)/controllers/algo/accel_enrichment.cpp \
$(PROJECT_DIR)/controllers/algo/engine_configuration.cpp \
$(PROJECT_DIR)/controllers/algo/engine.cpp \
$(PROJECT_DIR)/controllers/algo/event_registry.cpp \
$(PROJECT_DIR)/controllers/algo/algo.cpp

View File

@ -1,24 +0,0 @@
/**
* @file can_header.h
*
* @date Dec 21, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef CAN_HEADER_H_
#define CAN_HEADER_H_
#include "rusefi_enums.h"
/**
* Net Body Computer types
*/
typedef enum {
CAN_BUS_NBC_BMW = 0,
CAN_BUS_NBC_FIAT = 1,
CAN_BUS_NBC_VAG = 2,
Internal_ForceMyEnumIntSize_can_nbc = ENUM_SIZE_HACK,
} can_nbc_e;
#endif /* CAN_HEADER_H_ */

View File

@ -1,89 +0,0 @@
/**
* @file ec2.h
*
* this is a mess because some code is still in C and some is
* already in C++. trigger structure is C++
* TODO: rename? merge? Do something with this file
*
* @date Apr 26, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef EC2_H_
#define EC2_H_
#include "engine_configuration.h"
#include "event_registry.h"
#include "trigger_structure.h"
/**
* @brief Here we store information about which injector or spark should be fired when.
*/
typedef struct {
ActuatorEventList crankingInjectionEvents;
ActuatorEventList injectionEvents;
/**
* We are alternating two event lists in order to avoid a potential issue around revolution boundary
* when an event is scheduled within the next revolution.
*/
IgnitionEventList ignitionEvents[2];
} EventHandlerConfiguration;
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
/**
* this part of the structure is separate just because so far
* these fields are not integrated with Tuner Studio. Step by step :)
*/
class engine_configuration2_s {
// todo: move these fields into Engine class, eliminate this class
public:
engine_configuration2_s();
Thermistor iat;
Thermistor clt;
trigger_shape_s triggerShape;
EventHandlerConfiguration engineEventConfiguration;
/**
* This coefficient translates ADC value directly into voltage adjusted according to
* voltage divider configuration. This is a future (?) performance optimization.
*/
float adcToVoltageInputDividerCoefficient;
};
typedef struct {
engine_configuration_s *engineConfiguration;
engine_configuration2_s *engineConfiguration2;
} configuration_s;
void prepareOutputSignals(engine_configuration_s *engineConfiguration,
engine_configuration2_s *engineConfiguration2);
void initializeIgnitionActions(float advance, float dwellAngle, engine_configuration_s *engineConfiguration, engine_configuration2_s *engineConfiguration2, IgnitionEventList *list);
float getFuelMultiplier(engine_configuration_s const *e, injection_mode_e mode);
void addFuelEvents(engine_configuration_s const *e, engine_configuration2_s *engineConfiguration2, ActuatorEventList *list, injection_mode_e mode);
void registerActuatorEventExt(engine_configuration_s const *engineConfiguration, trigger_shape_s * s, ActuatorEvent *e, OutputSignal *actuator, float angleOffset);
void resetConfigurationExt(Logging * logger, engine_type_e engineType,
engine_configuration_s *engineConfiguration,
engine_configuration2_s *engineConfiguration2,
board_configuration_s *boardConfiguration);
void applyNonPersistentConfiguration(Logging * logger, engine_configuration_s *engineConfiguration,
engine_configuration2_s *engineConfiguration2);
void setDefaultNonPersistentConfiguration(engine_configuration2_s *engineConfiguration2);
void printConfiguration(engine_configuration_s *engineConfiguration, engine_configuration2_s *engineConfiguration2);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* EC2_H_ */

View File

@ -1,23 +0,0 @@
/**
* @file engine.cpp
*
*
* This might be a http://en.wikipedia.org/wiki/God_object but that's best way I can
* express myself in C/C++. I am open for suggestions :)
*
* @date May 21, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "main.h"
#include "engine.h"
#include "engine_state.h"
/**
* We are executing these heavy (logarithm) methods from outside the trigger callbacks for performance reasons.
*/
void Engine::updateSlowSensors() {
engineState.iat = getIntakeAirTemperature();
engineState.clt = getCoolantTemperature();
}

View File

@ -1,35 +0,0 @@
/**
* @file engine.h
*
* @date May 21, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef ENGINE_H_
#define ENGINE_H_
#include "main.h"
#include "engine_configuration.h"
class EngineState {
public:
/**
* Access to these two fields is not synchronized in any way - that should work since float read/write are atomic.
*/
float iat;
float clt;
};
class RpmCalculator;
class Engine {
public:
RpmCalculator *rpmCalculator;
engine_configuration_s *engineConfiguration;
EngineState engineState;
void updateSlowSensors();
};
#endif /* ENGINE_H_ */

View File

@ -1,492 +0,0 @@
/**
* @file engine_configuration.cpp
* @brief Utility method related to the engine configuration data structure.
*
* @date Nov 22, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "main.h"
#include "engine_configuration.h"
#include "allsensors.h"
#include "interpolation.h"
#include "trigger_decoder.h"
#include "engine_math.h"
#include "speed_density.h"
#if EFI_TUNER_STUDIO
#include "tunerstudio.h"
#endif
#include "audi_aan.h"
#include "dodge_neon.h"
#include "ford_aspire.h"
#include "ford_fiesta.h"
#include "ford_1995_inline_6.h"
#include "snow_blower.h"
#include "nissan_primera.h"
#include "honda_accord.h"
#include "GY6_139QMB.h"
#include "mazda_miata_nb.h"
#include "mazda_323.h"
#include "saturn_ion.h"
#include "MiniCooperR50.h"
#include "ford_escort_gt.h"
#include "citroenBerlingoTU3JP.h"
#include "rover_v8.h"
#include "mitsubishi.h"
static volatile int globalConfigurationVersion = 0;
int getGlobalConfigurationVersion(void) {
return globalConfigurationVersion;
}
void incrementGlobalConfigurationVersion(void) {
globalConfigurationVersion++;
}
/**
* @brief Sets the same dwell time across the whole getRpm() range
*/
void setConstantDwell(engine_configuration_s *engineConfiguration, float dwellMs) {
for (int i = 0; i < DWELL_CURVE_SIZE; i++) {
engineConfiguration->sparkDwellBins[i] = 1000 * i;
engineConfiguration->sparkDwell[i] = dwellMs;
}
}
void setWholeVEMap(engine_configuration_s *engineConfiguration, float value) {
// todo: table helper?
// for (int l = 0; l < VE_LOAD_COUNT; l++) {
// for (int r = 0; r < VE_RPM_COUNT; r++) {
// engineConfiguration->veTable[l][r] = value;
// }
// }
}
void setWholeFuelMap(engine_configuration_s *engineConfiguration, float value) {
// todo: table helper?
for (int l = 0; l < FUEL_LOAD_COUNT; l++) {
for (int r = 0; r < FUEL_RPM_COUNT; r++) {
engineConfiguration->fuelTable[l][r] = value;
}
}
}
/**
* @brief Global default engine configuration
* This method sets the default global engine configuration. These values are later overridden by engine-specific defaults
* and the settings saves in flash memory.
*/
void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
memset(engineConfiguration, 0, sizeof(engine_configuration_s));
memset(boardConfiguration, 0, sizeof(board_configuration_s));
setDetaultVETable(engineConfiguration);
engineConfiguration->injectorLag = 0.0;
for (int i = 0; i < IAT_CURVE_SIZE; i++) {
engineConfiguration->iatFuelCorrBins[i] = -40 + i * 10;
engineConfiguration->iatFuelCorr[i] = 1; // this correction is a multiplier
}
for (int i = 0; i < CLT_CURVE_SIZE; i++) {
engineConfiguration->cltFuelCorrBins[i] = -40 + i * 10;
engineConfiguration->cltFuelCorr[i] = 1; // this correction is a multiplier
}
// setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, -40, 1.5);
// setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, -30, 1.5);
// setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, -20, 1.42);
// setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, -10, 1.36);
// setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, 0, 1.28);
// setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, 10, 1.19);
// setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, 20, 1.12);
// setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, 30, 1.10);
// setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, 40, 1.06);
// setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, 50, 1.06);
// setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, 60, 1.03);
// setTableValue(engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE, 70, 1.01);
for (int i = 0; i < VBAT_INJECTOR_CURVE_SIZE; i++) {
engineConfiguration->battInjectorLagCorrBins[i] = 12 - VBAT_INJECTOR_CURVE_SIZE / 2 + i;
engineConfiguration->battInjectorLagCorr[i] = 0; // zero extra time by default
}
setConstantDwell(engineConfiguration, 4); // 4ms is global default dwell
setFuelLoadBin(engineConfiguration, 1.2, 4.4);
setFuelRpmBin(engineConfiguration, 800, 7000);
setTimingLoadBin(engineConfiguration, 1.2, 4.4);
setTimingRpmBin(engineConfiguration, 800, 7000);
setTableBin2(engineConfiguration->map.samplingAngleBins, MAP_ANGLE_SIZE, 800, 7000, 1);
setTableBin2(engineConfiguration->map.samplingAngle, MAP_ANGLE_SIZE, 100, 130, 1);
setTableBin2(engineConfiguration->map.samplingWindowBins, MAP_ANGLE_SIZE, 800, 7000, 1);
setTableBin2(engineConfiguration->map.samplingWindow, MAP_ANGLE_SIZE, 50, 50, 1);
// set_whole_timing_map 3
setWholeFuelMap(engineConfiguration, 3);
setThermistorConfiguration(&engineConfiguration->cltThermistorConf, 0, 9500, 23.8889, 2100, 48.8889, 1000);
engineConfiguration->cltThermistorConf.bias_resistor = 1500;
setThermistorConfiguration(&engineConfiguration->iatThermistorConf, 32, 9500, 75, 2100, 120, 1000);
// todo: this value is way off! I am pretty sure temp coeffs are off also
engineConfiguration->iatThermistorConf.bias_resistor = 2700;
engineConfiguration->rpmHardLimit = 7000;
engineConfiguration->crankingSettings.crankingRpm = 550;
// set_cranking_fuel_max 6 40
engineConfiguration->crankingSettings.coolantTempMaxC = 40; // 6ms at 40C
engineConfiguration->crankingSettings.fuelAtMaxTempMs = 6;
// set_cranking_fuel_min 6 -40
engineConfiguration->crankingSettings.coolantTempMinC = -40; // 6ms at -40C
engineConfiguration->crankingSettings.fuelAtMinTempMs = 6;
engineConfiguration->analogInputDividerCoefficient = 2;
engineConfiguration->crankingChargeAngle = 70;
engineConfiguration->timingMode = TM_DYNAMIC;
engineConfiguration->fixedModeTiming = 50;
engineConfiguration->analogChartMode = AC_TRIGGER;
engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
engineConfiguration->baroSensor.hwChannel = EFI_ADC_4;
engineConfiguration->firingOrder = FO_1_THEN_3_THEN_4_THEN2;
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
engineConfiguration->injectionMode = IM_SEQUENTIAL;
engineConfiguration->ignitionMode = IM_ONE_COIL;
engineConfiguration->globalTriggerAngleOffset = 0;
engineConfiguration->injectionOffset = 0;
engineConfiguration->ignitionOffset = 0;
engineConfiguration->overrideCrankingIgnition = TRUE;
engineConfiguration->analogChartFrequency = 20;
engineConfiguration->algorithm = LM_MAF;
engineConfiguration->vbattDividerCoeff = ((float) (15 + 65)) / 15;
engineConfiguration->fanOnTemperature = 75;
engineConfiguration->fanOffTemperature = 70;
engineConfiguration->tpsMin = convertVoltageTo10bitADC(1.250);
engineConfiguration->tpsMax = convertVoltageTo10bitADC(4.538);
engineConfiguration->can_nbc_type = CAN_BUS_NBC_BMW;
engineConfiguration->can_sleep_period = 50;
engineConfiguration->canReadEnabled = TRUE;
engineConfiguration->canWriteEnabled = false;
setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
engineConfiguration->cylindersCount = 4;
engineConfiguration->displacement = 2;
/**
* By the way http://users.erols.com/srweiss/tableifc.htm has a LOT of data
*/
engineConfiguration->injectorFlow = 200;
engineConfiguration->displayMode = DM_HD44780;
engineConfiguration->logFormat = LF_NATIVE;
engineConfiguration->directSelfStimulation = false;
engineConfiguration->needSecondTriggerInput = true;
engineConfiguration->triggerConfig.triggerType = TT_TOOTHED_WHEEL_60_2;
engineConfiguration->HD44780width = 20;
engineConfiguration->HD44780height = 4;
engineConfiguration->tpsAdcChannel = EFI_ADC_3;
engineConfiguration->vBattAdcChannel = EFI_ADC_5;
engineConfiguration->cltAdcChannel = EFI_ADC_6;
engineConfiguration->iatAdcChannel = EFI_ADC_7;
engineConfiguration->mafAdcChannel = EFI_ADC_0;
engineConfiguration->afrSensor.afrAdcChannel = EFI_ADC_14;
initEgoSensor(&engineConfiguration->afrSensor, ES_BPSX_D1);
engineConfiguration->globalFuelCorrection = 1;
engineConfiguration->map.sensor.sensorType = MT_MPX4250;
engineConfiguration->baroSensor.sensorType = MT_CUSTOM;
engineConfiguration->baroSensor.Min = 0;
engineConfiguration->baroSensor.Max = 500;
engineConfiguration->diffLoadEnrichmentCoef = 1;
engineConfiguration->hasMapSensor = TRUE;
engineConfiguration->hasCltSensor = TRUE;
boardConfiguration->idleSolenoidFrequency = 200;
// engineConfiguration->idleMode = IM_AUTO;
engineConfiguration->idleMode = IM_MANUAL;
engineConfiguration->isInjectionEnabled = true;
engineConfiguration->isIgnitionEnabled = true;
engineConfiguration->isCylinderCleanupEnabled = true;
engineConfiguration->secondTriggerChannelEnabled = true;
boardConfiguration->idleValvePin = GPIOE_2;
boardConfiguration->idleValvePinMode = OM_DEFAULT;
boardConfiguration->fuelPumpPin = GPIOC_13;
boardConfiguration->fuelPumpPinMode = OM_DEFAULT;
boardConfiguration->electronicThrottlePin1 = GPIOC_9;
boardConfiguration->o2heaterPin = GPIO_NONE;
boardConfiguration->injectionPins[0] = GPIOB_9;
boardConfiguration->injectionPins[1] = GPIOB_8;
boardConfiguration->injectionPins[2] = GPIOE_3;
boardConfiguration->injectionPins[3] = GPIOE_5;
boardConfiguration->injectionPins[4] = GPIOE_6;
boardConfiguration->injectionPins[5] = GPIOC_12;
boardConfiguration->injectionPins[6] = GPIO_NONE;
boardConfiguration->injectionPins[7] = GPIO_NONE;
boardConfiguration->injectionPins[8] = GPIO_NONE;
boardConfiguration->injectionPins[9] = GPIO_NONE;
boardConfiguration->injectionPins[10] = GPIO_NONE;
boardConfiguration->injectionPins[11] = GPIO_NONE;
boardConfiguration->injectionPinMode = OM_DEFAULT;
boardConfiguration->ignitionPins[0] = GPIOC_7;
boardConfiguration->ignitionPins[1] = GPIOE_4; // todo: update this value
boardConfiguration->ignitionPins[2] = GPIOE_0; // todo: update this value
boardConfiguration->ignitionPins[3] = GPIOE_1; // todo: update this value
boardConfiguration->ignitionPins[4] = GPIO_NONE;
boardConfiguration->ignitionPins[5] = GPIO_NONE;
boardConfiguration->ignitionPins[6] = GPIO_NONE;
boardConfiguration->ignitionPins[7] = GPIO_NONE;
boardConfiguration->ignitionPins[8] = GPIO_NONE;
boardConfiguration->ignitionPins[9] = GPIO_NONE;
boardConfiguration->ignitionPins[10] = GPIO_NONE;
boardConfiguration->ignitionPins[11] = GPIO_NONE;
boardConfiguration->ignitionPinMode = OM_DEFAULT;
boardConfiguration->malfunctionIndicatorPin = GPIOC_9;
boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;
boardConfiguration->fanPin = GPIOC_15;
boardConfiguration->fanPinMode = OM_DEFAULT;
boardConfiguration->idleSwitchPin = GPIOC_8;
boardConfiguration->triggerSimulatorPins[0] = GPIOD_1;
boardConfiguration->triggerSimulatorPins[1] = GPIOD_2;
boardConfiguration->triggerSimulatorPins[2] = GPIOD_3;
boardConfiguration->triggerSimulatorPinModes[0] = OM_DEFAULT;
boardConfiguration->triggerSimulatorPinModes[1] = OM_DEFAULT;
boardConfiguration->triggerSimulatorPinModes[2] = OM_DEFAULT;
boardConfiguration->HD44780_rs = GPIOE_9;
boardConfiguration->HD44780_e = GPIOE_11;
boardConfiguration->HD44780_db4 = GPIOE_13;
boardConfiguration->HD44780_db5 = GPIOE_15;
boardConfiguration->HD44780_db6 = GPIOB_11;
boardConfiguration->HD44780_db7 = GPIOB_13;
boardConfiguration->gps_rx_pin = GPIOB_7;
boardConfiguration->gps_tx_pin = GPIOB_6;
memset(boardConfiguration->adcHwChannelEnabled, 0, sizeof(boardConfiguration->adcHwChannelEnabled));
boardConfiguration->adcHwChannelEnabled[0] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[1] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[2] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[3] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[4] = ADC_FAST;
boardConfiguration->adcHwChannelEnabled[6] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[7] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[11] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[12] = ADC_SLOW;
boardConfiguration->adcHwChannelEnabled[13] = ADC_SLOW;
boardConfiguration->triggerInputPins[0] = GPIOC_6;
boardConfiguration->triggerInputPins[1] = GPIOA_5;
boardConfiguration->logicAnalyzerPins[0] = GPIOA_8;
boardConfiguration->logicAnalyzerPins[1] = GPIOE_7;
boardConfiguration->idleThreadPeriod = 100;
boardConfiguration->consoleLoopPeriod = 200;
boardConfiguration->lcdThreadPeriod = 300;
boardConfiguration->tunerStudioThreadPeriod = 300;
boardConfiguration->generalPeriodicThreadPeriod = 50;
boardConfiguration->tunerStudioSerialSpeed = 38400;
boardConfiguration->boardTestModeJumperPin = GPIOB_0;
boardConfiguration->canDeviceMode = CD_USE_CAN2;
boardConfiguration->canTxPin = GPIOB_0;
boardConfiguration->canRxPin = GPIOB_12;
boardConfiguration->digitalPotentiometerSpiDevice = SPI_NONE;
boardConfiguration->digitalPotentiometerChipSelect[0] = GPIOD_7;
boardConfiguration->digitalPotentiometerChipSelect[1] = GPIO_NONE;
boardConfiguration->digitalPotentiometerChipSelect[2] = GPIOD_5;
boardConfiguration->digitalPotentiometerChipSelect[3] = GPIO_NONE;
boardConfiguration->is_enabled_spi_1 = false;
boardConfiguration->is_enabled_spi_2 = true;
boardConfiguration->is_enabled_spi_3 = true;
}
//void setDefaultNonPersistentConfiguration(engine_configuration2_s *engineConfiguration2) {
//}
void resetConfigurationExt(Logging * logger, engine_type_e engineType, engine_configuration_s *engineConfiguration,
engine_configuration2_s *engineConfiguration2, board_configuration_s *boardConfiguration) {
/**
* Let's apply global defaults first
*/
setDefaultConfiguration(engineConfiguration, boardConfiguration);
engineConfiguration->engineType = engineType;
/**
* And override them with engine-specific defaults
*/
switch (engineType) {
#if EFI_SUPPORT_DODGE_NEON || defined(__DOXYGEN__)
case DODGE_NEON_1995:
setDodgeNeonEngineConfiguration(engineConfiguration, boardConfiguration);
break;
#endif /* EFI_SUPPORT_DODGE_NEON */
#if EFI_SUPPORT_FORD_ASPIRE || defined(__DOXYGEN__)
case FORD_ASPIRE_1996:
setFordAspireEngineConfiguration(engineConfiguration, boardConfiguration);
break;
#endif /* EFI_SUPPORT_FORD_ASPIRE */
#if EFI_SUPPORT_FORD_FIESTA || defined(__DOXYGEN__)
case FORD_FIESTA:
setFordFiestaDefaultEngineConfiguration(engineConfiguration);
break;
#endif /* EFI_SUPPORT_FORD_FIESTA */
#if EFI_SUPPORT_NISSAN_PRIMERA || defined(__DOXYGEN__)
case NISSAN_PRIMERA:
setNissanPrimeraEngineConfiguration(engineConfiguration);
break;
#endif
case HONDA_ACCORD_CD:
setHondaAccordConfigurationThreeWires(engineConfiguration, boardConfiguration);
break;
case HONDA_ACCORD_CD_TWO_WIRES:
setHondaAccordConfigurationTwoWires(engineConfiguration, boardConfiguration);
break;
case HONDA_ACCORD_CD_DIP:
setHondaAccordConfigurationDip(engineConfiguration, boardConfiguration);
break;
case MITSU_4G93:
setMitsubishiConfiguration(engineConfiguration, boardConfiguration);
break;
#if EFI_SUPPORT_1995_FORD_INLINE_6 || defined(__DOXYGEN__)
case FORD_INLINE_6_1995:
setFordInline6(engineConfiguration, boardConfiguration);
break;
#endif /* EFI_SUPPORT_1995_FORD_INLINE_6 */
case GY6_139QMB:
setGy6139qmbDefaultEngineConfiguration(engineConfiguration);
break;
case MAZDA_MIATA_NB:
setMazdaMiataNbEngineConfiguration(engineConfiguration, boardConfiguration);
break;
case MAZDA_323:
setMazda323EngineConfiguration(engineConfiguration);
break;
case SATURN_ION_2004:
setSaturnIonEngineConfiguration(engineConfiguration);
break;
case MINI_COOPER_R50:
setMiniCooperR50(engineConfiguration, boardConfiguration);
break;
case FORD_ESCORT_GT:
setFordEscortGt(engineConfiguration, boardConfiguration);
break;
case MIATA_1990:
setMiata1990(engineConfiguration, boardConfiguration);
break;
case MIATA_1994:
setMiata1994(engineConfiguration, boardConfiguration);
break;
case MIATA_1996:
setMiata1996(engineConfiguration, boardConfiguration);
break;
case CITROEN_TU3JP:
setCitroenBerlingoTU3JPConfiguration(engineConfiguration, boardConfiguration);
break;
case ROVER_V8:
setRoverv8(engineConfiguration, boardConfiguration);
break;
default:
firmwareError("Unexpected engine type: %d", engineType);
}
applyNonPersistentConfiguration(logger, engineConfiguration, engineConfiguration2);
#if EFI_TUNER_STUDIO
syncTunerStudioCopy();
#endif
}
engine_configuration2_s::engine_configuration2_s() {
}
void applyNonPersistentConfiguration(Logging * logger, engine_configuration_s *engineConfiguration,
engine_configuration2_s *engineConfiguration2) {
// todo: this would require 'initThermistors() to re-establish a reference, todo: fix
// memset(engineConfiguration2, 0, sizeof(engine_configuration2_s));
#if EFI_PROD_CODE
scheduleMsg(logger, "applyNonPersistentConfiguration()");
#endif
initializeTriggerShape(logger, engineConfiguration, engineConfiguration2);
if (engineConfiguration2->triggerShape.getSize() == 0) {
firmwareError("triggerShape size is zero");
return;
}
if (engineConfiguration2->triggerShape.shaftPositionEventCount == 0) {
firmwareError("shaftPositionEventCount is zero");
return;
}
prepareOutputSignals(engineConfiguration, engineConfiguration2);
// todo: looks like this is here only for unit tests. todo: remove
initializeIgnitionActions(0, 0, engineConfiguration, engineConfiguration2,
&engineConfiguration2->engineEventConfiguration.ignitionEvents[0]);
}
void setOperationMode(engine_configuration_s *engineConfiguration, operation_mode_e mode) {
if (mode == FOUR_STROKE_CAM_SENSOR) {
engineConfiguration->rpmMultiplier = 0.5;
} else if (mode == FOUR_STROKE_CRANK_SENSOR) {
engineConfiguration->rpmMultiplier = 1;
}
}
operation_mode_e getOperationMode(engine_configuration_s const *engineConfiguration) {
if (engineConfiguration->rpmMultiplier == 1)
return FOUR_STROKE_CRANK_SENSOR;
return FOUR_STROKE_CAM_SENSOR;
}

View File

@ -1,437 +0,0 @@
/**
* @file engine_configuration.h
* @brief Main engine configuration data structure.
*
* @date Oct 30, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef ENGINE_CONFIGURATION_H_
#define ENGINE_CONFIGURATION_H_
#include "efifeatures.h"
#include "crc.h"
#include "sensor_types.h"
#include "can_header.h"
#include "rusefi_enums.h"
typedef struct {
float coolantTempMinC;
float coolantTempMaxC;
float fuelAtMinTempMs;
float fuelAtMaxTempMs;
/**
* This value controls what RPM values we consider 'cranking' (any RPM below 'crankingRpm')
* Anything above 'crankingRpm' would be 'running'
*/
short int crankingRpm;
} cranking_parameters_s;
#define FUEL_RPM_COUNT 16
#define FUEL_LOAD_COUNT 16
#define VE_RPM_COUNT 16
#define VE_LOAD_COUNT 16
#define AFR_RPM_COUNT 16
#define AFR_LOAD_COUNT 16
#define CLT_CURVE_SIZE 16
#define IAT_CURVE_SIZE 16
#define VBAT_INJECTOR_CURVE_SIZE 8
#define IGN_LOAD_COUNT 16
#define IGN_RPM_COUNT 16
#define DWELL_CURVE_SIZE 8
typedef enum {
AC_OFF = 0,
/**
* You would use this value if you want to see a detailed graph of your trigger events
*/
AC_TRIGGER = 1, AC_MAP = 2,
Internal_ForceMyEnumIntSize_analog_chart_mode = ENUM_SIZE_HACK,
} analog_chart_e;
typedef enum {
/**
* This is the default mode in which ECU controls timing dynamically
*/
TM_DYNAMIC = 0,
/**
* Fixed timing is useful while you are playing with a timing gun - you need to have fixed
* timing if you want to install your distributor at some specific angle
*/
TM_FIXED = 1,
Internal_ForceMyEnumIntSize_timing_mode = ENUM_SIZE_HACK,
} timing_mode_e;
typedef enum {
CD_OFF = 0,
CD_USE_CAN1 = 1,
CD_USE_CAN2 = 2,
Internal_ForceMyEnumIntSize_can_device_mode = ENUM_SIZE_HACK,
} can_device_mode_e;
typedef struct {
adc_channel_e afrAdcChannel;
float v1;
float value1;
float v2;
float value2;
} afr_sensor_s;
#define DWELL_COUNT 8
/**
* @brief Trigger wheel(s) configuration
*/
typedef struct {
trigger_type_e triggerType;
int customIsSynchronizationNeeded;
int customTotalToothCount;
int customSkippedToothCount;
float customSyncRatioFrom;
float customSyncRatioTo;
int customUseRiseEdge;
} trigger_config_s;
#define HW_MAX_ADC_INDEX 16
typedef struct {
// WARNING: by default, our small enums are ONE BYTE. this one is made 4-byte with the 'ENUM_SIZE_HACK' hack
brain_pin_e idleValvePin;
pin_output_mode_e idleValvePinMode;
brain_pin_e fuelPumpPin;
pin_output_mode_e fuelPumpPinMode;
brain_pin_e injectionPins[12];
pin_output_mode_e injectionPinMode;
brain_pin_e ignitionPins[12];
pin_output_mode_e ignitionPinMode;
brain_pin_e malfunctionIndicatorPin;
pin_output_mode_e malfunctionIndicatorPinMode;
brain_pin_e fanPin;
pin_output_mode_e fanPinMode;
brain_pin_e electronicThrottlePin1;
pin_output_mode_e electronicThrottlePin1Mode;
brain_pin_e idleSwitchPin;
pin_input_mode_e idleSwitchPinMode;
brain_pin_e alternatorControlPin;
pin_output_mode_e alternatorControlPinMode;
brain_pin_e HD44780_rs;
brain_pin_e HD44780_e;
brain_pin_e HD44780_db4;
brain_pin_e HD44780_db5;
brain_pin_e HD44780_db6;
brain_pin_e HD44780_db7;
brain_pin_e gps_rx_pin;
brain_pin_e gps_tx_pin;
int idleSolenoidFrequency;
int unused;
/**
* Digital Potentiometer is used by stock ECU stimulation code
*/
spi_device_e digitalPotentiometerSpiDevice;
brain_pin_e digitalPotentiometerChipSelect[DIGIPOT_COUNT];
adc_channel_mode_e adcHwChannelEnabled[HW_MAX_ADC_INDEX];
brain_pin_e triggerInputPins[2];
brain_pin_e logicAnalyzerPins[2];
int idleThreadPeriod;
int consoleLoopPeriod;
int lcdThreadPeriod;
int tunerStudioThreadPeriod;
int generalPeriodicThreadPeriod;
int tunerStudioSerialSpeed;
brain_pin_e boardTestModeJumperPin;
can_device_mode_e canDeviceMode;
brain_pin_e canTxPin;
brain_pin_e canRxPin;
brain_pin_e triggerSimulatorPins[3];
pin_output_mode_e triggerSimulatorPinModes[3];
brain_pin_e o2heaterPin;
pin_output_mode_e o2heaterPinModeTodO;
unsigned int is_enabled_spi_1 : 1;
unsigned int is_enabled_spi_2 : 1;
unsigned int is_enabled_spi_3 : 1;
int unused2[7];
} board_configuration_s;
/**
* @brief Engine configuration.
* Values in this data structure are adjustable and persisted in on-board flash RAM.
*
* The offsets are tracked using
* https://docs.google.com/spreadsheet/ccc?key=0AiAmAn6tn3L_dGJXZDZOcVVhaG9SaHZKU1dyMjhEV0E
*
* todo: currently the fields here are simply in the order in which they were implemented
* todo: re-arrange this structure one we have a stable code version
*/
typedef struct {
float injectorLag; // size 4, offset 0
/**
* cc/min, cubic centimeter per minute
*
* By the way, g/s = 0.125997881 * (lb/hr)
* g/s = 0.125997881 * (cc/min)/10.5
* g/s = 0.0119997981 * cc/min
*
*/
float injectorFlow; // size 4, offset 4
float battInjectorLagCorrBins[VBAT_INJECTOR_CURVE_SIZE]; // size 32, offset 8
float battInjectorLagCorr[VBAT_INJECTOR_CURVE_SIZE]; // size 32, offset 40
float cltFuelCorrBins[CLT_CURVE_SIZE]; // size 64, offset 72
float cltFuelCorr[CLT_CURVE_SIZE]; // size 64, offset 136
float iatFuelCorrBins[IAT_CURVE_SIZE]; // size 64, offset 200
float iatFuelCorr[IAT_CURVE_SIZE]; // size 64, offset 264
/**
* Should the trigger emulator push data right into trigger input, eliminating the need for physical jumper wires?
* PS: Funny name, right? :)
*/
short int directSelfStimulation; // size 2, offset 328
// todo: extract these two fields into a structure
// todo: we need two sets of TPS parameters - modern ETBs have to sensors
short int tpsMin; // size 2, offset 330
// tpsMax value as 10 bit ADC value. Not Voltage!
short int tpsMax; // size 2, offset 332
short int analogChartMode;
cranking_parameters_s crankingSettings;
MAP_sensor_config_s map;
// todo: merge with channel settings, use full-scale Thermistor here!
ThermistorConf cltThermistorConf; // size 40 (10*4), offset 336
ThermistorConf iatThermistorConf; // size 40, offset 376
float sparkDwellBins[DWELL_COUNT]; // offset 580
float sparkDwell[DWELL_COUNT];
float ignitionLoadBins[IGN_LOAD_COUNT];
float ignitionRpmBins[IGN_RPM_COUNT];
/**
* this value could be used to offset the whole ignition timing table by a constant
*/
float ignitionOffset;
/**
* While cranking (which causes battery voltage to drop) we can calculate dwell time in shaft
* degrees, not in absolute time as in running mode.
*/
float crankingChargeAngle;
timing_mode_e timingMode;
/**
* This value is used in 'fixed timing' mode, i.e. constant timing
* This mode is useful for instance while adjusting distributor location
*/
float fixedModeTiming;
// WARNING: by default, our small enums are ONE BYTE. but if the are surrounded by non-enums - alignments do the trick
engine_type_e engineType;
float fuelLoadBins[FUEL_LOAD_COUNT]; //
// RPM is float and not integer in order to use unified methods for interpolation
float fuelRpmBins[FUEL_RPM_COUNT]; //
/**
* Engine displacement, in liters
* see also cylindersCount
*/
float displacement;
int rpmHardLimit;
injection_mode_e crankingInjectionMode;
injection_mode_e injectionMode;
/**
* Inside rusEfi all the angles are handled in relation to the trigger synchronization event
* which depends on the trigger shape and has nothing to do wit Top Dead Center (TDC)
*
* For engine configuration humans need angles from TDC.
*
* This field is the angle between Top Dead Center (TDC) and the first trigger event.
* Knowing this angle allows us to control timing and other angles in reference to TDC.
*/
float globalTriggerAngleOffset;
/**
* We have 3.3V ADC and most of the analog input signals are 5V, this forces us to use
* voltage dividers on the input circuits. This parameter holds the coefficient of these dividers.
* see also vbattDividerCoeff
*/
float analogInputDividerCoefficient;
/**
* This setting controls which algorithm is used for ENGINE LOAD
*/
engine_load_mode_e algorithm;
/**
* see
*/
float vbattDividerCoeff;
/**
* Cooling fan turn-on temperature threshold, in Celsuis
*/
float fanOnTemperature;
/**
* Cooling fan turn-off temperature threshold, in Celsuis
*/
float fanOffTemperature;
int canReadEnabled;
int canWriteEnabled;
can_nbc_e can_nbc_type;
int can_sleep_period;
int cylindersCount;
ignition_mode_e ignitionMode;
firing_order_e firingOrder;
/**
* This magic constant is about four-stroke engines with camshaft position sensors.
* On any four stroke engine, each revolution of the camshaft is two revolutions
* of the crankshaft. If camshaft position is our primary sensor, we use this multiplier
* to convert from camshaft angles to crankshaft angles. All angels across the system
* should be crankshaft angles.
*/
float rpmMultiplier;
display_mode_e displayMode;
log_format_e logFormat;
int firmwareVersion;
int HD44780width;
int HD44780height;
adc_channel_e tpsAdcChannel;
int overrideCrankingIgnition;
int analogChartFrequency;
trigger_config_s triggerConfig;
int space;
adc_channel_e vBattAdcChannel;
float globalFuelCorrection;
// todo: merge with channel settings, use full-scale Thermistor!
adc_channel_e cltAdcChannel;
adc_channel_e iatAdcChannel;
adc_channel_e mafAdcChannel;
afr_sensor_s afrSensor;
float injectionOffset;
float crankingTimingAngle;
float diffLoadEnrichmentCoef;
air_pressure_sensor_config_s baroSensor;
float veLoadBins[VE_LOAD_COUNT];
float veRpmBins[VE_RPM_COUNT];
float afrLoadBins[AFR_LOAD_COUNT];
float afrRpmBins[AFR_RPM_COUNT];
// the large tables are always in the end - that's related to TunerStudio paging implementation
float fuelTable[FUEL_LOAD_COUNT][FUEL_RPM_COUNT]; // size 1024
float ignitionTable[IGN_LOAD_COUNT][IGN_RPM_COUNT]; // size 1024
float veTable[VE_LOAD_COUNT][VE_RPM_COUNT]; // size 1024
float afrTable[AFR_LOAD_COUNT][AFR_RPM_COUNT]; // size 1024
board_configuration_s bc;
int hasMapSensor;
int hasCltSensor;
idle_mode_e idleMode;
bool isInjectionEnabled : 1; // bit 0
bool isIgnitionEnabled : 1; // bit 1
bool isCylinderCleanupEnabled : 1; // bit 2
bool secondTriggerChannelEnabled : 1; // bit 3
bool needSecondTriggerInput : 1; // bit 4
int unused3[8];
} engine_configuration_s;
void setOperationMode(engine_configuration_s *engineConfiguration, operation_mode_e mode);
operation_mode_e getOperationMode(engine_configuration_s const *engineConfiguration);
typedef struct {
engine_configuration_s engineConfiguration;
} persistent_config_s;
typedef struct {
int version;
int size;
persistent_config_s persistentConfiguration;
crc_t value;
} persistent_config_container_s;
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
const char* getConfigurationName(engine_configuration_s *engineConfiguration);
void setDefaultConfiguration(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
void setWholeFuelMap(engine_configuration_s *engineConfiguration, float value);
void setConstantDwell(engine_configuration_s *engineConfiguration, float dwellMs);
void printFloatArray(const char *prefix, float array[], int size);
void incrementGlobalConfigurationVersion(void);
int getGlobalConfigurationVersion(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ENGINE_CONFIGURATION_H_ */

View File

@ -1,15 +0,0 @@
/**
* @file engine_state.h
* @brief One header which acts as gateway to current engine state
*
* @date Dec 20, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef ENGINE_STATE_H_
#define ENGINE_STATE_H_
#include "allsensors.h"
#include "rpm_calculator.h"
#endif /* ENGINE_STATE_H_ */

View File

@ -1,64 +0,0 @@
/**
* @file error_handling.h
*
* @date Mar 6, 2014
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef ERROR_HANDLING_H_
#define ERROR_HANDLING_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#include "obd_error_codes.h"
#include "stdbool.h"
/**
* Something is wrong, but we can live with it: some minor sensor is disconnected
* or something like that
*
*/
int warning(obd_code_e code, const char *fmt, ...);
/**
* Something really bad had happened - firmware cannot function
*
* todo: better method name?
*/
void firmwareError(const char *fmt, ...);
bool hasFirmwareError(void);
char *getFirmwareError(void);
/**
* declared as a macro so that this code does not use stack
* so that it would not crash the error handler in case of stack issues
*/
#if CH_DBG_SYSTEM_STATE_CHECK
#define hasFatalError() (dbg_panic_msg != NULL)
#else
#define hasFatalError() (FALSE)
#endif
void chDbgPanic3(const char *msg, const char * file, int line);
void initErrorHandling(void);
char *getWarninig(void);
// todo: better place for this shared declaration?
int getRusEfiVersion(void);
/**
* @deprecated Global panic is inconvenient because it's hard to deliver the error message while whole instance
* is stopped. Please use firmwareWarning() instead
*/
#define efiAssert(condition, message, result) { if (!(condition)) { firmwareError(message); return result; } }
#define efiAssertVoid(condition, message) { if (!(condition)) { firmwareError(message); return; } }
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ERROR_HANDLING_H_ */

View File

@ -1,34 +0,0 @@
/**
* @file event_registry.cpp
* @brief This data structure knows when to do what
*
* @date Nov 27, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "event_registry.h"
#include "main.h"
#include "engine_math.h"
//void registerActuatorEventWhat(ActuatorEventList *list, int eventIndex, OutputSignal *actuator, float angleOffset) {
// ActuatorEvent *e = list->getNextActuatorEvent();
// if (e == NULL)
// return; // error already reported
// e->position.eventIndex = eventIndex;
// e->actuator = actuator;
// e->position.angleOffset = angleOffset;
//}

View File

@ -1,83 +0,0 @@
/**
* @file event_registry.h
*
* @date Nov 27, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef EVENT_REGISTRY_H_
#define EVENT_REGISTRY_H_
#include "global.h"
#include "signal_executor.h"
#define MAX_EVENT_COUNT 80
/**
* This structure defines an angle position within the trigger
*/
typedef struct {
/**
* That's trigger event index
*/
int eventIndex;
float eventAngle;
/**
* Angle offset from the trigger event
*/
float angleOffset;
} event_trigger_position_s;
typedef struct {
event_trigger_position_s position;
OutputSignal *actuator;
} ActuatorEvent;
typedef struct IgnitionEvent_struct IgnitionEvent;
struct IgnitionEvent_struct {
io_pin_e io_pin;
scheduling_s signalTimerUp;
scheduling_s signalTimerDown;
event_trigger_position_s dwellPosition;
float advance;
event_trigger_position_s sparkPosition;
IgnitionEvent *next;
char *name;
};
template <class Type, int Dimention>
class ArrayList {
public:
int size;
Type events[Dimention];
void resetEventList(void);
Type *getNextActuatorEvent(void);
};
template <class Type, int Dimention>
void ArrayList< Type, Dimention>::resetEventList(void) {
size = 0;
}
template <class Type, int Dimention>
Type * ArrayList< Type, Dimention>::getNextActuatorEvent(void) {
efiAssert(size < Dimention, "registerActuatorEvent() too many events", (Type *)NULL);
return &events[size++];
}
typedef ArrayList<ActuatorEvent, MAX_EVENT_COUNT> ActuatorEventList;
typedef ArrayList<IgnitionEvent, MAX_EVENT_COUNT> IgnitionEventList;
///**
// * this is an intermediate implementation of flexible event handling.
// *
// * In the future implementation we will drop the 'eventIndex' parameter and everything will be
// * angle-driven. But that's just a plan for next iteration.
// *
// * @param actuator injector or coil OutputSignal
// */
//void registerActuatorEvent(ActuatorEventList *list, int eventIndex, OutputSignal *actuator, float angleOffset);
#endif /* EVENT_REGISTRY_H_ */

View File

@ -1,166 +0,0 @@
/**
* @file fuel_math.cpp
* @brief Fuel amount calculation logic
*
* While engine running, fuel amount is an interpolated value from the fuel map by getRpm() and getEngineLoad()
* On top of the value from the fuel map we also apply
* <BR>1) getInjectorLag() correction to account for fuel injector lag
* <BR>2) getCltCorrection() for warm-up
* <BR>3) getIatCorrection() to account for cold weather
*
* getCrankingFuel() depents only on getCoolantTemperature()
*
*
* @date May 27, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "main.h"
#include "fuel_math.h"
#include "interpolation.h"
#include "engine_configuration.h"
#include "allsensors.h"
#include "engine_math.h"
#include "rpm_calculator.h"
#include "speed_density.h"
#if EFI_ACCEL_ENRICHMENT
#include "accel_enrichment.h"
#endif /* EFI_ACCEL_ENRICHMENT */
float getBaseFuel(Engine *engine, int rpm) {
if (engine->engineConfiguration->algorithm == LM_SPEED_DENSITY) {
return getSpeedDensityFuel(engine, rpm);
} else {
float engineLoad = getEngineLoadT(engine);
return getBaseTableFuel(rpm, engineLoad);
}
}
/**
* @returns Length of fuel injection, in milliseconds
*/
float getFuelMs(int rpm, Engine *engine) {
if (isCranking()) {
return getCrankingFuel();
} else {
float baseFuel = getBaseFuel(engine, rpm);
float fuel = getRunningFuel(baseFuel, engine, rpm);
return fuel;
}
}
float getRunningFuel(float baseFuel, Engine *engine, int rpm) {
float iatCorrection = getIatCorrection(getIntakeAirTemperature());
float cltCorrection = getCltCorrection(getCoolantTemperature());
float injectorLag = getInjectorLag(getVBatt());
#if EFI_ACCEL_ENRICHMENT
float accelEnrichment = getAccelEnrichment();
// todo: accelEnrichment
#endif /* EFI_ACCEL_ENRICHMENT */
return baseFuel * cltCorrection * iatCorrection + injectorLag;
}
extern Engine engine;
extern engine_configuration_s *engineConfiguration;
static Map3D1616 fuelMap;
/**
* @brief Injector lag correction
* @param vBatt Battery voltage.
* @return Time in ms for injection opening time based on current battery voltage
*/
float getInjectorLag(float vBatt) {
if (cisnan(vBatt)) {
warning(OBD_System_Voltage_Malfunction, "vBatt=%f", vBatt);
return 0;
}
float vBattCorrection = interpolate2d(vBatt, engineConfiguration->battInjectorLagCorrBins,
engineConfiguration->battInjectorLagCorr, VBAT_INJECTOR_CURVE_SIZE);
return engineConfiguration->injectorLag + vBattCorrection;
}
/**
* @brief Initialize fuel map data structure
* @note this method has nothing to do with fuel map VALUES - it's job
* is to prepare the fuel map data structure for 3d interpolation
*/
void prepareFuelMap(void) {
fuelMap.init(engineConfiguration->fuelTable);
}
/**
* @brief Engine warm-up fuel correction.
*/
float getCltCorrection(float clt) {
if (cisnan(clt))
return 1; // this error should be already reported somewhere else, let's just handle it
return interpolate2d(clt, engineConfiguration->cltFuelCorrBins, engineConfiguration->cltFuelCorr, CLT_CURVE_SIZE);
}
float getIatCorrection(float iat) {
if (cisnan(iat))
return 1; // this error should be already reported somewhere else, let's just handle it
return interpolate2d(iat, engineConfiguration->iatFuelCorrBins, engineConfiguration->iatFuelCorr, IAT_CURVE_SIZE);
}
float getBaseTableFuel(int rpm, float engineLoad) {
efiAssert(!cisnan(engineLoad), "invalid el", NAN);
return fuelMap.getValue(engineLoad, engineConfiguration->fuelLoadBins, rpm,
engineConfiguration->fuelRpmBins);
}
float getCrankingFuel(void) {
return getStartingFuel(getCoolantTemperature());
}
float getStartingFuel(float coolantTemperature) {
// these magic constants are in Celsius
if (cisnan(coolantTemperature) || coolantTemperature < engineConfiguration->crankingSettings.coolantTempMinC)
return engineConfiguration->crankingSettings.fuelAtMinTempMs;
if (coolantTemperature > engineConfiguration->crankingSettings.coolantTempMaxC)
return engineConfiguration->crankingSettings.fuelAtMaxTempMs;
return interpolate(engineConfiguration->crankingSettings.coolantTempMinC,
engineConfiguration->crankingSettings.fuelAtMinTempMs,
engineConfiguration->crankingSettings.coolantTempMaxC,
engineConfiguration->crankingSettings.fuelAtMaxTempMs, coolantTemperature);
}
/**
* @return 0 for OM_DEFAULT and OM_OPENDRAIN
*/
inline static int getElectricalValue0(pin_output_mode_e mode) {
return mode == OM_INVERTED || mode == OM_OPENDRAIN_INVERTED;
}
/**
* @return 1 for OM_DEFAULT and OM_OPENDRAIN
*/
inline static int getElectricalValue1(pin_output_mode_e mode) {
return mode == OM_DEFAULT || mode == OM_OPENDRAIN;
}
// todo: this method is here for unit test visibility. todo: move to a bette place!
int getElectricalValue(int logicalValue, pin_output_mode_e mode) {
efiAssert(mode <= OM_OPENDRAIN_INVERTED, "invalid pin_output_mode_e", -1);
return logicalValue ? getElectricalValue1(mode) : getElectricalValue0(mode);
}

View File

@ -1,34 +0,0 @@
/**
* @file fuel_math.h
*
* @date May 27, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef FUEL_MAP_H_
#define FUEL_MAP_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#include "engine.h"
void prepareFuelMap(void);
float getBaseFuel(Engine *engine, int rpm);
float getBaseTableFuel(int rpm, float engineLoad);
float getIatCorrection(float iat);
float getInjectorLag(float vBatt);
float getCltCorrection(float clt);
float getRunningFuel(float baseFuel, Engine *engine, int rpm);
float getCrankingFuel(void);
float getStartingFuel(float coolantTemperature);
float getFuelMs(int rpm, Engine *engine);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* FUEL_MAP_H_ */

View File

@ -1,95 +0,0 @@
/**
* @file idle_controller.c
* @brief Simple Idle Air Valve control algorithm
*
* This algorithm is trying to get current RPM to the desired 'target' value
* by changing Idle Air Valve solenoid duty cycle. Depending on how far current RPM
* is from the target RPM, the incremental change would be smaller or bigger.
*
*
* todo: DEFAULT_IDLE_DUTY should be a field on the IdleValveState, not a constant
*
* @date May 22, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "idle_controller.h"
#include "efilib.h"
// todo: move this to "idle_controller.h"
int isCranking(void);
static int lastGoodValue = DEFAULT_IDLE_DUTY;
void idleInit(IdleValveState *idle) {
idle->value = DEFAULT_IDLE_DUTY;
setIdleRpm(idle, DEFAULT_TARGET_RPM);
idle->timeOfLastIdleChange = 0;
}
void setIdleRpm(IdleValveState *idle, int targetRpm) {
idle->targetRpmRangeLeft = (int)(targetRpm * 0.93);
idle->targetRpmRangeRight = (int)(targetRpm * 1.07);
}
/**
* @brief sets new idle valve duty cycle: checks the bounds and reports new value
*/
static int setNewValue(IdleValveState *idle, int currentRpm, int now, char * msg, int newValue) {
newValue = maxI(newValue, MIN_IDLE);
newValue = minI(newValue, MAX_IDLE);
if (idle->value != newValue) {
idleDebug(msg, currentRpm);
idle->timeOfLastIdleChange = now;
}
idle->value = newValue;
return newValue;
}
static int changeValue(IdleValveState *idle, int currentRpm, int now, char * msg, int delta) {
int newValue = idle->value + delta;
return setNewValue(idle, currentRpm, now, msg, newValue);
}
/**
* now - current time in seconds
*/
int getIdle(IdleValveState *idle, int currentRpm, int now) {
if (currentRpm == 0 || isCranking()) {
return setNewValue(idle, currentRpm, now, "cranking value: ", DEFAULT_IDLE_DUTY);
}
if (currentRpm < 0.7 * idle->targetRpmRangeLeft) {
return setNewValue(idle, currentRpm, now, "RPMs are seriously low: ", lastGoodValue);
}
if (now - idle->timeOfLastIdleChange < IDLE_PERIOD) {
// too soon to adjust anything - exiting
return idle->value;
}
if (currentRpm > idle->targetRpmRangeLeft && currentRpm < idle->targetRpmRangeRight) {
// current RPM is good enough
// todo: need idle signal input
//lastGoodValue = idle->value;
return idle->value;
}
if (currentRpm >= idle->targetRpmRangeRight + 100)
return changeValue(idle, currentRpm, now, "idle control: rpm is too high: ", -IDLE_DECREASE_STEP);
if (currentRpm >= idle->targetRpmRangeRight)
return changeValue(idle, currentRpm, now, "idle control: rpm is a bit too high: ", -1);
// we are here if RPM is low, let's see how low
// if (currentRpm < 0.7 * idle->targetRpmRangeLeft) {
// // todo: act faster in case of really low RPM?
// return setNewValue(idle, currentRpm, now, "RPMs are seriously low: ", 15 * IDLE_INCREASE_STEP);
// } else
if (currentRpm < idle->targetRpmRangeLeft - 100) {
return changeValue(idle, currentRpm, now, "idle control: RPMs are low: ", IDLE_INCREASE_STEP);
}
return changeValue(idle, currentRpm, now, "idle control: RPMs are a bit low: ", 1);
}

View File

@ -1,50 +0,0 @@
/**
* @file idle_controller.h
*
* @date May 22, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef IDLE_CONTROLLER_H_
#define IDLE_CONTROLLER_H_
// 700‰ duty cycle by default
#define DEFAULT_IDLE_DUTY 600
#define DEFAULT_TARGET_RPM 1000
//#define DEFAULT_TARGET_RPM 2000
#define IDLE_PERIOD 1
// Per mil (1/1000) values
#define MIN_IDLE 100
#define MAX_IDLE 900
#define IDLE_INCREASE_STEP 5
#define IDLE_DECREASE_STEP 5
typedef struct {
int time;
int targetRpmRangeLeft, targetRpmRangeRight;
int value;
int timeOfLastIdleChange;
} IdleValveState;
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void idleInit(IdleValveState *idle);
int getIdle(IdleValveState *idle, int currentRpm, int time);
void setIdleRpm(IdleValveState *idle, int targetRpm);
void idleDebug(char *msg, int value);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* IDLE_CONTROLLER_H_ */

View File

@ -1,142 +0,0 @@
/**
* @file io_pins.h
*
* @date Jan 24, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef STATUS_LEDS_H_
#define STATUS_LEDS_H_
#include "main.h"
#define GPIO_NULL NULL
/**
* Logical pins. See brain_pin_e for physical pins.
*/
typedef enum {
LED_WARNING, // Orange on-board LED
LED_RUNNING, // Green on-board LED
LED_ERROR, // Red on-board LED
LED_COMMUNICATION_1, // Blue on-board LED
LED_EXT_1, // external board LED
LED_EXT_2, // external board LED
LED_EXT_3, // external board LED
LED_DEBUG,
LED_EMULATOR,
/**
* see board_configuration_s->idleValvePin
*/
IDLE_VALVE,
TRIGGER_EMULATOR_PRIMARY,
TRIGGER_EMULATOR_SECONDARY,
TRIGGER_EMULATOR_3RD,
SPARKOUT_1_OUTPUT,
SPARKOUT_2_OUTPUT,
SPARKOUT_3_OUTPUT,
SPARKOUT_4_OUTPUT,
SPARKOUT_5_OUTPUT,
SPARKOUT_6_OUTPUT,
SPARKOUT_7_OUTPUT,
SPARKOUT_8_OUTPUT,
SPARKOUT_9_OUTPUT,
SPARKOUT_10_OUTPUT,
SPARKOUT_11_OUTPUT,
SPARKOUT_12_OUTPUT,
INJECTOR_1_OUTPUT,
INJECTOR_2_OUTPUT,
INJECTOR_3_OUTPUT,
INJECTOR_4_OUTPUT,
INJECTOR_5_OUTPUT,
INJECTOR_6_OUTPUT,
INJECTOR_7_OUTPUT,
INJECTOR_8_OUTPUT,
INJECTOR_9_OUTPUT,
INJECTOR_10_OUTPUT,
INJECTOR_11_OUTPUT,
INJECTOR_12_OUTPUT,
ELECTRONIC_THROTTLE_CONTROL_1,
ELECTRONIC_THROTTLE_CONTROL_2,
ELECTRONIC_THROTTLE_CONTROL_3,
/**
* these seven segment display pins are related to unused external tachometer code
* I still have the hardware so maybe one day I will fix it, but for now it's just dead code
* See https://www.youtube.com/watch?v=YYiHoN6MBqE
* todo: this should be re-implemented in a smarter way with some sort of multiplexing anyway
*/
/* digit 1 */
LED_HUGE_0, // B2
LED_HUGE_1,
LED_HUGE_2,
LED_HUGE_3,
LED_HUGE_4,
LED_HUGE_5,
LED_HUGE_6,
/* digit 2 */
LED_HUGE_7,
LED_HUGE_8,
LED_HUGE_9, // E15
LED_HUGE_10,
LED_HUGE_11,
LED_HUGE_12,
LED_HUGE_13,
/* digit 3 */
LED_HUGE_14,
LED_HUGE_15,
LED_HUGE_16,
LED_HUGE_17,
LED_HUGE_18,
LED_HUGE_19,
LED_HUGE_20,
// malfunction LED indicator - CheckEngine
LED_CHECK_ENGINE,
FUEL_PUMP_RELAY,
FAN_RELAY,
O2_HEATER,
SPI_CS_1,
SPI_CS_2,
SPI_CS_3,
SPI_CS_4,
SPI_CS_SD_MODULE,
/**
* This output pin is used to turn alternator on or off
*/
ALTERNATOR_SWITCH,
} io_pin_e;
#define IO_PIN_COUNT 100
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void initPrimaryPins(void);
void initOutputPins(void);
const char *getPinName(io_pin_e io_pin);
void turnOutputPinOn(io_pin_e pin);
void turnOutputPinOff(io_pin_e pin);
void setOutputPinValue(io_pin_e pin, int logicValue);
int getElectricalValue(int logicalValue, pin_output_mode_e mode);
int getOutputPinValue(io_pin_e pin);
void setDefaultPinState(io_pin_e pin, pin_output_mode_e *defaultState);
void outputPinRegisterExt2(const char *msg, io_pin_e ioPin, brain_pin_e brainPin, pin_output_mode_e *outputMode);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* STATUS_LEDS_H_ */

View File

@ -1,54 +0,0 @@
/**
* @file main_trigger_callback.h
* @brief Main logic header
*
*
* @date Feb 9, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef MAIN_LOOP_H_
#define MAIN_LOOP_H_
#include "main.h"
#define MAX_INJECTOR_COUNT 12
#define MAX_IGNITER_COUNT 4
#ifdef __cplusplus
#include "engine_configuration.h"
#include "ec2.h"
#include "event_registry.h"
#include "engine.h"
class MainTriggerCallback {
public:
// MainTriggerCallback();
void init(Engine *engine, engine_configuration2_s *engineConfiguration2);
Engine *engine;
engine_configuration_s *engineConfiguration;
engine_configuration2_s *engineConfiguration2;
};
void initMainEventListener(Engine *engine, engine_configuration2_s *engineConfiguration2);
void onTriggerEvent(trigger_event_e ckpSignalType, int eventIndex, MainTriggerCallback *mainTriggerCallback);
#endif
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void showMainHistogram(void);
void onEveryMillisecondTimerSignal(void);
int isIgnitionTimingError(void);
float getFuel(int rpm, float key);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* MAIN_LOOP_H_ */

View File

@ -1,60 +0,0 @@
/**
* @file malfunction_central.c
* @brief This data structure holds current malfunction codes
*
* @date Dec 20, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#include "malfunction_central.h"
static error_codes_set_s error_codes_set;
/**
* @return -1 if code not found
*/
static int find_position(obd_code_e e_code) // Search if code is present
{
// cycle for searching element equal seaching code
for (int t = 0; t < error_codes_set.count; t++)
if (error_codes_set.error_codes[t] == e_code)
return t; // we found position where this code is present
return -1; // -1 if code not found
}
void initMalfunctionCentral(void) {
error_codes_set.count = 0;
}
void addError(obd_code_e errorCode) {
if (error_codes_set.count < MAX_ERROR_CODES_COUNT && find_position(errorCode) == -1) {
error_codes_set.error_codes[error_codes_set.count] = errorCode;
error_codes_set.count++;
}
}
void removeError(obd_code_e errorCode) {
int pos = find_position(errorCode);
if (pos >= 0) {
for (int t = pos; t < error_codes_set.count; t++) // shift all right elements to one pos left
error_codes_set.error_codes[t] = error_codes_set.error_codes[t + 1];
error_codes_set.error_codes[--error_codes_set.count] = (obd_code_e)0; // place 0
}
}
void setError(int flag, obd_code_e errorCode) {
if (flag)
addError(errorCode);
else
removeError(errorCode);
}
void getErrorCodes(error_codes_set_s * copy) {
copy->count = error_codes_set.count;
for (int i = 0; i < copy->count; i++)
copy->error_codes[i] = error_codes_set.error_codes[i];
}
bool hasErrorCodes(void) {
return error_codes_set.count > 0;
}

View File

@ -1,57 +0,0 @@
/**
* @file malfunction_central.h
* @brief This data structure holds current malfunction codes
*
* @date Dec 20, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*/
#ifndef MALFUNCTION_CENTRAL_H_
#define MALFUNCTION_CENTRAL_H_
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#include "main.h"
#include "obd_error_codes.h"
#define MAX_ERROR_CODES_COUNT 10
typedef struct {
int count;
obd_code_e error_codes[MAX_ERROR_CODES_COUNT];
} error_codes_set_s;
void initMalfunctionCentral(void);
/**
* @brief Adds an error code into the set of current errors.
* The error code is placed into the fixed-size data structure if it fits into it.
* The error code stays in the data structure till it is removed by 'clearError'
*
*/
void addError(obd_code_e errorCode);
/**
* @brief Removed the error code from the set of current errors.
*
*/
void removeError(obd_code_e errorCode);
void setError(int flag, obd_code_e errorCode);
/**
* @brief Copies the current set of errors into the specified buffer
*/
void getErrorCodes(error_codes_set_s * buffer);
bool hasErrorCodes(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* MALFUNCTION_CENTRAL_H_ */

View File

@ -1,88 +0,0 @@
/*
* map_adjuster.c
*
* @date Jul 23, 2013
* @author Andrey Belomutskiy, (c) 2012-2014
*
*
* This file is part of rusEfi - see http://rusefi.com
*
* rusEfi is free software; you can redistribute it and/or modify it under the terms of
* the GNU General Public License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* rusEfi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include <stddef.h>
#include "map_adjuster.h"
#include "avg_values.h"
#define TARGET_MIN_AFR 11
#define TARGET_MAX_AFR 16
#define HOW_MANY_MEASURMENTS_ARE_NEEDED 5
#define MULT_STEP_DOWN 0.92
#if 0
static AvgTable adjustments;
static AvgTable afrs;
void initMapAdjuster(void) {
avgReset(&afrs);
avgFill(&adjustments, 1, 1);
}
float maxF(float i1, float i2) {
return i1 > i2 ? i1 : i2;
}
static int adjustCell(int i, int j, void (*callback)(int, float, float)) {
int count = afrs.counts[i][j];
if (count < HOW_MANY_MEASURMENTS_ARE_NEEDED)
return 0;
float value = avgGetValueByIndexes(&afrs, i, j);
afrs.counts[i][j] = 0;
afrs.values[i][j] = 0;
if (value < TARGET_MIN_AFR) {
float currentMult = adjustments.values[i][j];
// printf("adj %d %d. cur=%f\r\n", i, j, currentMult);
float newValue = maxF(0.1, MULT_STEP_DOWN * currentMult);
adjustments.values[i][j] = newValue;
// printf("adj %d %d. new=%f\r\n", i, j, adjustments.values[i][j]);
if (callback != NULL)
callback(MAX_RPM * i / AVG_TAB_SIZE, 1.0 * MAX_KEY * j / AVG_TAB_SIZE, newValue);
return 1;
}
return 0;
}
int runMapAdjustments(void (*callback)(int, float, float)) {
int total = 0;
for (int i = 0; i < AVG_TAB_SIZE; i++) {
for (int j = 0; j < AVG_TAB_SIZE; j++) {
total += adjustCell(i, j, callback);
}
}
return total;
}
void addAfr(int rpm, float key, float afr) {
avgAddValue(&afrs, rpm, key, afr);
}
float getMultiplier(int rpm, float key) {
return avgGetValue(&adjustments, rpm, key);
}
#endif /* 0 */

Some files were not shown because too many files have changed in this diff Show More