Author Topic: DigisparkRGB : not compiling for Digispark Pro  (Read 5515 times)

hussonl

  • Newbie
  • *
  • Posts: 3
DigisparkRGB : not compiling for Digispark Pro
« on: April 20, 2015, 01:51:29 pm »
Hello DigiSpark community,

I currently found some time to begin to play with my DigiSpark and Digispark Pro received some months ago ;-)
After searching on this forum I haven't found any similar problem.

So here it is :

I've tried the DigisparkRGB example on a Digispark, and it's OK.
But when trying to compile for a DigiSpark Pro (after changing the board type to "Digispark Pro" ;-) ), I got the following error :

Code: [Select]
C:\Program Files (x86)\Digistump_Arduino\hardware\digistump\avr\libraries\DigisparkRGB\DigisparkRGB.cpp: In function 'void DigisparkRGBBegin()':
C:\Program Files (x86)\Digistump_Arduino\hardware\digistump\avr\libraries\DigisparkRGB\DigisparkRGB.cpp:41:3: error: 'TIFR' was not declared in this scope
   TIFR = (1 << TOV0);           // clear interrupt flag
   ^
C:\Program Files (x86)\Digistump_Arduino\hardware\digistump\avr\libraries\DigisparkRGB\DigisparkRGB.cpp:42:3: error: 'TIMSK' was not declared in this scope
   TIMSK = (1 << TOIE0);         // enable overflow interrupt
   ^
Error while compiling.

I can precise that the most simple example "Blink" can be compile for both cards.
And it's OK to for the quick example on the Wiki page : http://digistump.com/wiki/digispark/tutorials/rgb

What could be the problem ?

hussonl

  • Newbie
  • *
  • Posts: 3
Re: DigisparkRGB : not compiling for Digispark Pro
« Reply #1 on: April 20, 2015, 02:43:24 pm »
Thanks for this explaination.

Should you suggest to modify the library (DigisparkRGB.cpp) or not ?
If yes, by adding #ifdef/#endif like this (for ATTiny 85) :
Code: [Select]
#ifdef TIFR
  TIFR = (1 << TOV0);           // clear interrupt flag
#endif

Or also by adding this (for ATTiny 87) after the previous code :
Code: [Select]
#ifdef TIFR0
  TIFR0 = (1 << TOV0);           // clear interrupt flag
#endif

Or do I have to avoid using the included library (with the IDE) and build my own one ?
« Last Edit: April 20, 2015, 02:45:00 pm by hussonl »

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: DigisparkRGB : not compiling for Digispark Pro
« Reply #2 on: June 23, 2015, 01:55:59 pm »
This has been updated to work with the Pro in the upcoming release