Skip to content
This repository has been archived by the owner on Jan 7, 2019. It is now read-only.

Commit

Permalink
[examples] Add NUCLEO-F411RE blinky example.
Browse files Browse the repository at this point in the history
  • Loading branch information
salkinium committed May 18, 2016
1 parent 4e108de commit e346020
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 4 additions & 0 deletions examples/nucleo_f411re/blink/SConstruct
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# path to the xpcc root directory
xpccpath = '../../..'
# execute the common SConstruct file
execfile(xpccpath + '/scons/SConstruct')
29 changes: 29 additions & 0 deletions examples/nucleo_f411re/blink/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include <xpcc/architecture/platform.hpp>

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;
}
3 changes: 3 additions & 0 deletions examples/nucleo_f411re/blink/project.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build]
board = nucleo_f411re
buildpath = ${xpccpath}/build/nucleo_f411re/${name}

0 comments on commit e346020

Please sign in to comment.