You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
QR decoding in app works (to serial)
This commit is contained in:
@@ -25,8 +25,7 @@ const char *quirc_version(void)
|
||||
|
||||
struct quirc *quirc_new(void)
|
||||
{
|
||||
printf("quirc_new\n");
|
||||
struct quirc *q = d_malloc(sizeof(*q));
|
||||
struct quirc *q = ps_malloc(sizeof(*q));
|
||||
|
||||
if (!q)
|
||||
return NULL;
|
||||
|
||||
@@ -62,7 +62,6 @@ def qr_button_click(e):
|
||||
print(f"QR decoding found: {result}")
|
||||
except Exception as e:
|
||||
print("QR decode error: ", e)
|
||||
raise
|
||||
|
||||
|
||||
qr_button.add_event_cb(qr_button_click,lv.EVENT.CLICKED,None)
|
||||
@@ -95,8 +94,8 @@ cam = Camera(
|
||||
xclk_freq=20000000,
|
||||
powerdown_pin=-1,
|
||||
reset_pin=-1,
|
||||
pixel_format=PixelFormat.RGB565,
|
||||
#pixel_format=PixelFormat.GRAYSCALE,
|
||||
#pixel_format=PixelFormat.RGB565,
|
||||
pixel_format=PixelFormat.GRAYSCALE,
|
||||
frame_size=FrameSize.R240X240,
|
||||
grab_mode=GrabMode.LATEST
|
||||
)
|
||||
@@ -121,11 +120,11 @@ image_dsc = lv.image_dsc_t({
|
||||
"magic": lv.IMAGE_HEADER_MAGIC,
|
||||
"w": width,
|
||||
"h": height,
|
||||
"stride": width *2,
|
||||
"cf": lv.COLOR_FORMAT.RGB565
|
||||
#"cf": lv.COLOR_FORMAT.L8
|
||||
"stride": width ,
|
||||
#"cf": lv.COLOR_FORMAT.RGB565
|
||||
"cf": lv.COLOR_FORMAT.L8
|
||||
},
|
||||
'data_size': width * height*2,
|
||||
'data_size': width * height,
|
||||
'data': None # Will be updated per frame
|
||||
})
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ if [ ! -z "$appname" ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
~/sources/lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py mkdir "/apps"
|
||||
~/sources/lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py mkdir "/builtin"
|
||||
~/sources/lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py mkdir "/builtin/apps"
|
||||
~/sources/lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py fs cp -r "$appdir" :/"$target"
|
||||
|
||||
Reference in New Issue
Block a user