Explorar el Código

FIX: error handling in ps2.c

tags/v1.9
tmk hace 13 años
padre
commit
1f5cd6d7dc
Se han modificado 1 ficheros con 7 adiciones y 1 borrados
  1. 7
    1
      ps2.c

+ 7
- 1
ps2.c Ver fichero

@@ -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;
}


Cargando…
Cancelar
Guardar