From d0fd56bc782b8233da9bfc826837769fb17b407b Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Tue, 26 Jul 2016 15:13:07 -0700 Subject: [PATCH] Touch: Expose metrics calculation struct/function. --- firmware/application/touch.cpp | 8 +------- firmware/application/touch.hpp | 8 ++++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/firmware/application/touch.cpp b/firmware/application/touch.cpp index 09f8db8f1..503af80fe 100644 --- a/firmware/application/touch.cpp +++ b/firmware/application/touch.cpp @@ -23,13 +23,7 @@ namespace touch { -struct Metrics { - const float x; - const float y; - const float r; -}; - -static Metrics calculate_metrics(const Frame& frame) { +Metrics calculate_metrics(const Frame& frame) { /* TODO: Yikes! M0 doesn't have floating point, so this code is * expensive! On the other hand, it seems to be working well (and * fast *enough*?), so maybe leave it alone at least for now. diff --git a/firmware/application/touch.hpp b/firmware/application/touch.hpp index 0402243a6..31c1bd55f 100644 --- a/firmware/application/touch.hpp +++ b/firmware/application/touch.hpp @@ -106,6 +106,14 @@ struct Frame { bool touch { false }; }; +struct Metrics { + const float x; + const float y; + const float r; +}; + +Metrics calculate_metrics(const Frame& frame); + template class Filter { public: