Thread: Tasks Question
View Single Post
  #3   Spotlight this post!  
Unread 21-01-2011, 17:07
DjMaddius's Avatar
DjMaddius DjMaddius is offline
Registered User
AKA: Matt Smith
FRC #2620 (Southgate Titans)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Southgate, Mi
Posts: 161
DjMaddius is an unknown quantity at this point
Re: Tasks Question

Thanks, that helped quite a bit.

Though now im having a separate problem with it. When i declate the task:

Code:
Task scissorLiftTask("Scissor Lift Task", (FUNCPTR)scissorMovePos);
I get the error

Code:
error: argument of type `void (BuiltinDefaultCode::)(int)' does not match `int (*)(...)'
My function for the task is as follows:

Code:
void scissorMovePos(int argPtr)
	{
		ScissorsLiftTaskStruct* args = (ScissorsLiftTaskStruct*)argPtr;
		while(true)
		{
			if(curPOS != POS)
			{
				switch(POS)
				{
					case 0: // DOWN
						args->solenoids[1]->Set(true);
						break;
						
					case 1: // SIDE HIGH
						
						break;
						
					case 2: // SIDE MID
						
						break;
						
					case 3: // SIDE LOW
						
						break;
						
					case 4: // MID LOW
						
						break;
						
					case 5: // MID MID	
						
						break;
						
					case 6: // MID HIGH
						
						break;
						
					default: // DOWN
						
						break;
				}
				curPOS = POS;
			}
		}
	}

EDIT:;

Also, im getting this error:
Code:
error: incompatible types in assignment of `Solenoid* (*)[9]' to `Solenoid*[9]'
with this line:
Code:
scissorLiftTaskArgs.solenoids = &m_solenoids;
Declarations of the two objects involved in the above error:
Code:
struct ScissorsLiftTaskStruct
	{
	     Solenoid *solenoids[(NUM_SOLENOIDS+1)];
	};

Solenoid *m_solenoids[(NUM_SOLENOIDS+1)];

Last edited by DjMaddius : 21-01-2011 at 17:16.
Reply With Quote