Firmata: Increasing iterations to allow more precise readings and allow more time for response
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
af051d820a
commit
4b22a923cf
@@ -187,7 +187,7 @@ mraa_firmata_i2c_wait(int addr, int reg)
|
|||||||
int res = firmata_dev->i2cmsg[addr][reg];
|
int res = firmata_dev->i2cmsg[addr][reg];
|
||||||
if (pthread_spin_unlock(&firmata_dev->lock) != 0) return MRAA_ERROR_UNSPECIFIED;
|
if (pthread_spin_unlock(&firmata_dev->lock) != 0) return MRAA_ERROR_UNSPECIFIED;
|
||||||
for (; res == -1; i++) {
|
for (; res == -1; i++) {
|
||||||
if (i > 50) {
|
if (i > 1000) {
|
||||||
return MRAA_ERROR_UNSPECIFIED;
|
return MRAA_ERROR_UNSPECIFIED;
|
||||||
}
|
}
|
||||||
usleep(500);
|
usleep(500);
|
||||||
|
|||||||
Reference in New Issue
Block a user