diff options
-rw-r--r-- | skey.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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++; } |