Skip to content

Commit 3915caf

Browse files
author
Nicolas Rabault
authored
Merge pull request #89 from Luos-io/rev_1.3.0
Release candidate for 1.3.0
2 parents 1b9d7d7 + aecf14e commit 3915caf

37 files changed

+1463
-132
lines changed

.github/workflows/build.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
platformio run -d Projects/l0/Dc_motor
6868
platformio run -d Projects/l0/Distance
6969
platformio run -d Projects/l0/Dxl
70-
platformio run -d Projects/l0/Gate
70+
platformio run -d Projects/l0/Gate_SerialCom
7171
platformio run -d Projects/l0/Gpio
7272
platformio run -d Projects/l0/Imu
7373
platformio run -d Projects/l0/Led
@@ -82,13 +82,21 @@ jobs:
8282
platformio run -d Projects/l0/Bike_alarm/Start_controller
8383
# arduino
8484
platformio run -d Projects/Arduino/Button
85-
platformio run -d Projects/Arduino/Gate
86-
# NUCLEO-G431KB
87-
platformio run -d Projects/NUCLEO-G431KB/Button
85+
platformio run -d Projects/Arduino/Gate_SerialCom
8886
# NUCLEO-L432KC
8987
platformio run -d Projects/NUCLEO-L432KC/Button
90-
platformio run -d Projects/NUCLEO-L432KC/Gate
88+
platformio run -d Projects/NUCLEO-L432KC/Gate_SerialCom
9189
platformio run -d Projects/NUCLEO-L432KC/Led
9290
# STM32F4-discovery
9391
platformio run -d Projects/STM32F4-discovery/Button
94-
platformio run -d Projects/STM32F4-discovery/Gate
92+
platformio run -d Projects/STM32F4-discovery/Gate_SerialCom
93+
# NUCLEO-F401RE
94+
platformio run -d Projects/NUCLEO-F401RE/Button
95+
platformio run -d Projects/NUCLEO-F401RE/Gate_SerialCom
96+
platformio run -d Projects/NUCLEO-F401RE/Led
97+
# NUCLEO-F401RB
98+
platformio run -d Projects/NUCLEO-F410RB/Button
99+
platformio run -d Projects/NUCLEO-F410RB/Gate_SerialCom
100+
# NUCLEO-G431KB
101+
platformio run -d Projects/NUCLEO-G431KB/Button
102+
platformio run -d Projects/NUCLEO-G431KB/Gate_SerialCom

.github/workflows/dev-build.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
platformio run -d Projects/l0/Dc_motor
9595
platformio run -d Projects/l0/Distance
9696
platformio run -d Projects/l0/Dxl
97-
platformio run -d Projects/l0/Gate
97+
platformio run -d Projects/l0/Gate_SerialCom
9898
platformio run -d Projects/l0/Gpio
9999
platformio run -d Projects/l0/Imu
100100
platformio run -d Projects/l0/Led
@@ -109,13 +109,21 @@ jobs:
109109
platformio run -d Projects/l0/Bike_alarm/Start_controller
110110
# arduino
111111
platformio run -d Projects/Arduino/Button
112-
platformio run -d Projects/Arduino/Gate
113-
# NUCLEO-G431KB
114-
platformio run -d Projects/NUCLEO-G431KB/Button
112+
platformio run -d Projects/Arduino/Gate_SerialCom
115113
# NUCLEO-L432KC
116114
platformio run -d Projects/NUCLEO-L432KC/Button
117-
platformio run -d Projects/NUCLEO-L432KC/Gate
115+
platformio run -d Projects/NUCLEO-L432KC/Gate_SerialCom
118116
platformio run -d Projects/NUCLEO-L432KC/Led
119117
# STM32F4-discovery
120118
platformio run -d Projects/STM32F4-discovery/Button
121-
platformio run -d Projects/STM32F4-discovery/Gate
119+
platformio run -d Projects/STM32F4-discovery/Gate_SerialCom
120+
# NUCLEO-F401RE
121+
platformio run -d Projects/NUCLEO-F401RE/Button
122+
platformio run -d Projects/NUCLEO-F401RE/Gate_SerialCom
123+
platformio run -d Projects/NUCLEO-F401RE/Led
124+
# NUCLEO-F401RB
125+
platformio run -d Projects/NUCLEO-F410RB/Button
126+
platformio run -d Projects/NUCLEO-F410RB/Gate_SerialCom
127+
# NUCLEO-G431KB
128+
platformio run -d Projects/NUCLEO-G431KB/Button
129+
platformio run -d Projects/NUCLEO-G431KB/Gate_SerialCom

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.nosync
12
.DS_Store
23
**/.DS_Store
34
*.icloud

OD/luos_od.h

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include "od_temperature.h"
1616
#include "od_illuminance.h"
1717
#include "od_time.h"
18+
#include "od_pid.h"
19+
#include "od_control.h"
1820

