#129 preparation
This commit is contained in:
parent
af5a4c50f5
commit
a63c22fddf
|
@ -235,7 +235,7 @@ void PwmConfig::weComplexInit(const char *msg, int phaseCount, float *switchTime
|
||||||
timerCallback(this);
|
timerCallback(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void startSimplePwm(PwmConfig *state, const char *msg, OutputPin *output, float frequency, float dutyCycle, pwm_gen_callback *stateChangeCallback) {
|
void startSimplePwm(SimplePwm *state, const char *msg, OutputPin *output, float frequency, float dutyCycle, pwm_gen_callback *stateChangeCallback) {
|
||||||
efiAssertVoid(CUSTOM_ERR_6692, state != NULL, "state");
|
efiAssertVoid(CUSTOM_ERR_6692, state != NULL, "state");
|
||||||
efiAssertVoid(CUSTOM_ERR_6665, dutyCycle >= 0 && dutyCycle <= 1, "dutyCycle");
|
efiAssertVoid(CUSTOM_ERR_6665, dutyCycle >= 0 && dutyCycle <= 1, "dutyCycle");
|
||||||
if (frequency < 1) {
|
if (frequency < 1) {
|
||||||
|
@ -254,7 +254,7 @@ void startSimplePwm(PwmConfig *state, const char *msg, OutputPin *output, float
|
||||||
state->weComplexInit(msg, 2, switchTimes, 1, pinStates, NULL, stateChangeCallback);
|
state->weComplexInit(msg, 2, switchTimes, 1, pinStates, NULL, stateChangeCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
void startSimplePwmExt(PwmConfig *state, const char *msg, brain_pin_e brainPin, OutputPin *output, float frequency,
|
void startSimplePwmExt(SimplePwm *state, const char *msg, brain_pin_e brainPin, OutputPin *output, float frequency,
|
||||||
float dutyCycle, pwm_gen_callback *stateChangeCallback) {
|
float dutyCycle, pwm_gen_callback *stateChangeCallback) {
|
||||||
|
|
||||||
output->initPin(msg, brainPin);
|
output->initPin(msg, brainPin);
|
||||||
|
|
|
@ -106,7 +106,7 @@ private:
|
||||||
*
|
*
|
||||||
* This method should be called after scheduling layer is started by initSignalExecutor()
|
* This method should be called after scheduling layer is started by initSignalExecutor()
|
||||||
*/
|
*/
|
||||||
void startSimplePwm(PwmConfig *state, const char *msg, OutputPin *output,
|
void startSimplePwm(SimplePwm *state, const char *msg, OutputPin *output,
|
||||||
float dutyCycle, float frequency, pwm_gen_callback *stateChangeCallback);
|
float dutyCycle, float frequency, pwm_gen_callback *stateChangeCallback);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -114,7 +114,7 @@ void startSimplePwm(PwmConfig *state, const char *msg, OutputPin *output,
|
||||||
*
|
*
|
||||||
* This method should be called after scheduling layer is started by initSignalExecutor()
|
* This method should be called after scheduling layer is started by initSignalExecutor()
|
||||||
*/
|
*/
|
||||||
void startSimplePwmExt(PwmConfig *state, const char *msg, brain_pin_e brainPin, OutputPin *output,
|
void startSimplePwmExt(SimplePwm *state, const char *msg, brain_pin_e brainPin, OutputPin *output,
|
||||||
float frequency, float dutyCycle, pwm_gen_callback *stateChangeCallback);
|
float frequency, float dutyCycle, pwm_gen_callback *stateChangeCallback);
|
||||||
|
|
||||||
void copyPwmParameters(PwmConfig *state, int phaseCount, float *switchTimes,
|
void copyPwmParameters(PwmConfig *state, int phaseCount, float *switchTimes,
|
||||||
|
|
|
@ -121,17 +121,17 @@ void testApplyPinState(PwmConfig *state, int stateIndex) {
|
||||||
void testPwmGenerator() {
|
void testPwmGenerator() {
|
||||||
print("*************************************** testPwmGenerator\r\n");
|
print("*************************************** testPwmGenerator\r\n");
|
||||||
|
|
||||||
PwmConfig pwm;
|
SimplePwm pwm;
|
||||||
|
|
||||||
OutputPin pin;
|
OutputPin pin;
|
||||||
|
|
||||||
//pwm.setFrequency(600);
|
//pwm.setFrequency(600);
|
||||||
|
|
||||||
// startSimplePwm(&pwm, "unit_test",
|
startSimplePwm(&pwm, "unit_test",
|
||||||
// &pin,
|
&pin,
|
||||||
// 600 /* frequency */,
|
600 /* frequency */,
|
||||||
// 0.80 /* duty cycle */,
|
0.80 /* duty cycle */,
|
||||||
// &testApplyPinState);
|
&testApplyPinState);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue