From 10af7a87890144e33f39752ba14c1ea3bee563f5 Mon Sep 17 00:00:00 2001 From: Estevam Souza Date: Sat, 1 Jun 2024 18:40:33 -0300 Subject: [PATCH] =?UTF-8?q?:boom:=20melhorando=20o=20c=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/arduino.json | 3 +++ fix_link.py | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .vscode/arduino.json diff --git a/.vscode/arduino.json b/.vscode/arduino.json new file mode 100644 index 0000000..de5ed52 --- /dev/null +++ b/.vscode/arduino.json @@ -0,0 +1,3 @@ +{ + "port": "COM6" +} \ No newline at end of file diff --git a/fix_link.py b/fix_link.py index 72505ee..b0fb52f 100644 --- a/fix_link.py +++ b/fix_link.py @@ -12,7 +12,11 @@ } """ FRAMEWORK_DIR = env.PioPlatform().get_package_dir("framework-arduino-mbed") -target_file = join(FRAMEWORK_DIR, "libraries", "rpclib" , "library.json") + +if FRAMEWORK_DIR is None: + raise ValueError("O pacote 'framework-arduino-mbed' não foi encontrado. Certifique-se de que ele está instalado corretamente.") + +target_file = join(FRAMEWORK_DIR, "libraries", "rpclib", "library.json") if not isfile(target_file): # put it in there with open(target_file, "w") as fp: @@ -20,7 +24,7 @@ print("[+] Saved library.json for RPCLib fix.") # Fix linking by declaring start and end properly -for e in env, DefaultEnvironment(): +for e in (env, DefaultEnvironment()): # This env-variables are set for 50_50 flash-layout # defines = [("CM4_BINARY_START", "0x08100000"), ("CM4_BINARY_END", "0x08200000")] # This env-variables are set for 75_25 flash-layout @@ -30,4 +34,4 @@ e.Append( LINKFLAGS=["-D%s=%s" % (name, value) for name, value in defines], CPPDEFINES=defines - ) \ No newline at end of file + )