Skip to content

Instantly share code, notes, and snippets.

@isamert
Last active December 22, 2017 22:21
Show Gist options
  • Save isamert/8171df49798de07c3176adb16c1bd49a to your computer and use it in GitHub Desktop.
Save isamert/8171df49798de07c3176adb16c1bd49a to your computer and use it in GitHub Desktop.
A Fish function for compiling and flashing programs for ATMega32 via usbasp programmer
function avrflash
mkdir -p build
cd build
avr-gcc ../$argv -Os -Wall -mmcu=atmega32 -o main_bin
avr-objcopy -j .text -j .data -O ihex main_bin "main.hex"
avrdude -c usbasp -p m32 -U flash:w:"main.hex"
cd ..
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment