mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-21 19:29:18 +00:00
31 lines
419 B
C
31 lines
419 B
C
#include "contiki.h"
|
|
|
|
PROCESS(example_pollhandler, "Pollhandler example");
|
|
|
|
static void
|
|
exithandler(void)
|
|
{
|
|
printf("Process exited\n");
|
|
}
|
|
|
|
static void
|
|
pollhandler(void)
|
|
{
|
|
printf("Process polled\n");
|
|
}
|
|
|
|
PROCESS_THREAD(example_pollhandler, ev, data)
|
|
{
|
|
|
|
PROCESS_POLLHANDLER(pollhandler());
|
|
PROCESS_EXITHANDLER(exithandler());
|
|
|
|
PROCESS_BEGIN();
|
|
|
|
while(1) {
|
|
PROCESS_WAIT_EVENT();
|
|
}
|
|
|
|
PROCESS_END();
|
|
}
|