Skip to content

Commit

Permalink
Merge pull request #1994 from BytesGalore/EasyCPPMixing_samr21_xpro_s…
Browse files Browse the repository at this point in the history
…upport_fix

cpu/samd21 C++ samr21-xpro support fix
  • Loading branch information
haukepetersen committed Nov 17, 2014
2 parents d4e651a + ae3492b commit d1e57fa
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion boards/samr21-xpro/Makefile.features
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_gpio cpp
5 changes: 5 additions & 0 deletions boards/samr21-xpro/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export PORT ?= /dev/ttyACM0
# define tools used for building the project
export PREFIX = arm-none-eabi-
export CC = $(PREFIX)gcc
export CXX = $(PREFIX)g++
export AR = $(PREFIX)ar
export AS = $(PREFIX)as
export LINK = $(PREFIX)gcc
Expand All @@ -30,6 +31,10 @@ export OFLAGS += -O binary
export FFLAGS += $(HEXFILE)
export TERMFLAGS += "$(PORT)"

# unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++
export CXXUWFLAGS +=
export CXXEXFLAGS +=

# use the nano-specs of the NewLib when available
ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0)
export LINKFLAGS += -specs=nano.specs -lc -lnosys
Expand Down
16 changes: 16 additions & 0 deletions cpu/samd21/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ pid_t _getpid(void)
*
* @return TODO
*/
__attribute__ ((weak))
int _kill_r(struct _reent *r, pid_t pid, int sig)
{
r->_errno = ESRCH; /* not implemented yet */
Expand Down Expand Up @@ -317,3 +318,18 @@ int _unlink_r(struct _reent *r, char* path)
r->_errno = ENODEV; /* not implemented yet */
return -1;
}

/**
* @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;
}

0 comments on commit d1e57fa

Please sign in to comment.