lvgl / lv_lib_qrcode Goto Github PK
View Code? Open in Web Editor NEWQR code generation with LVGL
License: MIT License
QR code generation with LVGL
License: MIT License
In lv_qrcode.c, function lv_qrcode_create
calls LV_IMG_BUF_SIZE_INDEXED_1BIT
and LV_ASSERT_MEM
,however, I could not find the declarations or definitions in master lvgl respo.
lv_obj_t * lv_qrcode_create(lv_obj_t * parent, lv_coord_t size, lv_color_t dark_color, lv_color_t light_color)
{
uint32_t buf_size = LV_IMG_BUF_SIZE_INDEXED_1BIT(size, size);
uint8_t * buf = lv_mem_alloc(buf_size);
LV_ASSERT_MEM(buf);
So, I replace them with LV_CANVAS_BUF_SIZE_INDEXED_1BIT
and lv_mem_assert
, is that right?
lv_obj_t * lv_qrcode_create(lv_obj_t * parent, lv_coord_t size, lv_color_t dark_color, lv_color_t light_color)
{
uint32_t buf_size = LV_CANVAS_BUF_SIZE_INDEXED_1BIT(size, size);
uint8_t * buf = lv_mem_alloc(buf_size);
lv_mem_assert(buf);
I'm unable to build my firmware when adding the QR Code Lib, using the example code provided.
I get the following error:
src/lv_lib_qrcode/lv_qrcode.c:52:4: error: implicit declaration of function 'lv_mem_assert' [-Werror=implicit-function-declaration]
lv_mem_assert(buf);
^
I'm using lvl 6.1.2, and embedding the code within mongoose-os.
This bug report refers to the lack of a user defined colour pad, the empty area around a QR code.
Machine reading improves when codes have a large padded area around them, in the same colour as the very thin margin as defined in existing sources.
int margin = (obj_w - scaled) / 2;
To introduce a user defined padded area, a parameter could be added wherever graphic size is referenced (in buffers, allocation, and construction.)
I've solved this problem and will submit a pull request called Colourpad Addition 1A.
Hello,
I am trying to test the library as suggested by the example, but it only shows "NO DATA" in my display. My hardware is a 128x64 dot monochrome, and its working fine with others objects (images and labels). Are the instructions "lv_qrcode_create" and "lv_qrcode_update" all that is needed to display the QR Code?
I experimented with this library on an ESP32. I think it has 8K bytes of stack.
lv_qrcode_update
starts by allocating two arrays (qr0
and data_tmp
), each about 4K bytes, and this causes a stack overflow on the ESP32. (It did work on my Windows simultator, so I had a clue..)
data_tmp
holds a copy of the data to convert into a QRcode. This is typically a URL, and they are never 4K long.
So I changed it to 128 bytes, then it worked fine on the ESP32
In fact, I think, it is not needed to make a local copy of the to-be-encoded data.
If you decide to fix this, maybe it is worthwhile adding this to the widgets. It took me quite a while to add it there and get everything properly compiling.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.