aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/TempDataLogger/Lib
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-10-13 14:05:35 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-10-13 14:05:35 +0000
commit5a4def747897c1c6ffbe465506d846c7c686d3e9 (patch)
treee5a9ca31ab554e993f1a9041e44976cf7b253921 /Projects/TempDataLogger/Lib
parenta8871c7fba73307226bd13e2cad4c840c850e6f1 (diff)
downloadlufa-5a4def747897c1c6ffbe465506d846c7c686d3e9.tar.gz
lufa-5a4def747897c1c6ffbe465506d846c7c686d3e9.tar.bz2
lufa-5a4def747897c1c6ffbe465506d846c7c686d3e9.zip
Clean up excessive whitespace at the end of each line using the wspurify tool made by Laszlo Monda
Diffstat (limited to 'Projects/TempDataLogger/Lib')
-rw-r--r--Projects/TempDataLogger/Lib/DS1307.c23
-rw-r--r--Projects/TempDataLogger/Lib/DS1307.h23
-rw-r--r--Projects/TempDataLogger/Lib/DataflashManager.c81
-rw-r--r--Projects/TempDataLogger/Lib/DataflashManager.h23
-rw-r--r--Projects/TempDataLogger/Lib/FATFs/00readme.txt1
-rw-r--r--Projects/TempDataLogger/Lib/FATFs/diskio.c1
-rw-r--r--Projects/TempDataLogger/Lib/FATFs/diskio.h1
-rw-r--r--Projects/TempDataLogger/Lib/FATFs/ff.c5
-rw-r--r--Projects/TempDataLogger/Lib/FATFs/ff.h1
-rw-r--r--Projects/TempDataLogger/Lib/FATFs/ffconf.h1
-rw-r--r--Projects/TempDataLogger/Lib/FATFs/integer.h1
-rw-r--r--Projects/TempDataLogger/Lib/SCSI.c63
-rw-r--r--Projects/TempDataLogger/Lib/SCSI.h25
13 files changed, 131 insertions, 118 deletions
diff --git a/Projects/TempDataLogger/Lib/DS1307.c b/Projects/TempDataLogger/Lib/DS1307.c
index a85aa6176..270dbbaa9 100644
--- a/Projects/TempDataLogger/Lib/DS1307.c
+++ b/Projects/TempDataLogger/Lib/DS1307.c
@@ -1,6 +1,6 @@
/*
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -15,7 +15,7 @@ void DS1307_SetDate(const uint8_t Day,
return;
#endif
- DS1307_DateRegs_t CurrentRTCDate;
+ DS1307_DateRegs_t CurrentRTCDate;
CurrentRTCDate.Byte1.Fields.TenDay = (Day / 10);
CurrentRTCDate.Byte1.Fields.Day = (Day % 10);
CurrentRTCDate.Byte2.Fields.TenMonth = (Month / 10);
@@ -29,7 +29,7 @@ void DS1307_SetDate(const uint8_t Day,
TWI_SendByte(CurrentRTCDate.Byte1.IntVal);
TWI_SendByte(CurrentRTCDate.Byte2.IntVal);
TWI_SendByte(CurrentRTCDate.Byte3.IntVal);
-
+
TWI_StopTransmission();
}
}
@@ -51,18 +51,18 @@ void DS1307_SetTime(const uint8_t Hour,
CurrentRTCTime.Byte3.Fields.TenHour = (Hour / 10);
CurrentRTCTime.Byte3.Fields.Hour = (Hour % 10);
CurrentRTCTime.Byte3.Fields.TwelveHourMode = false;
-
+
if (TWI_StartTransmission(DS1307_ADDRESS_WRITE, 10))
{
TWI_SendByte(DS1307_TIMEREG_START);
TWI_SendByte(CurrentRTCTime.Byte1.IntVal);
TWI_SendByte(CurrentRTCTime.Byte2.IntVal);
TWI_SendByte(CurrentRTCTime.Byte3.IntVal);
-
+
TWI_StopTransmission();
}
}
-
+
void DS1307_GetDate(uint8_t* const Day,
uint8_t* const Month,
uint8_t* const Year)
@@ -77,7 +77,7 @@ void DS1307_GetDate(uint8_t* const Day,
if (TWI_StartTransmission(DS1307_ADDRESS_WRITE, 10))
{
TWI_SendByte(DS1307_DATEREG_START);
-
+
TWI_StopTransmission();
}
@@ -88,7 +88,7 @@ void DS1307_GetDate(uint8_t* const Day,
TWI_ReceiveByte(&CurrentRTCDate.Byte1.IntVal, false);
TWI_ReceiveByte(&CurrentRTCDate.Byte2.IntVal, false);
TWI_ReceiveByte(&CurrentRTCDate.Byte3.IntVal, true);
-
+
TWI_StopTransmission();
}
@@ -111,10 +111,10 @@ void DS1307_GetTime(uint8_t* const Hour,
if (TWI_StartTransmission(DS1307_ADDRESS_WRITE, 10))
{
TWI_SendByte(DS1307_TIMEREG_START);
-
+
TWI_StopTransmission();
}
-
+
DS1307_TimeRegs_t CurrentRTCTime;
if (TWI_StartTransmission(DS1307_ADDRESS_READ, 10))
@@ -122,7 +122,7 @@ void DS1307_GetTime(uint8_t* const Hour,
TWI_ReceiveByte(&CurrentRTCTime.Byte1.IntVal, false);
TWI_ReceiveByte(&CurrentRTCTime.Byte2.IntVal, false);
TWI_ReceiveByte(&CurrentRTCTime.Byte3.IntVal, true);
-
+
TWI_StopTransmission();
}
@@ -130,3 +130,4 @@ void DS1307_GetTime(uint8_t* const Hour,
*Minute = (CurrentRTCTime.Byte2.Fields.TenMin * 10) + CurrentRTCTime.Byte2.Fields.Min;
*Hour = (CurrentRTCTime.Byte3.Fields.TenHour * 10) + CurrentRTCTime.Byte3.Fields.Hour;
}
+
diff --git a/Projects/TempDataLogger/Lib/DS1307.h b/Projects/TempDataLogger/Lib/DS1307.h
index c9fe43c3d..3212dd3c9 100644
--- a/Projects/TempDataLogger/Lib/DS1307.h
+++ b/Projects/TempDataLogger/Lib/DS1307.h
@@ -1,6 +1,6 @@
/*
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -24,10 +24,10 @@
unsigned int TenSec : 3;
unsigned int CH : 1;
} Fields;
-
+
uint8_t IntVal;
} Byte1;
-
+
union
{
struct
@@ -36,10 +36,10 @@
unsigned int TenMin : 3;
unsigned int Reserved : 1;
} Fields;
-
+
uint8_t IntVal;
} Byte2;
-
+
union
{
struct
@@ -49,7 +49,7 @@
unsigned int TwelveHourMode : 1;
unsigned int Reserved : 1;
} Fields;
-
+
uint8_t IntVal;
} Byte3;
} DS1307_TimeRegs_t;
@@ -64,7 +64,7 @@
unsigned int TenDay : 2;
unsigned int Reserved : 2;
} Fields;
-
+
uint8_t IntVal;
} Byte1;
@@ -76,10 +76,10 @@
unsigned int TenMonth : 1;
unsigned int Reserved : 3;
} Fields;
-
+
uint8_t IntVal;
} Byte2;
-
+
union
{
struct
@@ -87,7 +87,7 @@
unsigned int Year : 4;
unsigned int TenYear : 4;
} Fields;
-
+
uint8_t IntVal;
} Byte3;
} DS1307_DateRegs_t;
@@ -95,7 +95,7 @@
/* Macros: */
#define DS1307_TIMEREG_START 0x00
#define DS1307_DATEREG_START 0x04
-
+
#define DS1307_ADDRESS_READ 0b11010001
#define DS1307_ADDRESS_WRITE 0b11010000
@@ -114,3 +114,4 @@
uint8_t* const Second);
#endif
+
diff --git a/Projects/TempDataLogger/Lib/DataflashManager.c b/Projects/TempDataLogger/Lib/DataflashManager.c
index 3cabda776..b7bc2f41c 100644
--- a/Projects/TempDataLogger/Lib/DataflashManager.c
+++ b/Projects/TempDataLogger/Lib/DataflashManager.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 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
@@ -77,7 +77,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
while (TotalBlocks)
{
uint8_t BytesInBlockDiv16 = 0;
-
+
/* Write an endpoint packet sized data block to the Dataflash */
while (BytesInBlockDiv16 < (VIRTUAL_MEMORY_BLOCK_SIZE >> 4))
{
@@ -86,7 +86,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
{
/* Clear the current endpoint bank */
Endpoint_ClearOUT();
-
+
/* Wait until the host has sent another packet */
if (Endpoint_WaitUntilReady())
return;
@@ -125,7 +125,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
/* Send the Dataflash buffer write command */
Dataflash_SendByte(UsingSecondBuffer ? DF_CMD_BUFF2WRITE : DF_CMD_BUFF1WRITE);
- Dataflash_SendAddressBytes(0, 0);
+ Dataflash_SendAddressBytes(0, 0);
}
/* Write one 16-byte chunk of data to the Dataflash */
@@ -145,7 +145,7 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
Dataflash_SendByte(Endpoint_Read_Byte());
-
+
/* Increment the Dataflash page 16 byte block counter */
CurrDFPageByteDiv16++;
@@ -154,9 +154,9 @@ void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceIn
/* Check if the current command is being aborted by the host */
if (MSInterfaceInfo->State.IsMassStoreReset)
- return;
+ return;
}
-
+
/* Decrement the blocks remaining counter and reset the sub block counter */
TotalBlocks--;
}
@@ -201,15 +201,15 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
Dataflash_SendByte(0x00);
Dataflash_SendByte(0x00);
Dataflash_SendByte(0x00);
-
+
/* Wait until endpoint is ready before continuing */
if (Endpoint_WaitUntilReady())
return;
-
+
while (TotalBlocks)
{
uint8_t BytesInBlockDiv16 = 0;
-
+
/* Write an endpoint packet sized data block to the Dataflash */
while (BytesInBlockDiv16 < (VIRTUAL_MEMORY_BLOCK_SIZE >> 4))
{
@@ -218,12 +218,12 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
{
/* Clear the endpoint bank to send its contents to the host */
Endpoint_ClearIN();
-
+
/* Wait until the endpoint is ready for more data */
if (Endpoint_WaitUntilReady())
return;
}
-
+
/* Check if end of Dataflash page reached */
if (CurrDFPageByteDiv16 == (DATAFLASH_PAGE_SIZE >> 4))
{
@@ -233,7 +233,7 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
/* Select the next Dataflash chip based on the new Dataflash page index */
Dataflash_SelectChipFromPage(CurrDFPage);
-
+
/* Send the Dataflash main memory page read command */
Dataflash_SendByte(DF_CMD_MAINMEMPAGEREAD);
Dataflash_SendAddressBytes(CurrDFPage, 0);
@@ -241,7 +241,7 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
Dataflash_SendByte(0x00);
Dataflash_SendByte(0x00);
Dataflash_SendByte(0x00);
- }
+ }
/* Read one 16-byte chunk of data from the Dataflash */
Endpoint_Write_Byte(Dataflash_ReceiveByte());
@@ -260,10 +260,10 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
Endpoint_Write_Byte(Dataflash_ReceiveByte());
-
+
/* Increment the Dataflash page 16 byte block counter */
CurrDFPageByteDiv16++;
-
+
/* Increment the block 16 byte block counter */
BytesInBlockDiv16++;
@@ -271,11 +271,11 @@ void DataflashManager_ReadBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
if (MSInterfaceInfo->State.IsMassStoreReset)
return;
}
-
+
/* Decrement the blocks remaining counter */
TotalBlocks--;
}
-
+
/* If the endpoint is full, send its contents to the host */
if (!(Endpoint_IsReadWriteAllowed()))
Endpoint_ClearIN();
@@ -315,11 +315,11 @@ void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
/* Send the Dataflash buffer write command */
Dataflash_SendByte(DF_CMD_BUFF1WRITE);
Dataflash_SendAddressBytes(0, CurrDFPageByte);
-
+
while (TotalBlocks)
{
uint8_t BytesInBlockDiv16 = 0;
-
+
/* Write an endpoint packet sized data block to the Dataflash */
while (BytesInBlockDiv16 < (VIRTUAL_MEMORY_BLOCK_SIZE >> 4))
{
@@ -359,18 +359,18 @@ void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress,
Dataflash_SendByte(DF_CMD_BUFF1WRITE);
Dataflash_SendAddressBytes(0, 0);
}
-
+
/* Write one 16-byte chunk of data to the Dataflash */
for (uint8_t ByteNum = 0; ByteNum < 16; ByteNum++)
Dataflash_SendByte(*(BufferPtr++));
-
+
/* Increment the Dataflash page 16 byte block counter */
CurrDFPageByteDiv16++;
/* Increment the block 16 byte block counter */
- BytesInBlockDiv16++;
+ BytesInBlockDiv16++;
}
-
+
/* Decrement the blocks remaining counter and reset the sub block counter */
TotalBlocks--;
}
@@ -416,7 +416,7 @@ void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
while (TotalBlocks)
{
uint8_t BytesInBlockDiv16 = 0;
-
+
/* Write an endpoint packet sized data block to the Dataflash */
while (BytesInBlockDiv16 < (VIRTUAL_MEMORY_BLOCK_SIZE >> 4))
{
@@ -429,7 +429,7 @@ void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
/* Select the next Dataflash chip based on the new Dataflash page index */
Dataflash_SelectChipFromPage(CurrDFPage);
-
+
/* Send the Dataflash main memory page read command */
Dataflash_SendByte(DF_CMD_MAINMEMPAGEREAD);
Dataflash_SendAddressBytes(CurrDFPage, 0);
@@ -437,19 +437,19 @@ void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress,
Dataflash_SendByte(0x00);
Dataflash_SendByte(0x00);
Dataflash_SendByte(0x00);
- }
+ }
/* Read one 16-byte chunk of data from the Dataflash */
for (uint8_t ByteNum = 0; ByteNum < 16; ByteNum++)
*(BufferPtr++) = Dataflash_ReceiveByte();
-
+
/* Increment the Dataflash page 16 byte block counter */
CurrDFPageByteDiv16++;
-
+
/* Increment the block 16 byte block counter */
BytesInBlockDiv16++;
}
-
+
/* Decrement the blocks remaining counter */
TotalBlocks--;
}
@@ -464,7 +464,7 @@ void DataflashManager_ResetDataflashProtections(void)
/* Select first Dataflash chip, send the read status register command */
Dataflash_SelectChip(DATAFLASH_CHIP1);
Dataflash_SendByte(DF_CMD_GETSTATUS);
-
+
/* Check if sector protection is enabled */
if (Dataflash_ReceiveByte() & DF_STATUS_SECTORPROTECTION_ON)
{
@@ -476,12 +476,12 @@ void DataflashManager_ResetDataflashProtections(void)
Dataflash_SendByte(DF_CMD_SECTORPROTECTIONOFF[2]);
Dataflash_SendByte(DF_CMD_SECTORPROTECTIONOFF[3]);
}
-
+
/* Select second Dataflash chip (if present on selected board), send read status register command */
#if (DATAFLASH_TOTALCHIPS == 2)
Dataflash_SelectChip(DATAFLASH_CHIP2);
Dataflash_SendByte(DF_CMD_GETSTATUS);
-
+
/* Check if sector protection is enabled */
if (Dataflash_ReceiveByte() & DF_STATUS_SECTORPROTECTION_ON)
{
@@ -494,7 +494,7 @@ void DataflashManager_ResetDataflashProtections(void)
Dataflash_SendByte(DF_CMD_SECTORPROTECTIONOFF[3]);
}
#endif
-
+
/* Deselect current Dataflash chip */
Dataflash_DeselectChip();
}
@@ -528,6 +528,7 @@ bool DataflashManager_CheckDataflashOperation(void)
if (ReturnByte != DF_MANUFACTURER_ATMEL)
return false;
#endif
-
+
return true;
}
+
diff --git a/Projects/TempDataLogger/Lib/DataflashManager.h b/Projects/TempDataLogger/Lib/DataflashManager.h
index 70dd88d21..cd1c460cd 100644
--- a/Projects/TempDataLogger/Lib/DataflashManager.h
+++ b/Projects/TempDataLogger/Lib/DataflashManager.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 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
@@ -32,13 +32,13 @@
*
* Header file for DataflashManager.c.
*/
-
+
#ifndef _DATAFLASH_MANAGER_H_
#define _DATAFLASH_MANAGER_H_
/* Includes: */
#include <avr/io.h>
-
+
#include "TempDataLogger.h"
#include "Descriptors.h"
@@ -60,12 +60,12 @@
* storage media (Dataflash) using a different native block size. Do not change this value.
*/
#define VIRTUAL_MEMORY_BLOCK_SIZE 512
-
+
/** Total number of blocks of the virtual memory for reporting to the host as the device's total capacity. Do not
* change this value; change VIRTUAL_MEMORY_BYTES instead to alter the media size.
*/
#define VIRTUAL_MEMORY_BLOCKS (VIRTUAL_MEMORY_BYTES / VIRTUAL_MEMORY_BLOCK_SIZE)
-
+
/* Function Prototypes: */
void DataflashManager_WriteBlocks(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
const uint32_t BlockAddress,
@@ -81,5 +81,6 @@
uint8_t* BufferPtr) ATTR_NON_NULL_PTR_ARG(3);
void DataflashManager_ResetDataflashProtections(void);
bool DataflashManager_CheckDataflashOperation(void);
-
+
#endif
+
diff --git a/Projects/TempDataLogger/Lib/FATFs/00readme.txt b/Projects/TempDataLogger/Lib/FATFs/00readme.txt
index a34c951c9..97951fc3d 100644
--- a/Projects/TempDataLogger/Lib/FATFs/00readme.txt
+++ b/Projects/TempDataLogger/Lib/FATFs/00readme.txt
@@ -115,3 +115,4 @@ REVISION HISTORY
Changed some types on the API, XCHAR->TCHAR.
Changed fname member in the FILINFO structure on Unicode cfg.
String functions support UTF-8 encoding files on Unicode cfg.
+
diff --git a/Projects/TempDataLogger/Lib/FATFs/diskio.c b/Projects/TempDataLogger/Lib/FATFs/diskio.c
index 68c2aeb97..c18151284 100644
--- a/Projects/TempDataLogger/Lib/FATFs/diskio.c
+++ b/Projects/TempDataLogger/Lib/FATFs/diskio.c
@@ -97,3 +97,4 @@ DWORD get_fattime (void)
((DWORD)Minute << 5) |
(((DWORD)Second >> 1) << 0);
}
+
diff --git a/Projects/TempDataLogger/Lib/FATFs/diskio.h b/Projects/TempDataLogger/Lib/FATFs/diskio.h
index 5feb82f83..3459da351 100644
--- a/Projects/TempDataLogger/Lib/FATFs/diskio.h
+++ b/Projects/TempDataLogger/Lib/FATFs/diskio.h
@@ -69,3 +69,4 @@ DRESULT disk_ioctl (BYTE, BYTE, void*);
#define _DISKIO
#endif
+
diff --git a/Projects/TempDataLogger/Lib/FATFs/ff.c b/Projects/TempDataLogger/Lib/FATFs/ff.c
index 3da658e97..ab53ea598 100644
--- a/Projects/TempDataLogger/Lib/FATFs/ff.c
+++ b/Projects/TempDataLogger/Lib/FATFs/ff.c
@@ -2289,7 +2289,7 @@ FRESULT f_close (
#if _FS_REENTRANT
res = validate(fp->fs, fp->id);
if (res == FR_OK) {
- res = dec_lock(fp->fs, fp->lockid);
+ res = dec_lock(fp->fs, fp->lockid);
unlock_fs(fp->fs, FR_OK);
}
#else
@@ -3539,7 +3539,7 @@ int f_printf (
res++;
}
do {
- cc = f_putc(s[--i], fil);
+ cc = f_putc(s[--i], fil);
res++;
} while (i && cc != EOF);
if (cc != EOF) cc = 0;
@@ -3551,3 +3551,4 @@ int f_printf (
#endif /* !_FS_READONLY */
#endif /* _USE_STRFUNC */
+
diff --git a/Projects/TempDataLogger/Lib/FATFs/ff.h b/Projects/TempDataLogger/Lib/FATFs/ff.h
index 19b6a15b6..c5a6a0b5e 100644
--- a/Projects/TempDataLogger/Lib/FATFs/ff.h
+++ b/Projects/TempDataLogger/Lib/FATFs/ff.h
@@ -611,3 +611,4 @@ void ff_rel_grant (_SYNC_t); /* Unlock sync object */
#endif
#endif /* _FATFS */
+
diff --git a/Projects/TempDataLogger/Lib/FATFs/ffconf.h b/Projects/TempDataLogger/Lib/FATFs/ffconf.h
index a217b0bf8..48edc4aed 100644
--- a/Projects/TempDataLogger/Lib/FATFs/ffconf.h
+++ b/Projects/TempDataLogger/Lib/FATFs/ffconf.h
@@ -179,3 +179,4 @@
#endif /* _FFCONFIG */
+
diff --git a/Projects/TempDataLogger/Lib/FATFs/integer.h b/Projects/TempDataLogger/Lib/FATFs/integer.h
index 1bc381cc0..c27d79d35 100644
--- a/Projects/TempDataLogger/Lib/FATFs/integer.h
+++ b/Projects/TempDataLogger/Lib/FATFs/integer.h
@@ -37,3 +37,4 @@ typedef unsigned char BOOL;
#endif
#endif
+
diff --git a/Projects/TempDataLogger/Lib/SCSI.c b/Projects/TempDataLogger/Lib/SCSI.c
index a98731957..5e2eec5d7 100644
--- a/Projects/TempDataLogger/Lib/SCSI.c
+++ b/Projects/TempDataLogger/Lib/SCSI.c
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 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
@@ -34,29 +34,29 @@
* devices use a thin "Bulk-Only Transport" protocol for issuing commands and status information,
* which wrap around standard SCSI device commands for controlling the actual storage medium.
*/
-
+
#define INCLUDE_FROM_SCSI_C
#include "SCSI.h"
/** Structure to hold the SCSI response data to a SCSI INQUIRY command. This gives information about the device's
* features and capabilities.
*/
-SCSI_Inquiry_Response_t InquiryData =
+SCSI_Inquiry_Response_t InquiryData =
{
.DeviceType = DEVICE_TYPE_BLOCK,
.PeripheralQualifier = 0,
-
+
.Removable = true,
-
+
.Version = 0,
-
+
.ResponseDataFormat = 2,
.NormACA = false,
.TrmTsk = false,
.AERC = false,
.AdditionalLength = 0x1F,
-
+
.SoftReset = false,
.CmdQue = false,
.Linked = false,
@@ -64,7 +64,7 @@ SCSI_Inquiry_Response_t InquiryData =
.WideBus16Bit = false,
.WideBus32Bit = false,
.RelAddr = false,
-
+
.VendorID = "LUFA",
.ProductID = "Dataflash Disk",
.RevisionID = {'0','.','0','0'},
@@ -96,13 +96,13 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
switch (MSInterfaceInfo->State.CommandBlock.SCSICommandData[0])
{
case SCSI_CMD_INQUIRY:
- CommandSuccess = SCSI_Command_Inquiry(MSInterfaceInfo);
+ CommandSuccess = SCSI_Command_Inquiry(MSInterfaceInfo);
break;
case SCSI_CMD_REQUEST_SENSE:
CommandSuccess = SCSI_Command_Request_Sense(MSInterfaceInfo);
break;
case SCSI_CMD_READ_CAPACITY_10:
- CommandSuccess = SCSI_Command_Read_Capacity_10(MSInterfaceInfo);
+ CommandSuccess = SCSI_Command_Read_Capacity_10(MSInterfaceInfo);
break;
case SCSI_CMD_SEND_DIAGNOSTIC:
CommandSuccess = SCSI_Command_Send_Diagnostic(MSInterfaceInfo);
@@ -134,7 +134,7 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)
SCSI_SET_SENSE(SCSI_SENSE_KEY_GOOD,
SCSI_ASENSE_NO_ADDITIONAL_INFORMATION,
SCSI_ASENSEQ_NO_QUALIFIER);
-
+
return true;
}
@@ -165,11 +165,11 @@ static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
return false;
}
-
+
Endpoint_Write_Stream_LE(&InquiryData, BytesTransferred, NO_STREAM_CALLBACK);
uint8_t PadBytes[AllocationLength - BytesTransferred];
-
+
/* Pad out remaining bytes with 0x00 */
Endpoint_Write_Stream_LE(&PadBytes, sizeof(PadBytes), NO_STREAM_CALLBACK);
@@ -178,7 +178,7 @@ static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInf
/* Succeed the command and update the bytes transferred counter */
MSInterfaceInfo->State.CommandBlock.DataTransferLength -= BytesTransferred;
-
+
return true;
}
@@ -193,7 +193,7 @@ static bool SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* const MSInterf
{
uint8_t AllocationLength = MSInterfaceInfo->State.CommandBlock.SCSICommandData[4];
uint8_t BytesTransferred = (AllocationLength < sizeof(SenseData))? AllocationLength : sizeof(SenseData);
-
+
uint8_t PadBytes[AllocationLength - BytesTransferred];
Endpoint_Write_Stream_LE(&SenseData, BytesTransferred, NO_STREAM_CALLBACK);
@@ -221,10 +221,10 @@ static bool SCSI_Command_Read_Capacity_10(USB_ClassInfo_MS_Device_t* const MSInt
Endpoint_Write_Stream_BE(&LastBlockAddressInLUN, sizeof(LastBlockAddressInLUN), NO_STREAM_CALLBACK);
Endpoint_Write_Stream_BE(&MediaBlockSize, sizeof(MediaBlockSize), NO_STREAM_CALLBACK);
Endpoint_ClearIN();
-
+
/* Succeed the command and update the bytes transferred counter */
MSInterfaceInfo->State.CommandBlock.DataTransferLength -= 8;
-
+
return true;
}
@@ -248,21 +248,21 @@ static bool SCSI_Command_Send_Diagnostic(USB_ClassInfo_MS_Device_t* const MSInte
return false;
}
-
+
/* Check to see if all attached Dataflash ICs are functional */
if (!(DataflashManager_CheckDataflashOperation()))
{
/* Update SENSE key with a hardware error condition and return command fail */
SCSI_SET_SENSE(SCSI_SENSE_KEY_HARDWARE_ERROR,
SCSI_ASENSE_NO_ADDITIONAL_INFORMATION,
- SCSI_ASENSEQ_NO_QUALIFIER);
-
+ SCSI_ASENSEQ_NO_QUALIFIER);
+
return false;
}
-
+
/* Succeed the command and update the bytes transferred counter */
MSInterfaceInfo->State.CommandBlock.DataTransferLength = 0;
-
+
return true;
}
@@ -280,13 +280,13 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfa
{
uint32_t BlockAddress;
uint16_t TotalBlocks;
-
+
/* Load in the 32-bit block address (SCSI uses big-endian, so have to reverse the byte order) */
BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]);
/* Load in the 16-bit total blocks (SCSI uses big-endian, so have to reverse the byte order) */
TotalBlocks = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]);
-
+
/* Check if the block address is outside the maximum allowable value for the LUN */
if (BlockAddress >= VIRTUAL_MEMORY_BLOCKS)
{
@@ -297,7 +297,7 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfa
return false;
}
-
+
/* Determine if the packet is a READ (10) or WRITE (10) command, call appropriate function */
if (IsDataRead == DATA_READ)
DataflashManager_ReadBlocks(MSInterfaceInfo, BlockAddress, TotalBlocks);
@@ -306,6 +306,7 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfa
/* Update the bytes transferred counter and succeed the command */
MSInterfaceInfo->State.CommandBlock.DataTransferLength -= ((uint32_t)TotalBlocks * VIRTUAL_MEMORY_BLOCK_SIZE);
-
+
return true;
}
+
diff --git a/Projects/TempDataLogger/Lib/SCSI.h b/Projects/TempDataLogger/Lib/SCSI.h
index f3aea7222..39c9aee46 100644
--- a/Projects/TempDataLogger/Lib/SCSI.h
+++ b/Projects/TempDataLogger/Lib/SCSI.h
@@ -1,7 +1,7 @@
/*
LUFA Library
Copyright (C) Dean Camera, 2010.
-
+
dean [at] fourwalledcubicle [dot] com
www.fourwalledcubicle.com
*/
@@ -9,13 +9,13 @@
/*
Copyright 2010 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
@@ -32,7 +32,7 @@
*
* Header file for SCSI.c.
*/
-
+
#ifndef _SCSI_H_
#define _SCSI_H_
@@ -46,7 +46,7 @@
#include "../TempDataLogger.h"
#include "../Descriptors.h"
#include "DataflashManager.h"
-
+
/* Macros: */
/** Macro to set the current SCSI sense data to the given key, additional sense code and additional sense qualifier. This
* is for convenience, as it allows for all three sense values (returned upon request to the host to give information about
@@ -68,13 +68,13 @@
/** Value for the DeviceType entry in the SCSI_Inquiry_Response_t enum, indicating a Block Media device. */
#define DEVICE_TYPE_BLOCK 0x00
-
+
/** Value for the DeviceType entry in the SCSI_Inquiry_Response_t enum, indicating a CD-ROM device. */
#define DEVICE_TYPE_CDROM 0x05
-
+
/* Function Prototypes: */
bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);
-
+
#if defined(INCLUDE_FROM_SCSI_C)
static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);
static bool SCSI_Command_Request_Sense(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);
@@ -83,5 +83,6 @@
static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo,
const bool IsDataRead);
#endif
-
+
#endif
+