From 7f977da45e50e0bd9d69bd47ba5abfe881430ebb Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Fri, 26 Oct 2018 18:21:05 +0200 Subject: [PATCH] model01: Use a modified CDC.cpp At least for OSX, we need to slow down Serial writes. The easiest way to do that is to add a delay after each write, and to accomplish that, the easiest is to modify `CDC.cpp`. Without this, on OSX, we end up writing too fast (and changing the baud rate does not help, no matter in which direction I change), and end up losing data. This is not a great solution. It's not even a solution, but a workaround. But it works for now. Signed-off-by: Gergely Nagy --- avr/variants/model01/CDC.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/avr/variants/model01/CDC.cpp b/avr/variants/model01/CDC.cpp index 142f8f6..a974095 100644 --- a/avr/variants/model01/CDC.cpp +++ b/avr/variants/model01/CDC.cpp @@ -232,6 +232,7 @@ size_t Serial_::write(const uint8_t *buffer, size_t size) if (_usbLineInfo.lineState > 0) { int r = USB_Send(CDC_TX,buffer,size); if (r > 0) { + delay(5); return r; } else { setWriteError();