From 091515956d87d9e662aa0ee46abfec314a46f1e8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 12 Apr 2016 18:39:21 +1000 Subject: [PATCH] dsm: fixed shadowed variables errors --- src/lib/rc/dsm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/rc/dsm.c b/src/lib/rc/dsm.c index 22aeeddb63..d60f0687a5 100644 --- a/src/lib/rc/dsm.c +++ b/src/lib/rc/dsm.c @@ -231,7 +231,7 @@ dsm_guess_format(bool reset) } int -dsm_config(int dsm_fd) +dsm_config(int fd) { #ifdef GPIO_SPEKTRUM_PWR_EN // enable power on DSM connector @@ -240,15 +240,15 @@ dsm_config(int dsm_fd) int ret = -1; - if (dsm_fd >= 0) { + if (fd >= 0) { struct termios t; /* 115200bps, no parity, one stop bit */ - tcgetattr(dsm_fd, &t); + tcgetattr(fd, &t); cfsetspeed(&t, 115200); t.c_cflag &= ~(CSTOPB | PARENB); - tcsetattr(dsm_fd, TCSANOW, &t); + tcsetattr(fd, TCSANOW, &t); /* initialise the decoder */ dsm_partial_frame_count = 0; @@ -526,7 +526,7 @@ dsm_decode(hrt_abstime frame_time, uint16_t *values, uint16_t *num_values, bool * @return true=decoded raw channel values updated, false=no update */ bool -dsm_input(int dsm_fd, uint16_t *values, uint16_t *num_values, bool *dsm_11_bit, uint8_t *n_bytes, uint8_t **bytes, +dsm_input(int fd, uint16_t *values, uint16_t *num_values, bool *dsm_11_bit, uint8_t *n_bytes, uint8_t **bytes, unsigned max_values) { int ret = 1; @@ -554,7 +554,7 @@ dsm_input(int dsm_fd, uint16_t *values, uint16_t *num_values, bool *dsm_11_bit, * a complete frame. */ - ret = read(dsm_fd, &dsm_buf[0], sizeof(dsm_buf) / sizeof(dsm_buf[0])); + ret = read(fd, &dsm_buf[0], sizeof(dsm_buf) / sizeof(dsm_buf[0])); /* if the read failed for any reason, just give up here */ if (ret < 1) {