diff --git a/boards/mbed_lpc1768/Makefile.features b/boards/mbed_lpc1768/Makefile.features new file mode 100644 index 0000000000..990fa817be --- /dev/null +++ b/boards/mbed_lpc1768/Makefile.features @@ -0,0 +1 @@ +FEATURES_PROVIDED += cpp diff --git a/boards/mbed_lpc1768/Makefile.include b/boards/mbed_lpc1768/Makefile.include index 9f13d89423..8c092b07b7 100644 --- a/boards/mbed_lpc1768/Makefile.include +++ b/boards/mbed_lpc1768/Makefile.include @@ -4,15 +4,23 @@ export CPU = lpc1768 # toolchain config export PREFIX = arm-none-eabi- export CC = $(PREFIX)gcc +export CXX = $(PREFIX)g++ export AR = $(PREFIX)ar -export CFLAGS += -DUSE_STDPERIPH_DRIVER -ggdb -g3 -O0 -Wall -Wstrict-prototypes -mcpu=cortex-m3 $(FPU_USAGE) -mlittle-endian -mthumb -mthumb-interwork -nostartfiles -export ASFLAGS = -ggdb -g3 -mcpu=cortex-m3 $(FPU_USAGE) -mlittle-endian export AS = $(PREFIX)as export LINK = $(PREFIX)gcc export SIZE = $(PREFIX)size export OBJCOPY = $(PREFIX)objcopy -#LINKFLAGS += -g3 -ggdb -mcpu=cortex-m3 $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mthumb-interwork -nostartfiles -T$(RIOTCPU)/$(CPU)/LPC1768.ld -LINKFLAGS += -mcpu=cortex-m3 -mthumb -Wl,--gc-sections,--cref -lc -lgcc -lnosys -T$(RIOTCPU)/$(CPU)/LPC1768.ld -nostartfiles + +# define build options +CPU_USAGE = -mcpu=cortex-m3 +FPU_USAGE = +export CFLAGS += -ggdb -g3 -std=gnu99 -Os -Wall -Wstrict-prototypes $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -mthumb -mthumb-interwork -nostartfiles +export CFLAGS += -ffunction-sections -fdata-sections -fno-builtin +export ASFLAGS += -ggdb -g3 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian +export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mthumb-interwork -nostartfiles +export LINKFLAGS += -T$(RIOTCPU)/$(CPU)/LPC1768.ld + +#LINKFLAGS += -mcpu=cortex-m3 -mthumb -Wl,--gc-sections,--cref -lc -lgcc -lnosys -nostartfiles ifeq ($(strip $(PORT)),) export PORT = /dev/ttyUSB0 @@ -25,3 +33,7 @@ export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include/ -I$(RIOTCPU)/$(CPU)/include export OFLAGS = -O binary export UNDEF += $(BINDIR)cpu/startup.o + +# unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++ +export CXXUWFLAGS += +export CXXEXFLAGS += diff --git a/cpu/lpc1768/syscalls.c b/cpu/lpc1768/syscalls.c index 96d4220e39..3d6fa2808f 100644 --- a/cpu/lpc1768/syscalls.c +++ b/cpu/lpc1768/syscalls.c @@ -224,10 +224,10 @@ pid_t _getpid(void) return sched_active_pid; } /*---------------------------------------------------------------------------*/ +__attribute__ ((weak)) int _kill_r(struct _reent *r, int pid, int sig) { - /* not implemented */ - r->_errno = ESRCH; // no such process + r->_errno = ESRCH; /* not implemented yet */ return -1; } /*---------------------------------------------------------------------------*/ @@ -241,3 +241,18 @@ int _gettimeofday(struct timeval *tp, void *restrict tzp) { void _init(void){} void _fini(void){} + +/** + * @brief Send a signal to a thread + * + * @param[in] pid the pid to send to + * @param[in] sig the signal to send + * + * @return TODO + */ +__attribute__ ((weak)) +int _kill(int pid, int sig) +{ + errno = ESRCH; /* not implemented yet */ + return -1; +}