-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Serial.AvailableForWrite missing in IDE 1.6.8 for MKR1000 #5006
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This sounds like a problem to report with the MKR1000 maintainers, I do not believe that that is part of the official Arduino IDE? |
It is indeed part of Arduino's documented Serial API. Every board should support it. https://www.arduino.cc/en/Serial/AvailableForWrite For boards without serial transmit buffering, a value of 0 or 1 should be returned, depending on the hardware bit that indicates if the port's buffer can accept the next byte. |
I agree with @PaulStoffregen's assessment, currently the SAMD core does not have serial transmit buffering, arduino/ArduinoCore-samd#33 is open to track this, and I've submitted arduino/ArduinoCore-samd#58 to resolve it. I'll open a PR shortly for a simpler change to implement |
I've submitted arduino/ArduinoCore-samd#146 to cover the hardware serial on SAMD. However, this will only add it for I've noticed the CDC implementation in both the SAM and SAMD core's are also missing Any thoughts on this? |
Heh, seems I totally missed that the MKR1000 board by Arduino. Scratch my comment :-) |
The AVR with on-chip USB hardware has a small dedicated memory for USB packet buffers. Atmel calls it "DPRAM" in their datasheets. It's completely separate from normal AVR memory and not addressable in any way other than special FIFO registers in the USB hardware. The FIFO registers work based on other registers which configure the allocation of this special memory among all the USB endpoints. Even within that small special memory, the entire space can't ever be allocated to any particular endpoint. Different AVR USB chips support different numbers of endpoints and have varying rules for how the this memory can be allocated to them. Any attempt to change availableForWrite() needs to very carefully consider these hardware limitations.... |
After discussing this with @cmaglie, we've decided the SAM and SAMD Since both implementation flush the bank on write, the return value will be the |
I've submitted the PR's:
One note, the AVR version of |
The Serial library for MKR1000 using IDE 1.6.8 seems to be missing the function AvailableForWrite. Confirmation or refutation requested.
The text was updated successfully, but these errors were encountered: