View Single Post
  #3   Spotlight this post!  
Unread 09-02-2007, 18:38
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: Am i just not seeing it?

That function compiles fine for me. My guess is that the error is actually in the line/statement above your function definition. Are you missing a semicolon, closing brace, or closing parenthesis there?

For example, I tried this code
Code:
/*Various declarations to get the function to compile */
.....

int x // <--- Missing semicolon

static void do_manual_override( void )
{
  if (left_ramp_up == CLOSED)
  {
    left_motor_pwm = motor_up;
  }
  else if (left_ramp_down == CLOSED)
  {
    left_motor_pwm = motor_down;
  }
  else left_motor_pwm = motor_off;

  if (right_ramp_up == CLOSED)
  {
    right_motor_pwm = motor_up;
  }
  else if (right_ramp_down == CLOSED)
  {
    right_motor_pwm = motor_down;
  }
  else right_motor_pwm = motor_off;
}
and got the following error
Code:
test.c:18: error: syntax error before "static"
Hope that helps.