Refactor Trigger System #635
This commit is contained in:
parent
af7f6454bc
commit
935a9fa706
|
@ -21,11 +21,11 @@ void SingleWave::init(pin_state_t *pinStates) {
|
|||
this->pinStates = pinStates;
|
||||
}
|
||||
|
||||
int SingleWave::getState(int switchIndex) {
|
||||
pin_state_t SingleWave::getState(int switchIndex) {
|
||||
return pinStates[switchIndex];
|
||||
}
|
||||
|
||||
void SingleWave::setState(int switchIndex, int state) {
|
||||
void SingleWave::setState(int switchIndex, pin_state_t state) {
|
||||
pinStates[switchIndex] = state;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,8 +39,8 @@ public:
|
|||
* todo: confirm that we only deal with two states here, no magic '-1'?
|
||||
* @return HIGH or LOW state at given index
|
||||
*/
|
||||
int getState(int switchIndex);
|
||||
void setState(int switchIndex, int state);
|
||||
pin_state_t getState(int switchIndex);
|
||||
void setState(int switchIndex, pin_state_t state);
|
||||
|
||||
// todo: make this private by using 'getState' and 'setState' methods
|
||||
pin_state_t *pinStates;
|
||||
|
|
|
@ -254,7 +254,7 @@ void copyPwmParameters(PwmConfig *state, int phaseCount, float const *switchTime
|
|||
for (int channelIndex = 0; channelIndex < waveCount; channelIndex++) {
|
||||
// print("output switch time index (%d/%d) at %.2f to %d\r\n", phaseIndex, channelIndex,
|
||||
// switchTimes[phaseIndex], pinStates[waveIndex][phaseIndex]);
|
||||
int value = pinStates[channelIndex][phaseIndex];
|
||||
pin_state_t value = pinStates[channelIndex][phaseIndex];
|
||||
state->multiWave.channels[channelIndex].setState(phaseIndex, value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ public:
|
|||
|
||||
// todo: add a runtime validation which would verify that this field was set properly
|
||||
// todo: maybe even automate this flag calculation?
|
||||
int initialState[PWM_PHASE_MAX_WAVE_PER_PWM];
|
||||
pin_state_t initialState[PWM_PHASE_MAX_WAVE_PER_PWM];
|
||||
|
||||
int8_t isFrontEvent[PWM_PHASE_MAX_COUNT];
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue