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