Skip to content

Commit 072b2c3

Browse files
committed
Conflicts: IRremoteInt.h
2 parents b25accf + a2af9e3 commit 072b2c3

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

IRremoteInt.h

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
#define IRremoteint_h
1818

1919
#if defined(ARDUINO) && ARDUINO >= 100
20-
#include "Arduino.h"
20+
#include <Arduino.h>
2121
#else
22-
#include "WProgram.h"
22+
#include <WProgram.h>
2323
#endif
2424

2525
// define which timer to use
@@ -57,6 +57,10 @@
5757
//#define IR_USE_TIMER1 // tx = pin 13
5858
#define IR_USE_TIMER2 // tx = pin 14
5959

60+
// Atmega8
61+
#elif defined(__AVR_ATmega8P__) || defined(__AVR_ATmega8__)
62+
#define IR_USE_TIMER1 // tx = pin 9
63+
6064
// Arduino Duemilanove, Diecimila, LilyPad, Mini, Fio, etc
6165
#else
6266
//#define IR_USE_TIMER1 // tx = pin 9
@@ -237,8 +241,13 @@ extern volatile irparams_t irparams;
237241
#define TIMER_RESET
238242
#define TIMER_ENABLE_PWM (TCCR1A |= _BV(COM1A1))
239243
#define TIMER_DISABLE_PWM (TCCR1A &= ~(_BV(COM1A1)))
240-
#define TIMER_ENABLE_INTR (TIMSK1 = _BV(OCIE1A))
241-
#define TIMER_DISABLE_INTR (TIMSK1 = 0)
244+
#if defined(__AVR_ATmega8P__) || defined(__AVR_ATmega8__)
245+
#define TIMER_ENABLE_INTR (TIMSK = _BV(OCIE1A))
246+
#define TIMER_DISABLE_INTR (TIMSK = 0)
247+
#else
248+
#define TIMER_ENABLE_INTR (TIMSK1 = _BV(OCIE1A))
249+
#define TIMER_DISABLE_INTR (TIMSK1 = 0)
250+
#endif
242251
#define TIMER_INTR_NAME TIMER1_COMPA_vect
243252
#define TIMER_CONFIG_KHZ(val) ({ \
244253
const uint16_t pwmval = SYSCLOCK / 2000 / (val); \

0 commit comments

Comments
 (0)