diff options
author | David Hendricks <dhendrix@chromium.org> | 2012-04-20 13:46:04 -0700 |
---|---|---|
committer | David Hendricks <dhendrix@chromium.org> | 2012-04-23 10:56:12 -0700 |
commit | 9b942e570c058380cfbb57748c6bc093aa83bc9a (patch) | |
tree | 01044f607d594b1f59a326f214164e5c63d3c6d4 | |
parent | ff8926b5e357fe4cc82473af7603f3d273d1971a (diff) | |
download | chrome-ec-9b942e570c058380cfbb57748c6bc093aa83bc9a.tar.gz |
stm32l: fix length argument for i2c writes
Pass the actual msg_len instead of the maximum outbound message size.
BUG=none
TEST=tested on daisy using logic analyzer (notes below)
Beforehand, the output on a logic analyzer looked sane until the last
bits and stop condition, after which the bus appeared to go haywire
and the system would reset. I'm guessing that this is due to the EC
trying to drive SDA line while the host is holding SCL high.
Change-Id: I1afa520d858905a571540341fe02f374dcdf43c1
Signed-off-by: David Hendricks <dhendrix@chromium.org>
-rw-r--r-- | chip/stm32l/i2c.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/chip/stm32l/i2c.c b/chip/stm32l/i2c.c index ccf7dba63e..0c4aff57de 100644 --- a/chip/stm32l/i2c.c +++ b/chip/stm32l/i2c.c @@ -116,7 +116,7 @@ void i2c2_work_task(void) msg_len = message_process_cmd(i2c_xmit_mode[I2C2], out_msg, sizeof(out_msg)); if (msg_len > 0) { - i2c_write_raw(I2C2, out_msg, sizeof(out_msg)); + i2c_write_raw(I2C2, out_msg, msg_len); } else { uart_printf("%s: unexpected mode %u\n", __func__, i2c_xmit_mode[I2C2]); |