From c38550a4b6f391feb96f7aa3b411a95046f75bfa Mon Sep 17 00:00:00 2001 From: Felix Petriconi Date: Mon, 11 May 2020 00:31:00 +0200 Subject: [PATCH] [examples] Add NUCLEO-F746ZG example --- .circleci/config.yml | 2 +- examples/nucleo_f746zg/blink/main.cpp | 40 ++++++++++++++++++++++++ examples/nucleo_f746zg/blink/project.xml | 9 ++++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100755 examples/nucleo_f746zg/blink/main.cpp create mode 100755 examples/nucleo_f746zg/blink/project.xml diff --git a/.circleci/config.yml b/.circleci/config.yml index 83121040d4..25330c979a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -93,7 +93,7 @@ jobs: - run: name: Examples STM32F7 Series command: | - (cd examples && ../tools/scripts/examples_compile.py stm32f746g_discovery stm32f769i_discovery) + (cd examples && ../tools/scripts/examples_compile.py stm32f746g_discovery stm32f769i_discovery nucleo_f746zg) - run: name: Examples STM32G0 Series command: | diff --git a/examples/nucleo_f746zg/blink/main.cpp b/examples/nucleo_f746zg/blink/main.cpp new file mode 100755 index 0000000000..205bc44743 --- /dev/null +++ b/examples/nucleo_f746zg/blink/main.cpp @@ -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 + +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 (true) + { + Leds::write(1 << (counter % (Leds::width+1) )); + modm::delay(Button::read() ? 100ms : 500ms); + + MODM_LOG_INFO << "loop: " << counter++ << modm::endl; + } + + return 0; +} diff --git a/examples/nucleo_f746zg/blink/project.xml b/examples/nucleo_f746zg/blink/project.xml new file mode 100755 index 0000000000..f35dffd1f0 --- /dev/null +++ b/examples/nucleo_f746zg/blink/project.xml @@ -0,0 +1,9 @@ + + modm:nucleo-f746zg + + + + + modm:build:scons + +