FIX: error handling in ps2.c
This commit is contained in:
parent
035b286b24
commit
1f5cd6d7dc
8
ps2.c
8
ps2.c
@ -104,9 +104,9 @@ uint8_t ps2_host_send(uint8_t data)
|
|||||||
|
|
||||||
/* request to send */
|
/* request to send */
|
||||||
clock_lo();
|
clock_lo();
|
||||||
data_lo();
|
|
||||||
_delay_us(100);
|
_delay_us(100);
|
||||||
/* start bit [1] */
|
/* start bit [1] */
|
||||||
|
data_lo();
|
||||||
clock_hi();
|
clock_hi();
|
||||||
WAIT(clock_lo, 15000, 1);
|
WAIT(clock_lo, 15000, 1);
|
||||||
/* data [2-9] */
|
/* data [2-9] */
|
||||||
@ -137,6 +137,9 @@ uint8_t ps2_host_send(uint8_t data)
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
ERROR:
|
ERROR:
|
||||||
|
/* inhibit device to send */
|
||||||
|
data_hi();
|
||||||
|
clock_lo();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,6 +190,9 @@ uint8_t ps2_host_recv(void)
|
|||||||
|
|
||||||
return data;
|
return data;
|
||||||
ERROR:
|
ERROR:
|
||||||
|
/* inhibit device to send */
|
||||||
|
data_hi();
|
||||||
|
clock_lo();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user