FreeCalypso > hg > freecalypso-tools
annotate rvinterf/tmsh/rftablechk.c @ 497:74610c4f10f7
target-utils: added 10 ms delay at the end of abb_power_off()
The deosmification of the ABB access code (replacement of osmo_delay_ms()
bogus delays with correctly-timed ones, which are significantly shorter)
had one annoying side effect: when executing the poweroff command from
any of the programs, one last '=' prompt character was being sent (and
received by the x86 host) as the Calypso board powers off. With delays
being shorter now, the abb_power_off() function was returning and the
standalone program's main loop was printing its prompt before the Iota chip
fully executed the switch-off sequence!
I thought about inserting an endless tight loop at the end of the
abb_power_off() function, but the implemented solution of a 10 ms delay
is a little nicer IMO because if the DEVOFF operation doesn't happen for
some reason in a manual hacking scenario, there won't be an artificial
blocker in the form of a tight loop keeping us from further poking around.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 25 May 2019 20:44:05 +0000 |
parents | bc23c1cd30ae |
children |
rev | line source |
---|---|
123
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This module contains the function that checks if the table format |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * and rftw index match. |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 */ |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <sys/types.h> |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <stdio.h> |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 #include <string.h> |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 #include <strings.h> |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 #include <stdlib.h> |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 #include "localtypes.h" |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 #include "l1tm.h" |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 #include "exitcodes.h" |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 static struct table_match { |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 int index; |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 char *format; |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 } matchlist[] = { |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 {RX_AGC_TABLE, "agc-table"}, |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 {AFC_PARAMS, "afcparams"}, |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 {RX_AGC_GLOBAL_PARAMS, "agc-global-params"}, |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 {RX_IL_2_AGC_MAX, "il2agc"}, |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 {RX_IL_2_AGC_PWR, "il2agc"}, |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 {RX_IL_2_AGC_AV, "il2agc"}, |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 {TX_LEVELS, "tx-levels"}, |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 {TX_CAL_CHAN, "tx-calchan"}, |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 {TX_CAL_TEMP, "tx-caltemp"}, |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 {RX_CAL_CHAN, "rx-calchan"}, |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 {RX_CAL_TEMP, "rx-caltemp"}, |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 {RX_AGC_PARAMS, "rx-agc-params"}, |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 {0, 0} |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 }; |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 rftw_index_format_check(index, format) |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 char *format; |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 { |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 struct table_match *tp; |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 if (!strcmp(format, "raw")) |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 return(0); |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 for (tp = matchlist; tp->index; tp++) { |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 if (tp->index == index) { |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 if (!strcmp(format, tp->format)) |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 return(0); |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 printf("error: read table of type %s, expected %s\n", |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 format, tp->format); |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 return(ERROR_USAGE); |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 } |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 } |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 return(0); |
bc23c1cd30ae
fc-tmsh: rftw format consistency check implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 } |