Revert "Remove coroutines (#874)" (#1019)

* Revert "Remove coroutines (#874)"

This reverts commit 569c78fd8c.

* Update freertos Kernel submodule to latest head

* Remove temporary files

* Fix MingW demos and spell check

* Fix manifest version; fix headers

* Add ignore files and paths to core-checker.py

* Fix copyright in remaining files

* Fix PR check build failure

1. Remove defining `inline` in Makefile. This was causing build
   warnings.
2. Ensure that the linker removed unused functions from various
   compilation units.
3. Update the linker script so that all the functions are correctly
   placed in FLASH section.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>

---------

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
Co-authored-by: Gaurav Aggarwal <aggarg@amazon.com>
This commit is contained in:
Aniruddha Kanhere 2023-06-09 15:25:48 -07:00 committed by GitHub
parent 9ccae851e7
commit 1277ba1661
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
605 changed files with 11240 additions and 3628 deletions

View file

@ -28,32 +28,32 @@
/*
*
* vMain() is effectively the demo application entry point. It is called by
* the main() function generated by the Processor Expert application.
* the main() function generated by the Processor Expert application.
*
* vMain() creates all the demo application tasks, then starts the scheduler.
* The WEB documentation provides more details of the demo application tasks.
*
* Main.c also creates a task called "Check". This only executes every three
* seconds but has the highest priority so is guaranteed to get processor time.
* Main.c also creates a task called "Check". This only executes every three
* seconds but has the highest priority so is guaranteed to get processor time.
* Its main function is to check that all the other tasks are still operational.
* Each task (other than the "flash" tasks) maintains a unique count that is
* incremented each time the task successfully completes its function. Should
* any error occur within such a task the count is permanently halted. The
* Each task (other than the "flash" tasks) maintains a unique count that is
* incremented each time the task successfully completes its function. Should
* any error occur within such a task the count is permanently halted. The
* check task inspects the count of each task to ensure it has changed since
* the last time the check task executed. If all the count variables have
* the last time the check task executed. If all the count variables have
* changed all the tasks are still executing error free, and the check task
* toggles the onboard LED. Should any task contain an error at any time
* toggles the onboard LED. Should any task contain an error at any time
* the LED toggle rate will change from 3 seconds to 500ms.
*
* This file also includes the functionality normally implemented within the
* standard demo application file integer.c. Due to the limited memory
* This file also includes the functionality normally implemented within the
* standard demo application file integer.c. Due to the limited memory
* available on the microcontroller the functionality has been included within
* the idle task hook [vApplicationIdleHook()] - instead of within the usual
* separate task. See the documentation within integer.c for the rationale
* separate task. See the documentation within integer.c for the rationale
* of the integer task functionality.
*
*
*
*
* The demo applications included with other FreeRTOS ports make use of the
* standard ComTest tasks. These use a loopback connector to transmit and
* receive RS232 characters between two tasks. The test is important for two
@ -66,21 +66,21 @@
*
* The demo board used to develop this port does not include an RS232 interface
* so the ComTest tasks could not easily be included. Instead these two tests
* are created using a 'Button Push' task.
*
* are created using a 'Button Push' task.
*
* The 'Button Push' task blocks on a queue, waiting for data to arrive. A
* simple interrupt routine connected to the PP0 input on the demo board places
* data in the queue each time the PP0 button is pushed (this button is built
* onto the demo board). As the 'Button Push' task is created with a
* data in the queue each time the PP0 button is pushed (this button is built
* onto the demo board). As the 'Button Push' task is created with a
* relatively high priority it will unblock and want to execute as soon as data
* arrives in the queue - resulting in a context switch within the PP0 input
* ISR. If the data retrieved from the queue is that expected the 'Button Push'
* task toggles LED 5. Therefore correct operation is indicated by the LED
* toggling each time the PP0 button is pressed.
*
* This test is not as satisfactory as the ComTest method - but the simple
* This test is not as satisfactory as the ComTest method - but the simple
* nature of the port makes is just about adequate.
*
*
*/
/* Kernel includes. */
@ -109,7 +109,7 @@
/* LED that is toggled by the check task. The check task periodically checks
that all the other tasks are operating without error. If no errors are found
the LED is toggled with mainCHECK_PERIOD frequency. If an error is found
the LED is toggled with mainCHECK_PERIOD frequency. If an error is found
then the toggle rate increases to mainERROR_CHECK_PERIOD. */
#define mainCHECK_TASK_LED ( 7 )
#define mainCHECK_PERIOD ( ( TickType_t ) 3000 / portTICK_PERIOD_MS )
@ -165,14 +165,14 @@ their status. If an error is detected in one of the locally defined tasks then
this flag is set to pdTRUE. */
portBASE_TYPE xLocalError = pdFALSE;
/* The queue used to send data from the button push ISR to the Button Push
/* The queue used to send data from the button push ISR to the Button Push
task. */
static QueueHandle_t xButtonQueue;
/*-----------------------------------------------------------*/
/*
/*
* This is called from the main() function generated by the Processor Expert.
*/
void vMain( void )
@ -181,15 +181,15 @@ void vMain( void )
vStartLEDFlashTasks( mainFLASH_PRIORITY );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartDynamicPriorityTasks();
/* Start the locally defined tasks. There is also a task implemented as
the idle hook. */
xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
xTaskCreate( vButtonTask, "Button", configMINIMAL_STACK_SIZE, NULL, mainBUTTON_TASK_PRIORITY, NULL );
/* All the tasks have been created - start the scheduler. */
vTaskStartScheduler();
/* Should not reach here! */
for( ;; );
}
@ -206,11 +206,11 @@ TickType_t xLastWakeTime;
for( ;; )
{
/* Delay until it is time to execute again. The delay period is
/* Delay until it is time to execute again. The delay period is
shorter following an error. */
vTaskDelayUntil( &xLastWakeTime, xDelayPeriod );
/* Check all the demo application tasks are executing without
/* Check all the demo application tasks are executing without
error. If an error is found the delay period is shortened - this
has the effect of increasing the flash rate of the 'check' task
LED. */
@ -280,7 +280,7 @@ volatile long lValue;
{
taskYIELD();
}
#endif
#endif
}
}
/*-----------------------------------------------------------*/
@ -296,11 +296,11 @@ unsigned portBASE_TYPE uxExpected = 1, uxReceived;
{
/* Now the queue is created it is safe to enable the button interrupt. */
ButtonInterrupt_Enable();
for( ;; )
{
/* Simply wait for data to arrive from the button push interrupt. */
if( xQueueReceive( xButtonQueue, &uxReceived, portMAX_DELAY ) == pdPASS )
if( xQueueReceive( xButtonQueue, &uxReceived, portMAX_DELAY ) == pdPASS )
{
/* Was the data we received that expected? */
if( uxReceived != uxExpected )
@ -308,21 +308,21 @@ unsigned portBASE_TYPE uxExpected = 1, uxReceived;
/* Error! */
portENTER_CRITICAL();
xLocalError = pdTRUE;
portEXIT_CRITICAL();
portEXIT_CRITICAL();
}
else
{
/* Toggle the LED for every successful push. */
vParTestToggleLED( mainBUTTON_PUSH_LED );
vParTestToggleLED( mainBUTTON_PUSH_LED );
}
uxExpected++;
}
}
}
/* Will only get here if the queue could not be created. */
for( ;; );
for( ;; );
}
/*-----------------------------------------------------------*/
@ -335,9 +335,9 @@ unsigned portBASE_TYPE uxExpected = 1, uxReceived;
static unsigned long xHigherPriorityTaskWoken;
xHigherPriorityTaskWoken = pdFALSE;
/* Send an incrementing value to the button push task each run. */
uxValToSend++;
uxValToSend++;
/* Clear the interrupt flag. */
PIFP = 1;
@ -352,10 +352,10 @@ unsigned portBASE_TYPE uxExpected = 1, uxReceived;
{
/* NOTE: This macro can only be used if there are no local
variables defined. This function uses a static variable so it's
use is permitted. If the variable were not static portYIELD()
use is permitted. If the variable were not static portYIELD()
would have to be used in it's place. */
portTASK_SWITCH_FROM_ISR();
}
}
}
#pragma CODE_SEG DEFAULT