-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sven Oliver Moll
committed
Mar 5, 2021
1 parent
182d570
commit 3b9f1f5
Showing
2 changed files
with
42 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
|
||
DEVICE="/dev/ttyUSB0" | ||
HEXFILE="" | ||
|
||
for i; do | ||
case "${i}" in | ||
/dev/*) DEVICE="${i}" ;; | ||
*) HEXFILE="${i}" ;; | ||
esac | ||
done | ||
|
||
if [ -z "${HEXFILE}" -o ! -f "${HEXFILE}" ]; then | ||
cat <<EOF | ||
usage: $0 (<device>) <hexfile> | ||
Will try to use avrdude to flash the specified hexfile into the Arduino. | ||
The following configuration is assumed: | ||
- ATmega328p @ 3.3V | ||
- Arduino bootloader @ 57600 Baud | ||
- Serial interface @ ${DEVICE} (can be changed by parameter) | ||
(This script is called "myflash.sh" because it might not work for you!) | ||
EOF | ||
exit 1 | ||
fi | ||
|
||
exec avrdude -v -patmega328p -carduino -P"${DEVICE}" -b57600 -D -Uflash:w:"${HEXFILE}":i |