mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 10:06:07 +01:00
autosize QR code
This commit is contained in:
@@ -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 =
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user