changeset 141:6b01d4ef85c3

fc-tmsh: save-tx-ramp command implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 26 Feb 2017 23:37:56 +0000 (2017-02-26)
parents e6c265bf5a6d
children d41edd329670
files rvinterf/tmsh/rftablewr.c rvinterf/tmsh/saverftab.c rvinterf/tmsh/usercmd.c
diffstat 3 files changed, 33 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/tmsh/rftablewr.c	Sun Feb 26 23:26:30 2017 +0000
+++ b/rvinterf/tmsh/rftablewr.c	Sun Feb 26 23:37:56 2017 +0000
@@ -189,3 +189,19 @@
 	fprintf(outf, "%5u\t# lna_switch_thr_low\n", get_u16(bin + 4));
 	fprintf(outf, "%5u\t# lna_switch_thr_high\n", get_u16(bin + 6));
 }
+
+void
+write_tx_ramp(bin, outf)
+	u_char *bin;
+	FILE *outf;
+{
+	int i;
+
+	fputs("ramp-up  ", outf);
+	for (i = 0; i < 16; i++)
+		fprintf(outf, " %3u", bin[i]);
+	putc('\n', outf);
+	fputs("ramp-down", outf);
+	for (i = 0; i < 16; i++)
+		fprintf(outf, " %3u", bin[i+16]);
+}
--- a/rvinterf/tmsh/saverftab.c	Sun Feb 26 23:26:30 2017 +0000
+++ b/rvinterf/tmsh/saverftab.c	Sun Feb 26 23:37:56 2017 +0000
@@ -112,3 +112,18 @@
 	fclose(outf);
 	return(0);
 }
+
+cmd_save_tx_ramp(argc, argv)
+	char **argv;
+{
+	FILE *outf;
+
+	outf = fopen(argv[1], "w");
+	if (!outf) {
+		perror(argv[1]);
+		return(ERROR_UNIX);
+	}
+	write_tx_ramp(ttr_ramp_data, outf);
+	fclose(outf);
+	return(0);
+}
--- a/rvinterf/tmsh/usercmd.c	Sun Feb 26 23:26:30 2017 +0000
+++ b/rvinterf/tmsh/usercmd.c	Sun Feb 26 23:37:56 2017 +0000
@@ -35,6 +35,7 @@
 extern int cmd_rxpw();
 extern int cmd_save_rf_table();
 extern int cmd_save_rf_table_raw();
+extern int cmd_save_tx_ramp();
 extern int cmd_scr();
 extern int cmd_scw();
 extern int cmd_sr();
@@ -90,6 +91,7 @@
 	{"rxpw", 2, 2, cmd_rxpw},
 	{"save-rf-table", 1, 1, cmd_save_rf_table},
 	{"save-rf-table-raw", 1, 1, cmd_save_rf_table_raw},
+	{"save-tx-ramp", 1, 1, cmd_save_tx_ramp},
 	{"scr", 1, 1, cmd_scr},
 	{"scw", 2, 2, cmd_scw},
 	{"sr", 2, 2, cmd_sr},