sensors/boson: Restore FLIR BOSON Factory defaults on reset.

It's possible to load settings into the FLIR BOSON via the desktop GUI which prevent
it from outputting the expected image after reset. Always restore the factory default
settings and apply all recomended steps to set the video output mode.
This commit is contained in:
Kwabena W. Agyeman 2025-03-26 21:16:57 -07:00
parent eb779fd48a
commit 004aff310c

View File

@ -87,10 +87,26 @@ static int reset(omv_csi_t *csi) {
return -1;
}
// Always restore factory defaults to ensure the camera is in a known state.
FLR_RESULT ret = bosonRestoreFactoryDefaultsFromFlash();
// FLIR BOSON may glitch after restoring factory defaults.
if (ret != FLR_OK && ret != FLR_COMM_ERROR_READING_COMM) {
return -1;
}
if (dvoSetOutputFormat(FLR_DVO_DEFAULT_FORMAT) != FLR_OK) {
return -1;
}
if (dvoSetType(FLR_DVO_TYPE_MONO8) != FLR_OK) {
return -1;
}
if (dvoApplyCustomSettings() != FLR_OK) {
return -1;
}
if (telemetrySetState(FLR_DISABLE) != FLR_OK) {
return -1;
}