Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static ssize_t motor_driver_write(struct file *filep, const char *buffer,size_t len, loff_t *offset){
- int returnVal = 0;
- char numberBuffer[len];
- strcpy(numberBuffer, buffer);
- printk (KERN_INFO "buffer is %s\n", numberBuffer);
- returnVal = kstrtol(numberBuffer, 10, &duty_cycle);
- if (returnVal < 0){
- printk (KERN_ALERT "Kstrtol Failed\n");
- return returnVal;
- }
- printk (KERN_INFO "duty cycle is %ld\n", duty_cycle);
- hrtimer_start(&hr_timer, ktime, HRTIMER_MODE_REL);
- return len;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement