diff --git a/gbser.cc b/gbser.cc index bda793e52..0f9e98423 100644 --- a/gbser.cc +++ b/gbser.cc @@ -44,67 +44,6 @@ int gbser_set_speed(void* handle, unsigned speed) return gbser_set_port(handle, speed, 8, 0, 1); } -static int parity_letter(char c) -{ - switch (c) { - case 'N': - case 'n': - return 0; - case 'O': - case 'o': - return 1; - case 'E': - case 'e': - return 2; - default: - return -1; - } -} - -/* Set the serial port up by parsing the supplied parameter string. - * Valid parameter strings look like '4800,8,N,1'. Parsing is case- - * insensitive, spaces are allowed around the commas and omitted - * trailing fields will default to '8', 'N' and '1' - */ -int gbser_setup(void* handle, const char* spec) -{ - unsigned arg[] = { 4800, 8, 0, 1 }; - - for (unsigned int ap = 0; ap < sizeof(arg) / sizeof(arg[0]); ap++) { - unsigned t = 0; - int pl; - while (isspace(*spec)) { - spec++; - } - /* Allow 'N', 'O' or 'E' as the parity spec */ - if (ap == 2 && (pl = parity_letter(*spec), pl >= 0)) { - t = pl; - spec++; - } else { - if (!isdigit(*spec)) { - break; - } - while (isdigit(*spec)) { - t = t * 10 + *spec++ - '0'; - } - } - arg[ap] = t; - while (isspace(*spec)) { - spec++; - } - if (*spec != ',') { - break; - } - spec++; - } - - if (*spec != '\0') { - return gbser_ERROR; - } - - return gbser_set_port(handle, arg[0], arg[1], arg[2], arg[3]); -} - /* Return true if there are characters available on the serial port */ int gbser_avail(void* handle) diff --git a/gbser.h b/gbser.h index d6b332a5d..8c73480ed 100644 --- a/gbser.h +++ b/gbser.h @@ -56,13 +56,6 @@ int gbser_set_port(void* handle, unsigned speed, unsigned parity, unsigned stop); -/* Set the serial port up by parsing the supplied parameter string. - * Valid parameter strings look like '4800,8,N,1'. Parsing is case- - * insensitive, spaces are allowed around the commas and omitted - * trailing fields will default to '8', 'N' and '1' - */ -int gbser_setup(void* handle, const char* spec); - /* Return true if there are characters available on the serial port */ int gbser_avail(void* handle); diff --git a/gbser_private.h b/gbser_private.h index 568d6314b..e69de4db2 100644 --- a/gbser_private.h +++ b/gbser_private.h @@ -25,6 +25,6 @@ #define BUFSIZE 512 void gbser_db(int l, const char* msg, ...); -int gbser_fill_buffer(void* h, unsigned want, unsigned* ms); +int gbser_fill_buffer(void* handle, unsigned want, unsigned* ms); unsigned gbser_read_buffer(void* handle, void** buf, unsigned* len); #endif // GBSER_PRIVATE_H_ diff --git a/gbser_win.cc b/gbser_win.cc index 3a19406a2..0fd08e719 100644 --- a/gbser_win.cc +++ b/gbser_win.cc @@ -141,7 +141,7 @@ static int set_rx_timeout(gbser_handle* h, DWORD timeout) * * Worse still, Win98 and ME fail the open if you rename com1 to be \\.\\com1: * - * It returns a pointer to a staticly allocated buffer and is therefore not + * It returns a pointer to a statically allocated buffer and is therefore not * thread safe. The buffer pointed to remains valid only until the next * call to this function. */