Wire library and yun produces 2 warnings "Timer 2 not finished ..."

Hi I have a sketch that gives wierd problems. Basically somethimes the processor doesn't even get to setup(). That means something is going wrong in the constructors or init. When investigating I found these warnings

Description Resource Path Location Type

warning Timer 2 not finished (may not be present on this CPU) wiring.c /batterijlader/arduino/core line 265 C/C++ Problem

warning Timer 2 not finished (may not be present on this CPU) wiring.c /batterijlader/arduino/core line 274 C/C++ Problem

Looking at the code that gives

void init()
{
.....
// set timer 2 prescale factor to 64
#if defined(TCCR2) && defined(CS22)
    sbi(TCCR2, CS22);
#elif defined(TCCR2B) && defined(CS22)
    sbi(TCCR2B, CS22);
#else
    #warning Timer 2 not finished (may not be present on this CPU)
#endif

    // configure timer 2 for phase correct pwm (8-bit)
#if defined(TCCR2) && defined(WGM20)
    sbi(TCCR2, WGM20);
#elif defined(TCCR2A) && defined(WGM20)
    sbi(TCCR2A, WGM20);
#else
    #warning Timer 2 not finished (may not be present on this CPU)
#endif
....
}

Which makes me very suspicious.

Input is welcomed. Best regards Jantje

Yun/ATmega32u4 Timer.

  • One 8-bit Timer/Counter with Separate Prescaler and Compare Mode (Timer 0)
  • Two 16-bit Timer/Counter with Separate Prescaler, Compare- and Capture Mode (Timer 1 and Timer 3)
  • One 10-bit High-Speed Timer/Counter with PLL (64 MHz) and Compare Mode, high speed (64MHz) timer (Timer 4)

http://www.atmel.com/images/7766s.pdf

Timer 2 ?

wierd isn't it? Looks like the code is not yet finished. But leonardo has been out for some time .... Best regards Jantje