summaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorNicholas Corgan <nick.corgan@ettus.com>2013-03-25 14:03:46 -0700
committerJosh Blum <josh@joshknows.com>2013-03-26 14:22:15 -0700
commit64db4563fd19b2211e814490a30d3d95204467e2 (patch)
tree7164da35f60e036c7e441a220b3378f45850c6ae /host
parentaa8bba40c142b6f038d55b7f81c829b6c9f1b1eb (diff)
downloaduhd-64db4563fd19b2211e814490a30d3d95204467e2.tar.gz
uhd-64db4563fd19b2211e814490a30d3d95204467e2.tar.bz2
uhd-64db4563fd19b2211e814490a30d3d95204467e2.zip
utils: usrp_n2xx_simple_net_burner now has option to automatically reboot
Diffstat (limited to 'host')
-rw-r--r--host/utils/usrp_n2xx_simple_net_burner.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/host/utils/usrp_n2xx_simple_net_burner.cpp b/host/utils/usrp_n2xx_simple_net_burner.cpp
index 901842538..9f5700d9b 100644
--- a/host/utils/usrp_n2xx_simple_net_burner.cpp
+++ b/host/utils/usrp_n2xx_simple_net_burner.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2012 Ettus Research LLC
+// Copyright 2012-2013 Ettus Research LLC
//
// 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
@@ -368,6 +368,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("fpga", po::value<std::string>(&fpga_path), "Specify a filepath for a custom FPGA image.")
("no_fw", "Do not burn a firmware image.")
("no_fpga", "Do not burn an FPGA image.")
+ ("auto_reboot", "Automatically reboot N2XX without prompting.")
("list", "List available N2XX USRP devices.")
;
po::variables_map vm;
@@ -388,6 +389,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
bool use_custom_fpga = (vm.count("fpga") > 0);
bool use_custom_fw = (vm.count("fw") > 0);
bool list_usrps = (vm.count("list") > 0);
+ bool auto_reboot = (vm.count("auto_reboot") > 0);
if(!burn_fpga && !burn_fw){
std::cout << "No images will be burned." << std::endl;
@@ -501,16 +503,19 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
verify_image(udp_transport, true, fw_image, flash_info[1], fw_image_size);
}
- //Prompt user to reset USRP
- std::string user_response = "foo";
- bool reset = false;
- while(user_response != "y" and user_response != "" and user_response != "n"){
- std::cout << std::endl << "Image burning successful. Reset USRP (Y/n)? ";
- std::getline(std::cin, user_response);
- std::transform(user_response.begin(), user_response.end(), user_response.begin(), ::tolower);
- reset = (user_response == "" or user_response == "y");
+ //Reset USRP N2XX
+ bool reset;
+ if(auto_reboot) reset = true;
+ else{
+ std::string user_response = "foo";
+ while(user_response != "y" and user_response != "" and user_response != "n"){
+ std::cout << std::endl << "Image burning successful. Reset USRP (Y/n)? ";
+ std::getline(std::cin, user_response);
+ std::transform(user_response.begin(), user_response.end(), user_response.begin(), ::tolower);
+ reset = (user_response == "" or user_response == "y");
+ }
+ std::cout << std::endl; //Formatting
}
- std::cout << std::endl; //Formatting
if(reset) reset_usrp(udp_transport);
else return EXIT_SUCCESS;