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