save 1440 bytes (#2226)
This commit is contained in:
parent
8ef1d04ca6
commit
a294dfeadd
|
@ -361,10 +361,10 @@ void TriggerWaveform::setTriggerSynchronizationGap3(int gapIndex, float syncRati
|
|||
/**
|
||||
* this method is only used on initialization
|
||||
*/
|
||||
int TriggerWaveform::findAngleIndex(TriggerFormDetails *details, float target) const {
|
||||
int engineCycleEventCount = getLength();
|
||||
uint16_t TriggerWaveform::findAngleIndex(TriggerFormDetails *details, float target) const {
|
||||
size_t engineCycleEventCount = getLength();
|
||||
|
||||
efiAssert(CUSTOM_ERR_ASSERT, engineCycleEventCount > 0, "engineCycleEventCount", 0);
|
||||
efiAssert(CUSTOM_ERR_ASSERT, engineCycleEventCount <= 0xFFFF, "engineCycleEventCount", 0);
|
||||
|
||||
uint32_t left = 0;
|
||||
uint32_t right = engineCycleEventCount - 1;
|
||||
|
@ -433,11 +433,13 @@ void TriggerWaveform::prepareShape(TriggerFormDetails *details DECLARE_ENGINE_PA
|
|||
|
||||
int engineCycleInt = (int) getEngineCycle(operationMode);
|
||||
for (int angle = 0; angle < engineCycleInt; angle++) {
|
||||
int triggerShapeIndex = findAngleIndex(details, angle);
|
||||
uint16_t triggerShapeIndex = findAngleIndex(details, angle);
|
||||
|
||||
if (useOnlyRisingEdgeForTriggerTemp) {
|
||||
// we need even index for front_only mode - so if odd indexes are rounded down
|
||||
triggerShapeIndex = triggerShapeIndex & 0xFFFFFFFE;
|
||||
// we need even index for front_only mode - so if odd indexes are rounded down by clearing the low bit
|
||||
triggerShapeIndex &= 0xFFFE;
|
||||
}
|
||||
|
||||
details->triggerIndexByAngle[angle] = triggerShapeIndex;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -275,7 +275,7 @@ public:
|
|||
private:
|
||||
trigger_shape_helper h;
|
||||
|
||||
int findAngleIndex(TriggerFormDetails *details, float angle) const;
|
||||
uint16_t findAngleIndex(TriggerFormDetails *details, float angle) const;
|
||||
|
||||
/**
|
||||
* Working buffer for 'wave' instance
|
||||
|
@ -313,7 +313,7 @@ public:
|
|||
* this cache allows us to find a close-enough (with one degree precision) trigger wheel index by
|
||||
* given angle with fast constant speed. That's a performance optimization for event scheduling.
|
||||
*/
|
||||
int triggerIndexByAngle[720];
|
||||
uint16_t triggerIndexByAngle[720];
|
||||
};
|
||||
|
||||
void findTriggerPosition(
|
||||
|
|
Loading…
Reference in New Issue