Skip to content

Commit

Permalink
switch out filesystem build script on the fly if littlefs
Browse files Browse the repository at this point in the history
  • Loading branch information
idolpx committed Jul 6, 2023
1 parent 4a9d787 commit 6117b38
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
import subprocess
import sys

Import("env")

# Don't do anything if this is an 'uploadfs' or 'erase' target
if sys.argv[9] == 'buildfs' or sys.argv[9] == 'uploadfs' or sys.argv[9] == 'erase':
cmdline = ','.join(sys.argv)
if cmdline.find('buildfs') or cmdline.find('uploadfs'):
# Change build tool if we are using LittleFS
if any("FLASH_LITTLEFS" in x for x in env['BUILD_FLAGS']):
print("\033[1;31mReplaceing MKSPIFFSTOOL with mklittlefs\033[1;37m")
print("\033[1;31mReplacing MKSPIFFSTOOL with mklittlefs\033[1;37m")
env.Replace (MKSPIFFSTOOL = "mklittlefs")

# Disable automatic versioning
Expand Down

0 comments on commit 6117b38

Please sign in to comment.