Fork to see if I can get working

Dependencies:   BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated

Fork of xDotBridge_update_test20180823 by Matt Briggs

Revision:
52:64a2c71c7c49
Parent:
50:e89647e77fd5
Child:
53:a1563574a980
--- a/xDotBridge/src/main.cpp	Tue Feb 21 11:07:22 2017 -0700
+++ b/xDotBridge/src/main.cpp	Tue Feb 21 15:33:57 2017 -0700
@@ -14,7 +14,7 @@
 
 mDot* dot = NULL; // Used by dot-utils
 
-DigitalOut gpio3(GPIO3, 1); // Flash ~hold signal
+//DigitalOut gpio3(GPIO3, 1); // Flash ~hold signal
 
 volatile bool ccIntFlag;
 volatile bool tamperIntFlag;
@@ -31,13 +31,12 @@
 
 
 int main() {
+    CmdResult result;
     ccIntFlag = false;
     tamperIntFlag = false;
     pairBtnIntFlag = false;
     pc.baud(115200);
 
-    CommProtocolPeerBrute protocol;
-    BaseboardIO bbio;
     RadioEvent events;  // Custom event handler for automatically displaying RX data
 
     mts::MTSLog::setLogLevel(mts::MTSLog::TRACE_LEVEL);
@@ -73,7 +72,7 @@
 //    logInfo("Programmable Voltage Detector set for level: %d", pvdConfig.PVDLevel);
 //    // HAL_PWR_PVDCallback need to define this I think this will override the current implementation
 
-    dot->setWakePin(WAKE);
+//    dot->setWakePin(WAKE);
 
     // save changes to configuration
     logInfo("saving configuration");
@@ -83,6 +82,16 @@
 
     // display configuration
     display_config();
+    CommProtocolPeerBrute protocol;
+    BaseboardIO bbio;
+
+    result = bbio.init();
+    if (result == cmdSuccess) {
+        pc.printf("= Baseboard Init Finished Successfully    =\r\n");
+    }
+    else {
+        pc.printf("= Baseboard Init Finished with Error      =\r\n");
+    }
 
     uint16_t seqNum=0;
     Callback<void()> ccInIntObj (&ccInIntCallback);
@@ -134,8 +143,8 @@
 		    }
 
             bbio.ledOff();
-            sleep_save_io();
-            sleep_configure_io();
+//            sleep_save_io();
+//            sleep_configure_io();
             dot->sleep(0, mDot::INTERRUPT, false);  // Go to sleep until wake button
             sleep_restore_io();
 		}
@@ -157,11 +166,11 @@
             bbio.ledOff();
             bbio.relayNormal();
             logInfo("Sleeping.  Time %d", us_ticker_read());
-            sleep_save_io();
-            sleep_configure_io();
+//            sleep_save_io();
+//            sleep_configure_io();
             // TODO maybe add if statement here to prevent double hits by sleeping for a longer time
             dot->sleep(2, mDot::RTC_ALARM_OR_INTERRUPT, false);  // Go to sleep until wake button
-            sleep_restore_io();
+//            sleep_restore_io();
 		}
 
 		// TODO maybe a good place to put pairing logic
@@ -171,8 +180,6 @@
         // Need to re-implement some of these sleep functions
 //		sleep_save_io();
 //		sleep_configure_io();
-
-//        dot->sleep(2, mDot::INTERRUPT, false);  // Go to sleep until wake button
     }
 
     return 0;