melexis / mlx90632-library

MLX90632 library for the Melexis 90632 Infra Red temperature sensor.
Apache License 2.0
42 stars 15 forks source link

EE_VERSION fails on MLX90632_XTD_RNG_KEY at mlx90632_init #32

Closed KammutierSpule closed 3 years ago

KammutierSpule commented 3 years ago

Hello, I'm using a extended device.

It returns an error on mlx90632_init

if ((eeprom_version & 0x7F00) == MLX90632_XTD_RNG_KEY)
    {
        return ERANGE;
    }

What does it mean?

Letme commented 3 years ago

https://github.com/melexis/mlx90632-library/blob/master/inc/mlx90632.h#L366

KammutierSpule commented 3 years ago

thanks I understand now :)

Letme commented 3 years ago

It's a positive value, so it's not an error. And to keep it compatible somehow with errno.h, we reused the ERANGE name (Which wrongly indicates ErrorRANGE, but you could as well view is as ExtendedRANGE ).