Skip to content

Commit b7fce80

Browse files
QR decoding in app works (to serial)
1 parent c4fcbc8 commit b7fce80

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

c_mpos/quirc/lib/quirc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ const char *quirc_version(void)
2525

2626
struct quirc *quirc_new(void)
2727
{
28-
printf("quirc_new\n");
29-
struct quirc *q = d_malloc(sizeof(*q));
28+
struct quirc *q = ps_malloc(sizeof(*q));
3029

3130
if (!q)
3231
return NULL;

internal_filesystem/apps/com.example.camtest/assets/camtest.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def qr_button_click(e):
6262
print(f"QR decoding found: {result}")
6363
except Exception as e:
6464
print("QR decode error: ", e)
65-
raise
6665

6766

6867
qr_button.add_event_cb(qr_button_click,lv.EVENT.CLICKED,None)
@@ -95,8 +94,8 @@ def close_button_click(e):
9594
xclk_freq=20000000,
9695
powerdown_pin=-1,
9796
reset_pin=-1,
98-
pixel_format=PixelFormat.RGB565,
99-
#pixel_format=PixelFormat.GRAYSCALE,
97+
#pixel_format=PixelFormat.RGB565,
98+
pixel_format=PixelFormat.GRAYSCALE,
10099
frame_size=FrameSize.R240X240,
101100
grab_mode=GrabMode.LATEST
102101
)
@@ -121,11 +120,11 @@ def close_button_click(e):
121120
"magic": lv.IMAGE_HEADER_MAGIC,
122121
"w": width,
123122
"h": height,
124-
"stride": width *2,
125-
"cf": lv.COLOR_FORMAT.RGB565
126-
#"cf": lv.COLOR_FORMAT.L8
123+
"stride": width ,
124+
#"cf": lv.COLOR_FORMAT.RGB565
125+
"cf": lv.COLOR_FORMAT.L8
127126
},
128-
'data_size': width * height*2,
127+
'data_size': width * height,
129128
'data': None # Will be updated per frame
130129
})
131130

scripts/install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if [ ! -z "$appname" ]; then
2626
exit 1
2727
fi
2828
fi
29+
~/sources/lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py mkdir "/apps"
2930
~/sources/lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py mkdir "/builtin"
3031
~/sources/lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py mkdir "/builtin/apps"
3132
~/sources/lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py fs cp -r "$appdir" :/"$target"

0 commit comments

Comments
 (0)