##// END OF EJS Templates
snapshot extraction for the waveform ring is operational...
paul -
r105:ecfd2ffe3033 VHDLib206
parent child
Show More
@@ -1,253 +1,253
1 #############################################################################
1 #############################################################################
2 # Makefile for building: bin/fsw
2 # Makefile for building: bin/fsw
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Tue Mar 4 09:15:37 2014
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Tue Mar 4 13:06:39 2014
4 # Project: fsw-qt.pro
4 # Project: fsw-qt.pro
5 # Template: app
5 # Template: app
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
7 #############################################################################
7 #############################################################################
8
8
9 ####### Compiler, tools and options
9 ####### Compiler, tools and options
10
10
11 CC = sparc-rtems-gcc
11 CC = sparc-rtems-gcc
12 CXX = sparc-rtems-g++
12 CXX = sparc-rtems-g++
13 DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=2 -DPRINT_MESSAGES_ON_CONSOLE -DDEBUG_MESSAGES
13 DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=3 -DPRINT_MESSAGES_ON_CONSOLE
14 CFLAGS = -pipe -O3 -Wall $(DEFINES)
14 CFLAGS = -pipe -O3 -Wall $(DEFINES)
15 CXXFLAGS = -pipe -O3 -Wall $(DEFINES)
15 CXXFLAGS = -pipe -O3 -Wall $(DEFINES)
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../../LFR_basic-parameters
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../../LFR_basic-parameters
17 LINK = sparc-rtems-g++
17 LINK = sparc-rtems-g++
18 LFLAGS =
18 LFLAGS =
19 LIBS = $(SUBLIBS)
19 LIBS = $(SUBLIBS)
20 AR = sparc-rtems-ar rcs
20 AR = sparc-rtems-ar rcs
21 RANLIB =
21 RANLIB =
22 QMAKE = /usr/bin/qmake-qt4
22 QMAKE = /usr/bin/qmake-qt4
23 TAR = tar -cf
23 TAR = tar -cf
24 COMPRESS = gzip -9f
24 COMPRESS = gzip -9f
25 COPY = cp -f
25 COPY = cp -f
26 SED = sed
26 SED = sed
27 COPY_FILE = $(COPY)
27 COPY_FILE = $(COPY)
28 COPY_DIR = $(COPY) -r
28 COPY_DIR = $(COPY) -r
29 STRIP = sparc-rtems-strip
29 STRIP = sparc-rtems-strip
30 INSTALL_FILE = install -m 644 -p
30 INSTALL_FILE = install -m 644 -p
31 INSTALL_DIR = $(COPY_DIR)
31 INSTALL_DIR = $(COPY_DIR)
32 INSTALL_PROGRAM = install -m 755 -p
32 INSTALL_PROGRAM = install -m 755 -p
33 DEL_FILE = rm -f
33 DEL_FILE = rm -f
34 SYMLINK = ln -f -s
34 SYMLINK = ln -f -s
35 DEL_DIR = rmdir
35 DEL_DIR = rmdir
36 MOVE = mv -f
36 MOVE = mv -f
37 CHK_DIR_EXISTS= test -d
37 CHK_DIR_EXISTS= test -d
38 MKDIR = mkdir -p
38 MKDIR = mkdir -p
39
39
40 ####### Output directory
40 ####### Output directory
41
41
42 OBJECTS_DIR = obj/
42 OBJECTS_DIR = obj/
43
43
44 ####### Files
44 ####### Files
45
45
46 SOURCES = ../src/wf_handler.c \
46 SOURCES = ../src/wf_handler.c \
47 ../src/tc_handler.c \
47 ../src/tc_handler.c \
48 ../src/fsw_processing.c \
48 ../src/fsw_processing.c \
49 ../src/fsw_misc.c \
49 ../src/fsw_misc.c \
50 ../src/fsw_init.c \
50 ../src/fsw_init.c \
51 ../src/fsw_globals.c \
51 ../src/fsw_globals.c \
52 ../src/fsw_spacewire.c \
52 ../src/fsw_spacewire.c \
53 ../src/tc_load_dump_parameters.c \
53 ../src/tc_load_dump_parameters.c \
54 ../src/tm_lfr_tc_exe.c \
54 ../src/tm_lfr_tc_exe.c \
55 ../src/tc_acceptance.c \
55 ../src/tc_acceptance.c \
56 ../../LFR_basic-parameters/basic_parameters.c
56 ../../LFR_basic-parameters/basic_parameters.c
57 OBJECTS = obj/wf_handler.o \
57 OBJECTS = obj/wf_handler.o \
58 obj/tc_handler.o \
58 obj/tc_handler.o \
59 obj/fsw_processing.o \
59 obj/fsw_processing.o \
60 obj/fsw_misc.o \
60 obj/fsw_misc.o \
61 obj/fsw_init.o \
61 obj/fsw_init.o \
62 obj/fsw_globals.o \
62 obj/fsw_globals.o \
63 obj/fsw_spacewire.o \
63 obj/fsw_spacewire.o \
64 obj/tc_load_dump_parameters.o \
64 obj/tc_load_dump_parameters.o \
65 obj/tm_lfr_tc_exe.o \
65 obj/tm_lfr_tc_exe.o \
66 obj/tc_acceptance.o \
66 obj/tc_acceptance.o \
67 obj/basic_parameters.o
67 obj/basic_parameters.o
68 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
68 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
69 /usr/lib64/qt4/mkspecs/common/linux.conf \
69 /usr/lib64/qt4/mkspecs/common/linux.conf \
70 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
70 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
71 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
71 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
72 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
72 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
73 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
73 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
74 /usr/lib64/qt4/mkspecs/qconfig.pri \
74 /usr/lib64/qt4/mkspecs/qconfig.pri \
75 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
75 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
76 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
76 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
77 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
77 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
78 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
78 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
79 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
79 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
80 sparc.pri \
80 sparc.pri \
81 /usr/lib64/qt4/mkspecs/features/release.prf \
81 /usr/lib64/qt4/mkspecs/features/release.prf \
82 /usr/lib64/qt4/mkspecs/features/default_post.prf \
82 /usr/lib64/qt4/mkspecs/features/default_post.prf \
83 /usr/lib64/qt4/mkspecs/features/shared.prf \
83 /usr/lib64/qt4/mkspecs/features/shared.prf \
84 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
84 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
85 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
85 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
86 /usr/lib64/qt4/mkspecs/features/resources.prf \
86 /usr/lib64/qt4/mkspecs/features/resources.prf \
87 /usr/lib64/qt4/mkspecs/features/uic.prf \
87 /usr/lib64/qt4/mkspecs/features/uic.prf \
88 /usr/lib64/qt4/mkspecs/features/yacc.prf \
88 /usr/lib64/qt4/mkspecs/features/yacc.prf \
89 /usr/lib64/qt4/mkspecs/features/lex.prf \
89 /usr/lib64/qt4/mkspecs/features/lex.prf \
90 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
90 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
91 fsw-qt.pro
91 fsw-qt.pro
92 QMAKE_TARGET = fsw
92 QMAKE_TARGET = fsw
93 DESTDIR = bin/
93 DESTDIR = bin/
94 TARGET = bin/fsw
94 TARGET = bin/fsw
95
95
96 first: all
96 first: all
97 ####### Implicit rules
97 ####### Implicit rules
98
98
99 .SUFFIXES: .o .c .cpp .cc .cxx .C
99 .SUFFIXES: .o .c .cpp .cc .cxx .C
100
100
101 .cpp.o:
101 .cpp.o:
102 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
102 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
103
103
104 .cc.o:
104 .cc.o:
105 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
105 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
106
106
107 .cxx.o:
107 .cxx.o:
108 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
108 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
109
109
110 .C.o:
110 .C.o:
111 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
111 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
112
112
113 .c.o:
113 .c.o:
114 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
114 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
115
115
116 ####### Build rules
116 ####### Build rules
117
117
118 all: Makefile $(TARGET)
118 all: Makefile $(TARGET)
119
119
120 $(TARGET): $(OBJECTS)
120 $(TARGET): $(OBJECTS)
121 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
121 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
122 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
122 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
123
123
124 Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
124 Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
125 /usr/lib64/qt4/mkspecs/common/linux.conf \
125 /usr/lib64/qt4/mkspecs/common/linux.conf \
126 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
126 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
127 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
127 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
128 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
128 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
129 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
129 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
130 /usr/lib64/qt4/mkspecs/qconfig.pri \
130 /usr/lib64/qt4/mkspecs/qconfig.pri \
131 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
131 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
132 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
132 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
133 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
133 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
134 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
134 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
135 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
135 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
136 sparc.pri \
136 sparc.pri \
137 /usr/lib64/qt4/mkspecs/features/release.prf \
137 /usr/lib64/qt4/mkspecs/features/release.prf \
138 /usr/lib64/qt4/mkspecs/features/default_post.prf \
138 /usr/lib64/qt4/mkspecs/features/default_post.prf \
139 /usr/lib64/qt4/mkspecs/features/shared.prf \
139 /usr/lib64/qt4/mkspecs/features/shared.prf \
140 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
140 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
141 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
141 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
142 /usr/lib64/qt4/mkspecs/features/resources.prf \
142 /usr/lib64/qt4/mkspecs/features/resources.prf \
143 /usr/lib64/qt4/mkspecs/features/uic.prf \
143 /usr/lib64/qt4/mkspecs/features/uic.prf \
144 /usr/lib64/qt4/mkspecs/features/yacc.prf \
144 /usr/lib64/qt4/mkspecs/features/yacc.prf \
145 /usr/lib64/qt4/mkspecs/features/lex.prf \
145 /usr/lib64/qt4/mkspecs/features/lex.prf \
146 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf
146 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf
147 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
147 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
148 /usr/lib64/qt4/mkspecs/common/unix.conf:
148 /usr/lib64/qt4/mkspecs/common/unix.conf:
149 /usr/lib64/qt4/mkspecs/common/linux.conf:
149 /usr/lib64/qt4/mkspecs/common/linux.conf:
150 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
150 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
151 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
151 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
152 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
152 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
153 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
153 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
154 /usr/lib64/qt4/mkspecs/qconfig.pri:
154 /usr/lib64/qt4/mkspecs/qconfig.pri:
155 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
155 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
156 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
156 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
157 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
157 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
158 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
158 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
159 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
159 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
160 sparc.pri:
160 sparc.pri:
161 /usr/lib64/qt4/mkspecs/features/release.prf:
161 /usr/lib64/qt4/mkspecs/features/release.prf:
162 /usr/lib64/qt4/mkspecs/features/default_post.prf:
162 /usr/lib64/qt4/mkspecs/features/default_post.prf:
163 /usr/lib64/qt4/mkspecs/features/shared.prf:
163 /usr/lib64/qt4/mkspecs/features/shared.prf:
164 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
164 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
165 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
165 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
166 /usr/lib64/qt4/mkspecs/features/resources.prf:
166 /usr/lib64/qt4/mkspecs/features/resources.prf:
167 /usr/lib64/qt4/mkspecs/features/uic.prf:
167 /usr/lib64/qt4/mkspecs/features/uic.prf:
168 /usr/lib64/qt4/mkspecs/features/yacc.prf:
168 /usr/lib64/qt4/mkspecs/features/yacc.prf:
169 /usr/lib64/qt4/mkspecs/features/lex.prf:
169 /usr/lib64/qt4/mkspecs/features/lex.prf:
170 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
170 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
171 qmake: FORCE
171 qmake: FORCE
172 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
172 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
173
173
174 dist:
174 dist:
175 @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0
175 @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0
176 $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw1.0.0/ && (cd `dirname obj/fsw1.0.0` && $(TAR) fsw1.0.0.tar fsw1.0.0 && $(COMPRESS) fsw1.0.0.tar) && $(MOVE) `dirname obj/fsw1.0.0`/fsw1.0.0.tar.gz . && $(DEL_FILE) -r obj/fsw1.0.0
176 $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw1.0.0/ && (cd `dirname obj/fsw1.0.0` && $(TAR) fsw1.0.0.tar fsw1.0.0 && $(COMPRESS) fsw1.0.0.tar) && $(MOVE) `dirname obj/fsw1.0.0`/fsw1.0.0.tar.gz . && $(DEL_FILE) -r obj/fsw1.0.0
177
177
178
178
179 clean:compiler_clean
179 clean:compiler_clean
180 -$(DEL_FILE) $(OBJECTS)
180 -$(DEL_FILE) $(OBJECTS)
181 -$(DEL_FILE) *~ core *.core
181 -$(DEL_FILE) *~ core *.core
182
182
183
183
184 ####### Sub-libraries
184 ####### Sub-libraries
185
185
186 distclean: clean
186 distclean: clean
187 -$(DEL_FILE) $(TARGET)
187 -$(DEL_FILE) $(TARGET)
188 -$(DEL_FILE) Makefile
188 -$(DEL_FILE) Makefile
189
189
190
190
191 grmon:
191 grmon:
192 cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u
192 cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u
193
193
194 check: first
194 check: first
195
195
196 compiler_rcc_make_all:
196 compiler_rcc_make_all:
197 compiler_rcc_clean:
197 compiler_rcc_clean:
198 compiler_uic_make_all:
198 compiler_uic_make_all:
199 compiler_uic_clean:
199 compiler_uic_clean:
200 compiler_image_collection_make_all: qmake_image_collection.cpp
200 compiler_image_collection_make_all: qmake_image_collection.cpp
201 compiler_image_collection_clean:
201 compiler_image_collection_clean:
202 -$(DEL_FILE) qmake_image_collection.cpp
202 -$(DEL_FILE) qmake_image_collection.cpp
203 compiler_yacc_decl_make_all:
203 compiler_yacc_decl_make_all:
204 compiler_yacc_decl_clean:
204 compiler_yacc_decl_clean:
205 compiler_yacc_impl_make_all:
205 compiler_yacc_impl_make_all:
206 compiler_yacc_impl_clean:
206 compiler_yacc_impl_clean:
207 compiler_lex_make_all:
207 compiler_lex_make_all:
208 compiler_lex_clean:
208 compiler_lex_clean:
209 compiler_clean:
209 compiler_clean:
210
210
211 ####### Compile
211 ####### Compile
212
212
213 obj/wf_handler.o: ../src/wf_handler.c
213 obj/wf_handler.o: ../src/wf_handler.c
214 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c
214 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c
215
215
216 obj/tc_handler.o: ../src/tc_handler.c
216 obj/tc_handler.o: ../src/tc_handler.c
217 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c
217 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c
218
218
219 obj/fsw_processing.o: ../src/fsw_processing.c ../src/fsw_processing_globals.c
219 obj/fsw_processing.o: ../src/fsw_processing.c ../src/fsw_processing_globals.c
220 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c
220 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c
221
221
222 obj/fsw_misc.o: ../src/fsw_misc.c
222 obj/fsw_misc.o: ../src/fsw_misc.c
223 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c
223 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c
224
224
225 obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c
225 obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c
226 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c
226 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c
227
227
228 obj/fsw_globals.o: ../src/fsw_globals.c
228 obj/fsw_globals.o: ../src/fsw_globals.c
229 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c
229 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c
230
230
231 obj/fsw_spacewire.o: ../src/fsw_spacewire.c
231 obj/fsw_spacewire.o: ../src/fsw_spacewire.c
232 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c
232 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c
233
233
234 obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c
234 obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c
235 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c
235 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c
236
236
237 obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c
237 obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c
238 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c
238 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c
239
239
240 obj/tc_acceptance.o: ../src/tc_acceptance.c
240 obj/tc_acceptance.o: ../src/tc_acceptance.c
241 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c
241 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c
242
242
243 obj/basic_parameters.o: ../../LFR_basic-parameters/basic_parameters.c ../../LFR_basic-parameters/basic_parameters.h
243 obj/basic_parameters.o: ../../LFR_basic-parameters/basic_parameters.c ../../LFR_basic-parameters/basic_parameters.h
244 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/basic_parameters.o ../../LFR_basic-parameters/basic_parameters.c
244 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/basic_parameters.o ../../LFR_basic-parameters/basic_parameters.c
245
245
246 ####### Install
246 ####### Install
247
247
248 install: FORCE
248 install: FORCE
249
249
250 uninstall: FORCE
250 uninstall: FORCE
251
251
252 FORCE:
252 FORCE:
253
253
@@ -1,77 +1,77
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
3 # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report
4 CONFIG += console verbose debug_messages
4 CONFIG += console verbose
5 CONFIG -= qt
5 CONFIG -= qt
6
6
7 include(./sparc.pri)
7 include(./sparc.pri)
8
8
9 # flight software version
9 # flight software version
10 SWVERSION=-1-0
10 SWVERSION=-1-0
11 DEFINES += SW_VERSION_N1=1 # major
11 DEFINES += SW_VERSION_N1=1 # major
12 DEFINES += SW_VERSION_N2=0 # minor
12 DEFINES += SW_VERSION_N2=0 # minor
13 DEFINES += SW_VERSION_N3=0 # patch
13 DEFINES += SW_VERSION_N3=0 # patch
14 DEFINES += SW_VERSION_N4=2 # internal
14 DEFINES += SW_VERSION_N4=3 # 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
41
42 INCLUDEPATH += \
42 INCLUDEPATH += \
43 ../src \
43 ../src \
44 ../header \
44 ../header \
45 ../../LFR_basic-parameters
45 ../../LFR_basic-parameters
46
46
47 SOURCES += \
47 SOURCES += \
48 ../src/wf_handler.c \
48 ../src/wf_handler.c \
49 ../src/tc_handler.c \
49 ../src/tc_handler.c \
50 ../src/fsw_processing.c \
50 ../src/fsw_processing.c \
51 ../src/fsw_misc.c \
51 ../src/fsw_misc.c \
52 ../src/fsw_init.c \
52 ../src/fsw_init.c \
53 ../src/fsw_globals.c \
53 ../src/fsw_globals.c \
54 ../src/fsw_spacewire.c \
54 ../src/fsw_spacewire.c \
55 ../src/tc_load_dump_parameters.c \
55 ../src/tc_load_dump_parameters.c \
56 ../src/tm_lfr_tc_exe.c \
56 ../src/tm_lfr_tc_exe.c \
57 ../src/tc_acceptance.c \
57 ../src/tc_acceptance.c \
58 ../../LFR_basic-parameters/basic_parameters.c
58 ../../LFR_basic-parameters/basic_parameters.c
59
59
60
60
61 HEADERS += \
61 HEADERS += \
62 ../header/wf_handler.h \
62 ../header/wf_handler.h \
63 ../header/tc_handler.h \
63 ../header/tc_handler.h \
64 ../header/grlib_regs.h \
64 ../header/grlib_regs.h \
65 ../header/fsw_processing.h \
65 ../header/fsw_processing.h \
66 ../header/fsw_params.h \
66 ../header/fsw_params.h \
67 ../header/fsw_misc.h \
67 ../header/fsw_misc.h \
68 ../header/fsw_init.h \
68 ../header/fsw_init.h \
69 ../header/ccsds_types.h \
69 ../header/ccsds_types.h \
70 ../header/fsw_params_processing.h \
70 ../header/fsw_params_processing.h \
71 ../header/fsw_spacewire.h \
71 ../header/fsw_spacewire.h \
72 ../header/tc_load_dump_parameters.h \
72 ../header/tc_load_dump_parameters.h \
73 ../header/tm_lfr_tc_exe.h \
73 ../header/tm_lfr_tc_exe.h \
74 ../header/tc_acceptance.h \
74 ../header/tc_acceptance.h \
75 ../header/fsw_params_nb_bytes.h \
75 ../header/fsw_params_nb_bytes.h \
76 ../../LFR_basic-parameters/basic_parameters.h
76 ../../LFR_basic-parameters/basic_parameters.h
77
77
@@ -1,339 +1,339
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE QtCreatorProject>
2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by QtCreator 3.0.0, 2014-03-04T07:03:18. -->
3 <!-- Written by QtCreator 3.0.0, 2014-03-06T15:56:18. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
7 <value type="int">1</value>
7 <value type="int">1</value>
8 </data>
8 </data>
9 <data>
9 <data>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
11 <valuemap type="QVariantMap">
11 <valuemap type="QVariantMap">
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
14 <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
14 <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
15 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
15 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
16 <value type="QString" key="language">Cpp</value>
16 <value type="QString" key="language">Cpp</value>
17 <valuemap type="QVariantMap" key="value">
17 <valuemap type="QVariantMap" key="value">
18 <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
18 <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
19 </valuemap>
19 </valuemap>
20 </valuemap>
20 </valuemap>
21 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
21 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
22 <value type="QString" key="language">QmlJS</value>
22 <value type="QString" key="language">QmlJS</value>
23 <valuemap type="QVariantMap" key="value">
23 <valuemap type="QVariantMap" key="value">
24 <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
24 <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
25 </valuemap>
25 </valuemap>
26 </valuemap>
26 </valuemap>
27 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
27 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
28 <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
28 <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
29 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
29 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
30 <value type="int" key="EditorConfiguration.IndentSize">4</value>
30 <value type="int" key="EditorConfiguration.IndentSize">4</value>
31 <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
31 <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
32 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
32 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
33 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
33 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
34 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
34 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
35 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
35 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
36 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
36 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
37 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
37 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
38 <value type="int" key="EditorConfiguration.TabSize">8</value>
38 <value type="int" key="EditorConfiguration.TabSize">8</value>
39 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
39 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
40 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
40 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
41 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
41 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
42 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
42 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
43 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
43 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
44 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
44 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
45 </valuemap>
45 </valuemap>
46 </data>
46 </data>
47 <data>
47 <data>
48 <variable>ProjectExplorer.Project.PluginSettings</variable>
48 <variable>ProjectExplorer.Project.PluginSettings</variable>
49 <valuemap type="QVariantMap"/>
49 <valuemap type="QVariantMap"/>
50 </data>
50 </data>
51 <data>
51 <data>
52 <variable>ProjectExplorer.Project.Target.0</variable>
52 <variable>ProjectExplorer.Project.Target.0</variable>
53 <valuemap type="QVariantMap">
53 <valuemap type="QVariantMap">
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
55 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
55 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
56 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{e04e3924-0bd8-4708-be18-f1474e45608e}</value>
56 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{e04e3924-0bd8-4708-be18-f1474e45608e}</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
58 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
58 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
59 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
59 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
60 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
60 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
61 <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value>
61 <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value>
62 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
62 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
63 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
63 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
64 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
64 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
65 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
65 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
66 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
66 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
67 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
67 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
68 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
68 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
69 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
69 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
70 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
70 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
71 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
71 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
72 </valuemap>
72 </valuemap>
73 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
73 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
74 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
74 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
75 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
75 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
76 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
76 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
77 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
77 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
78 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
78 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
79 <value type="QString">-w</value>
79 <value type="QString">-w</value>
80 <value type="QString">-r</value>
80 <value type="QString">-r</value>
81 </valuelist>
81 </valuelist>
82 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
82 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
83 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
83 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
84 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
84 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
85 </valuemap>
85 </valuemap>
86 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
86 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
88 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
88 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
89 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
89 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
90 </valuemap>
90 </valuemap>
91 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
91 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
92 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
92 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
93 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
93 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
96 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
96 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
97 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
97 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
98 <value type="QString">-w</value>
98 <value type="QString">-w</value>
99 <value type="QString">-r</value>
99 <value type="QString">-r</value>
100 </valuelist>
100 </valuelist>
101 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
101 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
102 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
102 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
103 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
103 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
104 </valuemap>
104 </valuemap>
105 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
105 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
106 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
106 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
107 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
107 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
108 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
108 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
109 </valuemap>
109 </valuemap>
110 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
110 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
111 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
111 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
112 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
112 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
115 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
115 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
116 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
116 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
117 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
117 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
118 </valuemap>
118 </valuemap>
119 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
119 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
120 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
120 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
121 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
121 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
122 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
122 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
124 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
124 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
125 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
125 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
126 </valuemap>
126 </valuemap>
127 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
127 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
128 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
128 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
129 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
129 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
130 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
130 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
131 </valuemap>
131 </valuemap>
132 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
132 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
133 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
133 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
134 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
134 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
135 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
135 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
136 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
136 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
137 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
137 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
138 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
138 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
139 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
139 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
140 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
140 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
141 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
141 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
142 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
142 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
143 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
143 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
144 <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
144 <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
145 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
145 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
146 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
146 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
147 <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
147 <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
148 <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
148 <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
149 <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
149 <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
150 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
150 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
151 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
151 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
152 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
152 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
153 <value type="int">0</value>
153 <value type="int">0</value>
154 <value type="int">1</value>
154 <value type="int">1</value>
155 <value type="int">2</value>
155 <value type="int">2</value>
156 <value type="int">3</value>
156 <value type="int">3</value>
157 <value type="int">4</value>
157 <value type="int">4</value>
158 <value type="int">5</value>
158 <value type="int">5</value>
159 <value type="int">6</value>
159 <value type="int">6</value>
160 <value type="int">7</value>
160 <value type="int">7</value>
161 <value type="int">8</value>
161 <value type="int">8</value>
162 <value type="int">9</value>
162 <value type="int">9</value>
163 <value type="int">10</value>
163 <value type="int">10</value>
164 <value type="int">11</value>
164 <value type="int">11</value>
165 <value type="int">12</value>
165 <value type="int">12</value>
166 <value type="int">13</value>
166 <value type="int">13</value>
167 <value type="int">14</value>
167 <value type="int">14</value>
168 </valuelist>
168 </valuelist>
169 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
169 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
170 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
170 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
171 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
171 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
172 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
172 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
173 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
173 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
174 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
174 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
175 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
175 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
176 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
176 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
177 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
177 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
178 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
178 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
179 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
179 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
180 <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
180 <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
181 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
181 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
182 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
182 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
183 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
183 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
184 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
184 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
185 </valuemap>
185 </valuemap>
186 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
186 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
187 </valuemap>
187 </valuemap>
188 </data>
188 </data>
189 <data>
189 <data>
190 <variable>ProjectExplorer.Project.Target.1</variable>
190 <variable>ProjectExplorer.Project.Target.1</variable>
191 <valuemap type="QVariantMap">
191 <valuemap type="QVariantMap">
192 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
192 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
193 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
193 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
194 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value>
194 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value>
195 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
195 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
196 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
196 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
197 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
197 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
198 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
198 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
199 <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value>
199 <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value>
200 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
200 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
201 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
201 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
202 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
202 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
203 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
203 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
204 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
204 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
205 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
205 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
206 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
206 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
207 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
207 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value>
208 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
208 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
209 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
209 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
210 </valuemap>
210 </valuemap>
211 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
211 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
212 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
212 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
213 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
213 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
214 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
214 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
215 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
215 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
216 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
216 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
217 <value type="QString">-w</value>
217 <value type="QString">-w</value>
218 <value type="QString">-r</value>
218 <value type="QString">-r</value>
219 </valuelist>
219 </valuelist>
220 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
220 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
221 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
221 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
222 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
222 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
223 </valuemap>
223 </valuemap>
224 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
224 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
225 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
225 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
226 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
226 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
227 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
227 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
228 </valuemap>
228 </valuemap>
229 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
229 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
230 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
230 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
231 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
231 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
232 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
232 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
233 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
233 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
234 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
234 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
235 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
235 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
236 <value type="QString">-w</value>
236 <value type="QString">-w</value>
237 <value type="QString">-r</value>
237 <value type="QString">-r</value>
238 </valuelist>
238 </valuelist>
239 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
239 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
240 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
240 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
241 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
241 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
242 </valuemap>
242 </valuemap>
243 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
243 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
244 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
244 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
245 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
245 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
246 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
246 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
247 </valuemap>
247 </valuemap>
248 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
248 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
249 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
249 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
250 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
250 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
251 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
251 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
252 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
252 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
253 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
253 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
254 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
254 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
255 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
255 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
256 </valuemap>
256 </valuemap>
257 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
257 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
258 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
258 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
259 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
259 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
260 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
260 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
261 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
261 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
262 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
262 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
263 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
263 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
264 </valuemap>
264 </valuemap>
265 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
265 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
266 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
266 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
267 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
267 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
268 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
268 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
269 </valuemap>
269 </valuemap>
270 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
270 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
271 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
271 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
272 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
272 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
273 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
273 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
274 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
274 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
275 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
275 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
276 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
276 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
277 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
277 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
278 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
278 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
279 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
279 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
280 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
280 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
281 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
281 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
282 <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
282 <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
283 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
283 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
284 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
284 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
285 <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
285 <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
286 <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
286 <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
287 <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
287 <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
288 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
288 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
289 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
289 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
290 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
290 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
291 <value type="int">0</value>
291 <value type="int">0</value>
292 <value type="int">1</value>
292 <value type="int">1</value>
293 <value type="int">2</value>
293 <value type="int">2</value>
294 <value type="int">3</value>
294 <value type="int">3</value>
295 <value type="int">4</value>
295 <value type="int">4</value>
296 <value type="int">5</value>
296 <value type="int">5</value>
297 <value type="int">6</value>
297 <value type="int">6</value>
298 <value type="int">7</value>
298 <value type="int">7</value>
299 <value type="int">8</value>
299 <value type="int">8</value>
300 <value type="int">9</value>
300 <value type="int">9</value>
301 <value type="int">10</value>
301 <value type="int">10</value>
302 <value type="int">11</value>
302 <value type="int">11</value>
303 <value type="int">12</value>
303 <value type="int">12</value>
304 <value type="int">13</value>
304 <value type="int">13</value>
305 <value type="int">14</value>
305 <value type="int">14</value>
306 </valuelist>
306 </valuelist>
307 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
307 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
308 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
308 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
309 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
309 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
310 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
310 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
311 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
311 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
312 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
312 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
313 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
313 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
314 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
314 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
315 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
315 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
316 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
316 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
317 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
317 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
318 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
318 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
319 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
319 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
320 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
320 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
321 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
321 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
322 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
322 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
323 </valuemap>
323 </valuemap>
324 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
324 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
325 </valuemap>
325 </valuemap>
326 </data>
326 </data>
327 <data>
327 <data>
328 <variable>ProjectExplorer.Project.TargetCount</variable>
328 <variable>ProjectExplorer.Project.TargetCount</variable>
329 <value type="int">2</value>
329 <value type="int">2</value>
330 </data>
330 </data>
331 <data>
331 <data>
332 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
332 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
333 <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
333 <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
334 </data>
334 </data>
335 <data>
335 <data>
336 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
336 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
337 <value type="int">15</value>
337 <value type="int">15</value>
338 </data>
338 </data>
339 </qtcreator>
339 </qtcreator>
@@ -1,225 +1,226
1 #ifndef FSW_PARAMS_H_INCLUDED
1 #ifndef FSW_PARAMS_H_INCLUDED
2 #define FSW_PARAMS_H_INCLUDED
2 #define FSW_PARAMS_H_INCLUDED
3
3
4 #include "grlib_regs.h"
4 #include "grlib_regs.h"
5 #include "fsw_params_processing.h"
5 #include "fsw_params_processing.h"
6 #include "fsw_params_nb_bytes.h"
6 #include "fsw_params_nb_bytes.h"
7 #include "tm_byte_positions.h"
7 #include "tm_byte_positions.h"
8 #include "ccsds_types.h"
8 #include "ccsds_types.h"
9
9
10 #define GRSPW_DEVICE_NAME "/dev/grspw0"
10 #define GRSPW_DEVICE_NAME "/dev/grspw0"
11 #define UART_DEVICE_NAME "/dev/console"
11 #define UART_DEVICE_NAME "/dev/console"
12
12
13 typedef struct ring_node
13 typedef struct ring_node
14 {
14 {
15 struct ring_node *previous;
15 struct ring_node *previous;
16 int buffer_address;
16 int buffer_address;
17 struct ring_node *next;
17 struct ring_node *next;
18 unsigned int status;
18 unsigned int status;
19 } ring_node;
19 } ring_node;
20
20
21 //************************
21 //************************
22 // flight software version
22 // flight software version
23 // this parameters is handled by the Qt project options
23 // this parameters is handled by the Qt project options
24
24
25 #define NB_PACKETS_PER_GROUP_OF_CWF 8 // 8 packets containing 336 blk
25 #define NB_PACKETS_PER_GROUP_OF_CWF 8 // 8 packets containing 336 blk
26 #define NB_PACKETS_PER_GROUP_OF_CWF_LIGHT 4 // 4 packets containing 672 blk
26 #define NB_PACKETS_PER_GROUP_OF_CWF_LIGHT 4 // 4 packets containing 672 blk
27 #define NB_SAMPLES_PER_SNAPSHOT 2688 // 336 * 8 = 672 * 4 = 2688
27 #define NB_SAMPLES_PER_SNAPSHOT 2688 // 336 * 8 = 672 * 4 = 2688
28 #define TIME_OFFSET 2
28 #define TIME_OFFSET 2
29 #define TIME_OFFSET_IN_BYTES 8
29 #define TIME_OFFSET_IN_BYTES 8
30 #define WAVEFORM_EXTENDED_HEADER_OFFSET 22
30 #define WAVEFORM_EXTENDED_HEADER_OFFSET 22
31 #define NB_BYTES_SWF_BLK (2 * 6)
31 #define NB_BYTES_SWF_BLK (2 * 6)
32 #define NB_WORDS_SWF_BLK 3
32 #define NB_WORDS_SWF_BLK 3
33 #define NB_BYTES_CWF3_LIGHT_BLK 6
33 #define NB_BYTES_CWF3_LIGHT_BLK 6
34 #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8
34 #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8
35 #define NB_RING_NODES_F0 3 // AT LEAST 3
35 #define NB_RING_NODES_F0 3 // AT LEAST 3
36 #define NB_RING_NODES_F1 5 // AT LEAST 3
36 #define NB_RING_NODES_F1 5 // AT LEAST 3
37 #define NB_RING_NODES_F2 5 // AT LEAST 3
37 #define NB_RING_NODES_F2 5 // AT LEAST 3
38 #define NB_RING_NODES_ASM_F0 12 // AT LEAST 3
38 #define NB_RING_NODES_ASM_F0 12 // AT LEAST 3
39 #define NB_RING_NODES_ASM_F1 2 // AT LEAST 3
39 #define NB_RING_NODES_ASM_F1 2 // AT LEAST 3
40 #define NB_RING_NODES_ASM_F2 2 // AT LEAST 3
40 #define NB_RING_NODES_ASM_F2 2 // AT LEAST 3
41
41
42 //**********
42 //**********
43 // LFR MODES
43 // LFR MODES
44 #define LFR_MODE_STANDBY 0
44 #define LFR_MODE_STANDBY 0
45 #define LFR_MODE_NORMAL 1
45 #define LFR_MODE_NORMAL 1
46 #define LFR_MODE_BURST 2
46 #define LFR_MODE_BURST 2
47 #define LFR_MODE_SBM1 3
47 #define LFR_MODE_SBM1 3
48 #define LFR_MODE_SBM2 4
48 #define LFR_MODE_SBM2 4
49
49
50 #define TDS_MODE_LFM 5
50 #define TDS_MODE_LFM 5
51 #define TDS_MODE_STANDBY 0
51 #define TDS_MODE_STANDBY 0
52 #define TDS_MODE_NORMAL 1
52 #define TDS_MODE_NORMAL 1
53 #define TDS_MODE_BURST 2
53 #define TDS_MODE_BURST 2
54 #define TDS_MODE_SBM1 3
54 #define TDS_MODE_SBM1 3
55 #define TDS_MODE_SBM2 4
55 #define TDS_MODE_SBM2 4
56
56
57 #define THR_MODE_STANDBY 0
57 #define THR_MODE_STANDBY 0
58 #define THR_MODE_NORMAL 1
58 #define THR_MODE_NORMAL 1
59 #define THR_MODE_BURST 2
59 #define THR_MODE_BURST 2
60
60
61 #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0
61 #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0
62 #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1
62 #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1
63 #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2
63 #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2
64 #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3
64 #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3
65 #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4
65 #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4
66 #define RTEMS_EVENT_MODE_SBM2_WFRM RTEMS_EVENT_5
66 #define RTEMS_EVENT_MODE_SBM2_WFRM RTEMS_EVENT_5
67 #define RTEMS_EVENT_MODE_NORMAL_SWF_F0 RTEMS_EVENT_6
67 #define RTEMS_EVENT_MODE_NORMAL_SWF_F0 RTEMS_EVENT_6
68 #define RTEMS_EVENT_MODE_NORMAL_SWF_F1 RTEMS_EVENT_7
68 #define RTEMS_EVENT_MODE_NORMAL_SWF_F1 RTEMS_EVENT_7
69 #define RTEMS_EVENT_MODE_NORMAL_SWF_F2 RTEMS_EVENT_8
69 #define RTEMS_EVENT_MODE_NORMAL_SWF_F2 RTEMS_EVENT_8
70
70
71 //****************************
71 //****************************
72 // LFR DEFAULT MODE PARAMETERS
72 // LFR DEFAULT MODE PARAMETERS
73 // COMMON
73 // COMMON
74 #define DEFAULT_SY_LFR_COMMON0 0x00
74 #define DEFAULT_SY_LFR_COMMON0 0x00
75 #define DEFAULT_SY_LFR_COMMON1 0x10 // default value 0 0 0 1 0 0 0 0
75 #define DEFAULT_SY_LFR_COMMON1 0x10 // default value 0 0 0 1 0 0 0 0
76 // NORM
76 // NORM
77 #define SY_LFR_N_SWF_L 2048 // nb sample
77 #define SY_LFR_N_SWF_L 2048 // nb sample
78 #define SY_LFR_N_SWF_P 300 // sec
78 #define SY_LFR_N_SWF_P 300 // sec
79 #define SY_LFR_N_ASM_P 3600 // sec
79 #define SY_LFR_N_ASM_P 3600 // sec
80 #define SY_LFR_N_BP_P0 4 // sec
80 #define SY_LFR_N_BP_P0 4 // sec
81 #define SY_LFR_N_BP_P1 20 // sec
81 #define SY_LFR_N_BP_P1 20 // sec
82 #define SY_LFR_N_CWF_LONG_F3 0 // 0 => production of light continuous waveforms at f3
82 #define SY_LFR_N_CWF_LONG_F3 0 // 0 => production of light continuous waveforms at f3
83 #define MIN_DELTA_SNAPSHOT 16 // sec
83 #define MIN_DELTA_SNAPSHOT 16 // sec
84 // BURST
84 // BURST
85 #define DEFAULT_SY_LFR_B_BP_P0 1 // sec
85 #define DEFAULT_SY_LFR_B_BP_P0 1 // sec
86 #define DEFAULT_SY_LFR_B_BP_P1 5 // sec
86 #define DEFAULT_SY_LFR_B_BP_P1 5 // sec
87 // SBM1
87 // SBM1
88 #define DEFAULT_SY_LFR_S1_BP_P0 1 // sec
88 #define DEFAULT_SY_LFR_S1_BP_P0 1 // sec
89 #define DEFAULT_SY_LFR_S1_BP_P1 1 // sec
89 #define DEFAULT_SY_LFR_S1_BP_P1 1 // sec
90 // SBM2
90 // SBM2
91 #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec
91 #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec
92 #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec
92 #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec
93 // ADDITIONAL PARAMETERS
93 // ADDITIONAL PARAMETERS
94 #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms
94 #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms
95 #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s
95 #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s
96 // STATUS WORD
96 // STATUS WORD
97 #define DEFAULT_STATUS_WORD_BYTE0 0x0d // [0000] [1] [101] mode 4 bits / SPW enabled 1 bit / state is run 3 bits
97 #define DEFAULT_STATUS_WORD_BYTE0 0x0d // [0000] [1] [101] mode 4 bits / SPW enabled 1 bit / state is run 3 bits
98 #define DEFAULT_STATUS_WORD_BYTE1 0x00
98 #define DEFAULT_STATUS_WORD_BYTE1 0x00
99 //
99 //
100 #define SY_LFR_DPU_CONNECT_TIMEOUT 100 // 100 * 10 ms = 1 s
100 #define SY_LFR_DPU_CONNECT_TIMEOUT 100 // 100 * 10 ms = 1 s
101 #define SY_LFR_DPU_CONNECT_ATTEMPT 3
101 #define SY_LFR_DPU_CONNECT_ATTEMPT 3
102 //****************************
102 //****************************
103
103
104 //*****************************
104 //*****************************
105 // APB REGISTERS BASE ADDRESSES
105 // APB REGISTERS BASE ADDRESSES
106 #define REGS_ADDR_APBUART 0x80000100
106 #define REGS_ADDR_APBUART 0x80000100
107 #define REGS_ADDR_GPTIMER 0x80000300
107 #define REGS_ADDR_GPTIMER 0x80000300
108 #define REGS_ADDR_GRSPW 0x80000500
108 #define REGS_ADDR_GRSPW 0x80000500
109 #define REGS_ADDR_TIME_MANAGEMENT 0x80000600
109 #define REGS_ADDR_TIME_MANAGEMENT 0x80000600
110 #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00
110 #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00
111 #define REGS_ADDR_WAVEFORM_PICKER 0x80000f20
111 #define REGS_ADDR_WAVEFORM_PICKER 0x80000f20
112
112
113 #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff
113 #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff
114 #define APBUART_CTRL_REG_MASK_TE 0x00000002
114 #define APBUART_CTRL_REG_MASK_TE 0x00000002
115 #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 (0x50)
115 #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 (0x50)
116
116
117 //**********
117 //**********
118 // IRQ LINES
118 // IRQ LINES
119 #define IRQ_SM_SIMULATOR 9
119 #define IRQ_SM_SIMULATOR 9
120 #define IRQ_SPARC_SM_SIMULATOR 0x19 // see sparcv8.pdf p.76 for interrupt levels
120 #define IRQ_SPARC_SM_SIMULATOR 0x19 // see sparcv8.pdf p.76 for interrupt levels
121 #define IRQ_WAVEFORM_PICKER 14
121 #define IRQ_WAVEFORM_PICKER 14
122 #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels
122 #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels
123 #define IRQ_SPECTRAL_MATRIX 6
123 #define IRQ_SPECTRAL_MATRIX 6
124 #define IRQ_SPARC_SPECTRAL_MATRIX 0x16 // see sparcv8.pdf p.76 for interrupt levels
124 #define IRQ_SPARC_SPECTRAL_MATRIX 0x16 // see sparcv8.pdf p.76 for interrupt levels
125
125
126 //*****
126 //*****
127 // TIME
127 // TIME
128 #define CLKDIV_SM_SIMULATOR (10000 - 1) // 10 ms
128 #define CLKDIV_SM_SIMULATOR (10000 - 1) // 10 ms
129 #define TIMER_SM_SIMULATOR 1
129 #define TIMER_SM_SIMULATOR 1
130 #define HK_PERIOD 100 // 100 * 10ms => 1s
130 #define HK_PERIOD 100 // 100 * 10ms => 1s
131 #define SY_LFR_TIME_SYN_TIMEOUT_in_ms 2000
131 #define SY_LFR_TIME_SYN_TIMEOUT_in_ms 2000
132 #define SY_LFR_TIME_SYN_TIMEOUT_in_ticks 200 // 200 * 10 ms = 2 s
132 #define SY_LFR_TIME_SYN_TIMEOUT_in_ticks 200 // 200 * 10 ms = 2 s
133
133
134 //**********
134 //**********
135 // LPP CODES
135 // LPP CODES
136 #define LFR_SUCCESSFUL 0
136 #define LFR_SUCCESSFUL 0
137 #define LFR_DEFAULT 1
137 #define LFR_DEFAULT 1
138
138
139 //******
139 //******
140 // RTEMS
140 // RTEMS
141 #define TASKID_RECV 1
141 #define TASKID_RECV 1
142 #define TASKID_ACTN 2
142 #define TASKID_ACTN 2
143 #define TASKID_SPIQ 3
143 #define TASKID_SPIQ 3
144 #define TASKID_SMIQ 4
144 #define TASKID_SMIQ 4
145 #define TASKID_STAT 5
145 #define TASKID_STAT 5
146 #define TASKID_AVF0 6
146 #define TASKID_AVF0 6
147 //#define TASKID_BPF0 7
147 #define TASKID_SWBD 7
148 #define TASKID_WFRM 8
148 #define TASKID_WFRM 8
149 #define TASKID_DUMB 9
149 #define TASKID_DUMB 9
150 #define TASKID_HOUS 10
150 #define TASKID_HOUS 10
151 #define TASKID_MATR 11
151 #define TASKID_MATR 11
152 #define TASKID_CWF3 12
152 #define TASKID_CWF3 12
153 #define TASKID_CWF2 13
153 #define TASKID_CWF2 13
154 #define TASKID_CWF1 14
154 #define TASKID_CWF1 14
155 #define TASKID_SEND 15
155 #define TASKID_SEND 15
156 #define TASKID_WTDG 16
156 #define TASKID_WTDG 16
157
157
158 #define TASK_PRIORITY_SPIQ 5
158 #define TASK_PRIORITY_SPIQ 5
159 #define TASK_PRIORITY_SMIQ 10
159 #define TASK_PRIORITY_SMIQ 10
160 #define TASK_PRIORITY_WTDG 20
160 #define TASK_PRIORITY_WTDG 20
161 #define TASK_PRIORITY_HOUS 30
161 #define TASK_PRIORITY_HOUS 30
162 #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together
162 #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together
163 #define TASK_PRIORITY_CWF2 35 //
163 #define TASK_PRIORITY_CWF2 35 //
164 #define TASK_PRIORITY_WFRM 40
164 #define TASK_PRIORITY_WFRM 40
165 #define TASK_PRIORITY_CWF3 40 // there is a printf in this function, be careful with its priority wrt CWF1
165 #define TASK_PRIORITY_CWF3 40 // there is a printf in this function, be careful with its priority wrt CWF1
166 #define TASK_PRIORITY_SWBD 40
166 #define TASK_PRIORITY_SEND 45
167 #define TASK_PRIORITY_SEND 45
167 #define TASK_PRIORITY_RECV 50
168 #define TASK_PRIORITY_RECV 50
168 #define TASK_PRIORITY_ACTN 50
169 #define TASK_PRIORITY_ACTN 50
169 #define TASK_PRIORITY_AVF0 60
170 #define TASK_PRIORITY_AVF0 60
170 #define TASK_PRIORITY_BPF0 60
171 #define TASK_PRIORITY_BPF0 60
171 #define TASK_PRIORITY_MATR 100
172 #define TASK_PRIORITY_MATR 100
172 #define TASK_PRIORITY_STAT 200
173 #define TASK_PRIORITY_STAT 200
173 #define TASK_PRIORITY_DUMB 200
174 #define TASK_PRIORITY_DUMB 200
174
175
175 #define ACTION_MSG_QUEUE_COUNT 10
176 #define ACTION_MSG_QUEUE_COUNT 10
176 #define ACTION_MSG_PKTS_COUNT 50
177 #define ACTION_MSG_PKTS_COUNT 50
177 #define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES)
178 #define ACTION_MSG_PKTS_MAX_SIZE (PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES)
178 #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options
179 #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options
179
180
180 #define QUEUE_RECV 0
181 #define QUEUE_RECV 0
181 #define QUEUE_SEND 1
182 #define QUEUE_SEND 1
182
183
183 //*******
184 //*******
184 // MACROS
185 // MACROS
185 #ifdef PRINT_MESSAGES_ON_CONSOLE
186 #ifdef PRINT_MESSAGES_ON_CONSOLE
186 #define PRINTF(x) printf(x);
187 #define PRINTF(x) printf(x);
187 #define PRINTF1(x,y) printf(x,y);
188 #define PRINTF1(x,y) printf(x,y);
188 #define PRINTF2(x,y,z) printf(x,y,z);
189 #define PRINTF2(x,y,z) printf(x,y,z);
189 #else
190 #else
190 #define PRINTF(x) ;
191 #define PRINTF(x) ;
191 #define PRINTF1(x,y) ;
192 #define PRINTF1(x,y) ;
192 #define PRINTF2(x,y,z) ;
193 #define PRINTF2(x,y,z) ;
193 #endif
194 #endif
194
195
195 #ifdef BOOT_MESSAGES
196 #ifdef BOOT_MESSAGES
196 #define BOOT_PRINTF(x) printf(x);
197 #define BOOT_PRINTF(x) printf(x);
197 #define BOOT_PRINTF1(x,y) printf(x,y);
198 #define BOOT_PRINTF1(x,y) printf(x,y);
198 #define BOOT_PRINTF2(x,y,z) printf(x,y,z);
199 #define BOOT_PRINTF2(x,y,z) printf(x,y,z);
199 #else
200 #else
200 #define BOOT_PRINTF(x) ;
201 #define BOOT_PRINTF(x) ;
201 #define BOOT_PRINTF1(x,y) ;
202 #define BOOT_PRINTF1(x,y) ;
202 #define BOOT_PRINTF2(x,y,z) ;
203 #define BOOT_PRINTF2(x,y,z) ;
203 #endif
204 #endif
204
205
205 #ifdef DEBUG_MESSAGES
206 #ifdef DEBUG_MESSAGES
206 #define DEBUG_PRINTF(x) printf(x);
207 #define DEBUG_PRINTF(x) printf(x);
207 #define DEBUG_PRINTF1(x,y) printf(x,y);
208 #define DEBUG_PRINTF1(x,y) printf(x,y);
208 #define DEBUG_PRINTF2(x,y,z) printf(x,y,z);
209 #define DEBUG_PRINTF2(x,y,z) printf(x,y,z);
209 #else
210 #else
210 #define DEBUG_PRINTF(x) ;
211 #define DEBUG_PRINTF(x) ;
211 #define DEBUG_PRINTF1(x,y) ;
212 #define DEBUG_PRINTF1(x,y) ;
212 #define DEBUG_PRINTF2(x,y,z) ;
213 #define DEBUG_PRINTF2(x,y,z) ;
213 #endif
214 #endif
214
215
215 #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period
216 #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period
216
217
217 struct param_local_str{
218 struct param_local_str{
218 unsigned int local_sbm1_nb_cwf_sent;
219 unsigned int local_sbm1_nb_cwf_sent;
219 unsigned int local_sbm1_nb_cwf_max;
220 unsigned int local_sbm1_nb_cwf_max;
220 unsigned int local_sbm2_nb_cwf_sent;
221 unsigned int local_sbm2_nb_cwf_sent;
221 unsigned int local_sbm2_nb_cwf_max;
222 unsigned int local_sbm2_nb_cwf_max;
222 unsigned int local_nb_interrupt_f0_MAX;
223 unsigned int local_nb_interrupt_f0_MAX;
223 };
224 };
224
225
225 #endif // FSW_PARAMS_H_INCLUDED
226 #endif // FSW_PARAMS_H_INCLUDED
@@ -1,90 +1,96
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 extern int fdSPW;
15 extern int fdSPW;
16
16
17 //*****************
17 //*****************
18 // waveform buffers
18 // waveform buffers
19 // F0
19 // F0
20 //extern volatile int wf_snap_f0[ ];
20 //extern volatile int wf_snap_f0[ ];
21 // F1 F2
21 // F1 F2
22 extern volatile int wf_snap_f0[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ];
22 extern volatile int wf_snap_f0[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ];
23 extern volatile int wf_snap_f1[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ];
23 extern volatile int wf_snap_f1[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ];
24 extern volatile int wf_snap_f2[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ];
24 extern volatile int wf_snap_f2[ ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ];
25 // F3
25 // F3
26 extern volatile int wf_cont_f3_a[ ];
26 extern volatile int wf_cont_f3_a[ ];
27 extern volatile int wf_cont_f3_b[ ];
27 extern volatile int wf_cont_f3_b[ ];
28 extern char wf_cont_f3_light[ ];
28 extern char wf_cont_f3_light[ ];
29
29
30 extern waveform_picker_regs_new_t *waveform_picker_regs;
30 extern waveform_picker_regs_new_t *waveform_picker_regs;
31 extern time_management_regs_t *time_management_regs;
31 extern time_management_regs_t *time_management_regs;
32 extern Packet_TM_LFR_HK_t housekeeping_packet;
32 extern Packet_TM_LFR_HK_t housekeeping_packet;
33 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
33 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
34 extern struct param_local_str param_local;
34 extern struct param_local_str param_local;
35
35
36 extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
36 extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
37 extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
37 extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
38
38
39 extern rtems_id Task_id[20]; /* array of task ids */
39 extern rtems_id Task_id[20]; /* array of task ids */
40
40
41 extern unsigned char lfrCurrentMode;
41 extern unsigned char lfrCurrentMode;
42
42
43 //**********
44 // RTEMS_ISR
43 rtems_isr waveforms_isr( rtems_vector_number vector );
45 rtems_isr waveforms_isr( rtems_vector_number vector );
44 rtems_isr waveforms_isr_alt( rtems_vector_number vector );
46
47 //***********
48 // RTEMS_TASK
45 rtems_task wfrm_task( rtems_task_argument argument );
49 rtems_task wfrm_task( rtems_task_argument argument );
46 rtems_task cwf3_task( rtems_task_argument argument );
50 rtems_task cwf3_task( rtems_task_argument argument );
47 rtems_task cwf2_task( rtems_task_argument argument );
51 rtems_task cwf2_task( rtems_task_argument argument );
48 rtems_task cwf1_task( rtems_task_argument argument );
52 rtems_task cwf1_task( rtems_task_argument argument );
53 rtems_task swbd_task( rtems_task_argument argument );
49
54
50 //******************
55 //******************
51 // general functions
56 // general functions
52 void init_waveforms( void );
57 void init_waveforms( void );
53 void init_waveform_rings( void );
58 void init_waveform_rings( void );
54 void reset_current_ring_nodes( void );
59 void reset_current_ring_nodes( void );
55 //
60 //
56 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF );
61 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF );
57 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
62 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
58 int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
63 int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
59 //
64 //
60 int send_waveform_SWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id );
65 int send_waveform_SWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id );
61 int send_waveform_CWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
66 int send_waveform_CWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
62 int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
67 int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
63 int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
68 int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
64 //
69 //
65 void compute_acquisition_time(unsigned int coarseTime, unsigned int fineTime,
70 void compute_acquisition_time(unsigned int coarseTime, unsigned int fineTime,
66 unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char *acquisitionTime );
71 unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char *acquisitionTime );
72 void build_snapshot_from_ring( void );
67 //
73 //
68 rtems_id get_pkts_queue_id( void );
74 rtems_id get_pkts_queue_id( void );
69
75
70 //**************
76 //**************
71 // wfp registers
77 // wfp registers
72 // RESET
78 // RESET
73 void reset_wfp_burst_enable( void );
79 void reset_wfp_burst_enable( void );
74 void reset_wfp_status(void);
80 void reset_wfp_status(void);
75 void reset_waveform_picker_regs( void );
81 void reset_waveform_picker_regs( void );
76 // SET
82 // SET
77 void set_wfp_data_shaping(void);
83 void set_wfp_data_shaping(void);
78 void set_wfp_burst_enable_register( unsigned char mode );
84 void set_wfp_burst_enable_register( unsigned char mode );
79 void set_wfp_delta_snapshot( void );
85 void set_wfp_delta_snapshot( void );
80 void set_wfp_delta_f0_f0_2( void );
86 void set_wfp_delta_f0_f0_2( void );
81 void set_wfp_delta_f1( void );
87 void set_wfp_delta_f1( void );
82 void set_wfp_delta_f2( void );
88 void set_wfp_delta_f2( void );
83
89
84 //*****************
90 //*****************
85 // local parameters
91 // local parameters
86 void set_local_nb_interrupt_f0_MAX( void );
92 void set_local_nb_interrupt_f0_MAX( void );
87
93
88 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid );
94 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid );
89
95
90 #endif // WF_HANDLER_H_INCLUDED
96 #endif // WF_HANDLER_H_INCLUDED
@@ -1,72 +1,72
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 = 24584
34 // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes = 24584
35 // 97 * 256 = 24832 => delta = 248 bytes = 62 words
35 // 97 * 256 = 24832 => delta = 248 bytes = 62 words
36 // WAVEFORMS GLOBAL VARIABLES // 2688 * 3 * 4 + 2 * 4 = 32256 + 8 bytes = 32264
36 // WAVEFORMS GLOBAL VARIABLES // 2688 * 3 * 4 + 2 * 4 = 32256 + 8 bytes = 32264
37 // 127 * 256 = 32512 => delta = 248 bytes = 62 words
37 // 127 * 256 = 32512 => delta = 248 bytes = 62 words
38 // F0
38 // F0
39 volatile int wf_snap_f0[ NB_RING_NODES_F0 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100)));
39 volatile int wf_snap_f0[ NB_RING_NODES_F0 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100)));
40 // F1 F2
40 // F1 F2
41 volatile int wf_snap_f1[ NB_RING_NODES_F1 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100)));
41 volatile int wf_snap_f1[ NB_RING_NODES_F1 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100)));
42 volatile int wf_snap_f2[ NB_RING_NODES_F2 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100)));
42 volatile int wf_snap_f2[ NB_RING_NODES_F2 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100)));
43 // F3
43 // F3
44 volatile int wf_cont_f3_a [ (NB_SAMPLES_PER_SNAPSHOT) * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
44 volatile int wf_cont_f3_a [ (NB_SAMPLES_PER_SNAPSHOT) * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
45 volatile int wf_cont_f3_b [ (NB_SAMPLES_PER_SNAPSHOT) * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
45 volatile int wf_cont_f3_b [ (NB_SAMPLES_PER_SNAPSHOT) * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100)));
46 char wf_cont_f3_light[ (NB_SAMPLES_PER_SNAPSHOT) * NB_BYTES_CWF3_LIGHT_BLK + TIME_OFFSET_IN_BYTES ] __attribute__((aligned(0x100)));
46 char wf_cont_f3_light[ (NB_SAMPLES_PER_SNAPSHOT) * NB_BYTES_CWF3_LIGHT_BLK + TIME_OFFSET_IN_BYTES ] __attribute__((aligned(0x100)));
47
47
48 // SPECTRAL MATRICES GLOBAL VARIABLES
48 // SPECTRAL MATRICES GLOBAL VARIABLES
49 volatile int sm_f0[ NB_RING_NODES_ASM_F0 ][ TIME_OFFSET + TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
49 volatile int sm_f0[ NB_RING_NODES_ASM_F0 ][ TIME_OFFSET + TOTAL_SIZE_SM + 62 ] __attribute__((aligned(0x100)));
50 volatile int sm_f1[ NB_RING_NODES_ASM_F1 ][ TIME_OFFSET + TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
50 volatile int sm_f1[ NB_RING_NODES_ASM_F1 ][ TIME_OFFSET + TOTAL_SIZE_SM + 62 ] __attribute__((aligned(0x100)));
51 volatile int sm_f2[ NB_RING_NODES_ASM_F2 ][ TIME_OFFSET + TOTAL_SIZE_SM ] __attribute__((aligned(0x100)));
51 volatile int sm_f2[ NB_RING_NODES_ASM_F2 ][ TIME_OFFSET + TOTAL_SIZE_SM + 62 ] __attribute__((aligned(0x100)));
52
52
53 // APB CONFIGURATION REGISTERS
53 // APB CONFIGURATION REGISTERS
54 time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT;
54 time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT;
55 gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER;
55 gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER;
56 waveform_picker_regs_new_t *waveform_picker_regs = (waveform_picker_regs_new_t*) REGS_ADDR_WAVEFORM_PICKER;
56 waveform_picker_regs_new_t *waveform_picker_regs = (waveform_picker_regs_new_t*) REGS_ADDR_WAVEFORM_PICKER;
57 spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX;
57 spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX;
58
58
59 // MODE PARAMETERS
59 // MODE PARAMETERS
60 Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
60 Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
61 struct param_local_str param_local;
61 struct param_local_str param_local;
62
62
63 // HK PACKETS
63 // HK PACKETS
64 Packet_TM_LFR_HK_t housekeeping_packet;
64 Packet_TM_LFR_HK_t housekeeping_packet;
65 // sequence counters are incremented by APID (PID + CAT) and destination ID
65 // sequence counters are incremented by APID (PID + CAT) and destination ID
66 unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
66 unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
67 unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
67 unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
68 unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID];
68 unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID];
69 spw_stats spacewire_stats;
69 spw_stats spacewire_stats;
70 spw_stats spacewire_stats_backup;
70 spw_stats spacewire_stats_backup;
71
71
72
72
@@ -1,604 +1,639
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 reset_local_time();
73 reset_local_time();
74
74
75 rtems_status_code status;
75 rtems_status_code status;
76 rtems_status_code status_spw;
76 rtems_status_code status_spw;
77 rtems_isr_entry old_isr_handler;
77 rtems_isr_entry old_isr_handler;
78
78
79 // UART settings
79 // UART settings
80 send_console_outputs_on_apbuart_port();
80 send_console_outputs_on_apbuart_port();
81 set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE);
81 set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE);
82 enable_apbuart_transmitter();
82 enable_apbuart_transmitter();
83 DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n")
83 DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n")
84
84
85 PRINTF("\n\n\n\n\n")
85 PRINTF("\n\n\n\n\n")
86 PRINTF("*************************\n")
86 PRINTF("*************************\n")
87 PRINTF("** LFR Flight Software **\n")
87 PRINTF("** LFR Flight Software **\n")
88 PRINTF1("** %d.", SW_VERSION_N1)
88 PRINTF1("** %d.", SW_VERSION_N1)
89 PRINTF1("%d.", SW_VERSION_N2)
89 PRINTF1("%d.", SW_VERSION_N2)
90 PRINTF1("%d.", SW_VERSION_N3)
90 PRINTF1("%d.", SW_VERSION_N3)
91 PRINTF1("%d **\n", SW_VERSION_N4)
91 PRINTF1("%d **\n", SW_VERSION_N4)
92 PRINTF("*************************\n")
92 PRINTF("*************************\n")
93 PRINTF("\n\n")
93 PRINTF("\n\n")
94
94
95 reset_wfp_burst_enable(); // stop the waveform picker if it was running
95 reset_wfp_burst_enable(); // stop the waveform picker if it was running
96 init_waveform_rings(); // initialize the waveform rings
96 init_waveform_rings(); // initialize the waveform rings
97 init_sm_rings();
97 init_sm_rings();
98
98
99 init_parameter_dump();
99 init_parameter_dump();
100 init_local_mode_parameters();
100 init_local_mode_parameters();
101 init_housekeeping_parameters();
101 init_housekeeping_parameters();
102
102
103 updateLFRCurrentMode();
103 updateLFRCurrentMode();
104
104
105 BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode)
105 BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode)
106
106
107 create_names(); // create all names
107 create_names(); // create all names
108
108
109 status = create_message_queues(); // create message queues
109 status = create_message_queues(); // create message queues
110 if (status != RTEMS_SUCCESSFUL)
110 if (status != RTEMS_SUCCESSFUL)
111 {
111 {
112 PRINTF1("in INIT *** ERR in create_message_queues, code %d", status)
112 PRINTF1("in INIT *** ERR in create_message_queues, code %d", status)
113 }
113 }
114
114
115 status = create_all_tasks(); // create all tasks
115 status = create_all_tasks(); // create all tasks
116 if (status != RTEMS_SUCCESSFUL)
116 if (status != RTEMS_SUCCESSFUL)
117 {
117 {
118 PRINTF1("in INIT *** ERR in create_all_tasks, code %d", status)
118 PRINTF1("in INIT *** ERR in create_all_tasks, code %d", status)
119 }
119 }
120
120
121 // **************************
121 // **************************
122 // <SPACEWIRE INITIALIZATION>
122 // <SPACEWIRE INITIALIZATION>
123 grspw_timecode_callback = &timecode_irq_handler;
123 grspw_timecode_callback = &timecode_irq_handler;
124
124
125 status_spw = spacewire_open_link(); // (1) open the link
125 status_spw = spacewire_open_link(); // (1) open the link
126 if ( status_spw != RTEMS_SUCCESSFUL )
126 if ( status_spw != RTEMS_SUCCESSFUL )
127 {
127 {
128 PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw )
128 PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw )
129 }
129 }
130
130
131 if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link
131 if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link
132 {
132 {
133 status_spw = spacewire_configure_link( fdSPW );
133 status_spw = spacewire_configure_link( fdSPW );
134 if ( status_spw != RTEMS_SUCCESSFUL )
134 if ( status_spw != RTEMS_SUCCESSFUL )
135 {
135 {
136 PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw )
136 PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw )
137 }
137 }
138 }
138 }
139
139
140 if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link
140 if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link
141 {
141 {
142 status_spw = spacewire_start_link( fdSPW );
142 status_spw = spacewire_start_link( fdSPW );
143 if ( status_spw != RTEMS_SUCCESSFUL )
143 if ( status_spw != RTEMS_SUCCESSFUL )
144 {
144 {
145 PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw )
145 PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw )
146 }
146 }
147 }
147 }
148 // </SPACEWIRE INITIALIZATION>
148 // </SPACEWIRE INITIALIZATION>
149 // ***************************
149 // ***************************
150
150
151 status = start_all_tasks(); // start all tasks
151 status = start_all_tasks(); // start all tasks
152 if (status != RTEMS_SUCCESSFUL)
152 if (status != RTEMS_SUCCESSFUL)
153 {
153 {
154 PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status)
154 PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status)
155 }
155 }
156
156
157 // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization
157 // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization
158 status = start_recv_send_tasks();
158 status = start_recv_send_tasks();
159 if ( status != RTEMS_SUCCESSFUL )
159 if ( status != RTEMS_SUCCESSFUL )
160 {
160 {
161 PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status )
161 PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status )
162 }
162 }
163
163
164 // suspend science tasks. they will be restarted later depending on the mode
164 // suspend science tasks. they will be restarted later depending on the mode
165 status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY)
165 status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY)
166 if (status != RTEMS_SUCCESSFUL)
166 if (status != RTEMS_SUCCESSFUL)
167 {
167 {
168 PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status)
168 PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status)
169 }
169 }
170
170
171 //******************************
171 //******************************
172 // <SPECTRAL MATRICES SIMULATOR>
172 // <SPECTRAL MATRICES SIMULATOR>
173 LEON_Mask_interrupt( IRQ_SM_SIMULATOR );
173 LEON_Mask_interrupt( IRQ_SM_SIMULATOR );
174 configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR,
174 configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR,
175 IRQ_SPARC_SM_SIMULATOR, spectral_matrices_isr_simu );
175 IRQ_SPARC_SM_SIMULATOR, spectral_matrices_isr_simu );
176 // </SPECTRAL MATRICES SIMULATOR>
176 // </SPECTRAL MATRICES SIMULATOR>
177 //*******************************
177 //*******************************
178
178
179 // configure IRQ handling for the waveform picker unit
179 // configure IRQ handling for the waveform picker unit
180 status = rtems_interrupt_catch( waveforms_isr,
180 status = rtems_interrupt_catch( waveforms_isr,
181 IRQ_SPARC_WAVEFORM_PICKER,
181 IRQ_SPARC_WAVEFORM_PICKER,
182 &old_isr_handler) ;
182 &old_isr_handler) ;
183 // configure IRQ handling for the spectral matrices unit
183 // configure IRQ handling for the spectral matrices unit
184 status = rtems_interrupt_catch( spectral_matrices_isr,
184 status = rtems_interrupt_catch( spectral_matrices_isr,
185 IRQ_SPARC_SPECTRAL_MATRIX,
185 IRQ_SPARC_SPECTRAL_MATRIX,
186 &old_isr_handler) ;
186 &old_isr_handler) ;
187
187
188 // if the spacewire link is not up then send an event to the SPIQ task for link recovery
188 // if the spacewire link is not up then send an event to the SPIQ task for link recovery
189 if ( status_spw != RTEMS_SUCCESSFUL )
189 if ( status_spw != RTEMS_SUCCESSFUL )
190 {
190 {
191 status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT );
191 status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT );
192 if ( status != RTEMS_SUCCESSFUL ) {
192 if ( status != RTEMS_SUCCESSFUL ) {
193 PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status )
193 PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status )
194 }
194 }
195 }
195 }
196
196
197 BOOT_PRINTF("delete INIT\n")
197 BOOT_PRINTF("delete INIT\n")
198
198
199 status = rtems_task_delete(RTEMS_SELF);
199 status = rtems_task_delete(RTEMS_SELF);
200
200
201 }
201 }
202
202
203 void init_local_mode_parameters( void )
203 void init_local_mode_parameters( void )
204 {
204 {
205 /** This function initialize the param_local global variable with default values.
205 /** This function initialize the param_local global variable with default values.
206 *
206 *
207 */
207 */
208
208
209 unsigned int i;
209 unsigned int i;
210
210
211 // LOCAL PARAMETERS
211 // LOCAL PARAMETERS
212 set_local_nb_interrupt_f0_MAX();
212 set_local_nb_interrupt_f0_MAX();
213
213
214 BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max)
214 BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max)
215 BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max)
215 BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max)
216 BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX)
216 BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX)
217
217
218 // init sequence counters
218 // init sequence counters
219
219
220 for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++)
220 for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++)
221 {
221 {
222 sequenceCounters_TC_EXE[i] = 0x00;
222 sequenceCounters_TC_EXE[i] = 0x00;
223 }
223 }
224 sequenceCounters_SCIENCE_NORMAL_BURST = 0x00;
224 sequenceCounters_SCIENCE_NORMAL_BURST = 0x00;
225 sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00;
225 sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00;
226 }
226 }
227
227
228 void reset_local_time( void )
228 void reset_local_time( void )
229 {
229 {
230
230
231 }
231 }
232
232
233 void create_names( void ) // create all names for tasks and queues
233 void create_names( void ) // create all names for tasks and queues
234 {
234 {
235 /** This function creates all RTEMS names used in the software for tasks and queues.
235 /** This function creates all RTEMS names used in the software for tasks and queues.
236 *
236 *
237 * @return RTEMS directive status codes:
237 * @return RTEMS directive status codes:
238 * - RTEMS_SUCCESSFUL - successful completion
238 * - RTEMS_SUCCESSFUL - successful completion
239 *
239 *
240 */
240 */
241
241
242 // task names
242 // task names
243 Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' );
243 Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' );
244 Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' );
244 Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' );
245 Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' );
245 Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' );
246 Task_name[TASKID_SMIQ] = rtems_build_name( 'S', 'M', 'I', 'Q' );
246 Task_name[TASKID_SMIQ] = rtems_build_name( 'S', 'M', 'I', 'Q' );
247 Task_name[TASKID_STAT] = rtems_build_name( 'S', 'T', 'A', 'T' );
247 Task_name[TASKID_STAT] = rtems_build_name( 'S', 'T', 'A', 'T' );
248 Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' );
248 Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' );
249 // Task_name[TASKID_BPF0] = rtems_build_name( 'B', 'P', 'F', '0' );
249 Task_name[TASKID_SWBD] = rtems_build_name( 'S', 'W', 'B', 'D' );
250 Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' );
250 Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' );
251 Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' );
251 Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' );
252 Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' );
252 Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' );
253 Task_name[TASKID_MATR] = rtems_build_name( 'M', 'A', 'T', 'R' );
253 Task_name[TASKID_MATR] = rtems_build_name( 'M', 'A', 'T', 'R' );
254 Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' );
254 Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' );
255 Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' );
255 Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' );
256 Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' );
256 Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' );
257 Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' );
257 Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' );
258 Task_name[TASKID_WTDG] = rtems_build_name( 'W', 'T', 'D', 'G' );
258 Task_name[TASKID_WTDG] = rtems_build_name( 'W', 'T', 'D', 'G' );
259
259
260 // rate monotonic period names
260 // rate monotonic period names
261 name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' );
261 name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' );
262
262
263 misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' );
263 misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' );
264 misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' );
264 misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' );
265 }
265 }
266
266
267 int create_all_tasks( void ) // create all tasks which run in the software
267 int create_all_tasks( void ) // create all tasks which run in the software
268 {
268 {
269 /** This function creates all RTEMS tasks used in the software.
269 /** This function creates all RTEMS tasks used in the software.
270 *
270 *
271 * @return RTEMS directive status codes:
271 * @return RTEMS directive status codes:
272 * - RTEMS_SUCCESSFUL - task created successfully
272 * - RTEMS_SUCCESSFUL - task created successfully
273 * - RTEMS_INVALID_ADDRESS - id is NULL
273 * - RTEMS_INVALID_ADDRESS - id is NULL
274 * - RTEMS_INVALID_NAME - invalid task name
274 * - RTEMS_INVALID_NAME - invalid task name
275 * - RTEMS_INVALID_PRIORITY - invalid task priority
275 * - RTEMS_INVALID_PRIORITY - invalid task priority
276 * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured
276 * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured
277 * - RTEMS_TOO_MANY - too many tasks created
277 * - RTEMS_TOO_MANY - too many tasks created
278 * - RTEMS_UNSATISFIED - not enough memory for stack/FP context
278 * - RTEMS_UNSATISFIED - not enough memory for stack/FP context
279 * - RTEMS_TOO_MANY - too many global objects
279 * - RTEMS_TOO_MANY - too many global objects
280 *
280 *
281 */
281 */
282
282
283 rtems_status_code status;
283 rtems_status_code status;
284
284
285 //**********
286 // SPACEWIRE
285 // RECV
287 // RECV
286 status = rtems_task_create(
288 status = rtems_task_create(
287 Task_name[TASKID_RECV], TASK_PRIORITY_RECV, RTEMS_MINIMUM_STACK_SIZE,
289 Task_name[TASKID_RECV], TASK_PRIORITY_RECV, RTEMS_MINIMUM_STACK_SIZE,
288 RTEMS_DEFAULT_MODES,
290 RTEMS_DEFAULT_MODES,
289 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV]
291 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV]
290 );
292 );
291
293 if (status == RTEMS_SUCCESSFUL) // SEND
294 {
295 status = rtems_task_create(
296 Task_name[TASKID_SEND], TASK_PRIORITY_SEND, RTEMS_MINIMUM_STACK_SIZE,
297 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
298 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SEND]
299 );
300 }
301 if (status == RTEMS_SUCCESSFUL) // WTDG
302 {
303 status = rtems_task_create(
304 Task_name[TASKID_WTDG], TASK_PRIORITY_WTDG, RTEMS_MINIMUM_STACK_SIZE,
305 RTEMS_DEFAULT_MODES,
306 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_WTDG]
307 );
308 }
292 if (status == RTEMS_SUCCESSFUL) // ACTN
309 if (status == RTEMS_SUCCESSFUL) // ACTN
293 {
310 {
294 status = rtems_task_create(
311 status = rtems_task_create(
295 Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE,
312 Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE,
296 RTEMS_DEFAULT_MODES,
313 RTEMS_DEFAULT_MODES,
297 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN]
314 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN]
298 );
315 );
299 }
316 }
300 if (status == RTEMS_SUCCESSFUL) // SPIQ
317 if (status == RTEMS_SUCCESSFUL) // SPIQ
301 {
318 {
302 status = rtems_task_create(
319 status = rtems_task_create(
303 Task_name[TASKID_SPIQ], TASK_PRIORITY_SPIQ, RTEMS_MINIMUM_STACK_SIZE,
320 Task_name[TASKID_SPIQ], TASK_PRIORITY_SPIQ, RTEMS_MINIMUM_STACK_SIZE,
304 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
321 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
305 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ]
322 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ]
306 );
323 );
307 }
324 }
325
326 //******************
327 // SPECTRAL MATRICES
308 if (status == RTEMS_SUCCESSFUL) // SMIQ
328 if (status == RTEMS_SUCCESSFUL) // SMIQ
309 {
329 {
310 status = rtems_task_create(
330 status = rtems_task_create(
311 Task_name[TASKID_SMIQ], TASK_PRIORITY_SMIQ, RTEMS_MINIMUM_STACK_SIZE,
331 Task_name[TASKID_SMIQ], TASK_PRIORITY_SMIQ, RTEMS_MINIMUM_STACK_SIZE,
312 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
332 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
313 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SMIQ]
333 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SMIQ]
314 );
334 );
315 }
335 }
316 if (status == RTEMS_SUCCESSFUL) // STAT
317 {
318 status = rtems_task_create(
319 Task_name[TASKID_STAT], TASK_PRIORITY_STAT, RTEMS_MINIMUM_STACK_SIZE,
320 RTEMS_DEFAULT_MODES,
321 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_STAT]
322 );
323 }
324 if (status == RTEMS_SUCCESSFUL) // AVF0
336 if (status == RTEMS_SUCCESSFUL) // AVF0
325 {
337 {
326 status = rtems_task_create(
338 status = rtems_task_create(
327 Task_name[TASKID_AVF0], TASK_PRIORITY_AVF0, RTEMS_MINIMUM_STACK_SIZE,
339 Task_name[TASKID_AVF0], TASK_PRIORITY_AVF0, RTEMS_MINIMUM_STACK_SIZE,
328 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
340 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
329 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0]
341 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0]
330 );
342 );
331 }
343 }
344 if (status == RTEMS_SUCCESSFUL) // MATR
345 {
346 status = rtems_task_create(
347 Task_name[TASKID_MATR], TASK_PRIORITY_MATR, RTEMS_MINIMUM_STACK_SIZE,
348 RTEMS_DEFAULT_MODES,
349 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_MATR]
350 );
351 }
352
353 //****************
354 // WAVEFORM PICKER
332 if (status == RTEMS_SUCCESSFUL) // WFRM
355 if (status == RTEMS_SUCCESSFUL) // WFRM
333 {
356 {
334 status = rtems_task_create(
357 status = rtems_task_create(
335 Task_name[TASKID_WFRM], TASK_PRIORITY_WFRM, RTEMS_MINIMUM_STACK_SIZE,
358 Task_name[TASKID_WFRM], TASK_PRIORITY_WFRM, RTEMS_MINIMUM_STACK_SIZE,
336 RTEMS_DEFAULT_MODES,
359 RTEMS_DEFAULT_MODES,
337 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_WFRM]
360 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_WFRM]
338 );
361 );
339 }
362 }
340 if (status == RTEMS_SUCCESSFUL) // DUMB
341 {
342 status = rtems_task_create(
343 Task_name[TASKID_DUMB], TASK_PRIORITY_DUMB, RTEMS_MINIMUM_STACK_SIZE,
344 RTEMS_DEFAULT_MODES,
345 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_DUMB]
346 );
347 }
348 if (status == RTEMS_SUCCESSFUL) // HOUS
349 {
350 status = rtems_task_create(
351 Task_name[TASKID_HOUS], TASK_PRIORITY_HOUS, RTEMS_MINIMUM_STACK_SIZE,
352 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
353 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS]
354 );
355 }
356 if (status == RTEMS_SUCCESSFUL) // MATR
357 {
358 status = rtems_task_create(
359 Task_name[TASKID_MATR], TASK_PRIORITY_MATR, RTEMS_MINIMUM_STACK_SIZE,
360 RTEMS_DEFAULT_MODES,
361 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_MATR]
362 );
363 }
364 if (status == RTEMS_SUCCESSFUL) // CWF3
363 if (status == RTEMS_SUCCESSFUL) // CWF3
365 {
364 {
366 status = rtems_task_create(
365 status = rtems_task_create(
367 Task_name[TASKID_CWF3], TASK_PRIORITY_CWF3, RTEMS_MINIMUM_STACK_SIZE,
366 Task_name[TASKID_CWF3], TASK_PRIORITY_CWF3, RTEMS_MINIMUM_STACK_SIZE,
368 RTEMS_DEFAULT_MODES,
367 RTEMS_DEFAULT_MODES,
369 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF3]
368 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF3]
370 );
369 );
371 }
370 }
372 if (status == RTEMS_SUCCESSFUL) // CWF2
371 if (status == RTEMS_SUCCESSFUL) // CWF2
373 {
372 {
374 status = rtems_task_create(
373 status = rtems_task_create(
375 Task_name[TASKID_CWF2], TASK_PRIORITY_CWF2, RTEMS_MINIMUM_STACK_SIZE,
374 Task_name[TASKID_CWF2], TASK_PRIORITY_CWF2, RTEMS_MINIMUM_STACK_SIZE,
376 RTEMS_DEFAULT_MODES,
375 RTEMS_DEFAULT_MODES,
377 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF2]
376 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF2]
378 );
377 );
379 }
378 }
380 if (status == RTEMS_SUCCESSFUL) // CWF1
379 if (status == RTEMS_SUCCESSFUL) // CWF1
381 {
380 {
382 status = rtems_task_create(
381 status = rtems_task_create(
383 Task_name[TASKID_CWF1], TASK_PRIORITY_CWF1, RTEMS_MINIMUM_STACK_SIZE,
382 Task_name[TASKID_CWF1], TASK_PRIORITY_CWF1, RTEMS_MINIMUM_STACK_SIZE,
384 RTEMS_DEFAULT_MODES,
383 RTEMS_DEFAULT_MODES,
385 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF1]
384 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF1]
386 );
385 );
387 }
386 }
388 if (status == RTEMS_SUCCESSFUL) // SEND
387 if (status == RTEMS_SUCCESSFUL) // SWBD
388 {
389 status = rtems_task_create(
390 Task_name[TASKID_SWBD], TASK_PRIORITY_SWBD, RTEMS_MINIMUM_STACK_SIZE,
391 RTEMS_DEFAULT_MODES,
392 RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_SWBD]
393 );
394 }
395
396 //*****
397 // MISC
398 if (status == RTEMS_SUCCESSFUL) // STAT
389 {
399 {
390 status = rtems_task_create(
400 status = rtems_task_create(
391 Task_name[TASKID_SEND], TASK_PRIORITY_SEND, RTEMS_MINIMUM_STACK_SIZE,
401 Task_name[TASKID_STAT], TASK_PRIORITY_STAT, RTEMS_MINIMUM_STACK_SIZE,
392 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
402 RTEMS_DEFAULT_MODES,
393 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SEND]
403 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_STAT]
394 );
404 );
395 }
405 }
396 if (status == RTEMS_SUCCESSFUL) // WTDG
406 if (status == RTEMS_SUCCESSFUL) // DUMB
397 {
407 {
398 status = rtems_task_create(
408 status = rtems_task_create(
399 Task_name[TASKID_WTDG], TASK_PRIORITY_WTDG, RTEMS_MINIMUM_STACK_SIZE,
409 Task_name[TASKID_DUMB], TASK_PRIORITY_DUMB, RTEMS_MINIMUM_STACK_SIZE,
400 RTEMS_DEFAULT_MODES,
410 RTEMS_DEFAULT_MODES,
401 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_WTDG]
411 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_DUMB]
412 );
413 }
414 if (status == RTEMS_SUCCESSFUL) // HOUS
415 {
416 status = rtems_task_create(
417 Task_name[TASKID_HOUS], TASK_PRIORITY_HOUS, RTEMS_MINIMUM_STACK_SIZE,
418 RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT,
419 RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS]
402 );
420 );
403 }
421 }
404
422
405 return status;
423 return status;
406 }
424 }
407
425
408 int start_recv_send_tasks( void )
426 int start_recv_send_tasks( void )
409 {
427 {
410 rtems_status_code status;
428 rtems_status_code status;
411
429
412 status = rtems_task_start( Task_id[TASKID_RECV], recv_task, 1 );
430 status = rtems_task_start( Task_id[TASKID_RECV], recv_task, 1 );
413 if (status!=RTEMS_SUCCESSFUL) {
431 if (status!=RTEMS_SUCCESSFUL) {
414 BOOT_PRINTF("in INIT *** Error starting TASK_RECV\n")
432 BOOT_PRINTF("in INIT *** Error starting TASK_RECV\n")
415 }
433 }
416
434
417 if (status == RTEMS_SUCCESSFUL) // SEND
435 if (status == RTEMS_SUCCESSFUL) // SEND
418 {
436 {
419 status = rtems_task_start( Task_id[TASKID_SEND], send_task, 1 );
437 status = rtems_task_start( Task_id[TASKID_SEND], send_task, 1 );
420 if (status!=RTEMS_SUCCESSFUL) {
438 if (status!=RTEMS_SUCCESSFUL) {
421 BOOT_PRINTF("in INIT *** Error starting TASK_SEND\n")
439 BOOT_PRINTF("in INIT *** Error starting TASK_SEND\n")
422 }
440 }
423 }
441 }
424
442
425 return status;
443 return status;
426 }
444 }
427
445
428 int start_all_tasks( void ) // start all tasks except SEND RECV and HOUS
446 int start_all_tasks( void ) // start all tasks except SEND RECV and HOUS
429 {
447 {
430 /** This function starts all RTEMS tasks used in the software.
448 /** This function starts all RTEMS tasks used in the software.
431 *
449 *
432 * @return RTEMS directive status codes:
450 * @return RTEMS directive status codes:
433 * - RTEMS_SUCCESSFUL - ask started successfully
451 * - RTEMS_SUCCESSFUL - ask started successfully
434 * - RTEMS_INVALID_ADDRESS - invalid task entry point
452 * - RTEMS_INVALID_ADDRESS - invalid task entry point
435 * - RTEMS_INVALID_ID - invalid task id
453 * - RTEMS_INVALID_ID - invalid task id
436 * - RTEMS_INCORRECT_STATE - task not in the dormant state
454 * - RTEMS_INCORRECT_STATE - task not in the dormant state
437 * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task
455 * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task
438 *
456 *
439 */
457 */
440 // starts all the tasks fot eh flight software
458 // starts all the tasks fot eh flight software
441
459
442 rtems_status_code status;
460 rtems_status_code status;
443
461
462 //**********
463 // SPACEWIRE
444 status = rtems_task_start( Task_id[TASKID_SPIQ], spiq_task, 1 );
464 status = rtems_task_start( Task_id[TASKID_SPIQ], spiq_task, 1 );
445 if (status!=RTEMS_SUCCESSFUL) {
465 if (status!=RTEMS_SUCCESSFUL) {
446 BOOT_PRINTF("in INIT *** Error starting TASK_SPIQ\n")
466 BOOT_PRINTF("in INIT *** Error starting TASK_SPIQ\n")
447 }
467 }
448
468
449 if (status == RTEMS_SUCCESSFUL) // WTDG
469 if (status == RTEMS_SUCCESSFUL) // WTDG
450 {
470 {
451 status = rtems_task_start( Task_id[TASKID_WTDG], wtdg_task, 1 );
471 status = rtems_task_start( Task_id[TASKID_WTDG], wtdg_task, 1 );
452 if (status!=RTEMS_SUCCESSFUL) {
472 if (status!=RTEMS_SUCCESSFUL) {
453 BOOT_PRINTF("in INIT *** Error starting TASK_WTDG\n")
473 BOOT_PRINTF("in INIT *** Error starting TASK_WTDG\n")
454 }
474 }
455 }
475 }
456
476
457 if (status == RTEMS_SUCCESSFUL) // SMIQ
458 {
459 status = rtems_task_start( Task_id[TASKID_SMIQ], smiq_task, 1 );
460 if (status!=RTEMS_SUCCESSFUL) {
461 BOOT_PRINTF("in INIT *** Error starting TASK_BPPR\n")
462 }
463 }
464
465 if (status == RTEMS_SUCCESSFUL) // ACTN
477 if (status == RTEMS_SUCCESSFUL) // ACTN
466 {
478 {
467 status = rtems_task_start( Task_id[TASKID_ACTN], actn_task, 1 );
479 status = rtems_task_start( Task_id[TASKID_ACTN], actn_task, 1 );
468 if (status!=RTEMS_SUCCESSFUL) {
480 if (status!=RTEMS_SUCCESSFUL) {
469 BOOT_PRINTF("in INIT *** Error starting TASK_ACTN\n")
481 BOOT_PRINTF("in INIT *** Error starting TASK_ACTN\n")
470 }
482 }
471 }
483 }
472
484
473 if (status == RTEMS_SUCCESSFUL) // STAT
485 //******************
486 // SPECTRAL MATRICES
487 if (status == RTEMS_SUCCESSFUL) // SMIQ
474 {
488 {
475 status = rtems_task_start( Task_id[TASKID_STAT], stat_task, 1 );
489 status = rtems_task_start( Task_id[TASKID_SMIQ], smiq_task, 1 );
476 if (status!=RTEMS_SUCCESSFUL) {
490 if (status!=RTEMS_SUCCESSFUL) {
477 BOOT_PRINTF("in INIT *** Error starting TASK_STAT\n")
491 BOOT_PRINTF("in INIT *** Error starting TASK_BPPR\n")
478 }
492 }
479 }
493 }
480
494
481 if (status == RTEMS_SUCCESSFUL) // AVF0
495 if (status == RTEMS_SUCCESSFUL) // AVF0
482 {
496 {
483 status = rtems_task_start( Task_id[TASKID_AVF0], avf0_task, 1 );
497 status = rtems_task_start( Task_id[TASKID_AVF0], avf0_task, 1 );
484 if (status!=RTEMS_SUCCESSFUL) {
498 if (status!=RTEMS_SUCCESSFUL) {
485 BOOT_PRINTF("in INIT *** Error starting TASK_AVF0\n")
499 BOOT_PRINTF("in INIT *** Error starting TASK_AVF0\n")
486 }
500 }
487 }
501 }
488
502
503 if (status == RTEMS_SUCCESSFUL) // MATR
504 {
505 status = rtems_task_start( Task_id[TASKID_MATR], matr_task, 1 );
506 if (status!=RTEMS_SUCCESSFUL) {
507 BOOT_PRINTF("in INIT *** Error starting TASK_MATR\n")
508 }
509 }
510
511 //****************
512 // WAVEFORM PICKER
489 if (status == RTEMS_SUCCESSFUL) // WFRM
513 if (status == RTEMS_SUCCESSFUL) // WFRM
490 {
514 {
491 status = rtems_task_start( Task_id[TASKID_WFRM], wfrm_task, 1 );
515 status = rtems_task_start( Task_id[TASKID_WFRM], wfrm_task, 1 );
492 if (status!=RTEMS_SUCCESSFUL) {
516 if (status!=RTEMS_SUCCESSFUL) {
493 BOOT_PRINTF("in INIT *** Error starting TASK_WFRM\n")
517 BOOT_PRINTF("in INIT *** Error starting TASK_WFRM\n")
494 }
518 }
495 }
519 }
496
520
497 if (status == RTEMS_SUCCESSFUL) // DUMB
498 {
499 status = rtems_task_start( Task_id[TASKID_DUMB], dumb_task, 1 );
500 if (status!=RTEMS_SUCCESSFUL) {
501 BOOT_PRINTF("in INIT *** Error starting TASK_DUMB\n")
502 }
503 }
504
505 if (status == RTEMS_SUCCESSFUL) // HOUS
506 {
507 status = rtems_task_start( Task_id[TASKID_HOUS], hous_task, 1 );
508 if (status!=RTEMS_SUCCESSFUL) {
509 BOOT_PRINTF("in INIT *** Error starting TASK_HOUS\n")
510 }
511 }
512
513 if (status == RTEMS_SUCCESSFUL) // MATR
514 {
515 status = rtems_task_start( Task_id[TASKID_MATR], matr_task, 1 );
516 if (status!=RTEMS_SUCCESSFUL) {
517 BOOT_PRINTF("in INIT *** Error starting TASK_MATR\n")
518 }
519 }
520
521 if (status == RTEMS_SUCCESSFUL) // CWF3
521 if (status == RTEMS_SUCCESSFUL) // CWF3
522 {
522 {
523 status = rtems_task_start( Task_id[TASKID_CWF3], cwf3_task, 1 );
523 status = rtems_task_start( Task_id[TASKID_CWF3], cwf3_task, 1 );
524 if (status!=RTEMS_SUCCESSFUL) {
524 if (status!=RTEMS_SUCCESSFUL) {
525 BOOT_PRINTF("in INIT *** Error starting TASK_CWF3\n")
525 BOOT_PRINTF("in INIT *** Error starting TASK_CWF3\n")
526 }
526 }
527 }
527 }
528
528
529 if (status == RTEMS_SUCCESSFUL) // CWF2
529 if (status == RTEMS_SUCCESSFUL) // CWF2
530 {
530 {
531 status = rtems_task_start( Task_id[TASKID_CWF2], cwf2_task, 1 );
531 status = rtems_task_start( Task_id[TASKID_CWF2], cwf2_task, 1 );
532 if (status!=RTEMS_SUCCESSFUL) {
532 if (status!=RTEMS_SUCCESSFUL) {
533 BOOT_PRINTF("in INIT *** Error starting TASK_CWF2\n")
533 BOOT_PRINTF("in INIT *** Error starting TASK_CWF2\n")
534 }
534 }
535 }
535 }
536
536
537 if (status == RTEMS_SUCCESSFUL) // CWF1
537 if (status == RTEMS_SUCCESSFUL) // CWF1
538 {
538 {
539 status = rtems_task_start( Task_id[TASKID_CWF1], cwf1_task, 1 );
539 status = rtems_task_start( Task_id[TASKID_CWF1], cwf1_task, 1 );
540 if (status!=RTEMS_SUCCESSFUL) {
540 if (status!=RTEMS_SUCCESSFUL) {
541 BOOT_PRINTF("in INIT *** Error starting TASK_CWF1\n")
541 BOOT_PRINTF("in INIT *** Error starting TASK_CWF1\n")
542 }
542 }
543 }
543 }
544
545 if (status == RTEMS_SUCCESSFUL) // SWBD
546 {
547 status = rtems_task_start( Task_id[TASKID_SWBD], swbd_task, 1 );
548 if (status!=RTEMS_SUCCESSFUL) {
549 BOOT_PRINTF("in INIT *** Error starting TASK_SWBD\n")
550 }
551 }
552
553 //*****
554 // MISC
555 if (status == RTEMS_SUCCESSFUL) // HOUS
556 {
557 status = rtems_task_start( Task_id[TASKID_HOUS], hous_task, 1 );
558 if (status!=RTEMS_SUCCESSFUL) {
559 BOOT_PRINTF("in INIT *** Error starting TASK_HOUS\n")
560 }
561 }
562
563 if (status == RTEMS_SUCCESSFUL) // DUMB
564 {
565 status = rtems_task_start( Task_id[TASKID_DUMB], dumb_task, 1 );
566 if (status!=RTEMS_SUCCESSFUL) {
567 BOOT_PRINTF("in INIT *** Error starting TASK_DUMB\n")
568 }
569 }
570
571 if (status == RTEMS_SUCCESSFUL) // STAT
572 {
573 status = rtems_task_start( Task_id[TASKID_STAT], stat_task, 1 );
574 if (status!=RTEMS_SUCCESSFUL) {
575 BOOT_PRINTF("in INIT *** Error starting TASK_STAT\n")
576 }
577 }
578
544 return status;
579 return status;
545 }
580 }
546
581
547 rtems_status_code create_message_queues( void ) // create the two message queues used in the software
582 rtems_status_code create_message_queues( void ) // create the two message queues used in the software
548 {
583 {
549 rtems_status_code status_recv;
584 rtems_status_code status_recv;
550 rtems_status_code status_send;
585 rtems_status_code status_send;
551 rtems_status_code ret;
586 rtems_status_code ret;
552 rtems_id queue_id;
587 rtems_id queue_id;
553
588
554 // create the queue for handling valid TCs
589 // create the queue for handling valid TCs
555 status_recv = rtems_message_queue_create( misc_name[QUEUE_RECV],
590 status_recv = rtems_message_queue_create( misc_name[QUEUE_RECV],
556 ACTION_MSG_QUEUE_COUNT, CCSDS_TC_PKT_MAX_SIZE,
591 ACTION_MSG_QUEUE_COUNT, CCSDS_TC_PKT_MAX_SIZE,
557 RTEMS_FIFO | RTEMS_LOCAL, &queue_id );
592 RTEMS_FIFO | RTEMS_LOCAL, &queue_id );
558 if ( status_recv != RTEMS_SUCCESSFUL ) {
593 if ( status_recv != RTEMS_SUCCESSFUL ) {
559 PRINTF1("in create_message_queues *** ERR creating QUEU queue, %d\n", status_recv)
594 PRINTF1("in create_message_queues *** ERR creating QUEU queue, %d\n", status_recv)
560 }
595 }
561
596
562 // create the queue for handling TM packet sending
597 // create the queue for handling TM packet sending
563 status_send = rtems_message_queue_create( misc_name[QUEUE_SEND],
598 status_send = rtems_message_queue_create( misc_name[QUEUE_SEND],
564 ACTION_MSG_PKTS_COUNT, ACTION_MSG_PKTS_MAX_SIZE,
599 ACTION_MSG_PKTS_COUNT, ACTION_MSG_PKTS_MAX_SIZE,
565 RTEMS_FIFO | RTEMS_LOCAL, &queue_id );
600 RTEMS_FIFO | RTEMS_LOCAL, &queue_id );
566 if ( status_send != RTEMS_SUCCESSFUL ) {
601 if ( status_send != RTEMS_SUCCESSFUL ) {
567 PRINTF1("in create_message_queues *** ERR creating PKTS queue, %d\n", status_send)
602 PRINTF1("in create_message_queues *** ERR creating PKTS queue, %d\n", status_send)
568 }
603 }
569
604
570 if ( status_recv != RTEMS_SUCCESSFUL )
605 if ( status_recv != RTEMS_SUCCESSFUL )
571 {
606 {
572 ret = status_recv;
607 ret = status_recv;
573 }
608 }
574 else
609 else
575 {
610 {
576 ret = status_send;
611 ret = status_send;
577 }
612 }
578
613
579 return ret;
614 return ret;
580 }
615 }
581
616
582 rtems_status_code get_message_queue_id_send( rtems_id *queue_id )
617 rtems_status_code get_message_queue_id_send( rtems_id *queue_id )
583 {
618 {
584 rtems_status_code status;
619 rtems_status_code status;
585 rtems_name queue_name;
620 rtems_name queue_name;
586
621
587 queue_name = rtems_build_name( 'Q', '_', 'S', 'D' );
622 queue_name = rtems_build_name( 'Q', '_', 'S', 'D' );
588
623
589 status = rtems_message_queue_ident( queue_name, 0, queue_id );
624 status = rtems_message_queue_ident( queue_name, 0, queue_id );
590
625
591 return status;
626 return status;
592 }
627 }
593
628
594 rtems_status_code get_message_queue_id_recv( rtems_id *queue_id )
629 rtems_status_code get_message_queue_id_recv( rtems_id *queue_id )
595 {
630 {
596 rtems_status_code status;
631 rtems_status_code status;
597 rtems_name queue_name;
632 rtems_name queue_name;
598
633
599 queue_name = rtems_build_name( 'Q', '_', 'R', 'V' );
634 queue_name = rtems_build_name( 'Q', '_', 'R', 'V' );
600
635
601 status = rtems_message_queue_ident( queue_name, 0, queue_id );
636 status = rtems_message_queue_ident( queue_name, 0, queue_id );
602
637
603 return status;
638 return status;
604 }
639 }
@@ -1,1305 +1,1236
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[ NB_PACKETS_PER_GROUP_OF_CWF ];
19 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F1[ NB_PACKETS_PER_GROUP_OF_CWF ];
20 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_BURST[ NB_PACKETS_PER_GROUP_OF_CWF ];
20 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_BURST[ NB_PACKETS_PER_GROUP_OF_CWF ];
21 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_SBM2[ NB_PACKETS_PER_GROUP_OF_CWF ];
21 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F2_SBM2[ NB_PACKETS_PER_GROUP_OF_CWF ];
22 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3[ NB_PACKETS_PER_GROUP_OF_CWF ];
22 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3[ NB_PACKETS_PER_GROUP_OF_CWF ];
23 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3_light[ NB_PACKETS_PER_GROUP_OF_CWF_LIGHT ];
23 Header_TM_LFR_SCIENCE_CWF_t headerCWF_F3_light[ NB_PACKETS_PER_GROUP_OF_CWF_LIGHT ];
24
24
25 //**************
25 //**************
26 // waveform ring
26 // waveform ring
27 ring_node waveform_ring_f0[NB_RING_NODES_F0];
27 ring_node waveform_ring_f0[NB_RING_NODES_F0];
28 ring_node waveform_ring_f1[NB_RING_NODES_F1];
28 ring_node waveform_ring_f1[NB_RING_NODES_F1];
29 ring_node waveform_ring_f2[NB_RING_NODES_F2];
29 ring_node waveform_ring_f2[NB_RING_NODES_F2];
30 ring_node *current_ring_node_f0;
30 ring_node *current_ring_node_f0;
31 ring_node *ring_node_to_send_swf_f0;
31 ring_node *ring_node_to_send_swf_f0;
32 ring_node *current_ring_node_f1;
32 ring_node *current_ring_node_f1;
33 ring_node *ring_node_to_send_swf_f1;
33 ring_node *ring_node_to_send_swf_f1;
34 ring_node *ring_node_to_send_cwf_f1;
34 ring_node *ring_node_to_send_cwf_f1;
35 ring_node *current_ring_node_f2;
35 ring_node *current_ring_node_f2;
36 ring_node *ring_node_to_send_swf_f2;
36 ring_node *ring_node_to_send_swf_f2;
37 ring_node *ring_node_to_send_cwf_f2;
37 ring_node *ring_node_to_send_cwf_f2;
38
38
39 bool extractSWF = false;
40
41 int wf_snap_f1_extracted[ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET ];
42
39 rtems_isr waveforms_isr( rtems_vector_number vector )
43 rtems_isr waveforms_isr( rtems_vector_number vector )
40 {
44 {
41 /** This is the interrupt sub routine called by the waveform picker core.
45 /** This is the interrupt sub routine called by the waveform picker core.
42 *
46 *
43 * This ISR launch different actions depending mainly on two pieces of information:
47 * This ISR launch different actions depending mainly on two pieces of information:
44 * 1. the values read in the registers of the waveform picker.
48 * 1. the values read in the registers of the waveform picker.
45 * 2. the current LFR mode.
49 * 2. the current LFR mode.
46 *
50 *
47 */
51 */
48
52
49 static unsigned char nb_swf = 0;
53 static unsigned char nb_swf = 0;
50
54
51 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
55 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
52 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
56 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
53 { // in modes other than STANDBY and BURST, send the CWF_F3 data
57 { // in modes other than STANDBY and BURST, send the CWF_F3 data
54 if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full
58 if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full
55 // (1) change the receiving buffer for the waveform picker
59 // (1) change the receiving buffer for the waveform picker
56 if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) {
60 if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) {
57 waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_b);
61 waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_b);
58 }
62 }
59 else {
63 else {
60 waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a);
64 waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a);
61 }
65 }
62 // (2) send an event for the waveforms transmission
66 // (2) send an event for the waveforms transmission
63 if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
67 if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
64 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
68 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
65 }
69 }
66 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111]
70 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111]
67 }
71 }
68 }
72 }
69
73
70 switch(lfrCurrentMode)
74 switch(lfrCurrentMode)
71 {
75 {
72 //********
76 //********
73 // STANDBY
77 // STANDBY
74 case(LFR_MODE_STANDBY):
78 case(LFR_MODE_STANDBY):
75 break;
79 break;
76
80
77 //******
81 //******
78 // NORMAL
82 // NORMAL
79 case(LFR_MODE_NORMAL):
83 case(LFR_MODE_NORMAL):
80 if ( (waveform_picker_regs->status & 0xff8) != 0x00) // [1000] check the error bits
84 if ( (waveform_picker_regs->status & 0xff8) != 0x00) // [1000] check the error bits
81 {
85 {
82 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
86 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
83 }
87 }
84 if ( (waveform_picker_regs->status & 0x07) == 0x07) // [0111] check the f2, f1, f0 full bits
88 if ( (waveform_picker_regs->status & 0x07) == 0x07) // [0111] check the f2, f1, f0 full bits
85 {
89 {
86 // change F0 ring node
90 // change F0 ring node
87 ring_node_to_send_swf_f0 = current_ring_node_f0;
91 ring_node_to_send_swf_f0 = current_ring_node_f0;
88 current_ring_node_f0 = current_ring_node_f0->next;
92 current_ring_node_f0 = current_ring_node_f0->next;
89 waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address;
93 waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address;
90 // change F1 ring node
94 // change F1 ring node
91 ring_node_to_send_swf_f1 = current_ring_node_f1;
95 ring_node_to_send_swf_f1 = current_ring_node_f1;
92 current_ring_node_f1 = current_ring_node_f1->next;
96 current_ring_node_f1 = current_ring_node_f1->next;
93 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
97 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
94 // change F2 ring node
98 // change F2 ring node
95 ring_node_to_send_swf_f2 = current_ring_node_f2;
99 ring_node_to_send_swf_f2 = current_ring_node_f2;
96 current_ring_node_f2 = current_ring_node_f2->next;
100 current_ring_node_f2 = current_ring_node_f2->next;
97 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;
98 //
102 //
99 // if (nb_swf < 2)
103 // if (nb_swf < 2)
100 if (true)
104 if (true)
101 {
105 {
102 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
106 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
103 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
107 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
104 }
108 }
105 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff888; // [1000 1000 1000]
109 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff888; // [1000 1000 1000]
106 nb_swf = nb_swf + 1;
110 nb_swf = nb_swf + 1;
107 }
111 }
108 else
112 else
109 {
113 {
110 reset_wfp_burst_enable();
114 reset_wfp_burst_enable();
111 nb_swf = 0;
115 nb_swf = 0;
112 }
116 }
113
117
114 }
118 }
115
119
116 break;
120 break;
117
121
118 //******
122 //******
119 // BURST
123 // BURST
120 case(LFR_MODE_BURST):
124 case(LFR_MODE_BURST):
121 if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit
125 if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit
122 // (1) change the receiving buffer for the waveform picker
126 // (1) change the receiving buffer for the waveform picker
123 ring_node_to_send_cwf_f2 = current_ring_node_f2;
127 ring_node_to_send_cwf_f2 = current_ring_node_f2;
124 current_ring_node_f2 = current_ring_node_f2->next;
128 current_ring_node_f2 = current_ring_node_f2->next;
125 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
129 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
126 // (2) send an event for the waveforms transmission
130 // (2) send an event for the waveforms transmission
127 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
131 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
128 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
132 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
129 }
133 }
130 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
134 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
131 }
135 }
132 break;
136 break;
133
137
134 //*****
138 //*****
135 // SBM1
139 // SBM1
136 case(LFR_MODE_SBM1):
140 case(LFR_MODE_SBM1):
137 if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit
141 if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit
142 // (0) launch snapshot extraction if needed
143 if (extractSWF == true)
144 {
145 ring_node_to_send_swf_f1 = current_ring_node_f1;
146 if (rtems_event_send( Task_id[TASKID_SWBD], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
147 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
148 }
149 extractSWF = false;
150 }
138 // (1) change the receiving buffer for the waveform picker
151 // (1) change the receiving buffer for the waveform picker
139 ring_node_to_send_cwf_f1 = current_ring_node_f1;
152 ring_node_to_send_cwf_f1 = current_ring_node_f1;
140 current_ring_node_f1 = current_ring_node_f1->next;
153 current_ring_node_f1 = current_ring_node_f1->next;
141 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
154 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
142 // (2) send an event for the waveforms transmission
155 // (2) send an event for the the CWF1 task for transmission
143 if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) {
156 if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) {
144 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
157 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
145 }
158 }
146 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0
159 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bits = 0
147 }
148 if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit
149 ring_node_to_send_swf_f1 = current_ring_node_f1->previous;
150 }
151 if ( (waveform_picker_regs->status & 0x04) == 0x04 ) { // [0100] check the f2 full bit
152 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
153 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
154 }
155 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0
156 }
157 break;
158
159 //*****
160 // SBM2
161 case(LFR_MODE_SBM2):
162 if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit
163 // (1) change the receiving buffer for the waveform picker
164 ring_node_to_send_cwf_f2 = current_ring_node_f2;
165 current_ring_node_f2 = current_ring_node_f2->next;
166 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
167 // (2) send an event for the waveforms transmission
168 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) {
169 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
170 }
171 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
172 }
160 }
173 if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit
161 if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit
174 ring_node_to_send_swf_f2 = current_ring_node_f2->previous;
162 extractSWF = true;
175 }
163 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffeee; // [1111 1110 1110 1110] f0 bits = 0
176 if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit
177 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
178 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
179 }
180 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0
181 }
164 }
182 break;
165 if ( (waveform_picker_regs->status & 0x04) == 0x04 ) { // [0100] check the f2 full bit
183
166 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) {
184 //********
185 // DEFAULT
186 default:
187 break;
188 }
189 }
190
191 rtems_isr waveforms_isr_alt( rtems_vector_number vector )
192 {
193 /** This is the interrupt sub routine called by the waveform picker core.
194 *
195 * This ISR launch different actions depending mainly on two pieces of information:
196 * 1. the values read in the registers of the waveform picker.
197 * 2. the current LFR mode.
198 *
199 */
200
201 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
202 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
203 { // in modes other than STANDBY and BURST, send the CWF_F3 data
204 if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full
205 // (1) change the receiving buffer for the waveform picker
206 if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) {
207 waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_b);
208 }
209 else {
210 waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a);
211 }
212 // (2) send an event for the waveforms transmission
213 if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
214 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
167 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
215 }
168 }
216 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111]
169 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bits = 0
217 }
218 }
219
220 switch(lfrCurrentMode)
221 {
222 //********
223 // STANDBY
224 case(LFR_MODE_STANDBY):
225 break;
226
227 //******
228 // NORMAL
229 case(LFR_MODE_NORMAL):
230 if ( (waveform_picker_regs->status & 0xff8) != 0x00) // [1000] check the error bits
231 {
232 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
233 }
234 if ( (waveform_picker_regs->status & 0x01) == 0x01) // [0001] check the f0 full bit
235 {
236 // change F0 ring node
237 ring_node_to_send_swf_f0 = current_ring_node_f0;
238 current_ring_node_f0 = current_ring_node_f0->next;
239 waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address;
240 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffeee; // [1110 1110 1110]
241 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL_SWF_F0 ) != RTEMS_SUCCESSFUL) {
242 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
243 }
244 }
245 if ( (waveform_picker_regs->status & 0x02) == 0x02) // [0010] check the f1 full bit
246 {
247 // change F1 ring node
248 ring_node_to_send_swf_f1 = current_ring_node_f1;
249 current_ring_node_f1 = current_ring_node_f1->next;
250 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
251 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1101 1101 1101]
252 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL_SWF_F1 ) != RTEMS_SUCCESSFUL) {
253 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
254 }
255 }
256 if ( (waveform_picker_regs->status & 0x04) == 0x04) // [0100] check the f2 full bit
257 {
258 // change F2 ring node
259 ring_node_to_send_swf_f2 = current_ring_node_f2;
260 current_ring_node_f2 = current_ring_node_f2->next;
261 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
262 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1011 1011 1011]
263 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL_SWF_F2 ) != RTEMS_SUCCESSFUL) {
264 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
265 }
266 }
267 break;
268
269 //******
270 // BURST
271 case(LFR_MODE_BURST):
272 if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit
273 // (1) change the receiving buffer for the waveform picker
274 ring_node_to_send_cwf_f2 = current_ring_node_f2;
275 current_ring_node_f2 = current_ring_node_f2->next;
276 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
277 // (2) send an event for the waveforms transmission
278 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
279 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
280 }
281 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
282 }
283 break;
284
285 //*****
286 // SBM1
287 case(LFR_MODE_SBM1):
288 if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit
289 // (1) change the receiving buffer for the waveform picker
290 ring_node_to_send_cwf_f1 = current_ring_node_f1;
291 current_ring_node_f1 = current_ring_node_f1->next;
292 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
293 // (2) send an event for the waveforms transmission
294 if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) {
295 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
296 }
297 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0
298 }
299 if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit
300 ring_node_to_send_swf_f1 = current_ring_node_f1->previous;
301 }
302 if ( (waveform_picker_regs->status & 0x04) == 0x04 ) { // [0100] check the f2 full bit
303 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
304 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
305 }
306 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0
307 }
170 }
308 break;
171 break;
309
172
310 //*****
173 //*****
311 // SBM2
174 // SBM2
312 case(LFR_MODE_SBM2):
175 case(LFR_MODE_SBM2):
313 if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit
176 if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit
314 // (1) change the receiving buffer for the waveform picker
177 // (1) change the receiving buffer for the waveform picker
315 ring_node_to_send_cwf_f2 = current_ring_node_f2;
178 ring_node_to_send_cwf_f2 = current_ring_node_f2;
316 current_ring_node_f2 = current_ring_node_f2->next;
179 current_ring_node_f2 = current_ring_node_f2->next;
317 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
180 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
318 // (2) send an event for the waveforms transmission
181 // (2) send an event for the waveforms transmission
319 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) {
182 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) {
320 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
183 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
321 }
184 }
322 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
185 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
323 }
186 }
324 if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit
187 if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit
325 ring_node_to_send_swf_f2 = current_ring_node_f2->previous;
188 ring_node_to_send_swf_f2 = current_ring_node_f2->previous;
326 }
189 }
327 if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit
190 if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit
328 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
191 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) {
329 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
192 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
330 }
193 }
331 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0
194 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0
332 }
195 }
333 break;
196 break;
334
197
335 //********
198 //********
336 // DEFAULT
199 // DEFAULT
337 default:
200 default:
338 break;
201 break;
339 }
202 }
340 }
203 }
341
204
342 rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
205 rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
343 {
206 {
344 /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode.
207 /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode.
345 *
208 *
346 * @param unused is the starting argument of the RTEMS task
209 * @param unused is the starting argument of the RTEMS task
347 *
210 *
348 * The following data packets are sent by this task:
211 * The following data packets are sent by this task:
349 * - TM_LFR_SCIENCE_NORMAL_SWF_F0
212 * - TM_LFR_SCIENCE_NORMAL_SWF_F0
350 * - TM_LFR_SCIENCE_NORMAL_SWF_F1
213 * - TM_LFR_SCIENCE_NORMAL_SWF_F1
351 * - TM_LFR_SCIENCE_NORMAL_SWF_F2
214 * - TM_LFR_SCIENCE_NORMAL_SWF_F2
352 *
215 *
353 */
216 */
354
217
355 rtems_event_set event_out;
218 rtems_event_set event_out;
356 rtems_id queue_id;
219 rtems_id queue_id;
357 rtems_status_code status;
220 rtems_status_code status;
358
221
359 init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 );
222 init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 );
360 init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 );
223 init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 );
361 init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 );
224 init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 );
362
225
363 init_waveforms();
226 init_waveforms();
364
227
365 status = get_message_queue_id_send( &queue_id );
228 status = get_message_queue_id_send( &queue_id );
366 if (status != RTEMS_SUCCESSFUL)
229 if (status != RTEMS_SUCCESSFUL)
367 {
230 {
368 PRINTF1("in WFRM *** ERR get_message_queue_id_send %d\n", status)
231 PRINTF1("in WFRM *** ERR get_message_queue_id_send %d\n", status)
369 }
232 }
370
233
371 BOOT_PRINTF("in WFRM ***\n")
234 BOOT_PRINTF("in WFRM ***\n")
372
235
373 while(1){
236 while(1){
374 // wait for an RTEMS_EVENT
237 // wait for an RTEMS_EVENT
375 rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1
238 rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1
376 | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM
239 | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM,
377 | RTEMS_EVENT_MODE_NORMAL_SWF_F0
378 | RTEMS_EVENT_MODE_NORMAL_SWF_F1
379 | RTEMS_EVENT_MODE_NORMAL_SWF_F2,
380 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
240 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
381 if (event_out == RTEMS_EVENT_MODE_NORMAL)
241 if (event_out == RTEMS_EVENT_MODE_NORMAL)
382 {
242 {
243 PRINTF("WFRM received RTEMS_EVENT_MODE_NORMAL\n")
383 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
244 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
384 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
245 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
385 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
246 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
386 }
247 }
387 if ( (event_out & RTEMS_EVENT_MODE_NORMAL_SWF_F0) == RTEMS_EVENT_MODE_NORMAL_SWF_F0)
248 if (event_out == RTEMS_EVENT_MODE_SBM1)
388 {
249 {
250 PRINTF("WFRM received RTEMS_EVENT_MODE_SBM1\n")
389 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
251 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
390 }
252 send_waveform_SWF((volatile int*) wf_snap_f1_extracted , SID_NORM_SWF_F1, headerSWF_F1, queue_id);
391 if ( (event_out & RTEMS_EVENT_MODE_NORMAL_SWF_F1) == RTEMS_EVENT_MODE_NORMAL_SWF_F1)
392 {
393 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
394 }
395 if ( (event_out & RTEMS_EVENT_MODE_NORMAL_SWF_F2) == RTEMS_EVENT_MODE_NORMAL_SWF_F2)
396 {
397 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
253 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
398 }
254 }
399 }
255 }
400 }
256 }
401
257
402 rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
258 rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
403 {
259 {
404 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3.
260 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3.
405 *
261 *
406 * @param unused is the starting argument of the RTEMS task
262 * @param unused is the starting argument of the RTEMS task
407 *
263 *
408 * The following data packet is sent by this task:
264 * The following data packet is sent by this task:
409 * - TM_LFR_SCIENCE_NORMAL_CWF_F3
265 * - TM_LFR_SCIENCE_NORMAL_CWF_F3
410 *
266 *
411 */
267 */
412
268
413 rtems_event_set event_out;
269 rtems_event_set event_out;
414 rtems_id queue_id;
270 rtems_id queue_id;
415 rtems_status_code status;
271 rtems_status_code status;
416
272
417 init_header_continuous_wf_table( SID_NORM_CWF_LONG_F3, headerCWF_F3 );
273 init_header_continuous_wf_table( SID_NORM_CWF_LONG_F3, headerCWF_F3 );
418 init_header_continuous_cwf3_light_table( headerCWF_F3_light );
274 init_header_continuous_cwf3_light_table( headerCWF_F3_light );
419
275
420 status = get_message_queue_id_send( &queue_id );
276 status = get_message_queue_id_send( &queue_id );
421 if (status != RTEMS_SUCCESSFUL)
277 if (status != RTEMS_SUCCESSFUL)
422 {
278 {
423 PRINTF1("in CWF3 *** ERR get_message_queue_id_send %d\n", status)
279 PRINTF1("in CWF3 *** ERR get_message_queue_id_send %d\n", status)
424 }
280 }
425
281
426 BOOT_PRINTF("in CWF3 ***\n")
282 BOOT_PRINTF("in CWF3 ***\n")
427
283
428 while(1){
284 while(1){
429 // wait for an RTEMS_EVENT
285 // wait for an RTEMS_EVENT
430 rtems_event_receive( RTEMS_EVENT_0,
286 rtems_event_receive( RTEMS_EVENT_0,
431 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
287 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
432 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
288 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
433 {
289 {
434 PRINTF("send CWF_LONG_F3\n")
290 PRINTF("send CWF_LONG_F3\n")
435 }
291 }
436 else
292 else
437 {
293 {
438 PRINTF("send CWF_F3 (light)\n")
294 PRINTF("send CWF_F3 (light)\n")
439 }
295 }
440 if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) {
296 if (waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3_a) {
441 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
297 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
442 {
298 {
443 send_waveform_CWF( wf_cont_f3_b, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id );
299 send_waveform_CWF( wf_cont_f3_b, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id );
444 }
300 }
445 else
301 else
446 {
302 {
447 send_waveform_CWF3_light( wf_cont_f3_b, headerCWF_F3_light, queue_id );
303 send_waveform_CWF3_light( wf_cont_f3_b, headerCWF_F3_light, queue_id );
448 }
304 }
449 }
305 }
450 else
306 else
451 {
307 {
452 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
308 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
453 {
309 {
454 send_waveform_CWF( wf_cont_f3_a, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id );
310 send_waveform_CWF( wf_cont_f3_a, SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id );
455 }
311 }
456 else
312 else
457 {
313 {
458 send_waveform_CWF3_light( wf_cont_f3_a, headerCWF_F3_light, queue_id );
314 send_waveform_CWF3_light( wf_cont_f3_a, headerCWF_F3_light, queue_id );
459 }
315 }
460
316
461 }
317 }
462 }
318 }
463 }
319 }
464
320
465 rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2
321 rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2
466 {
322 {
467 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2.
323 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2.
468 *
324 *
469 * @param unused is the starting argument of the RTEMS task
325 * @param unused is the starting argument of the RTEMS task
470 *
326 *
471 * The following data packet is sent by this function:
327 * The following data packet is sent by this function:
472 * - TM_LFR_SCIENCE_BURST_CWF_F2
328 * - TM_LFR_SCIENCE_BURST_CWF_F2
473 * - TM_LFR_SCIENCE_SBM2_CWF_F2
329 * - TM_LFR_SCIENCE_SBM2_CWF_F2
474 *
330 *
475 */
331 */
476
332
477 rtems_event_set event_out;
333 rtems_event_set event_out;
478 rtems_id queue_id;
334 rtems_id queue_id;
479 rtems_status_code status;
335 rtems_status_code status;
480
336
481 init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST );
337 init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST );
482 init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 );
338 init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 );
483
339
484 status = get_message_queue_id_send( &queue_id );
340 status = get_message_queue_id_send( &queue_id );
485 if (status != RTEMS_SUCCESSFUL)
341 if (status != RTEMS_SUCCESSFUL)
486 {
342 {
487 PRINTF1("in CWF2 *** ERR get_message_queue_id_send %d\n", status)
343 PRINTF1("in CWF2 *** ERR get_message_queue_id_send %d\n", status)
488 }
344 }
489
345
490 BOOT_PRINTF("in CWF2 ***\n")
346 BOOT_PRINTF("in CWF2 ***\n")
491
347
492 while(1){
348 while(1){
493 // wait for an RTEMS_EVENT
349 // wait for an RTEMS_EVENT
494 rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2,
350 rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2,
495 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
351 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
496 if (event_out == RTEMS_EVENT_MODE_BURST)
352 if (event_out == RTEMS_EVENT_MODE_BURST)
497 {
353 {
498 send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id );
354 send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id );
499 }
355 }
500 if (event_out == RTEMS_EVENT_MODE_SBM2)
356 if (event_out == RTEMS_EVENT_MODE_SBM2)
501 {
357 {
502 send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
358 send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
503 }
359 }
504 }
360 }
505 }
361 }
506
362
507 rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1
363 rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1
508 {
364 {
509 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1.
365 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1.
510 *
366 *
511 * @param unused is the starting argument of the RTEMS task
367 * @param unused is the starting argument of the RTEMS task
512 *
368 *
513 * The following data packet is sent by this function:
369 * The following data packet is sent by this function:
514 * - TM_LFR_SCIENCE_SBM1_CWF_F1
370 * - TM_LFR_SCIENCE_SBM1_CWF_F1
515 *
371 *
516 */
372 */
517
373
518 rtems_event_set event_out;
374 rtems_event_set event_out;
519 rtems_id queue_id;
375 rtems_id queue_id;
520 rtems_status_code status;
376 rtems_status_code status;
521
377
522 init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 );
378 init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 );
523
379
524 status = get_message_queue_id_send( &queue_id );
380 status = get_message_queue_id_send( &queue_id );
525 if (status != RTEMS_SUCCESSFUL)
381 if (status != RTEMS_SUCCESSFUL)
526 {
382 {
527 PRINTF1("in CWF1 *** ERR get_message_queue_id_send %d\n", status)
383 PRINTF1("in CWF1 *** ERR get_message_queue_id_send %d\n", status)
528 }
384 }
529
385
530 BOOT_PRINTF("in CWF1 ***\n")
386 BOOT_PRINTF("in CWF1 ***\n")
531
387
532 while(1){
388 while(1){
533 // wait for an RTEMS_EVENT
389 // wait for an RTEMS_EVENT
534 rtems_event_receive( RTEMS_EVENT_MODE_SBM1,
390 rtems_event_receive( RTEMS_EVENT_MODE_SBM1,
535 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
391 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
536 send_waveform_CWF( (volatile int*) ring_node_to_send_cwf_f1->buffer_address, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
392 send_waveform_CWF( (volatile int*) ring_node_to_send_cwf_f1->buffer_address, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
537 }
393 }
538 }
394 }
539
395
396 rtems_task swbd_task(rtems_task_argument argument)
397 {
398 /** This RTEMS task is dedicated to the building of snapshots from different continuous waveforms buffers.
399 *
400 * @param unused is the starting argument of the RTEMS task
401 *
402 */
403
404 rtems_event_set event_out;
405
406 BOOT_PRINTF("in SWBD ***\n")
407
408 while(1){
409 // wait for an RTEMS_EVENT
410 rtems_event_receive( RTEMS_EVENT_0,
411 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
412 build_snapshot_from_ring();
413 }
414 }
415
540 //******************
416 //******************
541 // general functions
417 // general functions
542 void init_waveforms( void )
418 void init_waveforms( void )
543 {
419 {
544 int i = 0;
420 int i = 0;
545
421
546 for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
422 for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
547 {
423 {
548 //***
424 //***
549 // F0
425 // F0
550 // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; //
426 // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; //
551 // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; //
427 // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; //
552 // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; //
428 // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; //
553
429
554 //***
430 //***
555 // F1
431 // F1
556 // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111;
432 // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111;
557 // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333;
433 // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333;
558 // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
434 // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
559
435
560 //***
436 //***
561 // F2
437 // F2
562 // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333;
438 // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333;
563 // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111;
439 // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111;
564 // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
440 // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
565
441
566 //***
442 //***
567 // F3
443 // F3
568 // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1;
444 // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1;
569 // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2;
445 // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2;
570 // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000;
446 // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000;
571 }
447 }
572 }
448 }
573
449
574 void init_waveform_rings( void )
450 void init_waveform_rings( void )
575 {
451 {
576 unsigned char i;
452 unsigned char i;
577
453
578 // F0 RING
454 // F0 RING
579 waveform_ring_f0[0].next = (ring_node*) &waveform_ring_f0[1];
455 waveform_ring_f0[0].next = (ring_node*) &waveform_ring_f0[1];
580 waveform_ring_f0[0].previous = (ring_node*) &waveform_ring_f0[NB_RING_NODES_F0-1];
456 waveform_ring_f0[0].previous = (ring_node*) &waveform_ring_f0[NB_RING_NODES_F0-1];
581 waveform_ring_f0[0].buffer_address = (int) &wf_snap_f0[0][0];
457 waveform_ring_f0[0].buffer_address = (int) &wf_snap_f0[0][0];
582
458
583 waveform_ring_f0[NB_RING_NODES_F0-1].next = (ring_node*) &waveform_ring_f0[0];
459 waveform_ring_f0[NB_RING_NODES_F0-1].next = (ring_node*) &waveform_ring_f0[0];
584 waveform_ring_f0[NB_RING_NODES_F0-1].previous = (ring_node*) &waveform_ring_f0[NB_RING_NODES_F0-2];
460 waveform_ring_f0[NB_RING_NODES_F0-1].previous = (ring_node*) &waveform_ring_f0[NB_RING_NODES_F0-2];
585 waveform_ring_f0[NB_RING_NODES_F0-1].buffer_address = (int) &wf_snap_f0[NB_RING_NODES_F0-1][0];
461 waveform_ring_f0[NB_RING_NODES_F0-1].buffer_address = (int) &wf_snap_f0[NB_RING_NODES_F0-1][0];
586
462
587 for(i=1; i<NB_RING_NODES_F0-1; i++)
463 for(i=1; i<NB_RING_NODES_F0-1; i++)
588 {
464 {
589 waveform_ring_f0[i].next = (ring_node*) &waveform_ring_f0[i+1];
465 waveform_ring_f0[i].next = (ring_node*) &waveform_ring_f0[i+1];
590 waveform_ring_f0[i].previous = (ring_node*) &waveform_ring_f0[i-1];
466 waveform_ring_f0[i].previous = (ring_node*) &waveform_ring_f0[i-1];
591 waveform_ring_f0[i].buffer_address = (int) &wf_snap_f0[i][0];
467 waveform_ring_f0[i].buffer_address = (int) &wf_snap_f0[i][0];
592 }
468 }
593
469
594 // F1 RING
470 // F1 RING
595 waveform_ring_f1[0].next = (ring_node*) &waveform_ring_f1[1];
471 waveform_ring_f1[0].next = (ring_node*) &waveform_ring_f1[1];
596 waveform_ring_f1[0].previous = (ring_node*) &waveform_ring_f1[NB_RING_NODES_F1-1];
472 waveform_ring_f1[0].previous = (ring_node*) &waveform_ring_f1[NB_RING_NODES_F1-1];
597 waveform_ring_f1[0].buffer_address = (int) &wf_snap_f1[0][0];
473 waveform_ring_f1[0].buffer_address = (int) &wf_snap_f1[0][0];
598
474
599 waveform_ring_f1[NB_RING_NODES_F1-1].next = (ring_node*) &waveform_ring_f1[0];
475 waveform_ring_f1[NB_RING_NODES_F1-1].next = (ring_node*) &waveform_ring_f1[0];
600 waveform_ring_f1[NB_RING_NODES_F1-1].previous = (ring_node*) &waveform_ring_f1[NB_RING_NODES_F1-2];
476 waveform_ring_f1[NB_RING_NODES_F1-1].previous = (ring_node*) &waveform_ring_f1[NB_RING_NODES_F1-2];
601 waveform_ring_f1[NB_RING_NODES_F1-1].buffer_address = (int) &wf_snap_f1[NB_RING_NODES_F1-1][0];
477 waveform_ring_f1[NB_RING_NODES_F1-1].buffer_address = (int) &wf_snap_f1[NB_RING_NODES_F1-1][0];
602
478
603 for(i=1; i<NB_RING_NODES_F1-1; i++)
479 for(i=1; i<NB_RING_NODES_F1-1; i++)
604 {
480 {
605 waveform_ring_f1[i].next = (ring_node*) &waveform_ring_f1[i+1];
481 waveform_ring_f1[i].next = (ring_node*) &waveform_ring_f1[i+1];
606 waveform_ring_f1[i].previous = (ring_node*) &waveform_ring_f1[i-1];
482 waveform_ring_f1[i].previous = (ring_node*) &waveform_ring_f1[i-1];
607 waveform_ring_f1[i].buffer_address = (int) &wf_snap_f1[i][0];
483 waveform_ring_f1[i].buffer_address = (int) &wf_snap_f1[i][0];
608 }
484 }
609
485
610 // F2 RING
486 // F2 RING
611 waveform_ring_f2[0].next = (ring_node*) &waveform_ring_f2[1];
487 waveform_ring_f2[0].next = (ring_node*) &waveform_ring_f2[1];
612 waveform_ring_f2[0].previous = (ring_node*) &waveform_ring_f2[NB_RING_NODES_F2-1];
488 waveform_ring_f2[0].previous = (ring_node*) &waveform_ring_f2[NB_RING_NODES_F2-1];
613 waveform_ring_f2[0].buffer_address = (int) &wf_snap_f2[0][0];
489 waveform_ring_f2[0].buffer_address = (int) &wf_snap_f2[0][0];
614
490
615 waveform_ring_f2[NB_RING_NODES_F2-1].next = (ring_node*) &waveform_ring_f2[0];
491 waveform_ring_f2[NB_RING_NODES_F2-1].next = (ring_node*) &waveform_ring_f2[0];
616 waveform_ring_f2[NB_RING_NODES_F2-1].previous = (ring_node*) &waveform_ring_f2[NB_RING_NODES_F2-2];
492 waveform_ring_f2[NB_RING_NODES_F2-1].previous = (ring_node*) &waveform_ring_f2[NB_RING_NODES_F2-2];
617 waveform_ring_f2[NB_RING_NODES_F2-1].buffer_address = (int) &wf_snap_f2[NB_RING_NODES_F2-1][0];
493 waveform_ring_f2[NB_RING_NODES_F2-1].buffer_address = (int) &wf_snap_f2[NB_RING_NODES_F2-1][0];
618
494
619 for(i=1; i<NB_RING_NODES_F2-1; i++)
495 for(i=1; i<NB_RING_NODES_F2-1; i++)
620 {
496 {
621 waveform_ring_f2[i].next = (ring_node*) &waveform_ring_f2[i+1];
497 waveform_ring_f2[i].next = (ring_node*) &waveform_ring_f2[i+1];
622 waveform_ring_f2[i].previous = (ring_node*) &waveform_ring_f2[i-1];
498 waveform_ring_f2[i].previous = (ring_node*) &waveform_ring_f2[i-1];
623 waveform_ring_f2[i].buffer_address = (int) &wf_snap_f2[i][0];
499 waveform_ring_f2[i].buffer_address = (int) &wf_snap_f2[i][0];
624 }
500 }
625
501
626 DEBUG_PRINTF1("waveform_ring_f0 @%x\n", (unsigned int) waveform_ring_f0)
502 DEBUG_PRINTF1("waveform_ring_f0 @%x\n", (unsigned int) waveform_ring_f0)
627 DEBUG_PRINTF1("waveform_ring_f1 @%x\n", (unsigned int) waveform_ring_f1)
503 DEBUG_PRINTF1("waveform_ring_f1 @%x\n", (unsigned int) waveform_ring_f1)
628 DEBUG_PRINTF1("waveform_ring_f2 @%x\n", (unsigned int) waveform_ring_f2)
504 DEBUG_PRINTF1("waveform_ring_f2 @%x\n", (unsigned int) waveform_ring_f2)
629
505
630 }
506 }
631
507
632 void reset_current_ring_nodes( void )
508 void reset_current_ring_nodes( void )
633 {
509 {
634 current_ring_node_f0 = waveform_ring_f0;
510 current_ring_node_f0 = waveform_ring_f0;
635 ring_node_to_send_swf_f0 = waveform_ring_f0;
511 ring_node_to_send_swf_f0 = waveform_ring_f0;
636
512
637 current_ring_node_f1 = waveform_ring_f1;
513 current_ring_node_f1 = waveform_ring_f1;
638 ring_node_to_send_cwf_f1 = waveform_ring_f1;
514 ring_node_to_send_cwf_f1 = waveform_ring_f1;
639 ring_node_to_send_swf_f1 = waveform_ring_f1;
515 ring_node_to_send_swf_f1 = waveform_ring_f1;
640
516
641 current_ring_node_f2 = waveform_ring_f2;
517 current_ring_node_f2 = waveform_ring_f2;
642 ring_node_to_send_cwf_f2 = waveform_ring_f2;
518 ring_node_to_send_cwf_f2 = waveform_ring_f2;
643 ring_node_to_send_swf_f2 = waveform_ring_f2;
519 ring_node_to_send_swf_f2 = waveform_ring_f2;
644 }
520 }
645
521
646 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF)
522 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF)
647 {
523 {
648 unsigned char i;
524 unsigned char i;
649
525
650 for (i=0; i<7; i++)
526 for (i=0; i<7; i++)
651 {
527 {
652 headerSWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
528 headerSWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
653 headerSWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
529 headerSWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
654 headerSWF[ i ].reserved = DEFAULT_RESERVED;
530 headerSWF[ i ].reserved = DEFAULT_RESERVED;
655 headerSWF[ i ].userApplication = CCSDS_USER_APP;
531 headerSWF[ i ].userApplication = CCSDS_USER_APP;
656 headerSWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
532 headerSWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
657 headerSWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
533 headerSWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
658 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
534 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
659 if (i == 6)
535 if (i == 6)
660 {
536 {
661 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_224 >> 8);
537 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_224 >> 8);
662 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_224 );
538 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_224 );
663 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_224 >> 8);
539 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_224 >> 8);
664 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_224 );
540 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_224 );
665 }
541 }
666 else
542 else
667 {
543 {
668 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_304 >> 8);
544 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_304 >> 8);
669 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_304 );
545 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_304 );
670 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_304 >> 8);
546 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_304 >> 8);
671 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_304 );
547 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_304 );
672 }
548 }
673 headerSWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
549 headerSWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
674 headerSWF[ i ].pktCnt = DEFAULT_PKTCNT; // PKT_CNT
550 headerSWF[ i ].pktCnt = DEFAULT_PKTCNT; // PKT_CNT
675 headerSWF[ i ].pktNr = i+1; // PKT_NR
551 headerSWF[ i ].pktNr = i+1; // PKT_NR
676 // DATA FIELD HEADER
552 // DATA FIELD HEADER
677 headerSWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
553 headerSWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
678 headerSWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
554 headerSWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
679 headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
555 headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
680 headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
556 headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
681 // AUXILIARY DATA HEADER
557 // AUXILIARY DATA HEADER
682 headerSWF[ i ].time[0] = 0x00;
558 headerSWF[ i ].time[0] = 0x00;
683 headerSWF[ i ].time[0] = 0x00;
559 headerSWF[ i ].time[0] = 0x00;
684 headerSWF[ i ].time[0] = 0x00;
560 headerSWF[ i ].time[0] = 0x00;
685 headerSWF[ i ].time[0] = 0x00;
561 headerSWF[ i ].time[0] = 0x00;
686 headerSWF[ i ].time[0] = 0x00;
562 headerSWF[ i ].time[0] = 0x00;
687 headerSWF[ i ].time[0] = 0x00;
563 headerSWF[ i ].time[0] = 0x00;
688 headerSWF[ i ].sid = sid;
564 headerSWF[ i ].sid = sid;
689 headerSWF[ i ].hkBIA = DEFAULT_HKBIA;
565 headerSWF[ i ].hkBIA = DEFAULT_HKBIA;
690 }
566 }
691 return LFR_SUCCESSFUL;
567 return LFR_SUCCESSFUL;
692 }
568 }
693
569
694 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
570 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
695 {
571 {
696 unsigned int i;
572 unsigned int i;
697
573
698 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF; i++)
574 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF; i++)
699 {
575 {
700 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
576 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
701 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
577 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
702 headerCWF[ i ].reserved = DEFAULT_RESERVED;
578 headerCWF[ i ].reserved = DEFAULT_RESERVED;
703 headerCWF[ i ].userApplication = CCSDS_USER_APP;
579 headerCWF[ i ].userApplication = CCSDS_USER_APP;
704 if ( (sid == SID_SBM1_CWF_F1) || (sid == SID_SBM2_CWF_F2) )
580 if ( (sid == SID_SBM1_CWF_F1) || (sid == SID_SBM2_CWF_F2) )
705 {
581 {
706 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2 >> 8);
582 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2 >> 8);
707 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2);
583 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2);
708 }
584 }
709 else
585 else
710 {
586 {
711 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
587 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
712 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
588 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
713 }
589 }
714 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
590 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
715 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_336 >> 8);
591 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_336 >> 8);
716 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_336 );
592 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_336 );
717 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_CWF >> 8);
593 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_CWF >> 8);
718 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_CWF );
594 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_CWF );
719 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
595 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
720 // DATA FIELD HEADER
596 // DATA FIELD HEADER
721 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
597 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
722 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
598 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
723 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
599 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
724 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
600 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
725 // AUXILIARY DATA HEADER
601 // AUXILIARY DATA HEADER
726 headerCWF[ i ].sid = sid;
602 headerCWF[ i ].sid = sid;
727 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
603 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
728 headerCWF[ i ].time[0] = 0x00;
604 headerCWF[ i ].time[0] = 0x00;
729 headerCWF[ i ].time[0] = 0x00;
605 headerCWF[ i ].time[0] = 0x00;
730 headerCWF[ i ].time[0] = 0x00;
606 headerCWF[ i ].time[0] = 0x00;
731 headerCWF[ i ].time[0] = 0x00;
607 headerCWF[ i ].time[0] = 0x00;
732 headerCWF[ i ].time[0] = 0x00;
608 headerCWF[ i ].time[0] = 0x00;
733 headerCWF[ i ].time[0] = 0x00;
609 headerCWF[ i ].time[0] = 0x00;
734 }
610 }
735 return LFR_SUCCESSFUL;
611 return LFR_SUCCESSFUL;
736 }
612 }
737
613
738 int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
614 int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
739 {
615 {
740 unsigned int i;
616 unsigned int i;
741
617
742 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF_LIGHT; i++)
618 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF_LIGHT; i++)
743 {
619 {
744 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
620 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
745 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
621 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
746 headerCWF[ i ].reserved = DEFAULT_RESERVED;
622 headerCWF[ i ].reserved = DEFAULT_RESERVED;
747 headerCWF[ i ].userApplication = CCSDS_USER_APP;
623 headerCWF[ i ].userApplication = CCSDS_USER_APP;
748
624
749 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
625 headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8);
750 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
626 headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST);
751
627
752 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
628 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
753 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_672 >> 8);
629 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_672 >> 8);
754 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_672 );
630 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_672 );
755 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_CWF_SHORT_F3 >> 8);
631 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_CWF_SHORT_F3 >> 8);
756 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_CWF_SHORT_F3 );
632 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_CWF_SHORT_F3 );
757
633
758 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
634 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
759 // DATA FIELD HEADER
635 // DATA FIELD HEADER
760 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
636 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
761 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
637 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
762 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
638 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
763 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
639 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
764 // AUXILIARY DATA HEADER
640 // AUXILIARY DATA HEADER
765 headerCWF[ i ].sid = SID_NORM_CWF_F3;
641 headerCWF[ i ].sid = SID_NORM_CWF_F3;
766 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
642 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
767 headerCWF[ i ].time[0] = 0x00;
643 headerCWF[ i ].time[0] = 0x00;
768 headerCWF[ i ].time[0] = 0x00;
644 headerCWF[ i ].time[0] = 0x00;
769 headerCWF[ i ].time[0] = 0x00;
645 headerCWF[ i ].time[0] = 0x00;
770 headerCWF[ i ].time[0] = 0x00;
646 headerCWF[ i ].time[0] = 0x00;
771 headerCWF[ i ].time[0] = 0x00;
647 headerCWF[ i ].time[0] = 0x00;
772 headerCWF[ i ].time[0] = 0x00;
648 headerCWF[ i ].time[0] = 0x00;
773 }
649 }
774 return LFR_SUCCESSFUL;
650 return LFR_SUCCESSFUL;
775 }
651 }
776
652
777 int send_waveform_SWF( volatile int *waveform, unsigned int sid,
653 int send_waveform_SWF( volatile int *waveform, unsigned int sid,
778 Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id )
654 Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id )
779 {
655 {
780 /** This function sends SWF CCSDS packets (F2, F1 or F0).
656 /** This function sends SWF CCSDS packets (F2, F1 or F0).
781 *
657 *
782 * @param waveform points to the buffer containing the data that will be send.
658 * @param waveform points to the buffer containing the data that will be send.
783 * @param sid is the source identifier of the data that will be sent.
659 * @param sid is the source identifier of the data that will be sent.
784 * @param headerSWF points to a table of headers that have been prepared for the data transmission.
660 * @param headerSWF points to a table of headers that have been prepared for the data transmission.
785 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
661 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
786 * contain information to setup the transmission of the data packets.
662 * contain information to setup the transmission of the data packets.
787 *
663 *
788 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
664 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
789 *
665 *
790 */
666 */
791
667
792 unsigned int i;
668 unsigned int i;
793 int ret;
669 int ret;
794 unsigned int coarseTime;
670 unsigned int coarseTime;
795 unsigned int fineTime;
671 unsigned int fineTime;
796 rtems_status_code status;
672 rtems_status_code status;
797 spw_ioctl_pkt_send spw_ioctl_send_SWF;
673 spw_ioctl_pkt_send spw_ioctl_send_SWF;
798
674
799 spw_ioctl_send_SWF.hlen = TM_HEADER_LEN + 4 + 12; // + 4 is for the protocole extra header, + 12 is for the auxiliary header
675 spw_ioctl_send_SWF.hlen = TM_HEADER_LEN + 4 + 12; // + 4 is for the protocole extra header, + 12 is for the auxiliary header
800 spw_ioctl_send_SWF.options = 0;
676 spw_ioctl_send_SWF.options = 0;
801
677
802 ret = LFR_DEFAULT;
678 ret = LFR_DEFAULT;
803
679
804 DEBUG_PRINTF1("sid = %d, ", sid)
680 DEBUG_PRINTF1("sid = %d, ", sid)
805 DEBUG_PRINTF2("coarse = %x, fine = %x\n", waveform[0], waveform[1])
681 DEBUG_PRINTF2("coarse = %x, fine = %x\n", waveform[0], waveform[1])
806
682
807 coarseTime = waveform[0];
683 coarseTime = waveform[0];
808 fineTime = waveform[1];
684 fineTime = waveform[1];
809
685
810 for (i=0; i<7; i++) // send waveform
686 for (i=0; i<7; i++) // send waveform
811 {
687 {
812 spw_ioctl_send_SWF.data = (char*) &waveform[ (i * BLK_NR_304 * NB_WORDS_SWF_BLK) + TIME_OFFSET];
688 spw_ioctl_send_SWF.data = (char*) &waveform[ (i * BLK_NR_304 * NB_WORDS_SWF_BLK) + TIME_OFFSET];
813 spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ];
689 spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ];
814 // BUILD THE DATA
690 // BUILD THE DATA
815 if (i==6) {
691 if (i==6) {
816 spw_ioctl_send_SWF.dlen = BLK_NR_224 * NB_BYTES_SWF_BLK;
692 spw_ioctl_send_SWF.dlen = BLK_NR_224 * NB_BYTES_SWF_BLK;
817 }
693 }
818 else {
694 else {
819 spw_ioctl_send_SWF.dlen = BLK_NR_304 * NB_BYTES_SWF_BLK;
695 spw_ioctl_send_SWF.dlen = BLK_NR_304 * NB_BYTES_SWF_BLK;
820 }
696 }
821 // SET PACKET SEQUENCE COUNTER
697 // SET PACKET SEQUENCE COUNTER
822 increment_seq_counter_source_id( headerSWF[ i ].packetSequenceControl, sid );
698 increment_seq_counter_source_id( headerSWF[ i ].packetSequenceControl, sid );
823 // SET PACKET TIME
699 // SET PACKET TIME
824 compute_acquisition_time( coarseTime, fineTime, sid, i, headerSWF[ i ].acquisitionTime );
700 compute_acquisition_time( coarseTime, fineTime, sid, i, headerSWF[ i ].acquisitionTime );
825 //
701 //
826 headerSWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
702 headerSWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
827 headerSWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
703 headerSWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
828 headerSWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
704 headerSWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
829 headerSWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time);
705 headerSWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time);
830 headerSWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8);
706 headerSWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8);
831 headerSWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time);
707 headerSWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time);
832 // SEND PACKET
708 // SEND PACKET
833 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_SWF, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
709 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_SWF, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
834 if (status != RTEMS_SUCCESSFUL) {
710 if (status != RTEMS_SUCCESSFUL) {
835 printf("%d-%d, ERR %d\n", sid, i, (int) status);
711 printf("%d-%d, ERR %d\n", sid, i, (int) status);
836 ret = LFR_DEFAULT;
712 ret = LFR_DEFAULT;
837 }
713 }
838 rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds
714 rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds
839 }
715 }
840
716
841 return ret;
717 return ret;
842 }
718 }
843
719
844 int send_waveform_CWF(volatile int *waveform, unsigned int sid,
720 int send_waveform_CWF(volatile int *waveform, unsigned int sid,
845 Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
721 Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
846 {
722 {
847 /** This function sends CWF CCSDS packets (F2, F1 or F0).
723 /** This function sends CWF CCSDS packets (F2, F1 or F0).
848 *
724 *
849 * @param waveform points to the buffer containing the data that will be send.
725 * @param waveform points to the buffer containing the data that will be send.
850 * @param sid is the source identifier of the data that will be sent.
726 * @param sid is the source identifier of the data that will be sent.
851 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
727 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
852 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
728 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
853 * contain information to setup the transmission of the data packets.
729 * contain information to setup the transmission of the data packets.
854 *
730 *
855 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
731 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
856 *
732 *
857 */
733 */
858
734
859 unsigned int i;
735 unsigned int i;
860 int ret;
736 int ret;
861 unsigned int coarseTime;
737 unsigned int coarseTime;
862 unsigned int fineTime;
738 unsigned int fineTime;
863 rtems_status_code status;
739 rtems_status_code status;
864 spw_ioctl_pkt_send spw_ioctl_send_CWF;
740 spw_ioctl_pkt_send spw_ioctl_send_CWF;
865
741
866 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
742 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
867 spw_ioctl_send_CWF.options = 0;
743 spw_ioctl_send_CWF.options = 0;
868
744
869 ret = LFR_DEFAULT;
745 ret = LFR_DEFAULT;
870
746
871 coarseTime = waveform[0];
747 coarseTime = waveform[0];
872 fineTime = waveform[1];
748 fineTime = waveform[1];
873
749
874 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF; i++) // send waveform
750 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF; i++) // send waveform
875 {
751 {
876 spw_ioctl_send_CWF.data = (char*) &waveform[ (i * BLK_NR_CWF * NB_WORDS_SWF_BLK) + TIME_OFFSET];
752 spw_ioctl_send_CWF.data = (char*) &waveform[ (i * BLK_NR_CWF * NB_WORDS_SWF_BLK) + TIME_OFFSET];
877 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
753 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
878 // BUILD THE DATA
754 // BUILD THE DATA
879 spw_ioctl_send_CWF.dlen = BLK_NR_CWF * NB_BYTES_SWF_BLK;
755 spw_ioctl_send_CWF.dlen = BLK_NR_CWF * NB_BYTES_SWF_BLK;
880 // SET PACKET SEQUENCE COUNTER
756 // SET PACKET SEQUENCE COUNTER
881 increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, sid );
757 increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, sid );
882 // SET PACKET TIME
758 // SET PACKET TIME
883 compute_acquisition_time( coarseTime, fineTime, sid, i, headerCWF[ i ].acquisitionTime);
759 compute_acquisition_time( coarseTime, fineTime, sid, i, headerCWF[ i ].acquisitionTime);
884 //
760 //
885 headerCWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
761 headerCWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
886 headerCWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
762 headerCWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
887 headerCWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
763 headerCWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
888 headerCWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time);
764 headerCWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time);
889 headerCWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8);
765 headerCWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8);
890 headerCWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time);
766 headerCWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time);
891 // SEND PACKET
767 // SEND PACKET
892 if (sid == SID_NORM_CWF_LONG_F3)
768 if (sid == SID_NORM_CWF_LONG_F3)
893 {
769 {
894 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
770 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
895 if (status != RTEMS_SUCCESSFUL) {
771 if (status != RTEMS_SUCCESSFUL) {
896 printf("%d-%d, ERR %d\n", sid, i, (int) status);
772 printf("%d-%d, ERR %d\n", sid, i, (int) status);
897 ret = LFR_DEFAULT;
773 ret = LFR_DEFAULT;
898 }
774 }
899 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
775 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
900 }
776 }
901 else
777 else
902 {
778 {
903 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
779 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
904 if (status != RTEMS_SUCCESSFUL) {
780 if (status != RTEMS_SUCCESSFUL) {
905 printf("%d-%d, ERR %d\n", sid, i, (int) status);
781 printf("%d-%d, ERR %d\n", sid, i, (int) status);
906 ret = LFR_DEFAULT;
782 ret = LFR_DEFAULT;
907 }
783 }
908 }
784 }
909 }
785 }
910
786
911 return ret;
787 return ret;
912 }
788 }
913
789
914 int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
790 int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
915 {
791 {
916 /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data.
792 /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data.
917 *
793 *
918 * @param waveform points to the buffer containing the data that will be send.
794 * @param waveform points to the buffer containing the data that will be send.
919 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
795 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
920 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
796 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
921 * contain information to setup the transmission of the data packets.
797 * contain information to setup the transmission of the data packets.
922 *
798 *
923 * By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer
799 * By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer
924 * from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks.
800 * from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks.
925 *
801 *
926 */
802 */
927
803
928 unsigned int i;
804 unsigned int i;
929 int ret;
805 int ret;
930 unsigned int coarseTime;
806 unsigned int coarseTime;
931 unsigned int fineTime;
807 unsigned int fineTime;
932 rtems_status_code status;
808 rtems_status_code status;
933 spw_ioctl_pkt_send spw_ioctl_send_CWF;
809 spw_ioctl_pkt_send spw_ioctl_send_CWF;
934 char *sample;
810 char *sample;
935
811
936 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
812 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
937 spw_ioctl_send_CWF.options = 0;
813 spw_ioctl_send_CWF.options = 0;
938
814
939 ret = LFR_DEFAULT;
815 ret = LFR_DEFAULT;
940
816
941 //**********************
817 //**********************
942 // BUILD CWF3_light DATA
818 // BUILD CWF3_light DATA
943 for ( i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
819 for ( i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
944 {
820 {
945 sample = (char*) &waveform[ (i * NB_WORDS_SWF_BLK) + TIME_OFFSET ];
821 sample = (char*) &waveform[ (i * NB_WORDS_SWF_BLK) + TIME_OFFSET ];
946 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + TIME_OFFSET_IN_BYTES ] = sample[ 0 ];
822 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + TIME_OFFSET_IN_BYTES ] = sample[ 0 ];
947 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 + TIME_OFFSET_IN_BYTES ] = sample[ 1 ];
823 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 + TIME_OFFSET_IN_BYTES ] = sample[ 1 ];
948 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 + TIME_OFFSET_IN_BYTES ] = sample[ 2 ];
824 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 + TIME_OFFSET_IN_BYTES ] = sample[ 2 ];
949 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 + TIME_OFFSET_IN_BYTES ] = sample[ 3 ];
825 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 + TIME_OFFSET_IN_BYTES ] = sample[ 3 ];
950 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 + TIME_OFFSET_IN_BYTES ] = sample[ 4 ];
826 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 + TIME_OFFSET_IN_BYTES ] = sample[ 4 ];
951 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 + TIME_OFFSET_IN_BYTES ] = sample[ 5 ];
827 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 + TIME_OFFSET_IN_BYTES ] = sample[ 5 ];
952 }
828 }
953
829
954 coarseTime = waveform[0];
830 coarseTime = waveform[0];
955 fineTime = waveform[1];
831 fineTime = waveform[1];
956
832
957 //*********************
833 //*********************
958 // SEND CWF3_light DATA
834 // SEND CWF3_light DATA
959 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF_LIGHT; i++) // send waveform
835 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF_LIGHT; i++) // send waveform
960 {
836 {
961 spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK) + TIME_OFFSET_IN_BYTES];
837 spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK) + TIME_OFFSET_IN_BYTES];
962 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
838 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
963 // BUILD THE DATA
839 // BUILD THE DATA
964 spw_ioctl_send_CWF.dlen = BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK;
840 spw_ioctl_send_CWF.dlen = BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK;
965 // SET PACKET SEQUENCE COUNTER
841 // SET PACKET SEQUENCE COUNTER
966 increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, SID_NORM_CWF_F3 );
842 increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, SID_NORM_CWF_F3 );
967 // SET PACKET TIME
843 // SET PACKET TIME
968 compute_acquisition_time( coarseTime, fineTime, SID_NORM_CWF_F3, i, headerCWF[ i ].acquisitionTime );
844 compute_acquisition_time( coarseTime, fineTime, SID_NORM_CWF_F3, i, headerCWF[ i ].acquisitionTime );
969 //
845 //
970 headerCWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
846 headerCWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
971 headerCWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
847 headerCWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
972 headerCWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
848 headerCWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
973 headerCWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time);
849 headerCWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time);
974 headerCWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8);
850 headerCWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8);
975 headerCWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time);
851 headerCWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time);
976 // SEND PACKET
852 // SEND PACKET
977 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
853 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
978 if (status != RTEMS_SUCCESSFUL) {
854 if (status != RTEMS_SUCCESSFUL) {
979 printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status);
855 printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status);
980 ret = LFR_DEFAULT;
856 ret = LFR_DEFAULT;
981 }
857 }
982 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
858 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
983 }
859 }
984
860
985 return ret;
861 return ret;
986 }
862 }
987
863
988 void compute_acquisition_time( unsigned int coarseTime, unsigned int fineTime,
864 void compute_acquisition_time( unsigned int coarseTime, unsigned int fineTime,
989 unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char * acquisitionTime )
865 unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char * acquisitionTime )
990 {
866 {
991 unsigned long long int acquisitionTimeAsLong;
867 unsigned long long int acquisitionTimeAsLong;
992 unsigned char localAcquisitionTime[6];
868 unsigned char localAcquisitionTime[6];
993 double deltaT = 0.;
869 double deltaT;
870
871 deltaT = 0.;
994
872
995 localAcquisitionTime[0] = (unsigned char) ( coarseTime >> 8 );
873 localAcquisitionTime[0] = (unsigned char) ( coarseTime >> 8 );
996 localAcquisitionTime[1] = (unsigned char) ( coarseTime );
874 localAcquisitionTime[1] = (unsigned char) ( coarseTime );
997 localAcquisitionTime[2] = (unsigned char) ( coarseTime >> 24 );
875 localAcquisitionTime[2] = (unsigned char) ( coarseTime >> 24 );
998 localAcquisitionTime[3] = (unsigned char) ( coarseTime >> 16 );
876 localAcquisitionTime[3] = (unsigned char) ( coarseTime >> 16 );
999 localAcquisitionTime[4] = (unsigned char) ( fineTime >> 24 );
877 localAcquisitionTime[4] = (unsigned char) ( fineTime >> 24 );
1000 localAcquisitionTime[5] = (unsigned char) ( fineTime >> 16 );
878 localAcquisitionTime[5] = (unsigned char) ( fineTime >> 16 );
1001
879
1002 acquisitionTimeAsLong = ( (unsigned long long int) localAcquisitionTime[0] << 40 )
880 acquisitionTimeAsLong = ( (unsigned long long int) localAcquisitionTime[0] << 40 )
1003 + ( (unsigned long long int) localAcquisitionTime[1] << 32 )
881 + ( (unsigned long long int) localAcquisitionTime[1] << 32 )
1004 + ( localAcquisitionTime[2] << 24 )
882 + ( localAcquisitionTime[2] << 24 )
1005 + ( localAcquisitionTime[3] << 16 )
883 + ( localAcquisitionTime[3] << 16 )
1006 + ( localAcquisitionTime[4] << 8 )
884 + ( localAcquisitionTime[4] << 8 )
1007 + ( localAcquisitionTime[5] );
885 + ( localAcquisitionTime[5] );
1008
886
1009 switch( sid )
887 switch( sid )
1010 {
888 {
1011 case SID_NORM_SWF_F0:
889 case SID_NORM_SWF_F0:
1012 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 24576. ;
890 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 24576. ;
1013 break;
891 break;
1014
892
1015 case SID_NORM_SWF_F1:
893 case SID_NORM_SWF_F1:
1016 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 4096. ;
894 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 4096. ;
1017 break;
895 break;
1018
896
1019 case SID_NORM_SWF_F2:
897 case SID_NORM_SWF_F2:
1020 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 256. ;
898 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 256. ;
1021 break;
899 break;
1022
900
1023 case SID_SBM1_CWF_F1:
901 case SID_SBM1_CWF_F1:
1024 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 4096. ;
902 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 4096. ;
1025 break;
903 break;
1026
904
1027 case SID_SBM2_CWF_F2:
905 case SID_SBM2_CWF_F2:
1028 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 256. ;
906 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 256. ;
1029 break;
907 break;
1030
908
1031 case SID_BURST_CWF_F2:
909 case SID_BURST_CWF_F2:
1032 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 256. ;
910 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 256. ;
1033 break;
911 break;
1034
912
1035 case SID_NORM_CWF_F3:
913 case SID_NORM_CWF_F3:
1036 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF_SHORT_F3 * 65536. / 16. ;
914 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF_SHORT_F3 * 65536. / 16. ;
1037 break;
915 break;
1038
916
1039 case SID_NORM_CWF_LONG_F3:
917 case SID_NORM_CWF_LONG_F3:
1040 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 16. ;
918 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 16. ;
1041 break;
919 break;
1042
920
1043 default:
921 default:
1044 PRINTF1("in compute_acquisition_time *** ERR unexpected sid %d", sid)
922 PRINTF1("in compute_acquisition_time *** ERR unexpected sid %d", sid)
1045 deltaT = 0.;
923 deltaT = 0.;
1046 break;
924 break;
1047 }
925 }
1048
926
1049 acquisitionTimeAsLong = acquisitionTimeAsLong + (unsigned long long int) deltaT;
927 acquisitionTimeAsLong = acquisitionTimeAsLong + (unsigned long long int) deltaT;
1050 //
928 //
1051 acquisitionTime[0] = (unsigned char) (acquisitionTimeAsLong >> 40);
929 acquisitionTime[0] = (unsigned char) (acquisitionTimeAsLong >> 40);
1052 acquisitionTime[1] = (unsigned char) (acquisitionTimeAsLong >> 32);
930 acquisitionTime[1] = (unsigned char) (acquisitionTimeAsLong >> 32);
1053 acquisitionTime[2] = (unsigned char) (acquisitionTimeAsLong >> 24);
931 acquisitionTime[2] = (unsigned char) (acquisitionTimeAsLong >> 24);
1054 acquisitionTime[3] = (unsigned char) (acquisitionTimeAsLong >> 16);
932 acquisitionTime[3] = (unsigned char) (acquisitionTimeAsLong >> 16);
1055 acquisitionTime[4] = (unsigned char) (acquisitionTimeAsLong >> 8 );
933 acquisitionTime[4] = (unsigned char) (acquisitionTimeAsLong >> 8 );
1056 acquisitionTime[5] = (unsigned char) (acquisitionTimeAsLong );
934 acquisitionTime[5] = (unsigned char) (acquisitionTimeAsLong );
935
936 }
937
938 void build_snapshot_from_ring( void )
939 {
940 unsigned int i;
941 unsigned long long int centerTime_asLong;
942 unsigned long long int acquisitionTimeF0_asLong;
943 unsigned long long int acquisitionTimeF1_asLong;
944 unsigned char *acquisitionTimeF0;
945 unsigned char *acquisitionTimeF1;
946 unsigned char *ptr1;
947 unsigned char *ptr2;
948
949 unsigned int deltaT;
950
951 deltaT = 2731; // (2048. / 24576. / 2.) * 65536. = 2730.667;
952
953 acquisitionTimeF0 = (unsigned char*) current_ring_node_f0->buffer_address;
954 acquisitionTimeF1 = (unsigned char*) ring_node_to_send_cwf_f1->buffer_address;
955
956 acquisitionTimeF0_asLong = 0x00;
957 acquisitionTimeF1_asLong = 0x00;
958 acquisitionTimeF0_asLong = ( acquisitionTimeF0[0] << 24 )
959 + ( acquisitionTimeF0[1] << 16 )
960 + ( (unsigned long long int) acquisitionTimeF0[2] << 40 )
961 + ( (unsigned long long int) acquisitionTimeF0[3] << 32 )
962 + ( acquisitionTimeF0[4] << 8 )
963 + ( acquisitionTimeF0[5] );
964
965 acquisitionTimeF1_asLong = ( acquisitionTimeF1[0] << 24 )
966 + ( acquisitionTimeF1[1] << 16 )
967 + ( (unsigned long long int) acquisitionTimeF1[2] << 40 )
968 + ( (unsigned long long int) acquisitionTimeF1[3] << 32 )
969 + ( acquisitionTimeF1[4] << 8 )
970 + ( acquisitionTimeF1[5] );
971
972 centerTime_asLong = acquisitionTimeF0_asLong + deltaT;
973
974 ptr1 = (unsigned char*) &acquisitionTimeF1_asLong;
975 ptr2 = (unsigned char*) wf_snap_f1_extracted;
976
977 ptr2[0] = ptr1[ 2 + 2 ];
978 ptr2[1] = ptr1[ 3 + 2 ];
979 ptr2[2] = ptr1[ 0 + 2 ];
980 ptr2[3] = ptr1[ 1 + 2 ];
981 ptr2[4] = ptr1[ 4 + 2 ];
982 ptr2[5] = ptr1[ 5 + 2 ];
983
984 for (i=0; i<(NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK); i++ )
985 {
986 wf_snap_f1_extracted[i + TIME_OFFSET] = ((int*)(ring_node_to_send_cwf_f1->buffer_address))[i + TIME_OFFSET];
987 }
1057 }
988 }
1058
989
1059 //**************
990 //**************
1060 // wfp registers
991 // wfp registers
1061 void reset_wfp_burst_enable(void)
992 void reset_wfp_burst_enable(void)
1062 {
993 {
1063 /** This function resets the waveform picker burst_enable register.
994 /** This function resets the waveform picker burst_enable register.
1064 *
995 *
1065 * The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0.
996 * The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0.
1066 *
997 *
1067 */
998 */
1068
999
1069 waveform_picker_regs->run_burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1000 waveform_picker_regs->run_burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1070 }
1001 }
1071
1002
1072 void reset_wfp_status( void )
1003 void reset_wfp_status( void )
1073 {
1004 {
1074 /** This function resets the waveform picker status register.
1005 /** This function resets the waveform picker status register.
1075 *
1006 *
1076 * All status bits are set to 0 [new_err full_err full].
1007 * All status bits are set to 0 [new_err full_err full].
1077 *
1008 *
1078 */
1009 */
1079
1010
1080 waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1011 waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1081 }
1012 }
1082
1013
1083 void reset_waveform_picker_regs(void)
1014 void reset_waveform_picker_regs(void)
1084 {
1015 {
1085 /** This function resets the waveform picker module registers.
1016 /** This function resets the waveform picker module registers.
1086 *
1017 *
1087 * The registers affected by this function are located at the following offset addresses:
1018 * The registers affected by this function are located at the following offset addresses:
1088 * - 0x00 data_shaping
1019 * - 0x00 data_shaping
1089 * - 0x04 run_burst_enable
1020 * - 0x04 run_burst_enable
1090 * - 0x08 addr_data_f0
1021 * - 0x08 addr_data_f0
1091 * - 0x0C addr_data_f1
1022 * - 0x0C addr_data_f1
1092 * - 0x10 addr_data_f2
1023 * - 0x10 addr_data_f2
1093 * - 0x14 addr_data_f3
1024 * - 0x14 addr_data_f3
1094 * - 0x18 status
1025 * - 0x18 status
1095 * - 0x1C delta_snapshot
1026 * - 0x1C delta_snapshot
1096 * - 0x20 delta_f0
1027 * - 0x20 delta_f0
1097 * - 0x24 delta_f0_2
1028 * - 0x24 delta_f0_2
1098 * - 0x28 delta_f1
1029 * - 0x28 delta_f1
1099 * - 0x2c delta_f2
1030 * - 0x2c delta_f2
1100 * - 0x30 nb_data_by_buffer
1031 * - 0x30 nb_data_by_buffer
1101 * - 0x34 nb_snapshot_param
1032 * - 0x34 nb_snapshot_param
1102 * - 0x38 start_date
1033 * - 0x38 start_date
1103 * - 0x3c nb_word_in_buffer
1034 * - 0x3c nb_word_in_buffer
1104 *
1035 *
1105 */
1036 */
1106
1037
1107 waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW
1038 waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW
1108 waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
1039 waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
1109 waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; // 0x08
1040 waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; // 0x08
1110 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; // 0x0c
1041 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; // 0x0c
1111 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; // 0x10
1042 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; // 0x10
1112 waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); // 0x14
1043 waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_a); // 0x14
1113 waveform_picker_regs->status = 0x00; // 0x18
1044 waveform_picker_regs->status = 0x00; // 0x18
1114 //
1045 //
1115 set_wfp_delta_snapshot(); // 0x1c
1046 set_wfp_delta_snapshot(); // 0x1c
1116 set_wfp_delta_f0_f0_2(); // 0x20, 0x24
1047 set_wfp_delta_f0_f0_2(); // 0x20, 0x24
1117 set_wfp_delta_f1(); // 0x28
1048 set_wfp_delta_f1(); // 0x28
1118 set_wfp_delta_f2(); // 0x2c
1049 set_wfp_delta_f2(); // 0x2c
1119 DEBUG_PRINTF1("delta_snapshot %x\n", waveform_picker_regs->delta_snapshot)
1050 DEBUG_PRINTF1("delta_snapshot %x\n", waveform_picker_regs->delta_snapshot)
1120 DEBUG_PRINTF1("delta_f0 %x\n", waveform_picker_regs->delta_f0)
1051 DEBUG_PRINTF1("delta_f0 %x\n", waveform_picker_regs->delta_f0)
1121 DEBUG_PRINTF1("delta_f0_2 %x\n", waveform_picker_regs->delta_f0_2)
1052 DEBUG_PRINTF1("delta_f0_2 %x\n", waveform_picker_regs->delta_f0_2)
1122 DEBUG_PRINTF1("delta_f1 %x\n", waveform_picker_regs->delta_f1)
1053 DEBUG_PRINTF1("delta_f1 %x\n", waveform_picker_regs->delta_f1)
1123 DEBUG_PRINTF1("delta_f2 %x\n", waveform_picker_regs->delta_f2)
1054 DEBUG_PRINTF1("delta_f2 %x\n", waveform_picker_regs->delta_f2)
1124 // 2688 = 8 * 336
1055 // 2688 = 8 * 336
1125 waveform_picker_regs->nb_data_by_buffer = 0xa7f; // 0x30 *** 2688 - 1 => nb samples -1
1056 waveform_picker_regs->nb_data_by_buffer = 0xa7f; // 0x30 *** 2688 - 1 => nb samples -1
1126 waveform_picker_regs->snapshot_param = 0xa80; // 0x34 *** 2688 => nb samples
1057 waveform_picker_regs->snapshot_param = 0xa80; // 0x34 *** 2688 => nb samples
1127 waveform_picker_regs->start_date = 0x00; // 0x38
1058 waveform_picker_regs->start_date = 0x00; // 0x38
1128 waveform_picker_regs->nb_word_in_buffer = 0x1f82; // 0x3c *** 2688 * 3 + 2 = 8066
1059 waveform_picker_regs->nb_word_in_buffer = 0x1f82; // 0x3c *** 2688 * 3 + 2 = 8066
1129 }
1060 }
1130
1061
1131 void set_wfp_data_shaping( void )
1062 void set_wfp_data_shaping( void )
1132 {
1063 {
1133 /** This function sets the data_shaping register of the waveform picker module.
1064 /** This function sets the data_shaping register of the waveform picker module.
1134 *
1065 *
1135 * The value is read from one field of the parameter_dump_packet structure:\n
1066 * The value is read from one field of the parameter_dump_packet structure:\n
1136 * bw_sp0_sp1_r0_r1
1067 * bw_sp0_sp1_r0_r1
1137 *
1068 *
1138 */
1069 */
1139
1070
1140 unsigned char data_shaping;
1071 unsigned char data_shaping;
1141
1072
1142 // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register
1073 // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register
1143 // waveform picker : [R1 R0 SP1 SP0 BW]
1074 // waveform picker : [R1 R0 SP1 SP0 BW]
1144
1075
1145 data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1;
1076 data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1;
1146
1077
1147 waveform_picker_regs->data_shaping =
1078 waveform_picker_regs->data_shaping =
1148 ( (data_shaping & 0x10) >> 4 ) // BW
1079 ( (data_shaping & 0x10) >> 4 ) // BW
1149 + ( (data_shaping & 0x08) >> 2 ) // SP0
1080 + ( (data_shaping & 0x08) >> 2 ) // SP0
1150 + ( (data_shaping & 0x04) ) // SP1
1081 + ( (data_shaping & 0x04) ) // SP1
1151 + ( (data_shaping & 0x02) << 2 ) // R0
1082 + ( (data_shaping & 0x02) << 2 ) // R0
1152 + ( (data_shaping & 0x01) << 4 ); // R1
1083 + ( (data_shaping & 0x01) << 4 ); // R1
1153 }
1084 }
1154
1085
1155 void set_wfp_burst_enable_register( unsigned char mode )
1086 void set_wfp_burst_enable_register( unsigned char mode )
1156 {
1087 {
1157 /** This function sets the waveform picker burst_enable register depending on the mode.
1088 /** This function sets the waveform picker burst_enable register depending on the mode.
1158 *
1089 *
1159 * @param mode is the LFR mode to launch.
1090 * @param mode is the LFR mode to launch.
1160 *
1091 *
1161 * The burst bits shall be before the enable bits.
1092 * The burst bits shall be before the enable bits.
1162 *
1093 *
1163 */
1094 */
1164
1095
1165 // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0
1096 // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0
1166 // the burst bits shall be set first, before the enable bits
1097 // the burst bits shall be set first, before the enable bits
1167 switch(mode) {
1098 switch(mode) {
1168 case(LFR_MODE_NORMAL):
1099 case(LFR_MODE_NORMAL):
1169 waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enable
1100 waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enable
1170 waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0
1101 waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0
1171 break;
1102 break;
1172 case(LFR_MODE_BURST):
1103 case(LFR_MODE_BURST):
1173 waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1104 waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1174 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2
1105 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2
1175 break;
1106 break;
1176 case(LFR_MODE_SBM1):
1107 case(LFR_MODE_SBM1):
1177 waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled
1108 waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled
1178 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
1109 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
1179 break;
1110 break;
1180 case(LFR_MODE_SBM2):
1111 case(LFR_MODE_SBM2):
1181 waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1112 waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1182 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
1113 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
1183 break;
1114 break;
1184 default:
1115 default:
1185 waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled
1116 waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled
1186 break;
1117 break;
1187 }
1118 }
1188 }
1119 }
1189
1120
1190 void set_wfp_delta_snapshot( void )
1121 void set_wfp_delta_snapshot( void )
1191 {
1122 {
1192 /** This function sets the delta_snapshot register of the waveform picker module.
1123 /** This function sets the delta_snapshot register of the waveform picker module.
1193 *
1124 *
1194 * The value is read from two (unsigned char) of the parameter_dump_packet structure:
1125 * The value is read from two (unsigned char) of the parameter_dump_packet structure:
1195 * - sy_lfr_n_swf_p[0]
1126 * - sy_lfr_n_swf_p[0]
1196 * - sy_lfr_n_swf_p[1]
1127 * - sy_lfr_n_swf_p[1]
1197 *
1128 *
1198 */
1129 */
1199
1130
1200 unsigned int delta_snapshot;
1131 unsigned int delta_snapshot;
1201 unsigned int delta_snapshot_in_T2;
1132 unsigned int delta_snapshot_in_T2;
1202
1133
1203 delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256
1134 delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256
1204 + parameter_dump_packet.sy_lfr_n_swf_p[1];
1135 + parameter_dump_packet.sy_lfr_n_swf_p[1];
1205
1136
1206 delta_snapshot_in_T2 = delta_snapshot * 256;
1137 delta_snapshot_in_T2 = delta_snapshot * 256;
1207 waveform_picker_regs->delta_snapshot = delta_snapshot_in_T2; // max 4 bytes
1138 waveform_picker_regs->delta_snapshot = delta_snapshot_in_T2; // max 4 bytes
1208 }
1139 }
1209
1140
1210 void set_wfp_delta_f0_f0_2( void )
1141 void set_wfp_delta_f0_f0_2( void )
1211 {
1142 {
1212 unsigned int delta_snapshot;
1143 unsigned int delta_snapshot;
1213 unsigned int nb_samples_per_snapshot;
1144 unsigned int nb_samples_per_snapshot;
1214 float delta_f0_in_float;
1145 float delta_f0_in_float;
1215
1146
1216 delta_snapshot = waveform_picker_regs->delta_snapshot;
1147 delta_snapshot = waveform_picker_regs->delta_snapshot;
1217 nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
1148 nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
1218 delta_f0_in_float =nb_samples_per_snapshot / 2. * ( 1. / 256. - 1. / 24576.) * 256.;
1149 delta_f0_in_float =nb_samples_per_snapshot / 2. * ( 1. / 256. - 1. / 24576.) * 256.;
1219
1150
1220 waveform_picker_regs->delta_f0 = delta_snapshot - floor( delta_f0_in_float );
1151 waveform_picker_regs->delta_f0 = delta_snapshot - floor( delta_f0_in_float );
1221 waveform_picker_regs->delta_f0_2 = 0x7; // max 7 bits
1152 waveform_picker_regs->delta_f0_2 = 0x7; // max 7 bits
1222 }
1153 }
1223
1154
1224 void set_wfp_delta_f1( void )
1155 void set_wfp_delta_f1( void )
1225 {
1156 {
1226 unsigned int delta_snapshot;
1157 unsigned int delta_snapshot;
1227 unsigned int nb_samples_per_snapshot;
1158 unsigned int nb_samples_per_snapshot;
1228 float delta_f1_in_float;
1159 float delta_f1_in_float;
1229
1160
1230 delta_snapshot = waveform_picker_regs->delta_snapshot;
1161 delta_snapshot = waveform_picker_regs->delta_snapshot;
1231 nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
1162 nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
1232 delta_f1_in_float = nb_samples_per_snapshot / 2. * ( 1. / 256. - 1. / 4096.) * 256.;
1163 delta_f1_in_float = nb_samples_per_snapshot / 2. * ( 1. / 256. - 1. / 4096.) * 256.;
1233
1164
1234 waveform_picker_regs->delta_f1 = delta_snapshot - floor( delta_f1_in_float );
1165 waveform_picker_regs->delta_f1 = delta_snapshot - floor( delta_f1_in_float );
1235 }
1166 }
1236
1167
1237 void set_wfp_delta_f2()
1168 void set_wfp_delta_f2()
1238 {
1169 {
1239 unsigned int delta_snapshot;
1170 unsigned int delta_snapshot;
1240 unsigned int nb_samples_per_snapshot;
1171 unsigned int nb_samples_per_snapshot;
1241
1172
1242 delta_snapshot = waveform_picker_regs->delta_snapshot;
1173 delta_snapshot = waveform_picker_regs->delta_snapshot;
1243 nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
1174 nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
1244
1175
1245 waveform_picker_regs->delta_f2 = delta_snapshot - nb_samples_per_snapshot / 2;
1176 waveform_picker_regs->delta_f2 = delta_snapshot - nb_samples_per_snapshot / 2;
1246 }
1177 }
1247
1178
1248 //*****************
1179 //*****************
1249 // local parameters
1180 // local parameters
1250 void set_local_nb_interrupt_f0_MAX( void )
1181 void set_local_nb_interrupt_f0_MAX( void )
1251 {
1182 {
1252 /** This function sets the value of the nb_interrupt_f0_MAX local parameter.
1183 /** This function sets the value of the nb_interrupt_f0_MAX local parameter.
1253 *
1184 *
1254 * This parameter is used for the SM validation only.\n
1185 * This parameter is used for the SM validation only.\n
1255 * The software waits param_local.local_nb_interrupt_f0_MAX interruptions from the spectral matrices
1186 * The software waits param_local.local_nb_interrupt_f0_MAX interruptions from the spectral matrices
1256 * module before launching a basic processing.
1187 * module before launching a basic processing.
1257 *
1188 *
1258 */
1189 */
1259
1190
1260 param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256
1191 param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256
1261 + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100;
1192 + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100;
1262 }
1193 }
1263
1194
1264 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid )
1195 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid )
1265 {
1196 {
1266 unsigned short *sequence_cnt;
1197 unsigned short *sequence_cnt;
1267 unsigned short segmentation_grouping_flag;
1198 unsigned short segmentation_grouping_flag;
1268 unsigned short new_packet_sequence_control;
1199 unsigned short new_packet_sequence_control;
1269
1200
1270 if ( (sid ==SID_NORM_SWF_F0) || (sid ==SID_NORM_SWF_F1) || (sid ==SID_NORM_SWF_F2)
1201 if ( (sid ==SID_NORM_SWF_F0) || (sid ==SID_NORM_SWF_F1) || (sid ==SID_NORM_SWF_F2)
1271 || (sid ==SID_NORM_CWF_F3) || (sid==SID_NORM_CWF_LONG_F3) || (sid ==SID_BURST_CWF_F2) )
1202 || (sid ==SID_NORM_CWF_F3) || (sid==SID_NORM_CWF_LONG_F3) || (sid ==SID_BURST_CWF_F2) )
1272 {
1203 {
1273 sequence_cnt = &sequenceCounters_SCIENCE_NORMAL_BURST;
1204 sequence_cnt = &sequenceCounters_SCIENCE_NORMAL_BURST;
1274 }
1205 }
1275 else if ( (sid ==SID_SBM1_CWF_F1) || (sid ==SID_SBM2_CWF_F2) )
1206 else if ( (sid ==SID_SBM1_CWF_F1) || (sid ==SID_SBM2_CWF_F2) )
1276 {
1207 {
1277 sequence_cnt = &sequenceCounters_SCIENCE_SBM1_SBM2;
1208 sequence_cnt = &sequenceCounters_SCIENCE_SBM1_SBM2;
1278 }
1209 }
1279 else
1210 else
1280 {
1211 {
1281 sequence_cnt = NULL;
1212 sequence_cnt = NULL;
1282 PRINTF1("in increment_seq_counter_source_id *** ERR apid_destid %d not known\n", sid)
1213 PRINTF1("in increment_seq_counter_source_id *** ERR apid_destid %d not known\n", sid)
1283 }
1214 }
1284
1215
1285 if (sequence_cnt != NULL)
1216 if (sequence_cnt != NULL)
1286 {
1217 {
1287 segmentation_grouping_flag = (packet_sequence_control[ 0 ] & 0xc0) << 8;
1218 segmentation_grouping_flag = (packet_sequence_control[ 0 ] & 0xc0) << 8;
1288 *sequence_cnt = (*sequence_cnt) & 0x3fff;
1219 *sequence_cnt = (*sequence_cnt) & 0x3fff;
1289
1220
1290 new_packet_sequence_control = segmentation_grouping_flag | *sequence_cnt ;
1221 new_packet_sequence_control = segmentation_grouping_flag | *sequence_cnt ;
1291
1222
1292 packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8);
1223 packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8);
1293 packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control );
1224 packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control );
1294
1225
1295 // increment the sequence counter for the next packet
1226 // increment the sequence counter for the next packet
1296 if ( *sequence_cnt < SEQ_CNT_MAX)
1227 if ( *sequence_cnt < SEQ_CNT_MAX)
1297 {
1228 {
1298 *sequence_cnt = *sequence_cnt + 1;
1229 *sequence_cnt = *sequence_cnt + 1;
1299 }
1230 }
1300 else
1231 else
1301 {
1232 {
1302 *sequence_cnt = 0;
1233 *sequence_cnt = 0;
1303 }
1234 }
1304 }
1235 }
1305 }
1236 }
General Comments 0
You need to be logged in to leave comments. Login now