##// END OF EJS Templates
added nb_word_in_buffer to the waveform picker registers
paul -
r71:1b03ba925ab6 nov2013
parent child
Show More
@@ -1,248 +1,248
1 1 #############################################################################
2 2 # Makefile for building: bin/fsw
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Wed Nov 13 08:18:19 2013
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Wed Nov 13 13:54:37 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
7 7 #############################################################################
8 8
9 9 ####### Compiler, tools and options
10 10
11 11 CC = sparc-rtems-gcc
12 12 CXX = sparc-rtems-g++
13 13 DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=22 -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
17 17 LINK = sparc-rtems-g++
18 18 LFLAGS =
19 19 LIBS = $(SUBLIBS)
20 20 AR = sparc-rtems-ar rcs
21 21 RANLIB =
22 22 QMAKE = /usr/bin/qmake-qt4
23 23 TAR = tar -cf
24 24 COMPRESS = gzip -9f
25 25 COPY = cp -f
26 26 SED = sed
27 27 COPY_FILE = $(COPY)
28 28 COPY_DIR = $(COPY) -r
29 29 STRIP = sparc-rtems-strip
30 30 INSTALL_FILE = install -m 644 -p
31 31 INSTALL_DIR = $(COPY_DIR)
32 32 INSTALL_PROGRAM = install -m 755 -p
33 33 DEL_FILE = rm -f
34 34 SYMLINK = ln -f -s
35 35 DEL_DIR = rmdir
36 36 MOVE = mv -f
37 37 CHK_DIR_EXISTS= test -d
38 38 MKDIR = mkdir -p
39 39
40 40 ####### Output directory
41 41
42 42 OBJECTS_DIR = obj/
43 43
44 44 ####### Files
45 45
46 46 SOURCES = ../src/wf_handler.c \
47 47 ../src/tc_handler.c \
48 48 ../src/fsw_processing.c \
49 49 ../src/fsw_misc.c \
50 50 ../src/fsw_init.c \
51 51 ../src/fsw_globals.c \
52 52 ../src/fsw_spacewire.c \
53 53 ../src/tc_load_dump_parameters.c \
54 54 ../src/tm_lfr_tc_exe.c \
55 55 ../src/tc_acceptance.c
56 56 OBJECTS = obj/wf_handler.o \
57 57 obj/tc_handler.o \
58 58 obj/fsw_processing.o \
59 59 obj/fsw_misc.o \
60 60 obj/fsw_init.o \
61 61 obj/fsw_globals.o \
62 62 obj/fsw_spacewire.o \
63 63 obj/tc_load_dump_parameters.o \
64 64 obj/tm_lfr_tc_exe.o \
65 65 obj/tc_acceptance.o
66 66 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
67 67 /usr/lib64/qt4/mkspecs/common/linux.conf \
68 68 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
69 69 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
70 70 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
71 71 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
72 72 /usr/lib64/qt4/mkspecs/qconfig.pri \
73 73 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
74 74 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
75 75 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
76 76 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
77 77 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
78 78 sparc.pri \
79 79 /usr/lib64/qt4/mkspecs/features/release.prf \
80 80 /usr/lib64/qt4/mkspecs/features/default_post.prf \
81 81 /usr/lib64/qt4/mkspecs/features/shared.prf \
82 82 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
83 83 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
84 84 /usr/lib64/qt4/mkspecs/features/resources.prf \
85 85 /usr/lib64/qt4/mkspecs/features/uic.prf \
86 86 /usr/lib64/qt4/mkspecs/features/yacc.prf \
87 87 /usr/lib64/qt4/mkspecs/features/lex.prf \
88 88 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
89 89 fsw-qt.pro
90 90 QMAKE_TARGET = fsw
91 91 DESTDIR = bin/
92 92 TARGET = bin/fsw
93 93
94 94 first: all
95 95 ####### Implicit rules
96 96
97 97 .SUFFIXES: .o .c .cpp .cc .cxx .C
98 98
99 99 .cpp.o:
100 100 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
101 101
102 102 .cc.o:
103 103 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
104 104
105 105 .cxx.o:
106 106 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
107 107
108 108 .C.o:
109 109 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
110 110
111 111 .c.o:
112 112 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
113 113
114 114 ####### Build rules
115 115
116 116 all: Makefile $(TARGET)
117 117
118 118 $(TARGET): $(OBJECTS)
119 119 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
120 120 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
121 121
122 122 Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
123 123 /usr/lib64/qt4/mkspecs/common/linux.conf \
124 124 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
125 125 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
126 126 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
127 127 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
128 128 /usr/lib64/qt4/mkspecs/qconfig.pri \
129 129 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
130 130 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
131 131 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
132 132 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
133 133 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
134 134 sparc.pri \
135 135 /usr/lib64/qt4/mkspecs/features/release.prf \
136 136 /usr/lib64/qt4/mkspecs/features/default_post.prf \
137 137 /usr/lib64/qt4/mkspecs/features/shared.prf \
138 138 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
139 139 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
140 140 /usr/lib64/qt4/mkspecs/features/resources.prf \
141 141 /usr/lib64/qt4/mkspecs/features/uic.prf \
142 142 /usr/lib64/qt4/mkspecs/features/yacc.prf \
143 143 /usr/lib64/qt4/mkspecs/features/lex.prf \
144 144 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf
145 145 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
146 146 /usr/lib64/qt4/mkspecs/common/unix.conf:
147 147 /usr/lib64/qt4/mkspecs/common/linux.conf:
148 148 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
149 149 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
150 150 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
151 151 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
152 152 /usr/lib64/qt4/mkspecs/qconfig.pri:
153 153 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
154 154 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
155 155 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
156 156 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
157 157 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
158 158 sparc.pri:
159 159 /usr/lib64/qt4/mkspecs/features/release.prf:
160 160 /usr/lib64/qt4/mkspecs/features/default_post.prf:
161 161 /usr/lib64/qt4/mkspecs/features/shared.prf:
162 162 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
163 163 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
164 164 /usr/lib64/qt4/mkspecs/features/resources.prf:
165 165 /usr/lib64/qt4/mkspecs/features/uic.prf:
166 166 /usr/lib64/qt4/mkspecs/features/yacc.prf:
167 167 /usr/lib64/qt4/mkspecs/features/lex.prf:
168 168 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
169 169 qmake: FORCE
170 170 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
171 171
172 172 dist:
173 173 @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0
174 174 $(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
175 175
176 176
177 177 clean:compiler_clean
178 178 -$(DEL_FILE) $(OBJECTS)
179 179 -$(DEL_FILE) *~ core *.core
180 180
181 181
182 182 ####### Sub-libraries
183 183
184 184 distclean: clean
185 185 -$(DEL_FILE) $(TARGET)
186 186 -$(DEL_FILE) Makefile
187 187
188 188
189 189 grmon:
190 190 cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u
191 191
192 192 check: first
193 193
194 194 compiler_rcc_make_all:
195 195 compiler_rcc_clean:
196 196 compiler_uic_make_all:
197 197 compiler_uic_clean:
198 198 compiler_image_collection_make_all: qmake_image_collection.cpp
199 199 compiler_image_collection_clean:
200 200 -$(DEL_FILE) qmake_image_collection.cpp
201 201 compiler_yacc_decl_make_all:
202 202 compiler_yacc_decl_clean:
203 203 compiler_yacc_impl_make_all:
204 204 compiler_yacc_impl_clean:
205 205 compiler_lex_make_all:
206 206 compiler_lex_clean:
207 207 compiler_clean:
208 208
209 209 ####### Compile
210 210
211 211 obj/wf_handler.o: ../src/wf_handler.c
212 212 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c
213 213
214 214 obj/tc_handler.o: ../src/tc_handler.c
215 215 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c
216 216
217 217 obj/fsw_processing.o: ../src/fsw_processing.c ../src/fsw_processing_globals.c
218 218 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c
219 219
220 220 obj/fsw_misc.o: ../src/fsw_misc.c
221 221 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c
222 222
223 223 obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c
224 224 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c
225 225
226 226 obj/fsw_globals.o: ../src/fsw_globals.c
227 227 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c
228 228
229 229 obj/fsw_spacewire.o: ../src/fsw_spacewire.c
230 230 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c
231 231
232 232 obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c
233 233 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c
234 234
235 235 obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c
236 236 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c
237 237
238 238 obj/tc_acceptance.o: ../src/tc_acceptance.c
239 239 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c
240 240
241 241 ####### Install
242 242
243 243 install: FORCE
244 244
245 245 uninstall: FORCE
246 246
247 247 FORCE:
248 248
@@ -1,305 +1,305
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by QtCreator 2.8.1, 2013-11-13T13:39:43. -->
3 <!-- Written by QtCreator 2.8.1, 2013-11-13T13:50:25. -->
4 4 <qtcreator>
5 5 <data>
6 6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
7 7 <value type="int">0</value>
8 8 </data>
9 9 <data>
10 10 <variable>ProjectExplorer.Project.EditorSettings</variable>
11 11 <valuemap type="QVariantMap">
12 12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
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 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 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>
26 26 </valuemap>
27 27 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
28 28 <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
29 29 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
30 30 <value type="int" key="EditorConfiguration.IndentSize">4</value>
31 31 <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
32 32 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
33 33 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
34 34 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
35 35 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
36 36 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
37 37 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
38 38 <value type="int" key="EditorConfiguration.TabSize">8</value>
39 39 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
40 40 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
41 41 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
42 42 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
43 43 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
44 44 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
45 45 </valuemap>
46 46 </data>
47 47 <data>
48 48 <variable>ProjectExplorer.Project.PluginSettings</variable>
49 49 <valuemap type="QVariantMap"/>
50 50 </data>
51 51 <data>
52 52 <variable>ProjectExplorer.Project.Target.0</variable>
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 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">1</value>
60 60 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
61 61 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
62 62 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
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 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>
70 70 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
71 71 </valuemap>
72 72 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
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 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>
80 80 </valuelist>
81 81 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
82 82 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w -j 4</value>
83 83 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
84 84 </valuemap>
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 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 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>
99 99 </valuelist>
100 100 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
101 101 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w clean</value>
102 102 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
103 103 </valuemap>
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 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 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>
118 118 </valuemap>
119 119 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
120 120 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
121 121 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
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 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>
129 129 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
130 130 </valuemap>
131 131 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
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 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>
139 139 </valuelist>
140 140 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
141 141 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w </value>
142 142 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
143 143 </valuemap>
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 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 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>
158 158 </valuelist>
159 159 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
160 160 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w clean</value>
161 161 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
162 162 </valuemap>
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 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 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>
177 177 </valuemap>
178 178 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
179 179 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
180 180 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
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 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 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 192 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
193 193 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
194 194 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
195 195 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
196 196 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
197 197 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
198 198 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
199 199 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
200 200 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
201 201 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
202 202 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
203 203 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
204 204 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
205 205 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
206 206 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
207 207 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
208 208 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
209 209 <value type="int">0</value>
210 210 <value type="int">1</value>
211 211 <value type="int">2</value>
212 212 <value type="int">3</value>
213 213 <value type="int">4</value>
214 214 <value type="int">5</value>
215 215 <value type="int">6</value>
216 216 <value type="int">7</value>
217 217 <value type="int">8</value>
218 218 <value type="int">9</value>
219 219 <value type="int">10</value>
220 220 <value type="int">11</value>
221 221 <value type="int">12</value>
222 222 <value type="int">13</value>
223 223 <value type="int">14</value>
224 224 </valuelist>
225 225 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
226 226 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
227 227 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
228 228 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
229 229 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
230 230 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
231 231 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
232 232 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
233 233 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
234 234 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
235 235 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
236 236 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
237 237 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
238 238 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
239 239 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
240 240 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
241 241 </valuemap>
242 242 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
243 243 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
244 244 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
245 245 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
246 246 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
247 247 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
248 248 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
249 249 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
250 250 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
251 251 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
252 252 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
253 253 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
254 254 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
255 255 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
256 256 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
257 257 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
258 258 <value type="int">0</value>
259 259 <value type="int">1</value>
260 260 <value type="int">2</value>
261 261 <value type="int">3</value>
262 262 <value type="int">4</value>
263 263 <value type="int">5</value>
264 264 <value type="int">6</value>
265 265 <value type="int">7</value>
266 266 <value type="int">8</value>
267 267 <value type="int">9</value>
268 268 <value type="int">10</value>
269 269 <value type="int">11</value>
270 270 <value type="int">12</value>
271 271 <value type="int">13</value>
272 272 <value type="int">14</value>
273 273 </valuelist>
274 274 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
275 275 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
276 276 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
277 277 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">doxygen</value>
278 278 <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">true</value>
279 279 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">/opt/DEV_PLE/doc</value>
280 280 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Run doxygen</value>
281 281 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
282 282 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
283 283 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
284 284 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
285 285 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
286 286 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
287 287 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
288 288 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
289 289 </valuemap>
290 290 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
291 291 </valuemap>
292 292 </data>
293 293 <data>
294 294 <variable>ProjectExplorer.Project.TargetCount</variable>
295 295 <value type="int">1</value>
296 296 </data>
297 297 <data>
298 298 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
299 299 <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
300 300 </data>
301 301 <data>
302 302 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
303 303 <value type="int">14</value>
304 304 </data>
305 305 </qtcreator>
@@ -1,77 +1,78
1 1 #ifndef GRLIB_REGS_H_INCLUDED
2 2 #define GRLIB_REGS_H_INCLUDED
3 3
4 4 #define NB_GPTIMER 3
5 5
6 6 struct apbuart_regs_str{
7 7 volatile unsigned int data;
8 8 volatile unsigned int status;
9 9 volatile unsigned int ctrl;
10 10 volatile unsigned int scaler;
11 11 volatile unsigned int fifoDebug;
12 12 };
13 13
14 14 struct ahbuart_regs_str{
15 15 volatile unsigned int unused;
16 16 volatile unsigned int status;
17 17 volatile unsigned int ctrl;
18 18 volatile unsigned int scaler;
19 19 };
20 20
21 21 struct timer_regs_str
22 22 {
23 23 volatile unsigned int counter;
24 24 volatile unsigned int reload;
25 25 volatile unsigned int ctrl;
26 26 volatile unsigned int unused;
27 27 };
28 28 typedef struct timer_regs_str timer_regs_t;
29 29
30 30 struct gptimer_regs_str
31 31 {
32 32 volatile unsigned int scaler_value;
33 33 volatile unsigned int scaler_reload;
34 34 volatile unsigned int conf;
35 35 volatile unsigned int unused0;
36 36 timer_regs_t timer[NB_GPTIMER];
37 37 };
38 38 typedef struct gptimer_regs_str gptimer_regs_t;
39 39
40 40 struct time_management_regs_str{
41 41 volatile int ctrl; // bit 0 forces the load of the coarse_time_load value and resets the fine_time
42 42 volatile int coarse_time_load;
43 43 volatile int coarse_time;
44 44 volatile int fine_time;
45 45 };
46 46 typedef struct time_management_regs_str time_management_regs_t;
47 47
48 48 struct new_waveform_picker_regs_str{
49 volatile int data_shaping; // 0x00 00 *** R1 R0 SP1 SP0 BW
50 volatile int run_burst_enable; // 0x04 01 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
51 volatile int addr_data_f0; // 0x08
52 volatile int addr_data_f1; // 0x0c
53 volatile int addr_data_f2; // 0x10
54 volatile int addr_data_f3; // 0x14
55 volatile int status; // 0x18
56 volatile int delta_snapshot; // 0x1c
57 volatile int delta_f0; // 0x20
58 volatile int delta_f0_2;
59 volatile int delta_f1;
60 volatile int delta_f2;
61 volatile int nb_data_by_buffer;
62 volatile int snapshot_param;
63 volatile int start_date;
49 int data_shaping; // 0x00 00 *** R1 R0 SP1 SP0 BW
50 int run_burst_enable; // 0x04 01 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
51 int addr_data_f0; // 0x08
52 int addr_data_f1; // 0x0c
53 int addr_data_f2; // 0x10
54 int addr_data_f3; // 0x14
55 volatile int status; // 0x18
56 int delta_snapshot; // 0x1c
57 int delta_f0; // 0x20
58 int delta_f0_2; // 0x24
59 int delta_f1; // 0x28
60 int delta_f2; // 0x2c
61 int nb_data_by_buffer; // 0x30
62 int snapshot_param; // 0x34
63 int start_date; // 0x38
64 int nb_word_in_buffer; // 0x3c
64 65 };
65 66 typedef struct new_waveform_picker_regs_str new_waveform_picker_regs_t;
66 67
67 68 struct spectral_matrix_regs_str{
68 69 volatile int config;
69 70 volatile int status;
70 71 volatile int matrixF0_Address0;
71 72 volatile int matrixFO_Address1;
72 73 volatile int matrixF1_Address;
73 74 volatile int matrixF2_Address;
74 75 };
75 76 typedef struct spectral_matrix_regs_str spectral_matrix_regs_t;
76 77
77 78 #endif // GRLIB_REGS_H_INCLUDED
@@ -1,1225 +1,1227
1 1 /** Functions and tasks related to waveform packet generation.
2 2 *
3 3 * @file
4 4 * @author P. LEROY
5 5 *
6 6 * A group of functions to handle waveforms, in snapshot or continuous format.\n
7 7 *
8 8 */
9 9
10 10 #include "wf_handler.h"
11 11
12 12 // SWF
13 13 Header_TM_LFR_SCIENCE_SWF_t headerSWF_F0[7];
14 14 Header_TM_LFR_SCIENCE_SWF_t headerSWF_F1[7];
15 15 Header_TM_LFR_SCIENCE_SWF_t headerSWF_F2[7];
16 16 // CWF
17 17 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F1[7];
18 18 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_BURST[7];
19 19 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_SBM2[7];
20 20 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3[7];
21 21 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3_light[7];
22 22
23 23 unsigned char doubleSendCWF1 = 0;
24 24 unsigned char doubleSendCWF2 = 0;
25 25
26 26 rtems_isr waveforms_isr( rtems_vector_number vector )
27 27 {
28 28 /** This is the interrupt sub routine called by the waveform picker core.
29 29 *
30 30 * This ISR launch different actions depending mainly on two pieces of information:
31 31 * 1. the values read in the registers of the waveform picker.
32 32 * 2. the current LFR mode.
33 33 *
34 34 */
35 35
36 36 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
37 37 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff00f; // clear new_err and full_err
38 38
39 39 #ifdef GSA
40 40 #else
41 41 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
42 42 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
43 43 { // in modes other than STANDBY and BURST, send the CWF_F3 data
44 44 if ((new_waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full
45 45 // (1) change the receiving buffer for the waveform picker
46 46 if (new_waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) {
47 47 new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_bis);
48 48 }
49 49 else {
50 50 new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3);
51 51 }
52 52 // (2) send an event for the waveforms transmission
53 53 if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
54 54 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
55 55 }
56 56 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111]
57 57 }
58 58 }
59 59 #endif
60 60
61 61 switch(lfrCurrentMode)
62 62 {
63 63 //********
64 64 // STANDBY
65 65 case(LFR_MODE_STANDBY):
66 66 break;
67 67
68 68 //******
69 69 // NORMAL
70 70 case(LFR_MODE_NORMAL):
71 71 #ifdef GSA
72 72 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
73 73 #else
74 74 if ( (new_waveform_picker_regs->run_burst_enable & 0x7) == 0x0 ){ // if no channel is enable
75 75 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
76 76 }
77 77 else {
78 78 if ( (new_waveform_picker_regs->status & 0x7) == 0x7 ){ // f2 f1 and f0 are full
79 79 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable & 0x08;
80 80 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
81 81 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
82 82 }
83 83 // new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0x00;
84 84 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888;
85 85 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x07; // [0111] enable f2 f1 f0
86 86 }
87 87 }
88 88 #endif
89 89 break;
90 90
91 91 //******
92 92 // BURST
93 93 case(LFR_MODE_BURST):
94 94 #ifdef GSA
95 95 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
96 96 #else
97 97 if ((new_waveform_picker_regs->status & 0x04) == 0x04){ // [0100] check the f2 full bit
98 98 // (1) change the receiving buffer for the waveform picker
99 99 if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) {
100 100 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis);
101 101 }
102 102 else {
103 103 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2);
104 104 }
105 105 // (2) send an event for the waveforms transmission
106 106 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
107 107 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
108 108 }
109 109 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bits = 0
110 110 }
111 111 #endif
112 112 break;
113 113
114 114 //*****
115 115 // SBM1
116 116 case(LFR_MODE_SBM1):
117 117 #ifdef GSA
118 118 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
119 119 #else
120 120 if ((new_waveform_picker_regs->status & 0x02) == 0x02){ // [0010] check the f1 full bit
121 121 // (1) change the receiving buffer for the waveform picker
122 122 if ( param_local.local_sbm1_nb_cwf_sent == (param_local.local_sbm1_nb_cwf_max-1) )
123 123 {
124 124 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_norm);
125 125 }
126 126 else if ( new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1_norm )
127 127 {
128 128 doubleSendCWF1 = 1;
129 129 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1);
130 130 }
131 131 else if ( new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1 ) {
132 132 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_bis);
133 133 }
134 134 else {
135 135 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1);
136 136 }
137 137 // (2) send an event for the waveforms transmission
138 138 if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) {
139 139 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
140 140 }
141 141 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0
142 142 }
143 143 if ( ( (new_waveform_picker_regs->status & 0x05) == 0x05 ) ) { // [0101] check the f2 and f0 full bit
144 144 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
145 145 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
146 146 }
147 147 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0
148 148 reset_local_sbm1_nb_cwf_sent();
149 149 }
150 150
151 151 #endif
152 152 break;
153 153
154 154 //*****
155 155 // SBM2
156 156 case(LFR_MODE_SBM2):
157 157 #ifdef GSA
158 158 PRINTF("in waveform_isr *** unexpected waveform picker interruption\n")
159 159 #else
160 160 if ((new_waveform_picker_regs->status & 0x04) == 0x04){ // [0100] check the f2 full bit
161 161 // (1) change the receiving buffer for the waveform picker
162 162 if ( param_local.local_sbm2_nb_cwf_sent == (param_local.local_sbm2_nb_cwf_max-1) )
163 163 {
164 164 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_norm);
165 165 }
166 166 else if ( new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2_norm ) {
167 167 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2);
168 168 doubleSendCWF2 = 1;
169 169 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2_WFRM ) != RTEMS_SUCCESSFUL) {
170 170 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
171 171 }
172 172 reset_local_sbm2_nb_cwf_sent();
173 173 }
174 174 else if ( new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2 ) {
175 175 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis);
176 176 }
177 177 else {
178 178 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2);
179 179 }
180 180 // (2) send an event for the waveforms transmission
181 181 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) {
182 182 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
183 183 }
184 184 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
185 185 }
186 186 if ( ( (new_waveform_picker_regs->status & 0x03) == 0x03 ) ) { // [0011] f3 f2 f1 f0, f1 and f0 are full
187 187 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) {
188 188 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
189 189 }
190 190 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0
191 191 }
192 192 #endif
193 193 break;
194 194
195 195 //********
196 196 // DEFAULT
197 197 default:
198 198 break;
199 199 }
200 200 }
201 201
202 202 rtems_isr waveforms_simulator_isr( rtems_vector_number vector )
203 203 {
204 204 /** This is the interrupt sub routine called by the waveform picker simulator.
205 205 *
206 206 * This ISR is for debug purpose only.
207 207 *
208 208 */
209 209
210 210 unsigned char lfrMode;
211 211 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
212 212
213 213 switch(lfrMode) {
214 214 case (LFR_MODE_STANDBY):
215 215 break;
216 216 case (LFR_MODE_NORMAL):
217 217 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
218 218 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_5 );
219 219 }
220 220 break;
221 221 case (LFR_MODE_BURST):
222 222 break;
223 223 case (LFR_MODE_SBM1):
224 224 break;
225 225 case (LFR_MODE_SBM2):
226 226 break;
227 227 }
228 228 }
229 229
230 230 rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
231 231 {
232 232 /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode.
233 233 *
234 234 * @param unused is the starting argument of the RTEMS task
235 235 *
236 236 * The following data packets are sent by this task:
237 237 * - TM_LFR_SCIENCE_NORMAL_SWF_F0
238 238 * - TM_LFR_SCIENCE_NORMAL_SWF_F1
239 239 * - TM_LFR_SCIENCE_NORMAL_SWF_F2
240 240 *
241 241 */
242 242
243 243 rtems_event_set event_out;
244 244 rtems_id queue_id;
245 245
246 246 init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 );
247 247 init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 );
248 248 init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 );
249 249
250 250 init_waveforms();
251 251
252 252 queue_id = get_pkts_queue_id();
253 253
254 254 BOOT_PRINTF("in WFRM ***\n")
255 255
256 256 while(1){
257 257 // wait for an RTEMS_EVENT
258 258 rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1
259 259 | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM,
260 260 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
261 261
262 262 if (event_out == RTEMS_EVENT_MODE_NORMAL)
263 263 {
264 264 send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
265 265 send_waveform_SWF(wf_snap_f1, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
266 266 send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
267 267 #ifdef GSA
268 268 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xf888; // [1111 1000 1000 1000] f2, f1, f0 bits =0
269 269 #endif
270 270 }
271 271 else if (event_out == RTEMS_EVENT_MODE_SBM1)
272 272 {
273 273 send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
274 274 send_waveform_SWF(wf_snap_f1_norm, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
275 275 send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
276 276 #ifdef GSA
277 277 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2, f0 bits = 0
278 278 #endif
279 279 }
280 280 else if (event_out == RTEMS_EVENT_MODE_SBM2)
281 281 {
282 282 send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
283 283 send_waveform_SWF(wf_snap_f1, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
284 284 #ifdef GSA
285 285 new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0
286 286 #endif
287 287 }
288 288 else if (event_out == RTEMS_EVENT_MODE_SBM2_WFRM)
289 289 {
290 290 send_waveform_SWF(wf_snap_f2_norm, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
291 291 }
292 292 else
293 293 {
294 294 PRINTF("in WFRM *** unexpected event")
295 295 }
296 296
297 297
298 298 #ifdef GSA
299 299 // irq processed, reset the related register of the timer unit
300 300 gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl = gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl | 0x00000010;
301 301 // clear the interruption
302 302 LEON_Unmask_interrupt( IRQ_WF );
303 303 #endif
304 304 }
305 305 }
306 306
307 307 rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
308 308 {
309 309 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3.
310 310 *
311 311 * @param unused is the starting argument of the RTEMS task
312 312 *
313 313 * The following data packet is sent by this task:
314 314 * - TM_LFR_SCIENCE_NORMAL_CWF_F3
315 315 *
316 316 */
317 317
318 318 rtems_event_set event_out;
319 319 rtems_id queue_id;
320 320
321 321 init_header_continuous_wf_table( SID_NORM_CWF_F3, headerCWF_F3 );
322 322 init_header_continuous_wf3_light_table( headerCWF_F3_light );
323 323
324 324 queue_id = get_pkts_queue_id();
325 325
326 326 BOOT_PRINTF("in CWF3 ***\n")
327 327
328 328 while(1){
329 329 // wait for an RTEMS_EVENT
330 330 rtems_event_receive( RTEMS_EVENT_0,
331 331 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
332 332 PRINTF("send CWF F3 \n")
333 333 #ifdef GSA
334 334 #else
335 335 if (new_waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) {
336 336 send_waveform_CWF3_light( wf_cont_f3_bis, headerCWF_F3_light, queue_id );
337 337 }
338 338 else {
339 339 send_waveform_CWF3_light( wf_cont_f3, headerCWF_F3_light, queue_id );
340 340 }
341 341 #endif
342 342 }
343 343 }
344 344
345 345 rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2
346 346 {
347 347 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2.
348 348 *
349 349 * @param unused is the starting argument of the RTEMS task
350 350 *
351 351 * The following data packet is sent by this function:
352 352 * - TM_LFR_SCIENCE_BURST_CWF_F2
353 353 * - TM_LFR_SCIENCE_SBM2_CWF_F2
354 354 *
355 355 */
356 356
357 357 rtems_event_set event_out;
358 358 rtems_id queue_id;
359 359
360 360 init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST );
361 361 init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 );
362 362
363 363 queue_id = get_pkts_queue_id();
364 364
365 365 BOOT_PRINTF("in CWF2 ***\n")
366 366
367 367 while(1){
368 368 // wait for an RTEMS_EVENT
369 369 rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2,
370 370 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
371 371
372 372 if (event_out == RTEMS_EVENT_MODE_BURST)
373 373 {
374 374 // F2
375 375 #ifdef GSA
376 376 #else
377 377 if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) {
378 378 send_waveform_CWF( wf_snap_f2_bis, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id );
379 379 }
380 380 else {
381 381 send_waveform_CWF( wf_snap_f2, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id );
382 382 }
383 383 #endif
384 384 }
385 385
386 386 else if (event_out == RTEMS_EVENT_MODE_SBM2)
387 387 {
388 388 #ifdef GSA
389 389 #else
390 390 if (doubleSendCWF2 == 1)
391 391 {
392 392 doubleSendCWF2 = 0;
393 393 send_waveform_CWF( wf_snap_f2_norm, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
394 394 }
395 395 else if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) {
396 396 send_waveform_CWF( wf_snap_f2_bis, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
397 397 }
398 398 else {
399 399 send_waveform_CWF( wf_snap_f2, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
400 400 }
401 401 param_local.local_sbm2_nb_cwf_sent ++;
402 402 #endif
403 403 }
404 404 else
405 405 {
406 406 PRINTF1("in CWF2 *** ERR mode = %d\n", lfrCurrentMode)
407 407 }
408 408 }
409 409 }
410 410
411 411 rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1
412 412 {
413 413 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1.
414 414 *
415 415 * @param unused is the starting argument of the RTEMS task
416 416 *
417 417 * The following data packet is sent by this function:
418 418 * - TM_LFR_SCIENCE_SBM1_CWF_F1
419 419 *
420 420 */
421 421
422 422 rtems_event_set event_out;
423 423 rtems_id queue_id;
424 424
425 425 init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 );
426 426
427 427 queue_id = get_pkts_queue_id();
428 428
429 429 BOOT_PRINTF("in CWF1 ***\n")
430 430
431 431 while(1){
432 432 // wait for an RTEMS_EVENT
433 433 rtems_event_receive( RTEMS_EVENT_MODE_SBM1,
434 434 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
435 435 if (event_out == RTEMS_EVENT_MODE_SBM1)
436 436 {
437 437 #ifdef GSA
438 438 #else
439 439 if (doubleSendCWF1 == 1)
440 440 {
441 441 doubleSendCWF1 = 0;
442 442 send_waveform_CWF( wf_snap_f1_norm, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
443 443 }
444 444 else if (new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) {
445 445 send_waveform_CWF( wf_snap_f1_bis, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
446 446 }
447 447 else {
448 448 send_waveform_CWF( wf_snap_f1, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
449 449 }
450 450 param_local.local_sbm1_nb_cwf_sent ++;
451 451 #endif
452 452 }
453 453 else
454 454 {
455 455 PRINTF1("in CWF1 *** ERR mode = %d\n", lfrCurrentMode)
456 456 }
457 457 }
458 458 }
459 459
460 460 //******************
461 461 // general functions
462 462 void init_waveforms( void )
463 463 {
464 464 int i = 0;
465 465
466 466 for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
467 467 {
468 468 //***
469 469 // F0
470 470 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; //
471 471 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; //
472 472 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; //
473 473
474 474 //***
475 475 // F1
476 476 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111;
477 477 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333;
478 478 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
479 479
480 480 //***
481 481 // F2
482 482 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333;
483 483 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111;
484 484 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
485 485
486 486 //***
487 487 // F3
488 488 //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1;
489 489 //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2;
490 490 //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000;
491 491 }
492 492 }
493 493
494 494 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF)
495 495 {
496 496 unsigned char i;
497 497
498 498 for (i=0; i<7; i++)
499 499 {
500 500 headerSWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
501 501 headerSWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
502 502 headerSWF[ i ].reserved = DEFAULT_RESERVED;
503 503 headerSWF[ i ].userApplication = CCSDS_USER_APP;
504 504 headerSWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
505 505 headerSWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
506 506 if (i == 0)
507 507 {
508 508 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST;
509 509 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_340 >> 8);
510 510 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_340 );
511 511 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
512 512 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
513 513 }
514 514 else if (i == 6)
515 515 {
516 516 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST;
517 517 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_8 >> 8);
518 518 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_8 );
519 519 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8);
520 520 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 );
521 521 }
522 522 else
523 523 {
524 524 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION;
525 525 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_340 >> 8);
526 526 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_340 );
527 527 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
528 528 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
529 529 }
530 530 headerSWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
531 531 headerSWF[ i ].pktCnt = DEFAULT_PKTCNT; // PKT_CNT
532 532 headerSWF[ i ].pktNr = i+1; // PKT_NR
533 533 // DATA FIELD HEADER
534 534 headerSWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
535 535 headerSWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
536 536 headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
537 537 headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
538 538 // AUXILIARY DATA HEADER
539 539 headerSWF[ i ].sid = sid;
540 540 headerSWF[ i ].hkBIA = DEFAULT_HKBIA;
541 541 headerSWF[ i ].time[0] = 0x00;
542 542 headerSWF[ i ].time[0] = 0x00;
543 543 headerSWF[ i ].time[0] = 0x00;
544 544 headerSWF[ i ].time[0] = 0x00;
545 545 headerSWF[ i ].time[0] = 0x00;
546 546 headerSWF[ i ].time[0] = 0x00;
547 547 }
548 548 return LFR_SUCCESSFUL;
549 549 }
550 550
551 551 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
552 552 {
553 553 unsigned int i;
554 554
555 555 for (i=0; i<7; i++)
556 556 {
557 557 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
558 558 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
559 559 headerCWF[ i ].reserved = DEFAULT_RESERVED;
560 560 headerCWF[ i ].userApplication = CCSDS_USER_APP;
561 561 if ( (sid == SID_SBM1_CWF_F1) || (sid == SID_SBM2_CWF_F2) )
562 562 {
563 563 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2 >> 8);
564 564 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2);
565 565 }
566 566 else
567 567 {
568 568 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
569 569 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
570 570 }
571 571 if (i == 0)
572 572 {
573 573 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST;
574 574 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_340 >> 8);
575 575 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_340 );
576 576 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
577 577 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
578 578 }
579 579 else if (i == 6)
580 580 {
581 581 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST;
582 582 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_8 >> 8);
583 583 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_8 );
584 584 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8);
585 585 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 );
586 586 }
587 587 else
588 588 {
589 589 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION;
590 590 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_340 >> 8);
591 591 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_340 );
592 592 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
593 593 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
594 594 }
595 595 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
596 596 // PKT_CNT
597 597 // PKT_NR
598 598 // DATA FIELD HEADER
599 599 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
600 600 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
601 601 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
602 602 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
603 603 // AUXILIARY DATA HEADER
604 604 headerCWF[ i ].sid = sid;
605 605 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
606 606 headerCWF[ i ].time[0] = 0x00;
607 607 headerCWF[ i ].time[0] = 0x00;
608 608 headerCWF[ i ].time[0] = 0x00;
609 609 headerCWF[ i ].time[0] = 0x00;
610 610 headerCWF[ i ].time[0] = 0x00;
611 611 headerCWF[ i ].time[0] = 0x00;
612 612 }
613 613 return LFR_SUCCESSFUL;
614 614 }
615 615
616 616 int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
617 617 {
618 618 unsigned int i;
619 619
620 620 for (i=0; i<7; i++)
621 621 {
622 622 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
623 623 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
624 624 headerCWF[ i ].reserved = DEFAULT_RESERVED;
625 625 headerCWF[ i ].userApplication = CCSDS_USER_APP;
626 626
627 627 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
628 628 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
629 629 if (i == 0)
630 630 {
631 631 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST;
632 632 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8);
633 633 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 );
634 634 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
635 635 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
636 636 }
637 637 else if (i == 6)
638 638 {
639 639 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST;
640 640 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 >> 8);
641 641 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 );
642 642 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8);
643 643 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 );
644 644 }
645 645 else
646 646 {
647 647 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION;
648 648 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8);
649 649 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 );
650 650 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8);
651 651 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 );
652 652 }
653 653 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
654 654 // DATA FIELD HEADER
655 655 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
656 656 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
657 657 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
658 658 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
659 659 // AUXILIARY DATA HEADER
660 660 headerCWF[ i ].sid = SID_NORM_CWF_F3;
661 661 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
662 662 headerCWF[ i ].time[0] = 0x00;
663 663 headerCWF[ i ].time[0] = 0x00;
664 664 headerCWF[ i ].time[0] = 0x00;
665 665 headerCWF[ i ].time[0] = 0x00;
666 666 headerCWF[ i ].time[0] = 0x00;
667 667 headerCWF[ i ].time[0] = 0x00;
668 668 }
669 669 return LFR_SUCCESSFUL;
670 670 }
671 671
672 672 void reset_waveforms( void )
673 673 {
674 674 int i = 0;
675 675
676 676 for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
677 677 {
678 678 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x10002000;
679 679 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000;
680 680 wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000;
681 681
682 682 //***
683 683 // F1
684 684 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x1000f000;
685 685 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0xf0001000;
686 686 wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000;
687 687
688 688 //***
689 689 // F2
690 690 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x40008000;
691 691 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000;
692 692 wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x10002000;
693 693
694 694 //***
695 695 // F3
696 696 /*wf_cont_f3[ i* NB_WORDS_SWF_BLK + 0 ] = build_value( i, i ); // v and 1
697 697 wf_cont_f3[ i* NB_WORDS_SWF_BLK + 1 ] = build_value( i, i ); // e2 and b1
698 698 wf_cont_f3[ i* NB_WORDS_SWF_BLK + 2 ] = build_value( i, i ); // b2 and b3*/
699 699 }
700 700 }
701 701
702 702 int send_waveform_SWF( volatile int *waveform, unsigned int sid,
703 703 Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id )
704 704 {
705 705 /** This function sends SWF CCSDS packets (F2, F1 or F0).
706 706 *
707 707 * @param waveform points to the buffer containing the data that will be send.
708 708 * @param sid is the source identifier of the data that will be sent.
709 709 * @param headerSWF points to a table of headers that have been prepared for the data transmission.
710 710 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
711 711 * contain information to setup the transmission of the data packets.
712 712 *
713 713 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
714 714 *
715 715 */
716 716
717 717 unsigned int i;
718 718 int ret;
719 719 rtems_status_code status;
720 720 spw_ioctl_pkt_send spw_ioctl_send_SWF;
721 721
722 722 spw_ioctl_send_SWF.hlen = TM_HEADER_LEN + 4 + 12; // + 4 is for the protocole extra header, + 12 is for the auxiliary header
723 723 spw_ioctl_send_SWF.options = 0;
724 724
725 725 ret = LFR_DEFAULT;
726 726
727 727 for (i=0; i<7; i++) // send waveform
728 728 {
729 729 spw_ioctl_send_SWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ];
730 730 spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ];
731 731 // BUILD THE DATA
732 732 if (i==6) {
733 733 spw_ioctl_send_SWF.dlen = 8 * NB_BYTES_SWF_BLK;
734 734 }
735 735 else {
736 736 spw_ioctl_send_SWF.dlen = 340 * NB_BYTES_SWF_BLK;
737 737 }
738 738 // SET PACKET SEQUENCE COUNTER
739 739 increment_seq_counter_source_id( headerSWF[ i ].packetSequenceControl, sid );
740 740 // SET PACKET TIME
741 741 headerSWF[ i ].acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24);
742 742 headerSWF[ i ].acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16);
743 743 headerSWF[ i ].acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8);
744 744 headerSWF[ i ].acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time);
745 745 headerSWF[ i ].acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8);
746 746 headerSWF[ i ].acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time);
747 747 headerSWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
748 748 headerSWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
749 749 headerSWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
750 750 headerSWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time);
751 751 headerSWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8);
752 752 headerSWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time);
753 753 // SEND PACKET
754 754 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_SWF, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
755 755 if (status != RTEMS_SUCCESSFUL) {
756 756 printf("%d-%d, ERR %d\n", sid, i, (int) status);
757 757 ret = LFR_DEFAULT;
758 758 }
759 759 rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds
760 760 }
761 761
762 762 return ret;
763 763 }
764 764
765 765 int send_waveform_CWF(volatile int *waveform, unsigned int sid,
766 766 Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
767 767 {
768 768 /** This function sends CWF CCSDS packets (F2, F1 or F0).
769 769 *
770 770 * @param waveform points to the buffer containing the data that will be send.
771 771 * @param sid is the source identifier of the data that will be sent.
772 772 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
773 773 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
774 774 * contain information to setup the transmission of the data packets.
775 775 *
776 776 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
777 777 *
778 778 */
779 779
780 780 unsigned int i;
781 781 int ret;
782 782 rtems_status_code status;
783 783 spw_ioctl_pkt_send spw_ioctl_send_CWF;
784 784
785 785 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
786 786 spw_ioctl_send_CWF.options = 0;
787 787
788 788 ret = LFR_DEFAULT;
789 789
790 790 for (i=0; i<7; i++) // send waveform
791 791 {
792 792 int coarseTime = 0x00;
793 793 int fineTime = 0x00;
794 794 spw_ioctl_send_CWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ];
795 795 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
796 796 // BUILD THE DATA
797 797 if (i==6) {
798 798 spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_SWF_BLK;
799 799 }
800 800 else {
801 801 spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_SWF_BLK;
802 802 }
803 803 // SET PACKET SEQUENCE COUNTER
804 804 increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, sid );
805 805 // SET PACKET TIME
806 806 coarseTime = time_management_regs->coarse_time;
807 807 fineTime = time_management_regs->fine_time;
808 808 headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24);
809 809 headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16);
810 810 headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8);
811 811 headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime);
812 812 headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8);
813 813 headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime);
814 814 headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24);
815 815 headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16);
816 816 headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8);
817 817 headerCWF[ i ].time[3] = (unsigned char) (coarseTime);
818 818 headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8);
819 819 headerCWF[ i ].time[5] = (unsigned char) (fineTime);
820 820 // SEND PACKET
821 821 if (sid == SID_NORM_CWF_F3)
822 822 {
823 823 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
824 824 if (status != RTEMS_SUCCESSFUL) {
825 825 printf("%d-%d, ERR %d\n", sid, i, (int) status);
826 826 ret = LFR_DEFAULT;
827 827 }
828 828 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
829 829 }
830 830 else
831 831 {
832 832 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
833 833 if (status != RTEMS_SUCCESSFUL) {
834 834 printf("%d-%d, ERR %d\n", sid, i, (int) status);
835 835 ret = LFR_DEFAULT;
836 836 }
837 837 }
838 838 }
839 839
840 840 return ret;
841 841 }
842 842
843 843 int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
844 844 {
845 845 /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data.
846 846 *
847 847 * @param waveform points to the buffer containing the data that will be send.
848 848 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
849 849 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
850 850 * contain information to setup the transmission of the data packets.
851 851 *
852 852 * By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer
853 853 * from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks.
854 854 *
855 855 */
856 856
857 857 unsigned int i;
858 858 int ret;
859 859 rtems_status_code status;
860 860 spw_ioctl_pkt_send spw_ioctl_send_CWF;
861 861 char *sample;
862 862
863 863 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
864 864 spw_ioctl_send_CWF.options = 0;
865 865
866 866 ret = LFR_DEFAULT;
867 867
868 868 //**********************
869 869 // BUILD CWF3_light DATA
870 870 for ( i=0; i< 2048; i++)
871 871 {
872 872 sample = (char*) &waveform[ i * NB_WORDS_SWF_BLK ];
873 873 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) ] = sample[ 0 ];
874 874 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 ] = sample[ 1 ];
875 875 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 ] = sample[ 2 ];
876 876 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 ] = sample[ 3 ];
877 877 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 ] = sample[ 4 ];
878 878 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ];
879 879 }
880 880
881 881 //*********************
882 882 // SEND CWF3_light DATA
883 883
884 884 for (i=0; i<7; i++) // send waveform
885 885 {
886 886 int coarseTime = 0x00;
887 887 int fineTime = 0x00;
888 888 spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * 340 * NB_BYTES_CWF3_LIGHT_BLK) ];
889 889 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
890 890 // BUILD THE DATA
891 891 if ( i == WFRM_INDEX_OF_LAST_PACKET ) {
892 892 spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_CWF3_LIGHT_BLK;
893 893 }
894 894 else {
895 895 spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_CWF3_LIGHT_BLK;
896 896 }
897 897 // SET PACKET SEQUENCE COUNTER
898 898 increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, SID_NORM_CWF_F3 );
899 899 // SET PACKET TIME
900 900 coarseTime = time_management_regs->coarse_time;
901 901 fineTime = time_management_regs->fine_time;
902 902 headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24);
903 903 headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16);
904 904 headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8);
905 905 headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime);
906 906 headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8);
907 907 headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime);
908 908 headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24);
909 909 headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16);
910 910 headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8);
911 911 headerCWF[ i ].time[3] = (unsigned char) (coarseTime);
912 912 headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8);
913 913 headerCWF[ i ].time[5] = (unsigned char) (fineTime);
914 914 // SEND PACKET
915 915 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
916 916 if (status != RTEMS_SUCCESSFUL) {
917 917 printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status);
918 918 ret = LFR_DEFAULT;
919 919 }
920 920 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
921 921 }
922 922
923 923 return ret;
924 924 }
925 925
926 926
927 927 //**************
928 928 // wfp registers
929 929 void set_wfp_data_shaping()
930 930 {
931 931 /** This function sets the data_shaping register of the waveform picker module.
932 932 *
933 933 * The value is read from one field of the parameter_dump_packet structure:\n
934 934 * bw_sp0_sp1_r0_r1
935 935 *
936 936 */
937 937
938 938 unsigned char data_shaping;
939 939
940 940 // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register
941 941 // waveform picker : [R1 R0 SP1 SP0 BW]
942 942
943 943 data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1;
944 944
945 945 #ifdef GSA
946 946 #else
947 947 new_waveform_picker_regs->data_shaping =
948 948 ( (data_shaping & 0x10) >> 4 ) // BW
949 949 + ( (data_shaping & 0x08) >> 2 ) // SP0
950 950 + ( (data_shaping & 0x04) ) // SP1
951 951 + ( (data_shaping & 0x02) << 2 ) // R0
952 952 + ( (data_shaping & 0x01) << 4 ); // R1
953 953 #endif
954 954 }
955 955
956 956 char set_wfp_delta_snapshot()
957 957 {
958 958 /** This function sets the delta_snapshot register of the waveform picker module.
959 959 *
960 960 * The value is read from two (unsigned char) of the parameter_dump_packet structure:
961 961 * - sy_lfr_n_swf_p[0]
962 962 * - sy_lfr_n_swf_p[1]
963 963 *
964 964 */
965 965
966 966 char ret;
967 967 unsigned int delta_snapshot;
968 968 unsigned int aux;
969 969
970 970 aux = 0;
971 971 ret = LFR_DEFAULT;
972 972
973 973 delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256
974 974 + parameter_dump_packet.sy_lfr_n_swf_p[1];
975 975
976 976 #ifdef GSA
977 977 #else
978 978 if ( delta_snapshot < MIN_DELTA_SNAPSHOT )
979 979 {
980 980 aux = MIN_DELTA_SNAPSHOT;
981 981 ret = LFR_DEFAULT;
982 982 }
983 983 else
984 984 {
985 985 aux = delta_snapshot ;
986 986 ret = LFR_SUCCESSFUL;
987 987 }
988 988 new_waveform_picker_regs->delta_snapshot = aux - 1; // max 2 bytes
989 989 #endif
990 990
991 991 return ret;
992 992 }
993 993
994 994 void set_wfp_burst_enable_register( unsigned char mode)
995 995 {
996 996 /** This function sets the waveform picker burst_enable register depending on the mode.
997 997 *
998 998 * @param mode is the LFR mode to launch.
999 999 *
1000 1000 * The burst bits shall be before the enable bits.
1001 1001 *
1002 1002 */
1003 1003
1004 1004 #ifdef GSA
1005 1005 #else
1006 1006 // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0
1007 1007 // the burst bits shall be set first, before the enable bits
1008 1008 switch(mode) {
1009 1009 case(LFR_MODE_NORMAL):
1010 1010 new_waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enable
1011 1011 // new_waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0
1012 1012 new_waveform_picker_regs->run_burst_enable = 0x07; // [0000 0111] enable f2 f1 f0
1013 1013 break;
1014 1014 case(LFR_MODE_BURST):
1015 1015 new_waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1016 1016 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2
1017 1017 break;
1018 1018 case(LFR_MODE_SBM1):
1019 1019 new_waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled
1020 1020 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
1021 1021 break;
1022 1022 case(LFR_MODE_SBM2):
1023 1023 new_waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1024 1024 new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
1025 1025 break;
1026 1026 default:
1027 1027 new_waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled
1028 1028 break;
1029 1029 }
1030 1030 #endif
1031 1031 }
1032 1032
1033 1033 void reset_wfp_run_burst_enable()
1034 1034 {
1035 1035 /** This function resets the waveform picker burst_enable register.
1036 1036 *
1037 1037 * The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0.
1038 1038 *
1039 1039 */
1040 1040
1041 1041 #ifdef GSA
1042 1042 #else
1043 1043 new_waveform_picker_regs->run_burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1044 1044 #endif
1045 1045 }
1046 1046
1047 1047 void reset_wfp_status()
1048 1048 {
1049 1049 /** This function resets the waveform picker status register.
1050 1050 *
1051 1051 * All status bits are set to 0 [new_err full_err full].
1052 1052 *
1053 1053 */
1054 1054
1055 1055 #ifdef GSA
1056 1056 #else
1057 1057 new_waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1058 1058 #endif
1059 1059 }
1060 1060
1061 1061 void reset_new_waveform_picker_regs()
1062 1062 {
1063 1063 /** This function resets the waveform picker module registers.
1064 1064 *
1065 1065 * The registers affected by this function are located at the following offset addresses:
1066 1066 * - 0x00 data_shaping
1067 1067 * - 0x04 run_burst_enable
1068 1068 * - 0x08 addr_data_f0
1069 1069 * - 0x0C addr_data_f1
1070 1070 * - 0x10 addr_data_f2
1071 1071 * - 0x14 addr_data_f3
1072 1072 * - 0x18 status
1073 1073 * - 0x1C delta_snapshot
1074 1074 * - 0x20 delta_f0
1075 1075 * - 0x24 delta_f0_2
1076 1076 * - 0x28 delta_f1
1077 1077 * - 0x2c delta_f2
1078 1078 * - 0x30 nb_data_by_buffer
1079 1079 * - 0x34 nb_snapshot_param
1080 1080 * - 0x38 start_date
1081 * - 0x3c nb_word_in_buffer
1081 1082 *
1082 1083 */
1083 1084
1084 1085 new_waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW
1085 1086 new_waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
1086 1087 new_waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // 0x08
1087 1088 new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); // 0x0c
1088 1089 new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); // 0x10
1089 1090 new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); // 0x14
1090 1091 new_waveform_picker_regs->status = 0x00; // 0x18
1091 1092 // new_waveform_picker_regs->delta_snapshot = 0x12800; // 0x1c 296 * 256 = 75776
1092 1093 new_waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c 16 * 256 = 4096
1093 1094 new_waveform_picker_regs->delta_f0 = 0x3f5; // 0x20 *** 1013
1094 1095 new_waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7
1095 1096 new_waveform_picker_regs->delta_f1 = 0x3c0; // 0x28 *** 960
1096 1097 // new_waveform_picker_regs->delta_f2 = 0x12200; // 0x2c *** 74240
1097 1098 new_waveform_picker_regs->delta_f2 = 0xc00; // 0x2c *** 12 * 256 = 2048
1098 new_waveform_picker_regs->nb_data_by_buffer = 0x1802; // 0x30 *** 2048 * 3 + 2
1099 new_waveform_picker_regs->snapshot_param = 0x7ff; // 0x34 *** 2048 -1
1099 new_waveform_picker_regs->nb_data_by_buffer = 0x7ff; // 0x30 *** 2048 -1
1100 new_waveform_picker_regs->snapshot_param = 0x800; // 0x34 *** 2048
1100 1101 new_waveform_picker_regs->start_date = 0x00; // 0x38
1102 new_waveform_picker_regs->nb_word_in_buffer = 0x1802; // 0x3c *** 2048 * 3 + 2 = 6146
1101 1103 }
1102 1104
1103 1105 //*****************
1104 1106 // local parameters
1105 1107 void set_local_sbm1_nb_cwf_max()
1106 1108 {
1107 1109 /** This function sets the value of the sbm1_nb_cwf_max local parameter.
1108 1110 *
1109 1111 * The sbm1_nb_cwf_max parameter counts the number of CWF_F1 records that have been sent.\n
1110 1112 * This parameter is used to send CWF_F1 data as normal data when the SBM1 is active.\n\n
1111 1113 * (2 snapshots of 2048 points per seconds) * (period of the NORM snashots) - 8 s (duration of the f2 snapshot)
1112 1114 *
1113 1115 */
1114 1116 param_local.local_sbm1_nb_cwf_max = 2 *
1115 1117 (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256
1116 1118 + parameter_dump_packet.sy_lfr_n_swf_p[1]) - 8; // 16 CWF1 parts during 1 SWF2
1117 1119 }
1118 1120
1119 1121 void set_local_sbm2_nb_cwf_max()
1120 1122 {
1121 1123 /** This function sets the value of the sbm1_nb_cwf_max local parameter.
1122 1124 *
1123 1125 * The sbm1_nb_cwf_max parameter counts the number of CWF_F1 records that have been sent.\n
1124 1126 * This parameter is used to send CWF_F2 data as normal data when the SBM2 is active.\n\n
1125 1127 * (period of the NORM snashots) / (8 seconds per snapshot at f2 = 256 Hz)
1126 1128 *
1127 1129 */
1128 1130
1129 1131 param_local.local_sbm2_nb_cwf_max = (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256
1130 1132 + parameter_dump_packet.sy_lfr_n_swf_p[1]) / 8;
1131 1133 }
1132 1134
1133 1135 void set_local_nb_interrupt_f0_MAX()
1134 1136 {
1135 1137 /** This function sets the value of the nb_interrupt_f0_MAX local parameter.
1136 1138 *
1137 1139 * This parameter is used for the SM validation only.\n
1138 1140 * The software waits param_local.local_nb_interrupt_f0_MAX interruptions from the spectral matrices
1139 1141 * module before launching a basic processing.
1140 1142 *
1141 1143 */
1142 1144
1143 1145 param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256
1144 1146 + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100;
1145 1147 }
1146 1148
1147 1149 void reset_local_sbm1_nb_cwf_sent()
1148 1150 {
1149 1151 /** This function resets the value of the sbm1_nb_cwf_sent local parameter.
1150 1152 *
1151 1153 * The sbm1_nb_cwf_sent parameter counts the number of CWF_F1 records that have been sent.\n
1152 1154 * This parameter is used to send CWF_F1 data as normal data when the SBM1 is active.
1153 1155 *
1154 1156 */
1155 1157
1156 1158 param_local.local_sbm1_nb_cwf_sent = 0;
1157 1159 }
1158 1160
1159 1161 void reset_local_sbm2_nb_cwf_sent()
1160 1162 {
1161 1163 /** This function resets the value of the sbm2_nb_cwf_sent local parameter.
1162 1164 *
1163 1165 * The sbm2_nb_cwf_sent parameter counts the number of CWF_F2 records that have been sent.\n
1164 1166 * This parameter is used to send CWF_F2 data as normal data when the SBM2 mode is active.
1165 1167 *
1166 1168 */
1167 1169
1168 1170 param_local.local_sbm2_nb_cwf_sent = 0;
1169 1171 }
1170 1172
1171 1173 rtems_id get_pkts_queue_id( void )
1172 1174 {
1173 1175 rtems_id queue_id;
1174 1176 rtems_status_code status;
1175 1177 rtems_name queue_send_name;
1176 1178
1177 1179 queue_send_name = rtems_build_name( 'Q', '_', 'S', 'D' );
1178 1180
1179 1181 status = rtems_message_queue_ident( queue_send_name, 0, &queue_id );
1180 1182 if (status != RTEMS_SUCCESSFUL)
1181 1183 {
1182 1184 PRINTF1("in get_pkts_queue_id *** ERR %d\n", status)
1183 1185 }
1184 1186 return queue_id;
1185 1187 }
1186 1188
1187 1189 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid )
1188 1190 {
1189 1191 unsigned short *sequence_cnt;
1190 1192 unsigned short segmentation_grouping_flag;
1191 1193 unsigned short new_packet_sequence_control;
1192 1194
1193 1195 if ( (sid ==SID_NORM_SWF_F0) || (sid ==SID_NORM_SWF_F1) || (sid ==SID_NORM_SWF_F2)
1194 1196 || (sid ==SID_NORM_CWF_F3) || (sid ==SID_BURST_CWF_F2) )
1195 1197 {
1196 1198 sequence_cnt = &sequenceCounters_SCIENCE_NORMAL_BURST;
1197 1199 }
1198 1200 else if ( (sid ==SID_SBM1_CWF_F1) || (sid ==SID_SBM2_CWF_F2) )
1199 1201 {
1200 1202 sequence_cnt = &sequenceCounters_SCIENCE_SBM1_SBM2;
1201 1203 }
1202 1204 else
1203 1205 {
1204 1206 sequence_cnt = &sequenceCounters_TC_EXE[ UNKNOWN ];
1205 1207 PRINTF1("in increment_seq_counter_source_id *** ERR apid_destid %d not known\n", sid)
1206 1208 }
1207 1209
1208 1210 segmentation_grouping_flag = (packet_sequence_control[ 0 ] & 0xc0) << 8;
1209 1211 *sequence_cnt = (*sequence_cnt) & 0x3fff;
1210 1212
1211 1213 new_packet_sequence_control = segmentation_grouping_flag | *sequence_cnt ;
1212 1214
1213 1215 packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8);
1214 1216 packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control );
1215 1217
1216 1218 // increment the sequence counter for the next packet
1217 1219 if ( *sequence_cnt < SEQ_CNT_MAX)
1218 1220 {
1219 1221 *sequence_cnt = *sequence_cnt + 1;
1220 1222 }
1221 1223 else
1222 1224 {
1223 1225 *sequence_cnt = 0;
1224 1226 }
1225 1227 }
General Comments 0
You need to be logged in to leave comments. Login now