CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How can I return to the main position from interrupt?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Sun Nov 25, 2012 6:25 pm     Reply with quote

Seriously - how many successful programs have you written to date?

The concept you are pursuing runs counter to the essential theory of structured programming. And that is the essential message EVERYBODY is giving you.

And the idea that you have a while loop in your ISR boggles this boyz mind !!! (even w/o the shenanigans you propose).

I would say rethink the whole structure and start again.
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Mon Nov 26, 2012 4:02 am     Reply with quote

Quote:
I've no chance to do as you all mentioned above to figure out one flag position, because I don't know where & when my interrupt occurs to terminate my big function.

Yes. That's part of the idea of interrupts. You don't know when they'll occur. On the other hand, you don't care either. Your interrupt can handle many flags, you're not limited to one.

I was in your position over quarter of a century ago, writting huge spaghetti code, that had to be printed out so I could follow it. Then I discovered structured programming. I've not had to print out a program since.

Your 45 second function scares me. If you effectively jump out of any part of it after an interrupt something is left hanging in mid-air. Then, on the other hand, you're worried about something else getting into wrong states by not being serviced.

What we're ALL saying to you is sit down and redo your entire structure.

You're standing too close to the problem, fixated by your chosen route, and can't see a way out.

Stop and stand back a little, it's going to be painful. In the end you have little choice.

Mike
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group