1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #5211 from kaspar030/ethos_fixes

drivers: ethos: misc fixes
This commit is contained in:
Oleg Hahm 2016-03-31 00:43:55 +02:00
commit 4f17d2bd9c
2 changed files with 4 additions and 2 deletions

View File

@ -521,6 +521,7 @@ endif
ifneq (,$(filter ethos,$(USEMODULE)))
USEMODULE += netdev2_eth
USEMODULE += random
endif
ifneq (,$(filter random,$(USEMODULE)))

View File

@ -297,11 +297,12 @@ static int _recv(netdev2_t *netdev, char* buf, int len, void* info)
ethos_t * dev = (ethos_t *) netdev;
if (buf) {
if (len != dev->last_framesize) {
DEBUG("ethos _recv(): unmatched receive buffer size.");
if (len < dev->last_framesize) {
DEBUG("ethos _recv(): receive buffer too small.");
return -1;
}
len = dev->last_framesize;
dev->last_framesize = 0;
if ((tsrb_get(&dev->inbuf, buf, len) != len)) {