Skip to content

Commit

Permalink
Make the new fs.getFree/mkfs dependent on build flags (not enough spa…
Browse files Browse the repository at this point in the history
…ce in most normal Espruino builds)
  • Loading branch information
gfwilliams committed Jan 30, 2025
1 parent 60b1f4b commit 7c3a5d6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README_BuildProcess.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ This is a partial list of definitions that can be added in a `BOARD.py` file's `
* `ESPR_TERMNINAL_NO_SCROLL` - disable scrolling in the onscreen terminal (once we get to the end, we just clear the screen and start at the top)
* `ESPR_HAS_BOOTLOADER_UF2` - nRF5x: Allow entering UF2 bootloader mode by calling E.rebootToDFU()
* `ESPR_BLE_PRIVATE_ADDRESS_SUPPORT` - NRF52: Enable support for using a random private BLE address, that automatically changes at a set interval. See the `privacy` option that can be passed to `NRF.setSecurity()`.
* `ESPR_FS_MKFS` - Add support for require("fs").mkfs for formatting disks
* `ESPR_FS_GETFREE` - Add support for require("fs").getFree in the filesystem library


There are some specifically that are useful for cutting a few bytes out of the build:
Expand Down
1 change: 1 addition & 0 deletions boards/PIPBOY.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
'DEFINES+=-DUSE_FONT_6X8 -DGRAPHICS_PALETTED_IMAGES -DGRAPHICS_ANTIALIAS -DESPR_PBF_FONTS -DESPR_GRAPHICS_INTERNAL -DESPR_GRAPHICS_SELF_INIT -DESPR_GRAPHICS_NO_SPLASH -DGRAPHICS_FAST_PATHS',
'DEFINES+=-DESPR_SDIO_FAST_UNALIGNED', # see sdio_diskio.c - this is a nasty hack to increase unaligned read speed
'DEFINES+=-DLCD_ORIENTATION_LANDSCAPE',
'DEFINES+=-DESPR_FS_MKFS -DESPR_FS_GETFREE',
'DEFINES+=-DUSE_AUDIO_CODEC',
'DEFINES+=-DESPR_DELAY_MULTIPLIER=28672', # don't work out what to use for jshDelayMicroseconds at boot, just hard-code it
'DEFINES+=-DESPR_RTC_INITIALISE_TICKS=30', # 168Mhz so we need to wait more ticks for the RTC to init (21->2s doesn't seem to be enough - this is nearer 3s!)
Expand Down
4 changes: 2 additions & 2 deletions libs/filesystem/jswrap_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ JsVar *jswrap_fs_stat(JsVar *path) {
"type" : "staticmethod",
"class" : "fs",
"name" : "getFree",
"ifndef" : "SAVE_ON_FLASH",
"ifdef" : "ESPR_FS_GETFREE",
"generate" : "jswrap_fs_getfree",
"params" : [
["path","JsVar","The path specifying the logical drive"]
Expand Down Expand Up @@ -492,7 +492,7 @@ bool jswrap_fs_mkdir(JsVar *path) {
"type" : "staticmethod",
"class" : "fs",
"name" : "mkfs",
"ifndef" : "SAVE_ON_FLASH",
"ifdef" : "ESPR_FS_MKFS",
"generate" : "jswrap_fs_mkfs",
"return" : ["bool","True on success, or false on failure"]
}
Expand Down

0 comments on commit 7c3a5d6

Please sign in to comment.