Skip to content

Commit 85eec34

Browse files
committed
[examples] Add Nucleo-F334R8 blink example
1 parent 057499a commit 85eec34

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
name: Examples STM32F3 Series
9797
when: always
9898
command: |
99-
(cd examples && ../tools/scripts/examples_compile.py stm32f3_discovery nucleo_f303k8 nucleo_f303re)
99+
(cd examples && ../tools/scripts/examples_compile.py stm32f3_discovery nucleo_f303k8 nucleo_f303re nucleo_f334r8)
100100
- run:
101101
name: Examples STM32F7 Series
102102
when: always

examples/nucleo_f334r8/blink/main.cpp

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) 2020, Raphael Lehmann
3+
*
4+
* This file is part of the modm project.
5+
*
6+
* This Source Code Form is subject to the terms of the Mozilla Public
7+
* License, v. 2.0. If a copy of the MPL was not distributed with this
8+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
9+
*/
10+
// ----------------------------------------------------------------------------
11+
12+
#include <modm/board.hpp>
13+
14+
using namespace Board;
15+
16+
int
17+
main()
18+
{
19+
Board::initialize();
20+
LedD13::setOutput();
21+
22+
// Use the logging streams to print some messages.
23+
// Change MODM_LOG_LEVEL above to enable or disable these messages
24+
MODM_LOG_DEBUG << "debug" << modm::endl;
25+
MODM_LOG_INFO << "info" << modm::endl;
26+
MODM_LOG_WARNING << "warning" << modm::endl;
27+
MODM_LOG_ERROR << "error" << modm::endl;
28+
29+
uint32_t counter(0);
30+
31+
while (true)
32+
{
33+
LedD13::toggle();
34+
modm::delay_ms(Button::read() ? 100 : 500);
35+
36+
MODM_LOG_INFO << "loop: " << counter++ << modm::endl;
37+
}
38+
39+
return 0;
40+
}
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<library>
2+
<extends>modm:nucleo-f334r8</extends>
3+
<options>
4+
<option name="modm:build:build.path">../../../build/nucleo_f334r8/blink</option>
5+
</options>
6+
<modules>
7+
<module>modm:build:scons</module>
8+
</modules>
9+
</library>

0 commit comments

Comments
 (0)