You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to send some frames, about 60bytes in length. My mcu was not sending, because the AvailableForWrite() non-blocking limit on the Teensy 3.2 is 39 bytes.
What is the correct way to overcome this? I just overrode the limit and returned 1000UL available for write.
Thanks for the help and the great algorithm!
Tim
The text was updated successfully, but these errors were encountered:
OK, so AvailableForWrite is an Arduino call that says how much space there is in its internal buffer. If your platform only has 39 bytes then a 60 byte frame isn't going to fit and if you lie to MIN and say there's space then the Arduino buffer will overflow. I'm not sure how Arduino will handle overflows, though. So what you could do is create your own buffering scheme on top.
How it could work is that you create your own FIFO code in software, with a static buffer, and then report back to MIN not the space in the Arduino buffer but the space in your software FIFO (there's code in MIN to do a simple FIFO you could base it on - a power-of-2 sized FIFO can be implemented quite easily). Then in periodic polling function you check to see how much space there is in the Arduino buffer (using AvailableForWrite and move up to that much out of your software FIFO into the Arduino software.
I'm trying to send some frames, about 60bytes in length. My mcu was not sending, because the AvailableForWrite() non-blocking limit on the Teensy 3.2 is 39 bytes.
What is the correct way to overcome this? I just overrode the limit and returned 1000UL available for write.
Thanks for the help and the great algorithm!
Tim
The text was updated successfully, but these errors were encountered: