![](/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/inc/SerialTermMgr.h
- Revision:
- 77:176e3eb8f712
- Parent:
- 76:d1b20a259d8f
- Child:
- 78:43f074baac34
--- a/xDotBridge/inc/SerialTermMgr.h Tue May 16 15:15:58 2017 -0600 +++ b/xDotBridge/inc/SerialTermMgr.h Wed May 17 16:41:56 2017 -0600 @@ -9,13 +9,16 @@ #define XDOTBRIDGE_INC_SERIALTERMMGR_H_ #include "mbed.h" +#include "BufferedSerial.h" +#include "WinbondSPIFlash.h" #include "BaseboardIO.h" const uint32_t TERM_BAUD = 115200; const uint8_t TERM_TIMEOUT = 30; // In seconds const float XMODEM_TIMEOUT = 10.0; -const uint8_t FLASH_BIN_OFFSET = 0x20; // Skip first 32 bytes +const uint16_t FLASH_BIN_OFFSET = 256; // Skip first flash page +const uint16_t XMODEM_PACKET_SIZE = 128; enum ScreenId { mainScreenId, @@ -35,7 +38,8 @@ ScreenId mCurrScreen; // Current selection float mFwVersion; BaseboardIO *mBbio; // Handle for reading states - Serial *mPc; + BufferedSerial *mPc; + WinbondSPIFlash *mFlash; bool inputMainPage(char in); void printMainScreen(); @@ -45,8 +49,8 @@ void printEnterProgMode(); bool xmodem2Flash(); public: - SerialTermMgr(BaseboardIO *bbio, float fwVersion); - void regSerial (Serial *pc) { + SerialTermMgr(BaseboardIO *bbio, WinbondSPIFlash *flash, float fwVersion); + void regSerial (BufferedSerial *pc) { mPc = pc; } ScreenId getCurrentScreenId() {