diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index 5fb9bf9d37..116620345f 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -188,7 +188,7 @@ void MyMesh::writeContactRespFrame(uint8_t code, const ContactInfo &contact) { void MyMesh::updateContactFromFrame(ContactInfo &contact, uint32_t& last_mod, const uint8_t *frame, int len) { int i = 0; - uint8_t code = frame[i++]; // eg. CMD_ADD_UPDATE_CONTACT + i++; // skip command code byte (eg. CMD_ADD_UPDATE_CONTACT) memcpy(contact.id.pub_key, &frame[i], PUB_KEY_SIZE); i += PUB_KEY_SIZE; contact.type = frame[i++]; diff --git a/examples/companion_radio/main.cpp b/examples/companion_radio/main.cpp index ef9b6bfca4..6ca374e875 100644 --- a/examples/companion_radio/main.cpp +++ b/examples/companion_radio/main.cpp @@ -2,16 +2,6 @@ #include #include "MyMesh.h" -// Believe it or not, this std C function is busted on some platforms! -static uint32_t _atoi(const char* sp) { - uint32_t n = 0; - while (*sp && *sp >= '0' && *sp <= '9') { - n *= 10; - n += (*sp++ - '0'); - } - return n; -} - #if defined(NRF52_PLATFORM) || defined(STM32_PLATFORM) #include #if defined(QSPIFLASH) diff --git a/src/Mesh.cpp b/src/Mesh.cpp index e9b92262ce..07fcf86c27 100644 --- a/src/Mesh.cpp +++ b/src/Mesh.cpp @@ -290,7 +290,6 @@ DispatcherAction Mesh::onRecvPacket(Packet* pkt) { } case PAYLOAD_TYPE_MULTIPART: if (pkt->payload_len > 2) { - uint8_t remaining = pkt->payload[0] >> 4; // num of packets in this multipart sequence still to be sent uint8_t type = pkt->payload[0] & 0x0F; if (type == PAYLOAD_TYPE_ACK && pkt->payload_len >= 5) { // a multipart ACK