mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-13 00:07:12 +00:00
Merge branch 'fz-dev' into dev
This commit is contained in:
commit
3327093dae
4 changed files with 50 additions and 10 deletions
|
@ -17,7 +17,7 @@ static void power_unplug_usb_draw_callback(Canvas* canvas, void* _model) {
|
||||||
canvas_set_color(canvas, ColorWhite);
|
canvas_set_color(canvas, ColorWhite);
|
||||||
canvas_set_font(canvas, FontPrimary);
|
canvas_set_font(canvas, FontPrimary);
|
||||||
elements_multiline_text_aligned(
|
elements_multiline_text_aligned(
|
||||||
canvas, 64, 32, AlignCenter, AlignCenter, "It's now safe to unplug\nUSB cable");
|
canvas, 64, 32, AlignCenter, AlignCenter, "It's now safe to unplug\nthe USB cable");
|
||||||
}
|
}
|
||||||
|
|
||||||
PowerUnplugUsb* power_unplug_usb_alloc() {
|
PowerUnplugUsb* power_unplug_usb_alloc() {
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 177 B After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 3.5 KiB |
|
@ -8,20 +8,61 @@ SCRIPT_PATH="${SCRIPT_PATH:-$DEFAULT_SCRIPT_PATH}";
|
||||||
FBT_TOOLCHAIN_VERSION="${FBT_TOOLCHAIN_VERSION:-"8"}";
|
FBT_TOOLCHAIN_VERSION="${FBT_TOOLCHAIN_VERSION:-"8"}";
|
||||||
FBT_TOOLCHAIN_PATH="${FBT_TOOLCHAIN_PATH:-$SCRIPT_PATH}";
|
FBT_TOOLCHAIN_PATH="${FBT_TOOLCHAIN_PATH:-$SCRIPT_PATH}";
|
||||||
|
|
||||||
|
fbtenv_show_usage()
|
||||||
|
{
|
||||||
|
echo "Running this script manually is wrong, please source it";
|
||||||
|
echo "Example:";
|
||||||
|
printf "\tsource scripts/toolchain/fbtenv.sh\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
fbtenv_curl()
|
||||||
|
{
|
||||||
|
curl --progress-bar -SLo "$1" "$2";
|
||||||
|
}
|
||||||
|
|
||||||
|
fbtenv_wget()
|
||||||
|
{
|
||||||
|
wget --show-progress --progress=bar:force -qO "$1" "$2";
|
||||||
|
}
|
||||||
|
|
||||||
fbtenv_check_sourced()
|
fbtenv_check_sourced()
|
||||||
{
|
{
|
||||||
case "${ZSH_EVAL_CONTEXT:-""}" in *:file:*)
|
case "${ZSH_EVAL_CONTEXT:-""}" in *:file:*)
|
||||||
return 0;;
|
return 0;;
|
||||||
esac
|
esac
|
||||||
|
if [ ${0##*/} = "fbtenv.sh" ]; then # exluding script itself
|
||||||
|
fbtenv_show_usage;
|
||||||
|
return 1;
|
||||||
|
fi
|
||||||
case ${0##*/} in dash|-dash|bash|-bash|ksh|-ksh|sh|-sh|*.sh|fbt)
|
case ${0##*/} in dash|-dash|bash|-bash|ksh|-ksh|sh|-sh|*.sh|fbt)
|
||||||
return 0;;
|
return 0;;
|
||||||
esac
|
esac
|
||||||
echo "Running this script manually is wrong, please source it";
|
fbtenv_show_usage;
|
||||||
echo "Example:";
|
|
||||||
printf "\tsource scripts/toolchain/fbtenv.sh\n";
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fbtenv_chck_many_source()
|
||||||
|
{
|
||||||
|
if ! echo "${PS1:-""}" | grep -q "[fbt]"; then
|
||||||
|
if ! echo "${PROMPT:-""}" | grep -q "[fbt]"; then
|
||||||
|
return 0;
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "Warning! It script seen to be sourced more then once!";
|
||||||
|
echo "It may signalise what you are making some mistakes, please open a new shell!";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
fbtenv_set_shell_prompt()
|
||||||
|
{
|
||||||
|
if [ -n "${PS1:-""}" ]; then
|
||||||
|
PS1="[fbt]$PS1";
|
||||||
|
elif [ -n "${PROMPT:-""}" ]; then
|
||||||
|
PROMPT="[fbt]$PROMPT";
|
||||||
|
fi
|
||||||
|
return 0; # all other shells
|
||||||
|
}
|
||||||
|
|
||||||
fbtenv_check_script_path()
|
fbtenv_check_script_path()
|
||||||
{
|
{
|
||||||
if [ ! -x "$SCRIPT_PATH/fbt" ]; then
|
if [ ! -x "$SCRIPT_PATH/fbt" ]; then
|
||||||
|
@ -107,7 +148,7 @@ fbtenv_download_toolchain_tar()
|
||||||
{
|
{
|
||||||
echo "Downloading toolchain:";
|
echo "Downloading toolchain:";
|
||||||
mkdir -p "$FBT_TOOLCHAIN_PATH/toolchain" || return 1;
|
mkdir -p "$FBT_TOOLCHAIN_PATH/toolchain" || return 1;
|
||||||
"$DOWNLOADER" $DOWNLOADER_ARGS "$FBT_TOOLCHAIN_PATH/toolchain/$TOOLCHAIN_TAR" "$TOOLCHAIN_URL" || return 1;
|
"$FBT_DOWNLOADER" "$FBT_TOOLCHAIN_PATH/toolchain/$TOOLCHAIN_TAR" "$TOOLCHAIN_URL" || return 1;
|
||||||
echo "done";
|
echo "done";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -166,13 +207,11 @@ fbtenv_curl_wget_check()
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
fi
|
||||||
echo "yes"
|
echo "yes"
|
||||||
DOWNLOADER="wget";
|
FBT_DOWNLOADER="fbtenv_wget";
|
||||||
DOWNLOADER_ARGS="--show-progress --progress=bar:force -qO";
|
|
||||||
return 0;
|
return 0;
|
||||||
fi
|
fi
|
||||||
echo "yes"
|
echo "yes"
|
||||||
DOWNLOADER="curl";
|
FBT_DOWNLOADER="fbtenv_curl";
|
||||||
DOWNLOADER_ARGS="--progress-bar -SLo";
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,10 +245,11 @@ fbtenv_download_toolchain()
|
||||||
fbtenv_main()
|
fbtenv_main()
|
||||||
{
|
{
|
||||||
fbtenv_check_sourced || return 1;
|
fbtenv_check_sourced || return 1;
|
||||||
|
fbtenv_chck_many_source; # many source it's just a warning
|
||||||
|
fbtenv_set_shell_prompt;
|
||||||
fbtenv_check_script_path || return 1;
|
fbtenv_check_script_path || return 1;
|
||||||
fbtenv_get_kernel_type || return 1;
|
fbtenv_get_kernel_type || return 1;
|
||||||
fbtenv_check_download_toolchain || return 1;
|
fbtenv_check_download_toolchain || return 1;
|
||||||
PS1="[FBT]${PS1-}";
|
|
||||||
PATH="$TOOLCHAIN_ARCH_DIR/python/bin:$PATH";
|
PATH="$TOOLCHAIN_ARCH_DIR/python/bin:$PATH";
|
||||||
PATH="$TOOLCHAIN_ARCH_DIR/bin:$PATH";
|
PATH="$TOOLCHAIN_ARCH_DIR/bin:$PATH";
|
||||||
PATH="$TOOLCHAIN_ARCH_DIR/protobuf/bin:$PATH";
|
PATH="$TOOLCHAIN_ARCH_DIR/protobuf/bin:$PATH";
|
||||||
|
|
Loading…
Reference in a new issue