diff --git a/.gitignore b/.gitignore index dd07a9ba9..ad64baa0d 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,6 @@ /boards.local.txt /platform.local.txt +# Locally-installed arduino-cli (for building) +/bin/ + diff --git a/cores/nRF5/main.cpp b/cores/nRF5/main.cpp index 7e3e95f82..cde71cff8 100644 --- a/cores/nRF5/main.cpp +++ b/cores/nRF5/main.cpp @@ -39,7 +39,12 @@ void Bluefruit_printInfo() {} void initVariant() __attribute__((weak)); void initVariant() { } +// Allow the loop_task stack size to be overridden from the build (e.g. +// -DLOOP_STACK_SZ=2048 in platformio.ini). The default 1024 words (4KB) is too +// small for some sketches (e.g. deep LittleFS file-open call chains run from loop()). +#ifndef LOOP_STACK_SZ #define LOOP_STACK_SZ (256*4) +#endif #define CALLBACK_STACK_SZ (256*3) static TaskHandle_t _loopHandle; diff --git a/libraries/Adafruit_LittleFS/src/littlefs/lfs.c b/libraries/Adafruit_LittleFS/src/littlefs/lfs.c index f9d9ce344..aa1abeda8 100644 --- a/libraries/Adafruit_LittleFS/src/littlefs/lfs.c +++ b/libraries/Adafruit_LittleFS/src/littlefs/lfs.c @@ -1963,9 +1963,9 @@ int lfs_rename(lfs_t *lfs, const char *oldpath, const char *newpath) { err = lfs_dir_fetch(lfs, &dir, preventry.d.u.dir); if (err) { return err; - } else if (dir.d.size != sizeof(dir.d)+4) { + } else if (dir.d.size != sizeof(dir.d)+4) { return LFS_ERR_NOTEMPTY; - } + } } // move to new location @@ -1989,10 +1989,10 @@ int lfs_rename(lfs_t *lfs, const char *oldpath, const char *newpath) { // fetch old pair again in case dir block changed lfs->moving = true; err = lfs_dir_find(lfs, &oldcwd, &oldentry, &oldpath); + lfs->moving = false; if (err) { return err; } - lfs->moving = false; // remove old entry err = lfs_dir_remove(lfs, &oldcwd, &oldentry); diff --git a/libraries/Adafruit_LittleFS/src/littlefs/lfs_util.h b/libraries/Adafruit_LittleFS/src/littlefs/lfs_util.h index 14e265305..b2dc23714 100644 --- a/libraries/Adafruit_LittleFS/src/littlefs/lfs_util.h +++ b/libraries/Adafruit_LittleFS/src/littlefs/lfs_util.h @@ -30,13 +30,6 @@ #ifndef LFS_NO_ASSERT #include #endif - -#if !CFG_DEBUG -#define LFS_NO_DEBUG -#define LFS_NO_WARN -#define LFS_NO_ERROR -#endif - #if !defined(LFS_NO_DEBUG) || !defined(LFS_NO_WARN) || !defined(LFS_NO_ERROR) #include #endif @@ -168,8 +161,7 @@ void lfs_crc(uint32_t *crc, const void *buffer, size_t size); // Allocate memory, only used if buffers are not provided to littlefs static inline void *lfs_malloc(size_t size) { #ifndef LFS_NO_MALLOC - extern void *pvPortMalloc( size_t xWantedSize ); - return pvPortMalloc(size); + return malloc(size); #else (void)size; return NULL; @@ -179,8 +171,7 @@ static inline void *lfs_malloc(size_t size) { // Deallocate memory, only used if buffers are not provided to littlefs static inline void lfs_free(void *p) { #ifndef LFS_NO_MALLOC - extern void vPortFree( void *pv ); - vPortFree(p); + free(p); #else (void)p; #endif diff --git a/package.json b/package.json index 11849d75d..da6c7a313 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,10 @@ { - "description": "Adafruit Arduino Framework for NRF52", "name": "framework-arduinoadafruitnrf52", - "url": "https://github.com/meshcore-dev/Adafruit_nRF52_Arduino", "version": "1.10701.0", + "description": "Arduino framework for Adafruit nRF52 boards (MeshCore fork with LittleFS v1.7.2 and Bluefruit fixes)", + "url": "https://github.com/weebl2000/Adafruit_nRF52_Arduino", "repository": { "type": "git", - "url": "https://github.com/meshcore-dev/Adafruit_nRF52_Arduino" + "url": "https://github.com/weebl2000/Adafruit_nRF52_Arduino" } - }