diff --git a/README.md b/README.md index d4a20ed1..d941f847 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,9 @@ Arduino Core API module for zephyr leverages the power of Zephyr under an Arduin west update ``` +* **Note:** For ***Linux users only*** there exists an ``install.sh`` script in this project that can be run to quickly link the ArduinoCore-API to this module. +If you are able to run that script successfully then you can skip the next steps. + * To "complete" the core you need to copy or symlink the api folder from the [ArduinoCore-API](https://github.com/arduino/ArduinoCore-API.git) repo to the target's ``cores/arduino`` folder: ```sh $ git clone git@github.com:arduino/ArduinoCore-API # Any location @@ -36,6 +39,9 @@ $ ln -s ///ArduinoCore-API/api cores/arduino/. The `cores` folder can be found at `~/zephyrproject/modules/lib/Arduino-Zephyr-API/cores`. **Known Bug(s):** + +__NOTE:__ You can skip this step as well if you ran ``install.sh``. + * While compiling with the ArduinoCore-API `WCharacter.h` produces many errors. The include of that file needs to be deleted from `cores/arduino/api/ArduinoAPI.h` (it is unused in this port.) We are looking into resolving the issue. **Maintainers**: diff --git a/install.sh b/install.sh new file mode 100755 index 00000000..6ecce735 --- /dev/null +++ b/install.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -e; + +printf '%s\n' "Before running this script, make sure of the following:" +printf '%s\n' "1. You have zephyr installed properly on your system." +printf '%s\n' "2. Updated west.yml in zephyr and run west update to pull this module in proper location." +printf '%s\n' "If you meet the above criteria, please enter [yY]Yes and if not, then [nN]No." +read answer; + +if [ "$answer" != "${answer#[Yy]}" ] ;then + printf '%s\n' "Yes"; +else + printf '%s\n' "No"; + exit 1; +fi + +API_FOLDER=~/.ArduinoCore-API +if [ ! -d "$API_FOLDER" ] ; then + printf '%s\n' "Cloning ArduinoCore API in $API_FOLDER"; + git clone git@github.com:arduino/ArduinoCore-API ~/.ArduinoCore-API; +else + printf '%s\n' "API Folder already exists, skipping clone..."; +fi + +printf '%s\n' "Commenting out WCharacter.h because it fails to build properly"; +sed '/WCharacter.h/ s/./\/\/ &/' ~/.ArduinoCore-API/api/ArduinoAPI.h > ~/.ArduinoCore-API/api/tmpArduinoAPI.h ; +mv ~/.ArduinoCore-API/api/tmpArduinoAPI.h ~/.ArduinoCore-API/api/ArduinoAPI.h ; + +printf '%s\n' "Linking..."; +ln -sf ~/.ArduinoCore-API/api cores/arduino/. ; + +printf '%s\n' "Module Successfully setup..."; +