Go to Post I'd just give you the URL, but then you wouldn't learn to look for yourself. - DonRotolo [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
  #28   Spotlight this post!  
Unread 24-02-2004, 10:05
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
Re: sleep()

Quote:
Originally Posted by KenWittlief
I've been wanting to scope the loop myself, but havent got to it yet- thanks for instrumenting your RC.
Thanks, but I got the idea from someone on this forum.

Quote:
One thing I have not been able to figure out. The main loop looks for new input from the OI, and if it doesnt see it, it call the user_fast code.

That took me a little time to figure out. The fast code (Process_Data_From_Local_IO()) is called every loop of the while(1) loop. The "slow" user code is called in addition very occasionally in the while(1) loop when new data is ready (if (statusflag.NEW_SPI_DATA) ).

Quote:
Don't see anything in the fast code to throttle it back - can you put your toggles at the beginning and end of the fast section and see how fast it runs with your scope for us?
I did that, too, at the time, just to see. I didn't measure the rate, but it looked like hundreds of times for each call of Process_Data_From_Local_IO(). An easier, non-scope way would be to run a counter in the main while( 1 ) loop, then print it and reset it just before calling Process_Data_From_Local_IO().

...I was doing integer division in a few places in my joystick calculations and I was worried that my code was too slow, but was relieved to see that it runs in only 4 ms. Whew!
 


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 much sleep are you going to get??? ttedrow General Forum 34 11-01-2004 02:27
Sing me a SONG! Biggs717 Chit-Chat 78 09-05-2003 07:59
Sweet sweet sleep DavidAusTex General Forum 26 25-02-2003 00:38
LET ME SLEEP!!!!! archiver 2001 2 24-06-2002 01:08
Speaking of sleep and dew....see the pic... archiver 2001 3 24-06-2002 00:54


All times are GMT -5. The time now is 14:04.

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