SpenceKonde / ATTinyCore

Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8
Other
1.59k stars 308 forks source link

Servo library doesn't compile on ATtiny85 #222

Closed fudge01010 closed 6 years ago

fudge01010 commented 6 years ago

Servo example doesn't compile for ATtiny85.

Build options:

attached is compilation output:



C:\Users\Fudge\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.1.5\libraries\Servo\src\avr\Servo.cpp:82:44: error: cannot convert 'volatile uint8_t* {aka volatile unsigned char*}' to 'volatile uint16_t* {aka volatile unsigned int*}' for argument '2' to 'void handle_interrupts(timer16_Sequence_t, volatile uint16_t*, volatile uint16_t*)'

   handle_interrupts(_timer1, &TCNT1, &OCR1A);

                                            ^

C:\Users\Fudge\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.1.5\libraries\Servo\src\avr\Servo.cpp: In function 'void initISR(timer16_Sequence_t)':

C:\Users\Fudge\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.1.5\libraries\Servo\src\avr\Servo.cpp:128:5: error: 'TCCR1A' was not declared in this scope

     TCCR1A = 0;             // normal counting mode

     ^

C:\Users\Fudge\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.1.5\libraries\Servo\src\avr\Servo.cpp:129:5: error: 'TCCR1B' was not declared in this scope

     TCCR1B = _BV(CS11);     // set prescaler of 8

     ^

C:\Users\Fudge\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.1.5\libraries\Servo\src\avr\Servo.cpp:136:5: error: 'TIFR1' was not declared in this scope

     TIFR1 |= _BV(OCF1A);     // clear any pending interrupts;

     ^

C:\Users\Fudge\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.1.5\libraries\Servo\src\avr\Servo.cpp:137:5: error: 'TIMSK1' was not declared in this scope

     TIMSK1 |=  _BV(OCIE1A) ; // enable the output compare interrupt

     ^

Multiple libraries were found for "Servo.h"
 Used: C:\Users\Fudge\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.1.5\libraries\Servo
 Not used: C:\Program Files (x86)\Arduino\libraries\Servo
exit status 1
Error compiling for board ATtiny25/45/85.```
SpenceKonde commented 6 years ago

Like the normal Servo library supplied with the official core, this servo library does not support the tiny85/45/25 or tiny861/461/261. There is an open issue (#85 ) to add support for this.

Closing because duplicate of #85.