From e3460209596a51b95427a1ab02d17d3fe95fa6d1 Mon Sep 17 00:00:00 2001 From: Niklas Hauser Date: Wed, 18 May 2016 23:06:17 +0100 Subject: [PATCH] [examples] Add NUCLEO-F411RE blinky example. --- .travis.yml | 1 + examples/nucleo_f411re/blink/SConstruct | 4 ++++ examples/nucleo_f411re/blink/main.cpp | 29 ++++++++++++++++++++++++ examples/nucleo_f411re/blink/project.cfg | 3 +++ 4 files changed, 37 insertions(+) create mode 100644 examples/nucleo_f411re/blink/SConstruct create mode 100644 examples/nucleo_f411re/blink/main.cpp create mode 100644 examples/nucleo_f411re/blink/project.cfg diff --git a/.travis.yml b/.travis.yml index 3dc4f1dd1..d465b5e53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,6 +61,7 @@ env: - TEST_SUITE="check=examples examples=stm32f4_loa_v2b" - TEST_SUITE="check=examples examples=stm32f469_discovery" - TEST_SUITE="check=examples examples=nucleo_f103rb" + - TEST_SUITE="check=examples examples=nucleo_f411re" - TEST_SUITE="check=examples examples=unittest" script: "scons $TEST_SUITE" diff --git a/examples/nucleo_f411re/blink/SConstruct b/examples/nucleo_f411re/blink/SConstruct new file mode 100644 index 000000000..54cafe644 --- /dev/null +++ b/examples/nucleo_f411re/blink/SConstruct @@ -0,0 +1,4 @@ +# path to the xpcc root directory +xpccpath = '../../..' +# execute the common SConstruct file +execfile(xpccpath + '/scons/SConstruct') diff --git a/examples/nucleo_f411re/blink/main.cpp b/examples/nucleo_f411re/blink/main.cpp new file mode 100644 index 000000000..ef9525049 --- /dev/null +++ b/examples/nucleo_f411re/blink/main.cpp @@ -0,0 +1,29 @@ +#include + +using namespace Board; + +int +main() +{ + Board::initialize(); + LedD13::setOutput(); + + // Use the logging streams to print some messages. + // Change XPCC_LOG_LEVEL above to enable or disable these messages + XPCC_LOG_DEBUG << "debug" << xpcc::endl; + XPCC_LOG_INFO << "info" << xpcc::endl; + XPCC_LOG_WARNING << "warning" << xpcc::endl; + XPCC_LOG_ERROR << "error" << xpcc::endl; + + uint32_t counter(0); + + while (1) + { + LedD13::toggle(); + xpcc::delayMilliseconds(Button::read() ? 100 : 500); + + XPCC_LOG_INFO << "loop: " << counter++ << xpcc::endl; + } + + return 0; +} diff --git a/examples/nucleo_f411re/blink/project.cfg b/examples/nucleo_f411re/blink/project.cfg new file mode 100644 index 000000000..ec9411875 --- /dev/null +++ b/examples/nucleo_f411re/blink/project.cfg @@ -0,0 +1,3 @@ +[build] +board = nucleo_f411re +buildpath = ${xpccpath}/build/nucleo_f411re/${name}