Merge branch 'bugFix2' into 'master'

Fixed tardy joystick bug

See merge request ACD52832_MasterExample/ACD52832_MasterExampleFW!18
This commit is contained in:
Jurica Rešetar
2019-03-21 09:31:44 +01:00
2 changed files with 15557 additions and 15624 deletions
+15501 -15573
View File
File diff suppressed because it is too large Load Diff
+56 -51
View File
@@ -540,7 +540,8 @@ void joystickTaskFunction(void *arg)
};
BALL_POSITION ballPosition = BALL_POSITION::CENTER;
BALL_POSITION ballPositionPrev = BALL_POSITION::CENTER;
vTaskSuspend(NULL);
while(1)
@@ -564,6 +565,7 @@ void joystickTaskFunction(void *arg)
xTaskResumeAll();
}
ballPositionPrev = ballPosition;
epd.drawImage(joystick1);
switch (intSourceRecvSecondary)
{
@@ -663,60 +665,63 @@ void joystickTaskFunction(void *arg)
break;
}
}
vTaskSuspend(menuStateMachineTask);
switch (ballPosition)
if(ballPositionPrev != ballPosition)
{
case BALL_POSITION::UP:
vTaskSuspend(menuStateMachineTask);
switch (ballPosition)
{
epd.fillCircle(xCoordCenter,
yCoordCenter-centerOffset,
ballRadius,
color);
epd.write();
break;
}
case BALL_POSITION::DOWN:
{
epd.fillCircle(xCoordCenter,
yCoordCenter+centerOffset,
ballRadius,
color);
epd.write();
break;
}
case BALL_POSITION::LEFT:
{
epd.fillCircle(xCoordCenter-centerOffset,
yCoordCenter,
ballRadius,
color);
epd.write();
break;
}
case BALL_POSITION::RIGHT:
{
epd.fillCircle(xCoordCenter+centerOffset,
yCoordCenter,
ballRadius,
color);
epd.write();
break;
}
case BALL_POSITION::CENTER:
{
epd.fillCircle(xCoordCenter,
yCoordCenter,
ballRadius,
color);
epd.write();
break;
}
default:
{
break;
case BALL_POSITION::UP:
{
epd.fillCircle(xCoordCenter,
yCoordCenter-centerOffset,
ballRadius,
color);
epd.write();
break;
}
case BALL_POSITION::DOWN:
{
epd.fillCircle(xCoordCenter,
yCoordCenter+centerOffset,
ballRadius,
color);
epd.write();
break;
}
case BALL_POSITION::LEFT:
{
epd.fillCircle(xCoordCenter-centerOffset,
yCoordCenter,
ballRadius,
color);
epd.write();
break;
}
case BALL_POSITION::RIGHT:
{
epd.fillCircle(xCoordCenter+centerOffset,
yCoordCenter,
ballRadius,
color);
epd.write();
break;
}
case BALL_POSITION::CENTER:
{
epd.fillCircle(xCoordCenter,
yCoordCenter,
ballRadius,
color);
epd.write();
break;
}
default:
{
break;
}
}
vTaskResume(menuStateMachineTask);
}
vTaskResume(menuStateMachineTask);
}
}
}