]> sigrok.org Git - libsigrok.git/blobdiff - hardware/common/serial.c
hantek-dso: fix channel selection
[libsigrok.git] / hardware / common / serial.c
index 332cb587cd1a6678f3d89636e406965bfc971a6d..cd7002b8345d8be7e76d6624e7cac8a39fafa14f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the sigrok project.
  *
- * Copyright (C) 2010 Bert Vermeulen <bert@biot.com>
+ * Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -190,7 +190,7 @@ SR_PRIV void serial_restore_params(int fd, void *backup)
  * flowcontrol: 1 = rts/cts, 2 = xon/xoff
  * parity: 0 = none, 1 = even, 2 = odd
  */
-SR_PRIV int serial_set_params(int fd, int speed, int bits, int parity,
+SR_PRIV int serial_set_params(int fd, int baudrate, int bits, int parity,
                              int stopbits, int flowcontrol)
 {
 #ifdef _WIN32
@@ -201,8 +201,7 @@ SR_PRIV int serial_set_params(int fd, int speed, int bits, int parity,
                return SR_ERR;
        }
 
-       /* TODO: Rename 'speed' to 'baudrate'. */
-       switch(speed) {
+       switch (baudrate) {
        /* TODO: Support for higher baud rates. */
        case 115200:
                dcb.BaudRate = CBR_115200;
@@ -235,7 +234,7 @@ SR_PRIV int serial_set_params(int fd, int speed, int bits, int parity,
        struct termios term;
        speed_t baud;
 
-       switch (speed) {
+       switch (baudrate) {
        case 9600:
                baud = B9600;
                break;