mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
example ccn-lite-relay; enable TLSF for native
With the previous commit TLSF should compile for native, too.
This commit is contained in:
parent
60e283e6a2
commit
b522c13432
@ -33,10 +33,7 @@ USEMODULE += xtimer
|
||||
USEMODULE += random
|
||||
USEMODULE += prng_minstd
|
||||
|
||||
|
||||
ifneq (,$(filter-out native,$(BOARD)))
|
||||
USEPKG += tlsf
|
||||
endif
|
||||
USEPKG += tlsf
|
||||
|
||||
USEPKG += ccn-lite
|
||||
USEMODULE += ccn-lite-utils
|
||||
|
@ -20,11 +20,7 @@
|
||||
|
||||
#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 "tlsf-malloc.h"
|
||||
#include "msg.h"
|
||||
#include "shell.h"
|
||||
#include "ccn-lite-riot.h"
|
||||
@ -33,17 +29,13 @@
|
||||
#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
|
||||
/* 10kB buffer for the heap should be enough for everyone */
|
||||
#define TLSF_BUFFER (10240 / sizeof(uint32_t))
|
||||
static uint32_t _tlsf_heap[TLSF_BUFFER];
|
||||
|
||||
int main(void)
|
||||
{
|
||||
#ifndef BOARD_NATIVE
|
||||
tlsf_create_with_pool(_tlsf_heap, sizeof(_tlsf_heap));
|
||||
#endif
|
||||
msg_init_queue(_main_msg_queue, MAIN_QUEUE_SIZE);
|
||||
|
||||
puts("Basic CCN-Lite example");
|
||||
|
Loading…
Reference in New Issue
Block a user