From 8bf6ccf6eeeb5d277020511e65a808db2bd8ce02 Mon Sep 17 00:00:00 2001 From: Alwin Berger Date: Thu, 20 Apr 2023 09:21:31 +0200 Subject: [PATCH] fix clear on notify take --- .../Demo/CORTEX_M3_MPS2_QEMU_GCC/main_waters.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/main_waters.c b/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/main_waters.c index d4d1b030..62bf7d12 100644 --- a/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/main_waters.c +++ b/FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/main_waters.c @@ -301,7 +301,7 @@ static void prvTask78( void * pvParameters ) { // Exectime: f(x,y) = c + y*20000 + rng(x)*50000 // Output: g(x,y) = y * (x % 4) uint16_t x = fuzz_short_next(); - int y = ulTaskNotifyTake(pdFALSE, 0); + int y = ulTaskNotifyTake(pdTRUE, 0); volatile int torun = 6035; if (y > 0) { torun += 20000; @@ -323,7 +323,7 @@ static void prvTask400( void * pvParameters ) { // Actions -------------------------------------- // Exectime: f(x,y) = rng(x)*y*c or (rng(x) % 1000) uint32_t x = fuzz_long_next(); - int y = ulTaskNotifyTake(pdFALSE, 0); + int y = ulTaskNotifyTake(pdTRUE, 0); volatile int torun = 0; if (y == 2 && DEBUG_VAL(CHANCE_1_IN_POWOF2(x, 2), 1)) { torun = 1765; @@ -351,9 +351,9 @@ static void prvTask397( void * pvParameters ) { xTaskNotify(xTask90, DEBUG_VAL(x & 0x1, 0), eSetValueWithOverwrite); // 3 different activation strategies ------------- // activate sporadically from interrupts - // ulTaskNotifyTake(pdTRUE,portMAX_DELAY); + ulTaskNotifyTake(pdTRUE,portMAX_DELAY); // activate with worst possible frequency (700us, but tick resolution is too low) - vTaskDelayUntil( &xLastWakeTime, xFrequency ); + // vTaskDelayUntil( &xLastWakeTime, xFrequency ); // wait pseudo random many ticks // vTaskDelayUntil( &xLastWakeTime, CLAMP(RNG, 1, 100) / portTICK_PERIOD_MS ); } @@ -367,7 +367,7 @@ static void prvTask90( void * pvParameters ) { // Actions -------------------------------------- // Exectime: f(x) = c + x // Output: g(x) = x % 4 - int y = ulTaskNotifyTake(pdFALSE, 0); + int y = ulTaskNotifyTake(pdTRUE, 0); volatile uint16_t x = fuzz_short_next(); DEBUG_WCET(x=20048;) int torun = 0; @@ -391,7 +391,7 @@ static void prvTask1107( void * pvParameters ) { // Exectime: f(x) = c - x*y volatile uint16_t x = fuzz_short_next(); DEBUG_WCET(x=0;) - int y = ulTaskNotifyTake(pdFALSE, 0); + int y = ulTaskNotifyTake(pdTRUE, 0); int torun = 76865-((int)x)*y; WCET_CLAMP(torun, 10000, 76865, TASK_1107_MESSAGE) // --------------------------------------------- @@ -428,7 +428,7 @@ static void prvTask1009( void * pvParameters ) { // Exectime: f(x,y) = if x%8 == y ? 40000+x : x (<40k) // Output: g(x) = x % 8 == y uint16_t x = fuzz_short_next(); - int y = ulTaskNotifyTake(pdFALSE, 0); + int y = ulTaskNotifyTake(pdTRUE, 0); volatile int torun = 0; if (x % 8 == y) { torun = 40000 + x; @@ -455,7 +455,7 @@ static void prvTask1129( void * pvParameters ) { // longmax - shortmax: 39505 // most likely long case, which causes a short case in next task volatile uint32_t x = (uint32_t)fuzz_short_next(); - int y = ulTaskNotifyTake(pdFALSE, 0); + int y = ulTaskNotifyTake(pdTRUE, 0); DEBUG_WCET( static char flag=0; if (flag++ == 0 | flag == 5 | flag == 8 | flag == 9) {x = 65529;} @@ -483,7 +483,7 @@ static void prvTask416( void * pvParameters ) { // Exectime: f(x,y) = if y ? c1+2*x : c2-x // longmax - shortmax: 76955 volatile uint32_t x = (uint32_t)fuzz_short_next(); - int y = ulTaskNotifyTake(pdFALSE, 0); + int y = ulTaskNotifyTake(pdTRUE, 0); volatile int torun = 0; if (y) { DEBUG_WCET(x=0xffff;)