Use TX Burst enum consistently

- By convention, enums are uppercase in C
- Use it everywhere
This commit is contained in:
Robert Schmidt
2023-01-19 14:32:01 +01:00
parent faba9ac244
commit 72460cec61
7 changed files with 38 additions and 37 deletions
+7 -5
View File
@@ -152,11 +152,13 @@ typedef enum {
/*! \brief Radio Tx burst flags */
typedef enum {
Invalid = 0,
MiddleOfBurst,
StartOfBurst,
EndOfBurst
} radio_tx_flag_t;
TX_BURST_INVALID = 0,
TX_BURST_MIDDLE = 1,
TX_BURST_START = 2,
TX_BURST_END = 3,
TX_BURST_START_AND_END = 4,
TX_BURST_END_NO_TIME_SPEC = 10,
} radio_tx_burst_flag_t;
/*! \brief Structure used for initializing UDP read threads */
typedef struct {
+2 -2
View File
@@ -164,9 +164,9 @@ trx_iris_write(openair0_device *device, openair0_timestamp timestamp, void **buf
return nsamps;
}
if (flags == 2 || flags == 1) { // start of burst
if (flags == TX_BURST_START || flags == TX_BURST_MIDDLE)
} else if (flags == 3 || flags == 4) {
} else if (flags == TX_BURST_END || flags == TX_BURST_START_AND_END) {
flag |= SOAPY_SDR_END_BURST;
}
+5 -5
View File
@@ -389,7 +389,7 @@ static int trx_usrp_write(openair0_device *device,
usrp_state_t *s = (usrp_state_t *)device->priv;
int nsamps2; // aligned to upper 32 or 16 byte boundary
int flags_burst = flags&0xf;
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
int end;
@@ -400,22 +400,22 @@ static int trx_usrp_write(openair0_device *device,
bool first_packet_state=false,last_packet_state=false;
if (flags_burst == 2) { // start of burst
if (flags_burst == TX_BURST_START) {
// s->tx_md.start_of_burst = true;
// s->tx_md.end_of_burst = false;
first_packet_state = true;
last_packet_state = false;
} else if (flags_burst == 3) { // end of burst
} else if (flags_burst == TX_BURST_END) {
//s->tx_md.start_of_burst = false;
//s->tx_md.end_of_burst = true;
first_packet_state = false;
last_packet_state = true;
} else if (flags_burst == 4) { // start and end
} else if (flags_burst == TX_BURST_START_AND_END) {
// s->tx_md.start_of_burst = true;
// s->tx_md.end_of_burst = true;
first_packet_state = true;
last_packet_state = true;
} else if (flags_burst==1) { // middle of burst
} else if (flags_burst == TX_BURST_MIDDLE) {
// s->tx_md.start_of_burst = false;
// s->tx_md.end_of_burst = false;
first_packet_state = false;