Skip to content

Instantly share code, notes, and snippets.

@ericek111
Created October 4, 2022 11:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericek111/09031373b354895b884cf84218d90f30 to your computer and use it in GitHub Desktop.
Save ericek111/09031373b354895b884cf84218d90f30 to your computer and use it in GitHub Desktop.
Script for Galaxy S10e to overclock the flashlight LED
mytmpfolder="/dev/myowntmp" # it seems there is no /tmp, so let's make our own -- /dev is on a tmpfs, it is purged on reboot
mkdir -p "$mytmpfolder"
flashfile="/sys/class/camera/flash/rear_flash"
curval="$(cat "$mytmpfolder/turboflashval")"
curval="${curval:-0}"
HIGH_VAL=200
LOW_VAL=2003
function setFlash {
echo "$1" > "$flashfile"
echo "$1" > "$mytmpfolder/turboflashval"
echo "Setting $1"
}
if [ "$1" = "t" ]; then
if ( [ "$curval" -eq $LOW_VAL ] || [ "$curval" -eq 0 ] ); then
setFlash $HIGH_VAL
elif [ "$curval" -eq $HIGH_VAL ]; then
setFlash 0
fi
else
if [ "$curval" -ne 0 ]; then
setFlash 0
else
setFlash $LOW_VAL
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment