firmata_mraa.c: retry counter should not be decremented past 0
This means the retry counter works appropriately in case of failure. Closes #574 Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -537,7 +537,7 @@ mraa_firmata_plat_init(const char* uart_dev)
|
|||||||
|
|
||||||
// if this isn't working then we have an issue with our uart
|
// if this isn't working then we have an issue with our uart
|
||||||
int retry = 20;
|
int retry = 20;
|
||||||
while (!firmata_dev->isReady && retry--) {
|
while (!firmata_dev->isReady && --retry) {
|
||||||
firmata_pull(firmata_dev);
|
firmata_pull(firmata_dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user