Hello world!
This commit is contained in:
parent
21d8e85292
commit
e0230679c2
11 changed files with 282 additions and 0 deletions
24
scripts/build.sh
Executable file
24
scripts/build.sh
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Gitpod and VsCode Codespaces tasks do not source the user environment
|
||||
if [ "${USER}" == "gitpod" ]; then
|
||||
which idf.py >/dev/null || {
|
||||
source ~/export-esp.sh > /dev/null 2>&1
|
||||
}
|
||||
elif [ "${CODESPACE_NAME}" != "" ]; then
|
||||
which idf.py >/dev/null || {
|
||||
source ~/export-esp.sh > /dev/null 2>&1
|
||||
}
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
""|"release")
|
||||
cargo build --release
|
||||
;;
|
||||
"debug")
|
||||
cargo build
|
||||
;;
|
||||
*)
|
||||
echo "Wrong argument. Only \"debug\"/\"release\" arguments are supported"
|
||||
exit 1;;
|
||||
esac
|
22
scripts/flash.sh
Executable file
22
scripts/flash.sh
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
BUILD_MODE=""
|
||||
case "$1" in
|
||||
""|"release")
|
||||
bash scripts/build.sh
|
||||
BUILD_MODE="release"
|
||||
;;
|
||||
"debug")
|
||||
bash scripts/build.sh debug
|
||||
BUILD_MODE="debug"
|
||||
;;
|
||||
*)
|
||||
echo "Wrong argument. Only \"debug\"/\"release\" arguments are supported"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
export ESP_ARCH=xtensa-esp32-espidf
|
||||
|
||||
web-flash --chip esp32 target/${ESP_ARCH}/${BUILD_MODE}/e-bike-tracker-device
|
36
scripts/run-wokwi.sh
Executable file
36
scripts/run-wokwi.sh
Executable file
|
@ -0,0 +1,36 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
BUILD_MODE=""
|
||||
case "$1" in
|
||||
""|"release")
|
||||
bash scripts/build.sh
|
||||
BUILD_MODE="release"
|
||||
;;
|
||||
"debug")
|
||||
bash scripts/build.sh debug
|
||||
BUILD_MODE="debug"
|
||||
;;
|
||||
*)
|
||||
echo "Wrong argument. Only \"debug\"/\"release\" arguments are supported"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
if [ "${USER}" == "gitpod" ];then
|
||||
gp_url=$(gp url 9012)
|
||||
echo "gp_url=${gp_url}"
|
||||
export WOKWI_HOST=${gp_url:8}
|
||||
elif [ "${CODESPACE_NAME}" != "" ];then
|
||||
export WOKWI_HOST=${CODESPACE_NAME}-9012.githubpreview.dev
|
||||
fi
|
||||
|
||||
export ESP_ARCH=xtensa-esp32-espidf
|
||||
|
||||
# TODO: Update with your Wokwi Project
|
||||
export WOKWI_PROJECT_ID=""
|
||||
if [ "${WOKWI_PROJECT_ID}" == "" ]; then
|
||||
wokwi-server --chip esp32 target/${ESP_ARCH}/${BUILD_MODE}/e-bike-tracker-device
|
||||
else
|
||||
wokwi-server --chip esp32 --id ${WOKWI_PROJECT_ID} target/${ESP_ARCH}/${BUILD_MODE}/e-bike-tracker-device
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue