From a6d6d0460bd36423ab06529646747364567ed1c6 Mon Sep 17 00:00:00 2001 From: knolax <1339802534.kk@gmail.com> Date: Sat, 23 Dec 2017 12:36:27 -0500 Subject: changed the function calls to the linux gpio interface to their cansleep equivalents --- skey.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/skey.c b/skey.c index ac9b19b..48fcc03 100644 --- a/skey.c +++ b/skey.c @@ -85,13 +85,13 @@ int skey_update_thread (void *data) { int column_index = 0; while (row_index < 3) { //sets the column pin high for reading - gpio_set_value(row_pins[row_index], 1); + gpio_set_value_cansleep(row_pins[row_index], 1); //gives it some buffer time usleep(10); //reads with all the rows column_index = 0; while (column_index < 10) { - if (gpio_get_value(column_pins[column_index])) { + if (gpio_get_value_cansleep(column_pins[column_index])) { printk(KERN_INFO "skey: key pressed at column %d, row %d\n", column_index, row_index); } else { printk(KERN_INFO "skey: key not pressed at column %d, row %d\n", column_index, row_index); @@ -99,7 +99,7 @@ int skey_update_thread (void *data) { column_index++; } //sets the row pin low - gpio_set_value(row_pins[row_index], 0); + gpio_set_value_cansleep(row_pins[row_index], 0); usleep(10); row_index++; } -- cgit v1.1