Go to Post I do this stuff because...well first inspired me to become me. I now understand who i am better and what i want to do. - Marygrace [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
  #1   Spotlight this post!  
Unread 22-01-2007, 09:12
Japper's Avatar
Japper Japper is offline
Registered User
FRC #3692 (RocknRobots)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Rutland Wisconsin
Posts: 147
Japper has a spectacular aura aboutJapper has a spectacular aura about
2007 IFI default code question

In the IFI 2007 default code main.c , there is a condition statement (see below) where if _SIMULATOR is defined then
statusflag.NEW_SPI_DATA is set to 1 and the slow loop (which execute every 26.2ms) is used., otherwise
it is never entered.

It is my assumption that because _SIMULATOR is defined in the default.h header file that this slow loop
will always be executed.

Why would you not want to use the slow loop (and remove the definition in the header file)?

Here is the code:
============
void main (void)
{
#ifdef UNCHANGEABLE_DEFINITION_AREA
IFI_Initialization (); /* DO NOT CHANGE! */
#endif

User_Initialization(); /* You edit this in user_routines.c */

statusflag.NEW_SPI_DATA = 0; /* DO NOT CHANGE! */

while (1) /* This loop will repeat indefinitely. */
{
#ifdef _SIMULATOR
statusflag.NEW_SPI_DATA = 1;
#endif


if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{ /* I'm slow! I only execute every 26.2ms because */
/* that's how fast the Master uP gives me data. */
Process_Data_From_Master_uP(); /* You edit this in user_routines.c */

if (autonomous_mode) /* DO NOT CHANGE! */
{
User_Autonomous_Code(); /* You edit this in user_routines_fast.c */
}
}
Process_Data_From_Local_IO(); /* You edit this in user_routines_fast.c */
/* I'm fast! I execute during every loop.*/
} /* while (1) */
} /* END of Main */
===========
 


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
Problems with Kevin's 2007 default code bruss6 Programming 8 19-01-2007 15:42
2007 Default Code? Binome Programming 52 11-01-2007 14:27
New IFI Default/User and Master Code Alex698 Programming 6 28-02-2006 23:04
Question about Solenoid and default code waialua359 Control System 4 21-01-2006 18:21
navigate and default code newbie question alan koch Programming 2 17-02-2004 22:25


All times are GMT -5. The time now is 12:59.

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