@@ -0,0 +1,119 | |||
|
1 | #ifndef TC_TYPES_H | |
|
2 | #define TC_TYPES_H | |
|
3 | ||
|
4 | #include <ccsds_types.h> | |
|
5 | ||
|
6 | // PACKET ID | |
|
7 | #define TC_LFR_PACKET_ID 0x1ccc // PID 76 CAT 12 | |
|
8 | ||
|
9 | #define PACKET_LENGTH_TC_LFR_LOAD_COMMON_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET) | |
|
10 | #define PACKET_LENGTH_TC_LFR_LOAD_NORMAL_PAR (20 - CCSDS_TC_TM_PACKET_OFFSET) | |
|
11 | #define PACKET_LENGTH_TC_LFR_LOAD_BURST_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET) | |
|
12 | #define PACKET_LENGTH_TC_LFR_LOAD_SBM1_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET) | |
|
13 | #define PACKET_LENGTH_TC_LFR_LOAD_SBM2_PAR (14 - CCSDS_TC_TM_PACKET_OFFSET) | |
|
14 | #define PACKET_LENGTH_TC_LFR_DUMP_PAR (12 - CCSDS_TC_TM_PACKET_OFFSET) | |
|
15 | #define PACKET_LENGTH_TC_LFR_ENTER_MODE (20 - CCSDS_TC_TM_PACKET_OFFSET) | |
|
16 | ||
|
17 | // TC TYPES | |
|
18 | #define TC_TYPE_DEFAULT 181 | |
|
19 | #define TC_TYPE_LFR_UPDATE_TIME 9 | |
|
20 | ||
|
21 | // TC SUBTYPES | |
|
22 | #define TC_SUBTYPE_LOAD_COMMON_PAR 11 | |
|
23 | #define TC_SUBTYPE_LOAD_NORMAL_PAR 13 | |
|
24 | #define TC_SUBTYPE_LOAD_BURST_PAR 19 | |
|
25 | #define TC_SUBTYPE_LOAD_SBM1_PAR 25 | |
|
26 | #define TC_SUBTYPE_LOAD_SBM2_PAR 27 | |
|
27 | #define TC_SUBTYPE_DUMP_PAR 31 | |
|
28 | #define TC_SUBTYPE_ENTER_MODE 41 | |
|
29 | ||
|
30 | // OTHER CONSTANTS | |
|
31 | #define TC_LFR_PACKET_SEQUENCE_CONTROL 0xc000 // PID 76 CAT 12 | |
|
32 | #define TC_LFR_DATA_FIELD_HEADER0 0x19 | |
|
33 | #define TC_LFR_LOAD_COMMON_PAR_SPARE 0x00 | |
|
34 | ||
|
35 | struct Packet_TC_LFR_ENTER_MODE_str | |
|
36 | { // the CCSDS header is added by LPPMON | |
|
37 | unsigned char packetID[2]; | |
|
38 | unsigned char packetSequenceControl[2]; | |
|
39 | unsigned char packetLength[2]; | |
|
40 | // DATA FIELD HEADER | |
|
41 | unsigned char ccsdsSecHeaderFlag_pusVersion_ack; | |
|
42 | unsigned char serviceType; | |
|
43 | unsigned char serviceSubType; | |
|
44 | unsigned char sourceID; | |
|
45 | unsigned char spare; | |
|
46 | unsigned char mode; | |
|
47 | unsigned char enterModeTime[6]; | |
|
48 | unsigned char crc[2]; | |
|
49 | }; | |
|
50 | typedef struct Packet_TC_LFR_ENTER_MODE_str Packet_TC_LFR_ENTER_MODE_t; | |
|
51 | ||
|
52 | struct Packet_TC_LFR_DUMP_PAR_str | |
|
53 | { // the CCSDS header is added by LPPMON | |
|
54 | unsigned char packetID[2]; | |
|
55 | unsigned char packetSequenceControl[2]; | |
|
56 | unsigned char packetLength[2]; | |
|
57 | // DATA FIELD HEADER | |
|
58 | unsigned char ccsdsSecHeaderFlag_pusVersion_ack; | |
|
59 | unsigned char serviceType; | |
|
60 | unsigned char serviceSubType; | |
|
61 | unsigned char sourceID; | |
|
62 | unsigned char crc[2]; | |
|
63 | ||
|
64 | }; | |
|
65 | typedef struct Packet_TC_LFR_DUMP_PAR_str Packet_TC_LFR_DUMP_PAR_t; | |
|
66 | ||
|
67 | struct Packet_TC_LFR_LOAD_COMMON_PAR_str | |
|
68 | { // the CCSDS header is added by LPPMON | |
|
69 | unsigned char packetID[2]; | |
|
70 | unsigned char packetSequenceControl[2]; | |
|
71 | unsigned char packetLength[2]; | |
|
72 | // DATA FIELD HEADER | |
|
73 | unsigned char ccsdsSecHeaderFlag_pusVersion_ack; | |
|
74 | unsigned char serviceType; | |
|
75 | unsigned char serviceSubType; | |
|
76 | unsigned char sourceID; | |
|
77 | unsigned char spare; | |
|
78 | unsigned char bw_sp0_sp1_r0_r1; | |
|
79 | unsigned char crc[2]; | |
|
80 | ||
|
81 | }; | |
|
82 | typedef struct Packet_TC_LFR_LOAD_COMMON_PAR_str Packet_TC_LFR_LOAD_COMMON_PAR_t; | |
|
83 | ||
|
84 | struct Packet_TC_LFR_LOAD_NORMAL_PAR_str | |
|
85 | { // the CCSDS header is added by LPPMON | |
|
86 | unsigned char packetID[2]; | |
|
87 | unsigned char packetSequenceControl[2]; | |
|
88 | unsigned char packetLength[2]; | |
|
89 | // DATA FIELD HEADER | |
|
90 | unsigned char ccsdsSecHeaderFlag_pusVersion_ack; | |
|
91 | unsigned char serviceType; | |
|
92 | unsigned char serviceSubType; | |
|
93 | unsigned char sourceID; | |
|
94 | unsigned char sy_lfr_n_swf_l[2]; | |
|
95 | unsigned char sy_lfr_n_swf_p[2]; | |
|
96 | unsigned char sy_lfr_n_asm_p[2]; | |
|
97 | unsigned char sy_lfr_n_bp_p0; | |
|
98 | unsigned char sy_lfr_n_bp_p1; | |
|
99 | unsigned char crc[2]; | |
|
100 | }; | |
|
101 | typedef struct Packet_TC_LFR_LOAD_NORMAL_PAR_str Packet_TC_LFR_LOAD_NORMAL_PAR_t; | |
|
102 | ||
|
103 | struct Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_str | |
|
104 | { // the CCSDS header is added by LPPMON | |
|
105 | unsigned char packetID[2]; | |
|
106 | unsigned char packetSequenceControl[2]; | |
|
107 | unsigned char packetLength[2]; | |
|
108 | // DATA FIELD HEADER | |
|
109 | unsigned char ccsdsSecHeaderFlag_pusVersion_ack; | |
|
110 | unsigned char serviceType; | |
|
111 | unsigned char serviceSubType; | |
|
112 | unsigned char sourceID; | |
|
113 | unsigned char sy_lfr_bp_p0; | |
|
114 | unsigned char sy_lfr_bp_p1; | |
|
115 | unsigned char crc[2]; | |
|
116 | }; | |
|
117 | typedef struct Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_str Packet_TC_LFR_LOAD_BURST_SBM1_SBM2_PAR_t; | |
|
118 | ||
|
119 | #endif // TC_TYPES_H |
@@ -1,6 +1,6 | |||
|
1 | 1 | ############################################################################# |
|
2 |
# Makefile for building: bin/fsw |
|
|
3 |
# Generated by qmake (2.01a) (Qt 4.8.4) on: Thu |
|
|
2 | # Makefile for building: bin/fsw | |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.4) on: Thu Aug 1 15:31:06 2013 | |
|
4 | 4 | # Project: fsw-qt.pro |
|
5 | 5 | # Template: app |
|
6 | 6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
@@ -10,7 +10,7 | |||
|
10 | 10 | |
|
11 | 11 | CC = sparc-rtems-gcc |
|
12 | 12 | CXX = sparc-rtems-g++ |
|
13 |
DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=1 |
|
|
13 | DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=12 -DPRINT_MESSAGES_ON_CONSOLE | |
|
14 | 14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
15 | 15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
16 | 16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header |
@@ -78,9 +78,9 DIST = /usr/lib64/qt4/mkspecs/c | |||
|
78 | 78 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
79 | 79 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ |
|
80 | 80 | fsw-qt.pro |
|
81 |
QMAKE_TARGET = fsw |
|
|
81 | QMAKE_TARGET = fsw | |
|
82 | 82 | DESTDIR = bin/ |
|
83 |
TARGET = bin/fsw |
|
|
83 | TARGET = bin/fsw | |
|
84 | 84 | |
|
85 | 85 | first: all |
|
86 | 86 | ####### Implicit rules |
@@ -159,8 +159,8 qmake: FORCE | |||
|
159 | 159 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
160 | 160 | |
|
161 | 161 | dist: |
|
162 |
@$(CHK_DIR_EXISTS) obj/fsw |
|
|
163 |
$(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw |
|
|
162 | @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0 | |
|
163 | $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw1.0.0/ && (cd `dirname obj/fsw1.0.0` && $(TAR) fsw1.0.0.tar fsw1.0.0 && $(COMPRESS) fsw1.0.0.tar) && $(MOVE) `dirname obj/fsw1.0.0`/fsw1.0.0.tar.gz . && $(DEL_FILE) -r obj/fsw1.0.0 | |
|
164 | 164 | |
|
165 | 165 | |
|
166 | 166 | clean:compiler_clean |
|
1 | NO CONTENT: modified file, binary diff hidden |
|
1 | NO CONTENT: modified file, binary diff hidden |
@@ -1,17 +1,17 | |||
|
1 | 1 | TEMPLATE = app |
|
2 | 2 | # CONFIG += console v8 sim |
|
3 | 3 | # CONFIG options = verbose *** cpu_usage_report *** gsa |
|
4 |
CONFIG += console verbose |
|
|
4 | CONFIG += console verbose | |
|
5 | 5 | CONFIG -= qt |
|
6 | 6 | |
|
7 | 7 | include(./sparc.pri) |
|
8 | 8 | |
|
9 | 9 | # flight software version |
|
10 |
SWVERSION=-0-1 |
|
|
10 | SWVERSION=-0-12 | |
|
11 | 11 | DEFINES += SW_VERSION_N1=0 |
|
12 | 12 | DEFINES += SW_VERSION_N2=0 |
|
13 | 13 | DEFINES += SW_VERSION_N3=0 |
|
14 |
DEFINES += SW_VERSION_N4=1 |
|
|
14 | DEFINES += SW_VERSION_N4=12 | |
|
15 | 15 | |
|
16 | 16 | contains( CONFIG, verbose ) { |
|
17 | 17 | DEFINES += PRINT_MESSAGES_ON_CONSOLE |
@@ -1,6 +1,6 | |||
|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
|
2 | 2 | <!DOCTYPE QtCreatorProject> |
|
3 |
<!-- Written by QtCreator 2. |
|
|
3 | <!-- Written by QtCreator 2.8.0, 2013-08-01T13:38:09. --> | |
|
4 | 4 | <qtcreator> |
|
5 | 5 | <data> |
|
6 | 6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
@@ -13,13 +13,13 | |||
|
13 | 13 | <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> |
|
14 | 14 | <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value> |
|
15 | 15 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> |
|
16 |
<value type="Q |
|
|
16 | <value type="QString" key="language">Cpp</value> | |
|
17 | 17 | <valuemap type="QVariantMap" key="value"> |
|
18 | 18 | <value type="QString" key="CurrentPreferences">CppGlobal</value> |
|
19 | 19 | </valuemap> |
|
20 | 20 | </valuemap> |
|
21 | 21 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> |
|
22 |
<value type="Q |
|
|
22 | <value type="QString" key="language">QmlJS</value> | |
|
23 | 23 | <valuemap type="QVariantMap" key="value"> |
|
24 | 24 | <value type="QString" key="CurrentPreferences">QmlJSGlobal</value> |
|
25 | 25 | </valuemap> |
@@ -53,7 +53,7 | |||
|
53 | 53 | <valuemap type="QVariantMap"> |
|
54 | 54 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value> |
|
55 | 55 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value> |
|
56 |
<value type="Q |
|
|
56 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value> | |
|
57 | 57 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> |
|
58 | 58 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> |
|
59 | 59 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> |
@@ -63,7 +63,7 | |||
|
63 | 63 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
64 | 64 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|
65 | 65 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
66 |
<value type="Q |
|
|
66 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> | |
|
67 | 67 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|
68 | 68 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value> |
|
69 | 69 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
@@ -73,7 +73,7 | |||
|
73 | 73 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
74 | 74 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
75 | 75 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
76 |
<value type="Q |
|
|
76 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
|
77 | 77 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
78 | 78 | <value type="QString">-w</value> |
|
79 | 79 | <value type="QString">-r</value> |
@@ -85,14 +85,14 | |||
|
85 | 85 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|
86 | 86 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|
87 | 87 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
88 |
<value type="Q |
|
|
88 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> | |
|
89 | 89 | </valuemap> |
|
90 | 90 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|
91 | 91 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
92 | 92 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
93 | 93 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
94 | 94 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
95 |
<value type="Q |
|
|
95 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
|
96 | 96 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
97 | 97 | <value type="QString">-w</value> |
|
98 | 98 | <value type="QString">-r</value> |
@@ -104,14 +104,14 | |||
|
104 | 104 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|
105 | 105 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|
106 | 106 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
107 |
<value type="Q |
|
|
107 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> | |
|
108 | 108 | </valuemap> |
|
109 | 109 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|
110 | 110 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|
111 | 111 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|
112 | 112 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value> |
|
113 | 113 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
114 |
<value type="Q |
|
|
114 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> | |
|
115 | 115 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> |
|
116 | 116 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> |
|
117 | 117 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value> |
@@ -122,7 +122,7 | |||
|
122 | 122 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
123 | 123 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|
124 | 124 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
125 |
<value type="Q |
|
|
125 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> | |
|
126 | 126 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|
127 | 127 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value> |
|
128 | 128 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
@@ -132,7 +132,7 | |||
|
132 | 132 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
133 | 133 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
134 | 134 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
135 |
<value type="Q |
|
|
135 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
|
136 | 136 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
137 | 137 | <value type="QString">-w</value> |
|
138 | 138 | <value type="QString">-r</value> |
@@ -144,14 +144,14 | |||
|
144 | 144 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|
145 | 145 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|
146 | 146 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
147 |
<value type="Q |
|
|
147 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> | |
|
148 | 148 | </valuemap> |
|
149 | 149 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|
150 | 150 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
151 | 151 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
152 | 152 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
153 | 153 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
154 |
<value type="Q |
|
|
154 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
|
155 | 155 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
156 | 156 | <value type="QString">-w</value> |
|
157 | 157 | <value type="QString">-r</value> |
@@ -163,14 +163,14 | |||
|
163 | 163 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|
164 | 164 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|
165 | 165 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
166 |
<value type="Q |
|
|
166 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> | |
|
167 | 167 | </valuemap> |
|
168 | 168 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|
169 | 169 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|
170 | 170 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|
171 | 171 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value> |
|
172 | 172 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
173 |
<value type="Q |
|
|
173 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> | |
|
174 | 174 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> |
|
175 | 175 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> |
|
176 | 176 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value> |
@@ -181,14 +181,15 | |||
|
181 | 181 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> |
|
182 | 182 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> |
|
183 | 183 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
184 |
<value type="Q |
|
|
184 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> | |
|
185 | 185 | </valuemap> |
|
186 | 186 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> |
|
187 | 187 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value> |
|
188 | 188 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
189 |
<value type="Q |
|
|
189 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> | |
|
190 | 190 | </valuemap> |
|
191 | 191 | <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> |
|
192 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> | |
|
192 | 193 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> |
|
193 | 194 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> |
|
194 | 195 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
@@ -221,18 +222,19 | |||
|
221 | 222 | <value type="int">13</value> |
|
222 | 223 | <value type="int">14</value> |
|
223 | 224 | </valuelist> |
|
225 | <value type="int" key="PE.EnvironmentAspect.Base">2</value> | |
|
226 | <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> | |
|
224 | 227 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value> |
|
225 | 228 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
226 |
<value type="Q |
|
|
227 | <value type="int" key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase">2</value> | |
|
229 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value> | |
|
228 | 230 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> |
|
229 | 231 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value> |
|
230 | 232 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> |
|
231 | 233 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value> |
|
232 | <valuelist type="QVariantList" key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges"/> | |
|
233 | 234 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> |
|
234 | 235 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> |
|
235 | 236 | <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> |
|
237 | <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value> | |
|
236 | 238 | <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> |
|
237 | 239 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> |
|
238 | 240 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value> |
@@ -246,10 +248,10 | |||
|
246 | 248 | </data> |
|
247 | 249 | <data> |
|
248 | 250 | <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> |
|
249 |
<value type="Q |
|
|
251 | <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value> | |
|
250 | 252 | </data> |
|
251 | 253 | <data> |
|
252 | 254 | <variable>ProjectExplorer.Project.Updater.FileVersion</variable> |
|
253 |
<value type="int">1 |
|
|
255 | <value type="int">14</value> | |
|
254 | 256 | </data> |
|
255 | 257 | </qtcreator> |
@@ -11,6 +11,7 | |||
|
11 | 11 | #define CCSDS_PROCESS_ID 76 |
|
12 | 12 | #define CCSDS_PACKET_CATEGORY 12 |
|
13 | 13 | #define CCSDS_NODE_ADDRESS 0xfe |
|
14 | #define CCSDS_USER_APP 0x00 | |
|
14 | 15 | |
|
15 | 16 | // PACKET ID |
|
16 | 17 | #define TM_PACKET_ID_TC_EXE 0x0cc1 // PID 76 CAT 1 |
@@ -17,12 +17,14 | |||
|
17 | 17 | #define LFR_MODE_BURST 2 |
|
18 | 18 | #define LFR_MODE_SBM1 3 |
|
19 | 19 | #define LFR_MODE_SBM2 4 |
|
20 | #define LFR_MODE_NORMAL_CWF_F3 5 | |
|
20 | 21 | |
|
21 | 22 | #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0 |
|
22 | 23 | #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1 |
|
23 | 24 | #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2 |
|
24 | 25 | #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3 |
|
25 | 26 | #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4 |
|
27 | #define RTEMS_EVENT_MODE_NORMAL_CWF_F3 RTEMS_EVENT_5 | |
|
26 | 28 | |
|
27 | 29 | //**************************** |
|
28 | 30 | // LFR DEFAULT MODE PARAMETERS |
@@ -32,9 +34,10 | |||
|
32 | 34 | // NORM |
|
33 | 35 | #define DEFAULT_SY_LFR_N_SWF_L 2048 // nb sample |
|
34 | 36 | #define DEFAULT_SY_LFR_N_SWF_P 16 // sec |
|
35 | #define DEFAULT_SY_LFR_N_ASM_P 16 // sec | |
|
37 | #define DEFAULT_SY_LFR_N_ASM_P 16 // sec | |
|
36 | 38 | #define DEFAULT_SY_LFR_N_BP_P0 4 // sec |
|
37 | 39 | #define DEFAULT_SY_LFR_N_BP_P1 20 // sec |
|
40 | #define MIN_DELTA_SNAPSHOT 16 // sec | |
|
38 | 41 | // BURST |
|
39 | 42 | #define DEFAULT_SY_LFR_B_BP_P0 1 // sec |
|
40 | 43 | #define DEFAULT_SY_LFR_B_BP_P1 5 // sec |
@@ -102,6 +105,7 | |||
|
102 | 105 | #define TASKID_DUMB 9 |
|
103 | 106 | #define TASKID_HOUS 10 |
|
104 | 107 | #define TASKID_MATR 11 |
|
108 | #define TASKID_CWF3 12 | |
|
105 | 109 | |
|
106 | 110 | #define ACTION_MSG_QUEUE_COUNT 10 |
|
107 | 111 | |
@@ -154,6 +158,7 struct param_local_str{ | |||
|
154 | 158 | unsigned int local_sbm1_nb_cwf_max; |
|
155 | 159 | unsigned int local_sbm2_nb_cwf_sent; |
|
156 | 160 | unsigned int local_sbm2_nb_cwf_max; |
|
161 | unsigned int local_nb_interrupt_f0_MAX; | |
|
157 | 162 | }; |
|
158 | 163 | |
|
159 | 164 | #endif // FSW_RTEMS_CONFIG_H_INCLUDED |
@@ -4,6 +4,7 | |||
|
4 | 4 | #define NB_BINS_PER_SM 128 |
|
5 | 5 | #define NB_VALUES_PER_SM 25 |
|
6 | 6 | #define TOTAL_SIZE_SM (NB_BINS_PER_SM * NB_VALUES_PER_SM) |
|
7 | #define SM_HEADER 4 | |
|
7 | 8 | |
|
8 | 9 | #define NB_BINS_COMPRESSED_SM_F0 11 |
|
9 | 10 | #define NB_BINS_COMPRESSED_SM_F1 13 |
@@ -13,8 +13,8 | |||
|
13 | 13 | #include <stdio.h> |
|
14 | 14 | #include <stdlib.h> |
|
15 | 15 | |
|
16 |
extern volatile int spec_mat_f0_ |
|
|
17 |
extern volatile int spec_mat_f0_ |
|
|
16 | extern volatile int spec_mat_f0_0[ ]; | |
|
17 | extern volatile int spec_mat_f0_1[ ]; | |
|
18 | 18 | extern volatile int spec_mat_f0_c[ ]; |
|
19 | 19 | extern volatile int spec_mat_f0_d[ ]; |
|
20 | 20 | extern volatile int spec_mat_f0_e[ ]; |
@@ -22,8 +22,20 extern volatile int spec_mat_f0_f[ ]; | |||
|
22 | 22 | extern volatile int spec_mat_f0_g[ ]; |
|
23 | 23 | extern volatile int spec_mat_f0_h[ ]; |
|
24 | 24 | |
|
25 | extern volatile int spec_mat_f1[ ]; | |
|
26 | extern volatile int spec_mat_f2[ ]; | |
|
27 | ||
|
28 | extern volatile int spec_mat_f1_bis[ ]; | |
|
29 | extern volatile int spec_mat_f2_bis[ ]; | |
|
30 | extern volatile int spec_mat_f0_0_bis[ ]; | |
|
31 | extern volatile int spec_mat_f0_1_bis[ ]; | |
|
32 | ||
|
25 | 33 | extern rtems_id Task_id[ ]; /* array of task ids */ |
|
26 | 34 | |
|
35 | // parameters | |
|
36 | extern struct param_local_str param_local; | |
|
37 | ||
|
38 | // registers | |
|
27 | 39 | extern time_management_regs_t *time_management_regs; |
|
28 | 40 | extern spectral_matrix_regs_t *spectral_matrix_regs; |
|
29 | 41 | |
@@ -49,7 +61,7 void init_header_asm( Header_TM_LFR_SCIE | |||
|
49 | 61 | void send_spectral_matrix(Header_TM_LFR_SCIENCE_ASM_t *header, char *spectral_matrix, |
|
50 | 62 | unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send); |
|
51 | 63 | void convert_averaged_spectral_matrix(volatile float *input_matrix, char *output_matrix); |
|
52 |
void |
|
|
64 | void fill_averaged_spectral_matrix(); | |
|
53 | 65 | void reset_spectral_matrix_regs(); |
|
54 | 66 | |
|
55 | 67 | #endif // FSW_RTEMS_PROCESSING_H_INCLUDED |
@@ -66,6 +66,8 int enter_normal_mode(ccsdsTelecommandPa | |||
|
66 | 66 | int enter_burst_mode(ccsdsTelecommandPacket_t *TC); |
|
67 | 67 | int enter_sbm1_mode(ccsdsTelecommandPacket_t *TC); |
|
68 | 68 | int enter_sbm2_mode(ccsdsTelecommandPacket_t *TC); |
|
69 | int restart_science_tasks(); | |
|
70 | int suspend_science_tasks(); | |
|
69 | 71 | // parameters loading |
|
70 | 72 | int action_load_comm(ccsdsTelecommandPacket_t *TC); |
|
71 | 73 | int action_load_norm(ccsdsTelecommandPacket_t *TC); |
@@ -22,11 +22,13 extern volatile int wf_snap_f1_bis[ ]; | |||
|
22 | 22 | extern volatile int wf_snap_f2[ ]; |
|
23 | 23 | extern volatile int wf_snap_f2_bis[ ]; |
|
24 | 24 | extern volatile int wf_cont_f3[ ]; |
|
25 | extern volatile int wf_cont_f3_bis[ ]; | |
|
25 | 26 | extern waveform_picker_regs_t *waveform_picker_regs; |
|
26 | 27 | |
|
27 | 28 | rtems_isr waveforms_isr( rtems_vector_number vector ); |
|
28 | 29 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ); |
|
29 | 30 | rtems_task wfrm_task(rtems_task_argument argument); |
|
31 | rtems_task cwf3_task(rtems_task_argument argument); | |
|
30 | 32 | |
|
31 | 33 | //****************** |
|
32 | 34 | // general functions |
@@ -34,22 +36,31 void init_waveforms( void ); | |||
|
34 | 36 | void init_header_snapshot_wf( Header_TM_LFR_SCIENCE_SWF_t *header ); |
|
35 | 37 | void init_header_continuous_wf( Header_TM_LFR_SCIENCE_CWF_t *header ); |
|
36 | 38 | void reset_waveforms( void ); |
|
37 | void send_waveform_norm(Header_TM_LFR_SCIENCE_SWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send); | |
|
38 | void send_waveform_burst(Header_TM_LFR_SCIENCE_CWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send); | |
|
39 | void send_waveform_sbm1(Header_TM_LFR_SCIENCE_CWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send); | |
|
40 | void send_waveform_sbm2(Header_TM_LFR_SCIENCE_CWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send); | |
|
39 | void send_waveform_norm( Header_TM_LFR_SCIENCE_SWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send ); | |
|
40 | void send_waveform_burst( Header_TM_LFR_SCIENCE_CWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send ); | |
|
41 | void send_waveform_sbm1( Header_TM_LFR_SCIENCE_CWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send ); | |
|
42 | void send_waveform_sbm2( Header_TM_LFR_SCIENCE_CWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send ); | |
|
43 | void send_waveform_norm_cwf_f3(Header_TM_LFR_SCIENCE_CWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send ); | |
|
44 | ||
|
41 | 45 | void send_waveform_SWF( Header_TM_LFR_SCIENCE_SWF_t *header, volatile int *waveform, |
|
42 | unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send); | |
|
46 | unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send ); | |
|
43 | 47 | void send_waveform_CWF( Header_TM_LFR_SCIENCE_CWF_t *header, volatile int *waveform, |
|
44 | unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send); | |
|
48 | unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send ); | |
|
45 | 49 | |
|
46 | 50 | //************** |
|
47 | 51 | // wfp registers |
|
48 |
void set_wfp_data_shaping( |
|
|
49 | void set_wfp_delta_snapshot(unsigned int delta_snapshot); | |
|
52 | void set_wfp_data_shaping(); | |
|
53 | char set_wfp_delta_snapshot(); | |
|
54 | void set_wfp_burst_enable_register( unsigned char mode); | |
|
50 | 55 | void reset_wfp_burst_enable(); |
|
51 | 56 | void reset_waveform_picker_regs(); |
|
52 | // | |
|
53 | int build_value(int value1, int value0); | |
|
57 | ||
|
58 | //***************** | |
|
59 | // local parameters | |
|
60 | void set_local_sbm1_nb_cwf_max(); | |
|
61 | void set_local_sbm2_nb_cwf_max(); | |
|
62 | void set_local_nb_interrupt_f0_MAX(); | |
|
63 | void reset_local_sbm1_nb_cwf_sent(); | |
|
64 | void reset_local_sbm2_nb_cwf_sent(); | |
|
54 | 65 | |
|
55 | 66 | #endif // WF_HANDLER_H_INCLUDED |
@@ -29,23 +29,25 volatile int wf_snap_f1_bis[ NB_SAMPLES_ | |||
|
29 | 29 | volatile int wf_snap_f2[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; |
|
30 | 30 | volatile int wf_snap_f2_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; |
|
31 | 31 | volatile int wf_cont_f3[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; |
|
32 | volatile int wf_cont_f3_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; | |
|
32 | 33 | |
|
33 | 34 | // SPECTRAL MATRICES GLOBAL VARIABLES |
|
34 |
volatile int spec_mat_f0_ |
|
|
35 |
volatile int spec_mat_f0_ |
|
|
36 | volatile int spec_mat_f0_c[ TOTAL_SIZE_SM ]; | |
|
37 | volatile int spec_mat_f0_d[ TOTAL_SIZE_SM ]; | |
|
38 | volatile int spec_mat_f0_e[ TOTAL_SIZE_SM ]; | |
|
39 | volatile int spec_mat_f0_f[ TOTAL_SIZE_SM ]; | |
|
40 | volatile int spec_mat_f0_g[ TOTAL_SIZE_SM ]; | |
|
41 | volatile int spec_mat_f0_h[ TOTAL_SIZE_SM ]; | |
|
35 | volatile int spec_mat_f0_0[ SM_HEADER + TOTAL_SIZE_SM ]; | |
|
36 | volatile int spec_mat_f0_1[ SM_HEADER + TOTAL_SIZE_SM ]; | |
|
37 | volatile int spec_mat_f0_c[ SM_HEADER + TOTAL_SIZE_SM ]; | |
|
38 | volatile int spec_mat_f0_d[ SM_HEADER + TOTAL_SIZE_SM ]; | |
|
39 | volatile int spec_mat_f0_e[ SM_HEADER + TOTAL_SIZE_SM ]; | |
|
40 | volatile int spec_mat_f0_f[ SM_HEADER + TOTAL_SIZE_SM ]; | |
|
41 | volatile int spec_mat_f0_g[ SM_HEADER + TOTAL_SIZE_SM ]; | |
|
42 | volatile int spec_mat_f0_h[ SM_HEADER + TOTAL_SIZE_SM ]; | |
|
43 | volatile int spec_mat_f0_0_bis[ SM_HEADER + TOTAL_SIZE_SM ]; | |
|
44 | volatile int spec_mat_f0_1_bis[ SM_HEADER + TOTAL_SIZE_SM ]; | |
|
42 | 45 | // |
|
43 |
volatile int spec_mat_f1 |
|
|
44 |
volatile int spec_mat_f |
|
|
46 | volatile int spec_mat_f1[ SM_HEADER + TOTAL_SIZE_SM ]; | |
|
47 | volatile int spec_mat_f1_bis[ SM_HEADER + TOTAL_SIZE_SM ]; | |
|
45 | 48 | // |
|
46 |
volatile int spec_mat_f |
|
|
47 |
volatile int spec_mat_f |
|
|
48 | volatile int spec_mat_f2_a_bis[ TOTAL_SIZE_SM ]; | |
|
49 | volatile int spec_mat_f2[ SM_HEADER + TOTAL_SIZE_SM ]; | |
|
50 | volatile int spec_mat_f2_bis[ SM_HEADER + TOTAL_SIZE_SM ]; | |
|
49 | 51 | |
|
50 | 52 | // MODE PARAMETERS |
|
51 | 53 | Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; |
@@ -81,31 +81,30 rtems_task Init( rtems_task_argument ign | |||
|
81 | 81 | |
|
82 | 82 | spacewire_configure_link(); |
|
83 | 83 | |
|
84 | //**************************** | |
|
84 | #ifdef GSA | |
|
85 | 85 | // Spectral Matrices simulator |
|
86 | 86 | configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR, |
|
87 | 87 | IRQ_SPARC_SM, spectral_matrices_isr ); |
|
88 | ||
|
89 | 88 | //********** |
|
90 | 89 | // WAVEFORMS |
|
91 | ||
|
92 | #ifdef GSA | |
|
93 | // simulator | |
|
94 | 90 | configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR, CLKDIV_WF_SIMULATOR, |
|
95 | 91 | IRQ_SPARC_WF, waveforms_simulator_isr ); |
|
92 | LEON_Mask_interrupt( IRQ_SM ); | |
|
96 | 93 | LEON_Mask_interrupt( IRQ_WF ); |
|
97 | 94 | #else |
|
98 | // configure the waveform picker | |
|
95 | // reset configuration registers | |
|
99 | 96 | reset_waveform_picker_regs(); |
|
97 | reset_spectral_matrix_regs(); | |
|
98 | // configure IRQ handling for the waveform picker unit | |
|
100 | 99 | status = rtems_interrupt_catch( waveforms_isr, |
|
101 | 100 | IRQ_SPARC_WAVEFORM_PICKER, |
|
102 | 101 | &old_isr_handler) ; |
|
103 | LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); | |
|
104 | // configure the spectral matrix | |
|
105 | reset_spectral_matrix_regs(); | |
|
106 | status = rtems_interrupt_catch( waveforms_isr, | |
|
102 | // configure IRQ handling for the spectral matrix unit | |
|
103 | status = rtems_interrupt_catch( spectral_matrices_isr, | |
|
107 | 104 | IRQ_SPARC_SPECTRAL_MATRIX, |
|
108 | 105 | &old_isr_handler) ; |
|
106 | // mask IRQ lines | |
|
107 | LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); | |
|
109 | 108 | LEON_Mask_interrupt( IRQ_SPECTRAL_MATRIX ); |
|
110 | 109 | #endif |
|
111 | 110 | |
@@ -163,34 +162,28 void init_parameter_dump(void) | |||
|
163 | 162 | |
|
164 | 163 | //**************** |
|
165 | 164 | // SBM1 PARAMETERS |
|
166 | parameter_dump_packet.sy_lfr_s1_bp_p0 = (unsigned char) DEFAULT_SY_LFR_S1_BP_P0; | |
|
167 |
parameter_dump_packet.sy_lfr_s1_bp_p1 = (unsigned char) DEFAULT_SY_LFR_S1_BP_P |
|
|
165 | parameter_dump_packet.sy_lfr_s1_bp_p0 = (unsigned char) DEFAULT_SY_LFR_S1_BP_P0; // min value is 0.25 s for the period | |
|
166 | parameter_dump_packet.sy_lfr_s1_bp_p1 = (unsigned char) DEFAULT_SY_LFR_S1_BP_P1; | |
|
168 | 167 | |
|
169 | 168 | //**************** |
|
170 | 169 | // SBM2 PARAMETERS |
|
171 | 170 | parameter_dump_packet.sy_lfr_s2_bp_p0 = (unsigned char) DEFAULT_SY_LFR_S2_BP_P0; |
|
172 |
parameter_dump_packet.sy_lfr_s2_bp_p1 = (unsigned char) DEFAULT_SY_LFR_S2_BP_P |
|
|
171 | parameter_dump_packet.sy_lfr_s2_bp_p1 = (unsigned char) DEFAULT_SY_LFR_S2_BP_P1; | |
|
173 | 172 | } |
|
174 | 173 | |
|
175 | 174 | void init_local_mode_parameters(void) |
|
176 | 175 | { |
|
177 | 176 | // LOCAL PARAMETERS |
|
178 | // (2 snapshots of 2048 points per seconds) * (period of the NORM snashots) | |
|
179 |
|
|
|
180 | parameter_dump_packet.sy_lfr_n_swf_p[0] * 256 | |
|
181 | + parameter_dump_packet.sy_lfr_n_swf_p[1] | |
|
182 | ); | |
|
183 | // (period of the NORM snashots) / (8 seconds per snapshot at f2 = 256 Hz) | |
|
184 | param_local.local_sbm2_nb_cwf_max = ( | |
|
185 | parameter_dump_packet.sy_lfr_n_swf_p[0] * 256 | |
|
186 | + parameter_dump_packet.sy_lfr_n_swf_p[1] | |
|
187 | )/ 8; | |
|
177 | set_local_sbm1_nb_cwf_max(); | |
|
178 | set_local_sbm2_nb_cwf_max(); | |
|
179 | set_local_nb_interrupt_f0_MAX(); | |
|
188 | 180 | |
|
189 | 181 | PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max) |
|
190 | 182 | PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max) |
|
183 | PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX) | |
|
191 | 184 | |
|
192 |
|
|
|
193 |
|
|
|
185 | reset_local_sbm1_nb_cwf_sent(); | |
|
186 | reset_local_sbm2_nb_cwf_sent(); | |
|
194 | 187 | } |
|
195 | 188 | |
|
196 | 189 | void init_housekeeping_parameters(void) |
@@ -240,6 +233,7 int create_names( void ) | |||
|
240 | 233 | Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' ); |
|
241 | 234 | Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' ); |
|
242 | 235 | Task_name[TASKID_MATR] = rtems_build_name( 'M', 'A', 'T', 'R' ); |
|
236 | Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' ); | |
|
243 | 237 | |
|
244 | 238 | // rate monotonic period name |
|
245 | 239 | HK_name = rtems_build_name( 'H', 'O', 'U', 'S' ); |
@@ -277,7 +271,7 int create_all_tasks( void ) | |||
|
277 | 271 | ); |
|
278 | 272 | // STAT |
|
279 | 273 | status = rtems_task_create( |
|
280 |
Task_name[TASKID_STAT], |
|
|
274 | Task_name[TASKID_STAT], 251, RTEMS_MINIMUM_STACK_SIZE * 2, | |
|
281 | 275 | RTEMS_DEFAULT_MODES, |
|
282 | 276 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_STAT] |
|
283 | 277 | ); |
@@ -317,6 +311,12 int create_all_tasks( void ) | |||
|
317 | 311 | RTEMS_DEFAULT_MODES, |
|
318 | 312 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_MATR] |
|
319 | 313 | ); |
|
314 | // CWF3 | |
|
315 | status = rtems_task_create( | |
|
316 | Task_name[TASKID_CWF3], 250, RTEMS_MINIMUM_STACK_SIZE * 2, | |
|
317 | RTEMS_DEFAULT_MODES, | |
|
318 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF3] | |
|
319 | ); | |
|
320 | 320 | |
|
321 | 321 | return 0; |
|
322 | 322 | } |
@@ -327,57 +327,62 int start_all_tasks( void ) | |||
|
327 | 327 | |
|
328 | 328 | status = rtems_task_start( Task_id[TASKID_SPIQ], spiq_task, 1 ); |
|
329 | 329 | if (status!=RTEMS_SUCCESSFUL) { |
|
330 |
PRINTF(" |
|
|
330 | PRINTF("in INIT *** Error starting TASK_SPIQ\n") | |
|
331 | 331 | } |
|
332 | 332 | |
|
333 | 333 | status = rtems_task_start( Task_id[TASKID_RECV], recv_task, 1 ); |
|
334 | 334 | if (status!=RTEMS_SUCCESSFUL) { |
|
335 |
PRINTF(" |
|
|
335 | PRINTF("in INIT *** Error starting TASK_RECV\n") | |
|
336 | 336 | } |
|
337 | 337 | |
|
338 | 338 | status = rtems_task_start( Task_id[TASKID_ACTN], actn_task, 1 ); |
|
339 | 339 | if (status!=RTEMS_SUCCESSFUL) { |
|
340 |
PRINTF(" |
|
|
340 | PRINTF("in INIT *** Error starting TASK_ACTN\n") | |
|
341 | 341 | } |
|
342 | 342 | |
|
343 | 343 | status = rtems_task_start( Task_id[TASKID_SMIQ], smiq_task, 1 ); |
|
344 | 344 | if (status!=RTEMS_SUCCESSFUL) { |
|
345 |
PRINTF(" |
|
|
345 | PRINTF("in INIT *** Error starting TASK_BPPR\n") | |
|
346 | 346 | } |
|
347 | 347 | |
|
348 | 348 | status = rtems_task_start( Task_id[TASKID_STAT], stat_task, 1 ); |
|
349 | 349 | if (status!=RTEMS_SUCCESSFUL) { |
|
350 |
PRINTF(" |
|
|
350 | PRINTF("in INIT *** Error starting TASK_STAT\n") | |
|
351 | 351 | } |
|
352 | 352 | |
|
353 | 353 | status = rtems_task_start( Task_id[TASKID_AVF0], avf0_task, 1 ); |
|
354 | 354 | if (status!=RTEMS_SUCCESSFUL) { |
|
355 |
PRINTF(" |
|
|
355 | PRINTF("in INIT *** Error starting TASK_AVF0\n") | |
|
356 | 356 | } |
|
357 | 357 | |
|
358 | 358 | status = rtems_task_start( Task_id[TASKID_BPF0], bpf0_task, 1 ); |
|
359 | 359 | if (status!=RTEMS_SUCCESSFUL) { |
|
360 |
PRINTF(" |
|
|
360 | PRINTF("in INIT *** Error starting TASK_BPF0\n") | |
|
361 | 361 | } |
|
362 | 362 | |
|
363 | 363 | status = rtems_task_start( Task_id[TASKID_WFRM], wfrm_task, 1 ); |
|
364 | 364 | if (status!=RTEMS_SUCCESSFUL) { |
|
365 |
PRINTF(" |
|
|
365 | PRINTF("in INIT *** Error starting TASK_WFRM\n") | |
|
366 | 366 | } |
|
367 | 367 | |
|
368 | 368 | status = rtems_task_start( Task_id[TASKID_DUMB], dumb_task, 1 ); |
|
369 | 369 | if (status!=RTEMS_SUCCESSFUL) { |
|
370 |
PRINTF(" |
|
|
370 | PRINTF("in INIT *** Error starting TASK_DUMB\n") | |
|
371 | 371 | } |
|
372 | 372 | |
|
373 | 373 | status = rtems_task_start( Task_id[TASKID_HOUS], hous_task, 1 ); |
|
374 | 374 | if (status!=RTEMS_SUCCESSFUL) { |
|
375 |
PRINTF(" |
|
|
375 | PRINTF("in INIT *** Error starting TASK_HOUS\n") | |
|
376 | 376 | } |
|
377 | 377 | |
|
378 | 378 | status = rtems_task_start( Task_id[TASKID_MATR], matr_task, 1 ); |
|
379 | 379 | if (status!=RTEMS_SUCCESSFUL) { |
|
380 |
PRINTF(" |
|
|
380 | PRINTF("in INIT *** Error starting TASK_MATR\n") | |
|
381 | } | |
|
382 | ||
|
383 | status = rtems_task_start( Task_id[TASKID_CWF3], cwf3_task, 1 ); | |
|
384 | if (status!=RTEMS_SUCCESSFUL) { | |
|
385 | PRINTF("in INIT *** Error starting TASK_CWF3\n") | |
|
381 | 386 | } |
|
382 | 387 | |
|
383 | 388 | return 0; |
@@ -13,6 +13,69 float compressed_spec_mat_f0[ TOTAL_SIZE | |||
|
13 | 13 | // Interrupt Service Routine for spectral matrices processing |
|
14 | 14 | rtems_isr spectral_matrices_isr( rtems_vector_number vector ) |
|
15 | 15 | { |
|
16 | unsigned char status; | |
|
17 | unsigned char i; | |
|
18 | ||
|
19 | status = spectral_matrix_regs->status; //[f2 f1 f0_1 f0_0] | |
|
20 | for (i=0; i<4; i++) | |
|
21 | { | |
|
22 | if ( ( (status >> i) & 0x01) == 1) // (1) buffer rotation | |
|
23 | { | |
|
24 | switch(i) | |
|
25 | { | |
|
26 | case 0: | |
|
27 | if (spectral_matrix_regs->matrixF0_Address0 == (int) spec_mat_f0_0) | |
|
28 | { | |
|
29 | spectral_matrix_regs->matrixF0_Address0 = (int) spec_mat_f0_0_bis; | |
|
30 | } | |
|
31 | else | |
|
32 | { | |
|
33 | spectral_matrix_regs->matrixF0_Address0 = (int) spec_mat_f0_0; | |
|
34 | } | |
|
35 | spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffe; | |
|
36 | break; | |
|
37 | case 1: | |
|
38 | if (spectral_matrix_regs->matrixFO_Address1 == (int) spec_mat_f0_1) | |
|
39 | { | |
|
40 | spectral_matrix_regs->matrixFO_Address1 = (int) spec_mat_f0_1_bis; | |
|
41 | } | |
|
42 | else | |
|
43 | { | |
|
44 | spectral_matrix_regs->matrixFO_Address1 = (int) spec_mat_f0_1; | |
|
45 | } | |
|
46 | spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffd; | |
|
47 | break; | |
|
48 | case 2: | |
|
49 | if (spectral_matrix_regs->matrixF1_Address == (int) spec_mat_f1) | |
|
50 | { | |
|
51 | spectral_matrix_regs->matrixF1_Address = (int) spec_mat_f1_bis; | |
|
52 | } | |
|
53 | else | |
|
54 | { | |
|
55 | spectral_matrix_regs->matrixF1_Address = (int) spec_mat_f1; | |
|
56 | } | |
|
57 | spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffb; | |
|
58 | break; | |
|
59 | case 3: | |
|
60 | if (spectral_matrix_regs->matrixF2_Address == (int) spec_mat_f2) | |
|
61 | { | |
|
62 | spectral_matrix_regs->matrixF2_Address = (int) spec_mat_f2_bis; | |
|
63 | } | |
|
64 | else | |
|
65 | { | |
|
66 | spectral_matrix_regs->matrixF2_Address = (int) spec_mat_f2; | |
|
67 | } | |
|
68 | spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffff7; | |
|
69 | break; | |
|
70 | default: | |
|
71 | break; | |
|
72 | } | |
|
73 | } | |
|
74 | } | |
|
75 | ||
|
76 | // reset error codes to 0 | |
|
77 | spectral_matrix_regs->status = spectral_matrix_regs->status & 0xffffffcf; // [1100 1111] | |
|
78 | ||
|
16 | 79 | if (rtems_event_send( Task_id[TASKID_SMIQ], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
17 | 80 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_4 ); |
|
18 | 81 | } |
@@ -24,17 +87,13 rtems_task smiq_task(rtems_task_argument | |||
|
24 | 87 | { |
|
25 | 88 | rtems_event_set event_out; |
|
26 | 89 | unsigned int nb_interrupt_f0 = 0; |
|
27 | unsigned int nb_interrupt_f0_MAX = 0; | |
|
28 | ||
|
29 | nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256 | |
|
30 | + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100; | |
|
31 | 90 | |
|
32 | 91 | PRINTF("in SMIQ *** \n") |
|
33 | 92 | |
|
34 | 93 | while(1){ |
|
35 | 94 | rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0 |
|
36 | 95 | nb_interrupt_f0 = nb_interrupt_f0 + 1; |
|
37 | if (nb_interrupt_f0 == nb_interrupt_f0_MAX ){ | |
|
96 | if (nb_interrupt_f0 == param_local.local_nb_interrupt_f0_MAX ){ | |
|
38 | 97 | if (rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) |
|
39 | 98 | { |
|
40 | 99 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); |
@@ -58,13 +117,13 rtems_task spw_bppr_task(rtems_task_argu | |||
|
58 | 117 | status = rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); |
|
59 | 118 | if (status == RTEMS_SUCCESSFUL) { |
|
60 | 119 | if ((spectral_matrix_regs->status & 0x00000001)==1) { |
|
61 |
matrix_average(spec_mat_f0_ |
|
|
120 | matrix_average(spec_mat_f0_0, averaged_spec_mat_f0); | |
|
62 | 121 | spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffe; |
|
63 | 122 | //printf("f0_a\n"); |
|
64 | 123 | Nb_average_f0++; |
|
65 | 124 | } |
|
66 | 125 | if (((spectral_matrix_regs->status>>1) & 0x00000001)==1) { |
|
67 |
matrix_average(spec_mat_f0_ |
|
|
126 | matrix_average(spec_mat_f0_1, compressed_spec_mat_f0); | |
|
68 | 127 | spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffd; |
|
69 | 128 | //printf("f0_b\n"); |
|
70 | 129 | Nb_average_f0++; |
@@ -137,11 +196,15 rtems_task matr_task(rtems_task_argument | |||
|
137 | 196 | |
|
138 | 197 | PRINTF("in MATR *** \n") |
|
139 | 198 | |
|
140 |
|
|
|
199 | fill_averaged_spectral_matrix( ); | |
|
141 | 200 | |
|
142 | 201 | while(1){ |
|
143 | 202 | rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0 |
|
144 | 203 | |
|
204 | #ifdef GSA | |
|
205 | #else | |
|
206 | fill_averaged_spectral_matrix( ); | |
|
207 | #endif | |
|
145 | 208 | convert_averaged_spectral_matrix( averaged_spec_mat_f0, averaged_spec_mat_f0_char); |
|
146 | 209 | |
|
147 | 210 | send_spectral_matrix( &headerASM, averaged_spec_mat_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM); |
@@ -154,8 +217,8 void matrix_average(volatile int *spec_m | |||
|
154 | 217 | { |
|
155 | 218 | int i; |
|
156 | 219 | for(i=0; i<TOTAL_SIZE_SM; i++){ |
|
157 |
averaged_spec_mat[i] = averaged_spec_mat[i] + spec_mat_f0_ |
|
|
158 |
+ spec_mat_f0_ |
|
|
220 | averaged_spec_mat[i] = averaged_spec_mat[i] + spec_mat_f0_0[i] | |
|
221 | + spec_mat_f0_1[i] | |
|
159 | 222 | + spec_mat_f0_c[i] |
|
160 | 223 | + spec_mat_f0_d[i] |
|
161 | 224 | + spec_mat_f0_e[i] |
@@ -497,10 +560,13 void convert_averaged_spectral_matrix( v | |||
|
497 | 560 | } |
|
498 | 561 | } |
|
499 | 562 | |
|
500 |
void |
|
|
563 | void fill_averaged_spectral_matrix( ) | |
|
501 | 564 | { |
|
565 | ||
|
566 | #ifdef GSA | |
|
502 | 567 | float offset = 10.; |
|
503 | 568 | float coeff = 100000.; |
|
569 | ||
|
504 | 570 | averaged_spec_mat_f0[ 0 + 25 * 0 ] = 0. + offset; |
|
505 | 571 | averaged_spec_mat_f0[ 0 + 25 * 1 ] = 1. + offset; |
|
506 | 572 | averaged_spec_mat_f0[ 0 + 25 * 2 ] = 2. + offset; |
@@ -564,12 +630,33 void init_averaged_spectral_matrix( ) | |||
|
564 | 630 | averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 13 ] = averaged_spec_mat_f0[ 13 ]; |
|
565 | 631 | averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 14 ] = averaged_spec_mat_f0[ 14 ]; |
|
566 | 632 | averaged_spec_mat_f0[ (TOTAL_SIZE_SM/2) + 15 ] = averaged_spec_mat_f0[ 15 ]; |
|
633 | #else | |
|
634 | unsigned int i; | |
|
635 | ||
|
636 | for(i=0; i<TOTAL_SIZE_SM; i++) | |
|
637 | { | |
|
638 | if (spectral_matrix_regs->matrixF0_Address0 == (int) spec_mat_f0_0) | |
|
639 | averaged_spec_mat_f0[i] = (float) spec_mat_f0_0_bis[ SM_HEADER + i ]; | |
|
640 | else | |
|
641 | averaged_spec_mat_f0[i] = (float) spec_mat_f0_0[ SM_HEADER + i ]; | |
|
642 | } | |
|
643 | #endif | |
|
567 | 644 | } |
|
568 | 645 | |
|
569 | 646 | void reset_spectral_matrix_regs() |
|
570 | 647 | { |
|
571 | 648 | #ifdef GSA |
|
572 | 649 | #else |
|
573 | ||
|
650 | spectral_matrix_regs->matrixF0_Address0 = (int) spec_mat_f0_0; | |
|
651 | spectral_matrix_regs->matrixFO_Address1 = (int) spec_mat_f0_1; | |
|
652 | spectral_matrix_regs->matrixF1_Address = (int) spec_mat_f1; | |
|
653 | spectral_matrix_regs->matrixF2_Address = (int) spec_mat_f2; | |
|
574 | 654 | #endif |
|
575 | 655 | } |
|
656 | ||
|
657 | //****************** | |
|
658 | // general functions | |
|
659 | ||
|
660 | ||
|
661 | ||
|
662 |
@@ -467,17 +467,17 rtems_task actn_task( rtems_task_argumen | |||
|
467 | 467 | break; |
|
468 | 468 | // |
|
469 | 469 | case TC_SUBTYPE_LOAD_BURST: |
|
470 |
result = action_ |
|
|
470 | result = action_load_burst( &TC ); | |
|
471 | 471 | close_action( &TC, result ); |
|
472 | 472 | break; |
|
473 | 473 | // |
|
474 | 474 | case TC_SUBTYPE_LOAD_SBM1: |
|
475 |
result = action_ |
|
|
475 | result = action_load_sbm1( &TC ); | |
|
476 | 476 | close_action( &TC, result ); |
|
477 | 477 | break; |
|
478 | 478 | // |
|
479 | 479 | case TC_SUBTYPE_LOAD_SBM2: |
|
480 |
result = action_ |
|
|
480 | result = action_load_sbm2( &TC ); | |
|
481 | 481 | close_action( &TC, result ); |
|
482 | 482 | break; |
|
483 | 483 | // |
@@ -665,8 +665,10 int action_load_burst(ccsdsTelecommandPa | |||
|
665 | 665 | result = LFR_DEFAULT; |
|
666 | 666 | } |
|
667 | 667 | else { |
|
668 | send_tm_lfr_tc_exe_not_implemented( TC ); | |
|
669 | result = LFR_DEFAULT; | |
|
668 | parameter_dump_packet.sy_lfr_b_bp_p0 = TC->dataAndCRC[0]; | |
|
669 | parameter_dump_packet.sy_lfr_b_bp_p1 = TC->dataAndCRC[1]; | |
|
670 | ||
|
671 | result = LFR_SUCCESSFUL; | |
|
670 | 672 | } |
|
671 | 673 | |
|
672 | 674 | return result; |
@@ -680,13 +682,15 int action_load_sbm1(ccsdsTelecommandPac | |||
|
680 | 682 | result = LFR_DEFAULT; |
|
681 | 683 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
682 | 684 | |
|
683 |
if ( |
|
|
685 | if ( lfrMode == LFR_MODE_SBM1 ) { | |
|
684 | 686 | send_tm_lfr_tc_exe_not_executable( TC ); |
|
685 | 687 | result = LFR_DEFAULT; |
|
686 | 688 | } |
|
687 | 689 | else { |
|
688 | send_tm_lfr_tc_exe_not_implemented( TC ); | |
|
689 | result = LFR_DEFAULT; | |
|
690 | parameter_dump_packet.sy_lfr_s1_bp_p0 = TC->dataAndCRC[0]; | |
|
691 | parameter_dump_packet.sy_lfr_s1_bp_p1 = TC->dataAndCRC[1]; | |
|
692 | ||
|
693 | result = LFR_SUCCESSFUL; | |
|
690 | 694 | } |
|
691 | 695 | |
|
692 | 696 | return result; |
@@ -700,13 +704,15 int action_load_sbm2(ccsdsTelecommandPac | |||
|
700 | 704 | result = LFR_DEFAULT; |
|
701 | 705 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
702 | 706 | |
|
703 |
if ( |
|
|
707 | if ( lfrMode == LFR_MODE_SBM2 ) { | |
|
704 | 708 | send_tm_lfr_tc_exe_not_executable( TC ); |
|
705 | 709 | result = LFR_DEFAULT; |
|
706 | 710 | } |
|
707 | 711 | else { |
|
708 | send_tm_lfr_tc_exe_not_implemented( TC ); | |
|
709 | result = LFR_DEFAULT; | |
|
712 | parameter_dump_packet.sy_lfr_s2_bp_p0 = TC->dataAndCRC[0]; | |
|
713 | parameter_dump_packet.sy_lfr_s2_bp_p1 = TC->dataAndCRC[1]; | |
|
714 | ||
|
715 | result = LFR_SUCCESSFUL; | |
|
710 | 716 | } |
|
711 | 717 | |
|
712 | 718 | return result; |
@@ -841,7 +847,7 int transition_validation(unsigned char | |||
|
841 | 847 | } |
|
842 | 848 | break; |
|
843 | 849 | case LFR_MODE_BURST: |
|
844 |
if ( lfrMode == LFR_MODE_ST |
|
|
850 | if ( lfrMode == LFR_MODE_BURST ) { | |
|
845 | 851 | status = LFR_DEFAULT; |
|
846 | 852 | } |
|
847 | 853 | else { |
@@ -895,13 +901,7 int stop_current_mode() | |||
|
895 | 901 | // suspend several tasks |
|
896 | 902 | |
|
897 | 903 | if (lfrMode != LFR_MODE_STANDBY) { |
|
898 | status = rtems_task_suspend( Task_id[TASKID_AVF0] ); | |
|
899 | if (status == RTEMS_SUCCESSFUL) { | |
|
900 | status = rtems_task_suspend( Task_id[TASKID_BPF0] ); | |
|
901 | if (status == RTEMS_SUCCESSFUL) { | |
|
902 | status = rtems_task_suspend( Task_id[TASKID_WFRM] ); | |
|
903 | } | |
|
904 | } | |
|
904 | suspend_science_tasks(); | |
|
905 | 905 | } |
|
906 | 906 | |
|
907 | 907 | if (status != RTEMS_SUCCESSFUL) |
@@ -959,29 +959,30 int enter_normal_mode( ccsdsTelecommandP | |||
|
959 | 959 | { |
|
960 | 960 | rtems_status_code status; |
|
961 | 961 | |
|
962 | status = rtems_task_restart( Task_id[TASKID_AVF0], 0 ); | |
|
963 | if (status == RTEMS_SUCCESSFUL) { | |
|
964 | status = rtems_task_restart( Task_id[TASKID_BPF0], 0 ); | |
|
965 | if (status == RTEMS_SUCCESSFUL) { | |
|
966 | status = rtems_task_restart( Task_id[TASKID_WFRM], 0 ); | |
|
967 | } | |
|
968 | } | |
|
962 | status = restart_science_tasks(); | |
|
969 | 963 | |
|
970 | 964 | #ifdef GSA |
|
971 | 965 | timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR ); |
|
972 | 966 | timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR ); |
|
973 | 967 | LEON_Clear_interrupt( IRQ_WF ); |
|
974 | 968 | LEON_Unmask_interrupt( IRQ_WF ); |
|
969 | // | |
|
970 | set_local_nb_interrupt_f0_MAX(); | |
|
975 | 971 | LEON_Clear_interrupt( IRQ_SM ); // the IRQ_SM seems to be incompatible with the IRQ_WF on the xilinx board |
|
976 | 972 | LEON_Unmask_interrupt( IRQ_SM ); |
|
977 | 973 | #else |
|
974 | // waveform picker | |
|
978 | 975 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
979 | 976 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
980 |
waveform_picker_regs |
|
|
981 | waveform_picker_regs->addr_data_f1 = (int) wf_snap_f1; | |
|
982 | waveform_picker_regs->status = 0x00; | |
|
983 | LEON_Clear_interrupt( IRQ_SM ); // the IRQ_SM seems to be incompatible with the IRQ_WF on the xilinx board | |
|
984 | LEON_Unmask_interrupt( IRQ_SM ); | |
|
977 | reset_waveform_picker_regs(); | |
|
978 | set_wfp_burst_enable_register(LFR_MODE_NORMAL); | |
|
979 | // spectral matrix | |
|
980 | // | |
|
981 | set_local_nb_interrupt_f0_MAX(); | |
|
982 | LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX ); // the IRQ_SM seems to be incompatible with the IRQ_WF on the xilinx board | |
|
983 | LEON_Unmask_interrupt( IRQ_SPECTRAL_MATRIX ); | |
|
984 | spectral_matrix_regs->config = 0x01; | |
|
985 | spectral_matrix_regs->status = 0x00; | |
|
985 | 986 | #endif |
|
986 | 987 | |
|
987 | 988 | return status; |
@@ -994,19 +995,14 int enter_burst_mode(ccsdsTelecommandPac | |||
|
994 | 995 | |
|
995 | 996 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
996 | 997 | |
|
997 | status = rtems_task_restart( Task_id[TASKID_AVF0], 0 ); | |
|
998 | if (status == RTEMS_SUCCESSFUL) { | |
|
999 | status = rtems_task_restart( Task_id[TASKID_BPF0], 0 ); | |
|
1000 | if (status == RTEMS_SUCCESSFUL) { | |
|
1001 | status = rtems_task_restart( Task_id[TASKID_WFRM], 0 ); | |
|
1002 | } | |
|
1003 | } | |
|
998 | status = restart_science_tasks(); | |
|
1004 | 999 | |
|
1005 | 1000 | #ifdef GSA |
|
1006 | 1001 | #else |
|
1007 | 1002 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
1008 | 1003 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
1009 |
waveform_picker_regs |
|
|
1004 | reset_waveform_picker_regs(); | |
|
1005 | set_wfp_burst_enable_register(LFR_MODE_BURST); | |
|
1010 | 1006 | waveform_picker_regs->burst_enable = 0x40; // [0100 0000] burst f2, f1, f0 enable f3 f2 f1 f0 |
|
1011 | 1007 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x04; |
|
1012 | 1008 | waveform_picker_regs->status = 0x00; |
@@ -1021,27 +1017,18 int enter_sbm1_mode(ccsdsTelecommandPack | |||
|
1021 | 1017 | { |
|
1022 | 1018 | rtems_status_code status; |
|
1023 | 1019 | |
|
1024 | status = rtems_task_restart( Task_id[TASKID_AVF0], 0 ); | |
|
1025 | if (status == RTEMS_SUCCESSFUL) { | |
|
1026 | status = rtems_task_restart( Task_id[TASKID_BPF0], 0 ); | |
|
1027 | if (status == RTEMS_SUCCESSFUL) { | |
|
1028 | status = rtems_task_restart( Task_id[TASKID_WFRM], 0 ); | |
|
1029 | } | |
|
1030 | } | |
|
1020 | status = restart_science_tasks(); | |
|
1031 | 1021 | |
|
1032 | // at the beginning of the mode, the parameter local_sbm1_nb_cwf_max has a specific value | |
|
1033 | param_local.local_sbm1_nb_cwf_max = 2 * ( | |
|
1034 | (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256) | |
|
1035 | + parameter_dump_packet.sy_lfr_n_swf_p[1] | |
|
1036 | )/ 4; | |
|
1022 | set_local_sbm1_nb_cwf_max(); | |
|
1023 | ||
|
1024 | reset_local_sbm1_nb_cwf_sent(); | |
|
1037 | 1025 | |
|
1038 | 1026 | #ifdef GSA |
|
1039 | 1027 | #else |
|
1040 | 1028 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
1041 | 1029 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
1042 | waveform_picker_regs->addr_data_f1 = (int) wf_snap_f1; | |
|
1043 | waveform_picker_regs->burst_enable = 0x20; // [0010 0000] burst f2, f1, f0 enable f3 f2 f1 f0 | |
|
1044 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x07; // [0111] enable f3 f2 f1 f0 | |
|
1030 | reset_waveform_picker_regs(); | |
|
1031 | set_wfp_burst_enable_register(LFR_MODE_SBM1); | |
|
1045 | 1032 | waveform_picker_regs->status = 0x00; |
|
1046 | 1033 | #endif |
|
1047 | 1034 | |
@@ -1054,27 +1041,18 int enter_sbm2_mode(ccsdsTelecommandPack | |||
|
1054 | 1041 | { |
|
1055 | 1042 | rtems_status_code status; |
|
1056 | 1043 | |
|
1057 | status = rtems_task_restart( Task_id[TASKID_AVF0], 0 ); | |
|
1058 | if (status == RTEMS_SUCCESSFUL) { | |
|
1059 | status = rtems_task_restart( Task_id[TASKID_BPF0], 0 ); | |
|
1060 | if (status == RTEMS_SUCCESSFUL) { | |
|
1061 | status = rtems_task_restart( Task_id[TASKID_WFRM], 0 ); | |
|
1062 | } | |
|
1063 | } | |
|
1044 | status = restart_science_tasks(); | |
|
1064 | 1045 | |
|
1065 | // at the beginning of the mode, the parameter local_sbm2_nb_cwf_max has a specific value | |
|
1066 | param_local.local_sbm1_nb_cwf_max = ( | |
|
1067 | (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256) | |
|
1068 | + parameter_dump_packet.sy_lfr_n_swf_p[1] | |
|
1069 | ) / 16; | |
|
1046 | set_local_sbm2_nb_cwf_max(); | |
|
1047 | ||
|
1048 | reset_local_sbm2_nb_cwf_sent(); | |
|
1070 | 1049 | |
|
1071 | 1050 | #ifdef GSA |
|
1072 | 1051 | #else |
|
1073 | 1052 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
1074 | 1053 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
1075 | waveform_picker_regs->addr_data_f2 = (int) wf_snap_f2; | |
|
1076 | waveform_picker_regs->burst_enable = 0x40; // [0100 0000] burst f2, f1, f0 enable f3 f2 f1 f0 | |
|
1077 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x04; | |
|
1054 | reset_waveform_picker_regs(); | |
|
1055 | set_wfp_burst_enable_register(LFR_MODE_SBM2); | |
|
1078 | 1056 | waveform_picker_regs->status = 0x00; |
|
1079 | 1057 | #endif |
|
1080 | 1058 | |
@@ -1083,6 +1061,43 int enter_sbm2_mode(ccsdsTelecommandPack | |||
|
1083 | 1061 | return status; |
|
1084 | 1062 | } |
|
1085 | 1063 | |
|
1064 | int restart_science_tasks() | |
|
1065 | { | |
|
1066 | rtems_status_code status; | |
|
1067 | ||
|
1068 | status = rtems_task_restart( Task_id[TASKID_AVF0], 0 ); | |
|
1069 | ||
|
1070 | if (status == RTEMS_SUCCESSFUL) { | |
|
1071 | status = rtems_task_restart( Task_id[TASKID_BPF0], 0 ); | |
|
1072 | if (status == RTEMS_SUCCESSFUL) { | |
|
1073 | status = rtems_task_restart( Task_id[TASKID_WFRM], 0 ); | |
|
1074 | if (status == RTEMS_SUCCESSFUL) { | |
|
1075 | status = rtems_task_restart( Task_id[TASKID_CWF3], 0 ); | |
|
1076 | } | |
|
1077 | } | |
|
1078 | } | |
|
1079 | ||
|
1080 | return status; | |
|
1081 | } | |
|
1082 | ||
|
1083 | int suspend_science_tasks() | |
|
1084 | { | |
|
1085 | rtems_status_code status; | |
|
1086 | ||
|
1087 | status = rtems_task_suspend( Task_id[TASKID_AVF0] ); | |
|
1088 | if (status == RTEMS_SUCCESSFUL) { | |
|
1089 | status = rtems_task_suspend( Task_id[TASKID_BPF0] ); | |
|
1090 | if (status == RTEMS_SUCCESSFUL) { | |
|
1091 | status = rtems_task_suspend( Task_id[TASKID_WFRM] ); | |
|
1092 | if (status == RTEMS_SUCCESSFUL) { | |
|
1093 | status = rtems_task_suspend( Task_id[TASKID_CWF3] ); | |
|
1094 | } | |
|
1095 | } | |
|
1096 | } | |
|
1097 | ||
|
1098 | return status; | |
|
1099 | } | |
|
1100 | ||
|
1086 | 1101 | //**************** |
|
1087 | 1102 | // CLOSING ACTIONS |
|
1088 | 1103 |
@@ -5,6 +5,27 rtems_isr waveforms_isr( rtems_vector_nu | |||
|
5 | 5 | unsigned char lfrMode; |
|
6 | 6 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
7 | 7 | |
|
8 | #ifdef GSA | |
|
9 | #else | |
|
10 | if ( (lfrMode != LFR_MODE_STANDBY) & (lfrMode != LFR_MODE_BURST) ) | |
|
11 | { // in modes other than STANDBY and BURST, send the CWF_F3 data | |
|
12 | if ((waveform_picker_regs->status & 0x08) == 0x08){ // f3 is full | |
|
13 | // (1) change the receiving buffer for the waveform picker | |
|
14 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) { | |
|
15 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_bis); | |
|
16 | } | |
|
17 | else { | |
|
18 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); | |
|
19 | } | |
|
20 | // (2) send an event for the waveforms transmission | |
|
21 | if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_MODE_NORMAL_CWF_F3 ) != RTEMS_SUCCESSFUL) { | |
|
22 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
|
23 | } | |
|
24 | waveform_picker_regs->status = waveform_picker_regs->status & 0x0007; // reset the f3 full bit to 0 | |
|
25 | } | |
|
26 | } | |
|
27 | #endif | |
|
28 | ||
|
8 | 29 | switch(lfrMode) |
|
9 | 30 | { |
|
10 | 31 | //******** |
@@ -18,18 +39,14 rtems_isr waveforms_isr( rtems_vector_nu | |||
|
18 | 39 | #ifdef GSA |
|
19 | 40 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") |
|
20 | 41 | #else |
|
21 | if ( (waveform_picker_regs->burst_enable & 0x7) == 0x0 ){// if no channel is enable | |
|
22 |
|
|
|
23 | PRINTF("in waveform_isr *** Error sending event to DUMB\n"); | |
|
24 | } | |
|
42 | if ( (waveform_picker_regs->burst_enable & 0x7) == 0x0 ){ // if no channel is enable | |
|
43 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
|
25 | 44 | } |
|
26 | 45 | else { |
|
27 |
if ( (waveform_picker_regs->status & 0x7) == 0x7 ){ |
|
|
28 |
waveform_picker_regs->burst_enable = |
|
|
46 | if ( (waveform_picker_regs->status & 0x7) == 0x7 ){ // f2 f1 and f0 are full | |
|
47 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable & 0x08; | |
|
29 | 48 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { |
|
30 |
|
|
|
31 | PRINTF("in waveform_isr *** Error sending event to DUMB\n"); | |
|
32 | } | |
|
49 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
|
33 | 50 | } |
|
34 | 51 | } |
|
35 | 52 | } |
@@ -64,7 +81,7 rtems_isr waveforms_isr( rtems_vector_nu | |||
|
64 | 81 | #ifdef GSA |
|
65 | 82 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") |
|
66 | 83 | #else |
|
67 | if ((waveform_picker_regs->status & 0x02) == 0x02){ // check the f1 full bit | |
|
84 | if ((waveform_picker_regs->status & 0x02) == 0x02){ // [0010] check the f1 full bit | |
|
68 | 85 | // (1) change the receiving buffer for the waveform picker |
|
69 | 86 | if (waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) { |
|
70 | 87 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_bis); |
@@ -79,7 +96,7 rtems_isr waveforms_isr( rtems_vector_nu | |||
|
79 | 96 | } |
|
80 | 97 | waveform_picker_regs->status = waveform_picker_regs->status & 0x000d; // reset the f1 full bit to 0 |
|
81 | 98 | } |
|
82 |
if ( ( (waveform_picker_regs->status & 0x05) == 0x05 ) ) { // [0101] |
|
|
99 | if ( ( (waveform_picker_regs->status & 0x05) == 0x05 ) ) { // [0101] check the f2 and f0 full bit | |
|
83 | 100 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { |
|
84 | 101 | PRINTF("in waveforms_isr *** Error sending event to WFRM\n") |
|
85 | 102 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
@@ -87,6 +104,7 rtems_isr waveforms_isr( rtems_vector_nu | |||
|
87 | 104 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x05; // [0101] // enable f2 and f0 |
|
88 | 105 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffaaa; // set to 0 the bits related to f2 and f0 |
|
89 | 106 | } |
|
107 | ||
|
90 | 108 | #endif |
|
91 | 109 | break; |
|
92 | 110 | |
@@ -184,18 +202,21 rtems_task wfrm_task(rtems_task_argument | |||
|
184 | 202 | intEventOut = (unsigned int) event_out; |
|
185 | 203 | for (i = 0; i< 5; i++) { |
|
186 | 204 | if ( ( (intEventOut >> i) & 0x0001) != 0 ) { |
|
205 | ||
|
187 | 206 | switch(i) { |
|
207 | ||
|
188 | 208 | case(LFR_MODE_NORMAL): |
|
189 | send_waveform_norm( &headerSWF, &spw_ioctl_send_SWF); | |
|
209 | send_waveform_norm( &headerSWF, &spw_ioctl_send_SWF ); | |
|
190 | 210 | break; |
|
211 | ||
|
191 | 212 | case(LFR_MODE_BURST): |
|
192 | send_waveform_burst( &headerCWF, &spw_ioctl_send_CWF); | |
|
213 | send_waveform_burst( &headerCWF, &spw_ioctl_send_CWF ); | |
|
193 | 214 | break; |
|
215 | ||
|
194 | 216 | case(LFR_MODE_SBM1): |
|
195 | send_waveform_sbm1( &headerCWF, &spw_ioctl_send_CWF); | |
|
217 | send_waveform_sbm1( &headerCWF, &spw_ioctl_send_CWF ); | |
|
196 | 218 | #ifdef GSA |
|
197 | 219 | #else |
|
198 | param_local.local_sbm1_nb_cwf_sent ++; | |
|
199 | 220 | if ( param_local.local_sbm1_nb_cwf_sent == (param_local.local_sbm1_nb_cwf_max-1) ) { |
|
200 | 221 | // send the f1 buffer as a NORM snapshot |
|
201 | 222 | if (waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) { |
@@ -204,14 +225,18 rtems_task wfrm_task(rtems_task_argument | |||
|
204 | 225 | else { |
|
205 | 226 | send_waveform_SWF( &headerSWF, wf_snap_f1, SID_NORM_SWF_F1, &spw_ioctl_send_SWF ); |
|
206 | 227 | } |
|
228 | reset_local_sbm1_nb_cwf_sent(); | |
|
229 | } | |
|
230 | else { | |
|
231 | param_local.local_sbm1_nb_cwf_sent ++; | |
|
207 | 232 | } |
|
208 | 233 | #endif |
|
209 | 234 | break; |
|
235 | ||
|
210 | 236 | case(LFR_MODE_SBM2): |
|
211 | send_waveform_sbm2( &headerCWF, &spw_ioctl_send_CWF); | |
|
237 | send_waveform_sbm2( &headerCWF, &spw_ioctl_send_CWF ); | |
|
212 | 238 | #ifdef GSA |
|
213 | 239 | #else |
|
214 | param_local.local_sbm2_nb_cwf_sent ++; | |
|
215 | 240 | if ( param_local.local_sbm2_nb_cwf_sent == (param_local.local_sbm2_nb_cwf_max-1) ) { |
|
216 | 241 | // send the f2 buffer as a NORM snapshot |
|
217 | 242 | if (waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) { |
@@ -220,9 +245,14 rtems_task wfrm_task(rtems_task_argument | |||
|
220 | 245 | else { |
|
221 | 246 | send_waveform_SWF( &headerSWF, wf_snap_f2, SID_NORM_SWF_F2, &spw_ioctl_send_SWF ); |
|
222 | 247 | } |
|
248 | reset_local_sbm2_nb_cwf_sent(); | |
|
249 | } | |
|
250 | else { | |
|
251 | param_local.local_sbm2_nb_cwf_sent ++; | |
|
223 | 252 | } |
|
224 | 253 | #endif |
|
225 | 254 | break; |
|
255 | ||
|
226 | 256 | default: |
|
227 | 257 | break; |
|
228 | 258 | } |
@@ -231,6 +261,30 rtems_task wfrm_task(rtems_task_argument | |||
|
231 | 261 | } |
|
232 | 262 | } |
|
233 | 263 | |
|
264 | rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP | |
|
265 | { | |
|
266 | spw_ioctl_pkt_send spw_ioctl_send_CWF; | |
|
267 | rtems_event_set event_out; | |
|
268 | Header_TM_LFR_SCIENCE_CWF_t headerCWF; | |
|
269 | ||
|
270 | init_header_continuous_wf( &headerCWF ); | |
|
271 | ||
|
272 | // BUILD THE PACKET HEADER | |
|
273 | spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header | |
|
274 | spw_ioctl_send_CWF.hdr = (char*) &headerCWF; | |
|
275 | spw_ioctl_send_CWF.options = 0; | |
|
276 | ||
|
277 | PRINTF("in CWF3 ***\n") | |
|
278 | ||
|
279 | while(1){ | |
|
280 | // wait for an RTEMS_EVENT | |
|
281 | rtems_event_receive( RTEMS_EVENT_5, | |
|
282 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); | |
|
283 | PRINTF("send CWF F3 \n") | |
|
284 | send_waveform_norm_cwf_f3( &headerCWF, &spw_ioctl_send_CWF ); | |
|
285 | } | |
|
286 | } | |
|
287 | ||
|
234 | 288 | //****************** |
|
235 | 289 | // general functions |
|
236 | 290 | void init_waveforms( void ) |
@@ -477,36 +531,6 void send_waveform_CWF( Header_TM_LFR_SC | |||
|
477 | 531 | } |
|
478 | 532 | } |
|
479 | 533 | |
|
480 | int build_value(int value1, int value0) | |
|
481 | { | |
|
482 | int aux = 0; | |
|
483 | int aux1 = 0; | |
|
484 | int aux0 = 0; | |
|
485 | int value1_aux = 0; | |
|
486 | int value0_aux = 0; | |
|
487 | ||
|
488 | value1_aux = value1; | |
|
489 | value0_aux = value0; | |
|
490 | ||
|
491 | //****** | |
|
492 | // B3 B2 | |
|
493 | if (value1_aux > 8191) value1_aux = 8191; | |
|
494 | if (value1_aux < -8192) value1_aux = -8192; | |
|
495 | aux1 = ( (int) ( ( (unsigned char) (value1_aux / 256 ) ) << 8 ) ) | |
|
496 | + ( (int) ( (unsigned char) (value1_aux ) ) ); | |
|
497 | ||
|
498 | //****** | |
|
499 | // B1 B0 | |
|
500 | if (value0_aux > 8191) value0_aux = 8191; | |
|
501 | if (value0_aux < -8192) value0_aux = -8192; | |
|
502 | aux0 = ( (int) ( ( (unsigned char) (value0_aux / 256) ) << 8 ) ) | |
|
503 | + ( (int) ( (unsigned char) (value0_aux ) ) ); | |
|
504 | ||
|
505 | aux = (aux1 << 16) + aux0; | |
|
506 | ||
|
507 | return aux; | |
|
508 | } | |
|
509 | ||
|
510 | 534 | void send_waveform_norm(Header_TM_LFR_SCIENCE_SWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send) |
|
511 | 535 | { |
|
512 | 536 | unsigned char lfrMode; |
@@ -522,46 +546,68 void send_waveform_norm(Header_TM_LFR_SC | |||
|
522 | 546 | header->time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
523 | 547 | header->time[5] = (unsigned char) (time_management_regs->fine_time); |
|
524 | 548 | |
|
525 | //*************** | |
|
526 | // send snapshots | |
|
527 | // F0 | |
|
528 | send_waveform_SWF( header, wf_snap_f0, SID_NORM_SWF_F0, spw_ioctl_send); | |
|
529 | // F1 | |
|
530 | if (lfrMode == LFR_MODE_NORMAL) // in SBM1 mode, the snapshot is sent by the send_waveform_sbm1 function | |
|
531 | { | |
|
549 | switch(lfrMode) { | |
|
550 | ||
|
551 | case LFR_MODE_NORMAL: | |
|
552 | send_waveform_SWF( header, wf_snap_f0, SID_NORM_SWF_F0, spw_ioctl_send); | |
|
532 | 553 | send_waveform_SWF( header, wf_snap_f1, SID_NORM_SWF_F1, spw_ioctl_send); |
|
554 | send_waveform_SWF( header, wf_snap_f2, SID_NORM_SWF_F2, spw_ioctl_send); | |
|
555 | #ifdef GSA | |
|
556 | #else | |
|
557 | waveform_picker_regs->status = waveform_picker_regs->status & 0x00; | |
|
558 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x07; // [0111] enable f2 f1 f0 | |
|
559 | #endif | |
|
560 | break; | |
|
561 | ||
|
562 | case LFR_MODE_SBM1: | |
|
563 | send_waveform_SWF( header, wf_snap_f0, SID_NORM_SWF_F0, spw_ioctl_send); | |
|
564 | // F1 data are sent by the send_waveform_sbm1 function | |
|
565 | send_waveform_SWF( header, wf_snap_f2, SID_NORM_SWF_F2, spw_ioctl_send); | |
|
566 | break; | |
|
567 | ||
|
568 | case LFR_MODE_SBM2: | |
|
569 | send_waveform_SWF( header, wf_snap_f0, SID_NORM_SWF_F0, spw_ioctl_send); | |
|
570 | send_waveform_SWF( header, wf_snap_f1, SID_NORM_SWF_F1, spw_ioctl_send); | |
|
571 | // F2 data are sent by the send_waveform_sbm2 function | |
|
572 | break; | |
|
573 | ||
|
574 | default: | |
|
575 | break; | |
|
533 | 576 | } |
|
534 | // F2 | |
|
535 | send_waveform_SWF( header, wf_snap_f2, SID_NORM_SWF_F2, spw_ioctl_send); | |
|
577 | ||
|
536 | 578 | #ifdef GSA |
|
537 | 579 | // irq processed, reset the related register of the timer unit |
|
538 | 580 | gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl = gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl | 0x00000010; |
|
539 | 581 | // clear the interruption |
|
540 | 582 | LEON_Unmask_interrupt( IRQ_WF ); |
|
583 | #endif | |
|
584 | ||
|
585 | } | |
|
586 | ||
|
587 | void send_waveform_norm_cwf_f3(Header_TM_LFR_SCIENCE_CWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send) | |
|
588 | { | |
|
589 | header->packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL >> 8); | |
|
590 | header->packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL); | |
|
591 | // TIME | |
|
592 | header->time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
|
593 | header->time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
|
594 | header->time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
|
595 | header->time[3] = (unsigned char) (time_management_regs->coarse_time); | |
|
596 | header->time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
|
597 | header->time[5] = (unsigned char) (time_management_regs->fine_time); | |
|
598 | ||
|
599 | //******************************* | |
|
600 | // send continuous waveform at f3 | |
|
601 | // F3 | |
|
602 | #ifdef GSA | |
|
541 | 603 | #else |
|
542 | // irq processed, reset the related register of the waveform picker | |
|
543 | if (lfrMode == LFR_MODE_SBM1) { | |
|
544 | param_local.local_sbm1_nb_cwf_sent = 0; | |
|
545 | // after the first transmission of the swf at F1, the period is set to local_sbm1_nb_cwf_max | |
|
546 | param_local.local_sbm1_nb_cwf_max = 2 * ( | |
|
547 | ( parameter_dump_packet.sy_lfr_n_swf_p[0] * 256 ) | |
|
548 | + parameter_dump_packet.sy_lfr_n_swf_p[1] | |
|
549 | ); | |
|
550 | } | |
|
551 | else if (lfrMode == LFR_MODE_SBM2) { | |
|
552 | param_local.local_sbm2_nb_cwf_sent = 0; | |
|
553 | // after the first transmission of the swf at F2, the period is set to local_sbm2_nb_cwf_max | |
|
554 | param_local.local_sbm2_nb_cwf_max = ( | |
|
555 | ( parameter_dump_packet.sy_lfr_n_swf_p[0] * 256 ) | |
|
556 | + parameter_dump_packet.sy_lfr_n_swf_p[1] | |
|
557 | )/ 8; | |
|
604 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) { | |
|
605 | send_waveform_CWF( header, wf_cont_f3_bis, SID_NORM_CWF_F3, spw_ioctl_send); | |
|
558 | 606 | } |
|
559 | 607 | else { |
|
560 | waveform_picker_regs->status = waveform_picker_regs->status & 0x00; | |
|
561 | waveform_picker_regs->burst_enable = 0x07; // [0111] enable f2 f1 f0 | |
|
608 | send_waveform_CWF( header, wf_cont_f3, SID_NORM_CWF_F3, spw_ioctl_send); | |
|
562 | 609 | } |
|
563 | 610 | #endif |
|
564 | ||
|
565 | 611 | } |
|
566 | 612 | |
|
567 | 613 | void send_waveform_burst(Header_TM_LFR_SCIENCE_CWF_t *header, spw_ioctl_pkt_send *spw_ioctl_send) |
@@ -639,10 +685,15 void send_waveform_sbm2(Header_TM_LFR_SC | |||
|
639 | 685 | |
|
640 | 686 | //************** |
|
641 | 687 | // wfp registers |
|
642 |
void set_wfp_data_shaping( |
|
|
688 | void set_wfp_data_shaping() | |
|
643 | 689 | { |
|
690 | unsigned char data_shaping; | |
|
691 | ||
|
644 | 692 | // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register |
|
645 | 693 | // waveform picker : [R1 R0 SP1 SP0 BW] |
|
694 | ||
|
695 | data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1; | |
|
696 | ||
|
646 | 697 | #ifdef GSA |
|
647 | 698 | #else |
|
648 | 699 | waveform_picker_regs->data_shaping = |
@@ -654,13 +705,60 void set_wfp_data_shaping(unsigned char | |||
|
654 | 705 | #endif |
|
655 | 706 | } |
|
656 | 707 | |
|
657 | void set_wfp_delta_snapshot(unsigned int delta_snapshot) | |
|
708 | char set_wfp_delta_snapshot() | |
|
709 | { | |
|
710 | char ret; | |
|
711 | unsigned int delta_snapshot; | |
|
712 | ret = LFR_DEFAULT; | |
|
713 | ||
|
714 | delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256 | |
|
715 | + parameter_dump_packet.sy_lfr_n_swf_p[1]; | |
|
716 | ||
|
717 | #ifdef GSA | |
|
718 | #else | |
|
719 | unsigned char aux = 0; | |
|
720 | if ( delta_snapshot < MIN_DELTA_SNAPSHOT ) | |
|
721 | { | |
|
722 | aux = MIN_DELTA_SNAPSHOT; | |
|
723 | ret = LFR_DEFAULT; | |
|
724 | } | |
|
725 | else | |
|
726 | { | |
|
727 | aux = delta_snapshot ; | |
|
728 | ret = LFR_SUCCESSFUL; | |
|
729 | } | |
|
730 | waveform_picker_regs->delta_snapshot = aux; // max 2 bytes | |
|
731 | #endif | |
|
732 | ||
|
733 | return ret; | |
|
734 | } | |
|
735 | ||
|
736 | void set_wfp_burst_enable_register( unsigned char mode) | |
|
658 | 737 | { |
|
659 | 738 | #ifdef GSA |
|
660 | 739 | #else |
|
661 | unsigned char aux = 0; | |
|
662 | aux = delta_snapshot / 2 ; | |
|
663 | waveform_picker_regs->delta_snapshot = aux; // max 2 bytes | |
|
740 | // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0 | |
|
741 | // the burst bits shall be set first, before the enable bits | |
|
742 | switch(mode) { | |
|
743 | case(LFR_MODE_NORMAL): | |
|
744 | waveform_picker_regs->burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0 | |
|
745 | break; | |
|
746 | case(LFR_MODE_BURST): | |
|
747 | waveform_picker_regs->burst_enable = 0x40; // [0100 0000] f2 burst enabled | |
|
748 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x04; // [0100] enable f2 | |
|
749 | break; | |
|
750 | case(LFR_MODE_SBM1): | |
|
751 | waveform_picker_regs->burst_enable = 0x20; // [0010 0000] f1 burst enabled | |
|
752 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0 | |
|
753 | break; | |
|
754 | case(LFR_MODE_SBM2): | |
|
755 | waveform_picker_regs->burst_enable = 0x40; // [0100 0000] f2 burst enabled | |
|
756 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0 | |
|
757 | break; | |
|
758 | default: | |
|
759 | waveform_picker_regs->burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled | |
|
760 | break; | |
|
761 | } | |
|
664 | 762 | #endif |
|
665 | 763 | } |
|
666 | 764 | |
@@ -676,19 +774,53 void reset_waveform_picker_regs() | |||
|
676 | 774 | { |
|
677 | 775 | #ifdef GSA |
|
678 | 776 | #else |
|
679 | set_wfp_data_shaping(parameter_dump_packet.bw_sp0_sp1_r0_r1); | |
|
777 | set_wfp_data_shaping(); | |
|
680 | 778 | reset_wfp_burst_enable(); |
|
681 | 779 | waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // |
|
682 | 780 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); // |
|
683 | 781 | waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); // |
|
684 | 782 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); // |
|
685 | waveform_picker_regs->status = 0x00; // | |
|
686 | set_wfp_delta_snapshot( | |
|
687 | ( parameter_dump_packet.sy_lfr_n_swf_p[0]*256) | |
|
688 | + parameter_dump_packet.sy_lfr_n_swf_p[1] ); // time in seconds between two snapshots | |
|
689 |
waveform_picker_regs-> |
|
|
690 |
waveform_picker_regs-> |
|
|
691 | waveform_picker_regs->nb_burst_available = 0x180; // max 3 bytes, size of the buffer in burst (1 burst = 16 x 4 octets) | |
|
692 | waveform_picker_regs->nb_snapshot_param = 0x7ff; // max 3 octets, 2048 - 1 | |
|
783 | set_wfp_delta_snapshot(); // time in seconds between two snapshots | |
|
784 | waveform_picker_regs->delta_f2_f1 = 0xffff; // max 4 bytes | |
|
785 | waveform_picker_regs->delta_f2_f0 = 0x17c00; // max 5 bytes | |
|
786 | waveform_picker_regs->nb_burst_available = 0x180; // max 3 bytes, size of the buffer in burst (1 burst = 16 x 4 octets) | |
|
787 | waveform_picker_regs->nb_snapshot_param = 0x7ff; // max 3 octets, 2048 - 1 | |
|
788 | waveform_picker_regs->status = 0x00; // | |
|
693 | 789 | #endif |
|
694 | 790 | } |
|
791 | ||
|
792 | //***************** | |
|
793 | // local parameters | |
|
794 | void set_local_sbm1_nb_cwf_max() | |
|
795 | { | |
|
796 | // (2 snapshots of 2048 points per seconds) * (period of the NORM snashots) | |
|
797 | param_local.local_sbm1_nb_cwf_max = 2 * ( | |
|
798 | parameter_dump_packet.sy_lfr_n_swf_p[0] * 256 | |
|
799 | + parameter_dump_packet.sy_lfr_n_swf_p[1] | |
|
800 | ); | |
|
801 | } | |
|
802 | ||
|
803 | void set_local_sbm2_nb_cwf_max() | |
|
804 | { | |
|
805 | // (period of the NORM snashots) / (8 seconds per snapshot at f2 = 256 Hz) | |
|
806 | param_local.local_sbm2_nb_cwf_max = ( | |
|
807 | parameter_dump_packet.sy_lfr_n_swf_p[0] * 256 | |
|
808 | + parameter_dump_packet.sy_lfr_n_swf_p[1] | |
|
809 | )/ 8; | |
|
810 | } | |
|
811 | ||
|
812 | void set_local_nb_interrupt_f0_MAX() | |
|
813 | { | |
|
814 | param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256 | |
|
815 | + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100; | |
|
816 | } | |
|
817 | ||
|
818 | void reset_local_sbm1_nb_cwf_sent() | |
|
819 | { | |
|
820 | param_local.local_sbm1_nb_cwf_sent = 0; | |
|
821 | } | |
|
822 | ||
|
823 | void reset_local_sbm2_nb_cwf_sent() | |
|
824 | { | |
|
825 | param_local.local_sbm2_nb_cwf_sent = 0; | |
|
826 | } |
General Comments 0
You need to be logged in to leave comments.
Login now