diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 7036c52bd7..8d39d30988 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -92,15 +92,11 @@ jobs: - name: Examples SAMD Devices if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py feather_m4 samd samd21_xplained_pro) + (cd examples && ../tools/scripts/examples_compile.py feather_m4 samd) - name: Examples SAMG Devices if: always() run: | (cd examples && ../tools/scripts/examples_compile.py samg55_xplained_pro) - - name: Examples SAME5x Devices - if: always() - run: | - (cd examples && ../tools/scripts/examples_compile.py same54_xplained_pro) - name: Examples SAME70 Devices if: always() run: | @@ -112,7 +108,7 @@ jobs: - name: Examples RP20 Devices if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py feather_rp2040 rp_pico thingplus_rp2040) + (cd examples && ../tools/scripts/examples_compile.py rp_pico) - name: Execute Python Scripts if: always() run: | @@ -138,51 +134,43 @@ jobs: - name: Examples STM32F0 Series if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py stm32f0_discovery stm32f072_discovery nucleo_f031k6 nucleo_f072rb nucleo_f091rc nucleo_f042k6 stm32f030f4p6_demo_board) + (cd examples && ../tools/scripts/examples_compile.py stm32f0_discovery stm32f072_discovery nucleo_f072rb nucleo_f042k6 stm32f030f4p6_demo_board) - name: Examples STM32F1 Series if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py stm32f1_discovery nucleo_f103rb olimexino_stm32 blue_pill_f103 black_pill_f103) + (cd examples && ../tools/scripts/examples_compile.py stm32f1_discovery nucleo_f103rb blue_pill_f103) - name: Examples STM32F3 Series if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py stm32f3_discovery nucleo_f303k8 nucleo_f303re nucleo_f334r8) + (cd examples && ../tools/scripts/examples_compile.py stm32f3_discovery nucleo_f303re) - name: Examples STM32F7 Series if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py stm32f746g_discovery stm32f769i_discovery nucleo_f746zg nucleo_f767zi) + (cd examples && ../tools/scripts/examples_compile.py stm32f746g_discovery stm32f769i_discovery nucleo_f767zi) - name: Examples STM32G0 Series if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py nucleo_g070rb nucleo_g071rb) + (cd examples && ../tools/scripts/examples_compile.py nucleo_g071rb) - name: Examples STM32L0 Series if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py nucleo_l031k6 nucleo_l053r8) - - name: Examples STM32L1 Series - if: always() - run: | - (cd examples && ../tools/scripts/examples_compile.py nucleo_l152re stm32l1_discovery) + (cd examples && ../tools/scripts/examples_compile.py nucleo_l031k6) - name: Examples STM32L4 Series if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py stm32l476_discovery nucleo_l476rg nucleo_l432kc nucleo_l452re nucleo_l496zg-p) + (cd examples && ../tools/scripts/examples_compile.py nucleo_l476rg nucleo_l432kc nucleo_l452re) - name: Examples STM32L5 Series if: always() run: | (cd examples && ../tools/scripts/examples_compile.py nucleo_l552ze-q) - - name: Examples STM32U5 Series - if: always() - run: | - (cd examples && ../tools/scripts/examples_compile.py nucleo_u575zi-q) - name: Examples STM32G4 Series if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py nucleo_g474re nucleo_g431rb nucleo_g431kb) + (cd examples && ../tools/scripts/examples_compile.py nucleo_g474re) - name: Examples STM32H7 Series if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py nucleo_h743zi nucleo_h723zg stm32h750vbt6_devebox) + (cd examples && ../tools/scripts/examples_compile.py nucleo_h723zg) stm32f4-examples-1: runs-on: ubuntu-22.04 @@ -202,7 +190,7 @@ jobs: - name: Examples STM32F4 Only Discovery Board if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py stm32f4_discovery stm32f429_discovery stm32f469_discovery stm32f401_discovery) + (cd examples && ../tools/scripts/examples_compile.py stm32f4_discovery stm32f469_discovery stm32f401_discovery) stm32f4-examples-2: runs-on: ubuntu-22.04 @@ -225,7 +213,7 @@ jobs: - name: Examples STM32F4 Without Discovery Board if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py nucleo_f401re nucleo_f411re nucleo_f429zi nucleo_f446re nucleo_f446ze nucleo_f439zi black_pill_f401 black_pill_f411 stm32f407vet6_devebox stm32_f4ve) + (cd examples && ../tools/scripts/examples_compile.py nucleo_f401re nucleo_f411re nucleo_f429zi nucleo_f446re nucleo_f446ze nucleo_f439zi stm32f407vet6_devebox stm32_f4ve) avr-examples: runs-on: ubuntu-22.04 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 81caab334b..5d833af92f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -70,13 +70,18 @@ jobs: run: | (cd examples && ../tools/scripts/examples_compile.py linux) - - name: Compile STM32 Examples + - name: Generic Examples if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py nucleo_f031k6 nucleo_f103rb nucleo_f303re nucleo_f411re nucleo_f746zg) - (cd examples && ../tools/scripts/examples_compile.py nucleo_g071rb nucleo_l031k6 nucleo_l152re nucleo_l476rg nucleo_g474re) + (cd examples && ../tools/scripts/examples_compile.py generic) + + - name: Compile STM32 Discovery Examples + if: always() + run: | + (cd examples && ../tools/scripts/examples_compile.py stm32f0_discovery stm32f072_discovery stm32f1_discovery stm32f3_discovery stm32f4_discovery) + (cd examples && ../tools/scripts/examples_compile.py stm32f401_discovery stm32f469_discovery stm32f746g_discovery stm32f769i_discovery) - name: Compile AVR Examples if: always() run: | - (cd examples && ../tools/scripts/examples_compile.py avr) + (cd examples && ../tools/scripts/examples_compile.py avr arduino_nano arduino_uno srxe) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f5795822a4..127592943a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -100,24 +100,28 @@ jobs: with: submodules: 'recursive' - - name: Hosted Examples + - name: Hosted Unittests if: always() shell: bash run: | - (cd examples && python ../tools/scripts/examples_compile.py linux/assert linux/block_device/ram linux/build_info linux/git linux/logger linux/printf linux/etl linux/fiber) + (cd test && make run-hosted-windows) - - name: Hosted Unittests + - name: Hosted Examples if: always() shell: bash run: | - (cd test && make run-hosted-windows) + (cd examples && python ../tools/scripts/examples_compile.py linux) - - name: Compile STM32 Examples + - name: Generic Examples + if: always() + run: | + (cd examples && ../tools/scripts/examples_compile.py generic) + + - name: Compile STM32 Discovery Examples if: always() - shell: bash run: | - (cd examples && python ../tools/scripts/examples_compile.py nucleo_f031k6 nucleo_f103rb nucleo_f303re nucleo_f411re nucleo_f746zg) - (cd examples && python ../tools/scripts/examples_compile.py nucleo_g071rb nucleo_l031k6 nucleo_l152re nucleo_l476rg nucleo_g474re) + (cd examples && ../tools/scripts/examples_compile.py stm32f0_discovery stm32f072_discovery stm32f1_discovery stm32f3_discovery stm32f4_discovery) + (cd examples && ../tools/scripts/examples_compile.py stm32f401_discovery stm32f469_discovery stm32f746g_discovery stm32f769i_discovery) - name: Compile AVR Examples if: always() diff --git a/examples/README.md b/examples/README.md index bdec775371..72fae7f3de 100644 --- a/examples/README.md +++ b/examples/README.md @@ -18,7 +18,7 @@ Change directory into any of the examples and compile it: ```sh # cd into any example you like -cd modm/examples/generic/blinky +cd modm/examples/core/blinky # generate modm library (call only once) lbuild build # compile the example @@ -56,6 +56,69 @@ Have a look at the [build system documentation][build_docs] and the [online documentation][docs]. +## Structure + +- core + - custom_allocator + - delay + - exceptions_rtti + - fiber + - flash + - hard_fault + - itm + - multi-core + - resumable + - rtt + - threadsafe_statics + - tlsf_allocator + - unaligned_access + - vector_table_ram +- gpio + - blinky + - exti + - gpio + - ports +- analog + - adc_dma + - comp + - dac +- timer + - encoder_input + - pwm + - timer +- logging + - logger + - printf + - uart +- ui + - game_of_life + - graphics +- driver + - can + - i2c + - single wire + - spi +- communication + - amnb + - ethernet_freertos + - nrf24 + - sab + - xpcc +- ext + - cmsis_dsp + - etl + - freertos + - nanopb + - usb + - usb_dfu + - usbfatfs + - lvgl + - ros +- board + - super custom board-specific examples + - ideally we get rid of this section + + ## Interesting Examples We have hundreds of examples but here are some of our favorite ones for our @@ -117,6 +180,12 @@ Here are some additional examples of displays and sensors we like: + +### Compiling Examples for Multiple Targets + + + + ### Copy Carefully When copying from our examples make sure to set the repository path correctly! @@ -134,10 +203,10 @@ The `modm/examples/lbuild.xml` file: When you write your own application, you must set this path yourself! --> - ../repo.lb + ../repo.lb - modm:docs + modm:docs ``` diff --git a/examples/arduino_nano/color/project.xml b/examples/arduino_nano/color/project.xml index 3a249e8797..252c4b400f 100644 --- a/examples/arduino_nano/color/project.xml +++ b/examples/arduino_nano/color/project.xml @@ -1,8 +1,5 @@ modm:arduino-nano - - - modm:build:scons modm:processing:protothread diff --git a/examples/arduino_nano/encoder_input_bitbang/project.xml b/examples/arduino_nano/encoder_input_bitbang/project.xml index 6a15971d34..e1c2fe4773 100644 --- a/examples/arduino_nano/encoder_input_bitbang/project.xml +++ b/examples/arduino_nano/encoder_input_bitbang/project.xml @@ -1,8 +1,5 @@ modm:arduino-nano - - - modm:build:scons modm:processing:timer diff --git a/examples/arduino_nano/printf/project.xml b/examples/arduino_nano/printf/project.xml index 121c387559..5581fa4c73 100644 --- a/examples/arduino_nano/printf/project.xml +++ b/examples/arduino_nano/printf/project.xml @@ -1,7 +1,6 @@ modm:arduino-nano - diff --git a/examples/arduino_uno/basic/analog_read_serial/project.xml b/examples/arduino_uno/basic/analog_read_serial/project.xml index fca2afa952..cdac186b02 100644 --- a/examples/arduino_uno/basic/analog_read_serial/project.xml +++ b/examples/arduino_uno/basic/analog_read_serial/project.xml @@ -1,8 +1,5 @@ modm:arduino-uno - - - modm:platform:adc modm:build:scons diff --git a/examples/arduino_uno/basic/blink/main.cpp b/examples/arduino_uno/basic/blink/main.cpp deleted file mode 100644 index 904d97b400..0000000000 --- a/examples/arduino_uno/basic/blink/main.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2013-2014, Kevin Läufer - * Copyright (c) 2013, 2016-2017, Niklas Hauser - * Copyright (c) 2014, Sascha Schade - * - * 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/. - */ -// ---------------------------------------------------------------------------- - -// Inspired by: http://arduino.cc/en/Tutorial/Blink - -#include - -int -main() -{ - Board::initialize(); - LedD13::setOutput(); - - while (true) - { - LedD13::set(); - modm::delay(1s); - LedD13::reset(); - modm::delay(1s); - } -} diff --git a/examples/arduino_uno/basic/blink/project.xml b/examples/arduino_uno/basic/blink/project.xml deleted file mode 100644 index e29d41ab2a..0000000000 --- a/examples/arduino_uno/basic/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:arduino-uno - - - - - modm:build:scons - - diff --git a/examples/arduino_uno/basic/digital_read_serial/project.xml b/examples/arduino_uno/basic/digital_read_serial/project.xml index ae364b05a0..aaa3d8241c 100644 --- a/examples/arduino_uno/basic/digital_read_serial/project.xml +++ b/examples/arduino_uno/basic/digital_read_serial/project.xml @@ -1,7 +1,6 @@ modm:arduino-uno - diff --git a/examples/arduino_uno/basic/read_analog_voltage/project.xml b/examples/arduino_uno/basic/read_analog_voltage/project.xml index c43285ab08..78544d24ec 100644 --- a/examples/arduino_uno/basic/read_analog_voltage/project.xml +++ b/examples/arduino_uno/basic/read_analog_voltage/project.xml @@ -1,7 +1,6 @@ modm:arduino-uno - diff --git a/examples/avr/1-wire/ds18b20/project.xml b/examples/avr/1-wire/ds18b20/project.xml index d76f2eac0f..5ab9c1ca76 100644 --- a/examples/avr/1-wire/ds18b20/project.xml +++ b/examples/avr/1-wire/ds18b20/project.xml @@ -2,7 +2,6 @@ - modm:driver:ds18b20 diff --git a/examples/avr/adc/basic/project.xml b/examples/avr/adc/basic/project.xml index 5b4f84c701..02ec057207 100644 --- a/examples/avr/adc/basic/project.xml +++ b/examples/avr/adc/basic/project.xml @@ -2,7 +2,6 @@ - modm:io diff --git a/examples/avr/adc/oversample/project.xml b/examples/avr/adc/oversample/project.xml index a94acf03ab..6ac7739236 100644 --- a/examples/avr/adc/oversample/project.xml +++ b/examples/avr/adc/oversample/project.xml @@ -2,7 +2,6 @@ - modm:driver:adc_sampler diff --git a/examples/avr/app_can2usb/project.xml b/examples/avr/app_can2usb/project.xml index c4a4667ae4..0b3497e4cf 100644 --- a/examples/avr/app_can2usb/project.xml +++ b/examples/avr/app_can2usb/project.xml @@ -2,7 +2,6 @@ - modm:architecture:delay diff --git a/examples/avr/assert/project.xml b/examples/avr/assert/project.xml index 9b27a92988..8fb1190652 100644 --- a/examples/avr/assert/project.xml +++ b/examples/avr/assert/project.xml @@ -1,7 +1,6 @@ modm:arduino-nano - diff --git a/examples/avr/block_device_mirror/project.xml b/examples/avr/block_device_mirror/project.xml index bac86d8116..8f22138872 100644 --- a/examples/avr/block_device_mirror/project.xml +++ b/examples/avr/block_device_mirror/project.xml @@ -2,7 +2,6 @@ - diff --git a/examples/avr/can/mcp2515/project.xml b/examples/avr/can/mcp2515/project.xml index f0c7777fa4..b843540ba4 100644 --- a/examples/avr/can/mcp2515/project.xml +++ b/examples/avr/can/mcp2515/project.xml @@ -2,7 +2,6 @@ - diff --git a/examples/avr/can/mcp2515_uart/project.xml b/examples/avr/can/mcp2515_uart/project.xml index be0337d4aa..1796d010ca 100644 --- a/examples/avr/can/mcp2515_uart/project.xml +++ b/examples/avr/can/mcp2515_uart/project.xml @@ -2,7 +2,6 @@ - diff --git a/examples/avr/display/dogm128/benchmark/project.xml b/examples/avr/display/dogm128/benchmark/project.xml index d49ecd55a0..2937aaff56 100644 --- a/examples/avr/display/dogm128/benchmark/project.xml +++ b/examples/avr/display/dogm128/benchmark/project.xml @@ -2,7 +2,6 @@ - diff --git a/examples/avr/display/dogm128/caged_ball/project.xml b/examples/avr/display/dogm128/caged_ball/project.xml index cea6286622..c2b80a9728 100644 --- a/examples/avr/display/dogm128/caged_ball/project.xml +++ b/examples/avr/display/dogm128/caged_ball/project.xml @@ -2,7 +2,6 @@ - modm:driver:ea_dog diff --git a/examples/avr/display/dogm128/draw/project.xml b/examples/avr/display/dogm128/draw/project.xml index b6f250ad57..c2b80a9728 100644 --- a/examples/avr/display/dogm128/draw/project.xml +++ b/examples/avr/display/dogm128/draw/project.xml @@ -2,7 +2,6 @@ - modm:driver:ea_dog diff --git a/examples/avr/display/dogm128/image/project.xml b/examples/avr/display/dogm128/image/project.xml index d3f62a0517..6974c8113d 100644 --- a/examples/avr/display/dogm128/image/project.xml +++ b/examples/avr/display/dogm128/image/project.xml @@ -2,7 +2,6 @@ - diff --git a/examples/avr/display/dogm128/text/project.xml b/examples/avr/display/dogm128/text/project.xml index 01677ed2ee..47d2de485a 100644 --- a/examples/avr/display/dogm128/text/project.xml +++ b/examples/avr/display/dogm128/text/project.xml @@ -2,7 +2,6 @@ - modm:driver:ea_dog diff --git a/examples/avr/display/dogm128/touch/project.xml b/examples/avr/display/dogm128/touch/project.xml index 0ab2bd86e3..fc546bc1a9 100644 --- a/examples/avr/display/dogm128/touch/project.xml +++ b/examples/avr/display/dogm128/touch/project.xml @@ -2,7 +2,6 @@ - modm:driver:ea_dog diff --git a/examples/avr/display/dogm132/project.xml b/examples/avr/display/dogm132/project.xml index 91dce2d58b..5f429dad0d 100644 --- a/examples/avr/display/dogm132/project.xml +++ b/examples/avr/display/dogm132/project.xml @@ -2,7 +2,6 @@ - modm:driver:ea_dog diff --git a/examples/avr/display/dogm163/project.xml b/examples/avr/display/dogm163/project.xml index d1700bc654..603144304a 100644 --- a/examples/avr/display/dogm163/project.xml +++ b/examples/avr/display/dogm163/project.xml @@ -2,7 +2,6 @@ - modm:driver:ea_dog diff --git a/examples/avr/display/hd44780/project.xml b/examples/avr/display/hd44780/project.xml index 37e48bec39..a8fb80f547 100644 --- a/examples/avr/display/hd44780/project.xml +++ b/examples/avr/display/hd44780/project.xml @@ -2,7 +2,6 @@ - modm:driver:hd44780 diff --git a/examples/avr/display/siemens_s65/project.xml b/examples/avr/display/siemens_s65/project.xml index af4a99045a..caa734a3dd 100644 --- a/examples/avr/display/siemens_s65/project.xml +++ b/examples/avr/display/siemens_s65/project.xml @@ -2,7 +2,6 @@ - modm:driver:siemens_s65 diff --git a/examples/avr/fiber/main.cpp b/examples/avr/fiber/main.cpp deleted file mode 100644 index 89065e4270..0000000000 --- a/examples/avr/fiber/main.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2020, Erik Henriksson - * - * 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 -#include -#include - -using namespace Board; -using namespace std::chrono_literals; - -constexpr uint32_t cycles = 100'000; -volatile uint32_t f1counter = 0, f2counter = 0; -uint32_t total_counter=0; - -void -fiber_function1() -{ - MODM_LOG_INFO << MODM_FILE_INFO << modm::endl; - while (++f1counter < cycles) { modm::fiber::yield(); total_counter++; } -} - -void -fiber_function2(uint32_t cyc) -{ - MODM_LOG_INFO << MODM_FILE_INFO << modm::endl; - while (++f2counter < cyc) { modm::fiber::yield(); total_counter++; } -} - -struct Test -{ - void - fiber_function3() - { - MODM_LOG_INFO << MODM_FILE_INFO << modm::endl; - while (++f3counter < cycles) { modm::fiber::yield(); total_counter++; } - } - - void - fiber_function4(uint32_t cyc) - { - MODM_LOG_INFO << MODM_FILE_INFO << modm::endl; - while (++f4counter < cyc) { modm::fiber::yield(); total_counter++; } - } - - volatile uint32_t f3counter{0}; - volatile uint32_t f4counter{0}; -} test; - -modm::Fiber<> fiber1(fiber_function1); -modm::Fiber<> fiber2(+[](){ fiber_function2(cycles); }); -modm::Fiber<> fiber3(+[](){ test.fiber_function3(); }); -modm::Fiber<> fiber4([cyc=uint32_t(cycles)]() mutable { cyc++; test.fiber_function4(cyc); }); - -// ATmega2560@16MHz: 239996 yields in 2492668us, 96280 yields per second, 10386ns per yield -int -main() -{ - Board::initialize(); - Board::LedD13::setOutput(); - MODM_LOG_INFO << "Starting fiber modm::yield benchmark..." << modm::endl; - MODM_LOG_INFO.flush(); - - fiber1.watermark_stack(); - fiber2.watermark_stack(); - fiber3.watermark_stack(); - fiber4.watermark_stack(); - - const modm::PreciseTimestamp start = modm::PreciseClock::now(); - modm::fiber::Scheduler::run(); - const auto diff = (modm::PreciseClock::now() - start); - - MODM_LOG_INFO << "Benchmark done!" << modm::endl; - MODM_LOG_INFO << "Executed " << total_counter << " yields in " << diff << modm::endl; - MODM_LOG_INFO << uint32_t((total_counter * 1'000'000ull) / std::chrono::microseconds(diff).count()); - MODM_LOG_INFO << " yields per second, "; - MODM_LOG_INFO << uint32_t(std::chrono::nanoseconds(diff).count() / total_counter); - MODM_LOG_INFO << "ns per yield" << modm::endl; - - MODM_LOG_INFO << "Stack usage 1 = " << fiber1.stack_usage() << modm::endl; - MODM_LOG_INFO << "Stack usage 2 = " << fiber2.stack_usage() << modm::endl; - MODM_LOG_INFO << "Stack usage 3 = " << fiber3.stack_usage() << modm::endl; - MODM_LOG_INFO << "Stack usage 4 = " << fiber4.stack_usage() << modm::endl; - - while(1) ; - return 0; -} diff --git a/examples/avr/fiber/project.xml b/examples/avr/fiber/project.xml deleted file mode 100644 index d06e96568a..0000000000 --- a/examples/avr/fiber/project.xml +++ /dev/null @@ -1,12 +0,0 @@ - - modm:mega-2560-pro - - - - - - modm:build:scons - modm:processing:timer - modm:processing:fiber - - diff --git a/examples/avr/flash/project.xml b/examples/avr/flash/project.xml index 320a4384b9..25c47226b2 100644 --- a/examples/avr/flash/project.xml +++ b/examples/avr/flash/project.xml @@ -2,7 +2,6 @@ - modm:architecture:accessor diff --git a/examples/avr/gpio/basic/project.xml b/examples/avr/gpio/basic/project.xml index c88a919454..958c42b0e0 100644 --- a/examples/avr/gpio/basic/project.xml +++ b/examples/avr/gpio/basic/project.xml @@ -2,7 +2,6 @@ - modm:platform:core diff --git a/examples/avr/gpio/blinking/project.xml b/examples/avr/gpio/blinking/project.xml index 95416fa367..15fbad6080 100644 --- a/examples/avr/gpio/blinking/project.xml +++ b/examples/avr/gpio/blinking/project.xml @@ -2,7 +2,6 @@ - modm:architecture:delay diff --git a/examples/avr/gpio/button_group/project.xml b/examples/avr/gpio/button_group/project.xml index 6d5d088c01..613fdfc8ed 100644 --- a/examples/avr/gpio/button_group/project.xml +++ b/examples/avr/gpio/button_group/project.xml @@ -2,7 +2,6 @@ - modm:architecture:interrupt diff --git a/examples/avr/logger/project.xml b/examples/avr/logger/project.xml index 31b21ecd9b..73efafd8a8 100644 --- a/examples/avr/logger/project.xml +++ b/examples/avr/logger/project.xml @@ -2,7 +2,6 @@ - modm:debug diff --git a/examples/avr/mega_pro/project.xml b/examples/avr/mega_pro/project.xml index 4e1c2afb34..a40cdd1007 100644 --- a/examples/avr/mega_pro/project.xml +++ b/examples/avr/mega_pro/project.xml @@ -1,8 +1,5 @@ modm:mega-2560-pro - - - modm:build:scons diff --git a/examples/avr/ports/project.xml b/examples/avr/ports/project.xml index dd4e9e7755..39bdc96a71 100644 --- a/examples/avr/ports/project.xml +++ b/examples/avr/ports/project.xml @@ -1,7 +1,6 @@ modm:al-avreb-can - diff --git a/examples/avr/protothread/project.xml b/examples/avr/protothread/project.xml index 1dd52d5caf..322d1d30f9 100644 --- a/examples/avr/protothread/project.xml +++ b/examples/avr/protothread/project.xml @@ -2,7 +2,6 @@ - modm:platform:core diff --git a/examples/avr/pwm/pca9685/project.xml b/examples/avr/pwm/pca9685/project.xml index 9b51df4892..30dd56be87 100644 --- a/examples/avr/pwm/pca9685/project.xml +++ b/examples/avr/pwm/pca9685/project.xml @@ -2,7 +2,6 @@ - modm:driver:pca9685 diff --git a/examples/avr/qmc5883l/project.xml b/examples/avr/qmc5883l/project.xml index dd13835c4f..2d56cce1c8 100644 --- a/examples/avr/qmc5883l/project.xml +++ b/examples/avr/qmc5883l/project.xml @@ -1,8 +1,5 @@ modm:mega-2560-pro - - - modm:platform:i2c modm:driver:qmc5883l diff --git a/examples/avr/sab/master/project.xml b/examples/avr/sab/master/project.xml index 1bc58715d2..9c87e67442 100644 --- a/examples/avr/sab/master/project.xml +++ b/examples/avr/sab/master/project.xml @@ -2,7 +2,6 @@ - modm:communication:sab diff --git a/examples/avr/sab/slave/project.xml b/examples/avr/sab/slave/project.xml index a8f6a2c30a..8f598542e5 100644 --- a/examples/avr/sab/slave/project.xml +++ b/examples/avr/sab/slave/project.xml @@ -2,7 +2,6 @@ - modm:communication:sab diff --git a/examples/avr/timeout/project.xml b/examples/avr/timeout/project.xml index db4026f3a8..af353aa0a2 100644 --- a/examples/avr/timeout/project.xml +++ b/examples/avr/timeout/project.xml @@ -2,7 +2,6 @@ - modm:architecture:interrupt diff --git a/examples/avr/timer/project.xml b/examples/avr/timer/project.xml index 7c98a2c676..7bfaa951eb 100644 --- a/examples/avr/timer/project.xml +++ b/examples/avr/timer/project.xml @@ -1,7 +1,6 @@ modm:arduino-nano - diff --git a/examples/avr/uart/basic/project.xml b/examples/avr/uart/basic/project.xml index a879efd609..4df1958dc2 100644 --- a/examples/avr/uart/basic/project.xml +++ b/examples/avr/uart/basic/project.xml @@ -2,7 +2,6 @@ - modm:platform:clock diff --git a/examples/avr/uart/extended/project.xml b/examples/avr/uart/extended/project.xml index a744f63a23..7f318489a0 100644 --- a/examples/avr/uart/extended/project.xml +++ b/examples/avr/uart/extended/project.xml @@ -2,7 +2,6 @@ - modm:io diff --git a/examples/avr/xpcc/receiver/project.xml b/examples/avr/xpcc/receiver/project.xml index 6cf803d986..d0f3f432cf 100644 --- a/examples/avr/xpcc/receiver/project.xml +++ b/examples/avr/xpcc/receiver/project.xml @@ -3,7 +3,6 @@ - diff --git a/examples/avr/xpcc/sender/project.xml b/examples/avr/xpcc/sender/project.xml index 541f5698bc..6e39b03602 100644 --- a/examples/avr/xpcc/sender/project.xml +++ b/examples/avr/xpcc/sender/project.xml @@ -3,7 +3,6 @@ - diff --git a/examples/black_pill_f103/blink/main.cpp b/examples/black_pill_f103/blink/main.cpp deleted file mode 100644 index ddedac3bb7..0000000000 --- a/examples/black_pill_f103/blink/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2016, Sascha Schade - * Copyright (c) 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; - -/* - * Blinks the green user LED with 1 Hz. - * It is on for 90% of the time and off for 10% of the time. - */ - -int -main() -{ - Board::initialize(); - - LedGreen::set(); - - while (true) - { - LedGreen::set(); - modm::delay(900ms); - - LedGreen::reset(); - modm::delay(100ms); - } - - return 0; -} diff --git a/examples/black_pill_f103/blink/project.xml b/examples/black_pill_f103/blink/project.xml deleted file mode 100644 index 99e4bc5564..0000000000 --- a/examples/black_pill_f103/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:black-pill-f103 - - - - - - modm:build:scons - - diff --git a/examples/black_pill_f401/blink/main.cpp b/examples/black_pill_f401/blink/main.cpp deleted file mode 100644 index a075feac8c..0000000000 --- a/examples/black_pill_f401/blink/main.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2016, Sascha Schade - * Copyright (c) 2017, Niklas Hauser - * 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 - -using namespace Board; - -/* - * Blinks the user LED with 1 Hz - * or 5 Hz is the user button is pressed. - */ - -int -main() -{ - Board::initialize(); - - while (true) - { - Led::toggle(); - modm::delay(Button::read() ? 100ms : 500ms); - } - - return 0; -} diff --git a/examples/black_pill_f401/blink/project.xml b/examples/black_pill_f401/blink/project.xml deleted file mode 100644 index 0eb3c1b1e9..0000000000 --- a/examples/black_pill_f401/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:black-pill-f401 - - - - - modm:build:scons - - diff --git a/examples/black_pill_f411/blink/main.cpp b/examples/black_pill_f411/blink/main.cpp deleted file mode 100644 index 41a72dfeed..0000000000 --- a/examples/black_pill_f411/blink/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2016, Sascha Schade - * Copyright (c) 2017, Niklas Hauser - * 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 - -using namespace Board; - -/* - * Blinks the user LED with 1 Hz - * or 5 Hz is the user button is pressed. - */ - -int -main() -{ - Board::initialize(); - - Led::set(); - - while (true) - { - Led::toggle(); - modm::delay(Button::read() ? 100ms : 500ms); - } - - return 0; -} diff --git a/examples/black_pill_f411/blink/project.xml b/examples/black_pill_f411/blink/project.xml deleted file mode 100644 index 08d866fea7..0000000000 --- a/examples/black_pill_f411/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:black-pill-f411 - - - - - modm:build:scons - - diff --git a/examples/blue_pill_f103/adns_9800/project.xml b/examples/blue_pill_f103/adns_9800/project.xml index 4f54e9196d..bcaed737cc 100644 --- a/examples/blue_pill_f103/adns_9800/project.xml +++ b/examples/blue_pill_f103/adns_9800/project.xml @@ -1,7 +1,6 @@ modm:blue-pill-f103 - diff --git a/examples/blue_pill_f103/blink/main.cpp b/examples/blue_pill_f103/blink/main.cpp deleted file mode 100644 index ddedac3bb7..0000000000 --- a/examples/blue_pill_f103/blink/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2016, Sascha Schade - * Copyright (c) 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; - -/* - * Blinks the green user LED with 1 Hz. - * It is on for 90% of the time and off for 10% of the time. - */ - -int -main() -{ - Board::initialize(); - - LedGreen::set(); - - while (true) - { - LedGreen::set(); - modm::delay(900ms); - - LedGreen::reset(); - modm::delay(100ms); - } - - return 0; -} diff --git a/examples/blue_pill_f103/blink/openocd.cfg b/examples/blue_pill_f103/blink/openocd.cfg deleted file mode 100644 index b157e7e432..0000000000 --- a/examples/blue_pill_f103/blink/openocd.cfg +++ /dev/null @@ -1,2 +0,0 @@ -# Replace this with your custom programmer -source [find interface/stlink-v2.cfg] diff --git a/examples/blue_pill_f103/blink/project.xml b/examples/blue_pill_f103/blink/project.xml deleted file mode 100644 index 1bfb056e4e..0000000000 --- a/examples/blue_pill_f103/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:blue-pill-f103 - - - - - - modm:build:scons - - diff --git a/examples/blue_pill_f103/can/project.xml b/examples/blue_pill_f103/can/project.xml index 9864f5d235..b2fdf203a2 100644 --- a/examples/blue_pill_f103/can/project.xml +++ b/examples/blue_pill_f103/can/project.xml @@ -1,7 +1,6 @@ modm:blue-pill-f103 - diff --git a/examples/blue_pill_f103/encoder_input/project.xml b/examples/blue_pill_f103/encoder_input/project.xml index 34707ffb99..74b0510455 100644 --- a/examples/blue_pill_f103/encoder_input/project.xml +++ b/examples/blue_pill_f103/encoder_input/project.xml @@ -1,7 +1,6 @@ modm:blue-pill-f103 - diff --git a/examples/blue_pill_f103/encoder_input_bitbang/project.xml b/examples/blue_pill_f103/encoder_input_bitbang/project.xml index 717a9f9d8d..e587558141 100644 --- a/examples/blue_pill_f103/encoder_input_bitbang/project.xml +++ b/examples/blue_pill_f103/encoder_input_bitbang/project.xml @@ -1,7 +1,6 @@ modm:blue-pill-f103 - diff --git a/examples/blue_pill_f103/environment/project.xml b/examples/blue_pill_f103/environment/project.xml index a679f45f7c..33c4019884 100644 --- a/examples/blue_pill_f103/environment/project.xml +++ b/examples/blue_pill_f103/environment/project.xml @@ -1,7 +1,6 @@ modm:blue-pill-f103 - diff --git a/examples/blue_pill_f103/flash/openocd.cfg b/examples/blue_pill_f103/flash/openocd.cfg deleted file mode 100644 index b157e7e432..0000000000 --- a/examples/blue_pill_f103/flash/openocd.cfg +++ /dev/null @@ -1,2 +0,0 @@ -# Replace this with your custom programmer -source [find interface/stlink-v2.cfg] diff --git a/examples/blue_pill_f103/flash/project.xml b/examples/blue_pill_f103/flash/project.xml deleted file mode 100644 index 31b1ba5de2..0000000000 --- a/examples/blue_pill_f103/flash/project.xml +++ /dev/null @@ -1,16 +0,0 @@ - - modm:blue-pill-f103 - - - - - - modm:platform:gpio - modm:platform:flash - modm:debug - modm:platform:uart:2 - modm:processing:timer - modm:build:scons - modm:build:compilation_db - - diff --git a/examples/blue_pill_f103/graphics/project.xml b/examples/blue_pill_f103/graphics/project.xml index bacef55085..37752979c8 100644 --- a/examples/blue_pill_f103/graphics/project.xml +++ b/examples/blue_pill_f103/graphics/project.xml @@ -1,7 +1,6 @@ modm:blue-pill-f103 - diff --git a/examples/blue_pill_f103/itm/main.cpp b/examples/blue_pill_f103/itm/main.cpp deleted file mode 100644 index 6d1a262261..0000000000 --- a/examples/blue_pill_f103/itm/main.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2016, 2021, Sascha Schade - * Copyright (c) 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 -#include -#include - -using namespace Board; - -modm::IODeviceWrapper itm_device; -modm::IOStream stream(itm_device); - -/* - * Blinks the green user LED with 1 Hz and outputs the loop counter over ITM. - * SWO pin is PB3. openocd > 0.11.0 is required. Receive data with: - * scons log-itm fcpu=72000000 - */ - -int -main() -{ - Board::initialize(); - Itm::initialize(); - - stream << "Hello from the SWO." << modm::endl; - stream << "debug" << modm::endl; - stream << "info" << modm::endl; - stream << "warning" << modm::endl; - stream << "error" << modm::endl; - - LedGreen::set(); - - while (true) - { - static modm::PeriodicTimer tmr{500ms}; - - if (tmr.execute()) - { - LedGreen::toggle(); - - static uint32_t counter{0}; - stream << "loop: " << counter++ << modm::endl; - } - Itm::update(); - } - - return 0; -} diff --git a/examples/blue_pill_f103/itm/openocd.cfg b/examples/blue_pill_f103/itm/openocd.cfg deleted file mode 100644 index b157e7e432..0000000000 --- a/examples/blue_pill_f103/itm/openocd.cfg +++ /dev/null @@ -1,2 +0,0 @@ -# Replace this with your custom programmer -source [find interface/stlink-v2.cfg] diff --git a/examples/blue_pill_f103/itm/project.xml b/examples/blue_pill_f103/itm/project.xml deleted file mode 100644 index b231234f6e..0000000000 --- a/examples/blue_pill_f103/itm/project.xml +++ /dev/null @@ -1,14 +0,0 @@ - - modm:blue-pill-f103 - - - - - - - modm:build:scons - modm:debug - modm:platform:itm - modm:processing:timer - - diff --git a/examples/blue_pill_f103/logger/project.xml b/examples/blue_pill_f103/logger/project.xml index 04550dbc87..13a5fa0fe3 100644 --- a/examples/blue_pill_f103/logger/project.xml +++ b/examples/blue_pill_f103/logger/project.xml @@ -1,7 +1,6 @@ modm:blue-pill-f103 - diff --git a/examples/blue_pill_f103/rtt/main.cpp b/examples/blue_pill_f103/rtt/main.cpp deleted file mode 100644 index dccf0da86e..0000000000 --- a/examples/blue_pill_f103/rtt/main.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2021, Niklas Hauser - * Edited by Steven Macias - * - * 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 -#include -#include - -using namespace Board; - -Rtt rtt(0); -modm::IODeviceObjectWrapper< Rtt, modm::IOBuffer::DiscardIfFull > rtt_device(rtt); -// Set all four logger streams to use RTT -modm::log::Logger modm::log::debug(rtt_device); -modm::log::Logger modm::log::info(rtt_device); -modm::log::Logger modm::log::warning(rtt_device); -modm::log::Logger modm::log::error(rtt_device); - -#undef MODM_LOG_LEVEL -#define MODM_LOG_LEVEL modm::log::INFO - -/* - - $ scons log-rtt -╭───OpenOCD───> Real Time Transfer -╰─────RTT────── stm32f303vct6 -Info : STLINK V2J16S0 (API v2) VID:PID 0483:3748 -Info : stm32f3x.cpu: hardware has 6 breakpoints, 4 watchpoints -Info : rtt: Searching for control block 'SEGGER RTT' -Info : rtt: Control block found at 0x20000c04 -Info : Listening on port 9090 for rtt connections -Info -Warning -Error -loop: 0 -loop: 1 -loop: 2 -loop: 3 -loop: 4 -loop: 5 - - -Type number 0-9, then press enter to send. -The LED should blink slower or faster. - -Ctrl+D to exit - -*/ - -// ---------------------------------------------------------------------------- -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); - modm::PeriodicTimer tmr(100ms); - - char data; - while (true) - { - MODM_LOG_INFO.get(data); - switch(data) - { - case '0': - tmr.restart(1s); - break; - case '1'...'9': - tmr.restart(std::chrono::milliseconds((data - '0') * 100)); - break; - } - if (tmr.execute()) - { - LedGreen::toggle(); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - } - - return 0; -} diff --git a/examples/blue_pill_f103/rtt/openocd.cfg b/examples/blue_pill_f103/rtt/openocd.cfg deleted file mode 100644 index 2edce20b3d..0000000000 --- a/examples/blue_pill_f103/rtt/openocd.cfg +++ /dev/null @@ -1,2 +0,0 @@ -# Replace this with your custom programmer -source [find interface/stlink.cfg] diff --git a/examples/blue_pill_f103/rtt/project.xml b/examples/blue_pill_f103/rtt/project.xml deleted file mode 100644 index b4e74223df..0000000000 --- a/examples/blue_pill_f103/rtt/project.xml +++ /dev/null @@ -1,14 +0,0 @@ - - modm:blue-pill-f103 - - - - - - - modm:platform:rtt - modm:processing:timer - modm:build:scons - modm:debug - - diff --git a/examples/blue_pill_f103/servo_pwm/project.xml b/examples/blue_pill_f103/servo_pwm/project.xml index c62c69654f..067398fca6 100644 --- a/examples/blue_pill_f103/servo_pwm/project.xml +++ b/examples/blue_pill_f103/servo_pwm/project.xml @@ -1,7 +1,6 @@ modm:blue-pill-f103 - diff --git a/examples/blue_pill_f103/weight_scale_hx711/project.xml b/examples/blue_pill_f103/weight_scale_hx711/project.xml index 7858b9c500..0f0a3cf0b6 100644 --- a/examples/blue_pill_f103/weight_scale_hx711/project.xml +++ b/examples/blue_pill_f103/weight_scale_hx711/project.xml @@ -1,7 +1,6 @@ modm:blue-pill-f103 - diff --git a/examples/generic/delay/main.cpp b/examples/core/delay/main.cpp similarity index 100% rename from examples/generic/delay/main.cpp rename to examples/core/delay/main.cpp diff --git a/examples/generic/delay/project.xml b/examples/core/delay/project.xml similarity index 88% rename from examples/generic/delay/project.xml rename to examples/core/delay/project.xml index f839f46a81..d61d826ad1 100644 --- a/examples/generic/delay/project.xml +++ b/examples/core/delay/project.xml @@ -13,20 +13,21 @@ - modm:nucleo-l152re + - + - + modm:build:scons modm:debug modm:driver:cycle_counter + diff --git a/examples/generic/fiber/main.cpp b/examples/core/fiber/main.cpp similarity index 100% rename from examples/generic/fiber/main.cpp rename to examples/core/fiber/main.cpp diff --git a/examples/core/fiber/project.xml b/examples/core/fiber/project.xml new file mode 100644 index 0000000000..debfabacef --- /dev/null +++ b/examples/core/fiber/project.xml @@ -0,0 +1,29 @@ + + + + + + + modm:nucleo-f072rb + + + + + + + + + + + + + + + + + modm:build:scons + modm:processing:timer + modm:processing:fiber + modm:driver:cycle_counter + + diff --git a/examples/blue_pill_f103/flash/main.cpp b/examples/core/flash/main.cpp similarity index 88% rename from examples/blue_pill_f103/flash/main.cpp rename to examples/core/flash/main.cpp index 27a4ebac51..40b9b99957 100644 --- a/examples/blue_pill_f103/flash/main.cpp +++ b/examples/core/flash/main.cpp @@ -9,25 +9,15 @@ */ #include -#include #include using namespace std::chrono_literals; -modm::IODeviceWrapper< Usart2, modm::IOBuffer::BlockIfFull > loggerDevice; -modm::log::Logger modm::log::info(loggerDevice); - -// Set the log level -#undef MODM_LOG_LEVEL -#define MODM_LOG_LEVEL modm::log::INFO - // ---------------------------------------------------------------------------- int main() { Board::initialize(); - Usart2::connect(); - Usart2::initialize(); MODM_LOG_INFO << "\n\nReboot\n"; if (not Flash::unlock()) { @@ -46,7 +36,7 @@ main() { uint32_t err{0}; - const uint8_t sector_start = Flash::getSector(Flash::Size / 2); + const uint8_t sector_start = Flash::getSector(Flash::Size/2); const uint8_t sector_end = Flash::getSector(Flash::Size); MODM_LOG_INFO << "Erasing sectors [" << sector_start << ", " << sector_end << ")" << modm::endl; MODM_LOG_INFO.flush(); @@ -54,9 +44,8 @@ main() const modm::PreciseTimestamp start = modm::PreciseClock::now(); - for (uint8_t sector{sector_start}; sector < sector_end; sector++){ + for (uint8_t sector{sector_start}; sector < sector_end; sector++) err |= Flash::erase(sector); - } const auto diff = (modm::PreciseClock::now() - start); MODM_LOG_INFO << "Erasing done in " << diff << " with errors: " << err << modm::endl; diff --git a/examples/nucleo_f446re/flash/project.xml b/examples/core/flash/project.xml similarity index 51% rename from examples/nucleo_f446re/flash/project.xml rename to examples/core/flash/project.xml index 69f785966e..93750a1e98 100644 --- a/examples/nucleo_f446re/flash/project.xml +++ b/examples/core/flash/project.xml @@ -1,10 +1,10 @@ modm:nucleo-f446re - - - + + + + - modm:platform:gpio modm:platform:flash modm:processing:timer modm:build:scons diff --git a/examples/nucleo_f103rb/hard_fault/main.cpp b/examples/core/hard_fault/main.cpp similarity index 94% rename from examples/nucleo_f103rb/hard_fault/main.cpp rename to examples/core/hard_fault/main.cpp index ebe6c9b4d1..d7c028bdac 100644 --- a/examples/nucleo_f103rb/hard_fault/main.cpp +++ b/examples/core/hard_fault/main.cpp @@ -19,8 +19,6 @@ void function1(uint32_t bla) if (Button::read()) { // execute undefined instructed - // the hard fault handler will blink the blue LED - // or, if the debugger is connected, will trigger a breakpoint asm volatile (".short 0xde00"); } } @@ -69,9 +67,11 @@ main() MODM_LOG_INFO << "Hold Button to cause a Hardfault!" << modm::endl; +#ifdef CoreDebug_DHCSR_C_DEBUGEN_Msk if (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) { MODM_LOG_INFO << "Debugger connected!" << modm::endl; } +#endif while (true) { diff --git a/examples/core/hard_fault/project.xml b/examples/core/hard_fault/project.xml new file mode 100644 index 0000000000..3a8ce88cfe --- /dev/null +++ b/examples/core/hard_fault/project.xml @@ -0,0 +1,15 @@ + + modm:nucleo-f072rb + + + + + + + + + modm:platform:fault + modm:platform:heap + modm:build:scons + + diff --git a/examples/nucleo_l476rg/itm/main.cpp b/examples/core/itm/main.cpp similarity index 84% rename from examples/nucleo_l476rg/itm/main.cpp rename to examples/core/itm/main.cpp index d46fc8fabc..ce87336e34 100644 --- a/examples/nucleo_l476rg/itm/main.cpp +++ b/examples/core/itm/main.cpp @@ -15,6 +15,7 @@ using namespace Board; modm::IODeviceWrapper itm_device; +// Set all four logger streams to use ITM modm::IOStream stream(itm_device); int @@ -22,13 +23,9 @@ main() { Board::initialize(); Itm::initialize(); + Leds::setOutput(); stream << "Hello from the SWO." << modm::endl; - stream << "debug" << modm::endl; - stream << "info" << modm::endl; - stream << "warning" << modm::endl; - stream << "error" << modm::endl; - while (true) { @@ -36,7 +33,7 @@ main() if (tmr.execute()) { tmr.restart(Button::read() ? 100ms : 500ms); - LedGreen::toggle(); + Leds::toggle(); static uint32_t counter{0}; stream << "loop: " << counter++ << modm::endl; diff --git a/examples/nucleo_f303re/itm/project.xml b/examples/core/itm/project.xml similarity index 74% rename from examples/nucleo_f303re/itm/project.xml rename to examples/core/itm/project.xml index 244fd58fb7..11ca1823d9 100644 --- a/examples/nucleo_f303re/itm/project.xml +++ b/examples/core/itm/project.xml @@ -1,7 +1,8 @@ modm:nucleo-f303re + + - diff --git a/examples/generic/resumable/main.cpp b/examples/core/resumable/main.cpp similarity index 100% rename from examples/generic/resumable/main.cpp rename to examples/core/resumable/main.cpp diff --git a/examples/generic/resumable/project.xml b/examples/core/resumable/project.xml similarity index 74% rename from examples/generic/resumable/project.xml rename to examples/core/resumable/project.xml index c04c67c333..0fdd398093 100644 --- a/examples/generic/resumable/project.xml +++ b/examples/core/resumable/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l476rg - - - modm:architecture:delay modm:processing:protothread diff --git a/examples/stm32f3_discovery/rtt/main.cpp b/examples/core/rtt/main.cpp similarity index 98% rename from examples/stm32f3_discovery/rtt/main.cpp rename to examples/core/rtt/main.cpp index 2a4a6d4368..7aee27242f 100644 --- a/examples/stm32f3_discovery/rtt/main.cpp +++ b/examples/core/rtt/main.cpp @@ -59,6 +59,7 @@ int main() { Board::initialize(); + Leds::setOutput(); MODM_LOG_DEBUG << "Debug" << modm::endl; MODM_LOG_INFO << "Info" << modm::endl; @@ -83,7 +84,7 @@ main() } if (tmr.execute()) { - LedNorth::toggle(); + Leds::toggle(); MODM_LOG_INFO << "loop: " << counter++ << modm::endl; } diff --git a/examples/stm32f3_discovery/rtt/project.xml b/examples/core/rtt/project.xml similarity index 50% rename from examples/stm32f3_discovery/rtt/project.xml rename to examples/core/rtt/project.xml index 1964b37101..dc89d74f1b 100644 --- a/examples/stm32f3_discovery/rtt/project.xml +++ b/examples/core/rtt/project.xml @@ -1,8 +1,12 @@ modm:disco-f303vc + + - + + + modm:platform:rtt diff --git a/examples/generic/rtc_ds1302/main.cpp b/examples/driver/ds1302/main.cpp similarity index 100% rename from examples/generic/rtc_ds1302/main.cpp rename to examples/driver/ds1302/main.cpp diff --git a/examples/generic/rtc_ds1302/project.xml b/examples/driver/ds1302/project.xml similarity index 65% rename from examples/generic/rtc_ds1302/project.xml rename to examples/driver/ds1302/project.xml index 1591ad83b1..3e2e453174 100644 --- a/examples/generic/rtc_ds1302/project.xml +++ b/examples/driver/ds1302/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l476rg - - - modm:driver:ds1302 modm:processing:timer diff --git a/examples/generic/i2c_multiplex/main.cpp b/examples/driver/i2c_multiplex/main.cpp similarity index 100% rename from examples/generic/i2c_multiplex/main.cpp rename to examples/driver/i2c_multiplex/main.cpp diff --git a/examples/generic/i2c_multiplex/project.xml b/examples/driver/i2c_multiplex/project.xml similarity index 100% rename from examples/generic/i2c_multiplex/project.xml rename to examples/driver/i2c_multiplex/project.xml diff --git a/examples/nucleo_f042k6/lis3mdl/main.cpp b/examples/driver/lis3mdl/main.cpp similarity index 65% rename from examples/nucleo_f042k6/lis3mdl/main.cpp rename to examples/driver/lis3mdl/main.cpp index 461a11c476..8885aab86b 100644 --- a/examples/nucleo_f042k6/lis3mdl/main.cpp +++ b/examples/driver/lis3mdl/main.cpp @@ -14,48 +14,35 @@ using namespace Board; using namespace std::chrono_literals; -using I2cSda = GpioA10; -using I2cScl = GpioA9; +// Create a sensor object with the address of the sensor built onto the Pololu AltIMU-10 v5 +modm::Lis3mdl sensor(0x1E); int main() { Board::initialize(); - LedD13::setOutput(); + Board::initializeI2c(); MODM_LOG_INFO << "LIS3MDL demo" << modm::endl; - I2cMaster1::connect(); - I2cMaster1::initialize(); - - // Create a sensor object with the adress of the sensor built onto the Pololu AltIMU-10 v5 - modm::Lis3mdl sensor(0x1E); - // Turn on and configure the magnetometer - bool success = RF_CALL_BLOCKING(sensor.configure(modm::lis3mdl::DataRate::Rate_5_Hz, - modm::lis3mdl::Scale::Scale_8_gauss)); - - - if(!success) + if(!RF_CALL_BLOCKING(sensor.configure(modm::lis3mdl::DataRate::Rate_5_Hz, + modm::lis3mdl::Scale::Scale_8_gauss))) { MODM_LOG_INFO << "Sensor could not be configured!" << modm::endl; } // Set the sensor to continous acquistion and turn on the temperature sensing - success = RF_CALL_BLOCKING(sensor.setMode(modm::lis3mdl::OperationMode::Continous)); - if(!success) + if(!RF_CALL_BLOCKING(sensor.setMode(modm::lis3mdl::OperationMode::Continous))) { MODM_LOG_INFO << "Sensor could not be started!" << modm::endl; } modm::Vector3f magVector; - while (true) { - //Read the sensor data and print it out - success = RF_CALL_BLOCKING(sensor.readMagnetometer(magVector)); - - if(success) + // Read the sensor data and print it out + if(RF_CALL_BLOCKING(sensor.readMagnetometer(magVector))) { MODM_LOG_INFO << "Magnetic Vector:" << modm::endl; MODM_LOG_INFO << "X: "<< magVector.x << " gauss" << modm::endl; diff --git a/examples/driver/lis3mdl/project.xml b/examples/driver/lis3mdl/project.xml new file mode 100644 index 0000000000..c6d7012776 --- /dev/null +++ b/examples/driver/lis3mdl/project.xml @@ -0,0 +1,27 @@ + + modm:nucleo-f031k6 + + + + + + + + + + + + + + + + + + + + + + modm:build:scons + modm:driver:lis3mdl + + diff --git a/examples/nucleo_f031k6/sk6812/main.cpp b/examples/driver/sk6812/main.cpp similarity index 88% rename from examples/nucleo_f031k6/sk6812/main.cpp rename to examples/driver/sk6812/main.cpp index a1285b7db3..f9b66b18be 100644 --- a/examples/nucleo_f031k6/sk6812/main.cpp +++ b/examples/driver/sk6812/main.cpp @@ -16,15 +16,15 @@ using namespace Board; -using Output = Board::D11; -modm::Sk6812w leds; +using Output = Board::spi::Sdo; +modm::Sk6812w leds; modm::ShortPeriodicTimer tmr{33ms}; int main() { Board::initialize(); - LedD13::setOutput(); + Leds::setOutput(); leds.initialize(); constexpr uint8_t max = 62; @@ -45,7 +45,7 @@ main() leds.write(); while(not tmr.execute()) ; - LedD13::toggle(); + Leds::toggle(); } return 0; diff --git a/examples/driver/sk6812/project.xml b/examples/driver/sk6812/project.xml new file mode 100644 index 0000000000..a482ff206c --- /dev/null +++ b/examples/driver/sk6812/project.xml @@ -0,0 +1,14 @@ + + + modm:nucleo-f031k6 + + + + + + + modm:build:scons + modm:driver:sk6812 + modm:ui:led + + diff --git a/examples/generic/etl/main.cpp b/examples/ext/etl/main.cpp similarity index 100% rename from examples/generic/etl/main.cpp rename to examples/ext/etl/main.cpp diff --git a/examples/generic/etl/project.xml b/examples/ext/etl/project.xml similarity index 60% rename from examples/generic/etl/project.xml rename to examples/ext/etl/project.xml index 6292a7cbb4..6d5ef7118d 100644 --- a/examples/generic/etl/project.xml +++ b/examples/ext/etl/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f439zi - - - modm:etl modm:build:scons diff --git a/examples/nucleo_f303re/rtos/main.cpp b/examples/ext/freertos/main.cpp similarity index 73% rename from examples/nucleo_f303re/rtos/main.cpp rename to examples/ext/freertos/main.cpp index 359c3301a2..ff52a2f5da 100644 --- a/examples/nucleo_f303re/rtos/main.cpp +++ b/examples/ext/freertos/main.cpp @@ -15,7 +15,6 @@ #include using namespace modm::platform; -using namespace modm::literals; /** * This example uses four threads to check if task switching works correctly. @@ -36,23 +35,24 @@ using namespace modm::literals; */ // ---------------------------------------------------------------------------- -template -class P: modm::rtos::Thread +class BlinkThread: modm::rtos::Thread { char c; + uint8_t position; + uint16_t delay; uint8_t i = 0; volatile float a = 10.f; public: - P(char c): Thread(2,1<<10), c(c) {} + BlinkThread(char c, uint16_t delay, uint8_t position) + : Thread(2, 1024), c{c}, position{position}, delay{delay} {} void run() { - Gpio::setOutput(); while (true) { - sleep(SleepTime * MILLISECONDS); + sleep(delay * MILLISECONDS); - Gpio::toggle(); + Board::Leds::write((1ul << position) ^ Board::Leds::read()); { static modm::rtos::Mutex lm; modm::rtos::MutexGuard m(lm); @@ -64,10 +64,10 @@ class P: modm::rtos::Thread } }; -P< Board::LedD13, 260 > p1('0'); -P< Board::LedD13, 260 + 10 > p2('a'); -P< Board::LedD13, 260 + 20 > p3('A'); -P< Board::LedD13, 260 + 30 > p4('!'); +BlinkThread p1('0', 260 , 0); +BlinkThread p2('a', 260 + 10, 1); +BlinkThread p3('A', 260 + 20, 2); +BlinkThread p4('!', 260 + 30, 3); // ---------------------------------------------------------------------------- @@ -75,6 +75,10 @@ int main() { Board::initialize(); + Board::Leds::setOutput(); + + MODM_LOG_INFO << "\n\nReboot: FreeRTOS blink example" << modm::endl; + modm::rtos::Scheduler::schedule(); return 0; } diff --git a/examples/ext/freertos/project.xml b/examples/ext/freertos/project.xml new file mode 100644 index 0000000000..d08f59b4f4 --- /dev/null +++ b/examples/ext/freertos/project.xml @@ -0,0 +1,21 @@ + + + modm:nucleo-f072rb + + + + + + + + + + + + + + modm:processing:rtos + modm:platform:heap + modm:build:scons + + diff --git a/examples/generic/ros/README.md b/examples/ext/ros/README.md similarity index 100% rename from examples/generic/ros/README.md rename to examples/ext/ros/README.md diff --git a/examples/generic/ros/can_bridge/README.md b/examples/ext/ros/can_bridge/README.md similarity index 100% rename from examples/generic/ros/can_bridge/README.md rename to examples/ext/ros/can_bridge/README.md diff --git a/examples/generic/ros/can_bridge/main.cpp b/examples/ext/ros/can_bridge/main.cpp similarity index 100% rename from examples/generic/ros/can_bridge/main.cpp rename to examples/ext/ros/can_bridge/main.cpp diff --git a/examples/black_pill_f103/blink/openocd.cfg b/examples/ext/ros/can_bridge/openocd.cfg similarity index 100% rename from examples/black_pill_f103/blink/openocd.cfg rename to examples/ext/ros/can_bridge/openocd.cfg diff --git a/examples/generic/ros/can_bridge/project.xml b/examples/ext/ros/can_bridge/project.xml similarity index 85% rename from examples/generic/ros/can_bridge/project.xml rename to examples/ext/ros/can_bridge/project.xml index 336bed37db..977293b5f5 100644 --- a/examples/generic/ros/can_bridge/project.xml +++ b/examples/ext/ros/can_bridge/project.xml @@ -1,7 +1,6 @@ modm:blue-pill-f103 - diff --git a/examples/generic/ros/environment/hardware.hpp b/examples/ext/ros/environment/hardware.hpp similarity index 100% rename from examples/generic/ros/environment/hardware.hpp rename to examples/ext/ros/environment/hardware.hpp diff --git a/examples/generic/ros/environment/main.cpp b/examples/ext/ros/environment/main.cpp similarity index 100% rename from examples/generic/ros/environment/main.cpp rename to examples/ext/ros/environment/main.cpp diff --git a/examples/generic/ros/environment/project.xml b/examples/ext/ros/environment/project.xml similarity index 86% rename from examples/generic/ros/environment/project.xml rename to examples/ext/ros/environment/project.xml index 67bb72a1d0..b5beeff593 100644 --- a/examples/generic/ros/environment/project.xml +++ b/examples/ext/ros/environment/project.xml @@ -1,7 +1,6 @@ modm:nucleo-l476rg - diff --git a/examples/generic/ros/environment/thread_bme280.cpp b/examples/ext/ros/environment/thread_bme280.cpp similarity index 100% rename from examples/generic/ros/environment/thread_bme280.cpp rename to examples/ext/ros/environment/thread_bme280.cpp diff --git a/examples/generic/ros/environment/thread_bme280.hpp b/examples/ext/ros/environment/thread_bme280.hpp similarity index 100% rename from examples/generic/ros/environment/thread_bme280.hpp rename to examples/ext/ros/environment/thread_bme280.hpp diff --git a/examples/generic/ros/environment/thread_display.cpp b/examples/ext/ros/environment/thread_display.cpp similarity index 100% rename from examples/generic/ros/environment/thread_display.cpp rename to examples/ext/ros/environment/thread_display.cpp diff --git a/examples/generic/ros/environment/thread_display.hpp b/examples/ext/ros/environment/thread_display.hpp similarity index 100% rename from examples/generic/ros/environment/thread_display.hpp rename to examples/ext/ros/environment/thread_display.hpp diff --git a/examples/generic/ros/sub_pub/main.cpp b/examples/ext/ros/sub_pub/main.cpp similarity index 100% rename from examples/generic/ros/sub_pub/main.cpp rename to examples/ext/ros/sub_pub/main.cpp diff --git a/examples/generic/ros/sub_pub/project.xml b/examples/ext/ros/sub_pub/project.xml similarity index 85% rename from examples/generic/ros/sub_pub/project.xml rename to examples/ext/ros/sub_pub/project.xml index b988021959..0ef4d550ca 100644 --- a/examples/generic/ros/sub_pub/project.xml +++ b/examples/ext/ros/sub_pub/project.xml @@ -1,7 +1,6 @@ modm:nucleo-l476rg - diff --git a/examples/generic/usb/main.cpp b/examples/ext/usb/main.cpp similarity index 100% rename from examples/generic/usb/main.cpp rename to examples/ext/usb/main.cpp diff --git a/examples/generic/usb/msc_disk.c b/examples/ext/usb/msc_disk.c similarity index 100% rename from examples/generic/usb/msc_disk.c rename to examples/ext/usb/msc_disk.c diff --git a/examples/generic/usb/project.xml b/examples/ext/usb/project.xml similarity index 76% rename from examples/generic/usb/project.xml rename to examples/ext/usb/project.xml index 4abc6e9b9f..75c0338892 100644 --- a/examples/generic/usb/project.xml +++ b/examples/ext/usb/project.xml @@ -11,14 +11,19 @@ + + + + + - - + + @@ -35,6 +40,7 @@ modm:io + diff --git a/examples/black_pill_f411/usbfatfs/ffconf_local.h b/examples/ext/usbfatfs/ffconf_local.h similarity index 100% rename from examples/black_pill_f411/usbfatfs/ffconf_local.h rename to examples/ext/usbfatfs/ffconf_local.h diff --git a/examples/black_pill_f411/usbfatfs/main.cpp b/examples/ext/usbfatfs/main.cpp similarity index 99% rename from examples/black_pill_f411/usbfatfs/main.cpp rename to examples/ext/usbfatfs/main.cpp index 0747979138..edb1115373 100644 --- a/examples/black_pill_f411/usbfatfs/main.cpp +++ b/examples/ext/usbfatfs/main.cpp @@ -93,7 +93,7 @@ check_for_update() { if (is_valid(&fil, fno.fsize)) { - Board::Led::set(); + Board::Leds::write(1); // We first copy the file into the last Flash section of 128kB. // It's not guaranteed that the file is stored in FatFs in *one* // continous chunk and we cannot access FatFs code in ram_apply!!! diff --git a/examples/black_pill_f411/usbfatfs/project.xml b/examples/ext/usbfatfs/project.xml similarity index 54% rename from examples/black_pill_f411/usbfatfs/project.xml rename to examples/ext/usbfatfs/project.xml index fe63d5aac3..023dfc8a55 100644 --- a/examples/black_pill_f411/usbfatfs/project.xml +++ b/examples/ext/usbfatfs/project.xml @@ -1,7 +1,7 @@ modm:black-pill-f411 + - @@ -11,5 +11,11 @@ modm:platform:flash modm:build:scons modm:math:utils + + + + + + diff --git a/examples/black_pill_f411/usbfatfs/ramdisk.cpp b/examples/ext/usbfatfs/ramdisk.cpp similarity index 100% rename from examples/black_pill_f411/usbfatfs/ramdisk.cpp rename to examples/ext/usbfatfs/ramdisk.cpp diff --git a/examples/feather_m4/blink/main.cpp b/examples/feather_m4/blink/main.cpp deleted file mode 100644 index e7c6a21108..0000000000 --- a/examples/feather_m4/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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() -{ - 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) - { - Led::toggle(); - modm::delay(500ms); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - - return 0; -} - diff --git a/examples/feather_m4/blink/project.xml b/examples/feather_m4/blink/project.xml deleted file mode 100644 index 96e9674f07..0000000000 --- a/examples/feather_m4/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:feather-m4 - - - - - modm:build:scons - modm:architecture:delay - - diff --git a/examples/feather_m4/neopixel/project.xml b/examples/feather_m4/neopixel/project.xml index be177c7bb7..927e24bc23 100644 --- a/examples/feather_m4/neopixel/project.xml +++ b/examples/feather_m4/neopixel/project.xml @@ -1,8 +1,5 @@ modm:feather-m4 - - - modm:build:scons modm:architecture:delay diff --git a/examples/feather_m4/usbserial/main.cpp b/examples/feather_m4/usbserial/main.cpp deleted file mode 100644 index 55d917ca77..0000000000 --- a/examples/feather_m4/usbserial/main.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2016-2017, Niklas Hauser - * Copyright (c) 2022, Christopher Durand - * Copyright (c) 2023, Thomas Rush - * - * 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 -#include - -using namespace Board; - -modm::IODeviceWrapper usb_io_device; -modm::IOStream usb_stream(usb_io_device); - -int -main() -{ - initialize(); - initializeUsbFs(); - - tusb_init(); - - uint32_t counter(0); - - modm::PeriodicTimer timer{500ms}; - - while (not timer.execute()) { - tud_task(); - } - - // it can be hard to catch this without the preceding delay - usb_stream << "Hello from USB" << modm::endl; - - while (true) - { - tud_task(); - if (timer.execute()) { - Led::toggle(); - usb_stream << "loop: " << counter++ << modm::endl; - } - } - - return 0; -} diff --git a/examples/feather_m4/usbserial/project.xml b/examples/feather_m4/usbserial/project.xml deleted file mode 100644 index ccf9dc7e8b..0000000000 --- a/examples/feather_m4/usbserial/project.xml +++ /dev/null @@ -1,12 +0,0 @@ - - modm:feather-m4 - - - - - - modm:tinyusb - modm:build:scons - modm:processing:timer - - diff --git a/examples/feather_rp2040/blink/main.cpp b/examples/feather_rp2040/blink/main.cpp deleted file mode 100644 index eece38f216..0000000000 --- a/examples/feather_rp2040/blink/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2016, Sascha Schade - * Copyright (c) 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; - -/* - * Blinks the green user LED with 1 Hz. - * It is on for 90% of the time and off for 10% of the time. - */ - -int -main() -{ - Board::initialize(); - - Led::setOutput(); - - while (true) - { - Led::set(); - modm::delay(900ms); - - Led::reset(); - modm::delay(100ms); - } - - return 0; -} diff --git a/examples/feather_rp2040/blink/project.xml b/examples/feather_rp2040/blink/project.xml deleted file mode 100644 index 91b87ef5a4..0000000000 --- a/examples/feather_rp2040/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:feather-rp2040 - - - - - modm:build:scons - - diff --git a/examples/generic/README.md b/examples/generic/README.md deleted file mode 100644 index 3e8db68453..0000000000 --- a/examples/generic/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Generic Examples for modm - -Over time many examples have been duplicated to many different dev boards. - -Up-to-date examples which run on different boards shall be consolidated -in this folder. Typically, only the dev board in project.cfg should be -replaced. A good example is blinky from -https://github.com/roboterclubaachen/getting-started-with-modm - -# List of examples - -| Example | External Hardware | Nucleo L476RG | Arduino Uno | -|:-------------------|:------------------------|:-----------------|:------------| -| Blinky( + Logger) | None | ✅ | ✅ | -| RTC DS1302 | RTC Module DS1302 | ✅ | ✅ | diff --git a/examples/generic/blinky/project.xml b/examples/generic/blinky/project.xml deleted file mode 100644 index ca7b76e203..0000000000 --- a/examples/generic/blinky/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:nucleo-l476rg - - - - - modm:architecture:delay - modm:build:scons - - diff --git a/examples/generic/fiber/project.xml b/examples/generic/fiber/project.xml deleted file mode 100644 index 6ba23ab424..0000000000 --- a/examples/generic/fiber/project.xml +++ /dev/null @@ -1,14 +0,0 @@ - - modm:nucleo-f429zi - - - - - - - modm:build:scons - modm:processing:timer - modm:processing:fiber - modm:driver:cycle_counter - - diff --git a/examples/generic/ros/can_bridge/openocd.cfg b/examples/generic/ros/can_bridge/openocd.cfg deleted file mode 100644 index b157e7e432..0000000000 --- a/examples/generic/ros/can_bridge/openocd.cfg +++ /dev/null @@ -1,2 +0,0 @@ -# Replace this with your custom programmer -source [find interface/stlink-v2.cfg] diff --git a/examples/generic/usb/openocd.cfg b/examples/generic/usb/openocd.cfg deleted file mode 100644 index b157e7e432..0000000000 --- a/examples/generic/usb/openocd.cfg +++ /dev/null @@ -1,2 +0,0 @@ -# Replace this with your custom programmer -source [find interface/stlink-v2.cfg] diff --git a/examples/generic/blinky/main.cpp b/examples/gpio/blinky/main.cpp similarity index 80% rename from examples/generic/blinky/main.cpp rename to examples/gpio/blinky/main.cpp index 8aed4ca6fd..8224512741 100644 --- a/examples/generic/blinky/main.cpp +++ b/examples/gpio/blinky/main.cpp @@ -10,18 +10,19 @@ */ #include -int main() +int +main() { Board::initialize(); Board::Leds::setOutput(); + static uint32_t counter(0); while (true) { - Board::Leds::toggle(); + Board::Leds::write(counter); modm::delay(Board::Button::read() ? 250ms : 500ms); #ifdef MODM_BOARD_HAS_LOGGER - static uint32_t counter(0); - MODM_LOG_INFO << "Loop counter: " << (counter++) << modm::endl; + MODM_LOG_INFO << "Loop counter: " << counter << modm::endl; #endif } return 0; diff --git a/examples/gpio/blinky/project.xml b/examples/gpio/blinky/project.xml new file mode 100644 index 0000000000..bfb2e19e9b --- /dev/null +++ b/examples/gpio/blinky/project.xml @@ -0,0 +1,75 @@ + + modm:nucleo-l476rg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + modm:architecture:delay + modm:build:scons + + diff --git a/examples/linux/assert/project.xml b/examples/linux/assert/project.xml index bc713408ef..8c942372bb 100644 --- a/examples/linux/assert/project.xml +++ b/examples/linux/assert/project.xml @@ -2,7 +2,6 @@ - modm:platform:core diff --git a/examples/linux/block_device/file/project.xml b/examples/linux/block_device/file/project.xml index 92e8d87d5f..1261579c7a 100644 --- a/examples/linux/block_device/file/project.xml +++ b/examples/linux/block_device/file/project.xml @@ -2,7 +2,6 @@ - modm:platform:core diff --git a/examples/linux/block_device/mirror/project.xml b/examples/linux/block_device/mirror/project.xml index 9f4224d5a9..c49d5d2a7e 100644 --- a/examples/linux/block_device/mirror/project.xml +++ b/examples/linux/block_device/mirror/project.xml @@ -2,7 +2,6 @@ - modm:platform:core diff --git a/examples/linux/block_device/ram/project.xml b/examples/linux/block_device/ram/project.xml index a7c25d2089..e0575c0ae3 100644 --- a/examples/linux/block_device/ram/project.xml +++ b/examples/linux/block_device/ram/project.xml @@ -2,7 +2,6 @@ - modm:platform:core diff --git a/examples/linux/build_info/project.xml b/examples/linux/build_info/project.xml index e093490cdb..03ee799822 100644 --- a/examples/linux/build_info/project.xml +++ b/examples/linux/build_info/project.xml @@ -2,7 +2,6 @@ - diff --git a/examples/linux/can_debugger/project.xml b/examples/linux/can_debugger/project.xml index 04f6279842..4c2090cc30 100644 --- a/examples/linux/can_debugger/project.xml +++ b/examples/linux/can_debugger/project.xml @@ -1,7 +1,6 @@ - modm:debug diff --git a/examples/linux/etl/project.xml b/examples/linux/etl/project.xml index d776773bbc..7cde194225 100644 --- a/examples/linux/etl/project.xml +++ b/examples/linux/etl/project.xml @@ -2,7 +2,6 @@ - modm:etl diff --git a/examples/linux/fiber/project.xml b/examples/linux/fiber/project.xml index 3933a79854..0ef6763fd1 100644 --- a/examples/linux/fiber/project.xml +++ b/examples/linux/fiber/project.xml @@ -2,7 +2,6 @@ - modm:debug diff --git a/examples/linux/git/project.xml b/examples/linux/git/project.xml index 1fb1b22f28..52904e84ae 100644 --- a/examples/linux/git/project.xml +++ b/examples/linux/git/project.xml @@ -2,7 +2,6 @@ - diff --git a/examples/linux/logger/project.xml b/examples/linux/logger/project.xml index 6075c7d2db..a1ede4258d 100644 --- a/examples/linux/logger/project.xml +++ b/examples/linux/logger/project.xml @@ -2,7 +2,6 @@ - modm:debug diff --git a/examples/linux/printf/project.xml b/examples/linux/printf/project.xml index 70094dfa15..e0edaeb94e 100644 --- a/examples/linux/printf/project.xml +++ b/examples/linux/printf/project.xml @@ -2,7 +2,6 @@ - diff --git a/examples/linux/serial_interface/project.xml b/examples/linux/serial_interface/project.xml index 43c4a55f5c..4ef6941352 100644 --- a/examples/linux/serial_interface/project.xml +++ b/examples/linux/serial_interface/project.xml @@ -1,7 +1,6 @@ - modm:platform:core diff --git a/examples/linux/static_serial_interface/project.xml b/examples/linux/static_serial_interface/project.xml index 5a9490b51e..4ef6941352 100644 --- a/examples/linux/static_serial_interface/project.xml +++ b/examples/linux/static_serial_interface/project.xml @@ -1,7 +1,6 @@ - modm:platform:core diff --git a/examples/linux/threads/project.xml b/examples/linux/threads/project.xml index 9554854329..2f5bfe5f9d 100644 --- a/examples/linux/threads/project.xml +++ b/examples/linux/threads/project.xml @@ -1,7 +1,6 @@ - modm:platform:core diff --git a/examples/nucleo_f031k6/blink/main.cpp b/examples/nucleo_f031k6/blink/main.cpp deleted file mode 100644 index 27b5693d5a..0000000000 --- a/examples/nucleo_f031k6/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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_f031k6/blink/project.xml b/examples/nucleo_f031k6/blink/project.xml deleted file mode 100644 index b54736503f..0000000000 --- a/examples/nucleo_f031k6/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-f031k6 - - - - - modm:build:scons - - diff --git a/examples/nucleo_f031k6/sk6812/project.xml b/examples/nucleo_f031k6/sk6812/project.xml deleted file mode 100644 index 376998bffb..0000000000 --- a/examples/nucleo_f031k6/sk6812/project.xml +++ /dev/null @@ -1,12 +0,0 @@ - - modm:nucleo-f031k6 - - - - - modm:build:scons - modm:driver:sk6812 - modm:platform:spi:1 - modm:ui:led - - diff --git a/examples/nucleo_f042k6/blink/main.cpp b/examples/nucleo_f042k6/blink/main.cpp deleted file mode 100644 index 27b5693d5a..0000000000 --- a/examples/nucleo_f042k6/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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_f042k6/blink/project.xml b/examples/nucleo_f042k6/blink/project.xml deleted file mode 100644 index 454d51723b..0000000000 --- a/examples/nucleo_f042k6/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-f042k6 - - - - - modm:build:scons - - diff --git a/examples/nucleo_f042k6/lis3mdl/project.xml b/examples/nucleo_f042k6/lis3mdl/project.xml deleted file mode 100644 index e03311dcad..0000000000 --- a/examples/nucleo_f042k6/lis3mdl/project.xml +++ /dev/null @@ -1,11 +0,0 @@ - - modm:nucleo-f042k6 - - - - - modm:build:scons - modm:driver:lis3mdl - modm:platform:i2c:1 - - diff --git a/examples/nucleo_f042k6/lp503x/project.xml b/examples/nucleo_f042k6/lp503x/project.xml index c0e3195964..2b036d0568 100644 --- a/examples/nucleo_f042k6/lp503x/project.xml +++ b/examples/nucleo_f042k6/lp503x/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f042k6 - - - modm:build:scons modm:driver:lp503x diff --git a/examples/nucleo_f042k6/lsm6ds33/project.xml b/examples/nucleo_f042k6/lsm6ds33/project.xml index d2766324d6..22049af9fc 100644 --- a/examples/nucleo_f042k6/lsm6ds33/project.xml +++ b/examples/nucleo_f042k6/lsm6ds33/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f042k6 - - - modm:build:scons modm:driver:lsm6ds33 diff --git a/examples/nucleo_f042k6/ms5837/project.xml b/examples/nucleo_f042k6/ms5837/project.xml index 68067ab3ab..6199777ba5 100644 --- a/examples/nucleo_f042k6/ms5837/project.xml +++ b/examples/nucleo_f042k6/ms5837/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f042k6 - - - modm:build:scons modm:driver:ms5837 diff --git a/examples/nucleo_f042k6/spi_dma/project.xml b/examples/nucleo_f042k6/spi_dma/project.xml index ce0fc964be..c3fae910e4 100644 --- a/examples/nucleo_f042k6/spi_dma/project.xml +++ b/examples/nucleo_f042k6/spi_dma/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f042k6 - - - modm:platform:gpio modm:platform:dma diff --git a/examples/nucleo_f042k6/tmp12x/project.xml b/examples/nucleo_f042k6/tmp12x/project.xml index 040aca166d..6d3b7784bc 100644 --- a/examples/nucleo_f042k6/tmp12x/project.xml +++ b/examples/nucleo_f042k6/tmp12x/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f042k6 - - - modm:build:scons modm:driver:tmp12x diff --git a/examples/nucleo_f042k6/vector_table_ram/project.xml b/examples/nucleo_f042k6/vector_table_ram/project.xml index 49051a08fe..56d8122756 100644 --- a/examples/nucleo_f042k6/vector_table_ram/project.xml +++ b/examples/nucleo_f042k6/vector_table_ram/project.xml @@ -1,7 +1,6 @@ modm:nucleo-f042k6 - diff --git a/examples/nucleo_f072rb/blink/main.cpp b/examples/nucleo_f072rb/blink/main.cpp deleted file mode 100644 index e7f726844d..0000000000 --- a/examples/nucleo_f072rb/blink/main.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2021, Thomas Sommer - * - * 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 -#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); - modm::ShortPeriodicTimer timer(1s); - - while (true) - { - if (timer.execute()) - { - LedD13::toggle(); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - } - - return 0; -} diff --git a/examples/nucleo_f072rb/blink/project.xml b/examples/nucleo_f072rb/blink/project.xml deleted file mode 100644 index 24d8c0704c..0000000000 --- a/examples/nucleo_f072rb/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:nucleo-f072rb - - - - - modm:build:scons - modm:processing:timer - - diff --git a/examples/nucleo_f072rb/iwdg/project.xml b/examples/nucleo_f072rb/iwdg/project.xml index b75648896d..f69d630c8f 100644 --- a/examples/nucleo_f072rb/iwdg/project.xml +++ b/examples/nucleo_f072rb/iwdg/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f072rb - - - modm:build:scons modm:platform:iwdg diff --git a/examples/nucleo_f091rc/blink/main.cpp b/examples/nucleo_f091rc/blink/main.cpp deleted file mode 100644 index f10affaca2..0000000000 --- a/examples/nucleo_f091rc/blink/main.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2021, 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 -#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); - modm::ShortPeriodicTimer timer(1s); - - while (true) - { - if (timer.execute()) - { - LedD13::toggle(); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - } - - return 0; -} diff --git a/examples/nucleo_f091rc/blink/project.xml b/examples/nucleo_f091rc/blink/project.xml deleted file mode 100644 index f47f080786..0000000000 --- a/examples/nucleo_f091rc/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:nucleo-f091rc - - - - - modm:build:scons - modm:processing:timer - - diff --git a/examples/nucleo_f103rb/blink/main.cpp b/examples/nucleo_f103rb/blink/main.cpp deleted file mode 100644 index 53ea9b38b8..0000000000 --- a/examples/nucleo_f103rb/blink/main.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 -#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); - modm::PrecisePeriodicTimer tmr(1.23456789s); - - while (true) - { - if (tmr.execute()) - { - LedD13::toggle(); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - } - - return 0; -} diff --git a/examples/nucleo_f103rb/blink/project.xml b/examples/nucleo_f103rb/blink/project.xml deleted file mode 100644 index 8dcd3f3a7e..0000000000 --- a/examples/nucleo_f103rb/blink/project.xml +++ /dev/null @@ -1,13 +0,0 @@ - - modm:nucleo-f103rb - - - - - ../generated/blink - - modm:build:scons - modm:build:make - modm:processing:timer - - diff --git a/examples/nucleo_f103rb/hard_fault/project.xml b/examples/nucleo_f103rb/hard_fault/project.xml deleted file mode 100644 index c07698d07f..0000000000 --- a/examples/nucleo_f103rb/hard_fault/project.xml +++ /dev/null @@ -1,12 +0,0 @@ - - modm:nucleo-f103rb - - - - - modm:platform:fault - modm:platform:heap - modm:build:scons - modm:build:make - - diff --git a/examples/nucleo_f103rb/itm/main.cpp b/examples/nucleo_f103rb/itm/main.cpp deleted file mode 100644 index a157d348a6..0000000000 --- a/examples/nucleo_f103rb/itm/main.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2019, 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 -#include - -using namespace Board; - -modm::IODeviceWrapper itm_device; -modm::IOStream stream(itm_device); - -int -main() -{ - Board::initialize(); - Itm::initialize(); - LedD13::setOutput(); - - stream << "Hello from the SWO." << modm::endl; - stream << "debug" << modm::endl; - stream << "info" << modm::endl; - stream << "warning" << modm::endl; - stream << "error" << modm::endl; - - - while (true) - { - static modm::PeriodicTimer tmr{500ms}; - if (tmr.execute()) - { - tmr.restart(Button::read() ? 100ms : 500ms); - LedD13::toggle(); - - static uint32_t counter{0}; - stream << "loop: " << counter++ << modm::endl; - } - Itm::update(); - } - - return 0; -} diff --git a/examples/nucleo_f103rb/itm/project.xml b/examples/nucleo_f103rb/itm/project.xml deleted file mode 100644 index 5c24d6899e..0000000000 --- a/examples/nucleo_f103rb/itm/project.xml +++ /dev/null @@ -1,13 +0,0 @@ - - modm:nucleo-f103rb - - - - - - modm:build:scons - modm:build:make - modm:platform:itm - modm:processing:timer - - diff --git a/examples/nucleo_f103rb/rtos/main.cpp b/examples/nucleo_f103rb/rtos/main.cpp deleted file mode 100644 index 85ceacb538..0000000000 --- a/examples/nucleo_f103rb/rtos/main.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2014, Georgi Grinshpun - * Copyright (c) 2014, Sascha Schade - * Copyright (c) 2015-2017, 2019 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 -#include - -using namespace modm::platform; - -/** - * This example uses four threads to check if task switching works correctly. - * - * What to expect? - * --------------- - * - All our LEDs blinking at different rates, about 3 to 4 Hz - * - A string at 115200 baud - * - * 0aA!1bB"2cC#3dD$4eE%5fF&6gG'7hH(8iI9)jJ0*aA1!bB2"cC - * - * Each thread prints out a sequence - * 0123456789 - * abcdefghij - * ABCDEFGHIJ - * !"#$%&'()* - * respectivly. - */ - -// ---------------------------------------------------------------------------- -template -class P: modm::rtos::Thread -{ - char c; - uint8_t i = 0; - volatile float a = 10.f; -public: - P(char c): Thread(2,1<<10), c(c) {} - - void run() - { - Gpio::setOutput(); - while (true) - { - sleep(SleepTime * MILLISECONDS); - - Gpio::toggle(); - { - static modm::rtos::Mutex lm; - modm::rtos::MutexGuard m(lm); - MODM_LOG_INFO << char(i + c); - } - i = (i+1)%10; - a *= 3.141f; - } - } -}; - -P< Board::LedD13, 260 > p1('0'); -P< Board::LedD13, 260 + 10 > p2('a'); -P< Board::LedD13, 260 + 20 > p3('A'); -P< Board::LedD13, 260 + 30 > p4('!'); - - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - modm::rtos::Scheduler::schedule(); - return 0; -} diff --git a/examples/nucleo_f103rb/rtos/project.xml b/examples/nucleo_f103rb/rtos/project.xml deleted file mode 100644 index 6223a9a004..0000000000 --- a/examples/nucleo_f103rb/rtos/project.xml +++ /dev/null @@ -1,11 +0,0 @@ - - modm:nucleo-f103rb - - - - - modm:processing:rtos - modm:platform:heap - modm:build:scons - - diff --git a/examples/nucleo_f103rb/stts22h/project.xml b/examples/nucleo_f103rb/stts22h/project.xml index 71d25370ae..d5f08e8966 100644 --- a/examples/nucleo_f103rb/stts22h/project.xml +++ b/examples/nucleo_f103rb/stts22h/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f103rb - - - modm:build:scons modm:processing:timer diff --git a/examples/nucleo_f103rb/undefined_irq/project.xml b/examples/nucleo_f103rb/undefined_irq/project.xml index bc5fc6421b..5457542781 100644 --- a/examples/nucleo_f103rb/undefined_irq/project.xml +++ b/examples/nucleo_f103rb/undefined_irq/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f103rb - - - modm:build:scons modm:build:make diff --git a/examples/nucleo_f303k8/blink/main.cpp b/examples/nucleo_f303k8/blink/main.cpp deleted file mode 100644 index f7a7bcef2e..0000000000 --- a/examples/nucleo_f303k8/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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(); - 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_f303k8/blink/project.xml b/examples/nucleo_f303k8/blink/project.xml deleted file mode 100644 index 0a8e79cb76..0000000000 --- a/examples/nucleo_f303k8/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-f303k8 - - - - - modm:build:scons - - diff --git a/examples/nucleo_f303k8/rtos/main.cpp b/examples/nucleo_f303k8/rtos/main.cpp deleted file mode 100644 index 85ceacb538..0000000000 --- a/examples/nucleo_f303k8/rtos/main.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2014, Georgi Grinshpun - * Copyright (c) 2014, Sascha Schade - * Copyright (c) 2015-2017, 2019 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 -#include - -using namespace modm::platform; - -/** - * This example uses four threads to check if task switching works correctly. - * - * What to expect? - * --------------- - * - All our LEDs blinking at different rates, about 3 to 4 Hz - * - A string at 115200 baud - * - * 0aA!1bB"2cC#3dD$4eE%5fF&6gG'7hH(8iI9)jJ0*aA1!bB2"cC - * - * Each thread prints out a sequence - * 0123456789 - * abcdefghij - * ABCDEFGHIJ - * !"#$%&'()* - * respectivly. - */ - -// ---------------------------------------------------------------------------- -template -class P: modm::rtos::Thread -{ - char c; - uint8_t i = 0; - volatile float a = 10.f; -public: - P(char c): Thread(2,1<<10), c(c) {} - - void run() - { - Gpio::setOutput(); - while (true) - { - sleep(SleepTime * MILLISECONDS); - - Gpio::toggle(); - { - static modm::rtos::Mutex lm; - modm::rtos::MutexGuard m(lm); - MODM_LOG_INFO << char(i + c); - } - i = (i+1)%10; - a *= 3.141f; - } - } -}; - -P< Board::LedD13, 260 > p1('0'); -P< Board::LedD13, 260 + 10 > p2('a'); -P< Board::LedD13, 260 + 20 > p3('A'); -P< Board::LedD13, 260 + 30 > p4('!'); - - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - modm::rtos::Scheduler::schedule(); - return 0; -} diff --git a/examples/nucleo_f303k8/rtos/project.xml b/examples/nucleo_f303k8/rtos/project.xml deleted file mode 100644 index fbd693ec83..0000000000 --- a/examples/nucleo_f303k8/rtos/project.xml +++ /dev/null @@ -1,12 +0,0 @@ - - modm:nucleo-f303k8 - - - - - modm:processing:rtos - modm:platform:heap - modm:build:scons - modm:build:make - - diff --git a/examples/nucleo_f303re/blink/main.cpp b/examples/nucleo_f303re/blink/main.cpp deleted file mode 100644 index 2c38798a25..0000000000 --- a/examples/nucleo_f303re/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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(); - 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_ms(Button::read() ? 100 : 500); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - - return 0; -} diff --git a/examples/nucleo_f303re/blink/project.xml b/examples/nucleo_f303re/blink/project.xml deleted file mode 100644 index 0be0b70754..0000000000 --- a/examples/nucleo_f303re/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-f303re - - - - - modm:build:scons - - diff --git a/examples/nucleo_f303re/itm/main.cpp b/examples/nucleo_f303re/itm/main.cpp deleted file mode 100644 index a157d348a6..0000000000 --- a/examples/nucleo_f303re/itm/main.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2019, 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 -#include - -using namespace Board; - -modm::IODeviceWrapper itm_device; -modm::IOStream stream(itm_device); - -int -main() -{ - Board::initialize(); - Itm::initialize(); - LedD13::setOutput(); - - stream << "Hello from the SWO." << modm::endl; - stream << "debug" << modm::endl; - stream << "info" << modm::endl; - stream << "warning" << modm::endl; - stream << "error" << modm::endl; - - - while (true) - { - static modm::PeriodicTimer tmr{500ms}; - if (tmr.execute()) - { - tmr.restart(Button::read() ? 100ms : 500ms); - LedD13::toggle(); - - static uint32_t counter{0}; - stream << "loop: " << counter++ << modm::endl; - } - Itm::update(); - } - - return 0; -} diff --git a/examples/nucleo_f303re/rtos/project.xml b/examples/nucleo_f303re/rtos/project.xml deleted file mode 100644 index 4045801884..0000000000 --- a/examples/nucleo_f303re/rtos/project.xml +++ /dev/null @@ -1,11 +0,0 @@ - - modm:nucleo-f303re - - - - - modm:processing:rtos - modm:platform:heap - modm:build:scons - - diff --git a/examples/nucleo_f303re/spi_dma/project.xml b/examples/nucleo_f303re/spi_dma/project.xml index c7b7f33399..29a138ca18 100644 --- a/examples/nucleo_f303re/spi_dma/project.xml +++ b/examples/nucleo_f303re/spi_dma/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f303re - - - modm:platform:gpio modm:platform:dma diff --git a/examples/nucleo_f303re/temperature_mcp990x/project.xml b/examples/nucleo_f303re/temperature_mcp990x/project.xml index e78b5159d8..c35fcd1ca2 100644 --- a/examples/nucleo_f303re/temperature_mcp990x/project.xml +++ b/examples/nucleo_f303re/temperature_mcp990x/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f303re - - - modm:build:scons modm:platform:i2c:2 diff --git a/examples/nucleo_f334r8/blink/main.cpp b/examples/nucleo_f334r8/blink/main.cpp deleted file mode 100644 index 57453d9948..0000000000 --- a/examples/nucleo_f334r8/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2020, 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(); - 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_ms(Button::read() ? 100 : 500); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - - return 0; -} diff --git a/examples/nucleo_f334r8/blink/project.xml b/examples/nucleo_f334r8/blink/project.xml deleted file mode 100644 index a0c57d491d..0000000000 --- a/examples/nucleo_f334r8/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-f334r8 - - - - - modm:build:scons - - diff --git a/examples/nucleo_f401re/adc_dma/project.xml b/examples/nucleo_f401re/adc_dma/project.xml index 4b9b76268b..b59fd4c062 100644 --- a/examples/nucleo_f401re/adc_dma/project.xml +++ b/examples/nucleo_f401re/adc_dma/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f401re - - - modm:build:scons modm:platform:timer:1 diff --git a/examples/nucleo_f401re/blink/main.cpp b/examples/nucleo_f401re/blink/main.cpp deleted file mode 100644 index a350d65468..0000000000 --- a/examples/nucleo_f401re/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2016-2017, Niklas Hauser - * Copyright (c) 2017, Sascha Schade - * - * 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_f401re/blink/project.xml b/examples/nucleo_f401re/blink/project.xml deleted file mode 100644 index bfaa013a3b..0000000000 --- a/examples/nucleo_f401re/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-f401re - - - - - modm:build:scons - - diff --git a/examples/nucleo_f401re/distance_vl53l0/project.xml b/examples/nucleo_f401re/distance_vl53l0/project.xml index e06a51f19f..6adccc000e 100644 --- a/examples/nucleo_f401re/distance_vl53l0/project.xml +++ b/examples/nucleo_f401re/distance_vl53l0/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f401re - - - modm:debug modm:driver:vl53l0 diff --git a/examples/nucleo_f401re/timer_register_count/project.xml b/examples/nucleo_f401re/timer_register_count/project.xml index e6736e3c3f..8089eec588 100644 --- a/examples/nucleo_f401re/timer_register_count/project.xml +++ b/examples/nucleo_f401re/timer_register_count/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f401re - - - modm:build:scons modm:platform:timer:1 diff --git a/examples/nucleo_f411re/blink/main.cpp b/examples/nucleo_f411re/blink/main.cpp deleted file mode 100644 index f7a7bcef2e..0000000000 --- a/examples/nucleo_f411re/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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(); - 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_f411re/blink/project.xml b/examples/nucleo_f411re/blink/project.xml deleted file mode 100644 index 7f112cbbc6..0000000000 --- a/examples/nucleo_f411re/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-f411re - - - - - modm:build:scons - - diff --git a/examples/nucleo_f411re/imu_bno055/project.xml b/examples/nucleo_f411re/imu_bno055/project.xml index 146a01add6..0963ab3c03 100644 --- a/examples/nucleo_f411re/imu_bno055/project.xml +++ b/examples/nucleo_f411re/imu_bno055/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f411re - - - modm:debug modm:driver:bno055 diff --git a/examples/nucleo_f411re/radio/nrf24-basic-comm/project.xml b/examples/nucleo_f411re/radio/nrf24-basic-comm/project.xml index 8cce1d3add..76dcf82240 100644 --- a/examples/nucleo_f411re/radio/nrf24-basic-comm/project.xml +++ b/examples/nucleo_f411re/radio/nrf24-basic-comm/project.xml @@ -1,7 +1,4 @@ - - - modm:build:scons diff --git a/examples/nucleo_f411re/radio/nrf24-data/project.xml b/examples/nucleo_f411re/radio/nrf24-data/project.xml index 2aa29628d4..76dcf82240 100644 --- a/examples/nucleo_f411re/radio/nrf24-data/project.xml +++ b/examples/nucleo_f411re/radio/nrf24-data/project.xml @@ -1,7 +1,4 @@ - - - modm:build:scons diff --git a/examples/nucleo_f411re/radio/nrf24-phy-test/project.xml b/examples/nucleo_f411re/radio/nrf24-phy-test/project.xml index ef5818a8b1..76dcf82240 100644 --- a/examples/nucleo_f411re/radio/nrf24-phy-test/project.xml +++ b/examples/nucleo_f411re/radio/nrf24-phy-test/project.xml @@ -1,7 +1,4 @@ - - - modm:build:scons diff --git a/examples/nucleo_f411re/radio/nrf24-scanner/project.xml b/examples/nucleo_f411re/radio/nrf24-scanner/project.xml index 671be131c7..76dcf82240 100644 --- a/examples/nucleo_f411re/radio/nrf24-scanner/project.xml +++ b/examples/nucleo_f411re/radio/nrf24-scanner/project.xml @@ -1,7 +1,4 @@ - - - modm:build:scons diff --git a/examples/nucleo_f411re/rtos/main.cpp b/examples/nucleo_f411re/rtos/main.cpp deleted file mode 100644 index 85ceacb538..0000000000 --- a/examples/nucleo_f411re/rtos/main.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2014, Georgi Grinshpun - * Copyright (c) 2014, Sascha Schade - * Copyright (c) 2015-2017, 2019 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 -#include - -using namespace modm::platform; - -/** - * This example uses four threads to check if task switching works correctly. - * - * What to expect? - * --------------- - * - All our LEDs blinking at different rates, about 3 to 4 Hz - * - A string at 115200 baud - * - * 0aA!1bB"2cC#3dD$4eE%5fF&6gG'7hH(8iI9)jJ0*aA1!bB2"cC - * - * Each thread prints out a sequence - * 0123456789 - * abcdefghij - * ABCDEFGHIJ - * !"#$%&'()* - * respectivly. - */ - -// ---------------------------------------------------------------------------- -template -class P: modm::rtos::Thread -{ - char c; - uint8_t i = 0; - volatile float a = 10.f; -public: - P(char c): Thread(2,1<<10), c(c) {} - - void run() - { - Gpio::setOutput(); - while (true) - { - sleep(SleepTime * MILLISECONDS); - - Gpio::toggle(); - { - static modm::rtos::Mutex lm; - modm::rtos::MutexGuard m(lm); - MODM_LOG_INFO << char(i + c); - } - i = (i+1)%10; - a *= 3.141f; - } - } -}; - -P< Board::LedD13, 260 > p1('0'); -P< Board::LedD13, 260 + 10 > p2('a'); -P< Board::LedD13, 260 + 20 > p3('A'); -P< Board::LedD13, 260 + 30 > p4('!'); - - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - modm::rtos::Scheduler::schedule(); - return 0; -} diff --git a/examples/nucleo_f411re/rtos/project.xml b/examples/nucleo_f411re/rtos/project.xml deleted file mode 100644 index 3d7de69fcd..0000000000 --- a/examples/nucleo_f411re/rtos/project.xml +++ /dev/null @@ -1,11 +0,0 @@ - - modm:nucleo-f411re - - - - - modm:processing:rtos - modm:platform:heap - modm:build:scons - - diff --git a/examples/nucleo_f411re/sx1276_rx/project.xml b/examples/nucleo_f411re/sx1276_rx/project.xml index 7fc65465b5..c6ec9649df 100644 --- a/examples/nucleo_f411re/sx1276_rx/project.xml +++ b/examples/nucleo_f411re/sx1276_rx/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f411re - - - modm:build:scons modm:platform:spi:1 diff --git a/examples/nucleo_f411re/sx1276_tx/project.xml b/examples/nucleo_f411re/sx1276_tx/project.xml index 571712fbc8..c6ec9649df 100644 --- a/examples/nucleo_f411re/sx1276_tx/project.xml +++ b/examples/nucleo_f411re/sx1276_tx/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f411re - - - modm:build:scons modm:platform:spi:1 diff --git a/examples/nucleo_f429zi/adc_ads816x/project.xml b/examples/nucleo_f429zi/adc_ads816x/project.xml index 9b74055737..56985d2fa2 100644 --- a/examples/nucleo_f429zi/adc_ads816x/project.xml +++ b/examples/nucleo_f429zi/adc_ads816x/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:build:scons modm:platform:spi:1 diff --git a/examples/nucleo_f429zi/blink/main.cpp b/examples/nucleo_f429zi/blink/main.cpp deleted file mode 100644 index 205bc44743..0000000000 --- a/examples/nucleo_f429zi/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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_f429zi/blink/project.xml b/examples/nucleo_f429zi/blink/project.xml deleted file mode 100644 index ae5ada81c8..0000000000 --- a/examples/nucleo_f429zi/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-f429zi - - - - - modm:build:scons - - diff --git a/examples/nucleo_f429zi/cmsis_dsp/bayes/project.xml b/examples/nucleo_f429zi/cmsis_dsp/bayes/project.xml index 998cc284f6..4176e369f5 100644 --- a/examples/nucleo_f429zi/cmsis_dsp/bayes/project.xml +++ b/examples/nucleo_f429zi/cmsis_dsp/bayes/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:build:scons modm:cmsis:dsp:bayes diff --git a/examples/nucleo_f429zi/cmsis_dsp/class_marks/project.xml b/examples/nucleo_f429zi/cmsis_dsp/class_marks/project.xml index 9c18398010..06e38524a0 100644 --- a/examples/nucleo_f429zi/cmsis_dsp/class_marks/project.xml +++ b/examples/nucleo_f429zi/cmsis_dsp/class_marks/project.xml @@ -1,7 +1,6 @@ modm:nucleo-f429zi - diff --git a/examples/nucleo_f429zi/cmsis_dsp/convolution/project.xml b/examples/nucleo_f429zi/cmsis_dsp/convolution/project.xml index 42dca23bc6..946bc17c8e 100644 --- a/examples/nucleo_f429zi/cmsis_dsp/convolution/project.xml +++ b/examples/nucleo_f429zi/cmsis_dsp/convolution/project.xml @@ -1,7 +1,6 @@ modm:nucleo-f429zi - diff --git a/examples/nucleo_f429zi/cmsis_dsp/dotproduct/project.xml b/examples/nucleo_f429zi/cmsis_dsp/dotproduct/project.xml index 8e699c709e..0576c94f12 100644 --- a/examples/nucleo_f429zi/cmsis_dsp/dotproduct/project.xml +++ b/examples/nucleo_f429zi/cmsis_dsp/dotproduct/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:build:scons modm:build:make diff --git a/examples/nucleo_f429zi/cmsis_dsp/fft_bin/project.xml b/examples/nucleo_f429zi/cmsis_dsp/fft_bin/project.xml index 7ef92ce942..01b5890f3f 100644 --- a/examples/nucleo_f429zi/cmsis_dsp/fft_bin/project.xml +++ b/examples/nucleo_f429zi/cmsis_dsp/fft_bin/project.xml @@ -1,7 +1,6 @@ modm:nucleo-f429zi - diff --git a/examples/nucleo_f429zi/cmsis_dsp/fir/project.xml b/examples/nucleo_f429zi/cmsis_dsp/fir/project.xml index 9cb314f1e2..5de24274f4 100644 --- a/examples/nucleo_f429zi/cmsis_dsp/fir/project.xml +++ b/examples/nucleo_f429zi/cmsis_dsp/fir/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:build:scons modm:cmsis:dsp:filtering diff --git a/examples/nucleo_f429zi/cmsis_dsp/graphic_equalizer/project.xml b/examples/nucleo_f429zi/cmsis_dsp/graphic_equalizer/project.xml index 6ae108ce9b..fbc9d893eb 100644 --- a/examples/nucleo_f429zi/cmsis_dsp/graphic_equalizer/project.xml +++ b/examples/nucleo_f429zi/cmsis_dsp/graphic_equalizer/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:build:scons modm:cmsis:dsp:filtering diff --git a/examples/nucleo_f429zi/cmsis_dsp/linear_interp/project.xml b/examples/nucleo_f429zi/cmsis_dsp/linear_interp/project.xml index 4a0c8fbe2f..6a8dd4a2df 100644 --- a/examples/nucleo_f429zi/cmsis_dsp/linear_interp/project.xml +++ b/examples/nucleo_f429zi/cmsis_dsp/linear_interp/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:build:scons modm:build:make diff --git a/examples/nucleo_f429zi/cmsis_dsp/matrix/project.xml b/examples/nucleo_f429zi/cmsis_dsp/matrix/project.xml index 3d6c6a3b6d..65e80c4dbd 100644 --- a/examples/nucleo_f429zi/cmsis_dsp/matrix/project.xml +++ b/examples/nucleo_f429zi/cmsis_dsp/matrix/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:build:scons modm:cmsis:dsp:matrix diff --git a/examples/nucleo_f429zi/cmsis_dsp/signal_converge/project.xml b/examples/nucleo_f429zi/cmsis_dsp/signal_converge/project.xml index b81de0017a..f5f00cda7f 100644 --- a/examples/nucleo_f429zi/cmsis_dsp/signal_converge/project.xml +++ b/examples/nucleo_f429zi/cmsis_dsp/signal_converge/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:build:scons modm:cmsis:dsp:filtering diff --git a/examples/nucleo_f429zi/cmsis_dsp/sin_cos/project.xml b/examples/nucleo_f429zi/cmsis_dsp/sin_cos/project.xml index 6bc9a45a48..55d03d30ca 100644 --- a/examples/nucleo_f429zi/cmsis_dsp/sin_cos/project.xml +++ b/examples/nucleo_f429zi/cmsis_dsp/sin_cos/project.xml @@ -1,7 +1,6 @@ modm:nucleo-f429zi - diff --git a/examples/nucleo_f429zi/cmsis_dsp/svm/project.xml b/examples/nucleo_f429zi/cmsis_dsp/svm/project.xml index 38b0a20647..a9c68b962b 100644 --- a/examples/nucleo_f429zi/cmsis_dsp/svm/project.xml +++ b/examples/nucleo_f429zi/cmsis_dsp/svm/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:build:scons modm:cmsis:dsp:svm diff --git a/examples/nucleo_f429zi/cmsis_dsp/variance/project.xml b/examples/nucleo_f429zi/cmsis_dsp/variance/project.xml index 15ac691b6c..b14e3d2f46 100644 --- a/examples/nucleo_f429zi/cmsis_dsp/variance/project.xml +++ b/examples/nucleo_f429zi/cmsis_dsp/variance/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:build:scons modm:cmsis:dsp:basic_math diff --git a/examples/nucleo_f429zi/ethernet/project.xml b/examples/nucleo_f429zi/ethernet/project.xml index f661e8ab60..0bce1ab910 100755 --- a/examples/nucleo_f429zi/ethernet/project.xml +++ b/examples/nucleo_f429zi/ethernet/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:build:scons modm:freertos:tcp:lan8720a diff --git a/examples/nucleo_f429zi/freertos_static/project.xml b/examples/nucleo_f429zi/freertos_static/project.xml index 1d82f7d8a5..7ac20e87d4 100644 --- a/examples/nucleo_f429zi/freertos_static/project.xml +++ b/examples/nucleo_f429zi/freertos_static/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:freertos modm:build:scons diff --git a/examples/nucleo_f429zi/imu_adis16470/project.xml b/examples/nucleo_f429zi/imu_adis16470/project.xml index 5692204e28..c8ecb940a6 100644 --- a/examples/nucleo_f429zi/imu_adis16470/project.xml +++ b/examples/nucleo_f429zi/imu_adis16470/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:build:scons modm:platform:spi:1 diff --git a/examples/nucleo_f429zi/nanopb/project.xml b/examples/nucleo_f429zi/nanopb/project.xml index aef80dfb2f..fa06c5819d 100644 --- a/examples/nucleo_f429zi/nanopb/project.xml +++ b/examples/nucleo_f429zi/nanopb/project.xml @@ -1,7 +1,6 @@ modm:nucleo-f429zi - diff --git a/examples/nucleo_f429zi/pat9125el/project.xml b/examples/nucleo_f429zi/pat9125el/project.xml index e0cc9fc9f0..0545305110 100644 --- a/examples/nucleo_f429zi/pat9125el/project.xml +++ b/examples/nucleo_f429zi/pat9125el/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:driver:pat9125el modm:io diff --git a/examples/nucleo_f429zi/rtc_mcp7941x/project.xml b/examples/nucleo_f429zi/rtc_mcp7941x/project.xml index 7369a82fa4..ff3c8d3e76 100644 --- a/examples/nucleo_f429zi/rtc_mcp7941x/project.xml +++ b/examples/nucleo_f429zi/rtc_mcp7941x/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:driver:mcp7941x modm:io diff --git a/examples/nucleo_f429zi/spi_flash/project.xml b/examples/nucleo_f429zi/spi_flash/project.xml index 0f64d47b3b..3fb0c28828 100644 --- a/examples/nucleo_f429zi/spi_flash/project.xml +++ b/examples/nucleo_f429zi/spi_flash/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f429zi - - - modm:driver:block.device:spi.flash modm:platform:spi:1 diff --git a/examples/nucleo_f429zi/spi_flash_fatfs/project.xml b/examples/nucleo_f429zi/spi_flash_fatfs/project.xml index ba04e1a17d..2a6a9ec447 100644 --- a/examples/nucleo_f429zi/spi_flash_fatfs/project.xml +++ b/examples/nucleo_f429zi/spi_flash_fatfs/project.xml @@ -1,7 +1,6 @@ modm:nucleo-f429zi - diff --git a/examples/nucleo_f429zi/spistack_flash/project.xml b/examples/nucleo_f429zi/spistack_flash/project.xml index 29980df508..4cf81601d7 100644 --- a/examples/nucleo_f429zi/spistack_flash/project.xml +++ b/examples/nucleo_f429zi/spistack_flash/project.xml @@ -1,12 +1,9 @@ modm:nucleo-f429zi - - - modm:driver:block.device:spi.flash modm:driver:block.device:spi.stack.flash modm:platform:spi:1 modm:build:scons - \ No newline at end of file + diff --git a/examples/nucleo_f429zi/usb_freertos/project.xml b/examples/nucleo_f429zi/usb_freertos/project.xml index 1fca26d0fc..b90728245c 100644 --- a/examples/nucleo_f429zi/usb_freertos/project.xml +++ b/examples/nucleo_f429zi/usb_freertos/project.xml @@ -1,7 +1,6 @@ modm:nucleo-f429zi - diff --git a/examples/nucleo_f429zi/usbfatfs/ffconf_local.h b/examples/nucleo_f429zi/usbfatfs/ffconf_local.h deleted file mode 100644 index f68a42ef41..0000000000 --- a/examples/nucleo_f429zi/usbfatfs/ffconf_local.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2021, 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/. - */ - -#ifndef FFCONF_DEF -# error "Don't include this file directly, use 'ffconf.h' instead!" -#endif - -// Enable directory filtering: f_findfirst(), f_findnext() -#define FF_USE_FIND 1 - -// Enable Volume Formatting: f_mkfs() -#define FF_USE_MKFS 1 - -// Enable Volume Label: f_setlabel(), f_getlabel() -#define FF_USE_LABEL 1 - -// Enable tiny sector buffers -#define FF_FS_TINY 1 diff --git a/examples/nucleo_f429zi/usbfatfs/main.cpp b/examples/nucleo_f429zi/usbfatfs/main.cpp deleted file mode 100644 index be15abb772..0000000000 --- a/examples/nucleo_f429zi/usbfatfs/main.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2020, 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 -#include -#include -#include -#include - -/* You can test this by updating this firmware with itself: - -If you want to use the sanity check: - - scons bin && \ - cp ../../../build/nucleo_f429zi/usb_fatfs/scons-release/usbfatfs.bin . && \ - echo -n "F429" >> usbfatfs.bin && \ - crc32 usbfatfs.bin | xxd -r -p - >> usbfatfs.bin && \ - mv usbfatfs.bin /Volumes/MODM_USB - -Otherwise just copy the file as is and `#define WITH_SANITY_CHECK 0` - - scons bin && \ - cp ../../../build/nucleo_f429zi/usb_fatfs/scons-release/usbfatfs.bin /Volumes/MODM_USB - -*/ - -#define WITH_SANITY_CHECK 1 - -// ---------------------------------------------------------------------------- -modm_ramcode -void ram_apply(uint8_t pages, const uint8_t *image, uint32_t length) -{ - modm::atomic::Lock l; - // ONLY RAMCODE FROM HERE ON!!! - for (auto page{0u}; page <= pages; page++) - Flash::erase(page); - for (uintptr_t ptr{0}; ptr < length; ptr += sizeof(Flash::MaxWordType)) - Flash::program(Flash::OriginAddr + ptr, *(Flash::MaxWordType*)(image + ptr)); - NVIC_SystemReset(); -} - -bool is_valid(FIL *fil, size_t size) -{ -#if WITH_SANITY_CHECK - UINT read; - // Validate processor type string: - f_lseek(fil, size-8); - char type[5]; - f_read(fil, type, 4, &read); - if (memcmp(type, "F429", 4)) - return false; - // Validate CRC32 of the entire image - uint32_t file_crc; - f_read(fil, &file_crc, 4, &read); - file_crc = modm::swap(file_crc); - f_rewind(fil); - uint32_t crc{modm::math::crc32_init}; - for (FSIZE_t offset{0}; offset < size-4; offset++) - { - uint8_t data; - f_read(fil, &data, 1, &read); - crc = modm::math::crc32_update(crc, data); - } - f_rewind(fil); - return (~crc == file_crc); -#else - return true; -#endif -} - -void -check_for_update() -{ - // FAT12 max filename length is 8.3, so this is the max: - static const char *firmware_name = "USBFATFS.BIN"; - static constexpr uint8_t buffer_sector{7}; - // Note: This allocates all FatFs buffers *ON THE STACK*! - // It may be desirable to allocate them statically for your code! - if (FATFS fs; f_mount(&fs, "", 0) == FR_OK) - { - DIR dj; - if (FILINFO fno; f_findfirst(&dj, &fno, "", firmware_name) == FR_OK and fno.fname[0]) - { - if (FIL fil; f_open(&fil, firmware_name, FA_READ) == FR_OK) - { - if (is_valid(&fil, fno.fsize)) - { - Board::LedBlue::set(); - // We first copy the file into the middle of the flash. - // It's not guaranteed that the file is stored in FatFs in *one* - // continous chunk and we cannot access FatFs code in ram_apply!!! - Flash::unlock(); - uint32_t dst_addr{Flash::Size/2}; - for (auto page{Flash::getPage(dst_addr)}; - page <= Flash::getPage(dst_addr+fno.fsize); - page++) Flash::erase(page); - for (FSIZE_t offset{0}; offset < fno.fsize; - offset += sizeof(Flash::MaxWordType), - dst_addr += sizeof(Flash::MaxWordType)) - { - Flash::MaxWordType buffer; UINT read; - f_read(&fil, &buffer, sizeof(Flash::MaxWordType), &read); - Flash::program(dst_addr, buffer); - } - // Jump into RAM and copy from last flash page to first pages - ram_apply(Flash::getPage(fno.fsize), Flash::Origin + Flash::Size/2, fno.fsize); - } - f_close(&fil); - } - } - f_closedir(&dj); - f_mount(NULL, "", 1); - } -} - -void -initializeFatFs() -{ - FATFS fs; - uint8_t fatfs_buffer[FF_MAX_SS]; - f_mount(&fs, "", 0); - - // initialize ramdisk with Fat12 file system - MKFS_PARM param{FM_FAT | FM_SFD, 0, 0, 0, 0}; - f_mkfs("", ¶m, fatfs_buffer, sizeof(fatfs_buffer)); - f_setlabel("MODM_USB"); - - f_mount(NULL, "", 1); -} - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - Board::initializeUsbFs(); - initializeFatFs(); - tusb_init(); - - while (true) - { - tud_task(); - - static modm::PeriodicTimer tmr{1s}; - if (tmr.execute()) check_for_update(); - } - return 0; -} diff --git a/examples/nucleo_f429zi/usbfatfs/project.xml b/examples/nucleo_f429zi/usbfatfs/project.xml deleted file mode 100644 index 95b6c2f49f..0000000000 --- a/examples/nucleo_f429zi/usbfatfs/project.xml +++ /dev/null @@ -1,18 +0,0 @@ - - modm:nucleo-f429zi - - - - - - modm:processing:timer - modm:tinyusb - modm:fatfs - modm:platform:flash - modm:build:scons - modm:math:utils - - - CFG_TUSB_DEBUG=2 - - diff --git a/examples/nucleo_f429zi/usbfatfs/ramdisk.cpp b/examples/nucleo_f429zi/usbfatfs/ramdisk.cpp deleted file mode 100644 index 99da56a9ff..0000000000 --- a/examples/nucleo_f429zi/usbfatfs/ramdisk.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2020, 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 -#include -#include -#include - -// ---------------------------------------------------------------------------- -static constexpr uint32_t sector_size{512}; -static constexpr uint32_t sector_count{365}; -// Allocate giant array inside the SRAM1 noinit section -modm_section(".noinit_sram1") uint8_t ram_disk[sector_count * sector_size]; - -DSTATUS disk_initialize(BYTE pdrv) { return pdrv ? STA_NOINIT : 0; } -DSTATUS disk_status(BYTE pdrv) { return pdrv ? STA_NOINIT : 0; } -DRESULT disk_read(BYTE pdrv, BYTE *buff, LBA_t sector, UINT count) -{ - if (pdrv) return RES_NOTRDY; - memcpy(buff, ram_disk + sector * sector_size, count * sector_size); - return RES_OK; -} -DRESULT disk_write(BYTE pdrv, const BYTE *buff, LBA_t sector, UINT count) -{ - if (pdrv) return RES_NOTRDY; - memcpy(ram_disk + sector * sector_size, buff, count * sector_size); - return RES_OK; -} -DRESULT disk_ioctl(BYTE pdrv, BYTE ctrl, void *buff) -{ - if (pdrv) return RES_NOTRDY; - switch (ctrl) - { - case CTRL_SYNC: return RES_OK; - case GET_SECTOR_COUNT: *(LBA_t*)buff = sector_count; return RES_OK; - case GET_SECTOR_SIZE: *(WORD*) buff = sector_size; return RES_OK; - case GET_BLOCK_SIZE: *(DWORD*)buff = 64; return RES_OK; - default: return RES_PARERR; - } -} - -// ---------------------------------------------------------------------------- -// TinyUSB MSC callbacks also accessing the same RAM disk -#include - -void tud_msc_inquiry_cb(uint8_t, uint8_t vendor_id[8], uint8_t product_id[16], uint8_t product_rev[4]) -{ - const char vid[] = "TinyUSB"; - const char pid[] = "Mass Storage"; - const char rev[] = "1.0"; - memcpy(vendor_id , vid, strlen(vid)); - memcpy(product_id , pid, strlen(pid)); - memcpy(product_rev, rev, strlen(rev)); -} -bool tud_msc_test_unit_ready_cb(uint8_t) { return true; } -bool tud_msc_start_stop_cb(uint8_t, uint8_t, bool, bool) { return true; } -void tud_msc_capacity_cb(uint8_t, uint32_t* block_count, uint16_t* block_size) -{ - *block_count = sector_count; - *block_size = sector_size; -} -int32_t tud_msc_read10_cb(uint8_t, uint32_t lba, uint32_t offset, void* buffer, uint32_t bufsize) -{ - uint8_t const* addr = ram_disk + sector_size * lba + offset; - memcpy(buffer, addr, bufsize); - return bufsize; -} -int32_t tud_msc_write10_cb(uint8_t, uint32_t lba, uint32_t offset, uint8_t* buffer, uint32_t bufsize) -{ - uint8_t* addr = ram_disk + sector_size * lba + offset; - memcpy(addr, buffer, bufsize); - return bufsize; -} - -int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16], void* buffer, uint16_t bufsize) -{ - void const* response = NULL; - uint16_t resplen = 0; - bool in_xfer = true; - switch (scsi_cmd[0]) - { - case SCSI_CMD_PREVENT_ALLOW_MEDIUM_REMOVAL: - resplen = 0; - break; - - default: - tud_msc_set_sense(lun, SCSI_SENSE_ILLEGAL_REQUEST, 0x20, 0x00); - resplen = -1; - break; - } - if (resplen > bufsize) resplen = bufsize; - if (response and (resplen > 0) and in_xfer) - memcpy(buffer, response, resplen); - return resplen; -} diff --git a/examples/nucleo_f439zi/blink/main.cpp b/examples/nucleo_f439zi/blink/main.cpp deleted file mode 100644 index 205bc44743..0000000000 --- a/examples/nucleo_f439zi/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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_f439zi/blink/project.xml b/examples/nucleo_f439zi/blink/project.xml deleted file mode 100644 index 51980a818e..0000000000 --- a/examples/nucleo_f439zi/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-f439zi - - - - - modm:build:scons - - diff --git a/examples/nucleo_f439zi/spi_dma/project.xml b/examples/nucleo_f439zi/spi_dma/project.xml index b8ca489c20..1d35b2c721 100644 --- a/examples/nucleo_f439zi/spi_dma/project.xml +++ b/examples/nucleo_f439zi/spi_dma/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f439zi - - - modm:platform:gpio modm:platform:dma diff --git a/examples/nucleo_f446re/blink/main.cpp b/examples/nucleo_f446re/blink/main.cpp deleted file mode 100644 index 205bc44743..0000000000 --- a/examples/nucleo_f446re/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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_f446re/blink/project.xml b/examples/nucleo_f446re/blink/project.xml deleted file mode 100644 index 7903fa03e0..0000000000 --- a/examples/nucleo_f446re/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-f446re - - - - - modm:build:scons - - diff --git a/examples/nucleo_f446re/color/project.xml b/examples/nucleo_f446re/color/project.xml index b70f66949f..2b80c8af76 100644 --- a/examples/nucleo_f446re/color/project.xml +++ b/examples/nucleo_f446re/color/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f446re - - - modm:driver:tcs3472 modm:platform:i2c:1 diff --git a/examples/nucleo_f446re/flash/main.cpp b/examples/nucleo_f446re/flash/main.cpp deleted file mode 100644 index 4cefe0267c..0000000000 --- a/examples/nucleo_f446re/flash/main.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2020, 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 -#include - -using namespace std::chrono_literals; - -#undef MODM_LOG_LEVEL -#define MODM_LOG_LEVEL modm::log::INFO - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - - MODM_LOG_INFO << "\n\nReboot\n"; - if (not Flash::unlock()) { - MODM_LOG_INFO << "Flash unlock failed!" << modm::endl; - } - - for (uintptr_t offset{0}, sector{255}; offset < Flash::Size; offset += 1) - { - const uint8_t nsector = Flash::getSector(offset); - if (sector != nsector) { - MODM_LOG_INFO << "Sector " << nsector << " found at boundary " << - (Flash::Origin + offset) << modm::endl; - sector = nsector; - } - } - - { - uint32_t err{0}; - const uint8_t sector_start = Flash::getSector(Flash::Size/2); - const uint8_t sector_end = Flash::getSector(Flash::Size); - MODM_LOG_INFO << "Erasing sectors [" << sector_start << ", " << sector_end << ")" << modm::endl; - MODM_LOG_INFO.flush(); - modm::delay(1s); - - const modm::PreciseTimestamp start = modm::PreciseClock::now(); - - for (uint8_t sector{sector_start}; sector < sector_end; sector++) - err |= Flash::erase(sector); - - const auto diff = (modm::PreciseClock::now() - start); - MODM_LOG_INFO << "Erasing done in " << diff << " with errors: " << err << modm::endl; - MODM_LOG_INFO << "Erasing with " << (Flash::Size/2 / (diff.count() >> 10) ) << "kiB/s" << modm::endl; - MODM_LOG_INFO.flush(); - } - - { - uint32_t err{0}; - const modm::PreciseTimestamp start = modm::PreciseClock::now(); - for (uint32_t dst_addr{Flash::OriginAddr + Flash::Size/2}, src_addr{Flash::OriginAddr}; - src_addr < (Flash::OriginAddr + Flash::Size/2); - src_addr += sizeof(Flash::MaxWordType), dst_addr += sizeof(Flash::MaxWordType)) - { - err |= Flash::program(dst_addr, *(Flash::MaxWordType*)src_addr); - } - - const auto diff = (modm::PreciseClock::now() - start); - MODM_LOG_INFO << "Programming done in " << diff << " with errors: " << err << modm::endl; - MODM_LOG_INFO << "Programming with " << (Flash::Size/2 / (diff.count() >> 10) ) << "kiB/s" << modm::endl; - } - - while(1) ; - return 0; -} diff --git a/examples/nucleo_f446ze/blink/main.cpp b/examples/nucleo_f446ze/blink/main.cpp deleted file mode 100644 index 205bc44743..0000000000 --- a/examples/nucleo_f446ze/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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_f446ze/blink/project.xml b/examples/nucleo_f446ze/blink/project.xml deleted file mode 100644 index 787d0a0d74..0000000000 --- a/examples/nucleo_f446ze/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-f446ze - - - - - modm:build:scons - - diff --git a/examples/nucleo_f446ze/dac_basic/project.xml b/examples/nucleo_f446ze/dac_basic/project.xml index 7bd8b090f7..a11cbfddeb 100644 --- a/examples/nucleo_f446ze/dac_basic/project.xml +++ b/examples/nucleo_f446ze/dac_basic/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f446ze - - - modm:build:scons modm:platform:dac diff --git a/examples/nucleo_f446ze/dac_dma/project.xml b/examples/nucleo_f446ze/dac_dma/project.xml index 832c27fe72..0c1e6b82a6 100644 --- a/examples/nucleo_f446ze/dac_dma/project.xml +++ b/examples/nucleo_f446ze/dac_dma/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f446ze - - - modm:debug modm:platform:dac diff --git a/examples/nucleo_f446ze/usbserial/main.cpp b/examples/nucleo_f446ze/usbserial/main.cpp deleted file mode 100644 index 7f2cc95e3a..0000000000 --- a/examples/nucleo_f446ze/usbserial/main.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2020, Erik Henriksson - * Copyright (c) 2020, 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 - -#include -#include -#include - -using namespace Board; - -modm::IODeviceWrapper usb_io_device; -modm::IOStream usb_stream(usb_io_device); - -modm::PeriodicTimer tmr{2.5s}; - -// Invoked when device is mounted -void tud_mount_cb() { tmr.restart(1s); } -// Invoked when device is unmounted -void tud_umount_cb() { tmr.restart(250ms); } -// Invoked when usb bus is suspended -// remote_wakeup_en : if host allow us to perform remote wakeup -// Within 7ms, device must draw an average of current less than 2.5 mA from bus -void tud_suspend_cb(bool) { tmr.restart(2.5s); } -// Invoked when usb bus is resumed -void tud_resume_cb() { tmr.restart(1s); } - -int main() -{ - Board::initialize(); - Board::initializeUsbFs(); - - tusb_init(); - - uint8_t counter{0}; - while (true) - { - tud_task(); - - if (tmr.execute()) - { - Leds::toggle(); - usb_stream << "Hello World from USB: " << (counter++) << modm::endl; - } - } - - return 0; -} diff --git a/examples/nucleo_f446ze/usbserial/project.xml b/examples/nucleo_f446ze/usbserial/project.xml deleted file mode 100644 index e77739fc5a..0000000000 --- a/examples/nucleo_f446ze/usbserial/project.xml +++ /dev/null @@ -1,13 +0,0 @@ - - modm:nucleo-f446ze - - - - - - modm:build:scons - modm:tinyusb - modm:processing:timer - modm:io - - diff --git a/examples/nucleo_f746zg/blink/main.cpp b/examples/nucleo_f746zg/blink/main.cpp deleted file mode 100755 index 205bc44743..0000000000 --- a/examples/nucleo_f746zg/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 deleted file mode 100755 index f35dffd1f0..0000000000 --- a/examples/nucleo_f746zg/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-f746zg - - - - - modm:build:scons - - diff --git a/examples/nucleo_f767zi/blink/main.cpp b/examples/nucleo_f767zi/blink/main.cpp deleted file mode 100755 index 205bc44743..0000000000 --- a/examples/nucleo_f767zi/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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_f767zi/blink/project.xml b/examples/nucleo_f767zi/blink/project.xml deleted file mode 100755 index 13d0f39050..0000000000 --- a/examples/nucleo_f767zi/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-f767zi - - - - - modm:build:scons - - diff --git a/examples/nucleo_f767zi/ethernet/project.xml b/examples/nucleo_f767zi/ethernet/project.xml index 77967d8985..2f5ba9709b 100755 --- a/examples/nucleo_f767zi/ethernet/project.xml +++ b/examples/nucleo_f767zi/ethernet/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f767zi - - - modm:build:scons modm:freertos:tcp:lan8720a diff --git a/examples/nucleo_f767zi/freertos_blink/main.cpp b/examples/nucleo_f767zi/freertos_blink/main.cpp deleted file mode 100755 index ed4387e6aa..0000000000 --- a/examples/nucleo_f767zi/freertos_blink/main.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2020, Mike Wolfram - * - * 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 -#include - -using namespace Board; - -class BlinkTask : modm::rtos::Thread -{ -public: - BlinkTask() - : Thread(4, 2048, "blink") - {} - - void - run() - { - Leds::setOutput(); - while (true) - { - vTaskDelay(333 * (configTICK_RATE_HZ / 1000.0)); - Leds::toggle(); - } - } -}; - -BlinkTask blinkTask; - -int -main() -{ - Board::initialize(); - - MODM_LOG_INFO << "\n\nReboot: FreeRTOS blink example" << modm::endl; - - modm::rtos::Scheduler::schedule(); - - // we should never get here - return 0; -} diff --git a/examples/nucleo_f767zi/freertos_blink/project.xml b/examples/nucleo_f767zi/freertos_blink/project.xml deleted file mode 100755 index 9e8fc1693d..0000000000 --- a/examples/nucleo_f767zi/freertos_blink/project.xml +++ /dev/null @@ -1,11 +0,0 @@ - - modm:nucleo-f767zi - - - - - modm:build:scons - modm:freertos - modm:processing:rtos - - diff --git a/examples/nucleo_f767zi/spi_dma/project.xml b/examples/nucleo_f767zi/spi_dma/project.xml index 0f59fd175c..a8d0b51c15 100644 --- a/examples/nucleo_f767zi/spi_dma/project.xml +++ b/examples/nucleo_f767zi/spi_dma/project.xml @@ -1,8 +1,5 @@ modm:nucleo-f767zi - - - modm:platform:gpio modm:platform:dma diff --git a/examples/nucleo_g070rb/blink/main.cpp b/examples/nucleo_g070rb/blink/main.cpp deleted file mode 100644 index a6f817cc72..0000000000 --- a/examples/nucleo_g070rb/blink/main.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2019, 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 -#include - -using namespace Board; - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - LedD13::setOutput(modm::Gpio::Low); - - // 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}; - modm::PeriodicTimer timer{500ms}; - - while (true) - { - if (timer.execute()) - { - LedD13::toggle(); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - } - - return 0; -} diff --git a/examples/nucleo_g070rb/blink/project.xml b/examples/nucleo_g070rb/blink/project.xml deleted file mode 100644 index 001c5a5fc0..0000000000 --- a/examples/nucleo_g070rb/blink/project.xml +++ /dev/null @@ -1,11 +0,0 @@ - - modm:nucleo-g070rb - - - - - modm:platform:gpio - modm:processing:timer - modm:build:scons - - diff --git a/examples/nucleo_g071rb/adc/project.xml b/examples/nucleo_g071rb/adc/project.xml index d28f13fab2..50f52cf467 100644 --- a/examples/nucleo_g071rb/adc/project.xml +++ b/examples/nucleo_g071rb/adc/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g071rb - - - modm:platform:gpio modm:platform:adc diff --git a/examples/nucleo_g071rb/amnb/project.xml b/examples/nucleo_g071rb/amnb/project.xml index 3ac67b913d..69f35ad784 100644 --- a/examples/nucleo_g071rb/amnb/project.xml +++ b/examples/nucleo_g071rb/amnb/project.xml @@ -1,7 +1,6 @@ modm:nucleo-g071rb - diff --git a/examples/nucleo_g071rb/apa102/project.xml b/examples/nucleo_g071rb/apa102/project.xml index e2b55a4669..c9c96aea18 100644 --- a/examples/nucleo_g071rb/apa102/project.xml +++ b/examples/nucleo_g071rb/apa102/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g071rb - - - modm:build:scons modm:driver:apa102 diff --git a/examples/nucleo_g071rb/blink/main.cpp b/examples/nucleo_g071rb/blink/main.cpp deleted file mode 100644 index da89431903..0000000000 --- a/examples/nucleo_g071rb/blink/main.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2019, 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 -#include - -using namespace Board; - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - LedD13::setOutput(modm::Gpio::Low); - - // 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); - modm::PrecisePeriodicTimer tmr(0.500990s); - modm::PeriodicTimer tmrS(0.500990s); - - uint32_t ms_counter{0}; - uint32_t us_counter{0}; - - while (true) - { - { - uint32_t ms = modm::Clock::now().time_since_epoch().count(); - if (ms < ms_counter) { - MODM_LOG_ERROR << ms << " < " << ms_counter << modm::endl; - } - ms_counter = ms; - }{ - uint32_t us = modm::PreciseClock::now().time_since_epoch().count(); - if (us < us_counter) { - MODM_LOG_ERROR << us << " < " << us_counter << modm::endl; - } - us_counter = us; - } - - if (tmr.execute()) - { - LedD13::toggle(); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - - if (tmrS.execute()) - { - LedD13::toggle(); - } - } - - return 0; -} diff --git a/examples/nucleo_g071rb/blink/project.xml b/examples/nucleo_g071rb/blink/project.xml deleted file mode 100644 index 989fdf8b60..0000000000 --- a/examples/nucleo_g071rb/blink/project.xml +++ /dev/null @@ -1,11 +0,0 @@ - - modm:nucleo-g071rb - - - - - modm:platform:gpio - modm:processing:timer - modm:build:scons - - diff --git a/examples/nucleo_g071rb/custom_allocator/project.xml b/examples/nucleo_g071rb/custom_allocator/project.xml index b80e773a4c..ef6dc81740 100644 --- a/examples/nucleo_g071rb/custom_allocator/project.xml +++ b/examples/nucleo_g071rb/custom_allocator/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g071rb - - - modm:platform:gpio modm:architecture:memory diff --git a/examples/nucleo_g071rb/flash/main.cpp b/examples/nucleo_g071rb/flash/main.cpp deleted file mode 100644 index f1b685b5a5..0000000000 --- a/examples/nucleo_g071rb/flash/main.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2020, 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 -#include - -#undef MODM_LOG_LEVEL -#define MODM_LOG_LEVEL modm::log::INFO - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - - MODM_LOG_INFO << "\n\nReboot\n"; - if (not Flash::unlock()) { - MODM_LOG_INFO << "Flash unlock failed!" << modm::endl; - } - - { - uint32_t err{0}; - MODM_LOG_INFO << "Erasing sectors [32, 64)" << modm::endl; - MODM_LOG_INFO.flush(); - modm::delay(1s); - - const modm::PreciseTimestamp start = modm::PreciseClock::now(); - - for (uint8_t page{32}; page < 64u; page++) - err |= Flash::erase(page); - - const auto diff = (modm::PreciseClock::now() - start); - MODM_LOG_INFO << "Erasing done in " << diff << " with errors: " << err << modm::endl; - MODM_LOG_INFO << "Erasing with " << (Flash::Size/2 / (diff.count() >> 10) ) << "kiB/s" << modm::endl; - MODM_LOG_INFO.flush(); - } - - - { - uint32_t err{0}; - const modm::PreciseTimestamp start = modm::PreciseClock::now(); - for (uint32_t dst_addr{Flash::OriginAddr + Flash::Size/2}, src_addr{Flash::OriginAddr}; - src_addr < (Flash::OriginAddr + Flash::Size/2); - src_addr += sizeof(Flash::MaxWordType), dst_addr += sizeof(Flash::MaxWordType)) - { - err |= Flash::program(dst_addr, *(Flash::MaxWordType*)src_addr); - } - - const auto diff = (modm::PreciseClock::now() - start); - MODM_LOG_INFO << "Programming done in " << diff << " with errors: " << err << modm::endl; - MODM_LOG_INFO << "Programming with " << (Flash::Size/2 / (diff.count() >> 10) ) << "kiB/s" << modm::endl; - } - - while(1) ; - return 0; -} diff --git a/examples/nucleo_g071rb/flash/project.xml b/examples/nucleo_g071rb/flash/project.xml deleted file mode 100644 index d1d5f56b79..0000000000 --- a/examples/nucleo_g071rb/flash/project.xml +++ /dev/null @@ -1,12 +0,0 @@ - - modm:nucleo-g071rb - - - - - modm:platform:gpio - modm:platform:flash - modm:processing:timer - modm:build:scons - - diff --git a/examples/nucleo_g071rb/matrix/project.xml b/examples/nucleo_g071rb/matrix/project.xml index 3893ddf9d3..e08175478e 100644 --- a/examples/nucleo_g071rb/matrix/project.xml +++ b/examples/nucleo_g071rb/matrix/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g071rb - - - modm:platform:gpio modm:platform:i2c.bitbang diff --git a/examples/nucleo_g071rb/rtos/main.cpp b/examples/nucleo_g071rb/rtos/main.cpp deleted file mode 100644 index 85ceacb538..0000000000 --- a/examples/nucleo_g071rb/rtos/main.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2014, Georgi Grinshpun - * Copyright (c) 2014, Sascha Schade - * Copyright (c) 2015-2017, 2019 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 -#include - -using namespace modm::platform; - -/** - * This example uses four threads to check if task switching works correctly. - * - * What to expect? - * --------------- - * - All our LEDs blinking at different rates, about 3 to 4 Hz - * - A string at 115200 baud - * - * 0aA!1bB"2cC#3dD$4eE%5fF&6gG'7hH(8iI9)jJ0*aA1!bB2"cC - * - * Each thread prints out a sequence - * 0123456789 - * abcdefghij - * ABCDEFGHIJ - * !"#$%&'()* - * respectivly. - */ - -// ---------------------------------------------------------------------------- -template -class P: modm::rtos::Thread -{ - char c; - uint8_t i = 0; - volatile float a = 10.f; -public: - P(char c): Thread(2,1<<10), c(c) {} - - void run() - { - Gpio::setOutput(); - while (true) - { - sleep(SleepTime * MILLISECONDS); - - Gpio::toggle(); - { - static modm::rtos::Mutex lm; - modm::rtos::MutexGuard m(lm); - MODM_LOG_INFO << char(i + c); - } - i = (i+1)%10; - a *= 3.141f; - } - } -}; - -P< Board::LedD13, 260 > p1('0'); -P< Board::LedD13, 260 + 10 > p2('a'); -P< Board::LedD13, 260 + 20 > p3('A'); -P< Board::LedD13, 260 + 30 > p4('!'); - - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - modm::rtos::Scheduler::schedule(); - return 0; -} diff --git a/examples/nucleo_g071rb/rtos/project.xml b/examples/nucleo_g071rb/rtos/project.xml deleted file mode 100644 index ab231cd0d4..0000000000 --- a/examples/nucleo_g071rb/rtos/project.xml +++ /dev/null @@ -1,11 +0,0 @@ - - modm:nucleo-g071rb - - - - - modm:processing:rtos - modm:platform:heap - modm:build:scons - - diff --git a/examples/nucleo_g431kb/blink/main.cpp b/examples/nucleo_g431kb/blink/main.cpp deleted file mode 100644 index cc9239b621..0000000000 --- a/examples/nucleo_g431kb/blink/main.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 - -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; -} diff --git a/examples/nucleo_g431kb/blink/project.xml b/examples/nucleo_g431kb/blink/project.xml deleted file mode 100644 index e188235e66..0000000000 --- a/examples/nucleo_g431kb/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-g431kb - - - - - modm:build:scons - - diff --git a/examples/nucleo_g431kb/flash/main.cpp b/examples/nucleo_g431kb/flash/main.cpp deleted file mode 100644 index 11eada6c3c..0000000000 --- a/examples/nucleo_g431kb/flash/main.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2020, 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 -#include - -#undef MODM_LOG_LEVEL -#define MODM_LOG_LEVEL modm::log::INFO - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - - MODM_LOG_INFO << "\n\nReboot\n"; - if (not Flash::unlock()) { - MODM_LOG_INFO << "Flash unlock failed!" << modm::endl; - } - - { - uint32_t err{0}; - MODM_LOG_INFO << "Erasing sectors [32, 64)" << modm::endl; - MODM_LOG_INFO.flush(); - modm::delay(1s); - - const modm::PreciseTimestamp start = modm::PreciseClock::now(); - - for (uint8_t page{32}; page < 64u; page++) - err |= Flash::erase(page); - - const auto diff = (modm::PreciseClock::now() - start); - MODM_LOG_INFO << "Erasing done in " << diff << " with errors: " << err << modm::endl; - MODM_LOG_INFO << "Erasing with " << (Flash::Size/2 / (diff.count() >> 10) ) << "kiB/s" << modm::endl; - MODM_LOG_INFO.flush(); - } - - - { - uint32_t err{0}; - const modm::PreciseTimestamp start = modm::PreciseClock::now(); - for (uint32_t dst_addr{Flash::OriginAddr + Flash::Size/2}, src_addr{Flash::OriginAddr}; - src_addr < (Flash::OriginAddr + Flash::Size/2); - src_addr += sizeof(Flash::MaxWordType), dst_addr += sizeof(Flash::MaxWordType)) - { - err |= Flash::program(dst_addr, *(Flash::MaxWordType*)src_addr); - } - - const auto diff = (modm::PreciseClock::now() - start); - MODM_LOG_INFO << "Programming done in " << diff << " with errors: " << err << modm::endl; - MODM_LOG_INFO << "Programming with " << (Flash::Size/2 / (diff.count() >> 10) ) << "kiB/s" << modm::endl; - } - - while(1) ; - return 0; -} \ No newline at end of file diff --git a/examples/nucleo_g431kb/flash/project.xml b/examples/nucleo_g431kb/flash/project.xml deleted file mode 100644 index 60279dee78..0000000000 --- a/examples/nucleo_g431kb/flash/project.xml +++ /dev/null @@ -1,12 +0,0 @@ - - modm:nucleo-g431kb - - - - - modm:platform:gpio - modm:platform:flash - modm:processing:timer - modm:build:scons - - \ No newline at end of file diff --git a/examples/nucleo_g431rb/blink/main.cpp b/examples/nucleo_g431rb/blink/main.cpp deleted file mode 100644 index f820f9cc29..0000000000 --- a/examples/nucleo_g431rb/blink/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2020, 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(); - 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_g431rb/blink/project.xml b/examples/nucleo_g431rb/blink/project.xml deleted file mode 100644 index 93a23928ba..0000000000 --- a/examples/nucleo_g431rb/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-g431rb - - - - - modm:build:scons - - diff --git a/examples/nucleo_g431rb/flash/main.cpp b/examples/nucleo_g431rb/flash/main.cpp deleted file mode 100644 index 11eada6c3c..0000000000 --- a/examples/nucleo_g431rb/flash/main.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2020, 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 -#include - -#undef MODM_LOG_LEVEL -#define MODM_LOG_LEVEL modm::log::INFO - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - - MODM_LOG_INFO << "\n\nReboot\n"; - if (not Flash::unlock()) { - MODM_LOG_INFO << "Flash unlock failed!" << modm::endl; - } - - { - uint32_t err{0}; - MODM_LOG_INFO << "Erasing sectors [32, 64)" << modm::endl; - MODM_LOG_INFO.flush(); - modm::delay(1s); - - const modm::PreciseTimestamp start = modm::PreciseClock::now(); - - for (uint8_t page{32}; page < 64u; page++) - err |= Flash::erase(page); - - const auto diff = (modm::PreciseClock::now() - start); - MODM_LOG_INFO << "Erasing done in " << diff << " with errors: " << err << modm::endl; - MODM_LOG_INFO << "Erasing with " << (Flash::Size/2 / (diff.count() >> 10) ) << "kiB/s" << modm::endl; - MODM_LOG_INFO.flush(); - } - - - { - uint32_t err{0}; - const modm::PreciseTimestamp start = modm::PreciseClock::now(); - for (uint32_t dst_addr{Flash::OriginAddr + Flash::Size/2}, src_addr{Flash::OriginAddr}; - src_addr < (Flash::OriginAddr + Flash::Size/2); - src_addr += sizeof(Flash::MaxWordType), dst_addr += sizeof(Flash::MaxWordType)) - { - err |= Flash::program(dst_addr, *(Flash::MaxWordType*)src_addr); - } - - const auto diff = (modm::PreciseClock::now() - start); - MODM_LOG_INFO << "Programming done in " << diff << " with errors: " << err << modm::endl; - MODM_LOG_INFO << "Programming with " << (Flash::Size/2 / (diff.count() >> 10) ) << "kiB/s" << modm::endl; - } - - while(1) ; - return 0; -} \ No newline at end of file diff --git a/examples/nucleo_g431rb/flash/project.xml b/examples/nucleo_g431rb/flash/project.xml deleted file mode 100644 index e90b2ba331..0000000000 --- a/examples/nucleo_g431rb/flash/project.xml +++ /dev/null @@ -1,12 +0,0 @@ - - modm:nucleo-g431rb - - - - - modm:platform:gpio - modm:platform:flash - modm:processing:timer - modm:build:scons - - \ No newline at end of file diff --git a/examples/nucleo_g474re/adc_basic/project.xml b/examples/nucleo_g474re/adc_basic/project.xml index 8ef9d03e77..5ad1096af2 100644 --- a/examples/nucleo_g474re/adc_basic/project.xml +++ b/examples/nucleo_g474re/adc_basic/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:debug modm:platform:adc:1 diff --git a/examples/nucleo_g474re/adc_sequence_dma/project.xml b/examples/nucleo_g474re/adc_sequence_dma/project.xml index 35d6e6add3..96f49342fc 100644 --- a/examples/nucleo_g474re/adc_sequence_dma/project.xml +++ b/examples/nucleo_g474re/adc_sequence_dma/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:debug modm:platform:adc:1 diff --git a/examples/nucleo_g474re/ads101x/project.xml b/examples/nucleo_g474re/ads101x/project.xml index 790f897315..5c5b2dc2ec 100644 --- a/examples/nucleo_g474re/ads101x/project.xml +++ b/examples/nucleo_g474re/ads101x/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:driver:ads101x modm:platform:gpio @@ -11,4 +8,4 @@ modm:processing:timer modm:build:scons - \ No newline at end of file + diff --git a/examples/nucleo_g474re/ads7828/project.xml b/examples/nucleo_g474re/ads7828/project.xml index d35e31bff8..03061ba17a 100644 --- a/examples/nucleo_g474re/ads7828/project.xml +++ b/examples/nucleo_g474re/ads7828/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:driver:ads7828 modm:platform:gpio @@ -11,4 +8,4 @@ modm:processing:timer modm:build:scons - \ No newline at end of file + diff --git a/examples/nucleo_g474re/as5047/project.xml b/examples/nucleo_g474re/as5047/project.xml index 4b86fa2b25..124023840f 100644 --- a/examples/nucleo_g474re/as5047/project.xml +++ b/examples/nucleo_g474re/as5047/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:driver:as5047 modm:platform:gpio @@ -11,4 +8,4 @@ modm:processing:timer modm:build:scons - \ No newline at end of file + diff --git a/examples/nucleo_g474re/blink/main.cpp b/examples/nucleo_g474re/blink/main.cpp deleted file mode 100644 index 942c463502..0000000000 --- a/examples/nucleo_g474re/blink/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 - -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_g474re/blink/project.xml b/examples/nucleo_g474re/blink/project.xml deleted file mode 100644 index 4f9e4597ae..0000000000 --- a/examples/nucleo_g474re/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-g474re - - - - - modm:build:scons - - diff --git a/examples/nucleo_g474re/can/project.xml b/examples/nucleo_g474re/can/project.xml index 8185fcdce1..f1bf07b21f 100644 --- a/examples/nucleo_g474re/can/project.xml +++ b/examples/nucleo_g474re/can/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:debug modm:platform:can:1 diff --git a/examples/nucleo_g474re/dac_basic/project.xml b/examples/nucleo_g474re/dac_basic/project.xml index 10b98a3fab..ecceeffb4a 100644 --- a/examples/nucleo_g474re/dac_basic/project.xml +++ b/examples/nucleo_g474re/dac_basic/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:debug modm:platform:dac:2 diff --git a/examples/nucleo_g474re/dac_dma/project.xml b/examples/nucleo_g474re/dac_dma/project.xml index a6feb9dfeb..6de3be1a9a 100644 --- a/examples/nucleo_g474re/dac_dma/project.xml +++ b/examples/nucleo_g474re/dac_dma/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:debug modm:platform:dac:1 diff --git a/examples/nucleo_g474re/flash/main.cpp b/examples/nucleo_g474re/flash/main.cpp deleted file mode 100644 index 11eada6c3c..0000000000 --- a/examples/nucleo_g474re/flash/main.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2020, 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 -#include - -#undef MODM_LOG_LEVEL -#define MODM_LOG_LEVEL modm::log::INFO - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - - MODM_LOG_INFO << "\n\nReboot\n"; - if (not Flash::unlock()) { - MODM_LOG_INFO << "Flash unlock failed!" << modm::endl; - } - - { - uint32_t err{0}; - MODM_LOG_INFO << "Erasing sectors [32, 64)" << modm::endl; - MODM_LOG_INFO.flush(); - modm::delay(1s); - - const modm::PreciseTimestamp start = modm::PreciseClock::now(); - - for (uint8_t page{32}; page < 64u; page++) - err |= Flash::erase(page); - - const auto diff = (modm::PreciseClock::now() - start); - MODM_LOG_INFO << "Erasing done in " << diff << " with errors: " << err << modm::endl; - MODM_LOG_INFO << "Erasing with " << (Flash::Size/2 / (diff.count() >> 10) ) << "kiB/s" << modm::endl; - MODM_LOG_INFO.flush(); - } - - - { - uint32_t err{0}; - const modm::PreciseTimestamp start = modm::PreciseClock::now(); - for (uint32_t dst_addr{Flash::OriginAddr + Flash::Size/2}, src_addr{Flash::OriginAddr}; - src_addr < (Flash::OriginAddr + Flash::Size/2); - src_addr += sizeof(Flash::MaxWordType), dst_addr += sizeof(Flash::MaxWordType)) - { - err |= Flash::program(dst_addr, *(Flash::MaxWordType*)src_addr); - } - - const auto diff = (modm::PreciseClock::now() - start); - MODM_LOG_INFO << "Programming done in " << diff << " with errors: " << err << modm::endl; - MODM_LOG_INFO << "Programming with " << (Flash::Size/2 / (diff.count() >> 10) ) << "kiB/s" << modm::endl; - } - - while(1) ; - return 0; -} \ No newline at end of file diff --git a/examples/nucleo_g474re/flash/project.xml b/examples/nucleo_g474re/flash/project.xml deleted file mode 100644 index b3980ad430..0000000000 --- a/examples/nucleo_g474re/flash/project.xml +++ /dev/null @@ -1,12 +0,0 @@ - - modm:nucleo-g474re - - - - - modm:platform:gpio - modm:platform:flash - modm:processing:timer - modm:build:scons - - \ No newline at end of file diff --git a/examples/nucleo_g474re/imu_lsm6dso/project.xml b/examples/nucleo_g474re/imu_lsm6dso/project.xml index ac5179ff04..4633df89a1 100644 --- a/examples/nucleo_g474re/imu_lsm6dso/project.xml +++ b/examples/nucleo_g474re/imu_lsm6dso/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:build:scons modm:platform:spi:1 diff --git a/examples/nucleo_g474re/ixm42xxx/project.xml b/examples/nucleo_g474re/ixm42xxx/project.xml index 5262c37935..45cf93a775 100644 --- a/examples/nucleo_g474re/ixm42xxx/project.xml +++ b/examples/nucleo_g474re/ixm42xxx/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:driver:ixm42xxx modm:math:geometry @@ -12,4 +9,4 @@ modm:processing:timer modm:build:scons - \ No newline at end of file + diff --git a/examples/nucleo_g474re/ixm42xxx_fifo/project.xml b/examples/nucleo_g474re/ixm42xxx_fifo/project.xml index fcf707cd29..d848062824 100644 --- a/examples/nucleo_g474re/ixm42xxx_fifo/project.xml +++ b/examples/nucleo_g474re/ixm42xxx_fifo/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:driver:ixm42xxx modm:math:geometry @@ -13,4 +10,4 @@ modm:processing:timer modm:build:scons - \ No newline at end of file + diff --git a/examples/nucleo_g474re/max31855/project.xml b/examples/nucleo_g474re/max31855/project.xml index 506a31d432..6532792080 100644 --- a/examples/nucleo_g474re/max31855/project.xml +++ b/examples/nucleo_g474re/max31855/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:driver:max31855 modm:platform:gpio @@ -11,4 +8,4 @@ modm:processing:timer modm:build:scons - \ No newline at end of file + diff --git a/examples/nucleo_g474re/ms5611/project.xml b/examples/nucleo_g474re/ms5611/project.xml index d2af13d728..73aab84262 100644 --- a/examples/nucleo_g474re/ms5611/project.xml +++ b/examples/nucleo_g474re/ms5611/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:driver:ms5611 modm:platform:gpio @@ -11,4 +8,4 @@ modm:processing:timer modm:build:scons - \ No newline at end of file + diff --git a/examples/nucleo_g474re/servo_pwm/project.xml b/examples/nucleo_g474re/servo_pwm/project.xml index 64712c4808..b0f00f1e3c 100644 --- a/examples/nucleo_g474re/servo_pwm/project.xml +++ b/examples/nucleo_g474re/servo_pwm/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:build:scons modm:platform:timer:4 diff --git a/examples/nucleo_g474re/sx128x_lora/project.xml b/examples/nucleo_g474re/sx128x_lora/project.xml index 544f5d2171..7db4777760 100644 --- a/examples/nucleo_g474re/sx128x_lora/project.xml +++ b/examples/nucleo_g474re/sx128x_lora/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:driver:sx128x modm:platform:exti @@ -12,4 +9,4 @@ modm:processing:timer modm:build:scons - \ No newline at end of file + diff --git a/examples/nucleo_g474re/timer_input_capture/project.xml b/examples/nucleo_g474re/timer_input_capture/project.xml index 55d070ad90..204b6ea292 100644 --- a/examples/nucleo_g474re/timer_input_capture/project.xml +++ b/examples/nucleo_g474re/timer_input_capture/project.xml @@ -1,8 +1,5 @@ modm:nucleo-g474re - - - modm:build:scons modm:platform:timer:4 diff --git a/examples/nucleo_h723zg/adc_injected_conversion/project.xml b/examples/nucleo_h723zg/adc_injected_conversion/project.xml index c79cb1f183..a099d5718c 100644 --- a/examples/nucleo_h723zg/adc_injected_conversion/project.xml +++ b/examples/nucleo_h723zg/adc_injected_conversion/project.xml @@ -1,8 +1,5 @@ modm:nucleo-h723zg - - - modm:build:scons modm:platform:adc:1 diff --git a/examples/nucleo_h723zg/adc_simple/project.xml b/examples/nucleo_h723zg/adc_simple/project.xml index f74ce06da3..e5d3f186f9 100644 --- a/examples/nucleo_h723zg/adc_simple/project.xml +++ b/examples/nucleo_h723zg/adc_simple/project.xml @@ -1,8 +1,5 @@ modm:nucleo-h723zg - - - modm:build:scons modm:platform:adc:* diff --git a/examples/nucleo_h723zg/blink/main.cpp b/examples/nucleo_h723zg/blink/main.cpp deleted file mode 100644 index 205bc44743..0000000000 --- a/examples/nucleo_h723zg/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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_h723zg/blink/project.xml b/examples/nucleo_h723zg/blink/project.xml deleted file mode 100644 index e4bddd1ed7..0000000000 --- a/examples/nucleo_h723zg/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-h723zg - - - - - modm:build:scons - - diff --git a/examples/nucleo_h723zg/bmi088/i2c/project.xml b/examples/nucleo_h723zg/bmi088/i2c/project.xml index 797c04a836..66485ed802 100644 --- a/examples/nucleo_h723zg/bmi088/i2c/project.xml +++ b/examples/nucleo_h723zg/bmi088/i2c/project.xml @@ -1,7 +1,6 @@ modm:nucleo-h723zg - diff --git a/examples/nucleo_h723zg/bmi088/spi/project.xml b/examples/nucleo_h723zg/bmi088/spi/project.xml index 0ee7b8a80b..47cea71e40 100644 --- a/examples/nucleo_h723zg/bmi088/spi/project.xml +++ b/examples/nucleo_h723zg/bmi088/spi/project.xml @@ -1,7 +1,6 @@ modm:nucleo-h723zg - diff --git a/examples/nucleo_h723zg/dac_dma/project.xml b/examples/nucleo_h723zg/dac_dma/project.xml index 047b381dee..08ce6ecf7e 100644 --- a/examples/nucleo_h723zg/dac_dma/project.xml +++ b/examples/nucleo_h723zg/dac_dma/project.xml @@ -1,8 +1,5 @@ modm:nucleo-h723zg - - - modm:debug modm:platform:dac:1 diff --git a/examples/nucleo_h743zi/blink/main.cpp b/examples/nucleo_h743zi/blink/main.cpp deleted file mode 100644 index b890fc662b..0000000000 --- a/examples/nucleo_h743zi/blink/main.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 -#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; - - for (const auto [traits, start, end, size] : modm::platform::HeapTable()) - { - MODM_LOG_INFO.printf("Memory section %#x @[0x%p,0x%p](%u)\n", - traits.value, start, end, size); - } - - uint32_t counter(0); - modm::ShortTimeout tmr; - - while (true) - { - Leds::write(1 << (counter % (Leds::width+1) )); - // modm::delay(Button::read() ? 100ms : 500ms); - tmr.restart(Button::read() ? 100ms : 500ms); - while(not tmr.execute()) ; - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - - return 0; -} diff --git a/examples/nucleo_h743zi/blink/project.xml b/examples/nucleo_h743zi/blink/project.xml deleted file mode 100644 index 079b714c33..0000000000 --- a/examples/nucleo_h743zi/blink/project.xml +++ /dev/null @@ -1,11 +0,0 @@ - - modm:nucleo-h743zi - - - - - modm:architecture:memory - modm:build:scons - modm:processing:timer - - diff --git a/examples/nucleo_l031k6/blink/main.cpp b/examples/nucleo_l031k6/blink/main.cpp deleted file mode 100644 index 27b5693d5a..0000000000 --- a/examples/nucleo_l031k6/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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_l031k6/blink/project.xml b/examples/nucleo_l031k6/blink/project.xml deleted file mode 100644 index b234525d07..0000000000 --- a/examples/nucleo_l031k6/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-l031k6 - - - - - modm:build:scons - - diff --git a/examples/nucleo_l031k6/vector_table_ram/project.xml b/examples/nucleo_l031k6/vector_table_ram/project.xml index 84c6927449..35db4f1f79 100644 --- a/examples/nucleo_l031k6/vector_table_ram/project.xml +++ b/examples/nucleo_l031k6/vector_table_ram/project.xml @@ -1,7 +1,6 @@ modm:nucleo-l031k6 - diff --git a/examples/nucleo_l053r8/blink/main.cpp b/examples/nucleo_l053r8/blink/main.cpp deleted file mode 100644 index 27b5693d5a..0000000000 --- a/examples/nucleo_l053r8/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 deleted file mode 100644 index 26c4d22848..0000000000 --- a/examples/nucleo_l053r8/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-l053r8 - - - - - modm:build:scons - - diff --git a/examples/nucleo_l152re/blink/main.cpp b/examples/nucleo_l152re/blink/main.cpp deleted file mode 100644 index f7a7bcef2e..0000000000 --- a/examples/nucleo_l152re/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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(); - 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_l152re/blink/project.xml b/examples/nucleo_l152re/blink/project.xml deleted file mode 100644 index 312d35dab3..0000000000 --- a/examples/nucleo_l152re/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-l152re - - - - - modm:build:scons - - diff --git a/examples/nucleo_l432kc/blink/main.cpp b/examples/nucleo_l432kc/blink/main.cpp deleted file mode 100644 index c5853f01af..0000000000 --- a/examples/nucleo_l432kc/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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)); - modm::delay(Button::read() ? 100ms : 500ms); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - - return 0; -} diff --git a/examples/nucleo_l432kc/blink/project.xml b/examples/nucleo_l432kc/blink/project.xml deleted file mode 100644 index 04b0481925..0000000000 --- a/examples/nucleo_l432kc/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-l432kc - - - - - modm:build:scons - - diff --git a/examples/nucleo_l432kc/comp/project.xml b/examples/nucleo_l432kc/comp/project.xml index 8384defc1d..8c1e206198 100644 --- a/examples/nucleo_l432kc/comp/project.xml +++ b/examples/nucleo_l432kc/comp/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l432kc - - - modm:platform:comp:* modm:build:scons diff --git a/examples/nucleo_l432kc/gyroscope/project.xml b/examples/nucleo_l432kc/gyroscope/project.xml index 8fd87a3f22..8a4240693e 100644 --- a/examples/nucleo_l432kc/gyroscope/project.xml +++ b/examples/nucleo_l432kc/gyroscope/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l432kc - - - modm:driver:l3gd20 modm:math:filter diff --git a/examples/nucleo_l432kc/pwm/project.xml b/examples/nucleo_l432kc/pwm/project.xml index 93ca92d036..68bd9bf37c 100644 --- a/examples/nucleo_l432kc/pwm/project.xml +++ b/examples/nucleo_l432kc/pwm/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l432kc - - - modm:build:scons modm:platform:timer:1 diff --git a/examples/nucleo_l432kc/pwm_advanced/project.xml b/examples/nucleo_l432kc/pwm_advanced/project.xml index 9bd3557d06..68bd9bf37c 100644 --- a/examples/nucleo_l432kc/pwm_advanced/project.xml +++ b/examples/nucleo_l432kc/pwm_advanced/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l432kc - - - modm:build:scons modm:platform:timer:1 diff --git a/examples/nucleo_l432kc/spi_dma/project.xml b/examples/nucleo_l432kc/spi_dma/project.xml index a7c7453465..4c28cb3d7d 100644 --- a/examples/nucleo_l432kc/spi_dma/project.xml +++ b/examples/nucleo_l432kc/spi_dma/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l432kc - - - modm:platform:gpio modm:platform:dma diff --git a/examples/nucleo_l432kc/uart_spi/project.xml b/examples/nucleo_l432kc/uart_spi/project.xml index 2b6df6d65e..f190cc4fe0 100644 --- a/examples/nucleo_l432kc/uart_spi/project.xml +++ b/examples/nucleo_l432kc/uart_spi/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l432kc - - - modm:platform:gpio modm:platform:uart.spi:1 diff --git a/examples/nucleo_l452re/blink/main.cpp b/examples/nucleo_l452re/blink/main.cpp deleted file mode 100644 index 414e9d4969..0000000000 --- a/examples/nucleo_l452re/blink/main.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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() -{ - initialize(); - - while (true) - { - LedGreen::toggle(); - modm::delay(Button::read() ? 250ms : 500ms); - } - - return 0; -} diff --git a/examples/nucleo_l452re/blink/project.xml b/examples/nucleo_l452re/blink/project.xml deleted file mode 100644 index 2dfb13445b..0000000000 --- a/examples/nucleo_l452re/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:nucleo-l452re - - - - - modm:platform:gpio - modm:build:scons - - diff --git a/examples/nucleo_l452re/graphics_touch/project.xml b/examples/nucleo_l452re/graphics_touch/project.xml index 3b07f11c1d..4f721d61dc 100644 --- a/examples/nucleo_l452re/graphics_touch/project.xml +++ b/examples/nucleo_l452re/graphics_touch/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l452re - - - modm:build:scons modm:driver:ili9341 diff --git a/examples/nucleo_l452re/lvgl/project.xml b/examples/nucleo_l452re/lvgl/project.xml index ee8da18a25..1fd0cece71 100644 --- a/examples/nucleo_l452re/lvgl/project.xml +++ b/examples/nucleo_l452re/lvgl/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l452re - - - modm:build:scons modm:processing:timer diff --git a/examples/nucleo_l476rg/adc/project.xml b/examples/nucleo_l476rg/adc/project.xml index de32c704c1..ede57a9448 100644 --- a/examples/nucleo_l476rg/adc/project.xml +++ b/examples/nucleo_l476rg/adc/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l476rg - - - modm:platform:adc:1 modm:platform:clock diff --git a/examples/nucleo_l476rg/blink/main.cpp b/examples/nucleo_l476rg/blink/main.cpp deleted file mode 100644 index 47913e7234..0000000000 --- a/examples/nucleo_l476rg/blink/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2017, Niklas Hauser - * Copyright (c) 2017, Sascha Schade - * - * 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() -{ - initialize(); - - // Output MSI Clock at MCO - // 48 MHz / 16 = 3 MHz expected at PA8 - Rcc::enableClockOutput( - Rcc::ClockOutputSource::MultiSpeedInternalClock, - Rcc::ClockOutputPrescaler::Div16); - - GpioConnector::connect(); - - LedGreen::set(); - - while (true) - { - LedGreen::toggle(); - modm::delay(Button::read() ? 250ms : 500ms); - } - - return 0; -} diff --git a/examples/nucleo_l476rg/blink/project.xml b/examples/nucleo_l476rg/blink/project.xml deleted file mode 100644 index 7e8349b0c2..0000000000 --- a/examples/nucleo_l476rg/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:nucleo-l476rg - - - - - modm:platform:gpio - modm:build:scons - - diff --git a/examples/nucleo_l476rg/dac_dma/project.xml b/examples/nucleo_l476rg/dac_dma/project.xml index cbfdfab388..7ad420b356 100644 --- a/examples/nucleo_l476rg/dac_dma/project.xml +++ b/examples/nucleo_l476rg/dac_dma/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l476rg - - - modm:debug modm:platform:dac:1 diff --git a/examples/nucleo_l476rg/i2c_test/main.cpp b/examples/nucleo_l476rg/i2c_test/main.cpp index 916217be29..38e804168b 100644 --- a/examples/nucleo_l476rg/i2c_test/main.cpp +++ b/examples/nucleo_l476rg/i2c_test/main.cpp @@ -29,8 +29,6 @@ using MyI2cMaster = modm::platform::I2cMaster1; -using namespace Board; - template < class I2cMaster > class I2cTestDevice : public modm::I2cDevice { @@ -136,7 +134,7 @@ main() MyI2cMaster::connect(); MyI2cMaster::initialize(); - LedGreen::set(); + Board::LedGreen::set(); RF_CALL_BLOCKING(i2c.ping()); modm::delay(25us); @@ -161,7 +159,7 @@ main() // Blink if run without hanging. while(true) { - LedGreen::toggle(); + Board::LedGreen::toggle(); modm::delay(500ms); }; diff --git a/examples/nucleo_l476rg/i2c_test/project.xml b/examples/nucleo_l476rg/i2c_test/project.xml index aa169b452c..f3dc98bd4f 100644 --- a/examples/nucleo_l476rg/i2c_test/project.xml +++ b/examples/nucleo_l476rg/i2c_test/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l476rg - - - modm:architecture:i2c.device modm:platform:i2c:1 diff --git a/examples/nucleo_l476rg/itm/project.xml b/examples/nucleo_l476rg/itm/project.xml deleted file mode 100644 index 6817989eff..0000000000 --- a/examples/nucleo_l476rg/itm/project.xml +++ /dev/null @@ -1,13 +0,0 @@ - - modm:nucleo-l476rg - - - - - - modm:build:scons - modm:build:make - modm:platform:itm - modm:processing:timer - - diff --git a/examples/nucleo_l476rg/rtt/main.cpp b/examples/nucleo_l476rg/rtt/main.cpp deleted file mode 100644 index c8cb45f189..0000000000 --- a/examples/nucleo_l476rg/rtt/main.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2021, 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 -#include -#include - -using namespace Board; - -Rtt rtt(0); -modm::IODeviceObjectWrapper< Rtt, modm::IOBuffer::DiscardIfFull > rtt_device(rtt); -modm::IOStream rtt_stream(rtt_device); - -#undef MODM_LOG_LEVEL -#define MODM_LOG_LEVEL modm::log::INFO - -/* - - $ scons rtt -╭───OpenOCD───> Real Time Transfer -╰─────RTT────── stm32f303vct6 -Info : STLINK V2J16S0 (API v2) VID:PID 0483:3748 -Info : stm32f3x.cpu: hardware has 6 breakpoints, 4 watchpoints -Info : rtt: Searching for control block 'SEGGER RTT' -Info : rtt: Control block found at 0x20000c04 -Info : Listening on port 9090 for rtt connections -Info -Warning -Error -loop: 0 -loop: 1 -loop: 2 -loop: 3 -loop: 4 -loop: 5 - - -Type number 0-9, then press enter to send. -The LED should blink slower or faster. - -Ctrl+D to exit - -*/ - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - - rtt_stream << "RTT Demo on Nucleo-64" << modm::endl; - - uint32_t counter(0); - modm::PeriodicTimer tmr(100ms); - - char data; - while (true) - { - rtt_stream.get(data); - switch(data) - { - case '0': - tmr.restart(1s); - break; - case '1'...'9': - tmr.restart(std::chrono::milliseconds((data - '0') * 100)); - break; - } - if (tmr.execute()) - { - LedGreen::toggle(); - - rtt_stream << "loop: " << counter++ << modm::endl; - } - } - - return 0; -} diff --git a/examples/nucleo_l476rg/rtt/project.xml b/examples/nucleo_l476rg/rtt/project.xml deleted file mode 100644 index aa853f1a1c..0000000000 --- a/examples/nucleo_l476rg/rtt/project.xml +++ /dev/null @@ -1,13 +0,0 @@ - - modm:nucleo-l476rg - - - - - - modm:platform:rtt - modm:processing:timer - modm:build:scons - modm:debug - - diff --git a/examples/nucleo_l496zg-p/blink/main.cpp b/examples/nucleo_l496zg-p/blink/main.cpp deleted file mode 100644 index d1338a0993..0000000000 --- a/examples/nucleo_l496zg-p/blink/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 deleted file mode 100644 index b1ef87b9bd..0000000000 --- a/examples/nucleo_l496zg-p/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:nucleo-l496zg-p - - - - - modm:platform:gpio - modm:build:scons - - diff --git a/examples/nucleo_l552ze-q/adc_basic/project.xml b/examples/nucleo_l552ze-q/adc_basic/project.xml index 1299fdc719..102a0b4cf2 100644 --- a/examples/nucleo_l552ze-q/adc_basic/project.xml +++ b/examples/nucleo_l552ze-q/adc_basic/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l552ze-q - - - modm:debug modm:platform:adc:1 diff --git a/examples/nucleo_l552ze-q/blink/main.cpp b/examples/nucleo_l552ze-q/blink/main.cpp deleted file mode 100644 index d1338a0993..0000000000 --- a/examples/nucleo_l552ze-q/blink/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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_l552ze-q/blink/project.xml b/examples/nucleo_l552ze-q/blink/project.xml deleted file mode 100644 index b03f74f518..0000000000 --- a/examples/nucleo_l552ze-q/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:nucleo-l552ze-q - - - - - modm:platform:gpio - modm:build:scons - - diff --git a/examples/nucleo_l552ze-q/dac_dma/project.xml b/examples/nucleo_l552ze-q/dac_dma/project.xml index 752a87dd96..88733409a6 100644 --- a/examples/nucleo_l552ze-q/dac_dma/project.xml +++ b/examples/nucleo_l552ze-q/dac_dma/project.xml @@ -1,8 +1,5 @@ modm:nucleo-l552ze-q - - - modm:debug modm:platform:dac:1 diff --git a/examples/nucleo_l552ze-q/freertos_blink/main.cpp b/examples/nucleo_l552ze-q/freertos_blink/main.cpp deleted file mode 100755 index 06baeb514b..0000000000 --- a/examples/nucleo_l552ze-q/freertos_blink/main.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2020, Mike Wolfram - * - * 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 -#include - -using namespace Board; - -class BlinkTask : modm::rtos::Thread -{ -public: - BlinkTask() - : Thread(4, 2048, "blink") - {} - - void - run() - { - Leds::setOutput(); - while (true) - { - vTaskDelay(500 * (configTICK_RATE_HZ / 1000.0)); - Leds::toggle(); - } - } -}; - -BlinkTask blinkTask; - -int -main() -{ - Board::initialize(); - - MODM_LOG_INFO << "\n\nReboot: FreeRTOS blink example" << modm::endl; - - modm::rtos::Scheduler::schedule(); - - // we should never get here - return 0; -} diff --git a/examples/nucleo_l552ze-q/freertos_blink/project.xml b/examples/nucleo_l552ze-q/freertos_blink/project.xml deleted file mode 100755 index 64b4226089..0000000000 --- a/examples/nucleo_l552ze-q/freertos_blink/project.xml +++ /dev/null @@ -1,11 +0,0 @@ - - modm:nucleo-l552ze-q - - - - - modm:build:scons - modm:freertos - modm:processing:rtos - - diff --git a/examples/nucleo_u575zi-q/blink/main.cpp b/examples/nucleo_u575zi-q/blink/main.cpp deleted file mode 100644 index e7ad089eef..0000000000 --- a/examples/nucleo_u575zi-q/blink/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2022, 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_u575zi-q/blink/project.xml b/examples/nucleo_u575zi-q/blink/project.xml deleted file mode 100644 index 1cb85d4916..0000000000 --- a/examples/nucleo_u575zi-q/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:nucleo-u575zi-q - - - - - modm:build:scons - - diff --git a/examples/olimexino_stm32/blink/main.cpp b/examples/olimexino_stm32/blink/main.cpp deleted file mode 100644 index 3a891ec401..0000000000 --- a/examples/olimexino_stm32/blink/main.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2017, Carl Treudler - * Copyright (c) 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 - -int main() -{ - Board::initialize(); - Board::LedD3::setOutput(); - - - while (true) - { - Board::LedD3::toggle(); - modm::delay(200ms); - } - return 0; -} diff --git a/examples/olimexino_stm32/blink/project.xml b/examples/olimexino_stm32/blink/project.xml deleted file mode 100644 index b57ae5a876..0000000000 --- a/examples/olimexino_stm32/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:olimexino-stm32 - - - - - modm:platform:gpio - modm:build:scons - - diff --git a/examples/rp_pico/adc_simple/project.xml b/examples/rp_pico/adc_simple/project.xml index 6aee18e673..cd1acbc503 100644 --- a/examples/rp_pico/adc_simple/project.xml +++ b/examples/rp_pico/adc_simple/project.xml @@ -1,8 +1,5 @@ modm:rp-pico - - - modm:io modm:platform:adc diff --git a/examples/rp_pico/blink/main.cpp b/examples/rp_pico/blink/main.cpp deleted file mode 100644 index d2015d36b8..0000000000 --- a/examples/rp_pico/blink/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2016, Sascha Schade - * Copyright (c) 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; - -/* - * Blinks the green user LED with 1 Hz. - * It is on for 90% of the time and off for 10% of the time. - */ - -int -main() -{ - Board::initialize(); - - LedGreen::setOutput(); - - while (true) - { - LedGreen::set(); - modm::delay(900ms); - - LedGreen::reset(); - modm::delay(100ms); - } - - return 0; -} diff --git a/examples/rp_pico/blink/project.xml b/examples/rp_pico/blink/project.xml deleted file mode 100644 index 8aff40d49a..0000000000 --- a/examples/rp_pico/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:rp-pico - - - - - - modm:build:scons - - diff --git a/examples/rp_pico/fiber/project.xml b/examples/rp_pico/fiber/project.xml index 311aa65856..af76e33e1d 100644 --- a/examples/rp_pico/fiber/project.xml +++ b/examples/rp_pico/fiber/project.xml @@ -1,8 +1,5 @@ modm:rp-pico - - - modm:debug modm:platform:uart:0 diff --git a/examples/rp_pico/interrupt/project.xml b/examples/rp_pico/interrupt/project.xml index 9abf5ab623..8d5a42e75f 100644 --- a/examples/rp_pico/interrupt/project.xml +++ b/examples/rp_pico/interrupt/project.xml @@ -1,8 +1,5 @@ modm:rp-pico - - - modm:platform:extint modm:build:scons diff --git a/examples/rp_pico/logger/project.xml b/examples/rp_pico/logger/project.xml index 82492276ab..2cf095af01 100644 --- a/examples/rp_pico/logger/project.xml +++ b/examples/rp_pico/logger/project.xml @@ -1,8 +1,5 @@ modm:rp-pico - - - modm:debug modm:platform:gpio diff --git a/examples/rp_pico/mcblink/project.xml b/examples/rp_pico/mcblink/project.xml index 63577e34c2..37e07de24b 100644 --- a/examples/rp_pico/mcblink/project.xml +++ b/examples/rp_pico/mcblink/project.xml @@ -1,8 +1,5 @@ modm:rp-pico - - - modm:debug modm:processing:timer diff --git a/examples/rp_pico/mclogger/project.xml b/examples/rp_pico/mclogger/project.xml index 8f05615fd8..e653493587 100644 --- a/examples/rp_pico/mclogger/project.xml +++ b/examples/rp_pico/mclogger/project.xml @@ -1,8 +1,5 @@ modm:rp-pico - - - modm:debug modm:platform:gpio diff --git a/examples/rp_pico/rtc_mcp7941x/project.xml b/examples/rp_pico/rtc_mcp7941x/project.xml index b24d0343e3..67b06e70e9 100644 --- a/examples/rp_pico/rtc_mcp7941x/project.xml +++ b/examples/rp_pico/rtc_mcp7941x/project.xml @@ -1,7 +1,6 @@ modm:rp-pico - diff --git a/examples/rp_pico/spi_dma/project.xml b/examples/rp_pico/spi_dma/project.xml index b1c9b09f08..4a070ccfff 100644 --- a/examples/rp_pico/spi_dma/project.xml +++ b/examples/rp_pico/spi_dma/project.xml @@ -1,7 +1,6 @@ modm:rp-pico - diff --git a/examples/rp_pico/st7789/project.xml b/examples/rp_pico/st7789/project.xml index 0c3942617a..60d806791c 100644 --- a/examples/rp_pico/st7789/project.xml +++ b/examples/rp_pico/st7789/project.xml @@ -1,8 +1,5 @@ modm:rp-pico - - - modm:platform:spi:0 modm:platform:uart:0 diff --git a/examples/samd/blink/main.cpp b/examples/samd/blink/main.cpp deleted file mode 100644 index cf4f826f7c..0000000000 --- a/examples/samd/blink/main.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2019, Ethan Slattery - * - * 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; -using namespace std::chrono_literals; - -int -main() -{ - Board::initialize(); - while (1) - { - Led::toggle(); - modm::delay(500ms); - -#ifdef MODM_BOARD_HAS_LOGGER - static uint32_t counter(0); - MODM_LOG_INFO << "Loop counter: " << (counter++) << modm::endl; -#endif - } - - return 0; -} diff --git a/examples/samd/blink/project.xml b/examples/samd/blink/project.xml deleted file mode 100644 index 3bab6ef5a5..0000000000 --- a/examples/samd/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:feather-m0 - - - - - modm:build:scons - - diff --git a/examples/samd/interrupt/project.xml b/examples/samd/interrupt/project.xml index 1c53a440cb..2fc4fea47f 100644 --- a/examples/samd/interrupt/project.xml +++ b/examples/samd/interrupt/project.xml @@ -1,8 +1,5 @@ modm:feather-m0 - - - modm:build:scons modm:platform:extint diff --git a/examples/samd21_xplained_pro/blink/main.cpp b/examples/samd21_xplained_pro/blink/main.cpp deleted file mode 100644 index 90716c8993..0000000000 --- a/examples/samd21_xplained_pro/blink/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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(); - - // 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) - { - Led0::toggle(); - modm::delay(Button::read() ? 500ms : 100ms); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - - return 0; -} diff --git a/examples/samd21_xplained_pro/blink/project.xml b/examples/samd21_xplained_pro/blink/project.xml deleted file mode 100644 index 2c9638f352..0000000000 --- a/examples/samd21_xplained_pro/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:samd21-xplained-pro - - - - - modm:build:scons - - diff --git a/examples/samd21_xplained_pro/usbserial/main.cpp b/examples/samd21_xplained_pro/usbserial/main.cpp deleted file mode 100644 index 2bf24ef589..0000000000 --- a/examples/samd21_xplained_pro/usbserial/main.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2016-2017, Niklas Hauser - * Copyright (c) 2022, Christopher Durand - * - * 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 -#include - -using namespace Board; - -modm::IODeviceWrapper usb_io_device; -modm::IOStream usb_stream(usb_io_device); - -int -main() -{ - Board::initialize(); - Board::initializeUsbFs(); - - tusb_init(); - - usb_stream << "Hello from USB" << modm::endl; - - uint32_t counter(0); - - modm::PeriodicTimer timer{500ms}; - while (true) - { - tud_task(); - if (timer.execute()) { - Led0::toggle(); - usb_stream << "loop: " << counter++ << modm::endl; - } - } - - return 0; -} diff --git a/examples/samd21_xplained_pro/usbserial/project.xml b/examples/samd21_xplained_pro/usbserial/project.xml deleted file mode 100644 index 8ab1e6a5a9..0000000000 --- a/examples/samd21_xplained_pro/usbserial/project.xml +++ /dev/null @@ -1,12 +0,0 @@ - - modm:samd21-xplained-pro - - - - - - modm:tinyusb - modm:build:scons - modm:processing:timer - - diff --git a/examples/same54_xplained_pro/blink/main.cpp b/examples/same54_xplained_pro/blink/main.cpp deleted file mode 100644 index 90716c8993..0000000000 --- a/examples/same54_xplained_pro/blink/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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(); - - // 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) - { - Led0::toggle(); - modm::delay(Button::read() ? 500ms : 100ms); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - - return 0; -} diff --git a/examples/same54_xplained_pro/blink/project.xml b/examples/same54_xplained_pro/blink/project.xml deleted file mode 100644 index fa74596a8f..0000000000 --- a/examples/same54_xplained_pro/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:same54-xplained-pro - - - - - modm:build:scons - modm:platform:uart:1 - - diff --git a/examples/same54_xplained_pro/usbserial/main.cpp b/examples/same54_xplained_pro/usbserial/main.cpp deleted file mode 100644 index 2bf24ef589..0000000000 --- a/examples/same54_xplained_pro/usbserial/main.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2016-2017, Niklas Hauser - * Copyright (c) 2022, Christopher Durand - * - * 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 -#include - -using namespace Board; - -modm::IODeviceWrapper usb_io_device; -modm::IOStream usb_stream(usb_io_device); - -int -main() -{ - Board::initialize(); - Board::initializeUsbFs(); - - tusb_init(); - - usb_stream << "Hello from USB" << modm::endl; - - uint32_t counter(0); - - modm::PeriodicTimer timer{500ms}; - while (true) - { - tud_task(); - if (timer.execute()) { - Led0::toggle(); - usb_stream << "loop: " << counter++ << modm::endl; - } - } - - return 0; -} diff --git a/examples/same54_xplained_pro/usbserial/project.xml b/examples/same54_xplained_pro/usbserial/project.xml deleted file mode 100644 index a43ae490d0..0000000000 --- a/examples/same54_xplained_pro/usbserial/project.xml +++ /dev/null @@ -1,12 +0,0 @@ - - modm:same54-xplained-pro - - - - - - modm:tinyusb - modm:build:scons - modm:processing:timer - - diff --git a/examples/same70_xplained/adc/project.xml b/examples/same70_xplained/adc/project.xml index afd9795e40..da3e892da1 100644 --- a/examples/same70_xplained/adc/project.xml +++ b/examples/same70_xplained/adc/project.xml @@ -1,8 +1,5 @@ modm:same70-xplained - - - modm:build:scons modm:platform:adc:0 diff --git a/examples/same70_xplained/blink/main.cpp b/examples/same70_xplained/blink/main.cpp deleted file mode 100644 index 5ca9c1db06..0000000000 --- a/examples/same70_xplained/blink/main.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2016-2017, Niklas Hauser - * Copyright (c) 2023, Luiz Carlos Gili - * - * 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 -#include -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) - { - Led0::toggle(); - modm::delay_ms(1000); - - if(ButtonSW0::read()){ - counter = 0; - } - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - - return 0; -} diff --git a/examples/same70_xplained/blink/project.xml b/examples/same70_xplained/blink/project.xml deleted file mode 100644 index dcd8d2ee66..0000000000 --- a/examples/same70_xplained/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:same70-xplained - - - - - modm:build:scons - - diff --git a/examples/same70_xplained/pwm/main.cpp b/examples/same70_xplained/pwm/main.cpp index 69e42c2ca9..6b40548821 100644 --- a/examples/same70_xplained/pwm/main.cpp +++ b/examples/same70_xplained/pwm/main.cpp @@ -55,7 +55,7 @@ int main() // Activate override mode to force outputs to low when button is pressed const auto outputs = Pwm0::Outputs::Ch2PwmH | Pwm0::Outputs::Ch2PwmL; - if (ButtonSW0::read()) + if (Button::read()) Pwm0::setOutputOverride(outputs, false); else Pwm0::clearOutputOverride(outputs, false); diff --git a/examples/same70_xplained/pwm/project.xml b/examples/same70_xplained/pwm/project.xml index 9062de0783..4e41a86dfd 100644 --- a/examples/same70_xplained/pwm/project.xml +++ b/examples/same70_xplained/pwm/project.xml @@ -1,8 +1,5 @@ modm:same70-xplained - - - modm:build:scons modm:platform:pwm:* diff --git a/examples/same70_xplained/timer/project.xml b/examples/same70_xplained/timer/project.xml index 014a5dea1f..c65f66cd44 100644 --- a/examples/same70_xplained/timer/project.xml +++ b/examples/same70_xplained/timer/project.xml @@ -1,8 +1,5 @@ modm:same70-xplained - - - modm:build:scons modm:platform:timer:* diff --git a/examples/samg55_xplained_pro/adc-uart/project.xml b/examples/samg55_xplained_pro/adc-uart/project.xml index 159b733451..c3bb3fc3c0 100644 --- a/examples/samg55_xplained_pro/adc-uart/project.xml +++ b/examples/samg55_xplained_pro/adc-uart/project.xml @@ -1,11 +1,10 @@ modm:samg55-xplained-pro - modm:build:scons modm:platform:adc - \ No newline at end of file + diff --git a/examples/samg55_xplained_pro/blink/main.cpp b/examples/samg55_xplained_pro/blink/main.cpp deleted file mode 100644 index c6f374328c..0000000000 --- a/examples/samg55_xplained_pro/blink/main.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "modm/board.hpp" - -using namespace modm::platform; - -int main() { - Board::initialize(); - - while(true) { - Board::Led::toggle(); - modm::delay_ms(500); - } - -} \ No newline at end of file diff --git a/examples/samg55_xplained_pro/blink/project.xml b/examples/samg55_xplained_pro/blink/project.xml deleted file mode 100644 index 1efaab682b..0000000000 --- a/examples/samg55_xplained_pro/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:samg55-xplained-pro - - - - - modm:build:scons - - \ No newline at end of file diff --git a/examples/samg55_xplained_pro/spi-loopback/project.xml b/examples/samg55_xplained_pro/spi-loopback/project.xml index 43d375086e..1c7c2b4a3f 100644 --- a/examples/samg55_xplained_pro/spi-loopback/project.xml +++ b/examples/samg55_xplained_pro/spi-loopback/project.xml @@ -2,10 +2,9 @@ modm:samg55-xplained-pro - modm:build:scons modm:platform:spi:0 - \ No newline at end of file + diff --git a/examples/samg55_xplained_pro/timer/project.xml b/examples/samg55_xplained_pro/timer/project.xml index 70dc0c60f9..9f5f3ace79 100644 --- a/examples/samg55_xplained_pro/timer/project.xml +++ b/examples/samg55_xplained_pro/timer/project.xml @@ -1,7 +1,6 @@ modm:samg55-xplained-pro - @@ -11,4 +10,4 @@ modm:platform:timer:2 modm:platform:timer:3 - \ No newline at end of file + diff --git a/examples/samg55_xplained_pro/usbserial/main.cpp b/examples/samg55_xplained_pro/usbserial/main.cpp deleted file mode 100644 index b5a7373073..0000000000 --- a/examples/samg55_xplained_pro/usbserial/main.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include - -using namespace modm::platform; - -int main() { - Board::initialize(); - - // Pull DP low briefly on reset to make sure USB host disconnects/reconnects - MATRIX->CCFG_SYSIO |= (CCFG_SYSIO_SYSIO11 | CCFG_SYSIO_SYSIO10); - GpioA22::setOutput(false); - modm::delay_ms(5); - GpioA22::setInput(); - - Board::initializeUsbFs(); - - tusb_init(); - - while (true) - { - // Read any received data and echo it back - uint8_t buf[64]; - uint32_t read_count; - tud_task(); - read_count = UsbUart0::read(buf, sizeof(buf)); - UsbUart0::write(buf, read_count); - Board::Led::toggle(); - } -} \ No newline at end of file diff --git a/examples/samg55_xplained_pro/usbserial/project.xml b/examples/samg55_xplained_pro/usbserial/project.xml deleted file mode 100644 index 6890ba3390..0000000000 --- a/examples/samg55_xplained_pro/usbserial/project.xml +++ /dev/null @@ -1,13 +0,0 @@ - - modm:samg55-xplained-pro - - - - - - - - modm:tinyusb - modm:build:scons - - \ No newline at end of file diff --git a/examples/samv/blink/project.xml b/examples/samv/blink/project.xml index 471cfbc581..5b21ae1fda 100644 --- a/examples/samv/blink/project.xml +++ b/examples/samv/blink/project.xml @@ -1,7 +1,6 @@ - diff --git a/examples/samv71_xplained_ultra/adc/dma/project.xml b/examples/samv71_xplained_ultra/adc/dma/project.xml index b1feab198e..16b2761cf8 100644 --- a/examples/samv71_xplained_ultra/adc/dma/project.xml +++ b/examples/samv71_xplained_ultra/adc/dma/project.xml @@ -1,8 +1,5 @@ modm:samv71-xplained-ultra - - - modm:build:scons modm:platform:adc:0 diff --git a/examples/samv71_xplained_ultra/adc/multi-channel/project.xml b/examples/samv71_xplained_ultra/adc/multi-channel/project.xml index 9df9d2782f..3cbc2cc9e5 100644 --- a/examples/samv71_xplained_ultra/adc/multi-channel/project.xml +++ b/examples/samv71_xplained_ultra/adc/multi-channel/project.xml @@ -1,8 +1,5 @@ modm:samv71-xplained-ultra - - - modm:build:scons modm:platform:adc:0 diff --git a/examples/samv71_xplained_ultra/adc/simple/project.xml b/examples/samv71_xplained_ultra/adc/simple/project.xml index 55e63382ff..3cbc2cc9e5 100644 --- a/examples/samv71_xplained_ultra/adc/simple/project.xml +++ b/examples/samv71_xplained_ultra/adc/simple/project.xml @@ -1,8 +1,5 @@ modm:samv71-xplained-ultra - - - modm:build:scons modm:platform:adc:0 diff --git a/examples/samv71_xplained_ultra/blink/main.cpp b/examples/samv71_xplained_ultra/blink/main.cpp deleted file mode 100644 index 63d68f8de1..0000000000 --- a/examples/samv71_xplained_ultra/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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(); - - // 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) - { - Led0::toggle(); - Led1::toggle(); - modm::delay(ButtonSW0::read() ? 500ms : 100ms); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - - return 0; -} diff --git a/examples/samv71_xplained_ultra/blink/project.xml b/examples/samv71_xplained_ultra/blink/project.xml deleted file mode 100644 index 44ac35294a..0000000000 --- a/examples/samv71_xplained_ultra/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:samv71-xplained-ultra - - - - - modm:build:scons - - diff --git a/examples/samv71_xplained_ultra/dac/project.xml b/examples/samv71_xplained_ultra/dac/project.xml index 7522ed67b8..df54354992 100644 --- a/examples/samv71_xplained_ultra/dac/project.xml +++ b/examples/samv71_xplained_ultra/dac/project.xml @@ -1,8 +1,5 @@ modm:samv71-xplained-ultra - - - modm:build:scons modm:platform:dac diff --git a/examples/samv71_xplained_ultra/dma/block_transfer/project.xml b/examples/samv71_xplained_ultra/dma/block_transfer/project.xml index fc3fefaf67..ce4f94a1fa 100644 --- a/examples/samv71_xplained_ultra/dma/block_transfer/project.xml +++ b/examples/samv71_xplained_ultra/dma/block_transfer/project.xml @@ -1,8 +1,5 @@ modm:samv71-xplained-ultra - - - modm:build:scons modm:platform:dac diff --git a/examples/samv71_xplained_ultra/dma/linked_list_transfer/project.xml b/examples/samv71_xplained_ultra/dma/linked_list_transfer/project.xml index 7b2b6dd27e..ce4f94a1fa 100644 --- a/examples/samv71_xplained_ultra/dma/linked_list_transfer/project.xml +++ b/examples/samv71_xplained_ultra/dma/linked_list_transfer/project.xml @@ -1,8 +1,5 @@ modm:samv71-xplained-ultra - - - modm:build:scons modm:platform:dac diff --git a/examples/samv71_xplained_ultra/fdcan/project.xml b/examples/samv71_xplained_ultra/fdcan/project.xml index 7621eadfab..7a9c0a0dad 100644 --- a/examples/samv71_xplained_ultra/fdcan/project.xml +++ b/examples/samv71_xplained_ultra/fdcan/project.xml @@ -1,7 +1,6 @@ modm:samv71-xplained-ultra - diff --git a/examples/samv71_xplained_ultra/i2c-eeprom/at24mac402/project.xml b/examples/samv71_xplained_ultra/i2c-eeprom/at24mac402/project.xml index 5f7c10e243..e36086fc0e 100644 --- a/examples/samv71_xplained_ultra/i2c-eeprom/at24mac402/project.xml +++ b/examples/samv71_xplained_ultra/i2c-eeprom/at24mac402/project.xml @@ -1,8 +1,5 @@ modm:samv71-xplained-ultra - - - modm:build:scons modm:driver:at24mac402 diff --git a/examples/samv71_xplained_ultra/i2c-eeprom/generic/project.xml b/examples/samv71_xplained_ultra/i2c-eeprom/generic/project.xml index f01217b264..1c3ebd6660 100644 --- a/examples/samv71_xplained_ultra/i2c-eeprom/generic/project.xml +++ b/examples/samv71_xplained_ultra/i2c-eeprom/generic/project.xml @@ -1,8 +1,5 @@ modm:samv71-xplained-ultra - - - modm:build:scons modm:driver:i2c.eeprom diff --git a/examples/samv71_xplained_ultra/mcp3008/project.xml b/examples/samv71_xplained_ultra/mcp3008/project.xml index 6d11a839de..807b87434f 100644 --- a/examples/samv71_xplained_ultra/mcp3008/project.xml +++ b/examples/samv71_xplained_ultra/mcp3008/project.xml @@ -1,8 +1,5 @@ modm:samv71-xplained-ultra - - - modm:build:scons modm:driver:mcp3008 diff --git a/examples/samv71_xplained_ultra/pwm/main.cpp b/examples/samv71_xplained_ultra/pwm/main.cpp index a2d7d0cf5a..e2e64ea438 100644 --- a/examples/samv71_xplained_ultra/pwm/main.cpp +++ b/examples/samv71_xplained_ultra/pwm/main.cpp @@ -55,7 +55,7 @@ int main() // Activate override mode to force outputs to low when button is pressed const auto outputs = Pwm0::Outputs::Ch2PwmH | Pwm0::Outputs::Ch2PwmL; - if (ButtonSW0::read()) + if (Button::read()) Pwm0::setOutputOverride(outputs, false); else Pwm0::clearOutputOverride(outputs, false); diff --git a/examples/samv71_xplained_ultra/pwm/project.xml b/examples/samv71_xplained_ultra/pwm/project.xml index 9c6917a4ce..595fb57d0a 100644 --- a/examples/samv71_xplained_ultra/pwm/project.xml +++ b/examples/samv71_xplained_ultra/pwm/project.xml @@ -1,8 +1,5 @@ modm:samv71-xplained-ultra - - - modm:build:scons modm:platform:pwm:* diff --git a/examples/samv71_xplained_ultra/timer/project.xml b/examples/samv71_xplained_ultra/timer/project.xml index be65ad7951..d82f07be38 100644 --- a/examples/samv71_xplained_ultra/timer/project.xml +++ b/examples/samv71_xplained_ultra/timer/project.xml @@ -1,8 +1,5 @@ modm:samv71-xplained-ultra - - - modm:build:scons modm:platform:timer:* diff --git a/examples/srxe/blink/main.cpp b/examples/srxe/blink/main.cpp deleted file mode 100644 index f9c7723690..0000000000 --- a/examples/srxe/blink/main.cpp +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2021, Tomasz Wasilczyk - * - * 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 - -int -main() -{ - Board::initialize(); - - while (true) - { - Board::LedDebug::toggle(); - modm::delay(1s); - } -} diff --git a/examples/srxe/blink/project.xml b/examples/srxe/blink/project.xml deleted file mode 100644 index 5b21e4583c..0000000000 --- a/examples/srxe/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:srxe - - - - - modm:build:scons - - diff --git a/examples/srxe/display/project.xml b/examples/srxe/display/project.xml index 5501905b2f..6e67187de1 100644 --- a/examples/srxe/display/project.xml +++ b/examples/srxe/display/project.xml @@ -1,8 +1,5 @@ modm:srxe - - - modm:build:scons diff --git a/examples/stm32_f4ve/flash/project.xml b/examples/stm32_f4ve/flash/project.xml index a87ffbc37c..39dbb68467 100644 --- a/examples/stm32_f4ve/flash/project.xml +++ b/examples/stm32_f4ve/flash/project.xml @@ -1,8 +1,5 @@ modm:stm32_f4ve - - - modm:platform:gpio modm:platform:uart:2 diff --git a/examples/stm32_f4ve/gui/project.xml b/examples/stm32_f4ve/gui/project.xml index 8bf23c0a26..8999865b94 100644 --- a/examples/stm32_f4ve/gui/project.xml +++ b/examples/stm32_f4ve/gui/project.xml @@ -1,7 +1,6 @@ modm:stm32_f4ve - diff --git a/examples/stm32f030f4p6_demo_board/adc/project.xml b/examples/stm32f030f4p6_demo_board/adc/project.xml index 72f175d2e3..58cef53ddc 100644 --- a/examples/stm32f030f4p6_demo_board/adc/project.xml +++ b/examples/stm32f030f4p6_demo_board/adc/project.xml @@ -1,7 +1,6 @@ modm:stm32f030_demo - diff --git a/examples/stm32f030f4p6_demo_board/blink/main.cpp b/examples/stm32f030f4p6_demo_board/blink/main.cpp deleted file mode 100644 index cce170aadc..0000000000 --- a/examples/stm32f030f4p6_demo_board/blink/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2018, 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; - -/* - * Blinks the orange user LED with 1 Hz. - * It is on for 90% of the time and off for 10% of the time. - */ - -int -main() -{ - Board::initialize(); - - LedOrange::set(); - - while (true) - { - LedOrange::set(); - modm::delay(900ms); - - LedOrange::reset(); - modm::delay(100ms); - } - - return 0; -} diff --git a/examples/stm32f030f4p6_demo_board/blink/openocd.cfg b/examples/stm32f030f4p6_demo_board/blink/openocd.cfg deleted file mode 100644 index b157e7e432..0000000000 --- a/examples/stm32f030f4p6_demo_board/blink/openocd.cfg +++ /dev/null @@ -1,2 +0,0 @@ -# Replace this with your custom programmer -source [find interface/stlink-v2.cfg] diff --git a/examples/stm32f030f4p6_demo_board/blink/project.xml b/examples/stm32f030f4p6_demo_board/blink/project.xml deleted file mode 100644 index 8777cda2cb..0000000000 --- a/examples/stm32f030f4p6_demo_board/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:stm32f030_demo - - - - - - modm:build:scons - - diff --git a/examples/stm32f072_discovery/blink/main.cpp b/examples/stm32f072_discovery/blink/main.cpp deleted file mode 100644 index 6759121eb2..0000000000 --- a/examples/stm32f072_discovery/blink/main.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2016, Kevin Läufer - * 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(); - - LedUp::set(); - LedDown::set(); - - while (true) { - LedRight::toggle(); - LedUp::toggle(); - LedLeft::toggle(); - LedDown::toggle(); - modm::delay(1000ms); - } -} diff --git a/examples/stm32f072_discovery/blink/project.xml b/examples/stm32f072_discovery/blink/project.xml deleted file mode 100644 index 54dd3da710..0000000000 --- a/examples/stm32f072_discovery/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:disco-f072rb - - - - - modm:build:scons - - diff --git a/examples/stm32f072_discovery/can/project.xml b/examples/stm32f072_discovery/can/project.xml index d11d8f3901..4f86d286f8 100644 --- a/examples/stm32f072_discovery/can/project.xml +++ b/examples/stm32f072_discovery/can/project.xml @@ -1,8 +1,5 @@ modm:disco-f072rb - - - modm:debug modm:platform:can diff --git a/examples/stm32f072_discovery/hard_fault/main.cpp b/examples/stm32f072_discovery/hard_fault/main.cpp deleted file mode 100644 index 40916af434..0000000000 --- a/examples/stm32f072_discovery/hard_fault/main.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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 -#include - -// ---------------------------------------------------------------------------- -// Set the log level -#undef MODM_LOG_LEVEL -#define MODM_LOG_LEVEL modm::log::INFO - -// Create an IODeviceWrapper around the Uart Peripheral we want to use -modm::IODeviceWrapper< Usart1, modm::IOBuffer::BlockIfFull > loggerDevice; - -// Set all four logger streams to use the UART -modm::log::Logger modm::log::debug(loggerDevice); -modm::log::Logger modm::log::info(loggerDevice); -modm::log::Logger modm::log::warning(loggerDevice); -modm::log::Logger modm::log::error(loggerDevice); - - -int -main() -{ - Board::initialize(); - - // initialize Uart for MODM_LOG - Usart1::connect(); - Usart1::initialize(); - - if (FaultReporter::hasReport()) - { - MODM_LOG_ERROR << "\n\nHardFault! Copy the data into a 'coredump.txt' file, "; - MODM_LOG_ERROR << "then execute\n\n\tscons postmortem firmware=" << modm::hex; - for (const auto data : FaultReporter::buildId()) MODM_LOG_ERROR << data; - MODM_LOG_ERROR << "\n\n"; - for (const auto data : FaultReporter()) - MODM_LOG_ERROR << modm::hex << data << modm::flush; - MODM_LOG_ERROR << "\n\n\n" << modm::flush; - FaultReporter::clearAndReboot(); - } - - MODM_LOG_INFO << "Causing a Hardfault now!" << modm::endl; - - // simulate some stack usage - asm volatile ("push {r0-r7}"); - asm volatile ("push {r0-r7}"); - asm volatile ("push {r0-r7}"); - asm volatile ("pop {r0-r7}"); - asm volatile ("pop {r0-r7}"); - asm volatile ("pop {r0-r7}"); - - // load some patterns into r0-r7 - asm volatile ("ldr r0, =0xA000000A"); - asm volatile ("ldr r1, =0x0AAAAAA0"); - asm volatile ("ldr r2, =0x00A00A00"); - asm volatile ("ldr r3, =0x000AA000"); - asm volatile ("ldr r4, =0x04040404"); - asm volatile ("ldr r5, =0x05050505"); - asm volatile ("ldr r6, =0x06060606"); - asm volatile ("ldr r7, =0x07070707"); - - // execute unused stack - asm volatile ("ldr r4, =0x20000247"); - asm volatile ("bx r4"); - - // undefined instruction - asm volatile (".short 0xde00"); - - // stack overflow - while(true) { - asm volatile ("push {r0-r7}"); - } - - while (true) - { - modm::delay(1000ms); - Board::LedUp::toggle(); - } - - return 0; -} diff --git a/examples/stm32f072_discovery/hard_fault/project.xml b/examples/stm32f072_discovery/hard_fault/project.xml deleted file mode 100644 index 248805d70f..0000000000 --- a/examples/stm32f072_discovery/hard_fault/project.xml +++ /dev/null @@ -1,12 +0,0 @@ - - modm:disco-f072rb - - - - - modm:debug - modm:platform:fault - modm:platform:uart:1 - modm:build:scons - - diff --git a/examples/stm32f072_discovery/rotation/project.xml b/examples/stm32f072_discovery/rotation/project.xml index a734c89d24..8ee672feaf 100644 --- a/examples/stm32f072_discovery/rotation/project.xml +++ b/examples/stm32f072_discovery/rotation/project.xml @@ -1,8 +1,5 @@ modm:disco-f072rb - - - modm:math:filter modm:platform:gpio diff --git a/examples/stm32f072_discovery/stusb4500/project.xml b/examples/stm32f072_discovery/stusb4500/project.xml index 89a6908eaa..5506f1fd30 100644 --- a/examples/stm32f072_discovery/stusb4500/project.xml +++ b/examples/stm32f072_discovery/stusb4500/project.xml @@ -1,8 +1,5 @@ modm:disco-f072rb - - - modm:build:scons modm:debug diff --git a/examples/stm32f072_discovery/tmp102/project.xml b/examples/stm32f072_discovery/tmp102/project.xml index 93f529b3e6..4a50703fce 100644 --- a/examples/stm32f072_discovery/tmp102/project.xml +++ b/examples/stm32f072_discovery/tmp102/project.xml @@ -1,8 +1,5 @@ modm:disco-f072rb - - - modm:driver:tmp102 modm:io diff --git a/examples/stm32f072_discovery/uart/project.xml b/examples/stm32f072_discovery/uart/project.xml index b78434ebce..cd4f1e5d93 100644 --- a/examples/stm32f072_discovery/uart/project.xml +++ b/examples/stm32f072_discovery/uart/project.xml @@ -1,8 +1,5 @@ modm:disco-f072rb - - - modm:platform:gpio modm:platform:uart:1 diff --git a/examples/stm32f072_discovery/unaligned_access/project.xml b/examples/stm32f072_discovery/unaligned_access/project.xml index 9d7b68f789..5f82e73fb8 100644 --- a/examples/stm32f072_discovery/unaligned_access/project.xml +++ b/examples/stm32f072_discovery/unaligned_access/project.xml @@ -1,8 +1,5 @@ modm:disco-f072rb - - - modm:architecture:unaligned modm:container diff --git a/examples/stm32f0_discovery/blink/main.cpp b/examples/stm32f0_discovery/blink/main.cpp deleted file mode 100644 index 227ebd3cf6..0000000000 --- a/examples/stm32f0_discovery/blink/main.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2017, Sascha Schade - * - * 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(); - - LedGreen::set(); - LedBlue::reset(); - - while (true) { - LedGreen::toggle(); - LedBlue::toggle(); - modm::delay(Board::Button::read() ? 0.5s : 1s); - } -} diff --git a/examples/stm32f0_discovery/blink/project.xml b/examples/stm32f0_discovery/blink/project.xml deleted file mode 100644 index 654ae724d3..0000000000 --- a/examples/stm32f0_discovery/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:disco-f051r8 - - - - - modm:build:scons - - diff --git a/examples/stm32f0_discovery/logger/project.xml b/examples/stm32f0_discovery/logger/project.xml index 0ae889a3ca..cb2b3b4d56 100644 --- a/examples/stm32f0_discovery/logger/project.xml +++ b/examples/stm32f0_discovery/logger/project.xml @@ -1,7 +1,6 @@ modm:disco-f051r8 - diff --git a/examples/stm32f1_discovery/blink/main.cpp b/examples/stm32f1_discovery/blink/main.cpp deleted file mode 100644 index 736e444999..0000000000 --- a/examples/stm32f1_discovery/blink/main.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2015-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(); - - LedBlue::set(); - - while (true) - { - LedGreen::toggle(); - modm::delay(Button::read() ? 100ms : 300ms); - - LedBlue::toggle(); - modm::delay(Button::read() ? 100ms : 300ms); - } - - return 0; -} diff --git a/examples/stm32f1_discovery/blink/project.xml b/examples/stm32f1_discovery/blink/project.xml deleted file mode 100644 index aa56fb6396..0000000000 --- a/examples/stm32f1_discovery/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:disco-f100rb - - - - - modm:build:scons - - diff --git a/examples/stm32f1_discovery/logger/project.xml b/examples/stm32f1_discovery/logger/project.xml index a623eb82af..1af92a2cac 100644 --- a/examples/stm32f1_discovery/logger/project.xml +++ b/examples/stm32f1_discovery/logger/project.xml @@ -1,8 +1,5 @@ modm:disco-f100rb - - - modm:debug modm:platform:gpio diff --git a/examples/stm32f3_discovery/accelerometer/project.xml b/examples/stm32f3_discovery/accelerometer/project.xml index 4b6ec7cbf5..ec994f6913 100644 --- a/examples/stm32f3_discovery/accelerometer/project.xml +++ b/examples/stm32f3_discovery/accelerometer/project.xml @@ -1,7 +1,6 @@ modm:disco-f303vc - diff --git a/examples/stm32f3_discovery/adc/continous/project.xml b/examples/stm32f3_discovery/adc/continous/project.xml index f1574f5092..59c84698b5 100644 --- a/examples/stm32f3_discovery/adc/continous/project.xml +++ b/examples/stm32f3_discovery/adc/continous/project.xml @@ -1,8 +1,5 @@ modm:disco-f303vc - - - modm:debug modm:platform:adc:1 diff --git a/examples/stm32f3_discovery/adc/interrupt/project.xml b/examples/stm32f3_discovery/adc/interrupt/project.xml index 823d864dd3..1050270a62 100644 --- a/examples/stm32f3_discovery/adc/interrupt/project.xml +++ b/examples/stm32f3_discovery/adc/interrupt/project.xml @@ -1,8 +1,5 @@ modm:disco-f303vc - - - modm:debug modm:platform:adc:4 diff --git a/examples/stm32f3_discovery/adc/simple/project.xml b/examples/stm32f3_discovery/adc/simple/project.xml index 5633f09491..1050270a62 100644 --- a/examples/stm32f3_discovery/adc/simple/project.xml +++ b/examples/stm32f3_discovery/adc/simple/project.xml @@ -1,8 +1,5 @@ modm:disco-f303vc - - - modm:debug modm:platform:adc:4 diff --git a/examples/stm32f3_discovery/blink/main.cpp b/examples/stm32f3_discovery/blink/main.cpp deleted file mode 100644 index 12ac9b1080..0000000000 --- a/examples/stm32f3_discovery/blink/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2013, Kevin Läufer - * Copyright (c) 2013-2014, Sascha Schade - * Copyright (c) 2013, 2015-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(); - - Board::LedNorth::set(); - - while (true) - { - Board::LedNorth::toggle(); - modm::delay(100ms); - Board::LedNorthEast::toggle(); - modm::delay(100ms); - Board::LedEast::toggle(); - modm::delay(100ms); - Board::LedSouthEast::toggle(); - modm::delay(100ms); - Board::LedSouth::toggle(); - modm::delay(100ms); - Board::LedSouthWest::toggle(); - modm::delay(100ms); - Board::LedWest::toggle(); - modm::delay(100ms); - Board::LedNorthWest::toggle(); - modm::delay(100ms); - } - - return 0; -} diff --git a/examples/stm32f3_discovery/blink/project.xml b/examples/stm32f3_discovery/blink/project.xml deleted file mode 100644 index 41edb9fc5c..0000000000 --- a/examples/stm32f3_discovery/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:disco-f303vc - - - - - modm:build:scons - - diff --git a/examples/stm32f3_discovery/can/project.xml b/examples/stm32f3_discovery/can/project.xml index 9be2012afc..a48a341535 100644 --- a/examples/stm32f3_discovery/can/project.xml +++ b/examples/stm32f3_discovery/can/project.xml @@ -1,8 +1,5 @@ modm:disco-f303vc - - - modm:debug modm:platform:can diff --git a/examples/stm32f3_discovery/comp/project.xml b/examples/stm32f3_discovery/comp/project.xml index f9ea0ccae3..8030a8f8d6 100644 --- a/examples/stm32f3_discovery/comp/project.xml +++ b/examples/stm32f3_discovery/comp/project.xml @@ -1,8 +1,5 @@ modm:disco-f303vc - - - modm:debug modm:platform:uart:2 diff --git a/examples/stm32f3_discovery/ft245/project.xml b/examples/stm32f3_discovery/ft245/project.xml index 8ca3dc863f..3a7c7ad24a 100644 --- a/examples/stm32f3_discovery/ft245/project.xml +++ b/examples/stm32f3_discovery/ft245/project.xml @@ -1,8 +1,5 @@ modm:disco-f303vc - - - modm:driver:ft245 modm:platform:gpio diff --git a/examples/stm32f3_discovery/gdb/project.xml b/examples/stm32f3_discovery/gdb/project.xml index 98a4f0bcfa..af6b37e819 100644 --- a/examples/stm32f3_discovery/gdb/project.xml +++ b/examples/stm32f3_discovery/gdb/project.xml @@ -1,8 +1,5 @@ modm:disco-f303vc - - - modm:platform:can modm:build:scons diff --git a/examples/stm32f3_discovery/rotation/project.xml b/examples/stm32f3_discovery/rotation/project.xml index 706008df20..25d3d534ae 100644 --- a/examples/stm32f3_discovery/rotation/project.xml +++ b/examples/stm32f3_discovery/rotation/project.xml @@ -1,7 +1,6 @@ modm:disco-f303vc - diff --git a/examples/stm32f3_discovery/timer/basic/project.xml b/examples/stm32f3_discovery/timer/basic/project.xml index a6ea496ae8..d8b730cf84 100644 --- a/examples/stm32f3_discovery/timer/basic/project.xml +++ b/examples/stm32f3_discovery/timer/basic/project.xml @@ -1,8 +1,5 @@ modm:disco-f303vc - - - modm:platform:timer:1 modm:build:scons diff --git a/examples/stm32f3_discovery/uart/hal/project.xml b/examples/stm32f3_discovery/uart/hal/project.xml index f3cb13a59a..f92f5752f0 100644 --- a/examples/stm32f3_discovery/uart/hal/project.xml +++ b/examples/stm32f3_discovery/uart/hal/project.xml @@ -1,8 +1,5 @@ modm:disco-f303vc - - - modm:platform:gpio modm:platform:uart:2 diff --git a/examples/stm32f3_discovery/uart/logger/project.xml b/examples/stm32f3_discovery/uart/logger/project.xml index 37f7343acd..f737f8191c 100644 --- a/examples/stm32f3_discovery/uart/logger/project.xml +++ b/examples/stm32f3_discovery/uart/logger/project.xml @@ -1,8 +1,5 @@ modm:disco-f303vc - - - modm:debug modm:platform:gpio diff --git a/examples/stm32f3_discovery/usb_dfu/project.xml b/examples/stm32f3_discovery/usb_dfu/project.xml index 9e3d9b6453..935f781208 100644 --- a/examples/stm32f3_discovery/usb_dfu/project.xml +++ b/examples/stm32f3_discovery/usb_dfu/project.xml @@ -1,7 +1,6 @@ modm:disco-f303vc - diff --git a/examples/stm32f401_discovery/accelerometer/project.xml b/examples/stm32f401_discovery/accelerometer/project.xml index bd149df959..e8f1bb8b42 100644 --- a/examples/stm32f401_discovery/accelerometer/project.xml +++ b/examples/stm32f401_discovery/accelerometer/project.xml @@ -1,7 +1,6 @@ modm:disco-f401vc - diff --git a/examples/stm32f401_discovery/blink/main.cpp b/examples/stm32f401_discovery/blink/main.cpp deleted file mode 100644 index 0e0046fa3a..0000000000 --- a/examples/stm32f401_discovery/blink/main.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2011, Georgi Grinshpun - * Copyright (c) 2011-2012, Fabian Greif - * Copyright (c) 2012, 2014, Sascha Schade - * Copyright (c) 2013, Kevin Läufer - * Copyright (c) 2013, 2015-2017, Niklas Hauser - * Copyright (c) 2024, Carl Treudler - * - * 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() -{ - initialize(); - - LedOrange::set(); - LedRed::set(); - - while (true) - { - LedBlue::toggle(); - LedGreen::toggle(); - LedOrange::toggle(); - LedRed::toggle(); - modm::delay(Button::read() ? 250ms : 500ms); - } - - return 0; -} diff --git a/examples/stm32f401_discovery/blink/project.xml b/examples/stm32f401_discovery/blink/project.xml deleted file mode 100644 index d56c28e21d..0000000000 --- a/examples/stm32f401_discovery/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:disco-f401vc - - - - - modm:build:scons - - diff --git a/examples/stm32f401_discovery/gyroscope/project.xml b/examples/stm32f401_discovery/gyroscope/project.xml index f175575740..19dd500536 100644 --- a/examples/stm32f401_discovery/gyroscope/project.xml +++ b/examples/stm32f401_discovery/gyroscope/project.xml @@ -1,8 +1,5 @@ modm:disco-f401vc - - - modm:driver:l3gd20 modm:math:filter diff --git a/examples/stm32f401_discovery/uart/project.xml b/examples/stm32f401_discovery/uart/project.xml index 6f1b628e06..1d3d759adb 100644 --- a/examples/stm32f401_discovery/uart/project.xml +++ b/examples/stm32f401_discovery/uart/project.xml @@ -1,8 +1,5 @@ modm:disco-f401vc - - - modm:platform:gpio modm:platform:uart:2 diff --git a/examples/stm32f407vet6_devebox/blinky/main.cpp b/examples/stm32f407vet6_devebox/blinky/main.cpp deleted file mode 100644 index d8251fccab..0000000000 --- a/examples/stm32f407vet6_devebox/blinky/main.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2020, Sascha Schade - * - * 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(); - - while(true) - { - LedGreen::toggle(); - modm::delay(Button::read() ? 100ms : 500ms); - } - - return 0; -} diff --git a/examples/stm32f407vet6_devebox/blinky/openocd.cfg b/examples/stm32f407vet6_devebox/blinky/openocd.cfg deleted file mode 100644 index 2edce20b3d..0000000000 --- a/examples/stm32f407vet6_devebox/blinky/openocd.cfg +++ /dev/null @@ -1,2 +0,0 @@ -# Replace this with your custom programmer -source [find interface/stlink.cfg] diff --git a/examples/stm32f407vet6_devebox/blinky/project.xml b/examples/stm32f407vet6_devebox/blinky/project.xml deleted file mode 100644 index 4daef7fc53..0000000000 --- a/examples/stm32f407vet6_devebox/blinky/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:devebox-stm32f4xx - - - - - - modm:build:scons - - diff --git a/examples/stm32f407vet6_devebox/flash/project.xml b/examples/stm32f407vet6_devebox/flash/project.xml index 64ae61576a..2a29382536 100644 --- a/examples/stm32f407vet6_devebox/flash/project.xml +++ b/examples/stm32f407vet6_devebox/flash/project.xml @@ -1,7 +1,6 @@ modm:devebox-stm32f4xx - diff --git a/examples/stm32f407vet6_devebox/logger/project.xml b/examples/stm32f407vet6_devebox/logger/project.xml index d7e80352cd..2a29382536 100644 --- a/examples/stm32f407vet6_devebox/logger/project.xml +++ b/examples/stm32f407vet6_devebox/logger/project.xml @@ -1,7 +1,6 @@ modm:devebox-stm32f4xx - diff --git a/examples/stm32f429_discovery/blink/main.cpp b/examples/stm32f429_discovery/blink/main.cpp deleted file mode 100644 index bb109b0972..0000000000 --- a/examples/stm32f429_discovery/blink/main.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2015-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(); - - LedRed::set(); - usb::Vbus::setOutput(modm::Gpio::Low); - usb::Overcurrent::setOutput(modm::Gpio::Low); - - // 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) - { - LedRed::toggle(); - LedGreen::toggle(); - - modm::delay(Button::read() ? 125ms : 500ms); - - usb::Vbus::toggle(); - usb::Overcurrent::toggle(); - - modm::delay(Button::read() ? 125ms : 500ms); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - - return 0; -} diff --git a/examples/stm32f429_discovery/blink/project.xml b/examples/stm32f429_discovery/blink/project.xml deleted file mode 100644 index 5ba2769e31..0000000000 --- a/examples/stm32f429_discovery/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:disco-f429zi - - - - - modm:platform:gpio - modm:build:scons - - diff --git a/examples/stm32f469_discovery/assert/project.xml b/examples/stm32f469_discovery/assert/project.xml index 7b44f3fb0d..fc8a2c2858 100644 --- a/examples/stm32f469_discovery/assert/project.xml +++ b/examples/stm32f469_discovery/assert/project.xml @@ -1,7 +1,6 @@ modm:disco-f469ni - diff --git a/examples/stm32f469_discovery/blink/project.xml b/examples/stm32f469_discovery/blink/project.xml index 729234da1e..d1e835f636 100644 --- a/examples/stm32f469_discovery/blink/project.xml +++ b/examples/stm32f469_discovery/blink/project.xml @@ -1,8 +1,5 @@ modm:disco-f469ni - - - modm:platform:exti modm:processing:timer diff --git a/examples/stm32f469_discovery/can/project.xml b/examples/stm32f469_discovery/can/project.xml index 4612114e79..e3b52953c8 100644 --- a/examples/stm32f469_discovery/can/project.xml +++ b/examples/stm32f469_discovery/can/project.xml @@ -1,8 +1,5 @@ modm:disco-f469ni - - - modm:debug modm:platform:can:1 diff --git a/examples/stm32f469_discovery/display/project.xml b/examples/stm32f469_discovery/display/project.xml index b33b598aac..466e22622f 100644 --- a/examples/stm32f469_discovery/display/project.xml +++ b/examples/stm32f469_discovery/display/project.xml @@ -1,8 +1,5 @@ modm:disco-f469ni - - - modm:build:scons diff --git a/examples/stm32f469_discovery/exceptions_rtti/project.xml b/examples/stm32f469_discovery/exceptions_rtti/project.xml index 60aeffe8d6..323341900d 100644 --- a/examples/stm32f469_discovery/exceptions_rtti/project.xml +++ b/examples/stm32f469_discovery/exceptions_rtti/project.xml @@ -1,7 +1,6 @@ modm:disco-f469ni - diff --git a/examples/stm32f469_discovery/game_of_life/project.xml b/examples/stm32f469_discovery/game_of_life/project.xml index 4d73e97fc8..dc513e88f7 100644 --- a/examples/stm32f469_discovery/game_of_life/project.xml +++ b/examples/stm32f469_discovery/game_of_life/project.xml @@ -1,8 +1,5 @@ modm:disco-f469ni - - - modm:architecture:memory modm:processing:timer diff --git a/examples/stm32f469_discovery/hard_fault/main.cpp b/examples/stm32f469_discovery/hard_fault/main.cpp deleted file mode 100644 index dce5c6e18b..0000000000 --- a/examples/stm32f469_discovery/hard_fault/main.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2019, 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; - -__attribute__((noinline)) -void function1(uint32_t bla) -{ - static_cast(bla); - - if (Button::read()) { - // execute undefined instructed - // the hard fault handler will blink the blue LED - // or, if the debugger is connected, will trigger a breakpoint - asm volatile (".short 0xde00"); - } -} - -__attribute__((noinline)) -void function2(uint32_t bla, uint8_t blub) -{ - static_cast(blub); - function1(bla); -} - -void modm_hardfault_entry() -{ - // Put hardware in safe mode here - Board::Leds::set(); - // But do not wait forever - modm::delay(100ms); - // Do not depend on interrupts in this function (buffered UART etc!) -} - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - LedOrange::set(); - - uint32_t *const ptr = new uint32_t[20*1024]; - MODM_LOG_INFO << "Can I allocate 20kB? answer: " << ptr << modm::endl; - - if (FaultReporter::hasReport()) - { - MODM_LOG_ERROR << "\n\nHardFault! Copy the data into a 'coredump.txt' file, "; - MODM_LOG_ERROR << "then execute\n\n\tscons debug-coredump "; -#ifdef MODM_DEBUG_BUILD - MODM_LOG_ERROR << "profile=debug "; -#endif - MODM_LOG_ERROR << "firmware=" << modm::hex; - for (const auto data : FaultReporter::buildId()) MODM_LOG_ERROR << data; - MODM_LOG_ERROR << "\nor\n\tmake debug-coredump"; -#ifdef MODM_DEBUG_BUILD - MODM_LOG_ERROR << " profile=debug"; -#endif - MODM_LOG_ERROR << "\n\n"; - for (const auto data : FaultReporter()) - MODM_LOG_ERROR << modm::hex << data << modm::flush; - MODM_LOG_ERROR << "\n\n\n" << modm::flush; - FaultReporter::clearAndReboot(); - } - - MODM_LOG_INFO << "Hold Button to cause a Hardfault!" << modm::endl; - - if (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) { - // if this LED is on, the debugger is connected - LedRed::set(); - MODM_LOG_INFO << "Debugger connected!" << modm::endl; - } - - while (true) - { - LedGreen::toggle(); - LedOrange::toggle(); - - function2(23, 43); - - modm::delay(250ms); - } - - return 0; -} diff --git a/examples/stm32f469_discovery/hard_fault/project.xml b/examples/stm32f469_discovery/hard_fault/project.xml deleted file mode 100644 index 87a9281b5c..0000000000 --- a/examples/stm32f469_discovery/hard_fault/project.xml +++ /dev/null @@ -1,13 +0,0 @@ - - modm:disco-f469ni - - - - - - modm:platform:fault - modm:build:scons - modm:build:cmake - modm:build:make - - diff --git a/examples/stm32f469_discovery/lvgl/project.xml b/examples/stm32f469_discovery/lvgl/project.xml index 8eda1b8f7b..046bf803ac 100644 --- a/examples/stm32f469_discovery/lvgl/project.xml +++ b/examples/stm32f469_discovery/lvgl/project.xml @@ -1,8 +1,5 @@ modm:disco-f469ni - - - modm:build:scons modm:processing:timer diff --git a/examples/stm32f469_discovery/ports/project.xml b/examples/stm32f469_discovery/ports/project.xml index 9b12ee9513..9c2ce89957 100644 --- a/examples/stm32f469_discovery/ports/project.xml +++ b/examples/stm32f469_discovery/ports/project.xml @@ -1,8 +1,5 @@ modm:disco-f469ni - - - modm:platform:gpio modm:build:scons diff --git a/examples/stm32f469_discovery/printf/project.xml b/examples/stm32f469_discovery/printf/project.xml index 9d1b3022b0..9c2ce89957 100644 --- a/examples/stm32f469_discovery/printf/project.xml +++ b/examples/stm32f469_discovery/printf/project.xml @@ -1,8 +1,5 @@ modm:disco-f469ni - - - modm:platform:gpio modm:build:scons diff --git a/examples/stm32f469_discovery/threadsafe_statics/project.xml b/examples/stm32f469_discovery/threadsafe_statics/project.xml index 50323946c4..9c2ce89957 100644 --- a/examples/stm32f469_discovery/threadsafe_statics/project.xml +++ b/examples/stm32f469_discovery/threadsafe_statics/project.xml @@ -1,8 +1,5 @@ modm:disco-f469ni - - - modm:platform:gpio modm:build:scons diff --git a/examples/stm32f469_discovery/tlsf-allocator/project.xml b/examples/stm32f469_discovery/tlsf-allocator/project.xml index 535905b575..9ab6c1cf6f 100644 --- a/examples/stm32f469_discovery/tlsf-allocator/project.xml +++ b/examples/stm32f469_discovery/tlsf-allocator/project.xml @@ -1,8 +1,5 @@ modm:disco-f469ni - - - modm:architecture:memory modm:build:scons diff --git a/examples/stm32f469_discovery/touchscreen/project.xml b/examples/stm32f469_discovery/touchscreen/project.xml index d3432655d0..9284373c6b 100644 --- a/examples/stm32f469_discovery/touchscreen/project.xml +++ b/examples/stm32f469_discovery/touchscreen/project.xml @@ -1,7 +1,6 @@ modm:disco-f469ni - diff --git a/examples/stm32f4_discovery/accelerometer/project.xml b/examples/stm32f4_discovery/accelerometer/project.xml index 01bd492dce..14c83a482c 100644 --- a/examples/stm32f4_discovery/accelerometer/project.xml +++ b/examples/stm32f4_discovery/accelerometer/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:driver:lis302dl modm:math:filter diff --git a/examples/stm32f4_discovery/adc/interrupt/project.xml b/examples/stm32f4_discovery/adc/interrupt/project.xml index 0db8cbd05d..a36760e19e 100644 --- a/examples/stm32f4_discovery/adc/interrupt/project.xml +++ b/examples/stm32f4_discovery/adc/interrupt/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:debug modm:platform:adc:2 diff --git a/examples/stm32f4_discovery/adc/oversample/project.xml b/examples/stm32f4_discovery/adc/oversample/project.xml index e034bf700a..acf35c5d49 100644 --- a/examples/stm32f4_discovery/adc/oversample/project.xml +++ b/examples/stm32f4_discovery/adc/oversample/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:debug modm:driver:adc_sampler diff --git a/examples/stm32f4_discovery/adc/simple/project.xml b/examples/stm32f4_discovery/adc/simple/project.xml index b2e6e47ce4..a36760e19e 100644 --- a/examples/stm32f4_discovery/adc/simple/project.xml +++ b/examples/stm32f4_discovery/adc/simple/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:debug modm:platform:adc:2 diff --git a/examples/stm32f4_discovery/app_uart_sniffer/project.xml b/examples/stm32f4_discovery/app_uart_sniffer/project.xml index 71fa4dc4e3..cc860b1b0d 100644 --- a/examples/stm32f4_discovery/app_uart_sniffer/project.xml +++ b/examples/stm32f4_discovery/app_uart_sniffer/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:debug modm:platform:gpio diff --git a/examples/stm32f4_discovery/barometer_bmp085_bmp180/project.xml b/examples/stm32f4_discovery/barometer_bmp085_bmp180/project.xml index 77b145f867..a4a0cb3e36 100644 --- a/examples/stm32f4_discovery/barometer_bmp085_bmp180/project.xml +++ b/examples/stm32f4_discovery/barometer_bmp085_bmp180/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:driver:bmp085 modm:io diff --git a/examples/stm32f4_discovery/blink/main.cpp b/examples/stm32f4_discovery/blink/main.cpp deleted file mode 100644 index c25042e47e..0000000000 --- a/examples/stm32f4_discovery/blink/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2011, Georgi Grinshpun - * Copyright (c) 2011-2012, Fabian Greif - * Copyright (c) 2012, 2014, Sascha Schade - * Copyright (c) 2013, Kevin Läufer - * Copyright (c) 2013, 2015-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() -{ - initialize(); - - LedOrange::set(); - LedRed::set(); - - while (true) - { - LedBlue::toggle(); - LedGreen::toggle(); - LedOrange::toggle(); - LedRed::toggle(); - modm::delay(Button::read() ? 250ms : 500ms); - } - - return 0; -} diff --git a/examples/stm32f4_discovery/blink/project.xml b/examples/stm32f4_discovery/blink/project.xml deleted file mode 100644 index 755058d4a0..0000000000 --- a/examples/stm32f4_discovery/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:disco-f407vg - - - - - modm:build:scons - - diff --git a/examples/stm32f4_discovery/can/project.xml b/examples/stm32f4_discovery/can/project.xml index d8d565b7ed..a12cf4701e 100644 --- a/examples/stm32f4_discovery/can/project.xml +++ b/examples/stm32f4_discovery/can/project.xml @@ -1,7 +1,6 @@ modm:disco-f407vg - diff --git a/examples/stm32f4_discovery/can2/project.xml b/examples/stm32f4_discovery/can2/project.xml index 1b2a1fce1a..7574ca51d2 100644 --- a/examples/stm32f4_discovery/can2/project.xml +++ b/examples/stm32f4_discovery/can2/project.xml @@ -1,7 +1,6 @@ modm:disco-f407vg - diff --git a/examples/stm32f4_discovery/colour_tcs3414/project.xml b/examples/stm32f4_discovery/colour_tcs3414/project.xml index be24211661..35aa7309c2 100644 --- a/examples/stm32f4_discovery/colour_tcs3414/project.xml +++ b/examples/stm32f4_discovery/colour_tcs3414/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:driver:tcs3414 modm:io diff --git a/examples/stm32f4_discovery/display/hd44780/project.xml b/examples/stm32f4_discovery/display/hd44780/project.xml index 0f6eb522c7..6f10c53681 100644 --- a/examples/stm32f4_discovery/display/hd44780/project.xml +++ b/examples/stm32f4_discovery/display/hd44780/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:debug modm:driver:pca8574 diff --git a/examples/stm32f4_discovery/display/nokia_5110/project.xml b/examples/stm32f4_discovery/display/nokia_5110/project.xml index 5c3e8b4be0..75315c77e6 100644 --- a/examples/stm32f4_discovery/display/nokia_5110/project.xml +++ b/examples/stm32f4_discovery/display/nokia_5110/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:debug modm:driver:nokia5110 diff --git a/examples/stm32f4_discovery/display/ssd1306/project.xml b/examples/stm32f4_discovery/display/ssd1306/project.xml index 02ecafaea8..f23bd5ec0b 100644 --- a/examples/stm32f4_discovery/display/ssd1306/project.xml +++ b/examples/stm32f4_discovery/display/ssd1306/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:driver:ssd1306 modm:platform:gpio diff --git a/examples/stm32f4_discovery/distance_vl6180/project.xml b/examples/stm32f4_discovery/distance_vl6180/project.xml index f449ec012f..aa8bd92d3e 100644 --- a/examples/stm32f4_discovery/distance_vl6180/project.xml +++ b/examples/stm32f4_discovery/distance_vl6180/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:debug modm:driver:vl6180 diff --git a/examples/stm32f4_discovery/encoder_output/project.xml b/examples/stm32f4_discovery/encoder_output/project.xml index a396b26ab3..3a748da2f7 100644 --- a/examples/stm32f4_discovery/encoder_output/project.xml +++ b/examples/stm32f4_discovery/encoder_output/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:driver:encoder_output.bitbang modm:build:scons diff --git a/examples/stm32f4_discovery/exti/project.xml b/examples/stm32f4_discovery/exti/project.xml index 243d0e34a6..cb49bb4d71 100644 --- a/examples/stm32f4_discovery/exti/project.xml +++ b/examples/stm32f4_discovery/exti/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:architecture:interrupt modm:platform:exti diff --git a/examples/stm32f4_discovery/fpu/project.xml b/examples/stm32f4_discovery/fpu/project.xml index 7bd99ef0d9..fe65f038eb 100644 --- a/examples/stm32f4_discovery/fpu/project.xml +++ b/examples/stm32f4_discovery/fpu/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:math:geometry modm:build:scons diff --git a/examples/stm32f4_discovery/fsmc/project.xml b/examples/stm32f4_discovery/fsmc/project.xml index 188a58f3f9..975a632d69 100644 --- a/examples/stm32f4_discovery/fsmc/project.xml +++ b/examples/stm32f4_discovery/fsmc/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:platform:gpio modm:platform:fsmc diff --git a/examples/stm32f4_discovery/led_matrix_display/project.xml b/examples/stm32f4_discovery/led_matrix_display/project.xml index a1ed2f1407..0bb0e60a36 100644 --- a/examples/stm32f4_discovery/led_matrix_display/project.xml +++ b/examples/stm32f4_discovery/led_matrix_display/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:driver:max7219 modm:platform:gpio diff --git a/examples/stm32f4_discovery/open407v-d/gui/project.xml b/examples/stm32f4_discovery/open407v-d/gui/project.xml index 6e5d418d62..9dd736deb8 100644 --- a/examples/stm32f4_discovery/open407v-d/gui/project.xml +++ b/examples/stm32f4_discovery/open407v-d/gui/project.xml @@ -1,7 +1,6 @@ modm:disco-f407vg - diff --git a/examples/stm32f4_discovery/open407v-d/touchscreen/project.xml b/examples/stm32f4_discovery/open407v-d/touchscreen/project.xml index a19d49e7e2..a80be8f2ba 100644 --- a/examples/stm32f4_discovery/open407v-d/touchscreen/project.xml +++ b/examples/stm32f4_discovery/open407v-d/touchscreen/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:driver modm:driver:ads7843 diff --git a/examples/stm32f4_discovery/pressure_ams5915/project.xml b/examples/stm32f4_discovery/pressure_ams5915/project.xml index 29b45d6653..6dea23667d 100644 --- a/examples/stm32f4_discovery/pressure_ams5915/project.xml +++ b/examples/stm32f4_discovery/pressure_ams5915/project.xml @@ -1,7 +1,6 @@ modm:disco-f407vg - diff --git a/examples/stm32f4_discovery/protothreads/project.xml b/examples/stm32f4_discovery/protothreads/project.xml index 6a2aa88f46..eaeb7800ef 100644 --- a/examples/stm32f4_discovery/protothreads/project.xml +++ b/examples/stm32f4_discovery/protothreads/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:driver:tmp102 modm:io diff --git a/examples/stm32f4_discovery/sab2/project.xml b/examples/stm32f4_discovery/sab2/project.xml index 29728af59a..bcdc03e17f 100644 --- a/examples/stm32f4_discovery/sab2/project.xml +++ b/examples/stm32f4_discovery/sab2/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:platform:gpio modm:communication:sab2 diff --git a/examples/stm32f4_discovery/spi/project.xml b/examples/stm32f4_discovery/spi/project.xml index e81afd068e..9edcd0f569 100644 --- a/examples/stm32f4_discovery/spi/project.xml +++ b/examples/stm32f4_discovery/spi/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:platform:gpio modm:platform:spi.bitbang diff --git a/examples/stm32f4_discovery/temperature_ltc2984/project.xml b/examples/stm32f4_discovery/temperature_ltc2984/project.xml index 470c4a5ad8..76601e8b65 100644 --- a/examples/stm32f4_discovery/temperature_ltc2984/project.xml +++ b/examples/stm32f4_discovery/temperature_ltc2984/project.xml @@ -1,7 +1,6 @@ modm:disco-f407vg - diff --git a/examples/stm32f4_discovery/timer/project.xml b/examples/stm32f4_discovery/timer/project.xml index bb13e00319..c002f03d75 100644 --- a/examples/stm32f4_discovery/timer/project.xml +++ b/examples/stm32f4_discovery/timer/project.xml @@ -1,7 +1,6 @@ modm:disco-f407vg - diff --git a/examples/stm32f4_discovery/timer_test/project.xml b/examples/stm32f4_discovery/timer_test/project.xml index e0f7e85e94..020fd55496 100644 --- a/examples/stm32f4_discovery/timer_test/project.xml +++ b/examples/stm32f4_discovery/timer_test/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:architecture:interrupt modm:platform:timer:1 diff --git a/examples/stm32f4_discovery/uart/project.xml b/examples/stm32f4_discovery/uart/project.xml index d156797cd4..6dc92f45f9 100644 --- a/examples/stm32f4_discovery/uart/project.xml +++ b/examples/stm32f4_discovery/uart/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:platform:gpio modm:platform:uart:2 diff --git a/examples/stm32f4_discovery/uart_spi/project.xml b/examples/stm32f4_discovery/uart_spi/project.xml index d5e4f480c5..1f453c15a8 100644 --- a/examples/stm32f4_discovery/uart_spi/project.xml +++ b/examples/stm32f4_discovery/uart_spi/project.xml @@ -1,8 +1,5 @@ modm:disco-f407vg - - - modm:platform:gpio modm:platform:uart.spi:2 diff --git a/examples/stm32f746g_discovery/adc_ad7928/project.xml b/examples/stm32f746g_discovery/adc_ad7928/project.xml index ca4d50e087..ad51ae59a6 100644 --- a/examples/stm32f746g_discovery/adc_ad7928/project.xml +++ b/examples/stm32f746g_discovery/adc_ad7928/project.xml @@ -1,8 +1,5 @@ modm:disco-f746ng - - - modm:driver:ad7928 modm:platform:gpio diff --git a/examples/stm32f746g_discovery/blink/main.cpp b/examples/stm32f746g_discovery/blink/main.cpp deleted file mode 100644 index 8fabb14c2d..0000000000 --- a/examples/stm32f746g_discovery/blink/main.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2015-2017, Niklas Hauser - * Copyright (c) 2016, Sascha Schade - * - * 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(modm::Gpio::Low); - - // 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) - { - modm::delay(Button::read() ? 250ms : 1s); - LedD13::toggle(); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - } - - return 0; -} diff --git a/examples/stm32f746g_discovery/blink/project.xml b/examples/stm32f746g_discovery/blink/project.xml deleted file mode 100644 index 0533368c2a..0000000000 --- a/examples/stm32f746g_discovery/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:disco-f746ng - - - - - modm:platform:gpio - modm:build:scons - - diff --git a/examples/stm32f746g_discovery/rtos/main.cpp b/examples/stm32f746g_discovery/rtos/main.cpp deleted file mode 100644 index 85ceacb538..0000000000 --- a/examples/stm32f746g_discovery/rtos/main.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2014, Georgi Grinshpun - * Copyright (c) 2014, Sascha Schade - * Copyright (c) 2015-2017, 2019 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 -#include - -using namespace modm::platform; - -/** - * This example uses four threads to check if task switching works correctly. - * - * What to expect? - * --------------- - * - All our LEDs blinking at different rates, about 3 to 4 Hz - * - A string at 115200 baud - * - * 0aA!1bB"2cC#3dD$4eE%5fF&6gG'7hH(8iI9)jJ0*aA1!bB2"cC - * - * Each thread prints out a sequence - * 0123456789 - * abcdefghij - * ABCDEFGHIJ - * !"#$%&'()* - * respectivly. - */ - -// ---------------------------------------------------------------------------- -template -class P: modm::rtos::Thread -{ - char c; - uint8_t i = 0; - volatile float a = 10.f; -public: - P(char c): Thread(2,1<<10), c(c) {} - - void run() - { - Gpio::setOutput(); - while (true) - { - sleep(SleepTime * MILLISECONDS); - - Gpio::toggle(); - { - static modm::rtos::Mutex lm; - modm::rtos::MutexGuard m(lm); - MODM_LOG_INFO << char(i + c); - } - i = (i+1)%10; - a *= 3.141f; - } - } -}; - -P< Board::LedD13, 260 > p1('0'); -P< Board::LedD13, 260 + 10 > p2('a'); -P< Board::LedD13, 260 + 20 > p3('A'); -P< Board::LedD13, 260 + 30 > p4('!'); - - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - modm::rtos::Scheduler::schedule(); - return 0; -} diff --git a/examples/stm32f746g_discovery/rtos/project.xml b/examples/stm32f746g_discovery/rtos/project.xml deleted file mode 100644 index d9dc203add..0000000000 --- a/examples/stm32f746g_discovery/rtos/project.xml +++ /dev/null @@ -1,11 +0,0 @@ - - modm:disco-f746ng - - - - - modm:processing:rtos - modm:platform:heap - modm:build:scons - - diff --git a/examples/stm32f746g_discovery/tmp102/project.xml b/examples/stm32f746g_discovery/tmp102/project.xml index 1b940c166a..48fcfd7611 100644 --- a/examples/stm32f746g_discovery/tmp102/project.xml +++ b/examples/stm32f746g_discovery/tmp102/project.xml @@ -1,8 +1,5 @@ modm:disco-f746ng - - - modm:driver:tmp102 modm:io diff --git a/examples/stm32f769i_discovery/blink/calc.cpp b/examples/stm32f769i_discovery/blink/calc.cpp deleted file mode 100644 index b63ca4ea6f..0000000000 --- a/examples/stm32f769i_discovery/blink/calc.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2016, Sascha Schade - * - * 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 "calc.hpp" - -double Calc::myDouble = double(1.0); - -void -Calc::calc() -{ - myDouble += double(0.1); -} - -double -Calc::get() -{ - return myDouble; -} diff --git a/examples/stm32f769i_discovery/blink/calc.hpp b/examples/stm32f769i_discovery/blink/calc.hpp deleted file mode 100644 index 6bdc05d5c7..0000000000 --- a/examples/stm32f769i_discovery/blink/calc.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2016, Sascha Schade - * - * 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/. - */ -// ---------------------------------------------------------------------------- - -#ifndef CALC_HPP -#define CALC_HPP - - -class Calc -{ -public: - static void - calc(); - - static double - get(); - -protected: - static double - myDouble; -}; - -#endif // CALC_HPP diff --git a/examples/stm32f769i_discovery/blink/main.cpp b/examples/stm32f769i_discovery/blink/main.cpp deleted file mode 100644 index ef7887409d..0000000000 --- a/examples/stm32f769i_discovery/blink/main.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2015-2017, Niklas Hauser - * Copyright (c) 2016, Sascha Schade - * - * 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 -#include "calc.hpp" - -using namespace Board; - -// ---------------------------------------------------------------------------- -int -main() -{ - Board::initialize(); - LedJ13::setOutput(modm::Gpio::Low); - LedJ5::setOutput(modm::Gpio::Low); - LedA12::setOutput(modm::Gpio::Low); - LedD4::setOutput(modm::Gpio::Low); - - // 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) - { - modm::delay(Button::read() ? 250ms : 1s); - LedJ13::toggle(); - LedJ5::toggle(); - LedA12::toggle(); - LedD4::toggle(); - - MODM_LOG_INFO << "loop: " << counter++ << modm::endl; - MODM_LOG_INFO << "double: " << Calc::get() << modm::endl; - - Calc::calc(); - } - - return 0; -} diff --git a/examples/stm32f769i_discovery/blink/project.xml b/examples/stm32f769i_discovery/blink/project.xml deleted file mode 100644 index 3ff1346c61..0000000000 --- a/examples/stm32f769i_discovery/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:disco-f769ni - - - - - modm:platform:gpio - modm:build:scons - - diff --git a/examples/stm32f769i_discovery/dac_dma/project.xml b/examples/stm32f769i_discovery/dac_dma/project.xml index 29bbd99714..fc991fd09b 100644 --- a/examples/stm32f769i_discovery/dac_dma/project.xml +++ b/examples/stm32f769i_discovery/dac_dma/project.xml @@ -1,8 +1,5 @@ modm:disco-f769ni - - - modm:debug modm:platform:dac diff --git a/examples/stm32h750vbt6_devebox/blink/main.cpp b/examples/stm32h750vbt6_devebox/blink/main.cpp deleted file mode 100644 index a88e7fc2a7..0000000000 --- a/examples/stm32h750vbt6_devebox/blink/main.cpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2021, Henrik Hose - * - * 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(); - - while(true) - { - LedGreen::toggle(); - modm::delay(100ms + ButtonK1::read()*500ms + ButtonK2::read()*1000ms); - } - - return 0; -} diff --git a/examples/stm32h750vbt6_devebox/blink/openocd.cfg b/examples/stm32h750vbt6_devebox/blink/openocd.cfg deleted file mode 100644 index 06065b98c7..0000000000 --- a/examples/stm32h750vbt6_devebox/blink/openocd.cfg +++ /dev/null @@ -1 +0,0 @@ -source [find interface/stlink.cfg] diff --git a/examples/stm32h750vbt6_devebox/blink/project.xml b/examples/stm32h750vbt6_devebox/blink/project.xml deleted file mode 100644 index abe3825daa..0000000000 --- a/examples/stm32h750vbt6_devebox/blink/project.xml +++ /dev/null @@ -1,10 +0,0 @@ - - modm:devebox-stm32h750vb - - - - - - modm:build:scons - - diff --git a/examples/stm32l1_discovery/blink/main.cpp b/examples/stm32l1_discovery/blink/main.cpp deleted file mode 100644 index 7d02b7e109..0000000000 --- a/examples/stm32l1_discovery/blink/main.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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(); - - uint8_t counter{0}; - while (true) - { - Leds::write(1ul << (counter++ % Leds::width)); - modm::delay(Button::read() ? 500ms : 1s); - } - - return 0; -} diff --git a/examples/stm32l1_discovery/blink/project.xml b/examples/stm32l1_discovery/blink/project.xml deleted file mode 100644 index 4cf752dca1..0000000000 --- a/examples/stm32l1_discovery/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:disco-l152rc - - - - - modm:build:scons - - diff --git a/examples/stm32l476_discovery/blink/main.cpp b/examples/stm32l476_discovery/blink/main.cpp deleted file mode 100644 index 796f0b1378..0000000000 --- a/examples/stm32l476_discovery/blink/main.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2017, Sascha Schade - * - * 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() -{ - initialize(); - - LedRed::set(); - - while (true) - { - LedGreen::toggle(); - LedRed::toggle(); - modm::delay(Button::read() ? 250ms : 500ms); - } - - return 0; -} diff --git a/examples/stm32l476_discovery/blink/project.xml b/examples/stm32l476_discovery/blink/project.xml deleted file mode 100644 index f7c31c3e94..0000000000 --- a/examples/stm32l476_discovery/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:disco-l476vg - - - - - modm:build:scons - - diff --git a/examples/thingplus_rp2040/blink/main.cpp b/examples/thingplus_rp2040/blink/main.cpp deleted file mode 100644 index 2c2614c316..0000000000 --- a/examples/thingplus_rp2040/blink/main.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2016, Sascha Schade - * Copyright (c) 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; - -/* - * Blinks the user LED with 1 Hz. - * It is on for 90% of the time and off for 10% of the time. - */ - -int -main() -{ - Board::initialize(); - - Led::setOutput(); - - while (true) - { - Led::set(); - modm::delay(900ms); - - Led::reset(); - modm::delay(100ms); - } - - return 0; -} diff --git a/examples/thingplus_rp2040/blink/project.xml b/examples/thingplus_rp2040/blink/project.xml deleted file mode 100644 index 4d9daf6e8b..0000000000 --- a/examples/thingplus_rp2040/blink/project.xml +++ /dev/null @@ -1,9 +0,0 @@ - - modm:thingplus-rp2040 - - - - - modm:build:scons - - diff --git a/ext/hathach/module.lb b/ext/hathach/module.lb index 077afbfad4..1567db018a 100644 --- a/ext/hathach/module.lb +++ b/ext/hathach/module.lb @@ -269,7 +269,9 @@ Configuration options: def build(self, env): env.outbasepath = "modm/ext/tinyusb" - env.copy("tinyusb/src/device/", "device/") + operations = env.copy("tinyusb/src/device/", "device/") + operations = [o for o in operations if "usbd.c" in o.filename] + env.collect(":build:ccflags", "-Wno-bad-function-cast", operations=operations) # ----------------------------------------------------------------------------- diff --git a/src/modm/board/devebox_stm32h750vb/board.hpp b/src/modm/board/devebox_stm32h750vb/board.hpp index 721e1b73ba..d675c0e46a 100644 --- a/src/modm/board/devebox_stm32h750vb/board.hpp +++ b/src/modm/board/devebox_stm32h750vb/board.hpp @@ -140,6 +140,7 @@ struct SystemClock using ButtonK1 = GpioInverted; using ButtonK2 = GpioInverted; +using Button = ButtonK1; using LedGreen = GpioInverted; // User LED diff --git a/src/modm/board/disco_f411ve/board.hpp b/src/modm/board/disco_f411ve/board.hpp index ffb5286710..7fa060df27 100644 --- a/src/modm/board/disco_f411ve/board.hpp +++ b/src/modm/board/disco_f411ve/board.hpp @@ -63,6 +63,7 @@ struct SystemClock static constexpr uint32_t Timer11 = Apb2Timer; static constexpr uint32_t Usb = 48_MHz; + static constexpr uint32_t Iwdg = Rcc::LsiFrequency; static bool inline enable() { diff --git a/src/modm/board/feather_m0/board.hpp b/src/modm/board/feather_m0/board.hpp index 19860e77eb..447c4296b7 100644 --- a/src/modm/board/feather_m0/board.hpp +++ b/src/modm/board/feather_m0/board.hpp @@ -99,7 +99,8 @@ struct SystemClock }; using LoggerDevice = modm::IODeviceWrapper; -using Leds = Led; +using Leds = SoftwareGpioPort; +using Button = GpioUnused; inline void initialize() diff --git a/src/modm/board/feather_m4/board.hpp b/src/modm/board/feather_m4/board.hpp index 8293da9c5f..c0aefa7f9d 100644 --- a/src/modm/board/feather_m4/board.hpp +++ b/src/modm/board/feather_m4/board.hpp @@ -142,6 +142,7 @@ struct SystemClock }; using Leds = SoftwareGpioPort; +using Button = GpioUnused; struct Debug { diff --git a/src/modm/board/nucleo_f031k6/board.hpp b/src/modm/board/nucleo_f031k6/board.hpp index c2decbfe28..72630b7c89 100644 --- a/src/modm/board/nucleo_f031k6/board.hpp +++ b/src/modm/board/nucleo_f031k6/board.hpp @@ -92,6 +92,28 @@ using Uart = Usart1; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_f031k6 +/// @{ +using Sda = D4; +using Scl = D5; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_f031k6 +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_f031k6 /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -105,6 +127,20 @@ initialize() stlink::Uart::connect(); stlink::Uart::initialize(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_f031k6/module.lb b/src/modm/board/nucleo_f031k6/module.lb index af09b6d9bf..59e79d9e73 100644 --- a/src/modm/board/nucleo_f031k6/module.lb +++ b/src/modm/board/nucleo_f031k6/module.lb @@ -23,8 +23,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32f031k6t"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:1", - ":debug", ":architecture:clock", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:1" + ) return True def build(env): diff --git a/src/modm/board/nucleo_f042k6/board.hpp b/src/modm/board/nucleo_f042k6/board.hpp index 09f8aa93c7..3886847eb3 100644 --- a/src/modm/board/nucleo_f042k6/board.hpp +++ b/src/modm/board/nucleo_f042k6/board.hpp @@ -96,6 +96,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_f042k6 +/// @{ +using Sda = D4; +using Scl = D5; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_f042k6 +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_f042k6 /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -109,6 +131,20 @@ initialize() stlink::Uart::connect(); stlink::Uart::initialize(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_f042k6/module.lb b/src/modm/board/nucleo_f042k6/module.lb index 81c39b3946..f28b6e4072 100644 --- a/src/modm/board/nucleo_f042k6/module.lb +++ b/src/modm/board/nucleo_f042k6/module.lb @@ -24,8 +24,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32f042k6t"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_f072rb/board.hpp b/src/modm/board/nucleo_f072rb/board.hpp index 17b9c1d2d5..8b80253d67 100644 --- a/src/modm/board/nucleo_f072rb/board.hpp +++ b/src/modm/board/nucleo_f072rb/board.hpp @@ -96,6 +96,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_f072rb +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_f072rb +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_f072rb /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -109,6 +131,20 @@ initialize() stlink::Uart::connect(); stlink::Uart::initialize(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_f072rb/module.lb b/src/modm/board/nucleo_f072rb/module.lb index e6c07e51d7..bd4933adfd 100644 --- a/src/modm/board/nucleo_f072rb/module.lb +++ b/src/modm/board/nucleo_f072rb/module.lb @@ -23,8 +23,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32f072rbt"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2", + ) return True diff --git a/src/modm/board/nucleo_f091rc/board.hpp b/src/modm/board/nucleo_f091rc/board.hpp index 15a568e159..da1905bf74 100644 --- a/src/modm/board/nucleo_f091rc/board.hpp +++ b/src/modm/board/nucleo_f091rc/board.hpp @@ -95,6 +95,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_f091rc +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_f091rc +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_f091rc /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -108,6 +130,20 @@ initialize() stlink::Uart::connect(); stlink::Uart::initialize(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_f091rc/module.lb b/src/modm/board/nucleo_f091rc/module.lb index 113d972f5a..6f17a68f47 100644 --- a/src/modm/board/nucleo_f091rc/module.lb +++ b/src/modm/board/nucleo_f091rc/module.lb @@ -23,8 +23,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32f091rct"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True diff --git a/src/modm/board/nucleo_f103rb/board.hpp b/src/modm/board/nucleo_f103rb/board.hpp index 7ad9c9db30..12cd272f2b 100644 --- a/src/modm/board/nucleo_f103rb/board.hpp +++ b/src/modm/board/nucleo_f103rb/board.hpp @@ -107,6 +107,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_f091rc +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_f091rc +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_f103rb /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -125,6 +147,20 @@ initialize() // Enable PB4 as GPIO AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_f103rb/module.lb b/src/modm/board/nucleo_f103rb/module.lb index f6add3f678..81556534fd 100644 --- a/src/modm/board/nucleo_f103rb/module.lb +++ b/src/modm/board/nucleo_f103rb/module.lb @@ -23,8 +23,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32f103rbt"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2", + ) return True def build(env): diff --git a/src/modm/board/nucleo_f303k8/board.hpp b/src/modm/board/nucleo_f303k8/board.hpp index 53c933c586..73425163da 100644 --- a/src/modm/board/nucleo_f303k8/board.hpp +++ b/src/modm/board/nucleo_f303k8/board.hpp @@ -21,14 +21,15 @@ using namespace modm::platform; -/// @ingroup modm_board_nucleo_f303k8 namespace Board { - using namespace modm::literals; +/// @ingroup modm_board_nucleo_f303k8 +/// @{ +using namespace modm::literals; /// STM32F303K8 running at 64MHz generated from the internal 8MHz clock -// Dummy clock for devices -struct SystemClock { +struct SystemClock +{ static constexpr uint32_t Frequency = 64_MHz; static constexpr uint32_t Ahb = Frequency; static constexpr uint32_t Apb1 = Frequency / 2; @@ -93,15 +94,42 @@ using Button = GpioUnused; using LedD13 = D13; using Leds = SoftwareGpioPort< LedD13 >; - +/// @} namespace stlink { +/// @ingroup modm_board_nucleo_f303k8 +/// @{ using Rx = GpioInputA15; using Tx = GpioOutputA2; using Uart = Usart2; +/// @} +} + +namespace i2c +{ +/// @ingroup modm_board_nucleo_f303k8 +/// @{ +using Sda = D4; +using Scl = D5; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_f303k8 +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} } +/// @ingroup modm_board_nucleo_f303k8 +/// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -115,6 +143,21 @@ initialize() stlink::Uart::initialize(); } +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} +/// @} + } #endif // MODM_STM32_NUCLEO_F303K8_HPP diff --git a/src/modm/board/nucleo_f303k8/module.lb b/src/modm/board/nucleo_f303k8/module.lb index 5ad5d28b63..3295b156ff 100644 --- a/src/modm/board/nucleo_f303k8/module.lb +++ b/src/modm/board/nucleo_f303k8/module.lb @@ -23,8 +23,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32f303k8t"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_f303re/board.hpp b/src/modm/board/nucleo_f303re/board.hpp index 4fd12154b0..4a392b5797 100644 --- a/src/modm/board/nucleo_f303re/board.hpp +++ b/src/modm/board/nucleo_f303re/board.hpp @@ -108,6 +108,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_f091rc +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_f091rc +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_f303re /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -121,6 +143,20 @@ initialize() stlink::Uart::connect(); stlink::Uart::initialize(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_f303re/module.lb b/src/modm/board/nucleo_f303re/module.lb index 28ed996567..ce05f83909 100644 --- a/src/modm/board/nucleo_f303re/module.lb +++ b/src/modm/board/nucleo_f303re/module.lb @@ -24,8 +24,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32f303ret"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_f334r8/board.hpp b/src/modm/board/nucleo_f334r8/board.hpp index 80fde9d9b2..20fc852da1 100644 --- a/src/modm/board/nucleo_f334r8/board.hpp +++ b/src/modm/board/nucleo_f334r8/board.hpp @@ -105,6 +105,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_f334r8 +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_f334r8 +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_f334r8 /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -118,6 +140,20 @@ initialize() stlink::Uart::connect(); stlink::Uart::initialize(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_f334r8/module.lb b/src/modm/board/nucleo_f334r8/module.lb index 4728407d58..fc71369475 100644 --- a/src/modm/board/nucleo_f334r8/module.lb +++ b/src/modm/board/nucleo_f334r8/module.lb @@ -22,8 +22,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32f334r8t"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_f401re/board.hpp b/src/modm/board/nucleo_f401re/board.hpp index e5188b7e64..271ff83ead 100644 --- a/src/modm/board/nucleo_f401re/board.hpp +++ b/src/modm/board/nucleo_f401re/board.hpp @@ -105,6 +105,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_f401re +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_f401re +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_f401re /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -120,6 +142,20 @@ initialize() Button::setInput(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_f401re/module.lb b/src/modm/board/nucleo_f401re/module.lb index ceaac660a7..1384e29ff5 100644 --- a/src/modm/board/nucleo_f401re/module.lb +++ b/src/modm/board/nucleo_f401re/module.lb @@ -23,8 +23,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32f401ret"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_f411re/board.hpp b/src/modm/board/nucleo_f411re/board.hpp index 5fff5998fb..32ccd479dd 100644 --- a/src/modm/board/nucleo_f411re/board.hpp +++ b/src/modm/board/nucleo_f411re/board.hpp @@ -107,6 +107,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_f411re +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_f411re +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_f411re /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -122,6 +144,20 @@ initialize() Button::setInput(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_f411re/module.lb b/src/modm/board/nucleo_f411re/module.lb index 9236e5cd4a..4bbcaeacd6 100644 --- a/src/modm/board/nucleo_f411re/module.lb +++ b/src/modm/board/nucleo_f411re/module.lb @@ -23,8 +23,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32f411ret"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_f446re/board.hpp b/src/modm/board/nucleo_f446re/board.hpp index 783fbb4cb6..1499bf3413 100644 --- a/src/modm/board/nucleo_f446re/board.hpp +++ b/src/modm/board/nucleo_f446re/board.hpp @@ -117,6 +117,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_f446re +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_f446re +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_f446re /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -132,6 +154,20 @@ initialize() Button::setInput(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_f446re/module.lb b/src/modm/board/nucleo_f446re/module.lb index f720d20f75..eb0f6b4f37 100644 --- a/src/modm/board/nucleo_f446re/module.lb +++ b/src/modm/board/nucleo_f446re/module.lb @@ -23,8 +23,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32f446ret"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_g070rb/module.lb b/src/modm/board/nucleo_g070rb/module.lb index 147168f08b..d6c8e98ce2 100644 --- a/src/modm/board/nucleo_g070rb/module.lb +++ b/src/modm/board/nucleo_g070rb/module.lb @@ -23,8 +23,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32g070rbt"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_g071rb/board.hpp b/src/modm/board/nucleo_g071rb/board.hpp index 59c91861ca..6ba266bac2 100644 --- a/src/modm/board/nucleo_g071rb/board.hpp +++ b/src/modm/board/nucleo_g071rb/board.hpp @@ -143,6 +143,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_g071rb modm_board_nucleo_g070rb +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_g071rb modm_board_nucleo_g070rb +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_g071rb modm_board_nucleo_g070rb /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -158,6 +180,20 @@ initialize() Button::setInput(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_g071rb/module.lb b/src/modm/board/nucleo_g071rb/module.lb index c10da91c6a..feaa740351 100644 --- a/src/modm/board/nucleo_g071rb/module.lb +++ b/src/modm/board/nucleo_g071rb/module.lb @@ -22,8 +22,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32g071rbt"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_g431kb/board.hpp b/src/modm/board/nucleo_g431kb/board.hpp index 0b6b999c4d..dd6d8138db 100644 --- a/src/modm/board/nucleo_g431kb/board.hpp +++ b/src/modm/board/nucleo_g431kb/board.hpp @@ -151,6 +151,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_g431kb +/// @{ +using Sda = D4; +using Scl = D5; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_g431kb +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_g431kb /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -166,6 +188,20 @@ initialize() LedUser::setOutput(modm::Gpio::Low); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_g431kb/module.lb b/src/modm/board/nucleo_g431kb/module.lb index 63e68ed2d3..b549ca4863 100644 --- a/src/modm/board/nucleo_g431kb/module.lb +++ b/src/modm/board/nucleo_g431kb/module.lb @@ -22,8 +22,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32g431kb"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2", + ) return True def build(env): diff --git a/src/modm/board/nucleo_g431rb/board.hpp b/src/modm/board/nucleo_g431rb/board.hpp index de04fe9c12..5c7db8e375 100644 --- a/src/modm/board/nucleo_g431rb/board.hpp +++ b/src/modm/board/nucleo_g431rb/board.hpp @@ -125,6 +125,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_g431rb +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_g431rb +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_g431rb /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -140,6 +162,20 @@ initialize() Button::setInput(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_g431rb/module.lb b/src/modm/board/nucleo_g431rb/module.lb index 910ceb5bde..0855e630cd 100644 --- a/src/modm/board/nucleo_g431rb/module.lb +++ b/src/modm/board/nucleo_g431rb/module.lb @@ -22,8 +22,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32g431rbt"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_g474re/board.hpp b/src/modm/board/nucleo_g474re/board.hpp index 29d9ec86a5..d14b380336 100644 --- a/src/modm/board/nucleo_g474re/board.hpp +++ b/src/modm/board/nucleo_g474re/board.hpp @@ -139,6 +139,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_g474re +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_g474re +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_g474re /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -154,6 +176,20 @@ initialize() Button::setInput(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_g474re/module.lb b/src/modm/board/nucleo_g474re/module.lb index 0a2527b508..20c2e3d5ef 100644 --- a/src/modm/board/nucleo_g474re/module.lb +++ b/src/modm/board/nucleo_g474re/module.lb @@ -22,8 +22,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32g474ret"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_l031k6/board.hpp b/src/modm/board/nucleo_l031k6/board.hpp index ce88228d8c..be42a783d2 100644 --- a/src/modm/board/nucleo_l031k6/board.hpp +++ b/src/modm/board/nucleo_l031k6/board.hpp @@ -99,6 +99,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_l031k6 +/// @{ +using Sda = GpioB7; +using Scl = GpioB6; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_l031k6 +/// @{ +using Cs = GpioA11; +using Sck = GpioB3; +using Sdi = GpioB4; +using Sdo = GpioB5; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_l031k6 /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -112,6 +134,20 @@ initialize() stlink::Uart::connect(); stlink::Uart::initialize(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_l031k6/module.lb b/src/modm/board/nucleo_l031k6/module.lb index e35f967e10..7a2843da20 100644 --- a/src/modm/board/nucleo_l031k6/module.lb +++ b/src/modm/board/nucleo_l031k6/module.lb @@ -24,8 +24,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32l031k6t"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_l053r8/board.hpp b/src/modm/board/nucleo_l053r8/board.hpp index ba8ca0d7c3..5d52bb5ec5 100644 --- a/src/modm/board/nucleo_l053r8/board.hpp +++ b/src/modm/board/nucleo_l053r8/board.hpp @@ -105,6 +105,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_l053r8 +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_l053r8 +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_l053r8 /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -120,6 +142,20 @@ initialize() Button::setInput(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_l053r8/module.lb b/src/modm/board/nucleo_l053r8/module.lb index 05f5b5497a..5c47bbea41 100644 --- a/src/modm/board/nucleo_l053r8/module.lb +++ b/src/modm/board/nucleo_l053r8/module.lb @@ -23,8 +23,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32l053r8t"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_l152re/board.hpp b/src/modm/board/nucleo_l152re/board.hpp index a33e6079e6..718ef31df9 100644 --- a/src/modm/board/nucleo_l152re/board.hpp +++ b/src/modm/board/nucleo_l152re/board.hpp @@ -130,6 +130,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_l152re +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_l152re +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_l152re /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -145,6 +167,20 @@ initialize() Button::setInput(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_l152re/module.lb b/src/modm/board/nucleo_l152re/module.lb index 1bd2b6a476..100a204682 100644 --- a/src/modm/board/nucleo_l152re/module.lb +++ b/src/modm/board/nucleo_l152re/module.lb @@ -23,8 +23,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32l152ret"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_l432kc/board.hpp b/src/modm/board/nucleo_l432kc/board.hpp index 3627d45d9b..c7a5029231 100644 --- a/src/modm/board/nucleo_l432kc/board.hpp +++ b/src/modm/board/nucleo_l432kc/board.hpp @@ -30,20 +30,47 @@ using namespace modm::literals; struct SystemClock { static constexpr uint32_t Frequency = 80_MHz; - static constexpr uint32_t Ahb = Frequency; + static constexpr uint32_t Ahb = Frequency; + static constexpr uint32_t Ahb2 = Frequency; static constexpr uint32_t Apb1 = Frequency; static constexpr uint32_t Apb2 = Frequency; + static constexpr uint32_t Adc1 = Ahb2; + + static constexpr uint32_t Can1 = Apb1; + + static constexpr uint32_t Comp1 = Apb2; + static constexpr uint32_t Comp2 = Apb2; + + static constexpr uint32_t Dac1 = Apb1; + + static constexpr uint32_t I2c1 = Apb1; + static constexpr uint32_t I2c2 = Apb1; + static constexpr uint32_t I2c3 = Apb1; + static constexpr uint32_t I2c4 = Apb1; + + static constexpr uint32_t Spi1 = Apb2; + + static constexpr uint32_t Spi2 = Apb1; + static constexpr uint32_t Spi3 = Apb1; + + static constexpr uint32_t Timer1 = Apb2; + + static constexpr uint32_t Timer2 = Apb1; + static constexpr uint32_t Timer6 = Apb1; + + static constexpr uint32_t Timer15 = Apb2; + static constexpr uint32_t Timer16 = Apb2; + + static constexpr uint32_t Uart4 = Apb1; + static constexpr uint32_t Usart1 = Apb2; static constexpr uint32_t Usart2 = Apb1; static constexpr uint32_t Usart3 = Apb1; - static constexpr uint32_t Usart4 = Apb1; - static constexpr uint32_t Usart5 = Apb1; - static constexpr uint32_t Spi1 = Apb2; - static constexpr uint32_t Spi2 = Apb2; static constexpr uint32_t Iwdg = Rcc::LsiFrequency; + static constexpr uint32_t Usb = Apb1; static bool inline enable() @@ -111,6 +138,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_l432kc +/// @{ +using Sda = D4; +using Scl = D5; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_l432kc +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_l432kc /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -124,6 +173,20 @@ initialize() stlink::Uart::connect(Gpio::InputType::PullUp); stlink::Uart::initialize(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } diff --git a/src/modm/board/nucleo_l432kc/module.lb b/src/modm/board/nucleo_l432kc/module.lb index f87a49ae87..a2abe868a7 100644 --- a/src/modm/board/nucleo_l432kc/module.lb +++ b/src/modm/board/nucleo_l432kc/module.lb @@ -23,8 +23,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32l432kcu"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_l452re/board.hpp b/src/modm/board/nucleo_l452re/board.hpp index 5b8d38e020..6fd7e3ec57 100644 --- a/src/modm/board/nucleo_l452re/board.hpp +++ b/src/modm/board/nucleo_l452re/board.hpp @@ -120,6 +120,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_l452re +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_l452re +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_l452re /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -137,6 +159,20 @@ initialize() Button::setInput(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } // Board namespace diff --git a/src/modm/board/nucleo_l452re/module.lb b/src/modm/board/nucleo_l452re/module.lb index 3eaacb50cf..2305dae2f0 100644 --- a/src/modm/board/nucleo_l452re/module.lb +++ b/src/modm/board/nucleo_l452re/module.lb @@ -23,8 +23,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32l452ret"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/nucleo_l476rg/board.hpp b/src/modm/board/nucleo_l476rg/board.hpp index 2d887a5753..6eb4d18995 100644 --- a/src/modm/board/nucleo_l476rg/board.hpp +++ b/src/modm/board/nucleo_l476rg/board.hpp @@ -88,6 +88,28 @@ using Uart = Usart2; /// @} } +namespace i2c +{ +/// @ingroup modm_board_nucleo_l476rg +/// @{ +using Sda = D14; +using Scl = D15; +using Controller = I2cMaster1; +/// @} +} + +namespace spi +{ +/// @ingroup modm_board_nucleo_l476rg +/// @{ +using Cs = D10; +using Sck = D13; +using Sdi = D12; +using Sdo = D11; +using Controller = SpiMaster1; +/// @} +} + /// @ingroup modm_board_nucleo_l476rg /// @{ using LoggerDevice = modm::IODeviceWrapper< stlink::Uart, modm::IOBuffer::BlockIfFull >; @@ -105,6 +127,20 @@ initialize() Button::setInput(); } + +inline void +initializeI2c() +{ + i2c::Controller::connect(); + i2c::Controller::initialize(); +} + +inline void +initializeSpi() +{ + spi::Controller::connect(); + spi::Controller::initialize(); +} /// @} } // Board namespace diff --git a/src/modm/board/nucleo_l476rg/module.lb b/src/modm/board/nucleo_l476rg/module.lb index a9575a31d9..fb3d5ec088 100644 --- a/src/modm/board/nucleo_l476rg/module.lb +++ b/src/modm/board/nucleo_l476rg/module.lb @@ -23,8 +23,16 @@ def prepare(module, options): if not options[":target"].partname.startswith("stm32l476rgt"): return False - module.depends(":platform:core", ":platform:gpio", ":platform:clock", ":platform:uart:2", - ":debug", ":architecture:clock") + module.depends( + ":architecture:clock", + ":debug", + ":platform:clock", + ":platform:core", + ":platform:gpio", + ":platform:i2c:1", + ":platform:spi:1", + ":platform:uart:2" + ) return True def build(env): diff --git a/src/modm/board/same70_xplained/board.hpp b/src/modm/board/same70_xplained/board.hpp index c7209f3893..b0b401eaba 100644 --- a/src/modm/board/same70_xplained/board.hpp +++ b/src/modm/board/same70_xplained/board.hpp @@ -51,7 +51,7 @@ struct SystemClock }; using Led0 = GpioC8; -using ButtonSW0 = GpioInverted; +using Button = GpioInverted; using Leds = SoftwareGpioPort; @@ -80,7 +80,7 @@ initialize() Debug::Uart::connect(); Leds::setOutput(); - ButtonSW0::setInput(InputType::PullUp); + Button::setInput(InputType::PullUp); } /* diff --git a/src/modm/board/samg55_xplained_pro/board.hpp b/src/modm/board/samg55_xplained_pro/board.hpp index 1d9c0628e0..dd27f4d17f 100644 --- a/src/modm/board/samg55_xplained_pro/board.hpp +++ b/src/modm/board/samg55_xplained_pro/board.hpp @@ -63,6 +63,7 @@ struct SystemClock }; using Led = GpioA6; +using Leds = SoftwareGpioPort; using Button = GpioA2; using DebugUart = Usart7; using TxPin = GpioA28; @@ -88,6 +89,12 @@ initialize() inline void initializeUsbFs() { + // Pull DP low briefly on reset to make sure USB host disconnects/reconnects + MATRIX->CCFG_SYSIO |= (CCFG_SYSIO_SYSIO11 | CCFG_SYSIO_SYSIO10); + GpioA22::setOutput(false); + modm::delay_ms(5); + GpioA22::setInput(); + SystemClock::enableUsb(); Usb::initialize(); } diff --git a/src/modm/board/samv71_xplained_ultra/board.hpp b/src/modm/board/samv71_xplained_ultra/board.hpp index 2d75c252e1..d83623387b 100644 --- a/src/modm/board/samv71_xplained_ultra/board.hpp +++ b/src/modm/board/samv71_xplained_ultra/board.hpp @@ -67,7 +67,7 @@ struct SystemClock using Led0 = GpioInverted; using Led1 = GpioInverted; -using ButtonSW0 = GpioInverted; +using Button = GpioInverted; using Leds = SoftwareGpioPort; @@ -111,7 +111,7 @@ initialize() Leds::reset(); Leds::setOutput(); - ButtonSW0::setInput(InputType::PullUp); + Button::setInput(InputType::PullUp); Can::Can::connect(InputType::PullUp); } diff --git a/src/modm/board/srxe/board.hpp b/src/modm/board/srxe/board.hpp index 8f32b76182..05b250c044 100644 --- a/src/modm/board/srxe/board.hpp +++ b/src/modm/board/srxe/board.hpp @@ -26,6 +26,7 @@ using namespace modm::literals; using SystemClock = modm::platform::SystemClock; using LedDebug = GpioB0; +using Button = GpioUnused; using Leds = SoftwareGpioPort; /// @} diff --git a/src/modm/platform/core/cortex/assert.cpp.in b/src/modm/platform/core/cortex/assert.cpp.in index 5946334220..cccd89c9e8 100644 --- a/src/modm/platform/core/cortex/assert.cpp.in +++ b/src/modm/platform/core/cortex/assert.cpp.in @@ -84,11 +84,6 @@ modm_assert_report(_modm_assertion_info *cinfo) } } -// Mingw64 :facepalm; -#if defined(__MINGW64__) && !defined(__clang__) -#define PRIuPTR "I64u" -#endif - modm_weak void modm_abandon(const modm::AssertionInfo &info) { diff --git a/src/modm/platform/i2c/sam_x7x/i2c_master.hpp.in b/src/modm/platform/i2c/sam_x7x/i2c_master.hpp.in index 5fd43208b0..e450e19a4a 100644 --- a/src/modm/platform/i2c/sam_x7x/i2c_master.hpp.in +++ b/src/modm/platform/i2c/sam_x7x/i2c_master.hpp.in @@ -79,7 +79,7 @@ private: constexpr bool fastMode = baudrate > 125'000; // Baudrate threshold above which the low time is fixed to the minimum value of // 1.3us in fast mode or 4.7us in standard mode. - constexpr auto minLowTime = fastMode ? 1.3e-6 : 4.7e-6; + constexpr auto minLowTime = fastMode ? 1.3e-6f : 4.7e-6f; constexpr auto minLowTimeLimit = 1.f / (2*minLowTime); // t_high = ((CHDIV * 2^CKDIV) + 3) * (1 / peripheral clock) @@ -87,7 +87,7 @@ private: if constexpr (baudrate > minLowTimeLimit) { // calculate ideal low and high prescaler values (formula from ASF vendor HAL) constexpr auto cldiv = uint32_t(std::round((minLowTime * clock) - 3)); - constexpr auto tHigh = 1.f / ((baudrate + (baudrate - minLowTimeLimit)) * 2.f); + constexpr auto tHigh = 1.f / ((baudrate + float(baudrate - minLowTimeLimit)) * 2.f); constexpr auto chdiv = uint32_t(std::round((tHigh * clock) - 3)); // use 2^N pre-divider if max. prescaler exceeds 8 bits diff --git a/tools/scripts/examples_check.py b/tools/scripts/examples_check.py index 3fa837568a..4f13e7e30f 100755 --- a/tools/scripts/examples_check.py +++ b/tools/scripts/examples_check.py @@ -52,33 +52,39 @@ def check_builds_paths(projects): return result -def _get_paths_from_ci(files): - paths = set() - for file in files: - matches = re.findall(r"examples_compile.py (.*?)\)", file.read_text()) - paths |= set(m for match in matches for m in match.split(" ")) - return paths +def check_ci_workflows(folders): + def _check(path, missing=None): + path = ".github/workflows/" + path + matches = re.findall(r"examples_compile.py (.*?)\)", repopath(path).read_text()) + paths = set(m for match in matches for m in match.split(" ")) -def check_is_part_of_ci(projects): - folders = set(p.relative_to(repopath("examples")).parts[0] for p in projects) - result = 0 - # Linux files - paths = _get_paths_from_ci([repopath(".github/workflows/linux.yml")]) - paths = folders - paths - if paths: - print("\nLinux CI is missing examples: '{}'" - .format("', '".join(sorted(list(paths)))), file=sys.stderr) - print(" Please add these example folders to the appropriate CI job in\n" - " '.github/workflows/linux.yml'!") + if nonexistant_paths := paths - folders: + print("\nThe CI is trying to build examples that don't exist:\n\n- " + + "\n- ".join(sorted(list(nonexistant_paths))) + + "\n\n Please remove these example folders from the CI configuration:" + f"\n '{path}'!", file=sys.stderr) + + if missing is not None and (missing_paths := folders - paths - missing): + print("\nThe CI is missing examples:\n\n- " + + "\n- ".join(sorted(list(missing_paths))) + + "\n\n Please add these example folders to the appropriate CI job in" + f"\n '{path}'!", file=sys.stderr) + return len(missing_paths) + len(nonexistant_paths) - return len(paths) + return len(nonexistant_paths) + + errors = _check("linux.yml", {'rpi'}) + errors += _check("macos.yml") + errors += _check("windows.yml") + return errors if __name__ == "__main__": # Find all project files projects = list(repopath("examples").rglob("*/project.xml")) + folders = set(p.relative_to(repopath("examples")).parts[0] for p in projects) # Run a bunch of checks on them result = check_builds_paths(projects) - result += check_is_part_of_ci(projects) + result += check_ci_workflows(folders) # Return code if any exit(result) diff --git a/tools/scripts/examples_compile.py b/tools/scripts/examples_compile.py index 455ea55245..b1602fc3be 100755 --- a/tools/scripts/examples_compile.py +++ b/tools/scripts/examples_compile.py @@ -10,6 +10,7 @@ import os import sys import re +import shutil import argparse import platform import subprocess @@ -21,12 +22,16 @@ os.getenv("GITHUB_ACTIONS") is not None) is_running_on_windows = "Windows" in platform.platform() is_running_on_arm64 = "arm64" in platform.machine() -build_dir = (Path(os.path.abspath(__file__)).parents[2] / "build") +repo_dir = Path(os.path.abspath(__file__)).parents[2] +build_dir = repo_dir / "build" +examples_dir = repo_dir / "examples" cache_dir = build_dir / "cache" -global_options = {} -if is_running_in_ci: - global_options["::build.path"] = "build/" - global_options[":::cache_dir"] = str(cache_dir) +repo_file = repo_dir / "repo.lb" +option_collector_pattern = r'\n\s+' +option_map = {"option": "-D", "collect": "--collect"} +module_pattern = r'\n\s+' +global_options = f" -D modm:build:build.path=build/ -D modm:build:scons:cache_dir={cache_dir}" if is_running_in_ci else "" + def run_command(where, command, all_output=False): result = subprocess.run(command, shell=True, cwd=where, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -45,18 +50,45 @@ def enable(projects): filtered_projects.append(project) return filtered_projects +def prepare(project): + build_path = build_dir / project.relative_to(examples_dir) + project_cfg = project.read_text() + configs = set(re.findall(r"(.+?)", project_cfg)) + + if len(configs) >= 2: + output = ["=" * 90, f"Preparing: {project.parent}\n"] + config_options_collectors = re.findall(option_collector_pattern, project_cfg, flags=re.MULTILINE) + config_modules = re.findall(module_pattern, project_cfg, flags=re.MULTILINE) + generators = [] + for config in sorted(configs): + config_name = re.sub(r"[:-]+", "_", config) + new_project_xml = (project.parent / build_path / config_name.replace("modm_", "") / "project.xml") + shutil.copytree(project.parent, new_project_xml.parent, dirs_exist_ok=True) + new_project_cfg = re.sub(r".*?", "", project_cfg) + new_project_cfg = re.sub(r"", f"\n {config}", new_project_cfg) + new_project_xml.write_text(new_project_cfg) + options = "".join(f" {option_map[t]} {k}={v}" for d,t,k,v in config_options_collectors if config in d) + build_options = "".join(f" -m {m}" for d,m in config_modules if config in d) + lbuild_options = f"-r {repo_file} -D modm:build:build.path=build/" + options + generators.append((project, config, lbuild_options, build_options, new_project_xml)) + output.append(f"- {config:30}{options}{build_options}") + print("\n".join(output)) + return generators + + if '' in project_cfg: + target = "hosted-" + platform.system().lower() + if is_running_on_arm64: target += "-arm64" + return [(project, target, "-D modm:target=" + target, "", project)] + + return [(project, "project.xml", "", "", project)] def generate(project): - path = project.parent - output = ["=" * 90, "Generating: {}".format(path)] - options = " ".join("-D{}={}".format(k, v) for k,v in global_options.items()) - # Compile Linux examples under macOS with hosted-darwin target - if "hosted-linux" in project.read_text(): - options += " -D:target=hosted-{}".format(platform.system().lower()) - if is_running_on_arm64: options += "-arm64" - rc, ro = run_command(path, "lbuild {} build".format(options)) + project, config, lbuild_options, build_options, project_xml = project + output = ["=" * 90, f"Generating: {project.parent} for {config}"] + cmd = f"lbuild {global_options} {lbuild_options} build {build_options} --no-log" + rc, ro = run_command(project_xml.parent, cmd) print("\n".join(output + [ro])) - return None if rc else project + return None if rc else project_xml.resolve() def build(project): path = project.parent @@ -68,14 +100,14 @@ def build(project): commands.append( ("make build", "Make") ) elif ":build:cmake" in project_cfg and not is_running_on_windows: build_dir = re.search(r'name=".+?:build:build.path">(.*?)', project_cfg)[1] - cmd = "cmake -E make_directory {}/cmake-build-release; ".format(build_dir) - cmd += '(cd {}/cmake-build-release && cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" {}); '.format(build_dir, path.absolute()) - cmd += "cmake --build {}/cmake-build-release".format(build_dir) + cmd = f"cmake -E make_directory {build_dir}/cmake-build-release; " + cmd += f'(cd {build_dir}/cmake-build-release && cmake -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" {path.absolute()}); ' + cmd += f"cmake --build {build_dir}/cmake-build-release" commands.append( (cmd, "CMake") ) rcs = 0 for command, build_system in commands: - output = ["=" * 90, "Building: {} with {}".format(path / "main.cpp", build_system)] + output = ["=" * 90, f"Building: {path.relative_to(repo_dir)}/main.cpp with {build_system}"] rc, ro = run_command(path, command) rcs += rc print("\n".join(output + [ro])) @@ -93,7 +125,7 @@ def run(project): rcs = 0 for command, build_system in commands: - output = ["=" * 90, "Running: {} with {}".format(path / "main.cpp", build_system)] + output = ["=" * 90, f"Running: {path.relative_to(repo_dir)}/main.cpp with {build_system}"] rc, ro = run_command(path, command, all_output=True) print("\n".join(output + [ro])) if "CI: run fail" in project_cfg: @@ -104,7 +136,7 @@ def run(project): return None if rcs else project def compile_examples(paths, jobs, split, part): - print("Using {}x parallelism".format(jobs)) + print(f"Using {jobs}x parallelism") # Create build folder to prevent process race cache_dir.mkdir(exist_ok=True, parents=True) (cache_dir / "config").write_text('{"prefix_len": 2}') @@ -122,9 +154,17 @@ def compile_examples(paths, jobs, split, part): # Filter projects projects = enable(projects) + # first prepare all projects + with ThreadPool(jobs) as pool: + projects = pool.map(prepare, projects) + # Unlistify the project preparations + projects = [p for plist in projects for p in plist] + results += projects.count(None) + # first generate all projects with ThreadPool(jobs) as pool: projects = pool.map(generate, projects) + # Unlistify the project configs results += projects.count(None) # Filter projects for successful generation