[an error occurred while processing this directive]
|
Не помню точно, в чем была проблема, но в конце концов переписал процедуры так, что щелчки пропали (прога для ATmega128).
#pragma vector = TIMER1_OVF_vect
__interrupt void OutVoiceSample(void)
{
Timer1OverCount++;
if (Timer1OverCount == 2)
{
Timer1OverCount = 0;
ACSR |= T1_OVF;
}
}//OutVoiceSample
void DF_MainMemoryToSpeaker(unsigned int Page)
{
unsigned long IntroAddress;
unsigned char dummy = 0;
unsigned int StartAddress = 0;
clrbit(PORTG, nFCS);
DF_WriteSPI(DF_MM_RD);
DF_WriteSPI((char)(Page >> 7));
DF_WriteSPI((char)(Page << 1)|(StartAddress >> 8));
DF_WriteSPI((char)(StartAddress));
DF_WriteSPI(0x00);
DF_WriteSPI(0x00);
DF_WriteSPI(0x00);
DF_WriteSPI(0x00);
for(IntroAddress = 0; IntroAddress < MAX_BUFFER; IntroAddress++)
{
while(!(ACSR&T1_OVF));
DF_WriteSPI(0xFF);
dummy = SPDR;
OCR1B = dummy;
ACSR &= (~T1_OVF);
}
setbit(PORTG, nFCS);
}//DF_MainMemoryToSpeaker
void DF_PagesToSpeaker(unsigned int StartPage, unsigned int EndPage)
{
unsigned int CurrentPage;
SPCR = 0x5C;
TCCR1A = 0x21;
TCNT1 = 0x00;
TIFR = 0x04;
setbit(TIMSK, TOIE1);
TCCR1B = 0x01;
OCR1B = 0x00;
for (CurrentPage = StartPage; CurrentPage <= EndPage; CurrentPage++)
DF_MainMemoryToSpeaker(CurrentPage);
clrbit(TIMSK, TOIE1);
TCCR1B = 0x00;
SPCR = 0x00;
}
E-mail: info@telesys.ru