1921
/*******************************************************************************
2022
* Definitions

OD/od_control.h

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/******************************************************************************
2+
* @file OD_control
3+
* @brief object dictionnary managing flux control commands
4+
* @author Luos
5+
* @version 0.0.0
6+
******************************************************************************/
7+
#ifndef OD_OD_CONTROL_H_
8+
#define OD_OD_CONTROL_H_
9+
10+
#include "luos.h"
11+
12+
/*******************************************************************************
13+
* Definitions
14+
******************************************************************************/
15+
/*
16+
* Control modes
17+
*/
18+
typedef enum
19+
{
20+
PLAY,
21+
PAUSE,
22+
STOP
23+
} control_type_t;
24+
/*
25+
* controle
26+
*/
27+
typedef struct __attribute__((__packed__))
28+
{
29+
union
30+
{
31+
struct __attribute__((__packed__))
32+
{
33+
// control modes
34+
uint8_t flux : 2;
35+
uint8_t rec : 1;
36+
};
37+
uint8_t unmap;
38+
};
39+
} control_t;
40+
41+
/*******************************************************************************
42+
* Variables
43+
******************************************************************************/
44+
45+
/*******************************************************************************
46+
* Function
47+
******************************************************************************/
48+
// There is no conversion possible for PID
49+
//******** Conversions ***********
50+
51+
//******** Messages management ***********
52+
static inline void ControlOD_ControlToMsg(const control_t *const self, msg_t *const msg)
53+
{
54+
msg->header.cmd = CONTROL;
55+
memcpy(msg->data, self, sizeof(control_t));
56+
msg->header.size = sizeof(control_t);
57+
}
58+
59+
static inline void ControlOD_ControlFromMsg(control_t *const self, const msg_t *const msg)
60+
{
61+
LUOS_ASSERT(msg->header.size == sizeof(control_t));
62+
memcpy(self, msg->data, sizeof(control_t));
63+
// check data validity
64+
if (self->flux == 3)
65+
{
66+
// impossible value, go back to default values
67+
self->unmap = 0;
68+
}
69+
}
70+
71+
#endif /* OD_OD_CONTROL_H_ */

OD/od_pid.h

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/******************************************************************************
2+
* @file OD_pid
3+
* @brief object dictionnary Proportional Integral Derivative (PID)
4+
* @author Luos
5+
* @version 0.0.0
6+
******************************************************************************/
7+
#ifndef OD_OD_PID_H_
8+
#define OD_OD_PID_H_
9+
10+
#include "luos.h"
11+
12+
/*******************************************************************************
13+
* Definitions
14+
******************************************************************************/
15+
/*
16+
* Pid
17+
*/
18+
typedef struct __attribute__((__packed__))
19+
{
20+
union
21+
{
22+
struct __attribute__((__packed__))
23+
{
24+
float p;
25+
float i;
26+
float d;
27+
};
28+
unsigned char unmap[3 * sizeof(float)];
29+
float table[3];
30+
};
31+
} asserv_pid_t;
32+
33+
/*******************************************************************************
34+
* Variables
35+
******************************************************************************/
36+
37+
/*******************************************************************************
38+
* Function
39+
******************************************************************************/
40+
// There is no conversion possible for PID
41+
//******** Conversions ***********
42+
43+
//******** Messages management ***********
44+
static inline void PidOD_PidToMsg(const asserv_pid_t *const self, msg_t *const msg)
45+
{
46+
msg->header.cmd = PID;
47+
memcpy(msg->data, self, sizeof(asserv_pid_t));
48+
msg->header.size = sizeof(asserv_pid_t);
49+
}
50+
51+
static inline void PidOD_PidFromMsg(asserv_pid_t *const self, const msg_t *const msg)
52+
{
53+
LUOS_ASSERT(msg->header.size == sizeof(asserv_pid_t));
54+
memcpy(self, msg->data, sizeof(asserv_pid_t));
55+
}
56+
57+
#endif /* OD_OD_PID_H_ */

Robus/inc/msg_alloc.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ uint16_t MsgAlloc_LuosTasksNbr(void);
5252
void MsgAlloc_ClearMsgFromLuosTasks(msg_t *msg);
5353

5454
// Tx tasks create, get and consume
55-
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+
error_return_t MsgAlloc_SetTxTask(ll_container_t *ll_container_pt, uint8_t *data, uint16_t crc, uint16_t size, luos_localhost_t localhost, uint8_t ack);
5656
void MsgAlloc_PullMsgFromTxTask(void);
5757
void MsgAlloc_PullContainerFromTxTask(uint16_t container_id);
58-
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_GetTxTask(ll_container_t **ll_container_pt, uint8_t **data, uint16_t *size, uint8_t *localhost);
5959
error_return_t MsgAlloc_TxAllComplete(void);
6060

6161
#endif /* _MSGALLOC_H_ */

Robus/inc/reception.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ typedef struct
3333
DATA_CB callback;
3434
status_t status;
3535
} RxCom_t;
36+
3637
/*******************************************************************************
3738
* Variables
3839
******************************************************************************/
@@ -54,7 +55,7 @@ void Recep_EndMsg(void);
5455
void Recep_Reset(void);
5556
void Recep_Timeout(void);
5657
void Recep_InterpretMsgProtocol(msg_t *msg);
57-
uint8_t Recep_NodeConcerned(header_t *header);
58+
luos_localhost_t Recep_NodeConcerned(header_t *header);
5859
ll_container_t *Recep_GetConcernedLLContainer(header_t *header);
5960

6061
#endif /* _RECEPTION_H_ */

Robus/inc/robus_struct.h

+11
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@
1414
* Definitions
1515
******************************************************************************/
1616

17+
/******************************************************************************
18+
* @struct luos_localhost_t
19+
* @brief Transmit message direction
20+
******************************************************************************/
21+
typedef enum
22+
{
23+
EXTERNALHOST, // This message is for an external service
24+
LOCALHOST, // This message is for an internal service only
25+
MULTIHOST // This message is for an internal and an external service
26+
} luos_localhost_t;
27+
1728
/******************************************************************************
1829
* @struct memory_stats_t
1930
* @brief store informations about RAM occupation

0 commit comments

Comments
 (0)