Skip to content

Commit 6cf28ba

Browse files
Aart-KleinendorstAart Kleinendorst
and
Aart Kleinendorst
authored
added release/LPCCSTASKS-82-fix-printf-output-in-da1459x-i2c-temp-hum-example (#9)
Co-authored-by: Aart Kleinendorst <Aart.Kleinendorst.xz@Renesas.com>
1 parent bc2b3d4 commit 6cf28ba

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

interfaces/i2c_example/i2c_task.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,17 @@ OS_TASK_FUNCTION (i2c_master_task, pvParameters )
116116
HW_I2C_F_ADD_STOP);
117117
OS_EVENT_WAIT(i2c_event, OS_EVENT_FOREVER);
118118
#else
119-
I2C_error_code = ad_i2c_write_read(_master_handle,
120-
_req,
121-
I2C_REQUEST_SIZE,//reduce this to simulate incomplete send
122-
resp,
123-
I2C_RESPONSE_SIZE,
124-
HW_I2C_F_ADD_STOP);
119+
I2C_error_code = ad_i2c_write(_master_handle,
120+
_req,
121+
I2C_REQUEST_SIZE,
122+
HW_I2C_F_ADD_STOP);
123+
124+
vTaskDelayUntil(&xNextWakeTime, OS_TICKS_2_MS(40)); //delay wait as per datasheet
125+
126+
I2C_error_code = ad_i2c_read(_master_handle,
127+
resp,
128+
I2C_RESPONSE_SIZE,
129+
HW_I2C_F_ADD_STOP);
125130
#endif
126131
if(0 == I2C_error_code){
127132
/*

0 commit comments

Comments
 (0)