Skip to content

Commit 952741e

Browse files
committed
stubs: be smarter about the library error messages
Detect the common case of users cloning the core with the original name "ArduinoCore-zephyr" and warn them about it, as it causes library detection issues. Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
1 parent 26905aa commit 952741e

1 file changed

Lines changed: 24 additions & 3 deletions

File tree

libraries/stubs/Arduino_RouterBridge.h

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,31 @@
77
#pragma once
88

99
/*
10-
* This is just a placeholder to handle the case of the Arduino_RouterBridge
11-
* library NOT being installed. If this file is chosen, the actual library is
12-
* missing and the user needs to be warned about it.
10+
* This file is used to detect issues with the Arduino_RouterBridge library not
11+
* being detected properly. If this gets selected, either the library is not
12+
* installed or there is an issue with the library detection.
13+
*/
14+
15+
#ifdef ARDUINO_ARCH_ARDUINOCORE_ZEPHYR
16+
17+
/*
18+
* The core was probably cloned with the original name in the hardware/ sketch
19+
* folder, but that becomes part of the FQBN and it messes with library search,
20+
* so even if the library is installed it is deemed "not compatible".
21+
* Force the user to rename the core folder to "zephyr" to avoid this issue.
22+
*/
23+
24+
#error \
25+
"Invalid configuration: please rename your 'ArduinoCore-zephyr' folder inside hardware/ to 'zephyr'."
26+
27+
#else
28+
29+
/*
30+
* If the folder name is correct, then the actual library is really missing and
31+
* the user needs to be warned about it.
1332
*/
1433

1534
#error \
1635
"Please install the Arduino_RouterBridge library from the Library Manager for proper Serial support on this board."
36+
37+
#endif

0 commit comments

Comments
 (0)