Fork to see if I can get working
Dependencies: BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated
Fork of xDotBridge_update_test20180823 by
Revision 52:64a2c71c7c49, committed 2017-02-21
- Comitter:
- Matt Briggs
- Date:
- Tue Feb 21 15:33:57 2017 -0700
- Parent:
- 51:58d2a1b8f9d2
- Child:
- 53:a1563574a980
- Commit message:
- quick commit to compile.
Changed in this revision
| xDotBridge/config.h | Show annotated file Show diff for this revision Revisions of this file |
| xDotBridge/src/main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/xDotBridge/config.h Tue Feb 21 11:07:22 2017 -0700 +++ b/xDotBridge/config.h Tue Feb 21 15:33:57 2017 -0700 @@ -5,10 +5,10 @@ #ifndef CONFIG_H_ #define CONFIG_H_ -#define __TEST__ 1 // Comment out for main application +//#define __TEST__ 1 // Comment out for main application // Manual test -#define __TEST_BBIO__ // Comment out for main application +//#define __TEST_BBIO__ // Comment out for main application //#define __TEST_PVD__ // Comment out for main application //#define __TEST_LRR__ // Comment out for main application // These define which wireless bridge you are generating code for
--- 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;
