mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-01 08:54:14 -04:00
Prepare for a FreeRTOS V9 release candidate:
- Remove the standard demo files that used the [long since deprecated] alternative API. - Add standard demo task that tests the new xTaskAbortDelay() function. - Update the Win32 Visual Studio project to use Visual Studio 2015 Community Edition. - Rename the xGenericListItem TCB member to xStateListItem as it better describes the member's purpose.
This commit is contained in:
parent
c7b7b90cc9
commit
d7253324cd
58 changed files with 984 additions and 2490 deletions
|
@ -83,6 +83,19 @@
|
|||
#define portMAX_INTERRUPTS ( ( uint32_t ) sizeof( uint32_t ) * 8UL ) /* The number of bits in an uint32_t. */
|
||||
#define portNO_CRITICAL_NESTING ( ( uint32_t ) 0 )
|
||||
|
||||
/* The priorities at which the various components of the simulation execute.
|
||||
Priorities are higher when a soak test is performed to lessen the effect of
|
||||
Windows interfering with the timing. */
|
||||
#define portSOAK_TEST
|
||||
#ifndef portSOAK_TEST
|
||||
#define portSIMULATED_INTERRUPTS_THREAD_PRIORITY THREAD_PRIORITY_NORMAL
|
||||
#define portSIMULATED_TIMER_THREAD_PRIORITY THREAD_PRIORITY_BELOW_NORMAL
|
||||
#define portTASK_THREAD_PRIORITY THREAD_PRIORITY_IDLE
|
||||
#else
|
||||
#define portSIMULATED_INTERRUPTS_THREAD_PRIORITY THREAD_PRIORITY_TIME_CRITICAL
|
||||
#define portSIMULATED_TIMER_THREAD_PRIORITY THREAD_PRIORITY_HIGHEST
|
||||
#define portTASK_THREAD_PRIORITY THREAD_PRIORITY_ABOVE_NORMAL
|
||||
#endif
|
||||
/*
|
||||
* Created as a high priority thread, this function uses a timer to simulate
|
||||
* a tick interrupt being generated on an embedded target. In this Windows
|
||||
|
@ -261,7 +274,7 @@ int8_t *pcTopOfStack = ( int8_t * ) pxTopOfStack;
|
|||
configASSERT( pxThreadState->pvThread );
|
||||
SetThreadAffinityMask( pxThreadState->pvThread, 0x01 );
|
||||
SetThreadPriorityBoost( pxThreadState->pvThread, TRUE );
|
||||
SetThreadPriority( pxThreadState->pvThread, THREAD_PRIORITY_IDLE );
|
||||
SetThreadPriority( pxThreadState->pvThread, portTASK_THREAD_PRIORITY );
|
||||
|
||||
return ( StackType_t * ) pxThreadState;
|
||||
}
|
||||
|
@ -298,7 +311,7 @@ xThreadState *pxThreadState;
|
|||
|
||||
if( lSuccess == pdPASS )
|
||||
{
|
||||
if( SetThreadPriority( pvHandle, THREAD_PRIORITY_NORMAL ) == 0 )
|
||||
if( SetThreadPriority( pvHandle, portSIMULATED_INTERRUPTS_THREAD_PRIORITY ) == 0 )
|
||||
{
|
||||
lSuccess = pdFAIL;
|
||||
}
|
||||
|
@ -315,7 +328,7 @@ xThreadState *pxThreadState;
|
|||
pvHandle = CreateThread( NULL, 0, prvSimulatedPeripheralTimer, NULL, CREATE_SUSPENDED, NULL );
|
||||
if( pvHandle != NULL )
|
||||
{
|
||||
SetThreadPriority( pvHandle, THREAD_PRIORITY_BELOW_NORMAL );
|
||||
SetThreadPriority( pvHandle, portSIMULATED_TIMER_THREAD_PRIORITY );
|
||||
SetThreadPriorityBoost( pvHandle, TRUE );
|
||||
SetThreadAffinityMask( pvHandle, 0x01 );
|
||||
ResumeThread( pvHandle );
|
||||
|
@ -427,8 +440,8 @@ CONTEXT xContext;
|
|||
pxThreadState = ( xThreadState *) *( ( size_t * ) pvOldCurrentTCB );
|
||||
SuspendThread( pxThreadState->pvThread );
|
||||
|
||||
/* Ensure the thread is actually suspended by performing a
|
||||
synchronous operation that can only complete when the thread is
|
||||
/* Ensure the thread is actually suspended by performing a
|
||||
synchronous operation that can only complete when the thread is
|
||||
actually suspended. The below code asks for dummy register
|
||||
data. */
|
||||
xContext.ContextFlags = CONTEXT_INTEGER;
|
||||
|
@ -493,7 +506,7 @@ uint32_t ulErrorCode;
|
|||
does not run and swap it out before it is closed. If that were to happen
|
||||
the thread would never run again and effectively be a thread handle and
|
||||
memory leak. */
|
||||
SetThreadPriority( pvThread, THREAD_PRIORITY_ABOVE_NORMAL );
|
||||
SetThreadPriority( pvThread, THREAD_PRIORITY_HIGHEST );
|
||||
|
||||
/* This function will not return, therefore a yield is set as pending to
|
||||
ensure a context switch occurs away from this thread on the next tick. */
|
||||
|
@ -524,13 +537,15 @@ void vPortGenerateSimulatedInterrupt( uint32_t ulInterruptNumber )
|
|||
|
||||
if( ( ulInterruptNumber < portMAX_INTERRUPTS ) && ( pvInterruptEventMutex != NULL ) )
|
||||
{
|
||||
/* Yield interrupts are processed even when critical nesting is non-zero. */
|
||||
/* Yield interrupts are processed even when critical nesting is
|
||||
non-zero. */
|
||||
WaitForSingleObject( pvInterruptEventMutex, INFINITE );
|
||||
ulPendingInterrupts |= ( 1 << ulInterruptNumber );
|
||||
|
||||
/* The simulated interrupt is now held pending, but don't actually process it
|
||||
yet if this call is within a critical section. It is possible for this to
|
||||
be in a critical section as calls to wait for mutexes are accumulative. */
|
||||
/* The simulated interrupt is now held pending, but don't actually
|
||||
process it yet if this call is within a critical section. It is
|
||||
possible for this to be in a critical section as calls to wait for
|
||||
mutexes are accumulative. */
|
||||
if( ulCriticalNesting == 0 )
|
||||
{
|
||||
SetEvent( pvInterruptEvent );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue