@@ -1,273 +1,273 | |||||
1 | ############################################################################# |
|
1 | ############################################################################# | |
2 | # Makefile for building: bin/fsw |
|
2 | # Makefile for building: bin/fsw | |
3 |
# Generated by qmake (2.01a) (Qt 4.8.6) on: |
|
3 | # Generated by qmake (2.01a) (Qt 4.8.6) on: Mon Jun 23 07:48:42 2014 | |
4 | # Project: fsw-qt.pro |
|
4 | # Project: fsw-qt.pro | |
5 | # Template: app |
|
5 | # Template: app | |
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
6 | # Command: /usr/bin/qmake-qt4 -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
7 | ############################################################################# |
|
7 | ############################################################################# | |
8 |
|
8 | |||
9 | ####### Compiler, tools and options |
|
9 | ####### Compiler, tools and options | |
10 |
|
10 | |||
11 | CC = sparc-rtems-gcc |
|
11 | CC = sparc-rtems-gcc | |
12 | CXX = sparc-rtems-g++ |
|
12 | CXX = sparc-rtems-g++ | |
13 | DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=12 -DPRINT_MESSAGES_ON_CONSOLE |
|
13 | DEFINES = -DSW_VERSION_N1=1 -DSW_VERSION_N2=0 -DSW_VERSION_N3=0 -DSW_VERSION_N4=12 -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 -I../header/processing -I../src/LFR_basic-parameters |
|
16 | INCPATH = -I/usr/lib64/qt4/mkspecs/linux-g++ -I. -I../src -I../header -I../header/processing -I../src/LFR_basic-parameters | |
17 | LINK = sparc-rtems-g++ |
|
17 | LINK = sparc-rtems-g++ | |
18 | LFLAGS = |
|
18 | LFLAGS = | |
19 | LIBS = $(SUBLIBS) |
|
19 | LIBS = $(SUBLIBS) | |
20 | AR = sparc-rtems-ar rcs |
|
20 | AR = sparc-rtems-ar rcs | |
21 | RANLIB = |
|
21 | RANLIB = | |
22 | QMAKE = /usr/bin/qmake-qt4 |
|
22 | QMAKE = /usr/bin/qmake-qt4 | |
23 | TAR = tar -cf |
|
23 | TAR = tar -cf | |
24 | COMPRESS = gzip -9f |
|
24 | COMPRESS = gzip -9f | |
25 | COPY = cp -f |
|
25 | COPY = cp -f | |
26 | SED = sed |
|
26 | SED = sed | |
27 | COPY_FILE = $(COPY) |
|
27 | COPY_FILE = $(COPY) | |
28 | COPY_DIR = $(COPY) -r |
|
28 | COPY_DIR = $(COPY) -r | |
29 | STRIP = sparc-rtems-strip |
|
29 | STRIP = sparc-rtems-strip | |
30 | INSTALL_FILE = install -m 644 -p |
|
30 | INSTALL_FILE = install -m 644 -p | |
31 | INSTALL_DIR = $(COPY_DIR) |
|
31 | INSTALL_DIR = $(COPY_DIR) | |
32 | INSTALL_PROGRAM = install -m 755 -p |
|
32 | INSTALL_PROGRAM = install -m 755 -p | |
33 | DEL_FILE = rm -f |
|
33 | DEL_FILE = rm -f | |
34 | SYMLINK = ln -f -s |
|
34 | SYMLINK = ln -f -s | |
35 | DEL_DIR = rmdir |
|
35 | DEL_DIR = rmdir | |
36 | MOVE = mv -f |
|
36 | MOVE = mv -f | |
37 | CHK_DIR_EXISTS= test -d |
|
37 | CHK_DIR_EXISTS= test -d | |
38 | MKDIR = mkdir -p |
|
38 | MKDIR = mkdir -p | |
39 |
|
39 | |||
40 | ####### Output directory |
|
40 | ####### Output directory | |
41 |
|
41 | |||
42 | OBJECTS_DIR = obj/ |
|
42 | OBJECTS_DIR = obj/ | |
43 |
|
43 | |||
44 | ####### Files |
|
44 | ####### Files | |
45 |
|
45 | |||
46 | SOURCES = ../src/wf_handler.c \ |
|
46 | SOURCES = ../src/wf_handler.c \ | |
47 | ../src/tc_handler.c \ |
|
47 | ../src/tc_handler.c \ | |
48 | ../src/fsw_misc.c \ |
|
48 | ../src/fsw_misc.c \ | |
49 | ../src/fsw_init.c \ |
|
49 | ../src/fsw_init.c \ | |
50 | ../src/fsw_globals.c \ |
|
50 | ../src/fsw_globals.c \ | |
51 | ../src/fsw_spacewire.c \ |
|
51 | ../src/fsw_spacewire.c \ | |
52 | ../src/tc_load_dump_parameters.c \ |
|
52 | ../src/tc_load_dump_parameters.c \ | |
53 | ../src/tm_lfr_tc_exe.c \ |
|
53 | ../src/tm_lfr_tc_exe.c \ | |
54 | ../src/tc_acceptance.c \ |
|
54 | ../src/tc_acceptance.c \ | |
55 | ../src/processing/fsw_processing.c \ |
|
55 | ../src/processing/fsw_processing.c \ | |
56 | ../src/processing/avf0_prc0.c \ |
|
56 | ../src/processing/avf0_prc0.c \ | |
57 | ../src/processing/avf1_prc1.c \ |
|
57 | ../src/processing/avf1_prc1.c \ | |
58 | ../src/processing/avf2_prc2.c \ |
|
58 | ../src/processing/avf2_prc2.c \ | |
59 | ../src/lfr_cpu_usage_report.c \ |
|
59 | ../src/lfr_cpu_usage_report.c \ | |
60 | ../src/LFR_basic-parameters/basic_parameters.c |
|
60 | ../src/LFR_basic-parameters/basic_parameters.c | |
61 | OBJECTS = obj/wf_handler.o \ |
|
61 | OBJECTS = obj/wf_handler.o \ | |
62 | obj/tc_handler.o \ |
|
62 | obj/tc_handler.o \ | |
63 | obj/fsw_misc.o \ |
|
63 | obj/fsw_misc.o \ | |
64 | obj/fsw_init.o \ |
|
64 | obj/fsw_init.o \ | |
65 | obj/fsw_globals.o \ |
|
65 | obj/fsw_globals.o \ | |
66 | obj/fsw_spacewire.o \ |
|
66 | obj/fsw_spacewire.o \ | |
67 | obj/tc_load_dump_parameters.o \ |
|
67 | obj/tc_load_dump_parameters.o \ | |
68 | obj/tm_lfr_tc_exe.o \ |
|
68 | obj/tm_lfr_tc_exe.o \ | |
69 | obj/tc_acceptance.o \ |
|
69 | obj/tc_acceptance.o \ | |
70 | obj/fsw_processing.o \ |
|
70 | obj/fsw_processing.o \ | |
71 | obj/avf0_prc0.o \ |
|
71 | obj/avf0_prc0.o \ | |
72 | obj/avf1_prc1.o \ |
|
72 | obj/avf1_prc1.o \ | |
73 | obj/avf2_prc2.o \ |
|
73 | obj/avf2_prc2.o \ | |
74 | obj/lfr_cpu_usage_report.o \ |
|
74 | obj/lfr_cpu_usage_report.o \ | |
75 | obj/basic_parameters.o |
|
75 | obj/basic_parameters.o | |
76 | DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
76 | DIST = /usr/lib64/qt4/mkspecs/common/unix.conf \ | |
77 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
77 | /usr/lib64/qt4/mkspecs/common/linux.conf \ | |
78 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
78 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ | |
79 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ |
|
79 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ | |
80 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ |
|
80 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ | |
81 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ |
|
81 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ | |
82 | /usr/lib64/qt4/mkspecs/qconfig.pri \ |
|
82 | /usr/lib64/qt4/mkspecs/qconfig.pri \ | |
83 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ |
|
83 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ | |
84 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ |
|
84 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ | |
85 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ |
|
85 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ | |
86 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ |
|
86 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ | |
87 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
87 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ | |
88 | sparc.pri \ |
|
88 | sparc.pri \ | |
89 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
89 | /usr/lib64/qt4/mkspecs/features/release.prf \ | |
90 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
90 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ | |
91 | /usr/lib64/qt4/mkspecs/features/shared.prf \ |
|
91 | /usr/lib64/qt4/mkspecs/features/shared.prf \ | |
92 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
92 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ | |
93 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
93 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ | |
94 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
94 | /usr/lib64/qt4/mkspecs/features/resources.prf \ | |
95 | /usr/lib64/qt4/mkspecs/features/uic.prf \ |
|
95 | /usr/lib64/qt4/mkspecs/features/uic.prf \ | |
96 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ |
|
96 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ | |
97 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
97 | /usr/lib64/qt4/mkspecs/features/lex.prf \ | |
98 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ |
|
98 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf \ | |
99 | fsw-qt.pro |
|
99 | fsw-qt.pro | |
100 | QMAKE_TARGET = fsw |
|
100 | QMAKE_TARGET = fsw | |
101 | DESTDIR = bin/ |
|
101 | DESTDIR = bin/ | |
102 | TARGET = bin/fsw |
|
102 | TARGET = bin/fsw | |
103 |
|
103 | |||
104 | first: all |
|
104 | first: all | |
105 | ####### Implicit rules |
|
105 | ####### Implicit rules | |
106 |
|
106 | |||
107 | .SUFFIXES: .o .c .cpp .cc .cxx .C |
|
107 | .SUFFIXES: .o .c .cpp .cc .cxx .C | |
108 |
|
108 | |||
109 | .cpp.o: |
|
109 | .cpp.o: | |
110 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
110 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
111 |
|
111 | |||
112 | .cc.o: |
|
112 | .cc.o: | |
113 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
113 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
114 |
|
114 | |||
115 | .cxx.o: |
|
115 | .cxx.o: | |
116 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
116 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
117 |
|
117 | |||
118 | .C.o: |
|
118 | .C.o: | |
119 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" |
|
119 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
120 |
|
120 | |||
121 | .c.o: |
|
121 | .c.o: | |
122 | $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" |
|
122 | $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" | |
123 |
|
123 | |||
124 | ####### Build rules |
|
124 | ####### Build rules | |
125 |
|
125 | |||
126 | all: Makefile $(TARGET) |
|
126 | all: Makefile $(TARGET) | |
127 |
|
127 | |||
128 | $(TARGET): $(OBJECTS) |
|
128 | $(TARGET): $(OBJECTS) | |
129 | @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/ |
|
129 | @$(CHK_DIR_EXISTS) bin/ || $(MKDIR) bin/ | |
130 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) |
|
130 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) | |
131 |
|
131 | |||
132 | Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \ |
|
132 | Makefile: fsw-qt.pro /usr/lib64/qt4/mkspecs/linux-g++/qmake.conf /usr/lib64/qt4/mkspecs/common/unix.conf \ | |
133 | /usr/lib64/qt4/mkspecs/common/linux.conf \ |
|
133 | /usr/lib64/qt4/mkspecs/common/linux.conf \ | |
134 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ |
|
134 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf \ | |
135 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ |
|
135 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf \ | |
136 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ |
|
136 | /usr/lib64/qt4/mkspecs/common/g++-base.conf \ | |
137 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ |
|
137 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf \ | |
138 | /usr/lib64/qt4/mkspecs/qconfig.pri \ |
|
138 | /usr/lib64/qt4/mkspecs/qconfig.pri \ | |
139 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ |
|
139 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri \ | |
140 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ |
|
140 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf \ | |
141 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ |
|
141 | /usr/lib64/qt4/mkspecs/features/qt_config.prf \ | |
142 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ |
|
142 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf \ | |
143 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ |
|
143 | /usr/lib64/qt4/mkspecs/features/default_pre.prf \ | |
144 | sparc.pri \ |
|
144 | sparc.pri \ | |
145 | /usr/lib64/qt4/mkspecs/features/release.prf \ |
|
145 | /usr/lib64/qt4/mkspecs/features/release.prf \ | |
146 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ |
|
146 | /usr/lib64/qt4/mkspecs/features/default_post.prf \ | |
147 | /usr/lib64/qt4/mkspecs/features/shared.prf \ |
|
147 | /usr/lib64/qt4/mkspecs/features/shared.prf \ | |
148 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ |
|
148 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf \ | |
149 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ |
|
149 | /usr/lib64/qt4/mkspecs/features/warn_on.prf \ | |
150 | /usr/lib64/qt4/mkspecs/features/resources.prf \ |
|
150 | /usr/lib64/qt4/mkspecs/features/resources.prf \ | |
151 | /usr/lib64/qt4/mkspecs/features/uic.prf \ |
|
151 | /usr/lib64/qt4/mkspecs/features/uic.prf \ | |
152 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ |
|
152 | /usr/lib64/qt4/mkspecs/features/yacc.prf \ | |
153 | /usr/lib64/qt4/mkspecs/features/lex.prf \ |
|
153 | /usr/lib64/qt4/mkspecs/features/lex.prf \ | |
154 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf |
|
154 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf | |
155 | $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
155 | $(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
156 | /usr/lib64/qt4/mkspecs/common/unix.conf: |
|
156 | /usr/lib64/qt4/mkspecs/common/unix.conf: | |
157 | /usr/lib64/qt4/mkspecs/common/linux.conf: |
|
157 | /usr/lib64/qt4/mkspecs/common/linux.conf: | |
158 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: |
|
158 | /usr/lib64/qt4/mkspecs/common/gcc-base.conf: | |
159 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf: |
|
159 | /usr/lib64/qt4/mkspecs/common/gcc-base-unix.conf: | |
160 | /usr/lib64/qt4/mkspecs/common/g++-base.conf: |
|
160 | /usr/lib64/qt4/mkspecs/common/g++-base.conf: | |
161 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf: |
|
161 | /usr/lib64/qt4/mkspecs/common/g++-unix.conf: | |
162 | /usr/lib64/qt4/mkspecs/qconfig.pri: |
|
162 | /usr/lib64/qt4/mkspecs/qconfig.pri: | |
163 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri: |
|
163 | /usr/lib64/qt4/mkspecs/modules/qt_webkit.pri: | |
164 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf: |
|
164 | /usr/lib64/qt4/mkspecs/features/qt_functions.prf: | |
165 | /usr/lib64/qt4/mkspecs/features/qt_config.prf: |
|
165 | /usr/lib64/qt4/mkspecs/features/qt_config.prf: | |
166 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf: |
|
166 | /usr/lib64/qt4/mkspecs/features/exclusive_builds.prf: | |
167 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: |
|
167 | /usr/lib64/qt4/mkspecs/features/default_pre.prf: | |
168 | sparc.pri: |
|
168 | sparc.pri: | |
169 | /usr/lib64/qt4/mkspecs/features/release.prf: |
|
169 | /usr/lib64/qt4/mkspecs/features/release.prf: | |
170 | /usr/lib64/qt4/mkspecs/features/default_post.prf: |
|
170 | /usr/lib64/qt4/mkspecs/features/default_post.prf: | |
171 | /usr/lib64/qt4/mkspecs/features/shared.prf: |
|
171 | /usr/lib64/qt4/mkspecs/features/shared.prf: | |
172 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: |
|
172 | /usr/lib64/qt4/mkspecs/features/unix/gdb_dwarf_index.prf: | |
173 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: |
|
173 | /usr/lib64/qt4/mkspecs/features/warn_on.prf: | |
174 | /usr/lib64/qt4/mkspecs/features/resources.prf: |
|
174 | /usr/lib64/qt4/mkspecs/features/resources.prf: | |
175 | /usr/lib64/qt4/mkspecs/features/uic.prf: |
|
175 | /usr/lib64/qt4/mkspecs/features/uic.prf: | |
176 | /usr/lib64/qt4/mkspecs/features/yacc.prf: |
|
176 | /usr/lib64/qt4/mkspecs/features/yacc.prf: | |
177 | /usr/lib64/qt4/mkspecs/features/lex.prf: |
|
177 | /usr/lib64/qt4/mkspecs/features/lex.prf: | |
178 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf: |
|
178 | /usr/lib64/qt4/mkspecs/features/include_source_dir.prf: | |
179 | qmake: FORCE |
|
179 | qmake: FORCE | |
180 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro |
|
180 | @$(QMAKE) -spec /usr/lib64/qt4/mkspecs/linux-g++ -o Makefile fsw-qt.pro | |
181 |
|
181 | |||
182 | dist: |
|
182 | dist: | |
183 | @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0 |
|
183 | @$(CHK_DIR_EXISTS) obj/fsw1.0.0 || $(MKDIR) obj/fsw1.0.0 | |
184 | $(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 |
|
184 | $(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 | |
185 |
|
185 | |||
186 |
|
186 | |||
187 | clean:compiler_clean |
|
187 | clean:compiler_clean | |
188 | -$(DEL_FILE) $(OBJECTS) |
|
188 | -$(DEL_FILE) $(OBJECTS) | |
189 | -$(DEL_FILE) *~ core *.core |
|
189 | -$(DEL_FILE) *~ core *.core | |
190 |
|
190 | |||
191 |
|
191 | |||
192 | ####### Sub-libraries |
|
192 | ####### Sub-libraries | |
193 |
|
193 | |||
194 | distclean: clean |
|
194 | distclean: clean | |
195 | -$(DEL_FILE) $(TARGET) |
|
195 | -$(DEL_FILE) $(TARGET) | |
196 | -$(DEL_FILE) Makefile |
|
196 | -$(DEL_FILE) Makefile | |
197 |
|
197 | |||
198 |
|
198 | |||
199 | grmon: |
|
199 | grmon: | |
200 | cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u |
|
200 | cd bin && C:/opt/grmon-eval-2.0.29b/win32/bin/grmon.exe -uart COM4 -u | |
201 |
|
201 | |||
202 | check: first |
|
202 | check: first | |
203 |
|
203 | |||
204 | compiler_rcc_make_all: |
|
204 | compiler_rcc_make_all: | |
205 | compiler_rcc_clean: |
|
205 | compiler_rcc_clean: | |
206 | compiler_uic_make_all: |
|
206 | compiler_uic_make_all: | |
207 | compiler_uic_clean: |
|
207 | compiler_uic_clean: | |
208 | compiler_image_collection_make_all: qmake_image_collection.cpp |
|
208 | compiler_image_collection_make_all: qmake_image_collection.cpp | |
209 | compiler_image_collection_clean: |
|
209 | compiler_image_collection_clean: | |
210 | -$(DEL_FILE) qmake_image_collection.cpp |
|
210 | -$(DEL_FILE) qmake_image_collection.cpp | |
211 | compiler_yacc_decl_make_all: |
|
211 | compiler_yacc_decl_make_all: | |
212 | compiler_yacc_decl_clean: |
|
212 | compiler_yacc_decl_clean: | |
213 | compiler_yacc_impl_make_all: |
|
213 | compiler_yacc_impl_make_all: | |
214 | compiler_yacc_impl_clean: |
|
214 | compiler_yacc_impl_clean: | |
215 | compiler_lex_make_all: |
|
215 | compiler_lex_make_all: | |
216 | compiler_lex_clean: |
|
216 | compiler_lex_clean: | |
217 | compiler_clean: |
|
217 | compiler_clean: | |
218 |
|
218 | |||
219 | ####### Compile |
|
219 | ####### Compile | |
220 |
|
220 | |||
221 | obj/wf_handler.o: ../src/wf_handler.c |
|
221 | obj/wf_handler.o: ../src/wf_handler.c | |
222 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c |
|
222 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/wf_handler.o ../src/wf_handler.c | |
223 |
|
223 | |||
224 | obj/tc_handler.o: ../src/tc_handler.c |
|
224 | obj/tc_handler.o: ../src/tc_handler.c | |
225 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c |
|
225 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_handler.o ../src/tc_handler.c | |
226 |
|
226 | |||
227 | obj/fsw_misc.o: ../src/fsw_misc.c |
|
227 | obj/fsw_misc.o: ../src/fsw_misc.c | |
228 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c |
|
228 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_misc.o ../src/fsw_misc.c | |
229 |
|
229 | |||
230 | obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c |
|
230 | obj/fsw_init.o: ../src/fsw_init.c ../src/fsw_config.c | |
231 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c |
|
231 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_init.o ../src/fsw_init.c | |
232 |
|
232 | |||
233 | obj/fsw_globals.o: ../src/fsw_globals.c |
|
233 | obj/fsw_globals.o: ../src/fsw_globals.c | |
234 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c |
|
234 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_globals.o ../src/fsw_globals.c | |
235 |
|
235 | |||
236 | obj/fsw_spacewire.o: ../src/fsw_spacewire.c |
|
236 | obj/fsw_spacewire.o: ../src/fsw_spacewire.c | |
237 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c |
|
237 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_spacewire.o ../src/fsw_spacewire.c | |
238 |
|
238 | |||
239 | obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c |
|
239 | obj/tc_load_dump_parameters.o: ../src/tc_load_dump_parameters.c | |
240 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c |
|
240 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_load_dump_parameters.o ../src/tc_load_dump_parameters.c | |
241 |
|
241 | |||
242 | obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c |
|
242 | obj/tm_lfr_tc_exe.o: ../src/tm_lfr_tc_exe.c | |
243 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c |
|
243 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tm_lfr_tc_exe.o ../src/tm_lfr_tc_exe.c | |
244 |
|
244 | |||
245 | obj/tc_acceptance.o: ../src/tc_acceptance.c |
|
245 | obj/tc_acceptance.o: ../src/tc_acceptance.c | |
246 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c |
|
246 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/tc_acceptance.o ../src/tc_acceptance.c | |
247 |
|
247 | |||
248 | obj/fsw_processing.o: ../src/processing/fsw_processing.c |
|
248 | obj/fsw_processing.o: ../src/processing/fsw_processing.c | |
249 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/processing/fsw_processing.c |
|
249 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/fsw_processing.o ../src/processing/fsw_processing.c | |
250 |
|
250 | |||
251 | obj/avf0_prc0.o: ../src/processing/avf0_prc0.c |
|
251 | obj/avf0_prc0.o: ../src/processing/avf0_prc0.c | |
252 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf0_prc0.o ../src/processing/avf0_prc0.c |
|
252 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf0_prc0.o ../src/processing/avf0_prc0.c | |
253 |
|
253 | |||
254 | obj/avf1_prc1.o: ../src/processing/avf1_prc1.c |
|
254 | obj/avf1_prc1.o: ../src/processing/avf1_prc1.c | |
255 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf1_prc1.o ../src/processing/avf1_prc1.c |
|
255 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf1_prc1.o ../src/processing/avf1_prc1.c | |
256 |
|
256 | |||
257 | obj/avf2_prc2.o: ../src/processing/avf2_prc2.c |
|
257 | obj/avf2_prc2.o: ../src/processing/avf2_prc2.c | |
258 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf2_prc2.o ../src/processing/avf2_prc2.c |
|
258 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/avf2_prc2.o ../src/processing/avf2_prc2.c | |
259 |
|
259 | |||
260 | obj/lfr_cpu_usage_report.o: ../src/lfr_cpu_usage_report.c |
|
260 | obj/lfr_cpu_usage_report.o: ../src/lfr_cpu_usage_report.c | |
261 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/lfr_cpu_usage_report.o ../src/lfr_cpu_usage_report.c |
|
261 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/lfr_cpu_usage_report.o ../src/lfr_cpu_usage_report.c | |
262 |
|
262 | |||
263 | obj/basic_parameters.o: ../src/LFR_basic-parameters/basic_parameters.c |
|
263 | obj/basic_parameters.o: ../src/LFR_basic-parameters/basic_parameters.c | |
264 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/basic_parameters.o ../src/LFR_basic-parameters/basic_parameters.c |
|
264 | $(CC) -c $(CFLAGS) $(INCPATH) -o obj/basic_parameters.o ../src/LFR_basic-parameters/basic_parameters.c | |
265 |
|
265 | |||
266 | ####### Install |
|
266 | ####### Install | |
267 |
|
267 | |||
268 | install: FORCE |
|
268 | install: FORCE | |
269 |
|
269 | |||
270 | uninstall: FORCE |
|
270 | uninstall: FORCE | |
271 |
|
271 | |||
272 | FORCE: |
|
272 | FORCE: | |
273 |
|
273 |
@@ -1,782 +1,780 | |||||
1 | /** This is the RTEMS initialization module. |
|
1 | /** This is the RTEMS initialization module. | |
2 | * |
|
2 | * | |
3 | * @file |
|
3 | * @file | |
4 | * @author P. LEROY |
|
4 | * @author P. LEROY | |
5 | * |
|
5 | * | |
6 | * This module contains two very different information: |
|
6 | * This module contains two very different information: | |
7 | * - specific instructions to configure the compilation of the RTEMS executive |
|
7 | * - specific instructions to configure the compilation of the RTEMS executive | |
8 | * - functions related to the fligth softwre initialization, especially the INIT RTEMS task |
|
8 | * - functions related to the fligth softwre initialization, especially the INIT RTEMS task | |
9 | * |
|
9 | * | |
10 | */ |
|
10 | */ | |
11 |
|
11 | |||
12 | //************************* |
|
12 | //************************* | |
13 | // GPL reminder to be added |
|
13 | // GPL reminder to be added | |
14 | //************************* |
|
14 | //************************* | |
15 |
|
15 | |||
16 | #include <rtems.h> |
|
16 | #include <rtems.h> | |
17 |
|
17 | |||
18 | /* configuration information */ |
|
18 | /* configuration information */ | |
19 |
|
19 | |||
20 | #define CONFIGURE_INIT |
|
20 | #define CONFIGURE_INIT | |
21 |
|
21 | |||
22 | #include <bsp.h> /* for device driver prototypes */ |
|
22 | #include <bsp.h> /* for device driver prototypes */ | |
23 |
|
23 | |||
24 | /* configuration information */ |
|
24 | /* configuration information */ | |
25 |
|
25 | |||
26 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
|
26 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER | |
27 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
|
27 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER | |
28 |
|
28 | |||
29 | #define CONFIGURE_MAXIMUM_TASKS 20 |
|
29 | #define CONFIGURE_MAXIMUM_TASKS 20 | |
30 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
|
30 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE | |
31 | #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) |
|
31 | #define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) | |
32 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32 |
|
32 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 32 | |
33 | #define CONFIGURE_INIT_TASK_PRIORITY 1 // instead of 100 |
|
33 | #define CONFIGURE_INIT_TASK_PRIORITY 1 // instead of 100 | |
34 | #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT) |
|
34 | #define CONFIGURE_INIT_TASK_MODE (RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT) | |
35 | #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT) |
|
35 | #define CONFIGURE_INIT_TASK_ATTRIBUTES (RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT) | |
36 | #define CONFIGURE_MAXIMUM_DRIVERS 16 |
|
36 | #define CONFIGURE_MAXIMUM_DRIVERS 16 | |
37 | #define CONFIGURE_MAXIMUM_PERIODS 5 |
|
37 | #define CONFIGURE_MAXIMUM_PERIODS 5 | |
38 | #define CONFIGURE_MAXIMUM_TIMERS 5 // STAT (1s), send SWF (0.3s), send CWF3 (1s) |
|
38 | #define CONFIGURE_MAXIMUM_TIMERS 5 // STAT (1s), send SWF (0.3s), send CWF3 (1s) | |
39 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 5 |
|
39 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 5 | |
40 | #ifdef PRINT_STACK_REPORT |
|
40 | #ifdef PRINT_STACK_REPORT | |
41 | #define CONFIGURE_STACK_CHECKER_ENABLED |
|
41 | #define CONFIGURE_STACK_CHECKER_ENABLED | |
42 | #endif |
|
42 | #endif | |
43 |
|
43 | |||
44 | #include <rtems/confdefs.h> |
|
44 | #include <rtems/confdefs.h> | |
45 |
|
45 | |||
46 | /* If --drvmgr was enabled during the configuration of the RTEMS kernel */ |
|
46 | /* If --drvmgr was enabled during the configuration of the RTEMS kernel */ | |
47 | #ifdef RTEMS_DRVMGR_STARTUP |
|
47 | #ifdef RTEMS_DRVMGR_STARTUP | |
48 | #ifdef LEON3 |
|
48 | #ifdef LEON3 | |
49 | /* Add Timer and UART Driver */ |
|
49 | /* Add Timer and UART Driver */ | |
50 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
|
50 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER | |
51 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER |
|
51 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER | |
52 | #endif |
|
52 | #endif | |
53 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
|
53 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER | |
54 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART |
|
54 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART | |
55 | #endif |
|
55 | #endif | |
56 | #endif |
|
56 | #endif | |
57 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */ |
|
57 | #define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver */ | |
58 | #include <drvmgr/drvmgr_confdefs.h> |
|
58 | #include <drvmgr/drvmgr_confdefs.h> | |
59 | #endif |
|
59 | #endif | |
60 |
|
60 | |||
61 | #include "fsw_init.h" |
|
61 | #include "fsw_init.h" | |
62 | #include "fsw_config.c" |
|
62 | #include "fsw_config.c" | |
63 |
|
63 | |||
64 | rtems_task Init( rtems_task_argument ignored ) |
|
64 | rtems_task Init( rtems_task_argument ignored ) | |
65 | { |
|
65 | { | |
66 | /** This is the RTEMS INIT taks, it the first task launched by the system. |
|
66 | /** This is the RTEMS INIT taks, it the first task launched by the system. | |
67 | * |
|
67 | * | |
68 | * @param unused is the starting argument of the RTEMS task |
|
68 | * @param unused is the starting argument of the RTEMS task | |
69 | * |
|
69 | * | |
70 | * The INIT task create and run all other RTEMS tasks. |
|
70 | * The INIT task create and run all other RTEMS tasks. | |
71 | * |
|
71 | * | |
72 | */ |
|
72 | */ | |
73 |
|
73 | |||
74 | unsigned char *vhdlVersion; |
|
74 | unsigned char *vhdlVersion; | |
75 |
|
75 | |||
76 | reset_local_time(); |
|
76 | reset_local_time(); | |
77 |
|
77 | |||
78 | rtems_cpu_usage_reset(); |
|
78 | rtems_cpu_usage_reset(); | |
79 |
|
79 | |||
80 | rtems_status_code status; |
|
80 | rtems_status_code status; | |
81 | rtems_status_code status_spw; |
|
81 | rtems_status_code status_spw; | |
82 | rtems_isr_entry old_isr_handler; |
|
82 | rtems_isr_entry old_isr_handler; | |
83 |
|
83 | |||
84 | // UART settings |
|
84 | // UART settings | |
85 | send_console_outputs_on_apbuart_port(); |
|
85 | send_console_outputs_on_apbuart_port(); | |
86 | set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE); |
|
86 | set_apbuart_scaler_reload_register(REGS_ADDR_APBUART, APBUART_SCALER_RELOAD_VALUE); | |
87 | enable_apbuart_transmitter(); |
|
87 | enable_apbuart_transmitter(); | |
88 | DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n") |
|
88 | DEBUG_PRINTF("\n\n\n\n\nIn INIT *** Now the console is on port COM1\n") | |
89 |
|
89 | |||
90 | PRINTF("\n\n\n\n\n") |
|
90 | PRINTF("\n\n\n\n\n") | |
91 | PRINTF("*************************\n") |
|
91 | PRINTF("*************************\n") | |
92 | PRINTF("** LFR Flight Software **\n") |
|
92 | PRINTF("** LFR Flight Software **\n") | |
93 | PRINTF1("** %d.", SW_VERSION_N1) |
|
93 | PRINTF1("** %d.", SW_VERSION_N1) | |
94 | PRINTF1("%d." , SW_VERSION_N2) |
|
94 | PRINTF1("%d." , SW_VERSION_N2) | |
95 | PRINTF1("%d." , SW_VERSION_N3) |
|
95 | PRINTF1("%d." , SW_VERSION_N3) | |
96 | PRINTF1("%d **\n", SW_VERSION_N4) |
|
96 | PRINTF1("%d **\n", SW_VERSION_N4) | |
97 |
|
97 | |||
98 | vhdlVersion = (unsigned char *) (REGS_ADDR_VHDL_VERSION); |
|
98 | vhdlVersion = (unsigned char *) (REGS_ADDR_VHDL_VERSION); | |
99 | PRINTF("** VHDL **\n") |
|
99 | PRINTF("** VHDL **\n") | |
100 | PRINTF1("** %d.", vhdlVersion[1]) |
|
100 | PRINTF1("** %d.", vhdlVersion[1]) | |
101 | PRINTF1("%d." , vhdlVersion[2]) |
|
101 | PRINTF1("%d." , vhdlVersion[2]) | |
102 | PRINTF1("%d **\n", vhdlVersion[3]) |
|
102 | PRINTF1("%d **\n", vhdlVersion[3]) | |
103 | PRINTF("*************************\n") |
|
103 | PRINTF("*************************\n") | |
104 | PRINTF("\n\n") |
|
104 | PRINTF("\n\n") | |
105 |
|
105 | |||
106 | init_parameter_dump(); |
|
106 | init_parameter_dump(); | |
107 | init_local_mode_parameters(); |
|
107 | init_local_mode_parameters(); | |
108 | init_housekeeping_parameters(); |
|
108 | init_housekeeping_parameters(); | |
109 |
|
109 | |||
110 | // waveform picker initialization |
|
110 | // waveform picker initialization | |
111 | WFP_init_rings(); // initialize the waveform rings |
|
111 | WFP_init_rings(); // initialize the waveform rings | |
112 | WFP_reset_current_ring_nodes(); |
|
112 | WFP_reset_current_ring_nodes(); | |
113 | reset_waveform_picker_regs(); |
|
113 | reset_waveform_picker_regs(); | |
114 |
|
114 | |||
115 | // spectral matrices initialization |
|
115 | // spectral matrices initialization | |
116 | SM_init_rings(); // initialize spectral matrices rings |
|
116 | SM_init_rings(); // initialize spectral matrices rings | |
117 | SM_reset_current_ring_nodes(); |
|
117 | SM_reset_current_ring_nodes(); | |
118 | reset_spectral_matrix_regs(); |
|
118 | reset_spectral_matrix_regs(); | |
119 |
|
119 | |||
120 | updateLFRCurrentMode(); |
|
120 | updateLFRCurrentMode(); | |
121 |
|
121 | |||
122 | BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode) |
|
122 | BOOT_PRINTF1("in INIT *** lfrCurrentMode is %d\n", lfrCurrentMode) | |
123 |
|
123 | |||
124 | create_names(); // create all names |
|
124 | create_names(); // create all names | |
125 |
|
125 | |||
126 | status = create_message_queues(); // create message queues |
|
126 | status = create_message_queues(); // create message queues | |
127 | if (status != RTEMS_SUCCESSFUL) |
|
127 | if (status != RTEMS_SUCCESSFUL) | |
128 | { |
|
128 | { | |
129 | PRINTF1("in INIT *** ERR in create_message_queues, code %d", status) |
|
129 | PRINTF1("in INIT *** ERR in create_message_queues, code %d", status) | |
130 | } |
|
130 | } | |
131 |
|
131 | |||
132 | status = create_all_tasks(); // create all tasks |
|
132 | status = create_all_tasks(); // create all tasks | |
133 | if (status != RTEMS_SUCCESSFUL) |
|
133 | if (status != RTEMS_SUCCESSFUL) | |
134 | { |
|
134 | { | |
135 | PRINTF1("in INIT *** ERR in create_all_tasks, code %d\n", status) |
|
135 | PRINTF1("in INIT *** ERR in create_all_tasks, code %d\n", status) | |
136 | } |
|
136 | } | |
137 |
|
137 | |||
138 | // ************************** |
|
138 | // ************************** | |
139 | // <SPACEWIRE INITIALIZATION> |
|
139 | // <SPACEWIRE INITIALIZATION> | |
140 | grspw_timecode_callback = &timecode_irq_handler; |
|
140 | grspw_timecode_callback = &timecode_irq_handler; | |
141 |
|
141 | |||
142 | status_spw = spacewire_open_link(); // (1) open the link |
|
142 | status_spw = spacewire_open_link(); // (1) open the link | |
143 | if ( status_spw != RTEMS_SUCCESSFUL ) |
|
143 | if ( status_spw != RTEMS_SUCCESSFUL ) | |
144 | { |
|
144 | { | |
145 | PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw ) |
|
145 | PRINTF1("in INIT *** ERR spacewire_open_link code %d\n", status_spw ) | |
146 | } |
|
146 | } | |
147 |
|
147 | |||
148 | if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link |
|
148 | if ( status_spw == RTEMS_SUCCESSFUL ) // (2) configure the link | |
149 | { |
|
149 | { | |
150 | status_spw = spacewire_configure_link( fdSPW ); |
|
150 | status_spw = spacewire_configure_link( fdSPW ); | |
151 | if ( status_spw != RTEMS_SUCCESSFUL ) |
|
151 | if ( status_spw != RTEMS_SUCCESSFUL ) | |
152 | { |
|
152 | { | |
153 | PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw ) |
|
153 | PRINTF1("in INIT *** ERR spacewire_configure_link code %d\n", status_spw ) | |
154 | } |
|
154 | } | |
155 | } |
|
155 | } | |
156 |
|
156 | |||
157 | if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link |
|
157 | if ( status_spw == RTEMS_SUCCESSFUL) // (3) start the link | |
158 | { |
|
158 | { | |
159 | status_spw = spacewire_start_link( fdSPW ); |
|
159 | status_spw = spacewire_start_link( fdSPW ); | |
160 | if ( status_spw != RTEMS_SUCCESSFUL ) |
|
160 | if ( status_spw != RTEMS_SUCCESSFUL ) | |
161 | { |
|
161 | { | |
162 | PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw ) |
|
162 | PRINTF1("in INIT *** ERR spacewire_start_link code %d\n", status_spw ) | |
163 | } |
|
163 | } | |
164 | } |
|
164 | } | |
165 | // </SPACEWIRE INITIALIZATION> |
|
165 | // </SPACEWIRE INITIALIZATION> | |
166 | // *************************** |
|
166 | // *************************** | |
167 |
|
167 | |||
168 | status = start_all_tasks(); // start all tasks |
|
168 | status = start_all_tasks(); // start all tasks | |
169 | if (status != RTEMS_SUCCESSFUL) |
|
169 | if (status != RTEMS_SUCCESSFUL) | |
170 | { |
|
170 | { | |
171 | PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status) |
|
171 | PRINTF1("in INIT *** ERR in start_all_tasks, code %d", status) | |
172 | } |
|
172 | } | |
173 |
|
173 | |||
174 | // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization |
|
174 | // start RECV and SEND *AFTER* SpaceWire Initialization, due to the timeout of the start call during the initialization | |
175 | status = start_recv_send_tasks(); |
|
175 | status = start_recv_send_tasks(); | |
176 | if ( status != RTEMS_SUCCESSFUL ) |
|
176 | if ( status != RTEMS_SUCCESSFUL ) | |
177 | { |
|
177 | { | |
178 | PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status ) |
|
178 | PRINTF1("in INIT *** ERR start_recv_send_tasks code %d\n", status ) | |
179 | } |
|
179 | } | |
180 |
|
180 | |||
181 | // suspend science tasks, they will be restarted later depending on the mode |
|
181 | // suspend science tasks, they will be restarted later depending on the mode | |
182 | status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY) |
|
182 | status = suspend_science_tasks(); // suspend science tasks (not done in stop_current_mode if current mode = STANDBY) | |
183 | if (status != RTEMS_SUCCESSFUL) |
|
183 | if (status != RTEMS_SUCCESSFUL) | |
184 | { |
|
184 | { | |
185 | PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status) |
|
185 | PRINTF1("in INIT *** in suspend_science_tasks *** ERR code: %d\n", status) | |
186 | } |
|
186 | } | |
187 |
|
187 | |||
188 | //****************************** |
|
188 | //****************************** | |
189 | // <SPECTRAL MATRICES SIMULATOR> |
|
189 | // <SPECTRAL MATRICES SIMULATOR> | |
190 | LEON_Mask_interrupt( IRQ_SM_SIMULATOR ); |
|
190 | LEON_Mask_interrupt( IRQ_SM_SIMULATOR ); | |
191 | configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR, |
|
191 | configure_timer((gptimer_regs_t*) REGS_ADDR_GPTIMER, TIMER_SM_SIMULATOR, CLKDIV_SM_SIMULATOR, | |
192 | IRQ_SPARC_SM_SIMULATOR, spectral_matrices_isr_simu ); |
|
192 | IRQ_SPARC_SM_SIMULATOR, spectral_matrices_isr_simu ); | |
193 | // </SPECTRAL MATRICES SIMULATOR> |
|
193 | // </SPECTRAL MATRICES SIMULATOR> | |
194 | //******************************* |
|
194 | //******************************* | |
195 |
|
195 | |||
196 | // configure IRQ handling for the waveform picker unit |
|
196 | // configure IRQ handling for the waveform picker unit | |
197 | status = rtems_interrupt_catch( waveforms_isr, |
|
197 | status = rtems_interrupt_catch( waveforms_isr, | |
198 | IRQ_SPARC_WAVEFORM_PICKER, |
|
198 | IRQ_SPARC_WAVEFORM_PICKER, | |
199 | &old_isr_handler) ; |
|
199 | &old_isr_handler) ; | |
200 | // configure IRQ handling for the spectral matrices unit |
|
200 | // configure IRQ handling for the spectral matrices unit | |
201 | status = rtems_interrupt_catch( spectral_matrices_isr, |
|
201 | status = rtems_interrupt_catch( spectral_matrices_isr, | |
202 | IRQ_SPARC_SPECTRAL_MATRIX, |
|
202 | IRQ_SPARC_SPECTRAL_MATRIX, | |
203 | &old_isr_handler) ; |
|
203 | &old_isr_handler) ; | |
204 |
|
204 | |||
205 | // if the spacewire link is not up then send an event to the SPIQ task for link recovery |
|
205 | // if the spacewire link is not up then send an event to the SPIQ task for link recovery | |
206 | if ( status_spw != RTEMS_SUCCESSFUL ) |
|
206 | if ( status_spw != RTEMS_SUCCESSFUL ) | |
207 | { |
|
207 | { | |
208 | status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT ); |
|
208 | status = rtems_event_send( Task_id[TASKID_SPIQ], SPW_LINKERR_EVENT ); | |
209 | if ( status != RTEMS_SUCCESSFUL ) { |
|
209 | if ( status != RTEMS_SUCCESSFUL ) { | |
210 | PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status ) |
|
210 | PRINTF1("in INIT *** ERR rtems_event_send to SPIQ code %d\n", status ) | |
211 | } |
|
211 | } | |
212 | } |
|
212 | } | |
213 |
|
213 | |||
214 | BOOT_PRINTF("delete INIT\n") |
|
214 | BOOT_PRINTF("delete INIT\n") | |
215 |
|
215 | |||
216 | send_dumb_hk(); |
|
|||
217 |
|
||||
218 | status = rtems_task_delete(RTEMS_SELF); |
|
216 | status = rtems_task_delete(RTEMS_SELF); | |
219 |
|
217 | |||
220 | } |
|
218 | } | |
221 |
|
219 | |||
222 | void init_local_mode_parameters( void ) |
|
220 | void init_local_mode_parameters( void ) | |
223 | { |
|
221 | { | |
224 | /** This function initialize the param_local global variable with default values. |
|
222 | /** This function initialize the param_local global variable with default values. | |
225 | * |
|
223 | * | |
226 | */ |
|
224 | */ | |
227 |
|
225 | |||
228 | unsigned int i; |
|
226 | unsigned int i; | |
229 |
|
227 | |||
230 | // LOCAL PARAMETERS |
|
228 | // LOCAL PARAMETERS | |
231 |
|
229 | |||
232 | BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max) |
|
230 | BOOT_PRINTF1("local_sbm1_nb_cwf_max %d \n", param_local.local_sbm1_nb_cwf_max) | |
233 | BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max) |
|
231 | BOOT_PRINTF1("local_sbm2_nb_cwf_max %d \n", param_local.local_sbm2_nb_cwf_max) | |
234 | BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX) |
|
232 | BOOT_PRINTF1("nb_interrupt_f0_MAX = %d\n", param_local.local_nb_interrupt_f0_MAX) | |
235 |
|
233 | |||
236 | // init sequence counters |
|
234 | // init sequence counters | |
237 |
|
235 | |||
238 | for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++) |
|
236 | for(i = 0; i<SEQ_CNT_NB_DEST_ID; i++) | |
239 | { |
|
237 | { | |
240 | sequenceCounters_TC_EXE[i] = 0x00; |
|
238 | sequenceCounters_TC_EXE[i] = 0x00; | |
241 | } |
|
239 | } | |
242 | sequenceCounters_SCIENCE_NORMAL_BURST = 0x00; |
|
240 | sequenceCounters_SCIENCE_NORMAL_BURST = 0x00; | |
243 | sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00; |
|
241 | sequenceCounters_SCIENCE_SBM1_SBM2 = 0x00; | |
244 | sequenceCounterHK = TM_PACKET_SEQ_CTRL_STANDALONE << 8; |
|
242 | sequenceCounterHK = TM_PACKET_SEQ_CTRL_STANDALONE << 8; | |
245 | sequenceCounterParameterDump = TM_PACKET_SEQ_CTRL_STANDALONE << 8; |
|
243 | sequenceCounterParameterDump = TM_PACKET_SEQ_CTRL_STANDALONE << 8; | |
246 | } |
|
244 | } | |
247 |
|
245 | |||
248 | void reset_local_time( void ) |
|
246 | void reset_local_time( void ) | |
249 | { |
|
247 | { | |
250 | time_management_regs->ctrl = 0x02; // software reset, coarse time = 0x80000000 |
|
248 | time_management_regs->ctrl = 0x02; // software reset, coarse time = 0x80000000 | |
251 | } |
|
249 | } | |
252 |
|
250 | |||
253 | void create_names( void ) // create all names for tasks and queues |
|
251 | void create_names( void ) // create all names for tasks and queues | |
254 | { |
|
252 | { | |
255 | /** This function creates all RTEMS names used in the software for tasks and queues. |
|
253 | /** This function creates all RTEMS names used in the software for tasks and queues. | |
256 | * |
|
254 | * | |
257 | * @return RTEMS directive status codes: |
|
255 | * @return RTEMS directive status codes: | |
258 | * - RTEMS_SUCCESSFUL - successful completion |
|
256 | * - RTEMS_SUCCESSFUL - successful completion | |
259 | * |
|
257 | * | |
260 | */ |
|
258 | */ | |
261 |
|
259 | |||
262 | // task names |
|
260 | // task names | |
263 | Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' ); |
|
261 | Task_name[TASKID_RECV] = rtems_build_name( 'R', 'E', 'C', 'V' ); | |
264 | Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' ); |
|
262 | Task_name[TASKID_ACTN] = rtems_build_name( 'A', 'C', 'T', 'N' ); | |
265 | Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' ); |
|
263 | Task_name[TASKID_SPIQ] = rtems_build_name( 'S', 'P', 'I', 'Q' ); | |
266 | Task_name[TASKID_STAT] = rtems_build_name( 'S', 'T', 'A', 'T' ); |
|
264 | Task_name[TASKID_STAT] = rtems_build_name( 'S', 'T', 'A', 'T' ); | |
267 | Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' ); |
|
265 | Task_name[TASKID_AVF0] = rtems_build_name( 'A', 'V', 'F', '0' ); | |
268 | Task_name[TASKID_SWBD] = rtems_build_name( 'S', 'W', 'B', 'D' ); |
|
266 | Task_name[TASKID_SWBD] = rtems_build_name( 'S', 'W', 'B', 'D' ); | |
269 | Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' ); |
|
267 | Task_name[TASKID_WFRM] = rtems_build_name( 'W', 'F', 'R', 'M' ); | |
270 | Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' ); |
|
268 | Task_name[TASKID_DUMB] = rtems_build_name( 'D', 'U', 'M', 'B' ); | |
271 | Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' ); |
|
269 | Task_name[TASKID_HOUS] = rtems_build_name( 'H', 'O', 'U', 'S' ); | |
272 | Task_name[TASKID_PRC0] = rtems_build_name( 'P', 'R', 'C', '0' ); |
|
270 | Task_name[TASKID_PRC0] = rtems_build_name( 'P', 'R', 'C', '0' ); | |
273 | Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' ); |
|
271 | Task_name[TASKID_CWF3] = rtems_build_name( 'C', 'W', 'F', '3' ); | |
274 | Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' ); |
|
272 | Task_name[TASKID_CWF2] = rtems_build_name( 'C', 'W', 'F', '2' ); | |
275 | Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' ); |
|
273 | Task_name[TASKID_CWF1] = rtems_build_name( 'C', 'W', 'F', '1' ); | |
276 | Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' ); |
|
274 | Task_name[TASKID_SEND] = rtems_build_name( 'S', 'E', 'N', 'D' ); | |
277 | Task_name[TASKID_WTDG] = rtems_build_name( 'W', 'T', 'D', 'G' ); |
|
275 | Task_name[TASKID_WTDG] = rtems_build_name( 'W', 'T', 'D', 'G' ); | |
278 | Task_name[TASKID_AVF1] = rtems_build_name( 'A', 'V', 'F', '1' ); |
|
276 | Task_name[TASKID_AVF1] = rtems_build_name( 'A', 'V', 'F', '1' ); | |
279 | Task_name[TASKID_PRC1] = rtems_build_name( 'P', 'R', 'C', '1' ); |
|
277 | Task_name[TASKID_PRC1] = rtems_build_name( 'P', 'R', 'C', '1' ); | |
280 | Task_name[TASKID_AVF2] = rtems_build_name( 'A', 'V', 'F', '2' ); |
|
278 | Task_name[TASKID_AVF2] = rtems_build_name( 'A', 'V', 'F', '2' ); | |
281 | Task_name[TASKID_PRC2] = rtems_build_name( 'P', 'R', 'C', '2' ); |
|
279 | Task_name[TASKID_PRC2] = rtems_build_name( 'P', 'R', 'C', '2' ); | |
282 |
|
280 | |||
283 | // rate monotonic period names |
|
281 | // rate monotonic period names | |
284 | name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' ); |
|
282 | name_hk_rate_monotonic = rtems_build_name( 'H', 'O', 'U', 'S' ); | |
285 |
|
283 | |||
286 | misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' ); |
|
284 | misc_name[QUEUE_RECV] = rtems_build_name( 'Q', '_', 'R', 'V' ); | |
287 | misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' ); |
|
285 | misc_name[QUEUE_SEND] = rtems_build_name( 'Q', '_', 'S', 'D' ); | |
288 | misc_name[QUEUE_PRC0] = rtems_build_name( 'Q', '_', 'P', '0' ); |
|
286 | misc_name[QUEUE_PRC0] = rtems_build_name( 'Q', '_', 'P', '0' ); | |
289 | misc_name[QUEUE_PRC1] = rtems_build_name( 'Q', '_', 'P', '1' ); |
|
287 | misc_name[QUEUE_PRC1] = rtems_build_name( 'Q', '_', 'P', '1' ); | |
290 | misc_name[QUEUE_PRC2] = rtems_build_name( 'Q', '_', 'P', '2' ); |
|
288 | misc_name[QUEUE_PRC2] = rtems_build_name( 'Q', '_', 'P', '2' ); | |
291 | } |
|
289 | } | |
292 |
|
290 | |||
293 | int create_all_tasks( void ) // create all tasks which run in the software |
|
291 | int create_all_tasks( void ) // create all tasks which run in the software | |
294 | { |
|
292 | { | |
295 | /** This function creates all RTEMS tasks used in the software. |
|
293 | /** This function creates all RTEMS tasks used in the software. | |
296 | * |
|
294 | * | |
297 | * @return RTEMS directive status codes: |
|
295 | * @return RTEMS directive status codes: | |
298 | * - RTEMS_SUCCESSFUL - task created successfully |
|
296 | * - RTEMS_SUCCESSFUL - task created successfully | |
299 | * - RTEMS_INVALID_ADDRESS - id is NULL |
|
297 | * - RTEMS_INVALID_ADDRESS - id is NULL | |
300 | * - RTEMS_INVALID_NAME - invalid task name |
|
298 | * - RTEMS_INVALID_NAME - invalid task name | |
301 | * - RTEMS_INVALID_PRIORITY - invalid task priority |
|
299 | * - RTEMS_INVALID_PRIORITY - invalid task priority | |
302 | * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured |
|
300 | * - RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured | |
303 | * - RTEMS_TOO_MANY - too many tasks created |
|
301 | * - RTEMS_TOO_MANY - too many tasks created | |
304 | * - RTEMS_UNSATISFIED - not enough memory for stack/FP context |
|
302 | * - RTEMS_UNSATISFIED - not enough memory for stack/FP context | |
305 | * - RTEMS_TOO_MANY - too many global objects |
|
303 | * - RTEMS_TOO_MANY - too many global objects | |
306 | * |
|
304 | * | |
307 | */ |
|
305 | */ | |
308 |
|
306 | |||
309 | rtems_status_code status; |
|
307 | rtems_status_code status; | |
310 |
|
308 | |||
311 | //********** |
|
309 | //********** | |
312 | // SPACEWIRE |
|
310 | // SPACEWIRE | |
313 | // RECV |
|
311 | // RECV | |
314 | status = rtems_task_create( |
|
312 | status = rtems_task_create( | |
315 | Task_name[TASKID_RECV], TASK_PRIORITY_RECV, RTEMS_MINIMUM_STACK_SIZE, |
|
313 | Task_name[TASKID_RECV], TASK_PRIORITY_RECV, RTEMS_MINIMUM_STACK_SIZE, | |
316 | RTEMS_DEFAULT_MODES, |
|
314 | RTEMS_DEFAULT_MODES, | |
317 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV] |
|
315 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_RECV] | |
318 | ); |
|
316 | ); | |
319 | if (status == RTEMS_SUCCESSFUL) // SEND |
|
317 | if (status == RTEMS_SUCCESSFUL) // SEND | |
320 | { |
|
318 | { | |
321 | status = rtems_task_create( |
|
319 | status = rtems_task_create( | |
322 | Task_name[TASKID_SEND], TASK_PRIORITY_SEND, RTEMS_MINIMUM_STACK_SIZE, |
|
320 | Task_name[TASKID_SEND], TASK_PRIORITY_SEND, RTEMS_MINIMUM_STACK_SIZE, | |
323 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
321 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
324 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SEND] |
|
322 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SEND] | |
325 | ); |
|
323 | ); | |
326 | } |
|
324 | } | |
327 | if (status == RTEMS_SUCCESSFUL) // WTDG |
|
325 | if (status == RTEMS_SUCCESSFUL) // WTDG | |
328 | { |
|
326 | { | |
329 | status = rtems_task_create( |
|
327 | status = rtems_task_create( | |
330 | Task_name[TASKID_WTDG], TASK_PRIORITY_WTDG, RTEMS_MINIMUM_STACK_SIZE, |
|
328 | Task_name[TASKID_WTDG], TASK_PRIORITY_WTDG, RTEMS_MINIMUM_STACK_SIZE, | |
331 | RTEMS_DEFAULT_MODES, |
|
329 | RTEMS_DEFAULT_MODES, | |
332 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_WTDG] |
|
330 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_WTDG] | |
333 | ); |
|
331 | ); | |
334 | } |
|
332 | } | |
335 | if (status == RTEMS_SUCCESSFUL) // ACTN |
|
333 | if (status == RTEMS_SUCCESSFUL) // ACTN | |
336 | { |
|
334 | { | |
337 | status = rtems_task_create( |
|
335 | status = rtems_task_create( | |
338 | Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE, |
|
336 | Task_name[TASKID_ACTN], TASK_PRIORITY_ACTN, RTEMS_MINIMUM_STACK_SIZE, | |
339 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
337 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
340 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN] |
|
338 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_ACTN] | |
341 | ); |
|
339 | ); | |
342 | } |
|
340 | } | |
343 | if (status == RTEMS_SUCCESSFUL) // SPIQ |
|
341 | if (status == RTEMS_SUCCESSFUL) // SPIQ | |
344 | { |
|
342 | { | |
345 | status = rtems_task_create( |
|
343 | status = rtems_task_create( | |
346 | Task_name[TASKID_SPIQ], TASK_PRIORITY_SPIQ, RTEMS_MINIMUM_STACK_SIZE, |
|
344 | Task_name[TASKID_SPIQ], TASK_PRIORITY_SPIQ, RTEMS_MINIMUM_STACK_SIZE, | |
347 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
345 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
348 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ] |
|
346 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_SPIQ] | |
349 | ); |
|
347 | ); | |
350 | } |
|
348 | } | |
351 |
|
349 | |||
352 | //****************** |
|
350 | //****************** | |
353 | // SPECTRAL MATRICES |
|
351 | // SPECTRAL MATRICES | |
354 | if (status == RTEMS_SUCCESSFUL) // AVF0 |
|
352 | if (status == RTEMS_SUCCESSFUL) // AVF0 | |
355 | { |
|
353 | { | |
356 | status = rtems_task_create( |
|
354 | status = rtems_task_create( | |
357 | Task_name[TASKID_AVF0], TASK_PRIORITY_AVF0, RTEMS_MINIMUM_STACK_SIZE, |
|
355 | Task_name[TASKID_AVF0], TASK_PRIORITY_AVF0, RTEMS_MINIMUM_STACK_SIZE, | |
358 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
356 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
359 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0] |
|
357 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF0] | |
360 | ); |
|
358 | ); | |
361 | } |
|
359 | } | |
362 | if (status == RTEMS_SUCCESSFUL) // PRC0 |
|
360 | if (status == RTEMS_SUCCESSFUL) // PRC0 | |
363 | { |
|
361 | { | |
364 | status = rtems_task_create( |
|
362 | status = rtems_task_create( | |
365 | Task_name[TASKID_PRC0], TASK_PRIORITY_PRC0, RTEMS_MINIMUM_STACK_SIZE * 2, |
|
363 | Task_name[TASKID_PRC0], TASK_PRIORITY_PRC0, RTEMS_MINIMUM_STACK_SIZE * 2, | |
366 | RTEMS_DEFAULT_MODES, |
|
364 | RTEMS_DEFAULT_MODES, | |
367 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC0] |
|
365 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC0] | |
368 | ); |
|
366 | ); | |
369 | } |
|
367 | } | |
370 | if (status == RTEMS_SUCCESSFUL) // AVF1 |
|
368 | if (status == RTEMS_SUCCESSFUL) // AVF1 | |
371 | { |
|
369 | { | |
372 | status = rtems_task_create( |
|
370 | status = rtems_task_create( | |
373 | Task_name[TASKID_AVF1], TASK_PRIORITY_AVF1, RTEMS_MINIMUM_STACK_SIZE, |
|
371 | Task_name[TASKID_AVF1], TASK_PRIORITY_AVF1, RTEMS_MINIMUM_STACK_SIZE, | |
374 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
372 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
375 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF1] |
|
373 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF1] | |
376 | ); |
|
374 | ); | |
377 | } |
|
375 | } | |
378 | if (status == RTEMS_SUCCESSFUL) // PRC1 |
|
376 | if (status == RTEMS_SUCCESSFUL) // PRC1 | |
379 | { |
|
377 | { | |
380 | status = rtems_task_create( |
|
378 | status = rtems_task_create( | |
381 | Task_name[TASKID_PRC1], TASK_PRIORITY_PRC1, RTEMS_MINIMUM_STACK_SIZE * 2, |
|
379 | Task_name[TASKID_PRC1], TASK_PRIORITY_PRC1, RTEMS_MINIMUM_STACK_SIZE * 2, | |
382 | RTEMS_DEFAULT_MODES, |
|
380 | RTEMS_DEFAULT_MODES, | |
383 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC1] |
|
381 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC1] | |
384 | ); |
|
382 | ); | |
385 | } |
|
383 | } | |
386 | if (status == RTEMS_SUCCESSFUL) // AVF2 |
|
384 | if (status == RTEMS_SUCCESSFUL) // AVF2 | |
387 | { |
|
385 | { | |
388 | status = rtems_task_create( |
|
386 | status = rtems_task_create( | |
389 | Task_name[TASKID_AVF2], TASK_PRIORITY_AVF2, RTEMS_MINIMUM_STACK_SIZE, |
|
387 | Task_name[TASKID_AVF2], TASK_PRIORITY_AVF2, RTEMS_MINIMUM_STACK_SIZE, | |
390 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
388 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
391 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF2] |
|
389 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_AVF2] | |
392 | ); |
|
390 | ); | |
393 | } |
|
391 | } | |
394 | if (status == RTEMS_SUCCESSFUL) // PRC2 |
|
392 | if (status == RTEMS_SUCCESSFUL) // PRC2 | |
395 | { |
|
393 | { | |
396 | status = rtems_task_create( |
|
394 | status = rtems_task_create( | |
397 | Task_name[TASKID_PRC2], TASK_PRIORITY_PRC2, RTEMS_MINIMUM_STACK_SIZE * 2, |
|
395 | Task_name[TASKID_PRC2], TASK_PRIORITY_PRC2, RTEMS_MINIMUM_STACK_SIZE * 2, | |
398 | RTEMS_DEFAULT_MODES, |
|
396 | RTEMS_DEFAULT_MODES, | |
399 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC2] |
|
397 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_PRC2] | |
400 | ); |
|
398 | ); | |
401 | } |
|
399 | } | |
402 |
|
400 | |||
403 | //**************** |
|
401 | //**************** | |
404 | // WAVEFORM PICKER |
|
402 | // WAVEFORM PICKER | |
405 | if (status == RTEMS_SUCCESSFUL) // WFRM |
|
403 | if (status == RTEMS_SUCCESSFUL) // WFRM | |
406 | { |
|
404 | { | |
407 | status = rtems_task_create( |
|
405 | status = rtems_task_create( | |
408 | Task_name[TASKID_WFRM], TASK_PRIORITY_WFRM, RTEMS_MINIMUM_STACK_SIZE, |
|
406 | Task_name[TASKID_WFRM], TASK_PRIORITY_WFRM, RTEMS_MINIMUM_STACK_SIZE, | |
409 | RTEMS_DEFAULT_MODES, |
|
407 | RTEMS_DEFAULT_MODES, | |
410 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_WFRM] |
|
408 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_WFRM] | |
411 | ); |
|
409 | ); | |
412 | } |
|
410 | } | |
413 | if (status == RTEMS_SUCCESSFUL) // CWF3 |
|
411 | if (status == RTEMS_SUCCESSFUL) // CWF3 | |
414 | { |
|
412 | { | |
415 | status = rtems_task_create( |
|
413 | status = rtems_task_create( | |
416 | Task_name[TASKID_CWF3], TASK_PRIORITY_CWF3, RTEMS_MINIMUM_STACK_SIZE, |
|
414 | Task_name[TASKID_CWF3], TASK_PRIORITY_CWF3, RTEMS_MINIMUM_STACK_SIZE, | |
417 | RTEMS_DEFAULT_MODES, |
|
415 | RTEMS_DEFAULT_MODES, | |
418 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF3] |
|
416 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF3] | |
419 | ); |
|
417 | ); | |
420 | } |
|
418 | } | |
421 | if (status == RTEMS_SUCCESSFUL) // CWF2 |
|
419 | if (status == RTEMS_SUCCESSFUL) // CWF2 | |
422 | { |
|
420 | { | |
423 | status = rtems_task_create( |
|
421 | status = rtems_task_create( | |
424 | Task_name[TASKID_CWF2], TASK_PRIORITY_CWF2, RTEMS_MINIMUM_STACK_SIZE, |
|
422 | Task_name[TASKID_CWF2], TASK_PRIORITY_CWF2, RTEMS_MINIMUM_STACK_SIZE, | |
425 | RTEMS_DEFAULT_MODES, |
|
423 | RTEMS_DEFAULT_MODES, | |
426 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF2] |
|
424 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF2] | |
427 | ); |
|
425 | ); | |
428 | } |
|
426 | } | |
429 | if (status == RTEMS_SUCCESSFUL) // CWF1 |
|
427 | if (status == RTEMS_SUCCESSFUL) // CWF1 | |
430 | { |
|
428 | { | |
431 | status = rtems_task_create( |
|
429 | status = rtems_task_create( | |
432 | Task_name[TASKID_CWF1], TASK_PRIORITY_CWF1, RTEMS_MINIMUM_STACK_SIZE, |
|
430 | Task_name[TASKID_CWF1], TASK_PRIORITY_CWF1, RTEMS_MINIMUM_STACK_SIZE, | |
433 | RTEMS_DEFAULT_MODES, |
|
431 | RTEMS_DEFAULT_MODES, | |
434 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF1] |
|
432 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_CWF1] | |
435 | ); |
|
433 | ); | |
436 | } |
|
434 | } | |
437 | if (status == RTEMS_SUCCESSFUL) // SWBD |
|
435 | if (status == RTEMS_SUCCESSFUL) // SWBD | |
438 | { |
|
436 | { | |
439 | status = rtems_task_create( |
|
437 | status = rtems_task_create( | |
440 | Task_name[TASKID_SWBD], TASK_PRIORITY_SWBD, RTEMS_MINIMUM_STACK_SIZE, |
|
438 | Task_name[TASKID_SWBD], TASK_PRIORITY_SWBD, RTEMS_MINIMUM_STACK_SIZE, | |
441 | RTEMS_DEFAULT_MODES, |
|
439 | RTEMS_DEFAULT_MODES, | |
442 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_SWBD] |
|
440 | RTEMS_DEFAULT_ATTRIBUTES | RTEMS_FLOATING_POINT, &Task_id[TASKID_SWBD] | |
443 | ); |
|
441 | ); | |
444 | } |
|
442 | } | |
445 |
|
443 | |||
446 | //***** |
|
444 | //***** | |
447 | // MISC |
|
445 | // MISC | |
448 | if (status == RTEMS_SUCCESSFUL) // STAT |
|
446 | if (status == RTEMS_SUCCESSFUL) // STAT | |
449 | { |
|
447 | { | |
450 | status = rtems_task_create( |
|
448 | status = rtems_task_create( | |
451 | Task_name[TASKID_STAT], TASK_PRIORITY_STAT, RTEMS_MINIMUM_STACK_SIZE, |
|
449 | Task_name[TASKID_STAT], TASK_PRIORITY_STAT, RTEMS_MINIMUM_STACK_SIZE, | |
452 | RTEMS_DEFAULT_MODES, |
|
450 | RTEMS_DEFAULT_MODES, | |
453 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_STAT] |
|
451 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_STAT] | |
454 | ); |
|
452 | ); | |
455 | } |
|
453 | } | |
456 | if (status == RTEMS_SUCCESSFUL) // DUMB |
|
454 | if (status == RTEMS_SUCCESSFUL) // DUMB | |
457 | { |
|
455 | { | |
458 | status = rtems_task_create( |
|
456 | status = rtems_task_create( | |
459 | Task_name[TASKID_DUMB], TASK_PRIORITY_DUMB, RTEMS_MINIMUM_STACK_SIZE, |
|
457 | Task_name[TASKID_DUMB], TASK_PRIORITY_DUMB, RTEMS_MINIMUM_STACK_SIZE, | |
460 | RTEMS_DEFAULT_MODES, |
|
458 | RTEMS_DEFAULT_MODES, | |
461 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_DUMB] |
|
459 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_DUMB] | |
462 | ); |
|
460 | ); | |
463 | } |
|
461 | } | |
464 | if (status == RTEMS_SUCCESSFUL) // HOUS |
|
462 | if (status == RTEMS_SUCCESSFUL) // HOUS | |
465 | { |
|
463 | { | |
466 | status = rtems_task_create( |
|
464 | status = rtems_task_create( | |
467 | Task_name[TASKID_HOUS], TASK_PRIORITY_HOUS, RTEMS_MINIMUM_STACK_SIZE, |
|
465 | Task_name[TASKID_HOUS], TASK_PRIORITY_HOUS, RTEMS_MINIMUM_STACK_SIZE, | |
468 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, |
|
466 | RTEMS_DEFAULT_MODES | RTEMS_NO_PREEMPT, | |
469 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS] |
|
467 | RTEMS_DEFAULT_ATTRIBUTES, &Task_id[TASKID_HOUS] | |
470 | ); |
|
468 | ); | |
471 | } |
|
469 | } | |
472 |
|
470 | |||
473 | return status; |
|
471 | return status; | |
474 | } |
|
472 | } | |
475 |
|
473 | |||
476 | int start_recv_send_tasks( void ) |
|
474 | int start_recv_send_tasks( void ) | |
477 | { |
|
475 | { | |
478 | rtems_status_code status; |
|
476 | rtems_status_code status; | |
479 |
|
477 | |||
480 | status = rtems_task_start( Task_id[TASKID_RECV], recv_task, 1 ); |
|
478 | status = rtems_task_start( Task_id[TASKID_RECV], recv_task, 1 ); | |
481 | if (status!=RTEMS_SUCCESSFUL) { |
|
479 | if (status!=RTEMS_SUCCESSFUL) { | |
482 | BOOT_PRINTF("in INIT *** Error starting TASK_RECV\n") |
|
480 | BOOT_PRINTF("in INIT *** Error starting TASK_RECV\n") | |
483 | } |
|
481 | } | |
484 |
|
482 | |||
485 | if (status == RTEMS_SUCCESSFUL) // SEND |
|
483 | if (status == RTEMS_SUCCESSFUL) // SEND | |
486 | { |
|
484 | { | |
487 | status = rtems_task_start( Task_id[TASKID_SEND], send_task, 1 ); |
|
485 | status = rtems_task_start( Task_id[TASKID_SEND], send_task, 1 ); | |
488 | if (status!=RTEMS_SUCCESSFUL) { |
|
486 | if (status!=RTEMS_SUCCESSFUL) { | |
489 | BOOT_PRINTF("in INIT *** Error starting TASK_SEND\n") |
|
487 | BOOT_PRINTF("in INIT *** Error starting TASK_SEND\n") | |
490 | } |
|
488 | } | |
491 | } |
|
489 | } | |
492 |
|
490 | |||
493 | return status; |
|
491 | return status; | |
494 | } |
|
492 | } | |
495 |
|
493 | |||
496 | int start_all_tasks( void ) // start all tasks except SEND RECV and HOUS |
|
494 | int start_all_tasks( void ) // start all tasks except SEND RECV and HOUS | |
497 | { |
|
495 | { | |
498 | /** This function starts all RTEMS tasks used in the software. |
|
496 | /** This function starts all RTEMS tasks used in the software. | |
499 | * |
|
497 | * | |
500 | * @return RTEMS directive status codes: |
|
498 | * @return RTEMS directive status codes: | |
501 | * - RTEMS_SUCCESSFUL - ask started successfully |
|
499 | * - RTEMS_SUCCESSFUL - ask started successfully | |
502 | * - RTEMS_INVALID_ADDRESS - invalid task entry point |
|
500 | * - RTEMS_INVALID_ADDRESS - invalid task entry point | |
503 | * - RTEMS_INVALID_ID - invalid task id |
|
501 | * - RTEMS_INVALID_ID - invalid task id | |
504 | * - RTEMS_INCORRECT_STATE - task not in the dormant state |
|
502 | * - RTEMS_INCORRECT_STATE - task not in the dormant state | |
505 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task |
|
503 | * - RTEMS_ILLEGAL_ON_REMOTE_OBJECT - cannot start remote task | |
506 | * |
|
504 | * | |
507 | */ |
|
505 | */ | |
508 | // starts all the tasks fot eh flight software |
|
506 | // starts all the tasks fot eh flight software | |
509 |
|
507 | |||
510 | rtems_status_code status; |
|
508 | rtems_status_code status; | |
511 |
|
509 | |||
512 | //********** |
|
510 | //********** | |
513 | // SPACEWIRE |
|
511 | // SPACEWIRE | |
514 | status = rtems_task_start( Task_id[TASKID_SPIQ], spiq_task, 1 ); |
|
512 | status = rtems_task_start( Task_id[TASKID_SPIQ], spiq_task, 1 ); | |
515 | if (status!=RTEMS_SUCCESSFUL) { |
|
513 | if (status!=RTEMS_SUCCESSFUL) { | |
516 | BOOT_PRINTF("in INIT *** Error starting TASK_SPIQ\n") |
|
514 | BOOT_PRINTF("in INIT *** Error starting TASK_SPIQ\n") | |
517 | } |
|
515 | } | |
518 |
|
516 | |||
519 | if (status == RTEMS_SUCCESSFUL) // WTDG |
|
517 | if (status == RTEMS_SUCCESSFUL) // WTDG | |
520 | { |
|
518 | { | |
521 | status = rtems_task_start( Task_id[TASKID_WTDG], wtdg_task, 1 ); |
|
519 | status = rtems_task_start( Task_id[TASKID_WTDG], wtdg_task, 1 ); | |
522 | if (status!=RTEMS_SUCCESSFUL) { |
|
520 | if (status!=RTEMS_SUCCESSFUL) { | |
523 | BOOT_PRINTF("in INIT *** Error starting TASK_WTDG\n") |
|
521 | BOOT_PRINTF("in INIT *** Error starting TASK_WTDG\n") | |
524 | } |
|
522 | } | |
525 | } |
|
523 | } | |
526 |
|
524 | |||
527 | if (status == RTEMS_SUCCESSFUL) // ACTN |
|
525 | if (status == RTEMS_SUCCESSFUL) // ACTN | |
528 | { |
|
526 | { | |
529 | status = rtems_task_start( Task_id[TASKID_ACTN], actn_task, 1 ); |
|
527 | status = rtems_task_start( Task_id[TASKID_ACTN], actn_task, 1 ); | |
530 | if (status!=RTEMS_SUCCESSFUL) { |
|
528 | if (status!=RTEMS_SUCCESSFUL) { | |
531 | BOOT_PRINTF("in INIT *** Error starting TASK_ACTN\n") |
|
529 | BOOT_PRINTF("in INIT *** Error starting TASK_ACTN\n") | |
532 | } |
|
530 | } | |
533 | } |
|
531 | } | |
534 |
|
532 | |||
535 | //****************** |
|
533 | //****************** | |
536 | // SPECTRAL MATRICES |
|
534 | // SPECTRAL MATRICES | |
537 | if (status == RTEMS_SUCCESSFUL) // AVF0 |
|
535 | if (status == RTEMS_SUCCESSFUL) // AVF0 | |
538 | { |
|
536 | { | |
539 | status = rtems_task_start( Task_id[TASKID_AVF0], avf0_task, LFR_MODE_STANDBY ); |
|
537 | status = rtems_task_start( Task_id[TASKID_AVF0], avf0_task, LFR_MODE_STANDBY ); | |
540 | if (status!=RTEMS_SUCCESSFUL) { |
|
538 | if (status!=RTEMS_SUCCESSFUL) { | |
541 | BOOT_PRINTF("in INIT *** Error starting TASK_AVF0\n") |
|
539 | BOOT_PRINTF("in INIT *** Error starting TASK_AVF0\n") | |
542 | } |
|
540 | } | |
543 | } |
|
541 | } | |
544 | if (status == RTEMS_SUCCESSFUL) // PRC0 |
|
542 | if (status == RTEMS_SUCCESSFUL) // PRC0 | |
545 | { |
|
543 | { | |
546 | status = rtems_task_start( Task_id[TASKID_PRC0], prc0_task, LFR_MODE_STANDBY ); |
|
544 | status = rtems_task_start( Task_id[TASKID_PRC0], prc0_task, LFR_MODE_STANDBY ); | |
547 | if (status!=RTEMS_SUCCESSFUL) { |
|
545 | if (status!=RTEMS_SUCCESSFUL) { | |
548 | BOOT_PRINTF("in INIT *** Error starting TASK_PRC0\n") |
|
546 | BOOT_PRINTF("in INIT *** Error starting TASK_PRC0\n") | |
549 | } |
|
547 | } | |
550 | } |
|
548 | } | |
551 | if (status == RTEMS_SUCCESSFUL) // AVF1 |
|
549 | if (status == RTEMS_SUCCESSFUL) // AVF1 | |
552 | { |
|
550 | { | |
553 | status = rtems_task_start( Task_id[TASKID_AVF1], avf1_task, LFR_MODE_STANDBY ); |
|
551 | status = rtems_task_start( Task_id[TASKID_AVF1], avf1_task, LFR_MODE_STANDBY ); | |
554 | if (status!=RTEMS_SUCCESSFUL) { |
|
552 | if (status!=RTEMS_SUCCESSFUL) { | |
555 | BOOT_PRINTF("in INIT *** Error starting TASK_AVF1\n") |
|
553 | BOOT_PRINTF("in INIT *** Error starting TASK_AVF1\n") | |
556 | } |
|
554 | } | |
557 | } |
|
555 | } | |
558 | if (status == RTEMS_SUCCESSFUL) // PRC1 |
|
556 | if (status == RTEMS_SUCCESSFUL) // PRC1 | |
559 | { |
|
557 | { | |
560 | status = rtems_task_start( Task_id[TASKID_PRC1], prc1_task, LFR_MODE_STANDBY ); |
|
558 | status = rtems_task_start( Task_id[TASKID_PRC1], prc1_task, LFR_MODE_STANDBY ); | |
561 | if (status!=RTEMS_SUCCESSFUL) { |
|
559 | if (status!=RTEMS_SUCCESSFUL) { | |
562 | BOOT_PRINTF("in INIT *** Error starting TASK_PRC1\n") |
|
560 | BOOT_PRINTF("in INIT *** Error starting TASK_PRC1\n") | |
563 | } |
|
561 | } | |
564 | } |
|
562 | } | |
565 | if (status == RTEMS_SUCCESSFUL) // AVF2 |
|
563 | if (status == RTEMS_SUCCESSFUL) // AVF2 | |
566 | { |
|
564 | { | |
567 | status = rtems_task_start( Task_id[TASKID_AVF2], avf2_task, 1 ); |
|
565 | status = rtems_task_start( Task_id[TASKID_AVF2], avf2_task, 1 ); | |
568 | if (status!=RTEMS_SUCCESSFUL) { |
|
566 | if (status!=RTEMS_SUCCESSFUL) { | |
569 | BOOT_PRINTF("in INIT *** Error starting TASK_AVF2\n") |
|
567 | BOOT_PRINTF("in INIT *** Error starting TASK_AVF2\n") | |
570 | } |
|
568 | } | |
571 | } |
|
569 | } | |
572 | if (status == RTEMS_SUCCESSFUL) // PRC2 |
|
570 | if (status == RTEMS_SUCCESSFUL) // PRC2 | |
573 | { |
|
571 | { | |
574 | status = rtems_task_start( Task_id[TASKID_PRC2], prc2_task, 1 ); |
|
572 | status = rtems_task_start( Task_id[TASKID_PRC2], prc2_task, 1 ); | |
575 | if (status!=RTEMS_SUCCESSFUL) { |
|
573 | if (status!=RTEMS_SUCCESSFUL) { | |
576 | BOOT_PRINTF("in INIT *** Error starting TASK_PRC2\n") |
|
574 | BOOT_PRINTF("in INIT *** Error starting TASK_PRC2\n") | |
577 | } |
|
575 | } | |
578 | } |
|
576 | } | |
579 |
|
577 | |||
580 | //**************** |
|
578 | //**************** | |
581 | // WAVEFORM PICKER |
|
579 | // WAVEFORM PICKER | |
582 | if (status == RTEMS_SUCCESSFUL) // WFRM |
|
580 | if (status == RTEMS_SUCCESSFUL) // WFRM | |
583 | { |
|
581 | { | |
584 | status = rtems_task_start( Task_id[TASKID_WFRM], wfrm_task, 1 ); |
|
582 | status = rtems_task_start( Task_id[TASKID_WFRM], wfrm_task, 1 ); | |
585 | if (status!=RTEMS_SUCCESSFUL) { |
|
583 | if (status!=RTEMS_SUCCESSFUL) { | |
586 | BOOT_PRINTF("in INIT *** Error starting TASK_WFRM\n") |
|
584 | BOOT_PRINTF("in INIT *** Error starting TASK_WFRM\n") | |
587 | } |
|
585 | } | |
588 | } |
|
586 | } | |
589 | if (status == RTEMS_SUCCESSFUL) // CWF3 |
|
587 | if (status == RTEMS_SUCCESSFUL) // CWF3 | |
590 | { |
|
588 | { | |
591 | status = rtems_task_start( Task_id[TASKID_CWF3], cwf3_task, 1 ); |
|
589 | status = rtems_task_start( Task_id[TASKID_CWF3], cwf3_task, 1 ); | |
592 | if (status!=RTEMS_SUCCESSFUL) { |
|
590 | if (status!=RTEMS_SUCCESSFUL) { | |
593 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF3\n") |
|
591 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF3\n") | |
594 | } |
|
592 | } | |
595 | } |
|
593 | } | |
596 | if (status == RTEMS_SUCCESSFUL) // CWF2 |
|
594 | if (status == RTEMS_SUCCESSFUL) // CWF2 | |
597 | { |
|
595 | { | |
598 | status = rtems_task_start( Task_id[TASKID_CWF2], cwf2_task, 1 ); |
|
596 | status = rtems_task_start( Task_id[TASKID_CWF2], cwf2_task, 1 ); | |
599 | if (status!=RTEMS_SUCCESSFUL) { |
|
597 | if (status!=RTEMS_SUCCESSFUL) { | |
600 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF2\n") |
|
598 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF2\n") | |
601 | } |
|
599 | } | |
602 | } |
|
600 | } | |
603 | if (status == RTEMS_SUCCESSFUL) // CWF1 |
|
601 | if (status == RTEMS_SUCCESSFUL) // CWF1 | |
604 | { |
|
602 | { | |
605 | status = rtems_task_start( Task_id[TASKID_CWF1], cwf1_task, 1 ); |
|
603 | status = rtems_task_start( Task_id[TASKID_CWF1], cwf1_task, 1 ); | |
606 | if (status!=RTEMS_SUCCESSFUL) { |
|
604 | if (status!=RTEMS_SUCCESSFUL) { | |
607 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF1\n") |
|
605 | BOOT_PRINTF("in INIT *** Error starting TASK_CWF1\n") | |
608 | } |
|
606 | } | |
609 | } |
|
607 | } | |
610 | if (status == RTEMS_SUCCESSFUL) // SWBD |
|
608 | if (status == RTEMS_SUCCESSFUL) // SWBD | |
611 | { |
|
609 | { | |
612 | status = rtems_task_start( Task_id[TASKID_SWBD], swbd_task, 1 ); |
|
610 | status = rtems_task_start( Task_id[TASKID_SWBD], swbd_task, 1 ); | |
613 | if (status!=RTEMS_SUCCESSFUL) { |
|
611 | if (status!=RTEMS_SUCCESSFUL) { | |
614 | BOOT_PRINTF("in INIT *** Error starting TASK_SWBD\n") |
|
612 | BOOT_PRINTF("in INIT *** Error starting TASK_SWBD\n") | |
615 | } |
|
613 | } | |
616 | } |
|
614 | } | |
617 |
|
615 | |||
618 | //***** |
|
616 | //***** | |
619 | // MISC |
|
617 | // MISC | |
620 | if (status == RTEMS_SUCCESSFUL) // HOUS |
|
618 | if (status == RTEMS_SUCCESSFUL) // HOUS | |
621 | { |
|
619 | { | |
622 | status = rtems_task_start( Task_id[TASKID_HOUS], hous_task, 1 ); |
|
620 | status = rtems_task_start( Task_id[TASKID_HOUS], hous_task, 1 ); | |
623 | if (status!=RTEMS_SUCCESSFUL) { |
|
621 | if (status!=RTEMS_SUCCESSFUL) { | |
624 | BOOT_PRINTF("in INIT *** Error starting TASK_HOUS\n") |
|
622 | BOOT_PRINTF("in INIT *** Error starting TASK_HOUS\n") | |
625 | } |
|
623 | } | |
626 | } |
|
624 | } | |
627 | if (status == RTEMS_SUCCESSFUL) // DUMB |
|
625 | if (status == RTEMS_SUCCESSFUL) // DUMB | |
628 | { |
|
626 | { | |
629 | status = rtems_task_start( Task_id[TASKID_DUMB], dumb_task, 1 ); |
|
627 | status = rtems_task_start( Task_id[TASKID_DUMB], dumb_task, 1 ); | |
630 | if (status!=RTEMS_SUCCESSFUL) { |
|
628 | if (status!=RTEMS_SUCCESSFUL) { | |
631 | BOOT_PRINTF("in INIT *** Error starting TASK_DUMB\n") |
|
629 | BOOT_PRINTF("in INIT *** Error starting TASK_DUMB\n") | |
632 | } |
|
630 | } | |
633 | } |
|
631 | } | |
634 | if (status == RTEMS_SUCCESSFUL) // STAT |
|
632 | if (status == RTEMS_SUCCESSFUL) // STAT | |
635 | { |
|
633 | { | |
636 | status = rtems_task_start( Task_id[TASKID_STAT], stat_task, 1 ); |
|
634 | status = rtems_task_start( Task_id[TASKID_STAT], stat_task, 1 ); | |
637 | if (status!=RTEMS_SUCCESSFUL) { |
|
635 | if (status!=RTEMS_SUCCESSFUL) { | |
638 | BOOT_PRINTF("in INIT *** Error starting TASK_STAT\n") |
|
636 | BOOT_PRINTF("in INIT *** Error starting TASK_STAT\n") | |
639 | } |
|
637 | } | |
640 | } |
|
638 | } | |
641 |
|
639 | |||
642 | return status; |
|
640 | return status; | |
643 | } |
|
641 | } | |
644 |
|
642 | |||
645 | rtems_status_code create_message_queues( void ) // create the two message queues used in the software |
|
643 | rtems_status_code create_message_queues( void ) // create the two message queues used in the software | |
646 | { |
|
644 | { | |
647 | rtems_status_code status_recv; |
|
645 | rtems_status_code status_recv; | |
648 | rtems_status_code status_send; |
|
646 | rtems_status_code status_send; | |
649 | rtems_status_code status_q_p0; |
|
647 | rtems_status_code status_q_p0; | |
650 | rtems_status_code status_q_p1; |
|
648 | rtems_status_code status_q_p1; | |
651 | rtems_status_code status_q_p2; |
|
649 | rtems_status_code status_q_p2; | |
652 | rtems_status_code ret; |
|
650 | rtems_status_code ret; | |
653 | rtems_id queue_id; |
|
651 | rtems_id queue_id; | |
654 |
|
652 | |||
655 | //**************************************** |
|
653 | //**************************************** | |
656 | // create the queue for handling valid TCs |
|
654 | // create the queue for handling valid TCs | |
657 | status_recv = rtems_message_queue_create( misc_name[QUEUE_RECV], |
|
655 | status_recv = rtems_message_queue_create( misc_name[QUEUE_RECV], | |
658 | MSG_QUEUE_COUNT_RECV, CCSDS_TC_PKT_MAX_SIZE, |
|
656 | MSG_QUEUE_COUNT_RECV, CCSDS_TC_PKT_MAX_SIZE, | |
659 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); |
|
657 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); | |
660 | if ( status_recv != RTEMS_SUCCESSFUL ) { |
|
658 | if ( status_recv != RTEMS_SUCCESSFUL ) { | |
661 | PRINTF1("in create_message_queues *** ERR creating QUEU queue, %d\n", status_recv) |
|
659 | PRINTF1("in create_message_queues *** ERR creating QUEU queue, %d\n", status_recv) | |
662 | } |
|
660 | } | |
663 |
|
661 | |||
664 | //************************************************ |
|
662 | //************************************************ | |
665 | // create the queue for handling TM packet sending |
|
663 | // create the queue for handling TM packet sending | |
666 | status_send = rtems_message_queue_create( misc_name[QUEUE_SEND], |
|
664 | status_send = rtems_message_queue_create( misc_name[QUEUE_SEND], | |
667 | MSG_QUEUE_COUNT_SEND, MSG_QUEUE_SIZE_SEND, |
|
665 | MSG_QUEUE_COUNT_SEND, MSG_QUEUE_SIZE_SEND, | |
668 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); |
|
666 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); | |
669 | if ( status_send != RTEMS_SUCCESSFUL ) { |
|
667 | if ( status_send != RTEMS_SUCCESSFUL ) { | |
670 | PRINTF1("in create_message_queues *** ERR creating PKTS queue, %d\n", status_send) |
|
668 | PRINTF1("in create_message_queues *** ERR creating PKTS queue, %d\n", status_send) | |
671 | } |
|
669 | } | |
672 |
|
670 | |||
673 | //***************************************************************************** |
|
671 | //***************************************************************************** | |
674 | // create the queue for handling averaged spectral matrices for processing @ f0 |
|
672 | // create the queue for handling averaged spectral matrices for processing @ f0 | |
675 | status_q_p0 = rtems_message_queue_create( misc_name[QUEUE_PRC0], |
|
673 | status_q_p0 = rtems_message_queue_create( misc_name[QUEUE_PRC0], | |
676 | MSG_QUEUE_COUNT_PRC0, MSG_QUEUE_SIZE_PRC0, |
|
674 | MSG_QUEUE_COUNT_PRC0, MSG_QUEUE_SIZE_PRC0, | |
677 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); |
|
675 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); | |
678 | if ( status_q_p0 != RTEMS_SUCCESSFUL ) { |
|
676 | if ( status_q_p0 != RTEMS_SUCCESSFUL ) { | |
679 | PRINTF1("in create_message_queues *** ERR creating Q_P0 queue, %d\n", status_q_p0) |
|
677 | PRINTF1("in create_message_queues *** ERR creating Q_P0 queue, %d\n", status_q_p0) | |
680 | } |
|
678 | } | |
681 |
|
679 | |||
682 | //***************************************************************************** |
|
680 | //***************************************************************************** | |
683 | // create the queue for handling averaged spectral matrices for processing @ f1 |
|
681 | // create the queue for handling averaged spectral matrices for processing @ f1 | |
684 | status_q_p1 = rtems_message_queue_create( misc_name[QUEUE_PRC1], |
|
682 | status_q_p1 = rtems_message_queue_create( misc_name[QUEUE_PRC1], | |
685 | MSG_QUEUE_COUNT_PRC1, MSG_QUEUE_SIZE_PRC1, |
|
683 | MSG_QUEUE_COUNT_PRC1, MSG_QUEUE_SIZE_PRC1, | |
686 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); |
|
684 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); | |
687 | if ( status_q_p1 != RTEMS_SUCCESSFUL ) { |
|
685 | if ( status_q_p1 != RTEMS_SUCCESSFUL ) { | |
688 | PRINTF1("in create_message_queues *** ERR creating Q_P1 queue, %d\n", status_q_p1) |
|
686 | PRINTF1("in create_message_queues *** ERR creating Q_P1 queue, %d\n", status_q_p1) | |
689 | } |
|
687 | } | |
690 |
|
688 | |||
691 | //***************************************************************************** |
|
689 | //***************************************************************************** | |
692 | // create the queue for handling averaged spectral matrices for processing @ f2 |
|
690 | // create the queue for handling averaged spectral matrices for processing @ f2 | |
693 | status_q_p2 = rtems_message_queue_create( misc_name[QUEUE_PRC2], |
|
691 | status_q_p2 = rtems_message_queue_create( misc_name[QUEUE_PRC2], | |
694 | MSG_QUEUE_COUNT_PRC2, MSG_QUEUE_SIZE_PRC2, |
|
692 | MSG_QUEUE_COUNT_PRC2, MSG_QUEUE_SIZE_PRC2, | |
695 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); |
|
693 | RTEMS_FIFO | RTEMS_LOCAL, &queue_id ); | |
696 | if ( status_q_p2 != RTEMS_SUCCESSFUL ) { |
|
694 | if ( status_q_p2 != RTEMS_SUCCESSFUL ) { | |
697 | PRINTF1("in create_message_queues *** ERR creating Q_P2 queue, %d\n", status_q_p2) |
|
695 | PRINTF1("in create_message_queues *** ERR creating Q_P2 queue, %d\n", status_q_p2) | |
698 | } |
|
696 | } | |
699 |
|
697 | |||
700 | if ( status_recv != RTEMS_SUCCESSFUL ) |
|
698 | if ( status_recv != RTEMS_SUCCESSFUL ) | |
701 | { |
|
699 | { | |
702 | ret = status_recv; |
|
700 | ret = status_recv; | |
703 | } |
|
701 | } | |
704 | else if( status_send != RTEMS_SUCCESSFUL ) |
|
702 | else if( status_send != RTEMS_SUCCESSFUL ) | |
705 | { |
|
703 | { | |
706 | ret = status_send; |
|
704 | ret = status_send; | |
707 | } |
|
705 | } | |
708 | else if( status_q_p0 != RTEMS_SUCCESSFUL ) |
|
706 | else if( status_q_p0 != RTEMS_SUCCESSFUL ) | |
709 | { |
|
707 | { | |
710 | ret = status_q_p0; |
|
708 | ret = status_q_p0; | |
711 | } |
|
709 | } | |
712 | else if( status_q_p1 != RTEMS_SUCCESSFUL ) |
|
710 | else if( status_q_p1 != RTEMS_SUCCESSFUL ) | |
713 | { |
|
711 | { | |
714 | ret = status_q_p1; |
|
712 | ret = status_q_p1; | |
715 | } |
|
713 | } | |
716 | else |
|
714 | else | |
717 | { |
|
715 | { | |
718 | ret = status_q_p2; |
|
716 | ret = status_q_p2; | |
719 | } |
|
717 | } | |
720 |
|
718 | |||
721 | return ret; |
|
719 | return ret; | |
722 | } |
|
720 | } | |
723 |
|
721 | |||
724 | rtems_status_code get_message_queue_id_send( rtems_id *queue_id ) |
|
722 | rtems_status_code get_message_queue_id_send( rtems_id *queue_id ) | |
725 | { |
|
723 | { | |
726 | rtems_status_code status; |
|
724 | rtems_status_code status; | |
727 | rtems_name queue_name; |
|
725 | rtems_name queue_name; | |
728 |
|
726 | |||
729 | queue_name = rtems_build_name( 'Q', '_', 'S', 'D' ); |
|
727 | queue_name = rtems_build_name( 'Q', '_', 'S', 'D' ); | |
730 |
|
728 | |||
731 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); |
|
729 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); | |
732 |
|
730 | |||
733 | return status; |
|
731 | return status; | |
734 | } |
|
732 | } | |
735 |
|
733 | |||
736 | rtems_status_code get_message_queue_id_recv( rtems_id *queue_id ) |
|
734 | rtems_status_code get_message_queue_id_recv( rtems_id *queue_id ) | |
737 | { |
|
735 | { | |
738 | rtems_status_code status; |
|
736 | rtems_status_code status; | |
739 | rtems_name queue_name; |
|
737 | rtems_name queue_name; | |
740 |
|
738 | |||
741 | queue_name = rtems_build_name( 'Q', '_', 'R', 'V' ); |
|
739 | queue_name = rtems_build_name( 'Q', '_', 'R', 'V' ); | |
742 |
|
740 | |||
743 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); |
|
741 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); | |
744 |
|
742 | |||
745 | return status; |
|
743 | return status; | |
746 | } |
|
744 | } | |
747 |
|
745 | |||
748 | rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id ) |
|
746 | rtems_status_code get_message_queue_id_prc0( rtems_id *queue_id ) | |
749 | { |
|
747 | { | |
750 | rtems_status_code status; |
|
748 | rtems_status_code status; | |
751 | rtems_name queue_name; |
|
749 | rtems_name queue_name; | |
752 |
|
750 | |||
753 | queue_name = rtems_build_name( 'Q', '_', 'P', '0' ); |
|
751 | queue_name = rtems_build_name( 'Q', '_', 'P', '0' ); | |
754 |
|
752 | |||
755 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); |
|
753 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); | |
756 |
|
754 | |||
757 | return status; |
|
755 | return status; | |
758 | } |
|
756 | } | |
759 |
|
757 | |||
760 | rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id ) |
|
758 | rtems_status_code get_message_queue_id_prc1( rtems_id *queue_id ) | |
761 | { |
|
759 | { | |
762 | rtems_status_code status; |
|
760 | rtems_status_code status; | |
763 | rtems_name queue_name; |
|
761 | rtems_name queue_name; | |
764 |
|
762 | |||
765 | queue_name = rtems_build_name( 'Q', '_', 'P', '1' ); |
|
763 | queue_name = rtems_build_name( 'Q', '_', 'P', '1' ); | |
766 |
|
764 | |||
767 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); |
|
765 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); | |
768 |
|
766 | |||
769 | return status; |
|
767 | return status; | |
770 | } |
|
768 | } | |
771 |
|
769 | |||
772 | rtems_status_code get_message_queue_id_prc2( rtems_id *queue_id ) |
|
770 | rtems_status_code get_message_queue_id_prc2( rtems_id *queue_id ) | |
773 | { |
|
771 | { | |
774 | rtems_status_code status; |
|
772 | rtems_status_code status; | |
775 | rtems_name queue_name; |
|
773 | rtems_name queue_name; | |
776 |
|
774 | |||
777 | queue_name = rtems_build_name( 'Q', '_', 'P', '2' ); |
|
775 | queue_name = rtems_build_name( 'Q', '_', 'P', '2' ); | |
778 |
|
776 | |||
779 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); |
|
777 | status = rtems_message_queue_ident( queue_name, 0, queue_id ); | |
780 |
|
778 | |||
781 | return status; |
|
779 | return status; | |
782 | } |
|
780 | } |
General Comments 0
You need to be logged in to leave comments.
Login now