summaryrefslogtreecommitdiff
path: root/ps2.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2011-01-11 21:30:35 +0900
committertmk <nobody@nowhere>2011-01-11 21:30:35 +0900
commit1f5cd6d7dcbd18f2b647631600df13a0f6d64d25 (patch)
tree9cf3fa631171254c0a9bfafb734b12ae90564012 /ps2.c
parent035b286b24333185337f6c96f8e428e69b85a662 (diff)
FIX: error handling in ps2.c
Diffstat (limited to 'ps2.c')
-rw-r--r--ps2.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ps2.c b/ps2.c
index adb425ae33..a388b74892 100644
--- a/ps2.c
+++ b/ps2.c
@@ -104,9 +104,9 @@ uint8_t ps2_host_send(uint8_t data)
/* request to send */
clock_lo();
- data_lo();
_delay_us(100);
/* start bit [1] */
+ data_lo();
clock_hi();
WAIT(clock_lo, 15000, 1);
/* data [2-9] */
@@ -137,6 +137,9 @@ uint8_t ps2_host_send(uint8_t data)
return 1;
ERROR:
+ /* inhibit device to send */
+ data_hi();
+ clock_lo();
return 0;
}
@@ -187,6 +190,9 @@ uint8_t ps2_host_recv(void)
return data;
ERROR:
+ /* inhibit device to send */
+ data_hi();
+ clock_lo();
return 0;
}