ok so it appears it got broken when the PWM file was entirely rewritten . . .
Until I fix it, just add this code at the top of control.c, right after the variables are called, and it should work. It compiled fine for me, but I didn't test to see if it worked.
#ifndef PWM10
// mega128 PWM bits
#define PWM10 WGM10
#define PWM11 WGM11
#endif
//OC1B pin B6 (attached to green LED)
void PWM_Init_timer1_LED(u08 bitRes)
{
// enable timer2 as 8,9,10bit PWM
if(bitRes == 9)
{ // 9bit mode
sbi(TCCR1A,PWM11);
cbi(TCCR1A,PWM10);
}
else if( bitRes == 10 )
{ // 10bit mode
sbi(TCCR1A,PWM11);
sbi(TCCR1A,PWM10);
}
else
{ // default 8bit mode
cbi(TCCR1A,PWM11);
sbi(TCCR1A,PWM10);
}
// clear output compare values
OCR1B = 0;
}
//on commands
void PWM_timer1_On_LED(void)
{
sbi(TCCR1A,COM1B1);
cbi(TCCR1A,COM1B0);
}
//off commands
void PWM_timer1_Off_LED(void)
{
cbi(TCCR1A,COM1B1);
cbi(TCCR1A,COM1B0);
}
void PWM_timer1_Set_LED(u16 pwmDuty)
{OCR1B = pwmDuty;}