Skip to content

Commit

Permalink
[examples] Add Nucleo-G431KB blinky example
Browse files Browse the repository at this point in the history
  • Loading branch information
salkinium committed Nov 16, 2020
1 parent d362142 commit 276f5b3
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
name: Examples STM32G4 Series
when: always
command: |
(cd examples && ../tools/scripts/examples_compile.py nucleo_g474re)
(cd examples && ../tools/scripts/examples_compile.py nucleo_g431kb nucleo_g474re)
stm32f4-examples:
docker:
Expand Down
38 changes: 38 additions & 0 deletions examples/nucleo_g431kb/blink/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2019, Raphael Lehmann
*
* 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();

// 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 (true)
{
LedUser::toggle();
modm::delay(500ms);

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

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

0 comments on commit 276f5b3

Please sign in to comment.