Add a trace mode for usb tracing

This commit is contained in:
2025-10-12 12:56:09 +02:00
parent bf7ff27b8d
commit 652e687fb0
5 changed files with 51 additions and 26 deletions

View File

@@ -35,6 +35,15 @@ incdir = include_directories('src')
subdir('src')
# Build arguments
cpp_args = ['-DPROJ_VERSION="' + meson.project_version() + '"']
# USB trace mode option (for debugging without sending to hardware)
if get_option('usb_trace_only')
cpp_args += ['-DUSB_TRACE_ONLY']
message('USB_TRACE_ONLY enabled: USB data will be logged but not sent to device')
endif
ptprnt_exe = executable(
'ptprnt',
'src/main.cpp',
@@ -42,7 +51,7 @@ ptprnt_exe = executable(
dependencies: [usb_dep, log_dep, fmt_dep, pangocairo_dep, cli11_dep],
include_directories: incdir,
sources: [ptprnt_srcs],
cpp_args: ['-DPROJ_VERSION="' + meson.project_version() + '"'],
cpp_args: cpp_args,
)