From b094249ab9625787063c1893a3bc2050546519e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Wed, 26 Apr 2017 21:25:26 +0200 Subject: [PATCH] Read the extra zero byte earlier. I'm not sure if the KL03 bootloader is nondeterministic or what's going on. --- right/src/buspal/command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/right/src/buspal/command.c b/right/src/buspal/command.c index 6e65478..8203968 100644 --- a/right/src/buspal/command.c +++ b/right/src/buspal/command.c @@ -506,6 +506,8 @@ static status_t handle_command_internal(uint8_t *packet, uint32_t packetLength) } else { + uint8_t dst[1]; + peripheral_read(dst, 1); // TODO: Make this more general, so that the extra 0 byte is not expected. // receiving framing paket header if (peripheral_read(rxBuf, sizeof(framing_data_packet_t)) != kStatus_Success) { @@ -513,8 +515,6 @@ static status_t handle_command_internal(uint8_t *packet, uint32_t packetLength) } else { - uint8_t dst[1]; - peripheral_read(dst, 1); // TODO: Make this more general, so that the extra 0 byte is not expected. rxSize = ((framing_data_packet_t *)rxBuf)->length; if (peripheral_read(rxBuf + sizeof(framing_data_packet_t), rxSize) != kStatus_Success)