High priority interrupt context saving?!

Post
MartinWie
New Member
2005/06/12 06:49:48
Hello...

So I use low and high priority interrupts. With the low ones everything is allright, but it seems the compiler doesn't get that the high priority interrupt even is an interrupt. In disassembly the routine ends with return and not with retfie...


#pragma code high_vector_section=0x8
void high_interrupt(void)
{
_asm GOTO Signal_High _endasm
}
#pragma code


#pragma code low_vector_section=0x18
void low_interrupt(void)
{
_asm GOTO Signal_Low _endasm
}
#pragma code



#pragma interrupthigh Signal_High save=PROD
void Signal_High(void)
{
if(PIR1bits.TMR1IF == 1) //Zeit-Zähler erhöhen
{
PIR1bits.TMR1IF = 0;

TMR1H = 0xFF;
TMR1L = 0x00;

ZeitFan1_Temp++;
}
}


#pragma interruptlow Signal_Low save=PROD
void Signal_Low(void)
{
if(INTCONbits.INT0IF == 1) //Fan1
{
INTCONbits.INT0IF = 0;

ZeitFan1 = ZeitFan1_Temp;
ZeitFan1_Temp = 0;

}

if(INTCONbits.TMR0IF == 1) //Display schreiben
{
double temp = 0;

INTCONbits.TMR0IF = 0;

temp = ZeitFan1;
temp = ((16384)/temp)*60;

Lcd_Control_Send(0xC0);
Int2Bcd32(temp);
Bcd32AnLcdSenden();
}
}


So whats wrong there?

Greez Martin
Kruse
Super Member
RE: High priority interrupt context saving?! 2005/06/12 14:13:16
Tchüss

As far as I know there isn't such pragma as "interrupthigh" there is a interruptlow since the pragma "interrupt" is the high priority.

Don't you get an error or at least a warning ??
MartinWie
New Member
RE: High priority interrupt context saving?! 2005/06/12 14:19:15
Thanks that was it. You have to use interrupt and interruptlow...
No there was no warning and no error... the compiler treated it just like a common function...

Greez Martin
Guest
Super Member
RE: High priority interrupt context saving?! 2005/06/13 08:38:55
Martin,

The following code:
#pragma interrupthigh foo
void foo (void)
{
}

provides the following warning:
web.c:1:Warning [2002] unknown pragma 'interrupthigh'


Do you not see the same?

Tracy A. Kuhrt