Hi,
I’m testing the FREERTOS+TCP implementation with an STM32F407.
I’ve run into the following issue when building with GCC (5.1):
error:
NetworkInterface.cpp:289:1: sorry, unimplemented
: non-trivial designated initializers not supported
};
It turns out to be an issue with using C initializers with C++.
I’ve moved the initializers into the struct definition, remove the const PhyProperties_t xPHYProperties declaration and called the initilizer in vMACBProbePhy. All this seem to have made the compiler happy.
~~~~
typedef struct
PhyPropertiest
{
uint8
t speed;
uint8t mdix;
uint8
t duplex;
uint8t spare;
void intialize()
{
#if( ipconfigETHERNET_AN_ENABLE != 0 )
speed = PHY_SPEED_AUTO;
duplex = PHY_DUPLEX_AUTO;
#else
#if( ipconfigETHERNET_USE_100MB != 0 )
speed = PHY_SPEED_100;
#else
speed = PHY_SPEED_10;
#endif
#if( ipconfigETHERNET_USE_FULL_DUPLEX != 0 )
duplex = PHY_DUPLEX_FULL;
#else
duplex = PHY_DUPLEX_HALF;
#endif
#endif
#if( ipconfigETHERNET_AN_ENABLE != 0 ) && ( ipconfigETHERNET_AUTO_CROSS_ENABLE != 0 )
mdix = PHY_MDIX_AUTO;
#elif( ipconfigETHERNET_CROSSED_LINK != 0 )
mdix = PHY_MDIX_CROSSED;
#else
mdix = PHY_MDIX_DIRECT;
#endif
}
} PhyProperties_t;
~~~~
~~~~
void vMACBProbePhy( void )
{
uint32
t ulPhyControl, ulConfig, ulAdvertise, ulLower, ulUpper, ulMACPhyID, ulValue;
TimeOutt xPhyTime;
TickType_t xRemTime = 0;
/* For local use only: describe the PHY's properties: */
PhyProperties_t xPHYProperties;
xPHYProperties.intialize();
HAL_ETH_ReadPHYRegister(&xETH, PHY_REG_03_PHYSID2, &ulLower);
...
~~~~