diff --git a/pkg/talking_leds/Makefile b/pkg/talking_leds/Makefile new file mode 100644 index 0000000000..ac27ea79eb --- /dev/null +++ b/pkg/talking_leds/Makefile @@ -0,0 +1,11 @@ +PKG_NAME=talking_leds +PKG_URL=https://github.com/fabriziop/TalkingLED +PKG_VERSION=8ae4f2d0b736aa338f24e097dbaf876fbb385dbd +PKG_LICENSE=MIT + +.PHONY: all + +all: + "$(MAKE)" -C $(PKG_BUILDDIR)/src -f $(CURDIR)/Makefile.talking_leds + +include $(RIOTBASE)/pkg/pkg.mk diff --git a/pkg/talking_leds/Makefile.dep b/pkg/talking_leds/Makefile.dep new file mode 100644 index 0000000000..60bad41674 --- /dev/null +++ b/pkg/talking_leds/Makefile.dep @@ -0,0 +1 @@ +USEMODULE += arduino diff --git a/pkg/talking_leds/Makefile.include b/pkg/talking_leds/Makefile.include new file mode 100644 index 0000000000..102cad5aad --- /dev/null +++ b/pkg/talking_leds/Makefile.include @@ -0,0 +1,3 @@ +INCLUDES += -I$(PKGDIRBASE)/talking_leds/src + +CXXEXFLAGS += -std=c++11 diff --git a/pkg/talking_leds/Makefile.talking_leds b/pkg/talking_leds/Makefile.talking_leds new file mode 100644 index 0000000000..29d54f30b7 --- /dev/null +++ b/pkg/talking_leds/Makefile.talking_leds @@ -0,0 +1,3 @@ +MODULE = talking_leds + +include $(RIOTBASE)/Makefile.base diff --git a/pkg/talking_leds/doc.txt b/pkg/talking_leds/doc.txt new file mode 100644 index 0000000000..9aec241a36 --- /dev/null +++ b/pkg/talking_leds/doc.txt @@ -0,0 +1,6 @@ +/** + * @defgroup pkg_talking_leds Talking LEDs - Arduino library for demonstration + * @ingroup pkg + * @brief Demonstrates the usage of Arduino libraries as packages + * @see https://github.com/fabriziop/TalkingLED + */ diff --git a/tests/sys_arduino_lib/Makefile b/tests/sys_arduino_lib/Makefile new file mode 100644 index 0000000000..b106960d41 --- /dev/null +++ b/tests/sys_arduino_lib/Makefile @@ -0,0 +1,5 @@ +include ../Makefile.tests_common + +USEPKG += talking_leds + +include $(RIOTBASE)/Makefile.include diff --git a/tests/sys_arduino_lib/Makefile.ci b/tests/sys_arduino_lib/Makefile.ci new file mode 100644 index 0000000000..503155bffc --- /dev/null +++ b/tests/sys_arduino_lib/Makefile.ci @@ -0,0 +1,7 @@ +BOARD_INSUFFICIENT_MEMORY := \ + arduino-duemilanove \ + arduino-leonardo \ + arduino-nano \ + arduino-uno \ + nucleo-f031k6 \ + # diff --git a/tests/sys_arduino_lib/main.cpp b/tests/sys_arduino_lib/main.cpp new file mode 100644 index 0000000000..aae77b850b --- /dev/null +++ b/tests/sys_arduino_lib/main.cpp @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2019 Gunar Schorcht + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License v2.1. See the file LICENSE in the top level + * directory for more details. + */ + +/** + * @ingroup tests + * @{ + * + * @file + * @brief Demonstrates the use of an Arduino library imported as package + * + * @author Gunar Schorcht + * + * @} + */ + +#include + +#include "arduino_board.h" +#include "TalkingLED.h" + +#ifndef ARDUINO_LED +#define ARDUINO_LED (13) /* Arduino Uno LED pin */ +#endif + +TalkingLED tled; + +int main(void) +{ + tled.begin(ARDUINO_LED); + + while (1) { + /* message 2: short short */ + tled.message(2); + tled.waitEnd(); + /* message 8: long long */ + tled.message(8); + tled.waitEnd(); + } + + return 0; +}