
151
C-Control Pro Mega Series
© 2008 Conrad Electronic
irqnr
specifies the interrupt type (see
Return Parameter
The return value expresses how often a interrupt got triggered until the function Irq_GetCount() has been
called. A value greater 1 shows that the interrupts
are triggered more rapidly than the interrupt service routine is processed.
6.9.4
Irq_SetVect
Interrupt Functions
Syntax
void Irq_SetVect(byte irqnr,float vect);
Sub Irq_SetVect(irqnr As Byte,vect As Single)
Description
Defines an interrupt service routine for a specified interrupt. At the end of the interrupt service routine the
function
() has to be called, otherwise the interrupt service routine gets called continuously.
Parameter
irqnr
specifies the interrupt type (see
vect is the name of the interrupt function to be called
Remark
The floating point data type seems not suitable for an interrupt vector, but a 4 byte data type is
needed to specify a function in the Mega128 environment.
6.9.5
IRQ Example
Example: Usage of Interrupt Routines
// normally Timer 2 is called every 10ms. In this example the variable
// cnt gets increased by one every 10ms
int cnt;
void ISR(void)
{
int irqcnt;
cnt=cnt+
1
;
irqcnt=Irq_GetCount(INT_TIM2COMP);
}
Summary of Contents for C-Control Pro Mega Series
Page 1: ... 2008 Conrad Electronic C Control Pro Mega Series ...
Page 9: ...VIII Inhalt 2008 Conrad Electronic ...
Page 10: ...Part 1 ...
Page 17: ...Part 2 ...
Page 23: ...Part 3 ...
Page 41: ...32 Hardware 2008 Conrad Electronic 3 3 5 3 Component Parts Plan ...
Page 57: ...48 Hardware 2008 Conrad Electronic 3 4 5 3 Component Parts Plan ...
Page 58: ...Part 4 ...
Page 91: ...82 IDE 2008 Conrad Electronic ...
Page 92: ...Part 5 ...
Page 135: ...126 Compiler 2008 Conrad Electronic 31 1F US 63 3F 95 5F _ 127 7F DEL ...
Page 136: ...Part 6 ...
Page 231: ...Part 7 ...
Page 240: ......