#if !defined(IOCOMPAT_H)
#define IOCOMPAT_H 1
#if defined(__AVR_AT90S2313__)
# define OC1 PB3
# define OCR OCR1
# define DDROC DDRB
# define TIMER1_OVF_vect TIMER1_OVF1_vect
#elif defined(__AVR_AT90S2333__) || defined(__AVR_AT90S4433__)
# define OC1 PB1
# define DDROC DDRB
# define OCR OCR1
#elif defined(__AVR_AT90S4414__) || defined(__AVR_AT90S8515__) || \
defined(__AVR_AT90S4434__) || defined(__AVR_AT90S8535__) || \
defined(__AVR_ATmega163__) || defined(__AVR_ATmega8515__) || \
defined(__AVR_ATmega8535__) || \
defined(__AVR_ATmega164P__) || defined(__AVR_ATmega324P__) || \
defined(__AVR_ATmega644__) || defined(__AVR_ATmega644P__) || \
defined(__AVR_ATmega1284P__)
# define OC1 PD5
# define DDROC DDRD
# define OCR OCR1A
# if !defined(TIMSK)
# define TIMSK TIMSK1
# endif
#elif defined(__AVR_ATmega8__) || defined(__AVR_ATmega48__) || \
defined(__AVR_ATmega88__) || defined(__AVR_ATmega168__)
# define OC1 PB1
# define DDROC DDRB
# define OCR OCR1A
# if !defined(TIMSK)
# define TIMSK TIMSK1
# endif
#elif defined(__AVR_ATtiny2313__)
# define OC1 PB3
# define OCR OCR1A
# define DDROC DDRB
#elif defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || \
defined(__AVR_ATtiny84__)
# define OC1 PA6
# define DDROC DDRA
# if !defined(OCR1A)
#
# define OCR OCRA1
# else
# define OCR OCR1A
# endif
# define TIMSK TIMSK1
# define TIMER1_OVF_vect TIM1_OVF_vect
#elif defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || \
defined(__AVR_ATtiny85__)
# define OC1 PB1
# define DDROC DDRB
# define OCR OCR1A
# define TCCR1A TCCR1
# define TCCR1B TCCR1
# define TIMER1_OVF_vect TIM1_OVF_vect
# define TIMER1_TOP 255
# define TIMER1_PWM_INIT _BV(PWM1A) | _BV(COM1A1)
# define TIMER1_CLOCKSOURCE _BV(CS12)
#elif defined(__AVR_ATtiny26__)
# define OC1 PB1
# define DDROC DDRB
# define OCR OCR1A
# define TIMER1_OVF_vect TIMER1_OVF1_vect
# define TIMER1_TOP 255
# define TIMER1_PWM_INIT _BV(PWM1A) | _BV(COM1A1)
# define TIMER1_CLOCKSOURCE _BV(CS12)
# define TIMER1_SETUP_HOOK() OCR1C = 255
#elif defined(__AVR_ATtiny261__) || defined(__AVR_ATtiny461__) || \
defined(__AVR_ATtiny861__)
# define OC1 PB1
# define DDROC DDRB
# define OCR OCR1A
# define TIMER1_PWM_INIT _BV(WGM10) | _BV(PWM1A) | _BV(COM1A1)
# define TIMER1_TOP 255
# define TIMER1_CLOCKSOURCE _BV(CS12)
#elif defined(__AVR_ATmega32__) || defined(__AVR_ATmega16__)
# define OC1 PD5
# define DDROC DDRD
# define OCR OCR1A
#elif defined(__AVR_ATmega64__) || defined(__AVR_ATmega128__) || \
defined(__AVR_ATmega165__) || defined(__AVR_ATmega169__) || \
defined(__AVR_ATmega325__) || defined(__AVR_ATmega3250__) || \
defined(__AVR_ATmega645__) || defined(__AVR_ATmega6450__) || \
defined(__AVR_ATmega329__) || defined(__AVR_ATmega3290__) || \
defined(__AVR_ATmega649__) || defined(__AVR_ATmega6490__) || \
defined(__AVR_ATmega640__) || \
defined(__AVR_ATmega1280__) || defined(__AVR_ATmega1281__) || \
defined(__AVR_ATmega2560__) || defined(__AVR_ATmega2561__) || \
defined(__AVR_ATmega32U4__)
# define OC1 PB5
# define DDROC DDRB
# define OCR OCR1A
# if !defined(PB5)
# define PB5 5
# endif
# if !defined(TIMSK)
# define TIMSK TIMSK1
# endif
#else
# error "Don't know what kind of MCU you are compiling for"
#endif
#if !defined(COM1A1)
# define COM1A1 COM11
#endif
#if !defined(WGM10)
# define WGM10 PWM10
# define WGM11 PWM11
#endif
#if !defined(TIMER1_TOP)
# define TIMER1_TOP 1023
#endif
#if !defined(TIMER1_PWM_INIT)
# define TIMER1_PWM_INIT _BV(WGM10) | _BV(WGM11) | _BV(COM1A1)
#endif
#if !defined(TIMER1_CLOCKSOURCE)
# define TIMER1_CLOCKSOURCE _BV(CS10)
#endif
#endif