error when compiling source code attiny

Hello all,
long time since ive been on here.
So what im hoping to be a quick q&a.
I am attempting to build this class d amplifier for a portable bluetooth speaker that I am making.
I already made the speaker but it is basic with low power amp and speakers. what i want to do is use this amplifier outlined here that uses an attiny 45 or 85.
http://rdimitrov.twistedsanity.net/blog/show.php?entry=Microcontroller%20Class%20D%20Amplifier,%20Rev2
Here is the source code that he made
http://rdimitrov.twistedsanity.net/blog/files/damp2-src.zip
I took the source code and copied and pasted it directly into a new project and i get this error when compiling

#include <avr/interrupt.h>
#include <avr/sleep.h>
#include <stdint.h>

typedef uint32_t	u32;
typedef uint16_t	u16;
typedef uint8_t		u8;
typedef int32_t		s32;
typedef int16_t		s16;
typedef int8_t		s8;

#define DACP OCR1A
#define DACN OCR1B

__attribute__((naked)) int main(void)
{
	// Configure ports
	DDRB  = 0b00010010; // OC0AB are L/R PWM output. Drive unused pins low (helps noise).
	PORTB = 0b11100100; // No activate pull-ups

	// ADC
	ADMUX  = 0b11010011; // PB3, AVcc, 10 bit, 2.56VRef
	ADCSRA = 0b11000100; // CPU/16 sampling rate; Sampling freq: 16 MHz / 16 / 13 = 78 kHz
	//             ^ - interrupt enable
	// Power reduction
	PRR   = 0b00000110; // Clock-gate USI and Counter0.
	MCUCR = 0b00100000;


	// PWM
	//OCR1C = 255;
	TCCR1 = 0b01100010; // non-inv PWM, 32MHz / 512 = 62 kHz
	GTCCR = 0b01100000;
	TIMSK = 0b100;
	PLLCSR = 0b110;

	sei();

	while(1) {
		sleep_cpu();
	}
}


// 50% duty cycle at idle. Slightly less efficient, but better sounding.
u8 time;
u16 pos;
u16 neg;

ISR(TIMER1_OVF_vect) {

	if(1 & ++time) {
		u16 adc		= ADC;
		s16 val1	= (adc >> 1) - 256;
		u8 val2		= (u8)(adc & 1);

		pos = 256 + val1 + val2;
		neg = 256 - val1;

		if(val1 >= 254)
			pos = 510;

		if(val1 <= -255)
			neg = 510;

		if(pos > 255) {
			DACP = 255;
			pos -= 255;
		} else {
			DACP = pos;
			pos = 0;
		}

		if(neg > 255) {
			DACN = 255;
			neg -= 255;
		} else {
			DACN = neg;
			neg = 0;
		}

	} else {
		DACP = pos;
		DACN = neg;
	}
}

the error message said “TCCR1 not declared in this scope”
“TIMSK not declared in this scope”
“PLLSCR not declared in this scope”

I havent tried to upload only compile.
He used an avr isp programmer but I am trying to use the arduino uno as the isp. I dont know if that is the issue or not.
Thanks!

__attribute__((naked)) [color=#CC6600]int[/color] main([color=#CC6600]void[/color])

It's hard to believe that your code really looks like that. DO NOT USE COPY FOR FORUM!

sorry Paul, I fixed it

Which AtTiny do you have?

The timers on the ATtiny85 are not quite the same as the timers on the ATmega chips, so porting code that uses those timers directly is not as easy as it might be.

"TCCR1 not declared in this scope"

Timer1 on ATmega328 has two control registers TCCR1A and TCCR1B. Apparently tiny85 only has one control register for timer1.

"TIMSK not declared in this scope"

Similarly, ATmega has separate interrupt control registers for each timer (TIMSK0, TIMSK1, TIMSK2)

"PLLSCR not declared in this scope"

But ATmega does NOT have a PLL that can be used to run the timers in "extra high speed mode", so this register does not exist at all.

Have you installed a 'core' that supports the Tiny45 and Tiny 85? If not TinyCore1 should work for you. Just Google for it. Your code compiles without error on my machine with TinyCore1 installed.