zephyrproject-rtos / gsoc-2022-arduino-core

Arduino Core Zephyr Module (GSoC 2022 Project)
Apache License 2.0
44 stars 11 forks source link

Create common digital pin definition #53

Closed soburi closed 1 year ago

soburi commented 1 year ago

The digitalPins enumeration, arduino_pins array, and contents of these are determined by d[N]_gpios declaration in dts.

Interlock the declaration with the dts definition.

DhruvaG2000 commented 1 year ago

Thank you for your contribution! Please rebase your branch on latest main and resolve conflicts

soburi commented 1 year ago

Hi, @DhruvaG2000

Thank you for your contribution! Please rebase your branch on latest main and resolve conflicts

Rebase done.

soburi commented 1 year ago

Tested on arduino nano 33 ble sense, and arduino mkr zero and blink LEDs work okay. Thanks @soburi this looks much more elegant! Thanks to macro magic I guess ;)

This PR is ready to merge pending a few formatting issues:

ERROR: space prohibited before that close parenthesis ')'
#498: FILE: variants/variants.h:22:

and many more that appear upon running checkpatch.pl patches/0001-variants-Define-common-digital-pin-definition.patch

Update done. I'll also update other PRs. I forgot to run checkpatch. Thank you.

soburi commented 1 year ago

Tested on arduino nano 33 ble sense, and arduino mkr zero and blink LEDs work okay. Thanks @soburi this looks much more elegant! Thanks to macro magic I guess ;)

I think typically configuration must be able to handle without an additional header, only an overlay file. In other words, We should create a header file only case if it can't derive from devicetree information.

(It is painful for us to manage many files and various rules. We should make effort to only need to write an overlay file basically.)

DhruvaG2000 commented 1 year ago

@soburi now that your arduino nano 33 iot fix is merged, there seem to be minor conflicts in this PR, kindly resolve them.