if (Temp_ADC > pgm_read_word(&Temperature_Lookup[0]))
return TEMP_MIN_TEMP;
- for (uint16_t Index = 0; Index < TEMP_TABLE_SIZE; Index++)
+ for (uint16_t Index = 0; Index < (sizeof(Temperature_Lookup) / sizeof(Temperature_Lookup[0])); Index++)
{
if (Temp_ADC > pgm_read_word(&Temperature_Lookup[Index]))
- return (Index + TEMP_TABLE_OFFSET);
+ return (Index + TEMP_TABLE_OFFSET_DEGREES);
}
return TEMP_MAX_TEMP;