Skip to content

Commit 201d5b9

Browse files
Li.TianmingLi.Tianming
authored andcommitted
Add Hide/Show option for ALT and homeDist
1 parent f2685b1 commit 201d5b9

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/drivers/osd/msp_osd/msp_osd.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -414,11 +414,11 @@ void MspOsd::Run()
414414
// vehicle_global_position,
415415
// _heartbeat);
416416
// this->Send(MSP_COMP_GPS, &msg);
417+
if(enabled(SymbolIndex::HOME_DIST)){
418+
const auto msg = msp_osd::construct_rendor_distanceToHome(home_position, vehicle_global_position);
417419

418-
const auto msg = msp_osd::construct_rendor_distanceToHome(home_position, vehicle_global_position);
419-
420-
this->Send(MSP_CMD_DISPLAYPORT, &msg, sizeof(msp_rendor_distanceToHome_t));
421-
420+
this->Send(MSP_CMD_DISPLAYPORT, &msg, sizeof(msp_rendor_distanceToHome_t));
421+
}
422422
}
423423

424424
// MSP_ATTITUDE
@@ -450,10 +450,12 @@ void MspOsd::Run()
450450
// construct and send message
451451
// const auto msg = msp_osd::construct_ALTITUDE(vehicle_gps_position, vehicle_local_position);
452452
// this->Send(MSP_ALTITUDE, &msg);
453+
454+
if(enabled(SymbolIndex::ALTITUDE)){
453455
const auto msg = msp_osd::construct_Rendor_ALTITUDE(vehicle_gps_position, vehicle_local_position);
454456

455457
this->Send(MSP_CMD_DISPLAYPORT, &msg, sizeof(msp_altitude_t));
456-
458+
}
457459
}
458460

459461
// MSP_MOTOR_TELEMETRY

0 commit comments

Comments
 (0)