Browse Source

Merge pull request #1763 from mkbel/save_flash_timer2

Do not compile timer02.c if not used. Saves 148B flash.
XPila 5 years ago
parent
commit
238079fc95
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Firmware/timer02.c

+ 5 - 0
Firmware/timer02.c

@@ -2,6 +2,9 @@
 // use atmega timer2 as main system timer instead of timer0
 // timer0 is used for fast pwm (OC0B output)
 // original OVF handler is disabled
+
+#ifdef SYSTEM_TIMER_2
+
 #include <avr/io.h>
 #include <avr/interrupt.h>
 #include "Arduino.h"
@@ -166,3 +169,5 @@ void noTone2(__attribute__((unused)) uint8_t _pin)
 {
 	PIN_CLR(BEEPER);
 }
+
+#endif //SYSTEM_TIMER_2