Skip to content

Commit 56dce67

Browse files
committed
Tricky sleep 0ms
1 parent 0bcca0b commit 56dce67

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

keybd.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "keybd.h"
2+
#include "syscall.h"
23

34
#define HIGH 1
45
#define LOW 0
@@ -13,6 +14,7 @@ void scan_keybd(const IOInterface *interface, int rows, int cols, int result[row
1314
{
1415
for(int r = 0; r < rows; r++) {
1516
interface->write_row(r, LOW);
17+
sleep(0);
1618
for(int c = 0; c < cols; c++) {
1719
result[r][c] = !interface->read_col(c);
1820
}
@@ -34,4 +36,4 @@ void update_keybd_event(int rows, int cols, int last_result[rows][cols], int res
3436
event[r][c] = UNCHANGED;
3537
}
3638
}
37-
}
39+
}

0 commit comments

Comments
 (0)