UART Command Parser Time Manager Data Store for SD Card for stm32l476 [it's not Licensed as BSD/GPLx]
Dependencies: mbed SDFileSystem
Diff: common/DeviceRepeater.cpp
- Revision:
- 9:c81d0df866f5
- Parent:
- 8:b18a8764ecae
- Child:
- 10:db2be22bc2f9
--- a/common/DeviceRepeater.cpp Sat May 11 04:20:42 2019 +0000 +++ b/common/DeviceRepeater.cpp Mon May 13 02:56:39 2019 +0000 @@ -90,6 +90,7 @@ // Device is in DEV_READY /* TODO - add callback for changing READY to RUNNING */ + pDriver->ready2run(); // start Runnig // Device is in DEV_RUNNING @@ -117,10 +118,11 @@ { if (stat != DEV_RUNNING) { /* Delaied Stop */ - if (stat != DEV_REQ_STOP) { + if (stat == DEV_REQ_STOP) { /*****************************************************/ /* TODO - add callback for changing RUNNING to READY */ /*****************************************************/ + pDriver->run2ready(); repeat_remain_sec = 0; stat = DEV_READY; return; @@ -128,11 +130,14 @@ return; } if (repeat_remain_sec > 0) { + repeat_remain_sec--; + } + if (repeat_remain_sec == 0) { /*****************************************************/ /* TODO - kick Senser and send XFD/XDS Data */ /*****************************************************/ /** Sensing and Sending Data **/ - repeat_remain_sec--; + pDriver->exec(pUR->getCurrentUart(), pSds->getFilePointer()); } if (repeat_remain_sec <= 0) { if (repeat_remain_cnt > 0) { @@ -142,6 +147,7 @@ /*****************************************************/ /* TODO - add callback for changing RUNNING to READY */ /*****************************************************/ + pDriver->run2ready(); repeat_remain_sec = 0; stat = DEV_READY; pClock->detach();