You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Time QR decoding and add kdmukai's speedups
240x240 image decoding goes from 1800ms to 406ms. Thanks, @kdmukai!
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user