From 5a4def747897c1c6ffbe465506d846c7c686d3e9 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 13 Oct 2010 14:05:35 +0000 Subject: Clean up excessive whitespace at the end of each line using the wspurify tool made by Laszlo Monda --- .../MassStorageKeyboard/Lib/DataflashManager.c | 81 +++++++++++----------- 1 file changed, 41 insertions(+), 40 deletions(-) (limited to 'Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.c') diff --git a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.c b/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.c index ce2ac8151..2c63f6098 100644 --- a/Demos/Device/ClassDriver/MassStorageKeyboard/Lib/DataflashManager.c +++ b/Demos/Device/ClassDriver/MassStorageKeyboard/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; } + -- cgit v1.2.3