aboutsummaryrefslogtreecommitdiffstats
path: root/ucs2-interface
diff options
context:
space:
mode:
authorTobias Jahnke <tjahnk@users.noreply.github.com>2017-08-23 16:59:36 +0200
committerTobias Jahnke <tjahnk@users.noreply.github.com>2017-08-23 16:59:36 +0200
commit81124d50004ee8c0a141771c4b59a79b1a9ec4f1 (patch)
treeb66fc134e967b97191643275def82f862a7593b0 /ucs2-interface
parent852f83844416d399d8efd111da2dd0d4c5580980 (diff)
initialze muted, improved trace on i2c failure
Diffstat (limited to 'ucs2-interface')
-rw-r--r--ucs2-interface/ucs_lib_interf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ucs2-interface/ucs_lib_interf.c b/ucs2-interface/ucs_lib_interf.c
index 9e7167d..ad256e3 100644
--- a/ucs2-interface/ucs_lib_interf.c
+++ b/ucs2-interface/ucs_lib_interf.c
@@ -174,6 +174,7 @@ bool UCSI_ProcessRxData(UCSI_Data_t *my,
void UCSI_Service(UCSI_Data_t *my)
{
+ Ucs_Return_t ret;
UnicensCmdEntry_t *e;
bool popEntry = true; /*Set to false in specific case, where function will callback asynchrony.*/
assert(MAGIC == my->magic);
@@ -218,12 +219,13 @@ void UCSI_Service(UCSI_Data_t *my)
UCSI_CB_OnUserMessage(my->tag, true, "UnicensCmd_GpioWritePort failed", 0);
break;
case UnicensCmd_I2CWrite:
- if (UCS_RET_SUCCESS == Ucs_I2c_WritePort(my->unicens, e->val.I2CWrite.destination, 0x0F00,
+ ret = Ucs_I2c_WritePort(my->unicens, e->val.I2CWrite.destination, 0x0F00,
(e->val.I2CWrite.isBurst ? UCS_I2C_BURST_MODE : UCS_I2C_DEFAULT_MODE), e->val.I2CWrite.blockCount,
- e->val.I2CWrite.slaveAddr, e->val.I2CWrite.timeout, e->val.I2CWrite.dataLen, e->val.I2CWrite.data, OnUcsI2CWrite))
+ e->val.I2CWrite.slaveAddr, e->val.I2CWrite.timeout, e->val.I2CWrite.dataLen, e->val.I2CWrite.data, OnUcsI2CWrite);
+ if (UCS_RET_SUCCESS == ret)
popEntry = false;
else {
- UCSI_CB_OnUserMessage(my->tag, true, "Ucs_I2c_WritePort failed", 0);
+ UCSI_CB_OnUserMessage(my->tag, true, "Ucs_I2c_WritePort failed ret=%d", 1, ret);
assert(e->val.I2CWrite.result_fptr != NULL);
e->val.I2CWrite.result_fptr(NULL /*processing error*/, e->val.I2CWrite.request_ptr);
}