Merge branch 'radio-recv-bug-94'
This commit is contained in:
commit
2f4e542fee
3 changed files with 8 additions and 0 deletions
|
@ -233,6 +233,8 @@ class PacketBuffer
|
|||
* @endcode
|
||||
*/
|
||||
void setRSSI(uint8_t rssi);
|
||||
|
||||
static PacketBuffer EmptyPacket;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#include "MicroBit.h"
|
||||
|
||||
// Create the EmptyPacket reference.
|
||||
PacketBuffer PacketBuffer::EmptyPacket = PacketBuffer(1);
|
||||
|
||||
/**
|
||||
* Default Constructor.
|
||||
* Creates an empty Packet Buffer.
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue