lwip sys_arch: Add functional xInsideISR implementation
Relies on global flags set when the user ISR is executing. Unclear if this fixes any bugs as ISR code may not have been calling into LWIP, but the previous implementation was broken.
This commit is contained in:
parent
1fe6586189
commit
cb78ecd0e2
2 changed files with 598 additions and 585 deletions
|
@ -9,6 +9,8 @@
|
||||||
|
|
||||||
_xt_isr isr[16];
|
_xt_isr isr[16];
|
||||||
|
|
||||||
|
bool esp_in_isr;
|
||||||
|
|
||||||
void IRAM _xt_isr_attach(uint8_t i, _xt_isr func)
|
void IRAM _xt_isr_attach(uint8_t i, _xt_isr func)
|
||||||
{
|
{
|
||||||
isr[i] = func;
|
isr[i] = func;
|
||||||
|
@ -20,6 +22,8 @@ void IRAM _xt_isr_attach(uint8_t i, _xt_isr func)
|
||||||
*/
|
*/
|
||||||
uint16_t IRAM _xt_isr_handler(uint16_t intset)
|
uint16_t IRAM _xt_isr_handler(uint16_t intset)
|
||||||
{
|
{
|
||||||
|
esp_in_isr = true;
|
||||||
|
|
||||||
/* WDT has highest priority (occasional WDT resets otherwise) */
|
/* WDT has highest priority (occasional WDT resets otherwise) */
|
||||||
if(intset & BIT(INUM_WDT)) {
|
if(intset & BIT(INUM_WDT)) {
|
||||||
_xt_clear_ints(BIT(INUM_WDT));
|
_xt_clear_ints(BIT(INUM_WDT));
|
||||||
|
@ -35,5 +39,7 @@ uint16_t IRAM _xt_isr_handler(uint16_t intset)
|
||||||
intset -= mask;
|
intset -= mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
esp_in_isr = false;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
387
lwip/sys_arch.c
387
lwip/sys_arch.c
|
@ -49,10 +49,18 @@
|
||||||
#include "lwip/mem.h"
|
#include "lwip/mem.h"
|
||||||
#include "lwip/stats.h"
|
#include "lwip/stats.h"
|
||||||
|
|
||||||
/* Very crude mechanism used to determine if the critical section handling
|
extern bool esp_in_isr;
|
||||||
functions are being called from an interrupt context or not. This relies on
|
|
||||||
the interrupt handler setting this variable manually. */
|
/* Based on the default xInsideISR mechanism to determine
|
||||||
portBASE_TYPE xInsideISR = pdFALSE;
|
if an ISR is running.
|
||||||
|
|
||||||
|
Doesn't support the possibility that LWIP functions are called from the NMI
|
||||||
|
handler (none are called from NMI when using current/SDK implementation.)
|
||||||
|
*/
|
||||||
|
static inline bool is_inside_isr()
|
||||||
|
{
|
||||||
|
return esp_in_isr;
|
||||||
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
* Routine: sys_mbox_new
|
* Routine: sys_mbox_new
|
||||||
|
@ -66,17 +74,17 @@ portBASE_TYPE xInsideISR = pdFALSE;
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
err_t sys_mbox_new( sys_mbox_t *pxMailBox, int iSize )
|
err_t sys_mbox_new( sys_mbox_t *pxMailBox, int iSize )
|
||||||
{
|
{
|
||||||
err_t xReturn = ERR_MEM;
|
err_t xReturn = ERR_MEM;
|
||||||
|
|
||||||
*pxMailBox = xQueueCreate( iSize, sizeof( void * ) );
|
*pxMailBox = xQueueCreate( iSize, sizeof( void * ) );
|
||||||
|
|
||||||
if( *pxMailBox != NULL )
|
if( *pxMailBox != NULL )
|
||||||
{
|
{
|
||||||
xReturn = ERR_OK;
|
xReturn = ERR_OK;
|
||||||
SYS_STATS_INC_USED( mbox );
|
SYS_STATS_INC_USED( mbox );
|
||||||
}
|
}
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,21 +104,21 @@ void sys_mbox_free( sys_mbox_t *pxMailBox )
|
||||||
{
|
{
|
||||||
unsigned long ulMessagesWaiting;
|
unsigned long ulMessagesWaiting;
|
||||||
|
|
||||||
ulMessagesWaiting = uxQueueMessagesWaiting( *pxMailBox );
|
ulMessagesWaiting = uxQueueMessagesWaiting( *pxMailBox );
|
||||||
configASSERT( ( ulMessagesWaiting == 0 ) );
|
configASSERT( ( ulMessagesWaiting == 0 ) );
|
||||||
|
|
||||||
#if SYS_STATS
|
#if SYS_STATS
|
||||||
{
|
{
|
||||||
if( ulMessagesWaiting != 0UL )
|
if( ulMessagesWaiting != 0UL )
|
||||||
{
|
{
|
||||||
SYS_STATS_INC( mbox.err );
|
SYS_STATS_INC( mbox.err );
|
||||||
}
|
}
|
||||||
|
|
||||||
SYS_STATS_DEC( mbox.used );
|
SYS_STATS_DEC( mbox.used );
|
||||||
}
|
}
|
||||||
#endif /* SYS_STATS */
|
#endif /* SYS_STATS */
|
||||||
|
|
||||||
vQueueDelete( *pxMailBox );
|
vQueueDelete( *pxMailBox );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
|
@ -124,7 +132,7 @@ unsigned long ulMessagesWaiting;
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void sys_mbox_post( sys_mbox_t *pxMailBox, void *pxMessageToPost )
|
void sys_mbox_post( sys_mbox_t *pxMailBox, void *pxMessageToPost )
|
||||||
{
|
{
|
||||||
while( xQueueSendToBack( *pxMailBox, &pxMessageToPost, portMAX_DELAY ) != pdTRUE );
|
while( xQueueSendToBack( *pxMailBox, &pxMessageToPost, portMAX_DELAY ) != pdTRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
|
@ -145,27 +153,27 @@ err_t sys_mbox_trypost( sys_mbox_t *pxMailBox, void *pxMessageToPost )
|
||||||
err_t xReturn;
|
err_t xReturn;
|
||||||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
if( xInsideISR != pdFALSE )
|
if( is_inside_isr() != pdFALSE )
|
||||||
{
|
{
|
||||||
xReturn = xQueueSendFromISR( *pxMailBox, &pxMessageToPost, &xHigherPriorityTaskWoken );
|
xReturn = xQueueSendFromISR( *pxMailBox, &pxMessageToPost, &xHigherPriorityTaskWoken );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xReturn = xQueueSend( *pxMailBox, &pxMessageToPost, ( portTickType ) 0 );
|
xReturn = xQueueSend( *pxMailBox, &pxMessageToPost, ( portTickType ) 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( xReturn == pdPASS )
|
if( xReturn == pdPASS )
|
||||||
{
|
{
|
||||||
xReturn = ERR_OK;
|
xReturn = ERR_OK;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* The queue was already full. */
|
/* The queue was already full. */
|
||||||
xReturn = ERR_MEM;
|
xReturn = ERR_MEM;
|
||||||
SYS_STATS_INC( mbox.err );
|
SYS_STATS_INC( mbox.err );
|
||||||
}
|
}
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
|
@ -199,46 +207,46 @@ void *pvDummy;
|
||||||
portTickType xStartTime, xEndTime, xElapsed;
|
portTickType xStartTime, xEndTime, xElapsed;
|
||||||
unsigned long ulReturn;
|
unsigned long ulReturn;
|
||||||
|
|
||||||
xStartTime = xTaskGetTickCount();
|
xStartTime = xTaskGetTickCount();
|
||||||
|
|
||||||
if( NULL == ppvBuffer )
|
if( NULL == ppvBuffer )
|
||||||
{
|
{
|
||||||
ppvBuffer = &pvDummy;
|
ppvBuffer = &pvDummy;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ulTimeOut != 0UL )
|
if( ulTimeOut != 0UL )
|
||||||
{
|
{
|
||||||
configASSERT( xInsideISR == ( portBASE_TYPE ) 0 );
|
configASSERT( is_inside_isr() == ( portBASE_TYPE ) 0 );
|
||||||
|
|
||||||
if( pdTRUE == xQueueReceive( *pxMailBox, &( *ppvBuffer ), ulTimeOut/ portTICK_RATE_MS ) )
|
if( pdTRUE == xQueueReceive( *pxMailBox, &( *ppvBuffer ), ulTimeOut/ portTICK_RATE_MS ) )
|
||||||
{
|
{
|
||||||
xEndTime = xTaskGetTickCount();
|
xEndTime = xTaskGetTickCount();
|
||||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;
|
xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;
|
||||||
|
|
||||||
ulReturn = xElapsed;
|
ulReturn = xElapsed;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Timed out. */
|
/* Timed out. */
|
||||||
*ppvBuffer = NULL;
|
*ppvBuffer = NULL;
|
||||||
ulReturn = SYS_ARCH_TIMEOUT;
|
ulReturn = SYS_ARCH_TIMEOUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while( pdTRUE != xQueueReceive( *pxMailBox, &( *ppvBuffer ), portMAX_DELAY ) );
|
while( pdTRUE != xQueueReceive( *pxMailBox, &( *ppvBuffer ), portMAX_DELAY ) );
|
||||||
xEndTime = xTaskGetTickCount();
|
xEndTime = xTaskGetTickCount();
|
||||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;
|
xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;
|
||||||
|
|
||||||
if( xElapsed == 0UL )
|
if( xElapsed == 0UL )
|
||||||
{
|
{
|
||||||
xElapsed = 1UL;
|
xElapsed = 1UL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ulReturn = xElapsed;
|
ulReturn = xElapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ulReturn;
|
return ulReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
|
@ -262,30 +270,30 @@ unsigned long ulReturn;
|
||||||
long lResult;
|
long lResult;
|
||||||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
if( ppvBuffer== NULL )
|
if( ppvBuffer== NULL )
|
||||||
{
|
{
|
||||||
ppvBuffer = &pvDummy;
|
ppvBuffer = &pvDummy;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( xInsideISR != pdFALSE )
|
if( is_inside_isr() != pdFALSE )
|
||||||
{
|
{
|
||||||
lResult = xQueueReceiveFromISR( *pxMailBox, &( *ppvBuffer ), &xHigherPriorityTaskWoken );
|
lResult = xQueueReceiveFromISR( *pxMailBox, &( *ppvBuffer ), &xHigherPriorityTaskWoken );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lResult = xQueueReceive( *pxMailBox, &( *ppvBuffer ), 0UL );
|
lResult = xQueueReceive( *pxMailBox, &( *ppvBuffer ), 0UL );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( lResult == pdPASS )
|
if( lResult == pdPASS )
|
||||||
{
|
{
|
||||||
ulReturn = ERR_OK;
|
ulReturn = ERR_OK;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ulReturn = SYS_MBOX_EMPTY;
|
ulReturn = SYS_MBOX_EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ulReturn;
|
return ulReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
|
@ -305,24 +313,24 @@ err_t sys_sem_new( sys_sem_t *pxSemaphore, u8_t ucCount )
|
||||||
{
|
{
|
||||||
err_t xReturn = ERR_MEM;
|
err_t xReturn = ERR_MEM;
|
||||||
|
|
||||||
vSemaphoreCreateBinary( ( *pxSemaphore ) );
|
vSemaphoreCreateBinary( ( *pxSemaphore ) );
|
||||||
|
|
||||||
if( *pxSemaphore != NULL )
|
if( *pxSemaphore != NULL )
|
||||||
{
|
{
|
||||||
if( ucCount == 0U )
|
if( ucCount == 0U )
|
||||||
{
|
{
|
||||||
xSemaphoreTake( *pxSemaphore, 1UL );
|
xSemaphoreTake( *pxSemaphore, 1UL );
|
||||||
}
|
}
|
||||||
|
|
||||||
xReturn = ERR_OK;
|
xReturn = ERR_OK;
|
||||||
SYS_STATS_INC_USED( sem );
|
SYS_STATS_INC_USED( sem );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SYS_STATS_INC( sem.err );
|
SYS_STATS_INC( sem.err );
|
||||||
}
|
}
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
|
@ -353,36 +361,36 @@ u32_t sys_arch_sem_wait( sys_sem_t *pxSemaphore, u32_t ulTimeout )
|
||||||
portTickType xStartTime, xEndTime, xElapsed;
|
portTickType xStartTime, xEndTime, xElapsed;
|
||||||
unsigned long ulReturn;
|
unsigned long ulReturn;
|
||||||
|
|
||||||
xStartTime = xTaskGetTickCount();
|
xStartTime = xTaskGetTickCount();
|
||||||
|
|
||||||
if( ulTimeout != 0UL )
|
if( ulTimeout != 0UL )
|
||||||
{
|
{
|
||||||
if( xSemaphoreTake( *pxSemaphore, ulTimeout / portTICK_RATE_MS ) == pdTRUE )
|
if( xSemaphoreTake( *pxSemaphore, ulTimeout / portTICK_RATE_MS ) == pdTRUE )
|
||||||
{
|
{
|
||||||
xEndTime = xTaskGetTickCount();
|
xEndTime = xTaskGetTickCount();
|
||||||
xElapsed = (xEndTime - xStartTime) * portTICK_RATE_MS;
|
xElapsed = (xEndTime - xStartTime) * portTICK_RATE_MS;
|
||||||
ulReturn = xElapsed;
|
ulReturn = xElapsed;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ulReturn = SYS_ARCH_TIMEOUT;
|
ulReturn = SYS_ARCH_TIMEOUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while( xSemaphoreTake( *pxSemaphore, portMAX_DELAY ) != pdTRUE );
|
while( xSemaphoreTake( *pxSemaphore, portMAX_DELAY ) != pdTRUE );
|
||||||
xEndTime = xTaskGetTickCount();
|
xEndTime = xTaskGetTickCount();
|
||||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;
|
xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;
|
||||||
|
|
||||||
if( xElapsed == 0UL )
|
if( xElapsed == 0UL )
|
||||||
{
|
{
|
||||||
xElapsed = 1UL;
|
xElapsed = 1UL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ulReturn = xElapsed;
|
ulReturn = xElapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ulReturn;
|
return ulReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Create a new mutex
|
/** Create a new mutex
|
||||||
|
@ -392,33 +400,33 @@ err_t sys_mutex_new( sys_mutex_t *pxMutex )
|
||||||
{
|
{
|
||||||
err_t xReturn = ERR_MEM;
|
err_t xReturn = ERR_MEM;
|
||||||
|
|
||||||
*pxMutex = xSemaphoreCreateMutex();
|
*pxMutex = xSemaphoreCreateMutex();
|
||||||
|
|
||||||
if( *pxMutex != NULL )
|
if( *pxMutex != NULL )
|
||||||
{
|
{
|
||||||
xReturn = ERR_OK;
|
xReturn = ERR_OK;
|
||||||
SYS_STATS_INC_USED( mutex );
|
SYS_STATS_INC_USED( mutex );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SYS_STATS_INC( mutex.err );
|
SYS_STATS_INC( mutex.err );
|
||||||
}
|
}
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Lock a mutex
|
/** Lock a mutex
|
||||||
* @param mutex the mutex to lock */
|
* @param mutex the mutex to lock */
|
||||||
void sys_mutex_lock( sys_mutex_t *pxMutex )
|
void sys_mutex_lock( sys_mutex_t *pxMutex )
|
||||||
{
|
{
|
||||||
while( xSemaphoreTake( *pxMutex, portMAX_DELAY ) != pdPASS );
|
while( xSemaphoreTake( *pxMutex, portMAX_DELAY ) != pdPASS );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Unlock a mutex
|
/** Unlock a mutex
|
||||||
* @param mutex the mutex to unlock */
|
* @param mutex the mutex to unlock */
|
||||||
void sys_mutex_unlock(sys_mutex_t *pxMutex )
|
void sys_mutex_unlock(sys_mutex_t *pxMutex )
|
||||||
{
|
{
|
||||||
xSemaphoreGive( *pxMutex );
|
xSemaphoreGive( *pxMutex );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -426,8 +434,8 @@ void sys_mutex_unlock(sys_mutex_t *pxMutex )
|
||||||
* @param mutex the mutex to delete */
|
* @param mutex the mutex to delete */
|
||||||
void sys_mutex_free( sys_mutex_t *pxMutex )
|
void sys_mutex_free( sys_mutex_t *pxMutex )
|
||||||
{
|
{
|
||||||
SYS_STATS_DEC( mutex.used );
|
SYS_STATS_DEC( mutex.used );
|
||||||
vQueueDelete( *pxMutex );
|
vQueueDelete( *pxMutex );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -443,14 +451,14 @@ void sys_sem_signal( sys_sem_t *pxSemaphore )
|
||||||
{
|
{
|
||||||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
if( xInsideISR != pdFALSE )
|
if( is_inside_isr() != pdFALSE )
|
||||||
{
|
{
|
||||||
xSemaphoreGiveFromISR( *pxSemaphore, &xHigherPriorityTaskWoken );
|
xSemaphoreGiveFromISR( *pxSemaphore, &xHigherPriorityTaskWoken );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xSemaphoreGive( *pxSemaphore );
|
xSemaphoreGive( *pxSemaphore );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
|
@ -463,8 +471,8 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void sys_sem_free( sys_sem_t *pxSemaphore )
|
void sys_sem_free( sys_sem_t *pxSemaphore )
|
||||||
{
|
{
|
||||||
SYS_STATS_DEC(sem.used);
|
SYS_STATS_DEC(sem.used);
|
||||||
vQueueDelete( *pxSemaphore );
|
vQueueDelete( *pxSemaphore );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
|
@ -479,7 +487,7 @@ void sys_init(void)
|
||||||
|
|
||||||
u32_t sys_now(void)
|
u32_t sys_now(void)
|
||||||
{
|
{
|
||||||
return xTaskGetTickCount();
|
return xTaskGetTickCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
|
@ -506,18 +514,18 @@ xTaskHandle xCreatedTask;
|
||||||
portBASE_TYPE xResult;
|
portBASE_TYPE xResult;
|
||||||
sys_thread_t xReturn;
|
sys_thread_t xReturn;
|
||||||
|
|
||||||
xResult = xTaskCreate( pxThread, ( signed char * ) pcName, iStackSize, pvArg, iPriority, &xCreatedTask );
|
xResult = xTaskCreate( pxThread, ( signed char * ) pcName, iStackSize, pvArg, iPriority, &xCreatedTask );
|
||||||
|
|
||||||
if( xResult == pdPASS )
|
if( xResult == pdPASS )
|
||||||
{
|
{
|
||||||
xReturn = xCreatedTask;
|
xReturn = xCreatedTask;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xReturn = NULL;
|
xReturn = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
|
@ -541,11 +549,11 @@ sys_thread_t xReturn;
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
sys_prot_t sys_arch_protect( void )
|
sys_prot_t sys_arch_protect( void )
|
||||||
{
|
{
|
||||||
if( xInsideISR == pdFALSE )
|
if( is_inside_isr() == pdFALSE )
|
||||||
{
|
{
|
||||||
taskENTER_CRITICAL();
|
taskENTER_CRITICAL();
|
||||||
}
|
}
|
||||||
return ( sys_prot_t ) 1;
|
return ( sys_prot_t ) 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*
|
/*---------------------------------------------------------------------------*
|
||||||
|
@ -561,11 +569,11 @@ sys_prot_t sys_arch_protect( void )
|
||||||
*---------------------------------------------------------------------------*/
|
*---------------------------------------------------------------------------*/
|
||||||
void sys_arch_unprotect( sys_prot_t xValue )
|
void sys_arch_unprotect( sys_prot_t xValue )
|
||||||
{
|
{
|
||||||
(void) xValue;
|
(void) xValue;
|
||||||
if( xInsideISR == pdFALSE )
|
if( is_inside_isr() == pdFALSE )
|
||||||
{
|
{
|
||||||
taskEXIT_CRITICAL();
|
taskEXIT_CRITICAL();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -573,13 +581,12 @@ void sys_arch_unprotect( sys_prot_t xValue )
|
||||||
*/
|
*/
|
||||||
void sys_assert( const char *pcMessage )
|
void sys_assert( const char *pcMessage )
|
||||||
{
|
{
|
||||||
(void) pcMessage;
|
(void) pcMessage;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*-------------------------------------------------------------------------*
|
/*-------------------------------------------------------------------------*
|
||||||
* End of File: sys_arch.c
|
* End of File: sys_arch.c
|
||||||
*-------------------------------------------------------------------------*/
|
*-------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue