drivers/sensors: Fix support for FLIR Lepton 1.

This commit is contained in:
Kwabena W. Agyeman 2025-07-20 21:02:51 -07:00
parent 4c5b996c5b
commit 592a22902b

View File

@ -314,7 +314,11 @@ static int lepton_reset(omv_csi_t *csi, bool measurement_mode, bool high_temp_mo
// Use the low gain mode to enable high temperature readings (~450C) on Lepton 3.5 // Use the low gain mode to enable high temperature readings (~450C) on Lepton 3.5
LEP_SYS_GAIN_MODE_E gain_mode = high_temp_mode ? LEP_SYS_GAIN_MODE_LOW : LEP_SYS_GAIN_MODE_HIGH; LEP_SYS_GAIN_MODE_E gain_mode = high_temp_mode ? LEP_SYS_GAIN_MODE_LOW : LEP_SYS_GAIN_MODE_HIGH;
if (LEP_SetSysGainMode(&lepton.port, gain_mode) != LEP_OK || bool hasSetSysGainMode = csi->chip_id == LEPTON_3_5 ||
csi->chip_id == LEPTON_3_0 ||
csi->chip_id == LEPTON_2_5;
if ((hasSetSysGainMode && LEP_SetSysGainMode(&lepton.port, gain_mode) != LEP_OK) ||
LEP_GetAgcROI(&lepton.port, &roi) != LEP_OK || LEP_GetAgcROI(&lepton.port, &roi) != LEP_OK ||
LEP_SetRadEnableState(&lepton.port, measurement_mode) != LEP_OK || LEP_SetRadEnableState(&lepton.port, measurement_mode) != LEP_OK ||
LEP_SetAgcEnableState(&lepton.port, !measurement_mode) != LEP_OK || LEP_SetAgcEnableState(&lepton.port, !measurement_mode) != LEP_OK ||