diff --git a/README.md b/README.md index 036f88fd58..1166f48420 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,16 @@ current binaries are always available at http://rusefi.com/build_server/ +[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6YSSN35GWYS3A) +[![Tindie](http://rusefi.com/wiki/images/1/1c/Tindie-smalls.png)](https://www.tindie.com/stores/russian/) + #Releases | Release date | Revision | Details | | ------------ | --------- | ------- | +| 05/05/2017 | r13974 | bugfix #404: 36/1 FATAL error: angle range trgSync | +| 05/03/2017 | r13967 | improvement: ChibiOS 3.2 | | 04/06/2017 | r13759 | major improvement #72: ChibiOS 3.1 | | 03/26/2017 | r13330 | super annoying bug #336 fixed | | 03/20/2017 | r13233 | improvements #375 & #376: hard FPU mode & migrating to fresh version of arm gcc | diff --git a/firmware/ChibiOS-Contrib b/firmware/ChibiOS-Contrib index 97aaabeedd..fa9b5ac5ae 160000 --- a/firmware/ChibiOS-Contrib +++ b/firmware/ChibiOS-Contrib @@ -1 +1 @@ -Subproject commit 97aaabeedd53ec16147696f8b44b16ee43d86a99 +Subproject commit fa9b5ac5ae2f6df6b0b861547260fddde3b37830 diff --git a/firmware/ChibiOS3 b/firmware/ChibiOS3 index a7e847a894..0f416078cc 160000 --- a/firmware/ChibiOS3 +++ b/firmware/ChibiOS3 @@ -1 +1 @@ -Subproject commit a7e847a894dbc8d15e178d63cba1e71d043c3fdf +Subproject commit 0f416078cc00c1bb1be55453adc8dcdc9bb1baf4 diff --git a/firmware/Makefile b/firmware/Makefile index 1a8ec69c54..5b220d9ad7 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -176,6 +176,7 @@ CPPSRC = $(CHCPPSRC) \ $(DEV_SRC_CPP) \ $(CONTROLLERS_ALGO_SRC_CPP) \ $(SYSTEMSRC_CPP) \ + $(BOARDSRC_CPP) \ $(ENGINES_SRC_CPP) \ $(HW_LAYER_EMS_CPP) \ $(HW_SENSORS_SRC) \ diff --git a/firmware/compile_and_program.bat b/firmware/compile_and_program.bat index 1d954020f5..c8481be98a 100644 --- a/firmware/compile_and_program.bat +++ b/firmware/compile_and_program.bat @@ -13,8 +13,8 @@ rem magic once needed call update_version.bat echo Starting compilation -rem the important piece -make +rem the important piece (pass external args if needed) +make %1 %2 %3 rem cd build rem if not exist rusefi.hex echo "compilation failed" diff --git a/firmware/config/boards/ST_STM32F4/board.h b/firmware/config/boards/ST_STM32F4/board.h index abff6dfcad..96b9532001 100644 --- a/firmware/config/boards/ST_STM32F4/board.h +++ b/firmware/config/boards/ST_STM32F4/board.h @@ -57,7 +57,9 @@ * * See also STM32F4xx_MCUCONF is defined in mcuconf.h */ +#ifndef STM32F407xx #define STM32F407xx +#endif /* * IO pins assignments. diff --git a/firmware/config/boards/ST_STM32F4/board.mk b/firmware/config/boards/ST_STM32F4/board.mk index 25db37f4ac..cd52bf6250 100644 --- a/firmware/config/boards/ST_STM32F4/board.mk +++ b/firmware/config/boards/ST_STM32F4/board.mk @@ -1,5 +1,9 @@ # List of all the board related files. BOARDSRC = $(PROJECT_DIR)/config/boards/ST_STM32F4/board.c +BOARDSRC_CPP = # Required include directories BOARDINC = $(PROJECT_DIR)/config/boards/ST_STM32F4 + +# MCU defines +DDEFS += -DSTM32F407xx diff --git a/firmware/config/engines/mazda_miata_vvt.cpp b/firmware/config/engines/mazda_miata_vvt.cpp index e6329d3004..8e4673dbf1 100644 --- a/firmware/config/engines/mazda_miata_vvt.cpp +++ b/firmware/config/engines/mazda_miata_vvt.cpp @@ -180,7 +180,7 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { boardConfiguration->alternatorControlPin = GPIOE_10; boardConfiguration->alternatorControlPinMode = OM_OPENDRAIN; -// boardConfiguration->vehicleSpeedSensorInputPin = GPIOA_8; // https://github.com/rusefi/rusefi/issues/401 + boardConfiguration->vehicleSpeedSensorInputPin = GPIOA_8; // enable altdebug engineConfiguration->targetVBatt = 13.8; diff --git a/firmware/config/engines/rover_v8.cpp b/firmware/config/engines/rover_v8.cpp index a3f378e4ec..e6fbcc5782 100644 --- a/firmware/config/engines/rover_v8.cpp +++ b/firmware/config/engines/rover_v8.cpp @@ -31,8 +31,11 @@ EXTERN_ENGINE; void setRoverv8(DECLARE_ENGINE_PARAMETER_F) { setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR); + // set trigger_type 9 engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_36_1; + boardConfiguration->is_enabled_spi_2 = false; + boardConfiguration->isHip9011Enabled = false; setFrankenstein_01_LCD(boardConfiguration); engineConfiguration->specs.displacement = 3.528; @@ -114,12 +117,12 @@ void setRoverv8(DECLARE_ENGINE_PARAMETER_F) { /* Stepper logic: boardConfiguration->idle.stepperDirectionPin = GPIOE_10; - boardConfiguration->idle.stepperStepPin = GPIOE_12; - engineConfiguration->stepperEnablePin = GPIOE_14; + boardConfiguration->idle.stepperStepPin = GPIOE_12; // todo: set pin which would not conflict with coils + engineConfiguration->stepperEnablePin = GPIOE_14; // todo: set pin which would not conflict with coils engineConfiguration->idleStepperReactionTime = 10; engineConfiguration->idleStepperTotalSteps = 150; */ - boardConfiguration->useStepperIdle = true; + boardConfiguration->useStepperIdle = false; // set injection_pin_mode 0 boardConfiguration->injectionPinMode = OM_DEFAULT; diff --git a/firmware/config/stm32f0egt/efifeatures.h b/firmware/config/stm32f0egt/efifeatures.h index 2d927ff73d..67feff44f0 100644 --- a/firmware/config/stm32f0egt/efifeatures.h +++ b/firmware/config/stm32f0egt/efifeatures.h @@ -18,6 +18,8 @@ #define EFI_CONSOLE_UART_DEVICE (&SD1) +#define TS_SERIAL_UART_DEVICE (&SD3) + #define EFI_CONSOLE_TX_PORT GPIOC #define EFI_CONSOLE_TX_PIN 10 #define EFI_CONSOLE_RX_PORT GPIOC diff --git a/firmware/config/stm32f4ems/efifeatures.h b/firmware/config/stm32f4ems/efifeatures.h index de0b8e5777..59af3a0736 100644 --- a/firmware/config/stm32f4ems/efifeatures.h +++ b/firmware/config/stm32f4ems/efifeatures.h @@ -243,6 +243,10 @@ #define EFI_CONSOLE_UART_DEVICE (&SD3) #endif +#ifndef TS_SERIAL_UART_DEVICE +#define TS_SERIAL_UART_DEVICE (&SD3) +#endif + // todo: start using consoleSerialTxPin? Not sure #ifndef EFI_CONSOLE_TX_PORT #define EFI_CONSOLE_TX_PORT GPIOC diff --git a/firmware/config/stm32f4ems/halconf_community.h b/firmware/config/stm32f4ems/halconf_community.h index 723221ac20..3180c6dcbf 100644 --- a/firmware/config/stm32f4ems/halconf_community.h +++ b/firmware/config/stm32f4ems/halconf_community.h @@ -130,8 +130,6 @@ #define EEPROM_USE_EE25XX TRUE -#define rccEnableCRC(lp) rccEnableAHB(RCC_AHBENR_CRCEN, lp) -#define rccDisableCRC(lp) rccDisableAHB(RCC_AHBENR_CRCEN, lp) /*===========================================================================*/ /* CRC driver settings. */ diff --git a/firmware/console/binary/tunerstudio_io.cpp b/firmware/console/binary/tunerstudio_io.cpp index 380305f87a..de76cf5678 100644 --- a/firmware/console/binary/tunerstudio_io.cpp +++ b/firmware/console/binary/tunerstudio_io.cpp @@ -21,10 +21,13 @@ extern LoggingWithStorage tsLogger; #include "pin_repository.h" #include "usbconsole.h" #include "map_averaging.h" + +#if HAL_USE_SERIAL_USB || defined(__DOXYGEN__) extern SerialUSBDriver SDU1; #define CONSOLE_DEVICE &SDU1 - -#define TS_SERIAL_UART_DEVICE &SD3 +#else +#define CONSOLE_DEVICE TS_SERIAL_UART_DEVICE +#endif static SerialConfig tsSerialConfig = { 0, 0, USART_CR2_STOP1_BITS | USART_CR2_LINEN, 0 }; @@ -56,10 +59,13 @@ void startTsPort(void) { BaseChannel * getTsSerialDevice(void) { #if EFI_PROD_CODE || defined(__DOXYGEN__) +#if EFI_USB_SERIAL || defined(__DOXYGEN__) if (isCommandLineConsoleOverTTL()) { // if console uses UART then TS uses USB - return (BaseChannel *) &SDU1; - } else { + return (BaseChannel *) CONSOLE_DEVICE; + } else +#endif + { return (BaseChannel *) TS_SERIAL_UART_DEVICE; } #else diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 8d144015c0..2ee685b6ee 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -97,7 +97,8 @@ static void setWarningEnabled(int value) { } #if EFI_FILE_LOGGING || defined(__DOXYGEN__) -static char FILE_LOGGER[1000] CCM_OPTIONAL; +// this one needs to be in main ram so that SD card SPI DMA works fine +static char FILE_LOGGER[1000] MAIN_RAM; static Logging fileLogger("file logger", FILE_LOGGER, sizeof(FILE_LOGGER)); #endif /* EFI_FILE_LOGGING */ @@ -748,7 +749,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->debugFloatField1 = getVoltage("fsio", engineConfiguration->fsioAdc[0]); } } else if (engineConfiguration->debugMode == DBG_VEHICLE_SPEED_SENSOR) { - tsOutputChannels->debugIntField1 = engine->engineState.vssCounter; + tsOutputChannels->debugIntField1 = engine->engineState.vssDebugEventCounter; } else if (engineConfiguration->debugMode == DBG_SD_CARD) { tsOutputChannels->debugIntField1 = engine->engineState.totalLoggedBytes; } else if (engineConfiguration->debugMode == DBG_CRANKING_DETAILS) { diff --git a/firmware/controllers/algo/aux_pid.cpp b/firmware/controllers/algo/aux_pid.cpp index 4e17b9301e..eabb9426c2 100644 --- a/firmware/controllers/algo/aux_pid.cpp +++ b/firmware/controllers/algo/aux_pid.cpp @@ -16,6 +16,7 @@ #include "tunerstudio_configuration.h" #include "fsio_impl.h" #include "engine_math.h" +#include "pin_repository.h" EXTERN_ENGINE ; @@ -119,15 +120,25 @@ static void turnAuxPidOn(int index) { engineConfiguration->auxPidFrequency[index], 0.1, applyPinState); } +void startAuxPins(void) { + for (int i = 0;i cj125ua = EFI_ADC_NONE; engineConfiguration->cj125ur = EFI_ADC_NONE; - boardConfiguration->idle.stepperDirectionPin = GPIO_UNASSIGNED; - boardConfiguration->idle.stepperStepPin = GPIO_UNASSIGNED; - engineConfiguration->stepperEnablePin = GPIO_UNASSIGNED; - boardConfiguration->idle.stepperDirectionPin = GPIO_UNASSIGNED; boardConfiguration->idle.stepperStepPin = GPIO_UNASSIGNED; engineConfiguration->stepperEnablePin = GPIO_UNASSIGNED; diff --git a/firmware/controllers/algo/obd_error_codes.h b/firmware/controllers/algo/obd_error_codes.h index b8125fc129..a09b02e331 100644 --- a/firmware/controllers/algo/obd_error_codes.h +++ b/firmware/controllers/algo/obd_error_codes.h @@ -1838,11 +1838,11 @@ typedef enum { CUSTOM_ERR_PIN_ALREADY_USED_2 = 6134, CUSTOM_ERR_ICU_STATE = 6135, CUSTOM_ERR_TCHARGE_NOT_READY = 6136, - CUSTOM_ERR_6137 = 6137, + CUSTOM_ERR_TRIGGER_SHAPE_TOO_LONG = 6137, CUSTOM_ERR_FUEL_TABLE_NOT_READY = 6138, CUSTOM_ERR_TCHARGE_NOT_READY2 = 6139, - CUSTOM_ERR_6140 = 6140, + CUSTOM_ERR_COMMAND_LOWER_CASE_EXPECTED = 6140, CUSTOM_ERR_FLASH_CRC_FAILED = 6141, CUSTOM_ERR_NOT_INPUT_PIN = 6142, CUSTOM_ERR_SKIPPED_TOOTH_SHAPE = 6143, diff --git a/firmware/controllers/injector_central.cpp b/firmware/controllers/injector_central.cpp index 392a64fed8..1ab40cc700 100644 --- a/firmware/controllers/injector_central.cpp +++ b/firmware/controllers/injector_central.cpp @@ -296,6 +296,7 @@ void runIoTest(int subsystem, int index) { } else if (subsystem == 0x16) { milBench(); } else if (subsystem == 0x17) { + } else if (subsystem == 0x20 && index == 0x3456) { } } diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index 047f0fdce6..77c5f042fe 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -438,6 +438,10 @@ static void printTemperatureInfo(void) { #endif /* EFI_ANALOG_SENSORS */ } +static void setCallFromPitStop(int durationMs) { + engine->callFromPitStopEndTime = currentTimeMillis() + durationMs; +} + static void setCrankingRpm(int value) { engineConfiguration->cranking.rpm = value; doPrintConfiguration(engine); @@ -1024,6 +1028,7 @@ static void setTpsErrorDetectionTooHigh(int v) { } command_i_s commandsI[] = {{"ignition_mode", setIgnitionMode}, + {"call_from_pitstop", setCallFromPitStop}, {"cranking_rpm", setCrankingRpm}, {"cranking_injection_mode", setCrankingInjectionMode}, {"injection_mode", setInjectionMode}, diff --git a/firmware/controllers/trigger/trigger_structure.cpp b/firmware/controllers/trigger/trigger_structure.cpp index fc28b49e67..39113a1242 100644 --- a/firmware/controllers/trigger/trigger_structure.cpp +++ b/firmware/controllers/trigger/trigger_structure.cpp @@ -50,13 +50,21 @@ void TriggerShape::calculateTriggerSynchPoint(TriggerState *state DECLARE_ENGINE triggerShapeSynchPointIndex = findTriggerZeroEventIndex(state, this, triggerConfig PASS_ENGINE_PARAMETER); - engine->engineCycleEventCount = getLength(); + int length = getLength(); + engine->engineCycleEventCount = length; + efiAssertVoid(length > 0, "shapeLength=0"); + if (length >= PWM_PHASE_MAX_COUNT) { + warning(CUSTOM_ERR_TRIGGER_SHAPE_TOO_LONG, "Count above %d", length); + shapeDefinitionError = true; + return; + } float firstAngle = getAngle(triggerShapeSynchPointIndex); + assertAngleRange(triggerShapeSynchPointIndex, "firstAngle"); int frontOnlyIndex = 0; - for (int eventIndex = 0; eventIndex < engine->engineCycleEventCount; eventIndex++) { + for (int eventIndex = 0; eventIndex < length; eventIndex++) { if (eventIndex == 0) { // explicit check for zero to avoid issues where logical zero is not exactly zero due to float nature eventAngles[0] = 0; @@ -64,6 +72,7 @@ void TriggerShape::calculateTriggerSynchPoint(TriggerState *state DECLARE_ENGINE eventAngles[1] = 0; frontOnlyIndexes[0] = 0; } else { + assertAngleRange(triggerShapeSynchPointIndex, "triggerShapeSynchPointIndex"); int triggerDefinitionCoordinate = (triggerShapeSynchPointIndex + eventIndex) % engine->engineCycleEventCount; efiAssertVoid(engine->engineCycleEventCount != 0, "zero engineCycleEventCount"); int triggerDefinitionIndex = triggerDefinitionCoordinate >= size ? triggerDefinitionCoordinate - size : triggerDefinitionCoordinate; @@ -260,7 +269,7 @@ angle_t TriggerShape::getAngle(int index) const { * See also trigger_central.cpp * See also getEngineCycleEventCount() */ - + efiAssert(size != 0, "shapeSize=0", NAN); int crankCycle = index / size; int remainder = index % size; diff --git a/firmware/development/sensor_chart.cpp b/firmware/development/sensor_chart.cpp index 33a43ee480..310902f0a4 100644 --- a/firmware/development/sensor_chart.cpp +++ b/firmware/development/sensor_chart.cpp @@ -13,7 +13,7 @@ #if EFI_SENSOR_CHART || defined(__DOXYGEN__) #include "status_loop.h" -static char LOGGING_BUFFER[5000]; +static char LOGGING_BUFFER[5000] CCM_OPTIONAL; static Logging logging("analog chart", LOGGING_BUFFER, sizeof(LOGGING_BUFFER)); static int pendingData = false; diff --git a/firmware/global.h b/firmware/global.h index ef43013675..edfbb5b31a 100644 --- a/firmware/global.h +++ b/firmware/global.h @@ -57,6 +57,15 @@ typedef unsigned int time_t; #define EFI_ERROR_CODE 0xffffffff +#if EFI_USE_CCM && defined __GNUC__ +#define MAIN_RAM __attribute__((section(".ram0"))) +#elif defined __GNUC__ +#define MAIN_RAM +#else +#define MAIN_RAM @ ".ram0" +#endif + + #if EFI_USE_CCM && defined __GNUC__ #define CCM_OPTIONAL __attribute__((section(".ram4"))) #elif defined __GNUC__ diff --git a/firmware/hw_layer/can_hw.cpp b/firmware/hw_layer/can_hw.cpp index ac3be61804..1511893767 100644 --- a/firmware/hw_layer/can_hw.cpp +++ b/firmware/hw_layer/can_hw.cpp @@ -131,7 +131,6 @@ static void canMazdaRX8(void) { commonTxInit(CAN_MAZDA_RX_RPM_SPEED); -#if EFI_VEHICLE_SPEED || defined(__DOXYGEN__) float kph = getVehicleSpeed(); setShortValue(&txmsg, SWAP_UINT16(getRpmE(engine) * 4), 0); @@ -139,7 +138,6 @@ static void canMazdaRX8(void) { setShortValue(&txmsg, SWAP_UINT16((int )(100 * kph + 10000)), 4); setShortValue(&txmsg, 0, 6); sendMessage(); -#endif /* EFI_VEHICLE_SPEED */ commonTxInit(CAN_MAZDA_RX_STATUS_2); txmsg.data8[0] = 0xFE; //Unknown @@ -152,13 +150,20 @@ static void canMazdaRX8(void) { txmsg.data8[7] = 0x00; // Unused commonTxInit(CAN_MAZDA_RX_STATUS_2); - txmsg.data8[0] = 0x98; //temp gauge //~170 is red, ~165 last bar, 152 centre, 90 first bar, 92 second bar + txmsg.data8[0] = (char)(engine->sensors.clt + 62); //temp gauge //~170 is red, ~165 last bar, 152 centre, 90 first bar, 92 second bar txmsg.data8[1] = 0x00; // something to do with trip meter 0x10, 0x11, 0x17 increments by 0.1 miles txmsg.data8[2] = 0x00; // unknown txmsg.data8[3] = 0x00; //unknown txmsg.data8[4] = 0x01; //Oil Pressure (not really a gauge) txmsg.data8[5] = 0x00; //check engine light txmsg.data8[6] = 0x00; //Coolant, oil and battery + if ((getRpmE(engine)>0) && (engine->sensors.vBatt<13)) { + setTxBit(6, 6); // battery light + } + if (engine->sensors.clt > 98) { + setTxBit(6, 1); // coolant light + } + //oil pressure warning lamp bit is 7 txmsg.data8[7] = 0x00; //unused sendMessage(); } diff --git a/firmware/hw_layer/digital_input_hw.cpp b/firmware/hw_layer/digital_input_hw.cpp index bd0b2ed4f2..e611c2a4f0 100644 --- a/firmware/hw_layer/digital_input_hw.cpp +++ b/firmware/hw_layer/digital_input_hw.cpp @@ -189,12 +189,37 @@ digital_input_s * initWaveAnalyzerDriver(const char *msg, brain_pin_e brainPin) digital_input_s *hw = registeredIcus.add(); hw->widthListeners.clear(); hw->periodListeners.clear(); + hw->started = false; hw->brainPin = brainPin; hw->driver = driver; turnOnCapturePin(msg, brainPin); return hw; } +void stopWaveAnalyzerDriver(const char *msg, brain_pin_e brainPin) { + if (brainPin == GPIO_UNASSIGNED) { + return; + } + unmarkPin(brainPin); + + ICUDriver *driver = getInputCaptureDriver(msg, brainPin); + if (driver == NULL) { + return; + } + int regSize = registeredIcus.size; + for (int i = 0; i < regSize; i++) { + if (registeredIcus.elements[i].driver == driver) { + // removing from driver from the list of used drivers + memcpy(®isteredIcus.elements[i], ®isteredIcus.elements[regSize - 1], + sizeof(digital_input_s)); + registeredIcus.size--; + icuDisableNotificationsI(driver); + icuStop(driver); + return; + } + } +} + void startInputDriver(digital_input_s *hw, bool isActiveHigh) { hw->isActiveHigh = isActiveHigh; if (hw->isActiveHigh) { diff --git a/firmware/hw_layer/digital_input_hw.h b/firmware/hw_layer/digital_input_hw.h index 6411ac8ad6..af70656293 100644 --- a/firmware/hw_layer/digital_input_hw.h +++ b/firmware/hw_layer/digital_input_hw.h @@ -28,6 +28,7 @@ digital_input_s *initWaveAnalyzerDriver(const char *msg, brain_pin_e brainPin); void startInputDriver(digital_input_s *hw, bool isActiveHigh); ICUDriver * getInputCaptureDriver(const char *msg, brain_pin_e hwPin); icuchannel_t getInputCaptureChannel(brain_pin_e hwPin); +void stopWaveAnalyzerDriver(const char *msg, brain_pin_e brainPin); #endif diff --git a/firmware/hw_layer/hardware.cpp b/firmware/hw_layer/hardware.cpp index 93a1221097..e75a28ddb3 100644 --- a/firmware/hw_layer/hardware.cpp +++ b/firmware/hw_layer/hardware.cpp @@ -40,7 +40,8 @@ #include "svnversion.h" #include "engine_configuration.h" #include "CJ125.h" -#endif +#include "aux_pid.h" +#endif /* EFI_PROD_CODE */ #if EFI_SPEED_DENSITY #include "map_averaging.h" @@ -230,6 +231,7 @@ void applyNewHardwareSettings(void) { stopCanPins(); stopETBPins(); stopVSSPins(); + stopAuxPins(); if (engineConfiguration->bc.is_enabled_spi_1 != activeConfiguration.bc.is_enabled_spi_1) stopSpi(SPI_DEVICE_1); @@ -288,6 +290,7 @@ void applyNewHardwareSettings(void) { startCanPins(); startETBPins(); startVSSPins(); + startAuxPins(); adcConfigListener(engine); } @@ -371,14 +374,17 @@ void initHardware(Logging *l) { initTriggerDecoder(); #endif - mySetPadMode2("board test", boardConfiguration->boardTestModeJumperPin, - PAL_MODE_INPUT_PULLUP); - bool isBoardTestMode_b = (!palReadPad(getHwPort(boardConfiguration->boardTestModeJumperPin), getHwPin(boardConfiguration->boardTestModeJumperPin))); - - // we can now relese this pin, it is actually used as output sometimes - unmarkPin(boardConfiguration->boardTestModeJumperPin); - + bool isBoardTestMode_b; + if (boardConfiguration->boardTestModeJumperPin != GPIO_UNASSIGNED) { + mySetPadMode2("board test", boardConfiguration->boardTestModeJumperPin, + PAL_MODE_INPUT_PULLUP); + isBoardTestMode_b = (!palReadPad(getHwPort(boardConfiguration->boardTestModeJumperPin), getHwPin(boardConfiguration->boardTestModeJumperPin))); + // we can now relese this pin, it is actually used as output sometimes + unmarkPin(boardConfiguration->boardTestModeJumperPin); + } else { + isBoardTestMode_b = false; + } #if HAL_USE_ADC || defined(__DOXYGEN__) initAdcInputs(isBoardTestMode_b); diff --git a/firmware/hw_layer/joystick.cpp b/firmware/hw_layer/joystick.cpp index ab9322ac5c..352b7a1445 100644 --- a/firmware/hw_layer/joystick.cpp +++ b/firmware/hw_layer/joystick.cpp @@ -58,6 +58,8 @@ static void extCallback(EXTDriver *extp, expchannel_t channel) { } #if EFI_HD44780_LCD || defined(__DOXYGEN__) onJoystick(button); +#else + UNUSED(button); #endif } diff --git a/firmware/hw_layer/rtc_helper.cpp b/firmware/hw_layer/rtc_helper.cpp index 87355e5679..99a0839ad6 100644 --- a/firmware/hw_layer/rtc_helper.cpp +++ b/firmware/hw_layer/rtc_helper.cpp @@ -41,6 +41,8 @@ static time_t GetTimeUnixSec(void) { rtcGetTime(&RTCD1, ×pec); rtcConvertDateTimeToStructTm(×pec, &tim, NULL); return mktime(&tim); +#else + return (time_t)0; #endif } diff --git a/firmware/hw_layer/stm32f4/stm32f4xx_hal_flash.c b/firmware/hw_layer/stm32f4/stm32f4xx_hal_flash.c index cbf1661834..bd2b159f58 100644 --- a/firmware/hw_layer/stm32f4/stm32f4xx_hal_flash.c +++ b/firmware/hw_layer/stm32f4/stm32f4xx_hal_flash.c @@ -93,8 +93,9 @@ */ /* Includes ------------------------------------------------------------------*/ -#define STM32F407xx +#ifdef STM32F407xx #define STM32F40_41xxx +#endif #define assert_param(expr) ((void)0) //#include "stm32f4xx_hal.h" diff --git a/firmware/hw_layer/stm32f4/stm32f4xx_hal_flash_ex.c b/firmware/hw_layer/stm32f4/stm32f4xx_hal_flash_ex.c index 5857b76f68..9a53d9324d 100644 --- a/firmware/hw_layer/stm32f4/stm32f4xx_hal_flash_ex.c +++ b/firmware/hw_layer/stm32f4/stm32f4xx_hal_flash_ex.c @@ -80,8 +80,9 @@ /* Includes ------------------------------------------------------------------*/ -#define STM32F407xx +#ifdef STM32F407xx #define STM32F40_41xxx +#endif #define assert_param(expr) ((void)0) #define HAL_FLASH_MODULE_ENABLED diff --git a/firmware/hw_layer/vehicle_speed.cpp b/firmware/hw_layer/vehicle_speed.cpp index 03fd1f3bec..813a75894a 100644 --- a/firmware/hw_layer/vehicle_speed.cpp +++ b/firmware/hw_layer/vehicle_speed.cpp @@ -44,7 +44,7 @@ float getVehicleSpeed(void) { } static void vsAnaWidthCallback(void) { - engine->engineState.vssCounter++; + engine->engineState.vssDebugEventCounter++; efitick_t nowNt = getTimeNowNt(); vssDiff = nowNt - lastSignalTimeNt; lastSignalTimeNt = nowNt; @@ -56,7 +56,7 @@ static void speedInfo(void) { scheduleMsg(logger, "c=%f eventCounter=%d speed=%f", engineConfiguration->vehicleSpeedCoef, - engine->engineState.vssCounter, + engine->engineState.vssDebugEventCounter, getVehicleSpeed()); scheduleMsg(logger, "vss diff %d", vssDiff); @@ -67,8 +67,7 @@ bool hasVehicleSpeedSensor() { } void stopVSSPins(void) { - unmarkPin(activeConfiguration.bc.vehicleSpeedSensorInputPin); - // todo: remove driver from registeredIcus + stopWaveAnalyzerDriver("VSS", activeConfiguration.bc.vehicleSpeedSensorInputPin); } void startVSSPins(void) { @@ -85,5 +84,10 @@ void initVehicleSpeed(Logging *l) { vehicleSpeedInput->widthListeners.registerCallback((VoidInt) vsAnaWidthCallback, NULL); } +#else /* EFI_VEHICLE_SPEED */ +float getVehicleSpeed(void) { + // no VSS support + return 0; +} #endif /* EFI_VEHICLE_SPEED */ diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index c7db2863fb..d52ee26e26 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -251,5 +251,5 @@ int getRusEfiVersion(void) { return 123; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE[0] * 0 != 0) return 3211; // this is here to make the compiler happy about the unused array - return 20170501; + return 20170505; } diff --git a/firmware/svnversion.h b/firmware/svnversion.h index 9d3c30f097..6e9abd8caa 100644 --- a/firmware/svnversion.h +++ b/firmware/svnversion.h @@ -1,5 +1,5 @@ // This file was generated by Version2Header -// Sat Apr 22 01:25:51 EEST 2017 +// Sat May 06 08:17:42 EDT 2017 #ifndef VCS_VERSION -#define VCS_VERSION "13886" +#define VCS_VERSION "13989" #endif diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 3152733aaf..0a3188b458 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -764,6 +764,10 @@ fileVersion = { 20161225 } ; and may create error messages. ; It is expected that these commands would not typically alter any ram mapped to a Constant. +; +; see TS_IO_TEST_COMMAND in firmware code +; + cmd_test_spk1 = "w\x00\x12\x00\x01" cmd_test_spk2 = "w\x00\x12\x00\x02" cmd_test_spk3 = "w\x00\x12\x00\x03" @@ -803,6 +807,7 @@ cmd_test_fuel_pump = "w\x00\x14\x00\x01" cmd_test_radiator_fan = "w\x00\x15\x00\x01" cmd_test_check_engine_light = "w\x00\x16\x00\x01" cmd_test_idle_valve = "w\x00\x17\x00\x01" +cmd_call_from_pit = "w\x00\x20\x34\x56" [UserDefined] @@ -1601,11 +1606,13 @@ cmd_test_idle_valve = "w\x00\x17\x00\x01" commandButton = "Injector #8", cmd_test_inj8 dialog = testMisc, "Misc" + commandButton = "Come To Pit", cmd_call_from_pit commandButton = "Fuel Pump", cmd_test_fuel_pump commandButton = "Radiator Fan", cmd_test_radiator_fan commandButton = "Check Engine", cmd_test_check_engine_light commandButton = "Idle Air Valve", cmd_test_idle_valve + ; bench test dialog = ioTest, "I-O Test", border panel = testSpark, West panel = testInjectors, Center diff --git a/firmware/util/cli_registry.cpp b/firmware/util/cli_registry.cpp index afd6ea8c2f..222615ebde 100644 --- a/firmware/util/cli_registry.cpp +++ b/firmware/util/cli_registry.cpp @@ -50,7 +50,7 @@ static void doAddAction(const char *token, action_type_e type, Void callback, vo for (int i = 0; i< efiStrlen(token);i++) { char ch = token[i]; if (ch != mytolower(ch)) { - firmwareError(CUSTOM_ERR_6140, "lowerCase expected [%s]", token); + firmwareError(CUSTOM_ERR_COMMAND_LOWER_CASE_EXPECTED, "lowerCase expected [%s]", token); } } current->token = token; diff --git a/java_console/autotest/src/com/rusefi/AutoTest.java b/java_console/autotest/src/com/rusefi/AutoTest.java index 83a9e37fcd..da59348a53 100644 --- a/java_console/autotest/src/com/rusefi/AutoTest.java +++ b/java_console/autotest/src/com/rusefi/AutoTest.java @@ -47,6 +47,7 @@ public class AutoTest { // todo? sleep(10); // time to reboot testBmwE34(); testSachs(); + testRoverV8(); testMitsu(); testCamaro(); testCitroenBerlingo(); @@ -266,6 +267,10 @@ public class AutoTest { assertWaveFall(msg, chart, EngineChart.INJECTOR_4, 0.493, x + 540); } + private static void testRoverV8() { + setEngineType(10); + } + private static void testFordFiesta() { setEngineType(4); EngineChart chart; diff --git a/misc/git_cheat_sheet.txt b/misc/git_cheat_sheet.txt index 080d1c7807..903304d627 100644 --- a/misc/git_cheat_sheet.txt +++ b/misc/git_cheat_sheet.txt @@ -21,3 +21,22 @@ git submodule update --init Refresh submodules: git submodule update --recursive --remote + +========================================= + +Generate diff of specific commit + + git diff COMMIT^ COMMIT +(this generates diff between previous to COMMIT and COMMIT) +========================================= + +https://help.github.com/articles/configuring-a-remote-for-a-fork/ + +git remote -v +git remote add upstream https://github.com/ChibiOS/ChibiOS.git +git remote -v + +========================================= +https://help.github.com/articles/syncing-a-fork/ + +