|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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 |
|
|
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 |