implemented infrared_sensor-driver
This commit is contained in:
@@ -37,7 +37,7 @@ static int infrared_sensor_open(struct inode *devfile, struct file *instance)
|
||||
|
||||
}
|
||||
|
||||
<<<<<<< HEAD:project/module/infrared_sensor/infrared_sensor_in_3.c
|
||||
|
||||
static ssize_t infrared_sensor_read( struct file *file, char __user *buffer, size_t length, loff_t *offset)
|
||||
{
|
||||
unsigned long not_copied;
|
||||
@@ -57,18 +57,6 @@ static ssize_t infrared_sensor_read( struct file *file, char __user *buffer, siz
|
||||
*offset += count - not_copied;
|
||||
|
||||
return count - not_copied;
|
||||
=======
|
||||
static ssize_t infrared_sensor_read( struct file *instance, char __user *user,
|
||||
size_t max_bytes_to_read, loff_t *offset)
|
||||
{
|
||||
unsigned long not_copied, to_copy;
|
||||
u32 value = gpio_get_value;
|
||||
|
||||
to_copy = min( max_bytes_to_read, sizeof(value) );
|
||||
not_copied=copy_to_user( user, &value, to_copy);
|
||||
|
||||
return to_copy - not_copied;
|
||||
>>>>>>> 8ad08b638d0490724f49b13692420465d9c65658:project/modules/infrared_sensor_in_3/infrared_sensor_in_3.c
|
||||
}
|
||||
|
||||
static int infrared_sensor_close( struct inode *devfile, struct file *instance)
|
||||
|
||||
Reference in New Issue
Block a user