More portability & bootloader fix (#720)
* fix bootloader * EFI_FSIO * EFI_EMULATE_POSITION_SENSORS, EFI_BOARD_TEST, EFI_AUX_PID, EFI_JOYSTICK
This commit is contained in:
parent
1238a16c63
commit
001fbb2526
|
@ -127,7 +127,7 @@ include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
|
||||||
|
|
||||||
include $(CONFIG)/boards/$(PROJECT_BOARD)/board.mk
|
include $(CONFIG)/boards/$(PROJECT_BOARD)/board.mk
|
||||||
|
|
||||||
include $(PROJECT_DIR)/hw_layer/$(CPU_HWLAYER)/hw_stm32.mk
|
include $(PROJECT_DIR)/hw_layer/$(CPU_HWLAYER)/hw_ports.mk
|
||||||
|
|
||||||
# Define linker script file here
|
# Define linker script file here
|
||||||
ifeq ($(LDSCRIPT),)
|
ifeq ($(LDSCRIPT),)
|
||||||
|
|
|
@ -229,6 +229,7 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
engineConfiguration->vbattDividerCoeff = ((float) (10 + 33)) / 10 * 2;
|
engineConfiguration->vbattDividerCoeff = ((float) (10 + 33)) / 10 * 2;
|
||||||
|
|
||||||
// VICS solenoid
|
// VICS solenoid
|
||||||
|
#if EFI_FSIO || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* to test
|
* to test
|
||||||
* set_fsio_setting 1 5000
|
* set_fsio_setting 1 5000
|
||||||
|
@ -237,7 +238,6 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
// set_fsio_expression 1 "rpm > fsio_setting(1)"
|
// set_fsio_expression 1 "rpm > fsio_setting(1)"
|
||||||
setFsioExt(0, GPIOE_3, RPM_ABOVE_USER_SETTING_1, 150 PASS_ENGINE_PARAMETER_SUFFIX);
|
setFsioExt(0, GPIOE_3, RPM_ABOVE_USER_SETTING_1, 150 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
|
||||||
|
|
||||||
// warning light
|
// warning light
|
||||||
/**
|
/**
|
||||||
* to test
|
* to test
|
||||||
|
@ -255,7 +255,7 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
|
||||||
// setFsio(1, GPIOC_13, "rpm 2 fsio_setting > coolant 3 fsio_setting > | vbatt 4 fsio_setting < |" PASS_ENGINE_PARAMETER_SUFFIX);
|
// setFsio(1, GPIOC_13, "rpm 2 fsio_setting > coolant 3 fsio_setting > | vbatt 4 fsio_setting < |" PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
setFsio(1, GPIOD_7, RPM_ABOVE_USER_SETTING_2 PASS_ENGINE_PARAMETER_SUFFIX);
|
setFsio(1, GPIOD_7, RPM_ABOVE_USER_SETTING_2 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
#endif /* EFI_FSIO */
|
||||||
|
|
||||||
config->ignitionRpmBins[0] = 800;
|
config->ignitionRpmBins[0] = 800;
|
||||||
config->ignitionRpmBins[1] = 1200;
|
config->ignitionRpmBins[1] = 1200;
|
||||||
|
|
|
@ -50,6 +50,7 @@ void setLadaKalina(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
|
||||||
|
|
||||||
// starter relay solenoid
|
// starter relay solenoid
|
||||||
|
#if EFI_FSIO || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* to test
|
* to test
|
||||||
* set_fsio_setting 1 5000
|
* set_fsio_setting 1 5000
|
||||||
|
@ -57,5 +58,5 @@ void setLadaKalina(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
engineConfiguration->bc.fsio_setting[0] = 500;
|
engineConfiguration->bc.fsio_setting[0] = 500;
|
||||||
// set_rpn_expression 1 "rpm 0 fsio_setting <"
|
// set_rpn_expression 1 "rpm 0 fsio_setting <"
|
||||||
setFsioExt(0, GPIOE_3, RPM_BELOW_USER_SETTING_1, 0 PASS_ENGINE_PARAMETER_SUFFIX);
|
setFsioExt(0, GPIOE_3, RPM_BELOW_USER_SETTING_1, 0 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
#endif /* EFI_FSIO */
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,8 +231,10 @@ void setMiataNA6_MAP_Configuration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
|
||||||
// set_fsio_expression 0 "((rpm > fsio_setting(4) & (fsio_analog_input < fsio_setting(5)) | rpm > fsio_setting(1) | (coolant > fsio_setting(2) > | (vbatt < fsio_setting(3)"
|
// set_fsio_expression 0 "((rpm > fsio_setting(4) & (fsio_analog_input < fsio_setting(5)) | rpm > fsio_setting(1) | (coolant > fsio_setting(2) > | (vbatt < fsio_setting(3)"
|
||||||
|
|
||||||
|
#if EFI_FSIO || defined(__DOXYGEN__)
|
||||||
// todo: convert
|
// todo: convert
|
||||||
setFsio(0, GPIOC_13, COMBINED_WARNING_LIGHT PASS_ENGINE_PARAMETER_SUFFIX);
|
setFsio(0, GPIOC_13, COMBINED_WARNING_LIGHT PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
#endif /* EFI_FSIO */
|
||||||
|
|
||||||
boardConfiguration->injectionPins[0] = GPIOD_3; // #1&3 pin 3U
|
boardConfiguration->injectionPins[0] = GPIOD_3; // #1&3 pin 3U
|
||||||
boardConfiguration->injectionPins[1] = GPIOE_2; // #2&4 pin 3V
|
boardConfiguration->injectionPins[1] = GPIOE_2; // #2&4 pin 3V
|
||||||
|
|
|
@ -90,7 +90,7 @@ void setMitsubishiConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
#if EFI_FSIO || defined(__DOXYGEN__)
|
#if EFI_FSIO || defined(__DOXYGEN__)
|
||||||
setFsioExt(0, GPIOC_9, RPM_ABOVE_6000_SOLENOID_80_DUTY, 200 PASS_ENGINE_PARAMETER_SUFFIX);
|
setFsioExt(0, GPIOC_9, RPM_ABOVE_6000_SOLENOID_80_DUTY, 200 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
setFsioExt(1, GPIOC_7, RPM_ABOVE_2000_SOLENOID_50_DUTY, 200 PASS_ENGINE_PARAMETER_SUFFIX);
|
setFsioExt(1, GPIOC_7, RPM_ABOVE_2000_SOLENOID_50_DUTY, 200 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
#endif
|
#endif /* EFI_FSIO */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -194,8 +194,9 @@ void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
onConfigurationChangeRpmEmulatorCallback(&activeConfiguration);
|
onConfigurationChangeRpmEmulatorCallback(&activeConfiguration);
|
||||||
#endif /* EFI_EMULATE_POSITION_SENSORS */
|
#endif /* EFI_EMULATE_POSITION_SENSORS */
|
||||||
|
|
||||||
|
#if EFI_FSIO || defined(__DOXYGEN__)
|
||||||
onConfigurationChangeFsioCallback(&activeConfiguration PASS_ENGINE_PARAMETER_SUFFIX);
|
onConfigurationChangeFsioCallback(&activeConfiguration PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
#endif /* EFI_FSIO */
|
||||||
rememberCurrentConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
rememberCurrentConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1108,6 +1109,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
setBoardConfigurationOverrides();
|
setBoardConfigurationOverrides();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if EFI_FSIO || defined(__DOXYGEN__)
|
||||||
/**
|
/**
|
||||||
* to test:
|
* to test:
|
||||||
* set_fsio_setting 1 5000
|
* set_fsio_setting 1 5000
|
||||||
|
@ -1121,7 +1123,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
// simple warning light as default configuration
|
// simple warning light as default configuration
|
||||||
// set_fsio_expression 1 "rpm > fsio_setting(1)"
|
// set_fsio_expression 1 "rpm > fsio_setting(1)"
|
||||||
setFsio(0, GPIO_UNASSIGNED, RPM_ABOVE_USER_SETTING_1 PASS_ENGINE_PARAMETER_SUFFIX);
|
setFsio(0, GPIO_UNASSIGNED, RPM_ABOVE_USER_SETTING_1 PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
|
#endif /* EFI_FSIO */
|
||||||
}
|
}
|
||||||
|
|
||||||
void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
|
|
|
@ -1309,10 +1309,10 @@ static void setValue(const char *paramStr, const char *valueStr) {
|
||||||
engineConfiguration->tpsMax = valueI;
|
engineConfiguration->tpsMax = valueI;
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "tps_min")) {
|
} else if (strEqualCaseInsensitive(paramStr, "tps_min")) {
|
||||||
engineConfiguration->tpsMin = valueI;
|
engineConfiguration->tpsMin = valueI;
|
||||||
#if ! EFI_UNIT_TEST || defined(__DOXYGEN__)
|
#if EFI_EMULATE_POSITION_SENSORS || defined(__DOXYGEN__)
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "rpm")) {
|
} else if (strEqualCaseInsensitive(paramStr, "rpm")) {
|
||||||
setTriggerEmulatorRPM(valueI);
|
setTriggerEmulatorRPM(valueI);
|
||||||
#endif /* ! EFI_UNIT_TEST */
|
#endif /* EFI_EMULATE_POSITION_SENSORS */
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "vvt_offset")) {
|
} else if (strEqualCaseInsensitive(paramStr, "vvt_offset")) {
|
||||||
engineConfiguration->vvtOffset = valueF;
|
engineConfiguration->vvtOffset = valueF;
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "vvt_mode")) {
|
} else if (strEqualCaseInsensitive(paramStr, "vvt_mode")) {
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
|
||||||
#if EFI_BOARD_TEST
|
#if EFI_BOARD_TEST || defined(__DOXYGEN__)
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "board_test.h"
|
#include "board_test.h"
|
||||||
#include "pin_repository.h"
|
#include "pin_repository.h"
|
||||||
|
|
|
@ -278,7 +278,9 @@ void applyNewHardwareSettings(void) {
|
||||||
#if EFI_VEHICLE_SPEED || defined(__DOXYGEN__)
|
#if EFI_VEHICLE_SPEED || defined(__DOXYGEN__)
|
||||||
stopVSSPins();
|
stopVSSPins();
|
||||||
#endif /* EFI_VEHICLE_SPEED */
|
#endif /* EFI_VEHICLE_SPEED */
|
||||||
|
#if EFI_AUX_PID || defined(__DOXYGEN__)
|
||||||
stopAuxPins();
|
stopAuxPins();
|
||||||
|
#endif /* EFI_AUX_PID */
|
||||||
|
|
||||||
if (engineConfiguration->bc.is_enabled_spi_1 != activeConfiguration.bc.is_enabled_spi_1)
|
if (engineConfiguration->bc.is_enabled_spi_1 != activeConfiguration.bc.is_enabled_spi_1)
|
||||||
stopSpi(SPI_DEVICE_1);
|
stopSpi(SPI_DEVICE_1);
|
||||||
|
@ -316,7 +318,9 @@ void applyNewHardwareSettings(void) {
|
||||||
#if EFI_VEHICLE_SPEED || defined(__DOXYGEN__)
|
#if EFI_VEHICLE_SPEED || defined(__DOXYGEN__)
|
||||||
startVSSPins();
|
startVSSPins();
|
||||||
#endif /* EFI_VEHICLE_SPEED */
|
#endif /* EFI_VEHICLE_SPEED */
|
||||||
|
#if EFI_AUX_PID || defined(__DOXYGEN__)
|
||||||
startAuxPins();
|
startAuxPins();
|
||||||
|
#endif /* EFI_AUX_PID */
|
||||||
|
|
||||||
adcConfigListener(engine);
|
adcConfigListener(engine);
|
||||||
}
|
}
|
||||||
|
@ -419,10 +423,12 @@ void initHardware(Logging *l) {
|
||||||
initAdcInputs(isBoardTestMode_b);
|
initAdcInputs(isBoardTestMode_b);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if EFI_BOARD_TEST || defined(__DOXYGEN__)
|
||||||
if (isBoardTestMode_b) {
|
if (isBoardTestMode_b) {
|
||||||
// this method never returns
|
// this method never returns
|
||||||
initBoardTest();
|
initBoardTest();
|
||||||
}
|
}
|
||||||
|
#endif /* EFI_BOARD_TEST */
|
||||||
|
|
||||||
initRtc();
|
initRtc();
|
||||||
|
|
||||||
|
@ -513,9 +519,9 @@ void initHardware(Logging *l) {
|
||||||
cdmIonInit();
|
cdmIonInit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (HAL_USE_PAL && EFI_PROD_CODE) || defined(__DOXYGEN__)
|
#if (HAL_USE_PAL && EFI_JOYSTICK) || defined(__DOXYGEN__)
|
||||||
initJoystick(sharedLogger);
|
initJoystick(sharedLogger);
|
||||||
#endif /* HAL_USE_PAL && EFI_PROD_CODE */
|
#endif /* HAL_USE_PAL && EFI_JOYSTICK */
|
||||||
|
|
||||||
calcFastAdcIndexes();
|
calcFastAdcIndexes();
|
||||||
|
|
||||||
|
|
|
@ -168,12 +168,12 @@ static int getParameterCount(action_type_e parameterType) {
|
||||||
* @brief This function prints out a list of all available commands
|
* @brief This function prints out a list of all available commands
|
||||||
*/
|
*/
|
||||||
void helpCommand(void) {
|
void helpCommand(void) {
|
||||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
#if EFI_BOARD_TEST || defined(__DOXYGEN__)
|
||||||
if (isBoardTestMode()) {
|
if (isBoardTestMode()) {
|
||||||
printBoardTestState();
|
printBoardTestState();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_BOARD_TEST */
|
||||||
|
|
||||||
#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__)
|
#if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__)
|
||||||
scheduleMsg(logging, "%d actions available", consoleActionCount);
|
scheduleMsg(logging, "%d actions available", consoleActionCount);
|
||||||
|
|
Loading…
Reference in New Issue