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