Conversation
a2f7406 to
4fbaf90
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors the Arduino Zephyr core by splitting the large zephyrCommon.cpp implementation into smaller, more focused compilation units. It also updates multiple sample CMakeLists.txt files to locate devicetree overlay files from variant directories (including revision-specific variants).
Changes:
- Remove
cores/arduino/zephyrCommon.cppand replace it with separate wiring/utility/interrupt/tone source files. - Add
cores/arduino/wiring_private.hto share devicetree-derived pin/port constants across the new units. - Update sample builds to select overlays from variant directories (including
${NORMALIZED_BOARD_TARGET}_${BOARD_REVISION}) and enable ADC/PWM in the blinky sample config.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| samples/threads_arduino/CMakeLists.txt | Adds variant directory + overlay selection logic. |
| samples/spi_controller/CMakeLists.txt | Adds variant directory + overlay selection logic. |
| samples/serial_event/CMakeLists.txt | Adds variant directory + overlay selection logic. |
| samples/i2cdemo/CMakeLists.txt | Adds variant directory + overlay selection logic. |
| samples/hello_arduino/CMakeLists.txt | Adds variant directory + overlay selection logic. |
| samples/fade/CMakeLists.txt | Adds variant directory + overlay selection logic. |
| samples/button_press_led/CMakeLists.txt | Adds variant directory + overlay selection logic. |
| samples/blinky_arduino/CMakeLists.txt | Adds variant directory + overlay selection logic. |
| samples/attach_interrupt/CMakeLists.txt | Adds variant directory + overlay selection logic. |
| samples/analog_input/CMakeLists.txt | Adds variant directory + overlay selection logic. |
| samples/blinky_arduino/prj.conf | Enables ADC/PWM configs for the blinky sample. |
| cores/arduino/zephyrCommon.cpp | Removed; functionality redistributed into new files. |
| cores/arduino/wiring.cpp | Adds yield/delay/micros/millis wiring functions. |
| cores/arduino/wiring_digital.cpp | Adds pinMode/digitalRead/digitalWrite implementation. |
| cores/arduino/wiring_analog.cpp | Adds PWM/ADC/DAC wiring implementation (gated by Kconfig). |
| cores/arduino/wiring_pulse.cpp | Adds pulseIn() implementation. |
| cores/arduino/WInterrupts.cpp | Adds attach/detach/noInterrupts/interrupts implementation. |
| cores/arduino/WMath.cpp | Adds random/randomSeed implementation (when non-minimal libc). |
| cores/arduino/Tone.cpp | Adds tone/noTone implementation. |
| cores/arduino/wiring_private.h | Introduces shared devicetree-derived pin/port constants. |
| cores/arduino/CMakeLists.txt | Replaces zephyrCommon.cpp with the new split source list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8c8d243 to
9fb90ae
Compare
9fb90ae to
48685d8
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
48685d8 to
83753ff
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
83753ff to
97e1a67
Compare
ae2cd5c to
ed51751
Compare
385e4f9 to
2518d18
Compare
2518d18 to
5c09229
Compare
5c09229 to
e3bfd9f
Compare
c8b9983 to
31a64ac
Compare
Built
|
| Artifact | Board | Core | Tests | RAM | Sketches | Warnings | Errors |
|---|---|---|---|---|---|---|---|
✅* zephyr_contrib |
ek_ra8d1
| 📗 | ✅* |
11.9% |
2 | 2 | - |
frdm_mcxn947
| 6 🏷️ | ✅* |
58.0% |
2 | 2 | - | |
frdm_rw612
| 1 🏷️ | ✅* |
83.0% |
2 | 2 | - | |
✔️* zephyr_main |
giga
| 4 🏷️ | ✅* |
54.6% |
56 | 12 | - |
nano33ble
| 1 🏷️ | ✅* |
78.8% |
28 | 10 | - | |
nano_matter
| 📗 | ✔️* |
|
20 | 10 | (2*) | |
nicla_vision
| 4 🏷️ | ✔️* |
56.9% |
50 | 12 | (10*) | |
niclasense
| 2 🏷️ | ✅* |
|
26 | 10 | - | |
opta
| 4 🏷️ | ✅* |
56.5% |
60 | 28 | - | |
portentac33
| 3 🏷️ | ✔️* |
|
62 | 26 | (8*) | |
portentah7
| 3 🏷️ | ✅* |
57.2% |
70 | 26 | - | |
✅* zephyr_unoq |
unoq
| 📗 | ✅* |
26.9% |
74 | 8 | - |
Legend
Board Test Status description 🔥 🔥 Test run failed to complete. ❌ 🔴 Test completed with unexpected errors. ✔️* 🚫 Test completed with errors, but all are known/expected. ✅* 🟡 Test completed with some warnings; no errors detected. ✅ 🟢 Test passed successfully, with no warnings or errors. 🌑 🌑 Test was skipped.
Replace {0} with {} for port_callback, set dac_channel_cfg::internal
explicitly, and expand adc_sequence initialization to make default
values explicit and avoid C++ initializer warnings.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Move constexpr-specified constants and functions used for compile-time calculations from zephyrCommon.cpp to wiring_private.h Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Split zephyrCommon.cpp into small cpp files. wirinig_digital.cpp: - pinMode - digitalWrite - digitalRead wirinig_analog.cpp: - analogRead - analogWrite - analogReference - analogReadResolution - analogWriteResolution wirinig_pulse.cpp: - pulseIn WInterrupts.cpp: - attachInterrupt - detachInterrupt - interrupts - noInterrupts - digitalPinToInterrupt WMath.cpp: - randomSeed - random Tone.cpp: - tone - noTone Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
31a64ac to
75df269
Compare
Built
|
| Artifact | Board | Core | Tests | RAM | Sketches | Warnings | Errors |
|---|---|---|---|---|---|---|---|
❌ zephyr_contrib |
ek_ra8d1
| 📗 | ❌ |
11.9% |
2 | - | 2 |
frdm_mcxn947
| 6 🏷️ | ❌ |
58.0% |
2 | - | 2 | |
frdm_rw612
| 1 🏷️ | ❌ |
83.0% |
2 | - | 2 | |
❌ zephyr_main |
giga
| 4 🏷️ | ❌ |
54.6% |
56 | - | 56 |
nano33ble
| 1 🏷️ | ❌ |
78.8% |
28 | - | 28 | |
nano_matter
| 📗 | ❌ |
|
20 | - | 18 (+2*) | |
nicla_vision
| 4 🏷️ | ❌ |
56.9% |
42 | - | 36 (+6*) | |
niclasense
| 2 🏷️ | ❌ |
|
26 | - | 26 | |
opta
| 4 🏷️ | ❌ |
56.5% |
60 | - | 58 (+2*) | |
portentac33
| 3 🏷️ | ❌ |
|
62 | - | 54 (+8*) | |
portentah7
| 3 🏷️ | ❌ |
57.2% |
70 | - | 68 (+2*) | |
❌ zephyr_unoq |
unoq
| 📗 | ❌ |
26.9% |
74 | - | 74 |
Legend
Board Test Status description 🔥 🔥 Test run failed to complete. ❌ 🔴 Test completed with unexpected errors. ✔️* 🚫 Test completed with errors, but all are known/expected. ✅* 🟡 Test completed with some warnings; no errors detected. ✅ 🟢 Test passed successfully, with no warnings or errors. 🌑 🌑 Test was skipped.
Caution
zephyr_contrib is blocked due to failures on ek_ra8d1, frdm_mcxn947, frdm_rw612!
Caution
zephyr_main is blocked due to failures on giga, nano33ble, nano_matter, nicla_vision, niclasense, opta, portentac33, portentah7!
Caution
zephyr_unoq is blocked due to failures on unoq!
Split zephyrCommon.cpp into small cpp files.