diff --git a/firmware/controllers/lcd_controller.cpp b/firmware/controllers/lcd_controller.cpp index 04830f2d44..165677ef66 100644 --- a/firmware/controllers/lcd_controller.cpp +++ b/firmware/controllers/lcd_controller.cpp @@ -224,6 +224,7 @@ static void showLine(lcd_line_e line) { case LL_VBATT: lcdPrintf("Battery %fv", getVBatt(engineConfiguration)); return; +#if EFI_ANALOG_SENSORS || defined(__DOXYGEN__) case LL_BARO: if (engineConfiguration->hasBaroSensor) { lcdPrintf("Baro: %f", getBaroPressure()); @@ -231,6 +232,7 @@ static void showLine(lcd_line_e line) { lcdPrintf("Baro: none"); } return; +#endif case LL_AFR: if (engineConfiguration->hasAfrSensor) { lcdPrintf("AFR: %f", getAfr()); @@ -265,6 +267,8 @@ static void showLine(lcd_line_e line) { case LL_TRIGGER_DUTY: lcdPrintf("Duty"); return; + default: + lcdPrintf("()"); } } diff --git a/firmware/controllers/map_averaging.cpp b/firmware/controllers/map_averaging.cpp index ad51851b3f..8a398dfb16 100644 --- a/firmware/controllers/map_averaging.cpp +++ b/firmware/controllers/map_averaging.cpp @@ -113,7 +113,7 @@ void mapAveragingCallback(adcsample_t adcValue) { efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "lowstck#9a"); -#if EFI_ANALOG_CHART +#if (EFI_ANALOG_CHART && EFI_ANALOG_SENSORS) || defined(__DOXYGEN__) if (boardConfiguration->analogChartMode == AC_MAP) if (perRevolutionCounter % FAST_MAP_CHART_SKIP_FACTOR == 0) { float voltage = adcToVoltsDivided(adcValue); @@ -199,9 +199,13 @@ float getMapVoltage(void) { * @return Manifold Absolute Pressure, in kPa */ float getMap(void) { +#if EFI_ANALOG_SENSORS || defined(__DOXYGEN__) if (!isValidRpm(engine->rpmCalculator.rpmValue)) return getRawMap(); // maybe return NaN in case of stopped engine? return getMapByVoltage(v_averagedMapValue); +#else + return 100; +#endif } void initMapAveraging(Logging *sharedLogger, Engine *engine) { diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index ddb7329d6c..281da5d63b 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -276,5 +276,5 @@ int getRusEfiVersion(void) { return 1; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE[0] == 0) return 1; // this is here to make the compiler happy about the unused array - return 20150303; + return 20150304; } diff --git a/firmware/util/efilib2.cpp b/firmware/util/efilib2.cpp index b857f1b805..c33f3c9a94 100644 --- a/firmware/util/efilib2.cpp +++ b/firmware/util/efilib2.cpp @@ -42,6 +42,27 @@ uint64_t Overflow64Counter::update(uint32_t value) { // todo: make this a macro? always inline? uint64_t Overflow64Counter::get() { +#if EFI_PROD_CODE + bool alreadyLocked = lockAnyContext(); + uint64_t localH = state.highBits; + uint32_t localLow = state.lowBits; + + uint32_t value = GET_TIMESTAMP(); + + if (value < localLow) { + // new value less than previous value means there was an overflow in that 32 bit counter + localH += 0x100000000LL; + } + + uint64_t result = localH + value; + + + if (!alreadyLocked) { + unlockAnyContext(); + } + return result; +#else + /** * this method is lock-free and thread-safe, that's because the 'update' method * is atomic with a critical zone requirement. @@ -73,4 +94,5 @@ uint64_t Overflow64Counter::get() { } return localH + value; +#endif }