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

@ -39,18 +39,18 @@
/*
* Timer instance | Value
* ----------------|---------
* TCB0 | 0
* TCB1 | 1
* TCB2 | 2
* TCB0 | 0
* TCB1 | 1
* TCB2 | 2
* TCB3 | 3
* RTC | 4
* RTC | 4
*/
#define configUSE_TIMER_INSTANCE 0
#define configUSE_PREEMPTION 1
/* NOTE: You can choose the following clock frequencies (Hz):
20000000, 10000000, 5000000, 2000000.
20000000, 10000000, 5000000, 2000000.
For other frequency values, update clock_config.h with your own settings. */
#define configCPU_CLOCK_HZ 10000000
@ -89,6 +89,10 @@ For other frequency values, update clock_config.h with your own settings. */
#define configUSE_TRACE_FACILITY 0
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
/* Co-routine related definitions. */
#define configUSE_CO_ROUTINES 1
#define configMAX_CO_ROUTINE_PRIORITIES 2
/* Software timer related definitions. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )

View file

@ -155,6 +155,10 @@
<Compile Include="main.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="..\..\..\Source\croutine.c">
<SubType>compile</SubType>
<Link>Source\croutine.c</Link>
</Compile>
<Compile Include="..\..\..\Source\event_groups.c">
<SubType>compile</SubType>
<Link>Source\event_groups.c</Link>
@ -199,6 +203,10 @@
<SubType>compile</SubType>
<Link>Source\include\atomic.h</Link>
</Compile>
<Compile Include="..\..\..\Source\include\croutine.h">
<SubType>compile</SubType>
<Link>Source\include\croutine.h</Link>
</Compile>
<Compile Include="..\..\..\Source\include\deprecated_definitions.h">
<SubType>compile</SubType>
<Link>Source\include\deprecated_definitions.h</Link>
@ -304,6 +312,14 @@
<SubType>compile</SubType>
<Link>Common\Minimal\PollQ.c</Link>
</Compile>
<Compile Include="..\..\..\Demo\Common\include\crflash.h">
<SubType>compile</SubType>
<Link>Common\include\crflash.h</Link>
</Compile>
<Compile Include="..\..\..\Demo\Common\Minimal\crflash.c">
<SubType>compile</SubType>
<Link>Common\Minimal\crflash.c</Link>
</Compile>
<Compile Include="..\..\..\Demo\Common\include\recmutex.h">
<SubType>compile</SubType>
<Link>Common\include\recmutex.h</Link>

View file

@ -88,7 +88,7 @@ void main_blinky( void )
{
/* Create the queue. */
xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( uint32_t ) );
if( xQueue != NULL )
{
/* Start the two tasks as described in the comments at the top of this

View file

@ -28,10 +28,12 @@
#include "FreeRTOS.h"
#include "task.h"
#include "croutine.h"
#include "PollQ.h"
#include "integer.h"
#include "serial.h"
#include "comtest.h"
#include "crflash.h"
#include "partest.h"
#include "regtest.h"
@ -61,6 +63,9 @@ again. */
the demo application is not unexpectedly resetting. */
#define mainRESET_COUNT_ADDRESS ( 0x1400 )
/* The number of coroutines to create. */
#define mainNUM_FLASH_COROUTINES ( 3 )
/*
* The task function for the "Check" task.
*/
@ -87,10 +92,13 @@ void main_minimal( void )
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartRegTestTasks();
/* Create the tasks defined within this file. */
xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Create the co-routines that flash the LED's. */
vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES );
/* In this port, to use preemptive scheduler define configUSE_PREEMPTION
as 1 in portmacro.h. To use the cooperative scheduler define
configUSE_PREEMPTION as 0. */
@ -102,7 +110,7 @@ void init_minimal( void )
/* Configure UART pins: PB0 Rx, PB1 Tx */
PORTB.DIR &= ~PIN1_bm;
PORTB.DIR |= PIN0_bm;
vParTestInitialise();
}
@ -123,7 +131,7 @@ static volatile unsigned long ulDummyVariable = 3UL;
integer tasks get some exercise. The result here is not important -
see the demo application documentation for more info. */
ulDummyVariable *= 3;
prvCheckOtherTasksAreStillRunning();
}
}
@ -152,7 +160,7 @@ static portBASE_TYPE xErrorHasOccurred = pdFALSE;
{
xErrorHasOccurred = pdTRUE;
}
if( xErrorHasOccurred == pdFALSE )
{
/* Toggle the LED if everything is okay so we know if an error occurs even if not
@ -174,4 +182,5 @@ unsigned char ucResetCount;
void vApplicationIdleHook( void )
{
vCoRoutineSchedule();
}

View file

@ -62,7 +62,7 @@ portBASE_TYPE xReturn;
{
xReturn = pdFALSE;
}
return xReturn;
}
/*-----------------------------------------------------------*/