auto-sync
This commit is contained in:
parent
8b29a2ba42
commit
257f46507b
|
@ -43,7 +43,7 @@
|
|||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.1287725454" name="FPU Type" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.fpv4spd16" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto.463687969" name="Link-time optimizer (-flto)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto" value="true" valueType="boolean"/>
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.920767907" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
|
||||
<builder buildPath="${workspace_loc:/firmware.newc}/Debug" id="ilg.gnuarmeclipse.managedbuild.cross.builder.2137117093" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||
<builder buildPath="${workspace_loc:/firmware}/Debug" id="ilg.gnuarmeclipse.managedbuild.cross.builder.2137117093" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.1587722559" name="Cross ARM GNU Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.533250110" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" value="true" valueType="boolean"/>
|
||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.616095263" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/>
|
||||
|
@ -249,7 +249,7 @@
|
|||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash.1425498986" name="Create flash image" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.createflash" value="true" valueType="boolean"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize.1740680628" name="Print size" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.addtools.printsize" value="true" valueType="boolean"/>
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.837857135" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
|
||||
<builder buildPath="${workspace_loc:/firmware.newc}/Release" id="ilg.gnuarmeclipse.managedbuild.cross.builder.2122141174" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||
<builder buildPath="${workspace_loc:/firmware}/Release" id="ilg.gnuarmeclipse.managedbuild.cross.builder.2122141174" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.1321040525" name="Cross ARM GNU Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.262734782" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" value="true" valueType="boolean"/>
|
||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.66687840" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/>
|
||||
|
@ -335,7 +335,7 @@
|
|||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.1732001730" name="FPU Type" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit" value="ilg.gnuarmeclipse.managedbuild.cross.option.arm.target.fpu.unit.fpv4spd16" valueType="enumerated"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto.1668820449" name="Link-time optimizer (-flto)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.optimization.lto" value="true" valueType="boolean"/>
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.1817810839" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
|
||||
<builder buildPath="${workspace_loc:/firmware.newc}/Debug" id="ilg.gnuarmeclipse.managedbuild.cross.builder.1551751280" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||
<builder buildPath="${workspace_loc:/firmware}/Debug" id="ilg.gnuarmeclipse.managedbuild.cross.builder.1551751280" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.539236567" name="Cross ARM GNU Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.922093160" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" value="true" valueType="boolean"/>
|
||||
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input.422780115" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.input"/>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>firmware.newc</name>
|
||||
<name>firmware</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
|
|
|
@ -122,7 +122,7 @@ CSRC = $(PORTSRC) \
|
|||
$(CONSOLEUTILSRC) \
|
||||
$(HALSRC) \
|
||||
$(EMULATIONSRC) \
|
||||
$(HW_LAYERSRC) \
|
||||
$(HW_LAYER_EMS) \
|
||||
$(CONTROLLERSSRC) \
|
||||
$(CONTROLLERS_ALGO_SRC) \
|
||||
$(CONTROLLERS_CORE_SRC) \
|
||||
|
@ -143,7 +143,7 @@ CPPSRC = $(CHCPPSRC) \
|
|||
$(CONTROLLERS_ALGO_SRC_CPP) \
|
||||
$(SYSTEMSRC_CPP) \
|
||||
$(ENGINES_SRC_CPP) \
|
||||
$(HW_LAYER_SRC_CPP) \
|
||||
$(HW_LAYER_EMS_CPP) \
|
||||
$(TUNERSTUDIO_SRC_CPP) \
|
||||
$(CONSOLE_SRC_CPP) \
|
||||
$(CONTROLLERS_SENSORS_SRC_CPP) \
|
||||
|
|
|
@ -11,12 +11,16 @@
|
|||
|
||||
#include "main.h"
|
||||
#include "can_hw.h"
|
||||
#include "pin_repository.h"
|
||||
#include "string.h"
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
|
||||
#include "pin_repository.h"
|
||||
#include "engine_state.h"
|
||||
#include "can_header.h"
|
||||
#include "engine_configuration.h"
|
||||
#include "vehicle_speed.h"
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
#if EFI_CAN_SUPPORT || defined(__DOXYGEN__)
|
||||
|
||||
|
@ -100,6 +104,8 @@ static void sendMessage() {
|
|||
sendMessage2(8);
|
||||
}
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
|
||||
static void canDashboardBMW(void) {
|
||||
//BMW Dashboard
|
||||
commonTxInit(CAN_BMW_E46_SPEED);
|
||||
|
@ -237,9 +243,15 @@ static void canInfo(void) {
|
|||
scheduleMsg(&logger, "CAN rx count %d/tx ok %d/tx not ok %d", canReadCounter, can_write_ok, can_write_not_ok);
|
||||
}
|
||||
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
|
||||
void initCan(void) {
|
||||
#if EFI_PROD_CODE
|
||||
if (!engineConfiguration->isCanEnabled)
|
||||
return;
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
initLogging(&logger, "CAN driver");
|
||||
|
||||
#if STM32_CAN_USE_CAN2
|
||||
|
@ -251,12 +263,15 @@ void initCan(void) {
|
|||
#endif
|
||||
|
||||
canStart(&EFI_CAN_DEVICE, &canConfig);
|
||||
#if EFI_PROD_CODE
|
||||
|
||||
chThdCreateStatic(canTreadStack, sizeof(canTreadStack), NORMALPRIO, (tfunc_t) canThread, NULL);
|
||||
|
||||
mySetPadMode2("CAN TX", boardConfiguration->canTxPin, PAL_MODE_ALTERNATE(EFI_CAN_TX_AF));
|
||||
mySetPadMode2("CAN RX", boardConfiguration->canRxPin, PAL_MODE_ALTERNATE(EFI_CAN_RX_AF));
|
||||
|
||||
addConsoleAction("caninfo", canInfo);
|
||||
#endif /* EFI_PROD_CODE */
|
||||
}
|
||||
|
||||
#endif /* EFI_CAN_SUPPORT */
|
||||
|
|
|
@ -262,7 +262,7 @@ void initHardware(Logging *logger, Engine *engine) {
|
|||
initOutputPins();
|
||||
|
||||
#if EFI_MAX_31855
|
||||
initMax31855(boardConfiguration);
|
||||
initMax31855(getSpiDevice(boardConfiguration->max31855spiDevice), boardConfiguration->max31855_cs);
|
||||
#endif /* EFI_MAX_31855 */
|
||||
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
|
||||
HW_LAYERSRC = $(PROJECT_DIR)/hw_layer/pin_repository.c \
|
||||
HW_LAYER_EMS = $(PROJECT_DIR)/hw_layer/pin_repository.c \
|
||||
$(PROJECT_DIR)/hw_layer/io_pins.c \
|
||||
$(PROJECT_DIR)/hw_layer/mcp3208.c \
|
||||
$(PROJECT_DIR)/hw_layer/max31855.c \
|
||||
$(PROJECT_DIR)/hw_layer/lcd/lcd_HD44780.c \
|
||||
$(PROJECT_DIR)/hw_layer/microsecond_timer.c \
|
||||
$(PROJECT_DIR)/hw_layer/serial_over_usb/usbcfg.c \
|
||||
|
@ -14,7 +13,7 @@ HW_LAYERSRC = $(PROJECT_DIR)/hw_layer/pin_repository.c \
|
|||
$(PROJECT_DIR)/hw_layer/gpio_helper.c \
|
||||
$(PROJECT_DIR)/hw_layer/wave_analyzer_hw.c
|
||||
|
||||
HW_LAYER_SRC_CPP = $(PROJECT_DIR)/hw_layer/hardware.cpp \
|
||||
HW_LAYER_EMS_CPP = $(PROJECT_DIR)/hw_layer/hardware.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/can_hw.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/adc_inputs.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/board_test.cpp \
|
||||
|
@ -22,6 +21,10 @@ HW_LAYER_SRC_CPP = $(PROJECT_DIR)/hw_layer/hardware.cpp \
|
|||
$(PROJECT_DIR)/hw_layer/trigger_input.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/HIP9011.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/vehicle_speed.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/max31855.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/stepper.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/stm32f4/mpu_util.cpp
|
||||
|
||||
HW_LAYER_EGT_CPP = $(PROJECT_DIR)/hw_layer/can_hw.cpp \
|
||||
$(PROJECT_DIR)/hw_layer/max31855.cpp
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* @file max31855.c
|
||||
* @file max31855.cpp
|
||||
* @brief MAX31855 Thermocouple-to-Digital Converter driver
|
||||
*
|
||||
*
|
||||
|
@ -13,12 +13,15 @@
|
|||
*/
|
||||
|
||||
#include "max31855.h"
|
||||
#include "pin_repository.h"
|
||||
#include "settings.h"
|
||||
#include "hardware.h"
|
||||
// that's for swap
|
||||
#include "tunerstudio_algo.h"
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
#include "hardware.h"
|
||||
#include "settings.h"
|
||||
#include "pin_repository.h"
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
#if EFI_MAX_31855
|
||||
|
||||
#define EGT_ERROR_VALUE -1000
|
||||
|
@ -29,7 +32,10 @@ static Logging logger;
|
|||
|
||||
static SPIConfig spiConfig[MAX31855_CS_COUNT];
|
||||
|
||||
static void showEgtInfo(board_configuration_s *boardConfiguration) {
|
||||
EXTERN_ENGINE;
|
||||
|
||||
static void showEgtInfo(void) {
|
||||
#if EFI_PROD_CODE
|
||||
printSpiState(&logger, boardConfiguration);
|
||||
|
||||
scheduleMsg(&logger, "EGT spi: %d", boardConfiguration->max31855spiDevice);
|
||||
|
@ -37,10 +43,9 @@ static void showEgtInfo(board_configuration_s *boardConfiguration) {
|
|||
for (int i = 0; i < MAX31855_CS_COUNT; i++) {
|
||||
if (boardConfiguration->max31855_cs[i] != GPIO_UNASSIGNED) {
|
||||
scheduleMsg(&logger, "%d ETG @ %s", i, hwPortname(boardConfiguration->max31855_cs[i]));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// bits D17 and D3 are always expected to be zero
|
||||
|
@ -135,22 +140,21 @@ static void egtRead(void) {
|
|||
}
|
||||
}
|
||||
|
||||
void initMax31855(board_configuration_s *boardConfiguration) {
|
||||
void initMax31855(SPIDriver *drv, egt_cs_array_t max31855_cs) {
|
||||
initLogging(&logger, "EGT");
|
||||
|
||||
driver = getSpiDevice(boardConfiguration->max31855spiDevice);
|
||||
driver = drv;
|
||||
|
||||
|
||||
addConsoleActionP("egtinfo", (VoidPtr) showEgtInfo, boardConfiguration);
|
||||
addConsoleAction("egtinfo", (Void) showEgtInfo);
|
||||
|
||||
addConsoleAction("egtread", (Void) egtRead);
|
||||
|
||||
turnOnSpi(SPI_DEVICE_3);
|
||||
|
||||
for (int i = 0; i < MAX31855_CS_COUNT; i++) {
|
||||
if (boardConfiguration->max31855_cs[i] != GPIO_UNASSIGNED) {
|
||||
if (max31855_cs[i] != GPIO_UNASSIGNED) {
|
||||
|
||||
initSpiCs(&spiConfig[i], boardConfiguration->max31855_cs[i]);
|
||||
initSpiCs(&spiConfig[i], max31855_cs[i]);
|
||||
|
||||
spiConfig[i].cr1 = SPI_BaudRatePrescaler_8;
|
||||
}
|
|
@ -16,7 +16,7 @@ extern "C"
|
|||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
void initMax31855(board_configuration_s *boardConfiguration);
|
||||
void initMax31855(SPIDriver *drv, egt_cs_array_t max31855_cs);
|
||||
uint16_t getEgtValue(int egtChannel);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Reference in New Issue