aboutsummaryrefslogtreecommitdiffstats
path: root/LUFA/Drivers/Board
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-12-26 15:44:10 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-12-26 15:44:10 +0000
commit6026b9128b3e9095375224731dd95e70c3edc206 (patch)
tree4b6973cf662422ba104ab4c101560492560cffeb /LUFA/Drivers/Board
parentc05e7cd7d9ec8cb593e837ba9928a02c3449e55f (diff)
downloadlufa-6026b9128b3e9095375224731dd95e70c3edc206.tar.gz
lufa-6026b9128b3e9095375224731dd95e70c3edc206.tar.bz2
lufa-6026b9128b3e9095375224731dd95e70c3edc206.zip
Fix compile errors from the changes to the SerialStream and board Temperature drivers.
Diffstat (limited to 'LUFA/Drivers/Board')
-rw-r--r--LUFA/Drivers/Board/Temperature.c4
-rw-r--r--LUFA/Drivers/Board/Temperature.h7
2 files changed, 7 insertions, 4 deletions
diff --git a/LUFA/Drivers/Board/Temperature.c b/LUFA/Drivers/Board/Temperature.c
index 3c8028143..e95b4ba99 100644
--- a/LUFA/Drivers/Board/Temperature.c
+++ b/LUFA/Drivers/Board/Temperature.c
@@ -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);
diff --git a/LUFA/Drivers/Board/Temperature.h b/LUFA/Drivers/Board/Temperature.h
index fa86ccd24..ef76ece27 100644
--- a/LUFA/Drivers/Board/Temperature.h
+++ b/LUFA/Drivers/Board/Temperature.h
@@ -92,12 +92,15 @@
/** ADC channel MUX mask for the temperature sensor. */
#define TEMP_ADC_CHANNEL_MASK ADC_CHANNEL0
+
+ /** Size of the temperature sensor lookup table, in lookup values */
+ #define TEMP_TABLE_SIZE 120
/** Minimum returnable temperature from the \ref Temperature_GetTemperature() function. */
- #define TEMP_MIN_TEMP TEMP_TABLE_OFFSET
+ #define TEMP_MIN_TEMP TEMP_TABLE_OFFSET_DEGREES
/** Maximum returnable temperature from the \ref Temperature_GetTemperature() function. */
- #define TEMP_MAX_TEMP ((TEMP_TABLE_SIZE - 1) + TEMP_TABLE_OFFSET)
+ #define TEMP_MAX_TEMP ((TEMP_TABLE_SIZE - 1) + TEMP_TABLE_OFFSET_DEGREES)
/* Inline Functions: */
/** Initialises the temperature sensor driver, including setting up the appropriate ADC channel.