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.