Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple configuration to deduplicate examples #1118

Draft
wants to merge 17 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 13 additions & 25 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
20 changes: 12 additions & 8 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
75 changes: 72 additions & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -117,6 +180,12 @@ Here are some additional examples of displays and sensors we like:
<!--/checkrepourls-->


<!--webignore-->
### Compiling Examples for Multiple Targets


<!--/webignore-->

### Copy Carefully

When copying from our examples make sure to set the repository path correctly!
Expand All @@ -134,10 +203,10 @@ The `modm/examples/lbuild.xml` file:
When you write your own application, you must set this
path yourself! -->
<repositories>
<repository><path>../repo.lb</path></repository>
<repository><path>../repo.lb</path></repository>
</repositories>
<modules>
<module>modm:docs</module>
<module>modm:docs</module>
</modules>
</library>
```
Expand Down
3 changes: 0 additions & 3 deletions examples/arduino_nano/color/project.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<library>
<extends>modm:arduino-nano</extends>
<options>
<option name="modm:build:build.path">../../../build/arduino_nano/color</option>
</options>
<modules>
<module>modm:build:scons</module>
<module>modm:processing:protothread</module>
Expand Down
3 changes: 0 additions & 3 deletions examples/arduino_nano/encoder_input_bitbang/project.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<library>
<extends>modm:arduino-nano</extends>
<options>
<option name="modm:build:build.path">../../../build/arduino_nano/encoder_input_bitbang</option>
</options>
<modules>
<module>modm:build:scons</module>
<module>modm:processing:timer</module>
Expand Down
1 change: 0 additions & 1 deletion examples/arduino_nano/printf/project.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<library>
<extends>modm:arduino-nano</extends>
<options>
<option name="modm:build:build.path">../../../build/arduino_nano/printf</option>
<option name="modm:io:with_long_long">yes</option>
<option name="modm:io:with_float">yes</option>
<option name="modm:io:with_printf">yes</option>
Expand Down
3 changes: 0 additions & 3 deletions examples/arduino_uno/basic/analog_read_serial/project.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<library>
<extends>modm:arduino-uno</extends>
<options>
<option name="modm:build:build.path">../../../../build/arduino_uno/basic/analog_read_serial</option>
</options>
<modules>
<module>modm:platform:adc</module>
<module>modm:build:scons</module>
Expand Down
31 changes: 0 additions & 31 deletions examples/arduino_uno/basic/blink/main.cpp

This file was deleted.

9 changes: 0 additions & 9 deletions examples/arduino_uno/basic/blink/project.xml

This file was deleted.

1 change: 0 additions & 1 deletion examples/arduino_uno/basic/digital_read_serial/project.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<library>
<extends>modm:arduino-uno</extends>
<options>
<option name="modm:build:build.path">../../../../build/arduino_uno/basic/digital_read_serial</option>
<option name="modm:build:cmake:include_cmakelists">yes</option>
</options>
<modules>
Expand Down
1 change: 0 additions & 1 deletion examples/arduino_uno/basic/read_analog_voltage/project.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<library>
<extends>modm:arduino-uno</extends>
<options>
<option name="modm:build:build.path">../../../../build/arduino_uno/basic/read_analog_voltage</option>
<option name="modm:io:with_float">True</option>
</options>
<modules>
Expand Down
1 change: 0 additions & 1 deletion examples/avr/1-wire/ds18b20/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<options>
<option name="modm:target">atmega644-20au</option>
<option name="modm:platform:core:f_cpu">14.7456M</option>
<option name="modm:build:build.path">../../../../build/avr/1-wire/ds18b20</option>
</options>
<modules>
<module>modm:driver:ds18b20</module>
Expand Down
1 change: 0 additions & 1 deletion examples/avr/adc/basic/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<options>
<option name="modm:target">atmega644-20au</option>
<option name="modm:platform:core:f_cpu">14.7456M</option>
<option name="modm:build:build.path">../../../../build/avr/adc/basic</option>
</options>
<modules>
<module>modm:io</module>
Expand Down
1 change: 0 additions & 1 deletion examples/avr/adc/oversample/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<options>
<option name="modm:target">atmega644-20au</option>
<option name="modm:platform:core:f_cpu">14.7456M</option>
<option name="modm:build:build.path">../../../../build/avr/adc/oversample</option>
</options>
<modules>
<module>modm:driver:adc_sampler</module>
Expand Down
1 change: 0 additions & 1 deletion examples/avr/app_can2usb/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<options>
<option name="modm:target">at90can128-16au</option>
<option name="modm:platform:core:f_cpu">16M</option>
<option name="modm:build:build.path">../../../build/avr/app_can2usb</option>
</options>
<modules>
<module>modm:architecture:delay</module>
Expand Down
Loading
Loading