Missing Serial.write(buf,len)

A shrunk down Leonardo-compatible board, thumb drive sized with native USB support. [Product info]
Post Reply
noisymime
Posts: 5
Joined: Mon Jul 08, 2013 1:25 pm

Missing Serial.write(buf,len)

Post by noisymime » Mon Jul 08, 2013 1:30 pm

Not sure if you guys are after bug type reports, but I came across an odd one tonight when trying to use:

Code: Select all

Serial.write(buf,len)
(As documented at: http://arduino.cc/en/Serial/Write)

After much toying around, it appears as though this function hasn't been included in the LeoSticks libs. The solution seems easy enough, the following lines need to be added to the USBAPI.h file where the Serial class is defined:

Code: Select all

using Print::write; // pull in write(str) and write(buf, size) from Print
operator bool();
These lines were taken from the Leonardo version of USBAPI.h

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: Missing Serial.write(buf,len)

Post by angusgr » Tue Jul 16, 2013 10:45 pm

Thanks for posting the bug noisymime, will hopefully help anyone else who sees this same problem.

I'm guessing you're using LeoStick V1? There are quite a few shortcomings in that profile compared to V2 which uses the same "core" as the Leonardo (ie the one provided with the Arduino IDE, rather than the separate files provided by us.) This is because LeoStick V1 came out before the final Leonardo release, so it's "beta" firmware.

If you continue noticing these little problems then the best long term solution is to reflash the bootloader to V2.

Cheers,

Angus

Post Reply