This commit is contained in:
tkl
2016-08-09 12:52:38 +02:00
parent 2f13f30b3d
commit 24770a1266
4 changed files with 58 additions and 3 deletions

View File

@@ -23,15 +23,16 @@ struct thread_context th_ctx;
static void th_func(void *arg)
{
unsigned int duty = 0;
pwm_open(&pwm_ch4);
open(&pwm_4);
while(1) {
while(duty < 100) {
ioctl(&pwm_4, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&duty);
pwm_set_duty_cycle(&pwm_ch4, duty);
sleep_ms(10);
duty++;
}
while(duty > 0) {
pwm_set_duty_cycle(&pwm_ch4, duty);
ioctl(&pwm_4, IOCTL_PWM_SET_DUTY_CYCLE, (const void *)&duty);
sleep_ms(10);
duty--;
}