rusefi-1/unit_tests/test_pwm_generator.cpp

42 lines
666 B
C++
Raw Normal View History

2018-12-08 15:11:28 -08:00
/*
* test_pwm_generator.cpp
*
* @date Dec 8, 2018
* Author: user
*/
#include "global.h"
#include "unit_test_framework.h"
#include "event_queue.h"
#include "pwm_generator_logic.h"
extern EventQueue schedulingQueue;
extern int timeNowUs;
void testApplyPinState(PwmConfig *state, int stateIndex) {
}
void testPwmGenerator() {
print("*************************************** testPwmGenerator\r\n");
SimplePwm pwm;
OutputPin pin;
//pwm.setFrequency(600);
schedulingQueue.clear();
startSimplePwm(&pwm, "unit_test",
&pin,
600 /* frequency */,
0.80 /* duty cycle */,
&testApplyPinState);
assertEquals(1, schedulingQueue.size());
}