[riot-notifications] [RIOT-OS/RIOT] boards/lpc1768: move vendor conf code to CPU level (#15741)

Alexandre Abadie notifications at github.com
Mon Jan 11 18:06:32 CET 2021


<!--
The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.
-->

### Contribution description

This PR moves lpc1768 CPU configuration code of mbed_lpc1768 and seeduino_arch-pro boards from board level to cpu level. The `vendor_conf.h` and `system.c` and strictly the same for both boards, so this PR removes duplicated code.

Since `vendor_conf.h` is moved to the `cpu/lpc1768/include/vendor` directory, the broken header guard of that file doesn't trigger a failure.

CPU configurability (for clock, etc) could be improved (using `#ifndef/#endif` and eventually Kconfig definitions) but I leave this as follow-up PRs.

<!--
Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes
-->


### Testing procedure

- Green CI
- Firmware sizes for both boards should remain unchanged. Here are examples with `examples/hello-world`:

<details><summary>mbed_lpc1768</summary>

- master

```
$ RIOT_CI_BUILD=1 make BOARD=mbed_lpc1768 -C examples/hello-world clean all --no-print-directory 
Building application "hello-world" for "mbed_lpc1768" with MCU "lpc1768".

   text	   data	    bss	    dec	    hex	filename
   8488	    112	   2304	  10904	   2a98	/work/riot/RIOT/examples/hello-world/bin/mbed_lpc1768/hello-world.elf
```

- this PR

```
$ RIOT_CI_BUILD=1 make BOARD=mbed_lpc1768 -C examples/hello-world --no-print-directory 
Building application "hello-world" for "mbed_lpc1768" with MCU "lpc1768".

   text	   data	    bss	    dec	    hex	filename
   8488	    112	   2304	  10904	   2a98	/work/riot/RIOT/examples/hello-world/bin/mbed_lpc1768/hello-world.elf
```

</details>

<details><summary>seeeduino_arch-pro</summary>

- master

```
$ RIOT_CI_BUILD=1 make BOARD=seeeduino_arch-pro -C examples/hello-world clean all --no-print-directory 
Building application "hello-world" for "seeeduino_arch-pro" with MCU "lpc1768".

   text	   data	    bss	    dec	    hex	filename
   8500	    112	   2304	  10916	   2aa4	/work/riot/RIOT/examples/hello-world/bin/seeeduino_arch-pro/hello-world.elf
```

- this PR

```
$ RIOT_CI_BUILD=1 make BOARD=seeeduino_arch-pro -C examples/hello-world --no-print-directory 
Building application "hello-world" for "seeeduino_arch-pro" with MCU "lpc1768".

   text	   data	    bss	    dec	    hex	filename
   8500	    112	   2304	  10916	   2aa4	/work/riot/RIOT/examples/hello-world/bin/seeeduino_arch-pro/hello-world.elf
```

</details>

- broken headerguard is not reported anymore by the check script:

<details><summary>master</summary>

```
$ ./dist/tools/headerguards/check.sh 
boards/mbed_lpc1768/include/vendor_conf.h: no / broken header guard
boards/seeeduino_arch-pro/include/vendor_conf.h: no / broken header guard
sys/posix/include/fcntl.h: no / broken header guard
```

</details>

<details><summary>this PR</summary>

```
$ ./dist/tools/headerguards/check.sh 
sys/posix/include/fcntl.h: no / broken header guard
```

</details>

<!--
Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output
-->


### Issues/PRs references

Should be merged before #15740 

<!--
Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/15741

-- Commit Summary --

  * boards/lpc1768: move vendor conf code to CPU level

-- File Changes --

    M boards/mbed_lpc1768/include/periph_conf.h (2)
    M boards/seeeduino_arch-pro/include/periph_conf.h (2)
    D boards/seeeduino_arch-pro/include/vendor_conf.h (419)
    D boards/seeeduino_arch-pro/system.c (98)
    R cpu/lpc1768/include/vendor/conf.h (0)
    R cpu/lpc1768/system.c (2)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/15741.patch
https://github.com/RIOT-OS/RIOT/pull/15741.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15741
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210111/2bf74d59/attachment.htm>


More information about the notifications mailing list