Skip to content

Commit 308fbb5

Browse files
Fix RX network interface to create task only once
1 parent 07e9985 commit 308fbb5

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

source/portable/NetworkInterface/RX/NetworkInterface.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ typedef enum
9494
eMACFailed, /* Initialisation failed. */
9595
} eMAC_INIT_STATUS_TYPE;
9696

97-
static TaskHandle_t ether_receive_check_task_handle = 0;
97+
static TaskHandle_t ether_receive_check_task_handle = NULL;
9898
static TaskHandle_t xTaskToNotify = NULL;
9999
static BaseType_t xPHYLinkStatus;
100100
static BaseType_t xReportedStatus;
@@ -448,12 +448,19 @@ static int InitializeNetwork( void )
448448
return pdFALSE;
449449
}
450450

451-
return_code = xTaskCreate( prvEMACDeferredInterruptHandlerTask,
452-
"ETHER_RECEIVE_CHECK_TASK",
453-
512u,
454-
0,
455-
configMAX_PRIORITIES - 1,
456-
&ether_receive_check_task_handle );
451+
if( ether_receive_check_task_handle == NULL )
452+
{
453+
return_code = xTaskCreate( prvEMACDeferredInterruptHandlerTask,
454+
"ETHER_RECEIVE_CHECK_TASK",
455+
512u,
456+
0,
457+
configMAX_PRIORITIES - 1,
458+
&ether_receive_check_task_handle );
459+
}
460+
else
461+
{
462+
return_code = pdTRUE;
463+
}
457464

458465
if( pdFALSE == return_code )
459466
{

0 commit comments

Comments
 (0)