Go to Post I truly love zipties. They're so elegant - permanent, yet disposable. Strong, yet flexible. Ubiquitous, yet somehow.... special. - Kris Verdeyen [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 08-02-2008, 16:05
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,673
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Interrupts, Interrupts, and more Interrupts!

Quote:
Originally Posted by dcbrown View Post
Will too many interupts will cause the red-light-of-death?
-------------------------------------------------------
Code:
	
<within the system clock routine, do...>

             if (statusflag.NEW_SPI_DATA != 0)
	{
                    Getdata(&rxdata);
                    Putdata(&txdata);
             }
Anyway, doing these operations in the background at interrupt time frees the user code from having to worry about taking too long between updates causing the red-light-of-death.
It might be nice to warn people trying this that all their operations on the data received from GetData() and sent to PutData() need to be atomic. I realize the data in the structs are represented as as unsigned chars, and thus accessing them is atomic, but it's pretty easy to get lazy and use them to store temporary results of calculations. The Default_Routine in the default code does this several times, and it's asking for trouble if you continue this practice with this style of communication servicing.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How many interrupts is too many interrupts? Madison Programming 14 08-02-2008 12:09
More than 6 RC digital input interrupts? Jared Russell Programming 2 06-02-2007 15:41
Interrupts and Script Conundrums Jon236 Programming 2 08-02-2005 23:01
interrupts and putdata() doy Programming 4 23-02-2004 22:45
Interrupts and rotation sensors kor Programming 3 12-02-2004 11:05


All times are GMT -5. The time now is 23:46.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi