1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 06:45:16 +03:00

Add camera frame OSD element

Adds an adjustable outline element designed to represent the field of view of the pilot's HD camera for visual framing. The width, height and position of the frame are adjustable.
This commit is contained in:
Bruce Luckcuck 2019-11-01 17:30:02 -04:00
parent ef4da5ab3c
commit 5c3b8c6eb6
5 changed files with 54 additions and 0 deletions

View file

@ -878,6 +878,11 @@ static bool mspCommonProcessOutCommand(uint8_t cmdMSP, sbuf_t *dst, mspPostProce
sbufWriteU8(dst, 0);
#endif // USE_OSD_STICK_OVERLAY
// API >= 1.43
// Add the camera frame element width/height
sbufWriteU8(dst, osdConfig()->camera_frame_width);
sbufWriteU8(dst, osdConfig()->camera_frame_height);
#endif // USE_OSD
break;
}
@ -3259,6 +3264,13 @@ static mspResult_e mspCommonProcessInCommand(mspDescriptor_t srcDesc, uint8_t cm
#endif // USE_OSD_STICK_OVERLAY
}
if (sbufBytesRemaining(src) >= 2) {
// API >= 1.43
// OSD camera frame element width/height
osdConfigMutable()->camera_frame_width = sbufReadU8(src);
osdConfigMutable()->camera_frame_height = sbufReadU8(src);
}
#endif
} else if ((int8_t)addr == -2) {
#if defined(USE_OSD)