Tactility SDK and release build scripting (#122)
* Implement release scripting and SDK building process * Fix for CYD display colors * Various improvements and fixes * Made build scripts more modular
This commit is contained in:
committed by
GitHub
parent
43714b2355
commit
a18221db08
@@ -0,0 +1,20 @@
|
||||
param(
|
||||
$port
|
||||
)
|
||||
|
||||
if ((Get-Command "esptool.py" -ErrorAction SilentlyContinue) -eq $null)
|
||||
{
|
||||
Write-Host "Unable to find esptool.py in your path. Make sure you have Python installed and on your path. Then run `pip install esptool`."
|
||||
}
|
||||
|
||||
|
||||
# Create flash command based on partitions
|
||||
$json = Get-Content .\build\flasher_args.json -Raw | ConvertFrom-Json
|
||||
$jsonClean = $json.flash_files -replace '[\{\}\@\;]', ''
|
||||
$jsonClean = $jsonClean -replace '[\=]', ' '
|
||||
|
||||
cd Binaries
|
||||
$command = "esptool.py --connect-attemps 10 --port $port -b 460800 write_flash $jsonClean"
|
||||
Invoke-Expression $command
|
||||
cd ..
|
||||
|
||||
Executable
+41
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Usage:
|
||||
# flash.sh [port]
|
||||
#
|
||||
# Arguments:
|
||||
# port - the port of the device (e.g. /dev/ttyUSB0, ...)
|
||||
#
|
||||
# Requirements:
|
||||
# jq - run 'pip install jq'
|
||||
# esptool.py - run 'pip install esptool'
|
||||
#
|
||||
# Documentation:
|
||||
# https://docs.espressif.com/projects/esptool/en/latest/esp32/
|
||||
#
|
||||
|
||||
# Source: https://stackoverflow.com/a/53798785
|
||||
function is_bin_in_path {
|
||||
builtin type -P "$1" &> /dev/null
|
||||
}
|
||||
|
||||
function require_bin {
|
||||
program=$1
|
||||
tip=$2
|
||||
if ! is_bin_in_path $program; then
|
||||
echo -e "\e[31m⚠️ $program not found!\n\t$tip\e[0m"
|
||||
fi
|
||||
}
|
||||
|
||||
require_bin esptool.py "install esptool from your package manager or install python and run 'pip install esptool'"
|
||||
require_bin jq "install jq from your package manager or install python and run 'pip install jq'"
|
||||
|
||||
if [[ $1 -eq 0 ]]; then
|
||||
echo -e "\e[31m⚠️ Must Specify port as argument. For example:\n\tflash.sh /dev/ttyACM0\n\tflash.sh /dev/ttyUSB0\e[0m"
|
||||
exit -1
|
||||
fi
|
||||
|
||||
cd Binaries
|
||||
# Create flash command based on partitions
|
||||
KEY_VALUES=`jq -r '.flash_files | keys[] as $k | "\($k) \(.[$k])"' flasher_args.json | tr "\n" " "`
|
||||
esptool.py --port $1 --connect-attempts 10 -b 460800 write_flash $KEY_VALUES
|
||||
Reference in New Issue
Block a user