aboutsummaryrefslogtreecommitdiff
path: root/libraries/Bridge
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@bug.st>2013-06-12 12:08:11 +0200
committerCristian Maglie <c.maglie@bug.st>2013-06-12 12:09:04 +0200
commit9e59262f643f1726738888b2945d3d63c1939d58 (patch)
tree659569705b8fdd973619a37b70b3d861b6d02666 /libraries/Bridge
parent60d4c13f76bee77e68915fd9cb9644e71ea420f6 (diff)
Bridge class now checks for protocol version
Diffstat (limited to 'libraries/Bridge')
-rw-r--r--libraries/Bridge/Bridge.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/libraries/Bridge/Bridge.cpp b/libraries/Bridge/Bridge.cpp
index 4787cb9..6f3e987 100644
--- a/libraries/Bridge/Bridge.cpp
+++ b/libraries/Bridge/Bridge.cpp
@@ -27,8 +27,6 @@ void BridgeClass::begin() {
return;
started = true;
- // TODO: A more robust restart
-
// Wait for Atheros bootloader to finish startup
do {
dropAll();
@@ -53,8 +51,11 @@ void BridgeClass::begin() {
// are ignored as "invalid packets".
// Reset the brigde
- uint8_t cmd[] = {'X','X'};
- transfer(cmd, 2);
+ uint8_t cmd[] = {'X','X', '1','0','0'};
+ uint8_t res[1];
+ transfer(cmd, 5, res, 1);
+ if (res[0] != 0)
+ while (true);
}
uint8_t BridgeClass::runCommand(String &command, uint8_t &err) {