From 249323fc5fa14dbc4c1a6316873cfc07f468f43b Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 1 Mar 2022 09:22:37 +0100 Subject: refactor: fix serial stream & unique ptr --- src/gyronardo.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/gyronardo.cpp') diff --git a/src/gyronardo.cpp b/src/gyronardo.cpp index e78bb1d..57bcd18 100644 --- a/src/gyronardo.cpp +++ b/src/gyronardo.cpp @@ -15,15 +15,14 @@ constexpr unsigned int BAUD_RATE = 9600U; constexpr unsigned int SENSOR_RETRY_TIME = 2000U; -UniquePtr sout_ptr; +SerialStream sout(Serial_(), BAUD_RATE); +// SerialStream sout(Serial, BAUD_RATE); UniquePtr sensor; void setup() { - sout_ptr = make_unique(Serial, BAUD_RATE); - - auto sout = *sout_ptr; + sout.waitReady(); sensor = make_unique(SENSOR_ADDRESS, Wire, sout, SENSOR_THROTTLE_TIME); -- cgit v1.2.3-18-g5258