summaryrefslogtreecommitdiff
path: root/src/gyronardo.cpp
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-03-01 09:22:37 +0100
committerHampusM <hampus@hampusmat.com>2022-03-01 09:22:37 +0100
commit249323fc5fa14dbc4c1a6316873cfc07f468f43b (patch)
treebd53ea18ab364e5f19993d0f7ef07a39ce10f60f /src/gyronardo.cpp
parent61f11389ea6296fb0c28dd7aa4d0bfa6feb919f3 (diff)
refactor: fix serial stream & unique ptr
Diffstat (limited to 'src/gyronardo.cpp')
-rw-r--r--src/gyronardo.cpp7
1 files changed, 3 insertions, 4 deletions
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<SerialStream> sout_ptr;
+SerialStream sout(Serial_(), BAUD_RATE);
+// SerialStream sout(Serial, BAUD_RATE);
UniquePtr<Sensor> sensor;
void setup()
{
- sout_ptr = make_unique<SerialStream>(Serial, BAUD_RATE);
-
- auto sout = *sout_ptr;
+ sout.waitReady();
sensor = make_unique<Sensor>(SENSOR_ADDRESS, Wire, sout, SENSOR_THROTTLE_TIME);