File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,15 @@ static mp_obj_t qrdecode(mp_uint_t n_args, const mp_obj_t *args) {
5656 //QRDECODE_DEBUG_PRINT("qrdecode: Resized quirc object\n");
5757
5858 uint8_t * image = quirc_begin (qr , NULL , NULL );
59- //memcpy(image, bufinfo.buf, width * height);
60- uint8_t * temp_image = image ;
61- //image = bufinfo.buf; // use existing buffer, rather than memcpy - but this doesnt find any images anymore :-/
62- qr -> image = bufinfo .buf ; // if this works then we can also eliminate quirc's ps_alloc()
59+ memcpy (image , bufinfo .buf , width * height );
60+ // would be nice to be able to use the existing buffer (bufinfo.buf) here, avoiding memcpy,
61+ // but that buffer is also being filled by image capture and displayed by lvgl
62+ // and that becomes unstable... it shows black artifacts and crashes sometimes...
63+ //uint8_t *temp_image = image;
64+ //image = bufinfo.buf;
65+ //qr->image = bufinfo.buf; // if this works then we can also eliminate quirc's ps_alloc()
6366 quirc_end (qr );
64- qr -> image = temp_image ; // restore, because quirc will try to free it
67+ // qr->image = temp_image; // restore, because quirc will try to free it
6568
6669 /*
6770 // Pointer swap - NO memcpy, NO internal.h needed
You can’t perform that action at this time.
0 commit comments