However, it is slow - in current ChibiOS code I get about 6 kB/s.
The patch below is a simple modification that handles serial interrupts in loop until the buffer is fully processed.
Operating system will usually combine the multiple 1-byte writes into a single TCP packet.
With the patch and 256 byte serial buffer size I get 300 kB/s transfer speed.
Code: Select all
diff --git a/os/hal/ports/simulator/posix/hal_lld.c b/os/hal/ports/simulator/posix/hal_lld.c
index 29eb30659..71fb82011 100755
--- a/os/hal/ports/simulator/posix/hal_lld.c
+++ b/os/hal/ports/simulator/posix/hal_lld.c
@@ -73,7 +73,7 @@ void _sim_check_for_interrupts(void) {
bool int_occurred = false;
#if HAL_USE_SERIAL
- if (sd_lld_interrupt_pending()) {
+ while (sd_lld_interrupt_pending()) {
int_occurred = true;
}
#endif
diff --git a/os/hal/ports/simulator/win32/hal_lld.c b/os/hal/ports/simulator/win32/hal_lld.c
index 541b0f000..c967971ba 100644
--- a/os/hal/ports/simulator/win32/hal_lld.c
+++ b/os/hal/ports/simulator/win32/hal_lld.c
@@ -79,7 +79,7 @@ void _sim_check_for_interrupts(void) {
bool int_occurred = false;
#if HAL_USE_SERIAL
- if (sd_lld_interrupt_pending()) {
+ while (sd_lld_interrupt_pending()) {
int_occurred = true;
}
#endif