mirror of https://github.com/rusefi/rusefi-1.git
evil manual merge of https://github.com/DonaldBecker/rusefi
This commit is contained in:
parent
4e19c96cb6
commit
8525c48036
|
@ -234,7 +234,7 @@ float LoadAccelEnrichment::getEngineLoadEnrichment(DECLARE_ENGINE_PARAMETER_SIGN
|
||||||
float taper = 0;
|
float taper = 0;
|
||||||
if (d > engineConfiguration->engineLoadAccelEnrichmentThreshold) {
|
if (d > engineConfiguration->engineLoadAccelEnrichmentThreshold) {
|
||||||
|
|
||||||
int distance = cb.currentIndex - index;
|
distance = cb.currentIndex - index;
|
||||||
if (distance <= 0) // checking if indexes are out of order due to circular buffer nature
|
if (distance <= 0) // checking if indexes are out of order due to circular buffer nature
|
||||||
distance += minI(cb.getCount(), cb.getSize());
|
distance += minI(cb.getCount(), cb.getSize());
|
||||||
|
|
||||||
|
|
|
@ -228,9 +228,11 @@ void setMap(fuel_table_t table, float value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static void setWholeVEMap(float value DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
static void setWholeVEMap(float value DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
||||||
setMap(config->veTable, value);
|
setMap(config->veTable, value);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void setWholeFuelMap(float value DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
void setWholeFuelMap(float value DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
||||||
setMap(config->fuelTable, value);
|
setMap(config->fuelTable, value);
|
||||||
|
@ -240,6 +242,8 @@ void setWholeIgnitionIatCorr(float value DECLARE_CONFIG_PARAMETER_SUFFIX) {
|
||||||
#if (IGN_LOAD_COUNT == FUEL_LOAD_COUNT) && (IGN_RPM_COUNT == FUEL_RPM_COUNT)
|
#if (IGN_LOAD_COUNT == FUEL_LOAD_COUNT) && (IGN_RPM_COUNT == FUEL_RPM_COUNT)
|
||||||
// todo: make setMap a template
|
// todo: make setMap a template
|
||||||
setMap(config->ignitionIatCorrTable, value);
|
setMap(config->ignitionIatCorrTable, value);
|
||||||
|
#else
|
||||||
|
UNUSED(value);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -426,7 +426,9 @@ bool PID_AutoTune::Runtime(Logging *logger)
|
||||||
}
|
}
|
||||||
avgInput /= (double)(inputCount + 1);
|
avgInput /= (double)(inputCount + 1);
|
||||||
|
|
||||||
|
#if defined(AUTOTUNE_DEBUG) || EFI_UNIT_TEST
|
||||||
bool stable = (iMax - iMin) <= 2.0 * workingNoiseBand;
|
bool stable = (iMax - iMin) <= 2.0 * workingNoiseBand;
|
||||||
|
#endif
|
||||||
#if defined (AUTOTUNE_DEBUG)
|
#if defined (AUTOTUNE_DEBUG)
|
||||||
Serial.print(F("iMax "));
|
Serial.print(F("iMax "));
|
||||||
Serial.println(iMax);
|
Serial.println(iMax);
|
||||||
|
|
|
@ -128,13 +128,13 @@ void fireSparkAndPrepareNextSchedule(IgnitionEvent *event) {
|
||||||
}
|
}
|
||||||
#if !EFI_UNIT_TEST
|
#if !EFI_UNIT_TEST
|
||||||
if (engineConfiguration->debugMode == DBG_DWELL_METRIC) {
|
if (engineConfiguration->debugMode == DBG_DWELL_METRIC) {
|
||||||
|
#if EFI_TUNER_STUDIO
|
||||||
uint32_t actualDwellDurationNt = getTimeNowLowerNt() - event->actualStartOfDwellNt;
|
uint32_t actualDwellDurationNt = getTimeNowLowerNt() - event->actualStartOfDwellNt;
|
||||||
/**
|
/**
|
||||||
* ratio of desired dwell duration to actual dwell duration gives us some idea of how good is input trigger jitter
|
* ratio of desired dwell duration to actual dwell duration gives us some idea of how good is input trigger jitter
|
||||||
*/
|
*/
|
||||||
float ratio = NT2US(actualDwellDurationNt) / 1000.0 / event->sparkDwell;
|
float ratio = NT2US(actualDwellDurationNt) / 1000.0 / event->sparkDwell;
|
||||||
|
|
||||||
#if EFI_TUNER_STUDIO
|
|
||||||
// todo: smarted solution for index to field mapping
|
// todo: smarted solution for index to field mapping
|
||||||
if (event->cylinderIndex == 0) {
|
if (event->cylinderIndex == 0) {
|
||||||
tsOutputChannels.debugFloatField1 = ratio;
|
tsOutputChannels.debugFloatField1 = ratio;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||||
|
Modified for RusEFI
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
@ -164,12 +165,12 @@ static const uint8_t vcom_string1[] = {
|
||||||
* Device Description string.
|
* Device Description string.
|
||||||
*/
|
*/
|
||||||
static const uint8_t vcom_string2[] = {
|
static const uint8_t vcom_string2[] = {
|
||||||
USB_DESC_BYTE(56), /* bLength. */
|
USB_DESC_BYTE(58), /* bLength. */
|
||||||
USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */
|
USB_DESC_BYTE(USB_DESCRIPTOR_STRING), /* bDescriptorType. */
|
||||||
'C', 0, 'h', 0, 'i', 0, 'b', 0, 'i', 0, 'O', 0, 'S', 0, '/', 0,
|
'R', 0, 'u', 0, 's', 0, 'E', 0, 'F', 0, 'I', 0, ' ', 0, 'E', 0,
|
||||||
'R', 0, 'T', 0, ' ', 0, 'V', 0, 'i', 0, 'r', 0, 't', 0, 'u', 0,
|
'n', 0, 'g', 0, 'i', 0, 'n', 0, 'e', 0, ' ', 0, 'M', 0, 'a', 0,
|
||||||
'a', 0, 'l', 0, ' ', 0, 'C', 0, 'O', 0, 'M', 0, ' ', 0, 'P', 0,
|
'n', 0, 'a', 0, 'g', 0, 'e', 0, 'm', 0, 'e', 0, 'n', 0, 't', 0,
|
||||||
'o', 0, 'r', 0, 't', 0
|
' ', 0, 'E', 0, 'C', 0, 'U', 0
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -44,7 +44,7 @@ void usb_serial_start(void) {
|
||||||
efiSetPadMode("USB DM", EFI_USB_SERIAL_DM, PAL_MODE_ALTERNATE(EFI_USB_AF));
|
efiSetPadMode("USB DM", EFI_USB_SERIAL_DM, PAL_MODE_ALTERNATE(EFI_USB_AF));
|
||||||
efiSetPadMode("USB DP", EFI_USB_SERIAL_DP, PAL_MODE_ALTERNATE(EFI_USB_AF));
|
efiSetPadMode("USB DP", EFI_USB_SERIAL_DP, PAL_MODE_ALTERNATE(EFI_USB_AF));
|
||||||
/*
|
/*
|
||||||
* Activates the serial driver 2 using the driver default configuration.
|
* Activates the serial driver using the driver default configuration.
|
||||||
*/
|
*/
|
||||||
sdStart(&USB_SERIAL_DRIVER, NULL);
|
sdStart(&USB_SERIAL_DRIVER, NULL);
|
||||||
#endif /* HAL_USE_SERIAL */
|
#endif /* HAL_USE_SERIAL */
|
||||||
|
|
Loading…
Reference in New Issue