Skip to content

Commit 148ef20

Browse files
committed
Rename partition
1 parent c530dbd commit 148ef20

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

lib/storage/storage.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static USBMSC MSC;
2121

2222
static constexpr std::uint16_t blockSize = 512; // Should be 512
2323

24-
static const esp_partition_t *fatPartition = nullptr;
24+
static const esp_partition_t *partition = nullptr;
2525

2626
// Callback invoked when received WRITE10 command.
2727
// Process data in buffer to disk's storage and
@@ -31,8 +31,8 @@ static int32_t onWrite(uint32_t lba, uint32_t offset, uint8_t *buffer, uint32_t
3131
HWSerial.printf("MSC WRITE: lba: %u, offset: %u, bufsize: %u\n", lba, offset, bufsize);
3232
uint32_t byteOffset = lba * blockSize + offset;
3333
// erase must be called before write
34-
ESP_ERROR_CHECK(esp_partition_erase_range(fatPartition, byteOffset, bufsize));
35-
ESP_ERROR_CHECK(esp_partition_write(fatPartition, byteOffset, buffer, bufsize));
34+
ESP_ERROR_CHECK(esp_partition_erase_range(partition, byteOffset, bufsize));
35+
ESP_ERROR_CHECK(esp_partition_write(partition, byteOffset, buffer, bufsize));
3636
return bufsize;
3737
}
3838

@@ -43,7 +43,7 @@ static int32_t onRead(uint32_t lba, uint32_t offset, void *buffer, uint32_t bufs
4343
{
4444
HWSerial.printf("MSC READ: lba: %u, offset: %u, bufsize: %u\n", lba, offset, bufsize);
4545
uint32_t byteOffset = lba * blockSize + offset;
46-
ESP_ERROR_CHECK(esp_partition_read(fatPartition, byteOffset, buffer, bufsize));
46+
ESP_ERROR_CHECK(esp_partition_read(partition, byteOffset, buffer, bufsize));
4747
return bufsize;
4848
}
4949

@@ -134,8 +134,8 @@ void Storage::begin()
134134
}
135135
HWSerial.println("FatFS erfolgreich gemountet.");
136136

137-
fatPartition = check_ffat_partition(FFAT_PARTITION_LABEL);
138-
if (!fatPartition)
137+
partition = check_ffat_partition(FFAT_PARTITION_LABEL);
138+
if (!partition)
139139
{
140140
printf("Error with FAT partition");
141141
return;

0 commit comments

Comments
 (0)