diff --git a/c_mpos/micropython.cmake b/c_mpos/micropython.cmake index d95eab72..1b3a181a 100644 --- a/c_mpos/micropython.cmake +++ b/c_mpos/micropython.cmake @@ -21,6 +21,18 @@ target_sources(usermod_c_mpos INTERFACE ${MPOS_C_SOURCES}) # Add include directories. target_include_directories(usermod_c_mpos INTERFACE ${MPOS_C_INCLUDES}) + +target_compile_definitions(usermod_c_mpos INTERFACE + # force quirc to use single precision floating point math + -DQUIRC_FLOAT_TYPE=float + -DQUIRC_USE_TGMATH=1 +) + +# Be sure to set the -O2 "optimize" flag!! +target_compile_options(usermod_c_mpos INTERFACE + -O2 +) + # Link our INTERFACE library to the usermod target. target_link_libraries(usermod INTERFACE usermod_c_mpos) diff --git a/internal_filesystem/apps/com.micropythonos.camera/assets/camera_app.py b/internal_filesystem/apps/com.micropythonos.camera/assets/camera_app.py index a3725bda..1aa31e29 100644 --- a/internal_filesystem/apps/com.micropythonos.camera/assets/camera_app.py +++ b/internal_filesystem/apps/com.micropythonos.camera/assets/camera_app.py @@ -171,11 +171,15 @@ class CameraApp(Activity): def qrdecode_one(self): try: import qrdecode + import utime + before = utime.ticks_ms() result = qrdecode.qrdecode_rgb565(self.current_cam_buffer, self.width, self.height) + after = utime.ticks_ms() #result = bytearray("INSERT_QR_HERE", "utf-8") if not result: self.status_label.set_text(self.status_label_text_searching) else: + print(f"SUCCESSFUL QR DECODE TOOK: {after-before}ms") result = remove_bom(result) result = print_qr_buffer(result) print(f"QR decoding found: {result}")