##// END OF EJS Templates
Sync
paul -
r115:f4c5e8b9b4cc VHDLib206
parent child
Show More
@@ -1,253 +1,253
1 #############################################################################
1 #############################################################################
2 # Makefile for building: bin/fsw
2 # Makefile for building: bin/fsw
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Apr 3 10:09:31 2014
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Apr 3 13:43:01 2014
4 # Project: fsw-qt.pro
4 # Project: fsw-qt.pro
5 # Template: app
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++ -o Makefile fsw-qt.pro
7 #############################################################################
7 #############################################################################
8
8
9 ####### Compiler, tools and options
9 ####### Compiler, tools and options
10
10
11 CC = sparc-rtems-gcc
11 CC = sparc-rtems-gcc
12 CXX = sparc-rtems-g++
12 CXX = sparc-rtems-g++
13 DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=5 -DPRINT_MESSAGES_ON_CONSOLE
13 DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=6 -DPRINT_MESSAGES_ON_CONSOLE -DPRINT_TASK_STATISTICS
14 CFLAGS = -pipe -O3 -Wall $(DEFINES)
14 CFLAGS = -pipe -O3 -Wall $(DEFINES)
15 CXXFLAGS = -pipe -O3 -Wall $(DEFINES)
15 CXXFLAGS = -pipe -O3 -Wall $(DEFINES)
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../../LFR_basic-parameters
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../../LFR_basic-parameters
17 LINK = sparc-rtems-g++
17 LINK = sparc-rtems-g++
18 LFLAGS =
18 LFLAGS =
19 LIBS = $(SUBLIBS)
19 LIBS = $(SUBLIBS)
20 AR = sparc-rtems-ar rcs
20 AR = sparc-rtems-ar rcs
21 RANLIB =
21 RANLIB =
22 QMAKE = /usr/bin/qmake-qt4
22 QMAKE = /usr/bin/qmake-qt4
23 TAR = tar -cf
23 TAR = tar -cf
24 COMPRESS = gzip -9f
24 COMPRESS = gzip -9f
25 COPY = cp -f
25 COPY = cp -f
26 SED = sed
26 SED = sed
27 COPY_FILE = $(COPY)
27 COPY_FILE = $(COPY)
28 COPY_DIR = $(COPY) -r
28 COPY_DIR = $(COPY) -r
29 STRIP = sparc-rtems-strip
29 STRIP = sparc-rtems-strip
30 INSTALL_FILE = install -m 644 -p
30 INSTALL_FILE = install -m 644 -p
31 INSTALL_DIR = $(COPY_DIR)
31 INSTALL_DIR = $(COPY_DIR)
32 INSTALL_PROGRAM = install -m 755 -p
32 INSTALL_PROGRAM = install -m 755 -p
33 DEL_FILE = rm -f
33 DEL_FILE = rm -f
34 SYMLINK = ln -f -s
34 SYMLINK = ln -f -s
35 DEL_DIR = rmdir
35 DEL_DIR = rmdir
36 MOVE = mv -f
36 MOVE = mv -f
37 CHK_DIR_EXISTS= test -d
37 CHK_DIR_EXISTS= test -d
38 MKDIR = mkdir -p
38 MKDIR = mkdir -p
39
39
40 ####### Output directory
40 ####### Output directory
41
41
42 OBJECTS_DIR = obj/
42 OBJECTS_DIR = obj/
43
43
44 ####### Files
44 ####### Files
45
45
46 SOURCES = ../src/wf_handler.c \
46 SOURCES = ../src/wf_handler.c \
47 ../src/tc_handler.c \
47 ../src/tc_handler.c \
48 ../src/fsw_processing.c \
48 ../src/fsw_processing.c \
49 ../src/fsw_misc.c \
49 ../src/fsw_misc.c \
50 ../src/fsw_init.c \
50 ../src/fsw_init.c \
51 ../src/fsw_globals.c \
51 ../src/fsw_globals.c \
52 ../src/fsw_spacewire.c \
52 ../src/fsw_spacewire.c \
53 ../src/tc_load_dump_parameters.c \
53 ../src/tc_load_dump_parameters.c \
54 ../src/tm_lfr_tc_exe.c \
54 ../src/tm_lfr_tc_exe.c \
55 ../src/tc_acceptance.c \
55 ../src/tc_acceptance.c \
56 ../../LFR_basic-parameters/basic_parameters.c
56 ../../LFR_basic-parameters/basic_parameters.c
57 OBJECTS = obj/wf_handler.o \
57 OBJECTS = obj/wf_handler.o \
58 obj/tc_handler.o \
58 obj/tc_handler.o \
59 obj/fsw_processing.o \
59 obj/fsw_processing.o \
60 obj/fsw_misc.o \
60 obj/fsw_misc.o \
61 obj/fsw_init.o \
61 obj/fsw_init.o \
62 obj/fsw_globals.o \
62 obj/fsw_globals.o \
63 obj/fsw_spacewire.o \
63 obj/fsw_spacewire.o \
64 obj/tc_load_dump_parameters.o \
64 obj/tc_load_dump_parameters.o \
65 obj/tm_lfr_tc_exe.o \
65 obj/tm_lfr_tc_exe.o \
66 obj/tc_acceptance.o \
66 obj/tc_acceptance.o \
67 obj/basic_parameters.o
67 obj/basic_parameters.o
68 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
68 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
69 /usr/lib64/qt4/mkspecs/common/linux.conf \
69 /usr/lib64/qt4/mkspecs/common/linux.conf \
70 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
70 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
71 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
71 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
72 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
72 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
73 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
73 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
74 /usr/lib64/qt4/mkspecs/qconfig.pri \
74 /usr/lib64/qt4/mkspecs/qconfig.pri \
75 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
75 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
76 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
76 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
77 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
77 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
78 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
78 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
79 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
79 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
80 sparc.pri \
80 sparc.pri \
81 /usr/lib64/qt4/mkspecs/features/release.prf \
81 /usr/lib64/qt4/mkspecs/features/release.prf \
82 /usr/lib64/qt4/mkspecs/features/default_post.prf \
82 /usr/lib64/qt4/mkspecs/features/default_post.prf \
83 /usr/lib64/qt4/mkspecs/features/shared.prf \
83 /usr/lib64/qt4/mkspecs/features/shared.prf \
84 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
84 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
85 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
85 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
86 /usr/lib64/qt4/mkspecs/features/resources.prf \
86 /usr/lib64/qt4/mkspecs/features/resources.prf \
87 /usr/lib64/qt4/mkspecs/features/uic.prf \
87 /usr/lib64/qt4/mkspecs/features/uic.prf \
88 /usr/lib64/qt4/mkspecs/features/yacc.prf \
88 /usr/lib64/qt4/mkspecs/features/yacc.prf \
89 /usr/lib64/qt4/mkspecs/features/lex.prf \
89 /usr/lib64/qt4/mkspecs/features/lex.prf \
90 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
90 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
91 fsw-qt.pro
91 fsw-qt.pro
92 QMAKE_TARGET = fsw
92 QMAKE_TARGET = fsw
93 DESTDIR = bin/
93 DESTDIR = bin/
94 TARGET = bin/fsw
94 TARGET = bin/fsw
95
95
96 first: all
96 first: all
97 ####### Implicit rules
97 ####### Implicit rules
98
98
99 .SUFFIXES: .o .c .cpp .cc .cxx .C
99 .SUFFIXES: .o .c .cpp .cc .cxx .C
100
100
101 .cpp.o:
101 .cpp.o:
102 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
102 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
103
103
104 .cc.o:
104 .cc.o:
105 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
105 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
106
106
107 .cxx.o:
107 .cxx.o:
108 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
108 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
109
109
110 .C.o:
110 .C.o:
111 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
111 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
112
112
113 .c.o:
113 .c.o:
114 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
114 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
115
115
116 ####### Build rules
116 ####### Build rules
117
117
118 all: Makefile $(TARGET)
118 all: Makefile $(TARGET)
119
119
120 $(TARGET): $(OBJECTS)
120 $(TARGET): $(OBJECTS)
121 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
121 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
122 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
122 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
123
123
124 Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
124 Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
125 /usr/lib64/qt4/mkspecs/common/linux.conf \
125 /usr/lib64/qt4/mkspecs/common/linux.conf \
126 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
126 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
127 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
127 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
128 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
128 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
129 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
129 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
130 /usr/lib64/qt4/mkspecs/qconfig.pri \
130 /usr/lib64/qt4/mkspecs/qconfig.pri \
131 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
131 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
132 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
132 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
133 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
133 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
134 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
134 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
135 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
135 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
136 sparc.pri \
136 sparc.pri \
137 /usr/lib64/qt4/mkspecs/features/release.prf \
137 /usr/lib64/qt4/mkspecs/features/release.prf \
138 /usr/lib64/qt4/mkspecs/features/default_post.prf \
138 /usr/lib64/qt4/mkspecs/features/default_post.prf \
139 /usr/lib64/qt4/mkspecs/features/shared.prf \
139 /usr/lib64/qt4/mkspecs/features/shared.prf \
140 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
140 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
141 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
141 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
142 /usr/lib64/qt4/mkspecs/features/resources.prf \
142 /usr/lib64/qt4/mkspecs/features/resources.prf \
143 /usr/lib64/qt4/mkspecs/features/uic.prf \
143 /usr/lib64/qt4/mkspecs/features/uic.prf \
144 /usr/lib64/qt4/mkspecs/features/yacc.prf \
144 /usr/lib64/qt4/mkspecs/features/yacc.prf \
145 /usr/lib64/qt4/mkspecs/features/lex.prf \
145 /usr/lib64/qt4/mkspecs/features/lex.prf \
146 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf
146 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf
147 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
147 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
148 /usr/lib64/qt4/mkspecs/common/unix.conf:
148 /usr/lib64/qt4/mkspecs/common/unix.conf:
149 /usr/lib64/qt4/mkspecs/common/linux.conf:
149 /usr/lib64/qt4/mkspecs/common/linux.conf:
150 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
150 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
151 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
151 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
152 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
152 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
153 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
153 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
154 /usr/lib64/qt4/mkspecs/qconfig.pri:
154 /usr/lib64/qt4/mkspecs/qconfig.pri:
155 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
155 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
156 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
156 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
157 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
157 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
158 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
158 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
159 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
159 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
160 sparc.pri:
160 sparc.pri:
161 /usr/lib64/qt4/mkspecs/features/release.prf:
161 /usr/lib64/qt4/mkspecs/features/release.prf:
162 /usr/lib64/qt4/mkspecs/features/default_post.prf:
162 /usr/lib64/qt4/mkspecs/features/default_post.prf:
163 /usr/lib64/qt4/mkspecs/features/shared.prf:
163 /usr/lib64/qt4/mkspecs/features/shared.prf:
164 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
164 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
165 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
165 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
166 /usr/lib64/qt4/mkspecs/features/resources.prf:
166 /usr/lib64/qt4/mkspecs/features/resources.prf:
167 /usr/lib64/qt4/mkspecs/features/uic.prf:
167 /usr/lib64/qt4/mkspecs/features/uic.prf:
168 /usr/lib64/qt4/mkspecs/features/yacc.prf:
168 /usr/lib64/qt4/mkspecs/features/yacc.prf:
169 /usr/lib64/qt4/mkspecs/features/lex.prf:
169 /usr/lib64/qt4/mkspecs/features/lex.prf:
170 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
170 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
171 qmake: FORCE
171 qmake: FORCE
172 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
172 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
173
173
174 dist:
174 dist:
175 @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0
175 @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0
176 $(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
176 $(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
177
177
178
178
179 clean:compiler_clean
179 clean:compiler_clean
180 -$(DEL_FILE) $(OBJECTS)
180 -$(DEL_FILE) $(OBJECTS)
181 -$(DEL_FILE) *~ core *.core
181 -$(DEL_FILE) *~ core *.core
182
182
183
183
184 ####### Sub-libraries
184 ####### Sub-libraries
185
185
186 distclean: clean
186 distclean: clean
187 -$(DEL_FILE) $(TARGET)
187 -$(DEL_FILE) $(TARGET)
188 -$(DEL_FILE) Makefile
188 -$(DEL_FILE) Makefile
189
189
190
190
191 grmon:
191 grmon:
192 cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u
192 cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u
193
193
194 check: first
194 check: first
195
195
196 compiler_rcc_make_all:
196 compiler_rcc_make_all:
197 compiler_rcc_clean:
197 compiler_rcc_clean:
198 compiler_uic_make_all:
198 compiler_uic_make_all:
199 compiler_uic_clean:
199 compiler_uic_clean:
200 compiler_image_collection_make_all: qmake_image_collection.cpp
200 compiler_image_collection_make_all: qmake_image_collection.cpp
201 compiler_image_collection_clean:
201 compiler_image_collection_clean:
202 -$(DEL_FILE) qmake_image_collection.cpp
202 -$(DEL_FILE) qmake_image_collection.cpp
203 compiler_yacc_decl_make_all:
203 compiler_yacc_decl_make_all:
204 compiler_yacc_decl_clean:
204 compiler_yacc_decl_clean:
205 compiler_yacc_impl_make_all:
205 compiler_yacc_impl_make_all:
206 compiler_yacc_impl_clean:
206 compiler_yacc_impl_clean:
207 compiler_lex_make_all:
207 compiler_lex_make_all:
208 compiler_lex_clean:
208 compiler_lex_clean:
209 compiler_clean:
209 compiler_clean:
210
210
211 ####### Compile
211 ####### Compile
212
212
213 obj/wf_handler.o: ../src/wf_handler.c
213 obj/wf_handler.o: ../src/wf_handler.c
214 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c
214 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c
215
215
216 obj/tc_handler.o: ../src/tc_handler.c
216 obj/tc_handler.o: ../src/tc_handler.c
217 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c
217 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c
218
218
219 obj/fsw_processing.o: ../src/fsw_processing.c ../src/fsw_processing_globals.c
219 obj/fsw_processing.o: ../src/fsw_processing.c ../src/fsw_processing_globals.c
220 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c
220 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c
221
221
222 obj/fsw_misc.o: ../src/fsw_misc.c
222 obj/fsw_misc.o: ../src/fsw_misc.c
223 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c
223 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c
224
224
225 obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c
225 obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c
226 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c
226 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c
227
227
228 obj/fsw_globals.o: ../src/fsw_globals.c
228 obj/fsw_globals.o: ../src/fsw_globals.c
229 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c
229 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c
230
230
231 obj/fsw_spacewire.o: ../src/fsw_spacewire.c
231 obj/fsw_spacewire.o: ../src/fsw_spacewire.c
232 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c
232 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c
233
233
234 obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c
234 obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c
235 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c
235 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c
236
236
237 obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c
237 obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c
238 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c
238 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c
239
239
240 obj/tc_acceptance.o: ../src/tc_acceptance.c
240 obj/tc_acceptance.o: ../src/tc_acceptance.c
241 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c
241 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c
242
242
243 obj/basic_parameters.o: ../../LFR_basic-parameters/basic_parameters.c ../../LFR_basic-parameters/basic_parameters.h
243 obj/basic_parameters.o: ../../LFR_basic-parameters/basic_parameters.c ../../LFR_basic-parameters/basic_parameters.h
244 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/basic_parameters.o ../../LFR_basic-parameters/basic_parameters.c
244 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/basic_parameters.o ../../LFR_basic-parameters/basic_parameters.c
245
245
246 ####### Install
246 ####### Install
247
247
248 install: FORCE
248 install: FORCE
249
249
250 uninstall: FORCE
250 uninstall: FORCE
251
251
252 FORCE:
252 FORCE:
253
253
@@ -1,85 +1,85
1 TEMPLATE = app
1 TEMPLATE = app
2 # CONFIG += console v8 sim
2 # CONFIG += console v8 sim
3 # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** vhdl_dev *** debug_tch
3 # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** vhdl_dev *** debug_tch
4 CONFIG += console verbose
4 CONFIG += console verbose cpu_usage_report
5 CONFIG -= qt
5 CONFIG -= qt
6
6
7 include(./sparc.pri)
7 include(./sparc.pri)
8
8
9 # flight software version
9 # flight software version
10 SWVERSION=-1-0
10 SWVERSION=-1-0
11 DEFINES += SW_VERSION_N1=1 # major
11 DEFINES += SW_VERSION_N1=1 # major
12 DEFINES += SW_VERSION_N2=0 # minor
12 DEFINES += SW_VERSION_N2=0 # minor
13 DEFINES += SW_VERSION_N3=0 # patch
13 DEFINES += SW_VERSION_N3=0 # patch
14 DEFINES += SW_VERSION_N4=5 # internal
14 DEFINES += SW_VERSION_N4=6 # internal
15
15
16 contains( CONFIG, debug_tch ) {
16 contains( CONFIG, debug_tch ) {
17 DEFINES += DEBUG_TCH
17 DEFINES += DEBUG_TCH
18 }
18 }
19
19
20 contains( CONFIG, vhdl_dev ) {
20 contains( CONFIG, vhdl_dev ) {
21 DEFINES += VHDL_DEV
21 DEFINES += VHDL_DEV
22 }
22 }
23
23
24 contains( CONFIG, verbose ) {
24 contains( CONFIG, verbose ) {
25 DEFINES += PRINT_MESSAGES_ON_CONSOLE
25 DEFINES += PRINT_MESSAGES_ON_CONSOLE
26 }
26 }
27
27
28 contains( CONFIG, debug_messages ) {
28 contains( CONFIG, debug_messages ) {
29 DEFINES += DEBUG_MESSAGES
29 DEFINES += DEBUG_MESSAGES
30 }
30 }
31
31
32 contains( CONFIG, cpu_usage_report ) {
32 contains( CONFIG, cpu_usage_report ) {
33 DEFINES += PRINT_TASK_STATISTICS
33 DEFINES += PRINT_TASK_STATISTICS
34 }
34 }
35
35
36 contains( CONFIG, stack_report ) {
36 contains( CONFIG, stack_report ) {
37 DEFINES += PRINT_STACK_REPORT
37 DEFINES += PRINT_STACK_REPORT
38 }
38 }
39
39
40 contains( CONFIG, boot_messages ) {
40 contains( CONFIG, boot_messages ) {
41 DEFINES += BOOT_MESSAGES
41 DEFINES += BOOT_MESSAGES
42 }
42 }
43
43
44 #doxygen.target = doxygen
44 #doxygen.target = doxygen
45 #doxygen.commands = doxygen ../doc/Doxyfile
45 #doxygen.commands = doxygen ../doc/Doxyfile
46 #QMAKE_EXTRA_TARGETS += doxygen
46 #QMAKE_EXTRA_TARGETS += doxygen
47
47
48 TARGET = fsw
48 TARGET = fsw
49
49
50 INCLUDEPATH += \
50 INCLUDEPATH += \
51 ../src \
51 ../src \
52 ../header \
52 ../header \
53 ../../LFR_basic-parameters
53 ../../LFR_basic-parameters
54
54
55 SOURCES += \
55 SOURCES += \
56 ../src/wf_handler.c \
56 ../src/wf_handler.c \
57 ../src/tc_handler.c \
57 ../src/tc_handler.c \
58 ../src/fsw_processing.c \
58 ../src/fsw_processing.c \
59 ../src/fsw_misc.c \
59 ../src/fsw_misc.c \
60 ../src/fsw_init.c \
60 ../src/fsw_init.c \
61 ../src/fsw_globals.c \
61 ../src/fsw_globals.c \
62 ../src/fsw_spacewire.c \
62 ../src/fsw_spacewire.c \
63 ../src/tc_load_dump_parameters.c \
63 ../src/tc_load_dump_parameters.c \
64 ../src/tm_lfr_tc_exe.c \
64 ../src/tm_lfr_tc_exe.c \
65 ../src/tc_acceptance.c \
65 ../src/tc_acceptance.c \
66 ../../LFR_basic-parameters/basic_parameters.c
66 ../../LFR_basic-parameters/basic_parameters.c
67
67
68
68
69 HEADERS += \
69 HEADERS += \
70 ../header/wf_handler.h \
70 ../header/wf_handler.h \
71 ../header/tc_handler.h \
71 ../header/tc_handler.h \
72 ../header/grlib_regs.h \
72 ../header/grlib_regs.h \
73 ../header/fsw_processing.h \
73 ../header/fsw_processing.h \
74 ../header/fsw_params.h \
74 ../header/fsw_params.h \
75 ../header/fsw_misc.h \
75 ../header/fsw_misc.h \
76 ../header/fsw_init.h \
76 ../header/fsw_init.h \
77 ../header/ccsds_types.h \
77 ../header/ccsds_types.h \
78 ../header/fsw_params_processing.h \
78 ../header/fsw_params_processing.h \
79 ../header/fsw_spacewire.h \
79 ../header/fsw_spacewire.h \
80 ../header/tc_load_dump_parameters.h \
80 ../header/tc_load_dump_parameters.h \
81 ../header/tm_lfr_tc_exe.h \
81 ../header/tm_lfr_tc_exe.h \
82 ../header/tc_acceptance.h \
82 ../header/tc_acceptance.h \
83 ../header/fsw_params_nb_bytes.h \
83 ../header/fsw_params_nb_bytes.h \
84 ../../LFR_basic-parameters/basic_parameters.h
84 ../../LFR_basic-parameters/basic_parameters.h
85
85
@@ -1,339 +1,339
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE QtCreatorProject>
2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by QtCreator 3.0.1, 2014-04-03T08:17:16. -->
3 <!-- Written by QtCreator 3.0.1, 2014-04-03T15:58:50. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
7 <value type="int">1</value>
7 <value type="int">1</value>
8 </data>
8 </data>
9 <data>
9 <data>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
11 <valuemap type="QVariantMap">
11 <valuemap type="QVariantMap">
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
14 <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
14 <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
15 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
15 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
16 <value type="QString" key="language">Cpp</value>
16 <value type="QString" key="language">Cpp</value>
17 <valuemap type="QVariantMap" key="value">
17 <valuemap type="QVariantMap" key="value">
18 <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
18 <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
19 </valuemap>
19 </valuemap>
20 </valuemap>
20 </valuemap>
21 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
21 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
22 <value type="QString" key="language">QmlJS</value>
22 <value type="QString" key="language">QmlJS</value>
23 <valuemap type="QVariantMap" key="value">
23 <valuemap type="QVariantMap" key="value">
24 <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
24 <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
25 </valuemap>
25 </valuemap>
26 </valuemap>
26 </valuemap>
27 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
27 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
28 <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
28 <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
29 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
29 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
30 <value type="int" key="EditorConfiguration.IndentSize">4</value>
30 <value type="int" key="EditorConfiguration.IndentSize">4</value>
31 <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
31 <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
32 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
32 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
33 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
33 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
34 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
34 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
35 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
35 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
36 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
36 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
37 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
37 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
38 <value type="int" key="EditorConfiguration.TabSize">8</value>
38 <value type="int" key="EditorConfiguration.TabSize">8</value>
39 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
39 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
40 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
40 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
41 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
41 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
42 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
42 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
43 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
43 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
44 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
44 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
45 </valuemap>
45 </valuemap>
46 </data>
46 </data>
47 <data>
47 <data>
48 <variable>ProjectExplorer.Project.PluginSettings</variable>
48 <variable>ProjectExplorer.Project.PluginSettings</variable>
49 <valuemap type="QVariantMap"/>
49 <valuemap type="QVariantMap"/>
50 </data>
50 </data>
51 <data>
51 <data>
52 <variable>ProjectExplorer.Project.Target.0</variable>
52 <variable>ProjectExplorer.Project.Target.0</variable>
53 <valuemap type="QVariantMap">
53 <valuemap type="QVariantMap">
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
55 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
55 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
56 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{e04e3924-0bd8-4708-be18-f1474e45608e}</value>
56 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{e04e3924-0bd8-4708-be18-f1474e45608e}</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
58 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
58 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
59 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
59 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
60 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
60 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
61 <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value>
61 <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value>
62 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
62 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
63 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
63 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
64 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
64 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
65 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
65 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
66 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
66 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
67 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
67 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
68 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
68 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
69 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
69 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
70 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
70 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
71 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
71 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
72 </valuemap>
72 </valuemap>
73 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
73 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
74 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
74 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
75 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
75 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
76 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
76 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
77 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
77 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
78 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
78 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
79 <value type="QString">-w</value>
79 <value type="QString">-w</value>
80 <value type="QString">-r</value>
80 <value type="QString">-r</value>
81 </valuelist>
81 </valuelist>
82 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
82 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
83 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
83 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
84 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
84 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
85 </valuemap>
85 </valuemap>
86 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
86 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
88 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
88 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
89 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
89 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
90 </valuemap>
90 </valuemap>
91 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
91 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
92 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
92 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
93 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
93 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
96 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
96 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
97 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
97 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
98 <value type="QString">-w</value>
98 <value type="QString">-w</value>
99 <value type="QString">-r</value>
99 <value type="QString">-r</value>
100 </valuelist>
100 </valuelist>
101 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
101 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
102 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
102 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
103 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
103 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
104 </valuemap>
104 </valuemap>
105 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
105 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
106 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
106 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
107 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
107 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
108 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
108 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
109 </valuemap>
109 </valuemap>
110 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
110 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
111 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
111 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
112 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
112 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
115 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
115 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
116 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
116 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
117 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
117 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
118 </valuemap>
118 </valuemap>
119 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
119 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
120 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
120 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
121 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
121 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
122 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
122 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
124 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
124 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
125 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
125 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
126 </valuemap>
126 </valuemap>
127 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
127 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
128 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
128 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
129 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
129 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
130 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
130 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
131 </valuemap>
131 </valuemap>
132 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
132 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
133 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
133 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
134 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
134 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
135 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
135 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
136 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
136 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
137 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
137 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
138 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
138 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
139 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
139 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
140 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
140 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
141 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
141 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
142 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
142 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
143 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
143 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
144 <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
144 <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
145 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
145 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
146 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
146 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
147 <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
147 <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
148 <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
148 <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
149 <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
149 <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
150 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
150 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
151 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
151 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
152 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
152 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
153 <value type="int">0</value>
153 <value type="int">0</value>
154 <value type="int">1</value>
154 <value type="int">1</value>
155 <value type="int">2</value>
155 <value type="int">2</value>
156 <value type="int">3</value>
156 <value type="int">3</value>
157 <value type="int">4</value>
157 <value type="int">4</value>
158 <value type="int">5</value>
158 <value type="int">5</value>
159 <value type="int">6</value>
159 <value type="int">6</value>
160 <value type="int">7</value>
160 <value type="int">7</value>
161 <value type="int">8</value>
161 <value type="int">8</value>
162 <value type="int">9</value>
162 <value type="int">9</value>
163 <value type="int">10</value>
163 <value type="int">10</value>
164 <value type="int">11</value>
164 <value type="int">11</value>
165 <value type="int">12</value>
165 <value type="int">12</value>
166 <value type="int">13</value>
166 <value type="int">13</value>
167 <value type="int">14</value>
167 <value type="int">14</value>
168 </valuelist>
168 </valuelist>
169 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
169 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
170 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
170 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
171 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
171 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
172 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
172 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
173 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
173 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
174 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
174 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
175 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
175 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
176 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
176 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
177 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
177 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
178 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
178 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
179 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
179 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
180 <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
180 <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
181 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
181 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
182 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
182 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
183 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
183 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
184 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
184 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
185 </valuemap>
185 </valuemap>
186 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
186 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
187 </valuemap>
187 </valuemap>
188 </data>
188 </data>
189 <data>
189 <data>
190 <variable>ProjectExplorer.Project.Target.1</variable>
190 <variable>ProjectExplorer.Project.Target.1</variable>
191 <valuemap type="QVariantMap">
191 <valuemap type="QVariantMap">
192 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
192 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
193 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
193 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
194 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value>
194 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value>
195 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
195 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
196 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
196 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
197 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
197 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
198 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
198 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
199 <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value>
199 <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value>
200 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
200 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
201 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
201 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
202 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
202 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
203 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
203 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
204 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
204 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
205 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
205 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
206 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
206 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
207 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
207 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
208 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
208 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
209 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
209 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
210 </valuemap>
210 </valuemap>
211 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
211 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
212 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
212 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
213 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
213 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
214 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
214 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
215 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
215 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
216 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
216 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
217 <value type="QString">-w</value>
217 <value type="QString">-w</value>
218 <value type="QString">-r</value>
218 <value type="QString">-r</value>
219 </valuelist>
219 </valuelist>
220 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
220 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
221 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
221 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
222 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
222 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
223 </valuemap>
223 </valuemap>
224 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
224 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
225 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
225 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
226 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
226 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
227 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
227 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
228 </valuemap>
228 </valuemap>
229 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
229 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
230 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
230 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
231 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
231 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
232 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
232 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
233 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
233 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
234 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
234 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
235 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
235 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
236 <value type="QString">-w</value>
236 <value type="QString">-w</value>
237 <value type="QString">-r</value>
237 <value type="QString">-r</value>
238 </valuelist>
238 </valuelist>
239 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
239 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
240 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
240 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
241 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
241 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
242 </valuemap>
242 </valuemap>
243 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
243 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
244 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
244 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
245 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
245 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
246 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
246 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
247 </valuemap>
247 </valuemap>
248 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
248 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
249 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
249 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
250 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
250 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
251 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
251 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
252 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
252 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
253 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
253 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
254 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
254 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
255 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
255 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
256 </valuemap>
256 </valuemap>
257 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
257 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
258 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
258 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
259 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
259 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
260 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
260 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
261 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
261 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
262 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
262 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
263 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
263 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
264 </valuemap>
264 </valuemap>
265 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
265 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
266 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
266 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
267 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
267 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
268 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
268 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
269 </valuemap>
269 </valuemap>
270 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
270 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
271 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
271 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
272 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
272 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
273 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
273 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
274 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
274 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
275 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
275 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
276 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
276 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
277 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
277 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
278 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
278 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
279 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
279 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
280 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
280 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
281 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
281 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
282 <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
282 <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
283 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
283 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
284 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
284 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
285 <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
285 <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
286 <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
286 <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
287 <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
287 <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
288 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
288 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
289 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
289 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
290 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
290 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
291 <value type="int">0</value>
291 <value type="int">0</value>
292 <value type="int">1</value>
292 <value type="int">1</value>
293 <value type="int">2</value>
293 <value type="int">2</value>
294 <value type="int">3</value>
294 <value type="int">3</value>
295 <value type="int">4</value>
295 <value type="int">4</value>
296 <value type="int">5</value>
296 <value type="int">5</value>
297 <value type="int">6</value>
297 <value type="int">6</value>
298 <value type="int">7</value>
298 <value type="int">7</value>
299 <value type="int">8</value>
299 <value type="int">8</value>
300 <value type="int">9</value>
300 <value type="int">9</value>
301 <value type="int">10</value>
301 <value type="int">10</value>
302 <value type="int">11</value>
302 <value type="int">11</value>
303 <value type="int">12</value>
303 <value type="int">12</value>
304 <value type="int">13</value>
304 <value type="int">13</value>
305 <value type="int">14</value>
305 <value type="int">14</value>
306 </valuelist>
306 </valuelist>
307 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
307 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
308 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
308 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
309 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
309 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
310 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
310 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
311 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
311 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
312 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
312 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
313 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
313 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
314 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
314 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
315 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
315 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
316 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
316 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
317 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
317 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
318 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
318 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
319 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
319 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
320 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
320 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
321 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
321 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
322 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
322 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
323 </valuemap>
323 </valuemap>
324 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
324 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
325 </valuemap>
325 </valuemap>
326 </data>
326 </data>
327 <data>
327 <data>
328 <variable>ProjectExplorer.Project.TargetCount</variable>
328 <variable>ProjectExplorer.Project.TargetCount</variable>
329 <value type="int">2</value>
329 <value type="int">2</value>
330 </data>
330 </data>
331 <data>
331 <data>
332 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
332 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
333 <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
333 <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
334 </data>
334 </data>
335 <data>
335 <data>
336 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
336 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
337 <value type="int">15</value>
337 <value type="int">15</value>
338 </data>
338 </data>
339 </qtcreator>
339 </qtcreator>
@@ -1,632 +1,655
1 #ifndef CCSDS_TYPES_H_INCLUDED
1 #ifndef CCSDS_TYPES_H_INCLUDED
2 #define CCSDS_TYPES_H_INCLUDED
2 #define CCSDS_TYPES_H_INCLUDED
3
3
4 #include "fsw_params_processing.h"
4 #include "fsw_params_processing.h"
5
5
6 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
6 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
7 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
7 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
8 #define CCSDS_TM_PKT_MAX_SIZE 4412
8 #define CCSDS_TM_PKT_MAX_SIZE 4412
9 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
9 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
10 #define CCSDS_TC_PKT_MAX_SIZE 256
10 #define CCSDS_TC_PKT_MAX_SIZE 256
11 #define CCSDS_TC_PKT_MIN_SIZE 16
11 #define CCSDS_TC_PKT_MIN_SIZE 16
12 #define CCSDS_TC_TM_PACKET_OFFSET 7
12 #define CCSDS_TC_TM_PACKET_OFFSET 7
13 #define CCSDS_PROCESS_ID 76
13 #define CCSDS_PROCESS_ID 76
14 #define CCSDS_PACKET_CATEGORY 12
14 #define CCSDS_PACKET_CATEGORY 12
15 #define CCSDS_NODE_ADDRESS 0xfe
15 #define CCSDS_NODE_ADDRESS 0xfe
16 #define CCSDS_USER_APP 0x00
16 #define CCSDS_USER_APP 0x00
17
17
18 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
18 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
19 #define DEFAULT_RESERVED 0x00
19 #define DEFAULT_RESERVED 0x00
20 #define DEFAULT_HKBIA 0x1e // 0001 1110
20 #define DEFAULT_HKBIA 0x1e // 0001 1110
21
21
22 // PACKET ID
22 // PACKET ID
23 #define TM_PACKET_ID_TC_EXE 0x0cc1 // PID 76 CAT 1
23 #define TM_PACKET_ID_TC_EXE 0x0cc1 // PID 76 CAT 1
24 #define TM_PACKET_ID_HK 0x0cc4 // PID 76 CAT 4
24 #define TM_PACKET_ID_HK 0x0cc4 // PID 76 CAT 4
25 #define TM_PACKET_ID_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9
25 #define TM_PACKET_ID_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9
26 #define TM_PACKET_ID_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
26 #define TM_PACKET_ID_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
27 #define TM_PACKET_ID_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
27 #define TM_PACKET_ID_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
28 #define TM_PACKET_PID_DEFAULT 76
28 #define TM_PACKET_PID_DEFAULT 76
29 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
29 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
30 #define TM_PACKET_CAT_TC_EXE 1
30 #define TM_PACKET_CAT_TC_EXE 1
31 #define TM_PACKET_CAT_HK 4
31 #define TM_PACKET_CAT_HK 4
32 #define TM_PACKET_CAT_PARAMETER_DUMP 9
32 #define TM_PACKET_CAT_PARAMETER_DUMP 9
33 #define TM_PACKET_CAT_SCIENCE 12
33 #define TM_PACKET_CAT_SCIENCE 12
34 #define TC_PACKET_CAT 12
34 #define TC_PACKET_CAT 12
35
35
36 // PACKET SEQUENCE CONTROL
36 // PACKET SEQUENCE CONTROL
37 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
37 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
38 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
38 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
39 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
39 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
40 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
40 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
41 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
41 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
42
42
43 // DESTINATION ID
43 // DESTINATION ID
44 #define TM_DESTINATION_ID_GROUND 0
44 #define TM_DESTINATION_ID_GROUND 0
45 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
45 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
46 #define TM_DESTINATION_ID_TC_SEQUENCES 111
46 #define TM_DESTINATION_ID_TC_SEQUENCES 111
47 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
47 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
48 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
48 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
49 #define TM_DESTINATION_ID_DIRECT_CMD 120
49 #define TM_DESTINATION_ID_DIRECT_CMD 120
50 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
50 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
51 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
51 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
52 #define TM_DESTINATION_ID_OBCP 15
52 #define TM_DESTINATION_ID_OBCP 15
53 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
53 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
54 #define TM_DESTINATION_ID_AOCS 11
54 #define TM_DESTINATION_ID_AOCS 11
55
55
56 #define CCSDS_DESTINATION_ID 0x01
56 #define CCSDS_DESTINATION_ID 0x01
57 #define CCSDS_PROTOCOLE_ID 0x02
57 #define CCSDS_PROTOCOLE_ID 0x02
58 #define CCSDS_RESERVED 0x00
58 #define CCSDS_RESERVED 0x00
59 #define CCSDS_USER_APP 0x00
59 #define CCSDS_USER_APP 0x00
60
60
61 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
61 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
62 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
62 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
63 #define SIZE_HK_PARAMETERS 112
63 #define SIZE_HK_PARAMETERS 112
64
64
65 // TC TYPES
65 // TC TYPES
66 #define TC_TYPE_GEN 181
66 #define TC_TYPE_GEN 181
67 #define TC_TYPE_TIME 9
67 #define TC_TYPE_TIME 9
68
68
69 // TC SUBTYPES
69 // TC SUBTYPES
70 #define TC_SUBTYPE_RESET 1
70 #define TC_SUBTYPE_RESET 1
71 #define TC_SUBTYPE_LOAD_COMM 11
71 #define TC_SUBTYPE_LOAD_COMM 11
72 #define TC_SUBTYPE_LOAD_NORM 13
72 #define TC_SUBTYPE_LOAD_NORM 13
73 #define TC_SUBTYPE_LOAD_BURST 19
73 #define TC_SUBTYPE_LOAD_BURST 19
74 #define TC_SUBTYPE_LOAD_SBM1 25
74 #define TC_SUBTYPE_LOAD_SBM1 25
75 #define TC_SUBTYPE_LOAD_SBM2 27
75 #define TC_SUBTYPE_LOAD_SBM2 27
76 #define TC_SUBTYPE_DUMP 31
76 #define TC_SUBTYPE_DUMP 31
77 #define TC_SUBTYPE_ENTER 41
77 #define TC_SUBTYPE_ENTER 41
78 #define TC_SUBTYPE_UPDT_INFO 51
78 #define TC_SUBTYPE_UPDT_INFO 51
79 #define TC_SUBTYPE_EN_CAL 61
79 #define TC_SUBTYPE_EN_CAL 61
80 #define TC_SUBTYPE_DIS_CAL 63
80 #define TC_SUBTYPE_DIS_CAL 63
81 #define TC_SUBTYPE_UPDT_TIME 129
81 #define TC_SUBTYPE_UPDT_TIME 129
82
82
83 // TC LEN
83 // TC LEN
84 #define TC_LEN_RESET 12
84 #define TC_LEN_RESET 12
85 #define TC_LEN_LOAD_COMM 14
85 #define TC_LEN_LOAD_COMM 14
86 #define TC_LEN_LOAD_NORM 22
86 #define TC_LEN_LOAD_NORM 22
87 #define TC_LEN_LOAD_BURST 14
87 #define TC_LEN_LOAD_BURST 14
88 #define TC_LEN_LOAD_SBM1 14
88 #define TC_LEN_LOAD_SBM1 14
89 #define TC_LEN_LOAD_SBM2 14
89 #define TC_LEN_LOAD_SBM2 14
90 #define TC_LEN_DUMP 12
90 #define TC_LEN_DUMP 12
91 #define TC_LEN_ENTER 20
91 #define TC_LEN_ENTER 20
92 #define TC_LEN_UPDT_INFO 46
92 #define TC_LEN_UPDT_INFO 46
93 #define TC_LEN_EN_CAL 12
93 #define TC_LEN_EN_CAL 12
94 #define TC_LEN_DIS_CAL 12
94 #define TC_LEN_DIS_CAL 12
95 #define TC_LEN_UPDT_TIME 18
95 #define TC_LEN_UPDT_TIME 18
96
96
97 // TM TYPES
97 // TM TYPES
98 #define TM_TYPE_TC_EXE 1
98 #define TM_TYPE_TC_EXE 1
99 #define TM_TYPE_HK 3
99 #define TM_TYPE_HK 3
100 #define TM_TYPE_PARAMETER_DUMP 3
100 #define TM_TYPE_PARAMETER_DUMP 3
101 #define TM_TYPE_LFR_SCIENCE 21
101 #define TM_TYPE_LFR_SCIENCE 21
102
102
103 // TM SUBTYPES
103 // TM SUBTYPES
104 #define TM_SUBTYPE_EXE_OK 7
104 #define TM_SUBTYPE_EXE_OK 7
105 #define TM_SUBTYPE_EXE_NOK 8
105 #define TM_SUBTYPE_EXE_NOK 8
106 #define TM_SUBTYPE_HK 25
106 #define TM_SUBTYPE_HK 25
107 #define TM_SUBTYPE_PARAMETER_DUMP 25
107 #define TM_SUBTYPE_PARAMETER_DUMP 25
108 #define TM_SUBTYPE_SCIENCE 3
108 #define TM_SUBTYPE_SCIENCE 3
109 #define TM_SUBTYPE_LFR_SCIENCE 3
109 #define TM_SUBTYPE_LFR_SCIENCE 3
110
110
111 // FAILURE CODES
111 // FAILURE CODES
112 #define ILLEGAL_APID 0
112 #define ILLEGAL_APID 0
113 #define WRONG_LEN_PKT 1
113 #define WRONG_LEN_PKT 1
114 #define INCOR_CHECKSUM 2
114 #define INCOR_CHECKSUM 2
115 #define ILL_TYPE 3
115 #define ILL_TYPE 3
116 #define ILL_SUBTYPE 4
116 #define ILL_SUBTYPE 4
117 #define WRONG_APP_DATA 5 // 0x00 0x05
117 #define WRONG_APP_DATA 5 // 0x00 0x05
118 #define TC_NOT_EXE 42000 // 0xa4 0x10
118 #define TC_NOT_EXE 42000 // 0xa4 0x10
119 #define WRONG_SRC_ID 42001 // 0xa4 0x11
119 #define WRONG_SRC_ID 42001 // 0xa4 0x11
120 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
120 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
121 #define FAIL_DETECTED 42003 // 0xa4 0x13
121 #define FAIL_DETECTED 42003 // 0xa4 0x13
122 #define NOT_ALLOWED 42004 // 0xa4 0x14
122 #define NOT_ALLOWED 42004 // 0xa4 0x14
123 #define CORRUPTED 42005 // 0xa4 0x15
123 #define CORRUPTED 42005 // 0xa4 0x15
124 #define CCSDS_TM_VALID 7
124 #define CCSDS_TM_VALID 7
125
125
126 // TC SID
126 // TC SID
127 #define SID_TC_GROUND 0
127 #define SID_TC_GROUND 0
128 #define SID_TC_MISSION_TIMELINE 110
128 #define SID_TC_MISSION_TIMELINE 110
129 #define SID_TC_TC_SEQUENCES 111
129 #define SID_TC_TC_SEQUENCES 111
130 #define SID_TC_RECOVERY_ACTION_CMD 112
130 #define SID_TC_RECOVERY_ACTION_CMD 112
131 #define SID_TC_BACKUP_MISSION_TIMELINE 113
131 #define SID_TC_BACKUP_MISSION_TIMELINE 113
132 #define SID_TC_DIRECT_CMD 120
132 #define SID_TC_DIRECT_CMD 120
133 #define SID_TC_SPARE_GRD_SRC1 121
133 #define SID_TC_SPARE_GRD_SRC1 121
134 #define SID_TC_SPARE_GRD_SRC2 122
134 #define SID_TC_SPARE_GRD_SRC2 122
135 #define SID_TC_OBCP 15
135 #define SID_TC_OBCP 15
136 #define SID_TC_SYSTEM_CONTROL 14
136 #define SID_TC_SYSTEM_CONTROL 14
137 #define SID_TC_AOCS 11
137 #define SID_TC_AOCS 11
138 #define SID_TC_RPW_INTERNAL 254
138 #define SID_TC_RPW_INTERNAL 254
139
139
140 enum apid_destid{
140 enum apid_destid{
141 GROUND,
141 GROUND,
142 MISSION_TIMELINE,
142 MISSION_TIMELINE,
143 TC_SEQUENCES,
143 TC_SEQUENCES,
144 RECOVERY_ACTION_CMD,
144 RECOVERY_ACTION_CMD,
145 BACKUP_MISSION_TIMELINE,
145 BACKUP_MISSION_TIMELINE,
146 DIRECT_CMD,
146 DIRECT_CMD,
147 SPARE_GRD_SRC1,
147 SPARE_GRD_SRC1,
148 SPARE_GRD_SRC2,
148 SPARE_GRD_SRC2,
149 OBCP,
149 OBCP,
150 SYSTEM_CONTROL,
150 SYSTEM_CONTROL,
151 AOCS,
151 AOCS,
152 RPW_INTERNAL
152 RPW_INTERNAL
153 };
153 };
154 // SEQUENCE COUNTERS
154 // SEQUENCE COUNTERS
155 #define SEQ_CNT_MAX 16383
155 #define SEQ_CNT_MAX 16383
156 #define SEQ_CNT_NB_DEST_ID 12
156 #define SEQ_CNT_NB_DEST_ID 12
157
157
158 // TM SID
158 // TM SID
159 #define SID_HK 1
159 #define SID_HK 1
160 #define SID_PARAMETER_DUMP 10
160 #define SID_PARAMETER_DUMP 10
161
161
162 #define SID_NORM_SWF_F0 3
162 #define SID_NORM_SWF_F0 3
163 #define SID_NORM_SWF_F1 4
163 #define SID_NORM_SWF_F1 4
164 #define SID_NORM_SWF_F2 5
164 #define SID_NORM_SWF_F2 5
165 #define SID_NORM_CWF_F3 1
165 #define SID_NORM_CWF_F3 1
166 #define SID_BURST_CWF_F2 2
166 #define SID_BURST_CWF_F2 2
167 #define SID_SBM1_CWF_F1 24
167 #define SID_SBM1_CWF_F1 24
168 #define SID_SBM2_CWF_F2 25
168 #define SID_SBM2_CWF_F2 25
169 #define SID_NORM_ASM_F0 11
169 #define SID_NORM_ASM_F0 11
170 #define SID_NORM_ASM_F1 12
170 #define SID_NORM_ASM_F1 12
171 #define SID_NORM_ASM_F2 13
171 #define SID_NORM_ASM_F2 13
172 #define SID_NORM_BP1_F0 14
172 #define SID_NORM_BP1_F0 14
173 #define SID_NORM_BP1_F1 15
173 #define SID_NORM_BP1_F1 15
174 #define SID_NORM_BP1_F2 16
174 #define SID_NORM_BP1_F2 16
175 #define SID_NORM_BP2_F0 19
175 #define SID_NORM_BP2_F0 19
176 #define SID_NORM_BP2_F1 20
176 #define SID_NORM_BP2_F1 20
177 #define SID_NORM_BP2_F2 21
177 #define SID_NORM_BP2_F2 21
178 #define SID_BURST_BP1_F0 17
178 #define SID_BURST_BP1_F0 17
179 #define SID_BURST_BP2_F0 22
179 #define SID_BURST_BP2_F0 22
180 #define SID_BURST_BP1_F1 18
180 #define SID_BURST_BP1_F1 18
181 #define SID_BURST_BP2_F1 23
181 #define SID_BURST_BP2_F1 23
182 #define SID_SBM1_BP1_F0 28
182 #define SID_SBM1_BP1_F0 28
183 #define SID_SBM1_BP2_F0 31
183 #define SID_SBM1_BP2_F0 31
184 #define SID_SBM2_BP1_F0 29
184 #define SID_SBM2_BP1_F0 29
185 #define SID_SBM2_BP2_F0 32
185 #define SID_SBM2_BP2_F0 32
186 #define SID_SBM2_BP1_F1 30
186 #define SID_SBM2_BP1_F1 30
187 #define SID_SBM2_BP2_F1 33
187 #define SID_SBM2_BP2_F1 33
188 #define SID_NORM_CWF_LONG_F3 34
188 #define SID_NORM_CWF_LONG_F3 34
189
189
190 // LENGTH (BYTES)
190 // LENGTH (BYTES)
191 #define LENGTH_TM_LFR_TC_EXE_MAX 32
191 #define LENGTH_TM_LFR_TC_EXE_MAX 32
192 #define LENGTH_TM_LFR_HK 126
192 #define LENGTH_TM_LFR_HK 126
193
193
194 // HEADER_LENGTH
194 // HEADER_LENGTH
195 #define TM_HEADER_LEN 16
195 #define TM_HEADER_LEN 16
196 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28
196 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28
197 // PACKET_LENGTH
197 // PACKET_LENGTH
198 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
198 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
199 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
199 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
200 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
200 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
201 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
201 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
202 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
202 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
203 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
203 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
204 #define PACKET_LENGTH_HK (124 - CCSDS_TC_TM_PACKET_OFFSET)
204 #define PACKET_LENGTH_HK (124 - CCSDS_TC_TM_PACKET_OFFSET)
205 #define PACKET_LENGTH_PARAMETER_DUMP (36 - CCSDS_TC_TM_PACKET_OFFSET)
205 #define PACKET_LENGTH_PARAMETER_DUMP (36 - CCSDS_TC_TM_PACKET_OFFSET)
206 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0 2221 // 44 * 25 * 2 + 28 - 7
206 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0 (2228 - CCSDS_TC_TM_PACKET_OFFSET) // 44 * 25 * 2 + 28 - 7
207 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1 2621 // 52 * 25 * 2 + 28 - 7
207 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1 (2628 - CCSDS_TC_TM_PACKET_OFFSET) // 52 * 25 * 2 + 28 - 7
208 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F2 2421 // 48 * 25 * 2 + 28 - 7
208 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F2 (2428 - CCSDS_TC_TM_PACKET_OFFSET) // 48 * 25 * 2 + 28 - 7
209 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 (126 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 9 + 27 - 7
210 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM1_BP1_F0 (224 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 9 + 26 - 7
209
211
210 #define SPARE1_PUSVERSION_SPARE2 0x10
212 #define SPARE1_PUSVERSION_SPARE2 0x10
211
213
212 // R1
214 // R1
213 #define TM_LEN_SCI_SWF_340 4101 // 340 * 12 + 10 + 12 - 1
215 #define TM_LEN_SCI_SWF_340 4101 // 340 * 12 + 10 + 12 - 1
214 #define TM_LEN_SCI_SWF_8 117 // 8 * 12 + 10 + 12 - 1
216 #define TM_LEN_SCI_SWF_8 117 // 8 * 12 + 10 + 12 - 1
215 #define TM_LEN_SCI_CWF_340 4099 // 340 * 12 + 10 + 10 - 1
217 #define TM_LEN_SCI_CWF_340 4099 // 340 * 12 + 10 + 10 - 1
216 #define TM_LEN_SCI_CWF_8 115 // 8 * 12 + 10 + 10 - 1
218 #define TM_LEN_SCI_CWF_8 115 // 8 * 12 + 10 + 10 - 1
217 #define TM_LEN_SCI_CWF3_LIGHT_340 2059 // 340 * 6 + 10 + 10 - 1
219 #define TM_LEN_SCI_CWF3_LIGHT_340 2059 // 340 * 6 + 10 + 10 - 1
218 #define TM_LEN_SCI_CWF3_LIGHT_8 67 // 8 * 6 + 10 + 10 - 1
220 #define TM_LEN_SCI_CWF3_LIGHT_8 67 // 8 * 6 + 10 + 10 - 1
219 // R2
221 // R2
220 #define TM_LEN_SCI_SWF_304 3669 // 304 * 12 + 10 + 12 - 1
222 #define TM_LEN_SCI_SWF_304 3669 // 304 * 12 + 10 + 12 - 1
221 #define TM_LEN_SCI_SWF_224 2709 // 224 * 12 + 10 + 12 - 1
223 #define TM_LEN_SCI_SWF_224 2709 // 224 * 12 + 10 + 12 - 1
222 #define TM_LEN_SCI_CWF_336 4051 // 336 * 12 + 10 + 10 - 1
224 #define TM_LEN_SCI_CWF_336 4051 // 336 * 12 + 10 + 10 - 1
223 #define TM_LEN_SCI_CWF_672 4051 // 672 * 6 + 10 + 10 - 1
225 #define TM_LEN_SCI_CWF_672 4051 // 672 * 6 + 10 + 10 - 1
224 //
226 //
225 #define DEFAULT_PKTCNT 0x07
227 #define DEFAULT_PKTCNT 0x07
226 #define BLK_NR_304 0x0130
228 #define BLK_NR_304 0x0130
227 #define BLK_NR_224 0x00e0
229 #define BLK_NR_224 0x00e0
228 #define BLK_NR_CWF 0x0150 // 336
230 #define BLK_NR_CWF 0x0150 // 336
229 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
231 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
230
232
231 enum TM_TYPE{
233 enum TM_TYPE{
232 TM_LFR_TC_EXE_OK,
234 TM_LFR_TC_EXE_OK,
233 TM_LFR_TC_EXE_ERR,
235 TM_LFR_TC_EXE_ERR,
234 TM_LFR_HK,
236 TM_LFR_HK,
235 TM_LFR_SCI,
237 TM_LFR_SCI,
236 TM_LFR_SCI_SBM,
238 TM_LFR_SCI_SBM,
237 TM_LFR_PAR_DUMP
239 TM_LFR_PAR_DUMP
238 };
240 };
239
241
240 typedef struct {
242 typedef struct {
241 unsigned char targetLogicalAddress;
243 unsigned char targetLogicalAddress;
242 unsigned char protocolIdentifier;
244 unsigned char protocolIdentifier;
243 unsigned char reserved;
245 unsigned char reserved;
244 unsigned char userApplication;
246 unsigned char userApplication;
245 // PACKET HEADER
247 // PACKET HEADER
246 unsigned char packetID[2];
248 unsigned char packetID[2];
247 unsigned char packetSequenceControl[2];
249 unsigned char packetSequenceControl[2];
248 unsigned char packetLength[2];
250 unsigned char packetLength[2];
249 // DATA FIELD HEADER
251 // DATA FIELD HEADER
250 unsigned char spare1_pusVersion_spare2;
252 unsigned char spare1_pusVersion_spare2;
251 unsigned char serviceType;
253 unsigned char serviceType;
252 unsigned char serviceSubType;
254 unsigned char serviceSubType;
253 unsigned char destinationID;
255 unsigned char destinationID;
254 unsigned char time[6];
256 unsigned char time[6];
255 //
257 //
256 unsigned char telecommand_pkt_id[2];
258 unsigned char telecommand_pkt_id[2];
257 unsigned char pkt_seq_control[2];
259 unsigned char pkt_seq_control[2];
258 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
260 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
259
261
260 typedef struct {
262 typedef struct {
261 unsigned char targetLogicalAddress;
263 unsigned char targetLogicalAddress;
262 unsigned char protocolIdentifier;
264 unsigned char protocolIdentifier;
263 unsigned char reserved;
265 unsigned char reserved;
264 unsigned char userApplication;
266 unsigned char userApplication;
265 // PACKET HEADER
267 // PACKET HEADER
266 unsigned char packetID[2];
268 unsigned char packetID[2];
267 unsigned char packetSequenceControl[2];
269 unsigned char packetSequenceControl[2];
268 unsigned char packetLength[2];
270 unsigned char packetLength[2];
269 // DATA FIELD HEADER
271 // DATA FIELD HEADER
270 unsigned char spare1_pusVersion_spare2;
272 unsigned char spare1_pusVersion_spare2;
271 unsigned char serviceType;
273 unsigned char serviceType;
272 unsigned char serviceSubType;
274 unsigned char serviceSubType;
273 unsigned char destinationID;
275 unsigned char destinationID;
274 unsigned char time[6];
276 unsigned char time[6];
275 //
277 //
276 unsigned char tc_failure_code[2];
278 unsigned char tc_failure_code[2];
277 unsigned char telecommand_pkt_id[2];
279 unsigned char telecommand_pkt_id[2];
278 unsigned char pkt_seq_control[2];
280 unsigned char pkt_seq_control[2];
279 unsigned char tc_service;
281 unsigned char tc_service;
280 unsigned char tc_subtype;
282 unsigned char tc_subtype;
281 unsigned char byte_position;
283 unsigned char byte_position;
282 unsigned char rcv_value;
284 unsigned char rcv_value;
283 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
285 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
284
286
285 typedef struct {
287 typedef struct {
286 unsigned char targetLogicalAddress;
288 unsigned char targetLogicalAddress;
287 unsigned char protocolIdentifier;
289 unsigned char protocolIdentifier;
288 unsigned char reserved;
290 unsigned char reserved;
289 unsigned char userApplication;
291 unsigned char userApplication;
290 // PACKET HEADER
292 // PACKET HEADER
291 unsigned char packetID[2];
293 unsigned char packetID[2];
292 unsigned char packetSequenceControl[2];
294 unsigned char packetSequenceControl[2];
293 unsigned char packetLength[2];
295 unsigned char packetLength[2];
294 // DATA FIELD HEADER
296 // DATA FIELD HEADER
295 unsigned char spare1_pusVersion_spare2;
297 unsigned char spare1_pusVersion_spare2;
296 unsigned char serviceType;
298 unsigned char serviceType;
297 unsigned char serviceSubType;
299 unsigned char serviceSubType;
298 unsigned char destinationID;
300 unsigned char destinationID;
299 unsigned char time[6];
301 unsigned char time[6];
300 //
302 //
301 unsigned char tc_failure_code[2];
303 unsigned char tc_failure_code[2];
302 unsigned char telecommand_pkt_id[2];
304 unsigned char telecommand_pkt_id[2];
303 unsigned char pkt_seq_control[2];
305 unsigned char pkt_seq_control[2];
304 unsigned char tc_service;
306 unsigned char tc_service;
305 unsigned char tc_subtype;
307 unsigned char tc_subtype;
306 unsigned char lfr_status_word[2];
308 unsigned char lfr_status_word[2];
307 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
309 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
308
310
309 typedef struct {
311 typedef struct {
310 unsigned char targetLogicalAddress;
312 unsigned char targetLogicalAddress;
311 unsigned char protocolIdentifier;
313 unsigned char protocolIdentifier;
312 unsigned char reserved;
314 unsigned char reserved;
313 unsigned char userApplication;
315 unsigned char userApplication;
314 // PACKET HEADER
316 // PACKET HEADER
315 unsigned char packetID[2];
317 unsigned char packetID[2];
316 unsigned char packetSequenceControl[2];
318 unsigned char packetSequenceControl[2];
317 unsigned char packetLength[2];
319 unsigned char packetLength[2];
318 // DATA FIELD HEADER
320 // DATA FIELD HEADER
319 unsigned char spare1_pusVersion_spare2;
321 unsigned char spare1_pusVersion_spare2;
320 unsigned char serviceType;
322 unsigned char serviceType;
321 unsigned char serviceSubType;
323 unsigned char serviceSubType;
322 unsigned char destinationID;
324 unsigned char destinationID;
323 unsigned char time[6];
325 unsigned char time[6];
324 //
326 //
325 unsigned char tc_failure_code[2];
327 unsigned char tc_failure_code[2];
326 unsigned char telecommand_pkt_id[2];
328 unsigned char telecommand_pkt_id[2];
327 unsigned char pkt_seq_control[2];
329 unsigned char pkt_seq_control[2];
328 unsigned char tc_service;
330 unsigned char tc_service;
329 unsigned char tc_subtype;
331 unsigned char tc_subtype;
330 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
332 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
331
333
332 typedef struct {
334 typedef struct {
333 unsigned char targetLogicalAddress;
335 unsigned char targetLogicalAddress;
334 unsigned char protocolIdentifier;
336 unsigned char protocolIdentifier;
335 unsigned char reserved;
337 unsigned char reserved;
336 unsigned char userApplication;
338 unsigned char userApplication;
337 // PACKET HEADER
339 // PACKET HEADER
338 unsigned char packetID[2];
340 unsigned char packetID[2];
339 unsigned char packetSequenceControl[2];
341 unsigned char packetSequenceControl[2];
340 unsigned char packetLength[2];
342 unsigned char packetLength[2];
341 // DATA FIELD HEADER
343 // DATA FIELD HEADER
342 unsigned char spare1_pusVersion_spare2;
344 unsigned char spare1_pusVersion_spare2;
343 unsigned char serviceType;
345 unsigned char serviceType;
344 unsigned char serviceSubType;
346 unsigned char serviceSubType;
345 unsigned char destinationID;
347 unsigned char destinationID;
346 unsigned char time[6];
348 unsigned char time[6];
347 //
349 //
348 unsigned char tc_failure_code[2];
350 unsigned char tc_failure_code[2];
349 unsigned char telecommand_pkt_id[2];
351 unsigned char telecommand_pkt_id[2];
350 unsigned char pkt_seq_control[2];
352 unsigned char pkt_seq_control[2];
351 unsigned char tc_service;
353 unsigned char tc_service;
352 unsigned char tc_subtype;
354 unsigned char tc_subtype;
353 } Packet_TM_LFR_TC_EXE_ERROR_t;
355 } Packet_TM_LFR_TC_EXE_ERROR_t;
354
356
355 typedef struct {
357 typedef struct {
356 unsigned char targetLogicalAddress;
358 unsigned char targetLogicalAddress;
357 unsigned char protocolIdentifier;
359 unsigned char protocolIdentifier;
358 unsigned char reserved;
360 unsigned char reserved;
359 unsigned char userApplication;
361 unsigned char userApplication;
360 // PACKET HEADER
362 // PACKET HEADER
361 unsigned char packetID[2];
363 unsigned char packetID[2];
362 unsigned char packetSequenceControl[2];
364 unsigned char packetSequenceControl[2];
363 unsigned char packetLength[2];
365 unsigned char packetLength[2];
364 // DATA FIELD HEADER
366 // DATA FIELD HEADER
365 unsigned char spare1_pusVersion_spare2;
367 unsigned char spare1_pusVersion_spare2;
366 unsigned char serviceType;
368 unsigned char serviceType;
367 unsigned char serviceSubType;
369 unsigned char serviceSubType;
368 unsigned char destinationID;
370 unsigned char destinationID;
369 unsigned char time[6];
371 unsigned char time[6];
370 //
372 //
371 unsigned char tc_failure_code[2];
373 unsigned char tc_failure_code[2];
372 unsigned char telecommand_pkt_id[2];
374 unsigned char telecommand_pkt_id[2];
373 unsigned char pkt_seq_control[2];
375 unsigned char pkt_seq_control[2];
374 unsigned char tc_service;
376 unsigned char tc_service;
375 unsigned char tc_subtype;
377 unsigned char tc_subtype;
376 unsigned char pkt_len_rcv_value[2];
378 unsigned char pkt_len_rcv_value[2];
377 unsigned char pkt_datafieldsize_cnt[2];
379 unsigned char pkt_datafieldsize_cnt[2];
378 unsigned char rcv_crc[2];
380 unsigned char rcv_crc[2];
379 unsigned char computed_crc[2];
381 unsigned char computed_crc[2];
380 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
382 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
381
383
382 typedef struct {
384 typedef struct {
383 unsigned char targetLogicalAddress;
385 unsigned char targetLogicalAddress;
384 unsigned char protocolIdentifier;
386 unsigned char protocolIdentifier;
385 unsigned char reserved;
387 unsigned char reserved;
386 unsigned char userApplication;
388 unsigned char userApplication;
387 unsigned char packetID[2];
389 unsigned char packetID[2];
388 unsigned char packetSequenceControl[2];
390 unsigned char packetSequenceControl[2];
389 unsigned char packetLength[2];
391 unsigned char packetLength[2];
390 // DATA FIELD HEADER
392 // DATA FIELD HEADER
391 unsigned char spare1_pusVersion_spare2;
393 unsigned char spare1_pusVersion_spare2;
392 unsigned char serviceType;
394 unsigned char serviceType;
393 unsigned char serviceSubType;
395 unsigned char serviceSubType;
394 unsigned char destinationID;
396 unsigned char destinationID;
395 unsigned char time[6];
397 unsigned char time[6];
396 // AUXILIARY HEADER
398 // AUXILIARY HEADER
397 unsigned char sid;
399 unsigned char sid;
398 unsigned char hkBIA;
400 unsigned char hkBIA;
399 unsigned char pktCnt;
401 unsigned char pktCnt;
400 unsigned char pktNr;
402 unsigned char pktNr;
401 unsigned char acquisitionTime[6];
403 unsigned char acquisitionTime[6];
402 unsigned char blkNr[2];
404 unsigned char blkNr[2];
403 } Header_TM_LFR_SCIENCE_SWF_t;
405 } Header_TM_LFR_SCIENCE_SWF_t;
404
406
405 typedef struct {
407 typedef struct {
406 unsigned char targetLogicalAddress;
408 unsigned char targetLogicalAddress;
407 unsigned char protocolIdentifier;
409 unsigned char protocolIdentifier;
408 unsigned char reserved;
410 unsigned char reserved;
409 unsigned char userApplication;
411 unsigned char userApplication;
410 unsigned char packetID[2];
412 unsigned char packetID[2];
411 unsigned char packetSequenceControl[2];
413 unsigned char packetSequenceControl[2];
412 unsigned char packetLength[2];
414 unsigned char packetLength[2];
413 // DATA FIELD HEADER
415 // DATA FIELD HEADER
414 unsigned char spare1_pusVersion_spare2;
416 unsigned char spare1_pusVersion_spare2;
415 unsigned char serviceType;
417 unsigned char serviceType;
416 unsigned char serviceSubType;
418 unsigned char serviceSubType;
417 unsigned char destinationID;
419 unsigned char destinationID;
418 unsigned char time[6];
420 unsigned char time[6];
419 // AUXILIARY DATA HEADER
421 // AUXILIARY DATA HEADER
420 unsigned char sid;
422 unsigned char sid;
421 unsigned char hkBIA;
423 unsigned char hkBIA;
422 unsigned char acquisitionTime[6];
424 unsigned char acquisitionTime[6];
423 unsigned char blkNr[2];
425 unsigned char blkNr[2];
424 } Header_TM_LFR_SCIENCE_CWF_t;
426 } Header_TM_LFR_SCIENCE_CWF_t;
425
427
426 typedef struct {
428 typedef struct {
427 unsigned char targetLogicalAddress;
429 unsigned char targetLogicalAddress;
428 unsigned char protocolIdentifier;
430 unsigned char protocolIdentifier;
429 unsigned char reserved;
431 unsigned char reserved;
430 unsigned char userApplication;
432 unsigned char userApplication;
431 unsigned char packetID[2];
433 unsigned char packetID[2];
432 unsigned char packetSequenceControl[2];
434 unsigned char packetSequenceControl[2];
433 unsigned char packetLength[2];
435 unsigned char packetLength[2];
434 // DATA FIELD HEADER
436 // DATA FIELD HEADER
435 unsigned char spare1_pusVersion_spare2;
437 unsigned char spare1_pusVersion_spare2;
436 unsigned char serviceType;
438 unsigned char serviceType;
437 unsigned char serviceSubType;
439 unsigned char serviceSubType;
438 unsigned char destinationID;
440 unsigned char destinationID;
439 unsigned char time[6];
441 unsigned char time[6];
440 // AUXILIARY HEADER
442 // AUXILIARY HEADER
441 unsigned char sid;
443 unsigned char sid;
442 unsigned char biaStatusInfo;
444 unsigned char biaStatusInfo;
443 unsigned char pa_lfr_pkt_cnt_asm;
445 unsigned char pa_lfr_pkt_cnt_asm;
444 unsigned char pa_lfr_pkt_nr_asm;
446 unsigned char pa_lfr_pkt_nr_asm;
445 unsigned char acquisitionTime[6];
447 unsigned char acquisitionTime[6];
446 unsigned char pa_lfr_asm_blk_nr[2];
448 unsigned char pa_lfr_asm_blk_nr[2];
447 } Header_TM_LFR_SCIENCE_ASM_t;
449 } Header_TM_LFR_SCIENCE_ASM_t;
448
450
449 typedef struct {
451 typedef struct {
450 unsigned char targetLogicalAddress;
452 unsigned char targetLogicalAddress;
451 unsigned char protocolIdentifier;
453 unsigned char protocolIdentifier;
452 unsigned char reserved;
454 unsigned char reserved;
453 unsigned char userApplication;
455 unsigned char userApplication;
454 unsigned char packetID[2];
456 unsigned char packetID[2];
455 unsigned char packetSequenceControl[2];
457 unsigned char packetSequenceControl[2];
456 unsigned char packetLength[2];
458 unsigned char packetLength[2];
457 // DATA FIELD HEADER
459 // DATA FIELD HEADER
458 unsigned char spare1_pusVersion_spare2;
460 unsigned char spare1_pusVersion_spare2;
459 unsigned char serviceType;
461 unsigned char serviceType;
460 unsigned char serviceSubType;
462 unsigned char serviceSubType;
461 unsigned char destinationID;
463 unsigned char destinationID;
462 unsigned char time[6];
464 unsigned char time[6];
463 // AUXILIARY HEADER
465 // AUXILIARY HEADER
464 unsigned char sid;
466 unsigned char sid;
465 unsigned char biaStatusInfo;
467 unsigned char biaStatusInfo;
466 unsigned char acquisitionTime[6];
468 unsigned char acquisitionTime[6];
467 unsigned char spare_source_data;
469 unsigned char spare_source_data;
468 unsigned char pa_lfr_bp_blk_nr[2];
470 unsigned char pa_lfr_bp_blk_nr[2];
469 } Header_TM_LFR_SCIENCE_BP_t;
471 } Header_TM_LFR_SCIENCE_BP_NORM_t;
472
473 typedef struct {
474 unsigned char targetLogicalAddress;
475 unsigned char protocolIdentifier;
476 unsigned char reserved;
477 unsigned char userApplication;
478 unsigned char packetID[2];
479 unsigned char packetSequenceControl[2];
480 unsigned char packetLength[2];
481 // DATA FIELD HEADER
482 unsigned char spare1_pusVersion_spare2;
483 unsigned char serviceType;
484 unsigned char serviceSubType;
485 unsigned char destinationID;
486 unsigned char time[6];
487 // AUXILIARY HEADER
488 unsigned char sid;
489 unsigned char biaStatusInfo;
490 unsigned char acquisitionTime[6];
491 unsigned char pa_lfr_bp_blk_nr[2];
492 } Header_TM_LFR_SCIENCE_BP_SBM_t;
470
493
471 typedef struct {
494 typedef struct {
472 //targetLogicalAddress is removed by the grspw module
495 //targetLogicalAddress is removed by the grspw module
473 unsigned char protocolIdentifier;
496 unsigned char protocolIdentifier;
474 unsigned char reserved;
497 unsigned char reserved;
475 unsigned char userApplication;
498 unsigned char userApplication;
476 unsigned char packetID[2];
499 unsigned char packetID[2];
477 unsigned char packetSequenceControl[2];
500 unsigned char packetSequenceControl[2];
478 unsigned char packetLength[2];
501 unsigned char packetLength[2];
479 // DATA FIELD HEADER
502 // DATA FIELD HEADER
480 unsigned char headerFlag_pusVersion_Ack;
503 unsigned char headerFlag_pusVersion_Ack;
481 unsigned char serviceType;
504 unsigned char serviceType;
482 unsigned char serviceSubType;
505 unsigned char serviceSubType;
483 unsigned char sourceID;
506 unsigned char sourceID;
484 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
507 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
485 } ccsdsTelecommandPacket_t;
508 } ccsdsTelecommandPacket_t;
486
509
487 typedef struct {
510 typedef struct {
488 unsigned char targetLogicalAddress;
511 unsigned char targetLogicalAddress;
489 unsigned char protocolIdentifier;
512 unsigned char protocolIdentifier;
490 unsigned char reserved;
513 unsigned char reserved;
491 unsigned char userApplication;
514 unsigned char userApplication;
492 unsigned char packetID[2];
515 unsigned char packetID[2];
493 unsigned char packetSequenceControl[2];
516 unsigned char packetSequenceControl[2];
494 unsigned char packetLength[2];
517 unsigned char packetLength[2];
495 unsigned char spare1_pusVersion_spare2;
518 unsigned char spare1_pusVersion_spare2;
496 unsigned char serviceType;
519 unsigned char serviceType;
497 unsigned char serviceSubType;
520 unsigned char serviceSubType;
498 unsigned char destinationID;
521 unsigned char destinationID;
499 unsigned char time[6];
522 unsigned char time[6];
500 unsigned char sid;
523 unsigned char sid;
501
524
502 //**************
525 //**************
503 // HK PARAMETERS
526 // HK PARAMETERS
504 unsigned char lfr_status_word[2];
527 unsigned char lfr_status_word[2];
505 unsigned char lfr_sw_version[4];
528 unsigned char lfr_sw_version[4];
506 unsigned char lfr_fpga_version[3];
529 unsigned char lfr_fpga_version[3];
507 // ressource statistics
530 // ressource statistics
508 unsigned char hk_lfr_cpu_load;
531 unsigned char hk_lfr_cpu_load;
509 unsigned char hk_lfr_load_max;
532 unsigned char hk_lfr_load_max;
510 unsigned char hk_lfr_load_aver;
533 unsigned char hk_lfr_load_aver;
511 // tc statistics
534 // tc statistics
512 unsigned char hk_lfr_update_info_tc_cnt[2];
535 unsigned char hk_lfr_update_info_tc_cnt[2];
513 unsigned char hk_lfr_update_time_tc_cnt[2];
536 unsigned char hk_lfr_update_time_tc_cnt[2];
514 unsigned char hk_lfr_exe_tc_cnt[2];
537 unsigned char hk_lfr_exe_tc_cnt[2];
515 unsigned char hk_lfr_rej_tc_cnt[2];
538 unsigned char hk_lfr_rej_tc_cnt[2];
516 unsigned char hk_lfr_last_exe_tc_id[2];
539 unsigned char hk_lfr_last_exe_tc_id[2];
517 unsigned char hk_lfr_last_exe_tc_type[2];
540 unsigned char hk_lfr_last_exe_tc_type[2];
518 unsigned char hk_lfr_last_exe_tc_subtype[2];
541 unsigned char hk_lfr_last_exe_tc_subtype[2];
519 unsigned char hk_lfr_last_exe_tc_time[6];
542 unsigned char hk_lfr_last_exe_tc_time[6];
520 unsigned char hk_lfr_last_rej_tc_id[2];
543 unsigned char hk_lfr_last_rej_tc_id[2];
521 unsigned char hk_lfr_last_rej_tc_type[2];
544 unsigned char hk_lfr_last_rej_tc_type[2];
522 unsigned char hk_lfr_last_rej_tc_subtype[2];
545 unsigned char hk_lfr_last_rej_tc_subtype[2];
523 unsigned char hk_lfr_last_rej_tc_time[6];
546 unsigned char hk_lfr_last_rej_tc_time[6];
524 // anomaly statistics
547 // anomaly statistics
525 unsigned char hk_lfr_le_cnt[2];
548 unsigned char hk_lfr_le_cnt[2];
526 unsigned char hk_lfr_me_cnt[2];
549 unsigned char hk_lfr_me_cnt[2];
527 unsigned char hk_lfr_he_cnt[2];
550 unsigned char hk_lfr_he_cnt[2];
528 unsigned char hk_lfr_last_er_rid[2];
551 unsigned char hk_lfr_last_er_rid[2];
529 unsigned char hk_lfr_last_er_code;
552 unsigned char hk_lfr_last_er_code;
530 unsigned char hk_lfr_last_er_time[6];
553 unsigned char hk_lfr_last_er_time[6];
531 // vhdl_blk_status
554 // vhdl_blk_status
532 unsigned char hk_lfr_vhdl_aa_sm;
555 unsigned char hk_lfr_vhdl_aa_sm;
533 unsigned char hk_lfr_vhdl_fft_sr;
556 unsigned char hk_lfr_vhdl_fft_sr;
534 unsigned char hk_lfr_vhdl_cic_hk;
557 unsigned char hk_lfr_vhdl_cic_hk;
535 unsigned char hk_lfr_vhdl_iir_cal;
558 unsigned char hk_lfr_vhdl_iir_cal;
536 // spacewire_if_statistics
559 // spacewire_if_statistics
537 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
560 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
538 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
561 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
539 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
562 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
540 unsigned char hk_lfr_dpu_spw_last_timc;
563 unsigned char hk_lfr_dpu_spw_last_timc;
541 // ahb error statistics
564 // ahb error statistics
542 unsigned int hk_lfr_last_fail_addr;
565 unsigned int hk_lfr_last_fail_addr;
543 // temperatures
566 // temperatures
544 unsigned char hk_lfr_temp_scm[2];
567 unsigned char hk_lfr_temp_scm[2];
545 unsigned char hk_lfr_temp_pcb[2];
568 unsigned char hk_lfr_temp_pcb[2];
546 unsigned char hk_lfr_temp_fpga[2];
569 unsigned char hk_lfr_temp_fpga[2];
547 // spacecraft potential
570 // spacecraft potential
548 unsigned char hk_lfr_sc_v_f3[2];
571 unsigned char hk_lfr_sc_v_f3[2];
549 unsigned char hk_lfr_sc_e1_f3[2];
572 unsigned char hk_lfr_sc_e1_f3[2];
550 unsigned char hk_lfr_sc_e2_f3[2];
573 unsigned char hk_lfr_sc_e2_f3[2];
551 // error counters
574 // error counters
552 unsigned char hk_lfr_dpu_spw_parity;
575 unsigned char hk_lfr_dpu_spw_parity;
553 unsigned char hk_lfr_dpu_spw_disconnect;
576 unsigned char hk_lfr_dpu_spw_disconnect;
554 unsigned char hk_lfr_dpu_spw_escape;
577 unsigned char hk_lfr_dpu_spw_escape;
555 unsigned char hk_lfr_dpu_spw_credit;
578 unsigned char hk_lfr_dpu_spw_credit;
556 unsigned char hk_lfr_dpu_spw_write_sync;
579 unsigned char hk_lfr_dpu_spw_write_sync;
557 unsigned char hk_lfr_dpu_spw_rx_ahb;
580 unsigned char hk_lfr_dpu_spw_rx_ahb;
558 unsigned char hk_lfr_dpu_spw_tx_ahb;
581 unsigned char hk_lfr_dpu_spw_tx_ahb;
559 unsigned char hk_lfr_dpu_spw_early_eop;
582 unsigned char hk_lfr_dpu_spw_early_eop;
560 unsigned char hk_lfr_dpu_spw_invalid_addr;
583 unsigned char hk_lfr_dpu_spw_invalid_addr;
561 unsigned char hk_lfr_dpu_spw_eep;
584 unsigned char hk_lfr_dpu_spw_eep;
562 unsigned char hk_lfr_dpu_spw_rx_too_big;
585 unsigned char hk_lfr_dpu_spw_rx_too_big;
563 // timecode
586 // timecode
564 unsigned char hk_lfr_timecode_erroneous;
587 unsigned char hk_lfr_timecode_erroneous;
565 unsigned char hk_lfr_timecode_missing;
588 unsigned char hk_lfr_timecode_missing;
566 unsigned char hk_lfr_timecode_invalid;
589 unsigned char hk_lfr_timecode_invalid;
567 // time
590 // time
568 unsigned char hk_lfr_time_timecode_it;
591 unsigned char hk_lfr_time_timecode_it;
569 unsigned char hk_lfr_time_not_synchro;
592 unsigned char hk_lfr_time_not_synchro;
570 unsigned char hk_lfr_time_timecode_ctr;
593 unsigned char hk_lfr_time_timecode_ctr;
571 // hk_lfr_buffer_dpu_
594 // hk_lfr_buffer_dpu_
572 unsigned char hk_lfr_buffer_dpu_tc_fifo;
595 unsigned char hk_lfr_buffer_dpu_tc_fifo;
573 unsigned char hk_lfr_buffer_dpu_tm_fifo;
596 unsigned char hk_lfr_buffer_dpu_tm_fifo;
574 // hk_lfr_ahb_
597 // hk_lfr_ahb_
575 unsigned char hk_lfr_ahb_correctable;
598 unsigned char hk_lfr_ahb_correctable;
576 unsigned char hk_lfr_ahb_uncorrectable;
599 unsigned char hk_lfr_ahb_uncorrectable;
577 // spare
600 // spare
578 unsigned char parameters_spare;
601 unsigned char parameters_spare;
579 } Packet_TM_LFR_HK_t;
602 } Packet_TM_LFR_HK_t;
580
603
581 typedef struct {
604 typedef struct {
582 unsigned char targetLogicalAddress;
605 unsigned char targetLogicalAddress;
583 unsigned char protocolIdentifier;
606 unsigned char protocolIdentifier;
584 unsigned char reserved;
607 unsigned char reserved;
585 unsigned char userApplication;
608 unsigned char userApplication;
586 unsigned char packetID[2];
609 unsigned char packetID[2];
587 unsigned char packetSequenceControl[2];
610 unsigned char packetSequenceControl[2];
588 unsigned char packetLength[2];
611 unsigned char packetLength[2];
589 // DATA FIELD HEADER
612 // DATA FIELD HEADER
590 unsigned char spare1_pusVersion_spare2;
613 unsigned char spare1_pusVersion_spare2;
591 unsigned char serviceType;
614 unsigned char serviceType;
592 unsigned char serviceSubType;
615 unsigned char serviceSubType;
593 unsigned char destinationID;
616 unsigned char destinationID;
594 unsigned char time[6];
617 unsigned char time[6];
595 unsigned char sid;
618 unsigned char sid;
596
619
597 //******************
620 //******************
598 // COMMON PARAMETERS
621 // COMMON PARAMETERS
599 unsigned char unused0;
622 unsigned char unused0;
600 unsigned char bw_sp0_sp1_r0_r1;
623 unsigned char bw_sp0_sp1_r0_r1;
601
624
602 //******************
625 //******************
603 // NORMAL PARAMETERS
626 // NORMAL PARAMETERS
604 unsigned char sy_lfr_n_swf_l[2];
627 unsigned char sy_lfr_n_swf_l[2];
605 unsigned char sy_lfr_n_swf_p[2];
628 unsigned char sy_lfr_n_swf_p[2];
606 unsigned char sy_lfr_n_asm_p[2];
629 unsigned char sy_lfr_n_asm_p[2];
607 unsigned char sy_lfr_n_bp_p0;
630 unsigned char sy_lfr_n_bp_p0;
608 unsigned char sy_lfr_n_bp_p1;
631 unsigned char sy_lfr_n_bp_p1;
609 unsigned char sy_lfr_n_cwf_long_f3;
632 unsigned char sy_lfr_n_cwf_long_f3;
610 unsigned char lfr_normal_parameters_spare;
633 unsigned char lfr_normal_parameters_spare;
611
634
612 //*****************
635 //*****************
613 // BURST PARAMETERS
636 // BURST PARAMETERS
614 unsigned char sy_lfr_b_bp_p0;
637 unsigned char sy_lfr_b_bp_p0;
615 unsigned char sy_lfr_b_bp_p1;
638 unsigned char sy_lfr_b_bp_p1;
616
639
617 //****************
640 //****************
618 // SBM1 PARAMETERS
641 // SBM1 PARAMETERS
619 unsigned char sy_lfr_s1_bp_p0;
642 unsigned char sy_lfr_s1_bp_p0;
620 unsigned char sy_lfr_s1_bp_p1;
643 unsigned char sy_lfr_s1_bp_p1;
621
644
622 //****************
645 //****************
623 // SBM2 PARAMETERS
646 // SBM2 PARAMETERS
624 unsigned char sy_lfr_s2_bp_p0;
647 unsigned char sy_lfr_s2_bp_p0;
625 unsigned char sy_lfr_s2_bp_p1;
648 unsigned char sy_lfr_s2_bp_p1;
626
649
627 // SPARE
650 // SPARE
628 unsigned char source_data_spare;
651 unsigned char source_data_spare;
629 } Packet_TM_LFR_PARAMETER_DUMP_t;
652 } Packet_TM_LFR_PARAMETER_DUMP_t;
630
653
631
654
632 #endif // CCSDS_TYPES_H_INCLUDED
655 #endif // CCSDS_TYPES_H_INCLUDED
@@ -1,235 +1,257
1 #ifndef FSW_PARAMS_H_INCLUDED
1 #ifndef FSW_PARAMS_H_INCLUDED
2 #define FSW_PARAMS_H_INCLUDED
2 #define FSW_PARAMS_H_INCLUDED
3
3
4 #include "grlib_regs.h"
4 #include "grlib_regs.h"
5 #include "fsw_params_processing.h"
5 #include "fsw_params_processing.h"
6 #include "fsw_params_nb_bytes.h"
6 #include "fsw_params_nb_bytes.h"
7 #include "tm_byte_positions.h"
7 #include "tm_byte_positions.h"
8 #include "ccsds_types.h"
8 #include "ccsds_types.h"
9
9
10 #define GRSPW_DEVICE_NAME "/dev/grspw0"
10 #define GRSPW_DEVICE_NAME "/dev/grspw0"
11 #define UART_DEVICE_NAME "/dev/console"
11 #define UART_DEVICE_NAME "/dev/console"
12
12
13 typedef struct ring_node
13 typedef struct ring_node
14 {
14 {
15 struct ring_node *previous;
15 struct ring_node *previous;
16 int buffer_address;
16 int buffer_address;
17 struct ring_node *next;
17 struct ring_node *next;
18 unsigned int status;
18 unsigned int status;
19 } ring_node;
19 } ring_node;
20
20
21 typedef struct ring_node_sm
21 typedef struct ring_node_sm
22 {
22 {
23 struct ring_node_sm *previous;
23 struct ring_node_sm *previous;
24 int buffer_address;
24 int buffer_address;
25 struct ring_node_sm *next;
25 struct ring_node_sm *next;
26 unsigned int status;
26 unsigned int status;
27 unsigned int coarseTime;
27 unsigned int coarseTime;
28 unsigned int fineTime;
28 unsigned int fineTime;
29 } ring_node_sm;
29 } ring_node_sm;
30
30
31 typedef struct ring_node_bp
32 {
33 struct ring_node_bp *previous;
34 struct ring_node_bp *next;
35 unsigned int status;
36 unsigned int coarseTime;
37 unsigned int fineTime;
38 Header_TM_LFR_SCIENCE_BP_SBM_t header;
39 unsigned char data[ 9 * 22 ];
40 } ring_node_bp;
41
42 typedef struct
43 {
44 unsigned int status;
45 unsigned int coarseTime;
46 unsigned int fineTime;
47 Header_TM_LFR_SCIENCE_BP_NORM_t header;
48 unsigned char data[ 9 * 22 ];
49 } ring_node_norm_bp;
50
31 //************************
51 //************************
32 // flight software version
52 // flight software version
33 // this parameters is handled by the Qt project options
53 // this parameters is handled by the Qt project options
34
54
35 #define NB_PACKETS_PER_GROUP_OF_CWF 8 // 8 packets containing 336 blk
55 #define NB_PACKETS_PER_GROUP_OF_CWF 8 // 8 packets containing 336 blk
36 #define NB_PACKETS_PER_GROUP_OF_CWF_LIGHT 4 // 4 packets containing 672 blk
56 #define NB_PACKETS_PER_GROUP_OF_CWF_LIGHT 4 // 4 packets containing 672 blk
37 #define NB_SAMPLES_PER_SNAPSHOT 2688 // 336 * 8 = 672 * 4 = 2688
57 #define NB_SAMPLES_PER_SNAPSHOT 2688 // 336 * 8 = 672 * 4 = 2688
38 #define TIME_OFFSET 2
58 #define TIME_OFFSET 2
39 #define TIME_OFFSET_IN_BYTES 8
59 #define TIME_OFFSET_IN_BYTES 8
40 #define WAVEFORM_EXTENDED_HEADER_OFFSET 22
60 #define WAVEFORM_EXTENDED_HEADER_OFFSET 22
41 #define NB_BYTES_SWF_BLK (2 * 6)
61 #define NB_BYTES_SWF_BLK (2 * 6)
42 #define NB_WORDS_SWF_BLK 3
62 #define NB_WORDS_SWF_BLK 3
43 #define NB_BYTES_CWF3_LIGHT_BLK 6
63 #define NB_BYTES_CWF3_LIGHT_BLK 6
44 #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8
64 #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8
45 #define NB_RING_NODES_F0 3 // AT LEAST 3
65 #define NB_RING_NODES_F0 3 // AT LEAST 3
46 #define NB_RING_NODES_F1 5 // AT LEAST 3
66 #define NB_RING_NODES_F1 5 // AT LEAST 3
47 #define NB_RING_NODES_F2 5 // AT LEAST 3
67 #define NB_RING_NODES_F2 5 // AT LEAST 3
48
68
49 //**********
69 //**********
50 // LFR MODES
70 // LFR MODES
51 #define LFR_MODE_STANDBY 0
71 #define LFR_MODE_STANDBY 0
52 #define LFR_MODE_NORMAL 1
72 #define LFR_MODE_NORMAL 1
53 #define LFR_MODE_BURST 2
73 #define LFR_MODE_BURST 2
54 #define LFR_MODE_SBM1 3
74 #define LFR_MODE_SBM1 3
55 #define LFR_MODE_SBM2 4
75 #define LFR_MODE_SBM2 4
56
76
57 #define TDS_MODE_LFM 5
77 #define TDS_MODE_LFM 5
58 #define TDS_MODE_STANDBY 0
78 #define TDS_MODE_STANDBY 0
59 #define TDS_MODE_NORMAL 1
79 #define TDS_MODE_NORMAL 1
60 #define TDS_MODE_BURST 2
80 #define TDS_MODE_BURST 2
61 #define TDS_MODE_SBM1 3
81 #define TDS_MODE_SBM1 3
62 #define TDS_MODE_SBM2 4
82 #define TDS_MODE_SBM2 4
63
83
64 #define THR_MODE_STANDBY 0
84 #define THR_MODE_STANDBY 0
65 #define THR_MODE_NORMAL 1
85 #define THR_MODE_NORMAL 1
66 #define THR_MODE_BURST 2
86 #define THR_MODE_BURST 2
67
87
68 #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0
88 #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0
69 #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1
89 #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1
70 #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2
90 #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2
71 #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3
91 #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3
72 #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4
92 #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4
73 #define RTEMS_EVENT_MODE_SBM2_WFRM RTEMS_EVENT_5
93 #define RTEMS_EVENT_MODE_SBM2_WFRM RTEMS_EVENT_5
74 #define RTEMS_EVENT_MODE_NORMAL_SWF_F0 RTEMS_EVENT_6
94 #define RTEMS_EVENT_MODE_NORMAL_SWF_F0 RTEMS_EVENT_6
75 #define RTEMS_EVENT_MODE_NORMAL_SWF_F1 RTEMS_EVENT_7
95 #define RTEMS_EVENT_MODE_NORMAL_SWF_F1 RTEMS_EVENT_7
76 #define RTEMS_EVENT_MODE_NORMAL_SWF_F2 RTEMS_EVENT_8
96 #define RTEMS_EVENT_MODE_NORMAL_SWF_F2 RTEMS_EVENT_8
77
97
78 //****************************
98 //****************************
79 // LFR DEFAULT MODE PARAMETERS
99 // LFR DEFAULT MODE PARAMETERS
80 // COMMON
100 // COMMON
81 #define DEFAULT_SY_LFR_COMMON0 0x00
101 #define DEFAULT_SY_LFR_COMMON0 0x00
82 #define DEFAULT_SY_LFR_COMMON1 0x10 // default value 0 0 0 1 0 0 0 0
102 #define DEFAULT_SY_LFR_COMMON1 0x10 // default value 0 0 0 1 0 0 0 0
83 // NORM
103 // NORM
84 #define SY_LFR_N_SWF_L 2048 // nb sample
104 #define SY_LFR_N_SWF_L 2048 // nb sample
85 #define SY_LFR_N_SWF_P 300 // sec
105 #define SY_LFR_N_SWF_P 300 // sec
86 #define SY_LFR_N_ASM_P 3600 // sec
106 #define SY_LFR_N_ASM_P 3600 // sec
87 #define SY_LFR_N_BP_P0 4 // sec
107 #define SY_LFR_N_BP_P0 4 // sec
88 #define SY_LFR_N_BP_P1 20 // sec
108 #define SY_LFR_N_BP_P1 20 // sec
89 #define SY_LFR_N_CWF_LONG_F3 0 // 0 => production of light continuous waveforms at f3
109 #define SY_LFR_N_CWF_LONG_F3 0 // 0 => production of light continuous waveforms at f3
90 #define MIN_DELTA_SNAPSHOT 16 // sec
110 #define MIN_DELTA_SNAPSHOT 16 // sec
91 // BURST
111 // BURST
92 #define DEFAULT_SY_LFR_B_BP_P0 1 // sec
112 #define DEFAULT_SY_LFR_B_BP_P0 1 // sec
93 #define DEFAULT_SY_LFR_B_BP_P1 5 // sec
113 #define DEFAULT_SY_LFR_B_BP_P1 5 // sec
94 // SBM1
114 // SBM1
95 #define DEFAULT_SY_LFR_S1_BP_P0 1 // sec
115 #define DEFAULT_SY_LFR_S1_BP_P0 1 // sec
96 #define DEFAULT_SY_LFR_S1_BP_P1 1 // sec
116 #define DEFAULT_SY_LFR_S1_BP_P1 1 // sec
97 // SBM2
117 // SBM2
98 #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec
118 #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec
99 #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec
119 #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec
100 // ADDITIONAL PARAMETERS
120 // ADDITIONAL PARAMETERS
101 #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms
121 #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms
102 #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s
122 #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s
103 // STATUS WORD
123 // STATUS WORD
104 #define DEFAULT_STATUS_WORD_BYTE0 0x0d // [0000] [1] [101] mode 4 bits / SPW enabled 1 bit / state is run 3 bits
124 #define DEFAULT_STATUS_WORD_BYTE0 0x0d // [0000] [1] [101] mode 4 bits / SPW enabled 1 bit / state is run 3 bits
105 #define DEFAULT_STATUS_WORD_BYTE1 0x00
125 #define DEFAULT_STATUS_WORD_BYTE1 0x00
106 //
126 //
107 #define SY_LFR_DPU_CONNECT_TIMEOUT 100 // 100 * 10 ms = 1 s
127 #define SY_LFR_DPU_CONNECT_TIMEOUT 100 // 100 * 10 ms = 1 s
108 #define SY_LFR_DPU_CONNECT_ATTEMPT 3
128 #define SY_LFR_DPU_CONNECT_ATTEMPT 3
109 //****************************
129 //****************************
110
130
111 //*****************************
131 //*****************************
112 // APB REGISTERS BASE ADDRESSES
132 // APB REGISTERS BASE ADDRESSES
113 #define REGS_ADDR_APBUART 0x80000100
133 #define REGS_ADDR_APBUART 0x80000100
114 #define REGS_ADDR_GPTIMER 0x80000300
134 #define REGS_ADDR_GPTIMER 0x80000300
115 #define REGS_ADDR_GRSPW 0x80000500
135 #define REGS_ADDR_GRSPW 0x80000500
116 #define REGS_ADDR_TIME_MANAGEMENT 0x80000600
136 #define REGS_ADDR_TIME_MANAGEMENT 0x80000600
117 #define REGS_ADDR_GRGPIO 0x80000b00
137 #define REGS_ADDR_GRGPIO 0x80000b00
118
138
119 #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00
139 #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00
120 #define REGS_ADDR_WAVEFORM_PICKER 0x80000f40
140 #define REGS_ADDR_WAVEFORM_PICKER 0x80000f40
121
141
122 #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff
142 #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff
123 #define APBUART_CTRL_REG_MASK_TE 0x00000002
143 #define APBUART_CTRL_REG_MASK_TE 0x00000002
124 #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 (0x50)
144 #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 (0x50)
125
145
126 //**********
146 //**********
127 // IRQ LINES
147 // IRQ LINES
128 #define IRQ_SM_SIMULATOR 9
148 #define IRQ_SM_SIMULATOR 9
129 #define IRQ_SPARC_SM_SIMULATOR 0x19 // see sparcv8.pdf p.76 for interrupt levels
149 #define IRQ_SPARC_SM_SIMULATOR 0x19 // see sparcv8.pdf p.76 for interrupt levels
130 #define IRQ_WAVEFORM_PICKER 14
150 #define IRQ_WAVEFORM_PICKER 14
131 #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels
151 #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels
132 #define IRQ_SPECTRAL_MATRIX 6
152 #define IRQ_SPECTRAL_MATRIX 6
133 #define IRQ_SPARC_SPECTRAL_MATRIX 0x16 // see sparcv8.pdf p.76 for interrupt levels
153 #define IRQ_SPARC_SPECTRAL_MATRIX 0x16 // see sparcv8.pdf p.76 for interrupt levels
134
154
135 //*****
155 //*****
136 // TIME
156 // TIME
137 #define CLKDIV_SM_SIMULATOR (10000 - 1) // 10 ms
157 #define CLKDIV_SM_SIMULATOR (10000 - 1) // 10 ms
138 #define TIMER_SM_SIMULATOR 1
158 #define TIMER_SM_SIMULATOR 1
139 #define HK_PERIOD 100 // 100 * 10ms => 1s
159 #define HK_PERIOD 100 // 100 * 10ms => 1s
140 #define SY_LFR_TIME_SYN_TIMEOUT_in_ms 2000
160 #define SY_LFR_TIME_SYN_TIMEOUT_in_ms 2000
141 #define SY_LFR_TIME_SYN_TIMEOUT_in_ticks 200 // 200 * 10 ms = 2 s
161 #define SY_LFR_TIME_SYN_TIMEOUT_in_ticks 200 // 200 * 10 ms = 2 s
142
162
143 //**********
163 //**********
144 // LPP CODES
164 // LPP CODES
145 #define LFR_SUCCESSFUL 0
165 #define LFR_SUCCESSFUL 0
146 #define LFR_DEFAULT 1
166 #define LFR_DEFAULT 1
167 #define LFR_EXE_ERROR 2
147
168
148 //******
169 //******
149 // RTEMS
170 // RTEMS
150 #define TASKID_RECV 1
171 #define TASKID_RECV 1
151 #define TASKID_ACTN 2
172 #define TASKID_ACTN 2
152 #define TASKID_SPIQ 3
173 #define TASKID_SPIQ 3
153 #define TASKID_SMIQ 4
174 #define TASKID_SMIQ 4
154 #define TASKID_STAT 5
175 #define TASKID_STAT 5
155 #define TASKID_AVF0 6
176 #define TASKID_AVF0 6
156 #define TASKID_SWBD 7
177 #define TASKID_SWBD 7
157 #define TASKID_WFRM 8
178 #define TASKID_WFRM 8
158 #define TASKID_DUMB 9
179 #define TASKID_DUMB 9
159 #define TASKID_HOUS 10
180 #define TASKID_HOUS 10
160 #define TASKID_MATR 11
181 #define TASKID_MATR 11
161 #define TASKID_CWF3 12
182 #define TASKID_CWF3 12
162 #define TASKID_CWF2 13
183 #define TASKID_CWF2 13
163 #define TASKID_CWF1 14
184 #define TASKID_CWF1 14
164 #define TASKID_SEND 15
185 #define TASKID_SEND 15
165 #define TASKID_WTDG 16
186 #define TASKID_WTDG 16
166
187
167 #define TASK_PRIORITY_SPIQ 5
188 #define TASK_PRIORITY_SPIQ 5
168 #define TASK_PRIORITY_SMIQ 10
189 #define TASK_PRIORITY_SMIQ 10
169 #define TASK_PRIORITY_WTDG 20
190 #define TASK_PRIORITY_WTDG 20
170 #define TASK_PRIORITY_HOUS 30
191 #define TASK_PRIORITY_HOUS 30
171 #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together
192 #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together
172 #define TASK_PRIORITY_CWF2 35 //
193 #define TASK_PRIORITY_CWF2 35 //
173 #define TASK_PRIORITY_SWBD 37 // SWBD has a lower priority than WFRM, this is to extract the snapshot before sending it
194 #define TASK_PRIORITY_SWBD 37 // SWBD has a lower priority than WFRM, this is to extract the snapshot before sending it
174 #define TASK_PRIORITY_WFRM 40
195 #define TASK_PRIORITY_WFRM 40
175 #define TASK_PRIORITY_CWF3 40 // there is a printf in this function, be careful with its priority wrt CWF1
196 #define TASK_PRIORITY_CWF3 40 // there is a printf in this function, be careful with its priority wrt CWF1
176 #define TASK_PRIORITY_SEND 45
197 #define TASK_PRIORITY_SEND 45
177 #define TASK_PRIORITY_RECV 50
198 #define TASK_PRIORITY_RECV 50
178 #define TASK_PRIORITY_ACTN 50
199 #define TASK_PRIORITY_ACTN 50
179 #define TASK_PRIORITY_AVF0 60
200 #define TASK_PRIORITY_AVF0 60
180 #define TASK_PRIORITY_BPF0 60
201 #define TASK_PRIORITY_BPF0 60
181 #define TASK_PRIORITY_MATR 100
202 #define TASK_PRIORITY_MATR 100
182 #define TASK_PRIORITY_STAT 200
203 #define TASK_PRIORITY_STAT 200
183 #define TASK_PRIORITY_DUMB 200
204 #define TASK_PRIORITY_DUMB 200
184
205
185 #define ACTION_MSG_QUEUE_COUNT 10
206 #define ACTION_MSG_QUEUE_COUNT 10
186 #define ACTION_MSG_PKTS_COUNT 50
207 #define ACTION_MSG_PKTS_COUNT 50
187 #define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES)
208 //#define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES)
209 #define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_TM_LFR_SCIENCE_SBM1_BP1_F0 + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES)
188 #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options
210 #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options
189
211
190 #define QUEUE_RECV 0
212 #define QUEUE_RECV 0
191 #define QUEUE_SEND 1
213 #define QUEUE_SEND 1
192
214
193 //*******
215 //*******
194 // MACROS
216 // MACROS
195 #ifdef PRINT_MESSAGES_ON_CONSOLE
217 #ifdef PRINT_MESSAGES_ON_CONSOLE
196 #define PRINTF(x) printf(x);
218 #define PRINTF(x) printf(x);
197 #define PRINTF1(x,y) printf(x,y);
219 #define PRINTF1(x,y) printf(x,y);
198 #define PRINTF2(x,y,z) printf(x,y,z);
220 #define PRINTF2(x,y,z) printf(x,y,z);
199 #else
221 #else
200 #define PRINTF(x) ;
222 #define PRINTF(x) ;
201 #define PRINTF1(x,y) ;
223 #define PRINTF1(x,y) ;
202 #define PRINTF2(x,y,z) ;
224 #define PRINTF2(x,y,z) ;
203 #endif
225 #endif
204
226
205 #ifdef BOOT_MESSAGES
227 #ifdef BOOT_MESSAGES
206 #define BOOT_PRINTF(x) printf(x);
228 #define BOOT_PRINTF(x) printf(x);
207 #define BOOT_PRINTF1(x,y) printf(x,y);
229 #define BOOT_PRINTF1(x,y) printf(x,y);
208 #define BOOT_PRINTF2(x,y,z) printf(x,y,z);
230 #define BOOT_PRINTF2(x,y,z) printf(x,y,z);
209 #else
231 #else
210 #define BOOT_PRINTF(x) ;
232 #define BOOT_PRINTF(x) ;
211 #define BOOT_PRINTF1(x,y) ;
233 #define BOOT_PRINTF1(x,y) ;
212 #define BOOT_PRINTF2(x,y,z) ;
234 #define BOOT_PRINTF2(x,y,z) ;
213 #endif
235 #endif
214
236
215 #ifdef DEBUG_MESSAGES
237 #ifdef DEBUG_MESSAGES
216 #define DEBUG_PRINTF(x) printf(x);
238 #define DEBUG_PRINTF(x) printf(x);
217 #define DEBUG_PRINTF1(x,y) printf(x,y);
239 #define DEBUG_PRINTF1(x,y) printf(x,y);
218 #define DEBUG_PRINTF2(x,y,z) printf(x,y,z);
240 #define DEBUG_PRINTF2(x,y,z) printf(x,y,z);
219 #else
241 #else
220 #define DEBUG_PRINTF(x) ;
242 #define DEBUG_PRINTF(x) ;
221 #define DEBUG_PRINTF1(x,y) ;
243 #define DEBUG_PRINTF1(x,y) ;
222 #define DEBUG_PRINTF2(x,y,z) ;
244 #define DEBUG_PRINTF2(x,y,z) ;
223 #endif
245 #endif
224
246
225 #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period
247 #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period
226
248
227 struct param_local_str{
249 struct param_local_str{
228 unsigned int local_sbm1_nb_cwf_sent;
250 unsigned int local_sbm1_nb_cwf_sent;
229 unsigned int local_sbm1_nb_cwf_max;
251 unsigned int local_sbm1_nb_cwf_max;
230 unsigned int local_sbm2_nb_cwf_sent;
252 unsigned int local_sbm2_nb_cwf_sent;
231 unsigned int local_sbm2_nb_cwf_max;
253 unsigned int local_sbm2_nb_cwf_max;
232 unsigned int local_nb_interrupt_f0_MAX;
254 unsigned int local_nb_interrupt_f0_MAX;
233 };
255 };
234
256
235 #endif // FSW_PARAMS_H_INCLUDED
257 #endif // FSW_PARAMS_H_INCLUDED
@@ -1,59 +1,53
1 #ifndef FSW_PARAMS_PROCESSING_H
1 #ifndef FSW_PARAMS_PROCESSING_H
2 #define FSW_PARAMS_PROCESSING_H
2 #define FSW_PARAMS_PROCESSING_H
3
3
4 #define NB_BINS_PER_SM 128
4 #define NB_BINS_PER_SM 128
5 #define NB_VALUES_PER_SM 25
5 #define NB_VALUES_PER_SM 25
6 #define TOTAL_SIZE_SM 3200 // 25 * 128
6 #define TOTAL_SIZE_SM 3200 // 25 * 128
7 #define TOTAL_SIZE_BP1_F0 99 // 11 * 9 = 99
7 #define TOTAL_SIZE_NORM_BP1_F0 99 // 11 * 9 = 99
8 #define TOTAL_SIZE_BP1_F1 117 // 13 * 9 = 117
8 #define TOTAL_SIZE_NORM_BP1_F1 117 // 13 * 9 = 117
9 #define TOTAL_SIZE_BP1_F2 108 // 12 * 9 = 108
9 #define TOTAL_SIZE_NORM_BP1_F2 108 // 12 * 9 = 108
10 #define TOTAL_SIZE_SBM1_BP1_F0 198 // 22 * 9 = 198
10 //
11 //
11 #define NB_RING_NODES_ASM_F0 12 // AT LEAST 3
12 #define NB_RING_NODES_ASM_F0 12 // AT LEAST 3
12 #define NB_RING_NODES_ASM_F1 2 // AT LEAST 3
13 #define NB_RING_NODES_ASM_F1 2 // AT LEAST 3
13 #define NB_RING_NODES_ASM_F2 2 // AT LEAST 3
14 #define NB_RING_NODES_ASM_F2 2 // AT LEAST 3
15 #define NB_RING_NODES_BP1_SBM1 10 // AT LEAST 3
14 //
16 //
15 #define NB_BINS_PER_ASM_F0 88
17 #define NB_BINS_PER_ASM_F0 88
16 #define NB_BINS_PER_PKT_ASM_F0 44
18 #define NB_BINS_PER_PKT_ASM_F0 44
17 #define TOTAL_SIZE_ASM_F0_IN_BYTES 4400 // 25 * 88 * 2
19 #define TOTAL_SIZE_ASM_F0_IN_BYTES 4400 // 25 * 88 * 2
18 #define ASM_F0_INDICE_START 17 // 88 bins
20 #define ASM_F0_INDICE_START 17 // 88 bins
19 #define ASM_F0_INDICE_STOP 104 // 2 packets of 44 bins
21 #define ASM_F0_INDICE_STOP 104 // 2 packets of 44 bins
20 //
22 //
21 #define NB_BINS_PER_ASM_F1 104
23 #define NB_BINS_PER_ASM_F1 104
22 #define NB_BINS_PER_PKT_ASM_F1 52
24 #define NB_BINS_PER_PKT_ASM_F1 52
23 #define TOTAL_SIZE_ASM_F1 2600 // 25 * 104
25 #define TOTAL_SIZE_ASM_F1 2600 // 25 * 104
24 #define ASM_F1_INDICE_START 6 // 104 bins
26 #define ASM_F1_INDICE_START 6 // 104 bins
25 #define ASM_F1_INDICE_STOP 109 // 2 packets of 52 bins
27 #define ASM_F1_INDICE_STOP 109 // 2 packets of 52 bins
26 //
28 //
27 #define NB_BINS_PER_ASM_F2 96
29 #define NB_BINS_PER_ASM_F2 96
28 #define NB_BINS_PER_PKT_ASM_F2 48
30 #define NB_BINS_PER_PKT_ASM_F2 48
29 #define TOTAL_SIZE_ASM_F2 2400 // 25 * 96
31 #define TOTAL_SIZE_ASM_F2 2400 // 25 * 96
30 #define ASM_F2_INDICE_START 7 // 96 bins
32 #define ASM_F2_INDICE_START 7 // 96 bins
31 #define ASM_F2_INDICE_STOP 102 // 2 packets of 48 bins
33 #define ASM_F2_INDICE_STOP 102 // 2 packets of 48 bins
32 //
34 //
33 #define NB_BINS_COMPRESSED_SM_F0 11
35 #define NB_BINS_COMPRESSED_SM_F0 11
34 #define NB_BINS_COMPRESSED_SM_F1 13
36 #define NB_BINS_COMPRESSED_SM_F1 13
35 #define NB_BINS_COMPRESSED_SM_F2 12
37 #define NB_BINS_COMPRESSED_SM_F2 12
38 #define NB_BINS_COMPRESSED_SM_SBM1_F0 22
36 //
39 //
37 #define NB_BINS_TO_AVERAGE_ASM_F0 8
40 #define NB_BINS_TO_AVERAGE_ASM_F0 8
38 #define NB_BINS_TO_AVERAGE_ASM_F1 8
41 #define NB_BINS_TO_AVERAGE_ASM_F1 8
39 #define NB_BINS_TO_AVERAGE_ASM_F2 8
42 #define NB_BINS_TO_AVERAGE_ASM_F2 8
43 #define NB_BINS_TO_AVERAGE_ASM_SBM1_F0 4
40 //
44 //
41 #define TOTAL_SIZE_COMPRESSED_ASM_F0 275 // 11 * 25 WORDS
45 #define TOTAL_SIZE_COMPRESSED_ASM_F0 275 // 11 * 25 WORDS
42 #define TOTAL_SIZE_COMPRESSED_ASM_F1 325 // 13 * 25 WORDS
46 #define TOTAL_SIZE_COMPRESSED_ASM_F1 325 // 13 * 25 WORDS
43 #define TOTAL_SIZE_COMPRESSED_ASM_F2 300 // 12 * 25 WORDS
47 #define TOTAL_SIZE_COMPRESSED_ASM_F2 300 // 12 * 25 WORDS
44 #define TOTAL_SIZE_COMPRESSED_ASM_SBM1 550 // 22 * 25 WORDS
48 #define TOTAL_SIZE_COMPRESSED_ASM_SBM1 550 // 22 * 25 WORDS
45 #define NB_AVERAGE_NORMAL_F0 384 // 96 * 4
49 #define NB_AVERAGE_NORMAL_F0 384 // 96 * 4
46 #define NB_AVERAGE_SBM1_F0 24 // 24 matrices at f0 = 0.25 second
50 #define NB_AVERAGE_SBM1_F0 24 // 24 matrices at f0 = 0.25 second
47 #define NB_SM_TO_RECEIVE_BEFORE_AVF0 8
51 #define NB_SM_TO_RECEIVE_BEFORE_AVF0 8
48
49 typedef struct {
50 volatile unsigned char PE[2];
51 volatile unsigned char PB[2];
52 volatile unsigned char V0;
53 volatile unsigned char V1;
54 volatile unsigned char V2_ELLIP_DOP;
55 volatile unsigned char SZ;
56 volatile unsigned char VPHI;
57 } BP1_t;
58
52
59 #endif // FSW_PARAMS_PROCESSING_H
53 #endif // FSW_PARAMS_PROCESSING_H
@@ -1,57 +1,64
1 #ifndef FSW_PROCESSING_H_INCLUDED
1 #ifndef FSW_PROCESSING_H_INCLUDED
2 #define FSW_PROCESSING_H_INCLUDED
2 #define FSW_PROCESSING_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <grspw.h>
5 #include <grspw.h>
6 #include <math.h>
6 #include <math.h>
7 #include <stdlib.h> // abs() is in the stdlib
7 #include <stdlib.h> // abs() is in the stdlib
8 #include <stdio.h> // printf()
8 #include <stdio.h> // printf()
9 #include <math.h>
9 #include <math.h>
10
10
11 #include "fsw_params.h"
11 #include "fsw_params.h"
12 #include "fsw_spacewire.h"
12 #include "fsw_spacewire.h"
13
13
14 extern volatile int sm_f0[ ];
14 extern volatile int sm_f0[ ];
15 extern volatile int sm_f1[ ];
15 extern volatile int sm_f1[ ];
16 extern volatile int sm_f2[ ];
16 extern volatile int sm_f2[ ];
17
17
18 // parameters
18 // parameters
19 extern struct param_local_str param_local;
19 extern struct param_local_str param_local;
20
20
21 // registers
21 // registers
22 extern time_management_regs_t *time_management_regs;
22 extern time_management_regs_t *time_management_regs;
23 extern spectral_matrix_regs_t *spectral_matrix_regs;
23 extern spectral_matrix_regs_t *spectral_matrix_regs;
24
24
25 extern rtems_name misc_name[5];
25 extern rtems_name misc_name[5];
26 extern rtems_id Task_id[20]; /* array of task ids */
26 extern rtems_id Task_id[20]; /* array of task ids */
27
27
28 void init_sm_rings( void );
28 void init_sm_rings( void );
29 void reset_current_sm_ring_nodes( void );
29 void reset_current_sm_ring_nodes( void );
30
30
31 // ISR
31 // ISR
32 void reset_nb_sm_f0( void );
32 void reset_nb_sm_f0( void );
33 rtems_isr spectral_matrices_isr( rtems_vector_number vector );
33 rtems_isr spectral_matrices_isr( rtems_vector_number vector );
34 rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector );
34 rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector );
35
35
36 // RTEMS TASKS
36 // RTEMS TASKS
37 rtems_task avf0_task(rtems_task_argument argument);
37 rtems_task avf0_task(rtems_task_argument argument);
38 rtems_task smiq_task(rtems_task_argument argument); // added to test the spectral matrix simulator
38 rtems_task smiq_task(rtems_task_argument argument); // added to test the spectral matrix simulator
39 rtems_task matr_task(rtems_task_argument argument);
39 rtems_task matr_task(rtems_task_argument argument);
40
40
41 void BP1_set_old(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * LFR_BP1);
41 //*****************************
42 void BP2_set_old(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat);
42 // Spectral matrices processing
43 //
43
44 void init_header_asm( Header_TM_LFR_SCIENCE_ASM_t *header);
45 void matrix_reset(volatile float *averaged_spec_mat);
46 void ASM_average(float *averaged_spec_mat_f0, float *averaged_spec_mat_f1,
44 void ASM_average(float *averaged_spec_mat_f0, float *averaged_spec_mat_f1,
47 ring_node_sm *ring_node_tab[],
45 ring_node_sm *ring_node_tab[],
48 unsigned int firstTimeF0, unsigned int firstTimeF1 );
46 unsigned int firstTimeF0, unsigned int firstTimeF1 );
49 void ASM_reorganize( float *averaged_spec_mat, float *averaged_spec_mat_reorganized );
47 void ASM_reorganize_and_divide(float *averaged_spec_mat, float *averaged_spec_mat_reorganized,
50 void ASM_compress( float *averaged_spec_mat, unsigned char fChannel, float *compressed_spec_mat );
48 float divider );
49 void ASM_compress_reorganize_and_divide(float *averaged_spec_mat, float *compressed_spec_mat,
50 float divider,
51 unsigned char nbBinsCompressedMatrix, unsigned char nbBinsToAverage , unsigned char ASMIndexStart);
51 void ASM_convert(volatile float *input_matrix, char *output_matrix);
52 void ASM_convert(volatile float *input_matrix, char *output_matrix);
52 void ASM_send(Header_TM_LFR_SCIENCE_ASM_t *header, char *spectral_matrix,
53 void ASM_send(Header_TM_LFR_SCIENCE_ASM_t *header, char *spectral_matrix,
53 unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send, rtems_id queue_id);
54 unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send, rtems_id queue_id);
54 void fill_averaged_spectral_matrix( void );
55
55 void reset_spectral_matrix_regs();
56 void BP1_send( ring_node_bp *ring_node_to_send, unsigned int sid, rtems_id queue_id );
57
58 void init_header_asm( Header_TM_LFR_SCIENCE_ASM_t *header);
59 void init_headers_bp_ring_sbm1();
60 void init_header_bp( Header_TM_LFR_SCIENCE_BP_SBM_t *header);
61
62 void reset_spectral_matrix_regs( void );
56
63
57 #endif // FSW_PROCESSING_H_INCLUDED
64 #endif // FSW_PROCESSING_H_INCLUDED
@@ -1,887 +1,704
1 /** Functions related to data processing.
1 /** Functions related to data processing.
2 *
2 *
3 * @file
3 * @file
4 * @author P. LEROY
4 * @author P. LEROY
5 *
5 *
6 * These function are related to data processing, i.e. spectral matrices averaging and basic parameters computation.
6 * These function are related to data processing, i.e. spectral matrices averaging and basic parameters computation.
7 *
7 *
8 */
8 */
9
9
10 #include <fsw_processing.h>
10 #include <fsw_processing.h>
11
11
12 #include "fsw_processing_globals.c"
12 #include "fsw_processing_globals.c"
13
13
14 //************************
14 //************************
15 // spectral matrices rings
15 // spectral matrices rings
16 ring_node_sm sm_ring_f0[NB_RING_NODES_ASM_F0];
16 ring_node_sm sm_ring_f0[ NB_RING_NODES_ASM_F0 ];
17 ring_node_sm sm_ring_f1[NB_RING_NODES_ASM_F1];
17 ring_node_sm sm_ring_f1[ NB_RING_NODES_ASM_F1 ];
18 ring_node_sm sm_ring_f2[NB_RING_NODES_ASM_F2];
18 ring_node_sm sm_ring_f2[ NB_RING_NODES_ASM_F2 ];
19 ring_node_sm *current_ring_node_sm_f0;
19 ring_node_sm *current_ring_node_sm_f0;
20 ring_node_sm *ring_node_for_averaging_sm_f0;
20 ring_node_sm *ring_node_for_averaging_sm_f0;
21 ring_node_sm *current_ring_node_sm_f1;
21 ring_node_sm *current_ring_node_sm_f1;
22 ring_node_sm *current_ring_node_sm_f2;
22 ring_node_sm *current_ring_node_sm_f2;
23
23
24 BP1_t data_BP1[ NB_BINS_COMPRESSED_SM_F0 ];
24 //**********************
25 // basic parameter rings
26 ring_node_bp *current_node_sbm1_bp1_f0;
27 ring_node_bp bp_ring_sbm1[ NB_RING_NODES_BP1_SBM1 ];
25
28
26 //*****
29 //*****
27 // NORM
30 // NORM
28 // F0
31 // F0
29 float averaged_sm_f0 [ TIME_OFFSET + TOTAL_SIZE_SM ];
32 float asm_f0 [ TIME_OFFSET + TOTAL_SIZE_SM ];
30 float averaged_sm_f0_reorganized[ TIME_OFFSET + TOTAL_SIZE_SM ];
33 float asm_f0_reorganized[ TIME_OFFSET + TOTAL_SIZE_SM ];
31 char averaged_sm_f0_char [ TIME_OFFSET_IN_BYTES + (TOTAL_SIZE_SM * 2) ];
34 char asm_f0_char [ TIME_OFFSET_IN_BYTES + (TOTAL_SIZE_SM * 2) ];
32 float compressed_sm_f0 [ TOTAL_SIZE_COMPRESSED_ASM_F0 ];
35 float compressed_sm_f0 [ TIME_OFFSET + TOTAL_SIZE_COMPRESSED_ASM_F0 ];
33
36
34 //*****
37 //*****
35 // SBM1
38 // SBM1
36 float averaged_sm_sbm1 [ TIME_OFFSET + TOTAL_SIZE_SM ];
39 float averaged_sm_sbm1 [ TIME_OFFSET + TOTAL_SIZE_SM ];
37 float compressed_sm_sbm1 [ TOTAL_SIZE_COMPRESSED_ASM_SBM1 ];
40 float compressed_sm_sbm1 [ TIME_OFFSET + TOTAL_SIZE_COMPRESSED_ASM_SBM1 ];
38
41
39 unsigned char LFR_BP1_F0[ TIME_OFFSET_IN_BYTES + TOTAL_SIZE_BP1_F0 * 2 ];
42 unsigned char LFR_BP1_F0[ TIME_OFFSET_IN_BYTES + TOTAL_SIZE_NORM_BP1_F0 * 2 ];
40 unsigned char LFR_BP1_F1[ TIME_OFFSET_IN_BYTES + TOTAL_SIZE_BP1_F1 ];
43 unsigned char LFR_BP1_F1[ TIME_OFFSET_IN_BYTES + TOTAL_SIZE_NORM_BP1_F1 ];
41 unsigned char LFR_BP1_F2[ TIME_OFFSET_IN_BYTES + TOTAL_SIZE_BP1_F2 ];
44 unsigned char LFR_BP1_F2[ TIME_OFFSET_IN_BYTES + TOTAL_SIZE_NORM_BP1_F2 ];
42
45
43 unsigned int nb_sm_f0;
46 unsigned int nb_sm_f0;
44
47
45 void init_sm_rings( void )
48 void init_sm_rings( void )
46 {
49 {
47 unsigned char i;
50 unsigned char i;
48
51
49 // F0 RING
52 // F0 RING
50 sm_ring_f0[0].next = (ring_node_sm*) &sm_ring_f0[1];
53 sm_ring_f0[0].next = (ring_node_sm*) &sm_ring_f0[1];
51 sm_ring_f0[0].previous = (ring_node_sm*) &sm_ring_f0[NB_RING_NODES_ASM_F0-1];
54 sm_ring_f0[0].previous = (ring_node_sm*) &sm_ring_f0[NB_RING_NODES_ASM_F0-1];
52 sm_ring_f0[0].buffer_address =
55 sm_ring_f0[0].buffer_address =
53 (int) &sm_f0[ 0 ];
56 (int) &sm_f0[ 0 ];
54
57
55 sm_ring_f0[NB_RING_NODES_ASM_F0-1].next = (ring_node_sm*) &sm_ring_f0[0];
58 sm_ring_f0[NB_RING_NODES_ASM_F0-1].next = (ring_node_sm*) &sm_ring_f0[0];
56 sm_ring_f0[NB_RING_NODES_ASM_F0-1].previous = (ring_node_sm*) &sm_ring_f0[NB_RING_NODES_ASM_F0-2];
59 sm_ring_f0[NB_RING_NODES_ASM_F0-1].previous = (ring_node_sm*) &sm_ring_f0[NB_RING_NODES_ASM_F0-2];
57 sm_ring_f0[NB_RING_NODES_ASM_F0-1].buffer_address =
60 sm_ring_f0[NB_RING_NODES_ASM_F0-1].buffer_address =
58 (int) &sm_f0[ (NB_RING_NODES_ASM_F0-1) * TOTAL_SIZE_SM ];
61 (int) &sm_f0[ (NB_RING_NODES_ASM_F0-1) * TOTAL_SIZE_SM ];
59
62
60 for(i=1; i<NB_RING_NODES_ASM_F0-1; i++)
63 for(i=1; i<NB_RING_NODES_ASM_F0-1; i++)
61 {
64 {
62 sm_ring_f0[i].next = (ring_node_sm*) &sm_ring_f0[i+1];
65 sm_ring_f0[i].next = (ring_node_sm*) &sm_ring_f0[i+1];
63 sm_ring_f0[i].previous = (ring_node_sm*) &sm_ring_f0[i-1];
66 sm_ring_f0[i].previous = (ring_node_sm*) &sm_ring_f0[i-1];
64 sm_ring_f0[i].buffer_address =
67 sm_ring_f0[i].buffer_address =
65 (int) &sm_f0[ i * TOTAL_SIZE_SM ];
68 (int) &sm_f0[ i * TOTAL_SIZE_SM ];
66 }
69 }
67
70
68 // F1 RING
71 // F1 RING
69 sm_ring_f1[0].next = (ring_node_sm*) &sm_ring_f1[1];
72 sm_ring_f1[0].next = (ring_node_sm*) &sm_ring_f1[1];
70 sm_ring_f1[0].previous = (ring_node_sm*) &sm_ring_f1[NB_RING_NODES_ASM_F1-1];
73 sm_ring_f1[0].previous = (ring_node_sm*) &sm_ring_f1[NB_RING_NODES_ASM_F1-1];
71 sm_ring_f1[0].buffer_address =
74 sm_ring_f1[0].buffer_address =
72 (int) &sm_f1[ 0 ];
75 (int) &sm_f1[ 0 ];
73
76
74 sm_ring_f1[NB_RING_NODES_ASM_F1-1].next = (ring_node_sm*) &sm_ring_f1[0];
77 sm_ring_f1[NB_RING_NODES_ASM_F1-1].next = (ring_node_sm*) &sm_ring_f1[0];
75 sm_ring_f1[NB_RING_NODES_ASM_F1-1].previous = (ring_node_sm*) &sm_ring_f1[NB_RING_NODES_ASM_F1-2];
78 sm_ring_f1[NB_RING_NODES_ASM_F1-1].previous = (ring_node_sm*) &sm_ring_f1[NB_RING_NODES_ASM_F1-2];
76 sm_ring_f1[NB_RING_NODES_ASM_F1-1].buffer_address =
79 sm_ring_f1[NB_RING_NODES_ASM_F1-1].buffer_address =
77 (int) &sm_f1[ (NB_RING_NODES_ASM_F1-1) * TOTAL_SIZE_SM ];
80 (int) &sm_f1[ (NB_RING_NODES_ASM_F1-1) * TOTAL_SIZE_SM ];
78
81
79 for(i=1; i<NB_RING_NODES_ASM_F1-1; i++)
82 for(i=1; i<NB_RING_NODES_ASM_F1-1; i++)
80 {
83 {
81 sm_ring_f1[i].next = (ring_node_sm*) &sm_ring_f1[i+1];
84 sm_ring_f1[i].next = (ring_node_sm*) &sm_ring_f1[i+1];
82 sm_ring_f1[i].previous = (ring_node_sm*) &sm_ring_f1[i-1];
85 sm_ring_f1[i].previous = (ring_node_sm*) &sm_ring_f1[i-1];
83 sm_ring_f1[i].buffer_address =
86 sm_ring_f1[i].buffer_address =
84 (int) &sm_f1[ i * TOTAL_SIZE_SM ];
87 (int) &sm_f1[ i * TOTAL_SIZE_SM ];
85 }
88 }
86
89
87 // F2 RING
90 // F2 RING
88 sm_ring_f2[0].next = (ring_node_sm*) &sm_ring_f2[1];
91 sm_ring_f2[0].next = (ring_node_sm*) &sm_ring_f2[1];
89 sm_ring_f2[0].previous = (ring_node_sm*) &sm_ring_f2[NB_RING_NODES_ASM_F2-1];
92 sm_ring_f2[0].previous = (ring_node_sm*) &sm_ring_f2[NB_RING_NODES_ASM_F2-1];
90 sm_ring_f2[0].buffer_address =
93 sm_ring_f2[0].buffer_address =
91 (int) &sm_f2[ 0 ];
94 (int) &sm_f2[ 0 ];
92
95
93 sm_ring_f2[NB_RING_NODES_ASM_F2-1].next = (ring_node_sm*) &sm_ring_f2[0];
96 sm_ring_f2[NB_RING_NODES_ASM_F2-1].next = (ring_node_sm*) &sm_ring_f2[0];
94 sm_ring_f2[NB_RING_NODES_ASM_F2-1].previous = (ring_node_sm*) &sm_ring_f2[NB_RING_NODES_ASM_F2-2];
97 sm_ring_f2[NB_RING_NODES_ASM_F2-1].previous = (ring_node_sm*) &sm_ring_f2[NB_RING_NODES_ASM_F2-2];
95 sm_ring_f2[NB_RING_NODES_ASM_F2-1].buffer_address =
98 sm_ring_f2[NB_RING_NODES_ASM_F2-1].buffer_address =
96 (int) &sm_f2[ (NB_RING_NODES_ASM_F2-1) * TOTAL_SIZE_SM ];
99 (int) &sm_f2[ (NB_RING_NODES_ASM_F2-1) * TOTAL_SIZE_SM ];
97
100
98 for(i=1; i<NB_RING_NODES_ASM_F2-1; i++)
101 for(i=1; i<NB_RING_NODES_ASM_F2-1; i++)
99 {
102 {
100 sm_ring_f2[i].next = (ring_node_sm*) &sm_ring_f2[i+1];
103 sm_ring_f2[i].next = (ring_node_sm*) &sm_ring_f2[i+1];
101 sm_ring_f2[i].previous = (ring_node_sm*) &sm_ring_f2[i-1];
104 sm_ring_f2[i].previous = (ring_node_sm*) &sm_ring_f2[i-1];
102 sm_ring_f2[i].buffer_address =
105 sm_ring_f2[i].buffer_address =
103 (int) &sm_f2[ i * TOTAL_SIZE_SM ];
106 (int) &sm_f2[ i * TOTAL_SIZE_SM ];
104 }
107 }
105
108
106 DEBUG_PRINTF1("asm_ring_f0 @%x\n", (unsigned int) sm_ring_f0)
109 DEBUG_PRINTF1("asm_ring_f0 @%x\n", (unsigned int) sm_ring_f0)
107 DEBUG_PRINTF1("asm_ring_f1 @%x\n", (unsigned int) sm_ring_f1)
110 DEBUG_PRINTF1("asm_ring_f1 @%x\n", (unsigned int) sm_ring_f1)
108 DEBUG_PRINTF1("asm_ring_f2 @%x\n", (unsigned int) sm_ring_f2)
111 DEBUG_PRINTF1("asm_ring_f2 @%x\n", (unsigned int) sm_ring_f2)
109
112
110 spectral_matrix_regs->matrixF0_Address0 = sm_ring_f0[0].buffer_address;
113 spectral_matrix_regs->matrixF0_Address0 = sm_ring_f0[0].buffer_address;
111 DEBUG_PRINTF1("spectral_matrix_regs->matrixF0_Address0 @%x\n", spectral_matrix_regs->matrixF0_Address0)
114 DEBUG_PRINTF1("spectral_matrix_regs->matrixF0_Address0 @%x\n", spectral_matrix_regs->matrixF0_Address0)
112 }
115 }
113
116
114 void reset_current_sm_ring_nodes( void )
117 void reset_current_sm_ring_nodes( void )
115 {
118 {
116 current_ring_node_sm_f0 = sm_ring_f0;
119 current_ring_node_sm_f0 = sm_ring_f0;
117 current_ring_node_sm_f1 = sm_ring_f1;
120 current_ring_node_sm_f1 = sm_ring_f1;
118 current_ring_node_sm_f2 = sm_ring_f2;
121 current_ring_node_sm_f2 = sm_ring_f2;
119
122
120 ring_node_for_averaging_sm_f0 = sm_ring_f0;
123 ring_node_for_averaging_sm_f0 = sm_ring_f0;
121 }
124 }
122
125
126 void reset_current_node_sbm1_bp1_f0( void )
127 {
128 current_node_sbm1_bp1_f0 = bp_ring_sbm1;
129 }
130
123 //***********************************************************
131 //***********************************************************
124 // Interrupt Service Routine for spectral matrices processing
132 // Interrupt Service Routine for spectral matrices processing
125 void reset_nb_sm_f0( void )
133 void reset_nb_sm_f0( void )
126 {
134 {
127 nb_sm_f0 = 0;
135 nb_sm_f0 = 0;
128 }
136 }
129
137
130 rtems_isr spectral_matrices_isr( rtems_vector_number vector )
138 rtems_isr spectral_matrices_isr( rtems_vector_number vector )
131 {
139 {
132 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 );
140 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 );
133
141
134 if ( (spectral_matrix_regs->status & 0x1) == 0x01)
142 if ( (spectral_matrix_regs->status & 0x1) == 0x01)
135 {
143 {
136 current_ring_node_sm_f0 = current_ring_node_sm_f0->next;
144 current_ring_node_sm_f0 = current_ring_node_sm_f0->next;
137 spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address;
145 spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address;
138 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffe; // 1110
146 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffe; // 1110
139 nb_sm_f0 = nb_sm_f0 + 1;
147 nb_sm_f0 = nb_sm_f0 + 1;
140 }
148 }
141 else if ( (spectral_matrix_regs->status & 0x2) == 0x02)
149 else if ( (spectral_matrix_regs->status & 0x2) == 0x02)
142 {
150 {
143 current_ring_node_sm_f0 = current_ring_node_sm_f0->next;
151 current_ring_node_sm_f0 = current_ring_node_sm_f0->next;
144 spectral_matrix_regs->matrixFO_Address1 = current_ring_node_sm_f0->buffer_address;
152 spectral_matrix_regs->matrixFO_Address1 = current_ring_node_sm_f0->buffer_address;
145 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffd; // 1101
153 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffd; // 1101
146 nb_sm_f0 = nb_sm_f0 + 1;
154 nb_sm_f0 = nb_sm_f0 + 1;
147 }
155 }
148
156
149 if ( (spectral_matrix_regs->status & 0x30) != 0x00)
157 if ( (spectral_matrix_regs->status & 0x30) != 0x00)
150 {
158 {
151 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 );
159 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 );
152 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xffffffcf; // 1100 1111
160 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xffffffcf; // 1100 1111
153 }
161 }
154
162
155 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffff3; // 0011
163 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffff3; // 0011
156
164
157 if (nb_sm_f0 == (NB_SM_TO_RECEIVE_BEFORE_AVF0-1) )
165 if (nb_sm_f0 == (NB_SM_TO_RECEIVE_BEFORE_AVF0-1) )
158 {
166 {
159 ring_node_for_averaging_sm_f0 = current_ring_node_sm_f0;
167 ring_node_for_averaging_sm_f0 = current_ring_node_sm_f0;
160 if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL)
168 if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL)
161 {
169 {
162 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 );
170 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 );
163 }
171 }
164 nb_sm_f0 = 0;
172 nb_sm_f0 = 0;
165 }
173 }
166 else
174 else
167 {
175 {
168 nb_sm_f0 = nb_sm_f0 + 1;
176 nb_sm_f0 = nb_sm_f0 + 1;
169 }
177 }
170 }
178 }
171
179
172 rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector )
180 rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector )
173 {
181 {
174 if (nb_sm_f0 == (NB_SM_TO_RECEIVE_BEFORE_AVF0-1) )
182 if (nb_sm_f0 == (NB_SM_TO_RECEIVE_BEFORE_AVF0-1) )
175 {
183 {
176 ring_node_for_averaging_sm_f0 = current_ring_node_sm_f0;
184 ring_node_for_averaging_sm_f0 = current_ring_node_sm_f0;
177 if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL)
185 if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL)
178 {
186 {
179 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 );
187 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 );
180 }
188 }
181 nb_sm_f0 = 0;
189 nb_sm_f0 = 0;
182 }
190 }
183 else
191 else
184 {
192 {
185 nb_sm_f0 = nb_sm_f0 + 1;
193 nb_sm_f0 = nb_sm_f0 + 1;
186 }
194 }
187 }
195 }
188
196
189 //************
197 //************
190 // RTEMS TASKS
198 // RTEMS TASKS
191
199
192 rtems_task smiq_task(rtems_task_argument argument) // process the Spectral Matrices IRQ
200 rtems_task smiq_task(rtems_task_argument argument) // process the Spectral Matrices IRQ
193 {
201 {
194 rtems_event_set event_out;
202 rtems_event_set event_out;
195
203
196 BOOT_PRINTF("in SMIQ *** \n")
204 BOOT_PRINTF("in SMIQ *** \n")
197
205
198 while(1){
206 while(1){
199 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
207 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
200 }
208 }
201 }
209 }
202
210
203 rtems_task avf0_task(rtems_task_argument argument)
211 rtems_task avf0_task(rtems_task_argument argument)
204 {
212 {
205 int i;
213 int i;
206 static unsigned int nb_average_norm_f0;
214 static unsigned int nb_average_norm_f0;
207 static unsigned int nb_average_sbm1_f0;
215 static unsigned int nb_average_sbm1_f0;
208 rtems_event_set event_out;
216 rtems_event_set event_out;
209 rtems_status_code status;
217 rtems_status_code status;
210 ring_node_sm *ring_node_tab[8];
218 ring_node_sm *ring_node_tab[8];
211
219
212 nb_average_norm_f0 = 0;
220 nb_average_norm_f0 = 0;
213 nb_average_sbm1_f0 = 0;
221 nb_average_sbm1_f0 = 0;
214
222
215 BOOT_PRINTF("in AVFO *** \n")
223 BOOT_PRINTF("in AVFO *** \n")
216
224
217 while(1){
225 while(1){
218 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
226 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
219 ring_node_tab[NB_SM_TO_RECEIVE_BEFORE_AVF0-1] = ring_node_for_averaging_sm_f0;
227 ring_node_tab[NB_SM_TO_RECEIVE_BEFORE_AVF0-1] = ring_node_for_averaging_sm_f0;
220 for ( i = 2; i < (NB_SM_TO_RECEIVE_BEFORE_AVF0+1); i++ )
228 for ( i = 2; i < (NB_SM_TO_RECEIVE_BEFORE_AVF0+1); i++ )
221 {
229 {
222 ring_node_for_averaging_sm_f0 = ring_node_for_averaging_sm_f0->previous;
230 ring_node_for_averaging_sm_f0 = ring_node_for_averaging_sm_f0->previous;
223 ring_node_tab[NB_SM_TO_RECEIVE_BEFORE_AVF0-i] = ring_node_for_averaging_sm_f0;
231 ring_node_tab[NB_SM_TO_RECEIVE_BEFORE_AVF0-i] = ring_node_for_averaging_sm_f0;
224 }
232 }
225
233
226 // copy time information in the averaged_sm_f0 buffer
234 // copy time information in the asm_f0 buffer
227 averaged_sm_f0[0] = ring_node_tab[7]->coarseTime;
235 asm_f0[0] = ring_node_tab[7]->coarseTime;
228 averaged_sm_f0[1] = ring_node_tab[7]->fineTime;
236 asm_f0[1] = ring_node_tab[7]->fineTime;
229 averaged_sm_sbm1[0] = ring_node_tab[7]->coarseTime;
237 averaged_sm_sbm1[0] = ring_node_tab[7]->coarseTime;
230 averaged_sm_sbm1[1] = ring_node_tab[7]->fineTime;
238 averaged_sm_sbm1[1] = ring_node_tab[7]->fineTime;
231
239
232 // compute the average and store it in the averaged_sm_f1 buffer
240 // compute the average and store it in the averaged_sm_f1 buffer
233 ASM_average( averaged_sm_f0, averaged_sm_sbm1,
241 ASM_average( asm_f0, averaged_sm_sbm1,
234 ring_node_tab,
242 ring_node_tab,
235 nb_average_norm_f0, nb_average_sbm1_f0 );
243 nb_average_norm_f0, nb_average_sbm1_f0 );
236
244
237
245
238 // update nb_average
246 // update nb_average
239 nb_average_norm_f0 = nb_average_norm_f0 + NB_SM_TO_RECEIVE_BEFORE_AVF0;
247 nb_average_norm_f0 = nb_average_norm_f0 + NB_SM_TO_RECEIVE_BEFORE_AVF0;
240 nb_average_sbm1_f0 = nb_average_sbm1_f0 + NB_SM_TO_RECEIVE_BEFORE_AVF0;
248 nb_average_sbm1_f0 = nb_average_sbm1_f0 + NB_SM_TO_RECEIVE_BEFORE_AVF0;
241
249
242 // launch actions depending on the current mode
250 // launch actions depending on the current mode
243
251
244 if (nb_average_sbm1_f0 == NB_AVERAGE_SBM1_F0)
252 if (nb_average_sbm1_f0 == NB_AVERAGE_SBM1_F0)
245 {
253 {
246 nb_average_sbm1_f0 = 0;
254 nb_average_sbm1_f0 = 0;
247 if (lfrCurrentMode == LFR_MODE_SBM1)
255 if (lfrCurrentMode == LFR_MODE_SBM1)
248 {
256 {
249 status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_MODE_SBM1 ); // sending an event to the task 7, BPF0
257 status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_MODE_SBM1 ); // sending an event to the task 7, BPF0
250 if (status != RTEMS_SUCCESSFUL)
258 if (status != RTEMS_SUCCESSFUL)
251 {
259 {
252 printf("in AVF0 *** Error sending RTEMS_EVENT_MODE_SBM1, code %d\n", status);
260 printf("in AVF0 *** Error sending RTEMS_EVENT_MODE_SBM1, code %d\n", status);
253 }
261 }
254 }
262 }
255 }
263 }
256
264
257 if (nb_average_norm_f0 == NB_AVERAGE_NORMAL_F0) {
265 if (nb_average_norm_f0 == NB_AVERAGE_NORMAL_F0) {
258 nb_average_norm_f0 = 0;
266 nb_average_norm_f0 = 0;
259 status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_MODE_NORMAL ); // sending an event to the task 7, BPF0
267 status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_MODE_NORMAL ); // sending an event to the task 7, BPF0
260 if (status != RTEMS_SUCCESSFUL) {
268 if (status != RTEMS_SUCCESSFUL) {
261 printf("in AVF0 *** Error sending RTEMS_EVENT_0, code %d\n", status);
269 printf("in AVF0 *** Error sending RTEMS_EVENT_0, code %d\n", status);
262 }
270 }
263 }
271 }
264 }
272 }
265 }
273 }
266
274
267 rtems_task matr_task(rtems_task_argument argument)
275 rtems_task matr_task(rtems_task_argument argument)
268 {
276 {
269 spw_ioctl_pkt_send spw_ioctl_send_ASM;
277 spw_ioctl_pkt_send spw_ioctl_send_ASM;
270 rtems_event_set event_out;
278 rtems_event_set event_out;
271 rtems_status_code status;
279 rtems_status_code status;
272 rtems_id queue_id;
280 rtems_id queue_id;
273 Header_TM_LFR_SCIENCE_ASM_t headerASM;
281 Header_TM_LFR_SCIENCE_ASM_t headerASM;
282 ring_node_norm_bp current_node_norm_bp1_f0;
274
283
275 init_header_asm( &headerASM );
284 init_header_asm( &headerASM );
285 // init_header_bp( &current_node_norm_bp1_f0.header );
276
286
277 status = get_message_queue_id_send( &queue_id );
287 status = get_message_queue_id_send( &queue_id );
278 if (status != RTEMS_SUCCESSFUL)
288 if (status != RTEMS_SUCCESSFUL)
279 {
289 {
280 PRINTF1("in MATR *** ERR get_message_queue_id_send %d\n", status)
290 PRINTF1("in MATR *** ERR get_message_queue_id_send %d\n", status)
281 }
291 }
282
292
283 BOOT_PRINTF("in MATR *** \n")
293 BOOT_PRINTF("in MATR *** \n")
284
294
285 fill_averaged_spectral_matrix( );
286
287 while(1){
295 while(1){
288 rtems_event_receive( RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1,
296 rtems_event_receive( RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1,
289 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
297 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
290 if (event_out==RTEMS_EVENT_MODE_NORMAL)
298 if (event_out==RTEMS_EVENT_MODE_NORMAL)
291 {
299 {
292 // 1) compress the matrix for Basic Parameters calculation
300 // 1) compress the matrix for Basic Parameters calculation
293 ASM_compress( averaged_sm_f0, 0, compressed_sm_f0 );
301 ASM_compress_reorganize_and_divide( asm_f0, compressed_sm_f0,
302 NB_AVERAGE_NORMAL_F0,
303 NB_BINS_COMPRESSED_SM_F0, NB_BINS_TO_AVERAGE_ASM_F0,
304 ASM_F0_INDICE_START );
294 // 2) compute the BP1 set
305 // 2) compute the BP1 set
295
306
296 // 3) send the BP1 set
307 // 3) send the BP1 set
297
308 BP1_send( &current_node_norm_bp1_f0, SID_NORM_BP1_F0, queue_id );
298 // 4) convert the float array in a char array
309 // 4) reorganize the ASM and divide
299 ASM_reorganize( averaged_sm_f0, averaged_sm_f0_reorganized );
310 ASM_reorganize_and_divide( asm_f0, asm_f0_reorganized, NB_AVERAGE_NORMAL_F0 );
300 ASM_convert( averaged_sm_f0_reorganized, averaged_sm_f0_char);
311 // 5) convert the float array in a char array
301 // 5) send the spectral matrix packets
312 ASM_convert( asm_f0_reorganized, asm_f0_char);
302 ASM_send( &headerASM, averaged_sm_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM, queue_id);
313 // 6) send the spectral matrix packets
314 ASM_send( &headerASM, asm_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM, queue_id);
303 }
315 }
304 else if (event_out==RTEMS_EVENT_MODE_SBM1)
316 else if (event_out==RTEMS_EVENT_MODE_SBM1)
305 {
317 {
306 // 1) compress the matrix for Basic Parameters calculation
318 // 1) compress the matrix for Basic Parameters calculation
307 ASM_compress( averaged_sm_sbm1, 0, compressed_sm_sbm1 );
319 ASM_compress_reorganize_and_divide( averaged_sm_sbm1, compressed_sm_sbm1,
320 NB_AVERAGE_SBM1_F0,
321 NB_BINS_COMPRESSED_SM_SBM1_F0, NB_BINS_TO_AVERAGE_ASM_SBM1_F0,
322 ASM_F0_INDICE_START);
308 // 2) compute the BP1 set
323 // 2) compute the BP1 set
309
324
310 // 3) send the basic parameters set 1 packet
325 // 3) send the basic parameters set 1 packet
311
326 BP1_send( current_node_sbm1_bp1_f0, SID_SBM1_BP1_F0, queue_id );
327 // 4) update current_node_sbm1_bp1_f0
328 current_node_sbm1_bp1_f0 = current_node_sbm1_bp1_f0->next;
312 }
329 }
313 else
330 else
314 {
331 {
315 PRINTF1("ERR *** in MATR *** unexect event = %x\n", (unsigned int) event_out)
332 PRINTF1("ERR *** in MATR *** unexect event = %x\n", (unsigned int) event_out)
316 }
333 }
317 }
334 }
318 }
335 }
319
336
320 //*****************************
337 //*****************************
321 // Spectral matrices processing
338 // Spectral matrices processing
322
339
323 void matrix_reset(volatile float *averaged_spec_mat)
324 {
325 int i;
326 for(i=0; i<TOTAL_SIZE_SM; i++){
327 averaged_spec_mat[i] = 0;
328 }
329 }
330
331 void ASM_average( float *averaged_spec_mat_f0, float *averaged_spec_mat_f1,
340 void ASM_average( float *averaged_spec_mat_f0, float *averaged_spec_mat_f1,
332 ring_node_sm *ring_node_tab[],
341 ring_node_sm *ring_node_tab[],
333 unsigned int nbAverageNormF0, unsigned int nbAverageSBM1F0 )
342 unsigned int nbAverageNormF0, unsigned int nbAverageSBM1F0 )
334 {
343 {
335 float sum;
344 float sum;
336 unsigned int i;
345 unsigned int i;
337
346
338 for(i=0; i<TOTAL_SIZE_SM; i++)
347 for(i=0; i<TOTAL_SIZE_SM; i++)
339 {
348 {
340 sum = ( (int *) (ring_node_tab[0]->buffer_address) ) [ i ]
349 sum = ( (int *) (ring_node_tab[0]->buffer_address) ) [ i ]
341 + ( (int *) (ring_node_tab[1]->buffer_address) ) [ i ]
350 + ( (int *) (ring_node_tab[1]->buffer_address) ) [ i ]
342 + ( (int *) (ring_node_tab[2]->buffer_address) ) [ i ]
351 + ( (int *) (ring_node_tab[2]->buffer_address) ) [ i ]
343 + ( (int *) (ring_node_tab[3]->buffer_address) ) [ i ]
352 + ( (int *) (ring_node_tab[3]->buffer_address) ) [ i ]
344 + ( (int *) (ring_node_tab[4]->buffer_address) ) [ i ]
353 + ( (int *) (ring_node_tab[4]->buffer_address) ) [ i ]
345 + ( (int *) (ring_node_tab[5]->buffer_address) ) [ i ]
354 + ( (int *) (ring_node_tab[5]->buffer_address) ) [ i ]
346 + ( (int *) (ring_node_tab[6]->buffer_address) ) [ i ]
355 + ( (int *) (ring_node_tab[6]->buffer_address) ) [ i ]
347 + ( (int *) (ring_node_tab[7]->buffer_address) ) [ i ];
356 + ( (int *) (ring_node_tab[7]->buffer_address) ) [ i ];
348
357
349 if ( (nbAverageNormF0 == 0) && (nbAverageSBM1F0 == 0) )
358 if ( (nbAverageNormF0 == 0) && (nbAverageSBM1F0 == 0) )
350 {
359 {
351 averaged_spec_mat_f0[ TIME_OFFSET + i ] = sum;
360 averaged_spec_mat_f0[ TIME_OFFSET + i ] = sum;
352 averaged_spec_mat_f1[ TIME_OFFSET + i ] = sum;
361 averaged_spec_mat_f1[ TIME_OFFSET + i ] = sum;
353 }
362 }
354 else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 != 0) )
363 else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 != 0) )
355 {
364 {
356 averaged_spec_mat_f0[ TIME_OFFSET + i ] = ( averaged_spec_mat_f0[ TIME_OFFSET + i ] + sum );
365 averaged_spec_mat_f0[ TIME_OFFSET + i ] = ( averaged_spec_mat_f0[ TIME_OFFSET + i ] + sum );
357 averaged_spec_mat_f1[ TIME_OFFSET + i ] = ( averaged_spec_mat_f1[ TIME_OFFSET + i ] + sum );
366 averaged_spec_mat_f1[ TIME_OFFSET + i ] = ( averaged_spec_mat_f1[ TIME_OFFSET + i ] + sum );
358 }
367 }
359 else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 == 0) )
368 else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 == 0) )
360 {
369 {
361 averaged_spec_mat_f0[ TIME_OFFSET + i ] = ( averaged_spec_mat_f0[ TIME_OFFSET + i ] + sum );
370 averaged_spec_mat_f0[ TIME_OFFSET + i ] = ( averaged_spec_mat_f0[ TIME_OFFSET + i ] + sum );
362 averaged_spec_mat_f1[ TIME_OFFSET + i ] = sum;
371 averaged_spec_mat_f1[ TIME_OFFSET + i ] = sum;
363 }
372 }
364 else
373 else
365 {
374 {
366 PRINTF2("ERR *** in ASM_average *** unexpected parameters %d %d\n", nbAverageNormF0, nbAverageSBM1F0)
375 PRINTF2("ERR *** in ASM_average *** unexpected parameters %d %d\n", nbAverageNormF0, nbAverageSBM1F0)
367 }
376 }
368 }
377 }
369 }
378 }
370
379
371 void ASM_reorganize( float *averaged_spec_mat, float *averaged_spec_mat_reorganized )
380 void ASM_reorganize_and_divide( float *averaged_spec_mat, float *averaged_spec_mat_reorganized, float divider )
372 {
381 {
373 int frequencyBin;
382 int frequencyBin;
374 int asmComponent;
383 int asmComponent;
375
384
376 // copy the time information
385 // copy the time information
377 averaged_spec_mat_reorganized[ 0 ] = averaged_spec_mat[ 0 ];
386 averaged_spec_mat_reorganized[ 0 ] = averaged_spec_mat[ 0 ];
378 averaged_spec_mat_reorganized[ 1 ] = averaged_spec_mat[ 1 ];
387 averaged_spec_mat_reorganized[ 1 ] = averaged_spec_mat[ 1 ];
379
388
380 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
389 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
381 {
390 {
382 for( frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++ )
391 for( frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++ )
383 {
392 {
384 averaged_spec_mat_reorganized[ TIME_OFFSET + frequencyBin * NB_VALUES_PER_SM + asmComponent ] =
393 averaged_spec_mat_reorganized[ TIME_OFFSET + frequencyBin * NB_VALUES_PER_SM + asmComponent ] =
385 averaged_spec_mat[ TIME_OFFSET + asmComponent * NB_BINS_PER_SM + frequencyBin ];
394 averaged_spec_mat[ TIME_OFFSET + asmComponent * NB_BINS_PER_SM + frequencyBin ] / divider;
386 }
395 }
387 }
396 }
388 }
397 }
389
398
390 void ASM_compress( float *averaged_spec_mat, unsigned char fChannel, float *compressed_spec_mat )
399 void ASM_compress_reorganize_and_divide(float *averaged_spec_mat, float *compressed_spec_mat , float divider,
400 unsigned char nbBinsCompressedMatrix, unsigned char nbBinsToAverage, unsigned char ASMIndexStart )
391 {
401 {
392 int frequencyBin;
402 int frequencyBin;
393 int asmComponent;
403 int asmComponent;
394 int offsetASM;
404 int offsetASM;
395 int offsetCompressed;
405 int offsetCompressed;
396 int k;
406 int k;
397
407
398 switch (fChannel){
408 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
399 case 0:
409 {
400 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
410 for( frequencyBin = 0; frequencyBin < nbBinsCompressedMatrix; frequencyBin++ )
401 {
411 {
402 for( frequencyBin = 0; frequencyBin < NB_BINS_COMPRESSED_SM_F0; frequencyBin++ )
412 offsetCompressed = TIME_OFFSET
413 + frequencyBin * NB_VALUES_PER_SM
414 + asmComponent;
415 offsetASM = TIME_OFFSET
416 + asmComponent * NB_BINS_PER_SM
417 + ASMIndexStart
418 + frequencyBin * nbBinsToAverage;
419 compressed_spec_mat[ offsetCompressed ] = 0;
420 for ( k = 0; k < nbBinsToAverage; k++ )
403 {
421 {
404 offsetCompressed = TIME_OFFSET
422 compressed_spec_mat[offsetCompressed ] =
405 + frequencyBin * NB_VALUES_PER_SM
423 ( compressed_spec_mat[ offsetCompressed ]
406 + asmComponent;
424 + averaged_spec_mat[ offsetASM + k ] ) / (divider * nbBinsToAverage);
407 offsetASM = TIME_OFFSET
408 + asmComponent * NB_BINS_PER_SM
409 + ASM_F0_INDICE_START
410 + frequencyBin * NB_BINS_TO_AVERAGE_ASM_F0;
411 compressed_spec_mat[ offsetCompressed ] = 0;
412 for ( k = 0; k < NB_BINS_TO_AVERAGE_ASM_F0; k++ )
413 {
414 compressed_spec_mat[offsetCompressed ] =
415 compressed_spec_mat[ offsetCompressed ]
416 + averaged_spec_mat[ offsetASM + k ];
417 }
418 }
425 }
419 }
426 }
420 break;
421
422 case 1:
423 // case fChannel = f1 to be completed later
424 break;
425
426 case 2:
427 // case fChannel = f1 to be completed later
428 break;
429
430 default:
431 break;
432 }
427 }
433 }
428 }
434
429
435 void ASM_convert( volatile float *input_matrix, char *output_matrix)
430 void ASM_convert( volatile float *input_matrix, char *output_matrix)
436 {
431 {
437 unsigned int i;
432 unsigned int i;
438 unsigned int frequencyBin;
433 unsigned int frequencyBin;
439 unsigned int asmComponent;
434 unsigned int asmComponent;
440 char * pt_char_input;
435 char * pt_char_input;
441 char * pt_char_output;
436 char * pt_char_output;
442
437
443 pt_char_input = (char*) &input_matrix;
438 pt_char_input = (char*) &input_matrix;
444 pt_char_output = (char*) &output_matrix;
439 pt_char_output = (char*) &output_matrix;
445
440
446 // copy the time information
441 // copy the time information
447 for (i=0; i<TIME_OFFSET_IN_BYTES; i++)
442 for (i=0; i<TIME_OFFSET_IN_BYTES; i++)
448 {
443 {
449 pt_char_output[ i ] = pt_char_output[ i ];
444 pt_char_output[ i ] = pt_char_output[ i ];
450 }
445 }
451
446
452 // convert all other data
447 // convert all other data
453 for( frequencyBin=0; frequencyBin<NB_BINS_PER_SM; frequencyBin++)
448 for( frequencyBin=0; frequencyBin<NB_BINS_PER_SM; frequencyBin++)
454 {
449 {
455 for ( asmComponent=0; asmComponent<NB_VALUES_PER_SM; asmComponent++)
450 for ( asmComponent=0; asmComponent<NB_VALUES_PER_SM; asmComponent++)
456 {
451 {
457 pt_char_input = (char*) &input_matrix [ (frequencyBin*NB_VALUES_PER_SM) + asmComponent + TIME_OFFSET ];
452 pt_char_input = (char*) &input_matrix [ (frequencyBin*NB_VALUES_PER_SM) + asmComponent + TIME_OFFSET ];
458 pt_char_output = (char*) &output_matrix[ 2 * ( (frequencyBin*NB_VALUES_PER_SM) + asmComponent ) + TIME_OFFSET_IN_BYTES ];
453 pt_char_output = (char*) &output_matrix[ 2 * ( (frequencyBin*NB_VALUES_PER_SM) + asmComponent ) + TIME_OFFSET_IN_BYTES ];
459 pt_char_output[0] = pt_char_input[0]; // bits 31 downto 24 of the float
454 pt_char_output[0] = pt_char_input[0]; // bits 31 downto 24 of the float
460 pt_char_output[1] = pt_char_input[1]; // bits 23 downto 16 of the float
455 pt_char_output[1] = pt_char_input[1]; // bits 23 downto 16 of the float
461 }
456 }
462 }
457 }
463 }
458 }
464
459
465 void ASM_send(Header_TM_LFR_SCIENCE_ASM_t *header, char *spectral_matrix,
460 void ASM_send(Header_TM_LFR_SCIENCE_ASM_t *header, char *spectral_matrix,
466 unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send, rtems_id queue_id)
461 unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send, rtems_id queue_id)
467 {
462 {
468 unsigned int i;
463 unsigned int i;
469 unsigned int length = 0;
464 unsigned int length = 0;
470 rtems_status_code status;
465 rtems_status_code status;
471
466
472 for (i=0; i<2; i++)
467 for (i=0; i<2; i++)
473 {
468 {
474 // (1) BUILD THE DATA
469 // (1) BUILD THE DATA
475 switch(sid)
470 switch(sid)
476 {
471 {
477 case SID_NORM_ASM_F0:
472 case SID_NORM_ASM_F0:
478 spw_ioctl_send->dlen = TOTAL_SIZE_ASM_F0_IN_BYTES / 2;
473 spw_ioctl_send->dlen = TOTAL_SIZE_ASM_F0_IN_BYTES / 2;
479 spw_ioctl_send->data = &spectral_matrix[
474 spw_ioctl_send->data = &spectral_matrix[
480 ( (ASM_F0_INDICE_START + (i*NB_BINS_PER_PKT_ASM_F0) ) * NB_VALUES_PER_SM ) * 2
475 ( (ASM_F0_INDICE_START + (i*NB_BINS_PER_PKT_ASM_F0) ) * NB_VALUES_PER_SM ) * 2
481 + TIME_OFFSET_IN_BYTES
476 + TIME_OFFSET_IN_BYTES
482 ];
477 ];
483 length = PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0;
478 length = PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0;
484 header->pa_lfr_asm_blk_nr[0] = (unsigned char) ( (NB_BINS_PER_PKT_ASM_F0) >> 8 ); // BLK_NR MSB
479 header->pa_lfr_asm_blk_nr[0] = (unsigned char) ( (NB_BINS_PER_PKT_ASM_F0) >> 8 ); // BLK_NR MSB
485 header->pa_lfr_asm_blk_nr[1] = (unsigned char) (NB_BINS_PER_PKT_ASM_F0); // BLK_NR LSB
480 header->pa_lfr_asm_blk_nr[1] = (unsigned char) (NB_BINS_PER_PKT_ASM_F0); // BLK_NR LSB
486 break;
481 break;
487 case SID_NORM_ASM_F1:
482 case SID_NORM_ASM_F1:
488 break;
483 break;
489 case SID_NORM_ASM_F2:
484 case SID_NORM_ASM_F2:
490 break;
485 break;
491 default:
486 default:
492 PRINTF1("ERR *** in ASM_send *** unexpected sid %d\n", sid)
487 PRINTF1("ERR *** in ASM_send *** unexpected sid %d\n", sid)
493 break;
488 break;
494 }
489 }
495 spw_ioctl_send->hlen = HEADER_LENGTH_TM_LFR_SCIENCE_ASM + CCSDS_PROTOCOLE_EXTRA_BYTES;
490 spw_ioctl_send->hlen = HEADER_LENGTH_TM_LFR_SCIENCE_ASM + CCSDS_PROTOCOLE_EXTRA_BYTES;
496 spw_ioctl_send->hdr = (char *) header;
491 spw_ioctl_send->hdr = (char *) header;
497 spw_ioctl_send->options = 0;
492 spw_ioctl_send->options = 0;
498
493
499 // (2) BUILD THE HEADER
494 // (2) BUILD THE HEADER
500 header->packetLength[0] = (unsigned char) (length>>8);
495 header->packetLength[0] = (unsigned char) (length>>8);
501 header->packetLength[1] = (unsigned char) (length);
496 header->packetLength[1] = (unsigned char) (length);
502 header->sid = (unsigned char) sid; // SID
497 header->sid = (unsigned char) sid; // SID
503 header->pa_lfr_pkt_cnt_asm = 2;
498 header->pa_lfr_pkt_cnt_asm = 2;
504 header->pa_lfr_pkt_nr_asm = (unsigned char) (i+1);
499 header->pa_lfr_pkt_nr_asm = (unsigned char) (i+1);
505
500
506 // (3) SET PACKET TIME
501 // (3) SET PACKET TIME
507 header->time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
502 header->time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
508 header->time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
503 header->time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
509 header->time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
504 header->time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
510 header->time[3] = (unsigned char) (time_management_regs->coarse_time);
505 header->time[3] = (unsigned char) (time_management_regs->coarse_time);
511 header->time[4] = (unsigned char) (time_management_regs->fine_time>>8);
506 header->time[4] = (unsigned char) (time_management_regs->fine_time>>8);
512 header->time[5] = (unsigned char) (time_management_regs->fine_time);
507 header->time[5] = (unsigned char) (time_management_regs->fine_time);
513 //
508 //
514 header->acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24);
509 header->acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24);
515 header->acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16);
510 header->acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16);
516 header->acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8);
511 header->acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8);
517 header->acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time);
512 header->acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time);
518 header->acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8);
513 header->acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8);
519 header->acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time);
514 header->acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time);
520
515
521 // (4) SEND PACKET
516 // (4) SEND PACKET
522 status = rtems_message_queue_send( queue_id, spw_ioctl_send, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
517 status = rtems_message_queue_send( queue_id, spw_ioctl_send, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
523 if (status != RTEMS_SUCCESSFUL) {
518 if (status != RTEMS_SUCCESSFUL) {
524 printf("in ASM_send *** ERR %d\n", (int) status);
519 printf("in ASM_send *** ERR %d\n", (int) status);
525 }
520 }
526 }
521 }
527 }
522 }
528
523
529 void BP1_send()
524 void BP1_send( ring_node_bp *ring_node_to_send, unsigned int sid, rtems_id queue_id )
530 {
525 {
531
526 unsigned int length = 0;
532 }
527 rtems_status_code status;
528 unsigned char nbBytesTosend;
533
529
534 void BP1_set_old(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * LFR_BP1){
530 // (1) BUILD THE DATA
535 int i;
531 switch(sid)
536 int j;
532 {
537 unsigned char tmp_u_char;
533 case SID_NORM_BP1_F0:
538 unsigned char * pt_char = NULL;
534 length = PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0;
539 float PSDB, PSDE;
535 ring_node_to_send->header.packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
540 float NVEC_V0;
536 ring_node_to_send->header.packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
541 float NVEC_V1;
537 ring_node_to_send->header.pa_lfr_bp_blk_nr[0] = (unsigned char) ( (NB_BINS_COMPRESSED_SM_F0) >> 8 ); // BLK_NR MSB
542 float NVEC_V2;
538 ring_node_to_send->header.pa_lfr_bp_blk_nr[1] = (unsigned char) (NB_BINS_COMPRESSED_SM_F0); // BLK_NR LSB
543 //float significand;
539 nbBytesTosend = PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0
544 //int exponent;
540 + CCSDS_TC_TM_PACKET_OFFSET
545 float aux;
541 + CCSDS_PROTOCOLE_EXTRA_BYTES;
546 float tr_SB_SB;
542 case SID_SBM1_BP1_F0:
547 float tmp;
543 length = PACKET_LENGTH_TM_LFR_SCIENCE_SBM1_BP1_F0;
548 float sx_re;
544 ring_node_to_send->header.packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2 >> 8);
549 float sx_im;
545 ring_node_to_send->header.packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2);
550 float nebx_re = 0;
546 ring_node_to_send->header.pa_lfr_bp_blk_nr[0] = (unsigned char) ( (NB_BINS_COMPRESSED_SM_SBM1_F0) >> 8 ); // BLK_NR MSB
551 float nebx_im = 0;
547 ring_node_to_send->header.pa_lfr_bp_blk_nr[1] = (unsigned char) (NB_BINS_COMPRESSED_SM_SBM1_F0); // BLK_NR LSB
552 float ny = 0;
548 nbBytesTosend = PACKET_LENGTH_TM_LFR_SCIENCE_SBM1_BP1_F0
553 float nz = 0;
549 + CCSDS_TC_TM_PACKET_OFFSET
554 float bx_bx_star = 0;
550 + CCSDS_PROTOCOLE_EXTRA_BYTES;
555 for(i=0; i<nb_bins_compressed_spec_mat; i++){
551 break;
556 //==============================================
552 default:
557 // BP1 PSD == B PAR_LFR_SC_BP1_PE_FL0 == 16 bits
553 nbBytesTosend = 0;
558 PSDB = compressed_spec_mat[i*30] // S11
554 PRINTF1("ERR *** in BP1_send *** unexpected sid %d\n", sid)
559 + compressed_spec_mat[(i*30) + 10] // S22
555 break;
560 + compressed_spec_mat[(i*30) + 18]; // S33
561 //significand = frexp(PSDB, &exponent);
562 pt_char = (unsigned char*) &PSDB;
563 LFR_BP1[(i*9) + 2] = pt_char[0]; // bits 31 downto 24 of the float
564 LFR_BP1[(i*9) + 3] = pt_char[1]; // bits 23 downto 16 of the float
565 //==============================================
566 // BP1 PSD == E PAR_LFR_SC_BP1_PB_FL0 == 16 bits
567 PSDE = compressed_spec_mat[(i*30) + 24] * K44_pe // S44
568 + compressed_spec_mat[(i*30) + 28] * K55_pe // S55
569 + compressed_spec_mat[(i*30) + 26] * K45_pe_re // S45
570 - compressed_spec_mat[(i*30) + 27] * K45_pe_im; // S45
571 pt_char = (unsigned char*) &PSDE;
572 LFR_BP1[(i*9) + 0] = pt_char[0]; // bits 31 downto 24 of the float
573 LFR_BP1[(i*9) + 1] = pt_char[1]; // bits 23 downto 16 of the float
574 //==============================================================================
575 // BP1 normal wave vector == PAR_LFR_SC_BP1_NVEC_V0_F0 == 8 bits
576 // == PAR_LFR_SC_BP1_NVEC_V1_F0 == 8 bits
577 // == PAR_LFR_SC_BP1_NVEC_V2_F0 == 1 bits
578 tmp = sqrt(
579 compressed_spec_mat[(i*30) + 3]*compressed_spec_mat[(i*30) + 3] //Im S12
580 +compressed_spec_mat[(i*30) + 5]*compressed_spec_mat[(i*30) + 5] //Im S13
581 +compressed_spec_mat[(i*30) + 13]*compressed_spec_mat[(i*30) + 13] //Im S23
582 );
583 NVEC_V0 = compressed_spec_mat[(i*30) + 13] / tmp; // Im S23
584 NVEC_V1 = -compressed_spec_mat[(i*30) + 5] / tmp; // Im S13
585 NVEC_V2 = compressed_spec_mat[(i*30) + 3] / tmp; // Im S12
586 LFR_BP1[(i*9) + 4] = (char) (NVEC_V0*127);
587 LFR_BP1[(i*9) + 5] = (char) (NVEC_V1*127);
588 pt_char = (unsigned char*) &NVEC_V2;
589 LFR_BP1[(i*9) + 6] = pt_char[0] & 0x80; // extract the sign of NVEC_V2
590 //=======================================================
591 // BP1 ellipticity == PAR_LFR_SC_BP1_ELLIP_F0 == 4 bits
592 aux = 2*tmp / PSDB; // compute the ellipticity
593 tmp_u_char = (unsigned char) (aux*(16-1)); // convert the ellipticity
594 LFR_BP1[i*9+6] = LFR_BP1[i*9+6] | ((tmp_u_char&0x0f)<<3); // keeps 4 bits of the resulting unsigned char
595 //==============================================================
596 // BP1 degree of polarization == PAR_LFR_SC_BP1_DOP_F0 == 3 bits
597 for(j = 0; j<NB_VALUES_PER_SM;j++){
598 tr_SB_SB = compressed_spec_mat[i*30] * compressed_spec_mat[i*30]
599 + compressed_spec_mat[(i*30) + 10] * compressed_spec_mat[(i*30) + 10]
600 + compressed_spec_mat[(i*30) + 18] * compressed_spec_mat[(i*30) + 18]
601 + 2 * compressed_spec_mat[(i*30) + 2] * compressed_spec_mat[(i*30) + 2]
602 + 2 * compressed_spec_mat[(i*30) + 3] * compressed_spec_mat[(i*30) + 3]
603 + 2 * compressed_spec_mat[(i*30) + 4] * compressed_spec_mat[(i*30) + 4]
604 + 2 * compressed_spec_mat[(i*30) + 5] * compressed_spec_mat[(i*30) + 5]
605 + 2 * compressed_spec_mat[(i*30) + 12] * compressed_spec_mat[(i*30) + 12]
606 + 2 * compressed_spec_mat[(i*30) + 13] * compressed_spec_mat[(i*30) + 13];
607 }
608 aux = PSDB*PSDB;
609 tmp = sqrt( abs( ( 3*tr_SB_SB - aux ) / ( 2 * aux ) ) );
610 tmp_u_char = (unsigned char) (NVEC_V0*(8-1));
611 LFR_BP1[(i*9) + 6] = LFR_BP1[(i*9) + 6] | (tmp_u_char & 0x07); // keeps 3 bits of the resulting unsigned char
612 //=======================================================================================
613 // BP1 x-component of the normalized Poynting flux == PAR_LFR_SC_BP1_SZ_F0 == 8 bits (7+1)
614 sx_re = compressed_spec_mat[(i*30) + 20] * K34_sx_re
615 + compressed_spec_mat[(i*30) + 6] * K14_sx_re
616 + compressed_spec_mat[(i*30) + 8] * K15_sx_re
617 + compressed_spec_mat[(i*30) + 14] * K24_sx_re
618 + compressed_spec_mat[(i*30) + 16] * K25_sx_re
619 + compressed_spec_mat[(i*30) + 22] * K35_sx_re;
620 sx_im = compressed_spec_mat[(i*30) + 21] * K34_sx_im
621 + compressed_spec_mat[(i*30) + 7] * K14_sx_im
622 + compressed_spec_mat[(i*30) + 9] * K15_sx_im
623 + compressed_spec_mat[(i*30) + 15] * K24_sx_im
624 + compressed_spec_mat[(i*30) + 17] * K25_sx_im
625 + compressed_spec_mat[(i*30) + 23] * K35_sx_im;
626 LFR_BP1[(i*9) + 7] = ((unsigned char) (sx_re * 128)) & 0x7f; // cf DOC for the compression
627 if ( abs(sx_re) > abs(sx_im) ) {
628 LFR_BP1[(i*9) + 7] = LFR_BP1[(i*9) + 1] | (0x80); // extract the sector of sx
629 }
630 else {
631 LFR_BP1[(i*9) + 7] = LFR_BP1[(i*9) + 1] & (0x7f); // extract the sector of sx
632 }
633 //======================================================================
634 // BP1 phase velocity estimator == PAR_LFR_SC_BP1_VPHI_F0 == 8 bits (7+1)
635 ny = sin(Alpha_M)*NVEC_V1 + cos(Alpha_M)*NVEC_V2;
636 nz = NVEC_V0;
637 bx_bx_star = cos(Alpha_M) * cos(Alpha_M) * compressed_spec_mat[i*30+10] // re S22
638 + sin(Alpha_M) * sin(Alpha_M) * compressed_spec_mat[i*30+18] // re S33
639 - 2 * sin(Alpha_M) * cos(Alpha_M) * compressed_spec_mat[i*30+12]; // re S23
640 nebx_re = ny * (compressed_spec_mat[(i*30) + 14] * K24_ny_re
641 +compressed_spec_mat[(i*30) + 16] * K25_ny_re
642 +compressed_spec_mat[(i*30) + 20] * K34_ny_re
643 +compressed_spec_mat[(i*30) + 22] * K35_ny_re)
644 + nz * (compressed_spec_mat[(i*30) + 14] * K24_nz_re
645 +compressed_spec_mat[(i*30) + 16] * K25_nz_re
646 +compressed_spec_mat[(i*30) + 20] * K34_nz_re
647 +compressed_spec_mat[(i*30) + 22] * K35_nz_re);
648 nebx_im = ny * (compressed_spec_mat[(i*30) + 15]*K24_ny_re
649 +compressed_spec_mat[(i*30) + 17] * K25_ny_re
650 +compressed_spec_mat[(i*30) + 21] * K34_ny_re
651 +compressed_spec_mat[(i*30) + 23] * K35_ny_re)
652 + nz * (compressed_spec_mat[(i*30) + 15] * K24_nz_im
653 +compressed_spec_mat[(i*30) + 17] * K25_nz_im
654 +compressed_spec_mat[(i*30) + 21] * K34_nz_im
655 +compressed_spec_mat[(i*30) + 23] * K35_nz_im);
656 tmp = nebx_re / bx_bx_star;
657 LFR_BP1[(i*9) + 8] = ((unsigned char) (tmp * 128)) & 0x7f; // cf DOC for the compression
658 if ( abs(nebx_re) > abs(nebx_im) ) {
659 LFR_BP1[(i*9) + 8] = LFR_BP1[(i*9) + 8] | (0x80); // extract the sector of nebx
660 }
661 else {
662 LFR_BP1[(i*9) + 8] = LFR_BP1[(i*9) + 8] & (0x7f); // extract the sector of nebx
663 }
664 }
556 }
665
557
666 }
558 // (2) BUILD THE HEADER
667
559 ring_node_to_send->header.packetLength[0] = (unsigned char) (length>>8);
668 void BP2_set_old(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat){
560 ring_node_to_send->header.packetLength[1] = (unsigned char) (length);
669 // BP2 autocorrelation
561 ring_node_to_send->header.sid = sid;
670 int i;
671 int aux = 0;
672
562
673 for(i = 0; i<nb_bins_compressed_spec_mat; i++){
563 // (3) SET PACKET TIME
674 // S12
564 ring_node_to_send->header.time[0] = (unsigned char) (ring_node_to_send->coarseTime>>24);
675 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 10]);
565 ring_node_to_send->header.time[1] = (unsigned char) (ring_node_to_send->coarseTime>>16);
676 compressed_spec_mat[(i*30) + 2] = compressed_spec_mat[(i*30) + 2] / aux;
566 ring_node_to_send->header.time[2] = (unsigned char) (ring_node_to_send->coarseTime>>8);
677 compressed_spec_mat[(i*30) + 3] = compressed_spec_mat[(i*30) + 3] / aux;
567 ring_node_to_send->header.time[3] = (unsigned char) (ring_node_to_send->coarseTime);
678 // S13
568 ring_node_to_send->header.time[4] = (unsigned char) (ring_node_to_send->fineTime>>8);
679 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 18]);
569 ring_node_to_send->header.time[5] = (unsigned char) (ring_node_to_send->fineTime);
680 compressed_spec_mat[(i*30) + 4] = compressed_spec_mat[(i*30) + 4] / aux;
570 //
681 compressed_spec_mat[(i*30) + 5] = compressed_spec_mat[(i*30) + 5] / aux;
571 ring_node_to_send->header.acquisitionTime[0] = (unsigned char) (ring_node_to_send->coarseTime>>24);
682 // S23
572 ring_node_to_send->header.acquisitionTime[1] = (unsigned char) (ring_node_to_send->coarseTime>>16);
683 aux = sqrt(compressed_spec_mat[i*30+12]*compressed_spec_mat[(i*30) + 18]);
573 ring_node_to_send->header.acquisitionTime[2] = (unsigned char) (ring_node_to_send->coarseTime>>8);
684 compressed_spec_mat[(i*30) + 12] = compressed_spec_mat[(i*30) + 12] / aux;
574 ring_node_to_send->header.acquisitionTime[3] = (unsigned char) (ring_node_to_send->coarseTime);
685 compressed_spec_mat[(i*30) + 13] = compressed_spec_mat[(i*30) + 13] / aux;
575 ring_node_to_send->header.acquisitionTime[4] = (unsigned char) (ring_node_to_send->fineTime>>8);
686 // S45
576 ring_node_to_send->header.acquisitionTime[5] = (unsigned char) (ring_node_to_send->fineTime);
687 aux = sqrt(compressed_spec_mat[i*30+24]*compressed_spec_mat[(i*30) + 28]);
577
688 compressed_spec_mat[(i*30) + 26] = compressed_spec_mat[(i*30) + 26] / aux;
578 // (4) SEND PACKET
689 compressed_spec_mat[(i*30) + 27] = compressed_spec_mat[(i*30) + 27] / aux;
579 status = rtems_message_queue_send( queue_id, &ring_node_to_send->header, nbBytesTosend);
690 // S14
580 if (status != RTEMS_SUCCESSFUL)
691 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) +24]);
581 {
692 compressed_spec_mat[(i*30) + 6] = compressed_spec_mat[(i*30) + 6] / aux;
582 printf("ERR *** in BP1_send *** ERR %d\n", (int) status);
693 compressed_spec_mat[(i*30) + 7] = compressed_spec_mat[(i*30) + 7] / aux;
694 // S15
695 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 28]);
696 compressed_spec_mat[(i*30) + 8] = compressed_spec_mat[(i*30) + 8] / aux;
697 compressed_spec_mat[(i*30) + 9] = compressed_spec_mat[(i*30) + 9] / aux;
698 // S24
699 aux = sqrt(compressed_spec_mat[i*10]*compressed_spec_mat[(i*30) + 24]);
700 compressed_spec_mat[(i*30) + 14] = compressed_spec_mat[(i*30) + 14] / aux;
701 compressed_spec_mat[(i*30) + 15] = compressed_spec_mat[(i*30) + 15] / aux;
702 // S25
703 aux = sqrt(compressed_spec_mat[i*10]*compressed_spec_mat[(i*30) + 28]);
704 compressed_spec_mat[(i*30) + 16] = compressed_spec_mat[(i*30) + 16] / aux;
705 compressed_spec_mat[(i*30) + 17] = compressed_spec_mat[(i*30) + 17] / aux;
706 // S34
707 aux = sqrt(compressed_spec_mat[i*18]*compressed_spec_mat[(i*30) + 24]);
708 compressed_spec_mat[(i*30) + 20] = compressed_spec_mat[(i*30) + 20] / aux;
709 compressed_spec_mat[(i*30) + 21] = compressed_spec_mat[(i*30) + 21] / aux;
710 // S35
711 aux = sqrt(compressed_spec_mat[i*18]*compressed_spec_mat[(i*30) + 28]);
712 compressed_spec_mat[(i*30) + 22] = compressed_spec_mat[(i*30) + 22] / aux;
713 compressed_spec_mat[(i*30) + 23] = compressed_spec_mat[(i*30) + 23] / aux;
714 }
583 }
715 }
584 }
716
585
717 void init_header_asm( Header_TM_LFR_SCIENCE_ASM_t *header)
586 void init_header_asm( Header_TM_LFR_SCIENCE_ASM_t *header)
718 {
587 {
719 header->targetLogicalAddress = CCSDS_DESTINATION_ID;
588 header->targetLogicalAddress = CCSDS_DESTINATION_ID;
720 header->protocolIdentifier = CCSDS_PROTOCOLE_ID;
589 header->protocolIdentifier = CCSDS_PROTOCOLE_ID;
721 header->reserved = 0x00;
590 header->reserved = 0x00;
722 header->userApplication = CCSDS_USER_APP;
591 header->userApplication = CCSDS_USER_APP;
723 header->packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
592 header->packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
724 header->packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
593 header->packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
725 header->packetSequenceControl[0] = 0xc0;
594 header->packetSequenceControl[0] = 0xc0;
726 header->packetSequenceControl[1] = 0x00;
595 header->packetSequenceControl[1] = 0x00;
727 header->packetLength[0] = 0x00;
596 header->packetLength[0] = 0x00;
728 header->packetLength[1] = 0x00;
597 header->packetLength[1] = 0x00;
729 // DATA FIELD HEADER
598 // DATA FIELD HEADER
730 header->spare1_pusVersion_spare2 = 0x10;
599 header->spare1_pusVersion_spare2 = 0x10;
731 header->serviceType = TM_TYPE_LFR_SCIENCE; // service type
600 header->serviceType = TM_TYPE_LFR_SCIENCE; // service type
732 header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
601 header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
733 header->destinationID = TM_DESTINATION_ID_GROUND;
602 header->destinationID = TM_DESTINATION_ID_GROUND;
734 // AUXILIARY DATA HEADER
603 // AUXILIARY DATA HEADER
735 header->sid = 0x00;
604 header->sid = 0x00;
736 header->biaStatusInfo = 0x00;
605 header->biaStatusInfo = 0x00;
737 header->pa_lfr_pkt_cnt_asm = 0x00;
606 header->pa_lfr_pkt_cnt_asm = 0x00;
738 header->pa_lfr_pkt_nr_asm = 0x00;
607 header->pa_lfr_pkt_nr_asm = 0x00;
739 header->time[0] = 0x00;
608 header->time[0] = 0x00;
740 header->time[0] = 0x00;
609 header->time[0] = 0x00;
741 header->time[0] = 0x00;
610 header->time[0] = 0x00;
742 header->time[0] = 0x00;
611 header->time[0] = 0x00;
743 header->time[0] = 0x00;
612 header->time[0] = 0x00;
744 header->time[0] = 0x00;
613 header->time[0] = 0x00;
745 header->pa_lfr_asm_blk_nr[0] = 0x00; // BLK_NR MSB
614 header->pa_lfr_asm_blk_nr[0] = 0x00; // BLK_NR MSB
746 header->pa_lfr_asm_blk_nr[1] = 0x00; // BLK_NR LSB
615 header->pa_lfr_asm_blk_nr[1] = 0x00; // BLK_NR LSB
747 }
616 }
748
617
749 void init_header_bp( Header_TM_LFR_SCIENCE_BP_t *header)
618 void init_bp_ring_sbm1()
619 {
620 unsigned int i;
621
622 //********
623 // F0 RING
624 bp_ring_sbm1[0].next = (ring_node_bp*) &bp_ring_sbm1[1];
625 bp_ring_sbm1[0].previous = (ring_node_bp*) &bp_ring_sbm1[NB_RING_NODES_BP1_SBM1-1];
626
627 bp_ring_sbm1[NB_RING_NODES_BP1_SBM1-1].next = (ring_node_bp*) &bp_ring_sbm1[0];
628 bp_ring_sbm1[NB_RING_NODES_BP1_SBM1-1].previous = (ring_node_bp*) &bp_ring_sbm1[NB_RING_NODES_ASM_F0-2];
629
630 for(i=1; i<NB_RING_NODES_BP1_SBM1-1; i++)
631 {
632 bp_ring_sbm1[i].next = (ring_node_bp*) &bp_ring_sbm1[i+1];
633 bp_ring_sbm1[i].previous = (ring_node_bp*) &bp_ring_sbm1[i-1];
634 }
635 //
636 //********
637
638 for (i=0; i<NB_RING_NODES_BP1_SBM1; i++)
639 {
640 init_header_bp( (Header_TM_LFR_SCIENCE_BP_SBM_t*) &bp_ring_sbm1[ i ] );
641 bp_ring_sbm1[ i ].status = 0;
642 }
643 }
644
645 void init_header_bp(Header_TM_LFR_SCIENCE_BP_SBM_t *header )
750 {
646 {
751 header->targetLogicalAddress = CCSDS_DESTINATION_ID;
647 header->targetLogicalAddress = CCSDS_DESTINATION_ID;
752 header->protocolIdentifier = CCSDS_PROTOCOLE_ID;
648 header->protocolIdentifier = CCSDS_PROTOCOLE_ID;
753 header->reserved = 0x00;
649 header->reserved = 0x00;
754 header->userApplication = CCSDS_USER_APP;
650 header->userApplication = CCSDS_USER_APP;
755 // header->packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
651 header->packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2 >> 8);
756 // header->packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
652 header->packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2);
757 header->packetSequenceControl[0] = 0xc0;
653 header->packetSequenceControl[0] = 0xc0;
758 header->packetSequenceControl[1] = 0x00;
654 header->packetSequenceControl[1] = 0x00;
759 header->packetLength[0] = 0x00;
655 header->packetLength[0] = 0x00;
760 header->packetLength[1] = 0x00;
656 header->packetLength[1] = 0x00;
761 // DATA FIELD HEADER
657 // DATA FIELD HEADER
762 header->spare1_pusVersion_spare2 = 0x10;
658 header->spare1_pusVersion_spare2 = 0x10;
763 header->serviceType = TM_TYPE_LFR_SCIENCE; // service type
659 header->serviceType = TM_TYPE_LFR_SCIENCE; // service type
764 header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
660 header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
765 header->destinationID = TM_DESTINATION_ID_GROUND;
661 header->destinationID = TM_DESTINATION_ID_GROUND;
766 // AUXILIARY DATA HEADER
662 // AUXILIARY DATA HEADER
767 header->sid = 0x00;
663 header->sid = 0x00;
768 header->biaStatusInfo = 0x00;
664 header->biaStatusInfo = 0x00;
769 header->time[0] = 0x00;
665 header->time[0] = 0x00;
770 header->time[0] = 0x00;
666 header->time[0] = 0x00;
771 header->time[0] = 0x00;
667 header->time[0] = 0x00;
772 header->time[0] = 0x00;
668 header->time[0] = 0x00;
773 header->time[0] = 0x00;
669 header->time[0] = 0x00;
774 header->time[0] = 0x00;
670 header->time[0] = 0x00;
775 header->pa_lfr_bp_blk_nr[0] = 0x00; // BLK_NR MSB
671 header->pa_lfr_bp_blk_nr[0] = 0x00; // BLK_NR MSB
776 header->pa_lfr_bp_blk_nr[1] = 0x00; // BLK_NR LSB
672 header->pa_lfr_bp_blk_nr[1] = 0x00; // BLK_NR LSB
777 }
673 }
778
674
779 void fill_averaged_spectral_matrix(void)
675 void reset_spectral_matrix_regs( void )
780 {
781 /** This function fills spectral matrices related buffers with arbitrary data.
782 *
783 * This function is for testing purpose only.
784 *
785 */
786
787 float offset;
788 float coeff;
789
790 offset = 10.;
791 coeff = 100000.;
792 averaged_sm_f0[ 0 + 25 * 0 ] = 0. + offset;
793 averaged_sm_f0[ 0 + 25 * 1 ] = 1. + offset;
794 averaged_sm_f0[ 0 + 25 * 2 ] = 2. + offset;
795 averaged_sm_f0[ 0 + 25 * 3 ] = 3. + offset;
796 averaged_sm_f0[ 0 + 25 * 4 ] = 4. + offset;
797 averaged_sm_f0[ 0 + 25 * 5 ] = 5. + offset;
798 averaged_sm_f0[ 0 + 25 * 6 ] = 6. + offset;
799 averaged_sm_f0[ 0 + 25 * 7 ] = 7. + offset;
800 averaged_sm_f0[ 0 + 25 * 8 ] = 8. + offset;
801 averaged_sm_f0[ 0 + 25 * 9 ] = 9. + offset;
802 averaged_sm_f0[ 0 + 25 * 10 ] = 10. + offset;
803 averaged_sm_f0[ 0 + 25 * 11 ] = 11. + offset;
804 averaged_sm_f0[ 0 + 25 * 12 ] = 12. + offset;
805 averaged_sm_f0[ 0 + 25 * 13 ] = 13. + offset;
806 averaged_sm_f0[ 0 + 25 * 14 ] = 14. + offset;
807 averaged_sm_f0[ 9 + 25 * 0 ] = -(0. + offset)* coeff;
808 averaged_sm_f0[ 9 + 25 * 1 ] = -(1. + offset)* coeff;
809 averaged_sm_f0[ 9 + 25 * 2 ] = -(2. + offset)* coeff;
810 averaged_sm_f0[ 9 + 25 * 3 ] = -(3. + offset)* coeff;
811 averaged_sm_f0[ 9 + 25 * 4 ] = -(4. + offset)* coeff;
812 averaged_sm_f0[ 9 + 25 * 5 ] = -(5. + offset)* coeff;
813 averaged_sm_f0[ 9 + 25 * 6 ] = -(6. + offset)* coeff;
814 averaged_sm_f0[ 9 + 25 * 7 ] = -(7. + offset)* coeff;
815 averaged_sm_f0[ 9 + 25 * 8 ] = -(8. + offset)* coeff;
816 averaged_sm_f0[ 9 + 25 * 9 ] = -(9. + offset)* coeff;
817 averaged_sm_f0[ 9 + 25 * 10 ] = -(10. + offset)* coeff;
818 averaged_sm_f0[ 9 + 25 * 11 ] = -(11. + offset)* coeff;
819 averaged_sm_f0[ 9 + 25 * 12 ] = -(12. + offset)* coeff;
820 averaged_sm_f0[ 9 + 25 * 13 ] = -(13. + offset)* coeff;
821 averaged_sm_f0[ 9 + 25 * 14 ] = -(14. + offset)* coeff;
822
823 offset = 10000000;
824 averaged_sm_f0[ 16 + 25 * 0 ] = (0. + offset)* coeff;
825 averaged_sm_f0[ 16 + 25 * 1 ] = (1. + offset)* coeff;
826 averaged_sm_f0[ 16 + 25 * 2 ] = (2. + offset)* coeff;
827 averaged_sm_f0[ 16 + 25 * 3 ] = (3. + offset)* coeff;
828 averaged_sm_f0[ 16 + 25 * 4 ] = (4. + offset)* coeff;
829 averaged_sm_f0[ 16 + 25 * 5 ] = (5. + offset)* coeff;
830 averaged_sm_f0[ 16 + 25 * 6 ] = (6. + offset)* coeff;
831 averaged_sm_f0[ 16 + 25 * 7 ] = (7. + offset)* coeff;
832 averaged_sm_f0[ 16 + 25 * 8 ] = (8. + offset)* coeff;
833 averaged_sm_f0[ 16 + 25 * 9 ] = (9. + offset)* coeff;
834 averaged_sm_f0[ 16 + 25 * 10 ] = (10. + offset)* coeff;
835 averaged_sm_f0[ 16 + 25 * 11 ] = (11. + offset)* coeff;
836 averaged_sm_f0[ 16 + 25 * 12 ] = (12. + offset)* coeff;
837 averaged_sm_f0[ 16 + 25 * 13 ] = (13. + offset)* coeff;
838 averaged_sm_f0[ 16 + 25 * 14 ] = (14. + offset)* coeff;
839
840 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 0 ] = averaged_sm_f0[ 0 ];
841 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 1 ] = averaged_sm_f0[ 1 ];
842 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 2 ] = averaged_sm_f0[ 2 ];
843 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 3 ] = averaged_sm_f0[ 3 ];
844 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 4 ] = averaged_sm_f0[ 4 ];
845 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 5 ] = averaged_sm_f0[ 5 ];
846 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 6 ] = averaged_sm_f0[ 6 ];
847 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 7 ] = averaged_sm_f0[ 7 ];
848 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 8 ] = averaged_sm_f0[ 8 ];
849 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 9 ] = averaged_sm_f0[ 9 ];
850 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 10 ] = averaged_sm_f0[ 10 ];
851 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 11 ] = averaged_sm_f0[ 11 ];
852 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 12 ] = averaged_sm_f0[ 12 ];
853 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 13 ] = averaged_sm_f0[ 13 ];
854 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 14 ] = averaged_sm_f0[ 14 ];
855 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 15 ] = averaged_sm_f0[ 15 ];
856 }
857
858 void reset_spectral_matrix_regs()
859 {
676 {
860 /** This function resets the spectral matrices module registers.
677 /** This function resets the spectral matrices module registers.
861 *
678 *
862 * The registers affected by this function are located at the following offset addresses:
679 * The registers affected by this function are located at the following offset addresses:
863 *
680 *
864 * - 0x00 config
681 * - 0x00 config
865 * - 0x04 status
682 * - 0x04 status
866 * - 0x08 matrixF0_Address0
683 * - 0x08 matrixF0_Address0
867 * - 0x10 matrixFO_Address1
684 * - 0x10 matrixFO_Address1
868 * - 0x14 matrixF1_Address
685 * - 0x14 matrixF1_Address
869 * - 0x18 matrixF2_Address
686 * - 0x18 matrixF2_Address
870 *
687 *
871 */
688 */
872
689
873 spectral_matrix_regs->config = 0x00;
690 spectral_matrix_regs->config = 0x00;
874 spectral_matrix_regs->status = 0x00;
691 spectral_matrix_regs->status = 0x00;
875
692
876 spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address;
693 spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address;
877 spectral_matrix_regs->matrixFO_Address1 = current_ring_node_sm_f0->buffer_address;
694 spectral_matrix_regs->matrixFO_Address1 = current_ring_node_sm_f0->buffer_address;
878 spectral_matrix_regs->matrixF1_Address = current_ring_node_sm_f1->buffer_address;
695 spectral_matrix_regs->matrixF1_Address = current_ring_node_sm_f1->buffer_address;
879 spectral_matrix_regs->matrixF2_Address = current_ring_node_sm_f2->buffer_address;
696 spectral_matrix_regs->matrixF2_Address = current_ring_node_sm_f2->buffer_address;
880 }
697 }
881
698
882 //******************
699 //******************
883 // general functions
700 // general functions
884
701
885
702
886
703
887
704
@@ -1,879 +1,879
1 /** Functions and tasks related to TeleCommand handling.
1 /** Functions and tasks related to TeleCommand handling.
2 *
2 *
3 * @file
3 * @file
4 * @author P. LEROY
4 * @author P. LEROY
5 *
5 *
6 * A group of functions to handle TeleCommands:\n
6 * A group of functions to handle TeleCommands:\n
7 * action launching\n
7 * action launching\n
8 * TC parsing\n
8 * TC parsing\n
9 * ...
9 * ...
10 *
10 *
11 */
11 */
12
12
13 #include "tc_handler.h"
13 #include "tc_handler.h"
14
14
15 //***********
15 //***********
16 // RTEMS TASK
16 // RTEMS TASK
17
17
18 rtems_task actn_task( rtems_task_argument unused )
18 rtems_task actn_task( rtems_task_argument unused )
19 {
19 {
20 /** This RTEMS task is responsible for launching actions upton the reception of valid TeleCommands.
20 /** This RTEMS task is responsible for launching actions upton the reception of valid TeleCommands.
21 *
21 *
22 * @param unused is the starting argument of the RTEMS task
22 * @param unused is the starting argument of the RTEMS task
23 *
23 *
24 * The ACTN task waits for data coming from an RTEMS msesage queue. When data arrives, it launches specific actions depending
24 * The ACTN task waits for data coming from an RTEMS msesage queue. When data arrives, it launches specific actions depending
25 * on the incoming TeleCommand.
25 * on the incoming TeleCommand.
26 *
26 *
27 */
27 */
28
28
29 int result;
29 int result;
30 rtems_status_code status; // RTEMS status code
30 rtems_status_code status; // RTEMS status code
31 ccsdsTelecommandPacket_t TC; // TC sent to the ACTN task
31 ccsdsTelecommandPacket_t TC; // TC sent to the ACTN task
32 size_t size; // size of the incoming TC packet
32 size_t size; // size of the incoming TC packet
33 unsigned char subtype; // subtype of the current TC packet
33 unsigned char subtype; // subtype of the current TC packet
34 unsigned char time[6];
34 unsigned char time[6];
35 rtems_id queue_rcv_id;
35 rtems_id queue_rcv_id;
36 rtems_id queue_snd_id;
36 rtems_id queue_snd_id;
37
37
38 status = get_message_queue_id_recv( &queue_rcv_id );
38 status = get_message_queue_id_recv( &queue_rcv_id );
39 if (status != RTEMS_SUCCESSFUL)
39 if (status != RTEMS_SUCCESSFUL)
40 {
40 {
41 PRINTF1("in ACTN *** ERR get_message_queue_id_recv %d\n", status)
41 PRINTF1("in ACTN *** ERR get_message_queue_id_recv %d\n", status)
42 }
42 }
43
43
44 status = get_message_queue_id_send( &queue_snd_id );
44 status = get_message_queue_id_send( &queue_snd_id );
45 if (status != RTEMS_SUCCESSFUL)
45 if (status != RTEMS_SUCCESSFUL)
46 {
46 {
47 PRINTF1("in ACTN *** ERR get_message_queue_id_send %d\n", status)
47 PRINTF1("in ACTN *** ERR get_message_queue_id_send %d\n", status)
48 }
48 }
49
49
50 result = LFR_SUCCESSFUL;
50 result = LFR_SUCCESSFUL;
51 subtype = 0; // subtype of the current TC packet
51 subtype = 0; // subtype of the current TC packet
52
52
53 BOOT_PRINTF("in ACTN *** \n")
53 BOOT_PRINTF("in ACTN *** \n")
54
54
55 while(1)
55 while(1)
56 {
56 {
57 status = rtems_message_queue_receive( queue_rcv_id, (char*) &TC, &size,
57 status = rtems_message_queue_receive( queue_rcv_id, (char*) &TC, &size,
58 RTEMS_WAIT, RTEMS_NO_TIMEOUT);
58 RTEMS_WAIT, RTEMS_NO_TIMEOUT);
59 getTime( time ); // set time to the current time
59 getTime( time ); // set time to the current time
60 if (status!=RTEMS_SUCCESSFUL)
60 if (status!=RTEMS_SUCCESSFUL)
61 {
61 {
62 PRINTF1("ERR *** in task ACTN *** error receiving a message, code %d \n", status)
62 PRINTF1("ERR *** in task ACTN *** error receiving a message, code %d \n", status)
63 }
63 }
64 else
64 else
65 {
65 {
66 subtype = TC.serviceSubType;
66 subtype = TC.serviceSubType;
67 switch(subtype)
67 switch(subtype)
68 {
68 {
69 case TC_SUBTYPE_RESET:
69 case TC_SUBTYPE_RESET:
70 result = action_reset( &TC, queue_snd_id, time );
70 result = action_reset( &TC, queue_snd_id, time );
71 close_action( &TC, result, queue_snd_id );
71 close_action( &TC, result, queue_snd_id );
72 break;
72 break;
73 //
73 //
74 case TC_SUBTYPE_LOAD_COMM:
74 case TC_SUBTYPE_LOAD_COMM:
75 result = action_load_common_par( &TC );
75 result = action_load_common_par( &TC );
76 close_action( &TC, result, queue_snd_id );
76 close_action( &TC, result, queue_snd_id );
77 break;
77 break;
78 //
78 //
79 case TC_SUBTYPE_LOAD_NORM:
79 case TC_SUBTYPE_LOAD_NORM:
80 result = action_load_normal_par( &TC, queue_snd_id, time );
80 result = action_load_normal_par( &TC, queue_snd_id, time );
81 close_action( &TC, result, queue_snd_id );
81 close_action( &TC, result, queue_snd_id );
82 break;
82 break;
83 //
83 //
84 case TC_SUBTYPE_LOAD_BURST:
84 case TC_SUBTYPE_LOAD_BURST:
85 result = action_load_burst_par( &TC, queue_snd_id, time );
85 result = action_load_burst_par( &TC, queue_snd_id, time );
86 close_action( &TC, result, queue_snd_id );
86 close_action( &TC, result, queue_snd_id );
87 break;
87 break;
88 //
88 //
89 case TC_SUBTYPE_LOAD_SBM1:
89 case TC_SUBTYPE_LOAD_SBM1:
90 result = action_load_sbm1_par( &TC, queue_snd_id, time );
90 result = action_load_sbm1_par( &TC, queue_snd_id, time );
91 close_action( &TC, result, queue_snd_id );
91 close_action( &TC, result, queue_snd_id );
92 break;
92 break;
93 //
93 //
94 case TC_SUBTYPE_LOAD_SBM2:
94 case TC_SUBTYPE_LOAD_SBM2:
95 result = action_load_sbm2_par( &TC, queue_snd_id, time );
95 result = action_load_sbm2_par( &TC, queue_snd_id, time );
96 close_action( &TC, result, queue_snd_id );
96 close_action( &TC, result, queue_snd_id );
97 break;
97 break;
98 //
98 //
99 case TC_SUBTYPE_DUMP:
99 case TC_SUBTYPE_DUMP:
100 result = action_dump_par( queue_snd_id );
100 result = action_dump_par( queue_snd_id );
101 close_action( &TC, result, queue_snd_id );
101 close_action( &TC, result, queue_snd_id );
102 break;
102 break;
103 //
103 //
104 case TC_SUBTYPE_ENTER:
104 case TC_SUBTYPE_ENTER:
105 result = action_enter_mode( &TC, queue_snd_id );
105 result = action_enter_mode( &TC, queue_snd_id );
106 close_action( &TC, result, queue_snd_id );
106 close_action( &TC, result, queue_snd_id );
107 break;
107 break;
108 //
108 //
109 case TC_SUBTYPE_UPDT_INFO:
109 case TC_SUBTYPE_UPDT_INFO:
110 result = action_update_info( &TC, queue_snd_id );
110 result = action_update_info( &TC, queue_snd_id );
111 close_action( &TC, result, queue_snd_id );
111 close_action( &TC, result, queue_snd_id );
112 break;
112 break;
113 //
113 //
114 case TC_SUBTYPE_EN_CAL:
114 case TC_SUBTYPE_EN_CAL:
115 result = action_enable_calibration( &TC, queue_snd_id, time );
115 result = action_enable_calibration( &TC, queue_snd_id, time );
116 close_action( &TC, result, queue_snd_id );
116 close_action( &TC, result, queue_snd_id );
117 break;
117 break;
118 //
118 //
119 case TC_SUBTYPE_DIS_CAL:
119 case TC_SUBTYPE_DIS_CAL:
120 result = action_disable_calibration( &TC, queue_snd_id, time );
120 result = action_disable_calibration( &TC, queue_snd_id, time );
121 close_action( &TC, result, queue_snd_id );
121 close_action( &TC, result, queue_snd_id );
122 break;
122 break;
123 //
123 //
124 case TC_SUBTYPE_UPDT_TIME:
124 case TC_SUBTYPE_UPDT_TIME:
125 result = action_update_time( &TC );
125 result = action_update_time( &TC );
126 close_action( &TC, result, queue_snd_id );
126 close_action( &TC, result, queue_snd_id );
127 break;
127 break;
128 //
128 //
129 default:
129 default:
130 break;
130 break;
131 }
131 }
132 }
132 }
133 }
133 }
134 }
134 }
135
135
136 //***********
136 //***********
137 // TC ACTIONS
137 // TC ACTIONS
138
138
139 int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
139 int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
140 {
140 {
141 /** This function executes specific actions when a TC_LFR_RESET TeleCommand has been received.
141 /** This function executes specific actions when a TC_LFR_RESET TeleCommand has been received.
142 *
142 *
143 * @param TC points to the TeleCommand packet that is being processed
143 * @param TC points to the TeleCommand packet that is being processed
144 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
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 send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time );
148 send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time );
149 return LFR_DEFAULT;
149 return LFR_DEFAULT;
150 }
150 }
151
151
152 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
152 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
153 {
153 {
154 /** This function executes specific actions when a TC_LFR_ENTER_MODE TeleCommand has been received.
154 /** This function executes specific actions when a TC_LFR_ENTER_MODE TeleCommand has been received.
155 *
155 *
156 * @param TC points to the TeleCommand packet that is being processed
156 * @param TC points to the TeleCommand packet that is being processed
157 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
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 rtems_status_code status;
161 rtems_status_code status;
162 unsigned char requestedMode;
162 unsigned char requestedMode;
163 unsigned int *transitionCoarseTime_ptr;
163 unsigned int *transitionCoarseTime_ptr;
164 unsigned int transitionCoarseTime;
164 unsigned int transitionCoarseTime;
165 unsigned char * bytePosPtr;
165 unsigned char * bytePosPtr;
166
166
167 bytePosPtr = (unsigned char *) &TC->packetID;
167 bytePosPtr = (unsigned char *) &TC->packetID;
168
168
169 requestedMode = bytePosPtr[ BYTE_POS_CP_MODE_LFR_SET ];
169 requestedMode = bytePosPtr[ BYTE_POS_CP_MODE_LFR_SET ];
170 transitionCoarseTime_ptr = (unsigned int *) ( &bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME ] );
170 transitionCoarseTime_ptr = (unsigned int *) ( &bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME ] );
171 transitionCoarseTime = (*transitionCoarseTime_ptr) & 0x7fffffff;
171 transitionCoarseTime = (*transitionCoarseTime_ptr) & 0x7fffffff;
172
172
173 status = check_mode_value( requestedMode );
173 status = check_mode_value( requestedMode );
174
174
175 if ( status != LFR_SUCCESSFUL ) // the mode value is inconsistent
175 if ( status != LFR_SUCCESSFUL ) // the mode value is inconsistent
176 {
176 {
177 send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_CP_MODE_LFR_SET, requestedMode );
177 send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_CP_MODE_LFR_SET, requestedMode );
178 }
178 }
179 else // the mode value is consistent, check the transition
179 else // the mode value is consistent, check the transition
180 {
180 {
181 status = check_mode_transition(requestedMode);
181 status = check_mode_transition(requestedMode);
182 if (status != LFR_SUCCESSFUL)
182 if (status != LFR_SUCCESSFUL)
183 {
183 {
184 PRINTF("ERR *** in action_enter_mode *** check_mode_transition\n")
184 PRINTF("ERR *** in action_enter_mode *** check_mode_transition\n")
185 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
185 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
186 }
186 }
187 }
187 }
188
188
189 if ( status == LFR_SUCCESSFUL ) // the transition is valid, enter the mode
189 if ( status == LFR_SUCCESSFUL ) // the transition is valid, enter the mode
190 {
190 {
191 status = check_transition_date( transitionCoarseTime );
191 status = check_transition_date( transitionCoarseTime );
192 if (status != LFR_SUCCESSFUL)
192 if (status != LFR_SUCCESSFUL)
193 {
193 {
194 PRINTF("ERR *** in action_enter_mode *** check_transition_date\n")
194 PRINTF("ERR *** in action_enter_mode *** check_transition_date\n")
195 send_tm_lfr_tc_exe_inconsistent( TC, queue_id,
195 send_tm_lfr_tc_exe_inconsistent( TC, queue_id,
196 BYTE_POS_CP_LFR_ENTER_MODE_TIME,
196 BYTE_POS_CP_LFR_ENTER_MODE_TIME,
197 bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME + 3 ] );
197 bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME + 3 ] );
198 }
198 }
199 }
199 }
200
200
201 if ( status == LFR_SUCCESSFUL ) // the date is valid, enter the mode
201 if ( status == LFR_SUCCESSFUL ) // the date is valid, enter the mode
202 {
202 {
203 PRINTF1("OK *** in action_enter_mode *** enter mode %d\n", requestedMode);
203 PRINTF1("OK *** in action_enter_mode *** enter mode %d\n", requestedMode);
204 status = enter_mode( requestedMode, transitionCoarseTime );
204 status = enter_mode( requestedMode, transitionCoarseTime );
205 }
205 }
206
206
207 return status;
207 return status;
208 }
208 }
209
209
210 int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
210 int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
211 {
211 {
212 /** This function executes specific actions when a TC_LFR_UPDATE_INFO TeleCommand has been received.
212 /** This function executes specific actions when a TC_LFR_UPDATE_INFO TeleCommand has been received.
213 *
213 *
214 * @param TC points to the TeleCommand packet that is being processed
214 * @param TC points to the TeleCommand packet that is being processed
215 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
215 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
216 *
216 *
217 * @return LFR directive status code:
217 * @return LFR directive status code:
218 * - LFR_DEFAULT
218 * - LFR_DEFAULT
219 * - LFR_SUCCESSFUL
219 * - LFR_SUCCESSFUL
220 *
220 *
221 */
221 */
222
222
223 unsigned int val;
223 unsigned int val;
224 int result;
224 int result;
225 unsigned int status;
225 unsigned int status;
226 unsigned char mode;
226 unsigned char mode;
227 unsigned char * bytePosPtr;
227 unsigned char * bytePosPtr;
228
228
229 bytePosPtr = (unsigned char *) &TC->packetID;
229 bytePosPtr = (unsigned char *) &TC->packetID;
230
230
231 // check LFR mode
231 // check LFR mode
232 mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET5 ] & 0x1e) >> 1;
232 mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET5 ] & 0x1e) >> 1;
233 status = check_update_info_hk_lfr_mode( mode );
233 status = check_update_info_hk_lfr_mode( mode );
234 if (status == LFR_SUCCESSFUL) // check TDS mode
234 if (status == LFR_SUCCESSFUL) // check TDS mode
235 {
235 {
236 mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 ] & 0xf0) >> 4;
236 mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 ] & 0xf0) >> 4;
237 status = check_update_info_hk_tds_mode( mode );
237 status = check_update_info_hk_tds_mode( mode );
238 }
238 }
239 if (status == LFR_SUCCESSFUL) // check THR mode
239 if (status == LFR_SUCCESSFUL) // check THR mode
240 {
240 {
241 mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 ] & 0x0f);
241 mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 ] & 0x0f);
242 status = check_update_info_hk_thr_mode( mode );
242 status = check_update_info_hk_thr_mode( mode );
243 }
243 }
244 if (status == LFR_SUCCESSFUL) // if the parameter check is successful
244 if (status == LFR_SUCCESSFUL) // if the parameter check is successful
245 {
245 {
246 val = housekeeping_packet.hk_lfr_update_info_tc_cnt[0] * 256
246 val = housekeeping_packet.hk_lfr_update_info_tc_cnt[0] * 256
247 + housekeeping_packet.hk_lfr_update_info_tc_cnt[1];
247 + housekeeping_packet.hk_lfr_update_info_tc_cnt[1];
248 val++;
248 val++;
249 housekeeping_packet.hk_lfr_update_info_tc_cnt[0] = (unsigned char) (val >> 8);
249 housekeeping_packet.hk_lfr_update_info_tc_cnt[0] = (unsigned char) (val >> 8);
250 housekeeping_packet.hk_lfr_update_info_tc_cnt[1] = (unsigned char) (val);
250 housekeeping_packet.hk_lfr_update_info_tc_cnt[1] = (unsigned char) (val);
251 }
251 }
252
252
253 result = status;
253 result = status;
254
254
255 return result;
255 return result;
256 }
256 }
257
257
258 int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
258 int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
259 {
259 {
260 /** This function executes specific actions when a TC_LFR_ENABLE_CALIBRATION TeleCommand has been received.
260 /** This function executes specific actions when a TC_LFR_ENABLE_CALIBRATION TeleCommand has been received.
261 *
261 *
262 * @param TC points to the TeleCommand packet that is being processed
262 * @param TC points to the TeleCommand packet that is being processed
263 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
263 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
264 *
264 *
265 */
265 */
266
266
267 int result;
267 int result;
268 unsigned char lfrMode;
268 unsigned char lfrMode;
269
269
270 result = LFR_DEFAULT;
270 result = LFR_DEFAULT;
271 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
271 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
272
272
273 send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time );
273 send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time );
274 result = LFR_DEFAULT;
274 result = LFR_DEFAULT;
275
275
276 return result;
276 return result;
277 }
277 }
278
278
279 int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
279 int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time)
280 {
280 {
281 /** This function executes specific actions when a TC_LFR_DISABLE_CALIBRATION TeleCommand has been received.
281 /** This function executes specific actions when a TC_LFR_DISABLE_CALIBRATION TeleCommand has been received.
282 *
282 *
283 * @param TC points to the TeleCommand packet that is being processed
283 * @param TC points to the TeleCommand packet that is being processed
284 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
284 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
285 *
285 *
286 */
286 */
287
287
288 int result;
288 int result;
289 unsigned char lfrMode;
289 unsigned char lfrMode;
290
290
291 result = LFR_DEFAULT;
291 result = LFR_DEFAULT;
292 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
292 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
293
293
294 send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time );
294 send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time );
295 result = LFR_DEFAULT;
295 result = LFR_DEFAULT;
296
296
297 return result;
297 return result;
298 }
298 }
299
299
300 int action_update_time(ccsdsTelecommandPacket_t *TC)
300 int action_update_time(ccsdsTelecommandPacket_t *TC)
301 {
301 {
302 /** This function executes specific actions when a TC_LFR_UPDATE_TIME TeleCommand has been received.
302 /** This function executes specific actions when a TC_LFR_UPDATE_TIME TeleCommand has been received.
303 *
303 *
304 * @param TC points to the TeleCommand packet that is being processed
304 * @param TC points to the TeleCommand packet that is being processed
305 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
305 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
306 *
306 *
307 * @return LFR_SUCCESSFUL
307 * @return LFR_SUCCESSFUL
308 *
308 *
309 */
309 */
310
310
311 unsigned int val;
311 unsigned int val;
312
312
313 time_management_regs->coarse_time_load = (TC->dataAndCRC[0] << 24)
313 time_management_regs->coarse_time_load = (TC->dataAndCRC[0] << 24)
314 + (TC->dataAndCRC[1] << 16)
314 + (TC->dataAndCRC[1] << 16)
315 + (TC->dataAndCRC[2] << 8)
315 + (TC->dataAndCRC[2] << 8)
316 + TC->dataAndCRC[3];
316 + TC->dataAndCRC[3];
317
317
318 PRINTF1("time received: %x\n", time_management_regs->coarse_time_load)
318 PRINTF1("time received: %x\n", time_management_regs->coarse_time_load)
319
319
320 val = housekeeping_packet.hk_lfr_update_time_tc_cnt[0] * 256
320 val = housekeeping_packet.hk_lfr_update_time_tc_cnt[0] * 256
321 + housekeeping_packet.hk_lfr_update_time_tc_cnt[1];
321 + housekeeping_packet.hk_lfr_update_time_tc_cnt[1];
322 val++;
322 val++;
323 housekeeping_packet.hk_lfr_update_time_tc_cnt[0] = (unsigned char) (val >> 8);
323 housekeeping_packet.hk_lfr_update_time_tc_cnt[0] = (unsigned char) (val >> 8);
324 housekeeping_packet.hk_lfr_update_time_tc_cnt[1] = (unsigned char) (val);
324 housekeeping_packet.hk_lfr_update_time_tc_cnt[1] = (unsigned char) (val);
325 // time_management_regs->ctrl = time_management_regs->ctrl | 1; // force tick
325 // time_management_regs->ctrl = time_management_regs->ctrl | 1; // force tick
326
326
327 return LFR_SUCCESSFUL;
327 return LFR_SUCCESSFUL;
328 }
328 }
329
329
330 //*******************
330 //*******************
331 // ENTERING THE MODES
331 // ENTERING THE MODES
332 int check_mode_value( unsigned char requestedMode )
332 int check_mode_value( unsigned char requestedMode )
333 {
333 {
334 int status;
334 int status;
335
335
336 if ( (requestedMode != LFR_MODE_STANDBY)
336 if ( (requestedMode != LFR_MODE_STANDBY)
337 && (requestedMode != LFR_MODE_NORMAL) && (requestedMode != LFR_MODE_BURST)
337 && (requestedMode != LFR_MODE_NORMAL) && (requestedMode != LFR_MODE_BURST)
338 && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) )
338 && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) )
339 {
339 {
340 status = LFR_DEFAULT;
340 status = LFR_DEFAULT;
341 }
341 }
342 else
342 else
343 {
343 {
344 status = LFR_SUCCESSFUL;
344 status = LFR_SUCCESSFUL;
345 }
345 }
346
346
347 return status;
347 return status;
348 }
348 }
349
349
350 int check_mode_transition( unsigned char requestedMode )
350 int check_mode_transition( unsigned char requestedMode )
351 {
351 {
352 /** This function checks the validity of the transition requested by the TC_LFR_ENTER_MODE.
352 /** This function checks the validity of the transition requested by the TC_LFR_ENTER_MODE.
353 *
353 *
354 * @param requestedMode is the mode requested by the TC_LFR_ENTER_MODE
354 * @param requestedMode is the mode requested by the TC_LFR_ENTER_MODE
355 *
355 *
356 * @return LFR directive status codes:
356 * @return LFR directive status codes:
357 * - LFR_SUCCESSFUL - the transition is authorized
357 * - LFR_SUCCESSFUL - the transition is authorized
358 * - LFR_DEFAULT - the transition is not authorized
358 * - LFR_DEFAULT - the transition is not authorized
359 *
359 *
360 */
360 */
361
361
362 int status;
362 int status;
363
363
364 switch (requestedMode)
364 switch (requestedMode)
365 {
365 {
366 case LFR_MODE_STANDBY:
366 case LFR_MODE_STANDBY:
367 if ( lfrCurrentMode == LFR_MODE_STANDBY ) {
367 if ( lfrCurrentMode == LFR_MODE_STANDBY ) {
368 status = LFR_DEFAULT;
368 status = LFR_DEFAULT;
369 }
369 }
370 else
370 else
371 {
371 {
372 status = LFR_SUCCESSFUL;
372 status = LFR_SUCCESSFUL;
373 }
373 }
374 break;
374 break;
375 case LFR_MODE_NORMAL:
375 case LFR_MODE_NORMAL:
376 if ( lfrCurrentMode == LFR_MODE_NORMAL ) {
376 if ( lfrCurrentMode == LFR_MODE_NORMAL ) {
377 status = LFR_DEFAULT;
377 status = LFR_DEFAULT;
378 }
378 }
379 else {
379 else {
380 status = LFR_SUCCESSFUL;
380 status = LFR_SUCCESSFUL;
381 }
381 }
382 break;
382 break;
383 case LFR_MODE_BURST:
383 case LFR_MODE_BURST:
384 if ( lfrCurrentMode == LFR_MODE_BURST ) {
384 if ( lfrCurrentMode == LFR_MODE_BURST ) {
385 status = LFR_DEFAULT;
385 status = LFR_DEFAULT;
386 }
386 }
387 else {
387 else {
388 status = LFR_SUCCESSFUL;
388 status = LFR_SUCCESSFUL;
389 }
389 }
390 break;
390 break;
391 case LFR_MODE_SBM1:
391 case LFR_MODE_SBM1:
392 if ( lfrCurrentMode == LFR_MODE_SBM1 ) {
392 if ( lfrCurrentMode == LFR_MODE_SBM1 ) {
393 status = LFR_DEFAULT;
393 status = LFR_DEFAULT;
394 }
394 }
395 else {
395 else {
396 status = LFR_SUCCESSFUL;
396 status = LFR_SUCCESSFUL;
397 }
397 }
398 break;
398 break;
399 case LFR_MODE_SBM2:
399 case LFR_MODE_SBM2:
400 if ( lfrCurrentMode == LFR_MODE_SBM2 ) {
400 if ( lfrCurrentMode == LFR_MODE_SBM2 ) {
401 status = LFR_DEFAULT;
401 status = LFR_DEFAULT;
402 }
402 }
403 else {
403 else {
404 status = LFR_SUCCESSFUL;
404 status = LFR_SUCCESSFUL;
405 }
405 }
406 break;
406 break;
407 default:
407 default:
408 status = LFR_DEFAULT;
408 status = LFR_DEFAULT;
409 break;
409 break;
410 }
410 }
411
411
412 return status;
412 return status;
413 }
413 }
414
414
415 int check_transition_date( unsigned int transitionCoarseTime )
415 int check_transition_date( unsigned int transitionCoarseTime )
416 {
416 {
417 int status;
417 int status;
418 unsigned int localCoarseTime;
418 unsigned int localCoarseTime;
419 unsigned int deltaCoarseTime;
419 unsigned int deltaCoarseTime;
420
420
421 status = LFR_SUCCESSFUL;
421 status = LFR_SUCCESSFUL;
422
422
423 if (transitionCoarseTime == 0) // transition time = 0 means an instant transition
423 if (transitionCoarseTime == 0) // transition time = 0 means an instant transition
424 {
424 {
425 status = LFR_SUCCESSFUL;
425 status = LFR_SUCCESSFUL;
426 }
426 }
427 else
427 else
428 {
428 {
429 localCoarseTime = time_management_regs->coarse_time & 0x7fffffff;
429 localCoarseTime = time_management_regs->coarse_time & 0x7fffffff;
430
430
431 if ( transitionCoarseTime <= localCoarseTime ) // SSS-CP-EQS-322
431 if ( transitionCoarseTime <= localCoarseTime ) // SSS-CP-EQS-322
432 {
432 {
433 status = LFR_DEFAULT;
433 status = LFR_DEFAULT;
434 PRINTF2("ERR *** in check_transition_date *** transition = %x, local = %x\n", transitionCoarseTime, localCoarseTime)
434 PRINTF2("ERR *** in check_transition_date *** transition = %x, local = %x\n", transitionCoarseTime, localCoarseTime)
435 }
435 }
436
436
437 if (status == LFR_SUCCESSFUL)
437 if (status == LFR_SUCCESSFUL)
438 {
438 {
439 deltaCoarseTime = transitionCoarseTime - localCoarseTime;
439 deltaCoarseTime = transitionCoarseTime - localCoarseTime;
440 if ( deltaCoarseTime > 3 ) // SSS-CP-EQS-323
440 if ( deltaCoarseTime > 3 ) // SSS-CP-EQS-323
441 {
441 {
442 status = LFR_DEFAULT;
442 status = LFR_DEFAULT;
443 PRINTF1("ERR *** in check_transition_date *** deltaCoarseTime = %x\n", deltaCoarseTime)
443 PRINTF1("ERR *** in check_transition_date *** deltaCoarseTime = %x\n", deltaCoarseTime)
444 }
444 }
445 }
445 }
446 }
446 }
447
447
448 return status;
448 return status;
449 }
449 }
450
450
451 int stop_current_mode( void )
451 int stop_current_mode( void )
452 {
452 {
453 /** This function stops the current mode by masking interrupt lines and suspending science tasks.
453 /** This function stops the current mode by masking interrupt lines and suspending science tasks.
454 *
454 *
455 * @return RTEMS directive status codes:
455 * @return RTEMS directive status codes:
456 * - RTEMS_SUCCESSFUL - task restarted successfully
456 * - RTEMS_SUCCESSFUL - task restarted successfully
457 * - RTEMS_INVALID_ID - task id invalid
457 * - RTEMS_INVALID_ID - task id invalid
458 * - RTEMS_ALREADY_SUSPENDED - task already suspended
458 * - RTEMS_ALREADY_SUSPENDED - task already suspended
459 *
459 *
460 */
460 */
461
461
462 rtems_status_code status;
462 rtems_status_code status;
463
463
464 status = RTEMS_SUCCESSFUL;
464 status = RTEMS_SUCCESSFUL;
465
465
466 // (1) mask interruptions
466 // (1) mask interruptions
467 LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); // mask waveform picker interrupt
467 LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); // mask waveform picker interrupt
468 LEON_Mask_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectral matrix interrupt
468 LEON_Mask_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectral matrix interrupt
469
469
470 // (2) clear interruptions
470 // (2) clear interruptions
471 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); // clear waveform picker interrupt
471 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); // clear waveform picker interrupt
472 LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectral matrix interrupt
472 LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectral matrix interrupt
473
473
474 // (3) reset waveform picker registers
474 // (3) reset waveform picker registers
475 reset_wfp_burst_enable(); // reset burst and enable bits
475 reset_wfp_burst_enable(); // reset burst and enable bits
476 reset_wfp_status(); // reset all the status bits
476 reset_wfp_status(); // reset all the status bits
477
477
478 // (4) reset spectral matrices registers
478 // (4) reset spectral matrices registers
479 set_irq_on_new_ready_matrix( 0 ); // stop the spectral matrices
479 set_irq_on_new_ready_matrix( 0 ); // stop the spectral matrices
480 set_run_matrix_spectral( 0 ); // run_matrix_spectral is set to 0
480 set_run_matrix_spectral( 0 ); // run_matrix_spectral is set to 0
481 reset_extractSWF(); // reset the extractSWF flag to false
481 reset_extractSWF(); // reset the extractSWF flag to false
482
482
483 // <Spectral Matrices simulator>
483 // <Spectral Matrices simulator>
484 LEON_Mask_interrupt( IRQ_SM_SIMULATOR ); // mask spectral matrix interrupt simulator
484 LEON_Mask_interrupt( IRQ_SM_SIMULATOR ); // mask spectral matrix interrupt simulator
485 timer_stop( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR );
485 timer_stop( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR );
486 LEON_Clear_interrupt( IRQ_SM_SIMULATOR ); // clear spectral matrix interrupt simulator
486 LEON_Clear_interrupt( IRQ_SM_SIMULATOR ); // clear spectral matrix interrupt simulator
487 // </Spectral Matrices simulator>
487 // </Spectral Matrices simulator>
488
488
489 // suspend several tasks
489 // suspend several tasks
490 if (lfrCurrentMode != LFR_MODE_STANDBY) {
490 if (lfrCurrentMode != LFR_MODE_STANDBY) {
491 status = suspend_science_tasks();
491 status = suspend_science_tasks();
492 }
492 }
493
493
494 if (status != RTEMS_SUCCESSFUL)
494 if (status != RTEMS_SUCCESSFUL)
495 {
495 {
496 PRINTF1("in stop_current_mode *** in suspend_science_tasks *** ERR code: %d\n", status)
496 PRINTF1("in stop_current_mode *** in suspend_science_tasks *** ERR code: %d\n", status)
497 }
497 }
498
498
499 return status;
499 return status;
500 }
500 }
501
501
502 int enter_mode( unsigned char mode, unsigned int transitionCoarseTime )
502 int enter_mode( unsigned char mode, unsigned int transitionCoarseTime )
503 {
503 {
504 /** This function is launched after a mode transition validation.
504 /** This function is launched after a mode transition validation.
505 *
505 *
506 * @param mode is the mode in which LFR will be put.
506 * @param mode is the mode in which LFR will be put.
507 *
507 *
508 * @return RTEMS directive status codes:
508 * @return RTEMS directive status codes:
509 * - RTEMS_SUCCESSFUL - the mode has been entered successfully
509 * - RTEMS_SUCCESSFUL - the mode has been entered successfully
510 * - RTEMS_NOT_SATISFIED - the mode has not been entered successfully
510 * - RTEMS_NOT_SATISFIED - the mode has not been entered successfully
511 *
511 *
512 */
512 */
513
513
514 rtems_status_code status;
514 rtems_status_code status;
515
515
516 //**********************
516 //**********************
517 // STOP THE CURRENT MODE
517 // STOP THE CURRENT MODE
518 status = stop_current_mode();
518 status = stop_current_mode();
519 if (status != RTEMS_SUCCESSFUL)
519 if (status != RTEMS_SUCCESSFUL)
520 {
520 {
521 PRINTF1("ERR *** in enter_mode *** stop_current_mode with mode = %d\n", mode)
521 PRINTF1("ERR *** in enter_mode *** stop_current_mode with mode = %d\n", mode)
522 }
522 }
523
523
524 //*************************
524 //*************************
525 // ENTER THE REQUESTED MODE
525 // ENTER THE REQUESTED MODE
526 if ( (mode == LFR_MODE_NORMAL) || (mode == LFR_MODE_BURST)
526 if ( (mode == LFR_MODE_NORMAL) || (mode == LFR_MODE_BURST)
527 || (mode == LFR_MODE_SBM1) || (mode == LFR_MODE_SBM2) )
527 || (mode == LFR_MODE_SBM1) || (mode == LFR_MODE_SBM2) )
528 {
528 {
529 #ifdef PRINT_TASK_STATISTICS
529 #ifdef PRINT_TASK_STATISTICS
530 rtems_cpu_usage_reset();
530 rtems_cpu_usage_reset();
531 maxCount = 0;
531 maxCount = 0;
532 #endif
532 #endif
533 status = restart_science_tasks();
533 status = restart_science_tasks();
534 launch_waveform_picker( mode, transitionCoarseTime );
534 launch_waveform_picker( mode, transitionCoarseTime );
535 // launch_spectral_matrix_simu( mode );
535 launch_spectral_matrix_simu( mode );
536 }
536 }
537 else if ( mode == LFR_MODE_STANDBY )
537 else if ( mode == LFR_MODE_STANDBY )
538 {
538 {
539 #ifdef PRINT_TASK_STATISTICS
539 #ifdef PRINT_TASK_STATISTICS
540 rtems_cpu_usage_report();
540 rtems_cpu_usage_report();
541 #endif
541 #endif
542
542
543 #ifdef PRINT_STACK_REPORT
543 #ifdef PRINT_STACK_REPORT
544 rtems_stack_checker_report_usage();
544 rtems_stack_checker_report_usage();
545 #endif
545 #endif
546 PRINTF1("maxCount = %d\n", maxCount)
546 PRINTF1("maxCount = %d\n", maxCount)
547 }
547 }
548 else
548 else
549 {
549 {
550 status = RTEMS_UNSATISFIED;
550 status = RTEMS_UNSATISFIED;
551 }
551 }
552
552
553 if (status != RTEMS_SUCCESSFUL)
553 if (status != RTEMS_SUCCESSFUL)
554 {
554 {
555 PRINTF1("ERR *** in enter_mode *** status = %d\n", status)
555 PRINTF1("ERR *** in enter_mode *** status = %d\n", status)
556 status = RTEMS_UNSATISFIED;
556 status = RTEMS_UNSATISFIED;
557 }
557 }
558
558
559 return status;
559 return status;
560 }
560 }
561
561
562 int restart_science_tasks()
562 int restart_science_tasks()
563 {
563 {
564 /** This function is used to restart all science tasks.
564 /** This function is used to restart all science tasks.
565 *
565 *
566 * @return RTEMS directive status codes:
566 * @return RTEMS directive status codes:
567 * - RTEMS_SUCCESSFUL - task restarted successfully
567 * - RTEMS_SUCCESSFUL - task restarted successfully
568 * - RTEMS_INVALID_ID - task id invalid
568 * - RTEMS_INVALID_ID - task id invalid
569 * - RTEMS_INCORRECT_STATE - task never started
569 * - RTEMS_INCORRECT_STATE - task never started
570 * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task
570 * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task
571 *
571 *
572 * Science tasks are AVF0, BPF0, WFRM, CWF3, CW2, CWF1
572 * Science tasks are AVF0, BPF0, WFRM, CWF3, CW2, CWF1
573 *
573 *
574 */
574 */
575
575
576 rtems_status_code status[6];
576 rtems_status_code status[6];
577 rtems_status_code ret;
577 rtems_status_code ret;
578
578
579 ret = RTEMS_SUCCESSFUL;
579 ret = RTEMS_SUCCESSFUL;
580
580
581 status[0] = rtems_task_restart( Task_id[TASKID_AVF0], 1 );
581 status[0] = rtems_task_restart( Task_id[TASKID_AVF0], 1 );
582 if (status[0] != RTEMS_SUCCESSFUL)
582 if (status[0] != RTEMS_SUCCESSFUL)
583 {
583 {
584 PRINTF1("in restart_science_task *** 0 ERR %d\n", status[0])
584 PRINTF1("in restart_science_task *** 0 ERR %d\n", status[0])
585 }
585 }
586
586
587 status[2] = rtems_task_restart( Task_id[TASKID_WFRM],1 );
587 status[2] = rtems_task_restart( Task_id[TASKID_WFRM],1 );
588 if (status[2] != RTEMS_SUCCESSFUL)
588 if (status[2] != RTEMS_SUCCESSFUL)
589 {
589 {
590 PRINTF1("in restart_science_task *** 2 ERR %d\n", status[2])
590 PRINTF1("in restart_science_task *** 2 ERR %d\n", status[2])
591 }
591 }
592
592
593 status[3] = rtems_task_restart( Task_id[TASKID_CWF3],1 );
593 status[3] = rtems_task_restart( Task_id[TASKID_CWF3],1 );
594 if (status[3] != RTEMS_SUCCESSFUL)
594 if (status[3] != RTEMS_SUCCESSFUL)
595 {
595 {
596 PRINTF1("in restart_science_task *** 3 ERR %d\n", status[3])
596 PRINTF1("in restart_science_task *** 3 ERR %d\n", status[3])
597 }
597 }
598
598
599 status[4] = rtems_task_restart( Task_id[TASKID_CWF2],1 );
599 status[4] = rtems_task_restart( Task_id[TASKID_CWF2],1 );
600 if (status[4] != RTEMS_SUCCESSFUL)
600 if (status[4] != RTEMS_SUCCESSFUL)
601 {
601 {
602 PRINTF1("in restart_science_task *** 4 ERR %d\n", status[4])
602 PRINTF1("in restart_science_task *** 4 ERR %d\n", status[4])
603 }
603 }
604
604
605 status[5] = rtems_task_restart( Task_id[TASKID_CWF1],1 );
605 status[5] = rtems_task_restart( Task_id[TASKID_CWF1],1 );
606 if (status[5] != RTEMS_SUCCESSFUL)
606 if (status[5] != RTEMS_SUCCESSFUL)
607 {
607 {
608 PRINTF1("in restart_science_task *** 5 ERR %d\n", status[5])
608 PRINTF1("in restart_science_task *** 5 ERR %d\n", status[5])
609 }
609 }
610
610
611 if ( (status[0] != RTEMS_SUCCESSFUL) || (status[2] != RTEMS_SUCCESSFUL) ||
611 if ( (status[0] != RTEMS_SUCCESSFUL) || (status[2] != RTEMS_SUCCESSFUL) ||
612 (status[3] != RTEMS_SUCCESSFUL) || (status[4] != RTEMS_SUCCESSFUL) || (status[5] != RTEMS_SUCCESSFUL) )
612 (status[3] != RTEMS_SUCCESSFUL) || (status[4] != RTEMS_SUCCESSFUL) || (status[5] != RTEMS_SUCCESSFUL) )
613 {
613 {
614 ret = RTEMS_UNSATISFIED;
614 ret = RTEMS_UNSATISFIED;
615 }
615 }
616
616
617 return ret;
617 return ret;
618 }
618 }
619
619
620 int suspend_science_tasks()
620 int suspend_science_tasks()
621 {
621 {
622 /** This function suspends the science tasks.
622 /** This function suspends the science tasks.
623 *
623 *
624 * @return RTEMS directive status codes:
624 * @return RTEMS directive status codes:
625 * - RTEMS_SUCCESSFUL - task restarted successfully
625 * - RTEMS_SUCCESSFUL - task restarted successfully
626 * - RTEMS_INVALID_ID - task id invalid
626 * - RTEMS_INVALID_ID - task id invalid
627 * - RTEMS_ALREADY_SUSPENDED - task already suspended
627 * - RTEMS_ALREADY_SUSPENDED - task already suspended
628 *
628 *
629 */
629 */
630
630
631 rtems_status_code status;
631 rtems_status_code status;
632
632
633 status = rtems_task_suspend( Task_id[TASKID_AVF0] );
633 status = rtems_task_suspend( Task_id[TASKID_AVF0] );
634 if (status != RTEMS_SUCCESSFUL)
634 if (status != RTEMS_SUCCESSFUL)
635 {
635 {
636 PRINTF1("in suspend_science_task *** AVF0 ERR %d\n", status)
636 PRINTF1("in suspend_science_task *** AVF0 ERR %d\n", status)
637 }
637 }
638
638
639 if (status == RTEMS_SUCCESSFUL) // suspend WFRM
639 if (status == RTEMS_SUCCESSFUL) // suspend WFRM
640 {
640 {
641 status = rtems_task_suspend( Task_id[TASKID_WFRM] );
641 status = rtems_task_suspend( Task_id[TASKID_WFRM] );
642 if (status != RTEMS_SUCCESSFUL)
642 if (status != RTEMS_SUCCESSFUL)
643 {
643 {
644 PRINTF1("in suspend_science_task *** WFRM ERR %d\n", status)
644 PRINTF1("in suspend_science_task *** WFRM ERR %d\n", status)
645 }
645 }
646 }
646 }
647
647
648 if (status == RTEMS_SUCCESSFUL) // suspend CWF3
648 if (status == RTEMS_SUCCESSFUL) // suspend CWF3
649 {
649 {
650 status = rtems_task_suspend( Task_id[TASKID_CWF3] );
650 status = rtems_task_suspend( Task_id[TASKID_CWF3] );
651 if (status != RTEMS_SUCCESSFUL)
651 if (status != RTEMS_SUCCESSFUL)
652 {
652 {
653 PRINTF1("in suspend_science_task *** CWF3 ERR %d\n", status)
653 PRINTF1("in suspend_science_task *** CWF3 ERR %d\n", status)
654 }
654 }
655 }
655 }
656
656
657 if (status == RTEMS_SUCCESSFUL) // suspend CWF2
657 if (status == RTEMS_SUCCESSFUL) // suspend CWF2
658 {
658 {
659 status = rtems_task_suspend( Task_id[TASKID_CWF2] );
659 status = rtems_task_suspend( Task_id[TASKID_CWF2] );
660 if (status != RTEMS_SUCCESSFUL)
660 if (status != RTEMS_SUCCESSFUL)
661 {
661 {
662 PRINTF1("in suspend_science_task *** CWF2 ERR %d\n", status)
662 PRINTF1("in suspend_science_task *** CWF2 ERR %d\n", status)
663 }
663 }
664 }
664 }
665
665
666 if (status == RTEMS_SUCCESSFUL) // suspend CWF1
666 if (status == RTEMS_SUCCESSFUL) // suspend CWF1
667 {
667 {
668 status = rtems_task_suspend( Task_id[TASKID_CWF1] );
668 status = rtems_task_suspend( Task_id[TASKID_CWF1] );
669 if (status != RTEMS_SUCCESSFUL)
669 if (status != RTEMS_SUCCESSFUL)
670 {
670 {
671 PRINTF1("in suspend_science_task *** CWF1 ERR %d\n", status)
671 PRINTF1("in suspend_science_task *** CWF1 ERR %d\n", status)
672 }
672 }
673 }
673 }
674
674
675 return status;
675 return status;
676 }
676 }
677
677
678 void launch_waveform_picker( unsigned char mode, unsigned int transitionCoarseTime )
678 void launch_waveform_picker( unsigned char mode, unsigned int transitionCoarseTime )
679 {
679 {
680 reset_current_ring_nodes();
680 reset_current_ring_nodes();
681 reset_waveform_picker_regs();
681 reset_waveform_picker_regs();
682 set_wfp_burst_enable_register( mode );
682 set_wfp_burst_enable_register( mode );
683
683
684 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER );
684 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER );
685 LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER );
685 LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER );
686
686
687 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x80; // [1000 0000]
687 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x80; // [1000 0000]
688 if (transitionCoarseTime == 0)
688 if (transitionCoarseTime == 0)
689 {
689 {
690 waveform_picker_regs->start_date = time_management_regs->coarse_time;
690 waveform_picker_regs->start_date = time_management_regs->coarse_time;
691 }
691 }
692 else
692 else
693 {
693 {
694 waveform_picker_regs->start_date = transitionCoarseTime;
694 waveform_picker_regs->start_date = transitionCoarseTime;
695 }
695 }
696 }
696 }
697
697
698 void launch_spectral_matrix( unsigned char mode )
698 void launch_spectral_matrix( unsigned char mode )
699 {
699 {
700 reset_nb_sm_f0();
700 reset_nb_sm_f0();
701 reset_current_sm_ring_nodes();
701 reset_current_sm_ring_nodes();
702 reset_spectral_matrix_regs();
702 reset_spectral_matrix_regs();
703
703
704 struct grgpio_regs_str *grgpio_regs = (struct grgpio_regs_str *) REGS_ADDR_GRGPIO;
704 struct grgpio_regs_str *grgpio_regs = (struct grgpio_regs_str *) REGS_ADDR_GRGPIO;
705 grgpio_regs->io_port_direction_register =
705 grgpio_regs->io_port_direction_register =
706 grgpio_regs->io_port_direction_register | 0x01; // [0001 1000], 0 = output disabled, 1 = output enabled
706 grgpio_regs->io_port_direction_register | 0x01; // [0001 1000], 0 = output disabled, 1 = output enabled
707 grgpio_regs->io_port_output_register = grgpio_regs->io_port_output_register | 0x00; // set the bit 0 to 1
707 grgpio_regs->io_port_output_register = grgpio_regs->io_port_output_register | 0x00; // set the bit 0 to 1
708 set_irq_on_new_ready_matrix( 1 );
708 set_irq_on_new_ready_matrix( 1 );
709 LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX );
709 LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX );
710 LEON_Unmask_interrupt( IRQ_SPECTRAL_MATRIX );
710 LEON_Unmask_interrupt( IRQ_SPECTRAL_MATRIX );
711 set_run_matrix_spectral( 1 );
711 set_run_matrix_spectral( 1 );
712
712
713 }
713 }
714
714
715 void set_irq_on_new_ready_matrix( unsigned char value )
715 void set_irq_on_new_ready_matrix( unsigned char value )
716 {
716 {
717 if (value == 1)
717 if (value == 1)
718 {
718 {
719 spectral_matrix_regs->config = spectral_matrix_regs->config | 0x01;
719 spectral_matrix_regs->config = spectral_matrix_regs->config | 0x01;
720 }
720 }
721 else
721 else
722 {
722 {
723 spectral_matrix_regs->config = spectral_matrix_regs->config & 0xfffffffe; // 1110
723 spectral_matrix_regs->config = spectral_matrix_regs->config & 0xfffffffe; // 1110
724 }
724 }
725 }
725 }
726
726
727 void set_run_matrix_spectral( unsigned char value )
727 void set_run_matrix_spectral( unsigned char value )
728 {
728 {
729 if (value == 1)
729 if (value == 1)
730 {
730 {
731 spectral_matrix_regs->config = spectral_matrix_regs->config | 0x4; // [0100] set run_matrix spectral to 1
731 spectral_matrix_regs->config = spectral_matrix_regs->config | 0x4; // [0100] set run_matrix spectral to 1
732 }
732 }
733 else
733 else
734 {
734 {
735 spectral_matrix_regs->config = spectral_matrix_regs->config & 0xfffffffb; // [1011] set run_matrix spectral to 0
735 spectral_matrix_regs->config = spectral_matrix_regs->config & 0xfffffffb; // [1011] set run_matrix spectral to 0
736 }
736 }
737 }
737 }
738
738
739 void launch_spectral_matrix_simu( unsigned char mode )
739 void launch_spectral_matrix_simu( unsigned char mode )
740 {
740 {
741 reset_nb_sm_f0();
741 reset_nb_sm_f0();
742 reset_current_sm_ring_nodes();
742 reset_current_sm_ring_nodes();
743 reset_spectral_matrix_regs();
743 reset_spectral_matrix_regs();
744
744
745 // Spectral Matrices simulator
745 // Spectral Matrices simulator
746 timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR );
746 timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR );
747 LEON_Clear_interrupt( IRQ_SM_SIMULATOR );
747 LEON_Clear_interrupt( IRQ_SM_SIMULATOR );
748 LEON_Unmask_interrupt( IRQ_SM_SIMULATOR );
748 LEON_Unmask_interrupt( IRQ_SM_SIMULATOR );
749 set_local_nb_interrupt_f0_MAX();
749 set_local_nb_interrupt_f0_MAX();
750 }
750 }
751
751
752 //****************
752 //****************
753 // CLOSING ACTIONS
753 // CLOSING ACTIONS
754 void update_last_TC_exe( ccsdsTelecommandPacket_t *TC, unsigned char * time )
754 void update_last_TC_exe( ccsdsTelecommandPacket_t *TC, unsigned char * time )
755 {
755 {
756 /** This function is used to update the HK packets statistics after a successful TC execution.
756 /** This function is used to update the HK packets statistics after a successful TC execution.
757 *
757 *
758 * @param TC points to the TC being processed
758 * @param TC points to the TC being processed
759 * @param time is the time used to date the TC execution
759 * @param time is the time used to date the TC execution
760 *
760 *
761 */
761 */
762
762
763 unsigned int val;
763 unsigned int val;
764
764
765 housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0];
765 housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0];
766 housekeeping_packet.hk_lfr_last_exe_tc_id[1] = TC->packetID[1];
766 housekeeping_packet.hk_lfr_last_exe_tc_id[1] = TC->packetID[1];
767 housekeeping_packet.hk_lfr_last_exe_tc_type[0] = 0x00;
767 housekeeping_packet.hk_lfr_last_exe_tc_type[0] = 0x00;
768 housekeeping_packet.hk_lfr_last_exe_tc_type[1] = TC->serviceType;
768 housekeeping_packet.hk_lfr_last_exe_tc_type[1] = TC->serviceType;
769 housekeeping_packet.hk_lfr_last_exe_tc_subtype[0] = 0x00;
769 housekeeping_packet.hk_lfr_last_exe_tc_subtype[0] = 0x00;
770 housekeeping_packet.hk_lfr_last_exe_tc_subtype[1] = TC->serviceSubType;
770 housekeeping_packet.hk_lfr_last_exe_tc_subtype[1] = TC->serviceSubType;
771 housekeeping_packet.hk_lfr_last_exe_tc_time[0] = time[0];
771 housekeeping_packet.hk_lfr_last_exe_tc_time[0] = time[0];
772 housekeeping_packet.hk_lfr_last_exe_tc_time[1] = time[1];
772 housekeeping_packet.hk_lfr_last_exe_tc_time[1] = time[1];
773 housekeeping_packet.hk_lfr_last_exe_tc_time[2] = time[2];
773 housekeeping_packet.hk_lfr_last_exe_tc_time[2] = time[2];
774 housekeeping_packet.hk_lfr_last_exe_tc_time[3] = time[3];
774 housekeeping_packet.hk_lfr_last_exe_tc_time[3] = time[3];
775 housekeeping_packet.hk_lfr_last_exe_tc_time[4] = time[4];
775 housekeeping_packet.hk_lfr_last_exe_tc_time[4] = time[4];
776 housekeeping_packet.hk_lfr_last_exe_tc_time[5] = time[5];
776 housekeeping_packet.hk_lfr_last_exe_tc_time[5] = time[5];
777
777
778 val = housekeeping_packet.hk_lfr_exe_tc_cnt[0] * 256 + housekeeping_packet.hk_lfr_exe_tc_cnt[1];
778 val = housekeeping_packet.hk_lfr_exe_tc_cnt[0] * 256 + housekeeping_packet.hk_lfr_exe_tc_cnt[1];
779 val++;
779 val++;
780 housekeeping_packet.hk_lfr_exe_tc_cnt[0] = (unsigned char) (val >> 8);
780 housekeeping_packet.hk_lfr_exe_tc_cnt[0] = (unsigned char) (val >> 8);
781 housekeeping_packet.hk_lfr_exe_tc_cnt[1] = (unsigned char) (val);
781 housekeeping_packet.hk_lfr_exe_tc_cnt[1] = (unsigned char) (val);
782 }
782 }
783
783
784 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char * time )
784 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char * time )
785 {
785 {
786 /** This function is used to update the HK packets statistics after a TC rejection.
786 /** This function is used to update the HK packets statistics after a TC rejection.
787 *
787 *
788 * @param TC points to the TC being processed
788 * @param TC points to the TC being processed
789 * @param time is the time used to date the TC rejection
789 * @param time is the time used to date the TC rejection
790 *
790 *
791 */
791 */
792
792
793 unsigned int val;
793 unsigned int val;
794
794
795 housekeeping_packet.hk_lfr_last_rej_tc_id[0] = TC->packetID[0];
795 housekeeping_packet.hk_lfr_last_rej_tc_id[0] = TC->packetID[0];
796 housekeeping_packet.hk_lfr_last_rej_tc_id[1] = TC->packetID[1];
796 housekeeping_packet.hk_lfr_last_rej_tc_id[1] = TC->packetID[1];
797 housekeeping_packet.hk_lfr_last_rej_tc_type[0] = 0x00;
797 housekeeping_packet.hk_lfr_last_rej_tc_type[0] = 0x00;
798 housekeeping_packet.hk_lfr_last_rej_tc_type[1] = TC->serviceType;
798 housekeeping_packet.hk_lfr_last_rej_tc_type[1] = TC->serviceType;
799 housekeeping_packet.hk_lfr_last_rej_tc_subtype[0] = 0x00;
799 housekeeping_packet.hk_lfr_last_rej_tc_subtype[0] = 0x00;
800 housekeeping_packet.hk_lfr_last_rej_tc_subtype[1] = TC->serviceSubType;
800 housekeeping_packet.hk_lfr_last_rej_tc_subtype[1] = TC->serviceSubType;
801 housekeeping_packet.hk_lfr_last_rej_tc_time[0] = time[0];
801 housekeeping_packet.hk_lfr_last_rej_tc_time[0] = time[0];
802 housekeeping_packet.hk_lfr_last_rej_tc_time[1] = time[1];
802 housekeeping_packet.hk_lfr_last_rej_tc_time[1] = time[1];
803 housekeeping_packet.hk_lfr_last_rej_tc_time[2] = time[2];
803 housekeeping_packet.hk_lfr_last_rej_tc_time[2] = time[2];
804 housekeeping_packet.hk_lfr_last_rej_tc_time[3] = time[3];
804 housekeeping_packet.hk_lfr_last_rej_tc_time[3] = time[3];
805 housekeeping_packet.hk_lfr_last_rej_tc_time[4] = time[4];
805 housekeeping_packet.hk_lfr_last_rej_tc_time[4] = time[4];
806 housekeeping_packet.hk_lfr_last_rej_tc_time[5] = time[5];
806 housekeeping_packet.hk_lfr_last_rej_tc_time[5] = time[5];
807
807
808 val = housekeeping_packet.hk_lfr_rej_tc_cnt[0] * 256 + housekeeping_packet.hk_lfr_rej_tc_cnt[1];
808 val = housekeeping_packet.hk_lfr_rej_tc_cnt[0] * 256 + housekeeping_packet.hk_lfr_rej_tc_cnt[1];
809 val++;
809 val++;
810 housekeeping_packet.hk_lfr_rej_tc_cnt[0] = (unsigned char) (val >> 8);
810 housekeeping_packet.hk_lfr_rej_tc_cnt[0] = (unsigned char) (val >> 8);
811 housekeeping_packet.hk_lfr_rej_tc_cnt[1] = (unsigned char) (val);
811 housekeeping_packet.hk_lfr_rej_tc_cnt[1] = (unsigned char) (val);
812 }
812 }
813
813
814 void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id )
814 void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id )
815 {
815 {
816 /** This function is the last step of the TC execution workflow.
816 /** This function is the last step of the TC execution workflow.
817 *
817 *
818 * @param TC points to the TC being processed
818 * @param TC points to the TC being processed
819 * @param result is the result of the TC execution (LFR_SUCCESSFUL / LFR_DEFAULT)
819 * @param result is the result of the TC execution (LFR_SUCCESSFUL / LFR_DEFAULT)
820 * @param queue_id is the id of the RTEMS message queue used to send TM packets
820 * @param queue_id is the id of the RTEMS message queue used to send TM packets
821 * @param time is the time used to date the TC execution
821 * @param time is the time used to date the TC execution
822 *
822 *
823 */
823 */
824
824
825 unsigned char requestedMode;
825 unsigned char requestedMode;
826
826
827 if (result == LFR_SUCCESSFUL)
827 if (result == LFR_SUCCESSFUL)
828 {
828 {
829 if ( !( (TC->serviceType==TC_TYPE_TIME) & (TC->serviceSubType==TC_SUBTYPE_UPDT_TIME) )
829 if ( !( (TC->serviceType==TC_TYPE_TIME) & (TC->serviceSubType==TC_SUBTYPE_UPDT_TIME) )
830 &
830 &
831 !( (TC->serviceType==TC_TYPE_GEN) & (TC->serviceSubType==TC_SUBTYPE_UPDT_INFO))
831 !( (TC->serviceType==TC_TYPE_GEN) & (TC->serviceSubType==TC_SUBTYPE_UPDT_INFO))
832 )
832 )
833 {
833 {
834 send_tm_lfr_tc_exe_success( TC, queue_id );
834 send_tm_lfr_tc_exe_success( TC, queue_id );
835 }
835 }
836 if ( (TC->serviceType == TC_TYPE_GEN) & (TC->serviceSubType == TC_SUBTYPE_ENTER) )
836 if ( (TC->serviceType == TC_TYPE_GEN) & (TC->serviceSubType == TC_SUBTYPE_ENTER) )
837 {
837 {
838 //**********************************
838 //**********************************
839 // UPDATE THE LFRMODE LOCAL VARIABLE
839 // UPDATE THE LFRMODE LOCAL VARIABLE
840 requestedMode = TC->dataAndCRC[1];
840 requestedMode = TC->dataAndCRC[1];
841 housekeeping_packet.lfr_status_word[0] = (unsigned char) ((requestedMode << 4) + 0x0d);
841 housekeeping_packet.lfr_status_word[0] = (unsigned char) ((requestedMode << 4) + 0x0d);
842 updateLFRCurrentMode();
842 updateLFRCurrentMode();
843 }
843 }
844 }
844 }
845 else
845 else if (result == LFR_EXE_ERROR)
846 {
846 {
847 send_tm_lfr_tc_exe_error( TC, queue_id );
847 send_tm_lfr_tc_exe_error( TC, queue_id );
848 }
848 }
849 }
849 }
850
850
851 //***************************
851 //***************************
852 // Interrupt Service Routines
852 // Interrupt Service Routines
853 rtems_isr commutation_isr1( rtems_vector_number vector )
853 rtems_isr commutation_isr1( rtems_vector_number vector )
854 {
854 {
855 if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
855 if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
856 printf("In commutation_isr1 *** Error sending event to DUMB\n");
856 printf("In commutation_isr1 *** Error sending event to DUMB\n");
857 }
857 }
858 }
858 }
859
859
860 rtems_isr commutation_isr2( rtems_vector_number vector )
860 rtems_isr commutation_isr2( rtems_vector_number vector )
861 {
861 {
862 if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
862 if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
863 printf("In commutation_isr2 *** Error sending event to DUMB\n");
863 printf("In commutation_isr2 *** Error sending event to DUMB\n");
864 }
864 }
865 }
865 }
866
866
867 //****************
867 //****************
868 // OTHER FUNCTIONS
868 // OTHER FUNCTIONS
869 void updateLFRCurrentMode()
869 void updateLFRCurrentMode()
870 {
870 {
871 /** This function updates the value of the global variable lfrCurrentMode.
871 /** This function updates the value of the global variable lfrCurrentMode.
872 *
872 *
873 * lfrCurrentMode is a parameter used by several functions to know in which mode LFR is running.
873 * lfrCurrentMode is a parameter used by several functions to know in which mode LFR is running.
874 *
874 *
875 */
875 */
876 // update the local value of lfrCurrentMode with the value contained in the housekeeping_packet structure
876 // update the local value of lfrCurrentMode with the value contained in the housekeeping_packet structure
877 lfrCurrentMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
877 lfrCurrentMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
878 }
878 }
879
879
General Comments 0
You need to be logged in to leave comments. Login now