forked from gatsby/df_datalink
update emulation option.
This commit is contained in:
@@ -411,26 +411,6 @@ int32_t Phy_InstInit(PHY_INST **instPtr, PHY_CONFIG *phyConfig)
|
||||
(*instPtr)->antConfigAddr = antConfigBram.Config.MemBaseAddress;
|
||||
(*instPtr)->recvDataAddr = rxDataBram.Config.MemBaseAddress;
|
||||
(*instPtr)->sendDataAddr = txDataBram.Config.MemBaseAddress;
|
||||
#else
|
||||
(*instPtr)->antConfigAddr = (uintptr_t)calloc(L1_ANTCONFIG_MAX_LEN / sizeof(uint64_t), sizeof(uint64_t));
|
||||
if ((*instPtr)->antConfigAddr == (uintptr_t)NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto init_error;
|
||||
}
|
||||
(*instPtr)->recvDataAddr = (uintptr_t)calloc(L1_TXRXDATA_MAX_LEN / sizeof(uint64_t), sizeof(uint64_t));
|
||||
if ((*instPtr)->recvDataAddr == (uintptr_t)NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto init_error;
|
||||
}
|
||||
(*instPtr)->sendDataAddr = (uintptr_t)calloc(L1_TXRXDATA_MAX_LEN / sizeof(uint64_t), sizeof(uint64_t));
|
||||
if ((*instPtr)->sendDataAddr == (uintptr_t)NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto init_error;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Initialize the XAdc driver. */
|
||||
XAdcPs_Config *xadcConfigPtr;
|
||||
@@ -452,6 +432,26 @@ int32_t Phy_InstInit(PHY_INST **instPtr, PHY_CONFIG *phyConfig)
|
||||
|
||||
/* Disable the Channel Sequencer before configuring the Sequence registers. */
|
||||
XAdcPs_SetSequencerMode(&((*instPtr)->hwXadc), XADCPS_SEQ_MODE_SAFE);
|
||||
#else
|
||||
(*instPtr)->antConfigAddr = (uintptr_t)calloc(L1_ANTCONFIG_MAX_LEN / sizeof(uint64_t), sizeof(uint64_t));
|
||||
if ((*instPtr)->antConfigAddr == (uintptr_t)NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto init_error;
|
||||
}
|
||||
(*instPtr)->recvDataAddr = (uintptr_t)calloc(L1_TXRXDATA_MAX_LEN / sizeof(uint64_t), sizeof(uint64_t));
|
||||
if ((*instPtr)->recvDataAddr == (uintptr_t)NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto init_error;
|
||||
}
|
||||
(*instPtr)->sendDataAddr = (uintptr_t)calloc(L1_TXRXDATA_MAX_LEN / sizeof(uint64_t), sizeof(uint64_t));
|
||||
if ((*instPtr)->sendDataAddr == (uintptr_t)NULL)
|
||||
{
|
||||
Status = EDCONF;
|
||||
goto init_error;
|
||||
}
|
||||
#endif
|
||||
|
||||
return SUCCESS;
|
||||
init_error:
|
||||
@@ -1097,7 +1097,7 @@ void Phy_UpdateHwSate(PHY_INST *instPtr)
|
||||
{
|
||||
ASSERT(instPtr != NULL);
|
||||
uint32_t rawData;
|
||||
|
||||
#ifndef EMULATION
|
||||
// -- Update Chip voltage, unit mV
|
||||
rawData = XAdcPs_GetAdcData(&(instPtr->hwXadc), XADCPS_CH_VCCPINT);
|
||||
instPtr->hwSate.spVolt = (uint16_t)(XAdcPs_RawToVoltage(rawData) * 1000);
|
||||
@@ -1108,7 +1108,11 @@ void Phy_UpdateHwSate(PHY_INST *instPtr)
|
||||
|
||||
// FIXME: Chip status determine.
|
||||
instPtr->hwSate.chipSt = 0;
|
||||
|
||||
#else
|
||||
instPtr->hwSate.spVolt = 0;
|
||||
instPtr->hwSate.spTemp = 0;
|
||||
instPtr->hwSate.chipSt = 0;
|
||||
#endif
|
||||
/*** Voltage and Status ***/
|
||||
rawData = PhyRead(instPtr, ANT_STATUS);
|
||||
// -- Update Antenna Status Code: 0xAA - normal, 0x55 - error
|
||||
|
||||
Reference in New Issue
Block a user