Refactor Trigger System #635

This commit is contained in:
rusefi 2019-02-03 01:04:24 -05:00
parent ad2af22d16
commit 4d368e0ca8
4 changed files with 4 additions and 4 deletions

View File

@ -245,7 +245,7 @@ static void timerCallback(PwmConfig *state) {
* Incoming parameters are potentially just values on current stack, so we have to copy
* into our own permanent storage, right?
*/
void copyPwmParameters(PwmConfig *state, int phaseCount, float *switchTimes, int waveCount, pin_state_t **pinStates) {
void copyPwmParameters(PwmConfig *state, int phaseCount, float *switchTimes, int waveCount, pin_state_t *const *pinStates) {
state->phaseCount = phaseCount;
for (int phaseIndex = 0; phaseIndex < phaseCount; phaseIndex++) {

View File

@ -140,6 +140,6 @@ void startSimplePwmExt(SimplePwm *state,
float frequency, float dutyCycle, pwm_gen_callback *stateChangeCallback);
void copyPwmParameters(PwmConfig *state, int phaseCount, float *switchTimes,
int waveCount, pin_state_t **pinStates);
int waveCount, pin_state_t *const *pinStates);
#endif /* PWM_GENERATOR_LOGIC_H_ */

View File

@ -225,7 +225,7 @@ void TriggerShape::addEvent(bool useOnlyRisingEdgeForTrigger, angle_t angle, tri
shapeDefinitionError = true;
return;
}
wave->setState(/* channelIndex */ 0, /* value */ initialState[i]);
wave->setState(/* switchIndex */ 0, /* value */ initialState[i]);
}
isFrontEvent[0] = TV_RISE == stateParam;

View File

@ -185,7 +185,7 @@ public:
MultiWave wave;
// todo: add a runtime validation which would verify that this field was set properly
// tood: maybe even automate this flag calculation?
// todo: maybe even automate this flag calculation?
int initialState[PWM_PHASE_MAX_WAVE_PER_PWM];
int8_t isFrontEvent[PWM_PHASE_MAX_COUNT];