Increase timeouts

This commit is contained in:
Jeremy Soller
2019-12-30 11:46:21 -07:00
parent 209834bee1
commit 0e59958dc0
4 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,7 @@
#include <ec/smbus.h>
//TODO: find best value
#define I2C_TIMEOUT 1000
#define I2C_TIMEOUT 10000
void i2c_reset(bool kill) {
if (HOSTAA & HOSTA_BUSY) {

View File

@ -9,7 +9,7 @@
.data = &PSDAT ## NUM, \
}
#define TIMEOUT 1000
#define PS2_TIMEOUT 10000
#define PSSTS_TIMEOUT_ERR (1 << 6)
#define PSSTS_FRAME_ERR (1 << 5)
@ -45,7 +45,7 @@ static int ps2_transaction(struct Ps2 * ps2, uint8_t * data, int length, bool re
}
uint32_t timeout;
for (timeout = TIMEOUT; timeout > 0; timeout--) {
for (timeout = PS2_TIMEOUT; timeout > 0; timeout--) {
uint8_t status = *(ps2->status);
// If an error happened, clear status and return the error
if (status & PSSTS_ALL_ERR) {