Skip to content

Commit 81861d0

Browse files
author
Zim Kalinowski
committed
Merge branch 'bugfix/fix_i2c_crash_v4.4' into 'release/v4.4'
I2C: Fix I2C Master operation with repeated start condition (backport v4.4) See merge request espressif/esp-idf!17118
2 parents 33f7009 + f60a914 commit 81861d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

components/driver/i2c.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,9 @@ static void IRAM_ATTR i2c_master_cmd_begin_static(i2c_port_t i2c_num)
13421342
p_i2c->cmd_idx = 0;
13431343
if (i2c_cmd_is_single_byte(cmd) || cmd->total_bytes == cmd->bytes_used) {
13441344
p_i2c->cmd_link.head = p_i2c->cmd_link.head->next;
1345-
p_i2c->cmd_link.head->cmd.bytes_used = 0;
1345+
if(p_i2c->cmd_link.head) {
1346+
p_i2c->cmd_link.head->cmd.bytes_used = 0;
1347+
}
13461348
}
13471349
p_i2c->status = I2C_STATUS_WRITE;
13481350
break;

0 commit comments

Comments
 (0)