##// END OF EJS Templates
Bug 709...
paul -
r73:8d0190b179ad VHDLib206
parent child
Show More
@@ -1,248 +1,248
1 1 #############################################################################
2 2 # Makefile for building: bin/fsw
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Wed Nov 13 08:18:19 2013
3 # Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Nov 14 08:56:42 2013
4 4 # Project: fsw-qt.pro
5 5 # Template: app
6 6 # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
7 7 #############################################################################
8 8
9 9 ####### Compiler, tools and options
10 10
11 11 CC = sparc-rtems-gcc
12 12 CXX = sparc-rtems-g++
13 DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=22 -DPRINT_MESSAGES_ON_CONSOLE
13 DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=23 -DPRINT_MESSAGES_ON_CONSOLE
14 14 CFLAGS = -pipe -O3 -Wall $(DEFINES)
15 15 CXXFLAGS = -pipe -O3 -Wall $(DEFINES)
16 16 INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header
17 17 LINK = sparc-rtems-g++
18 18 LFLAGS =
19 19 LIBS = $(SUBLIBS)
20 20 AR = sparc-rtems-ar rcs
21 21 RANLIB =
22 22 QMAKE = /usr/bin/qmake-qt4
23 23 TAR = tar -cf
24 24 COMPRESS = gzip -9f
25 25 COPY = cp -f
26 26 SED = sed
27 27 COPY_FILE = $(COPY)
28 28 COPY_DIR = $(COPY) -r
29 29 STRIP = sparc-rtems-strip
30 30 INSTALL_FILE = install -m 644 -p
31 31 INSTALL_DIR = $(COPY_DIR)
32 32 INSTALL_PROGRAM = install -m 755 -p
33 33 DEL_FILE = rm -f
34 34 SYMLINK = ln -f -s
35 35 DEL_DIR = rmdir
36 36 MOVE = mv -f
37 37 CHK_DIR_EXISTS= test -d
38 38 MKDIR = mkdir -p
39 39
40 40 ####### Output directory
41 41
42 42 OBJECTS_DIR = obj/
43 43
44 44 ####### Files
45 45
46 46 SOURCES = ../src/wf_handler.c \
47 47 ../src/tc_handler.c \
48 48 ../src/fsw_processing.c \
49 49 ../src/fsw_misc.c \
50 50 ../src/fsw_init.c \
51 51 ../src/fsw_globals.c \
52 52 ../src/fsw_spacewire.c \
53 53 ../src/tc_load_dump_parameters.c \
54 54 ../src/tm_lfr_tc_exe.c \
55 55 ../src/tc_acceptance.c
56 56 OBJECTS = obj/wf_handler.o \
57 57 obj/tc_handler.o \
58 58 obj/fsw_processing.o \
59 59 obj/fsw_misc.o \
60 60 obj/fsw_init.o \
61 61 obj/fsw_globals.o \
62 62 obj/fsw_spacewire.o \
63 63 obj/tc_load_dump_parameters.o \
64 64 obj/tm_lfr_tc_exe.o \
65 65 obj/tc_acceptance.o
66 66 DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \
67 67 /usr/lib64/qt4/mkspecs/common/linux.conf \
68 68 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
69 69 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
70 70 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
71 71 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
72 72 /usr/lib64/qt4/mkspecs/qconfig.pri \
73 73 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
74 74 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
75 75 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
76 76 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
77 77 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
78 78 sparc.pri \
79 79 /usr/lib64/qt4/mkspecs/features/release.prf \
80 80 /usr/lib64/qt4/mkspecs/features/default_post.prf \
81 81 /usr/lib64/qt4/mkspecs/features/shared.prf \
82 82 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
83 83 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
84 84 /usr/lib64/qt4/mkspecs/features/resources.prf \
85 85 /usr/lib64/qt4/mkspecs/features/uic.prf \
86 86 /usr/lib64/qt4/mkspecs/features/yacc.prf \
87 87 /usr/lib64/qt4/mkspecs/features/lex.prf \
88 88 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \
89 89 fsw-qt.pro
90 90 QMAKE_TARGET = fsw
91 91 DESTDIR = bin/
92 92 TARGET = bin/fsw
93 93
94 94 first: all
95 95 ####### Implicit rules
96 96
97 97 .SUFFIXES: .o .c .cpp .cc .cxx .C
98 98
99 99 .cpp.o:
100 100 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
101 101
102 102 .cc.o:
103 103 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
104 104
105 105 .cxx.o:
106 106 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
107 107
108 108 .C.o:
109 109 $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
110 110
111 111 .c.o:
112 112 $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
113 113
114 114 ####### Build rules
115 115
116 116 all: Makefile $(TARGET)
117 117
118 118 $(TARGET): $(OBJECTS)
119 119 @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/
120 120 $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
121 121
122 122 Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \
123 123 /usr/lib64/qt4/mkspecs/common/linux.conf \
124 124 /usr/lib64/qt4/mkspecs/common/gcc-base.conf \
125 125 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \
126 126 /usr/lib64/qt4/mkspecs/common/g++-base.conf \
127 127 /usr/lib64/qt4/mkspecs/common/g++-unix.conf \
128 128 /usr/lib64/qt4/mkspecs/qconfig.pri \
129 129 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \
130 130 /usr/lib64/qt4/mkspecs/features/qt_functions.prf \
131 131 /usr/lib64/qt4/mkspecs/features/qt_config.prf \
132 132 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \
133 133 /usr/lib64/qt4/mkspecs/features/default_pre.prf \
134 134 sparc.pri \
135 135 /usr/lib64/qt4/mkspecs/features/release.prf \
136 136 /usr/lib64/qt4/mkspecs/features/default_post.prf \
137 137 /usr/lib64/qt4/mkspecs/features/shared.prf \
138 138 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \
139 139 /usr/lib64/qt4/mkspecs/features/warn_on.prf \
140 140 /usr/lib64/qt4/mkspecs/features/resources.prf \
141 141 /usr/lib64/qt4/mkspecs/features/uic.prf \
142 142 /usr/lib64/qt4/mkspecs/features/yacc.prf \
143 143 /usr/lib64/qt4/mkspecs/features/lex.prf \
144 144 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf
145 145 $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
146 146 /usr/lib64/qt4/mkspecs/common/unix.conf:
147 147 /usr/lib64/qt4/mkspecs/common/linux.conf:
148 148 /usr/lib64/qt4/mkspecs/common/gcc-base.conf:
149 149 /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf:
150 150 /usr/lib64/qt4/mkspecs/common/g++-base.conf:
151 151 /usr/lib64/qt4/mkspecs/common/g++-unix.conf:
152 152 /usr/lib64/qt4/mkspecs/qconfig.pri:
153 153 /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri:
154 154 /usr/lib64/qt4/mkspecs/features/qt_functions.prf:
155 155 /usr/lib64/qt4/mkspecs/features/qt_config.prf:
156 156 /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf:
157 157 /usr/lib64/qt4/mkspecs/features/default_pre.prf:
158 158 sparc.pri:
159 159 /usr/lib64/qt4/mkspecs/features/release.prf:
160 160 /usr/lib64/qt4/mkspecs/features/default_post.prf:
161 161 /usr/lib64/qt4/mkspecs/features/shared.prf:
162 162 /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf:
163 163 /usr/lib64/qt4/mkspecs/features/warn_on.prf:
164 164 /usr/lib64/qt4/mkspecs/features/resources.prf:
165 165 /usr/lib64/qt4/mkspecs/features/uic.prf:
166 166 /usr/lib64/qt4/mkspecs/features/yacc.prf:
167 167 /usr/lib64/qt4/mkspecs/features/lex.prf:
168 168 /usr/lib64/qt4/mkspecs/features/include_source_dir.prf:
169 169 qmake: FORCE
170 170 @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro
171 171
172 172 dist:
173 173 @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0
174 174 $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw1.0.0/ && (cd `dirname obj/fsw1.0.0` && $(TAR) fsw1.0.0.tar fsw1.0.0 && $(COMPRESS) fsw1.0.0.tar) && $(MOVE) `dirname obj/fsw1.0.0`/fsw1.0.0.tar.gz . && $(DEL_FILE) -r obj/fsw1.0.0
175 175
176 176
177 177 clean:compiler_clean
178 178 -$(DEL_FILE) $(OBJECTS)
179 179 -$(DEL_FILE) *~ core *.core
180 180
181 181
182 182 ####### Sub-libraries
183 183
184 184 distclean: clean
185 185 -$(DEL_FILE) $(TARGET)
186 186 -$(DEL_FILE) Makefile
187 187
188 188
189 189 grmon:
190 190 cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u
191 191
192 192 check: first
193 193
194 194 compiler_rcc_make_all:
195 195 compiler_rcc_clean:
196 196 compiler_uic_make_all:
197 197 compiler_uic_clean:
198 198 compiler_image_collection_make_all: qmake_image_collection.cpp
199 199 compiler_image_collection_clean:
200 200 -$(DEL_FILE) qmake_image_collection.cpp
201 201 compiler_yacc_decl_make_all:
202 202 compiler_yacc_decl_clean:
203 203 compiler_yacc_impl_make_all:
204 204 compiler_yacc_impl_clean:
205 205 compiler_lex_make_all:
206 206 compiler_lex_clean:
207 207 compiler_clean:
208 208
209 209 ####### Compile
210 210
211 211 obj/wf_handler.o: ../src/wf_handler.c
212 212 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c
213 213
214 214 obj/tc_handler.o: ../src/tc_handler.c
215 215 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c
216 216
217 217 obj/fsw_processing.o: ../src/fsw_processing.c ../src/fsw_processing_globals.c
218 218 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c
219 219
220 220 obj/fsw_misc.o: ../src/fsw_misc.c
221 221 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c
222 222
223 223 obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c
224 224 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c
225 225
226 226 obj/fsw_globals.o: ../src/fsw_globals.c
227 227 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c
228 228
229 229 obj/fsw_spacewire.o: ../src/fsw_spacewire.c
230 230 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c
231 231
232 232 obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c
233 233 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c
234 234
235 235 obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c
236 236 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c
237 237
238 238 obj/tc_acceptance.o: ../src/tc_acceptance.c
239 239 $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c
240 240
241 241 ####### Install
242 242
243 243 install: FORCE
244 244
245 245 uninstall: FORCE
246 246
247 247 FORCE:
248 248
@@ -1,78 +1,78
1 1 TEMPLATE = app
2 2 # CONFIG += console v8 sim
3 3 # CONFIG options = verbose *** boot_messages *** debug_messages *** cpu_usage_report *** stack_report *** gsa
4 4 CONFIG += console verbose
5 5 CONFIG -= qt
6 6
7 7 include(./sparc.pri)
8 8
9 9 # flight software version
10 SWVERSION=-0-22
10 SWVERSION=-0-23
11 11 DEFINES += SW_VERSION_N1=0
12 12 DEFINES += SW_VERSION_N2=0
13 13 DEFINES += SW_VERSION_N3=0
14 DEFINES += SW_VERSION_N4=22
14 DEFINES += SW_VERSION_N4=23
15 15
16 16 contains( CONFIG, verbose ) {
17 17 DEFINES += PRINT_MESSAGES_ON_CONSOLE
18 18 }
19 19
20 20 contains( CONFIG, debug_messages ) {
21 21 DEFINES += DEBUG_MESSAGES
22 22 }
23 23
24 24 contains( CONFIG, cpu_usage_report ) {
25 25 DEFINES += PRINT_TASK_STATISTICS
26 26 }
27 27
28 28 contains( CONFIG, stack_report ) {
29 29 DEFINES += PRINT_STACK_REPORT
30 30 }
31 31
32 32 contains( CONFIG, boot_messages ) {
33 33 DEFINES += BOOT_MESSAGES
34 34 }
35 35
36 36 #doxygen.target = doxygen
37 37 #doxygen.commands = doxygen ../doc/Doxyfile
38 38 #QMAKE_EXTRA_TARGETS += doxygen
39 39
40 40 TARGET = fsw
41 41 contains( CONFIG, gsa ) {
42 42 DEFINES += GSA
43 43 TARGET = fsw-gsa
44 44 }
45 45
46 46 INCLUDEPATH += \
47 47 ../src \
48 48 ../header
49 49
50 50 SOURCES += \
51 51 ../src/wf_handler.c \
52 52 ../src/tc_handler.c \
53 53 ../src/fsw_processing.c \
54 54 ../src/fsw_misc.c \
55 55 ../src/fsw_init.c \
56 56 ../src/fsw_globals.c \
57 57 ../src/fsw_spacewire.c \
58 58 ../src/tc_load_dump_parameters.c \
59 59 ../src/tm_lfr_tc_exe.c \
60 60 ../src/tc_acceptance.c
61 61
62 62
63 63 HEADERS += \
64 64 ../header/wf_handler.h \
65 65 ../header/tc_handler.h \
66 66 ../header/grlib_regs.h \
67 67 ../header/fsw_processing.h \
68 68 ../header/fsw_params.h \
69 69 ../header/fsw_misc.h \
70 70 ../header/fsw_init.h \
71 71 ../header/ccsds_types.h \
72 72 ../header/fsw_params_processing.h \
73 73 ../header/fsw_spacewire.h \
74 74 ../header/tm_byte_positions.h \
75 75 ../header/tc_load_dump_parameters.h \
76 76 ../header/tm_lfr_tc_exe.h \
77 77 ../header/tc_acceptance.h
78 78
@@ -1,305 +1,305
1 1 <?xml version="1.0" encoding="UTF-8"?>
2 2 <!DOCTYPE QtCreatorProject>
3 <!-- Written by QtCreator 2.8.1, 2013-11-13T13:39:43. -->
3 <!-- Written by QtCreator 2.8.1, 2013-11-14T09:19:44. -->
4 4 <qtcreator>
5 5 <data>
6 6 <variable>ProjectExplorer.Project.ActiveTarget</variable>
7 7 <value type="int">0</value>
8 8 </data>
9 9 <data>
10 10 <variable>ProjectExplorer.Project.EditorSettings</variable>
11 11 <valuemap type="QVariantMap">
12 12 <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
13 13 <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
14 14 <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
15 15 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
16 16 <value type="QString" key="language">Cpp</value>
17 17 <valuemap type="QVariantMap" key="value">
18 18 <value type="QString" key="CurrentPreferences">CppGlobal</value>
19 19 </valuemap>
20 20 </valuemap>
21 21 <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
22 22 <value type="QString" key="language">QmlJS</value>
23 23 <valuemap type="QVariantMap" key="value">
24 24 <value type="QString" key="CurrentPreferences">QmlJSGlobal</value>
25 25 </valuemap>
26 26 </valuemap>
27 27 <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
28 28 <value type="QByteArray" key="EditorConfiguration.Codec">System</value>
29 29 <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
30 30 <value type="int" key="EditorConfiguration.IndentSize">4</value>
31 31 <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
32 32 <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
33 33 <value type="int" key="EditorConfiguration.PaddingMode">1</value>
34 34 <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
35 35 <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
36 36 <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
37 37 <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
38 38 <value type="int" key="EditorConfiguration.TabSize">8</value>
39 39 <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
40 40 <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
41 41 <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
42 42 <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
43 43 <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
44 44 <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
45 45 </valuemap>
46 46 </data>
47 47 <data>
48 48 <variable>ProjectExplorer.Project.PluginSettings</variable>
49 49 <valuemap type="QVariantMap"/>
50 50 </data>
51 51 <data>
52 52 <variable>ProjectExplorer.Project.Target.0</variable>
53 53 <valuemap type="QVariantMap">
54 54 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
55 55 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop-Qt 4.8.2 in PATH (System)</value>
56 56 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{5289e843-9ef2-45ce-88c6-ad27d8e08def}</value>
57 57 <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
58 58 <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
59 59 <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">1</value>
60 60 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
61 61 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
62 62 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
63 63 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
64 64 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
65 65 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
66 66 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
67 67 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
68 68 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
69 69 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
70 70 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
71 71 </valuemap>
72 72 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
73 73 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
74 74 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
75 75 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
76 76 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
77 77 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
78 78 <value type="QString">-w</value>
79 79 <value type="QString">-r</value>
80 80 </valuelist>
81 81 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
82 82 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w -j 4</value>
83 83 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
84 84 </valuemap>
85 85 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
86 86 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
87 87 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
88 88 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
89 89 </valuemap>
90 90 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
91 91 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
92 92 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
93 93 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
94 94 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
95 95 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
96 96 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
97 97 <value type="QString">-w</value>
98 98 <value type="QString">-r</value>
99 99 </valuelist>
100 100 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
101 101 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w clean</value>
102 102 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
103 103 </valuemap>
104 104 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
105 105 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
106 106 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
107 107 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
108 108 </valuemap>
109 109 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
110 110 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
111 111 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
112 112 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value>
113 113 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
114 114 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
115 115 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
116 116 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value>
117 117 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
118 118 </valuemap>
119 119 <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
120 120 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
121 121 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
122 122 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
123 123 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
124 124 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
125 125 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
126 126 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
127 127 <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
128 128 <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
129 129 <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
130 130 </valuemap>
131 131 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
132 132 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
133 133 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
134 134 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
135 135 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
136 136 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
137 137 <value type="QString">-w</value>
138 138 <value type="QString">-r</value>
139 139 </valuelist>
140 140 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
141 141 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w </value>
142 142 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
143 143 </valuemap>
144 144 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
145 145 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
146 146 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
147 147 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
148 148 </valuemap>
149 149 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
150 150 <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
151 151 <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
152 152 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
153 153 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
154 154 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
155 155 <valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
156 156 <value type="QString">-w</value>
157 157 <value type="QString">-r</value>
158 158 </valuelist>
159 159 <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
160 160 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">-r -w clean</value>
161 161 <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
162 162 </valuemap>
163 163 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
164 164 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
165 165 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
166 166 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
167 167 </valuemap>
168 168 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
169 169 <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
170 170 <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
171 171 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value>
172 172 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
173 173 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
174 174 <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
175 175 <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value>
176 176 <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value>
177 177 </valuemap>
178 178 <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
179 179 <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
180 180 <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
181 181 <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
182 182 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
183 183 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
184 184 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
185 185 </valuemap>
186 186 <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
187 187 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value>
188 188 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
189 189 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
190 190 </valuemap>
191 191 <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
192 192 <valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
193 193 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
194 194 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
195 195 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
196 196 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
197 197 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
198 198 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
199 199 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
200 200 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
201 201 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
202 202 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
203 203 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
204 204 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
205 205 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
206 206 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
207 207 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
208 208 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
209 209 <value type="int">0</value>
210 210 <value type="int">1</value>
211 211 <value type="int">2</value>
212 212 <value type="int">3</value>
213 213 <value type="int">4</value>
214 214 <value type="int">5</value>
215 215 <value type="int">6</value>
216 216 <value type="int">7</value>
217 217 <value type="int">8</value>
218 218 <value type="int">9</value>
219 219 <value type="int">10</value>
220 220 <value type="int">11</value>
221 221 <value type="int">12</value>
222 222 <value type="int">13</value>
223 223 <value type="int">14</value>
224 224 </valuelist>
225 225 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
226 226 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
227 227 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value>
228 228 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
229 229 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/opt/DEV_PLE/FSW-qt/fsw-qt.pro</value>
230 230 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
231 231 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value>
232 232 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
233 233 <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value>
234 234 <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
235 235 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
236 236 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
237 237 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
238 238 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
239 239 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
240 240 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
241 241 </valuemap>
242 242 <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.1">
243 243 <value type="bool" key="Analyzer.Project.UseGlobal">true</value>
244 244 <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
245 245 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
246 246 <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
247 247 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
248 248 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
249 249 <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
250 250 <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
251 251 <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
252 252 <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
253 253 <value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
254 254 <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
255 255 <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
256 256 <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
257 257 <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
258 258 <value type="int">0</value>
259 259 <value type="int">1</value>
260 260 <value type="int">2</value>
261 261 <value type="int">3</value>
262 262 <value type="int">4</value>
263 263 <value type="int">5</value>
264 264 <value type="int">6</value>
265 265 <value type="int">7</value>
266 266 <value type="int">8</value>
267 267 <value type="int">9</value>
268 268 <value type="int">10</value>
269 269 <value type="int">11</value>
270 270 <value type="int">12</value>
271 271 <value type="int">13</value>
272 272 <value type="int">14</value>
273 273 </valuelist>
274 274 <value type="int" key="PE.EnvironmentAspect.Base">2</value>
275 275 <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
276 276 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments"></value>
277 277 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable">doxygen</value>
278 278 <value type="bool" key="ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal">true</value>
279 279 <value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory">/opt/DEV_PLE/doc</value>
280 280 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Run doxygen</value>
281 281 <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
282 282 <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
283 283 <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
284 284 <value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
285 285 <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">false</value>
286 286 <value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
287 287 <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
288 288 <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
289 289 </valuemap>
290 290 <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">2</value>
291 291 </valuemap>
292 292 </data>
293 293 <data>
294 294 <variable>ProjectExplorer.Project.TargetCount</variable>
295 295 <value type="int">1</value>
296 296 </data>
297 297 <data>
298 298 <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
299 299 <value type="QByteArray">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value>
300 300 </data>
301 301 <data>
302 302 <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
303 303 <value type="int">14</value>
304 304 </data>
305 305 </qtcreator>
@@ -1,63 +1,63
1 1 #ifndef TC_HANDLER_H_INCLUDED
2 2 #define TC_HANDLER_H_INCLUDED
3 3
4 4 #include <rtems.h>
5 5 #include <leon.h>
6 6
7 7 #include "tc_load_dump_parameters.h"
8 8 #include "tc_acceptance.h"
9 9 #include "tm_lfr_tc_exe.h"
10 10 #include "wf_handler.h"
11 11
12 12 // MODE PARAMETERS
13 13 extern struct param_sbm1_str param_sbm1;
14 14 extern struct param_sbm2_str param_sbm2;
15 15 extern time_management_regs_t *time_management_regs;
16 16 extern waveform_picker_regs_t *waveform_picker_regs;
17 17 extern gptimer_regs_t *gptimer_regs;
18 18 extern rtems_name misc_name[5];
19 19 extern rtems_id Task_id[20]; /* array of task ids */
20 20 extern unsigned char lfrCurrentMode;
21 21 extern unsigned int maxCount;
22 22
23 23
24 24 //****
25 25 // ISR
26 26 rtems_isr commutation_isr1( rtems_vector_number vector );
27 27 rtems_isr commutation_isr2( rtems_vector_number vector );
28 28
29 29 //***********
30 30 // RTEMS TASK
31 31 rtems_task actn_task( rtems_task_argument unused );
32 32
33 33 //***********
34 34 // TC ACTIONS
35 35 int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
36 36 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
37 37 int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
38 38 int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
39 39 int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
40 40 int action_update_time(ccsdsTelecommandPacket_t *TC);
41 41
42 42 // mode transition
43 43 int transition_validation(unsigned char requestedMode);
44 44 int stop_current_mode();
45 45 int enter_mode(unsigned char mode, ccsdsTelecommandPacket_t *TC);
46 46 int enter_standby_mode();
47 47 int enter_normal_mode();
48 48 int enter_burst_mode();
49 49 int enter_sbm1_mode();
50 50 int enter_sbm2_mode();
51 51 int restart_science_tasks();
52 52 int suspend_science_tasks();
53 53
54 54 // other functions
55 55 void updateLFRCurrentMode();
56 void update_last_TC_exe(ccsdsTelecommandPacket_t *TC);
57 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC);
56 void update_last_TC_exe(ccsdsTelecommandPacket_t *TC, unsigned char *time);
57 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char *time);
58 58 void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id);
59 59
60 60 #endif // TC_HANDLER_H_INCLUDED
61 61
62 62
63 63
@@ -1,28 +1,28
1 1 #ifndef TM_LFR_TC_EXE_H_INCLUDED
2 2 #define TM_LFR_TC_EXE_H_INCLUDED
3 3
4 4 #include <rtems.h>
5 5 #include <stdio.h>
6 6
7 7 #include "fsw_params.h"
8 8 #include "fsw_spacewire.h"
9 9
10 10 extern time_management_regs_t *time_management_regs;
11 11 extern Packet_TM_LFR_HK_t housekeeping_packet;
12 12 extern unsigned short sequenceCounters_TC_EXE[];
13 13
14 int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
14 int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time);
15 15 int send_tm_lfr_tc_exe_inconsistent(ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
16 16 unsigned char byte_position, unsigned char rcv_value);
17 17 int send_tm_lfr_tc_exe_not_executable(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
18 18 int send_tm_lfr_tc_exe_not_implemented(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
19 19 int send_tm_lfr_tc_exe_error(ccsdsTelecommandPacket_t *TC, rtems_id queue_id);
20 20 int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
21 21 unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV, unsigned char destinationID);
22 22
23 23 void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id );
24 24
25 25 #endif // TM_LFR_TC_EXE_H_INCLUDED
26 26
27 27
28 28
@@ -1,768 +1,777
1 1 /** Functions and tasks related to TeleCommand handling.
2 2 *
3 3 * @file
4 4 * @author P. LEROY
5 5 *
6 6 * A group of functions to handle TeleCommands:\n
7 7 * action launching\n
8 8 * TC parsing\n
9 9 * ...
10 10 *
11 11 */
12 12
13 13 #include "tc_handler.h"
14 14
15 15 //***********
16 16 // RTEMS TASK
17 17
18 18 rtems_task actn_task( rtems_task_argument unused )
19 19 {
20 20 /** This RTEMS task is responsible for launching actions upton the reception of valid TeleCommands.
21 21 *
22 22 * @param unused is the starting argument of the RTEMS task
23 23 *
24 24 * The ACTN task waits for data coming from an RTEMS msesage queue. When data arrives, it launches specific actions depending
25 25 * on the incoming TeleCommand.
26 26 *
27 27 */
28 28
29 29 int result;
30 30 rtems_status_code status; // RTEMS status code
31 31 ccsdsTelecommandPacket_t TC; // TC sent to the ACTN task
32 32 size_t size; // size of the incoming TC packet
33 33 unsigned char subtype; // subtype of the current TC packet
34 34 rtems_id queue_rcv_id;
35 35 rtems_id queue_snd_id;
36 36
37 37 status = rtems_message_queue_ident( misc_name[QUEUE_RECV], 0, &queue_rcv_id );
38 38 if (status != RTEMS_SUCCESSFUL)
39 39 {
40 40 PRINTF1("in ACTN *** ERR getting queue_rcv_id %d\n", status)
41 41 }
42 42
43 43 status = rtems_message_queue_ident( misc_name[QUEUE_SEND], 0, &queue_snd_id );
44 44 if (status != RTEMS_SUCCESSFUL)
45 45 {
46 46 PRINTF1("in ACTN *** ERR getting queue_snd_id %d\n", status)
47 47 }
48 48
49 49 result = LFR_SUCCESSFUL;
50 50 subtype = 0; // subtype of the current TC packet
51 51
52 52 BOOT_PRINTF("in ACTN *** \n")
53 53
54 54 while(1)
55 55 {
56 56 status = rtems_message_queue_receive( queue_rcv_id, (char*) &TC, &size,
57 57 RTEMS_WAIT, RTEMS_NO_TIMEOUT);
58 58 if (status!=RTEMS_SUCCESSFUL) PRINTF1("ERR *** in task ACTN *** error receiving a message, code %d \n", status)
59 59 else
60 60 {
61 61 subtype = TC.serviceSubType;
62 62 switch(subtype)
63 63 {
64 64 case TC_SUBTYPE_RESET:
65 65 result = action_reset( &TC, queue_snd_id );
66 66 close_action( &TC, result, queue_snd_id );
67 67 break;
68 68 //
69 69 case TC_SUBTYPE_LOAD_COMM:
70 70 result = action_load_common_par( &TC );
71 71 close_action( &TC, result, queue_snd_id );
72 72 break;
73 73 //
74 74 case TC_SUBTYPE_LOAD_NORM:
75 75 result = action_load_normal_par( &TC, queue_snd_id );
76 76 close_action( &TC, result, queue_snd_id );
77 77 break;
78 78 //
79 79 case TC_SUBTYPE_LOAD_BURST:
80 80 result = action_load_burst_par( &TC, queue_snd_id );
81 81 close_action( &TC, result, queue_snd_id );
82 82 break;
83 83 //
84 84 case TC_SUBTYPE_LOAD_SBM1:
85 85 result = action_load_sbm1_par( &TC, queue_snd_id );
86 86 close_action( &TC, result, queue_snd_id );
87 87 break;
88 88 //
89 89 case TC_SUBTYPE_LOAD_SBM2:
90 90 result = action_load_sbm2_par( &TC, queue_snd_id );
91 91 close_action( &TC, result, queue_snd_id );
92 92 break;
93 93 //
94 94 case TC_SUBTYPE_DUMP:
95 95 result = action_dump_par( queue_snd_id );
96 96 close_action( &TC, result, queue_snd_id );
97 97 break;
98 98 //
99 99 case TC_SUBTYPE_ENTER:
100 100 result = action_enter_mode( &TC, queue_snd_id );
101 101 close_action( &TC, result, queue_snd_id );
102 102 break;
103 103 //
104 104 case TC_SUBTYPE_UPDT_INFO:
105 105 result = action_update_info( &TC, queue_snd_id );
106 106 close_action( &TC, result, queue_snd_id );
107 107 break;
108 108 //
109 109 case TC_SUBTYPE_EN_CAL:
110 110 result = action_enable_calibration( &TC, queue_snd_id );
111 111 close_action( &TC, result, queue_snd_id );
112 112 break;
113 113 //
114 114 case TC_SUBTYPE_DIS_CAL:
115 115 result = action_disable_calibration( &TC, queue_snd_id );
116 116 close_action( &TC, result, queue_snd_id );
117 117 break;
118 118 //
119 119 case TC_SUBTYPE_UPDT_TIME:
120 120 result = action_update_time( &TC );
121 121 close_action( &TC, result, queue_snd_id );
122 122 break;
123 123 //
124 124 default:
125 125 break;
126 126 }
127 127 }
128 128 }
129 129 }
130 130
131 131 //***********
132 132 // TC ACTIONS
133 133
134 134 int action_reset(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
135 135 {
136 136 /** This function executes specific actions when a TC_LFR_RESET TeleCommand has been received.
137 137 *
138 138 * @param TC points to the TeleCommand packet that is being processed
139 139 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
140 140 *
141 141 */
142 142
143 143 send_tm_lfr_tc_exe_not_implemented( TC, queue_id );
144 144 return LFR_DEFAULT;
145 145 }
146 146
147 147 int action_enter_mode(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
148 148 {
149 149 /** This function executes specific actions when a TC_LFR_ENTER_MODE TeleCommand has been received.
150 150 *
151 151 * @param TC points to the TeleCommand packet that is being processed
152 152 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
153 153 *
154 154 */
155 155
156 156 rtems_status_code status;
157 157 unsigned char requestedMode;
158 158
159 159 requestedMode = TC->dataAndCRC[1];
160 160
161 161 if ( (requestedMode != LFR_MODE_STANDBY)
162 162 && (requestedMode != LFR_MODE_NORMAL) && (requestedMode != LFR_MODE_BURST)
163 163 && (requestedMode != LFR_MODE_SBM1) && (requestedMode != LFR_MODE_SBM2) )
164 164 {
165 165 status = RTEMS_UNSATISFIED;
166 166 send_tm_lfr_tc_exe_inconsistent( TC, queue_id, BYTE_POS_CP_LFR_MODE, requestedMode );
167 167 }
168 168 else
169 169 {
170 170 printf("try to enter mode %d\n", requestedMode);
171 171
172 172 #ifdef PRINT_TASK_STATISTICS
173 173 if (requestedMode != LFR_MODE_STANDBY)
174 174 {
175 175 rtems_cpu_usage_reset();
176 176 maxCount = 0;
177 177 }
178 178 #endif
179 179
180 180 status = transition_validation(requestedMode);
181 181
182 182 if ( status == LFR_SUCCESSFUL ) {
183 183 if ( lfrCurrentMode != LFR_MODE_STANDBY)
184 184 {
185 185 status = stop_current_mode();
186 186 }
187 187 if (status != RTEMS_SUCCESSFUL)
188 188 {
189 189 PRINTF("ERR *** in action_enter *** stop_current_mode\n")
190 190 }
191 191 status = enter_mode(requestedMode, TC);
192 192 }
193 193 else
194 194 {
195 195 PRINTF("ERR *** in action_enter *** transition rejected\n")
196 196 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
197 197 }
198 198 }
199 199
200 200 return status;
201 201 }
202 202
203 203 int action_update_info(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
204 204 {
205 205 /** This function executes specific actions when a TC_LFR_UPDATE_INFO TeleCommand has been received.
206 206 *
207 207 * @param TC points to the TeleCommand packet that is being processed
208 208 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
209 209 *
210 210 * @return LFR directive status code:
211 211 * - LFR_DEFAULT
212 212 * - LFR_SUCCESSFUL
213 213 *
214 214 */
215 215
216 216 unsigned int val;
217 217 int result;
218 218
219 219 result = LFR_DEFAULT;
220 220
221 221 val = housekeeping_packet.hk_lfr_update_info_tc_cnt[0] * 256
222 222 + housekeeping_packet.hk_lfr_update_info_tc_cnt[1];
223 223 val++;
224 224 housekeeping_packet.hk_lfr_update_info_tc_cnt[0] = (unsigned char) (val >> 8);
225 225 housekeeping_packet.hk_lfr_update_info_tc_cnt[1] = (unsigned char) (val);
226 226
227 227 return result;
228 228 }
229 229
230 230 int action_enable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
231 231 {
232 232 /** This function executes specific actions when a TC_LFR_ENABLE_CALIBRATION TeleCommand has been received.
233 233 *
234 234 * @param TC points to the TeleCommand packet that is being processed
235 235 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
236 236 *
237 237 */
238 238
239 239 int result;
240 240 unsigned char lfrMode;
241 241
242 242 result = LFR_DEFAULT;
243 243 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
244 244
245 245 if ( (lfrMode == LFR_MODE_STANDBY) || (lfrMode == LFR_MODE_BURST) || (lfrMode == LFR_MODE_SBM2) ) {
246 246 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
247 247 result = LFR_DEFAULT;
248 248 }
249 249 else {
250 250 send_tm_lfr_tc_exe_not_implemented( TC, queue_id );
251 251 result = LFR_DEFAULT;
252 252 }
253 253 return result;
254 254 }
255 255
256 256 int action_disable_calibration(ccsdsTelecommandPacket_t *TC, rtems_id queue_id)
257 257 {
258 258 /** This function executes specific actions when a TC_LFR_DISABLE_CALIBRATION TeleCommand has been received.
259 259 *
260 260 * @param TC points to the TeleCommand packet that is being processed
261 261 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
262 262 *
263 263 */
264 264
265 265 int result;
266 266 unsigned char lfrMode;
267 267
268 268 result = LFR_DEFAULT;
269 269 lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
270 270
271 271 if ( (lfrMode == LFR_MODE_STANDBY) || (lfrMode == LFR_MODE_BURST) || (lfrMode == LFR_MODE_SBM2) ) {
272 272 send_tm_lfr_tc_exe_not_executable( TC, queue_id );
273 273 result = LFR_DEFAULT;
274 274 }
275 275 else {
276 276 send_tm_lfr_tc_exe_not_implemented( TC, queue_id );
277 277 result = LFR_DEFAULT;
278 278 }
279 279 return result;
280 280 }
281 281
282 282 int action_update_time(ccsdsTelecommandPacket_t *TC)
283 283 {
284 284 /** This function executes specific actions when a TC_LFR_UPDATE_TIME TeleCommand has been received.
285 285 *
286 286 * @param TC points to the TeleCommand packet that is being processed
287 287 * @param queue_id is the id of the queue which handles TM transmission by the SpaceWire driver
288 288 *
289 289 * @return LFR_SUCCESSFUL
290 290 *
291 291 */
292 292
293 293 unsigned int val;
294 294
295 295 time_management_regs->coarse_time_load = (TC->dataAndCRC[0] << 24)
296 296 + (TC->dataAndCRC[1] << 16)
297 297 + (TC->dataAndCRC[2] << 8)
298 298 + TC->dataAndCRC[3];
299 299 val = housekeeping_packet.hk_lfr_update_time_tc_cnt[0] * 256
300 300 + housekeeping_packet.hk_lfr_update_time_tc_cnt[1];
301 301 val++;
302 302 housekeeping_packet.hk_lfr_update_time_tc_cnt[0] = (unsigned char) (val >> 8);
303 303 housekeeping_packet.hk_lfr_update_time_tc_cnt[1] = (unsigned char) (val);
304 304 time_management_regs->ctrl = time_management_regs->ctrl | 1;
305 305
306 306 return LFR_SUCCESSFUL;
307 307 }
308 308
309 309 //*******************
310 310 // ENTERING THE MODES
311 311
312 312 int transition_validation(unsigned char requestedMode)
313 313 {
314 314 int status;
315 315
316 316 switch (requestedMode)
317 317 {
318 318 case LFR_MODE_STANDBY:
319 319 if ( lfrCurrentMode == LFR_MODE_STANDBY ) {
320 320 status = LFR_DEFAULT;
321 321 }
322 322 else
323 323 {
324 324 status = LFR_SUCCESSFUL;
325 325 }
326 326 break;
327 327 case LFR_MODE_NORMAL:
328 328 if ( lfrCurrentMode == LFR_MODE_NORMAL ) {
329 329 status = LFR_DEFAULT;
330 330 }
331 331 else {
332 332 status = LFR_SUCCESSFUL;
333 333 }
334 334 break;
335 335 case LFR_MODE_BURST:
336 336 if ( lfrCurrentMode == LFR_MODE_BURST ) {
337 337 status = LFR_DEFAULT;
338 338 }
339 339 else {
340 340 status = LFR_SUCCESSFUL;
341 341 }
342 342 break;
343 343 case LFR_MODE_SBM1:
344 344 if ( lfrCurrentMode == LFR_MODE_SBM1 ) {
345 345 status = LFR_DEFAULT;
346 346 }
347 347 else {
348 348 status = LFR_SUCCESSFUL;
349 349 }
350 350 break;
351 351 case LFR_MODE_SBM2:
352 352 if ( lfrCurrentMode == LFR_MODE_SBM2 ) {
353 353 status = LFR_DEFAULT;
354 354 }
355 355 else {
356 356 status = LFR_SUCCESSFUL;
357 357 }
358 358 break;
359 359 default:
360 360 status = LFR_DEFAULT;
361 361 break;
362 362 }
363 363
364 364 return status;
365 365 }
366 366
367 367 int stop_current_mode()
368 368 {
369 369 /** This function stops the current mode by masking interrupt lines and suspending science tasks.
370 370 *
371 371 * @return RTEMS directive status codes:
372 372 * - RTEMS_SUCCESSFUL - task restarted successfully
373 373 * - RTEMS_INVALID_ID - task id invalid
374 374 * - RTEMS_ALREADY_SUSPENDED - task already suspended
375 375 *
376 376 */
377 377
378 378 rtems_status_code status;
379 379
380 380 status = RTEMS_SUCCESSFUL;
381 381
382 382 #ifdef GSA
383 383 LEON_Mask_interrupt( IRQ_WF ); // mask waveform interrupt (coming from the timer VHDL IP)
384 384 LEON_Clear_interrupt( IRQ_WF ); // clear waveform interrupt (coming from the timer VHDL IP)
385 385 timer_stop( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR );
386 386 #else
387 387 // mask interruptions
388 388 LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); // mask waveform picker interrupt
389 389 LEON_Mask_interrupt( IRQ_SPECTRAL_MATRIX ); // mask spectral matrix interrupt
390 390 // reset registers
391 391 reset_wfp_burst_enable(); // reset burst and enable bits
392 392 reset_wfp_status(); // reset all the status bits
393 393 // creal interruptions
394 394 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); // clear waveform picker interrupt
395 395 LEON_Clear_interrupt( IRQ_SPECTRAL_MATRIX ); // clear spectarl matrix interrupt
396 396 #endif
397 397 //**********************
398 398 // suspend several tasks
399 399 if (lfrCurrentMode != LFR_MODE_STANDBY) {
400 400 status = suspend_science_tasks();
401 401 }
402 402
403 403 if (status != RTEMS_SUCCESSFUL)
404 404 {
405 405 PRINTF1("in stop_current_mode *** in suspend_science_tasks *** ERR code: %d\n", status)
406 406 }
407 407
408 408 return status;
409 409 }
410 410
411 411 int enter_mode(unsigned char mode, ccsdsTelecommandPacket_t *TC )
412 412 {
413 413 rtems_status_code status;
414 414
415 415 status = RTEMS_UNSATISFIED;
416 416
417 417 housekeeping_packet.lfr_status_word[0] = (unsigned char) ((mode << 4) + 0x0d);
418 418 updateLFRCurrentMode();
419 419
420 420 switch(mode){
421 421 case LFR_MODE_STANDBY:
422 422 status = enter_standby_mode( );
423 423 break;
424 424 case LFR_MODE_NORMAL:
425 425 status = enter_normal_mode( );
426 426 break;
427 427 case LFR_MODE_BURST:
428 428 status = enter_burst_mode( );
429 429 break;
430 430 case LFR_MODE_SBM1:
431 431 status = enter_sbm1_mode( );
432 432 break;
433 433 case LFR_MODE_SBM2:
434 434 status = enter_sbm2_mode( );
435 435 break;
436 436 default:
437 437 status = RTEMS_UNSATISFIED;
438 438 }
439 439
440 440 if (status != RTEMS_SUCCESSFUL)
441 441 {
442 442 PRINTF("in enter_mode *** ERR\n")
443 443 status = RTEMS_UNSATISFIED;
444 444 }
445 445
446 446 return status;
447 447 }
448 448
449 449 int enter_standby_mode()
450 450 {
451 451 PRINTF1("maxCount = %d\n", maxCount)
452 452
453 453 #ifdef PRINT_TASK_STATISTICS
454 454 rtems_cpu_usage_report();
455 455 #endif
456 456
457 457 #ifdef PRINT_STACK_REPORT
458 458 rtems_stack_checker_report_usage();
459 459 #endif
460 460
461 461 return LFR_SUCCESSFUL;
462 462 }
463 463
464 464 int enter_normal_mode()
465 465 {
466 466 rtems_status_code status;
467 467
468 468 status = restart_science_tasks();
469 469
470 470 #ifdef GSA
471 471 timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR );
472 472 timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR );
473 473 LEON_Clear_interrupt( IRQ_WF );
474 474 LEON_Unmask_interrupt( IRQ_WF );
475 475 //
476 476 set_local_nb_interrupt_f0_MAX();
477 477 LEON_Clear_interrupt( IRQ_SM ); // the IRQ_SM seems to be incompatible with the IRQ_WF on the xilinx board
478 478 LEON_Unmask_interrupt( IRQ_SM );
479 479 #else
480 480 //****************
481 481 // waveform picker
482 482 reset_waveform_picker_regs();
483 483 set_wfp_burst_enable_register(LFR_MODE_NORMAL);
484 484 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER );
485 485 LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER );
486 486 //****************
487 487 // spectral matrix
488 488 #endif
489 489
490 490 return status;
491 491 }
492 492
493 493 int enter_burst_mode()
494 494 {
495 495 rtems_status_code status;
496 496
497 497 status = restart_science_tasks();
498 498
499 499 #ifdef GSA
500 500 LEON_Unmask_interrupt( IRQ_SM );
501 501 #else
502 502 reset_waveform_picker_regs();
503 503 set_wfp_burst_enable_register(LFR_MODE_BURST);
504 504 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER );
505 505 LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER );
506 506 #endif
507 507
508 508 return status;
509 509 }
510 510
511 511 int enter_sbm1_mode()
512 512 {
513 513 rtems_status_code status;
514 514
515 515 status = restart_science_tasks();
516 516
517 517 set_local_sbm1_nb_cwf_max();
518 518
519 519 reset_local_sbm1_nb_cwf_sent();
520 520
521 521 #ifdef GSA
522 522 LEON_Unmask_interrupt( IRQ_SM );
523 523 #else
524 524 reset_waveform_picker_regs();
525 525 set_wfp_burst_enable_register(LFR_MODE_SBM1);
526 526 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER );
527 527 LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER );
528 528 // SM simulation
529 529 // timer_start( (gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR );
530 530 // LEON_Clear_interrupt( IRQ_SM ); // the IRQ_SM seems to be incompatible with the IRQ_WF on the xilinx board
531 531 // LEON_Unmask_interrupt( IRQ_SM );
532 532 #endif
533 533
534 534 return status;
535 535 }
536 536
537 537 int enter_sbm2_mode()
538 538 {
539 539 rtems_status_code status;
540 540
541 541 status = restart_science_tasks();
542 542
543 543 set_local_sbm2_nb_cwf_max();
544 544
545 545 reset_local_sbm2_nb_cwf_sent();
546 546
547 547 #ifdef GSA
548 548 LEON_Unmask_interrupt( IRQ_SM );
549 549 #else
550 550 reset_waveform_picker_regs();
551 551 set_wfp_burst_enable_register(LFR_MODE_SBM2);
552 552 LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER );
553 553 LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER );
554 554 #endif
555 555
556 556 return status;
557 557 }
558 558
559 559 int restart_science_tasks()
560 560 {
561 561 rtems_status_code status[6];
562 562 rtems_status_code ret;
563 563
564 564 ret = RTEMS_SUCCESSFUL;
565 565
566 566 status[0] = rtems_task_restart( Task_id[TASKID_AVF0], 1 );
567 567 if (status[0] != RTEMS_SUCCESSFUL)
568 568 {
569 569 PRINTF1("in restart_science_task *** 0 ERR %d\n", status[0])
570 570 }
571 571
572 572 status[1] = rtems_task_restart( Task_id[TASKID_BPF0],1 );
573 573 if (status[1] != RTEMS_SUCCESSFUL)
574 574 {
575 575 PRINTF1("in restart_science_task *** 1 ERR %d\n", status[1])
576 576 }
577 577
578 578 status[2] = rtems_task_restart( Task_id[TASKID_WFRM],1 );
579 579 if (status[2] != RTEMS_SUCCESSFUL)
580 580 {
581 581 PRINTF1("in restart_science_task *** 2 ERR %d\n", status[2])
582 582 }
583 583
584 584 status[3] = rtems_task_restart( Task_id[TASKID_CWF3],1 );
585 585 if (status[3] != RTEMS_SUCCESSFUL)
586 586 {
587 587 PRINTF1("in restart_science_task *** 3 ERR %d\n", status[3])
588 588 }
589 589
590 590 status[4] = rtems_task_restart( Task_id[TASKID_CWF2],1 );
591 591 if (status[4] != RTEMS_SUCCESSFUL)
592 592 {
593 593 PRINTF1("in restart_science_task *** 4 ERR %d\n", status[4])
594 594 }
595 595
596 596 status[5] = rtems_task_restart( Task_id[TASKID_CWF1],1 );
597 597 if (status[5] != RTEMS_SUCCESSFUL)
598 598 {
599 599 PRINTF1("in restart_science_task *** 5 ERR %d\n", status[5])
600 600 }
601 601
602 602 if ( (status[0] != RTEMS_SUCCESSFUL) || (status[1] != RTEMS_SUCCESSFUL) || (status[2] != RTEMS_SUCCESSFUL) ||
603 603 (status[3] != RTEMS_SUCCESSFUL) || (status[4] != RTEMS_SUCCESSFUL) || (status[5] != RTEMS_SUCCESSFUL) )
604 604 {
605 605 ret = RTEMS_UNSATISFIED;
606 606 }
607 607
608 608 return ret;
609 609 }
610 610
611 611 int suspend_science_tasks()
612 612 {
613 613 /** This function suspends the science tasks.
614 614 *
615 615 * @return RTEMS directive status codes:
616 616 * - RTEMS_SUCCESSFUL - task restarted successfully
617 617 * - RTEMS_INVALID_ID - task id invalid
618 618 * - RTEMS_ALREADY_SUSPENDED - task already suspended
619 619 *
620 620 */
621 621
622 622 rtems_status_code status;
623 623
624 624 status = rtems_task_suspend( Task_id[TASKID_AVF0] );
625 625 if (status != RTEMS_SUCCESSFUL)
626 626 {
627 627 PRINTF1("in suspend_science_task *** AVF0 ERR %d\n", status)
628 628 }
629 629
630 630 if (status == RTEMS_SUCCESSFUL) // suspend BPF0
631 631 {
632 632 status = rtems_task_suspend( Task_id[TASKID_BPF0] );
633 633 if (status != RTEMS_SUCCESSFUL)
634 634 {
635 635 PRINTF1("in suspend_science_task *** BPF0 ERR %d\n", status)
636 636 }
637 637 }
638 638
639 639 if (status == RTEMS_SUCCESSFUL) // suspend WFRM
640 640 {
641 641 status = rtems_task_suspend( Task_id[TASKID_WFRM] );
642 642 if (status != RTEMS_SUCCESSFUL)
643 643 {
644 644 PRINTF1("in suspend_science_task *** WFRM ERR %d\n", status)
645 645 }
646 646 }
647 647
648 648 if (status == RTEMS_SUCCESSFUL) // suspend CWF3
649 649 {
650 650 status = rtems_task_suspend( Task_id[TASKID_CWF3] );
651 651 if (status != RTEMS_SUCCESSFUL)
652 652 {
653 653 PRINTF1("in suspend_science_task *** CWF3 ERR %d\n", status)
654 654 }
655 655 }
656 656
657 657 if (status == RTEMS_SUCCESSFUL) // suspend CWF2
658 658 {
659 659 status = rtems_task_suspend( Task_id[TASKID_CWF2] );
660 660 if (status != RTEMS_SUCCESSFUL)
661 661 {
662 662 PRINTF1("in suspend_science_task *** CWF2 ERR %d\n", status)
663 663 }
664 664 }
665 665
666 666 if (status == RTEMS_SUCCESSFUL) // suspend CWF1
667 667 {
668 668 status = rtems_task_suspend( Task_id[TASKID_CWF1] );
669 669 if (status != RTEMS_SUCCESSFUL)
670 670 {
671 671 PRINTF1("in suspend_science_task *** CWF1 ERR %d\n", status)
672 672 }
673 673 }
674 674
675 675 return status;
676 676 }
677 677
678 678 //****************
679 679 // CLOSING ACTIONS
680 void update_last_TC_exe(ccsdsTelecommandPacket_t *TC)
680 void update_last_TC_exe(ccsdsTelecommandPacket_t *TC, unsigned char *time)
681 681 {
682 682 housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0];
683 683 housekeeping_packet.hk_lfr_last_exe_tc_id[1] = TC->packetID[1];
684 684 housekeeping_packet.hk_lfr_last_exe_tc_type[0] = 0x00;
685 685 housekeeping_packet.hk_lfr_last_exe_tc_type[1] = TC->serviceType;
686 686 housekeeping_packet.hk_lfr_last_exe_tc_subtype[0] = 0x00;
687 687 housekeeping_packet.hk_lfr_last_exe_tc_subtype[1] = TC->serviceSubType;
688 housekeeping_packet.hk_lfr_last_exe_tc_time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
689 housekeeping_packet.hk_lfr_last_exe_tc_time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
690 housekeeping_packet.hk_lfr_last_exe_tc_time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
691 housekeeping_packet.hk_lfr_last_exe_tc_time[3] = (unsigned char) (time_management_regs->coarse_time);
692 housekeeping_packet.hk_lfr_last_exe_tc_time[4] = (unsigned char) (time_management_regs->fine_time>>8);
693 housekeeping_packet.hk_lfr_last_exe_tc_time[5] = (unsigned char) (time_management_regs->fine_time);
688 housekeeping_packet.hk_lfr_last_exe_tc_time[0] = time[0];
689 housekeeping_packet.hk_lfr_last_exe_tc_time[1] = time[1];
690 housekeeping_packet.hk_lfr_last_exe_tc_time[2] = time[2];
691 housekeeping_packet.hk_lfr_last_exe_tc_time[3] = time[3];
692 housekeeping_packet.hk_lfr_last_exe_tc_time[4] = time[4];
693 housekeeping_packet.hk_lfr_last_exe_tc_time[5] = time[5];
694 694 }
695 695
696 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC)
696 void update_last_TC_rej(ccsdsTelecommandPacket_t *TC, unsigned char *time)
697 697 {
698 698 housekeeping_packet.hk_lfr_last_rej_tc_id[0] = TC->packetID[0];
699 699 housekeeping_packet.hk_lfr_last_rej_tc_id[1] = TC->packetID[1];
700 700 housekeeping_packet.hk_lfr_last_rej_tc_type[0] = 0x00;
701 701 housekeeping_packet.hk_lfr_last_rej_tc_type[1] = TC->serviceType;
702 702 housekeeping_packet.hk_lfr_last_rej_tc_subtype[0] = 0x00;
703 703 housekeeping_packet.hk_lfr_last_rej_tc_subtype[1] = TC->serviceSubType;
704 housekeeping_packet.hk_lfr_last_rej_tc_time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
705 housekeeping_packet.hk_lfr_last_rej_tc_time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
706 housekeeping_packet.hk_lfr_last_rej_tc_time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
707 housekeeping_packet.hk_lfr_last_rej_tc_time[3] = (unsigned char) (time_management_regs->coarse_time);
708 housekeeping_packet.hk_lfr_last_rej_tc_time[4] = (unsigned char) (time_management_regs->fine_time>>8);
709 housekeeping_packet.hk_lfr_last_rej_tc_time[5] = (unsigned char) (time_management_regs->fine_time);
704 housekeeping_packet.hk_lfr_last_rej_tc_time[0] = time[0];
705 housekeeping_packet.hk_lfr_last_rej_tc_time[1] = time[1];
706 housekeeping_packet.hk_lfr_last_rej_tc_time[2] = time[2];
707 housekeeping_packet.hk_lfr_last_rej_tc_time[3] = time[3];
708 housekeeping_packet.hk_lfr_last_rej_tc_time[4] = time[4];
709 housekeeping_packet.hk_lfr_last_rej_tc_time[5] = time[5];
710 710 }
711 711
712 712 void close_action(ccsdsTelecommandPacket_t *TC, int result, rtems_id queue_id)
713 713 {
714 714 unsigned int val = 0;
715 unsigned char time[6];
716
717 time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
718 time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
719 time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
720 time[3] = (unsigned char) (time_management_regs->coarse_time);
721 time[4] = (unsigned char) (time_management_regs->fine_time>>8);
722 time[5] = (unsigned char) (time_management_regs->fine_time);
723
715 724 if (result == LFR_SUCCESSFUL)
716 725 {
717 726 if ( !( (TC->serviceType==TC_TYPE_TIME) && (TC->serviceSubType==TC_SUBTYPE_UPDT_TIME) )
718 727 &&
719 728 !( (TC->serviceType==TC_TYPE_GEN) && (TC->serviceSubType==TC_SUBTYPE_UPDT_INFO))
720 729 )
721 730 {
722 send_tm_lfr_tc_exe_success( TC, queue_id );
731 send_tm_lfr_tc_exe_success( TC, queue_id, time );
723 732 }
724 update_last_TC_exe( TC );
733 update_last_TC_exe( TC, time );
725 734 val = housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[0] * 256 + housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[1];
726 735 val++;
727 736 housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[0] = (unsigned char) (val >> 8);
728 737 housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[1] = (unsigned char) (val);
729 738 }
730 739 else
731 740 {
732 update_last_TC_rej( TC );
741 update_last_TC_rej( TC, time );
733 742 val = housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[0] * 256 + housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[1];
734 743 val++;
735 744 housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[0] = (unsigned char) (val >> 8);
736 745 housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[1] = (unsigned char) (val);
737 746 }
738 747 }
739 748
740 749 //***************************
741 750 // Interrupt Service Routines
742 751 rtems_isr commutation_isr1( rtems_vector_number vector )
743 752 {
744 753 if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
745 754 printf("In commutation_isr1 *** Error sending event to DUMB\n");
746 755 }
747 756 }
748 757
749 758 rtems_isr commutation_isr2( rtems_vector_number vector )
750 759 {
751 760 if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) {
752 761 printf("In commutation_isr2 *** Error sending event to DUMB\n");
753 762 }
754 763 }
755 764
756 765 //****************
757 766 // OTHER FUNCTIONS
758 767 void updateLFRCurrentMode()
759 768 {
760 769 /** This function updates the value of the global variable lfrCurrentMode.
761 770 *
762 771 * lfrCurrentMode is a parameter used by several functions to know in which mode LFR is running.
763 772 *
764 773 */
765 774 // update the local value of lfrCurrentMode with the value contained in the housekeeping_packet structure
766 775 lfrCurrentMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4;
767 776 }
768 777
@@ -1,491 +1,491
1 1 /** Functions to send TM packets related to TC parsing and execution.
2 2 *
3 3 * @file
4 4 * @author P. LEROY
5 5 *
6 6 * A group of functions to send appropriate TM packets after parsing and execution:
7 7 * - TM_LFR_TC_EXE_SUCCESS
8 8 * - TM_LFR_TC_EXE_INCONSISTENT
9 9 * - TM_LFR_TC_EXE_NOT_EXECUTABLE
10 10 * - TM_LFR_TC_EXE_NOT_IMPLEMENTED
11 11 * - TM_LFR_TC_EXE_ERROR
12 12 * - TM_LFR_TC_EXE_CORRUPTED
13 13 *
14 14 */
15 15
16 16 #include "tm_lfr_tc_exe.h"
17 17
18 int send_tm_lfr_tc_exe_success( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
18 int send_tm_lfr_tc_exe_success( ccsdsTelecommandPacket_t *TC, rtems_id queue_id, unsigned char *time )
19 19 {
20 20 /** This function sends a TM_LFR_TC_EXE_SUCCESS packet in the dedicated RTEMS message queue.
21 21 *
22 22 * @param TC points to the TeleCommand packet that is being processed
23 23 * @param queue_id is the id of the queue which handles TM
24 24 *
25 25 * @return RTEMS directive status code:
26 26 * - RTEMS_SUCCESSFUL - message sent successfully
27 27 * - RTEMS_INVALID_ID - invalid queue id
28 28 * - RTEMS_INVALID_SIZE - invalid message size
29 29 * - RTEMS_INVALID_ADDRESS - buffer is NULL
30 30 * - RTEMS_UNSATISFIED - out of message buffers
31 31 * - RTEMS_TOO_MANY - queue s limit has been reached
32 32 *
33 33 */
34 34
35 35 rtems_status_code status;
36 36 Packet_TM_LFR_TC_EXE_SUCCESS_t TM;
37 37 unsigned char messageSize;
38 38
39 39 TM.targetLogicalAddress = CCSDS_DESTINATION_ID;
40 40 TM.protocolIdentifier = CCSDS_PROTOCOLE_ID;
41 41 TM.reserved = DEFAULT_RESERVED;
42 42 TM.userApplication = CCSDS_USER_APP;
43 43 // PACKET HEADER
44 44 TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8);
45 45 TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE );
46 46 increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID );
47 47 TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_SUCCESS >> 8);
48 48 TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_SUCCESS );
49 49 // DATA FIELD HEADER
50 50 TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
51 51 TM.serviceType = TM_TYPE_TC_EXE;
52 52 TM.serviceSubType = TM_SUBTYPE_EXE_OK;
53 53 TM.destinationID = TC->sourceID;
54 TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
55 TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
56 TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
57 TM.time[3] = (unsigned char) (time_management_regs->coarse_time);
58 TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
59 TM.time[5] = (unsigned char) (time_management_regs->fine_time);
54 TM.time[0] = time[0];
55 TM.time[1] = time[1];
56 TM.time[2] = time[2];
57 TM.time[3] = time[3];
58 TM.time[4] = time[4];
59 TM.time[5] = time[5];
60 60 //
61 61 TM.telecommand_pkt_id[0] = TC->packetID[0];
62 62 TM.telecommand_pkt_id[1] = TC->packetID[1];
63 63 TM.pkt_seq_control[0] = TC->packetSequenceControl[0];
64 64 TM.pkt_seq_control[1] = TC->packetSequenceControl[1];
65 65
66 66 messageSize = PACKET_LENGTH_TC_EXE_SUCCESS + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES;
67 67
68 68 // SEND DATA
69 69 status = rtems_message_queue_send( queue_id, &TM, messageSize);
70 70 if (status != RTEMS_SUCCESSFUL) {
71 71 PRINTF("in send_tm_lfr_tc_exe_success *** ERR\n")
72 72 }
73 73
74 74 return status;
75 75 }
76 76
77 77 int send_tm_lfr_tc_exe_inconsistent( ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
78 78 unsigned char byte_position, unsigned char rcv_value )
79 79 {
80 80 /** This function sends a TM_LFR_TC_EXE_INCONSISTENT packet in the dedicated RTEMS message queue.
81 81 *
82 82 * @param TC points to the TeleCommand packet that is being processed
83 83 * @param queue_id is the id of the queue which handles TM
84 84 * @param byte_position is the byte position of the MSB of the parameter that has been seen as inconsistent
85 85 * @param rcv_value is the value of the LSB of the parameter that has been deteced as inconsistent
86 86 *
87 87 * @return RTEMS directive status code:
88 88 * - RTEMS_SUCCESSFUL - message sent successfully
89 89 * - RTEMS_INVALID_ID - invalid queue id
90 90 * - RTEMS_INVALID_SIZE - invalid message size
91 91 * - RTEMS_INVALID_ADDRESS - buffer is NULL
92 92 * - RTEMS_UNSATISFIED - out of message buffers
93 93 * - RTEMS_TOO_MANY - queue s limit has been reached
94 94 *
95 95 */
96 96
97 97 rtems_status_code status;
98 98 Packet_TM_LFR_TC_EXE_INCONSISTENT_t TM;
99 99 unsigned char messageSize;
100 100
101 101 TM.targetLogicalAddress = CCSDS_DESTINATION_ID;
102 102 TM.protocolIdentifier = CCSDS_PROTOCOLE_ID;
103 103 TM.reserved = DEFAULT_RESERVED;
104 104 TM.userApplication = CCSDS_USER_APP;
105 105 // PACKET HEADER
106 106 TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8);
107 107 TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE );
108 108 increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID );
109 109 TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_INCONSISTENT >> 8);
110 110 TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_INCONSISTENT );
111 111 // DATA FIELD HEADER
112 112 TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
113 113 TM.serviceType = TM_TYPE_TC_EXE;
114 114 TM.serviceSubType = TM_SUBTYPE_EXE_NOK;
115 115 TM.destinationID = TC->sourceID;
116 116 TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
117 117 TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
118 118 TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
119 119 TM.time[3] = (unsigned char) (time_management_regs->coarse_time);
120 120 TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
121 121 TM.time[5] = (unsigned char) (time_management_regs->fine_time);
122 122 //
123 123 TM.tc_failure_code[0] = (char) (WRONG_APP_DATA >> 8);
124 124 TM.tc_failure_code[1] = (char) (WRONG_APP_DATA );
125 125 TM.telecommand_pkt_id[0] = TC->packetID[0];
126 126 TM.telecommand_pkt_id[1] = TC->packetID[1];
127 127 TM.pkt_seq_control[0] = TC->packetSequenceControl[0];
128 128 TM.pkt_seq_control[1] = TC->packetSequenceControl[1];
129 129 TM.tc_service = TC->serviceType; // type of the rejected TC
130 130 TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC
131 131 TM.byte_position = byte_position;
132 132 TM.rcv_value = rcv_value;
133 133
134 134 messageSize = PACKET_LENGTH_TC_EXE_INCONSISTENT + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES;
135 135
136 136 // SEND DATA
137 137 status = rtems_message_queue_send( queue_id, &TM, messageSize);
138 138 if (status != RTEMS_SUCCESSFUL) {
139 139 PRINTF("in send_tm_lfr_tc_exe_inconsistent *** ERR\n")
140 140 }
141 141
142 142 return status;
143 143 }
144 144
145 145 int send_tm_lfr_tc_exe_not_executable( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
146 146 {
147 147 /** This function sends a TM_LFR_TC_EXE_NOT_EXECUTABLE packet in the dedicated RTEMS message queue.
148 148 *
149 149 * @param TC points to the TeleCommand packet that is being processed
150 150 * @param queue_id is the id of the queue which handles TM
151 151 *
152 152 * @return RTEMS directive status code:
153 153 * - RTEMS_SUCCESSFUL - message sent successfully
154 154 * - RTEMS_INVALID_ID - invalid queue id
155 155 * - RTEMS_INVALID_SIZE - invalid message size
156 156 * - RTEMS_INVALID_ADDRESS - buffer is NULL
157 157 * - RTEMS_UNSATISFIED - out of message buffers
158 158 * - RTEMS_TOO_MANY - queue s limit has been reached
159 159 *
160 160 */
161 161
162 162 rtems_status_code status;
163 163 Packet_TM_LFR_TC_EXE_NOT_EXECUTABLE_t TM;
164 164 unsigned char messageSize;
165 165
166 166 TM.targetLogicalAddress = CCSDS_DESTINATION_ID;
167 167 TM.protocolIdentifier = CCSDS_PROTOCOLE_ID;
168 168 TM.reserved = DEFAULT_RESERVED;
169 169 TM.userApplication = CCSDS_USER_APP;
170 170 // PACKET HEADER
171 171 TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8);
172 172 TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE );
173 173 increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID );
174 174 TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE >> 8);
175 175 TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE );
176 176 // DATA FIELD HEADER
177 177 TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
178 178 TM.serviceType = TM_TYPE_TC_EXE;
179 179 TM.serviceSubType = TM_SUBTYPE_EXE_NOK;
180 180 TM.destinationID = TC->sourceID; // default destination id
181 181 TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
182 182 TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
183 183 TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
184 184 TM.time[3] = (unsigned char) (time_management_regs->coarse_time);
185 185 TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
186 186 TM.time[5] = (unsigned char) (time_management_regs->fine_time);
187 187 //
188 188 TM.tc_failure_code[0] = (char) (TC_NOT_EXE >> 8);
189 189 TM.tc_failure_code[1] = (char) (TC_NOT_EXE );
190 190 TM.telecommand_pkt_id[0] = TC->packetID[0];
191 191 TM.telecommand_pkt_id[1] = TC->packetID[1];
192 192 TM.pkt_seq_control[0] = TC->packetSequenceControl[0];
193 193 TM.pkt_seq_control[1] = TC->packetSequenceControl[1];
194 194 TM.tc_service = TC->serviceType; // type of the rejected TC
195 195 TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC
196 196 TM.lfr_status_word[0] = housekeeping_packet.lfr_status_word[0];
197 197 TM.lfr_status_word[1] = housekeeping_packet.lfr_status_word[1];
198 198
199 199 messageSize = PACKET_LENGTH_TC_EXE_NOT_EXECUTABLE + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES;
200 200
201 201 // SEND DATA
202 202 status = rtems_message_queue_send( queue_id, &TM, messageSize);
203 203 if (status != RTEMS_SUCCESSFUL) {
204 204 PRINTF("in send_tm_lfr_tc_exe_not_executable *** ERR\n")
205 205 }
206 206
207 207 return status;
208 208 }
209 209
210 210 int send_tm_lfr_tc_exe_not_implemented( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
211 211 {
212 212 /** This function sends a TM_LFR_TC_EXE_NOT_IMPLEMENTED packet in the dedicated RTEMS message queue.
213 213 *
214 214 * @param TC points to the TeleCommand packet that is being processed
215 215 * @param queue_id is the id of the queue which handles TM
216 216 *
217 217 * @return RTEMS directive status code:
218 218 * - RTEMS_SUCCESSFUL - message sent successfully
219 219 * - RTEMS_INVALID_ID - invalid queue id
220 220 * - RTEMS_INVALID_SIZE - invalid message size
221 221 * - RTEMS_INVALID_ADDRESS - buffer is NULL
222 222 * - RTEMS_UNSATISFIED - out of message buffers
223 223 * - RTEMS_TOO_MANY - queue s limit has been reached
224 224 *
225 225 */
226 226
227 227 rtems_status_code status;
228 228 Packet_TM_LFR_TC_EXE_NOT_IMPLEMENTED_t TM;
229 229 unsigned char messageSize;
230 230
231 231 TM.targetLogicalAddress = CCSDS_DESTINATION_ID;
232 232 TM.protocolIdentifier = CCSDS_PROTOCOLE_ID;
233 233 TM.reserved = DEFAULT_RESERVED;
234 234 TM.userApplication = CCSDS_USER_APP;
235 235 // PACKET HEADER
236 236 TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8);
237 237 TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE );
238 238 increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID );
239 239 TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED >> 8);
240 240 TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED );
241 241 // DATA FIELD HEADER
242 242 TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
243 243 TM.serviceType = TM_TYPE_TC_EXE;
244 244 TM.serviceSubType = TM_SUBTYPE_EXE_NOK;
245 245 TM.destinationID = TC->sourceID; // default destination id
246 246 TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
247 247 TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
248 248 TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
249 249 TM.time[3] = (unsigned char) (time_management_regs->coarse_time);
250 250 TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
251 251 TM.time[5] = (unsigned char) (time_management_regs->fine_time);
252 252 //
253 253 TM.tc_failure_code[0] = (char) (FUNCT_NOT_IMPL >> 8);
254 254 TM.tc_failure_code[1] = (char) (FUNCT_NOT_IMPL );
255 255 TM.telecommand_pkt_id[0] = TC->packetID[0];
256 256 TM.telecommand_pkt_id[1] = TC->packetID[1];
257 257 TM.pkt_seq_control[0] = TC->packetSequenceControl[0];
258 258 TM.pkt_seq_control[1] = TC->packetSequenceControl[1];
259 259 TM.tc_service = TC->serviceType; // type of the rejected TC
260 260 TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC
261 261
262 262 messageSize = PACKET_LENGTH_TC_EXE_NOT_IMPLEMENTED + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES;
263 263
264 264 // SEND DATA
265 265 status = rtems_message_queue_send( queue_id, &TM, messageSize);
266 266 if (status != RTEMS_SUCCESSFUL) {
267 267 PRINTF("in send_tm_lfr_tc_exe_not_implemented *** ERR\n")
268 268 }
269 269
270 270 return status;
271 271 }
272 272
273 273 int send_tm_lfr_tc_exe_error( ccsdsTelecommandPacket_t *TC, rtems_id queue_id )
274 274 {
275 275 /** This function sends a TM_LFR_TC_EXE_ERROR packet in the dedicated RTEMS message queue.
276 276 *
277 277 * @param TC points to the TeleCommand packet that is being processed
278 278 * @param queue_id is the id of the queue which handles TM
279 279 *
280 280 * @return RTEMS directive status code:
281 281 * - RTEMS_SUCCESSFUL - message sent successfully
282 282 * - RTEMS_INVALID_ID - invalid queue id
283 283 * - RTEMS_INVALID_SIZE - invalid message size
284 284 * - RTEMS_INVALID_ADDRESS - buffer is NULL
285 285 * - RTEMS_UNSATISFIED - out of message buffers
286 286 * - RTEMS_TOO_MANY - queue s limit has been reached
287 287 *
288 288 */
289 289
290 290 rtems_status_code status;
291 291 Packet_TM_LFR_TC_EXE_ERROR_t TM;
292 292 unsigned char messageSize;
293 293
294 294 TM.targetLogicalAddress = CCSDS_DESTINATION_ID;
295 295 TM.protocolIdentifier = CCSDS_PROTOCOLE_ID;
296 296 TM.reserved = DEFAULT_RESERVED;
297 297 TM.userApplication = CCSDS_USER_APP;
298 298 // PACKET HEADER
299 299 TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8);
300 300 TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE );
301 301 increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID );
302 302 TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_ERROR >> 8);
303 303 TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_ERROR );
304 304 // DATA FIELD HEADER
305 305 TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
306 306 TM.serviceType = TM_TYPE_TC_EXE;
307 307 TM.serviceSubType = TM_SUBTYPE_EXE_NOK;
308 308 TM.destinationID = TC->sourceID; // default destination id
309 309 TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
310 310 TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
311 311 TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
312 312 TM.time[3] = (unsigned char) (time_management_regs->coarse_time);
313 313 TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
314 314 TM.time[5] = (unsigned char) (time_management_regs->fine_time);
315 315 //
316 316 TM.tc_failure_code[0] = (char) (FAIL_DETECTED >> 8);
317 317 TM.tc_failure_code[1] = (char) (FAIL_DETECTED );
318 318 TM.telecommand_pkt_id[0] = TC->packetID[0];
319 319 TM.telecommand_pkt_id[1] = TC->packetID[1];
320 320 TM.pkt_seq_control[0] = TC->packetSequenceControl[0];
321 321 TM.pkt_seq_control[1] = TC->packetSequenceControl[1];
322 322 TM.tc_service = TC->serviceType; // type of the rejected TC
323 323 TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC
324 324
325 325 messageSize = PACKET_LENGTH_TC_EXE_ERROR + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES;
326 326
327 327 // SEND DATA
328 328 status = rtems_message_queue_send( queue_id, &TM, messageSize);
329 329 if (status != RTEMS_SUCCESSFUL) {
330 330 PRINTF("in send_tm_lfr_tc_exe_error *** ERR\n")
331 331 }
332 332
333 333 return status;
334 334 }
335 335
336 336 int send_tm_lfr_tc_exe_corrupted(ccsdsTelecommandPacket_t *TC, rtems_id queue_id,
337 337 unsigned char *computed_CRC, unsigned char *currentTC_LEN_RCV,
338 338 unsigned char destinationID)
339 339 {
340 340 /** This function sends a TM_LFR_TC_EXE_CORRUPTED packet in the dedicated RTEMS message queue.
341 341 *
342 342 * @param TC points to the TeleCommand packet that is being processed
343 343 * @param queue_id is the id of the queue which handles TM
344 344 * @param computed_CRC points to a buffer of two bytes containing the CRC computed during the parsing of the TeleCommand
345 345 * @param currentTC_LEN_RCV points to a buffer of two bytes containing a packet size field computed on the received data
346 346 *
347 347 * @return RTEMS directive status code:
348 348 * - RTEMS_SUCCESSFUL - message sent successfully
349 349 * - RTEMS_INVALID_ID - invalid queue id
350 350 * - RTEMS_INVALID_SIZE - invalid message size
351 351 * - RTEMS_INVALID_ADDRESS - buffer is NULL
352 352 * - RTEMS_UNSATISFIED - out of message buffers
353 353 * - RTEMS_TOO_MANY - queue s limit has been reached
354 354 *
355 355 */
356 356
357 357 rtems_status_code status;
358 358 Packet_TM_LFR_TC_EXE_CORRUPTED_t TM;
359 359 unsigned char messageSize;
360 360 unsigned int packetLength;
361 361 unsigned char *packetDataField;
362 362
363 363 packetLength = (TC->packetLength[0] * 256) + TC->packetLength[1]; // compute the packet length parameter
364 364 packetDataField = (unsigned char *) &TC->headerFlag_pusVersion_Ack; // get the beginning of the data field
365 365
366 366 TM.targetLogicalAddress = CCSDS_DESTINATION_ID;
367 367 TM.protocolIdentifier = CCSDS_PROTOCOLE_ID;
368 368 TM.reserved = DEFAULT_RESERVED;
369 369 TM.userApplication = CCSDS_USER_APP;
370 370 // PACKET HEADER
371 371 TM.packetID[0] = (unsigned char) (TM_PACKET_ID_TC_EXE >> 8);
372 372 TM.packetID[1] = (unsigned char) (TM_PACKET_ID_TC_EXE );
373 373 increment_seq_counter_destination_id( TM.packetSequenceControl, TC->sourceID );
374 374 TM.packetLength[0] = (unsigned char) (PACKET_LENGTH_TC_EXE_CORRUPTED >> 8);
375 375 TM.packetLength[1] = (unsigned char) (PACKET_LENGTH_TC_EXE_CORRUPTED );
376 376 // DATA FIELD HEADER
377 377 TM.spare1_pusVersion_spare2 = DEFAULT_SPARE1_PUSVERSION_SPARE2;
378 378 TM.serviceType = TM_TYPE_TC_EXE;
379 379 TM.serviceSubType = TM_SUBTYPE_EXE_NOK;
380 380 TM.destinationID = destinationID;
381 381 TM.time[0] = (unsigned char) (time_management_regs->coarse_time>>24);
382 382 TM.time[1] = (unsigned char) (time_management_regs->coarse_time>>16);
383 383 TM.time[2] = (unsigned char) (time_management_regs->coarse_time>>8);
384 384 TM.time[3] = (unsigned char) (time_management_regs->coarse_time);
385 385 TM.time[4] = (unsigned char) (time_management_regs->fine_time>>8);
386 386 TM.time[5] = (unsigned char) (time_management_regs->fine_time);
387 387 //
388 388 TM.tc_failure_code[0] = (unsigned char) (CORRUPTED >> 8);
389 389 TM.tc_failure_code[1] = (unsigned char) (CORRUPTED );
390 390 TM.telecommand_pkt_id[0] = TC->packetID[0];
391 391 TM.telecommand_pkt_id[1] = TC->packetID[1];
392 392 TM.pkt_seq_control[0] = TC->packetSequenceControl[0];
393 393 TM.pkt_seq_control[1] = TC->packetSequenceControl[1];
394 394 TM.tc_service = TC->serviceType; // type of the rejected TC
395 395 TM.tc_subtype = TC->serviceSubType; // subtype of the rejected TC
396 396 TM.pkt_len_rcv_value[0] = TC->packetLength[0];
397 397 TM.pkt_len_rcv_value[1] = TC->packetLength[1];
398 398 TM.pkt_datafieldsize_cnt[0] = currentTC_LEN_RCV[0];
399 399 TM.pkt_datafieldsize_cnt[1] = currentTC_LEN_RCV[1];
400 400 TM.rcv_crc[0] = packetDataField[ packetLength - 1 ];
401 401 TM.rcv_crc[1] = packetDataField[ packetLength ];
402 402 TM.computed_crc[0] = computed_CRC[0];
403 403 TM.computed_crc[1] = computed_CRC[1];
404 404
405 405 messageSize = PACKET_LENGTH_TC_EXE_CORRUPTED + CCSDS_TC_TM_PACKET_OFFSET + CCSDS_PROTOCOLE_EXTRA_BYTES;
406 406
407 407 // SEND DATA
408 408 status = rtems_message_queue_send( queue_id, &TM, messageSize);
409 409 if (status != RTEMS_SUCCESSFUL) {
410 410 PRINTF("in send_tm_lfr_tc_exe_error *** ERR\n")
411 411 }
412 412
413 413 return status;
414 414 }
415 415
416 416 void increment_seq_counter_destination_id( unsigned char *packet_sequence_control, unsigned char destination_id )
417 417 {
418 418 unsigned short sequence_cnt;
419 419 unsigned short segmentation_grouping_flag;
420 420 unsigned short new_packet_sequence_control;
421 421 unsigned char i;
422 422
423 423 switch (destination_id)
424 424 {
425 425 case SID_TC_GROUND:
426 426 i = GROUND;
427 427 break;
428 428 case SID_TC_MISSION_TIMELINE:
429 429 i = MISSION_TIMELINE;
430 430 break;
431 431 case SID_TC_TC_SEQUENCES:
432 432 i = TC_SEQUENCES;
433 433 break;
434 434 case SID_TC_RECOVERY_ACTION_CMD:
435 435 i = RECOVERY_ACTION_CMD;
436 436 break;
437 437 case SID_TC_BACKUP_MISSION_TIMELINE:
438 438 i = BACKUP_MISSION_TIMELINE;
439 439 break;
440 440 case SID_TC_DIRECT_CMD:
441 441 i = DIRECT_CMD;
442 442 break;
443 443 case SID_TC_SPARE_GRD_SRC1:
444 444 i = SPARE_GRD_SRC1;
445 445 break;
446 446 case SID_TC_SPARE_GRD_SRC2:
447 447 i = SPARE_GRD_SRC2;
448 448 break;
449 449 case SID_TC_OBCP:
450 450 i = OBCP;
451 451 break;
452 452 case SID_TC_SYSTEM_CONTROL:
453 453 i = SYSTEM_CONTROL;
454 454 break;
455 455 case SID_TC_AOCS:
456 456 i = AOCS;
457 457 break;
458 458 case SID_TC_RPW_INTERNAL:
459 459 i = RPW_INTERNAL;
460 460 break;
461 461 default:
462 462 i = UNKNOWN;
463 463 break;
464 464 }
465 465
466 466 if (i != UNKNOWN)
467 467 {
468 468 segmentation_grouping_flag = TM_PACKET_SEQ_CTRL_STANDALONE << 8;
469 469 sequence_cnt = sequenceCounters_TC_EXE[ i ] & 0x3fff;
470 470
471 471 new_packet_sequence_control = segmentation_grouping_flag | sequence_cnt ;
472 472
473 473 packet_sequence_control[0] = (unsigned char) (new_packet_sequence_control >> 8);
474 474 packet_sequence_control[1] = (unsigned char) (new_packet_sequence_control );
475 475
476 476 // increment the sequence counter for the next packet
477 477 if ( sequenceCounters_TC_EXE[ i ] < SEQ_CNT_MAX)
478 478 {
479 479 sequenceCounters_TC_EXE[ i ] = sequenceCounters_TC_EXE[ i ] + 1;
480 480 }
481 481 else
482 482 {
483 483 sequenceCounters_TC_EXE[ i ] = 0;
484 484 }
485 485 }
486 486 else
487 487 {
488 488 DEBUG_PRINTF1("in increment_seq_counter_destination_id *** ERR destination ID %d not known\n", destination_id)
489 489 }
490 490
491 491 }
General Comments 0
You need to be logged in to leave comments. Login now