Forum: Mikrocontroller und Digitale Elektronik mehrere ext. Interrupts sollen das gleiche auslösen


von Mario (Gast)


Lesenswert?

Hallo,

habe mal eine kurze Frage. Die ext. Int 4,5 und 6 sollen das gleiche im
Programm bewirken. Wie kann man das am besten schreiben?

Also diese Versionen gehen irgendwie nicht:


1. (SIGNAL (SIG_INTERRUPT4)) | (SIGNAL (SIG_INTERRUPT5)) |
(SIGNAL(SIG_INTERRUPT6))

2. SIGNAL ((SIG_INTERRUPT4) || (SIG_INTERRUPT5) || (SIG_INTERRUPT5))

3. SIGNAL (SIG_INTERRUPT4) | SIGNAL (SIG_INTERRUPT5) | SIGNAL
(SIG_INTERRUPT6)


Danke, Mario

von Florian (Gast)


Lesenswert?

Hallo,

du schreibst einfach eine funktion, welche du in jeder
Interruptfunktion aufrufst:
z.B.

void do_anywhat(void)
{
  ....
}

SIGNAL(SIG_INTERUPT4)
{
  do_anywhat();
}

SIGNAL(SIG_INTERUPT5)
{
  do_anywhat();
}


Gruß, Florian

von Mario (Gast)


Lesenswert?

@ Florian

daran hatte ich auch schon gedacht, aber ich dachte man kann es auch
anders lösen.

Danke für Deine nette Hilfe.

Mario

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.