1.1 --- a/ArduinoAm29F010.cpp Tue Jan 20 00:58:34 2015 +0100
1.2 +++ b/ArduinoAm29F010.cpp Tue Jan 20 01:40:55 2015 +0100
1.3 @@ -163,7 +163,7 @@
1.4
1.5 bool waitForCompletion(int high, int low, int written)
1.6 {
1.7 - int data;
1.8 + int data, then = millis();
1.9
1.10 do
1.11 {
1.12 @@ -171,7 +171,8 @@
1.13 data = readOp(high, low);
1.14 } while (
1.15 ((data & 0x80) != (written & 0x80)) &&
1.16 - ((data & 0x20) == 0)
1.17 + ((data & 0x20) == 0) &&
1.18 + (millis() - then < 2000)
1.19 );
1.20
1.21 return readOp(high, low) == written;