File tree 2 files changed +16
-26
lines changed 2 files changed +16
-26
lines changed Original file line number Diff line number Diff line change @@ -177,40 +177,30 @@ void LoggerMessageWriter_DFLogStart::process()
177
177
stage = Stage::RUNNING_SUBWRITERS;
178
178
FALLTHROUGH;
179
179
180
- case Stage::RUNNING_SUBWRITERS:
181
- if (!_writesysinfo.finished ()) {
182
- _writesysinfo.process ();
183
- if (!_writesysinfo.finished ()) {
184
- return ;
185
- }
186
- }
180
+ case Stage::RUNNING_SUBWRITERS: {
181
+ LoggerMessageWriter *subwriters[] {
182
+ &_writesysinfo,
187
183
#if AP_MISSION_ENABLED
188
- if (!_writeentiremission.finished ()) {
189
- _writeentiremission.process ();
190
- if (!_writeentiremission.finished ()) {
191
- return ;
192
- }
193
- }
184
+ &_writeentiremission,
194
185
#endif
195
186
#if HAL_LOGGER_RALLY_ENABLED
196
- if (!_writeallrallypoints.finished ()) {
197
- _writeallrallypoints.process ();
198
- if (!_writeallrallypoints.finished ()) {
199
- return ;
200
- }
201
- }
187
+ &_writeallrallypoints,
202
188
#endif
203
189
#if HAL_LOGGER_FENCE_ENABLED
204
- if (!_writeallpolyfence.finished ()) {
205
- _writeallpolyfence.process ();
206
- if (!_writeallpolyfence.finished ()) {
207
- return ;
190
+ &_writeallpolyfence,
191
+ #endif
192
+ };
193
+ for (auto *sw : subwriters) {
194
+ if (!sw->finished ()) {
195
+ sw->process ();
196
+ if (!sw->finished ()) {
197
+ return ;
198
+ }
208
199
}
209
200
}
210
- #endif
211
201
stage = Stage::VEHICLE_MESSAGES;
212
202
FALLTHROUGH;
213
-
203
+ }
214
204
case Stage::VEHICLE_MESSAGES:
215
205
// we guarantee 200 bytes of space for the vehicle startup
216
206
// messages. This allows them to be simple functions rather
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class LoggerMessageWriter {
8
8
9
9
virtual void reset () = 0;
10
10
virtual void process () = 0;
11
- virtual bool finished () { return _finished; }
11
+ bool finished () const { return _finished; }
12
12
13
13
virtual void set_logger_backend (class AP_Logger_Backend *backend) {
14
14
_logger_backend = backend;
You can’t perform that action at this time.
0 commit comments