From 9b23b469cf11d211fc8c9744ce31d89e5e51cde9 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 28 Feb 2018 15:38:06 +1100 Subject: [PATCH] AP_OpticalFlow: correct compiler warning In file included from ../../libraries/AP_OpticalFlow/AP_OpticalFlow_Pixart.cpp:28: ../../libraries/AP_OpticalFlow/AP_OpticalFlow_Pixart.h:75:13: warning: private field 'sum_x' is not used [-Wunused-private-field] int32_t sum_x; ^ ../../libraries/AP_OpticalFlow/AP_OpticalFlow_Pixart.h:76:13: warning: private field 'sum_y' is not used [-Wunused-private-field] int32_t sum_y; ^ ../../libraries/AP_OpticalFlow/AP_OpticalFlow_Pixart.h:77:14: warning: private field 'last_print_ms' is not used [-Wunused-private-field] uint32_t last_print_ms; ^ 4 warnings generated. --- libraries/AP_OpticalFlow/AP_OpticalFlow_Pixart.cpp | 3 +++ libraries/AP_OpticalFlow/AP_OpticalFlow_Pixart.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/AP_OpticalFlow/AP_OpticalFlow_Pixart.cpp b/libraries/AP_OpticalFlow/AP_OpticalFlow_Pixart.cpp index ce856bb5e3..fea86b8afa 100644 --- a/libraries/AP_OpticalFlow/AP_OpticalFlow_Pixart.cpp +++ b/libraries/AP_OpticalFlow/AP_OpticalFlow_Pixart.cpp @@ -309,11 +309,14 @@ void AP_OpticalFlow_Pixart::timer(void) } #if 0 + static uint32_t last_print_ms; static int fd = -1; if (fd == -1) { fd = open("/dev/ttyACM0", O_WRONLY); } // used for debugging + static int32_t sum_x; + static int32_t sum_y; sum_x += burst.delta_x; sum_y += burst.delta_y; diff --git a/libraries/AP_OpticalFlow/AP_OpticalFlow_Pixart.h b/libraries/AP_OpticalFlow/AP_OpticalFlow_Pixart.h index abc2c99ce6..9c5e11d09b 100644 --- a/libraries/AP_OpticalFlow/AP_OpticalFlow_Pixart.h +++ b/libraries/AP_OpticalFlow/AP_OpticalFlow_Pixart.h @@ -72,9 +72,6 @@ private: void timer(void); void motion_burst(void); - int32_t sum_x; - int32_t sum_y; - uint32_t last_print_ms; uint32_t last_burst_us; uint32_t last_update_ms; };