platform/minimal-net: Implement better idle behavior.
The minimal-net target, as currently written, wakes up the CPU every millisecond to check for packets, and will only react in real-time to input from stdin. If you are running this on a laptop battery, your battery will quickly drain. This change allows the CPU to idle when there is literally nothing to do while still being responsive to input from stein and/or incoming packets. This fix should significantly improve performance while significantly improving power usage. Win-win. Also added `_xassert()` implementation so that the contiki- provided `assert()` macro will work properly when used on this platform.
This commit is contained in:
parent
0a88373add
commit
092b6f3baa
5 changed files with 71 additions and 9 deletions
|
@ -69,6 +69,13 @@ static unsigned long lasttime;
|
|||
|
||||
#define BUF ((struct uip_eth_hdr *)&uip_buf[0])
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
tapdev_fd(void)
|
||||
{
|
||||
return fd;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
remove_route(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue