Skip to content

Commit 2c9826a

Browse files
committed
Fix start cluster calculation.
Fixes 133.
1 parent 09697eb commit 2c9826a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/usb/uf2/ghostfat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,11 @@ void read_block(uint32_t block_no, uint8_t *data) {
300300
d->createTime = __DOSTIME__;
301301
d->createDate = __DOSDATE__;
302302
d->lastAccessDate = __DOSDATE__;
303-
d->highStartCluster = startCluster >> 8; // BUGBUG -- shouldn't this be 16?
303+
d->highStartCluster = startCluster >> 16;
304304
// DIR_WrtTime and DIR_WrtDate must be supported
305305
d->updateTime = __DOSTIME__;
306306
d->updateDate = __DOSDATE__;
307-
d->startCluster = startCluster & 0xFF; // BUGBUG -- shouldn't this be 0xFFFF?
307+
d->startCluster = startCluster & 0xFFFF;
308308
d->size = (inf->content ? strlen(inf->content) : UF2_SIZE);
309309
}
310310

0 commit comments

Comments
 (0)