From 574a8fafc5e9af845a681d5673487ea1c4b6e8d1 Mon Sep 17 00:00:00 2001 From: Wez <59873510+wvarty@users.noreply.github.com> Date: Wed, 2 Mar 2022 19:07:48 +1000 Subject: [PATCH] Properly init the MSP frame state when creating the MSP class (#62) * Properly init the MSP frame state when creating the MSP class * Remove whitespace --- lib/MSP/msp.cpp | 4 ++++ lib/MSP/msp.h | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/MSP/msp.cpp b/lib/MSP/msp.cpp index 9fe5960..ff1ac10 100644 --- a/lib/MSP/msp.cpp +++ b/lib/MSP/msp.cpp @@ -31,6 +31,10 @@ uint8_t crc8_dvb_s2(uint8_t crc, unsigned char a) return crc; } +MSP::MSP() : m_inputState(MSP_IDLE) +{ +} + bool MSP::processReceivedByte(uint8_t c) { diff --git a/lib/MSP/msp.h b/lib/MSP/msp.h index 7637ee8..db51b06 100644 --- a/lib/MSP/msp.h +++ b/lib/MSP/msp.h @@ -88,6 +88,7 @@ typedef struct { class MSP { public: + MSP(); bool processReceivedByte(uint8_t c); mspPacket_t* getReceivedPacket(); void markPacketReceived();