From 897579e4913ae6c51deba542914027110fd1cdda Mon Sep 17 00:00:00 2001 From: Raphael Lehmann Date: Fri, 16 Apr 2021 02:30:38 +0200 Subject: [PATCH] [examples] Nucleo-L496ZG-P: minimal blink example --- .github/workflows/linux.yml | 2 +- examples/nucleo_l496zg-p/blink/main.cpp | 37 ++++++++++++++++++++++ examples/nucleo_l496zg-p/blink/project.xml | 10 ++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 examples/nucleo_l496zg-p/blink/main.cpp create mode 100644 examples/nucleo_l496zg-p/blink/project.xml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index c7f9b80eb3..9632b58010 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -118,7 +118,7 @@ jobs: - name: Examples STM32L4 Series if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py stm32l476_discovery nucleo_l476rg nucleo_l432kc nucleo_l452re) + (cd examples && ../tools/scripts/examples_compile.py stm32l476_discovery nucleo_l476rg nucleo_l432kc nucleo_l452re nucleo_l496zg-p) - name: Examples STM32G4 Series if: always() run: | diff --git a/examples/nucleo_l496zg-p/blink/main.cpp b/examples/nucleo_l496zg-p/blink/main.cpp new file mode 100644 index 0000000000..d1338a0993 --- /dev/null +++ b/examples/nucleo_l496zg-p/blink/main.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021, 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 + +using namespace Board; + +// ---------------------------------------------------------------------------- +int +main() +{ + Board::initialize(); + + 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(counter % (1 << 3)); + modm::delay(Button::read() ? 250ms : 500ms); + MODM_LOG_INFO << "loop: " << counter << modm::endl; + counter++; + } + + return 0; +} diff --git a/examples/nucleo_l496zg-p/blink/project.xml b/examples/nucleo_l496zg-p/blink/project.xml new file mode 100644 index 0000000000..b1ef87b9bd --- /dev/null +++ b/examples/nucleo_l496zg-p/blink/project.xml @@ -0,0 +1,10 @@ + + modm:nucleo-l496zg-p + + + + + modm:platform:gpio + modm:build:scons + +