From 94594af13f2b33286a393747b9e71e36374519cd Mon Sep 17 00:00:00 2001 From: Anuj Deshpande Date: Sat, 23 Feb 2019 17:58:48 +0530 Subject: [PATCH] examples: Move blink code to main task --- examples/get-started/blink/main/blink.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/examples/get-started/blink/main/blink.c b/examples/get-started/blink/main/blink.c index c121d4fbe4..20a0b94ebf 100644 --- a/examples/get-started/blink/main/blink.c +++ b/examples/get-started/blink/main/blink.c @@ -17,7 +17,7 @@ */ #define BLINK_GPIO CONFIG_BLINK_GPIO -void blink_task(void *pvParameter) +void app_main() { /* Configure the IOMUX register for pad BLINK_GPIO (some pads are muxed to GPIO on reset already, but some default to other @@ -30,15 +30,12 @@ void blink_task(void *pvParameter) gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT); while(1) { /* Blink off (output low) */ + printf("Turning off the LED\n"); gpio_set_level(BLINK_GPIO, 0); vTaskDelay(1000 / portTICK_PERIOD_MS); /* Blink on (output high) */ + printf("Turning on the LED\n"); gpio_set_level(BLINK_GPIO, 1); vTaskDelay(1000 / portTICK_PERIOD_MS); } } - -void app_main() -{ - xTaskCreate(&blink_task, "blink_task", configMINIMAL_STACK_SIZE, NULL, 5, NULL); -}