sasitejak / arduino-timerone

Automatically exported from code.google.com/p/arduino-timerone
0 stars 0 forks source link

In member function 'void TimerOne::start()': TimerOne.cpp:143: error: 'PSRSYNC' was not declared in this scope #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Unpack\install arduino-1.0.1-windows.zip
2. copy Timer1 library to \arduino-1.0.1\libraries
3. Start Arduino IDE, load  ISRBlink example sketch and verify compile 
(CTRL+R). Succeeds as expected.
4. Attempt to run same sketch with AtTiny84:
a) Arduino.cc, click Playground, click "Arduino on other Atmel Chips" on the 
left pane, click link to "Attiny 44/45/84/85" (navigates to 
http://hlt.media.mit.edu/?p=1695), download "ATtiny.zip"
b) unzip ATtiny.zip, and place "attiny" folder into arduino-1.0.1\hardware
c) Start Arduino IDE, select Tools, Board, ATtiny84 (either 1 or 8mhz)
d) Load the ISRBlink sketch and attempt to compile (CTRL+R)

What is the expected output? What do you see instead?
Expect: Like the Arduino Uno board, to compile.
Result:
C:\arduino-1.0.1\libraries\TimerOne\TimerOne.cpp: In member function 'void 
TimerOne::start()':
C:\arduino-1.0.1\libraries\TimerOne\TimerOne.cpp:143: error: 'PSRSYNC' was not 
declared in this scope

What version of the product are you using? On what operating system?
Arduino 1.0.1  (IDE)
damellis-attiny-6bff522.zip (Support for other AVR chips in the Arduino IDE, 
i.e. ATTiny84)
TimerOne-v9.zip (The version of TimerOne for this bug report)

Please provide any additional information below.
I do not know if this is an Arduino IDE issue, or an issue with the hardware 
definitions in damellis-attiny-6bff522.zip or an issue with TimerOne library.

Original issue reported on code.google.com by andrew.r...@gmail.com on 26 Aug 2012 at 5:39

GoogleCodeExporter commented 8 years ago
I had the same issue trying to get the pulse generator example from section 
18.5 in the Arduino cookbook to compile on an older ATMega8 with the Arduino 
bootloader.

The fix was to add the mapping for the ATMega8 pins in TimerOne.cpp:

#include "TimerOne.h"  <--- original code

// enable support for ATMEGA8
#if defined(__AVR_ATmega8__)
#define TIMSK1 TIMSK
#define GTCCR SFIOR
#define PSRSYNC PSR10
#endif

TimerOne Timer1;              // preinstatiate  <--- original code

After that, the pulse generator compiled and appeared to function correctly.

Original comment by fixbox2...@gmail.com on 8 Dec 2012 at 4:48