![]() ![]() I must admit I had thought the TX serial was buffered untill I saw this thread but I spotted and understood the problem and am capable of doing a crood fix. I had not figured out the IRQ for feeding it so did so as a timer a very crude fix but a fix none the less. I wrote my own ring buffer code effectively making a virtual com port which in turn fed the real serial port 1 character at a time thus stopping the blocking. I’ve not looked at you code, but what happens if they print more than a buffers worth? I presume it blocks until just 1 buffer’s worth is left, and then continues ? (Sorry not had chance to review the code yet) However I suspect the majority of people will prefer to have this even if it means they loose some RAM Arduino.h and add the define in there if they wanted to have a TX buffer, in which case we should probably allow the size to be set, e.g. Or the user could just edit one of the core headers e.g. Or alternatively, overload Serial.begin to add an additional argument to enable TX buffering. ![]() DUSE_SERIAL_TX_BUFFER=1 and then have an option menu in boards.txt that set flags that were picked up by platform.txt The only way to control it would either be to add something into the compiler directives e.g. I recall trying to do something similar to prevent the SPI class getting instantiated at all, but it didnt work, because those definitions would need to be in a header that is read in my the core. I have a feeling that defines in the sketch do not get picked up by the core code. I modded your code so I could see what effect baud rate has on the speed. IDE is 1.6.9 and core is up to date.Ĭode generally runs 7x faster, until I hit “Serial.prints”. I’m using serial upload with the built-in loader. I’ve tried both Serial and Serial1 and get the same results. I can’t seem to figure out why this code takes 6617us on the blue pill and takes 2472us on an UNO. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |