diff options
author | knolax <1339802534.kk@gmail.com> | 2017-12-29 16:12:14 -0500 |
---|---|---|
committer | knolax <1339802534.kk@gmail.com> | 2017-12-29 16:12:14 -0500 |
commit | 0be25ac4e78f21b42592ee9183c0159efa40270a (patch) | |
tree | 125014b8cc199dec0be7f1af8cc8ded152968586 /skey.c | |
parent | 42dd37ade1869064b3404ec8e62ca52c8e323985 (diff) |
added debug prints, testing this in production at the moment, also increased the scan period back to 1s.
Diffstat (limited to 'skey.c')
-rw-r--r-- | skey.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -165,12 +165,14 @@ int processkey(int row, int column, int state) { break; //if current_keymap is out of range [0,3] default: + printk(KERN_ALERT "skey: current_keymap out of bounds\n") return -EINVAL; break; } - + printk("skey: previous KEYSTATE_PHYS for r:%d,c:%d was %d\n", row, column, (KEYSTATE_PHYS & keystate[row][column])); //falling edge if ((KEYSTATE_PHYS & keystate[row][column]) && !state) { + printk(KERN_INFO "skey: falling edge detected for r:%d,c:%d\n". row. column); //after the previous keystate is checked, it is updated if (state) { keystate[row][column] = KEYSTATE_PHYS | keystate[row][column]; @@ -186,6 +188,7 @@ int processkey(int row, int column, int state) { } //rising edge }else if (!(KEYSTATE_PHYS & keystate[row][column]) && state) { + printk(KERN_INFO "skey: rising edge detected for r:%d,c:%d\n". row. column); //after the previous keystate is checked, it is updated if (state) { keystate[row][column] = KEYSTATE_PHYS | keystate[row][column]; @@ -254,7 +257,7 @@ int processkey(int row, int column, int state) { input_sync(skey_dev); return 0; break; - } + } //if it's stickymode, toggle the state stored and send corresponding vent if (stickymode) { //it was high before, so now it's being toggled off @@ -309,6 +312,7 @@ int skey_update_thread (void *data) { while (column_index < 10) { if (gpio_get_value_cansleep(column_pins[column_index])) { processkey(row_index, column_index, 1); + printk(KERN_INFO, "skey:button pressed at r:%d,c:%d\n", row_index, column_index); } else { processkey(row_index, column_index, 0); } @@ -322,7 +326,7 @@ int skey_update_thread (void *data) { } //sleep 500us= .5ms = 0.0005 seconds // 1 / 0.0005 = 2000 hz fastest, but it's really 1/0.00052 - usleep_range(500,500); + usleep_range(1000000,1000000); //for when the thread has to stop if (kthread_should_stop()) { break; |