diff --git a/arduino/common/lib/CommsControl/CommsCommon.h b/arduino/common/lib/CommsControl/CommsCommon.h index 3566a177be069cbfe9131785cb32c37dcf9e42a5..6ab31419237d80cd59d0de9b151168bf90884403 100644 --- a/arduino/common/lib/CommsControl/CommsCommon.h +++ b/arduino/common/lib/CommsControl/CommsCommon.h @@ -40,7 +40,7 @@ #define PACKET_SET 0x20 //set vs get ? // enum of all transfer types -enum PRIORITY { +enum PRIORITY : uint8_t { DATA = PACKET_DATA, CMD = PACKET_CMD, ALARM = PACKET_ALARM, diff --git a/arduino/common/lib/CommsControl/CommsControl.cpp b/arduino/common/lib/CommsControl/CommsControl.cpp index 02ff4fa433b98d95530993e89a7696321bf3eb89..58f6a2130e0075ab97b9c8cf3dfafd1e86bc215f 100644 --- a/arduino/common/lib/CommsControl/CommsControl.cpp +++ b/arduino/common/lib/CommsControl/CommsControl.cpp @@ -275,16 +275,8 @@ void CommsControl::finishPacket(PRIORITY &type) { } PRIORITY CommsControl::getInfoType(uint8_t &address) { - switch (address & PACKET_TYPE) { - case PACKET_ALARM: - return PRIORITY::ALARM; - case PACKET_CMD: - return PRIORITY::CMD; - case PACKET_DATA: - return PRIORITY::DATA; - default: - return PRIORITY::UNSET; - } + // return enum element corresponding to the address + return (PRIORITY)(address & PACKET_TYPE); } // get link to queue according to packet format