inline warning

I get the following warning
Warning:Use ‘inline’ to avoid possible simultaneous variable memory access conflicts for subroutine ‘startMotor’ called from multiple tasks ‘conveyer’ and ‘main’?

should I be worried?

Here is the code

task drive () //driving program to run parallel to lifting and delivering

{
while (1==1)
{
motor[rightMotor] = (vexRT[Ch2]);
motor[leftMotor] = (vexRT[Ch3]);
}
}

task conveyer() /task conveyor runs the conveyor belt when button 6U is
pressed and runs backwards when 6D is pressed
/
{
while (1==1)
{
while (vexRT[Btn6U]==1)
{
startMotor(conv1, 127);
startMotor(conv2, 127);
}
while (vexRT[Btn6D]==1)
{
startMotor(conv1, -127);
startMotor(conv2, -127);
}
stopMotor(conv1);
stopMotor(conv2);
}
}

task main() //task main is the lifting program
{
StartTask (drive);
StartTask (conveyer);
SensorValue[encoder] = 0;

while(1==1)
{
while(vexRT[Btn5U] == 1) //high goal
{
if(SensorValue[encoder]<=1200) //holding pattern for high goal
{
startMotor(lift1,127);
startMotor(lift2, 127);
}
else
{
stopMotor(lift1);
stopMotor(lift2);
}
}
while(vexRT[Btn7U] == 1) //go to medium goal
{
if(SensorValue[encoder]<=800) //holding pattern for medium goal
{
startMotor(lift1,127);
startMotor(lift2, 127);
}
else
{
stopMotor(lift1);
stopMotor(lift2);
}
}
while(vexRT[Btn7L] == 1) //go to low goal
{
if(SensorValue[encoder]<=360) //holding pattern for high goall
{
startMotor(lift1,127);
startMotor(lift2,127);
}
else
{
stopMotor(lift1);
stopMotor(lift2);
}
}

while (vexRT[Btn5D] == 1) //lower the lift
{
startMotor(lift1, -50);
startMotor(lift2, -50);
SensorValue[encoder] = 0;
}

  stopMotor(lift1);
  stopMotor(lift2);
  SensorValue[encoder] = 0;

} //end of forever loop
} //end of task main

Some of this may be resolved fllowing some of jpearman’s tips in this great programming tips post he started (and others who contributed too). You may want to start a few pages earlier but the thread shows some really good stuff about multitasking and putting in some waits so tasks can flow between each other.

https://vexforum.com/t/robotc-programming-tips/19718/1&highlight=semaphore&page=4

On page 4 you can see how the use of semaphores can help manage the attempted collisions of variable access. You can try and read variables from multiple threads as a “dirty read”, but only one place at a time should be writing to a variable is a good rule to follow. That’s what I think the warning is trying to tell you.

Also, this has a mian() versus usercontrol() as used in the competition template. Your main() code should really be in usercontrol() if this is for a competition. You may not pass your inspection check if left as is.

With RobotC 3.05 you can start the tasks in autonomous and not have them killed on you before user control but since you’re not allowed to use the joystick in autonomous it may not make much sense here. But you may not need to upgrade at all. If you are still waiting on those new I2C based encoders you might as well wait for another update for those too.

Refresher on the competition template:
http://www.robotc.net/support/vex/media/competitions/Using_the_ROBOTC_Competition_Templates.pdf

There is a possibility that the wrong value will get sent to a motor due to the way variables are passed into the startMotor function. I always find it funny when ROBOTC shows this warning as “inline” functions are not supported. The simple way of fixing this is to create two functions with different names, for example, startMotorA and startMotorB and only call one from each task. You do not show the startMotor function so I assume you are perhaps using the natural language extensions, if so all startMotor really does is this:

void startMotor(tMotor motorPort = port6, byte speed = 95)
{
  motor[motorPort] = speed;
}

you could create your own version of this or use motor] directly in the conveyer task as you do in the drive task.