mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 05:21:59 -04:00
Do not call exit() on MSVC Port when calling vPortEndScheduler (#624)
* make port exitable * correctly set xPortRunning to False * add suggestions from Review Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> * add suggestions from Review Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com> --------- Co-authored-by: Gaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>
This commit is contained in:
parent
050cf0d80f
commit
8252edec45
|
@ -160,7 +160,7 @@ TIMECAPS xTimeCaps;
|
||||||
/* Just to prevent compiler warnings. */
|
/* Just to prevent compiler warnings. */
|
||||||
( void ) lpParameter;
|
( void ) lpParameter;
|
||||||
|
|
||||||
for( ;; )
|
while( xPortRunning == pdTRUE )
|
||||||
{
|
{
|
||||||
/* Wait until the timer expires and we can access the simulated interrupt
|
/* Wait until the timer expires and we can access the simulated interrupt
|
||||||
variables. *NOTE* this is not a 'real time' way of generating tick
|
variables. *NOTE* this is not a 'real time' way of generating tick
|
||||||
|
@ -177,6 +177,8 @@ TIMECAPS xTimeCaps;
|
||||||
Sleep( portTICK_PERIOD_MS );
|
Sleep( portTICK_PERIOD_MS );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( xPortRunning == pdTRUE )
|
||||||
|
{
|
||||||
configASSERT( xPortRunning );
|
configASSERT( xPortRunning );
|
||||||
|
|
||||||
/* Can't proceed if in a critical section as pvInterruptEventMutex won't
|
/* Can't proceed if in a critical section as pvInterruptEventMutex won't
|
||||||
|
@ -197,12 +199,10 @@ TIMECAPS xTimeCaps;
|
||||||
and can access the interrupt handler variables. */
|
and can access the interrupt handler variables. */
|
||||||
ReleaseMutex( pvInterruptEventMutex );
|
ReleaseMutex( pvInterruptEventMutex );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
/* Should never reach here - MingW complains if you leave this line out,
|
|
||||||
MSVC complains if you put it in. */
|
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -566,7 +566,7 @@ uint32_t ulErrorCode;
|
||||||
|
|
||||||
void vPortEndScheduler( void )
|
void vPortEndScheduler( void )
|
||||||
{
|
{
|
||||||
exit( 0 );
|
xPortRunning = pdFALSE;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue