Skip to content

Commit db09b41

Browse files
committed
added more error checks
1 parent bf336e0 commit db09b41

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/storage/storage.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ void Storage::begin()
158158
MSC.mediaPresent(true);
159159

160160
// Set disk size, block size should be 512 regardless of spi flash page size
161-
MSC.begin(FFat.totalBytes() / blockSize, blockSize);
162-
USB.begin();
161+
if (!MSC.begin(FFat.totalBytes() / blockSize, blockSize))
162+
{
163+
ESP_LOGE(TAG, "starting USB MSC failed");
164+
}
165+
if (!USB.begin())
166+
{
167+
ESP_LOGE(TAG, "starting USB failed");
168+
}
163169
}

0 commit comments

Comments
 (0)