forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools/psoc6: Adding dev environment setup support script.
Signed-off-by: enriquezgarc <enriquezgarcia.external@infineon.com>
- Loading branch information
1 parent
059f1bc
commit 3a72023
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
# Use this script to setup your development environment. | ||
# With the ModusToolbox installed: | ||
# | ||
# $ source dev-setup.sh && toolchain_setup [path_to_modustoolbox] | ||
# | ||
# The path to the ModusToolbox is required if installed somewhere | ||
# else than in the default home path (~/ModusToolbox) | ||
|
||
function set_mtb_tools_path { | ||
mtb_path=$1 | ||
if [ "$mtb_path" = "" ]; then | ||
mtb_path=~/ModusToolbox | ||
fi | ||
|
||
echo ${mtb_path}/tools_* | ||
} | ||
|
||
function export_path { | ||
mtb_tools_path=$(set_mtb_tools_path) | ||
export PATH=${mtb_tools_path}/openocd/bin:${mtb_tools_path}/library-manager:${mtb_tools_path}/gcc/bin:$PATH | ||
} | ||
|
||
function install_udev_rules { | ||
mtb_tools_path=$(set_mtb_tools_path) | ||
${mtb_tools_path}/openocd/udev_rules/install_rules.sh | ||
} | ||
|
||
function toolchain_setup { | ||
mtb_path=$1 | ||
export_path ${mtb_path} | ||
install_udev_rules | ||
} | ||
|
||
function git_add_ssh { | ||
ssh_key=$1 | ||
eval $(ssh-agent -s) | ||
ssh-add ${ssh_key} | ||
} |