We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fcbfc8 commit c3b605dCopy full SHA for c3b605d
soft_pwm.c
@@ -105,6 +105,9 @@ static ssize_t pwm_store(
105
}else if(strcmp(attr->attr.name, "period")==0){
106
desc->period = (unsigned int)value;
107
}else if(strcmp(attr->attr.name, "pulses")==0){
108
+ if (value>0)
109
+ desc->pulses = (unsigned int)value*2;
110
+ else
111
desc->pulses = (unsigned int)value;
112
}
113
desc->next_tick = ktime_get();
@@ -305,7 +308,7 @@ static int __init soft_pwm_init(void){
305
308
struct timespec tp;
306
309
307
310
int status;
- printk(KERN_INFO "SoftPWM v0.1-acme initializing.\n");
311
+ printk(KERN_INFO "SoftPWM v0.2-acme initializing.\n");
312
313
hrtimer_get_res(CLOCK_MONOTONIC, &tp);
314
printk(KERN_INFO "Clock resolution is %ldns\n", tp.tv_nsec);
0 commit comments