Hi! On 13:45 Mon 08 Feb , Andrea Gasparini wrote: > Hi, > Let's say I have two kind of interrupt: IntA e IntB > After the former, I should do something, let's say "funcA()". > and after the second I should do (guess what?) funcB(). > > My constraints are that funcB have to be called after the relative funcA, > and *not* viceversa, and funcA have to be called during IntA handlers just > for speeding up things. > > Given that I can't say nothing about order of interrupts, how can I handle > the fact that funcB have to be called after funcA ? > ( I mean: I know that IntA will be raised before IntB, but that's doesn't > mean that the respective handlers will be called in this order... or not?) > > Hope that was clear enough... Maybe somehow like this: interruptA() { funcA(); int call = 0; lock a if (flag2 == 1) { call = 1; flag2 = 0; } else flag1 = 1 unlock a if (call) funcB(); } interruptB() { int call = 0; lock a if (flag1 == 1) { flag1 = 0; call = 1; } else flag2 = 1; unlock a if (call) funcB(); } -Michi -- programing a layer 3+4 network protocol for mesh networks see http://michaelblizek.twilightparadox.com -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