From c93314026c316a4aa4f4df8002c642882360e7a4 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 31 Jan 2014 15:10:52 +0100 Subject: [PATCH] Use the same standard baudrate for all models. The Mares Icon HD use a processor with integrated USB circuit, which presents itself to the host system as a CDC-ACM device. Since there is no external usb-serial chip involved, the baudrate and other serial line parameters are irrelevant. By choosing the same settings as the later models, which do use an usb-serial chip, we can completely avoid the problem of unresponsive devices due to using the wrong baudrate. --- src/mares_iconhd.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/mares_iconhd.c b/src/mares_iconhd.c index 5e09ea3..52305c1 100644 --- a/src/mares_iconhd.c +++ b/src/mares_iconhd.c @@ -37,12 +37,6 @@ rc == -1 ? DC_STATUS_IO : DC_STATUS_TIMEOUT \ ) -#if defined(_WIN32) || defined(__APPLE__) -#define BAUDRATE 256000 -#else -#define BAUDRATE 230400 -#endif - #define MATRIX 0x0F #define ICONHD 0x14 #define ICONHDNET 0x15 @@ -290,12 +284,8 @@ mares_iconhd_device_open (dc_device_t **out, dc_context_t *context, const char * return DC_STATUS_IO; } - // Set the serial communication protocol (256000 8N1). - if (model == NEMOWIDE2 || model == MATRIX || model == PUCKPRO || model == PUCK2) { - rc = serial_configure (device->port, 115200, 8, SERIAL_PARITY_EVEN, 1, SERIAL_FLOWCONTROL_NONE); - } else { - rc = serial_configure (device->port, BAUDRATE, 8, SERIAL_PARITY_NONE, 1, SERIAL_FLOWCONTROL_NONE); - } + // Set the serial communication protocol (115200 8E1). + rc = serial_configure (device->port, 115200, 8, SERIAL_PARITY_EVEN, 1, SERIAL_FLOWCONTROL_NONE); if (rc == -1) { ERROR (context, "Failed to set the terminal attributes."); serial_close (device->port);