@@ -40,6 +40,14 @@ function(find_arduino_sdk _return_var)
4040
4141endfunction ()
4242
43+ #=============================================================================#
44+ # Attempts to find the Arduino SDK's bin folder in the host system, searching at known locations.
45+ # Most installs will have it at SDK/hardware/tools/avr/bin but if nothing is there, it will
46+ # attempt to find a folder in PATH containing avr-gcc, hoping that everything else will be there too
47+ # This is because a bunch of linux distros' package managers install the binaries into /usr/bin
48+ # _return_var - Name of variable in parent-scope holding the return value.
49+ # Returns - Path to the folder containing Arduino compiler binaries
50+ #=============================================================================#
4351function (find_arduino_sdk_bin _return_var)
4452
4553 if (DEFINED ENV{ARDUINO_SDK_BIN_PATH})
@@ -63,6 +71,14 @@ function(find_arduino_sdk_bin _return_var)
6371
6472endfunction ()
6573
74+ #=============================================================================#
75+ # Attempts to find the Arduino SDK's root folder in the host system, searching at known locations.
76+ # Most installs will have it at SDK/hardware/tools/avr/ but if nothing is there, it will
77+ # attempt to find a folder containing etc/avrdude.conf, since a bunch of linux distros
78+ # put this into /etc rather than a subdirectory of the arduino SDK
79+ # _return_var - Name of variable in parent-scope holding the return value.
80+ # Returns - Path to the directory containing etc/avrdude.conf
81+ #=============================================================================#
6682function (find_arduino_sdk_root _return_var)
6783
6884 if (DEFINED ENV{ARDUINO_SDK_ROOT_PATH})
0 commit comments