aboutsummaryrefslogtreecommitdiff
path: root/Projects/TempDataLogger
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-09-13 08:21:07 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-09-13 08:21:07 +0000
commit2b1f6dd63e3a9ae5ed2ab9d4aeabd60eab7c6c10 (patch)
tree858ff1ca8b6781ea8f53ecc55881701602784991 /Projects/TempDataLogger
parent44e3311de4c0d12b228bce55edc4ceff690d4f91 (diff)
Commit LUFA-111009-QA tag for QA testing before moving into beta phase.LUFA-111009-QA
git-svn-id: http://lufa-lib.googlecode.com/svn/tags/LUFA-111009-QA@1923 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'Projects/TempDataLogger')
-rw-r--r--Projects/TempDataLogger/Descriptors.c6
-rw-r--r--Projects/TempDataLogger/Lib/DataflashManager.c2
-rw-r--r--Projects/TempDataLogger/TempDataLogger.c4
-rw-r--r--Projects/TempDataLogger/TempDataLogger.h5
4 files changed, 7 insertions, 10 deletions
diff --git a/Projects/TempDataLogger/Descriptors.c b/Projects/TempDataLogger/Descriptors.c
index 4aae3928..2e92c45f 100644
--- a/Projects/TempDataLogger/Descriptors.c
+++ b/Projects/TempDataLogger/Descriptors.c
@@ -136,7 +136,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | MASS_STORAGE_IN_EPNUM),
+ .EndpointAddress = (ENDPOINT_DIR_IN | MASS_STORAGE_IN_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
@@ -146,7 +146,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
+ .EndpointAddress = (ENDPOINT_DIR_OUT | MASS_STORAGE_OUT_EPNUM),
.Attributes = (EP_TYPE_BULK | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = MASS_STORAGE_IO_EPSIZE,
.PollingIntervalMS = 0x01
@@ -183,7 +183,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},
- .EndpointAddress = (ENDPOINT_DESCRIPTOR_DIR_IN | GENERIC_IN_EPNUM),
+ .EndpointAddress = (ENDPOINT_DIR_IN | GENERIC_IN_EPNUM),
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
.EndpointSize = GENERIC_EPSIZE,
.PollingIntervalMS = 0x01
diff --git a/Projects/TempDataLogger/Lib/DataflashManager.c b/Projects/TempDataLogger/Lib/DataflashManager.c
index efd70012..b7d05980 100644
--- a/Projects/TempDataLogger/Lib/DataflashManager.c
+++ b/Projects/TempDataLogger/Lib/DataflashManager.c
@@ -356,7 +356,7 @@ void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
/* Send the Dataflash buffer write command */
Dataflash_ToggleSelectedChipCS();
- Dataflash_SendByte(DF_CMD_BUFF1WRITE);
+ Dataflash_SendByte(UsingSecondBuffer ? DF_CMD_BUFF2WRITE : DF_CMD_BUFF1WRITE);
Dataflash_SendAddressBytes(0, 0);
}
diff --git a/Projects/TempDataLogger/TempDataLogger.c b/Projects/TempDataLogger/TempDataLogger.c
index e0a08933..e8d79874 100644
--- a/Projects/TempDataLogger/TempDataLogger.c
+++ b/Projects/TempDataLogger/TempDataLogger.c
@@ -102,7 +102,7 @@ ISR(TIMER1_COMPA_vect, ISR_BLOCK)
uint8_t LEDMask = LEDs_GetLEDs();
/* Check to see if the logging interval has expired */
- if (CurrentLoggingTicks++ < LoggingInterval500MS_SRAM)
+ if (++CurrentLoggingTicks < LoggingInterval500MS_SRAM)
return;
/* Reset log tick counter to prepare for next logging interval */
@@ -200,7 +200,7 @@ void SetupHardware(void)
Temperature_Init();
Dataflash_Init();
USB_Init();
- TWI_Init(TWI_BIT_PRESCALE_4, (F_CPU / 4 / 50000) / 2);
+ TWI_Init(TWI_BIT_PRESCALE_4, TWI_BITLENGTH_FROM_FREQ(4, 50000));
/* 500ms logging interval timer configuration */
OCR1A = (((F_CPU / 1024) / 2) - 1);
diff --git a/Projects/TempDataLogger/TempDataLogger.h b/Projects/TempDataLogger/TempDataLogger.h
index f3caa66b..10597da4 100644
--- a/Projects/TempDataLogger/TempDataLogger.h
+++ b/Projects/TempDataLogger/TempDataLogger.h
@@ -72,11 +72,8 @@
/** LED mask for the library LED driver, to indicate that the USB interface is busy. */
#define LEDMASK_USB_BUSY LEDS_LED2
- /** Filename for the log data when written to the dataflash FAT filesystem. */
- #define LOG_FILENAME "TEMPLOG.txt"
-
/** Default log interval when the EEPROM is blank, in 500ms ticks. */
- #define DEFAULT_LOG_INTERVAL 20
+ #define DEFAULT_LOG_INTERVAL 10
/** Indicates if the disk is write protected or not. */
#define DISK_READ_ONLY false