diff --git a/fw/Core/Hitcon/Logic/IrLogic.cc b/fw/Core/Hitcon/Logic/IrLogic.cc index b630f83..a259efd 100644 --- a/fw/Core/Hitcon/Logic/IrLogic.cc +++ b/fw/Core/Hitcon/Logic/IrLogic.cc @@ -212,6 +212,7 @@ void IrLogic::OnBufferReceived(uint8_t *buffer) { g_suspender.DecBlocker(); packet_buf = 0; bit = 0; + memset(&rx_packet, 0, sizeof(IrPacket)); break; default: diff --git a/fw/Core/Hitcon/Logic/IrLogic.h b/fw/Core/Hitcon/Logic/IrLogic.h index 07b41fc..8910214 100644 --- a/fw/Core/Hitcon/Logic/IrLogic.h +++ b/fw/Core/Hitcon/Logic/IrLogic.h @@ -21,7 +21,7 @@ struct IrPacket { // We need to add 3 bytes because we need // at least 1 byte to accomodate the size. // at least 1 byte to accomodate the chksum. - uint8_t data_[MAX_PACKET_PAYLOAD_BYTES + 3]; + uint8_t data_[MAX_PACKET_PAYLOAD_BYTES + 4]; size_t size_; };