diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-06-11 12:07:05 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-06-11 12:07:05 +0200 |
commit | c5743bb412d50d81d01351750c31e38d3c13c020 (patch) | |
tree | 1a058c10164c6fe588ac95412b8dcf8f7e7cf82f /src | |
parent | fc167d60232f9c9bd73485291a11df7babf0d92d (diff) | |
download | glutte-o-matic-c5743bb412d50d81d01351750c31e38d3c13c020.tar.gz glutte-o-matic-c5743bb412d50d81d01351750c31e38d3c13c020.tar.bz2 glutte-o-matic-c5743bb412d50d81d01351750c31e38d3c13c020.zip |
Merge test and launcher tasks
This saves some stack space
Diffstat (limited to 'src')
-rw-r--r-- | src/common/src/Core/main.c | 44 |
1 files changed, 10 insertions, 34 deletions
diff --git a/src/common/src/Core/main.c b/src/common/src/Core/main.c index 0f32945..f11ba50 100644 --- a/src/common/src/Core/main.c +++ b/src/common/src/Core/main.c @@ -107,26 +107,6 @@ int main(void) { } -static void test_task(void __attribute__ ((unused))*pvParameters) { - - int i = 0; - - while(1) { - vTaskDelay(1000 / portTICK_RATE_MS); - - if (i == 0) { - i = 1; - leds_turn_on(LED_GREEN); - - } else { - i = 0; - leds_turn_off(LED_GREEN); - } - - } - -} - // Launcher task is here to make sure the scheduler is // already running when calling the init functions. static void launcher_task(void __attribute__ ((unused))*pvParameters) @@ -204,22 +184,18 @@ static void launcher_task(void __attribute__ ((unused))*pvParameters) usart_debug_puts("Init done.\r\n"); - xTaskCreate( - test_task, - "Test task", - 4*configMINIMAL_STACK_SIZE, - (void*) NULL, - tskIDLE_PRIORITY + 2UL, - &task_handle); + while(1) { + int i = 0; + vTaskDelay(1000 / portTICK_RATE_MS); - /* We are done now, suspend this task - * With FreeDOS' heap_1.c, we cannot delete it. - * See freertos.org -> More Advanced... -> Memory Management - * for more info. - */ + if (i == 0) { + i = 1; + leds_turn_on(LED_GREEN); - while (1) { - vTaskSuspend(NULL); + } else { + i = 0; + leds_turn_off(LED_GREEN); + } } } |