aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples/gpio.cpp
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-11-18 09:38:08 -0800
committerMartin Braun <martin.braun@ettus.com>2019-11-26 12:21:34 -0800
commit9742e8ede5e35d535ab866a3a8884d14ff1df3b7 (patch)
tree77fe987711753979a649909a788d4e45a9dd9e85 /host/examples/gpio.cpp
parentcd4b1bcd6458b307512ef1249d28a6efe7e70ec8 (diff)
downloaduhd-9742e8ede5e35d535ab866a3a8884d14ff1df3b7.tar.gz
uhd-9742e8ede5e35d535ab866a3a8884d14ff1df3b7.tar.bz2
uhd-9742e8ede5e35d535ab866a3a8884d14ff1df3b7.zip
examples: gpio: Fix minor issues
- Use GPIO_BIT(x) instead of 1<<x where appropriate - Correctly use rx_buff/tx_buff in recv/send, respectively
Diffstat (limited to 'host/examples/gpio.cpp')
-rw-r--r--host/examples/gpio.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/host/examples/gpio.cpp b/host/examples/gpio.cpp
index 98471fc53..ccb5eb54e 100644
--- a/host/examples/gpio.cpp
+++ b/host/examples/gpio.cpp
@@ -320,7 +320,7 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
// test user controlled GPIO and ATR idle by setting bit 4 high for 1 second
std::cout << "\nTesting user controlled GPIO and ATR idle output..."
<< std::flush;
- usrp->set_gpio_attr(gpio, "OUT", 1 << 4, 1 << 4);
+ usrp->set_gpio_attr(gpio, "OUT", GPIO_BIT(4), GPIO_BIT(4));
stop_time = usrp->get_time_now() + dwell_time;
while (not stop_signal_called and usrp->get_time_now() < stop_time) {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
@@ -411,9 +411,9 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
stop_time = usrp->get_time_now() + dwell_time;
while (not stop_signal_called and usrp->get_time_now() < stop_time) {
try {
- tx_stream->send(rx_buffs, nsamps_per_buff, tx_md, timeout);
+ tx_stream->send(tx_buffs, nsamps_per_buff, tx_md, timeout);
tx_md.start_of_burst = false;
- rx_stream->recv(tx_buffs, nsamps_per_buff, rx_md, timeout);
+ rx_stream->recv(rx_buffs, nsamps_per_buff, rx_md, timeout);
} catch (...) {
}
}