Hello, I have two changes I made to libftdi fork I'm using internally in my project. It's nothing huge, but still worth sharing and definitely easier for me if merged upstream. Please take a look at the attached patches.
libftdi-constargs.patch fixes warnings when I try to pass `const char*` to ftdi_eeprom_initdefaults. libftdi-nologspam.patch removes a printf that spams stderr when trying to flash FT232H eeprom. Thanks for supporting this library, Tomasz Wasilczyk -- libftdi - see http://www.intra2net.com/en/developer/libftdi for details. To unsubscribe send a mail to [email protected]
From c6009c8604fb6ecf8ed6fc3615a076184e5f3d78 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk <[email protected]> Date: Thu, 11 Mar 2021 15:47:06 -0800 Subject: [PATCH] ftdi_eeprom_initdefaults don't need to modify its arguments --- src/ftdi.c | 4 ++-- src/ftdi.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ftdi.c b/src/ftdi.c index 03d7b07..6663ee2 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2576,8 +2576,8 @@ int ftdi_set_error_char(struct ftdi_context *ftdi, \retval -2: No struct ftdi_eeprom \retval -3: No connected device or device not yet opened */ -int ftdi_eeprom_initdefaults(struct ftdi_context *ftdi, char * manufacturer, - char * product, char * serial) +int ftdi_eeprom_initdefaults(struct ftdi_context *ftdi, const char * manufacturer, + const char * product, const char * serial) { struct ftdi_eeprom *eeprom; diff --git a/src/ftdi.h b/src/ftdi.h index fb45008..0603335 100644 --- a/src/ftdi.h +++ b/src/ftdi.h @@ -609,8 +609,8 @@ extern "C" /* init eeprom for the given FTDI type */ int ftdi_eeprom_initdefaults(struct ftdi_context *ftdi, - char * manufacturer, char *product, - char * serial); + const char * manufacturer, const char *product, + const char * serial); int ftdi_eeprom_build(struct ftdi_context *ftdi); int ftdi_eeprom_decode(struct ftdi_context *ftdi, int verbose); -- 2.31.0.rc2.261.g7f71774620-goog
From ce7f6fb68ae35ee0be12cd5604b8db48593ae0bb Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk <[email protected]> Date: Thu, 11 Mar 2021 15:43:12 -0800 Subject: [PATCH] Don't spam stderr when flashing FT232H eeprom --- src/ftdi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ftdi.c b/src/ftdi.c index 03d7b07..db66b87 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -3421,7 +3421,7 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi) set_ft232h_cbus(eeprom, output); output[0x1e] = eeprom->chip; - fprintf(stderr,"FIXME: Build FT232H specific EEPROM settings\n"); + /* FIXME: Build FT232H specific EEPROM settings */ break; case TYPE_230X: output[0x00] = 0x80; /* Actually, leave the default value */ -- 2.31.0.rc2.261.g7f71774620-goog
