This includes LTC681x.cpp, LTC6813.cpp, LTC6812.cpp.
See below LTC681x.cpp case:
for (int cic = 0; cic<total_ic; cic++)
{
measure_delta = (int32_t)ic[cic].cells.c_codes[6]-(int32_t)ic[cic].cells.c_codes[7];
if ((measure_delta>failure_pos_limit) || (measure_delta<failure_neg_limit))
{
error = error | (1<<(cic-1)); // <-- when cic = 0 we have a negative bitwise shift which is undefined behaviour
}
}
On top of this I think the error counter should only count the errors.
for (int cic = 0; cic<total_ic; cic++)
{
measure_delta = (int32_t)ic[cic].cells.c_codes[6]-(int32_t)ic[cic].cells.c_codes[7];
if ((measure_delta>failure_pos_limit) || (measure_delta<failure_neg_limit))
{
error += 1;
}
}
This includes
LTC681x.cpp,LTC6813.cpp,LTC6812.cpp.See below
LTC681x.cppcase:On top of this I think the error counter should only count the errors.