comparison librftab/rftablewr.c @ 721:059649902c7f

librftab: added support for adc-cal tables
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 25 Aug 2020 07:15:02 +0000
parents 329c31f7c797
children
comparison
equal deleted inserted replaced
720:b73c21a2148f 721:059649902c7f
32 32
33 i = le16toh(*(uint16_t *)bin); 33 i = le16toh(*(uint16_t *)bin);
34 if (i >= 32768) 34 if (i >= 32768)
35 i -= 65536; 35 i -= 65536;
36 return(i); 36 return(i);
37 }
38
39 void
40 write_adccal_table(bin, outf)
41 u_char *bin;
42 FILE *outf;
43 {
44 fputs("rf_table adc-cal\n\n", outf);
45 fprintf(outf, "%5u %6d\t# Vbat\n", get_u16(bin), get_s16(bin + 18));
46 fprintf(outf, "%5u %6d\t# Vchg\n", get_u16(bin + 2), get_s16(bin + 20));
47 fprintf(outf, "%5u %6d\t# Ichg\n", get_u16(bin + 4), get_s16(bin + 22));
48 fprintf(outf, "%5u %6d\t# Vbackup\n", get_u16(bin + 6),
49 get_s16(bin + 24));
50 fprintf(outf, "%5u %6d\t# ADIN1\n", get_u16(bin + 8),
51 get_s16(bin + 26));
52 fprintf(outf, "%5u %6d\t# ADIN2\n", get_u16(bin + 10),
53 get_s16(bin + 28));
54 fprintf(outf, "%5u %6d\t# ADIN3\n", get_u16(bin + 12),
55 get_s16(bin + 30));
56 fprintf(outf, "%5u %6d\t# RF Temp\n", get_u16(bin + 14),
57 get_s16(bin + 32));
58 fprintf(outf, "%5u %6d\t# ADIN5\n", get_u16(bin + 16),
59 get_s16(bin + 34));
37 } 60 }
38 61
39 void 62 void
40 write_afcparams_table(bin, outf) 63 write_afcparams_table(bin, outf)
41 u_char *bin; 64 u_char *bin;