@@ -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: |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Dec 12 07:45:06 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=22 -DPRINT_MESSAGES_ON_CONSOLE |
|
13 | DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=22 -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,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.1, 2013-1 |
|
3 | <!-- Written by QtCreator 2.8.1, 2013-12-12T15:59:05. --> | |
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,87 +1,86 | |||||
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 unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; |
|
33 | extern unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; | |
34 | extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; |
|
34 | extern unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; | |
35 | extern unsigned short sequenceCounters_TC_EXE[]; |
|
35 | extern unsigned short sequenceCounters_TC_EXE[]; | |
36 |
|
36 | |||
37 | extern rtems_name misc_name[5]; |
|
37 | extern rtems_name misc_name[5]; | |
38 | extern rtems_name Task_name[20]; /* array of task ids */ |
|
38 | extern rtems_name Task_name[20]; /* array of task ids */ | |
39 | extern rtems_id Task_id[20]; /* array of task ids */ |
|
39 | extern rtems_id Task_id[20]; /* array of task ids */ | |
40 |
|
40 | |||
41 | extern unsigned char lfrCurrentMode; |
|
41 | extern unsigned char lfrCurrentMode; | |
42 |
|
42 | |||
43 | rtems_isr waveforms_isr( rtems_vector_number vector ); |
|
43 | rtems_isr waveforms_isr( rtems_vector_number vector ); | |
44 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ); |
|
44 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ); | |
45 | rtems_task wfrm_task( rtems_task_argument argument ); |
|
45 | rtems_task wfrm_task( rtems_task_argument argument ); | |
46 | rtems_task cwf3_task( rtems_task_argument argument ); |
|
46 | rtems_task cwf3_task( rtems_task_argument argument ); | |
47 | rtems_task cwf2_task( rtems_task_argument argument ); |
|
47 | rtems_task cwf2_task( rtems_task_argument argument ); | |
48 | rtems_task cwf1_task( rtems_task_argument argument ); |
|
48 | rtems_task cwf1_task( rtems_task_argument argument ); | |
49 |
|
49 | |||
50 | //****************** |
|
50 | //****************** | |
51 | // general functions |
|
51 | // general functions | |
52 | void init_waveforms( void ); |
|
52 | void init_waveforms( void ); | |
53 | // |
|
53 | // | |
54 | int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF ); |
|
54 | int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF ); | |
55 | int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF ); |
|
55 | int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF ); | |
56 | int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF ); |
|
56 | int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF ); | |
57 | // |
|
57 | // | |
58 | void reset_waveforms( void ); |
|
58 | void reset_waveforms( void ); | |
59 | // |
|
59 | // | |
60 | int send_waveform_SWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id ); |
|
60 | int send_waveform_SWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id ); | |
61 | int send_waveform_CWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); |
|
61 | int send_waveform_CWF( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); | |
62 | int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); |
|
62 | int send_waveform_CWF3( volatile int *waveform, unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); | |
63 | int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); |
|
63 | int send_waveform_CWF3_light( volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id ); | |
64 | // |
|
64 | // | |
65 | rtems_id get_pkts_queue_id( void ); |
|
65 | rtems_id get_pkts_queue_id( void ); | |
66 |
|
66 | |||
67 | //************** |
|
67 | //************** | |
68 | // wfp registers |
|
68 | // wfp registers | |
69 | void set_wfp_data_shaping(); |
|
69 | void set_wfp_data_shaping(); | |
70 | char set_wfp_delta_snapshot(); |
|
70 | char set_wfp_delta_snapshot(); | |
71 | void set_wfp_burst_enable_register( unsigned char mode); |
|
71 | void set_wfp_burst_enable_register( unsigned char mode); | |
72 | void reset_wfp_run_burst_enable(); |
|
72 | void reset_wfp_run_burst_enable(); | |
73 | void reset_wfp_status(); |
|
73 | void reset_wfp_status(); | |
74 | void reset_new_waveform_picker_regs(); |
|
74 | void reset_new_waveform_picker_regs(); | |
75 | unsigned int address_alignment( volatile int *address); |
|
|||
76 |
|
75 | |||
77 | //***************** |
|
76 | //***************** | |
78 | // local parameters |
|
77 | // local parameters | |
79 | void set_local_sbm1_nb_cwf_max(); |
|
78 | void set_local_sbm1_nb_cwf_max(); | |
80 | void set_local_sbm2_nb_cwf_max(); |
|
79 | void set_local_sbm2_nb_cwf_max(); | |
81 | void set_local_nb_interrupt_f0_MAX(); |
|
80 | void set_local_nb_interrupt_f0_MAX(); | |
82 | void reset_local_sbm1_nb_cwf_sent(); |
|
81 | void reset_local_sbm1_nb_cwf_sent(); | |
83 | void reset_local_sbm2_nb_cwf_sent(); |
|
82 | void reset_local_sbm2_nb_cwf_sent(); | |
84 |
|
83 | |||
85 | void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ); |
|
84 | void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ); | |
86 |
|
85 | |||
87 | #endif // WF_HANDLER_H_INCLUDED |
|
86 | #endif // WF_HANDLER_H_INCLUDED |
@@ -1,91 +1,91 | |||||
1 | /** Global variables of the LFR flight software. |
|
1 | /** Global variables of the LFR flight software. | |
2 | * |
|
2 | * | |
3 | * @file |
|
3 | * @file | |
4 | * @author P. LEROY |
|
4 | * @author P. LEROY | |
5 | * |
|
5 | * | |
6 | * Among global variables, there are: |
|
6 | * Among global variables, there are: | |
7 | * - RTEMS names and id. |
|
7 | * - RTEMS names and id. | |
8 | * - APB configuration registers. |
|
8 | * - APB configuration registers. | |
9 | * - waveforms global buffers, used by the waveform picker hardware module to store data. |
|
9 | * - waveforms global buffers, used by the waveform picker hardware module to store data. | |
10 | * - spectral matrices buffesr, used by the hardware module to store data. |
|
10 | * - spectral matrices buffesr, used by the hardware module to store data. | |
11 | * - variable related to LFR modes parameters. |
|
11 | * - variable related to LFR modes parameters. | |
12 | * - the global HK packet buffer. |
|
12 | * - the global HK packet buffer. | |
13 | * - the global dump parameter buffer. |
|
13 | * - the global dump parameter buffer. | |
14 | * |
|
14 | * | |
15 | */ |
|
15 | */ | |
16 |
|
16 | |||
17 | #include <rtems.h> |
|
17 | #include <rtems.h> | |
18 | #include <grspw.h> |
|
18 | #include <grspw.h> | |
19 |
|
19 | |||
20 | #include "ccsds_types.h" |
|
20 | #include "ccsds_types.h" | |
21 | #include "grlib_regs.h" |
|
21 | #include "grlib_regs.h" | |
22 | #include "fsw_params.h" |
|
22 | #include "fsw_params.h" | |
23 |
|
23 | |||
24 | // RTEMS GLOBAL VARIABLES |
|
24 | // RTEMS GLOBAL VARIABLES | |
25 | rtems_name misc_name[5]; |
|
25 | rtems_name misc_name[5]; | |
26 | rtems_id misc_id[5]; |
|
26 | rtems_id misc_id[5]; | |
27 | rtems_name Task_name[20]; /* array of task names */ |
|
27 | rtems_name Task_name[20]; /* array of task names */ | |
28 | rtems_id Task_id[20]; /* array of task ids */ |
|
28 | rtems_id Task_id[20]; /* array of task ids */ | |
29 | unsigned int maxCount; |
|
29 | unsigned int maxCount; | |
30 | int fdSPW = 0; |
|
30 | int fdSPW = 0; | |
31 | int fdUART = 0; |
|
31 | int fdUART = 0; | |
32 | unsigned char lfrCurrentMode; |
|
32 | unsigned char lfrCurrentMode; | |
33 |
|
33 | |||
34 | // APB CONFIGURATION REGISTERS |
|
34 | // APB CONFIGURATION REGISTERS | |
35 | time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT; |
|
35 | time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT; | |
36 | gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER; |
|
36 | gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER; | |
37 | #ifdef GSA |
|
37 | #ifdef GSA | |
38 | #else |
|
38 | #else | |
39 | new_waveform_picker_regs_t *new_waveform_picker_regs = (new_waveform_picker_regs_t*) REGS_ADDR_WAVEFORM_PICKER; |
|
39 | new_waveform_picker_regs_t *new_waveform_picker_regs = (new_waveform_picker_regs_t*) REGS_ADDR_WAVEFORM_PICKER; | |
40 | #endif |
|
40 | #endif | |
41 | spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX; |
|
41 | spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX; | |
42 |
|
42 | |||
43 | // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes |
|
43 | // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes | |
44 |
volatile int wf_snap_f0[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET |
|
44 | volatile int wf_snap_f0[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); | |
45 | // |
|
45 | // | |
46 |
volatile int wf_snap_f1[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET |
|
46 | volatile int wf_snap_f1[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); | |
47 |
volatile int wf_snap_f1_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET |
|
47 | volatile int wf_snap_f1_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); | |
48 |
volatile int wf_snap_f1_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET |
|
48 | volatile int wf_snap_f1_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); | |
49 | // |
|
49 | // | |
50 |
volatile int wf_snap_f2[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET |
|
50 | volatile int wf_snap_f2[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); | |
51 |
volatile int wf_snap_f2_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET |
|
51 | volatile int wf_snap_f2_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); | |
52 |
volatile int wf_snap_f2_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET |
|
52 | volatile int wf_snap_f2_norm[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); | |
53 | // |
|
53 | // | |
54 |
volatile int wf_cont_f3[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET |
|
54 | volatile int wf_cont_f3[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); | |
55 |
volatile int wf_cont_f3_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET |
|
55 | volatile int wf_cont_f3_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); | |
56 |
char wf_cont_f3_light[ NB_SAMPLES_PER_SNAPSHOT * NB_BYTES_CWF3_LIGHT_BLK |
|
56 | char wf_cont_f3_light[ NB_SAMPLES_PER_SNAPSHOT * NB_BYTES_CWF3_LIGHT_BLK ] __attribute__((aligned(0x100))); | |
57 |
|
57 | |||
58 | // SPECTRAL MATRICES GLOBAL VARIABLES |
|
58 | // SPECTRAL MATRICES GLOBAL VARIABLES | |
59 | volatile int spec_mat_f0_0[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
59 | volatile int spec_mat_f0_0[ SM_HEADER + TOTAL_SIZE_SM ]; | |
60 | volatile int spec_mat_f0_1[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
60 | volatile int spec_mat_f0_1[ SM_HEADER + TOTAL_SIZE_SM ]; | |
61 | volatile int spec_mat_f0_a[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
61 | volatile int spec_mat_f0_a[ SM_HEADER + TOTAL_SIZE_SM ]; | |
62 | volatile int spec_mat_f0_b[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
62 | volatile int spec_mat_f0_b[ SM_HEADER + TOTAL_SIZE_SM ]; | |
63 | volatile int spec_mat_f0_c[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
63 | volatile int spec_mat_f0_c[ SM_HEADER + TOTAL_SIZE_SM ]; | |
64 | volatile int spec_mat_f0_d[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
64 | volatile int spec_mat_f0_d[ SM_HEADER + TOTAL_SIZE_SM ]; | |
65 | volatile int spec_mat_f0_e[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
65 | volatile int spec_mat_f0_e[ SM_HEADER + TOTAL_SIZE_SM ]; | |
66 | volatile int spec_mat_f0_f[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
66 | volatile int spec_mat_f0_f[ SM_HEADER + TOTAL_SIZE_SM ]; | |
67 | volatile int spec_mat_f0_g[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
67 | volatile int spec_mat_f0_g[ SM_HEADER + TOTAL_SIZE_SM ]; | |
68 | volatile int spec_mat_f0_h[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
68 | volatile int spec_mat_f0_h[ SM_HEADER + TOTAL_SIZE_SM ]; | |
69 | volatile int spec_mat_f0_0_bis[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
69 | volatile int spec_mat_f0_0_bis[ SM_HEADER + TOTAL_SIZE_SM ]; | |
70 | volatile int spec_mat_f0_1_bis[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
70 | volatile int spec_mat_f0_1_bis[ SM_HEADER + TOTAL_SIZE_SM ]; | |
71 | // |
|
71 | // | |
72 | volatile int spec_mat_f1[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
72 | volatile int spec_mat_f1[ SM_HEADER + TOTAL_SIZE_SM ]; | |
73 | volatile int spec_mat_f1_bis[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
73 | volatile int spec_mat_f1_bis[ SM_HEADER + TOTAL_SIZE_SM ]; | |
74 | // |
|
74 | // | |
75 | volatile int spec_mat_f2[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
75 | volatile int spec_mat_f2[ SM_HEADER + TOTAL_SIZE_SM ]; | |
76 | volatile int spec_mat_f2_bis[ SM_HEADER + TOTAL_SIZE_SM ]; |
|
76 | volatile int spec_mat_f2_bis[ SM_HEADER + TOTAL_SIZE_SM ]; | |
77 |
|
77 | |||
78 | // MODE PARAMETERS |
|
78 | // MODE PARAMETERS | |
79 | Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; |
|
79 | Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; | |
80 | struct param_local_str param_local; |
|
80 | struct param_local_str param_local; | |
81 |
|
81 | |||
82 | // HK PACKETS |
|
82 | // HK PACKETS | |
83 | Packet_TM_LFR_HK_t housekeeping_packet; |
|
83 | Packet_TM_LFR_HK_t housekeeping_packet; | |
84 | // sequence counters are incremented by APID (PID + CAT) and destination ID |
|
84 | // sequence counters are incremented by APID (PID + CAT) and destination ID | |
85 | unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; |
|
85 | unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; | |
86 | unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; |
|
86 | unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; | |
87 | unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID]; |
|
87 | unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID]; | |
88 | spw_stats spacewire_stats; |
|
88 | spw_stats spacewire_stats; | |
89 | spw_stats spacewire_stats_backup; |
|
89 | spw_stats spacewire_stats_backup; | |
90 |
|
90 | |||
91 |
|
91 |
@@ -1,772 +1,776 | |||||
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_run_burst_enable(); // reset run, burst and enable bits, [r b2 b1 b0 e3 e2 e1 e0] |
|
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 | int startDate; | |
468 |
|
468 | |||
469 | status = restart_science_tasks(); |
|
469 | status = restart_science_tasks(); | |
470 |
|
470 | |||
471 | #ifdef GSA |
|
471 | #ifdef GSA | |
472 | timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR ); |
|
472 | timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR ); | |
473 | timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR ); |
|
473 | timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR ); | |
474 | LEON_Clear_interrupt( IRQ_WF ); |
|
474 | LEON_Clear_interrupt( IRQ_WF ); | |
475 | LEON_Unmask_interrupt( IRQ_WF ); |
|
475 | LEON_Unmask_interrupt( IRQ_WF ); | |
476 | // |
|
476 | // | |
477 | set_local_nb_interrupt_f0_MAX(); |
|
477 | set_local_nb_interrupt_f0_MAX(); | |
478 | 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 | |
479 | LEON_Unmask_interrupt( IRQ_SM ); |
|
479 | LEON_Unmask_interrupt( IRQ_SM ); | |
480 | #else |
|
480 | #else | |
481 | //**************** |
|
481 | //**************** | |
482 | // waveform picker |
|
482 | // waveform picker | |
483 | reset_new_waveform_picker_regs(); |
|
483 | reset_new_waveform_picker_regs(); | |
484 | set_wfp_burst_enable_register( LFR_MODE_NORMAL ); |
|
484 | set_wfp_burst_enable_register( LFR_MODE_NORMAL ); | |
485 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
485 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); | |
486 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
486 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); | |
487 | startDate = time_management_regs->coarse_time + 2; |
|
487 | startDate = time_management_regs->coarse_time + 2; | |
488 | new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x80; // [1000 0000] |
|
488 | new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x80; // [1000 0000] | |
489 | new_waveform_picker_regs->start_date = startDate; |
|
489 | new_waveform_picker_regs->start_date = startDate; | |
490 | //**************** |
|
490 | //**************** | |
491 | // spectral matrix |
|
491 | // spectral matrix | |
492 | #endif |
|
492 | #endif | |
493 |
|
493 | |||
494 | return status; |
|
494 | return status; | |
495 | } |
|
495 | } | |
496 |
|
496 | |||
497 | int enter_burst_mode() |
|
497 | int enter_burst_mode() | |
498 | { |
|
498 | { | |
499 | rtems_status_code status; |
|
499 | rtems_status_code status; | |
500 |
|
500 | |||
501 | status = restart_science_tasks(); |
|
501 | status = restart_science_tasks(); | |
502 |
|
502 | |||
503 | #ifdef GSA |
|
503 | #ifdef GSA | |
504 | LEON_Unmask_interrupt( IRQ_SM ); |
|
504 | LEON_Unmask_interrupt( IRQ_SM ); | |
505 | #else |
|
505 | #else | |
506 | reset_new_waveform_picker_regs(); |
|
506 | reset_new_waveform_picker_regs(); | |
507 | set_wfp_burst_enable_register(LFR_MODE_BURST); |
|
507 | set_wfp_burst_enable_register(LFR_MODE_BURST); | |
508 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
508 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); | |
509 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
509 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); | |
510 | #endif |
|
510 | #endif | |
511 |
|
511 | |||
512 | return status; |
|
512 | return status; | |
513 | } |
|
513 | } | |
514 |
|
514 | |||
515 | int enter_sbm1_mode() |
|
515 | int enter_sbm1_mode() | |
516 | { |
|
516 | { | |
517 | rtems_status_code status; |
|
517 | rtems_status_code status; | |
|
518 | int startDate; | |||
518 |
|
519 | |||
519 | status = restart_science_tasks(); |
|
520 | status = restart_science_tasks(); | |
520 |
|
521 | |||
521 | set_local_sbm1_nb_cwf_max(); |
|
522 | set_local_sbm1_nb_cwf_max(); | |
522 |
|
523 | |||
523 | reset_local_sbm1_nb_cwf_sent(); |
|
524 | reset_local_sbm1_nb_cwf_sent(); | |
524 |
|
525 | |||
525 | #ifdef GSA |
|
526 | #ifdef GSA | |
526 | LEON_Unmask_interrupt( IRQ_SM ); |
|
527 | LEON_Unmask_interrupt( IRQ_SM ); | |
527 | #else |
|
528 | #else | |
|
529 | //**************** | |||
|
530 | // waveform picker | |||
528 | reset_new_waveform_picker_regs(); |
|
531 | reset_new_waveform_picker_regs(); | |
529 | set_wfp_burst_enable_register(LFR_MODE_SBM1); |
|
532 | set_wfp_burst_enable_register( LFR_MODE_SBM1 ); | |
530 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
533 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); | |
531 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
534 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); | |
532 | // SM simulation |
|
535 | startDate = time_management_regs->coarse_time + 2; | |
533 | // timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR ); |
|
536 | new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x80; // [1000 0000] | |
534 | // LEON_Clear_interrupt( IRQ_SM ); // the IRQ_SM seems to be incompatible with the IRQ_WF on the xilinx board |
|
537 | new_waveform_picker_regs->start_date = startDate; | |
535 | // LEON_Unmask_interrupt( IRQ_SM ); |
|
538 | //**************** | |
|
539 | // spectral matrix | |||
536 | #endif |
|
540 | #endif | |
537 |
|
541 | |||
538 | return status; |
|
542 | return status; | |
539 | } |
|
543 | } | |
540 |
|
544 | |||
541 | int enter_sbm2_mode() |
|
545 | int enter_sbm2_mode() | |
542 | { |
|
546 | { | |
543 | rtems_status_code status; |
|
547 | rtems_status_code status; | |
544 |
|
548 | |||
545 | status = restart_science_tasks(); |
|
549 | status = restart_science_tasks(); | |
546 |
|
550 | |||
547 | set_local_sbm2_nb_cwf_max(); |
|
551 | set_local_sbm2_nb_cwf_max(); | |
548 |
|
552 | |||
549 | reset_local_sbm2_nb_cwf_sent(); |
|
553 | reset_local_sbm2_nb_cwf_sent(); | |
550 |
|
554 | |||
551 | #ifdef GSA |
|
555 | #ifdef GSA | |
552 | LEON_Unmask_interrupt( IRQ_SM ); |
|
556 | LEON_Unmask_interrupt( IRQ_SM ); | |
553 | #else |
|
557 | #else | |
554 | reset_new_waveform_picker_regs(); |
|
558 | reset_new_waveform_picker_regs(); | |
555 | set_wfp_burst_enable_register(LFR_MODE_SBM2); |
|
559 | set_wfp_burst_enable_register(LFR_MODE_SBM2); | |
556 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
560 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); | |
557 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
561 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); | |
558 | #endif |
|
562 | #endif | |
559 |
|
563 | |||
560 | return status; |
|
564 | return status; | |
561 | } |
|
565 | } | |
562 |
|
566 | |||
563 | int restart_science_tasks() |
|
567 | int restart_science_tasks() | |
564 | { |
|
568 | { | |
565 | rtems_status_code status[6]; |
|
569 | rtems_status_code status[6]; | |
566 | rtems_status_code ret; |
|
570 | rtems_status_code ret; | |
567 |
|
571 | |||
568 | ret = RTEMS_SUCCESSFUL; |
|
572 | ret = RTEMS_SUCCESSFUL; | |
569 |
|
573 | |||
570 | status[0] = rtems_task_restart( Task_id[TASKID_AVF0], 1 ); |
|
574 | status[0] = rtems_task_restart( Task_id[TASKID_AVF0], 1 ); | |
571 | if (status[0] != RTEMS_SUCCESSFUL) |
|
575 | if (status[0] != RTEMS_SUCCESSFUL) | |
572 | { |
|
576 | { | |
573 | PRINTF1("in restart_science_task *** 0 ERR %d\n", status[0]) |
|
577 | PRINTF1("in restart_science_task *** 0 ERR %d\n", status[0]) | |
574 | } |
|
578 | } | |
575 |
|
579 | |||
576 | status[1] = rtems_task_restart( Task_id[TASKID_BPF0],1 ); |
|
580 | status[1] = rtems_task_restart( Task_id[TASKID_BPF0],1 ); | |
577 | if (status[1] != RTEMS_SUCCESSFUL) |
|
581 | if (status[1] != RTEMS_SUCCESSFUL) | |
578 | { |
|
582 | { | |
579 | PRINTF1("in restart_science_task *** 1 ERR %d\n", status[1]) |
|
583 | PRINTF1("in restart_science_task *** 1 ERR %d\n", status[1]) | |
580 | } |
|
584 | } | |
581 |
|
585 | |||
582 | status[2] = rtems_task_restart( Task_id[TASKID_WFRM],1 ); |
|
586 | status[2] = rtems_task_restart( Task_id[TASKID_WFRM],1 ); | |
583 | if (status[2] != RTEMS_SUCCESSFUL) |
|
587 | if (status[2] != RTEMS_SUCCESSFUL) | |
584 | { |
|
588 | { | |
585 | PRINTF1("in restart_science_task *** 2 ERR %d\n", status[2]) |
|
589 | PRINTF1("in restart_science_task *** 2 ERR %d\n", status[2]) | |
586 | } |
|
590 | } | |
587 |
|
591 | |||
588 | status[3] = rtems_task_restart( Task_id[TASKID_CWF3],1 ); |
|
592 | status[3] = rtems_task_restart( Task_id[TASKID_CWF3],1 ); | |
589 | if (status[3] != RTEMS_SUCCESSFUL) |
|
593 | if (status[3] != RTEMS_SUCCESSFUL) | |
590 | { |
|
594 | { | |
591 | PRINTF1("in restart_science_task *** 3 ERR %d\n", status[3]) |
|
595 | PRINTF1("in restart_science_task *** 3 ERR %d\n", status[3]) | |
592 | } |
|
596 | } | |
593 |
|
597 | |||
594 | status[4] = rtems_task_restart( Task_id[TASKID_CWF2],1 ); |
|
598 | status[4] = rtems_task_restart( Task_id[TASKID_CWF2],1 ); | |
595 | if (status[4] != RTEMS_SUCCESSFUL) |
|
599 | if (status[4] != RTEMS_SUCCESSFUL) | |
596 | { |
|
600 | { | |
597 | PRINTF1("in restart_science_task *** 4 ERR %d\n", status[4]) |
|
601 | PRINTF1("in restart_science_task *** 4 ERR %d\n", status[4]) | |
598 | } |
|
602 | } | |
599 |
|
603 | |||
600 | status[5] = rtems_task_restart( Task_id[TASKID_CWF1],1 ); |
|
604 | status[5] = rtems_task_restart( Task_id[TASKID_CWF1],1 ); | |
601 | if (status[5] != RTEMS_SUCCESSFUL) |
|
605 | if (status[5] != RTEMS_SUCCESSFUL) | |
602 | { |
|
606 | { | |
603 | PRINTF1("in restart_science_task *** 5 ERR %d\n", status[5]) |
|
607 | PRINTF1("in restart_science_task *** 5 ERR %d\n", status[5]) | |
604 | } |
|
608 | } | |
605 |
|
609 | |||
606 | if ( (status[0] != RTEMS_SUCCESSFUL) || (status[1] != RTEMS_SUCCESSFUL) || (status[2] != RTEMS_SUCCESSFUL) || |
|
610 | if ( (status[0] != RTEMS_SUCCESSFUL) || (status[1] != RTEMS_SUCCESSFUL) || (status[2] != RTEMS_SUCCESSFUL) || | |
607 | (status[3] != RTEMS_SUCCESSFUL) || (status[4] != RTEMS_SUCCESSFUL) || (status[5] != RTEMS_SUCCESSFUL) ) |
|
611 | (status[3] != RTEMS_SUCCESSFUL) || (status[4] != RTEMS_SUCCESSFUL) || (status[5] != RTEMS_SUCCESSFUL) ) | |
608 | { |
|
612 | { | |
609 | ret = RTEMS_UNSATISFIED; |
|
613 | ret = RTEMS_UNSATISFIED; | |
610 | } |
|
614 | } | |
611 |
|
615 | |||
612 | return ret; |
|
616 | return ret; | |
613 | } |
|
617 | } | |
614 |
|
618 | |||
615 | int suspend_science_tasks() |
|
619 | int suspend_science_tasks() | |
616 | { |
|
620 | { | |
617 | /** This function suspends the science tasks. |
|
621 | /** This function suspends the science tasks. | |
618 | * |
|
622 | * | |
619 | * @return RTEMS directive status codes: |
|
623 | * @return RTEMS directive status codes: | |
620 | * - RTEMS_SUCCESSFUL - task restarted successfully |
|
624 | * - RTEMS_SUCCESSFUL - task restarted successfully | |
621 | * - RTEMS_INVALID_ID - task id invalid |
|
625 | * - RTEMS_INVALID_ID - task id invalid | |
622 | * - RTEMS_ALREADY_SUSPENDED - task already suspended |
|
626 | * - RTEMS_ALREADY_SUSPENDED - task already suspended | |
623 | * |
|
627 | * | |
624 | */ |
|
628 | */ | |
625 |
|
629 | |||
626 | rtems_status_code status; |
|
630 | rtems_status_code status; | |
627 |
|
631 | |||
628 | status = rtems_task_suspend( Task_id[TASKID_AVF0] ); |
|
632 | status = rtems_task_suspend( Task_id[TASKID_AVF0] ); | |
629 | if (status != RTEMS_SUCCESSFUL) |
|
633 | if (status != RTEMS_SUCCESSFUL) | |
630 | { |
|
634 | { | |
631 | PRINTF1("in suspend_science_task *** AVF0 ERR %d\n", status) |
|
635 | PRINTF1("in suspend_science_task *** AVF0 ERR %d\n", status) | |
632 | } |
|
636 | } | |
633 |
|
637 | |||
634 | if (status == RTEMS_SUCCESSFUL) // suspend BPF0 |
|
638 | if (status == RTEMS_SUCCESSFUL) // suspend BPF0 | |
635 | { |
|
639 | { | |
636 | status = rtems_task_suspend( Task_id[TASKID_BPF0] ); |
|
640 | status = rtems_task_suspend( Task_id[TASKID_BPF0] ); | |
637 | if (status != RTEMS_SUCCESSFUL) |
|
641 | if (status != RTEMS_SUCCESSFUL) | |
638 | { |
|
642 | { | |
639 | PRINTF1("in suspend_science_task *** BPF0 ERR %d\n", status) |
|
643 | PRINTF1("in suspend_science_task *** BPF0 ERR %d\n", status) | |
640 | } |
|
644 | } | |
641 | } |
|
645 | } | |
642 |
|
646 | |||
643 | if (status == RTEMS_SUCCESSFUL) // suspend WFRM |
|
647 | if (status == RTEMS_SUCCESSFUL) // suspend WFRM | |
644 | { |
|
648 | { | |
645 | status = rtems_task_suspend( Task_id[TASKID_WFRM] ); |
|
649 | status = rtems_task_suspend( Task_id[TASKID_WFRM] ); | |
646 | if (status != RTEMS_SUCCESSFUL) |
|
650 | if (status != RTEMS_SUCCESSFUL) | |
647 | { |
|
651 | { | |
648 | PRINTF1("in suspend_science_task *** WFRM ERR %d\n", status) |
|
652 | PRINTF1("in suspend_science_task *** WFRM ERR %d\n", status) | |
649 | } |
|
653 | } | |
650 | } |
|
654 | } | |
651 |
|
655 | |||
652 | if (status == RTEMS_SUCCESSFUL) // suspend CWF3 |
|
656 | if (status == RTEMS_SUCCESSFUL) // suspend CWF3 | |
653 | { |
|
657 | { | |
654 | status = rtems_task_suspend( Task_id[TASKID_CWF3] ); |
|
658 | status = rtems_task_suspend( Task_id[TASKID_CWF3] ); | |
655 | if (status != RTEMS_SUCCESSFUL) |
|
659 | if (status != RTEMS_SUCCESSFUL) | |
656 | { |
|
660 | { | |
657 | PRINTF1("in suspend_science_task *** CWF3 ERR %d\n", status) |
|
661 | PRINTF1("in suspend_science_task *** CWF3 ERR %d\n", status) | |
658 | } |
|
662 | } | |
659 | } |
|
663 | } | |
660 |
|
664 | |||
661 | if (status == RTEMS_SUCCESSFUL) // suspend CWF2 |
|
665 | if (status == RTEMS_SUCCESSFUL) // suspend CWF2 | |
662 | { |
|
666 | { | |
663 | status = rtems_task_suspend( Task_id[TASKID_CWF2] ); |
|
667 | status = rtems_task_suspend( Task_id[TASKID_CWF2] ); | |
664 | if (status != RTEMS_SUCCESSFUL) |
|
668 | if (status != RTEMS_SUCCESSFUL) | |
665 | { |
|
669 | { | |
666 | PRINTF1("in suspend_science_task *** CWF2 ERR %d\n", status) |
|
670 | PRINTF1("in suspend_science_task *** CWF2 ERR %d\n", status) | |
667 | } |
|
671 | } | |
668 | } |
|
672 | } | |
669 |
|
673 | |||
670 | if (status == RTEMS_SUCCESSFUL) // suspend CWF1 |
|
674 | if (status == RTEMS_SUCCESSFUL) // suspend CWF1 | |
671 | { |
|
675 | { | |
672 | status = rtems_task_suspend( Task_id[TASKID_CWF1] ); |
|
676 | status = rtems_task_suspend( Task_id[TASKID_CWF1] ); | |
673 | if (status != RTEMS_SUCCESSFUL) |
|
677 | if (status != RTEMS_SUCCESSFUL) | |
674 | { |
|
678 | { | |
675 | PRINTF1("in suspend_science_task *** CWF1 ERR %d\n", status) |
|
679 | PRINTF1("in suspend_science_task *** CWF1 ERR %d\n", status) | |
676 | } |
|
680 | } | |
677 | } |
|
681 | } | |
678 |
|
682 | |||
679 | return status; |
|
683 | return status; | |
680 | } |
|
684 | } | |
681 |
|
685 | |||
682 | //**************** |
|
686 | //**************** | |
683 | // CLOSING ACTIONS |
|
687 | // CLOSING ACTIONS | |
684 | void update_last_TC_exe(ccsdsTelecommandPacket_t *TC) |
|
688 | void update_last_TC_exe(ccsdsTelecommandPacket_t *TC) | |
685 | { |
|
689 | { | |
686 | housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0]; |
|
690 | housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0]; | |
687 | housekeeping_packet.hk_lfr_last_exe_tc_id[1] = TC->packetID[1]; |
|
691 | housekeeping_packet.hk_lfr_last_exe_tc_id[1] = TC->packetID[1]; | |
688 | housekeeping_packet.hk_lfr_last_exe_tc_type[0] = 0x00; |
|
692 | housekeeping_packet.hk_lfr_last_exe_tc_type[0] = 0x00; | |
689 | housekeeping_packet.hk_lfr_last_exe_tc_type[1] = TC->serviceType; |
|
693 | housekeeping_packet.hk_lfr_last_exe_tc_type[1] = TC->serviceType; | |
690 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[0] = 0x00; |
|
694 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[0] = 0x00; | |
691 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[1] = TC->serviceSubType; |
|
695 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[1] = TC->serviceSubType; | |
692 | housekeeping_packet.hk_lfr_last_exe_tc_time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
696 | housekeeping_packet.hk_lfr_last_exe_tc_time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
693 | housekeeping_packet.hk_lfr_last_exe_tc_time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
697 | housekeeping_packet.hk_lfr_last_exe_tc_time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
694 | housekeeping_packet.hk_lfr_last_exe_tc_time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
698 | housekeeping_packet.hk_lfr_last_exe_tc_time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
695 | housekeeping_packet.hk_lfr_last_exe_tc_time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
699 | housekeeping_packet.hk_lfr_last_exe_tc_time[3] = (unsigned char) (time_management_regs->coarse_time); | |
696 | housekeeping_packet.hk_lfr_last_exe_tc_time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
700 | housekeeping_packet.hk_lfr_last_exe_tc_time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
697 | housekeeping_packet.hk_lfr_last_exe_tc_time[5] = (unsigned char) (time_management_regs->fine_time); |
|
701 | housekeeping_packet.hk_lfr_last_exe_tc_time[5] = (unsigned char) (time_management_regs->fine_time); | |
698 | } |
|
702 | } | |
699 |
|
703 | |||
700 | void update_last_TC_rej(ccsdsTelecommandPacket_t *TC) |
|
704 | void update_last_TC_rej(ccsdsTelecommandPacket_t *TC) | |
701 | { |
|
705 | { | |
702 | housekeeping_packet.hk_lfr_last_rej_tc_id[0] = TC->packetID[0]; |
|
706 | housekeeping_packet.hk_lfr_last_rej_tc_id[0] = TC->packetID[0]; | |
703 | housekeeping_packet.hk_lfr_last_rej_tc_id[1] = TC->packetID[1]; |
|
707 | housekeeping_packet.hk_lfr_last_rej_tc_id[1] = TC->packetID[1]; | |
704 | housekeeping_packet.hk_lfr_last_rej_tc_type[0] = 0x00; |
|
708 | housekeeping_packet.hk_lfr_last_rej_tc_type[0] = 0x00; | |
705 | housekeeping_packet.hk_lfr_last_rej_tc_type[1] = TC->serviceType; |
|
709 | housekeeping_packet.hk_lfr_last_rej_tc_type[1] = TC->serviceType; | |
706 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[0] = 0x00; |
|
710 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[0] = 0x00; | |
707 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[1] = TC->serviceSubType; |
|
711 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[1] = TC->serviceSubType; | |
708 | housekeeping_packet.hk_lfr_last_rej_tc_time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
712 | housekeeping_packet.hk_lfr_last_rej_tc_time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
709 | housekeeping_packet.hk_lfr_last_rej_tc_time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
713 | housekeeping_packet.hk_lfr_last_rej_tc_time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
710 | housekeeping_packet.hk_lfr_last_rej_tc_time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
714 | housekeeping_packet.hk_lfr_last_rej_tc_time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
711 | housekeeping_packet.hk_lfr_last_rej_tc_time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
715 | housekeeping_packet.hk_lfr_last_rej_tc_time[3] = (unsigned char) (time_management_regs->coarse_time); | |
712 | housekeeping_packet.hk_lfr_last_rej_tc_time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
716 | housekeeping_packet.hk_lfr_last_rej_tc_time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
713 | housekeeping_packet.hk_lfr_last_rej_tc_time[5] = (unsigned char) (time_management_regs->fine_time); |
|
717 | housekeeping_packet.hk_lfr_last_rej_tc_time[5] = (unsigned char) (time_management_regs->fine_time); | |
714 | } |
|
718 | } | |
715 |
|
719 | |||
716 | void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id) |
|
720 | void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id) | |
717 | { |
|
721 | { | |
718 | unsigned int val = 0; |
|
722 | unsigned int val = 0; | |
719 | if (result == LFR_SUCCESSFUL) |
|
723 | if (result == LFR_SUCCESSFUL) | |
720 | { |
|
724 | { | |
721 | if ( !( (TC->serviceType==TC_TYPE_TIME) && (TC->serviceSubType==TC_SUBTYPE_UPDT_TIME) ) |
|
725 | if ( !( (TC->serviceType==TC_TYPE_TIME) && (TC->serviceSubType==TC_SUBTYPE_UPDT_TIME) ) | |
722 | && |
|
726 | && | |
723 | !( (TC->serviceType==TC_TYPE_GEN) && (TC->serviceSubType==TC_SUBTYPE_UPDT_INFO)) |
|
727 | !( (TC->serviceType==TC_TYPE_GEN) && (TC->serviceSubType==TC_SUBTYPE_UPDT_INFO)) | |
724 | ) |
|
728 | ) | |
725 | { |
|
729 | { | |
726 | send_tm_lfr_tc_exe_success( TC, queue_id ); |
|
730 | send_tm_lfr_tc_exe_success( TC, queue_id ); | |
727 | } |
|
731 | } | |
728 | update_last_TC_exe( TC ); |
|
732 | update_last_TC_exe( TC ); | |
729 | val = housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[0] * 256 + housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[1]; |
|
733 | val = housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[0] * 256 + housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[1]; | |
730 | val++; |
|
734 | val++; | |
731 | housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[0] = (unsigned char) (val >> 8); |
|
735 | housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[0] = (unsigned char) (val >> 8); | |
732 | housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[1] = (unsigned char) (val); |
|
736 | housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[1] = (unsigned char) (val); | |
733 | } |
|
737 | } | |
734 | else |
|
738 | else | |
735 | { |
|
739 | { | |
736 | update_last_TC_rej( TC ); |
|
740 | update_last_TC_rej( TC ); | |
737 | val = housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[0] * 256 + housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[1]; |
|
741 | val = housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[0] * 256 + housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[1]; | |
738 | val++; |
|
742 | val++; | |
739 | housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[0] = (unsigned char) (val >> 8); |
|
743 | housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[0] = (unsigned char) (val >> 8); | |
740 | housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[1] = (unsigned char) (val); |
|
744 | housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[1] = (unsigned char) (val); | |
741 | } |
|
745 | } | |
742 | } |
|
746 | } | |
743 |
|
747 | |||
744 | //*************************** |
|
748 | //*************************** | |
745 | // Interrupt Service Routines |
|
749 | // Interrupt Service Routines | |
746 | rtems_isr commutation_isr1( rtems_vector_number vector ) |
|
750 | rtems_isr commutation_isr1( rtems_vector_number vector ) | |
747 | { |
|
751 | { | |
748 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
752 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
749 | printf("In commutation_isr1 *** Error sending event to DUMB\n"); |
|
753 | printf("In commutation_isr1 *** Error sending event to DUMB\n"); | |
750 | } |
|
754 | } | |
751 | } |
|
755 | } | |
752 |
|
756 | |||
753 | rtems_isr commutation_isr2( rtems_vector_number vector ) |
|
757 | rtems_isr commutation_isr2( rtems_vector_number vector ) | |
754 | { |
|
758 | { | |
755 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
759 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
756 | printf("In commutation_isr2 *** Error sending event to DUMB\n"); |
|
760 | printf("In commutation_isr2 *** Error sending event to DUMB\n"); | |
757 | } |
|
761 | } | |
758 | } |
|
762 | } | |
759 |
|
763 | |||
760 | //**************** |
|
764 | //**************** | |
761 | // OTHER FUNCTIONS |
|
765 | // OTHER FUNCTIONS | |
762 | void updateLFRCurrentMode() |
|
766 | void updateLFRCurrentMode() | |
763 | { |
|
767 | { | |
764 | /** This function updates the value of the global variable lfrCurrentMode. |
|
768 | /** This function updates the value of the global variable lfrCurrentMode. | |
765 | * |
|
769 | * | |
766 | * lfrCurrentMode is a parameter used by several functions to know in which mode LFR is running. |
|
770 | * lfrCurrentMode is a parameter used by several functions to know in which mode LFR is running. | |
767 | * |
|
771 | * | |
768 | */ |
|
772 | */ | |
769 | // update the local value of lfrCurrentMode with the value contained in the housekeeping_packet structure |
|
773 | // update the local value of lfrCurrentMode with the value contained in the housekeeping_packet structure | |
770 | lfrCurrentMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
774 | lfrCurrentMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
771 | } |
|
775 | } | |
772 |
|
776 |
@@ -1,1351 +1,1242 | |||||
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 | unsigned char fullRecord; |
|
25 | unsigned char fullRecord; | |
26 |
|
26 | |||
27 | rtems_isr waveforms_isr( rtems_vector_number vector ) |
|
27 | rtems_isr waveforms_isr( rtems_vector_number vector ) | |
28 | { |
|
28 | { | |
29 | unsigned int statusReg; |
|
29 | unsigned int statusReg; | |
30 |
|
30 | |||
31 | /** This is the interrupt sub routine called by the waveform picker core. |
|
31 | /** This is the interrupt sub routine called by the waveform picker core. | |
32 | * |
|
32 | * | |
33 | * This ISR launch different actions depending mainly on two pieces of information: |
|
33 | * This ISR launch different actions depending mainly on two pieces of information: | |
34 | * 1. the values read in the registers of the waveform picker. |
|
34 | * 1. the values read in the registers of the waveform picker. | |
35 | * 2. the current LFR mode. |
|
35 | * 2. the current LFR mode. | |
36 | * |
|
36 | * | |
37 | */ |
|
37 | */ | |
38 |
|
38 | |||
39 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff00f; // clear new_err and full_err |
|
39 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff00f; // clear new_err and full_err | |
40 |
|
40 | |||
41 | #ifdef GSA |
|
41 | #ifdef GSA | |
42 | #else |
|
42 | #else | |
43 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) |
|
43 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
44 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
44 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
45 | { // in modes other than STANDBY and BURST, send the CWF_F3 data |
|
45 | { // in modes other than STANDBY and BURST, send the CWF_F3 data | |
46 | if ((new_waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full |
|
46 | if ((new_waveform_picker_regs->status & 0x08) == 0x08){ // [1000] f3 is full | |
47 | // (1) change the receiving buffer for the waveform picker |
|
47 | // (1) change the receiving buffer for the waveform picker | |
48 | if (new_waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) { |
|
48 | if (new_waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) { | |
49 | new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_bis); |
|
49 | new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_bis); | |
50 | } |
|
50 | } | |
51 | else { |
|
51 | else { | |
52 | new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); |
|
52 | new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); | |
53 | } |
|
53 | } | |
54 | // (2) send an event for the waveforms transmission |
|
54 | // (2) send an event for the waveforms transmission | |
55 | if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
55 | if (rtems_event_send( Task_id[TASKID_CWF3], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
56 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
56 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
57 | } |
|
57 | } | |
58 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111] |
|
58 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff777; // reset f3 bits to 0, [1111 0111 0111 0111] | |
59 | } |
|
59 | } | |
60 | } |
|
60 | } | |
61 | #endif |
|
61 | #endif | |
62 |
|
62 | |||
63 | switch(lfrCurrentMode) |
|
63 | switch(lfrCurrentMode) | |
64 | { |
|
64 | { | |
65 | //******** |
|
65 | //******** | |
66 | // STANDBY |
|
66 | // STANDBY | |
67 | case(LFR_MODE_STANDBY): |
|
67 | case(LFR_MODE_STANDBY): | |
68 | break; |
|
68 | break; | |
69 |
|
69 | |||
70 | //****** |
|
70 | //****** | |
71 | // NORMAL |
|
71 | // NORMAL | |
72 | case(LFR_MODE_NORMAL): |
|
72 | case(LFR_MODE_NORMAL): | |
73 | #ifdef GSA |
|
73 | #ifdef GSA | |
74 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") |
|
74 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") | |
75 | #else |
|
75 | #else | |
76 | statusReg = new_waveform_picker_regs->status; |
|
76 | statusReg = new_waveform_picker_regs->status; | |
77 | fullRecord = fullRecord | ( statusReg & 0x7 ); |
|
77 | fullRecord = fullRecord | ( statusReg & 0x7 ); | |
78 |
|
|
78 | if ( (new_waveform_picker_regs->status & 0x7) == 0x7 ) // f2 f1 and f0 are full | |
79 | // if ( (new_waveform_picker_regs->status & 0x1) == 0x1 ) // f0 is full |
|
|||
80 | if ( (new_waveform_picker_regs->status & 0x4) == 0x4 ) // f2 is full |
|
|||
81 | { |
|
79 | { | |
82 | 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) { | |
83 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
81 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
84 | } |
|
82 | } | |
85 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888; |
|
83 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888; | |
86 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888; |
|
|||
87 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888; |
|
|||
88 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888; |
|
|||
89 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffff888; |
|
|||
90 | // if ( (new_waveform_picker_regs->status & 0x1) == 0x1 ) |
|
|||
91 | if ( (new_waveform_picker_regs->status & 0x4) == 0x4 ) // f2 is full |
|
|||
92 | { |
|
|||
93 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 ); |
|
|||
94 | } |
|
|||
95 | // if ( (new_waveform_picker_regs->status & 0x1) == 0x0 ) |
|
|||
96 | if ( (new_waveform_picker_regs->status & 0x4) == 0x0 ) |
|
|||
97 | { |
|
|||
98 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_7 ); |
|
|||
99 | } |
|
|||
100 | } |
|
84 | } | |
101 | #endif |
|
85 | #endif | |
102 | break; |
|
86 | break; | |
103 |
|
87 | |||
104 | //****** |
|
88 | //****** | |
105 | // BURST |
|
89 | // BURST | |
106 | case(LFR_MODE_BURST): |
|
90 | case(LFR_MODE_BURST): | |
107 | #ifdef GSA |
|
91 | #ifdef GSA | |
108 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") |
|
92 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") | |
109 | #else |
|
93 | #else | |
110 | if ((new_waveform_picker_regs->status & 0x04) == 0x04){ // [0100] check the f2 full bit |
|
94 | if ((new_waveform_picker_regs->status & 0x04) == 0x04){ // [0100] check the f2 full bit | |
111 | // (1) change the receiving buffer for the waveform picker |
|
95 | // (1) change the receiving buffer for the waveform picker | |
112 | if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) { |
|
96 | if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) { | |
113 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis); |
|
97 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis); | |
114 | } |
|
98 | } | |
115 | else { |
|
99 | else { | |
116 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); |
|
100 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); | |
117 | } |
|
101 | } | |
118 | // (2) send an event for the waveforms transmission |
|
102 | // (2) send an event for the waveforms transmission | |
119 | if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) { |
|
103 | if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_BURST ) != RTEMS_SUCCESSFUL) { | |
120 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
104 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
121 | } |
|
105 | } | |
122 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bits = 0 |
|
106 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bits = 0 | |
123 | } |
|
107 | } | |
124 | #endif |
|
108 | #endif | |
125 | break; |
|
109 | break; | |
126 |
|
110 | |||
127 | //***** |
|
111 | //***** | |
128 | // SBM1 |
|
112 | // SBM1 | |
129 | case(LFR_MODE_SBM1): |
|
113 | case(LFR_MODE_SBM1): | |
130 | #ifdef GSA |
|
114 | #ifdef GSA | |
131 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") |
|
115 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") | |
132 | #else |
|
116 | #else | |
133 | if ((new_waveform_picker_regs->status & 0x02) == 0x02){ // [0010] check the f1 full bit |
|
117 | if ((new_waveform_picker_regs->status & 0x02) == 0x02){ // [0010] check the f1 full bit | |
134 | // (1) change the receiving buffer for the waveform picker |
|
118 | // (1) change the receiving buffer for the waveform picker | |
135 | if ( param_local.local_sbm1_nb_cwf_sent == (param_local.local_sbm1_nb_cwf_max-1) ) |
|
119 | if ( param_local.local_sbm1_nb_cwf_sent == (param_local.local_sbm1_nb_cwf_max-1) ) | |
136 | { |
|
120 | { | |
137 | new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_norm); |
|
121 | new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_norm); | |
138 | } |
|
122 | } | |
139 | else if ( new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1_norm ) |
|
123 | else if ( new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1_norm ) | |
140 | { |
|
124 | { | |
141 | doubleSendCWF1 = 1; |
|
125 | doubleSendCWF1 = 1; | |
142 | new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); |
|
126 | new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); | |
143 | } |
|
127 | } | |
144 | else if ( new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1 ) { |
|
128 | else if ( new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1 ) { | |
145 | new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_bis); |
|
129 | new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_bis); | |
146 | } |
|
130 | } | |
147 | else { |
|
131 | else { | |
148 | new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); |
|
132 | new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); | |
149 | } |
|
133 | } | |
150 | // (2) send an event for the waveforms transmission |
|
134 | // (2) send an event for the waveforms transmission | |
151 | if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) { |
|
135 | if (rtems_event_send( Task_id[TASKID_CWF1], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) { | |
152 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
136 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
153 | } |
|
137 | } | |
154 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0 |
|
138 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffddd; // [1111 1101 1101 1101] f1 bit = 0 | |
155 | } |
|
139 | } | |
156 | if ( ( (new_waveform_picker_regs->status & 0x05) == 0x05 ) ) { // [0101] check the f2 and f0 full bit |
|
140 | if ( ( (new_waveform_picker_regs->status & 0x05) == 0x05 ) ) { // [0101] check the f2 and f0 full bit | |
157 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { |
|
141 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { | |
158 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
142 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
159 | } |
|
143 | } | |
160 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0 |
|
144 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2 and f0 bits = 0 | |
161 | reset_local_sbm1_nb_cwf_sent(); |
|
145 | reset_local_sbm1_nb_cwf_sent(); | |
162 | } |
|
146 | } | |
163 |
|
147 | |||
164 | #endif |
|
148 | #endif | |
165 | break; |
|
149 | break; | |
166 |
|
150 | |||
167 | //***** |
|
151 | //***** | |
168 | // SBM2 |
|
152 | // SBM2 | |
169 | case(LFR_MODE_SBM2): |
|
153 | case(LFR_MODE_SBM2): | |
170 | #ifdef GSA |
|
154 | #ifdef GSA | |
171 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") |
|
155 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") | |
172 | #else |
|
156 | #else | |
173 | if ((new_waveform_picker_regs->status & 0x04) == 0x04){ // [0100] check the f2 full bit |
|
157 | if ((new_waveform_picker_regs->status & 0x04) == 0x04){ // [0100] check the f2 full bit | |
174 | // (1) change the receiving buffer for the waveform picker |
|
158 | // (1) change the receiving buffer for the waveform picker | |
175 | if ( param_local.local_sbm2_nb_cwf_sent == (param_local.local_sbm2_nb_cwf_max-1) ) |
|
159 | if ( param_local.local_sbm2_nb_cwf_sent == (param_local.local_sbm2_nb_cwf_max-1) ) | |
176 | { |
|
160 | { | |
177 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_norm); |
|
161 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_norm); | |
178 | } |
|
162 | } | |
179 | else if ( new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2_norm ) { |
|
163 | else if ( new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2_norm ) { | |
180 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); |
|
164 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); | |
181 | doubleSendCWF2 = 1; |
|
165 | doubleSendCWF2 = 1; | |
182 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2_WFRM ) != RTEMS_SUCCESSFUL) { |
|
166 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2_WFRM ) != RTEMS_SUCCESSFUL) { | |
183 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
167 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
184 | } |
|
168 | } | |
185 | reset_local_sbm2_nb_cwf_sent(); |
|
169 | reset_local_sbm2_nb_cwf_sent(); | |
186 | } |
|
170 | } | |
187 | else if ( new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2 ) { |
|
171 | else if ( new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2 ) { | |
188 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis); |
|
172 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_bis); | |
189 | } |
|
173 | } | |
190 | else { |
|
174 | else { | |
191 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); |
|
175 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); | |
192 | } |
|
176 | } | |
193 | // (2) send an event for the waveforms transmission |
|
177 | // (2) send an event for the waveforms transmission | |
194 | if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) { |
|
178 | if (rtems_event_send( Task_id[TASKID_CWF2], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) { | |
195 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
179 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
196 | } |
|
180 | } | |
197 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0 |
|
181 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffbbb; // [1111 1011 1011 1011] f2 bit = 0 | |
198 | } |
|
182 | } | |
199 | if ( ( (new_waveform_picker_regs->status & 0x03) == 0x03 ) ) { // [0011] f3 f2 f1 f0, f1 and f0 are full |
|
183 | if ( ( (new_waveform_picker_regs->status & 0x03) == 0x03 ) ) { // [0011] f3 f2 f1 f0, f1 and f0 are full | |
200 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) { |
|
184 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM2 ) != RTEMS_SUCCESSFUL) { | |
201 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); |
|
185 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
202 | } |
|
186 | } | |
203 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0 |
|
187 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0 | |
204 | } |
|
188 | } | |
205 | #endif |
|
189 | #endif | |
206 | break; |
|
190 | break; | |
207 |
|
191 | |||
208 | //******** |
|
192 | //******** | |
209 | // DEFAULT |
|
193 | // DEFAULT | |
210 | default: |
|
194 | default: | |
211 | break; |
|
195 | break; | |
212 | } |
|
196 | } | |
213 | } |
|
197 | } | |
214 |
|
198 | |||
215 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ) |
|
199 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ) | |
216 | { |
|
200 | { | |
217 | /** This is the interrupt sub routine called by the waveform picker simulator. |
|
201 | /** This is the interrupt sub routine called by the waveform picker simulator. | |
218 | * |
|
202 | * | |
219 | * This ISR is for debug purpose only. |
|
203 | * This ISR is for debug purpose only. | |
220 | * |
|
204 | * | |
221 | */ |
|
205 | */ | |
222 |
|
206 | |||
223 | unsigned char lfrMode; |
|
207 | unsigned char lfrMode; | |
224 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
208 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
225 |
|
209 | |||
226 | switch(lfrMode) { |
|
210 | switch(lfrMode) { | |
227 | case (LFR_MODE_STANDBY): |
|
211 | case (LFR_MODE_STANDBY): | |
228 | break; |
|
212 | break; | |
229 | case (LFR_MODE_NORMAL): |
|
213 | case (LFR_MODE_NORMAL): | |
230 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { |
|
214 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { | |
231 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_5 ); |
|
215 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_5 ); | |
232 | } |
|
216 | } | |
233 | break; |
|
217 | break; | |
234 | case (LFR_MODE_BURST): |
|
218 | case (LFR_MODE_BURST): | |
235 | break; |
|
219 | break; | |
236 | case (LFR_MODE_SBM1): |
|
220 | case (LFR_MODE_SBM1): | |
237 | break; |
|
221 | break; | |
238 | case (LFR_MODE_SBM2): |
|
222 | case (LFR_MODE_SBM2): | |
239 | break; |
|
223 | break; | |
240 | } |
|
224 | } | |
241 | } |
|
225 | } | |
242 |
|
226 | |||
243 | rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP |
|
227 | rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP | |
244 | { |
|
228 | { | |
245 | /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode. |
|
229 | /** This RTEMS task is dedicated to the transmission of snapshots of the NORMAL mode. | |
246 | * |
|
230 | * | |
247 | * @param unused is the starting argument of the RTEMS task |
|
231 | * @param unused is the starting argument of the RTEMS task | |
248 | * |
|
232 | * | |
249 | * The following data packets are sent by this task: |
|
233 | * The following data packets are sent by this task: | |
250 | * - TM_LFR_SCIENCE_NORMAL_SWF_F0 |
|
234 | * - TM_LFR_SCIENCE_NORMAL_SWF_F0 | |
251 | * - TM_LFR_SCIENCE_NORMAL_SWF_F1 |
|
235 | * - TM_LFR_SCIENCE_NORMAL_SWF_F1 | |
252 | * - TM_LFR_SCIENCE_NORMAL_SWF_F2 |
|
236 | * - TM_LFR_SCIENCE_NORMAL_SWF_F2 | |
253 | * |
|
237 | * | |
254 | */ |
|
238 | */ | |
255 |
|
239 | |||
256 | rtems_event_set event_out; |
|
240 | rtems_event_set event_out; | |
257 | rtems_id queue_id; |
|
241 | rtems_id queue_id; | |
258 |
|
242 | |||
259 | init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 ); |
|
243 | init_header_snapshot_wf_table( SID_NORM_SWF_F0, headerSWF_F0 ); | |
260 | init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 ); |
|
244 | init_header_snapshot_wf_table( SID_NORM_SWF_F1, headerSWF_F1 ); | |
261 | init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 ); |
|
245 | init_header_snapshot_wf_table( SID_NORM_SWF_F2, headerSWF_F2 ); | |
262 |
|
246 | |||
263 | init_waveforms(); |
|
247 | init_waveforms(); | |
264 |
|
248 | |||
265 | queue_id = get_pkts_queue_id(); |
|
249 | queue_id = get_pkts_queue_id(); | |
266 |
|
250 | |||
267 | BOOT_PRINTF("in WFRM ***\n") |
|
251 | BOOT_PRINTF("in WFRM ***\n") | |
268 |
|
252 | |||
269 | while(1){ |
|
253 | while(1){ | |
270 | // wait for an RTEMS_EVENT |
|
254 | // wait for an RTEMS_EVENT | |
271 | rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1 |
|
255 | rtems_event_receive(RTEMS_EVENT_MODE_NORMAL | RTEMS_EVENT_MODE_SBM1 | |
272 | | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM, |
|
256 | | RTEMS_EVENT_MODE_SBM2 | RTEMS_EVENT_MODE_SBM2_WFRM, | |
273 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
257 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); | |
274 |
|
258 | |||
275 | if (event_out == RTEMS_EVENT_MODE_NORMAL) |
|
259 | if (event_out == RTEMS_EVENT_MODE_NORMAL) | |
276 | { |
|
260 | { | |
277 |
|
|
261 | send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id); | |
278 |
|
|
262 | send_waveform_SWF(wf_snap_f1, SID_NORM_SWF_F1, headerSWF_F1, queue_id); | |
279 | send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id); |
|
263 | send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id); | |
280 | #ifdef GSA |
|
264 | #ifdef GSA | |
281 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xf888; // [1111 1000 1000 1000] f2, f1, f0 bits =0 |
|
265 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xf888; // [1111 1000 1000 1000] f2, f1, f0 bits =0 | |
282 | #endif |
|
266 | #endif | |
283 | } |
|
267 | } | |
284 | else if (event_out == RTEMS_EVENT_MODE_SBM1) |
|
268 | else if (event_out == RTEMS_EVENT_MODE_SBM1) | |
285 | { |
|
269 | { | |
286 | send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id); |
|
270 | send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id); | |
287 | send_waveform_SWF(wf_snap_f1_norm, SID_NORM_SWF_F1, headerSWF_F1, queue_id); |
|
271 | send_waveform_SWF(wf_snap_f1_norm, SID_NORM_SWF_F1, headerSWF_F1, queue_id); | |
288 | send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id); |
|
272 | send_waveform_SWF(wf_snap_f2, SID_NORM_SWF_F2, headerSWF_F2, queue_id); | |
289 | #ifdef GSA |
|
273 | #ifdef GSA | |
290 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2, f0 bits = 0 |
|
274 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffaaa; // [1111 1010 1010 1010] f2, f0 bits = 0 | |
291 | #endif |
|
275 | #endif | |
292 | } |
|
276 | } | |
293 | else if (event_out == RTEMS_EVENT_MODE_SBM2) |
|
277 | else if (event_out == RTEMS_EVENT_MODE_SBM2) | |
294 | { |
|
278 | { | |
295 | send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id); |
|
279 | send_waveform_SWF(wf_snap_f0, SID_NORM_SWF_F0, headerSWF_F0, queue_id); | |
296 | send_waveform_SWF(wf_snap_f1, SID_NORM_SWF_F1, headerSWF_F1, queue_id); |
|
280 | send_waveform_SWF(wf_snap_f1, SID_NORM_SWF_F1, headerSWF_F1, queue_id); | |
297 | #ifdef GSA |
|
281 | #ifdef GSA | |
298 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0 |
|
282 | new_waveform_picker_regs->status = new_waveform_picker_regs->status & 0xfffffccc; // [1111 1100 1100 1100] f1, f0 bits = 0 | |
299 | #endif |
|
283 | #endif | |
300 | } |
|
284 | } | |
301 | else if (event_out == RTEMS_EVENT_MODE_SBM2_WFRM) |
|
285 | else if (event_out == RTEMS_EVENT_MODE_SBM2_WFRM) | |
302 | { |
|
286 | { | |
303 | send_waveform_SWF(wf_snap_f2_norm, SID_NORM_SWF_F2, headerSWF_F2, queue_id); |
|
287 | send_waveform_SWF(wf_snap_f2_norm, SID_NORM_SWF_F2, headerSWF_F2, queue_id); | |
304 | } |
|
288 | } | |
305 | else |
|
289 | else | |
306 | { |
|
290 | { | |
307 | PRINTF("in WFRM *** unexpected event") |
|
291 | PRINTF("in WFRM *** unexpected event") | |
308 | } |
|
292 | } | |
309 |
|
293 | |||
310 |
|
294 | |||
311 | #ifdef GSA |
|
295 | #ifdef GSA | |
312 | // irq processed, reset the related register of the timer unit |
|
296 | // irq processed, reset the related register of the timer unit | |
313 | gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl = gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl | 0x00000010; |
|
297 | gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl = gptimer_regs->timer[TIMER_WF_SIMULATOR].ctrl | 0x00000010; | |
314 | // clear the interruption |
|
298 | // clear the interruption | |
315 | LEON_Unmask_interrupt( IRQ_WF ); |
|
299 | LEON_Unmask_interrupt( IRQ_WF ); | |
316 | #endif |
|
300 | #endif | |
317 | } |
|
301 | } | |
318 | } |
|
302 | } | |
319 |
|
303 | |||
320 | rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP |
|
304 | rtems_task cwf3_task(rtems_task_argument argument) //used with the waveform picker VHDL IP | |
321 | { |
|
305 | { | |
322 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3. |
|
306 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f3. | |
323 | * |
|
307 | * | |
324 | * @param unused is the starting argument of the RTEMS task |
|
308 | * @param unused is the starting argument of the RTEMS task | |
325 | * |
|
309 | * | |
326 | * The following data packet is sent by this task: |
|
310 | * The following data packet is sent by this task: | |
327 | * - TM_LFR_SCIENCE_NORMAL_CWF_F3 |
|
311 | * - TM_LFR_SCIENCE_NORMAL_CWF_F3 | |
328 | * |
|
312 | * | |
329 | */ |
|
313 | */ | |
330 |
|
314 | |||
331 | rtems_event_set event_out; |
|
315 | rtems_event_set event_out; | |
332 | rtems_id queue_id; |
|
316 | rtems_id queue_id; | |
333 |
|
317 | |||
334 | init_header_continuous_wf_table( SID_NORM_CWF_F3, headerCWF_F3 ); |
|
318 | init_header_continuous_wf_table( SID_NORM_CWF_F3, headerCWF_F3 ); | |
335 | init_header_continuous_wf3_light_table( headerCWF_F3_light ); |
|
319 | init_header_continuous_wf3_light_table( headerCWF_F3_light ); | |
336 |
|
320 | |||
337 | queue_id = get_pkts_queue_id(); |
|
321 | queue_id = get_pkts_queue_id(); | |
338 |
|
322 | |||
339 | BOOT_PRINTF("in CWF3 ***\n") |
|
323 | BOOT_PRINTF("in CWF3 ***\n") | |
340 |
|
324 | |||
341 | while(1){ |
|
325 | while(1){ | |
342 | // wait for an RTEMS_EVENT |
|
326 | // wait for an RTEMS_EVENT | |
343 | rtems_event_receive( RTEMS_EVENT_0, |
|
327 | rtems_event_receive( RTEMS_EVENT_0, | |
344 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
328 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); | |
345 | PRINTF("send CWF F3 \n") |
|
329 | PRINTF("send CWF F3 \n") | |
346 | #ifdef GSA |
|
330 | #ifdef GSA | |
347 | #else |
|
331 | #else | |
348 | if (new_waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) { |
|
332 | if (new_waveform_picker_regs->addr_data_f3 == (int) wf_cont_f3) { | |
349 | send_waveform_CWF3_light( wf_cont_f3_bis, headerCWF_F3_light, queue_id ); |
|
333 | send_waveform_CWF3_light( wf_cont_f3_bis, headerCWF_F3_light, queue_id ); | |
350 | } |
|
334 | } | |
351 | else { |
|
335 | else { | |
352 | send_waveform_CWF3_light( wf_cont_f3, headerCWF_F3_light, queue_id ); |
|
336 | send_waveform_CWF3_light( wf_cont_f3, headerCWF_F3_light, queue_id ); | |
353 | } |
|
337 | } | |
354 | #endif |
|
338 | #endif | |
355 | } |
|
339 | } | |
356 | } |
|
340 | } | |
357 |
|
341 | |||
358 | rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2 |
|
342 | rtems_task cwf2_task(rtems_task_argument argument) // ONLY USED IN BURST AND SBM2 | |
359 | { |
|
343 | { | |
360 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2. |
|
344 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f2. | |
361 | * |
|
345 | * | |
362 | * @param unused is the starting argument of the RTEMS task |
|
346 | * @param unused is the starting argument of the RTEMS task | |
363 | * |
|
347 | * | |
364 | * The following data packet is sent by this function: |
|
348 | * The following data packet is sent by this function: | |
365 | * - TM_LFR_SCIENCE_BURST_CWF_F2 |
|
349 | * - TM_LFR_SCIENCE_BURST_CWF_F2 | |
366 | * - TM_LFR_SCIENCE_SBM2_CWF_F2 |
|
350 | * - TM_LFR_SCIENCE_SBM2_CWF_F2 | |
367 | * |
|
351 | * | |
368 | */ |
|
352 | */ | |
369 |
|
353 | |||
370 | rtems_event_set event_out; |
|
354 | rtems_event_set event_out; | |
371 | rtems_id queue_id; |
|
355 | rtems_id queue_id; | |
372 |
|
356 | |||
373 | init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST ); |
|
357 | init_header_continuous_wf_table( SID_BURST_CWF_F2, headerCWF_F2_BURST ); | |
374 | init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 ); |
|
358 | init_header_continuous_wf_table( SID_SBM2_CWF_F2, headerCWF_F2_SBM2 ); | |
375 |
|
359 | |||
376 | queue_id = get_pkts_queue_id(); |
|
360 | queue_id = get_pkts_queue_id(); | |
377 |
|
361 | |||
378 | BOOT_PRINTF("in CWF2 ***\n") |
|
362 | BOOT_PRINTF("in CWF2 ***\n") | |
379 |
|
363 | |||
380 | while(1){ |
|
364 | while(1){ | |
381 | // wait for an RTEMS_EVENT |
|
365 | // wait for an RTEMS_EVENT | |
382 | rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2, |
|
366 | rtems_event_receive( RTEMS_EVENT_MODE_BURST | RTEMS_EVENT_MODE_SBM2, | |
383 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
367 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); | |
384 |
|
368 | |||
385 | if (event_out == RTEMS_EVENT_MODE_BURST) |
|
369 | if (event_out == RTEMS_EVENT_MODE_BURST) | |
386 | { |
|
370 | { | |
387 | // F2 |
|
371 | // F2 | |
388 | #ifdef GSA |
|
372 | #ifdef GSA | |
389 | #else |
|
373 | #else | |
390 | if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) { |
|
374 | if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) { | |
391 | send_waveform_CWF( wf_snap_f2_bis, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id ); |
|
375 | send_waveform_CWF( wf_snap_f2_bis, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id ); | |
392 | } |
|
376 | } | |
393 | else { |
|
377 | else { | |
394 | send_waveform_CWF( wf_snap_f2, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id ); |
|
378 | send_waveform_CWF( wf_snap_f2, SID_BURST_CWF_F2, headerCWF_F2_BURST, queue_id ); | |
395 | } |
|
379 | } | |
396 | #endif |
|
380 | #endif | |
397 | } |
|
381 | } | |
398 |
|
382 | |||
399 | else if (event_out == RTEMS_EVENT_MODE_SBM2) |
|
383 | else if (event_out == RTEMS_EVENT_MODE_SBM2) | |
400 | { |
|
384 | { | |
401 | #ifdef GSA |
|
385 | #ifdef GSA | |
402 | #else |
|
386 | #else | |
403 | if (doubleSendCWF2 == 1) |
|
387 | if (doubleSendCWF2 == 1) | |
404 | { |
|
388 | { | |
405 | doubleSendCWF2 = 0; |
|
389 | doubleSendCWF2 = 0; | |
406 | send_waveform_CWF( wf_snap_f2_norm, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id ); |
|
390 | send_waveform_CWF( wf_snap_f2_norm, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id ); | |
407 | } |
|
391 | } | |
408 | else if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) { |
|
392 | else if (new_waveform_picker_regs->addr_data_f2 == (int) wf_snap_f2) { | |
409 | send_waveform_CWF( wf_snap_f2_bis, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id ); |
|
393 | send_waveform_CWF( wf_snap_f2_bis, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id ); | |
410 | } |
|
394 | } | |
411 | else { |
|
395 | else { | |
412 | send_waveform_CWF( wf_snap_f2, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id ); |
|
396 | send_waveform_CWF( wf_snap_f2, SID_SBM2_CWF_F2, headerCWF_F2_SBM2, queue_id ); | |
413 | } |
|
397 | } | |
414 | param_local.local_sbm2_nb_cwf_sent ++; |
|
398 | param_local.local_sbm2_nb_cwf_sent ++; | |
415 | #endif |
|
399 | #endif | |
416 | } |
|
400 | } | |
417 | else |
|
401 | else | |
418 | { |
|
402 | { | |
419 | PRINTF1("in CWF2 *** ERR mode = %d\n", lfrCurrentMode) |
|
403 | PRINTF1("in CWF2 *** ERR mode = %d\n", lfrCurrentMode) | |
420 | } |
|
404 | } | |
421 | } |
|
405 | } | |
422 | } |
|
406 | } | |
423 |
|
407 | |||
424 | rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1 |
|
408 | rtems_task cwf1_task(rtems_task_argument argument) // ONLY USED IN SBM1 | |
425 | { |
|
409 | { | |
426 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1. |
|
410 | /** This RTEMS task is dedicated to the transmission of continuous waveforms at f1. | |
427 | * |
|
411 | * | |
428 | * @param unused is the starting argument of the RTEMS task |
|
412 | * @param unused is the starting argument of the RTEMS task | |
429 | * |
|
413 | * | |
430 | * The following data packet is sent by this function: |
|
414 | * The following data packet is sent by this function: | |
431 | * - TM_LFR_SCIENCE_SBM1_CWF_F1 |
|
415 | * - TM_LFR_SCIENCE_SBM1_CWF_F1 | |
432 | * |
|
416 | * | |
433 | */ |
|
417 | */ | |
434 |
|
418 | |||
435 | rtems_event_set event_out; |
|
419 | rtems_event_set event_out; | |
436 | rtems_id queue_id; |
|
420 | rtems_id queue_id; | |
437 |
|
421 | |||
438 | init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 ); |
|
422 | init_header_continuous_wf_table( SID_SBM1_CWF_F1, headerCWF_F1 ); | |
439 |
|
423 | |||
440 | queue_id = get_pkts_queue_id(); |
|
424 | queue_id = get_pkts_queue_id(); | |
441 |
|
425 | |||
442 | BOOT_PRINTF("in CWF1 ***\n") |
|
426 | BOOT_PRINTF("in CWF1 ***\n") | |
443 |
|
427 | |||
444 | while(1){ |
|
428 | while(1){ | |
445 | // wait for an RTEMS_EVENT |
|
429 | // wait for an RTEMS_EVENT | |
446 | rtems_event_receive( RTEMS_EVENT_MODE_SBM1, |
|
430 | rtems_event_receive( RTEMS_EVENT_MODE_SBM1, | |
447 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); |
|
431 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); | |
448 | if (event_out == RTEMS_EVENT_MODE_SBM1) |
|
432 | if (event_out == RTEMS_EVENT_MODE_SBM1) | |
449 | { |
|
433 | { | |
450 | #ifdef GSA |
|
434 | #ifdef GSA | |
451 | #else |
|
435 | #else | |
452 | if (doubleSendCWF1 == 1) |
|
436 | if (doubleSendCWF1 == 1) | |
453 | { |
|
437 | { | |
454 | doubleSendCWF1 = 0; |
|
438 | doubleSendCWF1 = 0; | |
455 | send_waveform_CWF( wf_snap_f1_norm, SID_SBM1_CWF_F1, headerCWF_F1, queue_id ); |
|
439 | send_waveform_CWF( wf_snap_f1_norm, SID_SBM1_CWF_F1, headerCWF_F1, queue_id ); | |
456 | } |
|
440 | } | |
457 | else if (new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) { |
|
441 | else if (new_waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) { | |
458 | send_waveform_CWF( wf_snap_f1_bis, SID_SBM1_CWF_F1, headerCWF_F1, queue_id ); |
|
442 | send_waveform_CWF( wf_snap_f1_bis, SID_SBM1_CWF_F1, headerCWF_F1, queue_id ); | |
459 | } |
|
443 | } | |
460 | else { |
|
444 | else { | |
461 | send_waveform_CWF( wf_snap_f1, SID_SBM1_CWF_F1, headerCWF_F1, queue_id ); |
|
445 | send_waveform_CWF( wf_snap_f1, SID_SBM1_CWF_F1, headerCWF_F1, queue_id ); | |
462 | } |
|
446 | } | |
463 | param_local.local_sbm1_nb_cwf_sent ++; |
|
447 | param_local.local_sbm1_nb_cwf_sent ++; | |
464 | #endif |
|
448 | #endif | |
465 | } |
|
449 | } | |
466 | else |
|
450 | else | |
467 | { |
|
451 | { | |
468 | PRINTF1("in CWF1 *** ERR mode = %d\n", lfrCurrentMode) |
|
452 | PRINTF1("in CWF1 *** ERR mode = %d\n", lfrCurrentMode) | |
469 | } |
|
453 | } | |
470 | } |
|
454 | } | |
471 | } |
|
455 | } | |
472 |
|
456 | |||
473 | //****************** |
|
457 | //****************** | |
474 | // general functions |
|
458 | // general functions | |
475 | void init_waveforms( void ) |
|
459 | void init_waveforms( void ) | |
476 | { |
|
460 | { | |
477 | int i = 0; |
|
461 | int i = 0; | |
478 |
|
462 | |||
479 | for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) |
|
463 | for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) | |
480 | { |
|
464 | { | |
481 | // //*** |
|
465 | // //*** | |
482 | // // F0 |
|
466 | // // F0 | |
483 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; // |
|
467 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; // | |
484 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; // |
|
468 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; // | |
485 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; // |
|
469 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; // | |
486 |
|
470 | |||
487 | //*** |
|
471 | //*** | |
488 | // F1 |
|
472 | // F1 | |
489 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111; |
|
473 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111; | |
490 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333; |
|
474 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333; | |
491 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000; |
|
475 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000; | |
492 |
|
476 | |||
493 | //*** |
|
477 | //*** | |
494 | // F2 |
|
478 | // F2 | |
495 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0xffffffff; |
|
479 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0xffffffff; | |
496 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0xffffffff; |
|
480 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0xffffffff; | |
497 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xffffffff; |
|
481 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xffffffff; | |
498 |
|
482 | |||
499 | //*** |
|
483 | //*** | |
500 | // F0 |
|
484 | // F0 | |
501 | // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x0; // |
|
485 | // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x0; // | |
502 | // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x0; // |
|
486 | // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x0; // | |
503 | // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x0; // |
|
487 | // wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x0; // | |
504 |
|
488 | |||
505 | // //*** |
|
489 | // //*** | |
506 | // // F1 |
|
490 | // // F1 | |
507 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x0; |
|
491 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x0; | |
508 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x0; |
|
492 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x0; | |
509 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x0; |
|
493 | // wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x0; | |
510 |
|
494 | |||
511 | // //*** |
|
495 | // //*** | |
512 | // // F2 |
|
496 | // // F2 | |
513 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x0; |
|
497 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x0; | |
514 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x0; |
|
498 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x0; | |
515 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x0; |
|
499 | // wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x0; | |
516 |
|
500 | |||
517 | //*** |
|
501 | //*** | |
518 | // F3 |
|
502 | // F3 | |
519 | //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1; |
|
503 | //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1; | |
520 | //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2; |
|
504 | //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2; | |
521 | //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000; |
|
505 | //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000; | |
522 | } |
|
506 | } | |
523 | } |
|
507 | } | |
524 |
|
508 | |||
525 | int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF) |
|
509 | int init_header_snapshot_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_SWF_t *headerSWF) | |
526 | { |
|
510 | { | |
527 | unsigned char i; |
|
511 | unsigned char i; | |
528 |
|
512 | |||
529 | for (i=0; i<7; i++) |
|
513 | for (i=0; i<7; i++) | |
530 | { |
|
514 | { | |
531 | headerSWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
515 | headerSWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; | |
532 | headerSWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
516 | headerSWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
533 | headerSWF[ i ].reserved = DEFAULT_RESERVED; |
|
517 | headerSWF[ i ].reserved = DEFAULT_RESERVED; | |
534 | headerSWF[ i ].userApplication = CCSDS_USER_APP; |
|
518 | headerSWF[ i ].userApplication = CCSDS_USER_APP; | |
535 | headerSWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); |
|
519 | headerSWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); | |
536 | headerSWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); |
|
520 | headerSWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); | |
537 | if (i == 0) |
|
521 | if (i == 0) | |
538 | { |
|
522 | { | |
539 | headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST; |
|
523 | headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST; | |
540 | headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_340 >> 8); |
|
524 | headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_340 >> 8); | |
541 | headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_340 ); |
|
525 | headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_340 ); | |
542 | headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); |
|
526 | headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); | |
543 | headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); |
|
527 | headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); | |
544 | } |
|
528 | } | |
545 | else if (i == 6) |
|
529 | else if (i == 6) | |
546 | { |
|
530 | { | |
547 | headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST; |
|
531 | headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST; | |
548 | headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_8 >> 8); |
|
532 | headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_8 >> 8); | |
549 | headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_8 ); |
|
533 | headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_8 ); | |
550 | headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8); |
|
534 | headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8); | |
551 | headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 ); |
|
535 | headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 ); | |
552 | } |
|
536 | } | |
553 | else |
|
537 | else | |
554 | { |
|
538 | { | |
555 | headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION; |
|
539 | headerSWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION; | |
556 | headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_340 >> 8); |
|
540 | headerSWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_SWF_340 >> 8); | |
557 | headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_340 ); |
|
541 | headerSWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_SWF_340 ); | |
558 | headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); |
|
542 | headerSWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); | |
559 | headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); |
|
543 | headerSWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); | |
560 | } |
|
544 | } | |
561 | headerSWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
545 | headerSWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; | |
562 | headerSWF[ i ].pktCnt = DEFAULT_PKTCNT; // PKT_CNT |
|
546 | headerSWF[ i ].pktCnt = DEFAULT_PKTCNT; // PKT_CNT | |
563 | headerSWF[ i ].pktNr = i+1; // PKT_NR |
|
547 | headerSWF[ i ].pktNr = i+1; // PKT_NR | |
564 | // DATA FIELD HEADER |
|
548 | // DATA FIELD HEADER | |
565 | headerSWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
549 | headerSWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
566 | headerSWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type |
|
550 | headerSWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type | |
567 | headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
551 | headerSWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype | |
568 | headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; |
|
552 | headerSWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; | |
569 | // AUXILIARY DATA HEADER |
|
553 | // AUXILIARY DATA HEADER | |
570 | headerSWF[ i ].sid = sid; |
|
554 | headerSWF[ i ].sid = sid; | |
571 | headerSWF[ i ].hkBIA = DEFAULT_HKBIA; |
|
555 | headerSWF[ i ].hkBIA = DEFAULT_HKBIA; | |
572 | headerSWF[ i ].time[0] = 0x00; |
|
556 | headerSWF[ i ].time[0] = 0x00; | |
573 | headerSWF[ i ].time[0] = 0x00; |
|
557 | headerSWF[ i ].time[0] = 0x00; | |
574 | headerSWF[ i ].time[0] = 0x00; |
|
558 | headerSWF[ i ].time[0] = 0x00; | |
575 | headerSWF[ i ].time[0] = 0x00; |
|
559 | headerSWF[ i ].time[0] = 0x00; | |
576 | headerSWF[ i ].time[0] = 0x00; |
|
560 | headerSWF[ i ].time[0] = 0x00; | |
577 | headerSWF[ i ].time[0] = 0x00; |
|
561 | headerSWF[ i ].time[0] = 0x00; | |
578 | } |
|
562 | } | |
579 | return LFR_SUCCESSFUL; |
|
563 | return LFR_SUCCESSFUL; | |
580 | } |
|
564 | } | |
581 |
|
565 | |||
582 | int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF ) |
|
566 | int init_header_continuous_wf_table( unsigned int sid, Header_TM_LFR_SCIENCE_CWF_t *headerCWF ) | |
583 | { |
|
567 | { | |
584 | unsigned int i; |
|
568 | unsigned int i; | |
585 |
|
569 | |||
586 | for (i=0; i<7; i++) |
|
570 | for (i=0; i<7; i++) | |
587 | { |
|
571 | { | |
588 | headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
572 | headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; | |
589 | headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
573 | headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
590 | headerCWF[ i ].reserved = DEFAULT_RESERVED; |
|
574 | headerCWF[ i ].reserved = DEFAULT_RESERVED; | |
591 | headerCWF[ i ].userApplication = CCSDS_USER_APP; |
|
575 | headerCWF[ i ].userApplication = CCSDS_USER_APP; | |
592 | if ( (sid == SID_SBM1_CWF_F1) || (sid == SID_SBM2_CWF_F2) ) |
|
576 | if ( (sid == SID_SBM1_CWF_F1) || (sid == SID_SBM2_CWF_F2) ) | |
593 | { |
|
577 | { | |
594 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2 >> 8); |
|
578 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2 >> 8); | |
595 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2); |
|
579 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_SBM1_SBM2); | |
596 | } |
|
580 | } | |
597 | else |
|
581 | else | |
598 | { |
|
582 | { | |
599 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); |
|
583 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); | |
600 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); |
|
584 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); | |
601 | } |
|
585 | } | |
602 | if (i == 0) |
|
586 | if (i == 0) | |
603 | { |
|
587 | { | |
604 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST; |
|
588 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST; | |
605 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_340 >> 8); |
|
589 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_340 >> 8); | |
606 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_340 ); |
|
590 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_340 ); | |
607 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); |
|
591 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); | |
608 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); |
|
592 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); | |
609 | } |
|
593 | } | |
610 | else if (i == 6) |
|
594 | else if (i == 6) | |
611 | { |
|
595 | { | |
612 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST; |
|
596 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST; | |
613 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_8 >> 8); |
|
597 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_8 >> 8); | |
614 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_8 ); |
|
598 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_8 ); | |
615 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8); |
|
599 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8); | |
616 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 ); |
|
600 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 ); | |
617 | } |
|
601 | } | |
618 | else |
|
602 | else | |
619 | { |
|
603 | { | |
620 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION; |
|
604 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION; | |
621 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_340 >> 8); |
|
605 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF_340 >> 8); | |
622 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_340 ); |
|
606 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF_340 ); | |
623 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); |
|
607 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); | |
624 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); |
|
608 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); | |
625 | } |
|
609 | } | |
626 | headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
610 | headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; | |
627 | // PKT_CNT |
|
611 | // PKT_CNT | |
628 | // PKT_NR |
|
612 | // PKT_NR | |
629 | // DATA FIELD HEADER |
|
613 | // DATA FIELD HEADER | |
630 | headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
614 | headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
631 | headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type |
|
615 | headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type | |
632 | headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
616 | headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype | |
633 | headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; |
|
617 | headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; | |
634 | // AUXILIARY DATA HEADER |
|
618 | // AUXILIARY DATA HEADER | |
635 | headerCWF[ i ].sid = sid; |
|
619 | headerCWF[ i ].sid = sid; | |
636 | headerCWF[ i ].hkBIA = DEFAULT_HKBIA; |
|
620 | headerCWF[ i ].hkBIA = DEFAULT_HKBIA; | |
637 | headerCWF[ i ].time[0] = 0x00; |
|
621 | headerCWF[ i ].time[0] = 0x00; | |
638 | headerCWF[ i ].time[0] = 0x00; |
|
622 | headerCWF[ i ].time[0] = 0x00; | |
639 | headerCWF[ i ].time[0] = 0x00; |
|
623 | headerCWF[ i ].time[0] = 0x00; | |
640 | headerCWF[ i ].time[0] = 0x00; |
|
624 | headerCWF[ i ].time[0] = 0x00; | |
641 | headerCWF[ i ].time[0] = 0x00; |
|
625 | headerCWF[ i ].time[0] = 0x00; | |
642 | headerCWF[ i ].time[0] = 0x00; |
|
626 | headerCWF[ i ].time[0] = 0x00; | |
643 | } |
|
627 | } | |
644 | return LFR_SUCCESSFUL; |
|
628 | return LFR_SUCCESSFUL; | |
645 | } |
|
629 | } | |
646 |
|
630 | |||
647 | int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF ) |
|
631 | int init_header_continuous_wf3_light_table( Header_TM_LFR_SCIENCE_CWF_t *headerCWF ) | |
648 | { |
|
632 | { | |
649 | unsigned int i; |
|
633 | unsigned int i; | |
650 |
|
634 | |||
651 | for (i=0; i<7; i++) |
|
635 | for (i=0; i<7; i++) | |
652 | { |
|
636 | { | |
653 | headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
637 | headerCWF[ i ].targetLogicalAddress = CCSDS_DESTINATION_ID; | |
654 | headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
638 | headerCWF[ i ].protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
655 | headerCWF[ i ].reserved = DEFAULT_RESERVED; |
|
639 | headerCWF[ i ].reserved = DEFAULT_RESERVED; | |
656 | headerCWF[ i ].userApplication = CCSDS_USER_APP; |
|
640 | headerCWF[ i ].userApplication = CCSDS_USER_APP; | |
657 |
|
641 | |||
658 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); |
|
642 | headerCWF[ i ].packetID[0] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST >> 8); | |
659 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); |
|
643 | headerCWF[ i ].packetID[1] = (unsigned char) (TM_PACKET_ID_SCIENCE_NORMAL_BURST); | |
660 | if (i == 0) |
|
644 | if (i == 0) | |
661 | { |
|
645 | { | |
662 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST; |
|
646 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_FIRST; | |
663 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8); |
|
647 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8); | |
664 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 ); |
|
648 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 ); | |
665 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); |
|
649 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); | |
666 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); |
|
650 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); | |
667 | } |
|
651 | } | |
668 | else if (i == 6) |
|
652 | else if (i == 6) | |
669 | { |
|
653 | { | |
670 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST; |
|
654 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_LAST; | |
671 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 >> 8); |
|
655 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 >> 8); | |
672 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 ); |
|
656 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_8 ); | |
673 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8); |
|
657 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_8 >> 8); | |
674 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 ); |
|
658 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_8 ); | |
675 | } |
|
659 | } | |
676 | else |
|
660 | else | |
677 | { |
|
661 | { | |
678 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION; |
|
662 | headerCWF[ i ].packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_CONTINUATION; | |
679 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8); |
|
663 | headerCWF[ i ].packetLength[0] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 >> 8); | |
680 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 ); |
|
664 | headerCWF[ i ].packetLength[1] = (unsigned char) (TM_LEN_SCI_CWF3_LIGHT_340 ); | |
681 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); |
|
665 | headerCWF[ i ].blkNr[0] = (unsigned char) (BLK_NR_340 >> 8); | |
682 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); |
|
666 | headerCWF[ i ].blkNr[1] = (unsigned char) (BLK_NR_340 ); | |
683 | } |
|
667 | } | |
684 | headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; |
|
668 | headerCWF[ i ].packetSequenceControl[1] = TM_PACKET_SEQ_CNT_DEFAULT; | |
685 | // DATA FIELD HEADER |
|
669 | // DATA FIELD HEADER | |
686 | headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; |
|
670 | headerCWF[ i ].spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2; | |
687 | headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type |
|
671 | headerCWF[ i ].serviceType = TM_TYPE_LFR_SCIENCE; // service type | |
688 | headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
672 | headerCWF[ i ].serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype | |
689 | headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; |
|
673 | headerCWF[ i ].destinationID = TM_DESTINATION_ID_GROUND; | |
690 | // AUXILIARY DATA HEADER |
|
674 | // AUXILIARY DATA HEADER | |
691 | headerCWF[ i ].sid = SID_NORM_CWF_F3; |
|
675 | headerCWF[ i ].sid = SID_NORM_CWF_F3; | |
692 | headerCWF[ i ].hkBIA = DEFAULT_HKBIA; |
|
676 | headerCWF[ i ].hkBIA = DEFAULT_HKBIA; | |
693 | headerCWF[ i ].time[0] = 0x00; |
|
677 | headerCWF[ i ].time[0] = 0x00; | |
694 | headerCWF[ i ].time[0] = 0x00; |
|
678 | headerCWF[ i ].time[0] = 0x00; | |
695 | headerCWF[ i ].time[0] = 0x00; |
|
679 | headerCWF[ i ].time[0] = 0x00; | |
696 | headerCWF[ i ].time[0] = 0x00; |
|
680 | headerCWF[ i ].time[0] = 0x00; | |
697 | headerCWF[ i ].time[0] = 0x00; |
|
681 | headerCWF[ i ].time[0] = 0x00; | |
698 | headerCWF[ i ].time[0] = 0x00; |
|
682 | headerCWF[ i ].time[0] = 0x00; | |
699 | } |
|
683 | } | |
700 | return LFR_SUCCESSFUL; |
|
684 | return LFR_SUCCESSFUL; | |
701 | } |
|
685 | } | |
702 |
|
686 | |||
703 | void reset_waveforms( void ) |
|
687 | void reset_waveforms( void ) | |
704 | { |
|
688 | { | |
705 | int i = 0; |
|
689 | int i = 0; | |
706 |
|
690 | |||
707 | for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) |
|
691 | for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) | |
708 | { |
|
692 | { | |
709 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x10002000; |
|
693 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x10002000; | |
710 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000; |
|
694 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000; | |
711 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000; |
|
695 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000; | |
712 |
|
696 | |||
713 | //*** |
|
697 | //*** | |
714 | // F1 |
|
698 | // F1 | |
715 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x1000f000; |
|
699 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x1000f000; | |
716 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0xf0001000; |
|
700 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0xf0001000; | |
717 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000; |
|
701 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000; | |
718 |
|
702 | |||
719 | //*** |
|
703 | //*** | |
720 | // F2 |
|
704 | // F2 | |
721 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x40008000; |
|
705 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x40008000; | |
722 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000; |
|
706 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000; | |
723 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x10002000; |
|
707 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x10002000; | |
724 |
|
708 | |||
725 | //*** |
|
709 | //*** | |
726 | // F3 |
|
710 | // F3 | |
727 | /*wf_cont_f3[ i* NB_WORDS_SWF_BLK + 0 ] = build_value( i, i ); // v and 1 |
|
711 | /*wf_cont_f3[ i* NB_WORDS_SWF_BLK + 0 ] = build_value( i, i ); // v and 1 | |
728 | wf_cont_f3[ i* NB_WORDS_SWF_BLK + 1 ] = build_value( i, i ); // e2 and b1 |
|
712 | wf_cont_f3[ i* NB_WORDS_SWF_BLK + 1 ] = build_value( i, i ); // e2 and b1 | |
729 | wf_cont_f3[ i* NB_WORDS_SWF_BLK + 2 ] = build_value( i, i ); // b2 and b3*/ |
|
713 | wf_cont_f3[ i* NB_WORDS_SWF_BLK + 2 ] = build_value( i, i ); // b2 and b3*/ | |
730 | } |
|
714 | } | |
731 | } |
|
715 | } | |
732 |
|
716 | |||
733 | int send_waveform_SWF( volatile int *waveform, unsigned int sid, |
|
717 | int send_waveform_SWF( volatile int *waveform, unsigned int sid, | |
734 | Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id ) |
|
718 | Header_TM_LFR_SCIENCE_SWF_t *headerSWF, rtems_id queue_id ) | |
735 | { |
|
719 | { | |
736 | /** This function sends SWF CCSDS packets (F2, F1 or F0). |
|
720 | /** This function sends SWF CCSDS packets (F2, F1 or F0). | |
737 | * |
|
721 | * | |
738 | * @param waveform points to the buffer containing the data that will be send. |
|
722 | * @param waveform points to the buffer containing the data that will be send. | |
739 | * @param sid is the source identifier of the data that will be sent. |
|
723 | * @param sid is the source identifier of the data that will be sent. | |
740 | * @param headerSWF points to a table of headers that have been prepared for the data transmission. |
|
724 | * @param headerSWF points to a table of headers that have been prepared for the data transmission. | |
741 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures |
|
725 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures | |
742 | * contain information to setup the transmission of the data packets. |
|
726 | * contain information to setup the transmission of the data packets. | |
743 | * |
|
727 | * | |
744 | * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks. |
|
728 | * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks. | |
745 | * |
|
729 | * | |
746 | */ |
|
730 | */ | |
747 |
|
731 | |||
748 | unsigned int i; |
|
732 | unsigned int i; | |
749 | int ret; |
|
733 | int ret; | |
750 | rtems_status_code status; |
|
734 | rtems_status_code status; | |
751 | spw_ioctl_pkt_send spw_ioctl_send_SWF; |
|
735 | spw_ioctl_pkt_send spw_ioctl_send_SWF; | |
752 |
|
736 | |||
753 | spw_ioctl_send_SWF.hlen = TM_HEADER_LEN + 4 + 12; // + 4 is for the protocole extra header, + 12 is for the auxiliary header |
|
737 | spw_ioctl_send_SWF.hlen = TM_HEADER_LEN + 4 + 12; // + 4 is for the protocole extra header, + 12 is for the auxiliary header | |
754 | spw_ioctl_send_SWF.options = 0; |
|
738 | spw_ioctl_send_SWF.options = 0; | |
755 |
|
739 | |||
756 | ret = LFR_DEFAULT; |
|
740 | ret = LFR_DEFAULT; | |
757 |
|
741 | |||
758 | for (i=0; i<7; i++) // send waveform |
|
742 | for (i=0; i<7; i++) // send waveform | |
759 | { |
|
743 | { | |
760 | spw_ioctl_send_SWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) + TIME_OFFSET ]; |
|
744 | spw_ioctl_send_SWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) + TIME_OFFSET ]; | |
761 | spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ]; |
|
745 | spw_ioctl_send_SWF.hdr = (char*) &headerSWF[ i ]; | |
762 | // BUILD THE DATA |
|
746 | // BUILD THE DATA | |
763 | if (i==6) { |
|
747 | if (i==6) { | |
764 | spw_ioctl_send_SWF.dlen = 8 * NB_BYTES_SWF_BLK; |
|
748 | spw_ioctl_send_SWF.dlen = 8 * NB_BYTES_SWF_BLK; | |
765 | } |
|
749 | } | |
766 | else { |
|
750 | else { | |
767 | spw_ioctl_send_SWF.dlen = 340 * NB_BYTES_SWF_BLK; |
|
751 | spw_ioctl_send_SWF.dlen = 340 * NB_BYTES_SWF_BLK; | |
768 | } |
|
752 | } | |
769 | // SET PACKET SEQUENCE COUNTER |
|
753 | // SET PACKET SEQUENCE COUNTER | |
770 | increment_seq_counter_source_id( headerSWF[ i ].packetSequenceControl, sid ); |
|
754 | increment_seq_counter_source_id( headerSWF[ i ].packetSequenceControl, sid ); | |
771 | // SET PACKET TIME |
|
755 | // SET PACKET TIME | |
772 | headerSWF[ i ].acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
756 | headerSWF[ i ].acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
773 | headerSWF[ i ].acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
757 | headerSWF[ i ].acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
774 | headerSWF[ i ].acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
758 | headerSWF[ i ].acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
775 | headerSWF[ i ].acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time); |
|
759 | headerSWF[ i ].acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time); | |
776 | headerSWF[ i ].acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
760 | headerSWF[ i ].acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
777 | headerSWF[ i ].acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time); |
|
761 | headerSWF[ i ].acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time); | |
778 | headerSWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
762 | headerSWF[ i ].time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
779 | headerSWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
763 | headerSWF[ i ].time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
780 | headerSWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
764 | headerSWF[ i ].time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
781 | headerSWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
765 | headerSWF[ i ].time[3] = (unsigned char) (time_management_regs->coarse_time); | |
782 | headerSWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
766 | headerSWF[ i ].time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
783 | headerSWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time); |
|
767 | headerSWF[ i ].time[5] = (unsigned char) (time_management_regs->fine_time); | |
784 | // SEND PACKET |
|
768 | // SEND PACKET | |
785 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_SWF, ACTION_MSG_SPW_IOCTL_SEND_SIZE); |
|
769 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_SWF, ACTION_MSG_SPW_IOCTL_SEND_SIZE); | |
786 | if (status != RTEMS_SUCCESSFUL) { |
|
770 | if (status != RTEMS_SUCCESSFUL) { | |
787 | printf("%d-%d, ERR %d\n", sid, i, (int) status); |
|
771 | printf("%d-%d, ERR %d\n", sid, i, (int) status); | |
788 | ret = LFR_DEFAULT; |
|
772 | ret = LFR_DEFAULT; | |
789 | } |
|
773 | } | |
790 | rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds |
|
774 | rtems_task_wake_after(TIME_BETWEEN_TWO_SWF_PACKETS); // 300 ms between each packet => 7 * 3 = 21 packets => 6.3 seconds | |
791 | } |
|
775 | } | |
792 |
|
776 | |||
793 | return ret; |
|
777 | return ret; | |
794 | } |
|
778 | } | |
795 |
|
779 | |||
796 | int send_waveform_CWF(volatile int *waveform, unsigned int sid, |
|
780 | int send_waveform_CWF(volatile int *waveform, unsigned int sid, | |
797 | Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id) |
|
781 | Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id) | |
798 | { |
|
782 | { | |
799 | /** This function sends CWF CCSDS packets (F2, F1 or F0). |
|
783 | /** This function sends CWF CCSDS packets (F2, F1 or F0). | |
800 | * |
|
784 | * | |
801 | * @param waveform points to the buffer containing the data that will be send. |
|
785 | * @param waveform points to the buffer containing the data that will be send. | |
802 | * @param sid is the source identifier of the data that will be sent. |
|
786 | * @param sid is the source identifier of the data that will be sent. | |
803 | * @param headerCWF points to a table of headers that have been prepared for the data transmission. |
|
787 | * @param headerCWF points to a table of headers that have been prepared for the data transmission. | |
804 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures |
|
788 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures | |
805 | * contain information to setup the transmission of the data packets. |
|
789 | * contain information to setup the transmission of the data packets. | |
806 | * |
|
790 | * | |
807 | * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks. |
|
791 | * One group of 2048 samples is sent as 7 consecutive packets, 6 packets containing 340 blocks and 8 packets containing 8 blocks. | |
808 | * |
|
792 | * | |
809 | */ |
|
793 | */ | |
810 |
|
794 | |||
811 | unsigned int i; |
|
795 | unsigned int i; | |
812 | int ret; |
|
796 | int ret; | |
813 | rtems_status_code status; |
|
797 | rtems_status_code status; | |
814 | spw_ioctl_pkt_send spw_ioctl_send_CWF; |
|
798 | spw_ioctl_pkt_send spw_ioctl_send_CWF; | |
815 |
|
799 | |||
816 | spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header |
|
800 | spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header | |
817 | spw_ioctl_send_CWF.options = 0; |
|
801 | spw_ioctl_send_CWF.options = 0; | |
818 |
|
802 | |||
819 | ret = LFR_DEFAULT; |
|
803 | ret = LFR_DEFAULT; | |
820 |
|
804 | |||
821 | for (i=0; i<7; i++) // send waveform |
|
805 | for (i=0; i<7; i++) // send waveform | |
822 | { |
|
806 | { | |
823 | int coarseTime = 0x00; |
|
807 | int coarseTime = 0x00; | |
824 | int fineTime = 0x00; |
|
808 | int fineTime = 0x00; | |
825 | spw_ioctl_send_CWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ]; |
|
809 | spw_ioctl_send_CWF.data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ]; | |
826 | spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ]; |
|
810 | spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ]; | |
827 | // BUILD THE DATA |
|
811 | // BUILD THE DATA | |
828 | if (i==6) { |
|
812 | if (i==6) { | |
829 | spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_SWF_BLK; |
|
813 | spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_SWF_BLK; | |
830 | } |
|
814 | } | |
831 | else { |
|
815 | else { | |
832 | spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_SWF_BLK; |
|
816 | spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_SWF_BLK; | |
833 | } |
|
817 | } | |
834 | // SET PACKET SEQUENCE COUNTER |
|
818 | // SET PACKET SEQUENCE COUNTER | |
835 | increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, sid ); |
|
819 | increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, sid ); | |
836 | // SET PACKET TIME |
|
820 | // SET PACKET TIME | |
837 | coarseTime = time_management_regs->coarse_time; |
|
821 | coarseTime = time_management_regs->coarse_time; | |
838 | fineTime = time_management_regs->fine_time; |
|
822 | fineTime = time_management_regs->fine_time; | |
839 | headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24); |
|
823 | headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24); | |
840 | headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16); |
|
824 | headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16); | |
841 | headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8); |
|
825 | headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8); | |
842 | headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime); |
|
826 | headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime); | |
843 | headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8); |
|
827 | headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8); | |
844 | headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime); |
|
828 | headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime); | |
845 | headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24); |
|
829 | headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24); | |
846 | headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16); |
|
830 | headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16); | |
847 | headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8); |
|
831 | headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8); | |
848 | headerCWF[ i ].time[3] = (unsigned char) (coarseTime); |
|
832 | headerCWF[ i ].time[3] = (unsigned char) (coarseTime); | |
849 | headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8); |
|
833 | headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8); | |
850 | headerCWF[ i ].time[5] = (unsigned char) (fineTime); |
|
834 | headerCWF[ i ].time[5] = (unsigned char) (fineTime); | |
851 | // SEND PACKET |
|
835 | // SEND PACKET | |
852 | if (sid == SID_NORM_CWF_F3) |
|
836 | if (sid == SID_NORM_CWF_F3) | |
853 | { |
|
837 | { | |
854 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); |
|
838 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); | |
855 | if (status != RTEMS_SUCCESSFUL) { |
|
839 | if (status != RTEMS_SUCCESSFUL) { | |
856 | printf("%d-%d, ERR %d\n", sid, i, (int) status); |
|
840 | printf("%d-%d, ERR %d\n", sid, i, (int) status); | |
857 | ret = LFR_DEFAULT; |
|
841 | ret = LFR_DEFAULT; | |
858 | } |
|
842 | } | |
859 | rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS); |
|
843 | rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS); | |
860 | } |
|
844 | } | |
861 | else |
|
845 | else | |
862 | { |
|
846 | { | |
863 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); |
|
847 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); | |
864 | if (status != RTEMS_SUCCESSFUL) { |
|
848 | if (status != RTEMS_SUCCESSFUL) { | |
865 | printf("%d-%d, ERR %d\n", sid, i, (int) status); |
|
849 | printf("%d-%d, ERR %d\n", sid, i, (int) status); | |
866 | ret = LFR_DEFAULT; |
|
850 | ret = LFR_DEFAULT; | |
867 | } |
|
851 | } | |
868 | } |
|
852 | } | |
869 | } |
|
853 | } | |
870 |
|
854 | |||
871 | return ret; |
|
855 | return ret; | |
872 | } |
|
856 | } | |
873 |
|
857 | |||
874 | int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id) |
|
858 | int send_waveform_CWF3_light(volatile int *waveform, Header_TM_LFR_SCIENCE_CWF_t *headerCWF, rtems_id queue_id) | |
875 | { |
|
859 | { | |
876 | /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data. |
|
860 | /** This function sends CWF_F3 CCSDS packets without the b1, b2 and b3 data. | |
877 | * |
|
861 | * | |
878 | * @param waveform points to the buffer containing the data that will be send. |
|
862 | * @param waveform points to the buffer containing the data that will be send. | |
879 | * @param headerCWF points to a table of headers that have been prepared for the data transmission. |
|
863 | * @param headerCWF points to a table of headers that have been prepared for the data transmission. | |
880 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures |
|
864 | * @param queue_id is the id of the rtems queue to which spw_ioctl_pkt_send structures will be send. The structures | |
881 | * contain information to setup the transmission of the data packets. |
|
865 | * contain information to setup the transmission of the data packets. | |
882 | * |
|
866 | * | |
883 | * By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer |
|
867 | * By default, CWF_F3 packet are send without the b1, b2 and b3 data. This function rebuilds a data buffer | |
884 | * from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks. |
|
868 | * from the incoming data and sends it in 7 packets, 6 containing 340 blocks and 1 one containing 8 blocks. | |
885 | * |
|
869 | * | |
886 | */ |
|
870 | */ | |
887 |
|
871 | |||
888 | unsigned int i; |
|
872 | unsigned int i; | |
889 | int ret; |
|
873 | int ret; | |
890 | rtems_status_code status; |
|
874 | rtems_status_code status; | |
891 | spw_ioctl_pkt_send spw_ioctl_send_CWF; |
|
875 | spw_ioctl_pkt_send spw_ioctl_send_CWF; | |
892 | char *sample; |
|
876 | char *sample; | |
893 |
|
877 | |||
894 | spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header |
|
878 | spw_ioctl_send_CWF.hlen = TM_HEADER_LEN + 4 + 10; // + 4 is for the protocole extra header, + 10 is for the auxiliary header | |
895 | spw_ioctl_send_CWF.options = 0; |
|
879 | spw_ioctl_send_CWF.options = 0; | |
896 |
|
880 | |||
897 | ret = LFR_DEFAULT; |
|
881 | ret = LFR_DEFAULT; | |
898 |
|
882 | |||
899 | //********************** |
|
883 | //********************** | |
900 | // BUILD CWF3_light DATA |
|
884 | // BUILD CWF3_light DATA | |
901 | for ( i=0; i< 2048; i++) |
|
885 | for ( i=0; i< 2048; i++) | |
902 | { |
|
886 | { | |
903 | sample = (char*) &waveform[ i * NB_WORDS_SWF_BLK ]; |
|
887 | sample = (char*) &waveform[ i * NB_WORDS_SWF_BLK ]; | |
904 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) ] = sample[ 0 ]; |
|
888 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) ] = sample[ 0 ]; | |
905 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 ] = sample[ 1 ]; |
|
889 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 1 ] = sample[ 1 ]; | |
906 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 ] = sample[ 2 ]; |
|
890 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 2 ] = sample[ 2 ]; | |
907 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 ] = sample[ 3 ]; |
|
891 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 3 ] = sample[ 3 ]; | |
908 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 ] = sample[ 4 ]; |
|
892 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 4 ] = sample[ 4 ]; | |
909 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ]; |
|
893 | wf_cont_f3_light[ (i * NB_BYTES_CWF3_LIGHT_BLK) + 5 ] = sample[ 5 ]; | |
910 | } |
|
894 | } | |
911 |
|
895 | |||
912 | //********************* |
|
896 | //********************* | |
913 | // SEND CWF3_light DATA |
|
897 | // SEND CWF3_light DATA | |
914 |
|
898 | |||
915 | for (i=0; i<7; i++) // send waveform |
|
899 | for (i=0; i<7; i++) // send waveform | |
916 | { |
|
900 | { | |
917 | int coarseTime = 0x00; |
|
901 | int coarseTime = 0x00; | |
918 | int fineTime = 0x00; |
|
902 | int fineTime = 0x00; | |
919 | spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * 340 * NB_BYTES_CWF3_LIGHT_BLK) ]; |
|
903 | spw_ioctl_send_CWF.data = (char*) &wf_cont_f3_light[ (i * 340 * NB_BYTES_CWF3_LIGHT_BLK) ]; | |
920 | spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ]; |
|
904 | spw_ioctl_send_CWF.hdr = (char*) &headerCWF[ i ]; | |
921 | // BUILD THE DATA |
|
905 | // BUILD THE DATA | |
922 | if ( i == WFRM_INDEX_OF_LAST_PACKET ) { |
|
906 | if ( i == WFRM_INDEX_OF_LAST_PACKET ) { | |
923 | spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_CWF3_LIGHT_BLK; |
|
907 | spw_ioctl_send_CWF.dlen = 8 * NB_BYTES_CWF3_LIGHT_BLK; | |
924 | } |
|
908 | } | |
925 | else { |
|
909 | else { | |
926 | spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_CWF3_LIGHT_BLK; |
|
910 | spw_ioctl_send_CWF.dlen = 340 * NB_BYTES_CWF3_LIGHT_BLK; | |
927 | } |
|
911 | } | |
928 | // SET PACKET SEQUENCE COUNTER |
|
912 | // SET PACKET SEQUENCE COUNTER | |
929 | increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, SID_NORM_CWF_F3 ); |
|
913 | increment_seq_counter_source_id( headerCWF[ i ].packetSequenceControl, SID_NORM_CWF_F3 ); | |
930 | // SET PACKET TIME |
|
914 | // SET PACKET TIME | |
931 | coarseTime = time_management_regs->coarse_time; |
|
915 | coarseTime = time_management_regs->coarse_time; | |
932 | fineTime = time_management_regs->fine_time; |
|
916 | fineTime = time_management_regs->fine_time; | |
933 | headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24); |
|
917 | headerCWF[ i ].acquisitionTime[0] = (unsigned char) (coarseTime>>24); | |
934 | headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16); |
|
918 | headerCWF[ i ].acquisitionTime[1] = (unsigned char) (coarseTime>>16); | |
935 | headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8); |
|
919 | headerCWF[ i ].acquisitionTime[2] = (unsigned char) (coarseTime>>8); | |
936 | headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime); |
|
920 | headerCWF[ i ].acquisitionTime[3] = (unsigned char) (coarseTime); | |
937 | headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8); |
|
921 | headerCWF[ i ].acquisitionTime[4] = (unsigned char) (fineTime>>8); | |
938 | headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime); |
|
922 | headerCWF[ i ].acquisitionTime[5] = (unsigned char) (fineTime); | |
939 | headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24); |
|
923 | headerCWF[ i ].time[0] = (unsigned char) (coarseTime>>24); | |
940 | headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16); |
|
924 | headerCWF[ i ].time[1] = (unsigned char) (coarseTime>>16); | |
941 | headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8); |
|
925 | headerCWF[ i ].time[2] = (unsigned char) (coarseTime>>8); | |
942 | headerCWF[ i ].time[3] = (unsigned char) (coarseTime); |
|
926 | headerCWF[ i ].time[3] = (unsigned char) (coarseTime); | |
943 | headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8); |
|
927 | headerCWF[ i ].time[4] = (unsigned char) (fineTime>>8); | |
944 | headerCWF[ i ].time[5] = (unsigned char) (fineTime); |
|
928 | headerCWF[ i ].time[5] = (unsigned char) (fineTime); | |
945 | // SEND PACKET |
|
929 | // SEND PACKET | |
946 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); |
|
930 | status = rtems_message_queue_send( queue_id, &spw_ioctl_send_CWF, sizeof(spw_ioctl_send_CWF)); | |
947 | if (status != RTEMS_SUCCESSFUL) { |
|
931 | if (status != RTEMS_SUCCESSFUL) { | |
948 | printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status); |
|
932 | printf("%d-%d, ERR %d\n", SID_NORM_CWF_F3, i, (int) status); | |
949 | ret = LFR_DEFAULT; |
|
933 | ret = LFR_DEFAULT; | |
950 | } |
|
934 | } | |
951 | rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS); |
|
935 | rtems_task_wake_after(TIME_BETWEEN_TWO_CWF3_PACKETS); | |
952 | } |
|
936 | } | |
953 |
|
937 | |||
954 | return ret; |
|
938 | return ret; | |
955 | } |
|
939 | } | |
956 |
|
940 | |||
957 |
|
941 | |||
958 | //************** |
|
942 | //************** | |
959 | // wfp registers |
|
943 | // wfp registers | |
960 | void set_wfp_data_shaping() |
|
944 | void set_wfp_data_shaping() | |
961 | { |
|
945 | { | |
962 | /** This function sets the data_shaping register of the waveform picker module. |
|
946 | /** This function sets the data_shaping register of the waveform picker module. | |
963 | * |
|
947 | * | |
964 | * The value is read from one field of the parameter_dump_packet structure:\n |
|
948 | * The value is read from one field of the parameter_dump_packet structure:\n | |
965 | * bw_sp0_sp1_r0_r1 |
|
949 | * bw_sp0_sp1_r0_r1 | |
966 | * |
|
950 | * | |
967 | */ |
|
951 | */ | |
968 |
|
952 | |||
969 | unsigned char data_shaping; |
|
953 | unsigned char data_shaping; | |
970 |
|
954 | |||
971 | // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register |
|
955 | // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register | |
972 | // waveform picker : [R1 R0 SP1 SP0 BW] |
|
956 | // waveform picker : [R1 R0 SP1 SP0 BW] | |
973 |
|
957 | |||
974 | data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1; |
|
958 | data_shaping = parameter_dump_packet.bw_sp0_sp1_r0_r1; | |
975 |
|
959 | |||
976 | #ifdef GSA |
|
960 | #ifdef GSA | |
977 | #else |
|
961 | #else | |
978 | new_waveform_picker_regs->data_shaping = |
|
962 | new_waveform_picker_regs->data_shaping = | |
979 | ( (data_shaping & 0x10) >> 4 ) // BW |
|
963 | ( (data_shaping & 0x10) >> 4 ) // BW | |
980 | + ( (data_shaping & 0x08) >> 2 ) // SP0 |
|
964 | + ( (data_shaping & 0x08) >> 2 ) // SP0 | |
981 | + ( (data_shaping & 0x04) ) // SP1 |
|
965 | + ( (data_shaping & 0x04) ) // SP1 | |
982 | + ( (data_shaping & 0x02) << 2 ) // R0 |
|
966 | + ( (data_shaping & 0x02) << 2 ) // R0 | |
983 | + ( (data_shaping & 0x01) << 4 ); // R1 |
|
967 | + ( (data_shaping & 0x01) << 4 ); // R1 | |
984 | #endif |
|
968 | #endif | |
985 | } |
|
969 | } | |
986 |
|
970 | |||
987 | char set_wfp_delta_snapshot() |
|
971 | char set_wfp_delta_snapshot() | |
988 | { |
|
972 | { | |
989 | /** This function sets the delta_snapshot register of the waveform picker module. |
|
973 | /** This function sets the delta_snapshot register of the waveform picker module. | |
990 | * |
|
974 | * | |
991 | * The value is read from two (unsigned char) of the parameter_dump_packet structure: |
|
975 | * The value is read from two (unsigned char) of the parameter_dump_packet structure: | |
992 | * - sy_lfr_n_swf_p[0] |
|
976 | * - sy_lfr_n_swf_p[0] | |
993 | * - sy_lfr_n_swf_p[1] |
|
977 | * - sy_lfr_n_swf_p[1] | |
994 | * |
|
978 | * | |
995 | */ |
|
979 | */ | |
996 |
|
980 | |||
997 | char ret; |
|
981 | char ret; | |
998 | unsigned int delta_snapshot; |
|
982 | unsigned int delta_snapshot; | |
999 | unsigned int aux; |
|
983 | unsigned int aux; | |
1000 |
|
984 | |||
1001 | aux = 0; |
|
985 | aux = 0; | |
1002 | ret = LFR_DEFAULT; |
|
986 | ret = LFR_DEFAULT; | |
1003 |
|
987 | |||
1004 | delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256 |
|
988 | delta_snapshot = parameter_dump_packet.sy_lfr_n_swf_p[0]*256 | |
1005 | + parameter_dump_packet.sy_lfr_n_swf_p[1]; |
|
989 | + parameter_dump_packet.sy_lfr_n_swf_p[1]; | |
1006 |
|
990 | |||
1007 | #ifdef GSA |
|
991 | #ifdef GSA | |
1008 | #else |
|
992 | #else | |
1009 | if ( delta_snapshot < MIN_DELTA_SNAPSHOT ) |
|
993 | if ( delta_snapshot < MIN_DELTA_SNAPSHOT ) | |
1010 | { |
|
994 | { | |
1011 | aux = MIN_DELTA_SNAPSHOT; |
|
995 | aux = MIN_DELTA_SNAPSHOT; | |
1012 | ret = LFR_DEFAULT; |
|
996 | ret = LFR_DEFAULT; | |
1013 | } |
|
997 | } | |
1014 | else |
|
998 | else | |
1015 | { |
|
999 | { | |
1016 | aux = delta_snapshot ; |
|
1000 | aux = delta_snapshot ; | |
1017 | ret = LFR_SUCCESSFUL; |
|
1001 | ret = LFR_SUCCESSFUL; | |
1018 | } |
|
1002 | } | |
1019 | new_waveform_picker_regs->delta_snapshot = aux - 1; // max 2 bytes |
|
1003 | new_waveform_picker_regs->delta_snapshot = aux - 1; // max 2 bytes | |
1020 | #endif |
|
1004 | #endif | |
1021 |
|
1005 | |||
1022 | return ret; |
|
1006 | return ret; | |
1023 | } |
|
1007 | } | |
1024 |
|
1008 | |||
1025 | void set_wfp_burst_enable_register( unsigned char mode) |
|
1009 | void set_wfp_burst_enable_register( unsigned char mode) | |
1026 | { |
|
1010 | { | |
1027 | /** This function sets the waveform picker burst_enable register depending on the mode. |
|
1011 | /** This function sets the waveform picker burst_enable register depending on the mode. | |
1028 | * |
|
1012 | * | |
1029 | * @param mode is the LFR mode to launch. |
|
1013 | * @param mode is the LFR mode to launch. | |
1030 | * |
|
1014 | * | |
1031 | * The burst bits shall be before the enable bits. |
|
1015 | * The burst bits shall be before the enable bits. | |
1032 | * |
|
1016 | * | |
1033 | */ |
|
1017 | */ | |
1034 |
|
1018 | |||
1035 | #ifdef GSA |
|
1019 | #ifdef GSA | |
1036 | #else |
|
1020 | #else | |
1037 | // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0 |
|
1021 | // [0000 0000] burst f2, f1, f0 enable f3 f2 f1 f0 | |
1038 | // the burst bits shall be set first, before the enable bits |
|
1022 | // the burst bits shall be set first, before the enable bits | |
1039 | switch(mode) { |
|
1023 | switch(mode) { | |
1040 | case(LFR_MODE_NORMAL): |
|
1024 | case(LFR_MODE_NORMAL): | |
1041 |
new_waveform_picker_regs->run_burst_enable = 0x |
|
1025 | new_waveform_picker_regs->run_burst_enable = 0x80; // [1000 0000] f3 burst enable | |
1042 |
|
|
1026 | new_waveform_picker_regs->run_burst_enable = 0x0f; // [0000 1111] enable f3 f2 f1 f0 | |
1043 | // new_waveform_picker_regs->run_burst_enable = 0x07; // [0000 0111] enable f2 f1 f0 |
|
|||
1044 | // new_waveform_picker_regs->run_burst_enable = 0x01; // [0000 0001] enable f0 |
|
|||
1045 | new_waveform_picker_regs->run_burst_enable = 0x04; // [0000 0100] enable f0 |
|
|||
1046 | break; |
|
1027 | break; | |
1047 | case(LFR_MODE_BURST): |
|
1028 | case(LFR_MODE_BURST): | |
1048 | new_waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled |
|
1029 | new_waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled | |
1049 | new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2 |
|
1030 | new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x04; // [0100] enable f2 | |
1050 | break; |
|
1031 | break; | |
1051 | case(LFR_MODE_SBM1): |
|
1032 | case(LFR_MODE_SBM1): | |
1052 | new_waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled |
|
1033 | new_waveform_picker_regs->run_burst_enable = 0x20; // [0010 0000] f1 burst enabled | |
1053 | new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0 |
|
1034 | new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0 | |
1054 | break; |
|
1035 | break; | |
1055 | case(LFR_MODE_SBM2): |
|
1036 | case(LFR_MODE_SBM2): | |
1056 | new_waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled |
|
1037 | new_waveform_picker_regs->run_burst_enable = 0x40; // [0100 0000] f2 burst enabled | |
1057 | new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0 |
|
1038 | new_waveform_picker_regs->run_burst_enable = new_waveform_picker_regs->run_burst_enable | 0x0f; // [1111] enable f3 f2 f1 f0 | |
1058 | break; |
|
1039 | break; | |
1059 | default: |
|
1040 | default: | |
1060 | new_waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled |
|
1041 | new_waveform_picker_regs->run_burst_enable = 0x00; // [0000 0000] no burst enabled, no waveform enabled | |
1061 | break; |
|
1042 | break; | |
1062 | } |
|
1043 | } | |
1063 | #endif |
|
1044 | #endif | |
1064 | } |
|
1045 | } | |
1065 |
|
1046 | |||
1066 | void reset_wfp_run_burst_enable() |
|
1047 | void reset_wfp_run_burst_enable() | |
1067 | { |
|
1048 | { | |
1068 | /** This function resets the waveform picker burst_enable register. |
|
1049 | /** This function resets the waveform picker burst_enable register. | |
1069 | * |
|
1050 | * | |
1070 | * The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0. |
|
1051 | * The burst bits [f2 f1 f0] and the enable bits [f3 f2 f1 f0] are set to 0. | |
1071 | * |
|
1052 | * | |
1072 | */ |
|
1053 | */ | |
1073 |
|
1054 | |||
1074 | #ifdef GSA |
|
1055 | #ifdef GSA | |
1075 | #else |
|
1056 | #else | |
1076 | new_waveform_picker_regs->run_burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 |
|
1057 | new_waveform_picker_regs->run_burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 | |
1077 | #endif |
|
1058 | #endif | |
1078 | } |
|
1059 | } | |
1079 |
|
1060 | |||
1080 | void reset_wfp_status() |
|
1061 | void reset_wfp_status() | |
1081 | { |
|
1062 | { | |
1082 | /** This function resets the waveform picker status register. |
|
1063 | /** This function resets the waveform picker status register. | |
1083 | * |
|
1064 | * | |
1084 | * All status bits are set to 0 [new_err full_err full]. |
|
1065 | * All status bits are set to 0 [new_err full_err full]. | |
1085 | * |
|
1066 | * | |
1086 | */ |
|
1067 | */ | |
1087 |
|
1068 | |||
1088 | #ifdef GSA |
|
1069 | #ifdef GSA | |
1089 | #else |
|
1070 | #else | |
1090 | new_waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 |
|
1071 | new_waveform_picker_regs->status = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 | |
1091 | #endif |
|
1072 | #endif | |
1092 | } |
|
1073 | } | |
1093 |
|
1074 | |||
1094 | void reset_new_waveform_picker_regs() |
|
1075 | void reset_new_waveform_picker_regs() | |
1095 | { |
|
1076 | { | |
1096 | /** This function resets the waveform picker module registers. |
|
1077 | /** This function resets the waveform picker module registers. | |
1097 | * |
|
1078 | * | |
1098 | * The registers affected by this function are located at the following offset addresses: |
|
1079 | * The registers affected by this function are located at the following offset addresses: | |
1099 | * - 0x00 data_shaping |
|
1080 | * - 0x00 data_shaping | |
1100 | * - 0x04 run_burst_enable |
|
1081 | * - 0x04 run_burst_enable | |
1101 | * - 0x08 addr_data_f0 |
|
1082 | * - 0x08 addr_data_f0 | |
1102 | * - 0x0C addr_data_f1 |
|
1083 | * - 0x0C addr_data_f1 | |
1103 | * - 0x10 addr_data_f2 |
|
1084 | * - 0x10 addr_data_f2 | |
1104 | * - 0x14 addr_data_f3 |
|
1085 | * - 0x14 addr_data_f3 | |
1105 | * - 0x18 status |
|
1086 | * - 0x18 status | |
1106 | * - 0x1C delta_snapshot |
|
1087 | * - 0x1C delta_snapshot | |
1107 | * - 0x20 delta_f0 |
|
1088 | * - 0x20 delta_f0 | |
1108 | * - 0x24 delta_f0_2 |
|
1089 | * - 0x24 delta_f0_2 | |
1109 | * - 0x28 delta_f1 |
|
1090 | * - 0x28 delta_f1 | |
1110 | * - 0x2c delta_f2 |
|
1091 | * - 0x2c delta_f2 | |
1111 | * - 0x30 nb_data_by_buffer |
|
1092 | * - 0x30 nb_data_by_buffer | |
1112 | * - 0x34 nb_snapshot_param |
|
1093 | * - 0x34 nb_snapshot_param | |
1113 | * - 0x38 start_date |
|
1094 | * - 0x38 start_date | |
1114 | * - 0x3c nb_word_in_buffer |
|
1095 | * - 0x3c nb_word_in_buffer | |
1115 | * |
|
1096 | * | |
1116 | */ |
|
1097 | */ | |
1117 |
|
1098 | |||
1118 | unsigned int wf_snap_f0_aligned; |
|
|||
1119 | unsigned int wf_snap_f1_aligned; |
|
|||
1120 | unsigned int wf_snap_f2_aligned; |
|
|||
1121 | unsigned int wf_cont_f3_aligned; |
|
|||
1122 |
|
||||
1123 | new_waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW |
|
1099 | new_waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW | |
1124 | new_waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ] |
|
1100 | new_waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ] | |
1125 | wf_snap_f0_aligned = address_alignment( wf_snap_f0 ); |
|
1101 | new_waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // 0x08 | |
1126 | wf_snap_f1_aligned = address_alignment( wf_snap_f1 ); |
|
1102 | new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); // 0x0c | |
1127 | wf_snap_f2_aligned = address_alignment( wf_snap_f2 ); |
|
1103 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); // 0x10 | |
1128 | wf_cont_f3_aligned = address_alignment( wf_cont_f3 ); |
|
1104 | new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); // 0x14 | |
1129 | new_waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0_aligned); // 0x08 |
|
|||
1130 | new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_aligned); // 0x0c |
|
|||
1131 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_aligned); // 0x10 |
|
|||
1132 | new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_aligned); // 0x14 |
|
|||
1133 | new_waveform_picker_regs->status = 0x00; // 0x18 |
|
1105 | new_waveform_picker_regs->status = 0x00; // 0x18 | |
1134 | // new_waveform_picker_regs->delta_snapshot = 0x12800; // 0x1c 296 * 256 = 75776 |
|
1106 | // new_waveform_picker_regs->delta_snapshot = 0x12800; // 0x1c 296 * 256 = 75776 | |
1135 | // new_waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c 16 * 256 = 4096 |
|
1107 | // new_waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c 16 * 256 = 4096 | |
1136 | new_waveform_picker_regs->delta_snapshot = 0x2000; // 0x1c 32 * 256 = 8192 |
|
1108 | new_waveform_picker_regs->delta_snapshot = 0x2000; // 0x1c 32 * 256 = 8192 | |
1137 | new_waveform_picker_regs->delta_f0 = 0xbf5; // 0x20 *** 1013 |
|
1109 | new_waveform_picker_regs->delta_f0 = 0xbf5; // 0x20 *** 1013 | |
1138 | new_waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits] |
|
1110 | new_waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits] | |
1139 | new_waveform_picker_regs->delta_f1 = 0xbc0; // 0x28 *** 960 |
|
1111 | new_waveform_picker_regs->delta_f1 = 0xbc0; // 0x28 *** 960 | |
1140 | // new_waveform_picker_regs->delta_f2 = 0x12200; // 0x2c *** 74240 |
|
1112 | // new_waveform_picker_regs->delta_f2 = 0x12200; // 0x2c *** 74240 | |
1141 | new_waveform_picker_regs->delta_f2 = 0xc00; // 0x2c *** 12 * 256 = 3072 |
|
1113 | new_waveform_picker_regs->delta_f2 = 0xc00; // 0x2c *** 12 * 256 = 3072 | |
1142 | new_waveform_picker_regs->nb_data_by_buffer = 0x7ff; // 0x30 *** 2048 -1 => nb samples -1 |
|
1114 | new_waveform_picker_regs->nb_data_by_buffer = 0x7ff; // 0x30 *** 2048 -1 => nb samples -1 | |
1143 | new_waveform_picker_regs->snapshot_param = 0x800; // 0x34 *** 2048 => nb samples |
|
1115 | new_waveform_picker_regs->snapshot_param = 0x800; // 0x34 *** 2048 => nb samples | |
1144 | new_waveform_picker_regs->start_date = 0x00; // 0x38 |
|
1116 | new_waveform_picker_regs->start_date = 0x00; // 0x38 | |
1145 | new_waveform_picker_regs->nb_word_in_buffer = 0x1802; // 0x3c *** 2048 * 3 + 2 = 6146 |
|
1117 | new_waveform_picker_regs->nb_word_in_buffer = 0x1802; // 0x3c *** 2048 * 3 + 2 = 6146 | |
1146 | } |
|
1118 | } | |
1147 |
|
1119 | |||
1148 | void reset_new_waveform_picker_regs_alt() |
|
|||
1149 | { |
|
|||
1150 | /** This function resets the waveform picker module registers. |
|
|||
1151 | * |
|
|||
1152 | * The registers affected by this function are located at the following offset addresses: |
|
|||
1153 | * - 0x00 data_shaping |
|
|||
1154 | * - 0x04 run_burst_enable |
|
|||
1155 | * - 0x08 addr_data_f0 |
|
|||
1156 | * - 0x0C addr_data_f1 |
|
|||
1157 | * - 0x10 addr_data_f2 |
|
|||
1158 | * - 0x14 addr_data_f3 |
|
|||
1159 | * - 0x18 status |
|
|||
1160 | * - 0x1C delta_snapshot |
|
|||
1161 | * - 0x20 delta_f0 |
|
|||
1162 | * - 0x24 delta_f0_2 |
|
|||
1163 | * - 0x28 delta_f1 |
|
|||
1164 | * - 0x2c delta_f2 |
|
|||
1165 | * - 0x30 nb_data_by_buffer |
|
|||
1166 | * - 0x34 nb_snapshot_param |
|
|||
1167 | * - 0x38 start_date |
|
|||
1168 | * - 0x3c nb_word_in_buffer |
|
|||
1169 | * |
|
|||
1170 | */ |
|
|||
1171 |
|
||||
1172 | unsigned int wf_snap_f0_aligned; |
|
|||
1173 | unsigned int wf_snap_f1_aligned; |
|
|||
1174 | unsigned int wf_snap_f2_aligned; |
|
|||
1175 | unsigned int wf_cont_f3_aligned; |
|
|||
1176 |
|
||||
1177 | new_waveform_picker_regs->data_shaping = 0x01; // 0x00 *** R1 R0 SP1 SP0 BW |
|
|||
1178 | new_waveform_picker_regs->run_burst_enable = 0x00; // 0x04 *** [run *** burst f2, f1, f0 *** enable f3, f2, f1, f0 ] |
|
|||
1179 | wf_snap_f0_aligned = address_alignment( wf_snap_f0 ); |
|
|||
1180 | wf_snap_f1_aligned = address_alignment( wf_snap_f1 ); |
|
|||
1181 | wf_snap_f2_aligned = address_alignment( wf_snap_f2 ); |
|
|||
1182 | wf_cont_f3_aligned = address_alignment( wf_cont_f3 ); |
|
|||
1183 | new_waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0_aligned); // 0x08 |
|
|||
1184 | new_waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_aligned); // 0x0c |
|
|||
1185 | new_waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2_aligned); // 0x10 |
|
|||
1186 | new_waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3_aligned); // 0x14 |
|
|||
1187 | new_waveform_picker_regs->status = 0x00; // 0x18 |
|
|||
1188 | // new_waveform_picker_regs->delta_snapshot = 0x12800; // 0x1c 296 * 256 = 75776 |
|
|||
1189 | new_waveform_picker_regs->delta_snapshot = 0x1000; // 0x1c 16 * 256 = 4096 |
|
|||
1190 | new_waveform_picker_regs->delta_f0 = 0xbf5; // 0x20 *** 1013 |
|
|||
1191 | new_waveform_picker_regs->delta_f0_2 = 0x7; // 0x24 *** 7 [7 bits] |
|
|||
1192 | new_waveform_picker_regs->delta_f1 = 0xbc0; // 0x28 *** 960 |
|
|||
1193 | // new_waveform_picker_regs->delta_f2 = 0x12200; // 0x2c *** 74240 |
|
|||
1194 | new_waveform_picker_regs->delta_f2 = 0xc00; // 0x2c *** 12 * 256 = 3072 |
|
|||
1195 | new_waveform_picker_regs->nb_data_by_buffer = 0x07; // 0x30 *** 7 |
|
|||
1196 | new_waveform_picker_regs->snapshot_param = 0x10; // 0x34 *** 16 |
|
|||
1197 | new_waveform_picker_regs->start_date = 0x00; // 0x38 |
|
|||
1198 | new_waveform_picker_regs->nb_word_in_buffer = 0x34; // 0x3c *** (3 * 8 + 2) * 2 |
|
|||
1199 | } |
|
|||
1200 |
|
||||
1201 | //***************** |
|
1120 | //***************** | |
1202 | // local parameters |
|
1121 | // local parameters | |
1203 | void set_local_sbm1_nb_cwf_max() |
|
1122 | void set_local_sbm1_nb_cwf_max() | |
1204 | { |
|
1123 | { | |
1205 | /** This function sets the value of the sbm1_nb_cwf_max local parameter. |
|
1124 | /** This function sets the value of the sbm1_nb_cwf_max local parameter. | |
1206 | * |
|
1125 | * | |
1207 | * The sbm1_nb_cwf_max parameter counts the number of CWF_F1 records that have been sent.\n |
|
1126 | * The sbm1_nb_cwf_max parameter counts the number of CWF_F1 records that have been sent.\n | |
1208 | * This parameter is used to send CWF_F1 data as normal data when the SBM1 is active.\n\n |
|
1127 | * This parameter is used to send CWF_F1 data as normal data when the SBM1 is active.\n\n | |
1209 | * (2 snapshots of 2048 points per seconds) * (period of the NORM snashots) - 8 s (duration of the f2 snapshot) |
|
1128 | * (2 snapshots of 2048 points per seconds) * (period of the NORM snashots) - 8 s (duration of the f2 snapshot) | |
1210 | * |
|
1129 | * | |
1211 | */ |
|
1130 | */ | |
1212 | param_local.local_sbm1_nb_cwf_max = 2 * |
|
1131 | param_local.local_sbm1_nb_cwf_max = 2 * | |
1213 | (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256 |
|
1132 | (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256 | |
1214 | + parameter_dump_packet.sy_lfr_n_swf_p[1]) - 8; // 16 CWF1 parts during 1 SWF2 |
|
1133 | + parameter_dump_packet.sy_lfr_n_swf_p[1]) - 8; // 16 CWF1 parts during 1 SWF2 | |
1215 | } |
|
1134 | } | |
1216 |
|
1135 | |||
1217 | void set_local_sbm2_nb_cwf_max() |
|
1136 | void set_local_sbm2_nb_cwf_max() | |
1218 | { |
|
1137 | { | |
1219 | /** This function sets the value of the sbm1_nb_cwf_max local parameter. |
|
1138 | /** This function sets the value of the sbm1_nb_cwf_max local parameter. | |
1220 | * |
|
1139 | * | |
1221 | * The sbm1_nb_cwf_max parameter counts the number of CWF_F1 records that have been sent.\n |
|
1140 | * The sbm1_nb_cwf_max parameter counts the number of CWF_F1 records that have been sent.\n | |
1222 | * This parameter is used to send CWF_F2 data as normal data when the SBM2 is active.\n\n |
|
1141 | * This parameter is used to send CWF_F2 data as normal data when the SBM2 is active.\n\n | |
1223 | * (period of the NORM snashots) / (8 seconds per snapshot at f2 = 256 Hz) |
|
1142 | * (period of the NORM snashots) / (8 seconds per snapshot at f2 = 256 Hz) | |
1224 | * |
|
1143 | * | |
1225 | */ |
|
1144 | */ | |
1226 |
|
1145 | |||
1227 | param_local.local_sbm2_nb_cwf_max = (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256 |
|
1146 | param_local.local_sbm2_nb_cwf_max = (parameter_dump_packet.sy_lfr_n_swf_p[0] * 256 | |
1228 | + parameter_dump_packet.sy_lfr_n_swf_p[1]) / 8; |
|
1147 | + parameter_dump_packet.sy_lfr_n_swf_p[1]) / 8; | |
1229 | } |
|
1148 | } | |
1230 |
|
1149 | |||
1231 | void set_local_nb_interrupt_f0_MAX() |
|
1150 | void set_local_nb_interrupt_f0_MAX() | |
1232 | { |
|
1151 | { | |
1233 | /** This function sets the value of the nb_interrupt_f0_MAX local parameter. |
|
1152 | /** This function sets the value of the nb_interrupt_f0_MAX local parameter. | |
1234 | * |
|
1153 | * | |
1235 | * This parameter is used for the SM validation only.\n |
|
1154 | * This parameter is used for the SM validation only.\n | |
1236 | * The software waits param_local.local_nb_interrupt_f0_MAX interruptions from the spectral matrices |
|
1155 | * The software waits param_local.local_nb_interrupt_f0_MAX interruptions from the spectral matrices | |
1237 | * module before launching a basic processing. |
|
1156 | * module before launching a basic processing. | |
1238 | * |
|
1157 | * | |
1239 | */ |
|
1158 | */ | |
1240 |
|
1159 | |||
1241 | param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256 |
|
1160 | param_local.local_nb_interrupt_f0_MAX = ( (parameter_dump_packet.sy_lfr_n_asm_p[0]) * 256 | |
1242 | + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100; |
|
1161 | + parameter_dump_packet.sy_lfr_n_asm_p[1] ) * 100; | |
1243 | } |
|
1162 | } | |
1244 |
|
1163 | |||
1245 | void reset_local_sbm1_nb_cwf_sent() |
|
1164 | void reset_local_sbm1_nb_cwf_sent() | |
1246 | { |
|
1165 | { | |
1247 | /** This function resets the value of the sbm1_nb_cwf_sent local parameter. |
|
1166 | /** This function resets the value of the sbm1_nb_cwf_sent local parameter. | |
1248 | * |
|
1167 | * | |
1249 | * The sbm1_nb_cwf_sent parameter counts the number of CWF_F1 records that have been sent.\n |
|
1168 | * The sbm1_nb_cwf_sent parameter counts the number of CWF_F1 records that have been sent.\n | |
1250 | * This parameter is used to send CWF_F1 data as normal data when the SBM1 is active. |
|
1169 | * This parameter is used to send CWF_F1 data as normal data when the SBM1 is active. | |
1251 | * |
|
1170 | * | |
1252 | */ |
|
1171 | */ | |
1253 |
|
1172 | |||
1254 | param_local.local_sbm1_nb_cwf_sent = 0; |
|
1173 | param_local.local_sbm1_nb_cwf_sent = 0; | |
1255 | } |
|
1174 | } | |
1256 |
|
1175 | |||
1257 | void reset_local_sbm2_nb_cwf_sent() |
|
1176 | void reset_local_sbm2_nb_cwf_sent() | |
1258 | { |
|
1177 | { | |
1259 | /** This function resets the value of the sbm2_nb_cwf_sent local parameter. |
|
1178 | /** This function resets the value of the sbm2_nb_cwf_sent local parameter. | |
1260 | * |
|
1179 | * | |
1261 | * The sbm2_nb_cwf_sent parameter counts the number of CWF_F2 records that have been sent.\n |
|
1180 | * The sbm2_nb_cwf_sent parameter counts the number of CWF_F2 records that have been sent.\n | |
1262 | * This parameter is used to send CWF_F2 data as normal data when the SBM2 mode is active. |
|
1181 | * This parameter is used to send CWF_F2 data as normal data when the SBM2 mode is active. | |
1263 | * |
|
1182 | * | |
1264 | */ |
|
1183 | */ | |
1265 |
|
1184 | |||
1266 | param_local.local_sbm2_nb_cwf_sent = 0; |
|
1185 | param_local.local_sbm2_nb_cwf_sent = 0; | |
1267 | } |
|
1186 | } | |
1268 |
|
1187 | |||
1269 | rtems_id get_pkts_queue_id( void ) |
|
1188 | rtems_id get_pkts_queue_id( void ) | |
1270 | { |
|
1189 | { | |
1271 | rtems_id queue_id; |
|
1190 | rtems_id queue_id; | |
1272 | rtems_status_code status; |
|
1191 | rtems_status_code status; | |
1273 | rtems_name queue_send_name; |
|
1192 | rtems_name queue_send_name; | |
1274 |
|
1193 | |||
1275 | queue_send_name = rtems_build_name( 'Q', '_', 'S', 'D' ); |
|
1194 | queue_send_name = rtems_build_name( 'Q', '_', 'S', 'D' ); | |
1276 |
|
1195 | |||
1277 | status = rtems_message_queue_ident( queue_send_name, 0, &queue_id ); |
|
1196 | status = rtems_message_queue_ident( queue_send_name, 0, &queue_id ); | |
1278 | if (status != RTEMS_SUCCESSFUL) |
|
1197 | if (status != RTEMS_SUCCESSFUL) | |
1279 | { |
|
1198 | { | |
1280 | PRINTF1("in get_pkts_queue_id *** ERR %d\n", status) |
|
1199 | PRINTF1("in get_pkts_queue_id *** ERR %d\n", status) | |
1281 | } |
|
1200 | } | |
1282 | return queue_id; |
|
1201 | return queue_id; | |
1283 | } |
|
1202 | } | |
1284 |
|
1203 | |||
1285 | void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ) |
|
1204 | void increment_seq_counter_source_id( unsigned char *packet_sequence_control, unsigned int sid ) | |
1286 | { |
|
1205 | { | |
1287 | unsigned short *sequence_cnt; |
|
1206 | unsigned short *sequence_cnt; | |
1288 | unsigned short segmentation_grouping_flag; |
|
1207 | unsigned short segmentation_grouping_flag; | |
1289 | unsigned short new_packet_sequence_control; |
|
1208 | unsigned short new_packet_sequence_control; | |
1290 |
|
1209 | |||
1291 | if ( (sid ==SID_NORM_SWF_F0) || (sid ==SID_NORM_SWF_F1) || (sid ==SID_NORM_SWF_F2) |
|
1210 | if ( (sid ==SID_NORM_SWF_F0) || (sid ==SID_NORM_SWF_F1) || (sid ==SID_NORM_SWF_F2) | |
1292 | || (sid ==SID_NORM_CWF_F3) || (sid ==SID_BURST_CWF_F2) ) |
|
1211 | || (sid ==SID_NORM_CWF_F3) || (sid ==SID_BURST_CWF_F2) ) | |
1293 | { |
|
1212 | { | |
1294 | sequence_cnt = &sequenceCounters_SCIENCE_NORMAL_BURST; |
|
1213 | sequence_cnt = &sequenceCounters_SCIENCE_NORMAL_BURST; | |
1295 | } |
|
1214 | } | |
1296 | else if ( (sid ==SID_SBM1_CWF_F1) || (sid ==SID_SBM2_CWF_F2) ) |
|
1215 | else if ( (sid ==SID_SBM1_CWF_F1) || (sid ==SID_SBM2_CWF_F2) ) | |
1297 | { |
|
1216 | { | |
1298 | sequence_cnt = &sequenceCounters_SCIENCE_SBM1_SBM2; |
|
1217 | sequence_cnt = &sequenceCounters_SCIENCE_SBM1_SBM2; | |
1299 | } |
|
1218 | } | |
1300 | else |
|
1219 | else | |
1301 | { |
|
1220 | { | |
1302 | sequence_cnt = &sequenceCounters_TC_EXE[ UNKNOWN ]; |
|
1221 | sequence_cnt = &sequenceCounters_TC_EXE[ UNKNOWN ]; | |
1303 | PRINTF1("in increment_seq_counter_source_id *** ERR apid_destid %d not known\n", sid) |
|
1222 | PRINTF1("in increment_seq_counter_source_id *** ERR apid_destid %d not known\n", sid) | |
1304 | } |
|
1223 | } | |
1305 |
|
1224 | |||
1306 | segmentation_grouping_flag = (packet_sequence_control[ 0 ] & 0xc0) << 8; |
|
1225 | segmentation_grouping_flag = (packet_sequence_control[ 0 ] & 0xc0) << 8; | |
1307 | *sequence_cnt = (*sequence_cnt) & 0x3fff; |
|
1226 | *sequence_cnt = (*sequence_cnt) & 0x3fff; | |
1308 |
|
1227 | |||
1309 | new_packet_sequence_control = segmentation_grouping_flag | *sequence_cnt ; |
|
1228 | new_packet_sequence_control = segmentation_grouping_flag | *sequence_cnt ; | |
1310 |
|
1229 | |||
1311 | packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8); |
|
1230 | packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8); | |
1312 | packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control ); |
|
1231 | packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control ); | |
1313 |
|
1232 | |||
1314 | // increment the sequence counter for the next packet |
|
1233 | // increment the sequence counter for the next packet | |
1315 | if ( *sequence_cnt < SEQ_CNT_MAX) |
|
1234 | if ( *sequence_cnt < SEQ_CNT_MAX) | |
1316 | { |
|
1235 | { | |
1317 | *sequence_cnt = *sequence_cnt + 1; |
|
1236 | *sequence_cnt = *sequence_cnt + 1; | |
1318 | } |
|
1237 | } | |
1319 | else |
|
1238 | else | |
1320 | { |
|
1239 | { | |
1321 | *sequence_cnt = 0; |
|
1240 | *sequence_cnt = 0; | |
1322 | } |
|
1241 | } | |
1323 | } |
|
1242 | } | |
1324 |
|
||||
1325 | unsigned int address_alignment( volatile int *address) |
|
|||
1326 | { |
|
|||
1327 | unsigned char i; |
|
|||
1328 | unsigned char lastByte; |
|
|||
1329 | unsigned int addressAligned; |
|
|||
1330 |
|
||||
1331 | addressAligned = (unsigned int) address; |
|
|||
1332 |
|
||||
1333 | PRINTF1("address %x\n", addressAligned ); |
|
|||
1334 |
|
||||
1335 | for (i=0; i<256; i++) |
|
|||
1336 | { |
|
|||
1337 | lastByte = (unsigned char) ( addressAligned & 0x000000ff ) ; |
|
|||
1338 | if (lastByte == 0x00) |
|
|||
1339 | { |
|
|||
1340 | break; |
|
|||
1341 | } |
|
|||
1342 | else |
|
|||
1343 | { |
|
|||
1344 | addressAligned = addressAligned + 1; |
|
|||
1345 | } |
|
|||
1346 | } |
|
|||
1347 |
|
||||
1348 | PRINTF2("i = %d, address %x\n", i, (int) addressAligned); |
|
|||
1349 |
|
||||
1350 | return addressAligned; |
|
|||
1351 | } |
|
General Comments 0
You need to be logged in to leave comments.
Login now