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