Skip to content

Commit

Permalink
[example] Add blink for NUCLEO-F446RE
Browse files Browse the repository at this point in the history
And fix modulo on Led::width.
  • Loading branch information
se-bi authored and salkinium committed Jun 20, 2019
1 parent 31c15af commit f46b801
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
name: Examples STM32F4 Series
command: |
(cd examples && ../tools/scripts/examples_compile.py stm32f4_discovery)
(cd examples && ../tools/scripts/examples_compile.py stm32f429_discovery stm32f469_discovery nucleo_f401re nucleo_f411re nucleo_f429zi)
(cd examples && ../tools/scripts/examples_compile.py stm32f429_discovery stm32f469_discovery nucleo_f401re nucleo_f411re nucleo_f429zi nucleo_f446re)
avr-examples:
docker:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,14 @@ documentation.
</tr><tr>
<td align="center">NUCLEO-F411RE</td>
<td align="center">NUCLEO-F429ZI</td>
<td align="center">NUCLEO-F446RE</td>
<td align="center">NUCLEO-G071RB</td>
<td align="center">NUCLEO-L432KC</td>
</tr><tr>
<td align="center">NUCLEO-L432KC</td>
<td align="center">NUCLEO-L476RG</td>
<td align="center">OLIMEXINO-STM32</td>
<td align="center">STM32F030F4P6-DEMO</td>
</tr><tr>
</tr>
</table>
<!--/bsptable-->
Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ make gdb

## Interesting Examples

We have a lot of examples, <!--examplecount-->177<!--/examplecount--> to be
We have a lot of examples, <!--examplecount-->178<!--/examplecount--> to be
exact, but here are some of our favorite examples for our supported development
boards:

Expand Down
2 changes: 1 addition & 1 deletion examples/nucleo_f429zi/blink/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ main()

while (1)
{
Leds::write(1 << (counter % Leds::width));
Leds::write(1 << (counter % (Leds::width+1) ));
modm::delayMilliseconds(Button::read() ? 100 : 500);

MODM_LOG_INFO << "loop: " << counter++ << modm::endl;
Expand Down
40 changes: 40 additions & 0 deletions examples/nucleo_f446re/blink/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2016-2017, Niklas Hauser
*
* This file is part of the modm project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// ----------------------------------------------------------------------------

#include <modm/board.hpp>

using namespace Board;

int
main()
{
Board::initialize();
Leds::setOutput();

// Use the logging streams to print some messages.
// Change MODM_LOG_LEVEL above to enable or disable these messages
MODM_LOG_DEBUG << "debug" << modm::endl;
MODM_LOG_INFO << "info" << modm::endl;
MODM_LOG_WARNING << "warning" << modm::endl;
MODM_LOG_ERROR << "error" << modm::endl;

uint32_t counter(0);

while (1)
{
Leds::write(1 << (counter % (Leds::width+1) ));
modm::delayMilliseconds(Button::read() ? 100 : 500);

MODM_LOG_INFO << "loop: " << counter++ << modm::endl;
}

return 0;
}
9 changes: 9 additions & 0 deletions examples/nucleo_f446re/blink/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<library>
<extends>modm:nucleo-f446re</extends>
<options>
<option name="modm:build:build.path">../../../build/nucleo_f446re/blink</option>
</options>
<modules>
<module>modm:build:scons</module>
</modules>
</library>

0 comments on commit f46b801

Please sign in to comment.