fix array indexing bug in message_process_cmd

Source buffer was not being incremented properly, so the destination
buffer containing message payload was always msg[0].

BUG=none
TEST=tested on daisy (now keyboard protocol actually shows keys...)

Signed-off-by: David Hendricks <dhendrix@chromium.org>

Change-Id: If5a417291c9bff36bbeb2a87153de80300045257
This commit is contained in:
David Hendricks
2012-04-20 13:37:05 -07:00
parent f99b650a23
commit 66fa2685f0

View File

@@ -83,8 +83,8 @@ int message_process_cmd(int cmd, uint8_t *out_msg, int max_len)
for (i = 0; i < msg_len; i++) {
if (need_copy)
out_msg[i + 3] = *msg;
sum += *msg;
out_msg[i + 3] = msg[i];
sum += msg[i];
}
out_msg[i + 3] = sum & 0xff;
out_msg[i + 4] = MSG_PREAMBLE;