Commit b9268222 authored by Laurent THOMAS's avatar Laurent THOMAS

revert wrong commit on targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp

parent 6fb9f92b
...@@ -272,7 +272,7 @@ static int sync_to_gps(openair0_device *device) { ...@@ -272,7 +272,7 @@ static int sync_to_gps(openair0_device *device) {
*/ */
static int trx_usrp_start(openair0_device *device) { static int trx_usrp_start(openair0_device *device) {
usrp_state_t *s = (usrp_state_t *)device->priv; usrp_state_t *s = (usrp_state_t *)device->priv;
#if 0
// setup GPIO for TDD, GPIO(4) = ATR_RX // setup GPIO for TDD, GPIO(4) = ATR_RX
//set data direction register (DDR) to output //set data direction register (DDR) to output
s->usrp->set_gpio_attr("FP0", "DDR", 0xfff, 0xfff); s->usrp->set_gpio_attr("FP0", "DDR", 0xfff, 0xfff);
...@@ -286,7 +286,6 @@ static int trx_usrp_start(openair0_device *device) { ...@@ -286,7 +286,6 @@ static int trx_usrp_start(openair0_device *device) {
// set the output pins to 1 // set the output pins to 1
s->usrp->set_gpio_attr("FP0", "OUT", 7<<7, 0xf80); s->usrp->set_gpio_attr("FP0", "OUT", 7<<7, 0xf80);
#endif
s->wait_for_first_pps = 1; s->wait_for_first_pps = 1;
s->rx_count = 0; s->rx_count = 0;
s->tx_count = 0; s->tx_count = 0;
...@@ -954,9 +953,14 @@ extern "C" { ...@@ -954,9 +953,14 @@ extern "C" {
LOG_I(HW, "openair0_cfg[0].clock_source == '%d' (internal = %d, external = %d)\n", openair0_cfg[0].clock_source,internal,external); LOG_I(HW, "openair0_cfg[0].clock_source == '%d' (internal = %d, external = %d)\n", openair0_cfg[0].clock_source,internal,external);
usrp_state_t *s ; usrp_state_t *s ;
if ( device->priv == NULL) {
s=(usrp_state_t *)calloc(sizeof(usrp_state_t),1); s=(usrp_state_t *)calloc(sizeof(usrp_state_t),1);
device->priv=s; device->priv=s;
AssertFatal( s!=NULL,"USRP device: memory allocation failure\n"); AssertFatal( s!=NULL,"USRP device: memory allocation failure\n");
} else {
LOG_E(HW, "multiple device init detected\n");
return 0;
}
device->openair0_cfg = openair0_cfg; device->openair0_cfg = openair0_cfg;
device->trx_start_func = trx_usrp_start; device->trx_start_func = trx_usrp_start;
...@@ -996,12 +1000,10 @@ extern "C" { ...@@ -996,12 +1000,10 @@ extern "C" {
if (device_adds.size() == 0) { if (device_adds.size() == 0) {
LOG_E(HW,"No USRP Device Found.\n "); LOG_E(HW,"No USRP Device Found.\n ");
free(s); free(s);
abort();
return -1; return -1;
} else if (device_adds.size() > 1) { } else if (device_adds.size() > 1) {
LOG_E(HW,"More than one USRP Device Found. Please specify device more precisely in config file.\n"); LOG_E(HW,"More than one USRP Device Found. Please specify device more precisely in config file.\n");
free(s); free(s);
abort();
return -1; return -1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment