From 2937ec00881d3a88ef2a4e629625c6dc34d0aee4 Mon Sep 17 00:00:00 2001 From: winckel <winckel@eurecom.fr> Date: Thu, 6 Feb 2014 14:53:00 +0000 Subject: [PATCH] Fixed an issue with frequency argument over 2^31. git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5047 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- targets/RTAI/USER/lte-softmodem.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/targets/RTAI/USER/lte-softmodem.c b/targets/RTAI/USER/lte-softmodem.c index c857a86550..d42c34f804 100644 --- a/targets/RTAI/USER/lte-softmodem.c +++ b/targets/RTAI/USER/lte-softmodem.c @@ -240,7 +240,7 @@ static runmode_t mode; static int rx_input_level_dBm; #ifdef XFORMS extern int otg_enabled; -static char do_forms = 0; +static char do_forms=0; #else int otg_enabled; #endif @@ -300,10 +300,9 @@ void exit_fun(const char* s) #ifdef XFORMS void *scope_thread(void *arg) { - s16 prach_corr[1024], i; char stats_buffer[16384]; //FILE *UE_stats, *eNB_stats; - int len=0; + int len = 0; struct sched_param sched_param; sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO)+1; @@ -343,7 +342,7 @@ void *scope_thread(void *arg) { } //printf("doing forms\n"); - usleep(1000000); + usleep(100000); // 100 ms } //fclose (UE_stats); @@ -1138,14 +1137,15 @@ static void get_options (int argc, char **argv) break; case 'C': - downlink_frequency[0] = atoi(optarg); - downlink_frequency[1] = atoi(optarg); - downlink_frequency[2] = atoi(optarg); - downlink_frequency[3] = atoi(optarg); + downlink_frequency[0] = atof(optarg); // Use float to avoid issue with frequency over 2^31. + downlink_frequency[1] = downlink_frequency[0]; + downlink_frequency[2] = downlink_frequency[0]; + downlink_frequency[3] = downlink_frequency[0]; carrier_freq[0] = downlink_frequency[0]; carrier_freq[1] = downlink_frequency[1]; carrier_freq[2] = downlink_frequency[2]; carrier_freq[3] = downlink_frequency[3]; + printf("Downlink frequency set to %u\n", downlink_frequency[0]); break; case 'd': @@ -1305,7 +1305,7 @@ int main(int argc, char **argv) { frame_parms = (LTE_DL_FRAME_PARMS*) malloc(sizeof(LTE_DL_FRAME_PARMS)); /* Set some default values that may be overwritten while reading options */ - frame_parms->frame_type = 1; + frame_parms->frame_type = 1; /* TDD */ frame_parms->tdd_config = 3; frame_parms->tdd_config_S = 0; -- GitLab