Commit 58b9f07
authored
HardwareSerial Available For Write (#9319)
* feat(uart): setBufferSize
It makes sure that setting TX buffer size will match availableForWrite() response. It also sets the buffer to the minimum instead of doing nothing and returning an error.
For RX Buffer, it sets the minimum and also don't return an error.
This makes the APIs better and easy to understand its results.
* feat: sets TX buffer
This will allow to set TX buffer to a minimum with no error message.
It also makes it works as in the Arduino API specification that is to return the buffer available space. In ESP32 case it will be the minmum the HW TX FIFO size of 128 bytes.
* feat: adjust availableForWrite
This change will make sure that if no TX Ringbuffer is used, it will return the UART FIFO available space. Otherwise, it will return the Ringbuffer available space, as defined in the Arduino especification.1 parent aed7b4f commit 58b9f07
2 files changed
+12
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
537 | 537 | | |
538 | 538 | | |
539 | 539 | | |
| 540 | + | |
540 | 541 | | |
541 | 542 | | |
542 | 543 | | |
543 | | - | |
| 544 | + | |
544 | 545 | | |
545 | 546 | | |
546 | 547 | | |
547 | 548 | | |
548 | | - | |
549 | | - | |
| 549 | + | |
| 550 | + | |
550 | 551 | | |
551 | 552 | | |
552 | 553 | | |
553 | 554 | | |
554 | 555 | | |
555 | 556 | | |
| 557 | + | |
556 | 558 | | |
557 | 559 | | |
558 | 560 | | |
559 | | - | |
| 561 | + | |
560 | 562 | | |
561 | 563 | | |
562 | 564 | | |
563 | 565 | | |
564 | | - | |
565 | | - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
566 | 569 | | |
567 | | - | |
| 570 | + | |
568 | 571 | | |
569 | | - | |
| 572 | + | |
570 | 573 | | |
571 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
645 | | - | |
| 645 | + | |
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
| |||
0 commit comments