On a second look I noticed some self-tests aren't reporting their results which basically renders the self-test useless. Since it reports no errors. Below is a list of the functions with missing returns.
Function
Chip
Expected Behaviour
Actual Behaviour
LTC6810_rdaux()
LTC6810
Returns 0 if no errors detected. Returns -1 if a PEC mismatch is detected.
Always returns 0. Which means Errors are not detected.
LTC6810_rdcomm()
LTC6810
Returns 0 if no errors detected. Returns -1 if a PEC mismatch is detected.
Always returns 0. Which means Errors are not detected.
LTC6810_run_adc_redundancy_st()
LTC6810
Return the total number of errors detected.
Always returns 0. Which means Errors are not detected.
LTC6811_rdaux()
LTC6811
Returns 0 if no errors detected. Returns -1 if a PEC mismatch is detected.
Always returns 0. Which means Errors are not detected.
LTC6811_rdcomm()
LTC6811
Returns 0 if no errors detected. Returns -1 if a PEC mismatch is detected.
Always returns 0. Which means Errors are not detected.
LTC6811_run_adc_redundancy_st()
LTC6811
Return the total number of errors detected.
Always returns 0. Which means Errors are not detected.
LTC6811_run_adc_overlap()
LTC6811
Return the total number of errors detected.
Always returns 0. Which means Errors are not detected.
LTC6812_rdsctrl()
LTC6812
Returns 0 if no errors detected. Returns -1 if a PEC mismatch is detected.
returns nothing. Undefined behaviour if return value is used.
LTC6812_rdaux()
LTC6812
Returns 0 if no errors detected. Returns -1 if a PEC mismatch is detected.
Always returns 0. Which means Errors are not detected.
LTC6812_rdcomm()
LTC6812
Returns 0 if no errors detected. Returns -1 if a PEC mismatch is detected.
Always returns 0. Which means Errors are not detected.
LTC6812_run_adc_redundancy_st()
LTC6812
Return the total number of errors detected.
Always returns 0. Which means Errors are not detected.
LTC6813_rdsctrl()
LTC6813
Returns 0 if no errors detected. Returns -1 if a PEC mismatch is detected.
returns nothing. Undefined behaviour if return value is used.
LTC6813_rdaux()
LTC6813
Returns 0 if no errors detected. Returns -1 if a PEC mismatch is detected.
Always returns 0. Which means Errors are not detected.
LTC6813_rdcomm()
LTC6813
Returns 0 if no errors detected. Returns -1 if a PEC mismatch is detected.
Always returns 0. Which means Errors are not detected.
LTC6813_run_adc_redundancy_st()
LTC6813
Return the total number of errors detected.
Always returns 0. Which means Errors are not detected.
I started with fixing the PEC errors: https://github.com/analogdevicesinc/Linduino/pull/54 These are very big bugs.
On a second look I noticed some self-tests aren't reporting their results which basically renders the self-test useless. Since it reports no errors. Below is a list of the functions with missing returns.
LTC6810_rdaux()
LTC6810_rdcomm()
LTC6810_run_adc_redundancy_st()
LTC6811_rdaux()
LTC6811_rdcomm()
LTC6811_run_adc_redundancy_st()
LTC6811_run_adc_overlap()
LTC6812_rdsctrl()
return
value is used.LTC6812_rdaux()
LTC6812_rdcomm()
LTC6812_run_adc_redundancy_st()
LTC6813_rdsctrl()
return
value is used.LTC6813_rdaux()
LTC6813_rdcomm()
LTC6813_run_adc_redundancy_st()