Skip to content

Commit a495194

Browse files
committed
[examples] Add NUCLEO-H743ZI blinky
1 parent 210226a commit a495194

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

.github/workflows/linux.yml

+4
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ jobs:
124124
if: always()
125125
run: |
126126
(cd examples && ../tools/scripts/examples_compile.py nucleo_g474re nucleo_g431rb nucleo_g431kb)
127+
- name: Examples STM32H7 Series
128+
if: always()
129+
run: |
130+
(cd examples && ../tools/scripts/examples_compile.py nucleo_h743zi)
127131
128132
stm32f4-examples-1:
129133
runs-on: ubuntu-20.04

examples/nucleo_h743zi/blink/main.cpp

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright (c) 2016-2017, Niklas Hauser
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+
#include <modm/processing.hpp>
14+
15+
using namespace Board;
16+
17+
int
18+
main()
19+
{
20+
Board::initialize();
21+
Leds::setOutput();
22+
23+
// Use the logging streams to print some messages.
24+
// Change MODM_LOG_LEVEL above to enable or disable these messages
25+
MODM_LOG_DEBUG << "debug" << modm::endl;
26+
MODM_LOG_INFO << "info" << modm::endl;
27+
MODM_LOG_WARNING << "warning" << modm::endl;
28+
MODM_LOG_ERROR << "error" << modm::endl;
29+
30+
for (const auto [traits, start, end, size] : modm::platform::HeapTable())
31+
{
32+
MODM_LOG_INFO.printf("Memory section %#x @[0x%p,0x%p](%u)\n",
33+
traits.value, start, end, size);
34+
}
35+
36+
uint32_t counter(0);
37+
modm::ShortTimeout tmr;
38+
39+
while (true)
40+
{
41+
Leds::write(1 << (counter % (Leds::width+1) ));
42+
// modm::delay(Button::read() ? 100ms : 500ms);
43+
tmr.restart(Button::read() ? 100ms : 500ms);
44+
while(not tmr.execute()) ;
45+
46+
MODM_LOG_INFO << "loop: " << counter++ << modm::endl;
47+
}
48+
49+
return 0;
50+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<library>
2+
<extends>modm:nucleo-h743zi</extends>
3+
<options>
4+
<option name="modm:build:build.path">../../../build/nucleo_h743zi/blink</option>
5+
</options>
6+
<modules>
7+
<module>modm:architecture:memory</module>
8+
<module>modm:build:scons</module>
9+
<module>modm:processing:timer</module>
10+
</modules>
11+
</library>

0 commit comments

Comments
 (0)