From 42fe39ece57c5467fb4ffb9964e0b511d1e8b223 Mon Sep 17 00:00:00 2001 From: Rakesh Date: Tue, 8 Sep 2020 22:43:42 +0200 Subject: [PATCH] moving gpio control to the rx --- executables/nr-ru.c | 2 +- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/executables/nr-ru.c b/executables/nr-ru.c index 969ad21b8e..c2b5b80d31 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -747,7 +747,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { // the beam index is written in bits 8-10 of the flags // bit 11 enables the gpio programming int beam=0; - if (slot==0) beam = 11; //3 for boresight & 8 to enable + //if (slot==0) beam = 11; //3 for boresight & 8 to enable /* if (slot==0 || slot==40) beam=0&8; if (slot==10 || slot==50) beam=1&8; diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 6e94717a6f..4c27dc8ebb 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -69,7 +69,7 @@ /** @addtogroup _USRP_PHY_RF_INTERFACE_ * @{ */ - +int gpio789=0; extern int usrp_tx_thread; @@ -708,6 +708,12 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp s->rx_timestamp = s->rx_md.time_spec.to_ticks(s->sample_rate); *ptimestamp = s->rx_timestamp; + // push GPIO bits 7-9 from flags_msb + s->usrp->set_command_time(uhd::time_spec_t::from_ticks((s->rx_timestamp+(2*nsamps)),s->sample_rate)); + s->usrp->set_gpio_attr("FP0", "OUT", gpio789<<7, 0x380); + s->usrp->clear_command_time(); + gpio789 = (gpio789+1)&7; + if (device->recplay_state != NULL) { // record mode // Copy subframes to memory (later dump on a file) if (device->recplay_state->nb_samples < device->openair0_cfg->recplay_conf->u_sf_max) {