@@ -1,225 +1,225 | |||||
1 | ############################################################################# |
|
1 | ############################################################################# | |
2 | # Makefile for building: bin/fsw |
|
2 | # Makefile for building: bin/fsw$(SW_VERSION) | |
3 |
# Generated by qmake (2.01a) (Qt 4.8.4) on: |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.4) on: Fri Jun 14 07:50:58 2013 | |
4 | # Project: fsw-qt.pro |
|
4 | # Project: fsw-qt.pro | |
5 | # Template: app |
|
5 | # Template: app | |
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
7 | ############################################################################# |
|
7 | ############################################################################# | |
8 |
|
8 | |||
9 | ####### Compiler, tools and options |
|
9 | ####### Compiler, tools and options | |
10 |
|
10 | |||
11 | CC = sparc-rtems-gcc |
|
11 | CC = sparc-rtems-gcc | |
12 | CXX = sparc-rtems-g++ |
|
12 | CXX = sparc-rtems-g++ | |
13 | DEFINES = -DPRINT_MESSAGES_ON_CONSOLE |
|
13 | DEFINES = -DSW_VERSION_N1=0 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=4 -DPRINT_MESSAGES_ON_CONSOLE | |
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
14 | CFLAGS = -pipe -O3 -Wall $(DEFINES) | |
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) |
|
15 | CXXFLAGS = -pipe -O3 -Wall $(DEFINES) | |
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header |
|
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header | |
17 | LINK = sparc-rtems-g++ |
|
17 | LINK = sparc-rtems-g++ | |
18 | LFLAGS = |
|
18 | LFLAGS = | |
19 | LIBS = $(SUBLIBS) |
|
19 | LIBS = $(SUBLIBS) | |
20 | AR = sparc-rtems-ar rcs |
|
20 | AR = sparc-rtems-ar rcs | |
21 | RANLIB = |
|
21 | RANLIB = | |
22 | QMAKE = /usr/bin/qmake-qt4 |
|
22 | QMAKE = /usr/bin/qmake-qt4 | |
23 | TAR = tar -cf |
|
23 | TAR = tar -cf | |
24 | COMPRESS = gzip -9f |
|
24 | COMPRESS = gzip -9f | |
25 | COPY = cp -f |
|
25 | COPY = cp -f | |
26 | SED = sed |
|
26 | SED = sed | |
27 | COPY_FILE = $(COPY) |
|
27 | COPY_FILE = $(COPY) | |
28 | COPY_DIR = $(COPY) -r |
|
28 | COPY_DIR = $(COPY) -r | |
29 | STRIP = sparc-rtems-strip |
|
29 | STRIP = sparc-rtems-strip | |
30 | INSTALL_FILE = install -m 644 -p |
|
30 | INSTALL_FILE = install -m 644 -p | |
31 | INSTALL_DIR = $(COPY_DIR) |
|
31 | INSTALL_DIR = $(COPY_DIR) | |
32 | INSTALL_PROGRAM = install -m 755 -p |
|
32 | INSTALL_PROGRAM = install -m 755 -p | |
33 | DEL_FILE = rm -f |
|
33 | DEL_FILE = rm -f | |
34 | SYMLINK = ln -f -s |
|
34 | SYMLINK = ln -f -s | |
35 | DEL_DIR = rmdir |
|
35 | DEL_DIR = rmdir | |
36 | MOVE = mv -f |
|
36 | MOVE = mv -f | |
37 | CHK_DIR_EXISTS= test -d |
|
37 | CHK_DIR_EXISTS= test -d | |
38 | MKDIR = mkdir -p |
|
38 | MKDIR = mkdir -p | |
39 |
|
39 | |||
40 | ####### Output directory |
|
40 | ####### Output directory | |
41 |
|
41 | |||
42 | OBJECTS_DIR = obj/ |
|
42 | OBJECTS_DIR = obj/ | |
43 |
|
43 | |||
44 | ####### Files |
|
44 | ####### Files | |
45 |
|
45 | |||
46 | SOURCES = ../src/wf_handler.c \ |
|
46 | SOURCES = ../src/wf_handler.c \ | |
47 | ../src/tc_handler.c \ |
|
47 | ../src/tc_handler.c \ | |
48 | ../src/fsw_processing.c \ |
|
48 | ../src/fsw_processing.c \ | |
49 | ../src/fsw_misc.c \ |
|
49 | ../src/fsw_misc.c \ | |
50 | ../src/fsw_init.c \ |
|
50 | ../src/fsw_init.c \ | |
51 | ../src/fsw_globals.c |
|
51 | ../src/fsw_globals.c | |
52 | OBJECTS = obj/wf_handler.o \ |
|
52 | OBJECTS = obj/wf_handler.o \ | |
53 | obj/tc_handler.o \ |
|
53 | obj/tc_handler.o \ | |
54 | obj/fsw_processing.o \ |
|
54 | obj/fsw_processing.o \ | |
55 | obj/fsw_misc.o \ |
|
55 | obj/fsw_misc.o \ | |
56 | obj/fsw_init.o \ |
|
56 | obj/fsw_init.o \ | |
57 | obj/fsw_globals.o |
|
57 | obj/fsw_globals.o | |
58 | DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
58 | DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ | |
59 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
59 | /usr/lib64/qt4/mkspecs/common/linux.conf \ | |
60 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
60 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ | |
61 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ |
|
61 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ | |
62 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ |
|
62 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ | |
63 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ |
|
63 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ | |
64 | /usr/lib64/qt4/mkspecs/qconfig.pri \ |
|
64 | /usr/lib64/qt4/mkspecs/qconfig.pri \ | |
65 |
/usr/lib64/qt4/mkspecs/modules/qt_webkit |
|
65 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ | |
66 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ |
|
66 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ | |
67 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ |
|
67 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ | |
68 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ |
|
68 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ | |
69 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
69 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ | |
70 | sparc.pri \ |
|
70 | sparc.pri \ | |
71 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
71 | /usr/lib64/qt4/mkspecs/features/release.prf \ | |
72 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
72 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ | |
73 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
73 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ | |
74 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
74 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ | |
75 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
75 | /usr/lib64/qt4/mkspecs/features/resources.prf \ | |
76 | /usr/lib64/qt4/mkspecs/features/uic.prf \ |
|
76 | /usr/lib64/qt4/mkspecs/features/uic.prf \ | |
77 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ |
|
77 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ | |
78 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
78 | /usr/lib64/qt4/mkspecs/features/lex.prf \ | |
79 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ |
|
79 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ | |
80 | fsw-qt.pro |
|
80 | fsw-qt.pro | |
81 | QMAKE_TARGET = fsw |
|
81 | QMAKE_TARGET = fsw$(SW_VERSION) | |
82 | DESTDIR = bin/ |
|
82 | DESTDIR = bin/ | |
83 | TARGET = bin/fsw |
|
83 | TARGET = bin/fsw$(SW_VERSION) | |
84 |
|
84 | |||
85 | first: all |
|
85 | first: all | |
86 | ####### Implicit rules |
|
86 | ####### Implicit rules | |
87 |
|
87 | |||
88 | .SUFFIXES: .o .c .cpp .cc .cxx .C |
|
88 | .SUFFIXES: .o .c .cpp .cc .cxx .C | |
89 |
|
89 | |||
90 | .cpp.o: |
|
90 | .cpp.o: | |
91 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
91 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
92 |
|
92 | |||
93 | .cc.o: |
|
93 | .cc.o: | |
94 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
94 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
95 |
|
95 | |||
96 | .cxx.o: |
|
96 | .cxx.o: | |
97 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
97 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
98 |
|
98 | |||
99 | .C.o: |
|
99 | .C.o: | |
100 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
100 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
101 |
|
101 | |||
102 | .c.o: |
|
102 | .c.o: | |
103 | $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" |
|
103 | $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" | |
104 |
|
104 | |||
105 | ####### Build rules |
|
105 | ####### Build rules | |
106 |
|
106 | |||
107 | all: Makefile $(TARGET) |
|
107 | all: Makefile $(TARGET) | |
108 |
|
108 | |||
109 | $(TARGET): $(OBJECTS) |
|
109 | $(TARGET): $(OBJECTS) | |
110 | @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/ |
|
110 | @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/ | |
111 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) |
|
111 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) | |
112 |
|
112 | |||
113 | Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
113 | Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \ | |
114 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
114 | /usr/lib64/qt4/mkspecs/common/linux.conf \ | |
115 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
115 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ | |
116 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ |
|
116 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ | |
117 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ |
|
117 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ | |
118 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ |
|
118 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ | |
119 | /usr/lib64/qt4/mkspecs/qconfig.pri \ |
|
119 | /usr/lib64/qt4/mkspecs/qconfig.pri \ | |
120 |
/usr/lib64/qt4/mkspecs/modules/qt_webkit |
|
120 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ | |
121 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ |
|
121 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ | |
122 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ |
|
122 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ | |
123 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ |
|
123 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ | |
124 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
124 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ | |
125 | sparc.pri \ |
|
125 | sparc.pri \ | |
126 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
126 | /usr/lib64/qt4/mkspecs/features/release.prf \ | |
127 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
127 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ | |
128 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
128 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ | |
129 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
129 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ | |
130 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
130 | /usr/lib64/qt4/mkspecs/features/resources.prf \ | |
131 | /usr/lib64/qt4/mkspecs/features/uic.prf \ |
|
131 | /usr/lib64/qt4/mkspecs/features/uic.prf \ | |
132 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ |
|
132 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ | |
133 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
133 | /usr/lib64/qt4/mkspecs/features/lex.prf \ | |
134 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf |
|
134 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf | |
135 | $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
135 | $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
136 | /usr/lib64/qt4/mkspecs/common/unix.conf: |
|
136 | /usr/lib64/qt4/mkspecs/common/unix.conf: | |
137 | /usr/lib64/qt4/mkspecs/common/linux.conf: |
|
137 | /usr/lib64/qt4/mkspecs/common/linux.conf: | |
138 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: |
|
138 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: | |
139 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf: |
|
139 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf: | |
140 | /usr/lib64/qt4/mkspecs/common/g++-base.conf: |
|
140 | /usr/lib64/qt4/mkspecs/common/g++-base.conf: | |
141 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf: |
|
141 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf: | |
142 | /usr/lib64/qt4/mkspecs/qconfig.pri: |
|
142 | /usr/lib64/qt4/mkspecs/qconfig.pri: | |
143 |
/usr/lib64/qt4/mkspecs/modules/qt_webkit |
|
143 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri: | |
144 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf: |
|
144 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf: | |
145 | /usr/lib64/qt4/mkspecs/features/qt_config.prf: |
|
145 | /usr/lib64/qt4/mkspecs/features/qt_config.prf: | |
146 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf: |
|
146 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf: | |
147 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: |
|
147 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: | |
148 | sparc.pri: |
|
148 | sparc.pri: | |
149 | /usr/lib64/qt4/mkspecs/features/release.prf: |
|
149 | /usr/lib64/qt4/mkspecs/features/release.prf: | |
150 | /usr/lib64/qt4/mkspecs/features/default_post.prf: |
|
150 | /usr/lib64/qt4/mkspecs/features/default_post.prf: | |
151 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: |
|
151 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: | |
152 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: |
|
152 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: | |
153 | /usr/lib64/qt4/mkspecs/features/resources.prf: |
|
153 | /usr/lib64/qt4/mkspecs/features/resources.prf: | |
154 | /usr/lib64/qt4/mkspecs/features/uic.prf: |
|
154 | /usr/lib64/qt4/mkspecs/features/uic.prf: | |
155 | /usr/lib64/qt4/mkspecs/features/yacc.prf: |
|
155 | /usr/lib64/qt4/mkspecs/features/yacc.prf: | |
156 | /usr/lib64/qt4/mkspecs/features/lex.prf: |
|
156 | /usr/lib64/qt4/mkspecs/features/lex.prf: | |
157 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf: |
|
157 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf: | |
158 | qmake: FORCE |
|
158 | qmake: FORCE | |
159 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
159 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
160 |
|
160 | |||
161 | dist: |
|
161 | dist: | |
162 | @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0 |
|
162 | @$(CHK_DIR_EXISTS) obj/fsw$(SW_VERSION)1.0.0 || $(MKDIR) obj/fsw$(SW_VERSION)1.0.0 | |
163 | $(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 |
|
163 | $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/fsw$(SW_VERSION)1.0.0/ && (cd `dirname obj/fsw$(SW_VERSION)1.0.0` && $(TAR) fsw$(SW_VERSION)1.0.0.tar fsw$(SW_VERSION)1.0.0 && $(COMPRESS) fsw$(SW_VERSION)1.0.0.tar) && $(MOVE) `dirname obj/fsw$(SW_VERSION)1.0.0`/fsw$(SW_VERSION)1.0.0.tar.gz . && $(DEL_FILE) -r obj/fsw$(SW_VERSION)1.0.0 | |
164 |
|
164 | |||
165 |
|
165 | |||
166 | clean:compiler_clean |
|
166 | clean:compiler_clean | |
167 | -$(DEL_FILE) $(OBJECTS) |
|
167 | -$(DEL_FILE) $(OBJECTS) | |
168 | -$(DEL_FILE) *~ core *.core |
|
168 | -$(DEL_FILE) *~ core *.core | |
169 |
|
169 | |||
170 |
|
170 | |||
171 | ####### Sub-libraries |
|
171 | ####### Sub-libraries | |
172 |
|
172 | |||
173 | distclean: clean |
|
173 | distclean: clean | |
174 | -$(DEL_FILE) $(TARGET) |
|
174 | -$(DEL_FILE) $(TARGET) | |
175 | -$(DEL_FILE) Makefile |
|
175 | -$(DEL_FILE) Makefile | |
176 |
|
176 | |||
177 |
|
177 | |||
178 | grmon: |
|
178 | grmon: | |
179 | cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u |
|
179 | cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u | |
180 |
|
180 | |||
181 | check: first |
|
181 | check: first | |
182 |
|
182 | |||
183 | compiler_rcc_make_all: |
|
183 | compiler_rcc_make_all: | |
184 | compiler_rcc_clean: |
|
184 | compiler_rcc_clean: | |
185 | compiler_uic_make_all: |
|
185 | compiler_uic_make_all: | |
186 | compiler_uic_clean: |
|
186 | compiler_uic_clean: | |
187 | compiler_image_collection_make_all: qmake_image_collection.cpp |
|
187 | compiler_image_collection_make_all: qmake_image_collection.cpp | |
188 | compiler_image_collection_clean: |
|
188 | compiler_image_collection_clean: | |
189 | -$(DEL_FILE) qmake_image_collection.cpp |
|
189 | -$(DEL_FILE) qmake_image_collection.cpp | |
190 | compiler_yacc_decl_make_all: |
|
190 | compiler_yacc_decl_make_all: | |
191 | compiler_yacc_decl_clean: |
|
191 | compiler_yacc_decl_clean: | |
192 | compiler_yacc_impl_make_all: |
|
192 | compiler_yacc_impl_make_all: | |
193 | compiler_yacc_impl_clean: |
|
193 | compiler_yacc_impl_clean: | |
194 | compiler_lex_make_all: |
|
194 | compiler_lex_make_all: | |
195 | compiler_lex_clean: |
|
195 | compiler_lex_clean: | |
196 | compiler_clean: |
|
196 | compiler_clean: | |
197 |
|
197 | |||
198 | ####### Compile |
|
198 | ####### Compile | |
199 |
|
199 | |||
200 | obj/wf_handler.o: ../src/wf_handler.c |
|
200 | obj/wf_handler.o: ../src/wf_handler.c | |
201 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c |
|
201 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c | |
202 |
|
202 | |||
203 | obj/tc_handler.o: ../src/tc_handler.c |
|
203 | obj/tc_handler.o: ../src/tc_handler.c | |
204 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c |
|
204 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c | |
205 |
|
205 | |||
206 | obj/fsw_processing.o: ../src/fsw_processing.c |
|
206 | obj/fsw_processing.o: ../src/fsw_processing.c | |
207 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c |
|
207 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/fsw_processing.c | |
208 |
|
208 | |||
209 | obj/fsw_misc.o: ../src/fsw_misc.c |
|
209 | obj/fsw_misc.o: ../src/fsw_misc.c | |
210 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c |
|
210 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c | |
211 |
|
211 | |||
212 | obj/fsw_init.o: ../src/fsw_init.c |
|
212 | obj/fsw_init.o: ../src/fsw_init.c | |
213 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c |
|
213 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c | |
214 |
|
214 | |||
215 | obj/fsw_globals.o: ../src/fsw_globals.c |
|
215 | obj/fsw_globals.o: ../src/fsw_globals.c | |
216 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c |
|
216 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c | |
217 |
|
217 | |||
218 | ####### Install |
|
218 | ####### Install | |
219 |
|
219 | |||
220 | install: FORCE |
|
220 | install: FORCE | |
221 |
|
221 | |||
222 | uninstall: FORCE |
|
222 | uninstall: FORCE | |
223 |
|
223 | |||
224 | FORCE: |
|
224 | FORCE: | |
225 |
|
225 |
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -1,44 +1,51 | |||||
1 | TEMPLATE = app |
|
1 | TEMPLATE = app | |
2 | # CONFIG += console v8 sim |
|
2 | # CONFIG += console v8 sim | |
3 | # CONFIG options = verbose *** cpu_usage_report *** gsa |
|
3 | # CONFIG options = verbose *** cpu_usage_report *** gsa | |
4 | CONFIG += console verbose |
|
4 | CONFIG += console verbose | |
5 | CONFIG -= qt |
|
5 | CONFIG -= qt | |
6 |
|
6 | |||
7 | include(./sparc.pri) |
|
7 | include(./sparc.pri) | |
8 |
|
8 | |||
|
9 | # flight software version | |||
|
10 | SW_VERSION=-0-5 | |||
|
11 | DEFINES += SW_VERSION_N1=0 | |||
|
12 | DEFINES += SW_VERSION_N2=0 | |||
|
13 | DEFINES += SW_VERSION_N3=0 | |||
|
14 | DEFINES += SW_VERSION_N4=5 | |||
|
15 | ||||
9 | contains( CONFIG, verbose ) { |
|
16 | contains( CONFIG, verbose ) { | |
10 | DEFINES += PRINT_MESSAGES_ON_CONSOLE |
|
17 | DEFINES += PRINT_MESSAGES_ON_CONSOLE | |
11 | } |
|
18 | } | |
12 |
|
19 | |||
13 | contains( CONFIG, cpu_usage_report ) { |
|
20 | contains( CONFIG, cpu_usage_report ) { | |
14 | DEFINES += PRINT_TASK_STATISTICS |
|
21 | DEFINES += PRINT_TASK_STATISTICS | |
15 | } |
|
22 | } | |
16 |
|
23 | |||
17 | TARGET = fsw |
|
24 | TARGET = fsw$(SW_VERSION) | |
18 | contains( CONFIG, gsa ) { |
|
25 | contains( CONFIG, gsa ) { | |
19 | DEFINES += GSA |
|
26 | DEFINES += GSA | |
20 | TARGET = fsw-gsa |
|
27 | TARGET = fsw-gsa$(SW_VERSION) | |
21 | } |
|
28 | } | |
22 |
|
29 | |||
23 | INCLUDEPATH += \ |
|
30 | INCLUDEPATH += \ | |
24 | ../src \ |
|
31 | ../src \ | |
25 | ../header |
|
32 | ../header | |
26 |
|
33 | |||
27 | SOURCES += \ |
|
34 | SOURCES += \ | |
28 | ../src/wf_handler.c \ |
|
35 | ../src/wf_handler.c \ | |
29 | ../src/tc_handler.c \ |
|
36 | ../src/tc_handler.c \ | |
30 | ../src/fsw_processing.c \ |
|
37 | ../src/fsw_processing.c \ | |
31 | ../src/fsw_misc.c \ |
|
38 | ../src/fsw_misc.c \ | |
32 | ../src/fsw_init.c \ |
|
39 | ../src/fsw_init.c \ | |
33 | ../src/fsw_globals.c |
|
40 | ../src/fsw_globals.c | |
34 |
|
41 | |||
35 | HEADERS += \ |
|
42 | HEADERS += \ | |
36 | ../header/wf_handler.h \ |
|
43 | ../header/wf_handler.h \ | |
37 | ../header/tc_handler.h \ |
|
44 | ../header/tc_handler.h \ | |
38 | ../header/grlib_regs.h \ |
|
45 | ../header/grlib_regs.h \ | |
39 | ../header/fsw_processing.h \ |
|
46 | ../header/fsw_processing.h \ | |
40 | ../header/fsw_params.h \ |
|
47 | ../header/fsw_params.h \ | |
41 | ../header/fsw_misc.h \ |
|
48 | ../header/fsw_misc.h \ | |
42 | ../header/fsw_init.h \ |
|
49 | ../header/fsw_init.h \ | |
43 | ../header/ccsds_types.h |
|
50 | ../header/ccsds_types.h | |
44 |
|
51 |
@@ -1,265 +1,265 | |||||
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 Qt Creator 2.4.1, 2013-06- |
|
3 | <!-- Written by Qt Creator 2.4.1, 2013-06-17T15:56:28. --> | |
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 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> |
|
14 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0"> | |
15 | <value type="QString" key="language">Cpp</value> |
|
15 | <value type="QString" key="language">Cpp</value> | |
16 | <valuemap type="QVariantMap" key="value"> |
|
16 | <valuemap type="QVariantMap" key="value"> | |
17 | <value type="QString" key="CurrentPreferences">CppGlobal</value> |
|
17 | <value type="QString" key="CurrentPreferences">CppGlobal</value> | |
18 | </valuemap> |
|
18 | </valuemap> | |
19 | </valuemap> |
|
19 | </valuemap> | |
20 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> |
|
20 | <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1"> | |
21 | <value type="QString" key="language">QmlJS</value> |
|
21 | <value type="QString" key="language">QmlJS</value> | |
22 | <valuemap type="QVariantMap" key="value"> |
|
22 | <valuemap type="QVariantMap" key="value"> | |
23 | <value type="QString" key="CurrentPreferences">QmlJSGlobal</value> |
|
23 | <value type="QString" key="CurrentPreferences">QmlJSGlobal</value> | |
24 | </valuemap> |
|
24 | </valuemap> | |
25 | </valuemap> |
|
25 | </valuemap> | |
26 | <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value> |
|
26 | <value type="int" key="EditorConfiguration.CodeStyle.Count">2</value> | |
27 | <value type="QByteArray" key="EditorConfiguration.Codec">System</value> |
|
27 | <value type="QByteArray" key="EditorConfiguration.Codec">System</value> | |
28 | <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> |
|
28 | <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value> | |
29 | <value type="int" key="EditorConfiguration.IndentSize">4</value> |
|
29 | <value type="int" key="EditorConfiguration.IndentSize">4</value> | |
30 | <value type="bool" key="EditorConfiguration.MouseNavigation">true</value> |
|
30 | <value type="bool" key="EditorConfiguration.MouseNavigation">true</value> | |
31 | <value type="int" key="EditorConfiguration.PaddingMode">1</value> |
|
31 | <value type="int" key="EditorConfiguration.PaddingMode">1</value> | |
32 | <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> |
|
32 | <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value> | |
33 | <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> |
|
33 | <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value> | |
34 | <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> |
|
34 | <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value> | |
35 | <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> |
|
35 | <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value> | |
36 | <value type="int" key="EditorConfiguration.TabSize">8</value> |
|
36 | <value type="int" key="EditorConfiguration.TabSize">8</value> | |
37 | <value type="bool" key="EditorConfiguration.UseGlobal">true</value> |
|
37 | <value type="bool" key="EditorConfiguration.UseGlobal">true</value> | |
38 | <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> |
|
38 | <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value> | |
39 | <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> |
|
39 | <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value> | |
40 | <value type="bool" key="EditorConfiguration.cleanIndentation">true</value> |
|
40 | <value type="bool" key="EditorConfiguration.cleanIndentation">true</value> | |
41 | <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> |
|
41 | <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value> | |
42 | <value type="bool" key="EditorConfiguration.inEntireDocument">false</value> |
|
42 | <value type="bool" key="EditorConfiguration.inEntireDocument">false</value> | |
43 | </valuemap> |
|
43 | </valuemap> | |
44 | </data> |
|
44 | </data> | |
45 | <data> |
|
45 | <data> | |
46 | <variable>ProjectExplorer.Project.PluginSettings</variable> |
|
46 | <variable>ProjectExplorer.Project.PluginSettings</variable> | |
47 | <valuemap type="QVariantMap"/> |
|
47 | <valuemap type="QVariantMap"/> | |
48 | </data> |
|
48 | </data> | |
49 | <data> |
|
49 | <data> | |
50 | <variable>ProjectExplorer.Project.Target.0</variable> |
|
50 | <variable>ProjectExplorer.Project.Target.0</variable> | |
51 | <valuemap type="QVariantMap"> |
|
51 | <valuemap type="QVariantMap"> | |
52 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value> |
|
52 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value> | |
53 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value> |
|
53 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value> | |
54 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value> |
|
54 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Target.DesktopTarget</value> | |
55 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> |
|
55 | <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> | |
56 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> |
|
56 | <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> | |
57 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> |
|
57 | <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> | |
58 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> |
|
58 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> | |
59 | <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value> |
|
59 | <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value> | |
60 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
60 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
61 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
61 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
62 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|
62 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> | |
63 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
63 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
64 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|
64 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> | |
65 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|
65 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> | |
66 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value> |
|
66 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value> | |
67 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|
67 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> | |
68 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|
68 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> | |
69 | </valuemap> |
|
69 | </valuemap> | |
70 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|
70 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> | |
71 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
71 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
72 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
72 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
73 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
73 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
74 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|
74 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> | |
75 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|
75 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> | |
76 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
76 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
77 | </valuemap> |
|
77 | </valuemap> | |
78 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|
78 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> | |
79 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|
79 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> | |
80 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
80 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
81 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|
81 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> | |
82 | </valuemap> |
|
82 | </valuemap> | |
83 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|
83 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> | |
84 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
84 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
85 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
85 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
86 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
86 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
87 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
87 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
88 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|
88 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> | |
89 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|
89 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> | |
90 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
90 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
91 | </valuemap> |
|
91 | </valuemap> | |
92 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|
92 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> | |
93 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|
93 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> | |
94 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
94 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
95 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|
95 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> | |
96 | </valuemap> |
|
96 | </valuemap> | |
97 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|
97 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> | |
98 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|
98 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> | |
99 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|
99 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> | |
100 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value> |
|
100 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Release</value> | |
101 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
101 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
102 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|
102 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> | |
103 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> |
|
103 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> | |
104 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> |
|
104 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> | |
105 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value> |
|
105 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value> | |
106 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value> |
|
106 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value> | |
107 | </valuemap> |
|
107 | </valuemap> | |
108 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> |
|
108 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> | |
109 | <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value> |
|
109 | <value type="QString" key="ProjectExplorer.BuildCOnfiguration.ToolChain">ProjectExplorer.ToolChain.Gcc:/usr/bin/g++.x86-linux-generic-elf-64bit./usr/bin/gdb</value> | |
110 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
110 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
111 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
111 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
112 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> |
|
112 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value> | |
113 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
113 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
114 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> |
|
114 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value> | |
115 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> |
|
115 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value> | |
116 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value> |
|
116 | <value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value> | |
117 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> |
|
117 | <value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value> | |
118 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> |
|
118 | <value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value> | |
119 | </valuemap> |
|
119 | </valuemap> | |
120 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> |
|
120 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1"> | |
121 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
121 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
122 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
122 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
123 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
123 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
124 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> |
|
124 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value> | |
125 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> |
|
125 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value> | |
126 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
126 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
127 | </valuemap> |
|
127 | </valuemap> | |
128 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> |
|
128 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> | |
129 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> |
|
129 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value> | |
130 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
130 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
131 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> |
|
131 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> | |
132 | </valuemap> |
|
132 | </valuemap> | |
133 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> |
|
133 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1"> | |
134 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> |
|
134 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> | |
135 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> |
|
135 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value> | |
136 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
136 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
137 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> |
|
137 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value> | |
138 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> |
|
138 | <value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value> | |
139 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> |
|
139 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value> | |
140 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> |
|
140 | <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> | |
141 | </valuemap> |
|
141 | </valuemap> | |
142 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> |
|
142 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> | |
143 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> |
|
143 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value> | |
144 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
144 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
145 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> |
|
145 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> | |
146 | </valuemap> |
|
146 | </valuemap> | |
147 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> |
|
147 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value> | |
148 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> |
|
148 | <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> | |
149 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> |
|
149 | <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> | |
150 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value> |
|
150 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 4.8.2 in PATH (System) Debug</value> | |
151 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
151 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
152 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> |
|
152 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> | |
153 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> |
|
153 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> | |
154 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> |
|
154 | <value type="QString" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory">/opt/DEV_PLE/FSW-qt</value> | |
155 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value> |
|
155 | <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId">1</value> | |
156 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value> |
|
156 | <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">false</value> | |
157 | </valuemap> |
|
157 | </valuemap> | |
158 | <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value> |
|
158 | <value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value> | |
159 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> |
|
159 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0"> | |
160 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> |
|
160 | <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> | |
161 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> |
|
161 | <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value> | |
162 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> |
|
162 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value> | |
163 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
163 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
164 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> |
|
164 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> | |
165 | </valuemap> |
|
165 | </valuemap> | |
166 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> |
|
166 | <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> | |
167 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value> |
|
167 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">No deployment</value> | |
168 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
168 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
169 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> |
|
169 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> | |
170 | </valuemap> |
|
170 | </valuemap> | |
171 | <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> |
|
171 | <value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value> | |
172 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> |
|
172 | <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0"> | |
173 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> |
|
173 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> | |
174 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> |
|
174 | <value type="bool" key="Analyzer.Project.UseGlobal">true</value> | |
175 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|
175 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> | |
176 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> |
|
176 | <valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/> | |
177 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|
177 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> | |
178 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> |
|
178 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value> | |
179 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|
179 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> | |
180 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> |
|
180 | <value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value> | |
181 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|
181 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> | |
182 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> |
|
182 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value> | |
183 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|
183 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> | |
184 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> |
|
184 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value> | |
185 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|
185 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> | |
186 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> |
|
186 | <value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value> | |
187 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|
187 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> | |
188 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> |
|
188 | <value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value> | |
189 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|
189 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> | |
190 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> |
|
190 | <value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value> | |
191 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|
191 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> | |
192 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> |
|
192 | <value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value> | |
193 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|
193 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> | |
194 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> |
|
194 | <value type="int" key="Analyzer.Valgrind.NumCallers">25</value> | |
195 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|
195 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> | |
196 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> |
|
196 | <valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/> | |
197 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|
197 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> | |
198 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> |
|
198 | <value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value> | |
199 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|
199 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> | |
200 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> |
|
200 | <value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value> | |
201 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|
201 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> | |
202 | <value type="int">0</value> |
|
202 | <value type="int">0</value> | |
203 | <value type="int">1</value> |
|
203 | <value type="int">1</value> | |
204 | <value type="int">2</value> |
|
204 | <value type="int">2</value> | |
205 | <value type="int">3</value> |
|
205 | <value type="int">3</value> | |
206 | <value type="int">4</value> |
|
206 | <value type="int">4</value> | |
207 | <value type="int">5</value> |
|
207 | <value type="int">5</value> | |
208 | <value type="int">6</value> |
|
208 | <value type="int">6</value> | |
209 | <value type="int">7</value> |
|
209 | <value type="int">7</value> | |
210 | <value type="int">8</value> |
|
210 | <value type="int">8</value> | |
211 | <value type="int">9</value> |
|
211 | <value type="int">9</value> | |
212 | <value type="int">10</value> |
|
212 | <value type="int">10</value> | |
213 | <value type="int">11</value> |
|
213 | <value type="int">11</value> | |
214 | <value type="int">12</value> |
|
214 | <value type="int">12</value> | |
215 | <value type="int">13</value> |
|
215 | <value type="int">13</value> | |
216 | <value type="int">14</value> |
|
216 | <value type="int">14</value> | |
217 | </valuelist> |
|
217 | </valuelist> | |
218 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> |
|
218 | <valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds"> | |
219 | <value type="int">0</value> |
|
219 | <value type="int">0</value> | |
220 | <value type="int">1</value> |
|
220 | <value type="int">1</value> | |
221 | <value type="int">2</value> |
|
221 | <value type="int">2</value> | |
222 | <value type="int">3</value> |
|
222 | <value type="int">3</value> | |
223 | <value type="int">4</value> |
|
223 | <value type="int">4</value> | |
224 | <value type="int">5</value> |
|
224 | <value type="int">5</value> | |
225 | <value type="int">6</value> |
|
225 | <value type="int">6</value> | |
226 | <value type="int">7</value> |
|
226 | <value type="int">7</value> | |
227 | <value type="int">8</value> |
|
227 | <value type="int">8</value> | |
228 | <value type="int">9</value> |
|
228 | <value type="int">9</value> | |
229 | <value type="int">10</value> |
|
229 | <value type="int">10</value> | |
230 | <value type="int">11</value> |
|
230 | <value type="int">11</value> | |
231 | <value type="int">12</value> |
|
231 | <value type="int">12</value> | |
232 | <value type="int">13</value> |
|
232 | <value type="int">13</value> | |
233 | <value type="int">14</value> |
|
233 | <value type="int">14</value> | |
234 | </valuelist> |
|
234 | </valuelist> | |
235 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value> |
|
235 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">fsw-qt</value> | |
236 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> |
|
236 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> | |
237 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration</value> |
|
237 | <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration</value> | |
238 | <value type="int" key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase">2</value> |
|
238 | <value type="int" key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase">2</value> | |
239 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> |
|
239 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> | |
240 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value> |
|
240 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">fsw-qt.pro</value> | |
241 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> |
|
241 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> | |
242 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value> |
|
242 | <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">true</value> | |
243 | <valuelist type="QVariantList" key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges"/> |
|
243 | <valuelist type="QVariantList" key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges"/> | |
244 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> |
|
244 | <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> | |
245 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> |
|
245 | <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> | |
246 | <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> |
|
246 | <value type="bool" key="RunConfiguration.UseCppDebugger">true</value> | |
247 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> |
|
247 | <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> | |
248 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value> |
|
248 | <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value> | |
249 | </valuemap> |
|
249 | </valuemap> | |
250 | <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> |
|
250 | <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> | |
251 | </valuemap> |
|
251 | </valuemap> | |
252 | </data> |
|
252 | </data> | |
253 | <data> |
|
253 | <data> | |
254 | <variable>ProjectExplorer.Project.TargetCount</variable> |
|
254 | <variable>ProjectExplorer.Project.TargetCount</variable> | |
255 | <value type="int">1</value> |
|
255 | <value type="int">1</value> | |
256 | </data> |
|
256 | </data> | |
257 | <data> |
|
257 | <data> | |
258 | <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> |
|
258 | <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable> | |
259 | <value type="QString">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value> |
|
259 | <value type="QString">{2e58a81f-9962-4bba-ae6b-760177f0656c}</value> | |
260 | </data> |
|
260 | </data> | |
261 | <data> |
|
261 | <data> | |
262 | <variable>ProjectExplorer.Project.Updater.FileVersion</variable> |
|
262 | <variable>ProjectExplorer.Project.Updater.FileVersion</variable> | |
263 | <value type="int">10</value> |
|
263 | <value type="int">10</value> | |
264 | </data> |
|
264 | </data> | |
265 | </qtcreator> |
|
265 | </qtcreator> |
@@ -1,307 +1,308 | |||||
1 | #ifndef CCSDS_H_INCLUDED |
|
1 | #ifndef CCSDS_H_INCLUDED | |
2 | #define CCSDS_H_INCLUDED |
|
2 | #define CCSDS_H_INCLUDED | |
3 |
|
3 | |||
4 | #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4 |
|
4 | #define CCSDS_TELEMETRY_HEADER_LENGTH 16+4 | |
5 | #define CCSDS_TM_PKT_MAX_SIZE 4412 |
|
5 | #define CCSDS_TM_PKT_MAX_SIZE 4412 | |
6 | #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4 |
|
6 | #define CCSDS_TELECOMMAND_HEADER_LENGTH 10+4 | |
7 | #define CCSDS_TC_PKT_MAX_SIZE 256 |
|
7 | #define CCSDS_TC_PKT_MAX_SIZE 256 | |
8 | #define CCSDS_TC_PKT_MIN_SIZE 16 |
|
8 | #define CCSDS_TC_PKT_MIN_SIZE 16 | |
9 | #define CCSDS_TC_TM_PACKET_OFFSET 7 |
|
9 | #define CCSDS_TC_TM_PACKET_OFFSET 7 | |
10 | #define CCSDS_PROCESS_ID 76 |
|
10 | #define CCSDS_PROCESS_ID 76 | |
11 | #define CCSDS_PACKET_CATEGORY 12 |
|
11 | #define CCSDS_PACKET_CATEGORY 12 | |
12 | #define CCSDS_NODE_ADDRESS 0xfe |
|
12 | #define CCSDS_NODE_ADDRESS 0xfe | |
13 | // |
|
13 | // | |
14 | #define CCSDS_DESTINATION_ID_GROUND 0x00 |
|
14 | #define CCSDS_DESTINATION_ID_GROUND 0x00 | |
15 | #define CCSDS_DESTINATION_ID 0x01 |
|
15 | #define CCSDS_DESTINATION_ID 0x01 | |
16 | #define CCSDS_DESTINATION_ID_DPU 0x01 |
|
16 | #define CCSDS_DESTINATION_ID_DPU 0x01 | |
17 | // |
|
17 | // | |
18 | #define CCSDS_PROTOCOLE_ID 0x02 |
|
18 | #define CCSDS_PROTOCOLE_ID 0x02 | |
19 | #define CCSDS_USER_APP 0x00 |
|
19 | #define CCSDS_USER_APP 0x00 | |
20 |
|
20 | |||
21 | #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24 |
|
21 | #define SIZE_TM_LFR_TC_EXE_NOT_IMPLEMENTED 24 | |
22 | #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32 |
|
22 | #define SIZE_TM_LFR_TC_EXE_CORRUPTED 32 | |
|
23 | #define SIZE_HK_PARAMETERS 112 | |||
23 |
|
24 | |||
24 | #define ILLEGAL_APID 0 |
|
25 | #define ILLEGAL_APID 0 | |
25 | #define WRONG_LEN_PACKET 1 |
|
26 | #define WRONG_LEN_PACKET 1 | |
26 | #define INCOR_CHECKSUM 2 |
|
27 | #define INCOR_CHECKSUM 2 | |
27 | #define ILL_TYPE 3 |
|
28 | #define ILL_TYPE 3 | |
28 | #define ILL_SUBTYPE 4 |
|
29 | #define ILL_SUBTYPE 4 | |
29 | #define WRONG_APP_DATA 5 |
|
30 | #define WRONG_APP_DATA 5 | |
30 | #define WRONG_CMD_CODE 6 |
|
31 | #define WRONG_CMD_CODE 6 | |
31 | #define CCSDS_TM_VALID 7 |
|
32 | #define CCSDS_TM_VALID 7 | |
32 |
|
33 | |||
33 | // TC TYPES |
|
34 | // TC TYPES | |
34 | #define TC_TYPE_GEN 181 |
|
35 | #define TC_TYPE_GEN 181 | |
35 | #define TC_TYPE_TIME 9 |
|
36 | #define TC_TYPE_TIME 9 | |
36 |
|
37 | |||
37 | // TC SUBTYPES |
|
38 | // TC SUBTYPES | |
38 | #define TC_SUBTYPE_RESET 1 |
|
39 | #define TC_SUBTYPE_RESET 1 | |
39 | #define TC_SUBTYPE_LOAD_COMM 11 |
|
40 | #define TC_SUBTYPE_LOAD_COMM 11 | |
40 | #define TC_SUBTYPE_LOAD_NORM 13 |
|
41 | #define TC_SUBTYPE_LOAD_NORM 13 | |
41 | #define TC_SUBTYPE_LOAD_BURST 19 |
|
42 | #define TC_SUBTYPE_LOAD_BURST 19 | |
42 | #define TC_SUBTYPE_LOAD_SBM1 25 |
|
43 | #define TC_SUBTYPE_LOAD_SBM1 25 | |
43 | #define TC_SUBTYPE_LOAD_SBM2 27 |
|
44 | #define TC_SUBTYPE_LOAD_SBM2 27 | |
44 | #define TC_SUBTYPE_DUMP 31 |
|
45 | #define TC_SUBTYPE_DUMP 31 | |
45 | #define TC_SUBTYPE_ENTER 41 |
|
46 | #define TC_SUBTYPE_ENTER 41 | |
46 | #define TC_SUBTYPE_UPDT_INFO 51 |
|
47 | #define TC_SUBTYPE_UPDT_INFO 51 | |
47 | #define TC_SUBTYPE_EN_CAL 61 |
|
48 | #define TC_SUBTYPE_EN_CAL 61 | |
48 | #define TC_SUBTYPE_DIS_CAL 63 |
|
49 | #define TC_SUBTYPE_DIS_CAL 63 | |
49 | #define TC_SUBTYPE_UPDT_TIME 129 |
|
50 | #define TC_SUBTYPE_UPDT_TIME 129 | |
50 |
|
51 | |||
51 | // TC LEN |
|
52 | // TC LEN | |
52 | #define TC_LEN_RESET 12 |
|
53 | #define TC_LEN_RESET 12 | |
53 | #define TC_LEN_LOAD_COMM 14 |
|
54 | #define TC_LEN_LOAD_COMM 14 | |
54 | #define TC_LEN_LOAD_NORM 20 |
|
55 | #define TC_LEN_LOAD_NORM 20 | |
55 | #define TC_LEN_LOAD_BURST 14 |
|
56 | #define TC_LEN_LOAD_BURST 14 | |
56 | #define TC_LEN_LOAD_SBM1 14 |
|
57 | #define TC_LEN_LOAD_SBM1 14 | |
57 | #define TC_LEN_LOAD_SBM2 14 |
|
58 | #define TC_LEN_LOAD_SBM2 14 | |
58 | #define TC_LEN_DUMP 12 |
|
59 | #define TC_LEN_DUMP 12 | |
59 | #define TC_LEN_ENTER 20 |
|
60 | #define TC_LEN_ENTER 20 | |
60 | #define TC_LEN_UPDT_INFO 48 |
|
61 | #define TC_LEN_UPDT_INFO 48 | |
61 | #define TC_LEN_EN_CAL 12 |
|
62 | #define TC_LEN_EN_CAL 12 | |
62 | #define TC_LEN_DIS_CAL 12 |
|
63 | #define TC_LEN_DIS_CAL 12 | |
63 | #define TC_LEN_UPDT_TIME 18 |
|
64 | #define TC_LEN_UPDT_TIME 18 | |
64 |
|
65 | |||
65 | // TM TYPES |
|
66 | // TM TYPES | |
66 | #define TM_TYPE_LFR_SCIENCE 21 |
|
67 | #define TM_TYPE_LFR_SCIENCE 21 | |
|
68 | #define TM_TYPE_HK 3 | |||
67 |
|
69 | |||
68 | // TM SUBTYPES |
|
70 | // TM SUBTYPES | |
69 | #define TM_SUBTYPE_EXE_OK 7 |
|
71 | #define TM_SUBTYPE_EXE_OK 7 | |
70 | #define TM_SUBTYPE_EXE_NOK 8 |
|
72 | #define TM_SUBTYPE_EXE_NOK 8 | |
71 | #define TM_SUBTYPE_HK 25 |
|
73 | #define TM_SUBTYPE_HK 25 | |
72 | #define TM_SUBTYPE_SCIENCE 3 |
|
74 | #define TM_SUBTYPE_SCIENCE 3 | |
73 | #define TM_SUBTYPE_LFR_SCIENCE 3 |
|
75 | #define TM_SUBTYPE_LFR_SCIENCE 3 | |
74 |
|
76 | |||
|
77 | // TM SID | |||
75 | #define SID_DEFAULT 0 |
|
78 | #define SID_DEFAULT 0 | |
76 | #define SID_HK 1 |
|
79 | #define SID_HK 1 | |
77 | #define SID_EXE_INC 5 |
|
80 | #define SID_EXE_INC 5 | |
78 | #define SID_NOT_EXE 40000 |
|
81 | #define SID_NOT_EXE 40000 | |
79 | #define SID_NOT_IMP 40002 |
|
82 | #define SID_NOT_IMP 40002 | |
80 | #define SID_EXE_ERR 40003 |
|
83 | #define SID_EXE_ERR 40003 | |
81 | #define SID_EXE_CORR 40005 |
|
84 | #define SID_EXE_CORR 40005 | |
82 |
|
85 | |||
83 | #define SID_NORM_SWF_F0 3 |
|
86 | #define SID_NORM_SWF_F0 3 | |
84 | #define SID_NORM_SWF_F1 4 |
|
87 | #define SID_NORM_SWF_F1 4 | |
85 | #define SID_NORM_SWF_F2 5 |
|
88 | #define SID_NORM_SWF_F2 5 | |
86 | #define SID_NORM_CWF_F3 1 |
|
89 | #define SID_NORM_CWF_F3 1 | |
87 | #define SID_BURST_CWF_F2 2 |
|
90 | #define SID_BURST_CWF_F2 2 | |
88 | #define SID_SBM1_CWF_F1 24 |
|
91 | #define SID_SBM1_CWF_F1 24 | |
89 | #define SID_SBM2_CWF_F2 25 |
|
92 | #define SID_SBM2_CWF_F2 25 | |
90 | #define SID_NORM_ASM_F0 11 |
|
93 | #define SID_NORM_ASM_F0 11 | |
91 | #define SID_NORM_ASM_F1 12 |
|
94 | #define SID_NORM_ASM_F1 12 | |
92 | #define SID_NORM_ASM_F2 13 |
|
95 | #define SID_NORM_ASM_F2 13 | |
93 | #define SID_NORM_BP1_F0 14 |
|
96 | #define SID_NORM_BP1_F0 14 | |
94 | #define SID_NORM_BP1_F1 15 |
|
97 | #define SID_NORM_BP1_F1 15 | |
95 | #define SID_NORM_BP1_F2 16 |
|
98 | #define SID_NORM_BP1_F2 16 | |
96 | #define SID_NORM_BP2_F0 19 |
|
99 | #define SID_NORM_BP2_F0 19 | |
97 | #define SID_NORM_BP2_F1 20 |
|
100 | #define SID_NORM_BP2_F1 20 | |
98 | #define SID_NORM_BP2_F2 21 |
|
101 | #define SID_NORM_BP2_F2 21 | |
99 | #define SID_BURST_BP1_F0 17 |
|
102 | #define SID_BURST_BP1_F0 17 | |
100 | #define SID_BURST_BP2_F0 22 |
|
103 | #define SID_BURST_BP2_F0 22 | |
101 | #define SID_BURST_BP1_F1 18 |
|
104 | #define SID_BURST_BP1_F1 18 | |
102 | #define SID_BURST_BP2_F1 23 |
|
105 | #define SID_BURST_BP2_F1 23 | |
103 | #define SID_SBM1_BP1_F0 28 |
|
106 | #define SID_SBM1_BP1_F0 28 | |
104 | #define SID_SBM1_BP2_F0 31 |
|
107 | #define SID_SBM1_BP2_F0 31 | |
105 | #define SID_SBM2_BP1_F0 29 |
|
108 | #define SID_SBM2_BP1_F0 29 | |
106 | #define SID_SBM2_BP2_F0 32 |
|
109 | #define SID_SBM2_BP2_F0 32 | |
107 | #define SID_SBM1_BP1_F1 30 |
|
110 | #define SID_SBM1_BP1_F1 30 | |
108 | #define SID_SBM1_BP2_F1 33 |
|
111 | #define SID_SBM1_BP2_F1 33 | |
109 |
|
112 | |||
110 | // LENGTH (BYTES) |
|
113 | // LENGTH (BYTES) | |
111 | #define LENGTH_TM_LFR_HK 126 |
|
114 | #define LENGTH_TM_LFR_HK 126 | |
112 | #define LENGTH_TM_LFR_TC_EXE_MAX 32 |
|
115 | #define LENGTH_TM_LFR_TC_EXE_MAX 32 | |
113 | #define LENGTH_TM_LFR_SCIENCE_NORMAL_WF_MAX 4102 |
|
116 | #define LENGTH_TM_LFR_SCIENCE_NORMAL_WF_MAX 4102 | |
114 | // |
|
117 | // | |
115 | #define TM_LEN_EXE 20 - CCSDS_TC_TM_PACKET_OFFSET |
|
118 | #define TM_LEN_EXE 20 - CCSDS_TC_TM_PACKET_OFFSET | |
116 | #define TM_LEN_NOT_EXE 26 - CCSDS_TC_TM_PACKET_OFFSET |
|
119 | #define TM_LEN_NOT_EXE 26 - CCSDS_TC_TM_PACKET_OFFSET | |
117 | #define TM_LEN_NOT_IMP 24 - CCSDS_TC_TM_PACKET_OFFSET |
|
120 | #define TM_LEN_NOT_IMP 24 - CCSDS_TC_TM_PACKET_OFFSET | |
118 | #define TM_LEN_EXE_ERR 24 - CCSDS_TC_TM_PACKET_OFFSET |
|
121 | #define TM_LEN_EXE_ERR 24 - CCSDS_TC_TM_PACKET_OFFSET | |
119 | #define TM_LEN_EXE_CORR 32 - CCSDS_TC_TM_PACKET_OFFSET |
|
122 | #define TM_LEN_EXE_CORR 32 - CCSDS_TC_TM_PACKET_OFFSET | |
120 | #define TM_HEADER_LEN 16 |
|
123 | #define TM_HEADER_LEN 16 | |
121 |
|
124 | |||
122 | #define LEN_TM_LFR_HK 126 + 4 |
|
125 | #define LEN_TM_LFR_HK 126 + 4 | |
123 | #define LEN_TM_LFR_TC_EXE_NOT_IMP 24 +4 |
|
126 | #define LEN_TM_LFR_TC_EXE_NOT_IMP 24 +4 | |
124 |
|
127 | |||
125 | #define TM_LEN_SCI_NORM_SWF_340 340 * 12 + 6 + 10 - 1 |
|
128 | #define TM_LEN_SCI_NORM_SWF_340 340 * 12 + 6 + 10 - 1 | |
126 | #define TM_LEN_SCI_NORM_SWF_8 8 * 12 + 6 + 10 - 1 |
|
129 | #define TM_LEN_SCI_NORM_SWF_8 8 * 12 + 6 + 10 - 1 | |
127 |
|
130 | |||
128 | enum TM_TYPE{ |
|
131 | enum TM_TYPE{ | |
129 | TM_LFR_TC_EXE_OK, |
|
132 | TM_LFR_TC_EXE_OK, | |
130 | TM_LFR_TC_EXE_ERR, |
|
133 | TM_LFR_TC_EXE_ERR, | |
131 | TM_LFR_HK, |
|
134 | TM_LFR_HK, | |
132 | TM_LFR_SCI, |
|
135 | TM_LFR_SCI, | |
133 | TM_LFR_SCI_SBM, |
|
136 | TM_LFR_SCI_SBM, | |
134 | TM_LFR_PAR_DUMP |
|
137 | TM_LFR_PAR_DUMP | |
135 | }; |
|
138 | }; | |
136 |
|
139 | |||
137 | struct TMHeader_str |
|
140 | struct TMHeader_str | |
138 | { |
|
141 | { | |
139 | volatile unsigned char targetLogicalAddress; |
|
142 | volatile unsigned char targetLogicalAddress; | |
140 | volatile unsigned char protocolIdentifier; |
|
143 | volatile unsigned char protocolIdentifier; | |
141 | volatile unsigned char reserved; |
|
144 | volatile unsigned char reserved; | |
142 | volatile unsigned char userApplication; |
|
145 | volatile unsigned char userApplication; | |
143 | volatile unsigned char packetID[2]; |
|
146 | volatile unsigned char packetID[2]; | |
144 | volatile unsigned char packetSequenceControl[2]; |
|
147 | volatile unsigned char packetSequenceControl[2]; | |
145 | volatile unsigned char packetLength[2]; |
|
148 | volatile unsigned char packetLength[2]; | |
146 | volatile unsigned char dataFieldHeader[10]; |
|
149 | volatile unsigned char dataFieldHeader[10]; | |
147 | }; |
|
150 | }; | |
148 | typedef struct TMHeader_str TMHeader_t; |
|
151 | typedef struct TMHeader_str TMHeader_t; | |
149 |
|
152 | |||
150 | struct Packet_TM_LFR_HK_str |
|
|||
151 | { |
|
|||
152 | volatile unsigned char targetLogicalAddress; |
|
|||
153 | volatile unsigned char protocolIdentifier; |
|
|||
154 | volatile unsigned char reserved; |
|
|||
155 | volatile unsigned char userApplication; |
|
|||
156 | volatile unsigned char packetID[2]; |
|
|||
157 | volatile unsigned char packetSequenceControl[2]; |
|
|||
158 | volatile unsigned char packetLength[2]; |
|
|||
159 | volatile unsigned char dataFieldHeader[10]; |
|
|||
160 | volatile unsigned char data[LENGTH_TM_LFR_HK - 10 + 1]; |
|
|||
161 | }; |
|
|||
162 | typedef struct Packet_TM_LFR_HK_str Packet_TM_LFR_HK_t; |
|
|||
163 |
|
||||
164 | struct Packet_TM_LFR_TC_EXE_str |
|
153 | struct Packet_TM_LFR_TC_EXE_str | |
165 | { |
|
154 | { | |
166 | volatile unsigned char targetLogicalAddress; |
|
155 | volatile unsigned char targetLogicalAddress; | |
167 | volatile unsigned char protocolIdentifier; |
|
156 | volatile unsigned char protocolIdentifier; | |
168 | volatile unsigned char reserved; |
|
157 | volatile unsigned char reserved; | |
169 | volatile unsigned char userApplication; |
|
158 | volatile unsigned char userApplication; | |
170 | volatile unsigned char packetID[2]; |
|
159 | volatile unsigned char packetID[2]; | |
171 | volatile unsigned char packetSequenceControl[2]; |
|
160 | volatile unsigned char packetSequenceControl[2]; | |
172 | volatile unsigned char packetLength[2]; |
|
161 | volatile unsigned char packetLength[2]; | |
173 | volatile unsigned char dataFieldHeader[10]; |
|
162 | volatile unsigned char dataFieldHeader[10]; | |
174 | volatile unsigned char data[LENGTH_TM_LFR_TC_EXE_MAX - 10 + 1]; |
|
163 | volatile unsigned char data[LENGTH_TM_LFR_TC_EXE_MAX - 10 + 1]; | |
175 | }; |
|
164 | }; | |
176 | typedef struct Packet_TM_LFR_TC_EXE_str Packet_TM_LFR_TC_EXE_t; |
|
165 | typedef struct Packet_TM_LFR_TC_EXE_str Packet_TM_LFR_TC_EXE_t; | |
177 |
|
166 | |||
178 | struct Packet_TM_LFR_SCIENCE_NORMAL_WF_str |
|
167 | struct Packet_TM_LFR_SCIENCE_NORMAL_WF_str | |
179 | { |
|
168 | { | |
180 | volatile unsigned char targetLogicalAddress; |
|
169 | volatile unsigned char targetLogicalAddress; | |
181 | volatile unsigned char protocolIdentifier; |
|
170 | volatile unsigned char protocolIdentifier; | |
182 | volatile unsigned char reserved; |
|
171 | volatile unsigned char reserved; | |
183 | volatile unsigned char userApplication; |
|
172 | volatile unsigned char userApplication; | |
184 | volatile unsigned char packetID[2]; |
|
173 | volatile unsigned char packetID[2]; | |
185 | volatile unsigned char packetSequenceControl[2]; |
|
174 | volatile unsigned char packetSequenceControl[2]; | |
186 | volatile unsigned char packetLength[2]; |
|
175 | volatile unsigned char packetLength[2]; | |
187 | volatile unsigned char dataFieldHeader[10]; |
|
176 | volatile unsigned char dataFieldHeader[10]; | |
188 | volatile unsigned char auxiliaryHeader[6]; |
|
177 | volatile unsigned char auxiliaryHeader[6]; | |
189 | volatile unsigned char data[LENGTH_TM_LFR_SCIENCE_NORMAL_WF_MAX - 10 + 1]; |
|
178 | volatile unsigned char data[LENGTH_TM_LFR_SCIENCE_NORMAL_WF_MAX - 10 + 1]; | |
190 | }; |
|
179 | }; | |
191 | typedef struct Packet_TM_LFR_SCIENCE_NORMAL_WF_str Packet_TM_LFR_SCIENCE_NORMAL_WF_t; |
|
180 | typedef struct Packet_TM_LFR_SCIENCE_NORMAL_WF_str Packet_TM_LFR_SCIENCE_NORMAL_WF_t; | |
192 |
|
181 | |||
193 | struct ExtendedTMHeader_str |
|
182 | struct ExtendedTMHeader_str | |
194 | { |
|
183 | { | |
195 | volatile unsigned char targetLogicalAddress; |
|
184 | volatile unsigned char targetLogicalAddress; | |
196 | volatile unsigned char protocolIdentifier; |
|
185 | volatile unsigned char protocolIdentifier; | |
197 | volatile unsigned char reserved; |
|
186 | volatile unsigned char reserved; | |
198 | volatile unsigned char userApplication; |
|
187 | volatile unsigned char userApplication; | |
199 | volatile unsigned char packetID[2]; |
|
188 | volatile unsigned char packetID[2]; | |
200 | volatile unsigned char packetSequenceControl[2]; |
|
189 | volatile unsigned char packetSequenceControl[2]; | |
201 | volatile unsigned char packetLength[2]; |
|
190 | volatile unsigned char packetLength[2]; | |
202 | volatile unsigned char dataFieldHeader[10]; |
|
191 | volatile unsigned char dataFieldHeader[10]; | |
203 | volatile unsigned char auxiliaryHeader[6]; |
|
192 | volatile unsigned char auxiliaryHeader[6]; | |
204 | }; |
|
193 | }; | |
205 | typedef struct ExtendedTMHeader_str ExtendedTMHeader_t; |
|
194 | typedef struct ExtendedTMHeader_str ExtendedTMHeader_t; | |
206 |
|
195 | |||
207 | struct ccsdsTelecommandPacket_str |
|
196 | struct ccsdsTelecommandPacket_str | |
208 | { |
|
197 | { | |
209 | //unsigned char targetLogicalAddress; // removed by the grspw module |
|
198 | //unsigned char targetLogicalAddress; // removed by the grspw module | |
210 | volatile unsigned char protocolIdentifier; |
|
199 | volatile unsigned char protocolIdentifier; | |
211 | volatile unsigned char reserved; |
|
200 | volatile unsigned char reserved; | |
212 | volatile unsigned char userApplication; |
|
201 | volatile unsigned char userApplication; | |
213 | volatile unsigned char packetID[2]; |
|
202 | volatile unsigned char packetID[2]; | |
214 | volatile unsigned char packetSequenceControl[2]; |
|
203 | volatile unsigned char packetSequenceControl[2]; | |
215 | volatile unsigned char packetLength[2]; |
|
204 | volatile unsigned char packetLength[2]; | |
216 | volatile unsigned char dataFieldHeader[4]; |
|
205 | volatile unsigned char dataFieldHeader[4]; | |
217 | volatile unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10]; |
|
206 | volatile unsigned char dataAndCRC[CCSDS_TC_PKT_MAX_SIZE-10]; | |
218 | }; |
|
207 | }; | |
219 | typedef struct ccsdsTelecommandPacket_str ccsdsTelecommandPacket_t; |
|
208 | typedef struct ccsdsTelecommandPacket_str ccsdsTelecommandPacket_t; | |
220 |
|
209 | |||
221 |
struct |
|
210 | struct Packet_TM_LFR_HK_str | |
|
211 | { | |||
|
212 | volatile unsigned char targetLogicalAddress; | |||
|
213 | volatile unsigned char protocolIdentifier; | |||
|
214 | volatile unsigned char reserved; | |||
|
215 | volatile unsigned char userApplication; | |||
|
216 | volatile unsigned char packetID[2]; | |||
|
217 | volatile unsigned char packetSequenceControl[2]; | |||
|
218 | volatile unsigned char packetLength[2]; | |||
|
219 | volatile unsigned char dataFieldHeader[10]; | |||
|
220 | volatile unsigned char sid; | |||
|
221 | ||||
|
222 | //************** | |||
|
223 | // HK PARAMETERS | |||
222 | unsigned char lfr_status_word[2]; |
|
224 | unsigned char lfr_status_word[2]; | |
223 | unsigned char lfr_sw_version[4]; |
|
225 | unsigned char lfr_sw_version[4]; | |
224 | // tc statistics |
|
226 | // tc statistics | |
225 | unsigned char hk_lfr_update_info_tc_cnt[2]; |
|
227 | unsigned char hk_lfr_update_info_tc_cnt[2]; | |
226 | unsigned char hk_lfr_update_time_tc_cnt[2]; |
|
228 | unsigned char hk_lfr_update_time_tc_cnt[2]; | |
227 | unsigned char hk_dpu_exe_tc_lfr_cnt[2]; |
|
229 | unsigned char hk_dpu_exe_tc_lfr_cnt[2]; | |
228 | unsigned char hk_dpu_rej_tc_lfr_cnt[2]; |
|
230 | unsigned char hk_dpu_rej_tc_lfr_cnt[2]; | |
229 | unsigned char hk_lfr_last_exe_tc_id[2]; |
|
231 | unsigned char hk_lfr_last_exe_tc_id[2]; | |
230 | unsigned char hk_lfr_last_exe_tc_type[2]; |
|
232 | unsigned char hk_lfr_last_exe_tc_type[2]; | |
231 | unsigned char hk_lfr_last_exe_tc_subtype[2]; |
|
233 | unsigned char hk_lfr_last_exe_tc_subtype[2]; | |
232 | unsigned char hk_lfr_last_exe_tc_time[6]; |
|
234 | unsigned char hk_lfr_last_exe_tc_time[6]; | |
233 | unsigned char hk_lfr_last_rej_tc_id[2]; |
|
235 | unsigned char hk_lfr_last_rej_tc_id[2]; | |
234 | unsigned char hk_lfr_last_rej_tc_type[2]; |
|
236 | unsigned char hk_lfr_last_rej_tc_type[2]; | |
235 | unsigned char hk_lfr_last_rej_tc_subtype[2]; |
|
237 | unsigned char hk_lfr_last_rej_tc_subtype[2]; | |
236 | unsigned char hk_lfr_last_rej_tc_time[6]; |
|
238 | unsigned char hk_lfr_last_rej_tc_time[6]; | |
237 | // anomaly statistics |
|
239 | // anomaly statistics | |
238 | unsigned char hk_lfr_le_cnt[2]; |
|
240 | unsigned char hk_lfr_le_cnt[2]; | |
239 | unsigned char hk_lfr_me_cnt[2]; |
|
241 | unsigned char hk_lfr_me_cnt[2]; | |
240 | unsigned char hk_lfr_he_cnt[2]; |
|
242 | unsigned char hk_lfr_he_cnt[2]; | |
241 | unsigned char hk_lfr_last_er_rid[2]; |
|
243 | unsigned char hk_lfr_last_er_rid[2]; | |
242 | unsigned char hk_lfr_last_er_code; |
|
244 | unsigned char hk_lfr_last_er_code; | |
243 | unsigned char hk_lfr_last_er_time[6]; |
|
245 | unsigned char hk_lfr_last_er_time[6]; | |
244 | // vhdl_blk_status |
|
246 | // vhdl_blk_status | |
245 | unsigned char hk_lfr_vhdl_aa_sm; |
|
247 | unsigned char hk_lfr_vhdl_aa_sm; | |
246 | unsigned char hk_lfr_vhdl_fft_sr; |
|
248 | unsigned char hk_lfr_vhdl_fft_sr; | |
247 | unsigned char hk_lfr_vhdl_cic_hk; |
|
249 | unsigned char hk_lfr_vhdl_cic_hk; | |
248 | unsigned char hk_lfr_vhdl_iir_cal; |
|
250 | unsigned char hk_lfr_vhdl_iir_cal; | |
249 | // spacewire_if_statistics |
|
251 | // spacewire_if_statistics | |
250 | unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2]; |
|
252 | unsigned char hk_lfr_dpu_spw_pkt_rcv_cnt[2]; | |
251 | unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2]; |
|
253 | unsigned char hk_lfr_dpu_spw_pkt_sent_cnt[2]; | |
252 | unsigned char hk_lfr_dpu_spw_tick_out_cnt; |
|
254 | unsigned char hk_lfr_dpu_spw_tick_out_cnt; | |
253 | unsigned char hk_lfr_dpu_spw_last_timc; |
|
255 | unsigned char hk_lfr_dpu_spw_last_timc; | |
254 | // ahb error statistics |
|
256 | // ahb error statistics | |
255 | unsigned int hk_lfr_last_fail_addr; |
|
257 | unsigned int hk_lfr_last_fail_addr; | |
256 | // temperatures |
|
258 | // temperatures | |
257 | unsigned char hk_lfr_temp_scm[2]; |
|
259 | unsigned char hk_lfr_temp_scm[2]; | |
258 | unsigned char hk_lfr_temp_pcb[2]; |
|
260 | unsigned char hk_lfr_temp_pcb[2]; | |
259 | unsigned char hk_lfr_temp_fpga[2]; |
|
261 | unsigned char hk_lfr_temp_fpga[2]; | |
260 | // error counters |
|
262 | // error counters | |
261 | unsigned char hk_lfr_dpu_spw_parity; |
|
263 | unsigned char hk_lfr_dpu_spw_parity; | |
262 | unsigned char hk_lfr_dpu_spw_disconnect; |
|
264 | unsigned char hk_lfr_dpu_spw_disconnect; | |
263 | unsigned char hk_lfr_dpu_spw_escape; |
|
265 | unsigned char hk_lfr_dpu_spw_escape; | |
264 | unsigned char hk_lfr_dpu_spw_credit; |
|
266 | unsigned char hk_lfr_dpu_spw_credit; | |
265 | unsigned char hk_lfr_dpu_spw_write_sync; |
|
267 | unsigned char hk_lfr_dpu_spw_write_sync; | |
266 | unsigned char hk_lfr_dpu_spw_rx_ahb; |
|
268 | unsigned char hk_lfr_dpu_spw_rx_ahb; | |
267 | unsigned char hk_lfr_dpu_spw_tx_ahb; |
|
269 | unsigned char hk_lfr_dpu_spw_tx_ahb; | |
268 | unsigned char hk_lfr_dpu_spw_header_crc; |
|
270 | unsigned char hk_lfr_dpu_spw_header_crc; | |
269 | unsigned char hk_lfr_dpu_spw_data_crc; |
|
271 | unsigned char hk_lfr_dpu_spw_data_crc; | |
270 | unsigned char hk_lfr_dpu_spw_early_eop; |
|
272 | unsigned char hk_lfr_dpu_spw_early_eop; | |
271 | unsigned char hk_lfr_dpu_spw_invalid_addr; |
|
273 | unsigned char hk_lfr_dpu_spw_invalid_addr; | |
272 | unsigned char hk_lfr_dpu_spw_eep; |
|
274 | unsigned char hk_lfr_dpu_spw_eep; | |
273 | unsigned char hk_lfr_dpu_spw_rx_too_big; |
|
275 | unsigned char hk_lfr_dpu_spw_rx_too_big; | |
274 | // timecode |
|
276 | // timecode | |
275 | unsigned char hk_lfr_timecode_erroneous; |
|
277 | unsigned char hk_lfr_timecode_erroneous; | |
276 | unsigned char hk_lfr_timecode_missing; |
|
278 | unsigned char hk_lfr_timecode_missing; | |
277 | unsigned char hk_lfr_timecode_invalid; |
|
279 | unsigned char hk_lfr_timecode_invalid; | |
278 | // time |
|
280 | // time | |
279 | unsigned char hk_lfr_time_timecode_it; |
|
281 | unsigned char hk_lfr_time_timecode_it; | |
280 | unsigned char hk_lfr_time_not_synchro; |
|
282 | unsigned char hk_lfr_time_not_synchro; | |
281 | unsigned char hk_lfr_time_timecode_ctr; |
|
283 | unsigned char hk_lfr_time_timecode_ctr; | |
282 | // hk_lfr_buffer_dpu_ |
|
284 | // hk_lfr_buffer_dpu_ | |
283 | unsigned char hk_lfr_buffer_dpu_tc_fifo; |
|
285 | unsigned char hk_lfr_buffer_dpu_tc_fifo; | |
284 | unsigned char hk_lfr_buffer_dpu_tm_fifo; |
|
286 | unsigned char hk_lfr_buffer_dpu_tm_fifo; | |
285 | // hk_lfr_ahb_ |
|
287 | // hk_lfr_ahb_ | |
286 | unsigned char hk_lfr_ahb_correctable; |
|
288 | unsigned char hk_lfr_ahb_correctable; | |
287 | unsigned char hk_lfr_ahb_uncorrectable; |
|
289 | unsigned char hk_lfr_ahb_uncorrectable; | |
288 | unsigned char hk_lfr_ahb_fails_trans; |
|
290 | unsigned char hk_lfr_ahb_fails_trans; | |
289 | // hk_lfr_adc_ |
|
291 | // hk_lfr_adc_ | |
290 | unsigned char hk_lfr_adc_failure; |
|
292 | unsigned char hk_lfr_adc_failure; | |
291 | unsigned char hk_lfr_adc_timeout; |
|
293 | unsigned char hk_lfr_adc_timeout; | |
292 | unsigned char hk_lfr_toomany_err; |
|
294 | unsigned char hk_lfr_toomany_err; | |
293 | // hk_lfr_cpu_ |
|
295 | // hk_lfr_cpu_ | |
294 | unsigned char hk_lfr_cpu_write_err; |
|
296 | unsigned char hk_lfr_cpu_write_err; | |
295 | unsigned char hk_lfr_cpu_ins_access_err; |
|
297 | unsigned char hk_lfr_cpu_ins_access_err; | |
296 | unsigned char hk_lfr_cpu_illegal_ins; |
|
298 | unsigned char hk_lfr_cpu_illegal_ins; | |
297 | unsigned char hk_lfr_cpu_privilegied_ins; |
|
299 | unsigned char hk_lfr_cpu_privilegied_ins; | |
298 | unsigned char hk_lfr_cpu_register_hw; |
|
300 | unsigned char hk_lfr_cpu_register_hw; | |
299 | unsigned char hk_lfr_cpu_not_aligned; |
|
301 | unsigned char hk_lfr_cpu_not_aligned; | |
300 | unsigned char hk_lfr_cpu_data_exception; |
|
302 | unsigned char hk_lfr_cpu_data_exception; | |
301 | unsigned char hk_lfr_cpu_div_exception; |
|
303 | unsigned char hk_lfr_cpu_div_exception; | |
302 | unsigned char hk_lfr_cpu_arith_overflow; |
|
304 | unsigned char hk_lfr_cpu_arith_overflow; | |
303 |
|
||||
304 | }; |
|
305 | }; | |
305 |
typedef struct |
|
306 | typedef struct Packet_TM_LFR_HK_str Packet_TM_LFR_HK_t; | |
306 |
|
307 | |||
307 | #endif // CCSDS_H_INCLUDED |
|
308 | #endif // CCSDS_H_INCLUDED |
@@ -1,60 +1,64 | |||||
1 | #ifndef FSW_RTEMS_H_INCLUDED |
|
1 | #ifndef FSW_RTEMS_H_INCLUDED | |
2 | #define FSW_RTEMS_H_INCLUDED |
|
2 | #define FSW_RTEMS_H_INCLUDED | |
3 |
|
3 | |||
4 | #include <errno.h> |
|
4 | #include <errno.h> | |
5 | #include <fcntl.h> |
|
5 | #include <fcntl.h> | |
6 | #include <stdio.h> |
|
6 | #include <stdio.h> | |
7 | #include <stdlib.h> |
|
7 | #include <stdlib.h> | |
8 |
|
8 | |||
9 | #include <grspw.h> |
|
9 | #include <grspw.h> | |
10 | #include <apbuart.h> |
|
10 | #include <apbuart.h> | |
11 |
|
11 | |||
12 | #include <fsw_params.h> |
|
12 | #include <fsw_params.h> | |
13 | #include <fsw_misc.h> |
|
13 | #include <fsw_misc.h> | |
14 | #include <fsw_processing.h> |
|
14 | #include <fsw_processing.h> | |
15 | #include <tc_handler.h> |
|
15 | #include <tc_handler.h> | |
16 | #include <wf_handler.h> |
|
16 | #include <wf_handler.h> | |
17 | #include <grlib_regs.h> |
|
17 | #include <grlib_regs.h> | |
18 |
|
18 | #include <ccsds_types.h> | ||
|
19 | ||||
19 | extern int sched_yield( void ); |
|
20 | extern int sched_yield( void ); | |
20 | extern int errno; |
|
21 | extern int errno; | |
21 | extern rtems_id Task_id[ ]; /* array of task ids */ |
|
22 | extern rtems_id Task_id[ ]; /* array of task ids */ | |
22 | extern rtems_name Task_name[ ]; /* array of task names */ |
|
23 | extern rtems_name Task_name[ ]; /* array of task names */ | |
23 | extern rtems_name misc_name[ ]; /* arry of miscellaneous names for rtems objects */ |
|
24 | extern rtems_name misc_name[ ]; /* arry of miscellaneous names for rtems objects */ | |
24 | extern int fdSPW; // grspw file descriptor |
|
25 | extern int fdSPW; // grspw file descriptor | |
25 | extern int fdUART; // uart file descriptor |
|
26 | extern int fdUART; // uart file descriptor | |
26 |
|
27 | |||
27 | void timecode_irq_handler(void *pDev, void *regs, int minor, unsigned int tc); |
|
28 | void timecode_irq_handler(void *pDev, void *regs, int minor, unsigned int tc); | |
28 |
|
29 | |||
29 | // MODE PARAMETERS |
|
30 | // MODE PARAMETERS | |
30 |
extern struct param_ |
|
31 | extern struct param_common_str param_common; | |
31 |
extern struct param_ |
|
32 | extern struct param_norm_str param_norm; | |
32 |
extern struct param_ |
|
33 | extern struct param_burst_str param_burst; | |
33 |
extern struct param_sbm |
|
34 | extern struct param_sbm1_str param_sbm1; | |
34 | extern unsigned char param_common[]; |
|
35 | extern struct param_sbm2_str param_sbm2; | |
35 |
|
36 | extern Packet_TM_LFR_HK_t housekeeping_packet; | ||
|
37 | extern unsigned short sequenceCounters[SEQ_CNT_NB_PID][SEQ_CNT_NB_CAT][SEQ_CNT_NB_DEST_ID]; | |||
|
38 | ||||
36 | // RTEMS TASKS |
|
39 | // RTEMS TASKS | |
37 | rtems_task Init( rtems_task_argument argument); /* forward declaration needed */ |
|
40 | rtems_task Init( rtems_task_argument argument); /* forward declaration needed */ | |
38 | rtems_task recv_task(rtems_task_argument argument); |
|
41 | rtems_task recv_task(rtems_task_argument argument); | |
39 | rtems_task spiq_task(rtems_task_argument argument); |
|
42 | rtems_task spiq_task(rtems_task_argument argument); | |
40 | rtems_task stat_task(rtems_task_argument argument); |
|
43 | rtems_task stat_task(rtems_task_argument argument); | |
41 | rtems_task wfrm_task(rtems_task_argument argument); |
|
44 | rtems_task wfrm_task(rtems_task_argument argument); | |
42 | int create_names( void ); |
|
45 | int create_names( void ); | |
43 | int create_all_tasks( void ); |
|
46 | int create_all_tasks( void ); | |
44 | int start_all_tasks( void ); |
|
47 | int start_all_tasks( void ); | |
45 | int create_message_queue( void ); |
|
48 | int create_message_queue( void ); | |
46 |
|
49 | |||
47 | // OTHER functions |
|
50 | // OTHER functions | |
48 | void init_default_mode_parameters( void ); |
|
51 | void init_default_mode_parameters( void ); | |
49 |
|
52 | void init_housekeeping_parameters( void ); | ||
50 | int configure_spw_link( void ); |
|
53 | ||
51 | void configure_spacewire_set_NP(unsigned char val, unsigned int regAddr); // No Port force |
|
54 | int configure_spw_link( void ); | |
52 |
void configure_spacewire_set_ |
|
55 | void configure_spacewire_set_NP(unsigned char val, unsigned int regAddr); // No Port force | |
|
56 | void configure_spacewire_set_RE(unsigned char val, unsigned int regAddr); // RMAP Enable | |||
53 |
|
57 | |||
54 | extern int rtems_cpu_usage_report( void ); |
|
58 | extern int rtems_cpu_usage_report( void ); | |
55 | extern int rtems_cpu_usage_reset( void ); |
|
59 | extern int rtems_cpu_usage_reset( void ); | |
56 |
|
60 | |||
57 | rtems_status_code write_spw(spw_ioctl_pkt_send* spw_ioctl_send); |
|
61 | rtems_status_code write_spw(spw_ioctl_pkt_send* spw_ioctl_send); | |
58 | void (*grspw_timecode_callback) (void *pDev, void *regs, int minor, unsigned int tc); |
|
62 | void (*grspw_timecode_callback) (void *pDev, void *regs, int minor, unsigned int tc); | |
59 |
|
63 | |||
60 | #endif // FSW_RTEMS_CONFIG_H_INCLUDED |
|
64 | #endif // FSW_RTEMS_CONFIG_H_INCLUDED |
@@ -1,104 +1,150 | |||||
1 | #ifndef FSW_RTEMS_CONFIG_H_INCLUDED |
|
1 | #ifndef FSW_RTEMS_CONFIG_H_INCLUDED | |
2 | #define FSW_RTEMS_CONFIG_H_INCLUDED |
|
2 | #define FSW_RTEMS_CONFIG_H_INCLUDED | |
3 |
|
3 | |||
4 | #define GRSPW_DEVICE_NAME "/dev/grspw0" |
|
4 | #define GRSPW_DEVICE_NAME "/dev/grspw0" | |
5 | #define UART_DEVICE_NAME "/dev/console" |
|
5 | #define UART_DEVICE_NAME "/dev/console" | |
6 |
|
6 | |||
|
7 | //************************ | |||
|
8 | // flight software version | |||
|
9 | // this parameters is handled by the Qt project options | |||
|
10 | ||||
7 | //********** |
|
11 | //********** | |
8 | // LFR MODES |
|
12 | // LFR MODES | |
9 | #define LFR_MODE_STANDBY 0 |
|
13 | #define LFR_MODE_STANDBY 0 | |
10 | #define LFR_MODE_NORMAL 1 |
|
14 | #define LFR_MODE_NORMAL 1 | |
11 | #define LFR_MODE_BURST 2 |
|
15 | #define LFR_MODE_BURST 2 | |
12 | #define LFR_MODE_SBM1 3 |
|
16 | #define LFR_MODE_SBM1 3 | |
13 | #define LFR_MODE_SBM2 4 |
|
17 | #define LFR_MODE_SBM2 4 | |
14 |
|
18 | |||
|
19 | #define RTEMS_EVENT_MODE_STANDBY RTEMS_EVENT_0 | |||
|
20 | #define RTEMS_EVENT_MODE_NORMAL RTEMS_EVENT_1 | |||
|
21 | #define RTEMS_EVENT_MODE_BURST RTEMS_EVENT_2 | |||
|
22 | #define RTEMS_EVENT_MODE_SBM1 RTEMS_EVENT_3 | |||
|
23 | #define RTEMS_EVENT_MODE_SBM2 RTEMS_EVENT_4 | |||
|
24 | ||||
15 | //***************************** |
|
25 | //***************************** | |
16 | // APB REGISTERS BASE ADDRESSES |
|
26 | // APB REGISTERS BASE ADDRESSES | |
17 | #define REGS_ADDR_APBUART 0x80000100 |
|
27 | #define REGS_ADDR_APBUART 0x80000100 | |
18 | #define REGS_ADDR_GPTIMER 0x80000300 |
|
28 | #define REGS_ADDR_GPTIMER 0x80000300 | |
19 | #define REGS_ADDR_GRSPW 0x80000500 |
|
29 | #define REGS_ADDR_GRSPW 0x80000500 | |
20 | #define REGS_ADDR_TIME_MANAGEMENT 0x80000600 |
|
30 | #define REGS_ADDR_TIME_MANAGEMENT 0x80000600 | |
21 | #define REGS_ADDR_SPECTRAL_MATRICES 0x80000700 |
|
31 | #define REGS_ADDR_SPECTRAL_MATRICES 0x80000700 | |
22 | #define REGS_ADDR_WAVEFORM_PICKER 0x80000f20 |
|
32 | #define REGS_ADDR_WAVEFORM_PICKER 0x80000f20 | |
23 |
|
33 | |||
24 | #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff |
|
34 | #define APBUART_CTRL_REG_MASK_DB 0xfffff7ff | |
25 | #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 |
|
35 | #define APBUART_SCALER_RELOAD_VALUE 0x00000050 // 25 MHz => about 38400 | |
26 |
|
36 | |||
27 | //********** |
|
37 | //********** | |
28 | // IRQ LINES |
|
38 | // IRQ LINES | |
29 | #define IRQ_SM 9 |
|
39 | #define IRQ_SM 9 | |
30 | #define IRQ_SPARC_SM 0x19 // see sparcv8.pdf p.76 for interrupt levels |
|
40 | #define IRQ_SPARC_SM 0x19 // see sparcv8.pdf p.76 for interrupt levels | |
31 | #define IRQ_WF 10 |
|
41 | #define IRQ_WF 10 | |
32 | #define IRQ_SPARC_WF 0x1a // see sparcv8.pdf p.76 for interrupt levels |
|
42 | #define IRQ_SPARC_WF 0x1a // see sparcv8.pdf p.76 for interrupt levels | |
33 | #define IRQ_TIME1 12 |
|
43 | #define IRQ_TIME1 12 | |
34 | #define IRQ_SPARC_TIME1 0x1c // see sparcv8.pdf p.76 for interrupt levels |
|
44 | #define IRQ_SPARC_TIME1 0x1c // see sparcv8.pdf p.76 for interrupt levels | |
35 | #define IRQ_TIME2 13 |
|
45 | #define IRQ_TIME2 13 | |
36 | #define IRQ_SPARC_TIME2 0x1d // see sparcv8.pdf p.76 for interrupt levels |
|
46 | #define IRQ_SPARC_TIME2 0x1d // see sparcv8.pdf p.76 for interrupt levels | |
37 | #define IRQ_WAVEFORM_PICKER 14 |
|
47 | #define IRQ_WAVEFORM_PICKER 14 | |
38 | #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels |
|
48 | #define IRQ_SPARC_WAVEFORM_PICKER 0x1e // see sparcv8.pdf p.76 for interrupt levels | |
39 |
|
49 | |||
40 | //***** |
|
50 | //***** | |
41 | // TIME |
|
51 | // TIME | |
42 | #define CLKDIV_SM_SIMULATOR 9999 |
|
52 | #define CLKDIV_SM_SIMULATOR 9999 | |
43 | #define CLKDIV_WF_SIMULATOR 9999999 |
|
53 | #define CLKDIV_WF_SIMULATOR 9999999 | |
44 | #define TIMER_SM_SIMULATOR 1 |
|
54 | #define TIMER_SM_SIMULATOR 1 | |
45 | #define TIMER_WF_SIMULATOR 2 |
|
55 | #define TIMER_WF_SIMULATOR 2 | |
46 | #define HK_PERIOD 100 // 100 * 10ms => 1sec |
|
56 | #define HK_PERIOD 100 // 100 * 10ms => 1sec | |
47 |
|
57 | |||
|
58 | //********** | |||
|
59 | // LPP CODES | |||
|
60 | #define LFR_SUCCESSFUL 0 | |||
|
61 | #define LFR_DEFAULT 1 | |||
|
62 | ||||
48 | //****** |
|
63 | //****** | |
49 | // RTEMS |
|
64 | // RTEMS | |
50 | #define TASKID_RECV 1 |
|
65 | #define TASKID_RECV 1 | |
51 | #define TASKID_ACTN 2 |
|
66 | #define TASKID_ACTN 2 | |
52 | #define TASKID_SPIQ 3 |
|
67 | #define TASKID_SPIQ 3 | |
53 | #define TASKID_SMIQ 4 |
|
68 | #define TASKID_SMIQ 4 | |
54 | #define TASKID_STAT 5 |
|
69 | #define TASKID_STAT 5 | |
55 | #define TASKID_AVF0 6 |
|
70 | #define TASKID_AVF0 6 | |
56 | #define TASKID_BPF0 7 |
|
71 | #define TASKID_BPF0 7 | |
57 | #define TASKID_WFRM 8 |
|
72 | #define TASKID_WFRM 8 | |
58 | #define TASKID_DUMB 9 |
|
73 | #define TASKID_DUMB 9 | |
59 | #define TASKID_HOUS 10 |
|
74 | #define TASKID_HOUS 10 | |
60 |
|
75 | |||
61 | #define ACTION_MSG_QUEUE_COUNT 10 |
|
76 | #define ACTION_MSG_QUEUE_COUNT 10 | |
62 |
|
77 | |||
63 | //******* |
|
78 | //******* | |
64 | // MACROS |
|
79 | // MACROS | |
65 | #ifdef PRINT_MESSAGES_ON_CONSOLE |
|
80 | #ifdef PRINT_MESSAGES_ON_CONSOLE | |
66 | #define PRINTF(x) printf(x); |
|
81 | #define PRINTF(x) printf(x); | |
67 | #define PRINTF1(x,y) printf(x,y); |
|
82 | #define PRINTF1(x,y) printf(x,y); | |
68 | #define PRINTF2(x,y,z) printf(x,y,z); |
|
83 | #define PRINTF2(x,y,z) printf(x,y,z); | |
69 | #else |
|
84 | #else | |
70 | #define PRINTF(x) ; |
|
85 | #define PRINTF(x) ; | |
71 | #define PRINTF1(x,y) ; |
|
86 | #define PRINTF1(x,y) ; | |
72 | #define PRINTF2(x,y,z) ; |
|
87 | #define PRINTF2(x,y,z) ; | |
73 | #endif |
|
88 | #endif | |
74 |
|
89 | |||
75 | #define NB_SAMPLES_PER_SNAPSHOT 2048 |
|
90 | #define NB_SAMPLES_PER_SNAPSHOT 2048 | |
76 | #define TIME_OFFSET 2 |
|
91 | #define TIME_OFFSET 2 | |
77 | #define WAVEFORM_EXTENDED_HEADER_OFFSET 22 |
|
92 | #define WAVEFORM_EXTENDED_HEADER_OFFSET 22 | |
78 | #define NB_BYTES_SWF_BLK 2 * 6 |
|
93 | #define NB_BYTES_SWF_BLK 2 * 6 | |
79 | #define NB_WORDS_SWF_BLK 3 |
|
94 | #define NB_WORDS_SWF_BLK 3 | |
80 |
|
95 | |||
|
96 | //****************** | |||
|
97 | // SEQUENCE COUNTERS | |||
|
98 | #define SEQ_CNT_NB_PID 2 | |||
|
99 | #define SEQ_CNT_NB_CAT 4 | |||
|
100 | #define SEQ_CNT_NB_DEST_ID 11 | |||
|
101 | // pid | |||
|
102 | #define SEQ_CNT_PID_76 0 | |||
|
103 | #define SEQ_CNT_PID_79 1 | |||
|
104 | //cat | |||
|
105 | #define SEQ_CNT_CAT_1 0 | |||
|
106 | #define SEQ_CNT_CAT_4 1 | |||
|
107 | #define SEQ_CNT_CAT_9 2 | |||
|
108 | #define SEQ_CNT_CAT_12 3 | |||
|
109 | // destination id | |||
|
110 | #define SEQ_CNT_DST_ID_GROUND 0 | |||
|
111 | #define SEQ_CNT_DST_ID_MISSION_TIMELINE 1 | |||
|
112 | #define SEQ_CNT_DST_ID_TC_SEQUENCES 2 | |||
|
113 | #define SEQ_CNT_DST_ID_RECOVERY_ACTION_CMD 3 | |||
|
114 | #define SEQ_CNT_DST_ID_BACKUP_MISSION_TIMELINE 4 | |||
|
115 | #define SEQ_CNT_DST_ID_DIRECT_CMD 5 | |||
|
116 | #define SEQ_CNT_DST_ID_SPARE_GRD_SRC1 6 | |||
|
117 | #define SEQ_CNT_DST_ID_SPARE_GRD_SRC2 7 | |||
|
118 | #define SEQ_CNT_DST_ID_OBCP 8 | |||
|
119 | #define SEQ_CNT_DST_ID_SYSTEM_CONTROL 9 | |||
|
120 | #define SEQ_CNT_DST_ID_AOCS 10 | |||
|
121 | ||||
|
122 | struct param_common_str{ | |||
|
123 | unsigned char sy_lfr_common0; | |||
|
124 | unsigned char sy_lfr_common1; | |||
|
125 | }; | |||
|
126 | ||||
81 | struct param_norm_str{ |
|
127 | struct param_norm_str{ | |
82 | unsigned int sy_lfr_n_swf_l; // length of the snapshots |
|
128 | unsigned int sy_lfr_n_swf_l; // length of the snapshots | |
83 | unsigned int sy_lfr_n_swf_p; // time between two snapshots |
|
129 | unsigned int sy_lfr_n_swf_p; // time between two snapshots | |
84 | unsigned int sy_lfr_n_asm_p; // time between two asm |
|
130 | unsigned int sy_lfr_n_asm_p; // time between two asm | |
85 | unsigned char sy_lfr_n_bp_p0; // timebetween two products BP1 set |
|
131 | unsigned char sy_lfr_n_bp_p0; // timebetween two products BP1 set | |
86 | unsigned char sy_lfr_n_bp_p1; // time between two products BP2 set |
|
132 | unsigned char sy_lfr_n_bp_p1; // time between two products BP2 set | |
87 | }; |
|
133 | }; | |
88 |
|
134 | |||
89 | struct param_burst_str{ |
|
135 | struct param_burst_str{ | |
90 | unsigned char sy_lfr_b_bp_p0; // timebetween two products BP1 set |
|
136 | unsigned char sy_lfr_b_bp_p0; // timebetween two products BP1 set | |
91 | unsigned char sy_lfr_b_bp_p1; // time between two products BP2 set |
|
137 | unsigned char sy_lfr_b_bp_p1; // time between two products BP2 set | |
92 | }; |
|
138 | }; | |
93 |
|
139 | |||
94 | struct param_sbm1_str{ |
|
140 | struct param_sbm1_str{ | |
95 | unsigned char sy_lfr_s1_bp_p0; // timebetween two products BP1 set |
|
141 | unsigned char sy_lfr_s1_bp_p0; // timebetween two products BP1 set | |
96 | unsigned char sy_lfr_s1_bp_p1; // time between two products BP2 set |
|
142 | unsigned char sy_lfr_s1_bp_p1; // time between two products BP2 set | |
97 | }; |
|
143 | }; | |
98 |
|
144 | |||
99 | struct param_sbm2_str{ |
|
145 | struct param_sbm2_str{ | |
100 | unsigned char sy_lfr_s2_bp_p0; // timebetween two products BP1 set |
|
146 | unsigned char sy_lfr_s2_bp_p0; // timebetween two products BP1 set | |
101 | unsigned char sy_lfr_s2_bp_p1; // time between two products BP2 set |
|
147 | unsigned char sy_lfr_s2_bp_p1; // time between two products BP2 set | |
102 | }; |
|
148 | }; | |
103 |
|
149 | |||
104 | #endif // FSW_RTEMS_CONFIG_H_INCLUDED |
|
150 | #endif // FSW_RTEMS_CONFIG_H_INCLUDED |
@@ -1,71 +1,77 | |||||
1 | #ifndef TC_HANDLER_H_INCLUDED |
|
1 | #ifndef TC_HANDLER_H_INCLUDED | |
2 | #define TC_HANDLER_H_INCLUDED |
|
2 | #define TC_HANDLER_H_INCLUDED | |
3 |
|
3 | |||
4 | #include <rtems.h> |
|
4 | #include <rtems.h> | |
5 | #include <bsp.h> // for the LEON_Unmask_interrupt function |
|
5 | #include <bsp.h> // for the LEON_Unmask_interrupt function | |
6 | #include <stdio.h> |
|
6 | #include <stdio.h> | |
7 | #include <unistd.h> // for the read call |
|
7 | #include <unistd.h> // for the read call | |
8 | #include <sys/ioctl.h> // for the ioctl call |
|
8 | #include <sys/ioctl.h> // for the ioctl call | |
9 | #include <ccsds_types.h> |
|
9 | #include <ccsds_types.h> | |
10 | #include <grspw.h> |
|
10 | #include <grspw.h> | |
11 | #include <fsw_init.h> |
|
11 | #include <fsw_init.h> | |
12 |
|
12 | |||
13 | extern int fdSPW; |
|
13 | extern int fdSPW; | |
14 | extern rtems_name misc_name[ ]; |
|
14 | extern rtems_name misc_name[ ]; | |
15 | extern rtems_name misc_id[ ]; |
|
15 | extern rtems_name misc_id[ ]; | |
16 | extern rtems_id Task_id[ ]; // array of task ids |
|
16 | extern rtems_id Task_id[ ]; // array of task ids | |
17 | // MODE PARAMETERS |
|
17 | // MODE PARAMETERS | |
|
18 | extern struct param_common_str param_common; | |||
18 | extern struct param_norm_str param_norm; |
|
19 | extern struct param_norm_str param_norm; | |
19 | extern struct param_sbm1_str param_sbm1; |
|
20 | extern struct param_sbm1_str param_sbm1; | |
20 | extern struct param_sbm2_str param_sbm2; |
|
21 | extern struct param_sbm2_str param_sbm2; | |
|
22 | extern Packet_TM_LFR_HK_t housekeeping_packet; | |||
21 | extern time_management_regs_t *time_management_regs; |
|
23 | extern time_management_regs_t *time_management_regs; | |
22 | extern waveform_picker_regs_t *waveform_picker_regs; |
|
24 | extern waveform_picker_regs_t *waveform_picker_regs; | |
23 | extern gptimer_regs_t *gptimer_regs; |
|
25 | extern gptimer_regs_t *gptimer_regs; | |
24 | extern unsigned char param_common[]; |
|
|||
25 |
|
26 | |||
26 | //**** |
|
27 | //**** | |
27 | // ISR |
|
28 | // ISR | |
28 | rtems_isr commutation_isr1( rtems_vector_number vector ); |
|
29 | rtems_isr commutation_isr1( rtems_vector_number vector ); | |
29 | rtems_isr commutation_isr2( rtems_vector_number vector ); |
|
30 | rtems_isr commutation_isr2( rtems_vector_number vector ); | |
30 |
|
31 | |||
31 | //********************** |
|
32 | //********************** | |
32 | // GENERAL USE FUNCTIONS |
|
33 | // GENERAL USE FUNCTIONS | |
33 | void initLookUpTableForCRC( void ); |
|
34 | void initLookUpTableForCRC( void ); | |
34 | void GetCRCAsTwoBytes(unsigned char* data, unsigned char* crcAsTwoBytes, unsigned int sizeOfData); |
|
35 | void GetCRCAsTwoBytes(unsigned char* data, unsigned char* crcAsTwoBytes, unsigned int sizeOfData); | |
35 |
|
36 | |||
36 | //********************* |
|
37 | //********************* | |
37 | // ACCEPTANCE FUNCTIONS |
|
38 | // ACCEPTANCE FUNCTIONS | |
38 | unsigned char acceptTM(ccsdsTelecommandPacket_t * TMPacket, unsigned int tc_len_recv); |
|
39 | unsigned char acceptTM(ccsdsTelecommandPacket_t * TMPacket, unsigned int tc_len_recv); | |
39 |
|
40 | |||
40 | unsigned char TM_build_header( enum TM_TYPE tm_type, unsigned int packetLength, |
|
41 | unsigned char TM_build_header( enum TM_TYPE tm_type, unsigned int packetLength, | |
41 | unsigned int coarseTime, unsigned int fineTime, TMHeader_t *TMHeader); |
|
42 | unsigned int coarseTime, unsigned int fineTime, TMHeader_t *TMHeader); | |
42 | unsigned char TM_build_data(ccsdsTelecommandPacket_t *TC, char* data, unsigned int SID, unsigned char *computed_CRC); |
|
43 | unsigned char TM_build_data(ccsdsTelecommandPacket_t *TC, char* data, unsigned int SID, unsigned char *computed_CRC); | |
43 | int TC_checker(ccsdsTelecommandPacket_t *TC, unsigned int TC_LEN_RCV); |
|
44 | int TC_checker(ccsdsTelecommandPacket_t *TC, unsigned int TC_LEN_RCV); | |
44 |
|
45 | |||
45 | //*********** |
|
46 | //*********** | |
46 | // RTEMS TASK |
|
47 | // RTEMS TASK | |
47 | rtems_task recv_task( rtems_task_argument unused ); |
|
48 | rtems_task recv_task( rtems_task_argument unused ); | |
48 | rtems_task actn_task( rtems_task_argument unused ); |
|
49 | rtems_task actn_task( rtems_task_argument unused ); | |
49 | rtems_task dumb_task( rtems_task_argument unused ); |
|
50 | rtems_task dumb_task( rtems_task_argument unused ); | |
50 | int create_message_queue( void ); |
|
51 | int create_message_queue( void ); | |
51 |
|
52 | |||
52 | //*********** |
|
53 | //*********** | |
53 | // TC ACTIONS |
|
54 | // TC ACTIONS | |
54 | int action_default(ccsdsTelecommandPacket_t *TC); |
|
55 | int action_default(ccsdsTelecommandPacket_t *TC); | |
55 | int action_default_alt(ccsdsTelecommandPacket_t *TC); |
|
56 | int action_default_alt(ccsdsTelecommandPacket_t *TC); | |
56 | int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC); |
|
57 | int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC); | |
57 | // |
|
58 | // | |
58 | int stop_current_mode(); |
|
59 | int stop_current_mode(); | |
59 | int enter_normal_mode(); |
|
60 | int enter_normal_mode(); | |
60 | int enter_sbm1_mode(); |
|
61 | int enter_sbm1_mode(); | |
|
62 | int action_load_comm(ccsdsTelecommandPacket_t *TC); | |||
61 | int action_load_norm(ccsdsTelecommandPacket_t *TC); |
|
63 | int action_load_norm(ccsdsTelecommandPacket_t *TC); | |
62 | int action_enter(ccsdsTelecommandPacket_t *TC); |
|
64 | int action_enter(ccsdsTelecommandPacket_t *TC); | |
63 | int action_updt_time(ccsdsTelecommandPacket_t *TC); |
|
65 | int action_updt_time(ccsdsTelecommandPacket_t *TC); | |
64 | // |
|
66 | // | |
|
67 | void update_last_TC_exe(ccsdsTelecommandPacket_t *TC); | |||
|
68 | void update_last_TC_rej(ccsdsTelecommandPacket_t *TC); | |||
|
69 | void close_action(ccsdsTelecommandPacket_t *TC, int result); | |||
|
70 | // | |||
65 | rtems_status_code restart_if_needed(rtems_id id); |
|
71 | rtems_status_code restart_if_needed(rtems_id id); | |
66 | rtems_status_code suspend_if_needed(rtems_id id); |
|
72 | rtems_status_code suspend_if_needed(rtems_id id); | |
67 |
|
73 | |||
68 | #endif // TC_HANDLER_H_INCLUDED |
|
74 | #endif // TC_HANDLER_H_INCLUDED | |
69 |
|
75 | |||
70 |
|
76 | |||
71 |
|
77 |
@@ -1,38 +1,40 | |||||
1 | #ifndef WF_HANDLER_H_INCLUDED |
|
1 | #ifndef WF_HANDLER_H_INCLUDED | |
2 | #define WF_HANDLER_H_INCLUDED |
|
2 | #define WF_HANDLER_H_INCLUDED | |
3 |
|
3 | |||
4 | #include <rtems.h> |
|
4 | #include <rtems.h> | |
5 | #include <fsw_params.h> |
|
5 | #include <fsw_params.h> | |
6 | #include <grspw.h> |
|
6 | #include <grspw.h> | |
7 | #include <grlib_regs.h> |
|
7 | #include <grlib_regs.h> | |
8 | #include <ccsds_types.h> |
|
8 | #include <ccsds_types.h> | |
9 | #include <stdio.h> |
|
9 | #include <stdio.h> | |
10 | #include <fsw_init.h> |
|
10 | #include <fsw_init.h> | |
11 | #include <math.h> |
|
11 | #include <math.h> | |
12 |
|
12 | |||
13 | #define pi 3.1415 |
|
13 | #define pi 3.1415 | |
14 |
|
14 | |||
15 | //#include <sys/ioctl.h> |
|
15 | //#include <sys/ioctl.h> | |
16 |
|
16 | |||
17 | extern rtems_id Task_id[]; /* array of task ids */ |
|
17 | extern rtems_id Task_id[]; /* array of task ids */ | |
18 | extern int fdSPW; |
|
18 | extern int fdSPW; | |
19 | extern volatile int wf_snap_f0[ ]; |
|
19 | extern volatile int wf_snap_f0[ ]; | |
20 | extern volatile int wf_snap_f1[ ]; |
|
20 | extern volatile int wf_snap_f1[ ]; | |
21 | extern volatile int wf_snap_f1_bis[ ]; |
|
21 | extern volatile int wf_snap_f1_bis[ ]; | |
22 | extern volatile int wf_snap_f2[ ]; |
|
22 | extern volatile int wf_snap_f2[ ]; | |
23 | extern volatile int wf_cont_f3[ ]; |
|
23 | extern volatile int wf_cont_f3[ ]; | |
24 | extern waveform_picker_regs_t *waveform_picker_regs; |
|
24 | extern waveform_picker_regs_t *waveform_picker_regs; | |
25 |
|
25 | |||
26 | rtems_isr waveforms_isr( rtems_vector_number vector ); |
|
26 | rtems_isr waveforms_isr( rtems_vector_number vector ); | |
|
27 | rtems_isr waveforms_isr_alternative( rtems_vector_number vector ); | |||
27 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ); |
|
28 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ); | |
28 | rtems_task wfrm_task(rtems_task_argument argument); |
|
29 | rtems_task wfrm_task(rtems_task_argument argument); | |
29 |
|
30 | |||
30 | //****************** |
|
31 | //****************** | |
31 | // general functions |
|
32 | // general functions | |
32 | void init_waveforms( void ); |
|
33 | void init_waveforms( void ); | |
33 | void reset_waveforms( void ); |
|
34 | void reset_waveforms( void ); | |
34 | void send_waveform( ExtendedTMHeader_t *header, volatile int *waveform, unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send); |
|
35 | void send_waveform( ExtendedTMHeader_t *header, volatile int *waveform, unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send); | |
35 | void init_waveform_picker_regs(); |
|
36 | void init_waveform_picker_regs(); | |
|
37 | void set_data_shaping_parameters(unsigned char parameters); | |||
36 | int build_value(int value1, int value0); |
|
38 | int build_value(int value1, int value0); | |
37 |
|
39 | |||
38 | #endif // WF_HANDLER_H_INCLUDED |
|
40 | #endif // WF_HANDLER_H_INCLUDED |
@@ -1,54 +1,54 | |||||
1 | #include <fsw_processing.h> |
|
1 | #include <fsw_processing.h> | |
2 | #include <rtems.h> |
|
2 | #include <rtems.h> | |
3 | #include <ccsds_types.h> |
|
3 | #include <ccsds_types.h> | |
4 |
|
4 | |||
5 | // RTEMS GLOBAL VARIABLES |
|
5 | // RTEMS GLOBAL VARIABLES | |
6 | rtems_name misc_name[5]; |
|
6 | rtems_name misc_name[5]; | |
7 | rtems_name misc_id[5]; |
|
7 | rtems_name misc_id[5]; | |
8 | rtems_id Task_id[15]; /* array of task ids */ |
|
8 | rtems_id Task_id[15]; /* array of task ids */ | |
9 | rtems_name Task_name[15]; /* array of task names */ |
|
9 | rtems_name Task_name[15]; /* array of task names */ | |
10 | int fdSPW = 0; |
|
10 | int fdSPW = 0; | |
11 | int fdUART = 0; |
|
11 | int fdUART = 0; | |
12 |
|
12 | |||
13 | spectral_matrices_regs_t *spectral_matrices_regs = NULL; |
|
13 | spectral_matrices_regs_t *spectral_matrices_regs = NULL; | |
14 |
|
14 | |||
15 | // APB CONFIGURATION REGISTERS |
|
15 | // APB CONFIGURATION REGISTERS | |
16 | time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT; |
|
16 | time_management_regs_t *time_management_regs = (time_management_regs_t*) REGS_ADDR_TIME_MANAGEMENT; | |
17 | waveform_picker_regs_t *waveform_picker_regs = (waveform_picker_regs_t*) REGS_ADDR_WAVEFORM_PICKER; |
|
17 | waveform_picker_regs_t *waveform_picker_regs = (waveform_picker_regs_t*) REGS_ADDR_WAVEFORM_PICKER; | |
18 | gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER; |
|
18 | gptimer_regs_t *gptimer_regs = (gptimer_regs_t *) REGS_ADDR_GPTIMER; | |
19 |
|
19 | |||
20 | // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes |
|
20 | // WAVEFORMS GLOBAL VARIABLES // 2048 * 3 * 4 + 2 * 4 = 24576 + 8 bytes | |
21 | volatile int wf_snap_f0[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; |
|
21 | volatile int wf_snap_f0[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; | |
22 | volatile int wf_snap_f1[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; |
|
22 | volatile int wf_snap_f1[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; | |
23 | volatile int wf_snap_f1_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; |
|
23 | volatile int wf_snap_f1_bis[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; | |
24 | volatile int wf_snap_f2[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; |
|
24 | volatile int wf_snap_f2[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; | |
25 | volatile int wf_cont_f3[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; |
|
25 | volatile int wf_cont_f3[ NB_SAMPLES_PER_SNAPSHOT * NB_WORDS_SWF_BLK + TIME_OFFSET]; | |
26 |
|
26 | |||
27 | // SPECTRAL MATRICES GLOBAL VARIABLES |
|
27 | // SPECTRAL MATRICES GLOBAL VARIABLES | |
28 | volatile int spec_mat_f0_a[ TOTAL_SIZE_SPEC_MAT ]; |
|
28 | volatile int spec_mat_f0_a[ TOTAL_SIZE_SPEC_MAT ]; | |
29 | volatile int spec_mat_f0_b[ TOTAL_SIZE_SPEC_MAT ]; |
|
29 | volatile int spec_mat_f0_b[ TOTAL_SIZE_SPEC_MAT ]; | |
30 | volatile int spec_mat_f0_c[ TOTAL_SIZE_SPEC_MAT ]; |
|
30 | volatile int spec_mat_f0_c[ TOTAL_SIZE_SPEC_MAT ]; | |
31 | volatile int spec_mat_f0_d[ TOTAL_SIZE_SPEC_MAT ]; |
|
31 | volatile int spec_mat_f0_d[ TOTAL_SIZE_SPEC_MAT ]; | |
32 | volatile int spec_mat_f0_e[ TOTAL_SIZE_SPEC_MAT ]; |
|
32 | volatile int spec_mat_f0_e[ TOTAL_SIZE_SPEC_MAT ]; | |
33 | volatile int spec_mat_f0_f[ TOTAL_SIZE_SPEC_MAT ]; |
|
33 | volatile int spec_mat_f0_f[ TOTAL_SIZE_SPEC_MAT ]; | |
34 | volatile int spec_mat_f0_g[ TOTAL_SIZE_SPEC_MAT ]; |
|
34 | volatile int spec_mat_f0_g[ TOTAL_SIZE_SPEC_MAT ]; | |
35 | volatile int spec_mat_f0_h[ TOTAL_SIZE_SPEC_MAT ]; |
|
35 | volatile int spec_mat_f0_h[ TOTAL_SIZE_SPEC_MAT ]; | |
36 | // |
|
36 | // | |
37 | float averaged_spec_mat_f0[ TOTAL_SIZE_SPEC_MAT ]; |
|
37 | float averaged_spec_mat_f0[ TOTAL_SIZE_SPEC_MAT ]; | |
38 | float compressed_spec_mat_f0[ TOTAL_SIZE_COMPRESSED_MATRIX_f0 ]; |
|
38 | float compressed_spec_mat_f0[ TOTAL_SIZE_COMPRESSED_MATRIX_f0 ]; | |
39 |
|
39 | |||
40 | // MODE PARAMETERS |
|
40 | // MODE PARAMETERS | |
|
41 | struct param_common_str param_common; | |||
41 | struct param_norm_str param_norm; |
|
42 | struct param_norm_str param_norm; | |
42 | struct param_burst_str param_burst; |
|
43 | struct param_burst_str param_burst; | |
43 | struct param_sbm1_str param_sbm1; |
|
44 | struct param_sbm1_str param_sbm1; | |
44 | struct param_sbm2_str param_sbm2; |
|
45 | struct param_sbm2_str param_sbm2; | |
45 | unsigned char param_common[2]; |
|
|||
46 |
|
46 | |||
47 | // HK PACKETS |
|
47 | // HK PACKETS | |
48 | Packet_TM_LFR_HK_t housekeeping_packet; |
|
48 | Packet_TM_LFR_HK_t housekeeping_packet; | |
49 | hk_packet_t housekeeping_parameters; |
|
49 | unsigned short sequenceCounters[SEQ_CNT_NB_PID][SEQ_CNT_NB_CAT][SEQ_CNT_NB_DEST_ID]; | |
50 |
|
50 | |||
51 | // BASIC PARAMETERS GLOBAL VARIABLES |
|
51 | // BASIC PARAMETERS GLOBAL VARIABLES | |
52 | unsigned char LFR_BP1_F0[ NB_BINS_COMPRESSED_MATRIX_f0 * 9 ]; |
|
52 | unsigned char LFR_BP1_F0[ NB_BINS_COMPRESSED_MATRIX_f0 * 9 ]; | |
53 | BP1_t data_BP1[ NB_BINS_COMPRESSED_MATRIX_f0 ]; |
|
53 | BP1_t data_BP1[ NB_BINS_COMPRESSED_MATRIX_f0 ]; | |
54 |
|
54 |
@@ -1,414 +1,448 | |||||
1 | //************************* |
|
1 | //************************* | |
2 | // GPL reminder to be added |
|
2 | // GPL reminder to be added | |
3 | //************************* |
|
3 | //************************* | |
4 |
|
4 | |||
5 | #include <rtems.h> |
|
5 | #include <rtems.h> | |
6 |
|
6 | |||
7 | /* configuration information */ |
|
7 | /* configuration information */ | |
8 |
|
8 | |||
9 | #define CONFIGURE_INIT |
|
9 | #define CONFIGURE_INIT | |
10 |
|
10 | |||
11 | #include <bsp.h> /* for device driver prototypes */ |
|
11 | #include <bsp.h> /* for device driver prototypes */ | |
12 |
|
12 | |||
13 | /* configuration information */ |
|
13 | /* configuration information */ | |
14 |
|
14 | |||
15 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
|
15 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER | |
16 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
|
16 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER | |
17 |
|
17 | |||
18 | #define CONFIGURE_MAXIMUM_TASKS 15 |
|
18 | #define CONFIGURE_MAXIMUM_TASKS 15 | |
19 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
|
19 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE | |
20 | #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) |
|
20 | #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) | |
21 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32 |
|
21 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32 | |
22 | #define CONFIGURE_INIT_TASK_PRIORITY 100 |
|
22 | #define CONFIGURE_INIT_TASK_PRIORITY 100 | |
23 | #define CONFIGURE_MAXIMUM_DRIVERS 16 |
|
23 | #define CONFIGURE_MAXIMUM_DRIVERS 16 | |
24 | #define CONFIGURE_MAXIMUM_PERIODS 5 |
|
24 | #define CONFIGURE_MAXIMUM_PERIODS 5 | |
25 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 |
|
25 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 | |
26 |
|
26 | |||
27 | #include <rtems/confdefs.h> |
|
27 | #include <rtems/confdefs.h> | |
28 |
|
28 | |||
29 | /* If --drvmgr was enabled during the configuration of the RTEMS kernel */ |
|
29 | /* If --drvmgr was enabled during the configuration of the RTEMS kernel */ | |
30 | #ifdef RTEMS_DRVMGR_STARTUP |
|
30 | #ifdef RTEMS_DRVMGR_STARTUP | |
31 | #ifdef LEON3 |
|
31 | #ifdef LEON3 | |
32 | /* Add Timer and UART Driver */ |
|
32 | /* Add Timer and UART Driver */ | |
33 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
|
33 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER | |
34 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER |
|
34 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER | |
35 | #endif |
|
35 | #endif | |
36 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
|
36 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER | |
37 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART |
|
37 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART | |
38 | #endif |
|
38 | #endif | |
39 | #endif |
|
39 | #endif | |
40 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */ |
|
40 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */ | |
41 | #include <drvmgr/drvmgr_confdefs.h> |
|
41 | #include <drvmgr/drvmgr_confdefs.h> | |
42 | #endif |
|
42 | #endif | |
43 |
|
43 | |||
44 | #include <fsw_init.h> |
|
44 | #include <fsw_init.h> | |
45 | #include <fsw_config.c> |
|
45 | #include <fsw_config.c> | |
46 |
|
46 | |||
47 | char *lstates[6] = {"Error-reset", |
|
47 | char *lstates[6] = {"Error-reset", | |
48 | "Error-wait", |
|
48 | "Error-wait", | |
49 | "Ready", |
|
49 | "Ready", | |
50 | "Started", |
|
50 | "Started", | |
51 | "Connecting", |
|
51 | "Connecting", | |
52 | "Run" |
|
52 | "Run" | |
53 | }; |
|
53 | }; | |
54 |
|
54 | |||
55 | rtems_task Init( rtems_task_argument ignored ) |
|
55 | rtems_task Init( rtems_task_argument ignored ) | |
56 | { |
|
56 | { | |
57 | rtems_status_code status; |
|
57 | rtems_status_code status; | |
58 | rtems_isr_entry old_isr_handler; |
|
58 | rtems_isr_entry old_isr_handler; | |
59 |
|
59 | |||
60 | PRINTF("\n\n\n\n\n") |
|
60 | PRINTF("\n\n\n\n\n") | |
61 | PRINTF("***************************\n") |
|
61 | PRINTF("***************************\n") | |
62 | PRINTF("** START Flight Software **\n") |
|
62 | PRINTF("** START Flight Software **\n") | |
63 | PRINTF("***************************\n") |
|
63 | PRINTF("***************************\n") | |
64 | PRINTF("\n\n") |
|
64 | PRINTF("\n\n") | |
65 |
|
65 | |||
66 | //send_console_outputs_on_serial_port(); |
|
66 | //send_console_outputs_on_serial_port(); | |
67 | set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE); |
|
67 | set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE); | |
68 |
|
68 | |||
69 | initLookUpTableForCRC(); // in tc_handler.h |
|
69 | initLookUpTableForCRC(); // in tc_handler.h | |
70 | init_default_mode_parameters(); |
|
70 | init_default_mode_parameters(); | |
|
71 | init_housekeeping_parameters(); | |||
71 | create_message_queue(); |
|
72 | create_message_queue(); | |
72 |
|
73 | |||
73 | create_names(); |
|
74 | create_names(); | |
74 | create_all_tasks(); |
|
75 | create_all_tasks(); | |
75 | start_all_tasks(); |
|
76 | start_all_tasks(); | |
76 |
|
77 | |||
77 | grspw_timecode_callback = &timecode_irq_handler; |
|
78 | grspw_timecode_callback = &timecode_irq_handler; | |
78 |
|
79 | |||
79 | configure_spw_link(); |
|
80 | configure_spw_link(); | |
80 |
|
81 | |||
81 | //**************************** |
|
82 | //**************************** | |
82 | // Spectral Matrices simulator |
|
83 | // Spectral Matrices simulator | |
83 | configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR, |
|
84 | configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR, | |
84 | IRQ_SPARC_SM, spectral_matrices_isr ); |
|
85 | IRQ_SPARC_SM, spectral_matrices_isr ); | |
85 |
|
86 | |||
86 | //********** |
|
87 | //********** | |
87 | // WAVEFORMS |
|
88 | // WAVEFORMS | |
88 | // simulator |
|
89 | // simulator | |
89 |
|
90 | |||
90 | #ifdef GSA |
|
91 | #ifdef GSA | |
91 | configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR, CLKDIV_WF_SIMULATOR, |
|
92 | configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_WF_SIMULATOR, CLKDIV_WF_SIMULATOR, | |
92 | IRQ_SPARC_WF, waveforms_simulator_isr ); |
|
93 | IRQ_SPARC_WF, waveforms_simulator_isr ); | |
93 | #else |
|
94 | #else | |
94 | // configure the registers of the waveform picker |
|
95 | // configure the registers of the waveform picker | |
95 | init_waveform_picker_regs(); |
|
96 | init_waveform_picker_regs(); | |
96 | // configure the waveform picker interrupt service routine |
|
97 | // configure the waveform picker interrupt service routine | |
97 | status = rtems_interrupt_catch( waveforms_isr, |
|
98 | status = rtems_interrupt_catch( waveforms_isr, | |
98 | IRQ_SPARC_WAVEFORM_PICKER, |
|
99 | IRQ_SPARC_WAVEFORM_PICKER, | |
99 | &old_isr_handler) ; |
|
100 | &old_isr_handler) ; | |
100 | LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
101 | LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); | |
101 | #endif |
|
102 | #endif | |
102 |
|
103 | |||
103 | //********** |
|
104 | //********** | |
104 |
|
105 | |||
105 | //***************************************** |
|
106 | //***************************************** | |
106 | // irq handling of the time management unit |
|
107 | // irq handling of the time management unit | |
107 | status = rtems_interrupt_catch( commutation_isr1, |
|
108 | status = rtems_interrupt_catch( commutation_isr1, | |
108 | IRQ_SPARC_TIME1, |
|
109 | IRQ_SPARC_TIME1, | |
109 | &old_isr_handler) ; // see sparcv8.pdf p.76 for interrupt levels |
|
110 | &old_isr_handler) ; // see sparcv8.pdf p.76 for interrupt levels | |
110 | if (status==RTEMS_SUCCESSFUL) { |
|
111 | if (status==RTEMS_SUCCESSFUL) { | |
111 | PRINTF("OK *** commutation_isr1 *** rtems_interrupt_catch successfullly configured\n") |
|
112 | PRINTF("OK *** commutation_isr1 *** rtems_interrupt_catch successfullly configured\n") | |
112 | } |
|
113 | } | |
113 |
|
114 | |||
114 | status = rtems_interrupt_catch( commutation_isr2, |
|
115 | status = rtems_interrupt_catch( commutation_isr2, | |
115 | IRQ_SPARC_TIME2, |
|
116 | IRQ_SPARC_TIME2, | |
116 | &old_isr_handler) ; // see sparcv8.pdf p.76 for interrupt levels |
|
117 | &old_isr_handler) ; // see sparcv8.pdf p.76 for interrupt levels | |
117 | if (status==RTEMS_SUCCESSFUL) { |
|
118 | if (status==RTEMS_SUCCESSFUL) { | |
118 | PRINTF("OK *** commutation_isr2 *** rtems_interrupt_catch successfullly configured\n") |
|
119 | PRINTF("OK *** commutation_isr2 *** rtems_interrupt_catch successfullly configured\n") | |
119 | } |
|
120 | } | |
120 |
|
121 | |||
121 | LEON_Unmask_interrupt( IRQ_TIME1 ); |
|
122 | LEON_Unmask_interrupt( IRQ_TIME1 ); | |
122 | LEON_Unmask_interrupt( IRQ_TIME2 ); |
|
123 | LEON_Unmask_interrupt( IRQ_TIME2 ); | |
123 |
|
124 | |||
124 | #ifdef GSA |
|
125 | #ifdef GSA | |
125 | //if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
126 | //if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
126 | // printf("in INIT *** Error sending event to WFRM\n"); |
|
127 | // printf("in INIT *** Error sending event to WFRM\n"); | |
127 | //} |
|
128 | //} | |
128 | #endif |
|
129 | #endif | |
129 |
|
130 | |||
130 | status = rtems_task_delete(RTEMS_SELF); |
|
131 | status = rtems_task_delete(RTEMS_SELF); | |
131 |
|
132 | |||
132 | } |
|
133 | } | |
133 |
|
134 | |||
134 | rtems_task spiq_task(rtems_task_argument unused) |
|
135 | rtems_task spiq_task(rtems_task_argument unused) | |
135 | { |
|
136 | { | |
136 | rtems_event_set event_out; |
|
137 | rtems_event_set event_out; | |
137 | rtems_status_code status; |
|
138 | rtems_status_code status; | |
138 |
|
139 | |||
139 | while(true){ |
|
140 | while(true){ | |
140 | PRINTF("in SPIQ *** Waiting for SPW_LINKERR_EVENT\n") |
|
141 | PRINTF("in SPIQ *** Waiting for SPW_LINKERR_EVENT\n") | |
141 | rtems_event_receive(SPW_LINKERR_EVENT, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an SPW_LINKERR_EVENT |
|
142 | rtems_event_receive(SPW_LINKERR_EVENT, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an SPW_LINKERR_EVENT | |
142 |
|
143 | |||
143 | if (rtems_task_suspend(Task_id[TASKID_RECV])!=RTEMS_SUCCESSFUL) { // suspend RECV task |
|
144 | if (rtems_task_suspend(Task_id[TASKID_RECV])!=RTEMS_SUCCESSFUL) { // suspend RECV task | |
144 | PRINTF("in SPIQ *** Error suspending RECV Task\n") |
|
145 | PRINTF("in SPIQ *** Error suspending RECV Task\n") | |
145 | } |
|
146 | } | |
146 | if (rtems_task_suspend(Task_id[TASKID_HOUS])!=RTEMS_SUCCESSFUL) { // suspend HOUS task |
|
147 | if (rtems_task_suspend(Task_id[TASKID_HOUS])!=RTEMS_SUCCESSFUL) { // suspend HOUS task | |
147 | PRINTF("in SPIQ *** Error suspending HOUS Task\n") |
|
148 | PRINTF("in SPIQ *** Error suspending HOUS Task\n") | |
148 | } |
|
149 | } | |
149 |
|
150 | |||
150 | configure_spw_link(); |
|
151 | configure_spw_link(); | |
151 |
|
152 | |||
152 | status = rtems_task_restart( Task_id[TASKID_HOUS], 1 ); |
|
153 | status = rtems_task_restart( Task_id[TASKID_HOUS], 1 ); | |
153 | if (status!=RTEMS_SUCCESSFUL) { |
|
154 | if (status!=RTEMS_SUCCESSFUL) { | |
154 | PRINTF1("in SPIQ *** Error restarting HOUS Task *** code %d\n", status) |
|
155 | PRINTF1("in SPIQ *** Error restarting HOUS Task *** code %d\n", status) | |
155 | } |
|
156 | } | |
156 |
|
157 | |||
157 | if (rtems_task_restart(Task_id[TASKID_RECV], 1)!=RTEMS_SUCCESSFUL) { // restart RECV task |
|
158 | if (rtems_task_restart(Task_id[TASKID_RECV], 1)!=RTEMS_SUCCESSFUL) { // restart RECV task | |
158 | PRINTF("in SPIQ *** Error restarting RECV Task\n") |
|
159 | PRINTF("in SPIQ *** Error restarting RECV Task\n") | |
159 | } |
|
160 | } | |
160 | } |
|
161 | } | |
161 | } |
|
162 | } | |
162 |
|
163 | |||
163 | void init_default_mode_parameters() |
|
164 | void init_default_mode_parameters(void) | |
164 | { |
|
165 | { | |
165 | // COMMON PARAMETERS |
|
166 | // COMMON PARAMETERS | |
166 |
param_common |
|
167 | param_common.sy_lfr_common0 = 0x00; | |
167 |
param_common |
|
168 | param_common.sy_lfr_common1 = 0x10; // default value 0 0 0 1 0 0 0 0 | |
168 | // NORMAL MODE |
|
169 | // NORMAL MODE | |
169 | param_norm.sy_lfr_n_swf_l = 2048; // nb sample |
|
170 | param_norm.sy_lfr_n_swf_l = 2048; // nb sample | |
170 | param_norm.sy_lfr_n_swf_p = 300; // sec |
|
171 | param_norm.sy_lfr_n_swf_p = 300; // sec | |
171 | param_norm.sy_lfr_n_asm_p = 3600; // sec |
|
172 | param_norm.sy_lfr_n_asm_p = 3600; // sec | |
172 | param_norm.sy_lfr_n_bp_p0 = 4; // sec |
|
173 | param_norm.sy_lfr_n_bp_p0 = 4; // sec | |
173 | param_norm.sy_lfr_n_bp_p1 = 20; // sec |
|
174 | param_norm.sy_lfr_n_bp_p1 = 20; // sec | |
174 | // BURST MODE |
|
175 | // BURST MODE | |
175 | param_burst.sy_lfr_b_bp_p0 = 1; // sec |
|
176 | param_burst.sy_lfr_b_bp_p0 = 1; // sec | |
176 | param_burst.sy_lfr_b_bp_p1 = 5; // sec |
|
177 | param_burst.sy_lfr_b_bp_p1 = 5; // sec | |
177 | // SBM1 MODE |
|
178 | // SBM1 MODE | |
178 | param_sbm1.sy_lfr_s1_bp_p0 = 1; // sec |
|
179 | param_sbm1.sy_lfr_s1_bp_p0 = 1; // sec | |
179 | param_sbm1.sy_lfr_s1_bp_p1 = 1; // sec |
|
180 | param_sbm1.sy_lfr_s1_bp_p1 = 1; // sec | |
180 | // SBM2 MODE |
|
181 | // SBM2 MODE | |
181 | param_sbm2.sy_lfr_s2_bp_p0 = 1; // sec |
|
182 | param_sbm2.sy_lfr_s2_bp_p0 = 1; // sec | |
182 | param_sbm2.sy_lfr_s2_bp_p0 = 5; // sec |
|
183 | param_sbm2.sy_lfr_s2_bp_p0 = 5; // sec | |
183 | } |
|
184 | } | |
184 |
|
185 | |||
|
186 | void init_housekeeping_parameters(void) | |||
|
187 | { | |||
|
188 | unsigned int i = 0; | |||
|
189 | unsigned int j = 0; | |||
|
190 | unsigned int k = 0; | |||
|
191 | char *parameters; | |||
|
192 | ||||
|
193 | parameters = (char*) &housekeeping_packet.lfr_status_word; | |||
|
194 | for(i = 0; i< SIZE_HK_PARAMETERS; i++) | |||
|
195 | { | |||
|
196 | parameters[i] = 0x00; | |||
|
197 | } | |||
|
198 | // init status word | |||
|
199 | housekeeping_packet.lfr_status_word[0] = 0x00; | |||
|
200 | housekeeping_packet.lfr_status_word[1] = 0x00; | |||
|
201 | // init software version | |||
|
202 | housekeeping_packet.lfr_sw_version[0] = SW_VERSION_N1; | |||
|
203 | housekeeping_packet.lfr_sw_version[1] = SW_VERSION_N2; | |||
|
204 | housekeeping_packet.lfr_sw_version[2] = SW_VERSION_N3; | |||
|
205 | housekeeping_packet.lfr_sw_version[3] = SW_VERSION_N4; | |||
|
206 | // init sequence counters | |||
|
207 | for (i = 0; i<SEQ_CNT_NB_PID; i++) | |||
|
208 | { | |||
|
209 | for(j = 0; j<SEQ_CNT_NB_CAT; j++) | |||
|
210 | { | |||
|
211 | for(k = 0; k<SEQ_CNT_NB_DEST_ID; k++) | |||
|
212 | { | |||
|
213 | sequenceCounters[i][j][k] = 0x00; | |||
|
214 | } | |||
|
215 | } | |||
|
216 | } | |||
|
217 | } | |||
|
218 | ||||
185 | int create_names( void ) |
|
219 | int create_names( void ) | |
186 | { |
|
220 | { | |
187 | // task names |
|
221 | // task names | |
188 | Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' ); |
|
222 | Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' ); | |
189 | Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' ); |
|
223 | Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' ); | |
190 | Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' ); |
|
224 | Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' ); | |
191 | Task_name[TASKID_SMIQ] = rtems_build_name( 'S', 'M', 'I', 'Q' ); |
|
225 | Task_name[TASKID_SMIQ] = rtems_build_name( 'S', 'M', 'I', 'Q' ); | |
192 | Task_name[TASKID_STAT] = rtems_build_name( 'S', 'T', 'A', 'T' ); |
|
226 | Task_name[TASKID_STAT] = rtems_build_name( 'S', 'T', 'A', 'T' ); | |
193 | Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' ); |
|
227 | Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' ); | |
194 | Task_name[TASKID_BPF0] = rtems_build_name( 'B', 'P', 'F', '0' ); |
|
228 | Task_name[TASKID_BPF0] = rtems_build_name( 'B', 'P', 'F', '0' ); | |
195 | Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' ); |
|
229 | Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' ); | |
196 | Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' ); |
|
230 | Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' ); | |
197 | Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' ); |
|
231 | Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' ); | |
198 |
|
232 | |||
199 | // rate monotonic period name |
|
233 | // rate monotonic period name | |
200 | HK_name = rtems_build_name( 'H', 'O', 'U', 'S' ); |
|
234 | HK_name = rtems_build_name( 'H', 'O', 'U', 'S' ); | |
201 |
|
235 | |||
202 | return 0; |
|
236 | return 0; | |
203 | } |
|
237 | } | |
204 |
|
238 | |||
205 | int create_all_tasks( void ) |
|
239 | int create_all_tasks( void ) | |
206 | { |
|
240 | { | |
207 | rtems_status_code status; |
|
241 | rtems_status_code status; | |
208 |
|
242 | |||
209 | // RECV |
|
243 | // RECV | |
210 | status = rtems_task_create( |
|
244 | status = rtems_task_create( | |
211 | Task_name[TASKID_RECV], 200, RTEMS_MINIMUM_STACK_SIZE * 2, |
|
245 | Task_name[TASKID_RECV], 200, RTEMS_MINIMUM_STACK_SIZE * 2, | |
212 | RTEMS_DEFAULT_MODES, |
|
246 | RTEMS_DEFAULT_MODES, | |
213 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV] |
|
247 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV] | |
214 | ); |
|
248 | ); | |
215 | // ACTN |
|
249 | // ACTN | |
216 | status = rtems_task_create( |
|
250 | status = rtems_task_create( | |
217 | Task_name[TASKID_ACTN], 50, RTEMS_MINIMUM_STACK_SIZE * 2, |
|
251 | Task_name[TASKID_ACTN], 50, RTEMS_MINIMUM_STACK_SIZE * 2, | |
218 | RTEMS_DEFAULT_MODES, |
|
252 | RTEMS_DEFAULT_MODES, | |
219 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_ACTN] |
|
253 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_ACTN] | |
220 | ); |
|
254 | ); | |
221 | // SPIQ |
|
255 | // SPIQ | |
222 | status = rtems_task_create( |
|
256 | status = rtems_task_create( | |
223 | Task_name[TASKID_SPIQ], 5, RTEMS_MINIMUM_STACK_SIZE * 2, |
|
257 | Task_name[TASKID_SPIQ], 5, RTEMS_MINIMUM_STACK_SIZE * 2, | |
224 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
258 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
225 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ] |
|
259 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ] | |
226 | ); |
|
260 | ); | |
227 | // SMIQ |
|
261 | // SMIQ | |
228 | status = rtems_task_create( |
|
262 | status = rtems_task_create( | |
229 | Task_name[TASKID_SMIQ], 10, RTEMS_MINIMUM_STACK_SIZE * 2, |
|
263 | Task_name[TASKID_SMIQ], 10, RTEMS_MINIMUM_STACK_SIZE * 2, | |
230 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
264 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
231 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SMIQ] |
|
265 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SMIQ] | |
232 | ); |
|
266 | ); | |
233 | // STAT |
|
267 | // STAT | |
234 | status = rtems_task_create( |
|
268 | status = rtems_task_create( | |
235 | Task_name[TASKID_STAT], 150, RTEMS_MINIMUM_STACK_SIZE * 2, |
|
269 | Task_name[TASKID_STAT], 150, RTEMS_MINIMUM_STACK_SIZE * 2, | |
236 | RTEMS_DEFAULT_MODES, |
|
270 | RTEMS_DEFAULT_MODES, | |
237 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_STAT] |
|
271 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_STAT] | |
238 | ); |
|
272 | ); | |
239 | // AVF0 |
|
273 | // AVF0 | |
240 | status = rtems_task_create( |
|
274 | status = rtems_task_create( | |
241 | Task_name[TASKID_AVF0], 50, RTEMS_MINIMUM_STACK_SIZE * 2, |
|
275 | Task_name[TASKID_AVF0], 50, RTEMS_MINIMUM_STACK_SIZE * 2, | |
242 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
276 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
243 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0] |
|
277 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0] | |
244 | ); |
|
278 | ); | |
245 | // BPF0 |
|
279 | // BPF0 | |
246 | status = rtems_task_create( |
|
280 | status = rtems_task_create( | |
247 | Task_name[TASKID_BPF0], 50, RTEMS_MINIMUM_STACK_SIZE * 2, |
|
281 | Task_name[TASKID_BPF0], 50, RTEMS_MINIMUM_STACK_SIZE * 2, | |
248 | RTEMS_DEFAULT_MODES, |
|
282 | RTEMS_DEFAULT_MODES, | |
249 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_BPF0] |
|
283 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_BPF0] | |
250 | ); |
|
284 | ); | |
251 | // WFRM |
|
285 | // WFRM | |
252 | status = rtems_task_create( |
|
286 | status = rtems_task_create( | |
253 | Task_name[TASKID_WFRM], 100, RTEMS_MINIMUM_STACK_SIZE * 2, |
|
287 | Task_name[TASKID_WFRM], 100, RTEMS_MINIMUM_STACK_SIZE * 2, | |
254 | RTEMS_DEFAULT_MODES, |
|
288 | RTEMS_DEFAULT_MODES, | |
255 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_WFRM] |
|
289 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_WFRM] | |
256 | ); |
|
290 | ); | |
257 | // DUMB |
|
291 | // DUMB | |
258 | status = rtems_task_create( |
|
292 | status = rtems_task_create( | |
259 | Task_name[TASKID_DUMB], 200, RTEMS_MINIMUM_STACK_SIZE * 2, |
|
293 | Task_name[TASKID_DUMB], 200, RTEMS_MINIMUM_STACK_SIZE * 2, | |
260 | RTEMS_DEFAULT_MODES, |
|
294 | RTEMS_DEFAULT_MODES, | |
261 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_DUMB] |
|
295 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_DUMB] | |
262 | ); |
|
296 | ); | |
263 | // HOUS |
|
297 | // HOUS | |
264 | status = rtems_task_create( |
|
298 | status = rtems_task_create( | |
265 | Task_name[TASKID_HOUS], 199, RTEMS_MINIMUM_STACK_SIZE * 2, |
|
299 | Task_name[TASKID_HOUS], 199, RTEMS_MINIMUM_STACK_SIZE * 2, | |
266 | RTEMS_DEFAULT_MODES, |
|
300 | RTEMS_DEFAULT_MODES, | |
267 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS] |
|
301 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS] | |
268 | ); |
|
302 | ); | |
269 |
|
303 | |||
270 | return 0; |
|
304 | return 0; | |
271 | } |
|
305 | } | |
272 |
|
306 | |||
273 | int start_all_tasks( void ) |
|
307 | int start_all_tasks( void ) | |
274 | { |
|
308 | { | |
275 | rtems_status_code status; |
|
309 | rtems_status_code status; | |
276 |
|
310 | |||
277 | status = rtems_task_start( Task_id[TASKID_SPIQ], spiq_task, 1 ); |
|
311 | status = rtems_task_start( Task_id[TASKID_SPIQ], spiq_task, 1 ); | |
278 | if (status!=RTEMS_SUCCESSFUL) { |
|
312 | if (status!=RTEMS_SUCCESSFUL) { | |
279 | PRINTF("In INIT *** Error starting TASK_SPIQ\n") |
|
313 | PRINTF("In INIT *** Error starting TASK_SPIQ\n") | |
280 | } |
|
314 | } | |
281 |
|
315 | |||
282 | status = rtems_task_start( Task_id[TASKID_RECV], recv_task, 1 ); |
|
316 | status = rtems_task_start( Task_id[TASKID_RECV], recv_task, 1 ); | |
283 | if (status!=RTEMS_SUCCESSFUL) { |
|
317 | if (status!=RTEMS_SUCCESSFUL) { | |
284 | PRINTF("In INIT *** Error starting TASK_RECV\n") |
|
318 | PRINTF("In INIT *** Error starting TASK_RECV\n") | |
285 | } |
|
319 | } | |
286 |
|
320 | |||
287 | status = rtems_task_start( Task_id[TASKID_ACTN], actn_task, 1 ); |
|
321 | status = rtems_task_start( Task_id[TASKID_ACTN], actn_task, 1 ); | |
288 | if (status!=RTEMS_SUCCESSFUL) { |
|
322 | if (status!=RTEMS_SUCCESSFUL) { | |
289 | PRINTF("In INIT *** Error starting TASK_ACTN\n") |
|
323 | PRINTF("In INIT *** Error starting TASK_ACTN\n") | |
290 | } |
|
324 | } | |
291 |
|
325 | |||
292 | status = rtems_task_start( Task_id[TASKID_SMIQ], smiq_task, 1 ); |
|
326 | status = rtems_task_start( Task_id[TASKID_SMIQ], smiq_task, 1 ); | |
293 | if (status!=RTEMS_SUCCESSFUL) { |
|
327 | if (status!=RTEMS_SUCCESSFUL) { | |
294 | PRINTF("In INIT *** Error starting TASK_BPPR\n") |
|
328 | PRINTF("In INIT *** Error starting TASK_BPPR\n") | |
295 | } |
|
329 | } | |
296 |
|
330 | |||
297 | status = rtems_task_start( Task_id[TASKID_STAT], stat_task, 1 ); |
|
331 | status = rtems_task_start( Task_id[TASKID_STAT], stat_task, 1 ); | |
298 | if (status!=RTEMS_SUCCESSFUL) { |
|
332 | if (status!=RTEMS_SUCCESSFUL) { | |
299 | PRINTF("In INIT *** Error starting TASK_STAT\n") |
|
333 | PRINTF("In INIT *** Error starting TASK_STAT\n") | |
300 | } |
|
334 | } | |
301 |
|
335 | |||
302 | status = rtems_task_start( Task_id[TASKID_AVF0], avf0_task, 1 ); |
|
336 | status = rtems_task_start( Task_id[TASKID_AVF0], avf0_task, 1 ); | |
303 | if (status!=RTEMS_SUCCESSFUL) { |
|
337 | if (status!=RTEMS_SUCCESSFUL) { | |
304 | PRINTF("In INIT *** Error starting TASK_AVF0\n") |
|
338 | PRINTF("In INIT *** Error starting TASK_AVF0\n") | |
305 | } |
|
339 | } | |
306 |
|
340 | |||
307 | status = rtems_task_start( Task_id[TASKID_BPF0], bpf0_task, 1 ); |
|
341 | status = rtems_task_start( Task_id[TASKID_BPF0], bpf0_task, 1 ); | |
308 | if (status!=RTEMS_SUCCESSFUL) { |
|
342 | if (status!=RTEMS_SUCCESSFUL) { | |
309 | PRINTF("In INIT *** Error starting TASK_BPF0\n") |
|
343 | PRINTF("In INIT *** Error starting TASK_BPF0\n") | |
310 | } |
|
344 | } | |
311 |
|
345 | |||
312 | status = rtems_task_start( Task_id[TASKID_WFRM], wfrm_task, 1 ); |
|
346 | status = rtems_task_start( Task_id[TASKID_WFRM], wfrm_task, 1 ); | |
313 | if (status!=RTEMS_SUCCESSFUL) { |
|
347 | if (status!=RTEMS_SUCCESSFUL) { | |
314 | PRINTF("In INIT *** Error starting TASK_WFRM\n") |
|
348 | PRINTF("In INIT *** Error starting TASK_WFRM\n") | |
315 | } |
|
349 | } | |
316 |
|
350 | |||
317 | status = rtems_task_start( Task_id[TASKID_DUMB], dumb_task, 1 ); |
|
351 | status = rtems_task_start( Task_id[TASKID_DUMB], dumb_task, 1 ); | |
318 | if (status!=RTEMS_SUCCESSFUL) { |
|
352 | if (status!=RTEMS_SUCCESSFUL) { | |
319 | PRINTF("In INIT *** Error starting TASK_DUMB\n") |
|
353 | PRINTF("In INIT *** Error starting TASK_DUMB\n") | |
320 | } |
|
354 | } | |
321 |
|
355 | |||
322 | status = rtems_task_start( Task_id[TASKID_HOUS], hous_task, 1 ); |
|
356 | status = rtems_task_start( Task_id[TASKID_HOUS], hous_task, 1 ); | |
323 | if (status!=RTEMS_SUCCESSFUL) { |
|
357 | if (status!=RTEMS_SUCCESSFUL) { | |
324 | PRINTF("In INIT *** Error starting TASK_HOUS\n") |
|
358 | PRINTF("In INIT *** Error starting TASK_HOUS\n") | |
325 | } |
|
359 | } | |
326 |
|
360 | |||
327 | return 0; |
|
361 | return 0; | |
328 | } |
|
362 | } | |
329 |
|
363 | |||
330 | int configure_spw_link( void ) |
|
364 | int configure_spw_link( void ) | |
331 | { |
|
365 | { | |
332 | rtems_status_code status; |
|
366 | rtems_status_code status; | |
333 |
|
367 | |||
334 | close(fdSPW); // close the device if it is already open |
|
368 | close(fdSPW); // close the device if it is already open | |
335 | PRINTF("OK *** in configure_spw_link *** try to open "GRSPW_DEVICE_NAME"\n") |
|
369 | PRINTF("OK *** in configure_spw_link *** try to open "GRSPW_DEVICE_NAME"\n") | |
336 | fdSPW = open(GRSPW_DEVICE_NAME, O_RDWR); // open the device. the open call reset the hardware |
|
370 | fdSPW = open(GRSPW_DEVICE_NAME, O_RDWR); // open the device. the open call reset the hardware | |
337 | if (fdSPW<0) PRINTF("ERR *** in configure_spw_link *** Error opening"GRSPW_DEVICE_NAME"\n") |
|
371 | if (fdSPW<0) PRINTF("ERR *** in configure_spw_link *** Error opening"GRSPW_DEVICE_NAME"\n") | |
338 | while(ioctl(fdSPW, SPACEWIRE_IOCTRL_START, 0) != RTEMS_SUCCESSFUL){ |
|
372 | while(ioctl(fdSPW, SPACEWIRE_IOCTRL_START, 0) != RTEMS_SUCCESSFUL){ | |
339 | PRINTF(".") |
|
373 | PRINTF(".") | |
340 | fflush(stdout); |
|
374 | fflush(stdout); | |
341 | close(fdSPW); // close the device |
|
375 | close(fdSPW); // close the device | |
342 | fdSPW = open(GRSPW_DEVICE_NAME, O_RDWR); // open the device. the open call reset the hardware |
|
376 | fdSPW = open(GRSPW_DEVICE_NAME, O_RDWR); // open the device. the open call reset the hardware | |
343 | if (fdSPW<0) PRINTF("ERR *** In configure_spw_link *** Error opening"GRSPW_DEVICE_NAME"\n") |
|
377 | if (fdSPW<0) PRINTF("ERR *** In configure_spw_link *** Error opening"GRSPW_DEVICE_NAME"\n") | |
344 | rtems_task_wake_after(100); |
|
378 | rtems_task_wake_after(100); | |
345 | } |
|
379 | } | |
346 |
|
380 | |||
347 | PRINTF("OK *** In configure_spw_link *** "GRSPW_DEVICE_NAME" opened and started successfully\n") |
|
381 | PRINTF("OK *** In configure_spw_link *** "GRSPW_DEVICE_NAME" opened and started successfully\n") | |
348 |
|
382 | |||
349 | configure_spacewire_set_NP(1, REGS_ADDR_GRSPW); // No Port force |
|
383 | configure_spacewire_set_NP(1, REGS_ADDR_GRSPW); // No Port force | |
350 | configure_spacewire_set_RE(1, REGS_ADDR_GRSPW); // the dedicated call seems to break the no port force configuration |
|
384 | configure_spacewire_set_RE(1, REGS_ADDR_GRSPW); // the dedicated call seems to break the no port force configuration | |
351 |
|
385 | |||
352 | status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_RXBLOCK, 1); // sets the blocking mode for reception |
|
386 | status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_RXBLOCK, 1); // sets the blocking mode for reception | |
353 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_RXBLOCK\n") |
|
387 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_RXBLOCK\n") | |
354 | // |
|
388 | // | |
355 | status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_EVENT_ID, Task_id[TASKID_SPIQ]); // sets the task ID to which an event is sent when a |
|
389 | status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_EVENT_ID, Task_id[TASKID_SPIQ]); // sets the task ID to which an event is sent when a | |
356 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_EVENT_ID\n") // link-error interrupt occurs |
|
390 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_EVENT_ID\n") // link-error interrupt occurs | |
357 | // |
|
391 | // | |
358 | status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_DISABLE_ERR, 1); // automatic link-disabling due to link-error interrupts |
|
392 | status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_DISABLE_ERR, 1); // automatic link-disabling due to link-error interrupts | |
359 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_DISABLE_ERR\n") |
|
393 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_DISABLE_ERR\n") | |
360 | // |
|
394 | // | |
361 | status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_LINK_ERR_IRQ, 1); // sets the link-error interrupt bit |
|
395 | status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_LINK_ERR_IRQ, 1); // sets the link-error interrupt bit | |
362 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_LINK_ERR_IRQ\n") |
|
396 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_LINK_ERR_IRQ\n") | |
363 | // |
|
397 | // | |
364 | status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_TXBLOCK_ON_FULL, 0); // transmission blocks on full |
|
398 | status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_TXBLOCK_ON_FULL, 0); // transmission blocks on full | |
365 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TXBLOCK_ON_FULL\n") |
|
399 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TXBLOCK_ON_FULL\n") | |
366 | // |
|
400 | // | |
367 | status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_TCODE_CTRL, 0x0909); |
|
401 | status = ioctl(fdSPW, SPACEWIRE_IOCTRL_SET_TCODE_CTRL, 0x0909); | |
368 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TCODE_CTRL,\n") |
|
402 | if (status!=RTEMS_SUCCESSFUL) PRINTF("in SPIQ *** Error SPACEWIRE_IOCTRL_SET_TCODE_CTRL,\n") | |
369 |
|
403 | |||
370 | PRINTF("OK *** in configure_spw_link *** "GRSPW_DEVICE_NAME" configured successfully\n") |
|
404 | PRINTF("OK *** in configure_spw_link *** "GRSPW_DEVICE_NAME" configured successfully\n") | |
371 |
|
405 | |||
372 | return RTEMS_SUCCESSFUL; |
|
406 | return RTEMS_SUCCESSFUL; | |
373 | } |
|
407 | } | |
374 |
|
408 | |||
375 | void configure_spacewire_set_NP(unsigned char val, unsigned int regAddr) // [N]o [P]ort force |
|
409 | void configure_spacewire_set_NP(unsigned char val, unsigned int regAddr) // [N]o [P]ort force | |
376 | { |
|
410 | { | |
377 | unsigned int *spwptr = (unsigned int*) regAddr; |
|
411 | unsigned int *spwptr = (unsigned int*) regAddr; | |
378 |
|
412 | |||
379 | if (val == 1) { |
|
413 | if (val == 1) { | |
380 | *spwptr = *spwptr | 0x00100000; // [NP] set the No port force bit |
|
414 | *spwptr = *spwptr | 0x00100000; // [NP] set the No port force bit | |
381 | } |
|
415 | } | |
382 | if (val== 0) { |
|
416 | if (val== 0) { | |
383 | *spwptr = *spwptr & 0xffdfffff; |
|
417 | *spwptr = *spwptr & 0xffdfffff; | |
384 | } |
|
418 | } | |
385 | } |
|
419 | } | |
386 |
|
420 | |||
387 | void configure_spacewire_set_RE(unsigned char val, unsigned int regAddr) // [R]MAP [E]nable |
|
421 | void configure_spacewire_set_RE(unsigned char val, unsigned int regAddr) // [R]MAP [E]nable | |
388 | { |
|
422 | { | |
389 | unsigned int *spwptr = (unsigned int*) regAddr; |
|
423 | unsigned int *spwptr = (unsigned int*) regAddr; | |
390 |
|
424 | |||
391 | if (val == 1) |
|
425 | if (val == 1) | |
392 | { |
|
426 | { | |
393 | *spwptr = *spwptr | 0x00010000; // [RE] set the RMAP Enable bit |
|
427 | *spwptr = *spwptr | 0x00010000; // [RE] set the RMAP Enable bit | |
394 | } |
|
428 | } | |
395 | if (val== 0) |
|
429 | if (val== 0) | |
396 | { |
|
430 | { | |
397 | *spwptr = *spwptr & 0xfffdffff; |
|
431 | *spwptr = *spwptr & 0xfffdffff; | |
398 | } |
|
432 | } | |
399 | } |
|
433 | } | |
400 |
|
434 | |||
401 | rtems_status_code write_spw(spw_ioctl_pkt_send* spw_ioctl_send) |
|
435 | rtems_status_code write_spw(spw_ioctl_pkt_send* spw_ioctl_send) | |
402 | { |
|
436 | { | |
403 | rtems_status_code status; |
|
437 | rtems_status_code status; | |
404 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_SEND, spw_ioctl_send ); |
|
438 | status = ioctl( fdSPW, SPACEWIRE_IOCTRL_SEND, spw_ioctl_send ); | |
405 | return status; |
|
439 | return status; | |
406 | } |
|
440 | } | |
407 |
|
441 | |||
408 | void timecode_irq_handler(void *pDev, void *regs, int minor, unsigned int tc) |
|
442 | void timecode_irq_handler(void *pDev, void *regs, int minor, unsigned int tc) | |
409 | { |
|
443 | { | |
410 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_1 ) != RTEMS_SUCCESSFUL) { |
|
444 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_1 ) != RTEMS_SUCCESSFUL) { | |
411 | printf("In timecode_irq_handler *** Error sending event to DUMB\n"); |
|
445 | printf("In timecode_irq_handler *** Error sending event to DUMB\n"); | |
412 | } |
|
446 | } | |
413 | } |
|
447 | } | |
414 |
|
448 |
@@ -1,156 +1,156 | |||||
1 | #include <fsw_misc.h> |
|
1 | #include <fsw_misc.h> | |
2 | #include <fsw_params.h> |
|
2 | #include <fsw_params.h> | |
3 |
|
3 | |||
4 | extern rtems_id Task_id[]; /* array of task ids */ |
|
4 | extern rtems_id Task_id[]; /* array of task ids */ | |
5 | extern int fdSPW; |
|
5 | extern int fdSPW; | |
6 | extern TMHeader_t housekeeping_header; |
|
6 | extern TMHeader_t housekeeping_header; | |
7 | extern char housekeeping_data[]; |
|
7 | extern char housekeeping_data[]; | |
8 | extern Packet_TM_LFR_HK_t housekeeping_packet; |
|
8 | extern Packet_TM_LFR_HK_t housekeeping_packet; | |
9 |
|
9 | |||
10 | int configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider, |
|
10 | int configure_timer(gptimer_regs_t *gptimer_regs, unsigned char timer, unsigned int clock_divider, | |
11 | unsigned char interrupt_level, rtems_isr (*timer_isr)() ) |
|
11 | unsigned char interrupt_level, rtems_isr (*timer_isr)() ) | |
12 | { // configure the timer for the waveforms simulation |
|
12 | { // configure the timer for the waveforms simulation | |
13 | rtems_status_code status; |
|
13 | rtems_status_code status; | |
14 | rtems_isr_entry old_isr_handler; |
|
14 | rtems_isr_entry old_isr_handler; | |
15 |
|
15 | |||
16 | status = rtems_interrupt_catch( timer_isr, interrupt_level, &old_isr_handler) ; // see sparcv8.pdf p.76 for interrupt levels |
|
16 | status = rtems_interrupt_catch( timer_isr, interrupt_level, &old_isr_handler) ; // see sparcv8.pdf p.76 for interrupt levels | |
17 | //if (status==RTEMS_SUCCESSFUL) PRINTF("In configure_timer_for_wf_simulation *** rtems_interrupt_catch successfullly configured\n") |
|
17 | //if (status==RTEMS_SUCCESSFUL) PRINTF("In configure_timer_for_wf_simulation *** rtems_interrupt_catch successfullly configured\n") | |
18 |
|
18 | |||
19 | gptimer_regs->timer[timer].reload = clock_divider; // base clock frequency is 1 MHz |
|
19 | gptimer_regs->timer[timer].reload = clock_divider; // base clock frequency is 1 MHz | |
20 | gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000010; // clear pending IRQ if any |
|
20 | gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000010; // clear pending IRQ if any | |
21 | gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000004; // LD load value from the reload register |
|
21 | gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000004; // LD load value from the reload register | |
22 | gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000001; // EN enable the timer |
|
22 | gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000001; // EN enable the timer | |
23 | gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000002; // RS restart |
|
23 | gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000002; // RS restart | |
24 | gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000008; // IE interrupt enable |
|
24 | gptimer_regs->timer[timer].ctrl = gptimer_regs->timer[timer].ctrl | 0x00000008; // IE interrupt enable | |
25 |
|
25 | |||
26 | return 1; |
|
26 | return 1; | |
27 | } |
|
27 | } | |
28 |
|
28 | |||
29 | void print_statistics(spw_stats *stats) |
|
29 | void print_statistics(spw_stats *stats) | |
30 | { |
|
30 | { | |
31 | //printf(" ******** STATISTICS ******** \n"); |
|
31 | //printf(" ******** STATISTICS ******** \n"); | |
32 | printf("Transmit link errors: %i\n", stats->tx_link_err); |
|
32 | printf("Transmit link errors: %i\n", stats->tx_link_err); | |
33 | printf("Receiver RMAP header CRC errors: %i\n", stats->rx_rmap_header_crc_err); |
|
33 | printf("Receiver RMAP header CRC errors: %i\n", stats->rx_rmap_header_crc_err); | |
34 | printf("Receiver RMAP data CRC errors: %i\n", stats->rx_rmap_data_crc_err); |
|
34 | printf("Receiver RMAP data CRC errors: %i\n", stats->rx_rmap_data_crc_err); | |
35 | printf("Receiver EEP errors: %i\n", stats->rx_eep_err); |
|
35 | printf("Receiver EEP errors: %i\n", stats->rx_eep_err); | |
36 | printf("Receiver truncation errors: %i\n", stats->rx_truncated); |
|
36 | printf("Receiver truncation errors: %i\n", stats->rx_truncated); | |
37 | printf("Parity errors: %i\n", stats->parity_err); |
|
37 | printf("Parity errors: %i\n", stats->parity_err); | |
38 | printf("Escape errors: %i\n", stats->escape_err); |
|
38 | printf("Escape errors: %i\n", stats->escape_err); | |
39 | printf("Credit errors: %i\n", stats->credit_err); |
|
39 | printf("Credit errors: %i\n", stats->credit_err); | |
40 | printf("Disconnect errors: %i\n", stats->disconnect_err); |
|
40 | printf("Disconnect errors: %i\n", stats->disconnect_err); | |
41 | printf("Write synchronization errors: %i\n", stats->write_sync_err); |
|
41 | printf("Write synchronization errors: %i\n", stats->write_sync_err); | |
42 | printf("Early EOP/EEP: %i\n", stats->early_ep); |
|
42 | printf("Early EOP/EEP: %i\n", stats->early_ep); | |
43 | printf("Invalid Node Address: %i\n", stats->invalid_address); |
|
43 | printf("Invalid Node Address: %i\n", stats->invalid_address); | |
44 | printf("Packets transmitted: %i\n", stats->packets_sent); |
|
44 | printf("Packets transmitted: %i\n", stats->packets_sent); | |
45 | printf("Packets received: %i\n", stats->packets_received); |
|
45 | printf("Packets received: %i\n", stats->packets_received); | |
46 | } |
|
46 | } | |
47 |
|
47 | |||
48 | int send_console_outputs_on_serial_port( void ) // Send the console outputs on the serial port |
|
48 | int send_console_outputs_on_serial_port( void ) // Send the console outputs on the serial port | |
49 | { |
|
49 | { | |
50 | struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) REGS_ADDR_APBUART; |
|
50 | struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) REGS_ADDR_APBUART; | |
51 |
|
51 | |||
52 | apbuart_regs->ctrl = apbuart_regs->ctrl & APBUART_CTRL_REG_MASK_DB; |
|
52 | apbuart_regs->ctrl = apbuart_regs->ctrl & APBUART_CTRL_REG_MASK_DB; | |
53 | PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n") |
|
53 | PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n") | |
54 |
|
54 | |||
55 | return 0; |
|
55 | return 0; | |
56 | } |
|
56 | } | |
57 |
|
57 | |||
58 | int set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value) |
|
58 | int set_apbuart_scaler_reload_register(unsigned int regs, unsigned int value) | |
59 | { |
|
59 | { | |
60 | struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) regs; |
|
60 | struct apbuart_regs_str *apbuart_regs = (struct apbuart_regs_str *) regs; | |
61 |
|
61 | |||
62 | apbuart_regs->scaler = value; |
|
62 | apbuart_regs->scaler = value; | |
63 | PRINTF1("OK *** COM port scaler reload register set to %x\n", value) |
|
63 | PRINTF1("OK *** COM port scaler reload register set to %x\n", value) | |
64 |
|
64 | |||
65 | return 0; |
|
65 | return 0; | |
66 | } |
|
66 | } | |
67 |
|
67 | |||
68 | //************ |
|
68 | //************ | |
69 | // RTEMS TASKS |
|
69 | // RTEMS TASKS | |
70 |
|
70 | |||
71 | rtems_task stat_task(rtems_task_argument argument) |
|
71 | rtems_task stat_task(rtems_task_argument argument) | |
72 | { |
|
72 | { | |
73 | int i; |
|
73 | int i; | |
74 | int j; |
|
74 | int j; | |
75 | i = 0; |
|
75 | i = 0; | |
76 | j = 0; |
|
76 | j = 0; | |
77 | PRINTF("in STAT *** \n") |
|
77 | PRINTF("in STAT *** \n") | |
78 | while(1){ |
|
78 | while(1){ | |
79 | rtems_task_wake_after(1000); |
|
79 | rtems_task_wake_after(1000); | |
80 | PRINTF1("%d\n", j) |
|
80 | PRINTF1("%d\n", j) | |
81 | if (i == 2) { |
|
81 | if (i == 2) { | |
82 | #ifdef PRINT_TASK_STATISTICS |
|
82 | #ifdef PRINT_TASK_STATISTICS | |
83 | rtems_cpu_usage_report(); |
|
83 | rtems_cpu_usage_report(); | |
84 | rtems_cpu_usage_reset(); |
|
84 | rtems_cpu_usage_reset(); | |
85 | #endif |
|
85 | #endif | |
86 | i = 0; |
|
86 | i = 0; | |
87 | } |
|
87 | } | |
88 | else i++; |
|
88 | else i++; | |
89 | j++; |
|
89 | j++; | |
90 | } |
|
90 | } | |
91 | } |
|
91 | } | |
92 |
|
92 | |||
93 | rtems_task hous_task(rtems_task_argument argument) |
|
93 | rtems_task hous_task(rtems_task_argument argument) | |
94 | { |
|
94 | { | |
95 | int result; |
|
95 | int result; | |
96 | rtems_status_code status; |
|
96 | rtems_status_code status; | |
97 |
|
97 | |||
98 | PRINTF("in HOUS ***\n") |
|
98 | PRINTF("in HOUS ***\n") | |
99 |
|
99 | |||
100 | if (rtems_rate_monotonic_ident( HK_name, &HK_id)!=RTEMS_SUCCESSFUL) { |
|
100 | if (rtems_rate_monotonic_ident( HK_name, &HK_id) != RTEMS_SUCCESSFUL) { | |
101 | status = rtems_rate_monotonic_create( HK_name, &HK_id ); |
|
101 | status = rtems_rate_monotonic_create( HK_name, &HK_id ); | |
102 | if( status != RTEMS_SUCCESSFUL ) { |
|
102 | if( status != RTEMS_SUCCESSFUL ) { | |
103 | PRINTF1( "rtems_rate_monotonic_create failed with status of %d\n", status ) |
|
103 | PRINTF1( "rtems_rate_monotonic_create failed with status of %d\n", status ) | |
104 | } |
|
104 | } | |
105 | } |
|
105 | } | |
106 |
|
106 | |||
107 | housekeeping_packet.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
107 | housekeeping_packet.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
108 | housekeeping_packet.protocolIdentifier = 0x02; |
|
108 | housekeeping_packet.protocolIdentifier = 0x02; | |
109 | housekeeping_packet.reserved = 0x00; |
|
109 | housekeeping_packet.reserved = 0x00; | |
110 | housekeeping_packet.userApplication = 0x00; |
|
110 | housekeeping_packet.userApplication = 0x00; | |
111 | housekeeping_packet.packetID[0] = 0x0c; |
|
111 | housekeeping_packet.packetID[0] = 0x0c; | |
112 | housekeeping_packet.packetID[1] = 0xc4; |
|
112 | housekeeping_packet.packetID[1] = 0xc4; | |
113 | housekeeping_packet.packetSequenceControl[0] = 0xc0; |
|
113 | housekeeping_packet.packetSequenceControl[0] = 0xc0; | |
114 | housekeeping_packet.packetSequenceControl[1] = 0x00; |
|
114 | housekeeping_packet.packetSequenceControl[1] = 0x00; | |
115 | housekeeping_packet.packetLength[0] = 0x00; |
|
115 | housekeeping_packet.packetLength[0] = 0x00; | |
116 | housekeeping_packet.packetLength[1] = 0x77; |
|
116 | housekeeping_packet.packetLength[1] = 0x77; | |
117 | housekeeping_packet.dataFieldHeader[0] = 0x10; |
|
117 | housekeeping_packet.dataFieldHeader[0] = 0x10; | |
118 |
housekeeping_packet.dataFieldHeader[1] = |
|
118 | housekeeping_packet.dataFieldHeader[1] = TM_TYPE_HK; | |
119 |
housekeeping_packet.dataFieldHeader[2] = |
|
119 | housekeeping_packet.dataFieldHeader[2] = TM_SUBTYPE_HK; | |
120 |
housekeeping_packet.dataFieldHeader[3] = |
|
120 | housekeeping_packet.dataFieldHeader[3] = CCSDS_DESTINATION_ID_GROUND; | |
121 |
|
121 | |||
122 | status = rtems_rate_monotonic_cancel(HK_id); |
|
122 | status = rtems_rate_monotonic_cancel(HK_id); | |
123 | if( status != RTEMS_SUCCESSFUL ) |
|
123 | if( status != RTEMS_SUCCESSFUL ) | |
124 | PRINTF1( "ERR *** in HOUS *** rtems_rate_monotonic_cancel(HK_id) ***code: %d\n", status ) |
|
124 | PRINTF1( "ERR *** in HOUS *** rtems_rate_monotonic_cancel(HK_id) ***code: %d\n", status ) | |
125 | else |
|
125 | else | |
126 | PRINTF("OK *** in HOUS *** rtems_rate_monotonic_cancel(HK_id)\n") |
|
126 | PRINTF("OK *** in HOUS *** rtems_rate_monotonic_cancel(HK_id)\n") | |
127 |
|
127 | |||
128 | while(1){ // launch the rate monotonic task |
|
128 | while(1){ // launch the rate monotonic task | |
129 | status = rtems_rate_monotonic_period( HK_id, HK_PERIOD ); |
|
129 | status = rtems_rate_monotonic_period( HK_id, HK_PERIOD ); | |
130 | if ( status != RTEMS_SUCCESSFUL ){ |
|
130 | if ( status != RTEMS_SUCCESSFUL ){ | |
131 | PRINTF1( "ERR *** in HOUS *** rtems_rate_monotonic_period *** code %d\n", status); |
|
131 | PRINTF1( "ERR *** in HOUS *** rtems_rate_monotonic_period *** code %d\n", status); | |
132 | } |
|
132 | } | |
133 | else |
|
133 | else | |
134 | { |
|
134 | { | |
135 | housekeeping_packet.dataFieldHeader[4] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
135 | housekeeping_packet.dataFieldHeader[4] = (unsigned char) (time_management_regs->coarse_time>>24); | |
136 | housekeeping_packet.dataFieldHeader[5] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
136 | housekeeping_packet.dataFieldHeader[5] = (unsigned char) (time_management_regs->coarse_time>>16); | |
137 | housekeeping_packet.dataFieldHeader[6] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
137 | housekeeping_packet.dataFieldHeader[6] = (unsigned char) (time_management_regs->coarse_time>>8); | |
138 | housekeeping_packet.dataFieldHeader[7] = (unsigned char) (time_management_regs->coarse_time); |
|
138 | housekeeping_packet.dataFieldHeader[7] = (unsigned char) (time_management_regs->coarse_time); | |
139 | housekeeping_packet.dataFieldHeader[8] = (unsigned char) (time_management_regs->fine_time>>8); |
|
139 | housekeeping_packet.dataFieldHeader[8] = (unsigned char) (time_management_regs->fine_time>>8); | |
140 | housekeeping_packet.dataFieldHeader[9] = (unsigned char) (time_management_regs->fine_time); |
|
140 | housekeeping_packet.dataFieldHeader[9] = (unsigned char) (time_management_regs->fine_time); | |
141 |
housekeeping_packet.d |
|
141 | housekeeping_packet.sid = CCSDS_DESTINATION_ID_DPU; | |
142 | result = write ( fdSPW, &housekeeping_packet, LEN_TM_LFR_HK); |
|
142 | result = write ( fdSPW, &housekeeping_packet, LEN_TM_LFR_HK); | |
143 | if (result==-1) |
|
143 | if (result==-1) | |
144 | { |
|
144 | { | |
145 | PRINTF("ERR *** in HOUS *** HK send\n"); |
|
145 | PRINTF("ERR *** in HOUS *** HK send\n"); | |
146 | } |
|
146 | } | |
147 | } |
|
147 | } | |
148 | } |
|
148 | } | |
149 |
|
149 | |||
150 | PRINTF("in HOUS *** deleting task\n") |
|
150 | PRINTF("in HOUS *** deleting task\n") | |
151 |
|
151 | |||
152 | status = rtems_task_delete( RTEMS_SELF ); // should not return |
|
152 | status = rtems_task_delete( RTEMS_SELF ); // should not return | |
153 | printf( "rtems_task_delete returned with status of %d.\n", status ); |
|
153 | printf( "rtems_task_delete returned with status of %d.\n", status ); | |
154 | exit( 1 ); |
|
154 | exit( 1 ); | |
155 | } |
|
155 | } | |
156 |
|
156 |
@@ -1,821 +1,942 | |||||
1 | #include <tc_handler.h> |
|
1 | #include <tc_handler.h> | |
2 | #include <fsw_params.h> |
|
2 | #include <fsw_params.h> | |
3 |
|
3 | |||
4 | char *DumbMessages[5] = {"default", |
|
4 | char *DumbMessages[5] = {"in DUMB *** default", | |
5 | "timecode_irq_handler", |
|
5 | "in DUMB *** timecode_irq_handler", | |
6 | "waveforms_isr", |
|
6 | "in DUMB *** waveforms_isr", | |
7 | "", |
|
7 | "", | |
8 | "" |
|
8 | "" | |
9 | }; |
|
9 | }; | |
10 |
|
10 | |||
11 | unsigned char currentTC_LEN_RCV[2]; // SHALL be equal to the current TC packet estimated packet length field |
|
11 | unsigned char currentTC_LEN_RCV[2]; // SHALL be equal to the current TC packet estimated packet length field | |
12 | unsigned char currentTC_COMPUTED_CRC[2]; |
|
12 | unsigned char currentTC_COMPUTED_CRC[2]; | |
13 | unsigned int currentTC_LEN_RCV_AsUnsignedInt; |
|
13 | unsigned int currentTC_LEN_RCV_AsUnsignedInt; | |
14 | unsigned int currentTM_length; |
|
14 | unsigned int currentTM_length; | |
15 | unsigned char currentTC_processedFlag; |
|
15 | unsigned char currentTC_processedFlag; | |
16 |
|
16 | |||
17 | unsigned int lookUpTableForCRC[256]; |
|
17 | unsigned int lookUpTableForCRC[256]; | |
18 |
|
18 | |||
19 | //********************** |
|
19 | //********************** | |
20 | // GENERAL USE FUNCTIONS |
|
20 | // GENERAL USE FUNCTIONS | |
21 | unsigned int Crc_opt( unsigned char D, unsigned int Chk) |
|
21 | unsigned int Crc_opt( unsigned char D, unsigned int Chk) | |
22 | { |
|
22 | { | |
23 | return(((Chk << 8) & 0xff00)^lookUpTableForCRC [(((Chk >> 8)^D) & 0x00ff)]); |
|
23 | return(((Chk << 8) & 0xff00)^lookUpTableForCRC [(((Chk >> 8)^D) & 0x00ff)]); | |
24 | } |
|
24 | } | |
25 |
|
25 | |||
26 | void initLookUpTableForCRC( void ) |
|
26 | void initLookUpTableForCRC( void ) | |
27 | { |
|
27 | { | |
28 | unsigned int i; |
|
28 | unsigned int i; | |
29 | unsigned int tmp; |
|
29 | unsigned int tmp; | |
30 |
|
30 | |||
31 | for (i=0; i<256; i++) |
|
31 | for (i=0; i<256; i++) | |
32 | { |
|
32 | { | |
33 | tmp = 0; |
|
33 | tmp = 0; | |
34 | if((i & 1) != 0) { |
|
34 | if((i & 1) != 0) { | |
35 | tmp = tmp ^ 0x1021; |
|
35 | tmp = tmp ^ 0x1021; | |
36 | } |
|
36 | } | |
37 | if((i & 2) != 0) { |
|
37 | if((i & 2) != 0) { | |
38 | tmp = tmp ^ 0x2042; |
|
38 | tmp = tmp ^ 0x2042; | |
39 | } |
|
39 | } | |
40 | if((i & 4) != 0) { |
|
40 | if((i & 4) != 0) { | |
41 | tmp = tmp ^ 0x4084; |
|
41 | tmp = tmp ^ 0x4084; | |
42 | } |
|
42 | } | |
43 | if((i & 8) != 0) { |
|
43 | if((i & 8) != 0) { | |
44 | tmp = tmp ^ 0x8108; |
|
44 | tmp = tmp ^ 0x8108; | |
45 | } |
|
45 | } | |
46 | if((i & 16) != 0) { |
|
46 | if((i & 16) != 0) { | |
47 | tmp = tmp ^ 0x1231; |
|
47 | tmp = tmp ^ 0x1231; | |
48 | } |
|
48 | } | |
49 | if((i & 32) != 0) { |
|
49 | if((i & 32) != 0) { | |
50 | tmp = tmp ^ 0x2462; |
|
50 | tmp = tmp ^ 0x2462; | |
51 | } |
|
51 | } | |
52 | if((i & 64) != 0) { |
|
52 | if((i & 64) != 0) { | |
53 | tmp = tmp ^ 0x48c4; |
|
53 | tmp = tmp ^ 0x48c4; | |
54 | } |
|
54 | } | |
55 | if((i & 128) != 0) { |
|
55 | if((i & 128) != 0) { | |
56 | tmp = tmp ^ 0x9188; |
|
56 | tmp = tmp ^ 0x9188; | |
57 | } |
|
57 | } | |
58 | lookUpTableForCRC[i] = tmp; |
|
58 | lookUpTableForCRC[i] = tmp; | |
59 | } |
|
59 | } | |
60 | } |
|
60 | } | |
61 |
|
61 | |||
62 | void GetCRCAsTwoBytes(unsigned char* data, unsigned char* crcAsTwoBytes, unsigned int sizeOfData) |
|
62 | void GetCRCAsTwoBytes(unsigned char* data, unsigned char* crcAsTwoBytes, unsigned int sizeOfData) | |
63 | { |
|
63 | { | |
64 | unsigned int Chk; |
|
64 | unsigned int Chk; | |
65 | int j; |
|
65 | int j; | |
66 | Chk = 0xffff; // reset the syndrom to all ones |
|
66 | Chk = 0xffff; // reset the syndrom to all ones | |
67 | for (j=0; j<sizeOfData; j++) { |
|
67 | for (j=0; j<sizeOfData; j++) { | |
68 | Chk = Crc_opt(data[j], Chk); |
|
68 | Chk = Crc_opt(data[j], Chk); | |
69 | } |
|
69 | } | |
70 | crcAsTwoBytes[0] = (unsigned char) (Chk >> 8); |
|
70 | crcAsTwoBytes[0] = (unsigned char) (Chk >> 8); | |
71 | crcAsTwoBytes[1] = (unsigned char) (Chk & 0x00ff); |
|
71 | crcAsTwoBytes[1] = (unsigned char) (Chk & 0x00ff); | |
72 | } |
|
72 | } | |
73 |
|
73 | |||
74 | //********************* |
|
74 | //********************* | |
75 | // ACCEPTANCE FUNCTIONS |
|
75 | // ACCEPTANCE FUNCTIONS | |
76 | int TC_checker(ccsdsTelecommandPacket_t *TC, unsigned int tc_len_recv) |
|
76 | int TC_checker(ccsdsTelecommandPacket_t *TC, unsigned int tc_len_recv) | |
77 | { |
|
77 | { | |
78 | int ret = 0; |
|
78 | int ret = 0; | |
79 | rtems_status_code status; |
|
79 | rtems_status_code status; | |
80 | spw_ioctl_pkt_send spw_ioctl_send; |
|
80 | spw_ioctl_pkt_send spw_ioctl_send; | |
81 | TMHeader_t TM_header; |
|
81 | TMHeader_t TM_header; | |
82 | unsigned int code = 0; |
|
82 | unsigned int code = 0; | |
83 | unsigned char computed_CRC[2]; |
|
83 | unsigned char computed_CRC[2]; | |
84 | char data[ TM_LEN_EXE_CORR + CCSDS_TC_TM_PACKET_OFFSET - TM_HEADER_LEN ]; |
|
84 | char data[ TM_LEN_EXE_CORR + CCSDS_TC_TM_PACKET_OFFSET - TM_HEADER_LEN ]; | |
85 |
|
85 | |||
86 | GetCRCAsTwoBytes( (unsigned char*) TC->packetID, computed_CRC, tc_len_recv + 5 ); |
|
86 | GetCRCAsTwoBytes( (unsigned char*) TC->packetID, computed_CRC, tc_len_recv + 5 ); | |
87 | code = acceptTM( TC, tc_len_recv ) ; |
|
87 | code = acceptTM( TC, tc_len_recv ) ; | |
88 | if ( (code == ILLEGAL_APID) | (code == WRONG_LEN_PACKET) | (code == INCOR_CHECKSUM) |
|
88 | if ( (code == ILLEGAL_APID) | (code == WRONG_LEN_PACKET) | (code == INCOR_CHECKSUM) | |
89 | | (code == ILL_TYPE) | (code == ILL_SUBTYPE) | (code == WRONG_APP_DATA) ) |
|
89 | | (code == ILL_TYPE) | (code == ILL_SUBTYPE) | (code == WRONG_APP_DATA) ) | |
90 | { // generate TM_LFR_TC_EXE_CORRUPTED |
|
90 | { // generate TM_LFR_TC_EXE_CORRUPTED | |
91 | // BUILD HEADER |
|
91 | // BUILD HEADER | |
92 | TM_build_header( TM_LFR_TC_EXE_ERR, TM_LEN_EXE_CORR, 0, 0, &TM_header); |
|
92 | TM_build_header( TM_LFR_TC_EXE_ERR, TM_LEN_EXE_CORR, 0, 0, &TM_header); | |
93 | // BUILD DATA |
|
93 | // BUILD DATA | |
94 | TM_build_data( TC, data, SID_EXE_CORR, computed_CRC); |
|
94 | TM_build_data( TC, data, SID_EXE_CORR, computed_CRC); | |
95 | // PREPARE TM SENDING |
|
95 | // PREPARE TM SENDING | |
96 | spw_ioctl_send.hlen = TM_HEADER_LEN + 4; // + 4 is for the protocole extra header |
|
96 | spw_ioctl_send.hlen = TM_HEADER_LEN + 4; // + 4 is for the protocole extra header | |
97 | spw_ioctl_send.hdr = (char*) &TM_header; |
|
97 | spw_ioctl_send.hdr = (char*) &TM_header; | |
98 | spw_ioctl_send.dlen = 16; |
|
98 | spw_ioctl_send.dlen = 16; | |
99 | spw_ioctl_send.data = data; |
|
99 | spw_ioctl_send.data = data; | |
100 | // SEND PACKET |
|
100 | // SEND PACKET | |
101 | write_spw(&spw_ioctl_send); |
|
101 | write_spw(&spw_ioctl_send); | |
102 | } |
|
102 | } | |
103 | else { // send valid TC to the action launcher |
|
103 | else { // send valid TC to the action launcher | |
104 | status = rtems_message_queue_send( misc_id[0], TC, tc_len_recv + CCSDS_TC_TM_PACKET_OFFSET + 3); |
|
104 | status = rtems_message_queue_send( misc_id[0], TC, tc_len_recv + CCSDS_TC_TM_PACKET_OFFSET + 3); | |
105 | ret = -1; |
|
105 | ret = -1; | |
106 | } |
|
106 | } | |
107 | return ret; |
|
107 | return ret; | |
108 | } |
|
108 | } | |
109 |
|
109 | |||
110 | unsigned char acceptTM(ccsdsTelecommandPacket_t * TMPacket, unsigned int TC_LEN_RCV) |
|
110 | unsigned char acceptTM(ccsdsTelecommandPacket_t * TMPacket, unsigned int TC_LEN_RCV) | |
111 | { |
|
111 | { | |
112 | unsigned char ret = 0; |
|
112 | unsigned char ret = 0; | |
113 | unsigned char pid = 0; |
|
113 | unsigned char pid = 0; | |
114 | unsigned char category = 0; |
|
114 | unsigned char category = 0; | |
115 | unsigned int length = 0; |
|
115 | unsigned int length = 0; | |
116 | unsigned char packetType = 0; |
|
116 | unsigned char packetType = 0; | |
117 | unsigned char packetSubtype = 0; |
|
117 | unsigned char packetSubtype = 0; | |
118 | unsigned char * CCSDSContent = NULL; |
|
118 | unsigned char * CCSDSContent = NULL; | |
119 |
|
119 | |||
120 | // APID check *** APID on 2 bytes |
|
120 | // APID check *** APID on 2 bytes | |
121 | pid = ((TMPacket->packetID[0] & 0x07)<<4) + ( (TMPacket->packetID[1]>>4) & 0x0f ); // PID = 11 *** 7 bits xxxxx210 7654xxxx |
|
121 | pid = ((TMPacket->packetID[0] & 0x07)<<4) + ( (TMPacket->packetID[1]>>4) & 0x0f ); // PID = 11 *** 7 bits xxxxx210 7654xxxx | |
122 | category = (TMPacket->packetID[1] & 0x0f); // PACKET_CATEGORY = 12 *** 4 bits xxxxxxxx xxxx3210 |
|
122 | category = (TMPacket->packetID[1] & 0x0f); // PACKET_CATEGORY = 12 *** 4 bits xxxxxxxx xxxx3210 | |
123 | length = (TMPacket->packetLength[0] * 256) + TMPacket->packetLength[1]; |
|
123 | length = (TMPacket->packetLength[0] * 256) + TMPacket->packetLength[1]; | |
124 | packetType = TMPacket->dataFieldHeader[1]; |
|
124 | packetType = TMPacket->dataFieldHeader[1]; | |
125 | packetSubtype = TMPacket->dataFieldHeader[2]; |
|
125 | packetSubtype = TMPacket->dataFieldHeader[2]; | |
126 |
|
126 | |||
127 | if (pid!=CCSDS_PROCESS_ID) { |
|
127 | if (pid!=CCSDS_PROCESS_ID) { | |
128 | ret = ILLEGAL_APID; |
|
128 | ret = ILLEGAL_APID; | |
129 | } |
|
129 | } | |
130 | else if (category!=CCSDS_PACKET_CATEGORY) { |
|
130 | else if (category!=CCSDS_PACKET_CATEGORY) { | |
131 | ret = ILLEGAL_APID; |
|
131 | ret = ILLEGAL_APID; | |
132 | } |
|
132 | } | |
133 | else if (length != TC_LEN_RCV ) { // packet length check |
|
133 | else if (length != TC_LEN_RCV ) { // packet length check | |
134 | ret = WRONG_LEN_PACKET; // LEN RCV != SIZE FIELD |
|
134 | ret = WRONG_LEN_PACKET; // LEN RCV != SIZE FIELD | |
135 | } |
|
135 | } | |
136 | else if (length >= CCSDS_TC_PKT_MAX_SIZE) { |
|
136 | else if (length >= CCSDS_TC_PKT_MAX_SIZE) { | |
137 | ret = WRONG_LEN_PACKET; // check that the packet does not exceed the MAX size |
|
137 | ret = WRONG_LEN_PACKET; // check that the packet does not exceed the MAX size | |
138 | } |
|
138 | } | |
139 | else if (packetType == TC_TYPE_GEN){ // service type, subtype and packet length check |
|
139 | else if (packetType == TC_TYPE_GEN){ // service type, subtype and packet length check | |
140 | switch(packetSubtype){ //subtype, autorized values are 3, 20, 21, 24, 27, 28, 30, 40, 50, 60, 61 |
|
140 | switch(packetSubtype){ //subtype, autorized values are 3, 20, 21, 24, 27, 28, 30, 40, 50, 60, 61 | |
141 | case TC_SUBTYPE_RESET: |
|
141 | case TC_SUBTYPE_RESET: | |
142 | if (length!=(TC_LEN_RESET-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
142 | if (length!=(TC_LEN_RESET-CCSDS_TC_TM_PACKET_OFFSET)) { | |
143 | ret = WRONG_LEN_PACKET; |
|
143 | ret = WRONG_LEN_PACKET; | |
144 | } |
|
144 | } | |
145 | else { |
|
145 | else { | |
146 | ret = CCSDS_TM_VALID; |
|
146 | ret = CCSDS_TM_VALID; | |
147 | } |
|
147 | } | |
148 | break; |
|
148 | break; | |
149 | case TC_SUBTYPE_LOAD_COMM: |
|
149 | case TC_SUBTYPE_LOAD_COMM: | |
150 | if (length!=(TC_LEN_LOAD_COMM-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
150 | if (length!=(TC_LEN_LOAD_COMM-CCSDS_TC_TM_PACKET_OFFSET)) { | |
151 | ret = WRONG_LEN_PACKET; |
|
151 | ret = WRONG_LEN_PACKET; | |
152 | } |
|
152 | } | |
153 | else { |
|
153 | else { | |
154 | ret = CCSDS_TM_VALID; |
|
154 | ret = CCSDS_TM_VALID; | |
155 | } |
|
155 | } | |
156 | break; |
|
156 | break; | |
157 | case TC_SUBTYPE_LOAD_NORM: |
|
157 | case TC_SUBTYPE_LOAD_NORM: | |
158 | if (length!=(TC_LEN_LOAD_NORM-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
158 | if (length!=(TC_LEN_LOAD_NORM-CCSDS_TC_TM_PACKET_OFFSET)) { | |
159 | ret = WRONG_LEN_PACKET; |
|
159 | ret = WRONG_LEN_PACKET; | |
160 | } |
|
160 | } | |
161 | else { |
|
161 | else { | |
162 | ret = CCSDS_TM_VALID; |
|
162 | ret = CCSDS_TM_VALID; | |
163 | } |
|
163 | } | |
164 | break; |
|
164 | break; | |
165 | case TC_SUBTYPE_LOAD_BURST: |
|
165 | case TC_SUBTYPE_LOAD_BURST: | |
166 | if (length!=(TC_LEN_LOAD_BURST-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
166 | if (length!=(TC_LEN_LOAD_BURST-CCSDS_TC_TM_PACKET_OFFSET)) { | |
167 | ret = WRONG_LEN_PACKET; |
|
167 | ret = WRONG_LEN_PACKET; | |
168 | } |
|
168 | } | |
169 | else { |
|
169 | else { | |
170 | ret = CCSDS_TM_VALID; |
|
170 | ret = CCSDS_TM_VALID; | |
171 | } |
|
171 | } | |
172 | break; |
|
172 | break; | |
173 | case TC_SUBTYPE_LOAD_SBM1: |
|
173 | case TC_SUBTYPE_LOAD_SBM1: | |
174 | if (length!=(TC_LEN_LOAD_SBM1-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
174 | if (length!=(TC_LEN_LOAD_SBM1-CCSDS_TC_TM_PACKET_OFFSET)) { | |
175 | ret = WRONG_LEN_PACKET; |
|
175 | ret = WRONG_LEN_PACKET; | |
176 | } |
|
176 | } | |
177 | else { |
|
177 | else { | |
178 | ret = CCSDS_TM_VALID; |
|
178 | ret = CCSDS_TM_VALID; | |
179 | } |
|
179 | } | |
180 | break; |
|
180 | break; | |
181 | case TC_SUBTYPE_LOAD_SBM2: |
|
181 | case TC_SUBTYPE_LOAD_SBM2: | |
182 | if (length!=(TC_LEN_LOAD_SBM2-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
182 | if (length!=(TC_LEN_LOAD_SBM2-CCSDS_TC_TM_PACKET_OFFSET)) { | |
183 | ret = WRONG_LEN_PACKET; |
|
183 | ret = WRONG_LEN_PACKET; | |
184 | } |
|
184 | } | |
185 | else { |
|
185 | else { | |
186 | ret = CCSDS_TM_VALID; |
|
186 | ret = CCSDS_TM_VALID; | |
187 | } |
|
187 | } | |
188 | break; |
|
188 | break; | |
189 | case TC_SUBTYPE_DUMP: |
|
189 | case TC_SUBTYPE_DUMP: | |
190 | if (length!=(TC_LEN_DUMP-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
190 | if (length!=(TC_LEN_DUMP-CCSDS_TC_TM_PACKET_OFFSET)) { | |
191 | ret = WRONG_LEN_PACKET; |
|
191 | ret = WRONG_LEN_PACKET; | |
192 | } |
|
192 | } | |
193 | else { |
|
193 | else { | |
194 | ret = CCSDS_TM_VALID; |
|
194 | ret = CCSDS_TM_VALID; | |
195 | } |
|
195 | } | |
196 | break; |
|
196 | break; | |
197 | case TC_SUBTYPE_ENTER: |
|
197 | case TC_SUBTYPE_ENTER: | |
198 | if (length!=(TC_LEN_ENTER-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
198 | if (length!=(TC_LEN_ENTER-CCSDS_TC_TM_PACKET_OFFSET)) { | |
199 | ret = WRONG_LEN_PACKET; |
|
199 | ret = WRONG_LEN_PACKET; | |
200 | } |
|
200 | } | |
201 | else { |
|
201 | else { | |
202 | ret = CCSDS_TM_VALID; |
|
202 | ret = CCSDS_TM_VALID; | |
203 | } |
|
203 | } | |
204 | break; |
|
204 | break; | |
205 | case TC_SUBTYPE_UPDT_INFO: |
|
205 | case TC_SUBTYPE_UPDT_INFO: | |
206 | if (length!=(TC_LEN_UPDT_INFO-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
206 | if (length!=(TC_LEN_UPDT_INFO-CCSDS_TC_TM_PACKET_OFFSET)) { | |
207 | ret = WRONG_LEN_PACKET; |
|
207 | ret = WRONG_LEN_PACKET; | |
208 | } |
|
208 | } | |
209 | else { |
|
209 | else { | |
210 | ret = CCSDS_TM_VALID; |
|
210 | ret = CCSDS_TM_VALID; | |
211 | } |
|
211 | } | |
212 | break; |
|
212 | break; | |
213 | case TC_SUBTYPE_EN_CAL: |
|
213 | case TC_SUBTYPE_EN_CAL: | |
214 | if (length!=(TC_LEN_EN_CAL-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
214 | if (length!=(TC_LEN_EN_CAL-CCSDS_TC_TM_PACKET_OFFSET)) { | |
215 | ret = WRONG_LEN_PACKET; |
|
215 | ret = WRONG_LEN_PACKET; | |
216 | } |
|
216 | } | |
217 | else { |
|
217 | else { | |
218 | ret = CCSDS_TM_VALID; |
|
218 | ret = CCSDS_TM_VALID; | |
219 | } |
|
219 | } | |
220 | break; |
|
220 | break; | |
221 | case TC_SUBTYPE_DIS_CAL: |
|
221 | case TC_SUBTYPE_DIS_CAL: | |
222 | if (length!=(TC_LEN_DIS_CAL-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
222 | if (length!=(TC_LEN_DIS_CAL-CCSDS_TC_TM_PACKET_OFFSET)) { | |
223 | ret = WRONG_LEN_PACKET; |
|
223 | ret = WRONG_LEN_PACKET; | |
224 | } |
|
224 | } | |
225 | else { |
|
225 | else { | |
226 | ret = CCSDS_TM_VALID; |
|
226 | ret = CCSDS_TM_VALID; | |
227 | } |
|
227 | } | |
228 | break; |
|
228 | break; | |
229 | default: |
|
229 | default: | |
230 | ret = ILL_SUBTYPE; |
|
230 | ret = ILL_SUBTYPE; | |
231 | break; |
|
231 | break; | |
232 | } |
|
232 | } | |
233 | } |
|
233 | } | |
234 | else if (packetType == TC_TYPE_TIME){ |
|
234 | else if (packetType == TC_TYPE_TIME){ | |
235 | if (packetSubtype!=TC_SUBTYPE_UPDT_TIME) { |
|
235 | if (packetSubtype!=TC_SUBTYPE_UPDT_TIME) { | |
236 | ret = ILL_SUBTYPE; |
|
236 | ret = ILL_SUBTYPE; | |
237 | } |
|
237 | } | |
238 | else if (length!=(TC_LEN_UPDT_TIME-CCSDS_TC_TM_PACKET_OFFSET)) { |
|
238 | else if (length!=(TC_LEN_UPDT_TIME-CCSDS_TC_TM_PACKET_OFFSET)) { | |
239 | ret = WRONG_LEN_PACKET; |
|
239 | ret = WRONG_LEN_PACKET; | |
240 | } |
|
240 | } | |
241 | else { |
|
241 | else { | |
242 | ret = CCSDS_TM_VALID; |
|
242 | ret = CCSDS_TM_VALID; | |
243 | } |
|
243 | } | |
244 | } |
|
244 | } | |
245 | else { |
|
245 | else { | |
246 | ret = ILL_TYPE; |
|
246 | ret = ILL_TYPE; | |
247 | } |
|
247 | } | |
248 |
|
248 | |||
249 | // source ID check // Source ID not documented in the ICD |
|
249 | // source ID check // Source ID not documented in the ICD | |
250 |
|
250 | |||
251 | // packet error control, CRC check |
|
251 | // packet error control, CRC check | |
252 | if ( ret == CCSDS_TM_VALID ) { |
|
252 | if ( ret == CCSDS_TM_VALID ) { | |
253 | CCSDSContent = (unsigned char*) TMPacket->packetID; |
|
253 | CCSDSContent = (unsigned char*) TMPacket->packetID; | |
254 | GetCRCAsTwoBytes(CCSDSContent, currentTC_COMPUTED_CRC, length + CCSDS_TC_TM_PACKET_OFFSET - 2); // 2 CRC bytes removed from the calculation of the CRC |
|
254 | GetCRCAsTwoBytes(CCSDSContent, currentTC_COMPUTED_CRC, length + CCSDS_TC_TM_PACKET_OFFSET - 2); // 2 CRC bytes removed from the calculation of the CRC | |
255 | if (currentTC_COMPUTED_CRC[0] != CCSDSContent[length + CCSDS_TC_TM_PACKET_OFFSET -2]) { |
|
255 | if (currentTC_COMPUTED_CRC[0] != CCSDSContent[length + CCSDS_TC_TM_PACKET_OFFSET -2]) { | |
256 | ret = INCOR_CHECKSUM; |
|
256 | ret = INCOR_CHECKSUM; | |
257 | } |
|
257 | } | |
258 | else if (currentTC_COMPUTED_CRC[1] != CCSDSContent[length + CCSDS_TC_TM_PACKET_OFFSET -1]) { |
|
258 | else if (currentTC_COMPUTED_CRC[1] != CCSDSContent[length + CCSDS_TC_TM_PACKET_OFFSET -1]) { | |
259 | ret = INCOR_CHECKSUM; |
|
259 | ret = INCOR_CHECKSUM; | |
260 | } |
|
260 | } | |
261 | else { |
|
261 | else { | |
262 | ret = CCSDS_TM_VALID; |
|
262 | ret = CCSDS_TM_VALID; | |
263 | } |
|
263 | } | |
264 | } |
|
264 | } | |
265 |
|
265 | |||
266 | return ret; |
|
266 | return ret; | |
267 | } |
|
267 | } | |
268 |
|
268 | |||
269 | unsigned char TM_build_header( enum TM_TYPE tm_type, unsigned int packetLength, |
|
269 | unsigned char TM_build_header( enum TM_TYPE tm_type, unsigned int packetLength, | |
270 | unsigned int coarseTime, unsigned int fineTime, TMHeader_t *TMHeader) |
|
270 | unsigned int coarseTime, unsigned int fineTime, TMHeader_t *TMHeader) | |
271 | { |
|
271 | { | |
272 | TMHeader->targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
272 | TMHeader->targetLogicalAddress = CCSDS_DESTINATION_ID; | |
273 | TMHeader->protocolIdentifier = 0x02; |
|
273 | TMHeader->protocolIdentifier = 0x02; | |
274 | TMHeader->reserved = 0x00; |
|
274 | TMHeader->reserved = 0x00; | |
275 | TMHeader->userApplication = 0x00; |
|
275 | TMHeader->userApplication = 0x00; | |
276 | TMHeader->packetID[0] = 0x0c; |
|
276 | TMHeader->packetID[0] = 0x0c; | |
277 | TMHeader->packetSequenceControl[0] = 0xc0; |
|
277 | TMHeader->packetSequenceControl[0] = 0xc0; | |
278 | TMHeader->packetSequenceControl[1] = 0x00; |
|
278 | TMHeader->packetSequenceControl[1] = 0x00; | |
279 | TMHeader->packetLength[0] = (unsigned char) (packetLength>>8); |
|
279 | TMHeader->packetLength[0] = (unsigned char) (packetLength>>8); | |
280 | TMHeader->packetLength[1] = (unsigned char) packetLength; |
|
280 | TMHeader->packetLength[1] = (unsigned char) packetLength; | |
281 | TMHeader->dataFieldHeader[0] = 0x10; |
|
281 | TMHeader->dataFieldHeader[0] = 0x10; | |
282 | TMHeader->dataFieldHeader[3] = CCSDS_DESTINATION_ID; |
|
282 | TMHeader->dataFieldHeader[3] = CCSDS_DESTINATION_ID; | |
283 | switch (tm_type){ |
|
283 | switch (tm_type){ | |
284 | case(TM_LFR_TC_EXE_OK): |
|
284 | case(TM_LFR_TC_EXE_OK): | |
285 | TMHeader->packetID[1] = 0xc1; |
|
285 | TMHeader->packetID[1] = 0xc1; | |
286 | TMHeader->dataFieldHeader[1] = 1; // type |
|
286 | TMHeader->dataFieldHeader[1] = 1; // type | |
287 | TMHeader->dataFieldHeader[2] = 7; // subtype |
|
287 | TMHeader->dataFieldHeader[2] = 7; // subtype | |
288 | break; |
|
288 | break; | |
289 | case(TM_LFR_TC_EXE_ERR): |
|
289 | case(TM_LFR_TC_EXE_ERR): | |
290 | TMHeader->packetID[1] = 0xc1; |
|
290 | TMHeader->packetID[1] = 0xc1; | |
291 | TMHeader->dataFieldHeader[1] = 1; // type |
|
291 | TMHeader->dataFieldHeader[1] = 1; // type | |
292 | TMHeader->dataFieldHeader[2] = 8; // subtype |
|
292 | TMHeader->dataFieldHeader[2] = 8; // subtype | |
293 | break; |
|
293 | break; | |
294 | case(TM_LFR_HK): |
|
294 | case(TM_LFR_HK): | |
295 | TMHeader->packetID[1] = 0xc4; |
|
295 | TMHeader->packetID[1] = 0xc4; | |
296 | TMHeader->dataFieldHeader[1] = 3; // type |
|
296 | TMHeader->dataFieldHeader[1] = 3; // type | |
297 | TMHeader->dataFieldHeader[2] = 25; // subtype |
|
297 | TMHeader->dataFieldHeader[2] = 25; // subtype | |
298 | break; |
|
298 | break; | |
299 | case(TM_LFR_SCI): |
|
299 | case(TM_LFR_SCI): | |
300 | TMHeader->packetID[1] = 0xcc; |
|
300 | TMHeader->packetID[1] = 0xcc; | |
301 | TMHeader->dataFieldHeader[1] = 21; // type |
|
301 | TMHeader->dataFieldHeader[1] = 21; // type | |
302 | TMHeader->dataFieldHeader[2] = 3; // subtype |
|
302 | TMHeader->dataFieldHeader[2] = 3; // subtype | |
303 | break; |
|
303 | break; | |
304 | case(TM_LFR_SCI_SBM): |
|
304 | case(TM_LFR_SCI_SBM): | |
305 | TMHeader->packetID[1] = 0xfc; |
|
305 | TMHeader->packetID[1] = 0xfc; | |
306 | TMHeader->dataFieldHeader[1] = 21; // type |
|
306 | TMHeader->dataFieldHeader[1] = 21; // type | |
307 | TMHeader->dataFieldHeader[2] = 3; // subtype |
|
307 | TMHeader->dataFieldHeader[2] = 3; // subtype | |
308 | break; |
|
308 | break; | |
309 | case(TM_LFR_PAR_DUMP): |
|
309 | case(TM_LFR_PAR_DUMP): | |
310 | TMHeader->packetID[1] = 0xc9; |
|
310 | TMHeader->packetID[1] = 0xc9; | |
311 | TMHeader->dataFieldHeader[1] = 181; // type |
|
311 | TMHeader->dataFieldHeader[1] = 181; // type | |
312 | TMHeader->dataFieldHeader[2] = 31; // subtype |
|
312 | TMHeader->dataFieldHeader[2] = 31; // subtype | |
313 | break; |
|
313 | break; | |
314 | default: |
|
314 | default: | |
315 | return 0; |
|
315 | return 0; | |
316 | } |
|
316 | } | |
317 | TMHeader->dataFieldHeader[4] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
317 | TMHeader->dataFieldHeader[4] = (unsigned char) (time_management_regs->coarse_time>>24); | |
318 | TMHeader->dataFieldHeader[5] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
318 | TMHeader->dataFieldHeader[5] = (unsigned char) (time_management_regs->coarse_time>>16); | |
319 | TMHeader->dataFieldHeader[6] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
319 | TMHeader->dataFieldHeader[6] = (unsigned char) (time_management_regs->coarse_time>>8); | |
320 | TMHeader->dataFieldHeader[7] = (unsigned char) (time_management_regs->coarse_time); |
|
320 | TMHeader->dataFieldHeader[7] = (unsigned char) (time_management_regs->coarse_time); | |
321 | TMHeader->dataFieldHeader[8] = (unsigned char) (time_management_regs->fine_time>>8); |
|
321 | TMHeader->dataFieldHeader[8] = (unsigned char) (time_management_regs->fine_time>>8); | |
322 | TMHeader->dataFieldHeader[9] = (unsigned char) (time_management_regs->fine_time); |
|
322 | TMHeader->dataFieldHeader[9] = (unsigned char) (time_management_regs->fine_time); | |
323 | return 1; |
|
323 | return 1; | |
324 | } |
|
324 | } | |
325 |
|
325 | |||
326 | unsigned char TM_build_header_bis( enum TM_TYPE tm_type, unsigned int packetLength, |
|
326 | unsigned char TM_build_header_bis( enum TM_TYPE tm_type, unsigned int packetLength, | |
327 | unsigned int coarseTime, unsigned int fineTime, Packet_TM_LFR_TC_EXE_t *packet) |
|
327 | unsigned int coarseTime, unsigned int fineTime, Packet_TM_LFR_TC_EXE_t *packet) | |
328 | { |
|
328 | { | |
329 |
|
329 | |||
330 | packet->targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
330 | packet->targetLogicalAddress = CCSDS_DESTINATION_ID; | |
331 | packet->protocolIdentifier = 0x02; |
|
331 | packet->protocolIdentifier = 0x02; | |
332 | packet->reserved = 0x00; |
|
332 | packet->reserved = 0x00; | |
333 | packet->userApplication = 0x00; |
|
333 | packet->userApplication = 0x00; | |
334 | packet->packetID[0] = 0x0c; |
|
334 | packet->packetID[0] = 0x0c; | |
335 | packet->packetSequenceControl[0] = 0xc0; |
|
335 | packet->packetSequenceControl[0] = 0xc0; | |
336 | packet->packetSequenceControl[1] = 0x00; |
|
336 | packet->packetSequenceControl[1] = 0x00; | |
337 | packet->packetLength[0] = (unsigned char) (packetLength>>8); |
|
337 | packet->packetLength[0] = (unsigned char) (packetLength>>8); | |
338 | packet->packetLength[1] = (unsigned char) packetLength; |
|
338 | packet->packetLength[1] = (unsigned char) packetLength; | |
339 | packet->dataFieldHeader[0] = 0x10; |
|
339 | packet->dataFieldHeader[0] = 0x10; | |
340 | packet->dataFieldHeader[3] = CCSDS_DESTINATION_ID; |
|
340 | packet->dataFieldHeader[3] = CCSDS_DESTINATION_ID; | |
341 | switch (tm_type){ |
|
341 | switch (tm_type){ | |
342 | case(TM_LFR_TC_EXE_OK): |
|
342 | case(TM_LFR_TC_EXE_OK): | |
343 | packet->packetID[1] = 0xc1; |
|
343 | packet->packetID[1] = 0xc1; | |
344 | packet->dataFieldHeader[1] = 1; // type |
|
344 | packet->dataFieldHeader[1] = 1; // type | |
345 | packet->dataFieldHeader[2] = 7; // subtype |
|
345 | packet->dataFieldHeader[2] = 7; // subtype | |
346 | break; |
|
346 | break; | |
347 | case(TM_LFR_TC_EXE_ERR): |
|
347 | case(TM_LFR_TC_EXE_ERR): | |
348 | packet->packetID[1] = 0xc1; |
|
348 | packet->packetID[1] = 0xc1; | |
349 | packet->dataFieldHeader[1] = 1; // type |
|
349 | packet->dataFieldHeader[1] = 1; // type | |
350 | packet->dataFieldHeader[2] = 8; // subtype |
|
350 | packet->dataFieldHeader[2] = 8; // subtype | |
351 | break; |
|
351 | break; | |
352 | case(TM_LFR_HK): |
|
352 | case(TM_LFR_HK): | |
353 | packet->packetID[1] = 0xc4; |
|
353 | packet->packetID[1] = 0xc4; | |
354 | packet->dataFieldHeader[1] = 3; // type |
|
354 | packet->dataFieldHeader[1] = 3; // type | |
355 | packet->dataFieldHeader[2] = 25; // subtype |
|
355 | packet->dataFieldHeader[2] = 25; // subtype | |
356 | break; |
|
356 | break; | |
357 | case(TM_LFR_SCI): |
|
357 | case(TM_LFR_SCI): | |
358 | packet->packetID[1] = 0xcc; |
|
358 | packet->packetID[1] = 0xcc; | |
359 | packet->dataFieldHeader[1] = 21; // type |
|
359 | packet->dataFieldHeader[1] = 21; // type | |
360 | packet->dataFieldHeader[2] = 3; // subtype |
|
360 | packet->dataFieldHeader[2] = 3; // subtype | |
361 | break; |
|
361 | break; | |
362 | case(TM_LFR_SCI_SBM): |
|
362 | case(TM_LFR_SCI_SBM): | |
363 | packet->packetID[1] = 0xfc; |
|
363 | packet->packetID[1] = 0xfc; | |
364 | packet->dataFieldHeader[1] = 21; // type |
|
364 | packet->dataFieldHeader[1] = 21; // type | |
365 | packet->dataFieldHeader[2] = 3; // subtype |
|
365 | packet->dataFieldHeader[2] = 3; // subtype | |
366 | break; |
|
366 | break; | |
367 | case(TM_LFR_PAR_DUMP): |
|
367 | case(TM_LFR_PAR_DUMP): | |
368 | packet->packetID[1] = 0xc9; |
|
368 | packet->packetID[1] = 0xc9; | |
369 | packet->dataFieldHeader[1] = 181; // type |
|
369 | packet->dataFieldHeader[1] = 181; // type | |
370 | packet->dataFieldHeader[2] = 31; // subtype |
|
370 | packet->dataFieldHeader[2] = 31; // subtype | |
371 | break; |
|
371 | break; | |
372 | default: |
|
372 | default: | |
373 | return 0; |
|
373 | return 0; | |
374 | } |
|
374 | } | |
375 | packet->dataFieldHeader[4] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
375 | packet->dataFieldHeader[4] = (unsigned char) (time_management_regs->coarse_time>>24); | |
376 | packet->dataFieldHeader[5] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
376 | packet->dataFieldHeader[5] = (unsigned char) (time_management_regs->coarse_time>>16); | |
377 | packet->dataFieldHeader[6] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
377 | packet->dataFieldHeader[6] = (unsigned char) (time_management_regs->coarse_time>>8); | |
378 | packet->dataFieldHeader[7] = (unsigned char) (time_management_regs->coarse_time); |
|
378 | packet->dataFieldHeader[7] = (unsigned char) (time_management_regs->coarse_time); | |
379 | packet->dataFieldHeader[8] = (unsigned char) (time_management_regs->fine_time>>8); |
|
379 | packet->dataFieldHeader[8] = (unsigned char) (time_management_regs->fine_time>>8); | |
380 | packet->dataFieldHeader[9] = (unsigned char) (time_management_regs->fine_time); |
|
380 | packet->dataFieldHeader[9] = (unsigned char) (time_management_regs->fine_time); | |
381 | return 1; |
|
381 | return 1; | |
382 | } |
|
382 | } | |
383 |
|
383 | |||
384 | unsigned char TM_build_data(ccsdsTelecommandPacket_t *TC, char* data, unsigned int SID, unsigned char *computed_CRC) |
|
384 | unsigned char TM_build_data(ccsdsTelecommandPacket_t *TC, char* data, unsigned int SID, unsigned char *computed_CRC) | |
385 | { |
|
385 | { | |
386 | unsigned int packetLength; |
|
386 | unsigned int packetLength; | |
387 | packetLength = (TC->packetLength[0] * 256) + TC->packetLength[1]; |
|
387 | packetLength = (TC->packetLength[0] * 256) + TC->packetLength[1]; | |
388 | switch (SID){ |
|
388 | switch (SID){ | |
389 | case (SID_NOT_EXE): |
|
389 | case (SID_NOT_EXE): | |
390 | break; |
|
390 | break; | |
391 | case (SID_NOT_IMP): |
|
391 | case (SID_NOT_IMP): | |
392 | data[0] = 0x9c; |
|
392 | data[0] = 0x9c; | |
393 | data[1] = 0x42; |
|
393 | data[1] = 0x42; | |
394 | data[2] = TC->packetID[0]; |
|
394 | data[2] = TC->packetID[0]; | |
395 | data[3] = TC->packetID[1]; |
|
395 | data[3] = TC->packetID[1]; | |
396 | data[4] = TC->packetSequenceControl[0]; |
|
396 | data[4] = TC->packetSequenceControl[0]; | |
397 | data[5] = TC->packetSequenceControl[1]; |
|
397 | data[5] = TC->packetSequenceControl[1]; | |
398 | data[6] = TC->dataFieldHeader[1]; // type |
|
398 | data[6] = TC->dataFieldHeader[1]; // type | |
399 | data[7] = TC->dataFieldHeader[2]; // subtype |
|
399 | data[7] = TC->dataFieldHeader[2]; // subtype | |
400 | break; |
|
400 | break; | |
401 | case (SID_EXE_ERR): |
|
401 | case (SID_EXE_ERR): | |
402 | break; |
|
402 | break; | |
403 | case (SID_EXE_CORR): |
|
403 | case (SID_EXE_CORR): | |
404 | data[0] = 0x9c; |
|
404 | data[0] = 0x9c; | |
405 | data[1] = 0x45; |
|
405 | data[1] = 0x45; | |
406 | data[2] = TC->packetID[0]; |
|
406 | data[2] = TC->packetID[0]; | |
407 | data[3] = TC->packetID[1]; |
|
407 | data[3] = TC->packetID[1]; | |
408 | data[4] = TC->packetSequenceControl[0]; |
|
408 | data[4] = TC->packetSequenceControl[0]; | |
409 | data[5] = TC->packetSequenceControl[1]; |
|
409 | data[5] = TC->packetSequenceControl[1]; | |
410 | data[6] = TC->dataFieldHeader[1]; // type |
|
410 | data[6] = TC->dataFieldHeader[1]; // type | |
411 | data[7] = TC->dataFieldHeader[2]; // subtype |
|
411 | data[7] = TC->dataFieldHeader[2]; // subtype | |
412 | data[8] = currentTC_LEN_RCV[0]; |
|
412 | data[8] = currentTC_LEN_RCV[0]; | |
413 | data[9] = currentTC_LEN_RCV[1]; |
|
413 | data[9] = currentTC_LEN_RCV[1]; | |
414 | data[10] = TC->packetLength[0]; |
|
414 | data[10] = TC->packetLength[0]; | |
415 | data[11] = TC->packetLength[1]; |
|
415 | data[11] = TC->packetLength[1]; | |
416 | data[12] = TC->dataAndCRC[packetLength]; |
|
416 | data[12] = TC->dataAndCRC[packetLength]; | |
417 | data[13] = TC->dataAndCRC[packetLength+1]; |
|
417 | data[13] = TC->dataAndCRC[packetLength+1]; | |
418 | data[14] = computed_CRC[0]; |
|
418 | data[14] = computed_CRC[0]; | |
419 | data[15] = computed_CRC[1]; |
|
419 | data[15] = computed_CRC[1]; | |
420 | break; |
|
420 | break; | |
421 | default: |
|
421 | default: | |
422 | return 0; |
|
422 | return 0; | |
423 | } |
|
423 | } | |
424 | return 1; |
|
424 | return 1; | |
425 | } |
|
425 | } | |
426 |
|
426 | |||
427 | int create_message_queue( void ) |
|
427 | int create_message_queue( void ) | |
428 | { |
|
428 | { | |
429 | rtems_status_code status; |
|
429 | rtems_status_code status; | |
430 | misc_name[0] = rtems_build_name( 'Q', 'U', 'E', 'U' ); |
|
430 | misc_name[0] = rtems_build_name( 'Q', 'U', 'E', 'U' ); | |
431 | status = rtems_message_queue_create( misc_name[0], ACTION_MSG_QUEUE_COUNT, CCSDS_TC_PKT_MAX_SIZE, |
|
431 | status = rtems_message_queue_create( misc_name[0], ACTION_MSG_QUEUE_COUNT, CCSDS_TC_PKT_MAX_SIZE, | |
432 | RTEMS_FIFO | RTEMS_LOCAL, &misc_id[0] ); |
|
432 | RTEMS_FIFO | RTEMS_LOCAL, &misc_id[0] ); | |
433 | if (status!=RTEMS_SUCCESSFUL) { |
|
433 | if (status!=RTEMS_SUCCESSFUL) { | |
434 | PRINTF("in create_message_queue *** error creating message queue\n") |
|
434 | PRINTF("in create_message_queue *** error creating message queue\n") | |
435 | } |
|
435 | } | |
436 |
|
436 | |||
437 | return 0; |
|
437 | return 0; | |
438 | } |
|
438 | } | |
439 |
|
439 | |||
440 | //*********** |
|
440 | //*********** | |
441 | // RTEMS TASK |
|
441 | // RTEMS TASK | |
442 | rtems_task recv_task( rtems_task_argument unused ) |
|
442 | rtems_task recv_task( rtems_task_argument unused ) | |
443 | { |
|
443 | { | |
444 | int len = 0; |
|
444 | int len = 0; | |
445 | unsigned int i = 0; |
|
445 | unsigned int i = 0; | |
446 | unsigned int data_length = 0; |
|
446 | unsigned int data_length = 0; | |
447 | ccsdsTelecommandPacket_t currentTC; |
|
447 | ccsdsTelecommandPacket_t currentTC; | |
448 | char data[100]; |
|
448 | char data[100]; | |
449 |
|
449 | |||
450 | for(i=0; i<100; i++) data[i] = 0; |
|
450 | for(i=0; i<100; i++) data[i] = 0; | |
451 |
|
451 | |||
452 | PRINTF("in RECV *** \n") |
|
452 | PRINTF("in RECV *** \n") | |
453 |
|
453 | |||
454 | while(1) |
|
454 | while(1) | |
455 | { |
|
455 | { | |
456 | len = read(fdSPW, (char*) ¤tTC, CCSDS_TC_PKT_MAX_SIZE); // the call to read is blocking |
|
456 | len = read(fdSPW, (char*) ¤tTC, CCSDS_TC_PKT_MAX_SIZE); // the call to read is blocking | |
457 | if (len == -1){ // error during the read call |
|
457 | if (len == -1){ // error during the read call | |
458 | PRINTF("In RECV *** last read call returned -1\n") |
|
458 | PRINTF("In RECV *** last read call returned -1\n") | |
459 | if (rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT ) != RTEMS_SUCCESSFUL) { |
|
459 | if (rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT ) != RTEMS_SUCCESSFUL) { | |
460 | PRINTF("IN RECV *** Error: rtems_event_send SPW_LINKERR_EVENT\n") |
|
460 | PRINTF("IN RECV *** Error: rtems_event_send SPW_LINKERR_EVENT\n") | |
461 | } |
|
461 | } | |
462 | if (rtems_task_suspend(RTEMS_SELF) != RTEMS_SUCCESSFUL) { |
|
462 | if (rtems_task_suspend(RTEMS_SELF) != RTEMS_SUCCESSFUL) { | |
463 | PRINTF("In RECV *** Error: rtems_task_suspend(RTEMS_SELF)\n") |
|
463 | PRINTF("In RECV *** Error: rtems_task_suspend(RTEMS_SELF)\n") | |
464 | } |
|
464 | } | |
465 | } |
|
465 | } | |
466 | else { |
|
466 | else { | |
467 | PRINTF1("Got pck of length %d\n", len+1) |
|
467 | PRINTF1("Got pck of length %d\n", len+1) | |
468 | if ( (len+1) < CCSDS_TC_PKT_MIN_SIZE ) { |
|
468 | if ( (len+1) < CCSDS_TC_PKT_MIN_SIZE ) { | |
469 | PRINTF("In RECV *** packet lenght too short\n") |
|
469 | PRINTF("In RECV *** packet lenght too short\n") | |
470 | } |
|
470 | } | |
471 | else { |
|
471 | else { | |
472 | currentTC_LEN_RCV[0] = 0x00; |
|
472 | currentTC_LEN_RCV[0] = 0x00; | |
473 | currentTC_LEN_RCV[1] = (unsigned char) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // build the corresponding packet size field |
|
473 | currentTC_LEN_RCV[1] = (unsigned char) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // build the corresponding packet size field | |
474 | currentTC_LEN_RCV_AsUnsignedInt = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // => -3 is for Prot ID, Reserved and User App bytes |
|
474 | currentTC_LEN_RCV_AsUnsignedInt = (unsigned int) (len - CCSDS_TC_TM_PACKET_OFFSET - 3); // => -3 is for Prot ID, Reserved and User App bytes | |
475 | // CHECK THE TC AND BUILD THE APPROPRIATE TM |
|
475 | // CHECK THE TC AND BUILD THE APPROPRIATE TM | |
476 | data_length = TC_checker(¤tTC, currentTC_LEN_RCV_AsUnsignedInt); |
|
476 | data_length = TC_checker(¤tTC, currentTC_LEN_RCV_AsUnsignedInt); | |
477 | if (data_length!=-1) |
|
477 | if (data_length!=-1) | |
478 | { |
|
478 | { | |
479 | } |
|
479 | } | |
480 | } |
|
480 | } | |
481 | } |
|
481 | } | |
482 | } |
|
482 | } | |
483 | } |
|
483 | } | |
484 |
|
484 | |||
485 | rtems_task actn_task( rtems_task_argument unused ) |
|
485 | rtems_task actn_task( rtems_task_argument unused ) | |
486 | { |
|
486 | { | |
487 | int result = 0; |
|
487 | int result = 0; | |
|
488 | unsigned int val; | |||
488 | rtems_status_code status; // RTEMS status code |
|
489 | rtems_status_code status; // RTEMS status code | |
489 | ccsdsTelecommandPacket_t TC; // TC sent to the ACTN task |
|
490 | ccsdsTelecommandPacket_t TC; // TC sent to the ACTN task | |
490 | size_t size; // size of the incoming TC packet |
|
491 | size_t size; // size of the incoming TC packet | |
491 | unsigned char subtype = 0; // subtype of the current TC packet |
|
492 | unsigned char subtype = 0; // subtype of the current TC packet | |
492 |
|
493 | |||
493 | PRINTF("in ACTN *** \n") |
|
494 | PRINTF("in ACTN *** \n") | |
494 |
|
495 | |||
495 | while(1) |
|
496 | while(1) | |
496 | { |
|
497 | { | |
497 | status = rtems_message_queue_receive(misc_id[0], (char*) &TC, &size, |
|
498 | status = rtems_message_queue_receive(misc_id[0], (char*) &TC, &size, | |
498 | RTEMS_WAIT, RTEMS_NO_TIMEOUT); |
|
499 | RTEMS_WAIT, RTEMS_NO_TIMEOUT); | |
499 | if (status!=RTEMS_SUCCESSFUL) PRINTF1("in task ACTN *** error receiving a message, code %d \n", status) |
|
500 | if (status!=RTEMS_SUCCESSFUL) PRINTF1("in task ACTN *** error receiving a message, code %d \n", status) | |
500 | else |
|
501 | else | |
501 | { |
|
502 | { | |
502 | subtype = TC.dataFieldHeader[2]; |
|
503 | subtype = TC.dataFieldHeader[2]; | |
503 | switch(subtype) |
|
504 | switch(subtype) | |
504 | { |
|
505 | { | |
505 | case TC_SUBTYPE_RESET: |
|
506 | case TC_SUBTYPE_RESET: | |
506 | result = action_default( &TC ); |
|
507 | result = action_default( &TC ); | |
507 | break; |
|
508 | break; | |
508 | // |
|
509 | // | |
509 | case TC_SUBTYPE_LOAD_COMM: |
|
510 | case TC_SUBTYPE_LOAD_COMM: | |
510 |
result = action_ |
|
511 | result = action_load_comm( &TC ); | |
|
512 | close_action( &TC, result ); | |||
511 | break; |
|
513 | break; | |
512 | // |
|
514 | // | |
513 | case TC_SUBTYPE_LOAD_NORM: |
|
515 | case TC_SUBTYPE_LOAD_NORM: | |
514 | result = action_load_norm( &TC ); |
|
516 | result = action_load_norm( &TC ); | |
515 |
|
|
517 | close_action( &TC, result ); | |
516 | break; |
|
518 | break; | |
517 | // |
|
519 | // | |
518 | case TC_SUBTYPE_LOAD_BURST: |
|
520 | case TC_SUBTYPE_LOAD_BURST: | |
519 | result = action_default( &TC ); |
|
521 | result = action_default( &TC ); | |
|
522 | close_action( &TC, result ); | |||
520 | break; |
|
523 | break; | |
521 | // |
|
524 | // | |
522 | case TC_SUBTYPE_LOAD_SBM1: |
|
525 | case TC_SUBTYPE_LOAD_SBM1: | |
523 | result = action_default( &TC ); |
|
526 | result = action_default( &TC ); | |
|
527 | close_action( &TC, result ); | |||
524 | break; |
|
528 | break; | |
525 | // |
|
529 | // | |
526 | case TC_SUBTYPE_LOAD_SBM2: |
|
530 | case TC_SUBTYPE_LOAD_SBM2: | |
527 | result = action_default( &TC ); |
|
531 | result = action_default( &TC ); | |
|
532 | close_action( &TC, result ); | |||
528 | break; |
|
533 | break; | |
529 | // |
|
534 | // | |
530 | case TC_SUBTYPE_DUMP: |
|
535 | case TC_SUBTYPE_DUMP: | |
531 | result = action_default( &TC ); |
|
536 | result = action_default( &TC ); | |
|
537 | close_action( &TC, result ); | |||
532 | break; |
|
538 | break; | |
533 | // |
|
539 | // | |
534 | case TC_SUBTYPE_ENTER: |
|
540 | case TC_SUBTYPE_ENTER: | |
535 | result = action_enter( &TC ); |
|
541 | result = action_enter( &TC ); | |
536 |
|
|
542 | close_action( &TC, result ); | |
537 | break; |
|
543 | break; | |
538 | // |
|
544 | // | |
539 | case TC_SUBTYPE_UPDT_INFO: |
|
545 | case TC_SUBTYPE_UPDT_INFO: | |
540 | result = action_default( &TC ); |
|
546 | result = action_default( &TC ); | |
|
547 | val = housekeeping_packet.hk_lfr_update_info_tc_cnt[0] * 256 | |||
|
548 | + housekeeping_packet.hk_lfr_update_info_tc_cnt[1]; | |||
|
549 | val++; | |||
|
550 | housekeeping_packet.hk_lfr_update_info_tc_cnt[0] = (unsigned char) (val >> 8); | |||
|
551 | housekeeping_packet.hk_lfr_update_info_tc_cnt[1] = (unsigned char) (val); | |||
541 | break; |
|
552 | break; | |
542 | // |
|
553 | // | |
543 | case TC_SUBTYPE_EN_CAL: |
|
554 | case TC_SUBTYPE_EN_CAL: | |
544 | result = action_default( &TC ); |
|
555 | result = action_default( &TC ); | |
545 | break; |
|
556 | break; | |
546 | // |
|
557 | // | |
547 | case TC_SUBTYPE_DIS_CAL: |
|
558 | case TC_SUBTYPE_DIS_CAL: | |
548 | result = action_default( &TC ); |
|
559 | result = action_default( &TC ); | |
549 | break; |
|
560 | break; | |
550 | // |
|
561 | // | |
551 | case TC_SUBTYPE_UPDT_TIME: |
|
562 | case TC_SUBTYPE_UPDT_TIME: | |
552 | result = action_updt_time( &TC ); |
|
563 | result = action_updt_time( &TC ); | |
553 | send_tm_lfr_tc_exe_success( &TC ); |
|
564 | val = housekeeping_packet.hk_lfr_update_time_tc_cnt[0] * 256 | |
|
565 | + housekeeping_packet.hk_lfr_update_time_tc_cnt[1]; | |||
|
566 | val++; | |||
|
567 | housekeeping_packet.hk_lfr_update_time_tc_cnt[0] = (unsigned char) (val >> 8); | |||
|
568 | housekeeping_packet.hk_lfr_update_time_tc_cnt[1] = (unsigned char) (val); | |||
554 | break; |
|
569 | break; | |
555 | // |
|
570 | // | |
556 | default: |
|
571 | default: | |
557 | break; |
|
572 | break; | |
558 | } |
|
573 | } | |
559 | } |
|
574 | } | |
560 | } |
|
575 | } | |
561 | } |
|
576 | } | |
562 |
|
577 | |||
563 | rtems_task dumb_task( rtems_task_argument unused ) |
|
578 | rtems_task dumb_task( rtems_task_argument unused ) | |
564 | { |
|
579 | { | |
565 | unsigned int coarse_time = 0; |
|
580 | unsigned int coarse_time = 0; | |
566 | unsigned int fine_time = 0; |
|
581 | unsigned int fine_time = 0; | |
567 | unsigned int indice = 0; |
|
582 | unsigned int indice = 0; | |
568 | unsigned int shiftedIndice = 0; |
|
583 | unsigned int shiftedIndice = 0; | |
569 | rtems_event_set event_out; |
|
584 | rtems_event_set event_out; | |
570 |
|
585 | |||
571 | PRINTF("in DUMB *** \n") |
|
586 | PRINTF("in DUMB *** \n") | |
572 |
|
587 | |||
573 | while(1){ |
|
588 | while(1){ | |
574 | rtems_event_receive(RTEMS_EVENT_1, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0 |
|
589 | rtems_event_receive(RTEMS_EVENT_0 | RTEMS_EVENT_1 | RTEMS_EVENT_2 | RTEMS_EVENT_3 | RTEMS_EVENT_4, | |
|
590 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT | |||
575 | indice = 0; |
|
591 | indice = 0; | |
576 | shiftedIndice = (unsigned int) event_out; |
|
592 | shiftedIndice = (unsigned int) event_out; | |
577 | while(!(shiftedIndice & 0x0001)) |
|
593 | while(!(shiftedIndice & 0x0001)) | |
578 | { |
|
594 | { | |
579 | shiftedIndice = shiftedIndice >> 1; |
|
595 | shiftedIndice = shiftedIndice >> 1; | |
580 | indice++; |
|
596 | indice++; | |
581 | } |
|
597 | } | |
582 | coarse_time = time_management_regs->coarse_time; |
|
598 | coarse_time = time_management_regs->coarse_time; | |
583 | fine_time = time_management_regs->fine_time; |
|
599 | fine_time = time_management_regs->fine_time; | |
584 | printf("in DUMB *** time = coarse: %x, fine: %x, %s\n", coarse_time, fine_time, DumbMessages[indice]); |
|
600 | printf("in DUMB *** time = coarse: %x, fine: %x, %s\n", coarse_time, fine_time, DumbMessages[indice]); | |
585 | } |
|
601 | } | |
586 | } |
|
602 | } | |
587 |
|
603 | |||
588 | //*********** |
|
604 | //*********** | |
589 | // TC ACTIONS |
|
605 | // TC ACTIONS | |
590 |
|
606 | |||
591 | int action_default(ccsdsTelecommandPacket_t *TC) |
|
607 | int action_default(ccsdsTelecommandPacket_t *TC) | |
592 | { |
|
608 | { | |
593 | Packet_TM_LFR_TC_EXE_t packet; |
|
609 | Packet_TM_LFR_TC_EXE_t packet; | |
594 |
|
610 | |||
595 | TM_build_header_bis( TM_LFR_TC_EXE_ERR, TM_LEN_NOT_IMP, |
|
611 | TM_build_header_bis( TM_LFR_TC_EXE_ERR, TM_LEN_NOT_IMP, | |
596 | time_management_regs->coarse_time, time_management_regs->fine_time, &packet); |
|
612 | time_management_regs->coarse_time, time_management_regs->fine_time, &packet); | |
597 |
|
613 | |||
598 | packet.data[0] = 0x9c; |
|
614 | packet.data[0] = 0x9c; | |
599 | packet.data[1] = 0x42; |
|
615 | packet.data[1] = 0x42; | |
600 | packet.data[2] = TC->packetID[0]; |
|
616 | packet.data[2] = TC->packetID[0]; | |
601 | packet.data[3] = TC->packetID[1]; |
|
617 | packet.data[3] = TC->packetID[1]; | |
602 | packet.data[4] = TC->packetSequenceControl[0]; |
|
618 | packet.data[4] = TC->packetSequenceControl[0]; | |
603 | packet.data[5] = TC->packetSequenceControl[1]; |
|
619 | packet.data[5] = TC->packetSequenceControl[1]; | |
604 | packet.data[6] = TC->dataFieldHeader[1]; // type |
|
620 | packet.data[6] = TC->dataFieldHeader[1]; // type | |
605 | packet.data[7] = TC->dataFieldHeader[2]; // subtype |
|
621 | packet.data[7] = TC->dataFieldHeader[2]; // subtype | |
606 |
|
622 | |||
607 | // SEND DATA |
|
623 | // SEND DATA | |
608 | if (write ( fdSPW, &packet, LEN_TM_LFR_TC_EXE_NOT_IMP)==-1) { |
|
624 | if (write ( fdSPW, &packet, LEN_TM_LFR_TC_EXE_NOT_IMP)==-1) { | |
609 | PRINTF("ERR *** in action_default *** send TM packet\n"); |
|
625 | PRINTF("ERR *** in action_default *** send TM packet\n"); | |
610 | } |
|
626 | } | |
611 |
|
627 | |||
612 |
return |
|
628 | return LFR_DEFAULT; | |
613 | } |
|
629 | } | |
614 |
|
630 | |||
615 | int action_enter(ccsdsTelecommandPacket_t *TC) |
|
631 | int action_enter(ccsdsTelecommandPacket_t *TC) | |
616 | { |
|
632 | { | |
|
633 | rtems_status_code status; | |||
617 | unsigned char lfr_mode = TC->dataAndCRC[1]; |
|
634 | unsigned char lfr_mode = TC->dataAndCRC[1]; | |
618 | printf("enter mode %d\n", lfr_mode); |
|
635 | printf("enter mode %d\n", lfr_mode); | |
619 | switch(lfr_mode) |
|
636 | switch(lfr_mode) | |
620 | { |
|
637 | { | |
621 | //******** |
|
638 | //******** | |
622 | // STANDBY |
|
639 | // STANDBY | |
623 | case(LFR_MODE_STANDBY): |
|
640 | case(LFR_MODE_STANDBY): | |
624 | stop_current_mode(); |
|
641 | status = stop_current_mode(); | |
|
642 | if (status != RTEMS_SUCCESSFUL) | |||
|
643 | { | |||
|
644 | PRINTF("in action_enter *** error going back to STANDBY mode\n") | |||
|
645 | } | |||
|
646 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((LFR_MODE_STANDBY << 4) + 0x0d); | |||
625 | break; |
|
647 | break; | |
626 |
|
648 | |||
627 | //****** |
|
649 | //****** | |
628 | // NORMAL |
|
650 | // NORMAL | |
629 | case(LFR_MODE_NORMAL): |
|
651 | case(LFR_MODE_NORMAL): | |
630 | stop_current_mode(); |
|
652 | status = stop_current_mode(); | |
631 | enter_normal_mode(); |
|
653 | status = enter_normal_mode(); | |
|
654 | if (status == RTEMS_SUCCESSFUL) | |||
|
655 | { | |||
|
656 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((LFR_MODE_NORMAL << 4) + 0x0d); | |||
|
657 | } | |||
632 | break; |
|
658 | break; | |
633 |
|
659 | |||
634 | //****** |
|
660 | //****** | |
635 | // BURST |
|
661 | // BURST | |
636 | case(LFR_MODE_BURST): |
|
662 | case(LFR_MODE_BURST): | |
637 | stop_current_mode(); |
|
663 | status = stop_current_mode(); | |
|
664 | if (status == RTEMS_SUCCESSFUL) | |||
|
665 | { | |||
|
666 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((LFR_MODE_BURST << 4) + 0x0d); | |||
|
667 | } | |||
638 | break; |
|
668 | break; | |
639 |
|
669 | |||
640 | //***** |
|
670 | //***** | |
641 | // SBM1 |
|
671 | // SBM1 | |
642 | case(LFR_MODE_SBM1): |
|
672 | case(LFR_MODE_SBM1): | |
643 | stop_current_mode(); |
|
673 | status = stop_current_mode(); | |
644 | enter_sbm1_mode(); |
|
674 | status = enter_sbm1_mode(); | |
|
675 | if (status == RTEMS_SUCCESSFUL) | |||
|
676 | { | |||
|
677 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((LFR_MODE_SBM1 << 4) + 0x0d); | |||
|
678 | } | |||
645 | break; |
|
679 | break; | |
646 |
|
680 | |||
647 | //***** |
|
681 | //***** | |
648 | // SBM2 |
|
682 | // SBM2 | |
649 | case(LFR_MODE_SBM2): |
|
683 | case(LFR_MODE_SBM2): | |
650 | stop_current_mode(); |
|
684 | status = stop_current_mode(); | |
|
685 | if (status == RTEMS_SUCCESSFUL) | |||
|
686 | { | |||
|
687 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((LFR_MODE_SBM2 << 4) + 0x0d); | |||
|
688 | } | |||
651 | break; |
|
689 | break; | |
652 |
|
690 | |||
653 | //******** |
|
691 | //******** | |
654 | // DEFAULT |
|
692 | // DEFAULT | |
655 | default: |
|
693 | default: | |
656 | stop_current_mode(); |
|
694 | status = stop_current_mode(); | |
|
695 | if (status == RTEMS_SUCCESSFUL) | |||
|
696 | { | |||
|
697 | housekeeping_packet.lfr_status_word[0] = (unsigned char) ((LFR_MODE_STANDBY << 4) + 0x0d); | |||
|
698 | } | |||
657 | break; |
|
699 | break; | |
658 | } |
|
700 | } | |
659 |
return |
|
701 | return status; | |
660 | } |
|
702 | } | |
661 |
|
703 | |||
662 | int stop_current_mode() |
|
704 | int stop_current_mode() | |
663 | { |
|
705 | { | |
|
706 | rtems_status_code status; | |||
664 | // mask all IRQ lines related to signal processing |
|
707 | // mask all IRQ lines related to signal processing | |
665 | LEON_Mask_interrupt( IRQ_WF ); // mask waveform interrupt (coming from the timer VHDL IP) |
|
708 | LEON_Mask_interrupt( IRQ_WF ); // mask waveform interrupt (coming from the timer VHDL IP) | |
666 | LEON_Mask_interrupt( IRQ_SM ); // mask spectral matrices interrupt (coming from the timer VHDL IP) |
|
709 | LEON_Mask_interrupt( IRQ_SM ); // mask spectral matrices interrupt (coming from the timer VHDL IP) | |
667 | LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); // mask waveform picker interrupt |
|
710 | LEON_Mask_interrupt( IRQ_WAVEFORM_PICKER ); // mask waveform picker interrupt | |
668 |
|
711 | |||
669 | // clear all pending interruptions related to signal processing |
|
712 | // clear all pending interruptions related to signal processing | |
670 | LEON_Clear_interrupt( IRQ_WF ); // clear waveform interrupt (coming from the timer VHDL IP) |
|
713 | LEON_Clear_interrupt( IRQ_WF ); // clear waveform interrupt (coming from the timer VHDL IP) | |
671 | LEON_Clear_interrupt( IRQ_SM ); // clear spectral matrices interrupt (coming from the timer VHDL IP) |
|
714 | LEON_Clear_interrupt( IRQ_SM ); // clear spectral matrices interrupt (coming from the timer VHDL IP) | |
672 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); // clear waveform picker interrupt |
|
715 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); // clear waveform picker interrupt | |
673 |
|
716 | |||
674 | // suspend several tasks |
|
717 | // suspend several tasks | |
675 | suspend_if_needed( Task_id[TASKID_AVF0] ); |
|
718 | status = suspend_if_needed( Task_id[TASKID_AVF0] ); | |
676 | suspend_if_needed( Task_id[TASKID_BPF0] ); |
|
719 | if (status == RTEMS_SUCCESSFUL) { | |
677 |
suspend_if_needed( Task_id[TASKID_ |
|
720 | status = suspend_if_needed( Task_id[TASKID_BPF0] ); | |
|
721 | if (status == RTEMS_SUCCESSFUL) { | |||
|
722 | status = suspend_if_needed( Task_id[TASKID_WFRM] ); | |||
|
723 | } | |||
|
724 | } | |||
678 |
|
725 | |||
679 | // initialize the registers |
|
726 | // initialize the registers | |
680 | waveform_picker_regs->burst_enable = 0x00; // initialize |
|
727 | waveform_picker_regs->burst_enable = 0x00; // initialize | |
681 |
|
728 | |||
682 |
return |
|
729 | return status; | |
683 | } |
|
730 | } | |
684 |
|
731 | |||
685 | int enter_normal_mode() |
|
732 | int enter_normal_mode() | |
686 | { |
|
733 | { | |
|
734 | rtems_status_code status; | |||
687 |
|
735 | |||
688 | restart_if_needed( Task_id[TASKID_AVF0] ); |
|
736 | status = restart_if_needed( Task_id[TASKID_AVF0] ); | |
689 | restart_if_needed( Task_id[TASKID_BPF0] ); |
|
737 | if (status == RTEMS_SUCCESSFUL) { | |
690 |
restart_if_needed( Task_id[TASKID_ |
|
738 | status = restart_if_needed( Task_id[TASKID_BPF0] ); | |
|
739 | if (status == RTEMS_SUCCESSFUL) { | |||
|
740 | status = restart_if_needed( Task_id[TASKID_WFRM] ); | |||
|
741 | } | |||
|
742 | } | |||
691 |
|
743 | |||
692 | #ifdef GSA |
|
744 | #ifdef GSA | |
693 | LEON_Unmask_interrupt( IRQ_WF ); |
|
745 | LEON_Unmask_interrupt( IRQ_WF ); | |
694 | #else |
|
746 | #else | |
695 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
747 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); | |
696 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
748 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); | |
697 | waveform_picker_regs->burst_enable = 0x07; |
|
749 | waveform_picker_regs->burst_enable = 0x07; | |
|
750 | waveform_picker_regs->addr_data_f1 = (int) wf_snap_f1; | |||
698 | waveform_picker_regs->status = 0x00; |
|
751 | waveform_picker_regs->status = 0x00; | |
699 | #endif |
|
752 | #endif | |
700 | LEON_Unmask_interrupt( IRQ_SM ); |
|
753 | LEON_Unmask_interrupt( IRQ_SM ); | |
701 | return 0; |
|
754 | ||
|
755 | return status; | |||
702 | } |
|
756 | } | |
703 |
|
757 | |||
704 | int enter_sbm1_mode() |
|
758 | int enter_sbm1_mode() | |
705 | { |
|
759 | { | |
706 | restart_if_needed( Task_id[TASKID_AVF0] ); |
|
760 | rtems_status_code status; | |
707 |
restart_if_needed( Task_id[TASKID_ |
|
761 | status = restart_if_needed( Task_id[TASKID_AVF0] ); | |
708 | restart_if_needed( Task_id[TASKID_WFRM] ); |
|
762 | if (status == RTEMS_SUCCESSFUL) { | |
|
763 | status = restart_if_needed( Task_id[TASKID_BPF0] ); | |||
|
764 | if (status == RTEMS_SUCCESSFUL) { | |||
|
765 | status = restart_if_needed( Task_id[TASKID_WFRM] ); | |||
|
766 | } | |||
|
767 | } | |||
709 |
|
768 | |||
710 | #ifdef GSA |
|
769 | #ifdef GSA | |
711 | #else |
|
770 | #else | |
712 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); |
|
771 | LEON_Clear_interrupt( IRQ_WAVEFORM_PICKER ); | |
713 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); |
|
772 | LEON_Unmask_interrupt( IRQ_WAVEFORM_PICKER ); | |
714 | waveform_picker_regs->burst_enable = 0x20; // [0010 0000] burst f2, f1, f0 enable f3 f2 f1 f0 |
|
773 | waveform_picker_regs->burst_enable = 0x20; // [0010 0000] burst f2, f1, f0 enable f3 f2 f1 f0 | |
715 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x02; |
|
774 | waveform_picker_regs->burst_enable = waveform_picker_regs->burst_enable | 0x02; | |
716 | waveform_picker_regs->status = 0x00; |
|
775 | waveform_picker_regs->status = 0x00; | |
717 | #endif |
|
776 | #endif | |
718 | //LEON_Unmask_interrupt( IRQ_SM ); |
|
777 | //LEON_Unmask_interrupt( IRQ_SM ); | |
719 |
return |
|
778 | return status; | |
720 | } |
|
779 | } | |
721 |
|
780 | |||
722 | int action_load_norm(ccsdsTelecommandPacket_t *TC) |
|
781 | int action_load_norm(ccsdsTelecommandPacket_t *TC) | |
723 | { |
|
782 | { | |
724 | param_norm.sy_lfr_n_swf_l = (TC->dataAndCRC[0] * 256) + TC->dataAndCRC[1]; |
|
783 | param_norm.sy_lfr_n_swf_l = (TC->dataAndCRC[0] * 256) + TC->dataAndCRC[1]; | |
725 | param_norm.sy_lfr_n_swf_p = (TC->dataAndCRC[2] * 256) + TC->dataAndCRC[3]; |
|
784 | param_norm.sy_lfr_n_swf_p = (TC->dataAndCRC[2] * 256) + TC->dataAndCRC[3]; | |
726 | param_norm.sy_lfr_n_asm_p = (TC->dataAndCRC[4] * 256) + TC->dataAndCRC[5]; |
|
785 | param_norm.sy_lfr_n_asm_p = (TC->dataAndCRC[4] * 256) + TC->dataAndCRC[5]; | |
727 | param_norm.sy_lfr_n_bp_p0 = TC->dataAndCRC[6]; |
|
786 | param_norm.sy_lfr_n_bp_p0 = TC->dataAndCRC[6]; | |
728 | param_norm.sy_lfr_n_bp_p1 = TC->dataAndCRC[7]; |
|
787 | param_norm.sy_lfr_n_bp_p1 = TC->dataAndCRC[7]; | |
729 | /*printf("sy_lfr_n_ => swf_l %d, swf_p %d, asm_p %d, bsp_p0 %d, bsp_p1 %d\n", |
|
788 | ||
730 | param_norm.sy_lfr_n_swf_l, param_norm.sy_lfr_n_swf_p, |
|
789 | return LFR_SUCCESSFUL; | |
731 | param_norm.sy_lfr_n_asm_p, param_norm.sy_lfr_n_bp_p0, param_norm.sy_lfr_n_bp_p1);*/ |
|
790 | } | |
732 | return 0; |
|
791 | ||
|
792 | int action_load_comm(ccsdsTelecommandPacket_t *TC) | |||
|
793 | { | |||
|
794 | param_common.sy_lfr_common0 = TC->dataAndCRC[0]; | |||
|
795 | param_common.sy_lfr_common1 = TC->dataAndCRC[1]; | |||
|
796 | ||||
|
797 | set_data_shaping_parameters(param_common.sy_lfr_common1); | |||
|
798 | ||||
|
799 | return LFR_SUCCESSFUL; | |||
733 | } |
|
800 | } | |
734 |
|
801 | |||
735 | int action_updt_time(ccsdsTelecommandPacket_t *TC) |
|
802 | int action_updt_time(ccsdsTelecommandPacket_t *TC) | |
736 | { |
|
803 | { | |
737 | time_management_regs->coarse_time_load = (TC->dataAndCRC[0] << 24) |
|
804 | time_management_regs->coarse_time_load = (TC->dataAndCRC[0] << 24) | |
738 | + (TC->dataAndCRC[1] << 16) |
|
805 | + (TC->dataAndCRC[1] << 16) | |
739 | + (TC->dataAndCRC[2] << 8) |
|
806 | + (TC->dataAndCRC[2] << 8) | |
740 | + TC->dataAndCRC[3]; |
|
807 | + TC->dataAndCRC[3]; | |
741 | //time_management_regs->ctrl = time_management_regs->ctrl | 1; |
|
808 | //time_management_regs->ctrl = time_management_regs->ctrl | 1; | |
742 | return 0; |
|
809 | return 0; | |
743 | } |
|
810 | } | |
744 |
|
811 | |||
745 | int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC) |
|
812 | int send_tm_lfr_tc_exe_success(ccsdsTelecommandPacket_t *TC) | |
746 | { |
|
813 | { | |
747 | TMHeader_t TM_header; |
|
814 | TMHeader_t TM_header; | |
748 | char data[4]; |
|
815 | char data[4]; | |
749 | spw_ioctl_pkt_send spw_ioctl_send; |
|
816 | spw_ioctl_pkt_send spw_ioctl_send; | |
750 |
|
817 | |||
751 | TM_build_header( TM_LFR_TC_EXE_OK, TM_LEN_EXE, |
|
818 | TM_build_header( TM_LFR_TC_EXE_OK, TM_LEN_EXE, | |
752 | time_management_regs->coarse_time, time_management_regs->fine_time, &TM_header); |
|
819 | time_management_regs->coarse_time, time_management_regs->fine_time, &TM_header); | |
753 |
|
820 | |||
754 | data[0] = TC->packetID[0]; |
|
821 | data[0] = TC->packetID[0]; | |
755 | data[1] = TC->packetID[1]; |
|
822 | data[1] = TC->packetID[1]; | |
756 | data[2] = TC->packetSequenceControl[0]; |
|
823 | data[2] = TC->packetSequenceControl[0]; | |
757 | data[3] = TC->packetSequenceControl[1]; |
|
824 | data[3] = TC->packetSequenceControl[1]; | |
758 |
|
825 | |||
759 | // filling the structure for the spacewire transmission |
|
826 | // filling the structure for the spacewire transmission | |
760 | spw_ioctl_send.hlen = TM_HEADER_LEN + 3; // + 4 is for the protocole extra header |
|
827 | spw_ioctl_send.hlen = TM_HEADER_LEN + 3; // + 4 is for the protocole extra header | |
761 | spw_ioctl_send.hdr = (char*) &TM_header; |
|
828 | spw_ioctl_send.hdr = (char*) &TM_header; | |
762 | spw_ioctl_send.dlen = 3; |
|
829 | spw_ioctl_send.dlen = 3; | |
763 | spw_ioctl_send.data = data; |
|
830 | spw_ioctl_send.data = data; | |
764 |
|
831 | |||
765 | // SEND DATA |
|
832 | // SEND DATA | |
766 | write_spw(&spw_ioctl_send); |
|
833 | write_spw(&spw_ioctl_send); | |
767 |
|
834 | |||
768 | return 0; |
|
835 | return 0; | |
769 | } |
|
836 | } | |
770 |
|
837 | |||
771 | rtems_status_code restart_if_needed(rtems_id id) |
|
838 | rtems_status_code restart_if_needed(rtems_id id) | |
772 | { |
|
839 | { | |
773 | rtems_status_code status; |
|
840 | rtems_status_code status; | |
774 |
|
841 | |||
775 | status = rtems_task_is_suspended( id ); |
|
842 | status = rtems_task_is_suspended( id ); | |
776 |
|
843 | |||
777 | if (status==RTEMS_SUCCESSFUL) { |
|
844 | if (status==RTEMS_SUCCESSFUL) { | |
778 | status = rtems_task_restart( id, 0 ); |
|
845 | status = rtems_task_restart( id, 0 ); | |
779 | if (status!=RTEMS_SUCCESSFUL) { |
|
846 | if (status!=RTEMS_SUCCESSFUL) { | |
780 | PRINTF1("in restart_if_needed *** Error restarting with id %d\n", (int) id) |
|
847 | PRINTF1("in restart_if_needed *** Error restarting with id %d\n", (int) id) | |
781 | } |
|
848 | } | |
782 | } |
|
849 | } | |
783 |
|
850 | |||
784 | return status; |
|
851 | return status; | |
785 | } |
|
852 | } | |
786 |
|
853 | |||
787 | rtems_status_code suspend_if_needed(rtems_id id) |
|
854 | rtems_status_code suspend_if_needed(rtems_id id) | |
788 | { |
|
855 | { | |
789 | rtems_status_code status; |
|
856 | rtems_status_code status; | |
790 |
|
857 | |||
791 | status = rtems_task_is_suspended( id ); |
|
858 | status = rtems_task_is_suspended( id ); | |
792 |
|
859 | |||
793 | if (status!=RTEMS_SUCCESSFUL) { |
|
860 | if (status!=RTEMS_SUCCESSFUL) { | |
794 | status = rtems_task_suspend( id ); |
|
861 | status = rtems_task_suspend( id ); | |
795 | if (status!=RTEMS_SUCCESSFUL) { |
|
862 | if (status!=RTEMS_SUCCESSFUL) { | |
796 | PRINTF1("in suspend_if_needed *** Error suspending task with id %d\n", (int) id) |
|
863 | PRINTF1("in suspend_if_needed *** Error suspending task with id %d\n", (int) id) | |
797 | } |
|
864 | } | |
798 | } |
|
865 | } | |
799 |
|
866 | |||
800 | return status; |
|
867 | return status; | |
801 | } |
|
868 | } | |
802 |
|
869 | |||
|
870 | void update_last_TC_exe(ccsdsTelecommandPacket_t *TC) | |||
|
871 | { | |||
|
872 | housekeeping_packet.hk_lfr_last_exe_tc_id[0] = TC->packetID[0]; | |||
|
873 | housekeeping_packet.hk_lfr_last_exe_tc_id[1] = TC->packetID[1]; | |||
|
874 | housekeeping_packet.hk_lfr_last_exe_tc_type[0] = 0x00; | |||
|
875 | housekeeping_packet.hk_lfr_last_exe_tc_type[1] = TC->dataFieldHeader[1]; | |||
|
876 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[0] = 0x00; | |||
|
877 | housekeeping_packet.hk_lfr_last_exe_tc_subtype[1] = TC->dataFieldHeader[2]; | |||
|
878 | housekeeping_packet.hk_lfr_last_exe_tc_time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |||
|
879 | housekeeping_packet.hk_lfr_last_exe_tc_time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |||
|
880 | housekeeping_packet.hk_lfr_last_exe_tc_time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |||
|
881 | housekeeping_packet.hk_lfr_last_exe_tc_time[3] = (unsigned char) (time_management_regs->coarse_time); | |||
|
882 | housekeeping_packet.hk_lfr_last_exe_tc_time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |||
|
883 | housekeeping_packet.hk_lfr_last_exe_tc_time[5] = (unsigned char) (time_management_regs->fine_time); | |||
|
884 | } | |||
|
885 | ||||
|
886 | void update_last_TC_rej(ccsdsTelecommandPacket_t *TC) | |||
|
887 | { | |||
|
888 | housekeeping_packet.hk_lfr_last_rej_tc_id[0] = TC->packetID[0]; | |||
|
889 | housekeeping_packet.hk_lfr_last_rej_tc_id[1] = TC->packetID[1]; | |||
|
890 | housekeeping_packet.hk_lfr_last_rej_tc_type[0] = 0x00; | |||
|
891 | housekeeping_packet.hk_lfr_last_rej_tc_type[1] = TC->dataFieldHeader[1]; | |||
|
892 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[0] = 0x00; | |||
|
893 | housekeeping_packet.hk_lfr_last_rej_tc_subtype[1] = TC->dataFieldHeader[2]; | |||
|
894 | housekeeping_packet.hk_lfr_last_rej_tc_time[0] = (unsigned char) (time_management_regs->coarse_time>>24); | |||
|
895 | housekeeping_packet.hk_lfr_last_rej_tc_time[1] = (unsigned char) (time_management_regs->coarse_time>>16); | |||
|
896 | housekeeping_packet.hk_lfr_last_rej_tc_time[2] = (unsigned char) (time_management_regs->coarse_time>>8); | |||
|
897 | housekeeping_packet.hk_lfr_last_rej_tc_time[3] = (unsigned char) (time_management_regs->coarse_time); | |||
|
898 | housekeeping_packet.hk_lfr_last_rej_tc_time[4] = (unsigned char) (time_management_regs->fine_time>>8); | |||
|
899 | housekeeping_packet.hk_lfr_last_rej_tc_time[5] = (unsigned char) (time_management_regs->fine_time); | |||
|
900 | } | |||
|
901 | ||||
|
902 | void close_action(ccsdsTelecommandPacket_t *TC, int result) | |||
|
903 | { | |||
|
904 | unsigned int val = 0; | |||
|
905 | if (result == LFR_SUCCESSFUL) | |||
|
906 | { | |||
|
907 | send_tm_lfr_tc_exe_success( TC ); | |||
|
908 | update_last_TC_exe( TC ); | |||
|
909 | val = housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[0] * 256 + housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[1]; | |||
|
910 | val++; | |||
|
911 | housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[0] = (unsigned char) (val >> 8); | |||
|
912 | housekeeping_packet.hk_dpu_exe_tc_lfr_cnt[1] = (unsigned char) (val); | |||
|
913 | } | |||
|
914 | else | |||
|
915 | { | |||
|
916 | update_last_TC_rej( TC ); | |||
|
917 | val = housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[0] * 256 + housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[1]; | |||
|
918 | val++; | |||
|
919 | housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[0] = (unsigned char) (val >> 8); | |||
|
920 | housekeeping_packet.hk_dpu_rej_tc_lfr_cnt[1] = (unsigned char) (val); | |||
|
921 | } | |||
|
922 | } | |||
|
923 | ||||
803 | //*************************** |
|
924 | //*************************** | |
804 | // Interrupt Service Routines |
|
925 | // Interrupt Service Routines | |
805 | rtems_isr commutation_isr1( rtems_vector_number vector ) |
|
926 | rtems_isr commutation_isr1( rtems_vector_number vector ) | |
806 | { |
|
927 | { | |
807 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
928 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
808 | printf("In commutation_isr1 *** Error sending event to DUMB\n"); |
|
929 | printf("In commutation_isr1 *** Error sending event to DUMB\n"); | |
809 | } |
|
930 | } | |
810 | } |
|
931 | } | |
811 |
|
932 | |||
812 | rtems_isr commutation_isr2( rtems_vector_number vector ) |
|
933 | rtems_isr commutation_isr2( rtems_vector_number vector ) | |
813 | { |
|
934 | { | |
814 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
935 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
815 | printf("In commutation_isr2 *** Error sending event to DUMB\n"); |
|
936 | printf("In commutation_isr2 *** Error sending event to DUMB\n"); | |
816 | } |
|
937 | } | |
817 | } |
|
938 | } | |
818 |
|
939 | |||
819 |
|
940 | |||
820 |
|
941 | |||
821 |
|
942 |
@@ -1,312 +1,414 | |||||
1 | #include <wf_handler.h> |
|
1 | #include <wf_handler.h> | |
2 |
|
2 | |||
3 | rtems_isr waveforms_isr( rtems_vector_number vector ) |
|
3 | rtems_isr waveforms_isr_alternative( rtems_vector_number vector ) | |
4 | { |
|
4 | { | |
5 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ) != RTEMS_SUCCESSFUL) { |
|
|||
6 | printf("In waveforms_isr *** Error sending event to WFRM\n"); |
|
|||
7 | } |
|
|||
8 | if (waveform_picker_regs->burst_enable == 0x22) { |
|
5 | if (waveform_picker_regs->burst_enable == 0x22) { | |
9 | if (waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) { |
|
6 | if (waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) { | |
10 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_bis); |
|
7 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_bis); | |
11 | } |
|
8 | } | |
12 | else { |
|
9 | else { | |
13 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); |
|
10 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); | |
14 | } |
|
11 | } | |
15 |
if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_ |
|
12 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_2 ) != RTEMS_SUCCESSFUL) { | |
16 | printf("In waveforms_isr *** Error sending event to WFRM\n"); |
|
13 | //rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |
17 | } |
|
14 | } | |
18 | } |
|
15 | } | |
19 | waveform_picker_regs->status = 0x00; |
|
16 | waveform_picker_regs->status = 0x00; | |
20 | /*else if ( (waveform_picker_regs->burst_enable & 0x7) == 0x0 ){// if no channel is enable |
|
17 | /*else if ( (waveform_picker_regs->burst_enable & 0x7) == 0x0 ){// if no channel is enable | |
21 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ) != RTEMS_SUCCESSFUL) { |
|
18 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ) != RTEMS_SUCCESSFUL) { | |
22 | printf("In timecode_irq_handler *** Error sending event to DUMB\n"); |
|
19 | printf("In timecode_irq_handler *** Error sending event to DUMB\n"); | |
23 | } |
|
20 | } | |
24 | } |
|
21 | } | |
25 | else { |
|
22 | else { | |
26 | if ( (waveform_picker_regs->status & 0x7) == 0x7 ){ // f2 f1 and f0 are full |
|
23 | if ( (waveform_picker_regs->status & 0x7) == 0x7 ){ // f2 f1 and f0 are full | |
27 | waveform_picker_regs->burst_enable = 0x00; |
|
24 | waveform_picker_regs->burst_enable = 0x00; | |
28 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
25 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
29 | printf("In waveforms_isr *** Error sending event to WFRM\n"); |
|
26 | printf("In waveforms_isr *** Error sending event to WFRM\n"); | |
30 | } |
|
27 | } | |
31 | } |
|
28 | } | |
32 | }*/ |
|
29 | }*/ | |
33 | } |
|
30 | } | |
34 |
|
31 | |||
|
32 | rtems_isr waveforms_isr( rtems_vector_number vector ) | |||
|
33 | { | |||
|
34 | unsigned char lfrMode; | |||
|
35 | lfrMode = (housekeeping_packet.lfr_status_word[0] & 0xf0) >> 4; | |||
|
36 | ||||
|
37 | switch(lfrMode) | |||
|
38 | { | |||
|
39 | //******** | |||
|
40 | // STANDBY | |||
|
41 | case(LFR_MODE_STANDBY): | |||
|
42 | break; | |||
|
43 | ||||
|
44 | //****** | |||
|
45 | // NORMAL | |||
|
46 | case(LFR_MODE_NORMAL): | |||
|
47 | #ifdef GSA | |||
|
48 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") | |||
|
49 | #else | |||
|
50 | if ( (waveform_picker_regs->burst_enable & 0x7) == 0x0 ){// if no channel is enable | |||
|
51 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ) != RTEMS_SUCCESSFUL) { | |||
|
52 | PRINTF("in waveform_isr *** Error sending event to DUMB\n"); | |||
|
53 | } | |||
|
54 | } | |||
|
55 | else { | |||
|
56 | if ( (waveform_picker_regs->status & 0x7) == 0x7 ){ // f2 f1 and f0 are full | |||
|
57 | waveform_picker_regs->burst_enable = 0x00; | |||
|
58 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_NORMAL ) != RTEMS_SUCCESSFUL) { | |||
|
59 | if (rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ) != RTEMS_SUCCESSFUL) { | |||
|
60 | PRINTF("in waveform_isr *** Error sending event to DUMB\n"); | |||
|
61 | } | |||
|
62 | } | |||
|
63 | } | |||
|
64 | } | |||
|
65 | #endif | |||
|
66 | break; | |||
|
67 | ||||
|
68 | //****** | |||
|
69 | // BURST | |||
|
70 | case(LFR_MODE_BURST): | |||
|
71 | break; | |||
|
72 | ||||
|
73 | //***** | |||
|
74 | // SBM1 | |||
|
75 | case(LFR_MODE_SBM1): | |||
|
76 | #ifdef GSA | |||
|
77 | PRINTF("in waveform_isr *** unexpected waveform picker interruption\n") | |||
|
78 | #else | |||
|
79 | if (waveform_picker_regs->burst_enable == 0x22) { | |||
|
80 | if (waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) { | |||
|
81 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1_bis); | |||
|
82 | } | |||
|
83 | else { | |||
|
84 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); | |||
|
85 | } | |||
|
86 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_MODE_SBM1 ) != RTEMS_SUCCESSFUL) { | |||
|
87 | PRINTF("in waveforms_isr *** Error sending event to WFRM\n") | |||
|
88 | rtems_event_send( Task_id[TASKID_DUMB], RTEMS_EVENT_2 ); | |||
|
89 | } | |||
|
90 | } | |||
|
91 | waveform_picker_regs->status = 0x00; | |||
|
92 | #endif | |||
|
93 | break; | |||
|
94 | ||||
|
95 | //***** | |||
|
96 | // SBM2 | |||
|
97 | case(LFR_MODE_SBM2): | |||
|
98 | break; | |||
|
99 | ||||
|
100 | //******** | |||
|
101 | // DEFAULT | |||
|
102 | default: | |||
|
103 | break; | |||
|
104 | } | |||
|
105 | } | |||
|
106 | ||||
35 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ) |
|
107 | rtems_isr waveforms_simulator_isr( rtems_vector_number vector ) | |
36 | { |
|
108 | { | |
37 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { |
|
109 | if (rtems_event_send( Task_id[TASKID_WFRM], RTEMS_EVENT_0 ) != RTEMS_SUCCESSFUL) { | |
38 | printf("In waveforms_isr *** Error sending event to WFRM\n"); |
|
110 | printf("In waveforms_isr *** Error sending event to WFRM\n"); | |
39 | } |
|
111 | } | |
40 | } |
|
112 | } | |
41 |
|
113 | |||
42 | rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP |
|
114 | rtems_task wfrm_task(rtems_task_argument argument) //used with the waveform picker VHDL IP | |
43 | { |
|
115 | { | |
44 | spw_ioctl_pkt_send spw_ioctl_send; |
|
116 | spw_ioctl_pkt_send spw_ioctl_send; | |
45 | rtems_event_set event_out; |
|
117 | rtems_event_set event_out; | |
46 | ExtendedTMHeader_t header; |
|
118 | ExtendedTMHeader_t header; | |
47 |
|
119 | |||
48 | header.targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
120 | header.targetLogicalAddress = CCSDS_DESTINATION_ID; | |
49 | header.protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
121 | header.protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
50 | header.reserved = 0x00; |
|
122 | header.reserved = 0x00; | |
51 | header.userApplication = CCSDS_USER_APP; |
|
123 | header.userApplication = CCSDS_USER_APP; | |
52 | header.packetID[0] = 0x0c; |
|
124 | header.packetID[0] = 0x0c; | |
53 | header.packetID[1] = 0xcc; |
|
125 | header.packetID[1] = 0xcc; | |
54 | header.packetSequenceControl[0] = 0x00; |
|
126 | header.packetSequenceControl[0] = 0x00; | |
55 | header.packetSequenceControl[1] = 0x00; |
|
127 | header.packetSequenceControl[1] = 0x00; | |
56 | header.packetLength[0] = 0x00; |
|
128 | header.packetLength[0] = 0x00; | |
57 | header.packetLength[1] = 0x00; |
|
129 | header.packetLength[1] = 0x00; | |
58 | header.dataFieldHeader[0] = 0x10; |
|
130 | header.dataFieldHeader[0] = 0x10; | |
59 | header.dataFieldHeader[1] = TM_TYPE_LFR_SCIENCE; // service type |
|
131 | header.dataFieldHeader[1] = TM_TYPE_LFR_SCIENCE; // service type | |
60 | header.dataFieldHeader[2] = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
132 | header.dataFieldHeader[2] = TM_SUBTYPE_LFR_SCIENCE; // service subtype | |
61 | header.dataFieldHeader[3] = CCSDS_DESTINATION_ID_GROUND; |
|
133 | header.dataFieldHeader[3] = CCSDS_DESTINATION_ID_GROUND; | |
62 |
|
134 | |||
63 | header.auxiliaryHeader[0] = 0x00; |
|
135 | header.auxiliaryHeader[0] = 0x00; | |
64 | header.auxiliaryHeader[1] = 0x1f; |
|
136 | header.auxiliaryHeader[1] = 0x1f; | |
65 | header.auxiliaryHeader[2] = 0x07; // PKT_CNT |
|
137 | header.auxiliaryHeader[2] = 0x07; // PKT_CNT | |
66 | header.auxiliaryHeader[3] = 0x00; // PKT_NR |
|
138 | header.auxiliaryHeader[3] = 0x00; // PKT_NR | |
67 | header.auxiliaryHeader[4] = 0x00; // BLK_NR MSB |
|
139 | header.auxiliaryHeader[4] = 0x00; // BLK_NR MSB | |
68 | header.auxiliaryHeader[5] = 0x00; // BLK_NR LSB |
|
140 | header.auxiliaryHeader[5] = 0x00; // BLK_NR LSB | |
69 |
|
141 | |||
70 | // BUILD THE PACKET HEADER |
|
142 | // BUILD THE PACKET HEADER | |
71 | spw_ioctl_send.hlen = TM_HEADER_LEN + 4 + 6; // + 4 is for the protocole extra header, + 6 is for the auxiliary header |
|
143 | spw_ioctl_send.hlen = TM_HEADER_LEN + 4 + 6; // + 4 is for the protocole extra header, + 6 is for the auxiliary header | |
72 | spw_ioctl_send.hdr = (char*) &header; |
|
144 | spw_ioctl_send.hdr = (char*) &header; | |
73 |
|
145 | |||
74 | init_waveforms(); |
|
146 | init_waveforms(); | |
75 |
|
147 | |||
76 | PRINTF("in WFRM ***\n") |
|
148 | PRINTF("in WFRM ***\n") | |
77 |
|
149 | |||
78 | while(1){ |
|
150 | while(1){ | |
79 |
|
151 | // wait for an RTEMS_EVENT | ||
80 | rtems_event_receive(RTEMS_EVENT_0, RTEMS_WAIT, RTEMS_NO_TIMEOUT, &event_out); // wait for an RTEMS_EVENT0 |
|
152 | rtems_event_receive(RTEMS_EVENT_0 | RTEMS_EVENT_1 | RTEMS_EVENT_2 | RTEMS_EVENT_3 | RTEMS_EVENT_4, | |
81 | PRINTF("in WFRM *** send wfrm\n") |
|
153 | RTEMS_WAIT | RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &event_out); | |
82 | header.dataFieldHeader[4] = (unsigned char) (time_management_regs->coarse_time>>24); |
|
154 | header.dataFieldHeader[4] = (unsigned char) (time_management_regs->coarse_time>>24); | |
83 | header.dataFieldHeader[5] = (unsigned char) (time_management_regs->coarse_time>>16); |
|
155 | header.dataFieldHeader[5] = (unsigned char) (time_management_regs->coarse_time>>16); | |
84 | header.dataFieldHeader[6] = (unsigned char) (time_management_regs->coarse_time>>8); |
|
156 | header.dataFieldHeader[6] = (unsigned char) (time_management_regs->coarse_time>>8); | |
85 | header.dataFieldHeader[7] = (unsigned char) (time_management_regs->coarse_time); |
|
157 | header.dataFieldHeader[7] = (unsigned char) (time_management_regs->coarse_time); | |
86 | header.dataFieldHeader[8] = (unsigned char) (time_management_regs->fine_time>>8); |
|
158 | header.dataFieldHeader[8] = (unsigned char) (time_management_regs->fine_time>>8); | |
87 | header.dataFieldHeader[9] = (unsigned char) (time_management_regs->fine_time); |
|
159 | header.dataFieldHeader[9] = (unsigned char) (time_management_regs->fine_time); | |
88 |
|
160 | |||
89 | //*************** |
|
161 | switch(event_out) | |
90 | // send snapshots |
|
162 | { | |
91 | // F0 |
|
163 | //******** | |
92 | //send_waveform( &header, wf_snap_f0, SID_NORM_SWF_F0, &spw_ioctl_send); |
|
164 | // STANDBY | |
93 | // F1 |
|
165 | case(RTEMS_EVENT_MODE_STANDBY): | |
94 | if (waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) { |
|
166 | break; | |
95 | send_waveform( &header, wf_snap_f1_bis, SID_NORM_SWF_F1, &spw_ioctl_send); |
|
167 | ||
96 | } |
|
168 | //******* | |
97 | else { |
|
169 | // NORMAL | |
98 | send_waveform( &header, wf_snap_f1, SID_NORM_SWF_F1, &spw_ioctl_send); |
|
170 | case(RTEMS_EVENT_MODE_NORMAL): | |
|
171 | //*************** | |||
|
172 | // send snapshots | |||
|
173 | // F0 | |||
|
174 | send_waveform( &header, wf_snap_f0, SID_NORM_SWF_F0, &spw_ioctl_send); | |||
|
175 | // F1 | |||
|
176 | send_waveform( &header, wf_snap_f1, SID_NORM_SWF_F1, &spw_ioctl_send); | |||
|
177 | // F2 | |||
|
178 | send_waveform( &header, wf_snap_f2, SID_NORM_SWF_F2, &spw_ioctl_send); | |||
|
179 | #ifdef GSA | |||
|
180 | // irq processed, reset the related register of the timer unit | |||
|
181 | gptimer_regs->timer[2].ctrl = gptimer_regs->timer[2].ctrl | 0x00000010; | |||
|
182 | #else | |||
|
183 | // irq processed, reset the related register of the waveform picker | |||
|
184 | waveform_picker_regs->status = 0x00; | |||
|
185 | waveform_picker_regs->burst_enable = 0x07; | |||
|
186 | #endif | |||
|
187 | break; | |||
|
188 | ||||
|
189 | //***** | |||
|
190 | // SBM1 | |||
|
191 | case(RTEMS_EVENT_MODE_SBM1): | |||
|
192 | // F1 | |||
|
193 | if (waveform_picker_regs->addr_data_f1 == (int) wf_snap_f1) { | |||
|
194 | send_waveform( &header, wf_snap_f1_bis, SID_NORM_SWF_F1, &spw_ioctl_send); | |||
|
195 | } | |||
|
196 | else { | |||
|
197 | send_waveform( &header, wf_snap_f1, SID_NORM_SWF_F1, &spw_ioctl_send); | |||
|
198 | } | |||
|
199 | break; | |||
|
200 | default: | |||
|
201 | break; | |||
99 | } |
|
202 | } | |
100 | // F2 |
|
|||
101 | //send_waveform( &header, wf_snap_f2, SID_NORM_SWF_F2, &spw_ioctl_send); |
|
|||
102 |
|
||||
103 | #ifdef GSA |
|
|||
104 | // irq processed, reset the related register of the timer unit |
|
|||
105 | gptimer_regs->timer[2].ctrl = gptimer_regs->timer[2].ctrl | 0x00000010; |
|
|||
106 | #else |
|
|||
107 | // irq processed, reset the related register of the waveform picker |
|
|||
108 | //waveform_picker_regs->status = 0x00; |
|
|||
109 | //waveform_picker_regs->burst_enable = 0x07; |
|
|||
110 | #endif |
|
|||
111 |
|
||||
112 | } |
|
203 | } | |
113 | } |
|
204 | } | |
114 |
|
205 | |||
115 | //****************** |
|
206 | //****************** | |
116 | // general functions |
|
207 | // general functions | |
117 | void init_waveforms( void ) |
|
208 | void init_waveforms( void ) | |
118 | { |
|
209 | { | |
119 | int i = 0; |
|
210 | int i = 0; | |
120 |
|
211 | |||
121 | for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) |
|
212 | for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) | |
122 | { |
|
213 | { | |
123 | //*** |
|
214 | //*** | |
124 | // F0 |
|
215 | // F0 | |
125 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; // |
|
216 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x88887777; // | |
126 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; // |
|
217 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; // | |
127 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; // |
|
218 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0x44443333; // | |
128 |
|
219 | |||
129 | //*** |
|
220 | //*** | |
130 | // F1 |
|
221 | // F1 | |
131 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111; |
|
222 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x22221111; | |
132 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333; |
|
223 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x44443333; | |
133 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000; |
|
224 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000; | |
134 |
|
225 | |||
135 | //*** |
|
226 | //*** | |
136 | // F2 |
|
227 | // F2 | |
137 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333; |
|
228 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET ] = 0x44443333; | |
138 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; |
|
229 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET ] = 0x22221111; | |
139 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000; |
|
230 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET ] = 0xaaaa0000; | |
140 |
|
231 | |||
141 | //*** |
|
232 | //*** | |
142 | // F3 |
|
233 | // F3 | |
143 | //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1; |
|
234 | //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 0 ] = val1; | |
144 | //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2; |
|
235 | //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 1 ] = val2; | |
145 | //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000; |
|
236 | //wf_cont_f3[ (i* NB_WORDS_SWF_BLK) + 2 ] = 0xaaaa0000; | |
146 | } |
|
237 | } | |
147 | } |
|
238 | } | |
148 |
|
239 | |||
149 | void init_waveform_header( ExtendedTMHeader_t * header, unsigned int sid ) |
|
240 | void init_waveform_header( ExtendedTMHeader_t * header, unsigned int sid ) | |
150 | { |
|
241 | { | |
151 |
|
242 | |||
152 | header->targetLogicalAddress = CCSDS_DESTINATION_ID; |
|
243 | header->targetLogicalAddress = CCSDS_DESTINATION_ID; | |
153 | header->protocolIdentifier = CCSDS_PROTOCOLE_ID; |
|
244 | header->protocolIdentifier = CCSDS_PROTOCOLE_ID; | |
154 | header->reserved = 0x00; |
|
245 | header->reserved = 0x00; | |
155 | header->userApplication = CCSDS_USER_APP; |
|
246 | header->userApplication = CCSDS_USER_APP; | |
156 | header->packetID[0] = 0x0c; |
|
247 | header->packetID[0] = 0x0c; | |
157 | header->packetID[1] = 0xcc; |
|
248 | header->packetID[1] = 0xcc; | |
158 | header->packetSequenceControl[0] = 0x00; |
|
249 | header->packetSequenceControl[0] = 0x00; | |
159 | header->packetSequenceControl[1] = 0x00; |
|
250 | header->packetSequenceControl[1] = 0x00; | |
160 | header->packetLength[0] = 0x00; |
|
251 | header->packetLength[0] = 0x00; | |
161 | header->packetLength[1] = 0x00; |
|
252 | header->packetLength[1] = 0x00; | |
162 | header->dataFieldHeader[0] = 0x10; |
|
253 | header->dataFieldHeader[0] = 0x10; | |
163 | header->dataFieldHeader[1] = TM_TYPE_LFR_SCIENCE; // service type |
|
254 | header->dataFieldHeader[1] = TM_TYPE_LFR_SCIENCE; // service type | |
164 | header->dataFieldHeader[2] = TM_SUBTYPE_LFR_SCIENCE; // service subtype |
|
255 | header->dataFieldHeader[2] = TM_SUBTYPE_LFR_SCIENCE; // service subtype | |
165 | header->dataFieldHeader[3] = CCSDS_DESTINATION_ID_GROUND; |
|
256 | header->dataFieldHeader[3] = CCSDS_DESTINATION_ID_GROUND; | |
166 |
|
257 | |||
167 | header->auxiliaryHeader[0] = sid; |
|
258 | header->auxiliaryHeader[0] = sid; | |
168 | header->auxiliaryHeader[1] = 0x1f; |
|
259 | header->auxiliaryHeader[1] = 0x1f; | |
169 | header->auxiliaryHeader[2] = 0x07; // PKT_CNT |
|
260 | header->auxiliaryHeader[2] = 0x07; // PKT_CNT | |
170 | header->auxiliaryHeader[3] = 0x00; // PKT_NR |
|
261 | header->auxiliaryHeader[3] = 0x00; // PKT_NR | |
171 | header->auxiliaryHeader[4] = 0x00; // BLK_NR MSB |
|
262 | header->auxiliaryHeader[4] = 0x00; // BLK_NR MSB | |
172 | header->auxiliaryHeader[5] = 0x00; // BLK_NR LSB |
|
263 | header->auxiliaryHeader[5] = 0x00; // BLK_NR LSB | |
173 | } |
|
264 | } | |
174 |
|
265 | |||
175 | void reset_waveforms( void ) |
|
266 | void reset_waveforms( void ) | |
176 | { |
|
267 | { | |
177 | int i = 0; |
|
268 | int i = 0; | |
178 |
|
269 | |||
179 | for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) |
|
270 | for (i=0; i< NB_SAMPLES_PER_SNAPSHOT; i++) | |
180 | { |
|
271 | { | |
181 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x10002000; |
|
272 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x10002000; | |
182 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000; |
|
273 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000; | |
183 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000; |
|
274 | wf_snap_f0[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000; | |
184 |
|
275 | |||
185 | //*** |
|
276 | //*** | |
186 | // F1 |
|
277 | // F1 | |
187 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x1000f000; |
|
278 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x1000f000; | |
188 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0xf0001000; |
|
279 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0xf0001000; | |
189 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000; |
|
280 | wf_snap_f1[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x40008000; | |
190 |
|
281 | |||
191 | //*** |
|
282 | //*** | |
192 | // F2 |
|
283 | // F2 | |
193 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x40008000; |
|
284 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 0 + TIME_OFFSET] = 0x40008000; | |
194 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000; |
|
285 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 1 + TIME_OFFSET] = 0x20001000; | |
195 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x10002000; |
|
286 | wf_snap_f2[ (i* NB_WORDS_SWF_BLK) + 2 + TIME_OFFSET] = 0x10002000; | |
196 |
|
287 | |||
197 | //*** |
|
288 | //*** | |
198 | // F3 |
|
289 | // F3 | |
199 | /*wf_cont_f3[ i* NB_WORDS_SWF_BLK + 0 ] = build_value( i, i ); // v and 1 |
|
290 | /*wf_cont_f3[ i* NB_WORDS_SWF_BLK + 0 ] = build_value( i, i ); // v and 1 | |
200 | wf_cont_f3[ i* NB_WORDS_SWF_BLK + 1 ] = build_value( i, i ); // e2 and b1 |
|
291 | wf_cont_f3[ i* NB_WORDS_SWF_BLK + 1 ] = build_value( i, i ); // e2 and b1 | |
201 | wf_cont_f3[ i* NB_WORDS_SWF_BLK + 2 ] = build_value( i, i ); // b2 and b3*/ |
|
292 | wf_cont_f3[ i* NB_WORDS_SWF_BLK + 2 ] = build_value( i, i ); // b2 and b3*/ | |
202 | } |
|
293 | } | |
203 | } |
|
294 | } | |
204 |
|
295 | |||
205 | void send_waveform( ExtendedTMHeader_t *header, volatile int *waveform, |
|
296 | void send_waveform( ExtendedTMHeader_t *header, volatile int *waveform, | |
206 | unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send) |
|
297 | unsigned int sid, spw_ioctl_pkt_send *spw_ioctl_send) | |
207 | { |
|
298 | { | |
208 | unsigned int i = 0; |
|
299 | unsigned int i = 0; | |
209 | unsigned int length = 0; |
|
300 | unsigned int length = 0; | |
210 | rtems_status_code status; |
|
301 | rtems_status_code status; | |
211 |
|
302 | |||
212 | for (i=0; i<7; i++) // send waveform |
|
303 | for (i=0; i<7; i++) // send waveform | |
213 | { |
|
304 | { | |
214 | header->auxiliaryHeader[3] = (unsigned char) i+1; // PKT_NR |
|
305 | header->auxiliaryHeader[3] = (unsigned char) i+1; // PKT_NR | |
215 | // BUILD THE DATA |
|
306 | // BUILD THE DATA | |
216 | if (i==6) { |
|
307 | if (i==6) { | |
217 | spw_ioctl_send->dlen = 8 * NB_BYTES_SWF_BLK; |
|
308 | spw_ioctl_send->dlen = 8 * NB_BYTES_SWF_BLK; | |
218 | length = TM_LEN_SCI_NORM_SWF_8; |
|
309 | length = TM_LEN_SCI_NORM_SWF_8; | |
219 | header->auxiliaryHeader[4] = 0x00; // BLK_NR MSB |
|
310 | header->auxiliaryHeader[4] = 0x00; // BLK_NR MSB | |
220 | header->auxiliaryHeader[5] = 0x08; // BLK_NR LSB |
|
311 | header->auxiliaryHeader[5] = 0x08; // BLK_NR LSB | |
221 | } |
|
312 | } | |
222 | else { |
|
313 | else { | |
223 | spw_ioctl_send->dlen = 340 * NB_BYTES_SWF_BLK; |
|
314 | spw_ioctl_send->dlen = 340 * NB_BYTES_SWF_BLK; | |
224 | length = TM_LEN_SCI_NORM_SWF_340; |
|
315 | length = TM_LEN_SCI_NORM_SWF_340; | |
225 | header->auxiliaryHeader[4] = 0x01; // BLK_NR MSB |
|
316 | header->auxiliaryHeader[4] = 0x01; // BLK_NR MSB | |
226 | header->auxiliaryHeader[5] = 0x54; // BLK_NR LSB |
|
317 | header->auxiliaryHeader[5] = 0x54; // BLK_NR LSB | |
227 | } |
|
318 | } | |
228 | if (sid == SID_NORM_SWF_F0) { |
|
319 | if (sid == SID_NORM_SWF_F0) { | |
229 | spw_ioctl_send->data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) + (1 * TIME_OFFSET) ]; |
|
320 | spw_ioctl_send->data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) + (1 * TIME_OFFSET) ]; | |
230 | } |
|
321 | } | |
231 | else if (sid == SID_NORM_SWF_F1) { |
|
322 | else if (sid == SID_NORM_SWF_F1) { | |
232 | spw_ioctl_send->data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) + (1 * TIME_OFFSET) ]; |
|
323 | spw_ioctl_send->data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) + (1 * TIME_OFFSET) ]; | |
233 | } |
|
324 | } | |
234 | else if (sid == SID_NORM_SWF_F2) { |
|
325 | else if (sid == SID_NORM_SWF_F2) { | |
235 | spw_ioctl_send->data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) + (1 * TIME_OFFSET) ]; |
|
326 | spw_ioctl_send->data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) + (1 * TIME_OFFSET) ]; | |
236 | } |
|
327 | } | |
237 | else { |
|
328 | else { | |
238 | spw_ioctl_send->data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ]; |
|
329 | spw_ioctl_send->data = (char*) &waveform[ (i * 340 * NB_WORDS_SWF_BLK) ]; | |
239 | } |
|
330 | } | |
240 | // BUILD THE HEADER |
|
331 | // BUILD THE HEADER | |
241 | header->packetLength[0] = (unsigned char) (length>>8); |
|
332 | header->packetLength[0] = (unsigned char) (length>>8); | |
242 | header->packetLength[1] = (unsigned char) (length); |
|
333 | header->packetLength[1] = (unsigned char) (length); | |
243 | header->auxiliaryHeader[0] = sid; // SID |
|
334 | header->auxiliaryHeader[0] = sid; // SID | |
244 | // SEND PACKET |
|
335 | // SEND PACKET | |
245 | status = write_spw(spw_ioctl_send); |
|
336 | status = write_spw(spw_ioctl_send); | |
246 | if (status != RTEMS_SUCCESSFUL) { |
|
337 | if (status != RTEMS_SUCCESSFUL) { | |
247 | while (true) { |
|
338 | while (true) { | |
248 | if (status != RTEMS_SUCCESSFUL) { |
|
339 | if (status != RTEMS_SUCCESSFUL) { | |
249 | status = write_spw(spw_ioctl_send); |
|
340 | status = write_spw(spw_ioctl_send); | |
250 | //PRINTF1("%d", i) |
|
341 | //PRINTF1("%d", i) | |
251 | sched_yield(); |
|
342 | sched_yield(); | |
252 | } |
|
343 | } | |
253 | else { |
|
344 | else { | |
254 | //PRINTF("\n") |
|
345 | //PRINTF("\n") | |
255 | break; |
|
346 | break; | |
256 | } |
|
347 | } | |
257 | } |
|
348 | } | |
258 | } |
|
349 | } | |
259 | } |
|
350 | } | |
260 | } |
|
351 | } | |
261 |
|
352 | |||
262 | int build_value(int value1, int value0) |
|
353 | int build_value(int value1, int value0) | |
263 | { |
|
354 | { | |
264 | int aux = 0; |
|
355 | int aux = 0; | |
265 | int aux1 = 0; |
|
356 | int aux1 = 0; | |
266 | int aux0 = 0; |
|
357 | int aux0 = 0; | |
267 | int value1_aux = 0; |
|
358 | int value1_aux = 0; | |
268 | int value0_aux = 0; |
|
359 | int value0_aux = 0; | |
269 |
|
360 | |||
270 | value1_aux = value1; |
|
361 | value1_aux = value1; | |
271 | value0_aux = value0; |
|
362 | value0_aux = value0; | |
272 |
|
363 | |||
273 | //****** |
|
364 | //****** | |
274 | // B3 B2 |
|
365 | // B3 B2 | |
275 | if (value1_aux > 8191) value1_aux = 8191; |
|
366 | if (value1_aux > 8191) value1_aux = 8191; | |
276 | if (value1_aux < -8192) value1_aux = -8192; |
|
367 | if (value1_aux < -8192) value1_aux = -8192; | |
277 | aux1 = ( (int) ( ( (unsigned char) (value1_aux / 256 ) ) << 8 ) ) |
|
368 | aux1 = ( (int) ( ( (unsigned char) (value1_aux / 256 ) ) << 8 ) ) | |
278 | + ( (int) ( (unsigned char) (value1_aux ) ) ); |
|
369 | + ( (int) ( (unsigned char) (value1_aux ) ) ); | |
279 |
|
370 | |||
280 | //****** |
|
371 | //****** | |
281 | // B1 B0 |
|
372 | // B1 B0 | |
282 | if (value0_aux > 8191) value0_aux = 8191; |
|
373 | if (value0_aux > 8191) value0_aux = 8191; | |
283 | if (value0_aux < -8192) value0_aux = -8192; |
|
374 | if (value0_aux < -8192) value0_aux = -8192; | |
284 | aux0 = ( (int) ( ( (unsigned char) (value0_aux / 256) ) << 8 ) ) |
|
375 | aux0 = ( (int) ( ( (unsigned char) (value0_aux / 256) ) << 8 ) ) | |
285 | + ( (int) ( (unsigned char) (value0_aux ) ) ); |
|
376 | + ( (int) ( (unsigned char) (value0_aux ) ) ); | |
286 |
|
377 | |||
287 | aux = (aux1 << 16) + aux0; |
|
378 | aux = (aux1 << 16) + aux0; | |
288 |
|
379 | |||
289 | return aux; |
|
380 | return aux; | |
290 | } |
|
381 | } | |
291 |
|
382 | |||
292 | void init_waveform_picker_regs() |
|
383 | void init_waveform_picker_regs() | |
293 | { // 1 1 0 0 0 BW = 0 => BIAS_WORKS |
|
384 | { | |
294 | waveform_picker_regs->data_shaping = 0x18; // R1 R0 SP1 SP0 BW |
|
385 | set_data_shaping_parameters(param_common.sy_lfr_common1); | |
295 | waveform_picker_regs->burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 |
|
386 | waveform_picker_regs->burst_enable = 0x00; // burst f2, f1, f0 enable f3, f2, f1, f0 | |
296 | waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // |
|
387 | waveform_picker_regs->addr_data_f0 = (int) (wf_snap_f0); // | |
297 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); // |
|
388 | waveform_picker_regs->addr_data_f1 = (int) (wf_snap_f1); // | |
298 | waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); // |
|
389 | waveform_picker_regs->addr_data_f2 = (int) (wf_snap_f2); // | |
299 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); // |
|
390 | waveform_picker_regs->addr_data_f3 = (int) (wf_cont_f3); // | |
300 | waveform_picker_regs->status = 0x00; // |
|
391 | waveform_picker_regs->status = 0x00; // | |
301 | waveform_picker_regs->delta_snapshot = 0x5; // max 2 bytes |
|
392 | waveform_picker_regs->delta_snapshot = 0x5; // max 2 bytes | |
302 | waveform_picker_regs->delta_f2_f1 = 0xffff; // max 4 bytes |
|
393 | waveform_picker_regs->delta_f2_f1 = 0xffff; // max 4 bytes | |
303 | waveform_picker_regs->delta_f2_f0 = 0x17c00; // max 5 bytes |
|
394 | waveform_picker_regs->delta_f2_f0 = 0x17c00; // max 5 bytes | |
304 | waveform_picker_regs->nb_burst_available = 0x180; // max 3 bytes, size of the buffer in burst (1 burst = 16 x 4 octets) |
|
395 | waveform_picker_regs->nb_burst_available = 0x180; // max 3 bytes, size of the buffer in burst (1 burst = 16 x 4 octets) | |
305 | waveform_picker_regs->nb_snapshot_param = 0x7ff; // max 3 octets, 2048 - 1 |
|
396 | waveform_picker_regs->nb_snapshot_param = 0x7ff; // max 3 octets, 2048 - 1 | |
306 | //waveform_picker_regs->delta_snapshot = 0x2; // max 2 bytes, = period / 2 |
|
397 | //waveform_picker_regs->delta_snapshot = 0x2; // max 2 bytes, = period / 2 | |
307 | //waveform_picker_regs->delta_f2_f1 = 0x2d00; // max 4 bytes |
|
398 | //waveform_picker_regs->delta_f2_f1 = 0x2d00; // max 4 bytes | |
308 | //waveform_picker_regs->delta_f2_f0 = 0x2f80; // max 5 bytes |
|
399 | //waveform_picker_regs->delta_f2_f0 = 0x2f80; // max 5 bytes | |
309 | //waveform_picker_regs->nb_burst_available = 0x30; // max 3 bytes, size of the buffer in burst (1 burst = 16 x 4 octets) |
|
400 | //waveform_picker_regs->nb_burst_available = 0x30; // max 3 bytes, size of the buffer in burst (1 burst = 16 x 4 octets) | |
310 | //waveform_picker_regs->nb_snapshot_param = 0xff; // max 3 octets, 256 - 1 |
|
401 | //waveform_picker_regs->nb_snapshot_param = 0xff; // max 3 octets, 256 - 1 | |
311 | } |
|
402 | } | |
312 |
|
403 | |||
|
404 | void set_data_shaping_parameters(unsigned char parameters) | |||
|
405 | { | |||
|
406 | // get the parameters for the data shaping [BW SP0 SP1 R0 R1] in sy_lfr_common1 and configure the register | |||
|
407 | // waveform picker : [R1 R0 SP1 SP0 BW] | |||
|
408 | waveform_picker_regs->data_shaping = | |||
|
409 | ( (parameters & 0x10) >> 4 ) // BW | |||
|
410 | + ( (parameters & 0x08) >> 2 ) // SP0 | |||
|
411 | + ( (parameters & 0x04) ) // SP1 | |||
|
412 | + ( (parameters & 0x02) << 2 ) // R0 | |||
|
413 | + ( (parameters & 0x01) << 4 ); // R1 | |||
|
414 | } |
General Comments 0
You need to be logged in to leave comments.
Login now