forked from gatsby/df_datalink
fix: 修复RFSoC Timer不正常运行的问题; 暂时修改Z7的FPGA温度回读
This commit is contained in:
+18
-3
@@ -427,9 +427,24 @@ void AppTimer_IntrHandler(void *context)
|
|||||||
{
|
{
|
||||||
Phy_UpdateLogging(phyInstPtr);
|
Phy_UpdateLogging(phyInstPtr);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* Read the new Control/Status Register content.
|
||||||
|
*/
|
||||||
|
uint32_t ControlStatusReg;
|
||||||
|
ControlStatusReg = XTmrCtr_ReadReg(((XTmrCtr *)xdesc->instance)->BaseAddress,
|
||||||
|
0, XTC_TCSR_OFFSET);
|
||||||
|
/*
|
||||||
|
* Acknowledge the interrupt by clearing the
|
||||||
|
* interrupt bit in the timer control status
|
||||||
|
* register, this is done after calling the
|
||||||
|
* handler so the application could call
|
||||||
|
* IsExpired, the interrupt is cleared by
|
||||||
|
* writing a 1 to the interrupt bit of the
|
||||||
|
* register without changing any of the other
|
||||||
|
* bits
|
||||||
|
*/
|
||||||
XTmrCtr_WriteReg(((XTmrCtr *)xdesc->instance)->BaseAddress, 0,
|
XTmrCtr_WriteReg(((XTmrCtr *)xdesc->instance)->BaseAddress, 0,
|
||||||
XTC_TCSR_OFFSET, XTC_CSR_INT_OCCURED_MASK);
|
XTC_TCSR_OFFSET, ControlStatusReg | XTC_CSR_INT_OCCURED_MASK);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#error No timer implementation!
|
#error No timer implementation!
|
||||||
@@ -551,7 +566,7 @@ int main(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Start System Monitor logging.
|
// Start System Monitor logging.
|
||||||
timer_start(logTmPtr);
|
Status = timer_start(logTmPtr);
|
||||||
|
|
||||||
DBG_PRINT("Physical started...\n");
|
DBG_PRINT("Physical started...\n");
|
||||||
Phy_Start(phyInstPtr);
|
Phy_Start(phyInstPtr);
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
#include "circ_queue.h"
|
#include "circ_queue.h"
|
||||||
#include "../time_ctrl/time_ctrl.h"
|
#include "../time_ctrl/time_ctrl.h"
|
||||||
#ifndef EMULATION
|
#ifndef EMULATION
|
||||||
#include "../config/app_config.h"
|
#include "../../config/app_config.h"
|
||||||
#endif
|
#endif
|
||||||
/************************** Constant Definitions *****************************/
|
/************************** Constant Definitions *****************************/
|
||||||
#define NET_START_TIME_INFTY UINT32_MAX
|
#define NET_START_TIME_INFTY UINT32_MAX
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
#include "geometry/quaternion.h"
|
#include "geometry/quaternion.h"
|
||||||
#include "../phy_layer/phy_layer.h"
|
#include "../phy_layer/phy_layer.h"
|
||||||
#ifndef EMULATION
|
#ifndef EMULATION
|
||||||
#include "../config/app_config.h"
|
#include "../../config/app_config.h"
|
||||||
#endif
|
#endif
|
||||||
/************************** Constant Definitions *****************************/
|
/************************** Constant Definitions *****************************/
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "circ_queue.h"
|
#include "circ_queue.h"
|
||||||
#ifndef EMULATION
|
#ifndef EMULATION
|
||||||
#include "../config/app_config.h"
|
#include "../../config/app_config.h"
|
||||||
#endif
|
#endif
|
||||||
/************************** Constant Definitions *****************************/
|
/************************** Constant Definitions *****************************/
|
||||||
/***************** Macros (Inline Functions) Definitions *********************/
|
/***************** Macros (Inline Functions) Definitions *********************/
|
||||||
|
|||||||
@@ -1069,7 +1069,6 @@ void Phy_RefreshHwSate(PHY_INST *instPtr)
|
|||||||
: ((evalData < TEMPERATURE_MIN) ? INT8_MIN : (int8_t)round(evalData / TEMPERATURE_LSB));
|
: ((evalData < TEMPERATURE_MIN) ? INT8_MIN : (int8_t)round(evalData / TEMPERATURE_LSB));
|
||||||
// FIXME: XADC range needs further refine
|
// FIXME: XADC range needs further refine
|
||||||
instPtr->hwSate.spFpgaVolt = (VOLT_PS_OK | VOLT_PSAUX_OK | VOLT_DDR_OK | VOLT_PL_OK | VOLT_PLAUX_OK | VOLT_BRAM_OK);
|
instPtr->hwSate.spFpgaVolt = (VOLT_PS_OK | VOLT_PSAUX_OK | VOLT_DDR_OK | VOLT_PL_OK | VOLT_PLAUX_OK | VOLT_BRAM_OK);
|
||||||
instPtr->hwSate.spClkState = (CLK_SP_PLL1_LOCK | CLK_SP_PLL2_LOCK);
|
|
||||||
instPtr->hwSate.isSpOk = (instPtr->hwSate.spFpgaVolt == (VOLT_PS_OK | VOLT_PSAUX_OK | VOLT_DDR_OK | VOLT_PL_OK | VOLT_PLAUX_OK | VOLT_BRAM_OK))
|
instPtr->hwSate.isSpOk = (instPtr->hwSate.spFpgaVolt == (VOLT_PS_OK | VOLT_PSAUX_OK | VOLT_DDR_OK | VOLT_PL_OK | VOLT_PLAUX_OK | VOLT_BRAM_OK))
|
||||||
&& (instPtr->hwSate.spClkState == (CLK_SP_PLL1_LOCK | CLK_SP_PLL2_LOCK));
|
&& (instPtr->hwSate.spClkState == (CLK_SP_PLL1_LOCK | CLK_SP_PLL2_LOCK));
|
||||||
#else
|
#else
|
||||||
@@ -1149,10 +1148,11 @@ void Phy_RefreshHwSate(PHY_INST *instPtr)
|
|||||||
// -- Update FPGA Chip temperature, unit 1 deg
|
// -- Update FPGA Chip temperature, unit 1 deg
|
||||||
rawData = XAdcPs_GetAdcData(&(instPtr->hwXadc), XADCPS_CH_TEMP);
|
rawData = XAdcPs_GetAdcData(&(instPtr->hwXadc), XADCPS_CH_TEMP);
|
||||||
evalData = XAdcPs_RawToTemperature(rawData);
|
evalData = XAdcPs_RawToTemperature(rawData);
|
||||||
instPtr->hwSate.spFpgaTemp = (evalData > TEMPERATURE_MAX)
|
// instPtr->hwSate.spFpgaTemp = (evalData > TEMPERATURE_MAX)
|
||||||
? INT8_MAX
|
// ? INT8_MAX
|
||||||
: ((evalData < TEMPERATURE_MIN) ? INT8_MIN : (int8_t)round(evalData / TEMPERATURE_LSB));
|
// : ((evalData < TEMPERATURE_MIN) ? INT8_MIN : (int8_t)round(evalData / TEMPERATURE_LSB));
|
||||||
// FIXME: XADC readback is required
|
// FIXME: XADC readback is required
|
||||||
|
instPtr->hwSate.spFpgaTemp = ((instPtr->hwSate.spAdTemp_0 - 5) + (instPtr->hwSate.spAdTemp_1 - 7)) / 2;
|
||||||
instPtr->hwSate.spFpgaVolt = (VOLT_PS_OK | VOLT_PSAUX_OK | VOLT_DDR_OK | VOLT_PL_OK | VOLT_PLAUX_OK | VOLT_BRAM_OK);
|
instPtr->hwSate.spFpgaVolt = (VOLT_PS_OK | VOLT_PSAUX_OK | VOLT_DDR_OK | VOLT_PL_OK | VOLT_PLAUX_OK | VOLT_BRAM_OK);
|
||||||
instPtr->hwSate.isSpOk = (instPtr->hwSate.spFpgaVolt == (VOLT_PS_OK | VOLT_PSAUX_OK | VOLT_DDR_OK | VOLT_PL_OK | VOLT_PLAUX_OK | VOLT_BRAM_OK))
|
instPtr->hwSate.isSpOk = (instPtr->hwSate.spFpgaVolt == (VOLT_PS_OK | VOLT_PSAUX_OK | VOLT_DDR_OK | VOLT_PL_OK | VOLT_PLAUX_OK | VOLT_BRAM_OK))
|
||||||
&& (instPtr->hwSate.spClkState == (CLK_SP_PLL1_LOCK | CLK_SP_PLL2_LOCK))
|
&& (instPtr->hwSate.spClkState == (CLK_SP_PLL1_LOCK | CLK_SP_PLL2_LOCK))
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include "common.h"
|
#include "common.h"
|
||||||
#ifndef EMULATION
|
#ifndef EMULATION
|
||||||
#include "xbram.h"
|
#include "xbram.h"
|
||||||
#include "../config/app_config.h"
|
#include "../../config/app_config.h"
|
||||||
#ifdef HSJL_GE // Zynq MPSoC (Zynq UltraScale+)
|
#ifdef HSJL_GE // Zynq MPSoC (Zynq UltraScale+)
|
||||||
#include "xsysmon.h"
|
#include "xsysmon.h"
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user