Skip to content

Commit

Permalink
DriverSAM/NetworkInterface.c warning cleanup - purely refactoring (#1016
Browse files Browse the repository at this point in the history
)

* warning cleanup - purely refactoring

* Incorporated PR feedback
- Made vCheckBuffersAndQueue() static
- Added uxLowestSemCount back into prvEMACHandlerTask, now modifying global instead of shadowing

* Uncrustify: triggered by comment.

* Fix formatting

* Uncrustify: triggered by comment.

* Un-doing uncrustify commit that breaks formatting rules

* formatting fix

* formatting fix

---------

Co-authored-by: Soren Ptak <[email protected]>
Co-authored-by: GitHub Action <[email protected]>
Co-authored-by: Rahul Kar <[email protected]>
  • Loading branch information
4 people authored Sep 7, 2023
1 parent f590724 commit a91c311
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions source/portable/NetworkInterface/DriverSAM/NetworkInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,17 @@ static void hand_tx_errors( void );
static uint16_t prvGenerateCRC16( const uint8_t * pucAddress );
static void prvAddMulticastMACAddress( const uint8_t * ucMacAddress );

/* Checks IP queue, buffers, and semaphore and logs diagnostic info if configured */
static void vCheckBuffersAndQueue( void );

/* return 'puc_buffer' to the pool of transmission buffers. */
void returnTxBuffer( uint8_t * puc_buffer );

/*-----------------------------------------------------------*/

/* A copy of PHY register 1: 'PHY_REG_01_BMSR' */
static BaseType_t xGMACSwitchRequired;

/* LLMNR multicast address. */
static const uint8_t llmnr_mac_address[] = { 0x01, 0x00, 0x5E, 0x00, 0x00, 0xFC };

/* The GMAC object as defined by the ASF drivers. */
static gmac_device_t gs_gmac_dev;

Expand Down Expand Up @@ -454,8 +457,6 @@ static BaseType_t xPHY_Write( BaseType_t xAddress,

static BaseType_t prvSAM_NetworkInterfaceInitialise( NetworkInterface_t * pxInterface )
{
const TickType_t x5_Seconds = 5000UL;

if( xEMACTaskHandle == NULL )
{
prvGMACInit( pxInterface );
Expand Down Expand Up @@ -673,9 +674,7 @@ static BaseType_t prvSAM_NetworkInterfaceOutput( NetworkInterface_t * pxInterfac

static BaseType_t prvGMACInit( NetworkInterface_t * pxInterface )
{
uint32_t ncfgr;
NetworkEndPoint_t * pxEndPoint;
BaseType_t xEntry = 1;

gmac_options_t gmac_option;

Expand Down Expand Up @@ -1065,7 +1064,7 @@ volatile UBaseType_t uxLastMinBufferCount = 0;
volatile UBaseType_t uxCurrentSemCount;
volatile UBaseType_t uxLowestSemCount;

void vCheckBuffersAndQueue( void )
static void vCheckBuffersAndQueue( void )
{
static UBaseType_t uxCurrentCount;

Expand Down Expand Up @@ -1126,14 +1125,14 @@ void vNetworkInterfaceAllocateRAMToBuffers( NetworkBufferDescriptor_t pxNetworkB
static void prvEMACHandlerTask( void * pvParameters )
{
UBaseType_t uxCount;
UBaseType_t uxLowestSemCount = GMAC_TX_BUFFERS + 1;

uxLowestSemCount = GMAC_TX_BUFFERS + 1;

#if ( ipconfigZERO_COPY_TX_DRIVER != 0 )
NetworkBufferDescriptor_t * pxBuffer;
#endif
uint8_t * pucBuffer;
BaseType_t xResult = 0;
uint32_t xStatus;
const TickType_t ulMaxBlockTime = pdMS_TO_TICKS( EMAC_MAX_BLOCK_TIME_MS );
uint32_t ulISREvents = 0U;

Expand Down

0 comments on commit a91c311

Please sign in to comment.