diff options
author | Tobias Jahnke <tjahnk@users.noreply.github.com> | 2017-08-23 10:53:41 +0200 |
---|---|---|
committer | Tobias Jahnke <tjahnk@users.noreply.github.com> | 2017-08-23 13:15:10 +0200 |
commit | 620164975a968c4404c96f3e9ed1a7b9a63d6cb6 (patch) | |
tree | 23d80092c94c0b6100b2c8a03be0fc863f27a600 /HAL-afb/HAL_MOST_UNICENS/ucs2-vol/src/device_container.cpp | |
parent | c3d250fbc63c05d7f0ad5c4d95d725a16f3cece4 (diff) |
implements value retransmit and reload on failure
Diffstat (limited to 'HAL-afb/HAL_MOST_UNICENS/ucs2-vol/src/device_container.cpp')
-rw-r--r-- | HAL-afb/HAL_MOST_UNICENS/ucs2-vol/src/device_container.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/src/device_container.cpp b/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/src/device_container.cpp index 4c99c89..f8b1961 100644 --- a/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/src/device_container.cpp +++ b/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/src/device_container.cpp @@ -24,7 +24,7 @@ #include <stddef.h> #include "device_container.h" -#define DEVCONT_TIME_RETRIGGER (uint16_t)100U +#define DEVCONT_TIME_RETRIGGER (uint16_t)30U #define DEVCONT_TIME_NOW (uint16_t)0U #define DEVCONT_TIME_STOP (uint16_t)0xFFFFU @@ -123,13 +123,14 @@ void CDeviceContainer::Update() &OnI2cResult, this)) { - /*Clb_RegisterI2CResultCB(&OnI2cResult, this);*/ this->_tx_busy = true; + error = false; break; } else { error = true; + break; } } } @@ -142,9 +143,11 @@ void CDeviceContainer::Update() void CDeviceContainer::HandleI2cResult(uint8_t result) { - DEVCONT_UNUSED(result); this->_tx_busy = false; - this->RequestService(DEVCONT_TIME_NOW); + if (result == 0) + this->RequestService(DEVCONT_TIME_NOW); + else + this->RequestService(DEVCONT_TIME_RETRIGGER); } void CDeviceContainer::OnI2cResult(uint8_t result, void *obj_ptr) |