View Single Post
  #1   Spotlight this post!  
Unread 14-02-2005, 21:49
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Syntax Error: externs, structs, and macros

Here's the thing: I'm getting a syntax error in 2 seperate lines that are probably related. I have narrowed it down to the point that I know that it is not the next or previous line.

They are:
Code:
BEGIN_MOTOR_LIST(motor_list)
	MOTOR(STRAIGHT,	LeftDrive,	OI_Left,	0,	0,	 0,	 0,	0,	254,	254) //ME! ME!
//...
END_MOTOR_LIST
Code:
REF_MOTOR_LIST(motor_list);
Here are the dependencies needed to get this:
Code:
#ifdef _MOTORS_H_
#define _MOTORS_H_

typedef enum {NONE,STRAIGHT,POSITION,FISHER} MotorType;

struct motors
{
	enum Motor type;
	char* pwm;
	char* oi;
	char pot;
	char pot_min;
	char pot_max;
	char pot_center;
	char pwm_min;
	char pwm_max;
	char pwm_change;
}

#define BEGIN_MOTOR_LIST(name) struct motors rom name[] = {
#define END_MOTOR_LIST                   {NONE, 0, 0, 0, 0, 0, 0, 0, 0} };
#define REF_MOTOR_LIST(name) extern struct motors name[]
#define PTR_MOTOR_LIST(name) struct motors *name
#define MOTOR(type,pwm,oi,pot,pot_min,pot_max,pot_center,pwm_min,pwm_max,pwm_change) {type, &pwm, &oi, pot, pot_min, pot_max, pot_center, pwm_min, pwm_max, pwm_change },

void DoMotors(PTR_MOTOR_LIST(motorlist));
#endif
Code:
char LeftDrive, RightDrive, E2;
#define OI_Left  p1_y
(unfortunately, it inserted random spaces)

Enlightenment?