Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NOT FOR MERGE] scripts/flash.sh: update GPIO numbers to RTE OS v0.8.0 #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions scripts/flash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ WP_RANGE="0,0x00800000"
spiON() {
echo "set SPI Vcc to 3.3V"
# 0 - 1.8V , 1 - 3.3V
echo 1 > /sys/class/gpio/gpio405/value
echo 1 > /sys/class/gpio/gpio517/value
sleep 1
echo "SPI lines ON"
echo 1 > /sys/class/gpio/gpio404/value
echo 1 > /sys/class/gpio/gpio516/value
sleep 1
echo "SPI Vcc ON"
echo 1 > /sys/class/gpio/gpio406/value
echo 1 > /sys/class/gpio/gpio518/value
sleep 2
}

spiOFF() {
echo "SPI Vcc OFF"
echo 0 > /sys/class/gpio/gpio406/value
echo 0 > /sys/class/gpio/gpio518/value
echo "SPI lines OFF"
echo 0 > /sys/class/gpio/gpio404/value
echo 0 > /sys/class/gpio/gpio405/value
echo 0 > /sys/class/gpio/gpio516/value
echo 0 > /sys/class/gpio/gpio517/value
}

CMD="$1"
Expand Down Expand Up @@ -130,15 +130,15 @@ case "$CMD" in
;;
"wp-high")
echo "Setting WP pin HIGH ..."
echo "out" > /sys/class/gpio/gpio402/direction
echo "out" > /sys/class/gpio/gpio514/direction
# deassert WP pin to disable hardware protection of status registers
echo "1" > /sys/class/gpio/gpio402/value
echo "1" > /sys/class/gpio/gpio514/value
;;
"wp-low")
echo "Setting WP pin LOW ..."
echo "out" > /sys/class/gpio/gpio402/direction
echo "out" > /sys/class/gpio/gpio514/direction
# assert WP pin to enable hardware protection of status registers
echo "0" > /sys/class/gpio/gpio402/value
echo "0" > /sys/class/gpio/gpio514/value
;;
*)
echo "Command \"$CMD\" is not supported"
Expand Down