done
This commit is contained in:
@@ -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--;
|
||||
}
|
||||
|
Reference in New Issue
Block a user