analogdevicesinc / adpd-drivers

Analog Devices Photometric Device Drivers
Other
19 stars 10 forks source link

dubious list end detection in adi_adpdssm_loadDcfg() #6

Open hgrf opened 3 years ago

hgrf commented 3 years ago

The end of the list of register-value pairs is detected either by a value=0xFFFF or by a failed register write:

while((nRegData != 0xFFFFU) && (nRet == ADI_ADPD_DRV_SUCCESS)) {...}

The header files with these lists, generated by the evaluation software for ADPD4000 (tested with version 3.5.0), do not put a value 0xFFFF at the end of the list. This may lead to random register writes depening on the MCU memory content after the list. Furthermore, this mechanism implies that trying to write 0xFFFF to any register ends the parsing of the configuration list.

How about adding the length of the list as a parameter to adi_adpdssm_loadDcfg() ?

Kind regards,

Holger