This is hopefully a very basic question. I have an application using an ATTINY414 and one part of it uses TWI to take a reading from a temperature sensor, I'm using a basic single register read.
Due to the relative scarcity of posts about the newer ATTINY models and my lack of programming ability I created an ATMEL Start project for the chip, added the TWI option and then just copied all this code across to my project.
It's working fine but I'm sure that I've copied over a lot of code that I'm not actually using.
My question (there is one coming, honest) is whether it's worth my while going through this code and working out what I need and what's bloat. Is the compiler smart enough to work out when blocks of code will never be called and leave them out or does it assume that I know what I'm doing and include it all in the output that's uploaded to the MCU?
I'm fine for memory, I don't NEED to free any up, it just offends my sense of neatness to have redundant code sitting there and made me wonder how compilers handle this?
I'm using ATMEL Studio 7 if that's relevant.