PIC32 PORTSetBits macro

When using these peripheral macro’s when initializing the board the instruction are executed. When I use theses macro’s like PORTSetBits and PORTClearBits within a vTaskSupendAll code block. The motor are not started or stopped.
Am I missing some configuration?

PIC32 PORTSetBits macro

prototype of the task looks like this: void vTaskCPanel(void *pvParameters)
{
char action;
portBASE_TYPE xStatus;
char isBusy = 0;
TaskType event;
unsigned int sensorValue; datacontainer data;
pin_location motor;
pin_location sensor; motor.portId1 = IOPORT_F;
motor.bit1 = BIT_0;
motor.portId2 = IOPORT_F;
motor.bit2 = BIT_1; sensor.portId1 = IOPORT_B;
sensor.bit1 = BIT_15;
sensor.portId2 = IOPORT_D;
sensor.bit2 = BIT_4; data.motor = motor;
data.sensor = sensor; for(;;)
{
// wait for action queue, to be filled by vTaskEthListener
if (isBusy == 0)
{
xStatus = xQueueReceive(xQueueCPanel, &action, portMAX_DELAY);
if ( xStatus == pdPASS)
{
isBusy = 1;
event = Start;
}
else
{
// TODO: send error
}
} // handle action
switch (action)
{
case 0:
switch (event)
{
case Start:
vTaskSuspendAll();
{
PORTSetBits(IOPORT_F, BIT_0);
PORTClearBits(IOPORT_F, BIT_1);
}
xTaskResumeAll(); event = Running;
break;
case Running:
vTaskSuspendAll();
{
sensorValue = PORTReadBits(IOPORT_B, BIT_15);
if (sensorValue == 0)
{
InternalMotorStop(&motor);
event = Stopped;
}
}
xTaskResumeAll(); break;
case Stopped:
isBusy = 0;
break;
}
// TODO: read core timer to check for sensor errors // Delay task
vTaskDelay(100/portTICK_RATE_MS);
break;
case 1:
switch (event)
{
case Start:
vTaskSuspendAll();
{
PORTSetBits(motor.portId2, motor.bit2);
PORTClearBits(motor.portId1, motor.bit1);
}
xTaskResumeAll(); event = Running;
break;
case Running:
vTaskSuspendAll();
{
sensorValue = PORTReadBits(sensor.portId2, sensor.bit2);
if (sensorValue == 0)
{
InternalMotorStop(&motor);
event = Stopped;
}
}
xTaskResumeAll(); break;
case Stopped:
isBusy = 0;
break;
}
// TODO: read core timer to check for sensor errors // Delay task
vTaskDelay(100/portTICK_RATE_MS);
break;
}
}
}

PIC32 PORTSetBits macro

After rewriting the project with FreeRTOS, I forgot to enable the motor circuit…
Sorry for my stupidity!