aboutsummaryrefslogtreecommitdiff
path: root/Demos/Device/MassStorage/Lib/DataflashManager.c
diff options
context:
space:
mode:
authorDean Camera <[email protected]>2009-06-01 11:03:39 +0000
committerDean Camera <[email protected]>2009-06-01 11:03:39 +0000
commitd1e52660368d34d693131f6aff3c8fd8584162e5 (patch)
tree333916f85f9fd38a80b0785478aa596f11f166b6 /Demos/Device/MassStorage/Lib/DataflashManager.c
parent2440ca268ac444c1aed2441cefe9e25a767d961a (diff)
downloadqmk_firmware-d1e52660368d34d693131f6aff3c8fd8584162e5.tar.gz
qmk_firmware-d1e52660368d34d693131f6aff3c8fd8584162e5.zip
Commit of new class abstraction APIs for all device demos other than the MIDI demo - not documented yet.
Removed scheduler and memory allocation libraries. Added new EVENT_USB_StartOfFrame event in the library to indicate the start of each USB frame (when generated). Removed Tx interrupt from the USBtoSerial demo; now sends characters via polling to ensure more time for the Rx interrupt.
Diffstat (limited to 'Demos/Device/MassStorage/Lib/DataflashManager.c')
-rw-r--r--Demos/Device/MassStorage/Lib/DataflashManager.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/Demos/Device/MassStorage/Lib/DataflashManager.c b/Demos/Device/MassStorage/Lib/DataflashManager.c
index 4b624190f9..87edef12b4 100644
--- a/Demos/Device/MassStorage/Lib/DataflashManager.c
+++ b/Demos/Device/MassStorage/Lib/DataflashManager.c
@@ -46,7 +46,7 @@
* \param BlockAddress Data block starting address for the write sequence
* \param TotalBlocks Number of blocks of data to write
*/
-void DataflashManager_WriteBlocks(const uint32_t BlockAddress, uint16_t TotalBlocks)
+void DataflashManager_WriteBlocks(USB_ClassInfo_MS_t* MSInterfaceInfo, const uint32_t BlockAddress, uint16_t TotalBlocks)
{
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
@@ -142,7 +142,7 @@ void DataflashManager_WriteBlocks(const uint32_t BlockAddress, uint16_t TotalBlo
BytesInBlockDiv16++;
/* Check if the current command is being aborted by the host */
- if (IsMassStoreReset)
+ if (MSInterfaceInfo->IsMassStoreReset)
return;
}
@@ -171,7 +171,7 @@ void DataflashManager_WriteBlocks(const uint32_t BlockAddress, uint16_t TotalBlo
* \param BlockAddress Data block starting address for the read sequence
* \param TotalBlocks Number of blocks of data to read
*/
-void DataflashManager_ReadBlocks(const uint32_t BlockAddress, uint16_t TotalBlocks)
+void DataflashManager_ReadBlocks(USB_ClassInfo_MS_t* MSInterfaceInfo, const uint32_t BlockAddress, uint16_t TotalBlocks)
{
uint16_t CurrDFPage = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) / DATAFLASH_PAGE_SIZE);
uint16_t CurrDFPageByte = ((BlockAddress * VIRTUAL_MEMORY_BLOCK_SIZE) % DATAFLASH_PAGE_SIZE);
@@ -250,7 +250,7 @@ void DataflashManager_ReadBlocks(const uint32_t BlockAddress, uint16_t TotalBloc
BytesInBlockDiv16++;
/* Check if the current command is being aborted by the host */
- if (IsMassStoreReset)
+ if (MSInterfaceInfo->IsMassStoreReset)
return;
}
@@ -341,11 +341,7 @@ void DataflashManager_WriteBlocks_RAM(const uint32_t BlockAddress, uint16_t Tota
CurrDFPageByteDiv16++;
/* Increment the block 16 byte block counter */
- BytesInBlockDiv16++;
-
- /* Check if the current command is being aborted by the host */
- if (IsMassStoreReset)
- return;
+ BytesInBlockDiv16++;
}
/* Decrement the blocks remaining counter and reset the sub block counter */
@@ -421,10 +417,6 @@ void DataflashManager_ReadBlocks_RAM(const uint32_t BlockAddress, uint16_t Total
/* Increment the block 16 byte block counter */
BytesInBlockDiv16++;
-
- /* Check if the current command is being aborted by the host */
- if (IsMassStoreReset)
- return;
}
/* Decrement the blocks remaining counter */