![](/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:
- 89:edfe5d376e55
- Parent:
- 81:1eb0f16b2ab9
- Child:
- 90:32f9d043561a
--- a/xDotBridge/src/main.cpp Thu Nov 16 18:10:53 2017 -0700 +++ b/xDotBridge/src/main.cpp Sat Nov 18 15:50:10 2017 -0700 @@ -19,7 +19,7 @@ #define RX_SEQ_LOG 1 -const float BridgeVersion = 99.99; +const float BridgeVersion = 1.01; // 232 Pins const PinName SER_TERM_TX = UART_TX; @@ -27,51 +27,9 @@ #ifndef __TEST__ // Exclude code for tests Serial pc(USBTX, USBRX); -//RawSerial outPc(UART_TX, UART_RX); -//Serial *outPc; BufferedSerial *outPc; InterruptIn uart1RxIntIn (SER_TERM_RX); -//// Serial interrupts / buffer code -//const int buffer_size = 255; -//// might need to increase buffer size for high baud rates -//char tx_buffer[buffer_size+1]; -//char rx_buffer[buffer_size+1]; -//// Circular buffer pointers -//// volatile makes read-modify-write atomic -//volatile int tx_in=0; -//volatile int tx_out=0; -//volatile int rx_in=0; -//volatile int rx_out=0; -// -//// Interupt Routine to read in data from serial port -//void Rx_interrupt() { -// led1=1; -//// Loop just in case more than one character is in UART's receive FIFO buffer -//// Stop if buffer full -// while ((outPc.readable()) && (((rx_in + 1) % buffer_size) != rx_out)) { -// rx_buffer[rx_in] = outPc.getc(); -//// Uncomment to Echo to USB serial to watch data flow -//// monitor_device.putc(rx_buffer[rx_in]); -// rx_in = (rx_in + 1) % buffer_size; -// } -// led1=0; -// return; -//} -// -//// Interupt Routine to write out data to serial port -//void Tx_interrupt() { -// led2=1; -//// Loop to fill more than one character in UART's transmit FIFO buffer -//// Stop if buffer empty -// while ((outPc.writeable()) && (tx_in != tx_out)) { -// outPc.putc(tx_buffer[tx_out]); -// tx_out = (tx_out + 1) % buffer_size; -// } -// led2=0; -// return; -//} - mDot* dot = NULL; // Used by dot-utils volatile bool uartRxFlag; @@ -147,32 +105,6 @@ } protocol->printDotConfig(); - // save changes to configuration -// logInfo("saving configuration"); -// core_util_critical_section_enter(); -// bool dotConfigSaved = dot->saveConfig(); -// core_util_critical_section_exit(); -// if (!dotConfigSaved) { -// logError("failed to save configuration"); -// } - - // Setup programmable voltage detector - // PVD_LEVEL0 Falling 1.85 - // PVD_LEVEL1 Falling 2.04 - // PVD_LEVEL2 Falling 2.24 - // PVD_LEVEL3 Falling 2.44 - // PVD_LEVEL4 Falling 2.64 - // PVD_LEVEL5 Falling 2.84 - // PVD_LEVEL6 Falling 3.05 -// PWR_PVDTypeDef pvdConfig; -// pvdConfig.Mode = PWR_PVD_MODE_NORMAL; -// pvdConfig.PVDLevel = PWR_PVDLEVEL_5; -// -// HAL_PWR_ConfigPVD(&pvdConfig); -// HAL_PWR_EnablePVD(); -// 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->setWakeMode(mDot::RTC_ALARM_OR_INTERRUPT); dot->setWakePin(GPIO0); // dot->setWakePin(UART_RX);