replace a set of #define by a C bit array, remove duplicated extern global variable declaration

This commit is contained in:
Laurent THOMAS
2025-01-09 15:28:25 +01:00
committed by Robert Schmidt
parent f9bff3d6a0
commit e0ca70c36d
48 changed files with 135 additions and 284 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ int main(int argc, char **argv) {
paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC_GNB ;
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
get_common_options(uniqCfg, SOFTMODEM_GNB_BIT);
get_common_options(uniqCfg);
config_process_cmdline(uniqCfg, cmdline_params, sizeofArray(cmdline_params), NULL);
CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
lock_memory_to_ram();
+4 -6
View File
@@ -33,7 +33,7 @@
#include "openair1/PHY/defs_nr_UE.h"
extern "C" {
#include "openair1/PHY/TOOLS/phy_scope_interface.h"
uint64_t get_softmodem_optmask(void);
#include "executables/softmodem-common.h"
}
#include <iostream>
#include <vector>
@@ -42,7 +42,6 @@ uint64_t get_softmodem_optmask(void);
#include <sstream>
#include <mutex>
#include <thread>
#include "executables/softmodem-bits.h"
#define MAX_OFFSETS 14
#define NR_MAX_RB 273
@@ -678,7 +677,7 @@ void *imscope_thread(void *data_void_ptr)
static double last_frame_time = glfwGetTime();
static int target_fps = 24;
bool is_ue = (get_softmodem_optmask() & SOFTMODEM_5GUE_BIT) > 0;
bool is_ue = IS_SOFTMODEM_5GUE;
bool close_window = false;
while (!glfwWindowShouldClose(window) && close_window == false) {
// Poll and handle events (inputs, window resize, etc.)
@@ -795,8 +794,7 @@ void *imscope_thread(void *data_void_ptr)
extern "C" void imscope_autoinit(void *dataptr)
{
AssertFatal((get_softmodem_optmask() & SOFTMODEM_5GUE_BIT) || (get_softmodem_optmask() & SOFTMODEM_GNB_BIT),
"Scope cannot find NRUE or GNB context");
AssertFatal(IS_SOFTMODEM_5GUE || IS_SOFTMODEM_GNB, "Scope cannot find NRUE or GNB context");
for (auto i = 0U; i < EXTRA_SCOPE_TYPES; i++) {
scope_array[i].is_data_ready = false;
@@ -804,7 +802,7 @@ extern "C" void imscope_autoinit(void *dataptr)
scope_array[i].meta = {-1, -1};
}
if (SOFTMODEM_GNB_BIT & get_softmodem_optmask()) {
if (IS_SOFTMODEM_GNB) {
scopeParms_t *scope_params = (scopeParms_t *)dataptr;
scopeData_t *scope = (scopeData_t *)calloc(1, sizeof(scopeData_t));
scope->copyData = copyDataThreadSafe;
+2 -2
View File
@@ -1165,9 +1165,9 @@ STATICFORXSCOPE void nrUEinitScope(PHY_VARS_NR_UE *ue)
}
void nrscope_autoinit(void *dataptr) {
AssertFatal( (IS_SOFTMODEM_GNB_BIT||IS_SOFTMODEM_5GUE_BIT),"Scope cannot find NRUE or GNB context");
AssertFatal((IS_SOFTMODEM_GNB || IS_SOFTMODEM_5GUE), "Scope cannot find NRUE or GNB context");
if (IS_SOFTMODEM_GNB_BIT)
if (IS_SOFTMODEM_GNB)
gNBinitScope(dataptr);
else
nrUEinitScope(dataptr);