Use analogPinToChannel if it's defined
Removed call to analogPinToChannel for Leonardo
Check if ATmega32u4 is defined

Needed in order to work with Arduino Leonardo
Removed double instance of the same code
Merge branch 'issue1366' of github.com:Lauszus/Arduino into Lauszus-issue1366