Skip to content

Commit b715281

Browse files
soburiDhruvaG2000
authored andcommitted
zephyrSerial: Fix misdetection arduino_serial1
DT_NODE_EXISTS value is true even if the status is disabled, so it caused misdetection. Use DT_NODE_HAS_STATUS to detect the status of the arduino_serial1 node is ok. Signed-off-by: TOKITA Hiroshi <[email protected]>
1 parent b252469 commit b715281

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cores/arduino/zephyrSerial.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ arduino::ZephyrSerial Serial(DEVICE_DT_GET(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user
186186

187187
DT_FOREACH_PROP_ELEM(DT_PATH(zephyr_user), serials, DECLARE_SERIAL_N)
188188
#endif // PROP_LEN(serials) > 1
189-
#elif DT_NODE_EXISTS(DT_NODELABEL(arduino_serial))
189+
#elif DT_NODE_HAS_STATUS(DT_NODELABEL(arduino_serial), okay)
190190
/* If serials node is not defined, tries to use arduino_serial */
191191
arduino::ZephyrSerial Serial(DEVICE_DT_GET(DT_NODELABEL(arduino_serial)));
192192
#else

cores/arduino/zephyrSerial.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ DT_FOREACH_PROP_ELEM(DT_PATH(zephyr_user), serials, DECLARE_EXTERN_SERIAL_N)
9292
#undef EXTERN_SERIAL_N
9393
#undef SERIAL_DEFINED_0
9494
#endif
95-
#elif DT_NODE_EXISTS(DT_NODELABEL(arduino_serial))
95+
#elif DT_NODE_HAS_STATUS(DT_NODELABEL(arduino_serial), okay)
9696
extern arduino::ZephyrSerial Serial;
9797
#else
9898
extern arduino::ZephyrSerialStub Serial;

0 commit comments

Comments
 (0)