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

ccn-lite example: use TLSF

This commit is contained in:
Oleg Hahm 2015-12-07 21:17:40 +01:00
parent 13958178f5
commit 5259629678
2 changed files with 19 additions and 0 deletions

View File

@ -33,6 +33,11 @@ USEMODULE += xtimer
USEMODULE += random
USEMODULE += prng_minstd
ifneq (,$(filter-out native,$(BOARD)))
USEPKG += tlsf
endif
USEPKG += ccn-lite
USEMODULE += ccn-lite-utils

View File

@ -20,6 +20,11 @@
#include <stdio.h>
/* TODO: currently TLSF has to be disabled for native because of its stricter
* CFLAGS (-pedantic) */
#ifndef BOARD_NATIVE
# include "tlsf-malloc.h"
#endif
#include "msg.h"
#include "shell.h"
#include "ccn-lite-riot.h"
@ -28,8 +33,17 @@
#define MAIN_QUEUE_SIZE (8)
static msg_t _main_msg_queue[MAIN_QUEUE_SIZE];
#ifndef BOARD_NATIVE
/* some buffer for the heap */
# define TLSF_BUFFER (10240 / sizeof(uint32_t))
static uint32_t _tlsf_heap[TLSF_BUFFER];
#endif
int main(void)
{
#ifndef BOARD_NATIVE
tlsf_add_pool(_tlsf_heap, sizeof(_tlsf_heap));
#endif
msg_init_queue(_main_msg_queue, MAIN_QUEUE_SIZE);
puts("Basic CCN-Lite example");