From 8bb6d2a82d6eee52084f8c1c08f575b44706cc1c Mon Sep 17 00:00:00 2001 From: Marek Kraus Date: Tue, 22 Nov 2022 13:59:26 +0100 Subject: [PATCH] Adds LOW_LATENCY config, which is disabled by default This helped with handshake on CH340, but FT232H don't like it. Currently, it is not needed, as current code can work properly both on CH340G but also on FT232H. --- lib/blisp.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/blisp.c b/lib/blisp.c index a80bfa4..f3d94c6 100644 --- a/lib/blisp.c +++ b/lib/blisp.c @@ -1,9 +1,14 @@ #include +#include #include #include #include #include -#include + +#ifdef __linux__ +#include +#include +#endif #define DEBUG @@ -69,6 +74,16 @@ int32_t blisp_device_open(struct blisp_device* device, const char* port_name) // } else { device->current_baud_rate = 500000; // } + +#if 0 + int fd; + sp_get_port_handle(serial_port, &fd); + struct serial_struct serial; + ioctl(fd, TIOCGSERIAL, &serial); +// serial.flags &= ~(ASYNC_LOW_LATENCY); + serial.flags |= ASYNC_LOW_LATENCY; + ioctl(fd, TIOCSSERIAL, &serial); +#endif ret = sp_set_baudrate(serial_port, device->current_baud_rate); if (ret != SP_OK) { return -1; // TODO: Handle this