diff --git a/c_mpos/quirc/lib/quirc.c b/c_mpos/quirc/lib/quirc.c index 286f9122..4bbf41c8 100644 --- a/c_mpos/quirc/lib/quirc.c +++ b/c_mpos/quirc/lib/quirc.c @@ -25,7 +25,8 @@ const char *quirc_version(void) struct quirc *quirc_new(void) { - struct quirc *q = malloc(sizeof(*q)); + printf("quirc_new\n"); + struct quirc *q = d_malloc(sizeof(*q)); if (!q) return NULL; @@ -85,7 +86,7 @@ int quirc_resize(struct quirc *q, int w, int h) /* alloc a new buffer for q->pixels if needed */ if (!QUIRC_PIXEL_ALIAS_IMAGE) { - pixels = calloc(newdim, sizeof(quirc_pixel_t)); + pixels = ps_malloc(newdim * sizeof(quirc_pixel_t)); if (!pixels) goto fail; } diff --git a/draft_code/saved_functions.py b/draft_code/saved_functions.py index a329035f..86056951 100644 --- a/draft_code/saved_functions.py +++ b/draft_code/saved_functions.py @@ -602,7 +602,7 @@ def log_callback(level, log_str): # Convert log_str to string if it's a bytes object log_str = log_str.decode() if isinstance(log_str, bytes) else log_str # Optional: Print for debugging - #print(f"Level: {level}, Log: {log_str}") + print(f"Level: {level}, Log: {log_str}") # Log message format: "sysmon: 25 FPS (refr_cnt: 8 | redraw_cnt: 1), ..." if "sysmon:" in log_str and "FPS" in log_str: try: diff --git a/internal_filesystem/apps/com.example.camtest/assets/camtest.py b/internal_filesystem/apps/com.example.camtest/assets/camtest.py index 3bd8cb91..5c3d44c2 100644 --- a/internal_filesystem/apps/com.example.camtest/assets/camtest.py +++ b/internal_filesystem/apps/com.example.camtest/assets/camtest.py @@ -55,12 +55,13 @@ def qr_button_click(e): height = 240 buffer_size = width * height # 240 * 240 = 57600 bytes try: + import qrdecode result = qrdecode.qrdecode(current_cam_buffer, width, height) if result.startswith('\ufeff'): # Remove BOM (\ufeff) from the start of the decoded string, if present result = result[1:] print(f"QR decoding found: {result}") - except ValueError as e: - print("Error:", e) + except Exception as e: + print("QR decode error: ", e) raise diff --git a/scripts/install.sh b/scripts/install.sh index 2132ebd8..d48b231c 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -26,6 +26,8 @@ if [ ! -z "$appname" ]; then exit 1 fi fi + ~/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" echo "start_app(\"/$appdir\")" ~/sources/lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py