##// END OF EJS Templates
rev 1.0.0.5
paul -
r114:46134e185f55 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: Tue Apr 1 12:03:12 2014
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Apr 3 10:09:31 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 -DPRINT_TASK_STATISTICS
13 DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=5 -DPRINT_MESSAGES_ON_CONSOLE
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 cpu_usage_report
4 CONFIG += console verbose
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=5 # 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-01T07:09:49. -->
3 <!-- Written by QtCreator 3.0.1, 2014-04-03T08:17:16. -->
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,59 +1,59
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_BP1_F0 99 // 11 * 9 = 99
8 #define TOTAL_SIZE_BP1_F1 117 // 13 * 9 = 117
8 #define TOTAL_SIZE_BP1_F1 117 // 13 * 9 = 117
9 #define TOTAL_SIZE_BP1_F2 108 // 12 * 9 = 108
9 #define TOTAL_SIZE_BP1_F2 108 // 12 * 9 = 108
10 //
10 //
11 #define NB_RING_NODES_ASM_F0 12 // AT LEAST 3
11 #define NB_RING_NODES_ASM_F0 12 // AT LEAST 3
12 #define NB_RING_NODES_ASM_F1 2 // AT LEAST 3
12 #define NB_RING_NODES_ASM_F1 2 // AT LEAST 3
13 #define NB_RING_NODES_ASM_F2 2 // AT LEAST 3
13 #define NB_RING_NODES_ASM_F2 2 // AT LEAST 3
14 //
14 //
15 #define NB_BINS_PER_ASM_F0 88
15 #define NB_BINS_PER_ASM_F0 88
16 #define NB_BINS_PER_PKT_ASM_F0 44
16 #define NB_BINS_PER_PKT_ASM_F0 44
17 #define TOTAL_SIZE_ASM_F0_IN_BYTES 4400 // 25 * 88 * 2
17 #define TOTAL_SIZE_ASM_F0_IN_BYTES 4400 // 25 * 88 * 2
18 #define ASM_F0_INDICE_START 17 // 88 bins
18 #define ASM_F0_INDICE_START 17 // 88 bins
19 #define ASM_F0_INDICE_STOP 104 // 2 packets of 44 bins
19 #define ASM_F0_INDICE_STOP 104 // 2 packets of 44 bins
20 //
20 //
21 #define NB_BINS_PER_ASM_F1 104
21 #define NB_BINS_PER_ASM_F1 104
22 #define NB_BINS_PER_PKT_ASM_F1 52
22 #define NB_BINS_PER_PKT_ASM_F1 52
23 #define TOTAL_SIZE_ASM_F1 2600 // 25 * 104
23 #define TOTAL_SIZE_ASM_F1 2600 // 25 * 104
24 #define ASM_F1_INDICE_START 6 // 104 bins
24 #define ASM_F1_INDICE_START 6 // 104 bins
25 #define ASM_F1_INDICE_STOP 109 // 2 packets of 52 bins
25 #define ASM_F1_INDICE_STOP 109 // 2 packets of 52 bins
26 //
26 //
27 #define NB_BINS_PER_ASM_F2 96
27 #define NB_BINS_PER_ASM_F2 96
28 #define NB_BINS_PER_PKT_ASM_F2 48
28 #define NB_BINS_PER_PKT_ASM_F2 48
29 #define TOTAL_SIZE_ASM_F2 2400 // 25 * 96
29 #define TOTAL_SIZE_ASM_F2 2400 // 25 * 96
30 #define ASM_F2_INDICE_START 7 // 96 bins
30 #define ASM_F2_INDICE_START 7 // 96 bins
31 #define ASM_F2_INDICE_STOP 102 // 2 packets of 48 bins
31 #define ASM_F2_INDICE_STOP 102 // 2 packets of 48 bins
32 //
32 //
33 #define NB_BINS_COMPRESSED_SM_F0 11
33 #define NB_BINS_COMPRESSED_SM_F0 11
34 #define NB_BINS_COMPRESSED_SM_F1 13
34 #define NB_BINS_COMPRESSED_SM_F1 13
35 #define NB_BINS_COMPRESSED_SM_F2 12
35 #define NB_BINS_COMPRESSED_SM_F2 12
36 //
36 //
37 #define NB_BINS_TO_AVERAGE_ASM_F0 8
37 #define NB_BINS_TO_AVERAGE_ASM_F0 8
38 #define NB_BINS_TO_AVERAGE_ASM_F1 8
38 #define NB_BINS_TO_AVERAGE_ASM_F1 8
39 #define NB_BINS_TO_AVERAGE_ASM_F2 8
39 #define NB_BINS_TO_AVERAGE_ASM_F2 8
40 //
40 //
41 #define TOTAL_SIZE_COMPRESSED_ASM_F0 275 // 11 * 25 WORDS
41 #define TOTAL_SIZE_COMPRESSED_ASM_F0 275 // 11 * 25 WORDS
42 #define TOTAL_SIZE_COMPRESSED_ASM_F1 325 // 13 * 25 WORDS
42 #define TOTAL_SIZE_COMPRESSED_ASM_F1 325 // 13 * 25 WORDS
43 #define TOTAL_SIZE_COMPRESSED_ASM_F2 300 // 12 * 25 WORDS
43 #define TOTAL_SIZE_COMPRESSED_ASM_F2 300 // 12 * 25 WORDS
44 #define TOTAL_SIZE_COMPRESSED_ASM_SBM1 550 // 22 * 25 WORDS
44 #define TOTAL_SIZE_COMPRESSED_ASM_SBM1 550 // 22 * 25 WORDS
45 #define NB_AVERAGE_NORMAL_f0 384 // 96 * 4
45 #define NB_AVERAGE_NORMAL_F0 384 // 96 * 4
46 #define NB_AVERAGE_SBM1_f0 24 // 24 matrices at f0 = 0.25 second
46 #define NB_AVERAGE_SBM1_F0 24 // 24 matrices at f0 = 0.25 second
47 #define NB_SM_TO_RECEIVE_BEFORE_AVF0 8
47 #define NB_SM_TO_RECEIVE_BEFORE_AVF0 8
48
48
49 typedef struct {
49 typedef struct {
50 volatile unsigned char PE[2];
50 volatile unsigned char PE[2];
51 volatile unsigned char PB[2];
51 volatile unsigned char PB[2];
52 volatile unsigned char V0;
52 volatile unsigned char V0;
53 volatile unsigned char V1;
53 volatile unsigned char V1;
54 volatile unsigned char V2_ELLIP_DOP;
54 volatile unsigned char V2_ELLIP_DOP;
55 volatile unsigned char SZ;
55 volatile unsigned char SZ;
56 volatile unsigned char VPHI;
56 volatile unsigned char VPHI;
57 } BP1_t;
57 } BP1_t;
58
58
59 #endif // FSW_PARAMS_PROCESSING_H
59 #endif // FSW_PARAMS_PROCESSING_H
@@ -1,885 +1,887
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 BP1_t data_BP1[ NB_BINS_COMPRESSED_SM_F0 ];
25
25
26 //*****
26 //*****
27 // NORM
27 // NORM
28 // F0
28 // F0
29 float averaged_sm_f0 [ TIME_OFFSET + TOTAL_SIZE_SM ];
29 float averaged_sm_f0 [ TIME_OFFSET + TOTAL_SIZE_SM ];
30 float averaged_sm_f0_reorganized[ TIME_OFFSET + TOTAL_SIZE_SM ];
30 float averaged_sm_f0_reorganized[ TIME_OFFSET + TOTAL_SIZE_SM ];
31 char averaged_sm_f0_char [ TIME_OFFSET_IN_BYTES + (TOTAL_SIZE_SM * 2) ];
31 char averaged_sm_f0_char [ TIME_OFFSET_IN_BYTES + (TOTAL_SIZE_SM * 2) ];
32 float compressed_sm_f0 [ TOTAL_SIZE_COMPRESSED_ASM_F0 ];
32 float compressed_sm_f0 [ TOTAL_SIZE_COMPRESSED_ASM_F0 ];
33
33
34 //*****
34 //*****
35 // SBM1
35 // SBM1
36 float averaged_sm_sbm1 [ TIME_OFFSET + TOTAL_SIZE_SM ];
36 float averaged_sm_sbm1 [ TIME_OFFSET + TOTAL_SIZE_SM ];
37 float compressed_sm_sbm1 [ TOTAL_SIZE_COMPRESSED_ASM_SBM1 ];
37 float compressed_sm_sbm1 [ TOTAL_SIZE_COMPRESSED_ASM_SBM1 ];
38
38
39 unsigned char LFR_BP1_F0[ TIME_OFFSET_IN_BYTES + TOTAL_SIZE_BP1_F0 * 2 ];
39 unsigned char LFR_BP1_F0[ TIME_OFFSET_IN_BYTES + TOTAL_SIZE_BP1_F0 * 2 ];
40 unsigned char LFR_BP1_F1[ TIME_OFFSET_IN_BYTES + TOTAL_SIZE_BP1_F1 ];
40 unsigned char LFR_BP1_F1[ TIME_OFFSET_IN_BYTES + TOTAL_SIZE_BP1_F1 ];
41 unsigned char LFR_BP1_F2[ TIME_OFFSET_IN_BYTES + TOTAL_SIZE_BP1_F2 ];
41 unsigned char LFR_BP1_F2[ TIME_OFFSET_IN_BYTES + TOTAL_SIZE_BP1_F2 ];
42
42
43 unsigned int nb_sm_f0;
43 unsigned int nb_sm_f0;
44
44
45 void init_sm_rings( void )
45 void init_sm_rings( void )
46 {
46 {
47 unsigned char i;
47 unsigned char i;
48
48
49 // F0 RING
49 // F0 RING
50 sm_ring_f0[0].next = (ring_node_sm*) &sm_ring_f0[1];
50 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];
51 sm_ring_f0[0].previous = (ring_node_sm*) &sm_ring_f0[NB_RING_NODES_ASM_F0-1];
52 sm_ring_f0[0].buffer_address =
52 sm_ring_f0[0].buffer_address =
53 (int) &sm_f0[ 0 ];
53 (int) &sm_f0[ 0 ];
54
54
55 sm_ring_f0[NB_RING_NODES_ASM_F0-1].next = (ring_node_sm*) &sm_ring_f0[0];
55 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];
56 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 =
57 sm_ring_f0[NB_RING_NODES_ASM_F0-1].buffer_address =
58 (int) &sm_f0[ (NB_RING_NODES_ASM_F0-1) * TOTAL_SIZE_SM ];
58 (int) &sm_f0[ (NB_RING_NODES_ASM_F0-1) * TOTAL_SIZE_SM ];
59
59
60 for(i=1; i<NB_RING_NODES_ASM_F0-1; i++)
60 for(i=1; i<NB_RING_NODES_ASM_F0-1; i++)
61 {
61 {
62 sm_ring_f0[i].next = (ring_node_sm*) &sm_ring_f0[i+1];
62 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];
63 sm_ring_f0[i].previous = (ring_node_sm*) &sm_ring_f0[i-1];
64 sm_ring_f0[i].buffer_address =
64 sm_ring_f0[i].buffer_address =
65 (int) &sm_f0[ i * TOTAL_SIZE_SM ];
65 (int) &sm_f0[ i * TOTAL_SIZE_SM ];
66 }
66 }
67
67
68 // F1 RING
68 // F1 RING
69 sm_ring_f1[0].next = (ring_node_sm*) &sm_ring_f1[1];
69 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];
70 sm_ring_f1[0].previous = (ring_node_sm*) &sm_ring_f1[NB_RING_NODES_ASM_F1-1];
71 sm_ring_f1[0].buffer_address =
71 sm_ring_f1[0].buffer_address =
72 (int) &sm_f1[ 0 ];
72 (int) &sm_f1[ 0 ];
73
73
74 sm_ring_f1[NB_RING_NODES_ASM_F1-1].next = (ring_node_sm*) &sm_ring_f1[0];
74 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];
75 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 =
76 sm_ring_f1[NB_RING_NODES_ASM_F1-1].buffer_address =
77 (int) &sm_f1[ (NB_RING_NODES_ASM_F1-1) * TOTAL_SIZE_SM ];
77 (int) &sm_f1[ (NB_RING_NODES_ASM_F1-1) * TOTAL_SIZE_SM ];
78
78
79 for(i=1; i<NB_RING_NODES_ASM_F1-1; i++)
79 for(i=1; i<NB_RING_NODES_ASM_F1-1; i++)
80 {
80 {
81 sm_ring_f1[i].next = (ring_node_sm*) &sm_ring_f1[i+1];
81 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];
82 sm_ring_f1[i].previous = (ring_node_sm*) &sm_ring_f1[i-1];
83 sm_ring_f1[i].buffer_address =
83 sm_ring_f1[i].buffer_address =
84 (int) &sm_f1[ i * TOTAL_SIZE_SM ];
84 (int) &sm_f1[ i * TOTAL_SIZE_SM ];
85 }
85 }
86
86
87 // F2 RING
87 // F2 RING
88 sm_ring_f2[0].next = (ring_node_sm*) &sm_ring_f2[1];
88 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];
89 sm_ring_f2[0].previous = (ring_node_sm*) &sm_ring_f2[NB_RING_NODES_ASM_F2-1];
90 sm_ring_f2[0].buffer_address =
90 sm_ring_f2[0].buffer_address =
91 (int) &sm_f2[ 0 ];
91 (int) &sm_f2[ 0 ];
92
92
93 sm_ring_f2[NB_RING_NODES_ASM_F2-1].next = (ring_node_sm*) &sm_ring_f2[0];
93 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];
94 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 =
95 sm_ring_f2[NB_RING_NODES_ASM_F2-1].buffer_address =
96 (int) &sm_f2[ (NB_RING_NODES_ASM_F2-1) * TOTAL_SIZE_SM ];
96 (int) &sm_f2[ (NB_RING_NODES_ASM_F2-1) * TOTAL_SIZE_SM ];
97
97
98 for(i=1; i<NB_RING_NODES_ASM_F2-1; i++)
98 for(i=1; i<NB_RING_NODES_ASM_F2-1; i++)
99 {
99 {
100 sm_ring_f2[i].next = (ring_node_sm*) &sm_ring_f2[i+1];
100 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];
101 sm_ring_f2[i].previous = (ring_node_sm*) &sm_ring_f2[i-1];
102 sm_ring_f2[i].buffer_address =
102 sm_ring_f2[i].buffer_address =
103 (int) &sm_f2[ i * TOTAL_SIZE_SM ];
103 (int) &sm_f2[ i * TOTAL_SIZE_SM ];
104 }
104 }
105
105
106 DEBUG_PRINTF1("asm_ring_f0 @%x\n", (unsigned int) sm_ring_f0)
106 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)
107 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)
108 DEBUG_PRINTF1("asm_ring_f2 @%x\n", (unsigned int) sm_ring_f2)
109
109
110 spectral_matrix_regs->matrixF0_Address0 = sm_ring_f0[0].buffer_address;
110 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)
111 DEBUG_PRINTF1("spectral_matrix_regs->matrixF0_Address0 @%x\n", spectral_matrix_regs->matrixF0_Address0)
112 }
112 }
113
113
114 void reset_current_sm_ring_nodes( void )
114 void reset_current_sm_ring_nodes( void )
115 {
115 {
116 current_ring_node_sm_f0 = sm_ring_f0;
116 current_ring_node_sm_f0 = sm_ring_f0;
117 current_ring_node_sm_f1 = sm_ring_f1;
117 current_ring_node_sm_f1 = sm_ring_f1;
118 current_ring_node_sm_f2 = sm_ring_f2;
118 current_ring_node_sm_f2 = sm_ring_f2;
119
119
120 ring_node_for_averaging_sm_f0 = sm_ring_f0;
120 ring_node_for_averaging_sm_f0 = sm_ring_f0;
121 }
121 }
122
122
123 //***********************************************************
123 //***********************************************************
124 // Interrupt Service Routine for spectral matrices processing
124 // Interrupt Service Routine for spectral matrices processing
125 void reset_nb_sm_f0( void )
125 void reset_nb_sm_f0( void )
126 {
126 {
127 nb_sm_f0 = 0;
127 nb_sm_f0 = 0;
128 }
128 }
129
129
130 rtems_isr spectral_matrices_isr( rtems_vector_number vector )
130 rtems_isr spectral_matrices_isr( rtems_vector_number vector )
131 {
131 {
132 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 );
132 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 );
133
133
134 if ( (spectral_matrix_regs->status & 0x1) == 0x01)
134 if ( (spectral_matrix_regs->status & 0x1) == 0x01)
135 {
135 {
136 current_ring_node_sm_f0 = current_ring_node_sm_f0->next;
136 current_ring_node_sm_f0 = current_ring_node_sm_f0->next;
137 spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address;
137 spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address;
138 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffe; // 1110
138 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffe; // 1110
139 nb_sm_f0 = nb_sm_f0 + 1;
139 nb_sm_f0 = nb_sm_f0 + 1;
140 }
140 }
141 else if ( (spectral_matrix_regs->status & 0x2) == 0x02)
141 else if ( (spectral_matrix_regs->status & 0x2) == 0x02)
142 {
142 {
143 current_ring_node_sm_f0 = current_ring_node_sm_f0->next;
143 current_ring_node_sm_f0 = current_ring_node_sm_f0->next;
144 spectral_matrix_regs->matrixFO_Address1 = current_ring_node_sm_f0->buffer_address;
144 spectral_matrix_regs->matrixFO_Address1 = current_ring_node_sm_f0->buffer_address;
145 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffd; // 1101
145 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffd; // 1101
146 nb_sm_f0 = nb_sm_f0 + 1;
146 nb_sm_f0 = nb_sm_f0 + 1;
147 }
147 }
148
148
149 if ( (spectral_matrix_regs->status & 0x30) != 0x00)
149 if ( (spectral_matrix_regs->status & 0x30) != 0x00)
150 {
150 {
151 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 );
151 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 );
152 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xffffffcf; // 1100 1111
152 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xffffffcf; // 1100 1111
153 }
153 }
154
154
155 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffff3; // 0011
155 spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffff3; // 0011
156
156
157 if (nb_sm_f0 == (NB_SM_TO_RECEIVE_BEFORE_AVF0-1) )
157 if (nb_sm_f0 == (NB_SM_TO_RECEIVE_BEFORE_AVF0-1) )
158 {
158 {
159 ring_node_for_averaging_sm_f0 = current_ring_node_sm_f0;
159 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)
160 if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL)
161 {
161 {
162 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 );
162 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 );
163 }
163 }
164 nb_sm_f0 = 0;
164 nb_sm_f0 = 0;
165 }
165 }
166 else
166 else
167 {
167 {
168 nb_sm_f0 = nb_sm_f0 + 1;
168 nb_sm_f0 = nb_sm_f0 + 1;
169 }
169 }
170 }
170 }
171
171
172 rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector )
172 rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector )
173 {
173 {
174 if (nb_sm_f0 == (NB_SM_TO_RECEIVE_BEFORE_AVF0-1) )
174 if (nb_sm_f0 == (NB_SM_TO_RECEIVE_BEFORE_AVF0-1) )
175 {
175 {
176 ring_node_for_averaging_sm_f0 = current_ring_node_sm_f0;
176 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)
177 if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL)
178 {
178 {
179 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 );
179 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 );
180 }
180 }
181 nb_sm_f0 = 0;
181 nb_sm_f0 = 0;
182 }
182 }
183 else
183 else
184 {
184 {
185 nb_sm_f0 = nb_sm_f0 + 1;
185 nb_sm_f0 = nb_sm_f0 + 1;
186 }
186 }
187 }
187 }
188
188
189 //************
189 //************
190 // RTEMS TASKS
190 // RTEMS TASKS
191
191
192 rtems_task smiq_task(rtems_task_argument argument) // process the Spectral Matrices IRQ
192 rtems_task smiq_task(rtems_task_argument argument) // process the Spectral Matrices IRQ
193 {
193 {
194 rtems_event_set event_out;
194 rtems_event_set event_out;
195
195
196 BOOT_PRINTF("in SMIQ *** \n")
196 BOOT_PRINTF("in SMIQ *** \n")
197
197
198 while(1){
198 while(1){
199 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
199 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
200 }
200 }
201 }
201 }
202
202
203 rtems_task avf0_task(rtems_task_argument argument)
203 rtems_task avf0_task(rtems_task_argument argument)
204 {
204 {
205 int i;
205 int i;
206 static unsigned int nb_average_norm;
206 static unsigned int nb_average_norm_f0;
207 static unsigned int nb_average_sbm1;
207 static unsigned int nb_average_sbm1_f0;
208 rtems_event_set event_out;
208 rtems_event_set event_out;
209 rtems_status_code status;
209 rtems_status_code status;
210 ring_node_sm *ring_node_tab[8];
210 ring_node_sm *ring_node_tab[8];
211
211
212 nb_average_norm = 0;
212 nb_average_norm_f0 = 0;
213 nb_average_sbm1 = 0;
213 nb_average_sbm1_f0 = 0;
214
214
215 BOOT_PRINTF("in AVFO *** \n")
215 BOOT_PRINTF("in AVFO *** \n")
216
216
217 while(1){
217 while(1){
218 rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0
218 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;
219 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++ )
220 for ( i = 2; i < (NB_SM_TO_RECEIVE_BEFORE_AVF0+1); i++ )
221 {
221 {
222 ring_node_for_averaging_sm_f0 = ring_node_for_averaging_sm_f0->previous;
222 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;
223 ring_node_tab[NB_SM_TO_RECEIVE_BEFORE_AVF0-i] = ring_node_for_averaging_sm_f0;
224 }
224 }
225
225
226 // copy time information in the averaged_sm_f0 buffer
226 // copy time information in the averaged_sm_f0 buffer
227 averaged_sm_f0[0] = ring_node_tab[7]->coarseTime;
227 averaged_sm_f0[0] = ring_node_tab[7]->coarseTime;
228 averaged_sm_f0[1] = ring_node_tab[7]->fineTime;
228 averaged_sm_f0[1] = ring_node_tab[7]->fineTime;
229 averaged_sm_f1[0] = ring_node_tab[7]->coarseTime;
229 averaged_sm_sbm1[0] = ring_node_tab[7]->coarseTime;
230 averaged_sm_f1[1] = ring_node_tab[7]->fineTime;
230 averaged_sm_sbm1[1] = ring_node_tab[7]->fineTime;
231
231
232 // compute the average and store it in the averaged_sm_f1 buffer
232 // compute the average and store it in the averaged_sm_f1 buffer
233 ASM_average( averaged_sm_f0, averaged_sm_f1,
233 ASM_average( averaged_sm_f0, averaged_sm_sbm1,
234 ring_node_tab,
234 ring_node_tab,
235 nb_average_norm, nb_average_sbm1 );
235 nb_average_norm_f0, nb_average_sbm1_f0 );
236
236
237
237
238 // update nb_average
238 // update nb_average
239 nb_average_norm = nb_average_norm + NB_SM_TO_RECEIVE_BEFORE_AVF0;
239 nb_average_norm_f0 = nb_average_norm_f0 + NB_SM_TO_RECEIVE_BEFORE_AVF0;
240 nb_average_sbm1 = nb_average_sbm1 + NB_SM_TO_RECEIVE_BEFORE_AVF0;
240 nb_average_sbm1_f0 = nb_average_sbm1_f0 + NB_SM_TO_RECEIVE_BEFORE_AVF0;
241
241
242 // launch actions depending on the current mode
242 // launch actions depending on the current mode
243 if (lfrCurrentMode == LFR_MODE_SBM1)
243
244 if (nb_average_sbm1_f0 == NB_AVERAGE_SBM1_F0)
244 {
245 {
245 if (nb_average_sbm1 == NB_AVERAGE_SBM1_f0) {
246 nb_average_sbm1_f0 = 0;
246 nb_average_sbm1 = 0;
247 if (lfrCurrentMode == LFR_MODE_SBM1)
248 {
247 status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_MODE_SBM1 ); // sending an event to the task 7, BPF0
249 status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_MODE_SBM1 ); // sending an event to the task 7, BPF0
248 if (status != RTEMS_SUCCESSFUL) {
250 if (status != RTEMS_SUCCESSFUL)
249 printf("in AVF0 *** Error sending RTEMS_EVENT_0, code %d\n", status);
251 {
252 printf("in AVF0 *** Error sending RTEMS_EVENT_MODE_SBM1, code %d\n", status);
250 }
253 }
251 }
254 }
252 }
255 }
253 if (lfrCurrentMode == LFR_MODE_NORMAL)
256
254 {
257 if (nb_average_norm_f0 == NB_AVERAGE_NORMAL_F0) {
255 if (nb_average_norm == NB_AVERAGE_NORMAL_f0) {
258 nb_average_norm_f0 = 0;
256 nb_average_norm = 0;
259 status = rtems_event_send( Task_id[TASKID_MATR], RTEMS_EVENT_MODE_NORMAL ); // sending an event to the task 7, BPF0
257 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) {
258 if (status != RTEMS_SUCCESSFUL) {
261 printf("in AVF0 *** Error sending RTEMS_EVENT_0, code %d\n", status);
259 printf("in AVF0 *** Error sending RTEMS_EVENT_0, code %d\n", status);
260 }
261 }
262 }
262 }
263 }
263 }
264 }
264 }
265 }
265
266
266 rtems_task matr_task(rtems_task_argument argument)
267 rtems_task matr_task(rtems_task_argument argument)
267 {
268 {
268 spw_ioctl_pkt_send spw_ioctl_send_ASM;
269 spw_ioctl_pkt_send spw_ioctl_send_ASM;
269 rtems_event_set event_out;
270 rtems_event_set event_out;
270 rtems_status_code status;
271 rtems_status_code status;
271 rtems_id queue_id;
272 rtems_id queue_id;
272 Header_TM_LFR_SCIENCE_ASM_t headerASM;
273 Header_TM_LFR_SCIENCE_ASM_t headerASM;
273
274
274 init_header_asm( &headerASM );
275 init_header_asm( &headerASM );
275
276
276 status = get_message_queue_id_send( &queue_id );
277 status = get_message_queue_id_send( &queue_id );
277 if (status != RTEMS_SUCCESSFUL)
278 if (status != RTEMS_SUCCESSFUL)
278 {
279 {
279 PRINTF1("in MATR *** ERR get_message_queue_id_send %d\n", status)
280 PRINTF1("in MATR *** ERR get_message_queue_id_send %d\n", status)
280 }
281 }
281
282
282 BOOT_PRINTF("in MATR *** \n")
283 BOOT_PRINTF("in MATR *** \n")
283
284
284 fill_averaged_spectral_matrix( );
285 fill_averaged_spectral_matrix( );
285
286
286 while(1){
287 while(1){
287 rtems_event_receive( RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1,
288 rtems_event_receive( RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1,
288 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
289 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
289 if (event_out==RTEMS_EVENT_MODE_NORMAL)
290 if (event_out==RTEMS_EVENT_MODE_NORMAL)
290 {
291 {
291 // 1) compress the matrix for Basic Parameters calculation
292 // 1) compress the matrix for Basic Parameters calculation
292 ASM_compress( averaged_sm_f0, 0, compressed_sm_f0 );
293 ASM_compress( averaged_sm_f0, 0, compressed_sm_f0 );
293 // 2) compute the BP1 set
294 // 2) compute the BP1 set
294
295
295 // 3) convert the float array in a char array
296 // 3) send the BP1 set
297
298 // 4) convert the float array in a char array
296 ASM_reorganize( averaged_sm_f0, averaged_sm_f0_reorganized );
299 ASM_reorganize( averaged_sm_f0, averaged_sm_f0_reorganized );
297 ASM_convert( averaged_sm_f0_reorganized, averaged_sm_f0_char);
300 ASM_convert( averaged_sm_f0_reorganized, averaged_sm_f0_char);
298 // 4) send the spectral matrix packets
301 // 5) send the spectral matrix packets
299 ASM_send( &headerASM, averaged_sm_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM, queue_id);
302 ASM_send( &headerASM, averaged_sm_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM, queue_id);
300 }
303 }
301 else if (event_out==RTEMS_EVENT_MODE_SBM1)
304 else if (event_out==RTEMS_EVENT_MODE_SBM1)
302 {
305 {
303 // 1) compress the matrix for Basic Parameters calculation
306 // 1) compress the matrix for Basic Parameters calculation
304 ASM_compress( averaged_sm_f1, 0, compressed_sm_f1 );
307 ASM_compress( averaged_sm_sbm1, 0, compressed_sm_sbm1 );
305 // 2) compute the BP1 set
308 // 2) compute the BP1 set
306
309
307 // 4) send the basic parameters set 1 packet
310 // 3) send the basic parameters set 1 packet
308 BP1_send( );
311
309 }
312 }
310 else
313 else
311 {
314 {
312 PRINTF1("ERR *** in MATR *** unexect event = %x\n", (unsigned int) event_out)
315 PRINTF1("ERR *** in MATR *** unexect event = %x\n", (unsigned int) event_out)
313 }
316 }
314 }
317 }
315 }
318 }
316
319
317 //*****************************
320 //*****************************
318 // Spectral matrices processing
321 // Spectral matrices processing
319
322
320 void matrix_reset(volatile float *averaged_spec_mat)
323 void matrix_reset(volatile float *averaged_spec_mat)
321 {
324 {
322 int i;
325 int i;
323 for(i=0; i<TOTAL_SIZE_SM; i++){
326 for(i=0; i<TOTAL_SIZE_SM; i++){
324 averaged_spec_mat[i] = 0;
327 averaged_spec_mat[i] = 0;
325 }
328 }
326 }
329 }
327
330
328 void ASM_average( float *averaged_spec_mat_f0, float *averaged_spec_mat_f1,
331 void ASM_average( float *averaged_spec_mat_f0, float *averaged_spec_mat_f1,
329 ring_node_sm *ring_node_tab[],
332 ring_node_sm *ring_node_tab[],
330 unsigned int firstTimeF0, unsigned int firstTimeF1 )
333 unsigned int nbAverageNormF0, unsigned int nbAverageSBM1F0 )
331 {
334 {
332 float sum;
335 float sum;
333 unsigned int i;
336 unsigned int i;
334
337
335 for(i=0; i<TOTAL_SIZE_SM; i++)
338 for(i=0; i<TOTAL_SIZE_SM; i++)
336 {
339 {
337 sum = ( (int *) (ring_node_tab[0]->buffer_address) ) [ i ]
340 sum = ( (int *) (ring_node_tab[0]->buffer_address) ) [ i ]
338 + ( (int *) (ring_node_tab[1]->buffer_address) ) [ i ]
341 + ( (int *) (ring_node_tab[1]->buffer_address) ) [ i ]
339 + ( (int *) (ring_node_tab[2]->buffer_address) ) [ i ]
342 + ( (int *) (ring_node_tab[2]->buffer_address) ) [ i ]
340 + ( (int *) (ring_node_tab[3]->buffer_address) ) [ i ]
343 + ( (int *) (ring_node_tab[3]->buffer_address) ) [ i ]
341 + ( (int *) (ring_node_tab[4]->buffer_address) ) [ i ]
344 + ( (int *) (ring_node_tab[4]->buffer_address) ) [ i ]
342 + ( (int *) (ring_node_tab[5]->buffer_address) ) [ i ]
345 + ( (int *) (ring_node_tab[5]->buffer_address) ) [ i ]
343 + ( (int *) (ring_node_tab[6]->buffer_address) ) [ i ]
346 + ( (int *) (ring_node_tab[6]->buffer_address) ) [ i ]
344 + ( (int *) (ring_node_tab[7]->buffer_address) ) [ i ];
347 + ( (int *) (ring_node_tab[7]->buffer_address) ) [ i ];
345
348
346 if ( (firstTimeF0 == 0) && (firstTimeF1 == 0) )
349 if ( (nbAverageNormF0 == 0) && (nbAverageSBM1F0 == 0) )
347 {
350 {
348 averaged_spec_mat_f0[ i ] = averaged_spec_mat_f0[ i ] + sum;
351 averaged_spec_mat_f0[ TIME_OFFSET + i ] = sum;
349 averaged_spec_mat_f1[ i ] = averaged_spec_mat_f1[ i ] + sum;
352 averaged_spec_mat_f1[ TIME_OFFSET + i ] = sum;
350 }
353 }
351 else if ( (firstTimeF0 == 0) && (firstTimeF1 != 0) )
354 else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 != 0) )
352 {
355 {
353 averaged_spec_mat_f0[ i ] = averaged_spec_mat_f0[ i ] + sum;
356 averaged_spec_mat_f0[ TIME_OFFSET + i ] = ( averaged_spec_mat_f0[ TIME_OFFSET + i ] + sum );
354 averaged_spec_mat_f1[ i ] = sum;
357 averaged_spec_mat_f1[ TIME_OFFSET + i ] = ( averaged_spec_mat_f1[ TIME_OFFSET + i ] + sum );
355 }
358 }
356 else if ( (firstTimeF0 != 0) && (firstTimeF1 == 0) )
359 else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 == 0) )
357 {
360 {
358 averaged_spec_mat_f0[ i ] = sum;
361 averaged_spec_mat_f0[ TIME_OFFSET + i ] = ( averaged_spec_mat_f0[ TIME_OFFSET + i ] + sum );
359 averaged_spec_mat_f1[ i ] = averaged_spec_mat_f1[ i ] + sum;
362 averaged_spec_mat_f1[ TIME_OFFSET + i ] = sum;
360 }
363 }
361 else
364 else
362 {
365 {
363 averaged_spec_mat_f0[ i ] = sum;
366 PRINTF2("ERR *** in ASM_average *** unexpected parameters %d %d\n", nbAverageNormF0, nbAverageSBM1F0)
364 averaged_spec_mat_f1[ i ] = sum;
365 }
367 }
366 }
368 }
367 }
369 }
368
370
369 void ASM_reorganize( float *averaged_spec_mat, float *averaged_spec_mat_reorganized )
371 void ASM_reorganize( float *averaged_spec_mat, float *averaged_spec_mat_reorganized )
370 {
372 {
371 int frequencyBin;
373 int frequencyBin;
372 int asmComponent;
374 int asmComponent;
373
375
374 // copy the time information
376 // copy the time information
375 averaged_spec_mat_reorganized[ 0 ] = averaged_spec_mat[ 0 ];
377 averaged_spec_mat_reorganized[ 0 ] = averaged_spec_mat[ 0 ];
376 averaged_spec_mat_reorganized[ 1 ] = averaged_spec_mat[ 1 ];
378 averaged_spec_mat_reorganized[ 1 ] = averaged_spec_mat[ 1 ];
377
379
378 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
380 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
379 {
381 {
380 for( frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++ )
382 for( frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++ )
381 {
383 {
382 averaged_spec_mat_reorganized[ frequencyBin * NB_VALUES_PER_SM + asmComponent + TIME_OFFSET ] =
384 averaged_spec_mat_reorganized[ TIME_OFFSET + frequencyBin * NB_VALUES_PER_SM + asmComponent ] =
383 averaged_spec_mat[ asmComponent * NB_BINS_PER_SM + frequencyBin + TIME_OFFSET];
385 averaged_spec_mat[ TIME_OFFSET + asmComponent * NB_BINS_PER_SM + frequencyBin ];
384 }
386 }
385 }
387 }
386 }
388 }
387
389
388 void ASM_compress( float *averaged_spec_mat, unsigned char fChannel, float *compressed_spec_mat )
390 void ASM_compress( float *averaged_spec_mat, unsigned char fChannel, float *compressed_spec_mat )
389 {
391 {
390 int frequencyBin;
392 int frequencyBin;
391 int asmComponent;
393 int asmComponent;
392 int offsetASM;
394 int offsetASM;
393 int offsetCompressed;
395 int offsetCompressed;
394 int k;
396 int k;
395
397
396 switch (fChannel){
398 switch (fChannel){
397 case 0:
399 case 0:
398 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
400 for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++)
399 {
401 {
400 for( frequencyBin = 0; frequencyBin < NB_BINS_COMPRESSED_SM_F0; frequencyBin++ )
402 for( frequencyBin = 0; frequencyBin < NB_BINS_COMPRESSED_SM_F0; frequencyBin++ )
401 {
403 {
402 offsetCompressed = TIME_OFFSET
404 offsetCompressed = TIME_OFFSET
403 + frequencyBin * NB_VALUES_PER_SM
405 + frequencyBin * NB_VALUES_PER_SM
404 + asmComponent;
406 + asmComponent;
405 offsetASM = TIME_OFFSET
407 offsetASM = TIME_OFFSET
406 + asmComponent * NB_BINS_PER_SM
408 + asmComponent * NB_BINS_PER_SM
407 + ASM_F0_INDICE_START
409 + ASM_F0_INDICE_START
408 + frequencyBin * NB_BINS_TO_AVERAGE_ASM_F0;
410 + frequencyBin * NB_BINS_TO_AVERAGE_ASM_F0;
409 compressed_spec_mat[ offsetCompressed ] = 0;
411 compressed_spec_mat[ offsetCompressed ] = 0;
410 for ( k = 0; k < NB_BINS_TO_AVERAGE_ASM_F0; k++ )
412 for ( k = 0; k < NB_BINS_TO_AVERAGE_ASM_F0; k++ )
411 {
413 {
412 compressed_spec_mat[offsetCompressed ] =
414 compressed_spec_mat[offsetCompressed ] =
413 compressed_spec_mat[ offsetCompressed ]
415 compressed_spec_mat[ offsetCompressed ]
414 + averaged_spec_mat[ offsetASM + k ];
416 + averaged_spec_mat[ offsetASM + k ];
415 }
417 }
416 }
418 }
417 }
419 }
418 break;
420 break;
419
421
420 case 1:
422 case 1:
421 // case fChannel = f1 to be completed later
423 // case fChannel = f1 to be completed later
422 break;
424 break;
423
425
424 case 2:
426 case 2:
425 // case fChannel = f1 to be completed later
427 // case fChannel = f1 to be completed later
426 break;
428 break;
427
429
428 default:
430 default:
429 break;
431 break;
430 }
432 }
431 }
433 }
432
434
433 void ASM_convert( volatile float *input_matrix, char *output_matrix)
435 void ASM_convert( volatile float *input_matrix, char *output_matrix)
434 {
436 {
435 unsigned int i;
437 unsigned int i;
436 unsigned int frequencyBin;
438 unsigned int frequencyBin;
437 unsigned int asmComponent;
439 unsigned int asmComponent;
438 char * pt_char_input;
440 char * pt_char_input;
439 char * pt_char_output;
441 char * pt_char_output;
440
442
441 pt_char_input = (char*) &input_matrix;
443 pt_char_input = (char*) &input_matrix;
442 pt_char_output = (char*) &output_matrix;
444 pt_char_output = (char*) &output_matrix;
443
445
444 // copy the time information
446 // copy the time information
445 for (i=0; i<TIME_OFFSET_IN_BYTES; i++)
447 for (i=0; i<TIME_OFFSET_IN_BYTES; i++)
446 {
448 {
447 pt_char_output[ i ] = pt_char_output[ i ];
449 pt_char_output[ i ] = pt_char_output[ i ];
448 }
450 }
449
451
450 // convert all other data
452 // convert all other data
451 for( frequencyBin=0; frequencyBin<NB_BINS_PER_SM; frequencyBin++)
453 for( frequencyBin=0; frequencyBin<NB_BINS_PER_SM; frequencyBin++)
452 {
454 {
453 for ( asmComponent=0; asmComponent<NB_VALUES_PER_SM; asmComponent++)
455 for ( asmComponent=0; asmComponent<NB_VALUES_PER_SM; asmComponent++)
454 {
456 {
455 pt_char_input = (char*) &input_matrix [ (frequencyBin*NB_VALUES_PER_SM) + asmComponent + TIME_OFFSET ];
457 pt_char_input = (char*) &input_matrix [ (frequencyBin*NB_VALUES_PER_SM) + asmComponent + TIME_OFFSET ];
456 pt_char_output = (char*) &output_matrix[ 2 * ( (frequencyBin*NB_VALUES_PER_SM) + asmComponent ) + TIME_OFFSET_IN_BYTES ];
458 pt_char_output = (char*) &output_matrix[ 2 * ( (frequencyBin*NB_VALUES_PER_SM) + asmComponent ) + TIME_OFFSET_IN_BYTES ];
457 pt_char_output[0] = pt_char_input[0]; // bits 31 downto 24 of the float
459 pt_char_output[0] = pt_char_input[0]; // bits 31 downto 24 of the float
458 pt_char_output[1] = pt_char_input[1]; // bits 23 downto 16 of the float
460 pt_char_output[1] = pt_char_input[1]; // bits 23 downto 16 of the float
459 }
461 }
460 }
462 }
461 }
463 }
462
464
463 void ASM_send(Header_TM_LFR_SCIENCE_ASM_t *header, char *spectral_matrix,
465 void ASM_send(Header_TM_LFR_SCIENCE_ASM_t *header, char *spectral_matrix,
464 unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send, rtems_id queue_id)
466 unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send, rtems_id queue_id)
465 {
467 {
466 unsigned int i;
468 unsigned int i;
467 unsigned int length = 0;
469 unsigned int length = 0;
468 rtems_status_code status;
470 rtems_status_code status;
469
471
470 for (i=0; i<2; i++)
472 for (i=0; i<2; i++)
471 {
473 {
472 // (1) BUILD THE DATA
474 // (1) BUILD THE DATA
473 switch(sid)
475 switch(sid)
474 {
476 {
475 case SID_NORM_ASM_F0:
477 case SID_NORM_ASM_F0:
476 spw_ioctl_send->dlen = TOTAL_SIZE_ASM_F0_IN_BYTES / 2;
478 spw_ioctl_send->dlen = TOTAL_SIZE_ASM_F0_IN_BYTES / 2;
477 spw_ioctl_send->data = &spectral_matrix[
479 spw_ioctl_send->data = &spectral_matrix[
478 ( (ASM_F0_INDICE_START + (i*NB_BINS_PER_PKT_ASM_F0) ) * NB_VALUES_PER_SM ) * 2
480 ( (ASM_F0_INDICE_START + (i*NB_BINS_PER_PKT_ASM_F0) ) * NB_VALUES_PER_SM ) * 2
479 + TIME_OFFSET_IN_BYTES
481 + TIME_OFFSET_IN_BYTES
480 ];
482 ];
481 length = PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0;
483 length = PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0;
482 header->pa_lfr_asm_blk_nr[0] = (unsigned char) ( (NB_BINS_PER_PKT_ASM_F0) >> 8 ); // BLK_NR MSB
484 header->pa_lfr_asm_blk_nr[0] = (unsigned char) ( (NB_BINS_PER_PKT_ASM_F0) >> 8 ); // BLK_NR MSB
483 header->pa_lfr_asm_blk_nr[1] = (unsigned char) (NB_BINS_PER_PKT_ASM_F0); // BLK_NR LSB
485 header->pa_lfr_asm_blk_nr[1] = (unsigned char) (NB_BINS_PER_PKT_ASM_F0); // BLK_NR LSB
484 break;
486 break;
485 case SID_NORM_ASM_F1:
487 case SID_NORM_ASM_F1:
486 break;
488 break;
487 case SID_NORM_ASM_F2:
489 case SID_NORM_ASM_F2:
488 break;
490 break;
489 default:
491 default:
490 PRINTF1("ERR *** in ASM_send *** unexpected sid %d\n", sid)
492 PRINTF1("ERR *** in ASM_send *** unexpected sid %d\n", sid)
491 break;
493 break;
492 }
494 }
493 spw_ioctl_send->hlen = HEADER_LENGTH_TM_LFR_SCIENCE_ASM + CCSDS_PROTOCOLE_EXTRA_BYTES;
495 spw_ioctl_send->hlen = HEADER_LENGTH_TM_LFR_SCIENCE_ASM + CCSDS_PROTOCOLE_EXTRA_BYTES;
494 spw_ioctl_send->hdr = (char *) header;
496 spw_ioctl_send->hdr = (char *) header;
495 spw_ioctl_send->options = 0;
497 spw_ioctl_send->options = 0;
496
498
497 // (2) BUILD THE HEADER
499 // (2) BUILD THE HEADER
498 header->packetLength[0] = (unsigned char) (length>>8);
500 header->packetLength[0] = (unsigned char) (length>>8);
499 header->packetLength[1] = (unsigned char) (length);
501 header->packetLength[1] = (unsigned char) (length);
500 header->sid = (unsigned char) sid; // SID
502 header->sid = (unsigned char) sid; // SID
501 header->pa_lfr_pkt_cnt_asm = 2;
503 header->pa_lfr_pkt_cnt_asm = 2;
502 header->pa_lfr_pkt_nr_asm = (unsigned char) (i+1);
504 header->pa_lfr_pkt_nr_asm = (unsigned char) (i+1);
503
505
504 // (3) SET PACKET TIME
506 // (3) SET PACKET TIME
505 header->time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
507 header->time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
506 header->time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
508 header->time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
507 header->time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
509 header->time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
508 header->time[3] = (unsigned char) (time_management_regs->coarse_time);
510 header->time[3] = (unsigned char) (time_management_regs->coarse_time);
509 header->time[4] = (unsigned char) (time_management_regs->fine_time>>8);
511 header->time[4] = (unsigned char) (time_management_regs->fine_time>>8);
510 header->time[5] = (unsigned char) (time_management_regs->fine_time);
512 header->time[5] = (unsigned char) (time_management_regs->fine_time);
511 //
513 //
512 header->acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24);
514 header->acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24);
513 header->acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16);
515 header->acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16);
514 header->acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8);
516 header->acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8);
515 header->acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time);
517 header->acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time);
516 header->acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8);
518 header->acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8);
517 header->acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time);
519 header->acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time);
518
520
519 // (4) SEND PACKET
521 // (4) SEND PACKET
520 status = rtems_message_queue_send( queue_id, spw_ioctl_send, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
522 status = rtems_message_queue_send( queue_id, spw_ioctl_send, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
521 if (status != RTEMS_SUCCESSFUL) {
523 if (status != RTEMS_SUCCESSFUL) {
522 printf("in ASM_send *** ERR %d\n", (int) status);
524 printf("in ASM_send *** ERR %d\n", (int) status);
523 }
525 }
524 }
526 }
525 }
527 }
526
528
527 void BP1_send()
529 void BP1_send()
528 {
530 {
529
531
530 }
532 }
531
533
532 void BP1_set_old(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * LFR_BP1){
534 void BP1_set_old(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat, unsigned char * LFR_BP1){
533 int i;
535 int i;
534 int j;
536 int j;
535 unsigned char tmp_u_char;
537 unsigned char tmp_u_char;
536 unsigned char * pt_char = NULL;
538 unsigned char * pt_char = NULL;
537 float PSDB, PSDE;
539 float PSDB, PSDE;
538 float NVEC_V0;
540 float NVEC_V0;
539 float NVEC_V1;
541 float NVEC_V1;
540 float NVEC_V2;
542 float NVEC_V2;
541 //float significand;
543 //float significand;
542 //int exponent;
544 //int exponent;
543 float aux;
545 float aux;
544 float tr_SB_SB;
546 float tr_SB_SB;
545 float tmp;
547 float tmp;
546 float sx_re;
548 float sx_re;
547 float sx_im;
549 float sx_im;
548 float nebx_re = 0;
550 float nebx_re = 0;
549 float nebx_im = 0;
551 float nebx_im = 0;
550 float ny = 0;
552 float ny = 0;
551 float nz = 0;
553 float nz = 0;
552 float bx_bx_star = 0;
554 float bx_bx_star = 0;
553 for(i=0; i<nb_bins_compressed_spec_mat; i++){
555 for(i=0; i<nb_bins_compressed_spec_mat; i++){
554 //==============================================
556 //==============================================
555 // BP1 PSD == B PAR_LFR_SC_BP1_PE_FL0 == 16 bits
557 // BP1 PSD == B PAR_LFR_SC_BP1_PE_FL0 == 16 bits
556 PSDB = compressed_spec_mat[i*30] // S11
558 PSDB = compressed_spec_mat[i*30] // S11
557 + compressed_spec_mat[(i*30) + 10] // S22
559 + compressed_spec_mat[(i*30) + 10] // S22
558 + compressed_spec_mat[(i*30) + 18]; // S33
560 + compressed_spec_mat[(i*30) + 18]; // S33
559 //significand = frexp(PSDB, &exponent);
561 //significand = frexp(PSDB, &exponent);
560 pt_char = (unsigned char*) &PSDB;
562 pt_char = (unsigned char*) &PSDB;
561 LFR_BP1[(i*9) + 2] = pt_char[0]; // bits 31 downto 24 of the float
563 LFR_BP1[(i*9) + 2] = pt_char[0]; // bits 31 downto 24 of the float
562 LFR_BP1[(i*9) + 3] = pt_char[1]; // bits 23 downto 16 of the float
564 LFR_BP1[(i*9) + 3] = pt_char[1]; // bits 23 downto 16 of the float
563 //==============================================
565 //==============================================
564 // BP1 PSD == E PAR_LFR_SC_BP1_PB_FL0 == 16 bits
566 // BP1 PSD == E PAR_LFR_SC_BP1_PB_FL0 == 16 bits
565 PSDE = compressed_spec_mat[(i*30) + 24] * K44_pe // S44
567 PSDE = compressed_spec_mat[(i*30) + 24] * K44_pe // S44
566 + compressed_spec_mat[(i*30) + 28] * K55_pe // S55
568 + compressed_spec_mat[(i*30) + 28] * K55_pe // S55
567 + compressed_spec_mat[(i*30) + 26] * K45_pe_re // S45
569 + compressed_spec_mat[(i*30) + 26] * K45_pe_re // S45
568 - compressed_spec_mat[(i*30) + 27] * K45_pe_im; // S45
570 - compressed_spec_mat[(i*30) + 27] * K45_pe_im; // S45
569 pt_char = (unsigned char*) &PSDE;
571 pt_char = (unsigned char*) &PSDE;
570 LFR_BP1[(i*9) + 0] = pt_char[0]; // bits 31 downto 24 of the float
572 LFR_BP1[(i*9) + 0] = pt_char[0]; // bits 31 downto 24 of the float
571 LFR_BP1[(i*9) + 1] = pt_char[1]; // bits 23 downto 16 of the float
573 LFR_BP1[(i*9) + 1] = pt_char[1]; // bits 23 downto 16 of the float
572 //==============================================================================
574 //==============================================================================
573 // BP1 normal wave vector == PAR_LFR_SC_BP1_NVEC_V0_F0 == 8 bits
575 // BP1 normal wave vector == PAR_LFR_SC_BP1_NVEC_V0_F0 == 8 bits
574 // == PAR_LFR_SC_BP1_NVEC_V1_F0 == 8 bits
576 // == PAR_LFR_SC_BP1_NVEC_V1_F0 == 8 bits
575 // == PAR_LFR_SC_BP1_NVEC_V2_F0 == 1 bits
577 // == PAR_LFR_SC_BP1_NVEC_V2_F0 == 1 bits
576 tmp = sqrt(
578 tmp = sqrt(
577 compressed_spec_mat[(i*30) + 3]*compressed_spec_mat[(i*30) + 3] //Im S12
579 compressed_spec_mat[(i*30) + 3]*compressed_spec_mat[(i*30) + 3] //Im S12
578 +compressed_spec_mat[(i*30) + 5]*compressed_spec_mat[(i*30) + 5] //Im S13
580 +compressed_spec_mat[(i*30) + 5]*compressed_spec_mat[(i*30) + 5] //Im S13
579 +compressed_spec_mat[(i*30) + 13]*compressed_spec_mat[(i*30) + 13] //Im S23
581 +compressed_spec_mat[(i*30) + 13]*compressed_spec_mat[(i*30) + 13] //Im S23
580 );
582 );
581 NVEC_V0 = compressed_spec_mat[(i*30) + 13] / tmp; // Im S23
583 NVEC_V0 = compressed_spec_mat[(i*30) + 13] / tmp; // Im S23
582 NVEC_V1 = -compressed_spec_mat[(i*30) + 5] / tmp; // Im S13
584 NVEC_V1 = -compressed_spec_mat[(i*30) + 5] / tmp; // Im S13
583 NVEC_V2 = compressed_spec_mat[(i*30) + 3] / tmp; // Im S12
585 NVEC_V2 = compressed_spec_mat[(i*30) + 3] / tmp; // Im S12
584 LFR_BP1[(i*9) + 4] = (char) (NVEC_V0*127);
586 LFR_BP1[(i*9) + 4] = (char) (NVEC_V0*127);
585 LFR_BP1[(i*9) + 5] = (char) (NVEC_V1*127);
587 LFR_BP1[(i*9) + 5] = (char) (NVEC_V1*127);
586 pt_char = (unsigned char*) &NVEC_V2;
588 pt_char = (unsigned char*) &NVEC_V2;
587 LFR_BP1[(i*9) + 6] = pt_char[0] & 0x80; // extract the sign of NVEC_V2
589 LFR_BP1[(i*9) + 6] = pt_char[0] & 0x80; // extract the sign of NVEC_V2
588 //=======================================================
590 //=======================================================
589 // BP1 ellipticity == PAR_LFR_SC_BP1_ELLIP_F0 == 4 bits
591 // BP1 ellipticity == PAR_LFR_SC_BP1_ELLIP_F0 == 4 bits
590 aux = 2*tmp / PSDB; // compute the ellipticity
592 aux = 2*tmp / PSDB; // compute the ellipticity
591 tmp_u_char = (unsigned char) (aux*(16-1)); // convert the ellipticity
593 tmp_u_char = (unsigned char) (aux*(16-1)); // convert the ellipticity
592 LFR_BP1[i*9+6] = LFR_BP1[i*9+6] | ((tmp_u_char&0x0f)<<3); // keeps 4 bits of the resulting unsigned char
594 LFR_BP1[i*9+6] = LFR_BP1[i*9+6] | ((tmp_u_char&0x0f)<<3); // keeps 4 bits of the resulting unsigned char
593 //==============================================================
595 //==============================================================
594 // BP1 degree of polarization == PAR_LFR_SC_BP1_DOP_F0 == 3 bits
596 // BP1 degree of polarization == PAR_LFR_SC_BP1_DOP_F0 == 3 bits
595 for(j = 0; j<NB_VALUES_PER_SM;j++){
597 for(j = 0; j<NB_VALUES_PER_SM;j++){
596 tr_SB_SB = compressed_spec_mat[i*30] * compressed_spec_mat[i*30]
598 tr_SB_SB = compressed_spec_mat[i*30] * compressed_spec_mat[i*30]
597 + compressed_spec_mat[(i*30) + 10] * compressed_spec_mat[(i*30) + 10]
599 + compressed_spec_mat[(i*30) + 10] * compressed_spec_mat[(i*30) + 10]
598 + compressed_spec_mat[(i*30) + 18] * compressed_spec_mat[(i*30) + 18]
600 + compressed_spec_mat[(i*30) + 18] * compressed_spec_mat[(i*30) + 18]
599 + 2 * compressed_spec_mat[(i*30) + 2] * compressed_spec_mat[(i*30) + 2]
601 + 2 * compressed_spec_mat[(i*30) + 2] * compressed_spec_mat[(i*30) + 2]
600 + 2 * compressed_spec_mat[(i*30) + 3] * compressed_spec_mat[(i*30) + 3]
602 + 2 * compressed_spec_mat[(i*30) + 3] * compressed_spec_mat[(i*30) + 3]
601 + 2 * compressed_spec_mat[(i*30) + 4] * compressed_spec_mat[(i*30) + 4]
603 + 2 * compressed_spec_mat[(i*30) + 4] * compressed_spec_mat[(i*30) + 4]
602 + 2 * compressed_spec_mat[(i*30) + 5] * compressed_spec_mat[(i*30) + 5]
604 + 2 * compressed_spec_mat[(i*30) + 5] * compressed_spec_mat[(i*30) + 5]
603 + 2 * compressed_spec_mat[(i*30) + 12] * compressed_spec_mat[(i*30) + 12]
605 + 2 * compressed_spec_mat[(i*30) + 12] * compressed_spec_mat[(i*30) + 12]
604 + 2 * compressed_spec_mat[(i*30) + 13] * compressed_spec_mat[(i*30) + 13];
606 + 2 * compressed_spec_mat[(i*30) + 13] * compressed_spec_mat[(i*30) + 13];
605 }
607 }
606 aux = PSDB*PSDB;
608 aux = PSDB*PSDB;
607 tmp = sqrt( abs( ( 3*tr_SB_SB - aux ) / ( 2 * aux ) ) );
609 tmp = sqrt( abs( ( 3*tr_SB_SB - aux ) / ( 2 * aux ) ) );
608 tmp_u_char = (unsigned char) (NVEC_V0*(8-1));
610 tmp_u_char = (unsigned char) (NVEC_V0*(8-1));
609 LFR_BP1[(i*9) + 6] = LFR_BP1[(i*9) + 6] | (tmp_u_char & 0x07); // keeps 3 bits of the resulting unsigned char
611 LFR_BP1[(i*9) + 6] = LFR_BP1[(i*9) + 6] | (tmp_u_char & 0x07); // keeps 3 bits of the resulting unsigned char
610 //=======================================================================================
612 //=======================================================================================
611 // BP1 x-component of the normalized Poynting flux == PAR_LFR_SC_BP1_SZ_F0 == 8 bits (7+1)
613 // BP1 x-component of the normalized Poynting flux == PAR_LFR_SC_BP1_SZ_F0 == 8 bits (7+1)
612 sx_re = compressed_spec_mat[(i*30) + 20] * K34_sx_re
614 sx_re = compressed_spec_mat[(i*30) + 20] * K34_sx_re
613 + compressed_spec_mat[(i*30) + 6] * K14_sx_re
615 + compressed_spec_mat[(i*30) + 6] * K14_sx_re
614 + compressed_spec_mat[(i*30) + 8] * K15_sx_re
616 + compressed_spec_mat[(i*30) + 8] * K15_sx_re
615 + compressed_spec_mat[(i*30) + 14] * K24_sx_re
617 + compressed_spec_mat[(i*30) + 14] * K24_sx_re
616 + compressed_spec_mat[(i*30) + 16] * K25_sx_re
618 + compressed_spec_mat[(i*30) + 16] * K25_sx_re
617 + compressed_spec_mat[(i*30) + 22] * K35_sx_re;
619 + compressed_spec_mat[(i*30) + 22] * K35_sx_re;
618 sx_im = compressed_spec_mat[(i*30) + 21] * K34_sx_im
620 sx_im = compressed_spec_mat[(i*30) + 21] * K34_sx_im
619 + compressed_spec_mat[(i*30) + 7] * K14_sx_im
621 + compressed_spec_mat[(i*30) + 7] * K14_sx_im
620 + compressed_spec_mat[(i*30) + 9] * K15_sx_im
622 + compressed_spec_mat[(i*30) + 9] * K15_sx_im
621 + compressed_spec_mat[(i*30) + 15] * K24_sx_im
623 + compressed_spec_mat[(i*30) + 15] * K24_sx_im
622 + compressed_spec_mat[(i*30) + 17] * K25_sx_im
624 + compressed_spec_mat[(i*30) + 17] * K25_sx_im
623 + compressed_spec_mat[(i*30) + 23] * K35_sx_im;
625 + compressed_spec_mat[(i*30) + 23] * K35_sx_im;
624 LFR_BP1[(i*9) + 7] = ((unsigned char) (sx_re * 128)) & 0x7f; // cf DOC for the compression
626 LFR_BP1[(i*9) + 7] = ((unsigned char) (sx_re * 128)) & 0x7f; // cf DOC for the compression
625 if ( abs(sx_re) > abs(sx_im) ) {
627 if ( abs(sx_re) > abs(sx_im) ) {
626 LFR_BP1[(i*9) + 7] = LFR_BP1[(i*9) + 1] | (0x80); // extract the sector of sx
628 LFR_BP1[(i*9) + 7] = LFR_BP1[(i*9) + 1] | (0x80); // extract the sector of sx
627 }
629 }
628 else {
630 else {
629 LFR_BP1[(i*9) + 7] = LFR_BP1[(i*9) + 1] & (0x7f); // extract the sector of sx
631 LFR_BP1[(i*9) + 7] = LFR_BP1[(i*9) + 1] & (0x7f); // extract the sector of sx
630 }
632 }
631 //======================================================================
633 //======================================================================
632 // BP1 phase velocity estimator == PAR_LFR_SC_BP1_VPHI_F0 == 8 bits (7+1)
634 // BP1 phase velocity estimator == PAR_LFR_SC_BP1_VPHI_F0 == 8 bits (7+1)
633 ny = sin(Alpha_M)*NVEC_V1 + cos(Alpha_M)*NVEC_V2;
635 ny = sin(Alpha_M)*NVEC_V1 + cos(Alpha_M)*NVEC_V2;
634 nz = NVEC_V0;
636 nz = NVEC_V0;
635 bx_bx_star = cos(Alpha_M) * cos(Alpha_M) * compressed_spec_mat[i*30+10] // re S22
637 bx_bx_star = cos(Alpha_M) * cos(Alpha_M) * compressed_spec_mat[i*30+10] // re S22
636 + sin(Alpha_M) * sin(Alpha_M) * compressed_spec_mat[i*30+18] // re S33
638 + sin(Alpha_M) * sin(Alpha_M) * compressed_spec_mat[i*30+18] // re S33
637 - 2 * sin(Alpha_M) * cos(Alpha_M) * compressed_spec_mat[i*30+12]; // re S23
639 - 2 * sin(Alpha_M) * cos(Alpha_M) * compressed_spec_mat[i*30+12]; // re S23
638 nebx_re = ny * (compressed_spec_mat[(i*30) + 14] * K24_ny_re
640 nebx_re = ny * (compressed_spec_mat[(i*30) + 14] * K24_ny_re
639 +compressed_spec_mat[(i*30) + 16] * K25_ny_re
641 +compressed_spec_mat[(i*30) + 16] * K25_ny_re
640 +compressed_spec_mat[(i*30) + 20] * K34_ny_re
642 +compressed_spec_mat[(i*30) + 20] * K34_ny_re
641 +compressed_spec_mat[(i*30) + 22] * K35_ny_re)
643 +compressed_spec_mat[(i*30) + 22] * K35_ny_re)
642 + nz * (compressed_spec_mat[(i*30) + 14] * K24_nz_re
644 + nz * (compressed_spec_mat[(i*30) + 14] * K24_nz_re
643 +compressed_spec_mat[(i*30) + 16] * K25_nz_re
645 +compressed_spec_mat[(i*30) + 16] * K25_nz_re
644 +compressed_spec_mat[(i*30) + 20] * K34_nz_re
646 +compressed_spec_mat[(i*30) + 20] * K34_nz_re
645 +compressed_spec_mat[(i*30) + 22] * K35_nz_re);
647 +compressed_spec_mat[(i*30) + 22] * K35_nz_re);
646 nebx_im = ny * (compressed_spec_mat[(i*30) + 15]*K24_ny_re
648 nebx_im = ny * (compressed_spec_mat[(i*30) + 15]*K24_ny_re
647 +compressed_spec_mat[(i*30) + 17] * K25_ny_re
649 +compressed_spec_mat[(i*30) + 17] * K25_ny_re
648 +compressed_spec_mat[(i*30) + 21] * K34_ny_re
650 +compressed_spec_mat[(i*30) + 21] * K34_ny_re
649 +compressed_spec_mat[(i*30) + 23] * K35_ny_re)
651 +compressed_spec_mat[(i*30) + 23] * K35_ny_re)
650 + nz * (compressed_spec_mat[(i*30) + 15] * K24_nz_im
652 + nz * (compressed_spec_mat[(i*30) + 15] * K24_nz_im
651 +compressed_spec_mat[(i*30) + 17] * K25_nz_im
653 +compressed_spec_mat[(i*30) + 17] * K25_nz_im
652 +compressed_spec_mat[(i*30) + 21] * K34_nz_im
654 +compressed_spec_mat[(i*30) + 21] * K34_nz_im
653 +compressed_spec_mat[(i*30) + 23] * K35_nz_im);
655 +compressed_spec_mat[(i*30) + 23] * K35_nz_im);
654 tmp = nebx_re / bx_bx_star;
656 tmp = nebx_re / bx_bx_star;
655 LFR_BP1[(i*9) + 8] = ((unsigned char) (tmp * 128)) & 0x7f; // cf DOC for the compression
657 LFR_BP1[(i*9) + 8] = ((unsigned char) (tmp * 128)) & 0x7f; // cf DOC for the compression
656 if ( abs(nebx_re) > abs(nebx_im) ) {
658 if ( abs(nebx_re) > abs(nebx_im) ) {
657 LFR_BP1[(i*9) + 8] = LFR_BP1[(i*9) + 8] | (0x80); // extract the sector of nebx
659 LFR_BP1[(i*9) + 8] = LFR_BP1[(i*9) + 8] | (0x80); // extract the sector of nebx
658 }
660 }
659 else {
661 else {
660 LFR_BP1[(i*9) + 8] = LFR_BP1[(i*9) + 8] & (0x7f); // extract the sector of nebx
662 LFR_BP1[(i*9) + 8] = LFR_BP1[(i*9) + 8] & (0x7f); // extract the sector of nebx
661 }
663 }
662 }
664 }
663
665
664 }
666 }
665
667
666 void BP2_set_old(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat){
668 void BP2_set_old(float * compressed_spec_mat, unsigned char nb_bins_compressed_spec_mat){
667 // BP2 autocorrelation
669 // BP2 autocorrelation
668 int i;
670 int i;
669 int aux = 0;
671 int aux = 0;
670
672
671 for(i = 0; i<nb_bins_compressed_spec_mat; i++){
673 for(i = 0; i<nb_bins_compressed_spec_mat; i++){
672 // S12
674 // S12
673 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 10]);
675 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 10]);
674 compressed_spec_mat[(i*30) + 2] = compressed_spec_mat[(i*30) + 2] / aux;
676 compressed_spec_mat[(i*30) + 2] = compressed_spec_mat[(i*30) + 2] / aux;
675 compressed_spec_mat[(i*30) + 3] = compressed_spec_mat[(i*30) + 3] / aux;
677 compressed_spec_mat[(i*30) + 3] = compressed_spec_mat[(i*30) + 3] / aux;
676 // S13
678 // S13
677 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 18]);
679 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 18]);
678 compressed_spec_mat[(i*30) + 4] = compressed_spec_mat[(i*30) + 4] / aux;
680 compressed_spec_mat[(i*30) + 4] = compressed_spec_mat[(i*30) + 4] / aux;
679 compressed_spec_mat[(i*30) + 5] = compressed_spec_mat[(i*30) + 5] / aux;
681 compressed_spec_mat[(i*30) + 5] = compressed_spec_mat[(i*30) + 5] / aux;
680 // S23
682 // S23
681 aux = sqrt(compressed_spec_mat[i*30+12]*compressed_spec_mat[(i*30) + 18]);
683 aux = sqrt(compressed_spec_mat[i*30+12]*compressed_spec_mat[(i*30) + 18]);
682 compressed_spec_mat[(i*30) + 12] = compressed_spec_mat[(i*30) + 12] / aux;
684 compressed_spec_mat[(i*30) + 12] = compressed_spec_mat[(i*30) + 12] / aux;
683 compressed_spec_mat[(i*30) + 13] = compressed_spec_mat[(i*30) + 13] / aux;
685 compressed_spec_mat[(i*30) + 13] = compressed_spec_mat[(i*30) + 13] / aux;
684 // S45
686 // S45
685 aux = sqrt(compressed_spec_mat[i*30+24]*compressed_spec_mat[(i*30) + 28]);
687 aux = sqrt(compressed_spec_mat[i*30+24]*compressed_spec_mat[(i*30) + 28]);
686 compressed_spec_mat[(i*30) + 26] = compressed_spec_mat[(i*30) + 26] / aux;
688 compressed_spec_mat[(i*30) + 26] = compressed_spec_mat[(i*30) + 26] / aux;
687 compressed_spec_mat[(i*30) + 27] = compressed_spec_mat[(i*30) + 27] / aux;
689 compressed_spec_mat[(i*30) + 27] = compressed_spec_mat[(i*30) + 27] / aux;
688 // S14
690 // S14
689 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) +24]);
691 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) +24]);
690 compressed_spec_mat[(i*30) + 6] = compressed_spec_mat[(i*30) + 6] / aux;
692 compressed_spec_mat[(i*30) + 6] = compressed_spec_mat[(i*30) + 6] / aux;
691 compressed_spec_mat[(i*30) + 7] = compressed_spec_mat[(i*30) + 7] / aux;
693 compressed_spec_mat[(i*30) + 7] = compressed_spec_mat[(i*30) + 7] / aux;
692 // S15
694 // S15
693 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 28]);
695 aux = sqrt(compressed_spec_mat[i*30]*compressed_spec_mat[(i*30) + 28]);
694 compressed_spec_mat[(i*30) + 8] = compressed_spec_mat[(i*30) + 8] / aux;
696 compressed_spec_mat[(i*30) + 8] = compressed_spec_mat[(i*30) + 8] / aux;
695 compressed_spec_mat[(i*30) + 9] = compressed_spec_mat[(i*30) + 9] / aux;
697 compressed_spec_mat[(i*30) + 9] = compressed_spec_mat[(i*30) + 9] / aux;
696 // S24
698 // S24
697 aux = sqrt(compressed_spec_mat[i*10]*compressed_spec_mat[(i*30) + 24]);
699 aux = sqrt(compressed_spec_mat[i*10]*compressed_spec_mat[(i*30) + 24]);
698 compressed_spec_mat[(i*30) + 14] = compressed_spec_mat[(i*30) + 14] / aux;
700 compressed_spec_mat[(i*30) + 14] = compressed_spec_mat[(i*30) + 14] / aux;
699 compressed_spec_mat[(i*30) + 15] = compressed_spec_mat[(i*30) + 15] / aux;
701 compressed_spec_mat[(i*30) + 15] = compressed_spec_mat[(i*30) + 15] / aux;
700 // S25
702 // S25
701 aux = sqrt(compressed_spec_mat[i*10]*compressed_spec_mat[(i*30) + 28]);
703 aux = sqrt(compressed_spec_mat[i*10]*compressed_spec_mat[(i*30) + 28]);
702 compressed_spec_mat[(i*30) + 16] = compressed_spec_mat[(i*30) + 16] / aux;
704 compressed_spec_mat[(i*30) + 16] = compressed_spec_mat[(i*30) + 16] / aux;
703 compressed_spec_mat[(i*30) + 17] = compressed_spec_mat[(i*30) + 17] / aux;
705 compressed_spec_mat[(i*30) + 17] = compressed_spec_mat[(i*30) + 17] / aux;
704 // S34
706 // S34
705 aux = sqrt(compressed_spec_mat[i*18]*compressed_spec_mat[(i*30) + 24]);
707 aux = sqrt(compressed_spec_mat[i*18]*compressed_spec_mat[(i*30) + 24]);
706 compressed_spec_mat[(i*30) + 20] = compressed_spec_mat[(i*30) + 20] / aux;
708 compressed_spec_mat[(i*30) + 20] = compressed_spec_mat[(i*30) + 20] / aux;
707 compressed_spec_mat[(i*30) + 21] = compressed_spec_mat[(i*30) + 21] / aux;
709 compressed_spec_mat[(i*30) + 21] = compressed_spec_mat[(i*30) + 21] / aux;
708 // S35
710 // S35
709 aux = sqrt(compressed_spec_mat[i*18]*compressed_spec_mat[(i*30) + 28]);
711 aux = sqrt(compressed_spec_mat[i*18]*compressed_spec_mat[(i*30) + 28]);
710 compressed_spec_mat[(i*30) + 22] = compressed_spec_mat[(i*30) + 22] / aux;
712 compressed_spec_mat[(i*30) + 22] = compressed_spec_mat[(i*30) + 22] / aux;
711 compressed_spec_mat[(i*30) + 23] = compressed_spec_mat[(i*30) + 23] / aux;
713 compressed_spec_mat[(i*30) + 23] = compressed_spec_mat[(i*30) + 23] / aux;
712 }
714 }
713 }
715 }
714
716
715 void init_header_asm( Header_TM_LFR_SCIENCE_ASM_t *header)
717 void init_header_asm( Header_TM_LFR_SCIENCE_ASM_t *header)
716 {
718 {
717 header->targetLogicalAddress = CCSDS_DESTINATION_ID;
719 header->targetLogicalAddress = CCSDS_DESTINATION_ID;
718 header->protocolIdentifier = CCSDS_PROTOCOLE_ID;
720 header->protocolIdentifier = CCSDS_PROTOCOLE_ID;
719 header->reserved = 0x00;
721 header->reserved = 0x00;
720 header->userApplication = CCSDS_USER_APP;
722 header->userApplication = CCSDS_USER_APP;
721 header->packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
723 header->packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
722 header->packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
724 header->packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
723 header->packetSequenceControl[0] = 0xc0;
725 header->packetSequenceControl[0] = 0xc0;
724 header->packetSequenceControl[1] = 0x00;
726 header->packetSequenceControl[1] = 0x00;
725 header->packetLength[0] = 0x00;
727 header->packetLength[0] = 0x00;
726 header->packetLength[1] = 0x00;
728 header->packetLength[1] = 0x00;
727 // DATA FIELD HEADER
729 // DATA FIELD HEADER
728 header->spare1_pusVersion_spare2 = 0x10;
730 header->spare1_pusVersion_spare2 = 0x10;
729 header->serviceType = TM_TYPE_LFR_SCIENCE; // service type
731 header->serviceType = TM_TYPE_LFR_SCIENCE; // service type
730 header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
732 header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
731 header->destinationID = TM_DESTINATION_ID_GROUND;
733 header->destinationID = TM_DESTINATION_ID_GROUND;
732 // AUXILIARY DATA HEADER
734 // AUXILIARY DATA HEADER
733 header->sid = 0x00;
735 header->sid = 0x00;
734 header->biaStatusInfo = 0x00;
736 header->biaStatusInfo = 0x00;
735 header->pa_lfr_pkt_cnt_asm = 0x00;
737 header->pa_lfr_pkt_cnt_asm = 0x00;
736 header->pa_lfr_pkt_nr_asm = 0x00;
738 header->pa_lfr_pkt_nr_asm = 0x00;
737 header->time[0] = 0x00;
739 header->time[0] = 0x00;
738 header->time[0] = 0x00;
740 header->time[0] = 0x00;
739 header->time[0] = 0x00;
741 header->time[0] = 0x00;
740 header->time[0] = 0x00;
742 header->time[0] = 0x00;
741 header->time[0] = 0x00;
743 header->time[0] = 0x00;
742 header->time[0] = 0x00;
744 header->time[0] = 0x00;
743 header->pa_lfr_asm_blk_nr[0] = 0x00; // BLK_NR MSB
745 header->pa_lfr_asm_blk_nr[0] = 0x00; // BLK_NR MSB
744 header->pa_lfr_asm_blk_nr[1] = 0x00; // BLK_NR LSB
746 header->pa_lfr_asm_blk_nr[1] = 0x00; // BLK_NR LSB
745 }
747 }
746
748
747 void init_header_bp( Header_TM_LFR_SCIENCE_BP_t *header)
749 void init_header_bp( Header_TM_LFR_SCIENCE_BP_t *header)
748 {
750 {
749 header->targetLogicalAddress = CCSDS_DESTINATION_ID;
751 header->targetLogicalAddress = CCSDS_DESTINATION_ID;
750 header->protocolIdentifier = CCSDS_PROTOCOLE_ID;
752 header->protocolIdentifier = CCSDS_PROTOCOLE_ID;
751 header->reserved = 0x00;
753 header->reserved = 0x00;
752 header->userApplication = CCSDS_USER_APP;
754 header->userApplication = CCSDS_USER_APP;
753 // header->packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
755 // header->packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
754 // header->packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
756 // header->packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
755 header->packetSequenceControl[0] = 0xc0;
757 header->packetSequenceControl[0] = 0xc0;
756 header->packetSequenceControl[1] = 0x00;
758 header->packetSequenceControl[1] = 0x00;
757 header->packetLength[0] = 0x00;
759 header->packetLength[0] = 0x00;
758 header->packetLength[1] = 0x00;
760 header->packetLength[1] = 0x00;
759 // DATA FIELD HEADER
761 // DATA FIELD HEADER
760 header->spare1_pusVersion_spare2 = 0x10;
762 header->spare1_pusVersion_spare2 = 0x10;
761 header->serviceType = TM_TYPE_LFR_SCIENCE; // service type
763 header->serviceType = TM_TYPE_LFR_SCIENCE; // service type
762 header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
764 header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
763 header->destinationID = TM_DESTINATION_ID_GROUND;
765 header->destinationID = TM_DESTINATION_ID_GROUND;
764 // AUXILIARY DATA HEADER
766 // AUXILIARY DATA HEADER
765 header->sid = 0x00;
767 header->sid = 0x00;
766 header->biaStatusInfo = 0x00;
768 header->biaStatusInfo = 0x00;
767 header->time[0] = 0x00;
769 header->time[0] = 0x00;
768 header->time[0] = 0x00;
770 header->time[0] = 0x00;
769 header->time[0] = 0x00;
771 header->time[0] = 0x00;
770 header->time[0] = 0x00;
772 header->time[0] = 0x00;
771 header->time[0] = 0x00;
773 header->time[0] = 0x00;
772 header->time[0] = 0x00;
774 header->time[0] = 0x00;
773 header->pa_lfr_bp_blk_nr[0] = 0x00; // BLK_NR MSB
775 header->pa_lfr_bp_blk_nr[0] = 0x00; // BLK_NR MSB
774 header->pa_lfr_bp_blk_nr[1] = 0x00; // BLK_NR LSB
776 header->pa_lfr_bp_blk_nr[1] = 0x00; // BLK_NR LSB
775 }
777 }
776
778
777 void fill_averaged_spectral_matrix(void)
779 void fill_averaged_spectral_matrix(void)
778 {
780 {
779 /** This function fills spectral matrices related buffers with arbitrary data.
781 /** This function fills spectral matrices related buffers with arbitrary data.
780 *
782 *
781 * This function is for testing purpose only.
783 * This function is for testing purpose only.
782 *
784 *
783 */
785 */
784
786
785 float offset;
787 float offset;
786 float coeff;
788 float coeff;
787
789
788 offset = 10.;
790 offset = 10.;
789 coeff = 100000.;
791 coeff = 100000.;
790 averaged_sm_f0[ 0 + 25 * 0 ] = 0. + offset;
792 averaged_sm_f0[ 0 + 25 * 0 ] = 0. + offset;
791 averaged_sm_f0[ 0 + 25 * 1 ] = 1. + offset;
793 averaged_sm_f0[ 0 + 25 * 1 ] = 1. + offset;
792 averaged_sm_f0[ 0 + 25 * 2 ] = 2. + offset;
794 averaged_sm_f0[ 0 + 25 * 2 ] = 2. + offset;
793 averaged_sm_f0[ 0 + 25 * 3 ] = 3. + offset;
795 averaged_sm_f0[ 0 + 25 * 3 ] = 3. + offset;
794 averaged_sm_f0[ 0 + 25 * 4 ] = 4. + offset;
796 averaged_sm_f0[ 0 + 25 * 4 ] = 4. + offset;
795 averaged_sm_f0[ 0 + 25 * 5 ] = 5. + offset;
797 averaged_sm_f0[ 0 + 25 * 5 ] = 5. + offset;
796 averaged_sm_f0[ 0 + 25 * 6 ] = 6. + offset;
798 averaged_sm_f0[ 0 + 25 * 6 ] = 6. + offset;
797 averaged_sm_f0[ 0 + 25 * 7 ] = 7. + offset;
799 averaged_sm_f0[ 0 + 25 * 7 ] = 7. + offset;
798 averaged_sm_f0[ 0 + 25 * 8 ] = 8. + offset;
800 averaged_sm_f0[ 0 + 25 * 8 ] = 8. + offset;
799 averaged_sm_f0[ 0 + 25 * 9 ] = 9. + offset;
801 averaged_sm_f0[ 0 + 25 * 9 ] = 9. + offset;
800 averaged_sm_f0[ 0 + 25 * 10 ] = 10. + offset;
802 averaged_sm_f0[ 0 + 25 * 10 ] = 10. + offset;
801 averaged_sm_f0[ 0 + 25 * 11 ] = 11. + offset;
803 averaged_sm_f0[ 0 + 25 * 11 ] = 11. + offset;
802 averaged_sm_f0[ 0 + 25 * 12 ] = 12. + offset;
804 averaged_sm_f0[ 0 + 25 * 12 ] = 12. + offset;
803 averaged_sm_f0[ 0 + 25 * 13 ] = 13. + offset;
805 averaged_sm_f0[ 0 + 25 * 13 ] = 13. + offset;
804 averaged_sm_f0[ 0 + 25 * 14 ] = 14. + offset;
806 averaged_sm_f0[ 0 + 25 * 14 ] = 14. + offset;
805 averaged_sm_f0[ 9 + 25 * 0 ] = -(0. + offset)* coeff;
807 averaged_sm_f0[ 9 + 25 * 0 ] = -(0. + offset)* coeff;
806 averaged_sm_f0[ 9 + 25 * 1 ] = -(1. + offset)* coeff;
808 averaged_sm_f0[ 9 + 25 * 1 ] = -(1. + offset)* coeff;
807 averaged_sm_f0[ 9 + 25 * 2 ] = -(2. + offset)* coeff;
809 averaged_sm_f0[ 9 + 25 * 2 ] = -(2. + offset)* coeff;
808 averaged_sm_f0[ 9 + 25 * 3 ] = -(3. + offset)* coeff;
810 averaged_sm_f0[ 9 + 25 * 3 ] = -(3. + offset)* coeff;
809 averaged_sm_f0[ 9 + 25 * 4 ] = -(4. + offset)* coeff;
811 averaged_sm_f0[ 9 + 25 * 4 ] = -(4. + offset)* coeff;
810 averaged_sm_f0[ 9 + 25 * 5 ] = -(5. + offset)* coeff;
812 averaged_sm_f0[ 9 + 25 * 5 ] = -(5. + offset)* coeff;
811 averaged_sm_f0[ 9 + 25 * 6 ] = -(6. + offset)* coeff;
813 averaged_sm_f0[ 9 + 25 * 6 ] = -(6. + offset)* coeff;
812 averaged_sm_f0[ 9 + 25 * 7 ] = -(7. + offset)* coeff;
814 averaged_sm_f0[ 9 + 25 * 7 ] = -(7. + offset)* coeff;
813 averaged_sm_f0[ 9 + 25 * 8 ] = -(8. + offset)* coeff;
815 averaged_sm_f0[ 9 + 25 * 8 ] = -(8. + offset)* coeff;
814 averaged_sm_f0[ 9 + 25 * 9 ] = -(9. + offset)* coeff;
816 averaged_sm_f0[ 9 + 25 * 9 ] = -(9. + offset)* coeff;
815 averaged_sm_f0[ 9 + 25 * 10 ] = -(10. + offset)* coeff;
817 averaged_sm_f0[ 9 + 25 * 10 ] = -(10. + offset)* coeff;
816 averaged_sm_f0[ 9 + 25 * 11 ] = -(11. + offset)* coeff;
818 averaged_sm_f0[ 9 + 25 * 11 ] = -(11. + offset)* coeff;
817 averaged_sm_f0[ 9 + 25 * 12 ] = -(12. + offset)* coeff;
819 averaged_sm_f0[ 9 + 25 * 12 ] = -(12. + offset)* coeff;
818 averaged_sm_f0[ 9 + 25 * 13 ] = -(13. + offset)* coeff;
820 averaged_sm_f0[ 9 + 25 * 13 ] = -(13. + offset)* coeff;
819 averaged_sm_f0[ 9 + 25 * 14 ] = -(14. + offset)* coeff;
821 averaged_sm_f0[ 9 + 25 * 14 ] = -(14. + offset)* coeff;
820
822
821 offset = 10000000;
823 offset = 10000000;
822 averaged_sm_f0[ 16 + 25 * 0 ] = (0. + offset)* coeff;
824 averaged_sm_f0[ 16 + 25 * 0 ] = (0. + offset)* coeff;
823 averaged_sm_f0[ 16 + 25 * 1 ] = (1. + offset)* coeff;
825 averaged_sm_f0[ 16 + 25 * 1 ] = (1. + offset)* coeff;
824 averaged_sm_f0[ 16 + 25 * 2 ] = (2. + offset)* coeff;
826 averaged_sm_f0[ 16 + 25 * 2 ] = (2. + offset)* coeff;
825 averaged_sm_f0[ 16 + 25 * 3 ] = (3. + offset)* coeff;
827 averaged_sm_f0[ 16 + 25 * 3 ] = (3. + offset)* coeff;
826 averaged_sm_f0[ 16 + 25 * 4 ] = (4. + offset)* coeff;
828 averaged_sm_f0[ 16 + 25 * 4 ] = (4. + offset)* coeff;
827 averaged_sm_f0[ 16 + 25 * 5 ] = (5. + offset)* coeff;
829 averaged_sm_f0[ 16 + 25 * 5 ] = (5. + offset)* coeff;
828 averaged_sm_f0[ 16 + 25 * 6 ] = (6. + offset)* coeff;
830 averaged_sm_f0[ 16 + 25 * 6 ] = (6. + offset)* coeff;
829 averaged_sm_f0[ 16 + 25 * 7 ] = (7. + offset)* coeff;
831 averaged_sm_f0[ 16 + 25 * 7 ] = (7. + offset)* coeff;
830 averaged_sm_f0[ 16 + 25 * 8 ] = (8. + offset)* coeff;
832 averaged_sm_f0[ 16 + 25 * 8 ] = (8. + offset)* coeff;
831 averaged_sm_f0[ 16 + 25 * 9 ] = (9. + offset)* coeff;
833 averaged_sm_f0[ 16 + 25 * 9 ] = (9. + offset)* coeff;
832 averaged_sm_f0[ 16 + 25 * 10 ] = (10. + offset)* coeff;
834 averaged_sm_f0[ 16 + 25 * 10 ] = (10. + offset)* coeff;
833 averaged_sm_f0[ 16 + 25 * 11 ] = (11. + offset)* coeff;
835 averaged_sm_f0[ 16 + 25 * 11 ] = (11. + offset)* coeff;
834 averaged_sm_f0[ 16 + 25 * 12 ] = (12. + offset)* coeff;
836 averaged_sm_f0[ 16 + 25 * 12 ] = (12. + offset)* coeff;
835 averaged_sm_f0[ 16 + 25 * 13 ] = (13. + offset)* coeff;
837 averaged_sm_f0[ 16 + 25 * 13 ] = (13. + offset)* coeff;
836 averaged_sm_f0[ 16 + 25 * 14 ] = (14. + offset)* coeff;
838 averaged_sm_f0[ 16 + 25 * 14 ] = (14. + offset)* coeff;
837
839
838 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 0 ] = averaged_sm_f0[ 0 ];
840 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 0 ] = averaged_sm_f0[ 0 ];
839 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 1 ] = averaged_sm_f0[ 1 ];
841 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 1 ] = averaged_sm_f0[ 1 ];
840 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 2 ] = averaged_sm_f0[ 2 ];
842 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 2 ] = averaged_sm_f0[ 2 ];
841 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 3 ] = averaged_sm_f0[ 3 ];
843 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 3 ] = averaged_sm_f0[ 3 ];
842 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 4 ] = averaged_sm_f0[ 4 ];
844 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 4 ] = averaged_sm_f0[ 4 ];
843 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 5 ] = averaged_sm_f0[ 5 ];
845 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 5 ] = averaged_sm_f0[ 5 ];
844 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 6 ] = averaged_sm_f0[ 6 ];
846 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 6 ] = averaged_sm_f0[ 6 ];
845 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 7 ] = averaged_sm_f0[ 7 ];
847 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 7 ] = averaged_sm_f0[ 7 ];
846 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 8 ] = averaged_sm_f0[ 8 ];
848 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 8 ] = averaged_sm_f0[ 8 ];
847 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 9 ] = averaged_sm_f0[ 9 ];
849 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 9 ] = averaged_sm_f0[ 9 ];
848 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 10 ] = averaged_sm_f0[ 10 ];
850 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 10 ] = averaged_sm_f0[ 10 ];
849 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 11 ] = averaged_sm_f0[ 11 ];
851 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 11 ] = averaged_sm_f0[ 11 ];
850 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 12 ] = averaged_sm_f0[ 12 ];
852 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 12 ] = averaged_sm_f0[ 12 ];
851 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 13 ] = averaged_sm_f0[ 13 ];
853 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 13 ] = averaged_sm_f0[ 13 ];
852 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 14 ] = averaged_sm_f0[ 14 ];
854 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 14 ] = averaged_sm_f0[ 14 ];
853 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 15 ] = averaged_sm_f0[ 15 ];
855 averaged_sm_f0[ (TOTAL_SIZE_SM/2) + 15 ] = averaged_sm_f0[ 15 ];
854 }
856 }
855
857
856 void reset_spectral_matrix_regs()
858 void reset_spectral_matrix_regs()
857 {
859 {
858 /** This function resets the spectral matrices module registers.
860 /** This function resets the spectral matrices module registers.
859 *
861 *
860 * The registers affected by this function are located at the following offset addresses:
862 * The registers affected by this function are located at the following offset addresses:
861 *
863 *
862 * - 0x00 config
864 * - 0x00 config
863 * - 0x04 status
865 * - 0x04 status
864 * - 0x08 matrixF0_Address0
866 * - 0x08 matrixF0_Address0
865 * - 0x10 matrixFO_Address1
867 * - 0x10 matrixFO_Address1
866 * - 0x14 matrixF1_Address
868 * - 0x14 matrixF1_Address
867 * - 0x18 matrixF2_Address
869 * - 0x18 matrixF2_Address
868 *
870 *
869 */
871 */
870
872
871 spectral_matrix_regs->config = 0x00;
873 spectral_matrix_regs->config = 0x00;
872 spectral_matrix_regs->status = 0x00;
874 spectral_matrix_regs->status = 0x00;
873
875
874 spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address;
876 spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address;
875 spectral_matrix_regs->matrixFO_Address1 = current_ring_node_sm_f0->buffer_address;
877 spectral_matrix_regs->matrixFO_Address1 = current_ring_node_sm_f0->buffer_address;
876 spectral_matrix_regs->matrixF1_Address = current_ring_node_sm_f1->buffer_address;
878 spectral_matrix_regs->matrixF1_Address = current_ring_node_sm_f1->buffer_address;
877 spectral_matrix_regs->matrixF2_Address = current_ring_node_sm_f2->buffer_address;
879 spectral_matrix_regs->matrixF2_Address = current_ring_node_sm_f2->buffer_address;
878 }
880 }
879
881
880 //******************
882 //******************
881 // general functions
883 // general functions
882
884
883
885
884
886
885
887
@@ -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
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