X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/2073b96d82433607bd287e3b6529fd0d3cc428cd..ef44b8c036daf4806a369dfdcd5adf72cf85b824:/LUFA/Drivers/Board/Temperature.c diff --git a/LUFA/Drivers/Board/Temperature.c b/LUFA/Drivers/Board/Temperature.c index 3c8028143..42b393796 100644 --- a/LUFA/Drivers/Board/Temperature.c +++ b/LUFA/Drivers/Board/Temperature.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2010. + Copyright (C) Dean Camera, 2011. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -30,7 +30,7 @@ #include "Temperature.h" -static const uint16_t PROGMEM Temperature_Lookup[] = { +static const uint16_t PROGMEM Temperature_Lookup[TEMP_TABLE_SIZE] = { 0x3B4, 0x3B0, 0x3AB, 0x3A6, 0x3A0, 0x39A, 0x394, 0x38E, 0x388, 0x381, 0x37A, 0x373, 0x36B, 0x363, 0x35B, 0x353, 0x34A, 0x341, 0x338, 0x32F, 0x325, 0x31B, 0x311, 0x307, 0x2FC, 0x2F1, 0x2E6, 0x2DB, 0x2D0, 0x2C4, 0x2B8, 0x2AC, 0x2A0, 0x294, 0x288, 0x27C, @@ -50,7 +50,7 @@ int8_t Temperature_GetTemperature(void) if (Temp_ADC > pgm_read_word(&Temperature_Lookup[0])) return TEMP_MIN_TEMP; - for (uint16_t Index = 0; Index < (sizeof(Temperature_Lookup) / sizeof(Temperature_Lookup[0])); Index++) + for (uint16_t Index = 0; Index < TEMP_TABLE_SIZE; Index++) { if (Temp_ADC > pgm_read_word(&Temperature_Lookup[Index])) return (Index + TEMP_TABLE_OFFSET_DEGREES);