##// END OF EJS Templates
HK packet changed due to misalignment of one int data...
paul -
r132:f919b72104cf VHDLib206
parent child
Show More
@@ -1,268 +1,268
1 #############################################################################
1 #############################################################################
2 # Makefile for building: bin/fsw
2 # Makefile for building: bin/fsw
3 # Generated by qmake (2.01a) (Qt 4.8.6) on: Tue May 13 07:12:26 2014
3 # Generated by qmake (2.01a) (Qt 4.8.6) on: Tue May 13 15:18:10 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=7 -DPRINT_MESSAGES_ON_CONSOLE -DPRINT_TASK_STATISTICS
13 DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=7 -DPRINT_MESSAGES_ON_CONSOLE -DPRINT_TASK_STATISTICS
14 CFLAGS = -pipe -O3 -Wall $(DEFINES)
14 CFLAGS = -pipe -O3 -Wall $(DEFINES)
15 CXXFLAGS = -pipe -O3 -Wall $(DEFINES)
15 CXXFLAGS = -pipe -O3 -Wall $(DEFINES)
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../header/processing -I../src/basic_parameters
16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../header/processing -I../src/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_misc.c \
48 ../src/fsw_misc.c \
49 ../src/fsw_init.c \
49 ../src/fsw_init.c \
50 ../src/fsw_globals.c \
50 ../src/fsw_globals.c \
51 ../src/fsw_spacewire.c \
51 ../src/fsw_spacewire.c \
52 ../src/tc_load_dump_parameters.c \
52 ../src/tc_load_dump_parameters.c \
53 ../src/tm_lfr_tc_exe.c \
53 ../src/tm_lfr_tc_exe.c \
54 ../src/tc_acceptance.c \
54 ../src/tc_acceptance.c \
55 ../src/basic_parameters/basic_parameters.c \
55 ../src/basic_parameters/basic_parameters.c \
56 ../src/processing/fsw_processing.c \
56 ../src/processing/fsw_processing.c \
57 ../src/processing/avf0_prc0.c \
57 ../src/processing/avf0_prc0.c \
58 ../src/processing/avf1_prc1.c \
58 ../src/processing/avf1_prc1.c \
59 ../src/processing/avf2_prc2.c
59 ../src/processing/avf2_prc2.c
60 OBJECTS = obj/wf_handler.o \
60 OBJECTS = obj/wf_handler.o \
61 obj/tc_handler.o \
61 obj/tc_handler.o \
62 obj/fsw_misc.o \
62 obj/fsw_misc.o \
63 obj/fsw_init.o \
63 obj/fsw_init.o \
64 obj/fsw_globals.o \
64 obj/fsw_globals.o \
65 obj/fsw_spacewire.o \
65 obj/fsw_spacewire.o \
66 obj/tc_load_dump_parameters.o \
66 obj/tc_load_dump_parameters.o \
67 obj/tm_lfr_tc_exe.o \
67 obj/tm_lfr_tc_exe.o \
68 obj/tc_acceptance.o \
68 obj/tc_acceptance.o \
69 obj/basic_parameters.o \
69 obj/basic_parameters.o \
70 obj/fsw_processing.o \
70 obj/fsw_processing.o \
71 obj/avf0_prc0.o \
71 obj/avf0_prc0.o \
72 obj/avf1_prc1.o \
72 obj/avf1_prc1.o \
73 obj/avf2_prc2.o
73 obj/avf2_prc2.o
74 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
74 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
75 /usr/lib64/qt4/mkspecs/common/linux.conf \
75 /usr/lib64/qt4/mkspecs/common/linux.conf \
76 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
76 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
77 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
77 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
78 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
78 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
79 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
79 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
80 /usr/lib64/qt4/mkspecs/qconfig.pri \
80 /usr/lib64/qt4/mkspecs/qconfig.pri \
81 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
81 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
82 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
82 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
83 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
83 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
84 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
84 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
85 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
85 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
86 sparc.pri \
86 sparc.pri \
87 /usr/lib64/qt4/mkspecs/features/release.prf \
87 /usr/lib64/qt4/mkspecs/features/release.prf \
88 /usr/lib64/qt4/mkspecs/features/default_post.prf \
88 /usr/lib64/qt4/mkspecs/features/default_post.prf \
89 /usr/lib64/qt4/mkspecs/features/shared.prf \
89 /usr/lib64/qt4/mkspecs/features/shared.prf \
90 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
90 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
91 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
91 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
92 /usr/lib64/qt4/mkspecs/features/resources.prf \
92 /usr/lib64/qt4/mkspecs/features/resources.prf \
93 /usr/lib64/qt4/mkspecs/features/uic.prf \
93 /usr/lib64/qt4/mkspecs/features/uic.prf \
94 /usr/lib64/qt4/mkspecs/features/yacc.prf \
94 /usr/lib64/qt4/mkspecs/features/yacc.prf \
95 /usr/lib64/qt4/mkspecs/features/lex.prf \
95 /usr/lib64/qt4/mkspecs/features/lex.prf \
96 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
96 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
97 fsw-qt.pro
97 fsw-qt.pro
98 QMAKE_TARGET = fsw
98 QMAKE_TARGET = fsw
99 DESTDIR = bin/
99 DESTDIR = bin/
100 TARGET = bin/fsw
100 TARGET = bin/fsw
101
101
102 first: all
102 first: all
103 ####### Implicit rules
103 ####### Implicit rules
104
104
105 .SUFFIXES: .o .c .cpp .cc .cxx .C
105 .SUFFIXES: .o .c .cpp .cc .cxx .C
106
106
107 .cpp.o:
107 .cpp.o:
108 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
108 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
109
109
110 .cc.o:
110 .cc.o:
111 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
111 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
112
112
113 .cxx.o:
113 .cxx.o:
114 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
114 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
115
115
116 .C.o:
116 .C.o:
117 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
117 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
118
118
119 .c.o:
119 .c.o:
120 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
120 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
121
121
122 ####### Build rules
122 ####### Build rules
123
123
124 all: Makefile $(TARGET)
124 all: Makefile $(TARGET)
125
125
126 $(TARGET): $(OBJECTS)
126 $(TARGET): $(OBJECTS)
127 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
127 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
128 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
128 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
129
129
130 Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
130 Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
131 /usr/lib64/qt4/mkspecs/common/linux.conf \
131 /usr/lib64/qt4/mkspecs/common/linux.conf \
132 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
132 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
133 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
133 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
134 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
134 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
135 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
135 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
136 /usr/lib64/qt4/mkspecs/qconfig.pri \
136 /usr/lib64/qt4/mkspecs/qconfig.pri \
137 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
137 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
138 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
138 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
139 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
139 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
140 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
140 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
141 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
141 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
142 sparc.pri \
142 sparc.pri \
143 /usr/lib64/qt4/mkspecs/features/release.prf \
143 /usr/lib64/qt4/mkspecs/features/release.prf \
144 /usr/lib64/qt4/mkspecs/features/default_post.prf \
144 /usr/lib64/qt4/mkspecs/features/default_post.prf \
145 /usr/lib64/qt4/mkspecs/features/shared.prf \
145 /usr/lib64/qt4/mkspecs/features/shared.prf \
146 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
146 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
147 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
147 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
148 /usr/lib64/qt4/mkspecs/features/resources.prf \
148 /usr/lib64/qt4/mkspecs/features/resources.prf \
149 /usr/lib64/qt4/mkspecs/features/uic.prf \
149 /usr/lib64/qt4/mkspecs/features/uic.prf \
150 /usr/lib64/qt4/mkspecs/features/yacc.prf \
150 /usr/lib64/qt4/mkspecs/features/yacc.prf \
151 /usr/lib64/qt4/mkspecs/features/lex.prf \
151 /usr/lib64/qt4/mkspecs/features/lex.prf \
152 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf
152 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf
153 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
153 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
154 /usr/lib64/qt4/mkspecs/common/unix.conf:
154 /usr/lib64/qt4/mkspecs/common/unix.conf:
155 /usr/lib64/qt4/mkspecs/common/linux.conf:
155 /usr/lib64/qt4/mkspecs/common/linux.conf:
156 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
156 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
157 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
157 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
158 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
158 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
159 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
159 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
160 /usr/lib64/qt4/mkspecs/qconfig.pri:
160 /usr/lib64/qt4/mkspecs/qconfig.pri:
161 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
161 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
162 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
162 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
163 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
163 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
164 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
164 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
165 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
165 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
166 sparc.pri:
166 sparc.pri:
167 /usr/lib64/qt4/mkspecs/features/release.prf:
167 /usr/lib64/qt4/mkspecs/features/release.prf:
168 /usr/lib64/qt4/mkspecs/features/default_post.prf:
168 /usr/lib64/qt4/mkspecs/features/default_post.prf:
169 /usr/lib64/qt4/mkspecs/features/shared.prf:
169 /usr/lib64/qt4/mkspecs/features/shared.prf:
170 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
170 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
171 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
171 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
172 /usr/lib64/qt4/mkspecs/features/resources.prf:
172 /usr/lib64/qt4/mkspecs/features/resources.prf:
173 /usr/lib64/qt4/mkspecs/features/uic.prf:
173 /usr/lib64/qt4/mkspecs/features/uic.prf:
174 /usr/lib64/qt4/mkspecs/features/yacc.prf:
174 /usr/lib64/qt4/mkspecs/features/yacc.prf:
175 /usr/lib64/qt4/mkspecs/features/lex.prf:
175 /usr/lib64/qt4/mkspecs/features/lex.prf:
176 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
176 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
177 qmake: FORCE
177 qmake: FORCE
178 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
178 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
179
179
180 dist:
180 dist:
181 @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0
181 @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0
182 $(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
182 $(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
183
183
184
184
185 clean:compiler_clean
185 clean:compiler_clean
186 -$(DEL_FILE) $(OBJECTS)
186 -$(DEL_FILE) $(OBJECTS)
187 -$(DEL_FILE) *~ core *.core
187 -$(DEL_FILE) *~ core *.core
188
188
189
189
190 ####### Sub-libraries
190 ####### Sub-libraries
191
191
192 distclean: clean
192 distclean: clean
193 -$(DEL_FILE) $(TARGET)
193 -$(DEL_FILE) $(TARGET)
194 -$(DEL_FILE) Makefile
194 -$(DEL_FILE) Makefile
195
195
196
196
197 grmon:
197 grmon:
198 cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u
198 cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u
199
199
200 check: first
200 check: first
201
201
202 compiler_rcc_make_all:
202 compiler_rcc_make_all:
203 compiler_rcc_clean:
203 compiler_rcc_clean:
204 compiler_uic_make_all:
204 compiler_uic_make_all:
205 compiler_uic_clean:
205 compiler_uic_clean:
206 compiler_image_collection_make_all: qmake_image_collection.cpp
206 compiler_image_collection_make_all: qmake_image_collection.cpp
207 compiler_image_collection_clean:
207 compiler_image_collection_clean:
208 -$(DEL_FILE) qmake_image_collection.cpp
208 -$(DEL_FILE) qmake_image_collection.cpp
209 compiler_yacc_decl_make_all:
209 compiler_yacc_decl_make_all:
210 compiler_yacc_decl_clean:
210 compiler_yacc_decl_clean:
211 compiler_yacc_impl_make_all:
211 compiler_yacc_impl_make_all:
212 compiler_yacc_impl_clean:
212 compiler_yacc_impl_clean:
213 compiler_lex_make_all:
213 compiler_lex_make_all:
214 compiler_lex_clean:
214 compiler_lex_clean:
215 compiler_clean:
215 compiler_clean:
216
216
217 ####### Compile
217 ####### Compile
218
218
219 obj/wf_handler.o: ../src/wf_handler.c
219 obj/wf_handler.o: ../src/wf_handler.c
220 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c
220 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c
221
221
222 obj/tc_handler.o: ../src/tc_handler.c
222 obj/tc_handler.o: ../src/tc_handler.c
223 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c
223 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c
224
224
225 obj/fsw_misc.o: ../src/fsw_misc.c
225 obj/fsw_misc.o: ../src/fsw_misc.c
226 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c
226 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c
227
227
228 obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c
228 obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c
229 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c
229 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c
230
230
231 obj/fsw_globals.o: ../src/fsw_globals.c
231 obj/fsw_globals.o: ../src/fsw_globals.c
232 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c
232 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c
233
233
234 obj/fsw_spacewire.o: ../src/fsw_spacewire.c
234 obj/fsw_spacewire.o: ../src/fsw_spacewire.c
235 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c
235 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c
236
236
237 obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c
237 obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c
238 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c
238 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c
239
239
240 obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c
240 obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c
241 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c
241 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c
242
242
243 obj/tc_acceptance.o: ../src/tc_acceptance.c
243 obj/tc_acceptance.o: ../src/tc_acceptance.c
244 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c
244 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c
245
245
246 obj/basic_parameters.o: ../src/basic_parameters/basic_parameters.c ../src/basic_parameters/basic_parameters.h
246 obj/basic_parameters.o: ../src/basic_parameters/basic_parameters.c ../src/basic_parameters/basic_parameters.h
247 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/basic_parameters.o ../src/basic_parameters/basic_parameters.c
247 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/basic_parameters.o ../src/basic_parameters/basic_parameters.c
248
248
249 obj/fsw_processing.o: ../src/processing/fsw_processing.c
249 obj/fsw_processing.o: ../src/processing/fsw_processing.c
250 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/processing/fsw_processing.c
250 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/processing/fsw_processing.c
251
251
252 obj/avf0_prc0.o: ../src/processing/avf0_prc0.c
252 obj/avf0_prc0.o: ../src/processing/avf0_prc0.c
253 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf0_prc0.o ../src/processing/avf0_prc0.c
253 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf0_prc0.o ../src/processing/avf0_prc0.c
254
254
255 obj/avf1_prc1.o: ../src/processing/avf1_prc1.c
255 obj/avf1_prc1.o: ../src/processing/avf1_prc1.c
256 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf1_prc1.o ../src/processing/avf1_prc1.c
256 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf1_prc1.o ../src/processing/avf1_prc1.c
257
257
258 obj/avf2_prc2.o: ../src/processing/avf2_prc2.c
258 obj/avf2_prc2.o: ../src/processing/avf2_prc2.c
259 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf2_prc2.o ../src/processing/avf2_prc2.c
259 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf2_prc2.o ../src/processing/avf2_prc2.c
260
260
261 ####### Install
261 ####### Install
262
262
263 install: FORCE
263 install: FORCE
264
264
265 uninstall: FORCE
265 uninstall: FORCE
266
266
267 FORCE:
267 FORCE:
268
268
@@ -1,201 +1,201
1 <?xml version="1.0" encoding="UTF-8"?>
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE QtCreatorProject>
2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by QtCreator 3.0.1, 2014-05-13T07:49:30. -->
3 <!-- Written by QtCreator 3.0.1, 2014-05-13T15:58:32. -->
4 <qtcreator>
4 <qtcreator>
5 <data>
5 <data>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
7 <value type="int">0</value>
7 <value type="int">0</value>
8 </data>
8 </data>
9 <data>
9 <data>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
10 <variable>ProjectExplorer.Project.EditorSettings</variable>
11 <valuemap type="QVariantMap">
11 <valuemap type="QVariantMap">
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
14 <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
14 <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
15 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
15 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
16 <value type="QString" key="language">Cpp</value>
16 <value type="QString" key="language">Cpp</value>
17 <valuemap type="QVariantMap" key="value">
17 <valuemap type="QVariantMap" key="value">
18 <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
18 <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
19 </valuemap>
19 </valuemap>
20 </valuemap>
20 </valuemap>
21 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
21 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
22 <value type="QString" key="language">QmlJS</value>
22 <value type="QString" key="language">QmlJS</value>
23 <valuemap type="QVariantMap" key="value">
23 <valuemap type="QVariantMap" key="value">
24 <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
24 <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
25 </valuemap>
25 </valuemap>
26 </valuemap>
26 </valuemap>
27 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
27 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
28 <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
28 <value type="QByteArray" key="EditorConfiguration.Codec">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-Qt 4.8.3 in PATH (System)</value>
54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
55 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.3 in PATH (System)</value>
55 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
56 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{be73cf6a-f9d8-4d5a-8adf-adc2d83e2e44}</value>
56 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
57 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
58 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
58 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
59 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
59 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">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">true</value>
180 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
181 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
181 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</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.TargetCount</variable>
190 <variable>ProjectExplorer.Project.TargetCount</variable>
191 <value type="int">1</value>
191 <value type="int">1</value>
192 </data>
192 </data>
193 <data>
193 <data>
194 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
194 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
195 <value type="QByteArray">{cdbf9cdc-1e84-406e-889b-c4feef49e75c}</value>
195 <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
196 </data>
196 </data>
197 <data>
197 <data>
198 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
198 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
199 <value type="int">15</value>
199 <value type="int">15</value>
200 </data>
200 </data>
201 </qtcreator>
201 </qtcreator>
@@ -1,665 +1,665
1 #ifndef CCSDS_TYPES_H_INCLUDED
1 #ifndef CCSDS_TYPES_H_INCLUDED
2 #define CCSDS_TYPES_H_INCLUDED
2 #define CCSDS_TYPES_H_INCLUDED
3
3
4 #include "fsw_params_processing.h"
4 #include "fsw_params_processing.h"
5
5
6 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
6 #define CCSDS_PROTOCOLE_EXTRA_BYTES 4
7 #define CCSDS_TC_TM_PACKET_OFFSET 7
7 #define CCSDS_TC_TM_PACKET_OFFSET 7
8 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
8 #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4
9 #define CCSDS_TM_PKT_MAX_SIZE 4412
9 #define CCSDS_TM_PKT_MAX_SIZE 4412
10 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
10 #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4
11 #define CCSDS_TC_PKT_MAX_SIZE 256
11 #define CCSDS_TC_PKT_MAX_SIZE 256
12 #define CCSDS_TC_PKT_MIN_SIZE 16
12 #define CCSDS_TC_PKT_MIN_SIZE 16
13 #define CCSDS_PROCESS_ID 76
13 #define CCSDS_PROCESS_ID 76
14 #define CCSDS_PACKET_CATEGORY 12
14 #define CCSDS_PACKET_CATEGORY 12
15 #define CCSDS_NODE_ADDRESS 0xfe
15 #define CCSDS_NODE_ADDRESS 0xfe
16 #define CCSDS_USER_APP 0x00
16 #define CCSDS_USER_APP 0x00
17
17
18 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
18 #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10
19 #define DEFAULT_RESERVED 0x00
19 #define DEFAULT_RESERVED 0x00
20 #define DEFAULT_HKBIA 0x1e // 0001 1110
20 #define DEFAULT_HKBIA 0x1e // 0001 1110
21
21
22 // PACKET ID
22 // PACKET ID
23 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
23 #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1
24 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
24 #define APID_TM_HK 0x0cc4 // PID 76 CAT 4
25 #define APID_TM_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9
25 #define APID_TM_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9
26 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
26 #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12
27 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
27 #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12
28 #define TM_PACKET_PID_DEFAULT 76
28 #define TM_PACKET_PID_DEFAULT 76
29 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
29 #define TM_PACKET_PID_BURST_SBM1_SBM2 79
30 #define TM_PACKET_CAT_TC_EXE 1
30 #define TM_PACKET_CAT_TC_EXE 1
31 #define TM_PACKET_CAT_HK 4
31 #define TM_PACKET_CAT_HK 4
32 #define TM_PACKET_CAT_PARAMETER_DUMP 9
32 #define TM_PACKET_CAT_PARAMETER_DUMP 9
33 #define TM_PACKET_CAT_SCIENCE 12
33 #define TM_PACKET_CAT_SCIENCE 12
34 #define TC_PACKET_CAT 12
34 #define TC_PACKET_CAT 12
35
35
36 // PACKET SEQUENCE CONTROL
36 // PACKET SEQUENCE CONTROL
37 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
37 #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000]
38 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
38 #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000]
39 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
39 #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000]
40 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
40 #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000]
41 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
41 #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000]
42
42
43 // DESTINATION ID
43 // DESTINATION ID
44 #define TM_DESTINATION_ID_GROUND 0
44 #define TM_DESTINATION_ID_GROUND 0
45 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
45 #define TM_DESTINATION_ID_MISSION_TIMELINE 110
46 #define TM_DESTINATION_ID_TC_SEQUENCES 111
46 #define TM_DESTINATION_ID_TC_SEQUENCES 111
47 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
47 #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112
48 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
48 #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113
49 #define TM_DESTINATION_ID_DIRECT_CMD 120
49 #define TM_DESTINATION_ID_DIRECT_CMD 120
50 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
50 #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121
51 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
51 #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122
52 #define TM_DESTINATION_ID_OBCP 15
52 #define TM_DESTINATION_ID_OBCP 15
53 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
53 #define TM_DESTINATION_ID_SYSTEM_CONTROL 14
54 #define TM_DESTINATION_ID_AOCS 11
54 #define TM_DESTINATION_ID_AOCS 11
55
55
56 #define CCSDS_DESTINATION_ID 0x01
56 #define CCSDS_DESTINATION_ID 0x01
57 #define CCSDS_PROTOCOLE_ID 0x02
57 #define CCSDS_PROTOCOLE_ID 0x02
58 #define CCSDS_RESERVED 0x00
58 #define CCSDS_RESERVED 0x00
59 #define CCSDS_USER_APP 0x00
59 #define CCSDS_USER_APP 0x00
60
60
61 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
61 #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24
62 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
62 #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32
63 #define SIZE_HK_PARAMETERS 112
63 #define SIZE_HK_PARAMETERS 112
64
64
65 // TC TYPES
65 // TC TYPES
66 #define TC_TYPE_GEN 181
66 #define TC_TYPE_GEN 181
67 #define TC_TYPE_TIME 9
67 #define TC_TYPE_TIME 9
68
68
69 // TC SUBTYPES
69 // TC SUBTYPES
70 #define TC_SUBTYPE_RESET 1
70 #define TC_SUBTYPE_RESET 1
71 #define TC_SUBTYPE_LOAD_COMM 11
71 #define TC_SUBTYPE_LOAD_COMM 11
72 #define TC_SUBTYPE_LOAD_NORM 13
72 #define TC_SUBTYPE_LOAD_NORM 13
73 #define TC_SUBTYPE_LOAD_BURST 19
73 #define TC_SUBTYPE_LOAD_BURST 19
74 #define TC_SUBTYPE_LOAD_SBM1 25
74 #define TC_SUBTYPE_LOAD_SBM1 25
75 #define TC_SUBTYPE_LOAD_SBM2 27
75 #define TC_SUBTYPE_LOAD_SBM2 27
76 #define TC_SUBTYPE_DUMP 31
76 #define TC_SUBTYPE_DUMP 31
77 #define TC_SUBTYPE_ENTER 41
77 #define TC_SUBTYPE_ENTER 41
78 #define TC_SUBTYPE_UPDT_INFO 51
78 #define TC_SUBTYPE_UPDT_INFO 51
79 #define TC_SUBTYPE_EN_CAL 61
79 #define TC_SUBTYPE_EN_CAL 61
80 #define TC_SUBTYPE_DIS_CAL 63
80 #define TC_SUBTYPE_DIS_CAL 63
81 #define TC_SUBTYPE_UPDT_TIME 129
81 #define TC_SUBTYPE_UPDT_TIME 129
82
82
83 // TC LEN
83 // TC LEN
84 #define TC_LEN_RESET 12
84 #define TC_LEN_RESET 12
85 #define TC_LEN_LOAD_COMM 14
85 #define TC_LEN_LOAD_COMM 14
86 #define TC_LEN_LOAD_NORM 22
86 #define TC_LEN_LOAD_NORM 22
87 #define TC_LEN_LOAD_BURST 14
87 #define TC_LEN_LOAD_BURST 14
88 #define TC_LEN_LOAD_SBM1 14
88 #define TC_LEN_LOAD_SBM1 14
89 #define TC_LEN_LOAD_SBM2 14
89 #define TC_LEN_LOAD_SBM2 14
90 #define TC_LEN_DUMP 12
90 #define TC_LEN_DUMP 12
91 #define TC_LEN_ENTER 20
91 #define TC_LEN_ENTER 20
92 #define TC_LEN_UPDT_INFO 46
92 #define TC_LEN_UPDT_INFO 46
93 #define TC_LEN_EN_CAL 12
93 #define TC_LEN_EN_CAL 12
94 #define TC_LEN_DIS_CAL 12
94 #define TC_LEN_DIS_CAL 12
95 #define TC_LEN_UPDT_TIME 18
95 #define TC_LEN_UPDT_TIME 18
96
96
97 // TM TYPES
97 // TM TYPES
98 #define TM_TYPE_TC_EXE 1
98 #define TM_TYPE_TC_EXE 1
99 #define TM_TYPE_HK 3
99 #define TM_TYPE_HK 3
100 #define TM_TYPE_PARAMETER_DUMP 3
100 #define TM_TYPE_PARAMETER_DUMP 3
101 #define TM_TYPE_LFR_SCIENCE 21
101 #define TM_TYPE_LFR_SCIENCE 21
102
102
103 // TM SUBTYPES
103 // TM SUBTYPES
104 #define TM_SUBTYPE_EXE_OK 7
104 #define TM_SUBTYPE_EXE_OK 7
105 #define TM_SUBTYPE_EXE_NOK 8
105 #define TM_SUBTYPE_EXE_NOK 8
106 #define TM_SUBTYPE_HK 25
106 #define TM_SUBTYPE_HK 25
107 #define TM_SUBTYPE_PARAMETER_DUMP 25
107 #define TM_SUBTYPE_PARAMETER_DUMP 25
108 #define TM_SUBTYPE_SCIENCE 3
108 #define TM_SUBTYPE_SCIENCE 3
109 #define TM_SUBTYPE_LFR_SCIENCE 3
109 #define TM_SUBTYPE_LFR_SCIENCE 3
110
110
111 // FAILURE CODES
111 // FAILURE CODES
112 #define ILLEGAL_APID 0
112 #define ILLEGAL_APID 0
113 #define WRONG_LEN_PKT 1
113 #define WRONG_LEN_PKT 1
114 #define INCOR_CHECKSUM 2
114 #define INCOR_CHECKSUM 2
115 #define ILL_TYPE 3
115 #define ILL_TYPE 3
116 #define ILL_SUBTYPE 4
116 #define ILL_SUBTYPE 4
117 #define WRONG_APP_DATA 5 // 0x00 0x05
117 #define WRONG_APP_DATA 5 // 0x00 0x05
118 #define TC_NOT_EXE 42000 // 0xa4 0x10
118 #define TC_NOT_EXE 42000 // 0xa4 0x10
119 #define WRONG_SRC_ID 42001 // 0xa4 0x11
119 #define WRONG_SRC_ID 42001 // 0xa4 0x11
120 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
120 #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12
121 #define FAIL_DETECTED 42003 // 0xa4 0x13
121 #define FAIL_DETECTED 42003 // 0xa4 0x13
122 #define NOT_ALLOWED 42004 // 0xa4 0x14
122 #define NOT_ALLOWED 42004 // 0xa4 0x14
123 #define CORRUPTED 42005 // 0xa4 0x15
123 #define CORRUPTED 42005 // 0xa4 0x15
124 #define CCSDS_TM_VALID 7
124 #define CCSDS_TM_VALID 7
125
125
126 // TC SID
126 // TC SID
127 #define SID_TC_GROUND 0
127 #define SID_TC_GROUND 0
128 #define SID_TC_MISSION_TIMELINE 110
128 #define SID_TC_MISSION_TIMELINE 110
129 #define SID_TC_TC_SEQUENCES 111
129 #define SID_TC_TC_SEQUENCES 111
130 #define SID_TC_RECOVERY_ACTION_CMD 112
130 #define SID_TC_RECOVERY_ACTION_CMD 112
131 #define SID_TC_BACKUP_MISSION_TIMELINE 113
131 #define SID_TC_BACKUP_MISSION_TIMELINE 113
132 #define SID_TC_DIRECT_CMD 120
132 #define SID_TC_DIRECT_CMD 120
133 #define SID_TC_SPARE_GRD_SRC1 121
133 #define SID_TC_SPARE_GRD_SRC1 121
134 #define SID_TC_SPARE_GRD_SRC2 122
134 #define SID_TC_SPARE_GRD_SRC2 122
135 #define SID_TC_OBCP 15
135 #define SID_TC_OBCP 15
136 #define SID_TC_SYSTEM_CONTROL 14
136 #define SID_TC_SYSTEM_CONTROL 14
137 #define SID_TC_AOCS 11
137 #define SID_TC_AOCS 11
138 #define SID_TC_RPW_INTERNAL 254
138 #define SID_TC_RPW_INTERNAL 254
139
139
140 enum apid_destid{
140 enum apid_destid{
141 GROUND,
141 GROUND,
142 MISSION_TIMELINE,
142 MISSION_TIMELINE,
143 TC_SEQUENCES,
143 TC_SEQUENCES,
144 RECOVERY_ACTION_CMD,
144 RECOVERY_ACTION_CMD,
145 BACKUP_MISSION_TIMELINE,
145 BACKUP_MISSION_TIMELINE,
146 DIRECT_CMD,
146 DIRECT_CMD,
147 SPARE_GRD_SRC1,
147 SPARE_GRD_SRC1,
148 SPARE_GRD_SRC2,
148 SPARE_GRD_SRC2,
149 OBCP,
149 OBCP,
150 SYSTEM_CONTROL,
150 SYSTEM_CONTROL,
151 AOCS,
151 AOCS,
152 RPW_INTERNAL
152 RPW_INTERNAL
153 };
153 };
154 // SEQUENCE COUNTERS
154 // SEQUENCE COUNTERS
155 #define SEQ_CNT_MAX 16383
155 #define SEQ_CNT_MAX 16383
156 #define SEQ_CNT_NB_DEST_ID 12
156 #define SEQ_CNT_NB_DEST_ID 12
157
157
158 // TM SID
158 // TM SID
159 #define SID_HK 1
159 #define SID_HK 1
160 #define SID_PARAMETER_DUMP 10
160 #define SID_PARAMETER_DUMP 10
161
161
162 #define SID_NORM_SWF_F0 3
162 #define SID_NORM_SWF_F0 3
163 #define SID_NORM_SWF_F1 4
163 #define SID_NORM_SWF_F1 4
164 #define SID_NORM_SWF_F2 5
164 #define SID_NORM_SWF_F2 5
165 #define SID_NORM_CWF_F3 1
165 #define SID_NORM_CWF_F3 1
166 #define SID_BURST_CWF_F2 2
166 #define SID_BURST_CWF_F2 2
167 #define SID_SBM1_CWF_F1 24
167 #define SID_SBM1_CWF_F1 24
168 #define SID_SBM2_CWF_F2 25
168 #define SID_SBM2_CWF_F2 25
169 #define SID_NORM_ASM_F0 11
169 #define SID_NORM_ASM_F0 11
170 #define SID_NORM_ASM_F1 12
170 #define SID_NORM_ASM_F1 12
171 #define SID_NORM_ASM_F2 13
171 #define SID_NORM_ASM_F2 13
172 #define SID_NORM_BP1_F0 14
172 #define SID_NORM_BP1_F0 14
173 #define SID_NORM_BP1_F1 15
173 #define SID_NORM_BP1_F1 15
174 #define SID_NORM_BP1_F2 16
174 #define SID_NORM_BP1_F2 16
175 #define SID_NORM_BP2_F0 19
175 #define SID_NORM_BP2_F0 19
176 #define SID_NORM_BP2_F1 20
176 #define SID_NORM_BP2_F1 20
177 #define SID_NORM_BP2_F2 21
177 #define SID_NORM_BP2_F2 21
178 #define SID_BURST_BP1_F0 17
178 #define SID_BURST_BP1_F0 17
179 #define SID_BURST_BP2_F0 22
179 #define SID_BURST_BP2_F0 22
180 #define SID_BURST_BP1_F1 18
180 #define SID_BURST_BP1_F1 18
181 #define SID_BURST_BP2_F1 23
181 #define SID_BURST_BP2_F1 23
182 #define SID_SBM1_BP1_F0 28
182 #define SID_SBM1_BP1_F0 28
183 #define SID_SBM1_BP2_F0 31
183 #define SID_SBM1_BP2_F0 31
184 #define SID_SBM2_BP1_F0 29
184 #define SID_SBM2_BP1_F0 29
185 #define SID_SBM2_BP2_F0 32
185 #define SID_SBM2_BP2_F0 32
186 #define SID_SBM2_BP1_F1 30
186 #define SID_SBM2_BP1_F1 30
187 #define SID_SBM2_BP2_F1 33
187 #define SID_SBM2_BP2_F1 33
188 #define SID_NORM_CWF_LONG_F3 34
188 #define SID_NORM_CWF_LONG_F3 34
189
189
190 // LENGTH (BYTES)
190 // LENGTH (BYTES)
191 #define LENGTH_TM_LFR_TC_EXE_MAX 32
191 #define LENGTH_TM_LFR_TC_EXE_MAX 32
192 #define LENGTH_TM_LFR_HK 126
192 #define LENGTH_TM_LFR_HK 126
193
193
194 // HEADER_LENGTH
194 // HEADER_LENGTH
195 #define TM_HEADER_LEN 16
195 #define TM_HEADER_LEN 16
196 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28
196 #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28
197 // PACKET_LENGTH
197 // PACKET_LENGTH
198 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
198 #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET)
199 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
199 #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET)
200 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
200 #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET)
201 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
201 #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET)
202 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
202 #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET)
203 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
203 #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET)
204 #define PACKET_LENGTH_HK (124 - CCSDS_TC_TM_PACKET_OFFSET)
204 #define PACKET_LENGTH_HK (124 - CCSDS_TC_TM_PACKET_OFFSET)
205 #define PACKET_LENGTH_PARAMETER_DUMP (36 - CCSDS_TC_TM_PACKET_OFFSET)
205 #define PACKET_LENGTH_PARAMETER_DUMP (36 - CCSDS_TC_TM_PACKET_OFFSET)
206 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0 (2228 - CCSDS_TC_TM_PACKET_OFFSET) // 44 * 25 * 2 + 28
206 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0 (2228 - CCSDS_TC_TM_PACKET_OFFSET) // 44 * 25 * 2 + 28
207 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1 (2628 - CCSDS_TC_TM_PACKET_OFFSET) // 52 * 25 * 2 + 28
207 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1 (2628 - CCSDS_TC_TM_PACKET_OFFSET) // 52 * 25 * 2 + 28
208 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F2 (2428 - CCSDS_TC_TM_PACKET_OFFSET) // 48 * 25 * 2 + 28
208 #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F2 (2428 - CCSDS_TC_TM_PACKET_OFFSET) // 48 * 25 * 2 + 28
209 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 (126 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 9 + 27
209 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 (126 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 9 + 27
210 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (356 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 26
210 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (356 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 26
211 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 (144 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 9 + 27
211 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 (144 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 9 + 27
212 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 (416 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 30 + 26
212 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 (416 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 30 + 26
213 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F2 (134 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 9 + 26
213 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F2 (134 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 9 + 26
214 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F2 (386 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 30 + 26
214 #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F2 (386 - CCSDS_TC_TM_PACKET_OFFSET) // 12 * 30 + 26
215 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 (224 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 9 + 26
215 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 (224 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 9 + 26
216 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 (686 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 30 + 26
216 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 (686 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 30 + 26
217 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 (260 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 9 + 26
217 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 (260 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 9 + 26
218 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (806 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 26
218 #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (806 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 26
219
219
220 #define PACKET_LENGTH_DELTA 11 // 7 + 4
220 #define PACKET_LENGTH_DELTA 11 // 7 + 4
221
221
222 #define SPARE1_PUSVERSION_SPARE2 0x10
222 #define SPARE1_PUSVERSION_SPARE2 0x10
223
223
224 // R1
224 // R1
225 #define TM_LEN_SCI_SWF_340 4101 // 340 * 12 + 10 + 12 - 1
225 #define TM_LEN_SCI_SWF_340 4101 // 340 * 12 + 10 + 12 - 1
226 #define TM_LEN_SCI_SWF_8 117 // 8 * 12 + 10 + 12 - 1
226 #define TM_LEN_SCI_SWF_8 117 // 8 * 12 + 10 + 12 - 1
227 #define TM_LEN_SCI_CWF_340 4099 // 340 * 12 + 10 + 10 - 1
227 #define TM_LEN_SCI_CWF_340 4099 // 340 * 12 + 10 + 10 - 1
228 #define TM_LEN_SCI_CWF_8 115 // 8 * 12 + 10 + 10 - 1
228 #define TM_LEN_SCI_CWF_8 115 // 8 * 12 + 10 + 10 - 1
229 #define TM_LEN_SCI_CWF3_LIGHT_340 2059 // 340 * 6 + 10 + 10 - 1
229 #define TM_LEN_SCI_CWF3_LIGHT_340 2059 // 340 * 6 + 10 + 10 - 1
230 #define TM_LEN_SCI_CWF3_LIGHT_8 67 // 8 * 6 + 10 + 10 - 1
230 #define TM_LEN_SCI_CWF3_LIGHT_8 67 // 8 * 6 + 10 + 10 - 1
231 // R2
231 // R2
232 #define TM_LEN_SCI_SWF_304 3669 // 304 * 12 + 10 + 12 - 1
232 #define TM_LEN_SCI_SWF_304 3669 // 304 * 12 + 10 + 12 - 1
233 #define TM_LEN_SCI_SWF_224 2709 // 224 * 12 + 10 + 12 - 1
233 #define TM_LEN_SCI_SWF_224 2709 // 224 * 12 + 10 + 12 - 1
234 #define TM_LEN_SCI_CWF_336 4051 // 336 * 12 + 10 + 10 - 1
234 #define TM_LEN_SCI_CWF_336 4051 // 336 * 12 + 10 + 10 - 1
235 #define TM_LEN_SCI_CWF_672 4051 // 672 * 6 + 10 + 10 - 1
235 #define TM_LEN_SCI_CWF_672 4051 // 672 * 6 + 10 + 10 - 1
236 //
236 //
237 #define DEFAULT_PKTCNT 0x07
237 #define DEFAULT_PKTCNT 0x07
238 #define BLK_NR_304 0x0130
238 #define BLK_NR_304 0x0130
239 #define BLK_NR_224 0x00e0
239 #define BLK_NR_224 0x00e0
240 #define BLK_NR_CWF 0x0150 // 336
240 #define BLK_NR_CWF 0x0150 // 336
241 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
241 #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672
242
242
243 enum TM_TYPE{
243 enum TM_TYPE{
244 TM_LFR_TC_EXE_OK,
244 TM_LFR_TC_EXE_OK,
245 TM_LFR_TC_EXE_ERR,
245 TM_LFR_TC_EXE_ERR,
246 TM_LFR_HK,
246 TM_LFR_HK,
247 TM_LFR_SCI,
247 TM_LFR_SCI,
248 TM_LFR_SCI_SBM,
248 TM_LFR_SCI_SBM,
249 TM_LFR_PAR_DUMP
249 TM_LFR_PAR_DUMP
250 };
250 };
251
251
252 typedef struct {
252 typedef struct {
253 unsigned char targetLogicalAddress;
253 unsigned char targetLogicalAddress;
254 unsigned char protocolIdentifier;
254 unsigned char protocolIdentifier;
255 unsigned char reserved;
255 unsigned char reserved;
256 unsigned char userApplication;
256 unsigned char userApplication;
257 // PACKET HEADER
257 // PACKET HEADER
258 unsigned char packetID[2];
258 unsigned char packetID[2];
259 unsigned char packetSequenceControl[2];
259 unsigned char packetSequenceControl[2];
260 unsigned char packetLength[2];
260 unsigned char packetLength[2];
261 // DATA FIELD HEADER
261 // DATA FIELD HEADER
262 unsigned char spare1_pusVersion_spare2;
262 unsigned char spare1_pusVersion_spare2;
263 unsigned char serviceType;
263 unsigned char serviceType;
264 unsigned char serviceSubType;
264 unsigned char serviceSubType;
265 unsigned char destinationID;
265 unsigned char destinationID;
266 unsigned char time[6];
266 unsigned char time[6];
267 //
267 //
268 unsigned char telecommand_pkt_id[2];
268 unsigned char telecommand_pkt_id[2];
269 unsigned char pkt_seq_control[2];
269 unsigned char pkt_seq_control[2];
270 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
270 } Packet_TM_LFR_TC_EXE_SUCCESS_t;
271
271
272 typedef struct {
272 typedef struct {
273 unsigned char targetLogicalAddress;
273 unsigned char targetLogicalAddress;
274 unsigned char protocolIdentifier;
274 unsigned char protocolIdentifier;
275 unsigned char reserved;
275 unsigned char reserved;
276 unsigned char userApplication;
276 unsigned char userApplication;
277 // PACKET HEADER
277 // PACKET HEADER
278 unsigned char packetID[2];
278 unsigned char packetID[2];
279 unsigned char packetSequenceControl[2];
279 unsigned char packetSequenceControl[2];
280 unsigned char packetLength[2];
280 unsigned char packetLength[2];
281 // DATA FIELD HEADER
281 // DATA FIELD HEADER
282 unsigned char spare1_pusVersion_spare2;
282 unsigned char spare1_pusVersion_spare2;
283 unsigned char serviceType;
283 unsigned char serviceType;
284 unsigned char serviceSubType;
284 unsigned char serviceSubType;
285 unsigned char destinationID;
285 unsigned char destinationID;
286 unsigned char time[6];
286 unsigned char time[6];
287 //
287 //
288 unsigned char tc_failure_code[2];
288 unsigned char tc_failure_code[2];
289 unsigned char telecommand_pkt_id[2];
289 unsigned char telecommand_pkt_id[2];
290 unsigned char pkt_seq_control[2];
290 unsigned char pkt_seq_control[2];
291 unsigned char tc_service;
291 unsigned char tc_service;
292 unsigned char tc_subtype;
292 unsigned char tc_subtype;
293 unsigned char byte_position;
293 unsigned char byte_position;
294 unsigned char rcv_value;
294 unsigned char rcv_value;
295 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
295 } Packet_TM_LFR_TC_EXE_INCONSISTENT_t;
296
296
297 typedef struct {
297 typedef struct {
298 unsigned char targetLogicalAddress;
298 unsigned char targetLogicalAddress;
299 unsigned char protocolIdentifier;
299 unsigned char protocolIdentifier;
300 unsigned char reserved;
300 unsigned char reserved;
301 unsigned char userApplication;
301 unsigned char userApplication;
302 // PACKET HEADER
302 // PACKET HEADER
303 unsigned char packetID[2];
303 unsigned char packetID[2];
304 unsigned char packetSequenceControl[2];
304 unsigned char packetSequenceControl[2];
305 unsigned char packetLength[2];
305 unsigned char packetLength[2];
306 // DATA FIELD HEADER
306 // DATA FIELD HEADER
307 unsigned char spare1_pusVersion_spare2;
307 unsigned char spare1_pusVersion_spare2;
308 unsigned char serviceType;
308 unsigned char serviceType;
309 unsigned char serviceSubType;
309 unsigned char serviceSubType;
310 unsigned char destinationID;
310 unsigned char destinationID;
311 unsigned char time[6];
311 unsigned char time[6];
312 //
312 //
313 unsigned char tc_failure_code[2];
313 unsigned char tc_failure_code[2];
314 unsigned char telecommand_pkt_id[2];
314 unsigned char telecommand_pkt_id[2];
315 unsigned char pkt_seq_control[2];
315 unsigned char pkt_seq_control[2];
316 unsigned char tc_service;
316 unsigned char tc_service;
317 unsigned char tc_subtype;
317 unsigned char tc_subtype;
318 unsigned char lfr_status_word[2];
318 unsigned char lfr_status_word[2];
319 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
319 } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t;
320
320
321 typedef struct {
321 typedef struct {
322 unsigned char targetLogicalAddress;
322 unsigned char targetLogicalAddress;
323 unsigned char protocolIdentifier;
323 unsigned char protocolIdentifier;
324 unsigned char reserved;
324 unsigned char reserved;
325 unsigned char userApplication;
325 unsigned char userApplication;
326 // PACKET HEADER
326 // PACKET HEADER
327 unsigned char packetID[2];
327 unsigned char packetID[2];
328 unsigned char packetSequenceControl[2];
328 unsigned char packetSequenceControl[2];
329 unsigned char packetLength[2];
329 unsigned char packetLength[2];
330 // DATA FIELD HEADER
330 // DATA FIELD HEADER
331 unsigned char spare1_pusVersion_spare2;
331 unsigned char spare1_pusVersion_spare2;
332 unsigned char serviceType;
332 unsigned char serviceType;
333 unsigned char serviceSubType;
333 unsigned char serviceSubType;
334 unsigned char destinationID;
334 unsigned char destinationID;
335 unsigned char time[6];
335 unsigned char time[6];
336 //
336 //
337 unsigned char tc_failure_code[2];
337 unsigned char tc_failure_code[2];
338 unsigned char telecommand_pkt_id[2];
338 unsigned char telecommand_pkt_id[2];
339 unsigned char pkt_seq_control[2];
339 unsigned char pkt_seq_control[2];
340 unsigned char tc_service;
340 unsigned char tc_service;
341 unsigned char tc_subtype;
341 unsigned char tc_subtype;
342 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
342 } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t;
343
343
344 typedef struct {
344 typedef struct {
345 unsigned char targetLogicalAddress;
345 unsigned char targetLogicalAddress;
346 unsigned char protocolIdentifier;
346 unsigned char protocolIdentifier;
347 unsigned char reserved;
347 unsigned char reserved;
348 unsigned char userApplication;
348 unsigned char userApplication;
349 // PACKET HEADER
349 // PACKET HEADER
350 unsigned char packetID[2];
350 unsigned char packetID[2];
351 unsigned char packetSequenceControl[2];
351 unsigned char packetSequenceControl[2];
352 unsigned char packetLength[2];
352 unsigned char packetLength[2];
353 // DATA FIELD HEADER
353 // DATA FIELD HEADER
354 unsigned char spare1_pusVersion_spare2;
354 unsigned char spare1_pusVersion_spare2;
355 unsigned char serviceType;
355 unsigned char serviceType;
356 unsigned char serviceSubType;
356 unsigned char serviceSubType;
357 unsigned char destinationID;
357 unsigned char destinationID;
358 unsigned char time[6];
358 unsigned char time[6];
359 //
359 //
360 unsigned char tc_failure_code[2];
360 unsigned char tc_failure_code[2];
361 unsigned char telecommand_pkt_id[2];
361 unsigned char telecommand_pkt_id[2];
362 unsigned char pkt_seq_control[2];
362 unsigned char pkt_seq_control[2];
363 unsigned char tc_service;
363 unsigned char tc_service;
364 unsigned char tc_subtype;
364 unsigned char tc_subtype;
365 } Packet_TM_LFR_TC_EXE_ERROR_t;
365 } Packet_TM_LFR_TC_EXE_ERROR_t;
366
366
367 typedef struct {
367 typedef struct {
368 unsigned char targetLogicalAddress;
368 unsigned char targetLogicalAddress;
369 unsigned char protocolIdentifier;
369 unsigned char protocolIdentifier;
370 unsigned char reserved;
370 unsigned char reserved;
371 unsigned char userApplication;
371 unsigned char userApplication;
372 // PACKET HEADER
372 // PACKET HEADER
373 unsigned char packetID[2];
373 unsigned char packetID[2];
374 unsigned char packetSequenceControl[2];
374 unsigned char packetSequenceControl[2];
375 unsigned char packetLength[2];
375 unsigned char packetLength[2];
376 // DATA FIELD HEADER
376 // DATA FIELD HEADER
377 unsigned char spare1_pusVersion_spare2;
377 unsigned char spare1_pusVersion_spare2;
378 unsigned char serviceType;
378 unsigned char serviceType;
379 unsigned char serviceSubType;
379 unsigned char serviceSubType;
380 unsigned char destinationID;
380 unsigned char destinationID;
381 unsigned char time[6];
381 unsigned char time[6];
382 //
382 //
383 unsigned char tc_failure_code[2];
383 unsigned char tc_failure_code[2];
384 unsigned char telecommand_pkt_id[2];
384 unsigned char telecommand_pkt_id[2];
385 unsigned char pkt_seq_control[2];
385 unsigned char pkt_seq_control[2];
386 unsigned char tc_service;
386 unsigned char tc_service;
387 unsigned char tc_subtype;
387 unsigned char tc_subtype;
388 unsigned char pkt_len_rcv_value[2];
388 unsigned char pkt_len_rcv_value[2];
389 unsigned char pkt_datafieldsize_cnt[2];
389 unsigned char pkt_datafieldsize_cnt[2];
390 unsigned char rcv_crc[2];
390 unsigned char rcv_crc[2];
391 unsigned char computed_crc[2];
391 unsigned char computed_crc[2];
392 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
392 } Packet_TM_LFR_TC_EXE_CORRUPTED_t;
393
393
394 typedef struct {
394 typedef struct {
395 unsigned char targetLogicalAddress;
395 unsigned char targetLogicalAddress;
396 unsigned char protocolIdentifier;
396 unsigned char protocolIdentifier;
397 unsigned char reserved;
397 unsigned char reserved;
398 unsigned char userApplication;
398 unsigned char userApplication;
399 unsigned char packetID[2];
399 unsigned char packetID[2];
400 unsigned char packetSequenceControl[2];
400 unsigned char packetSequenceControl[2];
401 unsigned char packetLength[2];
401 unsigned char packetLength[2];
402 // DATA FIELD HEADER
402 // DATA FIELD HEADER
403 unsigned char spare1_pusVersion_spare2;
403 unsigned char spare1_pusVersion_spare2;
404 unsigned char serviceType;
404 unsigned char serviceType;
405 unsigned char serviceSubType;
405 unsigned char serviceSubType;
406 unsigned char destinationID;
406 unsigned char destinationID;
407 unsigned char time[6];
407 unsigned char time[6];
408 // AUXILIARY HEADER
408 // AUXILIARY HEADER
409 unsigned char sid;
409 unsigned char sid;
410 unsigned char hkBIA;
410 unsigned char hkBIA;
411 unsigned char pktCnt;
411 unsigned char pktCnt;
412 unsigned char pktNr;
412 unsigned char pktNr;
413 unsigned char acquisitionTime[6];
413 unsigned char acquisitionTime[6];
414 unsigned char blkNr[2];
414 unsigned char blkNr[2];
415 } Header_TM_LFR_SCIENCE_SWF_t;
415 } Header_TM_LFR_SCIENCE_SWF_t;
416
416
417 typedef struct {
417 typedef struct {
418 unsigned char targetLogicalAddress;
418 unsigned char targetLogicalAddress;
419 unsigned char protocolIdentifier;
419 unsigned char protocolIdentifier;
420 unsigned char reserved;
420 unsigned char reserved;
421 unsigned char userApplication;
421 unsigned char userApplication;
422 unsigned char packetID[2];
422 unsigned char packetID[2];
423 unsigned char packetSequenceControl[2];
423 unsigned char packetSequenceControl[2];
424 unsigned char packetLength[2];
424 unsigned char packetLength[2];
425 // DATA FIELD HEADER
425 // DATA FIELD HEADER
426 unsigned char spare1_pusVersion_spare2;
426 unsigned char spare1_pusVersion_spare2;
427 unsigned char serviceType;
427 unsigned char serviceType;
428 unsigned char serviceSubType;
428 unsigned char serviceSubType;
429 unsigned char destinationID;
429 unsigned char destinationID;
430 unsigned char time[6];
430 unsigned char time[6];
431 // AUXILIARY DATA HEADER
431 // AUXILIARY DATA HEADER
432 unsigned char sid;
432 unsigned char sid;
433 unsigned char hkBIA;
433 unsigned char hkBIA;
434 unsigned char acquisitionTime[6];
434 unsigned char acquisitionTime[6];
435 unsigned char blkNr[2];
435 unsigned char blkNr[2];
436 } Header_TM_LFR_SCIENCE_CWF_t;
436 } Header_TM_LFR_SCIENCE_CWF_t;
437
437
438 typedef struct {
438 typedef struct {
439 unsigned char targetLogicalAddress;
439 unsigned char targetLogicalAddress;
440 unsigned char protocolIdentifier;
440 unsigned char protocolIdentifier;
441 unsigned char reserved;
441 unsigned char reserved;
442 unsigned char userApplication;
442 unsigned char userApplication;
443 unsigned char packetID[2];
443 unsigned char packetID[2];
444 unsigned char packetSequenceControl[2];
444 unsigned char packetSequenceControl[2];
445 unsigned char packetLength[2];
445 unsigned char packetLength[2];
446 // DATA FIELD HEADER
446 // DATA FIELD HEADER
447 unsigned char spare1_pusVersion_spare2;
447 unsigned char spare1_pusVersion_spare2;
448 unsigned char serviceType;
448 unsigned char serviceType;
449 unsigned char serviceSubType;
449 unsigned char serviceSubType;
450 unsigned char destinationID;
450 unsigned char destinationID;
451 unsigned char time[6];
451 unsigned char time[6];
452 // AUXILIARY HEADER
452 // AUXILIARY HEADER
453 unsigned char sid;
453 unsigned char sid;
454 unsigned char biaStatusInfo;
454 unsigned char biaStatusInfo;
455 unsigned char pa_lfr_pkt_cnt_asm;
455 unsigned char pa_lfr_pkt_cnt_asm;
456 unsigned char pa_lfr_pkt_nr_asm;
456 unsigned char pa_lfr_pkt_nr_asm;
457 unsigned char acquisitionTime[6];
457 unsigned char acquisitionTime[6];
458 unsigned char pa_lfr_asm_blk_nr[2];
458 unsigned char pa_lfr_asm_blk_nr[2];
459 } Header_TM_LFR_SCIENCE_ASM_t;
459 } Header_TM_LFR_SCIENCE_ASM_t;
460
460
461 typedef struct {
461 typedef struct {
462 unsigned char targetLogicalAddress;
462 unsigned char targetLogicalAddress;
463 unsigned char protocolIdentifier;
463 unsigned char protocolIdentifier;
464 unsigned char reserved;
464 unsigned char reserved;
465 unsigned char userApplication;
465 unsigned char userApplication;
466 unsigned char packetID[2];
466 unsigned char packetID[2];
467 unsigned char packetSequenceControl[2];
467 unsigned char packetSequenceControl[2];
468 unsigned char packetLength[2];
468 unsigned char packetLength[2];
469 // DATA FIELD HEADER
469 // DATA FIELD HEADER
470 unsigned char spare1_pusVersion_spare2;
470 unsigned char spare1_pusVersion_spare2;
471 unsigned char serviceType;
471 unsigned char serviceType;
472 unsigned char serviceSubType;
472 unsigned char serviceSubType;
473 unsigned char destinationID;
473 unsigned char destinationID;
474 unsigned char time[6];
474 unsigned char time[6];
475 // AUXILIARY HEADER
475 // AUXILIARY HEADER
476 unsigned char sid;
476 unsigned char sid;
477 unsigned char biaStatusInfo;
477 unsigned char biaStatusInfo;
478 unsigned char acquisitionTime[6];
478 unsigned char acquisitionTime[6];
479 unsigned char source_data_spare[2];
479 unsigned char source_data_spare[2];
480 unsigned char pa_lfr_bp_blk_nr[2];
480 unsigned char pa_lfr_bp_blk_nr[2];
481 } Header_TM_LFR_SCIENCE_BP_with_spare_t;
481 } Header_TM_LFR_SCIENCE_BP_with_spare_t;
482
482
483 typedef struct {
483 typedef struct {
484 unsigned char targetLogicalAddress;
484 unsigned char targetLogicalAddress;
485 unsigned char protocolIdentifier;
485 unsigned char protocolIdentifier;
486 unsigned char reserved;
486 unsigned char reserved;
487 unsigned char userApplication;
487 unsigned char userApplication;
488 unsigned char packetID[2];
488 unsigned char packetID[2];
489 unsigned char packetSequenceControl[2];
489 unsigned char packetSequenceControl[2];
490 unsigned char packetLength[2];
490 unsigned char packetLength[2];
491 // DATA FIELD HEADER
491 // DATA FIELD HEADER
492 unsigned char spare1_pusVersion_spare2;
492 unsigned char spare1_pusVersion_spare2;
493 unsigned char serviceType;
493 unsigned char serviceType;
494 unsigned char serviceSubType;
494 unsigned char serviceSubType;
495 unsigned char destinationID;
495 unsigned char destinationID;
496 unsigned char time[6];
496 unsigned char time[6];
497 // AUXILIARY HEADER
497 // AUXILIARY HEADER
498 unsigned char sid;
498 unsigned char sid;
499 unsigned char biaStatusInfo;
499 unsigned char biaStatusInfo;
500 unsigned char acquisitionTime[6];
500 unsigned char acquisitionTime[6];
501 unsigned char pa_lfr_bp_blk_nr[2];
501 unsigned char pa_lfr_bp_blk_nr[2];
502 } Header_TM_LFR_SCIENCE_BP_t;
502 } Header_TM_LFR_SCIENCE_BP_t;
503
503
504 typedef struct {
504 typedef struct {
505 //targetLogicalAddress is removed by the grspw module
505 //targetLogicalAddress is removed by the grspw module
506 unsigned char protocolIdentifier;
506 unsigned char protocolIdentifier;
507 unsigned char reserved;
507 unsigned char reserved;
508 unsigned char userApplication;
508 unsigned char userApplication;
509 unsigned char packetID[2];
509 unsigned char packetID[2];
510 unsigned char packetSequenceControl[2];
510 unsigned char packetSequenceControl[2];
511 unsigned char packetLength[2];
511 unsigned char packetLength[2];
512 // DATA FIELD HEADER
512 // DATA FIELD HEADER
513 unsigned char headerFlag_pusVersion_Ack;
513 unsigned char headerFlag_pusVersion_Ack;
514 unsigned char serviceType;
514 unsigned char serviceType;
515 unsigned char serviceSubType;
515 unsigned char serviceSubType;
516 unsigned char sourceID;
516 unsigned char sourceID;
517 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
517 unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10];
518 } ccsdsTelecommandPacket_t;
518 } ccsdsTelecommandPacket_t;
519
519
520 typedef struct {
520 typedef struct {
521 unsigned char targetLogicalAddress;
521 unsigned char targetLogicalAddress;
522 unsigned char protocolIdentifier;
522 unsigned char protocolIdentifier;
523 unsigned char reserved;
523 unsigned char reserved;
524 unsigned char userApplication;
524 unsigned char userApplication;
525 unsigned char packetID[2];
525 unsigned char packetID[2];
526 unsigned char packetSequenceControl[2];
526 unsigned char packetSequenceControl[2];
527 unsigned char packetLength[2];
527 unsigned char packetLength[2];
528 unsigned char spare1_pusVersion_spare2;
528 unsigned char spare1_pusVersion_spare2;
529 unsigned char serviceType;
529 unsigned char serviceType;
530 unsigned char serviceSubType;
530 unsigned char serviceSubType;
531 unsigned char destinationID;
531 unsigned char destinationID;
532 unsigned char time[6];
532 unsigned char time[6];
533 unsigned char sid;
533 unsigned char sid;
534
534
535 //**************
535 //**************
536 // HK PARAMETERS
536 // HK PARAMETERS
537 unsigned char lfr_status_word[2];
537 unsigned char lfr_status_word[2];
538 unsigned char lfr_sw_version[4];
538 unsigned char lfr_sw_version[4];
539 unsigned char lfr_fpga_version[3];
539 unsigned char lfr_fpga_version[3];
540 // ressource statistics
540 // ressource statistics
541 unsigned char hk_lfr_cpu_load;
541 unsigned char hk_lfr_cpu_load;
542 unsigned char hk_lfr_load_max;
542 unsigned char hk_lfr_load_max;
543 unsigned char hk_lfr_load_aver;
543 unsigned char hk_lfr_load_aver;
544 // tc statistics
544 // tc statistics
545 unsigned char hk_lfr_update_info_tc_cnt[2];
545 unsigned char hk_lfr_update_info_tc_cnt[2];
546 unsigned char hk_lfr_update_time_tc_cnt[2];
546 unsigned char hk_lfr_update_time_tc_cnt[2];
547 unsigned char hk_lfr_exe_tc_cnt[2];
547 unsigned char hk_lfr_exe_tc_cnt[2];
548 unsigned char hk_lfr_rej_tc_cnt[2];
548 unsigned char hk_lfr_rej_tc_cnt[2];
549 unsigned char hk_lfr_last_exe_tc_id[2];
549 unsigned char hk_lfr_last_exe_tc_id[2];
550 unsigned char hk_lfr_last_exe_tc_type[2];
550 unsigned char hk_lfr_last_exe_tc_type[2];
551 unsigned char hk_lfr_last_exe_tc_subtype[2];
551 unsigned char hk_lfr_last_exe_tc_subtype[2];
552 unsigned char hk_lfr_last_exe_tc_time[6];
552 unsigned char hk_lfr_last_exe_tc_time[6];
553 unsigned char hk_lfr_last_rej_tc_id[2];
553 unsigned char hk_lfr_last_rej_tc_id[2];
554 unsigned char hk_lfr_last_rej_tc_type[2];
554 unsigned char hk_lfr_last_rej_tc_type[2];
555 unsigned char hk_lfr_last_rej_tc_subtype[2];
555 unsigned char hk_lfr_last_rej_tc_subtype[2];
556 unsigned char hk_lfr_last_rej_tc_time[6];
556 unsigned char hk_lfr_last_rej_tc_time[6];
557 // anomaly statistics
557 // anomaly statistics
558 unsigned char hk_lfr_le_cnt[2];
558 unsigned char hk_lfr_le_cnt[2];
559 unsigned char hk_lfr_me_cnt[2];
559 unsigned char hk_lfr_me_cnt[2];
560 unsigned char hk_lfr_he_cnt[2];
560 unsigned char hk_lfr_he_cnt[2];
561 unsigned char hk_lfr_last_er_rid[2];
561 unsigned char hk_lfr_last_er_rid[2];
562 unsigned char hk_lfr_last_er_code;
562 unsigned char hk_lfr_last_er_code;
563 unsigned char hk_lfr_last_er_time[6];
563 unsigned char hk_lfr_last_er_time[6];
564 // vhdl_blk_status
564 // vhdl_blk_status
565 unsigned char hk_lfr_vhdl_aa_sm;
565 unsigned char hk_lfr_vhdl_aa_sm;
566 unsigned char hk_lfr_vhdl_fft_sr;
566 unsigned char hk_lfr_vhdl_fft_sr;
567 unsigned char hk_lfr_vhdl_cic_hk;
567 unsigned char hk_lfr_vhdl_cic_hk;
568 unsigned char hk_lfr_vhdl_iir_cal;
568 unsigned char hk_lfr_vhdl_iir_cal;
569 // spacewire_if_statistics
569 // spacewire_if_statistics
570 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
570 unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2];
571 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
571 unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2];
572 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
572 unsigned char hk_lfr_dpu_spw_tick_out_cnt;
573 unsigned char hk_lfr_dpu_spw_last_timc;
573 unsigned char hk_lfr_dpu_spw_last_timc;
574 // ahb error statistics
574 // ahb error statistics
575 unsigned int hk_lfr_last_fail_addr;
575 unsigned char hk_lfr_last_fail_addr[4];
576 // temperatures
576 // temperatures
577 unsigned char hk_lfr_temp_scm[2];
577 unsigned char hk_lfr_temp_scm[2];
578 unsigned char hk_lfr_temp_pcb[2];
578 unsigned char hk_lfr_temp_pcb[2];
579 unsigned char hk_lfr_temp_fpga[2];
579 unsigned char hk_lfr_temp_fpga[2];
580 // spacecraft potential
580 // spacecraft potential
581 unsigned char hk_lfr_sc_v_f3[2];
581 unsigned char hk_lfr_sc_v_f3[2];
582 unsigned char hk_lfr_sc_e1_f3[2];
582 unsigned char hk_lfr_sc_e1_f3[2];
583 unsigned char hk_lfr_sc_e2_f3[2];
583 unsigned char hk_lfr_sc_e2_f3[2];
584 // error counters
584 // error counters
585 unsigned char hk_lfr_dpu_spw_parity;
585 unsigned char hk_lfr_dpu_spw_parity;
586 unsigned char hk_lfr_dpu_spw_disconnect;
586 unsigned char hk_lfr_dpu_spw_disconnect;
587 unsigned char hk_lfr_dpu_spw_escape;
587 unsigned char hk_lfr_dpu_spw_escape;
588 unsigned char hk_lfr_dpu_spw_credit;
588 unsigned char hk_lfr_dpu_spw_credit;
589 unsigned char hk_lfr_dpu_spw_write_sync;
589 unsigned char hk_lfr_dpu_spw_write_sync;
590 unsigned char hk_lfr_dpu_spw_rx_ahb;
590 unsigned char hk_lfr_dpu_spw_rx_ahb;
591 unsigned char hk_lfr_dpu_spw_tx_ahb;
591 unsigned char hk_lfr_dpu_spw_tx_ahb;
592 unsigned char hk_lfr_dpu_spw_early_eop;
592 unsigned char hk_lfr_dpu_spw_early_eop;
593 unsigned char hk_lfr_dpu_spw_invalid_addr;
593 unsigned char hk_lfr_dpu_spw_invalid_addr;
594 unsigned char hk_lfr_dpu_spw_eep;
594 unsigned char hk_lfr_dpu_spw_eep;
595 unsigned char hk_lfr_dpu_spw_rx_too_big;
595 unsigned char hk_lfr_dpu_spw_rx_too_big;
596 // timecode
596 // timecode
597 unsigned char hk_lfr_timecode_erroneous;
597 unsigned char hk_lfr_timecode_erroneous;
598 unsigned char hk_lfr_timecode_missing;
598 unsigned char hk_lfr_timecode_missing;
599 unsigned char hk_lfr_timecode_invalid;
599 unsigned char hk_lfr_timecode_invalid;
600 // time
600 // time
601 unsigned char hk_lfr_time_timecode_it;
601 unsigned char hk_lfr_time_timecode_it;
602 unsigned char hk_lfr_time_not_synchro;
602 unsigned char hk_lfr_time_not_synchro;
603 unsigned char hk_lfr_time_timecode_ctr;
603 unsigned char hk_lfr_time_timecode_ctr;
604 // hk_lfr_buffer_dpu_
604 // hk_lfr_buffer_dpu_
605 unsigned char hk_lfr_buffer_dpu_tc_fifo;
605 unsigned char hk_lfr_buffer_dpu_tc_fifo;
606 unsigned char hk_lfr_buffer_dpu_tm_fifo;
606 unsigned char hk_lfr_buffer_dpu_tm_fifo;
607 // hk_lfr_ahb_
607 // hk_lfr_ahb_
608 unsigned char hk_lfr_ahb_correctable;
608 unsigned char hk_lfr_ahb_correctable;
609 unsigned char hk_lfr_ahb_uncorrectable;
609 unsigned char hk_lfr_ahb_uncorrectable;
610 // spare
610 // spare
611 unsigned char parameters_spare;
611 unsigned char parameters_spare;
612 } Packet_TM_LFR_HK_t;
612 } Packet_TM_LFR_HK_t;
613
613
614 typedef struct {
614 typedef struct {
615 unsigned char targetLogicalAddress;
615 unsigned char targetLogicalAddress;
616 unsigned char protocolIdentifier;
616 unsigned char protocolIdentifier;
617 unsigned char reserved;
617 unsigned char reserved;
618 unsigned char userApplication;
618 unsigned char userApplication;
619 unsigned char packetID[2];
619 unsigned char packetID[2];
620 unsigned char packetSequenceControl[2];
620 unsigned char packetSequenceControl[2];
621 unsigned char packetLength[2];
621 unsigned char packetLength[2];
622 // DATA FIELD HEADER
622 // DATA FIELD HEADER
623 unsigned char spare1_pusVersion_spare2;
623 unsigned char spare1_pusVersion_spare2;
624 unsigned char serviceType;
624 unsigned char serviceType;
625 unsigned char serviceSubType;
625 unsigned char serviceSubType;
626 unsigned char destinationID;
626 unsigned char destinationID;
627 unsigned char time[6];
627 unsigned char time[6];
628 unsigned char sid;
628 unsigned char sid;
629
629
630 //******************
630 //******************
631 // COMMON PARAMETERS
631 // COMMON PARAMETERS
632 unsigned char unused0;
632 unsigned char unused0;
633 unsigned char bw_sp0_sp1_r0_r1;
633 unsigned char bw_sp0_sp1_r0_r1;
634
634
635 //******************
635 //******************
636 // NORMAL PARAMETERS
636 // NORMAL PARAMETERS
637 unsigned char sy_lfr_n_swf_l[2];
637 unsigned char sy_lfr_n_swf_l[2];
638 unsigned char sy_lfr_n_swf_p[2];
638 unsigned char sy_lfr_n_swf_p[2];
639 unsigned char sy_lfr_n_asm_p[2];
639 unsigned char sy_lfr_n_asm_p[2];
640 unsigned char sy_lfr_n_bp_p0;
640 unsigned char sy_lfr_n_bp_p0;
641 unsigned char sy_lfr_n_bp_p1;
641 unsigned char sy_lfr_n_bp_p1;
642 unsigned char sy_lfr_n_cwf_long_f3;
642 unsigned char sy_lfr_n_cwf_long_f3;
643 unsigned char lfr_normal_parameters_spare;
643 unsigned char lfr_normal_parameters_spare;
644
644
645 //*****************
645 //*****************
646 // BURST PARAMETERS
646 // BURST PARAMETERS
647 unsigned char sy_lfr_b_bp_p0;
647 unsigned char sy_lfr_b_bp_p0;
648 unsigned char sy_lfr_b_bp_p1;
648 unsigned char sy_lfr_b_bp_p1;
649
649
650 //****************
650 //****************
651 // SBM1 PARAMETERS
651 // SBM1 PARAMETERS
652 unsigned char sy_lfr_s1_bp_p0;
652 unsigned char sy_lfr_s1_bp_p0;
653 unsigned char sy_lfr_s1_bp_p1;
653 unsigned char sy_lfr_s1_bp_p1;
654
654
655 //****************
655 //****************
656 // SBM2 PARAMETERS
656 // SBM2 PARAMETERS
657 unsigned char sy_lfr_s2_bp_p0;
657 unsigned char sy_lfr_s2_bp_p0;
658 unsigned char sy_lfr_s2_bp_p1;
658 unsigned char sy_lfr_s2_bp_p1;
659
659
660 // SPARE
660 // SPARE
661 unsigned char source_data_spare;
661 unsigned char source_data_spare;
662 } Packet_TM_LFR_PARAMETER_DUMP_t;
662 } Packet_TM_LFR_PARAMETER_DUMP_t;
663
663
664
664
665 #endif // CCSDS_TYPES_H_INCLUDED
665 #endif // CCSDS_TYPES_H_INCLUDED
@@ -1,43 +1,45
1 #ifndef FSW_MISC_H_INCLUDED
1 #ifndef FSW_MISC_H_INCLUDED
2 #define FSW_MISC_H_INCLUDED
2 #define FSW_MISC_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <stdio.h>
5 #include <stdio.h>
6 #include <grspw.h>
6 #include <grspw.h>
7
7
8 #include "fsw_params.h"
8 #include "fsw_params.h"
9 #include "fsw_spacewire.h"
9 #include "fsw_spacewire.h"
10
10
11 rtems_name name_hk_rate_monotonic; // name of the HK rate monotonic
11 rtems_name name_hk_rate_monotonic; // name of the HK rate monotonic
12 rtems_id HK_id; // id of the HK rate monotonic period
12 rtems_id HK_id; // id of the HK rate monotonic period
13
13
14 //extern rtems_name misc_name[5];
14 //extern rtems_name misc_name[5];
15 //time_management_regs_t *time_management_regs;
15 //time_management_regs_t *time_management_regs;
16 //extern Packet_TM_LFR_HK_t housekeeping_packet;
16 //extern Packet_TM_LFR_HK_t housekeeping_packet;
17
17
18 void configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider,
18 void configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider,
19 unsigned char interrupt_level, rtems_isr (*timer_isr)() );
19 unsigned char interrupt_level, rtems_isr (*timer_isr)() );
20 void timer_start( gptimer_regs_t *gptimer_regs, unsigned char timer );
20 void timer_start( gptimer_regs_t *gptimer_regs, unsigned char timer );
21 void timer_stop( gptimer_regs_t *gptimer_regs, unsigned char timer );
21 void timer_stop( gptimer_regs_t *gptimer_regs, unsigned char timer );
22 void timer_set_clock_divider(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider);
22 void timer_set_clock_divider(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider);
23
23
24 // SERIAL LINK
24 // SERIAL LINK
25 int send_console_outputs_on_apbuart_port( void );
25 int send_console_outputs_on_apbuart_port( void );
26 int enable_apbuart_transmitter( void );
26 int enable_apbuart_transmitter( void );
27 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value);
27 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value);
28
28
29 // RTEMS TASKS
29 // RTEMS TASKS
30 rtems_task stat_task( rtems_task_argument argument );
30 rtems_task stat_task( rtems_task_argument argument );
31 rtems_task hous_task( rtems_task_argument argument );
31 rtems_task hous_task( rtems_task_argument argument );
32 rtems_task dumb_task( rtems_task_argument unused );
32 rtems_task dumb_task( rtems_task_argument unused );
33
33
34 void init_housekeeping_parameters( void );
34 void init_housekeeping_parameters( void );
35 void increment_seq_counter( unsigned char *packet_sequence_control);
35 void increment_seq_counter( unsigned char *packet_sequence_control);
36 void getTime( unsigned char *time);
36 void getTime( unsigned char *time);
37 unsigned long long int getTimeAsUnsignedLongLongInt( );
37 unsigned long long int getTimeAsUnsignedLongLongInt( );
38 void send_dumb_hk( void );
38 void send_dumb_hk( void );
39 void get_v_e1_e2_f3 (unsigned char *v, unsigned char *e1, unsigned char *e2, bool init_buffer_addr );
39 void get_v_e1_e2_f3 (unsigned char *v, unsigned char *e1, unsigned char *e2);
40
40
41 extern int sched_yield( void );
41 extern int sched_yield( void );
42 extern ring_node *current_ring_node_f3;
43 extern ring_node *ring_node_to_send_cwf_f3;
42
44
43 #endif // FSW_MISC_H_INCLUDED
45 #endif // FSW_MISC_H_INCLUDED
@@ -1,95 +1,94
1 #ifndef WF_HANDLER_H_INCLUDED
1 #ifndef WF_HANDLER_H_INCLUDED
2 #define WF_HANDLER_H_INCLUDED
2 #define WF_HANDLER_H_INCLUDED
3
3
4 #include <rtems.h>
4 #include <rtems.h>
5 #include <grspw.h>
5 #include <grspw.h>
6 #include <stdio.h>
6 #include <stdio.h>
7 #include <math.h>
7 #include <math.h>
8
8
9 #include "fsw_params.h"
9 #include "fsw_params.h"
10 #include "fsw_spacewire.h"
10 #include "fsw_spacewire.h"
11 #include "fsw_misc.h"
11 #include "fsw_misc.h"
12 #include "fsw_params_wf_handler.h"
12 #include "fsw_params_wf_handler.h"
13
13
14 #define pi 3.1415
14 #define pi 3.1415
15
15
16 extern int fdSPW;
16 extern int fdSPW;
17
17
18 //*****************
18 //*****************
19 // waveform buffers
19 // waveform buffers
20 extern volatile int wf_snap_f0[ ];
20 extern volatile int wf_snap_f0[ ];
21 extern volatile int wf_snap_f1[ ];
21 extern volatile int wf_snap_f1[ ];
22 extern volatile int wf_snap_f2[ ];
22 extern volatile int wf_snap_f2[ ];
23 extern volatile int wf_cont_f3[ ];
23 extern volatile int wf_cont_f3[ ];
24 extern char wf_cont_f3_light[ ];
24 extern char wf_cont_f3_light[ ];
25
25
26 extern waveform_picker_regs_new_t *waveform_picker_regs;
26 extern waveform_picker_regs_new_t *waveform_picker_regs;
27 extern time_management_regs_t *time_management_regs;
27 extern time_management_regs_t *time_management_regs;
28 extern Packet_TM_LFR_HK_t housekeeping_packet;
28 extern Packet_TM_LFR_HK_t housekeeping_packet;
29 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
29 extern Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet;
30 extern struct param_local_str param_local;
30 extern struct param_local_str param_local;
31
31
32 extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
32 extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST;
33 extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
33 extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2;
34
34
35 extern rtems_id Task_id[20]; /* array of task ids */
35 extern rtems_id Task_id[20]; /* array of task ids */
36
36
37 extern unsigned char lfrCurrentMode;
37 extern unsigned char lfrCurrentMode;
38
38
39 //**********
39 //**********
40 // RTEMS_ISR
40 // RTEMS_ISR
41 void reset_extractSWF( void );
41 void reset_extractSWF( void );
42 rtems_isr waveforms_isr( rtems_vector_number vector );
42 rtems_isr waveforms_isr( rtems_vector_number vector );
43
43
44 //***********
44 //***********
45 // RTEMS_TASK
45 // RTEMS_TASK
46 rtems_task wfrm_task( rtems_task_argument argument );
46 rtems_task wfrm_task( rtems_task_argument argument );
47 rtems_task cwf3_task( rtems_task_argument argument );
47 rtems_task cwf3_task( rtems_task_argument argument );
48 rtems_task cwf2_task( rtems_task_argument argument );
48 rtems_task cwf2_task( rtems_task_argument argument );
49 rtems_task cwf1_task( rtems_task_argument argument );
49 rtems_task cwf1_task( rtems_task_argument argument );
50 rtems_task swbd_task( rtems_task_argument argument );
50 rtems_task swbd_task( rtems_task_argument argument );
51
51
52 //******************
52 //******************
53 // general functions
53 // general functions
54 void init_waveforms( void );
55 void init_waveform_rings( void );
54 void init_waveform_rings( void );
56 void init_waveform_ring( ring_node waveform_ring[], unsigned char nbNodes, volatile int wfrm[] );
55 void init_waveform_ring( ring_node waveform_ring[], unsigned char nbNodes, volatile int wfrm[] );
57 void reset_current_ring_nodes( void );
56 void reset_current_ring_nodes( void );
58 //
57 //
59 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF );
58 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF );
60 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
59 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
61 int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
60 int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF );
62 //
61 //
63 int send_waveform_SWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id );
62 int send_waveform_SWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id );
64 int send_waveform_CWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
63 int send_waveform_CWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
65 int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
64 int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
66 int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
65 int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id );
67 //
66 //
68 void compute_acquisition_time(unsigned int coarseTime, unsigned int fineTime,
67 void compute_acquisition_time(unsigned int coarseTime, unsigned int fineTime,
69 unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char *acquisitionTime );
68 unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char *acquisitionTime );
70 void build_snapshot_from_ring(ring_node *ring_node_to_send , unsigned char frequencyChannel );
69 void build_snapshot_from_ring(ring_node *ring_node_to_send , unsigned char frequencyChannel );
71 void build_acquisition_time( unsigned long long int * acquisitionTimeAslong, ring_node *current_ring_node );
70 void build_acquisition_time( unsigned long long int * acquisitionTimeAslong, ring_node *current_ring_node );
72 //
71 //
73 rtems_id get_pkts_queue_id( void );
72 rtems_id get_pkts_queue_id( void );
74
73
75 //**************
74 //**************
76 // wfp registers
75 // wfp registers
77 // RESET
76 // RESET
78 void reset_wfp_burst_enable( void );
77 void reset_wfp_burst_enable( void );
79 void reset_wfp_status(void);
78 void reset_wfp_status(void);
80 void reset_waveform_picker_regs( void );
79 void reset_waveform_picker_regs( void );
81 // SET
80 // SET
82 void set_wfp_data_shaping(void);
81 void set_wfp_data_shaping(void);
83 void set_wfp_burst_enable_register( unsigned char mode );
82 void set_wfp_burst_enable_register( unsigned char mode );
84 void set_wfp_delta_snapshot( void );
83 void set_wfp_delta_snapshot( void );
85 void set_wfp_delta_f0_f0_2( void );
84 void set_wfp_delta_f0_f0_2( void );
86 void set_wfp_delta_f1( void );
85 void set_wfp_delta_f1( void );
87 void set_wfp_delta_f2( void );
86 void set_wfp_delta_f2( void );
88
87
89 //*****************
88 //*****************
90 // local parameters
89 // local parameters
91 void set_local_nb_interrupt_f0_MAX( void );
90 void set_local_nb_interrupt_f0_MAX( void );
92
91
93 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid );
92 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid );
94
93
95 #endif // WF_HANDLER_H_INCLUDED
94 #endif // WF_HANDLER_H_INCLUDED
@@ -1,503 +1,503
1 /** General usage functions and RTEMS tasks.
1 /** General usage functions and RTEMS tasks.
2 *
2 *
3 * @file
3 * @file
4 * @author P. LEROY
4 * @author P. LEROY
5 *
5 *
6 */
6 */
7
7
8 #include "fsw_misc.h"
8 #include "fsw_misc.h"
9
9
10 void configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider,
10 void configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider,
11 unsigned char interrupt_level, rtems_isr (*timer_isr)() )
11 unsigned char interrupt_level, rtems_isr (*timer_isr)() )
12 {
12 {
13 /** This function configures a GPTIMER timer instantiated in the VHDL design.
13 /** This function configures a GPTIMER timer instantiated in the VHDL design.
14 *
14 *
15 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
15 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
16 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
16 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
17 * @param clock_divider is the divider of the 1 MHz clock that will be configured.
17 * @param clock_divider is the divider of the 1 MHz clock that will be configured.
18 * @param interrupt_level is the interrupt level that the timer drives.
18 * @param interrupt_level is the interrupt level that the timer drives.
19 * @param timer_isr is the interrupt subroutine that will be attached to the IRQ driven by the timer.
19 * @param timer_isr is the interrupt subroutine that will be attached to the IRQ driven by the timer.
20 *
20 *
21 * Interrupt levels are described in the SPARC documentation sparcv8.pdf p.76
21 * Interrupt levels are described in the SPARC documentation sparcv8.pdf p.76
22 *
22 *
23 */
23 */
24
24
25 rtems_status_code status;
25 rtems_status_code status;
26 rtems_isr_entry old_isr_handler;
26 rtems_isr_entry old_isr_handler;
27
27
28 gptimer_regs->timer[timer].ctrl = 0x00; // reset the control register
28 gptimer_regs->timer[timer].ctrl = 0x00; // reset the control register
29
29
30 status = rtems_interrupt_catch( timer_isr, interrupt_level, &old_isr_handler) ; // see sparcv8.pdf p.76 for interrupt levels
30 status = rtems_interrupt_catch( timer_isr, interrupt_level, &old_isr_handler) ; // see sparcv8.pdf p.76 for interrupt levels
31 if (status!=RTEMS_SUCCESSFUL)
31 if (status!=RTEMS_SUCCESSFUL)
32 {
32 {
33 PRINTF("in configure_timer *** ERR rtems_interrupt_catch\n")
33 PRINTF("in configure_timer *** ERR rtems_interrupt_catch\n")
34 }
34 }
35
35
36 timer_set_clock_divider( gptimer_regs, timer, clock_divider);
36 timer_set_clock_divider( gptimer_regs, timer, clock_divider);
37 }
37 }
38
38
39 void timer_start(gptimer_regs_t *gptimer_regs, unsigned char timer)
39 void timer_start(gptimer_regs_t *gptimer_regs, unsigned char timer)
40 {
40 {
41 /** This function starts a GPTIMER timer.
41 /** This function starts a GPTIMER timer.
42 *
42 *
43 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
43 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
44 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
44 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
45 *
45 *
46 */
46 */
47
47
48 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000010; // clear pending IRQ if any
48 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000010; // clear pending IRQ if any
49 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000004; // LD load value from the reload register
49 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000004; // LD load value from the reload register
50 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000001; // EN enable the timer
50 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000001; // EN enable the timer
51 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000002; // RS restart
51 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000002; // RS restart
52 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000008; // IE interrupt enable
52 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000008; // IE interrupt enable
53 }
53 }
54
54
55 void timer_stop(gptimer_regs_t *gptimer_regs, unsigned char timer)
55 void timer_stop(gptimer_regs_t *gptimer_regs, unsigned char timer)
56 {
56 {
57 /** This function stops a GPTIMER timer.
57 /** This function stops a GPTIMER timer.
58 *
58 *
59 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
59 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
60 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
60 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
61 *
61 *
62 */
62 */
63
63
64 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl & 0xfffffffe; // EN enable the timer
64 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl & 0xfffffffe; // EN enable the timer
65 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl & 0xffffffef; // IE interrupt enable
65 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl & 0xffffffef; // IE interrupt enable
66 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000010; // clear pending IRQ if any
66 gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000010; // clear pending IRQ if any
67 }
67 }
68
68
69 void timer_set_clock_divider(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider)
69 void timer_set_clock_divider(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider)
70 {
70 {
71 /** This function sets the clock divider of a GPTIMER timer.
71 /** This function sets the clock divider of a GPTIMER timer.
72 *
72 *
73 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
73 * @param gptimer_regs points to the APB registers of the GPTIMER IP core.
74 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
74 * @param timer is the number of the timer in the IP core (several timers can be instantiated).
75 * @param clock_divider is the divider of the 1 MHz clock that will be configured.
75 * @param clock_divider is the divider of the 1 MHz clock that will be configured.
76 *
76 *
77 */
77 */
78
78
79 gptimer_regs->timer[timer].reload = clock_divider; // base clock frequency is 1 MHz
79 gptimer_regs->timer[timer].reload = clock_divider; // base clock frequency is 1 MHz
80 }
80 }
81
81
82 int send_console_outputs_on_apbuart_port( void ) // Send the console outputs on the apbuart port
82 int send_console_outputs_on_apbuart_port( void ) // Send the console outputs on the apbuart port
83 {
83 {
84 struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) REGS_ADDR_APBUART;
84 struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) REGS_ADDR_APBUART;
85
85
86 apbuart_regs->ctrl = APBUART_CTRL_REG_MASK_TE;
86 apbuart_regs->ctrl = APBUART_CTRL_REG_MASK_TE;
87
87
88 return 0;
88 return 0;
89 }
89 }
90
90
91 int enable_apbuart_transmitter( void ) // set the bit 1, TE Transmitter Enable to 1 in the APBUART control register
91 int enable_apbuart_transmitter( void ) // set the bit 1, TE Transmitter Enable to 1 in the APBUART control register
92 {
92 {
93 struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) REGS_ADDR_APBUART;
93 struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) REGS_ADDR_APBUART;
94
94
95 apbuart_regs->ctrl = apbuart_regs->ctrl | APBUART_CTRL_REG_MASK_TE;
95 apbuart_regs->ctrl = apbuart_regs->ctrl | APBUART_CTRL_REG_MASK_TE;
96
96
97 return 0;
97 return 0;
98 }
98 }
99
99
100 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value)
100 void set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value)
101 {
101 {
102 /** This function sets the scaler reload register of the apbuart module
102 /** This function sets the scaler reload register of the apbuart module
103 *
103 *
104 * @param regs is the address of the apbuart registers in memory
104 * @param regs is the address of the apbuart registers in memory
105 * @param value is the value that will be stored in the scaler register
105 * @param value is the value that will be stored in the scaler register
106 *
106 *
107 * The value shall be set by the software to get data on the serial interface.
107 * The value shall be set by the software to get data on the serial interface.
108 *
108 *
109 */
109 */
110
110
111 struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) regs;
111 struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) regs;
112
112
113 apbuart_regs->scaler = value;
113 apbuart_regs->scaler = value;
114 BOOT_PRINTF1("OK *** apbuart port scaler reload register set to 0x%x\n", value)
114 BOOT_PRINTF1("OK *** apbuart port scaler reload register set to 0x%x\n", value)
115 }
115 }
116
116
117 //************
117 //************
118 // RTEMS TASKS
118 // RTEMS TASKS
119
119
120 rtems_task stat_task(rtems_task_argument argument)
120 rtems_task stat_task(rtems_task_argument argument)
121 {
121 {
122 int i;
122 int i;
123 int j;
123 int j;
124 i = 0;
124 i = 0;
125 j = 0;
125 j = 0;
126 BOOT_PRINTF("in STAT *** \n")
126 BOOT_PRINTF("in STAT *** \n")
127 while(1){
127 while(1){
128 rtems_task_wake_after(1000);
128 rtems_task_wake_after(1000);
129 PRINTF1("%d\n", j)
129 PRINTF1("%d\n", j)
130 if (i == CPU_USAGE_REPORT_PERIOD) {
130 if (i == CPU_USAGE_REPORT_PERIOD) {
131 // #ifdef PRINT_TASK_STATISTICS
131 // #ifdef PRINT_TASK_STATISTICS
132 // rtems_cpu_usage_report();
132 // rtems_cpu_usage_report();
133 // rtems_cpu_usage_reset();
133 // rtems_cpu_usage_reset();
134 // #endif
134 // #endif
135 i = 0;
135 i = 0;
136 }
136 }
137 else i++;
137 else i++;
138 j++;
138 j++;
139 }
139 }
140 }
140 }
141
141
142 rtems_task hous_task(rtems_task_argument argument)
142 rtems_task hous_task(rtems_task_argument argument)
143 {
143 {
144 rtems_status_code status;
144 rtems_status_code status;
145 rtems_id queue_id;
145 rtems_id queue_id;
146 rtems_rate_monotonic_period_status period_status;
146 rtems_rate_monotonic_period_status period_status;
147
147
148 status = get_message_queue_id_send( &queue_id );
148 status = get_message_queue_id_send( &queue_id );
149 if (status != RTEMS_SUCCESSFUL)
149 if (status != RTEMS_SUCCESSFUL)
150 {
150 {
151 PRINTF1("in HOUS *** ERR get_message_queue_id_send %d\n", status)
151 PRINTF1("in HOUS *** ERR get_message_queue_id_send %d\n", status)
152 }
152 }
153
153
154 BOOT_PRINTF("in HOUS ***\n")
154 BOOT_PRINTF("in HOUS ***\n")
155
155
156 if (rtems_rate_monotonic_ident( name_hk_rate_monotonic, &HK_id) != RTEMS_SUCCESSFUL) {
156 if (rtems_rate_monotonic_ident( name_hk_rate_monotonic, &HK_id) != RTEMS_SUCCESSFUL) {
157 status = rtems_rate_monotonic_create( name_hk_rate_monotonic, &HK_id );
157 status = rtems_rate_monotonic_create( name_hk_rate_monotonic, &HK_id );
158 if( status != RTEMS_SUCCESSFUL ) {
158 if( status != RTEMS_SUCCESSFUL ) {
159 PRINTF1( "rtems_rate_monotonic_create failed with status of %d\n", status )
159 PRINTF1( "rtems_rate_monotonic_create failed with status of %d\n", status )
160 }
160 }
161 }
161 }
162
162
163 housekeeping_packet.targetLogicalAddress = CCSDS_DESTINATION_ID;
163 housekeeping_packet.targetLogicalAddress = CCSDS_DESTINATION_ID;
164 housekeeping_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID;
164 housekeeping_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID;
165 housekeeping_packet.reserved = DEFAULT_RESERVED;
165 housekeeping_packet.reserved = DEFAULT_RESERVED;
166 housekeeping_packet.userApplication = CCSDS_USER_APP;
166 housekeeping_packet.userApplication = CCSDS_USER_APP;
167 housekeeping_packet.packetID[0] = (unsigned char) (APID_TM_HK >> 8);
167 housekeeping_packet.packetID[0] = (unsigned char) (APID_TM_HK >> 8);
168 housekeeping_packet.packetID[1] = (unsigned char) (APID_TM_HK);
168 housekeeping_packet.packetID[1] = (unsigned char) (APID_TM_HK);
169 housekeeping_packet.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
169 housekeeping_packet.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
170 housekeeping_packet.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
170 housekeeping_packet.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
171 housekeeping_packet.packetLength[0] = (unsigned char) (PACKET_LENGTH_HK >> 8);
171 housekeeping_packet.packetLength[0] = (unsigned char) (PACKET_LENGTH_HK >> 8);
172 housekeeping_packet.packetLength[1] = (unsigned char) (PACKET_LENGTH_HK );
172 housekeeping_packet.packetLength[1] = (unsigned char) (PACKET_LENGTH_HK );
173 housekeeping_packet.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
173 housekeeping_packet.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
174 housekeeping_packet.serviceType = TM_TYPE_HK;
174 housekeeping_packet.serviceType = TM_TYPE_HK;
175 housekeeping_packet.serviceSubType = TM_SUBTYPE_HK;
175 housekeeping_packet.serviceSubType = TM_SUBTYPE_HK;
176 housekeeping_packet.destinationID = TM_DESTINATION_ID_GROUND;
176 housekeeping_packet.destinationID = TM_DESTINATION_ID_GROUND;
177 housekeeping_packet.sid = SID_HK;
177 housekeeping_packet.sid = SID_HK;
178
178
179 status = rtems_rate_monotonic_cancel(HK_id);
179 status = rtems_rate_monotonic_cancel(HK_id);
180 if( status != RTEMS_SUCCESSFUL ) {
180 if( status != RTEMS_SUCCESSFUL ) {
181 PRINTF1( "ERR *** in HOUS *** rtems_rate_monotonic_cancel(HK_id) ***code: %d\n", status )
181 PRINTF1( "ERR *** in HOUS *** rtems_rate_monotonic_cancel(HK_id) ***code: %d\n", status )
182 }
182 }
183 else {
183 else {
184 DEBUG_PRINTF("OK *** in HOUS *** rtems_rate_monotonic_cancel(HK_id)\n")
184 DEBUG_PRINTF("OK *** in HOUS *** rtems_rate_monotonic_cancel(HK_id)\n")
185 }
185 }
186
186
187 // startup phase
187 // startup phase
188 status = rtems_rate_monotonic_period( HK_id, SY_LFR_TIME_SYN_TIMEOUT_in_ticks );
188 status = rtems_rate_monotonic_period( HK_id, SY_LFR_TIME_SYN_TIMEOUT_in_ticks );
189 status = rtems_rate_monotonic_get_status( HK_id, &period_status );
189 status = rtems_rate_monotonic_get_status( HK_id, &period_status );
190 DEBUG_PRINTF1("startup HK, HK_id status = %d\n", period_status.state)
190 DEBUG_PRINTF1("startup HK, HK_id status = %d\n", period_status.state)
191 while(period_status.state != RATE_MONOTONIC_EXPIRED ) // after SY_LFR_TIME_SYN_TIMEOUT ms, starts HK anyway
191 while(period_status.state != RATE_MONOTONIC_EXPIRED ) // after SY_LFR_TIME_SYN_TIMEOUT ms, starts HK anyway
192 {
192 {
193 if ((time_management_regs->coarse_time & 0x80000000) == 0x00000000) // check time synchronization
193 if ((time_management_regs->coarse_time & 0x80000000) == 0x00000000) // check time synchronization
194 {
194 {
195 break; // break if LFR is synchronized
195 break; // break if LFR is synchronized
196 }
196 }
197 else
197 else
198 {
198 {
199 status = rtems_rate_monotonic_get_status( HK_id, &period_status );
199 status = rtems_rate_monotonic_get_status( HK_id, &period_status );
200 // sched_yield();
200 // sched_yield();
201 status = rtems_task_wake_after( 10 ); // wait SY_LFR_DPU_CONNECT_TIMEOUT 100 ms = 10 * 10 ms
201 status = rtems_task_wake_after( 10 ); // wait SY_LFR_DPU_CONNECT_TIMEOUT 100 ms = 10 * 10 ms
202 }
202 }
203 }
203 }
204 status = rtems_rate_monotonic_cancel(HK_id);
204 status = rtems_rate_monotonic_cancel(HK_id);
205 DEBUG_PRINTF1("startup HK, HK_id status = %d\n", period_status.state)
205 DEBUG_PRINTF1("startup HK, HK_id status = %d\n", period_status.state)
206
206
207 while(1){ // launch the rate monotonic task
207 while(1){ // launch the rate monotonic task
208 status = rtems_rate_monotonic_period( HK_id, HK_PERIOD );
208 status = rtems_rate_monotonic_period( HK_id, HK_PERIOD );
209 if ( status != RTEMS_SUCCESSFUL ) {
209 if ( status != RTEMS_SUCCESSFUL ) {
210 PRINTF1( "in HOUS *** ERR period: %d\n", status);
210 PRINTF1( "in HOUS *** ERR period: %d\n", status);
211 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_6 );
211 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_6 );
212 }
212 }
213 else {
213 else {
214 increment_seq_counter( housekeeping_packet.packetSequenceControl );
214 increment_seq_counter( housekeeping_packet.packetSequenceControl );
215 housekeeping_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
215 housekeeping_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
216 housekeeping_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
216 housekeeping_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
217 housekeeping_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
217 housekeeping_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
218 housekeeping_packet.time[3] = (unsigned char) (time_management_regs->coarse_time);
218 housekeeping_packet.time[3] = (unsigned char) (time_management_regs->coarse_time);
219 housekeeping_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
219 housekeeping_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
220 housekeeping_packet.time[5] = (unsigned char) (time_management_regs->fine_time);
220 housekeeping_packet.time[5] = (unsigned char) (time_management_regs->fine_time);
221
221
222 spacewire_update_statistics();
222 spacewire_update_statistics();
223
223
224 get_v_e1_e2_f3(
224 get_v_e1_e2_f3(
225 housekeeping_packet.hk_lfr_sc_v_f3, housekeeping_packet.hk_lfr_sc_e1_f3, housekeeping_packet.hk_lfr_sc_e2_f3,
225 housekeeping_packet.hk_lfr_sc_v_f3, housekeeping_packet.hk_lfr_sc_e1_f3, housekeeping_packet.hk_lfr_sc_e2_f3 );
226 false );
227
226
228 // SEND PACKET
227 // SEND PACKET
229 status = rtems_message_queue_urgent( queue_id, &housekeeping_packet,
228 status = rtems_message_queue_urgent( queue_id, &housekeeping_packet,
230 PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
229 PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
231 if (status != RTEMS_SUCCESSFUL) {
230 if (status != RTEMS_SUCCESSFUL) {
232 PRINTF1("in HOUS *** ERR send: %d\n", status)
231 PRINTF1("in HOUS *** ERR send: %d\n", status)
233 }
232 }
234 }
233 }
235 }
234 }
236
235
237 PRINTF("in HOUS *** deleting task\n")
236 PRINTF("in HOUS *** deleting task\n")
238
237
239 status = rtems_task_delete( RTEMS_SELF ); // should not return
238 status = rtems_task_delete( RTEMS_SELF ); // should not return
240 printf( "rtems_task_delete returned with status of %d.\n", status );
239 printf( "rtems_task_delete returned with status of %d.\n", status );
241 return;
240 return;
242 }
241 }
243
242
244 rtems_task dumb_task( rtems_task_argument unused )
243 rtems_task dumb_task( rtems_task_argument unused )
245 {
244 {
246 /** This RTEMS taks is used to print messages without affecting the general behaviour of the software.
245 /** This RTEMS taks is used to print messages without affecting the general behaviour of the software.
247 *
246 *
248 * @param unused is the starting argument of the RTEMS task
247 * @param unused is the starting argument of the RTEMS task
249 *
248 *
250 * The DUMB taks waits for RTEMS events and print messages depending on the incoming events.
249 * The DUMB taks waits for RTEMS events and print messages depending on the incoming events.
251 *
250 *
252 */
251 */
253
252
254 unsigned int i;
253 unsigned int i;
255 unsigned int intEventOut;
254 unsigned int intEventOut;
256 unsigned int coarse_time = 0;
255 unsigned int coarse_time = 0;
257 unsigned int fine_time = 0;
256 unsigned int fine_time = 0;
258 rtems_event_set event_out;
257 rtems_event_set event_out;
259
258
260 char *DumbMessages[10] = {"in DUMB *** default", // RTEMS_EVENT_0
259 char *DumbMessages[10] = {"in DUMB *** default", // RTEMS_EVENT_0
261 "in DUMB *** timecode_irq_handler", // RTEMS_EVENT_1
260 "in DUMB *** timecode_irq_handler", // RTEMS_EVENT_1
262 "in DUMB *** f3 buffer changed", // RTEMS_EVENT_2
261 "in DUMB *** f3 buffer changed", // RTEMS_EVENT_2
263 "in DUMB *** in SMIQ *** Error sending event to AVF0", // RTEMS_EVENT_3
262 "in DUMB *** in SMIQ *** Error sending event to AVF0", // RTEMS_EVENT_3
264 "in DUMB *** spectral_matrices_isr *** Error sending event to SMIQ", // RTEMS_EVENT_4
263 "in DUMB *** spectral_matrices_isr *** Error sending event to SMIQ", // RTEMS_EVENT_4
265 "in DUMB *** waveforms_simulator_isr", // RTEMS_EVENT_5
264 "in DUMB *** waveforms_simulator_isr", // RTEMS_EVENT_5
266 "ERR HK", // RTEMS_EVENT_6
265 "ERR HK", // RTEMS_EVENT_6
267 "ready for dump", // RTEMS_EVENT_7
266 "ready for dump", // RTEMS_EVENT_7
268 "in DUMB *** spectral_matrices_isr", // RTEMS_EVENT_8
267 "in DUMB *** spectral_matrices_isr", // RTEMS_EVENT_8
269 "tick" // RTEMS_EVENT_9
268 "tick" // RTEMS_EVENT_9
270 };
269 };
271
270
272 BOOT_PRINTF("in DUMB *** \n")
271 BOOT_PRINTF("in DUMB *** \n")
273
272
274 while(1){
273 while(1){
275 rtems_event_receive(RTEMS_EVENT_0 | RTEMS_EVENT_1 | RTEMS_EVENT_2 | RTEMS_EVENT_3
274 rtems_event_receive(RTEMS_EVENT_0 | RTEMS_EVENT_1 | RTEMS_EVENT_2 | RTEMS_EVENT_3
276 | RTEMS_EVENT_4 | RTEMS_EVENT_5 | RTEMS_EVENT_6 | RTEMS_EVENT_7
275 | RTEMS_EVENT_4 | RTEMS_EVENT_5 | RTEMS_EVENT_6 | RTEMS_EVENT_7
277 | RTEMS_EVENT_8 | RTEMS_EVENT_9,
276 | RTEMS_EVENT_8 | RTEMS_EVENT_9,
278 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT
277 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT
279 intEventOut = (unsigned int) event_out;
278 intEventOut = (unsigned int) event_out;
280 for ( i=0; i<32; i++)
279 for ( i=0; i<32; i++)
281 {
280 {
282 if ( ((intEventOut >> i) & 0x0001) != 0)
281 if ( ((intEventOut >> i) & 0x0001) != 0)
283 {
282 {
284 coarse_time = time_management_regs->coarse_time;
283 coarse_time = time_management_regs->coarse_time;
285 fine_time = time_management_regs->fine_time;
284 fine_time = time_management_regs->fine_time;
286 printf("in DUMB *** coarse: %x, fine: %x, %s\n", coarse_time, fine_time, DumbMessages[i]);
285 printf("in DUMB *** coarse: %x, fine: %x, %s\n", coarse_time, fine_time, DumbMessages[i]);
287 }
286 }
288 }
287 }
289 }
288 }
290 }
289 }
291
290
292 //*****************************
291 //*****************************
293 // init housekeeping parameters
292 // init housekeeping parameters
294
293
295 void init_housekeeping_parameters( void )
294 void init_housekeeping_parameters( void )
296 {
295 {
297 /** This function initialize the housekeeping_packet global variable with default values.
296 /** This function initialize the housekeeping_packet global variable with default values.
298 *
297 *
299 */
298 */
300
299
301 unsigned int i = 0;
300 unsigned int i = 0;
302 unsigned char *parameters;
301 unsigned char *parameters;
303
302
304 parameters = (unsigned char*) &housekeeping_packet.lfr_status_word;
303 parameters = (unsigned char*) &housekeeping_packet.lfr_status_word;
305 for(i = 0; i< SIZE_HK_PARAMETERS; i++)
304 for(i = 0; i< SIZE_HK_PARAMETERS; i++)
306 {
305 {
307 parameters[i] = 0x00;
306 parameters[i] = 0x00;
308 }
307 }
309 // init status word
308 // init status word
310 housekeeping_packet.lfr_status_word[0] = DEFAULT_STATUS_WORD_BYTE0;
309 housekeeping_packet.lfr_status_word[0] = DEFAULT_STATUS_WORD_BYTE0;
311 housekeeping_packet.lfr_status_word[1] = DEFAULT_STATUS_WORD_BYTE1;
310 housekeeping_packet.lfr_status_word[1] = DEFAULT_STATUS_WORD_BYTE1;
312 // init software version
311 // init software version
313 housekeeping_packet.lfr_sw_version[0] = SW_VERSION_N1;
312 housekeeping_packet.lfr_sw_version[0] = SW_VERSION_N1;
314 housekeeping_packet.lfr_sw_version[1] = SW_VERSION_N2;
313 housekeeping_packet.lfr_sw_version[1] = SW_VERSION_N2;
315 housekeeping_packet.lfr_sw_version[2] = SW_VERSION_N3;
314 housekeeping_packet.lfr_sw_version[2] = SW_VERSION_N3;
316 housekeeping_packet.lfr_sw_version[3] = SW_VERSION_N4;
315 housekeeping_packet.lfr_sw_version[3] = SW_VERSION_N4;
317 // init fpga version
316 // init fpga version
318 parameters = (unsigned char *) (REGS_ADDR_WAVEFORM_PICKER + 0xb0);
317 parameters = (unsigned char *) (REGS_ADDR_WAVEFORM_PICKER + 0xb0);
319 housekeeping_packet.lfr_fpga_version[0] = parameters[1]; // n1
318 housekeeping_packet.lfr_fpga_version[0] = parameters[1]; // n1
320 housekeeping_packet.lfr_fpga_version[1] = parameters[2]; // n2
319 housekeeping_packet.lfr_fpga_version[1] = parameters[2]; // n2
321 housekeeping_packet.lfr_fpga_version[2] = parameters[3]; // n3
320 housekeeping_packet.lfr_fpga_version[2] = parameters[3]; // n3
322 }
321 }
323
322
324 void increment_seq_counter( unsigned char *packet_sequence_control)
323 void increment_seq_counter( unsigned char *packet_sequence_control)
325 {
324 {
326 /** This function increment the sequence counter psased in argument.
325 /** This function increment the sequence counter psased in argument.
327 *
326 *
328 * The increment does not affect the grouping flag. In case of an overflow, the counter is reset to 0.
327 * The increment does not affect the grouping flag. In case of an overflow, the counter is reset to 0.
329 *
328 *
330 */
329 */
331
330
332 unsigned short sequence_cnt;
331 unsigned short sequence_cnt;
333 unsigned short segmentation_grouping_flag;
332 unsigned short segmentation_grouping_flag;
334 unsigned short new_packet_sequence_control;
333 unsigned short new_packet_sequence_control;
335
334
336 segmentation_grouping_flag = TM_PACKET_SEQ_CTRL_STANDALONE << 8; // keep bits 7 downto 6
335 segmentation_grouping_flag = TM_PACKET_SEQ_CTRL_STANDALONE << 8; // keep bits 7 downto 6
337 sequence_cnt = (unsigned short) (
336 sequence_cnt = (unsigned short) (
338 ( (packet_sequence_control[0] & 0x3f) << 8 ) // keep bits 5 downto 0
337 ( (packet_sequence_control[0] & 0x3f) << 8 ) // keep bits 5 downto 0
339 + packet_sequence_control[1]
338 + packet_sequence_control[1]
340 );
339 );
341
340
342 if ( sequence_cnt < SEQ_CNT_MAX)
341 if ( sequence_cnt < SEQ_CNT_MAX)
343 {
342 {
344 sequence_cnt = sequence_cnt + 1;
343 sequence_cnt = sequence_cnt + 1;
345 }
344 }
346 else
345 else
347 {
346 {
348 sequence_cnt = 0;
347 sequence_cnt = 0;
349 }
348 }
350
349
351 new_packet_sequence_control = segmentation_grouping_flag | sequence_cnt ;
350 new_packet_sequence_control = segmentation_grouping_flag | sequence_cnt ;
352
351
353 packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8);
352 packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8);
354 packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control );
353 packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control );
355 }
354 }
356
355
357 void getTime( unsigned char *time)
356 void getTime( unsigned char *time)
358 {
357 {
359 /** This function write the current local time in the time buffer passed in argument.
358 /** This function write the current local time in the time buffer passed in argument.
360 *
359 *
361 */
360 */
362
361
363 time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
362 time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
364 time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
363 time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
365 time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
364 time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
366 time[3] = (unsigned char) (time_management_regs->coarse_time);
365 time[3] = (unsigned char) (time_management_regs->coarse_time);
367 time[4] = (unsigned char) (time_management_regs->fine_time>>8);
366 time[4] = (unsigned char) (time_management_regs->fine_time>>8);
368 time[5] = (unsigned char) (time_management_regs->fine_time);
367 time[5] = (unsigned char) (time_management_regs->fine_time);
369 }
368 }
370
369
371 unsigned long long int getTimeAsUnsignedLongLongInt( )
370 unsigned long long int getTimeAsUnsignedLongLongInt( )
372 {
371 {
373 /** This function write the current local time in the time buffer passed in argument.
372 /** This function write the current local time in the time buffer passed in argument.
374 *
373 *
375 */
374 */
376 unsigned long long int time;
375 unsigned long long int time;
377
376
378 time = ( (unsigned long long int) (time_management_regs->coarse_time & 0x7fffffff) << 16 )
377 time = ( (unsigned long long int) (time_management_regs->coarse_time & 0x7fffffff) << 16 )
379 + time_management_regs->fine_time;
378 + time_management_regs->fine_time;
380
379
381 return time;
380 return time;
382 }
381 }
383
382
384 void send_dumb_hk( void )
383 void send_dumb_hk( void )
385 {
384 {
386 Packet_TM_LFR_HK_t dummy_hk_packet;
385 Packet_TM_LFR_HK_t dummy_hk_packet;
387 unsigned char *parameters;
386 unsigned char *parameters;
388 unsigned int i;
387 unsigned int i;
389 rtems_id queue_id;
388 rtems_id queue_id;
390
389
391 dummy_hk_packet.targetLogicalAddress = CCSDS_DESTINATION_ID;
390 dummy_hk_packet.targetLogicalAddress = CCSDS_DESTINATION_ID;
392 dummy_hk_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID;
391 dummy_hk_packet.protocolIdentifier = CCSDS_PROTOCOLE_ID;
393 dummy_hk_packet.reserved = DEFAULT_RESERVED;
392 dummy_hk_packet.reserved = DEFAULT_RESERVED;
394 dummy_hk_packet.userApplication = CCSDS_USER_APP;
393 dummy_hk_packet.userApplication = CCSDS_USER_APP;
395 dummy_hk_packet.packetID[0] = (unsigned char) (APID_TM_HK >> 8);
394 dummy_hk_packet.packetID[0] = (unsigned char) (APID_TM_HK >> 8);
396 dummy_hk_packet.packetID[1] = (unsigned char) (APID_TM_HK);
395 dummy_hk_packet.packetID[1] = (unsigned char) (APID_TM_HK);
397 dummy_hk_packet.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
396 dummy_hk_packet.packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
398 dummy_hk_packet.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
397 dummy_hk_packet.packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
399 dummy_hk_packet.packetLength[0] = (unsigned char) (PACKET_LENGTH_HK >> 8);
398 dummy_hk_packet.packetLength[0] = (unsigned char) (PACKET_LENGTH_HK >> 8);
400 dummy_hk_packet.packetLength[1] = (unsigned char) (PACKET_LENGTH_HK );
399 dummy_hk_packet.packetLength[1] = (unsigned char) (PACKET_LENGTH_HK );
401 dummy_hk_packet.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
400 dummy_hk_packet.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
402 dummy_hk_packet.serviceType = TM_TYPE_HK;
401 dummy_hk_packet.serviceType = TM_TYPE_HK;
403 dummy_hk_packet.serviceSubType = TM_SUBTYPE_HK;
402 dummy_hk_packet.serviceSubType = TM_SUBTYPE_HK;
404 dummy_hk_packet.destinationID = TM_DESTINATION_ID_GROUND;
403 dummy_hk_packet.destinationID = TM_DESTINATION_ID_GROUND;
405 dummy_hk_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
404 dummy_hk_packet.time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
406 dummy_hk_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
405 dummy_hk_packet.time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
407 dummy_hk_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
406 dummy_hk_packet.time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
408 dummy_hk_packet.time[3] = (unsigned char) (time_management_regs->coarse_time);
407 dummy_hk_packet.time[3] = (unsigned char) (time_management_regs->coarse_time);
409 dummy_hk_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
408 dummy_hk_packet.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
410 dummy_hk_packet.time[5] = (unsigned char) (time_management_regs->fine_time);
409 dummy_hk_packet.time[5] = (unsigned char) (time_management_regs->fine_time);
411 dummy_hk_packet.sid = SID_HK;
410 dummy_hk_packet.sid = SID_HK;
412
411
413 // init status word
412 // init status word
414 dummy_hk_packet.lfr_status_word[0] = 0xff;
413 dummy_hk_packet.lfr_status_word[0] = 0xff;
415 dummy_hk_packet.lfr_status_word[1] = 0xff;
414 dummy_hk_packet.lfr_status_word[1] = 0xff;
416 // init software version
415 // init software version
417 dummy_hk_packet.lfr_sw_version[0] = SW_VERSION_N1;
416 dummy_hk_packet.lfr_sw_version[0] = SW_VERSION_N1;
418 dummy_hk_packet.lfr_sw_version[1] = SW_VERSION_N2;
417 dummy_hk_packet.lfr_sw_version[1] = SW_VERSION_N2;
419 dummy_hk_packet.lfr_sw_version[2] = SW_VERSION_N3;
418 dummy_hk_packet.lfr_sw_version[2] = SW_VERSION_N3;
420 dummy_hk_packet.lfr_sw_version[3] = SW_VERSION_N4;
419 dummy_hk_packet.lfr_sw_version[3] = SW_VERSION_N4;
421 // init fpga version
420 // init fpga version
422 parameters = (unsigned char *) (REGS_ADDR_WAVEFORM_PICKER + 0xb0);
421 parameters = (unsigned char *) (REGS_ADDR_WAVEFORM_PICKER + 0xb0);
423 dummy_hk_packet.lfr_fpga_version[0] = parameters[1]; // n1
422 dummy_hk_packet.lfr_fpga_version[0] = parameters[1]; // n1
424 dummy_hk_packet.lfr_fpga_version[1] = parameters[2]; // n2
423 dummy_hk_packet.lfr_fpga_version[1] = parameters[2]; // n2
425 dummy_hk_packet.lfr_fpga_version[2] = parameters[3]; // n3
424 dummy_hk_packet.lfr_fpga_version[2] = parameters[3]; // n3
426
425
427 parameters = (unsigned char *) &dummy_hk_packet.hk_lfr_cpu_load;
426 parameters = (unsigned char *) &dummy_hk_packet.hk_lfr_cpu_load;
428
427
429 for (i=0; i<100; i++)
428 for (i=0; i<100; i++)
430 {
429 {
431 parameters[i] = 0xff;
430 parameters[i] = 0xff;
432 }
431 }
433
432
434 get_message_queue_id_send( &queue_id );
433 get_message_queue_id_send( &queue_id );
435
434
436 rtems_message_queue_urgent( queue_id, &dummy_hk_packet,
435 rtems_message_queue_urgent( queue_id, &dummy_hk_packet,
437 PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
436 PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES);
438 }
437 }
439
438
440 void get_v_e1_e2_f3( unsigned char *v, unsigned char *e1, unsigned char *e2, bool init_buffer_addr )
439 void get_v_e1_e2_f3( unsigned char *v, unsigned char *e1, unsigned char *e2 )
441 {
440 {
442 unsigned int coarseTime;
441 unsigned int coarseTime;
443 unsigned int acquisitionTime;
442 unsigned int acquisitionTime;
444 unsigned int deltaT = 0;
443 unsigned int deltaT = 0;
445 unsigned char *bufferPtr;
444 unsigned char *bufferPtr;
446
445
447 unsigned int offset_in_samples;
446 unsigned int offset_in_samples;
448 unsigned int offset_in_bytes;
447 unsigned int offset_in_bytes;
449 unsigned char f3 = 16; // v, e1 and e2 will be picked up each second, f3 = 16 Hz
448 unsigned char f3 = 16; // v, e1 and e2 will be picked up each second, f3 = 16 Hz
450
449
451 if (lfrCurrentMode == LFR_MODE_STANDBY)
450 if (lfrCurrentMode == LFR_MODE_STANDBY)
452 {
451 {
453 v[0] = 0x00;
452 v[0] = 0x00;
454 v[1] = 0x00;
453 v[1] = 0x00;
455 e1[0] = 0x00;
454 e1[0] = 0x00;
456 e1[1] = 0x00;
455 e1[1] = 0x00;
457 e2[0] = 0x00;
456 e2[0] = 0x00;
458 e2[1] = 0x00;
457 e2[1] = 0x00;
459 }
458 }
460 else
459 else
461 {
460 {
462 coarseTime = time_management_regs->coarse_time & 0x7fffffff;
461 coarseTime = time_management_regs->coarse_time & 0x7fffffff;
463 bufferPtr = (unsigned char*) waveform_picker_regs->addr_data_f3;
462 bufferPtr = (unsigned char*) current_ring_node_f3->buffer_address;
464 acquisitionTime = (unsigned int) ( ( bufferPtr[2] & 0x7f ) << 24 )
463 acquisitionTime = (unsigned int) ( ( bufferPtr[2] & 0x7f ) << 24 )
465 + (unsigned int) ( bufferPtr[3] << 16 )
464 + (unsigned int) ( bufferPtr[3] << 16 )
466 + (unsigned int) ( bufferPtr[0] << 8 )
465 + (unsigned int) ( bufferPtr[0] << 8 )
467 + (unsigned int) ( bufferPtr[1] );
466 + (unsigned int) ( bufferPtr[1] );
468 if ( coarseTime > acquisitionTime )
467 if ( coarseTime > acquisitionTime )
469 {
468 {
470 deltaT = coarseTime - acquisitionTime;
469 deltaT = coarseTime - acquisitionTime;
471 offset_in_samples = (deltaT-1) * f3 ;
470 offset_in_samples = (deltaT-1) * f3 ;
472 }
471 }
473 else if( coarseTime == acquisitionTime )
472 else if( coarseTime == acquisitionTime )
474 {
473 {
475 offset_in_samples = 0;
474 bufferPtr = (unsigned char*) current_ring_node_f3->previous->buffer_address; // pick up v e1 and e2 in the previous f3 buffer
475 offset_in_samples = NB_SAMPLES_PER_SNAPSHOT-1;
476 }
476 }
477 else
477 else
478 {
478 {
479 offset_in_samples = 0;
479 offset_in_samples = 0;
480 PRINTF2("ERR *** in get_v_e1_e2_f3 *** coarseTime = %x, acquisitionTime = %x\n", coarseTime, acquisitionTime)
480 PRINTF2("ERR *** in get_v_e1_e2_f3 *** coarseTime = %x, acquisitionTime = %x\n", coarseTime, acquisitionTime)
481 }
481 }
482
482
483 if ( offset_in_samples > (NB_SAMPLES_PER_SNAPSHOT - 1) )
483 if ( offset_in_samples > (NB_SAMPLES_PER_SNAPSHOT - 1) )
484 {
484 {
485 PRINTF1("ERR *** in get_v_e1_e2_f3 *** trying to read out the buffer, counter = %d\n", offset_in_samples)
485 PRINTF1("ERR *** in get_v_e1_e2_f3 *** trying to read out of the buffer, counter = %d\n", offset_in_samples)
486 offset_in_samples = NB_SAMPLES_PER_SNAPSHOT -1;
486 offset_in_samples = NB_SAMPLES_PER_SNAPSHOT -1;
487 }
487 }
488 PRINTF1("f3 data @ %x *** ", waveform_picker_regs->addr_data_f3 )
488 PRINTF1("f3 data @ %x *** ", waveform_picker_regs->addr_data_f3 )
489 PRINTF2("deltaT = %d, offset_in_samples = %d\n", deltaT, offset_in_samples )
489 PRINTF2("deltaT = %d, offset_in_samples = %d\n", deltaT, offset_in_samples )
490 offset_in_bytes = TIME_OFFSET_IN_BYTES + offset_in_samples * NB_WORDS_SWF_BLK * 4;
490 offset_in_bytes = TIME_OFFSET_IN_BYTES + offset_in_samples * NB_WORDS_SWF_BLK * 4;
491 v[0] = bufferPtr[ offset_in_bytes + 0];
491 v[0] = bufferPtr[ offset_in_bytes + 0];
492 v[1] = bufferPtr[ offset_in_bytes + 1];
492 v[1] = bufferPtr[ offset_in_bytes + 1];
493 e1[0] = bufferPtr[ offset_in_bytes + 2];
493 e1[0] = bufferPtr[ offset_in_bytes + 2];
494 e1[1] = bufferPtr[ offset_in_bytes + 3];
494 e1[1] = bufferPtr[ offset_in_bytes + 3];
495 e2[0] = bufferPtr[ offset_in_bytes + 4];
495 e2[0] = bufferPtr[ offset_in_bytes + 4];
496 e2[1] = bufferPtr[ offset_in_bytes + 5];
496 e2[1] = bufferPtr[ offset_in_bytes + 5];
497 }
497 }
498 }
498 }
499
499
500
500
501
501
502
502
503
503
@@ -1,1315 +1,1282
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 waveform_ring_f3[NB_RING_NODES_F3];
30 ring_node waveform_ring_f3[NB_RING_NODES_F3];
31 ring_node *current_ring_node_f0;
31 ring_node *current_ring_node_f0;
32 ring_node *ring_node_to_send_swf_f0;
32 ring_node *ring_node_to_send_swf_f0;
33 ring_node *current_ring_node_f1;
33 ring_node *current_ring_node_f1;
34 ring_node *ring_node_to_send_swf_f1;
34 ring_node *ring_node_to_send_swf_f1;
35 ring_node *ring_node_to_send_cwf_f1;
35 ring_node *ring_node_to_send_cwf_f1;
36 ring_node *current_ring_node_f2;
36 ring_node *current_ring_node_f2;
37 ring_node *ring_node_to_send_swf_f2;
37 ring_node *ring_node_to_send_swf_f2;
38 ring_node *ring_node_to_send_cwf_f2;
38 ring_node *ring_node_to_send_cwf_f2;
39 ring_node *current_ring_node_f3;
39 ring_node *current_ring_node_f3;
40 ring_node *ring_node_to_send_cwf_f3;
40 ring_node *ring_node_to_send_cwf_f3;
41
41
42 bool extractSWF = false;
42 bool extractSWF = false;
43 bool swf_f0_ready = false;
43 bool swf_f0_ready = false;
44 bool swf_f1_ready = false;
44 bool swf_f1_ready = false;
45 bool swf_f2_ready = false;
45 bool swf_f2_ready = false;
46
46
47 int wf_snap_extracted[ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET ];
47 int wf_snap_extracted[ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET ];
48
48
49 //*********************
49 //*********************
50 // Interrupt SubRoutine
50 // Interrupt SubRoutine
51
51
52 void reset_extractSWF( void )
52 void reset_extractSWF( void )
53 {
53 {
54 extractSWF = false;
54 extractSWF = false;
55 swf_f0_ready = false;
55 swf_f0_ready = false;
56 swf_f1_ready = false;
56 swf_f1_ready = false;
57 swf_f2_ready = false;
57 swf_f2_ready = false;
58 }
58 }
59
59
60 rtems_isr waveforms_isr( rtems_vector_number vector )
60 rtems_isr waveforms_isr( rtems_vector_number vector )
61 {
61 {
62 /** This is the interrupt sub routine called by the waveform picker core.
62 /** This is the interrupt sub routine called by the waveform picker core.
63 *
63 *
64 * This ISR launch different actions depending mainly on two pieces of information:
64 * This ISR launch different actions depending mainly on two pieces of information:
65 * 1. the values read in the registers of the waveform picker.
65 * 1. the values read in the registers of the waveform picker.
66 * 2. the current LFR mode.
66 * 2. the current LFR mode.
67 *
67 *
68 */
68 */
69
69
70 rtems_status_code status;
70 rtems_status_code status;
71
71
72 if ( (lfrCurrentMode == LFR_MODE_NORMAL) || (lfrCurrentMode == LFR_MODE_BURST) // in BURST the data are used to place v, e1 and e2 in the HK packet
72 if ( (lfrCurrentMode == LFR_MODE_NORMAL) || (lfrCurrentMode == LFR_MODE_BURST) // in BURST the data are used to place v, e1 and e2 in the HK packet
73 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
73 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) )
74 { // in modes other than STANDBY and BURST, send the CWF_F3 data
74 { // in modes other than STANDBY and BURST, send the CWF_F3 data
75 if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full
75 if ((waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full
76 // (1) change the receiving buffer for the waveform picker
76 // (1) change the receiving buffer for the waveform picker
77 ring_node_to_send_cwf_f3 = current_ring_node_f3;
77 ring_node_to_send_cwf_f3 = current_ring_node_f3;
78 current_ring_node_f3 = current_ring_node_f3->next;
78 current_ring_node_f3 = current_ring_node_f3->next;
79 waveform_picker_regs->addr_data_f3 = current_ring_node_f3->buffer_address;
79 waveform_picker_regs->addr_data_f3 = current_ring_node_f3->buffer_address;
80 // (2) send an event for the waveforms transmission
80 // (2) send an event for the waveforms transmission
81 if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
81 if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
82 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
82 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
83 }
83 }
84 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2);
84 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2);
85 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111]
85 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111]
86 }
86 }
87 }
87 }
88
88
89 switch(lfrCurrentMode)
89 switch(lfrCurrentMode)
90 {
90 {
91 //********
91 //********
92 // STANDBY
92 // STANDBY
93 case(LFR_MODE_STANDBY):
93 case(LFR_MODE_STANDBY):
94 break;
94 break;
95
95
96 //******
96 //******
97 // NORMAL
97 // NORMAL
98 case(LFR_MODE_NORMAL):
98 case(LFR_MODE_NORMAL):
99 if ( (waveform_picker_regs->status & 0xff8) != 0x00) // [1000] check the error bits
99 if ( (waveform_picker_regs->status & 0xff8) != 0x00) // [1000] check the error bits
100 {
100 {
101 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
101 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
102 }
102 }
103 if ( (waveform_picker_regs->status & 0x07) == 0x07) // [0111] check the f2, f1, f0 full bits
103 if ( (waveform_picker_regs->status & 0x07) == 0x07) // [0111] check the f2, f1, f0 full bits
104 {
104 {
105 // change F0 ring node
105 // change F0 ring node
106 ring_node_to_send_swf_f0 = current_ring_node_f0;
106 ring_node_to_send_swf_f0 = current_ring_node_f0;
107 current_ring_node_f0 = current_ring_node_f0->next;
107 current_ring_node_f0 = current_ring_node_f0->next;
108 waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address;
108 waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address;
109 // change F1 ring node
109 // change F1 ring node
110 ring_node_to_send_swf_f1 = current_ring_node_f1;
110 ring_node_to_send_swf_f1 = current_ring_node_f1;
111 current_ring_node_f1 = current_ring_node_f1->next;
111 current_ring_node_f1 = current_ring_node_f1->next;
112 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
112 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
113 // change F2 ring node
113 // change F2 ring node
114 ring_node_to_send_swf_f2 = current_ring_node_f2;
114 ring_node_to_send_swf_f2 = current_ring_node_f2;
115 current_ring_node_f2 = current_ring_node_f2->next;
115 current_ring_node_f2 = current_ring_node_f2->next;
116 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
116 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
117 //
117 //
118 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL)
118 if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL)
119 {
119 {
120 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
120 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
121 }
121 }
122 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff888; // [1000 1000 1000]
122 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffff888; // [1000 1000 1000]
123 }
123 }
124 break;
124 break;
125
125
126 //******
126 //******
127 // BURST
127 // BURST
128 case(LFR_MODE_BURST):
128 case(LFR_MODE_BURST):
129 if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit
129 if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit
130 // (1) change the receiving buffer for the waveform picker
130 // (1) change the receiving buffer for the waveform picker
131 ring_node_to_send_cwf_f2 = current_ring_node_f2;
131 ring_node_to_send_cwf_f2 = current_ring_node_f2;
132 current_ring_node_f2 = current_ring_node_f2->next;
132 current_ring_node_f2 = current_ring_node_f2->next;
133 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
133 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
134 // (2) send an event for the waveforms transmission
134 // (2) send an event for the waveforms transmission
135 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
135 if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) {
136 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
136 rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 );
137 }
137 }
138 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
138 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
139 }
139 }
140 break;
140 break;
141
141
142 //*****
142 //*****
143 // SBM1
143 // SBM1
144 case(LFR_MODE_SBM1):
144 case(LFR_MODE_SBM1):
145 if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit
145 if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit
146 // (1) change the receiving buffer for the waveform picker
146 // (1) change the receiving buffer for the waveform picker
147 ring_node_to_send_cwf_f1 = current_ring_node_f1;
147 ring_node_to_send_cwf_f1 = current_ring_node_f1;
148 current_ring_node_f1 = current_ring_node_f1->next;
148 current_ring_node_f1 = current_ring_node_f1->next;
149 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
149 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address;
150 // (2) send an event for the the CWF1 task for transmission (and snapshot extraction if needed)
150 // (2) send an event for the the CWF1 task for transmission (and snapshot extraction if needed)
151 status = rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 );
151 status = rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 );
152 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bits = 0
152 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bits = 0
153 }
153 }
154 if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit
154 if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit
155 swf_f0_ready = true;
155 swf_f0_ready = true;
156 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffeee; // [1111 1110 1110 1110] f0 bits = 0
156 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffeee; // [1111 1110 1110 1110] f0 bits = 0
157 }
157 }
158 if ( (waveform_picker_regs->status & 0x04) == 0x04 ) { // [0100] check the f2 full bit
158 if ( (waveform_picker_regs->status & 0x04) == 0x04 ) { // [0100] check the f2 full bit
159 swf_f2_ready = true;
159 swf_f2_ready = true;
160 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bits = 0
160 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bits = 0
161 }
161 }
162 break;
162 break;
163
163
164 //*****
164 //*****
165 // SBM2
165 // SBM2
166 case(LFR_MODE_SBM2):
166 case(LFR_MODE_SBM2):
167 if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit
167 if ( (waveform_picker_regs->status & 0x04) == 0x04 ){ // [0100] check the f2 full bit
168 // (1) change the receiving buffer for the waveform picker
168 // (1) change the receiving buffer for the waveform picker
169 ring_node_to_send_cwf_f2 = current_ring_node_f2;
169 ring_node_to_send_cwf_f2 = current_ring_node_f2;
170 current_ring_node_f2 = current_ring_node_f2->next;
170 current_ring_node_f2 = current_ring_node_f2->next;
171 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
171 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address;
172 // (2) send an event for the waveforms transmission
172 // (2) send an event for the waveforms transmission
173 status = rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 );
173 status = rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 );
174 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
174 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0
175 }
175 }
176 if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit
176 if ( (waveform_picker_regs->status & 0x01) == 0x01 ) { // [0001] check the f0 full bit
177 swf_f0_ready = true;
177 swf_f0_ready = true;
178 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffeee; // [1111 1110 1110 1110] f0 bits = 0
178 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffeee; // [1111 1110 1110 1110] f0 bits = 0
179 }
179 }
180 if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit
180 if ( (waveform_picker_regs->status & 0x02) == 0x02 ) { // [0010] check the f1 full bit
181 swf_f1_ready = true;
181 swf_f1_ready = true;
182 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1, f0 bits = 0
182 waveform_picker_regs->status = waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1, f0 bits = 0
183 }
183 }
184 break;
184 break;
185
185
186 //********
186 //********
187 // DEFAULT
187 // DEFAULT
188 default:
188 default:
189 break;
189 break;
190 }
190 }
191 }
191 }
192
192
193 //************
193 //************
194 // RTEMS TASKS
194 // RTEMS TASKS
195
195
196 rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
196 rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
197 {
197 {
198 /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode.
198 /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode.
199 *
199 *
200 * @param unused is the starting argument of the RTEMS task
200 * @param unused is the starting argument of the RTEMS task
201 *
201 *
202 * The following data packets are sent by this task:
202 * The following data packets are sent by this task:
203 * - TM_LFR_SCIENCE_NORMAL_SWF_F0
203 * - TM_LFR_SCIENCE_NORMAL_SWF_F0
204 * - TM_LFR_SCIENCE_NORMAL_SWF_F1
204 * - TM_LFR_SCIENCE_NORMAL_SWF_F1
205 * - TM_LFR_SCIENCE_NORMAL_SWF_F2
205 * - TM_LFR_SCIENCE_NORMAL_SWF_F2
206 *
206 *
207 */
207 */
208
208
209 rtems_event_set event_out;
209 rtems_event_set event_out;
210 rtems_id queue_id;
210 rtems_id queue_id;
211 rtems_status_code status;
211 rtems_status_code status;
212
212
213 init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 );
213 init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 );
214 init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 );
214 init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 );
215 init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 );
215 init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 );
216
216
217 init_waveforms();
218
219 status = get_message_queue_id_send( &queue_id );
217 status = get_message_queue_id_send( &queue_id );
220 if (status != RTEMS_SUCCESSFUL)
218 if (status != RTEMS_SUCCESSFUL)
221 {
219 {
222 PRINTF1("in WFRM *** ERR get_message_queue_id_send %d\n", status)
220 PRINTF1("in WFRM *** ERR get_message_queue_id_send %d\n", status)
223 }
221 }
224
222
225 BOOT_PRINTF("in WFRM ***\n")
223 BOOT_PRINTF("in WFRM ***\n")
226
224
227 while(1){
225 while(1){
228 // wait for an RTEMS_EVENT
226 // wait for an RTEMS_EVENT
229 rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1
227 rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1
230 | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM,
228 | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM,
231 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
229 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
232 if (event_out == RTEMS_EVENT_MODE_NORMAL)
230 if (event_out == RTEMS_EVENT_MODE_NORMAL)
233 {
231 {
234 DEBUG_PRINTF("WFRM received RTEMS_EVENT_MODE_NORMAL\n")
232 DEBUG_PRINTF("WFRM received RTEMS_EVENT_MODE_NORMAL\n")
235 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
233 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
236 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
234 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
237 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
235 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
238 }
236 }
239 if (event_out == RTEMS_EVENT_MODE_SBM1)
237 if (event_out == RTEMS_EVENT_MODE_SBM1)
240 {
238 {
241 DEBUG_PRINTF("WFRM received RTEMS_EVENT_MODE_SBM1\n")
239 DEBUG_PRINTF("WFRM received RTEMS_EVENT_MODE_SBM1\n")
242 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
240 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
243 send_waveform_SWF((volatile int*) wf_snap_extracted , SID_NORM_SWF_F1, headerSWF_F1, queue_id);
241 send_waveform_SWF((volatile int*) wf_snap_extracted , SID_NORM_SWF_F1, headerSWF_F1, queue_id);
244 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
242 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f2->buffer_address, SID_NORM_SWF_F2, headerSWF_F2, queue_id);
245 }
243 }
246 if (event_out == RTEMS_EVENT_MODE_SBM2)
244 if (event_out == RTEMS_EVENT_MODE_SBM2)
247 {
245 {
248 DEBUG_PRINTF("WFRM received RTEMS_EVENT_MODE_SBM2\n")
246 DEBUG_PRINTF("WFRM received RTEMS_EVENT_MODE_SBM2\n")
249 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
247 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f0->buffer_address, SID_NORM_SWF_F0, headerSWF_F0, queue_id);
250 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
248 send_waveform_SWF((volatile int*) ring_node_to_send_swf_f1->buffer_address, SID_NORM_SWF_F1, headerSWF_F1, queue_id);
251 send_waveform_SWF((volatile int*) wf_snap_extracted , SID_NORM_SWF_F2, headerSWF_F2, queue_id);
249 send_waveform_SWF((volatile int*) wf_snap_extracted , SID_NORM_SWF_F2, headerSWF_F2, queue_id);
252 }
250 }
253 }
251 }
254 }
252 }
255
253
256 rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
254 rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP
257 {
255 {
258 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3.
256 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3.
259 *
257 *
260 * @param unused is the starting argument of the RTEMS task
258 * @param unused is the starting argument of the RTEMS task
261 *
259 *
262 * The following data packet is sent by this task:
260 * The following data packet is sent by this task:
263 * - TM_LFR_SCIENCE_NORMAL_CWF_F3
261 * - TM_LFR_SCIENCE_NORMAL_CWF_F3
264 *
262 *
265 */
263 */
266
264
267 rtems_event_set event_out;
265 rtems_event_set event_out;
268 rtems_id queue_id;
266 rtems_id queue_id;
269 rtems_status_code status;
267 rtems_status_code status;
270
268
271 init_header_continuous_wf_table( SID_NORM_CWF_LONG_F3, headerCWF_F3 );
269 init_header_continuous_wf_table( SID_NORM_CWF_LONG_F3, headerCWF_F3 );
272 init_header_continuous_cwf3_light_table( headerCWF_F3_light );
270 init_header_continuous_cwf3_light_table( headerCWF_F3_light );
273
271
274 status = get_message_queue_id_send( &queue_id );
272 status = get_message_queue_id_send( &queue_id );
275 if (status != RTEMS_SUCCESSFUL)
273 if (status != RTEMS_SUCCESSFUL)
276 {
274 {
277 PRINTF1("in CWF3 *** ERR get_message_queue_id_send %d\n", status)
275 PRINTF1("in CWF3 *** ERR get_message_queue_id_send %d\n", status)
278 }
276 }
279
277
280 BOOT_PRINTF("in CWF3 ***\n")
278 BOOT_PRINTF("in CWF3 ***\n")
281
279
282 while(1){
280 while(1){
283 // wait for an RTEMS_EVENT
281 // wait for an RTEMS_EVENT
284 rtems_event_receive( RTEMS_EVENT_0,
282 rtems_event_receive( RTEMS_EVENT_0,
285 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
283 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
286 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
284 if ( (lfrCurrentMode == LFR_MODE_NORMAL)
287 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode==LFR_MODE_SBM2) )
285 || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode==LFR_MODE_SBM2) )
288 {
286 {
289 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
287 if ( (parameter_dump_packet.sy_lfr_n_cwf_long_f3 & 0x01) == 0x01)
290 {
288 {
291 PRINTF("send CWF_LONG_F3\n")
289 PRINTF("send CWF_LONG_F3\n")
292 send_waveform_CWF(
290 send_waveform_CWF(
293 (volatile int*) current_ring_node_f3->buffer_address,
291 (volatile int*) current_ring_node_f3->buffer_address,
294 SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id );
292 SID_NORM_CWF_LONG_F3, headerCWF_F3, queue_id );
295 }
293 }
296 else
294 else
297 {
295 {
298 PRINTF("send CWF_F3 (light)\n")
296 PRINTF("send CWF_F3 (light)\n")
299 send_waveform_CWF3_light(
297 send_waveform_CWF3_light(
300 (volatile int*) current_ring_node_f3->buffer_address,
298 (volatile int*) current_ring_node_f3->buffer_address,
301 headerCWF_F3_light, queue_id );
299 headerCWF_F3_light, queue_id );
302 }
300 }
303
301
304 }
302 }
305 else
303 else
306 {
304 {
307 PRINTF1("in CWF3 *** lfrCurrentMode is %d, no data will be sent\n", lfrCurrentMode)
305 PRINTF1("in CWF3 *** lfrCurrentMode is %d, no data will be sent\n", lfrCurrentMode)
308 }
306 }
309 }
307 }
310 }
308 }
311
309
312 rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2
310 rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2
313 {
311 {
314 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2.
312 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2.
315 *
313 *
316 * @param unused is the starting argument of the RTEMS task
314 * @param unused is the starting argument of the RTEMS task
317 *
315 *
318 * The following data packet is sent by this function:
316 * The following data packet is sent by this function:
319 * - TM_LFR_SCIENCE_BURST_CWF_F2
317 * - TM_LFR_SCIENCE_BURST_CWF_F2
320 * - TM_LFR_SCIENCE_SBM2_CWF_F2
318 * - TM_LFR_SCIENCE_SBM2_CWF_F2
321 *
319 *
322 */
320 */
323
321
324 rtems_event_set event_out;
322 rtems_event_set event_out;
325 rtems_id queue_id;
323 rtems_id queue_id;
326 rtems_status_code status;
324 rtems_status_code status;
327
325
328 init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST );
326 init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST );
329 init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 );
327 init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 );
330
328
331 status = get_message_queue_id_send( &queue_id );
329 status = get_message_queue_id_send( &queue_id );
332 if (status != RTEMS_SUCCESSFUL)
330 if (status != RTEMS_SUCCESSFUL)
333 {
331 {
334 PRINTF1("in CWF2 *** ERR get_message_queue_id_send %d\n", status)
332 PRINTF1("in CWF2 *** ERR get_message_queue_id_send %d\n", status)
335 }
333 }
336
334
337 BOOT_PRINTF("in CWF2 ***\n")
335 BOOT_PRINTF("in CWF2 ***\n")
338
336
339 while(1){
337 while(1){
340 // wait for an RTEMS_EVENT
338 // wait for an RTEMS_EVENT
341 rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2,
339 rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2,
342 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
340 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
343 if (event_out == RTEMS_EVENT_MODE_BURST)
341 if (event_out == RTEMS_EVENT_MODE_BURST)
344 {
342 {
345 send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id );
343 send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id );
346 }
344 }
347 if (event_out == RTEMS_EVENT_MODE_SBM2)
345 if (event_out == RTEMS_EVENT_MODE_SBM2)
348 {
346 {
349 send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
347 send_waveform_CWF( (volatile int *) ring_node_to_send_cwf_f2->buffer_address, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id );
350 // launch snapshot extraction if needed
348 // launch snapshot extraction if needed
351 if (extractSWF == true)
349 if (extractSWF == true)
352 {
350 {
353 ring_node_to_send_swf_f2 = ring_node_to_send_cwf_f2;
351 ring_node_to_send_swf_f2 = ring_node_to_send_cwf_f2;
354 // extract the snapshot
352 // extract the snapshot
355 build_snapshot_from_ring( ring_node_to_send_swf_f2, 2 );
353 build_snapshot_from_ring( ring_node_to_send_swf_f2, 2 );
356 // send the snapshot when built
354 // send the snapshot when built
357 status = rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2 );
355 status = rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2 );
358 extractSWF = false;
356 extractSWF = false;
359 }
357 }
360 if (swf_f0_ready && swf_f1_ready)
358 if (swf_f0_ready && swf_f1_ready)
361 {
359 {
362 extractSWF = true;
360 extractSWF = true;
363 swf_f0_ready = false;
361 swf_f0_ready = false;
364 swf_f1_ready = false;
362 swf_f1_ready = false;
365 }
363 }
366 }
364 }
367 }
365 }
368 }
366 }
369
367
370 rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1
368 rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1
371 {
369 {
372 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1.
370 /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1.
373 *
371 *
374 * @param unused is the starting argument of the RTEMS task
372 * @param unused is the starting argument of the RTEMS task
375 *
373 *
376 * The following data packet is sent by this function:
374 * The following data packet is sent by this function:
377 * - TM_LFR_SCIENCE_SBM1_CWF_F1
375 * - TM_LFR_SCIENCE_SBM1_CWF_F1
378 *
376 *
379 */
377 */
380
378
381 rtems_event_set event_out;
379 rtems_event_set event_out;
382 rtems_id queue_id;
380 rtems_id queue_id;
383 rtems_status_code status;
381 rtems_status_code status;
384
382
385 init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 );
383 init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 );
386
384
387 status = get_message_queue_id_send( &queue_id );
385 status = get_message_queue_id_send( &queue_id );
388 if (status != RTEMS_SUCCESSFUL)
386 if (status != RTEMS_SUCCESSFUL)
389 {
387 {
390 PRINTF1("in CWF1 *** ERR get_message_queue_id_send %d\n", status)
388 PRINTF1("in CWF1 *** ERR get_message_queue_id_send %d\n", status)
391 }
389 }
392
390
393 BOOT_PRINTF("in CWF1 ***\n")
391 BOOT_PRINTF("in CWF1 ***\n")
394
392
395 while(1){
393 while(1){
396 // wait for an RTEMS_EVENT
394 // wait for an RTEMS_EVENT
397 rtems_event_receive( RTEMS_EVENT_MODE_SBM1,
395 rtems_event_receive( RTEMS_EVENT_MODE_SBM1,
398 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
396 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
399 send_waveform_CWF( (volatile int*) ring_node_to_send_cwf_f1->buffer_address, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
397 send_waveform_CWF( (volatile int*) ring_node_to_send_cwf_f1->buffer_address, SID_SBM1_CWF_F1, headerCWF_F1, queue_id );
400 // launch snapshot extraction if needed
398 // launch snapshot extraction if needed
401 if (extractSWF == true)
399 if (extractSWF == true)
402 {
400 {
403 ring_node_to_send_swf_f1 = ring_node_to_send_cwf_f1;
401 ring_node_to_send_swf_f1 = ring_node_to_send_cwf_f1;
404 // launch the snapshot extraction
402 // launch the snapshot extraction
405 status = rtems_event_send( Task_id[TASKID_SWBD], RTEMS_EVENT_MODE_SBM1 );
403 status = rtems_event_send( Task_id[TASKID_SWBD], RTEMS_EVENT_MODE_SBM1 );
406 extractSWF = false;
404 extractSWF = false;
407 }
405 }
408 if (swf_f0_ready == true)
406 if (swf_f0_ready == true)
409 {
407 {
410 extractSWF = true;
408 extractSWF = true;
411 swf_f0_ready = false; // this step shall be executed only one time
409 swf_f0_ready = false; // this step shall be executed only one time
412 }
410 }
413 if ((swf_f1_ready == true) && (swf_f2_ready == true)) // swf_f1 is ready after the extraction
411 if ((swf_f1_ready == true) && (swf_f2_ready == true)) // swf_f1 is ready after the extraction
414 {
412 {
415 status = rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM1 );
413 status = rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM1 );
416 swf_f1_ready = false;
414 swf_f1_ready = false;
417 swf_f2_ready = false;
415 swf_f2_ready = false;
418 }
416 }
419 }
417 }
420 }
418 }
421
419
422 rtems_task swbd_task(rtems_task_argument argument)
420 rtems_task swbd_task(rtems_task_argument argument)
423 {
421 {
424 /** This RTEMS task is dedicated to the building of snapshots from different continuous waveforms buffers.
422 /** This RTEMS task is dedicated to the building of snapshots from different continuous waveforms buffers.
425 *
423 *
426 * @param unused is the starting argument of the RTEMS task
424 * @param unused is the starting argument of the RTEMS task
427 *
425 *
428 */
426 */
429
427
430 rtems_event_set event_out;
428 rtems_event_set event_out;
431
429
432 BOOT_PRINTF("in SWBD ***\n")
430 BOOT_PRINTF("in SWBD ***\n")
433
431
434 while(1){
432 while(1){
435 // wait for an RTEMS_EVENT
433 // wait for an RTEMS_EVENT
436 rtems_event_receive( RTEMS_EVENT_MODE_SBM1 | RTEMS_EVENT_MODE_SBM2,
434 rtems_event_receive( RTEMS_EVENT_MODE_SBM1 | RTEMS_EVENT_MODE_SBM2,
437 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
435 RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out);
438 if (event_out == RTEMS_EVENT_MODE_SBM1)
436 if (event_out == RTEMS_EVENT_MODE_SBM1)
439 {
437 {
440 build_snapshot_from_ring( ring_node_to_send_swf_f1, 1 );
438 build_snapshot_from_ring( ring_node_to_send_swf_f1, 1 );
441 swf_f1_ready = true; // the snapshot has been extracted and is ready to be sent
439 swf_f1_ready = true; // the snapshot has been extracted and is ready to be sent
442 }
440 }
443 else
441 else
444 {
442 {
445 PRINTF1("in SWBD *** unexpected rtems event received %x\n", (int) event_out)
443 PRINTF1("in SWBD *** unexpected rtems event received %x\n", (int) event_out)
446 }
444 }
447 }
445 }
448 }
446 }
449
447
450 //******************
448 //******************
451 // general functions
449 // general functions
452 void init_waveforms( void )
453 {
454 int i = 0;
455
456 for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
457 {
458 //***
459 // F0
460 // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; //
461 // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; //
462 // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; //
463
464 //***
465 // F1
466 // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111;
467 // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333;
468 // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
469
470 //***
471 // F2
472 // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333;
473 // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111;
474 // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000;
475
476 //***
477 // F3
478 // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1;
479 // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2;
480 // wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000;
481 }
482 }
483
450
484 void init_waveform_rings( void )
451 void init_waveform_rings( void )
485 {
452 {
486 // F0 RING
453 // F0 RING
487 init_waveform_ring( waveform_ring_f0, NB_RING_NODES_F0, wf_snap_f0 );
454 init_waveform_ring( waveform_ring_f0, NB_RING_NODES_F0, wf_snap_f0 );
488 // F1 RING
455 // F1 RING
489 init_waveform_ring( waveform_ring_f1, NB_RING_NODES_F1, wf_snap_f1 );
456 init_waveform_ring( waveform_ring_f1, NB_RING_NODES_F1, wf_snap_f1 );
490 // F2 RING
457 // F2 RING
491 init_waveform_ring( waveform_ring_f2, NB_RING_NODES_F2, wf_snap_f2 );
458 init_waveform_ring( waveform_ring_f2, NB_RING_NODES_F2, wf_snap_f2 );
492 // F3 RING
459 // F3 RING
493 init_waveform_ring( waveform_ring_f3, NB_RING_NODES_F3, wf_cont_f3 );
460 init_waveform_ring( waveform_ring_f3, NB_RING_NODES_F3, wf_cont_f3 );
494
461
495 DEBUG_PRINTF1("waveform_ring_f0 @%x\n", (unsigned int) waveform_ring_f0)
462 DEBUG_PRINTF1("waveform_ring_f0 @%x\n", (unsigned int) waveform_ring_f0)
496 DEBUG_PRINTF1("waveform_ring_f1 @%x\n", (unsigned int) waveform_ring_f1)
463 DEBUG_PRINTF1("waveform_ring_f1 @%x\n", (unsigned int) waveform_ring_f1)
497 DEBUG_PRINTF1("waveform_ring_f2 @%x\n", (unsigned int) waveform_ring_f2)
464 DEBUG_PRINTF1("waveform_ring_f2 @%x\n", (unsigned int) waveform_ring_f2)
498 DEBUG_PRINTF1("waveform_ring_f3 @%x\n", (unsigned int) waveform_ring_f3)
465 DEBUG_PRINTF1("waveform_ring_f3 @%x\n", (unsigned int) waveform_ring_f3)
499 }
466 }
500
467
501 void init_waveform_ring(ring_node waveform_ring[], unsigned char nbNodes, volatile int wfrm[] )
468 void init_waveform_ring(ring_node waveform_ring[], unsigned char nbNodes, volatile int wfrm[] )
502 {
469 {
503 unsigned char i;
470 unsigned char i;
504
471
505 waveform_ring[0].next = (ring_node*) &waveform_ring[ 1 ];
472 waveform_ring[0].next = (ring_node*) &waveform_ring[ 1 ];
506 waveform_ring[0].previous = (ring_node*) &waveform_ring[ nbNodes - 1 ];
473 waveform_ring[0].previous = (ring_node*) &waveform_ring[ nbNodes - 1 ];
507 waveform_ring[0].buffer_address = (int) &wfrm[0];
474 waveform_ring[0].buffer_address = (int) &wfrm[0];
508
475
509 waveform_ring[nbNodes-1].next = (ring_node*) &waveform_ring[ 0 ];
476 waveform_ring[nbNodes-1].next = (ring_node*) &waveform_ring[ 0 ];
510 waveform_ring[nbNodes-1].previous = (ring_node*) &waveform_ring[ nbNodes - 2 ];
477 waveform_ring[nbNodes-1].previous = (ring_node*) &waveform_ring[ nbNodes - 2 ];
511 waveform_ring[nbNodes-1].buffer_address = (int) &wfrm[ (nbNodes-1) * WFRM_BUFFER ];
478 waveform_ring[nbNodes-1].buffer_address = (int) &wfrm[ (nbNodes-1) * WFRM_BUFFER ];
512
479
513 for(i=1; i<nbNodes-1; i++)
480 for(i=1; i<nbNodes-1; i++)
514 {
481 {
515 waveform_ring[i].next = (ring_node*) &waveform_ring[ i + 1 ];
482 waveform_ring[i].next = (ring_node*) &waveform_ring[ i + 1 ];
516 waveform_ring[i].previous = (ring_node*) &waveform_ring[ i - 1 ];
483 waveform_ring[i].previous = (ring_node*) &waveform_ring[ i - 1 ];
517 waveform_ring[i].buffer_address = (int) &wfrm[ i * WFRM_BUFFER ];
484 waveform_ring[i].buffer_address = (int) &wfrm[ i * WFRM_BUFFER ];
518 }
485 }
519 }
486 }
520
487
521 void reset_current_ring_nodes( void )
488 void reset_current_ring_nodes( void )
522 {
489 {
523 current_ring_node_f0 = waveform_ring_f0;
490 current_ring_node_f0 = waveform_ring_f0;
524 ring_node_to_send_swf_f0 = waveform_ring_f0;
491 ring_node_to_send_swf_f0 = waveform_ring_f0;
525
492
526 current_ring_node_f1 = waveform_ring_f1;
493 current_ring_node_f1 = waveform_ring_f1;
527 ring_node_to_send_cwf_f1 = waveform_ring_f1;
494 ring_node_to_send_cwf_f1 = waveform_ring_f1;
528 ring_node_to_send_swf_f1 = waveform_ring_f1;
495 ring_node_to_send_swf_f1 = waveform_ring_f1;
529
496
530 current_ring_node_f2 = waveform_ring_f2;
497 current_ring_node_f2 = waveform_ring_f2;
531 ring_node_to_send_cwf_f2 = waveform_ring_f2;
498 ring_node_to_send_cwf_f2 = waveform_ring_f2;
532 ring_node_to_send_swf_f2 = waveform_ring_f2;
499 ring_node_to_send_swf_f2 = waveform_ring_f2;
533
500
534 current_ring_node_f3 = waveform_ring_f3;
501 current_ring_node_f3 = waveform_ring_f3;
535 ring_node_to_send_cwf_f3 = waveform_ring_f3;
502 ring_node_to_send_cwf_f3 = waveform_ring_f3;
536 }
503 }
537
504
538 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF)
505 int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF)
539 {
506 {
540 unsigned char i;
507 unsigned char i;
541
508
542 for (i=0; i<7; i++)
509 for (i=0; i<7; i++)
543 {
510 {
544 headerSWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
511 headerSWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
545 headerSWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
512 headerSWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
546 headerSWF[ i ].reserved = DEFAULT_RESERVED;
513 headerSWF[ i ].reserved = DEFAULT_RESERVED;
547 headerSWF[ i ].userApplication = CCSDS_USER_APP;
514 headerSWF[ i ].userApplication = CCSDS_USER_APP;
548 headerSWF[ i ].packetID[0] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST >> 8);
515 headerSWF[ i ].packetID[0] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST >> 8);
549 headerSWF[ i ].packetID[1] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST);
516 headerSWF[ i ].packetID[1] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST);
550 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
517 headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
551 if (i == 6)
518 if (i == 6)
552 {
519 {
553 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_224 >> 8);
520 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_224 >> 8);
554 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_224 );
521 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_224 );
555 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_224 >> 8);
522 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_224 >> 8);
556 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_224 );
523 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_224 );
557 }
524 }
558 else
525 else
559 {
526 {
560 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_304 >> 8);
527 headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_304 >> 8);
561 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_304 );
528 headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_304 );
562 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_304 >> 8);
529 headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_304 >> 8);
563 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_304 );
530 headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_304 );
564 }
531 }
565 headerSWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
532 headerSWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
566 headerSWF[ i ].pktCnt = DEFAULT_PKTCNT; // PKT_CNT
533 headerSWF[ i ].pktCnt = DEFAULT_PKTCNT; // PKT_CNT
567 headerSWF[ i ].pktNr = i+1; // PKT_NR
534 headerSWF[ i ].pktNr = i+1; // PKT_NR
568 // DATA FIELD HEADER
535 // DATA FIELD HEADER
569 headerSWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
536 headerSWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
570 headerSWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
537 headerSWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
571 headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
538 headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
572 headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
539 headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
573 // AUXILIARY DATA HEADER
540 // AUXILIARY DATA HEADER
574 headerSWF[ i ].time[0] = 0x00;
541 headerSWF[ i ].time[0] = 0x00;
575 headerSWF[ i ].time[0] = 0x00;
542 headerSWF[ i ].time[0] = 0x00;
576 headerSWF[ i ].time[0] = 0x00;
543 headerSWF[ i ].time[0] = 0x00;
577 headerSWF[ i ].time[0] = 0x00;
544 headerSWF[ i ].time[0] = 0x00;
578 headerSWF[ i ].time[0] = 0x00;
545 headerSWF[ i ].time[0] = 0x00;
579 headerSWF[ i ].time[0] = 0x00;
546 headerSWF[ i ].time[0] = 0x00;
580 headerSWF[ i ].sid = sid;
547 headerSWF[ i ].sid = sid;
581 headerSWF[ i ].hkBIA = DEFAULT_HKBIA;
548 headerSWF[ i ].hkBIA = DEFAULT_HKBIA;
582 }
549 }
583 return LFR_SUCCESSFUL;
550 return LFR_SUCCESSFUL;
584 }
551 }
585
552
586 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
553 int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
587 {
554 {
588 unsigned int i;
555 unsigned int i;
589
556
590 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF; i++)
557 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF; i++)
591 {
558 {
592 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
559 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
593 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
560 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
594 headerCWF[ i ].reserved = DEFAULT_RESERVED;
561 headerCWF[ i ].reserved = DEFAULT_RESERVED;
595 headerCWF[ i ].userApplication = CCSDS_USER_APP;
562 headerCWF[ i ].userApplication = CCSDS_USER_APP;
596 if ( (sid == SID_SBM1_CWF_F1) || (sid == SID_SBM2_CWF_F2) )
563 if ( (sid == SID_SBM1_CWF_F1) || (sid == SID_SBM2_CWF_F2) )
597 {
564 {
598 headerCWF[ i ].packetID[0] = (unsigned char) (APID_TM_SCIENCE_SBM1_SBM2 >> 8);
565 headerCWF[ i ].packetID[0] = (unsigned char) (APID_TM_SCIENCE_SBM1_SBM2 >> 8);
599 headerCWF[ i ].packetID[1] = (unsigned char) (APID_TM_SCIENCE_SBM1_SBM2);
566 headerCWF[ i ].packetID[1] = (unsigned char) (APID_TM_SCIENCE_SBM1_SBM2);
600 }
567 }
601 else
568 else
602 {
569 {
603 headerCWF[ i ].packetID[0] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST >> 8);
570 headerCWF[ i ].packetID[0] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST >> 8);
604 headerCWF[ i ].packetID[1] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST);
571 headerCWF[ i ].packetID[1] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST);
605 }
572 }
606 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
573 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
607 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_336 >> 8);
574 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_336 >> 8);
608 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_336 );
575 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_336 );
609 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_CWF >> 8);
576 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_CWF >> 8);
610 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_CWF );
577 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_CWF );
611 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
578 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
612 // DATA FIELD HEADER
579 // DATA FIELD HEADER
613 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
580 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
614 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
581 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
615 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
582 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
616 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
583 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
617 // AUXILIARY DATA HEADER
584 // AUXILIARY DATA HEADER
618 headerCWF[ i ].sid = sid;
585 headerCWF[ i ].sid = sid;
619 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
586 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
620 headerCWF[ i ].time[0] = 0x00;
587 headerCWF[ i ].time[0] = 0x00;
621 headerCWF[ i ].time[0] = 0x00;
588 headerCWF[ i ].time[0] = 0x00;
622 headerCWF[ i ].time[0] = 0x00;
589 headerCWF[ i ].time[0] = 0x00;
623 headerCWF[ i ].time[0] = 0x00;
590 headerCWF[ i ].time[0] = 0x00;
624 headerCWF[ i ].time[0] = 0x00;
591 headerCWF[ i ].time[0] = 0x00;
625 headerCWF[ i ].time[0] = 0x00;
592 headerCWF[ i ].time[0] = 0x00;
626 }
593 }
627 return LFR_SUCCESSFUL;
594 return LFR_SUCCESSFUL;
628 }
595 }
629
596
630 int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
597 int init_header_continuous_cwf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF )
631 {
598 {
632 unsigned int i;
599 unsigned int i;
633
600
634 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF_LIGHT; i++)
601 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF_LIGHT; i++)
635 {
602 {
636 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
603 headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID;
637 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
604 headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID;
638 headerCWF[ i ].reserved = DEFAULT_RESERVED;
605 headerCWF[ i ].reserved = DEFAULT_RESERVED;
639 headerCWF[ i ].userApplication = CCSDS_USER_APP;
606 headerCWF[ i ].userApplication = CCSDS_USER_APP;
640
607
641 headerCWF[ i ].packetID[0] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST >> 8);
608 headerCWF[ i ].packetID[0] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST >> 8);
642 headerCWF[ i ].packetID[1] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST);
609 headerCWF[ i ].packetID[1] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST);
643
610
644 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
611 headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE;
645 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_672 >> 8);
612 headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_672 >> 8);
646 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_672 );
613 headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_672 );
647 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_CWF_SHORT_F3 >> 8);
614 headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_CWF_SHORT_F3 >> 8);
648 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_CWF_SHORT_F3 );
615 headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_CWF_SHORT_F3 );
649
616
650 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
617 headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT;
651 // DATA FIELD HEADER
618 // DATA FIELD HEADER
652 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
619 headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
653 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
620 headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type
654 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
621 headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype
655 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
622 headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND;
656 // AUXILIARY DATA HEADER
623 // AUXILIARY DATA HEADER
657 headerCWF[ i ].sid = SID_NORM_CWF_F3;
624 headerCWF[ i ].sid = SID_NORM_CWF_F3;
658 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
625 headerCWF[ i ].hkBIA = DEFAULT_HKBIA;
659 headerCWF[ i ].time[0] = 0x00;
626 headerCWF[ i ].time[0] = 0x00;
660 headerCWF[ i ].time[0] = 0x00;
627 headerCWF[ i ].time[0] = 0x00;
661 headerCWF[ i ].time[0] = 0x00;
628 headerCWF[ i ].time[0] = 0x00;
662 headerCWF[ i ].time[0] = 0x00;
629 headerCWF[ i ].time[0] = 0x00;
663 headerCWF[ i ].time[0] = 0x00;
630 headerCWF[ i ].time[0] = 0x00;
664 headerCWF[ i ].time[0] = 0x00;
631 headerCWF[ i ].time[0] = 0x00;
665 }
632 }
666 return LFR_SUCCESSFUL;
633 return LFR_SUCCESSFUL;
667 }
634 }
668
635
669 int send_waveform_SWF( volatile int *waveform, unsigned int sid,
636 int send_waveform_SWF( volatile int *waveform, unsigned int sid,
670 Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id )
637 Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id )
671 {
638 {
672 /** This function sends SWF CCSDS packets (F2, F1 or F0).
639 /** This function sends SWF CCSDS packets (F2, F1 or F0).
673 *
640 *
674 * @param waveform points to the buffer containing the data that will be send.
641 * @param waveform points to the buffer containing the data that will be send.
675 * @param sid is the source identifier of the data that will be sent.
642 * @param sid is the source identifier of the data that will be sent.
676 * @param headerSWF points to a table of headers that have been prepared for the data transmission.
643 * @param headerSWF points to a table of headers that have been prepared for the data transmission.
677 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
644 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
678 * contain information to setup the transmission of the data packets.
645 * contain information to setup the transmission of the data packets.
679 *
646 *
680 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
647 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
681 *
648 *
682 */
649 */
683
650
684 unsigned int i;
651 unsigned int i;
685 int ret;
652 int ret;
686 unsigned int coarseTime;
653 unsigned int coarseTime;
687 unsigned int fineTime;
654 unsigned int fineTime;
688 rtems_status_code status;
655 rtems_status_code status;
689 spw_ioctl_pkt_send spw_ioctl_send_SWF;
656 spw_ioctl_pkt_send spw_ioctl_send_SWF;
690
657
691 spw_ioctl_send_SWF.hlen = TM_HEADER_LEN + 4 + 12; // + 4 is for the protocole extra header, + 12 is for the auxiliary header
658 spw_ioctl_send_SWF.hlen = TM_HEADER_LEN + 4 + 12; // + 4 is for the protocole extra header, + 12 is for the auxiliary header
692 spw_ioctl_send_SWF.options = 0;
659 spw_ioctl_send_SWF.options = 0;
693
660
694 ret = LFR_DEFAULT;
661 ret = LFR_DEFAULT;
695
662
696 coarseTime = waveform[0];
663 coarseTime = waveform[0];
697 fineTime = waveform[1];
664 fineTime = waveform[1];
698
665
699 for (i=0; i<7; i++) // send waveform
666 for (i=0; i<7; i++) // send waveform
700 {
667 {
701 spw_ioctl_send_SWF.data = (char*) &waveform[ (i * BLK_NR_304 * NB_WORDS_SWF_BLK) + TIME_OFFSET];
668 spw_ioctl_send_SWF.data = (char*) &waveform[ (i * BLK_NR_304 * NB_WORDS_SWF_BLK) + TIME_OFFSET];
702 spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ];
669 spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ];
703 // BUILD THE DATA
670 // BUILD THE DATA
704 if (i==6) {
671 if (i==6) {
705 spw_ioctl_send_SWF.dlen = BLK_NR_224 * NB_BYTES_SWF_BLK;
672 spw_ioctl_send_SWF.dlen = BLK_NR_224 * NB_BYTES_SWF_BLK;
706 }
673 }
707 else {
674 else {
708 spw_ioctl_send_SWF.dlen = BLK_NR_304 * NB_BYTES_SWF_BLK;
675 spw_ioctl_send_SWF.dlen = BLK_NR_304 * NB_BYTES_SWF_BLK;
709 }
676 }
710 // SET PACKET SEQUENCE COUNTER
677 // SET PACKET SEQUENCE COUNTER
711 increment_seq_counter_source_id( headerSWF[ i ].packetSequenceControl, sid );
678 increment_seq_counter_source_id( headerSWF[ i ].packetSequenceControl, sid );
712 // SET PACKET TIME
679 // SET PACKET TIME
713 compute_acquisition_time( coarseTime, fineTime, sid, i, headerSWF[ i ].acquisitionTime );
680 compute_acquisition_time( coarseTime, fineTime, sid, i, headerSWF[ i ].acquisitionTime );
714 //
681 //
715 headerSWF[ i ].time[0] = headerSWF[ i ].acquisitionTime[0];
682 headerSWF[ i ].time[0] = headerSWF[ i ].acquisitionTime[0];
716 headerSWF[ i ].time[1] = headerSWF[ i ].acquisitionTime[1];
683 headerSWF[ i ].time[1] = headerSWF[ i ].acquisitionTime[1];
717 headerSWF[ i ].time[2] = headerSWF[ i ].acquisitionTime[2];
684 headerSWF[ i ].time[2] = headerSWF[ i ].acquisitionTime[2];
718 headerSWF[ i ].time[3] = headerSWF[ i ].acquisitionTime[3];
685 headerSWF[ i ].time[3] = headerSWF[ i ].acquisitionTime[3];
719 headerSWF[ i ].time[4] = headerSWF[ i ].acquisitionTime[4];
686 headerSWF[ i ].time[4] = headerSWF[ i ].acquisitionTime[4];
720 headerSWF[ i ].time[5] = headerSWF[ i ].acquisitionTime[5];
687 headerSWF[ i ].time[5] = headerSWF[ i ].acquisitionTime[5];
721 // SEND PACKET
688 // SEND PACKET
722 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_SWF, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
689 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_SWF, ACTION_MSG_SPW_IOCTL_SEND_SIZE);
723 if (status != RTEMS_SUCCESSFUL) {
690 if (status != RTEMS_SUCCESSFUL) {
724 printf("%d-%d, ERR %d\n", sid, i, (int) status);
691 printf("%d-%d, ERR %d\n", sid, i, (int) status);
725 ret = LFR_DEFAULT;
692 ret = LFR_DEFAULT;
726 }
693 }
727 rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds
694 rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds
728 }
695 }
729
696
730 return ret;
697 return ret;
731 }
698 }
732
699
733 int send_waveform_CWF(volatile int *waveform, unsigned int sid,
700 int send_waveform_CWF(volatile int *waveform, unsigned int sid,
734 Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
701 Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
735 {
702 {
736 /** This function sends CWF CCSDS packets (F2, F1 or F0).
703 /** This function sends CWF CCSDS packets (F2, F1 or F0).
737 *
704 *
738 * @param waveform points to the buffer containing the data that will be send.
705 * @param waveform points to the buffer containing the data that will be send.
739 * @param sid is the source identifier of the data that will be sent.
706 * @param sid is the source identifier of the data that will be sent.
740 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
707 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
741 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
708 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
742 * contain information to setup the transmission of the data packets.
709 * contain information to setup the transmission of the data packets.
743 *
710 *
744 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
711 * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks.
745 *
712 *
746 */
713 */
747
714
748 unsigned int i;
715 unsigned int i;
749 int ret;
716 int ret;
750 unsigned int coarseTime;
717 unsigned int coarseTime;
751 unsigned int fineTime;
718 unsigned int fineTime;
752 rtems_status_code status;
719 rtems_status_code status;
753 spw_ioctl_pkt_send spw_ioctl_send_CWF;
720 spw_ioctl_pkt_send spw_ioctl_send_CWF;
754
721
755 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
722 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
756 spw_ioctl_send_CWF.options = 0;
723 spw_ioctl_send_CWF.options = 0;
757
724
758 ret = LFR_DEFAULT;
725 ret = LFR_DEFAULT;
759
726
760 coarseTime = waveform[0];
727 coarseTime = waveform[0];
761 fineTime = waveform[1];
728 fineTime = waveform[1];
762
729
763 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF; i++) // send waveform
730 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF; i++) // send waveform
764 {
731 {
765 spw_ioctl_send_CWF.data = (char*) &waveform[ (i * BLK_NR_CWF * NB_WORDS_SWF_BLK) + TIME_OFFSET];
732 spw_ioctl_send_CWF.data = (char*) &waveform[ (i * BLK_NR_CWF * NB_WORDS_SWF_BLK) + TIME_OFFSET];
766 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
733 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
767 // BUILD THE DATA
734 // BUILD THE DATA
768 spw_ioctl_send_CWF.dlen = BLK_NR_CWF * NB_BYTES_SWF_BLK;
735 spw_ioctl_send_CWF.dlen = BLK_NR_CWF * NB_BYTES_SWF_BLK;
769 // SET PACKET SEQUENCE COUNTER
736 // SET PACKET SEQUENCE COUNTER
770 increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, sid );
737 increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, sid );
771 // SET PACKET TIME
738 // SET PACKET TIME
772 compute_acquisition_time( coarseTime, fineTime, sid, i, headerCWF[ i ].acquisitionTime);
739 compute_acquisition_time( coarseTime, fineTime, sid, i, headerCWF[ i ].acquisitionTime);
773 //
740 //
774 headerCWF[ i ].time[0] = headerCWF[ i ].acquisitionTime[0];
741 headerCWF[ i ].time[0] = headerCWF[ i ].acquisitionTime[0];
775 headerCWF[ i ].time[1] = headerCWF[ i ].acquisitionTime[1];
742 headerCWF[ i ].time[1] = headerCWF[ i ].acquisitionTime[1];
776 headerCWF[ i ].time[2] = headerCWF[ i ].acquisitionTime[2];
743 headerCWF[ i ].time[2] = headerCWF[ i ].acquisitionTime[2];
777 headerCWF[ i ].time[3] = headerCWF[ i ].acquisitionTime[3];
744 headerCWF[ i ].time[3] = headerCWF[ i ].acquisitionTime[3];
778 headerCWF[ i ].time[4] = headerCWF[ i ].acquisitionTime[4];
745 headerCWF[ i ].time[4] = headerCWF[ i ].acquisitionTime[4];
779 headerCWF[ i ].time[5] = headerCWF[ i ].acquisitionTime[5];
746 headerCWF[ i ].time[5] = headerCWF[ i ].acquisitionTime[5];
780 // SEND PACKET
747 // SEND PACKET
781 if (sid == SID_NORM_CWF_LONG_F3)
748 if (sid == SID_NORM_CWF_LONG_F3)
782 {
749 {
783 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
750 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
784 if (status != RTEMS_SUCCESSFUL) {
751 if (status != RTEMS_SUCCESSFUL) {
785 printf("%d-%d, ERR %d\n", sid, i, (int) status);
752 printf("%d-%d, ERR %d\n", sid, i, (int) status);
786 ret = LFR_DEFAULT;
753 ret = LFR_DEFAULT;
787 }
754 }
788 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
755 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
789 }
756 }
790 else
757 else
791 {
758 {
792 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
759 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
793 if (status != RTEMS_SUCCESSFUL) {
760 if (status != RTEMS_SUCCESSFUL) {
794 printf("%d-%d, ERR %d\n", sid, i, (int) status);
761 printf("%d-%d, ERR %d\n", sid, i, (int) status);
795 ret = LFR_DEFAULT;
762 ret = LFR_DEFAULT;
796 }
763 }
797 }
764 }
798 }
765 }
799
766
800 return ret;
767 return ret;
801 }
768 }
802
769
803 int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
770 int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id)
804 {
771 {
805 /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data.
772 /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data.
806 *
773 *
807 * @param waveform points to the buffer containing the data that will be send.
774 * @param waveform points to the buffer containing the data that will be send.
808 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
775 * @param headerCWF points to a table of headers that have been prepared for the data transmission.
809 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
776 * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures
810 * contain information to setup the transmission of the data packets.
777 * contain information to setup the transmission of the data packets.
811 *
778 *
812 * By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer
779 * By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer
813 * from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks.
780 * from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks.
814 *
781 *
815 */
782 */
816
783
817 unsigned int i;
784 unsigned int i;
818 int ret;
785 int ret;
819 unsigned int coarseTime;
786 unsigned int coarseTime;
820 unsigned int fineTime;
787 unsigned int fineTime;
821 rtems_status_code status;
788 rtems_status_code status;
822 spw_ioctl_pkt_send spw_ioctl_send_CWF;
789 spw_ioctl_pkt_send spw_ioctl_send_CWF;
823 char *sample;
790 char *sample;
824
791
825 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
792 spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header
826 spw_ioctl_send_CWF.options = 0;
793 spw_ioctl_send_CWF.options = 0;
827
794
828 ret = LFR_DEFAULT;
795 ret = LFR_DEFAULT;
829
796
830 //**********************
797 //**********************
831 // BUILD CWF3_light DATA
798 // BUILD CWF3_light DATA
832 for ( i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
799 for ( i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++)
833 {
800 {
834 sample = (char*) &waveform[ (i * NB_WORDS_SWF_BLK) + TIME_OFFSET ];
801 sample = (char*) &waveform[ (i * NB_WORDS_SWF_BLK) + TIME_OFFSET ];
835 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + TIME_OFFSET_IN_BYTES ] = sample[ 0 ];
802 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + TIME_OFFSET_IN_BYTES ] = sample[ 0 ];
836 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 + TIME_OFFSET_IN_BYTES ] = sample[ 1 ];
803 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 + TIME_OFFSET_IN_BYTES ] = sample[ 1 ];
837 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 + TIME_OFFSET_IN_BYTES ] = sample[ 2 ];
804 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 + TIME_OFFSET_IN_BYTES ] = sample[ 2 ];
838 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 + TIME_OFFSET_IN_BYTES ] = sample[ 3 ];
805 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 + TIME_OFFSET_IN_BYTES ] = sample[ 3 ];
839 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 + TIME_OFFSET_IN_BYTES ] = sample[ 4 ];
806 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 + TIME_OFFSET_IN_BYTES ] = sample[ 4 ];
840 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 + TIME_OFFSET_IN_BYTES ] = sample[ 5 ];
807 wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 + TIME_OFFSET_IN_BYTES ] = sample[ 5 ];
841 }
808 }
842
809
843 coarseTime = waveform[0];
810 coarseTime = waveform[0];
844 fineTime = waveform[1];
811 fineTime = waveform[1];
845
812
846 //*********************
813 //*********************
847 // SEND CWF3_light DATA
814 // SEND CWF3_light DATA
848 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF_LIGHT; i++) // send waveform
815 for (i=0; i<NB_PACKETS_PER_GROUP_OF_CWF_LIGHT; i++) // send waveform
849 {
816 {
850 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];
817 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];
851 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
818 spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ];
852 // BUILD THE DATA
819 // BUILD THE DATA
853 spw_ioctl_send_CWF.dlen = BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK;
820 spw_ioctl_send_CWF.dlen = BLK_NR_CWF_SHORT_F3 * NB_BYTES_CWF3_LIGHT_BLK;
854 // SET PACKET SEQUENCE COUNTER
821 // SET PACKET SEQUENCE COUNTER
855 increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, SID_NORM_CWF_F3 );
822 increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, SID_NORM_CWF_F3 );
856 // SET PACKET TIME
823 // SET PACKET TIME
857 compute_acquisition_time( coarseTime, fineTime, SID_NORM_CWF_F3, i, headerCWF[ i ].acquisitionTime );
824 compute_acquisition_time( coarseTime, fineTime, SID_NORM_CWF_F3, i, headerCWF[ i ].acquisitionTime );
858 //
825 //
859 headerCWF[ i ].time[0] = headerCWF[ i ].acquisitionTime[0];
826 headerCWF[ i ].time[0] = headerCWF[ i ].acquisitionTime[0];
860 headerCWF[ i ].time[1] = headerCWF[ i ].acquisitionTime[1];
827 headerCWF[ i ].time[1] = headerCWF[ i ].acquisitionTime[1];
861 headerCWF[ i ].time[2] = headerCWF[ i ].acquisitionTime[2];
828 headerCWF[ i ].time[2] = headerCWF[ i ].acquisitionTime[2];
862 headerCWF[ i ].time[3] = headerCWF[ i ].acquisitionTime[3];
829 headerCWF[ i ].time[3] = headerCWF[ i ].acquisitionTime[3];
863 headerCWF[ i ].time[4] = headerCWF[ i ].acquisitionTime[4];
830 headerCWF[ i ].time[4] = headerCWF[ i ].acquisitionTime[4];
864 headerCWF[ i ].time[5] = headerCWF[ i ].acquisitionTime[5];
831 headerCWF[ i ].time[5] = headerCWF[ i ].acquisitionTime[5];
865 // SEND PACKET
832 // SEND PACKET
866 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
833 status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF));
867 if (status != RTEMS_SUCCESSFUL) {
834 if (status != RTEMS_SUCCESSFUL) {
868 printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status);
835 printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status);
869 ret = LFR_DEFAULT;
836 ret = LFR_DEFAULT;
870 }
837 }
871 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
838 rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS);
872 }
839 }
873
840
874 return ret;
841 return ret;
875 }
842 }
876
843
877 void compute_acquisition_time( unsigned int coarseTime, unsigned int fineTime,
844 void compute_acquisition_time( unsigned int coarseTime, unsigned int fineTime,
878 unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char * acquisitionTime )
845 unsigned int sid, unsigned char pa_lfr_pkt_nr, unsigned char * acquisitionTime )
879 {
846 {
880 unsigned long long int acquisitionTimeAsLong;
847 unsigned long long int acquisitionTimeAsLong;
881 unsigned char localAcquisitionTime[6];
848 unsigned char localAcquisitionTime[6];
882 double deltaT;
849 double deltaT;
883
850
884 deltaT = 0.;
851 deltaT = 0.;
885
852
886 localAcquisitionTime[0] = (unsigned char) ( coarseTime >> 8 );
853 localAcquisitionTime[0] = (unsigned char) ( coarseTime >> 8 );
887 localAcquisitionTime[1] = (unsigned char) ( coarseTime );
854 localAcquisitionTime[1] = (unsigned char) ( coarseTime );
888 localAcquisitionTime[2] = (unsigned char) ( coarseTime >> 24 );
855 localAcquisitionTime[2] = (unsigned char) ( coarseTime >> 24 );
889 localAcquisitionTime[3] = (unsigned char) ( coarseTime >> 16 );
856 localAcquisitionTime[3] = (unsigned char) ( coarseTime >> 16 );
890 localAcquisitionTime[4] = (unsigned char) ( fineTime >> 24 );
857 localAcquisitionTime[4] = (unsigned char) ( fineTime >> 24 );
891 localAcquisitionTime[5] = (unsigned char) ( fineTime >> 16 );
858 localAcquisitionTime[5] = (unsigned char) ( fineTime >> 16 );
892
859
893 acquisitionTimeAsLong = ( (unsigned long long int) localAcquisitionTime[0] << 40 )
860 acquisitionTimeAsLong = ( (unsigned long long int) localAcquisitionTime[0] << 40 )
894 + ( (unsigned long long int) localAcquisitionTime[1] << 32 )
861 + ( (unsigned long long int) localAcquisitionTime[1] << 32 )
895 + ( localAcquisitionTime[2] << 24 )
862 + ( localAcquisitionTime[2] << 24 )
896 + ( localAcquisitionTime[3] << 16 )
863 + ( localAcquisitionTime[3] << 16 )
897 + ( localAcquisitionTime[4] << 8 )
864 + ( localAcquisitionTime[4] << 8 )
898 + ( localAcquisitionTime[5] );
865 + ( localAcquisitionTime[5] );
899
866
900 switch( sid )
867 switch( sid )
901 {
868 {
902 case SID_NORM_SWF_F0:
869 case SID_NORM_SWF_F0:
903 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 24576. ;
870 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 24576. ;
904 break;
871 break;
905
872
906 case SID_NORM_SWF_F1:
873 case SID_NORM_SWF_F1:
907 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 4096. ;
874 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 4096. ;
908 break;
875 break;
909
876
910 case SID_NORM_SWF_F2:
877 case SID_NORM_SWF_F2:
911 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 256. ;
878 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_304 * 65536. / 256. ;
912 break;
879 break;
913
880
914 case SID_SBM1_CWF_F1:
881 case SID_SBM1_CWF_F1:
915 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 4096. ;
882 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 4096. ;
916 break;
883 break;
917
884
918 case SID_SBM2_CWF_F2:
885 case SID_SBM2_CWF_F2:
919 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 256. ;
886 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 256. ;
920 break;
887 break;
921
888
922 case SID_BURST_CWF_F2:
889 case SID_BURST_CWF_F2:
923 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 256. ;
890 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 256. ;
924 break;
891 break;
925
892
926 case SID_NORM_CWF_F3:
893 case SID_NORM_CWF_F3:
927 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF_SHORT_F3 * 65536. / 16. ;
894 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF_SHORT_F3 * 65536. / 16. ;
928 break;
895 break;
929
896
930 case SID_NORM_CWF_LONG_F3:
897 case SID_NORM_CWF_LONG_F3:
931 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 16. ;
898 deltaT = ( (double ) (pa_lfr_pkt_nr) ) * BLK_NR_CWF * 65536. / 16. ;
932 break;
899 break;
933
900
934 default:
901 default:
935 PRINTF1("in compute_acquisition_time *** ERR unexpected sid %d", sid)
902 PRINTF1("in compute_acquisition_time *** ERR unexpected sid %d", sid)
936 deltaT = 0.;
903 deltaT = 0.;
937 break;
904 break;
938 }
905 }
939
906
940 acquisitionTimeAsLong = acquisitionTimeAsLong + (unsigned long long int) deltaT;
907 acquisitionTimeAsLong = acquisitionTimeAsLong + (unsigned long long int) deltaT;
941 //
908 //
942 acquisitionTime[0] = (unsigned char) (acquisitionTimeAsLong >> 40);
909 acquisitionTime[0] = (unsigned char) (acquisitionTimeAsLong >> 40);
943 acquisitionTime[1] = (unsigned char) (acquisitionTimeAsLong >> 32);
910 acquisitionTime[1] = (unsigned char) (acquisitionTimeAsLong >> 32);
944 acquisitionTime[2] = (unsigned char) (acquisitionTimeAsLong >> 24);
911 acquisitionTime[2] = (unsigned char) (acquisitionTimeAsLong >> 24);
945 acquisitionTime[3] = (unsigned char) (acquisitionTimeAsLong >> 16);
912 acquisitionTime[3] = (unsigned char) (acquisitionTimeAsLong >> 16);
946 acquisitionTime[4] = (unsigned char) (acquisitionTimeAsLong >> 8 );
913 acquisitionTime[4] = (unsigned char) (acquisitionTimeAsLong >> 8 );
947 acquisitionTime[5] = (unsigned char) (acquisitionTimeAsLong );
914 acquisitionTime[5] = (unsigned char) (acquisitionTimeAsLong );
948
915
949 }
916 }
950
917
951 void build_snapshot_from_ring( ring_node *ring_node_to_send, unsigned char frequencyChannel )
918 void build_snapshot_from_ring( ring_node *ring_node_to_send, unsigned char frequencyChannel )
952 {
919 {
953 unsigned int i;
920 unsigned int i;
954 unsigned long long int centerTime_asLong;
921 unsigned long long int centerTime_asLong;
955 unsigned long long int acquisitionTimeF0_asLong;
922 unsigned long long int acquisitionTimeF0_asLong;
956 unsigned long long int acquisitionTime_asLong;
923 unsigned long long int acquisitionTime_asLong;
957 unsigned long long int bufferAcquisitionTime_asLong;
924 unsigned long long int bufferAcquisitionTime_asLong;
958 unsigned char *ptr1;
925 unsigned char *ptr1;
959 unsigned char *ptr2;
926 unsigned char *ptr2;
960 unsigned char nb_ring_nodes;
927 unsigned char nb_ring_nodes;
961 unsigned long long int frequency_asLong;
928 unsigned long long int frequency_asLong;
962 unsigned long long int nbTicksPerSample_asLong;
929 unsigned long long int nbTicksPerSample_asLong;
963 unsigned long long int nbSamplesPart1_asLong;
930 unsigned long long int nbSamplesPart1_asLong;
964 unsigned long long int sampleOffset_asLong;
931 unsigned long long int sampleOffset_asLong;
965
932
966 unsigned int deltaT_F0;
933 unsigned int deltaT_F0;
967 unsigned int deltaT_F1;
934 unsigned int deltaT_F1;
968 unsigned long long int deltaT_F2;
935 unsigned long long int deltaT_F2;
969
936
970 deltaT_F0 = 2731; // (2048. / 24576. / 2.) * 65536. = 2730.667;
937 deltaT_F0 = 2731; // (2048. / 24576. / 2.) * 65536. = 2730.667;
971 deltaT_F1 = 16384; // (2048. / 4096. / 2.) * 65536. = 16384;
938 deltaT_F1 = 16384; // (2048. / 4096. / 2.) * 65536. = 16384;
972 deltaT_F2 = 262144; // (2048. / 256. / 2.) * 65536. = 262144;
939 deltaT_F2 = 262144; // (2048. / 256. / 2.) * 65536. = 262144;
973 sampleOffset_asLong = 0x00;
940 sampleOffset_asLong = 0x00;
974
941
975 // (1) get the f0 acquisition time
942 // (1) get the f0 acquisition time
976 build_acquisition_time( &acquisitionTimeF0_asLong, current_ring_node_f0 );
943 build_acquisition_time( &acquisitionTimeF0_asLong, current_ring_node_f0 );
977
944
978 // (2) compute the central reference time
945 // (2) compute the central reference time
979 centerTime_asLong = acquisitionTimeF0_asLong + deltaT_F0;
946 centerTime_asLong = acquisitionTimeF0_asLong + deltaT_F0;
980
947
981 // (3) compute the acquisition time of the current snapshot
948 // (3) compute the acquisition time of the current snapshot
982 switch(frequencyChannel)
949 switch(frequencyChannel)
983 {
950 {
984 case 1: // 1 is for F1 = 4096 Hz
951 case 1: // 1 is for F1 = 4096 Hz
985 acquisitionTime_asLong = centerTime_asLong - deltaT_F1;
952 acquisitionTime_asLong = centerTime_asLong - deltaT_F1;
986 nb_ring_nodes = NB_RING_NODES_F1;
953 nb_ring_nodes = NB_RING_NODES_F1;
987 frequency_asLong = 4096;
954 frequency_asLong = 4096;
988 nbTicksPerSample_asLong = 16; // 65536 / 4096;
955 nbTicksPerSample_asLong = 16; // 65536 / 4096;
989 break;
956 break;
990 case 2: // 2 is for F2 = 256 Hz
957 case 2: // 2 is for F2 = 256 Hz
991 acquisitionTime_asLong = centerTime_asLong - deltaT_F2;
958 acquisitionTime_asLong = centerTime_asLong - deltaT_F2;
992 nb_ring_nodes = NB_RING_NODES_F2;
959 nb_ring_nodes = NB_RING_NODES_F2;
993 frequency_asLong = 256;
960 frequency_asLong = 256;
994 nbTicksPerSample_asLong = 256; // 65536 / 256;
961 nbTicksPerSample_asLong = 256; // 65536 / 256;
995 break;
962 break;
996 default:
963 default:
997 acquisitionTime_asLong = centerTime_asLong;
964 acquisitionTime_asLong = centerTime_asLong;
998 frequency_asLong = 256;
965 frequency_asLong = 256;
999 nbTicksPerSample_asLong = 256;
966 nbTicksPerSample_asLong = 256;
1000 break;
967 break;
1001 }
968 }
1002
969
1003 //****************************************************************************
970 //****************************************************************************
1004 // (4) search the ring_node with the acquisition time <= acquisitionTime_asLong
971 // (4) search the ring_node with the acquisition time <= acquisitionTime_asLong
1005 for (i=0; i<nb_ring_nodes; i++)
972 for (i=0; i<nb_ring_nodes; i++)
1006 {
973 {
1007 PRINTF1("%d ... ", i)
974 PRINTF1("%d ... ", i)
1008 build_acquisition_time( &bufferAcquisitionTime_asLong, ring_node_to_send );
975 build_acquisition_time( &bufferAcquisitionTime_asLong, ring_node_to_send );
1009 if (bufferAcquisitionTime_asLong <= acquisitionTime_asLong)
976 if (bufferAcquisitionTime_asLong <= acquisitionTime_asLong)
1010 {
977 {
1011 PRINTF1("buffer found with acquisition time = %llx\n", bufferAcquisitionTime_asLong)
978 PRINTF1("buffer found with acquisition time = %llx\n", bufferAcquisitionTime_asLong)
1012 break;
979 break;
1013 }
980 }
1014 ring_node_to_send = ring_node_to_send->previous;
981 ring_node_to_send = ring_node_to_send->previous;
1015 }
982 }
1016
983
1017 // (5) compute the number of samples to take in the current buffer
984 // (5) compute the number of samples to take in the current buffer
1018 sampleOffset_asLong = ((acquisitionTime_asLong - bufferAcquisitionTime_asLong) * frequency_asLong ) >> 16;
985 sampleOffset_asLong = ((acquisitionTime_asLong - bufferAcquisitionTime_asLong) * frequency_asLong ) >> 16;
1019 nbSamplesPart1_asLong = NB_SAMPLES_PER_SNAPSHOT - sampleOffset_asLong;
986 nbSamplesPart1_asLong = NB_SAMPLES_PER_SNAPSHOT - sampleOffset_asLong;
1020 PRINTF2("sampleOffset_asLong = %lld, nbSamplesPart1_asLong = %lld\n", sampleOffset_asLong, nbSamplesPart1_asLong)
987 PRINTF2("sampleOffset_asLong = %lld, nbSamplesPart1_asLong = %lld\n", sampleOffset_asLong, nbSamplesPart1_asLong)
1021
988
1022 // (6) compute the final acquisition time
989 // (6) compute the final acquisition time
1023 acquisitionTime_asLong = bufferAcquisitionTime_asLong +
990 acquisitionTime_asLong = bufferAcquisitionTime_asLong +
1024 sampleOffset_asLong * nbTicksPerSample_asLong;
991 sampleOffset_asLong * nbTicksPerSample_asLong;
1025
992
1026 // (7) copy the acquisition time at the beginning of the extrated snapshot
993 // (7) copy the acquisition time at the beginning of the extrated snapshot
1027 ptr1 = (unsigned char*) &acquisitionTime_asLong;
994 ptr1 = (unsigned char*) &acquisitionTime_asLong;
1028 ptr2 = (unsigned char*) wf_snap_extracted;
995 ptr2 = (unsigned char*) wf_snap_extracted;
1029 ptr2[0] = ptr1[ 2 + 2 ];
996 ptr2[0] = ptr1[ 2 + 2 ];
1030 ptr2[1] = ptr1[ 3 + 2 ];
997 ptr2[1] = ptr1[ 3 + 2 ];
1031 ptr2[2] = ptr1[ 0 + 2 ];
998 ptr2[2] = ptr1[ 0 + 2 ];
1032 ptr2[3] = ptr1[ 1 + 2 ];
999 ptr2[3] = ptr1[ 1 + 2 ];
1033 ptr2[4] = ptr1[ 4 + 2 ];
1000 ptr2[4] = ptr1[ 4 + 2 ];
1034 ptr2[5] = ptr1[ 5 + 2 ];
1001 ptr2[5] = ptr1[ 5 + 2 ];
1035
1002
1036 // re set the synchronization bit
1003 // re set the synchronization bit
1037
1004
1038
1005
1039 // copy the part 1 of the snapshot in the extracted buffer
1006 // copy the part 1 of the snapshot in the extracted buffer
1040 for ( i = 0; i < (nbSamplesPart1_asLong * NB_WORDS_SWF_BLK); i++ )
1007 for ( i = 0; i < (nbSamplesPart1_asLong * NB_WORDS_SWF_BLK); i++ )
1041 {
1008 {
1042 wf_snap_extracted[i + TIME_OFFSET] =
1009 wf_snap_extracted[i + TIME_OFFSET] =
1043 ((int*) ring_node_to_send->buffer_address)[i + (sampleOffset_asLong * NB_WORDS_SWF_BLK) + TIME_OFFSET];
1010 ((int*) ring_node_to_send->buffer_address)[i + (sampleOffset_asLong * NB_WORDS_SWF_BLK) + TIME_OFFSET];
1044 }
1011 }
1045 // copy the part 2 of the snapshot in the extracted buffer
1012 // copy the part 2 of the snapshot in the extracted buffer
1046 ring_node_to_send = ring_node_to_send->next;
1013 ring_node_to_send = ring_node_to_send->next;
1047 for ( i = (nbSamplesPart1_asLong * NB_WORDS_SWF_BLK); i < (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK); i++ )
1014 for ( i = (nbSamplesPart1_asLong * NB_WORDS_SWF_BLK); i < (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK); i++ )
1048 {
1015 {
1049 wf_snap_extracted[i + TIME_OFFSET] =
1016 wf_snap_extracted[i + TIME_OFFSET] =
1050 ((int*) ring_node_to_send->buffer_address)[(i-(nbSamplesPart1_asLong * NB_WORDS_SWF_BLK)) + TIME_OFFSET];
1017 ((int*) ring_node_to_send->buffer_address)[(i-(nbSamplesPart1_asLong * NB_WORDS_SWF_BLK)) + TIME_OFFSET];
1051 }
1018 }
1052 }
1019 }
1053
1020
1054 void build_acquisition_time( unsigned long long int *acquisitionTimeAslong, ring_node *current_ring_node )
1021 void build_acquisition_time( unsigned long long int *acquisitionTimeAslong, ring_node *current_ring_node )
1055 {
1022 {
1056 unsigned char *acquisitionTimeCharPtr;
1023 unsigned char *acquisitionTimeCharPtr;
1057
1024
1058 acquisitionTimeCharPtr = (unsigned char*) current_ring_node->buffer_address;
1025 acquisitionTimeCharPtr = (unsigned char*) current_ring_node->buffer_address;
1059
1026
1060 *acquisitionTimeAslong = 0x00;
1027 *acquisitionTimeAslong = 0x00;
1061 *acquisitionTimeAslong = ( acquisitionTimeCharPtr[0] << 24 )
1028 *acquisitionTimeAslong = ( acquisitionTimeCharPtr[0] << 24 )
1062 + ( acquisitionTimeCharPtr[1] << 16 )
1029 + ( acquisitionTimeCharPtr[1] << 16 )
1063 + ( (unsigned long long int) (acquisitionTimeCharPtr[2] & 0x7f) << 40 ) // [0111 1111] mask the synchronization bit
1030 + ( (unsigned long long int) (acquisitionTimeCharPtr[2] & 0x7f) << 40 ) // [0111 1111] mask the synchronization bit
1064 + ( (unsigned long long int) acquisitionTimeCharPtr[3] << 32 )
1031 + ( (unsigned long long int) acquisitionTimeCharPtr[3] << 32 )
1065 + ( acquisitionTimeCharPtr[4] << 8 )
1032 + ( acquisitionTimeCharPtr[4] << 8 )
1066 + ( acquisitionTimeCharPtr[5] );
1033 + ( acquisitionTimeCharPtr[5] );
1067 }
1034 }
1068
1035
1069 //**************
1036 //**************
1070 // wfp registers
1037 // wfp registers
1071 void reset_wfp_burst_enable(void)
1038 void reset_wfp_burst_enable(void)
1072 {
1039 {
1073 /** This function resets the waveform picker burst_enable register.
1040 /** This function resets the waveform picker burst_enable register.
1074 *
1041 *
1075 * The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0.
1042 * The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0.
1076 *
1043 *
1077 */
1044 */
1078
1045
1079 waveform_picker_regs->run_burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1046 waveform_picker_regs->run_burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1080 }
1047 }
1081
1048
1082 void reset_wfp_status( void )
1049 void reset_wfp_status( void )
1083 {
1050 {
1084 /** This function resets the waveform picker status register.
1051 /** This function resets the waveform picker status register.
1085 *
1052 *
1086 * All status bits are set to 0 [new_err full_err full].
1053 * All status bits are set to 0 [new_err full_err full].
1087 *
1054 *
1088 */
1055 */
1089
1056
1090 waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1057 waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0
1091 }
1058 }
1092
1059
1093 void reset_waveform_picker_regs(void)
1060 void reset_waveform_picker_regs(void)
1094 {
1061 {
1095 /** This function resets the waveform picker module registers.
1062 /** This function resets the waveform picker module registers.
1096 *
1063 *
1097 * The registers affected by this function are located at the following offset addresses:
1064 * The registers affected by this function are located at the following offset addresses:
1098 * - 0x00 data_shaping
1065 * - 0x00 data_shaping
1099 * - 0x04 run_burst_enable
1066 * - 0x04 run_burst_enable
1100 * - 0x08 addr_data_f0
1067 * - 0x08 addr_data_f0
1101 * - 0x0C addr_data_f1
1068 * - 0x0C addr_data_f1
1102 * - 0x10 addr_data_f2
1069 * - 0x10 addr_data_f2
1103 * - 0x14 addr_data_f3
1070 * - 0x14 addr_data_f3
1104 * - 0x18 status
1071 * - 0x18 status
1105 * - 0x1C delta_snapshot
1072 * - 0x1C delta_snapshot
1106 * - 0x20 delta_f0
1073 * - 0x20 delta_f0
1107 * - 0x24 delta_f0_2
1074 * - 0x24 delta_f0_2
1108 * - 0x28 delta_f1
1075 * - 0x28 delta_f1
1109 * - 0x2c delta_f2
1076 * - 0x2c delta_f2
1110 * - 0x30 nb_data_by_buffer
1077 * - 0x30 nb_data_by_buffer
1111 * - 0x34 nb_snapshot_param
1078 * - 0x34 nb_snapshot_param
1112 * - 0x38 start_date
1079 * - 0x38 start_date
1113 * - 0x3c nb_word_in_buffer
1080 * - 0x3c nb_word_in_buffer
1114 *
1081 *
1115 */
1082 */
1116
1083
1117 set_wfp_data_shaping(); // 0x00 *** R1 R0 SP1 SP0 BW
1084 set_wfp_data_shaping(); // 0x00 *** R1 R0 SP1 SP0 BW
1118 reset_wfp_burst_enable(); // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
1085 reset_wfp_burst_enable(); // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ]
1119 waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; // 0x08
1086 waveform_picker_regs->addr_data_f0 = current_ring_node_f0->buffer_address; // 0x08
1120 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; // 0x0c
1087 waveform_picker_regs->addr_data_f1 = current_ring_node_f1->buffer_address; // 0x0c
1121 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; // 0x10
1088 waveform_picker_regs->addr_data_f2 = current_ring_node_f2->buffer_address; // 0x10
1122 waveform_picker_regs->addr_data_f3 = current_ring_node_f3->buffer_address; // 0x14
1089 waveform_picker_regs->addr_data_f3 = current_ring_node_f3->buffer_address; // 0x14
1123 reset_wfp_status(); // 0x18
1090 reset_wfp_status(); // 0x18
1124 //
1091 //
1125 set_wfp_delta_snapshot(); // 0x1c
1092 set_wfp_delta_snapshot(); // 0x1c
1126 set_wfp_delta_f0_f0_2(); // 0x20, 0x24
1093 set_wfp_delta_f0_f0_2(); // 0x20, 0x24
1127 set_wfp_delta_f1(); // 0x28
1094 set_wfp_delta_f1(); // 0x28
1128 set_wfp_delta_f2(); // 0x2c
1095 set_wfp_delta_f2(); // 0x2c
1129 DEBUG_PRINTF1("delta_snapshot %x\n", waveform_picker_regs->delta_snapshot)
1096 DEBUG_PRINTF1("delta_snapshot %x\n", waveform_picker_regs->delta_snapshot)
1130 DEBUG_PRINTF1("delta_f0 %x\n", waveform_picker_regs->delta_f0)
1097 DEBUG_PRINTF1("delta_f0 %x\n", waveform_picker_regs->delta_f0)
1131 DEBUG_PRINTF1("delta_f0_2 %x\n", waveform_picker_regs->delta_f0_2)
1098 DEBUG_PRINTF1("delta_f0_2 %x\n", waveform_picker_regs->delta_f0_2)
1132 DEBUG_PRINTF1("delta_f1 %x\n", waveform_picker_regs->delta_f1)
1099 DEBUG_PRINTF1("delta_f1 %x\n", waveform_picker_regs->delta_f1)
1133 DEBUG_PRINTF1("delta_f2 %x\n", waveform_picker_regs->delta_f2)
1100 DEBUG_PRINTF1("delta_f2 %x\n", waveform_picker_regs->delta_f2)
1134 // 2688 = 8 * 336
1101 // 2688 = 8 * 336
1135 waveform_picker_regs->nb_data_by_buffer = 0xa7f; // 0x30 *** 2688 - 1 => nb samples -1
1102 waveform_picker_regs->nb_data_by_buffer = 0xa7f; // 0x30 *** 2688 - 1 => nb samples -1
1136 waveform_picker_regs->snapshot_param = 0xa80; // 0x34 *** 2688 => nb samples
1103 waveform_picker_regs->snapshot_param = 0xa80; // 0x34 *** 2688 => nb samples
1137 waveform_picker_regs->start_date = 0x00; // 0x38
1104 waveform_picker_regs->start_date = 0x00; // 0x38
1138 waveform_picker_regs->nb_word_in_buffer = 0x1f82; // 0x3c *** 2688 * 3 + 2 = 8066
1105 waveform_picker_regs->nb_word_in_buffer = 0x1f82; // 0x3c *** 2688 * 3 + 2 = 8066
1139 }
1106 }
1140
1107
1141 void set_wfp_data_shaping( void )
1108 void set_wfp_data_shaping( void )
1142 {
1109 {
1143 /** This function sets the data_shaping register of the waveform picker module.
1110 /** This function sets the data_shaping register of the waveform picker module.
1144 *
1111 *
1145 * The value is read from one field of the parameter_dump_packet structure:\n
1112 * The value is read from one field of the parameter_dump_packet structure:\n
1146 * bw_sp0_sp1_r0_r1
1113 * bw_sp0_sp1_r0_r1
1147 *
1114 *
1148 */
1115 */
1149
1116
1150 unsigned char data_shaping;
1117 unsigned char data_shaping;
1151
1118
1152 // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register
1119 // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register
1153 // waveform picker : [R1 R0 SP1 SP0 BW]
1120 // waveform picker : [R1 R0 SP1 SP0 BW]
1154
1121
1155 data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1;
1122 data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1;
1156
1123
1157 waveform_picker_regs->data_shaping =
1124 waveform_picker_regs->data_shaping =
1158 ( (data_shaping & 0x10) >> 4 ) // BW
1125 ( (data_shaping & 0x10) >> 4 ) // BW
1159 + ( (data_shaping & 0x08) >> 2 ) // SP0
1126 + ( (data_shaping & 0x08) >> 2 ) // SP0
1160 + ( (data_shaping & 0x04) ) // SP1
1127 + ( (data_shaping & 0x04) ) // SP1
1161 + ( (data_shaping & 0x02) << 2 ) // R0
1128 + ( (data_shaping & 0x02) << 2 ) // R0
1162 + ( (data_shaping & 0x01) << 4 ); // R1
1129 + ( (data_shaping & 0x01) << 4 ); // R1
1163 }
1130 }
1164
1131
1165 void set_wfp_burst_enable_register( unsigned char mode )
1132 void set_wfp_burst_enable_register( unsigned char mode )
1166 {
1133 {
1167 /** This function sets the waveform picker burst_enable register depending on the mode.
1134 /** This function sets the waveform picker burst_enable register depending on the mode.
1168 *
1135 *
1169 * @param mode is the LFR mode to launch.
1136 * @param mode is the LFR mode to launch.
1170 *
1137 *
1171 * The burst bits shall be before the enable bits.
1138 * The burst bits shall be before the enable bits.
1172 *
1139 *
1173 */
1140 */
1174
1141
1175 // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0
1142 // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0
1176 // the burst bits shall be set first, before the enable bits
1143 // the burst bits shall be set first, before the enable bits
1177 switch(mode) {
1144 switch(mode) {
1178 case(LFR_MODE_NORMAL):
1145 case(LFR_MODE_NORMAL):
1179 waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enable
1146 waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enable
1180 waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0
1147 waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0
1181 break;
1148 break;
1182 case(LFR_MODE_BURST):
1149 case(LFR_MODE_BURST):
1183 waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1150 waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1184 // waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2
1151 // waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2
1185 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0c; // [1100] enable f3 AND f2
1152 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0c; // [1100] enable f3 AND f2
1186 break;
1153 break;
1187 case(LFR_MODE_SBM1):
1154 case(LFR_MODE_SBM1):
1188 waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled
1155 waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled
1189 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
1156 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
1190 break;
1157 break;
1191 case(LFR_MODE_SBM2):
1158 case(LFR_MODE_SBM2):
1192 waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1159 waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled
1193 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
1160 waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0
1194 break;
1161 break;
1195 default:
1162 default:
1196 waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled
1163 waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled
1197 break;
1164 break;
1198 }
1165 }
1199 }
1166 }
1200
1167
1201 void set_wfp_delta_snapshot( void )
1168 void set_wfp_delta_snapshot( void )
1202 {
1169 {
1203 /** This function sets the delta_snapshot register of the waveform picker module.
1170 /** This function sets the delta_snapshot register of the waveform picker module.
1204 *
1171 *
1205 * The value is read from two (unsigned char) of the parameter_dump_packet structure:
1172 * The value is read from two (unsigned char) of the parameter_dump_packet structure:
1206 * - sy_lfr_n_swf_p[0]
1173 * - sy_lfr_n_swf_p[0]
1207 * - sy_lfr_n_swf_p[1]
1174 * - sy_lfr_n_swf_p[1]
1208 *
1175 *
1209 */
1176 */
1210
1177
1211 unsigned int delta_snapshot;
1178 unsigned int delta_snapshot;
1212 unsigned int delta_snapshot_in_T2;
1179 unsigned int delta_snapshot_in_T2;
1213
1180
1214 delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256
1181 delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256
1215 + parameter_dump_packet.sy_lfr_n_swf_p[1];
1182 + parameter_dump_packet.sy_lfr_n_swf_p[1];
1216
1183
1217 delta_snapshot_in_T2 = delta_snapshot * 256;
1184 delta_snapshot_in_T2 = delta_snapshot * 256;
1218 waveform_picker_regs->delta_snapshot = delta_snapshot_in_T2; // max 4 bytes
1185 waveform_picker_regs->delta_snapshot = delta_snapshot_in_T2; // max 4 bytes
1219 }
1186 }
1220
1187
1221 void set_wfp_delta_f0_f0_2( void )
1188 void set_wfp_delta_f0_f0_2( void )
1222 {
1189 {
1223 unsigned int delta_snapshot;
1190 unsigned int delta_snapshot;
1224 unsigned int nb_samples_per_snapshot;
1191 unsigned int nb_samples_per_snapshot;
1225 float delta_f0_in_float;
1192 float delta_f0_in_float;
1226
1193
1227 delta_snapshot = waveform_picker_regs->delta_snapshot;
1194 delta_snapshot = waveform_picker_regs->delta_snapshot;
1228 nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
1195 nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
1229 delta_f0_in_float =nb_samples_per_snapshot / 2. * ( 1. / 256. - 1. / 24576.) * 256.;
1196 delta_f0_in_float =nb_samples_per_snapshot / 2. * ( 1. / 256. - 1. / 24576.) * 256.;
1230
1197
1231 waveform_picker_regs->delta_f0 = delta_snapshot - floor( delta_f0_in_float );
1198 waveform_picker_regs->delta_f0 = delta_snapshot - floor( delta_f0_in_float );
1232 waveform_picker_regs->delta_f0_2 = 0x7; // max 7 bits
1199 waveform_picker_regs->delta_f0_2 = 0x7; // max 7 bits
1233 }
1200 }
1234
1201
1235 void set_wfp_delta_f1( void )
1202 void set_wfp_delta_f1( void )
1236 {
1203 {
1237 unsigned int delta_snapshot;
1204 unsigned int delta_snapshot;
1238 unsigned int nb_samples_per_snapshot;
1205 unsigned int nb_samples_per_snapshot;
1239 float delta_f1_in_float;
1206 float delta_f1_in_float;
1240
1207
1241 delta_snapshot = waveform_picker_regs->delta_snapshot;
1208 delta_snapshot = waveform_picker_regs->delta_snapshot;
1242 nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
1209 nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
1243 delta_f1_in_float = nb_samples_per_snapshot / 2. * ( 1. / 256. - 1. / 4096.) * 256.;
1210 delta_f1_in_float = nb_samples_per_snapshot / 2. * ( 1. / 256. - 1. / 4096.) * 256.;
1244
1211
1245 waveform_picker_regs->delta_f1 = delta_snapshot - floor( delta_f1_in_float );
1212 waveform_picker_regs->delta_f1 = delta_snapshot - floor( delta_f1_in_float );
1246 }
1213 }
1247
1214
1248 void set_wfp_delta_f2()
1215 void set_wfp_delta_f2()
1249 {
1216 {
1250 unsigned int delta_snapshot;
1217 unsigned int delta_snapshot;
1251 unsigned int nb_samples_per_snapshot;
1218 unsigned int nb_samples_per_snapshot;
1252
1219
1253 delta_snapshot = waveform_picker_regs->delta_snapshot;
1220 delta_snapshot = waveform_picker_regs->delta_snapshot;
1254 nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
1221 nb_samples_per_snapshot = parameter_dump_packet.sy_lfr_n_swf_l[0] * 256 + parameter_dump_packet.sy_lfr_n_swf_l[1];
1255
1222
1256 waveform_picker_regs->delta_f2 = delta_snapshot - nb_samples_per_snapshot / 2;
1223 waveform_picker_regs->delta_f2 = delta_snapshot - nb_samples_per_snapshot / 2;
1257 }
1224 }
1258
1225
1259 //*****************
1226 //*****************
1260 // local parameters
1227 // local parameters
1261 void set_local_nb_interrupt_f0_MAX( void )
1228 void set_local_nb_interrupt_f0_MAX( void )
1262 {
1229 {
1263 /** This function sets the value of the nb_interrupt_f0_MAX local parameter.
1230 /** This function sets the value of the nb_interrupt_f0_MAX local parameter.
1264 *
1231 *
1265 * This parameter is used for the SM validation only.\n
1232 * This parameter is used for the SM validation only.\n
1266 * The software waits param_local.local_nb_interrupt_f0_MAX interruptions from the spectral matrices
1233 * The software waits param_local.local_nb_interrupt_f0_MAX interruptions from the spectral matrices
1267 * module before launching a basic processing.
1234 * module before launching a basic processing.
1268 *
1235 *
1269 */
1236 */
1270
1237
1271 param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256
1238 param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256
1272 + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100;
1239 + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100;
1273 }
1240 }
1274
1241
1275 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid )
1242 void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid )
1276 {
1243 {
1277 unsigned short *sequence_cnt;
1244 unsigned short *sequence_cnt;
1278 unsigned short segmentation_grouping_flag;
1245 unsigned short segmentation_grouping_flag;
1279 unsigned short new_packet_sequence_control;
1246 unsigned short new_packet_sequence_control;
1280
1247
1281 if ( (sid ==SID_NORM_SWF_F0) || (sid ==SID_NORM_SWF_F1) || (sid ==SID_NORM_SWF_F2)
1248 if ( (sid ==SID_NORM_SWF_F0) || (sid ==SID_NORM_SWF_F1) || (sid ==SID_NORM_SWF_F2)
1282 || (sid ==SID_NORM_CWF_F3) || (sid==SID_NORM_CWF_LONG_F3) || (sid ==SID_BURST_CWF_F2) )
1249 || (sid ==SID_NORM_CWF_F3) || (sid==SID_NORM_CWF_LONG_F3) || (sid ==SID_BURST_CWF_F2) )
1283 {
1250 {
1284 sequence_cnt = (unsigned short *) &sequenceCounters_SCIENCE_NORMAL_BURST;
1251 sequence_cnt = (unsigned short *) &sequenceCounters_SCIENCE_NORMAL_BURST;
1285 }
1252 }
1286 else if ( (sid ==SID_SBM1_CWF_F1) || (sid ==SID_SBM2_CWF_F2) )
1253 else if ( (sid ==SID_SBM1_CWF_F1) || (sid ==SID_SBM2_CWF_F2) )
1287 {
1254 {
1288 sequence_cnt = (unsigned short *) &sequenceCounters_SCIENCE_SBM1_SBM2;
1255 sequence_cnt = (unsigned short *) &sequenceCounters_SCIENCE_SBM1_SBM2;
1289 }
1256 }
1290 else
1257 else
1291 {
1258 {
1292 sequence_cnt = (unsigned short *) NULL;
1259 sequence_cnt = (unsigned short *) NULL;
1293 PRINTF1("in increment_seq_counter_source_id *** ERR apid_destid %d not known\n", sid)
1260 PRINTF1("in increment_seq_counter_source_id *** ERR apid_destid %d not known\n", sid)
1294 }
1261 }
1295
1262
1296 if (sequence_cnt != NULL)
1263 if (sequence_cnt != NULL)
1297 {
1264 {
1298 // increment the sequence counter
1265 // increment the sequence counter
1299 if ( *sequence_cnt < SEQ_CNT_MAX)
1266 if ( *sequence_cnt < SEQ_CNT_MAX)
1300 {
1267 {
1301 *sequence_cnt = *sequence_cnt + 1;
1268 *sequence_cnt = *sequence_cnt + 1;
1302 }
1269 }
1303 else
1270 else
1304 {
1271 {
1305 *sequence_cnt = 0;
1272 *sequence_cnt = 0;
1306 }
1273 }
1307 segmentation_grouping_flag = TM_PACKET_SEQ_CTRL_STANDALONE << 8;
1274 segmentation_grouping_flag = TM_PACKET_SEQ_CTRL_STANDALONE << 8;
1308 *sequence_cnt = (*sequence_cnt) & 0x3fff;
1275 *sequence_cnt = (*sequence_cnt) & 0x3fff;
1309
1276
1310 new_packet_sequence_control = segmentation_grouping_flag | (*sequence_cnt) ;
1277 new_packet_sequence_control = segmentation_grouping_flag | (*sequence_cnt) ;
1311
1278
1312 packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8);
1279 packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8);
1313 packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control );
1280 packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control );
1314 }
1281 }
1315 }
1282 }
General Comments 0
You need to be logged in to leave comments. Login now