Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_OSD: fix code causing errors while compiling out OSD #19146

Merged
merged 1 commit into from Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions libraries/AP_MSP/AP_MSP_Telem_DJI.cpp
Expand Up @@ -97,13 +97,16 @@ MSPCommandResult AP_MSP_Telem_DJI::msp_process_out_esc_sensor_data(sbuf_t *dst)
if (!displaying_stats_screen()) {
telem.get_highest_motor_temperature(highest_temperature);
} else {
#if OSD_ENABLED
shiv-tyagi marked this conversation as resolved.
Show resolved Hide resolved
AP_OSD *osd = AP::osd();
if (osd == nullptr) {
return MSP_RESULT_ERROR;
}
WITH_SEMAPHORE(osd->get_semaphore());
highest_temperature = osd->get_stats_info().max_esc_temp;
#endif
}

const struct PACKED {
uint8_t temp;
uint16_t rpm;
Expand Down
3 changes: 2 additions & 1 deletion libraries/AP_OSD/AP_OSD.cpp
Expand Up @@ -217,12 +217,13 @@ const AP_Param::GroupInfo AP_OSD::var_info[] = {
AP_SUBGROUPINFO(param_screen[1], "6_", 22, AP_OSD, AP_OSD_ParamScreen),
#endif

#if OSD_ENABLED
shiv-tyagi marked this conversation as resolved.
Show resolved Hide resolved
// additional tables to go beyond 63 limit
AP_SUBGROUPINFO2(screen[0], "1_", 27, AP_OSD, AP_OSD_Screen),
AP_SUBGROUPINFO2(screen[1], "2_", 28, AP_OSD, AP_OSD_Screen),
AP_SUBGROUPINFO2(screen[2], "3_", 29, AP_OSD, AP_OSD_Screen),
AP_SUBGROUPINFO2(screen[3], "4_", 30, AP_OSD, AP_OSD_Screen),

#endif
AP_GROUPEND
};

Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_OSD/AP_OSD.h
Expand Up @@ -380,7 +380,7 @@ class AP_OSD_ParamScreen : public AP_OSD_AbstractScreen
static const uint8_t NUM_PARAMS = 9;
static const uint8_t SAVE_PARAM = NUM_PARAMS + 1;

#if HAL_WITH_OSD_BITMAP || HAL_WITH_MSP_DISPLAYPORT
#if OSD_ENABLED && (HAL_WITH_OSD_BITMAP || HAL_WITH_MSP_DISPLAYPORT)
shiv-tyagi marked this conversation as resolved.
Show resolved Hide resolved
void draw(void) override;
#endif
#if HAL_GCS_ENABLED
Expand Down