# HG changeset patch # User Mychaela Falconia # Date 1495928106 0 # Node ID 81e8f7e99d89c9281f07c7638d40ae146fefe3ae # Parent c87067884da7f8032f9351735ac5c83ffd8f8738 fc-rfcal-rxband: upload of GMagic to DUT implemented diff -r c87067884da7 -r 81e8f7e99d89 autocal/Makefile --- a/autocal/Makefile Sat May 27 23:23:35 2017 +0000 +++ b/autocal/Makefile Sat May 27 23:35:06 2017 +0000 @@ -7,8 +7,8 @@ GMAGIC_OBJS= gmagicmain.o l1meas.o l1tmops.o rvinterf.o rxcommon.o \ sockopts.o tsidsock.o -RXBAND_OBJS= l1meas.o l1tmops.o rvinterf.o rxband.o rxcommon.o sockopts.o \ - tsidsock.o +RXBAND_OBJS= l1meas.o l1tmops.o rvinterf.o rxband.o rxcommon.o rxupload.o \ + sockopts.o tsidsock.o TXBASIS_OBJS= l1tmops.o rvinterf.o tsidsock.o txbasis.o txpwrmeas.o diff -r c87067884da7 -r 81e8f7e99d89 autocal/l1tmops.c --- a/autocal/l1tmops.c Sat May 27 23:23:35 2017 +0000 +++ b/autocal/l1tmops.c Sat May 27 23:35:06 2017 +0000 @@ -210,8 +210,8 @@ rvi_msg[3]); exit(ERROR_TARGET); } - if (rvi_msg_len != size + 6) { - fprintf(stderr, "DUT error: rftr response wrong length\n"); + if (rvi_msg_len < size + 6) { + fprintf(stderr, "DUT error: rftr response too short\n"); exit(ERROR_TARGET); } if (rvi_msg[4] != index) { diff -r c87067884da7 -r 81e8f7e99d89 autocal/rxband.c --- a/autocal/rxband.c Sat May 27 23:23:35 2017 +0000 +++ b/autocal/rxband.c Sat May 27 23:35:06 2017 +0000 @@ -130,5 +130,6 @@ Gmagic = pm - RXCAL_SIGGEN_LEVEL - RXCAL_AGC_DB * 2; halfdb_to_string(Gmagic, Gmagic_db); printf("GMagic=%d (%s dB)\n", Gmagic, Gmagic_db); + upload_gmagic(Gmagic); return(0); } diff -r c87067884da7 -r 81e8f7e99d89 autocal/rxupload.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autocal/rxupload.c Sat May 27 23:35:06 2017 +0000 @@ -0,0 +1,25 @@ +/* + * This module contains the RF table upload code for fc-rfcal-rxband. + */ + +#include +#include +#include +#include +#include +#include +#include "rxband.h" +#include "rxtables.h" + +extern struct rxcal_band *rxcal_band; + +upload_gmagic(Gmagic) + unsigned Gmagic; +{ + struct rx_agc_params agcparams; + + do_rftr(RX_AGC_PARAMS, &agcparams, sizeof agcparams); + agcparams.g_magic = htole16(Gmagic); + do_rftw(RX_AGC_PARAMS, &agcparams, sizeof agcparams); + return(0); +}