![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Fork to see if I can get working
Dependencies: BufferedSerial OneWire WinbondSPIFlash libxDot-dev-mbed5-deprecated
Fork of xDotBridge_update_test20180823 by
Diff: xDotBridge/src/main.cpp
- Revision:
- 24:fdf87e4b72e5
- Parent:
- 23:4ed894108882
- Child:
- 25:fea776239709
--- a/xDotBridge/src/main.cpp Fri Dec 30 19:10:41 2016 +0000 +++ b/xDotBridge/src/main.cpp Tue Jan 03 10:49:44 2017 -0700 @@ -92,6 +92,25 @@ // as long as both Dots are configured correctly, they should be able to communicate update_peer_to_peer_config(network_address, network_session_key, data_session_key, tx_frequency, tx_datarate, tx_power); + + unsigned int wakeMode; + /////////////////////////////// + // Transmitter Configuration // + /////////////////////////////// + #if BRIDGE_TX + wakeMode = mDot::INTERRUPT; + #endif + + //////////////////////////// + // Receiver Configuration // + //////////////////////////// + #if BRIDGE_RX + wakeMode = mDot::RTC_ALARM_OR_INTERRUPT; + #endif + + // Common Configuration + dot->setWakePin(WAKE); + // save changes to configuration logInfo("saving configuration"); if (!dot->saveConfig()) { @@ -103,6 +122,10 @@ uint16_t seqNum=0; while (true) { + /////////////////////////// + // Transmitter main loop // + /////////////////////////// + #if BRIDGE_TX std::vector<uint8_t> tx_data; // join network if not joined @@ -116,8 +139,8 @@ send_data(tx_data); seqNum++; - - dot->sleep(); + dot->sleep(0, wakeMode, false); // Go to sleep until wake button + #endif } return 0;