From 0dbcfc75bdcc549f42501313112ec2dc38671511 Mon Sep 17 00:00:00 2001 From: Pierre-Noel Bouteville Date: Tue, 5 Apr 2022 15:33:58 +0200 Subject: [PATCH 1/5] replace duplicated if branch because empty by a comment to avoid warning/error with option GCC -Wduplicated-branches --- tasks.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tasks.c b/tasks.c index 20df2734508..c2dcc2e0965 100644 --- a/tasks.c +++ b/tasks.c @@ -2064,15 +2064,14 @@ void vTaskStartScheduler( void ) /* Setting up the timer tick is hardware specific and thus in the * portable interface. */ - if( xPortStartScheduler() != pdFALSE ) - { - /* Should not reach here as if the scheduler is running the - * function will not return. */ - } - else - { - /* Should only reach here if a task calls xTaskEndScheduler(). */ - } + xPortStartScheduler() + /* + * if just above call of xPortStartScheduler not return pdFALSE + * Should not reach here as if the scheduler is running the + * function will not return. + * otherwise + * Should only reach here if a task calls xTaskEndScheduler(). + */ } else { From 6e6c6fb0b917b0d953a8cd22c886f0bb01f8ee98 Mon Sep 17 00:00:00 2001 From: Pierre-Noel Bouteville Date: Tue, 5 Apr 2022 15:40:04 +0200 Subject: [PATCH 2/5] Missing ';' --- tasks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.c b/tasks.c index c2dcc2e0965..49295d0a441 100644 --- a/tasks.c +++ b/tasks.c @@ -2064,7 +2064,7 @@ void vTaskStartScheduler( void ) /* Setting up the timer tick is hardware specific and thus in the * portable interface. */ - xPortStartScheduler() + xPortStartScheduler(); /* * if just above call of xPortStartScheduler not return pdFALSE * Should not reach here as if the scheduler is running the From 7066ccc67461c9c7dedb4e9d571665d8cfec9378 Mon Sep 17 00:00:00 2001 From: Pierre-Noel Bouteville Date: Tue, 5 Apr 2022 15:42:26 +0200 Subject: [PATCH 3/5] cosmetic comment --- tasks.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tasks.c b/tasks.c index 49295d0a441..ddda63abf98 100644 --- a/tasks.c +++ b/tasks.c @@ -2065,13 +2065,11 @@ void vTaskStartScheduler( void ) /* Setting up the timer tick is hardware specific and thus in the * portable interface. */ xPortStartScheduler(); - /* - * if just above call of xPortStartScheduler not return pdFALSE + /* if just above call of xPortStartScheduler not return pdFALSE * Should not reach here as if the scheduler is running the * function will not return. * otherwise - * Should only reach here if a task calls xTaskEndScheduler(). - */ + * Should only reach here if a task calls xTaskEndScheduler(). */ } else { From 0337c7f598b0cfa98781af7a911e5440505168cc Mon Sep 17 00:00:00 2001 From: Pierre-Noel Bouteville Date: Wed, 6 Apr 2022 13:45:55 +0200 Subject: [PATCH 4/5] update comment as suggested by Gaurav-Aggarwal-AWS --- tasks.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tasks.c b/tasks.c index ddda63abf98..fdda7128626 100644 --- a/tasks.c +++ b/tasks.c @@ -2065,11 +2065,12 @@ void vTaskStartScheduler( void ) /* Setting up the timer tick is hardware specific and thus in the * portable interface. */ xPortStartScheduler(); - /* if just above call of xPortStartScheduler not return pdFALSE - * Should not reach here as if the scheduler is running the - * function will not return. - * otherwise - * Should only reach here if a task calls xTaskEndScheduler(). */ + /* In most cases, xPortStartScheduler() will not return. If it + * returns pdTRUE then there was not enough heap memory available + * to create either the Idle or the Timer task. If it returned + * pdFALSE, then the application called xTaskEndScheduler(). + * Most ports don't implement xTaskEndScheduler() as there is + * nothing to return to. */ } else { From f0fe0c33afea67ce93641f6facea0684228b0868 Mon Sep 17 00:00:00 2001 From: Pierre-Noel Bouteville Date: Wed, 6 Apr 2022 14:37:34 +0200 Subject: [PATCH 5/5] cosmetic --- tasks.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks.c b/tasks.c index fdda7128626..82ad273ddd9 100644 --- a/tasks.c +++ b/tasks.c @@ -2065,6 +2065,7 @@ void vTaskStartScheduler( void ) /* Setting up the timer tick is hardware specific and thus in the * portable interface. */ xPortStartScheduler(); + /* In most cases, xPortStartScheduler() will not return. If it * returns pdTRUE then there was not enough heap memory available * to create either the Idle or the Timer task. If it returned