mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-01 08:54:14 -04:00
Test the RTC and BURTC tickless implementations on the Gecko parts, and make correct as appropriate.
Replace some references to the older portTICK_RATE_MS macro with the newer pdMS_TO_TICKS() macro in the standard demo files.
This commit is contained in:
parent
556de14a1d
commit
732778a971
11 changed files with 190 additions and 56 deletions
|
@ -136,7 +136,7 @@ xBlockingQueueParameters *pxQueueParameters1, *pxQueueParameters2;
|
|||
xBlockingQueueParameters *pxQueueParameters3, *pxQueueParameters4;
|
||||
xBlockingQueueParameters *pxQueueParameters5, *pxQueueParameters6;
|
||||
const UBaseType_t uxQueueSize1 = 1, uxQueueSize5 = 5;
|
||||
const TickType_t xBlockTime = ( TickType_t ) 1000 / portTICK_PERIOD_MS;
|
||||
const TickType_t xBlockTime = pdMS_TO_TICKS( ( TickType_t ) 1000 );
|
||||
const TickType_t xDontBlock = ( TickType_t ) 0;
|
||||
|
||||
/* Create the first two tasks as described at the top of the file. */
|
||||
|
|
|
@ -122,7 +122,7 @@ that synchronise with the xEventGroupSync() function. */
|
|||
#define ebDONT_BLOCK ( 0 )
|
||||
|
||||
/* A 5ms delay. */
|
||||
#define ebSHORT_DELAY ( 5 / portTICK_PERIOD_MS )
|
||||
#define ebSHORT_DELAY pdMS_TO_TICKS( ( TickType_t ) 5 )
|
||||
|
||||
/* Used in the selective bits test which checks no, one or both tasks blocked on
|
||||
event bits in a group are unblocked as appropriate as different bits get set. */
|
||||
|
|
|
@ -109,7 +109,7 @@ Changes from V2.0.0
|
|||
|
||||
#define pollqSTACK_SIZE configMINIMAL_STACK_SIZE
|
||||
#define pollqQUEUE_SIZE ( 10 )
|
||||
#define pollqPRODUCER_DELAY ( ( TickType_t ) 200 / portTICK_PERIOD_MS )
|
||||
#define pollqPRODUCER_DELAY ( pdMS_TO_TICKS( ( TickType_t ) 200 ) )
|
||||
#define pollqCONSUMER_DELAY ( pollqPRODUCER_DELAY - ( TickType_t ) ( 20 / portTICK_PERIOD_MS ) )
|
||||
#define pollqNO_DELAY ( ( TickType_t ) 0 )
|
||||
#define pollqVALUES_TO_PRODUCE ( ( BaseType_t ) 3 )
|
||||
|
@ -135,10 +135,10 @@ static QueueHandle_t xPolledQueue;
|
|||
xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( UBaseType_t ) sizeof( uint16_t ) );
|
||||
|
||||
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
|
||||
in use. The queue registry is provided as a means for kernel aware
|
||||
in use. The queue registry is provided as a means for kernel aware
|
||||
debuggers to locate queues and has no purpose if a kernel aware debugger
|
||||
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||
defined to be less than 1. */
|
||||
vQueueAddToRegistry( xPolledQueue, "Poll_Test_Queue" );
|
||||
|
||||
|
@ -154,7 +154,7 @@ uint16_t usValue = ( uint16_t ) 0;
|
|||
BaseType_t xError = pdFALSE, xLoop;
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
{
|
||||
for( xLoop = 0; xLoop < pollqVALUES_TO_PRODUCE; xLoop++ )
|
||||
{
|
||||
/* Send an incrementing number on the queue without blocking. */
|
||||
|
@ -193,7 +193,7 @@ uint16_t usData, usExpectedValue = ( uint16_t ) 0;
|
|||
BaseType_t xError = pdFALSE;
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
{
|
||||
/* Loop until the queue is empty. */
|
||||
while( uxQueueMessagesWaiting( *( ( QueueHandle_t * ) pvParameters ) ) )
|
||||
{
|
||||
|
|
|
@ -122,7 +122,7 @@ queuesetPRIORITY_CHANGE_LOOPS number of values are sent to a queue. */
|
|||
/* A delay inserted when the Tx task changes its priority to be above the idle
|
||||
task priority to ensure the idle priority tasks get some CPU time before the
|
||||
next iteration of the queue set Tx task. */
|
||||
#define queuesetTX_LOOP_DELAY ( 200 / portTICK_PERIOD_MS )
|
||||
#define queuesetTX_LOOP_DELAY pdMS_TO_TICKS( ( TickType_t ) 200 )
|
||||
|
||||
/* The allowable maximum deviation between a received value and the expected
|
||||
received value. A deviation will occur when data is received from a queue
|
||||
|
@ -420,7 +420,7 @@ TickType_t xBlockTime;
|
|||
}
|
||||
|
||||
/* Wait for a message to arrive on one of the queues in the set. */
|
||||
xActivatedQueue = xQueueSelectFromSet( xQueueSet, portMAX_DELAY );
|
||||
xActivatedQueue = xQueueSelectFromSet( xQueueSet, portMAX_DELAY );
|
||||
|
||||
if( xActivatedQueue == NULL )
|
||||
{
|
||||
|
|
|
@ -115,7 +115,7 @@ task can tell if any of the suicidal tasks have failed to die.
|
|||
static volatile UBaseType_t uxTasksRunningAtStart = 0;
|
||||
|
||||
/* When a task deletes itself, it stack and TCB are cleaned up by the Idle task.
|
||||
Under heavy load the idle task might not get much processing time, so it would
|
||||
Under heavy load the idle task might not get much processing time, so it would
|
||||
be legitimate for several tasks to remain undeleted for a short period. There
|
||||
may also be a few other unexpected tasks if, for example, the tasks that test
|
||||
static allocation are also being used. */
|
||||
|
@ -141,15 +141,15 @@ UBaseType_t *puxPriority;
|
|||
/* Record the number of tasks that are running now so we know if any of the
|
||||
suicidal tasks have failed to be killed. */
|
||||
uxTasksRunningAtStart = ( UBaseType_t ) uxTaskGetNumberOfTasks();
|
||||
|
||||
|
||||
/* FreeRTOS.org versions before V3.0 started the idle-task as the very
|
||||
first task. The idle task was then already included in uxTasksRunningAtStart.
|
||||
From FreeRTOS V3.0 on, the idle task is started when the scheduler is
|
||||
started. Therefore the idle task is not yet accounted for. We correct
|
||||
this by increasing uxTasksRunningAtStart by 1. */
|
||||
uxTasksRunningAtStart++;
|
||||
|
||||
/* From FreeRTOS version 7.0.0 can optionally create a timer service task.
|
||||
|
||||
/* From FreeRTOS version 7.0.0 can optionally create a timer service task.
|
||||
If this is done, then uxTasksRunningAtStart needs incrementing again as that
|
||||
too is created when the scheduler is started. */
|
||||
#if configUSE_TIMERS == 1
|
||||
|
@ -159,12 +159,12 @@ UBaseType_t *puxPriority;
|
|||
#endif
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
||||
static portTASK_FUNCTION( vSuicidalTask, pvParameters )
|
||||
{
|
||||
volatile long l1, l2;
|
||||
TaskHandle_t xTaskToKill;
|
||||
const TickType_t xDelay = ( TickType_t ) 200 / portTICK_PERIOD_MS;
|
||||
const TickType_t xDelay = pdMS_TO_TICKS( ( TickType_t ) 200 );
|
||||
|
||||
if( pvParameters != NULL )
|
||||
{
|
||||
|
@ -203,7 +203,7 @@ const TickType_t xDelay = ( TickType_t ) 200 / portTICK_PERIOD_MS;
|
|||
|
||||
static portTASK_FUNCTION( vCreateTasks, pvParameters )
|
||||
{
|
||||
const TickType_t xDelay = ( TickType_t ) 1000 / portTICK_PERIOD_MS;
|
||||
const TickType_t xDelay = pdMS_TO_TICKS( ( TickType_t ) 1000 );
|
||||
UBaseType_t uxPriority;
|
||||
|
||||
uxPriority = *( UBaseType_t * ) pvParameters;
|
||||
|
@ -240,7 +240,7 @@ static UBaseType_t uxTasksRunningNow;
|
|||
{
|
||||
usLastCreationCount = usCreationCount;
|
||||
}
|
||||
|
||||
|
||||
uxTasksRunningNow = ( UBaseType_t ) uxTaskGetNumberOfTasks();
|
||||
|
||||
if( uxTasksRunningNow < uxTasksRunningAtStart )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue