From 548e14cfd6ee03ebb66bcad13648529d4a17f4e4 Mon Sep 17 00:00:00 2001 From: michael-west Date: Fri, 9 Dec 2016 16:15:40 -0800 Subject: GPIO: Set CTRL register before OUT register in GPIO example. --- host/examples/gpio.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/examples/gpio.cpp') diff --git a/host/examples/gpio.cpp b/host/examples/gpio.cpp index 1a1b2982f..02c73e96b 100644 --- a/host/examples/gpio.cpp +++ b/host/examples/gpio.cpp @@ -228,6 +228,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]) //set data direction register (DDR) usrp->set_gpio_attr(gpio, "DDR", ddr, mask); + //set control register + usrp->set_gpio_attr(gpio, "CTRL", ctrl, mask); + //set output values (OUT) usrp->set_gpio_attr(gpio, "OUT", out, mask); @@ -237,9 +240,6 @@ int UHD_SAFE_MAIN(int argc, char *argv[]) usrp->set_gpio_attr(gpio, "ATR_TX", atr_tx, mask); usrp->set_gpio_attr(gpio, "ATR_XX", atr_duplex, mask); - //set control register - usrp->set_gpio_attr(gpio, "CTRL", ctrl, mask); - //print out initial state of FP GPIO std::cout << "\nConfigured GPIO values:" << std::endl; output_reg_values(gpio, usrp, num_bits); -- cgit v1.2.3