diff --git a/lib/include/srslte/phy/common/phy_common.h b/lib/include/srslte/phy/common/phy_common.h index d9b8d14f7..78350252f 100644 --- a/lib/include/srslte/phy/common/phy_common.h +++ b/lib/include/srslte/phy/common/phy_common.h @@ -250,11 +250,10 @@ typedef enum SRSLTE_API { SRSLTE_MOD_QPSK, SRSLTE_MOD_16QAM, SRSLTE_MOD_64QAM, - SRSLTE_MOD_256QAM + SRSLTE_MOD_256QAM, + SRSLTE_MOD_NITEMS } srslte_mod_t; -#define SRSLTE_NOF_MODULATIONS (SRSLTE_MOD_256QAM + 1) - typedef enum { SRSLTE_DCI_FORMAT0 = 0, SRSLTE_DCI_FORMAT1, diff --git a/lib/include/srslte/phy/modem/evm.h b/lib/include/srslte/phy/modem/evm.h index 4a6c9552a..32a0ee92f 100644 --- a/lib/include/srslte/phy/modem/evm.h +++ b/lib/include/srslte/phy/modem/evm.h @@ -84,7 +84,6 @@ static inline srslte_evm_buffer_t* srslte_evm_buffer_alloc(uint32_t nof_prb) */ static inline void srslte_evm_buffer_resize(srslte_evm_buffer_t* q, uint32_t nof_prb) { - // Assert pointer and number of PRB if (!q || !nof_prb) { ERROR("Invalid inputs"); diff --git a/lib/include/srslte/phy/phch/pdsch.h b/lib/include/srslte/phy/phch/pdsch.h index 6a220a060..c9d240418 100644 --- a/lib/include/srslte/phy/phch/pdsch.h +++ b/lib/include/srslte/phy/phch/pdsch.h @@ -73,7 +73,7 @@ typedef struct SRSLTE_API { float* csi[SRSLTE_MAX_CODEWORDS]; /* Channel Strengh Indicator */ /* tx & rx objects */ - srslte_modem_table_t mod[SRSLTE_NOF_MODULATIONS]; + srslte_modem_table_t mod[SRSLTE_MOD_NITEMS]; // EVM buffers, one for each codeword (avoid concurrency issue with coworker) srslte_evm_buffer_t* evm_buffer[SRSLTE_MAX_CODEWORDS]; diff --git a/lib/src/phy/modem/demod_hard.c b/lib/src/phy/modem/demod_hard.c index 997c35c0b..a4c473f3a 100644 --- a/lib/src/phy/modem/demod_hard.c +++ b/lib/src/phy/modem/demod_hard.c @@ -60,6 +60,8 @@ int srslte_demod_hard_demodulate(srslte_demod_hard_t* q, cf_t* symbols, uint8_t* hard_qam256_demod(symbols, bits, nsymbols); nbits = nsymbols * 8; break; + case SRSLTE_MOD_NITEMS: + default:; // Do nothing } return nbits; } diff --git a/lib/src/phy/modem/modem_table.c b/lib/src/phy/modem/modem_table.c index d8f5e7fd8..5394519e0 100644 --- a/lib/src/phy/modem/modem_table.c +++ b/lib/src/phy/modem/modem_table.c @@ -122,6 +122,8 @@ int srslte_modem_table_lte(srslte_modem_table_t* q, srslte_mod_t modulation) } set_256QAMtable(q->symbol_table); break; + case SRSLTE_MOD_NITEMS: + default:; // Do nothing } return SRSLTE_SUCCESS; } diff --git a/lib/src/phy/phch/pdsch.c b/lib/src/phy/phch/pdsch.c index ed27bd012..0e6c441f5 100644 --- a/lib/src/phy/phch/pdsch.c +++ b/lib/src/phy/phch/pdsch.c @@ -254,7 +254,7 @@ static int pdsch_init(srslte_pdsch_t* q, uint32_t max_prb, bool is_ue, uint32_t INFO("Init PDSCH: %d PRBs, max_symbols: %d\n", max_prb, q->max_re); - for (int i = 0; i < SRSLTE_NOF_MODULATIONS; i++) { + for (int i = 0; i < SRSLTE_MOD_NITEMS; i++) { if (srslte_modem_table_lte(&q->mod[i], modulations[i])) { goto clean; } @@ -461,7 +461,7 @@ void srslte_pdsch_free(srslte_pdsch_t* q) srslte_sequence_free(&q->tmp_seq); - for (int i = 0; i < SRSLTE_NOF_MODULATIONS; i++) { + for (int i = 0; i < SRSLTE_MOD_NITEMS; i++) { srslte_modem_table_free(&q->mod[i]); } @@ -700,6 +700,8 @@ static void csi_correction(srslte_pdsch_t* q, srslte_pdsch_cfg_t* cfg, uint32_t _e += 2; } break; + case SRSLTE_MOD_NITEMS: + default:; // Do nothing } i /= qm;