From b10d6a42e67f3afa02203a1da0d927333f564710 Mon Sep 17 00:00:00 2001 From: David Gilday Date: Fri, 27 Jun 2014 19:13:08 +0100 Subject: [PATCH] Workaround to support LEGO EV3 Color Sensor in RGB-RAW mode --- lms2012/d_uart/Linuxmod_AM1808/d_uart_mod.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lms2012/d_uart/Linuxmod_AM1808/d_uart_mod.c b/lms2012/d_uart/Linuxmod_AM1808/d_uart_mod.c index 033abac48..c02ad46cc 100644 --- a/lms2012/d_uart/Linuxmod_AM1808/d_uart_mod.c +++ b/lms2012/d_uart/Linuxmod_AM1808/d_uart_mod.c @@ -3113,6 +3113,14 @@ static enum hrtimer_restart Device1TimerInterrupt1(struct hrtimer *pTimer) if (UartPort[Port].InLength) { + // Workaround for LEGO EV3 Color Sensor (type 29) in RGB-RAW mode (4) + // which always appears to generate unexpected CRC errors + if (UartPort[Port].Type == 29 && + UartPort[Port].Mode == 4 && + UartPort[Port].InLength == 8) + { + CrcError = 0; + } if (!CrcError) { if (UartPort[Port].Initialised == 0)