Skip to content
Snippets Groups Projects
Commit ce854ec3 authored by Christos Gentsos's avatar Christos Gentsos
Browse files

I2C: modify EXT CMD behavior to match exactly that of the normal CMD

parent e6100356
Branches
No related merge requests found
......@@ -69,12 +69,10 @@ static void __xMR I2C_rx_complete(const struct i2c_s_async_descriptor *const des
pec_checksum = crc8_byte(pec_checksum ^ std_cmd_addr);
if (std_cmd_addr == 0xFF) {
std_cmd_addr = 0;
cmd_len = 0;
rx_state = EXT_CMD;
send_ack(descr);
set_cmd(descr, 3);
} else if ((cmd_index = in_addr_space(cmds, std_cmd_addr)) != -1) {
ext_cmd_addr = 0;
cmd_len = 0;
if (*cmds->cmds[cmd_index].data_len < 0)
rx_state = BLK_GET_LEN;
......@@ -127,12 +125,13 @@ static void __xMR I2C_rx_complete(const struct i2c_s_async_descriptor *const des
if (use_pec)
pec_checksum = crc8_byte(pec_checksum ^ ext_cmd_addr);
if ((cmd_index = in_addr_space(ext_cmds, ext_cmd_addr)) != -1) {
send_ack(descr);
set_cmd(descr, 3);
cmd_len = 0;
if (*ext_cmds->cmds[cmd_index].data_len < 0)
rx_state = EXT_BLK_GET_LEN;
else
rx_state = EXT_DATA;
send_ack(descr);
set_cmd(descr, 3);
if (ext_cmds->cmds[cmd_index].a_callback)
ext_cmds->cmds[cmd_index].a_callback();
} else {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment