Fixed incorrect definition of the HID_KEYBOARD_SC_RIGHT_ARROW constant in the HID...
[pub/lufa.git] / LUFA / Drivers / Board / Temperature.c
index a5e82a2..42b3937 100644 (file)
@@ -1,21 +1,21 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2010.
-              
+     Copyright (C) Dean Camera, 2011.
+
   dean [at] fourwalledcubicle [dot] com
-      www.fourwalledcubicle.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 
+  Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
-  without fee, provided that the above copyright notice appear in 
+  without fee, provided that the above copyright notice appear in
   all copies and that both that the copyright notice and this
-  permission notice and warranty disclaimer appear in supporting 
-  documentation, and that the name of the author not be used in 
-  advertising or publicity pertaining to distribution of the 
+  permission notice and warranty disclaimer appear in supporting
+  documentation, and that the name of the author not be used in
+  advertising or publicity pertaining to distribution of the
   software without specific, written prior permission.
 
   The author disclaim all warranties with regard to this
@@ -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,
@@ -53,8 +53,9 @@ int8_t Temperature_GetTemperature(void)
        for (uint16_t Index = 0; Index < TEMP_TABLE_SIZE; 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;
 }
+