Merge branch 'radio-recv-bug-94'

This commit is contained in:
Joe Finney 2016-02-26 16:33:28 +00:00
commit 2f4e542fee
3 changed files with 8 additions and 0 deletions

View file

@ -233,6 +233,8 @@ class PacketBuffer
* @endcode
*/
void setRSSI(uint8_t rssi);
static PacketBuffer EmptyPacket;
};
#endif

View file

@ -1,5 +1,8 @@
#include "MicroBit.h"
// Create the EmptyPacket reference.
PacketBuffer PacketBuffer::EmptyPacket = PacketBuffer(1);
/**
* Default Constructor.
* Creates an empty Packet Buffer.

View file

@ -57,6 +57,9 @@ int MicroBitRadioDatagram::recv(uint8_t *buf, int len)
*/
PacketBuffer MicroBitRadioDatagram::recv()
{
if (rxQueue == NULL)
return PacketBuffer::EmptyPacket;
FrameBuffer *p = rxQueue;
rxQueue = rxQueue->next;