diff --git a/firmware/config/engines/mazda_miata_vvt.cpp b/firmware/config/engines/mazda_miata_vvt.cpp index 5a60b0fac3..d37c2475d4 100644 --- a/firmware/config/engines/mazda_miata_vvt.cpp +++ b/firmware/config/engines/mazda_miata_vvt.cpp @@ -22,11 +22,11 @@ * coil1/4 (p1 +5 VP) PE14 * coil2/2 (p1 +5 VP) PC7 * - * tachometer +5 VP (p3 +5 VP) PE8 - * alternator +5 VP (p3 +5 VP) PE10 - * MIL check engine (p4 no VP) PD9 + * tachometer +5 VP (p3 +12 VP) PE8 + * alternator +5 VP (p3 +12 VP) PE10 * * VVT solenoid on aux PID#1 PE3 + * warning light PE6 * * */ @@ -218,7 +218,7 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { - engineConfiguration->dizzySparkOutputPin = GPIOE_8; + engineConfiguration->dizzySparkOutputPin = GPIOE_8; // tachometer // set global_trigger_offset_angle 0 engineConfiguration->globalTriggerAngleOffset = 0; @@ -229,7 +229,7 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { // set cranking_timing_angle 10 engineConfiguration->crankingTimingAngle = 10; // set cranking_fuel 4 - engineConfiguration->cranking.baseFuel = 4; + engineConfiguration->cranking.baseFuel = 4; // this value for return-less NB miata fuel system, higher pressure boardConfiguration->ignitionPins[0] = GPIOE_14; boardConfiguration->ignitionPins[1] = GPIO_UNASSIGNED; @@ -286,6 +286,8 @@ void setMazdaMiata2003EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->ignitionMode = IM_WASTED_SPARK; + boardConfiguration->malfunctionIndicatorPin = GPIOE_6; // just for a test + /** * http://miataturbo.wikidot.com/fuel-injectors * 01-05 (purple) - #195500-4060 @@ -319,4 +321,8 @@ void setMazdaMiata2003EngineConfigurationNewBoard(DECLARE_ENGINE_PARAMETER_F) { setEgoSensor(ES_14Point7_Free PASS_ENGINE_PARAMETER); + + // set cranking_fuel 8 + engineConfiguration->cranking.baseFuel = 8; // higher value for return system NA conversion since lower fuel pressure + } diff --git a/firmware/config/stm32f4ems/chconf.h b/firmware/config/stm32f4ems/chconf.h index 830248fa0f..70ac579a9b 100644 --- a/firmware/config/stm32f4ems/chconf.h +++ b/firmware/config/stm32f4ems/chconf.h @@ -547,6 +547,16 @@ void chDbgPanic3(const char *msg, const char * file, int line); #define hasFatalError() (FALSE) #endif + +#define chDbgAssert(c, remark) do { \ + if (CH_DBG_ENABLE_ASSERTS != FALSE) { \ + if (!(c)) { \ + /*lint -restore*/ \ + chSysHalt(remark); \ + } \ + } \ +} while (false) + #endif /* _CHCONF_H_ */ /** @} */ diff --git a/firmware/hw_layer/digital_input_hw.cpp b/firmware/hw_layer/digital_input_hw.cpp index 3406d8e909..bd0b2ed4f2 100644 --- a/firmware/hw_layer/digital_input_hw.cpp +++ b/firmware/hw_layer/digital_input_hw.cpp @@ -211,6 +211,8 @@ void startInputDriver(digital_input_s *hw, bool isActiveHigh) { } wave_icucfg.channel = getInputCaptureChannel(hw->brainPin); efiIcuStart(driver, &wave_icucfg); + efiAssertVoid(driver != NULL, "di: driver is NULL"); + efiAssertVoid(driver->state == ICU_READY, "di: driver not ready"); icuStartCapture(driver); // this would change state from READY to WAITING icuEnableNotifications(driver); } diff --git a/firmware/hw_layer/trigger_input.cpp b/firmware/hw_layer/trigger_input.cpp index 04e8835ae2..95d89732f7 100644 --- a/firmware/hw_layer/trigger_input.cpp +++ b/firmware/hw_layer/trigger_input.cpp @@ -123,6 +123,8 @@ static ICUDriver *turnOnTriggerInputPin(const char *msg, brain_pin_e hwPin, ICUC efiIcuStart(driver, icucfg); if (driver->state == ICU_READY) { + efiAssert(driver != NULL, "ti: driver is NULL", NULL); + efiAssert(driver->state == ICU_READY, "ti: driver not ready", NULL); icuStartCapture(driver); // this would change state from READY to WAITING icuEnableNotifications(driver); } else { diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 763da20926..6a79593967 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 20170424; + return 20170426; }