From f363d3afba1d565a527a9b4d9f06a74f3e6b8e86 Mon Sep 17 00:00:00 2001 From: bit-cyber-fh <3120225656@bit.edu.cn> Date: Tue, 2 Apr 2024 00:05:54 +0800 Subject: [PATCH] misc update --- df_datalink_ge/src/main.c | 2 -- df_datalink_sp/src/include/circ_queue.h | 12 ++++-------- df_datalink_sp/src/main.c | 4 +--- .../src/networking/link_layer/link_layer.c | 3 +-- .../src/networking/link_layer/link_layer.h | 2 -- df_datalink_sp/src/networking/link_layer/node_list.c | 4 ++++ df_datalink_sp/src/systembus/systembus.c | 1 + df_datalink_sp/src/systembus/systembus.h | 4 ++-- df_datalink_sp/src/systembus/systembus_uart.c | 1 + 9 files changed, 14 insertions(+), 19 deletions(-) diff --git a/df_datalink_ge/src/main.c b/df_datalink_ge/src/main.c index e7174a9..e15bc33 100644 --- a/df_datalink_ge/src/main.c +++ b/df_datalink_ge/src/main.c @@ -88,7 +88,6 @@ L2_CONFIG linkConfig = .clustId = 1, .myId = 1, .headId = 1, - .bkpHeadId = 0, .netScale = 2, .phyInstPtr = NULL, // physical layer reference .tmcInstPtr = NULL @@ -99,7 +98,6 @@ L2_CONFIG linkConfig = // .clustId = 1, // .myId = 2, // .headId = 1, -// .bkpHeadId = 0, // .netScale = 2, // .phyInstPtr = NULL, // physical layer reference // .tmcInstPtr = NULL diff --git a/df_datalink_sp/src/include/circ_queue.h b/df_datalink_sp/src/include/circ_queue.h index d4e7308..684dc58 100644 --- a/df_datalink_sp/src/include/circ_queue.h +++ b/df_datalink_sp/src/include/circ_queue.h @@ -45,13 +45,11 @@ typedef struct * @brief create a FIFO queue * @param queue The new queue * @param queue_capacity maximum size of the queue - * @param a pool to allocate queue from */ bool CircQueueCreate(CIRC_QUEUE **queue, uint32_t queue_capacity); /** * @brief free queue memory -- call after destroy - * @note we do not free in destroy() to follow pthreads convention */ void CircQueueFree(CIRC_QUEUE *queue); @@ -72,9 +70,8 @@ bool isCircQueueEmpty(CIRC_QUEUE *queue); * * @param queue the queue * @param data the data - * @return RPA_EINTR the blocking was interrupted (try again) - * @return RPA_EOF the queue has been terminated - * @return RPA_SUCCESS on a successful push + * @return True on a successful push + * @return False push failed */ bool CircQueuePush(CIRC_QUEUE *queue, void *data); @@ -83,9 +80,8 @@ bool CircQueuePush(CIRC_QUEUE *queue, void *data); * * @param queue the queue * @param data the data - * @return RPA_EINTR the blocking was interrupted (try again) - * @return RPA_EOF if the queue has been terminated - * @return RPA_SUCCESS on a successful pop + * @return false pop failed + * @return true on a successful pop */ bool CircQueuePop(CIRC_QUEUE *queue, void **data); diff --git a/df_datalink_sp/src/main.c b/df_datalink_sp/src/main.c index 9b37c28..32817e0 100644 --- a/df_datalink_sp/src/main.c +++ b/df_datalink_sp/src/main.c @@ -75,7 +75,6 @@ L2_CONFIG linkConfig = { .clustId = 1, .myId = 1, .headId = 1, - .bkpHeadId = 0, .netScale = 2, .phyInstPtr = NULL, // physical layer reference .tmcInstPtr = NULL @@ -86,14 +85,13 @@ L2_CONFIG linkConfig = { // .clustId = 1, // .myId = 2, // .headId = 1, -// .bkpHeadId = 0, // .netScale = 2, // .phyInstPtr = NULL, // physical layer reference // .tmcInstPtr = NULL // }; static PHY_CONFIG phyConfig = { - .devId = 0, + .devId = PHY_DEVICE_ID, .baseAddr = PHY_BASEADDR, .antBramId = PHY_ANTCONFIG_BRAM_DEVICE_ID, .antInfoBramId = PHY_ANTINFO_BRAM_DEVICE_ID, diff --git a/df_datalink_sp/src/networking/link_layer/link_layer.c b/df_datalink_sp/src/networking/link_layer/link_layer.c index 6053060..5c44ba9 100644 --- a/df_datalink_sp/src/networking/link_layer/link_layer.c +++ b/df_datalink_sp/src/networking/link_layer/link_layer.c @@ -1146,8 +1146,7 @@ int32_t L2_SteerBeam2Node(L2_INST *instPtr, uint8_t nodeId) * @param txrxMode tx/rx state for next slot * @param frameType frame type of next slot. * - * @return Corresponding frame length - * L2_FRAME_NONE_LEN if the frame type code cannot be recognized. + * @return SUCCESS/FAILURE * ******************************************************************************/ int32_t L2_SetupNextSlot(L2_INST *instPtr, L2_TOR_TYPE txrxMode, L2_FRAME_TYPE frameType) diff --git a/df_datalink_sp/src/networking/link_layer/link_layer.h b/df_datalink_sp/src/networking/link_layer/link_layer.h index 7df9fcc..15b80bd 100644 --- a/df_datalink_sp/src/networking/link_layer/link_layer.h +++ b/df_datalink_sp/src/networking/link_layer/link_layer.h @@ -39,11 +39,9 @@ typedef struct { L2_NODE_TYPE myType; ///< node type - bool isInterHead; ///< indicate if node is head node uint8_t clustId; ///< node cluster id uint8_t myId; ///< node id uint8_t headId; ///< head node id - uint8_t bkpHeadId; ///< backup head id uint8_t netScale; ///< net scale PHY_INST *phyInstPtr; ///< pointer to system physical layer instance TMC_INST *tmcInstPtr; ///< pointer to system timer controller layer instance 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 ecf6810..9ae9bfb 100644 --- a/df_datalink_sp/src/networking/link_layer/node_list.c +++ b/df_datalink_sp/src/networking/link_layer/node_list.c @@ -32,6 +32,10 @@ #include "error.h" /***************** Macros (Inline Functions) Definitions *********************/ +/** + * @brief Get the node list length + * @param list pointer to node list + */ inline uint32_t L2_GetNodeListLen(NODE_LIST *list) { ASSERT(list != NULL); diff --git a/df_datalink_sp/src/systembus/systembus.c b/df_datalink_sp/src/systembus/systembus.c index 524cd66..602d7f9 100644 --- a/df_datalink_sp/src/systembus/systembus.c +++ b/df_datalink_sp/src/systembus/systembus.c @@ -15,6 +15,7 @@ * @addtogroup SystemBus * @{ */ + /***************************** Include Files *********************************/ #include #include diff --git a/df_datalink_sp/src/systembus/systembus.h b/df_datalink_sp/src/systembus/systembus.h index d5eafdc..62b8af5 100644 --- a/df_datalink_sp/src/systembus/systembus.h +++ b/df_datalink_sp/src/systembus/systembus.h @@ -53,8 +53,8 @@ typedef struct SYSBUS_UART *uartInst; ///< physical uart controller instance CIRC_QUEUE *txQueue; ///< tx queue CIRC_QUEUE *rxQueue; ///< rx queue - bool isRxDone; ///< tx done indicator - bool isTxDone; ///< rx done indicator + bool isTxDone; ///< tx done indicator + bool isRxDone; ///< rx done indicator } SYSBUS; /************************** Function Prototypes ******************************/ diff --git a/df_datalink_sp/src/systembus/systembus_uart.c b/df_datalink_sp/src/systembus/systembus_uart.c index 6ea968d..e9bb943 100644 --- a/df_datalink_sp/src/systembus/systembus_uart.c +++ b/df_datalink_sp/src/systembus/systembus_uart.c @@ -10,6 +10,7 @@ * Lab of Communication and Network * ******************************************************************************/ + /** * @addtogroup SystemBus * @{