From 9e59262f643f1726738888b2945d3d63c1939d58 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 12 Jun 2013 12:08:11 +0200 Subject: Bridge class now checks for protocol version --- libraries/Bridge/Bridge.cpp | 9 +++++---- 1 file 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) { -- cgit v1.2.3-18-g5258