From 3dedebbe7995579fa2783310604432ebe987390e Mon Sep 17 00:00:00 2001 From: Gatsby Van Date: Sat, 2 Mar 2024 16:32:12 +0800 Subject: [PATCH] miscellaneous update --- df_datalink_sp/src/networking/link_layer/node_list.c | 4 ++++ df_datalink_sp/src/networking/phy_layer/phy_layer.c | 4 +++- df_datalink_sp/src/networking/phy_layer/phy_layer.h | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/df_datalink_sp/src/networking/link_layer/node_list.c b/df_datalink_sp/src/networking/link_layer/node_list.c index 1a5c0ae..d40f251 100644 --- a/df_datalink_sp/src/networking/link_layer/node_list.c +++ b/df_datalink_sp/src/networking/link_layer/node_list.c @@ -130,6 +130,10 @@ void L2_NodeList_Destroy(NODE_LIST *list) NODE_ENTRY *L2_GetNodeById(NODE_LIST *list, uint8_t nodeId) { ASSERT(list != NULL); + if (nodeId == L2_BROADCAST_ID || nodeId == L2_NONE_ID) + { + return NULL; + } util_entry.nodeInfo.nodeId = nodeId; clist_node_t *node = clist_find(list, &util_entry); if (node == NULL) diff --git a/df_datalink_sp/src/networking/phy_layer/phy_layer.c b/df_datalink_sp/src/networking/phy_layer/phy_layer.c index c71e205..66ee274 100644 --- a/df_datalink_sp/src/networking/phy_layer/phy_layer.c +++ b/df_datalink_sp/src/networking/phy_layer/phy_layer.c @@ -308,6 +308,8 @@ void Phy_UpdateState(PHY_INST *instPtr) { instPtr->isValid = false; } + + // Logging instPtr->recvSlotTime.int_part = PhyRead(instPtr, TM_TARGET_H); instPtr->recvSlotTime.frac_part = PhyRead(instPtr, TM_TARGET_L); instPtr->recvFsTime.int_part = PhyRead(instPtr, FSTIME_H); @@ -334,7 +336,7 @@ void Phy_UpdateState(PHY_INST *instPtr) instPtr->phyLog.fsyncFreqCh = (PhyRead(instPtr, PHY_FRAME_SYNC_FREQEST) & PHY_FRAME_SYNC_FREQEST_CHANNEL_MASK) >> PHY_FRAME_SYNC_FREQEST_CHANNEL_SHIFT; instPtr->phyLog.deintlvAmpEst = PhyRead(instPtr, PHY_DEINTLV_AMPEST) & PHY_DEINTLV_AMPEST_MASK; memset(instPtr->phyLog.reserve, 0x00, sizeof(instPtr->phyLog.reserve)); - + // Sync logs to system monitor SysMonitor_UpdatePhysicalLayerLog(&(instPtr->phyLog)); } diff --git a/df_datalink_sp/src/networking/phy_layer/phy_layer.h b/df_datalink_sp/src/networking/phy_layer/phy_layer.h index 1b8667c..0357883 100644 --- a/df_datalink_sp/src/networking/phy_layer/phy_layer.h +++ b/df_datalink_sp/src/networking/phy_layer/phy_layer.h @@ -30,6 +30,7 @@ #ifndef EMULATION #include "xbram.h" #include "xadcps.h" +#include "../config/app_config.h" #endif #include "../../system_monitor.h" #include "../../time_ctrl/time_ctrl.h"