From 0d6a9374d5c67acc0f29da4ee4a3e4d454b8e250 Mon Sep 17 00:00:00 2001 From: Niklas Hauser Date: Wed, 20 Oct 2021 23:31:35 +0200 Subject: [PATCH] [example] Add NUCLEO-L053R8 blinky --- .github/workflows/linux.yml | 2 +- examples/nucleo_l053r8/blink/main.cpp | 40 ++++++++++++++++++++++++ examples/nucleo_l053r8/blink/project.xml | 9 ++++++ 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 examples/nucleo_l053r8/blink/main.cpp create mode 100644 examples/nucleo_l053r8/blink/project.xml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 282a49c26e..af2844526b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -119,7 +119,7 @@ jobs: - name: Examples STM32L0 Series if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py nucleo_l031k6) + (cd examples && ../tools/scripts/examples_compile.py nucleo_l031k6 nucleo_l053r8) - name: Examples STM32L1 Series if: always() run: | diff --git a/examples/nucleo_l053r8/blink/main.cpp b/examples/nucleo_l053r8/blink/main.cpp new file mode 100644 index 0000000000..27b5693d5a --- /dev/null +++ b/examples/nucleo_l053r8/blink/main.cpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2016-2017, Niklas Hauser + * Copyright (c) 2017, Nick Sarten + * + * 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(); + LedD13::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) + { + LedD13::toggle(); + modm::delay(Button::read() ? 100ms : 500ms); + + MODM_LOG_INFO << "loop: " << counter++ << modm::endl; + } + + return 0; +} diff --git a/examples/nucleo_l053r8/blink/project.xml b/examples/nucleo_l053r8/blink/project.xml new file mode 100644 index 0000000000..26c4d22848 --- /dev/null +++ b/examples/nucleo_l053r8/blink/project.xml @@ -0,0 +1,9 @@ + + modm:nucleo-l053r8 + + + + + modm:build:scons + +