@@ -1,253 +1,253 | |||||
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: T |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.5) on: Tue Apr 22 18:10:21 2014 | |
4 | # Project: fsw-qt.pro |
|
4 | # Project: fsw-qt.pro | |
5 | # Template: app |
|
5 | # Template: app | |
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
7 | ############################################################################# |
|
7 | ############################################################################# | |
8 |
|
8 | |||
9 | ####### Compiler, tools and options |
|
9 | ####### Compiler, tools and options | |
10 |
|
10 | |||
11 | CC = sparc-rtems-gcc |
|
11 | CC = sparc-rtems-gcc | |
12 | CXX = sparc-rtems-g++ |
|
12 | CXX = sparc-rtems-g++ | |
13 | DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=6 -DPRINT_MESSAGES_ON_CONSOLE -DPRINT_TASK_STATISTICS -DBOOT_MESSAGES |
|
13 | DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=6 -DPRINT_MESSAGES_ON_CONSOLE -DPRINT_TASK_STATISTICS -DBOOT_MESSAGES | |
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) | |
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) | |
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../src/basic_parameters |
|
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../src/basic_parameters | |
17 | LINK = sparc-rtems-g++ |
|
17 | LINK = sparc-rtems-g++ | |
18 | LFLAGS = |
|
18 | LFLAGS = | |
19 | LIBS = $(SUBLIBS) |
|
19 | LIBS = $(SUBLIBS) | |
20 | AR = sparc-rtems-ar rcs |
|
20 | AR = sparc-rtems-ar rcs | |
21 | RANLIB = |
|
21 | RANLIB = | |
22 | QMAKE = /usr/bin/qmake-qt4 |
|
22 | QMAKE = /usr/bin/qmake-qt4 | |
23 | TAR = tar -cf |
|
23 | TAR = tar -cf | |
24 | COMPRESS = gzip -9f |
|
24 | COMPRESS = gzip -9f | |
25 | COPY = cp -f |
|
25 | COPY = cp -f | |
26 | SED = sed |
|
26 | SED = sed | |
27 | COPY_FILE = $(COPY) |
|
27 | COPY_FILE = $(COPY) | |
28 | COPY_DIR = $(COPY) -r |
|
28 | COPY_DIR = $(COPY) -r | |
29 | STRIP = sparc-rtems-strip |
|
29 | STRIP = sparc-rtems-strip | |
30 | INSTALL_FILE = install -m 644 -p |
|
30 | INSTALL_FILE = install -m 644 -p | |
31 | INSTALL_DIR = $(COPY_DIR) |
|
31 | INSTALL_DIR = $(COPY_DIR) | |
32 | INSTALL_PROGRAM = install -m 755 -p |
|
32 | INSTALL_PROGRAM = install -m 755 -p | |
33 | DEL_FILE = rm -f |
|
33 | DEL_FILE = rm -f | |
34 | SYMLINK = ln -f -s |
|
34 | SYMLINK = ln -f -s | |
35 | DEL_DIR = rmdir |
|
35 | DEL_DIR = rmdir | |
36 | MOVE = mv -f |
|
36 | MOVE = mv -f | |
37 | CHK_DIR_EXISTS= test -d |
|
37 | CHK_DIR_EXISTS= test -d | |
38 | MKDIR = mkdir -p |
|
38 | MKDIR = mkdir -p | |
39 |
|
39 | |||
40 | ####### Output directory |
|
40 | ####### Output directory | |
41 |
|
41 | |||
42 | OBJECTS_DIR = obj/ |
|
42 | OBJECTS_DIR = obj/ | |
43 |
|
43 | |||
44 | ####### Files |
|
44 | ####### Files | |
45 |
|
45 | |||
46 | SOURCES = ../src/wf_handler.c \ |
|
46 | SOURCES = ../src/wf_handler.c \ | |
47 | ../src/tc_handler.c \ |
|
47 | ../src/tc_handler.c \ | |
48 | ../src/fsw_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 | ../src/basic_parameters/basic_parameters.c |
|
56 | ../src/basic_parameters/basic_parameters.c | |
57 | OBJECTS = obj/wf_handler.o \ |
|
57 | OBJECTS = obj/wf_handler.o \ | |
58 | obj/tc_handler.o \ |
|
58 | obj/tc_handler.o \ | |
59 | obj/fsw_processing.o \ |
|
59 | obj/fsw_processing.o \ | |
60 | obj/fsw_misc.o \ |
|
60 | obj/fsw_misc.o \ | |
61 | obj/fsw_init.o \ |
|
61 | obj/fsw_init.o \ | |
62 | obj/fsw_globals.o \ |
|
62 | obj/fsw_globals.o \ | |
63 | obj/fsw_spacewire.o \ |
|
63 | obj/fsw_spacewire.o \ | |
64 | obj/tc_load_dump_parameters.o \ |
|
64 | obj/tc_load_dump_parameters.o \ | |
65 | obj/tm_lfr_tc_exe.o \ |
|
65 | obj/tm_lfr_tc_exe.o \ | |
66 | obj/tc_acceptance.o \ |
|
66 | obj/tc_acceptance.o \ | |
67 | obj/basic_parameters.o |
|
67 | obj/basic_parameters.o | |
68 | DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
68 | DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ | |
69 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
69 | /usr/lib64/qt4/mkspecs/common/linux.conf \ | |
70 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
70 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ | |
71 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ |
|
71 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ | |
72 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ |
|
72 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ | |
73 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ |
|
73 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ | |
74 | /usr/lib64/qt4/mkspecs/qconfig.pri \ |
|
74 | /usr/lib64/qt4/mkspecs/qconfig.pri \ | |
75 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ |
|
75 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ | |
76 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ |
|
76 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ | |
77 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ |
|
77 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ | |
78 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ |
|
78 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ | |
79 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
79 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ | |
80 | sparc.pri \ |
|
80 | sparc.pri \ | |
81 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
81 | /usr/lib64/qt4/mkspecs/features/release.prf \ | |
82 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
82 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ | |
83 | /usr/lib64/qt4/mkspecs/features/shared.prf \ |
|
83 | /usr/lib64/qt4/mkspecs/features/shared.prf \ | |
84 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
84 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ | |
85 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
85 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ | |
86 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
86 | /usr/lib64/qt4/mkspecs/features/resources.prf \ | |
87 | /usr/lib64/qt4/mkspecs/features/uic.prf \ |
|
87 | /usr/lib64/qt4/mkspecs/features/uic.prf \ | |
88 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ |
|
88 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ | |
89 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
89 | /usr/lib64/qt4/mkspecs/features/lex.prf \ | |
90 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ |
|
90 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ | |
91 | fsw-qt.pro |
|
91 | fsw-qt.pro | |
92 | QMAKE_TARGET = fsw |
|
92 | QMAKE_TARGET = fsw | |
93 | DESTDIR = bin/ |
|
93 | DESTDIR = bin/ | |
94 | TARGET = bin/fsw |
|
94 | TARGET = bin/fsw | |
95 |
|
95 | |||
96 | first: all |
|
96 | first: all | |
97 | ####### Implicit rules |
|
97 | ####### Implicit rules | |
98 |
|
98 | |||
99 | .SUFFIXES: .o .c .cpp .cc .cxx .C |
|
99 | .SUFFIXES: .o .c .cpp .cc .cxx .C | |
100 |
|
100 | |||
101 | .cpp.o: |
|
101 | .cpp.o: | |
102 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
102 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
103 |
|
103 | |||
104 | .cc.o: |
|
104 | .cc.o: | |
105 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
105 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
106 |
|
106 | |||
107 | .cxx.o: |
|
107 | .cxx.o: | |
108 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
108 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
109 |
|
109 | |||
110 | .C.o: |
|
110 | .C.o: | |
111 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
111 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
112 |
|
112 | |||
113 | .c.o: |
|
113 | .c.o: | |
114 | $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" |
|
114 | $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" | |
115 |
|
115 | |||
116 | ####### Build rules |
|
116 | ####### Build rules | |
117 |
|
117 | |||
118 | all: Makefile $(TARGET) |
|
118 | all: Makefile $(TARGET) | |
119 |
|
119 | |||
120 | $(TARGET): $(OBJECTS) |
|
120 | $(TARGET): $(OBJECTS) | |
121 | @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/ |
|
121 | @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/ | |
122 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) |
|
122 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) | |
123 |
|
123 | |||
124 | Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
124 | Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \ | |
125 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
125 | /usr/lib64/qt4/mkspecs/common/linux.conf \ | |
126 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
126 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ | |
127 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ |
|
127 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ | |
128 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ |
|
128 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ | |
129 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ |
|
129 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ | |
130 | /usr/lib64/qt4/mkspecs/qconfig.pri \ |
|
130 | /usr/lib64/qt4/mkspecs/qconfig.pri \ | |
131 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ |
|
131 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ | |
132 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ |
|
132 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ | |
133 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ |
|
133 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ | |
134 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ |
|
134 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ | |
135 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
135 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ | |
136 | sparc.pri \ |
|
136 | sparc.pri \ | |
137 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
137 | /usr/lib64/qt4/mkspecs/features/release.prf \ | |
138 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
138 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ | |
139 | /usr/lib64/qt4/mkspecs/features/shared.prf \ |
|
139 | /usr/lib64/qt4/mkspecs/features/shared.prf \ | |
140 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
140 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ | |
141 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
141 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ | |
142 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
142 | /usr/lib64/qt4/mkspecs/features/resources.prf \ | |
143 | /usr/lib64/qt4/mkspecs/features/uic.prf \ |
|
143 | /usr/lib64/qt4/mkspecs/features/uic.prf \ | |
144 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ |
|
144 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ | |
145 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
145 | /usr/lib64/qt4/mkspecs/features/lex.prf \ | |
146 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf |
|
146 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf | |
147 | $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
147 | $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
148 | /usr/lib64/qt4/mkspecs/common/unix.conf: |
|
148 | /usr/lib64/qt4/mkspecs/common/unix.conf: | |
149 | /usr/lib64/qt4/mkspecs/common/linux.conf: |
|
149 | /usr/lib64/qt4/mkspecs/common/linux.conf: | |
150 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: |
|
150 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: | |
151 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf: |
|
151 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf: | |
152 | /usr/lib64/qt4/mkspecs/common/g++-base.conf: |
|
152 | /usr/lib64/qt4/mkspecs/common/g++-base.conf: | |
153 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf: |
|
153 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf: | |
154 | /usr/lib64/qt4/mkspecs/qconfig.pri: |
|
154 | /usr/lib64/qt4/mkspecs/qconfig.pri: | |
155 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri: |
|
155 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri: | |
156 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf: |
|
156 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf: | |
157 | /usr/lib64/qt4/mkspecs/features/qt_config.prf: |
|
157 | /usr/lib64/qt4/mkspecs/features/qt_config.prf: | |
158 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf: |
|
158 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf: | |
159 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: |
|
159 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: | |
160 | sparc.pri: |
|
160 | sparc.pri: | |
161 | /usr/lib64/qt4/mkspecs/features/release.prf: |
|
161 | /usr/lib64/qt4/mkspecs/features/release.prf: | |
162 | /usr/lib64/qt4/mkspecs/features/default_post.prf: |
|
162 | /usr/lib64/qt4/mkspecs/features/default_post.prf: | |
163 | /usr/lib64/qt4/mkspecs/features/shared.prf: |
|
163 | /usr/lib64/qt4/mkspecs/features/shared.prf: | |
164 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: |
|
164 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: | |
165 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: |
|
165 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: | |
166 | /usr/lib64/qt4/mkspecs/features/resources.prf: |
|
166 | /usr/lib64/qt4/mkspecs/features/resources.prf: | |
167 | /usr/lib64/qt4/mkspecs/features/uic.prf: |
|
167 | /usr/lib64/qt4/mkspecs/features/uic.prf: | |
168 | /usr/lib64/qt4/mkspecs/features/yacc.prf: |
|
168 | /usr/lib64/qt4/mkspecs/features/yacc.prf: | |
169 | /usr/lib64/qt4/mkspecs/features/lex.prf: |
|
169 | /usr/lib64/qt4/mkspecs/features/lex.prf: | |
170 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf: |
|
170 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf: | |
171 | qmake: FORCE |
|
171 | qmake: FORCE | |
172 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
172 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
173 |
|
173 | |||
174 | dist: |
|
174 | dist: | |
175 | @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0 |
|
175 | @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0 | |
176 | $(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 |
|
176 | $(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 | |
177 |
|
177 | |||
178 |
|
178 | |||
179 | clean:compiler_clean |
|
179 | clean:compiler_clean | |
180 | -$(DEL_FILE) $(OBJECTS) |
|
180 | -$(DEL_FILE) $(OBJECTS) | |
181 | -$(DEL_FILE) *~ core *.core |
|
181 | -$(DEL_FILE) *~ core *.core | |
182 |
|
182 | |||
183 |
|
183 | |||
184 | ####### Sub-libraries |
|
184 | ####### Sub-libraries | |
185 |
|
185 | |||
186 | distclean: clean |
|
186 | distclean: clean | |
187 | -$(DEL_FILE) $(TARGET) |
|
187 | -$(DEL_FILE) $(TARGET) | |
188 | -$(DEL_FILE) Makefile |
|
188 | -$(DEL_FILE) Makefile | |
189 |
|
189 | |||
190 |
|
190 | |||
191 | grmon: |
|
191 | grmon: | |
192 | cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u |
|
192 | cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u | |
193 |
|
193 | |||
194 | check: first |
|
194 | check: first | |
195 |
|
195 | |||
196 | compiler_rcc_make_all: |
|
196 | compiler_rcc_make_all: | |
197 | compiler_rcc_clean: |
|
197 | compiler_rcc_clean: | |
198 | compiler_uic_make_all: |
|
198 | compiler_uic_make_all: | |
199 | compiler_uic_clean: |
|
199 | compiler_uic_clean: | |
200 | compiler_image_collection_make_all: qmake_image_collection.cpp |
|
200 | compiler_image_collection_make_all: qmake_image_collection.cpp | |
201 | compiler_image_collection_clean: |
|
201 | compiler_image_collection_clean: | |
202 | -$(DEL_FILE) qmake_image_collection.cpp |
|
202 | -$(DEL_FILE) qmake_image_collection.cpp | |
203 | compiler_yacc_decl_make_all: |
|
203 | compiler_yacc_decl_make_all: | |
204 | compiler_yacc_decl_clean: |
|
204 | compiler_yacc_decl_clean: | |
205 | compiler_yacc_impl_make_all: |
|
205 | compiler_yacc_impl_make_all: | |
206 | compiler_yacc_impl_clean: |
|
206 | compiler_yacc_impl_clean: | |
207 | compiler_lex_make_all: |
|
207 | compiler_lex_make_all: | |
208 | compiler_lex_clean: |
|
208 | compiler_lex_clean: | |
209 | compiler_clean: |
|
209 | compiler_clean: | |
210 |
|
210 | |||
211 | ####### Compile |
|
211 | ####### Compile | |
212 |
|
212 | |||
213 | obj/wf_handler.o: ../src/wf_handler.c |
|
213 | obj/wf_handler.o: ../src/wf_handler.c | |
214 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c |
|
214 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c | |
215 |
|
215 | |||
216 | obj/tc_handler.o: ../src/tc_handler.c |
|
216 | obj/tc_handler.o: ../src/tc_handler.c | |
217 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c |
|
217 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c | |
218 |
|
218 | |||
219 | obj/fsw_processing.o: ../src/fsw_processing.c ../src/fsw_processing_globals.c |
|
219 | obj/fsw_processing.o: ../src/fsw_processing.c ../src/fsw_processing_globals.c | |
220 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c |
|
220 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c | |
221 |
|
221 | |||
222 | obj/fsw_misc.o: ../src/fsw_misc.c |
|
222 | obj/fsw_misc.o: ../src/fsw_misc.c | |
223 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c |
|
223 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c | |
224 |
|
224 | |||
225 | obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c |
|
225 | obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c | |
226 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c |
|
226 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c | |
227 |
|
227 | |||
228 | obj/fsw_globals.o: ../src/fsw_globals.c |
|
228 | obj/fsw_globals.o: ../src/fsw_globals.c | |
229 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c |
|
229 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c | |
230 |
|
230 | |||
231 | obj/fsw_spacewire.o: ../src/fsw_spacewire.c |
|
231 | obj/fsw_spacewire.o: ../src/fsw_spacewire.c | |
232 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c |
|
232 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c | |
233 |
|
233 | |||
234 | obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c |
|
234 | obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c | |
235 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c |
|
235 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c | |
236 |
|
236 | |||
237 | obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c |
|
237 | obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c | |
238 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c |
|
238 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c | |
239 |
|
239 | |||
240 | obj/tc_acceptance.o: ../src/tc_acceptance.c |
|
240 | obj/tc_acceptance.o: ../src/tc_acceptance.c | |
241 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c |
|
241 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c | |
242 |
|
242 | |||
243 | obj/basic_parameters.o: ../src/basic_parameters/basic_parameters.c ../src/basic_parameters/basic_parameters.h |
|
243 | obj/basic_parameters.o: ../src/basic_parameters/basic_parameters.c ../src/basic_parameters/basic_parameters.h | |
244 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/basic_parameters.o ../src/basic_parameters/basic_parameters.c |
|
244 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/basic_parameters.o ../src/basic_parameters/basic_parameters.c | |
245 |
|
245 | |||
246 | ####### Install |
|
246 | ####### Install | |
247 |
|
247 | |||
248 | install: FORCE |
|
248 | install: FORCE | |
249 |
|
249 | |||
250 | uninstall: FORCE |
|
250 | uninstall: FORCE | |
251 |
|
251 | |||
252 | FORCE: |
|
252 | FORCE: | |
253 |
|
253 |
@@ -1,201 +1,201 | |||||
1 | <?xml version="1.0" encoding="UTF-8"?> |
|
1 | <?xml version="1.0" encoding="UTF-8"?> | |
2 | <!DOCTYPE QtCreatorProject> |
|
2 | <!DOCTYPE QtCreatorProject> | |
3 |
<!-- Written by QtCreator 3.0.1, 2014-04- |
|
3 | <!-- Written by QtCreator 3.0.1, 2014-04-22T18:12:39. --> | |
4 | <qtcreator> |
|
4 | <qtcreator> | |
5 | <data> |
|
5 | <data> | |
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> |
|
6 | <variable>ProjectExplorer.Project.ActiveTarget</variable> | |
7 | <value type="int">0</value> |
|
7 | <value type="int">0</value> | |
8 | </data> |
|
8 | </data> | |
9 | <data> |
|
9 | <data> | |
10 | <variable>ProjectExplorer.Project.EditorSettings</variable> |
|
10 | <variable>ProjectExplorer.Project.EditorSettings</variable> | |
11 | <valuemap type="QVariantMap"> |
|
11 | <valuemap type="QVariantMap"> | |
12 | <value type="bool" key="EditorConfiguration.AutoIndent">true</value> |
|
12 | <value type="bool" key="EditorConfiguration.AutoIndent">true</value> | |
13 | <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> |
|
13 | <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value> | |
14 | <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value> |
|
14 | <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value> | |
15 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> |
|
15 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> | |
16 | <value type="QString" key="language">Cpp</value> |
|
16 | <value type="QString" key="language">Cpp</value> | |
17 | <valuemap type="QVariantMap" key="value"> |
|
17 | <valuemap type="QVariantMap" key="value"> | |
18 | <value type="QByteArray" key="CurrentPreferences">CppGlobal</value> |
|
18 | <value type="QByteArray" key="CurrentPreferences">CppGlobal</value> | |
19 | </valuemap> |
|
19 | </valuemap> | |
20 | </valuemap> |
|
20 | </valuemap> | |
21 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> |
|
21 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> | |
22 | <value type="QString" key="language">QmlJS</value> |
|
22 | <value type="QString" key="language">QmlJS</value> | |
23 | <valuemap type="QVariantMap" key="value"> |
|
23 | <valuemap type="QVariantMap" key="value"> | |
24 | <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value> |
|
24 | <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value> | |
25 | </valuemap> |
|
25 | </valuemap> | |
26 | </valuemap> |
|
26 | </valuemap> | |
27 | <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value> |
|
27 | <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value> | |
28 | <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value> |
|
28 | <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value> | |
29 | <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> |
|
29 | <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> | |
30 | <value type="int" key="EditorConfiguration.IndentSize">4</value> |
|
30 | <value type="int" key="EditorConfiguration.IndentSize">4</value> | |
31 | <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value> |
|
31 | <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value> | |
32 | <value type="bool" key="EditorConfiguration.MouseNavigation">true</value> |
|
32 | <value type="bool" key="EditorConfiguration.MouseNavigation">true</value> | |
33 | <value type="int" key="EditorConfiguration.PaddingMode">1</value> |
|
33 | <value type="int" key="EditorConfiguration.PaddingMode">1</value> | |
34 | <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> |
|
34 | <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> | |
35 | <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> |
|
35 | <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> | |
36 | <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> |
|
36 | <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> | |
37 | <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> |
|
37 | <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> | |
38 | <value type="int" key="EditorConfiguration.TabSize">8</value> |
|
38 | <value type="int" key="EditorConfiguration.TabSize">8</value> | |
39 | <value type="bool" key="EditorConfiguration.UseGlobal">true</value> |
|
39 | <value type="bool" key="EditorConfiguration.UseGlobal">true</value> | |
40 | <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> |
|
40 | <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> | |
41 | <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> |
|
41 | <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> | |
42 | <value type="bool" key="EditorConfiguration.cleanIndentation">true</value> |
|
42 | <value type="bool" key="EditorConfiguration.cleanIndentation">true</value> | |
43 | <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> |
|
43 | <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> | |
44 | <value type="bool" key="EditorConfiguration.inEntireDocument">false</value> |
|
44 | <value type="bool" key="EditorConfiguration.inEntireDocument">false</value> | |
45 | </valuemap> |
|
45 | </valuemap> | |
46 | </data> |
|
46 | </data> | |
47 | <data> |
|
47 | <data> | |
48 | <variable>ProjectExplorer.Project.PluginSettings</variable> |
|
48 | <variable>ProjectExplorer.Project.PluginSettings</variable> | |
49 | <valuemap type="QVariantMap"/> |
|
49 | <valuemap type="QVariantMap"/> | |
50 | </data> |
|
50 | </data> | |
51 | <data> |
|
51 | <data> | |
52 | <variable>ProjectExplorer.Project.Target.0</variable> |
|
52 | <variable>ProjectExplorer.Project.Target.0</variable> | |
53 | <valuemap type="QVariantMap"> |
|
53 | <valuemap type="QVariantMap"> | |
54 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.3 in PATH (System)</value> |
|
54 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.3 in PATH (System)</value> | |
55 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.3 in PATH (System)</value> |
|
55 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.3 in PATH (System)</value> | |
56 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{be73cf6a-f9d8-4d5a-8adf-adc2d83e2e44}</value> |
|
56 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{be73cf6a-f9d8-4d5a-8adf-adc2d83e2e44}</value> | |
57 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> |
|
57 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> | |
58 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> |
|
58 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> | |
59 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> |
|
59 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> | |
60 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> |
|
60 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> | |
61 | <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value> |
|
61 | <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory"></value> | |
62 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
62 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
63 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
63 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
64 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
64 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
65 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|
65 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> | |
66 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
66 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
67 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|
67 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> | |
68 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|
68 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> | |
69 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value> |
|
69 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">false</value> | |
70 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|
70 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> | |
71 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|
71 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> | |
72 | </valuemap> |
|
72 | </valuemap> | |
73 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|
73 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> | |
74 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
74 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
75 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
75 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
76 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
76 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
77 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
77 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
78 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
78 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> | |
79 | <value type="QString">-w</value> |
|
79 | <value type="QString">-w</value> | |
80 | <value type="QString">-r</value> |
|
80 | <value type="QString">-r</value> | |
81 | </valuelist> |
|
81 | </valuelist> | |
82 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|
82 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> | |
83 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|
83 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> | |
84 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
84 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
85 | </valuemap> |
|
85 | </valuemap> | |
86 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|
86 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> | |
87 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|
87 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> | |
88 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
88 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
89 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|
89 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> | |
90 | </valuemap> |
|
90 | </valuemap> | |
91 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|
91 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> | |
92 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
92 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
93 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> |
|
93 | <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> | |
94 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
94 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
95 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
95 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
96 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
96 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
97 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> |
|
97 | <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments"> | |
98 | <value type="QString">-w</value> |
|
98 | <value type="QString">-w</value> | |
99 | <value type="QString">-r</value> |
|
99 | <value type="QString">-r</value> | |
100 | </valuelist> |
|
100 | </valuelist> | |
101 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|
101 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> | |
102 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|
102 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> | |
103 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
103 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
104 | </valuemap> |
|
104 | </valuemap> | |
105 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|
105 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> | |
106 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|
106 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> | |
107 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
107 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
108 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|
108 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> | |
109 | </valuemap> |
|
109 | </valuemap> | |
110 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|
110 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> | |
111 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|
111 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> | |
112 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|
112 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> | |
113 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> |
|
113 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> | |
114 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
114 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
115 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|
115 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> | |
116 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> |
|
116 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> | |
117 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> |
|
117 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> | |
118 | </valuemap> |
|
118 | </valuemap> | |
119 | <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value> |
|
119 | <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">1</value> | |
120 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> |
|
120 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> | |
121 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
121 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
122 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> |
|
122 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> | |
123 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> |
|
123 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> | |
124 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
124 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
125 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> |
|
125 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> | |
126 | </valuemap> |
|
126 | </valuemap> | |
127 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> |
|
127 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> | |
128 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value> |
|
128 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value> | |
129 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
129 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
130 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> |
|
130 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> | |
131 | </valuemap> |
|
131 | </valuemap> | |
132 | <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> |
|
132 | <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> | |
133 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> |
|
133 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/> | |
134 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> |
|
134 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> | |
135 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|
135 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> | |
136 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|
136 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> | |
137 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|
137 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> | |
138 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|
138 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> | |
139 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|
139 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> | |
140 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|
140 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> | |
141 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|
141 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> | |
142 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|
142 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> | |
143 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|
143 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> | |
144 | <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> |
|
144 | <value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value> | |
145 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|
145 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> | |
146 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|
146 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> | |
147 | <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> |
|
147 | <value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value> | |
148 | <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> |
|
148 | <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value> | |
149 | <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> |
|
149 | <value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value> | |
150 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|
150 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> | |
151 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|
151 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> | |
152 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|
152 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> | |
153 | <value type="int">0</value> |
|
153 | <value type="int">0</value> | |
154 | <value type="int">1</value> |
|
154 | <value type="int">1</value> | |
155 | <value type="int">2</value> |
|
155 | <value type="int">2</value> | |
156 | <value type="int">3</value> |
|
156 | <value type="int">3</value> | |
157 | <value type="int">4</value> |
|
157 | <value type="int">4</value> | |
158 | <value type="int">5</value> |
|
158 | <value type="int">5</value> | |
159 | <value type="int">6</value> |
|
159 | <value type="int">6</value> | |
160 | <value type="int">7</value> |
|
160 | <value type="int">7</value> | |
161 | <value type="int">8</value> |
|
161 | <value type="int">8</value> | |
162 | <value type="int">9</value> |
|
162 | <value type="int">9</value> | |
163 | <value type="int">10</value> |
|
163 | <value type="int">10</value> | |
164 | <value type="int">11</value> |
|
164 | <value type="int">11</value> | |
165 | <value type="int">12</value> |
|
165 | <value type="int">12</value> | |
166 | <value type="int">13</value> |
|
166 | <value type="int">13</value> | |
167 | <value type="int">14</value> |
|
167 | <value type="int">14</value> | |
168 | </valuelist> |
|
168 | </valuelist> | |
169 | <value type="int" key="PE.EnvironmentAspect.Base">2</value> |
|
169 | <value type="int" key="PE.EnvironmentAspect.Base">2</value> | |
170 | <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> |
|
170 | <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> | |
171 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value> |
|
171 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value> | |
172 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
172 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
173 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value> |
|
173 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value> | |
174 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> |
|
174 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> | |
175 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value> |
|
175 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value> | |
176 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> |
|
176 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> | |
177 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value> |
|
177 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value> | |
178 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> |
|
178 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> | |
179 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> |
|
179 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> | |
180 | <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> |
|
180 | <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> | |
181 | <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value> |
|
181 | <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value> | |
182 | <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> |
|
182 | <value type="bool" key="RunConfiguration.UseMultiProcess">false</value> | |
183 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> |
|
183 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> | |
184 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> |
|
184 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> | |
185 | </valuemap> |
|
185 | </valuemap> | |
186 | <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> |
|
186 | <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> | |
187 | </valuemap> |
|
187 | </valuemap> | |
188 | </data> |
|
188 | </data> | |
189 | <data> |
|
189 | <data> | |
190 | <variable>ProjectExplorer.Project.TargetCount</variable> |
|
190 | <variable>ProjectExplorer.Project.TargetCount</variable> | |
191 | <value type="int">1</value> |
|
191 | <value type="int">1</value> | |
192 | </data> |
|
192 | </data> | |
193 | <data> |
|
193 | <data> | |
194 | <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> |
|
194 | <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> | |
195 | <value type="QByteArray">{cdbf9cdc-1e84-406e-889b-c4feef49e75c}</value> |
|
195 | <value type="QByteArray">{cdbf9cdc-1e84-406e-889b-c4feef49e75c}</value> | |
196 | </data> |
|
196 | </data> | |
197 | <data> |
|
197 | <data> | |
198 | <variable>ProjectExplorer.Project.Updater.FileVersion</variable> |
|
198 | <variable>ProjectExplorer.Project.Updater.FileVersion</variable> | |
199 | <value type="int">15</value> |
|
199 | <value type="int">15</value> | |
200 | </data> |
|
200 | </data> | |
201 | </qtcreator> |
|
201 | </qtcreator> |
@@ -1,660 +1,663 | |||||
1 | #ifndef CCSDS_TYPES_H_INCLUDED |
|
1 | #ifndef CCSDS_TYPES_H_INCLUDED | |
2 | #define CCSDS_TYPES_H_INCLUDED |
|
2 | #define CCSDS_TYPES_H_INCLUDED | |
3 |
|
3 | |||
4 | #include "fsw_params_processing.h" |
|
4 | #include "fsw_params_processing.h" | |
5 |
|
5 | |||
6 | #define CCSDS_PROTOCOLE_EXTRA_BYTES 4 |
|
6 | #define CCSDS_PROTOCOLE_EXTRA_BYTES 4 | |
7 | #define CCSDS_TC_TM_PACKET_OFFSET 7 |
|
7 | #define CCSDS_TC_TM_PACKET_OFFSET 7 | |
8 | #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4 |
|
8 | #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4 | |
9 | #define CCSDS_TM_PKT_MAX_SIZE 4412 |
|
9 | #define CCSDS_TM_PKT_MAX_SIZE 4412 | |
10 | #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4 |
|
10 | #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4 | |
11 | #define CCSDS_TC_PKT_MAX_SIZE 256 |
|
11 | #define CCSDS_TC_PKT_MAX_SIZE 256 | |
12 | #define CCSDS_TC_PKT_MIN_SIZE 16 |
|
12 | #define CCSDS_TC_PKT_MIN_SIZE 16 | |
13 | #define CCSDS_PROCESS_ID 76 |
|
13 | #define CCSDS_PROCESS_ID 76 | |
14 | #define CCSDS_PACKET_CATEGORY 12 |
|
14 | #define CCSDS_PACKET_CATEGORY 12 | |
15 | #define CCSDS_NODE_ADDRESS 0xfe |
|
15 | #define CCSDS_NODE_ADDRESS 0xfe | |
16 | #define CCSDS_USER_APP 0x00 |
|
16 | #define CCSDS_USER_APP 0x00 | |
17 |
|
17 | |||
18 | #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10 |
|
18 | #define DEFAULT_SPARE1_PUSVERSION_SPARE2 0x10 | |
19 | #define DEFAULT_RESERVED 0x00 |
|
19 | #define DEFAULT_RESERVED 0x00 | |
20 | #define DEFAULT_HKBIA 0x1e // 0001 1110 |
|
20 | #define DEFAULT_HKBIA 0x1e // 0001 1110 | |
21 |
|
21 | |||
22 | // PACKET ID |
|
22 | // PACKET ID | |
23 | #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1 |
|
23 | #define APID_TM_TC_EXE 0x0cc1 // PID 76 CAT 1 | |
24 | #define APID_TM_HK 0x0cc4 // PID 76 CAT 4 |
|
24 | #define APID_TM_HK 0x0cc4 // PID 76 CAT 4 | |
25 | #define APID_TM_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9 |
|
25 | #define APID_TM_PARAMETER_DUMP 0x0cc9 // PID 76 CAT 9 | |
26 | #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12 |
|
26 | #define APID_TM_SCIENCE_NORMAL_BURST 0x0ccc // PID 76 CAT 12 | |
27 | #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12 |
|
27 | #define APID_TM_SCIENCE_SBM1_SBM2 0x0cfc // PID 79 CAT 12 | |
28 | #define TM_PACKET_PID_DEFAULT 76 |
|
28 | #define TM_PACKET_PID_DEFAULT 76 | |
29 | #define TM_PACKET_PID_BURST_SBM1_SBM2 79 |
|
29 | #define TM_PACKET_PID_BURST_SBM1_SBM2 79 | |
30 | #define TM_PACKET_CAT_TC_EXE 1 |
|
30 | #define TM_PACKET_CAT_TC_EXE 1 | |
31 | #define TM_PACKET_CAT_HK 4 |
|
31 | #define TM_PACKET_CAT_HK 4 | |
32 | #define TM_PACKET_CAT_PARAMETER_DUMP 9 |
|
32 | #define TM_PACKET_CAT_PARAMETER_DUMP 9 | |
33 | #define TM_PACKET_CAT_SCIENCE 12 |
|
33 | #define TM_PACKET_CAT_SCIENCE 12 | |
34 | #define TC_PACKET_CAT 12 |
|
34 | #define TC_PACKET_CAT 12 | |
35 |
|
35 | |||
36 | // PACKET SEQUENCE CONTROL |
|
36 | // PACKET SEQUENCE CONTROL | |
37 | #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000] |
|
37 | #define TM_PACKET_SEQ_CTRL_CONTINUATION 0x00 // [0000 0000] | |
38 | #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000] |
|
38 | #define TM_PACKET_SEQ_CTRL_FIRST 0x40 // [0100 0000] | |
39 | #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000] |
|
39 | #define TM_PACKET_SEQ_CTRL_LAST 0x80 // [1000 0000] | |
40 | #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000] |
|
40 | #define TM_PACKET_SEQ_CTRL_STANDALONE 0xc0 // [1100 0000] | |
41 | #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000] |
|
41 | #define TM_PACKET_SEQ_CNT_DEFAULT 0x00 // [0000 0000] | |
42 |
|
42 | |||
43 | // DESTINATION ID |
|
43 | // DESTINATION ID | |
44 | #define TM_DESTINATION_ID_GROUND 0 |
|
44 | #define TM_DESTINATION_ID_GROUND 0 | |
45 | #define TM_DESTINATION_ID_MISSION_TIMELINE 110 |
|
45 | #define TM_DESTINATION_ID_MISSION_TIMELINE 110 | |
46 | #define TM_DESTINATION_ID_TC_SEQUENCES 111 |
|
46 | #define TM_DESTINATION_ID_TC_SEQUENCES 111 | |
47 | #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112 |
|
47 | #define TM_DESTINATION_ID_RECOVERY_ACTION_COMMAND 112 | |
48 | #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113 |
|
48 | #define TM_DESTINATION_ID_BACKUP_MISSION_TIMELINE 113 | |
49 | #define TM_DESTINATION_ID_DIRECT_CMD 120 |
|
49 | #define TM_DESTINATION_ID_DIRECT_CMD 120 | |
50 | #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121 |
|
50 | #define TM_DESTINATION_ID_SPARE_GRD_SRC1 121 | |
51 | #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122 |
|
51 | #define TM_DESTINATION_ID_SPARE_GRD_SRC2 122 | |
52 | #define TM_DESTINATION_ID_OBCP 15 |
|
52 | #define TM_DESTINATION_ID_OBCP 15 | |
53 | #define TM_DESTINATION_ID_SYSTEM_CONTROL 14 |
|
53 | #define TM_DESTINATION_ID_SYSTEM_CONTROL 14 | |
54 | #define TM_DESTINATION_ID_AOCS 11 |
|
54 | #define TM_DESTINATION_ID_AOCS 11 | |
55 |
|
55 | |||
56 | #define CCSDS_DESTINATION_ID 0x01 |
|
56 | #define CCSDS_DESTINATION_ID 0x01 | |
57 | #define CCSDS_PROTOCOLE_ID 0x02 |
|
57 | #define CCSDS_PROTOCOLE_ID 0x02 | |
58 | #define CCSDS_RESERVED 0x00 |
|
58 | #define CCSDS_RESERVED 0x00 | |
59 | #define CCSDS_USER_APP 0x00 |
|
59 | #define CCSDS_USER_APP 0x00 | |
60 |
|
60 | |||
61 | #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24 |
|
61 | #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24 | |
62 | #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32 |
|
62 | #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32 | |
63 | #define SIZE_HK_PARAMETERS 112 |
|
63 | #define SIZE_HK_PARAMETERS 112 | |
64 |
|
64 | |||
65 | // TC TYPES |
|
65 | // TC TYPES | |
66 | #define TC_TYPE_GEN 181 |
|
66 | #define TC_TYPE_GEN 181 | |
67 | #define TC_TYPE_TIME 9 |
|
67 | #define TC_TYPE_TIME 9 | |
68 |
|
68 | |||
69 | // TC SUBTYPES |
|
69 | // TC SUBTYPES | |
70 | #define TC_SUBTYPE_RESET 1 |
|
70 | #define TC_SUBTYPE_RESET 1 | |
71 | #define TC_SUBTYPE_LOAD_COMM 11 |
|
71 | #define TC_SUBTYPE_LOAD_COMM 11 | |
72 | #define TC_SUBTYPE_LOAD_NORM 13 |
|
72 | #define TC_SUBTYPE_LOAD_NORM 13 | |
73 | #define TC_SUBTYPE_LOAD_BURST 19 |
|
73 | #define TC_SUBTYPE_LOAD_BURST 19 | |
74 | #define TC_SUBTYPE_LOAD_SBM1 25 |
|
74 | #define TC_SUBTYPE_LOAD_SBM1 25 | |
75 | #define TC_SUBTYPE_LOAD_SBM2 27 |
|
75 | #define TC_SUBTYPE_LOAD_SBM2 27 | |
76 | #define TC_SUBTYPE_DUMP 31 |
|
76 | #define TC_SUBTYPE_DUMP 31 | |
77 | #define TC_SUBTYPE_ENTER 41 |
|
77 | #define TC_SUBTYPE_ENTER 41 | |
78 | #define TC_SUBTYPE_UPDT_INFO 51 |
|
78 | #define TC_SUBTYPE_UPDT_INFO 51 | |
79 | #define TC_SUBTYPE_EN_CAL 61 |
|
79 | #define TC_SUBTYPE_EN_CAL 61 | |
80 | #define TC_SUBTYPE_DIS_CAL 63 |
|
80 | #define TC_SUBTYPE_DIS_CAL 63 | |
81 | #define TC_SUBTYPE_UPDT_TIME 129 |
|
81 | #define TC_SUBTYPE_UPDT_TIME 129 | |
82 |
|
82 | |||
83 | // TC LEN |
|
83 | // TC LEN | |
84 | #define TC_LEN_RESET 12 |
|
84 | #define TC_LEN_RESET 12 | |
85 | #define TC_LEN_LOAD_COMM 14 |
|
85 | #define TC_LEN_LOAD_COMM 14 | |
86 | #define TC_LEN_LOAD_NORM 22 |
|
86 | #define TC_LEN_LOAD_NORM 22 | |
87 | #define TC_LEN_LOAD_BURST 14 |
|
87 | #define TC_LEN_LOAD_BURST 14 | |
88 | #define TC_LEN_LOAD_SBM1 14 |
|
88 | #define TC_LEN_LOAD_SBM1 14 | |
89 | #define TC_LEN_LOAD_SBM2 14 |
|
89 | #define TC_LEN_LOAD_SBM2 14 | |
90 | #define TC_LEN_DUMP 12 |
|
90 | #define TC_LEN_DUMP 12 | |
91 | #define TC_LEN_ENTER 20 |
|
91 | #define TC_LEN_ENTER 20 | |
92 | #define TC_LEN_UPDT_INFO 46 |
|
92 | #define TC_LEN_UPDT_INFO 46 | |
93 | #define TC_LEN_EN_CAL 12 |
|
93 | #define TC_LEN_EN_CAL 12 | |
94 | #define TC_LEN_DIS_CAL 12 |
|
94 | #define TC_LEN_DIS_CAL 12 | |
95 | #define TC_LEN_UPDT_TIME 18 |
|
95 | #define TC_LEN_UPDT_TIME 18 | |
96 |
|
96 | |||
97 | // TM TYPES |
|
97 | // TM TYPES | |
98 | #define TM_TYPE_TC_EXE 1 |
|
98 | #define TM_TYPE_TC_EXE 1 | |
99 | #define TM_TYPE_HK 3 |
|
99 | #define TM_TYPE_HK 3 | |
100 | #define TM_TYPE_PARAMETER_DUMP 3 |
|
100 | #define TM_TYPE_PARAMETER_DUMP 3 | |
101 | #define TM_TYPE_LFR_SCIENCE 21 |
|
101 | #define TM_TYPE_LFR_SCIENCE 21 | |
102 |
|
102 | |||
103 | // TM SUBTYPES |
|
103 | // TM SUBTYPES | |
104 | #define TM_SUBTYPE_EXE_OK 7 |
|
104 | #define TM_SUBTYPE_EXE_OK 7 | |
105 | #define TM_SUBTYPE_EXE_NOK 8 |
|
105 | #define TM_SUBTYPE_EXE_NOK 8 | |
106 | #define TM_SUBTYPE_HK 25 |
|
106 | #define TM_SUBTYPE_HK 25 | |
107 | #define TM_SUBTYPE_PARAMETER_DUMP 25 |
|
107 | #define TM_SUBTYPE_PARAMETER_DUMP 25 | |
108 | #define TM_SUBTYPE_SCIENCE 3 |
|
108 | #define TM_SUBTYPE_SCIENCE 3 | |
109 | #define TM_SUBTYPE_LFR_SCIENCE 3 |
|
109 | #define TM_SUBTYPE_LFR_SCIENCE 3 | |
110 |
|
110 | |||
111 | // FAILURE CODES |
|
111 | // FAILURE CODES | |
112 | #define ILLEGAL_APID 0 |
|
112 | #define ILLEGAL_APID 0 | |
113 | #define WRONG_LEN_PKT 1 |
|
113 | #define WRONG_LEN_PKT 1 | |
114 | #define INCOR_CHECKSUM 2 |
|
114 | #define INCOR_CHECKSUM 2 | |
115 | #define ILL_TYPE 3 |
|
115 | #define ILL_TYPE 3 | |
116 | #define ILL_SUBTYPE 4 |
|
116 | #define ILL_SUBTYPE 4 | |
117 | #define WRONG_APP_DATA 5 // 0x00 0x05 |
|
117 | #define WRONG_APP_DATA 5 // 0x00 0x05 | |
118 | #define TC_NOT_EXE 42000 // 0xa4 0x10 |
|
118 | #define TC_NOT_EXE 42000 // 0xa4 0x10 | |
119 | #define WRONG_SRC_ID 42001 // 0xa4 0x11 |
|
119 | #define WRONG_SRC_ID 42001 // 0xa4 0x11 | |
120 | #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12 |
|
120 | #define FUNCT_NOT_IMPL 42002 // 0xa4 0x12 | |
121 | #define FAIL_DETECTED 42003 // 0xa4 0x13 |
|
121 | #define FAIL_DETECTED 42003 // 0xa4 0x13 | |
122 | #define NOT_ALLOWED 42004 // 0xa4 0x14 |
|
122 | #define NOT_ALLOWED 42004 // 0xa4 0x14 | |
123 | #define CORRUPTED 42005 // 0xa4 0x15 |
|
123 | #define CORRUPTED 42005 // 0xa4 0x15 | |
124 | #define CCSDS_TM_VALID 7 |
|
124 | #define CCSDS_TM_VALID 7 | |
125 |
|
125 | |||
126 | // TC SID |
|
126 | // TC SID | |
127 | #define SID_TC_GROUND 0 |
|
127 | #define SID_TC_GROUND 0 | |
128 | #define SID_TC_MISSION_TIMELINE 110 |
|
128 | #define SID_TC_MISSION_TIMELINE 110 | |
129 | #define SID_TC_TC_SEQUENCES 111 |
|
129 | #define SID_TC_TC_SEQUENCES 111 | |
130 | #define SID_TC_RECOVERY_ACTION_CMD 112 |
|
130 | #define SID_TC_RECOVERY_ACTION_CMD 112 | |
131 | #define SID_TC_BACKUP_MISSION_TIMELINE 113 |
|
131 | #define SID_TC_BACKUP_MISSION_TIMELINE 113 | |
132 | #define SID_TC_DIRECT_CMD 120 |
|
132 | #define SID_TC_DIRECT_CMD 120 | |
133 | #define SID_TC_SPARE_GRD_SRC1 121 |
|
133 | #define SID_TC_SPARE_GRD_SRC1 121 | |
134 | #define SID_TC_SPARE_GRD_SRC2 122 |
|
134 | #define SID_TC_SPARE_GRD_SRC2 122 | |
135 | #define SID_TC_OBCP 15 |
|
135 | #define SID_TC_OBCP 15 | |
136 | #define SID_TC_SYSTEM_CONTROL 14 |
|
136 | #define SID_TC_SYSTEM_CONTROL 14 | |
137 | #define SID_TC_AOCS 11 |
|
137 | #define SID_TC_AOCS 11 | |
138 | #define SID_TC_RPW_INTERNAL 254 |
|
138 | #define SID_TC_RPW_INTERNAL 254 | |
139 |
|
139 | |||
140 | enum apid_destid{ |
|
140 | enum apid_destid{ | |
141 | GROUND, |
|
141 | GROUND, | |
142 | MISSION_TIMELINE, |
|
142 | MISSION_TIMELINE, | |
143 | TC_SEQUENCES, |
|
143 | TC_SEQUENCES, | |
144 | RECOVERY_ACTION_CMD, |
|
144 | RECOVERY_ACTION_CMD, | |
145 | BACKUP_MISSION_TIMELINE, |
|
145 | BACKUP_MISSION_TIMELINE, | |
146 | DIRECT_CMD, |
|
146 | DIRECT_CMD, | |
147 | SPARE_GRD_SRC1, |
|
147 | SPARE_GRD_SRC1, | |
148 | SPARE_GRD_SRC2, |
|
148 | SPARE_GRD_SRC2, | |
149 | OBCP, |
|
149 | OBCP, | |
150 | SYSTEM_CONTROL, |
|
150 | SYSTEM_CONTROL, | |
151 | AOCS, |
|
151 | AOCS, | |
152 | RPW_INTERNAL |
|
152 | RPW_INTERNAL | |
153 | }; |
|
153 | }; | |
154 | // SEQUENCE COUNTERS |
|
154 | // SEQUENCE COUNTERS | |
155 | #define SEQ_CNT_MAX 16383 |
|
155 | #define SEQ_CNT_MAX 16383 | |
156 | #define SEQ_CNT_NB_DEST_ID 12 |
|
156 | #define SEQ_CNT_NB_DEST_ID 12 | |
157 |
|
157 | |||
158 | // TM SID |
|
158 | // TM SID | |
159 | #define SID_HK 1 |
|
159 | #define SID_HK 1 | |
160 | #define SID_PARAMETER_DUMP 10 |
|
160 | #define SID_PARAMETER_DUMP 10 | |
161 |
|
161 | |||
162 | #define SID_NORM_SWF_F0 3 |
|
162 | #define SID_NORM_SWF_F0 3 | |
163 | #define SID_NORM_SWF_F1 4 |
|
163 | #define SID_NORM_SWF_F1 4 | |
164 | #define SID_NORM_SWF_F2 5 |
|
164 | #define SID_NORM_SWF_F2 5 | |
165 | #define SID_NORM_CWF_F3 1 |
|
165 | #define SID_NORM_CWF_F3 1 | |
166 | #define SID_BURST_CWF_F2 2 |
|
166 | #define SID_BURST_CWF_F2 2 | |
167 | #define SID_SBM1_CWF_F1 24 |
|
167 | #define SID_SBM1_CWF_F1 24 | |
168 | #define SID_SBM2_CWF_F2 25 |
|
168 | #define SID_SBM2_CWF_F2 25 | |
169 | #define SID_NORM_ASM_F0 11 |
|
169 | #define SID_NORM_ASM_F0 11 | |
170 | #define SID_NORM_ASM_F1 12 |
|
170 | #define SID_NORM_ASM_F1 12 | |
171 | #define SID_NORM_ASM_F2 13 |
|
171 | #define SID_NORM_ASM_F2 13 | |
172 | #define SID_NORM_BP1_F0 14 |
|
172 | #define SID_NORM_BP1_F0 14 | |
173 | #define SID_NORM_BP1_F1 15 |
|
173 | #define SID_NORM_BP1_F1 15 | |
174 | #define SID_NORM_BP1_F2 16 |
|
174 | #define SID_NORM_BP1_F2 16 | |
175 | #define SID_NORM_BP2_F0 19 |
|
175 | #define SID_NORM_BP2_F0 19 | |
176 | #define SID_NORM_BP2_F1 20 |
|
176 | #define SID_NORM_BP2_F1 20 | |
177 | #define SID_NORM_BP2_F2 21 |
|
177 | #define SID_NORM_BP2_F2 21 | |
178 | #define SID_BURST_BP1_F0 17 |
|
178 | #define SID_BURST_BP1_F0 17 | |
179 | #define SID_BURST_BP2_F0 22 |
|
179 | #define SID_BURST_BP2_F0 22 | |
180 | #define SID_BURST_BP1_F1 18 |
|
180 | #define SID_BURST_BP1_F1 18 | |
181 | #define SID_BURST_BP2_F1 23 |
|
181 | #define SID_BURST_BP2_F1 23 | |
182 | #define SID_SBM1_BP1_F0 28 |
|
182 | #define SID_SBM1_BP1_F0 28 | |
183 | #define SID_SBM1_BP2_F0 31 |
|
183 | #define SID_SBM1_BP2_F0 31 | |
184 | #define SID_SBM2_BP1_F0 29 |
|
184 | #define SID_SBM2_BP1_F0 29 | |
185 | #define SID_SBM2_BP2_F0 32 |
|
185 | #define SID_SBM2_BP2_F0 32 | |
186 | #define SID_SBM2_BP1_F1 30 |
|
186 | #define SID_SBM2_BP1_F1 30 | |
187 | #define SID_SBM2_BP2_F1 33 |
|
187 | #define SID_SBM2_BP2_F1 33 | |
188 | #define SID_NORM_CWF_LONG_F3 34 |
|
188 | #define SID_NORM_CWF_LONG_F3 34 | |
189 |
|
189 | |||
190 | // LENGTH (BYTES) |
|
190 | // LENGTH (BYTES) | |
191 | #define LENGTH_TM_LFR_TC_EXE_MAX 32 |
|
191 | #define LENGTH_TM_LFR_TC_EXE_MAX 32 | |
192 | #define LENGTH_TM_LFR_HK 126 |
|
192 | #define LENGTH_TM_LFR_HK 126 | |
193 |
|
193 | |||
194 | // HEADER_LENGTH |
|
194 | // HEADER_LENGTH | |
195 | #define TM_HEADER_LEN 16 |
|
195 | #define TM_HEADER_LEN 16 | |
196 | #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28 |
|
196 | #define HEADER_LENGTH_TM_LFR_SCIENCE_ASM 28 | |
197 | // PACKET_LENGTH |
|
197 | // PACKET_LENGTH | |
198 | #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET) |
|
198 | #define PACKET_LENGTH_TC_EXE_SUCCESS (20 - CCSDS_TC_TM_PACKET_OFFSET) | |
199 | #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET) |
|
199 | #define PACKET_LENGTH_TC_EXE_INCONSISTENT (26 - CCSDS_TC_TM_PACKET_OFFSET) | |
200 | #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET) |
|
200 | #define PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE (26 - CCSDS_TC_TM_PACKET_OFFSET) | |
201 | #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET) |
|
201 | #define PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED (24 - CCSDS_TC_TM_PACKET_OFFSET) | |
202 | #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET) |
|
202 | #define PACKET_LENGTH_TC_EXE_ERROR (24 - CCSDS_TC_TM_PACKET_OFFSET) | |
203 | #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET) |
|
203 | #define PACKET_LENGTH_TC_EXE_CORRUPTED (32 - CCSDS_TC_TM_PACKET_OFFSET) | |
204 | #define PACKET_LENGTH_HK (124 - CCSDS_TC_TM_PACKET_OFFSET) |
|
204 | #define PACKET_LENGTH_HK (124 - CCSDS_TC_TM_PACKET_OFFSET) | |
205 | #define PACKET_LENGTH_PARAMETER_DUMP (36 - CCSDS_TC_TM_PACKET_OFFSET) |
|
205 | #define PACKET_LENGTH_PARAMETER_DUMP (36 - CCSDS_TC_TM_PACKET_OFFSET) | |
206 |
#define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0 (2228 - CCSDS_TC_TM_PACKET_OFFSET) // 44 * 25 * 2 + 28 |
|
206 | #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0 (2228 - CCSDS_TC_TM_PACKET_OFFSET) // 44 * 25 * 2 + 28 | |
207 |
#define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1 (2628 - CCSDS_TC_TM_PACKET_OFFSET) // 52 * 25 * 2 + 28 |
|
207 | #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F1 (2628 - CCSDS_TC_TM_PACKET_OFFSET) // 52 * 25 * 2 + 28 | |
208 |
#define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F2 (2428 - CCSDS_TC_TM_PACKET_OFFSET) // 48 * 25 * 2 + 28 |
|
208 | #define PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F2 (2428 - CCSDS_TC_TM_PACKET_OFFSET) // 48 * 25 * 2 + 28 | |
209 |
#define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 (126 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 9 + 27 |
|
209 | #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 (126 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 9 + 27 | |
210 |
#define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (356 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 2 |
|
210 | #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 (356 - CCSDS_TC_TM_PACKET_OFFSET) // 11 * 30 + 26 | |
211 |
#define PACKET_LENGTH_TM_LFR_SCIENCE_ |
|
211 | #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 (144 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 9 + 27 | |
212 |
#define PACKET_LENGTH_TM_LFR_SCIENCE_ |
|
212 | #define PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 (416 - CCSDS_TC_TM_PACKET_OFFSET) // 13 * 30 + 26 | |
213 |
#define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP |
|
213 | #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 (224 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 9 + 26 | |
|
214 | #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 (686 - CCSDS_TC_TM_PACKET_OFFSET) // 22 * 30 + 26 | |||
|
215 | #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 (260 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 9 + 26 | |||
|
216 | #define PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 (806 - CCSDS_TC_TM_PACKET_OFFSET) // 26 * 30 + 26 | |||
214 |
|
217 | |||
215 | #define PACKET_LENGTH_DELTA 11 // 7 + 4 |
|
218 | #define PACKET_LENGTH_DELTA 11 // 7 + 4 | |
216 |
|
219 | |||
217 | #define SPARE1_PUSVERSION_SPARE2 0x10 |
|
220 | #define SPARE1_PUSVERSION_SPARE2 0x10 | |
218 |
|
221 | |||
219 | // R1 |
|
222 | // R1 | |
220 | #define TM_LEN_SCI_SWF_340 4101 // 340 * 12 + 10 + 12 - 1 |
|
223 | #define TM_LEN_SCI_SWF_340 4101 // 340 * 12 + 10 + 12 - 1 | |
221 | #define TM_LEN_SCI_SWF_8 117 // 8 * 12 + 10 + 12 - 1 |
|
224 | #define TM_LEN_SCI_SWF_8 117 // 8 * 12 + 10 + 12 - 1 | |
222 | #define TM_LEN_SCI_CWF_340 4099 // 340 * 12 + 10 + 10 - 1 |
|
225 | #define TM_LEN_SCI_CWF_340 4099 // 340 * 12 + 10 + 10 - 1 | |
223 | #define TM_LEN_SCI_CWF_8 115 // 8 * 12 + 10 + 10 - 1 |
|
226 | #define TM_LEN_SCI_CWF_8 115 // 8 * 12 + 10 + 10 - 1 | |
224 | #define TM_LEN_SCI_CWF3_LIGHT_340 2059 // 340 * 6 + 10 + 10 - 1 |
|
227 | #define TM_LEN_SCI_CWF3_LIGHT_340 2059 // 340 * 6 + 10 + 10 - 1 | |
225 | #define TM_LEN_SCI_CWF3_LIGHT_8 67 // 8 * 6 + 10 + 10 - 1 |
|
228 | #define TM_LEN_SCI_CWF3_LIGHT_8 67 // 8 * 6 + 10 + 10 - 1 | |
226 | // R2 |
|
229 | // R2 | |
227 | #define TM_LEN_SCI_SWF_304 3669 // 304 * 12 + 10 + 12 - 1 |
|
230 | #define TM_LEN_SCI_SWF_304 3669 // 304 * 12 + 10 + 12 - 1 | |
228 | #define TM_LEN_SCI_SWF_224 2709 // 224 * 12 + 10 + 12 - 1 |
|
231 | #define TM_LEN_SCI_SWF_224 2709 // 224 * 12 + 10 + 12 - 1 | |
229 | #define TM_LEN_SCI_CWF_336 4051 // 336 * 12 + 10 + 10 - 1 |
|
232 | #define TM_LEN_SCI_CWF_336 4051 // 336 * 12 + 10 + 10 - 1 | |
230 | #define TM_LEN_SCI_CWF_672 4051 // 672 * 6 + 10 + 10 - 1 |
|
233 | #define TM_LEN_SCI_CWF_672 4051 // 672 * 6 + 10 + 10 - 1 | |
231 | // |
|
234 | // | |
232 | #define DEFAULT_PKTCNT 0x07 |
|
235 | #define DEFAULT_PKTCNT 0x07 | |
233 | #define BLK_NR_304 0x0130 |
|
236 | #define BLK_NR_304 0x0130 | |
234 | #define BLK_NR_224 0x00e0 |
|
237 | #define BLK_NR_224 0x00e0 | |
235 | #define BLK_NR_CWF 0x0150 // 336 |
|
238 | #define BLK_NR_CWF 0x0150 // 336 | |
236 | #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672 |
|
239 | #define BLK_NR_CWF_SHORT_F3 0x02a0 // 672 | |
237 |
|
240 | |||
238 | enum TM_TYPE{ |
|
241 | enum TM_TYPE{ | |
239 | TM_LFR_TC_EXE_OK, |
|
242 | TM_LFR_TC_EXE_OK, | |
240 | TM_LFR_TC_EXE_ERR, |
|
243 | TM_LFR_TC_EXE_ERR, | |
241 | TM_LFR_HK, |
|
244 | TM_LFR_HK, | |
242 | TM_LFR_SCI, |
|
245 | TM_LFR_SCI, | |
243 | TM_LFR_SCI_SBM, |
|
246 | TM_LFR_SCI_SBM, | |
244 | TM_LFR_PAR_DUMP |
|
247 | TM_LFR_PAR_DUMP | |
245 | }; |
|
248 | }; | |
246 |
|
249 | |||
247 | typedef struct { |
|
250 | typedef struct { | |
248 | unsigned char targetLogicalAddress; |
|
251 | unsigned char targetLogicalAddress; | |
249 | unsigned char protocolIdentifier; |
|
252 | unsigned char protocolIdentifier; | |
250 | unsigned char reserved; |
|
253 | unsigned char reserved; | |
251 | unsigned char userApplication; |
|
254 | unsigned char userApplication; | |
252 | // PACKET HEADER |
|
255 | // PACKET HEADER | |
253 | unsigned char packetID[2]; |
|
256 | unsigned char packetID[2]; | |
254 | unsigned char packetSequenceControl[2]; |
|
257 | unsigned char packetSequenceControl[2]; | |
255 | unsigned char packetLength[2]; |
|
258 | unsigned char packetLength[2]; | |
256 | // DATA FIELD HEADER |
|
259 | // DATA FIELD HEADER | |
257 | unsigned char spare1_pusVersion_spare2; |
|
260 | unsigned char spare1_pusVersion_spare2; | |
258 | unsigned char serviceType; |
|
261 | unsigned char serviceType; | |
259 | unsigned char serviceSubType; |
|
262 | unsigned char serviceSubType; | |
260 | unsigned char destinationID; |
|
263 | unsigned char destinationID; | |
261 | unsigned char time[6]; |
|
264 | unsigned char time[6]; | |
262 | // |
|
265 | // | |
263 | unsigned char telecommand_pkt_id[2]; |
|
266 | unsigned char telecommand_pkt_id[2]; | |
264 | unsigned char pkt_seq_control[2]; |
|
267 | unsigned char pkt_seq_control[2]; | |
265 | } Packet_TM_LFR_TC_EXE_SUCCESS_t; |
|
268 | } Packet_TM_LFR_TC_EXE_SUCCESS_t; | |
266 |
|
269 | |||
267 | typedef struct { |
|
270 | typedef struct { | |
268 | unsigned char targetLogicalAddress; |
|
271 | unsigned char targetLogicalAddress; | |
269 | unsigned char protocolIdentifier; |
|
272 | unsigned char protocolIdentifier; | |
270 | unsigned char reserved; |
|
273 | unsigned char reserved; | |
271 | unsigned char userApplication; |
|
274 | unsigned char userApplication; | |
272 | // PACKET HEADER |
|
275 | // PACKET HEADER | |
273 | unsigned char packetID[2]; |
|
276 | unsigned char packetID[2]; | |
274 | unsigned char packetSequenceControl[2]; |
|
277 | unsigned char packetSequenceControl[2]; | |
275 | unsigned char packetLength[2]; |
|
278 | unsigned char packetLength[2]; | |
276 | // DATA FIELD HEADER |
|
279 | // DATA FIELD HEADER | |
277 | unsigned char spare1_pusVersion_spare2; |
|
280 | unsigned char spare1_pusVersion_spare2; | |
278 | unsigned char serviceType; |
|
281 | unsigned char serviceType; | |
279 | unsigned char serviceSubType; |
|
282 | unsigned char serviceSubType; | |
280 | unsigned char destinationID; |
|
283 | unsigned char destinationID; | |
281 | unsigned char time[6]; |
|
284 | unsigned char time[6]; | |
282 | // |
|
285 | // | |
283 | unsigned char tc_failure_code[2]; |
|
286 | unsigned char tc_failure_code[2]; | |
284 | unsigned char telecommand_pkt_id[2]; |
|
287 | unsigned char telecommand_pkt_id[2]; | |
285 | unsigned char pkt_seq_control[2]; |
|
288 | unsigned char pkt_seq_control[2]; | |
286 | unsigned char tc_service; |
|
289 | unsigned char tc_service; | |
287 | unsigned char tc_subtype; |
|
290 | unsigned char tc_subtype; | |
288 | unsigned char byte_position; |
|
291 | unsigned char byte_position; | |
289 | unsigned char rcv_value; |
|
292 | unsigned char rcv_value; | |
290 | } Packet_TM_LFR_TC_EXE_INCONSISTENT_t; |
|
293 | } Packet_TM_LFR_TC_EXE_INCONSISTENT_t; | |
291 |
|
294 | |||
292 | typedef struct { |
|
295 | typedef struct { | |
293 | unsigned char targetLogicalAddress; |
|
296 | unsigned char targetLogicalAddress; | |
294 | unsigned char protocolIdentifier; |
|
297 | unsigned char protocolIdentifier; | |
295 | unsigned char reserved; |
|
298 | unsigned char reserved; | |
296 | unsigned char userApplication; |
|
299 | unsigned char userApplication; | |
297 | // PACKET HEADER |
|
300 | // PACKET HEADER | |
298 | unsigned char packetID[2]; |
|
301 | unsigned char packetID[2]; | |
299 | unsigned char packetSequenceControl[2]; |
|
302 | unsigned char packetSequenceControl[2]; | |
300 | unsigned char packetLength[2]; |
|
303 | unsigned char packetLength[2]; | |
301 | // DATA FIELD HEADER |
|
304 | // DATA FIELD HEADER | |
302 | unsigned char spare1_pusVersion_spare2; |
|
305 | unsigned char spare1_pusVersion_spare2; | |
303 | unsigned char serviceType; |
|
306 | unsigned char serviceType; | |
304 | unsigned char serviceSubType; |
|
307 | unsigned char serviceSubType; | |
305 | unsigned char destinationID; |
|
308 | unsigned char destinationID; | |
306 | unsigned char time[6]; |
|
309 | unsigned char time[6]; | |
307 | // |
|
310 | // | |
308 | unsigned char tc_failure_code[2]; |
|
311 | unsigned char tc_failure_code[2]; | |
309 | unsigned char telecommand_pkt_id[2]; |
|
312 | unsigned char telecommand_pkt_id[2]; | |
310 | unsigned char pkt_seq_control[2]; |
|
313 | unsigned char pkt_seq_control[2]; | |
311 | unsigned char tc_service; |
|
314 | unsigned char tc_service; | |
312 | unsigned char tc_subtype; |
|
315 | unsigned char tc_subtype; | |
313 | unsigned char lfr_status_word[2]; |
|
316 | unsigned char lfr_status_word[2]; | |
314 | } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t; |
|
317 | } Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t; | |
315 |
|
318 | |||
316 | typedef struct { |
|
319 | typedef struct { | |
317 | unsigned char targetLogicalAddress; |
|
320 | unsigned char targetLogicalAddress; | |
318 | unsigned char protocolIdentifier; |
|
321 | unsigned char protocolIdentifier; | |
319 | unsigned char reserved; |
|
322 | unsigned char reserved; | |
320 | unsigned char userApplication; |
|
323 | unsigned char userApplication; | |
321 | // PACKET HEADER |
|
324 | // PACKET HEADER | |
322 | unsigned char packetID[2]; |
|
325 | unsigned char packetID[2]; | |
323 | unsigned char packetSequenceControl[2]; |
|
326 | unsigned char packetSequenceControl[2]; | |
324 | unsigned char packetLength[2]; |
|
327 | unsigned char packetLength[2]; | |
325 | // DATA FIELD HEADER |
|
328 | // DATA FIELD HEADER | |
326 | unsigned char spare1_pusVersion_spare2; |
|
329 | unsigned char spare1_pusVersion_spare2; | |
327 | unsigned char serviceType; |
|
330 | unsigned char serviceType; | |
328 | unsigned char serviceSubType; |
|
331 | unsigned char serviceSubType; | |
329 | unsigned char destinationID; |
|
332 | unsigned char destinationID; | |
330 | unsigned char time[6]; |
|
333 | unsigned char time[6]; | |
331 | // |
|
334 | // | |
332 | unsigned char tc_failure_code[2]; |
|
335 | unsigned char tc_failure_code[2]; | |
333 | unsigned char telecommand_pkt_id[2]; |
|
336 | unsigned char telecommand_pkt_id[2]; | |
334 | unsigned char pkt_seq_control[2]; |
|
337 | unsigned char pkt_seq_control[2]; | |
335 | unsigned char tc_service; |
|
338 | unsigned char tc_service; | |
336 | unsigned char tc_subtype; |
|
339 | unsigned char tc_subtype; | |
337 | } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t; |
|
340 | } Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t; | |
338 |
|
341 | |||
339 | typedef struct { |
|
342 | typedef struct { | |
340 | unsigned char targetLogicalAddress; |
|
343 | unsigned char targetLogicalAddress; | |
341 | unsigned char protocolIdentifier; |
|
344 | unsigned char protocolIdentifier; | |
342 | unsigned char reserved; |
|
345 | unsigned char reserved; | |
343 | unsigned char userApplication; |
|
346 | unsigned char userApplication; | |
344 | // PACKET HEADER |
|
347 | // PACKET HEADER | |
345 | unsigned char packetID[2]; |
|
348 | unsigned char packetID[2]; | |
346 | unsigned char packetSequenceControl[2]; |
|
349 | unsigned char packetSequenceControl[2]; | |
347 | unsigned char packetLength[2]; |
|
350 | unsigned char packetLength[2]; | |
348 | // DATA FIELD HEADER |
|
351 | // DATA FIELD HEADER | |
349 | unsigned char spare1_pusVersion_spare2; |
|
352 | unsigned char spare1_pusVersion_spare2; | |
350 | unsigned char serviceType; |
|
353 | unsigned char serviceType; | |
351 | unsigned char serviceSubType; |
|
354 | unsigned char serviceSubType; | |
352 | unsigned char destinationID; |
|
355 | unsigned char destinationID; | |
353 | unsigned char time[6]; |
|
356 | unsigned char time[6]; | |
354 | // |
|
357 | // | |
355 | unsigned char tc_failure_code[2]; |
|
358 | unsigned char tc_failure_code[2]; | |
356 | unsigned char telecommand_pkt_id[2]; |
|
359 | unsigned char telecommand_pkt_id[2]; | |
357 | unsigned char pkt_seq_control[2]; |
|
360 | unsigned char pkt_seq_control[2]; | |
358 | unsigned char tc_service; |
|
361 | unsigned char tc_service; | |
359 | unsigned char tc_subtype; |
|
362 | unsigned char tc_subtype; | |
360 | } Packet_TM_LFR_TC_EXE_ERROR_t; |
|
363 | } Packet_TM_LFR_TC_EXE_ERROR_t; | |
361 |
|
364 | |||
362 | typedef struct { |
|
365 | typedef struct { | |
363 | unsigned char targetLogicalAddress; |
|
366 | unsigned char targetLogicalAddress; | |
364 | unsigned char protocolIdentifier; |
|
367 | unsigned char protocolIdentifier; | |
365 | unsigned char reserved; |
|
368 | unsigned char reserved; | |
366 | unsigned char userApplication; |
|
369 | unsigned char userApplication; | |
367 | // PACKET HEADER |
|
370 | // PACKET HEADER | |
368 | unsigned char packetID[2]; |
|
371 | unsigned char packetID[2]; | |
369 | unsigned char packetSequenceControl[2]; |
|
372 | unsigned char packetSequenceControl[2]; | |
370 | unsigned char packetLength[2]; |
|
373 | unsigned char packetLength[2]; | |
371 | // DATA FIELD HEADER |
|
374 | // DATA FIELD HEADER | |
372 | unsigned char spare1_pusVersion_spare2; |
|
375 | unsigned char spare1_pusVersion_spare2; | |
373 | unsigned char serviceType; |
|
376 | unsigned char serviceType; | |
374 | unsigned char serviceSubType; |
|
377 | unsigned char serviceSubType; | |
375 | unsigned char destinationID; |
|
378 | unsigned char destinationID; | |
376 | unsigned char time[6]; |
|
379 | unsigned char time[6]; | |
377 | // |
|
380 | // | |
378 | unsigned char tc_failure_code[2]; |
|
381 | unsigned char tc_failure_code[2]; | |
379 | unsigned char telecommand_pkt_id[2]; |
|
382 | unsigned char telecommand_pkt_id[2]; | |
380 | unsigned char pkt_seq_control[2]; |
|
383 | unsigned char pkt_seq_control[2]; | |
381 | unsigned char tc_service; |
|
384 | unsigned char tc_service; | |
382 | unsigned char tc_subtype; |
|
385 | unsigned char tc_subtype; | |
383 | unsigned char pkt_len_rcv_value[2]; |
|
386 | unsigned char pkt_len_rcv_value[2]; | |
384 | unsigned char pkt_datafieldsize_cnt[2]; |
|
387 | unsigned char pkt_datafieldsize_cnt[2]; | |
385 | unsigned char rcv_crc[2]; |
|
388 | unsigned char rcv_crc[2]; | |
386 | unsigned char computed_crc[2]; |
|
389 | unsigned char computed_crc[2]; | |
387 | } Packet_TM_LFR_TC_EXE_CORRUPTED_t; |
|
390 | } Packet_TM_LFR_TC_EXE_CORRUPTED_t; | |
388 |
|
391 | |||
389 | typedef struct { |
|
392 | typedef struct { | |
390 | unsigned char targetLogicalAddress; |
|
393 | unsigned char targetLogicalAddress; | |
391 | unsigned char protocolIdentifier; |
|
394 | unsigned char protocolIdentifier; | |
392 | unsigned char reserved; |
|
395 | unsigned char reserved; | |
393 | unsigned char userApplication; |
|
396 | unsigned char userApplication; | |
394 | unsigned char packetID[2]; |
|
397 | unsigned char packetID[2]; | |
395 | unsigned char packetSequenceControl[2]; |
|
398 | unsigned char packetSequenceControl[2]; | |
396 | unsigned char packetLength[2]; |
|
399 | unsigned char packetLength[2]; | |
397 | // DATA FIELD HEADER |
|
400 | // DATA FIELD HEADER | |
398 | unsigned char spare1_pusVersion_spare2; |
|
401 | unsigned char spare1_pusVersion_spare2; | |
399 | unsigned char serviceType; |
|
402 | unsigned char serviceType; | |
400 | unsigned char serviceSubType; |
|
403 | unsigned char serviceSubType; | |
401 | unsigned char destinationID; |
|
404 | unsigned char destinationID; | |
402 | unsigned char time[6]; |
|
405 | unsigned char time[6]; | |
403 | // AUXILIARY HEADER |
|
406 | // AUXILIARY HEADER | |
404 | unsigned char sid; |
|
407 | unsigned char sid; | |
405 | unsigned char hkBIA; |
|
408 | unsigned char hkBIA; | |
406 | unsigned char pktCnt; |
|
409 | unsigned char pktCnt; | |
407 | unsigned char pktNr; |
|
410 | unsigned char pktNr; | |
408 | unsigned char acquisitionTime[6]; |
|
411 | unsigned char acquisitionTime[6]; | |
409 | unsigned char blkNr[2]; |
|
412 | unsigned char blkNr[2]; | |
410 | } Header_TM_LFR_SCIENCE_SWF_t; |
|
413 | } Header_TM_LFR_SCIENCE_SWF_t; | |
411 |
|
414 | |||
412 | typedef struct { |
|
415 | typedef struct { | |
413 | unsigned char targetLogicalAddress; |
|
416 | unsigned char targetLogicalAddress; | |
414 | unsigned char protocolIdentifier; |
|
417 | unsigned char protocolIdentifier; | |
415 | unsigned char reserved; |
|
418 | unsigned char reserved; | |
416 | unsigned char userApplication; |
|
419 | unsigned char userApplication; | |
417 | unsigned char packetID[2]; |
|
420 | unsigned char packetID[2]; | |
418 | unsigned char packetSequenceControl[2]; |
|
421 | unsigned char packetSequenceControl[2]; | |
419 | unsigned char packetLength[2]; |
|
422 | unsigned char packetLength[2]; | |
420 | // DATA FIELD HEADER |
|
423 | // DATA FIELD HEADER | |
421 | unsigned char spare1_pusVersion_spare2; |
|
424 | unsigned char spare1_pusVersion_spare2; | |
422 | unsigned char serviceType; |
|
425 | unsigned char serviceType; | |
423 | unsigned char serviceSubType; |
|
426 | unsigned char serviceSubType; | |
424 | unsigned char destinationID; |
|
427 | unsigned char destinationID; | |
425 | unsigned char time[6]; |
|
428 | unsigned char time[6]; | |
426 | // AUXILIARY DATA HEADER |
|
429 | // AUXILIARY DATA HEADER | |
427 | unsigned char sid; |
|
430 | unsigned char sid; | |
428 | unsigned char hkBIA; |
|
431 | unsigned char hkBIA; | |
429 | unsigned char acquisitionTime[6]; |
|
432 | unsigned char acquisitionTime[6]; | |
430 | unsigned char blkNr[2]; |
|
433 | unsigned char blkNr[2]; | |
431 | } Header_TM_LFR_SCIENCE_CWF_t; |
|
434 | } Header_TM_LFR_SCIENCE_CWF_t; | |
432 |
|
435 | |||
433 | typedef struct { |
|
436 | typedef struct { | |
434 | unsigned char targetLogicalAddress; |
|
437 | unsigned char targetLogicalAddress; | |
435 | unsigned char protocolIdentifier; |
|
438 | unsigned char protocolIdentifier; | |
436 | unsigned char reserved; |
|
439 | unsigned char reserved; | |
437 | unsigned char userApplication; |
|
440 | unsigned char userApplication; | |
438 | unsigned char packetID[2]; |
|
441 | unsigned char packetID[2]; | |
439 | unsigned char packetSequenceControl[2]; |
|
442 | unsigned char packetSequenceControl[2]; | |
440 | unsigned char packetLength[2]; |
|
443 | unsigned char packetLength[2]; | |
441 | // DATA FIELD HEADER |
|
444 | // DATA FIELD HEADER | |
442 | unsigned char spare1_pusVersion_spare2; |
|
445 | unsigned char spare1_pusVersion_spare2; | |
443 | unsigned char serviceType; |
|
446 | unsigned char serviceType; | |
444 | unsigned char serviceSubType; |
|
447 | unsigned char serviceSubType; | |
445 | unsigned char destinationID; |
|
448 | unsigned char destinationID; | |
446 | unsigned char time[6]; |
|
449 | unsigned char time[6]; | |
447 | // AUXILIARY HEADER |
|
450 | // AUXILIARY HEADER | |
448 | unsigned char sid; |
|
451 | unsigned char sid; | |
449 | unsigned char biaStatusInfo; |
|
452 | unsigned char biaStatusInfo; | |
450 | unsigned char pa_lfr_pkt_cnt_asm; |
|
453 | unsigned char pa_lfr_pkt_cnt_asm; | |
451 | unsigned char pa_lfr_pkt_nr_asm; |
|
454 | unsigned char pa_lfr_pkt_nr_asm; | |
452 | unsigned char acquisitionTime[6]; |
|
455 | unsigned char acquisitionTime[6]; | |
453 | unsigned char pa_lfr_asm_blk_nr[2]; |
|
456 | unsigned char pa_lfr_asm_blk_nr[2]; | |
454 | } Header_TM_LFR_SCIENCE_ASM_t; |
|
457 | } Header_TM_LFR_SCIENCE_ASM_t; | |
455 |
|
458 | |||
456 | typedef struct { |
|
459 | typedef struct { | |
457 | unsigned char targetLogicalAddress; |
|
460 | unsigned char targetLogicalAddress; | |
458 | unsigned char protocolIdentifier; |
|
461 | unsigned char protocolIdentifier; | |
459 | unsigned char reserved; |
|
462 | unsigned char reserved; | |
460 | unsigned char userApplication; |
|
463 | unsigned char userApplication; | |
461 | unsigned char packetID[2]; |
|
464 | unsigned char packetID[2]; | |
462 | unsigned char packetSequenceControl[2]; |
|
465 | unsigned char packetSequenceControl[2]; | |
463 | unsigned char packetLength[2]; |
|
466 | unsigned char packetLength[2]; | |
464 | // DATA FIELD HEADER |
|
467 | // DATA FIELD HEADER | |
465 | unsigned char spare1_pusVersion_spare2; |
|
468 | unsigned char spare1_pusVersion_spare2; | |
466 | unsigned char serviceType; |
|
469 | unsigned char serviceType; | |
467 | unsigned char serviceSubType; |
|
470 | unsigned char serviceSubType; | |
468 | unsigned char destinationID; |
|
471 | unsigned char destinationID; | |
469 | unsigned char time[6]; |
|
472 | unsigned char time[6]; | |
470 | // AUXILIARY HEADER |
|
473 | // AUXILIARY HEADER | |
471 | unsigned char sid; |
|
474 | unsigned char sid; | |
472 | unsigned char biaStatusInfo; |
|
475 | unsigned char biaStatusInfo; | |
473 | unsigned char acquisitionTime[6]; |
|
476 | unsigned char acquisitionTime[6]; | |
474 | unsigned char source_data_spare[2]; |
|
477 | unsigned char source_data_spare[2]; | |
475 | unsigned char pa_lfr_bp_blk_nr[2]; |
|
478 | unsigned char pa_lfr_bp_blk_nr[2]; | |
476 | } Header_TM_LFR_SCIENCE_BP_with_spare_t; |
|
479 | } Header_TM_LFR_SCIENCE_BP_with_spare_t; | |
477 |
|
480 | |||
478 | typedef struct { |
|
481 | typedef struct { | |
479 | unsigned char targetLogicalAddress; |
|
482 | unsigned char targetLogicalAddress; | |
480 | unsigned char protocolIdentifier; |
|
483 | unsigned char protocolIdentifier; | |
481 | unsigned char reserved; |
|
484 | unsigned char reserved; | |
482 | unsigned char userApplication; |
|
485 | unsigned char userApplication; | |
483 | unsigned char packetID[2]; |
|
486 | unsigned char packetID[2]; | |
484 | unsigned char packetSequenceControl[2]; |
|
487 | unsigned char packetSequenceControl[2]; | |
485 | unsigned char packetLength[2]; |
|
488 | unsigned char packetLength[2]; | |
486 | // DATA FIELD HEADER |
|
489 | // DATA FIELD HEADER | |
487 | unsigned char spare1_pusVersion_spare2; |
|
490 | unsigned char spare1_pusVersion_spare2; | |
488 | unsigned char serviceType; |
|
491 | unsigned char serviceType; | |
489 | unsigned char serviceSubType; |
|
492 | unsigned char serviceSubType; | |
490 | unsigned char destinationID; |
|
493 | unsigned char destinationID; | |
491 | unsigned char time[6]; |
|
494 | unsigned char time[6]; | |
492 | // AUXILIARY HEADER |
|
495 | // AUXILIARY HEADER | |
493 | unsigned char sid; |
|
496 | unsigned char sid; | |
494 | unsigned char biaStatusInfo; |
|
497 | unsigned char biaStatusInfo; | |
495 | unsigned char acquisitionTime[6]; |
|
498 | unsigned char acquisitionTime[6]; | |
496 | unsigned char pa_lfr_bp_blk_nr[2]; |
|
499 | unsigned char pa_lfr_bp_blk_nr[2]; | |
497 | } Header_TM_LFR_SCIENCE_BP_t; |
|
500 | } Header_TM_LFR_SCIENCE_BP_t; | |
498 |
|
501 | |||
499 | typedef struct { |
|
502 | typedef struct { | |
500 | //targetLogicalAddress is removed by the grspw module |
|
503 | //targetLogicalAddress is removed by the grspw module | |
501 | unsigned char protocolIdentifier; |
|
504 | unsigned char protocolIdentifier; | |
502 | unsigned char reserved; |
|
505 | unsigned char reserved; | |
503 | unsigned char userApplication; |
|
506 | unsigned char userApplication; | |
504 | unsigned char packetID[2]; |
|
507 | unsigned char packetID[2]; | |
505 | unsigned char packetSequenceControl[2]; |
|
508 | unsigned char packetSequenceControl[2]; | |
506 | unsigned char packetLength[2]; |
|
509 | unsigned char packetLength[2]; | |
507 | // DATA FIELD HEADER |
|
510 | // DATA FIELD HEADER | |
508 | unsigned char headerFlag_pusVersion_Ack; |
|
511 | unsigned char headerFlag_pusVersion_Ack; | |
509 | unsigned char serviceType; |
|
512 | unsigned char serviceType; | |
510 | unsigned char serviceSubType; |
|
513 | unsigned char serviceSubType; | |
511 | unsigned char sourceID; |
|
514 | unsigned char sourceID; | |
512 | unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10]; |
|
515 | unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10]; | |
513 | } ccsdsTelecommandPacket_t; |
|
516 | } ccsdsTelecommandPacket_t; | |
514 |
|
517 | |||
515 | typedef struct { |
|
518 | typedef struct { | |
516 | unsigned char targetLogicalAddress; |
|
519 | unsigned char targetLogicalAddress; | |
517 | unsigned char protocolIdentifier; |
|
520 | unsigned char protocolIdentifier; | |
518 | unsigned char reserved; |
|
521 | unsigned char reserved; | |
519 | unsigned char userApplication; |
|
522 | unsigned char userApplication; | |
520 | unsigned char packetID[2]; |
|
523 | unsigned char packetID[2]; | |
521 | unsigned char packetSequenceControl[2]; |
|
524 | unsigned char packetSequenceControl[2]; | |
522 | unsigned char packetLength[2]; |
|
525 | unsigned char packetLength[2]; | |
523 | unsigned char spare1_pusVersion_spare2; |
|
526 | unsigned char spare1_pusVersion_spare2; | |
524 | unsigned char serviceType; |
|
527 | unsigned char serviceType; | |
525 | unsigned char serviceSubType; |
|
528 | unsigned char serviceSubType; | |
526 | unsigned char destinationID; |
|
529 | unsigned char destinationID; | |
527 | unsigned char time[6]; |
|
530 | unsigned char time[6]; | |
528 | unsigned char sid; |
|
531 | unsigned char sid; | |
529 |
|
532 | |||
530 | //************** |
|
533 | //************** | |
531 | // HK PARAMETERS |
|
534 | // HK PARAMETERS | |
532 | unsigned char lfr_status_word[2]; |
|
535 | unsigned char lfr_status_word[2]; | |
533 | unsigned char lfr_sw_version[4]; |
|
536 | unsigned char lfr_sw_version[4]; | |
534 | unsigned char lfr_fpga_version[3]; |
|
537 | unsigned char lfr_fpga_version[3]; | |
535 | // ressource statistics |
|
538 | // ressource statistics | |
536 | unsigned char hk_lfr_cpu_load; |
|
539 | unsigned char hk_lfr_cpu_load; | |
537 | unsigned char hk_lfr_load_max; |
|
540 | unsigned char hk_lfr_load_max; | |
538 | unsigned char hk_lfr_load_aver; |
|
541 | unsigned char hk_lfr_load_aver; | |
539 | // tc statistics |
|
542 | // tc statistics | |
540 | unsigned char hk_lfr_update_info_tc_cnt[2]; |
|
543 | unsigned char hk_lfr_update_info_tc_cnt[2]; | |
541 | unsigned char hk_lfr_update_time_tc_cnt[2]; |
|
544 | unsigned char hk_lfr_update_time_tc_cnt[2]; | |
542 | unsigned char hk_lfr_exe_tc_cnt[2]; |
|
545 | unsigned char hk_lfr_exe_tc_cnt[2]; | |
543 | unsigned char hk_lfr_rej_tc_cnt[2]; |
|
546 | unsigned char hk_lfr_rej_tc_cnt[2]; | |
544 | unsigned char hk_lfr_last_exe_tc_id[2]; |
|
547 | unsigned char hk_lfr_last_exe_tc_id[2]; | |
545 | unsigned char hk_lfr_last_exe_tc_type[2]; |
|
548 | unsigned char hk_lfr_last_exe_tc_type[2]; | |
546 | unsigned char hk_lfr_last_exe_tc_subtype[2]; |
|
549 | unsigned char hk_lfr_last_exe_tc_subtype[2]; | |
547 | unsigned char hk_lfr_last_exe_tc_time[6]; |
|
550 | unsigned char hk_lfr_last_exe_tc_time[6]; | |
548 | unsigned char hk_lfr_last_rej_tc_id[2]; |
|
551 | unsigned char hk_lfr_last_rej_tc_id[2]; | |
549 | unsigned char hk_lfr_last_rej_tc_type[2]; |
|
552 | unsigned char hk_lfr_last_rej_tc_type[2]; | |
550 | unsigned char hk_lfr_last_rej_tc_subtype[2]; |
|
553 | unsigned char hk_lfr_last_rej_tc_subtype[2]; | |
551 | unsigned char hk_lfr_last_rej_tc_time[6]; |
|
554 | unsigned char hk_lfr_last_rej_tc_time[6]; | |
552 | // anomaly statistics |
|
555 | // anomaly statistics | |
553 | unsigned char hk_lfr_le_cnt[2]; |
|
556 | unsigned char hk_lfr_le_cnt[2]; | |
554 | unsigned char hk_lfr_me_cnt[2]; |
|
557 | unsigned char hk_lfr_me_cnt[2]; | |
555 | unsigned char hk_lfr_he_cnt[2]; |
|
558 | unsigned char hk_lfr_he_cnt[2]; | |
556 | unsigned char hk_lfr_last_er_rid[2]; |
|
559 | unsigned char hk_lfr_last_er_rid[2]; | |
557 | unsigned char hk_lfr_last_er_code; |
|
560 | unsigned char hk_lfr_last_er_code; | |
558 | unsigned char hk_lfr_last_er_time[6]; |
|
561 | unsigned char hk_lfr_last_er_time[6]; | |
559 | // vhdl_blk_status |
|
562 | // vhdl_blk_status | |
560 | unsigned char hk_lfr_vhdl_aa_sm; |
|
563 | unsigned char hk_lfr_vhdl_aa_sm; | |
561 | unsigned char hk_lfr_vhdl_fft_sr; |
|
564 | unsigned char hk_lfr_vhdl_fft_sr; | |
562 | unsigned char hk_lfr_vhdl_cic_hk; |
|
565 | unsigned char hk_lfr_vhdl_cic_hk; | |
563 | unsigned char hk_lfr_vhdl_iir_cal; |
|
566 | unsigned char hk_lfr_vhdl_iir_cal; | |
564 | // spacewire_if_statistics |
|
567 | // spacewire_if_statistics | |
565 | unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2]; |
|
568 | unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2]; | |
566 | unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2]; |
|
569 | unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2]; | |
567 | unsigned char hk_lfr_dpu_spw_tick_out_cnt; |
|
570 | unsigned char hk_lfr_dpu_spw_tick_out_cnt; | |
568 | unsigned char hk_lfr_dpu_spw_last_timc; |
|
571 | unsigned char hk_lfr_dpu_spw_last_timc; | |
569 | // ahb error statistics |
|
572 | // ahb error statistics | |
570 | unsigned int hk_lfr_last_fail_addr; |
|
573 | unsigned int hk_lfr_last_fail_addr; | |
571 | // temperatures |
|
574 | // temperatures | |
572 | unsigned char hk_lfr_temp_scm[2]; |
|
575 | unsigned char hk_lfr_temp_scm[2]; | |
573 | unsigned char hk_lfr_temp_pcb[2]; |
|
576 | unsigned char hk_lfr_temp_pcb[2]; | |
574 | unsigned char hk_lfr_temp_fpga[2]; |
|
577 | unsigned char hk_lfr_temp_fpga[2]; | |
575 | // spacecraft potential |
|
578 | // spacecraft potential | |
576 | unsigned char hk_lfr_sc_v_f3[2]; |
|
579 | unsigned char hk_lfr_sc_v_f3[2]; | |
577 | unsigned char hk_lfr_sc_e1_f3[2]; |
|
580 | unsigned char hk_lfr_sc_e1_f3[2]; | |
578 | unsigned char hk_lfr_sc_e2_f3[2]; |
|
581 | unsigned char hk_lfr_sc_e2_f3[2]; | |
579 | // error counters |
|
582 | // error counters | |
580 | unsigned char hk_lfr_dpu_spw_parity; |
|
583 | unsigned char hk_lfr_dpu_spw_parity; | |
581 | unsigned char hk_lfr_dpu_spw_disconnect; |
|
584 | unsigned char hk_lfr_dpu_spw_disconnect; | |
582 | unsigned char hk_lfr_dpu_spw_escape; |
|
585 | unsigned char hk_lfr_dpu_spw_escape; | |
583 | unsigned char hk_lfr_dpu_spw_credit; |
|
586 | unsigned char hk_lfr_dpu_spw_credit; | |
584 | unsigned char hk_lfr_dpu_spw_write_sync; |
|
587 | unsigned char hk_lfr_dpu_spw_write_sync; | |
585 | unsigned char hk_lfr_dpu_spw_rx_ahb; |
|
588 | unsigned char hk_lfr_dpu_spw_rx_ahb; | |
586 | unsigned char hk_lfr_dpu_spw_tx_ahb; |
|
589 | unsigned char hk_lfr_dpu_spw_tx_ahb; | |
587 | unsigned char hk_lfr_dpu_spw_early_eop; |
|
590 | unsigned char hk_lfr_dpu_spw_early_eop; | |
588 | unsigned char hk_lfr_dpu_spw_invalid_addr; |
|
591 | unsigned char hk_lfr_dpu_spw_invalid_addr; | |
589 | unsigned char hk_lfr_dpu_spw_eep; |
|
592 | unsigned char hk_lfr_dpu_spw_eep; | |
590 | unsigned char hk_lfr_dpu_spw_rx_too_big; |
|
593 | unsigned char hk_lfr_dpu_spw_rx_too_big; | |
591 | // timecode |
|
594 | // timecode | |
592 | unsigned char hk_lfr_timecode_erroneous; |
|
595 | unsigned char hk_lfr_timecode_erroneous; | |
593 | unsigned char hk_lfr_timecode_missing; |
|
596 | unsigned char hk_lfr_timecode_missing; | |
594 | unsigned char hk_lfr_timecode_invalid; |
|
597 | unsigned char hk_lfr_timecode_invalid; | |
595 | // time |
|
598 | // time | |
596 | unsigned char hk_lfr_time_timecode_it; |
|
599 | unsigned char hk_lfr_time_timecode_it; | |
597 | unsigned char hk_lfr_time_not_synchro; |
|
600 | unsigned char hk_lfr_time_not_synchro; | |
598 | unsigned char hk_lfr_time_timecode_ctr; |
|
601 | unsigned char hk_lfr_time_timecode_ctr; | |
599 | // hk_lfr_buffer_dpu_ |
|
602 | // hk_lfr_buffer_dpu_ | |
600 | unsigned char hk_lfr_buffer_dpu_tc_fifo; |
|
603 | unsigned char hk_lfr_buffer_dpu_tc_fifo; | |
601 | unsigned char hk_lfr_buffer_dpu_tm_fifo; |
|
604 | unsigned char hk_lfr_buffer_dpu_tm_fifo; | |
602 | // hk_lfr_ahb_ |
|
605 | // hk_lfr_ahb_ | |
603 | unsigned char hk_lfr_ahb_correctable; |
|
606 | unsigned char hk_lfr_ahb_correctable; | |
604 | unsigned char hk_lfr_ahb_uncorrectable; |
|
607 | unsigned char hk_lfr_ahb_uncorrectable; | |
605 | // spare |
|
608 | // spare | |
606 | unsigned char parameters_spare; |
|
609 | unsigned char parameters_spare; | |
607 | } Packet_TM_LFR_HK_t; |
|
610 | } Packet_TM_LFR_HK_t; | |
608 |
|
611 | |||
609 | typedef struct { |
|
612 | typedef struct { | |
610 | unsigned char targetLogicalAddress; |
|
613 | unsigned char targetLogicalAddress; | |
611 | unsigned char protocolIdentifier; |
|
614 | unsigned char protocolIdentifier; | |
612 | unsigned char reserved; |
|
615 | unsigned char reserved; | |
613 | unsigned char userApplication; |
|
616 | unsigned char userApplication; | |
614 | unsigned char packetID[2]; |
|
617 | unsigned char packetID[2]; | |
615 | unsigned char packetSequenceControl[2]; |
|
618 | unsigned char packetSequenceControl[2]; | |
616 | unsigned char packetLength[2]; |
|
619 | unsigned char packetLength[2]; | |
617 | // DATA FIELD HEADER |
|
620 | // DATA FIELD HEADER | |
618 | unsigned char spare1_pusVersion_spare2; |
|
621 | unsigned char spare1_pusVersion_spare2; | |
619 | unsigned char serviceType; |
|
622 | unsigned char serviceType; | |
620 | unsigned char serviceSubType; |
|
623 | unsigned char serviceSubType; | |
621 | unsigned char destinationID; |
|
624 | unsigned char destinationID; | |
622 | unsigned char time[6]; |
|
625 | unsigned char time[6]; | |
623 | unsigned char sid; |
|
626 | unsigned char sid; | |
624 |
|
627 | |||
625 | //****************** |
|
628 | //****************** | |
626 | // COMMON PARAMETERS |
|
629 | // COMMON PARAMETERS | |
627 | unsigned char unused0; |
|
630 | unsigned char unused0; | |
628 | unsigned char bw_sp0_sp1_r0_r1; |
|
631 | unsigned char bw_sp0_sp1_r0_r1; | |
629 |
|
632 | |||
630 | //****************** |
|
633 | //****************** | |
631 | // NORMAL PARAMETERS |
|
634 | // NORMAL PARAMETERS | |
632 | unsigned char sy_lfr_n_swf_l[2]; |
|
635 | unsigned char sy_lfr_n_swf_l[2]; | |
633 | unsigned char sy_lfr_n_swf_p[2]; |
|
636 | unsigned char sy_lfr_n_swf_p[2]; | |
634 | unsigned char sy_lfr_n_asm_p[2]; |
|
637 | unsigned char sy_lfr_n_asm_p[2]; | |
635 | unsigned char sy_lfr_n_bp_p0; |
|
638 | unsigned char sy_lfr_n_bp_p0; | |
636 | unsigned char sy_lfr_n_bp_p1; |
|
639 | unsigned char sy_lfr_n_bp_p1; | |
637 | unsigned char sy_lfr_n_cwf_long_f3; |
|
640 | unsigned char sy_lfr_n_cwf_long_f3; | |
638 | unsigned char lfr_normal_parameters_spare; |
|
641 | unsigned char lfr_normal_parameters_spare; | |
639 |
|
642 | |||
640 | //***************** |
|
643 | //***************** | |
641 | // BURST PARAMETERS |
|
644 | // BURST PARAMETERS | |
642 | unsigned char sy_lfr_b_bp_p0; |
|
645 | unsigned char sy_lfr_b_bp_p0; | |
643 | unsigned char sy_lfr_b_bp_p1; |
|
646 | unsigned char sy_lfr_b_bp_p1; | |
644 |
|
647 | |||
645 | //**************** |
|
648 | //**************** | |
646 | // SBM1 PARAMETERS |
|
649 | // SBM1 PARAMETERS | |
647 | unsigned char sy_lfr_s1_bp_p0; |
|
650 | unsigned char sy_lfr_s1_bp_p0; | |
648 | unsigned char sy_lfr_s1_bp_p1; |
|
651 | unsigned char sy_lfr_s1_bp_p1; | |
649 |
|
652 | |||
650 | //**************** |
|
653 | //**************** | |
651 | // SBM2 PARAMETERS |
|
654 | // SBM2 PARAMETERS | |
652 | unsigned char sy_lfr_s2_bp_p0; |
|
655 | unsigned char sy_lfr_s2_bp_p0; | |
653 | unsigned char sy_lfr_s2_bp_p1; |
|
656 | unsigned char sy_lfr_s2_bp_p1; | |
654 |
|
657 | |||
655 | // SPARE |
|
658 | // SPARE | |
656 | unsigned char source_data_spare; |
|
659 | unsigned char source_data_spare; | |
657 | } Packet_TM_LFR_PARAMETER_DUMP_t; |
|
660 | } Packet_TM_LFR_PARAMETER_DUMP_t; | |
658 |
|
661 | |||
659 |
|
662 | |||
660 | #endif // CCSDS_TYPES_H_INCLUDED |
|
663 | #endif // CCSDS_TYPES_H_INCLUDED |
@@ -1,307 +1,284 | |||||
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 "fsw_params_nb_bytes.h" |
|
6 | #include "fsw_params_nb_bytes.h" | |
7 | #include "tm_byte_positions.h" |
|
7 | #include "tm_byte_positions.h" | |
8 | #include "ccsds_types.h" |
|
8 | #include "ccsds_types.h" | |
9 |
|
9 | |||
10 | #define GRSPW_DEVICE_NAME "/dev/grspw0" |
|
10 | #define GRSPW_DEVICE_NAME "/dev/grspw0" | |
11 | #define UART_DEVICE_NAME "/dev/console" |
|
11 | #define UART_DEVICE_NAME "/dev/console" | |
12 |
|
12 | |||
13 | typedef struct ring_node |
|
13 | typedef struct ring_node | |
14 | { |
|
14 | { | |
15 | struct ring_node *previous; |
|
15 | struct ring_node *previous; | |
16 | int buffer_address; |
|
16 | int buffer_address; | |
17 | struct ring_node *next; |
|
17 | struct ring_node *next; | |
18 | unsigned int status; |
|
18 | unsigned int status; | |
19 | } ring_node; |
|
19 | } ring_node; | |
20 |
|
20 | |||
21 | typedef struct { |
|
21 | typedef struct { | |
22 | // F0 |
|
|||
23 | unsigned int f0; |
|
|||
24 | unsigned int norm_bp1_f0; |
|
|||
25 | unsigned int norm_bp2_f0; |
|
|||
26 | unsigned int norm_asm_f0; |
|
|||
27 | unsigned int sbm_bp1_f0; |
|
|||
28 | unsigned int sbm_bp2_f0; |
|
|||
29 | // F1 |
|
|||
30 | unsigned int f1; |
|
|||
31 | unsigned int norm_bp1_f1; |
|
|||
32 | unsigned int norm_bp2_f1; |
|
|||
33 | unsigned int norm_asm_f1; |
|
|||
34 | unsigned int sbm_bp1_f1; |
|
|||
35 | unsigned int sbm_bp2_f1; |
|
|||
36 | // F2 |
|
|||
37 | unsigned int f2; |
|
|||
38 | unsigned int norm_bp1_f2; |
|
|||
39 | unsigned int norm_bp2_f2; |
|
|||
40 | unsigned int norm_asm_f2; |
|
|||
41 | unsigned int sbm_bp1_f2; |
|
|||
42 | unsigned int sbm_bp2_f2; |
|
|||
43 | } nb_sm_t; |
|
|||
44 |
|
||||
45 | typedef struct { |
|
|||
46 | unsigned int norm_bp1_f0; |
|
22 | unsigned int norm_bp1_f0; | |
47 | unsigned int norm_bp2_f0; |
|
23 | unsigned int norm_bp2_f0; | |
48 | unsigned int norm_asm_f0; |
|
24 | unsigned int norm_asm_f0; | |
49 | unsigned int burst_sbm_bp1_f0; |
|
25 | unsigned int burst_sbm_bp1_f0; | |
50 | unsigned int burst_sbm_bp2_f0; |
|
26 | unsigned int burst_sbm_bp2_f0; | |
51 | unsigned int burst_bp1_f0; |
|
27 | unsigned int burst_bp1_f0; | |
52 | unsigned int burst_bp2_f0; |
|
28 | unsigned int burst_bp2_f0; | |
53 | unsigned int sbm1_bp1_f0; |
|
29 | unsigned int sbm1_bp1_f0; | |
54 | unsigned int sbm1_bp2_f0; |
|
30 | unsigned int sbm1_bp2_f0; | |
55 | unsigned int sbm2_bp1_f0; |
|
31 | unsigned int sbm2_bp1_f0; | |
56 | unsigned int sbm2_bp2_f0; |
|
32 | unsigned int sbm2_bp2_f0; | |
57 | } nb_sm_before_bp_asm_f0; |
|
33 | } nb_sm_before_bp_asm_f0; | |
58 |
|
34 | |||
59 | typedef struct { |
|
35 | typedef struct { | |
60 |
unsigned int norm_bp1 |
|
36 | unsigned int norm_bp1; | |
61 |
unsigned int norm_bp2 |
|
37 | unsigned int norm_bp2; | |
62 |
unsigned int norm_asm |
|
38 | unsigned int norm_asm; | |
63 |
unsigned int burst_sbm_bp1 |
|
39 | unsigned int burst_sbm_bp1; | |
64 |
unsigned int burst_sbm_bp2 |
|
40 | unsigned int burst_sbm_bp2; | |
65 |
unsigned int burst_bp1 |
|
41 | unsigned int burst_bp1; | |
66 |
unsigned int burst_bp2 |
|
42 | unsigned int burst_bp2; | |
67 |
unsigned int sbm2_bp1 |
|
43 | unsigned int sbm2_bp1; | |
68 |
unsigned int sbm2_bp2 |
|
44 | unsigned int sbm2_bp2; | |
69 | } nb_sm_before_bp_asm_f1; |
|
45 | } nb_sm_before_bp_asm_f1; | |
70 |
|
46 | |||
71 | typedef struct { |
|
47 | typedef struct { | |
72 | unsigned int norm_bp1_f2; |
|
48 | unsigned int norm_bp1_f2; | |
73 | unsigned int norm_bp2_f2; |
|
49 | unsigned int norm_bp2_f2; | |
74 | unsigned int norm_asm_f2; |
|
50 | unsigned int norm_asm_f2; | |
75 | unsigned int burst_sbm_bp1_f2; |
|
51 | unsigned int burst_sbm_bp1_f2; | |
76 | unsigned int burst_sbm_bp2_f2; |
|
52 | unsigned int burst_sbm_bp2_f2; | |
77 | unsigned int burst_bp1_f2; |
|
53 | unsigned int burst_bp1_f2; | |
78 | unsigned int burst_bp2_f2; |
|
54 | unsigned int burst_bp2_f2; | |
79 | unsigned int sbm2_bp1_f2; |
|
55 | unsigned int sbm2_bp1_f2; | |
80 | unsigned int sbm2_bp2_f2; |
|
56 | unsigned int sbm2_bp2_f2; | |
81 | } nb_sm_before_bp_asm_f2; |
|
57 | } nb_sm_before_bp_asm_f2; | |
82 |
|
58 | |||
83 | //************************ |
|
59 | //************************ | |
84 | // flight software version |
|
60 | // flight software version | |
85 | // this parameters is handled by the Qt project options |
|
61 | // this parameters is handled by the Qt project options | |
86 |
|
62 | |||
87 | #define NB_PACKETS_PER_GROUP_OF_CWF 8 // 8 packets containing 336 blk |
|
63 | #define NB_PACKETS_PER_GROUP_OF_CWF 8 // 8 packets containing 336 blk | |
88 | #define NB_PACKETS_PER_GROUP_OF_CWF_LIGHT 4 // 4 packets containing 672 blk |
|
64 | #define NB_PACKETS_PER_GROUP_OF_CWF_LIGHT 4 // 4 packets containing 672 blk | |
89 | #define NB_SAMPLES_PER_SNAPSHOT 2688 // 336 * 8 = 672 * 4 = 2688 |
|
65 | #define NB_SAMPLES_PER_SNAPSHOT 2688 // 336 * 8 = 672 * 4 = 2688 | |
90 | #define TIME_OFFSET 2 |
|
66 | #define TIME_OFFSET 2 | |
91 | #define TIME_OFFSET_IN_BYTES 8 |
|
67 | #define TIME_OFFSET_IN_BYTES 8 | |
92 | #define WAVEFORM_EXTENDED_HEADER_OFFSET 22 |
|
68 | #define WAVEFORM_EXTENDED_HEADER_OFFSET 22 | |
93 | #define NB_BYTES_SWF_BLK (2 * 6) |
|
69 | #define NB_BYTES_SWF_BLK (2 * 6) | |
94 | #define NB_WORDS_SWF_BLK 3 |
|
70 | #define NB_WORDS_SWF_BLK 3 | |
95 | #define NB_BYTES_CWF3_LIGHT_BLK 6 |
|
71 | #define NB_BYTES_CWF3_LIGHT_BLK 6 | |
96 | #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8 |
|
72 | #define WFRM_INDEX_OF_LAST_PACKET 6 // waveforms are transmitted in groups of 2048 blocks, 6 packets of 340 and 1 of 8 | |
97 | #define NB_RING_NODES_F0 3 // AT LEAST 3 |
|
73 | #define NB_RING_NODES_F0 3 // AT LEAST 3 | |
98 | #define NB_RING_NODES_F1 5 // AT LEAST 3 |
|
74 | #define NB_RING_NODES_F1 5 // AT LEAST 3 | |
99 | #define NB_RING_NODES_F2 5 // AT LEAST 3 |
|
75 | #define NB_RING_NODES_F2 5 // AT LEAST 3 | |
100 |
|
76 | |||
101 | //********** |
|
77 | //********** | |
102 | // LFR MODES |
|
78 | // LFR MODES | |
103 | #define LFR_MODE_STANDBY 0 |
|
79 | #define LFR_MODE_STANDBY 0 | |
104 | #define LFR_MODE_NORMAL 1 |
|
80 | #define LFR_MODE_NORMAL 1 | |
105 | #define LFR_MODE_BURST 2 |
|
81 | #define LFR_MODE_BURST 2 | |
106 | #define LFR_MODE_SBM1 3 |
|
82 | #define LFR_MODE_SBM1 3 | |
107 | #define LFR_MODE_SBM2 4 |
|
83 | #define LFR_MODE_SBM2 4 | |
108 |
|
84 | |||
109 | #define TDS_MODE_LFM 5 |
|
85 | #define TDS_MODE_LFM 5 | |
110 | #define TDS_MODE_STANDBY 0 |
|
86 | #define TDS_MODE_STANDBY 0 | |
111 | #define TDS_MODE_NORMAL 1 |
|
87 | #define TDS_MODE_NORMAL 1 | |
112 | #define TDS_MODE_BURST 2 |
|
88 | #define TDS_MODE_BURST 2 | |
113 | #define TDS_MODE_SBM1 3 |
|
89 | #define TDS_MODE_SBM1 3 | |
114 | #define TDS_MODE_SBM2 4 |
|
90 | #define TDS_MODE_SBM2 4 | |
115 |
|
91 | |||
116 | #define THR_MODE_STANDBY 0 |
|
92 | #define THR_MODE_STANDBY 0 | |
117 | #define THR_MODE_NORMAL 1 |
|
93 | #define THR_MODE_NORMAL 1 | |
118 | #define THR_MODE_BURST 2 |
|
94 | #define THR_MODE_BURST 2 | |
119 |
|
95 | |||
120 | #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0 |
|
96 | #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0 | |
121 | #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1 |
|
97 | #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1 | |
122 | #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2 |
|
98 | #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2 | |
123 | #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3 |
|
99 | #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3 | |
124 | #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4 |
|
100 | #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4 | |
125 | #define RTEMS_EVENT_MODE_SBM2_WFRM RTEMS_EVENT_5 |
|
101 | #define RTEMS_EVENT_MODE_SBM2_WFRM RTEMS_EVENT_5 | |
126 | #define RTEMS_EVENT_NORM_BP1_F0 RTEMS_EVENT_6 |
|
102 | #define RTEMS_EVENT_NORM_BP1_F0 RTEMS_EVENT_6 | |
127 | #define RTEMS_EVENT_NORM_BP2_F0 RTEMS_EVENT_7 |
|
103 | #define RTEMS_EVENT_NORM_BP2_F0 RTEMS_EVENT_7 | |
128 | #define RTEMS_EVENT_NORM_ASM_F0 RTEMS_EVENT_8 |
|
104 | #define RTEMS_EVENT_NORM_ASM_F0 RTEMS_EVENT_8 | |
129 | #define RTEMS_EVENT_NORM_BP1_F1 RTEMS_EVENT_9 |
|
105 | #define RTEMS_EVENT_NORM_BP1_F1 RTEMS_EVENT_9 | |
130 | #define RTEMS_EVENT_NORM_BP2_F1 RTEMS_EVENT_10 |
|
106 | #define RTEMS_EVENT_NORM_BP2_F1 RTEMS_EVENT_10 | |
131 | #define RTEMS_EVENT_NORM_ASM_F1 RTEMS_EVENT_11 |
|
107 | #define RTEMS_EVENT_NORM_ASM_F1 RTEMS_EVENT_11 | |
132 | #define RTEMS_EVENT_NORM_BP1_F2 RTEMS_EVENT_12 |
|
108 | #define RTEMS_EVENT_NORM_BP1_F2 RTEMS_EVENT_12 | |
133 | #define RTEMS_EVENT_NORM_BP2_F2 RTEMS_EVENT_13 |
|
109 | #define RTEMS_EVENT_NORM_BP2_F2 RTEMS_EVENT_13 | |
134 | #define RTEMS_EVENT_NORM_ASM_F2 RTEMS_EVENT_14 |
|
110 | #define RTEMS_EVENT_NORM_ASM_F2 RTEMS_EVENT_14 | |
135 | #define RTEMS_EVENT_BURST_SBM_BP1_F0 RTEMS_EVENT_15 |
|
111 | #define RTEMS_EVENT_BURST_SBM_BP1_F0 RTEMS_EVENT_15 | |
136 | #define RTEMS_EVENT_BURST_SBM_BP2_F0 RTEMS_EVENT_16 |
|
112 | #define RTEMS_EVENT_BURST_SBM_BP2_F0 RTEMS_EVENT_16 | |
137 | #define RTEMS_EVENT_BURST_SBM_BP1_F1 RTEMS_EVENT_17 |
|
113 | #define RTEMS_EVENT_BURST_SBM_BP1_F1 RTEMS_EVENT_17 | |
138 | #define RTEMS_EVENT_BURST_SBM_BP2_F1 RTEMS_EVENT_18 |
|
114 | #define RTEMS_EVENT_BURST_SBM_BP2_F1 RTEMS_EVENT_18 | |
139 | #define RTEMS_EVENT_BURST_SBM_BP1_F2 RTEMS_EVENT_19 |
|
115 | #define RTEMS_EVENT_BURST_SBM_BP1_F2 RTEMS_EVENT_19 | |
140 | #define RTEMS_EVENT_BURST_SBM_BP2_F2 RTEMS_EVENT_20 |
|
116 | #define RTEMS_EVENT_BURST_SBM_BP2_F2 RTEMS_EVENT_20 | |
141 |
|
117 | |||
142 | //**************************** |
|
118 | //**************************** | |
143 | // LFR DEFAULT MODE PARAMETERS |
|
119 | // LFR DEFAULT MODE PARAMETERS | |
144 | // COMMON |
|
120 | // COMMON | |
145 | #define DEFAULT_SY_LFR_COMMON0 0x00 |
|
121 | #define DEFAULT_SY_LFR_COMMON0 0x00 | |
146 | #define DEFAULT_SY_LFR_COMMON1 0x10 // default value 0 0 0 1 0 0 0 0 |
|
122 | #define DEFAULT_SY_LFR_COMMON1 0x10 // default value 0 0 0 1 0 0 0 0 | |
147 | // NORM |
|
123 | // NORM | |
148 | #define SY_LFR_N_SWF_L 2048 // nb sample |
|
124 | #define SY_LFR_N_SWF_L 2048 // nb sample | |
149 | #define SY_LFR_N_SWF_P 300 // sec |
|
125 | #define SY_LFR_N_SWF_P 300 // sec | |
150 | #define SY_LFR_N_ASM_P 3600 // sec |
|
126 | #define SY_LFR_N_ASM_P 3600 // sec | |
151 | #define SY_LFR_N_BP_P0 4 // sec |
|
127 | #define SY_LFR_N_BP_P0 4 // sec | |
152 | #define SY_LFR_N_BP_P1 20 // sec |
|
128 | #define SY_LFR_N_BP_P1 20 // sec | |
153 | #define SY_LFR_N_CWF_LONG_F3 0 // 0 => production of light continuous waveforms at f3 |
|
129 | #define SY_LFR_N_CWF_LONG_F3 0 // 0 => production of light continuous waveforms at f3 | |
154 | #define MIN_DELTA_SNAPSHOT 16 // sec |
|
130 | #define MIN_DELTA_SNAPSHOT 16 // sec | |
155 | // BURST |
|
131 | // BURST | |
156 | #define DEFAULT_SY_LFR_B_BP_P0 1 // sec |
|
132 | #define DEFAULT_SY_LFR_B_BP_P0 1 // sec | |
157 | #define DEFAULT_SY_LFR_B_BP_P1 5 // sec |
|
133 | #define DEFAULT_SY_LFR_B_BP_P1 5 // sec | |
158 | // SBM1 |
|
134 | // SBM1 | |
159 | #define DEFAULT_SY_LFR_S1_BP_P0 1 // sec |
|
135 | #define DEFAULT_SY_LFR_S1_BP_P0 1 // sec | |
160 | #define DEFAULT_SY_LFR_S1_BP_P1 1 // sec |
|
136 | #define DEFAULT_SY_LFR_S1_BP_P1 1 // sec | |
161 | // SBM2 |
|
137 | // SBM2 | |
162 | #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec |
|
138 | #define DEFAULT_SY_LFR_S2_BP_P0 1 // sec | |
163 | #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec |
|
139 | #define DEFAULT_SY_LFR_S2_BP_P1 5 // sec | |
164 | // ADDITIONAL PARAMETERS |
|
140 | // ADDITIONAL PARAMETERS | |
165 | #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms |
|
141 | #define TIME_BETWEEN_TWO_SWF_PACKETS 30 // nb x 10 ms => 300 ms | |
166 | #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s |
|
142 | #define TIME_BETWEEN_TWO_CWF3_PACKETS 1000 // nb x 10 ms => 10 s | |
167 | // STATUS WORD |
|
143 | // STATUS WORD | |
168 | #define DEFAULT_STATUS_WORD_BYTE0 0x0d // [0000] [1] [101] mode 4 bits / SPW enabled 1 bit / state is run 3 bits |
|
144 | #define DEFAULT_STATUS_WORD_BYTE0 0x0d // [0000] [1] [101] mode 4 bits / SPW enabled 1 bit / state is run 3 bits | |
169 | #define DEFAULT_STATUS_WORD_BYTE1 0x00 |
|
145 | #define DEFAULT_STATUS_WORD_BYTE1 0x00 | |
170 | // |
|
146 | // | |
171 | #define SY_LFR_DPU_CONNECT_TIMEOUT 100 // 100 * 10 ms = 1 s |
|
147 | #define SY_LFR_DPU_CONNECT_TIMEOUT 100 // 100 * 10 ms = 1 s | |
172 | #define SY_LFR_DPU_CONNECT_ATTEMPT 3 |
|
148 | #define SY_LFR_DPU_CONNECT_ATTEMPT 3 | |
173 | //**************************** |
|
149 | //**************************** | |
174 |
|
150 | |||
175 | //***************************** |
|
151 | //***************************** | |
176 | // APB REGISTERS BASE ADDRESSES |
|
152 | // APB REGISTERS BASE ADDRESSES | |
177 | #define REGS_ADDR_APBUART 0x80000100 |
|
153 | #define REGS_ADDR_APBUART 0x80000100 | |
178 | #define REGS_ADDR_GPTIMER 0x80000300 |
|
154 | #define REGS_ADDR_GPTIMER 0x80000300 | |
179 | #define REGS_ADDR_GRSPW 0x80000500 |
|
155 | #define REGS_ADDR_GRSPW 0x80000500 | |
180 | #define REGS_ADDR_TIME_MANAGEMENT 0x80000600 |
|
156 | #define REGS_ADDR_TIME_MANAGEMENT 0x80000600 | |
181 | #define REGS_ADDR_GRGPIO 0x80000b00 |
|
157 | #define REGS_ADDR_GRGPIO 0x80000b00 | |
182 |
|
158 | |||
183 | #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00 |
|
159 | #define REGS_ADDR_SPECTRAL_MATRIX 0x80000f00 | |
184 | #define REGS_ADDR_WAVEFORM_PICKER 0x80000f40 |
|
160 | #define REGS_ADDR_WAVEFORM_PICKER 0x80000f40 | |
185 |
|
161 | |||
186 | #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff |
|
162 | #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff | |
187 | #define APBUART_CTRL_REG_MASK_TE 0x00000002 |
|
163 | #define APBUART_CTRL_REG_MASK_TE 0x00000002 | |
188 | #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 (0x50) |
|
164 | #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 (0x50) | |
189 |
|
165 | |||
190 | //********** |
|
166 | //********** | |
191 | // IRQ LINES |
|
167 | // IRQ LINES | |
192 | #define IRQ_SM_SIMULATOR 9 |
|
168 | #define IRQ_SM_SIMULATOR 9 | |
193 | #define IRQ_SPARC_SM_SIMULATOR 0x19 // see sparcv8.pdf p.76 for interrupt levels |
|
169 | #define IRQ_SPARC_SM_SIMULATOR 0x19 // see sparcv8.pdf p.76 for interrupt levels | |
194 | #define IRQ_WAVEFORM_PICKER 14 |
|
170 | #define IRQ_WAVEFORM_PICKER 14 | |
195 | #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels |
|
171 | #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels | |
196 | #define IRQ_SPECTRAL_MATRIX 6 |
|
172 | #define IRQ_SPECTRAL_MATRIX 6 | |
197 | #define IRQ_SPARC_SPECTRAL_MATRIX 0x16 // see sparcv8.pdf p.76 for interrupt levels |
|
173 | #define IRQ_SPARC_SPECTRAL_MATRIX 0x16 // see sparcv8.pdf p.76 for interrupt levels | |
198 |
|
174 | |||
199 | //***** |
|
175 | //***** | |
200 | // TIME |
|
176 | // TIME | |
201 | #define CLKDIV_SM_SIMULATOR (10416 - 1) // 10 ms => nominal is 1/96 = 0.010416667, 10417 - 1 = 10416 |
|
177 | #define CLKDIV_SM_SIMULATOR (10416 - 1) // 10 ms => nominal is 1/96 = 0.010416667, 10417 - 1 = 10416 | |
202 | #define TIMER_SM_SIMULATOR 1 |
|
178 | #define TIMER_SM_SIMULATOR 1 | |
203 | #define HK_PERIOD 100 // 100 * 10ms => 1s |
|
179 | #define HK_PERIOD 100 // 100 * 10ms => 1s | |
204 | #define SY_LFR_TIME_SYN_TIMEOUT_in_ms 2000 |
|
180 | #define SY_LFR_TIME_SYN_TIMEOUT_in_ms 2000 | |
205 | #define SY_LFR_TIME_SYN_TIMEOUT_in_ticks 200 // 200 * 10 ms = 2 s |
|
181 | #define SY_LFR_TIME_SYN_TIMEOUT_in_ticks 200 // 200 * 10 ms = 2 s | |
206 |
|
182 | |||
207 | //********** |
|
183 | //********** | |
208 | // LPP CODES |
|
184 | // LPP CODES | |
209 | #define LFR_SUCCESSFUL 0 |
|
185 | #define LFR_SUCCESSFUL 0 | |
210 | #define LFR_DEFAULT 1 |
|
186 | #define LFR_DEFAULT 1 | |
211 | #define LFR_EXE_ERROR 2 |
|
187 | #define LFR_EXE_ERROR 2 | |
212 |
|
188 | |||
213 | //****** |
|
189 | //****** | |
214 | // RTEMS |
|
190 | // RTEMS | |
215 | #define TASKID_RECV 1 |
|
191 | #define TASKID_RECV 1 | |
216 | #define TASKID_ACTN 2 |
|
192 | #define TASKID_ACTN 2 | |
217 | #define TASKID_SPIQ 3 |
|
193 | #define TASKID_SPIQ 3 | |
218 |
#define TASKID_S |
|
194 | #define TASKID_STAT 4 | |
219 |
#define TASKID_ |
|
195 | #define TASKID_AVF0 5 | |
220 |
#define TASKID_ |
|
196 | #define TASKID_SWBD 6 | |
221 |
#define TASKID_ |
|
197 | #define TASKID_WFRM 7 | |
222 |
#define TASKID_ |
|
198 | #define TASKID_DUMB 8 | |
223 |
#define TASKID_ |
|
199 | #define TASKID_HOUS 9 | |
224 |
#define TASKID_ |
|
200 | #define TASKID_PRC0 10 | |
225 |
#define TASKID_ |
|
201 | #define TASKID_CWF3 11 | |
226 |
#define TASKID_CWF |
|
202 | #define TASKID_CWF2 12 | |
227 |
#define TASKID_CWF |
|
203 | #define TASKID_CWF1 13 | |
228 |
#define TASKID_ |
|
204 | #define TASKID_SEND 14 | |
229 |
#define TASKID_ |
|
205 | #define TASKID_WTDG 15 | |
230 |
#define TASKID_ |
|
206 | #define TASKID_AVF1 16 | |
|
207 | #define TASKID_PRC1 17 | |||
231 |
|
208 | |||
232 | #define TASK_PRIORITY_SPIQ 5 |
|
209 | #define TASK_PRIORITY_SPIQ 5 | |
233 | #define TASK_PRIORITY_SMIQ 10 |
|
210 | //#define TASK_PRIORITY_SMIQ 10 | |
234 | #define TASK_PRIORITY_WTDG 20 |
|
211 | #define TASK_PRIORITY_WTDG 20 | |
235 | #define TASK_PRIORITY_HOUS 30 |
|
212 | #define TASK_PRIORITY_HOUS 30 | |
236 | #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together |
|
213 | #define TASK_PRIORITY_CWF1 35 // CWF1 and CWF2 are never running together | |
237 | #define TASK_PRIORITY_CWF2 35 // |
|
214 | #define TASK_PRIORITY_CWF2 35 // | |
238 | #define TASK_PRIORITY_SWBD 37 // SWBD has a lower priority than WFRM, this is to extract the snapshot before sending it |
|
215 | #define TASK_PRIORITY_SWBD 37 // SWBD has a lower priority than WFRM, this is to extract the snapshot before sending it | |
239 | #define TASK_PRIORITY_WFRM 40 |
|
216 | #define TASK_PRIORITY_WFRM 40 | |
240 | #define TASK_PRIORITY_CWF3 40 // there is a printf in this function, be careful with its priority wrt CWF1 |
|
217 | #define TASK_PRIORITY_CWF3 40 // there is a printf in this function, be careful with its priority wrt CWF1 | |
241 | #define TASK_PRIORITY_SEND 45 |
|
218 | #define TASK_PRIORITY_SEND 45 | |
242 | #define TASK_PRIORITY_RECV 50 |
|
219 | #define TASK_PRIORITY_RECV 50 | |
243 | #define TASK_PRIORITY_ACTN 50 |
|
220 | #define TASK_PRIORITY_ACTN 50 | |
244 | #define TASK_PRIORITY_AVF0 60 |
|
221 | #define TASK_PRIORITY_AVF0 60 | |
245 | #define TASK_PRIORITY_BPF0 60 |
|
|||
246 | #define TASK_PRIORITY_PRC0 100 |
|
222 | #define TASK_PRIORITY_PRC0 100 | |
|
223 | #define TASK_PRIORITY_PRC1 100 | |||
|
224 | #define TASK_PRIORITY_AVF1 60 | |||
247 | #define TASK_PRIORITY_STAT 200 |
|
225 | #define TASK_PRIORITY_STAT 200 | |
248 | #define TASK_PRIORITY_DUMB 200 |
|
226 | #define TASK_PRIORITY_DUMB 200 | |
249 |
|
227 | |||
250 | #define MSG_QUEUE_COUNT_RECV 10 |
|
228 | #define MSG_QUEUE_COUNT_RECV 10 | |
251 | #define MSG_QUEUE_COUNT_SEND 50 |
|
229 | #define MSG_QUEUE_COUNT_SEND 50 | |
252 | #define MSG_QUEUE_COUNT_PRC0 10 |
|
230 | #define MSG_QUEUE_COUNT_PRC0 10 | |
253 | #define MSG_QUEUE_COUNT_PRC1 10 |
|
231 | #define MSG_QUEUE_COUNT_PRC1 10 | |
254 | //#define MSG_QUEUE_SIZE_SEND (PACKET_LENGTH_HK + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES) |
|
|||
255 | #define MSG_QUEUE_SIZE_SEND 810 // 806 + 4 => TM_LFR_SCIENCE_BURST_BP2_F1 |
|
232 | #define MSG_QUEUE_SIZE_SEND 810 // 806 + 4 => TM_LFR_SCIENCE_BURST_BP2_F1 | |
256 | #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options |
|
233 | #define ACTION_MSG_SPW_IOCTL_SEND_SIZE 24 // hlen *hdr dlen *data sent options | |
257 | #define MSG_QUEUE_SIZE_PRC0 20 // two pointers and one rtems_event + 2 integers |
|
234 | #define MSG_QUEUE_SIZE_PRC0 20 // two pointers and one rtems_event + 2 integers | |
258 | #define MSG_QUEUE_SIZE_PRC1 20 // two pointers and one rtems_event + 2 integers |
|
235 | #define MSG_QUEUE_SIZE_PRC1 20 // two pointers and one rtems_event + 2 integers | |
259 |
|
236 | |||
260 | #define QUEUE_RECV 0 |
|
237 | #define QUEUE_RECV 0 | |
261 | #define QUEUE_SEND 1 |
|
238 | #define QUEUE_SEND 1 | |
262 | #define QUEUE_PRC0 2 |
|
239 | #define QUEUE_PRC0 2 | |
263 | #define QUEUE_PRC1 3 |
|
240 | #define QUEUE_PRC1 3 | |
264 |
|
241 | |||
265 | //******* |
|
242 | //******* | |
266 | // MACROS |
|
243 | // MACROS | |
267 | #ifdef PRINT_MESSAGES_ON_CONSOLE |
|
244 | #ifdef PRINT_MESSAGES_ON_CONSOLE | |
268 | #define PRINTF(x) printf(x); |
|
245 | #define PRINTF(x) printf(x); | |
269 | #define PRINTF1(x,y) printf(x,y); |
|
246 | #define PRINTF1(x,y) printf(x,y); | |
270 | #define PRINTF2(x,y,z) printf(x,y,z); |
|
247 | #define PRINTF2(x,y,z) printf(x,y,z); | |
271 | #else |
|
248 | #else | |
272 | #define PRINTF(x) ; |
|
249 | #define PRINTF(x) ; | |
273 | #define PRINTF1(x,y) ; |
|
250 | #define PRINTF1(x,y) ; | |
274 | #define PRINTF2(x,y,z) ; |
|
251 | #define PRINTF2(x,y,z) ; | |
275 | #endif |
|
252 | #endif | |
276 |
|
253 | |||
277 | #ifdef BOOT_MESSAGES |
|
254 | #ifdef BOOT_MESSAGES | |
278 | #define BOOT_PRINTF(x) printf(x); |
|
255 | #define BOOT_PRINTF(x) printf(x); | |
279 | #define BOOT_PRINTF1(x,y) printf(x,y); |
|
256 | #define BOOT_PRINTF1(x,y) printf(x,y); | |
280 | #define BOOT_PRINTF2(x,y,z) printf(x,y,z); |
|
257 | #define BOOT_PRINTF2(x,y,z) printf(x,y,z); | |
281 | #else |
|
258 | #else | |
282 | #define BOOT_PRINTF(x) ; |
|
259 | #define BOOT_PRINTF(x) ; | |
283 | #define BOOT_PRINTF1(x,y) ; |
|
260 | #define BOOT_PRINTF1(x,y) ; | |
284 | #define BOOT_PRINTF2(x,y,z) ; |
|
261 | #define BOOT_PRINTF2(x,y,z) ; | |
285 | #endif |
|
262 | #endif | |
286 |
|
263 | |||
287 | #ifdef DEBUG_MESSAGES |
|
264 | #ifdef DEBUG_MESSAGES | |
288 | #define DEBUG_PRINTF(x) printf(x); |
|
265 | #define DEBUG_PRINTF(x) printf(x); | |
289 | #define DEBUG_PRINTF1(x,y) printf(x,y); |
|
266 | #define DEBUG_PRINTF1(x,y) printf(x,y); | |
290 | #define DEBUG_PRINTF2(x,y,z) printf(x,y,z); |
|
267 | #define DEBUG_PRINTF2(x,y,z) printf(x,y,z); | |
291 | #else |
|
268 | #else | |
292 | #define DEBUG_PRINTF(x) ; |
|
269 | #define DEBUG_PRINTF(x) ; | |
293 | #define DEBUG_PRINTF1(x,y) ; |
|
270 | #define DEBUG_PRINTF1(x,y) ; | |
294 | #define DEBUG_PRINTF2(x,y,z) ; |
|
271 | #define DEBUG_PRINTF2(x,y,z) ; | |
295 | #endif |
|
272 | #endif | |
296 |
|
273 | |||
297 | #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period |
|
274 | #define CPU_USAGE_REPORT_PERIOD 6 // * 10 s = period | |
298 |
|
275 | |||
299 | struct param_local_str{ |
|
276 | struct param_local_str{ | |
300 | unsigned int local_sbm1_nb_cwf_sent; |
|
277 | unsigned int local_sbm1_nb_cwf_sent; | |
301 | unsigned int local_sbm1_nb_cwf_max; |
|
278 | unsigned int local_sbm1_nb_cwf_max; | |
302 | unsigned int local_sbm2_nb_cwf_sent; |
|
279 | unsigned int local_sbm2_nb_cwf_sent; | |
303 | unsigned int local_sbm2_nb_cwf_max; |
|
280 | unsigned int local_sbm2_nb_cwf_max; | |
304 | unsigned int local_nb_interrupt_f0_MAX; |
|
281 | unsigned int local_nb_interrupt_f0_MAX; | |
305 | }; |
|
282 | }; | |
306 |
|
283 | |||
307 | #endif // FSW_PARAMS_H_INCLUDED |
|
284 | #endif // FSW_PARAMS_H_INCLUDED |
@@ -1,68 +1,73 | |||||
1 | #ifndef FSW_PARAMS_PROCESSING_H |
|
1 | #ifndef FSW_PARAMS_PROCESSING_H | |
2 | #define FSW_PARAMS_PROCESSING_H |
|
2 | #define FSW_PARAMS_PROCESSING_H | |
3 |
|
3 | |||
4 | #define NB_BINS_PER_SM 128 |
|
4 | #define NB_BINS_PER_SM 128 | |
5 | #define NB_VALUES_PER_SM 25 |
|
5 | #define NB_VALUES_PER_SM 25 | |
6 | #define TOTAL_SIZE_SM 3200 // 25 * 128 |
|
6 | #define TOTAL_SIZE_SM 3200 // 25 * 128 | |
7 | #define TOTAL_SIZE_NORM_BP1_F0 99 // 11 * 9 = 99 |
|
7 | #define TOTAL_SIZE_NORM_BP1_F0 99 // 11 * 9 = 99 | |
8 | #define TOTAL_SIZE_NORM_BP1_F1 117 // 13 * 9 = 117 |
|
8 | #define TOTAL_SIZE_NORM_BP1_F1 117 // 13 * 9 = 117 | |
9 | #define TOTAL_SIZE_NORM_BP1_F2 108 // 12 * 9 = 108 |
|
9 | #define TOTAL_SIZE_NORM_BP1_F2 108 // 12 * 9 = 108 | |
10 | #define TOTAL_SIZE_SBM1_BP1_F0 198 // 22 * 9 = 198 |
|
10 | #define TOTAL_SIZE_SBM1_BP1_F0 198 // 22 * 9 = 198 | |
11 | // |
|
11 | // | |
12 | #define NB_RING_NODES_SM_F0 12 // AT LEAST 3 |
|
12 | #define NB_RING_NODES_SM_F0 12 // AT LEAST 3 | |
|
13 | #define NB_RING_NODES_ASM_BURST_SBM_F0 10 // AT LEAST 3 | |||
|
14 | #define NB_RING_NODES_ASM_NORM_F0 10 // AT LEAST 3 | |||
13 | #define NB_RING_NODES_SM_F1 3 // AT LEAST 3 |
|
15 | #define NB_RING_NODES_SM_F1 3 // AT LEAST 3 | |
|
16 | #define NB_RING_NODES_ASM_BURST_SBM_F1 5 // AT LEAST 3 | |||
|
17 | #define NB_RING_NODES_ASM_NORM_F1 5 // AT LEAST 3 | |||
14 | #define NB_RING_NODES_SM_F2 3 // AT LEAST 3 |
|
18 | #define NB_RING_NODES_SM_F2 3 // AT LEAST 3 | |
15 | #define NB_RING_NODES_ASM_BURST_SBM_F0 10 // AT LEAST 3 |
|
|||
16 | #define NB_RING_NODES_ASM_NORM_F0 10 // AT LEAST 3 |
|
|||
17 | // |
|
19 | // | |
18 | #define NB_BINS_PER_ASM_F0 88 |
|
20 | #define NB_BINS_PER_ASM_F0 88 | |
19 | #define NB_BINS_PER_PKT_ASM_F0 44 |
|
21 | #define NB_BINS_PER_PKT_ASM_F0 44 | |
20 | #define TOTAL_SIZE_ASM_F0_IN_BYTES 4400 // 25 * 88 * 2 |
|
22 | #define TOTAL_SIZE_ASM_F0_IN_BYTES 4400 // 25 * 88 * 2 | |
21 | #define ASM_F0_INDICE_START 17 // 88 bins |
|
23 | #define ASM_F0_INDICE_START 17 // 88 bins | |
22 | #define ASM_F0_INDICE_STOP 104 // 2 packets of 44 bins |
|
24 | #define ASM_F0_INDICE_STOP 104 // 2 packets of 44 bins | |
23 | // |
|
25 | // | |
24 | #define NB_BINS_PER_ASM_F1 104 |
|
26 | #define NB_BINS_PER_ASM_F1 104 | |
25 | #define NB_BINS_PER_PKT_ASM_F1 52 |
|
27 | #define NB_BINS_PER_PKT_ASM_F1 52 | |
26 | #define TOTAL_SIZE_ASM_F1 2600 // 25 * 104 |
|
28 | #define TOTAL_SIZE_ASM_F1 2600 // 25 * 104 | |
27 | #define ASM_F1_INDICE_START 6 // 104 bins |
|
29 | #define ASM_F1_INDICE_START 6 // 104 bins | |
28 | #define ASM_F1_INDICE_STOP 109 // 2 packets of 52 bins |
|
30 | #define ASM_F1_INDICE_STOP 109 // 2 packets of 52 bins | |
29 | // |
|
31 | // | |
30 | #define NB_BINS_PER_ASM_F2 96 |
|
32 | #define NB_BINS_PER_ASM_F2 96 | |
31 | #define NB_BINS_PER_PKT_ASM_F2 48 |
|
33 | #define NB_BINS_PER_PKT_ASM_F2 48 | |
32 | #define TOTAL_SIZE_ASM_F2 2400 // 25 * 96 |
|
34 | #define TOTAL_SIZE_ASM_F2 2400 // 25 * 96 | |
33 | #define ASM_F2_INDICE_START 7 // 96 bins |
|
35 | #define ASM_F2_INDICE_START 7 // 96 bins | |
34 | #define ASM_F2_INDICE_STOP 102 // 2 packets of 48 bins |
|
36 | #define ASM_F2_INDICE_STOP 102 // 2 packets of 48 bins | |
35 | // |
|
37 | // | |
36 | #define NB_BINS_COMPRESSED_SM_F0 11 |
|
38 | #define NB_BINS_COMPRESSED_SM_F0 11 | |
37 | #define NB_BINS_COMPRESSED_SM_F1 13 |
|
39 | #define NB_BINS_COMPRESSED_SM_F1 13 | |
38 | #define NB_BINS_COMPRESSED_SM_F2 12 |
|
40 | #define NB_BINS_COMPRESSED_SM_F2 12 | |
39 | #define NB_BINS_COMPRESSED_SM_SBM_F0 22 |
|
41 | #define NB_BINS_COMPRESSED_SM_SBM_F0 22 | |
40 |
|
42 | #define NB_BINS_COMPRESSED_SM_SBM_F1 26 | ||
|
43 | #define NB_BINS_COMPRESSED_SM_SBM_F2 24 | |||
41 | // |
|
44 | // | |
42 | #define NB_BINS_TO_AVERAGE_ASM_F0 8 |
|
45 | #define NB_BINS_TO_AVERAGE_ASM_F0 8 | |
43 | #define NB_BINS_TO_AVERAGE_ASM_F1 8 |
|
46 | #define NB_BINS_TO_AVERAGE_ASM_F1 8 | |
44 | #define NB_BINS_TO_AVERAGE_ASM_F2 8 |
|
47 | #define NB_BINS_TO_AVERAGE_ASM_F2 8 | |
45 | #define NB_BINS_TO_AVERAGE_ASM_SBM_F0 4 |
|
48 | #define NB_BINS_TO_AVERAGE_ASM_SBM_F0 4 | |
|
49 | #define NB_BINS_TO_AVERAGE_ASM_SBM_F1 4 | |||
|
50 | #define NB_BINS_TO_AVERAGE_ASM_SBM_F2 4 | |||
46 | // |
|
51 | // | |
47 | #define TOTAL_SIZE_COMPRESSED_ASM_F0 275 // 11 * 25 WORDS |
|
52 | #define TOTAL_SIZE_COMPRESSED_ASM_F0 275 // 11 * 25 WORDS | |
48 | #define TOTAL_SIZE_COMPRESSED_ASM_F1 325 // 13 * 25 WORDS |
|
53 | #define TOTAL_SIZE_COMPRESSED_ASM_F1 325 // 13 * 25 WORDS | |
49 | #define TOTAL_SIZE_COMPRESSED_ASM_F2 300 // 12 * 25 WORDS |
|
54 | #define TOTAL_SIZE_COMPRESSED_ASM_F2 300 // 12 * 25 WORDS | |
50 | #define TOTAL_SIZE_COMPRESSED_ASM_SBM1 550 // 22 * 25 WORDS |
|
55 | #define TOTAL_SIZE_COMPRESSED_ASM_SBM1 550 // 22 * 25 WORDS | |
51 | // NORM |
|
56 | // NORM | |
52 | #define NB_SM_BEFORE_NORM_BP1_F0 384 // 96 * 4 |
|
57 | #define NB_SM_BEFORE_NORM_BP1_F0 384 // 96 * 4 | |
53 | #define NB_SM_BEFORE_NORM_BP2_F0 1920 // 96 * 20 |
|
58 | #define NB_SM_BEFORE_NORM_BP2_F0 1920 // 96 * 20 | |
54 | #define NB_SM_BEFORE_NORM_ASM_F0 384 // 384 matrices at f0 = 4.00 second |
|
59 | #define NB_SM_BEFORE_NORM_ASM_F0 384 // 384 matrices at f0 = 4.00 second | |
55 | // BURST |
|
60 | // BURST | |
56 | #define NB_SM_BEFORE_BURST_BP1_F0 96 // 96 matrices at f0 = 1.00 second |
|
61 | #define NB_SM_BEFORE_BURST_BP1_F0 96 // 96 matrices at f0 = 1.00 second | |
57 | #define NB_SM_BEFORE_BURST_BP2_F0 480 // 480 matrices at f0 = 5.00 second |
|
62 | #define NB_SM_BEFORE_BURST_BP2_F0 480 // 480 matrices at f0 = 5.00 second | |
58 | // SBM1 |
|
63 | // SBM1 | |
59 | #define NB_SM_BEFORE_SBM1_BP1_F0 24 // 24 matrices at f0 = 0.25 second |
|
64 | #define NB_SM_BEFORE_SBM1_BP1_F0 24 // 24 matrices at f0 = 0.25 second | |
60 | #define NB_SM_BEFORE_SBM1_BP2_F0 96 // 96 matrices at f0 = 1.00 second |
|
65 | #define NB_SM_BEFORE_SBM1_BP2_F0 96 // 96 matrices at f0 = 1.00 second | |
61 | // SBM2 |
|
66 | // SBM2 | |
62 | #define NB_SM_BEFORE_SBM2_BP1_F0 96 // 96 matrices at f0 = 1.00 second |
|
67 | #define NB_SM_BEFORE_SBM2_BP1_F0 96 // 96 matrices at f0 = 1.00 second | |
63 | #define NB_SM_BEFORE_SBM2_BP2_F0 480 // 480 matrices at f0 = 5.00 second |
|
68 | #define NB_SM_BEFORE_SBM2_BP2_F0 480 // 480 matrices at f0 = 5.00 second | |
64 | // GENERAL |
|
69 | // GENERAL | |
65 | #define NB_SM_BEFORE_AVF0 8 |
|
70 | #define NB_SM_BEFORE_AVF0 8 | |
66 | #define NB_SM_BEFORE_AVF1 8 |
|
71 | #define NB_SM_BEFORE_AVF1 8 | |
67 |
|
72 | |||
68 | #endif // FSW_PARAMS_PROCESSING_H |
|
73 | #endif // FSW_PARAMS_PROCESSING_H |
@@ -1,123 +1,123 | |||||
1 | #ifndef FSW_PROCESSING_H_INCLUDED |
|
1 | #ifndef FSW_PROCESSING_H_INCLUDED | |
2 | #define FSW_PROCESSING_H_INCLUDED |
|
2 | #define FSW_PROCESSING_H_INCLUDED | |
3 |
|
3 | |||
4 | #include <rtems.h> |
|
4 | #include <rtems.h> | |
5 | #include <grspw.h> |
|
5 | #include <grspw.h> | |
6 | #include <math.h> |
|
6 | #include <math.h> | |
7 | #include <stdlib.h> // abs() is in the stdlib |
|
7 | #include <stdlib.h> // abs() is in the stdlib | |
8 | #include <stdio.h> // printf() |
|
8 | #include <stdio.h> // printf() | |
9 | #include <math.h> |
|
9 | #include <math.h> | |
10 |
|
10 | |||
11 | #include "fsw_params.h" |
|
11 | #include "fsw_params.h" | |
12 | #include "fsw_spacewire.h" |
|
12 | #include "fsw_spacewire.h" | |
13 |
|
13 | |||
14 | typedef struct ring_node_sm |
|
14 | typedef struct ring_node_sm | |
15 | { |
|
15 | { | |
16 | struct ring_node_sm *previous; |
|
16 | struct ring_node_sm *previous; | |
17 | struct ring_node_sm *next; |
|
17 | struct ring_node_sm *next; | |
18 | int buffer_address; |
|
18 | int buffer_address; | |
19 | unsigned int status; |
|
19 | unsigned int status; | |
20 | unsigned int coarseTime; |
|
20 | unsigned int coarseTime; | |
21 | unsigned int fineTime; |
|
21 | unsigned int fineTime; | |
22 | } ring_node_sm; |
|
22 | } ring_node_sm; | |
23 |
|
23 | |||
24 | typedef struct ring_node_asm |
|
24 | typedef struct ring_node_asm | |
25 | { |
|
25 | { | |
26 | struct ring_node_asm *previous; |
|
|||
27 | struct ring_node_asm *next; |
|
26 | struct ring_node_asm *next; | |
28 | float matrix[ TOTAL_SIZE_SM ]; |
|
27 | float matrix[ TOTAL_SIZE_SM ]; | |
29 | unsigned int status; |
|
28 | unsigned int status; | |
30 | } ring_node_asm; |
|
29 | } ring_node_asm; | |
31 |
|
30 | |||
32 | typedef struct bp_packet |
|
31 | typedef struct bp_packet | |
33 | { |
|
32 | { | |
34 | Header_TM_LFR_SCIENCE_BP_t header; |
|
33 | Header_TM_LFR_SCIENCE_BP_t header; | |
35 | unsigned char data[ 30 * 22 ]; // MAX size is 22 * 30 [TM_LFR_SCIENCE_BURST_BP2_F1] |
|
34 | unsigned char data[ 30 * 22 ]; // MAX size is 22 * 30 [TM_LFR_SCIENCE_BURST_BP2_F1] | |
36 | } bp_packet; |
|
35 | } bp_packet; | |
37 |
|
36 | |||
38 | typedef struct bp_packet_with_spare |
|
37 | typedef struct bp_packet_with_spare | |
39 | { |
|
38 | { | |
40 | Header_TM_LFR_SCIENCE_BP_with_spare_t header; |
|
39 | Header_TM_LFR_SCIENCE_BP_with_spare_t header; | |
41 | unsigned char data[ 9 * 13 ]; // only for TM_LFR_SCIENCE_NORMAL_BP1_F0 and F1 |
|
40 | unsigned char data[ 9 * 13 ]; // only for TM_LFR_SCIENCE_NORMAL_BP1_F0 and F1 | |
42 | } bp_packet_with_spare; |
|
41 | } bp_packet_with_spare; | |
43 |
|
42 | |||
44 | typedef struct asm_msg |
|
43 | typedef struct asm_msg | |
45 | { |
|
44 | { | |
46 | ring_node_asm *norm; |
|
45 | ring_node_asm *norm; | |
47 | ring_node_asm *burst_sbm; |
|
46 | ring_node_asm *burst_sbm; | |
48 | rtems_event_set event; |
|
47 | rtems_event_set event; | |
49 | unsigned int coarseTime; |
|
48 | unsigned int coarseTime; | |
50 | unsigned int fineTime; |
|
49 | unsigned int fineTime; | |
51 | } asm_msg; |
|
50 | } asm_msg; | |
52 |
|
51 | |||
53 | extern nb_sm_t nb_sm; |
|
|||
54 | extern nb_sm_before_bp_asm_f0 nb_sm_before_f0; |
|
52 | extern nb_sm_before_bp_asm_f0 nb_sm_before_f0; | |
55 | extern nb_sm_before_bp_asm_f1 nb_sm_before_f1; |
|
53 | extern nb_sm_before_bp_asm_f1 nb_sm_before_f1; | |
56 | extern nb_sm_before_bp_asm_f2 nb_sm_before_f2; |
|
54 | extern nb_sm_before_bp_asm_f2 nb_sm_before_f2; | |
57 |
|
55 | |||
58 | extern volatile int sm_f0[ ]; |
|
56 | extern volatile int sm_f0[ ]; | |
59 | extern volatile int sm_f1[ ]; |
|
57 | extern volatile int sm_f1[ ]; | |
60 | extern volatile int sm_f2[ ]; |
|
58 | extern volatile int sm_f2[ ]; | |
61 |
|
59 | |||
62 | // parameters |
|
60 | // parameters | |
63 | extern struct param_local_str param_local; |
|
61 | extern struct param_local_str param_local; | |
64 |
|
62 | |||
65 | // registers |
|
63 | // registers | |
66 | extern time_management_regs_t *time_management_regs; |
|
64 | extern time_management_regs_t *time_management_regs; | |
67 | extern spectral_matrix_regs_t *spectral_matrix_regs; |
|
65 | extern spectral_matrix_regs_t *spectral_matrix_regs; | |
68 |
|
66 | |||
69 | extern rtems_name misc_name[5]; |
|
67 | extern rtems_name misc_name[5]; | |
70 | extern rtems_id Task_id[20]; /* array of task ids */ |
|
68 | extern rtems_id Task_id[20]; /* array of task ids */ | |
71 |
|
69 | |||
72 | // ISR |
|
70 | // ISR | |
73 | void reset_nb_sm_f0( unsigned char lfrMode ); |
|
71 | void reset_nb_sm_f0( unsigned char lfrMode ); | |
74 | rtems_isr spectral_matrices_isr( rtems_vector_number vector ); |
|
72 | rtems_isr spectral_matrices_isr( rtems_vector_number vector ); | |
75 | rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector ); |
|
73 | rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector ); | |
76 |
|
74 | |||
77 | // RTEMS TASKS |
|
75 | // RTEMS TASKS | |
78 | rtems_task smiq_task( rtems_task_argument argument ); // added to test the spectral matrix simulator |
|
|||
79 | rtems_task avf0_task( rtems_task_argument lfrRequestedMode ); |
|
76 | rtems_task avf0_task( rtems_task_argument lfrRequestedMode ); | |
80 | rtems_task prc0_task( rtems_task_argument lfrRequestedMode ); |
|
77 | rtems_task prc0_task( rtems_task_argument lfrRequestedMode ); | |
|
78 | rtems_task avf1_task( rtems_task_argument lfrRequestedMode ); | |||
|
79 | rtems_task prc1_task( rtems_task_argument lfrRequestedMode ); | |||
81 |
|
80 | |||
82 | //****************** |
|
81 | //****************** | |
83 | // Spectral Matrices |
|
82 | // Spectral Matrices | |
84 | void SM_init_rings( void ); |
|
83 | void SM_init_rings( void ); | |
85 | void ASM_init_rings( void ); |
|
84 | void ASM_init_rings( void ); | |
|
85 | void ASM_generic_init_ring(ring_node_asm *ring, unsigned char nbNodes ); | |||
86 | void SM_reset_current_ring_nodes( void ); |
|
86 | void SM_reset_current_ring_nodes( void ); | |
87 | void ASM_reset_current_ring_node( void ); |
|
87 | void ASM_reset_current_ring_nodes( void ); | |
88 | void ASM_init_header( Header_TM_LFR_SCIENCE_ASM_t *header); |
|
88 | void ASM_init_header( Header_TM_LFR_SCIENCE_ASM_t *header); | |
89 | void SM_average(float *averaged_spec_mat_f0, float *averaged_spec_mat_f1, |
|
89 | void SM_average(float *averaged_spec_mat_f0, float *averaged_spec_mat_f1, | |
90 | ring_node_sm *ring_node_tab[], |
|
90 | ring_node_sm *ring_node_tab[], | |
91 | unsigned int firstTimeF0, unsigned int firstTimeF1 ); |
|
91 | unsigned int firstTimeF0, unsigned int firstTimeF1 ); | |
92 | void ASM_reorganize_and_divide(float *averaged_spec_mat, float *averaged_spec_mat_reorganized, |
|
92 | void ASM_reorganize_and_divide(float *averaged_spec_mat, float *averaged_spec_mat_reorganized, | |
93 | float divider ); |
|
93 | float divider ); | |
94 | void ASM_compress_reorganize_and_divide(float *averaged_spec_mat, float *compressed_spec_mat, |
|
94 | void ASM_compress_reorganize_and_divide(float *averaged_spec_mat, float *compressed_spec_mat, | |
95 | float divider, |
|
95 | float divider, | |
96 | unsigned char nbBinsCompressedMatrix, unsigned char nbBinsToAverage , unsigned char ASMIndexStart); |
|
96 | unsigned char nbBinsCompressedMatrix, unsigned char nbBinsToAverage , unsigned char ASMIndexStart); | |
97 | void ASM_convert(volatile float *input_matrix, char *output_matrix); |
|
97 | void ASM_convert(volatile float *input_matrix, char *output_matrix); | |
98 | void ASM_send(Header_TM_LFR_SCIENCE_ASM_t *header, char *spectral_matrix, |
|
98 | void ASM_send(Header_TM_LFR_SCIENCE_ASM_t *header, char *spectral_matrix, | |
99 | unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send, rtems_id queue_id); |
|
99 | unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send, rtems_id queue_id); | |
100 |
|
100 | |||
101 | //***************** |
|
101 | //***************** | |
102 | // Basic Parameters |
|
102 | // Basic Parameters | |
103 |
|
103 | |||
104 | void BP_reset_current_ring_nodes( void ); |
|
104 | void BP_reset_current_ring_nodes( void ); | |
105 | void BP_init_header(Header_TM_LFR_SCIENCE_BP_t *header, |
|
105 | void BP_init_header(Header_TM_LFR_SCIENCE_BP_t *header, | |
106 | unsigned int apid, unsigned char sid, |
|
106 | unsigned int apid, unsigned char sid, | |
107 | unsigned int packetLength , unsigned char blkNr); |
|
107 | unsigned int packetLength , unsigned char blkNr); | |
108 | void BP_init_header_with_spare(Header_TM_LFR_SCIENCE_BP_with_spare_t *header, |
|
108 | void BP_init_header_with_spare(Header_TM_LFR_SCIENCE_BP_with_spare_t *header, | |
109 | unsigned int apid, unsigned char sid, |
|
109 | unsigned int apid, unsigned char sid, | |
110 | unsigned int packetLength, unsigned char blkNr ); |
|
110 | unsigned int packetLength, unsigned char blkNr ); | |
111 | void BP_send(char *data, |
|
111 | void BP_send(char *data, | |
112 | rtems_id queue_id , |
|
112 | rtems_id queue_id , | |
113 | unsigned int nbBytesToSend ); |
|
113 | unsigned int nbBytesToSend ); | |
114 |
|
114 | |||
115 | //****************** |
|
115 | //****************** | |
116 | // general functions |
|
116 | // general functions | |
117 | void reset_spectral_matrix_regs( void ); |
|
117 | void reset_spectral_matrix_regs( void ); | |
118 | void set_time(unsigned char *time, unsigned char *timeInBuffer ); |
|
118 | void set_time(unsigned char *time, unsigned char *timeInBuffer ); | |
119 |
|
119 | |||
120 | extern rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id ); |
|
120 | extern rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id ); | |
121 | extern rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id ); |
|
121 | extern rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id ); | |
122 |
|
122 | |||
123 | #endif // FSW_PROCESSING_H_INCLUDED |
|
123 | #endif // FSW_PROCESSING_H_INCLUDED |
@@ -1,51 +1,50 | |||||
1 | #ifndef TC_LOAD_DUMP_PARAMETERS_H |
|
1 | #ifndef TC_LOAD_DUMP_PARAMETERS_H | |
2 | #define TC_LOAD_DUMP_PARAMETERS_H |
|
2 | #define TC_LOAD_DUMP_PARAMETERS_H | |
3 |
|
3 | |||
4 | #include <rtems.h> |
|
4 | #include <rtems.h> | |
5 | #include <stdio.h> |
|
5 | #include <stdio.h> | |
6 |
|
6 | |||
7 | #include "fsw_params.h" |
|
7 | #include "fsw_params.h" | |
8 | #include "wf_handler.h" |
|
8 | #include "wf_handler.h" | |
9 | #include "tm_lfr_tc_exe.h" |
|
9 | #include "tm_lfr_tc_exe.h" | |
10 | #include "fsw_misc.h" |
|
10 | #include "fsw_misc.h" | |
11 |
|
11 | |||
12 | extern nb_sm_t nb_sm; |
|
|||
13 | extern nb_sm_before_bp_asm_f0 nb_sm_before_f0; |
|
12 | extern nb_sm_before_bp_asm_f0 nb_sm_before_f0; | |
14 | extern nb_sm_before_bp_asm_f1 nb_sm_before_f1; |
|
13 | extern nb_sm_before_bp_asm_f1 nb_sm_before_f1; | |
15 | extern nb_sm_before_bp_asm_f2 nb_sm_before_f2; |
|
14 | extern nb_sm_before_bp_asm_f2 nb_sm_before_f2; | |
16 |
|
15 | |||
17 | int action_load_common_par( ccsdsTelecommandPacket_t *TC ); |
|
16 | int action_load_common_par( ccsdsTelecommandPacket_t *TC ); | |
18 | int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); |
|
17 | int action_load_normal_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); | |
19 | int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); |
|
18 | int action_load_burst_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); | |
20 | int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); |
|
19 | int action_load_sbm1_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); | |
21 | int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); |
|
20 | int action_load_sbm2_par(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); | |
22 | int action_dump_par(rtems_id queue_id ); |
|
21 | int action_dump_par(rtems_id queue_id ); | |
23 |
|
22 | |||
24 | // NORMAL |
|
23 | // NORMAL | |
25 | int set_sy_lfr_n_swf_l(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); |
|
24 | int set_sy_lfr_n_swf_l(ccsdsTelecommandPacket_t *TC, rtems_id queue_id , unsigned char *time); | |
26 | int set_sy_lfr_n_swf_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time ); |
|
25 | int set_sy_lfr_n_swf_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time ); | |
27 | int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); |
|
26 | int set_sy_lfr_n_asm_p( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); | |
28 | int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); |
|
27 | int set_sy_lfr_n_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); | |
29 | int set_sy_lfr_n_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); |
|
28 | int set_sy_lfr_n_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); | |
30 | int set_sy_lfr_n_cwf_long_f3(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); |
|
29 | int set_sy_lfr_n_cwf_long_f3(ccsdsTelecommandPacket_t *TC, rtems_id queue_id); | |
31 |
|
30 | |||
32 | // BURST |
|
31 | // BURST | |
33 | int set_sy_lfr_b_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); |
|
32 | int set_sy_lfr_b_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); | |
34 | int set_sy_lfr_b_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); |
|
33 | int set_sy_lfr_b_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); | |
35 |
|
34 | |||
36 | // SBM1 |
|
35 | // SBM1 | |
37 | int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); |
|
36 | int set_sy_lfr_s1_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); | |
38 | int set_sy_lfr_s1_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); |
|
37 | int set_sy_lfr_s1_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); | |
39 |
|
38 | |||
40 | // SBM2 |
|
39 | // SBM2 | |
41 | int set_sy_lfr_s2_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); |
|
40 | int set_sy_lfr_s2_bp_p0( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); | |
42 | int set_sy_lfr_s2_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); |
|
41 | int set_sy_lfr_s2_bp_p1( ccsdsTelecommandPacket_t *TC, rtems_id queue_id ); | |
43 |
|
42 | |||
44 | // TC_LFR_UPDATE_INFO |
|
43 | // TC_LFR_UPDATE_INFO | |
45 | unsigned int check_update_info_hk_lfr_mode( unsigned char mode ); |
|
44 | unsigned int check_update_info_hk_lfr_mode( unsigned char mode ); | |
46 | unsigned int check_update_info_hk_tds_mode( unsigned char mode ); |
|
45 | unsigned int check_update_info_hk_tds_mode( unsigned char mode ); | |
47 | unsigned int check_update_info_hk_thr_mode( unsigned char mode ); |
|
46 | unsigned int check_update_info_hk_thr_mode( unsigned char mode ); | |
48 |
|
47 | |||
49 | void init_parameter_dump( void ); |
|
48 | void init_parameter_dump( void ); | |
50 |
|
49 | |||
51 | #endif // TC_LOAD_DUMP_PARAMETERS_H |
|
50 | #endif // TC_LOAD_DUMP_PARAMETERS_H |
@@ -1,80 +1,79 | |||||
1 | /** Global variables of the LFR flight software. |
|
1 | /** Global variables of the LFR flight software. | |
2 | * |
|
2 | * | |
3 | * @file |
|
3 | * @file | |
4 | * @author P. LEROY |
|
4 | * @author P. LEROY | |
5 | * |
|
5 | * | |
6 | * Among global variables, there are: |
|
6 | * Among global variables, there are: | |
7 | * - RTEMS names and id. |
|
7 | * - RTEMS names and id. | |
8 | * - APB configuration registers. |
|
8 | * - APB configuration registers. | |
9 | * - waveforms global buffers, used by the waveform picker hardware module to store data. |
|
9 | * - waveforms global buffers, used by the waveform picker hardware module to store data. | |
10 | * - spectral matrices buffesr, used by the hardware module to store data. |
|
10 | * - spectral matrices buffesr, used by the hardware module to store data. | |
11 | * - variable related to LFR modes parameters. |
|
11 | * - variable related to LFR modes parameters. | |
12 | * - the global HK packet buffer. |
|
12 | * - the global HK packet buffer. | |
13 | * - the global dump parameter buffer. |
|
13 | * - the global dump parameter buffer. | |
14 | * |
|
14 | * | |
15 | */ |
|
15 | */ | |
16 |
|
16 | |||
17 | #include <rtems.h> |
|
17 | #include <rtems.h> | |
18 | #include <grspw.h> |
|
18 | #include <grspw.h> | |
19 |
|
19 | |||
20 | #include "ccsds_types.h" |
|
20 | #include "ccsds_types.h" | |
21 | #include "grlib_regs.h" |
|
21 | #include "grlib_regs.h" | |
22 | #include "fsw_params.h" |
|
22 | #include "fsw_params.h" | |
23 |
|
23 | |||
24 | // RTEMS GLOBAL VARIABLES |
|
24 | // RTEMS GLOBAL VARIABLES | |
25 | rtems_name misc_name[5]; |
|
25 | rtems_name misc_name[5]; | |
26 | rtems_id misc_id[5]; |
|
26 | rtems_id misc_id[5]; | |
27 | rtems_name Task_name[20]; /* array of task names */ |
|
27 | rtems_name Task_name[20]; /* array of task names */ | |
28 | rtems_id Task_id[20]; /* array of task ids */ |
|
28 | rtems_id Task_id[20]; /* array of task ids */ | |
29 | unsigned int maxCount; |
|
29 | unsigned int maxCount; | |
30 | int fdSPW = 0; |
|
30 | int fdSPW = 0; | |
31 | int fdUART = 0; |
|
31 | int fdUART = 0; | |
32 | unsigned char lfrCurrentMode; |
|
32 | unsigned char lfrCurrentMode; | |
33 |
|
33 | |||
34 | // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes = 24584 |
|
34 | // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes = 24584 | |
35 | // 97 * 256 = 24832 => delta = 248 bytes = 62 words |
|
35 | // 97 * 256 = 24832 => delta = 248 bytes = 62 words | |
36 | // WAVEFORMS GLOBAL VARIABLES // 2688 * 3 * 4 + 2 * 4 = 32256 + 8 bytes = 32264 |
|
36 | // WAVEFORMS GLOBAL VARIABLES // 2688 * 3 * 4 + 2 * 4 = 32256 + 8 bytes = 32264 | |
37 | // 127 * 256 = 32512 => delta = 248 bytes = 62 words |
|
37 | // 127 * 256 = 32512 => delta = 248 bytes = 62 words | |
38 | // F0 |
|
38 | // F0 | |
39 | volatile int wf_snap_f0[ NB_RING_NODES_F0 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100))); |
|
39 | volatile int wf_snap_f0[ NB_RING_NODES_F0 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100))); | |
40 | // F1 F2 |
|
40 | // F1 F2 | |
41 | volatile int wf_snap_f1[ NB_RING_NODES_F1 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100))); |
|
41 | volatile int wf_snap_f1[ NB_RING_NODES_F1 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100))); | |
42 | volatile int wf_snap_f2[ NB_RING_NODES_F2 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100))); |
|
42 | volatile int wf_snap_f2[ NB_RING_NODES_F2 ][ (NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK) + TIME_OFFSET + 62 ] __attribute__((aligned(0x100))); | |
43 | // F3 |
|
43 | // F3 | |
44 | volatile int wf_cont_f3_a [ (NB_SAMPLES_PER_SNAPSHOT) * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); |
|
44 | volatile int wf_cont_f3_a [ (NB_SAMPLES_PER_SNAPSHOT) * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); | |
45 | volatile int wf_cont_f3_b [ (NB_SAMPLES_PER_SNAPSHOT) * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); |
|
45 | volatile int wf_cont_f3_b [ (NB_SAMPLES_PER_SNAPSHOT) * NB_WORDS_SWF_BLK + TIME_OFFSET ] __attribute__((aligned(0x100))); | |
46 | char wf_cont_f3_light[ (NB_SAMPLES_PER_SNAPSHOT) * NB_BYTES_CWF3_LIGHT_BLK + TIME_OFFSET_IN_BYTES ] __attribute__((aligned(0x100))); |
|
46 | char wf_cont_f3_light[ (NB_SAMPLES_PER_SNAPSHOT) * NB_BYTES_CWF3_LIGHT_BLK + TIME_OFFSET_IN_BYTES ] __attribute__((aligned(0x100))); | |
47 |
|
47 | |||
48 | //*********************************** |
|
48 | //*********************************** | |
49 | // SPECTRAL MATRICES GLOBAL VARIABLES |
|
49 | // SPECTRAL MATRICES GLOBAL VARIABLES | |
50 |
|
50 | |||
51 | nb_sm_t nb_sm; |
|
|||
52 | nb_sm_before_bp_asm_f0 nb_sm_before_f0; |
|
51 | nb_sm_before_bp_asm_f0 nb_sm_before_f0; | |
53 | nb_sm_before_bp_asm_f1 nb_sm_before_f1; |
|
52 | nb_sm_before_bp_asm_f1 nb_sm_before_f1; | |
54 | nb_sm_before_bp_asm_f2 nb_sm_before_f2; |
|
53 | nb_sm_before_bp_asm_f2 nb_sm_before_f2; | |
55 |
|
54 | |||
56 | // alignment constraints for the spectral matrices buffers => the first data after the time (8 bytes) shall be aligned on 0x00 |
|
55 | // alignment constraints for the spectral matrices buffers => the first data after the time (8 bytes) shall be aligned on 0x00 | |
57 | volatile int sm_f0[ NB_RING_NODES_SM_F0 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100))); |
|
56 | volatile int sm_f0[ NB_RING_NODES_SM_F0 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100))); | |
58 | volatile int sm_f1[ NB_RING_NODES_SM_F1 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100))); |
|
57 | volatile int sm_f1[ NB_RING_NODES_SM_F1 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100))); | |
59 | volatile int sm_f2[ NB_RING_NODES_SM_F2 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100))); |
|
58 | volatile int sm_f2[ NB_RING_NODES_SM_F2 * TOTAL_SIZE_SM ] __attribute__((aligned(0x100))); | |
60 |
|
59 | |||
61 | // APB CONFIGURATION REGISTERS |
|
60 | // APB CONFIGURATION REGISTERS | |
62 | time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT; |
|
61 | time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT; | |
63 | gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER; |
|
62 | gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER; | |
64 | waveform_picker_regs_new_t *waveform_picker_regs = (waveform_picker_regs_new_t*) REGS_ADDR_WAVEFORM_PICKER; |
|
63 | waveform_picker_regs_new_t *waveform_picker_regs = (waveform_picker_regs_new_t*) REGS_ADDR_WAVEFORM_PICKER; | |
65 | spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX; |
|
64 | spectral_matrix_regs_t *spectral_matrix_regs = (spectral_matrix_regs_t*) REGS_ADDR_SPECTRAL_MATRIX; | |
66 |
|
65 | |||
67 | // MODE PARAMETERS |
|
66 | // MODE PARAMETERS | |
68 | Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; |
|
67 | Packet_TM_LFR_PARAMETER_DUMP_t parameter_dump_packet; | |
69 | struct param_local_str param_local; |
|
68 | struct param_local_str param_local; | |
70 |
|
69 | |||
71 | // HK PACKETS |
|
70 | // HK PACKETS | |
72 | Packet_TM_LFR_HK_t housekeeping_packet; |
|
71 | Packet_TM_LFR_HK_t housekeeping_packet; | |
73 | // sequence counters are incremented by APID (PID + CAT) and destination ID |
|
72 | // sequence counters are incremented by APID (PID + CAT) and destination ID | |
74 | unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; |
|
73 | unsigned short sequenceCounters_SCIENCE_NORMAL_BURST; | |
75 | unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; |
|
74 | unsigned short sequenceCounters_SCIENCE_SBM1_SBM2; | |
76 | unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID]; |
|
75 | unsigned short sequenceCounters_TC_EXE[SEQ_CNT_NB_DEST_ID]; | |
77 | spw_stats spacewire_stats; |
|
76 | spw_stats spacewire_stats; | |
78 | spw_stats spacewire_stats_backup; |
|
77 | spw_stats spacewire_stats_backup; | |
79 |
|
78 | |||
80 |
|
79 |
@@ -1,696 +1,709 | |||||
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 4 |
|
38 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 4 | |
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 | reset_local_time(); |
|
73 | reset_local_time(); | |
74 |
|
74 | |||
75 | rtems_status_code status; |
|
75 | rtems_status_code status; | |
76 | rtems_status_code status_spw; |
|
76 | rtems_status_code status_spw; | |
77 | rtems_isr_entry old_isr_handler; |
|
77 | rtems_isr_entry old_isr_handler; | |
78 |
|
78 | |||
79 | // UART settings |
|
79 | // UART settings | |
80 | send_console_outputs_on_apbuart_port(); |
|
80 | send_console_outputs_on_apbuart_port(); | |
81 | set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE); |
|
81 | set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE); | |
82 | enable_apbuart_transmitter(); |
|
82 | enable_apbuart_transmitter(); | |
83 | DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n") |
|
83 | DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n") | |
84 |
|
84 | |||
85 | PRINTF("\n\n\n\n\n") |
|
85 | PRINTF("\n\n\n\n\n") | |
86 | PRINTF("*************************\n") |
|
86 | PRINTF("*************************\n") | |
87 | PRINTF("** LFR Flight Software **\n") |
|
87 | PRINTF("** LFR Flight Software **\n") | |
88 | PRINTF1("** %d.", SW_VERSION_N1) |
|
88 | PRINTF1("** %d.", SW_VERSION_N1) | |
89 | PRINTF1("%d." , SW_VERSION_N2) |
|
89 | PRINTF1("%d." , SW_VERSION_N2) | |
90 | PRINTF1("%d." , SW_VERSION_N3) |
|
90 | PRINTF1("%d." , SW_VERSION_N3) | |
91 | PRINTF1("%d **\n", SW_VERSION_N4) |
|
91 | PRINTF1("%d **\n", SW_VERSION_N4) | |
92 | PRINTF("*************************\n") |
|
92 | PRINTF("*************************\n") | |
93 | PRINTF("\n\n") |
|
93 | PRINTF("\n\n") | |
94 |
|
94 | |||
95 | init_parameter_dump(); |
|
95 | init_parameter_dump(); | |
96 | init_local_mode_parameters(); |
|
96 | init_local_mode_parameters(); | |
97 | init_housekeeping_parameters(); |
|
97 | init_housekeeping_parameters(); | |
98 |
|
98 | |||
99 | init_waveform_rings(); // initialize the waveform rings |
|
99 | init_waveform_rings(); // initialize the waveform rings | |
100 | SM_init_rings(); // initialize spectral matrices rings |
|
100 | SM_init_rings(); // initialize spectral matrices rings | |
101 | ASM_init_rings(); // initialize the average spectral matrix ring (just for burst, sbm1 and sbm2 asm @ f0 storage) |
|
101 | ASM_init_rings(); // initialize the average spectral matrix ring (just for burst, sbm1 and sbm2 asm @ f0 storage) | |
102 |
|
102 | |||
103 | reset_wfp_burst_enable(); |
|
103 | reset_wfp_burst_enable(); | |
104 | reset_wfp_status(); |
|
104 | reset_wfp_status(); | |
105 | set_wfp_data_shaping(); |
|
105 | set_wfp_data_shaping(); | |
106 |
|
106 | |||
107 | updateLFRCurrentMode(); |
|
107 | updateLFRCurrentMode(); | |
108 |
|
108 | |||
109 | BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode) |
|
109 | BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode) | |
110 |
|
110 | |||
111 | create_names(); // create all names |
|
111 | create_names(); // create all names | |
112 |
|
112 | |||
113 | status = create_message_queues(); // create message queues |
|
113 | status = create_message_queues(); // create message queues | |
114 | if (status != RTEMS_SUCCESSFUL) |
|
114 | if (status != RTEMS_SUCCESSFUL) | |
115 | { |
|
115 | { | |
116 | PRINTF1("in INIT *** ERR in create_message_queues, code %d", status) |
|
116 | PRINTF1("in INIT *** ERR in create_message_queues, code %d", status) | |
117 | } |
|
117 | } | |
118 |
|
118 | |||
119 | status = create_all_tasks(); // create all tasks |
|
119 | status = create_all_tasks(); // create all tasks | |
120 | if (status != RTEMS_SUCCESSFUL) |
|
120 | if (status != RTEMS_SUCCESSFUL) | |
121 | { |
|
121 | { | |
122 | PRINTF1("in INIT *** ERR in create_all_tasks, code %d", status) |
|
122 | PRINTF1("in INIT *** ERR in create_all_tasks, code %d", status) | |
123 | } |
|
123 | } | |
124 |
|
124 | |||
125 | // ************************** |
|
125 | // ************************** | |
126 | // <SPACEWIRE INITIALIZATION> |
|
126 | // <SPACEWIRE INITIALIZATION> | |
127 | grspw_timecode_callback = &timecode_irq_handler; |
|
127 | grspw_timecode_callback = &timecode_irq_handler; | |
128 |
|
128 | |||
129 | status_spw = spacewire_open_link(); // (1) open the link |
|
129 | status_spw = spacewire_open_link(); // (1) open the link | |
130 | if ( status_spw != RTEMS_SUCCESSFUL ) |
|
130 | if ( status_spw != RTEMS_SUCCESSFUL ) | |
131 | { |
|
131 | { | |
132 | PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw ) |
|
132 | PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw ) | |
133 | } |
|
133 | } | |
134 |
|
134 | |||
135 | if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link |
|
135 | if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link | |
136 | { |
|
136 | { | |
137 | status_spw = spacewire_configure_link( fdSPW ); |
|
137 | status_spw = spacewire_configure_link( fdSPW ); | |
138 | if ( status_spw != RTEMS_SUCCESSFUL ) |
|
138 | if ( status_spw != RTEMS_SUCCESSFUL ) | |
139 | { |
|
139 | { | |
140 | PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw ) |
|
140 | PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw ) | |
141 | } |
|
141 | } | |
142 | } |
|
142 | } | |
143 |
|
143 | |||
144 | if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link |
|
144 | if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link | |
145 | { |
|
145 | { | |
146 | status_spw = spacewire_start_link( fdSPW ); |
|
146 | status_spw = spacewire_start_link( fdSPW ); | |
147 | if ( status_spw != RTEMS_SUCCESSFUL ) |
|
147 | if ( status_spw != RTEMS_SUCCESSFUL ) | |
148 | { |
|
148 | { | |
149 | PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw ) |
|
149 | PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw ) | |
150 | } |
|
150 | } | |
151 | } |
|
151 | } | |
152 | // </SPACEWIRE INITIALIZATION> |
|
152 | // </SPACEWIRE INITIALIZATION> | |
153 | // *************************** |
|
153 | // *************************** | |
154 |
|
154 | |||
155 | status = start_all_tasks(); // start all tasks |
|
155 | status = start_all_tasks(); // start all tasks | |
156 | if (status != RTEMS_SUCCESSFUL) |
|
156 | if (status != RTEMS_SUCCESSFUL) | |
157 | { |
|
157 | { | |
158 | PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status) |
|
158 | PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status) | |
159 | } |
|
159 | } | |
160 |
|
160 | |||
161 | // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization |
|
161 | // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization | |
162 | status = start_recv_send_tasks(); |
|
162 | status = start_recv_send_tasks(); | |
163 | if ( status != RTEMS_SUCCESSFUL ) |
|
163 | if ( status != RTEMS_SUCCESSFUL ) | |
164 | { |
|
164 | { | |
165 | PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status ) |
|
165 | PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status ) | |
166 | } |
|
166 | } | |
167 |
|
167 | |||
168 | // suspend science tasks, they will be restarted later depending on the mode |
|
168 | // suspend science tasks, they will be restarted later depending on the mode | |
169 | status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY) |
|
169 | status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY) | |
170 | if (status != RTEMS_SUCCESSFUL) |
|
170 | if (status != RTEMS_SUCCESSFUL) | |
171 | { |
|
171 | { | |
172 | PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status) |
|
172 | PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status) | |
173 | } |
|
173 | } | |
174 |
|
174 | |||
175 | //****************************** |
|
175 | //****************************** | |
176 | // <SPECTRAL MATRICES SIMULATOR> |
|
176 | // <SPECTRAL MATRICES SIMULATOR> | |
177 | LEON_Mask_interrupt( IRQ_SM_SIMULATOR ); |
|
177 | LEON_Mask_interrupt( IRQ_SM_SIMULATOR ); | |
178 | configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR, |
|
178 | configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR, | |
179 | IRQ_SPARC_SM_SIMULATOR, spectral_matrices_isr_simu ); |
|
179 | IRQ_SPARC_SM_SIMULATOR, spectral_matrices_isr_simu ); | |
180 | // </SPECTRAL MATRICES SIMULATOR> |
|
180 | // </SPECTRAL MATRICES SIMULATOR> | |
181 | //******************************* |
|
181 | //******************************* | |
182 |
|
182 | |||
183 | // configure IRQ handling for the waveform picker unit |
|
183 | // configure IRQ handling for the waveform picker unit | |
184 | status = rtems_interrupt_catch( waveforms_isr, |
|
184 | status = rtems_interrupt_catch( waveforms_isr, | |
185 | IRQ_SPARC_WAVEFORM_PICKER, |
|
185 | IRQ_SPARC_WAVEFORM_PICKER, | |
186 | &old_isr_handler) ; |
|
186 | &old_isr_handler) ; | |
187 | // configure IRQ handling for the spectral matrices unit |
|
187 | // configure IRQ handling for the spectral matrices unit | |
188 | status = rtems_interrupt_catch( spectral_matrices_isr, |
|
188 | status = rtems_interrupt_catch( spectral_matrices_isr, | |
189 | IRQ_SPARC_SPECTRAL_MATRIX, |
|
189 | IRQ_SPARC_SPECTRAL_MATRIX, | |
190 | &old_isr_handler) ; |
|
190 | &old_isr_handler) ; | |
191 |
|
191 | |||
192 | // if the spacewire link is not up then send an event to the SPIQ task for link recovery |
|
192 | // if the spacewire link is not up then send an event to the SPIQ task for link recovery | |
193 | if ( status_spw != RTEMS_SUCCESSFUL ) |
|
193 | if ( status_spw != RTEMS_SUCCESSFUL ) | |
194 | { |
|
194 | { | |
195 | status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT ); |
|
195 | status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT ); | |
196 | if ( status != RTEMS_SUCCESSFUL ) { |
|
196 | if ( status != RTEMS_SUCCESSFUL ) { | |
197 | PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status ) |
|
197 | PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status ) | |
198 | } |
|
198 | } | |
199 | } |
|
199 | } | |
200 |
|
200 | |||
201 | BOOT_PRINTF("delete INIT\n") |
|
201 | BOOT_PRINTF("delete INIT\n") | |
202 |
|
202 | |||
203 | send_dumb_hk(); |
|
203 | send_dumb_hk(); | |
204 |
|
204 | |||
205 | status = rtems_task_delete(RTEMS_SELF); |
|
205 | status = rtems_task_delete(RTEMS_SELF); | |
206 |
|
206 | |||
207 | } |
|
207 | } | |
208 |
|
208 | |||
209 | void init_local_mode_parameters( void ) |
|
209 | void init_local_mode_parameters( void ) | |
210 | { |
|
210 | { | |
211 | /** This function initialize the param_local global variable with default values. |
|
211 | /** This function initialize the param_local global variable with default values. | |
212 | * |
|
212 | * | |
213 | */ |
|
213 | */ | |
214 |
|
214 | |||
215 | unsigned int i; |
|
215 | unsigned int i; | |
216 |
|
216 | |||
217 | // LOCAL PARAMETERS |
|
217 | // LOCAL PARAMETERS | |
218 | set_local_nb_interrupt_f0_MAX(); |
|
218 | set_local_nb_interrupt_f0_MAX(); | |
219 |
|
219 | |||
220 | BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max) |
|
220 | BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max) | |
221 | BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max) |
|
221 | BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max) | |
222 | BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX) |
|
222 | BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX) | |
223 |
|
223 | |||
224 | // init sequence counters |
|
224 | // init sequence counters | |
225 |
|
225 | |||
226 | for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++) |
|
226 | for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++) | |
227 | { |
|
227 | { | |
228 | sequenceCounters_TC_EXE[i] = 0x00; |
|
228 | sequenceCounters_TC_EXE[i] = 0x00; | |
229 | } |
|
229 | } | |
230 | sequenceCounters_SCIENCE_NORMAL_BURST = 0x00; |
|
230 | sequenceCounters_SCIENCE_NORMAL_BURST = 0x00; | |
231 | sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00; |
|
231 | sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00; | |
232 | } |
|
232 | } | |
233 |
|
233 | |||
234 | void reset_local_time( void ) |
|
234 | void reset_local_time( void ) | |
235 | { |
|
235 | { | |
236 | time_management_regs->ctrl = 0x02; // software reset, coarse time = 0x80000000 |
|
236 | time_management_regs->ctrl = 0x02; // software reset, coarse time = 0x80000000 | |
237 | } |
|
237 | } | |
238 |
|
238 | |||
239 | void create_names( void ) // create all names for tasks and queues |
|
239 | void create_names( void ) // create all names for tasks and queues | |
240 | { |
|
240 | { | |
241 | /** This function creates all RTEMS names used in the software for tasks and queues. |
|
241 | /** This function creates all RTEMS names used in the software for tasks and queues. | |
242 | * |
|
242 | * | |
243 | * @return RTEMS directive status codes: |
|
243 | * @return RTEMS directive status codes: | |
244 | * - RTEMS_SUCCESSFUL - successful completion |
|
244 | * - RTEMS_SUCCESSFUL - successful completion | |
245 | * |
|
245 | * | |
246 | */ |
|
246 | */ | |
247 |
|
247 | |||
248 | // task names |
|
248 | // task names | |
249 | Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' ); |
|
249 | Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' ); | |
250 | Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' ); |
|
250 | Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' ); | |
251 | Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' ); |
|
251 | Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' ); | |
252 | Task_name[TASKID_SMIQ] = rtems_build_name( 'S', 'M', 'I', 'Q' ); |
|
|||
253 | Task_name[TASKID_STAT] = rtems_build_name( 'S', 'T', 'A', 'T' ); |
|
252 | Task_name[TASKID_STAT] = rtems_build_name( 'S', 'T', 'A', 'T' ); | |
254 | Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' ); |
|
253 | Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' ); | |
255 | Task_name[TASKID_SWBD] = rtems_build_name( 'S', 'W', 'B', 'D' ); |
|
254 | Task_name[TASKID_SWBD] = rtems_build_name( 'S', 'W', 'B', 'D' ); | |
256 | Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' ); |
|
255 | Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' ); | |
257 | Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' ); |
|
256 | Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' ); | |
258 | Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' ); |
|
257 | Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' ); | |
259 | Task_name[TASKID_PRC0] = rtems_build_name( 'P', 'R', 'C', '0' ); |
|
258 | Task_name[TASKID_PRC0] = rtems_build_name( 'P', 'R', 'C', '0' ); | |
260 | Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' ); |
|
259 | Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' ); | |
261 | Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' ); |
|
260 | Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' ); | |
262 | Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' ); |
|
261 | Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' ); | |
263 | Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' ); |
|
262 | Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' ); | |
264 | Task_name[TASKID_WTDG] = rtems_build_name( 'W', 'T', 'D', 'G' ); |
|
263 | Task_name[TASKID_WTDG] = rtems_build_name( 'W', 'T', 'D', 'G' ); | |
|
264 | Task_name[TASKID_AVF1] = rtems_build_name( 'A', 'V', 'F', '1' ); | |||
|
265 | Task_name[TASKID_PRC1] = rtems_build_name( 'P', 'R', 'C', '1' ); | |||
265 |
|
266 | |||
266 | // rate monotonic period names |
|
267 | // rate monotonic period names | |
267 | name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' ); |
|
268 | name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' ); | |
268 |
|
269 | |||
269 | misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' ); |
|
270 | misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' ); | |
270 | misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' ); |
|
271 | misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' ); | |
271 | misc_name[QUEUE_PRC0] = rtems_build_name( 'Q', '_', 'P', '0' ); |
|
272 | misc_name[QUEUE_PRC0] = rtems_build_name( 'Q', '_', 'P', '0' ); | |
272 | misc_name[QUEUE_PRC1] = rtems_build_name( 'Q', '_', 'P', '1' ); |
|
273 | misc_name[QUEUE_PRC1] = rtems_build_name( 'Q', '_', 'P', '1' ); | |
273 | } |
|
274 | } | |
274 |
|
275 | |||
275 | int create_all_tasks( void ) // create all tasks which run in the software |
|
276 | int create_all_tasks( void ) // create all tasks which run in the software | |
276 | { |
|
277 | { | |
277 | /** This function creates all RTEMS tasks used in the software. |
|
278 | /** This function creates all RTEMS tasks used in the software. | |
278 | * |
|
279 | * | |
279 | * @return RTEMS directive status codes: |
|
280 | * @return RTEMS directive status codes: | |
280 | * - RTEMS_SUCCESSFUL - task created successfully |
|
281 | * - RTEMS_SUCCESSFUL - task created successfully | |
281 | * - RTEMS_INVALID_ADDRESS - id is NULL |
|
282 | * - RTEMS_INVALID_ADDRESS - id is NULL | |
282 | * - RTEMS_INVALID_NAME - invalid task name |
|
283 | * - RTEMS_INVALID_NAME - invalid task name | |
283 | * - RTEMS_INVALID_PRIORITY - invalid task priority |
|
284 | * - RTEMS_INVALID_PRIORITY - invalid task priority | |
284 | * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured |
|
285 | * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured | |
285 | * - RTEMS_TOO_MANY - too many tasks created |
|
286 | * - RTEMS_TOO_MANY - too many tasks created | |
286 | * - RTEMS_UNSATISFIED - not enough memory for stack/FP context |
|
287 | * - RTEMS_UNSATISFIED - not enough memory for stack/FP context | |
287 | * - RTEMS_TOO_MANY - too many global objects |
|
288 | * - RTEMS_TOO_MANY - too many global objects | |
288 | * |
|
289 | * | |
289 | */ |
|
290 | */ | |
290 |
|
291 | |||
291 | rtems_status_code status; |
|
292 | rtems_status_code status; | |
292 |
|
293 | |||
293 | //********** |
|
294 | //********** | |
294 | // SPACEWIRE |
|
295 | // SPACEWIRE | |
295 | // RECV |
|
296 | // RECV | |
296 | status = rtems_task_create( |
|
297 | status = rtems_task_create( | |
297 | Task_name[TASKID_RECV], TASK_PRIORITY_RECV, RTEMS_MINIMUM_STACK_SIZE, |
|
298 | Task_name[TASKID_RECV], TASK_PRIORITY_RECV, RTEMS_MINIMUM_STACK_SIZE, | |
298 | RTEMS_DEFAULT_MODES, |
|
299 | RTEMS_DEFAULT_MODES, | |
299 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV] |
|
300 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV] | |
300 | ); |
|
301 | ); | |
301 | if (status == RTEMS_SUCCESSFUL) // SEND |
|
302 | if (status == RTEMS_SUCCESSFUL) // SEND | |
302 | { |
|
303 | { | |
303 | status = rtems_task_create( |
|
304 | status = rtems_task_create( | |
304 | Task_name[TASKID_SEND], TASK_PRIORITY_SEND, RTEMS_MINIMUM_STACK_SIZE, |
|
305 | Task_name[TASKID_SEND], TASK_PRIORITY_SEND, RTEMS_MINIMUM_STACK_SIZE, | |
305 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
306 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
306 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SEND] |
|
307 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SEND] | |
307 | ); |
|
308 | ); | |
308 | } |
|
309 | } | |
309 | if (status == RTEMS_SUCCESSFUL) // WTDG |
|
310 | if (status == RTEMS_SUCCESSFUL) // WTDG | |
310 | { |
|
311 | { | |
311 | status = rtems_task_create( |
|
312 | status = rtems_task_create( | |
312 | Task_name[TASKID_WTDG], TASK_PRIORITY_WTDG, RTEMS_MINIMUM_STACK_SIZE, |
|
313 | Task_name[TASKID_WTDG], TASK_PRIORITY_WTDG, RTEMS_MINIMUM_STACK_SIZE, | |
313 | RTEMS_DEFAULT_MODES, |
|
314 | RTEMS_DEFAULT_MODES, | |
314 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_WTDG] |
|
315 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_WTDG] | |
315 | ); |
|
316 | ); | |
316 | } |
|
317 | } | |
317 | if (status == RTEMS_SUCCESSFUL) // ACTN |
|
318 | if (status == RTEMS_SUCCESSFUL) // ACTN | |
318 | { |
|
319 | { | |
319 | status = rtems_task_create( |
|
320 | status = rtems_task_create( | |
320 | Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE, |
|
321 | Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE, | |
321 | RTEMS_DEFAULT_MODES, |
|
322 | RTEMS_DEFAULT_MODES, | |
322 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN] |
|
323 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN] | |
323 | ); |
|
324 | ); | |
324 | } |
|
325 | } | |
325 | if (status == RTEMS_SUCCESSFUL) // SPIQ |
|
326 | if (status == RTEMS_SUCCESSFUL) // SPIQ | |
326 | { |
|
327 | { | |
327 | status = rtems_task_create( |
|
328 | status = rtems_task_create( | |
328 | Task_name[TASKID_SPIQ], TASK_PRIORITY_SPIQ, RTEMS_MINIMUM_STACK_SIZE, |
|
329 | Task_name[TASKID_SPIQ], TASK_PRIORITY_SPIQ, RTEMS_MINIMUM_STACK_SIZE, | |
329 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
330 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
330 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ] |
|
331 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ] | |
331 | ); |
|
332 | ); | |
332 | } |
|
333 | } | |
333 |
|
334 | |||
334 | //****************** |
|
335 | //****************** | |
335 | // SPECTRAL MATRICES |
|
336 | // SPECTRAL MATRICES | |
336 | if (status == RTEMS_SUCCESSFUL) // SMIQ |
|
|||
337 | { |
|
|||
338 | status = rtems_task_create( |
|
|||
339 | Task_name[TASKID_SMIQ], TASK_PRIORITY_SMIQ, RTEMS_MINIMUM_STACK_SIZE, |
|
|||
340 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
|||
341 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SMIQ] |
|
|||
342 | ); |
|
|||
343 | } |
|
|||
344 | if (status == RTEMS_SUCCESSFUL) // AVF0 |
|
337 | if (status == RTEMS_SUCCESSFUL) // AVF0 | |
345 | { |
|
338 | { | |
346 | status = rtems_task_create( |
|
339 | status = rtems_task_create( | |
347 | Task_name[TASKID_AVF0], TASK_PRIORITY_AVF0, RTEMS_MINIMUM_STACK_SIZE, |
|
340 | Task_name[TASKID_AVF0], TASK_PRIORITY_AVF0, RTEMS_MINIMUM_STACK_SIZE, | |
348 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
341 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
349 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0] |
|
342 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0] | |
350 | ); |
|
343 | ); | |
351 | } |
|
344 | } | |
352 |
if (status == RTEMS_SUCCESSFUL) // |
|
345 | if (status == RTEMS_SUCCESSFUL) // PRC0 | |
353 | { |
|
346 | { | |
354 | status = rtems_task_create( |
|
347 | status = rtems_task_create( | |
355 | Task_name[TASKID_PRC0], TASK_PRIORITY_PRC0, RTEMS_MINIMUM_STACK_SIZE * 2, |
|
348 | Task_name[TASKID_PRC0], TASK_PRIORITY_PRC0, RTEMS_MINIMUM_STACK_SIZE * 2, | |
356 | RTEMS_DEFAULT_MODES, |
|
349 | RTEMS_DEFAULT_MODES, | |
357 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC0] |
|
350 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC0] | |
358 | ); |
|
351 | ); | |
359 | } |
|
352 | } | |
|
353 | if (status == RTEMS_SUCCESSFUL) // AVF1 | |||
|
354 | { | |||
|
355 | status = rtems_task_create( | |||
|
356 | Task_name[TASKID_AVF1], TASK_PRIORITY_AVF1, RTEMS_MINIMUM_STACK_SIZE, | |||
|
357 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |||
|
358 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF1] | |||
|
359 | ); | |||
|
360 | } | |||
|
361 | if (status == RTEMS_SUCCESSFUL) // PRC1 | |||
|
362 | { | |||
|
363 | status = rtems_task_create( | |||
|
364 | Task_name[TASKID_PRC1], TASK_PRIORITY_PRC1, RTEMS_MINIMUM_STACK_SIZE * 2, | |||
|
365 | RTEMS_DEFAULT_MODES, | |||
|
366 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC1] | |||
|
367 | ); | |||
|
368 | } | |||
360 |
|
369 | |||
361 | //**************** |
|
370 | //**************** | |
362 | // WAVEFORM PICKER |
|
371 | // WAVEFORM PICKER | |
363 | if (status == RTEMS_SUCCESSFUL) // WFRM |
|
372 | if (status == RTEMS_SUCCESSFUL) // WFRM | |
364 | { |
|
373 | { | |
365 | status = rtems_task_create( |
|
374 | status = rtems_task_create( | |
366 | Task_name[TASKID_WFRM], TASK_PRIORITY_WFRM, RTEMS_MINIMUM_STACK_SIZE, |
|
375 | Task_name[TASKID_WFRM], TASK_PRIORITY_WFRM, RTEMS_MINIMUM_STACK_SIZE, | |
367 | RTEMS_DEFAULT_MODES, |
|
376 | RTEMS_DEFAULT_MODES, | |
368 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_WFRM] |
|
377 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_WFRM] | |
369 | ); |
|
378 | ); | |
370 | } |
|
379 | } | |
371 | if (status == RTEMS_SUCCESSFUL) // CWF3 |
|
380 | if (status == RTEMS_SUCCESSFUL) // CWF3 | |
372 | { |
|
381 | { | |
373 | status = rtems_task_create( |
|
382 | status = rtems_task_create( | |
374 | Task_name[TASKID_CWF3], TASK_PRIORITY_CWF3, RTEMS_MINIMUM_STACK_SIZE, |
|
383 | Task_name[TASKID_CWF3], TASK_PRIORITY_CWF3, RTEMS_MINIMUM_STACK_SIZE, | |
375 | RTEMS_DEFAULT_MODES, |
|
384 | RTEMS_DEFAULT_MODES, | |
376 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF3] |
|
385 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF3] | |
377 | ); |
|
386 | ); | |
378 | } |
|
387 | } | |
379 | if (status == RTEMS_SUCCESSFUL) // CWF2 |
|
388 | if (status == RTEMS_SUCCESSFUL) // CWF2 | |
380 | { |
|
389 | { | |
381 | status = rtems_task_create( |
|
390 | status = rtems_task_create( | |
382 | Task_name[TASKID_CWF2], TASK_PRIORITY_CWF2, RTEMS_MINIMUM_STACK_SIZE, |
|
391 | Task_name[TASKID_CWF2], TASK_PRIORITY_CWF2, RTEMS_MINIMUM_STACK_SIZE, | |
383 | RTEMS_DEFAULT_MODES, |
|
392 | RTEMS_DEFAULT_MODES, | |
384 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF2] |
|
393 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF2] | |
385 | ); |
|
394 | ); | |
386 | } |
|
395 | } | |
387 | if (status == RTEMS_SUCCESSFUL) // CWF1 |
|
396 | if (status == RTEMS_SUCCESSFUL) // CWF1 | |
388 | { |
|
397 | { | |
389 | status = rtems_task_create( |
|
398 | status = rtems_task_create( | |
390 | Task_name[TASKID_CWF1], TASK_PRIORITY_CWF1, RTEMS_MINIMUM_STACK_SIZE, |
|
399 | Task_name[TASKID_CWF1], TASK_PRIORITY_CWF1, RTEMS_MINIMUM_STACK_SIZE, | |
391 | RTEMS_DEFAULT_MODES, |
|
400 | RTEMS_DEFAULT_MODES, | |
392 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF1] |
|
401 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF1] | |
393 | ); |
|
402 | ); | |
394 | } |
|
403 | } | |
395 | if (status == RTEMS_SUCCESSFUL) // SWBD |
|
404 | if (status == RTEMS_SUCCESSFUL) // SWBD | |
396 | { |
|
405 | { | |
397 | status = rtems_task_create( |
|
406 | status = rtems_task_create( | |
398 | Task_name[TASKID_SWBD], TASK_PRIORITY_SWBD, RTEMS_MINIMUM_STACK_SIZE, |
|
407 | Task_name[TASKID_SWBD], TASK_PRIORITY_SWBD, RTEMS_MINIMUM_STACK_SIZE, | |
399 | RTEMS_DEFAULT_MODES, |
|
408 | RTEMS_DEFAULT_MODES, | |
400 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_SWBD] |
|
409 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_SWBD] | |
401 | ); |
|
410 | ); | |
402 | } |
|
411 | } | |
403 |
|
412 | |||
404 | //***** |
|
413 | //***** | |
405 | // MISC |
|
414 | // MISC | |
406 | if (status == RTEMS_SUCCESSFUL) // STAT |
|
415 | if (status == RTEMS_SUCCESSFUL) // STAT | |
407 | { |
|
416 | { | |
408 | status = rtems_task_create( |
|
417 | status = rtems_task_create( | |
409 | Task_name[TASKID_STAT], TASK_PRIORITY_STAT, RTEMS_MINIMUM_STACK_SIZE, |
|
418 | Task_name[TASKID_STAT], TASK_PRIORITY_STAT, RTEMS_MINIMUM_STACK_SIZE, | |
410 | RTEMS_DEFAULT_MODES, |
|
419 | RTEMS_DEFAULT_MODES, | |
411 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_STAT] |
|
420 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_STAT] | |
412 | ); |
|
421 | ); | |
413 | } |
|
422 | } | |
414 | if (status == RTEMS_SUCCESSFUL) // DUMB |
|
423 | if (status == RTEMS_SUCCESSFUL) // DUMB | |
415 | { |
|
424 | { | |
416 | status = rtems_task_create( |
|
425 | status = rtems_task_create( | |
417 | Task_name[TASKID_DUMB], TASK_PRIORITY_DUMB, RTEMS_MINIMUM_STACK_SIZE, |
|
426 | Task_name[TASKID_DUMB], TASK_PRIORITY_DUMB, RTEMS_MINIMUM_STACK_SIZE, | |
418 | RTEMS_DEFAULT_MODES, |
|
427 | RTEMS_DEFAULT_MODES, | |
419 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_DUMB] |
|
428 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_DUMB] | |
420 | ); |
|
429 | ); | |
421 | } |
|
430 | } | |
422 | if (status == RTEMS_SUCCESSFUL) // HOUS |
|
431 | if (status == RTEMS_SUCCESSFUL) // HOUS | |
423 | { |
|
432 | { | |
424 | status = rtems_task_create( |
|
433 | status = rtems_task_create( | |
425 | Task_name[TASKID_HOUS], TASK_PRIORITY_HOUS, RTEMS_MINIMUM_STACK_SIZE, |
|
434 | Task_name[TASKID_HOUS], TASK_PRIORITY_HOUS, RTEMS_MINIMUM_STACK_SIZE, | |
426 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
435 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
427 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS] |
|
436 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS] | |
428 | ); |
|
437 | ); | |
429 | } |
|
438 | } | |
430 |
|
439 | |||
431 | return status; |
|
440 | return status; | |
432 | } |
|
441 | } | |
433 |
|
442 | |||
434 | int start_recv_send_tasks( void ) |
|
443 | int start_recv_send_tasks( void ) | |
435 | { |
|
444 | { | |
436 | rtems_status_code status; |
|
445 | rtems_status_code status; | |
437 |
|
446 | |||
438 | status = rtems_task_start( Task_id[TASKID_RECV], recv_task, 1 ); |
|
447 | status = rtems_task_start( Task_id[TASKID_RECV], recv_task, 1 ); | |
439 | if (status!=RTEMS_SUCCESSFUL) { |
|
448 | if (status!=RTEMS_SUCCESSFUL) { | |
440 | BOOT_PRINTF("in INIT *** Error starting TASK_RECV\n") |
|
449 | BOOT_PRINTF("in INIT *** Error starting TASK_RECV\n") | |
441 | } |
|
450 | } | |
442 |
|
451 | |||
443 | if (status == RTEMS_SUCCESSFUL) // SEND |
|
452 | if (status == RTEMS_SUCCESSFUL) // SEND | |
444 | { |
|
453 | { | |
445 | status = rtems_task_start( Task_id[TASKID_SEND], send_task, 1 ); |
|
454 | status = rtems_task_start( Task_id[TASKID_SEND], send_task, 1 ); | |
446 | if (status!=RTEMS_SUCCESSFUL) { |
|
455 | if (status!=RTEMS_SUCCESSFUL) { | |
447 | BOOT_PRINTF("in INIT *** Error starting TASK_SEND\n") |
|
456 | BOOT_PRINTF("in INIT *** Error starting TASK_SEND\n") | |
448 | } |
|
457 | } | |
449 | } |
|
458 | } | |
450 |
|
459 | |||
451 | return status; |
|
460 | return status; | |
452 | } |
|
461 | } | |
453 |
|
462 | |||
454 | int start_all_tasks( void ) // start all tasks except SEND RECV and HOUS |
|
463 | int start_all_tasks( void ) // start all tasks except SEND RECV and HOUS | |
455 | { |
|
464 | { | |
456 | /** This function starts all RTEMS tasks used in the software. |
|
465 | /** This function starts all RTEMS tasks used in the software. | |
457 | * |
|
466 | * | |
458 | * @return RTEMS directive status codes: |
|
467 | * @return RTEMS directive status codes: | |
459 | * - RTEMS_SUCCESSFUL - ask started successfully |
|
468 | * - RTEMS_SUCCESSFUL - ask started successfully | |
460 | * - RTEMS_INVALID_ADDRESS - invalid task entry point |
|
469 | * - RTEMS_INVALID_ADDRESS - invalid task entry point | |
461 | * - RTEMS_INVALID_ID - invalid task id |
|
470 | * - RTEMS_INVALID_ID - invalid task id | |
462 | * - RTEMS_INCORRECT_STATE - task not in the dormant state |
|
471 | * - RTEMS_INCORRECT_STATE - task not in the dormant state | |
463 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task |
|
472 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task | |
464 | * |
|
473 | * | |
465 | */ |
|
474 | */ | |
466 | // starts all the tasks fot eh flight software |
|
475 | // starts all the tasks fot eh flight software | |
467 |
|
476 | |||
468 | rtems_status_code status; |
|
477 | rtems_status_code status; | |
469 |
|
478 | |||
470 | //********** |
|
479 | //********** | |
471 | // SPACEWIRE |
|
480 | // SPACEWIRE | |
472 | status = rtems_task_start( Task_id[TASKID_SPIQ], spiq_task, 1 ); |
|
481 | status = rtems_task_start( Task_id[TASKID_SPIQ], spiq_task, 1 ); | |
473 | if (status!=RTEMS_SUCCESSFUL) { |
|
482 | if (status!=RTEMS_SUCCESSFUL) { | |
474 | BOOT_PRINTF("in INIT *** Error starting TASK_SPIQ\n") |
|
483 | BOOT_PRINTF("in INIT *** Error starting TASK_SPIQ\n") | |
475 | } |
|
484 | } | |
476 |
|
485 | |||
477 | if (status == RTEMS_SUCCESSFUL) // WTDG |
|
486 | if (status == RTEMS_SUCCESSFUL) // WTDG | |
478 | { |
|
487 | { | |
479 | status = rtems_task_start( Task_id[TASKID_WTDG], wtdg_task, 1 ); |
|
488 | status = rtems_task_start( Task_id[TASKID_WTDG], wtdg_task, 1 ); | |
480 | if (status!=RTEMS_SUCCESSFUL) { |
|
489 | if (status!=RTEMS_SUCCESSFUL) { | |
481 | BOOT_PRINTF("in INIT *** Error starting TASK_WTDG\n") |
|
490 | BOOT_PRINTF("in INIT *** Error starting TASK_WTDG\n") | |
482 | } |
|
491 | } | |
483 | } |
|
492 | } | |
484 |
|
493 | |||
485 | if (status == RTEMS_SUCCESSFUL) // ACTN |
|
494 | if (status == RTEMS_SUCCESSFUL) // ACTN | |
486 | { |
|
495 | { | |
487 | status = rtems_task_start( Task_id[TASKID_ACTN], actn_task, 1 ); |
|
496 | status = rtems_task_start( Task_id[TASKID_ACTN], actn_task, 1 ); | |
488 | if (status!=RTEMS_SUCCESSFUL) { |
|
497 | if (status!=RTEMS_SUCCESSFUL) { | |
489 | BOOT_PRINTF("in INIT *** Error starting TASK_ACTN\n") |
|
498 | BOOT_PRINTF("in INIT *** Error starting TASK_ACTN\n") | |
490 | } |
|
499 | } | |
491 | } |
|
500 | } | |
492 |
|
501 | |||
493 | //****************** |
|
502 | //****************** | |
494 | // SPECTRAL MATRICES |
|
503 | // SPECTRAL MATRICES | |
495 | if (status == RTEMS_SUCCESSFUL) // SMIQ |
|
|||
496 | { |
|
|||
497 | status = rtems_task_start( Task_id[TASKID_SMIQ], smiq_task, 1 ); |
|
|||
498 | if (status!=RTEMS_SUCCESSFUL) { |
|
|||
499 | BOOT_PRINTF("in INIT *** Error starting TASK_BPPR\n") |
|
|||
500 | } |
|
|||
501 | } |
|
|||
502 |
|
||||
503 | if (status == RTEMS_SUCCESSFUL) // AVF0 |
|
504 | if (status == RTEMS_SUCCESSFUL) // AVF0 | |
504 | { |
|
505 | { | |
505 |
status = rtems_task_start( Task_id[TASKID_AVF0], avf0_task, |
|
506 | status = rtems_task_start( Task_id[TASKID_AVF0], avf0_task, LFR_MODE_STANDBY ); | |
506 | if (status!=RTEMS_SUCCESSFUL) { |
|
507 | if (status!=RTEMS_SUCCESSFUL) { | |
507 | BOOT_PRINTF("in INIT *** Error starting TASK_AVF0\n") |
|
508 | BOOT_PRINTF("in INIT *** Error starting TASK_AVF0\n") | |
508 | } |
|
509 | } | |
509 | } |
|
510 | } | |
510 |
|
||||
511 | if (status == RTEMS_SUCCESSFUL) // PRC0 |
|
511 | if (status == RTEMS_SUCCESSFUL) // PRC0 | |
512 | { |
|
512 | { | |
513 |
status = rtems_task_start( Task_id[TASKID_PRC0], prc0_task, |
|
513 | status = rtems_task_start( Task_id[TASKID_PRC0], prc0_task, LFR_MODE_STANDBY ); | |
514 | if (status!=RTEMS_SUCCESSFUL) { |
|
514 | if (status!=RTEMS_SUCCESSFUL) { | |
515 | BOOT_PRINTF("in INIT *** Error starting TASK_PRC0\n") |
|
515 | BOOT_PRINTF("in INIT *** Error starting TASK_PRC0\n") | |
516 | } |
|
516 | } | |
517 | } |
|
517 | } | |
|
518 | if (status == RTEMS_SUCCESSFUL) // AVF1 | |||
|
519 | { | |||
|
520 | status = rtems_task_start( Task_id[TASKID_AVF1], avf1_task, LFR_MODE_STANDBY ); | |||
|
521 | if (status!=RTEMS_SUCCESSFUL) { | |||
|
522 | BOOT_PRINTF("in INIT *** Error starting TASK_AVF1\n") | |||
|
523 | } | |||
|
524 | } | |||
|
525 | if (status == RTEMS_SUCCESSFUL) // PRC1 | |||
|
526 | { | |||
|
527 | status = rtems_task_start( Task_id[TASKID_PRC1], prc1_task, LFR_MODE_STANDBY ); | |||
|
528 | if (status!=RTEMS_SUCCESSFUL) { | |||
|
529 | BOOT_PRINTF("in INIT *** Error starting TASK_PRC1\n") | |||
|
530 | } | |||
|
531 | } | |||
518 |
|
532 | |||
519 | //**************** |
|
533 | //**************** | |
520 | // WAVEFORM PICKER |
|
534 | // WAVEFORM PICKER | |
521 | if (status == RTEMS_SUCCESSFUL) // WFRM |
|
535 | if (status == RTEMS_SUCCESSFUL) // WFRM | |
522 | { |
|
536 | { | |
523 | status = rtems_task_start( Task_id[TASKID_WFRM], wfrm_task, 1 ); |
|
537 | status = rtems_task_start( Task_id[TASKID_WFRM], wfrm_task, 1 ); | |
524 | if (status!=RTEMS_SUCCESSFUL) { |
|
538 | if (status!=RTEMS_SUCCESSFUL) { | |
525 | BOOT_PRINTF("in INIT *** Error starting TASK_WFRM\n") |
|
539 | BOOT_PRINTF("in INIT *** Error starting TASK_WFRM\n") | |
526 | } |
|
540 | } | |
527 | } |
|
541 | } | |
528 |
|
||||
529 | if (status == RTEMS_SUCCESSFUL) // CWF3 |
|
542 | if (status == RTEMS_SUCCESSFUL) // CWF3 | |
530 | { |
|
543 | { | |
531 | status = rtems_task_start( Task_id[TASKID_CWF3], cwf3_task, 1 ); |
|
544 | status = rtems_task_start( Task_id[TASKID_CWF3], cwf3_task, 1 ); | |
532 | if (status!=RTEMS_SUCCESSFUL) { |
|
545 | if (status!=RTEMS_SUCCESSFUL) { | |
533 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF3\n") |
|
546 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF3\n") | |
534 | } |
|
547 | } | |
535 | } |
|
548 | } | |
536 |
|
||||
537 | if (status == RTEMS_SUCCESSFUL) // CWF2 |
|
549 | if (status == RTEMS_SUCCESSFUL) // CWF2 | |
538 | { |
|
550 | { | |
539 | status = rtems_task_start( Task_id[TASKID_CWF2], cwf2_task, 1 ); |
|
551 | status = rtems_task_start( Task_id[TASKID_CWF2], cwf2_task, 1 ); | |
540 | if (status!=RTEMS_SUCCESSFUL) { |
|
552 | if (status!=RTEMS_SUCCESSFUL) { | |
541 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF2\n") |
|
553 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF2\n") | |
542 | } |
|
554 | } | |
543 | } |
|
555 | } | |
544 |
|
||||
545 | if (status == RTEMS_SUCCESSFUL) // CWF1 |
|
556 | if (status == RTEMS_SUCCESSFUL) // CWF1 | |
546 | { |
|
557 | { | |
547 | status = rtems_task_start( Task_id[TASKID_CWF1], cwf1_task, 1 ); |
|
558 | status = rtems_task_start( Task_id[TASKID_CWF1], cwf1_task, 1 ); | |
548 | if (status!=RTEMS_SUCCESSFUL) { |
|
559 | if (status!=RTEMS_SUCCESSFUL) { | |
549 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF1\n") |
|
560 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF1\n") | |
550 | } |
|
561 | } | |
551 | } |
|
562 | } | |
552 |
|
||||
553 | if (status == RTEMS_SUCCESSFUL) // SWBD |
|
563 | if (status == RTEMS_SUCCESSFUL) // SWBD | |
554 | { |
|
564 | { | |
555 | status = rtems_task_start( Task_id[TASKID_SWBD], swbd_task, 1 ); |
|
565 | status = rtems_task_start( Task_id[TASKID_SWBD], swbd_task, 1 ); | |
556 | if (status!=RTEMS_SUCCESSFUL) { |
|
566 | if (status!=RTEMS_SUCCESSFUL) { | |
557 | BOOT_PRINTF("in INIT *** Error starting TASK_SWBD\n") |
|
567 | BOOT_PRINTF("in INIT *** Error starting TASK_SWBD\n") | |
558 | } |
|
568 | } | |
559 | } |
|
569 | } | |
560 |
|
570 | |||
561 | //***** |
|
571 | //***** | |
562 | // MISC |
|
572 | // MISC | |
563 | if (status == RTEMS_SUCCESSFUL) // HOUS |
|
573 | if (status == RTEMS_SUCCESSFUL) // HOUS | |
564 | { |
|
574 | { | |
565 | status = rtems_task_start( Task_id[TASKID_HOUS], hous_task, 1 ); |
|
575 | status = rtems_task_start( Task_id[TASKID_HOUS], hous_task, 1 ); | |
566 | if (status!=RTEMS_SUCCESSFUL) { |
|
576 | if (status!=RTEMS_SUCCESSFUL) { | |
567 | BOOT_PRINTF("in INIT *** Error starting TASK_HOUS\n") |
|
577 | BOOT_PRINTF("in INIT *** Error starting TASK_HOUS\n") | |
568 | } |
|
578 | } | |
569 | } |
|
579 | } | |
570 |
|
||||
571 | if (status == RTEMS_SUCCESSFUL) // DUMB |
|
580 | if (status == RTEMS_SUCCESSFUL) // DUMB | |
572 | { |
|
581 | { | |
573 | status = rtems_task_start( Task_id[TASKID_DUMB], dumb_task, 1 ); |
|
582 | status = rtems_task_start( Task_id[TASKID_DUMB], dumb_task, 1 ); | |
574 | if (status!=RTEMS_SUCCESSFUL) { |
|
583 | if (status!=RTEMS_SUCCESSFUL) { | |
575 | BOOT_PRINTF("in INIT *** Error starting TASK_DUMB\n") |
|
584 | BOOT_PRINTF("in INIT *** Error starting TASK_DUMB\n") | |
576 | } |
|
585 | } | |
577 | } |
|
586 | } | |
578 |
|
||||
579 | if (status == RTEMS_SUCCESSFUL) // STAT |
|
587 | if (status == RTEMS_SUCCESSFUL) // STAT | |
580 | { |
|
588 | { | |
581 | status = rtems_task_start( Task_id[TASKID_STAT], stat_task, 1 ); |
|
589 | status = rtems_task_start( Task_id[TASKID_STAT], stat_task, 1 ); | |
582 | if (status!=RTEMS_SUCCESSFUL) { |
|
590 | if (status!=RTEMS_SUCCESSFUL) { | |
583 | BOOT_PRINTF("in INIT *** Error starting TASK_STAT\n") |
|
591 | BOOT_PRINTF("in INIT *** Error starting TASK_STAT\n") | |
584 | } |
|
592 | } | |
585 | } |
|
593 | } | |
586 |
|
594 | |||
587 | return status; |
|
595 | return status; | |
588 | } |
|
596 | } | |
589 |
|
597 | |||
590 | rtems_status_code create_message_queues( void ) // create the two message queues used in the software |
|
598 | rtems_status_code create_message_queues( void ) // create the two message queues used in the software | |
591 | { |
|
599 | { | |
592 | rtems_status_code status_recv; |
|
600 | rtems_status_code status_recv; | |
593 | rtems_status_code status_send; |
|
601 | rtems_status_code status_send; | |
594 |
rtems_status_code status_ |
|
602 | rtems_status_code status_q_p0; | |
|
603 | rtems_status_code status_q_p1; | |||
595 | rtems_status_code ret; |
|
604 | rtems_status_code ret; | |
596 | rtems_id queue_id; |
|
605 | rtems_id queue_id; | |
597 |
|
606 | |||
598 | //**************************************** |
|
607 | //**************************************** | |
599 | // create the queue for handling valid TCs |
|
608 | // create the queue for handling valid TCs | |
600 | status_recv = rtems_message_queue_create( misc_name[QUEUE_RECV], |
|
609 | status_recv = rtems_message_queue_create( misc_name[QUEUE_RECV], | |
601 | MSG_QUEUE_COUNT_RECV, CCSDS_TC_PKT_MAX_SIZE, |
|
610 | MSG_QUEUE_COUNT_RECV, CCSDS_TC_PKT_MAX_SIZE, | |
602 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); |
|
611 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); | |
603 | if ( status_recv != RTEMS_SUCCESSFUL ) { |
|
612 | if ( status_recv != RTEMS_SUCCESSFUL ) { | |
604 | PRINTF1("in create_message_queues *** ERR creating QUEU queue, %d\n", status_recv) |
|
613 | PRINTF1("in create_message_queues *** ERR creating QUEU queue, %d\n", status_recv) | |
605 | } |
|
614 | } | |
606 |
|
615 | |||
607 | //************************************************ |
|
616 | //************************************************ | |
608 | // create the queue for handling TM packet sending |
|
617 | // create the queue for handling TM packet sending | |
609 | status_send = rtems_message_queue_create( misc_name[QUEUE_SEND], |
|
618 | status_send = rtems_message_queue_create( misc_name[QUEUE_SEND], | |
610 | MSG_QUEUE_COUNT_SEND, MSG_QUEUE_SIZE_SEND, |
|
619 | MSG_QUEUE_COUNT_SEND, MSG_QUEUE_SIZE_SEND, | |
611 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); |
|
620 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); | |
612 | if ( status_send != RTEMS_SUCCESSFUL ) { |
|
621 | if ( status_send != RTEMS_SUCCESSFUL ) { | |
613 | PRINTF1("in create_message_queues *** ERR creating PKTS queue, %d\n", status_send) |
|
622 | PRINTF1("in create_message_queues *** ERR creating PKTS queue, %d\n", status_send) | |
614 | } |
|
623 | } | |
615 |
|
624 | |||
616 | //***************************************************************************** |
|
625 | //***************************************************************************** | |
617 | // create the queue for handling averaged spectral matrices for processing @ f0 |
|
626 | // create the queue for handling averaged spectral matrices for processing @ f0 | |
618 |
status_ |
|
627 | status_q_p0 = rtems_message_queue_create( misc_name[QUEUE_PRC0], | |
619 | MSG_QUEUE_COUNT_PRC0, MSG_QUEUE_SIZE_PRC0, |
|
628 | MSG_QUEUE_COUNT_PRC0, MSG_QUEUE_SIZE_PRC0, | |
620 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); |
|
629 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); | |
621 |
if ( status_ |
|
630 | if ( status_q_p0 != RTEMS_SUCCESSFUL ) { | |
622 |
PRINTF1("in create_message_queues *** ERR creating |
|
631 | PRINTF1("in create_message_queues *** ERR creating Q_P0 queue, %d\n", status_q_p0) | |
623 | } |
|
632 | } | |
624 |
|
633 | |||
625 | //***************************************************************************** |
|
634 | //***************************************************************************** | |
626 | // create the queue for handling averaged spectral matrices for processing @ f1 |
|
635 | // create the queue for handling averaged spectral matrices for processing @ f1 | |
627 |
|
|
636 | status_q_p1 = rtems_message_queue_create( misc_name[QUEUE_PRC1], | |
628 |
|
|
637 | MSG_QUEUE_COUNT_PRC1, MSG_QUEUE_SIZE_PRC1, | |
629 |
|
|
638 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); | |
630 |
|
|
639 | if ( status_q_p1 != RTEMS_SUCCESSFUL ) { | |
631 |
|
|
640 | PRINTF1("in create_message_queues *** ERR creating Q_P1 queue, %d\n", status_q_p1) | |
632 |
|
|
641 | } | |
633 |
|
642 | |||
634 | if ( status_recv != RTEMS_SUCCESSFUL ) |
|
643 | if ( status_recv != RTEMS_SUCCESSFUL ) | |
635 | { |
|
644 | { | |
636 | ret = status_recv; |
|
645 | ret = status_recv; | |
637 | } |
|
646 | } | |
638 | else if( status_send != RTEMS_SUCCESSFUL ) |
|
647 | else if( status_send != RTEMS_SUCCESSFUL ) | |
639 | { |
|
648 | { | |
640 | ret = status_send; |
|
649 | ret = status_send; | |
641 | } |
|
650 | } | |
|
651 | else if( status_q_p0 != RTEMS_SUCCESSFUL ) | |||
|
652 | { | |||
|
653 | ret = status_q_p0; | |||
|
654 | } | |||
642 | else |
|
655 | else | |
643 | { |
|
656 | { | |
644 |
ret = status_ |
|
657 | ret = status_q_p1; | |
645 | } |
|
658 | } | |
646 |
|
659 | |||
647 | return ret; |
|
660 | return ret; | |
648 | } |
|
661 | } | |
649 |
|
662 | |||
650 | rtems_status_code get_message_queue_id_send( rtems_id *queue_id ) |
|
663 | rtems_status_code get_message_queue_id_send( rtems_id *queue_id ) | |
651 | { |
|
664 | { | |
652 | rtems_status_code status; |
|
665 | rtems_status_code status; | |
653 | rtems_name queue_name; |
|
666 | rtems_name queue_name; | |
654 |
|
667 | |||
655 | queue_name = rtems_build_name( 'Q', '_', 'S', 'D' ); |
|
668 | queue_name = rtems_build_name( 'Q', '_', 'S', 'D' ); | |
656 |
|
669 | |||
657 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); |
|
670 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); | |
658 |
|
671 | |||
659 | return status; |
|
672 | return status; | |
660 | } |
|
673 | } | |
661 |
|
674 | |||
662 | rtems_status_code get_message_queue_id_recv( rtems_id *queue_id ) |
|
675 | rtems_status_code get_message_queue_id_recv( rtems_id *queue_id ) | |
663 | { |
|
676 | { | |
664 | rtems_status_code status; |
|
677 | rtems_status_code status; | |
665 | rtems_name queue_name; |
|
678 | rtems_name queue_name; | |
666 |
|
679 | |||
667 | queue_name = rtems_build_name( 'Q', '_', 'R', 'V' ); |
|
680 | queue_name = rtems_build_name( 'Q', '_', 'R', 'V' ); | |
668 |
|
681 | |||
669 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); |
|
682 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); | |
670 |
|
683 | |||
671 | return status; |
|
684 | return status; | |
672 | } |
|
685 | } | |
673 |
|
686 | |||
674 | rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id ) |
|
687 | rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id ) | |
675 | { |
|
688 | { | |
676 | rtems_status_code status; |
|
689 | rtems_status_code status; | |
677 | rtems_name queue_name; |
|
690 | rtems_name queue_name; | |
678 |
|
691 | |||
679 | queue_name = rtems_build_name( 'Q', '_', 'P', '0' ); |
|
692 | queue_name = rtems_build_name( 'Q', '_', 'P', '0' ); | |
680 |
|
693 | |||
681 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); |
|
694 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); | |
682 |
|
695 | |||
683 | return status; |
|
696 | return status; | |
684 | } |
|
697 | } | |
685 |
|
698 | |||
686 | rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id ) |
|
699 | rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id ) | |
687 | { |
|
700 | { | |
688 | rtems_status_code status; |
|
701 | rtems_status_code status; | |
689 | rtems_name queue_name; |
|
702 | rtems_name queue_name; | |
690 |
|
703 | |||
691 | queue_name = rtems_build_name( 'Q', '_', 'P', '1' ); |
|
704 | queue_name = rtems_build_name( 'Q', '_', 'P', '1' ); | |
692 |
|
705 | |||
693 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); |
|
706 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); | |
694 |
|
707 | |||
695 | return status; |
|
708 | return status; | |
696 | } |
|
709 | } |
This diff has been collapsed as it changes many lines, (684 lines changed) Show them Hide them | |||||
@@ -1,1079 +1,1231 | |||||
1 | /** Functions related to data processing. |
|
1 | /** Functions related to data processing. | |
2 | * |
|
2 | * | |
3 | * @file |
|
3 | * @file | |
4 | * @author P. LEROY |
|
4 | * @author P. LEROY | |
5 | * |
|
5 | * | |
6 | * These function are related to data processing, i.e. spectral matrices averaging and basic parameters computation. |
|
6 | * These function are related to data processing, i.e. spectral matrices averaging and basic parameters computation. | |
7 | * |
|
7 | * | |
8 | */ |
|
8 | */ | |
9 |
|
9 | |||
10 | #include <fsw_processing.h> |
|
10 | #include <fsw_processing.h> | |
11 |
|
11 | |||
12 | #include "fsw_processing_globals.c" |
|
12 | #include "fsw_processing_globals.c" | |
13 |
|
13 | |||
|
14 | unsigned int nb_sm_f0; | |||
|
15 | ||||
14 | //************************ |
|
16 | //************************ | |
15 | // spectral matrices rings |
|
17 | // spectral matrices rings | |
16 | ring_node_sm sm_ring_f0[ NB_RING_NODES_SM_F0 ]; |
|
18 | ring_node_sm sm_ring_f0[ NB_RING_NODES_SM_F0 ]; | |
17 | ring_node_sm sm_ring_f1[ NB_RING_NODES_SM_F1 ]; |
|
19 | ring_node_sm sm_ring_f1[ NB_RING_NODES_SM_F1 ]; | |
18 | ring_node_sm sm_ring_f2[ NB_RING_NODES_SM_F2 ]; |
|
20 | ring_node_sm sm_ring_f2[ NB_RING_NODES_SM_F2 ]; | |
19 | ring_node_sm *current_ring_node_sm_f0; |
|
21 | ring_node_sm *current_ring_node_sm_f0; | |
20 | ring_node_sm *current_ring_node_sm_f1; |
|
22 | ring_node_sm *current_ring_node_sm_f1; | |
21 | ring_node_sm *current_ring_node_sm_f2; |
|
23 | ring_node_sm *current_ring_node_sm_f2; | |
22 | ring_node_sm *ring_node_for_averaging_sm_f0; |
|
24 | ring_node_sm *ring_node_for_averaging_sm_f0; | |
23 | ring_node_sm *ring_node_for_averaging_sm_f1; |
|
25 | ring_node_sm *ring_node_for_averaging_sm_f1; | |
24 |
|
26 | |||
|
27 | ring_node_asm asm_ring_norm_f0 [ NB_RING_NODES_ASM_NORM_F0 ]; | |||
25 | ring_node_asm asm_ring_burst_sbm_f0[ NB_RING_NODES_ASM_BURST_SBM_F0 ]; |
|
28 | ring_node_asm asm_ring_burst_sbm_f0[ NB_RING_NODES_ASM_BURST_SBM_F0 ]; | |
26 |
ring_node_asm asm_ring_norm_f |
|
29 | ring_node_asm asm_ring_norm_f1 [ NB_RING_NODES_ASM_NORM_F1 ]; | |
|
30 | ring_node_asm asm_ring_burst_sbm_f1[ NB_RING_NODES_ASM_BURST_SBM_F1 ]; | |||
27 | ring_node_asm *current_ring_node_asm_burst_sbm_f0; |
|
31 | ring_node_asm *current_ring_node_asm_burst_sbm_f0; | |
|
32 | ring_node_asm *current_ring_node_asm_norm_f0; | |||
28 | ring_node_asm *current_ring_node_asm_burst_sbm_f1; |
|
33 | ring_node_asm *current_ring_node_asm_burst_sbm_f1; | |
29 | ring_node_asm *current_ring_node_asm_norm_f0; |
|
|||
30 | ring_node_asm *current_ring_node_asm_norm_f1; |
|
34 | ring_node_asm *current_ring_node_asm_norm_f1; | |
31 |
|
35 | |||
32 | float asm_norm_f0 [ TOTAL_SIZE_SM ]; |
|
|||
33 | float asm_f0_reorganized [ TOTAL_SIZE_SM ]; |
|
36 | float asm_f0_reorganized [ TOTAL_SIZE_SM ]; | |
34 | char asm_f0_char [ TIME_OFFSET_IN_BYTES + (TOTAL_SIZE_SM * 2) ]; |
|
37 | char asm_f0_char [ TIME_OFFSET_IN_BYTES + (TOTAL_SIZE_SM * 2) ]; | |
35 | float compressed_sm_norm_f0[ TOTAL_SIZE_COMPRESSED_ASM_F0 ]; |
|
38 | float compressed_sm_norm_f0[ TOTAL_SIZE_COMPRESSED_ASM_F0 ]; | |
36 | float compressed_sm_sbm [ TOTAL_SIZE_COMPRESSED_ASM_SBM1 ]; |
|
39 | float compressed_sm_sbm [ TOTAL_SIZE_COMPRESSED_ASM_SBM1 ]; | |
37 |
|
40 | |||
38 | //*********************************************************** |
|
41 | //*********************************************************** | |
39 | // Interrupt Service Routine for spectral matrices processing |
|
42 | // Interrupt Service Routine for spectral matrices processing | |
|
43 | ||||
40 | void reset_nb_sm_f0( unsigned char lfrMode ) |
|
44 | void reset_nb_sm_f0( unsigned char lfrMode ) | |
41 | { |
|
45 | { | |
42 |
nb_sm |
|
46 | nb_sm_f0 = 0; | |
43 | nb_sm.norm_bp1_f0 = 0; |
|
|||
44 | nb_sm.norm_bp2_f0 = 0; |
|
|||
45 | nb_sm.norm_asm_f0 = 0; |
|
|||
46 | nb_sm.sbm_bp1_f0 = 0; |
|
|||
47 | nb_sm.sbm_bp2_f0 = 0; |
|
|||
48 |
|
47 | |||
49 | nb_sm_before_f0.norm_bp1_f0 = parameter_dump_packet.sy_lfr_n_bp_p0 * 96; |
|
48 | nb_sm_before_f0.norm_bp1_f0 = parameter_dump_packet.sy_lfr_n_bp_p0 * 96; | |
50 | nb_sm_before_f0.norm_bp2_f0 = parameter_dump_packet.sy_lfr_n_bp_p1 * 96; |
|
49 | nb_sm_before_f0.norm_bp2_f0 = parameter_dump_packet.sy_lfr_n_bp_p1 * 96; | |
51 | nb_sm_before_f0.norm_asm_f0 = (parameter_dump_packet.sy_lfr_n_asm_p[0] * 256 + parameter_dump_packet.sy_lfr_n_asm_p[1]) * 96; |
|
50 | nb_sm_before_f0.norm_asm_f0 = (parameter_dump_packet.sy_lfr_n_asm_p[0] * 256 + parameter_dump_packet.sy_lfr_n_asm_p[1]) * 96; | |
52 | nb_sm_before_f0.sbm1_bp1_f0 = parameter_dump_packet.sy_lfr_s1_bp_p0 * 24; |
|
51 | nb_sm_before_f0.sbm1_bp1_f0 = parameter_dump_packet.sy_lfr_s1_bp_p0 * 24; | |
53 | nb_sm_before_f0.sbm1_bp2_f0 = parameter_dump_packet.sy_lfr_s1_bp_p1 * 96; |
|
52 | nb_sm_before_f0.sbm1_bp2_f0 = parameter_dump_packet.sy_lfr_s1_bp_p1 * 96; | |
54 | nb_sm_before_f0.sbm2_bp1_f0 = parameter_dump_packet.sy_lfr_s2_bp_p0 * 96; |
|
53 | nb_sm_before_f0.sbm2_bp1_f0 = parameter_dump_packet.sy_lfr_s2_bp_p0 * 96; | |
55 | nb_sm_before_f0.sbm2_bp2_f0 = parameter_dump_packet.sy_lfr_s2_bp_p1 * 96; |
|
54 | nb_sm_before_f0.sbm2_bp2_f0 = parameter_dump_packet.sy_lfr_s2_bp_p1 * 96; | |
56 | nb_sm_before_f0.burst_bp1_f0 = parameter_dump_packet.sy_lfr_b_bp_p0 * 96; |
|
55 | nb_sm_before_f0.burst_bp1_f0 = parameter_dump_packet.sy_lfr_b_bp_p0 * 96; | |
57 | nb_sm_before_f0.burst_bp2_f0 = parameter_dump_packet.sy_lfr_b_bp_p1 * 96; |
|
56 | nb_sm_before_f0.burst_bp2_f0 = parameter_dump_packet.sy_lfr_b_bp_p1 * 96; | |
58 |
|
57 | |||
59 | if (lfrMode == LFR_MODE_SBM1) |
|
58 | if (lfrMode == LFR_MODE_SBM1) | |
60 | { |
|
59 | { | |
61 | nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.sbm1_bp1_f0; |
|
60 | nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.sbm1_bp1_f0; | |
62 | nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.sbm1_bp2_f0; |
|
61 | nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.sbm1_bp2_f0; | |
63 | } |
|
62 | } | |
64 | else if (lfrMode == LFR_MODE_SBM2) |
|
63 | else if (lfrMode == LFR_MODE_SBM2) | |
65 | { |
|
64 | { | |
66 | nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.sbm2_bp1_f0; |
|
65 | nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.sbm2_bp1_f0; | |
67 | nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.sbm2_bp2_f0; |
|
66 | nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.sbm2_bp2_f0; | |
68 | } |
|
67 | } | |
69 | else if (lfrMode == LFR_MODE_BURST) |
|
68 | else if (lfrMode == LFR_MODE_BURST) | |
70 | { |
|
69 | { | |
71 | nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.burst_bp1_f0; |
|
70 | nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.burst_bp1_f0; | |
72 | nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.burst_bp2_f0; |
|
71 | nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.burst_bp2_f0; | |
73 | } |
|
72 | } | |
74 | else |
|
73 | else | |
75 | { |
|
74 | { | |
76 | nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.burst_bp1_f0; |
|
75 | nb_sm_before_f0.burst_sbm_bp1_f0 = nb_sm_before_f0.burst_bp1_f0; | |
77 | nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.burst_bp2_f0; |
|
76 | nb_sm_before_f0.burst_sbm_bp2_f0 = nb_sm_before_f0.burst_bp2_f0; | |
78 | } |
|
77 | } | |
79 | } |
|
78 | } | |
80 |
|
79 | |||
81 | void reset_nb_sm_f1( unsigned char lfrMode ) |
|
80 | void reset_nb_sm_f1( unsigned char lfrMode ) | |
82 | { |
|
81 | { | |
83 | nb_sm.f1 = 0; |
|
82 | nb_sm_before_f1.norm_bp1 = parameter_dump_packet.sy_lfr_n_bp_p0 * 16; | |
84 | nb_sm.norm_bp1_f1 = 0; |
|
83 | nb_sm_before_f1.norm_bp2 = parameter_dump_packet.sy_lfr_n_bp_p1 * 16; | |
85 | nb_sm.norm_bp2_f1 = 0; |
|
84 | nb_sm_before_f1.norm_asm = (parameter_dump_packet.sy_lfr_n_asm_p[0] * 256 + parameter_dump_packet.sy_lfr_n_asm_p[1]) * 16; | |
86 | nb_sm.norm_asm_f1 = 0; |
|
85 | nb_sm_before_f1.sbm2_bp1 = parameter_dump_packet.sy_lfr_s2_bp_p0 * 16; | |
87 | nb_sm.sbm_bp1_f1 = 0; |
|
86 | nb_sm_before_f1.sbm2_bp2 = parameter_dump_packet.sy_lfr_s2_bp_p1 * 16; | |
88 | nb_sm.sbm_bp2_f1 = 0; |
|
87 | nb_sm_before_f1.burst_bp1 = parameter_dump_packet.sy_lfr_b_bp_p0 * 16; | |
89 |
|
88 | nb_sm_before_f1.burst_bp2 = parameter_dump_packet.sy_lfr_b_bp_p1 * 16; | ||
90 | nb_sm_before_f1.norm_bp1_f1 = parameter_dump_packet.sy_lfr_n_bp_p0 * 16; |
|
|||
91 | nb_sm_before_f1.norm_bp2_f1 = parameter_dump_packet.sy_lfr_n_bp_p1 * 16; |
|
|||
92 | nb_sm_before_f1.norm_asm_f1 = (parameter_dump_packet.sy_lfr_n_asm_p[0] * 256 + parameter_dump_packet.sy_lfr_n_asm_p[1]) * 16; |
|
|||
93 | nb_sm_before_f1.sbm2_bp1_f1 = parameter_dump_packet.sy_lfr_s2_bp_p0 * 16; |
|
|||
94 | nb_sm_before_f1.sbm2_bp2_f1 = parameter_dump_packet.sy_lfr_s2_bp_p1 * 16; |
|
|||
95 | nb_sm_before_f1.burst_bp1_f1 = parameter_dump_packet.sy_lfr_b_bp_p0 * 16; |
|
|||
96 | nb_sm_before_f1.burst_bp2_f1 = parameter_dump_packet.sy_lfr_b_bp_p1 * 16; |
|
|||
97 |
|
89 | |||
98 | if (lfrMode == LFR_MODE_SBM2) |
|
90 | if (lfrMode == LFR_MODE_SBM2) | |
99 | { |
|
91 | { | |
100 |
nb_sm_before_f1.burst_sbm_bp1 |
|
92 | nb_sm_before_f1.burst_sbm_bp1 = nb_sm_before_f1.sbm2_bp1; | |
101 |
nb_sm_before_f1.burst_sbm_bp2 |
|
93 | nb_sm_before_f1.burst_sbm_bp2 = nb_sm_before_f1.sbm2_bp2; | |
102 | } |
|
94 | } | |
103 | else if (lfrMode == LFR_MODE_BURST) |
|
95 | else if (lfrMode == LFR_MODE_BURST) | |
104 | { |
|
96 | { | |
105 |
nb_sm_before_f1.burst_sbm_bp1 |
|
97 | nb_sm_before_f1.burst_sbm_bp1 = nb_sm_before_f1.burst_bp1; | |
106 |
nb_sm_before_f1.burst_sbm_bp2 |
|
98 | nb_sm_before_f1.burst_sbm_bp2 = nb_sm_before_f1.burst_bp2; | |
107 | } |
|
99 | } | |
108 | else |
|
100 | else | |
109 | { |
|
101 | { | |
110 |
nb_sm_before_f1.burst_sbm_bp1 |
|
102 | nb_sm_before_f1.burst_sbm_bp1 = nb_sm_before_f1.burst_bp1; | |
111 |
nb_sm_before_f1.burst_sbm_bp2 |
|
103 | nb_sm_before_f1.burst_sbm_bp2 = nb_sm_before_f1.burst_bp2; | |
112 | } |
|
104 | } | |
113 | } |
|
105 | } | |
114 |
|
106 | |||
115 | void reset_nb_sm_f2( unsigned char lfrMode ) |
|
107 | void reset_nb_sm_f2( unsigned char lfrMode ) | |
116 | { |
|
108 | { | |
117 | nb_sm.f2 = 0; |
|
|||
118 | nb_sm.norm_bp1_f2 = 0; |
|
|||
119 | nb_sm.norm_bp2_f2 = 0; |
|
|||
120 | nb_sm.norm_asm_f2 = 0; |
|
|||
121 | nb_sm.sbm_bp1_f2 = 0; |
|
|||
122 | nb_sm.sbm_bp2_f2 = 0; |
|
|||
123 |
|
||||
124 | nb_sm_before_f2.norm_bp1_f2 = parameter_dump_packet.sy_lfr_n_bp_p0; |
|
109 | nb_sm_before_f2.norm_bp1_f2 = parameter_dump_packet.sy_lfr_n_bp_p0; | |
125 | nb_sm_before_f2.norm_bp2_f2 = parameter_dump_packet.sy_lfr_n_bp_p1; |
|
110 | nb_sm_before_f2.norm_bp2_f2 = parameter_dump_packet.sy_lfr_n_bp_p1; | |
126 | nb_sm_before_f2.norm_asm_f2 = parameter_dump_packet.sy_lfr_n_asm_p[0] * 256 + parameter_dump_packet.sy_lfr_n_asm_p[1]; |
|
111 | nb_sm_before_f2.norm_asm_f2 = parameter_dump_packet.sy_lfr_n_asm_p[0] * 256 + parameter_dump_packet.sy_lfr_n_asm_p[1]; | |
127 | nb_sm_before_f2.sbm2_bp1_f2 = parameter_dump_packet.sy_lfr_s2_bp_p0; |
|
112 | nb_sm_before_f2.sbm2_bp1_f2 = parameter_dump_packet.sy_lfr_s2_bp_p0; | |
128 | nb_sm_before_f2.sbm2_bp2_f2 = parameter_dump_packet.sy_lfr_s2_bp_p1; |
|
113 | nb_sm_before_f2.sbm2_bp2_f2 = parameter_dump_packet.sy_lfr_s2_bp_p1; | |
129 | nb_sm_before_f2.burst_bp1_f2 = parameter_dump_packet.sy_lfr_b_bp_p0; |
|
114 | nb_sm_before_f2.burst_bp1_f2 = parameter_dump_packet.sy_lfr_b_bp_p0; | |
130 | nb_sm_before_f2.burst_bp2_f2 = parameter_dump_packet.sy_lfr_b_bp_p1; |
|
115 | nb_sm_before_f2.burst_bp2_f2 = parameter_dump_packet.sy_lfr_b_bp_p1; | |
131 |
|
116 | |||
132 | if (lfrMode == LFR_MODE_SBM2) |
|
117 | if (lfrMode == LFR_MODE_SBM2) | |
133 | { |
|
118 | { | |
134 | nb_sm_before_f2.burst_sbm_bp1_f2 = nb_sm_before_f2.sbm2_bp1_f2; |
|
119 | nb_sm_before_f2.burst_sbm_bp1_f2 = nb_sm_before_f2.sbm2_bp1_f2; | |
135 | nb_sm_before_f2.burst_sbm_bp2_f2 = nb_sm_before_f2.sbm2_bp2_f2; |
|
120 | nb_sm_before_f2.burst_sbm_bp2_f2 = nb_sm_before_f2.sbm2_bp2_f2; | |
136 | } |
|
121 | } | |
137 | else if (lfrMode == LFR_MODE_BURST) |
|
122 | else if (lfrMode == LFR_MODE_BURST) | |
138 | { |
|
123 | { | |
139 | nb_sm_before_f2.burst_sbm_bp1_f2 = nb_sm_before_f2.burst_bp1_f2; |
|
124 | nb_sm_before_f2.burst_sbm_bp1_f2 = nb_sm_before_f2.burst_bp1_f2; | |
140 | nb_sm_before_f2.burst_sbm_bp2_f2 = nb_sm_before_f2.burst_bp2_f2; |
|
125 | nb_sm_before_f2.burst_sbm_bp2_f2 = nb_sm_before_f2.burst_bp2_f2; | |
141 | } |
|
126 | } | |
142 | else |
|
127 | else | |
143 | { |
|
128 | { | |
144 | nb_sm_before_f2.burst_sbm_bp1_f2 = nb_sm_before_f2.burst_bp1_f2; |
|
129 | nb_sm_before_f2.burst_sbm_bp1_f2 = nb_sm_before_f2.burst_bp1_f2; | |
145 | nb_sm_before_f2.burst_sbm_bp2_f2 = nb_sm_before_f2.burst_bp2_f2; |
|
130 | nb_sm_before_f2.burst_sbm_bp2_f2 = nb_sm_before_f2.burst_bp2_f2; | |
146 | } |
|
131 | } | |
147 | } |
|
132 | } | |
148 |
|
133 | |||
149 | rtems_isr spectral_matrices_isr( rtems_vector_number vector ) |
|
134 | rtems_isr spectral_matrices_isr( rtems_vector_number vector ) | |
150 | { |
|
135 | { | |
151 | ring_node_sm *previous_ring_node_sm_f0; |
|
136 | ring_node_sm *previous_ring_node_sm_f0; | |
152 |
|
137 | |||
153 | // rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 ); |
|
138 | // rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 ); | |
154 |
|
139 | |||
155 | previous_ring_node_sm_f0 = current_ring_node_sm_f0; |
|
140 | previous_ring_node_sm_f0 = current_ring_node_sm_f0; | |
156 |
|
141 | |||
157 | if ( (spectral_matrix_regs->status & 0x2) == 0x02) // check ready matrix bit f0_1 |
|
142 | if ( (spectral_matrix_regs->status & 0x2) == 0x02) // check ready matrix bit f0_1 | |
158 | { |
|
143 | { | |
159 | current_ring_node_sm_f0 = current_ring_node_sm_f0->next; |
|
144 | current_ring_node_sm_f0 = current_ring_node_sm_f0->next; | |
160 | spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address; |
|
145 | spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address; | |
161 | spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffd; // 1101 |
|
146 | spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffffd; // 1101 | |
162 |
nb_sm |
|
147 | nb_sm_f0 = nb_sm_f0 + 1; | |
163 | } |
|
148 | } | |
164 |
|
149 | |||
165 | //************************ |
|
150 | //************************ | |
166 | // reset status error bits |
|
151 | // reset status error bits | |
167 | if ( (spectral_matrix_regs->status & 0x30) != 0x00) |
|
152 | if ( (spectral_matrix_regs->status & 0x30) != 0x00) | |
168 | { |
|
153 | { | |
169 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 ); |
|
154 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_8 ); | |
170 | spectral_matrix_regs->status = spectral_matrix_regs->status & 0xffffffcf; // 1100 1111 |
|
155 | spectral_matrix_regs->status = spectral_matrix_regs->status & 0xffffffcf; // 1100 1111 | |
171 | } |
|
156 | } | |
172 |
|
157 | |||
173 | //************************************** |
|
158 | //************************************** | |
174 | // reset ready matrix bits for f0_0, f1 and f2 |
|
159 | // reset ready matrix bits for f0_0, f1 and f2 | |
175 | spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffff2; // 0010 |
|
160 | spectral_matrix_regs->status = spectral_matrix_regs->status & 0xfffffff2; // 0010 | |
176 |
|
161 | |||
177 |
if (nb_sm |
|
162 | if (nb_sm_f0 == NB_SM_BEFORE_AVF0) | |
178 | { |
|
163 | { | |
179 | ring_node_for_averaging_sm_f0 = previous_ring_node_sm_f0; |
|
164 | ring_node_for_averaging_sm_f0 = previous_ring_node_sm_f0; | |
180 | if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) |
|
165 | if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) | |
181 | { |
|
166 | { | |
182 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); |
|
167 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); | |
183 | } |
|
168 | } | |
184 |
nb_sm |
|
169 | nb_sm_f0 = 0; | |
185 | } |
|
170 | } | |
186 |
|
171 | |||
187 | } |
|
172 | } | |
188 |
|
173 | |||
189 | rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector ) |
|
174 | rtems_isr spectral_matrices_isr_simu( rtems_vector_number vector ) | |
190 | { |
|
175 | { | |
191 |
if (nb_sm |
|
176 | if (nb_sm_f0 == (NB_SM_BEFORE_AVF0-1) ) | |
192 | { |
|
177 | { | |
193 | ring_node_for_averaging_sm_f0 = current_ring_node_sm_f0; |
|
178 | ring_node_for_averaging_sm_f0 = current_ring_node_sm_f0; | |
194 | if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) |
|
179 | if (rtems_event_send( Task_id[TASKID_AVF0], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) | |
195 | { |
|
180 | { | |
196 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); |
|
181 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_3 ); | |
197 | } |
|
182 | } | |
198 |
nb_sm |
|
183 | nb_sm_f0 = 0; | |
199 | } |
|
184 | } | |
200 | else |
|
185 | else | |
201 | { |
|
186 | { | |
202 |
nb_sm |
|
187 | nb_sm_f0 = nb_sm_f0 + 1; | |
203 | } |
|
188 | } | |
204 | } |
|
189 | } | |
205 |
|
190 | |||
206 | //************ |
|
191 | //************ | |
207 | // RTEMS TASKS |
|
192 | // RTEMS TASKS | |
208 |
|
193 | |||
209 | rtems_task smiq_task( rtems_task_argument argument ) // process the Spectral Matrices IRQ |
|
194 | //***************** | |
210 | { |
|
195 | // PROCESSING AT F0 | |
211 | rtems_event_set event_out; |
|
|||
212 |
|
||||
213 | BOOT_PRINTF("in SMIQ *** \n") |
|
|||
214 |
|
||||
215 | while(1){ |
|
|||
216 | rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0 |
|
|||
217 | } |
|
|||
218 | } |
|
|||
219 |
|
196 | |||
220 | rtems_task avf0_task( rtems_task_argument lfrRequestedMode ) |
|
197 | rtems_task avf0_task( rtems_task_argument lfrRequestedMode ) | |
221 | { |
|
198 | { | |
222 | int i; |
|
199 | int i; | |
223 |
|
200 | |||
224 | rtems_event_set event_out; |
|
201 | rtems_event_set event_out; | |
225 | rtems_status_code status; |
|
202 | rtems_status_code status; | |
226 | rtems_id queue_id_prc0; |
|
203 | rtems_id queue_id_prc0; | |
227 | asm_msg msgForMATR; |
|
204 | asm_msg msgForMATR; | |
228 | ring_node_sm *ring_node_tab[8]; |
|
205 | ring_node_sm *ring_node_tab[8]; | |
229 |
|
206 | |||
|
207 | static unsigned int nb_norm_bp1; | |||
|
208 | static unsigned int nb_norm_bp2; | |||
|
209 | static unsigned int nb_norm_asm; | |||
|
210 | static unsigned int nb_sbm_bp1; | |||
|
211 | static unsigned int nb_sbm_bp2; | |||
|
212 | ||||
|
213 | nb_norm_bp1 = 0; | |||
|
214 | nb_norm_bp2 = 0; | |||
|
215 | nb_norm_asm = 0; | |||
|
216 | nb_sbm_bp1 = 0; | |||
|
217 | nb_sbm_bp2 = 0; | |||
|
218 | ||||
230 | reset_nb_sm_f0( lfrRequestedMode ); // reset the sm counters that drive the BP and ASM computations / transmissions |
|
219 | reset_nb_sm_f0( lfrRequestedMode ); // reset the sm counters that drive the BP and ASM computations / transmissions | |
231 |
|
220 | |||
232 | BOOT_PRINTF1("in AVFO *** lfrRequestedMode = %d\n", lfrRequestedMode) |
|
221 | BOOT_PRINTF1("in AVFO *** lfrRequestedMode = %d\n", (int) lfrRequestedMode) | |
233 |
|
222 | |||
234 | status = get_message_queue_id_prc0( &queue_id_prc0 ); |
|
223 | status = get_message_queue_id_prc0( &queue_id_prc0 ); | |
235 | if (status != RTEMS_SUCCESSFUL) |
|
224 | if (status != RTEMS_SUCCESSFUL) | |
236 | { |
|
225 | { | |
237 | PRINTF1("in MATR *** ERR get_message_queue_id_prc0 %d\n", status) |
|
226 | PRINTF1("in MATR *** ERR get_message_queue_id_prc0 %d\n", status) | |
238 | } |
|
227 | } | |
239 |
|
228 | |||
240 | while(1){ |
|
229 | while(1){ | |
241 | rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0 |
|
230 | rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0 | |
242 | ring_node_tab[NB_SM_BEFORE_AVF0-1] = ring_node_for_averaging_sm_f0; |
|
231 | ring_node_tab[NB_SM_BEFORE_AVF0-1] = ring_node_for_averaging_sm_f0; | |
243 | for ( i = 2; i < (NB_SM_BEFORE_AVF0+1); i++ ) |
|
232 | for ( i = 2; i < (NB_SM_BEFORE_AVF0+1); i++ ) | |
244 | { |
|
233 | { | |
245 | ring_node_for_averaging_sm_f0 = ring_node_for_averaging_sm_f0->previous; |
|
234 | ring_node_for_averaging_sm_f0 = ring_node_for_averaging_sm_f0->previous; | |
246 | ring_node_tab[NB_SM_BEFORE_AVF0-i] = ring_node_for_averaging_sm_f0; |
|
235 | ring_node_tab[NB_SM_BEFORE_AVF0-i] = ring_node_for_averaging_sm_f0; | |
247 | } |
|
236 | } | |
248 |
|
237 | |||
249 | // compute the average and store it in the averaged_sm_f1 buffer |
|
238 | // compute the average and store it in the averaged_sm_f1 buffer | |
250 | SM_average( current_ring_node_asm_norm_f0->matrix, |
|
239 | SM_average( current_ring_node_asm_norm_f0->matrix, | |
251 | current_ring_node_asm_burst_sbm_f0->matrix, |
|
240 | current_ring_node_asm_burst_sbm_f0->matrix, | |
252 | ring_node_tab, |
|
241 | ring_node_tab, | |
253 |
nb_ |
|
242 | nb_norm_bp1, nb_sbm_bp1 ); | |
254 |
|
243 | |||
255 | // update nb_average |
|
244 | // update nb_average | |
256 |
nb_ |
|
245 | nb_norm_bp1 = nb_norm_bp1 + NB_SM_BEFORE_AVF0; | |
257 |
nb_ |
|
246 | nb_norm_bp2 = nb_norm_bp2 + NB_SM_BEFORE_AVF0; | |
258 |
nb_ |
|
247 | nb_norm_asm = nb_norm_asm + NB_SM_BEFORE_AVF0; | |
259 |
nb_s |
|
248 | nb_sbm_bp1 = nb_sbm_bp1 + NB_SM_BEFORE_AVF0; | |
260 |
nb_s |
|
249 | nb_sbm_bp2 = nb_sbm_bp2 + NB_SM_BEFORE_AVF0; | |
261 |
|
250 | |||
262 | //**************************************** |
|
251 | //**************************************** | |
263 | // initialize the mesage for the MATR task |
|
252 | // initialize the mesage for the MATR task | |
264 | msgForMATR.event = 0x00; // this composite event will be sent to the MATR task |
|
253 | msgForMATR.event = 0x00; // this composite event will be sent to the MATR task | |
265 | msgForMATR.burst_sbm = current_ring_node_asm_burst_sbm_f0; |
|
254 | msgForMATR.burst_sbm = current_ring_node_asm_burst_sbm_f0; | |
266 | msgForMATR.norm = current_ring_node_asm_norm_f0; |
|
255 | msgForMATR.norm = current_ring_node_asm_norm_f0; | |
267 | msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0]; |
|
256 | msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0]; | |
268 | msgForMATR.fineTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[1]; |
|
257 | msgForMATR.fineTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[1]; | |
269 |
|
258 | |||
270 |
if (nb_s |
|
259 | if (nb_sbm_bp1 == nb_sm_before_f0.burst_sbm_bp1_f0) | |
271 | { |
|
260 | { | |
272 |
nb_s |
|
261 | nb_sbm_bp1 = 0; | |
273 | // set another ring for the ASM storage |
|
262 | // set another ring for the ASM storage | |
274 | current_ring_node_asm_burst_sbm_f0 = current_ring_node_asm_burst_sbm_f0->next; |
|
263 | current_ring_node_asm_burst_sbm_f0 = current_ring_node_asm_burst_sbm_f0->next; | |
275 | if ( (lfrCurrentMode == LFR_MODE_BURST) |
|
264 | if ( (lfrCurrentMode == LFR_MODE_BURST) | |
276 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
265 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
277 | { |
|
266 | { | |
278 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_SBM_BP1_F0; |
|
267 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_SBM_BP1_F0; | |
279 | } |
|
268 | } | |
280 | } |
|
269 | } | |
281 |
|
270 | |||
282 |
if (nb_s |
|
271 | if (nb_sbm_bp2 == nb_sm_before_f0.burst_sbm_bp2_f0) | |
283 | { |
|
272 | { | |
284 |
nb_s |
|
273 | nb_sbm_bp2 = 0; | |
285 | if ( (lfrCurrentMode == LFR_MODE_BURST) |
|
274 | if ( (lfrCurrentMode == LFR_MODE_BURST) | |
286 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
275 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
287 | { |
|
276 | { | |
288 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_SBM_BP2_F0; |
|
277 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_SBM_BP2_F0; | |
289 | } |
|
278 | } | |
290 | } |
|
279 | } | |
291 |
|
280 | |||
292 |
if (nb_ |
|
281 | if (nb_norm_bp1 == nb_sm_before_f0.norm_bp1_f0) | |
293 | { |
|
282 | { | |
294 |
nb_ |
|
283 | nb_norm_bp1 = 0; | |
295 | // set another ring for the ASM storage |
|
284 | // set another ring for the ASM storage | |
296 | current_ring_node_asm_norm_f0 = current_ring_node_asm_norm_f0->next; |
|
285 | current_ring_node_asm_norm_f0 = current_ring_node_asm_norm_f0->next; | |
297 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) |
|
286 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
298 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
287 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
299 | { |
|
288 | { | |
300 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP1_F0; |
|
289 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP1_F0; | |
301 | } |
|
290 | } | |
302 | } |
|
291 | } | |
303 |
|
292 | |||
304 |
if (nb_ |
|
293 | if (nb_norm_bp2 == nb_sm_before_f0.norm_bp2_f0) | |
305 | { |
|
294 | { | |
306 |
nb_ |
|
295 | nb_norm_bp2 = 0; | |
307 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) |
|
296 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
308 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
297 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
309 | { |
|
298 | { | |
310 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP2_F0; |
|
299 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP2_F0; | |
311 | } |
|
300 | } | |
312 | } |
|
301 | } | |
313 |
|
302 | |||
314 |
if (nb_ |
|
303 | if (nb_norm_asm == nb_sm_before_f0.norm_asm_f0) | |
315 | { |
|
304 | { | |
316 |
nb_ |
|
305 | nb_norm_asm = 0; | |
317 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) |
|
306 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
318 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
307 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
319 | { |
|
308 | { | |
320 | // PRINTF1("%lld\n", localTime) |
|
309 | // PRINTF1("%lld\n", localTime) | |
321 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_ASM_F0; |
|
310 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_ASM_F0; | |
322 | } |
|
311 | } | |
323 | } |
|
312 | } | |
324 |
|
313 | |||
325 | //************************* |
|
314 | //************************* | |
326 | // send the message to MATR |
|
315 | // send the message to MATR | |
327 | if (msgForMATR.event != 0x00) |
|
316 | if (msgForMATR.event != 0x00) | |
328 | { |
|
317 | { | |
329 |
status = rtems_message_queue_send( queue_id_prc0, (char *) & |
|
318 | status = rtems_message_queue_send( queue_id_prc0, (char *) &msgForMATR, MSG_QUEUE_SIZE_PRC0); | |
330 | } |
|
319 | } | |
331 |
|
320 | |||
332 | if (status != RTEMS_SUCCESSFUL) { |
|
321 | if (status != RTEMS_SUCCESSFUL) { | |
333 | printf("in AVF0 *** Error sending message to MATR, code %d\n", status); |
|
322 | printf("in AVF0 *** Error sending message to MATR, code %d\n", status); | |
334 | } |
|
323 | } | |
335 | } |
|
324 | } | |
336 | } |
|
325 | } | |
337 |
|
326 | |||
338 | rtems_task prc0_task( rtems_task_argument lfrRequestedMode ) |
|
327 | rtems_task prc0_task( rtems_task_argument lfrRequestedMode ) | |
339 | { |
|
328 | { | |
340 |
|
|
329 | char incomingData[MSG_QUEUE_SIZE_SEND]; // incoming data buffer | |
341 |
|
|
330 | size_t size; // size of the incoming TC packet | |
342 |
|
|
331 | asm_msg *incomingMsg; | |
343 |
|
|
332 | // | |
344 |
|
|
333 | spw_ioctl_pkt_send spw_ioctl_send_ASM; | |
345 |
|
|
334 | rtems_status_code status; | |
346 |
|
|
335 | rtems_id queue_id; | |
347 |
|
|
336 | rtems_id queue_id_q_p0; | |
348 |
|
|
337 | Header_TM_LFR_SCIENCE_ASM_t headerASM; | |
349 |
|
|
338 | bp_packet_with_spare packet_norm_bp1_f0; | |
350 |
|
|
339 | bp_packet packet_norm_bp2_f0; | |
351 |
|
|
340 | bp_packet packet_sbm_bp1_f0; | |
352 |
|
|
341 | bp_packet packet_sbm_bp2_f0; | |
353 |
|
342 | |||
354 |
|
|
343 | unsigned long long int localTime; | |
355 |
|
344 | |||
356 |
|
|
345 | ASM_init_header( &headerASM ); | |
357 |
|
346 | |||
358 |
|
|
347 | //************* | |
359 |
|
|
348 | // NORM headers | |
360 |
|
|
349 | BP_init_header_with_spare( &packet_norm_bp1_f0.header, | |
361 |
|
|
350 | APID_TM_SCIENCE_NORMAL_BURST, SID_NORM_BP1_F0, | |
362 |
|
|
351 | PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0, NB_BINS_COMPRESSED_SM_F0 ); | |
363 |
|
|
352 | BP_init_header( &packet_norm_bp2_f0.header, | |
364 |
|
|
353 | APID_TM_SCIENCE_NORMAL_BURST, SID_NORM_BP2_F0, | |
365 |
|
|
354 | PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0, NB_BINS_COMPRESSED_SM_F0); | |
366 |
|
355 | |||
367 |
|
|
356 | //**************************** | |
368 |
|
|
357 | // BURST SBM1 and SBM2 headers | |
369 |
|
|
358 | if ( lfrRequestedMode == LFR_MODE_BURST ) | |
370 | // || (lfrRequestedMode == LFR_MODE_NORMAL) || (lfrRequestedMode == LFR_MODE_STANDBY) ) |
|
359 | { | |
371 | // { |
|
360 | BP_init_header( &packet_sbm_bp1_f0.header, | |
372 | // BP_init_header( ¤t_node_sbm_bp1_f0.header, |
|
361 | APID_TM_SCIENCE_NORMAL_BURST, SID_BURST_BP1_F0, | |
373 | // APID_TM_SCIENCE_NORMAL_BURST, SID_BURST_BP1_F0, |
|
362 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
374 | // PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0, NB_BINS_COMPRESSED_SM_SBM_F0); |
|
363 | BP_init_header( &packet_sbm_bp2_f0.header, | |
375 | // BP_init_header( ¤t_node_sbm_bp2_f0.header, |
|
364 | APID_TM_SCIENCE_NORMAL_BURST, SID_BURST_BP2_F0, | |
376 | // APID_TM_SCIENCE_NORMAL_BURST, SID_BURST_BP2_F0, |
|
365 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
377 | // PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0, NB_BINS_COMPRESSED_SM_SBM_F0); |
|
366 | } | |
378 | // } |
|
367 | else if ( lfrRequestedMode == LFR_MODE_SBM1 ) | |
379 | // else if ( lfrRequestedMode == LFR_MODE_SBM1 ) |
|
368 | { | |
380 | // { |
|
369 | BP_init_header( &packet_sbm_bp1_f0.header, | |
381 | // BP_init_header( ¤t_node_sbm_bp1_f0.header, |
|
370 | APID_TM_SCIENCE_SBM1_SBM2, SID_SBM1_BP1_F0, | |
382 | // APID_TM_SCIENCE_SBM1_SBM2, SID_SBM1_BP1_F0, |
|
371 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
383 | // PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0, NB_BINS_COMPRESSED_SM_SBM_F0); |
|
372 | BP_init_header( &packet_sbm_bp2_f0.header, | |
384 | // BP_init_header( ¤t_node_sbm_bp2_f0.header, |
|
373 | APID_TM_SCIENCE_SBM1_SBM2, SID_SBM1_BP2_F0, | |
385 | // APID_TM_SCIENCE_SBM1_SBM2, SID_SBM1_BP2_F0, |
|
374 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
386 | // PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0, NB_BINS_COMPRESSED_SM_SBM_F0); |
|
375 | } | |
387 | // } |
|
376 | else if ( lfrRequestedMode == LFR_MODE_SBM2 ) | |
388 | // else if ( lfrRequestedMode == LFR_MODE_SBM2 ) |
|
377 | { | |
389 | // { |
|
378 | BP_init_header( &packet_sbm_bp1_f0.header, | |
390 | // BP_init_header( ¤t_node_sbm_bp1_f0.header, |
|
379 | APID_TM_SCIENCE_SBM1_SBM2, SID_SBM2_BP1_F0, | |
391 | // APID_TM_SCIENCE_SBM1_SBM2, SID_SBM2_BP1_F0, |
|
380 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
392 | // PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0, NB_BINS_COMPRESSED_SM_SBM_F0); |
|
381 | BP_init_header( &packet_sbm_bp2_f0.header, | |
393 | // BP_init_header( ¤t_node_sbm_bp2_f0.header, |
|
382 | APID_TM_SCIENCE_SBM1_SBM2, SID_SBM2_BP2_F0, | |
394 | // APID_TM_SCIENCE_SBM1_SBM2, SID_SBM2_BP2_F0, |
|
383 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0, NB_BINS_COMPRESSED_SM_SBM_F0); | |
395 | // PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0, NB_BINS_COMPRESSED_SM_SBM_F0); |
|
384 | } | |
396 | // } |
|
385 | else | |
397 | // else |
|
386 | { | |
398 | // { |
|
387 | PRINTF1("in PRC0 *** lfrRequestedMode is %d, several headers not initialized\n", (unsigned int) lfrRequestedMode) | |
399 | // PRINTF1("ERR *** in MATR *** unexpected lfrRequestedMode passed as argument = %d\n", (unsigned int) lfrRequestedMode) |
|
388 | } | |
400 | // } |
|
|||
401 |
|
389 | |||
402 |
|
|
390 | status = get_message_queue_id_send( &queue_id ); | |
403 |
|
|
391 | if (status != RTEMS_SUCCESSFUL) | |
404 |
|
|
392 | { | |
405 |
|
|
393 | PRINTF1("in PRC0 *** ERR get_message_queue_id_send %d\n", status) | |
406 |
|
|
394 | } | |
407 |
|
|
395 | status = get_message_queue_id_prc0( &queue_id_q_p0); | |
408 |
|
|
396 | if (status != RTEMS_SUCCESSFUL) | |
409 |
|
|
397 | { | |
410 |
|
|
398 | PRINTF1("in PRC0 *** ERR get_message_queue_id_prc0 %d\n", status) | |
411 |
|
|
399 | } | |
412 |
|
400 | |||
413 |
|
|
401 | BOOT_PRINTF1("in PRC0 *** lfrRequestedMode = %d\n", (int) lfrRequestedMode) | |
414 |
|
402 | |||
415 |
|
|
403 | while(1){ | |
416 |
|
|
404 | status = rtems_message_queue_receive( queue_id_q_p0, incomingData, &size, //************************************ | |
417 |
|
|
405 | RTEMS_WAIT, RTEMS_NO_TIMEOUT ); // wait for a message coming from AVF0 | |
|
406 | ||||
|
407 | incomingMsg = (asm_msg*) incomingData; | |||
418 |
|
408 | |||
419 | // incomingMsg = (asm_msg*) incomingData; |
|
409 | localTime = getTimeAsUnsignedLongLongInt( ); | |
420 |
|
410 | //**************** | ||
421 | // localTime = getTimeAsUnsignedLongLongInt( ); |
|
411 | //**************** | |
422 | // //**************** |
|
412 | // BURST SBM1 SBM2 | |
423 |
|
|
413 | //**************** | |
424 | // // BURST SBM1 SBM2 |
|
414 | //**************** | |
425 | // //**************** |
|
415 | if (incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP1_F0 ) | |
426 | // //**************** |
|
416 | { | |
427 | // if (incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP1_F0 ) |
|
417 | // 1) compress the matrix for Basic Parameters calculation | |
428 | // { |
|
418 | ASM_compress_reorganize_and_divide( incomingMsg->burst_sbm->matrix, compressed_sm_sbm, | |
429 | // // 1) compress the matrix for Basic Parameters calculation |
|
419 | nb_sm_before_f0.burst_sbm_bp1_f0, | |
430 | // ASM_compress_reorganize_and_divide( incomingMsg->burst_sbm->matrix, compressed_sm_sbm, |
|
420 | NB_BINS_COMPRESSED_SM_SBM_F0, NB_BINS_TO_AVERAGE_ASM_SBM_F0, | |
431 |
|
|
421 | ASM_F0_INDICE_START); | |
432 | // NB_BINS_COMPRESSED_SM_SBM_F0, NB_BINS_TO_AVERAGE_ASM_SBM_F0, |
|
422 | // 2) compute the BP1 set | |
433 | // ASM_F0_INDICE_START); |
|
|||
434 | // // 2) compute the BP1 set |
|
|||
435 |
|
423 | |||
436 |
|
|
424 | // 3) send the BP1 set | |
437 |
|
|
425 | set_time( packet_sbm_bp1_f0.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |
438 |
|
|
426 | set_time( packet_sbm_bp1_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |
439 |
|
|
427 | BP_send( (char *) &packet_sbm_bp1_f0.header, queue_id, | |
440 |
|
|
428 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0 + PACKET_LENGTH_DELTA); | |
441 |
|
|
429 | // 4) compute the BP2 set if needed | |
442 |
|
|
430 | if ( incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP2_F0 ) | |
443 |
|
|
431 | { | |
444 |
|
|
432 | // 1) compute the BP2 set | |
445 |
|
433 | |||
446 |
|
|
434 | // 2) send the BP2 set | |
447 |
|
|
435 | set_time( packet_sbm_bp2_f0.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |
448 |
|
|
436 | set_time( packet_sbm_bp2_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |
449 |
|
|
437 | BP_send( (char *) &packet_sbm_bp2_f0.header, queue_id, | |
450 |
|
|
438 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0 + PACKET_LENGTH_DELTA); | |
451 |
|
|
439 | } | |
452 |
|
|
440 | } | |
453 |
|
441 | |||
454 |
|
|
442 | //***** | |
455 |
|
|
443 | //***** | |
456 |
|
|
444 | // NORM | |
457 |
|
|
445 | //***** | |
458 |
|
|
446 | //***** | |
459 |
|
|
447 | if (incomingMsg->event & RTEMS_EVENT_NORM_BP1_F0) | |
460 |
|
|
448 | { | |
461 |
|
|
449 | // 1) compress the matrix for Basic Parameters calculation | |
462 |
|
|
450 | ASM_compress_reorganize_and_divide( incomingMsg->norm->matrix, compressed_sm_norm_f0, | |
463 |
|
|
451 | nb_sm_before_f0.norm_bp1_f0, | |
464 |
|
|
452 | NB_BINS_COMPRESSED_SM_F0, NB_BINS_TO_AVERAGE_ASM_F0, | |
465 |
|
|
453 | ASM_F0_INDICE_START ); | |
466 |
|
|
454 | // 2) compute the BP1 set | |
467 |
|
455 | |||
468 |
|
|
456 | // 3) send the BP1 set | |
469 |
|
|
457 | set_time( packet_norm_bp1_f0.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |
470 |
|
|
458 | set_time( packet_norm_bp1_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |
471 |
|
|
459 | BP_send( (char *) &packet_norm_bp1_f0.header, queue_id, | |
472 |
|
|
460 | PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F0 + PACKET_LENGTH_DELTA); | |
473 |
|
|
461 | if (incomingMsg->event & RTEMS_EVENT_NORM_BP2_F0) | |
474 |
|
|
462 | { | |
475 |
|
|
463 | // 1) compute the BP2 set | |
476 |
|
464 | |||
477 |
|
|
465 | // 2) send the BP2 set | |
478 |
|
|
466 | set_time( packet_norm_bp2_f0.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |
479 |
|
|
467 | set_time( packet_norm_bp2_f0.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |
480 |
|
|
468 | BP_send( (char *) &packet_norm_bp2_f0.header, queue_id, | |
481 |
|
|
469 | PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F0 + PACKET_LENGTH_DELTA); | |
482 |
|
|
470 | } | |
483 |
|
|
471 | } | |
484 |
|
472 | |||
485 |
|
|
473 | if (incomingMsg->event & RTEMS_EVENT_NORM_ASM_F0) | |
486 |
|
|
474 | { | |
487 |
|
|
475 | // 1) reorganize the ASM and divide | |
488 |
|
|
476 | ASM_reorganize_and_divide( incomingMsg->norm->matrix, asm_f0_reorganized, NB_SM_BEFORE_NORM_BP1_F0 ); | |
489 |
|
|
477 | // 2) convert the float array in a char array | |
490 |
|
|
478 | ASM_convert( asm_f0_reorganized, asm_f0_char); | |
491 |
|
|
479 | // 3) send the spectral matrix packets | |
492 |
|
|
480 | set_time( headerASM.time , (unsigned char *) &incomingMsg->coarseTime ); | |
493 |
|
|
481 | set_time( headerASM.acquisitionTime, (unsigned char *) &incomingMsg->coarseTime ); | |
494 |
|
|
482 | ASM_send( &headerASM, asm_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM, queue_id); | |
495 |
|
|
483 | } | |
496 |
|
484 | |||
497 |
|
|
485 | } | |
498 | } |
|
486 | } | |
499 |
|
487 | |||
|
488 | //***************** | |||
|
489 | // PROCESSING AT F1 | |||
|
490 | ||||
500 | rtems_task avf1_task( rtems_task_argument lfrRequestedMode ) |
|
491 | rtems_task avf1_task( rtems_task_argument lfrRequestedMode ) | |
501 | { |
|
492 | { | |
502 | int i; |
|
493 | int i; | |
503 |
|
494 | |||
504 | rtems_event_set event_out; |
|
495 | rtems_event_set event_out; | |
505 | rtems_status_code status; |
|
496 | rtems_status_code status; | |
506 | rtems_id queue_id_prc1; |
|
497 | rtems_id queue_id_prc1; | |
507 | asm_msg msgForMATR; |
|
498 | asm_msg msgForMATR; | |
508 | ring_node_sm *ring_node_tab[8]; |
|
499 | ring_node_sm *ring_node_tab[8]; | |
509 |
|
500 | |||
|
501 | static unsigned int nb_norm_bp1; | |||
|
502 | static unsigned int nb_norm_bp2; | |||
|
503 | static unsigned int nb_norm_asm; | |||
|
504 | static unsigned int nb_sbm_bp1; | |||
|
505 | static unsigned int nb_sbm_bp2; | |||
|
506 | ||||
|
507 | nb_norm_bp1 = 0; | |||
|
508 | nb_norm_bp2 = 0; | |||
|
509 | nb_norm_asm = 0; | |||
|
510 | nb_sbm_bp1 = 0; | |||
|
511 | nb_sbm_bp2 = 0; | |||
|
512 | ||||
510 | reset_nb_sm_f1( lfrRequestedMode ); // reset the sm counters that drive the BP and ASM computations / transmissions |
|
513 | reset_nb_sm_f1( lfrRequestedMode ); // reset the sm counters that drive the BP and ASM computations / transmissions | |
511 |
|
514 | |||
512 | BOOT_PRINTF1("in AVF1 *** lfrRequestedMode = %d\n", lfrRequestedMode) |
|
515 | BOOT_PRINTF1("in AVF1 *** lfrRequestedMode = %d\n", (int) lfrRequestedMode) | |
513 |
|
516 | |||
514 | status = get_message_queue_id_prc1( &queue_id_prc1 ); |
|
517 | status = get_message_queue_id_prc1( &queue_id_prc1 ); | |
515 | if (status != RTEMS_SUCCESSFUL) |
|
518 | if (status != RTEMS_SUCCESSFUL) | |
516 | { |
|
519 | { | |
517 |
PRINTF1("in |
|
520 | PRINTF1("in AVF1 *** ERR get_message_queue_id_prc1 %d\n", status) | |
518 | } |
|
521 | } | |
519 |
|
522 | |||
520 | while(1){ |
|
523 | while(1){ | |
521 | rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0 |
|
524 | rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0 | |
522 | ring_node_tab[NB_SM_BEFORE_AVF1-1] = ring_node_for_averaging_sm_f1; |
|
525 | ring_node_tab[NB_SM_BEFORE_AVF1-1] = ring_node_for_averaging_sm_f1; | |
523 | for ( i = 2; i < (NB_SM_BEFORE_AVF1+1); i++ ) |
|
526 | for ( i = 2; i < (NB_SM_BEFORE_AVF1+1); i++ ) | |
524 | { |
|
527 | { | |
525 |
ring_node_for_averaging_sm_f |
|
528 | ring_node_for_averaging_sm_f1 = ring_node_for_averaging_sm_f1->previous; | |
526 |
ring_node_tab[NB_SM_BEFORE_AVF1-i] = ring_node_for_averaging_sm_f |
|
529 | ring_node_tab[NB_SM_BEFORE_AVF1-i] = ring_node_for_averaging_sm_f1; | |
527 | } |
|
530 | } | |
528 |
|
531 | |||
529 | // compute the average and store it in the averaged_sm_f1 buffer |
|
532 | // compute the average and store it in the averaged_sm_f1 buffer | |
530 | SM_average( current_ring_node_asm_norm_f1->matrix, |
|
533 | SM_average( current_ring_node_asm_norm_f1->matrix, | |
531 | current_ring_node_asm_burst_sbm_f1->matrix, |
|
534 | current_ring_node_asm_burst_sbm_f1->matrix, | |
532 | ring_node_tab, |
|
535 | ring_node_tab, | |
533 |
nb_ |
|
536 | nb_norm_bp1, nb_sbm_bp1 ); | |
534 |
|
537 | |||
535 | // update nb_average |
|
538 | // update nb_average | |
536 |
nb_ |
|
539 | nb_norm_bp1 = nb_norm_bp1 + NB_SM_BEFORE_AVF1; | |
537 |
nb_ |
|
540 | nb_norm_bp2 = nb_norm_bp2 + NB_SM_BEFORE_AVF1; | |
538 |
nb_ |
|
541 | nb_norm_asm = nb_norm_asm + NB_SM_BEFORE_AVF1; | |
539 |
nb_s |
|
542 | nb_sbm_bp1 = nb_sbm_bp1 + NB_SM_BEFORE_AVF1; | |
540 |
nb_s |
|
543 | nb_sbm_bp2 = nb_sbm_bp2 + NB_SM_BEFORE_AVF1; | |
541 |
|
544 | |||
542 | //**************************************** |
|
545 | //**************************************** | |
543 | // initialize the mesage for the MATR task |
|
546 | // initialize the mesage for the MATR task | |
544 |
msgForMATR.event = 0x00; // this composite event will be sent to the |
|
547 | msgForMATR.event = 0x00; // this composite event will be sent to the PRC1 task | |
545 | msgForMATR.burst_sbm = current_ring_node_asm_burst_sbm_f1; |
|
548 | msgForMATR.burst_sbm = current_ring_node_asm_burst_sbm_f1; | |
546 | msgForMATR.norm = current_ring_node_asm_norm_f1; |
|
549 | msgForMATR.norm = current_ring_node_asm_norm_f1; | |
547 | msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0]; |
|
550 | msgForMATR.coarseTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[0]; | |
548 | msgForMATR.fineTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[1]; |
|
551 | msgForMATR.fineTime = ( (unsigned int *) (ring_node_tab[0]->buffer_address) )[1]; | |
549 |
|
552 | |||
550 |
if (nb_s |
|
553 | if (nb_sbm_bp1 == nb_sm_before_f1.burst_sbm_bp1) | |
551 | { |
|
554 | { | |
552 |
nb_s |
|
555 | nb_sbm_bp1 = 0; | |
553 | // set another ring for the ASM storage |
|
556 | // set another ring for the ASM storage | |
554 |
current_ring_node_asm_burst_sbm_f |
|
557 | current_ring_node_asm_burst_sbm_f1 = current_ring_node_asm_burst_sbm_f1->next; | |
555 | if ( (lfrCurrentMode == LFR_MODE_BURST) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
558 | if ( (lfrCurrentMode == LFR_MODE_BURST) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
556 | { |
|
559 | { | |
557 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_SBM_BP1_F1; |
|
560 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_SBM_BP1_F1; | |
558 | } |
|
561 | } | |
559 | } |
|
562 | } | |
560 |
|
563 | |||
561 |
if (nb_s |
|
564 | if (nb_sbm_bp2 == nb_sm_before_f1.burst_sbm_bp2) | |
562 | { |
|
565 | { | |
563 |
nb_s |
|
566 | nb_sbm_bp2 = 0; | |
564 | if ( (lfrCurrentMode == LFR_MODE_BURST) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
567 | if ( (lfrCurrentMode == LFR_MODE_BURST) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
565 | { |
|
568 | { | |
566 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_SBM_BP2_F1; |
|
569 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_BURST_SBM_BP2_F1; | |
567 | } |
|
570 | } | |
568 | } |
|
571 | } | |
569 |
|
572 | |||
570 |
if (nb_ |
|
573 | if (nb_norm_bp1 == nb_sm_before_f1.norm_bp1) | |
571 | { |
|
574 | { | |
572 |
nb_ |
|
575 | nb_norm_bp1 = 0; | |
573 | // set another ring for the ASM storage |
|
576 | // set another ring for the ASM storage | |
574 |
current_ring_node_asm_norm_f |
|
577 | current_ring_node_asm_norm_f1 = current_ring_node_asm_norm_f1->next; | |
575 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) |
|
578 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
576 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
579 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
577 | { |
|
580 | { | |
578 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP1_F0; |
|
581 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP1_F0; | |
579 | } |
|
582 | } | |
580 | } |
|
583 | } | |
581 |
|
584 | |||
582 |
if (nb_ |
|
585 | if (nb_norm_bp2 == nb_sm_before_f1.norm_bp2) | |
583 | { |
|
586 | { | |
584 |
nb_ |
|
587 | nb_norm_bp2 = 0; | |
585 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) |
|
588 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
586 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
589 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
587 | { |
|
590 | { | |
588 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP2_F1; |
|
591 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_BP2_F1; | |
589 | } |
|
592 | } | |
590 | } |
|
593 | } | |
591 |
|
594 | |||
592 |
if (nb_ |
|
595 | if (nb_norm_asm == nb_sm_before_f1.norm_asm) | |
593 | { |
|
596 | { | |
594 |
nb_ |
|
597 | nb_norm_asm = 0; | |
595 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) |
|
598 | if ( (lfrCurrentMode == LFR_MODE_NORMAL) | |
596 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) |
|
599 | || (lfrCurrentMode == LFR_MODE_SBM1) || (lfrCurrentMode == LFR_MODE_SBM2) ) | |
597 | { |
|
600 | { | |
598 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_ASM_F1; |
|
601 | msgForMATR.event = msgForMATR.event | RTEMS_EVENT_NORM_ASM_F1; | |
599 | } |
|
602 | } | |
600 | } |
|
603 | } | |
601 |
|
604 | |||
602 | //************************* |
|
605 | //************************* | |
603 | // send the message to MATR |
|
606 | // send the message to MATR | |
604 | if (msgForMATR.event != 0x00) |
|
607 | if (msgForMATR.event != 0x00) | |
605 | { |
|
608 | { | |
606 |
status = rtems_message_queue_send( queue_id_prc1, (char *) & |
|
609 | status = rtems_message_queue_send( queue_id_prc1, (char *) &msgForMATR, MSG_QUEUE_SIZE_PRC1); | |
607 | } |
|
610 | } | |
608 |
|
611 | |||
609 | if (status != RTEMS_SUCCESSFUL) { |
|
612 | if (status != RTEMS_SUCCESSFUL) { | |
610 | printf("in AVF1 *** Error sending message to PRC1, code %d\n", status); |
|
613 | printf("in AVF1 *** Error sending message to PRC1, code %d\n", status); | |
611 | } |
|
614 | } | |
612 | } |
|
615 | } | |
613 | } |
|
616 | } | |
614 |
|
617 | |||
|
618 | rtems_task prc1_task( rtems_task_argument lfrRequestedMode ) | |||
|
619 | { | |||
|
620 | char incomingData[MSG_QUEUE_SIZE_SEND]; // incoming data buffer | |||
|
621 | size_t size; // size of the incoming TC packet | |||
|
622 | asm_msg *incomingMsg; | |||
|
623 | // | |||
|
624 | spw_ioctl_pkt_send spw_ioctl_send_ASM; | |||
|
625 | rtems_status_code status; | |||
|
626 | rtems_id queue_id; | |||
|
627 | rtems_id queue_id_q_p1; | |||
|
628 | Header_TM_LFR_SCIENCE_ASM_t headerASM; | |||
|
629 | bp_packet_with_spare packet_norm_bp1; | |||
|
630 | bp_packet packet_norm_bp2; | |||
|
631 | bp_packet packet_sbm_bp1; | |||
|
632 | bp_packet packet_sbm_bp2; | |||
|
633 | ||||
|
634 | unsigned long long int localTime; | |||
|
635 | ||||
|
636 | ASM_init_header( &headerASM ); | |||
|
637 | ||||
|
638 | //************* | |||
|
639 | // NORM headers | |||
|
640 | BP_init_header_with_spare( &packet_norm_bp1.header, | |||
|
641 | APID_TM_SCIENCE_NORMAL_BURST, SID_NORM_BP1_F1, | |||
|
642 | PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1, NB_BINS_COMPRESSED_SM_F1 ); | |||
|
643 | BP_init_header( &packet_norm_bp2.header, | |||
|
644 | APID_TM_SCIENCE_NORMAL_BURST, SID_NORM_BP2_F1, | |||
|
645 | PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1, NB_BINS_COMPRESSED_SM_F1); | |||
|
646 | ||||
|
647 | //*********************** | |||
|
648 | // BURST and SBM2 headers | |||
|
649 | if ( lfrRequestedMode == LFR_MODE_BURST ) | |||
|
650 | { | |||
|
651 | BP_init_header( &packet_sbm_bp1.header, | |||
|
652 | APID_TM_SCIENCE_NORMAL_BURST, SID_BURST_BP1_F1, | |||
|
653 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F0, NB_BINS_COMPRESSED_SM_SBM_F1); | |||
|
654 | BP_init_header( &packet_sbm_bp2.header, | |||
|
655 | APID_TM_SCIENCE_NORMAL_BURST, SID_BURST_BP2_F1, | |||
|
656 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F0, NB_BINS_COMPRESSED_SM_SBM_F1); | |||
|
657 | } | |||
|
658 | else if ( lfrRequestedMode == LFR_MODE_SBM2 ) | |||
|
659 | { | |||
|
660 | BP_init_header( &packet_sbm_bp1.header, | |||
|
661 | APID_TM_SCIENCE_SBM1_SBM2, SID_SBM2_BP1_F1, | |||
|
662 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1, NB_BINS_COMPRESSED_SM_SBM_F1); | |||
|
663 | BP_init_header( &packet_sbm_bp2.header, | |||
|
664 | APID_TM_SCIENCE_SBM1_SBM2, SID_SBM2_BP2_F1, | |||
|
665 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1, NB_BINS_COMPRESSED_SM_SBM_F1); | |||
|
666 | } | |||
|
667 | else | |||
|
668 | { | |||
|
669 | PRINTF1("ERR *** in PRC1 *** unexpected lfrRequestedMode passed as argument = %d\n", (unsigned int) lfrRequestedMode) | |||
|
670 | } | |||
|
671 | ||||
|
672 | status = get_message_queue_id_send( &queue_id ); | |||
|
673 | if (status != RTEMS_SUCCESSFUL) | |||
|
674 | { | |||
|
675 | PRINTF1("in PRC1 *** ERR get_message_queue_id_send %d\n", status) | |||
|
676 | } | |||
|
677 | status = get_message_queue_id_prc1( &queue_id_q_p1); | |||
|
678 | if (status != RTEMS_SUCCESSFUL) | |||
|
679 | { | |||
|
680 | PRINTF1("in PRC1 *** ERR get_message_queue_id_prc1 %d\n", status) | |||
|
681 | } | |||
|
682 | ||||
|
683 | BOOT_PRINTF1("in PRC1 *** lfrRequestedMode = %d\n", (int) lfrRequestedMode) | |||
|
684 | ||||
|
685 | while(1){ | |||
|
686 | status = rtems_message_queue_receive( queue_id_q_p1, incomingData, &size, //************************************ | |||
|
687 | RTEMS_WAIT, RTEMS_NO_TIMEOUT ); // wait for a message coming from AVF0 | |||
|
688 | ||||
|
689 | incomingMsg = (asm_msg*) incomingData; | |||
|
690 | ||||
|
691 | localTime = getTimeAsUnsignedLongLongInt( ); | |||
|
692 | //*********** | |||
|
693 | //*********** | |||
|
694 | // BURST SBM2 | |||
|
695 | //*********** | |||
|
696 | //*********** | |||
|
697 | if (incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP1_F1 ) | |||
|
698 | { | |||
|
699 | // 1) compress the matrix for Basic Parameters calculation | |||
|
700 | ASM_compress_reorganize_and_divide( incomingMsg->burst_sbm->matrix, compressed_sm_sbm, | |||
|
701 | nb_sm_before_f1.burst_sbm_bp1, | |||
|
702 | NB_BINS_COMPRESSED_SM_SBM_F1, NB_BINS_TO_AVERAGE_ASM_SBM_F1, | |||
|
703 | ASM_F1_INDICE_START); | |||
|
704 | // 2) compute the BP1 set | |||
|
705 | ||||
|
706 | // 3) send the BP1 set | |||
|
707 | set_time( packet_sbm_bp1.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |||
|
708 | set_time( packet_sbm_bp1.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |||
|
709 | BP_send( (char *) &packet_sbm_bp1.header, queue_id, | |||
|
710 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP1_F1 + PACKET_LENGTH_DELTA); | |||
|
711 | // 4) compute the BP2 set if needed | |||
|
712 | if ( incomingMsg->event & RTEMS_EVENT_BURST_SBM_BP2_F1 ) | |||
|
713 | { | |||
|
714 | // 1) compute the BP2 set | |||
|
715 | ||||
|
716 | // 2) send the BP2 set | |||
|
717 | set_time( packet_sbm_bp2.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |||
|
718 | set_time( packet_sbm_bp2.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |||
|
719 | BP_send( (char *) &packet_sbm_bp2.header, queue_id, | |||
|
720 | PACKET_LENGTH_TM_LFR_SCIENCE_SBM_BP2_F1 + PACKET_LENGTH_DELTA); | |||
|
721 | } | |||
|
722 | } | |||
|
723 | ||||
|
724 | //***** | |||
|
725 | //***** | |||
|
726 | // NORM | |||
|
727 | //***** | |||
|
728 | //***** | |||
|
729 | if (incomingMsg->event & RTEMS_EVENT_NORM_BP1_F1) | |||
|
730 | { | |||
|
731 | // 1) compress the matrix for Basic Parameters calculation | |||
|
732 | ASM_compress_reorganize_and_divide( incomingMsg->norm->matrix, compressed_sm_norm_f0, | |||
|
733 | nb_sm_before_f0.norm_bp1_f0, | |||
|
734 | NB_BINS_COMPRESSED_SM_F0, NB_BINS_TO_AVERAGE_ASM_F0, | |||
|
735 | ASM_F0_INDICE_START ); | |||
|
736 | // 2) compute the BP1 set | |||
|
737 | ||||
|
738 | // 3) send the BP1 set | |||
|
739 | set_time( packet_norm_bp1.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |||
|
740 | set_time( packet_norm_bp1.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |||
|
741 | BP_send( (char *) &packet_norm_bp1.header, queue_id, | |||
|
742 | PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP1_F1 + PACKET_LENGTH_DELTA); | |||
|
743 | if (incomingMsg->event & RTEMS_EVENT_NORM_BP2_F1) | |||
|
744 | { | |||
|
745 | // 1) compute the BP2 set | |||
|
746 | ||||
|
747 | // 2) send the BP2 set | |||
|
748 | set_time( packet_norm_bp2.header.time, (unsigned char *) &incomingMsg->coarseTime ); | |||
|
749 | set_time( packet_norm_bp2.header.acquisitionTime, (unsigned char *) &incomingMsg->fineTime ); | |||
|
750 | BP_send( (char *) &packet_norm_bp2.header, queue_id, | |||
|
751 | PACKET_LENGTH_TM_LFR_SCIENCE_NORM_BP2_F1 + PACKET_LENGTH_DELTA); | |||
|
752 | } | |||
|
753 | } | |||
|
754 | ||||
|
755 | if (incomingMsg->event & RTEMS_EVENT_NORM_ASM_F1) | |||
|
756 | { | |||
|
757 | // 1) reorganize the ASM and divide | |||
|
758 | ASM_reorganize_and_divide( incomingMsg->norm->matrix, asm_f0_reorganized, NB_SM_BEFORE_NORM_BP1_F0 ); | |||
|
759 | // 2) convert the float array in a char array | |||
|
760 | ASM_convert( asm_f0_reorganized, asm_f0_char); | |||
|
761 | // 3) send the spectral matrix packets | |||
|
762 | set_time( headerASM.time , (unsigned char *) &incomingMsg->coarseTime ); | |||
|
763 | set_time( headerASM.acquisitionTime, (unsigned char *) &incomingMsg->coarseTime ); | |||
|
764 | ASM_send( &headerASM, asm_f0_char, SID_NORM_ASM_F0, &spw_ioctl_send_ASM, queue_id); | |||
|
765 | } | |||
|
766 | ||||
|
767 | } | |||
|
768 | } | |||
|
769 | ||||
615 | //****************** |
|
770 | //****************** | |
616 | // Spectral Matrices |
|
771 | // Spectral Matrices | |
617 |
|
772 | |||
618 | void SM_init_rings( void ) |
|
773 | void SM_init_rings( void ) | |
619 | { |
|
774 | { | |
620 | unsigned char i; |
|
775 | unsigned char i; | |
621 |
|
776 | |||
622 | // F0 RING |
|
777 | // F0 RING | |
623 | sm_ring_f0[0].next = (ring_node_sm*) &sm_ring_f0[1]; |
|
778 | sm_ring_f0[0].next = (ring_node_sm*) &sm_ring_f0[1]; | |
624 | sm_ring_f0[0].previous = (ring_node_sm*) &sm_ring_f0[NB_RING_NODES_SM_F0-1]; |
|
779 | sm_ring_f0[0].previous = (ring_node_sm*) &sm_ring_f0[NB_RING_NODES_SM_F0-1]; | |
625 | sm_ring_f0[0].buffer_address = |
|
780 | sm_ring_f0[0].buffer_address = | |
626 | (int) &sm_f0[ 0 ]; |
|
781 | (int) &sm_f0[ 0 ]; | |
627 |
|
782 | |||
628 | sm_ring_f0[NB_RING_NODES_SM_F0-1].next = (ring_node_sm*) &sm_ring_f0[0]; |
|
783 | sm_ring_f0[NB_RING_NODES_SM_F0-1].next = (ring_node_sm*) &sm_ring_f0[0]; | |
629 | sm_ring_f0[NB_RING_NODES_SM_F0-1].previous = (ring_node_sm*) &sm_ring_f0[NB_RING_NODES_SM_F0-2]; |
|
784 | sm_ring_f0[NB_RING_NODES_SM_F0-1].previous = (ring_node_sm*) &sm_ring_f0[NB_RING_NODES_SM_F0-2]; | |
630 | sm_ring_f0[NB_RING_NODES_SM_F0-1].buffer_address = |
|
785 | sm_ring_f0[NB_RING_NODES_SM_F0-1].buffer_address = | |
631 | (int) &sm_f0[ (NB_RING_NODES_SM_F0-1) * TOTAL_SIZE_SM ]; |
|
786 | (int) &sm_f0[ (NB_RING_NODES_SM_F0-1) * TOTAL_SIZE_SM ]; | |
632 |
|
787 | |||
633 | for(i=1; i<NB_RING_NODES_SM_F0-1; i++) |
|
788 | for(i=1; i<NB_RING_NODES_SM_F0-1; i++) | |
634 | { |
|
789 | { | |
635 | sm_ring_f0[i].next = (ring_node_sm*) &sm_ring_f0[i+1]; |
|
790 | sm_ring_f0[i].next = (ring_node_sm*) &sm_ring_f0[i+1]; | |
636 | sm_ring_f0[i].previous = (ring_node_sm*) &sm_ring_f0[i-1]; |
|
791 | sm_ring_f0[i].previous = (ring_node_sm*) &sm_ring_f0[i-1]; | |
637 | sm_ring_f0[i].buffer_address = |
|
792 | sm_ring_f0[i].buffer_address = | |
638 | (int) &sm_f0[ i * TOTAL_SIZE_SM ]; |
|
793 | (int) &sm_f0[ i * TOTAL_SIZE_SM ]; | |
639 | } |
|
794 | } | |
640 |
|
795 | |||
641 | // F1 RING |
|
796 | // F1 RING | |
642 | sm_ring_f1[0].next = (ring_node_sm*) &sm_ring_f1[1]; |
|
797 | sm_ring_f1[0].next = (ring_node_sm*) &sm_ring_f1[1]; | |
643 | sm_ring_f1[0].previous = (ring_node_sm*) &sm_ring_f1[NB_RING_NODES_SM_F1-1]; |
|
798 | sm_ring_f1[0].previous = (ring_node_sm*) &sm_ring_f1[NB_RING_NODES_SM_F1-1]; | |
644 | sm_ring_f1[0].buffer_address = |
|
799 | sm_ring_f1[0].buffer_address = | |
645 | (int) &sm_f1[ 0 ]; |
|
800 | (int) &sm_f1[ 0 ]; | |
646 |
|
801 | |||
647 | sm_ring_f1[NB_RING_NODES_SM_F1-1].next = (ring_node_sm*) &sm_ring_f1[0]; |
|
802 | sm_ring_f1[NB_RING_NODES_SM_F1-1].next = (ring_node_sm*) &sm_ring_f1[0]; | |
648 | sm_ring_f1[NB_RING_NODES_SM_F1-1].previous = (ring_node_sm*) &sm_ring_f1[NB_RING_NODES_SM_F1-2]; |
|
803 | sm_ring_f1[NB_RING_NODES_SM_F1-1].previous = (ring_node_sm*) &sm_ring_f1[NB_RING_NODES_SM_F1-2]; | |
649 | sm_ring_f1[NB_RING_NODES_SM_F1-1].buffer_address = |
|
804 | sm_ring_f1[NB_RING_NODES_SM_F1-1].buffer_address = | |
650 | (int) &sm_f1[ (NB_RING_NODES_SM_F1-1) * TOTAL_SIZE_SM ]; |
|
805 | (int) &sm_f1[ (NB_RING_NODES_SM_F1-1) * TOTAL_SIZE_SM ]; | |
651 |
|
806 | |||
652 | for(i=1; i<NB_RING_NODES_SM_F1-1; i++) |
|
807 | for(i=1; i<NB_RING_NODES_SM_F1-1; i++) | |
653 | { |
|
808 | { | |
654 | sm_ring_f1[i].next = (ring_node_sm*) &sm_ring_f1[i+1]; |
|
809 | sm_ring_f1[i].next = (ring_node_sm*) &sm_ring_f1[i+1]; | |
655 | sm_ring_f1[i].previous = (ring_node_sm*) &sm_ring_f1[i-1]; |
|
810 | sm_ring_f1[i].previous = (ring_node_sm*) &sm_ring_f1[i-1]; | |
656 | sm_ring_f1[i].buffer_address = |
|
811 | sm_ring_f1[i].buffer_address = | |
657 | (int) &sm_f1[ i * TOTAL_SIZE_SM ]; |
|
812 | (int) &sm_f1[ i * TOTAL_SIZE_SM ]; | |
658 | } |
|
813 | } | |
659 |
|
814 | |||
660 | // F2 RING |
|
815 | // F2 RING | |
661 | sm_ring_f2[0].next = (ring_node_sm*) &sm_ring_f2[1]; |
|
816 | sm_ring_f2[0].next = (ring_node_sm*) &sm_ring_f2[1]; | |
662 | sm_ring_f2[0].previous = (ring_node_sm*) &sm_ring_f2[NB_RING_NODES_SM_F2-1]; |
|
817 | sm_ring_f2[0].previous = (ring_node_sm*) &sm_ring_f2[NB_RING_NODES_SM_F2-1]; | |
663 | sm_ring_f2[0].buffer_address = |
|
818 | sm_ring_f2[0].buffer_address = | |
664 | (int) &sm_f2[ 0 ]; |
|
819 | (int) &sm_f2[ 0 ]; | |
665 |
|
820 | |||
666 | sm_ring_f2[NB_RING_NODES_SM_F2-1].next = (ring_node_sm*) &sm_ring_f2[0]; |
|
821 | sm_ring_f2[NB_RING_NODES_SM_F2-1].next = (ring_node_sm*) &sm_ring_f2[0]; | |
667 | sm_ring_f2[NB_RING_NODES_SM_F2-1].previous = (ring_node_sm*) &sm_ring_f2[NB_RING_NODES_SM_F2-2]; |
|
822 | sm_ring_f2[NB_RING_NODES_SM_F2-1].previous = (ring_node_sm*) &sm_ring_f2[NB_RING_NODES_SM_F2-2]; | |
668 | sm_ring_f2[NB_RING_NODES_SM_F2-1].buffer_address = |
|
823 | sm_ring_f2[NB_RING_NODES_SM_F2-1].buffer_address = | |
669 | (int) &sm_f2[ (NB_RING_NODES_SM_F2-1) * TOTAL_SIZE_SM ]; |
|
824 | (int) &sm_f2[ (NB_RING_NODES_SM_F2-1) * TOTAL_SIZE_SM ]; | |
670 |
|
825 | |||
671 | for(i=1; i<NB_RING_NODES_SM_F2-1; i++) |
|
826 | for(i=1; i<NB_RING_NODES_SM_F2-1; i++) | |
672 | { |
|
827 | { | |
673 | sm_ring_f2[i].next = (ring_node_sm*) &sm_ring_f2[i+1]; |
|
828 | sm_ring_f2[i].next = (ring_node_sm*) &sm_ring_f2[i+1]; | |
674 | sm_ring_f2[i].previous = (ring_node_sm*) &sm_ring_f2[i-1]; |
|
829 | sm_ring_f2[i].previous = (ring_node_sm*) &sm_ring_f2[i-1]; | |
675 | sm_ring_f2[i].buffer_address = |
|
830 | sm_ring_f2[i].buffer_address = | |
676 | (int) &sm_f2[ i * TOTAL_SIZE_SM ]; |
|
831 | (int) &sm_f2[ i * TOTAL_SIZE_SM ]; | |
677 | } |
|
832 | } | |
678 |
|
833 | |||
679 | DEBUG_PRINTF1("asm_ring_f0 @%x\n", (unsigned int) sm_ring_f0) |
|
834 | DEBUG_PRINTF1("asm_ring_f0 @%x\n", (unsigned int) sm_ring_f0) | |
680 | DEBUG_PRINTF1("asm_ring_f1 @%x\n", (unsigned int) sm_ring_f1) |
|
835 | DEBUG_PRINTF1("asm_ring_f1 @%x\n", (unsigned int) sm_ring_f1) | |
681 | DEBUG_PRINTF1("asm_ring_f2 @%x\n", (unsigned int) sm_ring_f2) |
|
836 | DEBUG_PRINTF1("asm_ring_f2 @%x\n", (unsigned int) sm_ring_f2) | |
682 |
|
837 | |||
683 | spectral_matrix_regs->matrixF0_Address0 = sm_ring_f0[0].buffer_address; |
|
838 | spectral_matrix_regs->matrixF0_Address0 = sm_ring_f0[0].buffer_address; | |
684 | DEBUG_PRINTF1("spectral_matrix_regs->matrixF0_Address0 @%x\n", spectral_matrix_regs->matrixF0_Address0) |
|
839 | DEBUG_PRINTF1("spectral_matrix_regs->matrixF0_Address0 @%x\n", spectral_matrix_regs->matrixF0_Address0) | |
685 | } |
|
840 | } | |
686 |
|
841 | |||
687 | void ASM_init_rings( void ) |
|
842 | void ASM_init_rings( void ) | |
688 | { |
|
843 | { | |
|
844 | //*** | |||
|
845 | // F0 | |||
|
846 | // NORM | |||
|
847 | ASM_generic_init_ring( asm_ring_norm_f0, NB_RING_NODES_ASM_NORM_F0 ); | |||
|
848 | // BURST_SBM | |||
|
849 | ASM_generic_init_ring( asm_ring_burst_sbm_f0, NB_RING_NODES_ASM_BURST_SBM_F0 ); | |||
|
850 | ||||
|
851 | //*** | |||
|
852 | // F1 | |||
|
853 | //***** | |||
|
854 | // NORM | |||
|
855 | ASM_generic_init_ring( asm_ring_norm_f1, NB_RING_NODES_ASM_NORM_F1 ); | |||
|
856 | // BURST_SBM | |||
|
857 | ASM_generic_init_ring( asm_ring_burst_sbm_f1, NB_RING_NODES_ASM_BURST_SBM_F1 ); | |||
|
858 | } | |||
|
859 | ||||
|
860 | void ASM_generic_init_ring( ring_node_asm *ring, unsigned char nbNodes ) | |||
|
861 | { | |||
689 | unsigned char i; |
|
862 | unsigned char i; | |
690 |
|
863 | |||
691 | //************* |
|
864 | ring[ nbNodes - 1 ].next | |
692 | // BURST_SBM_F0 |
|
865 | = (ring_node_asm*) &ring[ 0 ]; | |
693 | asm_ring_burst_sbm_f0[0].next = (ring_node_asm*) &asm_ring_burst_sbm_f0[1]; |
|
|||
694 | asm_ring_burst_sbm_f0[0].previous = (ring_node_asm*) &asm_ring_burst_sbm_f0[NB_RING_NODES_ASM_BURST_SBM_F0-1]; |
|
|||
695 |
|
866 | |||
696 | asm_ring_burst_sbm_f0[NB_RING_NODES_ASM_BURST_SBM_F0-1].next |
|
867 | for(i=0; i<nbNodes-1; i++) | |
697 | = (ring_node_asm*) &asm_ring_burst_sbm_f0[0]; |
|
|||
698 | asm_ring_burst_sbm_f0[NB_RING_NODES_ASM_BURST_SBM_F0-1].previous |
|
|||
699 | = (ring_node_asm*) &asm_ring_burst_sbm_f0[NB_RING_NODES_ASM_BURST_SBM_F0-2]; |
|
|||
700 |
|
||||
701 | for(i=1; i<NB_RING_NODES_ASM_BURST_SBM_F0-1; i++) |
|
|||
702 | { |
|
868 | { | |
703 |
|
|
869 | ring[ i ].next = (ring_node_asm*) &ring[ i + 1 ]; | |
704 | asm_ring_burst_sbm_f0[i].previous = (ring_node_asm*) &asm_ring_burst_sbm_f0[i-1]; |
|
|||
705 | } |
|
|||
706 |
|
||||
707 | //************* |
|
|||
708 | // NORM_F0 |
|
|||
709 | asm_ring_norm_f0[0].next = (ring_node_asm*) &asm_ring_norm_f0[1]; |
|
|||
710 | asm_ring_norm_f0[0].previous = (ring_node_asm*) &asm_ring_norm_f0[NB_RING_NODES_ASM_BURST_SBM_F0-1]; |
|
|||
711 |
|
||||
712 | asm_ring_norm_f0[NB_RING_NODES_ASM_NORM_F0-1].next |
|
|||
713 | = (ring_node_asm*) &asm_ring_norm_f0[0]; |
|
|||
714 | asm_ring_norm_f0[NB_RING_NODES_ASM_NORM_F0-1].previous |
|
|||
715 | = (ring_node_asm*) &asm_ring_norm_f0[NB_RING_NODES_ASM_NORM_F0-2]; |
|
|||
716 |
|
||||
717 | for(i=1; i<NB_RING_NODES_ASM_NORM_F0-1; i++) |
|
|||
718 | { |
|
|||
719 | asm_ring_norm_f0[i].next = (ring_node_asm*) &asm_ring_norm_f0[i+1]; |
|
|||
720 | asm_ring_norm_f0[i].previous = (ring_node_asm*) &asm_ring_norm_f0[i-1]; |
|
|||
721 | } |
|
870 | } | |
722 | } |
|
871 | } | |
723 |
|
872 | |||
724 | void SM_reset_current_ring_nodes( void ) |
|
873 | void SM_reset_current_ring_nodes( void ) | |
725 | { |
|
874 | { | |
726 | current_ring_node_sm_f0 = sm_ring_f0; |
|
875 | current_ring_node_sm_f0 = sm_ring_f0; | |
727 | current_ring_node_sm_f1 = sm_ring_f1; |
|
876 | current_ring_node_sm_f1 = sm_ring_f1; | |
728 | current_ring_node_sm_f2 = sm_ring_f2; |
|
877 | current_ring_node_sm_f2 = sm_ring_f2; | |
729 |
|
878 | |||
730 | ring_node_for_averaging_sm_f0 = sm_ring_f0; |
|
879 | ring_node_for_averaging_sm_f0 = sm_ring_f0; | |
731 | } |
|
880 | } | |
732 |
|
881 | |||
733 | void ASM_reset_current_ring_node( void ) |
|
882 | void ASM_reset_current_ring_nodes( void ) | |
734 | { |
|
883 | { | |
735 | current_ring_node_asm_norm_f0 = asm_ring_norm_f0; |
|
884 | current_ring_node_asm_norm_f0 = asm_ring_norm_f0; | |
736 | current_ring_node_asm_burst_sbm_f0 = asm_ring_burst_sbm_f0; |
|
885 | current_ring_node_asm_burst_sbm_f0 = asm_ring_burst_sbm_f0; | |
|
886 | ||||
|
887 | current_ring_node_asm_norm_f1 = asm_ring_norm_f1; | |||
|
888 | current_ring_node_asm_burst_sbm_f1 = asm_ring_burst_sbm_f1; | |||
737 | } |
|
889 | } | |
738 |
|
890 | |||
739 | void ASM_init_header( Header_TM_LFR_SCIENCE_ASM_t *header) |
|
891 | void ASM_init_header( Header_TM_LFR_SCIENCE_ASM_t *header) | |
740 | { |
|
892 | { | |
741 | header->targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
893 | header->targetLogicalAddress = CCSDS_DESTINATION_ID; | |
742 | header->protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
894 | header->protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
743 | header->reserved = 0x00; |
|
895 | header->reserved = 0x00; | |
744 | header->userApplication = CCSDS_USER_APP; |
|
896 | header->userApplication = CCSDS_USER_APP; | |
745 | header->packetID[0] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST >> 8); |
|
897 | header->packetID[0] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST >> 8); | |
746 | header->packetID[1] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST); |
|
898 | header->packetID[1] = (unsigned char) (APID_TM_SCIENCE_NORMAL_BURST); | |
747 | header->packetSequenceControl[0] = 0xc0; |
|
899 | header->packetSequenceControl[0] = 0xc0; | |
748 | header->packetSequenceControl[1] = 0x00; |
|
900 | header->packetSequenceControl[1] = 0x00; | |
749 | header->packetLength[0] = 0x00; |
|
901 | header->packetLength[0] = 0x00; | |
750 | header->packetLength[1] = 0x00; |
|
902 | header->packetLength[1] = 0x00; | |
751 | // DATA FIELD HEADER |
|
903 | // DATA FIELD HEADER | |
752 | header->spare1_pusVersion_spare2 = 0x10; |
|
904 | header->spare1_pusVersion_spare2 = 0x10; | |
753 | header->serviceType = TM_TYPE_LFR_SCIENCE; // service type |
|
905 | header->serviceType = TM_TYPE_LFR_SCIENCE; // service type | |
754 | header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
906 | header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype | |
755 | header->destinationID = TM_DESTINATION_ID_GROUND; |
|
907 | header->destinationID = TM_DESTINATION_ID_GROUND; | |
756 | // AUXILIARY DATA HEADER |
|
908 | // AUXILIARY DATA HEADER | |
757 | header->sid = 0x00; |
|
909 | header->sid = 0x00; | |
758 | header->biaStatusInfo = 0x00; |
|
910 | header->biaStatusInfo = 0x00; | |
759 | header->pa_lfr_pkt_cnt_asm = 0x00; |
|
911 | header->pa_lfr_pkt_cnt_asm = 0x00; | |
760 | header->pa_lfr_pkt_nr_asm = 0x00; |
|
912 | header->pa_lfr_pkt_nr_asm = 0x00; | |
761 | header->time[0] = 0x00; |
|
913 | header->time[0] = 0x00; | |
762 | header->time[0] = 0x00; |
|
914 | header->time[0] = 0x00; | |
763 | header->time[0] = 0x00; |
|
915 | header->time[0] = 0x00; | |
764 | header->time[0] = 0x00; |
|
916 | header->time[0] = 0x00; | |
765 | header->time[0] = 0x00; |
|
917 | header->time[0] = 0x00; | |
766 | header->time[0] = 0x00; |
|
918 | header->time[0] = 0x00; | |
767 | header->pa_lfr_asm_blk_nr[0] = 0x00; // BLK_NR MSB |
|
919 | header->pa_lfr_asm_blk_nr[0] = 0x00; // BLK_NR MSB | |
768 | header->pa_lfr_asm_blk_nr[1] = 0x00; // BLK_NR LSB |
|
920 | header->pa_lfr_asm_blk_nr[1] = 0x00; // BLK_NR LSB | |
769 | } |
|
921 | } | |
770 |
|
922 | |||
771 | void SM_average( float *averaged_spec_mat_f0, float *averaged_spec_mat_f1, |
|
923 | void SM_average( float *averaged_spec_mat_f0, float *averaged_spec_mat_f1, | |
772 | ring_node_sm *ring_node_tab[], |
|
924 | ring_node_sm *ring_node_tab[], | |
773 | unsigned int nbAverageNormF0, unsigned int nbAverageSBM1F0 ) |
|
925 | unsigned int nbAverageNormF0, unsigned int nbAverageSBM1F0 ) | |
774 | { |
|
926 | { | |
775 | float sum; |
|
927 | float sum; | |
776 | unsigned int i; |
|
928 | unsigned int i; | |
777 |
|
929 | |||
778 | for(i=0; i<TOTAL_SIZE_SM; i++) |
|
930 | for(i=0; i<TOTAL_SIZE_SM; i++) | |
779 | { |
|
931 | { | |
780 | sum = ( (int *) (ring_node_tab[0]->buffer_address) ) [ i ] |
|
932 | sum = ( (int *) (ring_node_tab[0]->buffer_address) ) [ i ] | |
781 | + ( (int *) (ring_node_tab[1]->buffer_address) ) [ i ] |
|
933 | + ( (int *) (ring_node_tab[1]->buffer_address) ) [ i ] | |
782 | + ( (int *) (ring_node_tab[2]->buffer_address) ) [ i ] |
|
934 | + ( (int *) (ring_node_tab[2]->buffer_address) ) [ i ] | |
783 | + ( (int *) (ring_node_tab[3]->buffer_address) ) [ i ] |
|
935 | + ( (int *) (ring_node_tab[3]->buffer_address) ) [ i ] | |
784 | + ( (int *) (ring_node_tab[4]->buffer_address) ) [ i ] |
|
936 | + ( (int *) (ring_node_tab[4]->buffer_address) ) [ i ] | |
785 | + ( (int *) (ring_node_tab[5]->buffer_address) ) [ i ] |
|
937 | + ( (int *) (ring_node_tab[5]->buffer_address) ) [ i ] | |
786 | + ( (int *) (ring_node_tab[6]->buffer_address) ) [ i ] |
|
938 | + ( (int *) (ring_node_tab[6]->buffer_address) ) [ i ] | |
787 | + ( (int *) (ring_node_tab[7]->buffer_address) ) [ i ]; |
|
939 | + ( (int *) (ring_node_tab[7]->buffer_address) ) [ i ]; | |
788 |
|
940 | |||
789 | if ( (nbAverageNormF0 == 0) && (nbAverageSBM1F0 == 0) ) |
|
941 | if ( (nbAverageNormF0 == 0) && (nbAverageSBM1F0 == 0) ) | |
790 | { |
|
942 | { | |
791 | averaged_spec_mat_f0[ i ] = sum; |
|
943 | averaged_spec_mat_f0[ i ] = sum; | |
792 | averaged_spec_mat_f1[ i ] = sum; |
|
944 | averaged_spec_mat_f1[ i ] = sum; | |
793 | } |
|
945 | } | |
794 | else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 != 0) ) |
|
946 | else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 != 0) ) | |
795 | { |
|
947 | { | |
796 | averaged_spec_mat_f0[ i ] = ( averaged_spec_mat_f0[ i ] + sum ); |
|
948 | averaged_spec_mat_f0[ i ] = ( averaged_spec_mat_f0[ i ] + sum ); | |
797 | averaged_spec_mat_f1[ i ] = ( averaged_spec_mat_f1[ i ] + sum ); |
|
949 | averaged_spec_mat_f1[ i ] = ( averaged_spec_mat_f1[ i ] + sum ); | |
798 | } |
|
950 | } | |
799 | else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 == 0) ) |
|
951 | else if ( (nbAverageNormF0 != 0) && (nbAverageSBM1F0 == 0) ) | |
800 | { |
|
952 | { | |
801 | averaged_spec_mat_f0[ i ] = ( averaged_spec_mat_f0[ i ] + sum ); |
|
953 | averaged_spec_mat_f0[ i ] = ( averaged_spec_mat_f0[ i ] + sum ); | |
802 | averaged_spec_mat_f1[ i ] = sum; |
|
954 | averaged_spec_mat_f1[ i ] = sum; | |
803 | } |
|
955 | } | |
804 | else |
|
956 | else | |
805 | { |
|
957 | { | |
806 | PRINTF2("ERR *** in SM_average *** unexpected parameters %d %d\n", nbAverageNormF0, nbAverageSBM1F0) |
|
958 | PRINTF2("ERR *** in SM_average *** unexpected parameters %d %d\n", nbAverageNormF0, nbAverageSBM1F0) | |
807 | } |
|
959 | } | |
808 | } |
|
960 | } | |
809 | } |
|
961 | } | |
810 |
|
962 | |||
811 | void ASM_reorganize_and_divide( float *averaged_spec_mat, float *averaged_spec_mat_reorganized, float divider ) |
|
963 | void ASM_reorganize_and_divide( float *averaged_spec_mat, float *averaged_spec_mat_reorganized, float divider ) | |
812 | { |
|
964 | { | |
813 | int frequencyBin; |
|
965 | int frequencyBin; | |
814 | int asmComponent; |
|
966 | int asmComponent; | |
815 | unsigned int offsetAveragedSpecMatReorganized; |
|
967 | unsigned int offsetAveragedSpecMatReorganized; | |
816 | unsigned int offsetAveragedSpecMat; |
|
968 | unsigned int offsetAveragedSpecMat; | |
817 |
|
969 | |||
818 | for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++) |
|
970 | for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++) | |
819 | { |
|
971 | { | |
820 | for( frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++ ) |
|
972 | for( frequencyBin = 0; frequencyBin < NB_BINS_PER_SM; frequencyBin++ ) | |
821 | { |
|
973 | { | |
822 | offsetAveragedSpecMatReorganized = |
|
974 | offsetAveragedSpecMatReorganized = | |
823 | frequencyBin * NB_VALUES_PER_SM |
|
975 | frequencyBin * NB_VALUES_PER_SM | |
824 | + asmComponent; |
|
976 | + asmComponent; | |
825 | offsetAveragedSpecMat = |
|
977 | offsetAveragedSpecMat = | |
826 | asmComponent * NB_BINS_PER_SM |
|
978 | asmComponent * NB_BINS_PER_SM | |
827 | + frequencyBin; |
|
979 | + frequencyBin; | |
828 | averaged_spec_mat_reorganized[offsetAveragedSpecMatReorganized ] = |
|
980 | averaged_spec_mat_reorganized[offsetAveragedSpecMatReorganized ] = | |
829 | averaged_spec_mat[ offsetAveragedSpecMat ] / divider; |
|
981 | averaged_spec_mat[ offsetAveragedSpecMat ] / divider; | |
830 | } |
|
982 | } | |
831 | } |
|
983 | } | |
832 | } |
|
984 | } | |
833 |
|
985 | |||
834 | void ASM_compress_reorganize_and_divide(float *averaged_spec_mat, float *compressed_spec_mat , float divider, |
|
986 | void ASM_compress_reorganize_and_divide(float *averaged_spec_mat, float *compressed_spec_mat , float divider, | |
835 | unsigned char nbBinsCompressedMatrix, unsigned char nbBinsToAverage, unsigned char ASMIndexStart ) |
|
987 | unsigned char nbBinsCompressedMatrix, unsigned char nbBinsToAverage, unsigned char ASMIndexStart ) | |
836 | { |
|
988 | { | |
837 | int frequencyBin; |
|
989 | int frequencyBin; | |
838 | int asmComponent; |
|
990 | int asmComponent; | |
839 | int offsetASM; |
|
991 | int offsetASM; | |
840 | int offsetCompressed; |
|
992 | int offsetCompressed; | |
841 | int k; |
|
993 | int k; | |
842 |
|
994 | |||
843 | // build data |
|
995 | // build data | |
844 | for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++) |
|
996 | for (asmComponent = 0; asmComponent < NB_VALUES_PER_SM; asmComponent++) | |
845 | { |
|
997 | { | |
846 | for( frequencyBin = 0; frequencyBin < nbBinsCompressedMatrix; frequencyBin++ ) |
|
998 | for( frequencyBin = 0; frequencyBin < nbBinsCompressedMatrix; frequencyBin++ ) | |
847 | { |
|
999 | { | |
848 | offsetCompressed = // NO TIME OFFSET |
|
1000 | offsetCompressed = // NO TIME OFFSET | |
849 | frequencyBin * NB_VALUES_PER_SM |
|
1001 | frequencyBin * NB_VALUES_PER_SM | |
850 | + asmComponent; |
|
1002 | + asmComponent; | |
851 | offsetASM = // NO TIME OFFSET |
|
1003 | offsetASM = // NO TIME OFFSET | |
852 | asmComponent * NB_BINS_PER_SM |
|
1004 | asmComponent * NB_BINS_PER_SM | |
853 | + ASMIndexStart |
|
1005 | + ASMIndexStart | |
854 | + frequencyBin * nbBinsToAverage; |
|
1006 | + frequencyBin * nbBinsToAverage; | |
855 | compressed_spec_mat[ offsetCompressed ] = 0; |
|
1007 | compressed_spec_mat[ offsetCompressed ] = 0; | |
856 | for ( k = 0; k < nbBinsToAverage; k++ ) |
|
1008 | for ( k = 0; k < nbBinsToAverage; k++ ) | |
857 | { |
|
1009 | { | |
858 | compressed_spec_mat[offsetCompressed ] = |
|
1010 | compressed_spec_mat[offsetCompressed ] = | |
859 | ( compressed_spec_mat[ offsetCompressed ] |
|
1011 | ( compressed_spec_mat[ offsetCompressed ] | |
860 | + averaged_spec_mat[ offsetASM + k ] ) / (divider * nbBinsToAverage); |
|
1012 | + averaged_spec_mat[ offsetASM + k ] ) / (divider * nbBinsToAverage); | |
861 | } |
|
1013 | } | |
862 | } |
|
1014 | } | |
863 | } |
|
1015 | } | |
864 | } |
|
1016 | } | |
865 |
|
1017 | |||
866 | void ASM_convert( volatile float *input_matrix, char *output_matrix) |
|
1018 | void ASM_convert( volatile float *input_matrix, char *output_matrix) | |
867 | { |
|
1019 | { | |
868 | unsigned int frequencyBin; |
|
1020 | unsigned int frequencyBin; | |
869 | unsigned int asmComponent; |
|
1021 | unsigned int asmComponent; | |
870 | char * pt_char_input; |
|
1022 | char * pt_char_input; | |
871 | char * pt_char_output; |
|
1023 | char * pt_char_output; | |
872 | unsigned int offsetInput; |
|
1024 | unsigned int offsetInput; | |
873 | unsigned int offsetOutput; |
|
1025 | unsigned int offsetOutput; | |
874 |
|
1026 | |||
875 | pt_char_input = (char*) &input_matrix; |
|
1027 | pt_char_input = (char*) &input_matrix; | |
876 | pt_char_output = (char*) &output_matrix; |
|
1028 | pt_char_output = (char*) &output_matrix; | |
877 |
|
1029 | |||
878 | // convert all other data |
|
1030 | // convert all other data | |
879 | for( frequencyBin=0; frequencyBin<NB_BINS_PER_SM; frequencyBin++) |
|
1031 | for( frequencyBin=0; frequencyBin<NB_BINS_PER_SM; frequencyBin++) | |
880 | { |
|
1032 | { | |
881 | for ( asmComponent=0; asmComponent<NB_VALUES_PER_SM; asmComponent++) |
|
1033 | for ( asmComponent=0; asmComponent<NB_VALUES_PER_SM; asmComponent++) | |
882 | { |
|
1034 | { | |
883 | offsetInput = (frequencyBin*NB_VALUES_PER_SM) + asmComponent ; |
|
1035 | offsetInput = (frequencyBin*NB_VALUES_PER_SM) + asmComponent ; | |
884 | offsetOutput = 2 * ( (frequencyBin*NB_VALUES_PER_SM) + asmComponent ) ; |
|
1036 | offsetOutput = 2 * ( (frequencyBin*NB_VALUES_PER_SM) + asmComponent ) ; | |
885 | pt_char_input = (char*) &input_matrix [ offsetInput ]; |
|
1037 | pt_char_input = (char*) &input_matrix [ offsetInput ]; | |
886 | pt_char_output = (char*) &output_matrix[ offsetOutput ]; |
|
1038 | pt_char_output = (char*) &output_matrix[ offsetOutput ]; | |
887 | pt_char_output[0] = pt_char_input[0]; // bits 31 downto 24 of the float |
|
1039 | pt_char_output[0] = pt_char_input[0]; // bits 31 downto 24 of the float | |
888 | pt_char_output[1] = pt_char_input[1]; // bits 23 downto 16 of the float |
|
1040 | pt_char_output[1] = pt_char_input[1]; // bits 23 downto 16 of the float | |
889 | } |
|
1041 | } | |
890 | } |
|
1042 | } | |
891 | } |
|
1043 | } | |
892 |
|
1044 | |||
893 | void ASM_send(Header_TM_LFR_SCIENCE_ASM_t *header, char *spectral_matrix, |
|
1045 | void ASM_send(Header_TM_LFR_SCIENCE_ASM_t *header, char *spectral_matrix, | |
894 | unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send, rtems_id queue_id) |
|
1046 | unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send, rtems_id queue_id) | |
895 | { |
|
1047 | { | |
896 | unsigned int i; |
|
1048 | unsigned int i; | |
897 | unsigned int length = 0; |
|
1049 | unsigned int length = 0; | |
898 | rtems_status_code status; |
|
1050 | rtems_status_code status; | |
899 |
|
1051 | |||
900 | for (i=0; i<2; i++) |
|
1052 | for (i=0; i<2; i++) | |
901 | { |
|
1053 | { | |
902 | // (1) BUILD THE DATA |
|
1054 | // (1) BUILD THE DATA | |
903 | switch(sid) |
|
1055 | switch(sid) | |
904 | { |
|
1056 | { | |
905 | case SID_NORM_ASM_F0: |
|
1057 | case SID_NORM_ASM_F0: | |
906 | spw_ioctl_send->dlen = TOTAL_SIZE_ASM_F0_IN_BYTES / 2; |
|
1058 | spw_ioctl_send->dlen = TOTAL_SIZE_ASM_F0_IN_BYTES / 2; | |
907 | spw_ioctl_send->data = &spectral_matrix[ |
|
1059 | spw_ioctl_send->data = &spectral_matrix[ | |
908 | ( (ASM_F0_INDICE_START + (i*NB_BINS_PER_PKT_ASM_F0) ) * NB_VALUES_PER_SM ) * 2 |
|
1060 | ( (ASM_F0_INDICE_START + (i*NB_BINS_PER_PKT_ASM_F0) ) * NB_VALUES_PER_SM ) * 2 | |
909 | ]; |
|
1061 | ]; | |
910 | length = PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0; |
|
1062 | length = PACKET_LENGTH_TM_LFR_SCIENCE_ASM_F0; | |
911 | header->pa_lfr_asm_blk_nr[0] = (unsigned char) ( (NB_BINS_PER_PKT_ASM_F0) >> 8 ); // BLK_NR MSB |
|
1063 | header->pa_lfr_asm_blk_nr[0] = (unsigned char) ( (NB_BINS_PER_PKT_ASM_F0) >> 8 ); // BLK_NR MSB | |
912 | header->pa_lfr_asm_blk_nr[1] = (unsigned char) (NB_BINS_PER_PKT_ASM_F0); // BLK_NR LSB |
|
1064 | header->pa_lfr_asm_blk_nr[1] = (unsigned char) (NB_BINS_PER_PKT_ASM_F0); // BLK_NR LSB | |
913 | break; |
|
1065 | break; | |
914 | case SID_NORM_ASM_F1: |
|
1066 | case SID_NORM_ASM_F1: | |
915 | break; |
|
1067 | break; | |
916 | case SID_NORM_ASM_F2: |
|
1068 | case SID_NORM_ASM_F2: | |
917 | break; |
|
1069 | break; | |
918 | default: |
|
1070 | default: | |
919 | PRINTF1("ERR *** in ASM_send *** unexpected sid %d\n", sid) |
|
1071 | PRINTF1("ERR *** in ASM_send *** unexpected sid %d\n", sid) | |
920 | break; |
|
1072 | break; | |
921 | } |
|
1073 | } | |
922 | spw_ioctl_send->hlen = HEADER_LENGTH_TM_LFR_SCIENCE_ASM + CCSDS_PROTOCOLE_EXTRA_BYTES; |
|
1074 | spw_ioctl_send->hlen = HEADER_LENGTH_TM_LFR_SCIENCE_ASM + CCSDS_PROTOCOLE_EXTRA_BYTES; | |
923 | spw_ioctl_send->hdr = (char *) header; |
|
1075 | spw_ioctl_send->hdr = (char *) header; | |
924 | spw_ioctl_send->options = 0; |
|
1076 | spw_ioctl_send->options = 0; | |
925 |
|
1077 | |||
926 | // (2) BUILD THE HEADER |
|
1078 | // (2) BUILD THE HEADER | |
927 | header->packetLength[0] = (unsigned char) (length>>8); |
|
1079 | header->packetLength[0] = (unsigned char) (length>>8); | |
928 | header->packetLength[1] = (unsigned char) (length); |
|
1080 | header->packetLength[1] = (unsigned char) (length); | |
929 | header->sid = (unsigned char) sid; // SID |
|
1081 | header->sid = (unsigned char) sid; // SID | |
930 | header->pa_lfr_pkt_cnt_asm = 2; |
|
1082 | header->pa_lfr_pkt_cnt_asm = 2; | |
931 | header->pa_lfr_pkt_nr_asm = (unsigned char) (i+1); |
|
1083 | header->pa_lfr_pkt_nr_asm = (unsigned char) (i+1); | |
932 |
|
1084 | |||
933 | // (3) SET PACKET TIME |
|
1085 | // (3) SET PACKET TIME | |
934 | header->time[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
1086 | header->time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
935 | header->time[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
1087 | header->time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
936 | header->time[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
1088 | header->time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
937 | header->time[3] = (unsigned char) (time_management_regs->coarse_time); |
|
1089 | header->time[3] = (unsigned char) (time_management_regs->coarse_time); | |
938 | header->time[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
1090 | header->time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
939 | header->time[5] = (unsigned char) (time_management_regs->fine_time); |
|
1091 | header->time[5] = (unsigned char) (time_management_regs->fine_time); | |
940 | // |
|
1092 | // | |
941 | header->acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
1093 | header->acquisitionTime[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |
942 | header->acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
1094 | header->acquisitionTime[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |
943 | header->acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
1095 | header->acquisitionTime[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |
944 | header->acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time); |
|
1096 | header->acquisitionTime[3] = (unsigned char) (time_management_regs->coarse_time); | |
945 | header->acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8); |
|
1097 | header->acquisitionTime[4] = (unsigned char) (time_management_regs->fine_time>>8); | |
946 | header->acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time); |
|
1098 | header->acquisitionTime[5] = (unsigned char) (time_management_regs->fine_time); | |
947 |
|
1099 | |||
948 | // (4) SEND PACKET |
|
1100 | // (4) SEND PACKET | |
949 | status = rtems_message_queue_send( queue_id, spw_ioctl_send, ACTION_MSG_SPW_IOCTL_SEND_SIZE); |
|
1101 | status = rtems_message_queue_send( queue_id, spw_ioctl_send, ACTION_MSG_SPW_IOCTL_SEND_SIZE); | |
950 | if (status != RTEMS_SUCCESSFUL) { |
|
1102 | if (status != RTEMS_SUCCESSFUL) { | |
951 | printf("in ASM_send *** ERR %d\n", (int) status); |
|
1103 | printf("in ASM_send *** ERR %d\n", (int) status); | |
952 | } |
|
1104 | } | |
953 | } |
|
1105 | } | |
954 | } |
|
1106 | } | |
955 |
|
1107 | |||
956 | //***************** |
|
1108 | //***************** | |
957 | // Basic Parameters |
|
1109 | // Basic Parameters | |
958 |
|
1110 | |||
959 | void BP_init_header( Header_TM_LFR_SCIENCE_BP_t *header, |
|
1111 | void BP_init_header( Header_TM_LFR_SCIENCE_BP_t *header, | |
960 | unsigned int apid, unsigned char sid, |
|
1112 | unsigned int apid, unsigned char sid, | |
961 | unsigned int packetLength, unsigned char blkNr ) |
|
1113 | unsigned int packetLength, unsigned char blkNr ) | |
962 | { |
|
1114 | { | |
963 | header->targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
1115 | header->targetLogicalAddress = CCSDS_DESTINATION_ID; | |
964 | header->protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
1116 | header->protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
965 | header->reserved = 0x00; |
|
1117 | header->reserved = 0x00; | |
966 | header->userApplication = CCSDS_USER_APP; |
|
1118 | header->userApplication = CCSDS_USER_APP; | |
967 | header->packetID[0] = (unsigned char) (apid >> 8); |
|
1119 | header->packetID[0] = (unsigned char) (apid >> 8); | |
968 | header->packetID[1] = (unsigned char) (apid); |
|
1120 | header->packetID[1] = (unsigned char) (apid); | |
969 | header->packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; |
|
1121 | header->packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; | |
970 | header->packetSequenceControl[1] = 0x00; |
|
1122 | header->packetSequenceControl[1] = 0x00; | |
971 | header->packetLength[0] = (unsigned char) (packetLength >> 8); |
|
1123 | header->packetLength[0] = (unsigned char) (packetLength >> 8); | |
972 | header->packetLength[1] = (unsigned char) (packetLength); |
|
1124 | header->packetLength[1] = (unsigned char) (packetLength); | |
973 | // DATA FIELD HEADER |
|
1125 | // DATA FIELD HEADER | |
974 | header->spare1_pusVersion_spare2 = 0x10; |
|
1126 | header->spare1_pusVersion_spare2 = 0x10; | |
975 | header->serviceType = TM_TYPE_LFR_SCIENCE; // service type |
|
1127 | header->serviceType = TM_TYPE_LFR_SCIENCE; // service type | |
976 | header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
1128 | header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype | |
977 | header->destinationID = TM_DESTINATION_ID_GROUND; |
|
1129 | header->destinationID = TM_DESTINATION_ID_GROUND; | |
978 | // AUXILIARY DATA HEADER |
|
1130 | // AUXILIARY DATA HEADER | |
979 | header->sid = sid; |
|
1131 | header->sid = sid; | |
980 | header->biaStatusInfo = 0x00; |
|
1132 | header->biaStatusInfo = 0x00; | |
981 | header->time[0] = 0x00; |
|
1133 | header->time[0] = 0x00; | |
982 | header->time[0] = 0x00; |
|
1134 | header->time[0] = 0x00; | |
983 | header->time[0] = 0x00; |
|
1135 | header->time[0] = 0x00; | |
984 | header->time[0] = 0x00; |
|
1136 | header->time[0] = 0x00; | |
985 | header->time[0] = 0x00; |
|
1137 | header->time[0] = 0x00; | |
986 | header->time[0] = 0x00; |
|
1138 | header->time[0] = 0x00; | |
987 | header->pa_lfr_bp_blk_nr[0] = 0x00; // BLK_NR MSB |
|
1139 | header->pa_lfr_bp_blk_nr[0] = 0x00; // BLK_NR MSB | |
988 | header->pa_lfr_bp_blk_nr[1] = blkNr; // BLK_NR LSB |
|
1140 | header->pa_lfr_bp_blk_nr[1] = blkNr; // BLK_NR LSB | |
989 | } |
|
1141 | } | |
990 |
|
1142 | |||
991 | void BP_init_header_with_spare(Header_TM_LFR_SCIENCE_BP_with_spare_t *header, |
|
1143 | void BP_init_header_with_spare(Header_TM_LFR_SCIENCE_BP_with_spare_t *header, | |
992 | unsigned int apid, unsigned char sid, |
|
1144 | unsigned int apid, unsigned char sid, | |
993 | unsigned int packetLength , unsigned char blkNr) |
|
1145 | unsigned int packetLength , unsigned char blkNr) | |
994 | { |
|
1146 | { | |
995 | header->targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
1147 | header->targetLogicalAddress = CCSDS_DESTINATION_ID; | |
996 | header->protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
1148 | header->protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
997 | header->reserved = 0x00; |
|
1149 | header->reserved = 0x00; | |
998 | header->userApplication = CCSDS_USER_APP; |
|
1150 | header->userApplication = CCSDS_USER_APP; | |
999 | header->packetID[0] = (unsigned char) (apid >> 8); |
|
1151 | header->packetID[0] = (unsigned char) (apid >> 8); | |
1000 | header->packetID[1] = (unsigned char) (apid); |
|
1152 | header->packetID[1] = (unsigned char) (apid); | |
1001 | header->packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; |
|
1153 | header->packetSequenceControl[0] = TM_PACKET_SEQ_CTRL_STANDALONE; | |
1002 | header->packetSequenceControl[1] = 0x00; |
|
1154 | header->packetSequenceControl[1] = 0x00; | |
1003 | header->packetLength[0] = (unsigned char) (packetLength >> 8); |
|
1155 | header->packetLength[0] = (unsigned char) (packetLength >> 8); | |
1004 | header->packetLength[1] = (unsigned char) (packetLength); |
|
1156 | header->packetLength[1] = (unsigned char) (packetLength); | |
1005 | // DATA FIELD HEADER |
|
1157 | // DATA FIELD HEADER | |
1006 | header->spare1_pusVersion_spare2 = 0x10; |
|
1158 | header->spare1_pusVersion_spare2 = 0x10; | |
1007 | header->serviceType = TM_TYPE_LFR_SCIENCE; // service type |
|
1159 | header->serviceType = TM_TYPE_LFR_SCIENCE; // service type | |
1008 | header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
1160 | header->serviceSubType = TM_SUBTYPE_LFR_SCIENCE; // service subtype | |
1009 | header->destinationID = TM_DESTINATION_ID_GROUND; |
|
1161 | header->destinationID = TM_DESTINATION_ID_GROUND; | |
1010 | // AUXILIARY DATA HEADER |
|
1162 | // AUXILIARY DATA HEADER | |
1011 | header->sid = sid; |
|
1163 | header->sid = sid; | |
1012 | header->biaStatusInfo = 0x00; |
|
1164 | header->biaStatusInfo = 0x00; | |
1013 | header->time[0] = 0x00; |
|
1165 | header->time[0] = 0x00; | |
1014 | header->time[0] = 0x00; |
|
1166 | header->time[0] = 0x00; | |
1015 | header->time[0] = 0x00; |
|
1167 | header->time[0] = 0x00; | |
1016 | header->time[0] = 0x00; |
|
1168 | header->time[0] = 0x00; | |
1017 | header->time[0] = 0x00; |
|
1169 | header->time[0] = 0x00; | |
1018 | header->time[0] = 0x00; |
|
1170 | header->time[0] = 0x00; | |
1019 | header->pa_lfr_bp_blk_nr[0] = 0x00; // BLK_NR MSB |
|
1171 | header->pa_lfr_bp_blk_nr[0] = 0x00; // BLK_NR MSB | |
1020 | header->pa_lfr_bp_blk_nr[1] = blkNr; // BLK_NR LSB |
|
1172 | header->pa_lfr_bp_blk_nr[1] = blkNr; // BLK_NR LSB | |
1021 | } |
|
1173 | } | |
1022 |
|
1174 | |||
1023 | void BP_send(char *data, rtems_id queue_id, unsigned int nbBytesToSend ) |
|
1175 | void BP_send(char *data, rtems_id queue_id, unsigned int nbBytesToSend ) | |
1024 | { |
|
1176 | { | |
1025 | rtems_status_code status; |
|
1177 | rtems_status_code status; | |
1026 |
|
1178 | |||
1027 | // SEND PACKET |
|
1179 | // SEND PACKET | |
1028 | status = rtems_message_queue_send( queue_id, data, nbBytesToSend); |
|
1180 | status = rtems_message_queue_send( queue_id, data, nbBytesToSend); | |
1029 | if (status != RTEMS_SUCCESSFUL) |
|
1181 | if (status != RTEMS_SUCCESSFUL) | |
1030 | { |
|
1182 | { | |
1031 | printf("ERR *** in BP_send *** ERR %d\n", (int) status); |
|
1183 | printf("ERR *** in BP_send *** ERR %d\n", (int) status); | |
1032 | } |
|
1184 | } | |
1033 | } |
|
1185 | } | |
1034 |
|
1186 | |||
1035 | //****************** |
|
1187 | //****************** | |
1036 | // general functions |
|
1188 | // general functions | |
1037 |
|
1189 | |||
1038 | void reset_spectral_matrix_regs( void ) |
|
1190 | void reset_spectral_matrix_regs( void ) | |
1039 | { |
|
1191 | { | |
1040 | /** This function resets the spectral matrices module registers. |
|
1192 | /** This function resets the spectral matrices module registers. | |
1041 | * |
|
1193 | * | |
1042 | * The registers affected by this function are located at the following offset addresses: |
|
1194 | * The registers affected by this function are located at the following offset addresses: | |
1043 | * |
|
1195 | * | |
1044 | * - 0x00 config |
|
1196 | * - 0x00 config | |
1045 | * - 0x04 status |
|
1197 | * - 0x04 status | |
1046 | * - 0x08 matrixF0_Address0 |
|
1198 | * - 0x08 matrixF0_Address0 | |
1047 | * - 0x10 matrixFO_Address1 |
|
1199 | * - 0x10 matrixFO_Address1 | |
1048 | * - 0x14 matrixF1_Address |
|
1200 | * - 0x14 matrixF1_Address | |
1049 | * - 0x18 matrixF2_Address |
|
1201 | * - 0x18 matrixF2_Address | |
1050 | * |
|
1202 | * | |
1051 | */ |
|
1203 | */ | |
1052 |
|
1204 | |||
1053 | spectral_matrix_regs->config = 0x00; |
|
1205 | spectral_matrix_regs->config = 0x00; | |
1054 | spectral_matrix_regs->status = 0x00; |
|
1206 | spectral_matrix_regs->status = 0x00; | |
1055 |
|
1207 | |||
1056 | spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address; |
|
1208 | spectral_matrix_regs->matrixF0_Address0 = current_ring_node_sm_f0->buffer_address; | |
1057 | spectral_matrix_regs->matrixFO_Address1 = current_ring_node_sm_f0->buffer_address; |
|
1209 | spectral_matrix_regs->matrixFO_Address1 = current_ring_node_sm_f0->buffer_address; | |
1058 | spectral_matrix_regs->matrixF1_Address = current_ring_node_sm_f1->buffer_address; |
|
1210 | spectral_matrix_regs->matrixF1_Address = current_ring_node_sm_f1->buffer_address; | |
1059 | spectral_matrix_regs->matrixF2_Address = current_ring_node_sm_f2->buffer_address; |
|
1211 | spectral_matrix_regs->matrixF2_Address = current_ring_node_sm_f2->buffer_address; | |
1060 | } |
|
1212 | } | |
1061 |
|
1213 | |||
1062 | void set_time( unsigned char *time, unsigned char * timeInBuffer ) |
|
1214 | void set_time( unsigned char *time, unsigned char * timeInBuffer ) | |
1063 | { |
|
1215 | { | |
1064 | // time[0] = timeInBuffer[2]; |
|
1216 | // time[0] = timeInBuffer[2]; | |
1065 | // time[1] = timeInBuffer[3]; |
|
1217 | // time[1] = timeInBuffer[3]; | |
1066 | // time[2] = timeInBuffer[0]; |
|
1218 | // time[2] = timeInBuffer[0]; | |
1067 | // time[3] = timeInBuffer[1]; |
|
1219 | // time[3] = timeInBuffer[1]; | |
1068 | // time[4] = timeInBuffer[6]; |
|
1220 | // time[4] = timeInBuffer[6]; | |
1069 | // time[5] = timeInBuffer[7]; |
|
1221 | // time[5] = timeInBuffer[7]; | |
1070 |
|
1222 | |||
1071 | time[0] = timeInBuffer[0]; |
|
1223 | time[0] = timeInBuffer[0]; | |
1072 | time[1] = timeInBuffer[1]; |
|
1224 | time[1] = timeInBuffer[1]; | |
1073 | time[2] = timeInBuffer[2]; |
|
1225 | time[2] = timeInBuffer[2]; | |
1074 | time[3] = timeInBuffer[3]; |
|
1226 | time[3] = timeInBuffer[3]; | |
1075 | time[4] = timeInBuffer[6]; |
|
1227 | time[4] = timeInBuffer[6]; | |
1076 | time[5] = timeInBuffer[7]; |
|
1228 | time[5] = timeInBuffer[7]; | |
1077 | } |
|
1229 | } | |
1078 |
|
1230 | |||
1079 |
|
1231 |
@@ -1,888 +1,921 | |||||
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 ); |
|
71 | close_action( &TC, result, queue_snd_id ); | |
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 ); |
|
76 | close_action( &TC, result, queue_snd_id ); | |
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 ); |
|
81 | close_action( &TC, result, queue_snd_id ); | |
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 ); |
|
86 | close_action( &TC, result, queue_snd_id ); | |
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 ); |
|
91 | close_action( &TC, result, queue_snd_id ); | |
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 ); |
|
96 | close_action( &TC, result, queue_snd_id ); | |
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 ); |
|
101 | close_action( &TC, result, queue_snd_id ); | |
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 ); |
|
105 | result = action_enter_mode( &TC, queue_snd_id ); | |
106 | close_action( &TC, result, queue_snd_id ); |
|
106 | close_action( &TC, result, queue_snd_id ); | |
107 | break; |
|
107 | break; | |
108 | // |
|
108 | // | |
109 | case TC_SUBTYPE_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 ); |
|
111 | close_action( &TC, result, queue_snd_id ); | |
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 ); |
|
116 | close_action( &TC, result, queue_snd_id ); | |
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 ); |
|
121 | close_action( &TC, result, queue_snd_id ); | |
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 ); |
|
126 | close_action( &TC, result, queue_snd_id ); | |
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 ) |
|
152 | int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id ) | |
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 | unsigned int *transitionCoarseTime_ptr; |
|
163 | unsigned int *transitionCoarseTime_ptr; | |
164 | unsigned int transitionCoarseTime; |
|
164 | unsigned int transitionCoarseTime; | |
165 | unsigned char * bytePosPtr; |
|
165 | unsigned char * bytePosPtr; | |
166 |
|
166 | |||
167 | bytePosPtr = (unsigned char *) &TC->packetID; |
|
167 | bytePosPtr = (unsigned char *) &TC->packetID; | |
168 |
|
168 | |||
169 | requestedMode = bytePosPtr[ BYTE_POS_CP_MODE_LFR_SET ]; |
|
169 | requestedMode = bytePosPtr[ BYTE_POS_CP_MODE_LFR_SET ]; | |
170 | transitionCoarseTime_ptr = (unsigned int *) ( &bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME ] ); |
|
170 | transitionCoarseTime_ptr = (unsigned int *) ( &bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME ] ); | |
171 | transitionCoarseTime = (*transitionCoarseTime_ptr) & 0x7fffffff; |
|
171 | transitionCoarseTime = (*transitionCoarseTime_ptr) & 0x7fffffff; | |
172 |
|
172 | |||
173 | status = check_mode_value( requestedMode ); |
|
173 | status = check_mode_value( requestedMode ); | |
174 |
|
174 | |||
175 | if ( status != LFR_SUCCESSFUL ) // the mode value is inconsistent |
|
175 | if ( status != LFR_SUCCESSFUL ) // the mode value is inconsistent | |
176 | { |
|
176 | { | |
177 | send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_CP_MODE_LFR_SET, requestedMode ); |
|
177 | send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_CP_MODE_LFR_SET, requestedMode ); | |
178 | } |
|
178 | } | |
179 | else // the mode value is consistent, check the transition |
|
179 | else // the mode value is consistent, check the transition | |
180 | { |
|
180 | { | |
181 | status = check_mode_transition(requestedMode); |
|
181 | status = check_mode_transition(requestedMode); | |
182 | if (status != LFR_SUCCESSFUL) |
|
182 | if (status != LFR_SUCCESSFUL) | |
183 | { |
|
183 | { | |
184 | PRINTF("ERR *** in action_enter_mode *** check_mode_transition\n") |
|
184 | PRINTF("ERR *** in action_enter_mode *** check_mode_transition\n") | |
185 | send_tm_lfr_tc_exe_not_executable( TC, queue_id ); |
|
185 | send_tm_lfr_tc_exe_not_executable( TC, queue_id ); | |
186 | } |
|
186 | } | |
187 | } |
|
187 | } | |
188 |
|
188 | |||
189 | if ( status == LFR_SUCCESSFUL ) // the transition is valid, enter the mode |
|
189 | if ( status == LFR_SUCCESSFUL ) // the transition is valid, enter the mode | |
190 | { |
|
190 | { | |
191 | status = check_transition_date( transitionCoarseTime ); |
|
191 | status = check_transition_date( transitionCoarseTime ); | |
192 | if (status != LFR_SUCCESSFUL) |
|
192 | if (status != LFR_SUCCESSFUL) | |
193 | { |
|
193 | { | |
194 | PRINTF("ERR *** in action_enter_mode *** check_transition_date\n") |
|
194 | PRINTF("ERR *** in action_enter_mode *** check_transition_date\n") | |
195 | send_tm_lfr_tc_exe_inconsistent( TC, queue_id, |
|
195 | send_tm_lfr_tc_exe_inconsistent( TC, queue_id, | |
196 | BYTE_POS_CP_LFR_ENTER_MODE_TIME, |
|
196 | BYTE_POS_CP_LFR_ENTER_MODE_TIME, | |
197 | bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME + 3 ] ); |
|
197 | bytePosPtr[ BYTE_POS_CP_LFR_ENTER_MODE_TIME + 3 ] ); | |
198 | } |
|
198 | } | |
199 | } |
|
199 | } | |
200 |
|
200 | |||
201 | if ( status == LFR_SUCCESSFUL ) // the date is valid, enter the mode |
|
201 | if ( status == LFR_SUCCESSFUL ) // the date is valid, enter the mode | |
202 | { |
|
202 | { | |
203 | PRINTF1("OK *** in action_enter_mode *** enter mode %d\n", requestedMode); |
|
203 | PRINTF1("OK *** in action_enter_mode *** enter mode %d\n", requestedMode); | |
204 | status = enter_mode( requestedMode, transitionCoarseTime ); |
|
204 | status = enter_mode( requestedMode, transitionCoarseTime ); | |
205 | } |
|
205 | } | |
206 |
|
206 | |||
207 | return status; |
|
207 | return status; | |
208 | } |
|
208 | } | |
209 |
|
209 | |||
210 | int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id) |
|
210 | int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id) | |
211 | { |
|
211 | { | |
212 | /** This function executes specific actions when a TC_LFR_UPDATE_INFO TeleCommand has been received. |
|
212 | /** This function executes specific actions when a TC_LFR_UPDATE_INFO TeleCommand has been received. | |
213 | * |
|
213 | * | |
214 | * @param TC points to the TeleCommand packet that is being processed |
|
214 | * @param TC points to the TeleCommand packet that is being processed | |
215 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
215 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver | |
216 | * |
|
216 | * | |
217 | * @return LFR directive status code: |
|
217 | * @return LFR directive status code: | |
218 | * - LFR_DEFAULT |
|
218 | * - LFR_DEFAULT | |
219 | * - LFR_SUCCESSFUL |
|
219 | * - LFR_SUCCESSFUL | |
220 | * |
|
220 | * | |
221 | */ |
|
221 | */ | |
222 |
|
222 | |||
223 | unsigned int val; |
|
223 | unsigned int val; | |
224 | int result; |
|
224 | int result; | |
225 | unsigned int status; |
|
225 | unsigned int status; | |
226 | unsigned char mode; |
|
226 | unsigned char mode; | |
227 | unsigned char * bytePosPtr; |
|
227 | unsigned char * bytePosPtr; | |
228 |
|
228 | |||
229 | bytePosPtr = (unsigned char *) &TC->packetID; |
|
229 | bytePosPtr = (unsigned char *) &TC->packetID; | |
230 |
|
230 | |||
231 | // check LFR mode |
|
231 | // check LFR mode | |
232 | mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET5 ] & 0x1e) >> 1; |
|
232 | mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET5 ] & 0x1e) >> 1; | |
233 | status = check_update_info_hk_lfr_mode( mode ); |
|
233 | status = check_update_info_hk_lfr_mode( mode ); | |
234 | if (status == LFR_SUCCESSFUL) // check TDS mode |
|
234 | if (status == LFR_SUCCESSFUL) // check TDS mode | |
235 | { |
|
235 | { | |
236 | mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 ] & 0xf0) >> 4; |
|
236 | mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 ] & 0xf0) >> 4; | |
237 | status = check_update_info_hk_tds_mode( mode ); |
|
237 | status = check_update_info_hk_tds_mode( mode ); | |
238 | } |
|
238 | } | |
239 | if (status == LFR_SUCCESSFUL) // check THR mode |
|
239 | if (status == LFR_SUCCESSFUL) // check THR mode | |
240 | { |
|
240 | { | |
241 | mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 ] & 0x0f); |
|
241 | mode = (bytePosPtr[ BYTE_POS_UPDATE_INFO_PARAMETERS_SET6 ] & 0x0f); | |
242 | status = check_update_info_hk_thr_mode( mode ); |
|
242 | status = check_update_info_hk_thr_mode( mode ); | |
243 | } |
|
243 | } | |
244 | if (status == LFR_SUCCESSFUL) // if the parameter check is successful |
|
244 | if (status == LFR_SUCCESSFUL) // if the parameter check is successful | |
245 | { |
|
245 | { | |
246 | val = housekeeping_packet.hk_lfr_update_info_tc_cnt[0] * 256 |
|
246 | val = housekeeping_packet.hk_lfr_update_info_tc_cnt[0] * 256 | |
247 | + housekeeping_packet.hk_lfr_update_info_tc_cnt[1]; |
|
247 | + housekeeping_packet.hk_lfr_update_info_tc_cnt[1]; | |
248 | val++; |
|
248 | val++; | |
249 | housekeeping_packet.hk_lfr_update_info_tc_cnt[0] = (unsigned char) (val >> 8); |
|
249 | housekeeping_packet.hk_lfr_update_info_tc_cnt[0] = (unsigned char) (val >> 8); | |
250 | housekeeping_packet.hk_lfr_update_info_tc_cnt[1] = (unsigned char) (val); |
|
250 | housekeeping_packet.hk_lfr_update_info_tc_cnt[1] = (unsigned char) (val); | |
251 | } |
|
251 | } | |
252 |
|
252 | |||
253 | result = status; |
|
253 | result = status; | |
254 |
|
254 | |||
255 | return result; |
|
255 | return result; | |
256 | } |
|
256 | } | |
257 |
|
257 | |||
258 | int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
258 | int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) | |
259 | { |
|
259 | { | |
260 | /** This function executes specific actions when a TC_LFR_ENABLE_CALIBRATION TeleCommand has been received. |
|
260 | /** This function executes specific actions when a TC_LFR_ENABLE_CALIBRATION TeleCommand has been received. | |
261 | * |
|
261 | * | |
262 | * @param TC points to the TeleCommand packet that is being processed |
|
262 | * @param TC points to the TeleCommand packet that is being processed | |
263 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
263 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver | |
264 | * |
|
264 | * | |
265 | */ |
|
265 | */ | |
266 |
|
266 | |||
267 | int result; |
|
267 | int result; | |
268 | unsigned char lfrMode; |
|
268 | unsigned char lfrMode; | |
269 |
|
269 | |||
270 | result = LFR_DEFAULT; |
|
270 | result = LFR_DEFAULT; | |
271 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
271 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
272 |
|
272 | |||
273 | send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); |
|
273 | send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); | |
274 | result = LFR_DEFAULT; |
|
274 | result = LFR_DEFAULT; | |
275 |
|
275 | |||
276 | return result; |
|
276 | return result; | |
277 | } |
|
277 | } | |
278 |
|
278 | |||
279 | int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) |
|
279 | int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time) | |
280 | { |
|
280 | { | |
281 | /** This function executes specific actions when a TC_LFR_DISABLE_CALIBRATION TeleCommand has been received. |
|
281 | /** This function executes specific actions when a TC_LFR_DISABLE_CALIBRATION TeleCommand has been received. | |
282 | * |
|
282 | * | |
283 | * @param TC points to the TeleCommand packet that is being processed |
|
283 | * @param TC points to the TeleCommand packet that is being processed | |
284 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
284 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver | |
285 | * |
|
285 | * | |
286 | */ |
|
286 | */ | |
287 |
|
287 | |||
288 | int result; |
|
288 | int result; | |
289 | unsigned char lfrMode; |
|
289 | unsigned char lfrMode; | |
290 |
|
290 | |||
291 | result = LFR_DEFAULT; |
|
291 | result = LFR_DEFAULT; | |
292 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
292 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
293 |
|
293 | |||
294 | send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); |
|
294 | send_tm_lfr_tc_exe_not_implemented( TC, queue_id, time ); | |
295 | result = LFR_DEFAULT; |
|
295 | result = LFR_DEFAULT; | |
296 |
|
296 | |||
297 | return result; |
|
297 | return result; | |
298 | } |
|
298 | } | |
299 |
|
299 | |||
300 | int action_update_time(ccsdsTelecommandPacket_t *TC) |
|
300 | int action_update_time(ccsdsTelecommandPacket_t *TC) | |
301 | { |
|
301 | { | |
302 | /** This function executes specific actions when a TC_LFR_UPDATE_TIME TeleCommand has been received. |
|
302 | /** This function executes specific actions when a TC_LFR_UPDATE_TIME TeleCommand has been received. | |
303 | * |
|
303 | * | |
304 | * @param TC points to the TeleCommand packet that is being processed |
|
304 | * @param TC points to the TeleCommand packet that is being processed | |
305 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver |
|
305 | * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver | |
306 | * |
|
306 | * | |
307 | * @return LFR_SUCCESSFUL |
|
307 | * @return LFR_SUCCESSFUL | |
308 | * |
|
308 | * | |
309 | */ |
|
309 | */ | |
310 |
|
310 | |||
311 | unsigned int val; |
|
311 | unsigned int val; | |
312 |
|
312 | |||
313 | time_management_regs->coarse_time_load = (TC->dataAndCRC[0] << 24) |
|
313 | time_management_regs->coarse_time_load = (TC->dataAndCRC[0] << 24) | |
314 | + (TC->dataAndCRC[1] << 16) |
|
314 | + (TC->dataAndCRC[1] << 16) | |
315 | + (TC->dataAndCRC[2] << 8) |
|
315 | + (TC->dataAndCRC[2] << 8) | |
316 | + TC->dataAndCRC[3]; |
|
316 | + TC->dataAndCRC[3]; | |
317 |
|
317 | |||
318 | PRINTF1("time received: %x\n", time_management_regs->coarse_time_load) |
|
318 | PRINTF1("time received: %x\n", time_management_regs->coarse_time_load) | |
319 |
|
319 | |||
320 | val = housekeeping_packet.hk_lfr_update_time_tc_cnt[0] * 256 |
|
320 | val = housekeeping_packet.hk_lfr_update_time_tc_cnt[0] * 256 | |
321 | + housekeeping_packet.hk_lfr_update_time_tc_cnt[1]; |
|
321 | + housekeeping_packet.hk_lfr_update_time_tc_cnt[1]; | |
322 | val++; |
|
322 | val++; | |
323 | housekeeping_packet.hk_lfr_update_time_tc_cnt[0] = (unsigned char) (val >> 8); |
|
323 | housekeeping_packet.hk_lfr_update_time_tc_cnt[0] = (unsigned char) (val >> 8); | |
324 | housekeeping_packet.hk_lfr_update_time_tc_cnt[1] = (unsigned char) (val); |
|
324 | housekeeping_packet.hk_lfr_update_time_tc_cnt[1] = (unsigned char) (val); | |
325 | // time_management_regs->ctrl = time_management_regs->ctrl | 1; // force tick |
|
325 | // time_management_regs->ctrl = time_management_regs->ctrl | 1; // force tick | |
326 |
|
326 | |||
327 | return LFR_SUCCESSFUL; |
|
327 | return LFR_SUCCESSFUL; | |
328 | } |
|
328 | } | |
329 |
|
329 | |||
330 | //******************* |
|
330 | //******************* | |
331 | // ENTERING THE MODES |
|
331 | // ENTERING THE MODES | |
332 | int check_mode_value( unsigned char requestedMode ) |
|
332 | int check_mode_value( unsigned char requestedMode ) | |
333 | { |
|
333 | { | |
334 | int status; |
|
334 | int status; | |
335 |
|
335 | |||
336 | if ( (requestedMode != LFR_MODE_STANDBY) |
|
336 | if ( (requestedMode != LFR_MODE_STANDBY) | |
337 | && (requestedMode != LFR_MODE_NORMAL) && (requestedMode != LFR_MODE_BURST) |
|
337 | && (requestedMode != LFR_MODE_NORMAL) && (requestedMode != LFR_MODE_BURST) | |
338 | && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) ) |
|
338 | && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) ) | |
339 | { |
|
339 | { | |
340 | status = LFR_DEFAULT; |
|
340 | status = LFR_DEFAULT; | |
341 | } |
|
341 | } | |
342 | else |
|
342 | else | |
343 | { |
|
343 | { | |
344 | status = LFR_SUCCESSFUL; |
|
344 | status = LFR_SUCCESSFUL; | |
345 | } |
|
345 | } | |
346 |
|
346 | |||
347 | return status; |
|
347 | return status; | |
348 | } |
|
348 | } | |
349 |
|
349 | |||
350 | int check_mode_transition( unsigned char requestedMode ) |
|
350 | int check_mode_transition( unsigned char requestedMode ) | |
351 | { |
|
351 | { | |
352 | /** This function checks the validity of the transition requested by the TC_LFR_ENTER_MODE. |
|
352 | /** This function checks the validity of the transition requested by the TC_LFR_ENTER_MODE. | |
353 | * |
|
353 | * | |
354 | * @param requestedMode is the mode requested by the TC_LFR_ENTER_MODE |
|
354 | * @param requestedMode is the mode requested by the TC_LFR_ENTER_MODE | |
355 | * |
|
355 | * | |
356 | * @return LFR directive status codes: |
|
356 | * @return LFR directive status codes: | |
357 | * - LFR_SUCCESSFUL - the transition is authorized |
|
357 | * - LFR_SUCCESSFUL - the transition is authorized | |
358 | * - LFR_DEFAULT - the transition is not authorized |
|
358 | * - LFR_DEFAULT - the transition is not authorized | |
359 | * |
|
359 | * | |
360 | */ |
|
360 | */ | |
361 |
|
361 | |||
362 | int status; |
|
362 | int status; | |
363 |
|
363 | |||
364 | switch (requestedMode) |
|
364 | switch (requestedMode) | |
365 | { |
|
365 | { | |
366 | case LFR_MODE_STANDBY: |
|
366 | case LFR_MODE_STANDBY: | |
367 | if ( lfrCurrentMode == LFR_MODE_STANDBY ) { |
|
367 | if ( lfrCurrentMode == LFR_MODE_STANDBY ) { | |
368 | status = LFR_DEFAULT; |
|
368 | status = LFR_DEFAULT; | |
369 | } |
|
369 | } | |
370 | else |
|
370 | else | |
371 | { |
|
371 | { | |
372 | status = LFR_SUCCESSFUL; |
|
372 | status = LFR_SUCCESSFUL; | |
373 | } |
|
373 | } | |
374 | break; |
|
374 | break; | |
375 | case LFR_MODE_NORMAL: |
|
375 | case LFR_MODE_NORMAL: | |
376 | if ( lfrCurrentMode == LFR_MODE_NORMAL ) { |
|
376 | if ( lfrCurrentMode == LFR_MODE_NORMAL ) { | |
377 | status = LFR_DEFAULT; |
|
377 | status = LFR_DEFAULT; | |
378 | } |
|
378 | } | |
379 | else { |
|
379 | else { | |
380 | status = LFR_SUCCESSFUL; |
|
380 | status = LFR_SUCCESSFUL; | |
381 | } |
|
381 | } | |
382 | break; |
|
382 | break; | |
383 | case LFR_MODE_BURST: |
|
383 | case LFR_MODE_BURST: | |
384 | if ( lfrCurrentMode == LFR_MODE_BURST ) { |
|
384 | if ( lfrCurrentMode == LFR_MODE_BURST ) { | |
385 | status = LFR_DEFAULT; |
|
385 | status = LFR_DEFAULT; | |
386 | } |
|
386 | } | |
387 | else { |
|
387 | else { | |
388 | status = LFR_SUCCESSFUL; |
|
388 | status = LFR_SUCCESSFUL; | |
389 | } |
|
389 | } | |
390 | break; |
|
390 | break; | |
391 | case LFR_MODE_SBM1: |
|
391 | case LFR_MODE_SBM1: | |
392 | if ( lfrCurrentMode == LFR_MODE_SBM1 ) { |
|
392 | if ( lfrCurrentMode == LFR_MODE_SBM1 ) { | |
393 | status = LFR_DEFAULT; |
|
393 | status = LFR_DEFAULT; | |
394 | } |
|
394 | } | |
395 | else { |
|
395 | else { | |
396 | status = LFR_SUCCESSFUL; |
|
396 | status = LFR_SUCCESSFUL; | |
397 | } |
|
397 | } | |
398 | break; |
|
398 | break; | |
399 | case LFR_MODE_SBM2: |
|
399 | case LFR_MODE_SBM2: | |
400 | if ( lfrCurrentMode == LFR_MODE_SBM2 ) { |
|
400 | if ( lfrCurrentMode == LFR_MODE_SBM2 ) { | |
401 | status = LFR_DEFAULT; |
|
401 | status = LFR_DEFAULT; | |
402 | } |
|
402 | } | |
403 | else { |
|
403 | else { | |
404 | status = LFR_SUCCESSFUL; |
|
404 | status = LFR_SUCCESSFUL; | |
405 | } |
|
405 | } | |
406 | break; |
|
406 | break; | |
407 | default: |
|
407 | default: | |
408 | status = LFR_DEFAULT; |
|
408 | status = LFR_DEFAULT; | |
409 | break; |
|
409 | break; | |
410 | } |
|
410 | } | |
411 |
|
411 | |||
412 | return status; |
|
412 | return status; | |
413 | } |
|
413 | } | |
414 |
|
414 | |||
415 | int check_transition_date( unsigned int transitionCoarseTime ) |
|
415 | int check_transition_date( unsigned int transitionCoarseTime ) | |
416 | { |
|
416 | { | |
417 | int status; |
|
417 | int status; | |
418 | unsigned int localCoarseTime; |
|
418 | unsigned int localCoarseTime; | |
419 | unsigned int deltaCoarseTime; |
|
419 | unsigned int deltaCoarseTime; | |
420 |
|
420 | |||
421 | status = LFR_SUCCESSFUL; |
|
421 | status = LFR_SUCCESSFUL; | |
422 |
|
422 | |||
423 | if (transitionCoarseTime == 0) // transition time = 0 means an instant transition |
|
423 | if (transitionCoarseTime == 0) // transition time = 0 means an instant transition | |
424 | { |
|
424 | { | |
425 | status = LFR_SUCCESSFUL; |
|
425 | status = LFR_SUCCESSFUL; | |
426 | } |
|
426 | } | |
427 | else |
|
427 | else | |
428 | { |
|
428 | { | |
429 | localCoarseTime = time_management_regs->coarse_time & 0x7fffffff; |
|
429 | localCoarseTime = time_management_regs->coarse_time & 0x7fffffff; | |
430 |
|
430 | |||
431 | if ( transitionCoarseTime <= localCoarseTime ) // SSS-CP-EQS-322 |
|
431 | if ( transitionCoarseTime <= localCoarseTime ) // SSS-CP-EQS-322 | |
432 | { |
|
432 | { | |
433 | status = LFR_DEFAULT; |
|
433 | status = LFR_DEFAULT; | |
434 | PRINTF2("ERR *** in check_transition_date *** transition = %x, local = %x\n", transitionCoarseTime, localCoarseTime) |
|
434 | PRINTF2("ERR *** in check_transition_date *** transition = %x, local = %x\n", transitionCoarseTime, localCoarseTime) | |
435 | } |
|
435 | } | |
436 |
|
436 | |||
437 | if (status == LFR_SUCCESSFUL) |
|
437 | if (status == LFR_SUCCESSFUL) | |
438 | { |
|
438 | { | |
439 | deltaCoarseTime = transitionCoarseTime - localCoarseTime; |
|
439 | deltaCoarseTime = transitionCoarseTime - localCoarseTime; | |
440 | if ( deltaCoarseTime > 3 ) // SSS-CP-EQS-323 |
|
440 | if ( deltaCoarseTime > 3 ) // SSS-CP-EQS-323 | |
441 | { |
|
441 | { | |
442 | status = LFR_DEFAULT; |
|
442 | status = LFR_DEFAULT; | |
443 | PRINTF1("ERR *** in check_transition_date *** deltaCoarseTime = %x\n", deltaCoarseTime) |
|
443 | PRINTF1("ERR *** in check_transition_date *** deltaCoarseTime = %x\n", deltaCoarseTime) | |
444 | } |
|
444 | } | |
445 | } |
|
445 | } | |
446 | } |
|
446 | } | |
447 |
|
447 | |||
448 | return status; |
|
448 | return status; | |
449 | } |
|
449 | } | |
450 |
|
450 | |||
451 | int stop_current_mode( void ) |
|
451 | int stop_current_mode( void ) | |
452 | { |
|
452 | { | |
453 | /** This function stops the current mode by masking interrupt lines and suspending science tasks. |
|
453 | /** This function stops the current mode by masking interrupt lines and suspending science tasks. | |
454 | * |
|
454 | * | |
455 | * @return RTEMS directive status codes: |
|
455 | * @return RTEMS directive status codes: | |
456 | * - RTEMS_SUCCESSFUL - task restarted successfully |
|
456 | * - RTEMS_SUCCESSFUL - task restarted successfully | |
457 | * - RTEMS_INVALID_ID - task id invalid |
|
457 | * - RTEMS_INVALID_ID - task id invalid | |
458 | * - RTEMS_ALREADY_SUSPENDED - task already suspended |
|
458 | * - RTEMS_ALREADY_SUSPENDED - task already suspended | |
459 | * |
|
459 | * | |
460 | */ |
|
460 | */ | |
461 |
|
461 | |||
462 | rtems_status_code status; |
|
462 | rtems_status_code status; | |
463 |
|
463 | |||
464 | status = RTEMS_SUCCESSFUL; |
|
464 | status = RTEMS_SUCCESSFUL; | |
465 |
|
465 | |||
466 | // (1) mask interruptions |
|
466 | // (1) mask interruptions | |
467 | LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); // mask waveform picker interrupt |
|
467 | LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); // mask waveform picker interrupt | |
468 | LEON_Mask_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectral matrix interrupt |
|
468 | LEON_Mask_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectral matrix interrupt | |
469 |
|
469 | |||
470 | // (2) clear interruptions |
|
470 | // (2) clear interruptions | |
471 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); // clear waveform picker interrupt |
|
471 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); // clear waveform picker interrupt | |
472 | LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectral matrix interrupt |
|
472 | LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectral matrix interrupt | |
473 |
|
473 | |||
474 | // (3) reset waveform picker registers |
|
474 | // (3) reset waveform picker registers | |
475 | reset_wfp_burst_enable(); // reset burst and enable bits |
|
475 | reset_wfp_burst_enable(); // reset burst and enable bits | |
476 | reset_wfp_status(); // reset all the status bits |
|
476 | reset_wfp_status(); // reset all the status bits | |
477 |
|
477 | |||
478 | // (4) reset spectral matrices registers |
|
478 | // (4) reset spectral matrices registers | |
479 | set_irq_on_new_ready_matrix( 0 ); // stop the spectral matrices |
|
479 | set_irq_on_new_ready_matrix( 0 ); // stop the spectral matrices | |
480 | set_run_matrix_spectral( 0 ); // run_matrix_spectral is set to 0 |
|
480 | set_run_matrix_spectral( 0 ); // run_matrix_spectral is set to 0 | |
481 | reset_extractSWF(); // reset the extractSWF flag to false |
|
481 | reset_extractSWF(); // reset the extractSWF flag to false | |
482 |
|
482 | |||
483 | // <Spectral Matrices simulator> |
|
483 | // <Spectral Matrices simulator> | |
484 | LEON_Mask_interrupt( IRQ_SM_SIMULATOR ); // mask spectral matrix interrupt simulator |
|
484 | LEON_Mask_interrupt( IRQ_SM_SIMULATOR ); // mask spectral matrix interrupt simulator | |
485 | timer_stop( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR ); |
|
485 | timer_stop( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR ); | |
486 | LEON_Clear_interrupt( IRQ_SM_SIMULATOR ); // clear spectral matrix interrupt simulator |
|
486 | LEON_Clear_interrupt( IRQ_SM_SIMULATOR ); // clear spectral matrix interrupt simulator | |
487 | // </Spectral Matrices simulator> |
|
487 | // </Spectral Matrices simulator> | |
488 |
|
488 | |||
489 | // suspend several tasks |
|
489 | // suspend several tasks | |
490 | if (lfrCurrentMode != LFR_MODE_STANDBY) { |
|
490 | if (lfrCurrentMode != LFR_MODE_STANDBY) { | |
491 | status = suspend_science_tasks(); |
|
491 | status = suspend_science_tasks(); | |
492 | } |
|
492 | } | |
493 |
|
493 | |||
494 | if (status != RTEMS_SUCCESSFUL) |
|
494 | if (status != RTEMS_SUCCESSFUL) | |
495 | { |
|
495 | { | |
496 | PRINTF1("in stop_current_mode *** in suspend_science_tasks *** ERR code: %d\n", status) |
|
496 | PRINTF1("in stop_current_mode *** in suspend_science_tasks *** ERR code: %d\n", status) | |
497 | } |
|
497 | } | |
498 |
|
498 | |||
499 | return status; |
|
499 | return status; | |
500 | } |
|
500 | } | |
501 |
|
501 | |||
502 | int enter_mode( unsigned char mode, unsigned int transitionCoarseTime ) |
|
502 | int enter_mode( unsigned char mode, unsigned int transitionCoarseTime ) | |
503 | { |
|
503 | { | |
504 | /** This function is launched after a mode transition validation. |
|
504 | /** This function is launched after a mode transition validation. | |
505 | * |
|
505 | * | |
506 | * @param mode is the mode in which LFR will be put. |
|
506 | * @param mode is the mode in which LFR will be put. | |
507 | * |
|
507 | * | |
508 | * @return RTEMS directive status codes: |
|
508 | * @return RTEMS directive status codes: | |
509 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully |
|
509 | * - RTEMS_SUCCESSFUL - the mode has been entered successfully | |
510 | * - RTEMS_NOT_SATISFIED - the mode has not been entered successfully |
|
510 | * - RTEMS_NOT_SATISFIED - the mode has not been entered successfully | |
511 | * |
|
511 | * | |
512 | */ |
|
512 | */ | |
513 |
|
513 | |||
514 | rtems_status_code status; |
|
514 | rtems_status_code status; | |
515 |
|
515 | |||
516 | //********************** |
|
516 | //********************** | |
517 | // STOP THE CURRENT MODE |
|
517 | // STOP THE CURRENT MODE | |
518 | status = stop_current_mode(); |
|
518 | status = stop_current_mode(); | |
519 | if (status != RTEMS_SUCCESSFUL) |
|
519 | if (status != RTEMS_SUCCESSFUL) | |
520 | { |
|
520 | { | |
521 | PRINTF1("ERR *** in enter_mode *** stop_current_mode with mode = %d\n", mode) |
|
521 | PRINTF1("ERR *** in enter_mode *** stop_current_mode with mode = %d\n", mode) | |
522 | } |
|
522 | } | |
523 |
|
523 | |||
524 | //************************* |
|
524 | //************************* | |
525 | // ENTER THE REQUESTED MODE |
|
525 | // ENTER THE REQUESTED MODE | |
526 | if ( (mode == LFR_MODE_NORMAL) || (mode == LFR_MODE_BURST) |
|
526 | if ( (mode == LFR_MODE_NORMAL) || (mode == LFR_MODE_BURST) | |
527 | || (mode == LFR_MODE_SBM1) || (mode == LFR_MODE_SBM2) ) |
|
527 | || (mode == LFR_MODE_SBM1) || (mode == LFR_MODE_SBM2) ) | |
528 | { |
|
528 | { | |
529 | #ifdef PRINT_TASK_STATISTICS |
|
529 | #ifdef PRINT_TASK_STATISTICS | |
530 | rtems_cpu_usage_reset(); |
|
530 | rtems_cpu_usage_reset(); | |
531 | maxCount = 0; |
|
531 | maxCount = 0; | |
532 | #endif |
|
532 | #endif | |
533 | status = restart_science_tasks( mode ); |
|
533 | status = restart_science_tasks( mode ); | |
534 | launch_waveform_picker( mode, transitionCoarseTime ); |
|
534 | launch_waveform_picker( mode, transitionCoarseTime ); | |
535 | // launch_spectral_matrix( ); |
|
535 | // launch_spectral_matrix( ); | |
536 | // launch_spectral_matrix_simu( ); |
|
536 | // launch_spectral_matrix_simu( ); | |
537 | } |
|
537 | } | |
538 | else if ( mode == LFR_MODE_STANDBY ) |
|
538 | else if ( mode == LFR_MODE_STANDBY ) | |
539 | { |
|
539 | { | |
540 | #ifdef PRINT_TASK_STATISTICS |
|
540 | #ifdef PRINT_TASK_STATISTICS | |
541 | rtems_cpu_usage_report(); |
|
541 | rtems_cpu_usage_report(); | |
542 | #endif |
|
542 | #endif | |
543 |
|
543 | |||
544 | #ifdef PRINT_STACK_REPORT |
|
544 | #ifdef PRINT_STACK_REPORT | |
545 | PRINTF("stack report selected\n") |
|
545 | PRINTF("stack report selected\n") | |
546 | rtems_stack_checker_report_usage(); |
|
546 | rtems_stack_checker_report_usage(); | |
547 | #endif |
|
547 | #endif | |
548 | PRINTF1("maxCount = %d\n", maxCount) |
|
548 | PRINTF1("maxCount = %d\n", maxCount) | |
549 | } |
|
549 | } | |
550 | else |
|
550 | else | |
551 | { |
|
551 | { | |
552 | status = RTEMS_UNSATISFIED; |
|
552 | status = RTEMS_UNSATISFIED; | |
553 | } |
|
553 | } | |
554 |
|
554 | |||
555 | if (status != RTEMS_SUCCESSFUL) |
|
555 | if (status != RTEMS_SUCCESSFUL) | |
556 | { |
|
556 | { | |
557 | PRINTF1("ERR *** in enter_mode *** status = %d\n", status) |
|
557 | PRINTF1("ERR *** in enter_mode *** status = %d\n", status) | |
558 | status = RTEMS_UNSATISFIED; |
|
558 | status = RTEMS_UNSATISFIED; | |
559 | } |
|
559 | } | |
560 |
|
560 | |||
561 | return status; |
|
561 | return status; | |
562 | } |
|
562 | } | |
563 |
|
563 | |||
564 | int restart_science_tasks(unsigned char lfrRequestedMode ) |
|
564 | int restart_science_tasks(unsigned char lfrRequestedMode ) | |
565 | { |
|
565 | { | |
566 | /** This function is used to restart all science tasks. |
|
566 | /** This function is used to restart all science tasks. | |
567 | * |
|
567 | * | |
568 | * @return RTEMS directive status codes: |
|
568 | * @return RTEMS directive status codes: | |
569 | * - RTEMS_SUCCESSFUL - task restarted successfully |
|
569 | * - RTEMS_SUCCESSFUL - task restarted successfully | |
570 | * - RTEMS_INVALID_ID - task id invalid |
|
570 | * - RTEMS_INVALID_ID - task id invalid | |
571 | * - RTEMS_INCORRECT_STATE - task never started |
|
571 | * - RTEMS_INCORRECT_STATE - task never started | |
572 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task |
|
572 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot restart remote task | |
573 | * |
|
573 | * | |
574 |
* Science tasks are AVF0, |
|
574 | * Science tasks are AVF0, PRC0, WFRM, CWF3, CW2, CWF1 | |
575 | * |
|
575 | * | |
576 | */ |
|
576 | */ | |
577 |
|
577 | |||
578 |
rtems_status_code status[ |
|
578 | rtems_status_code status[8]; | |
579 | rtems_status_code ret; |
|
579 | rtems_status_code ret; | |
580 |
|
580 | |||
581 | ret = RTEMS_SUCCESSFUL; |
|
581 | ret = RTEMS_SUCCESSFUL; | |
582 |
|
582 | |||
583 | status[0] = rtems_task_restart( Task_id[TASKID_AVF0], lfrRequestedMode ); |
|
583 | status[0] = rtems_task_restart( Task_id[TASKID_AVF0], lfrRequestedMode ); | |
584 | if (status[0] != RTEMS_SUCCESSFUL) |
|
584 | if (status[0] != RTEMS_SUCCESSFUL) | |
585 | { |
|
585 | { | |
586 | PRINTF1("in restart_science_task *** 0 ERR %d\n", status[0]) |
|
586 | PRINTF1("in restart_science_task *** AVF0 ERR %d\n", status[0]) | |
|
587 | } | |||
|
588 | ||||
|
589 | status[1] = rtems_task_restart( Task_id[TASKID_PRC0], lfrRequestedMode ); | |||
|
590 | if (status[1] != RTEMS_SUCCESSFUL) | |||
|
591 | { | |||
|
592 | PRINTF1("in restart_science_task *** PRC0 ERR %d\n", status[1]) | |||
587 | } |
|
593 | } | |
588 |
|
594 | |||
589 | status[2] = rtems_task_restart( Task_id[TASKID_WFRM],1 ); |
|
595 | status[2] = rtems_task_restart( Task_id[TASKID_WFRM],1 ); | |
590 | if (status[2] != RTEMS_SUCCESSFUL) |
|
596 | if (status[2] != RTEMS_SUCCESSFUL) | |
591 | { |
|
597 | { | |
592 |
PRINTF1("in restart_science_task *** |
|
598 | PRINTF1("in restart_science_task *** WFRM ERR %d\n", status[2]) | |
593 | } |
|
599 | } | |
594 |
|
600 | |||
595 | status[3] = rtems_task_restart( Task_id[TASKID_CWF3],1 ); |
|
601 | status[3] = rtems_task_restart( Task_id[TASKID_CWF3],1 ); | |
596 | if (status[3] != RTEMS_SUCCESSFUL) |
|
602 | if (status[3] != RTEMS_SUCCESSFUL) | |
597 | { |
|
603 | { | |
598 | PRINTF1("in restart_science_task *** 3 ERR %d\n", status[3]) |
|
604 | PRINTF1("in restart_science_task *** CWF3 ERR %d\n", status[3]) | |
599 | } |
|
605 | } | |
600 |
|
606 | |||
601 | status[4] = rtems_task_restart( Task_id[TASKID_CWF2],1 ); |
|
607 | status[4] = rtems_task_restart( Task_id[TASKID_CWF2],1 ); | |
602 | if (status[4] != RTEMS_SUCCESSFUL) |
|
608 | if (status[4] != RTEMS_SUCCESSFUL) | |
603 | { |
|
609 | { | |
604 |
PRINTF1("in restart_science_task *** |
|
610 | PRINTF1("in restart_science_task *** CWF2 ERR %d\n", status[4]) | |
605 | } |
|
611 | } | |
606 |
|
612 | |||
607 | status[5] = rtems_task_restart( Task_id[TASKID_CWF1],1 ); |
|
613 | status[5] = rtems_task_restart( Task_id[TASKID_CWF1],1 ); | |
608 | if (status[5] != RTEMS_SUCCESSFUL) |
|
614 | if (status[5] != RTEMS_SUCCESSFUL) | |
609 | { |
|
615 | { | |
610 |
PRINTF1("in restart_science_task *** |
|
616 | PRINTF1("in restart_science_task *** CWF1 ERR %d\n", status[5]) | |
611 | } |
|
617 | } | |
612 |
|
618 | |||
613 |
status[6] = rtems_task_restart( Task_id[TASKID_ |
|
619 | status[6] = rtems_task_restart( Task_id[TASKID_AVF1], lfrRequestedMode ); | |
614 | if (status[6] != RTEMS_SUCCESSFUL) |
|
620 | if (status[6] != RTEMS_SUCCESSFUL) | |
615 | { |
|
621 | { | |
616 |
PRINTF1("in restart_science_task *** |
|
622 | PRINTF1("in restart_science_task *** AVF1 ERR %d\n", status[6]) | |
617 | } |
|
623 | } | |
618 |
|
624 | |||
619 | if ( (status[0] != RTEMS_SUCCESSFUL) || (status[2] != RTEMS_SUCCESSFUL) || |
|
625 | status[7] = rtems_task_restart( Task_id[TASKID_PRC1],lfrRequestedMode ); | |
620 |
|
|
626 | if (status[7] != RTEMS_SUCCESSFUL) | |
621 | (status[5] != RTEMS_SUCCESSFUL) || (status[6] != RTEMS_SUCCESSFUL) ) |
|
627 | { | |
|
628 | PRINTF1("in restart_science_task *** PRC1 ERR %d\n", status[7]) | |||
|
629 | } | |||
|
630 | ||||
|
631 | if ( (status[0] != RTEMS_SUCCESSFUL) || (status[1] != RTEMS_SUCCESSFUL) || | |||
|
632 | (status[2] != RTEMS_SUCCESSFUL) || (status[3] != RTEMS_SUCCESSFUL) || | |||
|
633 | (status[4] != RTEMS_SUCCESSFUL) || (status[5] != RTEMS_SUCCESSFUL) || | |||
|
634 | (status[6] != RTEMS_SUCCESSFUL) || (status[7] != RTEMS_SUCCESSFUL) ) | |||
622 | { |
|
635 | { | |
623 | ret = RTEMS_UNSATISFIED; |
|
636 | ret = RTEMS_UNSATISFIED; | |
624 | } |
|
637 | } | |
625 |
|
638 | |||
626 | return ret; |
|
639 | return ret; | |
627 | } |
|
640 | } | |
628 |
|
641 | |||
629 | int suspend_science_tasks() |
|
642 | int suspend_science_tasks() | |
630 | { |
|
643 | { | |
631 | /** This function suspends the science tasks. |
|
644 | /** This function suspends the science tasks. | |
632 | * |
|
645 | * | |
633 | * @return RTEMS directive status codes: |
|
646 | * @return RTEMS directive status codes: | |
634 | * - RTEMS_SUCCESSFUL - task restarted successfully |
|
647 | * - RTEMS_SUCCESSFUL - task restarted successfully | |
635 | * - RTEMS_INVALID_ID - task id invalid |
|
648 | * - RTEMS_INVALID_ID - task id invalid | |
636 | * - RTEMS_ALREADY_SUSPENDED - task already suspended |
|
649 | * - RTEMS_ALREADY_SUSPENDED - task already suspended | |
637 | * |
|
650 | * | |
638 | */ |
|
651 | */ | |
639 |
|
652 | |||
640 | rtems_status_code status; |
|
653 | rtems_status_code status; | |
641 |
|
654 | |||
642 | status = rtems_task_suspend( Task_id[TASKID_AVF0] ); |
|
655 | status = rtems_task_suspend( Task_id[TASKID_AVF0] ); // suspend AVF0 | |
643 | if (status != RTEMS_SUCCESSFUL) |
|
656 | if (status != RTEMS_SUCCESSFUL) | |
644 | { |
|
657 | { | |
645 | PRINTF1("in suspend_science_task *** AVF0 ERR %d\n", status) |
|
658 | PRINTF1("in suspend_science_task *** AVF0 ERR %d\n", status) | |
646 | } |
|
659 | } | |
647 |
|
660 | if (status == RTEMS_SUCCESSFUL) // suspend PRC0 | ||
|
661 | { | |||
|
662 | status = rtems_task_suspend( Task_id[TASKID_PRC0] ); | |||
|
663 | if (status != RTEMS_SUCCESSFUL) | |||
|
664 | { | |||
|
665 | PRINTF1("in suspend_science_task *** PRC0 ERR %d\n", status) | |||
|
666 | } | |||
|
667 | } | |||
|
668 | if (status == RTEMS_SUCCESSFUL) // suspend AVF1 | |||
|
669 | { | |||
|
670 | status = rtems_task_suspend( Task_id[TASKID_AVF1] ); | |||
|
671 | if (status != RTEMS_SUCCESSFUL) | |||
|
672 | { | |||
|
673 | PRINTF1("in suspend_science_task *** AVF1 ERR %d\n", status) | |||
|
674 | } | |||
|
675 | } | |||
|
676 | if (status == RTEMS_SUCCESSFUL) // suspend PRC1 | |||
|
677 | { | |||
|
678 | status = rtems_task_suspend( Task_id[TASKID_PRC1] ); | |||
|
679 | if (status != RTEMS_SUCCESSFUL) | |||
|
680 | { | |||
|
681 | PRINTF1("in suspend_science_task *** PRC1 ERR %d\n", status) | |||
|
682 | } | |||
|
683 | } | |||
648 | if (status == RTEMS_SUCCESSFUL) // suspend WFRM |
|
684 | if (status == RTEMS_SUCCESSFUL) // suspend WFRM | |
649 | { |
|
685 | { | |
650 | status = rtems_task_suspend( Task_id[TASKID_WFRM] ); |
|
686 | status = rtems_task_suspend( Task_id[TASKID_WFRM] ); | |
651 | if (status != RTEMS_SUCCESSFUL) |
|
687 | if (status != RTEMS_SUCCESSFUL) | |
652 | { |
|
688 | { | |
653 | PRINTF1("in suspend_science_task *** WFRM ERR %d\n", status) |
|
689 | PRINTF1("in suspend_science_task *** WFRM ERR %d\n", status) | |
654 | } |
|
690 | } | |
655 | } |
|
691 | } | |
656 |
|
||||
657 | if (status == RTEMS_SUCCESSFUL) // suspend CWF3 |
|
692 | if (status == RTEMS_SUCCESSFUL) // suspend CWF3 | |
658 | { |
|
693 | { | |
659 | status = rtems_task_suspend( Task_id[TASKID_CWF3] ); |
|
694 | status = rtems_task_suspend( Task_id[TASKID_CWF3] ); | |
660 | if (status != RTEMS_SUCCESSFUL) |
|
695 | if (status != RTEMS_SUCCESSFUL) | |
661 | { |
|
696 | { | |
662 | PRINTF1("in suspend_science_task *** CWF3 ERR %d\n", status) |
|
697 | PRINTF1("in suspend_science_task *** CWF3 ERR %d\n", status) | |
663 | } |
|
698 | } | |
664 | } |
|
699 | } | |
665 |
|
||||
666 | if (status == RTEMS_SUCCESSFUL) // suspend CWF2 |
|
700 | if (status == RTEMS_SUCCESSFUL) // suspend CWF2 | |
667 | { |
|
701 | { | |
668 | status = rtems_task_suspend( Task_id[TASKID_CWF2] ); |
|
702 | status = rtems_task_suspend( Task_id[TASKID_CWF2] ); | |
669 | if (status != RTEMS_SUCCESSFUL) |
|
703 | if (status != RTEMS_SUCCESSFUL) | |
670 | { |
|
704 | { | |
671 | PRINTF1("in suspend_science_task *** CWF2 ERR %d\n", status) |
|
705 | PRINTF1("in suspend_science_task *** CWF2 ERR %d\n", status) | |
672 | } |
|
706 | } | |
673 | } |
|
707 | } | |
674 |
|
||||
675 | if (status == RTEMS_SUCCESSFUL) // suspend CWF1 |
|
708 | if (status == RTEMS_SUCCESSFUL) // suspend CWF1 | |
676 | { |
|
709 | { | |
677 | status = rtems_task_suspend( Task_id[TASKID_CWF1] ); |
|
710 | status = rtems_task_suspend( Task_id[TASKID_CWF1] ); | |
678 | if (status != RTEMS_SUCCESSFUL) |
|
711 | if (status != RTEMS_SUCCESSFUL) | |
679 | { |
|
712 | { | |
680 | PRINTF1("in suspend_science_task *** CWF1 ERR %d\n", status) |
|
713 | PRINTF1("in suspend_science_task *** CWF1 ERR %d\n", status) | |
681 | } |
|
714 | } | |
682 | } |
|
715 | } | |
683 |
|
716 | |||
684 | return status; |
|
717 | return status; | |
685 | } |
|
718 | } | |
686 |
|
719 | |||
687 | void launch_waveform_picker( unsigned char mode, unsigned int transitionCoarseTime ) |
|
720 | void launch_waveform_picker( unsigned char mode, unsigned int transitionCoarseTime ) | |
688 | { |
|
721 | { | |
689 | reset_current_ring_nodes(); |
|
722 | reset_current_ring_nodes(); | |
690 | reset_waveform_picker_regs(); |
|
723 | reset_waveform_picker_regs(); | |
691 | set_wfp_burst_enable_register( mode ); |
|
724 | set_wfp_burst_enable_register( mode ); | |
692 |
|
725 | |||
693 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
726 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); | |
694 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
727 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); | |
695 |
|
728 | |||
696 | waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x80; // [1000 0000] |
|
729 | waveform_picker_regs->run_burst_enable = waveform_picker_regs->run_burst_enable | 0x80; // [1000 0000] | |
697 | if (transitionCoarseTime == 0) |
|
730 | if (transitionCoarseTime == 0) | |
698 | { |
|
731 | { | |
699 | waveform_picker_regs->start_date = time_management_regs->coarse_time; |
|
732 | waveform_picker_regs->start_date = time_management_regs->coarse_time; | |
700 | } |
|
733 | } | |
701 | else |
|
734 | else | |
702 | { |
|
735 | { | |
703 | waveform_picker_regs->start_date = transitionCoarseTime; |
|
736 | waveform_picker_regs->start_date = transitionCoarseTime; | |
704 | } |
|
737 | } | |
705 | } |
|
738 | } | |
706 |
|
739 | |||
707 | void launch_spectral_matrix( void ) |
|
740 | void launch_spectral_matrix( void ) | |
708 | { |
|
741 | { | |
709 | SM_reset_current_ring_nodes(); |
|
742 | SM_reset_current_ring_nodes(); | |
710 | ASM_reset_current_ring_node(); |
|
743 | ASM_reset_current_ring_nodes(); | |
711 | reset_spectral_matrix_regs(); |
|
744 | reset_spectral_matrix_regs(); | |
712 |
|
745 | |||
713 | struct grgpio_regs_str *grgpio_regs = (struct grgpio_regs_str *) REGS_ADDR_GRGPIO; |
|
746 | struct grgpio_regs_str *grgpio_regs = (struct grgpio_regs_str *) REGS_ADDR_GRGPIO; | |
714 | grgpio_regs->io_port_direction_register = |
|
747 | grgpio_regs->io_port_direction_register = | |
715 | grgpio_regs->io_port_direction_register | 0x01; // [0000 0001], 0 = output disabled, 1 = output enabled |
|
748 | grgpio_regs->io_port_direction_register | 0x01; // [0000 0001], 0 = output disabled, 1 = output enabled | |
716 | grgpio_regs->io_port_output_register = grgpio_regs->io_port_output_register & 0xfffffffe; // set the bit 0 to 0 |
|
749 | grgpio_regs->io_port_output_register = grgpio_regs->io_port_output_register & 0xfffffffe; // set the bit 0 to 0 | |
717 | set_irq_on_new_ready_matrix( 1 ); |
|
750 | set_irq_on_new_ready_matrix( 1 ); | |
718 | LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX ); |
|
751 | LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX ); | |
719 | LEON_Unmask_interrupt( IRQ_SPECTRAL_MATRIX ); |
|
752 | LEON_Unmask_interrupt( IRQ_SPECTRAL_MATRIX ); | |
720 | set_run_matrix_spectral( 1 ); |
|
753 | set_run_matrix_spectral( 1 ); | |
721 |
|
754 | |||
722 | } |
|
755 | } | |
723 |
|
756 | |||
724 | void launch_spectral_matrix_simu( void ) |
|
757 | void launch_spectral_matrix_simu( void ) | |
725 | { |
|
758 | { | |
726 | SM_reset_current_ring_nodes(); |
|
759 | SM_reset_current_ring_nodes(); | |
727 | ASM_reset_current_ring_node(); |
|
760 | ASM_reset_current_ring_nodes(); | |
728 | reset_spectral_matrix_regs(); |
|
761 | reset_spectral_matrix_regs(); | |
729 |
|
762 | |||
730 | // Spectral Matrices simulator |
|
763 | // Spectral Matrices simulator | |
731 | timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR ); |
|
764 | timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR ); | |
732 | LEON_Clear_interrupt( IRQ_SM_SIMULATOR ); |
|
765 | LEON_Clear_interrupt( IRQ_SM_SIMULATOR ); | |
733 | LEON_Unmask_interrupt( IRQ_SM_SIMULATOR ); |
|
766 | LEON_Unmask_interrupt( IRQ_SM_SIMULATOR ); | |
734 | set_local_nb_interrupt_f0_MAX(); |
|
767 | set_local_nb_interrupt_f0_MAX(); | |
735 | } |
|
768 | } | |
736 |
|
769 | |||
737 | void set_irq_on_new_ready_matrix( unsigned char value ) |
|
770 | void set_irq_on_new_ready_matrix( unsigned char value ) | |
738 | { |
|
771 | { | |
739 | if (value == 1) |
|
772 | if (value == 1) | |
740 | { |
|
773 | { | |
741 | spectral_matrix_regs->config = spectral_matrix_regs->config | 0x01; |
|
774 | spectral_matrix_regs->config = spectral_matrix_regs->config | 0x01; | |
742 | } |
|
775 | } | |
743 | else |
|
776 | else | |
744 | { |
|
777 | { | |
745 | spectral_matrix_regs->config = spectral_matrix_regs->config & 0xfffffffe; // 1110 |
|
778 | spectral_matrix_regs->config = spectral_matrix_regs->config & 0xfffffffe; // 1110 | |
746 | } |
|
779 | } | |
747 | } |
|
780 | } | |
748 |
|
781 | |||
749 | void set_run_matrix_spectral( unsigned char value ) |
|
782 | void set_run_matrix_spectral( unsigned char value ) | |
750 | { |
|
783 | { | |
751 | if (value == 1) |
|
784 | if (value == 1) | |
752 | { |
|
785 | { | |
753 | spectral_matrix_regs->config = spectral_matrix_regs->config | 0x4; // [0100] set run_matrix spectral to 1 |
|
786 | spectral_matrix_regs->config = spectral_matrix_regs->config | 0x4; // [0100] set run_matrix spectral to 1 | |
754 | } |
|
787 | } | |
755 | else |
|
788 | else | |
756 | { |
|
789 | { | |
757 | spectral_matrix_regs->config = spectral_matrix_regs->config & 0xfffffffb; // [1011] set run_matrix spectral to 0 |
|
790 | spectral_matrix_regs->config = spectral_matrix_regs->config & 0xfffffffb; // [1011] set run_matrix spectral to 0 | |
758 | } |
|
791 | } | |
759 | } |
|
792 | } | |
760 |
|
793 | |||
761 | //**************** |
|
794 | //**************** | |
762 | // CLOSING ACTIONS |
|
795 | // CLOSING ACTIONS | |
763 | void update_last_TC_exe( ccsdsTelecommandPacket_t *TC, unsigned char * time ) |
|
796 | void update_last_TC_exe( ccsdsTelecommandPacket_t *TC, unsigned char * time ) | |
764 | { |
|
797 | { | |
765 | /** This function is used to update the HK packets statistics after a successful TC execution. |
|
798 | /** This function is used to update the HK packets statistics after a successful TC execution. | |
766 | * |
|
799 | * | |
767 | * @param TC points to the TC being processed |
|
800 | * @param TC points to the TC being processed | |
768 | * @param time is the time used to date the TC execution |
|
801 | * @param time is the time used to date the TC execution | |
769 | * |
|
802 | * | |
770 | */ |
|
803 | */ | |
771 |
|
804 | |||
772 | unsigned int val; |
|
805 | unsigned int val; | |
773 |
|
806 | |||
774 | housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0]; |
|
807 | housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0]; | |
775 | housekeeping_packet.hk_lfr_last_exe_tc_id[1] = TC->packetID[1]; |
|
808 | housekeeping_packet.hk_lfr_last_exe_tc_id[1] = TC->packetID[1]; | |
776 | housekeeping_packet.hk_lfr_last_exe_tc_type[0] = 0x00; |
|
809 | housekeeping_packet.hk_lfr_last_exe_tc_type[0] = 0x00; | |
777 | housekeeping_packet.hk_lfr_last_exe_tc_type[1] = TC->serviceType; |
|
810 | housekeeping_packet.hk_lfr_last_exe_tc_type[1] = TC->serviceType; | |
778 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[0] = 0x00; |
|
811 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[0] = 0x00; | |
779 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[1] = TC->serviceSubType; |
|
812 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[1] = TC->serviceSubType; | |
780 | housekeeping_packet.hk_lfr_last_exe_tc_time[0] = time[0]; |
|
813 | housekeeping_packet.hk_lfr_last_exe_tc_time[0] = time[0]; | |
781 | housekeeping_packet.hk_lfr_last_exe_tc_time[1] = time[1]; |
|
814 | housekeeping_packet.hk_lfr_last_exe_tc_time[1] = time[1]; | |
782 | housekeeping_packet.hk_lfr_last_exe_tc_time[2] = time[2]; |
|
815 | housekeeping_packet.hk_lfr_last_exe_tc_time[2] = time[2]; | |
783 | housekeeping_packet.hk_lfr_last_exe_tc_time[3] = time[3]; |
|
816 | housekeeping_packet.hk_lfr_last_exe_tc_time[3] = time[3]; | |
784 | housekeeping_packet.hk_lfr_last_exe_tc_time[4] = time[4]; |
|
817 | housekeeping_packet.hk_lfr_last_exe_tc_time[4] = time[4]; | |
785 | housekeeping_packet.hk_lfr_last_exe_tc_time[5] = time[5]; |
|
818 | housekeeping_packet.hk_lfr_last_exe_tc_time[5] = time[5]; | |
786 |
|
819 | |||
787 | val = housekeeping_packet.hk_lfr_exe_tc_cnt[0] * 256 + housekeeping_packet.hk_lfr_exe_tc_cnt[1]; |
|
820 | val = housekeeping_packet.hk_lfr_exe_tc_cnt[0] * 256 + housekeeping_packet.hk_lfr_exe_tc_cnt[1]; | |
788 | val++; |
|
821 | val++; | |
789 | housekeeping_packet.hk_lfr_exe_tc_cnt[0] = (unsigned char) (val >> 8); |
|
822 | housekeeping_packet.hk_lfr_exe_tc_cnt[0] = (unsigned char) (val >> 8); | |
790 | housekeeping_packet.hk_lfr_exe_tc_cnt[1] = (unsigned char) (val); |
|
823 | housekeeping_packet.hk_lfr_exe_tc_cnt[1] = (unsigned char) (val); | |
791 | } |
|
824 | } | |
792 |
|
825 | |||
793 | void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char * time ) |
|
826 | void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char * time ) | |
794 | { |
|
827 | { | |
795 | /** This function is used to update the HK packets statistics after a TC rejection. |
|
828 | /** This function is used to update the HK packets statistics after a TC rejection. | |
796 | * |
|
829 | * | |
797 | * @param TC points to the TC being processed |
|
830 | * @param TC points to the TC being processed | |
798 | * @param time is the time used to date the TC rejection |
|
831 | * @param time is the time used to date the TC rejection | |
799 | * |
|
832 | * | |
800 | */ |
|
833 | */ | |
801 |
|
834 | |||
802 | unsigned int val; |
|
835 | unsigned int val; | |
803 |
|
836 | |||
804 | housekeeping_packet.hk_lfr_last_rej_tc_id[0] = TC->packetID[0]; |
|
837 | housekeeping_packet.hk_lfr_last_rej_tc_id[0] = TC->packetID[0]; | |
805 | housekeeping_packet.hk_lfr_last_rej_tc_id[1] = TC->packetID[1]; |
|
838 | housekeeping_packet.hk_lfr_last_rej_tc_id[1] = TC->packetID[1]; | |
806 | housekeeping_packet.hk_lfr_last_rej_tc_type[0] = 0x00; |
|
839 | housekeeping_packet.hk_lfr_last_rej_tc_type[0] = 0x00; | |
807 | housekeeping_packet.hk_lfr_last_rej_tc_type[1] = TC->serviceType; |
|
840 | housekeeping_packet.hk_lfr_last_rej_tc_type[1] = TC->serviceType; | |
808 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[0] = 0x00; |
|
841 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[0] = 0x00; | |
809 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[1] = TC->serviceSubType; |
|
842 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[1] = TC->serviceSubType; | |
810 | housekeeping_packet.hk_lfr_last_rej_tc_time[0] = time[0]; |
|
843 | housekeeping_packet.hk_lfr_last_rej_tc_time[0] = time[0]; | |
811 | housekeeping_packet.hk_lfr_last_rej_tc_time[1] = time[1]; |
|
844 | housekeeping_packet.hk_lfr_last_rej_tc_time[1] = time[1]; | |
812 | housekeeping_packet.hk_lfr_last_rej_tc_time[2] = time[2]; |
|
845 | housekeeping_packet.hk_lfr_last_rej_tc_time[2] = time[2]; | |
813 | housekeeping_packet.hk_lfr_last_rej_tc_time[3] = time[3]; |
|
846 | housekeeping_packet.hk_lfr_last_rej_tc_time[3] = time[3]; | |
814 | housekeeping_packet.hk_lfr_last_rej_tc_time[4] = time[4]; |
|
847 | housekeeping_packet.hk_lfr_last_rej_tc_time[4] = time[4]; | |
815 | housekeeping_packet.hk_lfr_last_rej_tc_time[5] = time[5]; |
|
848 | housekeeping_packet.hk_lfr_last_rej_tc_time[5] = time[5]; | |
816 |
|
849 | |||
817 | val = housekeeping_packet.hk_lfr_rej_tc_cnt[0] * 256 + housekeeping_packet.hk_lfr_rej_tc_cnt[1]; |
|
850 | val = housekeeping_packet.hk_lfr_rej_tc_cnt[0] * 256 + housekeeping_packet.hk_lfr_rej_tc_cnt[1]; | |
818 | val++; |
|
851 | val++; | |
819 | housekeeping_packet.hk_lfr_rej_tc_cnt[0] = (unsigned char) (val >> 8); |
|
852 | housekeeping_packet.hk_lfr_rej_tc_cnt[0] = (unsigned char) (val >> 8); | |
820 | housekeeping_packet.hk_lfr_rej_tc_cnt[1] = (unsigned char) (val); |
|
853 | housekeeping_packet.hk_lfr_rej_tc_cnt[1] = (unsigned char) (val); | |
821 | } |
|
854 | } | |
822 |
|
855 | |||
823 | void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id ) |
|
856 | void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id ) | |
824 | { |
|
857 | { | |
825 | /** This function is the last step of the TC execution workflow. |
|
858 | /** This function is the last step of the TC execution workflow. | |
826 | * |
|
859 | * | |
827 | * @param TC points to the TC being processed |
|
860 | * @param TC points to the TC being processed | |
828 | * @param result is the result of the TC execution (LFR_SUCCESSFUL / LFR_DEFAULT) |
|
861 | * @param result is the result of the TC execution (LFR_SUCCESSFUL / LFR_DEFAULT) | |
829 | * @param queue_id is the id of the RTEMS message queue used to send TM packets |
|
862 | * @param queue_id is the id of the RTEMS message queue used to send TM packets | |
830 | * @param time is the time used to date the TC execution |
|
863 | * @param time is the time used to date the TC execution | |
831 | * |
|
864 | * | |
832 | */ |
|
865 | */ | |
833 |
|
866 | |||
834 | unsigned char requestedMode; |
|
867 | unsigned char requestedMode; | |
835 |
|
868 | |||
836 | if (result == LFR_SUCCESSFUL) |
|
869 | if (result == LFR_SUCCESSFUL) | |
837 | { |
|
870 | { | |
838 | if ( !( (TC->serviceType==TC_TYPE_TIME) & (TC->serviceSubType==TC_SUBTYPE_UPDT_TIME) ) |
|
871 | if ( !( (TC->serviceType==TC_TYPE_TIME) & (TC->serviceSubType==TC_SUBTYPE_UPDT_TIME) ) | |
839 | & |
|
872 | & | |
840 | !( (TC->serviceType==TC_TYPE_GEN) & (TC->serviceSubType==TC_SUBTYPE_UPDT_INFO)) |
|
873 | !( (TC->serviceType==TC_TYPE_GEN) & (TC->serviceSubType==TC_SUBTYPE_UPDT_INFO)) | |
841 | ) |
|
874 | ) | |
842 | { |
|
875 | { | |
843 | send_tm_lfr_tc_exe_success( TC, queue_id ); |
|
876 | send_tm_lfr_tc_exe_success( TC, queue_id ); | |
844 | } |
|
877 | } | |
845 | if ( (TC->serviceType == TC_TYPE_GEN) & (TC->serviceSubType == TC_SUBTYPE_ENTER) ) |
|
878 | if ( (TC->serviceType == TC_TYPE_GEN) & (TC->serviceSubType == TC_SUBTYPE_ENTER) ) | |
846 | { |
|
879 | { | |
847 | //********************************** |
|
880 | //********************************** | |
848 | // UPDATE THE LFRMODE LOCAL VARIABLE |
|
881 | // UPDATE THE LFRMODE LOCAL VARIABLE | |
849 | requestedMode = TC->dataAndCRC[1]; |
|
882 | requestedMode = TC->dataAndCRC[1]; | |
850 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((requestedMode << 4) + 0x0d); |
|
883 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((requestedMode << 4) + 0x0d); | |
851 | updateLFRCurrentMode(); |
|
884 | updateLFRCurrentMode(); | |
852 | } |
|
885 | } | |
853 | } |
|
886 | } | |
854 | else if (result == LFR_EXE_ERROR) |
|
887 | else if (result == LFR_EXE_ERROR) | |
855 | { |
|
888 | { | |
856 | send_tm_lfr_tc_exe_error( TC, queue_id ); |
|
889 | send_tm_lfr_tc_exe_error( TC, queue_id ); | |
857 | } |
|
890 | } | |
858 | } |
|
891 | } | |
859 |
|
892 | |||
860 | //*************************** |
|
893 | //*************************** | |
861 | // Interrupt Service Routines |
|
894 | // Interrupt Service Routines | |
862 | rtems_isr commutation_isr1( rtems_vector_number vector ) |
|
895 | rtems_isr commutation_isr1( rtems_vector_number vector ) | |
863 | { |
|
896 | { | |
864 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
897 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
865 | printf("In commutation_isr1 *** Error sending event to DUMB\n"); |
|
898 | printf("In commutation_isr1 *** Error sending event to DUMB\n"); | |
866 | } |
|
899 | } | |
867 | } |
|
900 | } | |
868 |
|
901 | |||
869 | rtems_isr commutation_isr2( rtems_vector_number vector ) |
|
902 | rtems_isr commutation_isr2( rtems_vector_number vector ) | |
870 | { |
|
903 | { | |
871 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
904 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
872 | printf("In commutation_isr2 *** Error sending event to DUMB\n"); |
|
905 | printf("In commutation_isr2 *** Error sending event to DUMB\n"); | |
873 | } |
|
906 | } | |
874 | } |
|
907 | } | |
875 |
|
908 | |||
876 | //**************** |
|
909 | //**************** | |
877 | // OTHER FUNCTIONS |
|
910 | // OTHER FUNCTIONS | |
878 | void updateLFRCurrentMode() |
|
911 | void updateLFRCurrentMode() | |
879 | { |
|
912 | { | |
880 | /** This function updates the value of the global variable lfrCurrentMode. |
|
913 | /** This function updates the value of the global variable lfrCurrentMode. | |
881 | * |
|
914 | * | |
882 | * lfrCurrentMode is a parameter used by several functions to know in which mode LFR is running. |
|
915 | * lfrCurrentMode is a parameter used by several functions to know in which mode LFR is running. | |
883 | * |
|
916 | * | |
884 | */ |
|
917 | */ | |
885 | // update the local value of lfrCurrentMode with the value contained in the housekeeping_packet structure |
|
918 | // update the local value of lfrCurrentMode with the value contained in the housekeeping_packet structure | |
886 | lfrCurrentMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; |
|
919 | lfrCurrentMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |
887 | } |
|
920 | } | |
888 |
|
921 |
General Comments 0
You need to be logged in to leave comments.
Login now