Ragnarok 0 Posted January 30, 2006 Report Share Posted January 30, 2006 I'm getting this error : Function called in more than one execution thread: delay_us, when i'm trying to use delay_us in an interruption and in my standar code, how can i solve it?, i been reading the forum and i'm not sure if i could make inline this function, 'cause its generated, if so, how can I do it, help me please, thanks!!! Quote Link to post Share on other sites
Picxie 0 Posted January 30, 2006 Report Share Posted January 30, 2006 I'm getting this error : Function called in more than one execution thread: delay_us, when i'm trying to use delay_us in an interruption and in my standar code, how can i solve it?, i been reading the forum and i'm not sure if i could make inline this function, 'cause its generated, if so, how can I do it, help me please, thanks!!! <{POST_SNAPBACK}> NEVER delay in the interrupt. If you need to perform two operations in an interrupt, eg aquire ADC and Start ADC conversion, consider using a timer based interrupt and a state machine to service the ADC. If you absolutely must delay in an interrupt then try looping around some NOPs. Quote Link to post Share on other sites
wolahr 0 Posted February 1, 2006 Report Share Posted February 1, 2006 NEVER delay in the interrupt. <{POST_SNAPBACK}> Why not? Especially when there may be a higher priority interrupt which can interrupt the interrupt if something more pressing occurs? I can see that keeping interrupts short is a good idea in general, but is there some special or non-obvious reason why putting a delay in is dangerous? Quote Link to post Share on other sites
Picxie 0 Posted February 2, 2006 Report Share Posted February 2, 2006 NEVER delay in the interrupt. <{POST_SNAPBACK}> Why not? Especially when there may be a higher priority interrupt which can interrupt the interrupt if something more pressing occurs? I can see that keeping interrupts short is a good idea in general, but is there some special or non-obvious reason why putting a delay in is dangerous? <{POST_SNAPBACK}> Never delay in an interrupt!.....unless you have to. Quote Link to post Share on other sites
wolahr 0 Posted February 3, 2006 Report Share Posted February 3, 2006 NEVER delay in the interrupt. <{POST_SNAPBACK}> Why not? Especially when there may be a higher priority interrupt which can interrupt the interrupt if something more pressing occurs? I can see that keeping interrupts short is a good idea in general, but is there some special or non-obvious reason why putting a delay in is dangerous? <{POST_SNAPBACK}> Never delay in an interrupt!.....unless you have to. <{POST_SNAPBACK}> So, if I do have to delay in an interrupt, could you arrange the linker to allow delay calls to be called (inlined) from more than one thread, and perhaps create a warning saying: Never delay in an interrupt!.....unless you have to. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.