Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   problem with void Process_Data_From_Local_IO (http://www.chiefdelphi.com/forums/showthread.php?t=33614)

CmptrGk 29-01-2005 16:40

problem with void Process_Data_From_Local_IO
 
ok, this has been sort of annoying, mplab says that there is a syntax error in this line void Process_Data_From_Local_IO(void) this to me makes no sense whatsoever. also, it says that there is a syntax error on the last line of the program which is completly blank. here is the problem code
Code:

/*******************************************************************************
 * FUNCTION NAME: Process_Data_From_Local_IO
 * PURPOSE:          Execute user's realtime code.
 * You should modify this routine by adding code which you wish to run fast.
 * It will be executed every program loop, and not wait for fresh data
 * from the Operator Interface.
 * CALLED FROM:  main.c
 * ARGUMENTS:        none
 * RETURNS:          void
 *******************************************************************************/
 void Process_Data_From_Local_IO(void)
 {
          if (p3_sw_aux1 == 0 && p3_sw_top == 0 && p3_sw_trig == 0)
        {
                    auton_state = 1;
          }
 
          else if (p3_sw_aux1 == 1 && p3_sw_top == 0 && p3_sw_trig == 0)
        {
                auton_state = 2;
          }
 
        else if (p3_sw_aux1 == 0 && p3_sw_top == 1 && p3_sw_trig == 0)
        {
                auton_state = 3;
        }
 
          else if (p3_sw_aux1 == 0 && p3_sw_top == 0 && p3_sw_trig == 1)
        {
                auton_state = 4;
          }
 
          else if (p3_sw_aux1 == 1 && p3_sw_top == 1 && p3_sw_trig == 0)
        {
                auton_state = 5;
          }
 
        else if (p3_sw_aux1 == 1 && p3_sw_top == 0 && p3_sw_trig == 1)
        {
                auton_state = 6;
        }
 
          else if (p3_sw_aux1 == 0 && p3_sw_top == 1 && p3_sw_trig == 1)
        {
                auton_state = 7;
        }
 
          else if (p3_sw_aux1 == 1 && p3_sw_top == 1 && p3_sw_trig == 1)
        {
                auton_state = 8;
        }
       
       
 }
 
 }
 
 
 /******************************************************************************/
 /******************************************************************************/
 /******************************************************************************/


Mark McLeod 29-01-2005 16:51

Re: problem with void Process_Data_From_Local_IO
 
Quote:

Originally Posted by CmptrGk

}

}


/************************************************** ****************************/
/************************************************** ****************************/
/************************************************** ****************************/
[/code]

The first error sounds like it really occurs earlier in user_routines_fast.c. Take a look at the line(s) before this routine and look for at least 2 open brackets that don't have matching close brackets.

You have one too many closing brackets "}" in this routine, but it doesn't complain, so I'd say you have too many open brackets "{" earlier in the file. That would explain why you get an error message about "void Process_Data..."

The error message on the last line usually means the compiler cannot resolve an earlier problem (such as too many open brackets).

CmptrGk 29-01-2005 17:14

Re: problem with void Process_Data_From_Local_IO
 
thanks, i belive it was caused by a missing bracket in case 4 in the autonomus section


All times are GMT -5. The time now is 13:22.

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