house keeping

This commit is contained in:
hathach
2018-07-26 22:44:11 +07:00
parent 72b600c393
commit f5cbc0f4af
2 changed files with 10 additions and 5 deletions

View File

@@ -88,9 +88,9 @@ uint8_t msc_device_ramdisk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] =
[3] = README_CONTENTS
};
//--------------------------------------------------------------------+
// IMPLEMENTATION
//--------------------------------------------------------------------+
// Callback invoked when received READ10 command.
// Copy disk's data to buffer (up to bufsize) and return number of copied bytes.
int32_t tud_msc_read10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void* buffer, uint32_t bufsize)
{
uint8_t* addr = msc_device_ramdisk[lba] + offset;
@@ -99,6 +99,8 @@ int32_t tud_msc_read10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void* buff
return bufsize;
}
// Callback invoked when received WRITE10 command.
// Process data in buffer to disk's storage and return number of written bytes
int32_t tud_msc_write10_cb(uint8_t lun, uint32_t lba, uint32_t offset, void* buffer, uint32_t bufsize)
{
uint8_t* addr = msc_device_ramdisk[lba] + offset;