diff options
Diffstat (limited to 'example')
-rwxr-xr-x | example/ice4pi_prog | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/example/ice4pi_prog b/example/ice4pi_prog index 9e90f7c..37391f3 100755 --- a/example/ice4pi_prog +++ b/example/ice4pi_prog @@ -1,16 +1,24 @@ #!/bin/bash +dtparam spi=on gpioset `gpiofind GPIO24`=1 -sleep 1 +sleep 0.1 gpioset `gpiofind GPIO24`=0 tr '\0' '\377' < /dev/zero | dd bs=1M count=4 of=image iflag=fullblock dd if=${1} conv=notrunc of=image flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=20000 -w image #workaround first time fails after initial programming -flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=20000 -w image +#flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=20000 -w image +dtparam spi=off gpioset `gpiofind GPIO24`=1 -sleep 1 -gpioget `gpiofind GPIO24` -gpioget `gpiofind GPIO25` +#gpioget `gpiofind GPIO24` + +val="0" +while [ "$val" == "0" ] ; do + val=`gpioget \`gpiofind GPIO25\`` + echo $val + sleep 0.1 +done +dtparam spi=on |