Jump to content
Sign in to follow this  
Ragnarok

.....than One Execution Thread: Delay_us

Recommended Posts

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!!! :)

Share this post


Link to post
Share on other sites
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!!!  :)

 

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.

Share this post


Link to post
Share on other sites
NEVER delay in the interrupt.

 

 

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?

Share this post


Link to post
Share on other sites

NEVER delay in the interrupt.

 

 

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?

 

Never delay in an interrupt!.....unless you have to.

Share this post


Link to post
Share on other sites

NEVER delay in the interrupt.

 

 

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?

 

Never delay in an interrupt!.....unless you have to.

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.

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...