Skip to content

Commit

Permalink
Fix file creation on SD and SDFS
Browse files Browse the repository at this point in the history
The O_CREAT/etc. flags on the Pico are a full 32-bits in size, but the
core was generating a flag for SdFat using an 8-bit type, so all the
O_CREAT, O_TRUNC, O_APPEND, etc. flags got cut off.

Fix the flag size.

Fixes #214
  • Loading branch information
earlephilhower committed Jun 19, 2021
1 parent 2747681 commit ead5142
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/SDFS/src/SDFS.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ class SDFSImpl : public FSImpl
}


static uint8_t _getFlags(OpenMode openMode, AccessMode accessMode) {
uint8_t mode = 0;
static int _getFlags(OpenMode openMode, AccessMode accessMode) {
int mode = 0;
if (openMode & OM_CREATE) {
mode |= O_CREAT;
}
Expand Down

0 comments on commit ead5142

Please sign in to comment.