Skip to content

Commit d33cf1e

Browse files
authored
Merge pull request #75 from Luos-io/tx_it
Tx it
2 parents d2f591d + 95f50af commit d33cf1e

17 files changed

+917
-397
lines changed

Robus/inc/config.h

+2-5
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
/*******************************************************************************
1111
* Definitions
1212
******************************************************************************/
13-
#define TRUE 1
14-
#define FALSE 0
15-
1613
#define DEFAULTID 0x00
1714
#define PROTOCOL_REVISION 0
1815
#define BROADCAST_VAL 0x0FFF
@@ -23,8 +20,8 @@
2320
#define MAX_DATA_MSG_SIZE 128
2421
#define MAX_MULTICAST_ADDRESS 1
2522

26-
#ifndef NBR_NAK_RETRY
27-
#define NBR_NAK_RETRY 10
23+
#ifndef NBR_RETRY
24+
#define NBR_RETRY 10
2825
#endif
2926

3027
#ifndef MAX_CONTAINER_NUMBER

Robus/inc/context.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ typedef struct
1919
{
2020

2121
// Variables
22-
node_t node; /*!< Node informations. */
23-
RxCom_t rx; /*!< Receiver informations. */
24-
TxCom_t tx; /*!< Transmitter informations. */
25-
uint8_t ack; /*!< Ack informations. */
26-
PortMng_t port; /*!< port informations. */
22+
node_t node; /*!< Node informations. */
23+
RxCom_t rx; /*!< Receiver informations. */
24+
TxCom_t tx; /*!< Transmitter informations. */
25+
PortMng_t port; /*!< port informations. */
2726

2827
//Virtual container management
2928
ll_container_t ll_container_table[MAX_CONTAINER_NUMBER]; /*!< Virtual Container table. */

Robus/inc/msg_alloc.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ void MsgAlloc_ValidHeader(uint8_t valid, uint16_t data_size);
3131
void MsgAlloc_InvalidMsg(void);
3232
void MsgAlloc_EndMsg(void);
3333
void MsgAlloc_SetData(uint8_t data);
34-
void MsgAlloc_SetMessage(msg_t *msg);
3534
error_return_t MsgAlloc_IsEmpty(void);
3635
void MsgAlloc_UsedMsgEnd(void);
3736

@@ -51,4 +50,11 @@ error_return_t MsgAlloc_GetLuosTaskSize(uint16_t luos_task_id, uint16_t *size);
5150
uint16_t MsgAlloc_LuosTasksNbr(void);
5251
void MsgAlloc_ClearMsgFromLuosTasks(msg_t *msg);
5352

53+
// Tx tasks create, get and consume
54+
error_return_t MsgAlloc_SetTxTask(ll_container_t *ll_container_pt, uint8_t *data, uint16_t crc, uint16_t size, uint8_t locahost, uint8_t ack);
55+
void MsgAlloc_PullMsgFromTxTask(void);
56+
void MsgAlloc_PullContainerFromTxTask(uint16_t container_id);
57+
error_return_t MsgAlloc_GetTxTask(ll_container_t **ll_container_pt, uint8_t **data, uint16_t *size, uint8_t *locahost);
58+
error_return_t MsgAlloc_TxAllComplete(void);
59+
5460
#endif /* _MSGALLOC_H_ */

Robus/inc/robus.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ void Robus_ContainersClear(void);
2727
error_return_t Robus_SendMsg(ll_container_t *ll_container, msg_t *msg);
2828
uint16_t Robus_TopologyDetection(ll_container_t *ll_container);
2929
node_t *Robus_GetNode(void);
30-
void Robus_DelayUs(uint32_t delay);
30+
void Robus_Flush(void);
3131

3232
#endif /* _ROBUS_H_ */

Robus/inc/robus_struct.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,16 @@
2020
******************************************************************************/
2121
typedef struct __attribute__((__packed__))
2222
{
23-
uint8_t msg_stack_ratio;
23+
uint8_t rx_msg_stack_ratio;
2424
uint8_t luos_stack_ratio;
25+
uint8_t tx_msg_stack_ratio;
26+
uint8_t buffer_occupation_ratio;
2527
uint8_t msg_drop_number;
2628
} memory_stats_t;
2729

2830
typedef struct __attribute__((__packed__))
2931
{
30-
uint8_t msg_nbr;
31-
uint8_t fail_msg_nbr;
32-
uint8_t *max_collision_retry;
33-
uint8_t *max_nak_retry;
32+
uint8_t *max_retry;
3433
} ll_stats_t;
3534
/*
3635
* This structure is used to get the message addressing mode list.

Robus/inc/transmission.h

+14-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,20 @@
1212
/*******************************************************************************
1313
* Definitions
1414
******************************************************************************/
15+
typedef enum
16+
{
17+
TX_DISABLE, /*!< transmission with ack */
18+
TX_OK, /*!< transmission ok */
19+
TX_NOK /*!< transmission fail */
20+
21+
} transmitStatus_t;
22+
1523
typedef struct
1624
{
17-
uint8_t *data;
18-
volatile uint8_t lock;
19-
volatile uint8_t collision;
25+
volatile uint8_t lock; // Transmit lock state
26+
uint8_t *data; // data to compare for collision detection
27+
volatile transmitStatus_t status; // data to compare for collision detection
28+
volatile uint8_t collision; // true is a collision occure during this transmission.
2029
} TxCom_t;
2130
/*******************************************************************************
2231
* Variables
@@ -26,7 +35,7 @@ typedef struct
2635
* Function
2736
******************************************************************************/
2837
void Transmit_SendAck(void);
29-
error_return_t Transmit_Process(uint8_t *data, uint16_t size);
30-
void Transmit_WaitUnlockTx(void);
38+
void Transmit_Process(void);
39+
void Transmit_End(void);
3140

3241
#endif /* _TRANSMISSION_H_ */

0 commit comments

Comments
 (0)