File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -360,6 +360,22 @@ class I2cClass {
360
360
setAddress (transConfig_.address );
361
361
362
362
uint32_t quantity = txBuffer_.data ();
363
+ if (quantity == 0 ) {
364
+ // Clear flags
365
+ uint32_t temp = i2cDev_->IC_CLR_TX_ABRT ;
366
+ (void )temp;
367
+ if (i2cDev_->IC_TX_ABRT_SOURCE & 0x00000001 ) {
368
+ return SYSTEM_ERROR_I2C_ABORT;
369
+ }
370
+ // Send the slave address only
371
+ i2cDev_->IC_DATA_CMD = (transConfig_.address << 1 ) | (1 << 11 );
372
+ HAL_Delay_Milliseconds (5 );
373
+ if (i2cDev_->IC_TX_ABRT_SOURCE & 0x00000001 ) {
374
+ return SYSTEM_ERROR_I2C_ABORT;
375
+ }
376
+ return SYSTEM_ERROR_NONE;
377
+ }
378
+
363
379
for (uint32_t i = 0 ; i < quantity; i++) {
364
380
if (!WAIT_TIMED (transConfig_.timeout_ms , I2C_CheckFlagState (i2cDev_, BIT_IC_STATUS_TFNF) == 0 )) {
365
381
reset ();
You can’t perform that action at this time.
0 commit comments