Permalink
Browse files

Perhaps this will help stop us from bricking CBCs, seems like the ret…

…ry code doesn't work properly
  • Loading branch information...
1 parent 9049c3e commit 03d41721fa123965088e03557274baf3c190a03c Jorge Villatoro committed Jan 14, 2010
Showing with 10 additions and 1 deletion.
  1. +10 −1 src/BobLoader.cpp
View
@@ -120,6 +120,15 @@ bool BobLoader::downloadFirmware(QString port)
data.append(((const char *)&crc)[3]);
ret.clear();
+ serialPort.write(data);
+ while(ret.size() < 2)
+ ret += serialPort.read(2-ret.size());
+
+ if(ret != ok) {
+ m_failMessage = "Download failed, please retry from step 1";
+ return false;
+ }
+ /*
while(ret != ok) {
serialPort.write(data);
@@ -135,7 +144,7 @@ bool BobLoader::downloadFirmware(QString port)
}
ret += serialPort.read(2-ret.size());
}
- }
+ }*/
data = QByteArray("WR", 2) + firmware.read(256);
}

0 comments on commit 03d4172

Please sign in to comment.