diff --git a/ESP32_AP-Flasher/platformio.ini b/ESP32_AP-Flasher/platformio.ini index 74b9fd9f..f9866c72 100644 --- a/ESP32_AP-Flasher/platformio.ini +++ b/ESP32_AP-Flasher/platformio.ini @@ -18,7 +18,7 @@ lib_deps = https://github.com/Bodmer/TJpg_Decoder.git https://github.com/garretlab/shoddyxml2 https://github.com/Bodmer/U8g2_for_TFT_eSPI - https://github.com/ricmoo/qrcode + https://github.com/nlimper/QRCodeGenerator fastled/FastLED https://github.com/MajenkoLibraries/SoftSPI platform_packages = diff --git a/ESP32_AP-Flasher/src/contentmanager.cpp b/ESP32_AP-Flasher/src/contentmanager.cpp index d7505fae..1df6a673 100644 --- a/ESP32_AP-Flasher/src/contentmanager.cpp +++ b/ESP32_AP-Flasher/src/contentmanager.cpp @@ -24,7 +24,7 @@ #include "newproto.h" #include "storage.h" #ifdef CONTENT_QR -#include "qrcode.h" +#include "QRCodeGenerator.h" #endif #include "language.h" #include "settings.h" @@ -1062,9 +1062,10 @@ void drawQR(String &filename, String qrcontent, String title, tagRecord *&taginf const char *text = qrcontent.c_str(); QRCode qrcode; - uint8_t qrcodeData[qrcode_getBufferSize(2)]; + uint8_t version = findFittingVersion_text(ECC_MEDIUM, text); + uint8_t qrcodeData[qrcode_getBufferSize(version)]; // https://github.com/ricmoo/QRCode - qrcode_initText(&qrcode, qrcodeData, 2, ECC_MEDIUM, text); + qrcode_initText(&qrcode, qrcodeData, version, ECC_MEDIUM, text); StaticJsonDocument<512> loc; getTemplate(loc, 10, taginfo->hwType);