@@ -1,248 +1,249 | |||
|
1 | 1 | ############################################################################# |
|
2 | 2 | # Makefile for building: bin/fsw |
|
3 |
# Generated by qmake (2.01a) (Qt 4.8.5) on: |
|
|
3 | # Generated by qmake (2.01a) (Qt 4.8.5) on: Mon Jan 20 12:52:59 2014 | |
|
4 | 4 | # Project: fsw-qt.pro |
|
5 | 5 | # Template: app |
|
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
|
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ CONFIG+=debug -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 | DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=1 -DPRINT_MESSAGES_ON_CONSOLE | |
|
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) | |
|
13 | DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=1 -DPRINT_MESSAGES_ON_CONSOLE -DDEBUG_MESSAGES | |
|
14 | CFLAGS = -pipe -g -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 | LFLAGS = | |
|
18 | LFLAGS = -g | |
|
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 |
/usr/lib64/qt4/mkspecs/features/ |
|
|
79 | /usr/lib64/qt4/mkspecs/features/debug.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 | { test -n "$(DESTDIR)" && DESTDIR="$(DESTDIR)" || DESTDIR=.; } && test $$(gdb --version | sed -e 's,[^0-9]\+\([0-9]\)\.\([0-9]\).*,\1\2,;q') -gt 72 && gdb --nx --batch --quiet -ex 'set confirm off' -ex "save gdb-index $$DESTDIR" -ex quit '$(TARGET)' && test -f $(TARGET).gdb-index && sparc-rtems-objcopy --add-section '.gdb_index=$(TARGET).gdb-index' --set-section-flags '.gdb_index=readonly' '$(TARGET)' '$(TARGET)' && rm -f $(TARGET).gdb-index || true | |
|
121 | 122 | |
|
122 | 123 | Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
123 | 124 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
124 | 125 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
125 | 126 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ |
|
126 | 127 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ |
|
127 | 128 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ |
|
128 | 129 | /usr/lib64/qt4/mkspecs/qconfig.pri \ |
|
129 | 130 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ |
|
130 | 131 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ |
|
131 | 132 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ |
|
132 | 133 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ |
|
133 | 134 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
134 | 135 | sparc.pri \ |
|
135 |
/usr/lib64/qt4/mkspecs/features/ |
|
|
136 | /usr/lib64/qt4/mkspecs/features/debug.prf \ | |
|
136 | 137 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
137 | 138 | /usr/lib64/qt4/mkspecs/features/shared.prf \ |
|
138 | 139 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
139 | 140 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
140 | 141 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
141 | 142 | /usr/lib64/qt4/mkspecs/features/uic.prf \ |
|
142 | 143 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ |
|
143 | 144 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
144 | 145 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf |
|
145 | $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
|
146 | $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ CONFIG+=debug -o Makefile fsw-qt.pro | |
|
146 | 147 | /usr/lib64/qt4/mkspecs/common/unix.conf: |
|
147 | 148 | /usr/lib64/qt4/mkspecs/common/linux.conf: |
|
148 | 149 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: |
|
149 | 150 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf: |
|
150 | 151 | /usr/lib64/qt4/mkspecs/common/g++-base.conf: |
|
151 | 152 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf: |
|
152 | 153 | /usr/lib64/qt4/mkspecs/qconfig.pri: |
|
153 | 154 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri: |
|
154 | 155 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf: |
|
155 | 156 | /usr/lib64/qt4/mkspecs/features/qt_config.prf: |
|
156 | 157 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf: |
|
157 | 158 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: |
|
158 | 159 | sparc.pri: |
|
159 |
/usr/lib64/qt4/mkspecs/features/ |
|
|
160 | /usr/lib64/qt4/mkspecs/features/debug.prf: | |
|
160 | 161 | /usr/lib64/qt4/mkspecs/features/default_post.prf: |
|
161 | 162 | /usr/lib64/qt4/mkspecs/features/shared.prf: |
|
162 | 163 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: |
|
163 | 164 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: |
|
164 | 165 | /usr/lib64/qt4/mkspecs/features/resources.prf: |
|
165 | 166 | /usr/lib64/qt4/mkspecs/features/uic.prf: |
|
166 | 167 | /usr/lib64/qt4/mkspecs/features/yacc.prf: |
|
167 | 168 | /usr/lib64/qt4/mkspecs/features/lex.prf: |
|
168 | 169 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf: |
|
169 | 170 | qmake: FORCE |
|
170 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
|
171 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ CONFIG+=debug -o Makefile fsw-qt.pro | |
|
171 | 172 | |
|
172 | 173 | dist: |
|
173 | 174 | @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0 |
|
174 | 175 | $(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 | 176 | |
|
176 | 177 | |
|
177 | 178 | clean:compiler_clean |
|
178 | 179 | -$(DEL_FILE) $(OBJECTS) |
|
179 | 180 | -$(DEL_FILE) *~ core *.core |
|
180 | 181 | |
|
181 | 182 | |
|
182 | 183 | ####### Sub-libraries |
|
183 | 184 | |
|
184 | 185 | distclean: clean |
|
185 | 186 | -$(DEL_FILE) $(TARGET) |
|
186 | 187 | -$(DEL_FILE) Makefile |
|
187 | 188 | |
|
188 | 189 | |
|
189 | 190 | grmon: |
|
190 | 191 | cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u |
|
191 | 192 | |
|
192 | 193 | check: first |
|
193 | 194 | |
|
194 | 195 | compiler_rcc_make_all: |
|
195 | 196 | compiler_rcc_clean: |
|
196 | 197 | compiler_uic_make_all: |
|
197 | 198 | compiler_uic_clean: |
|
198 | 199 | compiler_image_collection_make_all: qmake_image_collection.cpp |
|
199 | 200 | compiler_image_collection_clean: |
|
200 | 201 | -$(DEL_FILE) qmake_image_collection.cpp |
|
201 | 202 | compiler_yacc_decl_make_all: |
|
202 | 203 | compiler_yacc_decl_clean: |
|
203 | 204 | compiler_yacc_impl_make_all: |
|
204 | 205 | compiler_yacc_impl_clean: |
|
205 | 206 | compiler_lex_make_all: |
|
206 | 207 | compiler_lex_clean: |
|
207 | 208 | compiler_clean: |
|
208 | 209 | |
|
209 | 210 | ####### Compile |
|
210 | 211 | |
|
211 | 212 | obj/wf_handler.o: ../src/wf_handler.c |
|
212 | 213 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c |
|
213 | 214 | |
|
214 | 215 | obj/tc_handler.o: ../src/tc_handler.c |
|
215 | 216 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c |
|
216 | 217 | |
|
217 | 218 | obj/fsw_processing.o: ../src/fsw_processing.c ../src/fsw_processing_globals.c |
|
218 | 219 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c |
|
219 | 220 | |
|
220 | 221 | obj/fsw_misc.o: ../src/fsw_misc.c |
|
221 | 222 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c |
|
222 | 223 | |
|
223 | 224 | obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c |
|
224 | 225 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c |
|
225 | 226 | |
|
226 | 227 | obj/fsw_globals.o: ../src/fsw_globals.c |
|
227 | 228 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c |
|
228 | 229 | |
|
229 | 230 | obj/fsw_spacewire.o: ../src/fsw_spacewire.c |
|
230 | 231 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c |
|
231 | 232 | |
|
232 | 233 | obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c |
|
233 | 234 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c |
|
234 | 235 | |
|
235 | 236 | obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c |
|
236 | 237 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c |
|
237 | 238 | |
|
238 | 239 | obj/tc_acceptance.o: ../src/tc_acceptance.c |
|
239 | 240 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c |
|
240 | 241 | |
|
241 | 242 | ####### Install |
|
242 | 243 | |
|
243 | 244 | install: FORCE |
|
244 | 245 | |
|
245 | 246 | uninstall: FORCE |
|
246 | 247 | |
|
247 | 248 | FORCE: |
|
248 | 249 |
@@ -1,79 +1,79 | |||
|
1 | 1 | TEMPLATE = app |
|
2 | 2 | # CONFIG += console v8 sim |
|
3 | 3 | # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** gsa |
|
4 | CONFIG += console verbose | |
|
4 | CONFIG += console verbose debug_messages | |
|
5 | 5 | CONFIG -= qt |
|
6 | 6 | |
|
7 | 7 | include(./sparc.pri) |
|
8 | 8 | |
|
9 | 9 | # flight software version |
|
10 | 10 | SWVERSION=-1-0 |
|
11 | 11 | DEFINES += SW_VERSION_N1=1 # major |
|
12 | 12 | DEFINES += SW_VERSION_N2=0 # minor |
|
13 | 13 | DEFINES += SW_VERSION_N3=0 # patch |
|
14 | 14 | DEFINES += SW_VERSION_N4=1 # internal |
|
15 | 15 | |
|
16 | 16 | contains( CONFIG, verbose ) { |
|
17 | 17 | DEFINES += PRINT_MESSAGES_ON_CONSOLE |
|
18 | 18 | } |
|
19 | 19 | |
|
20 | 20 | contains( CONFIG, debug_messages ) { |
|
21 | 21 | DEFINES += DEBUG_MESSAGES |
|
22 | 22 | } |
|
23 | 23 | |
|
24 | 24 | contains( CONFIG, cpu_usage_report ) { |
|
25 | 25 | DEFINES += PRINT_TASK_STATISTICS |
|
26 | 26 | } |
|
27 | 27 | |
|
28 | 28 | contains( CONFIG, stack_report ) { |
|
29 | 29 | DEFINES += PRINT_STACK_REPORT |
|
30 | 30 | } |
|
31 | 31 | |
|
32 | 32 | contains( CONFIG, boot_messages ) { |
|
33 | 33 | DEFINES += BOOT_MESSAGES |
|
34 | 34 | } |
|
35 | 35 | |
|
36 | 36 | #doxygen.target = doxygen |
|
37 | 37 | #doxygen.commands = doxygen ../doc/Doxyfile |
|
38 | 38 | #QMAKE_EXTRA_TARGETS += doxygen |
|
39 | 39 | |
|
40 | 40 | TARGET = fsw |
|
41 | 41 | contains( CONFIG, gsa ) { |
|
42 | 42 | DEFINES += GSA |
|
43 | 43 | TARGET = fsw-gsa |
|
44 | 44 | } |
|
45 | 45 | |
|
46 | 46 | INCLUDEPATH += \ |
|
47 | 47 | ../src \ |
|
48 | 48 | ../header |
|
49 | 49 | |
|
50 | 50 | SOURCES += \ |
|
51 | 51 | ../src/wf_handler.c \ |
|
52 | 52 | ../src/tc_handler.c \ |
|
53 | 53 | ../src/fsw_processing.c \ |
|
54 | 54 | ../src/fsw_misc.c \ |
|
55 | 55 | ../src/fsw_init.c \ |
|
56 | 56 | ../src/fsw_globals.c \ |
|
57 | 57 | ../src/fsw_spacewire.c \ |
|
58 | 58 | ../src/tc_load_dump_parameters.c \ |
|
59 | 59 | ../src/tm_lfr_tc_exe.c \ |
|
60 | 60 | ../src/tc_acceptance.c |
|
61 | 61 | |
|
62 | 62 | |
|
63 | 63 | HEADERS += \ |
|
64 | 64 | ../header/wf_handler.h \ |
|
65 | 65 | ../header/tc_handler.h \ |
|
66 | 66 | ../header/grlib_regs.h \ |
|
67 | 67 | ../header/fsw_processing.h \ |
|
68 | 68 | ../header/fsw_params.h \ |
|
69 | 69 | ../header/fsw_misc.h \ |
|
70 | 70 | ../header/fsw_init.h \ |
|
71 | 71 | ../header/ccsds_types.h \ |
|
72 | 72 | ../header/fsw_params_processing.h \ |
|
73 | 73 | ../header/fsw_spacewire.h \ |
|
74 | 74 | ../header/tm_byte_positions.h \ |
|
75 | 75 | ../header/tc_load_dump_parameters.h \ |
|
76 | 76 | ../header/tm_lfr_tc_exe.h \ |
|
77 | 77 | ../header/tc_acceptance.h \ |
|
78 | 78 | ../header/fsw_params_nb_bytes.h |
|
79 | 79 |
@@ -1,439 +1,311 | |||
|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
|
2 | 2 | <!DOCTYPE QtCreatorProject> |
|
3 |
<!-- Written by QtCreator |
|
|
3 | <!-- Written by QtCreator 3.0.0, 2014-01-21T06:52:06. --> | |
|
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 |
<value type="Q |
|
|
18 | <value type="QByteArray" 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 |
<value type="Q |
|
|
24 | <value type="QByteArray" 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">UTF-8</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">0</value> |
|
60 | 60 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> |
|
61 | <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> | |
|
61 | 62 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
62 | 63 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
63 | 64 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
64 | 65 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|
65 | 66 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
66 | 67 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|
67 | 68 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|
68 | 69 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value> |
|
69 | 70 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|
70 | 71 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|
71 | 72 | </valuemap> |
|
72 | 73 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|
73 | 74 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
74 | 75 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
75 | 76 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
76 | 77 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
77 | 78 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
78 | 79 | <value type="QString">-w</value> |
|
79 | 80 | <value type="QString">-r</value> |
|
80 | 81 | </valuelist> |
|
81 | 82 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|
82 | 83 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|
83 | 84 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
84 | 85 | </valuemap> |
|
85 | 86 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|
86 | 87 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|
87 | 88 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
88 | 89 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|
89 | 90 | </valuemap> |
|
90 | 91 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|
91 | 92 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
92 | 93 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
93 | 94 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
94 | 95 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
95 | 96 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
96 | 97 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
97 | 98 | <value type="QString">-w</value> |
|
98 | 99 | <value type="QString">-r</value> |
|
99 | 100 | </valuelist> |
|
100 | 101 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|
101 | 102 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|
102 | 103 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
103 | 104 | </valuemap> |
|
104 | 105 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|
105 | 106 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|
106 | 107 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
107 | 108 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|
108 | 109 | </valuemap> |
|
109 | 110 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|
110 | 111 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|
111 | 112 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|
112 | 113 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> |
|
113 | 114 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
114 | 115 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|
115 |
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration"> |
|
|
116 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> | |
|
116 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</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 | <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> | |
|
120 | 121 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
121 | 122 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
122 | 123 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
123 | 124 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|
124 | 125 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
125 | 126 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|
126 | 127 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|
127 | 128 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value> |
|
128 | 129 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|
129 | 130 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|
130 | 131 | </valuemap> |
|
131 | 132 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|
132 | 133 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
133 | 134 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
134 | 135 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
135 | 136 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
136 | 137 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
137 | 138 | <value type="QString">-w</value> |
|
138 | 139 | <value type="QString">-r</value> |
|
139 | 140 | </valuelist> |
|
140 | 141 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|
141 | 142 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|
142 | 143 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
143 | 144 | </valuemap> |
|
144 | 145 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|
145 | 146 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|
146 | 147 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
147 | 148 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|
148 | 149 | </valuemap> |
|
149 | 150 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|
150 | 151 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
151 | 152 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
152 | 153 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
153 | 154 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
154 | 155 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
155 | 156 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
156 | 157 | <value type="QString">-w</value> |
|
157 | 158 | <value type="QString">-r</value> |
|
158 | 159 | </valuelist> |
|
159 | 160 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|
160 | 161 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|
161 | 162 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
162 | 163 | </valuemap> |
|
163 | 164 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|
164 | 165 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|
165 | 166 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
166 | 167 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|
167 | 168 | </valuemap> |
|
168 | 169 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|
169 | 170 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|
170 | 171 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|
171 | 172 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release2</value> |
|
172 | 173 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
173 | 174 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|
174 | 175 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> |
|
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">Deploy locally</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 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> | |
|
195 | 194 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|
196 | 195 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|
197 | 196 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|
198 | 197 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|
199 | 198 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|
200 | 199 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|
201 | 200 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|
202 | 201 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|
203 | 202 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|
203 | <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> | |
|
204 | 204 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|
205 | 205 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|
206 | <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> | |
|
207 | <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> | |
|
208 | <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> | |
|
206 | 209 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|
207 | 210 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|
208 | 211 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|
209 | 212 | <value type="int">0</value> |
|
210 | 213 | <value type="int">1</value> |
|
211 | 214 | <value type="int">2</value> |
|
212 | 215 | <value type="int">3</value> |
|
213 | 216 | <value type="int">4</value> |
|
214 | 217 | <value type="int">5</value> |
|
215 | 218 | <value type="int">6</value> |
|
216 | 219 | <value type="int">7</value> |
|
217 | 220 | <value type="int">8</value> |
|
218 | 221 | <value type="int">9</value> |
|
219 | 222 | <value type="int">10</value> |
|
220 | 223 | <value type="int">11</value> |
|
221 | 224 | <value type="int">12</value> |
|
222 | 225 | <value type="int">13</value> |
|
223 | 226 | <value type="int">14</value> |
|
224 | 227 | </valuelist> |
|
225 | 228 | <value type="int" key="PE.EnvironmentAspect.Base">2</value> |
|
226 | 229 | <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> |
|
227 | 230 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value> |
|
228 | 231 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
229 | 232 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value> |
|
230 | 233 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> |
|
231 | 234 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value> |
|
232 | 235 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> |
|
233 | 236 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value> |
|
234 | 237 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> |
|
235 | 238 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> |
|
236 | 239 | <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> |
|
237 | 240 | <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value> |
|
238 | 241 | <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> |
|
239 | 242 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> |
|
240 | 243 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> |
|
241 | 244 | </valuemap> |
|
242 |
<value type="int" key="ProjectExplorer.Target.RunConfiguration |
|
|
243 | </valuemap> | |
|
244 | </data> | |
|
245 | <data> | |
|
246 | <variable>ProjectExplorer.Project.Target.1</variable> | |
|
247 | <valuemap type="QVariantMap"> | |
|
248 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop2</value> | |
|
249 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop2</value> | |
|
250 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{e96c4de1-323d-4095-8746-d006ca3bd573}</value> | |
|
251 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> | |
|
252 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> | |
|
253 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> | |
|
254 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> | |
|
255 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
|
256 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
|
257 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
|
258 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> | |
|
259 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
260 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> | |
|
261 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> | |
|
262 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value> | |
|
263 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> | |
|
264 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> | |
|
265 | </valuemap> | |
|
266 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> | |
|
267 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
|
268 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
|
269 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
270 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
|
271 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> | |
|
272 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> | |
|
273 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> | |
|
274 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
|
275 | </valuemap> | |
|
276 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> | |
|
277 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> | |
|
278 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
279 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> | |
|
280 | </valuemap> | |
|
281 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> | |
|
282 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
|
283 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
|
284 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
|
285 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
286 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
|
287 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> | |
|
288 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> | |
|
289 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> | |
|
290 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
|
291 | </valuemap> | |
|
292 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> | |
|
293 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> | |
|
294 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
295 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> | |
|
296 | </valuemap> | |
|
297 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> | |
|
298 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> | |
|
299 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> | |
|
300 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> | |
|
301 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
302 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> | |
|
303 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> | |
|
304 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> | |
|
305 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value> | |
|
306 | </valuemap> | |
|
307 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> | |
|
308 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
|
309 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
|
310 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
|
311 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> | |
|
312 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
313 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> | |
|
314 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> | |
|
315 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value> | |
|
316 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> | |
|
317 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> | |
|
318 | </valuemap> | |
|
319 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> | |
|
320 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
|
321 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
|
322 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
323 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
|
324 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> | |
|
325 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> | |
|
326 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> | |
|
327 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
|
328 | </valuemap> | |
|
329 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> | |
|
330 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> | |
|
331 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
332 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> | |
|
333 | </valuemap> | |
|
334 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> | |
|
335 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
|
336 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
|
337 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
|
338 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
339 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
|
340 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"/> | |
|
341 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> | |
|
342 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> | |
|
343 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
|
344 | </valuemap> | |
|
345 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> | |
|
346 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> | |
|
347 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
348 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> | |
|
349 | </valuemap> | |
|
350 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> | |
|
351 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> | |
|
352 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> | |
|
353 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release2</value> | |
|
354 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
355 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> | |
|
356 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> | |
|
357 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> | |
|
358 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value> | |
|
359 | </valuemap> | |
|
360 | <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value> | |
|
361 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> | |
|
362 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
|
363 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> | |
|
364 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> | |
|
365 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
366 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> | |
|
367 | </valuemap> | |
|
368 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> | |
|
369 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value> | |
|
370 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
|
371 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> | |
|
372 | </valuemap> | |
|
373 | <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> | |
|
374 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> | |
|
375 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> | |
|
376 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> | |
|
245 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1"> | |
|
377 | 246 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|
378 | 247 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|
379 | 248 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|
380 | 249 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|
381 | 250 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|
382 | 251 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|
383 | 252 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|
384 | 253 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|
385 | 254 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|
255 | <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> | |
|
386 | 256 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|
387 | 257 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|
258 | <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> | |
|
259 | <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> | |
|
260 | <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> | |
|
388 | 261 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|
389 | 262 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|
390 | 263 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|
391 | 264 | <value type="int">0</value> |
|
392 | 265 | <value type="int">1</value> |
|
393 | 266 | <value type="int">2</value> |
|
394 | 267 | <value type="int">3</value> |
|
395 | 268 | <value type="int">4</value> |
|
396 | 269 | <value type="int">5</value> |
|
397 | 270 | <value type="int">6</value> |
|
398 | 271 | <value type="int">7</value> |
|
399 | 272 | <value type="int">8</value> |
|
400 | 273 | <value type="int">9</value> |
|
401 | 274 | <value type="int">10</value> |
|
402 | 275 | <value type="int">11</value> |
|
403 | 276 | <value type="int">12</value> |
|
404 | 277 | <value type="int">13</value> |
|
405 | 278 | <value type="int">14</value> |
|
406 | 279 | </valuelist> |
|
407 |
<value type="int" key="PE.EnvironmentAspect.Base"> |
|
|
280 | <value type="int" key="PE.EnvironmentAspect.Base">-1</value> | |
|
408 | 281 | <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> |
|
409 |
<value type="QString" key="ProjectExplorer. |
|
|
282 | <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value> | |
|
283 | <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">grmon</value> | |
|
284 | <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">false</value> | |
|
285 | <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">%{buildDir}</value> | |
|
286 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Run grmon</value> | |
|
410 | 287 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
411 |
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id"> |
|
|
412 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> | |
|
413 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value> | |
|
414 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> | |
|
415 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value> | |
|
416 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> | |
|
288 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value> | |
|
417 | 289 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> |
|
418 | 290 | <value type="bool" key="RunConfiguration.UseCppDebugger">false</value> |
|
419 | 291 | <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> |
|
420 | 292 | <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> |
|
421 | 293 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> |
|
422 | 294 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> |
|
423 | 295 | </valuemap> |
|
424 |
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount"> |
|
|
296 | <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value> | |
|
425 | 297 | </valuemap> |
|
426 | 298 | </data> |
|
427 | 299 | <data> |
|
428 | 300 | <variable>ProjectExplorer.Project.TargetCount</variable> |
|
429 |
<value type="int"> |
|
|
301 | <value type="int">1</value> | |
|
430 | 302 | </data> |
|
431 | 303 | <data> |
|
432 | 304 | <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> |
|
433 | 305 | <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value> |
|
434 | 306 | </data> |
|
435 | 307 | <data> |
|
436 | 308 | <variable>ProjectExplorer.Project.Updater.FileVersion</variable> |
|
437 |
<value type="int">1 |
|
|
309 | <value type="int">15</value> | |
|
438 | 310 | </data> |
|
439 | 311 | </qtcreator> |
@@ -1,211 +1,204 | |||
|
1 | 1 | #ifndef FSW_PARAMS_H_INCLUDED |
|
2 | 2 | #define FSW_PARAMS_H_INCLUDED |
|
3 | 3 | |
|
4 | 4 | #include "grlib_regs.h" |
|
5 | 5 | #include "fsw_params_processing.h" |
|
6 | 6 | #include "tm_byte_positions.h" |
|
7 | 7 | #include "ccsds_types.h" |
|
8 | 8 | |
|
9 | 9 | #define GRSPW_DEVICE_NAME "/dev/grspw0" |
|
10 | 10 | #define UART_DEVICE_NAME "/dev/console" |
|
11 | 11 | |
|
12 | 12 | //************************ |
|
13 | 13 | // flight software version |
|
14 | 14 | // this parameters is handled by the Qt project options |
|
15 | 15 | |
|
16 | #define NB_SAMPLES_PER_SNAPSHOT 2048 | |
|
17 | #define TIME_OFFSET 2 | |
|
18 | #define WAVEFORM_EXTENDED_HEADER_OFFSET 22 | |
|
19 | #define NB_BYTES_SWF_BLK (2 * 6) | |
|
20 | #define NB_WORDS_SWF_BLK 3 | |
|
21 | #define NB_BYTES_CWF3_LIGHT_BLK 6 | |
|
22 | #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8 | |
|
23 | #define NB_RING_NODES_F1 5 // AT LEAST 3 | |
|
24 | #define NB_RING_NODES_F2 5 // AT LEAST 3 | |
|
25 | ||
|
16 | 26 | //********** |
|
17 | 27 | // LFR MODES |
|
18 | 28 | #define LFR_MODE_STANDBY 0 |
|
19 | 29 | #define LFR_MODE_NORMAL 1 |
|
20 | 30 | #define LFR_MODE_BURST 2 |
|
21 | 31 | #define LFR_MODE_SBM1 3 |
|
22 | 32 | #define LFR_MODE_SBM2 4 |
|
23 | 33 | #define LFR_MODE_NORMAL_CWF_F3 5 |
|
24 | 34 | |
|
25 | 35 | #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0 |
|
26 | 36 | #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1 |
|
27 | 37 | #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2 |
|
28 | 38 | #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3 |
|
29 | 39 | #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4 |
|
30 | 40 | #define RTEMS_EVENT_MODE_SBM2_WFRM RTEMS_EVENT_5 |
|
31 | 41 | |
|
32 | 42 | //**************************** |
|
33 | 43 | // LFR DEFAULT MODE PARAMETERS |
|
34 | 44 | // COMMON |
|
35 | 45 | #define DEFAULT_SY_LFR_COMMON0 0x00 |
|
36 | 46 | #define DEFAULT_SY_LFR_COMMON1 0x10 // default value 0 0 0 1 0 0 0 0 |
|
37 | 47 | // NORM |
|
38 | 48 | #define SY_LFR_N_SWF_L 2048 // nb sample |
|
39 |
#define SY_LFR_N_SWF_P 2 |
|
|
49 | #define SY_LFR_N_SWF_P 20 // sec | |
|
40 | 50 | #define SY_LFR_N_ASM_P 3600 // sec |
|
41 | 51 | #define SY_LFR_N_BP_P0 4 // sec |
|
42 | 52 | #define SY_LFR_N_BP_P1 20 // sec |
|
43 | 53 | #define MIN_DELTA_SNAPSHOT 16 // sec |
|
44 | 54 | // BURST |
|
45 | 55 | #define DEFAULT_SY_LFR_B_BP_P0 1 // sec |
|
46 | 56 | #define DEFAULT_SY_LFR_B_BP_P1 5 // sec |
|
47 | 57 | // SBM1 |
|
48 | 58 | #define DEFAULT_SY_LFR_S1_BP_P0 1 // sec |
|
49 | 59 | #define DEFAULT_SY_LFR_S1_BP_P1 1 // sec |
|
50 | 60 | // SBM2 |
|
51 | 61 | #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec |
|
52 | 62 | #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec |
|
53 | 63 | // ADDITIONAL PARAMETERS |
|
54 | 64 | #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms |
|
55 | 65 | #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s |
|
56 | 66 | // STATUS WORD |
|
57 | 67 | #define DEFAULT_STATUS_WORD_BYTE0 0x0d // [0000] [1] [101] mode 4 bits / SPW enabled 1 bit / state is run 3 bits |
|
58 | 68 | #define DEFAULT_STATUS_WORD_BYTE1 0x00 |
|
59 | 69 | // |
|
60 | 70 | #define SY_LFR_DPU_CONNECT_TIMEOUT 100 // 100 * 10 ms = 1 s |
|
61 | 71 | #define SY_LFR_DPU_CONNECT_ATTEMPT 3 |
|
62 | 72 | //**************************** |
|
63 | 73 | |
|
64 | 74 | //***************************** |
|
65 | 75 | // APB REGISTERS BASE ADDRESSES |
|
66 | 76 | #define REGS_ADDR_APBUART 0x80000100 |
|
67 | 77 | #define REGS_ADDR_GPTIMER 0x80000300 |
|
68 | 78 | #define REGS_ADDR_GRSPW 0x80000500 |
|
69 | 79 | #define REGS_ADDR_TIME_MANAGEMENT 0x80000600 |
|
70 | 80 | #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00 |
|
71 | 81 | |
|
72 | 82 | #ifdef GSA |
|
73 | 83 | #else |
|
74 | 84 | #define REGS_ADDR_WAVEFORM_PICKER 0x80000f20 |
|
75 | 85 | #endif |
|
76 | 86 | |
|
77 | 87 | #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff |
|
78 | 88 | #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 (0x50) |
|
79 | 89 | |
|
80 | 90 | //********** |
|
81 | 91 | // IRQ LINES |
|
82 | 92 | #define IRQ_SM 9 |
|
83 | 93 | #define IRQ_SPARC_SM 0x19 // see sparcv8.pdf p.76 for interrupt levels |
|
84 | 94 | #define IRQ_WF 10 |
|
85 | 95 | #define IRQ_SPARC_WF 0x1a // see sparcv8.pdf p.76 for interrupt levels |
|
86 | 96 | #define IRQ_TIME1 12 |
|
87 | 97 | #define IRQ_SPARC_TIME1 0x1c // see sparcv8.pdf p.76 for interrupt levels |
|
88 | 98 | #define IRQ_TIME2 13 |
|
89 | 99 | #define IRQ_SPARC_TIME2 0x1d // see sparcv8.pdf p.76 for interrupt levels |
|
90 | 100 | #define IRQ_WAVEFORM_PICKER 14 |
|
91 | 101 | #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels |
|
92 | 102 | #define IRQ_SPECTRAL_MATRIX 6 |
|
93 | 103 | #define IRQ_SPARC_SPECTRAL_MATRIX 0x16 // see sparcv8.pdf p.76 for interrupt levels |
|
94 | 104 | |
|
95 | 105 | //***** |
|
96 | 106 | // TIME |
|
97 | 107 | #define CLKDIV_SM_SIMULATOR (10000 - 1) // 10 ms |
|
98 | 108 | #define CLKDIV_WF_SIMULATOR (10000000 - 1) // 10 000 000 * 1 us = 10 s |
|
99 | 109 | #define TIMER_SM_SIMULATOR 1 |
|
100 | 110 | #define TIMER_WF_SIMULATOR 2 |
|
101 | 111 | #define HK_PERIOD 100 // 100 * 10ms => 1sec |
|
102 | 112 | |
|
103 | 113 | //********** |
|
104 | 114 | // LPP CODES |
|
105 | 115 | #define LFR_SUCCESSFUL 0 |
|
106 | 116 | #define LFR_DEFAULT 1 |
|
107 | 117 | |
|
108 | 118 | //****** |
|
109 | 119 | // RTEMS |
|
110 | 120 | #define TASKID_RECV 1 |
|
111 | 121 | #define TASKID_ACTN 2 |
|
112 | 122 | #define TASKID_SPIQ 3 |
|
113 | 123 | #define TASKID_SMIQ 4 |
|
114 | 124 | #define TASKID_STAT 5 |
|
115 | 125 | #define TASKID_AVF0 6 |
|
116 | 126 | #define TASKID_BPF0 7 |
|
117 | 127 | #define TASKID_WFRM 8 |
|
118 | 128 | #define TASKID_DUMB 9 |
|
119 | 129 | #define TASKID_HOUS 10 |
|
120 | 130 | #define TASKID_MATR 11 |
|
121 | 131 | #define TASKID_CWF3 12 |
|
122 | 132 | #define TASKID_CWF2 13 |
|
123 | 133 | #define TASKID_CWF1 14 |
|
124 | 134 | #define TASKID_SEND 15 |
|
125 | 135 | #define TASKID_WTDG 16 |
|
126 | 136 | |
|
127 | 137 | #define TASK_PRIORITY_SPIQ 5 |
|
128 | 138 | #define TASK_PRIORITY_SMIQ 10 |
|
129 | // | |
|
130 | 139 | #define TASK_PRIORITY_WTDG 20 |
|
131 | // | |
|
132 | 140 | #define TASK_PRIORITY_HOUS 30 |
|
133 | // | |
|
134 | 141 | #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together |
|
135 | 142 | #define TASK_PRIORITY_CWF2 35 // |
|
136 | // | |
|
137 | 143 | #define TASK_PRIORITY_WFRM 40 |
|
138 | 144 | #define TASK_PRIORITY_CWF3 40 // there is a printf in this function, be careful with its priority wrt CWF1 |
|
139 | // | |
|
140 | 145 | #define TASK_PRIORITY_SEND 45 |
|
141 | // | |
|
142 | 146 | #define TASK_PRIORITY_RECV 50 |
|
143 | 147 | #define TASK_PRIORITY_ACTN 50 |
|
144 | // | |
|
145 | 148 | #define TASK_PRIORITY_AVF0 60 |
|
146 | 149 | #define TASK_PRIORITY_BPF0 60 |
|
147 | 150 | #define TASK_PRIORITY_MATR 100 |
|
148 | 151 | #define TASK_PRIORITY_STAT 200 |
|
149 | 152 | #define TASK_PRIORITY_DUMB 200 |
|
150 | 153 | |
|
151 | #define SEMQ_PRIORITY_CEILING 30 | |
|
152 | ||
|
153 | 154 | #define ACTION_MSG_QUEUE_COUNT 10 |
|
154 | 155 | #define ACTION_MSG_PKTS_COUNT 50 |
|
155 | 156 | #define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES) |
|
156 | 157 | #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options |
|
157 | 158 | |
|
158 | 159 | #define QUEUE_RECV 0 |
|
159 | 160 | #define QUEUE_SEND 1 |
|
160 | 161 | |
|
161 | 162 | //******* |
|
162 | 163 | // MACROS |
|
163 | 164 | #ifdef PRINT_MESSAGES_ON_CONSOLE |
|
164 | 165 | #define PRINTF(x) printf(x); |
|
165 | 166 | #define PRINTF1(x,y) printf(x,y); |
|
166 | 167 | #define PRINTF2(x,y,z) printf(x,y,z); |
|
167 | 168 | #else |
|
168 | 169 | #define PRINTF(x) ; |
|
169 | 170 | #define PRINTF1(x,y) ; |
|
170 | 171 | #define PRINTF2(x,y,z) ; |
|
171 | 172 | #endif |
|
172 | 173 | |
|
173 | 174 | #ifdef BOOT_MESSAGES |
|
174 | 175 | #define BOOT_PRINTF(x) printf(x); |
|
175 | 176 | #define BOOT_PRINTF1(x,y) printf(x,y); |
|
176 | 177 | #define BOOT_PRINTF2(x,y,z) printf(x,y,z); |
|
177 | 178 | #else |
|
178 | 179 | #define BOOT_PRINTF(x) ; |
|
179 | 180 | #define BOOT_PRINTF1(x,y) ; |
|
180 | 181 | #define BOOT_PRINTF2(x,y,z) ; |
|
181 | 182 | #endif |
|
182 | 183 | |
|
183 | 184 | #ifdef DEBUG_MESSAGES |
|
184 | 185 | #define DEBUG_PRINTF(x) printf(x); |
|
185 | 186 | #define DEBUG_PRINTF1(x,y) printf(x,y); |
|
186 | 187 | #define DEBUG_PRINTF2(x,y,z) printf(x,y,z); |
|
187 | 188 | #else |
|
188 | 189 | #define DEBUG_PRINTF(x) ; |
|
189 | 190 | #define DEBUG_PRINTF1(x,y) ; |
|
190 | 191 | #define DEBUG_PRINTF2(x,y,z) ; |
|
191 | 192 | #endif |
|
192 | 193 | |
|
193 | 194 | #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period |
|
194 | 195 | |
|
195 | #define NB_SAMPLES_PER_SNAPSHOT 2048 | |
|
196 | #define TIME_OFFSET 2 | |
|
197 | #define WAVEFORM_EXTENDED_HEADER_OFFSET 22 | |
|
198 | #define NB_BYTES_SWF_BLK (2 * 6) | |
|
199 | #define NB_WORDS_SWF_BLK 3 | |
|
200 | #define NB_BYTES_CWF3_LIGHT_BLK 6 | |
|
201 | #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8 | |
|
202 | ||
|
203 | 196 | struct param_local_str{ |
|
204 | 197 | unsigned int local_sbm1_nb_cwf_sent; |
|
205 | 198 | unsigned int local_sbm1_nb_cwf_max; |
|
206 | 199 | unsigned int local_sbm2_nb_cwf_sent; |
|
207 | 200 | unsigned int local_sbm2_nb_cwf_max; |
|
208 | 201 | unsigned int local_nb_interrupt_f0_MAX; |
|
209 | 202 | }; |
|
210 | 203 | |
|
211 | 204 | #endif // FSW_PARAMS_H_INCLUDED |
@@ -1,85 +1,93 | |||
|
1 | 1 | #ifndef WF_HANDLER_H_INCLUDED |
|
2 | 2 | #define WF_HANDLER_H_INCLUDED |
|
3 | 3 | |
|
4 | 4 | #include <rtems.h> |
|
5 | 5 | #include <grspw.h> |
|
6 | 6 | #include <stdio.h> |
|
7 | 7 | #include <math.h> |
|
8 | 8 | |
|
9 | 9 | #include "fsw_params.h" |
|
10 | 10 | #include "fsw_spacewire.h" |
|
11 | 11 | #include "fsw_misc.h" |
|
12 | 12 | |
|
13 | 13 | #define pi 3.1415 |
|
14 | 14 | |
|
15 | typedef struct ring_node | |
|
16 | { | |
|
17 | struct ring_node *previous; | |
|
18 | int buffer_address; | |
|
19 | struct ring_node *next; | |
|
20 | unsigned int status; | |
|
21 | } ring_node; | |
|
22 | ||
|
15 | 23 | extern int fdSPW; |
|
24 | ||
|
25 | //***************** | |
|
26 | // waveform buffers | |
|
27 | // F0 | |
|
16 | 28 | extern volatile int wf_snap_f0[ ]; |
|
17 | // | |
|
18 | extern volatile int wf_snap_f1[ ]; | |
|
19 | extern volatile int wf_snap_f1_bis[ ]; | |
|
20 | extern volatile int wf_snap_f1_norm[ ]; | |
|
21 | // | |
|
22 | extern volatile int wf_snap_f2[ ]; | |
|
23 | extern volatile int wf_snap_f2_bis[ ]; | |
|
24 | extern volatile int wf_snap_f2_norm[ ]; | |
|
25 | // | |
|
29 | // F1 | |
|
30 | extern volatile int wf_snap_f1[ ][ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ]; | |
|
31 | // F2 | |
|
32 | extern volatile int wf_snap_f2[ ][ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ]; | |
|
33 | // F3 | |
|
26 | 34 | extern volatile int wf_cont_f3[ ]; |
|
27 | 35 | extern volatile int wf_cont_f3_bis[ ]; |
|
28 | 36 | extern char wf_cont_f3_light[ ]; |
|
37 | ||
|
29 | 38 | extern waveform_picker_regs_t *waveform_picker_regs; |
|
30 | 39 | extern time_management_regs_t *time_management_regs; |
|
31 | 40 | extern Packet_TM_LFR_HK_t housekeeping_packet; |
|
32 | 41 | extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; |
|
33 | 42 | extern struct param_local_str param_local; |
|
34 | 43 | |
|
35 | 44 | extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; |
|
36 | 45 | extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; |
|
37 | 46 | |
|
38 | 47 | extern rtems_id Task_id[20]; /* array of task ids */ |
|
39 | 48 | |
|
40 | 49 | extern unsigned char lfrCurrentMode; |
|
41 | 50 | |
|
42 | 51 | rtems_isr waveforms_isr( rtems_vector_number vector ); |
|
43 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ); | |
|
44 | 52 | rtems_task wfrm_task( rtems_task_argument argument ); |
|
45 | 53 | rtems_task cwf3_task( rtems_task_argument argument ); |
|
46 | 54 | rtems_task cwf2_task( rtems_task_argument argument ); |
|
47 | 55 | rtems_task cwf1_task( rtems_task_argument argument ); |
|
48 | 56 | |
|
49 | 57 | //****************** |
|
50 | 58 | // general functions |
|
51 | 59 | void init_waveforms( void ); |
|
60 | void init_waveform_rings( void ); | |
|
61 | void reset_current_ring_nodes( void ); | |
|
52 | 62 | // |
|
53 | 63 | int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF ); |
|
54 | 64 | int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF ); |
|
55 | 65 | int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF ); |
|
56 | 66 | // |
|
57 | void reset_waveforms( void ); | |
|
58 | // | |
|
59 | 67 | int send_waveform_SWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id ); |
|
60 | 68 | int send_waveform_CWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); |
|
61 | 69 | int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); |
|
62 | 70 | int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); |
|
63 | 71 | // |
|
64 | 72 | rtems_id get_pkts_queue_id( void ); |
|
65 | 73 | |
|
66 | 74 | //************** |
|
67 | 75 | // wfp registers |
|
68 | 76 | void set_wfp_data_shaping(); |
|
69 | 77 | char set_wfp_delta_snapshot(); |
|
70 | 78 | void set_wfp_burst_enable_register( unsigned char mode); |
|
71 | 79 | void reset_wfp_burst_enable(); |
|
72 | 80 | void reset_wfp_status(); |
|
73 | 81 | void reset_waveform_picker_regs(); |
|
74 | 82 | |
|
75 | 83 | //***************** |
|
76 | 84 | // local parameters |
|
77 | 85 | void set_local_sbm1_nb_cwf_max( void ); |
|
78 | 86 | void set_local_sbm2_nb_cwf_max( void ); |
|
79 | 87 | void set_local_nb_interrupt_f0_MAX( void ); |
|
80 | 88 | void reset_local_sbm1_nb_cwf_sent( void ); |
|
81 | 89 | void reset_local_sbm2_nb_cwf_sent( void ); |
|
82 | 90 | |
|
83 | 91 | void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ); |
|
84 | 92 | |
|
85 | 93 | #endif // WF_HANDLER_H_INCLUDED |
@@ -1,91 +1,87 | |||
|
1 | 1 | /** Global variables of the LFR flight software. |
|
2 | 2 | * |
|
3 | 3 | * @file |
|
4 | 4 | * @author P. LEROY |
|
5 | 5 | * |
|
6 | 6 | * Among global variables, there are: |
|
7 | 7 | * - RTEMS names and id. |
|
8 | 8 | * - APB configuration registers. |
|
9 | 9 | * - waveforms global buffers, used by the waveform picker hardware module to store data. |
|
10 | 10 | * - spectral matrices buffesr, used by the hardware module to store data. |
|
11 | 11 | * - variable related to LFR modes parameters. |
|
12 | 12 | * - the global HK packet buffer. |
|
13 | 13 | * - the global dump parameter buffer. |
|
14 | 14 | * |
|
15 | 15 | */ |
|
16 | 16 | |
|
17 | 17 | #include <rtems.h> |
|
18 | 18 | #include <grspw.h> |
|
19 | 19 | |
|
20 | 20 | #include "ccsds_types.h" |
|
21 | 21 | #include "grlib_regs.h" |
|
22 | 22 | #include "fsw_params.h" |
|
23 | 23 | |
|
24 | 24 | // RTEMS GLOBAL VARIABLES |
|
25 | 25 | rtems_name misc_name[5]; |
|
26 | 26 | rtems_id misc_id[5]; |
|
27 | 27 | rtems_name Task_name[20]; /* array of task names */ |
|
28 | 28 | rtems_id Task_id[20]; /* array of task ids */ |
|
29 | 29 | unsigned int maxCount; |
|
30 | 30 | int fdSPW = 0; |
|
31 | 31 | int fdUART = 0; |
|
32 | 32 | unsigned char lfrCurrentMode; |
|
33 | 33 | |
|
34 | // APB CONFIGURATION REGISTERS | |
|
35 | time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT; | |
|
36 | gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER; | |
|
37 | #ifdef GSA | |
|
38 | #else | |
|
39 | waveform_picker_regs_t *waveform_picker_regs = (waveform_picker_regs_t*) REGS_ADDR_WAVEFORM_PICKER; | |
|
40 | #endif | |
|
41 | spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX; | |
|
42 | ||
|
43 | 34 | // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes |
|
44 | 35 | volatile int wf_snap_f0[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ]; |
|
45 | 36 | // |
|
46 |
volatile int wf_snap_f1[ |
|
|
47 | volatile int wf_snap_f1_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ]; | |
|
48 | volatile int wf_snap_f1_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ]; | |
|
37 | volatile int wf_snap_f1[NB_RING_NODES_F1][ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ]; | |
|
49 | 38 | // |
|
50 |
volatile int wf_snap_f2[ |
|
|
51 | volatile int wf_snap_f2_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ]; | |
|
52 | volatile int wf_snap_f2_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ]; | |
|
39 | volatile int wf_snap_f2[NB_RING_NODES_F2][ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ]; | |
|
53 | 40 | // |
|
54 | 41 | volatile int wf_cont_f3[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ]; |
|
55 | 42 | volatile int wf_cont_f3_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ]; |
|
56 | 43 | char wf_cont_f3_light[ NB_SAMPLES_PER_SNAPSHOT * NB_BYTES_CWF3_LIGHT_BLK ]; |
|
57 | 44 | |
|
58 | 45 | // SPECTRAL MATRICES GLOBAL VARIABLES |
|
59 | 46 | volatile int spec_mat_f0_0[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
60 | 47 | volatile int spec_mat_f0_1[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
61 | 48 | volatile int spec_mat_f0_a[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
62 | 49 | volatile int spec_mat_f0_b[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
63 | 50 | volatile int spec_mat_f0_c[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
64 | 51 | volatile int spec_mat_f0_d[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
65 | 52 | volatile int spec_mat_f0_e[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
66 | 53 | volatile int spec_mat_f0_f[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
67 | 54 | volatile int spec_mat_f0_g[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
68 | 55 | volatile int spec_mat_f0_h[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
69 | 56 | volatile int spec_mat_f0_0_bis[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
70 | 57 | volatile int spec_mat_f0_1_bis[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
71 | 58 | // |
|
72 | 59 | volatile int spec_mat_f1[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
73 | 60 | volatile int spec_mat_f1_bis[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
74 | 61 | // |
|
75 | 62 | volatile int spec_mat_f2[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
76 | 63 | volatile int spec_mat_f2_bis[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
77 | 64 | |
|
65 | // APB CONFIGURATION REGISTERS | |
|
66 | time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT; | |
|
67 | gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER; | |
|
68 | #ifdef GSA | |
|
69 | #else | |
|
70 | waveform_picker_regs_t *waveform_picker_regs = (waveform_picker_regs_t*) REGS_ADDR_WAVEFORM_PICKER; | |
|
71 | #endif | |
|
72 | spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX; | |
|
73 | ||
|
78 | 74 | // MODE PARAMETERS |
|
79 | 75 | Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; |
|
80 | 76 | struct param_local_str param_local; |
|
81 | 77 | |
|
82 | 78 | // HK PACKETS |
|
83 | 79 | Packet_TM_LFR_HK_t housekeeping_packet; |
|
84 | 80 | // sequence counters are incremented by APID (PID + CAT) and destination ID |
|
85 | 81 | unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; |
|
86 | 82 | unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; |
|
87 | 83 | unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID]; |
|
88 | 84 | spw_stats spacewire_stats; |
|
89 | 85 | spw_stats spacewire_stats_backup; |
|
90 | 86 | |
|
91 | 87 |
@@ -1,610 +1,611 | |||
|
1 | 1 | /** This is the RTEMS initialization module. |
|
2 | 2 | * |
|
3 | 3 | * @file |
|
4 | 4 | * @author P. LEROY |
|
5 | 5 | * |
|
6 | 6 | * This module contains two very different information: |
|
7 | 7 | * - specific instructions to configure the compilation of the RTEMS executive |
|
8 | 8 | * - functions related to the fligth softwre initialization, especially the INIT RTEMS task |
|
9 | 9 | * |
|
10 | 10 | */ |
|
11 | 11 | |
|
12 | 12 | //************************* |
|
13 | 13 | // GPL reminder to be added |
|
14 | 14 | //************************* |
|
15 | 15 | |
|
16 | 16 | #include <rtems.h> |
|
17 | 17 | |
|
18 | 18 | /* configuration information */ |
|
19 | 19 | |
|
20 | 20 | #define CONFIGURE_INIT |
|
21 | 21 | |
|
22 | 22 | #include <bsp.h> /* for device driver prototypes */ |
|
23 | 23 | |
|
24 | 24 | /* configuration information */ |
|
25 | 25 | |
|
26 | 26 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
|
27 | 27 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
|
28 | 28 | |
|
29 | 29 | #define CONFIGURE_MAXIMUM_TASKS 20 |
|
30 | 30 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
|
31 | 31 | #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) |
|
32 | 32 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32 |
|
33 | 33 | #define CONFIGURE_INIT_TASK_PRIORITY 1 // instead of 100 |
|
34 | 34 | #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT) |
|
35 | 35 | #define CONFIGURE_MAXIMUM_DRIVERS 16 |
|
36 | 36 | #define CONFIGURE_MAXIMUM_PERIODS 5 |
|
37 | 37 | #define CONFIGURE_MAXIMUM_TIMERS 5 // STAT (1s), send SWF (0.3s), send CWF3 (1s) |
|
38 | 38 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 2 |
|
39 | 39 | #ifdef PRINT_STACK_REPORT |
|
40 | 40 | #define CONFIGURE_STACK_CHECKER_ENABLED |
|
41 | 41 | #endif |
|
42 | 42 | |
|
43 | 43 | #include <rtems/confdefs.h> |
|
44 | 44 | |
|
45 | 45 | /* If --drvmgr was enabled during the configuration of the RTEMS kernel */ |
|
46 | 46 | #ifdef RTEMS_DRVMGR_STARTUP |
|
47 | 47 | #ifdef LEON3 |
|
48 | 48 | /* Add Timer and UART Driver */ |
|
49 | 49 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
|
50 | 50 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER |
|
51 | 51 | #endif |
|
52 | 52 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
|
53 | 53 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART |
|
54 | 54 | #endif |
|
55 | 55 | #endif |
|
56 | 56 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */ |
|
57 | 57 | #include <drvmgr/drvmgr_confdefs.h> |
|
58 | 58 | #endif |
|
59 | 59 | |
|
60 | 60 | #include "fsw_init.h" |
|
61 | 61 | #include "fsw_config.c" |
|
62 | 62 | |
|
63 | 63 | rtems_task Init( rtems_task_argument ignored ) |
|
64 | 64 | { |
|
65 | 65 | /** This is the RTEMS INIT taks, it the first task launched by the system. |
|
66 | 66 | * |
|
67 | 67 | * @param unused is the starting argument of the RTEMS task |
|
68 | 68 | * |
|
69 | 69 | * The INIT task create and run all other RTEMS tasks. |
|
70 | 70 | * |
|
71 | 71 | */ |
|
72 | 72 | |
|
73 | 73 | |
|
74 | 74 | rtems_status_code status; |
|
75 | 75 | rtems_status_code status_spw; |
|
76 | 76 | rtems_isr_entry old_isr_handler; |
|
77 | 77 | |
|
78 | 78 | BOOT_PRINTF("\n\n\n\n\n") |
|
79 | 79 | BOOT_PRINTF("***************************\n") |
|
80 | 80 | BOOT_PRINTF("** START Flight Software **\n") |
|
81 | 81 | BOOT_PRINTF("***************************\n") |
|
82 | 82 | BOOT_PRINTF("\n\n") |
|
83 | 83 | |
|
84 | 84 | //send_console_outputs_on_apbuart_port(); |
|
85 | 85 | set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE); |
|
86 | 86 | |
|
87 | 87 | reset_wfp_burst_enable(); // stop the waveform picker if it was running |
|
88 | init_waveform_rings(); // initialize the waveform rings | |
|
88 | 89 | |
|
89 | 90 | init_parameter_dump(); |
|
90 | 91 | init_local_mode_parameters(); |
|
91 | 92 | init_housekeeping_parameters(); |
|
92 | 93 | |
|
93 | 94 | updateLFRCurrentMode(); |
|
94 | 95 | |
|
95 | 96 | BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode) |
|
96 | 97 | |
|
97 | 98 | create_names(); // create all names |
|
98 | 99 | |
|
99 | 100 | status = create_message_queues(); // create message queues |
|
100 | 101 | if (status != RTEMS_SUCCESSFUL) |
|
101 | 102 | { |
|
102 | 103 | PRINTF1("in INIT *** ERR in create_message_queues, code %d", status) |
|
103 | 104 | } |
|
104 | 105 | |
|
105 | 106 | status = create_all_tasks(); // create all tasks |
|
106 | 107 | if (status != RTEMS_SUCCESSFUL) |
|
107 | 108 | { |
|
108 | 109 | PRINTF1("in INIT *** ERR in create_all_tasks, code %d", status) |
|
109 | 110 | } |
|
110 | 111 | |
|
111 | 112 | // ************************** |
|
112 | 113 | // <SPACEWIRE INITIALIZATION> |
|
113 | 114 | grspw_timecode_callback = &timecode_irq_handler; |
|
114 | 115 | |
|
115 | 116 | status_spw = spacewire_open_link(); // (1) open the link |
|
116 | 117 | if ( status_spw != RTEMS_SUCCESSFUL ) |
|
117 | 118 | { |
|
118 | 119 | PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw ) |
|
119 | 120 | } |
|
120 | 121 | |
|
121 | 122 | if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link |
|
122 | 123 | { |
|
123 | 124 | status_spw = spacewire_configure_link( fdSPW ); |
|
124 | 125 | if ( status_spw != RTEMS_SUCCESSFUL ) |
|
125 | 126 | { |
|
126 | 127 | PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw ) |
|
127 | 128 | } |
|
128 | 129 | } |
|
129 | 130 | |
|
130 | 131 | if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link |
|
131 | 132 | { |
|
132 | 133 | status_spw = spacewire_start_link( fdSPW ); |
|
133 | 134 | if ( status_spw != RTEMS_SUCCESSFUL ) |
|
134 | 135 | { |
|
135 | 136 | PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw ) |
|
136 | 137 | } |
|
137 | 138 | } |
|
138 | 139 | // </SPACEWIRE INITIALIZATION> |
|
139 | 140 | // *************************** |
|
140 | 141 | |
|
141 | 142 | status = start_all_tasks(); // start all tasks |
|
142 | 143 | if (status != RTEMS_SUCCESSFUL) |
|
143 | 144 | { |
|
144 | 145 | PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status) |
|
145 | 146 | } |
|
146 | 147 | |
|
147 | 148 | // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization |
|
148 | 149 | status = start_recv_send_tasks(); |
|
149 | 150 | if ( status != RTEMS_SUCCESSFUL ) |
|
150 | 151 | { |
|
151 | 152 | PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status ) |
|
152 | 153 | } |
|
153 | 154 | |
|
154 | 155 | // suspend science tasks. they will be restarted later depending on the mode |
|
155 | 156 | status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY) |
|
156 | 157 | if (status != RTEMS_SUCCESSFUL) |
|
157 | 158 | { |
|
158 | 159 | PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status) |
|
159 | 160 | } |
|
160 | 161 | |
|
161 | 162 | #ifdef GSA |
|
162 | 163 | // mask IRQ lines |
|
163 | 164 | LEON_Mask_interrupt( IRQ_SM ); |
|
164 | 165 | LEON_Mask_interrupt( IRQ_WF ); |
|
165 | 166 | // Spectral Matrices simulator |
|
166 | 167 | configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR, |
|
167 | 168 | IRQ_SPARC_SM, spectral_matrices_isr ); |
|
168 | 169 | // WaveForms |
|
169 | 170 | configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR, CLKDIV_WF_SIMULATOR, |
|
170 | 171 | IRQ_SPARC_WF, waveforms_simulator_isr ); |
|
171 | 172 | #else |
|
172 | 173 | // configure IRQ handling for the waveform picker unit |
|
173 | 174 | status = rtems_interrupt_catch( waveforms_isr, |
|
174 | 175 | IRQ_SPARC_WAVEFORM_PICKER, |
|
175 | 176 | &old_isr_handler) ; |
|
176 | 177 | #endif |
|
177 | 178 | |
|
178 | 179 | // if the spacewire link is not up then send an event to the SPIQ task for link recovery |
|
179 | 180 | if ( status_spw != RTEMS_SUCCESSFUL ) |
|
180 | 181 | { |
|
181 | 182 | status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT ); |
|
182 | 183 | if ( status != RTEMS_SUCCESSFUL ) { |
|
183 | 184 | PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status ) |
|
184 | 185 | } |
|
185 | 186 | } |
|
186 | 187 | |
|
187 | 188 | BOOT_PRINTF("delete INIT\n") |
|
188 | 189 | |
|
189 | 190 | status = rtems_task_delete(RTEMS_SELF); |
|
190 | 191 | |
|
191 | 192 | } |
|
192 | 193 | |
|
193 | 194 | void init_local_mode_parameters( void ) |
|
194 | 195 | { |
|
195 | 196 | /** This function initialize the param_local global variable with default values. |
|
196 | 197 | * |
|
197 | 198 | */ |
|
198 | 199 | |
|
199 | 200 | unsigned int i; |
|
200 | 201 | |
|
201 | 202 | // LOCAL PARAMETERS |
|
202 | 203 | set_local_sbm1_nb_cwf_max(); |
|
203 | 204 | set_local_sbm2_nb_cwf_max(); |
|
204 | 205 | set_local_nb_interrupt_f0_MAX(); |
|
205 | 206 | |
|
206 | 207 | BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max) |
|
207 | 208 | BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max) |
|
208 | 209 | BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX) |
|
209 | 210 | |
|
210 | 211 | reset_local_sbm1_nb_cwf_sent(); |
|
211 | 212 | reset_local_sbm2_nb_cwf_sent(); |
|
212 | 213 | |
|
213 | 214 | // init sequence counters |
|
214 | 215 | |
|
215 | 216 | for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++) |
|
216 | 217 | { |
|
217 | 218 | sequenceCounters_TC_EXE[i] = 0x00; |
|
218 | 219 | } |
|
219 | 220 | sequenceCounters_SCIENCE_NORMAL_BURST = 0x00; |
|
220 | 221 | sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00; |
|
221 | 222 | } |
|
222 | 223 | |
|
223 | 224 | void create_names( void ) // create all names for tasks and queues |
|
224 | 225 | { |
|
225 | 226 | /** This function creates all RTEMS names used in the software for tasks and queues. |
|
226 | 227 | * |
|
227 | 228 | * @return RTEMS directive status codes: |
|
228 | 229 | * - RTEMS_SUCCESSFUL - successful completion |
|
229 | 230 | * |
|
230 | 231 | */ |
|
231 | 232 | |
|
232 | 233 | // task names |
|
233 | 234 | Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' ); |
|
234 | 235 | Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' ); |
|
235 | 236 | Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' ); |
|
236 | 237 | Task_name[TASKID_SMIQ] = rtems_build_name( 'S', 'M', 'I', 'Q' ); |
|
237 | 238 | Task_name[TASKID_STAT] = rtems_build_name( 'S', 'T', 'A', 'T' ); |
|
238 | 239 | Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' ); |
|
239 | 240 | Task_name[TASKID_BPF0] = rtems_build_name( 'B', 'P', 'F', '0' ); |
|
240 | 241 | Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' ); |
|
241 | 242 | Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' ); |
|
242 | 243 | Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' ); |
|
243 | 244 | Task_name[TASKID_MATR] = rtems_build_name( 'M', 'A', 'T', 'R' ); |
|
244 | 245 | Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' ); |
|
245 | 246 | Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' ); |
|
246 | 247 | Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' ); |
|
247 | 248 | Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' ); |
|
248 | 249 | Task_name[TASKID_WTDG] = rtems_build_name( 'W', 'T', 'D', 'G' ); |
|
249 | 250 | |
|
250 | 251 | // rate monotonic period names |
|
251 | 252 | name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' ); |
|
252 | 253 | |
|
253 | 254 | misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' ); |
|
254 | 255 | misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' ); |
|
255 | 256 | } |
|
256 | 257 | |
|
257 | 258 | int create_all_tasks( void ) // create all tasks which run in the software |
|
258 | 259 | { |
|
259 | 260 | /** This function creates all RTEMS tasks used in the software. |
|
260 | 261 | * |
|
261 | 262 | * @return RTEMS directive status codes: |
|
262 | 263 | * - RTEMS_SUCCESSFUL - task created successfully |
|
263 | 264 | * - RTEMS_INVALID_ADDRESS - id is NULL |
|
264 | 265 | * - RTEMS_INVALID_NAME - invalid task name |
|
265 | 266 | * - RTEMS_INVALID_PRIORITY - invalid task priority |
|
266 | 267 | * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured |
|
267 | 268 | * - RTEMS_TOO_MANY - too many tasks created |
|
268 | 269 | * - RTEMS_UNSATISFIED - not enough memory for stack/FP context |
|
269 | 270 | * - RTEMS_TOO_MANY - too many global objects |
|
270 | 271 | * |
|
271 | 272 | */ |
|
272 | 273 | |
|
273 | 274 | rtems_status_code status; |
|
274 | 275 | |
|
275 | 276 | // RECV |
|
276 | 277 | status = rtems_task_create( |
|
277 | 278 | Task_name[TASKID_RECV], TASK_PRIORITY_RECV, RTEMS_MINIMUM_STACK_SIZE, |
|
278 | 279 | RTEMS_DEFAULT_MODES, |
|
279 | 280 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV] |
|
280 | 281 | ); |
|
281 | 282 | |
|
282 | 283 | if (status == RTEMS_SUCCESSFUL) // ACTN |
|
283 | 284 | { |
|
284 | 285 | status = rtems_task_create( |
|
285 | 286 | Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE, |
|
286 | 287 | RTEMS_DEFAULT_MODES, |
|
287 | 288 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN] |
|
288 | 289 | ); |
|
289 | 290 | } |
|
290 | 291 | if (status == RTEMS_SUCCESSFUL) // SPIQ |
|
291 | 292 | { |
|
292 | 293 | status = rtems_task_create( |
|
293 | 294 | Task_name[TASKID_SPIQ], TASK_PRIORITY_SPIQ, RTEMS_MINIMUM_STACK_SIZE, |
|
294 | 295 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
295 | 296 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ] |
|
296 | 297 | ); |
|
297 | 298 | } |
|
298 | 299 | if (status == RTEMS_SUCCESSFUL) // SMIQ |
|
299 | 300 | { |
|
300 | 301 | status = rtems_task_create( |
|
301 | 302 | Task_name[TASKID_SMIQ], TASK_PRIORITY_SMIQ, RTEMS_MINIMUM_STACK_SIZE, |
|
302 | 303 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
303 | 304 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SMIQ] |
|
304 | 305 | ); |
|
305 | 306 | } |
|
306 | 307 | if (status == RTEMS_SUCCESSFUL) // STAT |
|
307 | 308 | { |
|
308 | 309 | status = rtems_task_create( |
|
309 | 310 | Task_name[TASKID_STAT], TASK_PRIORITY_STAT, RTEMS_MINIMUM_STACK_SIZE, |
|
310 | 311 | RTEMS_DEFAULT_MODES, |
|
311 | 312 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_STAT] |
|
312 | 313 | ); |
|
313 | 314 | } |
|
314 | 315 | if (status == RTEMS_SUCCESSFUL) // AVF0 |
|
315 | 316 | { |
|
316 | 317 | status = rtems_task_create( |
|
317 | 318 | Task_name[TASKID_AVF0], TASK_PRIORITY_AVF0, RTEMS_MINIMUM_STACK_SIZE, |
|
318 | 319 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
319 | 320 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0] |
|
320 | 321 | ); |
|
321 | 322 | } |
|
322 | 323 | if (status == RTEMS_SUCCESSFUL) // BPF0 |
|
323 | 324 | { |
|
324 | 325 | status = rtems_task_create( |
|
325 | 326 | Task_name[TASKID_BPF0], TASK_PRIORITY_BPF0, RTEMS_MINIMUM_STACK_SIZE, |
|
326 | 327 | RTEMS_DEFAULT_MODES, |
|
327 | 328 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_BPF0] |
|
328 | 329 | ); |
|
329 | 330 | } |
|
330 | 331 | if (status == RTEMS_SUCCESSFUL) // WFRM |
|
331 | 332 | { |
|
332 | 333 | status = rtems_task_create( |
|
333 | 334 | Task_name[TASKID_WFRM], TASK_PRIORITY_WFRM, RTEMS_MINIMUM_STACK_SIZE, |
|
334 | 335 | RTEMS_DEFAULT_MODES, |
|
335 | 336 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_WFRM] |
|
336 | 337 | ); |
|
337 | 338 | } |
|
338 | 339 | if (status == RTEMS_SUCCESSFUL) // DUMB |
|
339 | 340 | { |
|
340 | 341 | status = rtems_task_create( |
|
341 | 342 | Task_name[TASKID_DUMB], TASK_PRIORITY_DUMB, RTEMS_MINIMUM_STACK_SIZE, |
|
342 | 343 | RTEMS_DEFAULT_MODES, |
|
343 | 344 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_DUMB] |
|
344 | 345 | ); |
|
345 | 346 | } |
|
346 | 347 | if (status == RTEMS_SUCCESSFUL) // HOUS |
|
347 | 348 | { |
|
348 | 349 | status = rtems_task_create( |
|
349 | 350 | Task_name[TASKID_HOUS], TASK_PRIORITY_HOUS, RTEMS_MINIMUM_STACK_SIZE, |
|
350 | 351 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
351 | 352 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS] |
|
352 | 353 | ); |
|
353 | 354 | } |
|
354 | 355 | if (status == RTEMS_SUCCESSFUL) // MATR |
|
355 | 356 | { |
|
356 | 357 | status = rtems_task_create( |
|
357 | 358 | Task_name[TASKID_MATR], TASK_PRIORITY_MATR, RTEMS_MINIMUM_STACK_SIZE, |
|
358 | 359 | RTEMS_DEFAULT_MODES, |
|
359 | 360 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_MATR] |
|
360 | 361 | ); |
|
361 | 362 | } |
|
362 | 363 | if (status == RTEMS_SUCCESSFUL) // CWF3 |
|
363 | 364 | { |
|
364 | 365 | status = rtems_task_create( |
|
365 | 366 | Task_name[TASKID_CWF3], TASK_PRIORITY_CWF3, RTEMS_MINIMUM_STACK_SIZE, |
|
366 | 367 | RTEMS_DEFAULT_MODES, |
|
367 | 368 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF3] |
|
368 | 369 | ); |
|
369 | 370 | } |
|
370 | 371 | if (status == RTEMS_SUCCESSFUL) // CWF2 |
|
371 | 372 | { |
|
372 | 373 | status = rtems_task_create( |
|
373 | 374 | Task_name[TASKID_CWF2], TASK_PRIORITY_CWF2, RTEMS_MINIMUM_STACK_SIZE, |
|
374 | 375 | RTEMS_DEFAULT_MODES, |
|
375 | 376 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF2] |
|
376 | 377 | ); |
|
377 | 378 | } |
|
378 | 379 | if (status == RTEMS_SUCCESSFUL) // CWF1 |
|
379 | 380 | { |
|
380 | 381 | status = rtems_task_create( |
|
381 | 382 | Task_name[TASKID_CWF1], TASK_PRIORITY_CWF1, RTEMS_MINIMUM_STACK_SIZE, |
|
382 | 383 | RTEMS_DEFAULT_MODES, |
|
383 | 384 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_CWF1] |
|
384 | 385 | ); |
|
385 | 386 | } |
|
386 | 387 | if (status == RTEMS_SUCCESSFUL) // SEND |
|
387 | 388 | { |
|
388 | 389 | status = rtems_task_create( |
|
389 | 390 | Task_name[TASKID_SEND], TASK_PRIORITY_SEND, RTEMS_MINIMUM_STACK_SIZE, |
|
390 | 391 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
391 | 392 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SEND] |
|
392 | 393 | ); |
|
393 | 394 | } |
|
394 | 395 | if (status == RTEMS_SUCCESSFUL) // WTDG |
|
395 | 396 | { |
|
396 | 397 | status = rtems_task_create( |
|
397 | 398 | Task_name[TASKID_WTDG], TASK_PRIORITY_WTDG, RTEMS_MINIMUM_STACK_SIZE, |
|
398 | 399 | RTEMS_DEFAULT_MODES, |
|
399 | 400 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_WTDG] |
|
400 | 401 | ); |
|
401 | 402 | } |
|
402 | 403 | |
|
403 | 404 | return status; |
|
404 | 405 | } |
|
405 | 406 | |
|
406 | 407 | int start_recv_send_tasks( void ) |
|
407 | 408 | { |
|
408 | 409 | rtems_status_code status; |
|
409 | 410 | |
|
410 | 411 | status = rtems_task_start( Task_id[TASKID_RECV], recv_task, 1 ); |
|
411 | 412 | if (status!=RTEMS_SUCCESSFUL) { |
|
412 | 413 | BOOT_PRINTF("in INIT *** Error starting TASK_RECV\n") |
|
413 | 414 | } |
|
414 | 415 | |
|
415 | 416 | if (status == RTEMS_SUCCESSFUL) // SEND |
|
416 | 417 | { |
|
417 | 418 | status = rtems_task_start( Task_id[TASKID_SEND], send_task, 1 ); |
|
418 | 419 | if (status!=RTEMS_SUCCESSFUL) { |
|
419 | 420 | BOOT_PRINTF("in INIT *** Error starting TASK_SEND\n") |
|
420 | 421 | } |
|
421 | 422 | } |
|
422 | 423 | |
|
423 | 424 | return status; |
|
424 | 425 | } |
|
425 | 426 | |
|
426 | 427 | int start_all_tasks( void ) // start all tasks except SEND RECV and HOUS |
|
427 | 428 | { |
|
428 | 429 | /** This function starts all RTEMS tasks used in the software. |
|
429 | 430 | * |
|
430 | 431 | * @return RTEMS directive status codes: |
|
431 | 432 | * - RTEMS_SUCCESSFUL - ask started successfully |
|
432 | 433 | * - RTEMS_INVALID_ADDRESS - invalid task entry point |
|
433 | 434 | * - RTEMS_INVALID_ID - invalid task id |
|
434 | 435 | * - RTEMS_INCORRECT_STATE - task not in the dormant state |
|
435 | 436 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task |
|
436 | 437 | * |
|
437 | 438 | */ |
|
438 | 439 | // starts all the tasks fot eh flight software |
|
439 | 440 | |
|
440 | 441 | rtems_status_code status; |
|
441 | 442 | |
|
442 | 443 | status = rtems_task_start( Task_id[TASKID_SPIQ], spiq_task, 1 ); |
|
443 | 444 | if (status!=RTEMS_SUCCESSFUL) { |
|
444 | 445 | BOOT_PRINTF("in INIT *** Error starting TASK_SPIQ\n") |
|
445 | 446 | } |
|
446 | 447 | |
|
447 | 448 | if (status == RTEMS_SUCCESSFUL) // WTDG |
|
448 | 449 | { |
|
449 | 450 | status = rtems_task_start( Task_id[TASKID_WTDG], wtdg_task, 1 ); |
|
450 | 451 | if (status!=RTEMS_SUCCESSFUL) { |
|
451 | 452 | BOOT_PRINTF("in INIT *** Error starting TASK_WTDG\n") |
|
452 | 453 | } |
|
453 | 454 | } |
|
454 | 455 | |
|
455 | 456 | if (status == RTEMS_SUCCESSFUL) // SMIQ |
|
456 | 457 | { |
|
457 | 458 | status = rtems_task_start( Task_id[TASKID_SMIQ], smiq_task, 1 ); |
|
458 | 459 | if (status!=RTEMS_SUCCESSFUL) { |
|
459 | 460 | BOOT_PRINTF("in INIT *** Error starting TASK_BPPR\n") |
|
460 | 461 | } |
|
461 | 462 | } |
|
462 | 463 | |
|
463 | 464 | if (status == RTEMS_SUCCESSFUL) // ACTN |
|
464 | 465 | { |
|
465 | 466 | status = rtems_task_start( Task_id[TASKID_ACTN], actn_task, 1 ); |
|
466 | 467 | if (status!=RTEMS_SUCCESSFUL) { |
|
467 | 468 | BOOT_PRINTF("in INIT *** Error starting TASK_ACTN\n") |
|
468 | 469 | } |
|
469 | 470 | } |
|
470 | 471 | |
|
471 | 472 | if (status == RTEMS_SUCCESSFUL) // STAT |
|
472 | 473 | { |
|
473 | 474 | status = rtems_task_start( Task_id[TASKID_STAT], stat_task, 1 ); |
|
474 | 475 | if (status!=RTEMS_SUCCESSFUL) { |
|
475 | 476 | BOOT_PRINTF("in INIT *** Error starting TASK_STAT\n") |
|
476 | 477 | } |
|
477 | 478 | } |
|
478 | 479 | |
|
479 | 480 | if (status == RTEMS_SUCCESSFUL) // AVF0 |
|
480 | 481 | { |
|
481 | 482 | status = rtems_task_start( Task_id[TASKID_AVF0], avf0_task, 1 ); |
|
482 | 483 | if (status!=RTEMS_SUCCESSFUL) { |
|
483 | 484 | BOOT_PRINTF("in INIT *** Error starting TASK_AVF0\n") |
|
484 | 485 | } |
|
485 | 486 | } |
|
486 | 487 | |
|
487 | 488 | if (status == RTEMS_SUCCESSFUL) // BPF0 |
|
488 | 489 | { |
|
489 | 490 | status = rtems_task_start( Task_id[TASKID_BPF0], bpf0_task, 1 ); |
|
490 | 491 | if (status!=RTEMS_SUCCESSFUL) { |
|
491 | 492 | BOOT_PRINTF("in INIT *** Error starting TASK_BPF0\n") |
|
492 | 493 | } |
|
493 | 494 | } |
|
494 | 495 | |
|
495 | 496 | if (status == RTEMS_SUCCESSFUL) // WFRM |
|
496 | 497 | { |
|
497 | 498 | status = rtems_task_start( Task_id[TASKID_WFRM], wfrm_task, 1 ); |
|
498 | 499 | if (status!=RTEMS_SUCCESSFUL) { |
|
499 | 500 | BOOT_PRINTF("in INIT *** Error starting TASK_WFRM\n") |
|
500 | 501 | } |
|
501 | 502 | } |
|
502 | 503 | |
|
503 | 504 | if (status == RTEMS_SUCCESSFUL) // DUMB |
|
504 | 505 | { |
|
505 | 506 | status = rtems_task_start( Task_id[TASKID_DUMB], dumb_task, 1 ); |
|
506 | 507 | if (status!=RTEMS_SUCCESSFUL) { |
|
507 | 508 | BOOT_PRINTF("in INIT *** Error starting TASK_DUMB\n") |
|
508 | 509 | } |
|
509 | 510 | } |
|
510 | 511 | |
|
511 | 512 | if (status == RTEMS_SUCCESSFUL) // HOUS |
|
512 | 513 | { |
|
513 | 514 | status = rtems_task_start( Task_id[TASKID_HOUS], hous_task, 1 ); |
|
514 | 515 | if (status!=RTEMS_SUCCESSFUL) { |
|
515 | 516 | BOOT_PRINTF("in INIT *** Error starting TASK_HOUS\n") |
|
516 | 517 | } |
|
517 | 518 | } |
|
518 | 519 | |
|
519 | 520 | if (status == RTEMS_SUCCESSFUL) // MATR |
|
520 | 521 | { |
|
521 | 522 | status = rtems_task_start( Task_id[TASKID_MATR], matr_task, 1 ); |
|
522 | 523 | if (status!=RTEMS_SUCCESSFUL) { |
|
523 | 524 | BOOT_PRINTF("in INIT *** Error starting TASK_MATR\n") |
|
524 | 525 | } |
|
525 | 526 | } |
|
526 | 527 | |
|
527 | 528 | if (status == RTEMS_SUCCESSFUL) // CWF3 |
|
528 | 529 | { |
|
529 | 530 | status = rtems_task_start( Task_id[TASKID_CWF3], cwf3_task, 1 ); |
|
530 | 531 | if (status!=RTEMS_SUCCESSFUL) { |
|
531 | 532 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF3\n") |
|
532 | 533 | } |
|
533 | 534 | } |
|
534 | 535 | |
|
535 | 536 | if (status == RTEMS_SUCCESSFUL) // CWF2 |
|
536 | 537 | { |
|
537 | 538 | status = rtems_task_start( Task_id[TASKID_CWF2], cwf2_task, 1 ); |
|
538 | 539 | if (status!=RTEMS_SUCCESSFUL) { |
|
539 | 540 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF2\n") |
|
540 | 541 | } |
|
541 | 542 | } |
|
542 | 543 | |
|
543 | 544 | if (status == RTEMS_SUCCESSFUL) // CWF1 |
|
544 | 545 | { |
|
545 | 546 | status = rtems_task_start( Task_id[TASKID_CWF1], cwf1_task, 1 ); |
|
546 | 547 | if (status!=RTEMS_SUCCESSFUL) { |
|
547 | 548 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF1\n") |
|
548 | 549 | } |
|
549 | 550 | } |
|
550 | 551 | return status; |
|
551 | 552 | } |
|
552 | 553 | |
|
553 | 554 | rtems_status_code create_message_queues( void ) // create the two message queues used in the software |
|
554 | 555 | { |
|
555 | 556 | rtems_status_code status_recv; |
|
556 | 557 | rtems_status_code status_send; |
|
557 | 558 | rtems_status_code ret; |
|
558 | 559 | rtems_id queue_id; |
|
559 | 560 | |
|
560 | 561 | // create the queue for handling valid TCs |
|
561 | 562 | status_recv = rtems_message_queue_create( misc_name[QUEUE_RECV], |
|
562 | 563 | ACTION_MSG_QUEUE_COUNT, CCSDS_TC_PKT_MAX_SIZE, |
|
563 | 564 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); |
|
564 | 565 | if ( status_recv != RTEMS_SUCCESSFUL ) { |
|
565 | 566 | PRINTF1("in create_message_queues *** ERR creating QUEU queue, %d\n", status_recv) |
|
566 | 567 | } |
|
567 | 568 | |
|
568 | 569 | // create the queue for handling TM packet sending |
|
569 | 570 | status_send = rtems_message_queue_create( misc_name[QUEUE_SEND], |
|
570 | 571 | ACTION_MSG_PKTS_COUNT, ACTION_MSG_PKTS_MAX_SIZE, |
|
571 | 572 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); |
|
572 | 573 | if ( status_send != RTEMS_SUCCESSFUL ) { |
|
573 | 574 | PRINTF1("in create_message_queues *** ERR creating PKTS queue, %d\n", status_send) |
|
574 | 575 | } |
|
575 | 576 | |
|
576 | 577 | if ( status_recv != RTEMS_SUCCESSFUL ) |
|
577 | 578 | { |
|
578 | 579 | ret = status_recv; |
|
579 | 580 | } |
|
580 | 581 | else |
|
581 | 582 | { |
|
582 | 583 | ret = status_send; |
|
583 | 584 | } |
|
584 | 585 | |
|
585 | 586 | return ret; |
|
586 | 587 | } |
|
587 | 588 | |
|
588 | 589 | rtems_status_code get_message_queue_id_send( rtems_id *queue_id ) |
|
589 | 590 | { |
|
590 | 591 | rtems_status_code status; |
|
591 | 592 | rtems_name queue_name; |
|
592 | 593 | |
|
593 | 594 | queue_name = rtems_build_name( 'Q', '_', 'S', 'D' ); |
|
594 | 595 | |
|
595 | 596 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); |
|
596 | 597 | |
|
597 | 598 | return status; |
|
598 | 599 | } |
|
599 | 600 | |
|
600 | 601 | rtems_status_code get_message_queue_id_recv( rtems_id *queue_id ) |
|
601 | 602 | { |
|
602 | 603 | rtems_status_code status; |
|
603 | 604 | rtems_name queue_name; |
|
604 | 605 | |
|
605 | 606 | queue_name = rtems_build_name( 'Q', '_', 'R', 'V' ); |
|
606 | 607 | |
|
607 | 608 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); |
|
608 | 609 | |
|
609 | 610 | return status; |
|
610 | 611 | } |
@@ -1,862 +1,868 | |||
|
1 | 1 | /** Functions and tasks related to TeleCommand handling. |
|
2 | 2 | * |
|
3 | 3 | * @file |
|
4 | 4 | * @author P. LEROY |
|
5 | 5 | * |
|
6 | 6 | * A group of functions to handle TeleCommands:\n |
|
7 | 7 | * action launching\n |
|
8 | 8 | * TC parsing\n |
|
9 | 9 | * ... |
|
10 | 10 | * |
|
11 | 11 | */ |
|
12 | 12 | |
|
13 | 13 | #include "tc_handler.h" |
|
14 | 14 | |
|
15 | 15 | //*********** |
|
16 | 16 | // RTEMS TASK |
|
17 | 17 | |
|
18 | 18 | rtems_task actn_task( rtems_task_argument unused ) |
|
19 | 19 | { |
|
20 | 20 | /** This RTEMS task is responsible for launching actions upton the reception of valid TeleCommands. |
|
21 | 21 | * |
|
22 | 22 | * @param unused is the starting argument of the RTEMS task |
|
23 | 23 | * |
|
24 | 24 | * The ACTN task waits for data coming from an RTEMS msesage queue. When data arrives, it launches specific actions depending |
|
25 | 25 | * on the incoming TeleCommand. |
|
26 | 26 | * |
|
27 | 27 | */ |
|
28 | 28 | |
|
29 | 29 | int result; |
|
30 | 30 | rtems_status_code status; // RTEMS status code |
|
31 | 31 | ccsdsTelecommandPacket_t TC; // TC sent to the ACTN task |
|
32 | 32 | size_t size; // size of the incoming TC packet |
|
33 | 33 | unsigned char subtype; // subtype of the current TC packet |
|
34 | 34 | unsigned char time[6]; |
|
35 | 35 | rtems_id queue_rcv_id; |
|
36 | 36 | rtems_id queue_snd_id; |
|
37 | 37 | |
|
38 | 38 | status = get_message_queue_id_recv( &queue_rcv_id ); |
|
39 | 39 | if (status != RTEMS_SUCCESSFUL) |
|
40 | 40 | { |
|
41 | 41 | PRINTF1("in ACTN *** ERR get_message_queue_id_recv %d\n", status) |
|
42 | 42 | } |
|
43 | 43 | |
|
44 | 44 | status = get_message_queue_id_send( &queue_snd_id ); |
|
45 | 45 | if (status != RTEMS_SUCCESSFUL) |
|
46 | 46 | { |
|
47 | 47 | PRINTF1("in ACTN *** ERR get_message_queue_id_send %d\n", status) |
|
48 | 48 | } |
|
49 | 49 | |
|
50 | 50 | result = LFR_SUCCESSFUL; |
|
51 | 51 | subtype = 0; // subtype of the current TC packet |
|
52 | 52 | |
|
53 | 53 | BOOT_PRINTF("in ACTN *** \n") |
|
54 | 54 | |
|
55 | 55 | while(1) |
|
56 | 56 | { |
|
57 | 57 | status = rtems_message_queue_receive( queue_rcv_id, (char*) &TC, &size, |
|
58 | 58 | RTEMS_WAIT, RTEMS_NO_TIMEOUT); |
|
59 | 59 | getTime( time ); // set time to the current time |
|
60 | 60 | if (status!=RTEMS_SUCCESSFUL) |
|
61 | 61 | { |
|
62 | 62 | PRINTF1("ERR *** in task ACTN *** error receiving a message, code %d \n", status) |
|
63 | 63 | } |
|
64 | 64 | else |
|
65 | 65 | { |
|
66 | 66 | subtype = TC.serviceSubType; |
|
67 | 67 | switch(subtype) |
|
68 | 68 | { |
|
69 | 69 | case TC_SUBTYPE_RESET: |
|
70 | 70 | result = action_reset( &TC, queue_snd_id, time ); |
|
71 | 71 | close_action( &TC, result, queue_snd_id, time ); |
|
72 | 72 | break; |
|
73 | 73 | // |
|
74 | 74 | case TC_SUBTYPE_LOAD_COMM: |
|
75 | 75 | result = action_load_common_par( &TC ); |
|
76 | 76 | close_action( &TC, result, queue_snd_id, time ); |
|
77 | 77 | break; |
|
78 | 78 | // |
|
79 | 79 | case TC_SUBTYPE_LOAD_NORM: |
|
80 | 80 | result = action_load_normal_par( &TC, queue_snd_id, time ); |
|
81 | 81 | close_action( &TC, result, queue_snd_id, time ); |
|
82 | 82 | break; |
|
83 | 83 | // |
|
84 | 84 | case TC_SUBTYPE_LOAD_BURST: |
|
85 | 85 | result = action_load_burst_par( &TC, queue_snd_id, time ); |
|
86 | 86 | close_action( &TC, result, queue_snd_id, time ); |
|
87 | 87 | break; |
|
88 | 88 | // |
|
89 | 89 | case TC_SUBTYPE_LOAD_SBM1: |
|
90 | 90 | result = action_load_sbm1_par( &TC, queue_snd_id, time ); |
|
91 | 91 | close_action( &TC, result, queue_snd_id, time ); |
|
92 | 92 | break; |
|
93 | 93 | // |
|
94 | 94 | case TC_SUBTYPE_LOAD_SBM2: |
|
95 | 95 | result = action_load_sbm2_par( &TC, queue_snd_id, time ); |
|
96 | 96 | close_action( &TC, result, queue_snd_id, time ); |
|
97 | 97 | break; |
|
98 | 98 | // |
|
99 | 99 | case TC_SUBTYPE_DUMP: |
|
100 | 100 | result = action_dump_par( queue_snd_id ); |
|
101 | 101 | close_action( &TC, result, queue_snd_id, time ); |
|
102 | 102 | break; |
|
103 | 103 | // |
|
104 | 104 | case TC_SUBTYPE_ENTER: |
|
105 | 105 | result = action_enter_mode( &TC, queue_snd_id, time ); |
|
106 | 106 | close_action( &TC, result, queue_snd_id, time ); |
|
107 | 107 | break; |
|
108 | 108 | // |
|
109 | 109 | case TC_SUBTYPE_UPDT_INFO: |
|
110 | 110 | result = action_update_info( &TC, queue_snd_id ); |
|
111 | 111 | close_action( &TC, result, queue_snd_id, time ); |
|
112 | 112 | break; |
|
113 | 113 | // |
|
114 | 114 | case TC_SUBTYPE_EN_CAL: |
|
115 | 115 | result = action_enable_calibration( &TC, queue_snd_id, time ); |
|
116 | 116 | close_action( &TC, result, queue_snd_id, time ); |
|
117 | 117 | break; |
|
118 | 118 | // |
|
119 | 119 | case TC_SUBTYPE_DIS_CAL: |
|
120 | 120 | result = action_disable_calibration( &TC, queue_snd_id, time ); |
|
121 | 121 | close_action( &TC, result, queue_snd_id, time ); |
|
122 | 122 | break; |
|
123 | 123 | // |
|
124 | 124 | case TC_SUBTYPE_UPDT_TIME: |
|
125 | 125 | result = action_update_time( &TC ); |
|
126 | 126 | close_action( &TC, result, queue_snd_id, time ); |
|
127 | 127 | break; |
|
128 | 128 | // |
|
129 | 129 | default: |
|
130 | 130 | break; |
|
131 | 131 | } |
|
132 | 132 | } |
|
133 | 133 | } |
|
134 | 134 | } |
|
135 | 135 | |
|
136 | 136 | //*********** |
|
137 | 137 | // TC ACTIONS |
|
138 | 138 | |
|
139 | 139 | int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
140 | 140 | { |
|
141 | 141 | /** This function executes specific actions when a TC_LFR_RESET TeleCommand has been received. |
|
142 | 142 | * |
|
143 | 143 | * @param TC points to the TeleCommand packet that is being processed |
|
144 | 144 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
145 | 145 | * |
|
146 | 146 | */ |
|
147 | 147 | |
|
148 | 148 | send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); |
|
149 | 149 | return LFR_DEFAULT; |
|
150 | 150 | } |
|
151 | 151 | |
|
152 | 152 | int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
153 | 153 | { |
|
154 | 154 | /** This function executes specific actions when a TC_LFR_ENTER_MODE TeleCommand has been received. |
|
155 | 155 | * |
|
156 | 156 | * @param TC points to the TeleCommand packet that is being processed |
|
157 | 157 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
158 | 158 | * |
|
159 | 159 | */ |
|
160 | 160 | |
|
161 | 161 | rtems_status_code status; |
|
162 | 162 | unsigned char requestedMode; |
|
163 | 163 | |
|
164 | 164 | requestedMode = TC->dataAndCRC[1]; |
|
165 | 165 | |
|
166 | 166 | if ( (requestedMode != LFR_MODE_STANDBY) |
|
167 | 167 | && (requestedMode != LFR_MODE_NORMAL) && (requestedMode != LFR_MODE_BURST) |
|
168 | 168 | && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) ) |
|
169 | 169 | { |
|
170 | 170 | status = RTEMS_UNSATISFIED; |
|
171 | 171 | send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_CP_LFR_MODE, requestedMode, time ); |
|
172 | 172 | } |
|
173 | 173 | else |
|
174 | 174 | { |
|
175 | 175 | printf("try to enter mode %d\n", requestedMode); |
|
176 | 176 | |
|
177 | 177 | #ifdef PRINT_TASK_STATISTICS |
|
178 | 178 | if (requestedMode != LFR_MODE_STANDBY) |
|
179 | 179 | { |
|
180 | 180 | rtems_cpu_usage_reset(); |
|
181 | 181 | maxCount = 0; |
|
182 | 182 | } |
|
183 | 183 | #endif |
|
184 | 184 | |
|
185 | 185 | status = transition_validation(requestedMode); |
|
186 | 186 | |
|
187 | 187 | if ( status == LFR_SUCCESSFUL ) { |
|
188 | 188 | if ( lfrCurrentMode != LFR_MODE_STANDBY) |
|
189 | 189 | { |
|
190 | 190 | status = stop_current_mode(); |
|
191 | 191 | } |
|
192 | 192 | if (status != RTEMS_SUCCESSFUL) |
|
193 | 193 | { |
|
194 | 194 | PRINTF("ERR *** in action_enter *** stop_current_mode\n") |
|
195 | 195 | } |
|
196 | 196 | status = enter_mode( requestedMode ); |
|
197 | 197 | } |
|
198 | 198 | else |
|
199 | 199 | { |
|
200 | 200 | PRINTF("ERR *** in action_enter *** transition rejected\n") |
|
201 | 201 | send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); |
|
202 | 202 | } |
|
203 | 203 | } |
|
204 | 204 | |
|
205 | 205 | return status; |
|
206 | 206 | } |
|
207 | 207 | |
|
208 | 208 | int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id) |
|
209 | 209 | { |
|
210 | 210 | /** This function executes specific actions when a TC_LFR_UPDATE_INFO TeleCommand has been received. |
|
211 | 211 | * |
|
212 | 212 | * @param TC points to the TeleCommand packet that is being processed |
|
213 | 213 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
214 | 214 | * |
|
215 | 215 | * @return LFR directive status code: |
|
216 | 216 | * - LFR_DEFAULT |
|
217 | 217 | * - LFR_SUCCESSFUL |
|
218 | 218 | * |
|
219 | 219 | */ |
|
220 | 220 | |
|
221 | 221 | unsigned int val; |
|
222 | 222 | int result; |
|
223 | 223 | |
|
224 | 224 | result = LFR_SUCCESSFUL; |
|
225 | 225 | |
|
226 | 226 | val = housekeeping_packet.hk_lfr_update_info_tc_cnt[0] * 256 |
|
227 | 227 | + housekeeping_packet.hk_lfr_update_info_tc_cnt[1]; |
|
228 | 228 | val++; |
|
229 | 229 | housekeeping_packet.hk_lfr_update_info_tc_cnt[0] = (unsigned char) (val >> 8); |
|
230 | 230 | housekeeping_packet.hk_lfr_update_info_tc_cnt[1] = (unsigned char) (val); |
|
231 | 231 | |
|
232 | 232 | return result; |
|
233 | 233 | } |
|
234 | 234 | |
|
235 | 235 | int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
236 | 236 | { |
|
237 | 237 | /** This function executes specific actions when a TC_LFR_ENABLE_CALIBRATION TeleCommand has been received. |
|
238 | 238 | * |
|
239 | 239 | * @param TC points to the TeleCommand packet that is being processed |
|
240 | 240 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
241 | 241 | * |
|
242 | 242 | */ |
|
243 | 243 | |
|
244 | 244 | int result; |
|
245 | 245 | unsigned char lfrMode; |
|
246 | 246 | |
|
247 | 247 | result = LFR_DEFAULT; |
|
248 | 248 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
249 | 249 | |
|
250 | 250 | if ( (lfrMode == LFR_MODE_STANDBY) || (lfrMode == LFR_MODE_BURST) || (lfrMode == LFR_MODE_SBM2) ) { |
|
251 | 251 | send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); |
|
252 | 252 | result = LFR_DEFAULT; |
|
253 | 253 | } |
|
254 | 254 | else { |
|
255 | 255 | send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); |
|
256 | 256 | result = LFR_DEFAULT; |
|
257 | 257 | } |
|
258 | 258 | return result; |
|
259 | 259 | } |
|
260 | 260 | |
|
261 | 261 | int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
262 | 262 | { |
|
263 | 263 | /** This function executes specific actions when a TC_LFR_DISABLE_CALIBRATION TeleCommand has been received. |
|
264 | 264 | * |
|
265 | 265 | * @param TC points to the TeleCommand packet that is being processed |
|
266 | 266 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
267 | 267 | * |
|
268 | 268 | */ |
|
269 | 269 | |
|
270 | 270 | int result; |
|
271 | 271 | unsigned char lfrMode; |
|
272 | 272 | |
|
273 | 273 | result = LFR_DEFAULT; |
|
274 | 274 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
275 | 275 | |
|
276 | 276 | if ( (lfrMode == LFR_MODE_STANDBY) || (lfrMode == LFR_MODE_BURST) || (lfrMode == LFR_MODE_SBM2) ) { |
|
277 | 277 | send_tm_lfr_tc_exe_not_executable( TC, queue_id, time ); |
|
278 | 278 | result = LFR_DEFAULT; |
|
279 | 279 | } |
|
280 | 280 | else { |
|
281 | 281 | send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); |
|
282 | 282 | result = LFR_DEFAULT; |
|
283 | 283 | } |
|
284 | 284 | return result; |
|
285 | 285 | } |
|
286 | 286 | |
|
287 | 287 | int action_update_time(ccsdsTelecommandPacket_t *TC) |
|
288 | 288 | { |
|
289 | 289 | /** This function executes specific actions when a TC_LFR_UPDATE_TIME TeleCommand has been received. |
|
290 | 290 | * |
|
291 | 291 | * @param TC points to the TeleCommand packet that is being processed |
|
292 | 292 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
293 | 293 | * |
|
294 | 294 | * @return LFR_SUCCESSFUL |
|
295 | 295 | * |
|
296 | 296 | */ |
|
297 | 297 | |
|
298 | 298 | unsigned int val; |
|
299 | 299 | |
|
300 | 300 | time_management_regs->coarse_time_load = (TC->dataAndCRC[0] << 24) |
|
301 | 301 | + (TC->dataAndCRC[1] << 16) |
|
302 | 302 | + (TC->dataAndCRC[2] << 8) |
|
303 | 303 | + TC->dataAndCRC[3]; |
|
304 | 304 | val = housekeeping_packet.hk_lfr_update_time_tc_cnt[0] * 256 |
|
305 | 305 | + housekeeping_packet.hk_lfr_update_time_tc_cnt[1]; |
|
306 | 306 | val++; |
|
307 | 307 | housekeeping_packet.hk_lfr_update_time_tc_cnt[0] = (unsigned char) (val >> 8); |
|
308 | 308 | housekeeping_packet.hk_lfr_update_time_tc_cnt[1] = (unsigned char) (val); |
|
309 | 309 | time_management_regs->ctrl = time_management_regs->ctrl | 1; |
|
310 | 310 | |
|
311 | 311 | return LFR_SUCCESSFUL; |
|
312 | 312 | } |
|
313 | 313 | |
|
314 | 314 | //******************* |
|
315 | 315 | // ENTERING THE MODES |
|
316 | 316 | |
|
317 | 317 | int transition_validation(unsigned char requestedMode) |
|
318 | 318 | { |
|
319 | 319 | /** This function checks the validity of the transition requested by the TC_LFR_ENTER_MODE. |
|
320 | 320 | * |
|
321 | 321 | * @param requestedMode is the mode requested by the TC_LFR_ENTER_MODE |
|
322 | 322 | * |
|
323 | 323 | * @return LFR directive status codes: |
|
324 | 324 | * - LFR_SUCCESSFUL - the transition is authorized |
|
325 | 325 | * - LFR_DEFAULT - the transition is not authorized |
|
326 | 326 | * |
|
327 | 327 | */ |
|
328 | 328 | |
|
329 | 329 | int status; |
|
330 | 330 | |
|
331 | 331 | switch (requestedMode) |
|
332 | 332 | { |
|
333 | 333 | case LFR_MODE_STANDBY: |
|
334 | 334 | if ( lfrCurrentMode == LFR_MODE_STANDBY ) { |
|
335 | 335 | status = LFR_DEFAULT; |
|
336 | 336 | } |
|
337 | 337 | else |
|
338 | 338 | { |
|
339 | 339 | status = LFR_SUCCESSFUL; |
|
340 | 340 | } |
|
341 | 341 | break; |
|
342 | 342 | case LFR_MODE_NORMAL: |
|
343 | 343 | if ( lfrCurrentMode == LFR_MODE_NORMAL ) { |
|
344 | 344 | status = LFR_DEFAULT; |
|
345 | 345 | } |
|
346 | 346 | else { |
|
347 | 347 | status = LFR_SUCCESSFUL; |
|
348 | 348 | } |
|
349 | 349 | break; |
|
350 | 350 | case LFR_MODE_BURST: |
|
351 | 351 | if ( lfrCurrentMode == LFR_MODE_BURST ) { |
|
352 | 352 | status = LFR_DEFAULT; |
|
353 | 353 | } |
|
354 | 354 | else { |
|
355 | 355 | status = LFR_SUCCESSFUL; |
|
356 | 356 | } |
|
357 | 357 | break; |
|
358 | 358 | case LFR_MODE_SBM1: |
|
359 | 359 | if ( lfrCurrentMode == LFR_MODE_SBM1 ) { |
|
360 | 360 | status = LFR_DEFAULT; |
|
361 | 361 | } |
|
362 | 362 | else { |
|
363 | 363 | status = LFR_SUCCESSFUL; |
|
364 | 364 | } |
|
365 | 365 | break; |
|
366 | 366 | case LFR_MODE_SBM2: |
|
367 | 367 | if ( lfrCurrentMode == LFR_MODE_SBM2 ) { |
|
368 | 368 | status = LFR_DEFAULT; |
|
369 | 369 | } |
|
370 | 370 | else { |
|
371 | 371 | status = LFR_SUCCESSFUL; |
|
372 | 372 | } |
|
373 | 373 | break; |
|
374 | 374 | default: |
|
375 | 375 | status = LFR_DEFAULT; |
|
376 | 376 | break; |
|
377 | 377 | } |
|
378 | 378 | |
|
379 | 379 | return status; |
|
380 | 380 | } |
|
381 | 381 | |
|
382 | 382 | int stop_current_mode() |
|
383 | 383 | { |
|
384 | 384 | /** This function stops the current mode by masking interrupt lines and suspending science tasks. |
|
385 | 385 | * |
|
386 | 386 | * @return RTEMS directive status codes: |
|
387 | 387 | * - RTEMS_SUCCESSFUL - task restarted successfully |
|
388 | 388 | * - RTEMS_INVALID_ID - task id invalid |
|
389 | 389 | * - RTEMS_ALREADY_SUSPENDED - task already suspended |
|
390 | 390 | * |
|
391 | 391 | */ |
|
392 | 392 | |
|
393 | 393 | rtems_status_code status; |
|
394 | 394 | |
|
395 | 395 | status = RTEMS_SUCCESSFUL; |
|
396 | 396 | |
|
397 | 397 | #ifdef GSA |
|
398 | 398 | LEON_Mask_interrupt( IRQ_WF ); // mask waveform interrupt (coming from the timer VHDL IP) |
|
399 | 399 | LEON_Clear_interrupt( IRQ_WF ); // clear waveform interrupt (coming from the timer VHDL IP) |
|
400 | 400 | timer_stop( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR ); |
|
401 | 401 | #else |
|
402 | 402 | // mask interruptions |
|
403 | 403 | LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); // mask waveform picker interrupt |
|
404 | 404 | LEON_Mask_interrupt( IRQ_SPECTRAL_MATRIX ); // mask spectral matrix interrupt |
|
405 | 405 | // reset registers |
|
406 | 406 | reset_wfp_burst_enable(); // reset burst and enable bits |
|
407 | 407 | reset_wfp_status(); // reset all the status bits |
|
408 | 408 | // creal interruptions |
|
409 | 409 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); // clear waveform picker interrupt |
|
410 | 410 | LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectarl matrix interrupt |
|
411 | 411 | #endif |
|
412 | 412 | //********************** |
|
413 | 413 | // suspend several tasks |
|
414 | 414 | if (lfrCurrentMode != LFR_MODE_STANDBY) { |
|
415 | 415 | status = suspend_science_tasks(); |
|
416 | 416 | } |
|
417 | 417 | |
|
418 | 418 | if (status != RTEMS_SUCCESSFUL) |
|
419 | 419 | { |
|
420 | 420 | PRINTF1("in stop_current_mode *** in suspend_science_tasks *** ERR code: %d\n", status) |
|
421 | 421 | } |
|
422 | 422 | |
|
423 | 423 | return status; |
|
424 | 424 | } |
|
425 | 425 | |
|
426 | 426 | int enter_mode(unsigned char mode ) |
|
427 | 427 | { |
|
428 | 428 | /** This function is launched after a mode transition validation. |
|
429 | 429 | * |
|
430 | 430 | * @param mode is the mode in which LFR will be put. |
|
431 | 431 | * |
|
432 | 432 | * @return RTEMS directive status codes: |
|
433 | 433 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully |
|
434 | 434 | * - RTEMS_NOT_SATISFIED - the mode has not been entered successfully |
|
435 | 435 | * |
|
436 | 436 | */ |
|
437 | 437 | |
|
438 | 438 | rtems_status_code status; |
|
439 | 439 | |
|
440 | 440 | status = RTEMS_UNSATISFIED; |
|
441 | 441 | |
|
442 | 442 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((mode << 4) + 0x0d); |
|
443 | 443 | updateLFRCurrentMode(); |
|
444 | 444 | |
|
445 | 445 | switch(mode){ |
|
446 | 446 | case LFR_MODE_STANDBY: |
|
447 | 447 | status = enter_standby_mode( ); |
|
448 | 448 | break; |
|
449 | 449 | case LFR_MODE_NORMAL: |
|
450 | 450 | status = enter_normal_mode( ); |
|
451 | 451 | break; |
|
452 | 452 | case LFR_MODE_BURST: |
|
453 | 453 | status = enter_burst_mode( ); |
|
454 | 454 | break; |
|
455 | 455 | case LFR_MODE_SBM1: |
|
456 | 456 | status = enter_sbm1_mode( ); |
|
457 | 457 | break; |
|
458 | 458 | case LFR_MODE_SBM2: |
|
459 | 459 | status = enter_sbm2_mode( ); |
|
460 | 460 | break; |
|
461 | 461 | default: |
|
462 | 462 | status = RTEMS_UNSATISFIED; |
|
463 | 463 | } |
|
464 | 464 | |
|
465 | 465 | if (status != RTEMS_SUCCESSFUL) |
|
466 | 466 | { |
|
467 | 467 | PRINTF("in enter_mode *** ERR\n") |
|
468 | 468 | status = RTEMS_UNSATISFIED; |
|
469 | 469 | } |
|
470 | 470 | |
|
471 | 471 | return status; |
|
472 | 472 | } |
|
473 | 473 | |
|
474 | 474 | int enter_standby_mode() |
|
475 | 475 | { |
|
476 | 476 | /** This function is used to enter the STANDBY mode. |
|
477 | 477 | * |
|
478 | 478 | * @return RTEMS directive status codes: |
|
479 | 479 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully |
|
480 | 480 | * |
|
481 | 481 | */ |
|
482 | 482 | |
|
483 | 483 | PRINTF1("maxCount = %d\n", maxCount) |
|
484 | 484 | |
|
485 | 485 | #ifdef PRINT_TASK_STATISTICS |
|
486 | 486 | rtems_cpu_usage_report(); |
|
487 | 487 | #endif |
|
488 | 488 | |
|
489 | 489 | #ifdef PRINT_STACK_REPORT |
|
490 | 490 | rtems_stack_checker_report_usage(); |
|
491 | 491 | #endif |
|
492 | 492 | |
|
493 | 493 | return LFR_SUCCESSFUL; |
|
494 | 494 | } |
|
495 | 495 | |
|
496 | 496 | int enter_normal_mode() |
|
497 | 497 | { |
|
498 | 498 | rtems_status_code status; |
|
499 | 499 | |
|
500 | 500 | status = restart_science_tasks(); |
|
501 | 501 | |
|
502 | 502 | #ifdef GSA |
|
503 | 503 | timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR ); |
|
504 | 504 | timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR ); |
|
505 | 505 | LEON_Clear_interrupt( IRQ_WF ); |
|
506 | 506 | LEON_Unmask_interrupt( IRQ_WF ); |
|
507 | 507 | // |
|
508 | 508 | set_local_nb_interrupt_f0_MAX(); |
|
509 | 509 | LEON_Clear_interrupt( IRQ_SM ); // the IRQ_SM seems to be incompatible with the IRQ_WF on the xilinx board |
|
510 | 510 | LEON_Unmask_interrupt( IRQ_SM ); |
|
511 | 511 | #else |
|
512 | 512 | //**************** |
|
513 | 513 | // waveform picker |
|
514 | 514 | reset_waveform_picker_regs(); |
|
515 | 515 | set_wfp_burst_enable_register(LFR_MODE_NORMAL); |
|
516 | 516 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
517 | 517 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
518 | 518 | //**************** |
|
519 | 519 | // spectral matrix |
|
520 | 520 | #endif |
|
521 | 521 | |
|
522 | 522 | return status; |
|
523 | 523 | } |
|
524 | 524 | |
|
525 | 525 | int enter_burst_mode() |
|
526 | 526 | { |
|
527 | 527 | /** This function is used to enter the STANDBY mode. |
|
528 | 528 | * |
|
529 | 529 | * @return RTEMS directive status codes: |
|
530 | 530 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully |
|
531 | 531 | * - RTEMS_INVALID_ID - task id invalid |
|
532 | 532 | * - RTEMS_INCORRECT_STATE - task never started |
|
533 | 533 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task |
|
534 | 534 | * |
|
535 | 535 | */ |
|
536 | 536 | |
|
537 | 537 | rtems_status_code status; |
|
538 | 538 | |
|
539 | 539 | status = restart_science_tasks(); |
|
540 | 540 | |
|
541 | 541 | #ifdef GSA |
|
542 | 542 | LEON_Unmask_interrupt( IRQ_SM ); |
|
543 | 543 | #else |
|
544 | 544 | reset_waveform_picker_regs(); |
|
545 | 545 | set_wfp_burst_enable_register(LFR_MODE_BURST); |
|
546 | 546 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
547 | 547 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
548 | 548 | #endif |
|
549 | 549 | |
|
550 | 550 | return status; |
|
551 | 551 | } |
|
552 | 552 | |
|
553 | 553 | int enter_sbm1_mode() |
|
554 | 554 | { |
|
555 | 555 | /** This function is used to enter the SBM1 mode. |
|
556 | 556 | * |
|
557 | 557 | * @return RTEMS directive status codes: |
|
558 | 558 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully |
|
559 | 559 | * - RTEMS_INVALID_ID - task id invalid |
|
560 | 560 | * - RTEMS_INCORRECT_STATE - task never started |
|
561 | 561 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task |
|
562 | 562 | * |
|
563 | 563 | */ |
|
564 | 564 | |
|
565 | 565 | rtems_status_code status; |
|
566 | 566 | |
|
567 | 567 | status = restart_science_tasks(); |
|
568 | 568 | |
|
569 | 569 | set_local_sbm1_nb_cwf_max(); |
|
570 | 570 | |
|
571 | 571 | reset_local_sbm1_nb_cwf_sent(); |
|
572 | 572 | |
|
573 | 573 | #ifdef GSA |
|
574 | 574 | LEON_Unmask_interrupt( IRQ_SM ); |
|
575 | 575 | #else |
|
576 | //**************** | |
|
577 | // waveform picker | |
|
578 | reset_current_ring_nodes(); | |
|
576 | 579 | reset_waveform_picker_regs(); |
|
577 | 580 | set_wfp_burst_enable_register(LFR_MODE_SBM1); |
|
578 | 581 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
579 | 582 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
580 | 583 | #endif |
|
581 | 584 | |
|
582 | 585 | return status; |
|
583 | 586 | } |
|
584 | 587 | |
|
585 | 588 | int enter_sbm2_mode() |
|
586 | 589 | { |
|
587 | 590 | /** This function is used to enter the SBM2 mode. |
|
588 | 591 | * |
|
589 | 592 | * @return RTEMS directive status codes: |
|
590 | 593 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully |
|
591 | 594 | * - RTEMS_INVALID_ID - task id invalid |
|
592 | 595 | * - RTEMS_INCORRECT_STATE - task never started |
|
593 | 596 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task |
|
594 | 597 | * |
|
595 | 598 | */ |
|
596 | 599 | |
|
597 | 600 | rtems_status_code status; |
|
598 | 601 | |
|
599 | 602 | status = restart_science_tasks(); |
|
600 | 603 | |
|
601 | 604 | set_local_sbm2_nb_cwf_max(); |
|
602 | 605 | |
|
603 | 606 | reset_local_sbm2_nb_cwf_sent(); |
|
604 | 607 | |
|
605 | 608 | #ifdef GSA |
|
606 | 609 | LEON_Unmask_interrupt( IRQ_SM ); |
|
607 | 610 | #else |
|
611 | //**************** | |
|
612 | // waveform picker | |
|
613 | reset_current_ring_nodes(); | |
|
608 | 614 | reset_waveform_picker_regs(); |
|
609 | 615 | set_wfp_burst_enable_register(LFR_MODE_SBM2); |
|
610 | 616 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
611 | 617 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
612 | 618 | #endif |
|
613 | 619 | |
|
614 | 620 | return status; |
|
615 | 621 | } |
|
616 | 622 | |
|
617 | 623 | int restart_science_tasks() |
|
618 | 624 | { |
|
619 | 625 | /** This function is used to restart all science tasks. |
|
620 | 626 | * |
|
621 | 627 | * @return RTEMS directive status codes: |
|
622 | 628 | * - RTEMS_SUCCESSFUL - task restarted successfully |
|
623 | 629 | * - RTEMS_INVALID_ID - task id invalid |
|
624 | 630 | * - RTEMS_INCORRECT_STATE - task never started |
|
625 | 631 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task |
|
626 | 632 | * |
|
627 | 633 | * Science tasks are AVF0, BPF0, WFRM, CWF3, CW2, CWF1 |
|
628 | 634 | * |
|
629 | 635 | */ |
|
630 | 636 | |
|
631 | 637 | rtems_status_code status[6]; |
|
632 | 638 | rtems_status_code ret; |
|
633 | 639 | |
|
634 | 640 | ret = RTEMS_SUCCESSFUL; |
|
635 | 641 | |
|
636 | 642 | status[0] = rtems_task_restart( Task_id[TASKID_AVF0], 1 ); |
|
637 | 643 | if (status[0] != RTEMS_SUCCESSFUL) |
|
638 | 644 | { |
|
639 | 645 | PRINTF1("in restart_science_task *** 0 ERR %d\n", status[0]) |
|
640 | 646 | } |
|
641 | 647 | |
|
642 | 648 | status[1] = rtems_task_restart( Task_id[TASKID_BPF0],1 ); |
|
643 | 649 | if (status[1] != RTEMS_SUCCESSFUL) |
|
644 | 650 | { |
|
645 | 651 | PRINTF1("in restart_science_task *** 1 ERR %d\n", status[1]) |
|
646 | 652 | } |
|
647 | 653 | |
|
648 | 654 | status[2] = rtems_task_restart( Task_id[TASKID_WFRM],1 ); |
|
649 | 655 | if (status[2] != RTEMS_SUCCESSFUL) |
|
650 | 656 | { |
|
651 | 657 | PRINTF1("in restart_science_task *** 2 ERR %d\n", status[2]) |
|
652 | 658 | } |
|
653 | 659 | |
|
654 | 660 | status[3] = rtems_task_restart( Task_id[TASKID_CWF3],1 ); |
|
655 | 661 | if (status[3] != RTEMS_SUCCESSFUL) |
|
656 | 662 | { |
|
657 | 663 | PRINTF1("in restart_science_task *** 3 ERR %d\n", status[3]) |
|
658 | 664 | } |
|
659 | 665 | |
|
660 | 666 | status[4] = rtems_task_restart( Task_id[TASKID_CWF2],1 ); |
|
661 | 667 | if (status[4] != RTEMS_SUCCESSFUL) |
|
662 | 668 | { |
|
663 | 669 | PRINTF1("in restart_science_task *** 4 ERR %d\n", status[4]) |
|
664 | 670 | } |
|
665 | 671 | |
|
666 | 672 | status[5] = rtems_task_restart( Task_id[TASKID_CWF1],1 ); |
|
667 | 673 | if (status[5] != RTEMS_SUCCESSFUL) |
|
668 | 674 | { |
|
669 | 675 | PRINTF1("in restart_science_task *** 5 ERR %d\n", status[5]) |
|
670 | 676 | } |
|
671 | 677 | |
|
672 | 678 | if ( (status[0] != RTEMS_SUCCESSFUL) || (status[1] != RTEMS_SUCCESSFUL) || (status[2] != RTEMS_SUCCESSFUL) || |
|
673 | 679 | (status[3] != RTEMS_SUCCESSFUL) || (status[4] != RTEMS_SUCCESSFUL) || (status[5] != RTEMS_SUCCESSFUL) ) |
|
674 | 680 | { |
|
675 | 681 | ret = RTEMS_UNSATISFIED; |
|
676 | 682 | } |
|
677 | 683 | |
|
678 | 684 | return ret; |
|
679 | 685 | } |
|
680 | 686 | |
|
681 | 687 | int suspend_science_tasks() |
|
682 | 688 | { |
|
683 | 689 | /** This function suspends the science tasks. |
|
684 | 690 | * |
|
685 | 691 | * @return RTEMS directive status codes: |
|
686 | 692 | * - RTEMS_SUCCESSFUL - task restarted successfully |
|
687 | 693 | * - RTEMS_INVALID_ID - task id invalid |
|
688 | 694 | * - RTEMS_ALREADY_SUSPENDED - task already suspended |
|
689 | 695 | * |
|
690 | 696 | */ |
|
691 | 697 | |
|
692 | 698 | rtems_status_code status; |
|
693 | 699 | |
|
694 | 700 | status = rtems_task_suspend( Task_id[TASKID_AVF0] ); |
|
695 | 701 | if (status != RTEMS_SUCCESSFUL) |
|
696 | 702 | { |
|
697 | 703 | PRINTF1("in suspend_science_task *** AVF0 ERR %d\n", status) |
|
698 | 704 | } |
|
699 | 705 | |
|
700 | 706 | if (status == RTEMS_SUCCESSFUL) // suspend BPF0 |
|
701 | 707 | { |
|
702 | 708 | status = rtems_task_suspend( Task_id[TASKID_BPF0] ); |
|
703 | 709 | if (status != RTEMS_SUCCESSFUL) |
|
704 | 710 | { |
|
705 | 711 | PRINTF1("in suspend_science_task *** BPF0 ERR %d\n", status) |
|
706 | 712 | } |
|
707 | 713 | } |
|
708 | 714 | |
|
709 | 715 | if (status == RTEMS_SUCCESSFUL) // suspend WFRM |
|
710 | 716 | { |
|
711 | 717 | status = rtems_task_suspend( Task_id[TASKID_WFRM] ); |
|
712 | 718 | if (status != RTEMS_SUCCESSFUL) |
|
713 | 719 | { |
|
714 | 720 | PRINTF1("in suspend_science_task *** WFRM ERR %d\n", status) |
|
715 | 721 | } |
|
716 | 722 | } |
|
717 | 723 | |
|
718 | 724 | if (status == RTEMS_SUCCESSFUL) // suspend CWF3 |
|
719 | 725 | { |
|
720 | 726 | status = rtems_task_suspend( Task_id[TASKID_CWF3] ); |
|
721 | 727 | if (status != RTEMS_SUCCESSFUL) |
|
722 | 728 | { |
|
723 | 729 | PRINTF1("in suspend_science_task *** CWF3 ERR %d\n", status) |
|
724 | 730 | } |
|
725 | 731 | } |
|
726 | 732 | |
|
727 | 733 | if (status == RTEMS_SUCCESSFUL) // suspend CWF2 |
|
728 | 734 | { |
|
729 | 735 | status = rtems_task_suspend( Task_id[TASKID_CWF2] ); |
|
730 | 736 | if (status != RTEMS_SUCCESSFUL) |
|
731 | 737 | { |
|
732 | 738 | PRINTF1("in suspend_science_task *** CWF2 ERR %d\n", status) |
|
733 | 739 | } |
|
734 | 740 | } |
|
735 | 741 | |
|
736 | 742 | if (status == RTEMS_SUCCESSFUL) // suspend CWF1 |
|
737 | 743 | { |
|
738 | 744 | status = rtems_task_suspend( Task_id[TASKID_CWF1] ); |
|
739 | 745 | if (status != RTEMS_SUCCESSFUL) |
|
740 | 746 | { |
|
741 | 747 | PRINTF1("in suspend_science_task *** CWF1 ERR %d\n", status) |
|
742 | 748 | } |
|
743 | 749 | } |
|
744 | 750 | |
|
745 | 751 | return status; |
|
746 | 752 | } |
|
747 | 753 | |
|
748 | 754 | //**************** |
|
749 | 755 | // CLOSING ACTIONS |
|
750 | 756 | void update_last_TC_exe(ccsdsTelecommandPacket_t *TC, unsigned char *time) |
|
751 | 757 | { |
|
752 | 758 | /** This function is used to update the HK packets statistics after a successful TC execution. |
|
753 | 759 | * |
|
754 | 760 | * @param TC points to the TC being processed |
|
755 | 761 | * @param time is the time used to date the TC execution |
|
756 | 762 | * |
|
757 | 763 | */ |
|
758 | 764 | |
|
759 | 765 | housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0]; |
|
760 | 766 | housekeeping_packet.hk_lfr_last_exe_tc_id[1] = TC->packetID[1]; |
|
761 | 767 | housekeeping_packet.hk_lfr_last_exe_tc_type[0] = 0x00; |
|
762 | 768 | housekeeping_packet.hk_lfr_last_exe_tc_type[1] = TC->serviceType; |
|
763 | 769 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[0] = 0x00; |
|
764 | 770 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[1] = TC->serviceSubType; |
|
765 | 771 | housekeeping_packet.hk_lfr_last_exe_tc_time[0] = time[0]; |
|
766 | 772 | housekeeping_packet.hk_lfr_last_exe_tc_time[1] = time[1]; |
|
767 | 773 | housekeeping_packet.hk_lfr_last_exe_tc_time[2] = time[2]; |
|
768 | 774 | housekeeping_packet.hk_lfr_last_exe_tc_time[3] = time[3]; |
|
769 | 775 | housekeeping_packet.hk_lfr_last_exe_tc_time[4] = time[4]; |
|
770 | 776 | housekeeping_packet.hk_lfr_last_exe_tc_time[5] = time[5]; |
|
771 | 777 | } |
|
772 | 778 | |
|
773 | 779 | void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char *time) |
|
774 | 780 | { |
|
775 | 781 | /** This function is used to update the HK packets statistics after a TC rejection. |
|
776 | 782 | * |
|
777 | 783 | * @param TC points to the TC being processed |
|
778 | 784 | * @param time is the time used to date the TC rejection |
|
779 | 785 | * |
|
780 | 786 | */ |
|
781 | 787 | |
|
782 | 788 | housekeeping_packet.hk_lfr_last_rej_tc_id[0] = TC->packetID[0]; |
|
783 | 789 | housekeeping_packet.hk_lfr_last_rej_tc_id[1] = TC->packetID[1]; |
|
784 | 790 | housekeeping_packet.hk_lfr_last_rej_tc_type[0] = 0x00; |
|
785 | 791 | housekeeping_packet.hk_lfr_last_rej_tc_type[1] = TC->serviceType; |
|
786 | 792 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[0] = 0x00; |
|
787 | 793 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[1] = TC->serviceSubType; |
|
788 | 794 | housekeeping_packet.hk_lfr_last_rej_tc_time[0] = time[0]; |
|
789 | 795 | housekeeping_packet.hk_lfr_last_rej_tc_time[1] = time[1]; |
|
790 | 796 | housekeeping_packet.hk_lfr_last_rej_tc_time[2] = time[2]; |
|
791 | 797 | housekeeping_packet.hk_lfr_last_rej_tc_time[3] = time[3]; |
|
792 | 798 | housekeeping_packet.hk_lfr_last_rej_tc_time[4] = time[4]; |
|
793 | 799 | housekeeping_packet.hk_lfr_last_rej_tc_time[5] = time[5]; |
|
794 | 800 | } |
|
795 | 801 | |
|
796 | 802 | void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id, unsigned char *time) |
|
797 | 803 | { |
|
798 | 804 | /** This function is the last step of the TC execution workflow. |
|
799 | 805 | * |
|
800 | 806 | * @param TC points to the TC being processed |
|
801 | 807 | * @param result is the result of the TC execution (LFR_SUCCESSFUL / LFR_DEFAULT) |
|
802 | 808 | * @param queue_id is the id of the RTEMS message queue used to send TM packets |
|
803 | 809 | * @param time is the time used to date the TC execution |
|
804 | 810 | * |
|
805 | 811 | */ |
|
806 | 812 | |
|
807 | 813 | unsigned int val = 0; |
|
808 | 814 | |
|
809 | 815 | if (result == LFR_SUCCESSFUL) |
|
810 | 816 | { |
|
811 | 817 | if ( !( (TC->serviceType==TC_TYPE_TIME) && (TC->serviceSubType==TC_SUBTYPE_UPDT_TIME) ) |
|
812 | 818 | && |
|
813 | 819 | !( (TC->serviceType==TC_TYPE_GEN) && (TC->serviceSubType==TC_SUBTYPE_UPDT_INFO)) |
|
814 | 820 | ) |
|
815 | 821 | { |
|
816 | 822 | send_tm_lfr_tc_exe_success( TC, queue_id, time ); |
|
817 | 823 | } |
|
818 | 824 | update_last_TC_exe( TC, time ); |
|
819 | 825 | val = housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[0] * 256 + housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[1]; |
|
820 | 826 | val++; |
|
821 | 827 | housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[0] = (unsigned char) (val >> 8); |
|
822 | 828 | housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[1] = (unsigned char) (val); |
|
823 | 829 | } |
|
824 | 830 | else |
|
825 | 831 | { |
|
826 | 832 | update_last_TC_rej( TC, time ); |
|
827 | 833 | val = housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[0] * 256 + housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[1]; |
|
828 | 834 | val++; |
|
829 | 835 | housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[0] = (unsigned char) (val >> 8); |
|
830 | 836 | housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[1] = (unsigned char) (val); |
|
831 | 837 | } |
|
832 | 838 | } |
|
833 | 839 | |
|
834 | 840 | //*************************** |
|
835 | 841 | // Interrupt Service Routines |
|
836 | 842 | rtems_isr commutation_isr1( rtems_vector_number vector ) |
|
837 | 843 | { |
|
838 | 844 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
839 | 845 | printf("In commutation_isr1 *** Error sending event to DUMB\n"); |
|
840 | 846 | } |
|
841 | 847 | } |
|
842 | 848 | |
|
843 | 849 | rtems_isr commutation_isr2( rtems_vector_number vector ) |
|
844 | 850 | { |
|
845 | 851 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
846 | 852 | printf("In commutation_isr2 *** Error sending event to DUMB\n"); |
|
847 | 853 | } |
|
848 | 854 | } |
|
849 | 855 | |
|
850 | 856 | //**************** |
|
851 | 857 | // OTHER FUNCTIONS |
|
852 | 858 | void updateLFRCurrentMode() |
|
853 | 859 | { |
|
854 | 860 | /** This function updates the value of the global variable lfrCurrentMode. |
|
855 | 861 | * |
|
856 | 862 | * lfrCurrentMode is a parameter used by several functions to know in which mode LFR is running. |
|
857 | 863 | * |
|
858 | 864 | */ |
|
859 | 865 | // update the local value of lfrCurrentMode with the value contained in the housekeeping_packet structure |
|
860 | 866 | lfrCurrentMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
861 | 867 | } |
|
862 | 868 |
@@ -1,1225 +1,1131 | |||
|
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 | //***************** | |
|
13 | // waveform headers | |
|
12 | 14 | // SWF |
|
13 | 15 | Header_TM_LFR_SCIENCE_SWF_t headerSWF_F0[7]; |
|
14 | 16 | Header_TM_LFR_SCIENCE_SWF_t headerSWF_F1[7]; |
|
15 | 17 | Header_TM_LFR_SCIENCE_SWF_t headerSWF_F2[7]; |
|
16 | 18 | // CWF |
|
17 | 19 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F1[7]; |
|
18 | 20 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_BURST[7]; |
|
19 | 21 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_SBM2[7]; |
|
20 | 22 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3[7]; |
|
21 | 23 | Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3_light[7]; |
|
22 | 24 | |
|
23 | unsigned char doubleSendCWF1 = 0; | |
|
25 | //************** | |
|
26 | // waveform ring | |
|
27 | ring_node waveform_ring_f1[NB_RING_NODES_F1]; | |
|
28 | ring_node waveform_ring_f2[NB_RING_NODES_F2]; | |
|
29 | ring_node *current_ring_node_f1; | |
|
30 | ring_node *ring_node_to_send_swf_f1; | |
|
31 | ring_node *ring_node_to_send_cwf_f1; | |
|
32 | ring_node *current_ring_node_f2; | |
|
33 | ring_node *ring_node_to_send_swf_f2; | |
|
34 | ring_node *ring_node_to_send_cwf_f2; | |
|
35 | ||
|
24 | 36 | unsigned char doubleSendCWF2 = 0; |
|
25 | 37 | |
|
26 | 38 | rtems_isr waveforms_isr( rtems_vector_number vector ) |
|
27 | 39 | { |
|
28 | 40 | /** This is the interrupt sub routine called by the waveform picker core. |
|
29 | 41 | * |
|
30 | 42 | * This ISR launch different actions depending mainly on two pieces of information: |
|
31 | 43 | * 1. the values read in the registers of the waveform picker. |
|
32 | 44 | * 2. the current LFR mode. |
|
33 | 45 | * |
|
34 | 46 | */ |
|
35 | 47 | |
|
36 | 48 | #ifdef GSA |
|
37 | 49 | #else |
|
38 | 50 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) |
|
39 | 51 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
40 | 52 | { // in modes other than STANDBY and BURST, send the CWF_F3 data |
|
41 | 53 | if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full |
|
42 | 54 | // (1) change the receiving buffer for the waveform picker |
|
43 | 55 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) { |
|
44 | 56 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_bis); |
|
45 | 57 | } |
|
46 | 58 | else { |
|
47 | 59 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); |
|
48 | 60 | } |
|
49 | 61 | // (2) send an event for the waveforms transmission |
|
50 | 62 | if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
51 | 63 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
52 | 64 | } |
|
53 | 65 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111] |
|
54 | 66 | } |
|
55 | 67 | } |
|
56 | 68 | #endif |
|
57 | 69 | |
|
58 | 70 | switch(lfrCurrentMode) |
|
59 | 71 | { |
|
60 | 72 | //******** |
|
61 | 73 | // STANDBY |
|
62 | 74 | case(LFR_MODE_STANDBY): |
|
63 | 75 | break; |
|
64 | 76 | |
|
65 | 77 | //****** |
|
66 | 78 | // NORMAL |
|
67 | 79 | case(LFR_MODE_NORMAL): |
|
68 | 80 | #ifdef GSA |
|
69 | 81 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") |
|
70 | 82 | #else |
|
71 | 83 | if ( (waveform_picker_regs->burst_enable & 0x7) == 0x0 ){ // if no channel is enable |
|
72 | 84 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
73 | 85 | } |
|
74 | 86 | else { |
|
75 | 87 | if ( (waveform_picker_regs->status & 0x7) == 0x7 ){ // f2 f1 and f0 are full |
|
76 | 88 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable & 0x08; |
|
89 | ||
|
90 | ring_node_to_send_swf_f1 = current_ring_node_f1; | |
|
91 | current_ring_node_f1 = current_ring_node_f1->next; | |
|
92 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; | |
|
93 | ||
|
94 | ring_node_to_send_swf_f2 = current_ring_node_f2; | |
|
95 | current_ring_node_f2 = current_ring_node_f2->next; | |
|
96 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; | |
|
97 | ||
|
77 | 98 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { |
|
78 | 99 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
79 | 100 | } |
|
80 | // waveform_picker_regs->status = waveform_picker_regs->status & 0x00; | |
|
81 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff888; | |
|
101 | ||
|
102 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff888; // [1000 1000 1000] | |
|
82 | 103 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x07; // [0111] enable f2 f1 f0 |
|
83 | 104 | } |
|
84 | 105 | } |
|
85 | 106 | #endif |
|
86 | 107 | break; |
|
87 | 108 | |
|
88 | 109 | //****** |
|
89 | 110 | // BURST |
|
90 | 111 | case(LFR_MODE_BURST): |
|
91 | 112 | #ifdef GSA |
|
92 | 113 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") |
|
93 | 114 | #else |
|
94 | if ((waveform_picker_regs->status & 0x04) == 0x04){ // [0100] check the f2 full bit | |
|
115 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit | |
|
95 | 116 | // (1) change the receiving buffer for the waveform picker |
|
96 | if (waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) { | |
|
97 | waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis); | |
|
98 | } | |
|
99 | else { | |
|
100 | waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); | |
|
101 | } | |
|
117 | ring_node_to_send_cwf_f2 = current_ring_node_f2; | |
|
118 | current_ring_node_f2 = current_ring_node_f2->next; | |
|
119 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; | |
|
102 | 120 | // (2) send an event for the waveforms transmission |
|
103 |
if (rtems_event_send( Task_id[TASKID_CWF |
|
|
121 | if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) { | |
|
104 | 122 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
105 | 123 | } |
|
106 |
waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit |
|
|
124 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0 | |
|
107 | 125 | } |
|
108 | 126 | #endif |
|
109 | 127 | break; |
|
110 | 128 | |
|
111 | 129 | //***** |
|
112 | 130 | // SBM1 |
|
113 | 131 | case(LFR_MODE_SBM1): |
|
114 | 132 | #ifdef GSA |
|
115 | 133 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") |
|
116 | 134 | #else |
|
117 | if ((waveform_picker_regs->status & 0x02) == 0x02){ // [0010] check the f1 full bit | |
|
135 | if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit | |
|
118 | 136 | // (1) change the receiving buffer for the waveform picker |
|
119 | if ( param_local.local_sbm1_nb_cwf_sent == (param_local.local_sbm1_nb_cwf_max-1) ) | |
|
120 | { | |
|
121 |
|
|
|
122 | } | |
|
123 | else if ( waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1_norm ) | |
|
124 | { | |
|
125 | doubleSendCWF1 = 1; | |
|
126 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); | |
|
127 | } | |
|
128 | else if ( waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1 ) { | |
|
129 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_bis); | |
|
130 | } | |
|
131 | else { | |
|
132 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); | |
|
133 | } | |
|
137 | ring_node_to_send_cwf_f1 = current_ring_node_f1; | |
|
138 | current_ring_node_f1 = current_ring_node_f1->next; | |
|
139 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; | |
|
134 | 140 | // (2) send an event for the waveforms transmission |
|
135 | 141 | if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) { |
|
136 | 142 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
137 | 143 | } |
|
138 | 144 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0 |
|
139 | 145 | } |
|
140 |
if |
|
|
146 | if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit | |
|
147 | ring_node_to_send_swf_f1 = current_ring_node_f1->previous; | |
|
148 | } | |
|
149 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ) { // [0100] check the f2 full bit | |
|
141 | 150 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { |
|
142 | 151 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
143 | 152 | } |
|
144 | 153 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0 |
|
145 | reset_local_sbm1_nb_cwf_sent(); | |
|
146 | 154 | } |
|
147 | 155 | |
|
148 | 156 | #endif |
|
149 | 157 | break; |
|
150 | 158 | |
|
151 | 159 | //***** |
|
152 | 160 | // SBM2 |
|
153 | 161 | case(LFR_MODE_SBM2): |
|
154 | 162 | #ifdef GSA |
|
155 | 163 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") |
|
156 | 164 | #else |
|
157 | if ((waveform_picker_regs->status & 0x04) == 0x04){ // [0100] check the f2 full bit | |
|
165 | if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit | |
|
158 | 166 | // (1) change the receiving buffer for the waveform picker |
|
159 | if ( param_local.local_sbm2_nb_cwf_sent == (param_local.local_sbm2_nb_cwf_max-1) ) | |
|
160 | { | |
|
161 |
|
|
|
162 | } | |
|
163 | else if ( waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2_norm ) { | |
|
164 | waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); | |
|
165 | doubleSendCWF2 = 1; | |
|
166 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2_WFRM ) != RTEMS_SUCCESSFUL) { | |
|
167 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
|
168 | } | |
|
169 | reset_local_sbm2_nb_cwf_sent(); | |
|
170 | } | |
|
171 | else if ( waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2 ) { | |
|
172 | waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis); | |
|
173 | } | |
|
174 | else { | |
|
175 | waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); | |
|
176 | } | |
|
167 | ring_node_to_send_cwf_f2 = current_ring_node_f2; | |
|
168 | current_ring_node_f2 = current_ring_node_f2->next; | |
|
169 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; | |
|
177 | 170 | // (2) send an event for the waveforms transmission |
|
178 | 171 | if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) { |
|
179 | 172 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
180 | 173 | } |
|
181 | 174 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0 |
|
182 | 175 | } |
|
183 |
if |
|
|
184 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) { | |
|
185 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
|
186 | } | |
|
187 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0 | |
|
188 | } | |
|
176 | // if ( (waveform_picker_regs->status & 0x03) == 0x03 ) { // [0011] f3 f2 f1 f0, f1 and f0 are full | |
|
177 | // if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) { | |
|
178 | // rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
|
179 | // } | |
|
180 | // waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0 | |
|
181 | // } | |
|
189 | 182 | #endif |
|
190 | 183 | break; |
|
191 | 184 | |
|
192 | 185 | //******** |
|
193 | 186 | // DEFAULT |
|
194 | 187 | default: |
|
195 | 188 | break; |
|
196 | 189 | } |
|
197 | 190 | } |
|
198 | 191 | |
|
199 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ) | |
|
200 | { | |
|
201 | /** This is the interrupt sub routine called by the waveform picker simulator. | |
|
202 | * | |
|
203 | * This ISR is for debug purpose only. | |
|
204 | * | |
|
205 | */ | |
|
206 | ||
|
207 | unsigned char lfrMode; | |
|
208 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
|
209 | ||
|
210 | switch(lfrMode) { | |
|
211 | case (LFR_MODE_STANDBY): | |
|
212 | break; | |
|
213 | case (LFR_MODE_NORMAL): | |
|
214 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { | |
|
215 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_5 ); | |
|
216 | } | |
|
217 | break; | |
|
218 | case (LFR_MODE_BURST): | |
|
219 | break; | |
|
220 | case (LFR_MODE_SBM1): | |
|
221 | break; | |
|
222 | case (LFR_MODE_SBM2): | |
|
223 | break; | |
|
224 | } | |
|
225 | } | |
|
226 | ||
|
227 | 192 | rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP |
|
228 | 193 | { |
|
229 | 194 | /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode. |
|
230 | 195 | * |
|
231 | 196 | * @param unused is the starting argument of the RTEMS task |
|
232 | 197 | * |
|
233 | 198 | * The following data packets are sent by this task: |
|
234 | 199 | * - TM_LFR_SCIENCE_NORMAL_SWF_F0 |
|
235 | 200 | * - TM_LFR_SCIENCE_NORMAL_SWF_F1 |
|
236 | 201 | * - TM_LFR_SCIENCE_NORMAL_SWF_F2 |
|
237 | 202 | * |
|
238 | 203 | */ |
|
239 | 204 | |
|
240 | 205 | rtems_event_set event_out; |
|
241 | 206 | rtems_id queue_id; |
|
242 | 207 | rtems_status_code status; |
|
243 | 208 | |
|
244 | 209 | init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 ); |
|
245 | 210 | init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 ); |
|
246 | 211 | init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 ); |
|
247 | 212 | |
|
248 | 213 | init_waveforms(); |
|
249 | 214 | |
|
250 | 215 | status = get_message_queue_id_send( &queue_id ); |
|
251 | 216 | if (status != RTEMS_SUCCESSFUL) |
|
252 | 217 | { |
|
253 | 218 | PRINTF1("in WFRM *** ERR get_message_queue_id_send %d\n", status) |
|
254 | 219 | } |
|
255 | 220 | |
|
256 | 221 | BOOT_PRINTF("in WFRM ***\n") |
|
257 | 222 | |
|
258 | 223 | while(1){ |
|
259 | 224 | // wait for an RTEMS_EVENT |
|
260 | 225 | rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1 |
|
261 | 226 | | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM, |
|
262 | 227 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
263 | ||
|
228 | DEBUG_PRINTF("in WFRM *** 2\n") | |
|
264 | 229 | if (event_out == RTEMS_EVENT_MODE_NORMAL) |
|
265 | 230 | { |
|
266 | 231 | send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id); |
|
267 |
send_waveform_SWF( |
|
|
268 |
send_waveform_SWF( |
|
|
269 | #ifdef GSA | |
|
270 | waveform_picker_regs->status = waveform_picker_regs->status & 0xf888; // [1111 1000 1000 1000] f2, f1, f0 bits =0 | |
|
271 | #endif | |
|
272 | } | |
|
273 | else if (event_out == RTEMS_EVENT_MODE_SBM1) | |
|
274 | { | |
|
275 | send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id); | |
|
276 | send_waveform_SWF(wf_snap_f1_norm, SID_NORM_SWF_F1, headerSWF_F1, queue_id); | |
|
277 | send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id); | |
|
278 | #ifdef GSA | |
|
279 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2, f0 bits = 0 | |
|
280 | #endif | |
|
281 | } | |
|
282 | else if (event_out == RTEMS_EVENT_MODE_SBM2) | |
|
283 | { | |
|
284 | send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id); | |
|
285 | send_waveform_SWF(wf_snap_f1, SID_NORM_SWF_F1, headerSWF_F1, queue_id); | |
|
286 | #ifdef GSA | |
|
287 | waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0 | |
|
288 | #endif | |
|
289 | } | |
|
290 | else if (event_out == RTEMS_EVENT_MODE_SBM2_WFRM) | |
|
291 | { | |
|
292 | send_waveform_SWF(wf_snap_f2_norm, SID_NORM_SWF_F2, headerSWF_F2, queue_id); | |
|
232 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id); | |
|
233 | send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id); | |
|
293 | 234 | } |
|
294 | 235 | else |
|
295 | 236 | { |
|
296 | 237 | PRINTF("in WFRM *** unexpected event") |
|
297 | 238 | } |
|
298 | ||
|
299 | ||
|
300 | #ifdef GSA | |
|
301 | // irq processed, reset the related register of the timer unit | |
|
302 | gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl = gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl | 0x00000010; | |
|
303 | // clear the interruption | |
|
304 | LEON_Unmask_interrupt( IRQ_WF ); | |
|
305 | #endif | |
|
306 | 239 | } |
|
307 | 240 | } |
|
308 | 241 | |
|
309 | 242 | rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP |
|
310 | 243 | { |
|
311 | 244 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3. |
|
312 | 245 | * |
|
313 | 246 | * @param unused is the starting argument of the RTEMS task |
|
314 | 247 | * |
|
315 | 248 | * The following data packet is sent by this task: |
|
316 | 249 | * - TM_LFR_SCIENCE_NORMAL_CWF_F3 |
|
317 | 250 | * |
|
318 | 251 | */ |
|
319 | 252 | |
|
320 | 253 | rtems_event_set event_out; |
|
321 | 254 | rtems_id queue_id; |
|
322 | 255 | rtems_status_code status; |
|
323 | 256 | |
|
324 | 257 | init_header_continuous_wf_table( SID_NORM_CWF_F3, headerCWF_F3 ); |
|
325 | 258 | init_header_continuous_wf3_light_table( headerCWF_F3_light ); |
|
326 | 259 | |
|
327 | 260 | status = get_message_queue_id_send( &queue_id ); |
|
328 | 261 | if (status != RTEMS_SUCCESSFUL) |
|
329 | 262 | { |
|
330 | 263 | PRINTF1("in CWF3 *** ERR get_message_queue_id_send %d\n", status) |
|
331 | 264 | } |
|
332 | 265 | |
|
333 | 266 | BOOT_PRINTF("in CWF3 ***\n") |
|
334 | 267 | |
|
335 | 268 | while(1){ |
|
336 | 269 | // wait for an RTEMS_EVENT |
|
337 | 270 | rtems_event_receive( RTEMS_EVENT_0, |
|
338 | 271 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
339 | 272 | PRINTF("send CWF F3 \n") |
|
340 | 273 | #ifdef GSA |
|
341 | 274 | #else |
|
342 | 275 | if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) { |
|
343 | 276 | send_waveform_CWF3_light( wf_cont_f3_bis, headerCWF_F3_light, queue_id ); |
|
344 | 277 | } |
|
345 | 278 | else { |
|
346 | 279 | send_waveform_CWF3_light( wf_cont_f3, headerCWF_F3_light, queue_id ); |
|
347 | 280 | } |
|
348 | 281 | #endif |
|
349 | 282 | } |
|
350 | 283 | } |
|
351 | 284 | |
|
352 | 285 | rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2 |
|
353 | 286 | { |
|
354 | 287 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2. |
|
355 | 288 | * |
|
356 | 289 | * @param unused is the starting argument of the RTEMS task |
|
357 | 290 | * |
|
358 | 291 | * The following data packet is sent by this function: |
|
359 | 292 | * - TM_LFR_SCIENCE_BURST_CWF_F2 |
|
360 | 293 | * - TM_LFR_SCIENCE_SBM2_CWF_F2 |
|
361 | 294 | * |
|
362 | 295 | */ |
|
363 | 296 | |
|
364 | 297 | rtems_event_set event_out; |
|
365 | 298 | rtems_id queue_id; |
|
366 | 299 | rtems_status_code status; |
|
367 | 300 | |
|
368 | 301 | init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST ); |
|
369 | 302 | init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 ); |
|
370 | 303 | |
|
371 | 304 | status = get_message_queue_id_send( &queue_id ); |
|
372 | 305 | if (status != RTEMS_SUCCESSFUL) |
|
373 | 306 | { |
|
374 | 307 | PRINTF1("in CWF2 *** ERR get_message_queue_id_send %d\n", status) |
|
375 | 308 | } |
|
376 | 309 | |
|
377 | 310 | BOOT_PRINTF("in CWF2 ***\n") |
|
378 | 311 | |
|
379 | 312 | while(1){ |
|
380 | 313 | // wait for an RTEMS_EVENT |
|
381 | 314 | rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2, |
|
382 | 315 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
383 | 316 | |
|
384 | 317 | if (event_out == RTEMS_EVENT_MODE_BURST) |
|
385 | 318 | { |
|
386 | // F2 | |
|
387 | #ifdef GSA | |
|
388 | #else | |
|
389 | if (waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) { | |
|
390 | send_waveform_CWF( wf_snap_f2_bis, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id ); | |
|
391 | } | |
|
392 | else { | |
|
393 | send_waveform_CWF( wf_snap_f2, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id ); | |
|
394 | } | |
|
395 | #endif | |
|
319 | send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id ); | |
|
396 | 320 | } |
|
397 | ||
|
398 | else if (event_out == RTEMS_EVENT_MODE_SBM2) | |
|
321 | if (event_out == RTEMS_EVENT_MODE_SBM2) | |
|
399 | 322 | { |
|
400 | #ifdef GSA | |
|
401 | #else | |
|
402 | if (doubleSendCWF2 == 1) | |
|
403 | { | |
|
404 | doubleSendCWF2 = 0; | |
|
405 | send_waveform_CWF( wf_snap_f2_norm, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id ); | |
|
406 | } | |
|
407 | else if (waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) { | |
|
408 | send_waveform_CWF( wf_snap_f2_bis, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id ); | |
|
409 | } | |
|
410 | else { | |
|
411 | send_waveform_CWF( wf_snap_f2, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id ); | |
|
412 | } | |
|
413 | param_local.local_sbm2_nb_cwf_sent ++; | |
|
414 | #endif | |
|
415 | } | |
|
416 | else | |
|
417 | { | |
|
418 | PRINTF1("in CWF2 *** ERR mode = %d\n", lfrCurrentMode) | |
|
323 | send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id ); | |
|
419 | 324 | } |
|
420 | 325 | } |
|
421 | 326 | } |
|
422 | 327 | |
|
423 | 328 | rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1 |
|
424 | 329 | { |
|
425 | 330 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1. |
|
426 | 331 | * |
|
427 | 332 | * @param unused is the starting argument of the RTEMS task |
|
428 | 333 | * |
|
429 | 334 | * The following data packet is sent by this function: |
|
430 | 335 | * - TM_LFR_SCIENCE_SBM1_CWF_F1 |
|
431 | 336 | * |
|
432 | 337 | */ |
|
433 | 338 | |
|
434 | 339 | rtems_event_set event_out; |
|
435 | 340 | rtems_id queue_id; |
|
436 | 341 | rtems_status_code status; |
|
437 | 342 | |
|
438 | 343 | init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 ); |
|
439 | 344 | |
|
440 | 345 | status = get_message_queue_id_send( &queue_id ); |
|
441 | 346 | if (status != RTEMS_SUCCESSFUL) |
|
442 | 347 | { |
|
443 | 348 | PRINTF1("in CWF1 *** ERR get_message_queue_id_send %d\n", status) |
|
444 | 349 | } |
|
445 | 350 | |
|
446 | 351 | BOOT_PRINTF("in CWF1 ***\n") |
|
447 | 352 | |
|
448 | 353 | while(1){ |
|
449 | 354 | // wait for an RTEMS_EVENT |
|
450 | 355 | rtems_event_receive( RTEMS_EVENT_MODE_SBM1, |
|
451 | 356 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
452 | if (event_out == RTEMS_EVENT_MODE_SBM1) | |
|
453 | { | |
|
454 | #ifdef GSA | |
|
455 | #else | |
|
456 | if (doubleSendCWF1 == 1) | |
|
457 | { | |
|
458 | doubleSendCWF1 = 0; | |
|
459 | send_waveform_CWF( wf_snap_f1_norm, SID_SBM1_CWF_F1, headerCWF_F1, queue_id ); | |
|
460 | } | |
|
461 | else if (waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) { | |
|
462 | send_waveform_CWF( wf_snap_f1_bis, SID_SBM1_CWF_F1, headerCWF_F1, queue_id ); | |
|
463 | } | |
|
464 | else { | |
|
465 | send_waveform_CWF( wf_snap_f1, SID_SBM1_CWF_F1, headerCWF_F1, queue_id ); | |
|
466 | } | |
|
467 | param_local.local_sbm1_nb_cwf_sent ++; | |
|
468 | #endif | |
|
469 | } | |
|
470 | else | |
|
471 | { | |
|
472 | PRINTF1("in CWF1 *** ERR mode = %d\n", lfrCurrentMode) | |
|
473 | } | |
|
357 | send_waveform_CWF((volatile int*) ring_node_to_send_cwf_f1->buffer_address, SID_SBM1_CWF_F1, headerCWF_F1, queue_id ); | |
|
474 | 358 | } |
|
475 | 359 | } |
|
476 | 360 | |
|
477 | 361 | //****************** |
|
478 | 362 | // general functions |
|
479 | 363 | void init_waveforms( void ) |
|
480 | 364 | { |
|
481 | 365 | int i = 0; |
|
482 | 366 | |
|
483 | 367 | for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) |
|
484 | 368 | { |
|
485 | 369 | //*** |
|
486 | 370 | // F0 |
|
487 | 371 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; // |
|
488 | 372 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; // |
|
489 | 373 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; // |
|
490 | 374 | |
|
491 | 375 | //*** |
|
492 | 376 | // F1 |
|
493 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111; | |
|
494 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333; | |
|
495 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000; | |
|
377 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111; | |
|
378 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333; | |
|
379 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000; | |
|
496 | 380 | |
|
497 | 381 | //*** |
|
498 | 382 | // F2 |
|
499 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333; | |
|
500 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; | |
|
501 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000; | |
|
383 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333; | |
|
384 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; | |
|
385 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000; | |
|
502 | 386 | |
|
503 | 387 | //*** |
|
504 | 388 | // F3 |
|
505 |
|
|
|
506 |
|
|
|
507 |
|
|
|
389 | // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1; | |
|
390 | // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2; | |
|
391 | // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000; | |
|
392 | } | |
|
393 | } | |
|
394 | ||
|
395 | void init_waveform_rings( void ) | |
|
396 | { | |
|
397 | unsigned char i; | |
|
398 | ||
|
399 | // F1 RING | |
|
400 | waveform_ring_f1[0].next = (ring_node*) &waveform_ring_f1[1]; | |
|
401 | waveform_ring_f1[0].previous = (ring_node*) &waveform_ring_f1[NB_RING_NODES_F1-1]; | |
|
402 | waveform_ring_f1[0].buffer_address = (int) &wf_snap_f1[0][0]; | |
|
403 | ||
|
404 | waveform_ring_f1[NB_RING_NODES_F1-1].next = (ring_node*) &waveform_ring_f1[0]; | |
|
405 | waveform_ring_f1[NB_RING_NODES_F1-1].previous = (ring_node*) &waveform_ring_f1[NB_RING_NODES_F1-2]; | |
|
406 | waveform_ring_f1[NB_RING_NODES_F1-1].buffer_address = (int) &wf_snap_f1[NB_RING_NODES_F1-1][0]; | |
|
407 | ||
|
408 | for(i=1; i<NB_RING_NODES_F1-1; i++) | |
|
409 | { | |
|
410 | waveform_ring_f1[i].next = (ring_node*) &waveform_ring_f1[i+1]; | |
|
411 | waveform_ring_f1[i].previous = (ring_node*) &waveform_ring_f1[i-1]; | |
|
412 | waveform_ring_f1[i].buffer_address = (int) &wf_snap_f1[i][0]; | |
|
508 | 413 | } |
|
414 | ||
|
415 | // F2 RING | |
|
416 | waveform_ring_f2[0].next = (ring_node*) &waveform_ring_f2[1]; | |
|
417 | waveform_ring_f2[0].previous = (ring_node*) &waveform_ring_f2[NB_RING_NODES_F2-1]; | |
|
418 | waveform_ring_f2[0].buffer_address = (int) &wf_snap_f2[0][0]; | |
|
419 | ||
|
420 | waveform_ring_f2[NB_RING_NODES_F2-1].next = (ring_node*) &waveform_ring_f2[0]; | |
|
421 | waveform_ring_f2[NB_RING_NODES_F2-1].previous = (ring_node*) &waveform_ring_f2[NB_RING_NODES_F2-2]; | |
|
422 | waveform_ring_f2[NB_RING_NODES_F2-1].buffer_address = (int) &wf_snap_f2[NB_RING_NODES_F2-1][0]; | |
|
423 | ||
|
424 | for(i=1; i<NB_RING_NODES_F2-1; i++) | |
|
425 | { | |
|
426 | waveform_ring_f2[i].next = (ring_node*) &waveform_ring_f2[i+1]; | |
|
427 | waveform_ring_f2[i].previous = (ring_node*) &waveform_ring_f2[i-1]; | |
|
428 | waveform_ring_f2[i].buffer_address = (int) &wf_snap_f2[i][0]; | |
|
429 | } | |
|
430 | ||
|
431 | DEBUG_PRINTF1("waveform_ring_f1 @%x\n", (unsigned int) waveform_ring_f1) | |
|
432 | DEBUG_PRINTF1("waveform_ring_f2 @%x\n", (unsigned int) waveform_ring_f2) | |
|
433 | ||
|
434 | } | |
|
435 | ||
|
436 | void reset_current_ring_nodes( void ) | |
|
437 | { | |
|
438 | current_ring_node_f1 = waveform_ring_f1; | |
|
439 | ring_node_to_send_cwf_f1 = waveform_ring_f1; | |
|
440 | ring_node_to_send_swf_f1 = waveform_ring_f1; | |
|
441 | ||
|
442 | current_ring_node_f2 = waveform_ring_f2; | |
|
443 | ring_node_to_send_cwf_f2 = waveform_ring_f2; | |
|
444 | ring_node_to_send_swf_f2 = waveform_ring_f2; | |
|
509 | 445 | } |
|
510 | 446 | |
|
511 | 447 | int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF) |
|
512 | 448 | { |
|
513 | 449 | unsigned char i; |
|
514 | 450 | |
|
515 | 451 | for (i=0; i<7; i++) |
|
516 | 452 | { |
|
517 | 453 | headerSWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
518 | 454 | headerSWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
519 | 455 | headerSWF[ i ].reserved = DEFAULT_RESERVED; |
|
520 | 456 | headerSWF[ i ].userApplication = CCSDS_USER_APP; |
|
521 | 457 | headerSWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); |
|
522 | 458 | headerSWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); |
|
523 | 459 | if (i == 0) |
|
524 | 460 | { |
|
525 | 461 | headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST; |
|
526 | 462 | headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_340 >> 8); |
|
527 | 463 | headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_340 ); |
|
528 | 464 | headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); |
|
529 | 465 | headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); |
|
530 | 466 | } |
|
531 | 467 | else if (i == 6) |
|
532 | 468 | { |
|
533 | 469 | headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST; |
|
534 | 470 | headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_8 >> 8); |
|
535 | 471 | headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_8 ); |
|
536 | 472 | headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8); |
|
537 | 473 | headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 ); |
|
538 | 474 | } |
|
539 | 475 | else |
|
540 | 476 | { |
|
541 | 477 | headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION; |
|
542 | 478 | headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_340 >> 8); |
|
543 | 479 | headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_340 ); |
|
544 | 480 | headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); |
|
545 | 481 | headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); |
|
546 | 482 | } |
|
547 | 483 | headerSWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
548 | 484 | headerSWF[ i ].pktCnt = DEFAULT_PKTCNT; // PKT_CNT |
|
549 | 485 | headerSWF[ i ].pktNr = i+1; // PKT_NR |
|
550 | 486 | // DATA FIELD HEADER |
|
551 | 487 | headerSWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
552 | 488 | headerSWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type |
|
553 | 489 | headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
554 | 490 | headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; |
|
555 | 491 | // AUXILIARY DATA HEADER |
|
556 | 492 | headerSWF[ i ].time[0] = 0x00; |
|
557 | 493 | headerSWF[ i ].time[0] = 0x00; |
|
558 | 494 | headerSWF[ i ].time[0] = 0x00; |
|
559 | 495 | headerSWF[ i ].time[0] = 0x00; |
|
560 | 496 | headerSWF[ i ].time[0] = 0x00; |
|
561 | 497 | headerSWF[ i ].time[0] = 0x00; |
|
562 | 498 | headerSWF[ i ].sid = sid; |
|
563 | 499 | headerSWF[ i ].hkBIA = DEFAULT_HKBIA; |
|
564 | 500 | } |
|
565 | 501 | return LFR_SUCCESSFUL; |
|
566 | 502 | } |
|
567 | 503 | |
|
568 | 504 | int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF ) |
|
569 | 505 | { |
|
570 | 506 | unsigned int i; |
|
571 | 507 | |
|
572 | 508 | for (i=0; i<7; i++) |
|
573 | 509 | { |
|
574 | 510 | headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
575 | 511 | headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
576 | 512 | headerCWF[ i ].reserved = DEFAULT_RESERVED; |
|
577 | 513 | headerCWF[ i ].userApplication = CCSDS_USER_APP; |
|
578 | 514 | if ( (sid == SID_SBM1_CWF_F1) || (sid == SID_SBM2_CWF_F2) ) |
|
579 | 515 | { |
|
580 | 516 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2 >> 8); |
|
581 | 517 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2); |
|
582 | 518 | } |
|
583 | 519 | else |
|
584 | 520 | { |
|
585 | 521 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); |
|
586 | 522 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); |
|
587 | 523 | } |
|
588 | 524 | if (i == 0) |
|
589 | 525 | { |
|
590 | 526 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST; |
|
591 | 527 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_340 >> 8); |
|
592 | 528 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_340 ); |
|
593 | 529 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); |
|
594 | 530 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); |
|
595 | 531 | } |
|
596 | 532 | else if (i == 6) |
|
597 | 533 | { |
|
598 | 534 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST; |
|
599 | 535 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_8 >> 8); |
|
600 | 536 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_8 ); |
|
601 | 537 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8); |
|
602 | 538 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 ); |
|
603 | 539 | } |
|
604 | 540 | else |
|
605 | 541 | { |
|
606 | 542 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION; |
|
607 | 543 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_340 >> 8); |
|
608 | 544 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_340 ); |
|
609 | 545 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); |
|
610 | 546 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); |
|
611 | 547 | } |
|
612 | 548 | headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
613 | 549 | // PKT_CNT |
|
614 | 550 | // PKT_NR |
|
615 | 551 | // DATA FIELD HEADER |
|
616 | 552 | headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
617 | 553 | headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type |
|
618 | 554 | headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
619 | 555 | headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; |
|
620 | 556 | // AUXILIARY DATA HEADER |
|
621 | 557 | headerCWF[ i ].sid = sid; |
|
622 | 558 | headerCWF[ i ].hkBIA = DEFAULT_HKBIA; |
|
623 | 559 | headerCWF[ i ].time[0] = 0x00; |
|
624 | 560 | headerCWF[ i ].time[0] = 0x00; |
|
625 | 561 | headerCWF[ i ].time[0] = 0x00; |
|
626 | 562 | headerCWF[ i ].time[0] = 0x00; |
|
627 | 563 | headerCWF[ i ].time[0] = 0x00; |
|
628 | 564 | headerCWF[ i ].time[0] = 0x00; |
|
629 | 565 | } |
|
630 | 566 | return LFR_SUCCESSFUL; |
|
631 | 567 | } |
|
632 | 568 | |
|
633 | 569 | int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF ) |
|
634 | 570 | { |
|
635 | 571 | unsigned int i; |
|
636 | 572 | |
|
637 | 573 | for (i=0; i<7; i++) |
|
638 | 574 | { |
|
639 | 575 | headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
640 | 576 | headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
641 | 577 | headerCWF[ i ].reserved = DEFAULT_RESERVED; |
|
642 | 578 | headerCWF[ i ].userApplication = CCSDS_USER_APP; |
|
643 | 579 | |
|
644 | 580 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); |
|
645 | 581 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); |
|
646 | 582 | if (i == 0) |
|
647 | 583 | { |
|
648 | 584 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST; |
|
649 | 585 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8); |
|
650 | 586 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 ); |
|
651 | 587 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); |
|
652 | 588 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); |
|
653 | 589 | } |
|
654 | 590 | else if (i == 6) |
|
655 | 591 | { |
|
656 | 592 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST; |
|
657 | 593 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 >> 8); |
|
658 | 594 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 ); |
|
659 | 595 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8); |
|
660 | 596 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 ); |
|
661 | 597 | } |
|
662 | 598 | else |
|
663 | 599 | { |
|
664 | 600 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION; |
|
665 | 601 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8); |
|
666 | 602 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 ); |
|
667 | 603 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); |
|
668 | 604 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); |
|
669 | 605 | } |
|
670 | 606 | headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
671 | 607 | // DATA FIELD HEADER |
|
672 | 608 | headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
673 | 609 | headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type |
|
674 | 610 | headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
675 | 611 | headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; |
|
676 | 612 | // AUXILIARY DATA HEADER |
|
677 | 613 | headerCWF[ i ].sid = SID_NORM_CWF_F3; |
|
678 | 614 | headerCWF[ i ].hkBIA = DEFAULT_HKBIA; |
|
679 | 615 | headerCWF[ i ].time[0] = 0x00; |
|
680 | 616 | headerCWF[ i ].time[0] = 0x00; |
|
681 | 617 | headerCWF[ i ].time[0] = 0x00; |
|
682 | 618 | headerCWF[ i ].time[0] = 0x00; |
|
683 | 619 | headerCWF[ i ].time[0] = 0x00; |
|
684 | 620 | headerCWF[ i ].time[0] = 0x00; |
|
685 | 621 | } |
|
686 | 622 | return LFR_SUCCESSFUL; |
|
687 | 623 | } |
|
688 | 624 | |
|
689 | void reset_waveforms( void ) | |
|
690 | { | |
|
691 | int i = 0; | |
|
692 | ||
|
693 | for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) | |
|
694 | { | |
|
695 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x10002000; | |
|
696 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000; | |
|
697 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000; | |
|
698 | ||
|
699 | //*** | |
|
700 | // F1 | |
|
701 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x1000f000; | |
|
702 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0xf0001000; | |
|
703 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000; | |
|
704 | ||
|
705 | //*** | |
|
706 | // F2 | |
|
707 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x40008000; | |
|
708 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000; | |
|
709 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x10002000; | |
|
710 | ||
|
711 | //*** | |
|
712 | // F3 | |
|
713 | /*wf_cont_f3[ i* NB_WORDS_SWF_BLK + 0 ] = build_value( i, i ); // v and 1 | |
|
714 | wf_cont_f3[ i* NB_WORDS_SWF_BLK + 1 ] = build_value( i, i ); // e2 and b1 | |
|
715 | wf_cont_f3[ i* NB_WORDS_SWF_BLK + 2 ] = build_value( i, i ); // b2 and b3*/ | |
|
716 | } | |
|
717 | } | |
|
718 | ||
|
719 | 625 | int send_waveform_SWF( volatile int *waveform, unsigned int sid, |
|
720 | 626 | Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id ) |
|
721 | 627 | { |
|
722 | 628 | /** This function sends SWF CCSDS packets (F2, F1 or F0). |
|
723 | 629 | * |
|
724 | 630 | * @param waveform points to the buffer containing the data that will be send. |
|
725 | 631 | * @param sid is the source identifier of the data that will be sent. |
|
726 | 632 | * @param headerSWF points to a table of headers that have been prepared for the data transmission. |
|
727 | 633 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures |
|
728 | 634 | * contain information to setup the transmission of the data packets. |
|
729 | 635 | * |
|
730 | 636 | * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks. |
|
731 | 637 | * |
|
732 | 638 | */ |
|
733 | 639 | |
|
734 | 640 | unsigned int i; |
|
735 | 641 | int ret; |
|
736 | 642 | rtems_status_code status; |
|
737 | 643 | spw_ioctl_pkt_send spw_ioctl_send_SWF; |
|
738 | 644 | |
|
739 | 645 | spw_ioctl_send_SWF.hlen = TM_HEADER_LEN + 4 + 12; // + 4 is for the protocole extra header, + 12 is for the auxiliary header |
|
740 | 646 | spw_ioctl_send_SWF.options = 0; |
|
741 | 647 | |
|
742 | 648 | ret = LFR_DEFAULT; |
|
743 | 649 | |
|
744 | 650 | for (i=0; i<7; i++) // send waveform |
|
745 | 651 | { |
|
746 | 652 | spw_ioctl_send_SWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ]; |
|
747 | 653 | spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ]; |
|
748 | 654 | // BUILD THE DATA |
|
749 | 655 | if (i==6) { |
|
750 | 656 | spw_ioctl_send_SWF.dlen = 8 * NB_BYTES_SWF_BLK; |
|
751 | 657 | } |
|
752 | 658 | else { |
|
753 | 659 | spw_ioctl_send_SWF.dlen = 340 * NB_BYTES_SWF_BLK; |
|
754 | 660 | } |
|
755 | 661 | // SET PACKET SEQUENCE COUNTER |
|
756 | 662 | increment_seq_counter_source_id( headerSWF[ i ].packetSequenceControl, sid ); |
|
757 | 663 | // SET PACKET TIME |
|
758 | 664 | headerSWF[ i ].acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
759 | 665 | headerSWF[ i ].acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
760 | 666 | headerSWF[ i ].acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
761 | 667 | headerSWF[ i ].acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time); |
|
762 | 668 | headerSWF[ i ].acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
763 | 669 | headerSWF[ i ].acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time); |
|
764 | 670 | headerSWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
765 | 671 | headerSWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
766 | 672 | headerSWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
767 | 673 | headerSWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
768 | 674 | headerSWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
769 | 675 | headerSWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time); |
|
770 | 676 | // SEND PACKET |
|
771 | 677 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_SWF, ACTION_MSG_SPW_IOCTL_SEND_SIZE); |
|
772 | 678 | if (status != RTEMS_SUCCESSFUL) { |
|
773 | 679 | printf("%d-%d, ERR %d\n", sid, i, (int) status); |
|
774 | 680 | ret = LFR_DEFAULT; |
|
775 | 681 | } |
|
776 | 682 | rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds |
|
777 | 683 | } |
|
778 | 684 | |
|
779 | 685 | return ret; |
|
780 | 686 | } |
|
781 | 687 | |
|
782 | 688 | int send_waveform_CWF(volatile int *waveform, unsigned int sid, |
|
783 | 689 | Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id) |
|
784 | 690 | { |
|
785 | 691 | /** This function sends CWF CCSDS packets (F2, F1 or F0). |
|
786 | 692 | * |
|
787 | 693 | * @param waveform points to the buffer containing the data that will be send. |
|
788 | 694 | * @param sid is the source identifier of the data that will be sent. |
|
789 | 695 | * @param headerCWF points to a table of headers that have been prepared for the data transmission. |
|
790 | 696 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures |
|
791 | 697 | * contain information to setup the transmission of the data packets. |
|
792 | 698 | * |
|
793 | 699 | * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks. |
|
794 | 700 | * |
|
795 | 701 | */ |
|
796 | 702 | |
|
797 | 703 | unsigned int i; |
|
798 | 704 | int ret; |
|
799 | 705 | rtems_status_code status; |
|
800 | 706 | spw_ioctl_pkt_send spw_ioctl_send_CWF; |
|
801 | 707 | |
|
802 | 708 | spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header |
|
803 | 709 | spw_ioctl_send_CWF.options = 0; |
|
804 | 710 | |
|
805 | 711 | ret = LFR_DEFAULT; |
|
806 | 712 | |
|
807 | 713 | for (i=0; i<7; i++) // send waveform |
|
808 | 714 | { |
|
809 | 715 | int coarseTime = 0x00; |
|
810 | 716 | int fineTime = 0x00; |
|
811 | 717 | spw_ioctl_send_CWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ]; |
|
812 | 718 | spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ]; |
|
813 | 719 | // BUILD THE DATA |
|
814 | 720 | if (i==6) { |
|
815 | 721 | spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_SWF_BLK; |
|
816 | 722 | } |
|
817 | 723 | else { |
|
818 | 724 | spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_SWF_BLK; |
|
819 | 725 | } |
|
820 | 726 | // SET PACKET SEQUENCE COUNTER |
|
821 | 727 | increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, sid ); |
|
822 | 728 | // SET PACKET TIME |
|
823 | 729 | coarseTime = time_management_regs->coarse_time; |
|
824 | 730 | fineTime = time_management_regs->fine_time; |
|
825 | 731 | headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24); |
|
826 | 732 | headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16); |
|
827 | 733 | headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8); |
|
828 | 734 | headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime); |
|
829 | 735 | headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8); |
|
830 | 736 | headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime); |
|
831 | 737 | headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24); |
|
832 | 738 | headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16); |
|
833 | 739 | headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8); |
|
834 | 740 | headerCWF[ i ].time[3] = (unsigned char) (coarseTime); |
|
835 | 741 | headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8); |
|
836 | 742 | headerCWF[ i ].time[5] = (unsigned char) (fineTime); |
|
837 | 743 | // SEND PACKET |
|
838 | 744 | if (sid == SID_NORM_CWF_F3) |
|
839 | 745 | { |
|
840 | 746 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); |
|
841 | 747 | if (status != RTEMS_SUCCESSFUL) { |
|
842 | 748 | printf("%d-%d, ERR %d\n", sid, i, (int) status); |
|
843 | 749 | ret = LFR_DEFAULT; |
|
844 | 750 | } |
|
845 | 751 | rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS); |
|
846 | 752 | } |
|
847 | 753 | else |
|
848 | 754 | { |
|
849 | 755 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); |
|
850 | 756 | if (status != RTEMS_SUCCESSFUL) { |
|
851 | 757 | printf("%d-%d, ERR %d\n", sid, i, (int) status); |
|
852 | 758 | ret = LFR_DEFAULT; |
|
853 | 759 | } |
|
854 | 760 | } |
|
855 | 761 | } |
|
856 | 762 | |
|
857 | 763 | return ret; |
|
858 | 764 | } |
|
859 | 765 | |
|
860 | 766 | int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id) |
|
861 | 767 | { |
|
862 | 768 | /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data. |
|
863 | 769 | * |
|
864 | 770 | * @param waveform points to the buffer containing the data that will be send. |
|
865 | 771 | * @param headerCWF points to a table of headers that have been prepared for the data transmission. |
|
866 | 772 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures |
|
867 | 773 | * contain information to setup the transmission of the data packets. |
|
868 | 774 | * |
|
869 | 775 | * By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer |
|
870 | 776 | * from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks. |
|
871 | 777 | * |
|
872 | 778 | */ |
|
873 | 779 | |
|
874 | 780 | unsigned int i; |
|
875 | 781 | int ret; |
|
876 | 782 | rtems_status_code status; |
|
877 | 783 | spw_ioctl_pkt_send spw_ioctl_send_CWF; |
|
878 | 784 | char *sample; |
|
879 | 785 | |
|
880 | 786 | spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header |
|
881 | 787 | spw_ioctl_send_CWF.options = 0; |
|
882 | 788 | |
|
883 | 789 | ret = LFR_DEFAULT; |
|
884 | 790 | |
|
885 | 791 | //********************** |
|
886 | 792 | // BUILD CWF3_light DATA |
|
887 | 793 | for ( i=0; i< 2048; i++) |
|
888 | 794 | { |
|
889 | 795 | sample = (char*) &waveform[ i * NB_WORDS_SWF_BLK ]; |
|
890 | 796 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) ] = sample[ 0 ]; |
|
891 | 797 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 ] = sample[ 1 ]; |
|
892 | 798 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 ] = sample[ 2 ]; |
|
893 | 799 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 ] = sample[ 3 ]; |
|
894 | 800 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 ] = sample[ 4 ]; |
|
895 | 801 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ]; |
|
896 | 802 | } |
|
897 | 803 | |
|
898 | 804 | //********************* |
|
899 | 805 | // SEND CWF3_light DATA |
|
900 | 806 | |
|
901 | 807 | for (i=0; i<7; i++) // send waveform |
|
902 | 808 | { |
|
903 | 809 | int coarseTime = 0x00; |
|
904 | 810 | int fineTime = 0x00; |
|
905 | 811 | spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * 340 * NB_BYTES_CWF3_LIGHT_BLK) ]; |
|
906 | 812 | spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ]; |
|
907 | 813 | // BUILD THE DATA |
|
908 | 814 | if ( i == WFRM_INDEX_OF_LAST_PACKET ) { |
|
909 | 815 | spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_CWF3_LIGHT_BLK; |
|
910 | 816 | } |
|
911 | 817 | else { |
|
912 | 818 | spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_CWF3_LIGHT_BLK; |
|
913 | 819 | } |
|
914 | 820 | // SET PACKET SEQUENCE COUNTER |
|
915 | 821 | increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, SID_NORM_CWF_F3 ); |
|
916 | 822 | // SET PACKET TIME |
|
917 | 823 | coarseTime = time_management_regs->coarse_time; |
|
918 | 824 | fineTime = time_management_regs->fine_time; |
|
919 | 825 | headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24); |
|
920 | 826 | headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16); |
|
921 | 827 | headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8); |
|
922 | 828 | headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime); |
|
923 | 829 | headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8); |
|
924 | 830 | headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime); |
|
925 | 831 | headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24); |
|
926 | 832 | headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16); |
|
927 | 833 | headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8); |
|
928 | 834 | headerCWF[ i ].time[3] = (unsigned char) (coarseTime); |
|
929 | 835 | headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8); |
|
930 | 836 | headerCWF[ i ].time[5] = (unsigned char) (fineTime); |
|
931 | 837 | // SEND PACKET |
|
932 | 838 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); |
|
933 | 839 | if (status != RTEMS_SUCCESSFUL) { |
|
934 | 840 | printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status); |
|
935 | 841 | ret = LFR_DEFAULT; |
|
936 | 842 | } |
|
937 | 843 | rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS); |
|
938 | 844 | } |
|
939 | 845 | |
|
940 | 846 | return ret; |
|
941 | 847 | } |
|
942 | 848 | |
|
943 | 849 | |
|
944 | 850 | //************** |
|
945 | 851 | // wfp registers |
|
946 | 852 | void set_wfp_data_shaping() |
|
947 | 853 | { |
|
948 | 854 | /** This function sets the data_shaping register of the waveform picker module. |
|
949 | 855 | * |
|
950 | 856 | * The value is read from one field of the parameter_dump_packet structure:\n |
|
951 | 857 | * bw_sp0_sp1_r0_r1 |
|
952 | 858 | * |
|
953 | 859 | */ |
|
954 | 860 | |
|
955 | 861 | unsigned char data_shaping; |
|
956 | 862 | |
|
957 | 863 | // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register |
|
958 | 864 | // waveform picker : [R1 R0 SP1 SP0 BW] |
|
959 | 865 | |
|
960 | 866 | data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1; |
|
961 | 867 | |
|
962 | 868 | #ifdef GSA |
|
963 | 869 | #else |
|
964 | 870 | waveform_picker_regs->data_shaping = |
|
965 | 871 | ( (data_shaping & 0x10) >> 4 ) // BW |
|
966 | 872 | + ( (data_shaping & 0x08) >> 2 ) // SP0 |
|
967 | 873 | + ( (data_shaping & 0x04) ) // SP1 |
|
968 | 874 | + ( (data_shaping & 0x02) << 2 ) // R0 |
|
969 | 875 | + ( (data_shaping & 0x01) << 4 ); // R1 |
|
970 | 876 | #endif |
|
971 | 877 | } |
|
972 | 878 | |
|
973 | 879 | char set_wfp_delta_snapshot() |
|
974 | 880 | { |
|
975 | 881 | /** This function sets the delta_snapshot register of the waveform picker module. |
|
976 | 882 | * |
|
977 | 883 | * The value is read from two (unsigned char) of the parameter_dump_packet structure: |
|
978 | 884 | * - sy_lfr_n_swf_p[0] |
|
979 | 885 | * - sy_lfr_n_swf_p[1] |
|
980 | 886 | * |
|
981 | 887 | */ |
|
982 | 888 | |
|
983 | 889 | char ret; |
|
984 | 890 | unsigned int delta_snapshot; |
|
985 | 891 | unsigned int aux; |
|
986 | 892 | |
|
987 | 893 | aux = 0; |
|
988 | 894 | ret = LFR_DEFAULT; |
|
989 | 895 | |
|
990 | 896 | delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256 |
|
991 | 897 | + parameter_dump_packet.sy_lfr_n_swf_p[1]; |
|
992 | 898 | |
|
993 | 899 | #ifdef GSA |
|
994 | 900 | #else |
|
995 | 901 | if ( delta_snapshot < MIN_DELTA_SNAPSHOT ) |
|
996 | 902 | { |
|
997 | 903 | aux = MIN_DELTA_SNAPSHOT; |
|
998 | 904 | ret = LFR_DEFAULT; |
|
999 | 905 | } |
|
1000 | 906 | else |
|
1001 | 907 | { |
|
1002 | 908 | aux = delta_snapshot ; |
|
1003 | 909 | ret = LFR_SUCCESSFUL; |
|
1004 | 910 | } |
|
1005 | 911 | waveform_picker_regs->delta_snapshot = aux - 1; // max 2 bytes |
|
1006 | 912 | #endif |
|
1007 | 913 | |
|
1008 | 914 | return ret; |
|
1009 | 915 | } |
|
1010 | 916 | |
|
1011 | 917 | void set_wfp_burst_enable_register( unsigned char mode) |
|
1012 | 918 | { |
|
1013 | 919 | /** This function sets the waveform picker burst_enable register depending on the mode. |
|
1014 | 920 | * |
|
1015 | 921 | * @param mode is the LFR mode to launch. |
|
1016 | 922 | * |
|
1017 | 923 | * The burst bits shall be before the enable bits. |
|
1018 | 924 | * |
|
1019 | 925 | */ |
|
1020 | 926 | |
|
1021 | 927 | #ifdef GSA |
|
1022 | 928 | #else |
|
1023 | 929 | // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0 |
|
1024 | 930 | // the burst bits shall be set first, before the enable bits |
|
1025 | 931 | switch(mode) { |
|
1026 | 932 | case(LFR_MODE_NORMAL): |
|
1027 | 933 | waveform_picker_regs->burst_enable = 0x00; // [0000 0000] no burst enable |
|
1028 | 934 | waveform_picker_regs->burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0 |
|
1029 | 935 | break; |
|
1030 | 936 | case(LFR_MODE_BURST): |
|
1031 | 937 | waveform_picker_regs->burst_enable = 0x40; // [0100 0000] f2 burst enabled |
|
1032 | 938 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x04; // [0100] enable f2 |
|
1033 | 939 | break; |
|
1034 | 940 | case(LFR_MODE_SBM1): |
|
1035 | 941 | waveform_picker_regs->burst_enable = 0x20; // [0010 0000] f1 burst enabled |
|
1036 | 942 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0 |
|
1037 | 943 | break; |
|
1038 | 944 | case(LFR_MODE_SBM2): |
|
1039 | 945 | waveform_picker_regs->burst_enable = 0x40; // [0100 0000] f2 burst enabled |
|
1040 | 946 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0 |
|
1041 | 947 | break; |
|
1042 | 948 | default: |
|
1043 | 949 | waveform_picker_regs->burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled |
|
1044 | 950 | break; |
|
1045 | 951 | } |
|
1046 | 952 | #endif |
|
1047 | 953 | } |
|
1048 | 954 | |
|
1049 | 955 | void reset_wfp_burst_enable() |
|
1050 | 956 | { |
|
1051 | 957 | /** This function resets the waveform picker burst_enable register. |
|
1052 | 958 | * |
|
1053 | 959 | * The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0. |
|
1054 | 960 | * |
|
1055 | 961 | */ |
|
1056 | 962 | |
|
1057 | 963 | #ifdef GSA |
|
1058 | 964 | #else |
|
1059 | 965 | waveform_picker_regs->burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 |
|
1060 | 966 | #endif |
|
1061 | 967 | } |
|
1062 | 968 | |
|
1063 | 969 | void reset_wfp_status() |
|
1064 | 970 | { |
|
1065 | 971 | /** This function resets the waveform picker status register. |
|
1066 | 972 | * |
|
1067 | 973 | * All status bits are set to 0 [new_err full_err full]. |
|
1068 | 974 | * |
|
1069 | 975 | */ |
|
1070 | 976 | |
|
1071 | 977 | #ifdef GSA |
|
1072 | 978 | #else |
|
1073 | 979 | waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 |
|
1074 | 980 | #endif |
|
1075 | 981 | } |
|
1076 | 982 | |
|
1077 | 983 | void reset_waveform_picker_regs() |
|
1078 | 984 | { |
|
1079 | 985 | /** This function resets the waveform picker module registers. |
|
1080 | 986 | * |
|
1081 | 987 | * The registers affected by this function are located at the following offset addresses: |
|
1082 | 988 | * - 0x00 data_shaping |
|
1083 | 989 | * - 0x04 burst_enable |
|
1084 | 990 | * - 0x08 addr_data_f0 |
|
1085 | 991 | * - 0x0C addr_data_f1 |
|
1086 | 992 | * - 0x10 addr_data_f2 |
|
1087 | 993 | * - 0x14 addr_data_f3 |
|
1088 | 994 | * - 0x18 status |
|
1089 | 995 | * - 0x1C delta_snapshot |
|
1090 | 996 | * - 0x20 delta_f2_f1 |
|
1091 | 997 | * - 0x24 delta_f2_f0 |
|
1092 | 998 | * - 0x28 nb_burst |
|
1093 | 999 | * - 0x2C nb_snapshot |
|
1094 | 1000 | * |
|
1095 | 1001 | */ |
|
1096 | 1002 | |
|
1097 | 1003 | #ifdef GSA |
|
1098 | 1004 | #else |
|
1099 | 1005 | reset_wfp_burst_enable(); |
|
1100 | 1006 | reset_wfp_status(); |
|
1101 | 1007 | // set buffer addresses |
|
1102 |
waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); |
|
|
1103 |
waveform_picker_regs->addr_data_f1 = |
|
|
1104 |
waveform_picker_regs->addr_data_f2 = |
|
|
1105 |
waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); |
|
|
1008 | waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); | |
|
1009 | waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; | |
|
1010 | waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; | |
|
1011 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); | |
|
1106 | 1012 | // set other parameters |
|
1107 | 1013 | set_wfp_data_shaping(); |
|
1108 | 1014 | set_wfp_delta_snapshot(); // time in seconds between two snapshots |
|
1109 | 1015 | waveform_picker_regs->delta_f2_f1 = 0xffff; // 0x16800 => 92160 (max 4 bytes) |
|
1110 | 1016 | waveform_picker_regs->delta_f2_f0 = 0x17c00; // 97 280 (max 5 bytes) |
|
1111 | 1017 | waveform_picker_regs->nb_burst_available = 0x180; // max 3 bytes, size of the buffer in burst (1 burst = 16 x 4 octets) |
|
1112 | 1018 | waveform_picker_regs->nb_snapshot_param = 0x7ff; // max 3 octets, 2048 - 1 |
|
1113 | 1019 | #endif |
|
1114 | 1020 | } |
|
1115 | 1021 | |
|
1116 | 1022 | //***************** |
|
1117 | 1023 | // local parameters |
|
1118 | 1024 | void set_local_sbm1_nb_cwf_max( void ) |
|
1119 | 1025 | { |
|
1120 | 1026 | /** This function sets the value of the sbm1_nb_cwf_max local parameter. |
|
1121 | 1027 | * |
|
1122 | 1028 | * The sbm1_nb_cwf_max parameter counts the number of CWF_F1 records that have been sent.\n |
|
1123 | 1029 | * This parameter is used to send CWF_F1 data as normal data when the SBM1 is active.\n\n |
|
1124 | 1030 | * (2 snapshots of 2048 points per seconds) * (period of the NORM snashots) - 8 s (duration of the f2 snapshot) |
|
1125 | 1031 | * |
|
1126 | 1032 | */ |
|
1127 | 1033 | param_local.local_sbm1_nb_cwf_max = 2 * |
|
1128 | 1034 | (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256 |
|
1129 | 1035 | + parameter_dump_packet.sy_lfr_n_swf_p[1]) - 8; // 16 CWF1 parts during 1 SWF2 |
|
1130 | 1036 | } |
|
1131 | 1037 | |
|
1132 | 1038 | void set_local_sbm2_nb_cwf_max(void) |
|
1133 | 1039 | { |
|
1134 | 1040 | /** This function sets the value of the sbm1_nb_cwf_max local parameter. |
|
1135 | 1041 | * |
|
1136 | 1042 | * The sbm1_nb_cwf_max parameter counts the number of CWF_F1 records that have been sent.\n |
|
1137 | 1043 | * This parameter is used to send CWF_F2 data as normal data when the SBM2 is active.\n\n |
|
1138 | 1044 | * (period of the NORM snashots) / (8 seconds per snapshot at f2 = 256 Hz) |
|
1139 | 1045 | * |
|
1140 | 1046 | */ |
|
1141 | 1047 | |
|
1142 | 1048 | param_local.local_sbm2_nb_cwf_max = (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256 |
|
1143 | 1049 | + parameter_dump_packet.sy_lfr_n_swf_p[1]) / 8; |
|
1144 | 1050 | } |
|
1145 | 1051 | |
|
1146 | 1052 | void set_local_nb_interrupt_f0_MAX( void ) |
|
1147 | 1053 | { |
|
1148 | 1054 | /** This function sets the value of the nb_interrupt_f0_MAX local parameter. |
|
1149 | 1055 | * |
|
1150 | 1056 | * This parameter is used for the SM validation only.\n |
|
1151 | 1057 | * The software waits param_local.local_nb_interrupt_f0_MAX interruptions from the spectral matrices |
|
1152 | 1058 | * module before launching a basic processing. |
|
1153 | 1059 | * |
|
1154 | 1060 | */ |
|
1155 | 1061 | |
|
1156 | 1062 | param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256 |
|
1157 | 1063 | + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100; |
|
1158 | 1064 | } |
|
1159 | 1065 | |
|
1160 | 1066 | void reset_local_sbm1_nb_cwf_sent( void ) |
|
1161 | 1067 | { |
|
1162 | 1068 | /** This function resets the value of the sbm1_nb_cwf_sent local parameter. |
|
1163 | 1069 | * |
|
1164 | 1070 | * The sbm1_nb_cwf_sent parameter counts the number of CWF_F1 records that have been sent.\n |
|
1165 | 1071 | * This parameter is used to send CWF_F1 data as normal data when the SBM1 is active. |
|
1166 | 1072 | * |
|
1167 | 1073 | */ |
|
1168 | 1074 | |
|
1169 | 1075 | param_local.local_sbm1_nb_cwf_sent = 0; |
|
1170 | 1076 | } |
|
1171 | 1077 | |
|
1172 | 1078 | void reset_local_sbm2_nb_cwf_sent( void ) |
|
1173 | 1079 | { |
|
1174 | 1080 | /** This function resets the value of the sbm2_nb_cwf_sent local parameter. |
|
1175 | 1081 | * |
|
1176 | 1082 | * The sbm2_nb_cwf_sent parameter counts the number of CWF_F2 records that have been sent.\n |
|
1177 | 1083 | * This parameter is used to send CWF_F2 data as normal data when the SBM2 mode is active. |
|
1178 | 1084 | * |
|
1179 | 1085 | */ |
|
1180 | 1086 | |
|
1181 | 1087 | param_local.local_sbm2_nb_cwf_sent = 0; |
|
1182 | 1088 | } |
|
1183 | 1089 | |
|
1184 | 1090 | void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ) |
|
1185 | 1091 | { |
|
1186 | 1092 | unsigned short *sequence_cnt; |
|
1187 | 1093 | unsigned short segmentation_grouping_flag; |
|
1188 | 1094 | unsigned short new_packet_sequence_control; |
|
1189 | 1095 | |
|
1190 | 1096 | if ( (sid ==SID_NORM_SWF_F0) || (sid ==SID_NORM_SWF_F1) || (sid ==SID_NORM_SWF_F2) |
|
1191 | 1097 | || (sid ==SID_NORM_CWF_F3) || (sid ==SID_BURST_CWF_F2) ) |
|
1192 | 1098 | { |
|
1193 | 1099 | sequence_cnt = &sequenceCounters_SCIENCE_NORMAL_BURST; |
|
1194 | 1100 | } |
|
1195 | 1101 | else if ( (sid ==SID_SBM1_CWF_F1) || (sid ==SID_SBM2_CWF_F2) ) |
|
1196 | 1102 | { |
|
1197 | 1103 | sequence_cnt = &sequenceCounters_SCIENCE_SBM1_SBM2; |
|
1198 | 1104 | } |
|
1199 | 1105 | else |
|
1200 | 1106 | { |
|
1201 | 1107 | sequence_cnt = NULL; |
|
1202 | 1108 | PRINTF1("in increment_seq_counter_source_id *** ERR apid_destid %d not known\n", sid) |
|
1203 | 1109 | } |
|
1204 | 1110 | |
|
1205 | 1111 | if (sequence_cnt != NULL) |
|
1206 | 1112 | { |
|
1207 | 1113 | segmentation_grouping_flag = (packet_sequence_control[ 0 ] & 0xc0) << 8; |
|
1208 | 1114 | *sequence_cnt = (*sequence_cnt) & 0x3fff; |
|
1209 | 1115 | |
|
1210 | 1116 | new_packet_sequence_control = segmentation_grouping_flag | *sequence_cnt ; |
|
1211 | 1117 | |
|
1212 | 1118 | packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8); |
|
1213 | 1119 | packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control ); |
|
1214 | 1120 | |
|
1215 | 1121 | // increment the sequence counter for the next packet |
|
1216 | 1122 | if ( *sequence_cnt < SEQ_CNT_MAX) |
|
1217 | 1123 | { |
|
1218 | 1124 | *sequence_cnt = *sequence_cnt + 1; |
|
1219 | 1125 | } |
|
1220 | 1126 | else |
|
1221 | 1127 | { |
|
1222 | 1128 | *sequence_cnt = 0; |
|
1223 | 1129 | } |
|
1224 | 1130 | } |
|
1225 | 1131 | } |
General Comments 0
You need to be logged in to leave comments.
Login now