Skip to content

Commit 8b4d7aa

Browse files
committed
Squashed 'avr/cores/MCUdude_corefiles/' changes from 3aa8d81..d6d417b
d6d417b Fix register setting for ATmega8 The ATmega8 doesn't have WGM00 and WGM01 git-subtree-dir: avr/cores/MCUdude_corefiles git-subtree-split: d6d417bc58dfe2f52f45b9b60129c95f7dc62145
1 parent a919edd commit 8b4d7aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

wiring.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,10 @@ void init()
262262
// this combination is for the ATmega8535, ATmega8, ATmega16, ATmega32, ATmega8515, ATmega162
263263
sbi(TCCR0, CS01);
264264
sbi(TCCR0, CS00);
265-
sbi(TCCR0, WGM00);
266-
sbi(TCCR0, WGM01);
265+
#if defined(WGM00) && defined(WGM01) // The ATmega8 doesn't have WGM00 and WGM01
266+
sbi(TCCR0, WGM00);
267+
sbi(TCCR0, WGM01);
268+
#endif
267269
#elif defined(TCCR0B) && defined(CS01) && defined(CS00)
268270
// this combination is for the standard 168/328/640/1280/1281/2560/2561
269271
sbi(TCCR0B, CS01);

0 commit comments

Comments
 (0)