fix missing loop

This commit is contained in:
Alwin Berger 2022-02-15 00:23:15 +01:00
parent cc6a51574b
commit 45dec7fb56

View File

@ -172,41 +172,53 @@ static unsigned char get_average( void )
static void prvSamplerTask( void * pvParameters ) static void prvSamplerTask( void * pvParameters )
{ {
for (int i=0; i<WORK_SET_SIZE; i++) while (1)
{WORK_SET[i]=fuzz_input_next();} {
xTaskNotifyGive(xReplA); for (int i=0; i<WORK_SET_SIZE; i++)
xTaskNotifyGive(xReplB); {WORK_SET[i]=fuzz_input_next();}
xTaskNotifyGive(xReplA);
xTaskNotifyGive(xReplB);
}
} }
volatile char A_WILL_FAIL = 1; volatile char A_WILL_FAIL = 1;
static void prvReplicaA( void * pvParameters ) static void prvReplicaA( void * pvParameters )
{ {
ulTaskNotifyTake(pdTRUE,portMAX_DELAY); while (1)
unsigned char tmp = get_average();
if (tmp % 11 == 0 && A_WILL_FAIL)
{ {
A_WILL_FAIL--; ulTaskNotifyTake(pdTRUE,portMAX_DELAY);
tmp+=1; unsigned char tmp = get_average();
if (tmp % 11 == 0 && A_WILL_FAIL)
{
A_WILL_FAIL--;
tmp+=1;
}
int sum = count_up(tmp);
xQueueSend( xQueueOutputA, &sum, portMAX_DELAY );
} }
int sum = count_up(tmp);
xQueueSend( xQueueOutputA, &sum, portMAX_DELAY );
} }
static void prvReplicaB( void * pvParameters ) static void prvReplicaB( void * pvParameters )
{ {
ulTaskNotifyTake(pdTRUE,portMAX_DELAY); while (1)
unsigned char tmp = get_average();
if (tmp % 12 == 0)
{ {
tmp+=2; ulTaskNotifyTake(pdTRUE,portMAX_DELAY);
unsigned char tmp = get_average();
if (tmp % 12 == 0)
{
tmp+=2;
}
int sum = count_up(tmp);
xQueueSend( xQueueOutputB, &sum, portMAX_DELAY );
} }
int sum = count_up(tmp);
xQueueSend( xQueueOutputB, &sum, portMAX_DELAY );
} }
static void prvReplicaC( void * pvParameters ) static void prvReplicaC( void * pvParameters )
{ {
ulTaskNotifyTake(pdTRUE,portMAX_DELAY); while (1)
unsigned char tmp = get_average(); {
int sum = count_up(tmp); ulTaskNotifyTake(pdTRUE,portMAX_DELAY);
xQueueSend( xQueueOutputC, &sum, portMAX_DELAY ); unsigned char tmp = get_average();
int sum = count_up(tmp);
xQueueSend( xQueueOutputC, &sum, portMAX_DELAY );
}
} }
static void prvVoterTask( void * pvParameters ) static void prvVoterTask( void * pvParameters )
{ {