auto-sync

This commit is contained in:
rusEfi 2016-01-11 17:01:33 -05:00
parent 31dbf46578
commit a538dde81e
44 changed files with 140 additions and 139 deletions

View File

@ -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;
}

View File

@ -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]);

View File

@ -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();
};
/**

View File

@ -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
*/

View File

@ -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 {

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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<T, MAXSIZE>::reset() {
}
template<typename T, int MAXSIZE>
bool_t FLStack<T, MAXSIZE>::remove(T value) {
bool FLStack<T, MAXSIZE>::remove(T value) {
for (int i = 0; i < currentSize; i++) {
if (values[i] == value) {
values[0] = values[currentSize - 1];

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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];

View File

@ -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

View File

@ -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;
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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
*/

View File

@ -219,7 +219,7 @@ ThermistorMath::ThermistorMath() {
}
void ThermistorMath::init(thermistor_conf_s *config) {
bool_t isSameConfig = memcmp(config, &currentConfig, sizeof(currentConfig)) == 0;
bool isSameConfig = memcmp(config, &currentConfig, sizeof(currentConfig)) == 0;
if (isSameConfig) {
return;
}

View File

@ -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;
}

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -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) {

View File

@ -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;
}

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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);
}

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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)) {
/**

View File

@ -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)

View File

@ -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) {

View File

@ -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;

View File

@ -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