Commit 031155fe authored by Henrik Nordström's avatar Henrik Nordström
Browse files

Merge pull request #13 from projectgus/master

Fix fel-gpio & pio tools
parents 033706af 9e79a0d9
......@@ -3,6 +3,7 @@
pio_to_sram=0x2000
sram_to_pio=0x2004
set -e
if [ -f fel-pio.bin ]; then
./fel write 0x2000 fel-pio.bin
else
......@@ -13,6 +14,8 @@ fi
./fel read 0x3000 0x228 pio.reg
./pio -i pio.reg print > pio.old
cat pio.old | fgrep -v '<0><0><0><0>'
set +e
while read cmd; do
./pio -i pio.reg -o pio.reg $cmd
./fel write 0x3000 pio.reg
......
......@@ -392,7 +392,7 @@ int main(int argc, char **argv)
}
}
if (in) {
if (fread(buf, sizeof(buf), 1, in) != 1) {
if (fread(buf, PIO_REG_SIZE, 1, in) != 1) {
perror("read input");
exit(1);
}
......@@ -414,7 +414,7 @@ int main(int argc, char **argv)
exit(1);
}
}
if (fwrite(buf, sizeof(buf), 1, out) != 1) {
if (fwrite(buf, PIO_REG_SIZE, 1, out) != 1) {
perror("write output");
exit(1);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment