diff --git a/.github/workflows/buil_parallel.yml b/.github/workflows/buil_parallel.yml index 9e0b617c..c9c3bb98 100644 --- a/.github/workflows/buil_parallel.yml +++ b/.github/workflows/buil_parallel.yml @@ -99,43 +99,43 @@ sed -i "s/-DGIT_COMMIT_HASH='\"Homebrew\"'/\!echo '-DGIT_COMMIT_HASH=\\\\\\\\\"'\$\(git describe --always --dirty)'\\\\\\\\\"'/g" ./platformio.ini - name: Setup PlatformIO for Deauth run: | - pio pkg install -p espressif32 -t toolchain-xtensa32 + # pio pkg install -p espressif32 -t toolchain-xtensa32 - esp32_file="$HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libnet80211.a" - esp32s3_file="$HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/lib/libnet80211.a" + # esp32_file="$HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libnet80211.a" + # esp32s3_file="$HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/lib/libnet80211.a" - esp32_file_temp="$HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libnet80211_temp.a" - esp32s3_file_temp="$HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/lib/libnet80211_temp.a" + # esp32_file_temp="$HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/lib/libnet80211_temp.a" + # esp32s3_file_temp="$HOME/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32s3/lib/libnet80211_temp.a" # Definir caminhos para as ferramentas objcopy - toolchain_esp32="$HOME/.platformio/packages/toolchain-xtensa-esp32/xtensa-esp32-elf/bin/objcopy" - toolchain_esp32s3="$HOME/.platformio/packages/toolchain-xtensa-esp32s3/xtensa-esp32s3-elf/bin/objcopy" + # toolchain_esp32="$HOME/.platformio/packages/toolchain-xtensa-esp32/xtensa-esp32-elf/bin/objcopy" + # toolchain_esp32s3="$HOME/.platformio/packages/toolchain-xtensa-esp32s3/xtensa-esp32s3-elf/bin/objcopy" # Verificar se os arquivos existem antes de executar os comandos - if [[ -f "$esp32_file" && -f "$esp32s3_file" ]]; then - # Execute objcopy commands for ESP32 - $toolchain_esp32 --weaken-symbol=ieee80211_raw_frame_sanity_check "$esp32_file" "$esp32_file_temp" + # if [[ -f "$esp32_file" && -f "$esp32s3_file" ]]; then + # # Execute objcopy commands for ESP32 + # $toolchain_esp32 --weaken-symbol=ieee80211_raw_frame_sanity_check "$esp32_file" "$esp32_file_temp" - # Rename the original file to .old - mv "$esp32_file" "${esp32_file}.old" + # # Rename the original file to .old + # mv "$esp32_file" "${esp32_file}.old" - # Rename the _temp to original - mv "$esp32_file_temp" "$esp32_file" + # # Rename the _temp to original + # mv "$esp32_file_temp" "$esp32_file" - # Execute objcopy commands for ESP32-S3 - $toolchain_esp32s3 --weaken-symbol=ieee80211_raw_frame_sanity_check "$esp32s3_file" "$esp32s3_file_temp" + # # Execute objcopy commands for ESP32-S3 + # $toolchain_esp32s3 --weaken-symbol=ieee80211_raw_frame_sanity_check "$esp32s3_file" "$esp32s3_file_temp" - # Rename the original file to .old - mv "$esp32s3_file" "${esp32s3_file}.old" + # # Rename the original file to .old + # mv "$esp32s3_file" "${esp32s3_file}.old" - # Rename the _temp to original - mv "$esp32s3_file_temp" "$esp32s3_file" + # # Rename the _temp to original + # mv "$esp32s3_file_temp" "$esp32s3_file" - echo "Done." - else - echo "One or more specified files were not found." - exit 1 - fi + # echo "Done." + # else + # echo "One or more specified files were not found." + # exit 1 + # fi - name: Run Compile diff --git a/platformio.ini b/platformio.ini index 5375fc5d..7148c07e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -68,7 +68,7 @@ lib_deps = ;https://github.com/eadmaster/rtl_433_ESP [env:m5stack-cplus2] -platform = espressif32 +platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.4/platform-espressif32.zip board = m5stick-c framework = arduino board_build.partitions = custom_8Mb.csv @@ -187,7 +187,7 @@ lib_deps = ${common.lib_deps} [env:m5stack-cplus1_1] -platform = espressif32 +platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.4/platform-espressif32.zip board = m5stick-c framework = arduino board_build.partitions = custom_4Mb.csv @@ -299,7 +299,7 @@ lib_deps = [env:m5stack-cardputer] -platform = espressif32 +platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.4/platform-espressif32.zip board = m5stack-stamps3 framework = arduino board_build.partitions = custom_8Mb.csv @@ -418,7 +418,7 @@ lib_deps = xylopyrographer/LiteLED@^1.2.0 [env:m5stack-core2] -platform = espressif32 +platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.4/platform-espressif32.zip board = m5stick-c framework = arduino monitor_speed = 115200 @@ -541,7 +541,7 @@ lib_deps = ${common.lib_deps} [env:m5stack-core16mb] -platform = espressif32 +platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.4/platform-espressif32.zip board = m5stack-core-esp32 framework = arduino monitor_speed = 115200 @@ -664,7 +664,7 @@ lib_deps = ${common.lib_deps} [env:m5stack-core4mb] -platform = espressif32 +platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.4/platform-espressif32.zip board = m5stack-core-esp32 framework = arduino monitor_speed = 115200 @@ -784,7 +784,7 @@ lib_deps = [env:esp32-s3-devkitc-1] -platform = espressif32 +platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.4/platform-espressif32.zip board = esp32-s3-devkitc-1 framework = arduino ;board_build.partitions = custom_16Mb.csv @@ -884,7 +884,7 @@ lib_deps = ${common.lib_deps} [env:m5stack-cores3] -platform = espressif32 +platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.4/platform-espressif32.zip board = m5stack-cores3 framework = arduino monitor_speed = 115200 @@ -1010,7 +1010,7 @@ lib_deps = #New device model [env:NewDeviceModel] -platform = espressif32 +platform = https://github.com/bmorcelli/platform-espressif32/releases/download/0.0.4/platform-espressif32.zip board = m5stack-stamps3 framework = arduino board_build.partitions = custom_8Mb.csv diff --git a/src/core/globals.h b/src/core/globals.h index e0ef4c76..9b68ab81 100644 --- a/src/core/globals.h +++ b/src/core/globals.h @@ -102,7 +102,7 @@ extern String fileToCopy; extern int rotation; -extern uint8_t buff[4096]; +extern uint8_t buff[1024]; extern const int bufSize; diff --git a/src/core/sd_functions.cpp b/src/core/sd_functions.cpp index 73b27c90..f3461e46 100644 --- a/src/core/sd_functions.cpp +++ b/src/core/sd_functions.cpp @@ -137,9 +137,7 @@ bool renameFile(FS fs, String path, String filename) { ** Description: copy file from SD or LittleFS to LittleFS or SD ***************************************************************************************/ bool copyToFs(FS from, FS to, String path) { - // Tamanho do buffer para leitura/escrita - const size_t bufferSize = 1024; // Ajuste conforme necessário para otimizar a performance - uint8_t buffer[bufferSize]; + // Using Global Buffer bool result; if (!SD.begin()) { result = false; Serial.println("Error 1"); } @@ -168,8 +166,8 @@ bool copyToFs(FS from, FS to, String path) { return false; } //tft.drawRect(5,HEIGHT-12, (WIDTH-10), 9, FGCOLOR); - while ((bytesRead = source.read(buffer, bufferSize)) > 0) { - if (dest.write(buffer, bytesRead) != bytesRead) { + while ((bytesRead = source.read(buff, bufSize)) > 0) { + if (dest.write(buff, bytesRead) != bytesRead) { //Serial.println("Falha ao escrever no arquivo de destino"); source.close(); dest.close(); @@ -212,9 +210,7 @@ bool copyFile(FS fs, String path) { ** Description: paste file to new folder ***************************************************************************************/ bool pasteFile(FS fs, String path) { - // Tamanho do buffer para leitura/escrita - const size_t bufferSize = 1024; // Ajuste conforme necessário para otimizar a performance - uint8_t buffer[bufferSize]; + //Using Global Buffer // Abrir o arquivo original File sourceFile = fs.open(fileToCopy, FILE_READ); @@ -236,8 +232,8 @@ bool pasteFile(FS fs, String path) { int tot=sourceFile.size(); int prog=0; //tft.drawRect(5,HEIGHT-12, (WIDTH-10), 9, FGCOLOR); - while ((bytesRead = sourceFile.read(buffer, bufferSize)) > 0) { - if (destFile.write(buffer, bytesRead) != bytesRead) { + while ((bytesRead = sourceFile.read(buff, bufSize)) > 0) { + if (destFile.write(buff, bytesRead) != bytesRead) { //Serial.println("Falha ao escrever no arquivo de destino"); sourceFile.close(); destFile.close(); @@ -359,18 +355,18 @@ String readDecryptedAesFile(FS &fs, String filepath) { return ""; } - char buffer[fileSize]; - size_t bytesRead = file.readBytes(buffer, fileSize); + char buff[fileSize]; + size_t bytesRead = file.readBytes(buff, fileSize); //Serial.print("fileSize:"); //Serial.println(fileSize); //Serial.println(bytesRead); /* // read the whole file with a single call - char buffer[fileSize + 1]; - size_t bytesRead = file.readBytes(buffer, fileSize); - buffer[bytesRead] = '\0'; // Null-terminate the string - return String(buffer); + char buff[fileSize + 1]; + size_t bytesRead = file.readBytes(buff, fileSize); + buff[bytesRead] = '\0'; // Null-terminate the string + return String(buff); */ if (bytesRead==0) { @@ -385,7 +381,7 @@ String readDecryptedAesFile(FS &fs, String filepath) { } // else try to decrypt - String plaintext = aes_decrypt((uint8_t*)buffer, bytesRead, cachedPassword); + String plaintext = aes_decrypt((uint8_t*)buff, bytesRead, cachedPassword); // check if really plaintext if(!is_valid_ascii(plaintext)) { diff --git a/src/main.cpp b/src/main.cpp index a40549b9..838d7fdb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -57,8 +57,8 @@ String wui_pwd="bruce"; String ssid; String pwd; std::vector