misc update

This commit is contained in:
bit-cyber-fh
2024-04-02 00:05:54 +08:00
parent ff4b609a37
commit f363d3afba
9 changed files with 14 additions and 19 deletions
-2
View File
@@ -88,7 +88,6 @@ L2_CONFIG linkConfig =
.clustId = 1, .clustId = 1,
.myId = 1, .myId = 1,
.headId = 1, .headId = 1,
.bkpHeadId = 0,
.netScale = 2, .netScale = 2,
.phyInstPtr = NULL, // physical layer reference .phyInstPtr = NULL, // physical layer reference
.tmcInstPtr = NULL .tmcInstPtr = NULL
@@ -99,7 +98,6 @@ L2_CONFIG linkConfig =
// .clustId = 1, // .clustId = 1,
// .myId = 2, // .myId = 2,
// .headId = 1, // .headId = 1,
// .bkpHeadId = 0,
// .netScale = 2, // .netScale = 2,
// .phyInstPtr = NULL, // physical layer reference // .phyInstPtr = NULL, // physical layer reference
// .tmcInstPtr = NULL // .tmcInstPtr = NULL
+4 -8
View File
@@ -45,13 +45,11 @@ typedef struct
* @brief create a FIFO queue * @brief create a FIFO queue
* @param queue The new queue * @param queue The new queue
* @param queue_capacity maximum size of the 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); bool CircQueueCreate(CIRC_QUEUE **queue, uint32_t queue_capacity);
/** /**
* @brief free queue memory -- call after destroy * @brief free queue memory -- call after destroy
* @note we do not free in destroy() to follow pthreads convention
*/ */
void CircQueueFree(CIRC_QUEUE *queue); void CircQueueFree(CIRC_QUEUE *queue);
@@ -72,9 +70,8 @@ bool isCircQueueEmpty(CIRC_QUEUE *queue);
* *
* @param queue the queue * @param queue the queue
* @param data the data * @param data the data
* @return RPA_EINTR the blocking was interrupted (try again) * @return True on a successful push
* @return RPA_EOF the queue has been terminated * @return False push failed
* @return RPA_SUCCESS on a successful push
*/ */
bool CircQueuePush(CIRC_QUEUE *queue, void *data); bool CircQueuePush(CIRC_QUEUE *queue, void *data);
@@ -83,9 +80,8 @@ bool CircQueuePush(CIRC_QUEUE *queue, void *data);
* *
* @param queue the queue * @param queue the queue
* @param data the data * @param data the data
* @return RPA_EINTR the blocking was interrupted (try again) * @return false pop failed
* @return RPA_EOF if the queue has been terminated * @return true on a successful pop
* @return RPA_SUCCESS on a successful pop
*/ */
bool CircQueuePop(CIRC_QUEUE *queue, void **data); bool CircQueuePop(CIRC_QUEUE *queue, void **data);
+1 -3
View File
@@ -75,7 +75,6 @@ L2_CONFIG linkConfig = {
.clustId = 1, .clustId = 1,
.myId = 1, .myId = 1,
.headId = 1, .headId = 1,
.bkpHeadId = 0,
.netScale = 2, .netScale = 2,
.phyInstPtr = NULL, // physical layer reference .phyInstPtr = NULL, // physical layer reference
.tmcInstPtr = NULL .tmcInstPtr = NULL
@@ -86,14 +85,13 @@ L2_CONFIG linkConfig = {
// .clustId = 1, // .clustId = 1,
// .myId = 2, // .myId = 2,
// .headId = 1, // .headId = 1,
// .bkpHeadId = 0,
// .netScale = 2, // .netScale = 2,
// .phyInstPtr = NULL, // physical layer reference // .phyInstPtr = NULL, // physical layer reference
// .tmcInstPtr = NULL // .tmcInstPtr = NULL
// }; // };
static PHY_CONFIG phyConfig = { static PHY_CONFIG phyConfig = {
.devId = 0, .devId = PHY_DEVICE_ID,
.baseAddr = PHY_BASEADDR, .baseAddr = PHY_BASEADDR,
.antBramId = PHY_ANTCONFIG_BRAM_DEVICE_ID, .antBramId = PHY_ANTCONFIG_BRAM_DEVICE_ID,
.antInfoBramId = PHY_ANTINFO_BRAM_DEVICE_ID, .antInfoBramId = PHY_ANTINFO_BRAM_DEVICE_ID,
@@ -1146,8 +1146,7 @@ int32_t L2_SteerBeam2Node(L2_INST *instPtr, uint8_t nodeId)
* @param txrxMode tx/rx state for next slot * @param txrxMode tx/rx state for next slot
* @param frameType frame type of next slot. * @param frameType frame type of next slot.
* *
* @return Corresponding frame length * @return SUCCESS/FAILURE
* L2_FRAME_NONE_LEN if the frame type code cannot be recognized.
* *
******************************************************************************/ ******************************************************************************/
int32_t L2_SetupNextSlot(L2_INST *instPtr, L2_TOR_TYPE txrxMode, L2_FRAME_TYPE frameType) int32_t L2_SetupNextSlot(L2_INST *instPtr, L2_TOR_TYPE txrxMode, L2_FRAME_TYPE frameType)
@@ -39,11 +39,9 @@
typedef struct typedef struct
{ {
L2_NODE_TYPE myType; ///< node type L2_NODE_TYPE myType; ///< node type
bool isInterHead; ///< indicate if node is head node
uint8_t clustId; ///< node cluster id uint8_t clustId; ///< node cluster id
uint8_t myId; ///< node id uint8_t myId; ///< node id
uint8_t headId; ///< head node id uint8_t headId; ///< head node id
uint8_t bkpHeadId; ///< backup head id
uint8_t netScale; ///< net scale uint8_t netScale; ///< net scale
PHY_INST *phyInstPtr; ///< pointer to system physical layer instance PHY_INST *phyInstPtr; ///< pointer to system physical layer instance
TMC_INST *tmcInstPtr; ///< pointer to system timer controller layer instance TMC_INST *tmcInstPtr; ///< pointer to system timer controller layer instance
@@ -32,6 +32,10 @@
#include "error.h" #include "error.h"
/***************** Macros (Inline Functions) Definitions *********************/ /***************** Macros (Inline Functions) Definitions *********************/
/**
* @brief Get the node list length
* @param list pointer to node list
*/
inline uint32_t L2_GetNodeListLen(NODE_LIST *list) inline uint32_t L2_GetNodeListLen(NODE_LIST *list)
{ {
ASSERT(list != NULL); ASSERT(list != NULL);
+1
View File
@@ -15,6 +15,7 @@
* @addtogroup SystemBus * @addtogroup SystemBus
* @{ * @{
*/ */
/***************************** Include Files *********************************/ /***************************** Include Files *********************************/
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
+2 -2
View File
@@ -53,8 +53,8 @@ typedef struct
SYSBUS_UART *uartInst; ///< physical uart controller instance SYSBUS_UART *uartInst; ///< physical uart controller instance
CIRC_QUEUE *txQueue; ///< tx queue CIRC_QUEUE *txQueue; ///< tx queue
CIRC_QUEUE *rxQueue; ///< rx queue CIRC_QUEUE *rxQueue; ///< rx queue
bool isRxDone; ///< tx done indicator bool isTxDone; ///< tx done indicator
bool isTxDone; ///< rx done indicator bool isRxDone; ///< rx done indicator
} SYSBUS; } SYSBUS;
/************************** Function Prototypes ******************************/ /************************** Function Prototypes ******************************/
@@ -10,6 +10,7 @@
* Lab of Communication and Network * Lab of Communication and Network
* *
******************************************************************************/ ******************************************************************************/
/** /**
* @addtogroup SystemBus * @addtogroup SystemBus
* @{ * @{