From d2dbf58947def2f7c4c03e2926d19dd34091e789 Mon Sep 17 00:00:00 2001 From: 4m1g0 Date: Fri, 22 Jan 2021 18:49:45 +0100 Subject: [PATCH] Move global variables to class atributes to make it possible to define 2 sensors running independantly (#20) --- MHZ.cpp | 5 ----- MHZ.h | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MHZ.cpp b/MHZ.cpp index 6251b88..b7942f1 100644 --- a/MHZ.cpp +++ b/MHZ.cpp @@ -24,11 +24,6 @@ const int STATUS_NOT_READY = -5; const int STATUS_PWM_NOT_CONFIGURED = -6; const int STATUS_SERIAL_NOT_CONFIGURED = -7; -unsigned long lastRequest = 0; - -bool SerialConfigured = true; -bool PwmConfigured = true; - MHZ::MHZ(uint8_t rxpin, uint8_t txpin, uint8_t pwmpin, uint8_t type) { SoftwareSerial * ss = new SoftwareSerial(rxpin, txpin); _pwmpin = pwmpin; diff --git a/MHZ.h b/MHZ.h index e03c67a..5cdeaec 100644 --- a/MHZ.h +++ b/MHZ.h @@ -52,6 +52,11 @@ class MHZ { Stream * _serial; byte getCheckSum(byte *packet); + + unsigned long lastRequest = 0; + + bool SerialConfigured = true; + bool PwmConfigured = true; }; #endif