diff --git a/firmware/controllers/algo/advance_map.cpp b/firmware/controllers/algo/advance_map.cpp index 962ac3ef33..035f84dffa 100644 --- a/firmware/controllers/algo/advance_map.cpp +++ b/firmware/controllers/algo/advance_map.cpp @@ -52,7 +52,7 @@ static const ignition_table_t defaultIatTiming = { {-4.4, -4.9, -5.9, -5.9, -5.9, -5.9, -4.9, -4.9, -4.9, -4.9, -4.9, -3.9, -3.9, -3.9, -3.9, -3.9}, }; -bool_t isStep1Condition(int rpm DECLARE_ENGINE_PARAMETER_S) { +bool isStep1Condition(int rpm DECLARE_ENGINE_PARAMETER_S) { return boardConfiguration->enabledStep1Limiter && rpm >= engineConfiguration->step1rpm; } diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 3ecc20ae56..ff308b6175 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -173,7 +173,7 @@ static bool stopPin(NamedOutputPin *output) { return false; } -bool_t Engine::stopPins() { +bool Engine::stopPins() { bool result = false; for (int i = 0; i < engineConfiguration->specs.cylindersCount; i++) { result |= stopPin(&enginePins.coils[i]); diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index a5c6b8bb5f..5f3403d8e5 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -44,7 +44,7 @@ public: int eventsCount; private: void clear(); - void registerInjectionEvent(int injectorIndex, float angle, bool_t isSimultanious DECLARE_ENGINE_PARAMETER_S); + void registerInjectionEvent(int injectorIndex, float angle, bool isSimultanious DECLARE_ENGINE_PARAMETER_S); }; /** @@ -231,19 +231,19 @@ public: void periodicFastCallback(DECLARE_ENGINE_PARAMETER_F); void updateSlowSensors(DECLARE_ENGINE_PARAMETER_F); - bool_t clutchUpState; - bool_t clutchDownState; + bool clutchUpState; + bool clutchDownState; - bool_t isRunningPwmTest; + bool isRunningPwmTest; /** * Are we experiencing knock right now? */ - bool_t knockNow; + bool knockNow; /** * Have we experienced knock since engine was started? */ - bool_t knockEver; + bool knockEver; /** * KnockCount is directly proportional to the degrees of ignition * advance removed @@ -252,7 +252,7 @@ public: float knockVolts; - bool_t knockDebug; + bool knockDebug; efitimeus_t timeOfLastKnockEvent; @@ -260,7 +260,7 @@ public: * are we running any kind of functional test? this affect * some areas */ - bool_t isTestMode; + bool isTestMode; TriggerShape triggerShape; @@ -296,7 +296,7 @@ public: * This field is true if we are in 'cylinder cleanup' state right now * see isCylinderCleanupEnabled */ - bool_t isCylinderCleanupMode; + bool isCylinderCleanupMode; /** * value of 'triggerShape.getLength()' @@ -339,8 +339,8 @@ private: * 'running' means RPM are above crankingRpm * 'spinning' means the engine is not stopped */ - bool_t isSpinning; - bool_t stopPins(); + bool isSpinning; + bool stopPins(); }; /** diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index ea5a172ec0..c79139731b 100644 --- a/firmware/controllers/algo/engine_configuration_generated_structures.h +++ b/firmware/controllers/algo/engine_configuration_generated_structures.h @@ -214,14 +214,14 @@ typedef struct { trigger_type_e type; /** offset 4 bit 0 */ - bool_t customIsSynchronizationNeeded : 1; + bool customIsSynchronizationNeeded : 1; /** offset 4 bit 1 */ - bool_t customNeedSecondTriggerInput : 1; + bool customNeedSecondTriggerInput : 1; /** * This option could be used if your second trigger channel is broken offset 4 bit 2 */ - bool_t useOnlyFirstChannel : 1; + bool useOnlyFirstChannel : 1; /** * offset 8 */ @@ -540,43 +540,43 @@ typedef struct { pin_output_mode_e o2heaterPinModeTodO; /** offset 384 bit 0 */ - bool_t is_enabled_spi_1 : 1; + bool is_enabled_spi_1 : 1; /** offset 384 bit 1 */ - bool_t is_enabled_spi_2 : 1; + bool is_enabled_spi_2 : 1; /** offset 384 bit 2 */ - bool_t is_enabled_spi_3 : 1; + bool is_enabled_spi_3 : 1; /** offset 384 bit 3 */ - bool_t isSdCardEnabled : 1; + bool isSdCardEnabled : 1; /** offset 384 bit 4 */ - bool_t isFastAdcEnabled : 1; + bool isFastAdcEnabled : 1; /** offset 384 bit 5 */ - bool_t isEngineControlEnabled : 1; + bool isEngineControlEnabled : 1; /** offset 384 bit 6 */ - bool_t isHip9011Enabled : 1; + bool isHip9011Enabled : 1; /** offset 384 bit 7 */ - bool_t isVerboseAlternator : 1; + bool isVerboseAlternator : 1; /** offset 384 bit 8 */ - bool_t useSerialPort : 1; + bool useSerialPort : 1; /** offset 384 bit 9 */ - bool_t useStepperIdle : 1; + bool useStepperIdle : 1; /** offset 384 bit 10 */ - bool_t enabledStep1Limiter : 1; + bool enabledStep1Limiter : 1; /** offset 384 bit 11 */ - bool_t useTpicAdvancedMode : 1; + bool useTpicAdvancedMode : 1; /** offset 384 bit 12 */ - bool_t useLcdScreen : 1; + bool useLcdScreen : 1; /** * offset 388 */ @@ -762,7 +762,7 @@ typedef struct { * Should the trigger emulator push data right into trigger input, eliminating the need for physical jumper wires? * PS: Funny name, right? :) offset 80 bit 0 */ - bool_t directSelfStimulation : 1; + bool directSelfStimulation : 1; /** * todo: extract these two fields into a structure * todo: we need two sets of TPS parameters - modern ETBs have two sensors @@ -1041,68 +1041,68 @@ typedef struct { /** * @see isMapAveragingEnabled offset 1496 bit 0 */ - bool_t hasMapSensor : 1; + bool hasMapSensor : 1; /** offset 1496 bit 1 */ - bool_t hasIatSensor : 1; + bool hasIatSensor : 1; /** offset 1496 bit 2 */ - bool_t hasBaroSensor : 1; + bool hasBaroSensor : 1; /** offset 1496 bit 3 */ - bool_t hasAfrSensor : 1; + bool hasAfrSensor : 1; /** offset 1496 bit 4 */ - bool_t useConstantDwellDuringCranking : 1; + bool useConstantDwellDuringCranking : 1; /** * This options enables data for 'engine sniffer' tab in console, which comes at some CPU price offset 1496 bit 5 */ - bool_t isEngineChartEnabled : 1; + bool isEngineChartEnabled : 1; /** offset 1496 bit 6 */ - bool_t isCanEnabled : 1; + bool isCanEnabled : 1; /** offset 1496 bit 7 */ - bool_t hasCltSensor : 1; + bool hasCltSensor : 1; /** offset 1496 bit 8 */ - bool_t canReadEnabled : 1; + bool canReadEnabled : 1; /** offset 1496 bit 9 */ - bool_t canWriteEnabled : 1; + bool canWriteEnabled : 1; /** offset 1496 bit 10 */ - bool_t hasVehicleSpeedSensor : 1; + bool hasVehicleSpeedSensor : 1; /** offset 1496 bit 11 */ - bool_t isJoystickEnabled : 1; + bool isJoystickEnabled : 1; /** offset 1496 bit 12 */ - bool_t isGpsEnabled : 1; + bool isGpsEnabled : 1; /** offset 1496 bit 13 */ - bool_t isAlternatorControlEnabled : 1; + bool isAlternatorControlEnabled : 1; /** offset 1496 bit 14 */ - bool_t hasMafSensor : 1; + bool hasMafSensor : 1; /** offset 1496 bit 15 */ - bool_t hasTpsSensor : 1; + bool hasTpsSensor : 1; /** offset 1496 bit 16 */ - bool_t cutFuelOnHardLimit : 1; + bool cutFuelOnHardLimit : 1; /** offset 1496 bit 17 */ - bool_t cutSparkOnHardLimit : 1; + bool cutSparkOnHardLimit : 1; /** offset 1496 bit 18 */ - bool_t step1fuelCutEnable : 1; + bool step1fuelCutEnable : 1; /** offset 1496 bit 19 */ - bool_t step1SparkCutEnable : 1; + bool step1SparkCutEnable : 1; /** offset 1496 bit 20 */ - bool_t hasFrequencyReportingMapSensor : 1; + bool hasFrequencyReportingMapSensor : 1; /** * offset 1500 */ @@ -1113,58 +1113,58 @@ typedef struct { idle_mode_e idleMode; /** offset 1508 bit 0 */ - bool_t isInjectionEnabled : 1; + bool isInjectionEnabled : 1; /** offset 1508 bit 1 */ - bool_t isIgnitionEnabled : 1; + bool isIgnitionEnabled : 1; /** offset 1508 bit 2 */ - bool_t isCylinderCleanupEnabled : 1; + bool isCylinderCleanupEnabled : 1; /** offset 1508 bit 3 */ - bool_t secondTriggerChannelEnabled : 1; + bool secondTriggerChannelEnabled : 1; /** offset 1508 bit 4 */ - bool_t needSecondTriggerInputDeprecated : 1; + bool needSecondTriggerInputDeprecated : 1; /** offset 1508 bit 5 */ - bool_t isMapAveragingEnabled : 1; + bool isMapAveragingEnabled : 1; /** offset 1508 bit 6 */ - bool_t isMilEnabled : 1; + bool isMilEnabled : 1; /** offset 1508 bit 7 */ - bool_t isFuelPumpEnabled : 1; + bool isFuelPumpEnabled : 1; /** offset 1508 bit 8 */ - bool_t isTunerStudioEnabled : 1; + bool isTunerStudioEnabled : 1; /** offset 1508 bit 9 */ - bool_t isWaveAnalyzerEnabled : 1; + bool isWaveAnalyzerEnabled : 1; /** offset 1508 bit 10 */ - bool_t isIdleThreadEnabled : 1; + bool isIdleThreadEnabled : 1; /** offset 1508 bit 11 */ - bool_t isPrintTriggerSynchDetails : 1; + bool isPrintTriggerSynchDetails : 1; /** * Usually if we have no trigger events that means engine is stopped * Unless we are troubleshooting and spinning the engine by hand - this case a longer * delay is needed offset 1508 bit 12 */ - bool_t isManualSpinningMode : 1; + bool isManualSpinningMode : 1; /** * This is needed if batched injection and individual injector wiring offset 1508 bit 13 */ - bool_t twoWireBatchInjection : 1; + bool twoWireBatchInjection : 1; /** * See #172 offset 1508 bit 14 */ - bool_t useOnlyFrontForTrigger : 1; + bool useOnlyFrontForTrigger : 1; /** * This is needed if batched igniton (waster spark) and individual coil wiring offset 1508 bit 15 */ - bool_t twoWireBatchIgnition : 1; + bool twoWireBatchIgnition : 1; /** * offset 1512 */ diff --git a/firmware/controllers/algo/event_registry.h b/firmware/controllers/algo/event_registry.h index d0df12b653..e4c0d26a64 100644 --- a/firmware/controllers/algo/event_registry.h +++ b/firmware/controllers/algo/event_registry.h @@ -41,7 +41,7 @@ public: * This is a performance optimization - it's more efficient to handle all * injectors together if that's the case */ - bool_t isSimultanious; + bool isSimultanious; }; class IgnitionEvent { diff --git a/firmware/controllers/algo/idle_controller.cpp b/firmware/controllers/algo/idle_controller.cpp index 5d1a286c2f..9df30b3a72 100644 --- a/firmware/controllers/algo/idle_controller.cpp +++ b/firmware/controllers/algo/idle_controller.cpp @@ -63,7 +63,7 @@ static percent_t setNewValue(IdleValveState *idle, int currentRpm, efitimems_t n return newValue; } -bool_t isTpsLockout(DECLARE_ENGINE_PARAMETER_F) { +bool isTpsLockout(DECLARE_ENGINE_PARAMETER_F) { // if we have TPS sensor, then use it if (engineConfiguration->hasTpsSensor) return getTPS(PASS_ENGINE_PARAMETER_F) > TPS_IDLE_LOCKOUT; diff --git a/firmware/controllers/algo/malfunction_central.c b/firmware/controllers/algo/malfunction_central.c index e52019300b..690660db5b 100644 --- a/firmware/controllers/algo/malfunction_central.c +++ b/firmware/controllers/algo/malfunction_central.c @@ -44,7 +44,7 @@ void removeError(obd_code_e errorCode) { } } -void setError(bool_t isError, obd_code_e errorCode) { +void setError(bool isError, obd_code_e errorCode) { if (isError) addError(errorCode); else diff --git a/firmware/controllers/algo/malfunction_central.h b/firmware/controllers/algo/malfunction_central.h index 839a3545b7..bbdf2c75af 100644 --- a/firmware/controllers/algo/malfunction_central.h +++ b/firmware/controllers/algo/malfunction_central.h @@ -41,7 +41,7 @@ void addError(obd_code_e errorCode); */ void removeError(obd_code_e errorCode); -void setError(bool_t isError, obd_code_e errorCode); +void setError(bool isError, obd_code_e errorCode); /** * @brief Copies the current set of errors into the specified buffer diff --git a/firmware/controllers/core/fl_stack.h b/firmware/controllers/core/fl_stack.h index 52e2e875c6..252d484f54 100644 --- a/firmware/controllers/core/fl_stack.h +++ b/firmware/controllers/core/fl_stack.h @@ -20,7 +20,7 @@ public: void reset(); T pop(); T get(int index); - bool_t remove(T value); + bool remove(T value); int size(); bool isEmpty(); private: @@ -45,7 +45,7 @@ void FLStack::reset() { } template -bool_t FLStack::remove(T value) { +bool FLStack::remove(T value) { for (int i = 0; i < currentSize; i++) { if (values[i] == value) { values[0] = values[currentSize - 1]; diff --git a/firmware/controllers/core/fsio_core.cpp b/firmware/controllers/core/fsio_core.cpp index cf947379e8..638cfbe130 100644 --- a/firmware/controllers/core/fsio_core.cpp +++ b/firmware/controllers/core/fsio_core.cpp @@ -126,7 +126,7 @@ void LECalculator::push(le_action_e action, float value) { /** * @return true in case of error, false otherwise */ -bool_t LECalculator::doJob(Engine *engine, LEElement *element) { +bool LECalculator::doJob(Engine *engine, LEElement *element) { #if EFI_PROD_CODE || defined(__DOXYGEN__) efiAssert(getRemainingStack(chThdSelf()) > 64, "FSIO logic", false); #endif @@ -278,7 +278,7 @@ float LECalculator::getValue(Engine *engine) { while (element != NULL) { efiAssert(counter < 200, "FSIOcount", NAN); // just in case - bool_t isError = doJob(engine, element); + bool isError = doJob(engine, element); if (isError) { // error already reported return NAN; diff --git a/firmware/controllers/core/fsio_core.h b/firmware/controllers/core/fsio_core.h index d945d78214..7674d7b062 100644 --- a/firmware/controllers/core/fsio_core.h +++ b/firmware/controllers/core/fsio_core.h @@ -96,7 +96,7 @@ public: int currentCalculationLogPosition; private: void push(le_action_e action, float value); - bool_t doJob(Engine *engine, LEElement *element); + bool doJob(Engine *engine, LEElement *element); float pop(le_action_e action); LEElement *first; calc_stack_t stack; diff --git a/firmware/controllers/core/fsio_impl.cpp b/firmware/controllers/core/fsio_impl.cpp index a0fc1c08d8..4852cd37b7 100644 --- a/firmware/controllers/core/fsio_impl.cpp +++ b/firmware/controllers/core/fsio_impl.cpp @@ -214,7 +214,7 @@ static void handleFsio(Engine *engine, int index) { if (boardConfiguration->fsioPins[index] == GPIO_UNASSIGNED) return; - bool_t isPwmMode = boardConfiguration->fsioFrequency[index] != NO_PWM; + bool isPwmMode = boardConfiguration->fsioFrequency[index] != NO_PWM; float fvalue = calc.getValue2(fsioLogics[index], engine); engine->engineConfiguration2->fsioLastValue[index] = fvalue; diff --git a/firmware/controllers/electronic_throttle.cpp b/firmware/controllers/electronic_throttle.cpp index ed167ad259..cff37e8496 100644 --- a/firmware/controllers/electronic_throttle.cpp +++ b/firmware/controllers/electronic_throttle.cpp @@ -62,7 +62,7 @@ static float currentEtbDuty; EXTERN_ENGINE; -static bool_t wasEtbBraking = false; +static bool wasEtbBraking = false; static msg_t etbThread(void *arg) { UNUSED(arg); @@ -74,7 +74,7 @@ static msg_t etbThread(void *arg) { etbPwmUp.setSimplePwmDutyCycle(currentEtbDuty / 100); - bool_t needEtbBraking = absF(pedal - tps) < 3; + bool needEtbBraking = absF(pedal - tps) < 3; if (needEtbBraking != wasEtbBraking) { scheduleMsg(&logger, "need ETB braking: %d", needEtbBraking); wasEtbBraking = needEtbBraking; diff --git a/firmware/controllers/error_handling.cpp b/firmware/controllers/error_handling.cpp index 4e85301d38..f6effe7849 100644 --- a/firmware/controllers/error_handling.cpp +++ b/firmware/controllers/error_handling.cpp @@ -21,7 +21,7 @@ static LoggingWithStorage logger("error handling"); #define WARNING_PREFIX "WARNING: " extern int warningEnabled; -extern bool_t main_loop_started; +extern bool main_loop_started; const char *dbg_panic_file; int dbg_panic_line; @@ -111,7 +111,7 @@ void initErrorHandling(void) { } extern VTList vtlist; -extern bool_t main_loop_started; +extern bool main_loop_started; int getVtSizeEstimate(void) { VirtualTimer *first = vtlist.vt_next; diff --git a/firmware/controllers/flash_main.cpp b/firmware/controllers/flash_main.cpp index e2a79604ea..251140a50d 100644 --- a/firmware/controllers/flash_main.cpp +++ b/firmware/controllers/flash_main.cpp @@ -78,7 +78,7 @@ void writeToFlashNow(void) { efitimems_t nowMs = currentTimeMillis(); int result = flashWrite(FLASH_ADDR, (const char *) &persistentState, PERSISTENT_SIZE); scheduleMsg(logger, "Flash programmed in %dms", currentTimeMillis() - nowMs); - bool_t isSuccess = result == FLASH_RETURN_SUCCESS; + bool isSuccess = result == FLASH_RETURN_SUCCESS; if (isSuccess) { scheduleMsg(logger, FLASH_SUCCESS_MSG); } else { diff --git a/firmware/controllers/injector_central.cpp b/firmware/controllers/injector_central.cpp index 76f4095142..c061baddad 100644 --- a/firmware/controllers/injector_central.cpp +++ b/firmware/controllers/injector_central.cpp @@ -37,13 +37,13 @@ static LoggingWithStorage logger("InjectorCentral"); EXTERN_ENGINE ; -static bool_t isRunningBench = false; +static bool isRunningBench = false; static int is_injector_enabled[MAX_INJECTOR_COUNT]; extern engine_pins_s enginePins; -bool_t isRunningBenchTest(void) { +bool isRunningBenchTest(void) { return isRunningBench; } @@ -112,7 +112,7 @@ static void runBench(brain_pin_e brainPin, OutputPin *output, float delayMs, flo isRunningBench = false; } -static volatile bool_t needToRunBench = false; +static volatile bool needToRunBench = false; static float onTime; static float offTime; static float delayMs; diff --git a/firmware/controllers/injector_central.h b/firmware/controllers/injector_central.h index 2a49cd4151..bb8c07ef0b 100644 --- a/firmware/controllers/injector_central.h +++ b/firmware/controllers/injector_central.h @@ -17,7 +17,7 @@ void fanBench(void); void fuelPumpBench(void); void initInjectorCentral(void); -bool_t isRunningBenchTest(void); +bool isRunningBenchTest(void); int isInjectorEnabled(int cylinderId); void assertCylinderId(int cylinderId, const char *msg); diff --git a/firmware/controllers/map_averaging.cpp b/firmware/controllers/map_averaging.cpp index 18a239122b..16c0d47c01 100644 --- a/firmware/controllers/map_averaging.cpp +++ b/firmware/controllers/map_averaging.cpp @@ -84,7 +84,7 @@ static scheduling_s endTimer[INJECTION_PIN_COUNT][2]; * that's a performance optimization: let's not bother averaging * if we are outside of of the window */ -static bool_t isAveraging = false; +static bool isAveraging = false; static void startAveraging(void *arg) { (void) arg; diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index a9404b347e..2afd2c7a3b 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -114,7 +114,7 @@ void initializeIgnitionActions(angle_t advance, angle_t dwellAngle, } void FuelSchedule::registerInjectionEvent(int injectorIndex, float angle, - bool_t isSimultanious DECLARE_ENGINE_PARAMETER_S) { + bool isSimultanious DECLARE_ENGINE_PARAMETER_S) { NamedOutputPin *output = &enginePins.injectors[injectorIndex]; diff --git a/firmware/controllers/sensors/hip9011_lookup.cpp b/firmware/controllers/sensors/hip9011_lookup.cpp index ef4709bb33..3e285c770d 100644 --- a/firmware/controllers/sensors/hip9011_lookup.cpp +++ b/firmware/controllers/sensors/hip9011_lookup.cpp @@ -1,5 +1,6 @@ /** * @file hip9011_lookup.cpp + * @brief HIP9011-specific table lookups, the other part of implementation is in HIP9011.cpp * * @date Jan 4, 2015 * @author Andrey Belomutskiy, (c) 2012-2016 diff --git a/firmware/controllers/sensors/maf.cpp b/firmware/controllers/sensors/maf.cpp index d6ff60bde5..3a3c191a76 100644 --- a/firmware/controllers/sensors/maf.cpp +++ b/firmware/controllers/sensors/maf.cpp @@ -13,7 +13,7 @@ float getMaf(DECLARE_ENGINE_PARAMETER_F) { return getMafT(engineConfiguration); } -bool_t hasMafSensor(DECLARE_ENGINE_PARAMETER_F) { +bool hasMafSensor(DECLARE_ENGINE_PARAMETER_F) { return engineConfiguration->hasMafSensor && engineConfiguration->mafAdcChannel != EFI_ADC_NONE; } diff --git a/firmware/controllers/sensors/maf.h b/firmware/controllers/sensors/maf.h index 1709368652..818e9275e6 100644 --- a/firmware/controllers/sensors/maf.h +++ b/firmware/controllers/sensors/maf.h @@ -16,7 +16,7 @@ #define getMafT(ec) (getVoltageDivided("maf", ec->mafAdcChannel)) float getMaf(void); -bool_t hasMafSensor(DECLARE_ENGINE_PARAMETER_F); +bool hasMafSensor(DECLARE_ENGINE_PARAMETER_F); float getRealMaf(DECLARE_ENGINE_PARAMETER_F); void setBosch0280218037(persistent_config_s *engineConfiguration); diff --git a/firmware/controllers/sensors/map.cpp b/firmware/controllers/sensors/map.cpp index 2ed40dc018..9bce38cf48 100644 --- a/firmware/controllers/sensors/map.cpp +++ b/firmware/controllers/sensors/map.cpp @@ -124,7 +124,7 @@ float getRawMap(DECLARE_ENGINE_PARAMETER_F) { return getMapByVoltage(voltage PASS_ENGINE_PARAMETER); } -bool_t hasBaroSensor(DECLARE_ENGINE_PARAMETER_F) { +bool hasBaroSensor(DECLARE_ENGINE_PARAMETER_F) { return engineConfiguration->hasBaroSensor && engineConfiguration->baroSensor.hwChannel != EFI_ADC_NONE; } diff --git a/firmware/controllers/sensors/map.h b/firmware/controllers/sensors/map.h index 63782196f2..607bf3d823 100644 --- a/firmware/controllers/sensors/map.h +++ b/firmware/controllers/sensors/map.h @@ -14,7 +14,7 @@ void initMapDecoder(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_S); */ float getRawMap(DECLARE_ENGINE_PARAMETER_F); float getBaroPressure(DECLARE_ENGINE_PARAMETER_F); -bool_t hasBaroSensor(DECLARE_ENGINE_PARAMETER_F); +bool hasBaroSensor(DECLARE_ENGINE_PARAMETER_F); /** * @return MAP value averaged within a window of measurement */ diff --git a/firmware/controllers/sensors/thermistors.cpp b/firmware/controllers/sensors/thermistors.cpp index 763050b038..0ab7de6bb1 100644 --- a/firmware/controllers/sensors/thermistors.cpp +++ b/firmware/controllers/sensors/thermistors.cpp @@ -219,7 +219,7 @@ ThermistorMath::ThermistorMath() { } void ThermistorMath::init(thermistor_conf_s *config) { - bool_t isSameConfig = memcmp(config, ¤tConfig, sizeof(currentConfig)) == 0; + bool isSameConfig = memcmp(config, ¤tConfig, sizeof(currentConfig)) == 0; if (isSameConfig) { return; } diff --git a/firmware/controllers/sensors/tps.cpp b/firmware/controllers/sensors/tps.cpp index f8646e1966..dc7274a9a4 100644 --- a/firmware/controllers/sensors/tps.cpp +++ b/firmware/controllers/sensors/tps.cpp @@ -102,7 +102,7 @@ static float getPrimatyRawTPS(DECLARE_ENGINE_PARAMETER_F) { #define NO_TPS_MAGIC_VALUE 66.611 -bool_t hasPedalPositionSensor(DECLARE_ENGINE_PARAMETER_F) { +bool hasPedalPositionSensor(DECLARE_ENGINE_PARAMETER_F) { return engineConfiguration->pedalPositionChannel != EFI_ADC_NONE; } diff --git a/firmware/controllers/sensors/tps.h b/firmware/controllers/sensors/tps.h index 607eeb4d5f..99ba9f7819 100644 --- a/firmware/controllers/sensors/tps.h +++ b/firmware/controllers/sensors/tps.h @@ -13,7 +13,7 @@ #include "global.h" #include "engine_configuration.h" -bool_t hasPedalPositionSensor(DECLARE_ENGINE_PARAMETER_F); +bool hasPedalPositionSensor(DECLARE_ENGINE_PARAMETER_F); percent_t getPedalPosition(DECLARE_ENGINE_PARAMETER_F); /** * Throttle Position Sensor diff --git a/firmware/controllers/sensors/voltage.cpp b/firmware/controllers/sensors/voltage.cpp index b97c7716b9..7b12afea55 100644 --- a/firmware/controllers/sensors/voltage.cpp +++ b/firmware/controllers/sensors/voltage.cpp @@ -18,7 +18,7 @@ float getVRef(DECLARE_ENGINE_PARAMETER_F) { return getVoltageDivided("vref", engineConfiguration->vRefAdcChannel); } -bool_t hasVBatt(DECLARE_ENGINE_PARAMETER_F) { +bool hasVBatt(DECLARE_ENGINE_PARAMETER_F) { return engineConfiguration->vbattAdcChannel != EFI_ADC_NONE; } diff --git a/firmware/controllers/sensors/voltage.h b/firmware/controllers/sensors/voltage.h index 35cce5900b..35bf665ff0 100644 --- a/firmware/controllers/sensors/voltage.h +++ b/firmware/controllers/sensors/voltage.h @@ -15,6 +15,6 @@ float getVRef(DECLARE_ENGINE_PARAMETER_F); float getVBatt(DECLARE_ENGINE_PARAMETER_F); -bool_t hasVBatt(DECLARE_ENGINE_PARAMETER_F); +bool hasVBatt(DECLARE_ENGINE_PARAMETER_F); #endif diff --git a/firmware/controllers/system/SingleTimerExecutor.cpp b/firmware/controllers/system/SingleTimerExecutor.cpp index 0ff913a016..cab1a1de13 100644 --- a/firmware/controllers/system/SingleTimerExecutor.cpp +++ b/firmware/controllers/system/SingleTimerExecutor.cpp @@ -73,7 +73,7 @@ void Executor::scheduleByTime(scheduling_s *scheduling, efitimeus_t timeUs, schf // this would guard the queue and disable interrupts lockAnyContext(); } - bool_t needToResetTimer = queue.insertTask(scheduling, US2NT(timeUs), callback, param); + bool needToResetTimer = queue.insertTask(scheduling, US2NT(timeUs), callback, param); if (!reentrantFlag) { doExecute(); if (needToResetTimer) { diff --git a/firmware/controllers/system/efiGpio.cpp b/firmware/controllers/system/efiGpio.cpp index d6e1987849..5d6360d882 100644 --- a/firmware/controllers/system/efiGpio.cpp +++ b/firmware/controllers/system/efiGpio.cpp @@ -35,7 +35,7 @@ OutputPin::OutputPin() { #endif } -bool_t OutputPin::isInitialized() { +bool OutputPin::isInitialized() { #if EFI_PROD_CODE || defined(__DOXYGEN__) return port != NULL; #else @@ -47,7 +47,7 @@ void OutputPin::setValue(int logicValue) { doSetOutputPinValue2(this, logicValue); } -bool_t OutputPin::getLogicValue() { +bool OutputPin::getLogicValue() { return currentLogicValue; } diff --git a/firmware/controllers/system/efiGpio.h b/firmware/controllers/system/efiGpio.h index e62ee1aac7..39fca660de 100644 --- a/firmware/controllers/system/efiGpio.h +++ b/firmware/controllers/system/efiGpio.h @@ -21,10 +21,10 @@ class OutputPin { public: OutputPin(); - bool_t isInitialized(); + bool isInitialized(); void setValue(int logicValue); void setDefaultPinState(pin_output_mode_e *defaultState); - bool_t getLogicValue(); + bool getLogicValue(); void unregister(); #if EFI_PROD_CODE || defined(__DOXYGEN__) GPIO_TypeDef *port; diff --git a/firmware/controllers/system/event_queue.cpp b/firmware/controllers/system/event_queue.cpp index e07924516d..96ec3f6c46 100644 --- a/firmware/controllers/system/event_queue.cpp +++ b/firmware/controllers/system/event_queue.cpp @@ -38,7 +38,7 @@ bool EventQueue::checkIfPending(scheduling_s *scheduling) { /** * @return true if inserted into the head of the list */ -bool_t EventQueue::insertTask(scheduling_s *scheduling, efitime_t timeX, schfunc_t callback, void *param) { +bool EventQueue::insertTask(scheduling_s *scheduling, efitime_t timeX, schfunc_t callback, void *param) { #if EFI_UNIT_TEST assertListIsSorted(); #endif diff --git a/firmware/controllers/system/event_queue.h b/firmware/controllers/system/event_queue.h index e11cb493c0..ef1c0c2723 100644 --- a/firmware/controllers/system/event_queue.h +++ b/firmware/controllers/system/event_queue.h @@ -49,7 +49,7 @@ public: /** * O(size) */ - bool_t insertTask(scheduling_s *scheduling, efitime_t timeX, schfunc_t callback, void *param); + bool insertTask(scheduling_s *scheduling, efitime_t timeX, schfunc_t callback, void *param); int executeAll(efitime_t now); diff --git a/firmware/controllers/system/scheduler.h b/firmware/controllers/system/scheduler.h index 6ac9c4d160..62b5da0c0a 100644 --- a/firmware/controllers/system/scheduler.h +++ b/firmware/controllers/system/scheduler.h @@ -23,7 +23,7 @@ public: schfunc_t callback; void *param; scheduling_s *next; - bool_t isScheduled; + bool isScheduled; }; void scheduleTask(const char *prefix, scheduling_s *scheduling, int delayUs, schfunc_t callback, void *param); diff --git a/firmware/controllers/trigger/main_trigger_callback.cpp b/firmware/controllers/trigger/main_trigger_callback.cpp index 4d10f508e4..b4060d93c1 100644 --- a/firmware/controllers/trigger/main_trigger_callback.cpp +++ b/firmware/controllers/trigger/main_trigger_callback.cpp @@ -103,7 +103,7 @@ static void endSimultaniousInjection(Engine *engine) { extern WallFuel wallFuel; -static ALWAYS_INLINE void handleFuelInjectionEvent(bool_t limitedFuel, InjectionEvent *event, +static ALWAYS_INLINE void handleFuelInjectionEvent(bool limitedFuel, InjectionEvent *event, int rpm DECLARE_ENGINE_PARAMETER_S) { /** * todo: this is a bit tricky with batched injection. is it? Does the same @@ -160,7 +160,7 @@ static ALWAYS_INLINE void handleFuelInjectionEvent(bool_t limitedFuel, Injection } } -static ALWAYS_INLINE void handleFuel(bool_t limitedFuel, uint32_t eventIndex, int rpm DECLARE_ENGINE_PARAMETER_S) { +static ALWAYS_INLINE void handleFuel(bool limitedFuel, uint32_t eventIndex, int rpm DECLARE_ENGINE_PARAMETER_S) { if (!isInjectionEnabled(engine->engineConfiguration)) return; efiAssertVoid(getRemainingStack(chThdSelf()) > 128, "lowstck#3"); @@ -192,7 +192,7 @@ static ALWAYS_INLINE void handleFuel(bool_t limitedFuel, uint32_t eventIndex, in } } -static ALWAYS_INLINE void handleSparkEvent(bool_t limitedSpark, uint32_t eventIndex, IgnitionEvent *iEvent, +static ALWAYS_INLINE void handleSparkEvent(bool limitedSpark, uint32_t eventIndex, IgnitionEvent *iEvent, int rpm DECLARE_ENGINE_PARAMETER_S) { float dwellMs = engine->engineState.sparkDwell; @@ -261,7 +261,7 @@ static ALWAYS_INLINE void handleSparkEvent(bool_t limitedSpark, uint32_t eventIn } } -static ALWAYS_INLINE void handleSpark(bool_t limitedSpark, uint32_t eventIndex, int rpm, +static ALWAYS_INLINE void handleSpark(bool limitedSpark, uint32_t eventIndex, int rpm, IgnitionEventList *list DECLARE_ENGINE_PARAMETER_S) { if (!isValidRpm(rpm) || !engineConfiguration->isIgnitionEnabled) return; // this might happen for instance in case of a single trigger event after a pause @@ -323,7 +323,7 @@ static ALWAYS_INLINE void ignitionMathCalc(int rpm DECLARE_ENGINE_PARAMETER_S) { /** * this field is used as an Expression in IAR debugger */ -uint32_t *cyccnt = (uint32_t*) &DWT_CYCCNT; +uint32_t *cyccnt = (uint32_t*) &DWT->CYCCNT; #endif static ALWAYS_INLINE void scheduleIgnitionAndFuelEvents(int rpm, int revolutionIndex DECLARE_ENGINE_PARAMETER_S) { @@ -407,8 +407,8 @@ void mainTriggerCallback(trigger_event_e ckpSignalType, uint32_t eventIndex DECL // TODO: add 'pin shutdown' invocation somewhere - coils might be still open here! return; } - bool_t limitedSpark = rpm > engineConfiguration->rpmHardLimit; - bool_t limitedFuel = rpm > engineConfiguration->rpmHardLimit; + bool limitedSpark = rpm > engineConfiguration->rpmHardLimit; + bool limitedFuel = rpm > engineConfiguration->rpmHardLimit; if (limitedSpark || limitedFuel) { warning(OBD_PCM_Processor_Fault, "skipping stroke due to rpm=%d", rpm); } diff --git a/firmware/controllers/trigger/rpm_calculator.cpp b/firmware/controllers/trigger/rpm_calculator.cpp index 6a67fbb5c5..69f5b3997f 100644 --- a/firmware/controllers/trigger/rpm_calculator.cpp +++ b/firmware/controllers/trigger/rpm_calculator.cpp @@ -74,7 +74,7 @@ bool RpmCalculator::isRunning(DECLARE_ENGINE_PARAMETER_F) { * note that the result of this subtraction could be negative, that would happen if * we have a trigger event between the time we've invoked 'getTimeNow' and here */ - bool_t result = nowNt - lastRpmEventTimeNt < US2NT(US_PER_SECOND_LL); + bool result = nowNt - lastRpmEventTimeNt < US2NT(US_PER_SECOND_LL); if (!result) { notRunnintNow = nowNt; notRunningPrev = lastRpmEventTimeNt; diff --git a/firmware/controllers/trigger/trigger_central.cpp b/firmware/controllers/trigger/trigger_central.cpp index 55a950f4f6..d8dcee99c7 100644 --- a/firmware/controllers/trigger/trigger_central.cpp +++ b/firmware/controllers/trigger/trigger_central.cpp @@ -111,12 +111,12 @@ void TriggerCentral::resetCounters() { static char shaft_signal_msg_index[15]; -static bool_t isUpEvent[6] = { false, true, false, true, false, true }; +static bool isUpEvent[6] = { false, true, false, true, false, true }; static const char *eventId[6] = { CRANK1, CRANK1, CRANK2, CRANK2, CRANK3, CRANK3 }; static ALWAYS_INLINE void reportEventToWaveChart(trigger_event_e ckpSignalType, int index DECLARE_ENGINE_PARAMETER_S) { itoa10(&shaft_signal_msg_index[2], index); - bool_t isUp = isUpEvent[(int) ckpSignalType]; + bool isUp = isUpEvent[(int) ckpSignalType]; shaft_signal_msg_index[0] = isUp ? 'u' : 'd'; addWaveChartEvent(eventId[(int )ckpSignalType], (char* ) shaft_signal_msg_index); diff --git a/firmware/controllers/trigger/trigger_chrysler.cpp b/firmware/controllers/trigger/trigger_chrysler.cpp index 92a8e969f2..f4e9895ec8 100644 --- a/firmware/controllers/trigger/trigger_chrysler.cpp +++ b/firmware/controllers/trigger/trigger_chrysler.cpp @@ -26,7 +26,7 @@ void initDodgeRam(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) { } void configureNeon2003TriggerShape(TriggerShape *s DECLARE_ENGINE_PARAMETER_S) { - bool_t useOnlyPrimary = false; + bool useOnlyPrimary = false; s->initialize(FOUR_STROKE_CAM_SENSOR, !useOnlyPrimary); s->useRiseEdge = true; diff --git a/firmware/controllers/trigger/trigger_decoder.cpp b/firmware/controllers/trigger/trigger_decoder.cpp index 05c8d9fed8..a356829067 100644 --- a/firmware/controllers/trigger/trigger_decoder.cpp +++ b/firmware/controllers/trigger/trigger_decoder.cpp @@ -62,16 +62,16 @@ static Logging * logger; efitick_t lastDecodingErrorTime = US2NT(-10000000LL); // the boolean flag is a performance optimization so that complex comparison is avoided if no error -bool_t someSortOfTriggerError = false; +bool someSortOfTriggerError = false; /** * @return TRUE is something is wrong with trigger decoding */ -bool_t isTriggerDecoderError(void) { +bool isTriggerDecoderError(void) { return errorDetection.sum(6) > 4; } -bool_t TriggerState::isValidIndex(DECLARE_ENGINE_PARAMETER_F) { +bool TriggerState::isValidIndex(DECLARE_ENGINE_PARAMETER_F) { return currentCycle.current_index < TRIGGER_SHAPE(size); } @@ -145,7 +145,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no currentDuration = currentDurationLong > 10 * US2NT(US_PER_SECOND_LL) ? 10 * US2NT(US_PER_SECOND_LL) : currentDurationLong; - bool_t isPrimary = triggerWheel == T_PRIMARY; + bool isPrimary = triggerWheel == T_PRIMARY; if (isLessImportant(signal)) { #if EFI_UNIT_TEST || defined(__DOXYGEN__) @@ -193,7 +193,7 @@ void TriggerState::decodeTriggerEvent(trigger_event_e const signal, efitime_t no } #endif - bool_t isSynchronizationPoint; + bool isSynchronizationPoint; if (TRIGGER_SHAPE(isSynchronizationNeeded)) { /** diff --git a/firmware/controllers/trigger/trigger_decoder.h b/firmware/controllers/trigger/trigger_decoder.h index 2210c71072..cbee70ea8c 100644 --- a/firmware/controllers/trigger/trigger_decoder.h +++ b/firmware/controllers/trigger/trigger_decoder.h @@ -53,7 +53,7 @@ public: efitime_t getStartOfRevolutionIndex(); void decodeTriggerEvent(trigger_event_e const signal, efitime_t nowUs DECLARE_ENGINE_PARAMETER_S); - bool_t isValidIndex(DECLARE_ENGINE_PARAMETER_F); + bool isValidIndex(DECLARE_ENGINE_PARAMETER_F); float getTriggerDutyCycle(int index); TriggerStateCallback cycleCallback; @@ -120,7 +120,7 @@ class Engine; void initTriggerDecoder(void); void initTriggerDecoderLogger(Logging *sharedLogger); -bool_t isTriggerDecoderError(void); +bool isTriggerDecoderError(void); #define considerEventForGap() (!TRIGGER_SHAPE(useOnlyPrimaryForSync) || isPrimary) diff --git a/firmware/controllers/trigger/trigger_emulator_algo.cpp b/firmware/controllers/trigger/trigger_emulator_algo.cpp index f5b2266f12..0705a0b1c8 100644 --- a/firmware/controllers/trigger/trigger_emulator_algo.cpp +++ b/firmware/controllers/trigger/trigger_emulator_algo.cpp @@ -33,7 +33,7 @@ TriggerEmulatorHelper::TriggerEmulatorHelper() { } // this is not the only place where we have 'isUpEvent'. todo: reuse -static bool_t isUpEvent[6] = { false, true, false, true, false, true }; +static bool isUpEvent[6] = { false, true, false, true, false, true }; EXTERN_ENGINE ; @@ -46,13 +46,13 @@ static void fireShaftSignal(trigger_event_e signal) { void TriggerEmulatorHelper::handleEmulatorCallback(PwmConfig *state, int stateIndex) { int prevIndex = (stateIndex + state->phaseCount - 1) % state->phaseCount; - bool_t primaryWheelState = state->multiWave.waves[0].pinStates[prevIndex]; + bool primaryWheelState = state->multiWave.waves[0].pinStates[prevIndex]; int newPrimaryWheelState = state->multiWave.waves[0].pinStates[stateIndex]; - bool_t secondaryWheelState = state->multiWave.waves[1].pinStates[prevIndex]; + bool secondaryWheelState = state->multiWave.waves[1].pinStates[prevIndex]; int newSecondaryWheelState = state->multiWave.waves[1].pinStates[stateIndex]; - bool_t thirdWheelState = state->multiWave.waves[2].pinStates[prevIndex]; + bool thirdWheelState = state->multiWave.waves[2].pinStates[prevIndex]; int new3rdWheelState = state->multiWave.waves[2].pinStates[stateIndex]; if (primaryWheelState != newPrimaryWheelState) { diff --git a/firmware/controllers/trigger/trigger_simulator.cpp b/firmware/controllers/trigger/trigger_simulator.cpp index f6e5be6d3d..fe563f35d5 100644 --- a/firmware/controllers/trigger/trigger_simulator.cpp +++ b/firmware/controllers/trigger/trigger_simulator.cpp @@ -26,14 +26,14 @@ void TriggerStimulatorHelper::nextStep(TriggerState *state, TriggerShape * shape int time = (int) (SIMULATION_CYCLE_PERIOD * (loopIndex + shape->wave.getSwitchTime(stateIndex))); - bool_t primaryWheelState = shape->wave.getChannelState(0, prevIndex); - bool_t newPrimaryWheelState = shape->wave.getChannelState(0, stateIndex); + bool primaryWheelState = shape->wave.getChannelState(0, prevIndex); + bool newPrimaryWheelState = shape->wave.getChannelState(0, stateIndex); - bool_t secondaryWheelState = shape->wave.getChannelState(1, prevIndex); - bool_t newSecondaryWheelState = shape->wave.getChannelState(1, stateIndex); + bool secondaryWheelState = shape->wave.getChannelState(1, prevIndex); + bool newSecondaryWheelState = shape->wave.getChannelState(1, stateIndex); - bool_t thirdWheelState = shape->wave.getChannelState(2, prevIndex); - bool_t new3rdWheelState = shape->wave.getChannelState(2, stateIndex); + bool thirdWheelState = shape->wave.getChannelState(2, prevIndex); + bool new3rdWheelState = shape->wave.getChannelState(2, stateIndex); if (primaryWheelState != newPrimaryWheelState) { primaryWheelState = newPrimaryWheelState; diff --git a/firmware/controllers/trigger/trigger_structure.h b/firmware/controllers/trigger/trigger_structure.h index 1ea4dcff76..39111ce98b 100644 --- a/firmware/controllers/trigger/trigger_structure.h +++ b/firmware/controllers/trigger/trigger_structure.h @@ -36,8 +36,8 @@ public: TriggerShape(); void initializeTriggerShape(Logging *logger DECLARE_ENGINE_PARAMETER_S); - bool_t isSynchronizationNeeded; - bool_t needSecondTriggerInput; + bool isSynchronizationNeeded; + bool needSecondTriggerInput; /** * duty cycle for each individual trigger channel @@ -83,18 +83,18 @@ public: * In case of a multi-channel trigger, do we want to sync based on primary channel only? * See also gapBothDirections */ - bool_t useOnlyPrimaryForSync; + bool useOnlyPrimaryForSync; /** * Should we use falls or rises for gap ratio detection? * todo: combine this flag with gapBothDirections? */ - bool_t useRiseEdge; + bool useRiseEdge; /** * This is about selecting signal edges within partictular trigger channels. * Should we measure gaps with both fall and rise signal edges? * See also useOnlyPrimaryForSync */ - bool_t gapBothDirections; + bool gapBothDirections; /** * This is used for signal validation @@ -124,7 +124,7 @@ public: /** * This is a pretty questionable option which is considered by 'addEvent' method */ - bool_t invertOnAdd; + bool invertOnAdd; /** * Total count of shaft events per CAM or CRANK shaft revolution. * TODO this should be migrated to CRANKshaft revolution, this would go together