comparison autocal/rxcommon.c @ 46:751f8d9efed0

Rx cal: started the single measurement code
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 27 May 2017 06:25:59 +0000
parents 98abe6bd2042
children 1a0dbc746d57
comparison
equal deleted inserted replaced
45:98abe6bd2042 46:751f8d9efed0
19 do_scw(AUTO_RESET_LOOPS, RXCAL_LOOP_COUNT); 19 do_scw(AUTO_RESET_LOOPS, RXCAL_LOOP_COUNT);
20 do_scw(STAT_TYPE, ACCUMULATED_RX_STATS); 20 do_scw(STAT_TYPE, ACCUMULATED_RX_STATS);
21 do_scw(STAT_BITMASK, DSP_PM); 21 do_scw(STAT_BITMASK, DSP_PM);
22 return(0); 22 return(0);
23 } 23 }
24
25 halfdb_to_string(halfdb, strbuf)
26 int halfdb;
27 char *strbuf;
28 {
29 int sign;
30
31 if (halfdb < 0) {
32 sign = 1;
33 halfdb = -halfdb;
34 } else
35 sign = 0;
36 sprintf(strbuf, "%s%d.%c", sign ? "-" : "", halfdb >> 1,
37 halfdb & 1 ? '5' : '0');
38 return(0);
39 }
40
41 rx_single_offset_meas(arfcn, offset)
42 unsigned arfcn;
43 char *offset;
44 {
45 char dbm[64], tsid_cmd[128];
46
47 halfdb_to_string(RXCAL_SIGGEN_LEVEL, dbm);
48 printf("Rx meas at ARFCN %u offset %s kHz, TL=%s dBm, AGC=%d dB\n",
49 arfcn, offset, dbm, RXCAL_AGC_DB);
50 sprintf(tsid_cmd, "signal-gen-sine %u %s %s\n", arfcn, offset, dbm);
51 tsid_command(tsid_cmd);
52
53
54 }