hexagon5un / AVR-Programming

Code examples for the book "Make: AVR Programming"
http://littlehacks.org/AVR-Programming
MIT License
725 stars 340 forks source link

When changing Makefile new hex is not generated #44

Open CableGuy67 opened 4 years ago

CableGuy67 commented 4 years ago

I was working though the book using the 168 as is used in the book. I got a couple atmega8 chips for something else and figured I'd test them by swapping them into my testbed. I changed the Makefile to reflect the new chip and flashed the new chip. Everything reported as okay but I wasn't getting any activity on the leds. Since the rule for making the hex isn't dependent on changes to the Makefile like the c (etc) files are, the chip was flashed with the hexfile for the atmega168, not the m8 that I needed. Adding the Makefile as a prerequisite to the elf file would most likely fix this issue. Once I modified the .c file everything was rebuilt and the flash after that worked as expected. Great book. Thanks for that.