mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
Use GPIO flag and fix bug
This commit is contained in:
@@ -160,6 +160,12 @@ typedef enum {
|
||||
TX_BURST_END_NO_TIME_SPEC = 10,
|
||||
} radio_tx_burst_flag_t;
|
||||
|
||||
/*! \brief Radio TX GPIO flags: MSB to enable sending GPIO command, 12 LSB carry GPIO values */
|
||||
typedef enum {
|
||||
/* first 12 bits reserved for beams */
|
||||
TX_GPIO_CHANGE = 0x1000,
|
||||
} radio_tx_gpio_flag_t;
|
||||
|
||||
/*! \brief Structure used for initializing UDP read threads */
|
||||
typedef struct {
|
||||
openair0_device *device;
|
||||
@@ -317,7 +323,7 @@ typedef struct {
|
||||
int cc;
|
||||
signed char first_packet;
|
||||
signed char last_packet;
|
||||
int flags_gpio;
|
||||
radio_tx_gpio_flag_t flags_gpio;
|
||||
} openair0_write_package_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -390,7 +390,7 @@ static int trx_usrp_write(openair0_device *device,
|
||||
int nsamps2; // aligned to upper 32 or 16 byte boundary
|
||||
|
||||
radio_tx_burst_flag_t flags_burst = (radio_tx_burst_flag_t) (flags & 0xf);
|
||||
int flags_gpio = (flags>>4)&0x1fff; //MSB to enable sending GPIO command, 12 LSB carry GPIO values
|
||||
radio_tx_gpio_flag_t flags_gpio = (radio_tx_gpio_flag_t) ((flags >> 4) & 0x1fff);
|
||||
|
||||
int end;
|
||||
openair0_thread_t *write_thread = &device->write_thread;
|
||||
@@ -466,7 +466,7 @@ static int trx_usrp_write(openair0_device *device,
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_BEAM_SWITCHING_GPIO,1);
|
||||
// bit 13 enables gpio
|
||||
if (flags_gpio&0x1000) {
|
||||
if ((flags_gpio & TX_GPIO_CHANGE) != 0) {
|
||||
// push GPIO bits
|
||||
s->usrp->set_command_time(s->tx_md.time_spec);
|
||||
s->usrp->set_gpio_attr(s->gpio_bank, "OUT", flags_gpio, MAN_MASK);
|
||||
|
||||
Reference in New Issue
Block a user