From 9a33fc884aad897e45bdb50a4704322556e95fda Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Sat, 6 Feb 2016 16:44:19 -0800 Subject: [PATCH] More arguments pass-by-reference. --- firmware/application/touch.cpp | 4 ++-- firmware/application/touch.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/application/touch.cpp b/firmware/application/touch.cpp index 72f6d457a..09f8db8f1 100644 --- a/firmware/application/touch.cpp +++ b/firmware/application/touch.cpp @@ -29,7 +29,7 @@ struct Metrics { const float r; }; -static Metrics calculate_metrics(const Frame frame) { +static 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. @@ -66,7 +66,7 @@ static Metrics calculate_metrics(const Frame frame) { }; } -void Manager::feed(const Frame frame) { +void Manager::feed(const Frame& frame) { // touch_debounce.feed(touch_raw); const auto touch_raw = frame.touch; //const auto touch_stable = touch_debounce.state(); diff --git a/firmware/application/touch.hpp b/firmware/application/touch.hpp index cbd13b069..0402243a6 100644 --- a/firmware/application/touch.hpp +++ b/firmware/application/touch.hpp @@ -165,7 +165,7 @@ class Manager { public: std::function on_event; - void feed(const Frame frame); + void feed(const Frame& frame); private: enum State {