diff --git a/src/modules/sdlog2/sdlog2.c b/src/modules/sdlog2/sdlog2.c index fcedb2fb246d..990cb6387025 100644 --- a/src/modules/sdlog2/sdlog2.c +++ b/src/modules/sdlog2/sdlog2.c @@ -163,8 +163,6 @@ static const int LOG_BUFFER_SIZE_DEFAULT = 8192; static const int MAX_WRITE_CHUNK = 512; static const int MIN_BYTES_TO_WRITE = 512; -static const unsigned TELEMETRY_STATUS_MAX_LOG = 2;// TELEMETRY_STATUS_ORB_ID_NUM - static bool _extended_logging = false; #define MOUNTPOINT "/fs/microsd" @@ -1164,15 +1162,11 @@ int sdlog2_thread_main(int argc, char *argv[]) /* add new topics HERE */ - for (unsigned i = 0; i < TELEMETRY_STATUS_MAX_LOG; i++) { - subs.telemetry_subs[i] = orb_subscribe(telemetry_status_orb_id[i]); - } - - if (_extended_logging) { - subs.sat_info_sub = orb_subscribe(ORB_ID(satellite_info)); - } else { - subs.sat_info_sub = 0; + for (unsigned i = 0; i < TELEMETRY_STATUS_ORB_ID_NUM; i++) { + subs.telemetry_subs[i] = -1; } + + subs.sat_info_sub = -1; /* close non-needed fd's */ @@ -1752,7 +1746,7 @@ int sdlog2_thread_main(int argc, char *argv[]) } /* --- TELEMETRY --- */ - for (unsigned i = 0; i < TELEMETRY_STATUS_MAX_LOG; i++) { + for (unsigned i = 0; i < TELEMETRY_STATUS_ORB_ID_NUM; i++) { if (copy_if_updated(telemetry_status_orb_id[i], subs.telemetry_subs[i], &buf.telemetry)) { log_msg.msg_type = LOG_TEL0_MSG + i; log_msg.body.log_TEL.rssi = buf.telemetry.rssi;