From 3719314ab929d07fead7595410377cb044b2b5c1 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 13 Aug 2021 14:20:47 -0700 Subject: [PATCH] Fix pmw3360 code to only output debug info if mouse debugging is enabled (#13993) --- drivers/sensors/pmw3360.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/sensors/pmw3360.c b/drivers/sensors/pmw3360.c index 91ee87b957ac..13c5bdea26f1 100644 --- a/drivers/sensors/pmw3360.c +++ b/drivers/sensors/pmw3360.c @@ -213,12 +213,14 @@ report_pmw_t pmw_read_burst(void) { spi_stop(); - print_byte(data.motion); - print_byte(data.dx); - print_byte(data.mdx); - print_byte(data.dy); - print_byte(data.mdy); - dprintf("\n"); + if (debug_mouse) { + print_byte(data.motion); + print_byte(data.dx); + print_byte(data.mdx); + print_byte(data.dy); + print_byte(data.mdy); + dprintf("\n"); + } data.isMotion = (data.motion & 0x80) != 0; data.isOnSurface = (data.motion & 0x08) == 0;