From 1d5acb260184e476dd4c147c3a1faf70632aeb29 Mon Sep 17 00:00:00 2001 From: Peter Gerwinski <peter.gerwinski@hs-bochum.de> Date: Tue, 30 May 2023 12:16:01 +0200 Subject: [PATCH] =?UTF-8?q?Makefile=20und=20Download-Skript=20f=C3=BCr=20A?= =?UTF-8?q?rduino-Programmierung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 20230530/Makefile | 8 ++++++++ 20230530/download.sh | 3 +++ 2 files changed, 11 insertions(+) create mode 100644 20230530/Makefile create mode 100755 20230530/download.sh diff --git a/20230530/Makefile b/20230530/Makefile new file mode 100644 index 0000000..7ae33df --- /dev/null +++ b/20230530/Makefile @@ -0,0 +1,8 @@ +%.elf: %.c + avr-gcc -Wall -Os -mmcu=atmega328p $< -o $@ + +%.hex: %.elf + avr-objcopy -O ihex $< $@ + +download: + ./download.sh diff --git a/20230530/download.sh b/20230530/download.sh new file mode 100755 index 0000000..770c3b5 --- /dev/null +++ b/20230530/download.sh @@ -0,0 +1,3 @@ +port=$(ls -rt /dev/ttyACM* | tail -1) +echo avrdude -P $port -c arduino -p m328p -U flash:w:$(ls -rt *.hex | tail -1) +avrdude -P $port -c arduino -p m328p -U flash:w:$(ls -rt *.hex | tail -1) 2>/dev/null -- GitLab