This fixes a problem with the Serial UTF-8 decoder. This decoding moves data from char[] buf, into a ByteBuffer inFromSerial, then decodes them into a CharBuffer outToMessage and converts to a char[] to pass on. When the buf read contained just over a full buffer worth of bytes and contained some multi-byte characters, a situation could arise where two decodes were needed to fill up outToMessage, leaving some data in inFromSerial. If in this case no data would be left in buf, decoding would stop until more data came in from serial. This commit fixes this problem by: - Changing the outer loop to continue running when buf is empty, but inFromSerial is not. - Changing the inner loop to run at least once (so it runs when buf is empty, but inFromSerial is no). - Breaking out of the outer loop when no characters were produced (this handles the case where only an incomplete UTF-8 character remains in inFromSerial, which would otherwise prevent the loop from terminating. - Removes a `if (outToMessage.hasRemaining()` check that is now necessarily true if the break was not done. This fixes #9808.
Arduino is an open-source physical computing platform based on a simple I/O board and a development environment that implements the Processing/Wiring language. Arduino can be used to develop stand-alone interactive objects or can be connected to software on your computer (e.g. Flash, Processing and MaxMSP). The boards can be assembled by hand or purchased preassembled; the open-source IDE can be downloaded for free at https://arduino.cc
More info at
Bug reports and technical discussions
-
To report a bug in the software or to request a simple enhancement go to Github Issues
-
More complex requests and technical discussion should go on the Arduino Developers mailing list
-
If you're interested in modifying or extending the Arduino software, we strongly suggest discussing your ideas on the Developers mailing list before starting to work on them. That way you can coordinate with the Arduino Team and others, giving your work a higher chance of being integrated into the official release
Installation
Detailed instructions for installation in popular operating systems can be found at:
- Linux (see also the Arduino playground)
- macOS
- Windows
Credits
Arduino is an open source project, supported by many.
The Arduino team is composed of Massimo Banzi, David Cuartielles, Tom Igoe and David A. Mellis.
Arduino uses GNU avr-gcc toolchain, GCC ARM Embedded toolchain, avr-libc, avrdude, bossac, openOCD and code from Processing and Wiring.
Icon and about image designed by ToDo