Merge pull request #2631 from kwagyeman/kwabena/improve_flir_boson_driver
Some checks failed
🔎 Check Code Formatting / formatting-check (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_GIGA) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NANO_33_BLE_SENSE) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NANO_RP2040_CONNECT) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NICLA_VISION) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_PORTENTA_H7) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV2) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV3) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV4) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV4P) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMVPT) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV_RT1060) (push) Has been cancelled
🔥 Firmware Build / code-size-report (push) Has been cancelled
🔥 Firmware Build / stable-release (push) Has been cancelled
🔥 Firmware Build / development-release (push) Has been cancelled

sensors/boson: Try to initialize the FLIR BOSON in a loop.
This commit is contained in:
Ibrahim Abdelkader 2025-03-23 14:08:23 +02:00 committed by GitHub
commit eb779fd48a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,21 +44,38 @@
#include "Client_API.h"
#include "UART_Connector.h"
#define FLIR_BOSON_BOOT_TIME_MS (2500)
#define FLIR_BOSON_BOOT_TRY_COUNT (10)
#define FLIR_BOSON_BOOT_TIME_MS (1000)
static int boson_framesize = 0;
static int reset(omv_csi_t *csi) {
csi->color_palette = NULL;
// Give the camera time to boot.
mp_hal_delay_ms(FLIR_BOSON_BOOT_TIME_MS);
// Turn the com port on.
Initialize();
int i = 0;
FLR_BOSON_PARTNUMBER_T part;
if (bosonGetCameraPN(&part) != FLR_OK) {
// Older FLIR Boson (< IDD 4.x) cameras take forever to boot up.
for (; i < FLIR_BOSON_BOOT_TRY_COUNT; i++) {
if (i > 1) {
// Print something to prevent the user from thinking the camera is stuck.
mp_printf(MP_PYTHON_PRINTER,
"CSI: FLIR Boson not ready, retrying (%d/%d)...\n",
i, FLIR_BOSON_BOOT_TRY_COUNT - 1);
}
// Give the camera time to boot.
mp_hal_delay_ms(FLIR_BOSON_BOOT_TIME_MS);
// Turn the com port on.
Initialize();
if (bosonGetCameraPN(&part) == FLR_OK) {
break;
}
}
if (i == FLIR_BOSON_BOOT_TRY_COUNT) {
return -1;
}