From edcda1322b932fdbdcf64003b0171639286ec023 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 3 Apr 2023 13:14:21 +0200 Subject: [PATCH 001/150] Add the IO folder and source compilation. --- library.json | 3 ++- source_filter_script.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/library.json b/library.json index 965273a6b..092bc2d2a 100644 --- a/library.json +++ b/library.json @@ -2,7 +2,7 @@ "name": "luos_engine", "keywords": "robus,network,microservice,luos,operating system,os,embedded,communication,service,ST,luos engine", "description": "Luos engine turns your embedded system into services like microservices architecture does it in software.", - "version":"3.0.0", + "version": "3.0.0", "authors": { "name": "Luos", "url": "https://luos.io" @@ -17,6 +17,7 @@ "-I network/robus/selftest", "-I engine/OD", "-I engine/core/inc", + "-I engine/IO/inc", "-I engine/profiles/state", "-I engine/profiles/motor", "-I engine/profiles/servo_motor", diff --git a/source_filter_script.py b/source_filter_script.py index a9d3ace60..629f4e5a9 100644 --- a/source_filter_script.py +++ b/source_filter_script.py @@ -54,6 +54,7 @@ sources = ["+<*.c>", "+<../../../network/robus/src/*.c>", + "+<../../IO/src/*.c>", "+<../../../network/robus/selftest/*.c>", "+<../../profiles/state/*.c>", "+<../../profiles/motor/*.c>", From c03ace3a280c35020631e78140e0d63d88febe76 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 23 Mar 2023 10:25:53 +0100 Subject: [PATCH 002/150] Move msg_alloc from Robus to IO --- {network/robus => engine/IO}/inc/msg_alloc.h | 0 {network/robus => engine/IO}/src/msg_alloc.c | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {network/robus => engine/IO}/inc/msg_alloc.h (100%) rename {network/robus => engine/IO}/src/msg_alloc.c (100%) diff --git a/network/robus/inc/msg_alloc.h b/engine/IO/inc/msg_alloc.h similarity index 100% rename from network/robus/inc/msg_alloc.h rename to engine/IO/inc/msg_alloc.h diff --git a/network/robus/src/msg_alloc.c b/engine/IO/src/msg_alloc.c similarity index 100% rename from network/robus/src/msg_alloc.c rename to engine/IO/src/msg_alloc.c From 090de1aa014edcdf7655366ed55e8f55adeaf785 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 23 Mar 2023 10:28:08 +0100 Subject: [PATCH 003/150] Move topic pub/sub management from Robus to IO --- {network/robus => engine/IO}/inc/topic.h | 0 {network/robus => engine/IO}/src/topic.c | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {network/robus => engine/IO}/inc/topic.h (100%) rename {network/robus => engine/IO}/src/topic.c (100%) diff --git a/network/robus/inc/topic.h b/engine/IO/inc/topic.h similarity index 100% rename from network/robus/inc/topic.h rename to engine/IO/inc/topic.h diff --git a/network/robus/src/topic.c b/engine/IO/src/topic.c similarity index 100% rename from network/robus/src/topic.c rename to engine/IO/src/topic.c From 525651c5b9719198a9602588689993903db32b56 Mon Sep 17 00:00:00 2001 From: Salem_Luos Date: Thu, 5 Jan 2023 10:22:20 +0100 Subject: [PATCH 004/150] Create filter and luos_io files --- engine/IO/inc/filter.h | 27 +++++++++++++++++++++++++++ engine/IO/inc/luos_io.h | 27 +++++++++++++++++++++++++++ engine/IO/src/filter.c | 32 ++++++++++++++++++++++++++++++++ engine/IO/src/luos_io.c | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 118 insertions(+) create mode 100644 engine/IO/inc/filter.h create mode 100644 engine/IO/inc/luos_io.h create mode 100644 engine/IO/src/filter.c create mode 100644 engine/IO/src/luos_io.c diff --git a/engine/IO/inc/filter.h b/engine/IO/inc/filter.h new file mode 100644 index 000000000..f08a36caf --- /dev/null +++ b/engine/IO/inc/filter.h @@ -0,0 +1,27 @@ +/****************************************************************************** + * @file filter.c + * @brief Calculate filter for Phy and compare filter + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _FILTER_H_ +#define _FILTER_H_ + + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/******************************************************************************* + * Variables + ******************************************************************************/ + +/******************************************************************************* + * Functions + ******************************************************************************/ + +// generic functions +void Filter_Init(void); + + +#endif /* _FILTER_H_ */ diff --git a/engine/IO/inc/luos_io.h b/engine/IO/inc/luos_io.h new file mode 100644 index 000000000..9765d6a17 --- /dev/null +++ b/engine/IO/inc/luos_io.h @@ -0,0 +1,27 @@ +/****************************************************************************** + * @file luos_io.c + * @brief Interface file between Luos and a physical layer + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _LUOSIO_H_ +#define _LUOSIO_H_ + + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/******************************************************************************* + * Variables + ******************************************************************************/ + +/******************************************************************************* + * Functions + ******************************************************************************/ + +// generic functions +void LuosIO_Init(void); + + +#endif /* _LUOSIO_H_ */ diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c new file mode 100644 index 000000000..81bca316d --- /dev/null +++ b/engine/IO/src/filter.c @@ -0,0 +1,32 @@ +/****************************************************************************** + * @file filter.c + * @brief Calculate filter for Phy and compare filter + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#include + + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/******************************************************************************* + * Variables + ******************************************************************************/ + +/******************************************************************************* + * Functions + ******************************************************************************/ + + +/****************************************************************************** + * @brief Init the interface file. + * @param None + * @return None + ******************************************************************************/ +void Filter_Init(void) +{ + +} diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c new file mode 100644 index 000000000..143464d3c --- /dev/null +++ b/engine/IO/src/luos_io.c @@ -0,0 +1,32 @@ +/****************************************************************************** + * @file luos_io.c + * @brief Interface file between Luos and a physical layer + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#include + + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/******************************************************************************* + * Variables + ******************************************************************************/ + +/******************************************************************************* + * Functions + ******************************************************************************/ + + +/****************************************************************************** + * @brief Init the interface file. + * @param None + * @return None + ******************************************************************************/ +void LuosIO_Init(void) +{ + +} From 7496508694bdd635e3edf20aeb33e047cef38b82 Mon Sep 17 00:00:00 2001 From: Salem_Luos Date: Thu, 5 Jan 2023 10:35:17 +0100 Subject: [PATCH 005/150] Add an engine level configuration file --- engine/engine_config.h | 22 ++++++++++++++++++++++ library.json | 1 + 2 files changed, 23 insertions(+) create mode 100644 engine/engine_config.h diff --git a/engine/engine_config.h b/engine/engine_config.h new file mode 100644 index 000000000..9868c3334 --- /dev/null +++ b/engine/engine_config.h @@ -0,0 +1,22 @@ +/****************************************************************************** + * @file config + * @brief config for luos library ans robus protocole + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _ENGINE_CONFIG_H_ +#define _ENGINE_CONFIG_H_ + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/******************************************************************************* + * Variables + ******************************************************************************/ + +/******************************************************************************* + * Function + ******************************************************************************/ + +#endif /* _ENGINE_CONFIG_H_ */ diff --git a/library.json b/library.json index 092bc2d2a..3ec4a1462 100644 --- a/library.json +++ b/library.json @@ -15,6 +15,7 @@ "flags": [ "-I network/robus/inc", "-I network/robus/selftest", + "-I engine", "-I engine/OD", "-I engine/core/inc", "-I engine/IO/inc", From f5fcbc251c876390122707b364347c8c4db38e7b Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 23 Mar 2023 10:42:23 +0100 Subject: [PATCH 006/150] Rename and move the robus `config.h` file into `robus_config.h` --- engine/IO/src/msg_alloc.c | 2 +- library.json | 1 + network/robus/HAL/ESP32/robus_hal.h | 2 +- network/robus/inc/context.h | 2 +- network/robus/inc/robus_struct.h | 2 +- network/robus/{inc/config.h => robus_config.h} | 10 +++++----- 6 files changed, 10 insertions(+), 9 deletions(-) rename network/robus/{inc/config.h => robus_config.h} (92%) diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 1e892b079..0e443e515 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -45,7 +45,7 @@ #include #include #include -#include "config.h" +#include "robus_config.h" #include "msg_alloc.h" #include "luos_hal.h" #include "luos_utils.h" diff --git a/library.json b/library.json index 3ec4a1462..3bacb32ea 100644 --- a/library.json +++ b/library.json @@ -13,6 +13,7 @@ "build": { "srcDir": "engine/core/src", "flags": [ + "-I network/robus", "-I network/robus/inc", "-I network/robus/selftest", "-I engine", diff --git a/network/robus/HAL/ESP32/robus_hal.h b/network/robus/HAL/ESP32/robus_hal.h index 436bcfe58..33e440abf 100644 --- a/network/robus/HAL/ESP32/robus_hal.h +++ b/network/robus/HAL/ESP32/robus_hal.h @@ -10,7 +10,7 @@ #include #include -#include "config.h" +#include "robus_config.h" #include "robus_hal_config.h" /******************************************************************************* diff --git a/network/robus/inc/context.h b/network/robus/inc/context.h index 9efc78ce0..970133660 100644 --- a/network/robus/inc/context.h +++ b/network/robus/inc/context.h @@ -8,7 +8,7 @@ #define _CONTEXT_H_ #include -#include "config.h" +#include "robus_config.h" #include "port_manager.h" #include "reception.h" #include "transmission.h" diff --git a/network/robus/inc/robus_struct.h b/network/robus/inc/robus_struct.h index 17147af7c..2a71a4f9e 100644 --- a/network/robus/inc/robus_struct.h +++ b/network/robus/inc/robus_struct.h @@ -8,7 +8,7 @@ #define _ROBUS_STRUCT_H_ #include "stdint.h" -#include "config.h" +#include "robus_config.h" /******************************************************************************* * Definitions diff --git a/network/robus/inc/config.h b/network/robus/robus_config.h similarity index 92% rename from network/robus/inc/config.h rename to network/robus/robus_config.h index 594bd2d4d..4a72acbcf 100644 --- a/network/robus/inc/config.h +++ b/network/robus/robus_config.h @@ -1,11 +1,11 @@ /****************************************************************************** - * @file config - * @brief config for luos library ans robus protocole + * @file robus_config config + * @brief config of the Robus protocol * @author Luos * @version 0.0.0 ******************************************************************************/ -#ifndef _CONFIG_H_ -#define _CONFIG_H_ +#ifndef _ROBUS_CONFIG_H_ +#define _ROBUS_CONFIG_H_ /******************************************************************************* * Definitions @@ -65,4 +65,4 @@ * Function ******************************************************************************/ -#endif /* _CONFIG_H_ */ +#endif /* _ROBUS_CONFIG_H_ */ From 5ee14599a4a15d178df4a50082f00637f5b19390 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 23 Mar 2023 11:38:57 +0100 Subject: [PATCH 007/150] Move struct and configurations from Robus to IO --- .../IO/inc/io_struct.h | 2 +- engine/IO/inc/msg_alloc.h | 2 +- engine/OD/od_linear.h | 2 +- engine/bootloader/bootloader_core.h | 2 +- engine/engine_config.h | 46 +++++++++++++++---- network/robus/inc/robus.h | 2 +- network/robus/inc/transmission.h | 2 +- network/robus/robus_config.h | 46 +------------------ test/_resources/Unity/unit_test.h | 2 +- tool_services/gate/TinyJSON/bootloader_ex.h | 2 +- 10 files changed, 47 insertions(+), 61 deletions(-) rename network/robus/inc/robus_struct.h => engine/IO/inc/io_struct.h (99%) diff --git a/network/robus/inc/robus_struct.h b/engine/IO/inc/io_struct.h similarity index 99% rename from network/robus/inc/robus_struct.h rename to engine/IO/inc/io_struct.h index 2a71a4f9e..b246b8250 100644 --- a/network/robus/inc/robus_struct.h +++ b/engine/IO/inc/io_struct.h @@ -8,7 +8,7 @@ #define _ROBUS_STRUCT_H_ #include "stdint.h" -#include "robus_config.h" +#include "engine_config.h" /******************************************************************************* * Definitions diff --git a/engine/IO/inc/msg_alloc.h b/engine/IO/inc/msg_alloc.h index cc78281eb..e1c30d636 100644 --- a/engine/IO/inc/msg_alloc.h +++ b/engine/IO/inc/msg_alloc.h @@ -7,7 +7,7 @@ #ifndef _MSGALLOC_H_ #define _MSGALLOC_H_ -#include "robus_struct.h" +#include "io_struct.h" #include "stdint.h" /******************************************************************************* diff --git a/engine/OD/od_linear.h b/engine/OD/od_linear.h index 233409f46..95752f7a4 100644 --- a/engine/OD/od_linear.h +++ b/engine/OD/od_linear.h @@ -7,7 +7,7 @@ #ifndef OD_OD_LINEAR_H_ #define OD_OD_LINEAR_H_ -#include "robus_struct.h" +#include "io_struct.h" #include "string.h" /******************************************************************************* diff --git a/engine/bootloader/bootloader_core.h b/engine/bootloader/bootloader_core.h index 16dee1a76..d15fc0fc1 100644 --- a/engine/bootloader/bootloader_core.h +++ b/engine/bootloader/bootloader_core.h @@ -7,7 +7,7 @@ #ifndef BOOTLOADER_H #define BOOTLOADER_H -#include "robus_struct.h" +#include "io_struct.h" /******************************************************************************* * Definitions diff --git a/engine/engine_config.h b/engine/engine_config.h index 9868c3334..dc8f8eb42 100644 --- a/engine/engine_config.h +++ b/engine/engine_config.h @@ -1,6 +1,6 @@ /****************************************************************************** - * @file config - * @brief config for luos library ans robus protocole + * @file engine_config + * @brief config for luos_engine library * @author Luos * @version 0.0.0 ******************************************************************************/ @@ -10,13 +10,43 @@ /******************************************************************************* * Definitions ******************************************************************************/ +#define DEFAULTID 0x00 +#define PROTOCOL_REVISION 0 +#define BROADCAST_VAL 0x0FFF -/******************************************************************************* - * Variables - ******************************************************************************/ +#define MAX_ALIAS_SIZE 16 +#define MAX_DATA_MSG_SIZE 128 -/******************************************************************************* - * Function - ******************************************************************************/ +#ifndef MAX_SERVICE_NUMBER + #define MAX_SERVICE_NUMBER 5 +#endif + +#ifdef MAX_CONTAINER_NUMBER + #error 'MAX_CONTAINER_NUMBER' is deprecated since luos_engine@2.0.0, replace it by 'MAX_SERVICE_NUMBER', see: www.github.com/Luos-io/luos_engine/releases/tag/2.0.0 for more information. +#endif + +#ifndef MAX_PROFILE_NUMBER + #define MAX_PROFILE_NUMBER MAX_SERVICE_NUMBER +#endif + +#ifndef MSG_BUFFER_SIZE + #define MSG_BUFFER_SIZE 3 * sizeof(msg_t) +#endif + +#ifndef MAX_MSG_NB + #define MAX_MSG_NB 2 * MAX_SERVICE_NUMBER +#endif + +#ifndef NBR_PORT + #define NBR_PORT 2 +#endif + +#ifndef LAST_TOPIC + #define LAST_TOPIC 20 +#endif + +// Tab of byte. + 2 for overlap ID because aligned to byte +#define ID_MASK_SIZE ((MAX_SERVICE_NUMBER / 8) + 2) +#define TOPIC_MASK_SIZE ((LAST_TOPIC / 8) + 2) #endif /* _ENGINE_CONFIG_H_ */ diff --git a/network/robus/inc/robus.h b/network/robus/inc/robus.h index 4bf93bc6e..7179f2e27 100644 --- a/network/robus/inc/robus.h +++ b/network/robus/inc/robus.h @@ -9,7 +9,7 @@ #include #include -#include "robus_struct.h" +#include "io_struct.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/network/robus/inc/transmission.h b/network/robus/inc/transmission.h index cd65fa610..0fb37070f 100644 --- a/network/robus/inc/transmission.h +++ b/network/robus/inc/transmission.h @@ -7,7 +7,7 @@ #ifndef _TRANSMISSION_H_ #define _TRANSMISSION_H_ -#include "robus_struct.h" +#include "io_struct.h" #include /******************************************************************************* * Definitions diff --git a/network/robus/robus_config.h b/network/robus/robus_config.h index 4a72acbcf..f3b57aa85 100644 --- a/network/robus/robus_config.h +++ b/network/robus/robus_config.h @@ -10,13 +10,8 @@ /******************************************************************************* * Definitions ******************************************************************************/ -#define DEFAULTID 0x00 -#define PROTOCOL_REVISION 0 -#define BROADCAST_VAL 0x0FFF -#define TIMEOUT_VAL 2 -#define MAX_ALIAS_SIZE 16 -#define MAX_DATA_MSG_SIZE 128 +#define TIMEOUT_VAL 2 #ifndef DEFAULTBAUDRATE #define DEFAULTBAUDRATE 1000000 @@ -26,43 +21,4 @@ #define NBR_RETRY 10 #endif -#ifndef MAX_SERVICE_NUMBER - #define MAX_SERVICE_NUMBER 5 -#endif - -#ifdef MAX_CONTAINER_NUMBER - #error 'MAX_CONTAINER_NUMBER' is deprecated since luos_engine@2.0.0, replace it by 'MAX_SERVICE_NUMBER', see: www.github.com/Luos-io/luos_engine/releases/tag/2.0.0 for more information. -#endif - -#ifndef MAX_PROFILE_NUMBER - #define MAX_PROFILE_NUMBER MAX_SERVICE_NUMBER -#endif - -#ifndef MSG_BUFFER_SIZE - #define MSG_BUFFER_SIZE 3 * sizeof(msg_t) -#endif - -#ifndef MAX_MSG_NB - #define MAX_MSG_NB 2 * MAX_SERVICE_NUMBER -#endif - -#ifndef NBR_PORT - #define NBR_PORT 2 -#endif - -#ifndef LAST_TOPIC - #define LAST_TOPIC 20 -#endif - -// Tab of byte. + 2 for overlap ID because aligned to byte -#define ID_MASK_SIZE ((MAX_SERVICE_NUMBER / 8) + 2) -#define TOPIC_MASK_SIZE ((LAST_TOPIC / 8) + 2) -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Function - ******************************************************************************/ - #endif /* _ROBUS_CONFIG_H_ */ diff --git a/test/_resources/Unity/unit_test.h b/test/_resources/Unity/unit_test.h index a238faccc..e2ef0f48c 100644 --- a/test/_resources/Unity/unit_test.h +++ b/test/_resources/Unity/unit_test.h @@ -9,7 +9,7 @@ #include "robus_hal.h" #include "luos_engine.h" #include "luos_utils.h" -#include "robus_struct.h" +#include "io_struct.h" #include /******************************************************************************* diff --git a/tool_services/gate/TinyJSON/bootloader_ex.h b/tool_services/gate/TinyJSON/bootloader_ex.h index e4d387611..ad95d9a59 100644 --- a/tool_services/gate/TinyJSON/bootloader_ex.h +++ b/tool_services/gate/TinyJSON/bootloader_ex.h @@ -7,7 +7,7 @@ #ifndef BOOTLOADER_EX_H #define BOOTLOADER_EX_H -#include "robus_struct.h" +#include "io_struct.h" #include "luos_engine.h" #include "tiny-json.h" /******************************************************************************* From a1ebc8cecce42d575ae982ab880ce0d7be90726e Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 30 Mar 2023 11:06:02 +0200 Subject: [PATCH 008/150] Move public timestamp functions into public Luos_engine.h --- engine/core/inc/_timestamp.h | 6 +---- engine/core/inc/luos_engine.h | 9 +++---- engine/core/inc/timestamp.h | 24 ------------------- engine/core/src/timestamp.c | 12 +++++----- .../Arduino/button/lib/button/button.c | 2 +- .../ESP32/button_arduino/lib/button/button.c | 2 +- .../lib/Potentiometer/potentiometer.c | 3 +-- .../lib/Potentiometer/potentiometer.c | 3 +-- .../lib/Potentiometer/potentiometer.c | 3 +-- .../lib/Potentiometer/potentiometer.c | 3 +-- .../lib/Potentiometer/potentiometer.c | 3 +-- ...uos_bootloader_samd21j18a.X.production.map | 6 ++--- .../SAMD21XPLAINED/button/lib/button/button.c | 2 +- .../l0/distance/lib/Distance/distance.c | 3 +-- .../lib/Light_sensor/light_sensor.c | 3 +-- .../lib/Potentiometer/potentiometer.c | 3 +-- network/robus/src/reception.c | 4 ++-- network/robus/src/robus.c | 4 ++-- network/robus/src/transmission.c | 4 ++-- test/test_timestamp/main.c | 8 +++---- 20 files changed, 36 insertions(+), 71 deletions(-) delete mode 100644 engine/core/inc/timestamp.h diff --git a/engine/core/inc/_timestamp.h b/engine/core/inc/_timestamp.h index 8025c6aa1..d07d87211 100644 --- a/engine/core/inc/_timestamp.h +++ b/engine/core/inc/_timestamp.h @@ -7,11 +7,7 @@ #ifndef __TIMESTAMP_H_ #define __TIMESTAMP_H_ -#include "service_structs.h" -#include "luos_list.h" -#include "luos_utils.h" -#include "od_time.h" -#include "timestamp.h" +#include "luos_engine.h" /******************************************************************************* * Function diff --git a/engine/core/inc/luos_engine.h b/engine/core/inc/luos_engine.h index 1185b8660..ebb954e8e 100644 --- a/engine/core/inc/luos_engine.h +++ b/engine/core/inc/luos_engine.h @@ -12,7 +12,6 @@ #include "routing_table.h" #include "luos_od.h" #include "streaming.h" -#include "timestamp.h" /******************************************************************************* * Definitions @@ -39,9 +38,6 @@ typedef struct __attribute__((__packed__)) uint8_t unmap[sizeof(luos_stats_t) + sizeof(service_stats_t)]; /*!< streamable form. */ }; } general_stats_t; -/******************************************************************************* - * Variables - ******************************************************************************/ /******************************************************************************* * Function @@ -68,6 +64,11 @@ void Luos_ServicesClear(void); // ***************** Messaging management ***************** void Luos_Flush(void); +// *** Timestamping +time_luos_t Luos_Timestamp(void); +bool Luos_IsMsgTimstamped(msg_t *msg); +time_luos_t Luos_GetMsgTimestamp(msg_t *msg); + // *** Send error_return_t Luos_SendMsg(service_t *service, msg_t *msg); error_return_t Luos_SendTimestampMsg(service_t *service, msg_t *msg, time_luos_t timestamp); diff --git a/engine/core/inc/timestamp.h b/engine/core/inc/timestamp.h deleted file mode 100644 index bbbcfaf51..000000000 --- a/engine/core/inc/timestamp.h +++ /dev/null @@ -1,24 +0,0 @@ -/****************************************************************************** - * @file timestamp feature - * @brief time stamp data - * @author Luos - * @version 0.0.0 - ******************************************************************************/ -#ifndef _TIMESTAMP_H_ -#define _TIMESTAMP_H_ - -#include "stdbool.h" -#include "luos_list.h" -#include "service_structs.h" -#include "string.h" -#include "od_time.h" - -/******************************************************************************* - * Function - ******************************************************************************/ - -time_luos_t Timestamp_now(void); -bool Timestamp_IsTimestampMsg(msg_t *msg); -time_luos_t Timestamp_GetTimestamp(msg_t *msg); - -#endif /* _TIMESTAMP_H_ */ diff --git a/engine/core/src/timestamp.c b/engine/core/src/timestamp.c index 75185cba6..a9ae6fb11 100644 --- a/engine/core/src/timestamp.c +++ b/engine/core/src/timestamp.c @@ -12,7 +12,7 @@ * * Timestamp is a mechanism which enables to track events in the system. To use it users have to get and save a timestamp in * a time_luos_t variable. - * You can get a timestamp by calling the Timestamp_now() function. Then you can deal with the returned value as you want, allowing + * You can get a timestamp by calling the Luos_Timestamp() function. Then you can deal with the returned value as you want, allowing * you to tag a date in the past or in the future. * * Then you can send a message with a data and it's associated timestamp, luos can handle this by slighly modifiyng its @@ -58,7 +58,7 @@ * @param msg None * @return time_luos_t ******************************************************************************/ -time_luos_t Timestamp_now(void) +time_luos_t Luos_Timestamp(void) { return TimeOD_TimeFrom_ns((double)LuosHAL_GetTimestamp()); } @@ -67,7 +67,7 @@ time_luos_t Timestamp_now(void) * @param msg : Message to check * @return boolean it "True" if message is timestamped ******************************************************************************/ -_CRITICAL inline bool Timestamp_IsTimestampMsg(msg_t *msg) +_CRITICAL inline bool Luos_IsMsgTimstamped(msg_t *msg) { return (msg->header.config == TIMESTAMP_PROTOCOL); } @@ -76,10 +76,10 @@ _CRITICAL inline bool Timestamp_IsTimestampMsg(msg_t *msg) * @param msg : Message to get the timestamp from * @return time_luos_t ******************************************************************************/ -time_luos_t Timestamp_GetTimestamp(msg_t *msg) +time_luos_t Luos_GetMsgTimestamp(msg_t *msg) { time_luos_t timestamp = {0.0f}; - if (Timestamp_IsTimestampMsg(msg)) + if (Luos_IsMsgTimstamped(msg)) { // Timestamp is at the end of the message memcpy(×tamp, (msg->data + msg->header.size), sizeof(time_luos_t)); @@ -120,7 +120,7 @@ _CRITICAL void Timestamp_ConvertToLatency(msg_t *msg) last_msg = msg; } // Compute the latency from date - time_luos_t latency = TimeOD_TimeFrom_s(TimeOD_TimeTo_s(timestamp_date) - TimeOD_TimeTo_s(Timestamp_now())); + time_luos_t latency = TimeOD_TimeFrom_s(TimeOD_TimeTo_s(timestamp_date) - TimeOD_TimeTo_s(Luos_Timestamp())); // Write latency on the message memcpy(&msg->data[msg->header.size], &latency, sizeof(time_luos_t)); } diff --git a/examples/projects/Arduino/button/lib/button/button.c b/examples/projects/Arduino/button/lib/button/button.c index a88d70701..c465b37a8 100644 --- a/examples/projects/Arduino/button/lib/button/button.c +++ b/examples/projects/Arduino/button/lib/button/button.c @@ -55,7 +55,7 @@ static void Button_MsgHandler(service_t *service, msg_t *msg) pub_msg.header.target = msg->header.source; pub_msg.header.size = sizeof(char); pub_msg.data[0] = digitalRead(BTN_PIN); - time_luos_t timestamp = Timestamp_now(); + time_luos_t timestamp = Luos_Timestamp(); Luos_SendTimestampMsg(service, &pub_msg, timestamp); return; diff --git a/examples/projects/ESP32/button_arduino/lib/button/button.c b/examples/projects/ESP32/button_arduino/lib/button/button.c index 2d6d04f83..6ceab3928 100644 --- a/examples/projects/ESP32/button_arduino/lib/button/button.c +++ b/examples/projects/ESP32/button_arduino/lib/button/button.c @@ -55,7 +55,7 @@ static void Button_MsgHandler(service_t *service, msg_t *msg) pub_msg.header.target = msg->header.source; pub_msg.header.size = sizeof(char); pub_msg.data[0] = digitalRead(BTN_PIN); - time_luos_t timestamp = Timestamp_now(); + time_luos_t timestamp = Luos_Timestamp(); Luos_SendTimestampMsg(service, &pub_msg, timestamp); return; diff --git a/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.c b/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.c index 9da6353a1..bb4784c93 100644 --- a/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.c +++ b/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.c @@ -6,7 +6,6 @@ ******************************************************************************/ #include "main.h" #include "potentiometer.h" -#include "timestamp.h" /******************************************************************************* * Definitions @@ -46,7 +45,7 @@ void Potentiometer_Loop(void) { // read and save the angular position value angle = PotentiometerDrv_Read(); - angle_timestamp = Timestamp_now(); + angle_timestamp = Luos_Timestamp(); } /****************************************************************************** * @brief Msg Handler call back when a msg receive for this service diff --git a/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.c b/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.c index fb3c17e44..d14040dce 100644 --- a/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.c +++ b/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.c @@ -6,7 +6,6 @@ ******************************************************************************/ #include "main.h" #include "potentiometer.h" -#include "timestamp.h" /******************************************************************************* * Definitions @@ -46,7 +45,7 @@ void Potentiometer_Loop(void) { // read and save the angular position value angle = PotentiometerDrv_Read(); - angle_timestamp = Timestamp_now(); + angle_timestamp = Luos_Timestamp(); } /****************************************************************************** * @brief Msg Handler call back when a msg receive for this service diff --git a/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.c b/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.c index 9da6353a1..bb4784c93 100644 --- a/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.c +++ b/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.c @@ -6,7 +6,6 @@ ******************************************************************************/ #include "main.h" #include "potentiometer.h" -#include "timestamp.h" /******************************************************************************* * Definitions @@ -46,7 +45,7 @@ void Potentiometer_Loop(void) { // read and save the angular position value angle = PotentiometerDrv_Read(); - angle_timestamp = Timestamp_now(); + angle_timestamp = Luos_Timestamp(); } /****************************************************************************** * @brief Msg Handler call back when a msg receive for this service diff --git a/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.c b/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.c index 9da6353a1..bb4784c93 100644 --- a/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.c +++ b/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.c @@ -6,7 +6,6 @@ ******************************************************************************/ #include "main.h" #include "potentiometer.h" -#include "timestamp.h" /******************************************************************************* * Definitions @@ -46,7 +45,7 @@ void Potentiometer_Loop(void) { // read and save the angular position value angle = PotentiometerDrv_Read(); - angle_timestamp = Timestamp_now(); + angle_timestamp = Luos_Timestamp(); } /****************************************************************************** * @brief Msg Handler call back when a msg receive for this service diff --git a/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.c b/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.c index 9da6353a1..bb4784c93 100644 --- a/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.c +++ b/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.c @@ -6,7 +6,6 @@ ******************************************************************************/ #include "main.h" #include "potentiometer.h" -#include "timestamp.h" /******************************************************************************* * Definitions @@ -46,7 +45,7 @@ void Potentiometer_Loop(void) { // read and save the angular position value angle = PotentiometerDrv_Read(); - angle_timestamp = Timestamp_now(); + angle_timestamp = Luos_Timestamp(); } /****************************************************************************** * @brief Msg Handler call back when a msg receive for this service diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map index 8f2de01c8..c9eca9790 100644 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map +++ b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map @@ -3642,11 +3642,11 @@ LOAD data_init 0x000086fc 0xc build/luos_bootloader/production/_ext/1000620745/msg_alloc.o 0x000086fc MsgAlloc_UsedMsgEnd -.text.Timestamp_IsTimestampMsg%271 +.text.Luos_IsMsgTimstamped%271 0x00008708 0xc - .text.Timestamp_IsTimestampMsg + .text.Luos_IsMsgTimstamped 0x00008708 0xc build/luos_bootloader/production/_ext/1000620745/timestamp.o - 0x00008708 Timestamp_IsTimestampMsg + 0x00008708 Luos_IsMsgTimstamped .text.__sclose%272 0x00008714 0xc diff --git a/examples/projects/SAMD21XPLAINED/button/lib/button/button.c b/examples/projects/SAMD21XPLAINED/button/lib/button/button.c index c14a2bd16..af99840e4 100644 --- a/examples/projects/SAMD21XPLAINED/button/lib/button/button.c +++ b/examples/projects/SAMD21XPLAINED/button/lib/button/button.c @@ -55,7 +55,7 @@ static void Button_MsgHandler(service_t *service, msg_t *msg) pub_msg.header.target = msg->header.source; pub_msg.header.size = sizeof(char); pub_msg.data[0] = (((PORT->Group[BTN_PORT].IN.reg >> BTN_PIN)) & 0x01); - time_luos_t timestamp = Timestamp_now(); + time_luos_t timestamp = Luos_Timestamp(); Luos_SendTimestampMsg(service, &pub_msg, timestamp); return; diff --git a/examples/projects/l0/distance/lib/Distance/distance.c b/examples/projects/l0/distance/lib/Distance/distance.c index 366fa6fca..b408d013c 100644 --- a/examples/projects/l0/distance/lib/Distance/distance.c +++ b/examples/projects/l0/distance/lib/Distance/distance.c @@ -7,7 +7,6 @@ #include "vl53l0x_drv.h" #include "distance.h" -#include "timestamp.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -48,7 +47,7 @@ void Distance_Loop(void) if (vl53l0x_DrvRead(&dist) == SUCCEED) { new_data_ready = true; - distance_timestamp = Timestamp_now(); + distance_timestamp = Luos_Timestamp(); } } /****************************************************************************** diff --git a/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.c b/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.c index 4042e2c08..56fd8a18a 100644 --- a/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.c +++ b/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.c @@ -7,7 +7,6 @@ #include "main.h" #include "light_sensor.h" #include "string.h" -#include "timestamp.h" /******************************************************************************* * Definitions @@ -46,7 +45,7 @@ void LightSensor_Loop(void) { // read and store the value that captured by the sensor lux = LightSensorDrv_Read(); - lux_timestamp = Timestamp_now(); + lux_timestamp = Luos_Timestamp(); } /****************************************************************************** * @brief Msg Handler call back when a msg receive for this service diff --git a/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.c b/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.c index 9da6353a1..bb4784c93 100644 --- a/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.c +++ b/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.c @@ -6,7 +6,6 @@ ******************************************************************************/ #include "main.h" #include "potentiometer.h" -#include "timestamp.h" /******************************************************************************* * Definitions @@ -46,7 +45,7 @@ void Potentiometer_Loop(void) { // read and save the angular position value angle = PotentiometerDrv_Read(); - angle_timestamp = Timestamp_now(); + angle_timestamp = Luos_Timestamp(); } /****************************************************************************** * @brief Msg Handler call back when a msg receive for this service diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index 968339b0e..d031ee0c6 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -150,7 +150,7 @@ _CRITICAL void Recep_GetHeader(volatile uint8_t *data) { data_size = current_msg->header.size; // we need to check if we have a timestamped message and increase the data size if yes - if (Timestamp_IsTimestampMsg((msg_t *)current_msg) == true) + if (Luos_IsMsgTimstamped((msg_t *)current_msg) == true) { data_size += sizeof(time_luos_t); } @@ -201,7 +201,7 @@ _CRITICAL void Recep_GetData(volatile uint8_t *data) } MsgAlloc_ValidDataIntegrity(); // If message is timestamped, convert the latency to date - if (Timestamp_IsTimestampMsg((msg_t *)current_msg)) + if (Luos_IsMsgTimstamped((msg_t *)current_msg)) { // This conversion also remove the timestamp from the message size. Timestamp_ConvertToDate((msg_t *)current_msg, ll_rx_timestamp); diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index 371f26639..2f4d5e70a 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -17,7 +17,7 @@ #include "luos_hal.h" #include "msg_alloc.h" #include "luos_utils.h" -#include "timestamp.h" +#include "luos_engine.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -213,7 +213,7 @@ error_return_t Robus_SetTxTask(ll_service_t *ll_service, msg_t *msg) uint16_t crc_max_index = full_size; - if (Timestamp_IsTimestampMsg(msg) == true) + if (Luos_IsMsgTimstamped(msg) == true) { full_size += sizeof(time_luos_t); } diff --git a/network/robus/src/transmission.c b/network/robus/src/transmission.c index c8561093a..8ac2b80d4 100644 --- a/network/robus/src/transmission.c +++ b/network/robus/src/transmission.c @@ -51,7 +51,7 @@ #include "reception.h" #include "msg_alloc.h" #include "_timestamp.h" -#include "timestamp.h" +#include "luos_engine.h" /******************************************************************************* * Definitions @@ -166,7 +166,7 @@ _CRITICAL void Transmit_Process() ctx.tx.data = data; // Put timestamping on data here - if (Timestamp_IsTimestampMsg((msg_t *)data) && (!nbrRetry)) + if (Luos_IsMsgTimstamped((msg_t *)data) && (!nbrRetry)) { // Convert date to latency Timestamp_ConvertToLatency((msg_t *)data); diff --git a/test/test_timestamp/main.c b/test/test_timestamp/main.c index 8abdb03de..8059e9e2c 100644 --- a/test/test_timestamp/main.c +++ b/test/test_timestamp/main.c @@ -28,13 +28,13 @@ void unittest_Timestamp() time_luos_t event_b_timestamp; // Save event A - event_a_timestamp = Timestamp_now(); + event_a_timestamp = Luos_Timestamp(); // wait for 1.2 seconds uint32_t start_timer = Luos_GetSystick(); while (Luos_GetSystick() - start_timer < 1200) ; // Save event B - event_b_timestamp = Timestamp_now(); + event_b_timestamp = Luos_Timestamp(); // check the time elapsed between the two events time_luos_t time_elapsed = TimeOD_TimeFrom_s(TimeOD_TimeTo_s(event_b_timestamp) - TimeOD_TimeTo_s(event_a_timestamp)); @@ -64,7 +64,7 @@ void unittest_Timestamp() rx_msg = &default_sc.App_2.last_rx_msg; uint64_t low_level_rx_timestamp; // Get back the 1st timestamp - time_luos_t rx_event_a_timestamp = Timestamp_GetTimestamp(rx_msg); + time_luos_t rx_event_a_timestamp = Luos_GetMsgTimestamp(rx_msg); // Send the 2nd message to receiver with both the 2nd timestamp msg.header.size = 1; TEST_ASSERT_EQUAL(SUCCEED, Luos_SendTimestampMsg(default_sc.App_1.app, &msg, event_b_timestamp)); @@ -73,7 +73,7 @@ void unittest_Timestamp() // Get the message received rx_msg = &default_sc.App_2.last_rx_msg; // Get back the 2nd timestamp - time_luos_t rx_event_b_timestamp = Timestamp_GetTimestamp(rx_msg); + time_luos_t rx_event_b_timestamp = Luos_GetMsgTimestamp(rx_msg); // check the time elapsed between the two events time_elapsed = TimeOD_TimeFrom_s(TimeOD_TimeTo_s(rx_event_b_timestamp) - TimeOD_TimeTo_s(rx_event_a_timestamp)); From 48d530e31c9473a76c991c63c9fa7bc41d414b7d Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 23 Mar 2023 12:22:33 +0100 Subject: [PATCH 009/150] Add an error in case of inclusion of luos.h --- engine/core/inc/luos.h | 2 ++ examples/projects/Arduino/bldc_simple_foc/src/SimpleFOC.cpp | 2 +- examples/projects/Arduino/stepper_simple_foc/src/SimpleFOC.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/core/inc/luos.h b/engine/core/inc/luos.h index 683e3f4ea..427043d01 100644 --- a/engine/core/inc/luos.h +++ b/engine/core/inc/luos.h @@ -3,4 +3,6 @@ * @brief Retrocompatibility file to include luos_engine.h instead of luos.h * @author Luos ******************************************************************************/ + +#error 'luos.h' inclusion is deprecated since luos_engine@2.3.1, replace it by '#include "luos_engine.h"', see: www.github.com/Luos-io/luos_engine/commit/d3cc1618956907fc5a657ef07535ad9d5caa4f57 for more information. #include "luos_engine.h" \ No newline at end of file diff --git a/examples/projects/Arduino/bldc_simple_foc/src/SimpleFOC.cpp b/examples/projects/Arduino/bldc_simple_foc/src/SimpleFOC.cpp index f1c84099f..eb520f68d 100644 --- a/examples/projects/Arduino/bldc_simple_foc/src/SimpleFOC.cpp +++ b/examples/projects/Arduino/bldc_simple_foc/src/SimpleFOC.cpp @@ -6,7 +6,7 @@ extern "C" { #endif -#include +#include "luos_engine.h" #ifdef __cplusplus } diff --git a/examples/projects/Arduino/stepper_simple_foc/src/SimpleFOC.cpp b/examples/projects/Arduino/stepper_simple_foc/src/SimpleFOC.cpp index eab956aee..7b99ffea7 100644 --- a/examples/projects/Arduino/stepper_simple_foc/src/SimpleFOC.cpp +++ b/examples/projects/Arduino/stepper_simple_foc/src/SimpleFOC.cpp @@ -8,7 +8,7 @@ extern "C" { #endif -#include +#include "luos_engine.h" #ifdef __cplusplus } From f752b60becf508c741f7a40f9bc36ff69404fc07 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 23 Mar 2023 12:37:20 +0100 Subject: [PATCH 010/150] Clean luos_engine.h and remove unused `Luos_SetExternId` --- engine/core/inc/luos_engine.h | 35 ++++++++++++++------------------- engine/core/inc/routing_table.h | 6 ------ engine/core/src/luos_engine.c | 20 ------------------- engine/engine_config.h | 4 ++++ 4 files changed, 19 insertions(+), 46 deletions(-) diff --git a/engine/core/inc/luos_engine.h b/engine/core/inc/luos_engine.h index ebb954e8e..06383aadd 100644 --- a/engine/core/inc/luos_engine.h +++ b/engine/core/inc/luos_engine.h @@ -64,37 +64,32 @@ void Luos_ServicesClear(void); // ***************** Messaging management ***************** void Luos_Flush(void); -// *** Timestamping +// *** Timestamping management *** time_luos_t Luos_Timestamp(void); bool Luos_IsMsgTimstamped(msg_t *msg); time_luos_t Luos_GetMsgTimestamp(msg_t *msg); - -// *** Send -error_return_t Luos_SendMsg(service_t *service, msg_t *msg); error_return_t Luos_SendTimestampMsg(service_t *service, msg_t *msg, time_luos_t timestamp); + +// *** Big data management *** void Luos_SendData(service_t *service, msg_t *msg, void *bin_data, uint16_t size); +int Luos_ReceiveData(service_t *service, msg_t *msg, void *bin_data); + +// *** Streaming management *** void Luos_SendStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream); void Luos_SendStreamingSize(service_t *service, msg_t *msg, streaming_channel_t *stream, uint32_t max_size); -error_return_t Luos_TxComplete(void); +error_return_t Luos_ReceiveStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream); + +// *** Pub/Sub management *** +error_return_t Luos_TopicSubscribe(service_t *service, uint16_t topic); +error_return_t Luos_TopicUnsubscribe(service_t *service, uint16_t topic); -void Luos_SetExternId(service_t *service, target_mode_t target_mode, uint16_t target, uint16_t newid); +// *** Basic transmission management *** +error_return_t Luos_SendMsg(service_t *service, msg_t *msg); +error_return_t Luos_TxComplete(void); -// *** Receive +// *** Polling reception management *** error_return_t Luos_ReadMsg(service_t *service, msg_t **returned_msg); error_return_t Luos_ReadFromService(service_t *service, int16_t id, msg_t **returned_msg); -int Luos_ReceiveData(service_t *service, msg_t *msg, void *bin_data); -error_return_t Luos_ReceiveStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream); uint16_t Luos_NbrAvailableMsg(void); -uint32_t Luos_GetSystick(void); -error_return_t Luos_TxComplete(void); -void Luos_ResetStatistic(void); -bool Luos_IsNodeDetected(void); -void Luos_AddPackage(void (*Init)(void), void (*Loop)(void)); -void Luos_SetVerboseMode(uint8_t mode); -void Luos_SetFilterState(uint8_t state, service_t *service); -error_return_t Luos_TopicSubscribe(service_t *service, uint16_t topic); -error_return_t Luos_TopicUnsubscribe(service_t *service, uint16_t topic); -void Luos_Run(void); -void Luos_Detect(service_t *service); #endif /* LUOS_ENGINE_H */ diff --git a/engine/core/inc/routing_table.h b/engine/core/inc/routing_table.h index deb902e2b..4ab6d0f2b 100644 --- a/engine/core/inc/routing_table.h +++ b/engine/core/inc/routing_table.h @@ -11,9 +11,6 @@ /******************************************************************************* * Definitions ******************************************************************************/ -#ifndef MAX_RTB_ENTRY - #define MAX_RTB_ENTRY 40 -#endif typedef enum { @@ -21,9 +18,6 @@ typedef enum SERVICE, // Contain a service informations NODE, // Contain a node informations } entry_mode_t; -/******************************************************************************* - * Variables - ******************************************************************************/ /* This structure is used to receive or send messages between services in slave * and master mode. diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 32e77cc72..25da44762 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -995,26 +995,6 @@ error_return_t Luos_UpdateAlias(service_t *service, const char *alias, uint16_t memcpy(service->alias, clean_alias, MAX_ALIAS_SIZE); return SUCCEED; } -/****************************************************************************** - * @brief Set Id of a service trough the network - * @param service : Service sending request - * @param target_mode - * @param target - * @param newid : The new Id of service(s) - * @return None - ******************************************************************************/ -void Luos_SetExternId(service_t *service, target_mode_t target_mode, uint16_t target, uint16_t newid) -{ - msg_t msg; - msg.header.config = BASE_PROTOCOL; - msg.header.target = target; - msg.header.target_mode = target_mode; - msg.header.cmd = WRITE_NODE_ID; - msg.header.size = 2; - msg.data[1] = newid; - msg.data[0] = (newid << 8); - Robus_SendMsg(service->ll_service, &msg); -} /****************************************************************************** * @brief Return the number of messages available * @param None diff --git a/engine/engine_config.h b/engine/engine_config.h index dc8f8eb42..ca21ef937 100644 --- a/engine/engine_config.h +++ b/engine/engine_config.h @@ -21,6 +21,10 @@ #define MAX_SERVICE_NUMBER 5 #endif +#ifndef MAX_RTB_ENTRY + #define MAX_RTB_ENTRY 40 +#endif + #ifdef MAX_CONTAINER_NUMBER #error 'MAX_CONTAINER_NUMBER' is deprecated since luos_engine@2.0.0, replace it by 'MAX_SERVICE_NUMBER', see: www.github.com/Luos-io/luos_engine/releases/tag/2.0.0 for more information. #endif From be861f95b32e1d6e57530273f67474b034addeb5 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 28 Mar 2023 16:24:07 +0200 Subject: [PATCH 011/150] Group all topic things on a pub_sub.c file on engine/core --- engine/IO/inc/topic.h | 27 ------ engine/bootloader/bootloader_core.c | 4 +- engine/core/inc/luos_engine.h | 10 ++- engine/core/inc/pub_sub.h | 17 ++++ engine/core/src/luos_engine.c | 28 ------- engine/{IO/src/topic.c => core/src/pub_sub.c} | 81 +++++++++++++----- .../native/ping_pong/lib/PingPong/scoring.c | 2 +- network/robus/inc/robus.h | 2 - network/robus/src/reception.c | 6 +- network/robus/src/robus.c | 54 ------------ test/test_robus/main.c | 82 +++++++++---------- test/test_topic/main.c | 68 +++++++-------- 12 files changed, 164 insertions(+), 217 deletions(-) delete mode 100644 engine/IO/inc/topic.h create mode 100644 engine/core/inc/pub_sub.h rename engine/{IO/src/topic.c => core/src/pub_sub.c} (53%) diff --git a/engine/IO/inc/topic.h b/engine/IO/inc/topic.h deleted file mode 100644 index ca69fe6ca..000000000 --- a/engine/IO/inc/topic.h +++ /dev/null @@ -1,27 +0,0 @@ -/****************************************************************************** - * @file topic - * @brief multicast protocole description - * @author Luos - * @version 0.0.0 - ******************************************************************************/ -#ifndef _TOPIC_H_ -#define _TOPIC_H_ - -#include "context.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Function - ******************************************************************************/ -uint8_t Topic_IsTopicSubscribed(ll_service_t *ll_service, uint16_t topic_id); -error_return_t Topic_Subscribe(ll_service_t *ll_service, uint16_t topic_id); -error_return_t Topic_Unsubscribe(ll_service_t *ll_service, uint16_t topic_id); - -#endif /* _TARGET_H_ */ diff --git a/engine/bootloader/bootloader_core.c b/engine/bootloader/bootloader_core.c index 5cfb8d703..0e2949b03 100644 --- a/engine/bootloader/bootloader_core.c +++ b/engine/bootloader/bootloader_core.c @@ -385,7 +385,7 @@ void LuosBootloader_MsgHandler(msg_t *input) case BOOTLOADER_READY: source_id = input->header.source; bootloader_data_size = input->header.size - 2 * sizeof(char); - Luos_TopicSubscribe(0, (uint16_t)input->data[1]); + Luos_Subscribe(0, (uint16_t)input->data[1]); memcpy(bootloader_data, &(input->data[2]), bootloader_data_size); LuosHAL_SetMode((uint8_t)BOOT_MODE); @@ -445,7 +445,7 @@ void LuosBootloader_MsgHandler(msg_t *input) case BOOTLOADER_APP_SAVED: // set load flag load_flag = true; - Luos_TopicUnsubscribe(0, input->header.target); + Luos_Unsubscribe(0, input->header.target); break; case BOOTLOADER_STOP: diff --git a/engine/core/inc/luos_engine.h b/engine/core/inc/luos_engine.h index 06383aadd..d1978f5ab 100644 --- a/engine/core/inc/luos_engine.h +++ b/engine/core/inc/luos_engine.h @@ -70,6 +70,10 @@ bool Luos_IsMsgTimstamped(msg_t *msg); time_luos_t Luos_GetMsgTimestamp(msg_t *msg); error_return_t Luos_SendTimestampMsg(service_t *service, msg_t *msg, time_luos_t timestamp); +// *** Pub/Sub management (in file `pub_sub.c`)*** +error_return_t Luos_Subscribe(service_t *service, uint16_t topic); +error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic); + // *** Big data management *** void Luos_SendData(service_t *service, msg_t *msg, void *bin_data, uint16_t size); int Luos_ReceiveData(service_t *service, msg_t *msg, void *bin_data); @@ -79,9 +83,9 @@ void Luos_SendStreaming(service_t *service, msg_t *msg, streaming_channel_t *str void Luos_SendStreamingSize(service_t *service, msg_t *msg, streaming_channel_t *stream, uint32_t max_size); error_return_t Luos_ReceiveStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream); -// *** Pub/Sub management *** -error_return_t Luos_TopicSubscribe(service_t *service, uint16_t topic); -error_return_t Luos_TopicUnsubscribe(service_t *service, uint16_t topic); +// *** Pub/Sub management (in file `pub_sub.c`)*** +error_return_t PubSub_Subscribe(service_t *service, uint16_t topic); +error_return_t PubSub_Unsubscribe(service_t *service, uint16_t topic); // *** Basic transmission management *** error_return_t Luos_SendMsg(service_t *service, msg_t *msg); diff --git a/engine/core/inc/pub_sub.h b/engine/core/inc/pub_sub.h new file mode 100644 index 000000000..5da77ece1 --- /dev/null +++ b/engine/core/inc/pub_sub.h @@ -0,0 +1,17 @@ +/****************************************************************************** + * @file pub_sub.h + * @brief multicast referencing description + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _PUB_SUB_H_ +#define _PUB_SUB_H_ + +#include "context.h" + +/******************************************************************************* + * Function + ******************************************************************************/ +uint8_t PubSub_IsTopicSubscribed(ll_service_t *ll_service, uint16_t topic_id); + +#endif /* _PUB_SUB_H_ */ diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 25da44762..3a91ec320 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -1203,31 +1203,3 @@ void Luos_Detect(service_t *service) Luos_SendMsg(service, &detect_msg); } } -/****************************************************************************** - * @brief Subscribe to a new topic - * @param service - * @param topic - * @return None - ******************************************************************************/ -error_return_t Luos_TopicSubscribe(service_t *service, uint16_t topic) -{ - if (service == 0) - { - return Robus_TopicSubscribe(0, topic); - } - return Robus_TopicSubscribe(service->ll_service, topic); -} -/****************************************************************************** - * @brief Unsubscribe from a topic - * @param service - * @param topic - * @return None - ******************************************************************************/ -error_return_t Luos_TopicUnsubscribe(service_t *service, uint16_t topic) -{ - if (service == 0) - { - return Robus_TopicUnsubscribe(0, topic); - } - return Robus_TopicUnsubscribe(service->ll_service, topic); -} diff --git a/engine/IO/src/topic.c b/engine/core/src/pub_sub.c similarity index 53% rename from engine/IO/src/topic.c rename to engine/core/src/pub_sub.c index aa0d5b487..b513bac49 100644 --- a/engine/IO/src/topic.c +++ b/engine/core/src/pub_sub.c @@ -4,8 +4,9 @@ * @author Luos * @version 0.0.0 ******************************************************************************/ -#include "topic.h" -#include "stdbool.h" +#include "pub_sub.h" +#include "luos_engine.h" +#include #include /******************************************************************************* * Definitions @@ -16,7 +17,7 @@ ******************************************************************************/ /******************************************************************************* - * Function + * Functions ******************************************************************************/ /****************************************************************************** @@ -25,7 +26,7 @@ * @param multicast bank * @return Error ******************************************************************************/ -uint8_t Topic_IsTopicSubscribed(ll_service_t *ll_service, uint16_t topic_id) +uint8_t PubSub_IsTopicSubscribed(ll_service_t *ll_service, uint16_t topic_id) { unsigned char i; for (i = 0; i < ll_service->last_topic_position; i++) @@ -35,18 +36,32 @@ uint8_t Topic_IsTopicSubscribed(ll_service_t *ll_service, uint16_t topic_id) } return false; } + /****************************************************************************** - * @brief add a topic to the list - * @param service in multicast - * @param topic_add to add - * @return Error + * @brief Subscribe to a new topic + * @param service + * @param topic + * @return None ******************************************************************************/ -error_return_t Topic_Subscribe(ll_service_t *ll_service, uint16_t topic_id) +error_return_t Luos_Subscribe(service_t *service, uint16_t topic) { - // check if target exists or if we reached the maximum topics number - if ((Topic_IsTopicSubscribed(ll_service, topic_id) == false) && (ll_service->last_topic_position < LAST_TOPIC)) + // Assert if we add a topic that is greater than the max topic value + LUOS_ASSERT(topic <= LAST_TOPIC); + + // Add 1 to the bit corresponding to the topic in multicast mask + ctx.TopicMask[(topic / 8)] |= 1 << (topic - ((int)(topic / 8)) * 8); + + // add multicast this topic to the service + ll_service_t *ll_service = (ll_service_t *)&ctx.ll_service_table[0]; + if (service != 0) { - ll_service->topic_list[ll_service->last_topic_position] = topic_id; + ll_service = service->ll_service; + } + + // Check if target exists or if we reached the maximum topics number + if ((PubSub_IsTopicSubscribed(ll_service, topic) == false) && (ll_service->last_topic_position < LAST_TOPIC)) + { + ll_service->topic_list[ll_service->last_topic_position] = topic; ll_service->last_topic_position++; return SUCCEED; } @@ -54,26 +69,48 @@ error_return_t Topic_Subscribe(ll_service_t *ll_service, uint16_t topic_id) } /****************************************************************************** - * @brief remove a topic from the service list - * @param service in multicast - * @param topic_id to remove - * @return Error + * @brief Unsubscribe from a topic + * @param service + * @param topic + * @return None ******************************************************************************/ -error_return_t Topic_Unsubscribe(ll_service_t *ll_service, uint16_t topic_id) +error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic) { + error_return_t err = FAILED; + ll_service_t *ll_service = (ll_service_t *)&ctx.ll_service_table[0]; unsigned char i; + if (service != 0) + { + ll_service = service->ll_service; + } + // Delete topic from service list for (i = 0; i < ll_service->last_topic_position; i++) { - if (ll_service->topic_list[i] == topic_id) + if (ll_service->topic_list[i] == topic) { if (ll_service->last_topic_position >= LAST_TOPIC) { - return FAILED; + break; } memcpy(&ll_service->topic_list[i], &ll_service->topic_list[i + 1], ll_service->last_topic_position - i); ll_service->last_topic_position--; - return SUCCEED; + err = SUCCEED; + break; } } - return FAILED; -} + + // Recompute multicast mask if needed + if (err == SUCCEED) + { + for (uint16_t i = 0; i < ctx.ll_service_number; i++) + { + if (PubSub_IsTopicSubscribed((ll_service_t *)(&ctx.ll_service_table[i]), topic) == true) + { + return err; + } + } + // calculate mask after topic deletion + ctx.TopicMask[(topic / 8)] -= 1 << (topic - ((int)(topic / 8)) * 8); + } + return err; +} \ No newline at end of file diff --git a/examples/projects/native/ping_pong/lib/PingPong/scoring.c b/examples/projects/native/ping_pong/lib/PingPong/scoring.c index db8241302..1412e402b 100644 --- a/examples/projects/native/ping_pong/lib/PingPong/scoring.c +++ b/examples/projects/native/ping_pong/lib/PingPong/scoring.c @@ -14,7 +14,7 @@ score_table_t score_table; void score_init(service_t *player, search_result_t *player_list) { - Luos_TopicSubscribe(player, SCORE_TOPIC); + Luos_Subscribe(player, SCORE_TOPIC); memset(scores, 0, sizeof(scores)); score_table.player_nb = player_list->result_nbr; score_table.scores = scores; diff --git a/network/robus/inc/robus.h b/network/robus/inc/robus.h index 7179f2e27..fa0312d06 100644 --- a/network/robus/inc/robus.h +++ b/network/robus/inc/robus.h @@ -42,7 +42,5 @@ network_state_t Robus_IsNodeDetected(void); void Robus_SetFilterState(uint8_t state, ll_service_t *service); void Robus_SetVerboseMode(uint8_t mode); void Robus_MaskInit(void); -error_return_t Robus_TopicSubscribe(ll_service_t *ll_service, uint16_t topic_id); -error_return_t Robus_TopicUnsubscribe(ll_service_t *ll_service, uint16_t topic_id); #endif /* _ROBUS_H_ */ diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index d031ee0c6..b125d9d2d 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -46,7 +46,7 @@ #include #include "robus_hal.h" #include "luos_hal.h" -#include "topic.h" +#include "pub_sub.h" #include "transmission.h" #include "msg_alloc.h" #include "luos_utils.h" @@ -579,7 +579,7 @@ static inline void Recep_DoubleAlloc(msg_t *msg) } break; case (TOPIC): - if (Topic_IsTopicSubscribed((ll_service_t *)&ctx.ll_service_table[idx], msg->header.target) == false) + if (PubSub_IsTopicSubscribed((ll_service_t *)&ctx.ll_service_table[idx], msg->header.target) == false) { // store the message if it is not so that we dont have double messages in memory MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[idx], msg); @@ -640,7 +640,7 @@ void Recep_InterpretMsgProtocol(msg_t *msg) case TOPIC: for (i = 0; i < ctx.ll_service_number; i++) { - if (Topic_IsTopicSubscribed((ll_service_t *)&ctx.ll_service_table[i], msg->header.target)) + if (PubSub_IsTopicSubscribed((ll_service_t *)&ctx.ll_service_table[i], msg->header.target)) { // TODO manage multiple slave concerned MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg); diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index 2f4d5e70a..bdda80c00 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -12,7 +12,6 @@ #include "reception.h" #include "port_manager.h" #include "context.h" -#include "topic.h" #include "robus_hal.h" #include "luos_hal.h" #include "msg_alloc.h" @@ -610,56 +609,3 @@ _CRITICAL void Robus_SetVerboseMode(uint8_t mode) // verbose is localhost or multihost ctx.verbose = mode + 1; } -/****************************************************************************** - * @brief Add new mutlicast topic to service bank and node mask - * @param ll_service - * @param topic - * @return Error - ******************************************************************************/ -error_return_t Robus_TopicSubscribe(ll_service_t *ll_service, uint16_t topic_id) -{ - // assert if we add a topic that is greater than the max topic value - LUOS_ASSERT(topic_id <= LAST_TOPIC); - // add 1 to the bit corresponding to the topic in multicast mask - ctx.TopicMask[(topic_id / 8)] |= 1 << (topic_id - ((int)(topic_id / 8)) * 8); - // add multicast topic to service - if (ll_service == 0) - { - return Topic_Subscribe((ll_service_t *)(&ctx.ll_service_table[0]), topic_id); - } - return Topic_Subscribe(ll_service, topic_id); -} -/****************************************************************************** - * @brief Remove mutlicast topic to service bank and node mask - * @param ll_service - * @param topic - * @return Error - ******************************************************************************/ -error_return_t Robus_TopicUnsubscribe(ll_service_t *ll_service, uint16_t topic_id) -{ - error_return_t err; - - // delete topic from service list - if (ll_service == 0) - { - err = Topic_Unsubscribe((ll_service_t *)(&ctx.ll_service_table[0]), topic_id); - } - else - { - err = Topic_Unsubscribe(ll_service, topic_id); - } - - if (err == SUCCEED) - { - for (uint16_t i = 0; i < ctx.ll_service_number; i++) - { - if (Topic_IsTopicSubscribed((ll_service_t *)(&ctx.ll_service_table[i]), topic_id) == true) - { - return err; - } - } - // calculate mask after topic deletion - ctx.TopicMask[(topic_id / 8)] -= 1 << (topic_id - ((int)(topic_id / 8)) * 8); - } - return err; -} diff --git a/test/test_robus/main.c b/test/test_robus/main.c index 4c9862a7c..df6dc34bc 100644 --- a/test/test_robus/main.c +++ b/test/test_robus/main.c @@ -63,20 +63,20 @@ void unittest_Robus_IDMaskCalculation() } } -void unittest_Robus_TopicSubscribe(void) +void unittest_Luos_Subscribe(void) { NEW_TEST_CASE("Normal Add to node topic list"); { // Init default scenario context Init_Context(); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, 0); + Luos_Subscribe(default_sc.App_1.app, 0); TEST_ASSERT_EQUAL(0x01, ctx.TopicMask[0]); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, 4); + Luos_Subscribe(default_sc.App_1.app, 4); TEST_ASSERT_EQUAL(0x11, ctx.TopicMask[0]); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, 6); + Luos_Subscribe(default_sc.App_1.app, 6); TEST_ASSERT_EQUAL(0x51, ctx.TopicMask[0]); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, 18); + Luos_Subscribe(default_sc.App_1.app, 18); TEST_ASSERT_EQUAL(0x51, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); @@ -88,12 +88,12 @@ void unittest_Robus_TopicSubscribe(void) RESET_ASSERT(); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, LAST_TOPIC); + Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC); TEST_ASSERT_FALSE(IS_ASSERT()); TRY { - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, LAST_TOPIC + 1); + Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC + 1); } TEST_ASSERT_TRUE(IS_ASSERT()); } @@ -102,18 +102,18 @@ void unittest_Robus_TopicSubscribe(void) // Init default scenario context Init_Context(); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, 0); + Luos_Subscribe(default_sc.App_1.app, 0); TEST_ASSERT_EQUAL(0x01, ctx.TopicMask[0]); - Robus_TopicSubscribe(default_sc.App_2.app->ll_service, 0); + Luos_Subscribe(default_sc.App_2.app, 0); TEST_ASSERT_EQUAL(0x01, ctx.TopicMask[0]); - Robus_TopicSubscribe(default_sc.App_3.app->ll_service, 0); + Luos_Subscribe(default_sc.App_3.app, 0); TEST_ASSERT_EQUAL(0x01, ctx.TopicMask[0]); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, 4); + Luos_Subscribe(default_sc.App_1.app, 4); TEST_ASSERT_EQUAL(0x11, ctx.TopicMask[0]); - Robus_TopicSubscribe(default_sc.App_2.app->ll_service, 4); + Luos_Subscribe(default_sc.App_2.app, 4); TEST_ASSERT_EQUAL(0x11, ctx.TopicMask[0]); - Robus_TopicSubscribe(default_sc.App_3.app->ll_service, 4); + Luos_Subscribe(default_sc.App_3.app, 4); TEST_ASSERT_EQUAL(0x11, ctx.TopicMask[0]); } } @@ -125,7 +125,7 @@ void unittest_Robus_TopicUnsubscribe(void) // Init default scenario context Init_Context(); - error_return_t err = Robus_TopicUnsubscribe(default_sc.App_1.app->ll_service, 3); + error_return_t err = Luos_Unsubscribe(default_sc.App_1.app, 3); TEST_ASSERT_EQUAL(FAILED, err); } NEW_TEST_CASE("Normal Remove from topic list"); @@ -133,27 +133,27 @@ void unittest_Robus_TopicUnsubscribe(void) // Init default scenario context Init_Context(); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, 0); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, 4); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, 6); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, 18); + Luos_Subscribe(default_sc.App_1.app, 0); + Luos_Subscribe(default_sc.App_1.app, 4); + Luos_Subscribe(default_sc.App_1.app, 6); + Luos_Subscribe(default_sc.App_1.app, 18); TEST_ASSERT_EQUAL(0x51, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); - Robus_TopicUnsubscribe(default_sc.App_1.app->ll_service, 4); + Luos_Unsubscribe(default_sc.App_1.app, 4); TEST_ASSERT_EQUAL(0x41, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); - Robus_TopicUnsubscribe(default_sc.App_1.app->ll_service, 0); + Luos_Unsubscribe(default_sc.App_1.app, 0); TEST_ASSERT_EQUAL(0x40, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); - Robus_TopicUnsubscribe(default_sc.App_1.app->ll_service, 6); + Luos_Unsubscribe(default_sc.App_1.app, 6); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); - Robus_TopicUnsubscribe(default_sc.App_1.app->ll_service, 18); + Luos_Unsubscribe(default_sc.App_1.app, 18); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[2]); @@ -162,56 +162,56 @@ void unittest_Robus_TopicUnsubscribe(void) { // Init default scenario context Init_Context(); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, LAST_TOPIC - 1); + Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC - 1); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x08, ctx.TopicMask[2]); - Robus_TopicUnsubscribe(default_sc.App_1.app->ll_service, LAST_TOPIC - 1); + Luos_Unsubscribe(default_sc.App_1.app, LAST_TOPIC - 1); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[2]); - error_return_t err = Robus_TopicUnsubscribe(default_sc.App_1.app->ll_service, LAST_TOPIC); + error_return_t err = Luos_Unsubscribe(default_sc.App_1.app, LAST_TOPIC); TEST_ASSERT_EQUAL(err, FAILED); } NEW_TEST_CASE("Remove multiple times same topic"); { // Init default scenario context Init_Context(); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, 0); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, 4); - Robus_TopicSubscribe(default_sc.App_2.app->ll_service, 4); - Robus_TopicSubscribe(default_sc.App_3.app->ll_service, 4); - Robus_TopicSubscribe(default_sc.App_2.app->ll_service, 6); - Robus_TopicSubscribe(default_sc.App_3.app->ll_service, 6); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, 18); - Robus_TopicSubscribe(default_sc.App_2.app->ll_service, 18); + Luos_Subscribe(default_sc.App_1.app, 0); + Luos_Subscribe(default_sc.App_1.app, 4); + Luos_Subscribe(default_sc.App_2.app, 4); + Luos_Subscribe(default_sc.App_3.app, 4); + Luos_Subscribe(default_sc.App_2.app, 6); + Luos_Subscribe(default_sc.App_3.app, 6); + Luos_Subscribe(default_sc.App_1.app, 18); + Luos_Subscribe(default_sc.App_2.app, 18); TEST_ASSERT_EQUAL(0x51, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); - Robus_TopicUnsubscribe(default_sc.App_1.app->ll_service, 4); + Luos_Unsubscribe(default_sc.App_1.app, 4); TEST_ASSERT_EQUAL(0x51, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); - Robus_TopicUnsubscribe(default_sc.App_2.app->ll_service, 4); + Luos_Unsubscribe(default_sc.App_2.app, 4); TEST_ASSERT_EQUAL(0x51, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); - Robus_TopicUnsubscribe(default_sc.App_3.app->ll_service, 4); + Luos_Unsubscribe(default_sc.App_3.app, 4); TEST_ASSERT_EQUAL(0x41, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); - Robus_TopicUnsubscribe(default_sc.App_2.app->ll_service, 6); + Luos_Unsubscribe(default_sc.App_2.app, 6); TEST_ASSERT_EQUAL(0x41, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); - Robus_TopicUnsubscribe(default_sc.App_3.app->ll_service, 6); + Luos_Unsubscribe(default_sc.App_3.app, 6); TEST_ASSERT_EQUAL(0x01, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); - Robus_TopicUnsubscribe(default_sc.App_1.app->ll_service, 18); + Luos_Unsubscribe(default_sc.App_1.app, 18); TEST_ASSERT_EQUAL(0x01, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); - Robus_TopicUnsubscribe(default_sc.App_2.app->ll_service, 18); + Luos_Unsubscribe(default_sc.App_2.app, 18); TEST_ASSERT_EQUAL(0x01, ctx.TopicMask[0]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[2]); @@ -224,7 +224,7 @@ int main(int argc, char **argv) // Big data reception UNIT_TEST_RUN(unittest_Robus_IDMaskCalculation); - UNIT_TEST_RUN(unittest_Robus_TopicSubscribe); + UNIT_TEST_RUN(unittest_Luos_Subscribe); UNIT_TEST_RUN(unittest_Robus_TopicUnsubscribe); UNITY_END(); diff --git a/test/test_topic/main.c b/test/test_topic/main.c index 746df66b4..f8bb378b5 100644 --- a/test/test_topic/main.c +++ b/test/test_topic/main.c @@ -1,39 +1,39 @@ #include "main.h" #include "robus.h" #include "context.h" -#include "topic.h" +#include "pub_sub.h" #include #include extern default_scenario_t default_sc; -void unittest_Topic_IsTopicSubscribed(void) +void unittest_PubSub_IsTopicSubscribed(void) { NEW_TEST_CASE("Search Topics"); { // Init default scenario context Init_Context(); - Robus_TopicSubscribe(default_sc.App_1.app->ll_service, 1); - Robus_TopicSubscribe(default_sc.App_2.app->ll_service, 18); + Luos_Subscribe(default_sc.App_1.app, 1); + Luos_Subscribe(default_sc.App_2.app, 18); - TEST_ASSERT_TRUE(Topic_IsTopicSubscribed(default_sc.App_1.app->ll_service, 1)); - TEST_ASSERT_FALSE(Topic_IsTopicSubscribed(default_sc.App_2.app->ll_service, 1)); - TEST_ASSERT_FALSE(Topic_IsTopicSubscribed(default_sc.App_1.app->ll_service, 18)); - TEST_ASSERT_TRUE(Topic_IsTopicSubscribed(default_sc.App_2.app->ll_service, 18)); + TEST_ASSERT_TRUE(PubSub_IsTopicSubscribed(default_sc.App_1.app->ll_service, 1)); + TEST_ASSERT_FALSE(PubSub_IsTopicSubscribed(default_sc.App_2.app->ll_service, 1)); + TEST_ASSERT_FALSE(PubSub_IsTopicSubscribed(default_sc.App_1.app->ll_service, 18)); + TEST_ASSERT_TRUE(PubSub_IsTopicSubscribed(default_sc.App_2.app->ll_service, 18)); } } -void unittest_Topic_Subscribe(void) +void unittest_Luos_Subscribe(void) { NEW_TEST_CASE("Add random Topics"); { // Init default scenario context Init_Context(); - TEST_ASSERT_EQUAL(SUCCEED, Topic_Subscribe(default_sc.App_1.app->ll_service, 1)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, 1)); - TEST_ASSERT_EQUAL(SUCCEED, Topic_Subscribe(default_sc.App_1.app->ll_service, 18)); - TEST_ASSERT_EQUAL(SUCCEED, Topic_Subscribe(default_sc.App_1.app->ll_service, 27)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, 18)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, 27)); TEST_ASSERT_EQUAL(3, default_sc.App_1.app->ll_service->last_topic_position); TEST_ASSERT_EQUAL(1, default_sc.App_1.app->ll_service->topic_list[0]); TEST_ASSERT_EQUAL(18, default_sc.App_1.app->ll_service->topic_list[1]); @@ -46,47 +46,47 @@ void unittest_Topic_Subscribe(void) for (uint8_t i = 0; i < LAST_TOPIC; i++) { - TEST_ASSERT_EQUAL(SUCCEED, Topic_Subscribe(default_sc.App_1.app->ll_service, i)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, i)); TEST_ASSERT_EQUAL(i + 1, default_sc.App_1.app->ll_service->last_topic_position); } - TEST_ASSERT_EQUAL(FAILED, Topic_Subscribe(default_sc.App_1.app->ll_service, LAST_TOPIC)); + TEST_ASSERT_EQUAL(FAILED, Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC)); TEST_ASSERT_EQUAL(LAST_TOPIC, default_sc.App_1.app->ll_service->last_topic_position); - TEST_ASSERT_FALSE(Topic_IsTopicSubscribed(default_sc.App_1.app->ll_service, LAST_TOPIC)); + TEST_ASSERT_FALSE(PubSub_IsTopicSubscribed(default_sc.App_1.app->ll_service, LAST_TOPIC)); } } -void unittest_Topic_Unsubscribe(void) +void unittest_Luos_Unsubscribe(void) { NEW_TEST_CASE("Remove random topics"); { // Init default scenario context Init_Context(); - Topic_Subscribe(default_sc.App_1.app->ll_service, 2); - Topic_Subscribe(default_sc.App_1.app->ll_service, 7); - Topic_Subscribe(default_sc.App_1.app->ll_service, 17); + Luos_Subscribe(default_sc.App_1.app, 2); + Luos_Subscribe(default_sc.App_1.app, 7); + Luos_Subscribe(default_sc.App_1.app, 17); TEST_ASSERT_EQUAL(3, default_sc.App_1.app->ll_service->last_topic_position); TEST_ASSERT_EQUAL(2, default_sc.App_1.app->ll_service->topic_list[0]); TEST_ASSERT_EQUAL(7, default_sc.App_1.app->ll_service->topic_list[1]); TEST_ASSERT_EQUAL(17, default_sc.App_1.app->ll_service->topic_list[2]); - TEST_ASSERT_EQUAL(SUCCEED, Topic_Unsubscribe(default_sc.App_1.app->ll_service, 7)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 7)); TEST_ASSERT_EQUAL(2, default_sc.App_1.app->ll_service->last_topic_position); TEST_ASSERT_EQUAL(2, default_sc.App_1.app->ll_service->topic_list[0]); TEST_ASSERT_EQUAL(17, default_sc.App_1.app->ll_service->topic_list[1]); - TEST_ASSERT_EQUAL(FAILED, Topic_Unsubscribe(default_sc.App_1.app->ll_service, 18)); + TEST_ASSERT_EQUAL(FAILED, Luos_Unsubscribe(default_sc.App_1.app, 18)); TEST_ASSERT_EQUAL(2, default_sc.App_1.app->ll_service->last_topic_position); TEST_ASSERT_EQUAL(2, default_sc.App_1.app->ll_service->topic_list[0]); TEST_ASSERT_EQUAL(17, default_sc.App_1.app->ll_service->topic_list[1]); - TEST_ASSERT_EQUAL(SUCCEED, Topic_Unsubscribe(default_sc.App_1.app->ll_service, 17)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 17)); TEST_ASSERT_EQUAL(1, default_sc.App_1.app->ll_service->last_topic_position); TEST_ASSERT_EQUAL(2, default_sc.App_1.app->ll_service->topic_list[0]); - TEST_ASSERT_EQUAL(SUCCEED, Topic_Unsubscribe(default_sc.App_1.app->ll_service, 2)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 2)); TEST_ASSERT_EQUAL(0, default_sc.App_1.app->ll_service->last_topic_position); } NEW_TEST_CASE("Remove same topic"); @@ -94,14 +94,14 @@ void unittest_Topic_Unsubscribe(void) // Init default scenario context Init_Context(); - Topic_Subscribe(default_sc.App_1.app->ll_service, 2); - Topic_Subscribe(default_sc.App_1.app->ll_service, 17); + Luos_Subscribe(default_sc.App_1.app, 2); + Luos_Subscribe(default_sc.App_1.app, 17); - TEST_ASSERT_EQUAL(SUCCEED, Topic_Unsubscribe(default_sc.App_1.app->ll_service, 2)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 2)); TEST_ASSERT_EQUAL(1, default_sc.App_1.app->ll_service->last_topic_position); TEST_ASSERT_EQUAL(17, default_sc.App_1.app->ll_service->topic_list[0]); - TEST_ASSERT_EQUAL(FAILED, Topic_Unsubscribe(default_sc.App_1.app->ll_service, 2)); + TEST_ASSERT_EQUAL(FAILED, Luos_Unsubscribe(default_sc.App_1.app, 2)); TEST_ASSERT_EQUAL(1, default_sc.App_1.app->ll_service->last_topic_position); TEST_ASSERT_EQUAL(17, default_sc.App_1.app->ll_service->topic_list[0]); } @@ -111,22 +111,22 @@ void unittest_Topic_Unsubscribe(void) // Init default scenario context Init_Context(); - Topic_Subscribe(default_sc.App_1.app->ll_service, 2); + Luos_Subscribe(default_sc.App_1.app, 2); default_sc.App_1.app->ll_service->last_topic_position = LAST_TOPIC - 1; - TEST_ASSERT_EQUAL(SUCCEED, Topic_Unsubscribe(default_sc.App_1.app->ll_service, 2)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 2)); - Topic_Subscribe(default_sc.App_1.app->ll_service, 2); + Luos_Subscribe(default_sc.App_1.app, 2); default_sc.App_1.app->ll_service->last_topic_position = LAST_TOPIC; - TEST_ASSERT_EQUAL(FAILED, Topic_Unsubscribe(default_sc.App_1.app->ll_service, 2)); + TEST_ASSERT_EQUAL(FAILED, Luos_Unsubscribe(default_sc.App_1.app, 2)); } } int main(int argc, char **argv) { UNITY_BEGIN(); - UNIT_TEST_RUN(unittest_Topic_IsTopicSubscribed); - UNIT_TEST_RUN(unittest_Topic_Subscribe); - UNIT_TEST_RUN(unittest_Topic_Unsubscribe); + UNIT_TEST_RUN(unittest_PubSub_IsTopicSubscribed); + UNIT_TEST_RUN(unittest_Luos_Subscribe); + UNIT_TEST_RUN(unittest_Luos_Unsubscribe); UNITY_END(); } \ No newline at end of file From fbba385b1c9058a792187bb38650691374d12035 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 31 Mar 2023 20:04:22 +0200 Subject: [PATCH 012/150] Group all streaming functions on streaming.c/.h --- engine/core/inc/luos_engine.h | 12 +- engine/core/inc/streaming.h | 17 +- engine/core/src/luos_engine.c | 101 ---- engine/core/src/streaming.c | 133 ++++- .../bldc_simple_foc/lib/motor/motor.cpp | 14 +- .../stepper_simple_foc/lib/motor/motor.cpp | 14 +- ...uos_bootloader_samd21j18a.X.production.map | 22 +- .../lib/Controller_motor/controller_motor.c | 14 +- examples/projects/l0/dxl/lib/Dxl/dxl.c | 12 +- .../core/driver/eMPL/dmpKey.h | 531 +++++++++--------- test/test_luos/main.c | 56 +- test/test_luos/main.h | 2 +- tool_services/gate/pipe_link.c | 2 +- tool_services/inspector/pipe_link.c | 2 +- .../pipe/SERIAL/ARDUINO/pipe_com.cpp | 4 +- .../pipe/SERIAL/ESP32_IDF/pipe_com.c | 4 +- .../pipe/SERIAL/NUCLEO-F0/pipe_com.c | 4 +- .../pipe/SERIAL/NUCLEO-F4/pipe_com.c | 4 +- .../pipe/SERIAL/NUCLEO-G431/pipe_com.c | 4 +- .../pipe/SERIAL/NUCLEO-G474/pipe_com.c | 4 +- .../pipe/SERIAL/NUCLEO-L0/pipe_com.c | 4 +- .../pipe/SERIAL/NUCLEO-L4/pipe_com.c | 4 +- tool_services/pipe/SERIAL/l0/pipe_com.c | 4 +- tool_services/pipe/SERIAL/serial_protocol.h | 22 +- tool_services/pipe/WS/ARDUINO/pipe_com.cpp | 12 +- tool_services/pipe/WS/ESP32_IDF/pipe_com.c | 12 +- tool_services/pipe/WS/native/pipe_com.c | 12 +- tool_services/pipe/pipe.c | 6 +- 28 files changed, 516 insertions(+), 516 deletions(-) diff --git a/engine/core/inc/luos_engine.h b/engine/core/inc/luos_engine.h index d1978f5ab..8a51c9386 100644 --- a/engine/core/inc/luos_engine.h +++ b/engine/core/inc/luos_engine.h @@ -11,7 +11,6 @@ #include "service_structs.h" #include "routing_table.h" #include "luos_od.h" -#include "streaming.h" /******************************************************************************* * Definitions @@ -62,6 +61,12 @@ void Luos_Detect(service_t *service); void Luos_ServicesClear(void); // ***************** Messaging management ***************** +// *** Streaming management *** +#include "streaming.h" +void Luos_SendStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream); +void Luos_SendStreamingSize(service_t *service, msg_t *msg, streaming_channel_t *stream, uint32_t max_size); +error_return_t Luos_ReceiveStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream); + void Luos_Flush(void); // *** Timestamping management *** @@ -78,11 +83,6 @@ error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic); void Luos_SendData(service_t *service, msg_t *msg, void *bin_data, uint16_t size); int Luos_ReceiveData(service_t *service, msg_t *msg, void *bin_data); -// *** Streaming management *** -void Luos_SendStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream); -void Luos_SendStreamingSize(service_t *service, msg_t *msg, streaming_channel_t *stream, uint32_t max_size); -error_return_t Luos_ReceiveStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream); - // *** Pub/Sub management (in file `pub_sub.c`)*** error_return_t PubSub_Subscribe(service_t *service, uint16_t topic); error_return_t PubSub_Unsubscribe(service_t *service, uint16_t topic); diff --git a/engine/core/inc/streaming.h b/engine/core/inc/streaming.h index 5c145aaa7..fc47cf9cc 100644 --- a/engine/core/inc/streaming.h +++ b/engine/core/inc/streaming.h @@ -15,6 +15,7 @@ ******************************************************************************/ #ifndef STREAMING_H #define STREAMING_H +#include "service_structs.h" #include /******************************************************************************* @@ -35,13 +36,13 @@ typedef struct /******************************************************************************* * Function ******************************************************************************/ -streaming_channel_t Stream_CreateStreamingChannel(const void *ring_buffer, uint16_t ring_buffer_size, uint8_t data_size); -void Stream_ResetStreamingChannel(streaming_channel_t *stream); -uint16_t Stream_PutSample(streaming_channel_t *stream, const void *data, uint16_t size); -uint16_t Stream_GetSample(streaming_channel_t *stream, void *data, uint16_t size); -uint16_t Stream_GetAvailableSampleNB(streaming_channel_t *stream); -uint16_t Stream_GetAvailableSampleNBUntilEndBuffer(streaming_channel_t *stream); -uint16_t Stream_AddAvailableSampleNB(streaming_channel_t *stream, uint16_t size); -uint16_t Stream_RmvAvailableSampleNB(streaming_channel_t *stream, uint16_t size); +streaming_channel_t Streaming_CreateChannel(const void *ring_buffer, uint16_t ring_buffer_size, uint8_t data_size); +void Streaming_ResetChannel(streaming_channel_t *stream); +uint16_t Streaming_PutSample(streaming_channel_t *stream, const void *data, uint16_t size); +uint16_t Streaming_GetSample(streaming_channel_t *stream, void *data, uint16_t size); +uint16_t Streaming_GetAvailableSampleNB(streaming_channel_t *stream); +uint16_t Streaming_GetAvailableSampleNBUntilEndBuffer(streaming_channel_t *stream); +uint16_t Streaming_AddAvailableSampleNB(streaming_channel_t *stream, uint16_t size); +uint16_t Streaming_RmvAvailableSampleNB(streaming_channel_t *stream, uint16_t size); #endif /* LUOS_H */ diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 3a91ec320..05c02cb96 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -843,107 +843,6 @@ int Luos_ReceiveData(service_t *service, msg_t *msg, void *bin_data) } return 0; } -/****************************************************************************** - * @brief Send datas of a streaming channel - * @param Service : Who send - * @param msg : Message to send - * @param stram: Streaming channel pointer - * @return None - ******************************************************************************/ -void Luos_SendStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream) -{ - // Compute number of message needed to send available datas on ring buffer - Luos_SendStreamingSize(service, msg, stream, Stream_GetAvailableSampleNB(stream)); -} -/****************************************************************************** - * @brief Send a number of datas of a streaming channel - * @param service : Who send - * @param msg : Message to send - * @param stream : Streaming channel pointer - * @param max_size : Maximum sample to send - * @return None - ******************************************************************************/ -void Luos_SendStreamingSize(service_t *service, msg_t *msg, streaming_channel_t *stream, uint32_t max_size) -{ - // Compute number of message needed to send available datas on ring buffer - int msg_number = 1; - int data_size = Stream_GetAvailableSampleNB(stream); - if (data_size > max_size) - { - data_size = max_size; - } - const int max_data_msg_size = (MAX_DATA_MSG_SIZE / stream->data_size); - if (data_size > max_data_msg_size) - { - msg_number = (data_size / max_data_msg_size); - msg_number += ((msg_number * max_data_msg_size) < data_size); - } - - // Send messages one by one - for (volatile uint16_t chunk = 0; chunk < msg_number; chunk++) - { - // compute chunk size - uint16_t chunk_size = 0; - if (data_size > max_data_msg_size) - { - chunk_size = max_data_msg_size; - } - else - { - chunk_size = data_size; - } - - // Copy data into message - Stream_GetSample(stream, msg->data, chunk_size); - msg->header.size = data_size; - - // Send message - uint32_t tickstart = Luos_GetSystick(); - while (Luos_SendMsg(service, msg) == FAILED) - { - // No more memory space available - // 500ms of timeout after start trying to load our data in memory. Perhaps the buffer is full of RX messages try to increate the buffer size. - LUOS_ASSERT(((volatile uint32_t)Luos_GetSystick() - tickstart) < 500); - } - - // check end of data - if (data_size > max_data_msg_size) - { - data_size -= max_data_msg_size; - } - else - { - data_size = 0; - } - } -} -/****************************************************************************** - * @brief Receive a streaming channel datas - * @param service : Who send - * @param msg : Message to send - * @param stream : Streaming channel pointer - * @return error - ******************************************************************************/ -error_return_t Luos_ReceiveStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream) -{ - // Get chunk size - unsigned short chunk_size = 0; - if (msg->header.size > MAX_DATA_MSG_SIZE) - chunk_size = MAX_DATA_MSG_SIZE; - else - chunk_size = msg->header.size; - - // Copy data into buffer - Stream_PutSample(stream, msg->data, (chunk_size / stream->data_size)); - - // Check end of data - if ((msg->header.size <= MAX_DATA_MSG_SIZE)) - { - // Chunk collection finished - return SUCCEED; - } - return FAILED; -} /****************************************************************************** * @brief Store alias name service in flash * @param service : Service to store diff --git a/engine/core/src/streaming.c b/engine/core/src/streaming.c index 3bf037b75..ef7eeaa9d 100644 --- a/engine/core/src/streaming.c +++ b/engine/core/src/streaming.c @@ -5,6 +5,7 @@ * @version 0.0.0 ******************************************************************************/ #include +#include "luos_engine.h" #include "streaming.h" #include "luos_utils.h" /******************************************************************************* @@ -26,7 +27,7 @@ * @param data_size : Values size. * @return Streaming channel ******************************************************************************/ -streaming_channel_t Stream_CreateStreamingChannel(const void *ring_buffer, uint16_t ring_buffer_size, uint8_t data_size) +streaming_channel_t Streaming_CreateChannel(const void *ring_buffer, uint16_t ring_buffer_size, uint8_t data_size) { streaming_channel_t stream; LUOS_ASSERT((ring_buffer != NULL) || (ring_buffer_size > 0) || (data_size > 0)); @@ -45,7 +46,7 @@ streaming_channel_t Stream_CreateStreamingChannel(const void *ring_buffer, uint1 * @param stream : Streaming channel pointer * @return None ******************************************************************************/ -void Stream_ResetStreamingChannel(streaming_channel_t *stream) +void Streaming_ResetChannel(streaming_channel_t *stream) { stream->data_ptr = stream->ring_buffer; stream->sample_ptr = stream->ring_buffer; @@ -57,10 +58,10 @@ void Stream_ResetStreamingChannel(streaming_channel_t *stream) * @param size : The number of data to copy * @return Number of samples to put in buffer ******************************************************************************/ -uint16_t Stream_PutSample(streaming_channel_t *stream, const void *data, uint16_t size) +uint16_t Streaming_PutSample(streaming_channel_t *stream, const void *data, uint16_t size) { // check if we exceed ring buffer capacity - LUOS_ASSERT((Stream_GetAvailableSampleNB(stream) + size) <= (stream->end_ring_buffer - stream->ring_buffer)); + LUOS_ASSERT((Streaming_GetAvailableSampleNB(stream) + size) <= (stream->end_ring_buffer - stream->ring_buffer)); if (((size * stream->data_size) + stream->data_ptr) >= stream->end_ring_buffer) { // our data exceeds ring buffer end, cut it and copy. @@ -79,7 +80,7 @@ uint16_t Stream_PutSample(streaming_channel_t *stream, const void *data, uint16_ // Set the new data pointer stream->data_ptr = stream->data_ptr + (size * stream->data_size); } - return Stream_GetAvailableSampleNB(stream); + return Streaming_GetAvailableSampleNB(stream); } /****************************************************************************** * @brief Copy a sample from ring buffer to a data. @@ -88,9 +89,9 @@ uint16_t Stream_PutSample(streaming_channel_t *stream, const void *data, uint16_ * @param size : data size * @return None ******************************************************************************/ -uint16_t Stream_GetSample(streaming_channel_t *stream, void *data, uint16_t size) +uint16_t Streaming_GetSample(streaming_channel_t *stream, void *data, uint16_t size) { - uint16_t nb_available_samples = Stream_GetAvailableSampleNB(stream); + uint16_t nb_available_samples = Streaming_GetAvailableSampleNB(stream); if (nb_available_samples >= size) { // check if we need to loop in ring buffer @@ -125,7 +126,7 @@ uint16_t Stream_GetSample(streaming_channel_t *stream, void *data, uint16_t size * @param stream : Streaming channel pointer * @return Number of availabled samples ******************************************************************************/ -uint16_t Stream_GetAvailableSampleNB(streaming_channel_t *stream) +uint16_t Streaming_GetAvailableSampleNB(streaming_channel_t *stream) { int32_t nb_available_sample = (stream->data_ptr - stream->sample_ptr) / stream->data_size; if (nb_available_sample < 0) @@ -141,7 +142,7 @@ uint16_t Stream_GetAvailableSampleNB(streaming_channel_t *stream) * @param stream : Streaming channel pointer * @return Number of available samples ******************************************************************************/ -uint16_t Stream_GetAvailableSampleNBUntilEndBuffer(streaming_channel_t *stream) +uint16_t Streaming_GetAvailableSampleNBUntilEndBuffer(streaming_channel_t *stream) { int32_t nb_available_sample = (stream->data_ptr - stream->sample_ptr) / stream->data_size; if (nb_available_sample < 0) @@ -158,9 +159,9 @@ uint16_t Stream_GetAvailableSampleNBUntilEndBuffer(streaming_channel_t *stream) * @param size : The number of data to copy * @return Number of samples to add to channel ******************************************************************************/ -uint16_t Stream_AddAvailableSampleNB(streaming_channel_t *stream, uint16_t size) +uint16_t Streaming_AddAvailableSampleNB(streaming_channel_t *stream, uint16_t size) { - LUOS_ASSERT((uint32_t)(Stream_GetAvailableSampleNB(stream) + size) < (uint32_t)(stream->end_ring_buffer - stream->ring_buffer)); + LUOS_ASSERT((uint32_t)(Streaming_GetAvailableSampleNB(stream) + size) < (uint32_t)(stream->end_ring_buffer - stream->ring_buffer)); if (((size * stream->data_size) + stream->data_ptr) >= stream->end_ring_buffer) { uint16_t chunk1 = stream->end_ring_buffer - stream->data_ptr; @@ -171,7 +172,7 @@ uint16_t Stream_AddAvailableSampleNB(streaming_channel_t *stream, uint16_t size) { stream->data_ptr = stream->data_ptr + (size * stream->data_size); } - return Stream_GetAvailableSampleNB(stream); + return Streaming_GetAvailableSampleNB(stream); } /****************************************************************************** * @brief Remove a specific number of samples in buffer @@ -179,9 +180,9 @@ uint16_t Stream_AddAvailableSampleNB(streaming_channel_t *stream, uint16_t size) * @param size : The number of data to remove * @return Number of availabled samples ******************************************************************************/ -uint16_t Stream_RmvAvailableSampleNB(streaming_channel_t *stream, uint16_t size) +uint16_t Streaming_RmvAvailableSampleNB(streaming_channel_t *stream, uint16_t size) { - LUOS_ASSERT(Stream_GetAvailableSampleNB(stream) >= size); + LUOS_ASSERT(Streaming_GetAvailableSampleNB(stream) >= size); // Check if we exceed ring buffer capacity if (((size * stream->data_size) + stream->sample_ptr) > stream->end_ring_buffer) { @@ -199,5 +200,107 @@ uint16_t Stream_RmvAvailableSampleNB(streaming_channel_t *stream, uint16_t size) stream->sample_ptr = stream->ring_buffer; } } - return Stream_GetAvailableSampleNB(stream); + return Streaming_GetAvailableSampleNB(stream); } + +/****************************************************************************** + * @brief Send datas of a streaming channel + * @param Service : Who send + * @param msg : Message to send + * @param stram: Streaming channel pointer + * @return None + ******************************************************************************/ +void Luos_SendStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream) +{ + // Compute number of message needed to send available datas on ring buffer + Luos_SendStreamingSize(service, msg, stream, Streaming_GetAvailableSampleNB(stream)); +} +/****************************************************************************** + * @brief Send a number of datas of a streaming channel + * @param service : Who send + * @param msg : Message to send + * @param stream : Streaming channel pointer + * @param max_size : Maximum sample to send + * @return None + ******************************************************************************/ +void Luos_SendStreamingSize(service_t *service, msg_t *msg, streaming_channel_t *stream, uint32_t max_size) +{ + // Compute number of message needed to send available datas on ring buffer + int msg_number = 1; + int data_size = Streaming_GetAvailableSampleNB(stream); + if (data_size > max_size) + { + data_size = max_size; + } + const int max_data_msg_size = (MAX_DATA_MSG_SIZE / stream->data_size); + if (data_size > max_data_msg_size) + { + msg_number = (data_size / max_data_msg_size); + msg_number += ((msg_number * max_data_msg_size) < data_size); + } + + // Send messages one by one + for (volatile uint16_t chunk = 0; chunk < msg_number; chunk++) + { + // compute chunk size + uint16_t chunk_size = 0; + if (data_size > max_data_msg_size) + { + chunk_size = max_data_msg_size; + } + else + { + chunk_size = data_size; + } + + // Copy data into message + Streaming_GetSample(stream, msg->data, chunk_size); + msg->header.size = data_size; + + // Send message + uint32_t tickstart = Luos_GetSystick(); + while (Luos_SendMsg(service, msg) == FAILED) + { + // No more memory space available + // 500ms of timeout after start trying to load our data in memory. Perhaps the buffer is full of RX messages try to increate the buffer size. + LUOS_ASSERT(((volatile uint32_t)Luos_GetSystick() - tickstart) < 500); + } + + // check end of data + if (data_size > max_data_msg_size) + { + data_size -= max_data_msg_size; + } + else + { + data_size = 0; + } + } +} +/****************************************************************************** + * @brief Receive a streaming channel datas + * @param service : Who send + * @param msg : Message to send + * @param stream : Streaming channel pointer + * @return error + ******************************************************************************/ +error_return_t Luos_ReceiveStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream) +{ + // Get chunk size + unsigned short chunk_size = 0; + if (msg->header.size > MAX_DATA_MSG_SIZE) + chunk_size = MAX_DATA_MSG_SIZE; + else + chunk_size = msg->header.size; + + // Copy data into buffer + Streaming_PutSample(stream, msg->data, (chunk_size / stream->data_size)); + + // Check end of data + if ((msg->header.size <= MAX_DATA_MSG_SIZE)) + { + // Chunk collection finished + return SUCCEED; + } + return FAILED; +} \ No newline at end of file diff --git a/examples/projects/Arduino/bldc_simple_foc/lib/motor/motor.cpp b/examples/projects/Arduino/bldc_simple_foc/lib/motor/motor.cpp index ec9930066..6591e809e 100644 --- a/examples/projects/Arduino/bldc_simple_foc/lib/motor/motor.cpp +++ b/examples/projects/Arduino/bldc_simple_foc/lib/motor/motor.cpp @@ -114,8 +114,8 @@ void Motor_Init(void) // Streaming control channels servo_motor.control.unmap = 0; // PLAY and no REC servo_motor.sampling_period = TimeOD_TimeFrom_ms(SAMPLING_PERIOD_MS); - servo_motor.trajectory = Stream_CreateStreamingChannel((float *)trajectory_buf, BUFFER_SIZE, sizeof(float)); - servo_motor.measurement = Stream_CreateStreamingChannel((float *)measurement_buf, BUFFER_SIZE, sizeof(float)); + servo_motor.trajectory = Streaming_CreateChannel((float *)trajectory_buf, BUFFER_SIZE, sizeof(float)); + servo_motor.measurement = Streaming_CreateChannel((float *)measurement_buf, BUFFER_SIZE, sizeof(float)); // initialize tick variable tickstart = millis(); @@ -267,26 +267,26 @@ void Motor_TrajectoryCallback(void) if (servo_motor.control.rec && ((Luos_GetSystick() - last_rec_systick) >= TimeOD_TimeTo_ms(servo_motor.sampling_period))) { // We have to save a sample of current position - Stream_PutSample(&servo_motor.measurement, (angular_position_t *)&servo_motor.angular_position, 1); + Streaming_PutSample(&servo_motor.measurement, (angular_position_t *)&servo_motor.angular_position, 1); last_rec_systick = Luos_GetSystick(); } // ****** trajectory management ********* static uint32_t last_systick = 0; if (servo_motor.control.flux == STOP) { - Stream_ResetStreamingChannel(&servo_motor.trajectory); + Streaming_ResetChannel(&servo_motor.trajectory); } - if ((Stream_GetAvailableSampleNB(&servo_motor.trajectory) > 0) && ((Luos_GetSystick() - last_systick) >= TimeOD_TimeTo_ms(servo_motor.sampling_period)) && (servo_motor.control.flux == PLAY)) + if ((Streaming_GetAvailableSampleNB(&servo_motor.trajectory) > 0) && ((Luos_GetSystick() - last_systick) >= TimeOD_TimeTo_ms(servo_motor.sampling_period)) && (servo_motor.control.flux == PLAY)) { if (servo_motor.mode.mode_linear_position == 1) { linear_position_t linear_position_tmp; - Stream_GetSample(&servo_motor.trajectory, &linear_position_tmp, 1); + Streaming_GetSample(&servo_motor.trajectory, &linear_position_tmp, 1); servo_motor.target_angular_position = AngularOD_PositionFrom_deg(LinearOD_PositionTo_m(linear_position_tmp) * 360.0 / (3.141592653589793 * LinearOD_PositionTo_m(servo_motor.wheel_diameter))); } else { - Stream_GetSample(&servo_motor.trajectory, (angular_position_t *)&servo_motor.target_angular_position, 1); + Streaming_GetSample(&servo_motor.trajectory, (angular_position_t *)&servo_motor.target_angular_position, 1); } last_systick = Luos_GetSystick(); } diff --git a/examples/projects/Arduino/stepper_simple_foc/lib/motor/motor.cpp b/examples/projects/Arduino/stepper_simple_foc/lib/motor/motor.cpp index 256ef66e5..a809743a5 100644 --- a/examples/projects/Arduino/stepper_simple_foc/lib/motor/motor.cpp +++ b/examples/projects/Arduino/stepper_simple_foc/lib/motor/motor.cpp @@ -104,8 +104,8 @@ void Motor_Init(void) // Streaming control channels servo_motor.control.unmap = 0; // PLAY and no REC servo_motor.sampling_period = TimeOD_TimeFrom_ms(SAMPLING_PERIOD_MS); - servo_motor.trajectory = Stream_CreateStreamingChannel((float *)trajectory_buf, BUFFER_SIZE, sizeof(float)); - servo_motor.measurement = Stream_CreateStreamingChannel((float *)measurement_buf, BUFFER_SIZE, sizeof(float)); + servo_motor.trajectory = Streaming_CreateChannel((float *)trajectory_buf, BUFFER_SIZE, sizeof(float)); + servo_motor.measurement = Streaming_CreateChannel((float *)measurement_buf, BUFFER_SIZE, sizeof(float)); // simple foc pwm driver initialization driver.pwm_frequency = NOT_SET; @@ -231,26 +231,26 @@ void Motor_TrajectoryCallback(void) if (servo_motor.control.rec && ((Luos_GetSystick() - last_rec_systick) >= TimeOD_TimeTo_ms(servo_motor.sampling_period))) { // We have to save a sample of current position - Stream_PutSample(&servo_motor.measurement, (angular_position_t *)&servo_motor.angular_position, 1); + Streaming_PutSample(&servo_motor.measurement, (angular_position_t *)&servo_motor.angular_position, 1); last_rec_systick = Luos_GetSystick(); } // ****** trajectory management ********* static uint32_t last_systick = 0; if (servo_motor.control.flux == STOP) { - Stream_ResetStreamingChannel(&servo_motor.trajectory); + Streaming_ResetChannel(&servo_motor.trajectory); } - if ((Stream_GetAvailableSampleNB(&servo_motor.trajectory) > 0) && ((Luos_GetSystick() - last_systick) >= TimeOD_TimeTo_ms(servo_motor.sampling_period)) && (servo_motor.control.flux == PLAY)) + if ((Streaming_GetAvailableSampleNB(&servo_motor.trajectory) > 0) && ((Luos_GetSystick() - last_systick) >= TimeOD_TimeTo_ms(servo_motor.sampling_period)) && (servo_motor.control.flux == PLAY)) { if (servo_motor.mode.mode_linear_position == 1) { linear_position_t linear_position_tmp; - Stream_GetSample(&servo_motor.trajectory, &linear_position_tmp, 1); + Streaming_GetSample(&servo_motor.trajectory, &linear_position_tmp, 1); servo_motor.target_angular_position = AngularOD_PositionFrom_deg(LinearOD_PositionTo_m(linear_position_tmp) * 360.0 / (3.141592653589793 * LinearOD_PositionTo_m(servo_motor.wheel_diameter))); } else { - Stream_GetSample(&servo_motor.trajectory, (angular_position_t *)&servo_motor.target_angular_position, 1); + Streaming_GetSample(&servo_motor.trajectory, (angular_position_t *)&servo_motor.target_angular_position, 1); } last_systick = Luos_GetSystick(); } diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map index c9eca9790..e31b62a1e 100644 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map +++ b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map @@ -587,7 +587,7 @@ Discarded input sections .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/luos_engine.o .text.Luos_ServicesClear 0x00000000 0x14 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_ReceiveStreaming + .text.Streaming_Receive 0x00000000 0x3c build/luos_bootloader/production/_ext/1555399743/luos_engine.o .text.Luos_SendBaudrate 0x00000000 0x5a build/luos_bootloader/production/_ext/1555399743/luos_engine.o @@ -601,9 +601,9 @@ Discarded input sections 0x00000000 0x8 build/luos_bootloader/production/_ext/1555399743/luos_engine.o .text.Luos_Flush 0x00000000 0x8 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_SendStreamingSize + .text.Streaming_SendSize 0x00000000 0xb8 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_SendStreaming + .text.Streaming_Send 0x00000000 0x1c build/luos_bootloader/production/_ext/1555399743/luos_engine.o .text.Luos_ReadMsg 0x00000000 0x44 build/luos_bootloader/production/_ext/1555399743/luos_engine.o @@ -689,21 +689,21 @@ Discarded input sections .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/streaming.o .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/streaming.o .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Stream_CreateStreamingChannel + .text.Streaming_CreateChannel 0x00000000 0x38 build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Stream_ResetStreamingChannel + .text.Streaming_ResetChannel 0x00000000 0x8 build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Stream_GetAvailableSampleNB + .text.Streaming_GetAvailableSampleNB 0x00000000 0x48 build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Stream_PutSample + .text.Streaming_PutSample 0x00000000 0x8c build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Stream_GetSample + .text.Streaming_GetSample 0x00000000 0x70 build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Stream_GetAvailableSampleNBUntilEndBuffer + .text.Streaming_GetAvailableSampleNBUntilEndBuffer 0x00000000 0x3c build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Stream_AddAvailableSampleNB + .text.Streaming_AddAvailableSampleNB 0x00000000 0x4c build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Stream_RmvAvailableSampleNB + .text.Streaming_RmvAvailableSampleNB 0x00000000 0x34 build/luos_bootloader/production/_ext/1555399743/streaming.o .rodata 0x00000000 0x30 build/luos_bootloader/production/_ext/1555399743/streaming.o .debug_info 0x00000000 0x15eb build/luos_bootloader/production/_ext/1555399743/streaming.o diff --git a/examples/projects/l0/controller_motor/lib/Controller_motor/controller_motor.c b/examples/projects/l0/controller_motor/lib/Controller_motor/controller_motor.c index 35005185d..30667ecba 100644 --- a/examples/projects/l0/controller_motor/lib/Controller_motor/controller_motor.c +++ b/examples/projects/l0/controller_motor/lib/Controller_motor/controller_motor.c @@ -106,8 +106,8 @@ void ControllerMotor_Init(void) servo_motor.control.unmap = 0; // PLAY and no REC // Init streaming channels - servo_motor.trajectory = Stream_CreateStreamingChannel((float *)trajectory_buf, BUFFER_SIZE, sizeof(float)); - servo_motor.measurement = Stream_CreateStreamingChannel((float *)measurement_buf, BUFFER_SIZE, sizeof(float)); + servo_motor.trajectory = Streaming_CreateChannel((float *)trajectory_buf, BUFFER_SIZE, sizeof(float)); + servo_motor.measurement = Streaming_CreateChannel((float *)measurement_buf, BUFFER_SIZE, sizeof(float)); last_position = AngularOD_PositionFrom_deg(0.0); @@ -312,26 +312,26 @@ void HAL_SYSTICK_Motor_Callback(void) if (servo_motor.control.rec && ((Luos_GetSystick() - last_rec_systick) >= TimeOD_TimeTo_ms(servo_motor.sampling_period))) { // We have to save a sample of current position - Stream_PutSample(&servo_motor.measurement, (angular_position_t *)&servo_motor.angular_position, 1); + Streaming_PutSample(&servo_motor.measurement, (angular_position_t *)&servo_motor.angular_position, 1); last_rec_systick = Luos_GetSystick(); } // ****** trajectory management ********* static uint32_t last_systick = 0; if (servo_motor.control.flux == STOP) { - Stream_ResetStreamingChannel(&servo_motor.trajectory); + Streaming_ResetChannel(&servo_motor.trajectory); } - if ((Stream_GetAvailableSampleNB(&servo_motor.trajectory) > 0) && ((Luos_GetSystick() - last_systick) >= TimeOD_TimeTo_ms(servo_motor.sampling_period)) && (servo_motor.control.flux == PLAY)) + if ((Streaming_GetAvailableSampleNB(&servo_motor.trajectory) > 0) && ((Luos_GetSystick() - last_systick) >= TimeOD_TimeTo_ms(servo_motor.sampling_period)) && (servo_motor.control.flux == PLAY)) { if (servo_motor.mode.mode_linear_position == 1) { linear_position_t linear_position_tmp; - Stream_GetSample(&servo_motor.trajectory, &linear_position_tmp, 1); + Streaming_GetSample(&servo_motor.trajectory, &linear_position_tmp, 1); servo_motor.target_angular_position = AngularOD_PositionFrom_deg((LinearOD_PositionTo_m(linear_position_tmp) * 360.0) / (3.141592653589793 * LinearOD_PositionTo_m(servo_motor.wheel_diameter))); } else { - Stream_GetSample(&servo_motor.trajectory, (angular_position_t *)&servo_motor.target_angular_position, 1); + Streaming_GetSample(&servo_motor.trajectory, (angular_position_t *)&servo_motor.target_angular_position, 1); } last_systick = Luos_GetSystick(); } diff --git a/examples/projects/l0/dxl/lib/Dxl/dxl.c b/examples/projects/l0/dxl/lib/Dxl/dxl.c index 4cbf98a2a..16a8952dc 100644 --- a/examples/projects/l0/dxl/lib/Dxl/dxl.c +++ b/examples/projects/l0/dxl/lib/Dxl/dxl.c @@ -96,19 +96,19 @@ void Dxl_Loop(void) // ****** trajectory management ********* if (dxl[index].dxl_motor.control.flux == STOP) { - Stream_ResetStreamingChannel(&dxl[index].dxl_motor.trajectory); + Streaming_ResetChannel(&dxl[index].dxl_motor.trajectory); } - if ((Stream_GetAvailableSampleNB(&dxl[index].dxl_motor.trajectory) > 0) && ((Luos_GetSystick() - last_sample[index]) >= TimeOD_TimeTo_ms(dxl[index].dxl_motor.sampling_period)) && (dxl[index].dxl_motor.control.flux == PLAY)) + if ((Streaming_GetAvailableSampleNB(&dxl[index].dxl_motor.trajectory) > 0) && ((Luos_GetSystick() - last_sample[index]) >= TimeOD_TimeTo_ms(dxl[index].dxl_motor.sampling_period)) && (dxl[index].dxl_motor.control.flux == PLAY)) { if (dxl[index].dxl_motor.mode.mode_linear_position == 1) { linear_position_t linear_position_tmp; - Stream_GetSample(&dxl[index].dxl_motor.trajectory, &linear_position_tmp, 1); + Streaming_GetSample(&dxl[index].dxl_motor.trajectory, &linear_position_tmp, 1); dxl[index].dxl_motor.target_angular_position = AngularOD_PositionFrom_deg((LinearOD_PositionTo_m(linear_position_tmp) * 360.0) / (3.141592653589793 * LinearOD_PositionTo_m(dxl[index].dxl_motor.wheel_diameter))); } else { - Stream_GetSample(&dxl[index].dxl_motor.trajectory, (angular_position_t *)&dxl[index].dxl_motor.target_angular_position, 1); + Streaming_GetSample(&dxl[index].dxl_motor.trajectory, (angular_position_t *)&dxl[index].dxl_motor.target_angular_position, 1); } last_sample[index] = Luos_GetSystick(); @@ -475,8 +475,8 @@ static void discover_dxl(void) uint32_t nb_samples_in_frame = ceil(BUFFER_SIZE / dxl_index); for (int i = 0; i < dxl_index; i++) { - dxl[i].dxl_motor.trajectory = Stream_CreateStreamingChannel((float *)&trajectory_buf[nb_samples_in_frame * i], nb_samples_in_frame, sizeof(float)); - dxl[i].dxl_motor.measurement = Stream_CreateStreamingChannel((float *)&measurement_buf[nb_samples_in_frame * i], nb_samples_in_frame, sizeof(float)); + dxl[i].dxl_motor.trajectory = Streaming_CreateChannel((float *)&trajectory_buf[nb_samples_in_frame * i], nb_samples_in_frame, sizeof(float)); + dxl[i].dxl_motor.measurement = Streaming_CreateChannel((float *)&measurement_buf[nb_samples_in_frame * i], nb_samples_in_frame, sizeof(float)); } HAL_NVIC_DisableIRQ(USART3_4_IRQn); diff --git a/examples/projects/l0/imu/lib/Imu/motion_driver_6.12/core/driver/eMPL/dmpKey.h b/examples/projects/l0/imu/lib/Imu/motion_driver_6.12/core/driver/eMPL/dmpKey.h index c8f62a2af..baad4ffaf 100644 --- a/examples/projects/l0/imu/lib/Imu/motion_driver_6.12/core/driver/eMPL/dmpKey.h +++ b/examples/projects/l0/imu/lib/Imu/motion_driver_6.12/core/driver/eMPL/dmpKey.h @@ -6,285 +6,286 @@ #ifndef DMPKEY_H__ #define DMPKEY_H__ -#define KEY_CFG_25 (0) -#define KEY_CFG_24 (KEY_CFG_25 + 1) -#define KEY_CFG_26 (KEY_CFG_24 + 1) -#define KEY_CFG_27 (KEY_CFG_26 + 1) -#define KEY_CFG_21 (KEY_CFG_27 + 1) -#define KEY_CFG_20 (KEY_CFG_21 + 1) -#define KEY_CFG_TAP4 (KEY_CFG_20 + 1) -#define KEY_CFG_TAP5 (KEY_CFG_TAP4 + 1) -#define KEY_CFG_TAP6 (KEY_CFG_TAP5 + 1) -#define KEY_CFG_TAP7 (KEY_CFG_TAP6 + 1) -#define KEY_CFG_TAP0 (KEY_CFG_TAP7 + 1) -#define KEY_CFG_TAP1 (KEY_CFG_TAP0 + 1) -#define KEY_CFG_TAP2 (KEY_CFG_TAP1 + 1) -#define KEY_CFG_TAP3 (KEY_CFG_TAP2 + 1) -#define KEY_CFG_TAP_QUANTIZE (KEY_CFG_TAP3 + 1) -#define KEY_CFG_TAP_JERK (KEY_CFG_TAP_QUANTIZE + 1) -#define KEY_CFG_DR_INT (KEY_CFG_TAP_JERK + 1) -#define KEY_CFG_AUTH (KEY_CFG_DR_INT + 1) -#define KEY_CFG_TAP_SAVE_ACCB (KEY_CFG_AUTH + 1) -#define KEY_CFG_TAP_CLEAR_STICKY (KEY_CFG_TAP_SAVE_ACCB + 1) -#define KEY_CFG_FIFO_ON_EVENT (KEY_CFG_TAP_CLEAR_STICKY + 1) -#define KEY_FCFG_ACCEL_INPUT (KEY_CFG_FIFO_ON_EVENT + 1) -#define KEY_FCFG_ACCEL_INIT (KEY_FCFG_ACCEL_INPUT + 1) -#define KEY_CFG_23 (KEY_FCFG_ACCEL_INIT + 1) -#define KEY_FCFG_1 (KEY_CFG_23 + 1) -#define KEY_FCFG_3 (KEY_FCFG_1 + 1) -#define KEY_FCFG_2 (KEY_FCFG_3 + 1) -#define KEY_CFG_3D (KEY_FCFG_2 + 1) -#define KEY_CFG_3B (KEY_CFG_3D + 1) -#define KEY_CFG_3C (KEY_CFG_3B + 1) -#define KEY_FCFG_5 (KEY_CFG_3C + 1) -#define KEY_FCFG_4 (KEY_FCFG_5 + 1) -#define KEY_FCFG_7 (KEY_FCFG_4 + 1) -#define KEY_FCFG_FSCALE (KEY_FCFG_7 + 1) -#define KEY_FCFG_AZ (KEY_FCFG_FSCALE + 1) -#define KEY_FCFG_6 (KEY_FCFG_AZ + 1) -#define KEY_FCFG_LSB4 (KEY_FCFG_6 + 1) -#define KEY_CFG_12 (KEY_FCFG_LSB4 + 1) -#define KEY_CFG_14 (KEY_CFG_12 + 1) -#define KEY_CFG_15 (KEY_CFG_14 + 1) -#define KEY_CFG_16 (KEY_CFG_15 + 1) -#define KEY_CFG_18 (KEY_CFG_16 + 1) -#define KEY_CFG_6 (KEY_CFG_18 + 1) -#define KEY_CFG_7 (KEY_CFG_6 + 1) -#define KEY_CFG_4 (KEY_CFG_7 + 1) -#define KEY_CFG_5 (KEY_CFG_4 + 1) -#define KEY_CFG_2 (KEY_CFG_5 + 1) -#define KEY_CFG_3 (KEY_CFG_2 + 1) -#define KEY_CFG_1 (KEY_CFG_3 + 1) -#define KEY_CFG_EXTERNAL (KEY_CFG_1 + 1) -#define KEY_CFG_8 (KEY_CFG_EXTERNAL + 1) -#define KEY_CFG_9 (KEY_CFG_8 + 1) -#define KEY_CFG_ORIENT_3 (KEY_CFG_9 + 1) -#define KEY_CFG_ORIENT_2 (KEY_CFG_ORIENT_3 + 1) -#define KEY_CFG_ORIENT_1 (KEY_CFG_ORIENT_2 + 1) -#define KEY_CFG_GYRO_SOURCE (KEY_CFG_ORIENT_1 + 1) -#define KEY_CFG_ORIENT_IRQ_1 (KEY_CFG_GYRO_SOURCE + 1) -#define KEY_CFG_ORIENT_IRQ_2 (KEY_CFG_ORIENT_IRQ_1 + 1) -#define KEY_CFG_ORIENT_IRQ_3 (KEY_CFG_ORIENT_IRQ_2 + 1) -#define KEY_FCFG_MAG_VAL (KEY_CFG_ORIENT_IRQ_3 + 1) -#define KEY_FCFG_MAG_MOV (KEY_FCFG_MAG_VAL + 1) -#define KEY_CFG_LP_QUAT (KEY_FCFG_MAG_MOV + 1) +#define KEY_CFG_25 (0) +#define KEY_CFG_24 (KEY_CFG_25 + 1) +#define KEY_CFG_26 (KEY_CFG_24 + 1) +#define KEY_CFG_27 (KEY_CFG_26 + 1) +#define KEY_CFG_21 (KEY_CFG_27 + 1) +#define KEY_CFG_20 (KEY_CFG_21 + 1) +#define KEY_CFG_TAP4 (KEY_CFG_20 + 1) +#define KEY_CFG_TAP5 (KEY_CFG_TAP4 + 1) +#define KEY_CFG_TAP6 (KEY_CFG_TAP5 + 1) +#define KEY_CFG_TAP7 (KEY_CFG_TAP6 + 1) +#define KEY_CFG_TAP0 (KEY_CFG_TAP7 + 1) +#define KEY_CFG_TAP1 (KEY_CFG_TAP0 + 1) +#define KEY_CFG_TAP2 (KEY_CFG_TAP1 + 1) +#define KEY_CFG_TAP3 (KEY_CFG_TAP2 + 1) +#define KEY_CFG_TAP_QUANTIZE (KEY_CFG_TAP3 + 1) +#define KEY_CFG_TAP_JERK (KEY_CFG_TAP_QUANTIZE + 1) +#define KEY_CFG_DR_INT (KEY_CFG_TAP_JERK + 1) +#define KEY_CFG_AUTH (KEY_CFG_DR_INT + 1) +#define KEY_CFG_TAP_SAVE_ACCB (KEY_CFG_AUTH + 1) +#define KEY_CFG_TAP_CLEAR_STICKY (KEY_CFG_TAP_SAVE_ACCB + 1) +#define KEY_CFG_FIFO_ON_EVENT (KEY_CFG_TAP_CLEAR_STICKY + 1) +#define KEY_FCFG_ACCEL_INPUT (KEY_CFG_FIFO_ON_EVENT + 1) +#define KEY_FCFG_ACCEL_INIT (KEY_FCFG_ACCEL_INPUT + 1) +#define KEY_CFG_23 (KEY_FCFG_ACCEL_INIT + 1) +#define KEY_FCFG_1 (KEY_CFG_23 + 1) +#define KEY_FCFG_3 (KEY_FCFG_1 + 1) +#define KEY_FCFG_2 (KEY_FCFG_3 + 1) +#define KEY_CFG_3D (KEY_FCFG_2 + 1) +#define KEY_CFG_3B (KEY_CFG_3D + 1) +#define KEY_CFG_3C (KEY_CFG_3B + 1) +#define KEY_FCFG_5 (KEY_CFG_3C + 1) +#define KEY_FCFG_4 (KEY_FCFG_5 + 1) +#define KEY_FCFG_7 (KEY_FCFG_4 + 1) +#define KEY_FCFG_FSCALE (KEY_FCFG_7 + 1) +#define KEY_FCFG_AZ (KEY_FCFG_FSCALE + 1) +#define KEY_FCFG_6 (KEY_FCFG_AZ + 1) +#define KEY_FCFG_LSB4 (KEY_FCFG_6 + 1) +#define KEY_CFG_12 (KEY_FCFG_LSB4 + 1) +#define KEY_CFG_14 (KEY_CFG_12 + 1) +#define KEY_CFG_15 (KEY_CFG_14 + 1) +#define KEY_CFG_16 (KEY_CFG_15 + 1) +#define KEY_CFG_18 (KEY_CFG_16 + 1) +#define KEY_CFG_6 (KEY_CFG_18 + 1) +#define KEY_CFG_7 (KEY_CFG_6 + 1) +#define KEY_CFG_4 (KEY_CFG_7 + 1) +#define KEY_CFG_5 (KEY_CFG_4 + 1) +#define KEY_CFG_2 (KEY_CFG_5 + 1) +#define KEY_CFG_3 (KEY_CFG_2 + 1) +#define KEY_CFG_1 (KEY_CFG_3 + 1) +#define KEY_CFG_EXTERNAL (KEY_CFG_1 + 1) +#define KEY_CFG_8 (KEY_CFG_EXTERNAL + 1) +#define KEY_CFG_9 (KEY_CFG_8 + 1) +#define KEY_CFG_ORIENT_3 (KEY_CFG_9 + 1) +#define KEY_CFG_ORIENT_2 (KEY_CFG_ORIENT_3 + 1) +#define KEY_CFG_ORIENT_1 (KEY_CFG_ORIENT_2 + 1) +#define KEY_CFG_GYRO_SOURCE (KEY_CFG_ORIENT_1 + 1) +#define KEY_CFG_ORIENT_IRQ_1 (KEY_CFG_GYRO_SOURCE + 1) +#define KEY_CFG_ORIENT_IRQ_2 (KEY_CFG_ORIENT_IRQ_1 + 1) +#define KEY_CFG_ORIENT_IRQ_3 (KEY_CFG_ORIENT_IRQ_2 + 1) +#define KEY_FCFG_MAG_VAL (KEY_CFG_ORIENT_IRQ_3 + 1) +#define KEY_FCFG_MAG_MOV (KEY_FCFG_MAG_VAL + 1) +#define KEY_CFG_LP_QUAT (KEY_FCFG_MAG_MOV + 1) /* MPU6050 keys */ -#define KEY_CFG_ACCEL_FILTER (KEY_CFG_LP_QUAT + 1) -#define KEY_CFG_MOTION_BIAS (KEY_CFG_ACCEL_FILTER + 1) -#define KEY_TEMPLABEL (KEY_CFG_MOTION_BIAS + 1) - -#define KEY_D_0_22 (KEY_TEMPLABEL + 1) -#define KEY_D_0_24 (KEY_D_0_22 + 1) -#define KEY_D_0_36 (KEY_D_0_24 + 1) -#define KEY_D_0_52 (KEY_D_0_36 + 1) -#define KEY_D_0_96 (KEY_D_0_52 + 1) -#define KEY_D_0_104 (KEY_D_0_96 + 1) -#define KEY_D_0_108 (KEY_D_0_104 + 1) -#define KEY_D_0_163 (KEY_D_0_108 + 1) -#define KEY_D_0_188 (KEY_D_0_163 + 1) -#define KEY_D_0_192 (KEY_D_0_188 + 1) -#define KEY_D_0_224 (KEY_D_0_192 + 1) -#define KEY_D_0_228 (KEY_D_0_224 + 1) -#define KEY_D_0_232 (KEY_D_0_228 + 1) -#define KEY_D_0_236 (KEY_D_0_232 + 1) - -#define KEY_DMP_PREVPTAT (KEY_D_0_236 + 1) -#define KEY_D_1_2 (KEY_DMP_PREVPTAT + 1) -#define KEY_D_1_4 (KEY_D_1_2 + 1) -#define KEY_D_1_8 (KEY_D_1_4 + 1) -#define KEY_D_1_10 (KEY_D_1_8 + 1) -#define KEY_D_1_24 (KEY_D_1_10 + 1) -#define KEY_D_1_28 (KEY_D_1_24 + 1) -#define KEY_D_1_36 (KEY_D_1_28 + 1) -#define KEY_D_1_40 (KEY_D_1_36 + 1) -#define KEY_D_1_44 (KEY_D_1_40 + 1) -#define KEY_D_1_72 (KEY_D_1_44 + 1) -#define KEY_D_1_74 (KEY_D_1_72 + 1) -#define KEY_D_1_79 (KEY_D_1_74 + 1) -#define KEY_D_1_88 (KEY_D_1_79 + 1) -#define KEY_D_1_90 (KEY_D_1_88 + 1) -#define KEY_D_1_92 (KEY_D_1_90 + 1) -#define KEY_D_1_96 (KEY_D_1_92 + 1) -#define KEY_D_1_98 (KEY_D_1_96 + 1) -#define KEY_D_1_100 (KEY_D_1_98 + 1) -#define KEY_D_1_106 (KEY_D_1_100 + 1) -#define KEY_D_1_108 (KEY_D_1_106 + 1) -#define KEY_D_1_112 (KEY_D_1_108 + 1) -#define KEY_D_1_128 (KEY_D_1_112 + 1) -#define KEY_D_1_152 (KEY_D_1_128 + 1) -#define KEY_D_1_160 (KEY_D_1_152 + 1) -#define KEY_D_1_168 (KEY_D_1_160 + 1) -#define KEY_D_1_175 (KEY_D_1_168 + 1) -#define KEY_D_1_176 (KEY_D_1_175 + 1) -#define KEY_D_1_178 (KEY_D_1_176 + 1) -#define KEY_D_1_179 (KEY_D_1_178 + 1) -#define KEY_D_1_218 (KEY_D_1_179 + 1) -#define KEY_D_1_232 (KEY_D_1_218 + 1) -#define KEY_D_1_236 (KEY_D_1_232 + 1) -#define KEY_D_1_240 (KEY_D_1_236 + 1) -#define KEY_D_1_244 (KEY_D_1_240 + 1) -#define KEY_D_1_250 (KEY_D_1_244 + 1) -#define KEY_D_1_252 (KEY_D_1_250 + 1) -#define KEY_D_2_12 (KEY_D_1_252 + 1) -#define KEY_D_2_96 (KEY_D_2_12 + 1) -#define KEY_D_2_108 (KEY_D_2_96 + 1) -#define KEY_D_2_208 (KEY_D_2_108 + 1) -#define KEY_FLICK_MSG (KEY_D_2_208 + 1) -#define KEY_FLICK_COUNTER (KEY_FLICK_MSG + 1) -#define KEY_FLICK_LOWER (KEY_FLICK_COUNTER + 1) -#define KEY_CFG_FLICK_IN (KEY_FLICK_LOWER + 1) -#define KEY_FLICK_UPPER (KEY_CFG_FLICK_IN + 1) -#define KEY_CGNOTICE_INTR (KEY_FLICK_UPPER + 1) -#define KEY_D_2_224 (KEY_CGNOTICE_INTR + 1) -#define KEY_D_2_244 (KEY_D_2_224 + 1) -#define KEY_D_2_248 (KEY_D_2_244 + 1) -#define KEY_D_2_252 (KEY_D_2_248 + 1) - -#define KEY_D_GYRO_BIAS_X (KEY_D_2_252 + 1) -#define KEY_D_GYRO_BIAS_Y (KEY_D_GYRO_BIAS_X + 1) -#define KEY_D_GYRO_BIAS_Z (KEY_D_GYRO_BIAS_Y + 1) -#define KEY_D_ACC_BIAS_X (KEY_D_GYRO_BIAS_Z + 1) -#define KEY_D_ACC_BIAS_Y (KEY_D_ACC_BIAS_X + 1) -#define KEY_D_ACC_BIAS_Z (KEY_D_ACC_BIAS_Y + 1) -#define KEY_D_GYRO_ENABLE (KEY_D_ACC_BIAS_Z + 1) -#define KEY_D_ACCEL_ENABLE (KEY_D_GYRO_ENABLE + 1) -#define KEY_D_QUAT_ENABLE (KEY_D_ACCEL_ENABLE +1) -#define KEY_D_OUTPUT_ENABLE (KEY_D_QUAT_ENABLE + 1) -#define KEY_D_CR_TIME_G (KEY_D_OUTPUT_ENABLE + 1) -#define KEY_D_CR_TIME_A (KEY_D_CR_TIME_G + 1) -#define KEY_D_CR_TIME_Q (KEY_D_CR_TIME_A + 1) -#define KEY_D_CS_TAX (KEY_D_CR_TIME_Q + 1) -#define KEY_D_CS_TAY (KEY_D_CS_TAX + 1) -#define KEY_D_CS_TAZ (KEY_D_CS_TAY + 1) -#define KEY_D_CS_TGX (KEY_D_CS_TAZ + 1) -#define KEY_D_CS_TGY (KEY_D_CS_TGX + 1) -#define KEY_D_CS_TGZ (KEY_D_CS_TGY + 1) -#define KEY_D_CS_TQ0 (KEY_D_CS_TGZ + 1) -#define KEY_D_CS_TQ1 (KEY_D_CS_TQ0 + 1) -#define KEY_D_CS_TQ2 (KEY_D_CS_TQ1 + 1) -#define KEY_D_CS_TQ3 (KEY_D_CS_TQ2 + 1) +#define KEY_CFG_ACCEL_FILTER (KEY_CFG_LP_QUAT + 1) +#define KEY_CFG_MOTION_BIAS (KEY_CFG_ACCEL_FILTER + 1) +#define KEY_TEMPLABEL (KEY_CFG_MOTION_BIAS + 1) + +#define KEY_D_0_22 (KEY_TEMPLABEL + 1) +#define KEY_D_0_24 (KEY_D_0_22 + 1) +#define KEY_D_0_36 (KEY_D_0_24 + 1) +#define KEY_D_0_52 (KEY_D_0_36 + 1) +#define KEY_D_0_96 (KEY_D_0_52 + 1) +#define KEY_D_0_104 (KEY_D_0_96 + 1) +#define KEY_D_0_108 (KEY_D_0_104 + 1) +#define KEY_D_0_163 (KEY_D_0_108 + 1) +#define KEY_D_0_188 (KEY_D_0_163 + 1) +#define KEY_D_0_192 (KEY_D_0_188 + 1) +#define KEY_D_0_224 (KEY_D_0_192 + 1) +#define KEY_D_0_228 (KEY_D_0_224 + 1) +#define KEY_D_0_232 (KEY_D_0_228 + 1) +#define KEY_D_0_236 (KEY_D_0_232 + 1) + +#define KEY_DMP_PREVPTAT (KEY_D_0_236 + 1) +#define KEY_D_1_2 (KEY_DMP_PREVPTAT + 1) +#define KEY_D_1_4 (KEY_D_1_2 + 1) +#define KEY_D_1_8 (KEY_D_1_4 + 1) +#define KEY_D_1_10 (KEY_D_1_8 + 1) +#define KEY_D_1_24 (KEY_D_1_10 + 1) +#define KEY_D_1_28 (KEY_D_1_24 + 1) +#define KEY_D_1_36 (KEY_D_1_28 + 1) +#define KEY_D_1_40 (KEY_D_1_36 + 1) +#define KEY_D_1_44 (KEY_D_1_40 + 1) +#define KEY_D_1_72 (KEY_D_1_44 + 1) +#define KEY_D_1_74 (KEY_D_1_72 + 1) +#define KEY_D_1_79 (KEY_D_1_74 + 1) +#define KEY_D_1_88 (KEY_D_1_79 + 1) +#define KEY_D_1_90 (KEY_D_1_88 + 1) +#define KEY_D_1_92 (KEY_D_1_90 + 1) +#define KEY_D_1_96 (KEY_D_1_92 + 1) +#define KEY_D_1_98 (KEY_D_1_96 + 1) +#define KEY_D_1_100 (KEY_D_1_98 + 1) +#define KEY_D_1_106 (KEY_D_1_100 + 1) +#define KEY_D_1_108 (KEY_D_1_106 + 1) +#define KEY_D_1_112 (KEY_D_1_108 + 1) +#define KEY_D_1_128 (KEY_D_1_112 + 1) +#define KEY_D_1_152 (KEY_D_1_128 + 1) +#define KEY_D_1_160 (KEY_D_1_152 + 1) +#define KEY_D_1_168 (KEY_D_1_160 + 1) +#define KEY_D_1_175 (KEY_D_1_168 + 1) +#define KEY_D_1_176 (KEY_D_1_175 + 1) +#define KEY_D_1_178 (KEY_D_1_176 + 1) +#define KEY_D_1_179 (KEY_D_1_178 + 1) +#define KEY_D_1_218 (KEY_D_1_179 + 1) +#define KEY_D_1_232 (KEY_D_1_218 + 1) +#define KEY_D_1_236 (KEY_D_1_232 + 1) +#define KEY_D_1_240 (KEY_D_1_236 + 1) +#define KEY_D_1_244 (KEY_D_1_240 + 1) +#define KEY_D_1_250 (KEY_D_1_244 + 1) +#define KEY_D_1_252 (KEY_D_1_250 + 1) +#define KEY_D_2_12 (KEY_D_1_252 + 1) +#define KEY_D_2_96 (KEY_D_2_12 + 1) +#define KEY_D_2_108 (KEY_D_2_96 + 1) +#define KEY_D_2_208 (KEY_D_2_108 + 1) +#define KEY_FLICK_MSG (KEY_D_2_208 + 1) +#define KEY_FLICK_COUNTER (KEY_FLICK_MSG + 1) +#define KEY_FLICK_LOWER (KEY_FLICK_COUNTER + 1) +#define KEY_CFG_FLICK_IN (KEY_FLICK_LOWER + 1) +#define KEY_FLICK_UPPER (KEY_CFG_FLICK_IN + 1) +#define KEY_CGNOTICE_INTR (KEY_FLICK_UPPER + 1) +#define KEY_D_2_224 (KEY_CGNOTICE_INTR + 1) +#define KEY_D_2_244 (KEY_D_2_224 + 1) +#define KEY_D_2_248 (KEY_D_2_244 + 1) +#define KEY_D_2_252 (KEY_D_2_248 + 1) + +#define KEY_D_GYRO_BIAS_X (KEY_D_2_252 + 1) +#define KEY_D_GYRO_BIAS_Y (KEY_D_GYRO_BIAS_X + 1) +#define KEY_D_GYRO_BIAS_Z (KEY_D_GYRO_BIAS_Y + 1) +#define KEY_D_ACC_BIAS_X (KEY_D_GYRO_BIAS_Z + 1) +#define KEY_D_ACC_BIAS_Y (KEY_D_ACC_BIAS_X + 1) +#define KEY_D_ACC_BIAS_Z (KEY_D_ACC_BIAS_Y + 1) +#define KEY_D_GYRO_ENABLE (KEY_D_ACC_BIAS_Z + 1) +#define KEY_D_ACCEL_ENABLE (KEY_D_GYRO_ENABLE + 1) +#define KEY_D_QUAT_ENABLE (KEY_D_ACCEL_ENABLE + 1) +#define KEY_D_OUTPUT_ENABLE (KEY_D_QUAT_ENABLE + 1) +#define KEY_D_CR_TIME_G (KEY_D_OUTPUT_ENABLE + 1) +#define KEY_D_CR_TIME_A (KEY_D_CR_TIME_G + 1) +#define KEY_D_CR_TIME_Q (KEY_D_CR_TIME_A + 1) +#define KEY_D_CS_TAX (KEY_D_CR_TIME_Q + 1) +#define KEY_D_CS_TAY (KEY_D_CS_TAX + 1) +#define KEY_D_CS_TAZ (KEY_D_CS_TAY + 1) +#define KEY_D_CS_TGX (KEY_D_CS_TAZ + 1) +#define KEY_D_CS_TGY (KEY_D_CS_TGX + 1) +#define KEY_D_CS_TGZ (KEY_D_CS_TGY + 1) +#define KEY_D_CS_TQ0 (KEY_D_CS_TGZ + 1) +#define KEY_D_CS_TQ1 (KEY_D_CS_TQ0 + 1) +#define KEY_D_CS_TQ2 (KEY_D_CS_TQ1 + 1) +#define KEY_D_CS_TQ3 (KEY_D_CS_TQ2 + 1) /* Compass keys */ -#define KEY_CPASS_BIAS_X (KEY_D_CS_TQ3 + 1) -#define KEY_CPASS_BIAS_Y (KEY_CPASS_BIAS_X + 1) -#define KEY_CPASS_BIAS_Z (KEY_CPASS_BIAS_Y + 1) -#define KEY_CPASS_MTX_00 (KEY_CPASS_BIAS_Z + 1) -#define KEY_CPASS_MTX_01 (KEY_CPASS_MTX_00 + 1) -#define KEY_CPASS_MTX_02 (KEY_CPASS_MTX_01 + 1) -#define KEY_CPASS_MTX_10 (KEY_CPASS_MTX_02 + 1) -#define KEY_CPASS_MTX_11 (KEY_CPASS_MTX_10 + 1) -#define KEY_CPASS_MTX_12 (KEY_CPASS_MTX_11 + 1) -#define KEY_CPASS_MTX_20 (KEY_CPASS_MTX_12 + 1) -#define KEY_CPASS_MTX_21 (KEY_CPASS_MTX_20 + 1) -#define KEY_CPASS_MTX_22 (KEY_CPASS_MTX_21 + 1) +#define KEY_CPASS_BIAS_X (KEY_D_CS_TQ3 + 1) +#define KEY_CPASS_BIAS_Y (KEY_CPASS_BIAS_X + 1) +#define KEY_CPASS_BIAS_Z (KEY_CPASS_BIAS_Y + 1) +#define KEY_CPASS_MTX_00 (KEY_CPASS_BIAS_Z + 1) +#define KEY_CPASS_MTX_01 (KEY_CPASS_MTX_00 + 1) +#define KEY_CPASS_MTX_02 (KEY_CPASS_MTX_01 + 1) +#define KEY_CPASS_MTX_10 (KEY_CPASS_MTX_02 + 1) +#define KEY_CPASS_MTX_11 (KEY_CPASS_MTX_10 + 1) +#define KEY_CPASS_MTX_12 (KEY_CPASS_MTX_11 + 1) +#define KEY_CPASS_MTX_20 (KEY_CPASS_MTX_12 + 1) +#define KEY_CPASS_MTX_21 (KEY_CPASS_MTX_20 + 1) +#define KEY_CPASS_MTX_22 (KEY_CPASS_MTX_21 + 1) /* Gesture Keys */ -#define KEY_DMP_TAPW_MIN (KEY_CPASS_MTX_22 + 1) -#define KEY_DMP_TAP_THR_X (KEY_DMP_TAPW_MIN + 1) -#define KEY_DMP_TAP_THR_Y (KEY_DMP_TAP_THR_X + 1) -#define KEY_DMP_TAP_THR_Z (KEY_DMP_TAP_THR_Y + 1) -#define KEY_DMP_SH_TH_Y (KEY_DMP_TAP_THR_Z + 1) -#define KEY_DMP_SH_TH_X (KEY_DMP_SH_TH_Y + 1) -#define KEY_DMP_SH_TH_Z (KEY_DMP_SH_TH_X + 1) -#define KEY_DMP_ORIENT (KEY_DMP_SH_TH_Z + 1) -#define KEY_D_ACT0 (KEY_DMP_ORIENT + 1) -#define KEY_D_ACSX (KEY_D_ACT0 + 1) -#define KEY_D_ACSY (KEY_D_ACSX + 1) -#define KEY_D_ACSZ (KEY_D_ACSY + 1) - -#define KEY_X_GRT_Y_TMP (KEY_D_ACSZ + 1) -#define KEY_SKIP_X_GRT_Y_TMP (KEY_X_GRT_Y_TMP + 1) -#define KEY_SKIP_END_COMPARE (KEY_SKIP_X_GRT_Y_TMP + 1) -#define KEY_END_COMPARE_Y_X_TMP2 (KEY_SKIP_END_COMPARE + 1) -#define KEY_CFG_ANDROID_ORIENT_INT (KEY_END_COMPARE_Y_X_TMP2 + 1) -#define KEY_NO_ORIENT_INTERRUPT (KEY_CFG_ANDROID_ORIENT_INT + 1) -#define KEY_END_COMPARE_Y_X_TMP (KEY_NO_ORIENT_INTERRUPT + 1) -#define KEY_END_ORIENT_1 (KEY_END_COMPARE_Y_X_TMP + 1) -#define KEY_END_COMPARE_Y_X (KEY_END_ORIENT_1 + 1) -#define KEY_END_ORIENT (KEY_END_COMPARE_Y_X + 1) -#define KEY_X_GRT_Y (KEY_END_ORIENT + 1) -#define KEY_NOT_TIME_MINUS_1 (KEY_X_GRT_Y + 1) -#define KEY_END_COMPARE_Y_X_TMP3 (KEY_NOT_TIME_MINUS_1 + 1) -#define KEY_X_GRT_Y_TMP2 (KEY_END_COMPARE_Y_X_TMP3 + 1) +#define KEY_DMP_TAPW_MIN (KEY_CPASS_MTX_22 + 1) +#define KEY_DMP_TAP_THR_X (KEY_DMP_TAPW_MIN + 1) +#define KEY_DMP_TAP_THR_Y (KEY_DMP_TAP_THR_X + 1) +#define KEY_DMP_TAP_THR_Z (KEY_DMP_TAP_THR_Y + 1) +#define KEY_DMP_SH_TH_Y (KEY_DMP_TAP_THR_Z + 1) +#define KEY_DMP_SH_TH_X (KEY_DMP_SH_TH_Y + 1) +#define KEY_DMP_SH_TH_Z (KEY_DMP_SH_TH_X + 1) +#define KEY_DMP_ORIENT (KEY_DMP_SH_TH_Z + 1) +#define KEY_D_ACT0 (KEY_DMP_ORIENT + 1) +#define KEY_D_ACSX (KEY_D_ACT0 + 1) +#define KEY_D_ACSY (KEY_D_ACSX + 1) +#define KEY_D_ACSZ (KEY_D_ACSY + 1) + +#define KEY_X_GRT_Y_TMP (KEY_D_ACSZ + 1) +#define KEY_SKIP_X_GRT_Y_TMP (KEY_X_GRT_Y_TMP + 1) +#define KEY_SKIP_END_COMPARE (KEY_SKIP_X_GRT_Y_TMP + 1) +#define KEY_END_COMPARE_Y_X_TMP2 (KEY_SKIP_END_COMPARE + 1) +#define KEY_CFG_ANDROID_ORIENT_INT (KEY_END_COMPARE_Y_X_TMP2 + 1) +#define KEY_NO_ORIENT_INTERRUPT (KEY_CFG_ANDROID_ORIENT_INT + 1) +#define KEY_END_COMPARE_Y_X_TMP (KEY_NO_ORIENT_INTERRUPT + 1) +#define KEY_END_ORIENT_1 (KEY_END_COMPARE_Y_X_TMP + 1) +#define KEY_END_COMPARE_Y_X (KEY_END_ORIENT_1 + 1) +#define KEY_END_ORIENT (KEY_END_COMPARE_Y_X + 1) +#define KEY_X_GRT_Y (KEY_END_ORIENT + 1) +#define KEY_NOT_TIME_MINUS_1 (KEY_X_GRT_Y + 1) +#define KEY_END_COMPARE_Y_X_TMP3 (KEY_NOT_TIME_MINUS_1 + 1) +#define KEY_X_GRT_Y_TMP2 (KEY_END_COMPARE_Y_X_TMP3 + 1) /* Authenticate Keys */ -#define KEY_D_AUTH_OUT (KEY_X_GRT_Y_TMP2 + 1) -#define KEY_D_AUTH_IN (KEY_D_AUTH_OUT + 1) -#define KEY_D_AUTH_A (KEY_D_AUTH_IN + 1) -#define KEY_D_AUTH_B (KEY_D_AUTH_A + 1) +#define KEY_D_AUTH_OUT (KEY_X_GRT_Y_TMP2 + 1) +#define KEY_D_AUTH_IN (KEY_D_AUTH_OUT + 1) +#define KEY_D_AUTH_A (KEY_D_AUTH_IN + 1) +#define KEY_D_AUTH_B (KEY_D_AUTH_A + 1) /* Pedometer standalone only keys */ -#define KEY_D_PEDSTD_BP_B (KEY_D_AUTH_B + 1) -#define KEY_D_PEDSTD_HP_A (KEY_D_PEDSTD_BP_B + 1) -#define KEY_D_PEDSTD_HP_B (KEY_D_PEDSTD_HP_A + 1) -#define KEY_D_PEDSTD_BP_A4 (KEY_D_PEDSTD_HP_B + 1) -#define KEY_D_PEDSTD_BP_A3 (KEY_D_PEDSTD_BP_A4 + 1) -#define KEY_D_PEDSTD_BP_A2 (KEY_D_PEDSTD_BP_A3 + 1) -#define KEY_D_PEDSTD_BP_A1 (KEY_D_PEDSTD_BP_A2 + 1) -#define KEY_D_PEDSTD_INT_THRSH (KEY_D_PEDSTD_BP_A1 + 1) -#define KEY_D_PEDSTD_CLIP (KEY_D_PEDSTD_INT_THRSH + 1) -#define KEY_D_PEDSTD_SB (KEY_D_PEDSTD_CLIP + 1) -#define KEY_D_PEDSTD_SB_TIME (KEY_D_PEDSTD_SB + 1) -#define KEY_D_PEDSTD_PEAKTHRSH (KEY_D_PEDSTD_SB_TIME + 1) -#define KEY_D_PEDSTD_TIML (KEY_D_PEDSTD_PEAKTHRSH + 1) -#define KEY_D_PEDSTD_TIMH (KEY_D_PEDSTD_TIML + 1) -#define KEY_D_PEDSTD_PEAK (KEY_D_PEDSTD_TIMH + 1) -#define KEY_D_PEDSTD_TIMECTR (KEY_D_PEDSTD_PEAK + 1) -#define KEY_D_PEDSTD_STEPCTR (KEY_D_PEDSTD_TIMECTR + 1) -#define KEY_D_PEDSTD_WALKTIME (KEY_D_PEDSTD_STEPCTR + 1) -#define KEY_D_PEDSTD_DECI (KEY_D_PEDSTD_WALKTIME + 1) +#define KEY_D_PEDSTD_BP_B (KEY_D_AUTH_B + 1) +#define KEY_D_PEDSTD_HP_A (KEY_D_PEDSTD_BP_B + 1) +#define KEY_D_PEDSTD_HP_B (KEY_D_PEDSTD_HP_A + 1) +#define KEY_D_PEDSTD_BP_A4 (KEY_D_PEDSTD_HP_B + 1) +#define KEY_D_PEDSTD_BP_A3 (KEY_D_PEDSTD_BP_A4 + 1) +#define KEY_D_PEDSTD_BP_A2 (KEY_D_PEDSTD_BP_A3 + 1) +#define KEY_D_PEDSTD_BP_A1 (KEY_D_PEDSTD_BP_A2 + 1) +#define KEY_D_PEDSTD_INT_THRSH (KEY_D_PEDSTD_BP_A1 + 1) +#define KEY_D_PEDSTD_CLIP (KEY_D_PEDSTD_INT_THRSH + 1) +#define KEY_D_PEDSTD_SB (KEY_D_PEDSTD_CLIP + 1) +#define KEY_D_PEDSTD_SB_TIME (KEY_D_PEDSTD_SB + 1) +#define KEY_D_PEDSTD_PEAKTHRSH (KEY_D_PEDSTD_SB_TIME + 1) +#define KEY_D_PEDSTD_TIML (KEY_D_PEDSTD_PEAKTHRSH + 1) +#define KEY_D_PEDSTD_TIMH (KEY_D_PEDSTD_TIML + 1) +#define KEY_D_PEDSTD_PEAK (KEY_D_PEDSTD_TIMH + 1) +#define KEY_D_PEDSTD_TIMECTR (KEY_D_PEDSTD_PEAK + 1) +#define KEY_D_PEDSTD_STEPCTR (KEY_D_PEDSTD_TIMECTR + 1) +#define KEY_D_PEDSTD_WALKTIME (KEY_D_PEDSTD_STEPCTR + 1) +#define KEY_D_PEDSTD_DECI (KEY_D_PEDSTD_WALKTIME + 1) /*Host Based No Motion*/ -#define KEY_D_HOST_NO_MOT (KEY_D_PEDSTD_DECI + 1) +#define KEY_D_HOST_NO_MOT (KEY_D_PEDSTD_DECI + 1) /* EIS keys */ -#define KEY_P_EIS_FIFO_FOOTER (KEY_D_HOST_NO_MOT + 1) -#define KEY_P_EIS_FIFO_YSHIFT (KEY_P_EIS_FIFO_FOOTER + 1) -#define KEY_P_EIS_DATA_RATE (KEY_P_EIS_FIFO_YSHIFT + 1) -#define KEY_P_EIS_FIFO_XSHIFT (KEY_P_EIS_DATA_RATE + 1) -#define KEY_P_EIS_FIFO_SYNC (KEY_P_EIS_FIFO_XSHIFT + 1) -#define KEY_P_EIS_FIFO_ZSHIFT (KEY_P_EIS_FIFO_SYNC + 1) -#define KEY_P_EIS_FIFO_READY (KEY_P_EIS_FIFO_ZSHIFT + 1) -#define KEY_DMP_FOOTER (KEY_P_EIS_FIFO_READY + 1) -#define KEY_DMP_INTX_HC (KEY_DMP_FOOTER + 1) -#define KEY_DMP_INTX_PH (KEY_DMP_INTX_HC + 1) -#define KEY_DMP_INTX_SH (KEY_DMP_INTX_PH + 1) -#define KEY_DMP_AINV_SH (KEY_DMP_INTX_SH + 1) -#define KEY_DMP_A_INV_XH (KEY_DMP_AINV_SH + 1) -#define KEY_DMP_AINV_PH (KEY_DMP_A_INV_XH + 1) -#define KEY_DMP_CTHX_H (KEY_DMP_AINV_PH + 1) -#define KEY_DMP_CTHY_H (KEY_DMP_CTHX_H + 1) -#define KEY_DMP_CTHZ_H (KEY_DMP_CTHY_H + 1) -#define KEY_DMP_NCTHX_H (KEY_DMP_CTHZ_H + 1) -#define KEY_DMP_NCTHY_H (KEY_DMP_NCTHX_H + 1) -#define KEY_DMP_NCTHZ_H (KEY_DMP_NCTHY_H + 1) -#define KEY_DMP_CTSQ_XH (KEY_DMP_NCTHZ_H + 1) -#define KEY_DMP_CTSQ_YH (KEY_DMP_CTSQ_XH + 1) -#define KEY_DMP_CTSQ_ZH (KEY_DMP_CTSQ_YH + 1) -#define KEY_DMP_INTX_H (KEY_DMP_CTSQ_ZH + 1) -#define KEY_DMP_INTY_H (KEY_DMP_INTX_H + 1) -#define KEY_DMP_INTZ_H (KEY_DMP_INTY_H + 1) -//#define KEY_DMP_HPX_H (KEY_DMP_INTZ_H + 1) -//#define KEY_DMP_HPY_H (KEY_DMP_HPX_H + 1) -//#define KEY_DMP_HPZ_H (KEY_DMP_HPY_H + 1) +#define KEY_P_EIS_FIFO_FOOTER (KEY_D_HOST_NO_MOT + 1) +#define KEY_P_EIS_FIFO_YSHIFT (KEY_P_EIS_FIFO_FOOTER + 1) +#define KEY_P_EIS_DATA_RATE (KEY_P_EIS_FIFO_YSHIFT + 1) +#define KEY_P_EIS_FIFO_XSHIFT (KEY_P_EIS_DATA_RATE + 1) +#define KEY_P_EIS_FIFO_SYNC (KEY_P_EIS_FIFO_XSHIFT + 1) +#define KEY_P_EIS_FIFO_ZSHIFT (KEY_P_EIS_FIFO_SYNC + 1) +#define KEY_P_EIS_FIFO_READY (KEY_P_EIS_FIFO_ZSHIFT + 1) +#define KEY_DMP_FOOTER (KEY_P_EIS_FIFO_READY + 1) +#define KEY_DMP_INTX_HC (KEY_DMP_FOOTER + 1) +#define KEY_DMP_INTX_PH (KEY_DMP_INTX_HC + 1) +#define KEY_DMP_INTX_SH (KEY_DMP_INTX_PH + 1) +#define KEY_DMP_AINV_SH (KEY_DMP_INTX_SH + 1) +#define KEY_DMP_A_INV_XH (KEY_DMP_AINV_SH + 1) +#define KEY_DMP_AINV_PH (KEY_DMP_A_INV_XH + 1) +#define KEY_DMP_CTHX_H (KEY_DMP_AINV_PH + 1) +#define KEY_DMP_CTHY_H (KEY_DMP_CTHX_H + 1) +#define KEY_DMP_CTHZ_H (KEY_DMP_CTHY_H + 1) +#define KEY_DMP_NCTHX_H (KEY_DMP_CTHZ_H + 1) +#define KEY_DMP_NCTHY_H (KEY_DMP_NCTHX_H + 1) +#define KEY_DMP_NCTHZ_H (KEY_DMP_NCTHY_H + 1) +#define KEY_DMP_CTSQ_XH (KEY_DMP_NCTHZ_H + 1) +#define KEY_DMP_CTSQ_YH (KEY_DMP_CTSQ_XH + 1) +#define KEY_DMP_CTSQ_ZH (KEY_DMP_CTSQ_YH + 1) +#define KEY_DMP_INTX_H (KEY_DMP_CTSQ_ZH + 1) +#define KEY_DMP_INTY_H (KEY_DMP_INTX_H + 1) +#define KEY_DMP_INTZ_H (KEY_DMP_INTY_H + 1) +// #define KEY_DMP_HPX_H (KEY_DMP_INTZ_H + 1) +// #define KEY_DMP_HPY_H (KEY_DMP_HPX_H + 1) +// #define KEY_DMP_HPZ_H (KEY_DMP_HPY_H + 1) /* Stream keys */ -#define KEY_STREAM_P_GYRO_Z (KEY_DMP_INTZ_H + 1) -#define KEY_STREAM_P_GYRO_Y (KEY_STREAM_P_GYRO_Z + 1) -#define KEY_STREAM_P_GYRO_X (KEY_STREAM_P_GYRO_Y + 1) -#define KEY_STREAM_P_TEMP (KEY_STREAM_P_GYRO_X + 1) -#define KEY_STREAM_P_AUX_Y (KEY_STREAM_P_TEMP + 1) -#define KEY_STREAM_P_AUX_X (KEY_STREAM_P_AUX_Y + 1) -#define KEY_STREAM_P_AUX_Z (KEY_STREAM_P_AUX_X + 1) -#define KEY_STREAM_P_ACCEL_Y (KEY_STREAM_P_AUX_Z + 1) -#define KEY_STREAM_P_ACCEL_X (KEY_STREAM_P_ACCEL_Y + 1) -#define KEY_STREAM_P_FOOTER (KEY_STREAM_P_ACCEL_X + 1) -#define KEY_STREAM_P_ACCEL_Z (KEY_STREAM_P_FOOTER + 1) - -#define NUM_KEYS (KEY_STREAM_P_ACCEL_Z + 1) - -typedef struct { +#define KEY_Streaming_P_GYRO_Z (KEY_DMP_INTZ_H + 1) +#define KEY_Streaming_P_GYRO_Y (KEY_Streaming_P_GYRO_Z + 1) +#define KEY_Streaming_P_GYRO_X (KEY_Streaming_P_GYRO_Y + 1) +#define KEY_Streaming_P_TEMP (KEY_Streaming_P_GYRO_X + 1) +#define KEY_Streaming_P_AUX_Y (KEY_Streaming_P_TEMP + 1) +#define KEY_Streaming_P_AUX_X (KEY_Streaming_P_AUX_Y + 1) +#define KEY_Streaming_P_AUX_Z (KEY_Streaming_P_AUX_X + 1) +#define KEY_Streaming_P_ACCEL_Y (KEY_Streaming_P_AUX_Z + 1) +#define KEY_Streaming_P_ACCEL_X (KEY_Streaming_P_ACCEL_Y + 1) +#define KEY_Streaming_P_FOOTER (KEY_Streaming_P_ACCEL_X + 1) +#define KEY_Streaming_P_ACCEL_Z (KEY_Streaming_P_FOOTER + 1) + +#define NUM_KEYS (KEY_Streaming_P_ACCEL_Z + 1) + +typedef struct +{ unsigned short key; unsigned short addr; } tKeyLabel; @@ -389,7 +390,6 @@ typedef struct { #define DINAB6 0xb6 #define DINAB4 0xb4 - #define DINC00 0x00 #define DINC01 0x01 #define DINC02 0x02 @@ -460,7 +460,6 @@ typedef struct { #define DIND40 0x40 - #define DINA80 0x80 #define DINA90 0x90 #define DINAA0 0xa0 @@ -489,6 +488,4 @@ typedef struct { #define DINBC4 0xc4 #define DINBC6 0xc6 - - #endif // DMPKEY_H__ diff --git a/test/test_luos/main.c b/test/test_luos/main.c index f778a8522..d6b56a3f5 100644 --- a/test/test_luos/main.c +++ b/test/test_luos/main.c @@ -1,28 +1,28 @@ #include "main.h" #include #include -#define STREAM_BUFFER_SIZE 1024 +#define Streaming_BUFFER_SIZE 1024 extern default_scenario_t default_sc; -void unittest_Streaming_SendStreamingSize() +void unittest_Luos_SendStreamingStreamingSize() { NEW_TEST_CASE("Sample size sent to streaming < Available samples"); { uint32_t ExpectedMaxSize; msg_t tx_msg; - tx_msg.header.target = 2; - tx_msg.header.target_mode = SERVICEIDACK; - tx_msg.header.cmd = DEFAULT_CMD; - uint8_t stream_Buffer[STREAM_BUFFER_SIZE] = {0}; - streaming_channel_t streamChannel = Stream_CreateStreamingChannel(stream_Buffer, STREAM_BUFFER_SIZE, 1); + tx_msg.header.target = 2; + tx_msg.header.target_mode = SERVICEIDACK; + tx_msg.header.cmd = DEFAULT_CMD; + uint8_t Streaming_Buffer[Streaming_BUFFER_SIZE] = {0}; + streaming_channel_t streamChannel = Streaming_CreateChannel(Streaming_Buffer, Streaming_BUFFER_SIZE, 1); // Init default scenario context Init_Context(); // Init variable ExpectedMaxSize = 1; // Add samples - Stream_AddAvailableSampleNB(&streamChannel, 2); + Streaming_AddAvailableSampleNB(&streamChannel, 2); NEW_STEP("Verify 1 byte is received when stream channels size is 2"); Luos_SendStreamingSize(default_sc.App_1.app, &tx_msg, &streamChannel, 1); @@ -35,18 +35,18 @@ void unittest_Streaming_SendStreamingSize() { uint32_t ExpectedMaxSize; msg_t tx_msg; - tx_msg.header.target = 2; - tx_msg.header.target_mode = SERVICEIDACK; - tx_msg.header.cmd = DEFAULT_CMD; - uint8_t stream_Buffer[STREAM_BUFFER_SIZE] = {0}; - streaming_channel_t streamChannel = Stream_CreateStreamingChannel(stream_Buffer, STREAM_BUFFER_SIZE, 1); + tx_msg.header.target = 2; + tx_msg.header.target_mode = SERVICEIDACK; + tx_msg.header.cmd = DEFAULT_CMD; + uint8_t Streaming_Buffer[Streaming_BUFFER_SIZE] = {0}; + streaming_channel_t streamChannel = Streaming_CreateChannel(Streaming_Buffer, Streaming_BUFFER_SIZE, 1); // Init default scenario context Init_Context(); // Init variable ExpectedMaxSize = 2; // Add samples - Stream_AddAvailableSampleNB(&streamChannel, 2); + Streaming_AddAvailableSampleNB(&streamChannel, 2); NEW_STEP("Verify 2 byte are received when stream channels size is 2"); Luos_SendStreamingSize(default_sc.App_1.app, &tx_msg, &streamChannel, 2); @@ -59,11 +59,11 @@ void unittest_Streaming_SendStreamingSize() { uint32_t ExpectedMaxSize; msg_t tx_msg; - tx_msg.header.target = 2; - tx_msg.header.target_mode = SERVICEIDACK; - tx_msg.header.cmd = DEFAULT_CMD; - uint8_t stream_Buffer[STREAM_BUFFER_SIZE] = {0}; - streaming_channel_t streamChannel = Stream_CreateStreamingChannel(stream_Buffer, STREAM_BUFFER_SIZE, 1); + tx_msg.header.target = 2; + tx_msg.header.target_mode = SERVICEIDACK; + tx_msg.header.cmd = DEFAULT_CMD; + uint8_t Streaming_Buffer[Streaming_BUFFER_SIZE] = {0}; + streaming_channel_t streamChannel = Streaming_CreateChannel(Streaming_Buffer, Streaming_BUFFER_SIZE, 1); // Init default scenario context Init_Context(); @@ -73,7 +73,7 @@ void unittest_Streaming_SendStreamingSize() NEW_STEP("Verify 2 byte are received when we try to send 3 bytes"); // Add samples - Stream_AddAvailableSampleNB(&streamChannel, 2); + Streaming_AddAvailableSampleNB(&streamChannel, 2); Luos_SendStreamingSize(default_sc.App_1.app, &tx_msg, &streamChannel, 3); Luos_Loop(); // Verify @@ -84,11 +84,11 @@ void unittest_Streaming_SendStreamingSize() { uint32_t ExpectedMaxSize; msg_t tx_msg; - tx_msg.header.target = 2; - tx_msg.header.target_mode = SERVICEIDACK; - tx_msg.header.cmd = DEFAULT_CMD; - uint8_t stream_Buffer[STREAM_BUFFER_SIZE] = {0}; - streaming_channel_t streamChannel = Stream_CreateStreamingChannel(stream_Buffer, STREAM_BUFFER_SIZE, 1); + tx_msg.header.target = 2; + tx_msg.header.target_mode = SERVICEIDACK; + tx_msg.header.cmd = DEFAULT_CMD; + uint8_t Streaming_Buffer[Streaming_BUFFER_SIZE] = {0}; + streaming_channel_t streamChannel = Streaming_CreateChannel(Streaming_Buffer, Streaming_BUFFER_SIZE, 1); // Init default scenario context Init_Context(); @@ -102,7 +102,7 @@ void unittest_Streaming_SendStreamingSize() tx_msg.header.target = 3; // Add samples - Stream_AddAvailableSampleNB(&streamChannel, 2); + Streaming_AddAvailableSampleNB(&streamChannel, 2); Luos_SendStreamingSize(default_sc.App_1.app, &tx_msg, &streamChannel, 0); Luos_Loop(); // Verify @@ -115,7 +115,7 @@ void unittest_Streaming_SendStreamingSize() tx_msg.header.target = 2; // Add samples - Stream_AddAvailableSampleNB(&streamChannel, 128); + Streaming_AddAvailableSampleNB(&streamChannel, 128); Luos_SendStreamingSize(default_sc.App_1.app, &tx_msg, &streamChannel, 128); Luos_Loop(); // Verify @@ -219,7 +219,7 @@ int main(int argc, char **argv) // Big data reception UNIT_TEST_RUN(unittest_Luos_ReceiveData); // Streaming functions - UNIT_TEST_RUN(unittest_Streaming_SendStreamingSize); + UNIT_TEST_RUN(unittest_Luos_SendStreamingStreamingSize); UNITY_END(); } diff --git a/test/test_luos/main.h b/test/test_luos/main.h index ee37ebd19..486ae2f27 100644 --- a/test/test_luos/main.h +++ b/test/test_luos/main.h @@ -2,6 +2,6 @@ #define MAIN_H // Sreaming functions -void unittest_Streaming_SendStreamingSize(void); +void unittest_Luos_SendStreamingStreamingSize(void); #endif //MAIN_H \ No newline at end of file diff --git a/tool_services/gate/pipe_link.c b/tool_services/gate/pipe_link.c index 1c37ff1aa..f3ea1b525 100644 --- a/tool_services/gate/pipe_link.c +++ b/tool_services/gate/pipe_link.c @@ -40,7 +40,7 @@ void PipeLink_Send(service_t *service, void *data, uint32_t size) { // We have a localhost pipe // Copy the data directly into the local streaming channel without passing by Luos. - Stream_PutSample(PipeDirectPutSample, data, size); + Streaming_PutSample(PipeDirectPutSample, data, size); // Send a void set_cmd to strat data transmission on pipe. msg.header.size = 0; Luos_SendMsg(service, &msg); diff --git a/tool_services/inspector/pipe_link.c b/tool_services/inspector/pipe_link.c index 84a71e38f..117082880 100644 --- a/tool_services/inspector/pipe_link.c +++ b/tool_services/inspector/pipe_link.c @@ -41,7 +41,7 @@ void PipeLink_Send(service_t *service, void *data, uint32_t size) msg.header.config = BASE_PROTOCOL; // We have a localhost pipe // Copy the data directly into the local streaming channel without passing by Luos. - Stream_PutSample(PipeDirectPutSample, data, size); + Streaming_PutSample(PipeDirectPutSample, data, size); // Send a void set_cmd to strat data transmission on pipe. msg.header.size = 0; Luos_SendMsg(service, &msg); diff --git a/tool_services/pipe/SERIAL/ARDUINO/pipe_com.cpp b/tool_services/pipe/SERIAL/ARDUINO/pipe_com.cpp index bb6b0b378..8e36d876a 100644 --- a/tool_services/pipe/SERIAL/ARDUINO/pipe_com.cpp +++ b/tool_services/pipe/SERIAL/ARDUINO/pipe_com.cpp @@ -51,7 +51,7 @@ void PipeCom_Loop(void) while (Serial.available() > 0) { data = Serial.read(); - Stream_PutSample(Pipe_GetRxStreamChannel(), &data, 1); + Streaming_PutSample(Pipe_GetRxStreamChannel(), &data, 1); } } /****************************************************************************** @@ -75,7 +75,7 @@ void PipeCom_Send(void) while (size > 0) { Serial.write(SerialProtocol_GetDataToSend(), size); - Stream_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size); + Streaming_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size); size = SerialProtocol_GetSizeToSend(); } } diff --git a/tool_services/pipe/SERIAL/ESP32_IDF/pipe_com.c b/tool_services/pipe/SERIAL/ESP32_IDF/pipe_com.c index 950003979..7c3ee18b3 100644 --- a/tool_services/pipe/SERIAL/ESP32_IDF/pipe_com.c +++ b/tool_services/pipe/SERIAL/ESP32_IDF/pipe_com.c @@ -49,7 +49,7 @@ void PipeCom_Loop(void) { uart_hal_read_rxfifo(&uart_hal_context_log, &data[0], &size); uart_hal_rxfifo_rst(&uart_hal_context_log); - Stream_PutSample(Pipe_GetRxStreamChannel(), &data[0], size); + Streaming_PutSample(Pipe_GetRxStreamChannel(), &data[0], size); } } /****************************************************************************** @@ -75,7 +75,7 @@ void PipeCom_Send(void) while (size > 0) { uart_hal_write_txfifo(&uart_hal_context_log, (uint8_t *)SerialProtocol_GetDataToSend(), size, &wr_size); - Stream_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), wr_size); + Streaming_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), wr_size); size = SerialProtocol_GetSizeToSend(); } } diff --git a/tool_services/pipe/SERIAL/NUCLEO-F0/pipe_com.c b/tool_services/pipe/SERIAL/NUCLEO-F0/pipe_com.c index b4899b8d5..5378d96ca 100644 --- a/tool_services/pipe/SERIAL/NUCLEO-F0/pipe_com.c +++ b/tool_services/pipe/SERIAL/NUCLEO-F0/pipe_com.c @@ -211,7 +211,7 @@ void PIPE_COM_IRQHANDLER() RX_PrevPointerPosition = RX_PointerPosition; if (size != 0) { - Stream_AddAvailableSampleNB(Pipe_GetRxStreamChannel(), size); + Streaming_AddAvailableSampleNB(Pipe_GetRxStreamChannel(), size); } } } @@ -228,7 +228,7 @@ void PIPE_TX_DMA_IRQHANDLER() { PIPE_TX_DMA_CLEAR_TC(PIPE_TX_DMA); - Stream_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size_to_send); + Streaming_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size_to_send); size = SerialProtocol_GetSizeToSend(); is_sending = false; if (size > 0) diff --git a/tool_services/pipe/SERIAL/NUCLEO-F4/pipe_com.c b/tool_services/pipe/SERIAL/NUCLEO-F4/pipe_com.c index b8a82c0b6..5e05427fe 100644 --- a/tool_services/pipe/SERIAL/NUCLEO-F4/pipe_com.c +++ b/tool_services/pipe/SERIAL/NUCLEO-F4/pipe_com.c @@ -212,7 +212,7 @@ void PIPE_COM_IRQHANDLER() RX_PrevPointerPosition = RX_PointerPosition; if (size != 0) { - Stream_AddAvailableSampleNB(Pipe_GetRxStreamChannel(), size); + Streaming_AddAvailableSampleNB(Pipe_GetRxStreamChannel(), size); } } } @@ -229,7 +229,7 @@ void PIPE_TX_DMA_IRQHANDLER() { PIPE_TX_DMA_CLEAR_TC(PIPE_TX_DMA); - Stream_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size_to_send); + Streaming_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size_to_send); size = SerialProtocol_GetSizeToSend(); is_sending = false; if (size > 0) diff --git a/tool_services/pipe/SERIAL/NUCLEO-G431/pipe_com.c b/tool_services/pipe/SERIAL/NUCLEO-G431/pipe_com.c index 2e1327b0a..c2f24ef58 100644 --- a/tool_services/pipe/SERIAL/NUCLEO-G431/pipe_com.c +++ b/tool_services/pipe/SERIAL/NUCLEO-G431/pipe_com.c @@ -212,7 +212,7 @@ void PIPE_COM_IRQHANDLER() RX_PrevPointerPosition = RX_PointerPosition; if (size != 0) { - Stream_AddAvailableSampleNB(Pipe_GetRxStreamChannel(), size); + Streaming_AddAvailableSampleNB(Pipe_GetRxStreamChannel(), size); } } } @@ -229,7 +229,7 @@ void PIPE_TX_DMA_IRQHANDLER() { PIPE_TX_DMA_CLEAR_TC(PIPE_TX_DMA); - Stream_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size_to_send); + Streaming_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size_to_send); size = SerialProtocol_GetSizeToSend(); is_sending = false; if (size > 0) diff --git a/tool_services/pipe/SERIAL/NUCLEO-G474/pipe_com.c b/tool_services/pipe/SERIAL/NUCLEO-G474/pipe_com.c index 0e168caf7..e650cd091 100644 --- a/tool_services/pipe/SERIAL/NUCLEO-G474/pipe_com.c +++ b/tool_services/pipe/SERIAL/NUCLEO-G474/pipe_com.c @@ -211,7 +211,7 @@ void PIPE_COM_IRQHANDLER() RX_PrevPointerPosition = P2L_PointerPosition; if (size != 0) { - Stream_AddAvailableSampleNB(Pipe_GetRxStreamChannel(), size); + Streaming_AddAvailableSampleNB(Pipe_GetRxStreamChannel(), size); } } } @@ -228,7 +228,7 @@ void PIPE_TX_DMA_IRQHANDLER() { PIPE_TX_DMA_CLEAR_TC(PIPE_TX_DMA); - Stream_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size_to_send); + Streaming_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size_to_send); size = SerialProtocol_GetSizeToSend(); is_sending = false; if (size > 0) diff --git a/tool_services/pipe/SERIAL/NUCLEO-L0/pipe_com.c b/tool_services/pipe/SERIAL/NUCLEO-L0/pipe_com.c index 0f0bd946a..5357f5691 100644 --- a/tool_services/pipe/SERIAL/NUCLEO-L0/pipe_com.c +++ b/tool_services/pipe/SERIAL/NUCLEO-L0/pipe_com.c @@ -211,7 +211,7 @@ void PIPE_COM_IRQHANDLER() RX_PrevPointerPosition = RX_PointerPosition; if (size != 0) { - Stream_AddAvailableSampleNB(Pipe_GetRxStreamChannel(), size); + Streaming_AddAvailableSampleNB(Pipe_GetRxStreamChannel(), size); } } } @@ -228,7 +228,7 @@ void PIPE_TX_DMA_IRQHANDLER() { PIPE_TX_DMA_CLEAR_TC(PIPE_TX_DMA); - Stream_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size_to_send); + Streaming_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size_to_send); size = SerialProtocol_GetSizeToSend(); is_sending = false; if (size > 0) diff --git a/tool_services/pipe/SERIAL/NUCLEO-L4/pipe_com.c b/tool_services/pipe/SERIAL/NUCLEO-L4/pipe_com.c index e764981f1..5f3f62056 100644 --- a/tool_services/pipe/SERIAL/NUCLEO-L4/pipe_com.c +++ b/tool_services/pipe/SERIAL/NUCLEO-L4/pipe_com.c @@ -211,7 +211,7 @@ void PIPE_COM_IRQHANDLER() RX_PrevPointerPosition = RX_PointerPosition; if (size != 0) { - Stream_AddAvailableSampleNB(Pipe_GetRxStreamChannel(), size); + Streaming_AddAvailableSampleNB(Pipe_GetRxStreamChannel(), size); } } } @@ -229,7 +229,7 @@ void PIPE_TX_DMA_IRQHANDLER() { PIPE_TX_DMA_CLEAR_TC(PIPE_TX_DMA); - Stream_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size_to_send); + Streaming_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size_to_send); size = SerialProtocol_GetSizeToSend(); is_sending = false; if (size > 0) diff --git a/tool_services/pipe/SERIAL/l0/pipe_com.c b/tool_services/pipe/SERIAL/l0/pipe_com.c index e7f55e599..afa06f143 100644 --- a/tool_services/pipe/SERIAL/l0/pipe_com.c +++ b/tool_services/pipe/SERIAL/l0/pipe_com.c @@ -208,7 +208,7 @@ void PIPE_COM_IRQHANDLER() RX_PrevPointerPosition = RX_PointerPosition; if (size != 0) { - Stream_AddAvailableSampleNB(Pipe_GetRxStreamChannel(), size); + Streaming_AddAvailableSampleNB(Pipe_GetRxStreamChannel(), size); } } } @@ -225,7 +225,7 @@ void PIPE_TX_DMA_IRQHANDLER() { PIPE_TX_DMA_CLEAR_TC(PIPE_TX_DMA); - Stream_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size_to_send); + Streaming_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size_to_send); size = SerialProtocol_GetSizeToSend(); is_sending = false; if (size > 0) diff --git a/tool_services/pipe/SERIAL/serial_protocol.h b/tool_services/pipe/SERIAL/serial_protocol.h index f093336ac..17633d721 100644 --- a/tool_services/pipe/SERIAL/serial_protocol.h +++ b/tool_services/pipe/SERIAL/serial_protocol.h @@ -41,7 +41,7 @@ static inline void SerialProtocol_Init(void) SERIAL_HEADER, 0, }; - Stream_PutSample(serialTx_StreamChannel, &SerialHeader, sizeof(SerialHeader_t)); + Streaming_PutSample(serialTx_StreamChannel, &SerialHeader, sizeof(SerialHeader_t)); // Keep size to update, size are the last 2 bytes of the StreamChannel size_to_update = (uint8_t *)((int)serialTx_StreamChannel->data_ptr - 2); // Now we are ready to get data @@ -50,7 +50,7 @@ static inline void SerialProtocol_Init(void) static inline void SerialProtocol_CreateTxMsg(void) { // Evaluate size - uint16_t size = (Stream_GetAvailableSampleNB(serialTx_StreamChannel) - sizeof(SerialHeader_t)); + uint16_t size = (Streaming_GetAvailableSampleNB(serialTx_StreamChannel) - sizeof(SerialHeader_t)); // Update size if ((size_to_update + 2) > (uint8_t *)((int)serialTx_StreamChannel->end_ring_buffer)) { @@ -72,7 +72,7 @@ static inline void SerialProtocol_CreateTxMsg(void) {SERIAL_HEADER, 0} // Size will be updated on the next call of SerialProtocol_CreateTxMsg() }; - Stream_PutSample(serialTx_StreamChannel, &SerialProtocol, sizeof(SerialProtocol_t)); + Streaming_PutSample(serialTx_StreamChannel, &SerialProtocol, sizeof(SerialProtocol_t)); // Keep size to update, size are the last 2 bytes of the StreamChannel if (serialTx_StreamChannel->data_ptr == serialTx_StreamChannel->ring_buffer) @@ -91,13 +91,13 @@ static inline void SerialProtocol_CreateTxMsg(void) static inline uint16_t SerialProtocol_GetSizeToSend(void) { - if ((Stream_GetAvailableSampleNB(serialTx_StreamChannel) - sizeof(SerialHeader_t)) > Stream_GetAvailableSampleNBUntilEndBuffer(serialTx_StreamChannel)) + if ((Streaming_GetAvailableSampleNB(serialTx_StreamChannel) - sizeof(SerialHeader_t)) > Streaming_GetAvailableSampleNBUntilEndBuffer(serialTx_StreamChannel)) { - return Stream_GetAvailableSampleNBUntilEndBuffer(serialTx_StreamChannel); + return Streaming_GetAvailableSampleNBUntilEndBuffer(serialTx_StreamChannel); } else { - return Stream_GetAvailableSampleNB(serialTx_StreamChannel) - sizeof(SerialHeader_t); + return Streaming_GetAvailableSampleNB(serialTx_StreamChannel) - sizeof(SerialHeader_t); } } @@ -109,7 +109,7 @@ static inline char *SerialProtocol_GetDataToSend(void) static inline uint8_t SerialProtocol_IsMsgComplete(uint16_t *size) { streaming_channel_t *serialRx_StreamChannel = Pipe_GetRxStreamChannel(); - uint16_t TotalSize = Stream_GetAvailableSampleNB(serialRx_StreamChannel); + uint16_t TotalSize = Streaming_GetAvailableSampleNB(serialRx_StreamChannel); uint16_t SizeUntilEnd = 0; if (TotalSize > 4) @@ -123,7 +123,7 @@ static inline uint8_t SerialProtocol_IsMsgComplete(uint16_t *size) // Make TotalSize fit the size of remaining datas. TotalSize = TotalSize - i; i = 0; - SizeUntilEnd = Stream_GetAvailableSampleNBUntilEndBuffer(serialRx_StreamChannel); + SizeUntilEnd = Streaming_GetAvailableSampleNBUntilEndBuffer(serialRx_StreamChannel); // Make size pointer point to the size data (1 byte after the SERIAL_HEADER 16bits length) if (SizeUntilEnd > 1) { @@ -152,7 +152,7 @@ static inline uint8_t SerialProtocol_IsMsgComplete(uint16_t *size) if (*((uint8_t *)((int)serialRx_StreamChannel->sample_ptr + (*size + 3))) == SERIAL_FOOTER) { // This is a good message remove the header and size from the available sample keeping only the data - Stream_RmvAvailableSampleNB(serialRx_StreamChannel, 3); + Streaming_RmvAvailableSampleNB(serialRx_StreamChannel, 3); return true; } // Else this is not really a massage begin, so we have to remove the fake SERIAL_HEADER byte an dcontinue looking for it. @@ -163,7 +163,7 @@ static inline uint8_t SerialProtocol_IsMsgComplete(uint16_t *size) if (*((uint8_t *)((int)serialRx_StreamChannel->ring_buffer + ((*size + 3) - SizeUntilEnd))) == SERIAL_FOOTER) { // This is a good message remove the header and size from the available sample keeping only the data - Stream_RmvAvailableSampleNB(serialRx_StreamChannel, 3); + Streaming_RmvAvailableSampleNB(serialRx_StreamChannel, 3); return true; } // Else this is not really a massage begin, so we have to remove the fake SERIAL_HEADER byte an dcontinue looking for it. @@ -181,7 +181,7 @@ static inline uint8_t SerialProtocol_IsMsgComplete(uint16_t *size) } } // The first byte is not a good header remove the byte - Stream_RmvAvailableSampleNB(serialRx_StreamChannel, 1); + Streaming_RmvAvailableSampleNB(serialRx_StreamChannel, 1); } } return false; diff --git a/tool_services/pipe/WS/ARDUINO/pipe_com.cpp b/tool_services/pipe/WS/ARDUINO/pipe_com.cpp index f5dde1831..69be579e6 100644 --- a/tool_services/pipe/WS/ARDUINO/pipe_com.cpp +++ b/tool_services/pipe/WS/ARDUINO/pipe_com.cpp @@ -73,7 +73,7 @@ void onWebSocketEvent(uint8_t num, WStype_t type, uint8_t *payload, size_t lengt case WStype_TEXT: case WStype_BIN: Serial.printf("[%u] Text: %s\n", num, payload); - Stream_PutSample(Pipe_GetRxStreamChannel(), payload, length); + Streaming_PutSample(Pipe_GetRxStreamChannel(), payload, length); break; // For everything else: do nothing @@ -134,11 +134,11 @@ void PipeCom_Init(void) ******************************************************************************/ uint16_t PipeCom_GetSizeToSend(void) { - if ((Stream_GetAvailableSampleNB(Pipe_GetTxStreamChannel())) > Stream_GetAvailableSampleNBUntilEndBuffer(Pipe_GetTxStreamChannel())) + if ((Streaming_GetAvailableSampleNB(Pipe_GetTxStreamChannel())) > Streaming_GetAvailableSampleNBUntilEndBuffer(Pipe_GetTxStreamChannel())) { - return Stream_GetAvailableSampleNBUntilEndBuffer(Pipe_GetTxStreamChannel()); + return Streaming_GetAvailableSampleNBUntilEndBuffer(Pipe_GetTxStreamChannel()); } - return Stream_GetAvailableSampleNB(Pipe_GetTxStreamChannel()); + return Streaming_GetAvailableSampleNB(Pipe_GetTxStreamChannel()); } /****************************************************************************** * @brief We need to send something @@ -153,7 +153,7 @@ void PipeCom_Send(void) while (size != 0) { webSocket.sendBIN(ws_cli, (uint8_t *)Pipe_GetTxStreamChannel()->sample_ptr, size); - Stream_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size); + Streaming_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size); size = PipeCom_GetSizeToSend(); } } @@ -165,7 +165,7 @@ void PipeCom_Send(void) ******************************************************************************/ uint8_t PipeCom_Receive(uint16_t *size) { - *size = Stream_GetAvailableSampleNB(Pipe_GetRxStreamChannel()); + *size = Streaming_GetAvailableSampleNB(Pipe_GetRxStreamChannel()); return (*size > 0); } /****************************************************************************** diff --git a/tool_services/pipe/WS/ESP32_IDF/pipe_com.c b/tool_services/pipe/WS/ESP32_IDF/pipe_com.c index 06c937897..a02518d5c 100644 --- a/tool_services/pipe/WS/ESP32_IDF/pipe_com.c +++ b/tool_services/pipe/WS/ESP32_IDF/pipe_com.c @@ -92,7 +92,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { // Got websocket frame. Received data is wm->data. save it into the Pipe streaming channel struct mg_ws_message *wm = (struct mg_ws_message *)ev_data; - Stream_PutSample(Pipe_GetRxStreamChannel(), wm->data.ptr, wm->data.len); + Streaming_PutSample(Pipe_GetRxStreamChannel(), wm->data.ptr, wm->data.len); } else if (ev == MG_EV_ERROR) { @@ -256,11 +256,11 @@ void PipeCom_Init(void) ******************************************************************************/ uint16_t PipeCom_GetSizeToSend(void) { - if ((Stream_GetAvailableSampleNB(Pipe_GetTxStreamChannel())) > Stream_GetAvailableSampleNBUntilEndBuffer(Pipe_GetTxStreamChannel())) + if ((Streaming_GetAvailableSampleNB(Pipe_GetTxStreamChannel())) > Streaming_GetAvailableSampleNBUntilEndBuffer(Pipe_GetTxStreamChannel())) { - return Stream_GetAvailableSampleNBUntilEndBuffer(Pipe_GetTxStreamChannel()); + return Streaming_GetAvailableSampleNBUntilEndBuffer(Pipe_GetTxStreamChannel()); } - return Stream_GetAvailableSampleNB(Pipe_GetTxStreamChannel()); + return Streaming_GetAvailableSampleNB(Pipe_GetTxStreamChannel()); } /****************************************************************************** @@ -276,7 +276,7 @@ void PipeCom_Send(void) while (size != 0) { mg_ws_send(ws_connection, (const char *)Pipe_GetTxStreamChannel()->sample_ptr, size, WEBSOCKET_OP_BINARY); - Stream_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size); + Streaming_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size); size = PipeCom_GetSizeToSend(); } } @@ -288,7 +288,7 @@ void PipeCom_Send(void) ******************************************************************************/ uint8_t PipeCom_Receive(uint16_t *size) { - *size = Stream_GetAvailableSampleNB(Pipe_GetRxStreamChannel()); + *size = Streaming_GetAvailableSampleNB(Pipe_GetRxStreamChannel()); return (*size > 0); } diff --git a/tool_services/pipe/WS/native/pipe_com.c b/tool_services/pipe/WS/native/pipe_com.c index 7b905f201..e0e651d56 100644 --- a/tool_services/pipe/WS/native/pipe_com.c +++ b/tool_services/pipe/WS/native/pipe_com.c @@ -62,7 +62,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) { // Got websocket frame. Received data is wm->data. save it into the Pipe streaming channel struct mg_ws_message *wm = (struct mg_ws_message *)ev_data; - Stream_PutSample(Pipe_GetRxStreamChannel(), wm->data.ptr, wm->data.len); + Streaming_PutSample(Pipe_GetRxStreamChannel(), wm->data.ptr, wm->data.len); } else if (ev == MG_EV_CLOSE) { @@ -96,11 +96,11 @@ void PipeCom_Init(void) ******************************************************************************/ uint16_t PipeCom_GetSizeToSend(void) { - if ((Stream_GetAvailableSampleNB(Pipe_GetTxStreamChannel())) > Stream_GetAvailableSampleNBUntilEndBuffer(Pipe_GetTxStreamChannel())) + if ((Streaming_GetAvailableSampleNB(Pipe_GetTxStreamChannel())) > Streaming_GetAvailableSampleNBUntilEndBuffer(Pipe_GetTxStreamChannel())) { - return Stream_GetAvailableSampleNBUntilEndBuffer(Pipe_GetTxStreamChannel()); + return Streaming_GetAvailableSampleNBUntilEndBuffer(Pipe_GetTxStreamChannel()); } - return Stream_GetAvailableSampleNB(Pipe_GetTxStreamChannel()); + return Streaming_GetAvailableSampleNB(Pipe_GetTxStreamChannel()); } /****************************************************************************** @@ -117,7 +117,7 @@ void PipeCom_Send(void) while (size != 0) { mg_ws_send(ws_connection, (const char *)Pipe_GetTxStreamChannel()->sample_ptr, size, WEBSOCKET_OP_BINARY); - Stream_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size); + Streaming_RmvAvailableSampleNB(Pipe_GetTxStreamChannel(), size); size = PipeCom_GetSizeToSend(); start_tick = Luos_GetSystick(); while (Luos_GetSystick() - start_tick < 2) @@ -133,7 +133,7 @@ void PipeCom_Send(void) ******************************************************************************/ uint8_t PipeCom_Receive(uint16_t *size) { - *size = Stream_GetAvailableSampleNB(Pipe_GetRxStreamChannel()); + *size = Streaming_GetAvailableSampleNB(Pipe_GetRxStreamChannel()); return (*size > 0); } diff --git a/tool_services/pipe/pipe.c b/tool_services/pipe/pipe.c index 16b937e53..db64d92f9 100644 --- a/tool_services/pipe/pipe.c +++ b/tool_services/pipe/pipe.c @@ -32,8 +32,8 @@ static void Pipe_MsgHandler(service_t *service, msg_t *msg); ******************************************************************************/ void Pipe_Init(void) { - rx_StreamChannel = Stream_CreateStreamingChannel(rx_Buffer, PIPE_RX_BUFFER_SIZE, 1); - tx_StreamChannel = Stream_CreateStreamingChannel(tx_Buffer, PIPE_TX_BUFFER_SIZE, 1); + rx_StreamChannel = Streaming_CreateChannel(rx_Buffer, PIPE_RX_BUFFER_SIZE, 1); + tx_StreamChannel = Streaming_CreateChannel(tx_Buffer, PIPE_TX_BUFFER_SIZE, 1); PipeCom_Init(); revision_t revision = {.major = 1, .minor = 0, .build = 0}; Luos_CreateService(Pipe_MsgHandler, PIPE_TYPE, "Pipe", revision); @@ -113,7 +113,7 @@ void node_assert(char *file, uint32_t line) // manage self crashing scenario char json[512]; sprintf(json, "{\"assert\":{\"node_id\":1,\"file\":\"%s\",\"line\":%d}}\n", file, (unsigned int)line); - Stream_PutSample(&tx_StreamChannel, json, strlen(json)); + Streaming_PutSample(&tx_StreamChannel, json, strlen(json)); // Send the message PipeCom_Send(); From 35ab1618f97236ba7a12c3be18e13462086c5483 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 30 Mar 2023 12:28:46 +0200 Subject: [PATCH 013/150] Update Timestamp functions API --- engine/core/inc/luos_engine.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/engine/core/inc/luos_engine.h b/engine/core/inc/luos_engine.h index 8a51c9386..8861c1f83 100644 --- a/engine/core/inc/luos_engine.h +++ b/engine/core/inc/luos_engine.h @@ -61,15 +61,16 @@ void Luos_Detect(service_t *service); void Luos_ServicesClear(void); // ***************** Messaging management ***************** + +void Luos_Flush(void); + // *** Streaming management *** #include "streaming.h" void Luos_SendStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream); void Luos_SendStreamingSize(service_t *service, msg_t *msg, streaming_channel_t *stream, uint32_t max_size); error_return_t Luos_ReceiveStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream); -void Luos_Flush(void); - -// *** Timestamping management *** +// *** Timestamping management (in file `timestamp.c`)*** time_luos_t Luos_Timestamp(void); bool Luos_IsMsgTimstamped(msg_t *msg); time_luos_t Luos_GetMsgTimestamp(msg_t *msg); @@ -83,10 +84,6 @@ error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic); void Luos_SendData(service_t *service, msg_t *msg, void *bin_data, uint16_t size); int Luos_ReceiveData(service_t *service, msg_t *msg, void *bin_data); -// *** Pub/Sub management (in file `pub_sub.c`)*** -error_return_t PubSub_Subscribe(service_t *service, uint16_t topic); -error_return_t PubSub_Unsubscribe(service_t *service, uint16_t topic); - // *** Basic transmission management *** error_return_t Luos_SendMsg(service_t *service, msg_t *msg); error_return_t Luos_TxComplete(void); From 31b3cdda739d1bee36065458d04d5c2511cd8c30 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 28 Mar 2023 17:23:06 +0200 Subject: [PATCH 014/150] Move general_stats_t from luos_engine.h to service_structs.h --- engine/core/inc/luos_engine.h | 17 -------- engine/core/inc/luos_list.h | 8 ---- engine/core/inc/profile_core.h | 4 -- engine/core/inc/service_structs.h | 69 ++++++++++++++++++++----------- engine/core/inc/streaming.h | 3 -- 5 files changed, 45 insertions(+), 56 deletions(-) diff --git a/engine/core/inc/luos_engine.h b/engine/core/inc/luos_engine.h index 8861c1f83..dcae03651 100644 --- a/engine/core/inc/luos_engine.h +++ b/engine/core/inc/luos_engine.h @@ -21,23 +21,6 @@ #define LUOS_RUN() Luos_Run(); -/****************************************************************************** - * @struct general_stats_t - * @brief format all datas to be sent trough msg - ******************************************************************************/ -typedef struct __attribute__((__packed__)) -{ - union - { - struct __attribute__((__packed__)) - { - luos_stats_t node_stat; - service_stats_t service_stat; - }; - uint8_t unmap[sizeof(luos_stats_t) + sizeof(service_stats_t)]; /*!< streamable form. */ - }; -} general_stats_t; - /******************************************************************************* * Function ******************************************************************************/ diff --git a/engine/core/inc/luos_list.h b/engine/core/inc/luos_list.h index 7fdaf7826..579794d84 100644 --- a/engine/core/inc/luos_list.h +++ b/engine/core/inc/luos_list.h @@ -101,12 +101,4 @@ typedef enum LUOS_LAST_STD_CMD = 128 } luos_cmd_t; -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Function - ******************************************************************************/ - #endif /* LUOS_LIST_H */ diff --git a/engine/core/inc/profile_core.h b/engine/core/inc/profile_core.h index 7be82fbc4..03c5378b1 100644 --- a/engine/core/inc/profile_core.h +++ b/engine/core/inc/profile_core.h @@ -39,10 +39,6 @@ enum CONNECT_PROFILE }; -/******************************************************************************* - * Variables - ******************************************************************************/ - /******************************************************************************* * Function ******************************************************************************/ diff --git a/engine/core/inc/service_structs.h b/engine/core/inc/service_structs.h index fbc5c1933..66c0efb90 100644 --- a/engine/core/inc/service_structs.h +++ b/engine/core/inc/service_structs.h @@ -1,6 +1,6 @@ /****************************************************************************** - * @file services structure - * @brief describs all the + * @file services structures + * @brief describe all the service related structures * @author Luos * @version 0.0.0 ******************************************************************************/ @@ -13,9 +13,11 @@ /******************************************************************************* * Definitions ******************************************************************************/ -/* store informations about luos stats + +/****************************************************************************** + * store informations about luos stats * please refer to the documentation - */ + ******************************************************************************/ typedef struct __attribute__((__packed__)) { union @@ -28,9 +30,10 @@ typedef struct __attribute__((__packed__)) uint8_t unmap[sizeof(memory_stats_t) + 1]; /*!< streamable form. */ }; } luos_stats_t; -/* This structure is used to create services version +/****************************************************************************** + * This structure is used to create services version * please refer to the documentation - */ + ******************************************************************************/ typedef struct __attribute__((__packed__)) { union @@ -44,9 +47,10 @@ typedef struct __attribute__((__packed__)) uint8_t unmap[3]; /*!< streamable form. */ }; } revision_t; -/* This structure is used to manage services statistic +/****************************************************************************** + * This structure is used to manage services statistic * please refer to the documentation - */ + ******************************************************************************/ typedef struct __attribute__((__packed__)) service_stats_t { union @@ -59,9 +63,27 @@ typedef struct __attribute__((__packed__)) service_stats_t }; } service_stats_t; -/* This structure is used to manage services timed auto update +/****************************************************************************** + * @struct general_stats_t + * @brief format all datas to be sent trough msg + ******************************************************************************/ +typedef struct __attribute__((__packed__)) +{ + union + { + struct __attribute__((__packed__)) + { + luos_stats_t node_stat; + service_stats_t service_stat; + }; + uint8_t unmap[sizeof(luos_stats_t) + sizeof(service_stats_t)]; /*!< streamable form. */ + }; +} general_stats_t; + +/****************************************************************************** + * This structure is used to manage services timed auto update * please refer to the documentation - */ + ******************************************************************************/ typedef struct __attribute__((__packed__)) timed_update_t { uint32_t last_update; @@ -69,9 +91,10 @@ typedef struct __attribute__((__packed__)) timed_update_t uint16_t target; } timed_update_t; -/* This structure is used to manage read or write access +/****************************************************************************** + * This structure is used to manage read or write access * please refer to the documentation - */ + ******************************************************************************/ typedef enum { READ_WRITE_ACCESS, @@ -80,18 +103,20 @@ typedef enum NO_ACCESS } access_t; -/* This structure is used to manage packages +/****************************************************************************** + * This structure is used to manage packages * please refer to the documentation - */ + ******************************************************************************/ typedef struct { void (*Init)(void); void (*Loop)(void); } package_t; -/* This structure is used to manage services +/****************************************************************************** + * This structure is used to manage services * please refer to the documentation - */ + ******************************************************************************/ typedef struct __attribute__((__packed__)) service_t { ll_service_t *ll_service; @@ -110,6 +135,10 @@ typedef struct __attribute__((__packed__)) service_t typedef void (*SERVICE_CB)(service_t *service, msg_t *msg); +/****************************************************************************** + * This enum list all CMD reserved to Luos + * please refer to the documentation + ******************************************************************************/ typedef enum { // Luos specific registers @@ -135,12 +164,4 @@ typedef enum LUOS_LAST_RESERVED_CMD = 42 } reserved_luos_cmd_t; -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Function - ******************************************************************************/ - #endif /*__SERVICE_STRUCT_H */ diff --git a/engine/core/inc/streaming.h b/engine/core/inc/streaming.h index fc47cf9cc..03c503f01 100644 --- a/engine/core/inc/streaming.h +++ b/engine/core/inc/streaming.h @@ -29,9 +29,6 @@ typedef struct void *data_ptr; // Current pointer of data uint8_t data_size; // Size granularity of the data contained on the ring buffer } streaming_channel_t; -/******************************************************************************* - * Variables - ******************************************************************************/ /******************************************************************************* * Function From 7704b7a83de4ec03afb99b85d4fb9ad1c8673c53 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 28 Mar 2023 17:33:42 +0200 Subject: [PATCH 015/150] Remove useless node_state_t struct --- engine/core/inc/luos_utils.h | 3 --- engine/core/src/luos_engine.c | 42 +++++++++++------------------------ engine/engine_config.h | 1 + 3 files changed, 14 insertions(+), 32 deletions(-) diff --git a/engine/core/inc/luos_utils.h b/engine/core/inc/luos_utils.h index 24401a66f..3b147a9cf 100644 --- a/engine/core/inc/luos_utils.h +++ b/engine/core/inc/luos_utils.h @@ -37,9 +37,6 @@ typedef struct __attribute__((__packed__)) }; } luos_assert_t; -/******************************************************************************* - * Variables - ******************************************************************************/ /******************************************************************************* * Function diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 05c02cb96..34af06561 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -13,17 +13,6 @@ #include "bootloader_core.h" #include "_timestamp.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define BOOT_TIMEOUT 1000 - -typedef enum -{ - NODE_INIT, - NODE_RUN -} node_state_t; - /******************************************************************************* * Variables ******************************************************************************/ @@ -1038,32 +1027,27 @@ void Luos_PackageLoop(void) ******************************************************************************/ void Luos_Run(void) { - static node_state_t node_state = NODE_INIT; + static bool node_run = false; - switch (node_state) + if (!node_run) { - case NODE_INIT: - Luos_Init(); + Luos_Init(); #ifdef BOOTLOADER - LuosBootloader_Init(); + LuosBootloader_Init(); #else - Luos_PackageInit(); + Luos_PackageInit(); #endif - // go to run state after initialization - node_state = NODE_RUN; - break; - case NODE_RUN: - Luos_Loop(); + // go to run state after initialization + node_run = true; + } + else + { + Luos_Loop(); #ifdef BOOTLOADER - LuosBootloader_Loop(); + LuosBootloader_Loop(); #else - Luos_PackageLoop(); + Luos_PackageLoop(); #endif - break; - default: - Luos_Loop(); - Luos_PackageLoop(); - break; } } /****************************************************************************** diff --git a/engine/engine_config.h b/engine/engine_config.h index ca21ef937..2b371a111 100644 --- a/engine/engine_config.h +++ b/engine/engine_config.h @@ -10,6 +10,7 @@ /******************************************************************************* * Definitions ******************************************************************************/ +#define BOOT_TIMEOUT 1000 #define DEFAULTID 0x00 #define PROTOCOL_REVISION 0 #define BROADCAST_VAL 0x0FFF From 2b3338cfcf028afeeb23879caf1fa577d107c819 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 28 Mar 2023 17:37:47 +0200 Subject: [PATCH 016/150] Remove dynamic baudrate management --- engine/IO/inc/io_struct.h | 1 - engine/core/src/luos_engine.c | 1 - network/robus/src/robus.c | 9 --------- 3 files changed, 11 deletions(-) diff --git a/engine/IO/inc/io_struct.h b/engine/IO/inc/io_struct.h index b246b8250..7501b2d09 100644 --- a/engine/IO/inc/io_struct.h +++ b/engine/IO/inc/io_struct.h @@ -154,7 +154,6 @@ typedef enum WRITE_NODE_ID, /*!< Get and save a new given node ID. */ START_DETECTION, /*!< Start a detection*/ END_DETECTION, /*!< Detect the end of a detection*/ - SET_BAUDRATE, /*!< Set Robus baudrate*/ ASSERT, /*!< Node Assert message (only broadcast with a source as a node */ /*!< Compatibility area*/ diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 34af06561..828f5a949 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -188,7 +188,6 @@ static error_return_t Luos_IsALuosCmd(service_t *service, uint8_t cmd, uint16_t { case WRITE_NODE_ID: case START_DETECTION: - case SET_BAUDRATE: // ERROR LUOS_ASSERT(0); break; diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index bdda80c00..43f7747f7 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -420,7 +420,6 @@ static error_return_t Robus_DetectNextNodes(ll_service_t *ll_service) ******************************************************************************/ static error_return_t Robus_MsgHandler(msg_t *input) { - uint32_t baudrate; msg_t output_msg; node_bootstrap_t node_bootstrap; ll_service_t *ll_service = Recep_GetConcernedLLService(&input->header); @@ -484,14 +483,6 @@ static error_return_t Robus_MsgHandler(msg_t *input) Robus_SetNodeDetected(DETECTION_OK); return FAILED; break; - case SET_BAUDRATE: - // We have to wait the end of transmission of all the messages we have to transmit - while (MsgAlloc_TxAllComplete() == FAILED) - ; - memcpy(&baudrate, input->data, sizeof(uint32_t)); - RobusHAL_ComInit(baudrate); - return SUCCEED; - break; default: return FAILED; break; From 0053566ae1acd32a2f1113bc24152e6d164fba5c Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 31 Mar 2023 20:07:47 +0200 Subject: [PATCH 017/150] Group all node functions on a node.c.h --- engine/IO/inc/io_struct.h | 22 --- engine/IO/src/msg_alloc.c | 5 +- engine/bootloader/bootloader_core.c | 8 +- engine/core/inc/luos_engine.h | 5 +- engine/core/inc/node.h | 51 ++++++ engine/core/inc/routing_table.h | 1 + engine/core/src/luos_engine.c | 79 ++------- engine/core/src/node.c | 154 ++++++++++++++++++ engine/core/src/routing_table.c | 4 +- engine/engine_config.h | 9 +- .../apps/alarm_controller/alarm_controller.c | 2 +- .../biometric-security/biometric_security.c | 2 +- .../apps/start_controller/start_controller.c | 2 +- ...uos_bootloader_samd21j18a.X.production.map | 22 +-- .../lib/Detection_Button/detection_button.c | 2 +- .../lib/LedStrip_Position/ledstrip_position.c | 2 +- .../lib/motor_copy/motor_copy.c | 2 +- .../motor_demo_app/lib/run_motor/run_motor.c | 2 +- .../native/ping_pong/lib/PingPong/ping_pong.c | 12 +- network/robus/inc/context.h | 11 -- network/robus/inc/robus.h | 14 -- network/robus/src/port_manager.c | 13 +- network/robus/src/reception.c | 8 +- network/robus/src/robus.c | 122 +++----------- network/robus/src/transmission.c | 2 +- test/_resources/Scenarios/default_scenario.c | 2 +- test/test_routing_table/main.c | 4 +- tool_services/gate/gate.c | 2 +- tool_services/inspector/inspector.c | 2 +- 29 files changed, 304 insertions(+), 262 deletions(-) create mode 100644 engine/core/inc/node.h create mode 100644 engine/core/src/node.c diff --git a/engine/IO/inc/io_struct.h b/engine/IO/inc/io_struct.h index 7501b2d09..078633862 100644 --- a/engine/IO/inc/io_struct.h +++ b/engine/IO/inc/io_struct.h @@ -126,28 +126,6 @@ typedef enum FAILED = 0xFF /*!< function fail. */ } error_return_t; -/****************************************************************************** - * @struct node_t - * @brief node informations structure - ******************************************************************************/ -typedef struct __attribute__((__packed__)) -{ - union - { - struct __attribute__((__packed__)) - { - struct __attribute__((__packed__)) - { - uint16_t node_id : 12; /*!< Node id */ - uint16_t certified : 4; /*!< True if the node have a certificate */ - uint8_t node_info; - }; - uint16_t port_table[NBR_PORT]; /*!< Phisical port connections */ - }; - uint8_t unmap[NBR_PORT + 3]; /*!< Uncmaped form. */ - }; -} node_t; - typedef enum { // protocol level command diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 0e443e515..f7bcd57eb 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -49,6 +49,7 @@ #include "msg_alloc.h" #include "luos_hal.h" #include "luos_utils.h" +#include "node.h" #include "context.h" @@ -703,9 +704,9 @@ error_return_t MsgAlloc_IsReseted(void) // Check if we need to reset everything due to detection reset if (reset_needed) { - if (ctx.node.node_id != 0) + if (Node_Get()->node_id != 0) { - ctx.node.node_id = 0; + Node_Get()->node_id = 0; // We need to reset MsgAlloc MsgAlloc_Init(NULL); } diff --git a/engine/bootloader/bootloader_core.c b/engine/bootloader/bootloader_core.c index 0e2949b03..609e3c95c 100644 --- a/engine/bootloader/bootloader_core.c +++ b/engine/bootloader/bootloader_core.c @@ -72,7 +72,7 @@ void LuosBootloader_JumpToBootloader(void) LuosHAL_SetMode((uint8_t)APP_RELOAD_MODE); // Save node id in flash - node_t *node = Robus_GetNode(); + node_t *node = Node_Get(); uint16_t node_id = node->node_id; LuosHAL_SaveNodeID(node_id); @@ -155,7 +155,7 @@ void LuosBootloader_JumpToApp(void) void LuosBootloader_SetNodeID(void) { uint16_t node_id = LuosHAL_GetNodeID(); - node_t *node = Robus_GetNode(); + node_t *node = Node_Get(); node->node_id = node_id; } @@ -324,7 +324,7 @@ void LuosBootloader_SendCrc(bootloader_cmd_t response, uint8_t data) ready_msg.header.size = 2 * sizeof(uint8_t); ready_msg.data[0] = response; ready_msg.data[1] = data; - node_t *node = Robus_GetNode(); + node_t *node = Node_Get(); uint32_t tick = LuosHAL_GetSystick(); while (LuosHAL_GetSystick() - tick < node->node_id) ; @@ -344,7 +344,7 @@ void LuosBootloader_SendResponse(bootloader_cmd_t response) ready_msg.header.target = source_id; ready_msg.header.size = sizeof(uint8_t); ready_msg.data[0] = response; - node_t *node = Robus_GetNode(); + node_t *node = Node_Get(); uint32_t tick = LuosHAL_GetSystick(); while (LuosHAL_GetSystick() - tick < node->node_id) ; diff --git a/engine/core/inc/luos_engine.h b/engine/core/inc/luos_engine.h index dcae03651..668676d34 100644 --- a/engine/core/inc/luos_engine.h +++ b/engine/core/inc/luos_engine.h @@ -26,10 +26,11 @@ ******************************************************************************/ void Luos_Init(void); void Luos_Loop(void); +void Luos_ResetStatistic(void); // ***************** Node management ***************** -void Luos_ResetStatistic(void); -bool Luos_IsNodeDetected(void); +uint32_t Luos_GetSystick(void); +bool Luos_IsDetected(void); void Luos_SetVerboseMode(uint8_t mode); void Luos_SetFilterState(uint8_t state, service_t *service); diff --git a/engine/core/inc/node.h b/engine/core/inc/node.h new file mode 100644 index 000000000..60549ac06 --- /dev/null +++ b/engine/core/inc/node.h @@ -0,0 +1,51 @@ +/****************************************************************************** + * @file node management + * @brief time stamp data + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef __NODE_H_ +#define __NODE_H_ +/******************************************************************************* + * Definitions + ******************************************************************************/ +typedef enum +{ + NO_DETECTION, + DETECTION_OK, + LOCAL_DETECTION, + EXTERNAL_DETECTION, +} node_state_t; + +/****************************************************************************** + * @struct node_t + * @brief node informations structure + ******************************************************************************/ +typedef struct __attribute__((__packed__)) +{ + union + { + struct __attribute__((__packed__)) + { + struct __attribute__((__packed__)) + { + uint16_t node_id : 12; /*!< Node id */ + uint16_t certified : 4; /*!< True if the node have a certificate */ + uint8_t node_info; + }; + uint16_t port_table[NBR_PORT]; /*!< Phisical port connections */ + }; + uint8_t unmap[NBR_PORT + 3]; /*!< Uncmaped form. */ + }; +} node_t; + +/******************************************************************************* + * Function + ******************************************************************************/ +void Node_Init(void); +void Node_Loop(void); +node_t *Node_Get(void); +node_state_t Node_GetState(void); +void Node_SetState(node_state_t); + +#endif /* __NODE_H_ */ \ No newline at end of file diff --git a/engine/core/inc/routing_table.h b/engine/core/inc/routing_table.h index 4ab6d0f2b..e912eb260 100644 --- a/engine/core/inc/routing_table.h +++ b/engine/core/inc/routing_table.h @@ -8,6 +8,7 @@ #define TABLE #include "luos_engine.h" +#include "node.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 828f5a949..adfe8f031 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -175,6 +175,19 @@ void Luos_Loop(void) Flag_DetectServices = 0; } } +/****************************************************************************** + * @brief Luos clear statistic + * @param None + * @return None + ******************************************************************************/ +void Luos_ResetStatistic(void) +{ + memset(&luos_stats.unmap[0], 0, sizeof(luos_stats_t)); + for (uint16_t i = 0; i < service_number; i++) + { + service_table[i].statistics.max_retry = 0; + } +} /****************************************************************************** * @brief Check if this command concern luos * @param service : Pointer to the service @@ -344,7 +357,7 @@ static error_return_t Luos_MsgHandler(service_t *service, msg_t *input) case ASK_DETECTION: if (input->header.size == 0) { - if (Robus_IsNodeDetected() < LOCAL_DETECTION) + if (Node_GetState() < LOCAL_DETECTION) { Flag_DetectServices = 1; } @@ -439,7 +452,7 @@ static void Luos_TransmitLocalRoutingTable(service_t *service, msg_t *routeTB_ms routing_table_t local_routing_table[service_number + 1]; // start by saving node entry - RoutingTB_ConvertNodeToRoutingTable(&local_routing_table[entry_nb], Robus_GetNode()); + RoutingTB_ConvertNodeToRoutingTable(&local_routing_table[entry_nb], Node_Get()); entry_nb++; // save services entry for (uint16_t i = 0; i < service_number; i++) @@ -495,7 +508,7 @@ static void Luos_AutoUpdateManager(void) } else { - if (Robus_IsNodeDetected() == DETECTION_OK) + if (Node_GetState() == DETECTION_OK) { // directly transmit the message in Localhost Robus_SetTxTask(service_table[i].ll_service, &updt_msg); @@ -891,15 +904,6 @@ uint16_t Luos_NbrAvailableMsg(void) { return MsgAlloc_LuosTasksNbr(); } -/****************************************************************************** - * @brief Get tick number - * @param None - * @return Tick - ******************************************************************************/ -uint32_t Luos_GetSystick(void) -{ - return LuosHAL_GetSystick(); -} /****************************************************************************** * @brief Check if all Tx message are complete * @param None @@ -909,55 +913,6 @@ error_return_t Luos_TxComplete(void) { return MsgAlloc_TxAllComplete(); } -/****************************************************************************** - * @brief Luos clear statistic - * @param None - * @return None - ******************************************************************************/ -void Luos_ResetStatistic(void) -{ - memset(&luos_stats.unmap[0], 0, sizeof(luos_stats_t)); - for (uint16_t i = 0; i < service_number; i++) - { - service_table[i].statistics.max_retry = 0; - } -} -/****************************************************************************** - * @brief Check if the node is connected to the network - * @param None - * @return TRUE if the node is connected to the network - ******************************************************************************/ -bool Luos_IsNodeDetected(void) -{ - if (Robus_IsNodeDetected() == DETECTION_OK) - { - return true; - } - else - { - return false; - } -} - -/****************************************************************************** - * @brief Function that changes the filter value - * @param state : Put to "1" if we want to disable the filter , "0" to enable - * @param service - * @return None - ******************************************************************************/ -void Luos_SetFilterState(uint8_t state, service_t *service) -{ - Robus_SetFilterState(state, service->ll_service); -} -/****************************************************************************** - * @brief Function that changes the verbose mode - * @param mode : Put to "1" if we want to enable the verbose mode, "0" to disable - * @return None - ******************************************************************************/ -void Luos_SetVerboseMode(uint8_t mode) -{ - Robus_SetVerboseMode(mode); -} /****************************************************************************** * @brief Register a new package * @param Init : Init function name @@ -1072,7 +1027,7 @@ void Luos_Detect(service_t *service) { msg_t detect_msg; - if (Robus_IsNodeDetected() < LOCAL_DETECTION) + if (Node_GetState() < LOCAL_DETECTION) { // set the detection launcher id to 1 Luos_SetID(service, 1); diff --git a/engine/core/src/node.c b/engine/core/src/node.c new file mode 100644 index 000000000..0525c8459 --- /dev/null +++ b/engine/core/src/node.c @@ -0,0 +1,154 @@ +/****************************************************************************** + * @file node + * @brief node level functions + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#include "luos_engine.h" +#include "luos_hal.h" +#include "node.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ +typedef struct +{ + node_t info; + node_state_t state; + bool timeout_run; + uint32_t timeout; +} node_ctx_t; + +/******************************************************************************* + * Variables + ******************************************************************************/ +node_ctx_t node_ctx; + +/******************************************************************************* + * Function + ******************************************************************************/ + +/****************************************************************************** + * @brief get node structure + * @param None + * @return Node pointer + ******************************************************************************/ +node_t *Node_Get(void) +{ + return (node_t *)&node_ctx.info; +} + +/****************************************************************************** + * @brief get network_state value + * @param None + * @return state + ******************************************************************************/ +node_state_t Node_GetState(void) +{ + return node_ctx.state; +} + +/****************************************************************************** + * @brief Node initialization + * @param None + * @return None + ******************************************************************************/ +void Node_Init(void) +{ + // Set default service id. This id is a void id used if no service is created. + node_ctx.info.node_id = DEFAULTID; + // By default node are not certified. + node_ctx.info.certified = false; + // set node_info value + node_ctx.info.node_info = 0; +#ifdef NO_RTB + node_ctx.node_info |= 1 << 0; +#endif +} + +/****************************************************************************** + * @brief Node loop management, specially for timeout purpose + * @param None + * @return None + ******************************************************************************/ +void Node_Loop(void) +{ + if (node_ctx.timeout_run) + { + // if timeout is reached, go back to link-down state + if (Luos_GetSystick() - node_ctx.timeout > DETECTION_TIMEOUT_MS) + { + node_ctx.state = NO_DETECTION; + } + } +} + +/****************************************************************************** + * @brief set network_state value + * @param state + * @return None + * _CRITICAL function call in IRQ + ******************************************************************************/ +_CRITICAL inline void Node_SetState(node_state_t state) +{ + switch (state) + { + case NO_DETECTION: + node_ctx.timeout_run = false; + node_ctx.timeout = 0; + break; + case LOCAL_DETECTION: + case EXTERNAL_DETECTION: + node_ctx.timeout_run = true; + node_ctx.timeout = Luos_GetSystick(); + break; + case DETECTION_OK: + node_ctx.timeout_run = false; + node_ctx.timeout = 0; + break; + default: + break; + } + node_ctx.state = state; +} + +/****************************************************************************** + * @brief Get tick number + * @param None + * @return Tick + ******************************************************************************/ +uint32_t Luos_GetSystick(void) +{ + return LuosHAL_GetSystick(); +} + +/****************************************************************************** + * @brief Check if the node is connected to the network + * @param None + * @return TRUE if the node is connected to the network + ******************************************************************************/ +bool Luos_IsDetected(void) +{ + return (node_ctx.state == DETECTION_OK); +} + +/****************************************************************************** + * @brief Function that changes the filter value + * @param state : Put to "1" if we want to disable the filter , "0" to enable + * @param service + * @return None + ******************************************************************************/ +void Luos_SetFilterState(uint8_t state, service_t *service) +{ + Robus_SetFilterState(state, service->ll_service); +} + +/****************************************************************************** + * @brief Function that changes the verbose mode + * @param mode : Put to "1" if we want to enable the verbose mode, "0" to disable + * @return None + ******************************************************************************/ +void Luos_SetVerboseMode(uint8_t mode) +{ + Robus_SetVerboseMode(mode); +} \ No newline at end of file diff --git a/engine/core/src/routing_table.c b/engine/core/src/routing_table.c index 44384c18b..e1ceeb7a4 100644 --- a/engine/core/src/routing_table.c +++ b/engine/core/src/routing_table.c @@ -302,7 +302,7 @@ static void RoutingTB_Generate(service_t *service, uint16_t nb_node) static void RoutingTB_Share(service_t *service, uint16_t nb_node) { // Make sure that the detection is not interrupted - if (Robus_IsNodeDetected() == EXTERNAL_DETECTION) + if (Node_GetState() == EXTERNAL_DETECTION) { return; } @@ -339,7 +339,7 @@ static void RoutingTB_Share(service_t *service, uint16_t nb_node) void RoutingTB_SendEndDetection(service_t *service) { // Make sure that the detection is not interrupted - if (Robus_IsNodeDetected() == EXTERNAL_DETECTION) + if (Node_GetState() == EXTERNAL_DETECTION) { return; } diff --git a/engine/engine_config.h b/engine/engine_config.h index 2b371a111..2287bf457 100644 --- a/engine/engine_config.h +++ b/engine/engine_config.h @@ -10,10 +10,11 @@ /******************************************************************************* * Definitions ******************************************************************************/ -#define BOOT_TIMEOUT 1000 -#define DEFAULTID 0x00 -#define PROTOCOL_REVISION 0 -#define BROADCAST_VAL 0x0FFF +#define DETECTION_TIMEOUT_MS 10000 // Timeout used to detect a failed detection +#define BOOT_TIMEOUT 1000 +#define DEFAULTID 0x00 +#define PROTOCOL_REVISION 0 +#define BROADCAST_VAL 0x0FFF #define MAX_ALIAS_SIZE 16 #define MAX_DATA_MSG_SIZE 128 diff --git a/examples/apps/alarm_controller/alarm_controller.c b/examples/apps/alarm_controller/alarm_controller.c index 37c04cae6..66a3ee03b 100644 --- a/examples/apps/alarm_controller/alarm_controller.c +++ b/examples/apps/alarm_controller/alarm_controller.c @@ -51,7 +51,7 @@ void AlarmController_Loop(void) // ********** hot plug management ************ // Check if we have done the first init or if service Id have changed - if (Luos_IsNodeDetected()) + if (Luos_IsDetected()) { if (end_detection) { diff --git a/examples/apps/biometric-security/biometric_security.c b/examples/apps/biometric-security/biometric_security.c index 3d48b6078..d14830467 100644 --- a/examples/apps/biometric-security/biometric_security.c +++ b/examples/apps/biometric-security/biometric_security.c @@ -70,7 +70,7 @@ void BiometricSecurity_Loop(void) static uint8_t system_init = 0; search_result_t result; - if (Luos_IsNodeDetected() && !system_init) + if (Luos_IsDetected() && !system_init) { RTFilter_Alias(RTFilter_Reset(&result), "btn_"); diff --git a/examples/apps/start_controller/start_controller.c b/examples/apps/start_controller/start_controller.c index 0a4a86989..0ff313568 100644 --- a/examples/apps/start_controller/start_controller.c +++ b/examples/apps/start_controller/start_controller.c @@ -61,7 +61,7 @@ void StartController_Loop(void) search_result_t result; // ********** hot plug management ************ // Check if we have done the first init or if service Id have changed - if (Luos_IsNodeDetected()) + if (Luos_IsDetected()) { // Make services configurations if (end_detection) diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map index e31b62a1e..204138e17 100644 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map +++ b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map @@ -360,7 +360,7 @@ section address length [bytes] (dec) Description .text.Luos_SetVerboseMo 0x8740 0x8 8 .text.RoutingTB_Get 0x8748 0x8 8 .text.LuosHAL_GetMode 0x8750 0x8 8 -.text.Robus_GetNode 0x8758 0x8 8 +.text.Node_Get 0x8758 0x8 8 .text._close 0x8760 0x8 8 .text._fstat 0x8768 0x8 8 .text._isatty 0x8770 0x8 8 @@ -609,7 +609,7 @@ Discarded input sections 0x00000000 0x44 build/luos_bootloader/production/_ext/1555399743/luos_engine.o .text.Luos_ReadFromService 0x00000000 0xa0 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_IsNodeDetected + .text.Luos_IsDetected 0x00000000 0x10 build/luos_bootloader/production/_ext/1555399743/luos_engine.o .text.Luos_SetFilterState 0x00000000 0x1c build/luos_bootloader/production/_ext/1555399743/luos_engine.o @@ -3127,11 +3127,11 @@ LOAD data_init 0x000078c0 0x44 build/luos_bootloader/production/_ext/1857845632/robus_hal.o 0x000078c0 RobusHAL_ResetTimeout -.text.Robus_SetNodeDetected%176 +.text.Node_SetState%176 0x00007904 0x44 - .text.Robus_SetNodeDetected + .text.Node_SetState 0x00007904 0x44 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x00007904 Robus_SetNodeDetected + 0x00007904 Node_SetState .text._fwalk_reent%177 0x00007948 0x42 @@ -3569,11 +3569,11 @@ LOAD data_init 0x00008644 0x10 build/luos_bootloader/production/_ext/1234256160/luos_hal.o 0x00008644 LuosHAL_FlashReadLuosMemoryInfo -.text.Robus_IsNodeDetected%258 +.text.Node_GetState%258 0x00008654 0x10 - .text.Robus_IsNodeDetected + .text.Node_GetState 0x00008654 0x10 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x00008654 Robus_IsNodeDetected + 0x00008654 Node_GetState .text.Robus_SetVerboseMode%259 0x00008664 0x10 @@ -3686,11 +3686,11 @@ LOAD data_init 0x00008750 0x8 build/luos_bootloader/production/_ext/1234256160/luos_hal.o 0x00008750 LuosHAL_GetMode -.text.Robus_GetNode%279 +.text.Node_Get%279 0x00008758 0x8 - .text.Robus_GetNode + .text.Node_Get 0x00008758 0x8 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x00008758 Robus_GetNode + 0x00008758 Node_Get .text._close%280 0x00008760 0x8 diff --git a/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.c b/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.c index 334e9e6d8..32810d513 100644 --- a/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.c +++ b/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.c @@ -48,7 +48,7 @@ void DetectionButton_Loop(void) // ********** hot plug management ************ // Check if we have done the first init or if service Id have changed - if (Luos_IsNodeDetected() == false) + if (Luos_IsDetected() == false) { // We don't have any ID, meaning no detection occure or detection is occuring. if (previous_id == -1) diff --git a/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.c b/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.c index 8f95e5bb4..51a05a83c 100644 --- a/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.c +++ b/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.c @@ -78,7 +78,7 @@ void LedStripPosition_Loop(void) static uint32_t lastframe_time_ms = 0; search_result_t result; // Check if we have done the first init or if service Id have changed - if (Luos_IsNodeDetected()) + if (Luos_IsDetected()) { if (end_detection) { diff --git a/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.c b/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.c index 2c52c16f3..06b68e633 100644 --- a/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.c +++ b/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.c @@ -53,7 +53,7 @@ void MotorCopy_Loop(void) { // Check if we have done the first init or if service Id have changed - if (Luos_IsNodeDetected()) + if (Luos_IsDetected()) { if (end_detection) { diff --git a/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.c b/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.c index 5ffaf5db2..9ffa9013f 100644 --- a/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.c +++ b/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.c @@ -72,7 +72,7 @@ void RunMotor_Init(void) void RunMotor_Loop(void) { // Check if we the node is detected - if (Luos_IsNodeDetected()) + if (Luos_IsDetected()) { // check if we need to change the selected motor // if new target has been received, update selected motor diff --git a/examples/projects/native/ping_pong/lib/PingPong/ping_pong.c b/examples/projects/native/ping_pong/lib/PingPong/ping_pong.c index 535395c7a..7ae9fe70a 100644 --- a/examples/projects/native/ping_pong/lib/PingPong/ping_pong.c +++ b/examples/projects/native/ping_pong/lib/PingPong/ping_pong.c @@ -208,7 +208,7 @@ void game_service() return; } } - if (!Luos_IsNodeDetected()) + if (!Luos_IsDetected()) { // Someone relaunch a detection game_state = game_loading; @@ -222,7 +222,7 @@ void game_over() char c; score_increase(player, last_id); set_screen_to(gameOver_view); - while (Luos_IsNodeDetected()) + while (Luos_IsDetected()) { if ((kbhit())) { @@ -241,7 +241,7 @@ void game_start() char c; set_screen_to(start_view); // Game is not running - while (!Luos_IsNodeDetected()) + while (!Luos_IsDetected()) { // This is the initialization if ((kbhit())) @@ -282,7 +282,7 @@ void game_alone() get_service = true; game_state = game_loading; update_alone = true; - while (Luos_IsNodeDetected()) + while (Luos_IsDetected()) { } return; @@ -293,7 +293,7 @@ void game_alone() void game_loading() { set_screen_to(wait_view); - while (!Luos_IsNodeDetected()) + while (!Luos_IsDetected()) { } if (get_service) @@ -311,7 +311,7 @@ void game_running() static ball_t last_ball = LEFT; static uint32_t empty_date; uint8_t c; - if (!Luos_IsNodeDetected()) + if (!Luos_IsDetected()) { // Someone relaunch a detection game_state = game_loading; diff --git a/network/robus/inc/context.h b/network/robus/inc/context.h index 970133660..fd2cb968a 100644 --- a/network/robus/inc/context.h +++ b/network/robus/inc/context.h @@ -16,18 +16,10 @@ * Definitions ******************************************************************************/ -typedef struct -{ - network_state_t state; - bool timeout_run; - uint32_t timeout; -} network_lock_t; - typedef struct { // Variables - node_t node; /*!< Node informations. */ RxCom_t rx; /*!< Receiver informations. */ TxCom_t tx; /*!< Transmitter informations. */ PortMng_t port; /*!< Port informations. */ @@ -38,9 +30,6 @@ typedef struct uint8_t IDMask[ID_MASK_SIZE]; uint16_t IDShiftMask; - // network management - network_lock_t node_connected; - uint8_t filter_state; uint16_t filter_id; uint8_t verbose; diff --git a/network/robus/inc/robus.h b/network/robus/inc/robus.h index fa0312d06..f86316ebc 100644 --- a/network/robus/inc/robus.h +++ b/network/robus/inc/robus.h @@ -10,17 +10,6 @@ #include #include #include "io_struct.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -typedef enum -{ - NO_DETECTION, - DETECTION_OK, - LOCAL_DETECTION, - EXTERNAL_DETECTION, -} network_state_t; - /******************************************************************************* * Variables ******************************************************************************/ @@ -35,10 +24,7 @@ void Robus_ServicesClear(void); error_return_t Robus_SetTxTask(ll_service_t *ll_service, msg_t *msg); error_return_t Robus_SendMsg(ll_service_t *ll_service, msg_t *msg); uint16_t Robus_TopologyDetection(ll_service_t *ll_service); -node_t *Robus_GetNode(void); void Robus_IDMaskCalculation(uint16_t service_id, uint16_t service_number); -void Robus_SetNodeDetected(network_state_t); -network_state_t Robus_IsNodeDetected(void); void Robus_SetFilterState(uint8_t state, ll_service_t *service); void Robus_SetVerboseMode(uint8_t mode); void Robus_MaskInit(void); diff --git a/network/robus/src/port_manager.c b/network/robus/src/port_manager.c index b467e7f8f..dd034ef77 100644 --- a/network/robus/src/port_manager.c +++ b/network/robus/src/port_manager.c @@ -39,6 +39,7 @@ #include "context.h" #include "robus_hal.h" #include "luos_hal.h" +#include "node.h" /******************************************************************************* * Definitions @@ -67,7 +68,7 @@ _CRITICAL void PortMng_Init(void) // Reinit port table for (uint8_t port = 0; port < NBR_PORT; port++) { - ctx.node.port_table[port] = 0; + Node_Get()->port_table[port] = 0; } } /****************************************************************************** @@ -85,7 +86,7 @@ _CRITICAL void PortMng_PtpHandler(uint8_t PortNbr) // Check if every line have been poked and poke it if not for (uint8_t port = 0; port < NBR_PORT; port++) { - if (ctx.node.port_table[port] == 0) + if (Node_Get()->port_table[port] == 0) { return; } @@ -117,7 +118,7 @@ uint8_t PortMng_PokePort(uint8_t PortNbr) while (LuosHAL_GetSystick() - start_tick < 3) ; // Save port as empty by default - ctx.node.port_table[PortNbr] = 0xFFFF; + Node_Get()->port_table[PortNbr] = 0xFFFF; // read the line state if (RobusHAL_GetPTPState(PortNbr)) { @@ -139,11 +140,11 @@ uint8_t PortMng_PokePort(uint8_t PortNbr) ******************************************************************************/ error_return_t PortMng_PokeNextPort(void) { - if ((ctx.port.activ != NBR_PORT) || (ctx.node.node_id == 1)) + if ((ctx.port.activ != NBR_PORT) || (Node_Get()->node_id == 1)) { for (uint8_t port = 0; port < NBR_PORT; port++) { - if (ctx.node.port_table[port] == 0) + if (Node_Get()->port_table[port] == 0) { // this port have not been poked if (PortMng_PokePort(port)) @@ -153,7 +154,7 @@ error_return_t PortMng_PokeNextPort(void) else { // nobody is here - ctx.node.port_table[port] = 0xFFFF; + Node_Get()->port_table[port] = 0xFFFF; } } } diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index b125d9d2d..1b6511b65 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -219,7 +219,7 @@ _CRITICAL void Recep_GetData(volatile uint8_t *data) { MsgAlloc_Reset(); ctx.tx.status = TX_DISABLE; - Robus_SetNodeDetected(EXTERNAL_DETECTION); + Node_SetState(EXTERNAL_DETECTION); Robus_SetVerboseMode(false); PortMng_Init(); } @@ -522,7 +522,7 @@ _CRITICAL luos_localhost_t Recep_NodeConcerned(header_t *header) } else { - if ((header->target == ctx.node.node_id) && ((header->target != 0))) + if ((header->target == Node_Get()->node_id) && ((header->target != 0))) { return ctx.verbose; } @@ -658,7 +658,7 @@ void Recep_InterpretMsgProtocol(msg_t *msg) return; } // check if the message is really for the node or it is a service that has no filter - if (msg->header.target == ctx.node.node_id) + if (msg->header.target == Node_Get()->node_id) { for (i = 0; i < ctx.ll_service_number; i++) { @@ -687,7 +687,7 @@ _CRITICAL static inline uint8_t Recep_IsAckNeeded(void) // when it is a serviceidack and this message is destined to the node send an ack return 1; } - else if ((current_msg->header.target_mode == NODEIDACK) && (ctx.node.node_id == current_msg->header.target)) + else if ((current_msg->header.target_mode == NODEIDACK) && (Node_Get()->node_id == current_msg->header.target)) { // when it is nodeidack and this message is destined to the node send an ack return 1; diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index 43f7747f7..e7c3b07d6 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -34,12 +34,9 @@ typedef struct __attribute__((__packed__)) }; } node_bootstrap_t; -#define NETWORK_TIMEOUT 10000 // timeout to detect a failed detection - static error_return_t Robus_MsgHandler(msg_t *input); static error_return_t Robus_DetectNextNodes(ll_service_t *ll_service); static error_return_t Robus_ResetNetworkDetection(ll_service_t *ll_service); -static void Robus_RunNetworkTimeout(void); /******************************************************************************* * Variables ******************************************************************************/ @@ -61,15 +58,7 @@ void Robus_Init(memory_stats_t *memory_stats) { // Init the number of created virtual service. ctx.ll_service_number = 0; - // Set default service id. This id is a void id used if no service is created. - ctx.node.node_id = DEFAULTID; - // By default node are not certified. - ctx.node.certified = false; - // set node_info value - ctx.node.node_info = 0; -#ifdef NO_RTB - ctx.node.node_info |= 1 << 0; -#endif + Node_Init(); // no transmission lock ctx.tx.lock = false; // Init collision state @@ -103,7 +92,7 @@ void Robus_Init(memory_stats_t *memory_stats) ctx.rx.status.unmap = 0; ctx.rx.status.identifier = 0xF; - Robus_SetNodeDetected(NO_DETECTION); + Node_SetState(NO_DETECTION); } /****************************************************************************** * @brief Reset Masks @@ -126,7 +115,7 @@ void Robus_MaskInit(void) void Robus_Loop(void) { // Network timeout management - Robus_RunNetworkTimeout(); + Node_Loop(); // Execute message allocation tasks MsgAlloc_loop(); // Interpreat received messages and create luos task for it. @@ -193,7 +182,7 @@ error_return_t Robus_SetTxTask(ll_service_t *ll_service, msg_t *msg) // *************************************************** // don't send luos messages if network is down // *************************************************** - if ((msg->header.cmd >= LUOS_LAST_RESERVED_CMD) && (Robus_IsNodeDetected() != DETECTION_OK)) + if ((msg->header.cmd >= LUOS_LAST_RESERVED_CMD) && (Node_GetState() != DETECTION_OK)) { return PROHIBITED; } @@ -260,7 +249,7 @@ error_return_t Robus_SendMsg(ll_service_t *ll_service, msg_t *msg) } else { - msg->header.source = ctx.node.node_id; + msg->header.source = Node_Get()->node_id; } if (Robus_SetTxTask(ll_service, msg) == FAILED) { @@ -280,7 +269,7 @@ uint16_t Robus_TopologyDetection(ll_service_t *ll_service) // if a detection is in progress, // Don't do an another detection and return 0 - if (Robus_IsNodeDetected() >= LOCAL_DETECTION) + if (Node_GetState() >= LOCAL_DETECTION) { return 0; } @@ -292,13 +281,13 @@ uint16_t Robus_TopologyDetection(ll_service_t *ll_service) // Reset all detection state of services on the network Robus_ResetNetworkDetection(ll_service); // Make sure that the detection is not interrupted - if (Robus_IsNodeDetected() == EXTERNAL_DETECTION) + if (Node_GetState() == EXTERNAL_DETECTION) { return 0; } // setup local node - ctx.node.node_id = 1; - last_node = 1; + Node_Get()->node_id = 1; + last_node = 1; // setup sending ll_service ll_service->id = 1; @@ -334,7 +323,7 @@ static error_return_t Robus_ResetNetworkDetection(ll_service_t *ll_service) { // if a detection is in progress, // Don't do an another detection and return 0 - if (Robus_IsNodeDetected() >= LOCAL_DETECTION) + if (Node_GetState() >= LOCAL_DETECTION) { return 0; } @@ -353,11 +342,11 @@ static error_return_t Robus_ResetNetworkDetection(ll_service_t *ll_service) try_nbr++; } while ((MsgAlloc_IsEmpty() != SUCCEED) || (try_nbr > 5)); - ctx.node.node_id = 0; + Node_Get()->node_id = 0; PortMng_Init(); if (try_nbr < 5) { - Robus_SetNodeDetected(LOCAL_DETECTION); + Node_SetState(LOCAL_DETECTION); return SUCCEED; } @@ -392,9 +381,9 @@ static error_return_t Robus_DetectNextNodes(ll_service_t *ll_service) { // Message transmission failure // Consider this port unconnected - ctx.node.port_table[ctx.port.activ] = 0xFFFF; - ctx.port.activ = NBR_PORT; - ctx.port.keepLine = false; + Node_Get()->port_table[ctx.port.activ] = 0xFFFF; + ctx.port.activ = NBR_PORT; + ctx.port.keepLine = false; continue; } @@ -404,7 +393,7 @@ static error_return_t Robus_DetectNextNodes(ll_service_t *ll_service) while (ctx.port.keepLine) { Robus_Loop(); - if (LuosHAL_GetSystick() - start_tick > NETWORK_TIMEOUT) + if (LuosHAL_GetSystick() - start_tick > DETECTION_TIMEOUT_MS) { // topology detection is too long, we should abort it and restart return FAILED; @@ -446,10 +435,10 @@ static error_return_t Robus_MsgHandler(msg_t *input) // This is a reply to our request to generate the next node id. // This node_id is the one after the currently poked branch. // We need to save this ID as a connection on a port - memcpy((void *)&ctx.node.port_table[ctx.port.activ], (void *)&input->data[0], sizeof(uint16_t)); + memcpy((void *)&Node_Get()->port_table[ctx.port.activ], (void *)&input->data[0], sizeof(uint16_t)); // Now we can send it to the next node memcpy((void *)&node_bootstrap.nodeid, (void *)&input->data[0], sizeof(uint16_t)); - node_bootstrap.prev_nodeid = ctx.node.node_id; + node_bootstrap.prev_nodeid = Node_Get()->node_id; output_msg.header.config = BASE_PROTOCOL; output_msg.header.cmd = WRITE_NODE_ID; output_msg.header.size = sizeof(node_bootstrap_t); @@ -459,15 +448,15 @@ static error_return_t Robus_MsgHandler(msg_t *input) Robus_SendMsg(ll_service, &output_msg); break; case sizeof(node_bootstrap_t): - if (ctx.node.node_id != 0) + if (Node_Get()->node_id != 0) { - ctx.node.node_id = 0; + Node_Get()->node_id = 0; MsgAlloc_Init(NULL); } // This is a node bootstrap information. memcpy((void *)&node_bootstrap.unmap[0], (void *)&input->data[0], sizeof(node_bootstrap_t)); - ctx.node.node_id = node_bootstrap.nodeid; - ctx.node.port_table[ctx.port.activ] = node_bootstrap.prev_nodeid; + Node_Get()->node_id = node_bootstrap.nodeid; + Node_Get()->port_table[ctx.port.activ] = node_bootstrap.prev_nodeid; // Continue the topology detection on our other ports. Robus_DetectNextNodes(ll_service); default: @@ -480,7 +469,7 @@ static error_return_t Robus_MsgHandler(msg_t *input) break; case END_DETECTION: // Detect end of detection - Robus_SetNodeDetected(DETECTION_OK); + Node_SetState(DETECTION_OK); return FAILED; break; default: @@ -489,15 +478,6 @@ static error_return_t Robus_MsgHandler(msg_t *input) } return FAILED; } -/****************************************************************************** - * @brief get node structure - * @param None - * @return Node pointer - ******************************************************************************/ -node_t *Robus_GetNode(void) -{ - return (node_t *)&ctx.node; -} /****************************************************************************** * @brief ID Mask calculation * @param ID and Number of service @@ -523,62 +503,6 @@ void Robus_IDMaskCalculation(uint16_t service_id, uint16_t service_number) } } -/****************************************************************************** - * @brief set node_connected variable - * @param state - * @return None - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL inline void Robus_SetNodeDetected(network_state_t state) -{ - switch (state) - { - case NO_DETECTION: - ctx.node_connected.timeout_run = false; - ctx.node_connected.timeout = 0; - break; - case LOCAL_DETECTION: - case EXTERNAL_DETECTION: - ctx.node_connected.timeout_run = true; - ctx.node_connected.timeout = LuosHAL_GetSystick(); - break; - case DETECTION_OK: - ctx.node_connected.timeout_run = false; - ctx.node_connected.timeout = 0; - break; - default: - break; - } - ctx.node_connected.state = state; -} - -/****************************************************************************** - * @brief manage network timeout - * @param None - * @return None - ******************************************************************************/ -void Robus_RunNetworkTimeout(void) -{ - if (ctx.node_connected.timeout_run) - { - // if timeout is reached, go back to link-down state - if (LuosHAL_GetSystick() - ctx.node_connected.timeout > NETWORK_TIMEOUT) - { - Robus_SetNodeDetected(NO_DETECTION); - } - } -} - -/****************************************************************************** - * @brief get node_connected value - * @param None - * @return state - ******************************************************************************/ -network_state_t Robus_IsNodeDetected(void) -{ - return ctx.node_connected.state; -} - /****************************************************************************** * @brief Function that changes the filter value * @param uint8_t value, 1 if we want to disable, 0 to enable diff --git a/network/robus/src/transmission.c b/network/robus/src/transmission.c index 8ac2b80d4..c6cdb66ff 100644 --- a/network/robus/src/transmission.c +++ b/network/robus/src/transmission.c @@ -228,7 +228,7 @@ _CRITICAL void Transmit_End(void) // A tx_task failed nbrRetry++; // compute a delay before retry - RobusHAL_ResetTimeout(20 * nbrRetry * (ctx.node.node_id + 1)); + RobusHAL_ResetTimeout(20 * nbrRetry * (Node_Get()->node_id + 1)); // Lock the trasmission to be sure no one can send something from this node. ctx.tx.lock = true; ctx.tx.status = TX_DISABLE; diff --git a/test/_resources/Scenarios/default_scenario.c b/test/_resources/Scenarios/default_scenario.c index 0a7aa9824..aa895d96d 100644 --- a/test/_resources/Scenarios/default_scenario.c +++ b/test/_resources/Scenarios/default_scenario.c @@ -72,7 +72,7 @@ static void Detection(service_t *service) do { Luos_Loop(); - } while (!Luos_IsNodeDetected()); + } while (!Luos_IsDetected()); RTFilter_Reset(&result); printf("[INFO] %d services are active\n", result.result_nbr); diff --git a/test/test_routing_table/main.c b/test/test_routing_table/main.c index 65a44e627..fda93c220 100644 --- a/test/test_routing_table/main.c +++ b/test/test_routing_table/main.c @@ -109,7 +109,7 @@ void unittest_RTFilter_Type(void) do { Luos_Loop(); - } while (!Luos_IsNodeDetected()); + } while (!Luos_IsDetected()); // Init variables search_result_t result; @@ -234,7 +234,7 @@ void unittest_RTFilter_Alias() do { Luos_Loop(); - } while (!Luos_IsNodeDetected()); + } while (!Luos_IsDetected()); // Init variables ExpectedServiceNB = 3; search_result_t result; diff --git a/tool_services/gate/gate.c b/tool_services/gate/gate.c index 3bc1eb3d7..0aac929a3 100644 --- a/tool_services/gate/gate.c +++ b/tool_services/gate/gate.c @@ -56,7 +56,7 @@ void Gate_Loop(void) static uint32_t last_time = 0; // Check the detection status. - if (Luos_IsNodeDetected() == false) + if (Luos_IsDetected() == false) { #ifndef GATE_POLLING update_time = TimeOD_TimeFrom_s(GATE_REFRESH_TIME_S); diff --git a/tool_services/inspector/inspector.c b/tool_services/inspector/inspector.c index 83ba51049..8183b2303 100644 --- a/tool_services/inspector/inspector.c +++ b/tool_services/inspector/inspector.c @@ -44,7 +44,7 @@ void Inspector_Init(void) void Inspector_Loop(void) { // check if the network is detected - if (Luos_IsNodeDetected()) + if (Luos_IsDetected()) { if (Luos_NbrAvailableMsg() > 0) { From c6bf09cc5eaacca8316e42ee3baab301740fc9ef Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 31 Mar 2023 11:55:38 +0200 Subject: [PATCH 018/150] Create a script to compile all examples as fast as possible --- test/example_build.py | 115 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100755 test/example_build.py diff --git a/test/example_build.py b/test/example_build.py new file mode 100755 index 000000000..4cb1d20f6 --- /dev/null +++ b/test/example_build.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +from os.path import join, realpath, exists +import os +import subprocess +import click +import multiprocessing as mp +import sys +import time +import argparse + + +exampledir = 'examples/projects' + +# Compute the number of examples +nb_example = 0 +compiled_example = None +examples_success = None +examples_failed = None + +for target in os.listdir(exampledir): + examples_path = join(realpath(exampledir), target) + if os.path.isdir(examples_path): + for example in os.listdir(os.path.join(exampledir, target)): + example_path = join(realpath(exampledir), target, example) + if (exists(join(example_path, "platformio.ini"))): + # This is a valid example, count it + nb_example += 1 + + +def init(compiled, success, failed): + ''' store the counter for later use ''' + global compiled_example + global examples_success + global examples_failed + compiled_example = compiled + examples_success = success + examples_failed = failed + + +# Example compilation task +OKGREEN = '\r\033[92m' +FAIL = '\r\033[91m' +ENDC = '\033[0m' + + +def compile_example(cmd, target, example, clean): + global compiled_example + if clean: + subprocess.call(cmd + " --target clean", shell=True, + stdout=open(os.devnull, 'wb'), stderr=open(os.devnull, 'wb')) + print("done") + if subprocess.call(cmd, shell=True, stdout=open(os.devnull, 'wb'), stderr=open(os.devnull, 'wb')): + with compiled_example.get_lock(): + compiled_example.value += 1 + value = FAIL+"FAILED " + str(join(target, example) + ENDC) + print(value, flush=True) + with examples_failed.get_lock(): + examples_failed.value += 1 + else: + with compiled_example.get_lock(): + compiled_example.value += 1 + value = OKGREEN + "SUCCESS " + \ + str(join(target, example)) + ENDC + print(value, flush=True) + with examples_success.get_lock(): + examples_success.value += 1 + return True + + +if __name__ == '__main__': + + ## Parse arguments ## + parser = argparse.ArgumentParser(description='A command to build them all as fast as possible!\n', + formatter_class=argparse.RawTextHelpFormatter) + + # General arguments + parser.add_argument("--clean", action="store_true", + help="Clean all examples before building them") + args = parser.parse_args() + + start = time.time() + # Create all example compilation tasks + compiled_example = mp.Value('i', 0) + examples_success = mp.Value('i', 0) + examples_failed = mp.Value('i', 0) + pool = mp.Pool(nb_example, initializer=init, initargs=(compiled_example, + examples_success, + examples_failed,)) + click.secho( + "\nbuild result Project name\n------------ ------------") + for target in os.listdir(exampledir): + examples_path = join(realpath(exampledir), target) + if os.path.isdir(examples_path): + for example in os.listdir(os.path.join(exampledir, target)): + example_path = join(exampledir, target, example) + cmd = "platformio run -d " + example_path + if (exists(join(example_path, "platformio.ini"))): + pool.apply_async( + compile_example, args=(cmd, target, example, args.clean)) + + pool.close() + while compiled_example.value < nb_example: + # Print a nice loading bar + chars = "/—\|" + for char in chars: + sys.stdout.write( + '\r'+'Building ' + char + ' (' + str(compiled_example.value) + "/" + str(nb_example) + ")") + time.sleep(.1) + sys.stdout.flush() + + pool.join() + print("\r--------------------------------------------\nBuild summary\n--------------------------------------------") + print("\t- Success\t\t\t" + str(examples_success.value) + "/" + str(nb_example)) + print("\t- Failed\t\t\t" + str(examples_failed.value) + "/" + str(nb_example)) + print("\t- Total compilation time\t" + str(time.time() - start) + "s") From f44d0bc79822b9c9fa4260418c189ad390c5bbbe Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 31 Mar 2023 12:01:07 +0200 Subject: [PATCH 019/150] Make inspector use local Pipe during compilation --- examples/projects/Arduino/inspector_serialcom/platformio.ini | 1 + .../projects/NUCLEO-F072RB/inspector_serialcom/platformio.ini | 1 + .../projects/NUCLEO-F401RE/inspector_serialcom/platformio.ini | 1 + .../projects/NUCLEO-F410RB/inspector_serialcom/platformio.ini | 1 + .../projects/NUCLEO-G431KB/inspector_serialcom/platformio.ini | 1 + .../projects/NUCLEO-G474RE/inspector_serialcom/platformio.ini | 1 + .../projects/NUCLEO-L432KC/inspector_serialcom/platformio.ini | 1 + .../STM32F4-discovery/inspector_serialcom/platformio.ini | 1 + examples/projects/l0/inspector_serialcom/platformio.ini | 1 + 9 files changed, 9 insertions(+) diff --git a/examples/projects/Arduino/inspector_serialcom/platformio.ini b/examples/projects/Arduino/inspector_serialcom/platformio.ini index 582c60117..df7796fda 100644 --- a/examples/projects/Arduino/inspector_serialcom/platformio.ini +++ b/examples/projects/Arduino/inspector_serialcom/platformio.ini @@ -27,6 +27,7 @@ default_envs = zero [env] lib_extra_dirs = + $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ lib_ldf_mode =off platform = atmelsam diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-F072RB/inspector_serialcom/platformio.ini index 771c3d9e4..a9f2ccdc1 100644 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-F072RB/inspector_serialcom/platformio.ini @@ -14,6 +14,7 @@ default_envs = nucleo_f072rb [env] lib_ldf_mode =off lib_extra_dirs = + $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ platform = ststm32 board = nucleo_f072rb diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-F401RE/inspector_serialcom/platformio.ini index a398009b6..76b198b3c 100644 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-F401RE/inspector_serialcom/platformio.ini @@ -13,6 +13,7 @@ default_envs = nucleo_f401re [env] lib_ldf_mode =off lib_extra_dirs = + $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ platform = ststm32 board = nucleo_f401re diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-F410RB/inspector_serialcom/platformio.ini index 73da22e43..af9a65d6c 100644 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-F410RB/inspector_serialcom/platformio.ini @@ -13,6 +13,7 @@ default_envs = nucleo_f410rb [env] lib_ldf_mode =off lib_extra_dirs = + $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ platform = ststm32 board = nucleo_f410rb diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-G431KB/inspector_serialcom/platformio.ini index e647a2e45..6db1297eb 100644 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-G431KB/inspector_serialcom/platformio.ini @@ -13,6 +13,7 @@ default_envs = nucleo_g431kb [env] lib_ldf_mode =off lib_extra_dirs = + $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ platform = ststm32 board = nucleo_g431kb diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-G474RE/inspector_serialcom/platformio.ini index 653ea9b7b..df83df4c6 100644 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-G474RE/inspector_serialcom/platformio.ini @@ -13,6 +13,7 @@ default_envs = nucleo_g474re [env] lib_ldf_mode =off lib_extra_dirs = + $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ platform = ststm32 board = nucleo_g474re diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-L432KC/inspector_serialcom/platformio.ini index 6f6f5d923..3e89293a8 100644 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-L432KC/inspector_serialcom/platformio.ini @@ -13,6 +13,7 @@ default_envs = nucleo_l432kc [env] lib_ldf_mode =off lib_extra_dirs = + $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ platform = ststm32 board = nucleo_l432kc diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/platformio.ini b/examples/projects/STM32F4-discovery/inspector_serialcom/platformio.ini index 10c65087b..311d7613c 100644 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/platformio.ini +++ b/examples/projects/STM32F4-discovery/inspector_serialcom/platformio.ini @@ -26,6 +26,7 @@ build_flags = -DUSE_FULL_LL_DRIVER -DLUOSHAL=STM32F4 lib_extra_dirs = + $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ lib_deps = luos_engine@^3.0.0 diff --git a/examples/projects/l0/inspector_serialcom/platformio.ini b/examples/projects/l0/inspector_serialcom/platformio.ini index ace691e37..a7deab40d 100644 --- a/examples/projects/l0/inspector_serialcom/platformio.ini +++ b/examples/projects/l0/inspector_serialcom/platformio.ini @@ -13,6 +13,7 @@ default_envs = l0 [env] lib_ldf_mode =off lib_extra_dirs = + $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ platform = ststm32 board = l0 From b45d472003da5921b3538036e5a0de1e114effbe Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 31 Mar 2023 17:40:23 +0200 Subject: [PATCH 020/150] Remove filters disableabilty and verbose mode. We will have to completely redesign them and they represent complexity when it come to move things. --- engine/IO/src/msg_alloc.c | 5 --- engine/core/src/node.c | 6 ++- network/robus/inc/context.h | 5 +-- network/robus/inc/robus.h | 2 - network/robus/src/reception.c | 85 ++--------------------------------- network/robus/src/robus.c | 24 +--------- 6 files changed, 10 insertions(+), 117 deletions(-) diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index f7bcd57eb..6dab31109 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -166,11 +166,6 @@ void MsgAlloc_Init(memory_stats_t *memory_stats) mem_stat = memory_stats; } Robus_MaskInit(); // Mask filter for service ID - // Filter State - ctx.filter_id = 0; - ctx.filter_state = true; - // Verbose - ctx.verbose = LOCALHOST; // Reset have been made reset_needed = false; } diff --git a/engine/core/src/node.c b/engine/core/src/node.c index 0525c8459..e031b575f 100644 --- a/engine/core/src/node.c +++ b/engine/core/src/node.c @@ -140,7 +140,8 @@ bool Luos_IsDetected(void) ******************************************************************************/ void Luos_SetFilterState(uint8_t state, service_t *service) { - Robus_SetFilterState(state, service->ll_service); + // Enable or disable the filter for a given service + // This function have been disabled since 3.0.0 } /****************************************************************************** @@ -150,5 +151,6 @@ void Luos_SetFilterState(uint8_t state, service_t *service) ******************************************************************************/ void Luos_SetVerboseMode(uint8_t mode) { - Robus_SetVerboseMode(mode); + // Enable or disable the verbose mode + // This function have been disabled since 3.0.0 } \ No newline at end of file diff --git a/network/robus/inc/context.h b/network/robus/inc/context.h index fd2cb968a..0cf06303f 100644 --- a/network/robus/inc/context.h +++ b/network/robus/inc/context.h @@ -27,12 +27,9 @@ typedef struct // Low level service management ll_service_t ll_service_table[MAX_SERVICE_NUMBER]; /*!< Low level Service table. */ uint16_t ll_service_number; /*!< Low level Service number. */ + uint8_t IDMask[ID_MASK_SIZE]; uint16_t IDShiftMask; - - uint8_t filter_state; - uint16_t filter_id; - uint8_t verbose; uint8_t TopicMask[TOPIC_MASK_SIZE]; /*!< multicast target bank. */ } context_t; diff --git a/network/robus/inc/robus.h b/network/robus/inc/robus.h index f86316ebc..7b11fbcda 100644 --- a/network/robus/inc/robus.h +++ b/network/robus/inc/robus.h @@ -25,8 +25,6 @@ error_return_t Robus_SetTxTask(ll_service_t *ll_service, msg_t *msg); error_return_t Robus_SendMsg(ll_service_t *ll_service, msg_t *msg); uint16_t Robus_TopologyDetection(ll_service_t *ll_service); void Robus_IDMaskCalculation(uint16_t service_id, uint16_t service_number); -void Robus_SetFilterState(uint8_t state, ll_service_t *service); -void Robus_SetVerboseMode(uint8_t mode); void Robus_MaskInit(void); #endif /* _ROBUS_H_ */ diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index 1b6511b65..239db4e3e 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -220,7 +220,6 @@ _CRITICAL void Recep_GetData(volatile uint8_t *data) MsgAlloc_Reset(); ctx.tx.status = TX_DISABLE; Node_SetState(EXTERNAL_DETECTION); - Robus_SetVerboseMode(false); PortMng_Init(); } else @@ -476,16 +475,7 @@ _CRITICAL luos_localhost_t Recep_NodeConcerned(header_t *header) // Check all ll_service id if (Recep_ServiceIDCompare(header->target) == SUCCEED) { - return ctx.verbose; - } - if (ctx.filter_state == false) - { - // check if it is message comes from service that demanded the filter desactivation - if (ctx.filter_id != header->source) - { - // if there is a service that deactivated the filtering occupy the message - return MULTIHOST; - } + return LOCALHOST; } break; case TYPE: @@ -497,15 +487,6 @@ _CRITICAL luos_localhost_t Recep_NodeConcerned(header_t *header) return MULTIHOST; } } - if (ctx.filter_state == false) - { - // check if it is message comes from service that demanded the filter desactivation - if (ctx.filter_id != header->source) - { - // if there is a service that deactivated the filtering occupy the message - return MULTIHOST; - } - } break; case BROADCAST: if (header->target == BROADCAST_VAL) @@ -518,27 +499,18 @@ _CRITICAL luos_localhost_t Recep_NodeConcerned(header_t *header) case NODEID: if ((header->target == 0) && (ctx.port.activ != NBR_PORT) && (ctx.port.keepLine == false)) { - return ctx.verbose; // discard message if ID = 0 and no Port activ + return LOCALHOST; // discard message if ID = 0 and no Port activ } else { if ((header->target == Node_Get()->node_id) && ((header->target != 0))) { - return ctx.verbose; - } - else if (ctx.filter_state == false) - { - // check if it is message comes from service that demanded the filter desactivation - if (ctx.filter_id != header->source) - { - // if there is a service that deactivated the filtering occupy the message - return MULTIHOST; - } + return LOCALHOST; } } break; case TOPIC: - if ((Recep_TopicCompare(header->target) == SUCCEED) || (ctx.filter_state == false)) + if (Recep_TopicCompare(header->target) == SUCCEED) { return MULTIHOST; } @@ -549,47 +521,6 @@ _CRITICAL luos_localhost_t Recep_NodeConcerned(header_t *header) } return EXTERNALHOST; } -/****************************************************************************** - * @brief Double Allocate msg_task in case of desactivated filter - * @param msg pointer - * @return None - ******************************************************************************/ -static inline void Recep_DoubleAlloc(msg_t *msg) -{ - // if there is a service that deactivated the filter we also allocate a message for it - if (ctx.filter_state == false) - { - // find the position of this service in the node - uint16_t idx = Recep_CtxIndexFromID(ctx.filter_id); - // check if it is message for the same service that demanded the filter desactivation - switch (msg->header.target_mode) - { - case (SERVICEID): - if (ctx.filter_id != msg->header.target) - { - // store the message if it is not so that we dont have double messages in memory - MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[idx], msg); - } - break; - case (TYPE): - if (ctx.ll_service_table[idx].type != msg->header.target) - { - // store the message if it is not so that we dont have double messages in memory - MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[idx], msg); - } - break; - case (TOPIC): - if (PubSub_IsTopicSubscribed((ll_service_t *)&ctx.ll_service_table[idx], msg->header.target) == false) - { - // store the message if it is not so that we dont have double messages in memory - MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[idx], msg); - } - break; - default: - break; - } - } -} /****************************************************************************** * @brief Parse msg to find all services concerned and create * @param msg pointer @@ -613,8 +544,6 @@ void Recep_InterpretMsgProtocol(msg_t *msg) break; } } - // check if we need to double allocate msg_task - Recep_DoubleAlloc(msg); return; break; case TYPE: @@ -626,8 +555,6 @@ void Recep_InterpretMsgProtocol(msg_t *msg) MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg); } } - // check if we need to double allocate msg_task - Recep_DoubleAlloc(msg); return; break; case BROADCAST: @@ -646,8 +573,6 @@ void Recep_InterpretMsgProtocol(msg_t *msg) MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg); } } - // check if we need to double allocate msg_task - Recep_DoubleAlloc(msg); return; break; case NODEIDACK: @@ -665,8 +590,6 @@ void Recep_InterpretMsgProtocol(msg_t *msg) MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg); } } - // check if we need to double allocate msg_task - Recep_DoubleAlloc(msg); return; break; default: diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index e7c3b07d6..7ff1ea9c7 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -211,7 +211,7 @@ error_return_t Robus_SetTxTask(ll_service_t *ll_service, msg_t *msg) // Check the localhost situation luos_localhost_t localhost = Recep_NodeConcerned(&msg->header); // Check if ACK needed - if (((msg->header.target_mode == SERVICEIDACK) || (msg->header.target_mode == NODEIDACK)) && ((localhost && (msg->header.target != DEFAULTID)) || (ctx.verbose == MULTIHOST))) + if (((msg->header.target_mode == SERVICEIDACK) || (msg->header.target_mode == NODEIDACK)) && ((localhost && (msg->header.target != DEFAULTID)))) { // This is a localhost message and we need to transmit a ack. Add it at the end of the data to transmit ack = ctx.rx.status.unmap; @@ -502,25 +502,3 @@ void Robus_IDMaskCalculation(uint16_t service_id, uint16_t service_number) ctx.IDMask[tempo / 8] |= 1 << ((tempo) % 8); } } - -/****************************************************************************** - * @brief Function that changes the filter value - * @param uint8_t value, 1 if we want to disable, 0 to enable - * @return None - ******************************************************************************/ -void Robus_SetFilterState(uint8_t state, ll_service_t *service) -{ - ctx.filter_state = state; - ctx.filter_id = service->id; -} -/****************************************************************************** - * @brief Set verbose mode - * @param mode true or false - * @return None - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL void Robus_SetVerboseMode(uint8_t mode) -{ - // verbose is localhost or multihost - ctx.verbose = mode + 1; -} From 938eb48df1442eee5f6f500553c9216ecd58f75f Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 31 Mar 2023 17:53:37 +0200 Subject: [PATCH 021/150] Group all filter functions in a filter file --- engine/IO/inc/filter.h | 11 +- engine/IO/src/filter.c | 131 +++++++++++++++++++++- engine/IO/src/msg_alloc.c | 3 +- engine/core/src/luos_engine.c | 9 +- engine/core/src/pub_sub.c | 9 +- network/robus/inc/context.h | 4 - network/robus/inc/robus.h | 2 - network/robus/src/reception.c | 56 +--------- network/robus/src/robus.c | 49 +------- test/test_robus/main.c | 205 +++++++++++++++++++--------------- 10 files changed, 269 insertions(+), 210 deletions(-) diff --git a/engine/IO/inc/filter.h b/engine/IO/inc/filter.h index f08a36caf..272dbe0a6 100644 --- a/engine/IO/inc/filter.h +++ b/engine/IO/inc/filter.h @@ -7,6 +7,8 @@ #ifndef _FILTER_H_ #define _FILTER_H_ +#include "io_struct.h" +#include /******************************************************************************* * Definitions @@ -21,7 +23,12 @@ ******************************************************************************/ // generic functions -void Filter_Init(void); - +void Filter_IdInit(void); +void Filter_TopicInit(void); +void Filter_AddServiceId(uint16_t service_id, uint16_t service_number); +void Filter_AddTopic(uint16_t topic_id); +void Filter_RmTopic(uint16_t topic_id); +bool Filter_ServiceID(uint16_t service_id); +bool Filter_Topic(uint16_t topic_id); #endif /* _FILTER_H_ */ diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c index 81bca316d..b028e1882 100644 --- a/engine/IO/src/filter.c +++ b/engine/IO/src/filter.c @@ -5,28 +5,149 @@ * @version 0.0.0 ******************************************************************************/ -#include - +#include "filter.h" +#include "luos_utils.h" +#include "luos_hal.h" /******************************************************************************* * Definitions ******************************************************************************/ +typedef struct +{ + uint8_t IDMask[ID_MASK_SIZE]; + uint16_t IDShiftMask; + uint8_t TopicMask[TOPIC_MASK_SIZE]; /*!< multicast target bank. */ +} filter_ctx_t; /******************************************************************************* * Variables ******************************************************************************/ +filter_ctx_t filter_ctx; /******************************************************************************* * Functions ******************************************************************************/ - /****************************************************************************** - * @brief Init the interface file. + * @brief Reset Masks * @param None * @return None ******************************************************************************/ -void Filter_Init(void) +void Filter_IdInit(void) +{ + // Id mask init + filter_ctx.IDShiftMask = 0; + for (uint16_t i = 0; i < ID_MASK_SIZE; i++) + { + filter_ctx.IDMask[i] = 0; + } +} + +void Filter_TopicInit(void) +{ + // Multicast mask init + for (uint16_t i = 0; i < TOPIC_MASK_SIZE; i++) + { + filter_ctx.TopicMask[i] = 0; + } +} + +/****************************************************************************** + * @brief ID Mask calculation + * @param service_id ID of the first service + * @param service_number Number of the services on the node + * @return None + ******************************************************************************/ +void Filter_AddServiceId(uint16_t service_id, uint16_t service_number) +{ + // 4096 bit address 512 byte possible + // Create a mask of only possibility in the node + //--------------------------->|__________| + // Shift byte byte Mask of bit address + + LUOS_ASSERT(service_id > 0); + LUOS_ASSERT(service_id <= 4096 - MAX_SERVICE_NUMBER); + Filter_IdInit(); + uint16_t tempo = 0; + filter_ctx.IDShiftMask = (service_id - 1) / 8; // aligned to byte + + // Create a mask of bit corresponding to ID number in the node + for (uint16_t i = 0; i < service_number; i++) + { + tempo = (((service_id - 1) + i) - (8 * filter_ctx.IDShiftMask)); + filter_ctx.IDMask[tempo / 8] |= 1 << ((tempo) % 8); + } +} + +/****************************************************************************** + * @brief Add a Topic on the Mask + * @param topic_id + * @return None + ******************************************************************************/ +void Filter_AddTopic(uint16_t topic_id) { + // Add 1 to the bit corresponding to the topic in multicast mask + filter_ctx.TopicMask[(topic_id / 8)] |= 1 << (topic_id - ((int)(topic_id / 8)) * 8); +} +/****************************************************************************** + * @brief Remove a Topic on the Mask + * @param topic_id + * @return None + ******************************************************************************/ +void Filter_RmTopic(uint16_t topic_id) +{ + // Remove 1 to the bit corresponding to the topic in multicast mask + filter_ctx.TopicMask[(topic_id / 8)] &= ~(1 << (topic_id - ((int)(topic_id / 8)) * 8)); } + +/****************************************************************************** + * @brief Parse msg to find a service concerne + * @param header of message + * @return None + * _CRITICAL function call in IRQ + ******************************************************************************/ +_CRITICAL bool Filter_ServiceID(uint16_t service_id) +{ + //--------------------------->|__________| + // Shift byte byte Mask of bit address + // In an node, service ID are consecutive + // MaskID is byte field wich have the size of MAX_SERVICE_NUMBER + // Shift depend od ID of first service in Node (shift = NodeID/8) + + uint16_t compare = 0; + + if ((service_id > (8 * filter_ctx.IDShiftMask))) // IDMask aligned byte + { + // Calcul ID mask for ID receive + compare = ((service_id - 1) - ((8 * filter_ctx.IDShiftMask))); + // Check if compare and internal mask match + if ((filter_ctx.IDMask[compare / 8] & (1 << (compare % 8))) != 0) + { + return true; + } + } + return false; +} + +/****************************************************************************** + * @brief Parse multicast mask to find if target exists + * @param target of message + * @return None + * _CRITICAL function call in IRQ + ******************************************************************************/ +_CRITICAL bool Filter_Topic(uint16_t topic_id) +{ + uint8_t compare = 0; + // Make sure there is a topic that can be received by the node + if (topic_id <= LAST_TOPIC) + { + compare = topic_id - ((topic_id / 8) * 8); + // Search if topic exists in mask + if ((filter_ctx.TopicMask[(topic_id / 8)] & (1 << compare)) != 0) + { + return true; + } + } + return false; +} \ No newline at end of file diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 6dab31109..95c0f6b63 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -50,6 +50,7 @@ #include "luos_hal.h" #include "luos_utils.h" #include "node.h" +#include "filter.h" #include "context.h" @@ -165,7 +166,7 @@ void MsgAlloc_Init(memory_stats_t *memory_stats) { mem_stat = memory_stats; } - Robus_MaskInit(); // Mask filter for service ID + Filter_IdInit(); // Mask filter for service ID // Reset have been made reset_needed = false; } diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index adfe8f031..0376a5481 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -12,6 +12,7 @@ #include "luos_hal.h" #include "bootloader_core.h" #include "_timestamp.h" +#include "filter.h" /******************************************************************************* * Variables @@ -295,7 +296,7 @@ static error_return_t Luos_MsgHandler(service_t *service, msg_t *input) index++; } } - Robus_IDMaskCalculation(1, service_number); + Filter_AddServiceId(1, service_number); } else { @@ -304,7 +305,7 @@ static error_return_t Luos_MsgHandler(service_t *service, msg_t *input) { service_table[i].ll_service->id = base_id + i; } - Robus_IDMaskCalculation(base_id, service_number); + Filter_AddServiceId(base_id, service_number); } case 0: // send back a local routing table @@ -1012,11 +1013,11 @@ void Luos_Run(void) ******************************************************************************/ void Luos_SetID(service_t *service, uint16_t id) { - Robus_MaskInit(); + Filter_IdInit(); // set id service->ll_service->id = 1; // change filter mask - Robus_IDMaskCalculation(id, service_number); + Filter_AddServiceId(id, service_number); } /****************************************************************************** * @brief Demand a detection diff --git a/engine/core/src/pub_sub.c b/engine/core/src/pub_sub.c index b513bac49..c56639a08 100644 --- a/engine/core/src/pub_sub.c +++ b/engine/core/src/pub_sub.c @@ -8,6 +8,7 @@ #include "luos_engine.h" #include #include +#include "filter.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -48,8 +49,8 @@ error_return_t Luos_Subscribe(service_t *service, uint16_t topic) // Assert if we add a topic that is greater than the max topic value LUOS_ASSERT(topic <= LAST_TOPIC); - // Add 1 to the bit corresponding to the topic in multicast mask - ctx.TopicMask[(topic / 8)] |= 1 << (topic - ((int)(topic / 8)) * 8); + // Put this topic in the multicast bank + Filter_AddTopic(topic); // add multicast this topic to the service ll_service_t *ll_service = (ll_service_t *)&ctx.ll_service_table[0]; @@ -109,8 +110,8 @@ error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic) return err; } } - // calculate mask after topic deletion - ctx.TopicMask[(topic / 8)] -= 1 << (topic - ((int)(topic / 8)) * 8); + // Remove topic from multicast mask + Filter_RmTopic(topic); } return err; } \ No newline at end of file diff --git a/network/robus/inc/context.h b/network/robus/inc/context.h index 0cf06303f..baf07b5d7 100644 --- a/network/robus/inc/context.h +++ b/network/robus/inc/context.h @@ -28,10 +28,6 @@ typedef struct ll_service_t ll_service_table[MAX_SERVICE_NUMBER]; /*!< Low level Service table. */ uint16_t ll_service_number; /*!< Low level Service number. */ - uint8_t IDMask[ID_MASK_SIZE]; - uint16_t IDShiftMask; - uint8_t TopicMask[TOPIC_MASK_SIZE]; /*!< multicast target bank. */ - } context_t; /******************************************************************************* diff --git a/network/robus/inc/robus.h b/network/robus/inc/robus.h index 7b11fbcda..b20521033 100644 --- a/network/robus/inc/robus.h +++ b/network/robus/inc/robus.h @@ -24,7 +24,5 @@ void Robus_ServicesClear(void); error_return_t Robus_SetTxTask(ll_service_t *ll_service, msg_t *msg); error_return_t Robus_SendMsg(ll_service_t *ll_service, msg_t *msg); uint16_t Robus_TopologyDetection(ll_service_t *ll_service); -void Robus_IDMaskCalculation(uint16_t service_id, uint16_t service_number); -void Robus_MaskInit(void); #endif /* _ROBUS_H_ */ diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index 239db4e3e..1eb753dc3 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -53,6 +53,7 @@ #include "_timestamp.h" #include "robus.h" #include "bootloader_core.h" +#include "filter.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -404,55 +405,6 @@ ll_service_t *Recep_GetConcernedLLService(header_t *header) } return NULL; } -/****************************************************************************** - * @brief Parse msg to find a service concerne - * @param header of message - * @return None - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL static inline error_return_t Recep_ServiceIDCompare(uint16_t service_id) -{ - //--------------------------->|__________| - // Shift byte byte Mask of bit address - // In an node, service ID are consecutive - // MaskID is byte field wich have the size of MAX_SERVICE_NUMBER - // Shift depend od ID of first service in Node (shift = NodeID/8) - - uint16_t compare = 0; - - if ((service_id > (8 * ctx.IDShiftMask))) // IDMask aligned byte - { - // Calcul ID mask for ID receive - compare = ((service_id - 1) - ((8 * ctx.IDShiftMask))); - // check if compare and internal mask match - if ((ctx.IDMask[compare / 8] & (1 << (compare % 8))) != 0) - { - return SUCCEED; - } - } - return FAILED; -} -/****************************************************************************** - * @brief Parse multicast mask to find if target exists - * @param target of message - * @return None - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL static inline error_return_t Recep_TopicCompare(uint16_t topic_id) -{ - uint8_t compare = 0; - // make sure there is a topic that can be received by the node - if (topic_id <= LAST_TOPIC) - { - compare = topic_id - ((topic_id / 8) * 8); - // search if topic exists in mask - if ((ctx.TopicMask[(topic_id / 8)] & (1 << compare)) != 0) - { - return SUCCEED; - } - } - return FAILED; -} /****************************************************************************** * @brief Parse msg to find a service concerne * @param header of message @@ -473,7 +425,7 @@ _CRITICAL luos_localhost_t Recep_NodeConcerned(header_t *header) ctx.rx.status.rx_error = false; case SERVICEID: // Check all ll_service id - if (Recep_ServiceIDCompare(header->target) == SUCCEED) + if (Filter_ServiceID(header->target)) { return LOCALHOST; } @@ -510,7 +462,7 @@ _CRITICAL luos_localhost_t Recep_NodeConcerned(header_t *header) } break; case TOPIC: - if (Recep_TopicCompare(header->target) == SUCCEED) + if (Filter_Topic(header->target)) { return MULTIHOST; } @@ -605,7 +557,7 @@ void Recep_InterpretMsgProtocol(msg_t *msg) _CRITICAL static inline uint8_t Recep_IsAckNeeded(void) { // check the mode of the message received - if ((current_msg->header.target_mode == SERVICEIDACK) && (Recep_ServiceIDCompare(current_msg->header.target) == SUCCEED)) + if ((current_msg->header.target_mode == SERVICEIDACK) && (Filter_ServiceID(current_msg->header.target))) { // when it is a serviceidack and this message is destined to the node send an ack return 1; diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index 7ff1ea9c7..0df3533e3 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -17,6 +17,7 @@ #include "msg_alloc.h" #include "luos_utils.h" #include "luos_engine.h" +#include "filter.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -67,14 +68,9 @@ void Robus_Init(memory_stats_t *memory_stats) ctx.tx.status = TX_DISABLE; // Save luos baudrate baudrate = DEFAULTBAUDRATE; - // mask - Robus_MaskInit(); - - // multicast mask init - for (uint16_t i = 0; i < TOPIC_MASK_SIZE; i++) - { - ctx.TopicMask[i] = 0; - } + // Filters init + Filter_IdInit(); + Filter_TopicInit(); // Init reception Recep_Init(); @@ -94,19 +90,6 @@ void Robus_Init(memory_stats_t *memory_stats) Node_SetState(NO_DETECTION); } -/****************************************************************************** - * @brief Reset Masks - * @param None - * @return None - ******************************************************************************/ -void Robus_MaskInit(void) -{ - ctx.IDShiftMask = 0; - for (uint16_t i = 0; i < ID_MASK_SIZE; i++) - { - ctx.IDMask[i] = 0; - } -} /****************************************************************************** * @brief Loop of the Robus communication protocole * @param None @@ -478,27 +461,3 @@ static error_return_t Robus_MsgHandler(msg_t *input) } return FAILED; } -/****************************************************************************** - * @brief ID Mask calculation - * @param ID and Number of service - * @return None - ******************************************************************************/ -void Robus_IDMaskCalculation(uint16_t service_id, uint16_t service_number) -{ - // 4096 bit address 512 byte possible - // Create a mask of only possibility in the node - //--------------------------->|__________| - // Shift byte byte Mask of bit address - - LUOS_ASSERT(service_id > 0); - LUOS_ASSERT(service_id <= 4096 - MAX_SERVICE_NUMBER); - uint16_t tempo = 0; - ctx.IDShiftMask = (service_id - 1) / 8; // aligned to byte - - // create a mask of bit corresponding to ID number in the node - for (uint16_t i = 0; i < service_number; i++) - { - tempo = (((service_id - 1) + i) - (8 * ctx.IDShiftMask)); - ctx.IDMask[tempo / 8] |= 1 << ((tempo) % 8); - } -} diff --git a/test/test_robus/main.c b/test/test_robus/main.c index df6dc34bc..b91a70851 100644 --- a/test/test_robus/main.c +++ b/test/test_robus/main.c @@ -3,60 +3,46 @@ #include "robus.h" #include "context.h" #include "unit_test.h" -#include +#include "default_scenario.h" +#include "filter.h" extern default_scenario_t default_sc; -void unittest_Robus_IDMaskCalculation() +void unittest_Filter_AddServiceId() { - NEW_TEST_CASE("ID shift mask test"); + NEW_TEST_CASE("Service ID mask test"); { - Robus_MaskInit(); + Filter_IdInit(); - Robus_IDMaskCalculation(7, SERVICE_NUMBER); - TEST_ASSERT_EQUAL(0, ctx.IDShiftMask); + Filter_AddServiceId(7, SERVICE_NUMBER); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(7)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(7 + SERVICE_NUMBER - 1)); - Robus_IDMaskCalculation(8, SERVICE_NUMBER); - TEST_ASSERT_EQUAL(0, ctx.IDShiftMask); + Filter_AddServiceId(8, SERVICE_NUMBER); + TEST_ASSERT_EQUAL(false, Filter_ServiceID(7)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(8)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(8 + SERVICE_NUMBER - 1)); - Robus_IDMaskCalculation(9, SERVICE_NUMBER); - TEST_ASSERT_EQUAL(1, ctx.IDShiftMask); - } - - NEW_TEST_CASE("ID mask test"); - { - Robus_MaskInit(); - Robus_IDMaskCalculation(7, SERVICE_NUMBER); - TEST_ASSERT_EQUAL(0xC0, ctx.IDMask[0]); - TEST_ASSERT_EQUAL(0x07, ctx.IDMask[1]); - - Robus_MaskInit(); - Robus_IDMaskCalculation(8, SERVICE_NUMBER); - TEST_ASSERT_EQUAL(0, ctx.IDShiftMask); - TEST_ASSERT_EQUAL(0x80, ctx.IDMask[0]); - TEST_ASSERT_EQUAL(0x0F, ctx.IDMask[1]); - - Robus_MaskInit(); - Robus_IDMaskCalculation(9, SERVICE_NUMBER); - TEST_ASSERT_EQUAL(1, ctx.IDShiftMask); - TEST_ASSERT_EQUAL(0x1F, ctx.IDMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.IDMask[1]); + Filter_AddServiceId(9, SERVICE_NUMBER); + TEST_ASSERT_EQUAL(false, Filter_ServiceID(8)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(9)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(9 + SERVICE_NUMBER - 1)); } NEW_TEST_CASE("Limit 4096"); { - Robus_MaskInit(); - Robus_IDMaskCalculation(4096 - MAX_SERVICE_NUMBER, SERVICE_NUMBER); - TEST_ASSERT_EQUAL(508, ctx.IDShiftMask); + Filter_IdInit(); + Filter_AddServiceId(4096 - MAX_SERVICE_NUMBER, SERVICE_NUMBER); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(4096 - MAX_SERVICE_NUMBER)); } NEW_TEST_CASE("Limit 0"); { RESET_ASSERT(); - Robus_MaskInit(); + Filter_IdInit(); TRY { - Robus_IDMaskCalculation(0, SERVICE_NUMBER); + Filter_AddServiceId(0, SERVICE_NUMBER); } TEST_ASSERT_TRUE(IS_ASSERT()); RESET_ASSERT(); @@ -71,15 +57,25 @@ void unittest_Luos_Subscribe(void) Init_Context(); Luos_Subscribe(default_sc.App_1.app, 0); - TEST_ASSERT_EQUAL(0x01, ctx.TopicMask[0]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(6)); + TEST_ASSERT_EQUAL(false, Filter_Topic(18)); Luos_Subscribe(default_sc.App_1.app, 4); - TEST_ASSERT_EQUAL(0x11, ctx.TopicMask[0]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(6)); + TEST_ASSERT_EQUAL(false, Filter_Topic(18)); Luos_Subscribe(default_sc.App_1.app, 6); - TEST_ASSERT_EQUAL(0x51, ctx.TopicMask[0]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(false, Filter_Topic(18)); Luos_Subscribe(default_sc.App_1.app, 18); - TEST_ASSERT_EQUAL(0x51, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); } NEW_TEST_CASE("Assert when adding last topic"); { @@ -103,18 +99,24 @@ void unittest_Luos_Subscribe(void) Init_Context(); Luos_Subscribe(default_sc.App_1.app, 0); - TEST_ASSERT_EQUAL(0x01, ctx.TopicMask[0]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); Luos_Subscribe(default_sc.App_2.app, 0); - TEST_ASSERT_EQUAL(0x01, ctx.TopicMask[0]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); Luos_Subscribe(default_sc.App_3.app, 0); - TEST_ASSERT_EQUAL(0x01, ctx.TopicMask[0]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); Luos_Subscribe(default_sc.App_1.app, 4); - TEST_ASSERT_EQUAL(0x11, ctx.TopicMask[0]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); Luos_Subscribe(default_sc.App_2.app, 4); - TEST_ASSERT_EQUAL(0x11, ctx.TopicMask[0]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); Luos_Subscribe(default_sc.App_3.app, 4); - TEST_ASSERT_EQUAL(0x11, ctx.TopicMask[0]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); } } @@ -137,37 +139,43 @@ void unittest_Robus_TopicUnsubscribe(void) Luos_Subscribe(default_sc.App_1.app, 4); Luos_Subscribe(default_sc.App_1.app, 6); Luos_Subscribe(default_sc.App_1.app, 18); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); - TEST_ASSERT_EQUAL(0x51, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); Luos_Unsubscribe(default_sc.App_1.app, 4); - TEST_ASSERT_EQUAL(0x41, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + Luos_Unsubscribe(default_sc.App_1.app, 0); - TEST_ASSERT_EQUAL(0x40, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(false, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + Luos_Unsubscribe(default_sc.App_1.app, 6); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(false, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + Luos_Unsubscribe(default_sc.App_1.app, 18); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(false, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(6)); + TEST_ASSERT_EQUAL(false, Filter_Topic(18)); } NEW_TEST_CASE("Demand to remove last topic"); { // Init default scenario context Init_Context(); Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC - 1); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x08, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); Luos_Unsubscribe(default_sc.App_1.app, LAST_TOPIC - 1); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC - 1)); error_return_t err = Luos_Unsubscribe(default_sc.App_1.app, LAST_TOPIC); TEST_ASSERT_EQUAL(err, FAILED); } @@ -184,37 +192,52 @@ void unittest_Robus_TopicUnsubscribe(void) Luos_Subscribe(default_sc.App_1.app, 18); Luos_Subscribe(default_sc.App_2.app, 18); - TEST_ASSERT_EQUAL(0x51, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + Luos_Unsubscribe(default_sc.App_1.app, 4); - TEST_ASSERT_EQUAL(0x51, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + Luos_Unsubscribe(default_sc.App_2.app, 4); - TEST_ASSERT_EQUAL(0x51, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + Luos_Unsubscribe(default_sc.App_3.app, 4); - TEST_ASSERT_EQUAL(0x41, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + Luos_Unsubscribe(default_sc.App_2.app, 6); - TEST_ASSERT_EQUAL(0x41, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + Luos_Unsubscribe(default_sc.App_3.app, 6); - TEST_ASSERT_EQUAL(0x01, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + Luos_Unsubscribe(default_sc.App_1.app, 18); - TEST_ASSERT_EQUAL(0x01, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x04, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + Luos_Unsubscribe(default_sc.App_2.app, 18); - TEST_ASSERT_EQUAL(0x01, ctx.TopicMask[0]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[1]); - TEST_ASSERT_EQUAL(0x00, ctx.TopicMask[2]); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(6)); + TEST_ASSERT_EQUAL(false, Filter_Topic(18)); } } @@ -223,7 +246,7 @@ int main(int argc, char **argv) UNITY_BEGIN(); // Big data reception - UNIT_TEST_RUN(unittest_Robus_IDMaskCalculation); + UNIT_TEST_RUN(unittest_Filter_AddServiceId); UNIT_TEST_RUN(unittest_Luos_Subscribe); UNIT_TEST_RUN(unittest_Robus_TopicUnsubscribe); From 9d6e04fa86ad5527ba83abd43d7eb42241927233 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 3 Apr 2023 13:58:51 +0200 Subject: [PATCH 022/150] Remove all context usage on msg_alloc --- engine/IO/src/msg_alloc.c | 7 ------- engine/core/src/luos_engine.c | 7 +++++++ network/robus/src/robus.c | 12 ++++++++++++ platformio.ini | 6 ++---- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 95c0f6b63..248b22fc1 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -52,8 +52,6 @@ #include "node.h" #include "filter.h" -#include "context.h" - /******************************************************************************* * Definitions ******************************************************************************/ @@ -145,11 +143,6 @@ _CRITICAL static inline void MsgAlloc_FindNewOldestMsg(void); void MsgAlloc_Init(memory_stats_t *memory_stats) { //******** Init global vars pointers ********** - // Reinit ll_service id - for (uint8_t i = 0; i < ctx.ll_service_number; i++) - { - ctx.ll_service_table[i].id = DEFAULTID; - } current_msg = (msg_t *)&msg_buffer[0]; data_ptr = (uint8_t *)&msg_buffer[0]; data_end_estimation = (uint8_t *)¤t_msg->data[CRC_SIZE]; diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 0376a5481..d9af57414 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -13,6 +13,7 @@ #include "bootloader_core.h" #include "_timestamp.h" #include "filter.h" +#include "context.h" /******************************************************************************* * Variables @@ -96,6 +97,12 @@ void Luos_Loop(void) if (MsgAlloc_IsReseted() == SUCCEED) { // We receive a reset detection + // Reset services ID + // Reinit ll_service id + for (uint8_t i = 0; i < ctx.ll_service_number; i++) + { + ctx.ll_service_table[i].id = DEFAULTID; + } // Reset the data reception context Luos_ReceiveData(NULL, NULL, NULL); } diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index 0df3533e3..9827a21c9 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -316,6 +316,13 @@ static error_return_t Robus_ResetNetworkDetection(ll_service_t *ll_service) while (MsgAlloc_TxAllComplete() != SUCCEED) ; + // Reinit ll_service id + for (uint8_t i = 0; i < ctx.ll_service_number; i++) + { + ctx.ll_service_table[i].id = DEFAULTID; + } + + // Reinit msg alloc MsgAlloc_Init(NULL); // wait for some 2ms to be sure all previous messages are received and treated @@ -434,6 +441,11 @@ static error_return_t Robus_MsgHandler(msg_t *input) if (Node_Get()->node_id != 0) { Node_Get()->node_id = 0; + // Reinit ll_service id + for (uint8_t i = 0; i < ctx.ll_service_number; i++) + { + ctx.ll_service_table[i].id = DEFAULTID; + } MsgAlloc_Init(NULL); } // This is a node bootstrap information. diff --git a/platformio.ini b/platformio.ini index 38826d289..3a9d7b877 100644 --- a/platformio.ini +++ b/platformio.ini @@ -31,7 +31,5 @@ build_flags = build_type = debug test_build_src = true -; To debug a test : -; 1) Copy this file in Luos root directory -; 2) Replace "test_template" by the directory test name you want to debug (example : "routing_table") -;debug_test = test_template +; To debug a test, replace "test_template" by the directory test name you want to debug (example : "test_msg_alloc") +; debug_test = test_template From 7a41ddd608e7b9dd143386dd70d2187f1b1eadc1 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 4 Apr 2023 13:22:49 +0200 Subject: [PATCH 023/150] Create Service files --- engine/core/inc/service.h | 14 ++++++++++++++ engine/core/src/service.c | 7 +++++++ 2 files changed, 21 insertions(+) create mode 100644 engine/core/inc/service.h create mode 100644 engine/core/src/service.c diff --git a/engine/core/inc/service.h b/engine/core/inc/service.h new file mode 100644 index 000000000..ad101de28 --- /dev/null +++ b/engine/core/inc/service.h @@ -0,0 +1,14 @@ +/****************************************************************************** + * @file service.h + * @brief Service related functions + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _SERVICE_H_ +#define _SERVICE_H_ + +/******************************************************************************* + * Function + ******************************************************************************/ + +#endif /* _SERVICE_H_ */ diff --git a/engine/core/src/service.c b/engine/core/src/service.c new file mode 100644 index 000000000..b1e3dd515 --- /dev/null +++ b/engine/core/src/service.c @@ -0,0 +1,7 @@ +/****************************************************************************** + * @file Service + * @brief Service related functions + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#include "service.h" \ No newline at end of file From 49619b9d78dc047fdd7c6f38d1da0005e2c1903e Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 6 Apr 2023 12:27:30 +0200 Subject: [PATCH 024/150] Group all services function into service file. --- engine/core/inc/service.h | 11 +- engine/core/inc/service_structs.h | 1 - engine/core/src/luos_engine.c | 305 ++++-------------------------- engine/core/src/service.c | 297 ++++++++++++++++++++++++++++- 4 files changed, 338 insertions(+), 276 deletions(-) diff --git a/engine/core/inc/service.h b/engine/core/inc/service.h index ad101de28..f88580639 100644 --- a/engine/core/inc/service.h +++ b/engine/core/inc/service.h @@ -7,8 +7,17 @@ #ifndef _SERVICE_H_ #define _SERVICE_H_ +#include "service_structs.h" + /******************************************************************************* * Function ******************************************************************************/ - +void Service_Init(void); +service_t *Service_GetTable(void); +uint16_t Service_GetNumber(void); +void Service_ResetStatistics(void); +void Service_GenerateId(uint16_t base_id); +service_t *Service_GetService(ll_service_t *ll_service); +uint16_t Service_GetIndex(service_t *service); +void Service_AutoUpdateManager(void); #endif /* _SERVICE_H_ */ diff --git a/engine/core/inc/service_structs.h b/engine/core/inc/service_structs.h index 66c0efb90..a5ccc3c83 100644 --- a/engine/core/inc/service_structs.h +++ b/engine/core/inc/service_structs.h @@ -127,7 +127,6 @@ typedef struct __attribute__((__packed__)) service_t uint8_t alias[MAX_ALIAS_SIZE]; /*!< service alias. */ timed_update_t auto_refresh; /*!< service auto refresh context. */ revision_t revision; /*!< service firmware version. */ - luos_stats_t *node_statistics; /*!< Node level statistics. */ service_stats_t statistics; /*!< service level statistics. */ access_t access; /*!< service read write access. */ void *profile_context; /*!< Pointer to the profile context. */ diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index d9af57414..861c8ea11 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -14,6 +14,7 @@ #include "_timestamp.h" #include "filter.h" #include "context.h" +#include "service.h" /******************************************************************************* * Variables @@ -21,8 +22,6 @@ revision_t luos_version = {.major = 3, .minor = 0, .build = 0}; package_t package_table[MAX_SERVICE_NUMBER]; uint16_t package_number = 0; -service_t service_table[MAX_SERVICE_NUMBER]; -uint16_t service_number = 0; service_t *detection_service; uint8_t Flag_DetectServices = 0; @@ -33,11 +32,9 @@ general_stats_t general_stats; * Function ******************************************************************************/ static error_return_t Luos_MsgHandler(service_t *service, msg_t *input); -static service_t *Luos_GetService(ll_service_t *ll_service); -static uint16_t Luos_GetServiceIndex(service_t *service); static void Luos_TransmitLocalRoutingTable(service_t *service, msg_t *routeTB_msg); -static void Luos_AutoUpdateManager(void); static error_return_t Luos_IsALuosCmd(service_t *service, uint8_t cmd, uint16_t size); +static error_return_t Luos_Send(service_t *service, msg_t *msg); static inline void Luos_EmptyNode(void); static inline void Luos_PackageInit(void); static inline void Luos_PackageLoop(void); @@ -49,7 +46,7 @@ static inline void Luos_PackageLoop(void); ******************************************************************************/ void Luos_Init(void) { - service_number = 0; + Service_Init(); memset(&luos_stats.unmap[0], 0, sizeof(luos_stats_t)); LuosHAL_Init(); Robus_Init(&luos_stats.memory); @@ -112,7 +109,7 @@ void Luos_Loop(void) while (MsgAlloc_LookAtLuosTask(remaining_msg_number, &oldest_ll_service) != FAILED) { // There is a message available find the service linked to it - service_t *service = Luos_GetService(oldest_ll_service); + service_t *service = Service_GetService(oldest_ll_service); // check if this is a Luos Command uint8_t cmd = 0; uint16_t size = 0; @@ -172,7 +169,7 @@ void Luos_Loop(void) // finish msg used MsgAlloc_UsedMsgEnd(); // manage timed auto update - Luos_AutoUpdateManager(); + Service_AutoUpdateManager(); // save loop date last_loop_date = LuosHAL_GetSystick(); @@ -191,10 +188,7 @@ void Luos_Loop(void) void Luos_ResetStatistic(void) { memset(&luos_stats.unmap[0], 0, sizeof(luos_stats_t)); - for (uint16_t i = 0; i < service_number; i++) - { - service_table[i].statistics.max_retry = 0; - } + void Service_ResetStatistics(void); } /****************************************************************************** * @brief Check if this command concern luos @@ -290,30 +284,7 @@ static error_return_t Luos_MsgHandler(service_t *service, msg_t *input) // generate local ID RoutingTB_Erase(); memcpy(&base_id, &input->data[0], sizeof(uint16_t)); - if (base_id == 1) - { - // set service Id based on received data except for the detector one. - base_id = 2; - int index = 0; - for (uint16_t i = 0; i < service_number; i++) - { - if (service_table[i].ll_service->id != 1) - { - service_table[i].ll_service->id = base_id + index; - index++; - } - } - Filter_AddServiceId(1, service_number); - } - else - { - // set service Id based on received data - for (uint16_t i = 0; i < service_number; i++) - { - service_table[i].ll_service->id = base_id + i; - } - Filter_AddServiceId(base_id, service_number); - } + Service_GenerateId(base_id); case 0: // send back a local routing table output_msg.header.cmd = RTB; @@ -416,38 +387,6 @@ static error_return_t Luos_MsgHandler(service_t *service, msg_t *input) } return consume; } -/****************************************************************************** - * @brief Get pointer to a service in route table - * @param ll_service : low level service - * @return Service from list - ******************************************************************************/ -static service_t *Luos_GetService(ll_service_t *ll_service) -{ - for (uint16_t i = 0; i < service_number; i++) - { - if (ll_service == service_table[i].ll_service) - { - return &service_table[i]; - } - } - return 0; -} -/****************************************************************************** - * @brief Get this index of the service - * @param Service - * @return Service from list - ******************************************************************************/ -static uint16_t Luos_GetServiceIndex(service_t *service) -{ - for (uint16_t i = 0; i < service_number; i++) - { - if (service == &service_table[i]) - { - return i; - } - } - return 0xFFFF; -} /****************************************************************************** * @brief Transmit local RTB to network * @param service @@ -457,134 +396,19 @@ static uint16_t Luos_GetServiceIndex(service_t *service) static void Luos_TransmitLocalRoutingTable(service_t *service, msg_t *routeTB_msg) { uint16_t entry_nb = 0; - routing_table_t local_routing_table[service_number + 1]; + routing_table_t local_routing_table[Service_GetNumber() + 1]; // start by saving node entry RoutingTB_ConvertNodeToRoutingTable(&local_routing_table[entry_nb], Node_Get()); entry_nb++; // save services entry - for (uint16_t i = 0; i < service_number; i++) + for (uint16_t i = 0; i < Service_GetNumber(); i++) { - RoutingTB_ConvertServiceToRoutingTable((routing_table_t *)&local_routing_table[entry_nb++], &service_table[i]); + RoutingTB_ConvertServiceToRoutingTable((routing_table_t *)&local_routing_table[entry_nb++], &Service_GetTable()[i]); } Luos_SendData(service, routeTB_msg, (void *)local_routing_table, (entry_nb * sizeof(routing_table_t))); } -/****************************************************************************** - * @brief Auto update publication for service - * @param none - * @return none - ******************************************************************************/ -static void Luos_AutoUpdateManager(void) -{ - // check all services timed_update_t contexts - for (uint16_t i = 0; i < service_number; i++) - { - // check if services have an actual ID. If not, we are in detection mode and should reset the auto refresh - if (service_table[i].ll_service->id == DEFAULTID) - { - // this service have not been detected or is in detection mode. remove auto_refresh parameters - service_table[i].auto_refresh.target = 0; - service_table[i].auto_refresh.time_ms = 0; - service_table[i].auto_refresh.last_update = 0; - } - else - { - // check if there is a timed update setted and if it's time to update it. - if (service_table[i].auto_refresh.time_ms) - { - if (service_table[i].ll_service->dead_service_spotted == service_table[i].auto_refresh.target) - { - service_table[i].auto_refresh.target = 0; - service_table[i].auto_refresh.time_ms = 0; - service_table[i].auto_refresh.last_update = 0; - continue; - } - if ((LuosHAL_GetSystick() - service_table[i].auto_refresh.last_update) >= service_table[i].auto_refresh.time_ms) - { - // This service need to send an update - // Create a fake message for it from the service asking for update - msg_t updt_msg; - updt_msg.header.config = BASE_PROTOCOL; - updt_msg.header.target = service_table[i].ll_service->id; - updt_msg.header.source = service_table[i].auto_refresh.target; - updt_msg.header.target_mode = SERVICEIDACK; - updt_msg.header.cmd = GET_CMD; - updt_msg.header.size = 0; - if ((service_table[i].service_cb != 0)) - { - service_table[i].service_cb(&service_table[i], &updt_msg); - } - else - { - if (Node_GetState() == DETECTION_OK) - { - // directly transmit the message in Localhost - Robus_SetTxTask(service_table[i].ll_service, &updt_msg); - } - } - service_table[i].auto_refresh.last_update = LuosHAL_GetSystick(); - } - } - } - } -} -/****************************************************************************** - * @brief Clear list of service - * @param none - * @return none - ******************************************************************************/ -void Luos_ServicesClear(void) -{ - service_number = 0; - Robus_ServicesClear(); -} -/****************************************************************************** - * @brief API to Create a service - * @param service_cb : Callback msg handler for the service - * @param type of service corresponding to object dictionnary - * @param alias for the service string (15 caracters max). - * @param version FW for the service (tab[MajorVersion,MinorVersion,Patch]) - * @return Service object pointer. - ******************************************************************************/ -service_t *Luos_CreateService(SERVICE_CB service_cb, uint8_t type, const char *alias, revision_t revision) -{ - uint8_t i = 0; - service_t *service = &service_table[service_number]; - service->ll_service = Robus_ServiceCreate(type); - - // Link the service to his callback - service->service_cb = service_cb; - // Initialise the service aliases to 0 - memset((void *)service->default_alias, 0, MAX_ALIAS_SIZE); - memset((void *)service->alias, 0, MAX_ALIAS_SIZE); - // Save aliases - for (i = 0; i < MAX_ALIAS_SIZE - 1; i++) - { - service->default_alias[i] = alias[i]; - service->alias[i] = alias[i]; - if (service->default_alias[i] == '\0') - break; - } - service->default_alias[i] = '\0'; - service->alias[i] = '\0'; - - // Initialise the service revision to 0 - memset((void *)service->revision.unmap, 0, sizeof(revision_t)); - // Save firmware version - for (i = 0; i < sizeof(revision_t); i++) - { - service->revision.unmap[i] = revision.unmap[i]; - } - - // initiate service statistics - service->node_statistics = &luos_stats; - service->ll_service->ll_stat.max_retry = &service->statistics.max_retry; - - service_number++; - LUOS_ASSERT(service_number <= MAX_SERVICE_NUMBER); - return service; -} /****************************************************************************** * @brief Send msg through network * @param Service : Who send @@ -595,19 +419,7 @@ error_return_t Luos_SendMsg(service_t *service, msg_t *msg) { // set protocol version msg->header.config = BASE_PROTOCOL; - - if (service == 0) - { - // There is no service specified here, take the first one - service = &service_table[0]; - } - if ((service->ll_service->id == 0) && (msg->header.cmd >= LUOS_LAST_RESERVED_CMD)) - { - // We are in detection mode and this command come from user - // We can't send it - return PROHIBITED; - } - return Robus_SendMsg(service->ll_service, msg); + return Luos_Send(service, msg); } /****************************************************************************** @@ -621,10 +433,22 @@ error_return_t Luos_SendTimestampMsg(service_t *service, msg_t *msg, time_luos_t { // set timestamp in message Timestamp_EncodeMsg(msg, timestamp); + return Luos_Send(service, msg); +} + +/****************************************************************************** + * @brief Send msg through network + * @param service : Who send + * @param msg : Message to send + * @param timestamp + * @return SUCCEED : If the message is sent, else FAILED or PROHIBITED + ******************************************************************************/ +static error_return_t Luos_Send(service_t *service, msg_t *msg) +{ if (service == 0) { // There is no service specified here, take the first one - service = &service_table[0]; + service = &Service_GetTable()[0]; } if ((service->ll_service->id == 0) && (msg->header.cmd >= LUOS_LAST_RESERVED_CMD)) { @@ -632,11 +456,7 @@ error_return_t Luos_SendTimestampMsg(service_t *service, msg_t *msg, time_luos_t // We can't send it return PROHIBITED; } - if (Robus_SendMsg(service->ll_service, msg) == FAILED) - { - return FAILED; - } - return SUCCEED; + return Robus_SendMsg(service->ll_service, msg); } /****************************************************************************** @@ -794,7 +614,7 @@ int Luos_ReceiveData(service_t *service, msg_t *msg, void *bin_data) LUOS_ASSERT(msg != 0); LUOS_ASSERT(bin_data != 0); - uint16_t id = Luos_GetServiceIndex(service); + uint16_t id = Service_GetIndex(service); // check good service index if (id == 0xFFFF) { @@ -852,57 +672,6 @@ int Luos_ReceiveData(service_t *service, msg_t *msg, void *bin_data) } return 0; } -/****************************************************************************** - * @brief Store alias name service in flash - * @param service : Service to store - * @param alias : Alias to store - * @return SUCCEED : If the alias is correctly updated - ******************************************************************************/ -error_return_t Luos_UpdateAlias(service_t *service, const char *alias, uint16_t size) -{ - - if ((size == 0) || (alias[0] == '\0')) - { - // This is a void alias just replace it with the default alias, write it - memcpy(service->alias, service->default_alias, MAX_ALIAS_SIZE); - return SUCCEED; - } - // Be sure to have a size including \0 - if (alias[size - 1] != '\0') - { - size++; - } - // Clip size - if (size > MAX_ALIAS_SIZE) - { - size = MAX_ALIAS_SIZE; - } - char clean_alias[MAX_ALIAS_SIZE] = {0}; - // Replace any ' '' character by a '_' character, FAIL at any special character. - for (uint8_t i = 0; i < size - 1; i++) - { - switch (alias[i]) - { - case 'A' ... 'Z': - case 'a' ... 'z': - case '0' ... '9': - case '_': - // This is good - clean_alias[i] = alias[i]; - break; - case ' ': - clean_alias[i] = '_'; - break; - default: - // This is a wrong character, don't do anything and return FAILED - return FAILED; - break; - } - } - // We are ready to save this new alias, write it - memcpy(service->alias, clean_alias, MAX_ALIAS_SIZE); - return SUCCEED; -} /****************************************************************************** * @brief Return the number of messages available * @param None @@ -1012,20 +781,6 @@ void Luos_Run(void) #endif } } -/****************************************************************************** - * @brief Set a local id - * @param service : Service that we want to set id - * @param id : Id value - * @return None - ******************************************************************************/ -void Luos_SetID(service_t *service, uint16_t id) -{ - Filter_IdInit(); - // set id - service->ll_service->id = 1; - // change filter mask - Filter_AddServiceId(id, service_number); -} /****************************************************************************** * @brief Demand a detection * @param service : Service that launched the detection @@ -1037,8 +792,12 @@ void Luos_Detect(service_t *service) if (Node_GetState() < LOCAL_DETECTION) { - // set the detection launcher id to 1 - Luos_SetID(service, 1); + Filter_IdInit(); + // Set the detection launcher id to 1 + service->ll_service->id = 1; + // Update the filter just to accept our detector id + Filter_AddServiceId(1, 1); + // send ask detection message detection_service = service; detect_msg.header.target_mode = SERVICEIDACK; diff --git a/engine/core/src/service.c b/engine/core/src/service.c index b1e3dd515..7ef2b07cc 100644 --- a/engine/core/src/service.c +++ b/engine/core/src/service.c @@ -4,4 +4,299 @@ * @author Luos * @version 0.0.0 ******************************************************************************/ -#include "service.h" \ No newline at end of file +#include +#include "service.h" +#include "filter.h" +#include "luos_list.h" +#include "node.h" +#include "luos_utils.h" +#include "luos_hal.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ +typedef struct +{ + service_t list[MAX_SERVICE_NUMBER]; + uint16_t number; +} service_ctx_t; + +/******************************************************************************* + * Variables + ******************************************************************************/ +service_ctx_t service_ctx; + +/******************************************************************************* + * Function + ******************************************************************************/ + +/****************************************************************************** + * @brief API to Init the service table + * @param None + * @return None + ******************************************************************************/ +void Service_Init(void) +{ + service_ctx.number = 0; +} + +/****************************************************************************** + * @brief API to get the service table + * @param None + * @return service table + ******************************************************************************/ +service_t *Service_GetTable(void) +{ + return service_ctx.list; +} + +/****************************************************************************** + * @brief API to get the service number + * @param None + * @return service number + ******************************************************************************/ +uint16_t Service_GetNumber(void) +{ + return service_ctx.number; +} + +/****************************************************************************** + * @brief API to reset all service statistics + * @param None + * @return None + ******************************************************************************/ +void Service_ResetStatistics(void) +{ + for (uint16_t i = 0; i < service_ctx.number; i++) + { + service_ctx.list[i].statistics.max_retry = 0; + } +} + +/****************************************************************************** + * @brief API to generate a service ID + * @param baseId : base ID of the services, this value will be increased for eeach services + * @return None + ******************************************************************************/ +void Service_GenerateId(uint16_t base_id) +{ + LUOS_ASSERT(base_id > 0); + Filter_AddServiceId(base_id, service_ctx.number); + if (base_id == 1) + { + // If base_id is 1, it means that the node is a detector. + // Id 1 would be reserved for the already setted detector service. + // So we need to avoid the service with id 1 and start with id 2. + base_id = 2; + } + for (uint16_t i = 0; i < service_ctx.number; i++) + { + if (service_ctx.list[i].ll_service->id != 1) + { + service_ctx.list[i].ll_service->id = base_id++; + } + } +} + +/****************************************************************************** + * @brief Get pointer to a service based on ll_service + * @param ll_service : low level service + * @return Service from list + ******************************************************************************/ +service_t *Service_GetService(ll_service_t *ll_service) +{ + for (uint16_t i = 0; i < service_ctx.number; i++) + { + if (ll_service == service_ctx.list[i].ll_service) + { + return &service_ctx.list[i]; + } + } + return 0; +} + +/****************************************************************************** + * @brief Get this service index in the service table + * @param Service + * @return Service id the service list + ******************************************************************************/ +uint16_t Service_GetIndex(service_t *service) +{ + for (uint16_t i = 0; i < service_ctx.number; i++) + { + if (service == &service_ctx.list[i]) + { + return i; + } + } + return 0xFFFF; +} + +/****************************************************************************** + * @brief Auto update call for services + * @param none + * @return none + ******************************************************************************/ +void Service_AutoUpdateManager(void) +{ + // check all services timed_update_t contexts + for (uint16_t i = 0; i < service_ctx.number; i++) + { + // check if services have an actual ID. If not, we are in detection mode and should reset the auto refresh + if (service_ctx.list[i].ll_service->id == DEFAULTID) + { + // this service have not been detected or is in detection mode. remove auto_refresh parameters + service_ctx.list[i].auto_refresh.target = 0; + service_ctx.list[i].auto_refresh.time_ms = 0; + service_ctx.list[i].auto_refresh.last_update = 0; + } + else + { + // check if there is a timed update setted and if it's time to update it. + if (service_ctx.list[i].auto_refresh.time_ms) + { + if (service_ctx.list[i].ll_service->dead_service_spotted == service_ctx.list[i].auto_refresh.target) + { + service_ctx.list[i].auto_refresh.target = 0; + service_ctx.list[i].auto_refresh.time_ms = 0; + service_ctx.list[i].auto_refresh.last_update = 0; + continue; + } + if ((LuosHAL_GetSystick() - service_ctx.list[i].auto_refresh.last_update) >= service_ctx.list[i].auto_refresh.time_ms) + { + // This service need to send an update + // Create a fake message for it from the service asking for update + msg_t updt_msg; + updt_msg.header.config = BASE_PROTOCOL; + updt_msg.header.target = service_ctx.list[i].ll_service->id; + updt_msg.header.source = service_ctx.list[i].auto_refresh.target; + updt_msg.header.target_mode = SERVICEIDACK; + updt_msg.header.cmd = GET_CMD; + updt_msg.header.size = 0; + if ((service_ctx.list[i].service_cb != 0)) + { + service_ctx.list[i].service_cb(&service_ctx.list[i], &updt_msg); + } + else + { + if (Node_GetState() == DETECTION_OK) + { + // directly transmit the message in Localhost + Robus_SetTxTask(service_ctx.list[i].ll_service, &updt_msg); + } + } + service_ctx.list[i].auto_refresh.last_update = LuosHAL_GetSystick(); + } + } + } + } +} + +/****************************************************************************** + * @brief API to Create a service + * @param service_cb : Callback msg handler for the service + * @param type of service corresponding to object dictionnary + * @param alias for the service string (15 caracters max). + * @param version FW for the service (tab[MajorVersion,MinorVersion,Patch]) + * @return Service object pointer. + ******************************************************************************/ +service_t *Luos_CreateService(SERVICE_CB service_cb, uint8_t type, const char *alias, revision_t revision) +{ + uint8_t i = 0; + service_t *service = &service_ctx.list[service_ctx.number]; + service->ll_service = Robus_ServiceCreate(type); + + // Link the service to his callback + service->service_cb = service_cb; + + // Initialise the service aliases to 0 + memset((void *)service->default_alias, 0, MAX_ALIAS_SIZE); + memset((void *)service->alias, 0, MAX_ALIAS_SIZE); + // Save aliases + for (i = 0; i < MAX_ALIAS_SIZE - 1; i++) + { + service->default_alias[i] = alias[i]; + service->alias[i] = alias[i]; + if (service->default_alias[i] == '\0') + break; + } + service->default_alias[i] = '\0'; + service->alias[i] = '\0'; + + // Initialise the service revision to 0 + memset((void *)service->revision.unmap, 0, sizeof(revision_t)); + // Save firmware version + for (i = 0; i < sizeof(revision_t); i++) + { + service->revision.unmap[i] = revision.unmap[i]; + } + + // initiate service statistics + service->ll_service->ll_stat.max_retry = &service->statistics.max_retry; + + service_ctx.number++; + LUOS_ASSERT(service_ctx.number <= MAX_SERVICE_NUMBER); + return service; +} + +/****************************************************************************** + * @brief Store alias name service in flash + * @param service : Service to store + * @param alias : Alias to store + * @return SUCCEED : If the alias is correctly updated + ******************************************************************************/ +error_return_t Luos_UpdateAlias(service_t *service, const char *alias, uint16_t size) +{ + + if ((size == 0) || (alias[0] == '\0')) + { + // This is a void alias just replace it with the default alias, write it + memcpy(service->alias, service->default_alias, MAX_ALIAS_SIZE); + return SUCCEED; + } + // Be sure to have a size including \0 + if (alias[size - 1] != '\0') + { + size++; + } + // Clip size + if (size > MAX_ALIAS_SIZE) + { + size = MAX_ALIAS_SIZE; + } + char clean_alias[MAX_ALIAS_SIZE] = {0}; + // Replace any ' '' character by a '_' character, FAIL at any special character. + for (uint8_t i = 0; i < size - 1; i++) + { + switch (alias[i]) + { + case 'A' ... 'Z': + case 'a' ... 'z': + case '0' ... '9': + case '_': + // This is good + clean_alias[i] = alias[i]; + break; + case ' ': + clean_alias[i] = '_'; + break; + default: + // This is a wrong character, don't do anything and return FAILED + return FAILED; + break; + } + } + // We are ready to save this new alias, write it + memcpy(service->alias, clean_alias, MAX_ALIAS_SIZE); + return SUCCEED; +} +/****************************************************************************** + * @brief Clear list of service + * @param none + * @return none + ******************************************************************************/ +void Luos_ServicesClear(void) +{ + service_ctx.number = 0; + Robus_ServicesClear(); +} \ No newline at end of file From 358549d467f66a33d0d51966a1828d77eaad2b29 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 4 Apr 2023 14:42:49 +0200 Subject: [PATCH 025/150] Update .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 1640de383..54745e067 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,7 @@ /examples/projects/SAMD21XPLAINED/bootloader/firmware/luos_bootloader_samd21j18a.X/build/ /examples/projects/SAMD21XPLAINED/bootloader/firmware/luos_bootloader_samd21j18a.X/.generated_files/ /examples/projects/SAMD21XPLAINED/bootloader/firmware/luos_bootloader_samd21j18a.X/dist/ +examples/projects/ESP32/button/sdkconfig.esp32dev +examples/projects/ESP32/led/sdkconfig.esp32dev +tool_services/pipe/WS/ARDUINO/arduinoWebSockets/ mongoose/ From ae237a6fc842cd695ba34e11c135664d8661cdae Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 4 Apr 2023 14:45:40 +0200 Subject: [PATCH 026/150] Remove useless Luos_EmptyNode() function --- engine/core/src/luos_engine.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 861c8ea11..ca671b433 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -35,7 +35,6 @@ static error_return_t Luos_MsgHandler(service_t *service, msg_t *input); static void Luos_TransmitLocalRoutingTable(service_t *service, msg_t *routeTB_msg); static error_return_t Luos_IsALuosCmd(service_t *service, uint8_t cmd, uint16_t size); static error_return_t Luos_Send(service_t *service, msg_t *msg); -static inline void Luos_EmptyNode(void); static inline void Luos_PackageInit(void); static inline void Luos_PackageLoop(void); @@ -704,16 +703,6 @@ void Luos_AddPackage(void (*Init)(void), void (*Loop)(void)) package_number += 1; } -/****************************************************************************** - * @brief Create a service to signal an empty node - * @param None - * @return None - ******************************************************************************/ -void Luos_EmptyNode(void) -{ - Luos_CreateService(0, VOID_TYPE, "empty_node", luos_version); -} - /****************************************************************************** * @brief Run each package Init() * @param None @@ -732,7 +721,8 @@ void Luos_PackageInit(void) } else { - Luos_EmptyNode(); + // Create an emply node service + Luos_CreateService(0, VOID_TYPE, "empty_node", luos_version); } } From 8147a44db4361f74d988cd08fcdefd98691ed990 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 4 Apr 2023 14:54:37 +0200 Subject: [PATCH 027/150] Small code improvement --- engine/core/src/luos_engine.c | 1 - engine/core/src/routing_table.c | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index ca671b433..d07a6d2a5 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -174,7 +174,6 @@ void Luos_Loop(void) if (Flag_DetectServices == 1) { - Flag_DetectServices++; RoutingTB_DetectServices(detection_service); Flag_DetectServices = 0; } diff --git a/engine/core/src/routing_table.c b/engine/core/src/routing_table.c index e1ceeb7a4..4684e199e 100644 --- a/engine/core/src/routing_table.c +++ b/engine/core/src/routing_table.c @@ -368,15 +368,15 @@ void RoutingTB_DetectServices(service_t *service) uint16_t nb_node = Robus_TopologyDetection(service->ll_service); // Clear data reception state Luos_ReceiveData(NULL, NULL, NULL); - // clear the routing table. + // Clear the routing table. RoutingTB_Erase(); // Generate the routing_table RoutingTB_Generate(service, nb_node); // We have a complete routing table now share it with others. RoutingTB_Share(service, nb_node); - // send a message to indicate the end of the detection + // Send a message to indicate the end of the detection RoutingTB_SendEndDetection(service); - // clear statistic of node who start the detction + // Clear statistic of node who start the detction Luos_ResetStatistic(); } /****************************************************************************** From 664d2848740eaf748ec0748215f3ab23d3851c41 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 4 Apr 2023 15:55:11 +0200 Subject: [PATCH 028/150] Add type filtering on filter file --- engine/IO/inc/filter.h | 1 + engine/IO/src/filter.c | 24 ++++++++++++++++++++++-- network/robus/src/reception.c | 9 +++------ 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/engine/IO/inc/filter.h b/engine/IO/inc/filter.h index 272dbe0a6..9105cc720 100644 --- a/engine/IO/inc/filter.h +++ b/engine/IO/inc/filter.h @@ -30,5 +30,6 @@ void Filter_AddTopic(uint16_t topic_id); void Filter_RmTopic(uint16_t topic_id); bool Filter_ServiceID(uint16_t service_id); bool Filter_Topic(uint16_t topic_id); +bool Filter_Type(uint16_t type_id); #endif /* _FILTER_H_ */ diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c index b028e1882..cf2de5387 100644 --- a/engine/IO/src/filter.c +++ b/engine/IO/src/filter.c @@ -8,6 +8,7 @@ #include "filter.h" #include "luos_utils.h" #include "luos_hal.h" +#include "service.h" /******************************************************************************* * Definitions @@ -132,8 +133,8 @@ _CRITICAL bool Filter_ServiceID(uint16_t service_id) /****************************************************************************** * @brief Parse multicast mask to find if target exists - * @param target of message - * @return None + * @param topic_id of message + * @return bool true if there is one false if not * _CRITICAL function call in IRQ ******************************************************************************/ _CRITICAL bool Filter_Topic(uint16_t topic_id) @@ -150,4 +151,23 @@ _CRITICAL bool Filter_Topic(uint16_t topic_id) } } return false; +} + +/****************************************************************************** + * @brief Parse all services type to find if target exists + * @param type_id of message + * @return bool true if there is one false if not + * _CRITICAL function call in IRQ + ******************************************************************************/ +_CRITICAL bool Filter_Type(uint16_t type_id) +{ + // Check all ll_service type + for (int i = 0; i < Service_GetNumber(); i++) + { + if (type_id == Service_GetTable()[i].ll_service->type) + { + return true; + } + } + return false; } \ No newline at end of file diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index 1eb753dc3..413218e5e 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -431,13 +431,10 @@ _CRITICAL luos_localhost_t Recep_NodeConcerned(header_t *header) } break; case TYPE: - // Check all ll_service type - for (i = 0; i < ctx.ll_service_number; i++) + + if (Filter_Type(header->target)) { - if (header->target == ctx.ll_service_table[i].type) - { - return MULTIHOST; - } + return MULTIHOST; } break; case BROADCAST: From 6812c053eba1eef83b2db86c56037fad5d3e88bd Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 4 Apr 2023 15:56:32 +0200 Subject: [PATCH 029/150] Remove the redundant ll_service_number from robus context --- engine/core/inc/service.h | 6 ++ engine/core/src/pub_sub.c | 3 +- engine/core/src/service.c | 153 +++++++++++++++++++++++++++++++++- network/robus/inc/context.h | 2 - network/robus/inc/reception.h | 1 - network/robus/inc/robus.h | 4 +- network/robus/src/reception.c | 121 --------------------------- network/robus/src/robus.c | 43 ++-------- 8 files changed, 172 insertions(+), 161 deletions(-) diff --git a/engine/core/inc/service.h b/engine/core/inc/service.h index f88580639..7ff844ebb 100644 --- a/engine/core/inc/service.h +++ b/engine/core/inc/service.h @@ -17,7 +17,13 @@ service_t *Service_GetTable(void); uint16_t Service_GetNumber(void); void Service_ResetStatistics(void); void Service_GenerateId(uint16_t base_id); +void Service_ClearId(void); service_t *Service_GetService(ll_service_t *ll_service); uint16_t Service_GetIndex(service_t *service); void Service_AutoUpdateManager(void); + +// IO related functions +ll_service_t *Service_GetConcerned(header_t *header); +void Service_AllocMsg(msg_t *msg); + #endif /* _SERVICE_H_ */ diff --git a/engine/core/src/pub_sub.c b/engine/core/src/pub_sub.c index c56639a08..584515f33 100644 --- a/engine/core/src/pub_sub.c +++ b/engine/core/src/pub_sub.c @@ -9,6 +9,7 @@ #include #include #include "filter.h" +#include "service.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -103,7 +104,7 @@ error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic) // Recompute multicast mask if needed if (err == SUCCEED) { - for (uint16_t i = 0; i < ctx.ll_service_number; i++) + for (uint16_t i = 0; i < Service_GetNumber(); i++) { if (PubSub_IsTopicSubscribed((ll_service_t *)(&ctx.ll_service_table[i]), topic) == true) { diff --git a/engine/core/src/service.c b/engine/core/src/service.c index 7ef2b07cc..dbddfeed1 100644 --- a/engine/core/src/service.c +++ b/engine/core/src/service.c @@ -11,6 +11,8 @@ #include "node.h" #include "luos_utils.h" #include "luos_hal.h" +#include "msg_alloc.h" +#include "pub_sub.h" /******************************************************************************* * Definitions @@ -98,6 +100,18 @@ void Service_GenerateId(uint16_t base_id) } } +/****************************************************************************** + * @brief Clear all service ID + * @return None + ******************************************************************************/ +void Service_ClearId(void) +{ + for (uint16_t i = 0; i < service_ctx.number; i++) + { + service_ctx.list[i].ll_service->id = DEFAULTID; + } +} + /****************************************************************************** * @brief Get pointer to a service based on ll_service * @param ll_service : low level service @@ -192,6 +206,128 @@ void Service_AutoUpdateManager(void) } } +/****************************************************************************** + * @brief Parse msg to find a service concerned + * @param header of message + * @return ll_service pointer + ******************************************************************************/ +ll_service_t *Service_GetConcerned(header_t *header) +{ + uint16_t i = 0; + LUOS_ASSERT(header); + // Find if we are concerned by this message. + switch (header->target_mode) + { + case SERVICEIDACK: + case SERVICEID: + // Check all ll_service id + for (i = 0; i < service_ctx.number; i++) + { + if (header->target == service_ctx.list[i].ll_service->id) + { + return service_ctx.list[i].ll_service; + } + } + break; + case TYPE: + // Check all ll_service type + for (i = 0; i < service_ctx.number; i++) + { + if (header->target == service_ctx.list[i].ll_service->type) + { + return service_ctx.list[i].ll_service; + } + } + break; + case BROADCAST: + case NODEIDACK: + case NODEID: + return service_ctx.list[0].ll_service; + break; + case TOPIC: + default: + return NULL; + break; + } + return NULL; +} + +/****************************************************************************** + * @brief Parse msg to find all services concerned and allocate them + * @param msg pointer + * @return None + ******************************************************************************/ +void Service_AllocMsg(msg_t *msg) +{ + uint16_t i = 0; + + // Find if we are concerned by this message. + switch (msg->header.target_mode) + { + case SERVICEIDACK: + case SERVICEID: + // Check all ll_service id + for (i = 0; i < service_ctx.number; i++) + { + if (msg->header.target == service_ctx.list[i].ll_service->id) + { + MsgAlloc_LuosTaskAlloc(service_ctx.list[i].ll_service, msg); + break; + } + } + return; + break; + case TYPE: + // Check all ll_service type + for (i = 0; i < service_ctx.number; i++) + { + if (msg->header.target == service_ctx.list[i].ll_service->type) + { + MsgAlloc_LuosTaskAlloc(service_ctx.list[i].ll_service, msg); + } + } + return; + break; + case BROADCAST: + for (i = 0; i < service_ctx.number; i++) + { + MsgAlloc_LuosTaskAlloc(service_ctx.list[i].ll_service, msg); + } + return; + break; + case TOPIC: + for (i = 0; i < service_ctx.number; i++) + { + if (PubSub_IsTopicSubscribed(service_ctx.list[i].ll_service, msg->header.target)) + { + // TODO manage multiple slave concerned + MsgAlloc_LuosTaskAlloc(service_ctx.list[i].ll_service, msg); + } + } + return; + break; + case NODEIDACK: + case NODEID: + if (msg->header.target == DEFAULTID) // on default ID it's always a luos command create only one task + { + MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[0], msg); + return; + } + // check if the message is really for the node or it is a service that has no filter + if (msg->header.target == Node_Get()->node_id) + { + for (i = 0; i < service_ctx.number; i++) + { + MsgAlloc_LuosTaskAlloc(service_ctx.list[i].ll_service, msg); + } + } + return; + break; + default: + break; + } +} + /****************************************************************************** * @brief API to Create a service * @param service_cb : Callback msg handler for the service @@ -204,7 +340,22 @@ service_t *Luos_CreateService(SERVICE_CB service_cb, uint8_t type, const char *a { uint8_t i = 0; service_t *service = &service_ctx.list[service_ctx.number]; - service->ll_service = Robus_ServiceCreate(type); + service->ll_service = &Robus_GetLlServiceList()[service_ctx.number]; + + // Set the service type + service->ll_service->type = type; + // Initialise the service id, TODO the ID could be stored in EEprom, the default ID could be set in factory... + service->ll_service->id = DEFAULTID; + // Initialize dead service detection + service->ll_service->dead_service_spotted = 0; + // Clear stats + service->ll_service->ll_stat.max_retry = 0; + // Clear topic number + service->ll_service->last_topic_position = 0; + for (uint16_t i = 0; i < LAST_TOPIC; i++) + { + service->ll_service->topic_list[i] = 0; + } // Link the service to his callback service->service_cb = service_cb; diff --git a/network/robus/inc/context.h b/network/robus/inc/context.h index baf07b5d7..3d498ee67 100644 --- a/network/robus/inc/context.h +++ b/network/robus/inc/context.h @@ -26,8 +26,6 @@ typedef struct // Low level service management ll_service_t ll_service_table[MAX_SERVICE_NUMBER]; /*!< Low level Service table. */ - uint16_t ll_service_number; /*!< Low level Service number. */ - } context_t; /******************************************************************************* diff --git a/network/robus/inc/reception.h b/network/robus/inc/reception.h index 96e9ead98..6229af67a 100644 --- a/network/robus/inc/reception.h +++ b/network/robus/inc/reception.h @@ -54,7 +54,6 @@ void Recep_Init(void); void Recep_EndMsg(void); void Recep_Reset(void); void Recep_Timeout(void); -void Recep_InterpretMsgProtocol(msg_t *msg); luos_localhost_t Recep_NodeConcerned(header_t *header); ll_service_t *Recep_GetConcernedLLService(header_t *header); diff --git a/network/robus/inc/robus.h b/network/robus/inc/robus.h index b20521033..6e5551734 100644 --- a/network/robus/inc/robus.h +++ b/network/robus/inc/robus.h @@ -19,8 +19,10 @@ ******************************************************************************/ void Robus_Init(memory_stats_t *memory_stats); void Robus_Loop(void); -ll_service_t *Robus_ServiceCreate(uint16_t type); + void Robus_ServicesClear(void); +ll_service_t *Robus_GetLlServiceList(void); + error_return_t Robus_SetTxTask(ll_service_t *ll_service, msg_t *msg); error_return_t Robus_SendMsg(ll_service_t *ll_service, msg_t *msg); uint16_t Robus_TopologyDetection(ll_service_t *ll_service); diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index 413218e5e..ecad49653 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -360,51 +360,6 @@ _CRITICAL void Recep_CatchAck(volatile uint8_t *data) ctx.tx.status = TX_NOK; } } -/****************************************************************************** - * @brief Parse msg to find a service concerned - * @param header of message - * @return ll_service pointer - ******************************************************************************/ -ll_service_t *Recep_GetConcernedLLService(header_t *header) -{ - uint16_t i = 0; - LUOS_ASSERT(header); - // Find if we are concerned by this message. - switch (header->target_mode) - { - case SERVICEIDACK: - case SERVICEID: - // Check all ll_service id - for (i = 0; i < ctx.ll_service_number; i++) - { - if (header->target == ctx.ll_service_table[i].id) - { - return (ll_service_t *)&ctx.ll_service_table[i]; - } - } - break; - case TYPE: - // Check all ll_service type - for (i = 0; i < ctx.ll_service_number; i++) - { - if (header->target == ctx.ll_service_table[i].type) - { - return (ll_service_t *)&ctx.ll_service_table[i]; - } - } - break; - case BROADCAST: - case NODEIDACK: - case NODEID: - return (ll_service_t *)&ctx.ll_service_table[0]; - break; - case TOPIC: - default: - return NULL; - break; - } - return NULL; -} /****************************************************************************** * @brief Parse msg to find a service concerne * @param header of message @@ -414,8 +369,6 @@ ll_service_t *Recep_GetConcernedLLService(header_t *header) ******************************************************************************/ _CRITICAL luos_localhost_t Recep_NodeConcerned(header_t *header) { - uint16_t i = 0; - // Find if we are concerned by this message. // check if we need to filter all the messages @@ -470,81 +423,7 @@ _CRITICAL luos_localhost_t Recep_NodeConcerned(header_t *header) } return EXTERNALHOST; } -/****************************************************************************** - * @brief Parse msg to find all services concerned and create - * @param msg pointer - * @return None - ******************************************************************************/ -void Recep_InterpretMsgProtocol(msg_t *msg) -{ - uint16_t i = 0; - // Find if we are concerned by this message. - switch (msg->header.target_mode) - { - case SERVICEIDACK: - case SERVICEID: - // Check all ll_service id - for (i = 0; i < ctx.ll_service_number; i++) - { - if (msg->header.target == ctx.ll_service_table[i].id) - { - MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg); - break; - } - } - return; - break; - case TYPE: - // Check all ll_service type - for (i = 0; i < ctx.ll_service_number; i++) - { - if (msg->header.target == ctx.ll_service_table[i].type) - { - MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg); - } - } - return; - break; - case BROADCAST: - for (i = 0; i < ctx.ll_service_number; i++) - { - MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg); - } - return; - break; - case TOPIC: - for (i = 0; i < ctx.ll_service_number; i++) - { - if (PubSub_IsTopicSubscribed((ll_service_t *)&ctx.ll_service_table[i], msg->header.target)) - { - // TODO manage multiple slave concerned - MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg); - } - } - return; - break; - case NODEIDACK: - case NODEID: - if (msg->header.target == DEFAULTID) // on default ID it's always a luos command create only one task - { - MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[0], msg); - return; - } - // check if the message is really for the node or it is a service that has no filter - if (msg->header.target == Node_Get()->node_id) - { - for (i = 0; i < ctx.ll_service_number; i++) - { - MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[i], msg); - } - } - return; - break; - default: - break; - } -} /****************************************************************************** * @brief Check if we need to send an ack * @param None diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index 9827a21c9..aaa7b9bdf 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -18,6 +18,7 @@ #include "luos_utils.h" #include "luos_engine.h" #include "filter.h" +#include "service.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -57,8 +58,6 @@ volatile uint16_t last_node = 0; ******************************************************************************/ void Robus_Init(memory_stats_t *memory_stats) { - // Init the number of created virtual service. - ctx.ll_service_number = 0; Node_Init(); // no transmission lock ctx.tx.lock = false; @@ -108,35 +107,19 @@ void Robus_Loop(void) // Check if this message is a protocol one if (Robus_MsgHandler(msg) == FAILED) { - // If not create luos tasks. - Recep_InterpretMsgProtocol(msg); + // If not create luos tasks for all services. + Service_AllocMsg(msg); } } RobusHAL_Loop(); } /****************************************************************************** - * @brief create a service add in local route table - * @param type of service create + * @brief return the ll_service list * @return None ******************************************************************************/ -ll_service_t *Robus_ServiceCreate(uint16_t type) +ll_service_t *Robus_GetLlServiceList(void) { - // Set the service type - ctx.ll_service_table[ctx.ll_service_number].type = type; - // Initialise the service id, TODO the ID could be stored in EEprom, the default ID could be set in factory... - ctx.ll_service_table[ctx.ll_service_number].id = DEFAULTID; - // Initialize dead service detection - ctx.ll_service_table[ctx.ll_service_number].dead_service_spotted = 0; - // Clear stats - ctx.ll_service_table[ctx.ll_service_number].ll_stat.max_retry = 0; - // Clear topic number - ctx.ll_service_table[ctx.ll_service_number].last_topic_position = 0; - for (uint16_t i = 0; i < LAST_TOPIC; i++) - { - ctx.ll_service_table[ctx.ll_service_number].topic_list[i] = 0; - } - // Return the freshly initialized ll_service pointer. - return (ll_service_t *)&ctx.ll_service_table[ctx.ll_service_number++]; + return (ll_service_t *)ctx.ll_service_table; } /****************************************************************************** * @brief clear service list in route table @@ -147,8 +130,6 @@ void Robus_ServicesClear(void) { // Clear ll_service table memset((void *)ctx.ll_service_table, 0, sizeof(ll_service_t) * MAX_SERVICE_NUMBER); - // Reset the number of created services - ctx.ll_service_number = 0; } /****************************************************************************** * @brief Formalize message Set tx task and send @@ -317,10 +298,7 @@ static error_return_t Robus_ResetNetworkDetection(ll_service_t *ll_service) ; // Reinit ll_service id - for (uint8_t i = 0; i < ctx.ll_service_number; i++) - { - ctx.ll_service_table[i].id = DEFAULTID; - } + Service_ClearId(); // Reinit msg alloc MsgAlloc_Init(NULL); @@ -401,7 +379,7 @@ static error_return_t Robus_MsgHandler(msg_t *input) { msg_t output_msg; node_bootstrap_t node_bootstrap; - ll_service_t *ll_service = Recep_GetConcernedLLService(&input->header); + ll_service_t *ll_service = Service_GetConcerned(&input->header); switch (input->header.cmd) { case WRITE_NODE_ID: @@ -442,10 +420,7 @@ static error_return_t Robus_MsgHandler(msg_t *input) { Node_Get()->node_id = 0; // Reinit ll_service id - for (uint8_t i = 0; i < ctx.ll_service_number; i++) - { - ctx.ll_service_table[i].id = DEFAULTID; - } + Service_ClearId(); MsgAlloc_Init(NULL); } // This is a node bootstrap information. From 000575a43c7c9303fcd45339b76648a650ba18ca Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 4 Apr 2023 15:57:40 +0200 Subject: [PATCH 030/150] Remove useless baudrate variable --- network/robus/src/robus.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index aaa7b9bdf..78c170507 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -44,7 +44,6 @@ static error_return_t Robus_ResetNetworkDetection(ll_service_t *ll_service); ******************************************************************************/ // Creation of the robus context. This variable is used in all files of this lib. volatile context_t ctx; -uint32_t baudrate; /*!< System current baudrate. */ volatile uint16_t last_node = 0; /******************************************************************************* @@ -65,8 +64,6 @@ void Robus_Init(memory_stats_t *memory_stats) ctx.tx.collision = false; // Init Tx status ctx.tx.status = TX_DISABLE; - // Save luos baudrate - baudrate = DEFAULTBAUDRATE; // Filters init Filter_IdInit(); Filter_TopicInit(); From 07b8b3e5cde5eeffd0f0d49cab033affbc834872 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 5 Apr 2023 11:08:39 +0200 Subject: [PATCH 031/150] Move ll_service_t into Service_t, only one struct remain now. --- engine/IO/inc/filter.h | 2 +- engine/IO/inc/io_struct.h | 157 ------------- engine/IO/inc/msg_alloc.h | 14 +- engine/IO/inc/struct_io.h | 47 ++++ engine/IO/src/filter.c | 5 +- engine/IO/src/msg_alloc.c | 58 ++--- engine/OD/od_linear.h | 2 +- engine/bootloader/bootloader_core.h | 2 +- engine/core/inc/luos_engine.h | 4 +- engine/core/inc/luos_list.h | 2 +- engine/core/inc/pub_sub.h | 4 +- engine/core/inc/routing_table.h | 3 +- engine/core/inc/service.h | 5 +- engine/core/inc/streaming.h | 2 +- engine/core/inc/struct_engine.h | 27 +++ .../inc/{service_structs.h => struct_luos.h} | 179 ++++++++------- engine/core/inc/struct_stat.h | 78 +++++++ engine/core/inc/struct_utils.h | 27 +++ engine/core/src/luos_engine.c | 52 ++--- engine/core/src/luos_utils.c | 4 +- engine/core/src/node.c | 1 + engine/core/src/pub_sub.c | 43 ++-- engine/core/src/routing_table.c | 12 +- engine/core/src/service.c | 98 ++++---- engine/core/src/timestamp.c | 2 +- engine/engine_config.h | 12 +- .../native/ping_pong/lib/PingPong/ping_pong.c | 4 +- network/robus/inc/context.h | 3 - network/robus/inc/reception.h | 4 +- network/robus/inc/robus.h | 11 +- network/robus/inc/transmission.h | 2 +- network/robus/selftest/selftest.c | 1 + network/robus/src/reception.c | 15 +- network/robus/src/robus.c | 77 +++---- network/robus/src/transmission.c | 16 +- test/_resources/Unity/unit_test.h | 2 +- .../unit_test_mem_alloc_generic.c | 94 ++++---- .../unit_test_mem_alloc_static.c | 24 +- test/test_msg_alloc/unit_test_mem_alloc_tx.c | 210 +++++++++--------- test/test_topic/main.c | 60 ++--- tool_services/gate/TinyJSON/bootloader_ex.h | 2 +- tool_services/gate/TinyJSON/convert.c | 2 +- tool_services/gate/data_manager.c | 6 +- tool_services/gate/pipe_link.c | 4 +- tool_services/inspector/pipe_link.c | 2 +- 45 files changed, 677 insertions(+), 704 deletions(-) delete mode 100644 engine/IO/inc/io_struct.h create mode 100644 engine/IO/inc/struct_io.h create mode 100644 engine/core/inc/struct_engine.h rename engine/core/inc/{service_structs.h => struct_luos.h} (60%) create mode 100644 engine/core/inc/struct_stat.h create mode 100644 engine/core/inc/struct_utils.h diff --git a/engine/IO/inc/filter.h b/engine/IO/inc/filter.h index 9105cc720..66f327192 100644 --- a/engine/IO/inc/filter.h +++ b/engine/IO/inc/filter.h @@ -7,8 +7,8 @@ #ifndef _FILTER_H_ #define _FILTER_H_ -#include "io_struct.h" #include +#include /******************************************************************************* * Definitions diff --git a/engine/IO/inc/io_struct.h b/engine/IO/inc/io_struct.h deleted file mode 100644 index 078633862..000000000 --- a/engine/IO/inc/io_struct.h +++ /dev/null @@ -1,157 +0,0 @@ -/****************************************************************************** - * @file robus_struct - * @brief definition protocole robus structure - * @author Luos - * @version 0.0.0 - ******************************************************************************/ -#ifndef _ROBUS_STRUCT_H_ -#define _ROBUS_STRUCT_H_ - -#include "stdint.h" -#include "engine_config.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/****************************************************************************** - * @struct luos_localhost_t - * @brief Transmit message direction - ******************************************************************************/ -typedef enum -{ - EXTERNALHOST, // This message is for an external service - LOCALHOST, // This message is for an internal service only - MULTIHOST // This message is for an internal and an external service -} luos_localhost_t; - -/****************************************************************************** - * @struct memory_stats_t - * @brief store informations about RAM occupation - ******************************************************************************/ -typedef struct __attribute__((__packed__)) -{ - uint8_t rx_msg_stack_ratio; - uint8_t engine_msg_stack_ratio; - uint8_t tx_msg_stack_ratio; - uint8_t buffer_occupation_ratio; - uint8_t msg_drop_number; -} memory_stats_t; - -typedef struct __attribute__((__packed__)) -{ - uint8_t *max_retry; -} ll_stats_t; -/* - * This structure is used to get the message addressing mode list. - */ -typedef enum -{ - SERVICEID, /*!< Unique or virtual ID, used to send something to only one service. */ - SERVICEIDACK, /*!< Unique or virtual ID with reception Acknoledgment (ACK). */ - TYPE, /*!< Type mode, used to send something to all service of the same type. */ - BROADCAST, /*!< Broadcast mode, used to send something to everybody. */ - TOPIC, /*!< Multicast mode, used to send something to multiple services. */ - NODEID, /*!< Node mode, used to send something to all services of a node. */ - NODEIDACK, /*!< Node mode with reception Acknoledgment (ACK). */ - - ID = SERVICEID, /*!< This define is deprecated, please use SERVICEID instead. */ - IDACK = SERVICEIDACK /*!< This define is deprecated, please use SERVICEIDACK instead. */ -} target_mode_t; - -/* This structure is used specify data and destination of datas. - * please refer to the documentation - */ -typedef struct __attribute__((__packed__)) -{ - union - { - struct __attribute__((__packed__)) - { - uint16_t config : 4; /*!< Protocol version. */ - uint16_t target : 12; /*!< Target address, it can be (ID, Multicast/Broadcast, Type). */ - uint16_t target_mode : 4; /*!< Select targeting mode (ID, ID+ACK, Multicast/Broadcast, Type). */ - uint16_t source : 12; /*!< Source address, it can be (ID, Multicast/Broadcast, Type). */ - uint8_t cmd; /*!< msg definition. */ - uint16_t size; /*!< Size of the data field. */ - }; - uint8_t unmap[7]; /*!< Unmaped form. */ - }; -} header_t; - -/* This structure is used to receive or send messages between services in slave - * and master mode. - * please refer to the documentation - */ -typedef struct __attribute__((__packed__)) -{ - union - { - struct __attribute__((__packed__)) - { - header_t header; /*!< Header filed. */ - uint8_t data[MAX_DATA_MSG_SIZE]; /*!< Data with size known. */ - }; - uint8_t stream[sizeof(header_t) + MAX_DATA_MSG_SIZE]; /*!< unmaped option. */ - }; -} msg_t; - -/* This structure is used to manage virtual services - * please refer to the documentation - */ -typedef struct __attribute__((__packed__)) -{ - - // Service infomations - uint16_t id; /*!< Service ID. */ - uint16_t type; /*!< Service type. */ - - // Variables - uint16_t last_topic_position; /*!< Position pointer of the last topic added. */ - uint16_t topic_list[LAST_TOPIC]; /*!< multicast target bank. */ - uint16_t dead_service_spotted; /*!< The ID of a service that don't reply to a lot of ACK msg */ - - // variable stat on robus com for ll_service - ll_stats_t ll_stat; -} ll_service_t; - -/****************************************************************************** - * @struct error_return_t - * @brief Return function error global convention - ******************************************************************************/ -typedef enum -{ - SUCCEED, /*!< function work properly. */ - PROHIBITED, /*!< function usage is currently prohibited. */ - FAILED = 0xFF /*!< function fail. */ -} error_return_t; - -typedef enum -{ - // protocol level command - WRITE_NODE_ID, /*!< Get and save a new given node ID. */ - START_DETECTION, /*!< Start a detection*/ - END_DETECTION, /*!< Detect the end of a detection*/ - ASSERT, /*!< Node Assert message (only broadcast with a source as a node */ - - /*!< Compatibility area*/ - ROBUS_PROTOCOL_NB = 13, -} robus_cmd_t; - -typedef enum -{ - // Protocol version - BASE_PROTOCOL = PROTOCOL_REVISION, - TIMESTAMP_PROTOCOL, -} robus_protocol_t; - -typedef void (*RX_CB)(ll_service_t *ll_service, msg_t *msg); -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Function - ******************************************************************************/ - -#endif /* _ROBUS_STRUCT_H_ */ diff --git a/engine/IO/inc/msg_alloc.h b/engine/IO/inc/msg_alloc.h index e1c30d636..3547981de 100644 --- a/engine/IO/inc/msg_alloc.h +++ b/engine/IO/inc/msg_alloc.h @@ -7,8 +7,8 @@ #ifndef _MSGALLOC_H_ #define _MSGALLOC_H_ -#include "io_struct.h" -#include "stdint.h" +#include "struct_luos.h" +#include "struct_io.h" /******************************************************************************* * Definitions @@ -42,12 +42,12 @@ void MsgAlloc_ValidDataIntegrity(void); error_return_t MsgAlloc_PullMsgToInterpret(msg_t **returned_msg); // Luos task stack -void MsgAlloc_LuosTaskAlloc(ll_service_t *service_concerned_by_current_msg, msg_t *concerned_msg); +void MsgAlloc_LuosTaskAlloc(service_t *service_concerned_by_current_msg, msg_t *concerned_msg); // Luos task research and pull -error_return_t MsgAlloc_PullMsg(ll_service_t *target_service, msg_t **returned_msg); +error_return_t MsgAlloc_PullMsg(service_t *target_service, msg_t **returned_msg); error_return_t MsgAlloc_PullMsgFromLuosTask(uint16_t luos_task_id, msg_t **returned_msg); -error_return_t MsgAlloc_LookAtLuosTask(uint16_t luos_task_id, ll_service_t **allocated_service); +error_return_t MsgAlloc_LookAtLuosTask(uint16_t luos_task_id, service_t **allocated_service); error_return_t MsgAlloc_GetLuosTaskSourceId(uint16_t luos_task_id, uint16_t *source_id); error_return_t MsgAlloc_GetLuosTaskCmd(uint16_t luos_task_id, uint8_t *cmd); error_return_t MsgAlloc_GetLuosTaskSize(uint16_t luos_task_id, uint16_t *size); @@ -55,10 +55,10 @@ uint16_t MsgAlloc_LuosTasksNbr(void); void MsgAlloc_ClearMsgFromLuosTasks(msg_t *msg); // Tx tasks create, get and consume -error_return_t MsgAlloc_SetTxTask(ll_service_t *ll_service_pt, uint8_t *data, uint16_t crc, uint16_t size, luos_localhost_t localhost, uint8_t ack); +error_return_t MsgAlloc_SetTxTask(service_t *service_pt, uint8_t *data, uint16_t crc, uint16_t size, luos_localhost_t localhost, uint8_t ack); void MsgAlloc_PullMsgFromTxTask(void); void MsgAlloc_PullServiceFromTxTask(uint16_t service_id); -error_return_t MsgAlloc_GetTxTask(ll_service_t **ll_service_pt, uint8_t **data, uint16_t *size, uint8_t *localhost); +error_return_t MsgAlloc_GetTxTask(service_t **service_pt, uint8_t **data, uint16_t *size, uint8_t *localhost); error_return_t MsgAlloc_TxAllComplete(void); #endif /* _MSGALLOC_H_ */ diff --git a/engine/IO/inc/struct_io.h b/engine/IO/inc/struct_io.h new file mode 100644 index 000000000..37751a41f --- /dev/null +++ b/engine/IO/inc/struct_io.h @@ -0,0 +1,47 @@ +/****************************************************************************** + * @file struct_io + * @brief io level structures + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _STRUCT_IO_H_ +#define _STRUCT_IO_H_ + +#include +#include "engine_config.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/****************************************************************************** + * @struct luos_localhost_t + * @brief Transmit message direction + ******************************************************************************/ +typedef enum +{ + EXTERNALHOST, // This message is for an external service + LOCALHOST, // This message is for an internal service only + MULTIHOST // This message is for an internal and an external service +} luos_localhost_t; + +typedef enum +{ + // protocol level command + WRITE_NODE_ID, /*!< Get and save a new given node ID. */ + START_DETECTION, /*!< Start a detection*/ + END_DETECTION, /*!< Detect the end of a detection*/ + ASSERT, /*!< Node Assert message (only broadcast with a source as a node */ + + /*!< Compatibility area*/ + // ROBUS_PROTOCOL_NB = 13, +} robus_cmd_t; + +typedef enum +{ + // Protocol version + BASE_PROTOCOL = PROTOCOL_REVISION, + TIMESTAMP_PROTOCOL, +} robus_protocol_t; + +#endif /* _STRUCT_IO_H_ */ diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c index cf2de5387..d7fd42553 100644 --- a/engine/IO/src/filter.c +++ b/engine/IO/src/filter.c @@ -9,6 +9,7 @@ #include "luos_utils.h" #include "luos_hal.h" #include "service.h" +#include "struct_luos.h" /******************************************************************************* * Definitions @@ -161,10 +162,10 @@ _CRITICAL bool Filter_Topic(uint16_t topic_id) ******************************************************************************/ _CRITICAL bool Filter_Type(uint16_t type_id) { - // Check all ll_service type + // Check all service type for (int i = 0; i < Service_GetNumber(); i++) { - if (type_id == Service_GetTable()[i].ll_service->type) + if (type_id == Service_GetTable()[i].type) { return true; } diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 248b22fc1..202fffa65 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -32,7 +32,7 @@ * tasks at this space in memory and clear the memory space use by * msg_tasks or Luos_tasks. Also we have to prepare the reception of * the next header. - * - Event C : This event represent robus_loop and it is executed outside of IT. + * - Event C : This event represent phy_loop and it is executed outside of IT. * This event pull msg_tasks tasks and interpret all messages to * create one or more Luos_tasks. * - Task D : This is all msg trait by Luos Library interpret in Luos_loop. Msg can be @@ -45,12 +45,12 @@ #include #include #include -#include "robus_config.h" #include "msg_alloc.h" #include "luos_hal.h" #include "luos_utils.h" #include "node.h" #include "filter.h" +#include "struct_luos.h" /******************************************************************************* * Definitions @@ -65,16 +65,16 @@ ******************************************************************************/ typedef struct { - msg_t *msg_pt; /*!< Start pointer of the msg on msg_buffer. */ - ll_service_t *ll_service_pt; /*!< Pointer to the concerned ll_service. */ + msg_t *msg_pt; /*!< Start pointer of the msg on msg_buffer. */ + service_t *service_pt; /*!< Pointer to the concerned service. */ } luos_task_t; typedef struct { - uint8_t *data_pt; /*!< Start pointer of the data on msg_buffer. */ - uint16_t size; /*!< size of the data. */ - ll_service_t *ll_service_pt; /*!< Pointer to the transmitting ll_service. */ - uint8_t localhost; /*!< is this message a localhost one? */ + uint8_t *data_pt; /*!< Start pointer of the data on msg_buffer. */ + uint16_t size; /*!< size of the data. */ + service_t *service_pt; /*!< Pointer to the transmitting service. */ + uint8_t localhost; /*!< is this message a localhost one? */ } tx_task_t; /******************************************************************************* * Variables @@ -851,7 +851,7 @@ _CRITICAL static inline void MsgAlloc_ClearMsgTask(void) MsgAlloc_FindNewOldestMsg(); } /****************************************************************************** - * @brief Pull a message that is not interpreted by robus yet + * @brief Pull a message that is not interpreted by the phy yet * @param returned_msg : The message pointer. * @return error_return_t ******************************************************************************/ @@ -934,8 +934,8 @@ _CRITICAL static inline void MsgAlloc_ClearLuosTask(uint16_t luos_task_id) if (luos_tasks_stack_id != 0) { luos_tasks_stack_id--; - luos_tasks[luos_tasks_stack_id].msg_pt = 0; - luos_tasks[luos_tasks_stack_id].ll_service_pt = 0; + luos_tasks[luos_tasks_stack_id].msg_pt = 0; + luos_tasks[luos_tasks_stack_id].service_pt = 0; } LuosHAL_SetIrqState(true); MSGALLOC_MUTEX_UNLOCK @@ -947,7 +947,7 @@ _CRITICAL static inline void MsgAlloc_ClearLuosTask(uint16_t luos_task_id) * @param service_concerned_by_current_msg concerned msg * @return None ******************************************************************************/ -void MsgAlloc_LuosTaskAlloc(ll_service_t *service_concerned_by_current_msg, msg_t *concerned_msg) +void MsgAlloc_LuosTaskAlloc(service_t *service_concerned_by_current_msg, msg_t *concerned_msg) { // Find a free slot if (luos_tasks_stack_id == MAX_MSG_NB) @@ -964,8 +964,8 @@ void MsgAlloc_LuosTaskAlloc(ll_service_t *service_concerned_by_current_msg, msg_ MSGALLOC_MUTEX_LOCK LuosHAL_SetIrqState(false); LUOS_ASSERT(luos_tasks_stack_id < MAX_MSG_NB); - luos_tasks[luos_tasks_stack_id].msg_pt = concerned_msg; - luos_tasks[luos_tasks_stack_id].ll_service_pt = service_concerned_by_current_msg; + luos_tasks[luos_tasks_stack_id].msg_pt = concerned_msg; + luos_tasks[luos_tasks_stack_id].service_pt = service_concerned_by_current_msg; if (luos_tasks_stack_id == 0) { // This is the first message in the stack, so it could be the oldest one. @@ -992,7 +992,7 @@ void MsgAlloc_LuosTaskAlloc(ll_service_t *service_concerned_by_current_msg, msg_ * @param returned_msg : The message pointer. * @return error_return_t ******************************************************************************/ -error_return_t MsgAlloc_PullMsg(ll_service_t *target_service, msg_t **returned_msg) +error_return_t MsgAlloc_PullMsg(service_t *target_service, msg_t **returned_msg) { MsgAlloc_ValidDataIntegrity(); // @@ -1030,7 +1030,7 @@ error_return_t MsgAlloc_PullMsg(ll_service_t *target_service, msg_t **returned_m // find the oldest message allocated to this service for (uint16_t i = 0; i < luos_tasks_stack_id; i++) { - if (luos_tasks[i].ll_service_pt == target_service) + if (luos_tasks[i].service_pt == target_service) { *returned_msg = luos_tasks[i].msg_pt; // Clear the slot by sliding others to the left on it @@ -1120,7 +1120,7 @@ error_return_t MsgAlloc_PullMsgFromLuosTask(uint16_t luos_task_id, msg_t **retur * @param luos_task_id : Id of the allocator slot * @return error_return_t : Fail is there is no more message available. ******************************************************************************/ -error_return_t MsgAlloc_LookAtLuosTask(uint16_t luos_task_id, ll_service_t **allocated_service) +error_return_t MsgAlloc_LookAtLuosTask(uint16_t luos_task_id, service_t **allocated_service) { MsgAlloc_ValidDataIntegrity(); // @@ -1142,7 +1142,7 @@ error_return_t MsgAlloc_LookAtLuosTask(uint16_t luos_task_id, ll_service_t **all MSGALLOC_MUTEX_LOCK if (luos_task_id < luos_tasks_stack_id) { - *allocated_service = luos_tasks[luos_task_id].ll_service_pt; + *allocated_service = luos_tasks[luos_task_id].service_pt; MSGALLOC_MUTEX_UNLOCK return SUCCEED; } @@ -1375,7 +1375,7 @@ void MsgAlloc_ClearMsgFromLuosTasks(msg_t *msg) * @param size of the data to transmit * @return None ******************************************************************************/ -error_return_t MsgAlloc_SetTxTask(ll_service_t *ll_service_pt, uint8_t *data, uint16_t crc, uint16_t size, luos_localhost_t localhost, uint8_t ack) +error_return_t MsgAlloc_SetTxTask(service_t *service_pt, uint8_t *data, uint16_t crc, uint16_t size, luos_localhost_t localhost, uint8_t ack) { LUOS_ASSERT((tx_tasks_stack_id >= 0) && (tx_tasks_stack_id < MAX_MSG_NB) && ((uintptr_t)data > 0) && ((uintptr_t)current_msg < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE]) && ((uintptr_t)current_msg >= (uintptr_t)&msg_buffer[0])); void *rx_msg_bkp = 0; @@ -1641,10 +1641,10 @@ error_return_t MsgAlloc_SetTxTask(ll_service_t *ll_service_pt, uint8_t *data, ui // // Now we are ready to transmit, we can create the tx task LuosHAL_SetIrqState(false); - tx_tasks[tx_tasks_stack_id].size = size; - tx_tasks[tx_tasks_stack_id].data_pt = (uint8_t *)tx_msg; - tx_tasks[tx_tasks_stack_id].ll_service_pt = ll_service_pt; - tx_tasks[tx_tasks_stack_id].localhost = (localhost != EXTERNALHOST); + tx_tasks[tx_tasks_stack_id].size = size; + tx_tasks[tx_tasks_stack_id].data_pt = (uint8_t *)tx_msg; + tx_tasks[tx_tasks_stack_id].service_pt = service_pt; + tx_tasks[tx_tasks_stack_id].localhost = (localhost != EXTERNALHOST); tx_tasks_stack_id++; LUOS_ASSERT(tx_tasks_stack_id < MAX_MSG_NB); LuosHAL_SetIrqState(true); @@ -1810,14 +1810,14 @@ void MsgAlloc_PullServiceFromTxTask(uint16_t service_id) } /****************************************************************************** * @brief return a message to transmit - * @param ll_service_pt service sending this data + * @param service_pt service sending this data * @param data to send * @param size of the data to send * @param localhost is this message a localhost one * @return error_return_t : Fail is there is no more message available. * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL error_return_t MsgAlloc_GetTxTask(ll_service_t **ll_service_pt, uint8_t **data, uint16_t *size, uint8_t *localhost) +_CRITICAL error_return_t MsgAlloc_GetTxTask(service_t **service_pt, uint8_t **data, uint16_t *size, uint8_t *localhost) { LUOS_ASSERT(tx_tasks_stack_id < MAX_MSG_NB); MsgAlloc_ValidDataIntegrity(); @@ -1838,10 +1838,10 @@ _CRITICAL error_return_t MsgAlloc_GetTxTask(ll_service_t **ll_service_pt, uint8_ LuosHAL_SetIrqState(false); if (tx_tasks_stack_id > 0) { - *data = tx_tasks[0].data_pt; - *size = tx_tasks[0].size; - *ll_service_pt = tx_tasks[0].ll_service_pt; - *localhost = tx_tasks[0].localhost; + *data = tx_tasks[0].data_pt; + *size = tx_tasks[0].size; + *service_pt = tx_tasks[0].service_pt; + *localhost = tx_tasks[0].localhost; LuosHAL_SetIrqState(true); return SUCCEED; } diff --git a/engine/OD/od_linear.h b/engine/OD/od_linear.h index 95752f7a4..aac85d89a 100644 --- a/engine/OD/od_linear.h +++ b/engine/OD/od_linear.h @@ -7,7 +7,7 @@ #ifndef OD_OD_LINEAR_H_ #define OD_OD_LINEAR_H_ -#include "io_struct.h" +#include "struct_io.h" #include "string.h" /******************************************************************************* diff --git a/engine/bootloader/bootloader_core.h b/engine/bootloader/bootloader_core.h index d15fc0fc1..2ee7bab12 100644 --- a/engine/bootloader/bootloader_core.h +++ b/engine/bootloader/bootloader_core.h @@ -7,7 +7,7 @@ #ifndef BOOTLOADER_H #define BOOTLOADER_H -#include "io_struct.h" +#include "struct_luos.h" /******************************************************************************* * Definitions diff --git a/engine/core/inc/luos_engine.h b/engine/core/inc/luos_engine.h index 668676d34..b16056c66 100644 --- a/engine/core/inc/luos_engine.h +++ b/engine/core/inc/luos_engine.h @@ -6,9 +6,11 @@ #ifndef LUOS_ENGINE_H #define LUOS_ENGINE_H +#include +#include #include "luos_utils.h" #include "luos_list.h" -#include "service_structs.h" +#include "struct_luos.h" #include "routing_table.h" #include "luos_od.h" diff --git a/engine/core/inc/luos_list.h b/engine/core/inc/luos_list.h index 579794d84..c2f8e20c7 100644 --- a/engine/core/inc/luos_list.h +++ b/engine/core/inc/luos_list.h @@ -7,7 +7,7 @@ #ifndef LUOS_LIST_H #define LUOS_LIST_H -#include "service_structs.h" +#include "engine_config.h" /******************************************************************************* * Definitions diff --git a/engine/core/inc/pub_sub.h b/engine/core/inc/pub_sub.h index 5da77ece1..6b1402273 100644 --- a/engine/core/inc/pub_sub.h +++ b/engine/core/inc/pub_sub.h @@ -7,11 +7,11 @@ #ifndef _PUB_SUB_H_ #define _PUB_SUB_H_ -#include "context.h" +#include "struct_luos.h" /******************************************************************************* * Function ******************************************************************************/ -uint8_t PubSub_IsTopicSubscribed(ll_service_t *ll_service, uint16_t topic_id); +uint8_t PubSub_IsTopicSubscribed(service_t *service, uint16_t topic_id); #endif /* _PUB_SUB_H_ */ diff --git a/engine/core/inc/routing_table.h b/engine/core/inc/routing_table.h index e912eb260..055feeeb9 100644 --- a/engine/core/inc/routing_table.h +++ b/engine/core/inc/routing_table.h @@ -7,7 +7,8 @@ #ifndef TABLE #define TABLE -#include "luos_engine.h" +#include "struct_luos.h" +#include "luos_list.h" #include "node.h" /******************************************************************************* * Definitions diff --git a/engine/core/inc/service.h b/engine/core/inc/service.h index 7ff844ebb..db19c5198 100644 --- a/engine/core/inc/service.h +++ b/engine/core/inc/service.h @@ -7,7 +7,7 @@ #ifndef _SERVICE_H_ #define _SERVICE_H_ -#include "service_structs.h" +#include "struct_luos.h" /******************************************************************************* * Function @@ -18,12 +18,11 @@ uint16_t Service_GetNumber(void); void Service_ResetStatistics(void); void Service_GenerateId(uint16_t base_id); void Service_ClearId(void); -service_t *Service_GetService(ll_service_t *ll_service); uint16_t Service_GetIndex(service_t *service); void Service_AutoUpdateManager(void); // IO related functions -ll_service_t *Service_GetConcerned(header_t *header); +service_t *Service_GetConcerned(header_t *header); void Service_AllocMsg(msg_t *msg); #endif /* _SERVICE_H_ */ diff --git a/engine/core/inc/streaming.h b/engine/core/inc/streaming.h index 03c503f01..4c3e6eea8 100644 --- a/engine/core/inc/streaming.h +++ b/engine/core/inc/streaming.h @@ -15,9 +15,9 @@ ******************************************************************************/ #ifndef STREAMING_H #define STREAMING_H -#include "service_structs.h" #include + /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/engine/core/inc/struct_engine.h b/engine/core/inc/struct_engine.h new file mode 100644 index 000000000..982239f0b --- /dev/null +++ b/engine/core/inc/struct_engine.h @@ -0,0 +1,27 @@ +/****************************************************************************** + * @file engine structures + * @brief describe all engine private related structures + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef __ENGINE_STRUCT_H +#define __ENGINE_STRUCT_H + +#include +#include "struct_io.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/****************************************************************************** + * This structure is used to manage packages + * please refer to the documentation + ******************************************************************************/ +typedef struct +{ + void (*Init)(void); + void (*Loop)(void); +} package_t; + +#endif /*__ENGINE_STRUCT_H */ diff --git a/engine/core/inc/service_structs.h b/engine/core/inc/struct_luos.h similarity index 60% rename from engine/core/inc/service_structs.h rename to engine/core/inc/struct_luos.h index a5ccc3c83..c102c23b7 100644 --- a/engine/core/inc/service_structs.h +++ b/engine/core/inc/struct_luos.h @@ -1,71 +1,91 @@ /****************************************************************************** - * @file services structures - * @brief describe all the service related structures + * @file luos structures + * @brief describe all core structures * @author Luos * @version 0.0.0 ******************************************************************************/ -#ifndef __SERVICE_STRUCT_H -#define __SERVICE_STRUCT_H +#ifndef __LUOS_STRUCT_H +#define __LUOS_STRUCT_H -#include -#include "robus.h" +#include "engine_config.h" +#include "struct_stat.h" +#include "struct_utils.h" /******************************************************************************* * Definitions ******************************************************************************/ /****************************************************************************** - * store informations about luos stats + * This enum list all CMD reserved to Luos * please refer to the documentation ******************************************************************************/ -typedef struct __attribute__((__packed__)) +typedef enum { - union - { - struct __attribute__((__packed__)) - { - memory_stats_t memory; - uint8_t max_loop_time_ms; - }; - uint8_t unmap[sizeof(memory_stats_t) + 1]; /*!< streamable form. */ - }; -} luos_stats_t; + // Luos specific registers + LOCAL_RTB = ROBUS_PROTOCOL_NB, // Ask(size == 0), generate(size == 2) a local routing_table. + RTB, // Receive a routing_table. + WRITE_ALIAS, // Get and save a new given alias. + UPDATE_PUB, // Ask to update a sensor value each time duration to the sender + ASK_DETECTION, // Ask Luos to launch a detection + + // Revision management + REVISION, // service sends its firmware revision + LUOS_REVISION, // service sends its luos revision + LUOS_STATISTICS, // service sends its luos revision + + // bootloader command and response + BOOTLOADER_CMD, + BOOTLOADER_RESP, + + // Verbose command + VERBOSE, + + // compatibility area + // LUOS_LAST_RESERVED_CMD = 42 +} reserved_luos_cmd_t; + /****************************************************************************** - * This structure is used to create services version - * please refer to the documentation + * @enum target_mode_t + * @brief This enum list all target mode. ******************************************************************************/ -typedef struct __attribute__((__packed__)) +typedef enum { - union - { - struct __attribute__((__packed__)) - { - uint8_t major; - uint8_t minor; - uint8_t build; - }; - uint8_t unmap[3]; /*!< streamable form. */ - }; -} revision_t; + SERVICEID, /*!< Unique or virtual ID, used to send something to only one service. */ + SERVICEIDACK, /*!< Unique or virtual ID with reception Acknoledgment (ACK). */ + TYPE, /*!< Type mode, used to send something to all service of the same type. */ + BROADCAST, /*!< Broadcast mode, used to send something to everybody. */ + TOPIC, /*!< Multicast mode, used to send something to multiple services. */ + NODEID, /*!< Node mode, used to send something to all services of a node. */ + NODEIDACK, /*!< Node mode with reception Acknoledgment (ACK). */ + + ID = SERVICEID, /*!< This define is deprecated, please use SERVICEID instead. */ + IDACK = SERVICEIDACK /*!< This define is deprecated, please use SERVICEIDACK instead. */ +} target_mode_t; + /****************************************************************************** - * This structure is used to manage services statistic - * please refer to the documentation + * @struct header_t + * @brief This structure is used specify data and destination of datas. ******************************************************************************/ -typedef struct __attribute__((__packed__)) service_stats_t +typedef struct __attribute__((__packed__)) { union { struct __attribute__((__packed__)) { - uint8_t max_retry; + uint16_t config : 4; /*!< Protocol version. */ + uint16_t target : 12; /*!< Target address, it can be (ID, Multicast/Broadcast, Type). */ + uint16_t target_mode : 4; /*!< Select targeting mode (ID, ID+ACK, Multicast/Broadcast, Type). */ + uint16_t source : 12; /*!< Source address, it can be (ID, Multicast/Broadcast, Type). */ + uint8_t cmd; /*!< msg definition. */ + uint16_t size; /*!< Size of the data field. */ }; - uint8_t unmap[1]; /*!< streamable form. */ + uint8_t unmap[7]; /*!< Unmaped form. */ }; -} service_stats_t; +} header_t; /****************************************************************************** - * @struct general_stats_t - * @brief format all datas to be sent trough msg + * @struct msg_t + * @brief Message structure ******************************************************************************/ typedef struct __attribute__((__packed__)) { @@ -73,12 +93,12 @@ typedef struct __attribute__((__packed__)) { struct __attribute__((__packed__)) { - luos_stats_t node_stat; - service_stats_t service_stat; + header_t header; /*!< Header filed. */ + uint8_t data[MAX_DATA_MSG_SIZE]; /*!< Data with size known. */ }; - uint8_t unmap[sizeof(luos_stats_t) + sizeof(service_stats_t)]; /*!< streamable form. */ + uint8_t stream[sizeof(header_t) + MAX_DATA_MSG_SIZE]; /*!< unmaped option. */ }; -} general_stats_t; +} msg_t; /****************************************************************************** * This structure is used to manage services timed auto update @@ -104,63 +124,52 @@ typedef enum } access_t; /****************************************************************************** - * This structure is used to manage packages + * This structure is used to create services version * please refer to the documentation ******************************************************************************/ -typedef struct +typedef struct __attribute__((__packed__)) { - void (*Init)(void); - void (*Loop)(void); -} package_t; + union + { + struct __attribute__((__packed__)) + { + uint8_t major; + uint8_t minor; + uint8_t build; + }; + uint8_t unmap[3]; /*!< streamable form. */ + }; +} revision_t; /****************************************************************************** * This structure is used to manage services * please refer to the documentation ******************************************************************************/ -typedef struct __attribute__((__packed__)) service_t +typedef struct service_t { - ll_service_t *ll_service; - // Callback - void (*service_cb)(struct service_t *service, msg_t *msg); - // Variables + // Service infomations + uint16_t id; /*!< Service ID. */ + uint16_t type; /*!< Service type. */ uint8_t default_alias[MAX_ALIAS_SIZE]; /*!< service default alias. */ uint8_t alias[MAX_ALIAS_SIZE]; /*!< service alias. */ - timed_update_t auto_refresh; /*!< service auto refresh context. */ revision_t revision; /*!< service firmware version. */ - service_stats_t statistics; /*!< service level statistics. */ access_t access; /*!< service read write access. */ - void *profile_context; /*!< Pointer to the profile context. */ -} service_t; + uint16_t dead_service_spotted; /*!< The ID of a service that don't reply to a lot of ACK msg */ -typedef void (*SERVICE_CB)(service_t *service, msg_t *msg); - -/****************************************************************************** - * This enum list all CMD reserved to Luos - * please refer to the documentation - ******************************************************************************/ -typedef enum -{ - // Luos specific registers - LOCAL_RTB = ROBUS_PROTOCOL_NB, // Ask(size == 0), generate(size == 2) a local routing_table. - RTB, // Receive a routing_table. - WRITE_ALIAS, // Get and save a new given alias. - UPDATE_PUB, // Ask to update a sensor value each time duration to the sender - ASK_DETECTION, // Ask Luos to launch a detection + // Callback + void (*service_cb)(struct service_t *service, msg_t *msg); - // Revision management - REVISION, // service sends its firmware revision - LUOS_REVISION, // service sends its luos revision - LUOS_STATISTICS, // service sends its luos revision + // Statistics + service_stats_t statistics; /*!< service level statistics. */ - // bootloader command and response - BOOTLOADER_CMD, - BOOTLOADER_RESP, + // Private Variables + uint16_t last_topic_position; /*!< Position pointer of the last topic added. */ + uint16_t topic_list[LAST_TOPIC]; /*!< multicast target bank. */ + timed_update_t auto_refresh; /*!< service auto refresh context. */ + void *profile_context; /*!< Pointer to the profile context. */ - // Verbose command - VERBOSE, +} service_t; - // compatibility area - LUOS_LAST_RESERVED_CMD = 42 -} reserved_luos_cmd_t; +typedef void (*SERVICE_CB)(service_t *service, msg_t *msg); -#endif /*__SERVICE_STRUCT_H */ +#endif /*__LUOS_STRUCT_H */ \ No newline at end of file diff --git a/engine/core/inc/struct_stat.h b/engine/core/inc/struct_stat.h new file mode 100644 index 000000000..7b82783d2 --- /dev/null +++ b/engine/core/inc/struct_stat.h @@ -0,0 +1,78 @@ +/****************************************************************************** + * @file stat structures + * @brief describe all the statistics related structures + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef __STAT_STRUCT_H +#define __STAT_STRUCT_H + +#include + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/****************************************************************************** + * @struct memory_stats_t + * @brief store informations about RAM occupation + ******************************************************************************/ +typedef struct __attribute__((__packed__)) +{ + uint8_t rx_msg_stack_ratio; + uint8_t engine_msg_stack_ratio; + uint8_t tx_msg_stack_ratio; + uint8_t buffer_occupation_ratio; + uint8_t msg_drop_number; +} memory_stats_t; + +/****************************************************************************** + * store informations about luos stats + * please refer to the documentation + ******************************************************************************/ +typedef struct __attribute__((__packed__)) +{ + union + { + struct __attribute__((__packed__)) + { + memory_stats_t memory; + uint8_t max_loop_time_ms; + }; + uint8_t unmap[sizeof(memory_stats_t) + 1]; /*!< streamable form. */ + }; +} luos_stats_t; +/****************************************************************************** + * This structure is used to manage services statistic + * please refer to the documentation + ******************************************************************************/ +typedef struct __attribute__((__packed__)) service_stats_t +{ + union + { + struct __attribute__((__packed__)) + { + uint8_t max_retry; + }; + uint8_t unmap[1]; /*!< streamable form. */ + }; +} service_stats_t; + +/****************************************************************************** + * @struct general_stats_t + * @brief format all datas to be sent trough msg + ******************************************************************************/ +typedef struct __attribute__((__packed__)) +{ + union + { + struct __attribute__((__packed__)) + { + luos_stats_t node_stat; + service_stats_t service_stat; + }; + uint8_t unmap[sizeof(luos_stats_t) + sizeof(service_stats_t)]; /*!< streamable form. */ + }; +} general_stats_t; + +#endif /*__STAT_STRUCT_H */ diff --git a/engine/core/inc/struct_utils.h b/engine/core/inc/struct_utils.h new file mode 100644 index 000000000..fc8e9a841 --- /dev/null +++ b/engine/core/inc/struct_utils.h @@ -0,0 +1,27 @@ +/****************************************************************************** + * @file utils structures + * @brief describe practical general structures used by Luos + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef __STRUCT_UTILS_H +#define __STRUCT_UTILS_H + +#include + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/****************************************************************************** + * @struct error_return_t + * @brief Return function error global convention + ******************************************************************************/ +typedef enum +{ + SUCCEED, /*!< function work properly. */ + PROHIBITED, /*!< function usage is currently prohibited. */ + FAILED = 0xFF /*!< function fail. */ +} error_return_t; + +#endif /*__STRUCT_UTILS_H */ diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index d07a6d2a5..c812f0991 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -13,8 +13,8 @@ #include "bootloader_core.h" #include "_timestamp.h" #include "filter.h" -#include "context.h" #include "service.h" +#include "struct_engine.h" /******************************************************************************* * Variables @@ -68,9 +68,9 @@ void Luos_Init(void) void Luos_Loop(void) { static uint32_t last_loop_date; - uint16_t remaining_msg_number = 0; - ll_service_t *oldest_ll_service = NULL; - msg_t *returned_msg = NULL; + uint16_t remaining_msg_number = 0; + service_t *oldest_service = NULL; + msg_t *returned_msg = NULL; #ifdef WITH_BOOTLOADER // After 3 Luos_Loop, consider this application as safe and write a flag to let the booloader know it can jump to the application safely. @@ -94,22 +94,16 @@ void Luos_Loop(void) { // We receive a reset detection // Reset services ID - // Reinit ll_service id - for (uint8_t i = 0; i < ctx.ll_service_number; i++) - { - ctx.ll_service_table[i].id = DEFAULTID; - } + Service_ClearId(); // Reset the data reception context Luos_ReceiveData(NULL, NULL, NULL); } Robus_Loop(); // look at all received messages LUOS_MUTEX_LOCK - while (MsgAlloc_LookAtLuosTask(remaining_msg_number, &oldest_ll_service) != FAILED) + while (MsgAlloc_LookAtLuosTask(remaining_msg_number, &oldest_service) != FAILED) { - // There is a message available find the service linked to it - service_t *service = Service_GetService(oldest_ll_service); - // check if this is a Luos Command + // There is a message available, check if this is a Luos Command uint8_t cmd = 0; uint16_t size = 0; // There is a possibility to receive in IT a START_DETECTION so check task before doing any treatement @@ -118,12 +112,12 @@ void Luos_Loop(void) break; } // check if this msg cmd should be consumed by Luos_MsgHandler - if (Luos_IsALuosCmd(service, cmd, size) == SUCCEED) + if (Luos_IsALuosCmd(oldest_service, cmd, size) == SUCCEED) { if (MsgAlloc_PullMsgFromLuosTask(remaining_msg_number, &returned_msg) == SUCCEED) { // be sure the content of this message need to be managed by Luos and do it if it is. - if (Luos_MsgHandler((service_t *)service, returned_msg) == SUCCEED) + if (Luos_MsgHandler((service_t *)oldest_service, returned_msg) == SUCCEED) { // Luos CMD are generic for all services and have to be executed only once // Clear all luos tasks related to this message (in case of multicast message) @@ -132,9 +126,9 @@ void Luos_Loop(void) else { // Here we should not have polling services. - LUOS_ASSERT(service->service_cb != 0); + LUOS_ASSERT(oldest_service->service_cb != 0); // This message is for the user, pass it to the user. - service->service_cb(service, returned_msg); + oldest_service->service_cb(oldest_service, returned_msg); } } } @@ -142,13 +136,13 @@ void Luos_Loop(void) { // This message is for a service // check if this service have a callback? - if (service->service_cb != 0) + if (oldest_service->service_cb != 0) { // This service have a callback pull the message if (MsgAlloc_PullMsgFromLuosTask(remaining_msg_number, &returned_msg) == SUCCEED) { // This message is for the user, pass it to the user. - service->service_cb(service, returned_msg); + oldest_service->service_cb(oldest_service, returned_msg); } } else @@ -259,7 +253,7 @@ static error_return_t Luos_MsgHandler(service_t *service, msg_t *input) time_luos_t time; uint16_t base_id = 0; - if (((input->header.target_mode == SERVICEIDACK) || (input->header.target_mode == SERVICEID)) && (input->header.target != service->ll_service->id)) + if (((input->header.target_mode == SERVICEIDACK) || (input->header.target_mode == SERVICEID)) && (input->header.target != service->id)) { return FAILED; } @@ -448,13 +442,13 @@ static error_return_t Luos_Send(service_t *service, msg_t *msg) // There is no service specified here, take the first one service = &Service_GetTable()[0]; } - if ((service->ll_service->id == 0) && (msg->header.cmd >= LUOS_LAST_RESERVED_CMD)) + if ((service->id == 0) && (msg->header.cmd >= LUOS_LAST_RESERVED_CMD)) { // We are in detection mode and this command come from user // We can't send it return PROHIBITED; } - return Robus_SendMsg(service->ll_service, msg); + return Robus_SendMsg(service, msg); } /****************************************************************************** @@ -469,7 +463,7 @@ error_return_t Luos_ReadMsg(service_t *service, msg_t **returned_msg) LUOS_MUTEX_LOCK while (error == SUCCEED) { - error = MsgAlloc_PullMsg(service->ll_service, returned_msg); + error = MsgAlloc_PullMsg(service, returned_msg); // check if the content of this message need to be managed by Luos and do it if it is. if (error == SUCCEED) { @@ -494,14 +488,14 @@ error_return_t Luos_ReadMsg(service_t *service, msg_t **returned_msg) ******************************************************************************/ error_return_t Luos_ReadFromService(service_t *service, short id, msg_t **returned_msg) { - uint16_t remaining_msg_number = 0; - ll_service_t *oldest_ll_service = NULL; - error_return_t error = SUCCEED; + uint16_t remaining_msg_number = 0; + service_t *oldest_service = NULL; + error_return_t error = SUCCEED; LUOS_MUTEX_LOCK - while (MsgAlloc_LookAtLuosTask(remaining_msg_number, &oldest_ll_service) != FAILED) + while (MsgAlloc_LookAtLuosTask(remaining_msg_number, &oldest_service) != FAILED) { // Check if this message is for us - if (oldest_ll_service == service->ll_service) + if (oldest_service == service) { // Check the source id uint16_t source = 0; @@ -783,7 +777,7 @@ void Luos_Detect(service_t *service) { Filter_IdInit(); // Set the detection launcher id to 1 - service->ll_service->id = 1; + service->id = 1; // Update the filter just to accept our detector id Filter_AddServiceId(1, 1); diff --git a/engine/core/src/luos_utils.c b/engine/core/src/luos_utils.c index 91064b0fe..74191c68b 100644 --- a/engine/core/src/luos_utils.c +++ b/engine/core/src/luos_utils.c @@ -1,5 +1,5 @@ /****************************************************************************** - * @file robus_utils + * @file luos_utils * @brief Some tools used to debug * @author Luos * @version 0.0.0 @@ -10,7 +10,7 @@ #include "string.h" #include "luos_hal.h" #include "msg_alloc.h" -#include "stdbool.h" +#include #ifdef WITH_BOOTLOADER #include "bootloader_core.h" #endif diff --git a/engine/core/src/node.c b/engine/core/src/node.c index e031b575f..d1fabf312 100644 --- a/engine/core/src/node.c +++ b/engine/core/src/node.c @@ -64,6 +64,7 @@ void Node_Init(void) #ifdef NO_RTB node_ctx.node_info |= 1 << 0; #endif + Node_SetState(NO_DETECTION); } /****************************************************************************** diff --git a/engine/core/src/pub_sub.c b/engine/core/src/pub_sub.c index 584515f33..60d134df4 100644 --- a/engine/core/src/pub_sub.c +++ b/engine/core/src/pub_sub.c @@ -28,12 +28,12 @@ * @param multicast bank * @return Error ******************************************************************************/ -uint8_t PubSub_IsTopicSubscribed(ll_service_t *ll_service, uint16_t topic_id) +uint8_t PubSub_IsTopicSubscribed(service_t *service, uint16_t topic_id) { unsigned char i; - for (i = 0; i < ll_service->last_topic_position; i++) + for (i = 0; i < service->last_topic_position; i++) { - if (ll_service->topic_list[i] == topic_id) + if (service->topic_list[i] == topic_id) return true; } return false; @@ -49,22 +49,16 @@ error_return_t Luos_Subscribe(service_t *service, uint16_t topic) { // Assert if we add a topic that is greater than the max topic value LUOS_ASSERT(topic <= LAST_TOPIC); + LUOS_ASSERT(service != 0); // Put this topic in the multicast bank Filter_AddTopic(topic); - // add multicast this topic to the service - ll_service_t *ll_service = (ll_service_t *)&ctx.ll_service_table[0]; - if (service != 0) - { - ll_service = service->ll_service; - } - // Check if target exists or if we reached the maximum topics number - if ((PubSub_IsTopicSubscribed(ll_service, topic) == false) && (ll_service->last_topic_position < LAST_TOPIC)) + if ((PubSub_IsTopicSubscribed(service, topic) == false) && (service->last_topic_position < LAST_TOPIC)) { - ll_service->topic_list[ll_service->last_topic_position] = topic; - ll_service->last_topic_position++; + service->topic_list[service->last_topic_position] = topic; + service->last_topic_position++; return SUCCEED; } return FAILED; @@ -78,24 +72,21 @@ error_return_t Luos_Subscribe(service_t *service, uint16_t topic) ******************************************************************************/ error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic) { - error_return_t err = FAILED; - ll_service_t *ll_service = (ll_service_t *)&ctx.ll_service_table[0]; - unsigned char i; - if (service != 0) - { - ll_service = service->ll_service; - } + LUOS_ASSERT(topic <= LAST_TOPIC); + LUOS_ASSERT(service != 0); + + error_return_t err = FAILED; // Delete topic from service list - for (i = 0; i < ll_service->last_topic_position; i++) + for (uint16_t i = 0; i < service->last_topic_position; i++) { - if (ll_service->topic_list[i] == topic) + if (service->topic_list[i] == topic) { - if (ll_service->last_topic_position >= LAST_TOPIC) + if (service->last_topic_position >= LAST_TOPIC) { break; } - memcpy(&ll_service->topic_list[i], &ll_service->topic_list[i + 1], ll_service->last_topic_position - i); - ll_service->last_topic_position--; + memcpy(&service->topic_list[i], &service->topic_list[i + 1], service->last_topic_position - i); + service->last_topic_position--; err = SUCCEED; break; } @@ -106,7 +97,7 @@ error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic) { for (uint16_t i = 0; i < Service_GetNumber(); i++) { - if (PubSub_IsTopicSubscribed((ll_service_t *)(&ctx.ll_service_table[i]), topic) == true) + if (PubSub_IsTopicSubscribed(&Service_GetTable()[i], topic) == true) { return err; } diff --git a/engine/core/src/routing_table.c b/engine/core/src/routing_table.c index 4684e199e..f242e7999 100644 --- a/engine/core/src/routing_table.c +++ b/engine/core/src/routing_table.c @@ -11,7 +11,9 @@ #include #include #include "luos_hal.h" -#include "context.h" +#include "luos_engine.h" +#include "struct_engine.h" +#include "robus.h" /******************************************************************************* * Definitions @@ -365,7 +367,7 @@ void RoutingTB_DetectServices(service_t *service) // Desactivate verbose mode Luos_SetVerboseMode(false); // Starts the topology detection. - uint16_t nb_node = Robus_TopologyDetection(service->ll_service); + uint16_t nb_node = Robus_TopologyDetection(service); // Clear data reception state Luos_ReceiveData(NULL, NULL, NULL); // Clear the routing table. @@ -401,8 +403,8 @@ void RoutingTB_ConvertNodeToRoutingTable(routing_table_t *entry, node_t *node) ******************************************************************************/ void RoutingTB_ConvertServiceToRoutingTable(routing_table_t *entry, service_t *service) { - entry->type = service->ll_service->type; - entry->id = service->ll_service->id; + entry->type = service->type; + entry->id = service->id; entry->mode = SERVICE; for (uint8_t i = 0; i < MAX_ALIAS_SIZE; i++) { @@ -680,7 +682,7 @@ search_result_t *RTFilter_Service(search_result_t *result, service_t *service) while (entry_nbr < result->result_nbr) { // find a service with the wanted type - if (result->result_table[entry_nbr]->id != service->ll_service->id) + if (result->result_table[entry_nbr]->id != service->id) { // if we find an other id, erase it from the research table memcpy(&result->result_table[entry_nbr], &result->result_table[entry_nbr + 1], sizeof(routing_table_t *) * (result->result_nbr - entry_nbr)); diff --git a/engine/core/src/service.c b/engine/core/src/service.c index dbddfeed1..4ca6a4084 100644 --- a/engine/core/src/service.c +++ b/engine/core/src/service.c @@ -13,6 +13,7 @@ #include "luos_hal.h" #include "msg_alloc.h" #include "pub_sub.h" +#include "robus.h" /******************************************************************************* * Definitions @@ -93,9 +94,9 @@ void Service_GenerateId(uint16_t base_id) } for (uint16_t i = 0; i < service_ctx.number; i++) { - if (service_ctx.list[i].ll_service->id != 1) + if (service_ctx.list[i].id != 1) { - service_ctx.list[i].ll_service->id = base_id++; + service_ctx.list[i].id = base_id++; } } } @@ -108,27 +109,10 @@ void Service_ClearId(void) { for (uint16_t i = 0; i < service_ctx.number; i++) { - service_ctx.list[i].ll_service->id = DEFAULTID; + service_ctx.list[i].id = DEFAULTID; } } -/****************************************************************************** - * @brief Get pointer to a service based on ll_service - * @param ll_service : low level service - * @return Service from list - ******************************************************************************/ -service_t *Service_GetService(ll_service_t *ll_service) -{ - for (uint16_t i = 0; i < service_ctx.number; i++) - { - if (ll_service == service_ctx.list[i].ll_service) - { - return &service_ctx.list[i]; - } - } - return 0; -} - /****************************************************************************** * @brief Get this service index in the service table * @param Service @@ -157,7 +141,7 @@ void Service_AutoUpdateManager(void) for (uint16_t i = 0; i < service_ctx.number; i++) { // check if services have an actual ID. If not, we are in detection mode and should reset the auto refresh - if (service_ctx.list[i].ll_service->id == DEFAULTID) + if (service_ctx.list[i].id == DEFAULTID) { // this service have not been detected or is in detection mode. remove auto_refresh parameters service_ctx.list[i].auto_refresh.target = 0; @@ -169,7 +153,7 @@ void Service_AutoUpdateManager(void) // check if there is a timed update setted and if it's time to update it. if (service_ctx.list[i].auto_refresh.time_ms) { - if (service_ctx.list[i].ll_service->dead_service_spotted == service_ctx.list[i].auto_refresh.target) + if (service_ctx.list[i].dead_service_spotted == service_ctx.list[i].auto_refresh.target) { service_ctx.list[i].auto_refresh.target = 0; service_ctx.list[i].auto_refresh.time_ms = 0; @@ -182,7 +166,7 @@ void Service_AutoUpdateManager(void) // Create a fake message for it from the service asking for update msg_t updt_msg; updt_msg.header.config = BASE_PROTOCOL; - updt_msg.header.target = service_ctx.list[i].ll_service->id; + updt_msg.header.target = service_ctx.list[i].id; updt_msg.header.source = service_ctx.list[i].auto_refresh.target; updt_msg.header.target_mode = SERVICEIDACK; updt_msg.header.cmd = GET_CMD; @@ -195,8 +179,8 @@ void Service_AutoUpdateManager(void) { if (Node_GetState() == DETECTION_OK) { - // directly transmit the message in Localhost - Robus_SetTxTask(service_ctx.list[i].ll_service, &updt_msg); + // Directly transmit the message in Localhost + Robus_SetTxTask(&service_ctx.list[i], &updt_msg); } } service_ctx.list[i].auto_refresh.last_update = LuosHAL_GetSystick(); @@ -209,9 +193,9 @@ void Service_AutoUpdateManager(void) /****************************************************************************** * @brief Parse msg to find a service concerned * @param header of message - * @return ll_service pointer + * @return service pointer ******************************************************************************/ -ll_service_t *Service_GetConcerned(header_t *header) +service_t *Service_GetConcerned(header_t *header) { uint16_t i = 0; LUOS_ASSERT(header); @@ -220,29 +204,29 @@ ll_service_t *Service_GetConcerned(header_t *header) { case SERVICEIDACK: case SERVICEID: - // Check all ll_service id + // Check all service id for (i = 0; i < service_ctx.number; i++) { - if (header->target == service_ctx.list[i].ll_service->id) + if (header->target == service_ctx.list[i].id) { - return service_ctx.list[i].ll_service; + return &service_ctx.list[i]; } } break; case TYPE: - // Check all ll_service type + // Check all service type for (i = 0; i < service_ctx.number; i++) { - if (header->target == service_ctx.list[i].ll_service->type) + if (header->target == service_ctx.list[i].type) { - return service_ctx.list[i].ll_service; + return &service_ctx.list[i]; } } break; case BROADCAST: case NODEIDACK: case NODEID: - return service_ctx.list[0].ll_service; + return &service_ctx.list[0]; break; case TOPIC: default: @@ -266,24 +250,24 @@ void Service_AllocMsg(msg_t *msg) { case SERVICEIDACK: case SERVICEID: - // Check all ll_service id + // Check all service id for (i = 0; i < service_ctx.number; i++) { - if (msg->header.target == service_ctx.list[i].ll_service->id) + if (msg->header.target == service_ctx.list[i].id) { - MsgAlloc_LuosTaskAlloc(service_ctx.list[i].ll_service, msg); + MsgAlloc_LuosTaskAlloc(&service_ctx.list[i], msg); break; } } return; break; case TYPE: - // Check all ll_service type + // Check all service type for (i = 0; i < service_ctx.number; i++) { - if (msg->header.target == service_ctx.list[i].ll_service->type) + if (msg->header.target == service_ctx.list[i].type) { - MsgAlloc_LuosTaskAlloc(service_ctx.list[i].ll_service, msg); + MsgAlloc_LuosTaskAlloc(&service_ctx.list[i], msg); } } return; @@ -291,17 +275,17 @@ void Service_AllocMsg(msg_t *msg) case BROADCAST: for (i = 0; i < service_ctx.number; i++) { - MsgAlloc_LuosTaskAlloc(service_ctx.list[i].ll_service, msg); + MsgAlloc_LuosTaskAlloc(&service_ctx.list[i], msg); } return; break; case TOPIC: for (i = 0; i < service_ctx.number; i++) { - if (PubSub_IsTopicSubscribed(service_ctx.list[i].ll_service, msg->header.target)) + if (PubSub_IsTopicSubscribed(&service_ctx.list[i], msg->header.target)) { // TODO manage multiple slave concerned - MsgAlloc_LuosTaskAlloc(service_ctx.list[i].ll_service, msg); + MsgAlloc_LuosTaskAlloc(&service_ctx.list[i], msg); } } return; @@ -310,7 +294,7 @@ void Service_AllocMsg(msg_t *msg) case NODEID: if (msg->header.target == DEFAULTID) // on default ID it's always a luos command create only one task { - MsgAlloc_LuosTaskAlloc((ll_service_t *)&ctx.ll_service_table[0], msg); + MsgAlloc_LuosTaskAlloc(&service_ctx.list[0], msg); return; } // check if the message is really for the node or it is a service that has no filter @@ -318,7 +302,7 @@ void Service_AllocMsg(msg_t *msg) { for (i = 0; i < service_ctx.number; i++) { - MsgAlloc_LuosTaskAlloc(service_ctx.list[i].ll_service, msg); + MsgAlloc_LuosTaskAlloc(&service_ctx.list[i], msg); } } return; @@ -338,23 +322,22 @@ void Service_AllocMsg(msg_t *msg) ******************************************************************************/ service_t *Luos_CreateService(SERVICE_CB service_cb, uint8_t type, const char *alias, revision_t revision) { - uint8_t i = 0; - service_t *service = &service_ctx.list[service_ctx.number]; - service->ll_service = &Robus_GetLlServiceList()[service_ctx.number]; + uint8_t i = 0; + service_t *service = &service_ctx.list[service_ctx.number]; // Set the service type - service->ll_service->type = type; + service->type = type; // Initialise the service id, TODO the ID could be stored in EEprom, the default ID could be set in factory... - service->ll_service->id = DEFAULTID; + service->id = DEFAULTID; // Initialize dead service detection - service->ll_service->dead_service_spotted = 0; + service->dead_service_spotted = 0; // Clear stats - service->ll_service->ll_stat.max_retry = 0; + service->statistics.max_retry = 0; // Clear topic number - service->ll_service->last_topic_position = 0; + service->last_topic_position = 0; for (uint16_t i = 0; i < LAST_TOPIC; i++) { - service->ll_service->topic_list[i] = 0; + service->topic_list[i] = 0; } // Link the service to his callback @@ -382,9 +365,6 @@ service_t *Luos_CreateService(SERVICE_CB service_cb, uint8_t type, const char *a service->revision.unmap[i] = revision.unmap[i]; } - // initiate service statistics - service->ll_service->ll_stat.max_retry = &service->statistics.max_retry; - service_ctx.number++; LUOS_ASSERT(service_ctx.number <= MAX_SERVICE_NUMBER); return service; @@ -449,5 +429,7 @@ error_return_t Luos_UpdateAlias(service_t *service, const char *alias, uint16_t void Luos_ServicesClear(void) { service_ctx.number = 0; - Robus_ServicesClear(); + + // Clear service table + memset((void *)service_ctx.list, 0, sizeof(service_t) * MAX_SERVICE_NUMBER); } \ No newline at end of file diff --git a/engine/core/src/timestamp.c b/engine/core/src/timestamp.c index a9ae6fb11..ee1f5d6be 100644 --- a/engine/core/src/timestamp.c +++ b/engine/core/src/timestamp.c @@ -7,7 +7,7 @@ #include "_timestamp.h" #include "luos_hal.h" #include "string.h" -#include "service_structs.h" +#include "struct_luos.h" /******************************* Description of Timestamp process ************************************ * * Timestamp is a mechanism which enables to track events in the system. To use it users have to get and save a timestamp in diff --git a/engine/engine_config.h b/engine/engine_config.h index 2287bf457..7e7f57e89 100644 --- a/engine/engine_config.h +++ b/engine/engine_config.h @@ -10,11 +10,13 @@ /******************************************************************************* * Definitions ******************************************************************************/ -#define DETECTION_TIMEOUT_MS 10000 // Timeout used to detect a failed detection -#define BOOT_TIMEOUT 1000 -#define DEFAULTID 0x00 -#define PROTOCOL_REVISION 0 -#define BROADCAST_VAL 0x0FFF +#define LUOS_LAST_RESERVED_CMD 42 // Last Luos reserved command +#define ROBUS_PROTOCOL_NB 13 // Number of Robus protocol command +#define DETECTION_TIMEOUT_MS 10000 // Timeout used to detect a failed detection +#define BOOT_TIMEOUT 1000 +#define DEFAULTID 0x00 +#define PROTOCOL_REVISION 0 +#define BROADCAST_VAL 0x0FFF #define MAX_ALIAS_SIZE 16 #define MAX_DATA_MSG_SIZE 128 diff --git a/examples/projects/native/ping_pong/lib/PingPong/ping_pong.c b/examples/projects/native/ping_pong/lib/PingPong/ping_pong.c index 7ae9fe70a..6dfc5022e 100644 --- a/examples/projects/native/ping_pong/lib/PingPong/ping_pong.c +++ b/examples/projects/native/ping_pong/lib/PingPong/ping_pong.c @@ -64,7 +64,7 @@ uint16_t last_id = 0; void Player_MsgHandler(service_t *service, msg_t *msg) { - if ((msg->header.target_mode == TOPIC) & (msg->header.target = SCORE_TOPIC) & (msg->header.source != service->ll_service->id)) + if ((msg->header.target_mode == TOPIC) & (msg->header.target = SCORE_TOPIC) & (msg->header.source != service->id)) { score_update(msg); set_screen_to(score_view); @@ -168,7 +168,7 @@ bool send_random() do { target = rand() % target_list.result_nbr; - } while (target_list.result_table[target]->id == player->ll_service->id); + } while (target_list.result_table[target]->id == player->id); // Our target is OK, Send the message msg_t msg; diff --git a/network/robus/inc/context.h b/network/robus/inc/context.h index 3d498ee67..b4c65ac40 100644 --- a/network/robus/inc/context.h +++ b/network/robus/inc/context.h @@ -23,9 +23,6 @@ typedef struct RxCom_t rx; /*!< Receiver informations. */ TxCom_t tx; /*!< Transmitter informations. */ PortMng_t port; /*!< Port informations. */ - - // Low level service management - ll_service_t ll_service_table[MAX_SERVICE_NUMBER]; /*!< Low level Service table. */ } context_t; /******************************************************************************* diff --git a/network/robus/inc/reception.h b/network/robus/inc/reception.h index 6229af67a..46a107081 100644 --- a/network/robus/inc/reception.h +++ b/network/robus/inc/reception.h @@ -7,7 +7,8 @@ #ifndef _RECEPTION_H_ #define _RECEPTION_H_ -#include +#include "robus.h" +#include "struct_io.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -55,6 +56,5 @@ void Recep_EndMsg(void); void Recep_Reset(void); void Recep_Timeout(void); luos_localhost_t Recep_NodeConcerned(header_t *header); -ll_service_t *Recep_GetConcernedLLService(header_t *header); #endif /* _RECEPTION_H_ */ diff --git a/network/robus/inc/robus.h b/network/robus/inc/robus.h index 6e5551734..e4e167ef8 100644 --- a/network/robus/inc/robus.h +++ b/network/robus/inc/robus.h @@ -9,7 +9,7 @@ #include #include -#include "io_struct.h" +#include "struct_luos.h" /******************************************************************************* * Variables ******************************************************************************/ @@ -20,11 +20,8 @@ void Robus_Init(memory_stats_t *memory_stats); void Robus_Loop(void); -void Robus_ServicesClear(void); -ll_service_t *Robus_GetLlServiceList(void); - -error_return_t Robus_SetTxTask(ll_service_t *ll_service, msg_t *msg); -error_return_t Robus_SendMsg(ll_service_t *ll_service, msg_t *msg); -uint16_t Robus_TopologyDetection(ll_service_t *ll_service); +error_return_t Robus_SetTxTask(service_t *service, msg_t *msg); +error_return_t Robus_SendMsg(service_t *service, msg_t *msg); +uint16_t Robus_TopologyDetection(service_t *service); #endif /* _ROBUS_H_ */ diff --git a/network/robus/inc/transmission.h b/network/robus/inc/transmission.h index 0fb37070f..8f3b28456 100644 --- a/network/robus/inc/transmission.h +++ b/network/robus/inc/transmission.h @@ -7,7 +7,7 @@ #ifndef _TRANSMISSION_H_ #define _TRANSMISSION_H_ -#include "io_struct.h" +#include "struct_io.h" #include /******************************************************************************* * Definitions diff --git a/network/robus/selftest/selftest.c b/network/robus/selftest/selftest.c index 0b1b1320e..7cac5f195 100644 --- a/network/robus/selftest/selftest.c +++ b/network/robus/selftest/selftest.c @@ -9,6 +9,7 @@ #include "context.h" #include "stdbool.h" #include "robus_hal.h" +#include "struct_engine.h" /******************************************************************************* * Definitions diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index ecad49653..4be6741af 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -54,6 +54,8 @@ #include "robus.h" #include "bootloader_core.h" #include "filter.h" +#include "struct_engine.h" +#include "context.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -80,7 +82,6 @@ static int64_t ll_rx_timestamp = 0; * Function ******************************************************************************/ static inline uint8_t Recep_IsAckNeeded(void); -static inline uint16_t Recep_CtxIndexFromID(uint16_t id); /****************************************************************************** * @brief Reception init. * @param None @@ -377,7 +378,7 @@ _CRITICAL luos_localhost_t Recep_NodeConcerned(header_t *header) case SERVICEIDACK: ctx.rx.status.rx_error = false; case SERVICEID: - // Check all ll_service id + // Check all service id if (Filter_ServiceID(header->target)) { return LOCALHOST; @@ -446,13 +447,3 @@ _CRITICAL static inline uint8_t Recep_IsAckNeeded(void) // if not failed return 0; } - -/****************************************************************************** - * @brief returns the index in context table from the service id - * @param id - * @return index - ******************************************************************************/ -static inline uint16_t Recep_CtxIndexFromID(uint16_t id) -{ - return (id - ctx.ll_service_table[0].id); -} diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index 78c170507..2ef8c9028 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -37,8 +37,8 @@ typedef struct __attribute__((__packed__)) } node_bootstrap_t; static error_return_t Robus_MsgHandler(msg_t *input); -static error_return_t Robus_DetectNextNodes(ll_service_t *ll_service); -static error_return_t Robus_ResetNetworkDetection(ll_service_t *ll_service); +static error_return_t Robus_DetectNextNodes(service_t *service); +static error_return_t Robus_ResetNetworkDetection(service_t *service); /******************************************************************************* * Variables ******************************************************************************/ @@ -83,8 +83,6 @@ void Robus_Init(memory_stats_t *memory_stats) // Initialize the robus service status ctx.rx.status.unmap = 0; ctx.rx.status.identifier = 0xF; - - Node_SetState(NO_DETECTION); } /****************************************************************************** * @brief Loop of the Robus communication protocole @@ -110,31 +108,14 @@ void Robus_Loop(void) } RobusHAL_Loop(); } -/****************************************************************************** - * @brief return the ll_service list - * @return None - ******************************************************************************/ -ll_service_t *Robus_GetLlServiceList(void) -{ - return (ll_service_t *)ctx.ll_service_table; -} -/****************************************************************************** - * @brief clear service list in route table - * @param None - * @return None - ******************************************************************************/ -void Robus_ServicesClear(void) -{ - // Clear ll_service table - memset((void *)ctx.ll_service_table, 0, sizeof(ll_service_t) * MAX_SERVICE_NUMBER); -} + /****************************************************************************** * @brief Formalize message Set tx task and send * @param service to send * @param msg to send * @return error_return_t ******************************************************************************/ -error_return_t Robus_SetTxTask(ll_service_t *ll_service, msg_t *msg) +error_return_t Robus_SetTxTask(service_t *service, msg_t *msg) { error_return_t error = SUCCEED; uint8_t ack = 0; @@ -180,7 +161,7 @@ error_return_t Robus_SetTxTask(ll_service_t *ll_service, msg_t *msg) } // ********** Allocate the message ******************** - if (MsgAlloc_SetTxTask(ll_service, (uint8_t *)msg->stream, crc_val, full_size, localhost, ack) == FAILED) + if (MsgAlloc_SetTxTask(service, (uint8_t *)msg->stream, crc_val, full_size, localhost, ack) == FAILED) { error = FAILED; } @@ -201,18 +182,18 @@ error_return_t Robus_SetTxTask(ll_service_t *ll_service, msg_t *msg) * @param msg to send * @return none ******************************************************************************/ -error_return_t Robus_SendMsg(ll_service_t *ll_service, msg_t *msg) +error_return_t Robus_SendMsg(service_t *service, msg_t *msg) { // ********** Prepare the message ******************** - if (ll_service->id != 0) + if (service->id != 0) { - msg->header.source = ll_service->id; + msg->header.source = service->id; } else { msg->header.source = Node_Get()->node_id; } - if (Robus_SetTxTask(ll_service, msg) == FAILED) + if (Robus_SetTxTask(service, msg) == FAILED) { return FAILED; } @@ -220,10 +201,10 @@ error_return_t Robus_SendMsg(ll_service_t *ll_service, msg_t *msg) } /****************************************************************************** * @brief Start a topology detection procedure - * @param ll_service pointer to the detecting ll_service + * @param service pointer to the detecting service * @return The number of detected node. ******************************************************************************/ -uint16_t Robus_TopologyDetection(ll_service_t *ll_service) +uint16_t Robus_TopologyDetection(service_t *service) { uint8_t redetect_nb = 0; bool detect_enabled = true; @@ -240,7 +221,7 @@ uint16_t Robus_TopologyDetection(ll_service_t *ll_service) detect_enabled = false; // Reset all detection state of services on the network - Robus_ResetNetworkDetection(ll_service); + Robus_ResetNetworkDetection(service); // Make sure that the detection is not interrupted if (Node_GetState() == EXTERNAL_DETECTION) { @@ -249,10 +230,10 @@ uint16_t Robus_TopologyDetection(ll_service_t *ll_service) // setup local node Node_Get()->node_id = 1; last_node = 1; - // setup sending ll_service - ll_service->id = 1; + // setup sending service + service->id = 1; - if (Robus_DetectNextNodes(ll_service) == FAILED) + if (Robus_DetectNextNodes(service) == FAILED) { // check the number of retry we made LUOS_ASSERT((redetect_nb <= 4)); @@ -266,10 +247,10 @@ uint16_t Robus_TopologyDetection(ll_service_t *ll_service) } /****************************************************************************** * @brief reset all service port states - * @param ll_service pointer to the detecting ll_service + * @param service pointer to the detecting service * @return The number of detected node. ******************************************************************************/ -static error_return_t Robus_ResetNetworkDetection(ll_service_t *ll_service) +static error_return_t Robus_ResetNetworkDetection(service_t *service) { msg_t msg; uint8_t try_nbr = 0; @@ -289,12 +270,12 @@ static error_return_t Robus_ResetNetworkDetection(ll_service_t *ll_service) return 0; } // msg send not blocking - Robus_SendMsg(ll_service, &msg); + Robus_SendMsg(service, &msg); // need to wait until tx msg before clear msg alloc while (MsgAlloc_TxAllComplete() != SUCCEED) ; - // Reinit ll_service id + // Reinit service id Service_ClearId(); // Reinit msg alloc @@ -319,17 +300,17 @@ static error_return_t Robus_ResetNetworkDetection(ll_service_t *ll_service) } /****************************************************************************** * @brief run the procedure allowing to detect the next nodes on the next port - * @param ll_service pointer to the detecting ll_service + * @param service pointer to the detecting service * @return None. ******************************************************************************/ -static error_return_t Robus_DetectNextNodes(ll_service_t *ll_service) +static error_return_t Robus_DetectNextNodes(service_t *service) { // Lets try to poke other nodes while (PortMng_PokeNextPort() == SUCCEED) { // There is someone here // Clear spotted dead service detection - ll_service->dead_service_spotted = 0; + service->dead_service_spotted = 0; // Ask an ID to the detector service. msg_t msg; msg.header.config = BASE_PROTOCOL; @@ -337,12 +318,12 @@ static error_return_t Robus_DetectNextNodes(ll_service_t *ll_service) msg.header.target = 1; msg.header.cmd = WRITE_NODE_ID; msg.header.size = 0; - Robus_SendMsg(ll_service, &msg); + Robus_SendMsg(service, &msg); // Wait the end of transmission while (MsgAlloc_TxAllComplete() == FAILED) ; // Check if there is a failure on transmission - if (ll_service->dead_service_spotted != 0) + if (service->dead_service_spotted != 0) { // Message transmission failure // Consider this port unconnected @@ -376,7 +357,7 @@ static error_return_t Robus_MsgHandler(msg_t *input) { msg_t output_msg; node_bootstrap_t node_bootstrap; - ll_service_t *ll_service = Service_GetConcerned(&input->header); + service_t *service = Service_GetConcerned(&input->header); switch (input->header.cmd) { case WRITE_NODE_ID: @@ -393,7 +374,7 @@ static error_return_t Robus_MsgHandler(msg_t *input) output_msg.header.target = input->header.source; output_msg.header.target_mode = NODEIDACK; memcpy(output_msg.data, (void *)&last_node, sizeof(uint16_t)); - Robus_SendMsg(ll_service, &output_msg); + Robus_SendMsg(service, &output_msg); break; case 2: // This is a node id for the next node. @@ -410,13 +391,13 @@ static error_return_t Robus_MsgHandler(msg_t *input) output_msg.header.target = 0; output_msg.header.target_mode = NODEIDACK; memcpy((void *)&output_msg.data[0], (void *)&node_bootstrap.unmap[0], sizeof(node_bootstrap_t)); - Robus_SendMsg(ll_service, &output_msg); + Robus_SendMsg(service, &output_msg); break; case sizeof(node_bootstrap_t): if (Node_Get()->node_id != 0) { Node_Get()->node_id = 0; - // Reinit ll_service id + // Reinit service id Service_ClearId(); MsgAlloc_Init(NULL); } @@ -425,7 +406,7 @@ static error_return_t Robus_MsgHandler(msg_t *input) Node_Get()->node_id = node_bootstrap.nodeid; Node_Get()->port_table[ctx.port.activ] = node_bootstrap.prev_nodeid; // Continue the topology detection on our other ports. - Robus_DetectNextNodes(ll_service); + Robus_DetectNextNodes(service); default: break; } diff --git a/network/robus/src/transmission.c b/network/robus/src/transmission.c index c6cdb66ff..0064095af 100644 --- a/network/robus/src/transmission.c +++ b/network/robus/src/transmission.c @@ -118,24 +118,24 @@ _CRITICAL void Transmit_Process() uint8_t *data = 0; uint16_t size; uint8_t localhost; - ll_service_t *ll_service_pt; - if ((MsgAlloc_GetTxTask(&ll_service_pt, &data, &size, &localhost) == SUCCEED) && (Transmit_GetLockStatus() == false)) + service_t *service_pt; + if ((MsgAlloc_GetTxTask(&service_pt, &data, &size, &localhost) == SUCCEED) && (Transmit_GetLockStatus() == false)) { // We have something to send // Check if we already try to send it multiple times and save it on stats if it is - if ((*ll_service_pt->ll_stat.max_retry < nbrRetry) || (nbrRetry >= NBR_RETRY)) + if ((service_pt->statistics.max_retry < nbrRetry) || (nbrRetry >= NBR_RETRY)) { - *ll_service_pt->ll_stat.max_retry = nbrRetry; + service_pt->statistics.max_retry = nbrRetry; if (nbrRetry >= NBR_RETRY) { // We failed to transmit this message. We can't allow it, there is a issue on this target. - ll_service_pt->dead_service_spotted = (uint16_t)(((msg_t *)data)->header.target); - nbrRetry = 0; - ctx.tx.collision = false; + service_pt->dead_service_spotted = (uint16_t)(((msg_t *)data)->header.target); + nbrRetry = 0; + ctx.tx.collision = false; // Remove all transmist messages of this specific target MsgAlloc_PullServiceFromTxTask((uint16_t)(((msg_t *)data)->header.target)); // Try to get a tx_task for another service - if (MsgAlloc_GetTxTask(&ll_service_pt, &data, &size, &localhost) == FAILED) + if (MsgAlloc_GetTxTask(&service_pt, &data, &size, &localhost) == FAILED) { // Nothing to transmit anymore, just exit. return; diff --git a/test/_resources/Unity/unit_test.h b/test/_resources/Unity/unit_test.h index e2ef0f48c..7f8d759dd 100644 --- a/test/_resources/Unity/unit_test.h +++ b/test/_resources/Unity/unit_test.h @@ -9,7 +9,7 @@ #include "robus_hal.h" #include "luos_engine.h" #include "luos_utils.h" -#include "io_struct.h" +#include "struct_io.h" #include /******************************************************************************* diff --git a/test/test_msg_alloc/unit_test_mem_alloc_generic.c b/test/test_msg_alloc/unit_test_mem_alloc_generic.c index 1b89821a8..dbd332ab2 100644 --- a/test/test_msg_alloc/unit_test_mem_alloc_generic.c +++ b/test/test_msg_alloc/unit_test_mem_alloc_generic.c @@ -7,16 +7,16 @@ ******************************************************************************/ typedef struct __attribute__((__packed__)) { - msg_t *msg_pt; /*!< Start pointer of the msg on msg_buffer. */ - ll_service_t *ll_service_pt; /*!< Pointer to the concerned ll_service. */ + msg_t *msg_pt; /*!< Start pointer of the msg on msg_buffer. */ + service_t *service_pt; /*!< Pointer to the concerned service. */ } luos_task_t; typedef struct { - uint8_t *data_pt; /*!< Start pointer of the data on msg_buffer. */ - uint16_t size; /*!< size of the data. */ - ll_service_t *ll_service_pt; /*!< Pointer to the transmitting ll_service. */ - uint8_t localhost; /*!< is this message a localhost one? */ + uint8_t *data_pt; /*!< Start pointer of the data on msg_buffer. */ + uint16_t size; /*!< size of the data. */ + service_t *service_pt; /*!< Pointer to the transmitting service. */ + uint8_t localhost; /*!< is this message a localhost one? */ } tx_task_t; /******************************************************************************* @@ -957,7 +957,7 @@ void unittest_MsgAlloc_LuosTaskAlloc() // luos_task_t expected_luos_task; - ll_service_t service; + service_t service; // Init variables memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, @@ -995,18 +995,18 @@ void unittest_MsgAlloc_LuosTaskAlloc() // luos_tasks init state luos_tasks end state // // +---------+<--luos_tasks_stack_id +---------+ - // | 0 | | D 1 | (msg_pt & ll_service_pt are allocated) + // | 0 | | D 1 | (msg_pt & service_pt are allocated) // |---------| |---------| - // | 0 | | D 2 | (msg_pt & ll_service_pt are allocated) + // | 0 | | D 2 | (msg_pt & service_pt are allocated) // |---------| |---------| // | etc... | | etc... | // |---------| |---------| - // | 0 | | Last | (msg_pt & ll_service_pt are allocated) + // | 0 | | Last | (msg_pt & service_pt are allocated) // +---------+ luos_tasks_stack_id-->+---------+ // msg_t *message; - ll_service_t *service_concerned; + service_t *service_concerned; uint16_t expected_luos_tasks_stack_id; uint8_t expected_mem_stat; @@ -1026,7 +1026,7 @@ void unittest_MsgAlloc_LuosTaskAlloc() expected_luos_tasks_stack_id = i + 1; expected_mem_stat = ((i + 1) * 100 / MAX_MSG_NB); message = (msg_t *)&msg_buffer[0]; - service_concerned = (ll_service_t *)&msg_buffer[0]; + service_concerned = (service_t *)&msg_buffer[0]; // Launch Test MsgAlloc_LuosTaskAlloc(service_concerned, message); @@ -1035,7 +1035,7 @@ void unittest_MsgAlloc_LuosTaskAlloc() NEW_STEP_IN_LOOP("Check message pointer is allocated", i); TEST_ASSERT_EQUAL(message, luos_tasks[i].msg_pt); NEW_STEP_IN_LOOP("Check service pointer is allocated", i); - TEST_ASSERT_EQUAL(service_concerned, luos_tasks[i].ll_service_pt); + TEST_ASSERT_EQUAL(service_concerned, luos_tasks[i].service_pt); NEW_STEP_IN_LOOP("Check \"luos tasks stack id\" is updated", i); TEST_ASSERT_EQUAL(expected_luos_tasks_stack_id, luos_tasks_stack_id); NEW_STEP_IN_LOOP("Check \"oldest message\" points to first luos task", i); @@ -1088,13 +1088,13 @@ void unittest_MsgAlloc_PullMsg() // msg_t *returned_message; - ll_service_t *service = (ll_service_t *)0xFFFF; + service_t *service = (service_t *)0xFFFF; // Init variables luos_tasks_stack_id = MAX_MSG_NB - 1; for (uintptr_t i = 0; i < MAX_MSG_NB; i++) { - luos_tasks[i].ll_service_pt = (ll_service_t *)i; + luos_tasks[i].service_pt = (service_t *)i; } // Launch Test & Verify @@ -1135,7 +1135,7 @@ void unittest_MsgAlloc_PullMsg() msg_t *returned_message; msg_t *msg_to_clear; - ll_service_t *service; + service_t *service; luos_task_t expected_luos_tasks[MAX_MSG_NB]; for (uint16_t i = 0; i < MAX_MSG_NB; i++) @@ -1146,11 +1146,11 @@ void unittest_MsgAlloc_PullMsg() luos_tasks_stack_id = MAX_MSG_NB; for (uint16_t j = 0; j < MAX_MSG_NB; j++) { - luos_tasks[j].ll_service_pt = (ll_service_t *)&msg_buffer[j]; + luos_tasks[j].service_pt = (service_t *)&msg_buffer[j]; luos_tasks[j].msg_pt = (msg_t *)(&msg_buffer[0] + MAX_MSG_NB + j); expected_luos_tasks[j].msg_pt = (msg_t *)(&msg_buffer[0] + MAX_MSG_NB + j); } - service = luos_tasks[i].ll_service_pt; + service = luos_tasks[i].service_pt; msg_to_clear = luos_tasks[i].msg_pt; // Launch Test & Verify @@ -1229,7 +1229,7 @@ void unittest_MsgAlloc_PullMsgFromLuosTask() uint16_t task_id; msg_t *returned_message; msg_t *msg_to_clear; - ll_service_t *service; + service_t *service; luos_task_t expected_luos_tasks[MAX_MSG_NB]; for (uint16_t task_id = 0; task_id < MAX_MSG_NB; task_id++) @@ -1282,7 +1282,7 @@ void unittest_MsgAlloc_LookAtLuosTask() // uint16_t task_id; - ll_service_t **allocated_service; + service_t **allocated_service; // Init variables luos_tasks_stack_id = 0; @@ -1317,21 +1317,21 @@ void unittest_MsgAlloc_LookAtLuosTask() // // Init variables - ll_service_t *oldest_ll_service = NULL; - luos_tasks_stack_id = MAX_MSG_NB; + service_t *oldest_service = NULL; + luos_tasks_stack_id = MAX_MSG_NB; for (uintptr_t i = 0; i < MAX_MSG_NB; i++) { - luos_tasks[i].ll_service_pt = (ll_service_t *)i; + luos_tasks[i].service_pt = (service_t *)i; } // Call function & Verify for (uint16_t i = 0; i < MAX_MSG_NB; i++) { NEW_STEP_IN_LOOP("Check function returns SUCCEED", i); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_LookAtLuosTask(i, &oldest_ll_service)); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_LookAtLuosTask(i, &oldest_service)); NEW_STEP_IN_LOOP("Check if function return the service concerned by the oldest message", i); - TEST_ASSERT_EQUAL(i, oldest_ll_service); + TEST_ASSERT_EQUAL(i, oldest_service); } } } @@ -1567,23 +1567,23 @@ void unittest_MsgAlloc_ClearMsgFromLuosTasks() luos_task_t expected_luos_tasks[MAX_MSG_NB]; msg_t message; - ll_service_t service; + service_t service; // Init variables luos_tasks_stack_id = 0; for (uint16_t i = 0; i < MAX_MSG_NB; i++) { - luos_tasks[i].msg_pt = &message; - luos_tasks[i].ll_service_pt = &service; - expected_luos_tasks[i].msg_pt = &message; - expected_luos_tasks[i].ll_service_pt = &service; + luos_tasks[i].msg_pt = &message; + luos_tasks[i].service_pt = &service; + expected_luos_tasks[i].msg_pt = &message; + expected_luos_tasks[i].service_pt = &service; // Call function MsgAlloc_ClearMsgFromLuosTasks(luos_tasks[i].msg_pt); NEW_STEP_IN_LOOP("Check luos message pointer is not cleared", i); TEST_ASSERT_EQUAL(expected_luos_tasks[i].msg_pt, luos_tasks[i].msg_pt); NEW_STEP_IN_LOOP("Check luos service pointer is not cleared", i); - TEST_ASSERT_EQUAL(expected_luos_tasks[i].ll_service_pt, luos_tasks[i].ll_service_pt); + TEST_ASSERT_EQUAL(expected_luos_tasks[i].service_pt, luos_tasks[i].service_pt); } } @@ -1946,21 +1946,21 @@ void unittest_MsgAlloc_GetTxTask() // Init variables //--------------- - ll_service_t *ll_service; + service_t *service; uint8_t *data; uint16_t size = 128; uint8_t localhost = 1; - tx_tasks[0].data_pt = (uint8_t *)16; - tx_tasks[0].ll_service_pt = (ll_service_t *)32; - tx_tasks[0].size = 128; - tx_tasks[0].localhost = 1; + tx_tasks[0].data_pt = (uint8_t *)16; + tx_tasks[0].service_pt = (service_t *)32; + tx_tasks[0].size = 128; + tx_tasks[0].localhost = 1; tx_tasks_stack_id = MAX_MSG_NB + i; // Call function //--------------- - MsgAlloc_GetTxTask(&ll_service, &data, &size, &localhost); + MsgAlloc_GetTxTask(&service, &data, &size, &localhost); // Verify //--------------- @@ -1969,7 +1969,7 @@ void unittest_MsgAlloc_GetTxTask() // Call function //--------------- - MsgAlloc_GetTxTask(&ll_service, &data, &size, &localhost); + MsgAlloc_GetTxTask(&service, &data, &size, &localhost); // Verify //--------------- @@ -1995,7 +1995,7 @@ void unittest_MsgAlloc_GetTxTask() // +---------+ // - ll_service_t *ll_service; + service_t *service; uint8_t *data; uint16_t *size; uint8_t *localhost; @@ -2007,7 +2007,7 @@ void unittest_MsgAlloc_GetTxTask() // Call function & Verify //-------------------------- NEW_STEP("Check function returns FAILED when tx task is empty"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_GetTxTask(&ll_service, &data, size, localhost)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_GetTxTask(&service, &data, size, localhost)); } NEW_TEST_CASE("Verify there is a message"); @@ -2026,7 +2026,7 @@ void unittest_MsgAlloc_GetTxTask() // +---------+ // - ll_service_t *ll_service; + service_t *service; uint8_t *data; uint16_t size; uint8_t localhost; @@ -2035,17 +2035,17 @@ void unittest_MsgAlloc_GetTxTask() //--------------- tx_tasks_stack_id = 1; - tx_tasks[0].data_pt = (uint8_t *)16; - tx_tasks[0].ll_service_pt = (ll_service_t *)32; - tx_tasks[0].size = 128; - tx_tasks[0].localhost = 1; + tx_tasks[0].data_pt = (uint8_t *)16; + tx_tasks[0].service_pt = (service_t *)32; + tx_tasks[0].size = 128; + tx_tasks[0].localhost = 1; // Call function & Verify //-------------------------- NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_GetTxTask(&ll_service, &data, &size, &localhost)); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_GetTxTask(&service, &data, &size, &localhost)); NEW_STEP("Check function returns expected service pointer"); - TEST_ASSERT_EQUAL(tx_tasks[0].ll_service_pt, ll_service); + TEST_ASSERT_EQUAL(tx_tasks[0].service_pt, service); NEW_STEP("Check function returns expected data"); TEST_ASSERT_EQUAL(tx_tasks[0].data_pt, data); NEW_STEP("Check function returns expected size"); diff --git a/test/test_msg_alloc/unit_test_mem_alloc_static.c b/test/test_msg_alloc/unit_test_mem_alloc_static.c index 5a6e2e343..deda161f8 100644 --- a/test/test_msg_alloc/unit_test_mem_alloc_static.c +++ b/test/test_msg_alloc/unit_test_mem_alloc_static.c @@ -691,8 +691,8 @@ void unittest_ClearMsgSpace(void) for (uint16_t i = 0; i < MAX_MSG_NB - 2; i++) { - luos_tasks[i].msg_pt = (msg_t *)&msg_buffer[i + 2]; - luos_tasks[i].ll_service_pt = (ll_service_t *)&msg_buffer[i + 2]; + luos_tasks[i].msg_pt = (msg_t *)&msg_buffer[i + 2]; + luos_tasks[i].service_pt = (service_t *)&msg_buffer[i + 2]; } used_msg = (msg_t *)&msg_buffer[0]; oldest_msg = (msg_t *)&msg_buffer[2]; @@ -712,7 +712,7 @@ void unittest_ClearMsgSpace(void) for (uint16_t i = 0; i < MAX_MSG_NB - 2; i++) { TEST_ASSERT_EQUAL(0, luos_tasks[i].msg_pt); - TEST_ASSERT_EQUAL(0, luos_tasks[i].ll_service_pt); + TEST_ASSERT_EQUAL(0, luos_tasks[i].service_pt); } } @@ -1033,24 +1033,24 @@ void unittest_ClearLuosTask(void) for (uint16_t pt_value = 0; pt_value < MAX_MSG_NB; pt_value++) { // Init luos_tasks pointers - luos_tasks[pt_value].msg_pt = (msg_t *)(&msg_buffer[0] + pt_value); - luos_tasks[pt_value].ll_service_pt = (ll_service_t *)(&msg_buffer[0] + pt_value); + luos_tasks[pt_value].msg_pt = (msg_t *)(&msg_buffer[0] + pt_value); + luos_tasks[pt_value].service_pt = (service_t *)(&msg_buffer[0] + pt_value); // Init expected pointers if (pt_value == (tasks_stack_id - 1)) { - expected_luos_tasks[pt_value].msg_pt = 0; - expected_luos_tasks[pt_value].ll_service_pt = 0; + expected_luos_tasks[pt_value].msg_pt = 0; + expected_luos_tasks[pt_value].service_pt = 0; } else if (pt_value < task_id) { - expected_luos_tasks[pt_value].msg_pt = (msg_t *)(&msg_buffer[0] + pt_value); - expected_luos_tasks[pt_value].ll_service_pt = (ll_service_t *)(&msg_buffer[0] + pt_value); + expected_luos_tasks[pt_value].msg_pt = (msg_t *)(&msg_buffer[0] + pt_value); + expected_luos_tasks[pt_value].service_pt = (service_t *)(&msg_buffer[0] + pt_value); } else { - expected_luos_tasks[pt_value].msg_pt = (msg_t *)(&msg_buffer[0] + pt_value + 1); - expected_luos_tasks[pt_value].ll_service_pt = (ll_service_t *)(&msg_buffer[0] + pt_value + 1); + expected_luos_tasks[pt_value].msg_pt = (msg_t *)(&msg_buffer[0] + pt_value + 1); + expected_luos_tasks[pt_value].service_pt = (service_t *)(&msg_buffer[0] + pt_value + 1); } } @@ -1062,7 +1062,7 @@ void unittest_ClearLuosTask(void) for (uint8_t i = 0; i < tasks_stack_id; i++) { TEST_ASSERT_EQUAL(expected_luos_tasks[i].msg_pt, luos_tasks[i].msg_pt); - TEST_ASSERT_EQUAL(expected_luos_tasks[i].ll_service_pt, luos_tasks[i].ll_service_pt); + TEST_ASSERT_EQUAL(expected_luos_tasks[i].service_pt, luos_tasks[i].service_pt); } } } diff --git a/test/test_msg_alloc/unit_test_mem_alloc_tx.c b/test/test_msg_alloc/unit_test_mem_alloc_tx.c index 8ff47b621..3d08fb60f 100644 --- a/test/test_msg_alloc/unit_test_mem_alloc_tx.c +++ b/test/test_msg_alloc/unit_test_mem_alloc_tx.c @@ -13,16 +13,16 @@ ******************************************************************************/ typedef struct __attribute__((__packed__)) { - msg_t *msg_pt; /*!< Start pointer of the msg on msg_buffer. */ - ll_service_t *ll_service_pt; /*!< Pointer to the concerned ll_service. */ + msg_t *msg_pt; /*!< Start pointer of the msg on msg_buffer. */ + service_t *service_pt; /*!< Pointer to the concerned service. */ } luos_task_t; typedef struct { - uint8_t *data_pt; /*!< Start pointer of the data on msg_buffer. */ - uint16_t size; /*!< size of the data. */ - ll_service_t *ll_service_pt; /*!< Pointer to the transmitting ll_service. */ - uint8_t localhost; /*!< is this message a localhost one? */ + uint8_t *data_pt; /*!< Start pointer of the data on msg_buffer. */ + uint16_t size; /*!< size of the data. */ + service_t *service_pt; /*!< Pointer to the transmitting service. */ + uint8_t localhost; /*!< is this message a localhost one? */ } tx_task_t; /******************************************************************************* @@ -70,7 +70,7 @@ void unittest_SetTxTask_buffer_full() error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -87,7 +87,7 @@ void unittest_SetTxTask_buffer_full() { RESET_ASSERT(); NEW_STEP_IN_LOOP("Function returns FAILED when \"tx tasks stack id\" overflows", i - (MAX_MSG_NB - 1)); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(ll_service_pt, &dummy_data, crc, size, localhost, ack)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, &dummy_data, crc, size, localhost, ack)); NEW_STEP_IN_LOOP("Check NO assert has occured", i - (MAX_MSG_NB - 1)); TEST_ASSERT_FALSE(IS_ASSERT()); } @@ -104,7 +104,7 @@ void unittest_SetTxTask_Tx_too_long_1() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -147,7 +147,7 @@ void unittest_SetTxTask_Tx_too_long_1() //--------------------------- RESET_ASSERT(); NEW_STEP("Function returns FAILED when there is already a task in memory"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(ll_service_pt, data, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); } @@ -160,7 +160,7 @@ void unittest_SetTxTask_Tx_too_long_1() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -204,7 +204,7 @@ void unittest_SetTxTask_Tx_too_long_1() //--------------------------- RESET_ASSERT(); NEW_STEP("Function returns FAILED when there is already a task in memory"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(ll_service_pt, data, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); } @@ -217,7 +217,7 @@ void unittest_SetTxTask_Tx_too_long_1() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -261,7 +261,7 @@ void unittest_SetTxTask_Tx_too_long_1() //--------------------------- RESET_ASSERT(); NEW_STEP("Function returns FAILED when there is already a task in memory"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(ll_service_pt, data, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); } @@ -277,7 +277,7 @@ void unittest_SetTxTask_Tx_too_long_2() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -320,7 +320,7 @@ void unittest_SetTxTask_Tx_too_long_2() //--------------------------- RESET_ASSERT(); NEW_STEP("Function returns FAILED when there is already a task at begin of message buffer"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(ll_service_pt, data, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); } @@ -333,7 +333,7 @@ void unittest_SetTxTask_Tx_too_long_2() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -374,7 +374,7 @@ void unittest_SetTxTask_Tx_too_long_2() //--------------------------- RESET_ASSERT(); NEW_STEP("Function returns FAILED when there is already a task at begin of message buffer"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(ll_service_pt, data, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); } @@ -387,7 +387,7 @@ void unittest_SetTxTask_Tx_too_long_2() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -431,7 +431,7 @@ void unittest_SetTxTask_Tx_too_long_2() //--------------------------- RESET_ASSERT(); NEW_STEP("Function returns FAILED when there is already a task at begin of message buffer"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(ll_service_pt, data, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); } @@ -447,7 +447,7 @@ void unittest_SetTxTask_Tx_too_long_3() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -486,7 +486,7 @@ void unittest_SetTxTask_Tx_too_long_3() uint8_t *init_rx_message; ack = 0; localhost = 0; - ll_service_pt = (ll_service_t *)msg_buffer; // Fake service value + service_pt = (service_t *)msg_buffer; // Fake service value data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size / 2)]; // There are only 25 bytes left in msg buffer data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes @@ -498,10 +498,10 @@ void unittest_SetTxTask_Tx_too_long_3() expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)msg_buffer; - expected_tx_task.ll_service_pt = ll_service_pt; - expected_tx_task.localhost = localhost; + expected_tx_task.size = tx_size; + expected_tx_task.data_pt = (uint8_t *)msg_buffer; + expected_tx_task.service_pt = service_pt; + expected_tx_task.localhost = localhost; // Init Tx message for (size_t i = 0; i < tx_size - CRC_SIZE; i++) @@ -522,7 +522,7 @@ void unittest_SetTxTask_Tx_too_long_3() //--------------------------- RESET_ASSERT(); NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(ll_service_pt, tx_message, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); @@ -541,7 +541,7 @@ void unittest_SetTxTask_Tx_too_long_3() NEW_STEP("Check Tx task \"size\" is correctly computed"); TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(ll_service_pt, tx_tasks[tx_tasks_stack_id].ll_service_pt); + TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); NEW_STEP("Check Tx task \"localhost\" is correctly computed"); TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); @@ -573,7 +573,7 @@ void unittest_SetTxTask_Rx_too_long_1() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -614,7 +614,7 @@ void unittest_SetTxTask_Rx_too_long_1() //--------------------------- RESET_ASSERT(); NEW_STEP("Function returns FAILED"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(ll_service_pt, data, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); } @@ -627,7 +627,7 @@ void unittest_SetTxTask_Rx_too_long_1() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -664,7 +664,7 @@ void unittest_SetTxTask_Rx_too_long_1() //--------------------------- RESET_ASSERT(); NEW_STEP("Function returns FAILED"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(ll_service_pt, data, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); } @@ -677,7 +677,7 @@ void unittest_SetTxTask_Rx_too_long_1() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -714,7 +714,7 @@ void unittest_SetTxTask_Rx_too_long_1() //--------------------------- RESET_ASSERT(); NEW_STEP("Function returns FAILED"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(ll_service_pt, data, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); } @@ -729,7 +729,7 @@ void unittest_SetTxTask_Rx_too_long_2() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -766,7 +766,7 @@ void unittest_SetTxTask_Rx_too_long_2() //--------------------------- RESET_ASSERT(); NEW_STEP("Check function returns FAILED when Tx + Rx size doesn't fit msg buffer and a task is in requested memory"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(ll_service_pt, data, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); } @@ -782,7 +782,7 @@ void unittest_SetTxTask_Rx_too_long_3() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -819,7 +819,7 @@ void unittest_SetTxTask_Rx_too_long_3() //--------------------------- RESET_ASSERT(); NEW_STEP("Check function returns FAILED when Tx + Rx size doesn't fit msg buffer and a task is in memory beginning"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(ll_service_pt, data, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); } @@ -834,7 +834,7 @@ void unittest_SetTxTask_Rx_too_long_4() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -864,7 +864,7 @@ void unittest_SetTxTask_Rx_too_long_4() uint8_t *init_rx_message; ack = 0; localhost = 0; - ll_service_pt = (ll_service_t *)msg_buffer; // Fake service value + service_pt = (service_t *)msg_buffer; // Fake service value data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size + 1)]; // There are only 51 bytes left in msg buffer data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes @@ -876,10 +876,10 @@ void unittest_SetTxTask_Rx_too_long_4() expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)msg_buffer; - expected_tx_task.ll_service_pt = ll_service_pt; - expected_tx_task.localhost = localhost; + expected_tx_task.size = tx_size; + expected_tx_task.data_pt = (uint8_t *)msg_buffer; + expected_tx_task.service_pt = service_pt; + expected_tx_task.localhost = localhost; // Init Tx message for (size_t i = 0; i < tx_size - CRC_SIZE; i++) @@ -900,7 +900,7 @@ void unittest_SetTxTask_Rx_too_long_4() //--------------------------- RESET_ASSERT(); NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(ll_service_pt, tx_message, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); @@ -919,7 +919,7 @@ void unittest_SetTxTask_Rx_too_long_4() NEW_STEP("Check Tx task \"size\" is correctly computed"); TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(ll_service_pt, tx_tasks[tx_tasks_stack_id].ll_service_pt); + TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); NEW_STEP("Check Tx task \"localhost\" is correctly computed"); TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); @@ -951,7 +951,7 @@ void unittest_SetTxTask_Task_already_exists() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -981,7 +981,7 @@ void unittest_SetTxTask_Task_already_exists() uint16_t rx_bytes_received = 15; ack = 0; localhost = 0; - ll_service_pt = (ll_service_t *)msg_buffer; // Fake service value + service_pt = (service_t *)msg_buffer; // Fake service value data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes @@ -993,7 +993,7 @@ void unittest_SetTxTask_Task_already_exists() //--------------------------- RESET_ASSERT(); NEW_STEP("Check function returns FAILED when a task is in memory"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(ll_service_pt, data, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); } @@ -1008,7 +1008,7 @@ void unittest_SetTxTask_copy_OK() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -1043,7 +1043,7 @@ void unittest_SetTxTask_copy_OK() uint8_t *init_rx_message; ack = 0; localhost = 0; - ll_service_pt = (ll_service_t *)msg_buffer; // Fake service value + service_pt = (service_t *)msg_buffer; // Fake service value data = (uint8_t *)tx_message; // Tx message = 50 bytes current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes @@ -1055,10 +1055,10 @@ void unittest_SetTxTask_copy_OK() expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)current_msg; - expected_tx_task.ll_service_pt = ll_service_pt; - expected_tx_task.localhost = localhost; + expected_tx_task.size = tx_size; + expected_tx_task.data_pt = (uint8_t *)current_msg; + expected_tx_task.service_pt = service_pt; + expected_tx_task.localhost = localhost; // Init Tx message for (size_t i = 0; i < tx_size - CRC_SIZE; i++) @@ -1079,7 +1079,7 @@ void unittest_SetTxTask_copy_OK() //--------------------------- RESET_ASSERT(); NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(ll_service_pt, tx_message, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); @@ -1098,7 +1098,7 @@ void unittest_SetTxTask_copy_OK() NEW_STEP("Check Tx task \"size\" is correctly computed"); TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(ll_service_pt, tx_tasks[tx_tasks_stack_id].ll_service_pt); + TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); NEW_STEP("Check Tx task \"localhost\" is correctly computed"); TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); @@ -1128,7 +1128,7 @@ void unittest_SetTxTask_copy_OK() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -1166,7 +1166,7 @@ void unittest_SetTxTask_copy_OK() uint16_t padding; ack = 0; localhost = 0; - ll_service_pt = (ll_service_t *)msg_buffer; // Fake service value + service_pt = (service_t *)msg_buffer; // Fake service value data = (uint8_t *)tx_message; // Tx message = 50 bytes current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 80 bytes @@ -1179,10 +1179,10 @@ void unittest_SetTxTask_copy_OK() expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)current_msg; - expected_tx_task.ll_service_pt = ll_service_pt; - expected_tx_task.localhost = localhost; + expected_tx_task.size = tx_size; + expected_tx_task.data_pt = (uint8_t *)current_msg; + expected_tx_task.service_pt = service_pt; + expected_tx_task.localhost = localhost; // Init Tx message for (size_t i = 0; i < tx_size - CRC_SIZE; i++) @@ -1203,7 +1203,7 @@ void unittest_SetTxTask_copy_OK() //--------------------------- RESET_ASSERT(); NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(ll_service_pt, tx_message, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); @@ -1222,7 +1222,7 @@ void unittest_SetTxTask_copy_OK() NEW_STEP("Check Tx task \"size\" is correctly computed"); TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(ll_service_pt, tx_tasks[tx_tasks_stack_id].ll_service_pt); + TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); NEW_STEP("Check Tx task \"localhost\" is correctly computed"); TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); @@ -1252,7 +1252,7 @@ void unittest_SetTxTask_copy_OK() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -1290,7 +1290,7 @@ void unittest_SetTxTask_copy_OK() uint16_t padding; ack = 0; localhost = 0; - ll_service_pt = (ll_service_t *)msg_buffer; // Fake service value + service_pt = (service_t *)msg_buffer; // Fake service value data = (uint8_t *)tx_message; // Tx message = 50 bytes current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 80 bytes @@ -1302,10 +1302,10 @@ void unittest_SetTxTask_copy_OK() expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)current_msg; - expected_tx_task.ll_service_pt = ll_service_pt; - expected_tx_task.localhost = localhost; + expected_tx_task.size = tx_size; + expected_tx_task.data_pt = (uint8_t *)current_msg; + expected_tx_task.service_pt = service_pt; + expected_tx_task.localhost = localhost; // Init Tx message for (size_t i = 0; i < tx_size - CRC_SIZE; i++) @@ -1326,7 +1326,7 @@ void unittest_SetTxTask_copy_OK() //--------------------------- RESET_ASSERT(); NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(ll_service_pt, tx_message, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); @@ -1345,7 +1345,7 @@ void unittest_SetTxTask_copy_OK() NEW_STEP("Check Tx task \"size\" is correctly computed"); TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(ll_service_pt, tx_tasks[tx_tasks_stack_id].ll_service_pt); + TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); NEW_STEP("Check Tx task \"localhost\" is correctly computed"); TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); @@ -1373,7 +1373,7 @@ void unittest_SetTxTask_copy_OK() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -1408,7 +1408,7 @@ void unittest_SetTxTask_copy_OK() uint8_t *init_rx_message; ack = 0; localhost = 0; - ll_service_pt = (ll_service_t *)msg_buffer; // Fake service value + service_pt = (service_t *)msg_buffer; // Fake service value data = (uint8_t *)tx_message; // Tx message = 50 bytes current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes @@ -1420,10 +1420,10 @@ void unittest_SetTxTask_copy_OK() expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)current_msg; - expected_tx_task.ll_service_pt = ll_service_pt; - expected_tx_task.localhost = localhost; + expected_tx_task.size = tx_size; + expected_tx_task.data_pt = (uint8_t *)current_msg; + expected_tx_task.service_pt = service_pt; + expected_tx_task.localhost = localhost; // Init Tx message for (size_t i = 0; i < tx_size - CRC_SIZE; i++) @@ -1444,7 +1444,7 @@ void unittest_SetTxTask_copy_OK() //--------------------------- RESET_ASSERT(); NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(ll_service_pt, tx_message, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); @@ -1463,7 +1463,7 @@ void unittest_SetTxTask_copy_OK() NEW_STEP("Check Tx task \"size\" is correctly computed"); TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(ll_service_pt, tx_tasks[tx_tasks_stack_id].ll_service_pt); + TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); NEW_STEP("Check Tx task \"localhost\" is correctly computed"); TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); @@ -1495,7 +1495,7 @@ void unittest_SetTxTask_ACK() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost = EXTERNALHOST; @@ -1531,7 +1531,7 @@ void unittest_SetTxTask_ACK() uint8_t *init_rx_message; ack = 55; localhost = 0; - ll_service_pt = (ll_service_t *)msg_buffer; // Fake service value + service_pt = (service_t *)msg_buffer; // Fake service value data = (uint8_t *)tx_message; // Tx message = 51 bytes current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes @@ -1543,10 +1543,10 @@ void unittest_SetTxTask_ACK() expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)current_msg; - expected_tx_task.ll_service_pt = ll_service_pt; - expected_tx_task.localhost = localhost; + expected_tx_task.size = tx_size; + expected_tx_task.data_pt = (uint8_t *)current_msg; + expected_tx_task.service_pt = service_pt; + expected_tx_task.localhost = localhost; // Init Tx message for (size_t i = 0; i < tx_size - CRC_SIZE - sizeof(ack); i++) @@ -1568,7 +1568,7 @@ void unittest_SetTxTask_ACK() //--------------------------- RESET_ASSERT(); NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(ll_service_pt, tx_message, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); @@ -1587,7 +1587,7 @@ void unittest_SetTxTask_ACK() NEW_STEP("Check Tx task \"size\" is correctly computed"); TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(ll_service_pt, tx_tasks[tx_tasks_stack_id].ll_service_pt); + TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); NEW_STEP("Check Tx task \"localhost\" is correctly computed"); TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); @@ -1621,7 +1621,7 @@ void unittest_SetTxTask_internal_localhost() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost; @@ -1659,7 +1659,7 @@ void unittest_SetTxTask_internal_localhost() ack = 0; localhost = LOCALHOST; // Localhost : to fill msg_task - ll_service_pt = (ll_service_t *)msg_buffer; // Fake service value + service_pt = (service_t *)msg_buffer; // Fake service value data = (uint8_t *)tx_message; // Tx message = 50 bytes current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes @@ -1672,10 +1672,10 @@ void unittest_SetTxTask_internal_localhost() expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)current_msg; - expected_tx_task.ll_service_pt = ll_service_pt; - expected_tx_task.localhost = localhost; + expected_tx_task.size = tx_size; + expected_tx_task.data_pt = (uint8_t *)current_msg; + expected_tx_task.service_pt = service_pt; + expected_tx_task.localhost = localhost; // Init Tx message for (size_t i = 0; i < tx_size - CRC_SIZE; i++) @@ -1696,7 +1696,7 @@ void unittest_SetTxTask_internal_localhost() //--------------------------- RESET_ASSERT(); NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(ll_service_pt, tx_message, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); @@ -1716,7 +1716,7 @@ void unittest_SetTxTask_internal_localhost() // Check Tx Tasks is void tx_tasks_stack_id--; NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_NULL(tx_tasks[tx_tasks_stack_id].ll_service_pt); + TEST_ASSERT_NULL(tx_tasks[tx_tasks_stack_id].service_pt); NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); TEST_ASSERT_NULL(tx_tasks[tx_tasks_stack_id].data_pt); NEW_STEP("Check Tx task \"size\" = 0"); @@ -1753,7 +1753,7 @@ void unittest_SetTxTask_multihost() { error_return_t result; uint8_t *data; - ll_service_t *ll_service_pt; + service_t *service_pt; uint16_t crc; uint16_t size; luos_localhost_t localhost; @@ -1792,7 +1792,7 @@ void unittest_SetTxTask_multihost() ack = 0; localhost = MULTIHOST; - ll_service_pt = (ll_service_t *)msg_buffer; // Fake service value + service_pt = (service_t *)msg_buffer; // Fake service value data = (uint8_t *)tx_message; // Tx message = 50 bytes current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes @@ -1805,10 +1805,10 @@ void unittest_SetTxTask_multihost() expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)current_msg; - expected_tx_task.ll_service_pt = ll_service_pt; - expected_tx_task.localhost = localhost; + expected_tx_task.size = tx_size; + expected_tx_task.data_pt = (uint8_t *)current_msg; + expected_tx_task.service_pt = service_pt; + expected_tx_task.localhost = localhost; // Init Tx message for (size_t i = 0; i < tx_size - CRC_SIZE; i++) @@ -1829,7 +1829,7 @@ void unittest_SetTxTask_multihost() //--------------------------- RESET_ASSERT(); NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(ll_service_pt, tx_message, crc, tx_size, localhost, ack)); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); @@ -1851,7 +1851,7 @@ void unittest_SetTxTask_multihost() NEW_STEP("Check Tx task \"size\" is correctly computed"); TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(ll_service_pt, tx_tasks[tx_tasks_stack_id].ll_service_pt); + TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); NEW_STEP("Check \"localhost\" value is set to LOCALHOST"); TEST_ASSERT_EQUAL(LOCALHOST, tx_tasks[tx_tasks_stack_id].localhost); // Mutlihost must be seen as localhost NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); diff --git a/test/test_topic/main.c b/test/test_topic/main.c index f8bb378b5..a13432548 100644 --- a/test/test_topic/main.c +++ b/test/test_topic/main.c @@ -16,10 +16,10 @@ void unittest_PubSub_IsTopicSubscribed(void) Luos_Subscribe(default_sc.App_1.app, 1); Luos_Subscribe(default_sc.App_2.app, 18); - TEST_ASSERT_TRUE(PubSub_IsTopicSubscribed(default_sc.App_1.app->ll_service, 1)); - TEST_ASSERT_FALSE(PubSub_IsTopicSubscribed(default_sc.App_2.app->ll_service, 1)); - TEST_ASSERT_FALSE(PubSub_IsTopicSubscribed(default_sc.App_1.app->ll_service, 18)); - TEST_ASSERT_TRUE(PubSub_IsTopicSubscribed(default_sc.App_2.app->ll_service, 18)); + TEST_ASSERT_TRUE(PubSub_IsTopicSubscribed(default_sc.App_1.app, 1)); + TEST_ASSERT_FALSE(PubSub_IsTopicSubscribed(default_sc.App_2.app, 1)); + TEST_ASSERT_FALSE(PubSub_IsTopicSubscribed(default_sc.App_1.app, 18)); + TEST_ASSERT_TRUE(PubSub_IsTopicSubscribed(default_sc.App_2.app, 18)); } } @@ -34,10 +34,10 @@ void unittest_Luos_Subscribe(void) TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, 18)); TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, 27)); - TEST_ASSERT_EQUAL(3, default_sc.App_1.app->ll_service->last_topic_position); - TEST_ASSERT_EQUAL(1, default_sc.App_1.app->ll_service->topic_list[0]); - TEST_ASSERT_EQUAL(18, default_sc.App_1.app->ll_service->topic_list[1]); - TEST_ASSERT_EQUAL(27, default_sc.App_1.app->ll_service->topic_list[2]); + TEST_ASSERT_EQUAL(3, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(1, default_sc.App_1.app->topic_list[0]); + TEST_ASSERT_EQUAL(18, default_sc.App_1.app->topic_list[1]); + TEST_ASSERT_EQUAL(27, default_sc.App_1.app->topic_list[2]); } NEW_TEST_CASE("Add max topics number"); { @@ -47,13 +47,13 @@ void unittest_Luos_Subscribe(void) for (uint8_t i = 0; i < LAST_TOPIC; i++) { TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, i)); - TEST_ASSERT_EQUAL(i + 1, default_sc.App_1.app->ll_service->last_topic_position); + TEST_ASSERT_EQUAL(i + 1, default_sc.App_1.app->last_topic_position); } TEST_ASSERT_EQUAL(FAILED, Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC)); - TEST_ASSERT_EQUAL(LAST_TOPIC, default_sc.App_1.app->ll_service->last_topic_position); + TEST_ASSERT_EQUAL(LAST_TOPIC, default_sc.App_1.app->last_topic_position); - TEST_ASSERT_FALSE(PubSub_IsTopicSubscribed(default_sc.App_1.app->ll_service, LAST_TOPIC)); + TEST_ASSERT_FALSE(PubSub_IsTopicSubscribed(default_sc.App_1.app, LAST_TOPIC)); } } @@ -67,27 +67,27 @@ void unittest_Luos_Unsubscribe(void) Luos_Subscribe(default_sc.App_1.app, 2); Luos_Subscribe(default_sc.App_1.app, 7); Luos_Subscribe(default_sc.App_1.app, 17); - TEST_ASSERT_EQUAL(3, default_sc.App_1.app->ll_service->last_topic_position); - TEST_ASSERT_EQUAL(2, default_sc.App_1.app->ll_service->topic_list[0]); - TEST_ASSERT_EQUAL(7, default_sc.App_1.app->ll_service->topic_list[1]); - TEST_ASSERT_EQUAL(17, default_sc.App_1.app->ll_service->topic_list[2]); + TEST_ASSERT_EQUAL(3, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(2, default_sc.App_1.app->topic_list[0]); + TEST_ASSERT_EQUAL(7, default_sc.App_1.app->topic_list[1]); + TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[2]); TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 7)); - TEST_ASSERT_EQUAL(2, default_sc.App_1.app->ll_service->last_topic_position); - TEST_ASSERT_EQUAL(2, default_sc.App_1.app->ll_service->topic_list[0]); - TEST_ASSERT_EQUAL(17, default_sc.App_1.app->ll_service->topic_list[1]); + TEST_ASSERT_EQUAL(2, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(2, default_sc.App_1.app->topic_list[0]); + TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[1]); TEST_ASSERT_EQUAL(FAILED, Luos_Unsubscribe(default_sc.App_1.app, 18)); - TEST_ASSERT_EQUAL(2, default_sc.App_1.app->ll_service->last_topic_position); - TEST_ASSERT_EQUAL(2, default_sc.App_1.app->ll_service->topic_list[0]); - TEST_ASSERT_EQUAL(17, default_sc.App_1.app->ll_service->topic_list[1]); + TEST_ASSERT_EQUAL(2, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(2, default_sc.App_1.app->topic_list[0]); + TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[1]); TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 17)); - TEST_ASSERT_EQUAL(1, default_sc.App_1.app->ll_service->last_topic_position); - TEST_ASSERT_EQUAL(2, default_sc.App_1.app->ll_service->topic_list[0]); + TEST_ASSERT_EQUAL(1, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(2, default_sc.App_1.app->topic_list[0]); TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 2)); - TEST_ASSERT_EQUAL(0, default_sc.App_1.app->ll_service->last_topic_position); + TEST_ASSERT_EQUAL(0, default_sc.App_1.app->last_topic_position); } NEW_TEST_CASE("Remove same topic"); { @@ -98,12 +98,12 @@ void unittest_Luos_Unsubscribe(void) Luos_Subscribe(default_sc.App_1.app, 17); TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 2)); - TEST_ASSERT_EQUAL(1, default_sc.App_1.app->ll_service->last_topic_position); - TEST_ASSERT_EQUAL(17, default_sc.App_1.app->ll_service->topic_list[0]); + TEST_ASSERT_EQUAL(1, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[0]); TEST_ASSERT_EQUAL(FAILED, Luos_Unsubscribe(default_sc.App_1.app, 2)); - TEST_ASSERT_EQUAL(1, default_sc.App_1.app->ll_service->last_topic_position); - TEST_ASSERT_EQUAL(17, default_sc.App_1.app->ll_service->topic_list[0]); + TEST_ASSERT_EQUAL(1, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[0]); } NEW_TEST_CASE("Last topic position is corrupted"); @@ -112,11 +112,11 @@ void unittest_Luos_Unsubscribe(void) Init_Context(); Luos_Subscribe(default_sc.App_1.app, 2); - default_sc.App_1.app->ll_service->last_topic_position = LAST_TOPIC - 1; + default_sc.App_1.app->last_topic_position = LAST_TOPIC - 1; TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 2)); Luos_Subscribe(default_sc.App_1.app, 2); - default_sc.App_1.app->ll_service->last_topic_position = LAST_TOPIC; + default_sc.App_1.app->last_topic_position = LAST_TOPIC; TEST_ASSERT_EQUAL(FAILED, Luos_Unsubscribe(default_sc.App_1.app, 2)); } } diff --git a/tool_services/gate/TinyJSON/bootloader_ex.h b/tool_services/gate/TinyJSON/bootloader_ex.h index ad95d9a59..ab1aef3c7 100644 --- a/tool_services/gate/TinyJSON/bootloader_ex.h +++ b/tool_services/gate/TinyJSON/bootloader_ex.h @@ -7,7 +7,7 @@ #ifndef BOOTLOADER_EX_H #define BOOTLOADER_EX_H -#include "io_struct.h" +#include "struct_io.h" #include "luos_engine.h" #include "tiny-json.h" /******************************************************************************* diff --git a/tool_services/gate/TinyJSON/convert.c b/tool_services/gate/TinyJSON/convert.c index 5dcea0646..da01d432a 100644 --- a/tool_services/gate/TinyJSON/convert.c +++ b/tool_services/gate/TinyJSON/convert.c @@ -930,7 +930,7 @@ void Convert_ExcludedServiceData(service_t *service) { char json[300]; search_result_t result; - RTFilter_ID(RTFilter_Reset(&result), service->ll_service->dead_service_spotted); + RTFilter_ID(RTFilter_Reset(&result), service->dead_service_spotted); sprintf(json, "{\"dead_service\":\"%s\"}\n", result.result_table[0]->alias); // Send the message to pipe PipeLink_Send(service, json, strlen(json)); diff --git a/tool_services/gate/data_manager.c b/tool_services/gate/data_manager.c index 8325b0bd2..2e230f85b 100644 --- a/tool_services/gate/data_manager.c +++ b/tool_services/gate/data_manager.c @@ -62,12 +62,12 @@ void DataManager_collect(service_t *service) void DataManager_Run(service_t *service) { // Check if there is a dead service. - if (service->ll_service->dead_service_spotted) + if (service->dead_service_spotted) { Convert_ExcludedServiceData(service); - RoutingTB_RemoveOnRoutingTable(service->ll_service->dead_service_spotted); + RoutingTB_RemoveOnRoutingTable(service->dead_service_spotted); // Reset spotted dead service - service->ll_service->dead_service_spotted = 0; + service->dead_service_spotted = 0; } #ifdef GATE_POLLING DataManager_collect(service); diff --git a/tool_services/gate/pipe_link.c b/tool_services/gate/pipe_link.c index f3ea1b525..94d4f845f 100644 --- a/tool_services/gate/pipe_link.c +++ b/tool_services/gate/pipe_link.c @@ -56,7 +56,7 @@ uint16_t PipeLink_Find(service_t *service) search_result_t result; uint8_t localhost = false; // search a pipe type in localhost - RTFilter_Node(RTFilter_Type(RTFilter_Reset(&result), PIPE_TYPE), RoutingTB_NodeIDFromID(service->ll_service->id)); + RTFilter_Node(RTFilter_Type(RTFilter_Reset(&result), PIPE_TYPE), RoutingTB_NodeIDFromID(service->id)); if (result.result_nbr > 0) { @@ -97,7 +97,7 @@ uint16_t PipeLink_Find(service_t *service) msg.header.target_mode = SERVICEIDACK; msg.header.cmd = PARAMETERS; msg.header.size = 0; - LUOS_ASSERT(service->ll_service->id != 0); + LUOS_ASSERT(service->id != 0); while (Luos_SendMsg(service, &msg) != SUCCEED) ; } diff --git a/tool_services/inspector/pipe_link.c b/tool_services/inspector/pipe_link.c index 117082880..4e646a900 100644 --- a/tool_services/inspector/pipe_link.c +++ b/tool_services/inspector/pipe_link.c @@ -57,7 +57,7 @@ uint16_t PipeLink_Find(service_t *service) search_result_t result; uint8_t localhost = false; // search a pipe type in localhost - RTFilter_Node(RTFilter_Type(RTFilter_Reset(&result), PIPE_TYPE), RoutingTB_NodeIDFromID(service->ll_service->id)); + RTFilter_Node(RTFilter_Type(RTFilter_Reset(&result), PIPE_TYPE), RoutingTB_NodeIDFromID(service->id)); if (result.result_nbr > 0) { From 9e1e024a73c5a94074a5c53acdf7f3652fb05236 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 6 Apr 2023 09:35:31 +0200 Subject: [PATCH 032/150] Move robus init and loop things into IO --- engine/IO/inc/luos_io.h | 5 ++-- engine/IO/src/luos_io.c | 47 ++++++++++++++++++++++++++++++-- engine/core/src/luos_engine.c | 10 +++++-- network/robus/inc/robus.h | 10 ++----- network/robus/inc/transmission.h | 1 + network/robus/src/reception.c | 5 ++-- network/robus/src/robus.c | 44 +++--------------------------- network/robus/src/transmission.c | 14 ++++++++++ 8 files changed, 79 insertions(+), 57 deletions(-) diff --git a/engine/IO/inc/luos_io.h b/engine/IO/inc/luos_io.h index 9765d6a17..ee880e334 100644 --- a/engine/IO/inc/luos_io.h +++ b/engine/IO/inc/luos_io.h @@ -7,6 +7,7 @@ #ifndef _LUOSIO_H_ #define _LUOSIO_H_ +#include "struct_luos.h" /******************************************************************************* * Definitions @@ -21,7 +22,7 @@ ******************************************************************************/ // generic functions -void LuosIO_Init(void); - +void LuosIO_Init(memory_stats_t *memory_stats); +void LuosIO_Loop(void); #endif /* _LUOSIO_H_ */ diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 143464d3c..510d0acef 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -6,7 +6,12 @@ ******************************************************************************/ #include - +#include "transmission.h" +#include "reception.h" +#include "msg_alloc.h" +#include "robus.h" +#include "service.h" +#include "filter.h" /******************************************************************************* * Definitions @@ -20,13 +25,49 @@ * Functions ******************************************************************************/ - /****************************************************************************** * @brief Init the interface file. * @param None * @return None ******************************************************************************/ -void LuosIO_Init(void) +void LuosIO_Init(memory_stats_t *memory_stats) { + // Init filter + Filter_IdInit(); + Filter_TopicInit(); + + // Init transmission + Transmit_Init(); + + // Init reception + Recep_Init(); + + // Clear message allocation buffer table + MsgAlloc_Init(memory_stats); + + // Init Robus + Robus_Init(); +} +/****************************************************************************** + * @brief Loop of the IO level + * @param None + * @return None + ******************************************************************************/ +void LuosIO_Loop(void) +{ + // Execute message allocation tasks + MsgAlloc_loop(); + // Interpreat received messages and create luos task for it. + msg_t *msg; + while (MsgAlloc_PullMsgToInterpret(&msg) == SUCCEED) + { + // Check if this message is a protocol one + if (Robus_MsgHandler(msg) == FAILED) + { + // If not create luos tasks for all services. + Service_AllocMsg(msg); + } + } + Robus_Loop(); } diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index c812f0991..57977bb6b 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -46,9 +46,10 @@ static inline void Luos_PackageLoop(void); void Luos_Init(void) { Service_Init(); + Node_Init(); memset(&luos_stats.unmap[0], 0, sizeof(luos_stats_t)); LuosHAL_Init(); - Robus_Init(&luos_stats.memory); + LuosIO_Init(&luos_stats.memory); #ifdef WITH_BOOTLOADER if (APP_START_ADDRESS == (uint32_t)FLASH_BASE) @@ -98,7 +99,8 @@ void Luos_Loop(void) // Reset the data reception context Luos_ReceiveData(NULL, NULL, NULL); } - Robus_Loop(); + Node_Loop(); + LuosIO_Loop(); // look at all received messages LUOS_MUTEX_LOCK while (MsgAlloc_LookAtLuosTask(remaining_msg_number, &oldest_service) != FAILED) @@ -764,6 +766,7 @@ void Luos_Run(void) #endif } } + /****************************************************************************** * @brief Demand a detection * @param service : Service that launched the detection @@ -775,13 +778,14 @@ void Luos_Detect(service_t *service) if (Node_GetState() < LOCAL_DETECTION) { + // Reset filters Filter_IdInit(); // Set the detection launcher id to 1 service->id = 1; // Update the filter just to accept our detector id Filter_AddServiceId(1, 1); - // send ask detection message + // Send ask detection message detection_service = service; detect_msg.header.target_mode = SERVICEIDACK; detect_msg.header.cmd = ASK_DETECTION; diff --git a/network/robus/inc/robus.h b/network/robus/inc/robus.h index e4e167ef8..ef1d101a8 100644 --- a/network/robus/inc/robus.h +++ b/network/robus/inc/robus.h @@ -7,21 +7,17 @@ #ifndef _ROBUS_H_ #define _ROBUS_H_ -#include -#include -#include "struct_luos.h" -/******************************************************************************* - * Variables - ******************************************************************************/ +#include "luos_io.h" /******************************************************************************* * Function ******************************************************************************/ -void Robus_Init(memory_stats_t *memory_stats); +void Robus_Init(void); void Robus_Loop(void); error_return_t Robus_SetTxTask(service_t *service, msg_t *msg); error_return_t Robus_SendMsg(service_t *service, msg_t *msg); uint16_t Robus_TopologyDetection(service_t *service); +error_return_t Robus_MsgHandler(msg_t *input); #endif /* _ROBUS_H_ */ diff --git a/network/robus/inc/transmission.h b/network/robus/inc/transmission.h index 8f3b28456..82c44bf70 100644 --- a/network/robus/inc/transmission.h +++ b/network/robus/inc/transmission.h @@ -34,6 +34,7 @@ typedef struct /******************************************************************************* * Function ******************************************************************************/ +void Transmit_Init(void); uint16_t ll_crc_compute(uint8_t *, uint16_t, uint16_t); void Transmit_SendAck(void); void Transmit_Process(void); diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index 4be6741af..c433c577a 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -90,8 +90,9 @@ static inline uint8_t Recep_IsAckNeeded(void); void Recep_Init(void) { // Initialize the reception state machine - ctx.rx.status.unmap = 0; - ctx.rx.callback = Recep_GetHeader; + ctx.rx.status.unmap = 0; + ctx.rx.callback = Recep_GetHeader; + ctx.rx.status.identifier = 0xF; } /****************************************************************************** * @brief Callback to get a complete header diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index 2ef8c9028..9d9f64efe 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -36,7 +36,6 @@ typedef struct __attribute__((__packed__)) }; } node_bootstrap_t; -static error_return_t Robus_MsgHandler(msg_t *input); static error_return_t Robus_DetectNextNodes(service_t *service); static error_return_t Robus_ResetNetworkDetection(service_t *service); /******************************************************************************* @@ -55,35 +54,15 @@ volatile uint16_t last_node = 0; * @param None * @return None ******************************************************************************/ -void Robus_Init(memory_stats_t *memory_stats) +void Robus_Init(void) { - Node_Init(); - // no transmission lock - ctx.tx.lock = false; - // Init collision state - ctx.tx.collision = false; - // Init Tx status - ctx.tx.status = TX_DISABLE; - // Filters init - Filter_IdInit(); - Filter_TopicInit(); - - // Init reception - Recep_Init(); - - // Clear message allocation buffer table - MsgAlloc_Init(memory_stats); - // Init hal RobusHAL_Init(); // init detection structure PortMng_Init(); - - // Initialize the robus service status - ctx.rx.status.unmap = 0; - ctx.rx.status.identifier = 0xF; } + /****************************************************************************** * @brief Loop of the Robus communication protocole * @param None @@ -91,21 +70,6 @@ void Robus_Init(memory_stats_t *memory_stats) ******************************************************************************/ void Robus_Loop(void) { - // Network timeout management - Node_Loop(); - // Execute message allocation tasks - MsgAlloc_loop(); - // Interpreat received messages and create luos task for it. - msg_t *msg = NULL; - while (MsgAlloc_PullMsgToInterpret(&msg) == SUCCEED) - { - // Check if this message is a protocol one - if (Robus_MsgHandler(msg) == FAILED) - { - // If not create luos tasks for all services. - Service_AllocMsg(msg); - } - } RobusHAL_Loop(); } @@ -338,7 +302,7 @@ static error_return_t Robus_DetectNextNodes(service_t *service) uint32_t start_tick = LuosHAL_GetSystick(); while (ctx.port.keepLine) { - Robus_Loop(); + LuosIO_Loop(); if (LuosHAL_GetSystick() - start_tick > DETECTION_TIMEOUT_MS) { // topology detection is too long, we should abort it and restart @@ -353,7 +317,7 @@ static error_return_t Robus_DetectNextNodes(service_t *service) * @param msg pointer to the reeived message * @return error_return_t SUCCEED if the message have been consumed. ******************************************************************************/ -static error_return_t Robus_MsgHandler(msg_t *input) +error_return_t Robus_MsgHandler(msg_t *input) { msg_t output_msg; node_bootstrap_t node_bootstrap; diff --git a/network/robus/src/transmission.c b/network/robus/src/transmission.c index 0064095af..7a61ab13b 100644 --- a/network/robus/src/transmission.c +++ b/network/robus/src/transmission.c @@ -67,6 +67,20 @@ volatile uint8_t nbrRetry = 0; ******************************************************************************/ _CRITICAL static uint8_t Transmit_GetLockStatus(void); +/****************************************************************************** + * @brief Transmit_Init + * @param None + * @return None + ******************************************************************************/ +void Transmit_Init(void) +{ + // no transmission lock + ctx.tx.lock = false; + // Init collision state + ctx.tx.collision = false; + // Init Tx status + ctx.tx.status = TX_DISABLE; +} /****************************************************************************** * @brief Transmit an ACK * @param None From 8944f80ec2186d6c7e3a16f1d7d3b9cc12920b60 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 6 Apr 2023 11:27:40 +0200 Subject: [PATCH 033/150] Move topology management to LuosIO --- engine/IO/inc/luos_io.h | 1 + engine/IO/src/luos_io.c | 249 +++++++++++++++++++++++++++- engine/core/src/luos_engine.c | 16 +- engine/core/src/routing_table.c | 5 +- engine/engine_config.h | 1 + network/robus/inc/port_manager.h | 2 + network/robus/inc/robus.h | 9 +- network/robus/src/port_manager.c | 22 +++ network/robus/src/robus.c | 274 +++---------------------------- 9 files changed, 320 insertions(+), 259 deletions(-) diff --git a/engine/IO/inc/luos_io.h b/engine/IO/inc/luos_io.h index ee880e334..6d5d38af3 100644 --- a/engine/IO/inc/luos_io.h +++ b/engine/IO/inc/luos_io.h @@ -24,5 +24,6 @@ // generic functions void LuosIO_Init(memory_stats_t *memory_stats); void LuosIO_Loop(void); +uint16_t LuosIO_TopologyDetection(service_t *service); #endif /* _LUOSIO_H_ */ diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 510d0acef..3eac78e34 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -5,21 +5,44 @@ * @version 0.0.0 ******************************************************************************/ -#include +#include +#include "luos_io.h" #include "transmission.h" #include "reception.h" #include "msg_alloc.h" #include "robus.h" #include "service.h" #include "filter.h" +#include "node.h" +#include "luos_utils.h" +#include "luos_hal.h" +#include "luos_engine.h" /******************************************************************************* * Definitions ******************************************************************************/ +typedef struct __attribute__((__packed__)) +{ + union + { + struct __attribute__((__packed__)) + { + uint16_t prev_nodeid; + uint16_t nodeid; + }; + uint8_t unmap[sizeof(uint16_t) * 2]; + }; +} node_bootstrap_t; + +static error_return_t LuosIO_StartTopologyDetection(service_t *service); +static error_return_t LuosIO_MsgHandler(msg_t *input); +static error_return_t LuosIO_DetectNextNodes(service_t *service); + /******************************************************************************* * Variables ******************************************************************************/ +volatile uint16_t last_node = 0; /******************************************************************************* * Functions @@ -63,7 +86,7 @@ void LuosIO_Loop(void) while (MsgAlloc_PullMsgToInterpret(&msg) == SUCCEED) { // Check if this message is a protocol one - if (Robus_MsgHandler(msg) == FAILED) + if (LuosIO_MsgHandler(msg) == FAILED) { // If not create luos tasks for all services. Service_AllocMsg(msg); @@ -71,3 +94,225 @@ void LuosIO_Loop(void) } Robus_Loop(); } + +/****************************************************************************** + * @brief Run a topology detection procedure as a master node. + * @param service pointer to the detecting service + * @return The number of detected node. + ******************************************************************************/ +uint16_t LuosIO_TopologyDetection(service_t *service) +{ + uint8_t redetect_nb = 0; + bool detect_enabled = true; + + // If a detection is in progress, don't do an another detection and return 0 + if (Node_GetState() >= LOCAL_DETECTION) + { + return 0; + } + while (detect_enabled) + { + detect_enabled = false; + + // Reset all detection state of services on the network to start a new detection + LuosIO_StartTopologyDetection(service); + // Make sure that the detection is not interrupted + if (Node_GetState() == EXTERNAL_DETECTION) + { + return 0; + } + // Setup local node + Node_Get()->node_id = 1; + last_node = 1; + // Setup sending service id + service->id = 1; + + if (LuosIO_DetectNextNodes(service) == FAILED) + { + // check the number of retry we made + LUOS_ASSERT((redetect_nb <= 4)); + // Detection fail, restart it + redetect_nb++; + detect_enabled = true; + } + } + return last_node; +} + +/****************************************************************************** + * @brief Initiate a topology detection by reseting all service port states as a master node. + * @param service pointer to the detecting service + * @return The number of detected node. + ******************************************************************************/ +static error_return_t LuosIO_StartTopologyDetection(service_t *service) +{ + msg_t msg; + uint8_t try_nbr = 0; + + msg.header.config = BASE_PROTOCOL; + msg.header.target = BROADCAST_VAL; + msg.header.target_mode = BROADCAST; + msg.header.cmd = START_DETECTION; + msg.header.size = 0; + do + { + // If a detection is in progress, don't do an another detection and return 0 + if (Node_GetState() >= LOCAL_DETECTION) + { + return 0; + } + // Load the message to send + Luos_SendMsg(service, &msg); + // Wait until message is actually transmitted + while (MsgAlloc_TxAllComplete() != SUCCEED) + ; + // Reinit services id + Service_ClearId(); + // Reinit msg alloc + MsgAlloc_Init(NULL); + // Wait 2ms to be sure all previous messages are received and treated by other nodes + uint32_t start_tick = LuosHAL_GetSystick(); + while (LuosHAL_GetSystick() - start_tick < 2) + ; + try_nbr++; + } while ((MsgAlloc_IsEmpty() != SUCCEED) || (try_nbr > 5)); + // Reinit our node id + Node_Get()->node_id = 0; + // Clear any saved node id on physical layer ports + Robus_ResetNodeID(); + if (try_nbr < 5) + { + Node_SetState(LOCAL_DETECTION); + return SUCCEED; + } + return FAILED; +} + +/****************************************************************************** + * @brief check if received messages are protocols one and manage it if it is. + * @param msg pointer to the reeived message + * @return error_return_t SUCCEED if the message have been consumed. + ******************************************************************************/ +error_return_t LuosIO_MsgHandler(msg_t *input) +{ + msg_t output_msg; + node_bootstrap_t node_bootstrap; + service_t *service = Service_GetConcerned(&input->header); + switch (input->header.cmd) + { + case WRITE_NODE_ID: + // Depending on the size of the received data we have to do different things + switch (input->header.size) + { + case 0: + // Someone asking us a new node id (we are the detecting service) + // Increase the number of node_nb and send it back + last_node++; + output_msg.header.config = BASE_PROTOCOL; + output_msg.header.cmd = WRITE_NODE_ID; + output_msg.header.size = sizeof(uint16_t); + output_msg.header.target = input->header.source; + output_msg.header.target_mode = NODEIDACK; + memcpy(output_msg.data, (void *)&last_node, sizeof(uint16_t)); + Luos_SendMsg(service, &output_msg); + break; + case 2: + // This is a node id for the next node. + // This is a reply to our request to generate the next node id. + // This node_id is the one after the currently poked branch. + // Extract the node id from the received data + memcpy((void *)&node_bootstrap.nodeid, (void *)&input->data[0], sizeof(uint16_t)); + // We need to save this node ID as a connection to a port + Robus_SaveNodeID(node_bootstrap.nodeid); + // Now we can send it to the next node + node_bootstrap.prev_nodeid = Node_Get()->node_id; + output_msg.header.config = BASE_PROTOCOL; + output_msg.header.cmd = WRITE_NODE_ID; + output_msg.header.size = sizeof(node_bootstrap_t); + output_msg.header.target = 0; + output_msg.header.target_mode = NODEIDACK; + memcpy((void *)&output_msg.data[0], (void *)&node_bootstrap.unmap[0], sizeof(node_bootstrap_t)); + Luos_SendMsg(service, &output_msg); + break; + case sizeof(node_bootstrap_t): + if (Node_Get()->node_id != 0) + { + Node_Get()->node_id = 0; + // Reinit service id + Service_ClearId(); + MsgAlloc_Init(NULL); + } + // This is a node bootstrap information. + memcpy((void *)&node_bootstrap.unmap[0], (void *)&input->data[0], sizeof(node_bootstrap_t)); + Node_Get()->node_id = node_bootstrap.nodeid; + Robus_SaveNodeID(node_bootstrap.prev_nodeid); + // Continue the topology detection on our other ports. + LuosIO_DetectNextNodes(service); + default: + break; + } + return SUCCEED; + break; + case START_DETECTION: + return SUCCEED; + break; + case END_DETECTION: + // Detect end of detection + Node_SetState(DETECTION_OK); + return FAILED; + break; + default: + return FAILED; + break; + } + return FAILED; +} + +/****************************************************************************** + * @brief run the procedure allowing to detect the next nodes on the next physical layer port. + * @param service pointer to the detecting service + * @return None. + ******************************************************************************/ +static error_return_t LuosIO_DetectNextNodes(service_t *service) +{ + // Lets try to poke other nodes + while (Robus_FindNeighbour() == SUCCEED) + { + // There is someone here + // Clear spotted dead service detection + service->dead_service_spotted = 0; + // Ask an ID to the detector service. + msg_t msg; + msg.header.config = BASE_PROTOCOL; + msg.header.target_mode = NODEIDACK; + msg.header.target = 1; + msg.header.cmd = WRITE_NODE_ID; + msg.header.size = 0; + Luos_SendMsg(service, &msg); + // Wait the end of transmission + while (MsgAlloc_TxAllComplete() == FAILED) + ; + // Check if there is a failure on transmission + if (service->dead_service_spotted != 0) + { + // Message transmission failure + // Consider this port unconnected by sending a 0xFFFF node id meaning that this port is not connected + Robus_SaveNodeID(0xFFFF); + continue; + } + + // when Robus loop will receive the reply it will store and manage the new node_id and send it to the next node. + // We just have to wait the end of the treatment of the entire branch + uint32_t start_tick = LuosHAL_GetSystick(); + while (Robus_Busy()) + { + LuosIO_Loop(); + if (LuosHAL_GetSystick() - start_tick > DETECTION_TIMEOUT_MS) + { + // topology detection is too long, we should abort it and restart + return FAILED; + } + } + } + return SUCCEED; +} diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 57977bb6b..8f39c32a3 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -450,7 +450,21 @@ static error_return_t Luos_Send(service_t *service, msg_t *msg) // We can't send it return PROHIBITED; } - return Robus_SendMsg(service, msg); + + // ********** Prepare the message ******************** + if (service->id != 0) + { + msg->header.source = service->id; + } + else + { + msg->header.source = Node_Get()->node_id; + } + if (Robus_SetTxTask(service, msg) == FAILED) + { + return FAILED; + } + return SUCCEED; } /****************************************************************************** diff --git a/engine/core/src/routing_table.c b/engine/core/src/routing_table.c index f242e7999..71306facb 100644 --- a/engine/core/src/routing_table.c +++ b/engine/core/src/routing_table.c @@ -13,12 +13,11 @@ #include "luos_hal.h" #include "luos_engine.h" #include "struct_engine.h" -#include "robus.h" +#include "luos_io.h" /******************************************************************************* * Definitions ******************************************************************************/ -#define ALIAS_SIZE 15 /******************************************************************************* * Variables ******************************************************************************/ @@ -367,7 +366,7 @@ void RoutingTB_DetectServices(service_t *service) // Desactivate verbose mode Luos_SetVerboseMode(false); // Starts the topology detection. - uint16_t nb_node = Robus_TopologyDetection(service); + uint16_t nb_node = LuosIO_TopologyDetection(service); // Clear data reception state Luos_ReceiveData(NULL, NULL, NULL); // Clear the routing table. diff --git a/engine/engine_config.h b/engine/engine_config.h index 7e7f57e89..23e346126 100644 --- a/engine/engine_config.h +++ b/engine/engine_config.h @@ -12,6 +12,7 @@ ******************************************************************************/ #define LUOS_LAST_RESERVED_CMD 42 // Last Luos reserved command #define ROBUS_PROTOCOL_NB 13 // Number of Robus protocol command +#define ALIAS_SIZE 15 // Number of max char for service alias #define DETECTION_TIMEOUT_MS 10000 // Timeout used to detect a failed detection #define BOOT_TIMEOUT 1000 #define DEFAULTID 0x00 diff --git a/network/robus/inc/port_manager.h b/network/robus/inc/port_manager.h index 1a4e2d975..bf7bcc644 100644 --- a/network/robus/inc/port_manager.h +++ b/network/robus/inc/port_manager.h @@ -30,5 +30,7 @@ void PortMng_PtpHandler(uint8_t PortNbr); uint8_t PortMng_PokePort(uint8_t PortNbr); error_return_t PortMng_PokeNextPort(void); uint8_t PortMng_PortPokedStatus(void); +void PortMng_SaveNodeID(uint16_t nodeid); +bool PortMng_Busy(void); #endif /* _PORTMANAGER_H_ */ diff --git a/network/robus/inc/robus.h b/network/robus/inc/robus.h index ef1d101a8..a0de76386 100644 --- a/network/robus/inc/robus.h +++ b/network/robus/inc/robus.h @@ -8,6 +8,7 @@ #define _ROBUS_H_ #include "luos_io.h" +#include /******************************************************************************* * Function @@ -16,8 +17,10 @@ void Robus_Init(void); void Robus_Loop(void); error_return_t Robus_SetTxTask(service_t *service, msg_t *msg); -error_return_t Robus_SendMsg(service_t *service, msg_t *msg); -uint16_t Robus_TopologyDetection(service_t *service); -error_return_t Robus_MsgHandler(msg_t *input); + +void Robus_SaveNodeID(uint16_t nodeid); +void Robus_ResetNodeID(void); +bool Robus_Busy(void); +error_return_t Robus_FindNeighbour(void); #endif /* _ROBUS_H_ */ diff --git a/network/robus/src/port_manager.c b/network/robus/src/port_manager.c index dd034ef77..3acc3473e 100644 --- a/network/robus/src/port_manager.c +++ b/network/robus/src/port_manager.c @@ -179,3 +179,25 @@ _CRITICAL void PortMng_Reset(void) RobusHAL_SetPTPDefaultState(port); } } + +/****************************************************************************** + * @brief save node id on the port table + * @param node id + * @return None + ******************************************************************************/ +void PortMng_SaveNodeID(uint16_t nodeid) +{ + Node_Get()->port_table[ctx.port.activ] = nodeid; + if (nodeid == 0xFFFF) + { + // This means no that we failed to reach the next node + // Consider this port unconnected + ctx.port.activ = NBR_PORT; + ctx.port.keepLine = false; + } +} + +bool PortMng_Busy(void) +{ + return ctx.port.keepLine; +} diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index 9d9f64efe..65d0c649e 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -23,27 +23,11 @@ * Definitions ******************************************************************************/ -typedef struct __attribute__((__packed__)) -{ - union - { - struct __attribute__((__packed__)) - { - uint16_t prev_nodeid; - uint16_t nodeid; - }; - uint8_t unmap[sizeof(uint16_t) * 2]; - }; -} node_bootstrap_t; - -static error_return_t Robus_DetectNextNodes(service_t *service); -static error_return_t Robus_ResetNetworkDetection(service_t *service); /******************************************************************************* * Variables ******************************************************************************/ // Creation of the robus context. This variable is used in all files of this lib. volatile context_t ctx; -volatile uint16_t last_node = 0; /******************************************************************************* * Function @@ -59,7 +43,7 @@ void Robus_Init(void) // Init hal RobusHAL_Init(); - // init detection structure + // Init detection structure PortMng_Init(); } @@ -140,253 +124,43 @@ error_return_t Robus_SetTxTask(service_t *service, msg_t *msg) #endif return error; } + /****************************************************************************** - * @brief Send Msg to a service - * @param service to send - * @param msg to send - * @return none + * @brief Save a node id in the port table + * @param nodeid to save + * @return None. ******************************************************************************/ -error_return_t Robus_SendMsg(service_t *service, msg_t *msg) +void Robus_SaveNodeID(uint16_t nodeid) { - // ********** Prepare the message ******************** - if (service->id != 0) - { - msg->header.source = service->id; - } - else - { - msg->header.source = Node_Get()->node_id; - } - if (Robus_SetTxTask(service, msg) == FAILED) - { - return FAILED; - } - return SUCCEED; + PortMng_SaveNodeID(nodeid); } -/****************************************************************************** - * @brief Start a topology detection procedure - * @param service pointer to the detecting service - * @return The number of detected node. - ******************************************************************************/ -uint16_t Robus_TopologyDetection(service_t *service) -{ - uint8_t redetect_nb = 0; - bool detect_enabled = true; - - // if a detection is in progress, - // Don't do an another detection and return 0 - if (Node_GetState() >= LOCAL_DETECTION) - { - return 0; - } - - while (detect_enabled) - { - detect_enabled = false; - - // Reset all detection state of services on the network - Robus_ResetNetworkDetection(service); - // Make sure that the detection is not interrupted - if (Node_GetState() == EXTERNAL_DETECTION) - { - return 0; - } - // setup local node - Node_Get()->node_id = 1; - last_node = 1; - // setup sending service - service->id = 1; - - if (Robus_DetectNextNodes(service) == FAILED) - { - // check the number of retry we made - LUOS_ASSERT((redetect_nb <= 4)); - // Detection fail, restart it - redetect_nb++; - detect_enabled = true; - } - } - return last_node; -} /****************************************************************************** - * @brief reset all service port states - * @param service pointer to the detecting service - * @return The number of detected node. + * @brief Reset the node id of the port table + * @param None + * @return None. ******************************************************************************/ -static error_return_t Robus_ResetNetworkDetection(service_t *service) +void Robus_ResetNodeID(void) { - msg_t msg; - uint8_t try_nbr = 0; - - msg.header.config = BASE_PROTOCOL; - msg.header.target = BROADCAST_VAL; - msg.header.target_mode = BROADCAST; - msg.header.cmd = START_DETECTION; - msg.header.size = 0; - - do - { - // if a detection is in progress, - // Don't do an another detection and return 0 - if (Node_GetState() >= LOCAL_DETECTION) - { - return 0; - } - // msg send not blocking - Robus_SendMsg(service, &msg); - // need to wait until tx msg before clear msg alloc - while (MsgAlloc_TxAllComplete() != SUCCEED) - ; - - // Reinit service id - Service_ClearId(); - - // Reinit msg alloc - MsgAlloc_Init(NULL); - - // wait for some 2ms to be sure all previous messages are received and treated - uint32_t start_tick = LuosHAL_GetSystick(); - while (LuosHAL_GetSystick() - start_tick < 2) - ; - try_nbr++; - } while ((MsgAlloc_IsEmpty() != SUCCEED) || (try_nbr > 5)); - - Node_Get()->node_id = 0; PortMng_Init(); - if (try_nbr < 5) - { - Node_SetState(LOCAL_DETECTION); - return SUCCEED; - } - - return FAILED; } + /****************************************************************************** - * @brief run the procedure allowing to detect the next nodes on the next port - * @param service pointer to the detecting service - * @return None. + * @brief Is Robus busy + * @param None + * @return nodeid. ******************************************************************************/ -static error_return_t Robus_DetectNextNodes(service_t *service) +bool Robus_Busy(void) { - // Lets try to poke other nodes - while (PortMng_PokeNextPort() == SUCCEED) - { - // There is someone here - // Clear spotted dead service detection - service->dead_service_spotted = 0; - // Ask an ID to the detector service. - msg_t msg; - msg.header.config = BASE_PROTOCOL; - msg.header.target_mode = NODEIDACK; - msg.header.target = 1; - msg.header.cmd = WRITE_NODE_ID; - msg.header.size = 0; - Robus_SendMsg(service, &msg); - // Wait the end of transmission - while (MsgAlloc_TxAllComplete() == FAILED) - ; - // Check if there is a failure on transmission - if (service->dead_service_spotted != 0) - { - // Message transmission failure - // Consider this port unconnected - Node_Get()->port_table[ctx.port.activ] = 0xFFFF; - ctx.port.activ = NBR_PORT; - ctx.port.keepLine = false; - continue; - } - - // when Robus loop will receive the reply it will store and manage the new node_id and send it to the next node. - // We just have to wait the end of the treatment of the entire branch - uint32_t start_tick = LuosHAL_GetSystick(); - while (ctx.port.keepLine) - { - LuosIO_Loop(); - if (LuosHAL_GetSystick() - start_tick > DETECTION_TIMEOUT_MS) - { - // topology detection is too long, we should abort it and restart - return FAILED; - } - } - } - return SUCCEED; + return PortMng_Busy(); } + /****************************************************************************** - * @brief check if received messages are protocols one and manage it if it is. - * @param msg pointer to the reeived message - * @return error_return_t SUCCEED if the message have been consumed. + * @brief Find the next neighbour on this phy + * @param None + * @return error_return_t ******************************************************************************/ -error_return_t Robus_MsgHandler(msg_t *input) +error_return_t Robus_FindNeighbour(void) { - msg_t output_msg; - node_bootstrap_t node_bootstrap; - service_t *service = Service_GetConcerned(&input->header); - switch (input->header.cmd) - { - case WRITE_NODE_ID: - // Depending on the size of the received data we have to do different things - switch (input->header.size) - { - case 0: - // Someone asking us a new node id (we are the detecting service) - // Increase the number of node_nb and send it back - last_node++; - output_msg.header.config = BASE_PROTOCOL; - output_msg.header.cmd = WRITE_NODE_ID; - output_msg.header.size = sizeof(uint16_t); - output_msg.header.target = input->header.source; - output_msg.header.target_mode = NODEIDACK; - memcpy(output_msg.data, (void *)&last_node, sizeof(uint16_t)); - Robus_SendMsg(service, &output_msg); - break; - case 2: - // This is a node id for the next node. - // This is a reply to our request to generate the next node id. - // This node_id is the one after the currently poked branch. - // We need to save this ID as a connection on a port - memcpy((void *)&Node_Get()->port_table[ctx.port.activ], (void *)&input->data[0], sizeof(uint16_t)); - // Now we can send it to the next node - memcpy((void *)&node_bootstrap.nodeid, (void *)&input->data[0], sizeof(uint16_t)); - node_bootstrap.prev_nodeid = Node_Get()->node_id; - output_msg.header.config = BASE_PROTOCOL; - output_msg.header.cmd = WRITE_NODE_ID; - output_msg.header.size = sizeof(node_bootstrap_t); - output_msg.header.target = 0; - output_msg.header.target_mode = NODEIDACK; - memcpy((void *)&output_msg.data[0], (void *)&node_bootstrap.unmap[0], sizeof(node_bootstrap_t)); - Robus_SendMsg(service, &output_msg); - break; - case sizeof(node_bootstrap_t): - if (Node_Get()->node_id != 0) - { - Node_Get()->node_id = 0; - // Reinit service id - Service_ClearId(); - MsgAlloc_Init(NULL); - } - // This is a node bootstrap information. - memcpy((void *)&node_bootstrap.unmap[0], (void *)&input->data[0], sizeof(node_bootstrap_t)); - Node_Get()->node_id = node_bootstrap.nodeid; - Node_Get()->port_table[ctx.port.activ] = node_bootstrap.prev_nodeid; - // Continue the topology detection on our other ports. - Robus_DetectNextNodes(service); - default: - break; - } - return SUCCEED; - break; - case START_DETECTION: - return SUCCEED; - break; - case END_DETECTION: - // Detect end of detection - Node_SetState(DETECTION_OK); - return FAILED; - break; - default: - return FAILED; - break; - } - return FAILED; -} + return PortMng_PokeNextPort(); +} \ No newline at end of file From 7534573efe5a1c5e8a536ccc0c53d294c10a8801 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 6 Apr 2023 16:17:06 +0200 Subject: [PATCH 034/150] Create a phy.h/c files defining phy structs --- engine/IO/inc/phy.h | 28 ++++++++++++++++++++++++++++ engine/IO/src/phy.c | 29 +++++++++++++++++++++++++++++ network/robus/src/reception.c | 15 ++++++++------- 3 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 engine/IO/inc/phy.h create mode 100644 engine/IO/src/phy.c diff --git a/engine/IO/inc/phy.h b/engine/IO/inc/phy.h new file mode 100644 index 000000000..cff517e01 --- /dev/null +++ b/engine/IO/inc/phy.h @@ -0,0 +1,28 @@ +/****************************************************************************** + * @file phy.h + * @brief interface with the phy + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _PHY_H_ +#define _PHY_H_ + +#include + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/****************************************************************************** + * @struct phy_t + * @brief the data structure allowing the phy to interract with LuosIO + ******************************************************************************/ +typedef struct phy_t +{ + int64_t rx_timestamp; + +} phy_t; + +void Phy_Init(void); + +#endif /* _PHY_H_ */ diff --git a/engine/IO/src/phy.c b/engine/IO/src/phy.c new file mode 100644 index 000000000..851896858 --- /dev/null +++ b/engine/IO/src/phy.c @@ -0,0 +1,29 @@ +/****************************************************************************** + * @file phy.c + * @brief Manage physical layers + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#include "phy.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/******************************************************************************* + * Variables + ******************************************************************************/ + +/******************************************************************************* + * Functions + ******************************************************************************/ + +/****************************************************************************** + * @brief POhy initialization + * @param None + * @return None + ******************************************************************************/ +void Phy_Init(void) +{ +} \ No newline at end of file diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index c433c577a..f6fa735d8 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -47,7 +47,6 @@ #include "robus_hal.h" #include "luos_hal.h" #include "pub_sub.h" -#include "transmission.h" #include "msg_alloc.h" #include "luos_utils.h" #include "_timestamp.h" @@ -56,6 +55,7 @@ #include "filter.h" #include "struct_engine.h" #include "context.h" +#include "phy.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -73,10 +73,10 @@ /******************************************************************************* * Variables ******************************************************************************/ -uint16_t data_count = 0; -uint16_t data_size = 0; -uint16_t crc_val = 0; -static int64_t ll_rx_timestamp = 0; +uint16_t data_count = 0; +uint16_t data_size = 0; +uint16_t crc_val = 0; +phy_t phy; /******************************************************************************* * Function @@ -93,6 +93,7 @@ void Recep_Init(void) ctx.rx.status.unmap = 0; ctx.rx.callback = Recep_GetHeader; ctx.rx.status.identifier = 0xF; + phy.rx_timestamp = 0; } /****************************************************************************** * @brief Callback to get a complete header @@ -112,7 +113,7 @@ _CRITICAL void Recep_GetHeader(volatile uint8_t *data) case 1: // reset CRC computation // when we catch the first byte we timestamp the msg // -8 : time to transmit 8 bits at 1 us/bit - ll_rx_timestamp = LuosHAL_GetTimestamp() - BYTE_TRANSMIT_TIME; + phy.rx_timestamp = LuosHAL_GetTimestamp() - BYTE_TRANSMIT_TIME; ctx.tx.lock = true; // Switch the transmit status to disable to be sure to not interpreat the end timeout as an end of transmission. @@ -207,7 +208,7 @@ _CRITICAL void Recep_GetData(volatile uint8_t *data) if (Luos_IsMsgTimstamped((msg_t *)current_msg)) { // This conversion also remove the timestamp from the message size. - Timestamp_ConvertToDate((msg_t *)current_msg, ll_rx_timestamp); + Timestamp_ConvertToDate((msg_t *)current_msg, phy.rx_timestamp); } // Make an exception for bootloader command From ab2035e316a416c1bcd8cdde5f753379cb8c5aa5 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 6 Apr 2023 17:32:00 +0200 Subject: [PATCH 035/150] Move back rx and tx init into robus --- engine/IO/src/luos_io.c | 6 ------ network/robus/src/robus.c | 7 ++++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 3eac78e34..74f9104fc 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -59,12 +59,6 @@ void LuosIO_Init(memory_stats_t *memory_stats) Filter_IdInit(); Filter_TopicInit(); - // Init transmission - Transmit_Init(); - - // Init reception - Recep_Init(); - // Clear message allocation buffer table MsgAlloc_Init(memory_stats); diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index 65d0c649e..f31480aca 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -43,8 +43,13 @@ void Robus_Init(void) // Init hal RobusHAL_Init(); - // Init detection structure + // Init port structure PortMng_Init(); + + // Init transmission + Transmit_Init(); + // Init reception + Recep_Init(); } /****************************************************************************** From dce87651a2c2df53d881df0c58e80e6d088b9d68 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 6 Apr 2023 17:33:41 +0200 Subject: [PATCH 036/150] Manage phy instantiation --- engine/IO/inc/luos_phy.h | 39 +++++++++++++++++++ engine/IO/inc/phy.h | 28 ------------- engine/IO/src/{phy.c => luos_phy.c} | 32 ++++++++++++++- .../ESP32/button_arduino/sdkconfig.esp32dev | 30 ++++++++++++-- .../ESP32/gate_serialcom/sdkconfig.esp32dev | 25 +++++++++--- .../gate_serialcom_arduino/sdkconfig.esp32dev | 30 ++++++++++++-- .../ESP32/gate_wscom/sdkconfig.esp32dev | 21 ++++++++-- .../gate_wscom_arduino/sdkconfig.esp32dev | 30 ++++++++++++-- network/robus/HAL/ATSAMD21/robus_hal.c | 2 +- .../robus/HAL/ATSAMD21_ARDUINO/robus_hal.c | 2 +- network/robus/HAL/ATSAMD21_MBED/robus_hal.c | 2 +- network/robus/HAL/ESP32/robus_hal.c | 2 +- network/robus/HAL/NATIVE/robus_hal.c | 2 +- network/robus/HAL/STM32F0/robus_hal.c | 2 +- network/robus/HAL/STM32F4/robus_hal.c | 2 +- network/robus/HAL/STM32G4/robus_hal.c | 2 +- network/robus/HAL/STM32L0/robus_hal.c | 2 +- network/robus/HAL/STM32L4/robus_hal.c | 2 +- network/robus/HAL/template/robus_hal.c | 4 +- network/robus/inc/reception.h | 24 ++++++------ network/robus/inc/robus.h | 2 +- network/robus/src/reception.c | 30 +++++++------- network/robus/src/robus.c | 18 ++++++++- 23 files changed, 242 insertions(+), 91 deletions(-) create mode 100644 engine/IO/inc/luos_phy.h delete mode 100644 engine/IO/inc/phy.h rename engine/IO/src/{phy.c => luos_phy.c} (52%) diff --git a/engine/IO/inc/luos_phy.h b/engine/IO/inc/luos_phy.h new file mode 100644 index 000000000..7aea41d45 --- /dev/null +++ b/engine/IO/inc/luos_phy.h @@ -0,0 +1,39 @@ +/****************************************************************************** + * @file phy.h + * @brief interface with the phy + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _LUOS_PHY_H_ +#define _LUOS_PHY_H_ + +#include + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/****************************************************************************** + * @struct luos_luos_phy_t + * @brief the data structure allowing the phy to interract with LuosIO + ******************************************************************************/ +typedef struct luos_luos_phy_t +{ + volatile int64_t rx_timestamp; // Timestamp of the last received message. We will use it to compute the date based on received latency. + uint8_t *rx_buffer_base; // Pointer to the base of the buffer where we will store the begining of received data. + volatile uint8_t *rx_data; // Pointer to write received bytes. + volatile uint16_t rx_size; // Size of data to receive data. + struct __attribute__((__packed__)) + { + volatile uint8_t rx_alloc_job : 1; // If true, loop will need to filter already received data, if filter is ok, set rx_keep, alloc space, move *rx_data to point at the good place on allocator, put the number of bytes remaining on rx_size, and copy already received data in the allocated space. + volatile uint8_t rx_keep : 1; // True if we want to keep the received data. + }; +} luos_phy_t; + +void Phy_Init(void); +void Phy_Loop(void); +luos_phy_t *Phy_Create(void); + +void Phy_Send(luos_phy_t *phy, uint8_t *data, uint16_t size); + +#endif /* _LUOS_PHY_H_ */ diff --git a/engine/IO/inc/phy.h b/engine/IO/inc/phy.h deleted file mode 100644 index cff517e01..000000000 --- a/engine/IO/inc/phy.h +++ /dev/null @@ -1,28 +0,0 @@ -/****************************************************************************** - * @file phy.h - * @brief interface with the phy - * @author Luos - * @version 0.0.0 - ******************************************************************************/ -#ifndef _PHY_H_ -#define _PHY_H_ - -#include - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/****************************************************************************** - * @struct phy_t - * @brief the data structure allowing the phy to interract with LuosIO - ******************************************************************************/ -typedef struct phy_t -{ - int64_t rx_timestamp; - -} phy_t; - -void Phy_Init(void); - -#endif /* _PHY_H_ */ diff --git a/engine/IO/src/phy.c b/engine/IO/src/luos_phy.c similarity index 52% rename from engine/IO/src/phy.c rename to engine/IO/src/luos_phy.c index 851896858..2833b6e22 100644 --- a/engine/IO/src/phy.c +++ b/engine/IO/src/luos_phy.c @@ -5,7 +5,7 @@ * @version 0.0.0 ******************************************************************************/ -#include "phy.h" +#include "luos_phy.h" /******************************************************************************* * Definitions @@ -14,6 +14,7 @@ /******************************************************************************* * Variables ******************************************************************************/ +luos_phy_t phy; /******************************************************************************* * Functions @@ -26,4 +27,33 @@ ******************************************************************************/ void Phy_Init(void) { +} + +/****************************************************************************** + * @brief Phy loop + * @param None + * @return None + ******************************************************************************/ +void Phy_Loop(void) +{ +} + +/****************************************************************************** + * @brief Instanciate a physical layer + * @param None + * @return None + ******************************************************************************/ +luos_phy_t *Phy_Create(void) +{ + return &phy; +} + +/****************************************************************************** + * @brief Send data on the physical layer + * @param data Data to send + * @param size Size of the data to send + * @return None + ******************************************************************************/ +void Phy_Send(luos_phy_t *phy, uint8_t *data, uint16_t size) +{ } \ No newline at end of file diff --git a/examples/projects/ESP32/button_arduino/sdkconfig.esp32dev b/examples/projects/ESP32/button_arduino/sdkconfig.esp32dev index d0dec9acf..466eb0ad5 100644 --- a/examples/projects/ESP32/button_arduino/sdkconfig.esp32dev +++ b/examples/projects/ESP32/button_arduino/sdkconfig.esp32dev @@ -54,6 +54,7 @@ CONFIG_BOOTLOADER_LOG_LEVEL=3 CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set # CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y CONFIG_BOOTLOADER_WDT_ENABLE=y # CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set CONFIG_BOOTLOADER_WDT_TIME_MS=9000 @@ -95,6 +96,9 @@ CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set CONFIG_ESPTOOLPY_FLASHSIZE="2MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y @@ -131,6 +135,7 @@ CONFIG_PARTITION_TABLE_MD5=y # # Arduino Configuration # +CONFIG_ARDUINO_VARIANT="esp32" CONFIG_ENABLE_ARDUINO_DEPENDS=y CONFIG_AUTOSTART_ARDUINO=y # CONFIG_ARDUINO_RUN_CORE0 is not set @@ -142,11 +147,17 @@ CONFIG_ARDUINO_LOOP_STACK_SIZE=8192 CONFIG_ARDUINO_EVENT_RUN_CORE1=y # CONFIG_ARDUINO_EVENT_RUN_NO_AFFINITY is not set CONFIG_ARDUINO_EVENT_RUNNING_CORE=1 +# CONFIG_ARDUINO_SERIAL_EVENT_RUN_CORE0 is not set +# CONFIG_ARDUINO_SERIAL_EVENT_RUN_CORE1 is not set +CONFIG_ARDUINO_SERIAL_EVENT_RUN_NO_AFFINITY=y +CONFIG_ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE=-1 +CONFIG_ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE=2048 +CONFIG_ARDUINO_SERIAL_EVENT_TASK_PRIORITY=24 # CONFIG_ARDUINO_UDP_RUN_CORE0 is not set CONFIG_ARDUINO_UDP_RUN_CORE1=y # CONFIG_ARDUINO_UDP_RUN_NO_AFFINITY is not set -CONFIG_ARDUINO_UDP_TASK_PRIORITY=3 CONFIG_ARDUINO_UDP_RUNNING_CORE=1 +CONFIG_ARDUINO_UDP_TASK_PRIORITY=3 # CONFIG_ARDUINO_ISR_IRAM is not set CONFIG_DISABLE_HAL_LOCKS=y @@ -310,8 +321,8 @@ CONFIG_EFUSE_MAX_BLK_LEN=192 # CONFIG_ESP_TLS_USING_MBEDTLS=y # CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set -# CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_PSK_VERIFICATION is not set # CONFIG_ESP_TLS_INSECURE is not set # end of ESP-TLS @@ -519,6 +530,13 @@ CONFIG_ESP_PHY_REDUCE_TX_POWER=y # CONFIG_PM_ENABLE is not set # end of Power Management +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + # # ESP System Settings # @@ -602,6 +620,7 @@ CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set # end of Wi-Fi # @@ -948,6 +967,7 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y # CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set # CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set # CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 # end of Certificate Bundle # CONFIG_MBEDTLS_ECP_RESTARTABLE is not set @@ -1099,6 +1119,7 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y # # NVS # +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set # end of NVS # @@ -1236,7 +1257,6 @@ CONFIG_VFS_SUPPORT_TERMIOS=y # Host File System I/O (Semihosting) # CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -CONFIG_VFS_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 # end of Host File System I/O (Semihosting) # end of Virtual file system @@ -1253,6 +1273,7 @@ CONFIG_WL_SECTOR_SIZE=4096 # CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 +CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y # end of Wi-Fi Provisioning Manager # @@ -1265,6 +1286,8 @@ CONFIG_WPA_MBEDTLS_CRYPTO=y # CONFIG_WPA_TESTING_OPTIONS is not set # CONFIG_WPA_WPS_STRICT is not set # CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set # end of Supplicant # end of Component config @@ -1433,5 +1456,4 @@ CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 # End of deprecated options diff --git a/examples/projects/ESP32/gate_serialcom/sdkconfig.esp32dev b/examples/projects/ESP32/gate_serialcom/sdkconfig.esp32dev index 27849c495..bdebf7235 100644 --- a/examples/projects/ESP32/gate_serialcom/sdkconfig.esp32dev +++ b/examples/projects/ESP32/gate_serialcom/sdkconfig.esp32dev @@ -54,6 +54,7 @@ CONFIG_BOOTLOADER_LOG_LEVEL=3 CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set # CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y CONFIG_BOOTLOADER_WDT_ENABLE=y # CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set CONFIG_BOOTLOADER_WDT_TIME_MS=9000 @@ -95,6 +96,9 @@ CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set CONFIG_ESPTOOLPY_FLASHSIZE="2MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y @@ -263,8 +267,8 @@ CONFIG_EFUSE_MAX_BLK_LEN=192 # CONFIG_ESP_TLS_USING_MBEDTLS=y # CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set -# CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_PSK_VERIFICATION is not set # CONFIG_ESP_TLS_INSECURE is not set # end of ESP-TLS @@ -472,6 +476,13 @@ CONFIG_ESP_PHY_REDUCE_TX_POWER=y # CONFIG_PM_ENABLE is not set # end of Power Management +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + # # ESP System Settings # @@ -557,6 +568,7 @@ CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set # end of Wi-Fi # @@ -903,6 +915,7 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y # CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set # CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set # CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 # end of Certificate Bundle # CONFIG_MBEDTLS_ECP_RESTARTABLE is not set @@ -1050,6 +1063,7 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y # # NVS # +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set # end of NVS # @@ -1187,7 +1201,6 @@ CONFIG_VFS_SUPPORT_TERMIOS=y # Host File System I/O (Semihosting) # CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -CONFIG_VFS_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 # end of Host File System I/O (Semihosting) # end of Virtual file system @@ -1204,6 +1217,7 @@ CONFIG_WL_SECTOR_SIZE=4096 # CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 +CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y # end of Wi-Fi Provisioning Manager # @@ -1216,6 +1230,8 @@ CONFIG_WPA_MBEDTLS_CRYPTO=y # CONFIG_WPA_TESTING_OPTIONS is not set # CONFIG_WPA_WPS_STRICT is not set # CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set # end of Supplicant # end of Component config @@ -1306,8 +1322,8 @@ CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y # CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set # CONFIG_ESP32S2_PANIC_GDBSTUB is not set CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 -CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_MAIN_TASK_STACK_SIZE=3584 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=4096 +CONFIG_MAIN_TASK_STACK_SIZE=8192 # CONFIG_CONSOLE_UART_DEFAULT is not set CONFIG_CONSOLE_UART_CUSTOM=y # CONFIG_ESP_CONSOLE_UART_NONE is not set @@ -1386,5 +1402,4 @@ CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 # End of deprecated options diff --git a/examples/projects/ESP32/gate_serialcom_arduino/sdkconfig.esp32dev b/examples/projects/ESP32/gate_serialcom_arduino/sdkconfig.esp32dev index b5d0c4dbb..b654c993a 100644 --- a/examples/projects/ESP32/gate_serialcom_arduino/sdkconfig.esp32dev +++ b/examples/projects/ESP32/gate_serialcom_arduino/sdkconfig.esp32dev @@ -54,6 +54,7 @@ CONFIG_BOOTLOADER_LOG_LEVEL=1 CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set # CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y CONFIG_BOOTLOADER_WDT_ENABLE=y # CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set CONFIG_BOOTLOADER_WDT_TIME_MS=9000 @@ -95,6 +96,9 @@ CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set CONFIG_ESPTOOLPY_FLASHSIZE="2MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y @@ -131,6 +135,7 @@ CONFIG_PARTITION_TABLE_MD5=y # # Arduino Configuration # +CONFIG_ARDUINO_VARIANT="esp32" CONFIG_ENABLE_ARDUINO_DEPENDS=y CONFIG_AUTOSTART_ARDUINO=y # CONFIG_ARDUINO_RUN_CORE0 is not set @@ -142,11 +147,17 @@ CONFIG_ARDUINO_LOOP_STACK_SIZE=8192 CONFIG_ARDUINO_EVENT_RUN_CORE1=y # CONFIG_ARDUINO_EVENT_RUN_NO_AFFINITY is not set CONFIG_ARDUINO_EVENT_RUNNING_CORE=1 +# CONFIG_ARDUINO_SERIAL_EVENT_RUN_CORE0 is not set +# CONFIG_ARDUINO_SERIAL_EVENT_RUN_CORE1 is not set +CONFIG_ARDUINO_SERIAL_EVENT_RUN_NO_AFFINITY=y +CONFIG_ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE=-1 +CONFIG_ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE=2048 +CONFIG_ARDUINO_SERIAL_EVENT_TASK_PRIORITY=24 # CONFIG_ARDUINO_UDP_RUN_CORE0 is not set CONFIG_ARDUINO_UDP_RUN_CORE1=y # CONFIG_ARDUINO_UDP_RUN_NO_AFFINITY is not set -CONFIG_ARDUINO_UDP_TASK_PRIORITY=3 CONFIG_ARDUINO_UDP_RUNNING_CORE=1 +CONFIG_ARDUINO_UDP_TASK_PRIORITY=3 # CONFIG_ARDUINO_ISR_IRAM is not set CONFIG_DISABLE_HAL_LOCKS=y @@ -310,8 +321,8 @@ CONFIG_EFUSE_MAX_BLK_LEN=192 # CONFIG_ESP_TLS_USING_MBEDTLS=y # CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set -# CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_PSK_VERIFICATION is not set # CONFIG_ESP_TLS_INSECURE is not set # end of ESP-TLS @@ -519,6 +530,13 @@ CONFIG_ESP_PHY_REDUCE_TX_POWER=y # CONFIG_PM_ENABLE is not set # end of Power Management +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + # # ESP System Settings # @@ -604,6 +622,7 @@ CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set # end of Wi-Fi # @@ -952,6 +971,7 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y # CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set # CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set # CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 # end of Certificate Bundle # CONFIG_MBEDTLS_ECP_RESTARTABLE is not set @@ -1103,6 +1123,7 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y # # NVS # +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set # end of NVS # @@ -1240,7 +1261,6 @@ CONFIG_VFS_SUPPORT_TERMIOS=y # Host File System I/O (Semihosting) # CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -CONFIG_VFS_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 # end of Host File System I/O (Semihosting) # end of Virtual file system @@ -1257,6 +1277,7 @@ CONFIG_WL_SECTOR_SIZE=4096 # CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 +CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y # end of Wi-Fi Provisioning Manager # @@ -1269,6 +1290,8 @@ CONFIG_WPA_MBEDTLS_CRYPTO=y # CONFIG_WPA_TESTING_OPTIONS is not set # CONFIG_WPA_WPS_STRICT is not set # CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set # end of Supplicant # end of Component config @@ -1439,5 +1462,4 @@ CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 # End of deprecated options diff --git a/examples/projects/ESP32/gate_wscom/sdkconfig.esp32dev b/examples/projects/ESP32/gate_wscom/sdkconfig.esp32dev index 2576ae935..0d6b5cac7 100644 --- a/examples/projects/ESP32/gate_wscom/sdkconfig.esp32dev +++ b/examples/projects/ESP32/gate_wscom/sdkconfig.esp32dev @@ -54,6 +54,7 @@ CONFIG_BOOTLOADER_LOG_LEVEL=3 CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set # CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y CONFIG_BOOTLOADER_WDT_ENABLE=y # CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set CONFIG_BOOTLOADER_WDT_TIME_MS=9000 @@ -95,6 +96,9 @@ CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set CONFIG_ESPTOOLPY_FLASHSIZE="2MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y @@ -263,8 +267,8 @@ CONFIG_EFUSE_MAX_BLK_LEN=192 # CONFIG_ESP_TLS_USING_MBEDTLS=y # CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set -# CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_PSK_VERIFICATION is not set # CONFIG_ESP_TLS_INSECURE is not set # end of ESP-TLS @@ -472,6 +476,13 @@ CONFIG_ESP_PHY_REDUCE_TX_POWER=y # CONFIG_PM_ENABLE is not set # end of Power Management +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + # # ESP System Settings # @@ -559,6 +570,7 @@ CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set # end of Wi-Fi # @@ -905,6 +917,7 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y # CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set # CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set # CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 # end of Certificate Bundle # CONFIG_MBEDTLS_ECP_RESTARTABLE is not set @@ -1056,6 +1069,7 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y # # NVS # +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set # end of NVS # @@ -1193,7 +1207,6 @@ CONFIG_VFS_SUPPORT_TERMIOS=y # Host File System I/O (Semihosting) # CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -CONFIG_VFS_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 # end of Host File System I/O (Semihosting) # end of Virtual file system @@ -1210,6 +1223,7 @@ CONFIG_WL_SECTOR_SIZE=4096 # CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 +CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y # end of Wi-Fi Provisioning Manager # @@ -1222,6 +1236,8 @@ CONFIG_WPA_MBEDTLS_CRYPTO=y # CONFIG_WPA_TESTING_OPTIONS is not set # CONFIG_WPA_WPS_STRICT is not set # CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set # end of Supplicant # end of Component config @@ -1394,5 +1410,4 @@ CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 # End of deprecated options diff --git a/examples/projects/ESP32/gate_wscom_arduino/sdkconfig.esp32dev b/examples/projects/ESP32/gate_wscom_arduino/sdkconfig.esp32dev index b5d0c4dbb..b654c993a 100644 --- a/examples/projects/ESP32/gate_wscom_arduino/sdkconfig.esp32dev +++ b/examples/projects/ESP32/gate_wscom_arduino/sdkconfig.esp32dev @@ -54,6 +54,7 @@ CONFIG_BOOTLOADER_LOG_LEVEL=1 CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y # CONFIG_BOOTLOADER_FACTORY_RESET is not set # CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y CONFIG_BOOTLOADER_WDT_ENABLE=y # CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set CONFIG_BOOTLOADER_WDT_TIME_MS=9000 @@ -95,6 +96,9 @@ CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y # CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set CONFIG_ESPTOOLPY_FLASHSIZE="2MB" CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y CONFIG_ESPTOOLPY_BEFORE_RESET=y @@ -131,6 +135,7 @@ CONFIG_PARTITION_TABLE_MD5=y # # Arduino Configuration # +CONFIG_ARDUINO_VARIANT="esp32" CONFIG_ENABLE_ARDUINO_DEPENDS=y CONFIG_AUTOSTART_ARDUINO=y # CONFIG_ARDUINO_RUN_CORE0 is not set @@ -142,11 +147,17 @@ CONFIG_ARDUINO_LOOP_STACK_SIZE=8192 CONFIG_ARDUINO_EVENT_RUN_CORE1=y # CONFIG_ARDUINO_EVENT_RUN_NO_AFFINITY is not set CONFIG_ARDUINO_EVENT_RUNNING_CORE=1 +# CONFIG_ARDUINO_SERIAL_EVENT_RUN_CORE0 is not set +# CONFIG_ARDUINO_SERIAL_EVENT_RUN_CORE1 is not set +CONFIG_ARDUINO_SERIAL_EVENT_RUN_NO_AFFINITY=y +CONFIG_ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE=-1 +CONFIG_ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE=2048 +CONFIG_ARDUINO_SERIAL_EVENT_TASK_PRIORITY=24 # CONFIG_ARDUINO_UDP_RUN_CORE0 is not set CONFIG_ARDUINO_UDP_RUN_CORE1=y # CONFIG_ARDUINO_UDP_RUN_NO_AFFINITY is not set -CONFIG_ARDUINO_UDP_TASK_PRIORITY=3 CONFIG_ARDUINO_UDP_RUNNING_CORE=1 +CONFIG_ARDUINO_UDP_TASK_PRIORITY=3 # CONFIG_ARDUINO_ISR_IRAM is not set CONFIG_DISABLE_HAL_LOCKS=y @@ -310,8 +321,8 @@ CONFIG_EFUSE_MAX_BLK_LEN=192 # CONFIG_ESP_TLS_USING_MBEDTLS=y # CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set -# CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER is not set # CONFIG_ESP_TLS_PSK_VERIFICATION is not set # CONFIG_ESP_TLS_INSECURE is not set # end of ESP-TLS @@ -519,6 +530,13 @@ CONFIG_ESP_PHY_REDUCE_TX_POWER=y # CONFIG_PM_ENABLE is not set # end of Power Management +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + # # ESP System Settings # @@ -604,6 +622,7 @@ CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set # end of Wi-Fi # @@ -952,6 +971,7 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y # CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set # CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set # CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 # end of Certificate Bundle # CONFIG_MBEDTLS_ECP_RESTARTABLE is not set @@ -1103,6 +1123,7 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y # # NVS # +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set # end of NVS # @@ -1240,7 +1261,6 @@ CONFIG_VFS_SUPPORT_TERMIOS=y # Host File System I/O (Semihosting) # CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -CONFIG_VFS_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 # end of Host File System I/O (Semihosting) # end of Virtual file system @@ -1257,6 +1277,7 @@ CONFIG_WL_SECTOR_SIZE=4096 # CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 +CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y # end of Wi-Fi Provisioning Manager # @@ -1269,6 +1290,8 @@ CONFIG_WPA_MBEDTLS_CRYPTO=y # CONFIG_WPA_TESTING_OPTIONS is not set # CONFIG_WPA_WPS_STRICT is not set # CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set # end of Supplicant # end of Component config @@ -1439,5 +1462,4 @@ CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 -CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN=128 # End of deprecated options diff --git a/network/robus/HAL/ATSAMD21/robus_hal.c b/network/robus/HAL/ATSAMD21/robus_hal.c index 1fe81e351..9636840ab 100644 --- a/network/robus/HAL/ATSAMD21/robus_hal.c +++ b/network/robus/HAL/ATSAMD21/robus_hal.c @@ -211,7 +211,7 @@ _CRITICAL void LUOS_COM_IRQHANDLER() { // clean start bit detection uint8_t data = LUOS_COM->USART_INT.SERCOM_DATA; - ctx.rx.callback(&data); + Recep_data(&data); if (data_size_to_transmit == 0) { LUOS_COM->USART_INT.SERCOM_STATUS = SERCOM_USART_INT_STATUS_PERR_Msk | SERCOM_USART_INT_STATUS_FERR_Msk | SERCOM_USART_INT_STATUS_BUFOVF_Msk; diff --git a/network/robus/HAL/ATSAMD21_ARDUINO/robus_hal.c b/network/robus/HAL/ATSAMD21_ARDUINO/robus_hal.c index 55654e652..9667c916f 100644 --- a/network/robus/HAL/ATSAMD21_ARDUINO/robus_hal.c +++ b/network/robus/HAL/ATSAMD21_ARDUINO/robus_hal.c @@ -214,7 +214,7 @@ _CRITICAL void LUOS_COM_IRQHANDLER() { // clean start bit detection uint8_t data = LUOS_COM->USART.DATA.reg; - ctx.rx.callback(&data); + Recep_data(&data); if (data_size_to_transmit == 0) { LUOS_COM->USART.STATUS.reg = SERCOM_USART_STATUS_PERR | SERCOM_USART_STATUS_FERR | SERCOM_USART_STATUS_BUFOVF; diff --git a/network/robus/HAL/ATSAMD21_MBED/robus_hal.c b/network/robus/HAL/ATSAMD21_MBED/robus_hal.c index 586e0ecff..9549a0d4e 100644 --- a/network/robus/HAL/ATSAMD21_MBED/robus_hal.c +++ b/network/robus/HAL/ATSAMD21_MBED/robus_hal.c @@ -213,7 +213,7 @@ _CRITICAL void LUOS_COM_IRQHANDLER() { // clean start bit detection uint8_t data = LUOS_COM->USART.DATA.reg; - ctx.rx.callback(&data); + Recep_data(&data); if (data_size_to_transmit == 0) { LUOS_COM->USART.STATUS.reg = SERCOM_USART_STATUS_PERR | SERCOM_USART_STATUS_FERR | SERCOM_USART_STATUS_BUFOVF; diff --git a/network/robus/HAL/ESP32/robus_hal.c b/network/robus/HAL/ESP32/robus_hal.c index 66853fcee..4a590f902 100644 --- a/network/robus/HAL/ESP32/robus_hal.c +++ b/network/robus/HAL/ESP32/robus_hal.c @@ -275,7 +275,7 @@ _CRITICAL void RobusHAL_ComIrqHandler(void *arg) uart_hal_clr_intsts_mask(&uart_hal_context, UART_INTR_RXFIFO_FULL | UART_INTR_RXFIFO_TOUT); if (RxEn == true) { - ctx.rx.callback(&data[size - 1]); + Recep_data(&data[size - 1]); } else { diff --git a/network/robus/HAL/NATIVE/robus_hal.c b/network/robus/HAL/NATIVE/robus_hal.c index 5fe50a05d..af4c1d014 100644 --- a/network/robus/HAL/NATIVE/robus_hal.c +++ b/network/robus/HAL/NATIVE/robus_hal.c @@ -209,7 +209,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) #endif for (uint16_t i = 0; i < (int)wm->data.len; i++) { - ctx.rx.callback((volatile uint8_t *)&wm->data.ptr[i]); + Recep_data((volatile uint8_t *)&wm->data.ptr[i]); } #ifdef WS_PRINT printf("\n"); diff --git a/network/robus/HAL/STM32F0/robus_hal.c b/network/robus/HAL/STM32F0/robus_hal.c index 1e9ce2ed0..d53a24652 100644 --- a/network/robus/HAL/STM32F0/robus_hal.c +++ b/network/robus/HAL/STM32F0/robus_hal.c @@ -201,7 +201,7 @@ _CRITICAL void LUOS_COM_IRQHANDLER() { // We receive a byte uint8_t data = LL_USART_ReceiveData8(LUOS_COM); - ctx.rx.callback(&data); // send reception byte to state machine + Recep_data(&data); // send reception byte to state machine if (data_size_to_transmit == 0) { LUOS_COM->ICR = 0xFFFFFFFF; diff --git a/network/robus/HAL/STM32F4/robus_hal.c b/network/robus/HAL/STM32F4/robus_hal.c index b5b1bd02d..49985e5e6 100644 --- a/network/robus/HAL/STM32F4/robus_hal.c +++ b/network/robus/HAL/STM32F4/robus_hal.c @@ -202,7 +202,7 @@ _CRITICAL void LUOS_COM_IRQHANDLER() { // We receive a byte uint8_t data = LL_USART_ReceiveData8(LUOS_COM); - ctx.rx.callback(&data); // send reception byte to state machine + Recep_data(&data); // send reception byte to state machine if (data_size_to_transmit == 0) { LUOS_COM->SR = 0xFFFFFFFF; diff --git a/network/robus/HAL/STM32G4/robus_hal.c b/network/robus/HAL/STM32G4/robus_hal.c index 9970d9b7e..dc70622c2 100644 --- a/network/robus/HAL/STM32G4/robus_hal.c +++ b/network/robus/HAL/STM32G4/robus_hal.c @@ -202,7 +202,7 @@ _CRITICAL void LUOS_COM_IRQHANDLER() { // We receive a byte uint8_t data = LL_USART_ReceiveData8(LUOS_COM); - ctx.rx.callback(&data); // send reception byte to state machine + Recep_data(&data); // send reception byte to state machine if (data_size_to_transmit == 0) { LUOS_COM->ICR = 0xFFFFFFFF; diff --git a/network/robus/HAL/STM32L0/robus_hal.c b/network/robus/HAL/STM32L0/robus_hal.c index d30035d1b..5a25f9417 100644 --- a/network/robus/HAL/STM32L0/robus_hal.c +++ b/network/robus/HAL/STM32L0/robus_hal.c @@ -201,7 +201,7 @@ void LUOS_COM_IRQHANDLER() { // We receive a byte uint8_t data = LL_USART_ReceiveData8(LUOS_COM); - ctx.rx.callback(&data); // send reception byte to state machine + Recep_data(&data); // send reception byte to state machine if (data_size_to_transmit == 0) { LUOS_COM->ICR = 0xFFFFFFFF; diff --git a/network/robus/HAL/STM32L4/robus_hal.c b/network/robus/HAL/STM32L4/robus_hal.c index 1c810b1cc..aadc29a1f 100644 --- a/network/robus/HAL/STM32L4/robus_hal.c +++ b/network/robus/HAL/STM32L4/robus_hal.c @@ -202,7 +202,7 @@ _CRITICAL void LUOS_COM_IRQHANDLER() { // We receive a byte uint8_t data = LL_USART_ReceiveData8(LUOS_COM); - ctx.rx.callback(&data); // send reception byte to state machine + Recep_data(&data); // send reception byte to state machine if (data_size_to_transmit == 0) { LUOS_COM->ICR = 0xFFFFFFFF; diff --git a/network/robus/HAL/template/robus_hal.c b/network/robus/HAL/template/robus_hal.c index f194908f6..ba0ee0e45 100644 --- a/network/robus/HAL/template/robus_hal.c +++ b/network/robus/HAL/template/robus_hal.c @@ -226,7 +226,7 @@ void LUOS_COM_IRQHANDLER() * 1. Reset the timeout with the default value each time this function is call * * 2. Check if IRQ flag Rx is active (this means that this IRAQ have been raised because we receive a byte) - * Read the received byte and pass it to ctx.rx.callback(byte). + * Read the received byte and pass it to Recep_data(byte). * This function is the Robus reception state machine allowing to check and decode Luos frames. * * 3. Check framing error @@ -247,7 +247,7 @@ void LUOS_COM_IRQHANDLER() if ("Reception buffer not empty interrupt is true and enable") { // Get data from register - ctx.rx.callback(&data); // Send received byte to the Robus state machine + Recep_data(&data); // Send received byte to the Robus state machine if (data_size_to_transmit == 0) { // Clear error IT diff --git a/network/robus/inc/reception.h b/network/robus/inc/reception.h index 46a107081..5d47919ed 100644 --- a/network/robus/inc/reception.h +++ b/network/robus/inc/reception.h @@ -7,12 +7,13 @@ #ifndef _RECEPTION_H_ #define _RECEPTION_H_ -#include "robus.h" +#include "luos_phy.h" #include "struct_io.h" +#include "luos_io.h" /******************************************************************************* * Definitions ******************************************************************************/ -typedef void (*DATA_CB)(volatile uint8_t *data); +typedef void (*DATA_CB)(luos_phy_t *phy, volatile uint8_t *data); typedef struct __attribute__((__packed__)) { @@ -35,23 +36,22 @@ typedef struct status_t status; } RxCom_t; -/******************************************************************************* - * Variables - ******************************************************************************/ - /******************************************************************************* * Function ******************************************************************************/ + +void Recep_data(volatile uint8_t *data); + // Callbacks reception -void Recep_GetHeader(volatile uint8_t *data); -void Recep_GetData(volatile uint8_t *data); -void Recep_GetCollision(volatile uint8_t *data); -void Recep_Drop(volatile uint8_t *data); +void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data); +void Recep_GetData(luos_phy_t *phy_robus, volatile uint8_t *data); +void Recep_GetCollision(luos_phy_t *phy_robus, volatile uint8_t *data); +void Recep_Drop(luos_phy_t *phy_robus, volatile uint8_t *data); // Callbacks send -void Recep_CatchAck(volatile uint8_t *data); +void Recep_CatchAck(luos_phy_t *phy_robus, volatile uint8_t *data); -void Recep_Init(void); +void Recep_Init(luos_phy_t *phy_robus); void Recep_EndMsg(void); void Recep_Reset(void); void Recep_Timeout(void); diff --git a/network/robus/inc/robus.h b/network/robus/inc/robus.h index a0de76386..5b4421f1b 100644 --- a/network/robus/inc/robus.h +++ b/network/robus/inc/robus.h @@ -7,8 +7,8 @@ #ifndef _ROBUS_H_ #define _ROBUS_H_ -#include "luos_io.h" #include +#include "luos_io.h" /******************************************************************************* * Function diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index f6fa735d8..a4e97b80a 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -19,7 +19,7 @@ * v | | | * Header complete | | source ID |yes * + | | received +------>Disable Rx - * | yes | | + | + + * | yes | | + | + * v | | |no | | * +------+------+ +-------------+ | no| v | v * | Get | | Get | +------+ Collision | Wait End @@ -41,9 +41,9 @@ * +-------------+ +-----------------+ ***********************************************************************************************/ -#include "reception.h" #include #include +#include "reception.h" #include "robus_hal.h" #include "luos_hal.h" #include "pub_sub.h" @@ -55,7 +55,6 @@ #include "filter.h" #include "struct_engine.h" #include "context.h" -#include "phy.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -76,7 +75,6 @@ uint16_t data_count = 0; uint16_t data_size = 0; uint16_t crc_val = 0; -phy_t phy; /******************************************************************************* * Function @@ -87,13 +85,13 @@ static inline uint8_t Recep_IsAckNeeded(void); * @param None * @return None ******************************************************************************/ -void Recep_Init(void) +void Recep_Init(luos_phy_t *phy_robus) { // Initialize the reception state machine ctx.rx.status.unmap = 0; ctx.rx.callback = Recep_GetHeader; ctx.rx.status.identifier = 0xF; - phy.rx_timestamp = 0; + phy_robus->rx_timestamp = 0; } /****************************************************************************** * @brief Callback to get a complete header @@ -101,7 +99,7 @@ void Recep_Init(void) * @return None * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL void Recep_GetHeader(volatile uint8_t *data) +_CRITICAL void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data) { // Catch a byte. MsgAlloc_SetData(*data); @@ -113,7 +111,7 @@ _CRITICAL void Recep_GetHeader(volatile uint8_t *data) case 1: // reset CRC computation // when we catch the first byte we timestamp the msg // -8 : time to transmit 8 bits at 1 us/bit - phy.rx_timestamp = LuosHAL_GetTimestamp() - BYTE_TRANSMIT_TIME; + phy_robus->rx_timestamp = LuosHAL_GetTimestamp() - BYTE_TRANSMIT_TIME; ctx.tx.lock = true; // Switch the transmit status to disable to be sure to not interpreat the end timeout as an end of transmission. @@ -186,7 +184,7 @@ _CRITICAL void Recep_GetHeader(volatile uint8_t *data) * @return None * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL void Recep_GetData(volatile uint8_t *data) +_CRITICAL void Recep_GetData(luos_phy_t *phy_robus, volatile uint8_t *data) { MsgAlloc_SetData(*data); if (data_count < data_size) @@ -208,7 +206,7 @@ _CRITICAL void Recep_GetData(volatile uint8_t *data) if (Luos_IsMsgTimstamped((msg_t *)current_msg)) { // This conversion also remove the timestamp from the message size. - Timestamp_ConvertToDate((msg_t *)current_msg, phy.rx_timestamp); + Timestamp_ConvertToDate((msg_t *)current_msg, phy_robus->rx_timestamp); } // Make an exception for bootloader command @@ -251,7 +249,7 @@ _CRITICAL void Recep_GetData(volatile uint8_t *data) * @return None * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL void Recep_GetCollision(volatile uint8_t *data) +_CRITICAL void Recep_GetCollision(luos_phy_t *phy_robus, volatile uint8_t *data) { // Check data integrity if ((ctx.tx.data[data_count++] != *data) || (!ctx.tx.lock) || (ctx.rx.status.rx_framing_error == true)) @@ -286,17 +284,17 @@ _CRITICAL void Recep_GetCollision(volatile uint8_t *data) #ifdef SELFTEST selftest_SetRxFlag(); #endif - // collision detection end + // Collision detection end RobusHAL_SetRxState(false); RobusHAL_ResetTimeout(0); if (ctx.tx.status == TX_NOK) { - // switch to catch Ack. + // Switch to catch Ack. ctx.rx.callback = Recep_CatchAck; } else { - // switch to get header. + // Switch to get header. ctx.rx.callback = Recep_GetHeader; } return; @@ -310,7 +308,7 @@ _CRITICAL void Recep_GetCollision(volatile uint8_t *data) * @return None * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL void Recep_Drop(volatile uint8_t *data) +_CRITICAL void Recep_Drop(luos_phy_t *phy_robus, volatile uint8_t *data) { return; } @@ -350,7 +348,7 @@ _CRITICAL void Recep_Reset(void) * @return None * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL void Recep_CatchAck(volatile uint8_t *data) +_CRITICAL void Recep_CatchAck(luos_phy_t *phy_robus, volatile uint8_t *data) { volatile status_t status; status.unmap = *data; diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index f31480aca..d312bdb8e 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -28,6 +28,7 @@ ******************************************************************************/ // Creation of the robus context. This variable is used in all files of this lib. volatile context_t ctx; +luos_phy_t *phy_robus; /******************************************************************************* * Function @@ -48,8 +49,13 @@ void Robus_Init(void) // Init transmission Transmit_Init(); + + // Instantiate the phy struct + phy_robus = Phy_Create(); + LUOS_ASSERT(phy_robus); + // Init reception - Recep_Init(); + Recep_Init(phy_robus); } /****************************************************************************** @@ -168,4 +174,14 @@ bool Robus_Busy(void) error_return_t Robus_FindNeighbour(void) { return PortMng_PokeNextPort(); +} + +/****************************************************************************** + * @brief add the phy pointer to the callback + * @param pointer to the received data + * @return None + ******************************************************************************/ +_CRITICAL void Recep_data(volatile uint8_t *data) +{ + ctx.rx.callback(phy_robus, data); } \ No newline at end of file From e3825c7e30f450138d17be2804f7f0c3068c9b76 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 11 Apr 2023 15:03:44 +0200 Subject: [PATCH 037/150] Move reception filtering into filter except for Robus exceptions --- engine/IO/inc/filter.h | 3 ++ engine/IO/src/filter.c | 58 ++++++++++++++++++++++++++++-- network/robus/inc/reception.h | 3 +- network/robus/src/reception.c | 66 +++++++---------------------------- network/robus/src/robus.c | 11 +++--- 5 files changed, 80 insertions(+), 61 deletions(-) diff --git a/engine/IO/inc/filter.h b/engine/IO/inc/filter.h index 66f327192..26aae2651 100644 --- a/engine/IO/inc/filter.h +++ b/engine/IO/inc/filter.h @@ -9,6 +9,8 @@ #include #include +#include "struct_io.h" +#include "struct_luos.h" /******************************************************************************* * Definitions @@ -31,5 +33,6 @@ void Filter_RmTopic(uint16_t topic_id); bool Filter_ServiceID(uint16_t service_id); bool Filter_Topic(uint16_t topic_id); bool Filter_Type(uint16_t type_id); +luos_localhost_t Filter_GetLocalhost(header_t *header); #endif /* _FILTER_H_ */ diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c index d7fd42553..e8459c309 100644 --- a/engine/IO/src/filter.c +++ b/engine/IO/src/filter.c @@ -9,7 +9,7 @@ #include "luos_utils.h" #include "luos_hal.h" #include "service.h" -#include "struct_luos.h" +#include "node.h" /******************************************************************************* * Definitions @@ -171,4 +171,58 @@ _CRITICAL bool Filter_Type(uint16_t type_id) } } return false; -} \ No newline at end of file +} + +/****************************************************************************** + * @brief Parse msg to find a service concerne + * @param header of message + * @return None + * _CRITICAL function call in IRQ + ******************************************************************************/ +_CRITICAL luos_localhost_t Filter_GetLocalhost(header_t *header) +{ + // Find if we are concerned by this message. + // check if we need to filter all the messages + + switch (header->target_mode) + { + case SERVICEIDACK: + case SERVICEID: + // Check all service id + if (Filter_ServiceID(header->target)) + { + return LOCALHOST; + } + break; + case TYPE: + + if (Filter_Type(header->target)) + { + return MULTIHOST; + } + break; + case BROADCAST: + if (header->target == BROADCAST_VAL) + { + return MULTIHOST; + } + break; + case NODEIDACK: + case NODEID: + if ((header->target == Node_Get()->node_id) && (header->target != DEFAULTID)) + { + return LOCALHOST; + } + break; + case TOPIC: + if (Filter_Topic(header->target)) + { + return MULTIHOST; + } + break; + default: + return EXTERNALHOST; + break; + } + return EXTERNALHOST; +} diff --git a/network/robus/inc/reception.h b/network/robus/inc/reception.h index 5d47919ed..bfe7bb32c 100644 --- a/network/robus/inc/reception.h +++ b/network/robus/inc/reception.h @@ -7,6 +7,7 @@ #ifndef _RECEPTION_H_ #define _RECEPTION_H_ +#include #include "luos_phy.h" #include "struct_io.h" #include "luos_io.h" @@ -55,6 +56,6 @@ void Recep_Init(luos_phy_t *phy_robus); void Recep_EndMsg(void); void Recep_Reset(void); void Recep_Timeout(void); -luos_localhost_t Recep_NodeConcerned(header_t *header); +bool Recep_NodeConcerned(header_t *header); #endif /* _RECEPTION_H_ */ diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index a4e97b80a..16e72757a 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -42,7 +42,6 @@ ***********************************************************************************************/ #include -#include #include "reception.h" #include "robus_hal.h" #include "luos_hal.h" @@ -364,65 +363,26 @@ _CRITICAL void Recep_CatchAck(luos_phy_t *phy_robus, volatile uint8_t *data) /****************************************************************************** * @brief Parse msg to find a service concerne * @param header of message - * @return None + * @return true or false * warning : this function can be redefined only for mock testing purpose * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL luos_localhost_t Recep_NodeConcerned(header_t *header) +_CRITICAL bool Recep_NodeConcerned(header_t *header) { // Find if we are concerned by this message. - // check if we need to filter all the messages - - switch (header->target_mode) + if ((header->target_mode == NODEIDACK) || (header->target_mode == SERVICEIDACK)) { - case SERVICEIDACK: - ctx.rx.status.rx_error = false; - case SERVICEID: - // Check all service id - if (Filter_ServiceID(header->target)) - { - return LOCALHOST; - } - break; - case TYPE: - - if (Filter_Type(header->target)) - { - return MULTIHOST; - } - break; - case BROADCAST: - if (header->target == BROADCAST_VAL) - { - return MULTIHOST; - } - break; - case NODEIDACK: - ctx.rx.status.rx_error = false; - case NODEID: - if ((header->target == 0) && (ctx.port.activ != NBR_PORT) && (ctx.port.keepLine == false)) - { - return LOCALHOST; // discard message if ID = 0 and no Port activ - } - else - { - if ((header->target == Node_Get()->node_id) && ((header->target != 0))) - { - return LOCALHOST; - } - } - break; - case TOPIC: - if (Filter_Topic(header->target)) - { - return MULTIHOST; - } - break; - default: - return EXTERNALHOST; - break; + // In both of those cases we potentially need an ack. + ctx.rx.status.rx_error = false; + } + if ((header->target_mode == NODEID) || (header->target_mode == NODEIDACK)) + { + if ((header->target == 0) && (ctx.port.activ != NBR_PORT) && (ctx.port.keepLine == false)) + { + return true; // Keep message if nodeID = 0 and a PTP is activ + } } - return EXTERNALHOST; + return (Filter_GetLocalhost(header) != EXTERNALHOST); } /****************************************************************************** diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index d312bdb8e..a330930ac 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -14,11 +14,11 @@ #include "context.h" #include "robus_hal.h" #include "luos_hal.h" -#include "msg_alloc.h" #include "luos_utils.h" + +#include "msg_alloc.h" #include "luos_engine.h" #include "filter.h" -#include "service.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -97,6 +97,9 @@ error_return_t Robus_SetTxTask(service_t *service, msg_t *msg) { data_size = msg->header.size; } + + // Check the localhost situation + luos_localhost_t localhost = Filter_GetLocalhost(&msg->header); // Add the CRC to the total size of the message uint16_t full_size = sizeof(header_t) + data_size + CRC_SIZE; @@ -109,10 +112,8 @@ error_return_t Robus_SetTxTask(service_t *service, msg_t *msg) // Compute the CRC crc_val = ll_crc_compute(&msg->stream[0], crc_max_index - CRC_SIZE, 0xFFFF); - // Check the localhost situation - luos_localhost_t localhost = Recep_NodeConcerned(&msg->header); // Check if ACK needed - if (((msg->header.target_mode == SERVICEIDACK) || (msg->header.target_mode == NODEIDACK)) && ((localhost && (msg->header.target != DEFAULTID)))) + if (((msg->header.target_mode == SERVICEIDACK) || (msg->header.target_mode == NODEIDACK)) && (localhost != EXTERNALHOST)) { // This is a localhost message and we need to transmit a ack. Add it at the end of the data to transmit ack = ctx.rx.status.unmap; From e4b83ff9258aab15cc71dacf624bb4febc751e6d Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 11 Apr 2023 15:57:01 +0200 Subject: [PATCH 038/150] Fix timestamp msg reception computation --- network/robus/src/reception.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index 16e72757a..79e27c887 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -107,10 +107,12 @@ _CRITICAL void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data) // Check if we have all we need. switch (data_count) { - case 1: // reset CRC computation - // when we catch the first byte we timestamp the msg - // -8 : time to transmit 8 bits at 1 us/bit - phy_robus->rx_timestamp = LuosHAL_GetTimestamp() - BYTE_TRANSMIT_TIME; + case 1: + // Reset CRC computation + // When we catch the first byte we timestamp the msg + // We remove the time of the first byte to get the exact reception date. + // 1 byte is 10 bits and we convert it to nanoseconds + phy_robus->rx_timestamp = LuosHAL_GetTimestamp() - ((uint32_t)10 * (uint32_t)1000000000 / (uint32_t)DEFAULTBAUDRATE); ctx.tx.lock = true; // Switch the transmit status to disable to be sure to not interpreat the end timeout as an end of transmission. From f7439b1290b6ba54fa1f95f931cf805692cd4baa Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 12 Apr 2023 11:38:54 +0200 Subject: [PATCH 039/150] Reshape reception and almost completely shortcut msg_tasks --- engine/IO/inc/_luos_io.h | 26 + engine/IO/inc/luos_phy.h | 41 +- engine/IO/inc/msg_alloc.h | 9 +- engine/IO/src/luos_io.c | 34 +- engine/IO/src/luos_phy.c | 214 ++- engine/IO/src/msg_alloc.c | 658 +------- engine/core/src/luos_engine.c | 1 + examples/projects/l0/dxl/lib/Dxl/dxl.c | 2 +- .../projects/l0/gate_serialcom/node_config.h | 4 +- network/robus/inc/robus.h | 3 +- network/robus/src/reception.c | 190 +-- network/robus/src/robus.c | 11 +- platformio.ini | 2 +- test/test_msg_alloc/main.c | 19 +- test/test_msg_alloc/main.h | 17 +- .../unit_test_mem_alloc_generic.c | 696 +------- .../unit_test_mem_alloc_static.c | 104 +- test/test_msg_alloc/unit_test_mem_alloc_tx.c | 1458 ++--------------- 18 files changed, 591 insertions(+), 2898 deletions(-) create mode 100644 engine/IO/inc/_luos_io.h diff --git a/engine/IO/inc/_luos_io.h b/engine/IO/inc/_luos_io.h new file mode 100644 index 000000000..b8ff046bb --- /dev/null +++ b/engine/IO/inc/_luos_io.h @@ -0,0 +1,26 @@ +/****************************************************************************** + * @file luos_io.c + * @brief Interface file between Luos and a physical layer + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _PRIVATE_LUOSIO_H_ +#define _PRIVATE_LUOSIO_H_ + +#include "struct_luos.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/******************************************************************************* + * Variables + ******************************************************************************/ + +/******************************************************************************* + * Functions + ******************************************************************************/ + +error_return_t LuosIO_MsgHandler(msg_t *input); + +#endif /* _PRIVATE_LUOSIO_H_ */ \ No newline at end of file diff --git a/engine/IO/inc/luos_phy.h b/engine/IO/inc/luos_phy.h index 7aea41d45..7d9c57f17 100644 --- a/engine/IO/inc/luos_phy.h +++ b/engine/IO/inc/luos_phy.h @@ -1,13 +1,15 @@ /****************************************************************************** * @file phy.h - * @brief interface with the phy - * @author Luos + * @brief This file have to be imported by phy layers to interract with Luos + * @author Nicolas Rabault * @version 0.0.0 ******************************************************************************/ #ifndef _LUOS_PHY_H_ #define _LUOS_PHY_H_ #include +#include "struct_luos.h" +#include "struct_io.h" /******************************************************************************* * Definitions @@ -17,23 +19,50 @@ * @struct luos_luos_phy_t * @brief the data structure allowing the phy to interract with LuosIO ******************************************************************************/ +typedef struct +{ + // This is allowing to access the data as data or message + union + { + uint8_t *data_pt; // Start pointer of the data on msg_buffer. + msg_t *msg_pt; // Pointer to the message. + }; + uint16_t size; // size of the data. + void *phy_data; // Phy developpers can use this pointer to store any data they need. +} phy_tx_job_t; + typedef struct luos_luos_phy_t { + // *************** RX information *************** volatile int64_t rx_timestamp; // Timestamp of the last received message. We will use it to compute the date based on received latency. uint8_t *rx_buffer_base; // Pointer to the base of the buffer where we will store the begining of received data. - volatile uint8_t *rx_data; // Pointer to write received bytes. - volatile uint16_t rx_size; // Size of data to receive data. + union + { + volatile uint8_t *rx_data; // Pointer to write received bytes. + volatile msg_t *rx_msg; // Pointer to the message where we will write received bytes. + }; + volatile uint16_t received_data; // Number of bytes already received. + volatile uint16_t rx_size; // Size of data to receive. struct __attribute__((__packed__)) { - volatile uint8_t rx_alloc_job : 1; // If true, loop will need to filter already received data, if filter is ok, set rx_keep, alloc space, move *rx_data to point at the good place on allocator, put the number of bytes remaining on rx_size, and copy already received data in the allocated space. + volatile uint8_t rx_alloc_job : 1; // If true, Luosio_Loop funciton will need to filter already received data, if filter is ok, set rx_keep, alloc needed space, move *rx_data to point at the good place on allocator, put the number of bytes remaining on rx_size, and copy already received data in the allocated space. volatile uint8_t rx_keep : 1; // True if we want to keep the received data. }; + + // RX Private data + luos_localhost_t rx_phy_filter; // The phy concerned by this message. + + // *************** TX informations *************** + phy_tx_job_t tx_job[MAX_MSG_NB]; // List of phy tx jobs to send. + uint8_t tx_job_nb; // Number of tx jobs to send. } luos_phy_t; void Phy_Init(void); void Phy_Loop(void); luos_phy_t *Phy_Create(void); -void Phy_Send(luos_phy_t *phy, uint8_t *data, uint16_t size); +void Phy_Send(luos_phy_t *phy_ptr, uint8_t *data, uint16_t size); +void Phy_ComputeMsgSize(luos_phy_t *phy_ptr); +void Phy_ValidMsg(luos_phy_t *phy_ptr); #endif /* _LUOS_PHY_H_ */ diff --git a/engine/IO/inc/msg_alloc.h b/engine/IO/inc/msg_alloc.h index 3547981de..39b50bbd2 100644 --- a/engine/IO/inc/msg_alloc.h +++ b/engine/IO/inc/msg_alloc.h @@ -18,7 +18,7 @@ /******************************************************************************* * Variables ******************************************************************************/ -extern volatile msg_t *current_msg; + /******************************************************************************* * Functions ******************************************************************************/ @@ -28,15 +28,12 @@ void MsgAlloc_Init(memory_stats_t *memory_stats); void MsgAlloc_loop(void); // msg buffering functions -void MsgAlloc_ValidHeader(uint8_t valid, uint16_t data_size); -void MsgAlloc_InvalidMsg(void); -void MsgAlloc_EndMsg(void); -void MsgAlloc_SetData(uint8_t data); +uint8_t *MsgAlloc_Alloc(uint16_t data_size); + error_return_t MsgAlloc_IsEmpty(void); void MsgAlloc_UsedMsgEnd(void); void MsgAlloc_Reset(void); error_return_t MsgAlloc_IsReseted(void); -void MsgAlloc_ValidDataIntegrity(void); // msg interpretation task stack error_return_t MsgAlloc_PullMsgToInterpret(msg_t **returned_msg); diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 74f9104fc..11f8188fa 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -17,6 +17,7 @@ #include "luos_utils.h" #include "luos_hal.h" #include "luos_engine.h" +#include "bootloader_core.h" /******************************************************************************* * Definitions @@ -36,7 +37,6 @@ typedef struct __attribute__((__packed__)) } node_bootstrap_t; static error_return_t LuosIO_StartTopologyDetection(service_t *service); -static error_return_t LuosIO_MsgHandler(msg_t *input); static error_return_t LuosIO_DetectNextNodes(service_t *service); /******************************************************************************* @@ -75,18 +75,7 @@ void LuosIO_Loop(void) { // Execute message allocation tasks MsgAlloc_loop(); - // Interpreat received messages and create luos task for it. - msg_t *msg; - while (MsgAlloc_PullMsgToInterpret(&msg) == SUCCEED) - { - // Check if this message is a protocol one - if (LuosIO_MsgHandler(msg) == FAILED) - { - // If not create luos tasks for all services. - Service_AllocMsg(msg); - } - } - Robus_Loop(); + Phy_Loop(); } /****************************************************************************** @@ -164,6 +153,8 @@ static error_return_t LuosIO_StartTopologyDetection(service_t *service) Service_ClearId(); // Reinit msg alloc MsgAlloc_Init(NULL); + // Reinit Phy + Phy_Init(); // Wait 2ms to be sure all previous messages are received and treated by other nodes uint32_t start_tick = LuosHAL_GetSystick(); while (LuosHAL_GetSystick() - start_tick < 2) @@ -234,7 +225,10 @@ error_return_t LuosIO_MsgHandler(msg_t *input) Node_Get()->node_id = 0; // Reinit service id Service_ClearId(); + // Reinit msg alloc MsgAlloc_Init(NULL); + // Reinit Phy + Phy_Init(); } // This is a node bootstrap information. memcpy((void *)&node_bootstrap.unmap[0], (void *)&input->data[0], sizeof(node_bootstrap_t)); @@ -247,7 +241,21 @@ error_return_t LuosIO_MsgHandler(msg_t *input) } return SUCCEED; break; + case BOOTLOADER_CMD: + if (input->data[0] == BOOTLOADER_RESET) + { + LuosHAL_SetMode((uint8_t)BOOT_MODE); + LuosHAL_Reboot(); + // This message have been consumed + return SUCCEED; + } + return FAILED; + break; case START_DETECTION: + MsgAlloc_Reset(); + Node_SetState(EXTERNAL_DETECTION); + Robus_ResetNodeID(); + // This message have been consumed return SUCCEED; break; case END_DETECTION: diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 2833b6e22..a97396dce 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -1,20 +1,47 @@ /****************************************************************************** * @file phy.c - * @brief Manage physical layers - * @author Luos + * @brief This is the interface with all th phy layers This file manage all the jobs of all the phys + * @author Nicolas Rabault * @version 0.0.0 ******************************************************************************/ +#include #include "luos_phy.h" +#include "filter.h" +#include "msg_alloc.h" +#include "engine_config.h" +#include "luos_hal.h" +#include "node.h" +#include "_timestamp.h" +#include "robus.h" +#include "luos_io.h" +#include "_luos_io.h" +#include "service.h" /******************************************************************************* * Definitions ******************************************************************************/ +typedef struct __attribute__((__packed__)) +{ + uint64_t timestamp; + msg_t *alloc_msg; + luos_localhost_t phy_filter; +} luos_phy_job_t; + +typedef struct +{ + luos_phy_t phy; + luos_phy_job_t phy_job[MAX_MSG_NB]; + volatile uint16_t phy_job_nb; +} luos_phy_ctx_t; + +static void Phy_alloc(luos_phy_t *phy); +static void Phy_Dispatch(void); /******************************************************************************* * Variables ******************************************************************************/ -luos_phy_t phy; +luos_phy_ctx_t phy_ctx; /******************************************************************************* * Functions @@ -27,6 +54,8 @@ luos_phy_t phy; ******************************************************************************/ void Phy_Init(void) { + // Put everything to 0 + memset((void *)&phy_ctx, 0, sizeof(phy_ctx)); } /****************************************************************************** @@ -36,6 +65,14 @@ void Phy_Init(void) ******************************************************************************/ void Phy_Loop(void) { + // Manage received data allocation + if (phy_ctx.phy.rx_alloc_job) + { + Phy_alloc(&phy_ctx.phy); + } + // Manage complete message received dispatching + Phy_Dispatch(); + Robus_Loop(); } /****************************************************************************** @@ -45,7 +82,7 @@ void Phy_Loop(void) ******************************************************************************/ luos_phy_t *Phy_Create(void) { - return &phy; + return &phy_ctx.phy; } /****************************************************************************** @@ -54,6 +91,171 @@ luos_phy_t *Phy_Create(void) * @param size Size of the data to send * @return None ******************************************************************************/ -void Phy_Send(luos_phy_t *phy, uint8_t *data, uint16_t size) +void Phy_Send(luos_phy_t *phy_ptr, uint8_t *data, uint16_t size) +{ +} + +/****************************************************************************** + * @brief Consider the message as valid + * @param phy_ptr Pointer to the phy concerned by the allocation + * @return None + ******************************************************************************/ +_CRITICAL void Phy_ValidMsg(luos_phy_t *phy_ptr) +{ + LUOS_ASSERT(phy_ptr != NULL); + // Check if the allocation of the received message have been done + if (phy_ptr->rx_alloc_job) + { + // We did not allocate the received data yet + // This can happen if we did not had the time to execute Phy_Loop function before the end of the message reception or if this phy get the complete mgs in one time. + Phy_alloc(phy_ptr); + } + // Now we can create a phy_job to dispatch the tx_job later + LUOS_ASSERT(phy_ctx.phy_job_nb < MAX_MSG_NB); + LuosHAL_SetIrqState(false); + phy_ctx.phy_job[phy_ctx.phy_job_nb].timestamp = phy_ptr->rx_timestamp; + phy_ctx.phy_job[phy_ctx.phy_job_nb].alloc_msg = (msg_t *)phy_ptr->rx_data; + phy_ctx.phy_job[phy_ctx.phy_job_nb].phy_filter = phy_ptr->rx_phy_filter; + phy_ctx.phy_job_nb++; + // Then reset the phy to receive the next message + phy_ptr->rx_data = phy_ptr->rx_buffer_base; + phy_ptr->received_data = 0; + LuosHAL_SetIrqState(true); +} + +/****************************************************************************** + * @brief Compute the size of the message + * @param phy_ptr Pointer to the phy concerned by this message + * @return None + ******************************************************************************/ +inline void Phy_ComputeMsgSize(luos_phy_t *phy_ptr) +{ + + // Compute the size of the data to allocate + if (((header_t *)phy_ptr->rx_buffer_base)->size > MAX_DATA_MSG_SIZE) + { + // Cap the size to the maximum size of a message + phy_ptr->rx_size = MAX_DATA_MSG_SIZE + sizeof(header_t); + } + else + { + phy_ptr->rx_size = ((header_t *)phy_ptr->rx_buffer_base)->size + sizeof(header_t); + // We need to check if we have a timestamped message and increase the data size if yes + if (Luos_IsMsgTimstamped((msg_t *)(phy_ptr->rx_data)) == true) // TODO move it to TX + { + phy_ptr->rx_size += sizeof(time_luos_t); + } + } +} + +/****************************************************************************** + * @brief Allocate the received data if needed + * @param phy_ptr Pointer to the phy concerned by this message + * @return None + ******************************************************************************/ +_CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) +{ + void *rx_data; + void *copy_from; + + LuosHAL_SetIrqState(false); + // Check if this phy really need to alloc + if (phy_ptr->rx_alloc_job == false) + { + LuosHAL_SetIrqState(true); + return; + } + // Check if we receive enougth data to be able to allocate the complete message + LUOS_ASSERT((phy_ptr->received_data >= sizeof(header_t)) && (phy_ptr->received_data <= MAX_DATA_MSG_SIZE + sizeof(header_t))); + // Check if their is a mistake on the buffer allocation. In this case, the phy.rx_data was not properly set to rx_buffer_base before the data reception. + LUOS_ASSERT(phy_ptr->rx_data == phy_ptr->rx_buffer_base); + LuosHAL_SetIrqState(true); + + // We need to allocate this phy received data + Phy_ComputeMsgSize(phy_ptr); + + // Compute the phy concerned by this message + luos_localhost_t phy_filter = Filter_GetLocalhost((header_t *)phy_ptr->rx_buffer_base); + + // Now we can check if we need to store the received data + if (phy_filter != EXTERNALHOST) + { + // We need to store the received data. + // Update the informations allowing reception to continue and directly copy the data into the allocated buffer + LuosHAL_SetIrqState(false); + if (phy_ptr->rx_alloc_job) + { + uint16_t phy_stored_data_size = phy_ptr->received_data; + // Now allocate it + phy_ptr->rx_data = MsgAlloc_Alloc(phy_ptr->rx_size); + rx_data = (void *)phy_ptr->rx_data; + // Job is done + phy_ptr->rx_alloc_job = false; + LuosHAL_SetIrqState(true); + phy_ptr->rx_keep = true; + phy_ptr->rx_phy_filter = phy_filter; + copy_from = (void *)phy_ptr->rx_buffer_base; + + // Now we can copy the data already received + memcpy(rx_data, copy_from, phy_stored_data_size); + return; + } + LuosHAL_SetIrqState(true); + } + else + { + LuosHAL_SetIrqState(false); + if (phy_ptr->rx_alloc_job) + { + // Job is done + phy_ptr->rx_alloc_job = false; + LuosHAL_SetIrqState(true); + // We don't need to store the received data. + phy_ptr->rx_keep = false; + return; + } + LuosHAL_SetIrqState(true); + } +} + +/****************************************************************************** + * @brief Dispatch the received message + * @param None + * @return None + ******************************************************************************/ +static void Phy_Dispatch(void) { -} \ No newline at end of file + // Interpreat received messages and create luos task for it. + while (phy_ctx.phy_job_nb) + { + // Get the oldest job + LuosHAL_SetIrqState(false); + luos_phy_job_t job = phy_ctx.phy_job[--phy_ctx.phy_job_nb]; + LuosHAL_SetIrqState(true); + // If message is timestamped, convert the latency to date + if (Luos_IsMsgTimstamped(job.alloc_msg)) + { + // This conversion also remove the timestamp from the message size. + Timestamp_ConvertToDate(job.alloc_msg, job.timestamp); + } + // Check if this message is a protocol one + if (LuosIO_MsgHandler(job.alloc_msg) == FAILED) + { + // If not create luos tasks for all services. + Service_AllocMsg(job.alloc_msg); + // Later this service level dispatch will need to be done in core. + // LuosIO shoudn't care about service level, and should just list the message as a task to do on the Luos side. + } + } + // Localhost message are still stored on the MsgAlloc msg_task buffer, we have to deal with it too. + msg_t *msg; + while (MsgAlloc_PullMsgToInterpret(&msg) == SUCCEED) + { + // Check if this message is a protocol one + if (LuosIO_MsgHandler(msg) == FAILED) + { + // If not create luos tasks for all services. + Service_AllocMsg(msg); + } + } +} diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 202fffa65..813138d09 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -84,12 +84,10 @@ volatile bool reset_needed = false; // msg buffering volatile uint8_t msg_buffer[MSG_BUFFER_SIZE]; /*!< Memory space used to save and alloc messages. */ -volatile msg_t *current_msg; /*!< current work in progress msg pointer. */ volatile uint8_t *data_ptr; /*!< Pointer to the next data able to be written into msgbuffer. */ -volatile uint8_t *data_end_estimation; /*!< Estimated end of the current receiving message. */ -volatile msg_t *oldest_msg = NULL; /*!< The oldest message among all the stacks. */ -volatile msg_t *used_msg = NULL; /*!< Message curently used by luos loop. */ -volatile uint8_t mem_clear_needed; /*!< A flag allowing to spot some msg space cleaning operations to do. */ + +volatile msg_t *oldest_msg = NULL; /*!< The oldest message among all the stacks. */ +volatile msg_t *used_msg = NULL; /*!< Message curently used by luos loop. */ // msg interpretation task stack volatile msg_t *msg_tasks[MAX_MSG_NB]; /*!< ready message table. */ @@ -143,18 +141,15 @@ _CRITICAL static inline void MsgAlloc_FindNewOldestMsg(void); void MsgAlloc_Init(memory_stats_t *memory_stats) { //******** Init global vars pointers ********** - current_msg = (msg_t *)&msg_buffer[0]; - data_ptr = (uint8_t *)&msg_buffer[0]; - data_end_estimation = (uint8_t *)¤t_msg->data[CRC_SIZE]; - msg_tasks_stack_id = 0; + data_ptr = (uint8_t *)&msg_buffer[0]; + msg_tasks_stack_id = 0; memset((void *)msg_tasks, 0, sizeof(msg_tasks)); luos_tasks_stack_id = 0; memset((void *)luos_tasks, 0, sizeof(luos_tasks)); tx_tasks_stack_id = 0; memset((void *)tx_tasks, 0, sizeof(tx_tasks)); - used_msg = NULL; - oldest_msg = (msg_t *)INT_MAX; - mem_clear_needed = false; + used_msg = NULL; + oldest_msg = (msg_t *)INT_MAX; if (memory_stats != NULL) { mem_stat = memory_stats; @@ -190,25 +185,6 @@ void MsgAlloc_loop(void) { mem_stat->buffer_occupation_ratio = stat; } - MsgAlloc_ValidDataIntegrity(); -} -/****************************************************************************** - * @brief execute some memory sanity tasks out of IRQ - * @param None - * @return None - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL void MsgAlloc_ValidDataIntegrity(void) -{ - // Do we have to check data dropping? - LuosHAL_SetIrqState(false); - if (mem_clear_needed == true) - { - mem_clear_needed = false; - error_return_t clear_state = MsgAlloc_ClearMsgSpace((void *)current_msg, (void *)data_end_estimation); - LUOS_ASSERT(clear_state == SUCCEED); - } - LuosHAL_SetIrqState(true); } /****************************************************************************** * @brief compute remaing space on msg_buffer. @@ -224,9 +200,9 @@ static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void) { LUOS_ASSERT(((uintptr_t)oldest_msg >= (uintptr_t)&msg_buffer[0]) && ((uintptr_t)oldest_msg < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE])); // There is some tasks - if ((uintptr_t)oldest_msg > (uintptr_t)data_end_estimation) + if ((uintptr_t)oldest_msg > (uintptr_t)data_ptr) { - // The oldest task is between `data_end_estimation` and the end of the buffer + // The oldest task is between `data_ptr` and the end of the buffer // msg_buffer // +-------------------------------------------------------------+ // |-------------------------------------------------------------| @@ -234,9 +210,9 @@ static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void) // | | // |<-----Free space---->| // | | - // data_end_estimation oldest_task + // data_ptr oldest_task // - stack_free_space = (uintptr_t)oldest_msg - (uintptr_t)data_end_estimation; + stack_free_space = (uintptr_t)oldest_msg - (uintptr_t)data_ptr; LuosHAL_SetIrqState(true); } else @@ -246,21 +222,21 @@ static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void) // msg_buffer // +-------------------------------------------------------------+ // |-------------------------------------------------------------| - // +-------------^--------------^------------------^-------------+ - // | | | - // <-Free space->| | |<-Free space-> - // | | | - // | | | - // oldest_task current_message data_end_estimation + // +-------------^---------------------------------^-------------+ + // | | + // <-Free space->| |<-Free space-> + // | | + // | | + // oldest_task data_ptr // - stack_free_space = ((uintptr_t)oldest_msg - (uintptr_t)&msg_buffer[0]) + ((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - (uintptr_t)data_end_estimation); + stack_free_space = ((uintptr_t)oldest_msg - (uintptr_t)&msg_buffer[0]) + ((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - (uintptr_t)data_ptr); LuosHAL_SetIrqState(true); } } else { // There is no task yet just compute the actual reception - stack_free_space = MSG_BUFFER_SIZE - ((uintptr_t)data_end_estimation - (uintptr_t)current_msg); + stack_free_space = MSG_BUFFER_SIZE; LuosHAL_SetIrqState(true); } return stack_free_space; @@ -278,36 +254,36 @@ _CRITICAL static inline void MsgAlloc_OldestMsgCandidate(msg_t *oldest_stack_msg LUOS_ASSERT(((uintptr_t)oldest_stack_msg_pt >= (uintptr_t)&msg_buffer[0]) && ((uintptr_t)oldest_stack_msg_pt < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE])); // recompute oldest_stack_msg_pt into delta byte from current message uint32_t stack_delta_space; - if ((uintptr_t)oldest_stack_msg_pt > (uintptr_t)current_msg) + if ((uintptr_t)oldest_stack_msg_pt > (uintptr_t)data_ptr) { - // The oldest task is between `data_end_estimation` and the end of the buffer + // The oldest task is between `data_ptr` and the end of the buffer LuosHAL_SetIrqState(false); - stack_delta_space = (uintptr_t)oldest_stack_msg_pt - (uintptr_t)current_msg; + stack_delta_space = (uintptr_t)oldest_stack_msg_pt - (uintptr_t)data_ptr; LuosHAL_SetIrqState(true); } else { - // The oldest task is between the begin of the buffer and `data_end_estimation` + // The oldest task is between the begin of the buffer and `data_ptr` // we have to decay it to be able to define delta LuosHAL_SetIrqState(false); - stack_delta_space = ((uintptr_t)oldest_stack_msg_pt - (uintptr_t)&msg_buffer[0]) + ((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - (uintptr_t)current_msg); + stack_delta_space = ((uintptr_t)oldest_stack_msg_pt - (uintptr_t)&msg_buffer[0]) + ((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - (uintptr_t)data_ptr); LuosHAL_SetIrqState(true); } // recompute oldest_msg into delta byte from current message uintptr_t oldest_msg_delta_space; - if ((uintptr_t)oldest_msg > (uintptr_t)current_msg) + if ((uintptr_t)oldest_msg > (uintptr_t)data_ptr) { - // The oldest msg is between `data_end_estimation` and the end of the buffer + // The oldest msg is between `data_ptr` and the end of the buffer LuosHAL_SetIrqState(false); - oldest_msg_delta_space = (uintptr_t)oldest_msg - (uintptr_t)current_msg; + oldest_msg_delta_space = (uintptr_t)oldest_msg - (uintptr_t)data_ptr; LuosHAL_SetIrqState(true); } else { - // The oldest msg is between the begin of the buffer and `data_end_estimation` + // The oldest msg is between the begin of the buffer and `data_ptr` // we have to decay it to be able to define delta LuosHAL_SetIrqState(false); - oldest_msg_delta_space = ((uintptr_t)oldest_msg - (uintptr_t)&msg_buffer[0]) + ((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - (uintptr_t)current_msg); + oldest_msg_delta_space = ((uintptr_t)oldest_msg - (uintptr_t)&msg_buffer[0]) + ((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - (uintptr_t)data_ptr); LuosHAL_SetIrqState(true); } // Compare deltas @@ -354,7 +330,7 @@ _CRITICAL static inline error_return_t MsgAlloc_DoWeHaveSpace(void *to) { if ((uintptr_t)to > ((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE - 1])) { - // We reach msg_buffer end return an error + // We reach msg_buffer end. // // msg_buffer // +-------------------------------------------------------------+ @@ -362,294 +338,58 @@ _CRITICAL static inline error_return_t MsgAlloc_DoWeHaveSpace(void *to) // |-------------------------------------------------------------+ ^ // | // pointer + // Return as FAILED // return FAILED; } return SUCCEED; } /****************************************************************************** - * @brief Invalid the current message header by removing it (data will be ignored). - * @param None + * @brief Allocate a new message + * @param uint16_t data_size * @return None * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL void MsgAlloc_InvalidMsg(void) +_CRITICAL uint8_t *MsgAlloc_Alloc(uint16_t data_size) { - //******** Remove the header by reseting data_ptr ********* - // clean the memory zone - if (mem_clear_needed == true) + uint8_t *returned_ptr; + // Check data ptr alignement + if ((uintptr_t)data_ptr % 2 == 1) { - mem_clear_needed = false; - error_return_t clear_state = MsgAlloc_ClearMsgSpace((void *)current_msg, (void *)(data_ptr)); - LUOS_ASSERT(clear_state == SUCCEED); + data_ptr++; } - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^--------------^----------------------------------------------+ - // | | - // current_msg data_ptr - // - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^---------------------^---------------------------------------+ - // | | - // current_msg data_end_estimation - // data_ptr - // | | - // <----Header + CRC----> - // - data_ptr = (uint8_t *)current_msg; - data_end_estimation = (uint8_t *)(¤t_msg->stream[sizeof(header_t) + CRC_SIZE]); - LUOS_ASSERT((uintptr_t)data_end_estimation < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE]); -} -/****************************************************************************** - * @brief Valid the current message header by preparing the allocator to get the message data - * @param valid : is the header valid or not - * @param data_size : size of the data to receive - * @return None - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL void MsgAlloc_ValidHeader(uint8_t valid, uint16_t data_size) -{ - //******** Prepare the allocator to get data ********* - // Save the concerned service pointer into the concerned service pointer stack - if (valid == true) + // Check if we have space for the message + if (MsgAlloc_DoWeHaveSpace((void *)(data_ptr + data_size)) == FAILED) { - if (MsgAlloc_DoWeHaveSpace((void *)(¤t_msg->data[data_size + CRC_SIZE])) == FAILED) - { - // We are at the end of msg_buffer, we need to move the current space to the begin of msg_buffer - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |------------------------------------| Header | Datas to be received | - // +------------------------------------^----------^-------------+ ^ - // | | | - // current_msg data_ptr data_end_estimation - // - // - // msg_buffer ending state : - // +-------------------------------------------------------------+ - // | Header | Datas to be received |---------------------------- - // +----------^--------------------------------------------------+ - // | | - // current_msg data_ptr - // - // Copy the header at the begining of msg_buffer - memcpy((void *)&msg_buffer[0], (void *)¤t_msg->header, sizeof(header_t)); - // Move current_msg to msg_buffer - current_msg = (volatile msg_t *)&msg_buffer[0]; - // move data_ptr after the new location of the header - data_ptr = &msg_buffer[sizeof(header_t)]; - } - // Save the end position of our message // - // msg_buffer init state + // We don't have the space to store the message : // +-------------------------------------------------------------+ - // |----------------------| Header |---------------------------| - // +----------------------^----------^---------------------------+ - // | | - // current_msg data_ptr - // - // - // msg_buffer ending state : MEM_CLEAR_NEEDED = True + // |------------------------------------| Datas to be received | + // +------------------------------------^------------------------+ ^ + // | | + // data_ptr data_end + // move data_ptr to the beginning of the buffer // +-------------------------------------------------------------+ - // |----------------------| Header | Datas to be received |----| - // +----------------------^----------^----------------------^----+ - // | | | - // current_msg data_ptr data_end_estimation + // |-------------------------------------------------------------| + // | Datas to be received |---------------------------| + // ^---------------------------------^---------------------------+ + // | | + // data_ptr data_end // - data_end_estimation = (uint8_t *)¤t_msg->data[data_size + CRC_SIZE]; - // check if there is a msg treatment pending - if (((uintptr_t)used_msg >= (uintptr_t)current_msg) && ((uintptr_t)used_msg <= (uintptr_t)(¤t_msg->data[data_size + CRC_SIZE]))) - { - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |-------------------| Header | Datas to be received |-------| - // |----------------------------------------| An old message |---| - // +-------------------^----------^---------^--------------------+ - // | | | - // current_msg data_ptr used_msg - // - // - // msg_buffer ending state : old message is cleared (used_msg = NULL) - // +-------------------------------------------------------------+ - // |-------------------| Header | Datas to be received |-------| - // +-------------------^----------^------------------------------+ - // | | - // current_msg data_ptr - // - used_msg = NULL; - // This message is in the space we want to use, clear the task - if (mem_stat->msg_drop_number < 0xFF) - { - mem_stat->msg_drop_number++; - mem_stat->buffer_occupation_ratio = 100; - } - } - // Raise the clear flag allowing to perform a clear - mem_clear_needed = true; + // We don't have the space to store the message, move data_ptr to the beginning of the buffer + returned_ptr = (uint8_t *)&msg_buffer[0]; } else { - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |-------------------| Header |------------------------------| - // +-------------------^----------^------------------------------+ - // | | - // current_msg data_ptr - // - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |-------------------| ****** |------------------------------| - // +-------------------^-----------------------------------------+ - // | - // current_msg - // data_ptr - // - data_ptr = (uint8_t *)current_msg; - } -} -/****************************************************************************** - * @brief Finish the current message - * @param None - * @return None - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL void MsgAlloc_EndMsg(void) -{ - //******** End the message ********** - // clean the memory zone - if (mem_clear_needed == true) - { - // No luos_loop make it for us outside of IRQ, we have to make it - error_return_t clear_state = MsgAlloc_ClearMsgSpace((void *)current_msg, (void *)data_ptr); - LUOS_ASSERT(clear_state == SUCCEED); - mem_clear_needed = false; + returned_ptr = (uint8_t *)data_ptr; } + // Check if we have space for the message, assert if we don't + LUOS_ASSERT(MsgAlloc_CheckMsgSpace((void *)returned_ptr, (void *)((uintptr_t)returned_ptr + data_size)) == SUCCEED); - // Store the received message - if (msg_tasks_stack_id == MAX_MSG_NB) - { - // There is no more space on the msg_tasks, remove the oldest msg. - // - // msg_tasks init state msg_tasks end state - // +---------+ +---------+ - // | MSG_1 | | MSG_2 |<--Oldest message "D 1" is deleted - // |---------| |---------| - // | MSG_2 | | MSG_3 | - // |---------| |---------| - // | etc... | | etc... | - // |---------| |---------|<--luos_tasks_stack_id - // | MSG_10 | | 0 | - // +---------+<--luos_tasks_stack_id +---------+ - // - MsgAlloc_ClearMsgTask(); - if (mem_stat->msg_drop_number < 0xFF) - { - mem_stat->msg_drop_number++; - mem_stat->rx_msg_stack_ratio = 100; - } - } - MSGALLOC_MUTEX_LOCK - LUOS_ASSERT(msg_tasks[msg_tasks_stack_id] == 0); - LUOS_ASSERT(!(msg_tasks_stack_id > 0) || (((uintptr_t)msg_tasks[0] >= (uintptr_t)&msg_buffer[0]) && ((uintptr_t)msg_tasks[0] < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE]))); - msg_tasks[msg_tasks_stack_id] = current_msg; - if (msg_tasks_stack_id == 0) - { - MsgAlloc_OldestMsgCandidate((msg_t *)msg_tasks[0]); - } - LUOS_ASSERT((msg_tasks[msg_tasks_stack_id] != 0)); - msg_tasks_stack_id++; - - //******** Prepare the next msg ********* - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // | Header | Data | CRC |---------------------------------------+ - // +---------------------^---------------------------------------+ - // | - // data_ptr - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // OLD | Header | Data | CRC |---------------------------------------+ - // FUTURE |---------------| Header |------------------------------------+ - // +---------------^--------^------------------------------------+ - // | | - // data_ptr data_end_estimation - // current_msg - // - // data_ptr is actually 2 bytes after the message data because of the CRC. Remove the CRC. - data_ptr -= CRC_SIZE; - // Check data ptr alignement - if ((uintptr_t)data_ptr % 2 == 1) - { - data_ptr++; - } - // Check if we have space for the next message - if (MsgAlloc_DoWeHaveSpace((void *)(data_ptr + sizeof(header_t) + CRC_SIZE)) == FAILED) - { - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |------------------------------------| Header | Datas to be received | - // +-------------------------------------------------------------+ ^ - // | - // data_end_estimation - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |------------------------------------| Header |-------------| - // |---------| Datas to be received |----------------------------| - // ^---------^---------------------------------------------------+ - // | | - // data_ptr data_end_estimation - // current_mag - // - data_ptr = &msg_buffer[0]; - } - // update the current_msg - current_msg = (volatile msg_t *)data_ptr; - // Save the estimated end of the next message - data_end_estimation = (uint8_t *)¤t_msg->data[CRC_SIZE]; - // Raise the clear flag allowing to perform a clear - mem_clear_needed = true; - MSGALLOC_MUTEX_UNLOCK -} -/****************************************************************************** - * @brief write a byte into the current message. - * @param uint8_t data to write in the allocator - * @return None - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL void MsgAlloc_SetData(uint8_t data) -{ - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^-------------------------------------------------------------+ - // | - // data_ptr - // - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |First Data Byte|---------------------------------------------| - // +---------------^---------------------------------------------+ - // | - // data_ptr - // - //******** Write data ********* - *data_ptr = data; - data_ptr++; + // We consider this space as occupied, move data to the next available space + data_ptr = (uint8_t *)((uintptr_t)returned_ptr + data_size); + return returned_ptr; } /****************************************************************************** * @brief No message in buffer receive since initialization @@ -857,7 +597,6 @@ _CRITICAL static inline void MsgAlloc_ClearMsgTask(void) ******************************************************************************/ error_return_t MsgAlloc_PullMsgToInterpret(msg_t **returned_msg) { - MsgAlloc_ValidDataIntegrity(); if (msg_tasks_stack_id > 0) { // Case SUCCEED @@ -994,7 +733,6 @@ void MsgAlloc_LuosTaskAlloc(service_t *service_concerned_by_current_msg, msg_t * ******************************************************************************/ error_return_t MsgAlloc_PullMsg(service_t *target_service, msg_t **returned_msg) { - MsgAlloc_ValidDataIntegrity(); // // Pull a message from a specific service // @@ -1064,7 +802,6 @@ error_return_t MsgAlloc_PullMsg(service_t *target_service, msg_t **returned_msg) ******************************************************************************/ error_return_t MsgAlloc_PullMsgFromLuosTask(uint16_t luos_task_id, msg_t **returned_msg) { - MsgAlloc_ValidDataIntegrity(); // // msg_buffer example : msg_buffer after pulling message D2 // +------------------------+ +------------------------+ @@ -1122,7 +859,6 @@ error_return_t MsgAlloc_PullMsgFromLuosTask(uint16_t luos_task_id, msg_t **retur ******************************************************************************/ error_return_t MsgAlloc_LookAtLuosTask(uint16_t luos_task_id, service_t **allocated_service) { - MsgAlloc_ValidDataIntegrity(); // // luos_tasks // +---------+ @@ -1377,260 +1113,23 @@ void MsgAlloc_ClearMsgFromLuosTasks(msg_t *msg) ******************************************************************************/ error_return_t MsgAlloc_SetTxTask(service_t *service_pt, uint8_t *data, uint16_t crc, uint16_t size, luos_localhost_t localhost, uint8_t ack) { - LUOS_ASSERT((tx_tasks_stack_id >= 0) && (tx_tasks_stack_id < MAX_MSG_NB) && ((uintptr_t)data > 0) && ((uintptr_t)current_msg < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE]) && ((uintptr_t)current_msg >= (uintptr_t)&msg_buffer[0])); - void *rx_msg_bkp = 0; - void *tx_msg = 0; - uint16_t progression_size = 0; - uint16_t estimated_size = 0; - uint16_t decay_size = 0; - - // Start by cleaning the memory - MsgAlloc_ValidDataIntegrity(); + LUOS_ASSERT((tx_tasks_stack_id >= 0) && (tx_tasks_stack_id < MAX_MSG_NB) && ((uintptr_t)data > 0)); + void *tx_msg = 0; // Then compute if we have space into the TX_message buffer stack if (tx_tasks_stack_id >= MAX_MSG_NB - 1) { return FAILED; } - // Stop it MSGALLOC_MUTEX_LOCK - LuosHAL_SetIrqState(false); - // compute RX progression - progression_size = (uintptr_t)data_ptr - (uintptr_t)current_msg; - estimated_size = (uintptr_t)data_end_estimation - (uintptr_t)current_msg; - rx_msg_bkp = (void *)current_msg; - // - // * msg_buffer at beginning of MsgAlloc_SetTxTask : we are receiving a Rx message (complete or incomplete) - // +--------------------------------------------------------------------------+ - // |------------------------------| Receiving Rx ... |------------------------| - // +------------------------------^-------------------------------------------+ - // | - // current_msg - // - // * 2 cases for msg_buffer at end of MsgAlloc_SetTxTask : - // - // --> Case 1 : If Rx size received >= Tx size : - // - Rx message is decayed of "decay_size" after Tx message - // - Tx message is copied to former Rx message space memory - // - Padding is added : important for a correct mem copy behaviour - // +--------------------------------------------------------------------------+ - // |------------------------------| Tx | Padding | Rx |-------------| - // +------------------------------^--------------^----------------------------+ - // | | - // |------------->| - // | decay_size | - // | | - // current_msg current_msg - // init state - // - // --> Case 2 : If Rx size received > Tx size : - // - Rx message is decayed of "decay_size" after Tx message - // - Tx message is copied to former Rx message space memory - // - No padding - // +--------------------------------------------------------------------------+ - // |------------------------------| Tx | Rx |-------------------| - // +-------------------------------------------------^-----------------------+ - // | | - // |----------------->| - // | decay_size | - // | | - // current_msg current_msg - // init state - // - // So, we have to consider the biggest size between progression_size and size to be able to make a clean copy without stopping IRQ - if (progression_size > size) - { - decay_size = progression_size; - } - else - { - decay_size = size; - } - // Check if the message to send size (+ possible padding) fits into msg buffer - if (MsgAlloc_DoWeHaveSpace((void *)((uintptr_t)current_msg + decay_size)) == FAILED) - { - // - // message to send don't fit - // check at the end of buffer if there is a task - // - // - // +--------------------------------------------------------+ - // memory needed : |--------------------------------| "size Tx" or "size Rx received" | - // +--------------------------------^-----------------------+ - // | - // current_msg - // - // There is no space available for now - if (MsgAlloc_CheckMsgSpace((void *)current_msg, (void *)(uintptr_t)(&msg_buffer[MSG_BUFFER_SIZE - 1])) == FAILED) - { - // Check at the beginning of buffer if there is a task - // - // - // +----------------------------------------------------------------------------+ - // memory needed : |----------| "size Tx" or "size Rx received" |----------------------------| - // msg_buffer : |----------|------------|Task|----------------------------------------------| - // +----------^------------^---------------------------------------------------+ - // | | - // current_msg FAILED (there is a task) - // - LuosHAL_SetIrqState(true); - MSGALLOC_MUTEX_UNLOCK - return FAILED; - } - - if (MsgAlloc_CheckMsgSpace((void *)msg_buffer, (void *)((uintptr_t)msg_buffer + decay_size + estimated_size)) == FAILED) - { - // Check at the beginning of buffer if there is a task - // - // - // +----------------------------------------------------------------------------+ - // memory needed : | "size Tx" or "size Rx received" |---------------------------------------| - // msg_buffer : |--------------------------|Task|--------------------------------------------| - // +--------------------------^------------------------------------------------+ - // | - // FAILED (there is a task) - // - // There is no space available for now - LuosHAL_SetIrqState(true); - MSGALLOC_MUTEX_UNLOCK - return FAILED; - } - // move everything at the begining of the buffer - tx_msg = (void *)msg_buffer; - current_msg = (msg_t *)((uintptr_t)msg_buffer + decay_size); - data_ptr = (uint8_t *)((uintptr_t)current_msg + progression_size); - data_end_estimation = (uint8_t *)((uintptr_t)current_msg + estimated_size); - // We don't need to clear the space, we already check it using MsgAlloc_CheckMsgSpace - } - else - { - // Message to send fit - // - // +----------------------------------------------------------------+ - // memory needed : |-------------------| "size Tx" or "size Rx received" |-------| - // +-------------------^--------------------------------------------+ - // | - // current_msg - // - tx_msg = (void *)current_msg; - // Check if the receiving message size fit into msg buffer - if (MsgAlloc_DoWeHaveSpace((void *)((uintptr_t)tx_msg + decay_size + estimated_size)) == FAILED) - { - // receiving message don't fit, move it to the start of the buffer - // - // +------------------------------------------------------+ - // memory needed : |---------------| ("size Tx" or "size Rx received") + Rx estimated_size | - // +---------------^--------------------------------------+ - // | - // tx_msg - // - // Check space for the TX message - if (MsgAlloc_CheckMsgSpace((void *)tx_msg, (void *)((uintptr_t)tx_msg + decay_size)) == FAILED) - { - // There is no space available for now - // - // +--------------------------------------------------+ - // memory needed : |----------| "size Tx" or "size Rx received" |--+ - // msg_buffer : |----------|------------|Task|---------------------+ - // +----------^------------^--------------------------+ - // | | - // tx_msg FAILED (there is a task) - // - LuosHAL_SetIrqState(true); - MSGALLOC_MUTEX_UNLOCK - return FAILED; - } - // Check if there is a task between tx and end of buffer - if (MsgAlloc_CheckMsgSpace((void *)tx_msg, (void *)(uintptr_t)(&msg_buffer[MSG_BUFFER_SIZE - 1])) == FAILED) - { - // There is no space available for now - // - // +----------------------------------------------------------------------------+ - // memory needed : |----------| "size Tx" or "size Rx received" |----------------------------| - // msg_buffer : |----------|------------|-----------------------------------------------|Task| - // +----------^------------------------------------------------------------^----+ - // | | - // tx_msg FAILED (there is a task) - // - LuosHAL_SetIrqState(true); - MSGALLOC_MUTEX_UNLOCK - return FAILED; - } - // Check space for the RX message - if (MsgAlloc_CheckMsgSpace((void *)msg_buffer, (void *)((uintptr_t)msg_buffer + estimated_size)) == FAILED) - { - // There is no space available for now - // - // +----------------------------------------------------------------------------+ - // memory needed : | Rx estimated_size |------------------------------------------------------+ - // msg_buffer : |------------------|Task|----------------------------------------------------+ - // +------------------^---------------------------------------------------------+ - // | - // FAILED (there is a task) - // - LuosHAL_SetIrqState(true); - MSGALLOC_MUTEX_UNLOCK - return FAILED; - } - current_msg = (msg_t *)msg_buffer; - data_end_estimation = (uint8_t *)((uintptr_t)current_msg + estimated_size); - // We don't need to clear the space, we already check it using MsgAlloc_CheckMsgSpace - } - else - { - // receiving message fit, move receiving message of tx_message size - // Check space for the TX and RX message - if (MsgAlloc_CheckMsgSpace((void *)((uintptr_t)tx_msg), (void *)((uintptr_t)tx_msg + decay_size + estimated_size)) == FAILED) - { - // There is no space available for now - // - // +----------------------------------------------------------------------+ - // memory needed : |-----|("size Tx" or "size Rx received") + Rx estimated_size|-------+ - // msg_buffer : |-----|------------|Task|----------------------------------------------+ - // +-----^------------^---------------------------------------------------+ - // | | - // tx_msg FAILED (there is a task) - // - LuosHAL_SetIrqState(true); - MSGALLOC_MUTEX_UNLOCK - return FAILED; - } - current_msg = (msg_t *)((uintptr_t)current_msg + decay_size); - data_end_estimation = (uint8_t *)((uintptr_t)current_msg + estimated_size); - // We don't need to clear the space, we already check it using MsgAlloc_CheckMsgSpace - } - data_ptr = (uint8_t *)((uintptr_t)current_msg + progression_size); - LUOS_ASSERT((uintptr_t)(data_ptr) < (uintptr_t)(&msg_buffer[MSG_BUFFER_SIZE])); - } - // From here we have enough space to copy Tx message followed by Rx message - // First : deals with Rx - //---------------------------- - void *current_msg_cpy = (void *)current_msg; - // Copy previously received header parts - if (progression_size >= sizeof(header_t)) - { - // We have already received more than a header - // Copy the header before reenabling IRQ - memcpy((void *)current_msg_cpy, rx_msg_bkp, sizeof(header_t)); - // re-enable IRQ - LuosHAL_SetIrqState(true); - // Now we can copy additional datas - memcpy((void *)((uintptr_t)current_msg_cpy + sizeof(header_t)), (void *)((uintptr_t)rx_msg_bkp + sizeof(header_t)), (progression_size - sizeof(header_t))); - } - else - { - // Copy previously received incomplete header bytes - memcpy((void *)current_msg_cpy, rx_msg_bkp, progression_size); - // re-enable IRQ - LuosHAL_SetIrqState(true); - } + LuosHAL_SetIrqState(false); + // Alloc the space for the message + tx_msg = (void *)MsgAlloc_Alloc(size); + LuosHAL_SetIrqState(true); - // Secondly : deals with Tx - //---------------------------- - // Copy 3 bytes from the message to transmit just to be sure to be ready to start transmitting - // During those 3 bytes we have the time necessary to copy the other bytes - memcpy((void *)tx_msg, (void *)data, 3); + // Copy the tx msg into the buffer + memcpy((void *)tx_msg, (void *)data, size); #ifndef VERBOSE_LOCALHOST if (localhost != LOCALHOST) @@ -1657,33 +1156,17 @@ error_return_t MsgAlloc_SetTxTask(service_t *service_pt, uint8_t *data, uint16_t } #endif - // finish the Tx copy (with Ack if necessary) + // Write the CRC and the ACK if needed if (ack != 0) { - // msg_buffer : add Ack - // +-------------------------------------------------------------+ - // |----------------------------------| Tx + Ack | Rx |------| - // +-------------------------------------------------------------+ - // - // Finish the copy of the message to transmit - LuosHAL_SetIrqState(false); - memcpy((void *)&((char *)tx_msg)[3], (void *)&data[3], size - 6); // 3 bytes already copied - 2 bytes CRC - 1 byte ack - LuosHAL_SetIrqState(true); + // Write the CRC and Ack ((char *)tx_msg)[size - 3] = (uint8_t)(crc); ((char *)tx_msg)[size - 2] = (uint8_t)(crc >> 8); ((char *)tx_msg)[size - 1] = ack; } else { - // msg_buffer - // +-------------------------------------------------------------+ - // |----------------------------------| Tx | Rx |------------| - // +----------------------------------^--------------------------+ - // | - // tx_msg - // - // Finish the copy of the message to transmit - memcpy((void *)&((char *)tx_msg)[3], (void *)&data[3], size - 5); // 3 bytes already copied - 2 bytes CRC + // Write the CRC only ((char *)tx_msg)[size - 2] = (uint8_t)(crc); ((char *)tx_msg)[size - 1] = (uint8_t)(crc >> 8); } @@ -1820,7 +1303,6 @@ void MsgAlloc_PullServiceFromTxTask(uint16_t service_id) _CRITICAL error_return_t MsgAlloc_GetTxTask(service_t **service_pt, uint8_t **data, uint16_t *size, uint8_t *localhost) { LUOS_ASSERT(tx_tasks_stack_id < MAX_MSG_NB); - MsgAlloc_ValidDataIntegrity(); // // example if luos_tasks_stack_id = 0 diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 8f39c32a3..0312fdfbe 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -15,6 +15,7 @@ #include "filter.h" #include "service.h" #include "struct_engine.h" +#include "luos_io.h" /******************************************************************************* * Variables diff --git a/examples/projects/l0/dxl/lib/Dxl/dxl.c b/examples/projects/l0/dxl/lib/Dxl/dxl.c index 16a8952dc..99a7e79d0 100644 --- a/examples/projects/l0/dxl/lib/Dxl/dxl.c +++ b/examples/projects/l0/dxl/lib/Dxl/dxl.c @@ -15,7 +15,7 @@ /******************************************************************************* * Definitions ******************************************************************************/ -#define BUFFER_SIZE 1000 +#define BUFFER_SIZE 500 /******************************************************************************* * Variables diff --git a/examples/projects/l0/gate_serialcom/node_config.h b/examples/projects/l0/gate_serialcom/node_config.h index 538cc74bb..012118c0f 100644 --- a/examples/projects/l0/gate_serialcom/node_config.h +++ b/examples/projects/l0/gate_serialcom/node_config.h @@ -100,8 +100,8 @@ * :-------------------------|------------------------------------------------------ * MAX_RTB_ENTRY | 40 | max number entry in routing table * GATE_BUFF_SIZE | 1024 | Json receive buffer size - * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size - * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size + * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size + * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size * INIT_TIME | 150 | Wait init time before first detection ******************************************************************************/ #define MAX_RTB_ENTRY 40 diff --git a/network/robus/inc/robus.h b/network/robus/inc/robus.h index 5b4421f1b..2db25fb2e 100644 --- a/network/robus/inc/robus.h +++ b/network/robus/inc/robus.h @@ -8,7 +8,7 @@ #define _ROBUS_H_ #include -#include "luos_io.h" +#include "luos_phy.h" /******************************************************************************* * Function @@ -22,5 +22,6 @@ void Robus_SaveNodeID(uint16_t nodeid); void Robus_ResetNodeID(void); bool Robus_Busy(void); error_return_t Robus_FindNeighbour(void); +luos_phy_t *Robus_GetPhy(void); #endif /* _ROBUS_H_ */ diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index 79e27c887..6b15c4be5 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -50,9 +50,7 @@ #include "luos_utils.h" #include "_timestamp.h" #include "robus.h" -#include "bootloader_core.h" #include "filter.h" -#include "struct_engine.h" #include "context.h" /******************************************************************************* * Definitions @@ -66,19 +64,18 @@ #endif #define COLLISION_DETECTION_NUMBER 4 -#define BYTE_TRANSMIT_TIME 8 /******************************************************************************* * Variables ******************************************************************************/ -uint16_t data_count = 0; -uint16_t data_size = 0; -uint16_t crc_val = 0; +uint8_t data_rx[sizeof(msg_t)] = {0}; // Buffer to store the received data +uint16_t crc_val = 0; // CRC value /******************************************************************************* * Function ******************************************************************************/ -static inline uint8_t Recep_IsAckNeeded(void); +static inline uint8_t Recep_IsAckNeeded(luos_phy_t *phy_robus); +static inline bool Recep_IsARobusSpecialMsg(header_t *header); /****************************************************************************** * @brief Reception init. * @param None @@ -86,11 +83,16 @@ static inline uint8_t Recep_IsAckNeeded(void); ******************************************************************************/ void Recep_Init(luos_phy_t *phy_robus) { + LUOS_ASSERT(phy_robus != NULL); + LUOS_ASSERT(phy_robus->rx_alloc_job == false); // Initialize the reception state machine - ctx.rx.status.unmap = 0; - ctx.rx.callback = Recep_GetHeader; - ctx.rx.status.identifier = 0xF; - phy_robus->rx_timestamp = 0; + ctx.rx.status.unmap = 0; + ctx.rx.callback = Recep_GetHeader; + ctx.rx.status.identifier = 0xF; + phy_robus->rx_timestamp = 0; + phy_robus->rx_buffer_base = data_rx; + phy_robus->rx_data = data_rx; + phy_robus->rx_keep = true; } /****************************************************************************** * @brief Callback to get a complete header @@ -100,78 +102,50 @@ void Recep_Init(luos_phy_t *phy_robus) ******************************************************************************/ _CRITICAL void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data) { - // Catch a byte. - MsgAlloc_SetData(*data); - data_count++; + // Catch the byte. + phy_robus->rx_data[phy_robus->received_data++] = *data; // Check if we have all we need. - switch (data_count) + switch (phy_robus->received_data) { case 1: - // Reset CRC computation // When we catch the first byte we timestamp the msg // We remove the time of the first byte to get the exact reception date. // 1 byte is 10 bits and we convert it to nanoseconds phy_robus->rx_timestamp = LuosHAL_GetTimestamp() - ((uint32_t)10 * (uint32_t)1000000000 / (uint32_t)DEFAULTBAUDRATE); + // Declare Robus as busy ctx.tx.lock = true; // Switch the transmit status to disable to be sure to not interpreat the end timeout as an end of transmission. ctx.tx.status = TX_DISABLE; - crc_val = 0xFFFF; - break; - - case 3: // check if message is for the node - if (Recep_NodeConcerned((header_t *)¤t_msg->header) == false) - { - MsgAlloc_ValidHeader(false, data_size); - ctx.rx.callback = Recep_Drop; - return; - } + // Reset CRC computation + crc_val = 0xFFFF; break; - case (sizeof(header_t)): // Process at the header + case (sizeof(header_t)): + // Header finished #ifdef DEBUG printf("*******header data*******\n"); - printf("protocol : 0x%04x\n", current_msg->header.config); /*!< Protocol version. */ - printf("target : 0x%04x\n", current_msg->header.target); /*!< Target address, it can be (ID, Multicast/Broadcast, Type). */ - printf("target_mode : 0x%04x\n", current_msg->header.target_mode); /*!< Select targeting mode (ID, ID+ACK, Multicast/Broadcast, Type). */ - printf("source : 0x%04x\n", current_msg->header.source); /*!< Source address, it can be (ID, Multicast/Broadcast, Type). */ - printf("cmd : 0x%04x\n", current_msg->header.cmd); /*!< msg definition. */ - printf("size : 0x%04x\n", current_msg->header.size); /*!< Size of the data field. */ + printf("protocol : 0x%04x\n", phy_robus->rx_msg->header.config); /*!< Protocol version. */ + printf("target : 0x%04x\n", phy_robus->rx_msg->header.target); /*!< Target address, it can be (ID, Multicast/Broadcast, Type). */ + printf("target_mode : 0x%04x\n", phy_robus->rx_msg->header.target_mode); /*!< Select targeting mode (ID, ID+ACK, Multicast/Broadcast, Type). */ + printf("source : 0x%04x\n", phy_robus->rx_msg->header.source); /*!< Source address, it can be (ID, Multicast/Broadcast, Type). */ + printf("cmd : 0x%04x\n", phy_robus->rx_msg->header.cmd); /*!< msg definition. */ + printf("size : 0x%04x\n", phy_robus->rx_msg->header.size); /*!< Size of the data field. */ #endif - // Reset the catcher. - data_count = 0; - // Switch state machine to data reception ctx.rx.callback = Recep_GetData; - // Cap size for big messages - if (current_msg->header.size > MAX_DATA_MSG_SIZE) - { - data_size = MAX_DATA_MSG_SIZE; - } - else - { - data_size = current_msg->header.size; - // we need to check if we have a timestamped message and increase the data size if yes - if (Luos_IsMsgTimstamped((msg_t *)current_msg) == true) - { - data_size += sizeof(time_luos_t); - } - } + // Compute message size the result will be available in phy_robus->rx_size + Phy_ComputeMsgSize(phy_robus); if (ctx.rx.status.rx_framing_error == false) { - if (data_size) + if (Recep_IsARobusSpecialMsg((header_t *)data_rx) == false) { - MsgAlloc_ValidHeader(true, data_size); + // Put a flag to tell that we need to alloc this message + phy_robus->rx_alloc_job = true; } } - else - { - MsgAlloc_ValidHeader(false, data_size); - ctx.rx.callback = Recep_Drop; - return; - } break; default: @@ -187,62 +161,48 @@ _CRITICAL void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data) ******************************************************************************/ _CRITICAL void Recep_GetData(luos_phy_t *phy_robus, volatile uint8_t *data) { - MsgAlloc_SetData(*data); - if (data_count < data_size) + static uint16_t crc; + if (phy_robus->received_data < phy_robus->rx_size) { - // Continue CRC computation until the end of data + // Catch the byte. + phy_robus->rx_data[phy_robus->received_data] = *data; + // Continue the CRC computation until the end of data RobusHAL_ComputeCRC((uint8_t *)data, (uint8_t *)&crc_val); } - else if (data_count > data_size) + else if (phy_robus->received_data > phy_robus->rx_size) { - uint16_t crc = ((uint16_t)current_msg->data[data_size]) | ((uint16_t)current_msg->data[data_size + 1] << 8); + crc = crc | ((uint16_t)(*data) << 8); if (crc == crc_val) { - if (Recep_IsAckNeeded()) + // Message is OK + // Check if we need to send an ack + if (Recep_IsAckNeeded(phy_robus)) { + // Send an Ack Transmit_SendAck(); } - MsgAlloc_ValidDataIntegrity(); - // If message is timestamped, convert the latency to date - if (Luos_IsMsgTimstamped((msg_t *)current_msg)) - { - // This conversion also remove the timestamp from the message size. - Timestamp_ConvertToDate((msg_t *)current_msg, phy_robus->rx_timestamp); - } - - // Make an exception for bootloader command - if ((current_msg->header.cmd == BOOTLOADER_CMD) && (current_msg->data[0] == BOOTLOADER_RESET)) - { - LuosHAL_SetMode((uint8_t)BOOT_MODE); - LuosHAL_Reboot(); - } - - // Make an exception for reset detection command - if (current_msg->header.cmd == START_DETECTION) - { - MsgAlloc_Reset(); - ctx.tx.status = TX_DISABLE; - Node_SetState(EXTERNAL_DETECTION); - PortMng_Init(); - } - else - { - MsgAlloc_EndMsg(); - } + // Valid the message + Phy_ValidMsg(phy_robus); } else { ctx.rx.status.rx_error = true; - if (Recep_IsAckNeeded()) + if (Recep_IsAckNeeded(phy_robus)) { Transmit_SendAck(); } - MsgAlloc_InvalidMsg(); + // We dont valid the message, this will fragment a little bit the memory but it will be faster than a full memory check } + // We will drop any data received between now and the timeout ctx.rx.callback = Recep_Drop; return; } - data_count++; + else + { + // This is the first byte of the CRC, store it + crc = (uint16_t)(*data); + } + phy_robus->received_data++; } /****************************************************************************** * @brief Callback to get a collision beetween RX and Tx @@ -252,6 +212,7 @@ _CRITICAL void Recep_GetData(luos_phy_t *phy_robus, volatile uint8_t *data) ******************************************************************************/ _CRITICAL void Recep_GetCollision(luos_phy_t *phy_robus, volatile uint8_t *data) { + static uint8_t data_count = 0; // Check data integrity if ((ctx.tx.data[data_count++] != *data) || (!ctx.tx.lock) || (ctx.rx.status.rx_framing_error == true)) { @@ -262,21 +223,12 @@ _CRITICAL void Recep_GetCollision(luos_phy_t *phy_robus, volatile uint8_t *data) // Save the received data into the allocator to be able to continue the reception for (uint8_t i = 0; i < data_count - 1; i++) { - MsgAlloc_SetData(*ctx.tx.data + i); + Recep_GetHeader(phy_robus, &ctx.tx.data[i]); } - MsgAlloc_SetData(*data); + Recep_GetHeader(phy_robus, data); // Switch to get header. ctx.rx.callback = Recep_GetHeader; ctx.tx.status = TX_NOK; - if (data_count >= 3) - { - if (Recep_NodeConcerned((header_t *)¤t_msg->header) == false) - { - MsgAlloc_ValidHeader(false, data_size); - ctx.rx.callback = Recep_Drop; - return; - } - } } else { @@ -286,6 +238,7 @@ _CRITICAL void Recep_GetCollision(luos_phy_t *phy_robus, volatile uint8_t *data) selftest_SetRxFlag(); #endif // Collision detection end + data_count = 0; RobusHAL_SetRxState(false); RobusHAL_ResetTimeout(0); if (ctx.tx.status == TX_NOK) @@ -301,7 +254,6 @@ _CRITICAL void Recep_GetCollision(luos_phy_t *phy_robus, volatile uint8_t *data) return; } } - RobusHAL_ComputeCRC((uint8_t *)data, (uint8_t *)&crc_val); } /****************************************************************************** * @brief Callback to drop received data wrong header, data, or collision @@ -325,7 +277,6 @@ _CRITICAL void Recep_Timeout(void) { ctx.rx.status.rx_timeout = true; } - MsgAlloc_InvalidMsg(); Recep_Reset(); Transmit_End(); // This is possibly the end of a transmission, check it. } @@ -337,10 +288,13 @@ _CRITICAL void Recep_Timeout(void) ******************************************************************************/ _CRITICAL void Recep_Reset(void) { - data_count = 0; + luos_phy_t *phy_robus = Robus_GetPhy(); + phy_robus->received_data = 0; crc_val = 0xFFFF; ctx.rx.status.rx_framing_error = false; ctx.rx.callback = Recep_GetHeader; + phy_robus->rx_buffer_base = data_rx; + phy_robus->rx_data = data_rx; RobusHAL_SetRxDetecPin(true); } /****************************************************************************** @@ -369,7 +323,7 @@ _CRITICAL void Recep_CatchAck(luos_phy_t *phy_robus, volatile uint8_t *data) * warning : this function can be redefined only for mock testing purpose * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL bool Recep_NodeConcerned(header_t *header) +_CRITICAL static inline bool Recep_IsARobusSpecialMsg(header_t *header) { // Find if we are concerned by this message. if ((header->target_mode == NODEIDACK) || (header->target_mode == SERVICEIDACK)) @@ -381,10 +335,10 @@ _CRITICAL bool Recep_NodeConcerned(header_t *header) { if ((header->target == 0) && (ctx.port.activ != NBR_PORT) && (ctx.port.keepLine == false)) { - return true; // Keep message if nodeID = 0 and a PTP is activ + return true; // Message is specific to Robus if nodeID = 0 and a a PTP is activ } } - return (Filter_GetLocalhost(header) != EXTERNALHOST); + return false; } /****************************************************************************** @@ -393,19 +347,19 @@ _CRITICAL bool Recep_NodeConcerned(header_t *header) * @return true or false * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL static inline uint8_t Recep_IsAckNeeded(void) +_CRITICAL static inline uint8_t Recep_IsAckNeeded(luos_phy_t *phy_robus) { - // check the mode of the message received - if ((current_msg->header.target_mode == SERVICEIDACK) && (Filter_ServiceID(current_msg->header.target))) + header_t *header = (header_t *)(phy_robus->rx_buffer_base); + // Check the mode of the message received + if ((header->target_mode == SERVICEIDACK) && (Filter_ServiceID(header->target))) { - // when it is a serviceidack and this message is destined to the node send an ack + // When it is a serviceidack and this message is destined to the node send an ack return 1; } - else if ((current_msg->header.target_mode == NODEIDACK) && (Node_Get()->node_id == current_msg->header.target)) + else if ((header->target_mode == NODEIDACK) && (Node_Get()->node_id == header->target)) { - // when it is nodeidack and this message is destined to the node send an ack + // When it is nodeidack and this message is destined to the node send an ack return 1; } - // if not failed return 0; } diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index a330930ac..0a5c5711f 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -185,4 +185,13 @@ error_return_t Robus_FindNeighbour(void) _CRITICAL void Recep_data(volatile uint8_t *data) { ctx.rx.callback(phy_robus, data); -} \ No newline at end of file +} + +/****************************************************************************** + * @brief Get the phy pointer + * @return luos_phy_t* + ******************************************************************************/ +luos_phy_t *Robus_GetPhy(void) +{ + return phy_robus; +} diff --git a/platformio.ini b/platformio.ini index 3a9d7b877..86e7b38a9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -32,4 +32,4 @@ build_type = debug test_build_src = true ; To debug a test, replace "test_template" by the directory test name you want to debug (example : "test_msg_alloc") -; debug_test = test_template +debug_test = test_msg_alloc diff --git a/test/test_msg_alloc/main.c b/test/test_msg_alloc/main.c index ce3f1a18e..f3762bf3f 100644 --- a/test/test_msg_alloc/main.c +++ b/test/test_msg_alloc/main.c @@ -14,15 +14,10 @@ int main(int argc, char **argv) UNIT_TEST_RUN(unittest_ClearMsgTask); UNIT_TEST_RUN(unittest_ClearLuosTask); UNIT_TEST_RUN(unittest_ClearMsgSpace); - UNIT_TEST_RUN(unittest_ValidDataIntegrity); - ////MsgAlloc_FindNewOldestMsg => this function doesn't need unit test // Generic functions UNIT_TEST_RUN(unittest_MsgAlloc_loop); - UNIT_TEST_RUN(unittest_MsgAlloc_ValidHeader); - UNIT_TEST_RUN(unittest_MsgAlloc_InvalidMsg); - UNIT_TEST_RUN(unittest_MsgAlloc_EndMsg); - UNIT_TEST_RUN(unittest_MsgAlloc_SetData); + UNIT_TEST_RUN(unittest_MsgAlloc_Alloc); UNIT_TEST_RUN(unittest_MsgAlloc_IsEmpty); UNIT_TEST_RUN(unittest_MsgAlloc_UsedMsgEnd); UNIT_TEST_RUN(unittest_MsgAlloc_GetLuosTaskSourceId); @@ -39,19 +34,13 @@ int main(int argc, char **argv) UNIT_TEST_RUN(unittest_MsgAlloc_PullMsgFromTxTask); UNIT_TEST_RUN(unittest_MsgAlloc_PullServiceFromTxTask); UNIT_TEST_RUN(unittest_MsgAlloc_GetTxTask); - // MsgAlloc_Init => this function doesn't need unit test // Tx functions UNIT_TEST_RUN(unittest_SetTxTask_buffer_full); - UNIT_TEST_RUN(unittest_SetTxTask_Tx_too_long_1); - UNIT_TEST_RUN(unittest_SetTxTask_Tx_too_long_2); - UNIT_TEST_RUN(unittest_SetTxTask_Tx_too_long_3); - UNIT_TEST_RUN(unittest_SetTxTask_Rx_too_long_1); - UNIT_TEST_RUN(unittest_SetTxTask_Rx_too_long_2); - UNIT_TEST_RUN(unittest_SetTxTask_Rx_too_long_3); - UNIT_TEST_RUN(unittest_SetTxTask_Rx_too_long_4); + UNIT_TEST_RUN(unittest_SetTxTask_Tx_too_long); + UNIT_TEST_RUN(unittest_SetTxTask_Tx_overflow); + UNIT_TEST_RUN(unittest_SetTxTask_Tx_fit); UNIT_TEST_RUN(unittest_SetTxTask_Task_already_exists); - UNIT_TEST_RUN(unittest_SetTxTask_copy_OK); UNIT_TEST_RUN(unittest_SetTxTask_ACK); UNIT_TEST_RUN(unittest_SetTxTask_internal_localhost); UNIT_TEST_RUN(unittest_SetTxTask_multihost); diff --git a/test/test_msg_alloc/main.h b/test/test_msg_alloc/main.h index 4074e811e..def9a9541 100644 --- a/test/test_msg_alloc/main.h +++ b/test/test_msg_alloc/main.h @@ -9,14 +9,10 @@ void unittest_OldestMsgCandidate(void); void unittest_ClearMsgTask(void); void unittest_ClearLuosTask(void); void unittest_ClearMsgSpace(void); -void unittest_ValidDataIntegrity(void); // Generic functions void unittest_MsgAlloc_loop(void); -void unittest_MsgAlloc_ValidHeader(void); -void unittest_MsgAlloc_InvalidMsg(void); -void unittest_MsgAlloc_EndMsg(void); -void unittest_MsgAlloc_SetData(void); +void unittest_MsgAlloc_Alloc(void); void unittest_MsgAlloc_IsEmpty(void); void unittest_MsgAlloc_UsedMsgEnd(void); void unittest_MsgAlloc_GetLuosTaskSourceId(void); @@ -36,15 +32,10 @@ void unittest_MsgAlloc_GetTxTask(void); // Tx functions void unittest_SetTxTask_buffer_full(void); -void unittest_SetTxTask_Tx_too_long_1(void); -void unittest_SetTxTask_Tx_too_long_2(void); -void unittest_SetTxTask_Tx_too_long_3(void); -void unittest_SetTxTask_Rx_too_long_1(void); -void unittest_SetTxTask_Rx_too_long_2(void); -void unittest_SetTxTask_Rx_too_long_3(void); -void unittest_SetTxTask_Rx_too_long_4(void); +void unittest_SetTxTask_Tx_too_long(void); +void unittest_SetTxTask_Tx_overflow(void); +void unittest_SetTxTask_Tx_fit(void); void unittest_SetTxTask_Task_already_exists(void); -void unittest_SetTxTask_copy_OK(void); void unittest_SetTxTask_ACK(void); void unittest_SetTxTask_internal_localhost(void); void unittest_SetTxTask_multihost(void); diff --git a/test/test_msg_alloc/unit_test_mem_alloc_generic.c b/test/test_msg_alloc/unit_test_mem_alloc_generic.c index dbd332ab2..4f0d2e41e 100644 --- a/test/test_msg_alloc/unit_test_mem_alloc_generic.c +++ b/test/test_msg_alloc/unit_test_mem_alloc_generic.c @@ -25,12 +25,9 @@ typedef struct extern memory_stats_t *mem_stat; extern volatile bool reset_needed; extern volatile uint8_t msg_buffer[MSG_BUFFER_SIZE]; -extern volatile msg_t *current_msg; extern volatile uint8_t *data_ptr; -extern volatile uint8_t *data_end_estimation; extern volatile msg_t *oldest_msg; extern volatile msg_t *used_msg; -extern volatile uint8_t mem_clear_needed; extern volatile msg_t *msg_tasks[MAX_MSG_NB]; extern volatile uint16_t msg_tasks_stack_id; extern volatile luos_task_t luos_tasks[MAX_MSG_NB]; @@ -97,14 +94,14 @@ void unittest_MsgAlloc_loop() NEW_TEST_CASE("Verify buffer occupation rate stat computing"); MsgAlloc_Init(NULL); { - // data_end_estimation is incremented : buffer occupation computing is verified + // data_ptr is incremented : buffer occupation computing is verified // // msg_buffer // +-------------------------------------------------------------+ // |-------------------------------------------------------------| // ^-------------------------^---------------------^-------------+ // | | | - // data_end_estimation data_end_estimation data_end_estimation + // data_ptr data_ptr data_ptr // (0% occupation) (X% occupation) (etc...) // @@ -119,12 +116,11 @@ void unittest_MsgAlloc_loop() memset(&memory_stats, 0, sizeof(memory_stats)); MsgAlloc_Init(&memory_stats); - current_msg = (msg_t *)&msg_buffer[0]; + data_ptr = &msg_buffer[0]; // Call function and Verify //--------------------------- // Empty buffer - data_end_estimation = (uint8_t *)(current_msg); expected_buffer_occupation_ratio = 0; MsgAlloc_loop(); @@ -133,9 +129,10 @@ void unittest_MsgAlloc_loop() // Buffer occupation from 0 -> 100% NEW_STEP("Check buffer is full in all cases"); + oldest_msg = (msg_t *)&msg_buffer[0]; for (uint16_t i = sizeof(header_t); i < MSG_BUFFER_SIZE; i++) { - data_end_estimation = (uint8_t *)(current_msg) + i; + data_ptr = &msg_buffer[0] + i; expected_buffer_occupation_ratio = (i * 100) / (MSG_BUFFER_SIZE); MsgAlloc_loop(); @@ -145,690 +142,9 @@ void unittest_MsgAlloc_loop() } } -void unittest_MsgAlloc_ValidHeader() -{ -#define DATA_SIZE 64 - NEW_TEST_CASE("Invalid header"); - MsgAlloc_Init(NULL); - { - // valid = FALSE => the header is invalidated - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |-------------------| Header |------------------------------| - // +-------------------^----------^------------------------------+ - // | | - // current_msg data_ptr - // - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |-------------------| ****** |------------------------------| - // +-------------------^-----------------------------------------+ - // | - // current_msg - // data_ptr - // - - uint8_t valid = false; - uint16_t data_size = 0; - - data_ptr = (uint8_t *)&msg_buffer[0]; - current_msg = (msg_t *)&msg_buffer[1]; - - MsgAlloc_ValidHeader(valid, data_size); - - NEW_STEP("Check header is invalid: \"data pointer\" is reseted to \"current message\""); - TEST_ASSERT_EQUAL((uint8_t *)current_msg, data_ptr); - } - - NEW_TEST_CASE("Drop message"); - MsgAlloc_Init(NULL); - { - // There is a used message pending in current message memory - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |-------------------| Header | Datas to be received |-------| - // |----------------------------------------| An old message |---| - // +-------------------^----------^---------^--------------------+ - // | | | - // current_msg data_ptr used_msg - // - // - // msg_buffer ending state : old message is cleared (used_msg = NULL) - // +-------------------------------------------------------------+ - // |-------------------| Header | Datas to be received |-------| - // +-------------------^----------^------------------------------+ - // | | - // current_msg data_ptr - // - - uint8_t valid = true; - uint16_t data_size = DATA_SIZE; - uint8_t *ptr = (uint8_t *)&msg_buffer[0]; - - memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, - .engine_msg_stack_ratio = 0, - .tx_msg_stack_ratio = 0, - .buffer_occupation_ratio = 0, - .msg_drop_number = 0}; - - memset(&memory_stats, 0, sizeof(memory_stats)); - MsgAlloc_Init(&memory_stats); - - current_msg = (msg_t *)ptr++; - used_msg = (msg_t *)ptr; - - MsgAlloc_ValidHeader(valid, data_size); - - NEW_STEP("Check buffer is full"); - TEST_ASSERT_EQUAL(100, memory_stats.buffer_occupation_ratio); - NEW_STEP("Check there is 1 message dropped"); - TEST_ASSERT_EQUAL(1, memory_stats.msg_drop_number); - } - - NEW_TEST_CASE("There is no space in msg_buffer"); - MsgAlloc_Init(NULL); - { - // There is a no space left - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |------------------------------------| Header | Datas to be received | - // +------------------------------------^----------^-------------+ ^ - // | | | - // current_msg data_ptr data_end_estimation - // - // - // msg_buffer ending state : - // +-------------------------------------------------------------+ - // || Header | Datas to be received |-------------------------- - // +----------^--------------------------------------------------+ - // | | - // current_msg data_ptr - // - - uint8_t valid = true; - uint16_t data_size = DATA_SIZE; - current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - 1]; - uint8_t *expected_data_ptr = (uint8_t *)&msg_buffer[0] + sizeof(header_t); - uint8_t *expected_data_end = expected_data_ptr + data_size + CRC_SIZE; - - MsgAlloc_ValidHeader(valid, data_size); - NEW_STEP("Check mem cleared flag is raised"); - TEST_ASSERT_EQUAL(true, mem_clear_needed); - NEW_STEP("Check \"data pointer\" has been computed"); - TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - NEW_STEP("Check \"data end estimation\" has been computed"); - TEST_ASSERT_EQUAL(expected_data_end, data_end_estimation); - } - - NEW_TEST_CASE("There is enough space : save the end position and raise the clear flag"); - MsgAlloc_Init(NULL); - { - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |----------------------| Header |---------------------------| - // +----------------------^----------^---------------------------+ - // | | - // current_msg data_ptr - // - // - // msg_buffer ending state : MEM_CLEAR_NEEDED = True - // +-------------------------------------------------------------+ - // |----------------------| Header | Datas to be received |----| - // +----------------------^----------^----------------------^----+ - // | | | - // current_msg data_ptr data_end_estimation - // - - uint8_t *expected_data_end; - uint8_t valid = true; - uint16_t data_size = DATA_SIZE; - - current_msg = (msg_t *)&msg_buffer[0]; - expected_data_end = (uint8_t *)current_msg + sizeof(header_t) + data_size + CRC_SIZE; - - MsgAlloc_ValidHeader(valid, data_size); - NEW_STEP("Check mem cleared flag is raised"); - TEST_ASSERT_EQUAL(true, mem_clear_needed); - NEW_STEP("Check \"data end estimation\" has been computed"); - TEST_ASSERT_EQUAL(expected_data_end, data_end_estimation); - } -} - -void unittest_MsgAlloc_InvalidMsg() -{ - NEW_TEST_CASE("Verify assertion cases"); - MsgAlloc_Init(NULL); - { -#define DATA_END_LIMIT (MSG_BUFFER_SIZE - sizeof(header_t) - CRC_SIZE) - - // current_msg is in limit position : no left memory for a message : ASSERT - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |---------------------------------------------| Message | - // +---------------------------------------------^---------------^ - // | | - // current_msg data_ptr - // - - NEW_STEP("Forbidden values are injected -> Verify function is asserting"); - for (uint16_t i = DATA_END_LIMIT; i < MSG_BUFFER_SIZE; i++) - { - // Init variables - //--------------- - current_msg = (msg_t *)&msg_buffer[i]; - RESET_ASSERT(); - - // Call function - //--------------- - MsgAlloc_InvalidMsg(); - - // Verify - //--------------- - TEST_ASSERT_TRUE(IS_ASSERT()); - } - RESET_ASSERT(); - - // current_msg is OK : enough memory for a message : NO ASSERT - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |----------------------------------------| Message |----| - // +----------------------------------------^---------------^----+ - // | | - // current_msg data_ptr - // - - NEW_STEP("Correct values are injected -> Verify function is NOT asserting"); - for (uint16_t i = 0; i < DATA_END_LIMIT; i++) - { - // Init variables - //--------------- - current_msg = (msg_t *)&msg_buffer[i]; - RESET_ASSERT(); - - // Call function - //--------------- - MsgAlloc_InvalidMsg(); - - // Verify - //--------------- - TEST_ASSERT_FALSE(IS_ASSERT()); - } - } - - NEW_TEST_CASE("Check pointers values after invaliding a message"); - MsgAlloc_Init(NULL); - { - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^--------------^----------------------------------------------+ - // | | - // current_msg data_ptr - // - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^---------------------^---------------------------------------+ - // | | - // current_msg data_end_estimation - // data_ptr - // | | - // <----Header + CRC----> - // - -#define DATA_END (sizeof(header_t) + CRC_SIZE) - - // Init variables - //--------------- - current_msg = (msg_t *)&msg_buffer[0]; - data_ptr = &msg_buffer[10]; - // Call function - //--------------- - MsgAlloc_InvalidMsg(); - - // Verify - //--------------- - NEW_STEP("Check message is invalid: \"data pointer\" is reseted to \"current message\""); - TEST_ASSERT_EQUAL(current_msg, data_ptr); - NEW_STEP("Check \"data end estimation\" is correctly computed"); - TEST_ASSERT_EQUAL(data_end_estimation, ((uint8_t *)current_msg + DATA_END)); - - // Init variables - //--------------- - current_msg = (msg_t *)&msg_buffer[100]; - data_ptr = &msg_buffer[110]; - - // Call function - //--------------- - MsgAlloc_InvalidMsg(); - - // Verify - //--------------- - NEW_STEP("Check message is invalid: \"data pointer\" is reseted to \"current message\""); - TEST_ASSERT_EQUAL(current_msg, data_ptr); - NEW_STEP("Check \"data end estimation\" is correctly computed"); - TEST_ASSERT_EQUAL(data_end_estimation, ((uint8_t *)current_msg + DATA_END)); - } - - NEW_TEST_CASE("Clean memory"); - MsgAlloc_Init(NULL); - { - // msg_buffer init - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // +------^-----------------^------^-------^---------------------+ - // | | | | - // oldest_msg | data_ptr | - // Msg 1.......... Msg 10 - // - // msg_tasks init state msg_tasks end state - // +---------+ +---------+ - // | Msg 1 | | Msg 6 | - // |---------| |---------| - // | Msg 2 | | Msg 7 | - // |---------| |---------| - // | Msg 3 | | Msg 8 | - // |---------| |---------| - // | Msg 4 | | Msg 9 | - // |---------| |---------| - // | Msg 5 | | Msg 10 | - // |---------| |---------| - // | Msg 6 | | 0 | - // |---------| |---------| - // | Msg 7 | | 0 | - // |---------| |---------| - // | Msg 8 | | 0 | - // |---------| |---------| - // | Msg 9 | | 0 | - // |---------| |---------| - // | Msg 10 | | 0 | - // +---------+ +---------+ - // - -#define DATA_INDEX 15 - // Init variables - //--------------- - memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, - .engine_msg_stack_ratio = 0, - .tx_msg_stack_ratio = 0, - .buffer_occupation_ratio = 0, - .msg_drop_number = 0}; - - memset(&memory_stats, 0, sizeof(memory_stats)); - MsgAlloc_Init(&memory_stats); - - msg_t *expected_msg_tasks[MAX_MSG_NB]; - oldest_msg = (msg_t *)&msg_buffer[DATA_INDEX - (MAX_MSG_NB / 2)]; - current_msg = (msg_t *)oldest_msg; - data_ptr = &msg_buffer[DATA_INDEX - 1]; - mem_clear_needed = true; // TRUE to clean memory - msg_tasks_stack_id = MAX_MSG_NB; - - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - msg_tasks[i] = (msg_t *)&msg_buffer[i + DATA_INDEX - (MAX_MSG_NB / 2)]; - } - - for (uint16_t i = 0; i < (MAX_MSG_NB / 2); i++) - { - expected_msg_tasks[i] = (msg_t *)msg_tasks[(i + (MAX_MSG_NB / 2))]; // 5 tasks must be shifted - } - - for (uint16_t i = (MAX_MSG_NB / 2); i < MAX_MSG_NB; i++) - { - expected_msg_tasks[i] = 0; // other msg_tasks must be cleared - } - - // Call function - //--------------- - MsgAlloc_InvalidMsg(); - - // Verify - //--------------- - NEW_STEP("Check there is no need to clear memory"); - TEST_ASSERT_EQUAL(false, mem_clear_needed); - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - NEW_STEP_IN_LOOP("Clean message task", i); - TEST_ASSERT_EQUAL(expected_msg_tasks[i], msg_tasks[i]); - } - } -} - -void unittest_MsgAlloc_EndMsg() -{ - NEW_TEST_CASE("Verify assertion cases"); - MsgAlloc_Init(NULL); - { -#define assert_nb 6 - typedef struct - { - bool expected_asserts; - uint16_t stack_id; - msg_t *tasks; - msg_t *old_message; - } assert_scenario; - - assert_scenario assert_sc[assert_nb]; - - // Expected Values - assert_sc[0].expected_asserts = true; - assert_sc[0].tasks = (msg_t *)&msg_buffer[0]; - assert_sc[0].stack_id = 0; - assert_sc[0].old_message = 0; - - assert_sc[1].expected_asserts = false; - assert_sc[1].tasks = 0; - assert_sc[1].stack_id = 0; - assert_sc[1].old_message = (msg_t *)&msg_buffer[0]; - - assert_sc[2].expected_asserts = false; - assert_sc[2].tasks = 0; - assert_sc[2].stack_id = 1; - assert_sc[2].old_message = (msg_t *)&msg_buffer[0]; - - assert_sc[3].expected_asserts = false; - assert_sc[3].tasks = 0; - assert_sc[3].stack_id = 0; - assert_sc[3].old_message = (msg_t *)&msg_buffer[MAX_MSG_NB * sizeof(msg_t)]; - - assert_sc[4].expected_asserts = true; - assert_sc[4].tasks = 0; - assert_sc[4].stack_id = 1; - assert_sc[4].old_message = (msg_t *)&msg_buffer[MAX_MSG_NB * sizeof(msg_t)]; - - assert_sc[5].expected_asserts = true; - assert_sc[5].tasks = 0; - assert_sc[5].stack_id = 1; - assert_sc[5].old_message = (msg_t *)&luos_tasks; - - // Launch test - for (uint8_t i = 0; i < assert_nb; i++) - { - RESET_ASSERT(); - // Init variables - //--------------- - current_msg = (msg_t *)&msg_buffer[0]; - msg_tasks_stack_id = assert_sc[i].stack_id; - msg_tasks[0] = assert_sc[i].old_message; - msg_tasks[msg_tasks_stack_id] = assert_sc[i].tasks; - - // Call function - //--------------- - MsgAlloc_EndMsg(); - - // Verify - //--------------- - NEW_STEP_IN_LOOP("Verify function is asserting when forbidden values are injected", i); - TEST_ASSERT_EQUAL(assert_sc[i].expected_asserts, IS_ASSERT()); - } - RESET_ASSERT(); - } - RESET_ASSERT(); - - NEW_TEST_CASE("Prepare the next message : update pointers"); - MsgAlloc_Init(NULL); - { - // msg_buffer init state - // +-------------------------------------------------------------+ - // | Header | Data | CRC |---------------------------------------+ - // +---------------------^---------------------------------------+ - // | - // data_ptr - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // OLD | Header | Data | CRC |---------------------------------------+ - // FUTURE |---------------| Header |------------------------------------+ - // +---------------^--------^------------------------------------+ - // | | - // data_ptr data_end_estimation - // current_msg - // - - uint8_t *expected_data_ptr; - uint8_t *expected_data_end_estimation; - - // Init variables - //--------------- - if ((uintptr_t)&msg_buffer[10] % 2 == 0) - { - data_ptr = &msg_buffer[10]; // Data is already aligned - } - else - { - data_ptr = &msg_buffer[9]; // Align data - } - expected_data_ptr = (uint8_t *)(data_ptr - CRC_SIZE); - expected_data_end_estimation = (uint8_t *)(data_ptr + sizeof(header_t)); - - // Call function - //--------------- - RESET_ASSERT(); - MsgAlloc_EndMsg(); - - // Verify - //--------------- - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - NEW_STEP("Check \"data pointer\" alignment"); - TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - NEW_STEP("Check \"current message\" is correctly computed"); - TEST_ASSERT_EQUAL(data_ptr, current_msg); - NEW_STEP("Check \"data end estimation\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_end_estimation, data_end_estimation); - NEW_STEP("Check mem cleared flag is raised"); - TEST_ASSERT_EQUAL(true, mem_clear_needed); - NEW_STEP("Check \"message tasks stack id\" is incremented to 1"); - TEST_ASSERT_EQUAL(1, msg_tasks_stack_id); - } - - NEW_TEST_CASE("Data are not aligned"); - MsgAlloc_Init(NULL); - { - uint8_t *expected_data_ptr; - - // Init variables - //--------------- - if ((uintptr_t)&msg_buffer[10] % 2 == 0) - { - data_ptr = &msg_buffer[9]; // Data pointer's address is not aligned - } - else - { - data_ptr = &msg_buffer[10]; // Data pointer's address is not aligned - } - - expected_data_ptr = (uint8_t *)(data_ptr - CRC_SIZE + 1); - - // Call function - //--------------- - MsgAlloc_EndMsg(); - - // Verify - //--------------- - NEW_STEP("Check \"data pointer\" alignment"); - TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - } - - NEW_TEST_CASE("Verify task allocation"); - MsgAlloc_Init(NULL); - { - // msg_buffer init state - // +-------------------------------------------------------------+ - // | Header | Data | CRC |---------------------------------------+ - // +---------------------^---------------------------------------+ - // | - // data_ptr - // - // msg_buffer ending state after calling "MsgAlloc_EndMsg" - // +-------------------------------------------------------------+ - // OLD | Header | Data | CRC |---------------------------------------+ - // ^-------------------------------------------------------------+ - // | - // oldest_message - // msg_tasks[0] - - MsgAlloc_EndMsg(); - NEW_STEP("Check first \"message task\" points to beginning of \"message buffer\""); - TEST_ASSERT_EQUAL((msg_t *)&msg_buffer[0], msg_tasks[0]); - NEW_STEP("Check \"oldest message\" points to beginning of \"message buffer\""); - TEST_ASSERT_EQUAL((msg_t *)&msg_buffer[0], oldest_msg); - } - - NEW_TEST_CASE("Not enough space for the next message"); - MsgAlloc_Init(NULL); - { - // msg_buffer init state - // +-------------------------------------------------------------+ - // |---------------------------------------------| Header | Data | CRC | - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |---------------------------------------------| Header | Data | CRC | - // ^-------------------------------------------------------------+ - // | - // data_ptr - // current_mag - - // Init variables - //--------------- - data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 1]; - - // Call function - //--------------- - MsgAlloc_EndMsg(); - - // Verify - //--------------- - NEW_STEP("Check \"data pointer\" points to beginning of \"message buffer\""); - TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[0], data_ptr); - NEW_STEP("Check \"current message\" points to beginning of \"message buffer\""); - TEST_ASSERT_EQUAL((msg_t *)&msg_buffer[0], current_msg); - } - - NEW_TEST_CASE("Remove oldest msg if message task buffer is full"); - MsgAlloc_Init(NULL); - { - // msg_tasks_stack_id = MAX_MSG_NB => oldest message must be deleted - // - // msg_tasks init state msg_tasks end state - // - // +---------+ +---------+ - // | D 1 | | D 2 |<--Oldest message "D 1" is deleted - // |---------| |---------| - // | D 2 | | D 3 | - // |---------| |---------| - // | etc... | | etc... | - // |---------| |---------| - // | D10 | | NEW | - // +---------+<--luos_tasks_stack_id +---------+<--luos_tasks_stack_id - // - - msg_t *expected_msg_tasks[MAX_MSG_NB]; - // Init variables - //--------------- - memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, - .engine_msg_stack_ratio = 0, - .tx_msg_stack_ratio = 0, - .buffer_occupation_ratio = 0, - .msg_drop_number = 0}; - - memset(&memory_stats, 0, sizeof(memory_stats)); - MsgAlloc_Init(&memory_stats); - - // To avoid assert - msg_tasks[0] = (msg_t *)&msg_buffer[0]; - luos_tasks[0].msg_pt = (msg_t *)&msg_buffer[0]; - tx_tasks[0].data_pt = (uint8_t *)&msg_buffer[0]; - - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - msg_tasks[i] = (msg_t *)(&msg_buffer[0] + i); - expected_msg_tasks[i] = (msg_t *)(&msg_buffer[0] + i + 1); - } - expected_msg_tasks[MAX_MSG_NB - 1] = (msg_t *)(current_msg); - - // Last Msg Task must be cleared - msg_tasks_stack_id = MAX_MSG_NB; - - // Call function - //--------------- - MsgAlloc_EndMsg(); - - // Verify - //--------------- - NEW_STEP_IN_LOOP("Check oldest message task is cleared", 0); - TEST_ASSERT_EQUAL(expected_msg_tasks[0], msg_tasks[0]); - - for (uint16_t i = 1; i < MAX_MSG_NB - 1; i++) - { - NEW_STEP_IN_LOOP("Check message task", i); - TEST_ASSERT_EQUAL(expected_msg_tasks[i], msg_tasks[i]); - } - - NEW_STEP_IN_LOOP("Check last message task is filled with current message", MAX_MSG_NB - 1); - TEST_ASSERT_EQUAL(expected_msg_tasks[MAX_MSG_NB - 1], msg_tasks[MAX_MSG_NB - 1]); - } -} +void unittest_MsgAlloc_Alloc() {} #define COPY_LENGTH 128 -void unittest_MsgAlloc_SetData() -{ - NEW_TEST_CASE("Set Data"); - MsgAlloc_Init(NULL); - { - // msg_buffer init state - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^-------------------------------------------------------------+ - // | - // data_ptr - // - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |0 1 2 3 ....... (COPY_LENGTH -1) ----------------------------| - // -------------------------^------------------------------------+ - // | - // data_ptr - // - - uint8_t expected_datas[COPY_LENGTH]; - - // Init variables - //--------------- - data_ptr = (uint8_t *)&msg_buffer[0]; - memset((void *)&msg_buffer[0], 0xFF, COPY_LENGTH); - for (uint8_t i = 0; i < COPY_LENGTH; i++) - { - expected_datas[i] = i; - } - - // Call function - //--------------- - for (uint8_t i = 0; i < COPY_LENGTH; i++) - { - MsgAlloc_SetData(i); - } - - // Verify - //--------------- - NEW_STEP("Check message buffer is correctly filled"); - TEST_ASSERT_EQUAL_MEMORY(expected_datas, (uint8_t *)&msg_buffer[0], COPY_LENGTH); - } -} - void unittest_MsgAlloc_IsEmpty() { NEW_TEST_CASE("Is Empty"); diff --git a/test/test_msg_alloc/unit_test_mem_alloc_static.c b/test/test_msg_alloc/unit_test_mem_alloc_static.c index deda161f8..eef242e80 100644 --- a/test/test_msg_alloc/unit_test_mem_alloc_static.c +++ b/test/test_msg_alloc/unit_test_mem_alloc_static.c @@ -283,29 +283,24 @@ void unittest_BufferAvailableSpaceComputation(void) } } - NEW_TEST_CASE("No task is availabled"); + NEW_TEST_CASE("No task is available"); MsgAlloc_Init(NULL); { - uint32_t remaining_datas; - uint32_t expected_size = 0; - uint32_t free_space = 0; - oldest_msg = (msg_t *)INT_MAX; // No oldest message + volatile uint32_t free_space = 0; + oldest_msg = (msg_t *)INT_MAX; // No oldest message NEW_STEP("Check remaining space computing for all message size cases"); for (uint16_t i = 0; i < MSG_BUFFER_SIZE - 2; i++) { // Init variables //--------------- - current_msg = (msg_t *)&msg_buffer[i]; - data_end_estimation = (uint8_t *)&msg_buffer[i + 1]; + data_ptr = (uint8_t *)&msg_buffer[i + 1]; for (uint32_t j = 0; j < MSG_BUFFER_SIZE - 1; j++) { - // Test is launched only if "data_end_estimation" doesn't overflows "msg_buffer" size - if (data_end_estimation < (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE]) + // Test is launched only if "data_ptr" doesn't overflows "msg_buffer" size + if (data_ptr < (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE]) { RESET_ASSERT(); - remaining_datas = (uintptr_t)data_end_estimation - (uintptr_t)current_msg; - expected_size = MSG_BUFFER_SIZE - remaining_datas; // Call function //--------------- free_space = MsgAlloc_BufferAvailableSpaceComputation(); @@ -313,9 +308,9 @@ void unittest_BufferAvailableSpaceComputation(void) // Verify //--------------- TEST_ASSERT_FALSE(IS_ASSERT()); - TEST_ASSERT_EQUAL(expected_size, free_space); + TEST_ASSERT_EQUAL(MSG_BUFFER_SIZE, free_space); - data_end_estimation++; + data_ptr++; } else { @@ -325,7 +320,7 @@ void unittest_BufferAvailableSpaceComputation(void) } } - NEW_TEST_CASE("Oldest task is between `data_end_estimation` and the end of message buffer"); + NEW_TEST_CASE("Oldest task is between `data_ptr` and the end of message buffer"); MsgAlloc_Init(NULL); { // msg_buffer @@ -335,12 +330,12 @@ void unittest_BufferAvailableSpaceComputation(void) // | | // |<-----Free space---->| // | | - // data_end_estimation oldest_task + // data_ptr oldest_task uint32_t free_space = 0; uint32_t expected_size = 0; oldest_msg = (msg_t *)&msg_buffer[1]; - data_end_estimation = (uint8_t *)oldest_msg - 1; + data_ptr = (uint8_t *)oldest_msg - 1; NEW_STEP("Check remaining space computing for all cases"); for (uint16_t i = 0; i < MSG_BUFFER_SIZE - 1; i++) @@ -349,10 +344,10 @@ void unittest_BufferAvailableSpaceComputation(void) // for (uint8_t j = 0; j < 2; j++) for (uint16_t j = i; j < MSG_BUFFER_SIZE - 1; j++) { - if ((uintptr_t)oldest_msg > (uintptr_t)data_end_estimation) + if ((uintptr_t)oldest_msg > (uintptr_t)data_ptr) { RESET_ASSERT(); - expected_size = (uintptr_t)oldest_msg - (uintptr_t)data_end_estimation; + expected_size = (uintptr_t)oldest_msg - (uintptr_t)data_ptr; free_space = MsgAlloc_BufferAvailableSpaceComputation(); TEST_ASSERT_FALSE(IS_ASSERT()); TEST_ASSERT_EQUAL(expected_size, free_space); @@ -360,7 +355,7 @@ void unittest_BufferAvailableSpaceComputation(void) // oldest_msg++; oldest_msg = (msg_t *)&msg_buffer[j + 1]; } - data_end_estimation++; + data_ptr++; } } @@ -370,17 +365,17 @@ void unittest_BufferAvailableSpaceComputation(void) // msg_buffer // +-------------------------------------------------------------+ // |-------------------------------------------------------------| - // +-------------^--------------^------------------^-------------+ - // | | | - // <-Free space->| | |<-Free space-> - // | | | - // | | | - // oldest_task current_message data_end_estimation + // +-------------^---------------------------------^-------------+ + // | | + // <-Free space->| |<-Free space-> + // | | + // | | + // oldest_task data_ptr uint32_t free_space = 0; uint32_t expected_size = 0; - data_end_estimation = (uint8_t *)&msg_buffer[1]; - oldest_msg = (msg_t *)data_end_estimation - 1; + data_ptr = (uint8_t *)&msg_buffer[1]; + oldest_msg = (msg_t *)data_ptr - 1; NEW_STEP("Check remaining space computing for all cases"); // Test remaining space computing for all cases @@ -390,10 +385,10 @@ void unittest_BufferAvailableSpaceComputation(void) oldest_msg = (msg_t *)&msg_buffer[1]; for (uint16_t j = 0; j < MSG_BUFFER_SIZE - 1; j++) { - if ((uintptr_t)oldest_msg < (uintptr_t)data_end_estimation) + if ((uintptr_t)oldest_msg < (uintptr_t)data_ptr) { RESET_ASSERT(); - expected_size = (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - (uintptr_t)data_end_estimation; + expected_size = (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - (uintptr_t)data_ptr; expected_size += (uintptr_t)oldest_msg - (uintptr_t)&msg_buffer[0]; free_space = MsgAlloc_BufferAvailableSpaceComputation(); @@ -402,7 +397,7 @@ void unittest_BufferAvailableSpaceComputation(void) } oldest_msg = (msg_t *)&msg_buffer[j + 1]; } - data_end_estimation++; + data_ptr++; } } } @@ -501,7 +496,7 @@ void unittest_OldestMsgCandidate(void) for (uint8_t i = 0; i < CASE; i++) { - current_msg = (msg_t *)&msg_buffer[cases[i][0]]; + data_ptr = (uint8_t *)&msg_buffer[cases[i][0]]; oldest_msg = (msg_t *)&msg_buffer[cases[i][1]]; oldest_stack_msg_pt = (msg_t *)&msg_buffer[cases[i][2]]; expected_oldest_msg = (msg_t *)&msg_buffer[cases[i][3]]; @@ -512,53 +507,6 @@ void unittest_OldestMsgCandidate(void) } } -void unittest_ValidDataIntegrity(void) -{ - NEW_TEST_CASE("Check data integrity"); - MsgAlloc_Init(NULL); - { - // msg_buffer init state - // +-------------------------------------------------------------+ - // |-------|Header|----------------------------------------------| - // +-------------------------------------------------------------+ - // - // msg_buffer ending state (idem init) - // +-------------------------------------------------------------+ - // |-------|Header|----------------------------------------------| - // +-------------------------------------------------------------+ - // - - uint8_t expected_msg_buffer[MSG_BUFFER_SIZE]; - mem_clear_needed = 0; - - memset((void *)&msg_buffer[0], 0xAA, MSG_BUFFER_SIZE); - memset((void *)&expected_msg_buffer[0], 0xAA, MSG_BUFFER_SIZE); - RESET_ASSERT(); - MsgAlloc_ValidDataIntegrity(); - - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - NEW_STEP("Check message buffered has not been modified"); - TEST_ASSERT_EQUAL_MEMORY(expected_msg_buffer, msg_buffer, MSG_BUFFER_SIZE); - } - - NEW_TEST_CASE("Verify memory cleaning"); - MsgAlloc_Init(NULL); - { - mem_clear_needed = 1; - current_msg = (msg_t *)&msg_buffer[0]; - data_end_estimation = (uint8_t *)(current_msg + 1); - RESET_ASSERT(); - MsgAlloc_ValidDataIntegrity(); - - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - NEW_STEP("Check memory is cleared"); - TEST_ASSERT_EQUAL(0, mem_clear_needed); - // No more TEST_ASSERT needed as MsgAlloc_ClearMsgSpace has already been tested - } -} - void unittest_ClearMsgSpace(void) { NEW_TEST_CASE("There is not enough space in memory"); diff --git a/test/test_msg_alloc/unit_test_mem_alloc_tx.c b/test/test_msg_alloc/unit_test_mem_alloc_tx.c index 3d08fb60f..ecf3df379 100644 --- a/test/test_msg_alloc/unit_test_mem_alloc_tx.c +++ b/test/test_msg_alloc/unit_test_mem_alloc_tx.c @@ -31,12 +31,9 @@ typedef struct extern memory_stats_t *mem_stat; extern volatile bool reset_needed; extern volatile uint8_t msg_buffer[MSG_BUFFER_SIZE]; -extern volatile msg_t *current_msg; extern volatile uint8_t *data_ptr; -extern volatile uint8_t *data_end_estimation; extern volatile msg_t *oldest_msg; extern volatile msg_t *used_msg; -extern volatile uint8_t mem_clear_needed; extern volatile header_t *copy_task_pointer; extern volatile msg_t *msg_tasks[MAX_MSG_NB]; extern volatile uint16_t msg_tasks_stack_id; @@ -94,12 +91,10 @@ void unittest_SetTxTask_buffer_full() } } -void unittest_SetTxTask_Tx_too_long_1() +void unittest_SetTxTask_Tx_too_long() { //************************************************************** - NEW_TEST_CASE("Tx message doesn't fit in msg buffer\n" - "Tx size > Rx size received \n" - "There is already a task in memory\n"); + NEW_TEST_CASE("Tx message doesn't fit in msg buffer"); MsgAlloc_Init(NULL); { error_return_t result; @@ -110,899 +105,35 @@ void unittest_SetTxTask_Tx_too_long_1() luos_localhost_t localhost = EXTERNALHOST; uint8_t ack; - // Tx message size is greater than Rx size currently received. - // Tx message doesn't fit in msg buffer. - // There is already a Task , function should return FAILED - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |-------------------------------------|Rx|--------|Task|------| - // +-------------------------------------------------------------+ - // - // Tx message to copy - // +-------------------------------------------------------------+ - // |-------------------------------------| Tx | - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |-------------------------------------|Rx|--------|Task|------| - // +-------------------------------------------------------------+ - // | - // FAILED : there is a task - - // Init variables - //--------------- - uint16_t tx_size = 50; - uint16_t rx_size = 20; - uint16_t rx_bytes_received = 15; - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size / 2)]; // There are only 25 bytes left in msg buffer - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 15 bytes - data_end_estimation = (uint8_t *)current_msg + rx_size; // Rx message = 20 bytes - oldest_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - sizeof(header_t)]; // There is a task - tx_tasks_stack_id = 1; - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Function returns FAILED when there is already a task in memory"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - } - - //************************************************************** - NEW_TEST_CASE("Tx message doesn't fit in msg buffer\n" - "Rx size received > Tx size\n" - "There is already a task in memory\n"); - MsgAlloc_Init(NULL); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Rx size currently received size is greater than Tx message. - // Tx message doesn't fit in msg buffer. - // There is already a Task , function should return FAILED - // - // msg_buffer init state (impossible state) - // +-------------------------------------------------------------+ - // |-------------------------------------------------|Task|------| - // |-------------------------------------|Rx | - // +-------------------------------------------------------------+ - // - // Tx message to copy - // +-------------------------------------------------------------+ - // |-------------------------------------| Tx | - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |-------------------------------------------------|Task|------| - // +-------------------------------------------------------------+ - // | - // FAILED : there is a task - - // Init variables - //--------------- - uint16_t tx_size = 50; - uint16_t rx_size = 80; - uint16_t rx_bytes_received = 51; - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size / 2)]; // There are only 25 bytes left in msg buffer - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 51 bytes - data_end_estimation = (uint8_t *)current_msg + rx_size; // Rx message = 80 bytes - oldest_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - sizeof(header_t)]; // There is a task - tx_tasks_stack_id = 1; - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Function returns FAILED when there is already a task in memory"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - } - - //************************************************************** - NEW_TEST_CASE("Tx message doesn't fit in msg buffer\n" - "Rx size received = Tx size\n" - "There is already a task in memory\n"); - MsgAlloc_Init(NULL); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Tx message size = Rx size currently received. - // Tx message doesn't fit in msg buffer. - // There is already a Task , function should return FAILED - // - // msg_buffer init state (impossible state) - // +-------------------------------------------------------------+ - // |-------------------------------------------------|Task|------| - // |-------------------------------------| Rx | - // +-------------------------------------------------------------+ - // - // Tx message to copy - // +-------------------------------------------------------------+ - // |-------------------------------------| Tx | - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |-------------------------------------------------|Task|------| - // +-------------------------------------------------------------+ - // | - // FAILED : there is a task - - // Init variables - //--------------- - uint16_t tx_size = 50; - uint16_t rx_size = 80; - uint16_t rx_bytes_received = tx_size; - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size / 2)]; // There are only 25 bytes left in msg buffer - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 50 bytes - data_end_estimation = (uint8_t *)current_msg + rx_size; // Rx message = 50 bytes - oldest_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - sizeof(header_t)]; // There is a task - tx_tasks_stack_id = 1; - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Function returns FAILED when there is already a task in memory"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - } -} - -void unittest_SetTxTask_Tx_too_long_2() -{ - //************************************************************** - NEW_TEST_CASE("Tx message doesn't fit in msg buffer\n" - "Tx size > Rx size received\n" - "There is already a task at begin of message buffer\n"); - MsgAlloc_Init(NULL); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Tx message size is greater than Rx size currently received. - // Tx message doesn't fit in msg buffer. - // There is already a Task at beginning, function should return FAILED - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |-----|Task|-------------------------------|Rx|---------------| - // +-------------------------------------------------------------+ - // - // Tx message to copy - // +-------------------------------------------------------------+ - // |-------------------------------------| Tx | - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |-----|Task|-------------------------------|Rx|---------------| - // +-------------------------------------------------------------+ - // | - // FAILED : there is a task - - // Init variables - //--------------- - uint16_t tx_size = 50; - uint16_t rx_size = 20; - uint16_t rx_bytes_received = 15; - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size / 2)]; // There are only 25 bytes left in msg buffer - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 15 bytes - data_end_estimation = (uint8_t *)current_msg + rx_size; // Rx message = 20 bytes - oldest_msg = (msg_t *)&msg_buffer[MSG_START]; // We need 70 bytes but there are only 10 bytes left in msg buffer - tx_tasks_stack_id = 1; - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Function returns FAILED when there is already a task at begin of message buffer"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - } - - //************************************************************** - NEW_TEST_CASE("Tx message doesn't fit in msg buffer\n" - "Rx size received > Tx size\n" - "There is already a task at begin of message buffer\n"); - MsgAlloc_Init(NULL); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Rx size currently received is greater than Tx message size. - // Tx message doesn't fit in msg buffer. - // There is already a Task at beginning, function should return FAILED - // - // msg_buffer init state - // +-------------------------------------------------------------+ - // |-----|Task|--------------------------------------------------| - // |-------------------------------------|Rx | - // +-------------------------------------------------------------+ - // - // Tx message to copy - // +-------------------------------------------------------------+ - // |-------------------------------------| Tx | - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |-----|Task|--------------------------------------------------| - // +-------------------------------------------------------------+ - // | - // FAILED : there is a task - uint16_t tx_size = 50; - uint16_t rx_size = 80; - uint16_t rx_bytes_received = 51; - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size / 2)]; // There are only 25 bytes left in msg buffer - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 51 bytes - data_end_estimation = (uint8_t *)current_msg + rx_size; // Rx message = 80 bytes - oldest_msg = (msg_t *)&msg_buffer[MSG_START]; // We need 70 bytes but there are only 10 bytes left in msg buffer - tx_tasks_stack_id = 1; - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Function returns FAILED when there is already a task at begin of message buffer"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - } - - //************************************************************** - NEW_TEST_CASE("Tx message doesn't fit in msg buffer\n" - "Rx size received = Tx size\n" - "There is already a task at begin of message buffer\n"); - MsgAlloc_Init(NULL); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Tx message size = Rx size currently received. - // Tx message doesn't fit in msg buffer. - // There is already a Task , function should return FAILED - // - // msg_buffer init state (impossible state) - // +-------------------------------------------------------------+ - // |-----|Task|--------------------------------------------------| - // |-------------------------------------|Rx | - // +-------------------------------------------------------------+ - // - // Tx message to copy - // +-------------------------------------------------------------+ - // |-------------------------------------| Tx | - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |-----|Task|--------------------------------------------------| - // +-------------------------------------------------------------+ - // | - // FAILED : there is a task - - // Init variables - //--------------- - uint16_t tx_size = 50; - uint16_t rx_size = 80; - uint16_t rx_bytes_received = tx_size; - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size / 2)]; // There are only 25 bytes left in msg buffer - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 50 bytes - data_end_estimation = (uint8_t *)current_msg + rx_size; // Rx message = 50 bytes - oldest_msg = (msg_t *)&msg_buffer[MSG_START]; // We need 70 bytes but there are only 10 bytes left in msg buffer - tx_tasks_stack_id = 1; - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Function returns FAILED when there is already a task at begin of message buffer"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - } -} -void unittest_SetTxTask_Tx_too_long_3() -{ - //************************************************************** - NEW_TEST_CASE("Tx message doesn't fit in message buffer\n" - "Tx size > Rx size received \n" - "There is space at begin of message buffer\n"); - MsgAlloc_Init(NULL); - memset((void *)msg_buffer, 0, sizeof(msg_buffer)); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Tx message size > Rx size currently received. - // Tx message doesn't fit in msg buffer. - // There is space : move messages and create Tx Task - // - // Rx message to copy - // +-------------------------------------------------------------+ - // |--------------------------------------------------|Rx|-------| - // +-------------------------------------------------------------+ - // - // Tx message to copy - // +-------------------------------------------------------------+ - // |--------------------------------------------------| Tx | - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // | Tx |Rx|---------------------------------------| - // +-------------------------------------------------------------+ - - // Init variables - //--------------- - tx_task_t expected_tx_task; - msg_t *expected_current_msg; - uint8_t *expected_data_ptr; - uint8_t *expected_data_end_estimation; - uint16_t tx_size = 50; - uint16_t rx_size = 20; - uint16_t rx_bytes_received = 15; - uint8_t tx_message[tx_size]; - uint8_t rx_message[tx_size]; - uint8_t *init_rx_message; - ack = 0; - localhost = 0; - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size / 2)]; // There are only 25 bytes left in msg buffer - data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 15 bytes - oldest_msg = (msg_t *)&msg_buffer[80]; // There is a task at beginning of msg_buffer - tx_tasks_stack_id = 1; - - expected_current_msg = (msg_t *)((uintptr_t)msg_buffer + tx_size); // Rx message will be copied after Tx message - expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); - expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); - - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)msg_buffer; - expected_tx_task.service_pt = service_pt; - expected_tx_task.localhost = localhost; - - // Init Tx message - for (size_t i = 0; i < tx_size - CRC_SIZE; i++) - { - tx_message[i] = i; - } - - // Init Rx message - init_rx_message = (uint8_t *)current_msg; - for (size_t i = 0; i < rx_bytes_received; i++) - { - rx_message[i] = i + 100; - *init_rx_message = i + 100; - init_rx_message++; - } - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - - // Check pointers - NEW_STEP("Check \"tx tasks stack id\" is incremented to 2"); - TEST_ASSERT_EQUAL(2, tx_tasks_stack_id); - NEW_STEP("Check \"current message\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_current_msg, current_msg); - NEW_STEP("Check \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - NEW_STEP("Check \"data end estimation\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_end_estimation, data_end_estimation); - - // Check Tx Tasks - tx_tasks_stack_id--; - NEW_STEP("Check Tx task \"size\" is correctly computed"); - TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); - NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); - NEW_STEP("Check Tx task \"localhost\" is correctly computed"); - TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); - NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL((uint8_t *)msg_buffer, tx_tasks[tx_tasks_stack_id].data_pt); - -#ifdef UNIT_TEST_DEBUG - printf("\n"); - for (uint16_t i = 0; i < MSG_BUFFER_SIZE; i++) - { - printf("%d - ", msg_buffer[i]); - } - printf("\n"); -#endif - - // Check messages - NEW_STEP("Check Tx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(tx_message, msg_buffer, tx_size - CRC_SIZE); - NEW_STEP("Check Rx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(rx_message, msg_buffer + tx_size, rx_bytes_received); - } -} -void unittest_SetTxTask_Rx_too_long_1() -{ - //************************************************************** - NEW_TEST_CASE("Tx message fits in msg buffer\n" - "Tx size + Rx size received doesn't fit msg buffer\n" - "Tx size > Rx size received \n"); - MsgAlloc_Init(NULL); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Tx message size is greater than Rx size currently received. - // Tx message fits in msg buffer. - // Tx message + Rx Tx message does not fit in msg buffer. - // - // msg_buffer init state (impossible state) - // +-------------------------------------------------------------+ - // |-------------------------------| Current Rx |---|Task|-----| - // +-------------------------------------------------------------+ - // - // Tx message + Full Rx Message - // +-------------------------------------------------------------+ - // |-------------------------------| Tx | Full Rx | - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |-------------------------------| Current Rx |---|Task|-----| - // +-------------------------------------------------------------+ - - // Init variables - //--------------- - uint16_t tx_size = 50; - uint16_t rx_size = 30; - uint16_t rx_bytes_received = 10; - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size + rx_bytes_received + 1)]; // There are only 61 bytes left in msg buffer - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 10 bytes - data_end_estimation = (uint8_t *)current_msg + rx_size; // Rx message = 30 bytes - oldest_msg = (msg_t *)((uintptr_t)current_msg + tx_size); // There is a task - tx_tasks_stack_id = 1; - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Function returns FAILED"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - } - - //************************************************************** - NEW_TEST_CASE("Tx message fits in msg buffer\n" - "Tx size + Rx size received doesn't fit msg buffer\n" - "Rx size received > Tx size \n"); - MsgAlloc_Init(NULL); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Rx size currently receivedis greater than Tx message size. - // Tx message fits in msg buffer. - // Tx message + Rx Tx message does not fit in msg buffer. - // - // - // Tx message + Full Rx Message - // +-------------------------------------------------------------+ - // |-----------------------------------| Tx | FULL Rx | - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |-----------------------------------|Current Rx|------------| - // +-------------------------------------------------------------+ - - // Init variables - //--------------- - uint16_t tx_size = 50; - uint16_t rx_size = 100; - uint16_t rx_bytes_received = 51; - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size + rx_bytes_received + 1)]; // There are only 101 bytes left in msg buffer - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 51 bytes - data_end_estimation = (uint8_t *)current_msg + rx_size; // Rx message = 100 bytes - oldest_msg = (msg_t *)((uintptr_t)current_msg + rx_bytes_received); // There is a task - tx_tasks_stack_id = 1; - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Function returns FAILED"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - } - - //************************************************************** - NEW_TEST_CASE("Tx message fits in msg buffer\n" - "Tx size + Rx size received doesn't fit msg buffer\n" - "Rx size received = Tx size \n"); - MsgAlloc_Init(NULL); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Rx size currently receivedis greater than Tx message size. - // Tx message fits in msg buffer. - // Tx message + Rx Tx message does not fit in msg buffer. - // - // - // Tx message + Full Rx Message - // +-------------------------------------------------------------+ - // |--------------------------------------------------| Tx | Rx | - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |--------------------------------------------------| Rx |- | - // +-------------------------------------------------------------+ - - // Init variables - //--------------- - uint16_t tx_size = 50; - uint16_t rx_size = 100; - uint16_t rx_bytes_received = tx_size; - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size + rx_bytes_received + 1)]; // There are only 100 bytes left in msg buffer - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 50 bytes - data_end_estimation = (uint8_t *)current_msg + rx_size; // Rx message = 100 bytes - oldest_msg = (msg_t *)((uintptr_t)current_msg + tx_size); // There is a task - tx_tasks_stack_id = 1; - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Function returns FAILED"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - } -} -void unittest_SetTxTask_Rx_too_long_2() -{ - //************************************************************** - NEW_TEST_CASE("Tx message fits in msg buffer\n" - "Tx size + Rx size received doesn't fit msg buffer\n" - "There is a Task \n"); - MsgAlloc_Init(NULL); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // - // msg_buffer init state (impossible state) - // +-------------------------------------------------------------+ - // |-------------------------------| Current Rx |---|Task|-----| - // +-------------------------------------------------------------+ - // - // Tx message + Full Rx Message - // +-------------------------------------------------------------+ - // |-------------------------------| Tx | Full Rx | - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |-------------------------------| Current Rx |---|Task|-----| - // +-------------------------------------------------------------+ - - // Init variables - //--------------- - uint16_t tx_size = 50; - uint16_t rx_size = 30; - uint16_t rx_bytes_received = 10; - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size + rx_bytes_received + 1)]; // There are only 61 bytes left in msg buffer - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 10 bytes - data_end_estimation = (uint8_t *)current_msg + rx_size; // Rx message = 30 bytes - oldest_msg = (msg_t *)((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - sizeof(header_t)); // There is a task - tx_tasks_stack_id = 1; - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Check function returns FAILED when Tx + Rx size doesn't fit msg buffer and a task is in requested memory"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - } -} - -void unittest_SetTxTask_Rx_too_long_3() -{ - //************************************************************** - NEW_TEST_CASE("Tx message fits in msg buffer\n" - "Tx size + Rx size received doesn't fit msg buffer\n" - "There is already a task at begin of message buffer\n"); - MsgAlloc_Init(NULL); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // msg_buffer init state - // +-------------------------------------------------------------+ - // |-----|Task|------------------------| Current Rx |----| - // +-------------------------------------------------------------+ - // - // Message to copy - // +-------------------------------------------------------------+ - // |-----------------------------------| Tx | Current Rx | - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |-----|Task|------------------------| Current Rx |----| - // +-------------------------------------------------------------+ - - // Init variables - //--------------- - uint16_t tx_size = 50; - uint16_t rx_size = 30; - uint16_t rx_bytes_received = 10; - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size + 1)]; // There are only 51 bytes left in msg buffer - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 10 bytes - data_end_estimation = (uint8_t *)current_msg + rx_size; // Rx message = 30 bytes - oldest_msg = (msg_t *)&msg_buffer[0]; // There is a task at beginning of buffer - tx_tasks_stack_id = 1; - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Check function returns FAILED when Tx + Rx size doesn't fit msg buffer and a task is in memory beginning"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - } -} -void unittest_SetTxTask_Rx_too_long_4() -{ - //************************************************************** - NEW_TEST_CASE("Tx + Rx messages doesn't in message buffer\n" - "There is space at begin of message buffer\n"); - MsgAlloc_Init(NULL); - memset((void *)msg_buffer, 0, sizeof(msg_buffer)); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // msg_buffer init state - // +-------------------------------------------------------------+ - // |-----------------------------------| Tx | Current Rx | - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // | Current Rx |--------------| Tx |--| - // +-------------------------------------------------------------+ - - // Init variables - //--------------- - tx_task_t expected_tx_task; - msg_t *expected_current_msg; - uint8_t *expected_data_ptr; - uint8_t *expected_data_end_estimation; - uint16_t tx_size = 50; - uint16_t rx_size = 20; - uint16_t rx_bytes_received = 15; - uint8_t tx_message[tx_size]; - uint8_t rx_message[tx_size]; - uint8_t *init_rx_message; - ack = 0; - localhost = 0; - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size + 1)]; // There are only 51 bytes left in msg buffer - data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 15 bytes - oldest_msg = (msg_t *)&msg_buffer[80]; // No task - tx_tasks_stack_id = 1; - - expected_current_msg = (msg_t *)((uintptr_t)msg_buffer); // Rx message will be copied at beginning of message buffer - expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); - expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); - - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)msg_buffer; - expected_tx_task.service_pt = service_pt; - expected_tx_task.localhost = localhost; - - // Init Tx message - for (size_t i = 0; i < tx_size - CRC_SIZE; i++) - { - tx_message[i] = i; - } - - // Init Rx message - init_rx_message = (uint8_t *)current_msg; - for (size_t i = 0; i < rx_bytes_received; i++) - { - rx_message[i] = i + 100; - *init_rx_message = i + 100; - init_rx_message++; - } - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - - // Check pointers - NEW_STEP("Check \"tx tasks stack id\" is incremented to 2"); - TEST_ASSERT_EQUAL(2, tx_tasks_stack_id); - NEW_STEP("Check \"current message\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_current_msg, current_msg); - NEW_STEP("Check \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - NEW_STEP("Check \"data end estimation\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_end_estimation, data_end_estimation); - - // Check Tx Tasks - tx_tasks_stack_id--; - NEW_STEP("Check Tx task \"size\" is correctly computed"); - TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); - NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); - NEW_STEP("Check Tx task \"localhost\" is correctly computed"); - TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); - NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size + 1)], tx_tasks[tx_tasks_stack_id].data_pt); - -#ifdef UNIT_TEST_DEBUG - printf("\n"); - for (uint16_t i = 0; i < MSG_BUFFER_SIZE; i++) - { - printf("%d - ", msg_buffer[i]); - } - printf("\n"); -#endif - - // Check messages - NEW_STEP("Check Tx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(tx_message, &msg_buffer[MSG_BUFFER_SIZE - (tx_size + 1)], tx_size - CRC_SIZE); - NEW_STEP("Check Rx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(rx_message, msg_buffer, rx_bytes_received); - } -} -void unittest_SetTxTask_Task_already_exists() -{ - //************************************************************** - NEW_TEST_CASE("Tx + Rx messages fit in message buffer\n" - "There is already a task in memory\n"); - MsgAlloc_Init(NULL); - memset((void *)msg_buffer, 0, sizeof(msg_buffer)); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // msg_buffer init state - // +-------------------------------------------------------------+ - // |------------------------| Rx |------|Task|-------------------| - // +-------------------------------------------------------------+ + // Tx message doesn't fit in msg buffer function should assert // // Tx message to copy // +-------------------------------------------------------------+ - // |------------------------| Tx |----------------------| + // |---|other msgs|-----------------------------| Tx | // +-------------------------------------------------------------+ // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |------------------------| Rx |----|Task|---------------------| - // +-------------------------------------------------------------+ - // | - // FAILED : there is a task // Init variables //--------------- - uint16_t tx_size = 50; - uint16_t rx_size = 20; - uint16_t rx_bytes_received = 15; - ack = 0; - localhost = 0; - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty - data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 15 bytes - oldest_msg = (msg_t *)&msg_buffer[rx_size + 1]; // There is a Task - tx_tasks_stack_id = 1; + uint16_t tx_size = 50; + data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes + data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size / 2)]; // There are only 25 bytes left in msg buffer + oldest_msg = (msg_t *)&msg_buffer[10]; // There is a task + tx_tasks_stack_id = 1; // Call function and Verify //--------------------------- RESET_ASSERT(); - NEW_STEP("Check function returns FAILED when a task is in memory"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); + MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack); + NEW_STEP("Check assert has occured"); + TEST_ASSERT_TRUE(IS_ASSERT()); } } -void unittest_SetTxTask_copy_OK() +void unittest_SetTxTask_Tx_overflow() { //************************************************************** - NEW_TEST_CASE("Tx and Rx messages fit in message buffer\n" - "Tx size > Rx size received \n"); + NEW_TEST_CASE("Tx message doesn't fit in message buffer\n" + "There is space at begin of message buffer"); MsgAlloc_Init(NULL); memset((void *)msg_buffer, 0, sizeof(msg_buffer)); { @@ -1014,173 +145,33 @@ void unittest_SetTxTask_copy_OK() luos_localhost_t localhost = EXTERNALHOST; uint8_t ack; - // Tx message size > Rx size currently received. - // Tx and Rx messages fit in msg buffer. - // There is space : move messages and create Tx Task - // - // Tx message + Rx message to copy - // +-------------------------------------------------------------+ - // |----------------------------------| Rx |---------------------| - // |----------------------------------| Tx |-----------------| - // +-------------------------------------------------------------+ + // Tx message doesn't fit in msg buffer. + // There is space in the begining of the buffer: move messages and create Tx Task // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |----------------------------------| Tx | Rx |------------| - // +-------------------------------------------------------------+ - - // Init variables - //--------------- - tx_task_t expected_tx_task; - msg_t *expected_current_msg; - uint8_t *expected_data_ptr; - uint8_t *expected_data_end_estimation; - uint16_t tx_size = 50; - uint16_t rx_size = 20; - uint16_t rx_bytes_received = 15; - uint8_t tx_message[tx_size]; - uint8_t rx_message[tx_size]; - uint8_t *init_rx_message; - ack = 0; - localhost = 0; - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)tx_message; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty - data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 15 bytes - oldest_msg = (msg_t *)&msg_buffer[2 * tx_size + 1]; // No Task - tx_tasks_stack_id = 1; - - expected_current_msg = (msg_t *)((uintptr_t)current_msg + tx_size); // Rx message will be copied after Tx message - expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); - expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); - - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)current_msg; - expected_tx_task.service_pt = service_pt; - expected_tx_task.localhost = localhost; - - // Init Tx message - for (size_t i = 0; i < tx_size - CRC_SIZE; i++) - { - tx_message[i] = i; - } - - // Init Rx message - init_rx_message = (uint8_t *)current_msg; - for (size_t i = 0; i < rx_bytes_received; i++) - { - rx_message[i] = i + 100; - *init_rx_message = i + 100; - init_rx_message++; - } - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - - // Check pointers - NEW_STEP("Check \"tx tasks stack id\" is incremented to 2"); - TEST_ASSERT_EQUAL(2, tx_tasks_stack_id); - NEW_STEP("Check \"current message\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_current_msg, current_msg); - NEW_STEP("Check \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - NEW_STEP("Check \"data end estimation\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_end_estimation, data_end_estimation); - - // Check Tx Tasks - tx_tasks_stack_id--; - NEW_STEP("Check Tx task \"size\" is correctly computed"); - TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); - NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); - NEW_STEP("Check Tx task \"localhost\" is correctly computed"); - TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); - NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[MSG_START], tx_tasks[tx_tasks_stack_id].data_pt); - -#ifdef UNIT_TEST_DEBUG - printf("\n"); - for (uint16_t i = 0; i < MSG_BUFFER_SIZE; i++) - { - printf("%d - ", msg_buffer[i]); - } - printf("\n"); -#endif - - // Check messages - NEW_STEP("Check Tx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(tx_message, (uint8_t *)&msg_buffer[MSG_START], tx_size - CRC_SIZE); - NEW_STEP("Check Rx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(rx_message, (uint8_t *)&msg_buffer[MSG_START] + tx_size, rx_bytes_received); - } - - //************************************************************** - NEW_TEST_CASE("Tx and Rx messages fit in message buffer\n" - "Rx size received > Tx size\n"); - MsgAlloc_Init(NULL); - memset((void *)msg_buffer, 0, sizeof(msg_buffer)); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Rx size currently received > Tx message size. - // Tx and Rx messages fit in msg buffer. - // There is space : move messages and create Tx Task // - // Tx message + Rx message to copy + // Tx message to copy // +-------------------------------------------------------------+ - // |----------------------------------| Rx |-----------------| - // |----------------------------------| Tx |---------------------| + // |--------------------------------------------------| Tx | // +-------------------------------------------------------------+ // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |----------------------------------| Tx | Rx |------------| - // +-------------------------------------------------------------+ - // | - // Padding Added - // Init variables //--------------- tx_task_t expected_tx_task; - msg_t *expected_current_msg; uint8_t *expected_data_ptr; - uint8_t *expected_data_end_estimation; - uint16_t tx_size = 50; - uint16_t rx_size = 80; - uint16_t rx_bytes_received = 51; + uint16_t tx_size = 50; uint8_t tx_message[tx_size]; - uint8_t rx_message[tx_size]; - uint8_t *init_rx_message; - uint16_t padding; - ack = 0; - localhost = 0; - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)tx_message; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty - data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 80 bytes - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 51 bytes - oldest_msg = (msg_t *)&msg_buffer[2 * rx_size + 1]; // No Task - padding = rx_bytes_received - tx_size; // Add padding (1 byte) - tx_tasks_stack_id = 1; - - expected_current_msg = (msg_t *)((uintptr_t)current_msg + tx_size + padding); // Rx message will be copied after Tx message with padding - expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); - expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); + ack = 0; + localhost = 0; + service_pt = (service_t *)msg_buffer; // Fake service value + data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes + data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size / 2)]; // There are only 25 bytes left in msg buffer + oldest_msg = (msg_t *)&msg_buffer[80]; + tx_tasks_stack_id = 1; + + expected_data_ptr = (uint8_t *)((uintptr_t)msg_buffer + tx_size); expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)current_msg; + expected_tx_task.data_pt = (uint8_t *)msg_buffer; expected_tx_task.service_pt = service_pt; expected_tx_task.localhost = localhost; @@ -1190,15 +181,6 @@ void unittest_SetTxTask_copy_OK() tx_message[i] = i; } - // Init Rx message - init_rx_message = (uint8_t *)current_msg; - for (size_t i = 0; i < rx_bytes_received; i++) - { - rx_message[i] = i + 100; - *init_rx_message = i + 100; - init_rx_message++; - } - // Call function and Verify //--------------------------- RESET_ASSERT(); @@ -1210,12 +192,8 @@ void unittest_SetTxTask_copy_OK() // Check pointers NEW_STEP("Check \"tx tasks stack id\" is incremented to 2"); TEST_ASSERT_EQUAL(2, tx_tasks_stack_id); - NEW_STEP("Check \"current message\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_current_msg, current_msg); NEW_STEP("Check \"data pointer\" is correctly computed"); TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - NEW_STEP("Check \"data end estimation\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_end_estimation, data_end_estimation); // Check Tx Tasks tx_tasks_stack_id--; @@ -1226,7 +204,7 @@ void unittest_SetTxTask_copy_OK() NEW_STEP("Check Tx task \"localhost\" is correctly computed"); TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[MSG_START], tx_tasks[tx_tasks_stack_id].data_pt); + TEST_ASSERT_EQUAL((uint8_t *)msg_buffer, tx_tasks[tx_tasks_stack_id].data_pt); #ifdef UNIT_TEST_DEBUG printf("\n"); @@ -1239,16 +217,14 @@ void unittest_SetTxTask_copy_OK() // Check messages NEW_STEP("Check Tx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(tx_message, (uint8_t *)&msg_buffer[MSG_START], tx_size - CRC_SIZE); - NEW_STEP("Check Rx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(rx_message, (uint8_t *)&msg_buffer[MSG_START] + tx_size + padding, rx_bytes_received); + TEST_ASSERT_EQUAL_MEMORY(tx_message, msg_buffer, tx_size - CRC_SIZE); } - +} +void unittest_SetTxTask_Tx_fit() +{ //************************************************************** - NEW_TEST_CASE("Tx and Rx messages fit in message buffer\n" - "Tx size = Rx size received\n"); + NEW_TEST_CASE("Tx message fit in msg buffer"); MsgAlloc_Init(NULL); - memset((void *)msg_buffer, 0, sizeof(msg_buffer)); { error_return_t result; uint8_t *data; @@ -1258,116 +234,35 @@ void unittest_SetTxTask_copy_OK() luos_localhost_t localhost = EXTERNALHOST; uint8_t ack; - // Tx message size = Rx size currently received. - // Tx and Rx messages fit in msg buffer. - // There is space : move messages and create Tx Task + // Tx message fits in msg buffer. // - // Tx message + Rx message to copy + // Tx message fit // +-------------------------------------------------------------+ - // |----------------------------------| Rx |-----------------| - // |----------------------------------| Tx |-----------------| + // |-------------------------------| Tx |------| // +-------------------------------------------------------------+ // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |----------------------------------| Tx | Rx |--------| - // +-------------------------------------------------------------+ - // | - // Padding Added // Init variables //--------------- - tx_task_t expected_tx_task; - msg_t *expected_current_msg; - uint8_t *expected_data_ptr; - uint8_t *expected_data_end_estimation; - uint16_t tx_size = 50; - uint16_t rx_size = 80; - uint16_t rx_bytes_received = 50; - uint8_t tx_message[tx_size]; - uint8_t rx_message[tx_size]; - uint8_t *init_rx_message; - uint16_t padding; - ack = 0; - localhost = 0; - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)tx_message; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty - data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 80 bytes - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 51 bytes - oldest_msg = (msg_t *)&msg_buffer[2 * rx_size + 1]; // No Task - tx_tasks_stack_id = 1; - - expected_current_msg = (msg_t *)((uintptr_t)current_msg + tx_size); // Rx message will be copied after Tx message - expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); - expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); - - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)current_msg; - expected_tx_task.service_pt = service_pt; - expected_tx_task.localhost = localhost; - - // Init Tx message - for (size_t i = 0; i < tx_size - CRC_SIZE; i++) - { - tx_message[i] = i; - } - - // Init Rx message - init_rx_message = (uint8_t *)current_msg; - for (size_t i = 0; i < rx_bytes_received; i++) - { - rx_message[i] = i + 100; - *init_rx_message = i + 100; - init_rx_message++; - } + uint16_t tx_size = 50; + data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes + data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size + 20)]; // There are 70 bytes left in msg buffer // Rx message = 30 bytes + oldest_msg = (msg_t *)((uintptr_t)data_ptr - tx_size); // There is a task before + tx_tasks_stack_id = 1; // Call function and Verify //--------------------------- RESET_ASSERT(); - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); + NEW_STEP("Function returns SUCCEED"); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); NEW_STEP("Check NO assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); - - // Check pointers - NEW_STEP("Check \"tx tasks stack id\" is incremented to 2"); - TEST_ASSERT_EQUAL(2, tx_tasks_stack_id); - NEW_STEP("Check \"current message\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_current_msg, current_msg); - NEW_STEP("Check \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - NEW_STEP("Check \"data end estimation\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_end_estimation, data_end_estimation); - - // Check Tx Tasks - tx_tasks_stack_id--; - NEW_STEP("Check Tx task \"size\" is correctly computed"); - TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); - NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); - NEW_STEP("Check Tx task \"localhost\" is correctly computed"); - TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); - NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[MSG_START], tx_tasks[tx_tasks_stack_id].data_pt); - -#ifdef UNIT_TEST_DEBUG - printf("\n"); - for (uint16_t i = 0; i < MSG_BUFFER_SIZE; i++) - { - printf("%d - ", msg_buffer[i]); - } - printf("\n"); -#endif - - // Check messages - TEST_ASSERT_EQUAL_MEMORY(tx_message, (uint8_t *)&msg_buffer[MSG_START], tx_size - CRC_SIZE); - TEST_ASSERT_EQUAL_MEMORY(rx_message, (uint8_t *)&msg_buffer[MSG_START] + tx_size, rx_bytes_received); } - +} +void unittest_SetTxTask_Task_already_exists() +{ //************************************************************** - NEW_TEST_CASE("Tx and Rx messages fit in message buffer\n" - "Rx size received less than a header\n"); + NEW_TEST_CASE("Tx messages fit in message buffer, but there is already a task in memory"); MsgAlloc_Init(NULL); memset((void *)msg_buffer, 0, sizeof(msg_buffer)); { @@ -1379,110 +274,30 @@ void unittest_SetTxTask_copy_OK() luos_localhost_t localhost = EXTERNALHOST; uint8_t ack; - // Rx size sizeof(header_t) - // Tx and Rx messages fit in msg buffer. - // There is space : move messages and create Tx Task // - // Tx message + Rx message to copy + // Tx message hit the next task // +-------------------------------------------------------------+ - // |----------------------------------| Rx |---------------------| - // |----------------------------------| Tx |-----------------| + // |------------------------| Tx |Task|--------------------| // +-------------------------------------------------------------+ // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |----------------------------------| Tx | Rx |------------| - // +-------------------------------------------------------------+ // Init variables //--------------- - tx_task_t expected_tx_task; - msg_t *expected_current_msg; - uint8_t *expected_data_ptr; - uint8_t *expected_data_end_estimation; - uint16_t tx_size = 50; - uint16_t rx_size = 30; - uint16_t rx_bytes_received = sizeof(header_t) - 1; - uint8_t tx_message[tx_size]; - uint8_t rx_message[tx_size]; - uint8_t *init_rx_message; - ack = 0; - localhost = 0; - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)tx_message; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty - data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received < header - oldest_msg = (msg_t *)&msg_buffer[2 * tx_size + 1]; // No Task - tx_tasks_stack_id = 1; - - expected_current_msg = (msg_t *)((uintptr_t)current_msg + tx_size); // Rx message will be copied after Tx message - expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); - expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); - - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)current_msg; - expected_tx_task.service_pt = service_pt; - expected_tx_task.localhost = localhost; - - // Init Tx message - for (size_t i = 0; i < tx_size - CRC_SIZE; i++) - { - tx_message[i] = i; - } - - // Init Rx message - init_rx_message = (uint8_t *)current_msg; - for (size_t i = 0; i < rx_bytes_received; i++) - { - rx_message[i] = i + 100; - *init_rx_message = i + 100; - init_rx_message++; - } + uint16_t tx_size = 50; + ack = 0; + localhost = 0; + service_pt = (service_t *)msg_buffer; // Fake service value + data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes + data_ptr = (uint8_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty + oldest_msg = (msg_t *)&msg_buffer[(uintptr_t)data_ptr + 1]; // There is a Task + tx_tasks_stack_id = 1; // Call function and Verify //--------------------------- RESET_ASSERT(); - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); + MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack); + NEW_STEP("Check assert has occured"); TEST_ASSERT_FALSE(IS_ASSERT()); - - // Check pointers - NEW_STEP("Check \"tx tasks stack id\" is incremented to 2"); - TEST_ASSERT_EQUAL(2, tx_tasks_stack_id); - NEW_STEP("Check \"current message\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_current_msg, current_msg); - NEW_STEP("Check \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - NEW_STEP("Check \"data end estimation\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_end_estimation, data_end_estimation); - - // Check Tx Tasks - tx_tasks_stack_id--; - NEW_STEP("Check Tx task \"size\" is correctly computed"); - TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); - NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); - NEW_STEP("Check Tx task \"localhost\" is correctly computed"); - TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); - NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[MSG_START], tx_tasks[tx_tasks_stack_id].data_pt); - -#ifdef UNIT_TEST_DEBUG - printf("\n"); - for (uint16_t i = 0; i < MSG_BUFFER_SIZE; i++) - { - printf("%d - ", msg_buffer[i]); - } - printf("\n"); -#endif - - // Check messages - NEW_STEP("Check Tx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(tx_message, (uint8_t *)&msg_buffer[MSG_START], tx_size - CRC_SIZE); - NEW_STEP("Check Rx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(rx_message, (uint8_t *)&msg_buffer[MSG_START] + tx_size, rx_bytes_received); } } @@ -1520,31 +335,21 @@ void unittest_SetTxTask_ACK() // Init variables //--------------- tx_task_t expected_tx_task; - msg_t *expected_current_msg; uint8_t *expected_data_ptr; - uint8_t *expected_data_end_estimation; - uint16_t tx_size = 50 + sizeof(ack); - uint16_t rx_size = 20; - uint16_t rx_bytes_received = 15; + uint16_t tx_size = 50 + sizeof(ack); uint8_t tx_message[tx_size]; - uint8_t rx_message[tx_size]; - uint8_t *init_rx_message; - ack = 55; - localhost = 0; - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)tx_message; // Tx message = 51 bytes - current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty - data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 15 bytes - oldest_msg = (msg_t *)&msg_buffer[2 * tx_size + 1]; // No Task - tx_tasks_stack_id = 1; - - expected_current_msg = (msg_t *)((uintptr_t)current_msg + tx_size); // Rx message will be copied after Tx message - expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); - expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); + ack = 55; + localhost = 0; + service_pt = (service_t *)msg_buffer; // Fake service value + data = (uint8_t *)tx_message; // Tx message = 51 bytes + data_ptr = (uint8_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty + oldest_msg = (msg_t *)&msg_buffer[2 * tx_size + 1]; // No Task + tx_tasks_stack_id = 1; + + expected_data_ptr = (uint8_t *)((uintptr_t)data_ptr + tx_size); // Rx message will be copied after Tx message expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)current_msg; + expected_tx_task.data_pt = (uint8_t *)data_ptr; expected_tx_task.service_pt = service_pt; expected_tx_task.localhost = localhost; @@ -1555,15 +360,6 @@ void unittest_SetTxTask_ACK() } tx_message[tx_size] = ack; - // Init Rx message - init_rx_message = (uint8_t *)current_msg; - for (size_t i = 0; i < rx_bytes_received; i++) - { - rx_message[i] = i + 100; - *init_rx_message = i + 100; - init_rx_message++; - } - // Call function and Verify //--------------------------- RESET_ASSERT(); @@ -1575,12 +371,8 @@ void unittest_SetTxTask_ACK() // Check pointers NEW_STEP("Check \"tx tasks stack id\" is incremented to 2"); TEST_ASSERT_EQUAL(2, tx_tasks_stack_id); - NEW_STEP("Check \"current message\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_current_msg, current_msg); NEW_STEP("Check \"data pointer\" is correctly computed"); TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - NEW_STEP("Check \"data end estimation\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_end_estimation, data_end_estimation); // Check Tx Tasks tx_tasks_stack_id--; @@ -1607,8 +399,6 @@ void unittest_SetTxTask_ACK() TEST_ASSERT_EQUAL(ack, msg_buffer[MSG_START + tx_size - 1]); // Ack NEW_STEP("Check Tx message integrity : correct values in correct memory position"); TEST_ASSERT_EQUAL_MEMORY(tx_message, (uint8_t *)&msg_buffer[MSG_START], tx_size - CRC_SIZE - 1); - NEW_STEP("Check Rx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(rx_message, (uint8_t *)&msg_buffer[MSG_START] + tx_size, rx_bytes_received); } } @@ -1647,33 +437,23 @@ void unittest_SetTxTask_internal_localhost() // Init variables //--------------- tx_task_t expected_tx_task; - msg_t *expected_current_msg; uint8_t *expected_data_ptr; - uint8_t *expected_data_end_estimation; - uint16_t tx_size = 50; - uint16_t rx_size = 20; - uint16_t rx_bytes_received = 15; + uint16_t tx_size = 50; uint8_t tx_message[tx_size]; - uint8_t rx_message[tx_size]; - uint8_t *init_rx_message; - - ack = 0; - localhost = LOCALHOST; // Localhost : to fill msg_task - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)tx_message; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty - data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 15 bytes - oldest_msg = (msg_t *)&msg_buffer[2 * tx_size + 1]; // No Task - tx_tasks_stack_id = 1; - msg_tasks_stack_id = 0; - - expected_current_msg = (msg_t *)((uintptr_t)current_msg + tx_size); // Rx message will be copied after Tx message - expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); - expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); + + ack = 0; + localhost = LOCALHOST; // Localhost : to fill msg_task + service_pt = (service_t *)msg_buffer; // Fake service value + data = (uint8_t *)tx_message; // Tx message = 50 bytes + data_ptr = (uint8_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty + oldest_msg = (msg_t *)&msg_buffer[2 * tx_size + 1]; // No Task + tx_tasks_stack_id = 1; + msg_tasks_stack_id = 0; + + expected_data_ptr = (uint8_t *)((uintptr_t)data_ptr + tx_size); expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)current_msg; + expected_tx_task.data_pt = (uint8_t *)data_ptr; expected_tx_task.service_pt = service_pt; expected_tx_task.localhost = localhost; @@ -1683,15 +463,6 @@ void unittest_SetTxTask_internal_localhost() tx_message[i] = i; } - // Init Rx message - init_rx_message = (uint8_t *)current_msg; - for (size_t i = 0; i < rx_bytes_received; i++) - { - rx_message[i] = i + 100; - *init_rx_message = i + 100; - init_rx_message++; - } - // Call function and Verify //--------------------------- RESET_ASSERT(); @@ -1706,12 +477,8 @@ void unittest_SetTxTask_internal_localhost() NEW_STEP("Check \"message tasks stack id\" = 1"); TEST_ASSERT_EQUAL(1, msg_tasks_stack_id); - NEW_STEP("Check \"current message\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_current_msg, current_msg); NEW_STEP("Check \"data pointer\" is correctly computed"); TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - NEW_STEP("Check \"data end estimation\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_end_estimation, data_end_estimation); // Check Tx Tasks is void tx_tasks_stack_id--; @@ -1740,8 +507,6 @@ void unittest_SetTxTask_internal_localhost() // Check messages NEW_STEP("Check Tx message integrity : correct values in correct memory position"); TEST_ASSERT_EQUAL_MEMORY(tx_message, (uint8_t *)&msg_buffer[MSG_START], tx_size - CRC_SIZE); - NEW_STEP("Check Rx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(rx_message, (uint8_t *)&msg_buffer[MSG_START] + tx_size, rx_bytes_received); } } @@ -1780,33 +545,23 @@ void unittest_SetTxTask_multihost() // Init variables //--------------- tx_task_t expected_tx_task; - msg_t *expected_current_msg; uint8_t *expected_data_ptr; - uint8_t *expected_data_end_estimation; - uint16_t tx_size = 50; - uint16_t rx_size = 20; - uint16_t rx_bytes_received = 15; + uint16_t tx_size = 50; uint8_t tx_message[tx_size]; - uint8_t rx_message[tx_size]; - uint8_t *init_rx_message; - - ack = 0; - localhost = MULTIHOST; - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)tx_message; // Tx message = 50 bytes - current_msg = (msg_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty - data_end_estimation = (uint8_t *)current_msg + rx_size; // Complete Rx message = 20 bytes - data_ptr = (uint8_t *)current_msg + rx_bytes_received; // Rx message already received = 15 bytes - oldest_msg = (msg_t *)&msg_buffer[2 * tx_size + 1]; // No Task - tx_tasks_stack_id = 1; - msg_tasks_stack_id = 0; - - expected_current_msg = (msg_t *)((uintptr_t)current_msg + tx_size); // Rx message will be copied after Tx message - expected_data_ptr = (uint8_t *)((uintptr_t)expected_current_msg + rx_bytes_received); - expected_data_end_estimation = (uint8_t *)((uintptr_t)expected_current_msg + rx_size); + + ack = 0; + localhost = MULTIHOST; + service_pt = (service_t *)msg_buffer; // Fake service value + data = (uint8_t *)tx_message; // Tx message = 50 bytes + data_ptr = (uint8_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty + oldest_msg = (msg_t *)&msg_buffer[2 * tx_size + 1]; // No Task + tx_tasks_stack_id = 1; + msg_tasks_stack_id = 0; + + expected_data_ptr = (uint8_t *)((uintptr_t)data_ptr + tx_size); expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)current_msg; + expected_tx_task.data_pt = (uint8_t *)data_ptr; expected_tx_task.service_pt = service_pt; expected_tx_task.localhost = localhost; @@ -1816,15 +571,6 @@ void unittest_SetTxTask_multihost() tx_message[i] = i; } - // Init Rx message - init_rx_message = (uint8_t *)current_msg; - for (size_t i = 0; i < rx_bytes_received; i++) - { - rx_message[i] = i + 100; - *init_rx_message = i + 100; - init_rx_message++; - } - // Call function and Verify //--------------------------- RESET_ASSERT(); @@ -1839,12 +585,8 @@ void unittest_SetTxTask_multihost() NEW_STEP("Check \"message tasks stack id\" = 1"); TEST_ASSERT_EQUAL(1, msg_tasks_stack_id); - NEW_STEP("Check \"current message\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_current_msg, current_msg); NEW_STEP("Check \"data pointer\" is correctly computed"); TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - NEW_STEP("Check \"data end estimation\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_end_estimation, data_end_estimation); // Check Tx Tasks AND Message Tasks tx_tasks_stack_id--; @@ -1871,7 +613,5 @@ void unittest_SetTxTask_multihost() // Check messages NEW_STEP("Check Tx message integrity : correct values in correct memory position"); TEST_ASSERT_EQUAL_MEMORY(tx_message, (uint8_t *)&msg_buffer[MSG_START], tx_size - CRC_SIZE); - NEW_STEP("Check Rx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(rx_message, (uint8_t *)&msg_buffer[MSG_START] + tx_size, rx_bytes_received); } } From b245d60b0687c561f88f2d59b721c8778f42a3f2 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 14 Apr 2023 15:17:38 +0200 Subject: [PATCH 040/150] Assert if buffer full only on RX. TX can wait to load the buffer again... --- engine/IO/src/luos_io.c | 4 ++-- engine/IO/src/msg_alloc.c | 11 ++++++++++- test/test_msg_alloc/unit_test_mem_alloc_tx.c | 3 +-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 11f8188fa..1390d7ae8 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -303,7 +303,7 @@ static error_return_t LuosIO_DetectNextNodes(service_t *service) continue; } - // when Robus loop will receive the reply it will store and manage the new node_id and send it to the next node. + // When Robus loop will receive the reply it will store and manage the new node_id and send it to the next node. // We just have to wait the end of the treatment of the entire branch uint32_t start_tick = LuosHAL_GetSystick(); while (Robus_Busy()) @@ -311,7 +311,7 @@ static error_return_t LuosIO_DetectNextNodes(service_t *service) LuosIO_Loop(); if (LuosHAL_GetSystick() - start_tick > DETECTION_TIMEOUT_MS) { - // topology detection is too long, we should abort it and restart + // Topology detection is too long, we should abort it and restart return FAILED; } } diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 813138d09..0bb97a608 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -385,7 +385,11 @@ _CRITICAL uint8_t *MsgAlloc_Alloc(uint16_t data_size) returned_ptr = (uint8_t *)data_ptr; } // Check if we have space for the message, assert if we don't - LUOS_ASSERT(MsgAlloc_CheckMsgSpace((void *)returned_ptr, (void *)((uintptr_t)returned_ptr + data_size)) == SUCCEED); + if (MsgAlloc_CheckMsgSpace((void *)returned_ptr, (void *)((uintptr_t)returned_ptr + data_size)) != SUCCEED) + { + // We don't have the space to store the message, return NULL to indicate that there is no more space + return NULL; + } // We consider this space as occupied, move data to the next available space data_ptr = (uint8_t *)((uintptr_t)returned_ptr + data_size); @@ -1126,6 +1130,11 @@ error_return_t MsgAlloc_SetTxTask(service_t *service_pt, uint8_t *data, uint16_t LuosHAL_SetIrqState(false); // Alloc the space for the message tx_msg = (void *)MsgAlloc_Alloc(size); + if (tx_msg == NULL) + { + MSGALLOC_MUTEX_UNLOCK + return FAILED; + } LuosHAL_SetIrqState(true); // Copy the tx msg into the buffer diff --git a/test/test_msg_alloc/unit_test_mem_alloc_tx.c b/test/test_msg_alloc/unit_test_mem_alloc_tx.c index ecf3df379..ae841d619 100644 --- a/test/test_msg_alloc/unit_test_mem_alloc_tx.c +++ b/test/test_msg_alloc/unit_test_mem_alloc_tx.c @@ -124,9 +124,8 @@ void unittest_SetTxTask_Tx_too_long() // Call function and Verify //--------------------------- RESET_ASSERT(); - MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack); NEW_STEP("Check assert has occured"); - TEST_ASSERT_TRUE(IS_ASSERT()); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); } } void unittest_SetTxTask_Tx_overflow() From 43a42b56eb616671e6983707ad0bd2cde46eae5d Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 17 Apr 2023 14:00:09 +0200 Subject: [PATCH 041/150] Fix addressing generation at detection start. --- engine/core/src/luos_engine.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 0312fdfbe..307106115 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -119,7 +119,7 @@ void Luos_Loop(void) { if (MsgAlloc_PullMsgFromLuosTask(remaining_msg_number, &returned_msg) == SUCCEED) { - // be sure the content of this message need to be managed by Luos and do it if it is. + // Be sure the content of this message need to be managed by Luos and do it if it is. if (Luos_MsgHandler((service_t *)oldest_service, returned_msg) == SUCCEED) { // Luos CMD are generic for all services and have to be executed only once @@ -171,6 +171,11 @@ void Luos_Loop(void) if (Flag_DetectServices == 1) { + + // Set the detection launcher id to 1 + detection_service->id = 1; + // Generate the filters + Service_GenerateId(1); RoutingTB_DetectServices(detection_service); Flag_DetectServices = 0; } @@ -793,19 +798,23 @@ void Luos_Detect(service_t *service) if (Node_GetState() < LOCAL_DETECTION) { - // Reset filters - Filter_IdInit(); - // Set the detection launcher id to 1 - service->id = 1; - // Update the filter just to accept our detector id - Filter_AddServiceId(1, 1); + if (Node_GetState() == NO_DETECTION) + { + // We don't have any ID yet, let's create one at least for the detector + // Reset filters + Filter_IdInit(); + // Set the detection launcher id to 1 + service->id = 1; + // Update the filter just to accept our detector id + Filter_AddServiceId(1, 1); + } // Send ask detection message detection_service = service; detect_msg.header.target_mode = SERVICEIDACK; detect_msg.header.cmd = ASK_DETECTION; detect_msg.header.size = 0; - detect_msg.header.target = 1; + detect_msg.header.target = service->id; Luos_SendMsg(service, &detect_msg); } } From 5f118f34930886aac469447838de2f8a6142cd6e Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 17 Apr 2023 14:06:19 +0200 Subject: [PATCH 042/150] Fix double detection process occurring at the same time, fix #229 --- engine/core/src/luos_engine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 307106115..79589e69a 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -172,12 +172,12 @@ void Luos_Loop(void) if (Flag_DetectServices == 1) { + Flag_DetectServices = 0; // Set the detection launcher id to 1 detection_service->id = 1; // Generate the filters Service_GenerateId(1); RoutingTB_DetectServices(detection_service); - Flag_DetectServices = 0; } } /****************************************************************************** From 083b3b63a3ef7f221a857ffdbdd5742d02a70036 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 18 Apr 2023 11:33:34 +0200 Subject: [PATCH 043/150] Fix collision management --- engine/IO/src/luos_phy.c | 3 ++- network/robus/src/reception.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index a97396dce..6b072023b 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -55,7 +55,8 @@ luos_phy_ctx_t phy_ctx; void Phy_Init(void) { // Put everything to 0 - memset((void *)&phy_ctx, 0, sizeof(phy_ctx)); + memset((void *)phy_ctx.phy_job, 0, sizeof(phy_ctx.phy_job)); + phy_ctx.phy_job_nb = 0; } /****************************************************************************** diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index 6b15c4be5..2b16e373c 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -229,6 +229,7 @@ _CRITICAL void Recep_GetCollision(luos_phy_t *phy_robus, volatile uint8_t *data) // Switch to get header. ctx.rx.callback = Recep_GetHeader; ctx.tx.status = TX_NOK; + data_count = 0; } else { @@ -251,7 +252,6 @@ _CRITICAL void Recep_GetCollision(luos_phy_t *phy_robus, volatile uint8_t *data) // Switch to get header. ctx.rx.callback = Recep_GetHeader; } - return; } } } @@ -290,6 +290,9 @@ _CRITICAL void Recep_Reset(void) { luos_phy_t *phy_robus = Robus_GetPhy(); phy_robus->received_data = 0; + phy_robus->rx_size = 0; + phy_robus->rx_keep = true; + phy_robus->rx_alloc_job = false; crc_val = 0xFFFF; ctx.rx.status.rx_framing_error = false; ctx.rx.callback = Recep_GetHeader; From 5619724bba89f21b75ed199aeae4bf4e298b23c5 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 18 Apr 2023 11:34:22 +0200 Subject: [PATCH 044/150] [Gate] Add a small check if a service is excluded during detection. --- tool_services/gate/TinyJSON/convert.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tool_services/gate/TinyJSON/convert.c b/tool_services/gate/TinyJSON/convert.c index da01d432a..daec76345 100644 --- a/tool_services/gate/TinyJSON/convert.c +++ b/tool_services/gate/TinyJSON/convert.c @@ -931,6 +931,11 @@ void Convert_ExcludedServiceData(service_t *service) char json[300]; search_result_t result; RTFilter_ID(RTFilter_Reset(&result), service->dead_service_spotted); + if (result.result_nbr == 0) + { + // This can happen if a service is excluded during the detection. + return; + } sprintf(json, "{\"dead_service\":\"%s\"}\n", result.result_table[0]->alias); // Send the message to pipe PipeLink_Send(service, json, strlen(json)); From b279fdf14ca4026eaae601a4fd642a1532c58dd5 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 17 Apr 2023 19:32:39 +0200 Subject: [PATCH 045/150] Remove verbose mode --- engine/IO/inc/msg_alloc.h | 2 +- engine/IO/src/msg_alloc.c | 5 +---- engine/core/inc/luos_engine.h | 1 - engine/core/inc/struct_luos.h | 2 -- engine/core/src/luos_engine.c | 11 ---------- engine/core/src/node.c | 11 ---------- engine/core/src/routing_table.c | 2 -- network/robus/src/robus.c | 2 +- network/robus/src/transmission.c | 9 ++++----- .../unit_test_mem_alloc_generic.c | 20 ++++++------------- test/test_msg_alloc/unit_test_mem_alloc_tx.c | 17 +--------------- tool_services/inspector/data_manager.c | 15 -------------- 12 files changed, 14 insertions(+), 83 deletions(-) diff --git a/engine/IO/inc/msg_alloc.h b/engine/IO/inc/msg_alloc.h index 39b50bbd2..8e86aef14 100644 --- a/engine/IO/inc/msg_alloc.h +++ b/engine/IO/inc/msg_alloc.h @@ -55,7 +55,7 @@ void MsgAlloc_ClearMsgFromLuosTasks(msg_t *msg); error_return_t MsgAlloc_SetTxTask(service_t *service_pt, uint8_t *data, uint16_t crc, uint16_t size, luos_localhost_t localhost, uint8_t ack); void MsgAlloc_PullMsgFromTxTask(void); void MsgAlloc_PullServiceFromTxTask(uint16_t service_id); -error_return_t MsgAlloc_GetTxTask(service_t **service_pt, uint8_t **data, uint16_t *size, uint8_t *localhost); +error_return_t MsgAlloc_GetTxTask(service_t **service_pt, uint8_t **data, uint16_t *size); error_return_t MsgAlloc_TxAllComplete(void); #endif /* _MSGALLOC_H_ */ diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 0bb97a608..61f70b73e 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -74,7 +74,6 @@ typedef struct uint8_t *data_pt; /*!< Start pointer of the data on msg_buffer. */ uint16_t size; /*!< size of the data. */ service_t *service_pt; /*!< Pointer to the transmitting service. */ - uint8_t localhost; /*!< is this message a localhost one? */ } tx_task_t; /******************************************************************************* * Variables @@ -1152,7 +1151,6 @@ error_return_t MsgAlloc_SetTxTask(service_t *service_pt, uint8_t *data, uint16_t tx_tasks[tx_tasks_stack_id].size = size; tx_tasks[tx_tasks_stack_id].data_pt = (uint8_t *)tx_msg; tx_tasks[tx_tasks_stack_id].service_pt = service_pt; - tx_tasks[tx_tasks_stack_id].localhost = (localhost != EXTERNALHOST); tx_tasks_stack_id++; LUOS_ASSERT(tx_tasks_stack_id < MAX_MSG_NB); LuosHAL_SetIrqState(true); @@ -1309,7 +1307,7 @@ void MsgAlloc_PullServiceFromTxTask(uint16_t service_id) * @return error_return_t : Fail is there is no more message available. * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL error_return_t MsgAlloc_GetTxTask(service_t **service_pt, uint8_t **data, uint16_t *size, uint8_t *localhost) +_CRITICAL error_return_t MsgAlloc_GetTxTask(service_t **service_pt, uint8_t **data, uint16_t *size) { LUOS_ASSERT(tx_tasks_stack_id < MAX_MSG_NB); @@ -1332,7 +1330,6 @@ _CRITICAL error_return_t MsgAlloc_GetTxTask(service_t **service_pt, uint8_t **da *data = tx_tasks[0].data_pt; *size = tx_tasks[0].size; *service_pt = tx_tasks[0].service_pt; - *localhost = tx_tasks[0].localhost; LuosHAL_SetIrqState(true); return SUCCEED; } diff --git a/engine/core/inc/luos_engine.h b/engine/core/inc/luos_engine.h index b16056c66..86246ebdf 100644 --- a/engine/core/inc/luos_engine.h +++ b/engine/core/inc/luos_engine.h @@ -33,7 +33,6 @@ void Luos_ResetStatistic(void); // ***************** Node management ***************** uint32_t Luos_GetSystick(void); bool Luos_IsDetected(void); -void Luos_SetVerboseMode(uint8_t mode); void Luos_SetFilterState(uint8_t state, service_t *service); // ***************** Package management ***************** diff --git a/engine/core/inc/struct_luos.h b/engine/core/inc/struct_luos.h index c102c23b7..7754362a6 100644 --- a/engine/core/inc/struct_luos.h +++ b/engine/core/inc/struct_luos.h @@ -37,8 +37,6 @@ typedef enum BOOTLOADER_CMD, BOOTLOADER_RESP, - // Verbose command - VERBOSE, // compatibility area // LUOS_LAST_RESERVED_CMD = 42 diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 79589e69a..b88bd5690 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -232,12 +232,6 @@ static error_return_t Luos_IsALuosCmd(service_t *service, uint8_t cmd, uint16_t return SUCCEED; } break; - case VERBOSE: - if (size == 1) - { - return SUCCEED; - } - break; case BOOTLOADER_CMD: return SUCCEED; break; @@ -372,11 +366,6 @@ static error_return_t Luos_MsgHandler(service_t *service, msg_t *input) service->auto_refresh.last_update = LuosHAL_GetSystick(); consume = SUCCEED; break; - case VERBOSE: - // this node should send messages to all the network - Luos_SetVerboseMode(input->data[0]); - consume = SUCCEED; - break; case BOOTLOADER_CMD: // send data to the bootloader LuosBootloader_MsgHandler(input); diff --git a/engine/core/src/node.c b/engine/core/src/node.c index d1fabf312..491161c32 100644 --- a/engine/core/src/node.c +++ b/engine/core/src/node.c @@ -143,15 +143,4 @@ void Luos_SetFilterState(uint8_t state, service_t *service) { // Enable or disable the filter for a given service // This function have been disabled since 3.0.0 -} - -/****************************************************************************** - * @brief Function that changes the verbose mode - * @param mode : Put to "1" if we want to enable the verbose mode, "0" to disable - * @return None - ******************************************************************************/ -void Luos_SetVerboseMode(uint8_t mode) -{ - // Enable or disable the verbose mode - // This function have been disabled since 3.0.0 } \ No newline at end of file diff --git a/engine/core/src/routing_table.c b/engine/core/src/routing_table.c index 71306facb..228f9c1c8 100644 --- a/engine/core/src/routing_table.c +++ b/engine/core/src/routing_table.c @@ -363,8 +363,6 @@ void RoutingTB_SendEndDetection(service_t *service) ******************************************************************************/ void RoutingTB_DetectServices(service_t *service) { - // Desactivate verbose mode - Luos_SetVerboseMode(false); // Starts the topology detection. uint16_t nb_node = LuosIO_TopologyDetection(service); // Clear data reception state diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index 0a5c5711f..6a313d442 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -81,7 +81,7 @@ error_return_t Robus_SetTxTask(service_t *service, msg_t *msg) uint16_t data_size = 0; uint16_t crc_val = 0xFFFF; // *************************************************** - // don't send luos messages if network is down + // Don't send luos messages if network is down // *************************************************** if ((msg->header.cmd >= LUOS_LAST_RESERVED_CMD) && (Node_GetState() != DETECTION_OK)) { diff --git a/network/robus/src/transmission.c b/network/robus/src/transmission.c index 7a61ab13b..fb326df39 100644 --- a/network/robus/src/transmission.c +++ b/network/robus/src/transmission.c @@ -131,9 +131,8 @@ _CRITICAL void Transmit_Process() { uint8_t *data = 0; uint16_t size; - uint8_t localhost; service_t *service_pt; - if ((MsgAlloc_GetTxTask(&service_pt, &data, &size, &localhost) == SUCCEED) && (Transmit_GetLockStatus() == false)) + if ((MsgAlloc_GetTxTask(&service_pt, &data, &size) == SUCCEED) && (Transmit_GetLockStatus() == false)) { // We have something to send // Check if we already try to send it multiple times and save it on stats if it is @@ -149,7 +148,7 @@ _CRITICAL void Transmit_Process() // Remove all transmist messages of this specific target MsgAlloc_PullServiceFromTxTask((uint16_t)(((msg_t *)data)->header.target)); // Try to get a tx_task for another service - if (MsgAlloc_GetTxTask(&service_pt, &data, &size, &localhost) == FAILED) + if (MsgAlloc_GetTxTask(&service_pt, &data, &size) == FAILED) { // Nothing to transmit anymore, just exit. return; @@ -158,9 +157,9 @@ _CRITICAL void Transmit_Process() } // Check if we will need an ACK for this message and compute the transmit status we will need to manage it transmitStatus_t initial_transmit_status = TX_OK; - if (((((msg_t *)data)->header.target_mode == SERVICEIDACK) || (((msg_t *)data)->header.target_mode == NODEIDACK)) && (!localhost || (((msg_t *)data)->header.target == DEFAULTID))) + if (((((msg_t *)data)->header.target_mode == SERVICEIDACK) || (((msg_t *)data)->header.target_mode == NODEIDACK))) { - // We will need to validate the good reception of the ack. + // We will need to validate the good reception with a ack. // Switch the tx status as TX_NOK allowing to detect a default at the next Timeout if no ACK have been received. initial_transmit_status = TX_NOK; } diff --git a/test/test_msg_alloc/unit_test_mem_alloc_generic.c b/test/test_msg_alloc/unit_test_mem_alloc_generic.c index 4f0d2e41e..7261480e9 100644 --- a/test/test_msg_alloc/unit_test_mem_alloc_generic.c +++ b/test/test_msg_alloc/unit_test_mem_alloc_generic.c @@ -16,7 +16,6 @@ typedef struct uint8_t *data_pt; /*!< Start pointer of the data on msg_buffer. */ uint16_t size; /*!< size of the data. */ service_t *service_pt; /*!< Pointer to the transmitting service. */ - uint8_t localhost; /*!< is this message a localhost one? */ } tx_task_t; /******************************************************************************* @@ -1264,19 +1263,17 @@ void unittest_MsgAlloc_GetTxTask() //--------------- service_t *service; uint8_t *data; - uint16_t size = 128; - uint8_t localhost = 1; + uint16_t size = 128; tx_tasks[0].data_pt = (uint8_t *)16; tx_tasks[0].service_pt = (service_t *)32; tx_tasks[0].size = 128; - tx_tasks[0].localhost = 1; tx_tasks_stack_id = MAX_MSG_NB + i; // Call function //--------------- - MsgAlloc_GetTxTask(&service, &data, &size, &localhost); + MsgAlloc_GetTxTask(&service, &data, &size); // Verify //--------------- @@ -1285,7 +1282,7 @@ void unittest_MsgAlloc_GetTxTask() // Call function //--------------- - MsgAlloc_GetTxTask(&service, &data, &size, &localhost); + MsgAlloc_GetTxTask(&service, &data, &size); // Verify //--------------- @@ -1314,7 +1311,6 @@ void unittest_MsgAlloc_GetTxTask() service_t *service; uint8_t *data; uint16_t *size; - uint8_t *localhost; // Init variables //--------------- @@ -1323,7 +1319,7 @@ void unittest_MsgAlloc_GetTxTask() // Call function & Verify //-------------------------- NEW_STEP("Check function returns FAILED when tx task is empty"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_GetTxTask(&service, &data, size, localhost)); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_GetTxTask(&service, &data, size)); } NEW_TEST_CASE("Verify there is a message"); @@ -1333,7 +1329,7 @@ void unittest_MsgAlloc_GetTxTask() // luos_tasks // +---------+ // | D 1 | - // |---------|<--luos_tasks_stack_id : tx_tasks[0] is filled with pointers (service, data, size & localhost) + // |---------|<--luos_tasks_stack_id : tx_tasks[0] is filled with pointers (service, data, size) // | D 2 | // |---------| // | etc... | @@ -1345,7 +1341,6 @@ void unittest_MsgAlloc_GetTxTask() service_t *service; uint8_t *data; uint16_t size; - uint8_t localhost; // Init variables //--------------- @@ -1354,20 +1349,17 @@ void unittest_MsgAlloc_GetTxTask() tx_tasks[0].data_pt = (uint8_t *)16; tx_tasks[0].service_pt = (service_t *)32; tx_tasks[0].size = 128; - tx_tasks[0].localhost = 1; // Call function & Verify //-------------------------- NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_GetTxTask(&service, &data, &size, &localhost)); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_GetTxTask(&service, &data, &size)); NEW_STEP("Check function returns expected service pointer"); TEST_ASSERT_EQUAL(tx_tasks[0].service_pt, service); NEW_STEP("Check function returns expected data"); TEST_ASSERT_EQUAL(tx_tasks[0].data_pt, data); NEW_STEP("Check function returns expected size"); TEST_ASSERT_EQUAL(tx_tasks[0].size, size); - NEW_STEP("Check function returns expected localhost"); - TEST_ASSERT_EQUAL(tx_tasks[0].localhost, localhost); } } diff --git a/test/test_msg_alloc/unit_test_mem_alloc_tx.c b/test/test_msg_alloc/unit_test_mem_alloc_tx.c index ae841d619..e94f295a1 100644 --- a/test/test_msg_alloc/unit_test_mem_alloc_tx.c +++ b/test/test_msg_alloc/unit_test_mem_alloc_tx.c @@ -22,7 +22,6 @@ typedef struct uint8_t *data_pt; /*!< Start pointer of the data on msg_buffer. */ uint16_t size; /*!< size of the data. */ service_t *service_pt; /*!< Pointer to the transmitting service. */ - uint8_t localhost; /*!< is this message a localhost one? */ } tx_task_t; /******************************************************************************* @@ -160,7 +159,6 @@ void unittest_SetTxTask_Tx_overflow() uint16_t tx_size = 50; uint8_t tx_message[tx_size]; ack = 0; - localhost = 0; service_pt = (service_t *)msg_buffer; // Fake service value data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size / 2)]; // There are only 25 bytes left in msg buffer @@ -172,7 +170,6 @@ void unittest_SetTxTask_Tx_overflow() expected_tx_task.size = tx_size; expected_tx_task.data_pt = (uint8_t *)msg_buffer; expected_tx_task.service_pt = service_pt; - expected_tx_task.localhost = localhost; // Init Tx message for (size_t i = 0; i < tx_size - CRC_SIZE; i++) @@ -200,8 +197,6 @@ void unittest_SetTxTask_Tx_overflow() TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); - NEW_STEP("Check Tx task \"localhost\" is correctly computed"); - TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); TEST_ASSERT_EQUAL((uint8_t *)msg_buffer, tx_tasks[tx_tasks_stack_id].data_pt); @@ -284,7 +279,7 @@ void unittest_SetTxTask_Task_already_exists() //--------------- uint16_t tx_size = 50; ack = 0; - localhost = 0; + localhost = LOCALHOST; service_pt = (service_t *)msg_buffer; // Fake service value data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes data_ptr = (uint8_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty @@ -338,7 +333,6 @@ void unittest_SetTxTask_ACK() uint16_t tx_size = 50 + sizeof(ack); uint8_t tx_message[tx_size]; ack = 55; - localhost = 0; service_pt = (service_t *)msg_buffer; // Fake service value data = (uint8_t *)tx_message; // Tx message = 51 bytes data_ptr = (uint8_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty @@ -350,7 +344,6 @@ void unittest_SetTxTask_ACK() expected_tx_task.size = tx_size; expected_tx_task.data_pt = (uint8_t *)data_ptr; expected_tx_task.service_pt = service_pt; - expected_tx_task.localhost = localhost; // Init Tx message for (size_t i = 0; i < tx_size - CRC_SIZE - sizeof(ack); i++) @@ -379,8 +372,6 @@ void unittest_SetTxTask_ACK() TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); - NEW_STEP("Check Tx task \"localhost\" is correctly computed"); - TEST_ASSERT_EQUAL(localhost, tx_tasks[tx_tasks_stack_id].localhost); NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[MSG_START], tx_tasks[tx_tasks_stack_id].data_pt); @@ -454,7 +445,6 @@ void unittest_SetTxTask_internal_localhost() expected_tx_task.size = tx_size; expected_tx_task.data_pt = (uint8_t *)data_ptr; expected_tx_task.service_pt = service_pt; - expected_tx_task.localhost = localhost; // Init Tx message for (size_t i = 0; i < tx_size - CRC_SIZE; i++) @@ -487,8 +477,6 @@ void unittest_SetTxTask_internal_localhost() TEST_ASSERT_NULL(tx_tasks[tx_tasks_stack_id].data_pt); NEW_STEP("Check Tx task \"size\" = 0"); TEST_ASSERT_EQUAL(0, tx_tasks[tx_tasks_stack_id].size); - NEW_STEP("Check \"localhost\" is not allocated"); - TEST_ASSERT_EQUAL(0, tx_tasks[tx_tasks_stack_id].localhost); // Check Message Tasks NEW_STEP("Check \"message tasks\" points to expected message"); @@ -562,7 +550,6 @@ void unittest_SetTxTask_multihost() expected_tx_task.size = tx_size; expected_tx_task.data_pt = (uint8_t *)data_ptr; expected_tx_task.service_pt = service_pt; - expected_tx_task.localhost = localhost; // Init Tx message for (size_t i = 0; i < tx_size - CRC_SIZE; i++) @@ -593,8 +580,6 @@ void unittest_SetTxTask_multihost() TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); - NEW_STEP("Check \"localhost\" value is set to LOCALHOST"); - TEST_ASSERT_EQUAL(LOCALHOST, tx_tasks[tx_tasks_stack_id].localhost); // Mutlihost must be seen as localhost NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[MSG_START], tx_tasks[tx_tasks_stack_id].data_pt); NEW_STEP("Check message task \"data pointer\" is correctly computed"); diff --git a/tool_services/inspector/data_manager.c b/tool_services/inspector/data_manager.c index 17ff6c40a..94e31f961 100644 --- a/tool_services/inspector/data_manager.c +++ b/tool_services/inspector/data_manager.c @@ -128,21 +128,6 @@ void DataManager_GetPipeMsg(service_t *service, msg_t *data_msg) msg.header.size = 0; Luos_SendMsg(service, &msg); break; - case VERBOSE: - msg.header.target = (data_msg->data[1] << 4) + data_msg->data[0]; - msg.header.cmd = VERBOSE; - msg.header.size = 1; - msg.data[0] = data_msg->data[7]; - if (msg.header.target == BROADCAST_VAL) - { - msg.header.target_mode = BROADCAST; - } - else - { - msg.header.target_mode = SERVICEIDACK; - } - Luos_SendMsg(service, &msg); - break; case ASSERT: if (((data_msg->data[6] << 8) + data_msg->data[5]) == 0) { From 107c9a2f93402223189a6de61c824a796bf776a7 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 18 Apr 2023 13:40:04 +0200 Subject: [PATCH 046/150] Do not allow RX dropping during reception --- engine/IO/src/luos_phy.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 6b072023b..8a6663232 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -187,11 +187,13 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) if (phy_ptr->rx_alloc_job) { uint16_t phy_stored_data_size = phy_ptr->received_data; + phy_ptr->rx_alloc_job = false; // Now allocate it - phy_ptr->rx_data = MsgAlloc_Alloc(phy_ptr->rx_size); - rx_data = (void *)phy_ptr->rx_data; + rx_data = MsgAlloc_Alloc(phy_ptr->rx_size); + // Assert if the allocation failed. We don't allow to loose a RX message. + LUOS_ASSERT(rx_data != NULL); + phy_ptr->rx_data = rx_data; // Job is done - phy_ptr->rx_alloc_job = false; LuosHAL_SetIrqState(true); phy_ptr->rx_keep = true; phy_ptr->rx_phy_filter = phy_filter; From 2d2ae1d45827dac9219687d9e8dcf0be36b7f359 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 18 Apr 2023 13:40:45 +0200 Subject: [PATCH 047/150] Fix data dropping occurring during re-init --- engine/IO/src/msg_alloc.c | 4 +++- engine/core/inc/luos_utils.h | 1 - engine/core/inc/struct_luos.h | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 61f70b73e..be2b20449 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -140,15 +140,17 @@ _CRITICAL static inline void MsgAlloc_FindNewOldestMsg(void); void MsgAlloc_Init(memory_stats_t *memory_stats) { //******** Init global vars pointers ********** - data_ptr = (uint8_t *)&msg_buffer[0]; msg_tasks_stack_id = 0; memset((void *)msg_tasks, 0, sizeof(msg_tasks)); luos_tasks_stack_id = 0; memset((void *)luos_tasks, 0, sizeof(luos_tasks)); tx_tasks_stack_id = 0; memset((void *)tx_tasks, 0, sizeof(tx_tasks)); + LuosHAL_SetIrqState(false); + data_ptr = (uint8_t *)&msg_buffer[0]; used_msg = NULL; oldest_msg = (msg_t *)INT_MAX; + LuosHAL_SetIrqState(true); if (memory_stats != NULL) { mem_stat = memory_stats; diff --git a/engine/core/inc/luos_utils.h b/engine/core/inc/luos_utils.h index 3b147a9cf..8d83aa377 100644 --- a/engine/core/inc/luos_utils.h +++ b/engine/core/inc/luos_utils.h @@ -37,7 +37,6 @@ typedef struct __attribute__((__packed__)) }; } luos_assert_t; - /******************************************************************************* * Function ******************************************************************************/ diff --git a/engine/core/inc/struct_luos.h b/engine/core/inc/struct_luos.h index 7754362a6..2e5c315f5 100644 --- a/engine/core/inc/struct_luos.h +++ b/engine/core/inc/struct_luos.h @@ -37,7 +37,6 @@ typedef enum BOOTLOADER_CMD, BOOTLOADER_RESP, - // compatibility area // LUOS_LAST_RESERVED_CMD = 42 } reserved_luos_cmd_t; From a0ec64cc9c9b014ee546334354165aca47c0a359 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 19 Apr 2023 14:39:26 +0200 Subject: [PATCH 048/150] Fix multi-node detection --- engine/IO/inc/luos_phy.h | 2 +- engine/IO/src/filter.c | 2 +- engine/IO/src/luos_phy.c | 53 +++++++++++++++------------- network/robus/src/port_manager.c | 8 ++--- network/robus/src/reception.c | 59 ++++++++++++++++---------------- 5 files changed, 66 insertions(+), 58 deletions(-) diff --git a/engine/IO/inc/luos_phy.h b/engine/IO/inc/luos_phy.h index 7d9c57f17..3a26e1723 100644 --- a/engine/IO/inc/luos_phy.h +++ b/engine/IO/inc/luos_phy.h @@ -62,7 +62,7 @@ void Phy_Loop(void); luos_phy_t *Phy_Create(void); void Phy_Send(luos_phy_t *phy_ptr, uint8_t *data, uint16_t size); -void Phy_ComputeMsgSize(luos_phy_t *phy_ptr); +void Phy_Computeheader(luos_phy_t *phy_ptr); void Phy_ValidMsg(luos_phy_t *phy_ptr); #endif /* _LUOS_PHY_H_ */ diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c index e8459c309..7082a1825 100644 --- a/engine/IO/src/filter.c +++ b/engine/IO/src/filter.c @@ -209,7 +209,7 @@ _CRITICAL luos_localhost_t Filter_GetLocalhost(header_t *header) break; case NODEIDACK: case NODEID: - if ((header->target == Node_Get()->node_id) && (header->target != DEFAULTID)) + if ((header->target == Node_Get()->node_id)) { return LOCALHOST; } diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 8a6663232..475adf518 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -111,17 +111,20 @@ _CRITICAL void Phy_ValidMsg(luos_phy_t *phy_ptr) // This can happen if we did not had the time to execute Phy_Loop function before the end of the message reception or if this phy get the complete mgs in one time. Phy_alloc(phy_ptr); } - // Now we can create a phy_job to dispatch the tx_job later - LUOS_ASSERT(phy_ctx.phy_job_nb < MAX_MSG_NB); - LuosHAL_SetIrqState(false); - phy_ctx.phy_job[phy_ctx.phy_job_nb].timestamp = phy_ptr->rx_timestamp; - phy_ctx.phy_job[phy_ctx.phy_job_nb].alloc_msg = (msg_t *)phy_ptr->rx_data; - phy_ctx.phy_job[phy_ctx.phy_job_nb].phy_filter = phy_ptr->rx_phy_filter; - phy_ctx.phy_job_nb++; - // Then reset the phy to receive the next message - phy_ptr->rx_data = phy_ptr->rx_buffer_base; - phy_ptr->received_data = 0; - LuosHAL_SetIrqState(true); + if (phy_ptr->rx_keep == true) + { + // Now we can create a phy_job to dispatch the tx_job later + LUOS_ASSERT(phy_ctx.phy_job_nb < MAX_MSG_NB); + LuosHAL_SetIrqState(false); + phy_ctx.phy_job[phy_ctx.phy_job_nb].timestamp = phy_ptr->rx_timestamp; + phy_ctx.phy_job[phy_ctx.phy_job_nb].alloc_msg = (msg_t *)phy_ptr->rx_data; + phy_ctx.phy_job[phy_ctx.phy_job_nb].phy_filter = phy_ptr->rx_phy_filter; + phy_ctx.phy_job_nb++; + // Then reset the phy to receive the next message + phy_ptr->rx_data = phy_ptr->rx_buffer_base; + phy_ptr->received_data = 0; + LuosHAL_SetIrqState(true); + } } /****************************************************************************** @@ -129,7 +132,7 @@ _CRITICAL void Phy_ValidMsg(luos_phy_t *phy_ptr) * @param phy_ptr Pointer to the phy concerned by this message * @return None ******************************************************************************/ -inline void Phy_ComputeMsgSize(luos_phy_t *phy_ptr) +inline void Phy_Computeheader(luos_phy_t *phy_ptr) { // Compute the size of the data to allocate @@ -147,6 +150,19 @@ inline void Phy_ComputeMsgSize(luos_phy_t *phy_ptr) phy_ptr->rx_size += sizeof(time_luos_t); } } + + // Compute the phy concerned by this message + phy_ptr->rx_phy_filter = Filter_GetLocalhost((header_t *)phy_ptr->rx_buffer_base); + if (phy_ptr->rx_phy_filter != EXTERNALHOST) + { + phy_ptr->rx_keep = true; + phy_ptr->rx_alloc_job = true; + } + else + { + phy_ptr->rx_keep = false; + phy_ptr->rx_alloc_job = false; + } } /****************************************************************************** @@ -172,14 +188,9 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) LUOS_ASSERT(phy_ptr->rx_data == phy_ptr->rx_buffer_base); LuosHAL_SetIrqState(true); - // We need to allocate this phy received data - Phy_ComputeMsgSize(phy_ptr); - - // Compute the phy concerned by this message - luos_localhost_t phy_filter = Filter_GetLocalhost((header_t *)phy_ptr->rx_buffer_base); // Now we can check if we need to store the received data - if (phy_filter != EXTERNALHOST) + if (phy_ptr->rx_keep) { // We need to store the received data. // Update the informations allowing reception to continue and directly copy the data into the allocated buffer @@ -195,9 +206,7 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) phy_ptr->rx_data = rx_data; // Job is done LuosHAL_SetIrqState(true); - phy_ptr->rx_keep = true; - phy_ptr->rx_phy_filter = phy_filter; - copy_from = (void *)phy_ptr->rx_buffer_base; + copy_from = (void *)phy_ptr->rx_buffer_base; // Now we can copy the data already received memcpy(rx_data, copy_from, phy_stored_data_size); @@ -213,8 +222,6 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) // Job is done phy_ptr->rx_alloc_job = false; LuosHAL_SetIrqState(true); - // We don't need to store the received data. - phy_ptr->rx_keep = false; return; } LuosHAL_SetIrqState(true); diff --git a/network/robus/src/port_manager.c b/network/robus/src/port_manager.c index 3acc3473e..23d72b1e5 100644 --- a/network/robus/src/port_manager.c +++ b/network/robus/src/port_manager.c @@ -107,19 +107,19 @@ _CRITICAL void PortMng_PtpHandler(uint8_t PortNbr) ******************************************************************************/ uint8_t PortMng_PokePort(uint8_t PortNbr) { - // push the ptp line + // Push the ptp line RobusHAL_PushPTP(PortNbr); - // wait a little just to be sure everyone can read it + // Wait a little just to be sure everyone can read it uint32_t start_tick = LuosHAL_GetSystick(); while (LuosHAL_GetSystick() - start_tick < 2) ; - // release the ptp line + // Release the ptp line RobusHAL_SetPTPDefaultState(PortNbr); while (LuosHAL_GetSystick() - start_tick < 3) ; // Save port as empty by default Node_Get()->port_table[PortNbr] = 0xFFFF; - // read the line state + // Read the line state if (RobusHAL_GetPTPState(PortNbr)) { // Someone reply, reverse the detection to wake up on line release diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index 2b16e373c..182c0a5a1 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -74,8 +74,8 @@ uint16_t crc_val = 0; // CRC value /******************************************************************************* * Function ******************************************************************************/ -static inline uint8_t Recep_IsAckNeeded(luos_phy_t *phy_robus); -static inline bool Recep_IsARobusSpecialMsg(header_t *header); +static inline bool Recep_IsAckNeeded(luos_phy_t *phy_robus); +static inline bool Recep_RobusShouldDrop(header_t *header); /****************************************************************************** * @brief Reception init. * @param None @@ -133,18 +133,21 @@ _CRITICAL void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data) printf("cmd : 0x%04x\n", phy_robus->rx_msg->header.cmd); /*!< msg definition. */ printf("size : 0x%04x\n", phy_robus->rx_msg->header.size); /*!< Size of the data field. */ #endif + // Switch state machine to data reception ctx.rx.callback = Recep_GetData; - // Compute message size the result will be available in phy_robus->rx_size - Phy_ComputeMsgSize(phy_robus); - if (ctx.rx.status.rx_framing_error == false) { - if (Recep_IsARobusSpecialMsg((header_t *)data_rx) == false) + if (Recep_RobusShouldDrop((header_t *)data_rx) == true) { - // Put a flag to tell that we need to alloc this message - phy_robus->rx_alloc_job = true; + ctx.rx.callback = Recep_Drop; + return; } + + + // We complete the header reception, we need to compute all the needed values. + // Compute message header size, keep, ... the result will be available in phy_robus->rx_size, ... + Phy_Computeheader(phy_robus); } break; @@ -162,6 +165,11 @@ _CRITICAL void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data) _CRITICAL void Recep_GetData(luos_phy_t *phy_robus, volatile uint8_t *data) { static uint16_t crc; + if (phy_robus->rx_keep == false) + { + ctx.rx.callback = Recep_Drop; + return; + } if (phy_robus->received_data < phy_robus->rx_size) { // Catch the byte. @@ -295,6 +303,7 @@ _CRITICAL void Recep_Reset(void) phy_robus->rx_alloc_job = false; crc_val = 0xFFFF; ctx.rx.status.rx_framing_error = false; + ctx.rx.status.rx_error = false; ctx.rx.callback = Recep_GetHeader; phy_robus->rx_buffer_base = data_rx; phy_robus->rx_data = data_rx; @@ -320,25 +329,22 @@ _CRITICAL void Recep_CatchAck(luos_phy_t *phy_robus, volatile uint8_t *data) } } /****************************************************************************** - * @brief Parse msg to find a service concerne + * @brief Define if we should drop this message before Luos get it * @param header of message * @return true or false * warning : this function can be redefined only for mock testing purpose * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL static inline bool Recep_IsARobusSpecialMsg(header_t *header) +_CRITICAL static inline bool Recep_RobusShouldDrop(header_t *header) { - // Find if we are concerned by this message. - if ((header->target_mode == NODEIDACK) || (header->target_mode == SERVICEIDACK)) - { - // In both of those cases we potentially need an ack. - ctx.rx.status.rx_error = false; - } - if ((header->target_mode == NODEID) || (header->target_mode == NODEIDACK)) + // During detection we receive node ID messages, we need to keep them only if PTP allow us to keep them. + // Find if we should remove this message. + if (header->target_mode == NODEIDACK) { - if ((header->target == 0) && (ctx.port.activ != NBR_PORT) && (ctx.port.keepLine == false)) + if ((header->target == 0) && ((ctx.port.activ == NBR_PORT) || (PortMng_Busy() == true))) { - return true; // Message is specific to Robus if nodeID = 0 and a a PTP is activ + // If a no port is activ or we are waiting for a release of a PTP we drop node ID 1 message + return true; } } return false; @@ -350,19 +356,14 @@ _CRITICAL static inline bool Recep_IsARobusSpecialMsg(header_t *header) * @return true or false * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL static inline uint8_t Recep_IsAckNeeded(luos_phy_t *phy_robus) +_CRITICAL static inline bool Recep_IsAckNeeded(luos_phy_t *phy_robus) { header_t *header = (header_t *)(phy_robus->rx_buffer_base); // Check the mode of the message received - if ((header->target_mode == SERVICEIDACK) && (Filter_ServiceID(header->target))) + if (((header->target_mode == SERVICEIDACK) || (header->target_mode == NODEIDACK)) && (phy_robus->rx_keep == true)) { - // When it is a serviceidack and this message is destined to the node send an ack - return 1; + // If the message is a serviceidack or nodeidack and we keep it we need to send an ack + return true; } - else if ((header->target_mode == NODEIDACK) && (Node_Get()->node_id == header->target)) - { - // When it is nodeidack and this message is destined to the node send an ack - return 1; - } - return 0; + return false; } From 5c1a2c5556634eccd0b7329923bb850b75de06e7 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 19 Apr 2023 14:42:31 +0200 Subject: [PATCH 049/150] RX CRC optimization --- network/robus/src/reception.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index 182c0a5a1..532292da4 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -144,7 +144,6 @@ _CRITICAL void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data) return; } - // We complete the header reception, we need to compute all the needed values. // Compute message header size, keep, ... the result will be available in phy_robus->rx_size, ... Phy_Computeheader(phy_robus); @@ -154,7 +153,7 @@ _CRITICAL void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data) default: break; } - RobusHAL_ComputeCRC((uint8_t *)data, (uint8_t *)&crc_val); + RobusHAL_ComputeCRC((uint8_t *)&phy_robus->rx_data[phy_robus->received_data - 1], (uint8_t *)&crc_val); } /****************************************************************************** * @brief Callback to get a complete data @@ -175,7 +174,7 @@ _CRITICAL void Recep_GetData(luos_phy_t *phy_robus, volatile uint8_t *data) // Catch the byte. phy_robus->rx_data[phy_robus->received_data] = *data; // Continue the CRC computation until the end of data - RobusHAL_ComputeCRC((uint8_t *)data, (uint8_t *)&crc_val); + RobusHAL_ComputeCRC((uint8_t *)&phy_robus->rx_data[phy_robus->received_data], (uint8_t *)&crc_val); } else if (phy_robus->received_data > phy_robus->rx_size) { From 2f3a12288cea1b214da45448b5bc9c055f3ad864 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 19 Apr 2023 16:50:41 +0200 Subject: [PATCH 050/150] Improve RX/TX comment on Robus --- network/robus/src/reception.c | 64 ++++++++++++++++------------------- 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index 532292da4..8298ba687 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -5,52 +5,48 @@ * @version 0.0.0 ******************************************************************************/ -/******************************* Description of the RX process *********************************** +/******************************* Description of the RX/TX process *********************************** * Byte Received - * + + * | * | * no v yes - * +-----------------+Tx Enable+---------------+ + * +------------------Tx Enable----------------+ * | | - * +------+ true v v - * | Drop | <--------+Drop state<-----------------------+ +------+------+ - * | byte | + | | Get | - * +------+ | false | | Collision | - * v | | | - * Header complete | | source ID |yes - * + | | received +------>Disable Rx - * | yes | | + | + - * v | | |no | | - * +------+------+ +-------------+ | no| v | v - * | Get | | Get | +------+ Collision | Wait End - * | Header | | Data | +-------------+ Transmit - * | | | | |yes + - * | +---------+ | | | v | - * no| | Node | | | Message | Disable Tx no v - *Drop = true <-------+Concerned| | | Complete | +----+Ack needed - * ^ | +---------+ | | + | | + - * | | |yes | | |yes | Drop message | |yes - * | | v | | v |no Send NACK | v - * | no| valid | | Valid +----> if needed +--+ | +---+----+ - * +---------------+ Header | | CRC | | | | Get | - * | + | +------+------+ | | | Ack | - * | |yes | |yes v v +---+----+ - * | v | v +-------+-------+-+ | - * | Header | Store message | Timeout | | - * | Complete | Send ACK if needed+------>+ End reception +<------+ - * +-------------+ +-----------------+ + * +------+ | v + * | Drop | | +-------------+ + * | byte | | | Get Collision| + * +------+ | | | | + * ^ | | v | + * | | | source ID |yes + * | | | received----+----+->Disable Rx + * | +------------------------------+ | | | | | + * | v | | |no | | | + * | +-------------+ +-------------+ | | v |no | v + * | | Get Header | +>| Get Data |<-+ | | Collision --+----+ Wait End + * | | | | | | | | | | +------+-------+ Transmit + * | | | | | | v no | | | |yes | + * | yes| v | | | Message---+--+ | v | + * +------------+-Should Drop | | | Complete | +------ Disable Tx v + * | | |no | | | |yes | +-----Ack needed + * | | | | | | | | | no | + * | | | | | | | | | |yes + * | no| v | | | v |no Drop message | v + * +------------+-valid header| | | Valid CRC -+---->Send NACK +-----+ | +--------+ + * | |yes | | +------+------+ if needed | | | Get ack| + * | | | | |yes | | +---+----+ + * | +------+-+ | v v | + * | | v +-----------------+ | + * +-------------+ Send ACK if needed | Timeout | | + * Valid message----------->| End reception |<------+ + * +-----------------+ ***********************************************************************************************/ #include #include "reception.h" #include "robus_hal.h" #include "luos_hal.h" -#include "pub_sub.h" -#include "msg_alloc.h" #include "luos_utils.h" -#include "_timestamp.h" #include "robus.h" -#include "filter.h" #include "context.h" /******************************************************************************* * Definitions From aaa6e4388a4b7846c0af0e403a4a4fd89532db17 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 26 Apr 2023 11:08:16 +0200 Subject: [PATCH 051/150] Remove useless compiled files on SAMD21XPLAINED example --- .../production/_ext/1001328808/plib_nvmctrl.o | Bin 12408 -> 0 bytes .../_ext/1001328808/plib_nvmctrl.o.d | 218 - .../production/_ext/1137593668/exceptions.o | Bin 3332 -> 0 bytes .../production/_ext/1137593668/exceptions.o.d | 233 - .../_ext/1137593668/initialization.o | Bin 5584 -> 0 bytes .../_ext/1137593668/initialization.o.d | 230 - .../production/_ext/1137593668/interrupts.o | Bin 6340 -> 0 bytes .../production/_ext/1137593668/interrupts.o.d | 236 - .../_ext/1137593668/libc_syscalls.o | Bin 6928 -> 0 bytes .../_ext/1137593668/libc_syscalls.o.d | 209 - .../production/_ext/1137593668/startup_xc32.o | Bin 5024 -> 0 bytes .../_ext/1137593668/startup_xc32.o.d | 212 - .../production/_ext/1360937237/main.o | Bin 7220 -> 0 bytes .../production/_ext/1360937237/main.o.d | 298 -- .../production/_ext/1426513406/xc32_monitor.o | Bin 3468 -> 0 bytes .../_ext/1426513406/xc32_monitor.o.d | 2 - .../production/_ext/1968410007/plib_port.o | Bin 10612 -> 0 bytes .../production/_ext/1968410007/plib_port.o.d | 215 - .../production/_ext/1968463158/plib_nvic.o | Bin 5612 -> 0 bytes .../production/_ext/1968463158/plib_nvic.o.d | 215 - .../production/_ext/901117036/plib_evsys.o | Bin 3052 -> 0 bytes .../production/_ext/901117036/plib_evsys.o.d | 218 - .../production/_ext/903266522/plib_clock.o | Bin 5796 -> 0 bytes .../production/_ext/903266522/plib_clock.o.d | 218 - ...uos_bootloader_samd21j18a.X.production.elf | Bin 568472 -> 0 bytes ...uos_bootloader_samd21j18a.X.production.hex | 2507 ----------- ...uos_bootloader_samd21j18a.X.production.map | 3864 ----------------- .../luos_bootloader/production/memoryfile.xml | 17 - 28 files changed, 8892 deletions(-) delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o.d delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/exceptions.o delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/exceptions.o.d delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/initialization.o delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/initialization.o.d delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/interrupts.o delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/interrupts.o.d delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o.d delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/startup_xc32.o delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/startup_xc32.o.d delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1360937237/main.o delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1360937237/main.o.d delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o.d delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1968410007/plib_port.o delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1968410007/plib_port.o.d delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1968463158/plib_nvic.o delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1968463158/plib_nvic.o.d delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/901117036/plib_evsys.o delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/901117036/plib_evsys.o.d delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/903266522/plib_clock.o delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/903266522/plib_clock.o.d delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.elf delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.hex delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map delete mode 100644 examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/memoryfile.xml diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o deleted file mode 100644 index ecf26b5d434124b76406496ebe1981570533e281..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12408 zcmcIq3v?V;dA@gcN4r`*ENNv)mLFMV6)eZmO0pG433eh`mTWmvEX#HXK`>tJ&Pp5a zL+rz{LsCKrj}RIX+>(Uw2!Rli18tg+LTR9Z11+Vrz$rN;5NKLL(*z3Pad;ox@4Itn zcUE=+<(%GgX8-x$|GoFW|DCzBub-Hnlu`<}Nzo^&m=LpD6~`P_pilIOh>(}xc<$9l zm-mWMF(xlJ_IKal+)v(j`gF^qVG$DR#OYuB?zD`we0uQF2GJ-+hex~pBi$RU zyTZ3LjNkom_>D$1T$Xnl4>>XTF7LWtM#o2Gq-)gG9}OC?S&eg4`KhIifp$79grWNB zmwT@`5*Z)5C^8b;9vg~m8yvcLaAfG>$g9TYW(Mr+f}Kp-$^ISv3x#+tu@ouT$J51h zJ{Q?Gy#1o>7r#2vpG{@*@lt<$A-$`ZPnAGO z3>4$pT#;80kMS6zNZ;%DDu4 z(OhWxJ4G zUa|}E%s}pVHc={M29`7F1xq8bgc!eM{z%a-6z6m4L_RbBihSW%5p!bC4-Q+9oS%lp z`H2(p>@p^C9#eV^;w#QOlW-Mga_WkSJ@dOOF6UF}LUtuyu;*9BVmZ@z&Cp0Zc9qIQ z?~ma()47r`{DE?=m|o1;$%w*(W+tCojHn-n;8*v_e0d>b3*QQe7W8b{c^|Udkab!+ zu@o-|zh#vnFainR)~-4q1%ed^O2jbC;u7XgxzqAPJE(B+x{Ih_1RQ=vO@-li;^Mtl z+P;lS2i9e%=&OS*2>(aIWQqX$_hVc^j)YIt2mSZf_xObfSym!nW~3hqypMwvCFyuPQ?`Zw z0rOK(F`|CB%`Oy6@sdr?5Bg}S!H>=znZ^tVvqSaFZ%rQ#(S6 zY@$^}oyjMTLD`J1pM={+Yj=8)1Jq>>2cJ=K4S~d+=muVWpA#EvNE(mi}6A_RSOvXb#k{o?&n2-q%!BnL`=U2Uik40;+mJmJ;_!fIgsgPYN}Pxb^GZ#-$q<2I za4&+I8oYDF8Veb5B3%-**`{;T#q2oxRry6)Hr zQ1t8x9mP%xWBAN(w60g$qaiD&2v4?dRfKWIF3hL2xjpDv=9tr!f7eE)Lo7)}8`<}C z=x#M4vmuN7kubm8_8`XAh#rO+EO=o)+jvxU_A0Dkr-BIcxn@=#BRa1~cAGGt*J+#- zZIYQnD`EA+u?pXT&WB0IY(5HBJ6UTnd^So*pWn2NAVoSXyHLpGkxzz>6{KP*$+ep? z8tzg(^ea-njPNr?yF&{q8k9-fTp-R`4J<`W$uf9(Qt`_ z!hFDJ;}Z5ozYHpBw8h64VSdbL{5A~uqEDIZ_#$^0^I@aqa?FY^`m`bO8! zFfrNhWehT?cH?#;O@1z3CrQ2n+>;~<)k$)n5`752ZSp~+C|8e1lq5HwzNLhy#|2dt zf-3=n+Bvy4R3$RDmx}! zN*$&o36Z_BO+Bkb8%2OOzks~%OV?M;HyMFvn;2y|S1uxb=}4GwF}lywzxP(gGpJi+C8#+Lp?fn~fIQF``&XY6(3+T4_r$+btRX34*Sv=e25EZr_Vcu$VIJIPnj8c9j z;d0*La+W*rU{uOy7hKM5F6RV7-7y?@I&izu@(Xl;8=}hETs-42-f6T1R6@QLj77VI zLT9ti2=kN^y)SwXIN61QC$2wpeE6ata#-HT{@mq#RPl-!-jzhrjqY78_v7HMB*3gj zeuv9@O!26RqUvhi>2g00?vh&y?{dl)R-+UFt|0bO&Hp+FXXg|iaPUqS?-X4xnC~+J z`$2HB7|Zhm#(LsT8fW7f%(XD@HM*`=#1kUG4V8#8xlsg|M=Tr~U-yFfM#IO-*{#dB z`EH|uIoYjKP?#Sy8W@BV&WByyF0tNnt7}QfCO}gbCg5>*U5F6(BI!{z_6`Lk0c>#_@AAE*($%N!)KD zq57j_KIY0u(f(etNl-uay}|F+cj7TBbj6i3*_E&hy&;P?7o2^l^U&DnU1J8mb3 zMDV}*9#%x7MtZjhKHHa941a|&J2p2qBZB{}8Nmu;>Wae?SBy{3iQsd6?6nbXthm@F zg3tHes)$Xs3Wp{Ri{SUQLQ6$qy9oZE@03z#^(stGkL?w~|Iza875QNi{9)gnN`7rc z{?OsE!$%H@;E!~dyDH)rir@=dl3AOb;mYT=zM(@tP>U#|K{O)K^%*`E`6ZHq%IG^W8mpliReC|k2JqF1)*QukWc4W12y^uF! zx+3*JE;pPu9sF@Ch5u z^=(MQ!Yg@3oLiBeC=~LAy?CIL*Q}A-wR|6R_T!QlwFwc$NU);h3qoc(Ri@m2o#?Gt zn9HwB6!;`Ak5)Z)L7Tl@fdQwtM|&7=4)kkqc_NsNFWRqA&%Sb|YG4pD@4zL01`Fq@ zCrmjLCGrTUe~HU6J2O&(*>3{>Ic0j4b6kCm@bEnt-y&yyKb5mv4*PLF~{yS@5C ztPf*Qb|QiejDQX{4tvJ*vPSYYU8rI?CnhgzRO5{y+}zkI+vI5Ij@?QtVtP7e)O}(% zCaNbUyz*1wiUv}=)|TegX=_m(gPJM>o$NiUxa<5pIA_q$9N z{$3#p7~*<$_RV^Sd!%}8^B7@4JJXZb2rCwhaLLs)bd%u{P~=P_j&!#YJ4n!r%O^^s z@8^xHbFk7yj2`IpV~D{D6(|~a6LO?DNPwpu+#Vu`sM|UGR+=|@RZh+_1XziTo`51R z7Cna!J_#I+Ij=@FcJOsW=0anRz|lD5)tIaF3&j$R{rW>S<{`_jIa=yQjS27A2R0WD zI;i0EvN03bm{@G9p+j}XnD?$77ydE!F2iG?Pdto{8uB;IO?U=XpQeDz|LZBfNL(_H z?;Ps$3eTyE^I7-v$~-@l%pcz#8yuYH0sdklF~6J!Eitb?_srwOBU4V=f1nAis+H!m z*rn3BKT^4PvM6*anN4?b@!=W{&q5v#saV3csmleAN@B~H49yEtBkEp@61 z8pgJAk0esZMj+#sPiM{@-lA|4Q*sdZ6UdUlv1E-iZ1zIzRNH5NI(Ml`1yc%B<(hAo zG|jNtQzuQi%kW_mtE|rnFVC#u{k@P-G3y4xb&*KjfGO+3hEXH&&sw4@oZ`7JlV)zZ<-LF%#cTYuUd$YcO)as2!*` zV?@u4S&J>>xC3WoMd3m#pR;&8ZK;EBv3Gp@l1N|WQ)7f{A)?m8mOt`ir>ZFUdU_hw z_`2rCrb>ljTCnu;avQ6ITS-VGKGqz($+%TkDi7(b9%IdoH~HQ~POS}ADC)V5l?pa$ z{LqKj@7eINtq_Xa_(m&a4{psJhx%vmu_iE6FWda>a;@z2b;)(ITdGH8NK_kRa+_cL z__TXZh?MuDz?~ZG5`A2Xp60_E^!A6<8czp;TZq$G^Q+B=^;j!!u9C-k^)w&$i&}Z^ zAJyiAr&@kc*>iUQZzR;hhqG1k^-8{KgD-W}=EFY%syxy|O1`%u!Y6`i^I;pTm2X&O zpZjCA`7qP9@{LNqI{(!>YWYOdD*2{W@;DswG#?%wI*3=Mb@hC=i2j%4w~EP^KC`aRvdpxey4gtd~yAC;=?bgzn|NAJ znesSS7Vcq*=dINxt$yWo>FPCIzqY!x>gjxB5QhK~?J?lYSIISrpC#A19#!xo$*7$}zQ8g>!F?i?W!?@A35gs_*>{DOw32$4Q_ zXn41#|CNT1YWOKa=zl@u|ES@=Y4|M-pC*Ld_ci__4O?Hjqzh_#`3b=Gz)_N8!A1k0Hb%je=k+$kQ~= z2kRQ)u!bWV?k9xs6&hZt;nf=Qbc^F((D0;&*K7C=LX7(<4e!>FFFT|^qTwer{EUX5 z)9{-ben-RaY51ImKhf~#8uAc~cAGWi0T}T<4Owr9Z`be=4Ow?c=Mfmkm34>kl^VWU zLmq~aUe@qB4R6qpr()#4N5c$SY<#-^DrwHNymxS=!&Hlq*mJojKB7~oB5yI}T31P1Xk7%@~;_cV*!k&r`xQY*U zRXo5|Jg`4a|G;Mnn^5;Oo*{(46B@sc5PsjT@!JUD|2-PNhY)dmRO1g3A|4Sdp3Iiw z3xN0{so;`(hkv1zg!+%4h%Mj^AVxyWE##ivrIxXJkBJrROs$04ZE8u?&8C)K*>Y;h zm5ryCthb+9qGuC28$)kJDoW3uuJ?Dnk$bq@!98eP@6aC7nH05IYm3~WWBgMg-?=?n zDg1HM7BT!GG{y&v^g_9WCxSn;@res5sZMgJ!#wgfq@ij(_@x}uQMJ`_MNqtQv%tM_Za)&B^Q~YM7uz5f664*3i?xXM zh+m7#YwsxVL0oQg{k{_fuiS0GSySBR$~^#rSMDRg`&=PFSMG7#d*!|goNM20uG|wK zc;%h}em1!uu9ExZi^#dp!C$FVBM!$k8tz!76^aU%IwI7T-bbI?5Z}T;7h= z_K>)J|bJH{bfyY^WZkfp?k}&iQmE=*S_26la0_b?V=BzxCe^t3uC6e7F_h{87}d~ YbA?E`M!<7#nG;^QhY;UAF4H6Tzu?ifZ~y=R diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o.d b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o.d deleted file mode 100644 index f17efe774..000000000 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o.d +++ /dev/null @@ -1,218 +0,0 @@ -build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o: \ - ../src/config/luos_bootloader/peripheral/nvmctrl/plib_nvmctrl.c \ - ../src/config/luos_bootloader/interrupts.h \ - ../src/config/luos_bootloader/peripheral/nvmctrl/plib_nvmctrl.h \ - ../src/config/luos_bootloader/device.h \ - ../src/packs/ATSAMD21J18A_DFP/samd21j18a.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/component/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/component/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/component/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/component/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/component/port.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sercom.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/port.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc6.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc7.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h \ - ../src/config/luos_bootloader/device_cache.h \ - ../src/config/luos_bootloader/device.h \ - ../src/config/luos_bootloader/toolchain_specifics.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h - -../src/config/luos_bootloader/interrupts.h: - -../src/config/luos_bootloader/peripheral/nvmctrl/plib_nvmctrl.h: - -../src/config/luos_bootloader/device.h: - -../src/packs/ATSAMD21J18A_DFP/samd21j18a.h: - -../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/ac.h: - -../src/packs/ATSAMD21J18A_DFP/component/adc.h: - -../src/packs/ATSAMD21J18A_DFP/component/dac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/component/eic.h: - -../src/packs/ATSAMD21J18A_DFP/component/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/component/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h: - -../src/packs/ATSAMD21J18A_DFP/component/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/component/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/pac.h: - -../src/packs/ATSAMD21J18A_DFP/component/pm.h: - -../src/packs/ATSAMD21J18A_DFP/component/port.h: - -../src/packs/ATSAMD21J18A_DFP/component/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/component/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/component/sercom.h: - -../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/tc.h: - -../src/packs/ATSAMD21J18A_DFP/component/tcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/usb.h: - -../src/packs/ATSAMD21J18A_DFP/component/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/adc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/instance/eic.h: - -../src/packs/ATSAMD21J18A_DFP/instance/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/instance/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/instance/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/instance/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pm.h: - -../src/packs/ATSAMD21J18A_DFP/instance/port.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc6.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc7.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/usb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h: - -../src/config/luos_bootloader/device_cache.h: - -../src/config/luos_bootloader/device.h: - -../src/config/luos_bootloader/toolchain_specifics.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/exceptions.o b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/exceptions.o deleted file mode 100644 index f5760b306c7c186b56a4fa60ab63251937812930..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3332 zcmcIm&2Jl35TEC@6Bj#e)23~p652{dErQ*(lQd0&QtBp6TNIb5AEHu?%-i+a-gZCC z?mDCrs7MGQgt+ujt{`#X58%KJ32{IOap%UZ;>a1PWoCDu^Xz;ekQixq=FM;3ym>RT z@9o3O>uZcL5X9gtY>xok0|`=?OW0XB0mtF#lc!G}DFC@dmuFY5-&R+u=hX#$RZ>!==IYvpF{{t%)#|(vaj!K~<;IpZJ7d&tr50~g7ivbjYCq&LhNsiw7)lS9 zv7;ymmt|W7TJ7Hd5EgB|*I%}RFt)ceuhMh-5$fV@-!qZ#$P^E)?lKR(&G|_4RIQ_G zZ&p>U-R}Dq?Lv#}grkpkl1*vs2bvXl9#%qYqwK~3ly%*RLMzLJ;r4^5X$C=z^=a9m zVQ*P>kK9JO1uIL9+mRhc4d1Z>xA9gG-j6W-cB3-abRDy?j*}agx475CdNr_m_b`;G zk>>jj7VX;g%d3q`1MiKt6MFCQ&~A(@+e|BVue!kXJEBhqJjcc&r{mi#)#~yPa;(_* zhZMO&)WvM7jvqrVH=Yg#Hi$G}^M%yq_=tymV%rM( zrfXA_Nwf;P%EQ(g@4IpHD)(Ei9Rgcb)9;Z!uiOW~6m~uE>pZ&8aq2Z+vRoRm1UAWD zDjqE<#goO`W0UL#J3NLyPD8150hIuX4zHJ$;!^3g(qidM`4d*2WJlP==f1d9#>Gz4 zf=OcY$(vs3c$*7gH+_hp0yUb&{yI1Tc&^YtUO*nz>egn*fDlOnP$(k7ubumzaf$pdHD003@SsXG38fe zKDAO%Ba;GoI4CP{ERzC-5xgM7=xq!pNizs)G@c^f5c}Z=k`CB=ehKdGJAVS=eepx^ z*}ixZJy|5Az+oX~8uO0+%7$$51<-j-lDKx8f#`Y_s2KI(|FY zMa@kUueaR*y!$$Kv zdWUjAy+-lBi;wK@SM+rOb%F%;5h{dCSQ#BqzX=l9LsZD?PU9lf=d>>A#k!AC7IRR9 zIRwZ~kiZ_HLiSfde=6$8AAW)Zf8U@i=Aa1c=x>vRj0E;Ij%9xv=#Rcf@;8Bxi0@mJ z#T*pj2LdD#*!QR-xsqXIcWcCs@L%u|a|oWs?^evAv2gzr%5r?~Nc*KzSj6`m%2=u% zvV^XpKk79>VlCowzr|?xB`Wc_Nb*hoX#cdP)J8Cc{qi&F1POl>gKYO9#`lLXLN4t7 E2H6uSX8-^I diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/exceptions.o.d b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/exceptions.o.d deleted file mode 100644 index ecf050e64..000000000 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/exceptions.o.d +++ /dev/null @@ -1,233 +0,0 @@ -build/luos_bootloader/production/_ext/1137593668/exceptions.o: \ - ../src/config/luos_bootloader/exceptions.c \ - ../src/config/luos_bootloader/interrupts.h \ - ../src/config/luos_bootloader/definitions.h \ - ../src/config/luos_bootloader/peripheral/nvmctrl/plib_nvmctrl.h \ - ../src/config/luos_bootloader/device.h \ - ../src/packs/ATSAMD21J18A_DFP/samd21j18a.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/component/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/component/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/component/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/component/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/component/port.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sercom.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/port.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc6.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc7.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h \ - ../src/config/luos_bootloader/device_cache.h \ - ../src/config/luos_bootloader/device.h \ - ../src/config/luos_bootloader/toolchain_specifics.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/config/luos_bootloader/peripheral/evsys/plib_evsys.h \ - ../src/config/luos_bootloader/peripheral/port/plib_port.h \ - ../src/config/luos_bootloader/peripheral/clock/plib_clock.h \ - ../src/config/luos_bootloader/peripheral/nvic/plib_nvic.h - -../src/config/luos_bootloader/interrupts.h: - -../src/config/luos_bootloader/definitions.h: - -../src/config/luos_bootloader/peripheral/nvmctrl/plib_nvmctrl.h: - -../src/config/luos_bootloader/device.h: - -../src/packs/ATSAMD21J18A_DFP/samd21j18a.h: - -../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/ac.h: - -../src/packs/ATSAMD21J18A_DFP/component/adc.h: - -../src/packs/ATSAMD21J18A_DFP/component/dac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/component/eic.h: - -../src/packs/ATSAMD21J18A_DFP/component/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/component/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h: - -../src/packs/ATSAMD21J18A_DFP/component/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/component/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/pac.h: - -../src/packs/ATSAMD21J18A_DFP/component/pm.h: - -../src/packs/ATSAMD21J18A_DFP/component/port.h: - -../src/packs/ATSAMD21J18A_DFP/component/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/component/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/component/sercom.h: - -../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/tc.h: - -../src/packs/ATSAMD21J18A_DFP/component/tcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/usb.h: - -../src/packs/ATSAMD21J18A_DFP/component/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/adc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/instance/eic.h: - -../src/packs/ATSAMD21J18A_DFP/instance/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/instance/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/instance/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/instance/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pm.h: - -../src/packs/ATSAMD21J18A_DFP/instance/port.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc6.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc7.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/usb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h: - -../src/config/luos_bootloader/device_cache.h: - -../src/config/luos_bootloader/device.h: - -../src/config/luos_bootloader/toolchain_specifics.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/config/luos_bootloader/peripheral/evsys/plib_evsys.h: - -../src/config/luos_bootloader/peripheral/port/plib_port.h: - -../src/config/luos_bootloader/peripheral/clock/plib_clock.h: - -../src/config/luos_bootloader/peripheral/nvic/plib_nvic.h: diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/initialization.o b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/initialization.o deleted file mode 100644 index a100bb974884a7f0530b885e0bde67efed7421fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5584 zcmcIoU2Ggz6+W{&yI$LCCyt%QNeZ1Lrrpx+pY5c!ONiHw6PehKWji5|tv0i}v-UK* zJFA&lCv7Q2hzjz;6OLa3(vR8Ox4q7jsMV zX`@y&%4MURJeDlldcCx!*~Yr*m{wgI9vyjXWc&#&S*uhn-A(F6^SEPGTnI{5y<)B= z%et#4D`wR=K0T3Mw5?TJuW6^iJL!3|WLu>*vyq-(oXbsJNUtAF9nGX0dg*ddxtyCn zIh-w=Jhhk}NsXqm*<)!(ua$?hdirW(x5O_! zVb4~F<(U;y|1KPMw;V=D{YT=roI;nZC2G^wu%`+=7ID5+7|WYgY@lv1&Rl z&KT-UeJdQ{cuLHx^KNDN6U&8Jc_r|eNCqhFbdvvE8U zFb+j;PVskN|ExlNN*3zg6rG5FB>wry-f%Bwh>T;pU0Y?y6<^1I^M~=Qhk2brXnC2cA6v#^>(81{R^z?+5Xua+ zlfdUG*Bkp>=!**F9s#2pc!!eLwj#%tlk*gfcg%Mxd(;7Cud**ZsO(n`C?Di=wgrL$ zmEPP4D#Lsv0}vLcT#CZHsR0OMU-txf?gx9pYb_b}Jpf^BG&gNklfw4-JBZ);@2-#0 zBD=QIZ1?Y?)gATSbZtj{4?Vx5eiwazM|~gN-cjFAe`wS5dTm0~Tfa>n#~=XVHf?xI zg>aAEM~`A{czL*9_FzBW4*2tB=U=?OkokSBwe&B;54Z7;xAA8L&pX?P{d{5zk9@av ziXoSV%2X&ASKWf{x^^MuH=RNzGnN_6WHLMGMz`q7MzOhCFzXfTE@Hh{#9wT8QJ|gP zMXKYEyj8=wi{@PwRlZe%-{I%uxHh%-n0sj<@7ae6h3yNqRf5C9H+Prj_l~YZ{vLK6 zCa*HOj^KgBdK3dck3zjf&+;vd#&VtUeMDbHFAiaRL*Q>QMq%6(_$LD268hT$zbNo; z1b#)}HyC5me+#@JaF}0EkoO4OC-6am9}xIqfs+CwZ7)BrH_nrLBx9~!#$4x&69T6N z9uXK}CB~_gqaC9XuFp zqncu2s_kakR_SemQQtLC*D0SC#q0(4C0xY;R+eu-B zh!>ofYe53kV2r|x(^OE^p0WEz%(w7nI*GveIy6fO2%_<8m znZHef)IA45a9#}uWD+u-mtXyI-W#B$4@mj};%Q6>kh(8{55~KMczotKUJr(h_Z`sE z2PD0Ocx)#@>b?y@FkT}N4@=aF_X23?!!ce#yid!b3+R3fIvDR7;_>=&e*7;+ncr>D z!FWadVRjBO2~zhG1Wady;wJ1?q><3E{$)W+RUC_(kPI--%kVplV18c+d@sKdWPY!M z#@T29c`%B2T;mdCevAXlK$l?GfM7r54`6USOySKb&l*_z1vbl)LBLCr*C=Rr1J3WT Ig8*swKi?7y4gdfE diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/initialization.o.d b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/initialization.o.d deleted file mode 100644 index 8c73109e7..000000000 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/initialization.o.d +++ /dev/null @@ -1,230 +0,0 @@ -build/luos_bootloader/production/_ext/1137593668/initialization.o: \ - ../src/config/luos_bootloader/initialization.c \ - ../src/config/luos_bootloader/definitions.h \ - ../src/config/luos_bootloader/peripheral/nvmctrl/plib_nvmctrl.h \ - ../src/config/luos_bootloader/device.h \ - ../src/packs/ATSAMD21J18A_DFP/samd21j18a.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/component/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/component/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/component/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/component/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/component/port.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sercom.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/port.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc6.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc7.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h \ - ../src/config/luos_bootloader/device_cache.h \ - ../src/config/luos_bootloader/device.h \ - ../src/config/luos_bootloader/toolchain_specifics.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/config/luos_bootloader/peripheral/evsys/plib_evsys.h \ - ../src/config/luos_bootloader/peripheral/port/plib_port.h \ - ../src/config/luos_bootloader/peripheral/clock/plib_clock.h \ - ../src/config/luos_bootloader/peripheral/nvic/plib_nvic.h - -../src/config/luos_bootloader/definitions.h: - -../src/config/luos_bootloader/peripheral/nvmctrl/plib_nvmctrl.h: - -../src/config/luos_bootloader/device.h: - -../src/packs/ATSAMD21J18A_DFP/samd21j18a.h: - -../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/ac.h: - -../src/packs/ATSAMD21J18A_DFP/component/adc.h: - -../src/packs/ATSAMD21J18A_DFP/component/dac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/component/eic.h: - -../src/packs/ATSAMD21J18A_DFP/component/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/component/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h: - -../src/packs/ATSAMD21J18A_DFP/component/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/component/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/pac.h: - -../src/packs/ATSAMD21J18A_DFP/component/pm.h: - -../src/packs/ATSAMD21J18A_DFP/component/port.h: - -../src/packs/ATSAMD21J18A_DFP/component/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/component/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/component/sercom.h: - -../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/tc.h: - -../src/packs/ATSAMD21J18A_DFP/component/tcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/usb.h: - -../src/packs/ATSAMD21J18A_DFP/component/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/adc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/instance/eic.h: - -../src/packs/ATSAMD21J18A_DFP/instance/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/instance/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/instance/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/instance/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pm.h: - -../src/packs/ATSAMD21J18A_DFP/instance/port.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc6.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc7.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/usb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h: - -../src/config/luos_bootloader/device_cache.h: - -../src/config/luos_bootloader/device.h: - -../src/config/luos_bootloader/toolchain_specifics.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/config/luos_bootloader/peripheral/evsys/plib_evsys.h: - -../src/config/luos_bootloader/peripheral/port/plib_port.h: - -../src/config/luos_bootloader/peripheral/clock/plib_clock.h: - -../src/config/luos_bootloader/peripheral/nvic/plib_nvic.h: diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/interrupts.o b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/interrupts.o deleted file mode 100644 index f925e005049746fcb1dc0192fa882344c6fd81ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6340 zcmdUzPi))P9mjv9C|iz{)Q+9TX|hah(k5LZO0pcsc9O=9QMqxkv>(8$D z|BwA$1VFThD+!mDR^!?9>G-6ak<;<9RC+2knVyQjFuRgZYORW~wP3(AN#6 z6~BnuOy(O^L$B5won(G_arVNs2mJkaxx>2%jxt)(o|aN zSXxPLRWoDB*`nidIXyX>bb9R?iiN|IsdF4k2fNWsQ#a1>z6jJ>=YKFPy7*4_TvazL zZ7b1Ab(&oh%dC30RYALBrWB)EKc^V2%?UHniYM0Ni7V-NqE_p+t8^6!Q?o6$QL|^0 z(``Lb)mtrGi9`+aO-qNEEGJE)%4Qdn$s-Pka3`n6JOyxeS5N{d*zG`FR+I=EgXT)kU36tm>a_cdI!g{8S%=|Zpd zQmtXMURDgP6zI0>tk|veq#|G2afgUPpV?S%Yihh&R}2t^NVn}P5W{92XETn22T|;I zM9;@AmBLNEy>5Gi%H=MWWyZ?redWMkaF2^pzm5HMB2JxNMKR)dJ-}58JH7P#S_t*} z38h9p!hS-XTDx3V+GtJ?Xi@9Nvcg zoy~%U`yQm(-K51MSX67TXr^YB=biRI$_*8;9r1`nY)NnD6>~$WG_{2`=QPKhBIGo$ z80tl(+vNB~#$#>=#-^rb(_S}k1gIx8_!vO8NVTrYU+24gpg73Nm5SMn*3 zzR0NR(X>a)jMhCm=FyvsHa(j0sKRK+qvIZ}Flu@9lt-(KZV@eJv)q7HhHf*&jaIW! z=*TMqW87G4jJ?VjH_&y4UT26KWu2in7~+Q5VCW7*6W-`=F?5%q(;nJj=q($~=D5{u zGW52CIMQO|o=tN6mS{8dj*XW24X88pu8kJPxGm9P=)QnQ+XXz5Lcw!QdP#f<%OjWR zEQ?6?fvW0VJgew*w@>+jvT2`q!ucU;LJ$VDt*X|cCtlg2Qw@Zf!xgMA2)n+6#@ru9 zH-M;+>$Y0ky*Ux)t~;?Bg)-t-F;WwTgr_6J(NN@IWVLTdSP=&MkQ{|*^f@fV(LN5L z$aM5fbSk~i39%tzuQ0Rg%?s!WhiJI?!vWa;^ylcF^yvtOpdt7xc?qBH z*^Sd;UpAHsk9^`ob-IKBkR5kX9A=hUZroL(_^Gs+kyEKsr-AuusnM=ByQ)@dDHxcw zwa-`C+%^I5dFcfjILflB)$AvcwcXK7xlR{{TR=rW6u7ji{bVd}I*&#yqnJA^K-iv@ z&<7xd!^0yYuCD->vf1hQ@m>HKrwfVO7xL`q3}LY^T9wZ*2_W9y6WeWTEV2`gVfF<6 zDH_JOAUuiL@I)bzhrU>Uen8kOjR^aM{h?9efbfKHn1=34e1Qai|BQzr-`fSPvVR|h zXm+?1!X2}R)BFyi;t+&k$j8Gz6@q>kp_1O9g5wzgy3~jBU66YukHL$N4*~tBfc{%R|1+Tba4_z8 zsQ%|$xtQU?HvtHCv%zD91G3&)Z7-D&`5(+P<@&#W`^yoF`Xs<~}d(Ar9YuV9Wvv79SRMvR?vdl6@ASL-sg;MfMoL7TIS2Zj*f);1#k* z0bV701mJbDPXW9^_DO&{Wa9vL$$k;wEwYCJ-X{A6fO}*Qfql-42LawC{RF^$vIj7T zBO3+S#`{=&41n%u5g&^0N6_MAd`K1_i@#yk_8)N01}djSR$}&3W=F{4_rFo5K{mHr z7_OqV49C{p9De<=!2SjWa>X=3rUKc2m&%6Llv&6Fw%|?@cB-)BgQE&N9=M{NCH6_d znxNxBrY}VrenH`C)$nVa1~Pu-lj$65RJs-(NB>2_skhHI9-%qgLK`f)|z$(3dzkzwT4rbw-2+7Y)F8dl5@a;)>1Gw$Q zkh#}!7xQi%YU6v@UW_Ynvv-j3?Tui2G<`HaifP^U?qS}ogIV}K-phP)*^jW0@+k(% zugEzPqu)=Nb@v_MEIKJOg1(saDe*PUAp@AuxkdGqGInc4Zu)9g3*nwWjNsP#9J?mq=>_6}2mocVD zMDV>=AIXdlUzQooZO#p6HVqAL9U2|pnz?T5;J!htTCj>mt2nS_px_!cvz&3Q9iCJ20hms$WX}u~4c{0j*%fQY__o0Vt~28r)yy8y z-rzplbRDy7*9Z3%1GZ1DJ{xl4xz>xMZSXC4~cH?e70pV)I?aC2@XH$1#$&@-yV zO~c0Eyt#SP;Mn0n;!DG$V}rq{4cG8tUXBKbDRm5Ed7k6$h|7XeEY<%HX3^y9jUA@r z`qunFb*Nrxc)hUe!Ks7TklNs1QoEa#U8a0zm1Ey20VkHJjXjgoPrEW6APZz#CzWmk(Ti4C^*^_2fi; z_rd`AlI>RK4A;sp8Cee&?Z)9zBX=wc)P-8%O`bhdvx*tBY`9F}TBCLjpd`F99GbCf zK2wzDfLM@`s7O?t+DsrJnq~W30WA<%l+psJj}aA#KxOk14MNHmokpQzF;$2;i0QD% z;=P|!8B6F+sRUZhwZDnfO6a9J+z;B9bdyk@R3C<1v#!sXWu`ur8egCaOnthWm`r;F zeV;+Ag>`DLy~f3U?N4$hrJCW+z+nekiIyHMdX8Q;YDI*Z_;L%uYW5bM)Jrx0 zMBReyp;mGaKqaZ$o^H+?OdJiduPIC$1NR^3CY^T?Tc#r(=53$d!$m zs9h^EQEUpl3D1>k7^u{;SMs$EvRcfnA@8f%(;Ul018CQPO}}uYHgP?OPLAdB3XKxe z#7XTwAW6Moc$m#iokYp;Jo_YoQ_+A>NRdw+_e@Psva)zd8`G#~or#}zEp)?Lyu27~ zb4cS3a& zm|0~un983+CDTdTkUR^~_ipPUIh6xRolX%Z{@Qf|e5+&+Lk$w1iT6@znSaNS!NLB) z#NXO!-%+yp(6gJE_l!RjH_a=6dJ7P4LlOVLOq zty`{Ja}ZBTXe%JkFH-JSl;r*-jVdJMG+=&3=?O4RV(3iRngC0sb-RX*pr&X+>~=tX z)pBR7nu!c|6m1$Qr(}E5I`;FrW!fd%D$=x#iiNHv*x^QY45dQ`6P}W`Wyg^;VzOw% zI%JS&M53dB&5C8zXdUO2)|;g8_B3YeH7bxisf2svt_aiN=$oSc6KTDEDWdgMBz9$5 zFTqn4oA!&Fm7ZIr!s)bb9``F2Tysm*^?<}=Jlv|ZkVmnSY3$5MhqFp^Ms_@wj$^F_R%ba1SSntfM- zh|Cw2*6&EM_Y+v`Lu3QjQi|>eX>YE{=?{b}_-VN2ONm3)ng) zc^8pVYgIE{byOfnjXo(K2NnOUPjnE*RowR-r1ld^Uxx(enLL$=kSbR*jpB$lj*wpQf%vMT($2Xu z+`h#bB}p;4G7Lc`zNaL~h`^kD)VGiI>(TD&Gu|eMvx?L9D3cbs;-K9o=mNQl(_Ry$ z_`?#v9se4o(+|;*<|u5nZddCK*V5}g7Id@PO9u<*tC7S`0TB@Aj;O0klDkHy;6CZp zEY@@;O?Pt6*Wds=QL$&rK5KepIR!Q6@=RKV4`MkOXXtmbW>nGZvECG5&M)G+yg%^` zO~IEobTQ>-#xoSf4Uh2+9Wp@x2ZeX?&uiUDRqNM|G|lR+@gi8><$+rqGgeb|73|wh9e` zu!i!V{sMY|Jcr(kHyM>}#J|G-)!v4nl92?OU+|-yncMPs!;nuWber|^)#&LYPfsBE z$H%v2)-OCL zWymWT>6Hzi@kxsz64*y5oGGW;Q*DxtmX*vIy99rRg%>ZzFGe%5<Jo3LnEgxO()4NFx+tiY zhUZ$J>4+yE*Ja<;b49Drmt5BTwh+$B5&yG=mTJ^Esc$sMt8J&X>pS zjs<5B?MO-sW2Z171*g+#su2V?;V!RW7aXR82KD9i!V7F?SRbVths3pEP5vOh)ECvw zjM0}q;Z&%mG^F}+IFV|KCuKRqJ90p?oOhz?8wJ$3fy%lZweafTGx-wBas|(0IRbLQ zJaVp8i90)NhaQe`$+a=k2wfM0&PSvdLyhFR9KDp%M`)~939r!>%i)zfM=Ng^8a|fl zQ;9kL04vT`EUBD(mpW#o&L+ZG_Cyaig)oS{QeGC`TBT zE%@DlwU0_P?kE6+6WbLsKET>ui8dMyPU4%t_&}0ul7w)PHC2G=s5VeU}Kx~q( zs6@P@0OI40ri0icSsIVxj%pjfs1KTK4*D|G2usAXK*#l68PkW$#)7_6Xh(fW#e>i% zU$=-riFos9$MqeH>7(-@vhVI#A2iuh(05g&B*wb~?YO=&^wIoizPRWv=sSaUtULQB zwm9NPCE`5^fZ9V5137;m-5tc|F+H4+sff0Es>zUaATq{s8iV-~j|kNR_B)_?T1`Fu>L*i>sE;-8{^^Z#%D2RSrQ1>d(FBnu1#xly*(>>K<;nbFalTl| z&y_1D%Zrth`A;lwu9vJ%!)i9IX5mDk;Tm0YJMUUMwr4xt{M^F)lk+E^%NIJWwqy7O zqhX)+oR$xP>2zE6R-tM5MxkZ5t<%+0r485Fa*a;@9C)v^Zkw)SZri=m`o_iOv)4*H z$BW0yrJiBF5LMQe*H`8$`pUVD(tL5DSgD*Sc}Ax>S20T0&H1^~^5wwd>B{1ADHyfy z8a~1+^56)ihhZ$wbKKKWTPT{X-v1#io_w!=+H_psx?bp%d+ojlnZModG=T3}DZ@3l zPaAG$=Y&`2S&}#L&CeNbaSrWrXORi>w?>Yt3>2#2ZLJM@;cPLXVmOR%C zSEAJJJD%Qf93S~cNU%L)zA!U0tc49r&-eY`62G;ac^ff%PC~&sP?W;w4Lr&UN(UsF6pMzZ?rAa#7JmuZW}Jx)S!DH&=TG@ z(hxY)k^wWY35E=YU^=Gjec<^y9id!0I1|JEh$rQMyZfX9;k}yJpnt5qZyNpMH8hDP znvvPKDMt6liIUZgD{Cthw?x+FA&ydVtystRDRaP6t78j(MzBJ*!{7(X%M-iddJOiIiO9w61$QC<@2*NK~eI93e7d)AB4| zzhHEmZObLGUJnks3t{TTTW~twtGOnLjY-M4mcL`PNqlbfD;RfT1eOzHXeKAn{1fJr zkATo{XielnOw6E}oJBJQ5lzXJo)#(4RQe<7 zlj*e_a($c_B|ae0NKT~FP$o{M1*FOGz!vOUZV~fJ39*)A&FEp+m(p0{(490PN-spb zKb2X^5calsDx-!xmboP|)0okjk#C;Ou&42853JCaJ}+n*Gn@>F3QVRZ5j{saU8JZh z>1Panur{n&%G^3L5t|4mN0d{tlo~x;Ho2~JQ{E$-Ta9jFVFKU;u^uZUTW$iLh;5^A zKlu+4dW^23)xi zX1m|C>Ky}DQP+B~&fX1=!kB{VtGZrWtChmmajnu?Fw6tFCmK4nu>^Y4Y8m~uulv}P zUU8dOR`>iS&Mz?7gt&ez-3)FYNRR@Y=fRx8@|H;mO2~DOEr~=Tmk=X4O<M)#<@kIqF*yQmq`pw8B(jn$9Z2MaHia%aUlyircWqxcT-Ufkx*m+B^OYqPw$Zjf zE$?Nb^VRC9{OsTXkmt1IWm=wiz$XaigW9D#072SkCNkraS2f1-+@}~|uD|7p)GOLo z1ucIFjA7yJLgFyU#EDvAoklXr^-+hL2*bthK1h^Q9+#kaVM&c?Rw2| zEvqUItYVy|2*i-2sR$q4H!O}JYrFLc!cL|S5BhLc??Q}{^boUyAcx}{rNW;2F_I6+ z_w1jc`kwtKXlGCT6n$+^eU^T(r#_ldULRhKyAZ?de+ibu=atW5ecz1mN5KDKi2vOX z|HmQzZz0e1lSMxM4Xl83b7-(uIBUT_KE!`;h#%hBGd|5Uv3acP*hs$b>cytj=x<>I zwVeBijYb1+@%t#+j(H!cf#>^{<=sc~o{Bb~iTB3i`7RAzwYq#$>P}ZaH(_A((2;jG z%UpgB(C$~ko@a!-g(Gi^dyg1?9E=?%;(KQ7NU#sI$BD||wMU8gzX^{kT4D^NGmIZ2 zT49X01ivse92zg7I5fNnZZSql^>9{dNg_YQ*BRpx@|}?Xeu#e*;-7^0=OO-8h<_d8 zKQqSG{7Z=6W{i#bPKXoGF+Un&geAv^T4FxeI3BJi#xib9Uh?R3Ad~~iab!Qp`66a} z)!#zxaU3@pL(aQLLuc6^@|lpI4f|2iyV3ED2C(l2cw15Uv++s(Us18);qqfaai}7S zuGJ0{yYnvPk-83RJS^sjma90zs`8D9!n%z}WWk0Wxk`)tgJj`#AF*lSC)A=Mer}7r z$?Qho$FBHa;b9o^Hs(AqaGgZ~Wh4QmDecrLKWxW77>?oNT>UpYKIezWRbxRlxLsC< z>=wcEd8L5sgJBupD84iJ7|x6b^nTDN2YxchxSj)6v4W(R@f~J^5R~rY;G_OthQHS! zV}B^Ofj=9x>I0I#2Vc>1Qt4hAvU>vyp63oBD7zQIN5?&Yy_$!N$K^9Z&Ew0URUeRa z8~(V~6)4>oAc*=~gg@RR?2q@7^7n1fst-s?VUld8Ke?JDT`mm2Y z{JkC#DDrjaqW*et!e;@;$5_Sp3(%?$NO}`RR$?LqrTYzdrpuxHU$DCz(u`Qg-|s^V zBw+(VaBV5zaT$J#FB;#=k@@nOqvE>_8a3YolJG@z;u=?=;$s}G^Pj?Q0|H)a-iz#y g=gniPJp_{CNY;{a0$!2RLw4Uqe1GQ-At<~500b;VjsO4v diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/startup_xc32.o.d b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/startup_xc32.o.d deleted file mode 100644 index 1630fa9f0..000000000 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1137593668/startup_xc32.o.d +++ /dev/null @@ -1,212 +0,0 @@ -build/luos_bootloader/production/_ext/1137593668/startup_xc32.o: \ - ../src/config/luos_bootloader/startup_xc32.c \ - ../src/config/luos_bootloader/device.h \ - ../src/packs/ATSAMD21J18A_DFP/samd21j18a.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/component/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/component/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/component/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/component/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/component/port.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sercom.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/port.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc6.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc7.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h \ - ../src/config/luos_bootloader/device_cache.h \ - ../src/config/luos_bootloader/toolchain_specifics.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/config/luos_bootloader/interrupts.h - -../src/config/luos_bootloader/device.h: - -../src/packs/ATSAMD21J18A_DFP/samd21j18a.h: - -../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/ac.h: - -../src/packs/ATSAMD21J18A_DFP/component/adc.h: - -../src/packs/ATSAMD21J18A_DFP/component/dac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/component/eic.h: - -../src/packs/ATSAMD21J18A_DFP/component/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/component/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h: - -../src/packs/ATSAMD21J18A_DFP/component/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/component/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/pac.h: - -../src/packs/ATSAMD21J18A_DFP/component/pm.h: - -../src/packs/ATSAMD21J18A_DFP/component/port.h: - -../src/packs/ATSAMD21J18A_DFP/component/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/component/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/component/sercom.h: - -../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/tc.h: - -../src/packs/ATSAMD21J18A_DFP/component/tcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/usb.h: - -../src/packs/ATSAMD21J18A_DFP/component/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/adc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/instance/eic.h: - -../src/packs/ATSAMD21J18A_DFP/instance/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/instance/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/instance/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/instance/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pm.h: - -../src/packs/ATSAMD21J18A_DFP/instance/port.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc6.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc7.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/usb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h: - -../src/config/luos_bootloader/device_cache.h: - -../src/config/luos_bootloader/toolchain_specifics.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/config/luos_bootloader/interrupts.h: diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1360937237/main.o b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1360937237/main.o deleted file mode 100644 index 7974a2f0eab408be2907c6167fcb2550cd3a9966..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7220 zcmcIpeQX>@6`$Fi^R4e}$6q-+pS|SLHqiLaj@`sflg5eT6jO(~`6wwpwCvsOec-#> z>+W9cw2fLyQOif#v_Q*;ib^S>>BFzdBKey;6!`I#lF(LzY_2+;d6nwJk;dK__?eb>x^{C>yr5#W;T z=F2s=v1qw=zK)(|VVPkDL3#h!q?J9cl5)A$M6A~InI_`xrdO*p?NVCOMy&2MD{1)% z03q8Yr(LMqOkV_OqMyx&JmjjzJHp<@s^x+-memD-7W1m`d!Ss42gI^WU_vlt(2mQ| z&J{2M@IsC-opKr0=-HmX!x&+fTW|qrU(zw5e^Fo58S603#bTA|U+Ve-!~&|o^d|<0 z$>Ki-cn?|z%}8gRhW=RRcR(jhv*@(pCH?Vu9V{(F&^@}lT4)6Xh4KHcm4Er=HZ#?V~3B--Z*0(WwEYq(h95VPH_R9MP}U# z5bZMe*DB#jS!0l>4D5Tt{jt6JwW>{5x*VtrG&lVHk z>tF7MSUj_mZHr8NKco=Xa@`_N{-E=Dxk3Kw#C{u2Y!W19_PfxE-6Rb6iQo44Bx+vr+`9j>xtG!-(K@U+yd z>^PA^PL^u04l78smFOhkV%@fy6vss^akCWOox*Irb{&$pYT+I^r7#nYzD@N%kTP3W zB3o})V(&dm=s`UD`4lpU zR!>BfAeB$INFnM+3u;9OLp=mQzBy@a$ejp#AnhiBC$mQsW}Bi=n5WYDN-^(w(&4Y4UA5X=@vB9kclI3X=0M~hy&a> zCADH-z}7Lt`-zlV8!|f%Dx?D;DM92~-v1&@)-qizPL0!$59c!cocNFyKh;fEwwrAa z=}QAKagR1EPd;R<=exeMVAd^4pL@0bAT40B<>83fuuYjSAJ%$FkCwqwl1pHP^$~4| zUbtFjOUkTRjfN#(+-NcJQEgSQwveMVa_Fm%Y1@Y64uOPpF>P^LTYIIPCX%m#Gg=c? z;nl;$eOfBmORB{1oyDT!+^;yT6b?qd(fLzaMuTe|rIugpl7@>=I5NL5yD(lP@w%gJv%a--wUjG*mEZ4C1$m z&+}2XxeL%XkSxRb5Gwk`Z|MMqhAhUl9gO$!OO1h~Zmctob@cJWyq8WJTUauA4M3!B zis{C#c{tV=F_hlA;ly7dm?a{_Fth>|4z)hcEh9^UJ#ea|U8C z2fn&YR;!maV2)&MDzr*YnKTS7n-fY5htmkjHK7+ma&5FfW9tUsl-;mkJy}2lY?z4n zbZ-~&HinS&TmW5?<$JrN?*WqOeH^cyj)(V49qA9>#SyzP>EBHsxr;L`@xXo8ypP#{bpR zjjWXk2AT)o@2t2hk9!MwT|y^ZFW*qtC3(8`$e$R`j*jN(6TVU`=36yj#k{<}$>Xe4 zZhnh4&7@4NUI5+X3R9_cznTSErquc3eA0r#lwjSilE3CzkAT zwn{EF<@XTUcnirxX3(S~ZP0=+ynr@5k6v_y!>x%204E=5hAl?|fJMq;oW*3M^vifm z-@G>#8^i}Q=X4Qb9&R_8=`>CHk}~Bt+mV}&n6sqPs?)~|yLNhdS9XzK}}h+ugADsL(1&C0)%DbmW}aEXvTIN89Br{y5fgA zdA}IstND;V%-8U>d?UPgZixbdz4BU=i}^=MxH`yX1?uGdNYUZz<O4bvp!_(N1 zkj(U;a{hP*+f48q@;lkp7v(3}4HxBivxSTDSFyV<%I{;Jy(l01M5O4fKSI&`SF@*p z(DW#N{qWbfBNDx6|MWasrT-S6naDq+pYOY7wqzIDmEaTRLf9%4a25MH@^ln<9dVrN zD!5y?kn@I&I+p0`$m1X??PcdJkL5)a?1PClc#C14iM4pkq1JH2kVk51c)?bw?qlp` ztWpi`?4vg*>X+d#4cMz;{ZFcqOw@<))nUDfYRF$2*151A4{LHS$x~)hO>2y5@;%kk zp7;t4_#F8=5ImBjwWzITxIGVOmi10He5-&Or*TT9_dxa<-5(YxYW;5cGU`PAL;Ps z%Q}csPLuDb1piwI+VoVr#wN5$PVE}!%Mp*t<@iy4{4cpt$eceett(a3xZ42GCDv5P zcr+En7nRHd$^{y4FMi4fG}(Uqu14OdqIk3iMfH6Hidw)(ANfG(yAEyD2TgVgx?YI@ zs`=jY%WRg`^HtDGfX8k@{F079+YXJ}mVJB_K<2Ab?S>_fk#Mp%?S Rxb+;lB`Erh5<;!y{tHky7xDlA diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1360937237/main.o.d b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1360937237/main.o.d deleted file mode 100644 index f7146dae8..000000000 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1360937237/main.o.d +++ /dev/null @@ -1,298 +0,0 @@ -build/luos_bootloader/production/_ext/1360937237/main.o: ../src/main.c \ - ../src/config/luos_bootloader/definitions.h \ - ../src/config/luos_bootloader/peripheral/nvmctrl/plib_nvmctrl.h \ - ../src/config/luos_bootloader/device.h \ - ../src/packs/ATSAMD21J18A_DFP/samd21j18a.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/component/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/component/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/component/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/component/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/component/port.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sercom.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/port.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc6.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc7.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h \ - ../src/config/luos_bootloader/device_cache.h \ - ../src/config/luos_bootloader/device.h \ - ../src/config/luos_bootloader/toolchain_specifics.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/config/luos_bootloader/peripheral/evsys/plib_evsys.h \ - ../src/config/luos_bootloader/peripheral/port/plib_port.h \ - ../src/config/luos_bootloader/peripheral/clock/plib_clock.h \ - ../src/config/luos_bootloader/peripheral/nvic/plib_nvic.h \ - ../../../../../../Engine/Core/inc/luos.h \ - ../../../../../../Engine/Core/inc/luos_engine.h \ - ../../../../../../Engine/Core/inc/luos_utils.h \ - ../../../../../../Engine/Core/inc/luos_list.h \ - ../../../../../../Engine/Core/inc/service_structs.h \ - ../../../../../../Network/Robus/inc/robus.h \ - ../../../../../../Network/Robus/inc/robus_struct.h \ - ../../../../../../Network/Robus/inc/config.h \ - ../../../../../../Engine/Core/inc/routing_table.h \ - ../../../../../../Engine/OD/luos_od.h \ - ../../../../../../Engine/OD/od_linear.h \ - ../../../../../../Network/Robus/inc/robus_struct.h \ - ../../../../../../Engine/OD/od_angular.h \ - ../../../../../../Engine/OD/od_force.h \ - ../../../../../../Engine/OD/od_electric.h \ - ../../../../../../Engine/OD/od_ratio.h \ - ../../../../../../Engine/OD/od_temperature.h \ - ../../../../../../Engine/OD/od_illuminance.h \ - ../../../../../../Engine/OD/od_time.h \ - ../../../../../../Engine/OD/od_pid.h \ - ../../../../../../Engine/Core/inc/luos_engine.h \ - ../../../../../../Engine/OD/od_control.h \ - ../../../../../../Engine/Core/inc/streaming.h - -../src/config/luos_bootloader/definitions.h: - -../src/config/luos_bootloader/peripheral/nvmctrl/plib_nvmctrl.h: - -../src/config/luos_bootloader/device.h: - -../src/packs/ATSAMD21J18A_DFP/samd21j18a.h: - -../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/ac.h: - -../src/packs/ATSAMD21J18A_DFP/component/adc.h: - -../src/packs/ATSAMD21J18A_DFP/component/dac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/component/eic.h: - -../src/packs/ATSAMD21J18A_DFP/component/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/component/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h: - -../src/packs/ATSAMD21J18A_DFP/component/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/component/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/pac.h: - -../src/packs/ATSAMD21J18A_DFP/component/pm.h: - -../src/packs/ATSAMD21J18A_DFP/component/port.h: - -../src/packs/ATSAMD21J18A_DFP/component/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/component/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/component/sercom.h: - -../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/tc.h: - -../src/packs/ATSAMD21J18A_DFP/component/tcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/usb.h: - -../src/packs/ATSAMD21J18A_DFP/component/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/adc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/instance/eic.h: - -../src/packs/ATSAMD21J18A_DFP/instance/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/instance/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/instance/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/instance/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pm.h: - -../src/packs/ATSAMD21J18A_DFP/instance/port.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc6.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc7.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/usb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h: - -../src/config/luos_bootloader/device_cache.h: - -../src/config/luos_bootloader/device.h: - -../src/config/luos_bootloader/toolchain_specifics.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/config/luos_bootloader/peripheral/evsys/plib_evsys.h: - -../src/config/luos_bootloader/peripheral/port/plib_port.h: - -../src/config/luos_bootloader/peripheral/clock/plib_clock.h: - -../src/config/luos_bootloader/peripheral/nvic/plib_nvic.h: - -../../../../../../Engine/Core/inc/luos.h: - -../../../../../../Engine/Core/inc/luos_engine.h: - -../../../../../../Engine/Core/inc/luos_utils.h: - -../../../../../../Engine/Core/inc/luos_list.h: - -../../../../../../Engine/Core/inc/service_structs.h: - -../../../../../../Network/Robus/inc/robus.h: - -../../../../../../Network/Robus/inc/robus_struct.h: - -../../../../../../Network/Robus/inc/config.h: - -../../../../../../Engine/Core/inc/routing_table.h: - -../../../../../../Engine/OD/luos_od.h: - -../../../../../../Engine/OD/od_linear.h: - -../../../../../../Network/Robus/inc/robus_struct.h: - -../../../../../../Engine/OD/od_angular.h: - -../../../../../../Engine/OD/od_force.h: - -../../../../../../Engine/OD/od_electric.h: - -../../../../../../Engine/OD/od_ratio.h: - -../../../../../../Engine/OD/od_temperature.h: - -../../../../../../Engine/OD/od_illuminance.h: - -../../../../../../Engine/OD/od_time.h: - -../../../../../../Engine/OD/od_pid.h: - -../../../../../../Engine/Core/inc/luos_engine.h: - -../../../../../../Engine/OD/od_control.h: - -../../../../../../Engine/Core/inc/streaming.h: diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o deleted file mode 100644 index 066130f65f101820f145e93d2a6307e2eb56c1b8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3468 zcmcImO>7%Q6n^8iUAK1HCT{7Ugtk(u2FmW*Ntz~sK$ElyK}oUtBZ4q8>-9R>*7jPv z>yS!R&;vJ+dgI1_uZSDsf+~=DUg0z zQS9B$0sK)Ow7EgYR!7XH3QA8I&;2T z51_EzR^8dqYGz<+b*Ev^EzTMx&)x9Mrn-c&Z>%|%=USUi+gK~D&M&MRTj%xj1*2_R zx8mTn`L#>q#mc3nk};uA>c!%e;hW9cc+oVrt%-4C{(9HqmE!cg(aqZN%mC%-oE)XJ zk;e9Y*PDym0;tv7|3g_k`F3Z{a=pOb)|!QOqvJytY<8Me@V~8;=~^0lU_ zZK&F-MOCZUJ1vW6q4{>m5u+ZiW^CMYHOp-_(Fv^%xe>UO({;o5tY{^SM#uFlRo4yB zpPKC%eo%AVaN#O&a{|}XEn1u{-|%hEFSi`aZIoYgy<0xoV3!M%m4;I-uOdkK^0wJ* zqiDlFh^p$SsZWgCaeO>O@9#06asnYHQ z7Ky2JxQls%Chm~<4uZn!qb!LMB}K;CG(Adnoi=QCDx^dbyP7G9haGvGw#-(w;aay~ zk!J;iAtjS3rxhUJusD;+XO+yU%#HN0xGD~(;jW99a!O`4`+RmLdp0*LM#RMfA1&lW z9<`)MA}jgC0fZc-Z1zP&AWHT7t>pVW(|w-lZx)cLM?76YC1zY>lKvE>Pb4}Dfst7K zy_t0NA=qaT*WU%A&@8wb!$Q|6rTBy*AL}T$zzb9#5)IbL*W>zka!sxm&Dc1 zpTo|N~rz@zXk46n7FTM={O+ai%A zx{C=WhKW98j%E6c`97li5&xMvrvFRCA2A=oIf*#07vs3ELVhUXyyC16^Wfis_a~3> z*AT`B3&(x_$jfJp^YgXN_FgnT!u(j|5B+E~9*c0&{oBpJtbzw#mv2f5-_L-;uQ=&d z-zS|F`p&|{#^Fap_v}Wzqmdl7F@|#gVnf-um@4X6OcS;$ipc%Z`O9nL;}Nr|b((uZT5L%jD{h)7}|V;qln z5Apb1bA5d7<$S+_EPWu-*9^o+V)D){L>Sv$AFyNFhj^q9!%3Wf=@X9m1^OOOyuMFk z^X2nDHt&9-_kUA3my0Mq1j>y*ihe`3I44AL%kFni6>p!`R$RT5NiTTA&1oMgsmqJn@`Wd1>mx zOeh$enTz_vzF}W5IO;FOv&m2}?%z&?L;k51!{S_Ue9CXsS}DfM2+zlrBa{NFNtH_Z z;u)(g6v>Uk|3g^Z_(J7OB3~@0wuiETLZ(uJth`mpt^*(HsdzE5btYcSUK=e9W%Z#= zeP}7D4{dBzatUt5P$?x5J~m`;T6iu$l*nhZ7>S_`V%NWCj#o3v)>1t(b8|h;97vsg$T3r+|V*sBG zj>mnM&DW@k4$)LfZ{|`-J+T!pk~0>oq;uu*SeYCrd%ubq>k#fr&T8UtXr(Q*L5CeV z9L)x)+DNHO%j9#L(n5I*huGy(Uz-yyUCmN$FXJ}KR0}%XhE)SomuA$`Z1dnWBX{<8 z{|+K|B~X`E!jII*2%LeQ|6tV(R=td$rfvLu5l{0a{5VN_9pGYt`j=t-|=QDeR~U zrE}es_f+N5dA}*|t;(hI0aJd!kS{Ef>xl4vLI$oIvdGFZ!Wc9y2My^n%aNtUxrKRh z9W^!HmgN-Y>9tfcNUmeT`@7Q16NY{C!s=ym9T(oC=qAUJfRZjOM&{tdE4&j@K3Vk< zBG(DwU6InO)Wn0sMP=vjCKva%6mmH!JWQ^~S;)h*R1<1XA@5>AE5A>%&0@Y%h!sA^-PMVvoX=-n9eURtwu>pcJX}hGz*^a+LkCb5w%5U zmlvXEXP2kW$L3ZSBP$C_i?OLk$frp(w2zRZp?rp%4dt`sYABy0t)YCLni|T_QZqRl zG=Q|C<4ts$r`hrM+|*m*`z_ogp5M`h#aMJI5UArpZkk0O;wD*mn44nZ!`uW5AK}m~ ze3V1B@G)w(@o{q7_$g|!@?d~kZ9GUG8xK*NjfZKMjSo}1jgQc78y}?(8y}-i8y}}G z8$U(eRvrpakBtXukBx_DuZ@RkpN$VwuZ@pTpN)^vV>Uic2dq3CphGquq{9|Ijq%lO zJV^aE9-;vo57QAFAErSYAEBc*K1#=Ie2k9U_&9lO{1lzAa*XfeHXfvtHXfoUY&=Xu zHa<)~8y_LRjgL~m#>XgV<)ILb+IX18tQ`IOq>TsZsa@6iytuSDOAj7Ut0^H3%h1bM zPTGYbO6TUI3ri7sUL!Fnn&e?t$A0X%L1L?wXm=rjhKH7!H;AKGv0)t zR<>i;;u#VHhVJJff10~S_1iqJ?@N_(p;DgB#d#qY9@PpLthn!9L?e1+XL*E|J4-}+ zpkl*u?jmuK_86Tboh{@nzU~{tV7mHixY{dS-9K)4+ABTXA8X)fCBM1J@!Yff=xQ^4 z+#9g^xEE^RBa%ts@Fm`{yI8Hdc&Fd$;+#a=djhm9lvt0&(b01 z9r#vig*=3XlUFaUi+uf?%NdY!u zmw3|SfzGIbi?n%B;6n{H$4-I}EW2P)_oCTF`5 zz(Tj9=_}J{PA6pC23e_+bv1C>q?~r!oEkpxYFYfEqCHgy=$g8yFx=8ub{a>u&u+ZX zZEFO^&SGxV*Qa7ITo|(bK2jZFuad_S50Q?ig9?6QJWLfdQci(WH_x1FMgJD z(}se<^l-82fhRwQp-NlqA(Y7ol87UCxY1@@ogCLA`U7=fcF+VKL91K^$AK(1wXT3bCN7Q$7)+z( zYJV9fMxQ;hx(uv15F-?sQM@K$*POT-PCqMh^Ev7AxAtSySM&3K>HjS_caj(5=ny|` z-$l47<9UNe{I6~%C^4~yiyL`g#P>&~wXAtxw8r;7YuCcQKwzzqMn18Y&LuLHWNIxN z$AwZZ_5KQ%u9rx~Xk0>BuZ!db6fRo|`CJOO3}n4HLE~b{)JD9LDaXp!3#pQCi^nil zDkpI(0D|p9-mz@)(A7$Aakr2ro|0sUc{H`wM8o})f8PK9SR2MWi6fI2wZ2A};QI3sPd@zQf7Ki`SwBasQ+TfM5(dFttM>YaF>m!)!{cz`6x z@k{M(yCgT?O@1@Yw~=M$!eZ)Kx0Al!{{3)y6jBxP3NqE+antpp^H&@%3tQbf>rUb) zp2EE^iGF0Y(Mv-Y@HyRlp+$7Ldc+>F&)F;b#C~yzr@Ad!1upvc2UaD9%u4YBnQN9I zcJeD_Nlx?>PF$A6Ew3fqqSfj7;8;se>^k=HyzbYM6So(3eREBToRi#jdUu_^rB07e z8cT9gYn>h^6iafFr%sR4m?b$eGWPhavxMW@Rj1#D4Vq}C>cd{zN$qv^?b7~0)xN!& z&Lr`B0K7P=z}}z_fly`eJ{PVqkccVxud?;ayE0) zV+_^g#F6K#VB9>Osa=?lUss%GVi)G$w-x7+>B4;b7n{DB{?o?Y)Cy=#(c@tdSx?~&TZry zh~w+)_#;pQMJAtUAdTbiMw_Wp1I;598Q#Vpj;B;ElDxLCd_YMqzo6ykSdAJVe>GnF zo~+6EBelkiuihG0U(z*!^&7n=wOs>9aWtKKl?j~Hk8F)&`=M|6OuJDG!*A#wQ;cqGYg2FE=yrb}I3g1%5*KF+nI||=b_@2Ta zEBvX#PGQ*ZQOFl>T>iAeh{Ab=eEG)ub%kk#S%qbV+X_Fd@S_U(ZivVGHx+(P;pY|d zl@E{eTMGX|;a@3ySK)gK|5f1+6!P^Bk8_K{4uw4m4U`egm6 zk9Rfh7o8FH4l0!K@cYFaDC0sL!_0v)KE!jHIdGB@am^@{@glzS%z-j)#JR#8IL7^k zIL|R6&J9My^)W`o^94r4^Cyg`|DPC9?@t&}-(K!l)E8oe|IaYOuWa8*)js%_?E#nV zK|L~la2Y@9lktMfcs(jUaM{18KgsceZ!sc{vf|r}i07u_w-^!EtBSwQi1>b6@h>tW z&bJl+Ge#aaU+H?b9A5{Piw16)IsErPndJX4kZ-+&Pg557-u`lx}d6lZB5tNje@(_Kqa%xGvHQ#6X3k| zn8~!uLSVI<18?N-SL^I}e`{pN`<2xn?|+T#ey`4M`4M(^>+EcNUMCOy7K8X0_w>LN|?orroTvGgTb#Z(yA=6Z_!A-vU_PXp#xi3Kn|alW@eu zmzv?v4ZK+AFOJWGzcigdZ)Ov9c3x~K$IL;s*u`LHtv87~-)}<3^>*Rmc5uDLI)95$ z79ckh)H3Dj{0-~Ip2z-r@RFr@OKq@GnxKgsPp%#PV{9Mu|NKUn(6PgI)8_- zw*P5^_I{$y-%P);cd)-+i@!JP{N2OefbFK5pqA-N$}XVzzrk)r=F!GGxNSPyLa)>vBR8mrW$91Y8>mLiQ&}eFMVdCdMXdYpM`fn9C=G?q~#b8VmR#N=P@zds1VV^l>jaUV9c&M;{ zXsoc`{N%*R*}PXPdF8TK&h5>W0;ldSnSpoC5B)~n93CCnH?sdhGgqrr8%~sSO8$Yc zQHels8}*96m@7MxldJeu@4(b}elBP%22Ra9jB%Ks_1&Q1F8R&;?A)=5$%Xv6d#!ti z@=eEmD9N0kn4KOj*wcsS@*~!$RVeJuhfb|LTyXN|-I3w^#Hm=~o3!i^V(jo?617L0PG`F{wDCf{rwa2rA7ozK;Vn$=baTC~)vm4LUcloPm12b`dG zZf}^YnYl$XccNhCDwS5c5%7=j~S0Z0+ zHA1`8XhhhbvKQo=Uf?&EyuhjE>*sto->mv2n|hYZrpAk>LoW!6b>D4Ni)R|aLm_s< zD-Mm?5Gx*ot>U5cPOXXUD`GRxBC@a;FaHAeaOU`->EdMDS+U{=wTGR+D|SR-#~XOI zFy>ebD$(1h@pR}f*1fXnE;#|ycz3J5f}k1U5*F9=>k-qmu6WRv5!94XZPXWqgl^j{ z&_;&si0LP`+(gQ2sV>1@snZ?nv=z1PSZWo~lo5OBT46zN`$-KATqi%>DWP0$v`STv zW+G;k;>RDDnX+e&pR!MSVblmb#^=+b$Oo_r+9Qk`DaMR2aw1}FrxBk^pFzQ*$2dK@ zsdJ_${cR9MpB`(7xX_dS5{Oyq(_<}liakPI^y$$@#0Ps2lV)Sbs;p}{sA)fRC|-Uf zEdqh4kf*?&hwtuoLCqt=R>=6w8VWH!Oc?7a!#y>f9wOqSJDvhkcw(IS93-}4u!Sg0 z#7lBIJ<|B`SwqAt`t%SpJ8rPV+8wILQBK55NAsr$(=aV`F^)qL5lk6ksYJi+WqR3Q z-H&{y>VF2)9$9ISmVFh2`&KhJX0WVnPtQ&=?I-$HuJ_vZq8Hh7Cue3S=8rP%CBB2- zk7dzmht>vO*s3Cjf5EdvWb16Z9Iw6Y2cKrzHCO=66BCU|zXXZ#4g7=M{TaP`Yxn8& z27Z#S#}a9~SSIrk5MliTOz$4gd^oc|Gt-Y1xA;f1im*Gof%ox)YrZ;}<=`1cLR7;l zr?<00|4IJi$qdOYWImBOlVPlDrHPsT6-K&8lSa}nOd_0~?ff=7Zp0cIDmH!e-J%~W z6>API;QISi4ljg^B`*+6&8>xgXfL|1wM2_+m%WOE9JiwjO)mruX>Ny68OJ9Ev>^s( zhS&vtgd4`jlxA$zAMfIZK9Is#fBU>8NKbP~;%WV@M@@}mIhR#m!ij103&A&WW=Y*A zF2uTzC3J7yru!?QI{@V!`oA<%9>}LTIZx|PJi>+1&npXt{?4POApLFG&zCP)#>RB7 zksUGk&W^}l5!Q_^NcW_Ngyw5Xvq%4ijPS3J5AT6xFdfZ&PKF%^}m6A@s9j{_N_beHxjqq^p3MrXPej+aLGO8 zO&`|(skLbP^-5zEvQsMI z+hr9-wc)Npb?~{f=!L6r-jz|M)AaUu!YE+zOW*Q)M*AgDzR0x4>iw%tP;ZHpY1%r* zocfq^OD5pCB7)}rxLG9ye9D#iGP&%n#9*7z9I1~iSJ0j(L{!`*jiT{zf4W+H&XG$zc+$(Wh;$ewLC7zH-Ck?HG*cTwZ(b9NFl8(cI>Ye;- zCPciZJ->4BEVF{$VAUQfi357oFQvQ>DVF!BKXbiju#YFlQLdahxgd81(#20!9 zPUt~y7qKuF{vkgq$76)ho0j8`5mJ0sc%c?KC14c9xTJdc#*LWx(q>jE44Fj)t25V= zRDAZxjPIbTyzd~Z?6(51nk;YGmo=T>QZXlns)`dNS-uI1s9R}~iq)d;Y7ZZn37HE1 zyYQHW|3oZ0Yy46x!r|~98s!JJM&t{r(YhxammSO|(uq;!)d;ALYvblKT*3 zI{lKKYRc~<2uZp7FkVe=p+k=HMZE!|+rEJt9ddLpQ7)>c{5}POniKKP;`bu*R5iu> z0tl4W2PI=0UiF^^lk%G4r1~NJ3VuolUA7Aax;a5m-S2eB-G^GRNI^Cw_Z-Gazu&_d zY=TC9sXUb57tmKa=(4l0M>VCI;{6bWq`lw3-XLgXkKQemy{qUe9dy}c*dsaB6z^pa zlJ?$!y@Q~UJ#^dleviJ=L6=>Hy|Zc)61-Q@Pud&B0c3(k_UP|N72oUVC+&^m`!U%R z?}n5cl1!32l@KI3A&ZC7A@-Ayn@h-%UuyrxFB#t{#CH%hijUqtRD8WKhT3R?B-*R6 zN421u@6L;fB_TWPJRJDd7+l9?~lRB~~d$dMLxl2&qu9)Dd?tcNg Cy;-UN diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1968463158/plib_nvic.o.d b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1968463158/plib_nvic.o.d deleted file mode 100644 index 94c5a60ba..000000000 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/1968463158/plib_nvic.o.d +++ /dev/null @@ -1,215 +0,0 @@ -build/luos_bootloader/production/_ext/1968463158/plib_nvic.o: \ - ../src/config/luos_bootloader/peripheral/nvic/plib_nvic.c \ - ../src/config/luos_bootloader/device.h \ - ../src/packs/ATSAMD21J18A_DFP/samd21j18a.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/component/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/component/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/component/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/component/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/component/port.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sercom.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/port.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc6.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc7.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h \ - ../src/config/luos_bootloader/device_cache.h \ - ../src/config/luos_bootloader/device.h \ - ../src/config/luos_bootloader/toolchain_specifics.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/config/luos_bootloader/peripheral/nvic/plib_nvic.h - -../src/config/luos_bootloader/device.h: - -../src/packs/ATSAMD21J18A_DFP/samd21j18a.h: - -../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/ac.h: - -../src/packs/ATSAMD21J18A_DFP/component/adc.h: - -../src/packs/ATSAMD21J18A_DFP/component/dac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/component/eic.h: - -../src/packs/ATSAMD21J18A_DFP/component/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/component/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h: - -../src/packs/ATSAMD21J18A_DFP/component/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/component/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/pac.h: - -../src/packs/ATSAMD21J18A_DFP/component/pm.h: - -../src/packs/ATSAMD21J18A_DFP/component/port.h: - -../src/packs/ATSAMD21J18A_DFP/component/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/component/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/component/sercom.h: - -../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/tc.h: - -../src/packs/ATSAMD21J18A_DFP/component/tcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/usb.h: - -../src/packs/ATSAMD21J18A_DFP/component/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/adc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/instance/eic.h: - -../src/packs/ATSAMD21J18A_DFP/instance/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/instance/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/instance/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/instance/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pm.h: - -../src/packs/ATSAMD21J18A_DFP/instance/port.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc6.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc7.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/usb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h: - -../src/config/luos_bootloader/device_cache.h: - -../src/config/luos_bootloader/device.h: - -../src/config/luos_bootloader/toolchain_specifics.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/config/luos_bootloader/peripheral/nvic/plib_nvic.h: diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/901117036/plib_evsys.o b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/901117036/plib_evsys.o deleted file mode 100644 index c3a89dd3486f219d1cf0157d45b1169094a96310..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3052 zcmcIm&2Jl35TEC@V>fX^lcu523T>sL2GQNMlQd0I1?r?pRFsq`X&|UZ*4y>7z3F~w zcb%qC#0{ZvFB~|~D+dI<@+a_5@CR_=%%RNehqF#X_>dUsdFIV;c4pqp`|#&0>#K}0 zNQuED9L)fpmLjAu6R}B{fQ#U*J(d7+ktWa9?(fLU)m!qMI;~dasY-ReGFP3KAJ(=u zG-2za*%VD>R?&U#7#-Oc`(|LejyyFpeQSFDV_C6Vmdith>*iwMwn9`GuG2ExN|T3N zX_=N-Twc&NeYfp%TVBO^plz6j?;0J`(>6BOYfHP@{!R5}Mf14vC<|`aHttSU8+TVX zwP|%mtyX8XfZNTfD%TE-=_#%DAhvj~I#<);s9m3jn4U_(F%=KPh#+wN#jGs?&6f8+ zq(zJOx{HSEhvGo7E1uO2P#1Q(wvPNnrMPc&7P)Wl&jyMuD{WbMzbY%OR@X6T6-po? zjy_sZH8XR^RSeg*u@g!QWh-={tg2ez8%ZTJtLp|0-E~9kPgD4sCw$ZE2%lS;*bklr znrE4MBN9~umKW+ff$)R6V;Zhi|Iqax1=tT!ugo;iuD*`m>MIA__OO947S!Vg z>|z)1-Cwy|U+RUcw@lxD%zaTmmPaFQ;a+u)tGns8?eQEN2+X!4nzGU1KIB-b>+~sd zg`k7wl}#svT&@^TdNz?ZU$9)K9b4p!k=$=kiVcpeO0m@`rujnbvUtoxKC*4PUELCt zWt6SNRzBGNXuEOGF+-DE<|hJ}G7ud{I&Hbn@MyA8_GanAkW{){+8G#STkQM*BG+JO z=p9r7NGiNrmP!jlw}wXzd}BuO68+p`ibYgY2SPg)e>xx75igk z81SB;TyU^|w^IQ6whB2ZFepT^C527oa9Ir2mX{ag$==bH>4?hv(`u#i)_=TQFb=Kz zB@%<&(~UY7ciRoqX}PDU zxvt|wa~goJP+J72Ab$y1rXx9oQZffMcw&cKM;`hy@1zpG86iY37pQs=fJzGWM3Sm6tZexb zIjLC&aeSIOM>&nVj52Nw zxPyae6Z=nR7Tb%bJMKN@wT&bF21WP@ecdJ@p%fE1Pi2CBLpzy-gi?&-JRA2Q*>@C| z;?bTXet;wW21O_%kUh02M)yG0-& z(fytJdxmoQ4T^9`K!#H6IqFERBpBH}IA%xq4>;0q2>uoAWD*ie-G7hsY<}Nm)=Tvv zJIeQG9M}R6Sxnee+CwR&v505)(G9foP&tnJ2^{2){8CKx*Q0Oo0KDkUj&i4WA#3*| K=J(4fc7FmTU=G0m diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/901117036/plib_evsys.o.d b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/901117036/plib_evsys.o.d deleted file mode 100644 index 4c7f38a56..000000000 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/901117036/plib_evsys.o.d +++ /dev/null @@ -1,218 +0,0 @@ -build/luos_bootloader/production/_ext/901117036/plib_evsys.o: \ - ../src/config/luos_bootloader/peripheral/evsys/plib_evsys.c \ - ../src/config/luos_bootloader/peripheral/evsys/plib_evsys.h \ - ../src/config/luos_bootloader/device.h \ - ../src/packs/ATSAMD21J18A_DFP/samd21j18a.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/component/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/component/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/component/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/component/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/component/port.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sercom.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/port.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc6.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc7.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h \ - ../src/config/luos_bootloader/device_cache.h \ - ../src/config/luos_bootloader/device.h \ - ../src/config/luos_bootloader/toolchain_specifics.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/config/luos_bootloader/interrupts.h - -../src/config/luos_bootloader/peripheral/evsys/plib_evsys.h: - -../src/config/luos_bootloader/device.h: - -../src/packs/ATSAMD21J18A_DFP/samd21j18a.h: - -../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/ac.h: - -../src/packs/ATSAMD21J18A_DFP/component/adc.h: - -../src/packs/ATSAMD21J18A_DFP/component/dac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/component/eic.h: - -../src/packs/ATSAMD21J18A_DFP/component/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/component/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h: - -../src/packs/ATSAMD21J18A_DFP/component/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/component/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/pac.h: - -../src/packs/ATSAMD21J18A_DFP/component/pm.h: - -../src/packs/ATSAMD21J18A_DFP/component/port.h: - -../src/packs/ATSAMD21J18A_DFP/component/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/component/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/component/sercom.h: - -../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/tc.h: - -../src/packs/ATSAMD21J18A_DFP/component/tcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/usb.h: - -../src/packs/ATSAMD21J18A_DFP/component/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/adc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/instance/eic.h: - -../src/packs/ATSAMD21J18A_DFP/instance/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/instance/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/instance/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/instance/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pm.h: - -../src/packs/ATSAMD21J18A_DFP/instance/port.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc6.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc7.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/usb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h: - -../src/config/luos_bootloader/device_cache.h: - -../src/config/luos_bootloader/device.h: - -../src/config/luos_bootloader/toolchain_specifics.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/config/luos_bootloader/interrupts.h: diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/903266522/plib_clock.o b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/903266522/plib_clock.o deleted file mode 100644 index 2ddb288613049b72492ea65c3d4b13ca378428f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5796 zcmcH-TWlOx^~}uP^~Sq){7ULLO*@X=W=p%fUfW4*Q>V7q4;-%(1XL|TMZDUNA|4V*d_;T{S_JePJ}5|h6a*irqNPotz{4LAVa~t--;^jK>~+aQLCr zW1k#?o{^uI!wYXeJFqrXezg0J_uTkw|JwfYY= z$)oyId?KFI$H$V>V^hg#{hs;F^@Lf=o5iA8j2(&PEu&s2>y~-8Vpke$X90VM#(`zp;0eYc49@tF=C}k)tpVuBsQ$Zj%C#JW#sL|dZl1B3gt>O zvA&U>UpSpOdpLf0EYUOyXZ*^{{QBZ}GPk(Ak(h{2#*@h-3EQX@$CF0lTw!87F~8+n z98XToC){3Jmf>J}aq1jXX<|2~Z8xl0zbz_?rRM)3EgF2YHCt#{j(ILt8*5fuHp-lG ztCmN6#Y`Dip*(9?wX;X;SWS=Z=&_SYJyt5U>IE7_%r-g37$rWNKEB?F6&ke~u0*Va zbk%7w3uD+ zy33X-R_()vWo9qSBj+yReaR^!ej0Z|JE%&~uI$v!qFyK)7HGL#t5SESat^4s4*mdZ zR#if+y5B@qnO(*S*U?VeCy$WB^u7z^pmw-=&y5V#0IN3YJAS8$adJAjZ&*X8KnGX1 z`-EH{&ruDzR#!0%Ft?YEwg{RWj5gT+ZOkoj4*O!C#s}B%w6)QJ=ScOal=8f^v4L(B z1inQMPvJui1$ei`Mk`-6A@~T&euu52OiEzCKolUsr3beO284|Q>~&I;;IaodOh`iw z*o|aEf>0#z`&~~Wv1=ujUdyGnHq#JzF-jv)M}#o5HNUl;fxsW4l#@E52;20UYyML7 z>s+q7@|C3%uKeXFAJ<60lP|8Gg1`kK4uQ5)sGiAL=1#?Suu^fg0 zbO%5LfL)Nfkf+)(ug!d7d=1#E(qq8$7zg&68tvg8 zdp!?~&mI0O(;D=vw$mG2`xjL##`Rvf31EL!qc8A$5BPni)`9&^M$AzxgsS z&_vD5d5XmicUIL5le+-43CZSSb??=9e=-w|24QIZC%rsI-;-H)29Y;c? z$KBYJB7;6UB*xm($aE=6KUG+pbONQ6%s>IN&8HfMWn;?6y6AXxWy_U1O6I!hRD?cn zm-_}7!x*6SDmR7t!&+#6Xgk=eY$`oC6m=BB;bSPoV|FiSp_%Y|!_(o_emv6-10i-Z zM?pnd?N^ZR7)Cx3#^bJE35Q*ClJDyBc~5oX!6Wo+I!yYo&?CFrPx^@Hjtc;~;>sNn z+5e$PuhOT?b$)3fLcZMxAlbjEe19QK;?v=~!gpc_`Y~~RaU6K&hiUyYc1Y!>IN_!Bw zQEXv|(5*7qc~KjBf&@2X3xO>p#6_`npoE(cL-o<-hdhVt@yQDj0z%?uAQ>DaccvsM zGe7wGJ`AEk6mwOTx4OFk@8y&?Hsyc2A3C}D;3S$GTOG|TnFo-CqP2P@@ z4J7xlQ7%cdLBzM{s2o9ZH|r#Fk{v?ntj_imH_UpuZDIh$J#0v4-8x%4$Zpcvs?J8p zWQ^UyP1<6(Jsi8Thd6p@g9@h7;HezozQ@=e5o3?cL+iVp4Wm$*Wxd*#uB#EO0a!_; zX7s4{;i1zC>U;%nd6%C)IAIZN7ZDUtALx#Bah@iUfNFC7R(u#Hej9-@j3hgfiLFC0 z(y_iv=?e@fdz9;NNc)r_duM$J7O$!ARFk;$yjI99gH8G%37|jhr;90ev|P&g|zfR5{eivN`wHZ`vmg-c+X(GF_ck$ zv|nVruOKabkc5XZ-d?%*KHV3P_Q!h_q v8ekFazKTLTMqnQ{ir0gU`jj<~Bs{+x;HN|gknu2`HoFie^($$FSlay?D5Cn0 diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/903266522/plib_clock.o.d b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/903266522/plib_clock.o.d deleted file mode 100644 index 0ee3cbb7d..000000000 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/build/luos_bootloader/production/_ext/903266522/plib_clock.o.d +++ /dev/null @@ -1,218 +0,0 @@ -build/luos_bootloader/production/_ext/903266522/plib_clock.o: \ - ../src/config/luos_bootloader/peripheral/clock/plib_clock.c \ - ../src/config/luos_bootloader/peripheral/clock/plib_clock.h \ - ../src/config/luos_bootloader/device.h \ - ../src/packs/ATSAMD21J18A_DFP/samd21j18a.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/component/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/component/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/component/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/component/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pac.h \ - ../src/packs/ATSAMD21J18A_DFP/component/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/component/port.h \ - ../src/packs/ATSAMD21J18A_DFP/component/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sercom.h \ - ../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/tcc.h \ - ../src/packs/ATSAMD21J18A_DFP/component/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/component/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/adc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dmac.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/dsu.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/eic.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/evsys.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/gclk.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/i2s.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/mtb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pac2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/pm.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/port.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/ptc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/rtc.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc3.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc4.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc5.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc6.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tc7.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/usb.h \ - ../src/packs/ATSAMD21J18A_DFP/instance/wdt.h \ - ../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h \ - ../src/config/luos_bootloader/device_cache.h \ - ../src/config/luos_bootloader/device.h \ - ../src/config/luos_bootloader/toolchain_specifics.h \ - ../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h \ - ../src/config/luos_bootloader/interrupts.h - -../src/config/luos_bootloader/peripheral/clock/plib_clock.h: - -../src/config/luos_bootloader/device.h: - -../src/packs/ATSAMD21J18A_DFP/samd21j18a.h: - -../src/packs/CMSIS/CMSIS/Core/Include/core_cm0plus.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_version.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_gcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/ac.h: - -../src/packs/ATSAMD21J18A_DFP/component/adc.h: - -../src/packs/ATSAMD21J18A_DFP/component/dac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/component/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/component/eic.h: - -../src/packs/ATSAMD21J18A_DFP/component/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/component/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/component/hmatrixb.h: - -../src/packs/ATSAMD21J18A_DFP/component/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/component/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/component/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/pac.h: - -../src/packs/ATSAMD21J18A_DFP/component/pm.h: - -../src/packs/ATSAMD21J18A_DFP/component/port.h: - -../src/packs/ATSAMD21J18A_DFP/component/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/component/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/component/sercom.h: - -../src/packs/ATSAMD21J18A_DFP/component/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/component/tc.h: - -../src/packs/ATSAMD21J18A_DFP/component/tcc.h: - -../src/packs/ATSAMD21J18A_DFP/component/usb.h: - -../src/packs/ATSAMD21J18A_DFP/component/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/adc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dmac.h: - -../src/packs/ATSAMD21J18A_DFP/instance/dsu.h: - -../src/packs/ATSAMD21J18A_DFP/instance/eic.h: - -../src/packs/ATSAMD21J18A_DFP/instance/evsys.h: - -../src/packs/ATSAMD21J18A_DFP/instance/gclk.h: - -../src/packs/ATSAMD21J18A_DFP/instance/i2s.h: - -../src/packs/ATSAMD21J18A_DFP/instance/mtb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/nvmctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pac2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/pm.h: - -../src/packs/ATSAMD21J18A_DFP/instance/port.h: - -../src/packs/ATSAMD21J18A_DFP/instance/ptc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/rtc.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sbmatrix.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sercom5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/sysctrl.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc3.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc4.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc5.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc6.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tc7.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc0.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc1.h: - -../src/packs/ATSAMD21J18A_DFP/instance/tcc2.h: - -../src/packs/ATSAMD21J18A_DFP/instance/usb.h: - -../src/packs/ATSAMD21J18A_DFP/instance/wdt.h: - -../src/packs/ATSAMD21J18A_DFP/pio/samd21j18a.h: - -../src/config/luos_bootloader/device_cache.h: - -../src/config/luos_bootloader/device.h: - -../src/config/luos_bootloader/toolchain_specifics.h: - -../src/packs/CMSIS/CMSIS/Core/Include/cmsis_compiler.h: - -../src/config/luos_bootloader/interrupts.h: diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.elf b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.elf deleted file mode 100644 index 900ecefcde6e7dedf2e2a2f19cdc0f6c71818f8e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 568472 zcmeFadw5e-x<9`5PMWr9>6J?^ZAp_B+NMCE+)+%EvY`ziHyvmZQ$P(D#~_NSj1s_0 z5p{ri=>-)j&WLrCDb~?ZMn;@7I*y*57Ur}RofMQk>Nsx4nQ7Xj&G)l*E(D!(zUPnM z^ZcIQ^V@x%oxS#6mv^ntde>U-`>uEG?pm;zV;F`+|5#E)=+lEc2$_yMU!Oz>OA@9N z14%^O0;ZCtcJWBX(|BA+Azez`=@l+5{EJ7@6S)%T17c}R4}PQXdmh3wuK0LjVF|H# zq$^r(e7q9zO2kVS%A;xG;|WpV4KYM6DPBe2MCdCKk30r?HD(j?I<9EEluZ7S5s(p( z5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p( z5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p( z5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p( z5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p( z5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p( z5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p( z5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p( z5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p( z5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p( z5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5s(p(5%~WZ0^%-WcyI?HHbasllD4J z>u9y>9CMXfsRt3)s(HFP+i{@!MXnJkI{F{QyJ}8VLVAALpJ*&5&76iLi5Ww*p4)~N zafxL#XX4y1a+Ab_A%$@&v2aNu8CuDqJ^b_iwH!ga@-EuAo}8oOzs*S!|2|k*c`1)+ z(Yf04#;M1p5 zYWrc7eItIA-Ph!YrrwAWZW&q*s_kg^*?vlg8Cqh`bN)m3a5Hj;8ry@D(f5Ww+-zu8+}~FVVRsM&}yPnL0EpLgy{1oR0>}V|0E$I1hBD zMCiOB#h)6S2|6V)I-L@osh~4cqC>pr`U^>cL@7T;$p}ip!JG)C=cSUG1~oBChXxIx zG&(}*St-6@P!CG!F-o36Vt563Jlj78)LQ$~DbKpn!O1GS#!1B22T2j}9=kk{uL8B- z4L*1IrEFr@h%0#%G2E3x47Vf@asqRL1MiNf6T?>Aow$+^@5cQuTrc7>WD&#DDngoZ zy_iW1FC*<6s7DjmWMz8xTaCT1eBoI96b*spjFdemEy?KwBz~b_9pJ>%e0@y42BFdq>+|^P+9-8)mhF1+ySeu_Zb?p zs(PMSVCu3gAU)>(gH~-3Y2YIklS?-wQ0n=C#oB(G96E1tkhk8VnJ%x<5JFx zy_N+6>hgIvrPJ>Z85oJq1%!e=`tH9F8t{RKy5>lA`AImdnOUQG)RWne%viYhm(lwgjiRZ+khfp* zTHyVbb$l14{uBRdJbk5W=4kG_{VTyatMI19n%hg`xB8dj&Gnd_{!1Dy8~txC_-$8} zJ=gIYfyS@(FG9STJXIblZ;h0)!rv#wE%jfAl4#6z)#IFhmhxBnKNUXC|A1VFnzZ;| z5a{f&9ni6yb3?#$O`EW%^Cu%a!E6PKr_bb&*`UNUlV2C}cxiqWG`Sn5%LnieHD;NHJf8 zMn!Usiskxq=%&jdL&Aw`-af!Jb4R&$PCP{n{}L)NYx9@Cx*Qz?bga;E6CEGdVjR$M zL&p;x3v@jB{AzLetDgMQs1+q1j+Hhk^u_|F>nY4oPej^H_^*8{ zIcYBMy76KyLbT1xFJgt0#s%@(FFqa#EBXCWNNra33iE%Z^iU*r98U^7m^t>? zn>mWmz{qVmpOFBmth80CK2*I&QTTe~?G8IfOFnG7~ zo*U!JdwsYYz4#cg{V7t@QBL?j`{p_6*#6u{`TU~KCUGN`ye{~{oC)skc_6}*N^dv# zd>88T*Wq1}cVofl_hBa3X%E+B?=WqVXLv(S3t7&sSbdDFUv{_yBT3@&ue-O!xH`Mx zj>WA6a=~)S&9@Clxw!xwHkCiheV>=>K=;J(x(E(=QV%X3u8G58!7%0J8zVUAr4;jq zscg194u@$H4piD&A@LZc73St8F>dBS>)v5ogjRx7(%50T-b67^AEw+q?s)=S(3*D*tkDB1(+%a~RDF!AvQxCpaD@Q*O+QEB&M3 zm>5Uvgq-Vjm~Wc7F+%R*i6j@{F_?QykV|vA=V2bx_e6U)g=fWCBX%y#1z*SJ`oDk{ z@r4Xm)*L_9oB_Q3r$Bi*%Ey$qqq0|&m!q;5U3cPjpASxuSCu4>cxU~|dOe$Mv+~5i zg4cIkOcdRNl=`nV=QQ8uvc@9R=l20~1Edph{KLL3@H8vnl-4^qg(~&;22v2*X&MKMxXkmI#zM}H2XTVu4MHZ7c=cp2iB2>M(c$hEm_1R zh;u>*B+6ZyJ@c}+HM-OD_uH8K6kDU~m+s``@7#JO#inO68q)I_ONuSqvxVE~cx6dR z12b)`X{9Z(yf3MbZ05Rk&v1X?62*)lL!7w(WXRk=%y;snkTD#?2pnr_;hsmYb2+bf z6f;%&eWXgerg9~>+GeSQoH)eH_(ewK$PO? z&`#$wShGIuztU5xxjGMB?TC364}?t3T*IP=flz|)N=r+6qj+i8HgIQRc-_Jk$Kgev z!gy)j4O|pc`j#o~;j1`yY79fuVXnXOV?j$8LxR{mvQA(oydaD>VM7?fotJRip;v z`;ovGLX<~BG#!6Se|Gu2?Qh+iZfvx@b!R>)o0>W|-Q?FKimweROgpy|(_7m++*wj@ zWuv#|>`OPQE!nntyOT_V8Us;@#sD!``>!r_ZvW`GQd8$%Qxz`rk^g0xe(0{6@0FR+ zpBZ1~|5&$tXkGc3S@JQ13~o18PZ)|)%rGl@GmLj`BgT$xCv&Hgu~S(eQ{HUN z}g4x;I#XO!$OjZ<0L-{nCm-6e>NQQsJ)q(OacwMR= zP5W$Io+EK#WfC#CXhQtGkNlc&kgP_UXd5gDN9%VqE^iXT8IknI;@+=CIGR@zmxkI! zqVMUt91T0;!c-@WzNhQ+vPk(<4vn^%+E$_%x#H5(b^Xam1eIB%c+qt~nwQE1(ej^0 zI9d*sYmY=|QF$Pm-W`|zjrjC&X0#D!mr3l||AVM+26groKOBls5PTIuig zxb$x#9IdA(F8w03(GW@Rj0-o!g&&Bdr}-BFPkK2Jj+RIB(e#UO;r0Kcf2rW*tsq2c z+5Rsj|9?IHz6S|;aBsMgqi=wn|6xL=|1Yl4Reuz#ij}r1807!kzyDi2Aq{an@@QNb zMaFpTz}4?1YDWCII$`mEeSR+gwxlho%^VMlJ#5WyMl8^8RK2lCDJ}@TCdE_xbq7}I z*ChKj{Z(|ItU7@d(?ji&jrx~WNzRw5sFj*p>4^8X{ug3)x_0Dj$@3Wsu$pbfJ8GR% ziQEXaqHlq&g$r~hfzEn~PF;-7O`!Am2(^c_Tkr0oRLmo5V^j(e);X!gvc5+MCB8YlO^WLrrZQlBu9t@&lww{S&W+^K#Bx15+#toZ3}=5Y*TLb#Qp{t+8IfEm zv0QtHpA+bsLe~kpZmhuMPi-GjJ#i(T>3T)irdbHnH6*G#()A}5Jx9EamkSBij@jj|md?UHp_B`!f*qqr^{rq-Z|s7KhgtPl`BFt!TR`2DII@y|nGrPUOU$V&(7rm|MtsIul6)_f}*?mO*P(i5G&ulAe0Luu^`zI>G(Qzd$W`y#nV@ejvlh0KNre_+Q{iJOCaBD2G8I~})le(*?rzbn@F z^{7!t@F!@)mHA<5&>idjMZs<8{ksr;Z}*x zEipPbgUT#Ux0z;&Qum1u+6K?C{ zf$;qBNMP*ua_tU;=ZE_OsgYc1v0U2&&k3nj3BceFfu}B?=BO-6$3GqW(ma8Cyp5EO z87fcyNkPa&so#iqA7+O_303+Vwm+Lt;`0HzFB6>|<_E^dP@Nsf1y;1~(b-{&)S_{* zdQAkXqBM*7aURYps)QWLsPJ=@U1d!!D(iW+SXE>h|9oD7tW}<9in-xt7;N)W*N(sjdR=yMrD&qR1V#rLyBg3OPt**<++t6 z)$v-5Az$mtPK-X8@ifm}VxG*;CnR5O_{urWeNRr=+~ktmdP(sFZ>jG#sWmKG)9QR$ z*eE?cfu}y_0fE+1Ar1#f(Gxsluvl|Xh^LrYPYKG_66a|hW7-Q#irF!Xye=gD5pC@I z%AxetTEB9zCi=eIJ=vV--45z=yh(p#XA<+YzAcXG>!-SlW+{xbiAp?%J!KVdF`d@$ zwUjuSnKYO6`t3Qh$yE2s2`Xc0nX<8X2V|E)^ZlxqUe|1b-@xpi)#iJ6Qx8SzYu}0q z^nJODG5ynLgLSS|GoL&rFs54T2LdoO=m;}&i(@Kn^PJ>jMK3Y`hTrUXTd>*~(+Z^h zR@h*k$Zs^C_ZoB6tqF$;oH|wMx%}%%DSLjBX`{8=r7m3S+YVZ9`jUF?FdKQ7`8}_} zRN|y{Rru~UYk9Z%E$Czc=NMzQmF34z%eJW-GYUzm0`*e2wAj>#u24*AO$Fa7`jkd>^Ff>XASq4ou9V6e zOX!|)IAtE8HV}oF=HI!NnP2XD!8*S;X;PY(F{)d$t!h4{Rn?f*n%J1wqH2Yo#)UEy zO%=}Ds!uqa)>v#$eu*@ykF%|mW2`}2P8OfmI*o++{KB9uN6iD@#@56cXOmk-p%ijH zo7Ci#dFlA6RgrTaUrulO_;QV^5$!)HC`qSauIm;of86XO`DNgh$Ni*;;XQh%BL(H8 zHLetj(GJ>+iYB%hdyAma!!t8RwI;WKj_w)j-}=Av~hteD8VD9?*9_r`w zC+>QV<4$+}>;y3tHWoCh#Kgg~m={j#y6v^~P1sva5GRA{(_wX=?k5G*vizS|O?UfL z;@|xrNGU(Cuio~R0LyAV3tP{Z2tDT`6Wee-@B2;udzjnG2h)AC>vzJUt+2gOPm~Iq zzn-WxHk);Ig~fWhgA^6>^Xl)FY*TO5>y}x>(7H+cb8TTaRWXZN%ZhOvp$vcjDNB0hSM{}1wq}jst<`Pqi zi+w5EL+x|#4U?iQFALfU;#ssO)yuZ)8n$qK^;$?;H3AK_lH002#LfbA1V1DK*uIJP z_dZhSSeorKGqw6wQmehG`U!4BWofxi+Mmd_m3gU!9r8c}KZEt>C7-f+4a?IL@tMn@)3Bl(%GX4 z=4`u1G-g{cf7tfBN=zx+a_4QKJ3FYaqTVX;<6em$&q(~3$VY3CR_)QS$D0-=h7sVdw_GI6?^*>pdKKh=*|_5E%F};L(0|K93cJQJ;Y5xk z)gFbP1WoJjw6V47^W;;mk*j7`s26Yt;Eneqt`h!u)np;LF6}dtmG(S$n43?2m;OQe z+qzH*@!sQO412g`T!rN^aG%FVN|%2^N(jFlyP>rIKk+fwkkWKMG=+Fy@G&NRY4Qbw zv5L#mAGFvxHMwM2p7%&awyg#`H8l)5d)n8^98RWOwrS8r5@zqUJY*%GyytsJuY;Jw z%>29MA^l0q+Pt<3G6A^~m3+EUXHkNpvYh5`^D#3AIzp3)_va|7R=t`HC0Nv7C(gDN z*{<59E4|)3QgCn1XzY(Q`)W8ch47>wHTQn&tL8|_Mc&Ru>%{ic@F>!%BNKinEaC_} zvGxj&S(o#q^!z8GDRX#_shaD<404crOdzETfWTa|cv9T^|Gwq5l{L(QbIi=p$yHfwyhR@7n=C6 zKv6gG6!W`KgEL;tk)<=dBgXr4rlF<#q?X?9rR{8!+DW{(3$>UR$b=e(J$HRIqyS4z zBH>pGeMyJ8(Bu#K4IC|dpks{?nn+AH3S9L}UACnHlxn!Mx(&=7XQ6-cg_!FJ;yJ;q zCsRuKP{}V)x79#JW82H2^~FgSYB@u}YVJczovy)Bk=Ib6u-Plel3hZm4G7@mRrqTvZU&dMABAqW66iQzh0(jB=gK1Qv7F7@dAl@sRgyddr0wuK-+eQ zK>Lt*w+bF(mm(XSc^f>NaOXD&qsV)lL&8bNk0Lhi>&v0Z2YHG?ZPIS!?)Op*zw&xa zq_9sBn)u0OJNo{x?zPKg0yvt#gSOPvg|}-!uU6M~*~Wc{wGF1U`)~#Pok}u_oQ(OP z{t`Q9lZIc7_@E|;`-fkVY+PuAAwhg#7*;6glp#Z#HKWIW>gSTh>F3D(bJ(GV2Y!ut z_e*{t|Aj>g@ejkF3ztY6EMaZXoXw7Bq@0lFyIQ1B)UT!mXkyX?hdpXawO?t%9yJMKG|e@`SV<%ucNG6%oF4kn5A@Ikal-Hq_0S!X zmT`Yf%eV)1`SCE-GpQc>5bRJ1qI%dB(K8Z6Yr4Hqx%%pPDAz3sGklU2fv7o0?Gd@a6C2&l7jHyfu%P*3Yg%}B(4i# zS2@G$KlQvc3XUT8QE3#+g2X{b!E?ZWVeoSS))%MA@$`~**a;3xR^P)_O^BNld_pRR z`rt%8(8BiFgNQ8&!pB_tu2?{G^N#%NHEe>`B3XoNZ59Js>q zg_7+hp5t>Q+skyM5A*A2pi4P^w8Zh$HwWWCP>T48gnBqqFSZ1c3G9$!hKHzqlKPfX zjt}GT-O#;K+&4qiqbEMsP?h7L$^XNNNJE}r8*913&%?}wtc z*ee`=YKU_DZ!X94JGINk^Lv!Xcf-Cyc|K~3jrSSd%N>t!nvxH5wi75nITvtj7*2(3~4{usYzHtdH7bJznii)qy~Nx7E{y%@1OHd#}<%*+a|d9@n; z8FqNnK!#ZGD`;?Ecl=ejFT&kFkvNaq7wOIe+kJ(@x1%L{hVB8jbY9;lac~|^3xuu9 z38H3bE4Yu^5-Ep==l!&y+c3v$#=9_YsD`LrZaw%fd|F^K=+K=9w)+Z?uK}H#9>0FBu(8qZ5KsMp$6GA4TGiNVQ870-YB2dV8a zL40_STHC3=badY#LA-D9ZYi#Q@albs1kpA4h!nGRaBL)3bl)LCTt65d2kQo}-gih4 zZy0=D%C&qjIg%^7?~oua96Tn_z2=M9T&MFmwHZd|@Tg6W&heDL<9T}zM+#m5pS}Pd zj&dUDnb&`bRCBGXS1w?As-=D_z~54uMZYhd(0Tfn!LW34*gCdrB57QD5S~~RlVSgT zIf1KeU-uc30@G@-;{S8yGfJ&#I^72XR4H7S}@LOV37W=R8@=A%9ZT=acLU}n%Wge)I z?o43{=%h*9GfndOpAt7;7yH9}TIipEymY>%KL6qTdVjr?Yn8}A;|QI`6iSS$whtsX)dMsdFVwUe#Av>FM2dC*H(TU8B3P?9*({<7x3NtTRT|HzZLFe zCeyaxI)^8wT}w9>%p&w8$+X%-9WB<(UJW@c`kSlQrdHde8P$db;9o!en_8q zcL>%0Z4IQ zpC~s9XywqotD=?bcP8L6zb!;c*acOZ)IF(4gK2E!GthjibZU zKqIQQFa|I0$m--5I>K$8*|OEj&=4N z52a%yYhf$D8+*{X4KKr@vhMo%4eJ(_X^iB?Dy6t7_%rQ%PpSS#NS%$+-wFPwa06r+ zO~VaKJ=&$$mykKA=Z!&6;Us4H;%RhW#;Fh|51O1MspkXXO1;a!hfo<1qV=Y}8oHn-e>(Kt zY1PRL^hf__)bPi_`vq3~Xn2ZU;~Hn$%t@Z`#zq^p9&hFvUE}S#hAd_ar)@|#QL7@0sHWMXZ`egV!eEMDZyuc-Ne?6;B&%>qN5hNPO)M6aW#*m{zZ zHMdSpc7M>3Xi!+R6(1&&vkwa?zUwefk`t0gWw?n{io%A|iM$6rx^d_}p|2jEFZ?d4 zr%KRMFGCtrieCRTI-+(c(0_HXK`F(wfKq&KNath4{Gi!xu5NMc6DH6!o($i_>g=5v zIBAi+JuD$HW;GuUsjvgfib=sd`*`GV#jT*aDyQ+0nl934{o)ffapo^at7@fo^d_y) z+&V4G-PMtppJLHfbSL(lQ~S~=-(tOGfCXKH=}8qY-QOSj7<(7gr*Kf^DId{Y#6NMB>;iJSvw_>Fo|N|cbTX-m4^6rr_T&WDiCQkX~D1y2Dn zeWnN*e<^rOeTp3G0zS`b^OoDzvK!SlE@XT`Fr*eJ^HbBwwA7i(nW^{KmfJYnGTT1w z+|(7Cr>u%zPkt5Kz*#DP zHV3z>j1=iUSugF*7{j|W(~XScoP*1$_LPmbj1)b7;TW?~{cgu?g2!-Lp|ov8UFMOH z@n(TBX6W=q&E%Ph z3Li7;osQpF%erTyr*81mIsFamKY04I)X$I%qw+JAi67s8X#5;wJaz1;^C18U>9-)ib(GiVR+y-Ar^CgYe(~fzw>Vj^lSn>hah&oaAIrq?UELi;3eW?!^C82bS^pR zQ;NUx!!CQrY27XMChNDo8!%7ao?o*{cN;UOX4RE5QLK3quQWS&y2dp5YO7Kt@4^%h z^C~gT+m>9ur4l%~h_S|XzS z;d8@zz8snl@j9%hI5mLtO`izkVrXrhwslVPs_{OBh>fzM08RiYjm(P*@!1dqPX}|* z^y0|CXVC4kyryT%P~yJ^m82YN_}?j_Uc11Wdw7NU&%CKAG?3#LghH&%r#ZSFypci( zJ+mN2{6hDh@L+F_Y208R-*64{nf@60Oj`%u|6J41!HPc%+BwY)3iTG3BDEd+<$rNm zxsq*J>do7%Toz7qy@Y#4+F!O!br;`Bic|R_l2pc+dOQBU_T5#aM9DK#Kj>h})6M_% zF0PL5!*^@eXy7k#r-^9Fo45m&8JIyVKyG~qo{0?_=CmecYGo;xqHK)x`5_ypb;Dzb zwAivq1x{ybO^w#pidt*6b$LaK&E_?cvhwLwweVcRxfscpAx!Jf+V{0ADVxT$=eft? z+~hjxx7D5PDzP)uvR!%V8(n#+Pr3AI-L9Q$t?;1G*|2(Jclr!YU1r;6P2UKAiNklA z)ZKTQ;4zTBy&!GXcC94u(6jRi<_SF*J14?64Dr-7ceIU}_&SGf2PvV5Xn@H1j&Ilg zb`>cGBGbAeh(yz>khTSgWbbGZ65zeah+9J4Lev+5`X#J^FY_|k9i#Rb6-gxru(z(| zNpUf6!yc@e{}E&z2;tbPzR~_Hc5(0X-B3+TbgpQ&=JOfk+OiI-foI7-g=Ki3?O5q( zbaXqi>y|*vh=%RpMe03Q>#MG+Mm;8mc%iCl5kkh$#{!L6>f@l15bt&$)=x6OYQ<_& zqVl$qy85HgWYo5~RW-}j*SAS$W2?DCWF}HHTIcjYM%vfVmE+ar(e(MK=Xm>9tDnQUj;~4>=CyL=XKT2XT%*OxjVJV;M_#qg?Rgbw z@ATDj$MmNvFt*RTspMoLhnPmjRD)FXZpEE67WwvA|Fbt5o7zf!IddF0IY<-Jthj1T zv2q4et8N8%-ckY8qndlfGLC?%ElTyhSSggZdig-&VXlt5Gf8dRnZ$8vzIH3)J!(zu zIi`E2f-w|mZ?7Qv%=`k)k_s|e#kX7k){7_lcCz0~slyLJy9u=~>@$-Zc*%5IO2|b^ z4yonFz_-ubH-X&D{l-#GCXj`=PlJ`Hxq=*E4jvZTtZ(*s1X^E`51$evImjGhjOQ)P zp}o@ER$U3IPl`YnsJPPkv`Vid7eVu^;%~xMX9&WI|6Tn_+)zv{v+XgGw#@ z*7ZoW*ZQrO#c58AteqK#z0eJ=>>DjwVLPw%SyJ&N8JUIQ6n(30PvZf~PcUXIxG7--I}&IjQ0sA#0JfZDjZQgNJl zk%6p7eJhnGT&EP`Z1@chdYR_^_x|BtI&-J&q%*gDC!M*gtEm>HbsvN^Y@rlRE;093 zR%g25bL{TJH-`#(t@hgcCI1-s4zn@)X3Cv;Kt92e1WF#!DmeCeMh>}=v z9@$E^USO3>mW8mG*!ywz8MFK`V1^A10&gxW=KN3+p2;Fop}~DO{s`+K$xw~hbV4#Z zt#(c1v-W4)we%C0Jnt}Mhz_%EopTZX<5p`t(y~2yYhn~ftd#QB)G`e?6_n@43o{nXj z`V&y!8EVgn*G1b-sEDn4D|C*&4#>-9cMmDt!rctd+a|8SckSZaO^gxe*Ts8=47Y7H zu?WwWQY*~s`D{tjW+*><7-KoLBbv&g8*O)$L5lCe80NgnNsD^ujy@eP8Su&v+XwM2 z4d@vP=o!?4$UtATar0a|U8KMOpMU7|iKFH5g9`B|Mt=aB(fiPf zClBq#NHh=CayW@lG}y~b|ExnHeubIL=S?X6v?mSnq@*c$6gWSiEIr!uw4erGcsf+R z9Q0cf&|5!r0&}YAs#QEJ&r?}`HM*M^ZAtsBcXcb0_gio7R;c$|E4vjb`>jRYiq!r1 z4p+#S%x3+XhS~0{tYr2Up2ljsi7#1w1|g>VL&a&`ii*8bc)t|3NnyJbrm30k6e)ZL zr6WBnrI*6{rLav3+odqA0n$t1kGjsFR>;9fIi&D@DQuI%b}3A2jvP|>4BCS9L`pA( z_e){gMyA^?g)4NVi{VyOWZ-L=A%W?ne0z3~rDM2wfZrjw77lbivM&JxIy>>Evvwyj zD=(yMg;aC_*4Ibu7u> zOiV>Y*!;%A=l9uiR9>?)*F3eSwEDcIJ8{xEV!{l#$>jJ@nQ+dQ!y=aIV2)erwoG=A z;`ezIsl*o`SZD%_n1ioaI5xb4b07Jei^v-bZ8^V_(!a~+g4$S|+nMZmRj`fP*EFwSKd}1Nasa&v_ z7{k$h7VvP}?tO^8P6In>qaZNEVjza-UlIL_K3ussWL*8HjQvI4S4e-%zxfL%uu6aI zzxku_2C(Y?yML~QV&{Kw1o8#tjge44)a&3?_9i43~zHaJ)?b9>i^^S6qEZJlXL?KrBr{WwI@m6r`oP8apY6D@#?}iiy z3?wx0yP-sK6p{iw+Rfu}`buTa;h96^fQ?hMx9U`hgSgxs=0+D}UGCPNy-zP6DypY^Kjx}9Ae>X|2DDf&nV z4XlRr@h5@mCv>fMbrn)#9kBQ%-AM)wEVwV6Zi<$|!uME^BVnT7~qqz@S~FUCT^h3i55*Rn2S5 z42-RLm0@v`$>h4#)#hT#FS#ac+pz5-G{f4YF8EmKq_YJ&$Y`+g7#N&gxe}Kh7snuO zfxw~>nHW8i~4TRb(H!d(KR#b zS4!7Ty2jFPW@MnPboYoAmyJw`SuGT1J)elPWQT%5w>3GJQ{lr zo~XxFO?`8HGGsnaNoG$?eXC>>p!zrV&34wRMxD)&EEcCAVGzirZwje)j}a@g_>R9SudS& zcMZ|A-s#@0&Q#OIb&Va`#7Sp+Rheg#F-Mj=W|h-9(qeU;Dncs8`?B*ZVIo3*@&46$ zS*T6SK3BJe6eq>zaJs(Fg|&0Th5}>TzDDGY&i+Y}IokxvDc&Rb9>nh>he(PAJGeZ) z_k^6?L58NXWMbWEb8OgDYi+B;s=jHj^*3HxyKL33&slIHv28aqyHmg{e|7_A`LBfs z&`u}%y#d!ET&~W&F@GEd_LiqfdMh#1KnINY^l=WFvels8y&$ z@|c+)^O)(-WWj^wkvNZ;Jb27Z_2tA$oGfX>;S#AgPO}yEryrDf#RsS32R=B-C^5-L zzcdOvGVVC_W+1+VMK0|92N52E4tOA<1Ad7<_T$ugnSJ%9GMr7f!$y?tnTr{tV(mfe zIB!XH)=x-DHeXbowR43k{jAbl?#0(&@GT}fpR6A-+V%Id=4*I^-3b0E_T^zWw`K>8 zTNf*2Q`-n4T6FHEIeL;HS5TA;3*svE!N*H`Y&kP-_RmGk&J6VKP6HU(XmWkj> zTe;p{lh;^bbRJTboi!4s**1+dB|Uorl0_k}G8vpD&VHxDLJF1GseVlNm91}FuBFXs z+|+1gK55l`tsxUnSq(rg13NI6kh)d(mbL2>lw{IQW16F7iC$_48#z^G=-1e$Cb{x) zB60zCT#ssO)7bJ%*KY-yLl>9hGSAHNLI(3gr%WUG;!=?kXOkgQd0}(&7h{Y~$Czvb zf4AXO^6YbT+|1zVDDaqCnSqXfb?B@!c@t{dq}zZIl5l~pkg(@Lru=F-@nbIZ=TOMssUqoQ49UTFt?8~vvUz-uF{VT1W7hvT zkQdRRSg{nR3#i|I7G^kBEQAjM^%u~4$4GfY@ZZ;^mMI$9b^JT1;?4*gD(ix~P)SGpF&`(o4iKP8b! z{;G8Cpgc#{ig=xB?+MCp%prUa5}Hgc=P@Vso=^5NjA_jR(nm}fOIB-$f>}YC7ectyy44bTGwc;9Q=<0;ddLh>D6u9 zSeyk=k$eJ+p!jwmRMg`Q4m>`@iq8f-`Zuh9?^RW)(9*91Ukg`TD^GJ@u~GZC!t_zj zGq$7|nCB;r?@BE^Zq4hV-zD<}3aivka9OF&TX6k6D(iy>XpDDoHmnUa^hcb#Ex|ln zM#>$m_&HKxMfg~DJ z%1pTjZ13s>UaxCg_L;B}qufX~I?o6S(|b9GZAYvZ`FtHs{}gCl@V<|JX#nnz;tI>0 zdrlNey-&-%X79 zJ1-4&Yi@G4VlUQg+iU&Oi!&-xx=(w@PW*{24gNX0hP0(ew9GTij1~HOZDXfDuLa)> zQSW1FEwN&^E2F_}^JvFH@?gamhuDae8Qt6aiJRJilq7c%V^rLqZ4L7Fyw(mqwVM}@ z>(MRIEiyN-j~wdIGPOEQ)uY(OY_$IKJeAXq4jSDVcHM(4EI*_1d;~ICCM2Cy%GaKa znsobGM>=N2H6EIJ|KO-9i*f&2)}XNMUp0R&V{f_p67Zrn7y9k8W4Ne&Wdt(oT7;8u z6;XQ(>?~qu8~kDlmJ}={VlBQtWbtDE@y-o*ZsA&E`+`(o&ysfWG9>LCyKKBq@!k#h((ieu@X*G0)sk)vlV4?BHeD7X(b%Hgk4O|r0-B?rQNPBNP9m$ zR5G3qm1gjyWW0Bqbz21_K`)thH{ zf4_zAgVq}={TohGevZ7Cyr0n(bn@rCPdJJh^2@$gaJEM1rq89sH?ypT8doI`BdS7i~);Y{gk8S4oT!l+(Z*?{;)JC{8%{$tjXsm%u ztlKfhmuauv--<6b;5#)tEmZd24*%l&TN4%MQczB7qUvmNEVbeU0Va(2w4e6&+!5AJ zS5V#EUq||wVnzG;zr$)2uu2D3rU+K)XzwVjQ)KdJew2?)&HxT$@GccdDI!QE0mqCO zj>N|rfMroo!fp_LB;O$Y*WSNLSp8kX>KkD7*Q>Dl9Q7OMWGC#GEC=OQ6`w*DmZvyU z>KK!~Zr~KtzL|rJ>L<;K()!Vf^&`!jYHVBAlJL!01*}DRHWPA~946%W+3pQ>pFwA9 zU+;nBhY6ZWjID;c4Rus^AH}Dc`q$A_?KMacDqbPUl=u>aBm*AVH`{h(_wP`j2OkRC zW=U}dpE}+|?F;8W(-dKz**KV6osH)N?*_+c2Ys`4&~>WKn%tZ3bZGWkzw>I~cU7Uu zcl=GjR}7p~nm7vIHLY{C=7=@LYj7rOR%^75JyxGL!?^+}wT>FcdEtna?M*eA9p?mE z&K|2G5}WT>?^x@g`zLf>qjTE$YFG_BNj{|9E-f^@Mr**EV#=vL%q7ih;1J9t#yP1R1=G>|>o+iCBNO zJ!D+Lp0CS-oj0qhw=VjdDTOobf6+KA=aQ-Di@%08b4A2bmg#2SW2QY|9rE6uq_lrh zmyDdr_Gc;~CI+BMTSx`_LMY@JVX*PX5DzYb2qoSrQ7Jlyjw0HabTAH9ym#QSkGT-* z4J+pQM@!NHJ=MpGWBoXLg_%5jw$%l>66qvMDwQyY1{T9wNKf^pV1-=k|6KTtB-?Ye z8(_PFr=SqO?o-_`y53W}Dm|0JK=v93xdE5MwGi@$GkNN2&6w%~R$UK0^R-5kU7hL3 z#@C-4t)qGlT2s0+qECwipLE6Ft!=c7x#n|xudZA1KHoDSFd!z3*vY> zd@vYM3jvA|Zws-ID6*wD86oyKctLy|V~Oqy(fIu%jCf&$&hT_D+7KEM$~tqZY(%3; z)vR}0)^;&k*vHpbW^1thh%eA+-ArMzjoy{goqjoHW!*7%V(HkPBLor=Nt3J-Et?Ya zcUvB@wbVVci7{r9-Iiiob6qxRv*3#db={7#Q}~$aY!5~q9UQ1eyFTOj{3?JZk$wCcw7(G=)!V|)&^U0q${(2i8b!A7!hJj`(qrJ6ydnb zLOj2P@5ym-Dda0H+3;%q}m+dy0y_Uz~UR~>$%MEIEaN! ze)ESG#-Oo;=WdBM_?+@P#XOPZIZsN~m@-VzZwxM) z`I>XPlbNSHSB`$q;b%JkC8Qc(SVty}_8Lg0z3|pT$1RQ*9G4u0b+^>LP?vxYziWsW|`_46Fxg71zzObCNLIuZXFi@|@! z8jUmyhMA%i@AkYAb5c(NVcYYzk%_Nbv!EF!KyovYX=HUd_Lsq9tA-MYE$16=)B>*} ze-#w%y*EMMoY&@nR&o9)H0Q)Vb#Vf8Q>uGn&70LjwO@Ez?ep7m1|X9?z$N9>aUo%R zXK3K3@X}(=lKl6r<4j0@ZFSh%VhE_SdZh%ZG9cLa^=z&?hjfodZT_-R919#;;V@bWKuq6 zswQg=pS?Kj-SmtVR&a7H)@cPl8s1GI!zkY<%%$mkyeFBOWaNhizJV1SwkFfJNHv7Z z4}OXF>!J2>V`2DO9J!a`PQ(AxwFvR?*CUZuyp)ca zw^a&_=3yhje}T$46}9#=@Sww&o3Oh50+K+QH(5GoRO9(vVDPRD?{NM=de`FdAzeSN zKTG<^-c8xm3T!U&?%jB1qvDoq`{-)DbI*FF5&y%=i}kIJYCCeG4$-A08tt@Y|`n_KWQU0Q`9F^Os%tpjN1ThZ; z5-@Kp4_Nd}(NHf%<`QaIg=ZGe>k0H74Ylf1f6mar66gTL>%y8J8b}^yj7r$>S$obs zHTN)v@4#b{UWhhibdI%e%wJn`k!0ytkQPnG1FLJ^C0RJH2>(9=zxPTE9~YBBMn6Uh zMnAaXF=DhnSW|PTV_A-;WA%#YX*$jSVedQO>ng6iXKr~#?@4+pwq;wkBtO~6UCp)( zwj=4OSXM>F7;t!2dA0;fFc3i&ynVI{FtdQOPvLCx&#y`)~opYv~`A@l1&Y7D6MmE8lw2b(l>aKgpnjLam2R9{x1-^<#YU zr^k*#ZkjvL-R5+sd0;>0t5; zl9w@G3rx6iYbez}FWDB##C@Ur9%GXq`V$WZ$FN@CeOR_>0~X<}~6t_1CQILOGF;?k%R>wye$j?M~l@XkjWn&_>c(kS2h%fwqhUA*;g zi@x>UXTJ4+9ALjZLgSzFKA+t0q?;?#ZJwQ<(&#$;C^S2yDKkR*mS?_1JI=78#ojW} zZ^e0vFZ8n4Q|H@vE<$Z_!GgTRrZbfT7BojsPc8Wp@*f;-66|Wuf^^wL9PF%37D@NAn9`EU?ubuQ^r`1d6E?670<-b2f z`>m&@)*SuK5nJuX{^5v)r{7~Y_Em9@pmV+v*q<~}k3Fu8&`sj*uP8{h@A4yD#t(YYW_QY~?kT6*@~orT30bS7=S zcDsQuLtNXA^Re-=v*+y|uC=0J>CDwa$TyFOwFdUdXfJITdr?i;iK;dRuoFf5QTZv~ z#$FWe8C#Kd2zmmrh#Eeyzw*Sh&=SFZ%Tb(~RWE$7;>{y?v#k6BZpFgiRlmb%30qsV ztzjs@E?_CaZ(nrFqu6g<>i!|aKEda2oR2fLeZiMm>S6vc&d9JsKz zd$KO5Y^zv~v#fIT!{CkpH2APaI81x$Sg!-Y)CRUBxf%GaJ%{is{d{HG%RzzPeG8VN zKIY&ZH~B1mRmN_5D{FM(QOvhtg97Z1MzNdRp9=l7Oop1+>^r=Xy*m_{J2>$WzO7Rf z;`?~X?BasuoY#CGz4S$`IGD32c@+lKqlZ>T>8_PZK_7)#v< zL%NUFX5{rW#;)POfd?@MV(On&k69gbB+WV*g2rNEJ)**(E!W>wOYYRvuG3!ZLfjtm zY`J}h2NcIK*z%tOw&AN8BPag-jvfBQ9_c4qVE@M-O|WXj{u}La;#*~(? z^BL@5;y&%)9bvdTg5Hb2LKo#(VYi z?6=$S)>`}fBhJ(7N1g&mjys6wqx+MYcMx+B_HS7?T3IiA%=0w+x4BPYj)Ogk!^@cQ zy+U->yi=iUxtDtMK;FbMMzrg3>Idqfrz-#WEWT0|q>`CCLOZVAarM>a&aYl=c7{5y z?VQUzi?(5ZKJ~O+pWoHpW!2vg_cOR)H`V#xYZ&{*<&1r9A7iuL$5>=!WM~9(EgoIm zgFkH5s@2o}R}b#$8;ql@q^9_#GtkF4ru2WyhI91LE__T_!s zcov%J`_4Ii&h4XVu$1|5C=Cm1FYujzLn!nzERr&=$+$siL+l%_Mf)Rt2kf0c0E}tO z;{}=6L-rmr3;Zwo8c9>`H|=clr>6>bS%=+NwMz>f8+s$ExS>|TPf{~6*-nT=ZZ1>~FX5$~qvy59z}6=D zC1Iv^_b6^+x*RsU)bA$G!AarqXHQT4`sVfd>OVX| zI|do(XKqm3_2=&;KhMoTKS4^l*vsoYJ(YIq=n;lBJmE)i=TBg>4LWTYLD1sn+ZJNe z{v>_74YLoWy~uJ;PPLq(H8`C;%6xtGclW|odJlQ<8V4|FqLhM&d5opBRdbb8(LVSJjeWj_4AX&Q<7)>e6M)&TI-FE2ey|3zk@ZFX&9uA zM*WQbr96&NF8`iKag+AL#&=w|LyNqg-(ugwAGB_tdk2&FvOZjCy>#un z=NlK4dtl=nV3P+<9SQ9B5~lk+Leoa<=8et6Da%cvd80N?%{XfI!4rW4jvfr*OIRJ< zpTp!?#ccMnZNEToX6S$g+2qfU-+!aMrGRCW-+y&6-q=66=p2anjpIiToPO=}X&@BD zw*~fj8-hFT-^V7?j?(HS`xt|rEUki`JHf=-hw6pa$Yr7}2pMff*ow~d1w;JeS)i=1Rz*f74H8yRE%i7>TNuo|9~;~iZravDm*WBF4!lZ zIrNC{t90@~R_|RxLA_jJh;O_bp zum*mq(}j}**A^pmB6pu*?0Biuf?tf&s=U~)66XeIrr#79+cPwB$?DdjuJKXvmKYe_ z74GcsAL>T>*F0*%mVrNv>oR;Fg|L=yh4*w9R;QxR%qpZuc><*7}d6KN9JV z43G5<4I=%(esgb?uq;SEbj{wciS@&W(U)oG1va&heZ2Dca~L5oZk#wmGlP%j1@?d2 zwz5x6eO7!ECO7-^)U_uA2R@pYoBeJ3_*D0a(^Hq7#ElOwvhI8Rh)0}V;XPKDm30G7 zE(1HV7$k=F_3aDza@1J*N63(eOcz2Ia9-(=%2O}HKUlv`9Z)pc0#X)A*e|1~S-rG@X z6SotyMQfY1VLJ!_P%NXBLv%_C_-;SPQ z>Z`dJXE64#l*M&nHt9Nc|BaQ|=Cc@G(R+sv>|4}|yLaxtdPjuztf>E9wSNIa+1TNd zh4_XwTgsos9o7$#-j9jX@Z~#hDhci&I~n@6(=f&*I!jH)n8pe`&-&R1vS>Ux=TEuA zy!3JGh0rL+7XJxp-`*S8&(FDC>~-GJcfZ=}%;?>g9l&0vhXoFtoSKC*uVdn!{v%j( zusqCsp<@7R9gHXBXbgy-OS@=f!@1(!JDz@{`Gcr|Ek6`b2Ww6qp*=;0xvs^I+kyQR zy(3S=LRbJ)^et#8xFMSc|2KJ+s;H_&y zzc%Y~niI3hD~_VXmz&tR%oua_dSdms7ONKXe<7v zak0qNum~q9Z1UpcRDVJ2jI%?_cMJnZjH0N&>EW9GgW)#K7!KvFcVWCfJvDyx)YMy; zFMQ|N$*HB-2Qox?X&j#10CC`Og*Ceke_w<<0r&Vu#$Jcp1UjXYb)_emRZepQtKNf= zCNuZ+)cwGY@TGor&7(Bq;tvHDy0A`g!HUVZBQOzKcvl6DPNbJ`9CPkrthT6(LCEyx z$(b;S55p$E3jLZhaf*dWLrQG&^V32Rma#At;*--tIC#_9EosQG$vMXitoe3iyKoM{ zCjb5DFm~?!!RLjRT6U%NYer}9o=9XK2~fI$rHm0@p#7sy#+<57AOpPp(sHHE%wVn+$C6Z$ZnB;z*7 zNPGJh`cyCG<=a{fSnPA?BoEihxg1++Vvbqzr`$s0um>aiD*3M8pTRKlFk>^r8RZu- z+8?aB4r%!oTDWuCdg-R1x#Q+@Xk1UizRd9>-+t_xtXssY3^GjIT=}O%yznh0Phc4H ziDEjVmYCu0by&f~kfeT1XC!Aqn*?(2yBi}7$wt0;qXuS4QdXK5855WfEW@|v3whDq zl~acf%^R+zwcXvY;Y6(MU&p@CQRLe-G&B|-jg0K>>y7~B8uZX!+-4(WAWQKqH_L&{m+m{ zOY#2{fsg;!a@(Ai*j^0AD$YVuosrJ2KE@Z|(O%oOvXQy`?nW<9w=(%GKF7@B^LTA2 zbark*V_)~kPetEiNotUszVOKKH_k*2dM5fv!kT zPo!t%+Lc`+orB%Ixg(L?eWQItgSo|}CF@Gozni^)aRw6LpT%pNI&wor>;8*L<*ppq z*+0}dwi3nII6Aa*4215X!JU1(R`zs`b*|jm*B{v!I(v1?$k48l&Vk$-_(xYq3$wbh zrJ1!SNj$TyqOq#DC|p(3vbtnd>8hflwW~)v2YQN&I#&}2t1H@N zh%H5B6{}^g<0GA8DCsK79HI;Zv&iV^(8$L4uweA;9R6<*iwZwHzOj2~WGphVa-eXy ze|!|QvEK24F8nNb5ZWfojb<|yQvf_MBY*S6Do*>Sm#{w|9(2Mn<;}_H_^SZ$EEnGXRsLqQa+vs*#0ozcEbxqY(+bg5lZQt29GO(v}B(i;)9AR077Z;UvuG+@3 zL@SK_7~D15w`(xcliS_fIl|0vc)V|LtSmgnjOAHRqRkrIGd>s}#4zm9UI3npa8CH5 zwG?6f+*c`r;gvSlvr zgcMAtFlJW9Ly*myKwkC@_z@f-wwa<vS`s6sBYFf#=N>p_a}CHxp3OJv(KG~U%8 zVXpUs_ER`_FEN?@1N^aw5c?5fT$T#Mnf(^Ai7@R)1YGR|G?|@4VTj=ITfg)^fd_AG zsG&X_YHw{|)~^bv1V&I1+uAGIJKC7_>jIL=2yzv+p)sxvRVXlJH1mSKsIuS}JPG`klER!X&lZzcRdEb~EN{JHL%m3)eNZ zBi)8pX8*=e2~1ak6F`DQOoRC9iAu3YeAvgkmm10lv7pH&>(8We#?<9Kblx6 zv!{%Lc|x`&2~oCIG%)+9lUzXpudxHXV-9ac0|^W} zIO7V&cVPyQ@-%*kXwc6*INoWeUJ0Ujra_r^+vma`py#x^@Z_Q={7ZWTp7nSr65bR_ z?;=Wyeg-M29-F1pAW@hgMq4uH8PviOs3o8ZVY(r0S7@knWE3KAN~Ym4Q_yPq20hT4^u*?`IN$o;GO>y5M*ol#8}azgO>7E8zmPw(#k?h9 zV)ORXn7=${`EQz_Oq*3W1B%J3x1!G_^x2gze$BfXyAF;96!wHoU9VSny}$BO=YLDr z8{FO3Eqfk4y>lI}EUx2S_t)=uYDFR^<;`=CQx5-)iv^L7RhW5%@=2WXJDtpXN=`WFq!&-1!Ic?NNt*LB+& z#O>Z0qQBdV8Hf?a8nBCL#XOt6%)%^*J{oK$7G4U5yYA!S^XaiOL&`&}h#fZ(S}Zh&-nxmo{1YvR%~O*T%P4ZcX|66nF=p=Xx7hNM-l$w z#*&KUyes-C(#-FQKevx$g@<YYMDUFD2g?A2PQxE{%uVH^#i@soFqzk5ecYQzBWO6>Jv5H(FzW&LM+u}Lk#=|Xk4KpG zko{#uF@hGd9q1Bo56byrlTz|oC|pMaw$PY8doGpC3X3&oYjvojwXJSzb+{dS*~yeD zq^A8wM7D$TYmlu!T-mpaDmBY4_557OF&LQudu;~!gcO%Bd!3TWN(v8jPVDI!1<5DH z^dyC84-kY*N$@9yWq|q8A4m#MFuTn68lY1?Gj>8EcNRaT@0L!;Gc)pGS z6h$8!2xE_x*_*sF8ATiDLssunG>AjtdWXhGm|d=j5QvBaJ)L`*U7?5&N)U$-yHe30 z7}54du)Ar86fsj0_lVe4ikPKB3SzY)W=mq(1s&Tv96{K&B!UM-BPrZB8t$IxWcF4? z!%WIeTPy1jO@Nn!*9+zo6MbXs7H)TWZWh_fYV1xYpUAXtu!q?_E{P_P+c}7gc6x6W zd{2O+ws$Qg^v&Q69Mwb_xc>n^H zgydJeb3}JQrP84Wv!7Ok6o|2t*$2}e5<;MY`@42ZIi69epennEhA!zttZyaB9V%4h zNTd_sd}qPKn8+BxT(sbkKFrYU?=5&iQ1a2pBN23j?tPUT$)FADa&Dp(o3DA@~2iVYMP@Yye>%@?uDlfr|7@KV}xK?srT%>I!|t_mgV zzeE=06_rRs5)DbC5wyO;N%sguT9U$aI>GFpr9TX8jbJ;HL5FAd5&sUf86&t2Jy?z) z%>H!>jXXwhyF#`YTePYf_po$MErn9a5I=-f#^0mx8AL~I?guNAShE0M1Vc!HWk(DT z1(_X=jEoEpp*;V5?X>ZG!F6mjZ8`N2pS?2ZK0(3XNUU+F%S$I z9@%ySNPZwPvMVy!jUGN^cQ2Zp;>b}rTQM*R zH)elcL@b?+Hrdk$>Cl7haVKaQ$ld*s&OxfjJx0c}@Die^ z$=Tt-2)e@qhWla>aocRC*V_*o8Pv_q;I|BiSjg;$jCAV4X7GEUVvG*cVHUGLWB7lJ z1kB)%Y%2IJdc)X{8G(A#iWxjCh-jIQ8%e(w!Ctjd+4qtRYELthJjoVyUfD>#4}V-E z5nk0uJ|TiWir;kpFq$a!p17bya@y0&A`r!+4iyW8tQZL5%}ISjj6@g%X*4;<@k8`* zSd1%nKA-nf6njosl+14zaL?@sM)1*#Z5dA^FNP>k`i8ntL(92prD&3pvVyBd>Ot-V zOtM8;%?aZax2Lp>rPx*6b3~+yaREa|HBTq6NOgdw{&tN+aiL0j5Tur;i@8eB&)oDd zh488@S%>WR8tx;>B<1+v_$Zn$WyI|F8Chb+M8b}ajf@Rl67KJ$=5vFQE}I2J?!-29 z-#{cR+RKebfYLF7=t`ms#8@{ObLfR@1oLNycXbX7bcz=@o|t{Jkt+KZ+9>6$u=+b= z#nq712%pv#YE#9z)EruQqfY@{(v!CjwQXs7#rHt?QlNmaE51NVl*~1 z(B*J$aX1qYb!};TrFrJo8X{BG%=jFWXU~YP$l1C)DfVrt1(ZHenb0_U<4U2nYCg-Up z$n5(K9|PY9r{6W>L&MzbW{DASNe9pwm{*Z&idqG(rjU zyjpO(h>#W^L7c#Pey74`M#Gmf&+iNF65(e>!>eO5&ugm4S<&EYm}j!!3nKWuXz+@v zs#fOtgDO~dlupYR=6PKulFO{Y-C`+>mKr;8_Pk*}h4d^3?dsOn=2qrCH=XJ;2fInK z5?T>uXs}~YOoRCKiCaoHqPlXuXyW|(e2R7uk59p!5x;>ZQT)op*x!uCzH$-8{skib zgktAKbFUk%93S1w_+A%(m1fxLAMHLxH|Q2cLsyTC42{%cLdP#o1jQ$C}ufv^1#pf*n zig_6RAHrdvpdc|3T4^rMYZ7z!qI>f@u{)-6uUSZGtORu_++vLQyT*DEYbB-C4pI}G z6so3*gt{Jn+Eu|>o}#vk}@bn%1NGxj|=s`%xc4@97yw3mhPX6x%8>l+L!0$vLr zqPI6Y3(GLQ1^BnP1vm@^D!KnhPw(93-=owi)W0IUZl~?qC8~pc3BBm;ckTZ27G3;t z4s^f#H1V8yi|((f`}HYEZgnFsdlWxH_e*XP7G@qJ))mD10DfGg0YN%n?l%0G%)SeM zgc6u%pEZ|zXQ9V>Tbf(j!&P;y%$m;&C>GxOQ6lL;S=kQViqh$YY%Or;o+!P&78+d( z9lBrAn>!FV#~}uyM3H!|L(h!TMdEo5Ju6BVi7#^K*^*w@#H=7MxLpXID``Ui$jWy@ z=1b~%t)b?onz~wMEp|8s-q`fUTEYuHBT`u*!?!ecY-840ykIe4GJ=JQTGte+K^g_T z;A}xJkET(~tfjo5T~K#07gY{L72u~bi_jKCiYJIU%vwf7s;1@`(S8@6Eg~dQe+us! z85$o>m`7O4xcL~#I`f&HDeAPgwYj4O+h^(29(-<24c_kMBba3STdG^@S~gd=Ry2fb zI-o&U*W47Y_%rlM#%By4V#bX0DrU||uV&Va^crT*NUvqC8R?suo0&5dfVNET2WURG z@o!Yr8~E=rP4WvYTI!m@Efs}@)BHtLG;05fUra@c^OsOj;{2slgg8Hx%o6--N#r>G zI_6IBmq7(Gp1+=XojD^b6>3H~CMm*6jEixT`LESTUgW%&vIHEeN$e=S>*;9tkiO7NGlf&~A1wlv<4 z`dyabFJj9R{KafVg1>~VOz@YoRSEtzY;}TvEh|j$uVY2={^DY`Ho;%Q*2VjQ@1_KQ z5qnp1w7oVpH&wIKr&*Fip^Yi?0~k(HxFq!r*0$6&hlBz@)a`iUM6(w&#nj=xLE6k_T=8m_T!vsv$#p?o zuB#A@GJSaY!ztAob$?a8l-6 zDf7!9{F{j3$ebrbXJaEF3yumiFg`)2VvH}6yh_l|hI4SMrSZLad~A4p%uyro#g&5Q z-|s~sGV=*6A1@%VcuQuE^p+7snDWn(;E2TP2IJCtE3q2>1xd{oNxgNJOlh`A>8*7$ zB-B2%YZp!{_)ikkNcTHw{A5vl8b2wXA&n3=q_On-ZekK0(Imc`7oWs;i)KiojnHjCiNaC2M6WT}@6ojN!t8HmVMd2mL&C%<37r$vQV}A!nt@SGy`%NOxq9@*hHY*jhxJ<(A^yMv25mnQ5zajDuzsh)#~*lDzb_yq zE+crxfrs^)DsudRhc#KiFt;#*(+)hWKd6FDJMgexSBc~@bEX3i>kX5Xah+p$AD?aq zaG8r|T?-{vxYei@{yY5mF|9bdOzYBg#FOdJnjcaFYe-ZhZ!#f9+ zCgBKagq{=VGts@QA^h6h72aG@g$oC|BU@o1J~T4Q9!8jX4OFcHc_`54&XJy)PUyeH z_%({}cQPPL+)xqrcWV_VkjN=w)@H@YOym?Yt4?vU5;*IbwM8+q6BuR8s#lEM1jagM zH7G`Y0%I++8Wp2}7;RfaP_Bp-r%5qaB*emAX0u`xCNN5v)uI@s#At~O_Oxw{C3mi3 zmWjOfj<)wfJ2#4LtKx1DQ5$274#g-J(UhTeG}>0hts?GuRqe5O=PAx+;{n07{=RU!yifOrGYbO6Q(-3|( zLN2@#IzMotS1!P+#$YROMxlG<-%PK>5I-`8^L@IL>YZC}?1<}^q(}N+w43`Ycjswa zR{8YSnt7S>=S<)dv}4i`-=g(_-Gd)jfz{2ubFe+(4z+aDRWU2V(`hY2D~q}iZtAgi z@^lJG%ZaV+(A2bg9fHSQQP&y*rQf0W-EHI_aQp#xi2Q?&Khxb>jk)30>ME=jhIqPM zr)0U?He;uIn5Um5_Fb~!7g=BG#LH(Ml7ZOX+pvDZgo0#FY713{+hKaetPySwl9Xz@ z+y@JZ-D>f~i^M#Hb3ad9DDlSaoL{#a8h&tN7Hx1~LkA_ZiytE(#T8EuDFcv?&#Lw1I%VhO9NYDf1|9=A{Rr5PH z0#3w@fcem4{x6Pz@s`7*w5^h8IsAXSar2)X{u~Qnb5+V)5GHB?Y>o*(u8#VIxd&s1 zvH&(e<-Z@n91CFc!3<(D_g6uDAD%o^BC-HBKkoek{4gh#7Qp5M?tZXn|J<^{_-FLn&)*2Kj^( z*e6=2WP;(SvH-T$`J|YR1+cX)Qxag8NfyA?y7|%%JIo1YmHGCG^vD9(jVJf_kozro z5I~S1u*PNi)&|c781kfXEm;6to4hg^MI#Gf>s^Wlama>OSO8n)iWqMJY*i>CgmNr^ ztx83MU{MQTE2N0=7Qj}OBF0+)Th)q~U;%8^C~7WC`2ywk|0Z|fV0c^D-kzXJh zX8~-T>m_oc1+dkYMDQe709#uXjVyq_1MWW~ngB1s0@&*Ewf&d{u=Qn69#+j{0c<^)9*s7_tfykFZ4a{!C|}e9*!qh1InhH< zslo!-dRh^r1+aB6?Oj3$RIpE*ySW&vy+@zbGQf(5Yk z>l7M!;w^x!->7Cx7Qoa}D3uKHLs(_3glri^M{U-Fl}W6a1+WDRU<%?`09&vCR=ro4 z_EO)41@LM*whh8|5&9Km0SsEEq`_JdA-fnmp_H zA-b{vhO+v+34q~P07JdpvlI;q8tlg3l_iH5NMEO0c^nnc#SCLGz(x07Qk{WnQj4W!2(!vhNoEoTd)9@oOlah3l_ldM*--C zm|y{H!2K_)sxWNf(7uTAi@HeUZ~^|Nx}k{+7S&L%0G9~f(0;*oQ?&s1q)zmlTiy`3l_j6gcN6k z6ZZ@YVB%zR8XiTbMPF&gbFxLFUN)z(#_8gF1$`HO-PD~vhzB9gGz(x07Qpmknb`u^ zf(3Am;4T~;?;0A$rq3?s+Lc26fpf#M#O>a&;goCLCAN5xJ#am&{owAvh{zXW@tgYy zeDshBm&aRpAzSn)NGsrFLC(K{Kjhq(y5RdPp2&G>UF^m@;LbKc(^W5>|NmM#6#s8c_NE;gKo3=2DrVwRu`U|lW7l(?fb3@6^<3n4(e+#}A)GsU zJ=e8SpSYfjn9M^!{TfeRktR!`>$&D)6vIAX^m;C#Fc&0})I`ViT#q3NEzV8navga+ z7o`MXqnC3LK<12>b5WX*nUrqj4hZ%ej6iq;M|hA|FP6AKf^!&MhUfe9qDw zmvc#y#}~bvOA`D(=W;IT5BTKeT!%$^v^3v^C(jD}Ou`8mqDymJ&h=#so+vn$-0E^J znT(>T%ef>C;zXC`xSUH8A&^*wtIN405kd)~yqrtYAQ;h{%ef>mQxcuaxg;@5g;bYw zNn*AnMla`*R4mOOLbnl@b1iUDNn)3CkzXJhw=~D)Ttuds2nCH^&PDLh(%ct!IhUki zY3`vbQ&u9H054%_j?1~O7TG$NbCFMEsxIe}VgfmJIoJCH-xDCIaXA;Eua@SNf#>h> zLr&#{YkJ^`Tbko?t{;Hni(bw}K9QeuIhV>1^-e86wlv4(Tvy`_>ywvrMWf+vj;CU+ zOb8 zFDNNCP+)mESDJ`j?u%Z|l_v-xlASK+lF3z}WU2fYPMwZ7d&FOM38DA~U z>2fX^EPiQDmvcQM5{xa)>2fX^wI#YVx3M%QM59Y{x}0l=h!|U%)8$;$%@ddAbU7Dw z;b}{Ax}57dB#^K)r^~r2P%E*eIbF{6iU=l_=C_j!&eEJb$rg29*+{+te_SIGUMdIz z-6Mj262IyE;~-J*i3>_3r#;bRU8YAJDi#Q-yakqcZ&Ke7BN4_x8cm8EKgO=O%eh`e zv7MzkUCwnQf~loBUCu>b3{lR~oG#~*xI0U88%uN5Adx!(lWb8|v86d(&h=xFYV>k0 z@`_ZWmvc!<+~r(i%7dl3haP^1@Tx5Ga;_g^8I-s*r^~r$mLQUyemR$H7SopIHkRg; z&J0U)8%uL~;m)u$r^~q{0triV8%y&Fkv$rub2-`X=!d_X)bv)EzNB# z%_aBDrMZozx#Z2XG`F!dm)!WJxs9c{6cS5w5A`4_rKtb8(ocmGez)`|qxT8Fb2(Qz z2+q>n#?qYpvKhx+&ebA_6HL67$s>|jz&zBBXy8zOc{vx2oX*mmF6W{)8C{y&Sela% zQk;)CanD$q6DOO~@F+Sh`pQ4zIoYC7FPqa?<8<+t1pS-%^-yVNAQ^Y?9 zUk>yM=%*r7&v;Jz`7PDV$f;~?hCX6NTRSsz@KKxgI`M4fG&NUMBfPC1D2|IIxjmKM zHTZT)E^as<8^UL`n5Sy?dZcYwepFK~Z6Uxe)>AEseyTe~gpplOgn4RW!HwKe+&J3} zVr?wA;p-mgVV=#iNPesZd}4~_sgogsHgmZ><#sD%$fGjhYg7ZB!^~5kMkMB;SY3D$ zkPCq~dB@;iL{dW-X7=JPa4E>rD`g+Q#&C79&yNHqy!VHY= zB1tYXDVS4R6MPc_<+OE#LezfRev2UQj*N_n`#YKEW=Xe1hDk2Z_1?Ql1j>SnC~otRikqJI&nA`;#EXa0dKey2 zP|jQ~&viE4)0IaVI-q|rjYzVb|Kwpe2ajOI zopW9*iWa5@7ZxoPx1Z7VFV*eU;t~*)xw@$;&Tr)4HkNQ@MMo7rMO2M;ThRt3mUi6d z(%M|v(T2<9o7C2-W;xIX^|wJ zLyxW14d@w?VnpN5_rM0@E>U_u^N5a)7 zZMcvmo>YlDLPDE6n(EOJ<3bV{m@rp7G1M9gw^yShyW^=;l(q_J_%KgAne=|znKzLH ziBRme78Z!7Q)ZhXEy^mGY4J=Uv!tiT)1!h*UdD7D)u>1%w|i(lSLb zn9EGcw?Bo*d5!o{?K^2j8j)oC{sNxVIF6hadA|++BFav*Z|8fI5GQGsNnurkOS+PO zVHTPPuHwVJHm&Vwkva66qFQ}LLtRB1OU>zMsX|*0w{%nje9;v;Nc}4fZM#0M>8Izk zR&T9q!__z}Bd4LGxeahBf2Q=))q!3>#D-yZNhSDsSx6s=b#5Rw@QzZ zQ_)o0pg3j@$*4S5P8FoBXbLI6jpQ2ID{7V3l~dQ)A=7Z@G}P5@ZkHYp07d5%IeBwh z>RMFzq?|_deU+;Z<3#J$W^~~w$)8i#)YgJ=#R-!fS4@#w3SMPu<2ygGsWCo(E_HtK z68I;STr`I(+2Xih(n>HV@C4Yl*$`m4)4AA4qK}v5rqKv%o0~FN?h-8dM|%7E^1-N|^+n+Fa;VhWO5VBsCW^OGo5kZLH|k;rIY z&p2-V6ra6he6hoQI2GK%u5j1hG2D{QmpEB|9iISR(oNcSXL;#OhlIY1A}pcLZHj#f z#tU2rWv1(pL-gv!CGtfc?!%3POPySjk`Z+bhB!i-l<{RwHk%Q3DW}hGR>pRL8%K9J zwky01H;qhez=af>7<(LhHT=T)u$%0o3q7k(DKHGEk9km=>}yB9L{RRreu5d!@@ z?J|6UbHz76eI7v$!L20Ds+T}{6Ta8sVA#1A-WMqv{rsFB-oukWg{Xz(`9v<(UAVfvjwNc*ezmuPOF%OA6020W687kurY?b zTaEWH6mKm={t?1(`uPn#+{TkXh{OuXLwQ0H6c1CwR@s6OX;(IGmZq@uvuP6^?&is_ zBGQUG!3p4+0zce}8{sL%Lor;56SVXJP|aIkys~fuBEBv%z)=vD_X-HaR$r3C*iNv- z&&8DZLp&!i4Lclf*)4GwNIs*jU^qG}9K zIQ_WjVG~dOG&pO>6RR3OvFIm250yOm`xJ&eqH5Ms)d&{-WKoz9PcEc~glb{yruF?c zSo1*@cz9@V6hq?*$VeK%nR^)PB^jw%mR-&9w1St=2z(EyAA(z7L&R0Me+V-?^VZ2L z3;l?5M%z1khU`K#%FRPgoWMOtq&| zH@%#~&?hMU7c=%PlJk4#6Fz?JvV>xS_kic((;$~K}7^i44S zvY;J>e-dsbKAXYHFJ}Db=>%Xc_7UC%M*^0@Up>7#J9kGKaGQG-UX6_Zi;J7nL*V;$ z-GE94_|yym#9hCQk%6HRRLi{xP%|x$y3y*vq48b4ZS(?nCCw(0A%+A;d}fBM9D}hlj`T(1iyyRf;x@M>JLO5}_ZwsPeBT?isSSp$Rx(R>dyE`gf$x z=~Z4X!K{&BVprxAI28izT7kCsR08O0D0vb=JX}e#G;p5EVMGAuU+-%C^Op{%Qqb=p z7&-sht|k$bzAJ)TiRn)u&x;Tr0he5IX#l<;p2+#v5pM)f%5VSVHLYnzLfm}sI9r-p%#oBbp9 zH2>pj80Px9hbh8;>M|m;dG0KT^jA{DusUQ~_^=MX@fGRGrB8)foghZHcde|9dm&|P zXV=Ql{AUpC>zz>I!U}vi)1b7}F_rZhcwDxf>%G9jRAOWzOgoCgLK`0-fl)TI7bWke z2(TX$6`jBfDjs)_%@8wRaSb;uII(9s)ZINkEN-oG5?`!>m~P6qXJlxYZprMzJjPz4 zSkUIc_=h(ui8V%_db7_m={syL%UjK;>TW|LeI3D;(U_??<{WH$H84 zjg3(;y2))<&8BLQo7~BJNrq}k5j)(;*CDiB6AJ^yV7aqx*T#YwZra(lH_wvwVY#L9 zK%ESMo$VC2U2fltq*A^334E3ktxqEYOQSfS!BaXl8W+j9$@?_?86>FKf{N~I+l?lL zbiL0$&r5d_xz)b5eg15UK`lW{?vT5_y!Jk3#g(PxQ+rG%8U^ekA`f;V$-QJUUaATXm-jyN{g)pQJ zf=i&4-*Ce&CQQeRechPU;Z6Z@qF`U5_?CM*4_X<6P~YiKp|p*l%iV(=eyB2x(2Xsa zgbj_2(Wiw5R01BiYFNx34oEfLB$h_PBxCw6N~Ic~N&yYyQnM3jJI!x`pNo*b=>EJf zet+H<-Jdtb_a&fqF*ZJeyAkjOD{~RzIjP*iU!YW`ZGQW(8J4*D?VGmw?MvMJ_Bos1 zzL_?^y%rV9EAUqtyVCd?%;(V&;`SApFS^|xZpP`5PwrPniOld-Z)>k^ZNesIjA-Iq zz&*!1faKh=k2Ck&Y#NEEkx@PNW7QcJpH3PWW$t;Z>7%K;+_UT(5HFQv5l!8lokj%N z!0y76s0y6-xZD|D@#!?mM>H^JAQPjBd!b38U8Z}9_XHl0FKz$23shzxi0xnZQbphx z&S?ABy-X1dmSVc|?KxO_q&|%lq&O?mh#Y&0Xe*f;+(6rS?8BQXB9iGdeqs2r{Ev@T8hx<}5Th?k-;ONzgJVG0JQf zQQaF%3Yhr@rfx9$U2zN^H+|3w>Nx1y5f~4rd;|@eY9R`KmD7PdG=90OmDj~)Q8Mlt z^D(5N+K9V>Ux*p9j}9rqvV~UQFsiN1p*1%(oF7&suG(-s&7kI`_$D(uyJ`J}KHxsr zw2`pOrh`zKkbCf+aWt#QRZE zFP=qJX9U-|W%-%=k`#i~2;!Qeks(s+f}R#G_JWz9yWjVeNMb#1;Jq79S>oqqln34S zQN;3ER8TQeQ)Z%-q=HIaW3Dxe&~Oi!6w;(^?>g+LhbozSC_ow-Uh8N0ox|V6Z?_(~%d(7Jmf5ven zNDb8#os<%!D!a_2z)tJBl5c_@fEr`OnTSuEiKvF8&P06iXCmUg9hPSz81fR%M9@r~ zGZEjkGZE>h^9JWk#20srCeB3S3Gz(DH|tvr-{6TjQ%~ZbihkzD6X7(Cd(GQ+sQ3 z11keewLk$;*WKu66nj1RkiwkT6JXIa?;B}*~3a3L&;<#y(ueqj% z&J5p0MMA7{AI@|-8Y)`DEzNCpB5p;LgfkYLI9B=^>YA$KLxdcP3{d5xF`^+{QpKu$ zwdc1s(^HM_+zy-%wKkDBwUEED1@AcGZ1z=mG~gH#k9Bz6;RLs$oo#WF6iKmqUu|o} z*1God!&}8M4{Pvk#wb?TRLdHp;yDtB8|oSXLz9!lG1;WASz_4qE=#Al1}3g)v$XgE;L3@4DHDG&wq;D*f{)KiK}Umb zwj$)tF)0C?VtFn4ou*MgU+L2)L7!f%@032hPa3;N_33@m*geJaeZu?*l9?y<>3yH_ z*F=3?%=cghF_)?$V_kdfhF@c$*Pw#uk9!HSr`t-hs zO-d=MPw$^CR=P9j(3C`t<&FnUdgl3w?V3y7|%{a6_NoU*@}Cq?ZY-m*FYxHRS$zJO~&_ z5a_n!^B5aESKzB-D7ez6_iysbWE73`>HY6gG>AjtgsHo~ToEA<5yi)@{S}G`p#%{- zo&HKigJ47x`t<&gB4$dW(5LrTDPooiN&58uYDLVJM5#~juTj)ow%|jUzj(O6*>hNw zMCsG}Taw5x5RKEP_n+$}GN})`qx$szwj_dw^y%G>KD~ddqCuZNjpi4Vh$g_xVGEtl z-rmCfU7jlJ<2u#YolZWHDe2Sudt4GtAV>Q2{+-?}g75K=)c#!y34NhY@3km{G@8s^ zfFLR-RFnM3wf{Yy_ltbQN3Q*srIAnMBbLJc%bko+-_+tMqWs9U|I3~Yvq{2X=6^Ch z8f}F6pNh4zJ6YHlG8I(pwOfDe`i4x&V8XrkCrR+=>6YYuvbv>(YQ&E-v9mNj|xHok`a3J z{zKj`3CapL>CyY2Q+XG{i-J9`3RVU$O7?=1Vgm(+9=-p?w5LVva#WNcyp;BRK?srT z%>N^mTop>D^yvMss6-mvjvl@LaMD(^6X?;q&yez(kN*2&IxGeh90q&5$jN=%~$|U|Gb<1$^=&*M8{H zQ;<{m8W+dh}=GxDR^td4KjJ*M8{H%eaMk>iewB4?X(xM8wiOv`Ob9*M8{H%b;Z- zJ0H3BLyx{s1m2K`(u$8<`=LiK$HsDpMnfd@=wJn@lhKlJEju+4cf6L&xK=!Zmt z4SCK-uKnocGHQ#UiS__JdO{R6nTHV>-2r;^DI(&wJg2w&p+`^MoAl@%Vj=TGkDj_N z>CppL=OfpC=+R$|1W1pb3NAkd4L$nTkPYe46A>*Fdi3uX!JtR)6?>9ii~6f<7o*e= zV(mhBNp=L?k3U|k9RYH91nrADOk7YRIZfy)5s2bZABqJ+{0Be~uSn_+V$i{GM+3+! zj-S!TcEwQQhgJLSDE}h$U28v7=hvZ)5n@<}`Jp;bUW`hh2pe`kROcnsXoZpj)p^wh zkvn1GwJ57a;-k;>U28v7=WiCN3e|Z(tlG&dQWdK6ept0jiVL;SgHbllsy&VNtM5U0 zRhHl(Kdjns#$h`(+t_!l{ZO5!Nrp%^UUl9Nt9IEEAacA_yC16alnzwqRpX9+*V+%& zd3v`(bv|#}cdh+UotFrpS;oF=?T708IU;+sK~kOf!>T_i=C&ziaJ>>b&GVC3uP7 zwe~}GUUI((Lgtc)9~VS@%IV(IDXTpJKc*1 zAr8Ld8vo^LKUC*wIN|)P8NO@nhw6N%;6@esOwq{2hQt^%l2dgApiV*p z%#<49lwo&o=ip$ZA8U$~h30D{kUKTc`vnpxy1m3wgY#&62es&q?q_3ziKXT*kXuVG z92%tN*grtD)P497n>MLSplT;TmVs2P+j5@F`9$Y5lIGy>I8OlpBiaSOV~M@H~k zrqd%9n3a`|(|p|QYn>O{_2#qqCQ#)*jMzL-&#fIz3@fFm(6mhAS!NajFBOnSwFMUV zX#)*Pg?D7I+_aBkl6VyYi5j-p(&z@CyhM1RZ-|7j&7*117Ic{EaEa$6(Q*>pyD2H! z#QIKLQVv$?KH^;8mt|5DDM-p;I!Wa@Nqq!KElphT4WlTF<}Ze_08AhYH40S6l!|N9E!Ronj*xN|&^Ar=(vdbUeaULVCu(YQ1s>WV(8@B0wE+)Zps=+K zbnMydP<h=XoB73)>RFO#}E z9o7O`iSd>)nSO^=B>d;H^)eyAzcn(_H8dKLxnfv80^vq^SGKj_^OZT6^NtXC0CPax}G zA~6gD=B=+?2`S85e~v$`yi|@6j%;HH{4UX@=u3wc;&6z6*PJ8jk#AbeSo!;r8%V3E zz~yvW1W)BnKx&;-*Z*fzoV2O#EWXF6(m7}*bAC-Ujf3WrSQ-b-^>Jx@Ri#lOL?K-^ zmBeS2DBl}E;~iv-ObhvYmpB#qS+j^>@?z8S7&yy?c%L;xl=KxKj>Az?|C}j?k1xXe zI9z48h_Qb`lAHyomOp1MSd277*Mj`-;QuRJ)h+O3fxG5bJmd!8frADjfpSX3rQdW2 z#rK=u&`yxIBg9s?(E0G(gohj8N}XV9MnU};DEGn@QpD$E3*qIc8S@Q%EfoK1oZj3W z>DwJ?6ZUkNEirzFnb^C&f>ijTvm7YykWkPz@4v$pi6(i6SwW{<-ZZ?d;Fgmb0}{HB zqMZZ68o1iWZ4m$7%%mmP00_I_3Q3fo2=Pc~oSN}CC1lZjQN2`1XE`cgo3QD)Ag)D! z1Ih543LN<^Fbk-vOiX!Cf+OX-z$_#ANUJcSfi-_J+-52< z{hNTuE4q8fp;5svF|+?3VT@aM);)^95~@Kno!W5~B5i>!tU*+M0RoYKTvYyU{0g0Z=RMUL z5$&@|XdE9iY_a`y2p~>uL4lAsKfcTn?wFBB!VQDE9ZpvLF{6ltI|{<9aLY+|h95IF z(8k&MuotU_+al`ngfWZKvdzOV&RH=wG=|x`s7u)>PCD#2i7j*h(Dqe}Ic3bEy0Xo? zFuB}FL$_ZJ1^sG&%>^jLCb-qecVic3DA=6DorCGr`UJcCWCq|JLXB4>^l&dHzTUA+ymBdE0WyAo?m^9<9OwA_A zYqC`hiuq1 zB(D9*8vdr?;+bKX&A`2g67c;ioZ9`SkwdjRdk)rKaI$v4X{@H&tp%Y1PS)->jkBqC z_kb`;A!Yr2(`ckBx*L=`;bf=&jv)r@XFzxoZsRB|&1CrRO4c7h{w-YHK1ANA`s;Is zn9?l9(s@2y-Cf|x8vfV+!`{1q*I88i!|&|9-)r_x_ufgmPTdnc6hc%IMiJLma7C(koG@2s_E&6@Sj%=^AGYpsdNpxpszAJXC?udL@|a$i3Q z@a0Ie_{Q=vv{T9NWxRSmHg*~sT=&n&jKp2jMAr)ue{bT|E3s4uiI@?h`VZrZH);T2 z8C$qfM|&9I`<)5AWe0J~t^o~ah>vTUc+m_&&YU3{?!*N<%itTw7m+#^9dX>HhmjG}c(ouIq&*~E~ZG3WQ^J204g6~wUoOWXW29gJmRz3)_S26KT zH@1Q5Ut@ZU_0T4nhbE(qR{$@%;%K0Ym|)oYJ2a+fs301EU}ppS$e?luOt~j!I?k^Q z=2SE3wt`we;Eu*sp{_%l`G8}$HE*KSsl0)nF+`WYL1Pqen%3nRF?qBl;pOBZX}z5h zn@_zR0l+*YtCF*{N)7^aGLnej12H~|tKtSz@J|Yi&tLttpx|f=W)`-<2+60g2)W4! zNvEL=NIwL7gdVj*Zqh>j8PGS7^f28NljrXotYI}E)wQ4;UkxquR_yc)^yT|heJm;V zGgZqm6JX-ogfeOk9v9Pwvjfz}rapu|bseBrBh3`EMnI3?C)8trJdC8@(duIzTm*jy zfH#m<(Yy$ho5a58&<4Ju_XRaIplbon*6T0CECy$00R5h~m2zi}vM3jH42z+WJ>Tl5mgQ))R!!dz`Nv3rxF zo>4L-&&38A9>9ZEiSQ|-hLfQP_q-MkPZe4R@Kt*amsZVp20#7u9M!Hr?H^Vd`Mgt~ z%1iXHlGl3S_K4-CKT`_D9d)-VlkTWESeEdeAE22ufRmE<*ph4Is{(^0?_T?c{=j)W z1^-FB1btd=#9VwUi$dOLq&{8)@Oh-8jo0lPEmTO;Sgd>?b;4|I-+uady(x3t*8#g0 zsS8Skcbrz@AIt~gV`p`Wa%n{2sJAL+LNAw$bDUF)E6xIqSu-hDW4NCF z2Jo*Tt$YkT-f1M>!BXaAK6ERvRFXz=8d%sY9AVAMS;3Goze1WW4Dq3%3(&K22@9r%qC1XuNkC+D50V zhU*W{D!|9Y2BZ(>S)E#7Rlf!pwt5q=`Bv+NO-eY|X;=@6!$^1*z*iw%je@*A7pYO4 zGoOYeKc%)?IPxoTkCk&B?xLzw!#B;w)b>|^$4r1tEK=(m$ZW*L2awuHHoI&lrY_{p zM(Uo3%*zY$TtMdgNb6bv_*x9EiQqK56&be%-)6ux>_$y@U^>D*8@AtRs@?BYHP)W) zOu%akCaZbCJ^*a}5?nlni&ikuGo#aR8DM;oWL~}-;|K0j=3NJKXa@v%3Jq2A`+Ht} zMy0;OwwwmkVo0zMsdX1Jow(>gY9JZa3ZDL%4uq&dKRP;gDu&~%YeDFhks*J}d3C*7 z_!Jr54b;gfzYWQm#Z^ImvMKpJidVO&ROuWLCef-7f#__cI%1wdqnx^9(EVSqLwwB3^nmV^;EHR_CZyD z9k5)Bd8@d71S+n-)o8aI(@UXI0|6Vg#HoMGpz8;rq5JwL4967)W0naZQVu%g8*oE6 zE*c>l`JM`$9-~f)BhV!Dd^vT^wKgiJ?)SJ@f(z$ZnX23O$wE*ooJG`~W-W>@!s}&v zzEh^>4fF9G ziOF}}aDLdiafn-eg1q1!BUA4mP~x{p8|3}=So3@&=~IY??Kf11!Ve> z*@o2mugH8E7q=ocOvTU8H9D~D3n z-vJCC%RL3^6JG>uPa$9TI`Vv#t^W%yD9Ys;neXYb;E+>)5Di>|zH!^2I?nW+hI4`0 z08Cy+>XT||aGV=~Q_eQ3yEm!f6g28e7`gU$XcEKgg>=IPh zRk-FiSQQqiNE9YEc)0v$TpnA*ta}gMuh7SbEAC^*A0h|MZekxQoH1qQGxrGKOqnB?`xvGUCT}WpjPlInO=502_%Wpyr;&RG zR7~mF5ppjA&g9jkx4yqWcDV!6KcEm(Rz#cVq0=Fi=Ew#g&<<1S6y_$OYNpbu%)Own zxrkKOKw-9kiYYsdxIdz5rgS4kiviA*ZeVUXu9(tuSnkJYI8%Biabr-1DLsR^GQgP- zzZALcfHQgHhv_C^JIm>TSpqiPw(ssS9^}%bSzyoPO<=+MQHUu#nz?fTXYwY7$jt(K zrm%y!djMzhrZLwGH86#p%+c?WDePwME4X3`*JY8L11hF)4RIfUikQN+%)J8cOqo{Z z_%vb)*HcZ$0?w44#pZq%aHez zn^U(5pM|~Ks;$FTbz{@4xwGbfpt^3C9Cc8)antt2`}S-Z003V&Tefel<5FuK4M!KZ zE|`Hh68}ig@EJT_b4GJ_SM%z&#+gUWoYy=<*ScR^cX!vba)<(7pyte#d3lInOcmp1B(p*?L;q<9%k#T)R6(nY=zaZz)ZyP`2x9w@a zZLi30+biqk~$1&Vr7OPC&f~q z$5koA;d%}PJ|g@k^1~>#SYqYfwG*r3r1U?UI5zwXE<)q3oj9(7B|sc<*f@#fhZ9YA zZDAi_!W8yrBd};V*pMMiQ_r*1=d-4+@F?Vmk%b6@7Z6x&B~FZ! zEKQufWe3&8$a#5RXRp}T*~|MnTk^})pGiK%so8svQ?ob3so5Ls)a+TOX76xL%^8(V zu$r>O5a*k6<9y@7`G$(Ohgo>_rEjs5+QTfo0m(-R?}qp`JlPPh|3L3H$NO9|o6l`> zyqn61bW-fQJP1p)9e4b|`%HKf@}YIU@vir~Q5|oUb-wX#cAG&m)cMA{B~DIx=NrF5 zhV5aTZ-QisJPXb@e$D9bqv-Iw^NrsWZ1*XJ7%uyB%9s-wcHp!@BT*u>&Nu$t5-ns9 z(!hH+Xv#Gp8H)3bKX z80Q=Rh)}bkGU!tSLw^5A1A{n(iSv!W!~h|X5Ykh|Z#F;(B|tde_$>wo!3Y!Q8^6^6 z%QaA(Z~Qg`tTdFua;X7UX`pt#@s}BBwNr5iS{5jOZNNxbA)H(ga{ykw9TD@Q(IV#? z|LBll8X%KYA7)_@I(f`&-9S`{I0)O|XL0I~W;^w`FR=ZPLy+{%OH+ zQja*__@`%>lX_%o^Utsq;eNBnv!Hgq@xKuS_^1zi`W^qSY`z$L?C&o0vICC)O_Rg@ z)Xq2lJ>k9J1m_z-=zQbfYXGGoop1d6GL#g~H(}oS#=qZi!7Vh-H~xbW)ra#XL+yOy zKQv|()=c1hgPtqSH~zz8mI|a6otw@#{-ddr1&{+9alY{%3(phC^pMUs{*O)F4alNl zkDG?gLl!OjiIHLviQ#R#RP3Z__7vJ%p%T9)F;j#fXbiVOlNIowV>oIbT^Ns&fDd!tF-x$p{I{wS1`)+nd zD)ta^86`i|)u?jFHi~fE%|@USM2*fn-}rF8AxV{SzVYFFV@7S2alXMxekCE+^e}}9 zh|V{Fm1|faFgo7=Hde!uRpNZ(!}&(@N`rmg`NoIyjh7+6@~ZcBzVYFFqsul_S?3!Z zxK>dk1)Jy)W}R<*INxZ}c>r7I8z0U$wCjo0EUL23H$I$i^xU|_!r*-4!}&&+Z>tjL z8z0U$nruZ?!TH9A^9_xKVl}I(tn-b3jxE|DFzF9)zM)2OC#%Hy#)tFGlW79hSJ~0- z!}*58o6a{D*x>kZzTwcN^9|H$oo{?N->gQ>biQH3#rejE^UYnThR!zxqG!VS<~SjP z^G#OXx3US2SKTj;WJf6U3(2zCAiV+qvWaRCj8rqxX*ghtNC~oCXr&Ob9LG?B2<7_$ zkVhnkgG@S@?l^&b-sZ6~ZJcj>IN$W3{bP*tjSuIWIQkeh#vllAzF`)#5+LGg4T`9y2vJ2)tJ2VjSuG=S`)#;^8j9`NoIy zjl6T?+=>)0c(R^p%h<3e8ZOvVT)I;fjv8VxU}l{aK6z!0U{SW z-}rF8As;y3n9j}JFS;H$KAdm(Y=!ep)ez?!AI>*g1L&3o=Nli+Hw&bC^g%k`_;9`% zCe1{DD|Wu|;e4Z~k8MO0xw!anzR{Tes=>}TKAdkf<{(71&Nn`sZ?>WVeD+C4wazy_ zoNo>Y;sPLwoo{?N-%xrw->~)~=Nli+H>`usH-ajb49+(icdOtAJKy+lzR}n_fF107 z>nAhFdIN$hizIjN12b~n3q09)&F;0s8h;xO>k9*yR^9?6U>n`cT z`G$S6+B)C(aK51sTAT`yO4&+y0GWA{ZW!4FF%uMLL>aUgD^qZtO>m-{pg6tQA>JkM zX8fi&oVMdaSjL>1V&@wl&NrM+5W4U%&Nn`sZ|Ve_cfP4D_ALpASAG+W6(n1a_mqix zvtr{uxKTjdiB;;-t(YygA@uVkP`!XXmPzvBpeELHNWB5*Yeh7hep;WhUcO z25B;vQPuPke!kE-A$JXUaWiJhXK*nG7mL7esvJ-`<=X&pL##uCXk{|x8Nk*9c8Z3@ z550ZXRIYQsihr~np7Lu`=)9srubV>LVFK^?p?6qF`27i}{owZvjZzK5?e(*qDG9WY zjeDfPC>H?s5l~Od;^Gi4w4}~-B~A)fMe|`2+cE!AQ^JP#Us5e4v(KR@Q%O@Axd(8?6fS1& zJX|p)r+Ut&Mu_ONj{4vAxqs}k;s5ycxk1)3^}SB(f(`31!1ry~y&WgUY&dq$-W?K= zenUf3&(7_eHgMN-!_tG|RJU&f7Fkcmis8NudRcUR$Es!ok!jmdh!wwK%l5sy4s6`p zw_zuJXy^;Y2=xe12*0)i*=6@bpcWQ5tLoF zO8{WwO1gI-%4^7p{WMWWQC!Ky^!Py_5xj}_pX-yz{lAYZ z>B;&ex?drJB-SUXa2-K1Sy-PGpsY_CV19ivPo57ZiS@}mxeg|Y^+|mbOfX5TPYMOr zCsSOXqy>2?+cfMGRK>~+0Zy7_ZpKySM5@byxJQI{A)h@9Kh#v=kR+^5lG5YqlVVauTOG3?fl31Nwfqa%M zM40^QB+0zeL~qD592m4Hv9(mU*90v}Y%}@yi6WWUVes!4MKZCol)T?JiezG!VNi%7 zndnbnDIF|w(jp8rEp34s+12t;+585Ri!vhkr&s%kpx=kvkksX?GMo4A#20`@PL;w zR2e4NgG|M4M*V~p|3d;^#&`D(9KZuiJgDjF>{i4-1n!>ajX*RlbW0Nm(;HdEsT2Bm zZy-!>lo_@drk*z(r}{$CuYrpw+N;VCpcUPLE4e2Ogz1%qn~=}49#OPB|LAbZ*oxlR zIH|q3Hz~XW7bXyFn|nI0)Wr$a~# z*cm7lCfIg)ey}pR{|s@-PCqJ9K?Qlc;+nDp1ojS{r55Ak@c*`Wl6)oc)2a%e{Rjh@ zKVz$;=!`8LQ_`HV#c+iAGqyOb=Fiwd7)N9aXKdN1lDeQ*QaED^!3zs#Y(b&4n$($C@d_ZsvtIySqU$bTco!B~DKH&Ag~$Bwz3kvzb?tOp#|{GcT$c{U;PH zMAD0zf-7J=Y(lU_bIO?GkjF}OG}lOk0BmsOJg|8mKqXp88%ZykTdo0!bEXMK>wKD# z^rCqsw2{ZsJ4RCtuF@}}_FHjb=2$Exb2Bem6r74hB^{)WC(}nqgqn?kaWgME(!d}N zx8r0pFIr-N#gX))W&?y!b~7((F)#?0-^`0z4X`+pUesoQ#gX))r3N@Cl3ujTK&zcG zui?obsAz5QGiiz0%!@iA=0&4Ln|aaEA;DbGWN1Q+{}wMds>^&95?f#En%zRgMd;;TgOuSCXya2NHZ)4 z7v@Y&T=C~}aS)vroGK6HuIu0Y(===?C~t9H}j%z1hcVb#7KJ4UD;X(SwnG3fM?` z(L-aF4`;b*8%ZyEc+6gb)S5_o(W9v=1(1)V7d;k!Ss*%+Ui4#AcY{RIiyk)((~2*Qi!A%J(s1; zH@1LGB)#Z`WLCyqQ6#|X1HuL6GuvP>FLvTHA<^fi&VTc6=7&r3(8>?X^l3s+( zJk2Xz97!+2X5OrkpgXV z<14~u9yN+P$%tAQ4%p1|rC=eFUWCm&4)4K{^dfBLap(?-q!(c`?=&zN6iF|_X5Nda zrVvRl!e-w2LMD;)xC#>{I9_$X*vXDi=ogZu>>#3%ewbJdf^q6Z^e+yWB2t2E7dj|J zEXOfaAVT?T0gy)|hl5NynC>`%JYn;NNO}=A^DajFZ6v)2n|X8(*D=U&x~j@Bi&+T} z*}99cnWt5aUZ^41%rkuuwNn>if>jkF=|$MgJ6E{MW?qENJZ6QfZ01GS%+nAPNiV`? zo~+JcGcV1H%Rq11QuA1Z&AfBrd^tFhUWCm&zGMj7;?2AWn|Zn?K;+`hya=0lok@O;L=4tG=QPOVaMcB;K zLSi#7%@M>_%Kaay^K6{tu~tR=9X8KMdJ#7BUI0M%VoU|t%wt}6W3!nTVKeV-0UmVH ze1MU8{zRF@)a&84-`NgpB zAtUSqCpA1-MDWSz8LU3Oua73$ z#u^6STgj#I1%T)F?ccPgpKBmaYHKMcIR!uJ(z5V5AQAL^VEd^~X+_0Z=*|$@-_h6C zzlz(gr6UXsQU5xyJF=Sb(Vf!D_#Lba$5=P>;E7?SX&25YVWI@Tm1+cjNAd>{a`e=& z^6=xxC%12gmo?9--|Gykko6&z;4)?shgs=J3d2Tdu!3=WBHo+4*)X*C!JOc#$e!d zukXP(d2`FEr8*;L?f|$37l_tBVBFUk&`hLA509r%F2TZHGCd-^85h17jHO5BZ;`CT zr$?C$59|p@ahx_gt_$RNQu)|_!;28lZcJC1Vxbe4FlLZ7Jtn@M6$F{G@UN_Z4EmhR z@ZnrQWkZeTdl-5!QxTB}9od4N%m}mGhGl0J>%o@YPA9)&N@-C^rZWC@R&qvWR5%tc z;1cfA$&5{M4ViW9MRd|}De9UM4X_ zvE;tfhgkw*t(m8CX1dvw8nAH8aG5&8=2RacFd1df$ZY?6J{BurFMSX8vY0ai?3^tq3ts+!YJ_9=1e6TTCFW1eO&36+MU6Cp z*tQO7Vwi)tSHfjZH*ssMkxiTl=oF-BTz6GlV@o)v?g5|=NjGu3ZsOMg_!3gSiF3h= zO+3}W*u-@jR@B5DripCC`5G$?flsDw2rg?9^{Uh7ap3S<*R5t~H&Dd(Ljy&vW3WX> z9W|tJzk^_E(*)bNqhd4JxDit@X(CPg6>rs1u@-JPbpfyvNjGklZrtSnT!NHuTse3R zy?>1wR@AsPMU7jpv4_7)4QPb3pT9*->E>+{@tDu`eVU@1@;0EaAej&? zQ({ZG#@asBahj2ITc+u@FhJEukn(ML_AqVv>wDT#_jmQSBJmjoH5elNS5U8dDldEx zo5B0=b3lKLBr%JE*b?4`5z}yQkhJKL7X3H?jz-Fh{zilaV(a z^#?V07Wg=-Rvf*JG7J1c$q-Q;vv~LT*Mvw9e^Oaad-sF(E+n`c7v>jw^|o&7W01_> zsI+XBl7fFUd^!l$`mX*)$prHz7`#Fzb5ti@4)7X)Xf6ntvI?`_QazPDt0F~xJ$ybs zXpzY0Fx2^(?WcxbDmC>Ep~r#KXgJ@w=sDYgM5c3#M3A$k9rZ1oHGa~E5EK!qZaQ?+ zIuX9YyOFz6Pf2=`#wb+{7{BqTAA%P1>BJ$Lr}nMgZ5yYf+1v)U7oUVEOB)gQg>2O% z(>HEY^=#`U0G@|5>oQQ)f{J?ovMM9)2Y`PUsqRkTIORMDnb1Xwy2G6awh*Bdr<|8H z);|?f%Yj~#F$jsx?FF<-5)vH~UnVZIVYO2drEoB>x zemeqbRw<~?K%(5A&~mo{z6hz|RKTgn!F9Fn*^LLT4Ybp}XRyZ3L+xMNhu1)u{GARa z>i4YOJnYU>NAO;L8t_jd>4(*Ms)G-!Zvk*G(!2&&OLL*_y)Oaw9MWNhV2g)JZ~zj_ zI~VaFkcQVog3BitBsicJQi6qm&qflpIO>2pibT5r*@{%R3`ME%4+6+BJ%C@WdbP}% z(G9G5(8UInp7_zH)EqwH_?lJRuXMCs)8}!V{E3jRsTKWUDXauhm%0;!N-N?-HI<5Z z63`zZOIbw9=p{%CHY2kI7n_jg zk!;}^fLwswxkw8yLgw?h_#D!r>yU{by63D#jJd~{0}JoR#Seh`9@6{?Q2ba(s!n2U zzAAkiPp<{X0{T0kUqM>15}7O>7ipwwR z3Yj|$cHwi#FxV><^h8l%W{7N;0M5b2We3R$>N9ZJFD(Nkdy;*GM-?R3PY{# zM}YB$pQ~Y{H8OFNzNXr{>BaVC<9hWyD#-9NswL`glPA(V+&H9ku zMOu(WrV1CMkY-uZMbiOgcUwFk7Y&9%0)-bY0AMy~XE1F7<{4ZR_YbIEPv$5%3iwxn zhd3NZlp@BTFC(d4$~~FlJcXZ)AY!zzSr)tKB|s@b!$HGi#ustH4wso4UiJdK5dKg@9>F&*X zg5Wo!T86nnQLWAL7QakQ=X}s2hSzIU35{+BF@Og!-pcA3agEc0E>*8`EY&QtN4;9W z*}nB16veYxShTfZs$Za|dW1qP2((;IFJR1?KY$~L{xXr{57WqSnK1mrV)9$g)9x6z z?QNNymdmFPpD+?y>`z5Ner5^q&jMT_g8W6~XxY7~@VS)M(;Q^OGb&@ALoHkO?8h+? z1eK{QD{gDSu?`5*N{@F(RVrD5Xpx|18+Cl?kxJIF*d^KvO*?ku_5qvIPxhx%il5ht z<3>00=~>cDk?`qO+D$CCDR2omk%}4|2O^P8HSIWoCUDNn2a~*(}A+5sqw4?4?z<0N| zkbeznHI6jb(S5!tUvcx%nPwoZmS$sby&vC_kC%|mnE;=TR5ukB@hNsB>S3QAz?X~Z zn+u(~CSWUx|RfN!QnnDZ|MPxU$~npf$vwT`+`-l4t$`0YrJv$lw7 zAyA)*^LI$Ud6JHQ?~)rQvsLUnhw9jMs_|-Eg_M6oW+ne3FUZRQYZiEim9vF@z__z~ z!Qj`!85w!Cb@t-PjdTjA6(`Bn4F1eY&XWFpIpBwo<}rQ>D>z%X0-!sP2Dd`jKgi<}RI%k#X7~-8x^fYq0CxfpjdW z6~FOBKkFt@KW77W0BP115Zr`B@sBO#TK~NOe;sLX1zI&y1DddO@Ev#w<Qn965*$W>wnVk)1@ z+{=J7xl=O8&A=5?`BLIG;fl$vB^Q@h#LaV&`x$0_rt%g~i(BN4QZXg$R_Y zh3Ja!>tvFcR(X4j1b?rSNn-xUU$Ve|$;l+Kc4P(SkiXB##JIG~X~H6NV*ALoEC|DP z#8|DCpS(8=p6y`i>VNMO8pf?G`xL}YoC7ZIrT8iMow&8-j}UdWg^J6G+fW_{AaOej z&~d}%m6Q^R+(qS!0PqriF5auci}An;T07R^aTM=U*?$8Hy9GgeYgeZe-=ebQfSs4% z7}zE{@og3m1kLT8t$^&bkYv!s{4SeM2d&KSw)ye^$6@0H^`&hyo%kM=rBtz+%AjjS zhZFBt*=ryO_8yRzs!y@yYMqcW5G{*0%1Kb>lCIX49$B7@?^W^VK;ft3PpB}4M`Y02 z-MPw%KWSMw0ZlHQ_|Gi>&1nX~Q#Kz2tvDUM#fd*{HIPIFAKcfC!(>b)V>?z$W` zG5(9l5_4R>wj>BB{Dh=gWoeY-E+U!$`AOD#&xLoQgQwOUvzn6j@Tb}Fp3i+A1)=>E z7ytI2+P8V8bP#omU6x9a_mAd zHp^Gh=y)&Z>ZFR)-~v3A+}TwvL%=H-s}nxQYx(>FQZZ*y~n zet4dqX0+?N9Pf9g$(4EX*^c*m?ie8-l_zg*YlHA_n1)s5;j7lRu5`TL8z$B0ZKv+) zh2teQWw*jG3C?jCg5I0)6Tq*ui_cYmT$<0%)XqHzu+7BxeEk;hk1y37(n)RGzIEGR z+=SA{L~B6`#5eF*xr_yKsvO&?FYvq+uOG> zkc(|^nIA^m+s{MVbl&!MT|Otaw?sN2=fAsfC0#P^Bx!s53i7EU+uQA?XBFAr@@+)+ zRAC7tJCcwawzuR|Y)e26x)tW)t&q75){1KY$BS0|l|Rw-<+^3)s{e z+gr_s`T@+?-f9@cALPouT?X3nvC;{So6t=e-2EhoEKsvC!)xdHMlt4PL zz16@OeZMz15`EPT5klN^Ea`CoL)1-ZIbmqGzz}Ex~cvAEkb&t zV<{U*2e!8w2HV^4m$;XILord_I7F7n2hxGVtMHn`UVlIpQGxXej?)&|#9i2Kf-&w_ay+%7Cw zq_hogzL?nH=7kg+T%E&x)d6*2gL^+Xaaz;?bzp<50i_TF#!B~PP7xt+gY9Y7u))<_ za4Stf9oXPfjd+NqFad3ZVe&&`_LdS*jUFrkbzp;gtw3tg$r(@wHnTynI1aOw-_c3Hn@ACTUc&_4Fl@H1~-Qr3`;tUU=vUW zHn^O3V1sKk+vvasSM%Nsj~rf+OQrl!SCu`Gt&(uu%`<^=i5dy@VadhOHn=1SOh6sl z;A(yV>C>!fgS&AUYfT8q+TdzfATVo#t6|AN0_xBPSMy4PeLkQLZE#P_l3#i7z5#V; zgR9Fn1U8@!ZE#PQf=vPXqz$M;8(d8~4`3Tmhc>vE2=Su8m=HO%!PRr*5)0#02^(Bp zzAcb|I<&#nWGjNfHn{&H3|9pGhu`KB_V?iZZ^?J8B`z+ z;Vv`T1P8C~Bv&F|)JY`EhJa|7kmATukPdLhA52P+?N6T-B9`NTD)0lB2LX`hCdY=% zM3@6Po5Ufrd4QCd=sGmWy#>k`WuoiQAom22QGJN6LxWsqF+~BAH^|j`N0-bSn*mN7tc2?rp*~Z;;EZaLpU!YKVthg6KLl$dxY{803b$xEJ)MExs7!-j<=1 z#nE+Wkjpm@VT;fGd~_WeAHOSR-$u=U2V%X3iS7Z8v!O?YSkgG8VA*zk8LxbFV z(EvUWrPmf477a)?O4{CxSsP>!3ldpo%4fL9WK#D!9SXb!d>Q zv3CG_pclH|g@tf21*1W(#@#Kr!O?YSkgKuZ2DaEBR|^S)+>j%Pt(5yeQs>z?$@@D0 z3!5L|_+pTo#c`CRTneGZ*=@^KBFNOB=sLuVRh%AW&|<872-n#JXT7nCbB!J1pBMNi@EdYC z-H!_qC+3VRj;=$4Ts~M31^F=1b!d=#P_Whd^w1Gy{Ir4%7sA$5kLP!T8a0BS4Q~8F zoCjCZzsv;Tb<`M@=F7|kiMWGBlpYhzcp0`vaNg+-?Cdtj`IsFKC0)-9H(Y6 zIqp!kx1*L}*gY;ms@1FfJJcM0&Nl(lfHYAazMx&of~s@UBo^JJhP{Gp4+z#FO(qc@ zX>zFTZY3WwJm29n#P#E-AB)?gQd~y(J>ah*L8Hv#H449l7KmlVYM4dPOsxwIIQLAP z>47wMF6us`+%}*~)v#a-phqB?26U;}Y`|7PdXXmMTx^^?gZTr^UM%s0)yC zd-oi`ljJn)JsqRUzmI~Ba;D^!iS>TF5Wf^gBV_#g`B>&hqCLoOA^4-yBMT<)wmVhrs+7DQ1@H$*gKN}>_RdqGqINnyij{vP*2m)m3-v8{ zPkjq@eXoG!OJqAO-;ksB@9M{XP(QYd#zCXEe+ZT`NZvfOH&a0ilKy^C67l1y)~P^E zLYmB?*ih2y8?S3v4a7=|bkqbjtP1^M6CfucO{Z<}9bg~h&z(rBR=IUg!~WslkddE< z2%WCnzo1F=zX#?33hqa8rjJ8uqGSAdm~{2ZMf`onlVJ~U>(eI#l%pZHoCkkLBxg?uKXcJl_+;QPx2xl&YvrI@pL>c&}&G-pX&(y zWgNQEXN6K0p6Y6Q$cu$Tur5SH)QS<<2gu*@7bozJe-VgVkeXx&zAQt99i~af)hjZr zn4i55j5q67U-hbx{Sd_-MVc+6ZGby}uLf6!~&jpl&3djiHuTLI4g>pk}b^-391Zk!I}p-=Xr{h~2^VcEA@pGD~=y}@xbiP=G9sscL!fQZ~gqVsyQ+e?vw;8ZS zHoy40$T{yqJm(0)sFFT_s1`7WS`xwE7SztCA)1qL=FKxSz?Td-hnxw?N*w=C1v=Qn zfJzL$LUsyPePll_{uXzZ*e)eHmFaq@PA|tsK7B))rJrA^`%BB9a(WP71j5!rA061! z-<@9*Q|A;$6nkn>U*?QkM0hF=3BfGTWM+b6M`6eQUi=Uk<4-k`Iyl~0ny(5|dl7@} zk$Mb`dv&MdY}f^pA81=$Yq>apDE=gPv2&u+s_fcq{_wRPSXZ5oT9GKKKJb_`1h_?&&6E$0;3_B5K`35ep)$-J2E zw(*|IHGldEoZ+q*!2fbkJMBF^YmRAe?P0U}c4-UJ_|M}Ll!_nK)6>?~;>2!`k5=)O z_#o>W=vm#>;lw_s0HElraPQY{S-o-lZZsMn_`uXtTR4)oXY=-bY;4c=y{9;_M^ON< zK54%OeH)S{~j{||C(yp|M%^iv3h$ij-}YP zy?@4PL}+VSKjYNd^|Kph^y7{cBXtnBp0;HjGiKE{)z6$cXNC^aw()=52ICqX*=I)Q zo=yAr&A^Z>>@)5qsOP_Rqp=!q_4co!1zqw#*{B=5L-+n$lJRMk;wbxfZ%M}Ik1WGT zJN%X;*5a{2sH4fPu7oEWw+v+;k^6>buTi7djyzt_darTtHe;a63@s>Ig7NJmujKlt z-inm1!g<&XNK}?R2C(cey0?IHVe2tbTkZgmpr2>likFyPHpNnjK#7L(<)nHNKkh3Q zrT0Y_m2=wk+B=Wl?YN4ot?tUw=Ui;#$-LDgh*SJEdv?=#h_g>SEXoAB*I%)5@8)G2 z_wO`-eSX(5t?(by=+pfU9wL8?&Yk7kXN8nKJLp)g5l+x`T$gOW2?DW=+qyL-7Ib#E z>dSbr6!WPNBm%o#Cs{XWTit9>Ua+pKMN|2~(qq6^XMzA5o~>(FH|T6=vNLryGTBC* zEiu_yI*aX8Dchv8DU+S8v!y|IYpY>9jMs)|n%9P52G@pJ7MF%m87>Wza$L^Q{D$Ll zuD+}Yn%hjfMg+Enl>yEb(fE-;ht1~LR;ny*SFofTwYQRNl_ujFPRaRr z&5o_s6!DsK6*zT(WKEtVmS@%I#Mb5sW8g)?jyz#JPdLko9i1mEfSa6Hr^>zrQBX5v z!Sk|9Wkbvv$a_wbeVXE@=*y3e&W0t~+gU__V|D(|Hh-ipL>7Ygodj{E^4yl~>{z!- zyoGTvEEmJ}{I@|E>FxO#w&!05Z|X|6=VREOrvy}!Y|qEAJ+A>lq_^i|*q+yrWW??H z7`EqiJ{@s;K8EdioiEpV#l}44$HsibjrkZh<{yU$*wa9s8}l)2%*23zq@ zT5wF0cXhVvees{ia{7)WG@=c=>#||~ltlyvv9!w+dD>zS%VG1bjlDga`}Xzj-QGX2 zXD=4-iuTT*iN)g(Fc{Y1Js%6V;Kfa|(vrSlMY7P&R*iVkB8;r9ovrj>ZeIfv1Y5O{ z7O2)0E4$XMcD$D@%E$|pH57OymZNg9MQ57QvRv2nszszU;^?(9slyV%B1%g>hZcCh z#kq@6daP!cChR)4yR+Re`JJset#KWl?d0Czc&}SbdC44dc_Ws)PqnRK+zFbH*_D5OGYM^O~KRRZbqJ(zMYU!7b zUuDT-7A{Kh$5?n=;7gCu+{fD6kq~fR_x?DG2nq-)-mkWZq($fo##?w=;Kw$vT)M8q z@h4btxqw^Ou36T;90oG6oPK&#I;DNvdk0M|er+uN7pNnX41N=ykL`=>^43)=wK{?q zO_wl0qmJMus|`cDYNfO47q)`;X*pjFvtBgt`h_Z=6e?7I_}qrAz;YQutniTD%_REea1Vd2ozqTY{Lla zTD5d(hZBCx0+q~E;m1|(5wL^JmlW(+*R^z&6JBbm0z#WRS}@uHK4ih60k;VFpDj2t z;8p?uiv^d+bQWHwa^H~woD{MZEvuWmRyyJ3%4n$E)}`TBSa_waOvA6V@G4uIhF@jj zdQuEOp>lUf%W6rN?}p*kR;;ExoV_soq=nBmaOs5MH5NQaX0h;Em2;&Pb4iBBA~fcN zpHil`%yUZncMZD9;ipxc2hk5ZCmN~3r?@ZHv9_}t!6Q1IXtWi&0Hp0)RAu3bJTZlg z##lIRjA7Efe3cW8wQ%T`@U`neJkA2sd7v<_ws2_N5DWA177mRYxGmi$SMya%z689WJUSb!`cz;RCE4FWk)R}_G* zhwB6ZrHo0@vvu#D{r!V(9k$!!=V45Rj*4ceko%3%^3JuGgrb=$rwup2w;FJ6BT8k; za4Vjtqec~90)ix8wXP~qCN9ABu%?o)d*OpvQ7-v0=JJxeJflOW6u z?mW?4P%=RLJr0$f5`IBm7Glc_r2WHP)4j~O39_fKWy<0`VKw;q-ff6Txu;rK;fqp z)~q;?v}b!`@8EG*@&hk^E%iOUH1#k5EGmEd(`hL>Oohf*u&z}#`=TilJ@;#{JX)kwK zu|A)%@)~{q!t&2KMY`BGsAHEr>%~*h0Q%l@Uf71MGOdf}Eia>s-`Kp-#S32U6Gj)( z_g=JhnZEaum;066yOi#GFI&9nd#`x8gT=af)#6Rxd(F%3E7sL-E#CCK-+8&+#kzWZ zh_2o!=!&m`CBOG_pDNbXo3=ehSAVd1)A!!;a-S9Y>ALUz(bnIP*X6$c?L&0=wih3X zolWTSFJ5>lcG$Eo-?hArF8{;kjV}M{wMwgDCd!bmD${#$AV}5RXu`c5l zZ*&Qp`_09=bS>WK((`jY#k%zU!Q(ja2an^>&wZg-myvJhdOeOyY~JWH>F2&&tjmPRjL}j*-iO`@U1t37DQp&MU6xtiMwjI_Z*)1_&;6fbT~^q(BujpbHkORAb(iWn zveM7J0p|EV)BSX$#hZRQ%Fi8NtlQBRZ**Jb=hhYLc8tXv-H!Eh9mTpGXXP<-Wc3i; zj`wp934OKJAdUU##ysE3eUay_L`CdxoF;W3j#) zEZ*pQrk`6`tnWsPH~OCC=av=gyUF5>zGwTn=3;%%vGN#w&mE%gd4BHEVtvoI^hVzc z{M-}8`d(=3EA(BhP%K9eR_G!>J|6pKWlbeV`r*%^(DL@i*40i)vp@M&jArJ#oRSuQ zG9N(YT^;Snwfd7e1v3ZAHh(fFk@9t2&3J=ay1v^fS?W)I2kJ8*yvjNy%lyf_UHNHg z&|O{b$M*s`Y*g})3MXT~t>k{phDp4To3);jOPS{jxqQ3EN=}0|l6Vu>>mG@c5OzjM zyn*YyTk;U;@#d}bp1g@9@y5MKwCI<7h2`; z|7x8q`6TmrwbtcRCDWM4OSR6ImVBD!KW$&Khn1Yn{B;(emM3lUUsdi#sV@^@)fj8U zPVzIBq+A}h$+f=SmBr)o|-QtZpzoc??f;Z~?vaQdk z^DCC#sPhh+H|qSV%^P*zIYgcR$MQ4k{F=&X)R@)O~Q?`zGLx5S^uVT zHO0#MuC31~>p@Fzl=VHEH_Cd*=8dwxKSWs%+wU2ptRJY{-7+JVTV*|>3hNQJV_~Oi zkg^_C@qOq|W!1?asqkqitGspXx;5SNoaEzbG6$~C&z$2Vf1)O{>uJEOMko32YBJR; zy><}OpQ`wEKx7g)2(BDXwOP84@9kqGxYV>#La?gu4A-uFMJFkxrpMo6xzbc`_&t_` z%Q>P-a@!3BvJ9*ahb5Db30E2mZ|`MHI>w-cn^J0r!6&jqaqzL&y#vlrrR0s%d9s^f zFJyx=^z7^3Gr;hCsa=LakTs$?ss8jRDH1tJ3iC5$# zkeXDDZ#`>}mAY`0v?9r%loh=QEW}`ysO%yQ*C*^`ywv&O8k8IHTdB^;%4eYt(V4oW zf+)ro6(LSU#(eKpdZ}~W(~%#^N=NBq!HVFEgFZ&9qzN==^C)Qt5>F5;I~6zlW%EDw)@a3jm>Agbw#3jHW@viTsY z=@AAtD2QshGS0ww<~C;1>N@0t;$Wf7$ld!-f`w*=$M>OJf`v25%!qIpdP-KDVKO80 zqKG+KW|SGz3EQsB=y6|1IatwWd-K6UGgYQoQLxa=nD{-cAjp=5n^^%B)8}M|4`<(l zVzcJvNwCmtMMNS53$qK9Sg4FZCp&%^Zw2-RWlpf;T}+~~wOKMnu+UWl&W$#^hBN=46f)0=^J=sxL$FjWP*8z4F;Q=<3Yjul9VcOQ$T z)Z~K9uoHyFVfw}@&y0m)Y@XPG@M1_47DJ$iA$V>yR08xQ*4zo`8YHKv=^gv`ZIe5< z8|{AhgSfA!!GM*;OD5amyJO>6{7OLoWk_)t38QppA3E#4J|oQ0;KZ1I6y|H>batN8 z(XpxI^c0{^AWfM->AGSv0k}sv&VLYi58k;{w+6NXxDcsWWL;-l-xeCwm^x>nPM#Nh z8PaK>S8wL)oTcmh6rfil={jd?_TL5IUIL}gIYy8pAqaq|llxtHlg;6%BRJi0+K?83 zMs?BXr>{Kx{yo_yq4d%z7upD%j+^0lO1v>H?JhP(8Ri)AIMY)9hf& zjrb$OWKGZGmUpzT)g9ooM0^Ex)`{9~P@=Xv5&cG;sh@!wf32jSQGOcKDBNjT+G77yQpd=qKM6OroIc%$0>AUp#zH96HQ|I zU{>dV`F#g*)6s=!Ov$ixHHcTfX}cgNvVSA$=R`0eS&TmqBdHH7w`n<`(Gp08RIC@n zT{nL#n?HB}bRS%Wsl{}GWpIF?rce3^EK`xjf|>di#HfWU0(uJFD`YZT2E-9avrhvR zb-+fp4Qd;@Sm!|rcqVgXBN{j1d~iZyg3oiH6|EXBff(rqGlJL<0p z^0*P*9qCL;bSuiv)6>acYdLY;4Cu8;^R)H)UuRKOZZrBIfDQd9$GgG^wEAW=oC6TW zzQ%ysoY|i;RGI>^SUax#&Ht9C(!GvzJ<^fjt$2gyPerZ+=|8|}ftKlEc|D39I!3t*D4qH}A&y9|fr5&u@5fg!>~P+H8L5MWAq&Ud7*KoD9z* z5q~b_#dFGCegmM)Jcx7vWmnt?0KkVFdyad9e=)&gl`{CSFnUNu_y81NU92IK!#AlQjemz!MDG7PZk z)*>CxwY}T-zz6<=POLLtq2ipm+QpI*`B^mlZ0|3kXkq`!7jNB(vleL8iSWZHhM>Ct<(4I?VZ76k@0=Hr}w`v`qdNI8MlAqSEDB$K1Nh*s7?2fa5Hfe zZU%; zg%XFgPk+AvSqa9Zpf!4ZDbI3B^la(J>Ga4CNZw5(ZixR72u}yeNqjE(9W+JfHaUr# z%7}D)wvQ1f0%{`eghApnVJ3n1BpW0ralQXB>HyZYHb_q5W-)u`r*y&wxnRw=zzq?L zs0lP~-719ja@>lMY+0g*0f~A#m$t6!?1G7253DwmDRPC>{AxpCw`TMlRGZ9)$#I*4 z$3+f_Cg9E~V@{;l;ka{+Oo_;b$#LhFXfcCGhskm0mTN#Vk}x^$+|fFpju0ltomcXt z@GEyx2|09r60$ENi6STnLe@C7?xNrhOrU7G36tX<5o$ID#xObVkp>2FNGD-(aLjUE zAOd$Wrj6TdfDlT62$SQs7#IX2Ov2>2tp-@Gff6RiZ8N}1Ln$nm8eo+M>M%L(G6Su4 zO7}--m2%exBk-*dAsh|XKleFqN5s5nv?xrDdvr)JEy_vCl~mAnMN|)fvB-wWagQ-D zgvs%1ft`$EqP%g=FdH!AQsr(6PM2!+ZS2i5CzUcxj=R~@N`mGXCdb_pen{{^no_%4 z$5Q(eCMT6(1^yxYFqxWCi7S!GDBLa`CdWN3co>jKhskkI&oC$T$$PJRhOH3yoqeAL zb(kFY8v%pdMhKJR-j&T4+v~V@7kb+P$Ni?sp`&fVM;U~^C-l+FX@jf7?)`=fZlwv6<31QsjWj985;(%-xDSoF8cK-ORHFw=m>l=vG2anL zEjl^F?Z- z3JH_rB213vl?MBKm>d^ja%i=QC7g=)4U^*{OpY$wP+`O5xCoQO$Skp%rV8{)8z#p^ zm>f+y4`3T6$3>W&uL|*^3bagZSLtxTDa8xBViaS{$VRBp?Re8J=Twh^Fy^An89Oev@V}T8h zi!eDH!VHrGwc0Q_F2dye01Ox=hYgo7IWEHFEW}-5m>dGpGZ7}|XF`TBIjO`Yl);3_ zDQ6~?;NaDrGa$hQ6I`$EKW98d)!aCsdld2(`W z$V`Mekh94&n}_HoOpc2%IgEKX!i33j5hmv&Afx&aCdWmX9A+^^0U|+hT%22}^^Pv7 zAvm|vbV$@r#iSCfYD7Lvj*BokKNYSLCdb9OmCOoP36taE+)54ca7z#-$3>VNc~?Q0 z9G@32fZnvF@-Y|ZR{k_aDT~A8xCoOYZ%h=nI82Ukw#6eh<-m>kx@Fgb!MmJDHXH11Zx4GxpzB213P-U003FgY&5 zVNjr}&THcXC-b1Suw2$SP;1hJKJ|3~UP8z*^R=Y5Pm$&YX(K*#xt6G%{@E(N;U?v1Wk+trP%Y@W)ss$RWr zRd>5w$DG7Y1hLRhkZpUowe19>;>UwQ=myncdm67Z*uCVZ+dew4V=Q40!wDv&C>h_1 zr2HUUjlrpC;4md?4HhRQ@87Zo;XwEF_U`YO^9L;RiH0N|vEI#l_w@IeJ+5GqLE*b$ zmju$GSOffO2`0yHrr3#KN_aNKE*Js?(@F_}w76HI(IP{DV0!!{AVWWB39ImVIKF@H zo`F5sN_2v@3Mx95NTTF;v*#Zy)xad#8DNhD83~pZ$YbO8?b*M#x6cWd7sz8#@2<^G zuwuAYT_TeA$)H_R)WG4v50<#|A;W~LAd#o{)`OK9f*hZv+HocQ%cH^>6C77TI7&pak{TR8oak5$Mk(v~0y0v^*^c|s zV4eGY@Yj1UPrFFYh7#W(xq*<>gZg%qP?ZP8yQu- zths#^F8<~u`=)Vw3Ah`)w9!&pgKcmb-3v=Ku| zMMXVFFZx#Ah@oVJfx&~6o5cDg*pkZlaVVFt_94mA^exDz61U^GO5Kg$GX4NUj-g7H zhfT179$#c1lB|$Xt?fg`=j}t1BQ#j-LkQ-(3qKH&l?Flk5F!TKha^WDwAhEZDw%bU zMvW65fEecHB}ZpCS}9IC>;%Tx3bc+J_`-;sb!0+n7qLUm{msY~I1lS{Uc>zdj2#VK>OTtQ4u?@jFm%EDMLp z)QGSH_Mee_#HB{&Z<5SKsZnO8#^fl)oz&=YjHHFPzo=l|k*YGqLMLI*f=!Ky|BV#{ zI1u;-RzLUv2sR$2<5E;O#fC{kX?2QihK+{|SEqFRF!oe_s25K$GKfoS zvt$Yzk7As8{*_KN^VjCc*m#sqN)I>YAF$l7?6)*Cv!k8uuQ-7>`_^epnS&0~b|q#}JFZ0U^nL#TBuv9+}E zC~X@3F0Pdd1H|%KPzfdSQPGdR&(`GkwHnjw@k*)M%Dy96Jn-dBV*oKLFpa9E@nI-6 zmPNy~S{{CiJlKbXNxOaE>u0Pw$}}XQnXWWUgY+8KvC6b5iKR~rQB%X}co%CRiW7@Izzu>kk6=Wr+v0!!DU=sTb*xN5pxT*-W7nn!LDskL zGKV*G@b+8Sl~R=q<2pnK4w77&P4HBktgFOP2yVS@u^d0N~GBiRQ3)e=cwo%n`xB2ADyQ)pBg=&viyiF7n+)h$1DfeH-fcj) z7pNXKpl=nZZl9&w_3s6$2Mp+?0@XtX^lqN2;TZ!m3ein}0u?yUNo@K);d=?87obAZ$$Nz;$Q#WJMEKY#_Bz887}@1owrrYB6T=V>gPo;IMX{vY<<1iq^3 zTpQo}jC&_1CnF(1fIygpgq)lN2!nw@f`AM$45A`|Oc2dv5)c(psdKH0wbnWn>sU*z zwN|aQmR_w@Yn57SsZ+UXt+lqFc5tfJ?|I&}_HdHmz5Vz0*Wdkr&5w0h>v`WbyldKf zt@ZAAX$Yc^*U;BIuB3(@^0;2t&`&+C_cipI$7P_au`j&mawYOKs2x!B zZDv@+?tna7;Y4iAYO2LA1#&T*hb;G`wD!E*{+@){(;N~u8P!7X_Qs4U)MMP*CgtD)mGgqD0lLmeL1^BOwK zroBe;&DBtq5EB~#48%o6{19c9T{NkQgn>nN5*T>zX+K=52wbiBl>rM zd>c+ge*vCfz$F7nm!eNc9Uv^n`}Ccw7rKbh^j&riMP}aebsA zYMv{>k|FdQR`$1Cu0(-`9MNU$E=N?1U5f6E-H##92XJcaI%1E-gL4#|h+PBEk#Nba zh)%I5q8AMod%G@Im7-GY-5NStLlFB)4Q=$eZr0E#9#@erJ+-VU0n$op=!+iL91Y#! zawS#{5Zg#{9I?>PD<nFg-Dv(+ceBA z3a>mGC&6%)*go8X1wkL~Q`Ppjw}xf)QL!9b25^=7ogFXX>b53kT@;aGnJe*T0w#IC8*k!W%UFW_XtOgMes`jNzk59h+r$vz zJ^=E5SAs}W;mY0zMc(fsAhUt}JyN~jC6OlI?|z2JLgi{jzu#4Z##Vk^(a^&ZD>bAW zzN8sXyYqozvS6|92-~A3VY0Xga2-l8AI=b_tA%L?nSK|}Sl}@Af}u;83eeg&fGJ>H zPNu1m>|Qc02Ye+ME{B_0jljL|+$}Nq+QpmROyhROxFHfg^$0z6-vJmpe}pl0pF3I4 zUk4HISvVQUhd`C7`$Hh_!pT4`T!r^rhhl)_(a>b2`RP+2u5l4f0C@bQBu zLU|g(K<2(Zp~)Us1WiI{j>mO&L_sS&t}8UO$>X|4Lwzn+;!X|e#!ypt4l;nAB}K>7 zeby8$dNpL411F+q#kA;~fNX#h(RahM3obbwNl^6Ps;qp|0bjeSwFDoz1xYT`P$qIy zg-LGI(0C1@g1R&`!{g$mZmf+Z9@k?UI>F;Qpdspms>)8hHb8Wlx=%+2_+$XWxl{M8 zkY_KPh`q!S`)5F&h7+;>0?#{e$*U2aVjoi33=sQvUHU({g-B9Qnx%JCxY6Q|X=ns` zqV5+5HB_P@aJ{8VKi}i}n}!-Zu1HiR-|BKDMrz1uaifI8hJ!z3Y^B`yhcmtkb{RIK zu(Ha9lVP(Np5x$DjGc%9U1G*~ES&Lz6XQ!@_<|GTyYSrS#&{4hg2vU1@oqRfW2(;M zcVKwci81XM>?y*jJf1-e)3~28!jbIxPK-0aunkU1bq72*yD<()sSYwmUL^YzC&n+p z@G~dI2k`ubG3M|^``$3+;BN!!&+Lq3^iM<5Tw)bBU|NQo%O%zWnnT8WHPD%G()!!s z>4i%^0~WUa%g7ehJD~Lsfy$#je@|Hv=lJ;Ti&0mWHN!Ttyl>(&MVs zP`$@BPeaWvSE61+PU|Q6Kwz1#P&~dew}y@6CQw=CTig_qZv*0N|A>MDr=jG$%~wzO z@9G%8&@s?eBbdS%<6|dARAS(_!8+AgFk!*OS%r{Na}}0IT?BSWy4xk)3L{yf$@3g? zkcn)^Z$qH}bi6cyPC1TObe|m1;YxOaN;x_em30rzGKuinK@p%&mE=Q#5pK{CAjX~O zT7xK9yC=$AA8Uo4Q1i&M)!rqfGE>+1^Hw;5=C4CDywz5 zP<0bTRE1&zsFQ2-l55gXuZB+H z2>%go-Ukcug#n`DX^r13Bw{WIXUrV62n+w!I0Atyor1ulp#BZ+yy>XBBLK_=WfolW zWuRUhaUxPb zj=6BE;DNnN6K4TA15T!i8{xSgF1a2_u!h5kj9h&+%xB|PP+7zRMP*m**U&T#p)+2n zp=yuoY7HIZarMtsX|;G<=WFOxkLywmUF>otc#91Sp({m+els$_2Okt2uLV~nwCE2* zrtiav=m#9pe+}e6;Y9T48qEA~$^A%zqVw+Y!JnnryVXi3DGI`dn%g&EzWy~SlMalW2|t9y+A{wH3YF6G?ehTnl!Y?<2t0FbsiUQ z9%AzC9@mE&+Uas7;uuZ-7RTFbr7HA3#pEmWbwTW$=_>!emjuU)KMCI+xH|`|Y{JpN zh;W+8Wta2EE$}0~&01`MJN&EVmZEn;Y86;=HkN5{-)Gl1%LLsOZna zRjZZLJE3LV@ivb!4wJGdVJyWg^O#QEUz!Kp)E^7YWa>Xh%0H3RC0-+^r^iAoKQ)U* zQ0Xwg?4-UMua$5tdrpN@_AiIZnfmax_yPv5npz-;vV`kb6y3KdUf$h(a*bOrn0$1) zyuroVVi?CDx|vhyBz%fWcpK1D;HJsP6*%;C4NWkGl{`PV0pzRTs<{2X8>yMbfeifi zg~GD+{{W!p;hsUEWoh^eF#jB`>`9=qG&~3oySINttEJ%;pzv|=2SgUCZ)tb~XzVT~ z3az?*VxNW>M8ERO&mH^$4-~_kr7K}C-Yjm%l>R1)W!_WeRKhIPcJXx>TX0ir*j;9Y zmXl*PfHF8)72k^Zrtt>Fo*fFuX6RM%%Ygp|_Y;&*L_Zr5b}{1HKt=SA;2B!l1H4Yf@q28@mgn3Tko)K1lOLG<++ zN_bqBmSB;`HBv+CJg)H?YInI3Gd1LhF3-3YWPnYQI7D}zan~G+xdBeZz6%r)`#~W0 z!-?2jC-DQtojDd+vyg+Q$u+g0@p(tn(T2^>(bBh zxau{;JKA(w>ovs7*$ClPuR}wQ*hZ2gh=smfG5HG3XWS;;+ivob;D}*wbCSpi@vYT2 zPwROKkENh`Xt7fH$J05p|47WmN?p*g*F(-S?qW_~50xS~HBG$}Jc`rQeE@EOoAE{* zy9(HK^ncjAjcy8uq+3ex%arP+wYcjCRETnC3I zof7FHP;^B(kd{*B3Sy=)g&AP3xB*3xxq>hTA7RWDUz?)`%zq%|hv1~=Yywq!&TBvp z!AZ}Fpxy&;QUEr>FhoXtpRqH`lzL|+DEF`S6r0nb)ASM)4IKD_9~is~1AriOf? zFCEOaVK7(sV6NSRxxV0X;f*!5$IDzn5RV#)?#vaJL!OJ_MC`{LvA+l8J8&ZQui$wB z&J{a~UUYb|M=Gjc>{1Q+#9lC%YxQ8Rw!vJd4d%MU7ldqd{u3&wzn?8N` zB;*Z?e0amcXg2>8RBu>>_*aR^L0&UHK^=VzS4LD`Gw9(E@mH35!y<*R8TE)PRNosG zX)IH-qHzjzAh60C)_m`^+j-{}trf%kQ7~eLM&mJ7gwI)!h{-n+S2qF*T+l=9!uw>? zX^p;<2gaMm*=z}-RKrd4IAxvxqu?6Om{)^zFSFt^v<8aNX6YI?igPpd100yc;NGZv=(HLiR^Bq-B>` zEreru(>TOTFst<=6PeYr0AmN7FlM!L=IfzdkCd0gNgvO0mb$$_y5OXbUkT6UaLE!R z!6y5iDuA!Ma8{cKDvS3wMP(mfqM>Z$riz%{prHvG0#}EIW_eue$EviJd0Z!H=tPgJ zS3^B6SK@pPIh{d7-+>G;+j6OkS#9S6E&9EX>25d?eSstTK_JhSK>hp zIiky~_98OC3X`Hcvs&Sa*olD?v3ne`tAWgc6R|hJvjHyoKB80XmsBO_6L__mDuIDtg%Hw)jLrpGM;*T0~#D;poXjSMd6qB#e zoYfA3%5Hj#mjp))A)SQmp(lz^Zw7xkTbM5dZJGsbyg5-hC5@kjt!_{zg!vjJ3QK0{GCY_@7>iH7iKI9)?0cw852sLSKJPDAH- zTz6{dN{{Pa4c+E)C7#fbQ;Er<(W+EGc6pM=Yv^S+rNl?5drFon)pJ2?hhkx?bOmMK z)R~B3Z7Y~(24`VftC5|KYl4-0?_0R2w-dLZ2IVCXrcAskd@a;Bkyaf(em3`D{{HBE zYz|zYHXR1Pqps=3?QX5TJ@^0t7Q*!FDwokziTlNgXvjB?a$ZNff|Yz7H8)}t3lv#3 z?*l7V%_x!C6AUk`#q3L6!PfwX%CO-FKptmH5NR=7*}I^~<17I3z^YJ>vj>?b8h9)s zOGWt}XODr##!o65r}XDEq?@9I1s;RMP3+v_cX!bK36N5I33iVGcfei4Vxg1amYVx=qfiM(xo5%H>hA#BDUe?gHE?44@8qyW5M1L0pFOcaS zI1zmZs3Q9CMjR!=iRiQ8nE{u~Lb?<^8<7W#K1SzCwLUG>R1MA25JaD+A?o~TE^Y)< z&J#VZ4>i=|amCQj$@LkJD^EjLxm<}U8gfLJN5y)ih6jBXM0Xw)CqSNK;Y94aKoPOe z1acaji2Y@Fu7ykXBRa*l(2E9(y&F`PYm}n0#V^&+bPYl5y&9_VxbD)>8jp+H#Y}69 z$F)#Hr+Zw>H1s)_E3t8a*r;bTHw*ne#pIismj{gmhX*s#)s)~cBzLNK=M0|iFkvZu z=VhGjco?lFxDCz(SLaQSTU(n?MrbvzW`!zsNpOs)QU^JyEN+8hFR{7Q#aY~sOSemc zN6~K_FU1ki`B3__uJ=nCNc;l4#8)^kBF- zRA1>ud{cf;r|->x{TxcPgeolRUG{E^4Eu3P00r`lbCzSI@Ll!_BycI5%rEmuH4gF@ zucDtEt>>2|0Pt2!81qYPnI2^KBHG<>(%UR-Y)Wr?5y-P}(%bSjV-|!<@*SE@bMjJm zfV`-oT^d4vdQC%nJTATfGvdu2SBtHh^*ja#uco_yG{9H#s&)uz|H#CHtuF}w7 zU9QBf8gd4iOs#hVG>jtd+G2i*qDJJEVkTvR6Va<2(Ki5D11F+i3D4zlNdpzn0=1#u zm^KQ;OIrw?rXdulP(zn^TnP<*+2eW&#gYE6paG)4tR*<$rNL`!nA59X8b+Fe-gUVW zSsHRgm-(d-AQpA_b?29RAQ>ZQ>HuUbE!VQ0 zp{T5s<27`thEOTIV1%W=(c{{sp?f^8dAjsJ^0-)PMtt7m;s*JlL5!bw{_2G4%DmD)Ye?6VdiqoK2WO%v1V`sBE4AoGGxj2Y0$;!yMx6f{8eeOdx4 z3hFc-(9k(v8c%76+JcHJaY#c9;)!U;=zI$x)`jdT&eQ)I$a58(h@Ei6-Vfw{I1&3J zc>WBRoB}e78bL2Yx&w+@rDYqTs2rV(HB_P@RLb!hn(uLSXsE&Cie;#(YxTH_G_=Fx znxdi4x?G8B4LM?~cj)_(!`pB#gHhh0XSU$g7cTjX&ig4h)x<#!sft8nBTT73QY=2H z`TD@|#YWZ{mYt3Q)D)qXee0H`eGUAaj$hI}8Bn|Hv}1cV+$I#l@KHjomPzxu=r>P2RP+C|o0Y=?MjtfhT*ojtIqXx^oZ z(0?wTHE=xHUFz{ci@6rx92({qkl()ZFxcV9^AWPERv&A9AuyIo#jqCYD<)QNctbJF zGQ^WRY_OEv%W|$;hhxhPBe0%^JLwo$ycov8H#1Pc&&?kJ%YL}Bt)R*(YbQLcaMXma zvS$S#DA!3$C1AXbdN+>_*ne50*Gbm_eiH6Kkb$)E8%XpOxa8eH*+h4PqM9jjzlL;W z%S`z?Fq}l7{Ww$p2~baAG^FZBi@qKi;9*YDF;hOhT8q9DGVOp9(YHFH-vHzqI1zn6JP*Pp`;i3O zayB9l7JavtV7a1FbbhQzp&B&=(f4Yo*W2gsMhh+m-o`!aMTsLdzGLP$C4SmJqdPqaxcDWMIXvh&82b<{WEcCAx zlW**CqT}#j!)SilKg%g(E%EnGIP=(m{r+0rNfx6TYT;!6tUzad1*&XTfs@ zTrvR`X5NGZ2Gg ztbDjCF8>PQ!D(0&5C5bXHL|Cn_q=x4@&%*Ggl0bk`jb@x0rVwXbosyLes`XyO%Cy(Pmf;#v=}E^jTz?jcvij z`m1vs_`p_Br~agWmN|>ZK?@ftxTUp&_bI65{gJr70ad-o`&=D2ru*nC72Pk@La`fE zvwd@W2Q4OuaOz?N{UN+z7MM&lNNp#bX&X#JIe7+5vGiapccqq2!zVd6OSgzIW%D3p z`T-JHxI&)5?@ANlUIOpw-_hOOW0>EKm^9YC9}mnQu#Nd%vPzwJJtPNSzXkfAaP_RA zhro)X!7ThfIrX#0;YmjS^ix2ZiWVIMmwW^~9IZ1!=J>&6_6i_&gf$BCO*c_I72nkn zw&(~L-s@2urg6FpCAu`kB+Jp48(2L>0I|P|GMGPACzU-wD9p=gZd}efo!sl0~=k|RLzQ);Z#-v!rBHly0nsr@dRG+0>)F*vCcA&TDi7p zQTeQ*s_7Ne%ZrkU^4W>1^4Ucv)HJLpYwc`mZGoMN(wU`Au#4BcwWzmsdpo~YD@s;Y z%&M4uVo_-)OzLj#FWubKeq>*FTR#At@3ysXDdh`oDeQ){9=T{vSv@~=+uT{S7~#IM z746Nv-OXFud&*YSFRxj+zHIx9=`#{#8007WiK}Z?)F#UtYZup-RZOp(US2-4tZ#E? zOR{`(*^cIlWLeD`#j&iss-{fkx=l=ubxmjHCYsTkw-MvTpc|mAt>-i@Xi^BJ8 zJF*$pf?9W!b|!i{w)Fw)-@2`{3I7kOsm;C3TaVn_+qr#aUukDi>6W6>RpmvcZEf4S zpXXp`FXg}b^-o4Y$Z(GsO?@ONM%GB$mB*?@n8?P`k!sLst@o42&~{_9L@ zKbC{8uK%`gM`uj6i49|xj%~ZZw1T_w%!cvJZCx1kQMn=C)Y#m9g;ssWXCAgKdE@Clp)QqSeT0u-)@8lLi za}XxhLc8rN5zb%=Y)`E(tGv(5JqN>8>ft~n*RGDB!zgQLk^KC#P+XKM;#xzC4A)r7m2Q!OU?$?}!ooVunFyu(ZGJI8 zn_v82+58F)viTJq7UWlGAw~|zqQh-|$`}!wU(pe6Q8)t{(UH3UhhSikhRclTsIgap z9mcaFp3Sdlp^oOe(k(hVcr6%%j^#Eho)wF780FwM+Z==69R2{I^kLJ=v#&xp=Cj;p zn&LS@sWsXRu7tVN?asOyKAsqlGPNEUfXN>Riih*0_w1q;hDFQL4)tA7?7G+!k~! zw^_x(=On(JYoEaQ;`^oXm)-YnP3ggfem|j{0q`yeAdw1&ZZ5a*#*IT zL<{eW>43AI}D4HAM=)3BcvvVYn^b)Wp{R2@C?*Oh}2vf zLbEGJeI0(&)Z@*}F%Kb}UcZV4hteDBme*tmqbi{pHdGOZwJ>-yglYuAyf-DoRgwqUXjBJ zfC{oP9j>4nlnd~3c`{f>$YNw9nF%pij*dLabh4@MKDl)zY`!sUnB7@2+h5nk=Oean znd5s%rtmJjEBqcFonv1Pd)?%me+n zD|8;Pn}Cg8s67QM;bDc)B7wuz;1ExO=bIpY-6M|N4($8DG_x_*tHJ&r_bRMp#N2Qy z4rbvtqA=!6#PEbjj-wD4gRl#(Xa~41hARe>uGiU8udjmo5}YymQjl3|qpyUAQu*># z%dH6!ljh3afXh4?IZ~*i=Mj1Z?o2P`Dbhz~fTax17)=&wk8!4X4|1SO8xcY1Civ*m zMlp0be01s4(h%aA8C_bTjnJ>*qe~kZF{&nE2pZo?pyT{|HS<5X$ogNfn(1wAZtdYc zng6<_3}#OEFMc|D;-@WTz7Zh9-?5ZA#0Y=yQf3&2`hRaJqt`$)EAgBNw2xTHi2umy z=6V!Y-kwrcH$MTIvbqT%9|0ue;Jm!K0K!p|)f37$KSn6xyum7y{x7eMFN~Vc$N&KsbFXE%i4_xei3;~?}w!{2AI3w<2H{xIHMm}w^`w-$qx!9eD zmw08vmvwRRNGX~ucGFT8yMn95Zj_5%D!XNcWL02TJ$y}6H@jo8OA;5mB1%63B8q9G zbFsSz;TSV@demjvgj7S`=r9KjWU|}l3MGpvNJDB9;aKdFke%`&|3MviTOVRWn( zYwH?i_^n=3)3C<3k~JfBD{Fn>KxB2@n#P4SYik>7*3@B8)~v=&p=*p#q+!*>3+Q>05Y4@?~(Vg(ojrkUbA0GF-v3@FeUk zJR=2~z=bCXsSD4@2u+rSXSx~532#J>v8PcC-I$S4*_;?yoGiNs#4MIc8js6EF&Q2i z9b~i+$x$mZ*8Ubemb?0ljLWzU2_jDR8JHL%x2v1OT z`JA0Ug3sOH;LGRIVi`;orFNFW#iMuwO1^vfoLy_r;PQ=nWvXV+@5Ky&i)IlE4Sg$h)c&)JJLT4W42A(ds?tE?`OL|;B<*QYTo zHR`*3&OXK_%)53h_wqS=bsDP&V8C)NpR?C#3?_o&XMnm3(WLUm8U@ZZRF|7}ll6>b zD_1Sq%{dH7ro4R4Zi%S+K+W;;IlIlKRVr+DWV6)vmNBe-xqQwJF@yLU_@UD|*`Yrm zFao#g=*#Eq)2(70k6Y^UIs1%kh9p0E0kC&E8KT|U_Zd-LK4(8*Jrifl9>e}_jvKAl zupjh#+o^{AJsm>3s>|o>hwS}G375|S!C8)Be_sP}6r;_s_h(ao2zxe`d-EVrD?=j=miugI)cZ>h`Y>{oN%LEYlYG9<&x=j`9aZWCeG zV+8BV=j`9cIrHH1IbE|!!+ukD;}&D2$)3Vga^;70mHRU4Czm){^COT(kyNN}FPajv zarqosM(fMxY+OF4`Wqm1`J9c*=MIU4A%S?e1h71XS%UFKDPUt17Q@9vUCoA#%jZ;D zSxDZ!e9p$@b1&slioDT>y?oBb<#Q@-VzhJloQ=!pK9q=+qtPdw%jaxdKBri#06Uk@ z*|>ZzHjKH<8x3jY@;Muq_bfrH`lIUASHsra>{)- zAMIQ|XP@mvtrtu>2ri#vjiMz-V`j#1z~yt_lwz+R?TmUGm(OvS^YS?dOc*vUpW_hb z<#VW3=khrlm(NW=&b)k%g3IM|HZGsL0_F@N#ph;T5g3IS*C5`>A zI6c+i*RqT~VB_++>1bB=VY%*rSHR(dqCf%PJtSHG<#RSJpHtleMfP7lXXElYrh^$> z_jJCE$>no4E}!EA7njfBPOr_Kolt4PgBw1>#^rOW2GB>n%jaxdJ}1lZVsuDeK4;_d zx!0xg(E0qA&*93-d^MMBCBb*an~lro6s2c$>g97bE}v7B9Vn`E`J9c*=c*w9ABfUx zoy+HJTt2r_2p95BGT-HMHZGrI>3R7abN5|7XXElY=E2M7gyb(7E}v7heL_pUe9p$@ zbBcNosHvCF*|>a8(H<09>g97bE}v7>M?iHhpR;lKoGK(PpNn$@QA%n55h_gKB#bpH z=^LH!aAWM-HZGsr13>j+3{PA>$FSGeg{@eQ*l>Gg zKFT7`+t>)5t=f->jf|^JpOCCVVxz`>gg6+amUmtlE7VbZ=Y_Zr$wZn_DBW> zW*#^d%NU!%brnmDL!gYJ42sG(EH2fJjB%Oj@}NT5f=D?P%b1YEL~$zSr|DC%jEQ>l zqs7vvVi}V%ekSZ~mUk+aF$ zhu-&gSu%H-p8(ZM`Gz&v4~XzLuJ;^jmM^VYZDdB)*5j18uCadYLL*Cd^BUK##a2W% zb{3BIE%tLF4R!05u3oxorI8z1zIN4WTsp49c`A&pi#1DEuUWciwJ|KRaMh|c%dvG> z*U-3VMXizV2O8>D*BiqlYnHC4L!1@$!ch=eSJ$v`70&cVsN|Mo(-C=KcVk^$t*}gW z22xg*Ie!F1V&0s(S8;da^at)zlt`T^Ju!*T93xkRMvObYXF7!g0X zs9{m#8q^DRl6t7i?arSox0iCAy-Xigu_%$A_EXb>T0`-xI!h3EKj zx8RDFJCMe`DM>BQPoW5crgVe4hK5xQjjNX)UuP5<>H??c?rl(1GAE>QmkuYhcj9DL zQIr|Oi4Nf|5@5-m8x@8*$$|F)o`j7?y%~f_s}p*sle6zda^c_Q2 zImL;4H>i`%1|F(3Dka%gXuYn4_8RYRIvby#+||p85TDAQjKW<#3g5x}8OWOx_*D+R zDaksEo@0V(yYZ4WRVUQHV`*1Q>ki($fiYxm4-}Y`E%-R1Ps7vzWF`TlL`7KISJQm* zN_|1rroeEMvq{h?*HXtq0ZIm~LUsG5nSrt`n1$u?Y{NK*WqV}|zFxt0u>sPQ8JMtt z1oZ20IHxu<12P$%)d4}^%E+8wg^7|s4RB^rAme`MpC>*6rJ@s>wREwuIO^6M$qWRR z09_1M!J44)F=IVWgRmJ_cq=162($_0O>oAPdeGmOilSv+{7JS~GB^G_OHXMaqYNMS zNVcaU7FtJTd#~n@Y%c+NF`Q)kASedz7n5v9GcvQi737=Yj4986J~-Pn)RW1dW%Sep zGH!LU{VrmC2Tr6d(HxTP0iaL8Nw!H)j0<(PS323g3Gy3o#*`(X56-rUx$);K^sEVF zj7I&6w4Wf>$8eJExtc?=&FjJ|4xD6rF(}4foozZJQ`+eum%tfQ_JW?0ZROSI6+{++ z8GSU~Z&Xa^Hww!qY&XUik3nZ;V^p%?$#tx7DeMZ3o%yLTU({S*R9rapchU@@ERl(Z z!ApXWGt~hq@6hG@zL(FGr`$3hrgX*(H85&rcT`(r`haTmh3JIJTJi^GDSP?MS?w)5 z*cIgL2iu)`G_UM#X&mlyxxUHEFgKc+a)xja zs@D5YFpM7~Yjb6hBiKfB1_ev+ffS%nuuUrAKLL6H&T!_LMVtGZw_+l~jeqzs=+pjznx#?n!2`Dz~vf$B_E$=n&;@!+a}Zvi5G@04)pVn?D|X zL?nJ|8Y5<4(htKeEC5F}+|5XO5o+^Y(Ysp)QY~C{l4KUF@?9ji9KQR&NO2QJ@lqNg#4CRBwmpTyXgXtEJ|k zxd$>;4I$M=zNKS$w^K!0mjGd>8tX(XSzfjyflF9z)j6zf4<_%l)X2H3fr z@_;6YEPOgE+^FNz(E!oR;sE!}F`12^KPJ%}x+ETcq9Ev2^1Y{!|{;EGhZGHnXRWCt_ zzDG|X68JGZl_l`}5}sR-hidKW1fbuLX(l{>A=5&5f|JnxnyJF5TmmQ?&`Vyt<$%Tl zs&0Tsy8XG1=MX&1&ZvG0MPWai(uSh2ldyxxOsqSIzdJbJdo75V{8Z#ExN{(q`4hK8 zESSO$@l}8~!d1t>!PG0K!o$?h2j{>XsuLiVvY^MqBYm+A9`?n`ecE%6iifdYeLtX; zXyPf4Xqu`fV~HM*O2ujhE+{(>A4tQgkBQCuFwf9sCn8Ht^I`bt;w20<#qhoXmowZ( zXfANN+~K5M2_Id&h@s!XM;DvI&>4tB7az~iCGgSZ<}pMyGP>LXhQ0wGU2ZNz4M>45 zcQixq!$%h%8(DVv&sOsB`JI`8B`uq)FhS3r{2G1@O_O7c$faAKkF(G~-KXuz)dh1{Re6)*btQOn0oi zX`6PNzG|9teqPtzOwT7V3Hhu+wWjPUpBjb#TB>7V}z%$HEMknG30AMM~1 zn8%5pi4vq}iv0~Jb_yv!6vLhe`5#gYyBP^Y!=WPk^C7$mV2MnHA}o>d{i%F7W`xGe zSv_~&M6oP|R;+2*;u|971WgTCI6P`=?QQICZr;`-Uzs|IPt+_yi}|+TC5;PkF0Mn9 zGzn_?{x24(?KC;~Cl;IfY>%_pDf(g=SO)5BMehhQrCd*E%gP_YXWkGxTXrmisd_qF zR`IAX4m0yyoh_@<;-?DG9pTZoH8YnXDaFZ#HA|NXsy>*lPi^S~l&*^D=xkZD@)V$T zwyasBR2Z5w_)MrO{i~8*9$Gd5U;Hm9`gh>bBM(RJ)Y-D;S)akHtWt-<=fQ?mZL4H7 zMx8BdzQ#}-YF&xWmbE~Gew{6=MuRAnqqAi#)EElp>TFqyH0amavT8Nx*V(e_Gze86 zMprsp)?$qo8N(jNTf1ditE|^W60Ngk)u%BmHR{vZvW~F{r|N83tJ7FLDLPx$I*n0h z>rbG*i)d1LW1$Fz75a|$e&ce}YO1J(k95^mMkYCq}nt5h!wWwyY;dUn$50t+Qo4o$(z3T%9fJfc>l>N@vUZ zna*43Y+280!IaLH^>bYcM`z1AnEkxOUZ8chtY2ooDS*=1vR>55)p|Nx)~|FTp3ata zDD8L=#nIWaUd?Go-FiA()^B2CW&HVcwyfXAIrI2+wyZaGH*SGm9(xK?87V)ktC8za zwvoiqn*AV+BFWR)vY@j?7Ds2xg3gv6y`qf8u?wB8_1Vl7+9purqRtkuJcU8g1Q>O; zfQ?a@*4eV4v!&9?^6P9_(AipxrN^i0Y+2CRQgIWm&Xxt8tzLy-F7WAWSiT*<|a9>LiyU?CT^Fq#$5w5!P<}jxgKNgE)G8tc0BY zbd4}E9tV`igjBu{K%Sf&8!{7N4&-d|p%ca?k=EI=ptE%&D#Ov)vY@lo0MWG0mIa+H z1~ElBI$IWWwp6{NON!2x1)VM3A(1;P#ttznPiM=5&epAxs_1N4(Ai>8QWc#o3p!g0 z(K=febhcy_OPwux?ghV=W$Xb9I$O8qvXp+EEekqZeD{!K{W@C~bhcEtK#~1ATNZS- zn9dM7TNZS-_`n@PXUl@lma2gioh=JGTeBp4bV%xKSI$IWW zwiKmjfXug!j*}4}34AR-MptJR;5C-aOS4(tSvY@lYJciQQvY@l2 zXhZ32Setz_ptGe4Nu4c@AWA9i51lQBDV&6%v&Hap zPMA7d7Ie033`a+2%Yx1p!>Su=oh=JGTO$O71_~dj3`mmD*_vj zY+2CRVxM$%wk+suu@I^_txnuQI$NX^o17kH&|<9YfZq;r)+;tS*EmD`D}rB+-#CZU z{qRU}0>%Wt&Xxt8Ek0PF0yBipmIa-yZlUVcL0XnM5*ko{x5`!8uprgVLW~@Zr46?) zf=8)brH#nnp~jtBF{h1;tBnb)-Q{Bue9}9%0_>@3S80VhnosR2ZFH~-j6ugtLwY>x zs|Z7b9lyoqckw%tKdd%n88y@M>ON72=1eN$$;-`-eGE&q^A8X$TkN25O z`nZfQAtkUom6bj|&QxRp;}~g3FAko<_<>lieTeau-d!x;t$A1PE;d|aDSCIYg5Woq z0QK2sL1D_%XX9Ftxew51BhvtVw$DRKmMUNd8W(nVcNhb$JY*CE|Hw?J&vtA9GI8|T zxLjr)N}r7t;OVomANlp!C>~!k{hJFk-ey3bjfoyspG~#_iv9X*TZDapKAU12N}p|k zh&))IjjanS52^ZWDw!00HpPe8giCVfEyET1Y$TlOga_)g9gAE;q)w!j2k5h11ixuc z^xvWceYU#=wL_PBdo0jr`}_zDWn}>7{~!8n(U4haKMJWV+(WXxksXLiLSyn(eXA}- zWUNL4MtaB`8U9a1iLo|hNSfo+-VIVKu>S-!i%H6ml)aj!?(TlPA#Co!&@_vKj6CU5 zR&W_?FFlzBJ*Z;NnTa%Zd8lFS#L?^&IT@B7ZIKj6@f}oQ4nZ7pmGB|{zWxHp2FFIjR}^TDS*ns( z^lfpCc3f-@mrYXh6~vg{-qnNE9duvHc>G)?9qpl>9USXJ@Gt;?IJexhS z(e22Fd8wJto?aDX&%MmdWgjr+s9aT})7%P+iJRAt(^((f44cDEhVcpOVJ{T9=1TPA z%(;wSxec0CaPx}tpd$e4ky3&tGm|9LUq_*KgXYwkXwm4dsU(qpbc9oV zkulhnmvSFr*09{OrI^!nMfLZdhEKep!dPO;F-uLA6uMRw8tNOm5!ZD0ba!-bIn9^F zU(-x>rTxc1QJ}#vJ_q4U3bsgc`)h)kJqhqpxZ2*<78zT}%rHNetUdz%K53fL+Qlas z#@^r3_4dJ znsRlkHky8WmW(j!KouN|SNv0v>@xH=)quB`umKwZ9s{>hdd=|&KLVsC$9R9pedbD(6SKGY~RD((UH8n6W#+a~SG@!JsE({g2?(p(+b zVN_x)Lj%j0A3N4C{s?xX-kI^$L#R(KE`uq3Z>Ei(hBEF!vNOPr$F0tD4BF02ut?To zfBW@rZ*Oj0gs(&SsJkdrj#6l%>20{_Op0^HO0n}`UR1(Cx(?_{IJYdgA{}aQy%BSL z9k$($!c|L*N5!vWq@_=bv84lhS{kAl5F5Z`R4A(|P-Of( zfwUfDZu7T;Bm<~{MzLRq6h=LhIWyyL#bCaKAQ)eUTSCIpYk>s!ytr%W?T+U`@f_T> z>{)n{r=zrRGJx+wasmGAhckad36^mH5}x- z2`bi18Wrz@g~OF^K&q)ZA)^H=vXCw#j}po;GLR)op(f1HQO-o$`^d*@^6`qSGey5( zj+I756X?vbe^8Fwb$vQ^$co<`$5&IWQjq>4Q+Vs=3L^Z?vn zK{g{3IrX%5cH=R{_b5D_=Zzyc?hKR&ZVhMhd%o&&!;->r6A6yZmvwdc8K~AYne-kofNJa37WGJQ?mFRLZ5+~ zUj&kL^>v(n)|`)8gJT^Wi`@sj3DChBF+wlGM;9N(&>?KE(8Z6;LZ}XJD0ErV(h!Qn zM;9AQS}x+y#fur@1rT(xLZ)&Ge00!$L+DNT=yE19^i!lxmo|}Uu19)w>2q=rx(-}) z@!66)e06YXlOyXzQ*B7A$+?Ci4rzTk*FdUgA`QB{9OnNG_~_E-W+HScd~|Us_j@Q8 zUHk~-T;})Fr z_xsDy4L?mgZC`*4e}{J3ON{XMYNzD{5$T_=opue%7HUUcDJIOG0Ggth_6Yzn(ENR{ zrW$A_!pCe>C6lU>wHHJ&(A=OVs+96S)(zX@l+K=VNgKxO+r{Qjk~6m2|-N?%rhNkZCZH=!s$%G+wp;x)t(^vq9Mwc88z8& zp(^uDU|FfApR!U-KV=Ovu$=YZHvM!WQWpcu@5AF6SUwGfM%hvfEGsN!(-sDnA4fcQ zH#{28g2hXSP=w!Xvjo36`~kw)VKbU%-;A(-H$0j@j8!ynH#|CA!Gm_gqXn8U^lo@` zgeJ>wc+8CEgnxh>Gm`kxO%olJ%^X>rEc<7`(^)2I3clZn?I@UIX0)&s9c$-BQ8ifS zbTo0X6&;t6rq~^$#nJI`rjoKB9xV>O223}jm1Q1-M6&#!ku$*0$oc=_J|nk=1t%b0 zh>^oFYq-6iMUl_Qtr7W7BZ(HEH8QS7wrhIY8a4JLuwx_JXL{Ny)X{ur8Zgk@%?vCU zSRRHIhi71!eUIJ1zx56S%VZj0U|D@h|0!GVFtB`pnb5%U4D7+V29`M%n1?d3%(`ZY zvC|9#%M=$|@2-JmcGANcSZ1P!HLxtByx4DGxlY&z7+6+pLm5~eBO(tru*{A$$iT8n zCdI(A;)CWC2RHMU2@D37Nm%QIQ?}k=V42!_AyOR!%Uj?#%{+5W@0R|?nwFLoFeuXA zj4y)L@S|C*!l!u)TE6x^3;tmpcwsZAl^l!8dk$~O&%ottvySGp8W#4ifZl_Hg(^vT zK(Y%rcVUxZlx?!G3(mp^op6Oak*Z32RDx+Q0Wc4)K)(1LRmX(QV@6=TF*=uX*-fBb z3kP|Jqtc8e^Zxzj_&s}t~eJ_vSz5+e*(_S8FO6c!;c|61j z|K-c$fA39kfc;yVq5X&L-=@4bx~6X(OSe;yMTjP0$6}fa`%S{`Wagn5XXpTHih zAfi7XRSmA*FyhVGk^H2c$25_Xg z_FxGa>5R1;zSstMA}npSy%FII7FizRehqqZhG-A=T6m(K20dedIqGQ8lS~bIN&agH zNb+YH7Hz^(S-|ebPnxGePfT(D(&0XzIjy#Thj0dykiuXm4`+C=2}`!PHX?kb*@g)- zbATn$%t4k!GY41_%}li-XjX_N$u_e>9mp&vq%#liGLPY#iSJN0Q;dx0 z;%FlynSLW9nPTl!85u#QDMm&zU85qonFEZBsIcG2NT$!cg%}y}17d(;c;)~jBbly| z5tZCfMn-boX{E6rX8XHfMgT5uzc`jR;2_rE(YoU8@8FYy8F$1bV6i67wW@n9#jY0{C17Mf|bqhw!F$1c=JjLjk0aaju0#DOsKowZ1K-UbY zLW_+2o6rlz3}_Qx&!SM>#>*QlZq}zUEH&y=DTf(Q!qlK6D^C=_yE={4LzVKV&kU%- zpi(Y9ycf}=^2Qp&J(Y5p0ew`mRYvcca~P6LwHZ)VOw^n<1Nx-Utvr?*WB-Q*UiUHGT`?Fb6tSF*>^PegeG-0!A{!>j5Xh6sO=S$cSg(^9E zu4DewLUlm-5}jL{|11??3X*Zme=ZTEB&yASs=N~jiuq3^SQUa|{!^7=9+{Q-&y^B; z0mhpEzs%k!z#^8N=08<(wUEp+|EUsL9`%|3JSfvbebhDo`4Z|D3dl%CoBzBPJt{~+)jPVRYyMMrNaW6n$qF$mWg8PZ)p45t9GS^fUGtv|N~*5; zPlZI#Bm>NUrgQl)75rM3F=GC6B$}0dIMw_o-#8>$zbZM+f2wYQBKuXzY5tSx;I&8h zbiU=d=0EwM#cWnMg!xZZ1L&iv=09aMQj8AinE#~JS4<;?m_|BUyX2@4rj(&duI7@h zB>0VNLX})mdI|@d|5TJ6D5~H5=Tr#52ch&@zxmHOLbwnF?1JE(zLoQgLGzz1Jypq> z`vCKw%!8`rLh_dks^p5cPiTY9e=6!dpbj?wsb~)hZLs-IMSTQRzxhv9NT`yha|BUJ zY5x%_OyMMqXCvu85$TWyB|q*y8-Tmo6Mz) z`J)m(ZSO(&PPnO3gvZtDX3wT+TvwYNMM6)3&;gE<;Jk#M2YLaJv*5~J zN8ktWd>2mF(sDqorEM;v>Wyl6+Q^W<#@1}!BCT@|EL$21k(l{cx4P~b!`2yz zoymN-X+Djnd*eG%BlCgIg-eKbl)J<;%=?`BOSqPi?$^-z^6AKk1$!L%u(*3R(S90j z_poV`NsyO;T)tBCy`%Y*oi#_49=Te@-Jc+|JlDwb*SsjtWPf-5m=xPjb)t((*@-ShGUvioUeAv8*#h!^ z4dJgc`5A7>Ff=-#H7M!QM&fdQ?`C$WqMGboGo@#COl6|8B(W|@tV$H5)q33Q7RaA2 z3ybl`G}CEywLl9!^S$^&iXpr`*{8Nziw~+0OkYd@58G&O+{!)zExj~tv9r*@Otp? zo3pVKnPMyFzq~oy(icyco71teYcH*pAF-8VtGnN9-`#Jv+(W1CezTps-?T^F{TAj% z|J_I`#a52oK`k5ozPsPl#ngPM9C-Je%kH<89Ke3^}i9)aN!?DfBca289A!Wb#ma>yCxUjKAV%Mov{pE1B3 zarXL27Hc^yR5b#UytbCJ0pVBxKfe3lh^fMGCtbMDXHKi_T?l6}2`LQT64A4<*H5+( zX`)M0ikHoQ)@A2R`_pu3R6VEY(m0o$%RRtHBEATOx*VuWvj+k=eQt+&4mfT1{x{oy z|C{aJ|0b$8-vOsz^+xrE5IaxGMQ?)pRB!$h@v@i=8!Oc;4oPAbhjHFPK+3Gm;>59z zi!oED`&^byNVV7)_=H)j-XsvtVhYk?@{Nk9-jL4`_DYi*(Ds1i8GF$2j6L9Z#!fw+ zv7O@?d#K}?Xoz(mm2RRl4riIaX2yOs5eBFx!v7DaCK4VNydUvGj2w=Ihudqgz*1@= z;Q=?4hX>tI9v(IJZ-|$wCK4XvhVt;}U=ZnMhX$O2_)Y6@oI0lk(j$NyWa|#l@Im)k~*;$-Z5SZ4v8BqqF zg21#6Q*uv1U|6R>3W_tZqha@a(b|U9OV`yk!Y+F(gK2uFATX>m9hrKkATX@M4e^ND zG=gCrwLK0%4C|;8g(A)=2n_2e$cm^_5E#}`KrAAsATX?>!dVezSmzm}&Qp+R=s5V| zWAMWpob({oryww_vk%L72(C{-U|2^bqcLq*M`0)q`5ePK3PgeAz=KB?Fs!3M6iUEu znD$txF%*oLoPxlxj$+JHpqzrhu#N%?G^Zq4r@=x6x`uTWYmt$6HMSJQunsL~Mx0X+ z7}jA}TGe+70>e6lx%op@bqWH*I;mdYE8oj|`~oj%D{ z_WrEq9EK!QZCFPY6E&v|>zpQZD_=^zWejUyPC=p}W)Qy!KXf{$Xy`HohMVqb2n_2y z0wkhNLtt2kA<54%tfMnTyR+wery($`(}zu;2u?#_SjUYfhIQORieViULc6Nd5E#~Z z7%9Q94iKJ(z_5-2;wT1;{p`=)BZWW%cQm!Ba{NG#DKw=%4S``Db-O$oQcgo)Smz4a z(JVp_meUXz*7=?w6VSNJ)gJAuz0?@=hQK!JgHERUrt; zey&R~kIb}7bTB&z3j=}T1sHb%{4zUNfJH330mC{fxmrl3PeWi>M^(u3h;teO!#d~5 z^iUsBry($`a|P-ad+11pry($`vjjZ~+n5-^`ZNTFbvWnK+LX$TGLd|jBm z(-0cgQFG)1-)RU9>!|p(>NJFgbrc(Rno|txd`lAaPD5x|M@7Zvv(K;&Yt%grp<$f{ ziRhh%(6A1NdFp8h4eM|S4>%2>VVxf$ft1q_8rG>mt9Yj&G_3PeVZ&)iG;|)z;GBjq z5Djtgs!nnr!oE%-K?(w<&j~B%7Ti989>me(VC+Gz)?pA+lye$F!#b+o(Is8OI=Vw5cUDX^#H_s2 z5E|BbT2htM5E|BDP*Qab>nKE@hS0Fit7_UZ;`ICq{92YVVp!*CY{aCVhS0DM-#jE) z|7i#f>!@ylBKuE6Xjq5o3~?Gl!#aH64sjYn!#b)4Qcgo?Sf^UDM~8F_>s%mW4mb^= zVI4J>3_J~?VI4*38E_gx!#axMKMkQ_onJwKL8l=!tivs7KAcidLugosr61xngobsP z$55vsG_0d&L!E}uu#Tb*J`JH^9Yq`JG=zqA6xDwkLc=<$kTk5r5kx7a{b5*#VG1W< z7}jC<6DQ2m5E|A=VmLadAvCPRu!#WEEgeeR@P#KUUVOWR#h!ckn!&VPYLpXCf zry(?~!#?SrhS0DM3!#d0sS|g=X-G6g%6OC0qYPS%l^fxYhB)huH#yfhL;S~re+R$# z$_(~m;gRADI1Qm;9X?owJ`JH^ovVeaR~Kp7=1JI{#uk9@jwr)U{g%KU^eut?-}{yz zEkBr#)Wf`Z?VIrEZwb=#<;n%rzxOQxE?zrJhD*w~1nC9A-H7LYOAw1^{S4t~=$H5% zZ~hv;BlrV^vBPF8&pr{`P5y5QV)?_krXTn%L2S5!2YpKrE6{|Yza@x`&}3~{CzcaF z9XZB+hhpfpW^7b8b7XO{>`Oq*VwoVW;n~)~Rc(wGwqj%LpTOgNOAs5E@i5Y2?Wivg zjM(@%Q;`*nV_PRy9K2rQ!!*u#>>6wRd|dU$_GILKY@|b9qOliuqTs4GGWqrMan;)w zP)H`~o*N8d8s{ZuLen@4u@9~E^KsQ17tG8GhO|BT=m9=A5uRb zrg50)(E9nf>P>A^xcd3H>a9W8{rdU1>P@i?($B|LZ_`BN0s8s4>P_uC^+)s-a4^h* ztKL*Ho_;>AdQ*Iu54b32-ZJ1|8i#}?C!C_6kE`AmBG(Y9&Q)*y@DIM~?Rr6@p-Zr# zG7**@8d_oU!7!_H*pYE2iIHA337Yq^gWKO&2h*PBvk`OoDTZ-7-1%pN>#s;-auY%` z3*hO6=Z;bETm{el@EB9v=r~wej(6GB@+k|B46{tiP`?|76X0%TVvLFMRtVCU4$JtO5^X^y7QlBV+^3+!mLe$~_%N$dbX_uIh8oNk`xn+OY<3s;bdF z?ML`_m3nY;v?G^$EBJzW>T5dvS|mNKy{o;yeRD@6Y~FAiyI<4?wxJ+j7|C6Y4^f6c z!c9H2QWffn5r`zGvUeBU4Tj`7z~TJoe%~6&hF%J^juf$A(0FQlKi0whauvNOq8sKt z!q*L+li^B2c&M1)7L3PzuE~V^G}JWtbrj-R)Ldx@)$R@JAuobZIq4I(HWJIaP}EcQH{xKkjE#?qXnJ}oa=m`^Vriu z#yuTi4D2~+I_w?nX~&T*xTK3*3ePC8mtG0a5%7#b0gwT{NiV%YL**JOHzwZ>Xco98 z?}w)j9;5VGvRnp`207V=AQfPguav^B_M5H_dH=6Q!$#(Q*F@ys{Um-wHPk z-Q2?x>;Bjb#z@wR1r|4<~!zGdUhh-vY9_5SN)CplZGBT|lf^wsJpP zSsCUrZ$&?&i_eM7G|gYeaVHI2W&uM-0;kK&w-G9Vk1lIcWY*zN19M>Q$IJj5U3@N+ zSqmRsd|nnpTj8V298TIdkr`d~REGGLOqVs0q5lJ%E^`<|KZK7iGcRI%KY+n&e6SGn z-ar1)_vYT_tw(O|?c6@Iue1|qY;7IgoBK;QH?<$x*WK3t-vau#;)a5uIGeZjlwy20 zpIo}FZ}XN`unfp;OLCH+d6wn`)RzV&xn%v6FqQ4->?kF!(9)Ln z-m(=H$=bSgr3;T*ldLFRwrZh{QM$anYuk>pp7!R7WOHdpdsAN-epIlmuYViDObE)C z?fp1v{AcF2YT>dnY2vc&GfO+my1LtXpx>bfCI0*Ewdjs!W1}jZx-?QhO4?7?=Ddm{ zn_6L)1#TyYsWBe$0>n?yb3b=28 zIx5>RE`xKpRtZ<*4R|#?9jEwk)TgqsCO8w$Jo|V|1_7g4xQ<%6wrElLtfH#v71PU$ zl8N%!iK_D1MJLoWtSD>6Wg9Imtu3W9OPlZuGIfua=I-ZjOGlrMX%0snN)9iqO@& zdljfg5B!v~slB7U|Fk2wwxbfd{*i9n*V|l%d`qiJMID%ac463@lQPfX@JK!0z|%TYW9*M9gK+j`1pwsqn*S)meX z?(Azd0&eh>ZSB1$H_8L$)D<( zqAB4D!%7KP8nzqm=-J$Aq`5(sVODFWk?tZayb*JQn_Jqq8yRkpRu@sAxC^xPG`0Z9 zbb+SUDqQHnYH_Nfxw~t-k?le#NmK&1>AW38L0Hng0;v(3(-)b`Fyjx%F6a{D=b&OLSN)Tyddr|RCi_rCCEUZ!2Q zp-(k zQHs~xgmIMOwKQQY#k?sPO)1Vw45&2gYK*EBuL;8{&1%Bf%Hv&)5td@Yxau?y#tlyM znwwT&xaDPT!hlOLCp9%;(B(5%ufotvv9HAdOtDs8i!qqTyBgy#W=_ReOmR?``jCe^ z-(*ekMmD!os5P2gfw?Dx##6^r-Iv*;x;#} zGR=9s7I0hgxh<>A#E@&J!`6^zW9FoMUJE`27MQ>Kipforaos&7#cUySYQ(&DJ^f}{ z#JggO2u=@~aGPl@lUH4{(R?k%Zf;Wkj5NP_;$(<_y%2l#Ml&;yKV|YYTQ{2X3-Xbn zEljv}{fg^0tXg*+771oneu9}D@?d*&^Q6g}@Tm9&1^LiECrp5D{QS?g&1P-^Zj+f; zh`SzN4mKASNNIM{@20EQul=T(UqGZO7Fke8g!*H#g`wD0tJbaBaP^AKQ?4)J-E(TtEA@(HGQHVXobmp@+w3@C$+|?#qfIZ1{7vN4Y zJq5T^&60fXwNp%Q0dA|gv;cRaSsHS22V?Up+-zHaO{=*qOt8(|JjoJM%(6ns__=a= z))iCCZxu+!YV-0!>`A7t0DICzv%C;{in*cydrFJBvJiWsSrM{VZTaT9>o&skSBBgz z^sZ*JD&#rGa#eyks|%!0X>o!R%~gfcC))Ihlgygqr9=PK1=1%?GS?JfPnl%CQIPGd znPk@Hr(fGL(Og@AJ#nI0m(SiXsl{9uvJq!+#k6jfS>Mn1M=Bq{>hNwrl^Jw9P)W(Z z$NxdQ@XtN6Fo^d)@RclH$KwwC23*2#G^KMgBbW_e!qk+_Nz%7mQYCY~3#h_RKfn^+ zZ0lQh#kIJmI(N|jkle!GbOS6bo7BLIyi8^wMR6Uo68~1ZOTe-z)z9JfNd@kR^v&(C z#NxSFvyyW`7nZ6*T!0lSiHjFtT}q;T5f-B)db+Rz72*OcJ4wu6fYm06MO|29lDKd# z7M8-vVmT?CEY^_1nTvHJiCK%VSR}Ey#|$>bV(bc2HY0N??33!a_exfPJ##S4#^o>N z>=#kiUUB8BwWjRCDqd6Dq!lYxZ^Wky3z?5Aw=sBD79^j#@-Rku>^x-q@D@-dsQ98T= z`_sd;ua{;9i$9%dhS^Kiji&6fOzmKZaQku4VW_}PFCNPSrEyW!BZ0|q+(g;rh4JY{ zOH=3ZX|^Rkzc@aPGf%w#XJK$9x~5*-$CEVg;#mt8$GlEc zj=qLF`93sd_he4LEa`CeEAB~@{jTe75hu6Rl9vuvjS{%`cn~G z#xJ4;8skuuuy$qN#uaPub^o&e6!9688Pe^=W7%_2szh?T_%Hj*{*qwD;rujrTkUV6 zBq`4&y_BDHBcJdr``i2koj&`nm}bgeiBearUyt1g+=RUGx((>9zl##30&FO112)wb1+tX#=A25XT4d#+-ulNR5He7h% z{czbdLx>n)XOtp*v}_GG`{b5;iQa=(dVt)1Pu-+fW`0T~S62pm=$O_15$#pJdDRBK zoM#tLxcxqisaO=O|Hf76v=WzgEXpoe+;{P; zUi|VhO^ltKIR z^C?@ESyW`1b=bvQef1VJ?nXR{ZZeYwWHR?boS&NHj>%o$LDo~QU_#wq@Sni>K>!NE z-g=R_cMevxzkx03{Jpe%jtr<@Zd3Z#w7aIeQg(a#%dyqAWg$l2B7AiJhxF$DM(M9) z?`;mpliv{I-rH_)N=hEY|I*AR{C@;c#(&^G1{CeR{Xbxol>8O`mu9|>|8D?9SaY1< z-rMcSRe101PbB5|dv7cgdvEJb?!9rJ@#NlHv%^VOQ?t-dnJJgsY8dC->gW$-TGcX70(I+WK7tH#Z|`5|-rE$|S77grX7{uA#%t=rdvBU@;(Kq`AkmeAtHNk??6T6WbD0t9h_R;w7}jQ z70d^~G0Bei-k4Bm?@imS;NF{f5%%7uo!om%w!|j?-?I1i&7{M*`(XFpw7XM#Z)v9P zy`{Li_m*br-dl>Rdv9r`?!BeCy7!ji>fT$5ne4r#65QTfimiKZX{OzK%VX=_TfmO@ z-hzZ^?=9dL*n107(|d1)lXUMbo#r;!u=f@urT5;_Nq+Awoe=N61*!RaZ$V;u@2y~x z?!Bdxxa*Ycy`@vrdvEFV0();(Qwz1^aFZ=6A%;@%s> z@A3BD9v1mv?@a^u(4wX@ipIYOO0a1-E-`g+jr~E#Ch_<&u7|PyA7)UH$Yql zn`?guy3pntW%4%Hl*!Gt8?cRy*Bn+}-D)yFF3x0r0CBfR@;*1$DzT4t$~q>V!n78= zwmJ@Q3SLJ4aq%d!Zo}y|K>Y^%ZuyUkCoo6R-R9Km@xF9%B_;Sm>G!AjE=87Wd&v ziQ)?f48gL#YBe5#C|*!;HI6eiIJ@R8rXi|5YD z_BG?n7AsfvE$v&4x4R~Y?KdLJb%6c^5qnkeNeDd(sB1@+YWn)NcohTg!lpEUOfTLD z#t6$qs8${AU@W%GiH>;{7%P-Xx0_Hrs|dde0LFKfx!E%x0ONiuxyDKU2#i0rlAie- z7|#OG15GgZezdJrupJ*Y?z>>t;!74UxM0>Iehw0E@?*|9PaO5XBgcOQoHB&1mXgiV zSI(2BE}RUvIbJe6=y=I+rt_pj-~oHky$=JDayn-%LFeHi8%i-KF#dhYQ%7bxYF%V5 zy71%-_l(L3F@FV~o5)0uoxn(c>po*P z0x+q`L`L3EasJ23lZlLa&iq|GBM%s2Co;-ifb&_(lZj09;e3hmWFjN)+FkhU5de8* zBBQ>IzlX2T0EWm!#`+)HZOqevp=%IEujFL(6P>Quk!C1=Lt~5Qo?EQkC-BLi=fJJS zFIUNgKtd*g;UFaNzw}kiUO3?^1~6$taTOSKFH-jeiN*gDh5i?S8Tty!xENDeEjm%P zflzHAMBA$vHN)3khnHHB`v^~v(y!{?AK*(@fKz&5r^MJtKFWd3~q$=TyG%^r9>mCvSrK^I6nx8nL3 zFzG*h>h$3r^(~s88T7LZ#E*NyB-b9ilF7SZ@;5Y!F3QwRqr?ecLG?4g426>K1Inlk z7fjy-isu)mM)S*mLq-RmzJxy z%KY*M>~MX+-&5kxP0RE$jM@JOqQc(+{A9v*_g6=hb(0C{f%l`@05_SCHwx#C%EOR9 ztN0x7=HmQ(@({Got{jVUHsfp^U?@%51$YCrpQ9*cYVd?@N#^?xW1d)R%sYUOP{?X*A-u|M1p5i4 z(IPedk8t1fTgH3{cpItNT4SCEIH{>3^$w&KeHXJ4;O9u4J=~bb0h#T;jXD&WMIv?b z6G|ui38hunZ(RLFee0;?27E~qaMvSrDZAdqZ!qACNqrYw+^+Xm$_Ks90Ci&bc}m=S z4aK<6a~gcRv=smH!q(@FQe}JrVjEzFtNO4kCFC%1JTN|h|A_+2Q|D21P---{E8Qqsc` zpq_^buFd}o26BeKST7N32($h(SpNW!1@LL)oR5#EeGTAa7Q4d7EarAGi}Y2HTmf(~ zi@e{%`Mt`Mn8n*6e}nVC1h@q-$DG9c-F=3hrZk{)KGS6&KC$|Rt*Q1Rd`(`75BL7)WC;89g)r%1AHrOlKaOFQ3SqB;^>aWH!m9CM z&riTPu@JTc(zgS`5cUT+|9$285cV|Ap9J(5!rn&OYs?dbu<3gcg8*)A#SnHs&UXQ# z5VpgGurqKs&abWZyAUSaD1>q2%df2@goT{CL&ptaPowxJXcqTj!XW2E*n3EQ8*m~a zY#)}fMP|a{-%JSm^zT!DjyHc#evbN={~Wdc$k?y!#$4eqUl;lo^&9YYcXa<4zL>GU zca}N(wB>jrWes5L4>4Sfdg`*1o{BFogr9!?l6^S6Z#6&s^aXh8dx59^lX|L{Vlv}S zqnEA+%n(oAFERCwlb-q|_f&kqYtyE0egUp(PIVy_Tdt2uP*q!STl_To=@vkH5LKTz z>8oFIUtP80BNE5%cJ!?wuqmxF#2_X|(1R8Q#FTz>OE zoFYG=`vo{^W8kQ-tE0+~`NB`>qdNdw#80`IS!DRjRVV%QOT13qc;$vKBAzw{Zu;%V zC7#j}lWEEDBVaEAxc6?are>e?(l7bEFTX$j1%%VKz)xHMRQyzb3LWv3vGgv$PKl>~ zDDiatNl*Q9d+Lg{*KJ(&1vqMZ;HW7_Y*h$w-QYcpLEkNx0`-px2Dzye)^q1qo2AvQ)5c^!b$f# zN7Z=x(Md=Bay#l5bzf?G;HQmG(ogMesdF-P(TAOz>ec?(_LEopU+P^c-U|8x7N>Uw zUi!3nsos+smnpvm4=(`r$TgJSJMB5?rC;t~`bAyr?+M&=^G_H|?X~{6OzSr6oB|#b zKg|ruj42;hSzLZvd3V{6OlPJBuWc2LHkFk#!8E40&J>qVul!o&w8{l|2cl$>Au2sf zP+2CkU|0s{1J1ztd6jtNd|0NkQpL$1I4H9@d$8Vs<6jy_J_%E`b4qzml=s?lR?3wx%-E zjd~4fMV6wnKb;MF=mc-t*;S3mIc!2EDXCG+t8Mi%thM>n#+qOXntLKyQ|)}5ikFrK zRu!Sq$_lo`fLO(XVNvUqhgGvpGSIhO(xPm=ib_;`Xa?OCv|p8NKlGHgANoq#PZ$e^ zX$w}{Vr+j7PB;3eH)-q;C2=#Ao)WoRS?F%?O6Q*C&OHal?pYDa)BP$3!|~yT!%&sb zj|Y)Y7pO)`b!BPd;e$mqVAMcowHq+hIb^swy9)j`JacxHj+SAiGJ0xt5DoVl&`50V zy7Ztp#hYU#>f=##s%-_EIwH)EXMl&nU1q?723o)Zz7lrI`Bh9CspIY-X@uMP zidm02BX;<}$MAAktjngA+0lDu_6typG_rA{ELz8@#lUW50iE1`gbe znt%0tw?+J!U+hZY&M8{n&hgut7?)xH6tCKW3O+vbx37&2;XJ1Ilk4$;vK-~~yPbOAU~>beka zoF`vvox~S3+*^eiBxO~d6_&Y$R-FX@?dW~Hbt>(gET%gc}D&x-oUM5*I zoQRd5FLyjSrPfMu%y#vYfx>B`+)Y*k-DH&x0{JzsiaXX-*7fb6Fb4vJb}KqC>E9aH z4@2Ub`#~TJC5?va0@B^XoD0|p`I%fms*I5ox7Nw2oNoWCn99Rm*AbGM)>Bh)qnjUT zz!|{|IV$m!GhK%VPVkwdnZ~cucy23;mvC-ez|FYcDljVIC7ip05P7+RNJo-?{cE@U z)xqg*bU>mK#&aWctY>8f2 zj*Nw{SE*@V_2CL3z^(;ctQu$MAqft4b$O1z9+7Lg(j_u8j4w?t;?C9Ux(UH`$$35# zV;C+0ZMG)o<;FAzKHlQkbpDC%LZ?*}qB@h3AuzdsVq>O+S3S|pIu$iy1B5l2W*bF$ z&_6xQu9r+-3-jRt=dfY$9qdqpF*ALWVgT^^A~NCpu*0}mYzrB-m1kLvGJ-5`cC0p1 zdVw`4l%EsvP_Mb^3%z;a)wR1iyfDm$Z+eF^+87H$b5Xima2tSqxu`(I zy4dmj!hUgz^O+_xX#q@Rx-u!%H9uA|;gw?)&t#qthZ-3J-4tArKaMNiIIb!@jt7Ox zl5txd$JD_(+M_E|T$j29$56N680Nx3En;YOSc~C^*?utN3RM?vr??ABtjrm#Pt^eL zu0L(_oEFFXhID-XiWC-HL5~!PfN^?q>D=hkFoa~jvJE36ip@F7>$ehT#tW~}@x}6( zFh3%iyIAIhB=38PUY$i5(fqA2WqmbfF#wM9LkC$?LGB#*dpabH4-2A#bCZxWAq-CE z1yL&uW_ApTp?3JT6tZEL-Zq=)#!G1&A6s4Qn-m1o$@$@FN@y=WZ5tI2^QXmS>oA@k zO5qC*u}msz&4^Pa__+H341c~`Y;9+93_C7kAj87>q2(^#w1w?&%&b@@igL4kGlg>x zVxPZ(IHwY~6nIy0t`|*O6ranCYvJl>d*MRVBkc+EwFl_c3v^yv7)haVFCt%}TUZl% z&Bc|tKew18*_cbhIGQTB-DV7m*@=*!CUpA4S2!bw;l{gjiSqJtAwU4i+C{Yw|u9B_kl0h0Ywx0Xe~R;nB|Tn z{|YztU+Fd2ZnYE3im*0Xmz5K&t~R%vStT(Q>Q=i6CRjLM<#>J?`pipdJLTlh7-eq8 z7!c1x<%K5@cjrmklHs!=o;t9+rbk875AHd+siWFW9Wuo*e~r$9?xv@k+lJ}XP#ez$ zdh0XTFQ`k;1$yfJx4TzF`jui<>>ugJ4ay3k?GE!o*vH; zZV@dZ7K>*$M~rgwpSzhU0y;B9OJ`+`IgU@C6}rD2Hf{=1KZn`8k!kPCd^MaI#sxFO zIWEDN@de6rarE4%Jm{X_d@}IU^Bga@%5O^XPUNPF?R2R}-WF2qroZOpQtaH->fG?% zaB)-PoO_6K?xAj7gauNv0>Fnc!i>r4i(VbAp6cS&(P!?bA8F;%DiX>R7J4A&l5L;1DG*Mc?L3^!qYJ)Fj7x)Usg zyt-t4!ggv4mp?j@%?cX<-?Fn4z72dA*h$u&VgbYpy}Vu1c~*%X?_BEmWiu}F!kHQ? zoiM*!r!5SbQ43uZ>b5<%2s~ea3DvE?@Doaotbq!FPM_7* zdxS66GER#p^k_lADHmfID!h+iliwU5pwRR*@g_J;x6LXmG~c z%a!rzCk${?4OgoD1eOUwq>?p+xJ06rCLkUcD9;(!TtG9PuJSqZ2k^uKK>&C0l8K#F z#HDTGowmIvheDQzn|fh1kO<^Vo0`lh(}Ia+dZZfN_O)~s?B&A@cb$z(+2&!iYNpf3 z0dl?!O!S_M&QetyokLR*ox_`9yym@t0mW6&_Mo=)oOJ)mvoeU?p?oT^&5O0^Wp#AN zjxIkxnN=59d!(bW7e$lY4Ljkh}JZHhMWLbKOTgBGL zA^TKa1*h-Yq|=T zDsWdJ@3_*f|RooMy&o?e5gQ!E9)Iu7J@O`DxHSm3+^?|Dx=fDhhDIwC)!h9GcN(jijX_CmLeW-DOn>Q~?kP!;cz66ZJqzSkD40#7(h zS(iAuA;YR%sX7 zN4Cfx>nBu+dck_EzqOhho!lHvha_Gadk3^5cD(cU((u9&o1{9SvU#Je(j=<+aFhy0 zE}SsyL_bo+ejTYcYICWTwq}yMS&c~K$ITQP!@K5F^K8Z5K@f3#GRsM}alhs&gV0kz z1RJEWl|d`B4vavFo#>P#`~;P9;U_<`r!SBh*?C#)bs94#?q+EwU4^-8W!wF_sN>ag zko&^0%+zc(pY14@%r;^sCcD*Xyknpd_M-HRwaAts5nHX`^)fw7JezB-{)6%*p~qXt zYxi9d-fi#D8M!kr(U`761z2Co+7=O8YysVF5g5eR9>@FK3&VKb6+K1FmE8chvMTU2 zN`6o|fjwJ|CjIZy(jRP33~`sFLv_(LENp!ZLA5c9p$1P~ic?7sM+3FaO?;<>xoj)f zhr|8U;Ob_COTgpAanGe(w84$}uOzW$WP$!nJ&_cd2#@4BhpRka{L4BrEKnX6X9KuL#lvd_ zbg$m+;ciLvm^yb$qNmd_nZ`F&PStzQBj{Cn59Ku7O44ol;DYBX;nf9g(rtO(`a#&C zZKucAGmY`piJMX(%*Ghy?y;QUUPi3!NV6E=%Hbyfkw@rLN zcALp=w?yh<#|kFWByL+?zt0{86JT>Pfwctd$z*9CPTj3;+_AlJ&)Jp8D-W_JbN)&1 z$ol~*(?e>2PQzeKFD0hC0PXKLv$Oo2B4MD-QGc*o3Zu>SJaCECHxQnYHDPZ8PLmb-bH3Ajbw*5^9A~&swX>l)C{deyXh0Em#RrZbTG(;?X;%9lN|`76l|S&h=wS zq%;)ZrmKq%jJM~-GEs1B3Pm}Fn+wFU7B^TXhB2r$SQLc!8q#+Anx>wRbTN0TZ9Zvp zEc`a0{r>fB)emscLDJ;iIpPxjm^aDW*r>SQjQ^oV?N8j&O;T&sy z7@+1Byq%E5r7+6lrmDX_!b3p3I>K|0V4(t7(EGH!M;-0Wj754)#R=hJU#u$ti+S7K zp?Q~hIrfykD2Wf0dZ&SG>b_h@R7qIom-SKPEwr$A9-mD|WgD%#^B$kU(muKeyu^jz zVENzcc%M5ge~#sUKkGrau&as}hFB4DY~r~Cw>szP;QVQ!#@(1Wk>!7ZPIE0jynwgz ztt%http}eH>j->aU%N`=(ebB7p72Y)*%Y^VY1ksk{TE(|`N5X3^B)q4n;8!^v0dFQ zd+~eRuy^b4D!2ZY?%>k4I==@7yB!yr`3XJ*-MHpHF4qfN=8 z+&vPaQ{unG2bvh0KJx=j1-!Apg}RN~8naN=IR%`~-|h--`7#J%x$a{o?!7a@$^CcF zY>JdYdviF)@s$9(qD^jjNkFvY!i}zIf6%#t#KzTv_>AFb>q`5 z^QY&9y01A-5D-uJezP4A?!q`8ipRP8kv~cXx=|91wPd7z?h9kR&`qyK^Tr++(RFX~ zPBrREm*Ae5Z*q>#@F6U{5dN1x=C}-v-oddK#&PhDmU?F=zC1R(Clo|@Hc#{%JBRkT z5nAV`}hujG^$e)2hc*>Q9xOhy}Y=4Gf>|}fSSGw$;M4=YLV^GOTgQM52(0++# zl`P3SO>WIp=DK)5zWY zN`dz7w}C5s-(aPjoD4yW))i=RG&NfsjScVqSJmQfG5OhDy5AOO)RaJt*pI=&{h`3O zhr8x0)Xtw_QY$q1eU^zXzC7yxi&CLi*$MC08DZ=_>0eoQgyu6g4|5?WzgyT@2rcom zz$Y*To@~jqgWHy5$T-2UY$pWw433S`C%sZbh@J4lwhX=&m%nJ1#ofPlX-4kYzkYRX z^4WC%%aPV){b%fXG$M|ctMSk?AY(c=18q@~=q^C9+0d9%L5k=x83|JXm8NR!^6jRq z;#l#B92wIA6Dxsg|9iOU1b7V}1%UWzUwfRc1iXHyUbqPKmX_`FOWz5r* zFy^}&d4d}Bn*$$#w?_@UYSNgBW5-6E zx#N}{B~wOwtxkeC&`CGEWJI1+s*!5K+>SoME@pAQljF8IPJ$~W${oljRmQbgzm*=s zkAAD?#dY z0HlaM_6ej$eO(fW#sDNciN^q%ozyD;WGDJ>0Fff`K0u{N{UZQUL^DwlO(3-ZfCM7e zP!n8bP}j^eu;h6F0>XX`wWv1%bZxtIqy4g-2p}4790MXX~xZm+tHKs8s zfig6t$jtS5&3AE5K%WqgP}=ty`}hUh=fp4CJ}0idQTpkwR6j9GIg(IUqDnxKxqbjK zbHw%LJbe#<w>Pk3zlQHiC*f7K+Zx%Y5l_~Q+04+^Kk+^k5S%zXCidZMnM*xa-=14UlQxF|9 z#oBDn3^hUxL9-wOOR7LWUy- zYNl>94LOn}aypHt)J?l=s#CP{o5tJ;U^fxprF1#*VWopv_7QL%2f(eI0)$C0o)M;x z@Gg;B-2vKp{`^)wCq#^g%#LSumVvPf_QpDwZZi0%rS?r#e@r>1;nlE zVrTY(mZ1Cx0JI>{hX5^;ltE@TEl?dm6G$~^0?|mHK&nv_h*)xA^I2xK2zC$+5werW zmC}(TMGe8IrNv^Ou)A2CO8CxjP0NZGtW>|Y+tz@=dQig~0FDXbHv#DNBS16(BvsJ_ zO1Ruw{wEM9T)kSzvq{2hSW1_GANW+Uam+z-`{3A!StHNf{^4L>jw>(aW}%BuV^T*Nz1p_)e@gOHe>3B z`AXKC8$LzC8Juc{+JIjl&`pkxanL}qqPyDz!KmUvQ~8NF?$;n^*ic30Zl56(iMl^n zgHmY{U8L=O2NaoR-&R2#GUl>CvzH!#Ih~ChWbt#R$a~31S5VWQKrQN&9AUQxPSFqB z<%`?;rqFkzw)UNna?9unHp)@R=DgmCa(ucYzc}BRmjJYy_!Xt=iMK2iexs{dA-xyDH?=?lpRvz#Ey={ zj%*#Y%>W?S61^{EmdKUZAtkEfemq!XLsCFzQa~>Ys28oBM66-P^b*ZdF3}w25?v%@ z7m*s%8ybTv4qFRQ9IYfDWg>v5p_($fLb(4JNUqo&^iC{QgZc1QS7OKI_amsc;e@FLdN!Nzota z)WjJv#V$)ylaC(ZkHMM682|xwNvRSYqHD4Hsg4 z44^^8qm`~DK1=BaVon&4NqHx8w*g=#(Ow~Yi720M8|5z$p$;M^6s=utQzW9D6s>|j z&Z0o;t?JGksYf+|$f?VB-TdAi51m^8?7ywRw*k;BM7INQ*Z12w5<8Xu5l}UXpg3`@ z(9JpG5kj}*h-p!gnJAXsA#_u2C-5!+#v0LX0QM}uog?v}@}2d}8oR0079l^#ue1b~|Y&li!{HjF1XKA!||tB%_K9)S80T@E?K6ryVY>P)1lAP6?j z7>5%z9aPgZn9@B&4*+x^keW~<2}Df*O(3;Y^!E_Cf;)0a!G7pxxKt|yu;gu&{33M8 z;3x4ifX+iadWcORF&4lC;=L|`#D1GV+&k3fAh8U<9K>xfQpzAP2fzg4tV|(6vZdkh=uU`sMF$V3`Kj5GH>J!W>jt|IIHuxY{ynWEPFFJJMy?}lGpRNY>yT| ztbvX3Xdd@NaEj0xu`Ju?@;vTq;Jls3Ws}VV#2OZZ)1Jq5tr*L)IoIaNx^`p$x*4VJ z2C$0`0@D)Gq09j|<{<$2#G}wI8RHj8dXFti08~o+3IOu2 z0==nZEYGvmXwqu{rKaQFl6%WZt^<_wv=f{Xo^1sTw4APcOL)3NghU1$p6v#dntRJ} z>Wa~7usv?KZ9u#Oz(+GSn}$gZxt%y;Ygx|ZhNzvWsUG!h0hE}V4rOwrrpVa_oRQMu zek0DtqZR3qC5C6t3ib(gP!93L2?e1=M!1MKK&B1ACM0G!;hL6sDF88xXq%8dPE~mA zucfv^fVLH(p3cT1v&AGiwm9=JO7%#}Ym)NTOCjAGfV8~sBzNdd^sn~;!39l5oQ_O1 z+EYPO6qmtu2?*0qv0>!MNJ!xu21RD`0LLvdYz`gi1PXO$bvv7?K2)c&`jY2AuuzFn$^pKLy)DTlwgXmg9 zG!no?C~>2*iKvh4YA9N!%7~~tf61ynM8zW{TT_mh8nKihQf*i=Ap0m$(Uc>e0DuTl zlaO7Zr6ElXUloO&N=kt~@zmiB`kkcny*g>!1cTa*4}=u1Shq;>1gY*autKtL$vzmjGDQybRO^ z_XyTE4cH?a36O;BRGu_UX(+nYjRzKtz#v&3o5X*!Kod3GsbOmlM~n5%-UGN|@pI0nkW9naJUj^bTjV z!>Nk+Yf6`%U?_JdK?8p(*X2oYa2*i^8E;#_)%BIj>&Lt>*!xL}@1m&Yntq~{j4G3? z*usi?t}8jgQN8-TU<_*MW#W3Vw!1Lb)xzP=Tbo~zfA(`L%UMYr zx0|2sqPuXReAM@GObwbQPFQ{m?%)CFVZ=L>_7QvMa!i^4rW4YjVLQ*mWc9kQ^8J~W44HO5NVF?Fh_Eqs`Ucg*9OoA;x?sgiDxT4nz(na zO!6;g*c9PG1@izfkLZaxB)f^81*mzXs34f6RmDo=xJEM*Y36Jqo^>U$*bR`V6ZM}i z(Vgh<(@C+_u?KqCJ&B0F&BWq1Bbg$o(DNwmJt@&oM3mTv)Q44qNNw`7Fijna%C<^{ zdx%)~5-w}Kvt&dhuT6@j(OyQ8Mdth*wNQjK%hls7%MGrk+374ti)?pA28$MTPG>kT z=VP_9`mviyXv_F#1dD{R zNgCAmY{>LorRFw4vJFsVT5`lICFhdWK&r%>TO^D}CEY8j!FU@AplcJaR5~19Y*Dlw zp0q;RC;&R0XtI!5qUp*d>Qye$Qh@q4DQYgTLZH&KB&mal+L)&!N9yaEK*a2tpgl}w z?x;iB2msrfm|58##8WMwSZ(V`tO@*ap-;~`weQ`4OKJeyhIqzip=({bbO2i>!_-ei z5>GG!n5revWut&AhE3;#96}ccDfv9S?&Ps%W^zow7)ym=5=T45y@Gy8V#o2 zfHWIWAp!~|?p4|s$`&Sngz#~_3%m#r7*H&wrG*+qsB5H`?{Y@5h@}7)NqkW0s7UhH z3%@Bxybq99WLjvG2z71t^1euV&T0UQBz{ckT4$2OlzR|>qKNhbw0TJ#&;%mpFVybT zy$QguNxT<;8*fSOPFIq{w8$NxquJK+gNnz6IswIjSkS=%xfgD^Ph1oa@&nVkQD(Tx zfGbn#F#yyNy(MHf5#?h8wCneSPf^yI_!R(R>JcE#-Qx^>@j6`b16XU~SCpz8dg67|X_A_$)Z3k{mq53mfC zu|QUv_yYi1`xBsQ$&)2&6tas*$*ikjF{F(NwUk4Md8m=NM(E^mqTAprw*%OG#7`*g zA7i9u%IpBZWFm^>HyMTQ6QK?wClocAl)zMd5dMIb3!0+Xymvbua0gVG@{gyFE~_%f zj+x|9rV^iCuIW?9`1!fmw0{rL1~5?5@Qk@nJa`Lk`U6-`;#ZW81_x#S8UTBUD3Y${ zV_w8x;ATt#rZLY!@@Ifxu()2L4ekIP+2Hs=o5VKg_@G#c)Y4@raRl&SySp-V^pIn> zY~ON*Z-p8@QN&HUyp$w&P%@d@@m%md@@#NB(Lq3L5WUw4@o9gwdZjsbM$Spgv;B_g zikX8Ro(Eu45NDN6H3g*>17H$Shmajal#k7zX38&8AtEP~_@EX~v4tYmNu+AKLbb{6 z?|Z8-A^|j%_yeVDiMOrhn7(Ou%4$S4B$gu)b`#AMGE1~j$ZjIdy}r$N4vk|@BQhOC zlwmc~HK16Lh;3LP~uWnKobiLFSigm)wE08j}rO9dS%q0C(XC?TRqti*XC6+8=I zBNM+1KqjJJST->gfbAMax(M?;b3bRrh@S@_t}{1*N{Q9N=A6sUJMVP>)`0jvrK1{9 zrU8Ibi6~OI22{`vU}41D0LVmit7Q{YL4g`Dcc&F2&WczUa}%hPn7P9Z$MSE%8vv{U z@f@YgT@79Hs#LwCHsy#L0A+|S8!>s49&6KxCj@Ctpj(1-r&&iwHBy+H_7O8D?Q^-v zcR3Ej$zD)L6HMD-x3{&(9NL1-LqL(4?Q<>v4sQ4XSVQ95l=iu#hHwFspWfN=m#07XCZ#sbLiCL`@LFbuba-;~KjsYFZ(<7(f>xX2wR- zHe>X9^G`o2{iok6odXzMW!An{1mZOE@a~>dFOoMLPtuis26ZC1A4jR{gpAn^BkmKU zCi(^rxzjwiC_}mXMKO3s6TOwO~4k!0obm@ zdzG#y-qb4mu}+ql@=pWMx(^Np7Ij@1^|nF&P#N^;w8eiHLpNox~gUgb*NjalnSs_ zqUU`t5tTCDOLXHCmsUqq%1lT+2!Lvqz!prEvd&BNjP(*xDR+5^?m1qnSEq~DASdo4xn+^j341dI<0WgJVGN9OO{&tQ;oA4t8ZU*a3VP_xt8saw~Rf&UM zqUVs8h;+Q{CAwep6220&@GVHpSJfNN@1U%K-_C2q68In`dAL82)!plT|`c(D-ue?@br_R-1`7Ny+&*+4Jv)Gx|Bw) zk|0+JbA4d>#2*U1QLxqKZ-yjK-$Cd&$0)St7669}@hbrI3Q@f@b2l3{3%!&e-VA^Q z(S9Mji4G{2=qcqA;n%e&OEf~rZX*7QGPp$esb-MfL}w|NXo7NyCM%Z+KQc#IqS?wN z+M!(6%d|4-*mhU*B7LX9&RUL}kJ%h|0;q;KXb!dmUg#p)iKh5U-(z|66*ni>OS- z^QCl^F6p1HMEpZGH~Is^GGT%$x*ZvJh>i{-j){y}#yCI#8Hi_gBlSU%=%o7-5JjB? zi)ZQ~mEh>cZ|wFj(Vj>|Mje2nYS@eUY%3!DK?(Xzu(v@b12?MJBVM@Y zLoXZ^`I49Du7xU9=Zi##P`&isR_UD%A{)cX2iX|Lb6gic3dBA{c#|Y%<^h)1Qg}8{ z1?^4&0u-~@BeM+(?g!W+CjqBXu*fU5AY%T)bCs%UFFZjdTD^m2^`46OEDf9vp=87gy+D11%Q!A^ofv5nBtBZlZ@E|K+CP0j4}YJ zMqKA5mTdPDk&b)3M9%|WqQ{j$ycZHBs+uLds$?kfvX@x$xR;1Z`M^u`yyPW%LLKE` zvl6HPOVB3n4kf00i6uw9L{!Q$FVRyz#p&n?b&wvv9Z!$|(3wOt0NR73W@-XauTL=j z9Kl4D_5nXy;smegR$Pq(pn<3cpn{}^Y68(%pWt$Gi|J+notL=$Dxqs!Ix%JL1VB3x zMe@v$RVW2-7r_pqCxq-KdJ@1q9XV3e5P8;NFkc1)EwJYt+%N&qFyj3agsu+_qs*fK zWFw+To?%v=q6b8@gXlFOyNO;0sA;5H$BSu1PF-^Q6qhg%`4A8onlTj+o-FyYp><=y zYEyP6(C&N*vOZS!;d4iC(L=y}~sL@xNQm+1b;OGJ)tz+Mi3YL+lHzmz5~ z(NpUsqEb4&M0b;yh)P)r304B7umm<WiN4-YUq_Dm?h$<*MB_zY zFVR9F+ljQ4UgM875M|Dw%3KnWHRE(v58nj={)MG|J`ndq=3xM3h+hJvx};_#Dh~jg zT6O?Z60^NT&q^=hU53T2_7dIOy@Yp6N^F6|D_ROmcsjq7{a&KyelHP~@-r{d{kWHi zN_hY7=yhQg=FAMWlHz3%!B#0c7}N%}bZZ_$H~5x)vxI+Ta*kX@Cgbq9|p+M1^AE%WuFB)tYj$v9$48CQm2;F zPyit1ucMHv5tQVw{D?py=b)E}N~s20b#x#054&^m;}V1R6R*4frZAvNVW>4kD)^yt4rf8K$v>GHmBwk5BoK9u0s+OMwU=wJgk% zYq018(ASA;uNK;m1w>tNUj+o2_>9->0A?aS)DdTrHbeMIpTc)sCg9Vkdn2? zIUW!wcel=I;nR?M55N&b{DI`kE<%n@DHGQXz)M9#mS~M-6R%gct18Ah7qJ~~ozOv_I!WSvkT@vP_<#}c zlR`J=UIad3`NSVsKJkY_x8#UF7P=`%tR*E6Tk^G<762_FzDwzvuzbo)0ibP(C=xd) zE>Yo7Gr=c7jA)&Z-RpsvBUmW%Q+SsHSSImar3==cvTFfQO0*83Ws~}CO(43wgvp{0Cqp|9YQzfh^c~aExJZ{`MZcF02)mEw$k2U)%Ys7Z%7IrN(X*Z z=;j=;=14U1WxGcK)JR;uQE0D`8x*qvOedbNbUiU2X9B;`SqB{4A_%y$&9MVH(0D|9 zh3qDJ7@(~}>McoVC+eIkT}6}?vYlulibMwzT`6Qc(L>55+NWHihm}k8v~r1Pbl?Im z{)E;h^gsCv>SCd55_S0$^UMdpTZwKKvV-V0bA3kMa%sg6WhgP`jNAsRu5hX|nSqBY9|q6};wJ$?Z@#h= zivs|Ag80y7LLav$oO)vBe-D6OA$lL6frC^%lp%p=4nPw~U84y^yLp?^XgS1igPQ0{fVM6v z<`3>%>!er@=2-w%lDJibvXg;kD(Q+lG!y0k#2nyfm98Z&pC$Z8C!1jAdLBUIfZh=@ zOLY19&Nx!*0GL9Es4Vsgs(aUFfzSpk6kXgM2J?t0@y|Z7hGf4DVEu?ch(+N3ZSYh; zFeI6e?1KR2BYqkXh{z)MQf-VP;G;_WzB7;(PX@mXfa(*C6EaIQ9-y@(#r#oq@Yvh! zxJ?K^R-#RS{8m9Z_JEip@%BvH5Yy;R`_C1GSqdfBL45!4asd09c%{;{#Qgaa@Ee?Z zR+IeOh2NCB2Y5dqXf1WMErAe)pA@0ar+^MA=~Oz*;@tt-w=UladKJKQ;@6a}CEjwS zyui9A<1#wTOm70vP(;^24lPc!7NCtpiVDK6KtFbZML<@fH9{_Nih1q!41m@UA6B}S z_ywg$6Cdpq%MPY2WA;}8P)_s`q_BTL#0+ugA#3JE2)zTKXSPCu5G*E&aK_&)NyM6S z6sK62g|D2E_oC&y+L)qZQU3|@zz&K$35d2H%S4!3kBU^5QY)<@;@y%Xdq0q7_6xC$ zR~|0lVVMpWpNiiBxdXWgXc(ehLS9Dn2SRocsd|JxJ?e3vVg!JFK|E6FTH;2f>xucw z5M;)>d@-h$`2dtmbV$f z&7(J(QD-)iM^*6NL>~#6CHh3UL{yB>N3>SRcA^KAOLRcF zLiN4!Yr|z;eT*~#4o5s5X zbV1{f*GzUcp^BiPf@wW&v!EzP(u7)f0=m)BF%FDKX>ZTPlI|?B$KNzBY!CAUSM7Me zXh5O{DfTF=GEDb=hCDu7g?TWqVarU6;SVh!f<=;cW04O4= z1>`HDG9G~!^d}TFjONL6@-Va{%^qv-*T;ec=J0(i*|A8|Bk04};ev!DYpm0&@ZH2; z8eI(FU?twKwD&3ARqq5aop_7VKApEj^y#C$zI9CgmBHH-0H1%Q(X@nZnk z`3%q-mQ8$A*{RpEn+uBS9IQRC-@v!GYAxp_K7b>$l;9k^okP z_<+(rfY1=i><7SEh$xcpEEL)%LY+iTsMD9^8bZqpL~oW{S)w~s0nvTRC8DliWVz)X z&7~R!YGTdNL$nKk6-Orb0Em5nRO@9VBc&>F%W<quE~oOfnA<_pFq`@iNSYPS+cZ)uMBxGE2K_B$p4=&n4a(pNE%Fl1k|Vd_ zhC6^=No-^Rl1xF%SHU3wNDmhs=u6E*+@!Skbe#GjiJf-308yQgSt6<$VE&=xAI+|k z98ahsH2{miqE*CIO7po4!@vRlXyS)Zd(h0CcQk@iX4>y9!EaTN-U84v|F9&-6V}!V zkft&(fb+cLOmNB!e)j@DVnNz#EV3GJ4g^ShjTFGS9IQ{_V>8&{EX8w{!B%hvhv_u> zKATRwN9eoTiGKzNWqDqwttEI4Xjl39pce+`q*nvN{5)rMTpp;?13W#30?~>xlfAd3 z``(g0ppORUAAxQZ4Vpe4^p@cKHqcsvrbGNV2TM!$$9(Y0%+h;HF1@#eG~3M0@TAk- zvt805kNzaB4x#z?;QVQT(?|L>IoA~f>5*c+`h#mTS03AIO^^=p;1~;f8~`JOh{ht= z>;Ymqsknn>HJGdb#PL)R8Emyy+n- z2MC`;lk!;;zCxR46|(xH1=Lgk=6xbHws#N6XN22J^sJDbL@z3r=p`Y$h*%>SOVlZ3 zClQ?@xQK?F!~_=`s^$EqTH^5-T;Ml?)FbusEE^KdMf3B^wcMJd;p^ZS~Eua|G$>Dyy z7wIz9u~-5p3*uV=c-@S}ysqRCAQl2{tu27UEa83t*v|v$d*e&1Q0p21xX7XhPBo}g zKR=*0@W|+iV|-gC9M^&gM->$Q&s799a^h?r4V?o&9wSxg1QRQ_Yk<}&Nwf`6Vs5zQ zW?yiWF{yAjEBvlzbQVRTt`$%Q8{sT~Dn=eX{H*2}LqUuLVCo_o1>m>Y+AbJEWOxKfyCO@=7!JX01)8JeBA|99*%L1)2~jzu^<^ONlo5dK!yY7N zBf-(xIE=|4-veT`DZ#2O7Ip2^{4*u%ppw27#1o!iXBaROP>FHvdxZLa0Vp#A@8D)K zY3j%McQ=Nc%c(}24w*RsgcG8LfB{%cN$ao{YHm-`Z#`@sYDNzBORrellQ?HjVt5b4 z?2#$f7E;$&txMUYbZ$0+Q^4;qIrk=?+VmR%okZFqiPvkBxKcRUpl=z@+2q{O<~K{( z?gV$v1|JJ>=cLC02BJl8G-oplPbUN-r0EQS2u~*mBBWWPK*Uwh6~sys0ufhNCjv9& zfE4P6|E|Lv9h|#*;_YKrPg`{vYp0XNG9sE;jAqD@m=Az75p5Gb3BErMKGEYswi7)C zC^6fPnH(t^4re5KS;%EXj7Xw}M2Y$<5$nbNbM?b8X2fE5LJ3i$kjseJtD;1zF8>fV z5yiphVdMF&Aa?^WFz-ZZy8$5SL9`Df(K7&i|I#4#(bN|-h1R{JB+*eJJKhIUo3ljx zl7Y=ivugoRN?RM0q%C^v1!BkuM<;rw9100w6LEmxBgI?%yr8}L4l)uTMZ~cxQY1LE za6jOtBnuckwn5izqPl~K4Nz`2n6}Y3;wizPIg$p?YDSiW1J-QXKbEH=SF#E0nqQ>A#(3s_5 z+$zi@UZD4{1dCmZMoOy0kR(UB_^*w}j+v1#+MCiPOlk}J%JhJ-T9^#ba^OtdnZ@xE z-}!5J&zOQp2I!?wgVOcH^Xaqw?Ca=itet2q%JEAUo{SSS+KH&br$IJ4nsA0jB=U0M zqQeS9P5PJs#;pJh!gqm2NrBxgdzX^W0ab{PcQ*meR&qYjRwefXJ)`9FK<_B|F3<-` zegsqt>p5KmjZ|_J(0C=M1JP^<XLFN$@O~c|aQ<4<#%z&1{M-eooj&V3=+hU!aH1TC@;u2`V zHX>1#kex(ZmCGUUkdj1?2-!t+P`Rw>Q6-6fA!H|!cG6|+r0D<@LBvX8Oc8BTF41No zyV!$!luNWvx%+`0Q7+L_$|ZV6xkS$^m*_Uwvfx{67&U_LsTX` zei;#c0bHUc0}|VTLIKdTc(pWP_rXjZ-&xaMRC^_L z0z;0BISLJIsPLnc*oDR)c}Q@Ryw9P;LLk-KT?bh^jz@!}{iy#`Ali>XMx?Q}`#z9b z4QVSo&?lpu*(?jPKy(w3M7IjrLG+ArS=|?uOnNmO=#6Ly?cffgaR4Y|^Rx=tL6jQ) z6oF;@Z|lpmGC;BX2O+iH1B}(?V?Y`Wk$=D=p-YCU_BdUkTyu%4749wo;2j0NJ@ zfx6j1tT!bV0_zCqWQAE<_yiGqNkWG6Ylnuk| zJD$b20^b2ZoY@Iv*FZ!ME0=BayplvO0S036JLK50V|^oXJbf8Z3D(3hRmYBf`}7ex zI?zY}bP~~t%FMSQ(U40Vs*A0Avq}+d2Ly_F$|Xb%vNcojv71JK8gYhSSX2io8_XHG zoshm0PzAoqlluucL#5HXk{;@!gR+OPIN1!O4%)@|wO_bhhk(>UyVwWnf7!(Ux~77w z!_yBw#4NM~M}D*%z*%%$j&mKh*%v_Skjc^-`U)%}S}SA+tx@j@;!pN@aCOLJ6MxA% zUx0?FJe=^N=2ifb5=YLm*1G}VCN7oAdk=E$m7MMSfDQ;5__|*;m7$C2DjY`iMplcf z+yb5{H+i}Cf@m8+S0(>3xW$2Wq23C{_vFnb;nL70MA!2Wb_W`?9CSSZF>3_SI3-(w zxI_XM|K%tuF2*E^cQ|lH;9|_trKato(WmE_nK_Y*s7*=ymm`Dvv53(C*3*fk>kKiZ z>#Azb(oepIN!Gyh}O%mK5vst9J>=xdwL6furse-6Uz_kYzO$NZd+JGnpl7_BR zaud+4O5O&vLrGeDpOQo@q7*$84N35D)B@N@Q3tkx!PbeGu5}`&YnF(KoO+;Zhl0|| zcDI4l$_5Ukg0!FoV0(qp3FMVP>#uHn8R~4@lNph$^(nL()mIriv ze?$|~AGO?`k(yp7r{LAsw z#u@-Z9A`T@c)mWx zraOxrrUUY*S7gRo?DVBElQoJAK~JlG{=BKy({YmWR3hPj+WCB2ext=iqX9+cz(l8I zH`;-E?!Z%au3XA#d-8L7T1x$QG%wS5X!_sJaOr$zBFwMl{HM7tedNuW&R^5Xm%DU< zle=7;0e25KV?C`!1?BNU7PV(D`hnrW9SpBU=1`y+a`WVJu?Tu>hi!gdW&Urwk91QzB zvWoKjt~}s3qMhhRFAsvAQezIGA$Q}-ptcX|b}RRU#SIqEv3QTg&L5fH7WjE1&iNef zGAlRL;$Dl1P#o(04}b3JJp%2+X5lN~w^6_zF9R2ud;hbO!~IivSed`Q$$Iiv|JWxh zao!HhA8B;uI83|w8-SFX3gsh#`HR3kz&n@g^AzD#-B%tf-ey<1Pnw$9*7* z%+f|@Cm+Yk!tWll?QOQ>W+r4tK@a=y&=%c0<1e}}FMkte4={fMXEZQ>KxYOpe>jJ@ z7S6sMm=ETE49p)}+6K&DZfXPO&mHmnMT`(GbKG$RM3MP$v9pV>vmXVIpK#m({4nZU z3%uzzjUlhtdhAwsL&kdp=~E;3Ug|`Jy~b@dvsI`A7b#%U=hlM{(v2 z>nDe1YCPim)@(1nBR3V8@4~TczRmbHFyA%Z1AF;y8_)T^HLvmcUN)LuJ{rLGcgIc; z@SFec%58;yG>tq5z7qH@YcJ&+0DS)fiw^m9p*0B_E=j-3=(z$rfPapH|Tsjxh`RRZC?_K(yg8jeo zVVBNDcYgk_{IN^tf*fJeA6ma>f8^2|kzV0bUH!lDm`mS_bRD@Wr1@+A)TQq)nEsPL zbLqSQ2*;=9zXG=?RVyzBW(4Jrz`E^nz-9o~aPHvsKzPpe|Nqb4w*bafTxZ{_@vJ3V zk|j&>`>`uOFktUW@&f}a+42KyNj8pchztfJUO{N*kIwk2W+V{Art{G$ko*NlFu%pHP}6ElK|GJ9B6D?n<&{$3U7tV_)4pGjr#8 z=FB-~&deOaV;%YZwRkubM|*5M^7rH=MvHSgel|Vw^W=$6=iBkbwds?8Ck-M0P9E1f z^6N=F){#Hw9AX{$aq^nv$Gt<=7j1hB<|{npzsW;e_aNHjF+A4&H~11hKgTlz=~(v# zbk-%H^C0hR>&!Zk#~`21GO|y}1JbydyeRo}&W+YRgZaij zuj2PK%(JubSoi3qm<#bdhUa^Dtb1t_@(7-3n^6}$KgVO;ree@lOkAt+yc5q+JkR0z z4xXw~$Pjp_LdwI_TxP#QTTB7H!LyX{@L0DNew*+#;5mrLx`*-maXe4psSL$`Wg*Ih zXWAmfT#Por^8g;}!r_&OQ;e{VF~Vn!63%Zn;dvLH`|;eFlm5p5+h^?(n=5vlwV)1o zn(#b<$2!7S;MtqwZ~N80ZF~#ozHK-+Pp?2fQr;qOZR1hiqKrkHA&ApDz zw&9_?brAh{0&UJYkMh>n@SJXXq%oWD*zYKBk%zFbecO5xrzt~Fz9P?UT^=UQVmu{y zn($c1JL)^|?8C!L?5%qR^Wdv^evD^vXxzRAeu&S{@f4Ej4BWta;MNB4a(KwoS@$9M z-;ZY={KEbs-yuKJGRkz6?!E>Ar3Kn8pjiLm7+m+y*?9=g7OVFUS)U=O}yGd??RR zc3@ocw3O#~9kvZ;*(t+Oo}-Mz-;`}w2lB}FW^<;=>(MFCQ8uuSm!0y0Q(kU*5gzNl zbu;#g;&~3wYj~_9{34#0a{MU=QifrlkT>!UffnJR9Jmk<j-50zwg4a@5w{|7Q51w3qdy9p=!otRX2yrI_Y4G9+>+F3L_A(0VUyL|R zJJ)~UBH-P{FrC1|Inp|NpP#+V&-x!meBSey>u+!7v)A(3_}@od-p7~g-vmGAYcJTd z@wbiP&!cU5QtM-Qcs8qb)<0P=(x1oC+H-Kj@#)`$_&np*I(u}jJ-0U3|1*fo6KAcf zK{;3+d(LdGe+BJ+_I%h}{~3sX5RY~C z;MPO%X* zN%-@zj((rPWACYQ{*Wo3Rlrj`yxNJkRLwzuS@$r)d4ZL^y~_GOGKRmsit16M^F2J) zO+y;IqAJ(_2Ka^Z=QrW}51k^Mb??W+8<_Z5cM!jM<=tb!WBu7Ce}m^WJoy^qA$V*! z!=4MmN)T3swrCHv$MXn#8P7t5@v-ivnJD*c@SAvewyAaB8^hlo?P||;weep?d>-hU z>)#B&C-Ce;`aD0?y4_>=+v8U4S*tew3B+ePbNzX`sXgKJ1b*A|Ozn4vJ3v41@S2xz z;j!*x=VMO6!#h@fj>kIQo$|S5n8)z&MiA@n9K+vUnPTrtvGMOkd|suJ>u)bVu{WRC z_!E#HFGb1q=QSp_JWOjf$`mfwwWkQj&~ZEje_NO9Z{gP~e5`cOmjCIN|2W$5n|NNp zGa+G10lpN!AFaap!@~pRt$XJf{`SOud)&T_e>dX4f+yGCo}F(G&bRUZ8*zDJey%@H z!MEjMT09CrT&``^CfoxNb0{=ECxx-{bR;^ka_dsVW%C)vh-4sm%wa;|?J{Fv`FMbr9_z?k@~kkf6Hpc+4^5pr*9q>zLtffDYbzOdfkqkPUwx zeasWS?D1aKfA@CaP4MvaF6+Yn-68)Kw_=Rr;dwih{n*DZo<#);^MHGJqIj%pg8xB0m+gf}g?h^cc9M2E& z&{}*29%~i<2!4M756${%1@KK{l1CEmci!z1mZwRFLiqg?{HqMtIf-%W9wq;z_Q!6VjWm^n8OxsQ*xzh_>%cn8I!A8*hr`*A6#c^Ah5f>KGY|1VqGa6>q{!Qg=Y4o`9rF#R zVZ+0Ix#_M#q;+_9-4zPw z?+=9FD1M(8g1Nr)PzdJl;~|*qH#Fd~&Khr7n3nQNFgnlwpW-6!o&Xk;toZSGVsM}> z(bm`7(bbvg9_kxx+1uBb?(S=CPYopcQv+T7`%(j~-HEpDzP9VUwu^T65A<~owDv?h zy1G+?yL-CY2Kw6eb@lHaZd+cnd;juyRn_kPF8prW-PPOHJ=C7s-P4K)y{R+%c<{iW z7ZkF;we7mWME%Yk^;m@bvLiE?`e0QGXw5g3?3M^Z7t zyVV%lYB_s!LY|(jj!g8mDxUyY{m*b*yzcY^FF&GwdQ(&ySU%;5SDz=!mPy2)pwokI zZ#!VVJrw%(7bCv?vV2>PkLRl&=keq6M8s$25p~;*z9f3srl8f&ZiWVZ&bs=UX3Nlfb@H5exvf$Ho=CtJF=I=(z!ZK>ZllX!DUX77Hfu0dMR zN8ss6FxC=NAnZU2bl1>K&JX5S7E0Ts_jx*?6B!?LQF8B4S9f|@S1;%J0ROrCuWE_I z0ny6CAq^m2AjyoQzF@G(5VSm<74{dN50uc6L|G&njU==mDa+$=y_v7S8pMc|=@N;$ z0Dos!5zV4{Dt=es15_Fda`AN{uBVWcFVK}Jf{rw47Kxu1;f+BwAuENSn(EI&*rvGl8*_qxK5Ak7L{3A! z6KyiG%t5q2I|~d$f8Rj*e+BZhpyOm0B&x6r!f6B`(AW@euBoc0Jbz{m*?YnC*fP_b zoDDPRc*OL>4uo|@fonj-5oGgs8K+E-`u*c3Z24$u|J6yt{^=xPKR!v=9hej*l<_^AP~z4_x>4#c^Fu-^F@8pnCpXqm%gQ zcQTT?Au7?z!E|+TLQp{YE3zOh+B>+dmWM^A?`g*(4 zeFI^p<{nPYRcwPYLke7X()vfOlGY*Bp+AKx7O?$}1e78`%sangy*6o)x7Oe*XgXk?Uqlv*V?^TEU{ zZh9Z(=^zG}%6-^N9nc!umZ|><=CVqeC^2}dmRGF+T2{%NkPpJ7#PIun1@@t-)2V@h zq5kyXIGedW1x`EFvOm>^K}zw?QDSPZ)SnC4EtiovAmpI_w8??zrH0#5{p|aoREE^k zEKXenA~emUF9e;o7wSvMbwc3#ap{38@b`a34+KNQ$k}IAw1Rw{ZXHMu^|z3&jq)DVSPx zWcP~dYT@)SKh4l(eqISkHP_p5rqbA5HBOp*_GJM|*k_`5IXPiuXwLtQy`50gB-T@o zhVI7mdRn^zikBr5SpFY!mgWEPGvNR63z5+ZrpF*j2nFTvkvG;dfC@G-PIX2*=ee(UZ1|ssTshnsr2=I1J@WC%5y)jIpV{$?4F}sF9$Db*{^{j81@``fd%BRoMlcSZ$wvr%u z?n*t0af(YIaIR!Z6h!oFvgw9q7J!j2M2so(bzuzUj7%dKg{0zVic2eT^(sY&MiE@u zG8AC(E-x!9E7vmtOpfX)7wY1rdY&qb>S>iwiN-aBmt|2sBMGRgQ)J=-bs!p1lN7X1i#fS1pNgT;9l$I&D2)U@@1}P-kIwPLniZVS(VIigq)B`t3)3GL6 zJ?EoaR1p(V*GKXBLngFH{T)Ig>eB{n!NsiwXb+M9> zt8NXV?JC=%S0iFeTrX+X1yOv@?+VbdRd~T7COgTYWh%jvyBHb2kc>l&a6eE26$^!O!M3*P$a;=FO#Khc!p# zedV+!Cz)8W+A{Xkd)bCFqR6K?ZRO}1gB6yX3FA!WobhofC!IBON&zsK*g`Y=m~pbE zwk%37t3iG3E$ObF6ev2nZN$3+6c3 zGpI)86R1KU?W(PW+IuOUnW^i8+ zDdlPxLTlr3U7`k|;sG5{?>`vTh3fk%ju|I!62_Ixv)pf@WECSOln66OZKAeZPg0-9 zT8J64oQ2e%4TBn$!T)p4AL|x>HXP?{;aB;gi2!rB`aP~=xFj)_L$k8ncJ;^vQ}1__ z$vRv~2PZE*n^WCPYG`j23Zo;B=mMke#iCsSC=6y4(8tJpp*k5q)Jp5Q&?C=h%SGPD z%AnlQ$Syry-Jwj=fDpZcCcZ$uTcL>%+z16QiPW69P8|acS1+THP}!oWX^e)*mCT;2 zf-BN`A@ZQ+nqUED4zpOeRxgz--zz;8Kc<(m`0o?StC2la1VX#7ZP1GmaXv}u5T{a3 zV)HY8G5WC@1*`@df(0o#*2rY@CfokvJ|OkaLEFWo_jP1BD{)xQjqCiRUc&6xp@1?e z`PTri29RpW;taFGO+@OaC>itEUshHTq_Zkfhu9|!6%J!zoz$)DiX1F#KrZSJFhNHn zot-i@kb6Nj*of6w6^KV-kp^T9@S-4(Z8ERPblHRs^YwX*-1U3b8yb3OFXuMEQ%#DO zDHNkTqV}VtYEpxab|7{|G}b z`|Xp2-D|=~6kLMbn5I6;fU-vL$fj)IB$7H&iN=p=tc}j&AdiBVoR;TSdT7+BeiSg? z_d!#P1s$-th=_%$KsCOfACpA`7d70hkNC&*-*=#^~|VVR;8=v0Vk?twV*b?L$7a_MTMF1IJowTt-@?q zpaaNs^Suu5<<0W5NPUVFI8tWHN!G6-c^JTgNIcRA`pcmS#6{8O>4JrN&L%WMmEHrt zg1AoH8`XOtSIlc*Mqr$7`XC%=)AM{`96?J_+PU*J^e`yx`eaZ-DR(te zOQPJ-W>oJ=P(v&X08Jx}q)Lc6Gg3jm?=SpjG<=PEA6Uz2Ld({~QOZvW>8$9+9D~J! z(#Vw1Cy=6{DHAb*`WwDvP69ah~}%$`iN7m{`97fXkNZ0wA`<%#I~Um zW1Z3sSH48djHszmJqbSZxE@+oU)E7||Flrf^NkYNF1*uNJaj=7{fay$Zl5@Q^hqU9@Grcutoa~H6(lj4}5 zQK{oPp$3ub9F&55(-xUNm%PH%i%|Lt5UB`6#Jp?eT^f12Xdy6HpO3;0M|E=pmn|zI zHD!WN>!W%rdbPR(UhmM`kc9l)C4m(f3?yk4zzFl+C0yc+V<0D$LSAO_!P`gFzGjgwll!TFGT~a5bP<4Z0(dOW)`t=3)t+BvVlcnCO)cf zp^#v#^c0S~>MBII&qY99|9E3Ol8iKKe?~OKEXpMPt%%|Cj+C*M91#hWsa)q{URefc zk&I}uifCj`2QXMx;)mb~OOp_?av{bd=gb=0=gR;A^;hUctMse{N62heg_Tw?w&Rc_ zvVqfzE{y86YA+N|VDgz_b(st1&?$&4X%w9ZYwjvp1r8fZBOevYwn_PFP@yKSjDth~ zyZl|btki20Os#9n$iN#Ue>TXKnlQ{R)YC*(pxL6}E()O!jO8*@9|(FM(`i6yhy_#h zG_seI)eRg@iv@R3(`yYGAjwt5AR{Onhiiu$uADy#g&xci6F~%HxOCxz7EX8g?n;A) zq{dh4icO>esYr+@k z`3ZJ%kceNf5zCRQ5Pn}3f(`*Kua7nfl_yTqTC@N(#Jnxs==}Xili=O6P+%x;*O_Ub z#;2vpQ4;;qrja9+HX}7m<15*j>5ts1*2sbc8m27m(fEpz-AGvqmhssi=O~%5G~!f5 zSn_ZxBIu?@U1YH2z*HYYM?pfmeWeTayDhrmJerO8Rx! z)uFt<|8>LdG11N;=J-(Vq}V^cByzBJ%#vjd2rpZmd8X)Xb*RMj5o>oqdBM+M?GB(D z4Uut-hU^l`q9MLVgJCQH*+-6!fmC4HVFpWjptX0fr)zMKhCVWUU{jP%4F?9U*#jg? zmud^{*0rsNQN2PD>qZ(1;)#-zhqZtAxQJ3pEWhPg!Ov9S?Otx++0&O$wXj$Rqp(@|LRpJvi!W3ZSd zhtU|aNg@h?sSu43%M_F+iA*EYOHv!De<4@RGfvWH2n_U$K0e|vy`1= zy#y7g^7S9cFr+;0M?DBl4pd~aulYkVwv{awFfNCx3+Q_QTL?7vS+ONsXMR)E&+Mf#2Zpt1>^D6a*xSlf)m8e10 zFWedKVM?kH`!*zXRR`N~mmWZz@+3M<51_3ee1jQgrN|^wc|iUXf*<@E@yoBstXS}L zG$o~iMJ;V!jsCxu)zgTE<<$i6J6HfRdgxsN?$kgwg$^8zm5ekY(>heE999ZcU)2b2 zU7AEIrYWP+WEw?U&k~`h1HH)d+$G_CF5dP6@R8!K z5ou+st*!dns;!3{D`GVAbI_g<$dBO9fA{7NDeq*}8|Y!`#Ey*m362jc?9F?hC^uvL zYM(6mP+cEG6zG0d#kt4==^Sb<*l376LKT>fG#W9J-AJtl3S%lWYW@td-`c5KUl=;Zm<}^U16^ z&1P1k+OTygWV^2ls-2zlzn*E%qhuRyaCSO#=E~yeIll{);z+2qT}_;*fhSrVzqn=> zYIUqCzx_1Y`r-zC=`o|;+ivQOBo|6E3VTojhD>?i8^i81hc_NgQbZK)pnV;TX3vUQ zN2Y8i**H5sx#6UuN5<4ZM1!22k2DhunevXu{vu-%pUq68r$&_uAW>KunS!s|jh4-} z8{V4-5ULA>kdiBg#tq8`v(Xu?Rj!aKBh!lC*%;X};=U0kn->J8ZaOPmKaRo4nNCKX?#p!~fEt7jrCi_&;i zep;`{)(G>gMD=5n+az_3`+B|tTZg#_bAcP@JWo-biztb>%DQZ_eTZzQtal<#t*D|g#mO6OoFDRL{GUlsb)HbQk^#SRHkI$~s!JO)$ULQVX%pdWMlcfkY&qxi33 z(F^EK%-cso9z`GjlRi5c-p0BCy&hyPCCt)*q)F!q6L6HnQ88eCh zK6uSw6Y@7aEXqin+#*#5)iS$+{~7TVrZuea0o9J(Y&IT$Ad}Gd5y6jyB)n~8j-Ftp zX=)m9K~BlclRwp;n^3VtouZ4eLP!02Mv~yMpw6^2hG?>K08xAjMB;^zl(2wG3&OeR zA9!)Ki>t$n_%miS$q>wn$W%*&Yh?byaD}QjBZ~6i8TEsprFIc@0=rlyG811?MSY&0 zevV$a05kwH`4rgd6h!8U_8vdNSxi`%<)TPsnW+f46fB8z zDT6Cr6sjSYOBgIb#VVyV=}Ra7I}Yej-sN-_3BpWr7#_~LmiJ_5$sNqU19hUoMeGt{XHfq*qsU= zXxeZ{hVe}YALeMD!39~>9DjxsV*qnBXYk2UmBA;YDg)pNP2kZ%>aPNYMxxwLUL}H( zj$BoyHv-Y$0(q(-CM1pm6pza=@8!XJO&~>4P>^v!wvcK7ZWA?cl8b5TpM{cfa$14V zSOaZp<|U(sdVKf>QjclsRe-7-k;=e6GL2fA2Sn8EZ-;~c4_Qfs5T;%sQLpfmR|Yo6 z39;tl@Qm7GtdZf)8IHOE&L3RcuH^cUSySR<9t26|--47SnU7Y&j~p~5dW~P#((0dct&Se= zFzE1SFt#*}WH)Fu1_i2;75GF_FJ=?Oq?P@q%(Tbjn$;Isg{n11UXJVELUTb%Aqgf1 zKrUtFIfr6Z(JaM_X#vc#;K%hu^9HNO?fxPfQNW{=gq>+Q$ztxC4cmJOGi#nc)T|NJ z8LzDix}jDY$2BvLl2$*rOp7$5s1riCyIk@`xQntE_9Ue0uvi(hKvLqbmP`LUl z^*Nlp7f=IQmEf9gbq1e!%C>qxkpoM{WKK+NxaeCh1n6Senej`r3#SNbCn^=Ncis7d z)%ItB#6XQ+3fl#;l`zVp7Ia#stUSeA{Q)Qrdpc%VM(A_ndLsw*J3tZ{(CFS50tT~B zYf{z&${AFxOmKJVe0VQ`PP8(~(}kcjVqX%S)`}k?a);Dkpqb;1BaOEXGqUX!OcBzDVN7g7?DUZPmu&&vv4P!!|@Mh%Bn^$ge znP;=BzjnPW;?nEV%cg6`(aTOi<8krohe6RQbu*Q3PSb|m|n69HhL1#=76W5&o52E2^1g0R6(i8Gcm$Zj)+ zHfL1D&M9{5WU>>M*>bnwo^#k)_=NdgfH~YPd@|fEfUKoou-Dl(6{G2!c(AUzJD8QL zsWZpg2rciR&|L^-XDKkVQYib%E25&2fEr|)2!`Y_DIk(qnzw~(#qgE^*iK?%xF6Od zcsB;`TF2>3l@G8KL?c7aI_8b77A8PUFa26SZ=oe@Jc!pUJei#tAhQ4DVH!bvAC?>u zbstpF9MAJ$!wKCGnDJ#1IfEfzefH)kSqb$rG)UwoG5yRXnXZ;~C(O{8Od+0P?VH8m ziY}`PJ8dp+^AIMQI4{TBZf8VVugUI7eDw?x<%G;tW`4%ckxbq+TXG&_tlm!xUo{mf z8BCjO%pydEa?Gjic*wDOl(Ar`j4;f%{=p2Fz_X9l2?k?v4#Dgf`^I8thD+py9qMTl zk?Oxfve)@!4X6iTD}dMKDmeJUg1}ObybAall<8dI0E;45W+rEzvaH@aQ3^)AN_cgL zrzEQ{2iq(585W4-9C_Au3PRCD7TrsZSN0#&T0Tif*2=mTNNt_89~cQNmKO1IvoTq0 z0F3>%U&*#t`>@uawxA^C$7m~kuBt%lNj(G7*j$8H86I^8yOtXZR?C5i$#`T&kSl9! z)^NBqM!xm}#%;7eHTSxftK*Q!Fz2&Hcw!Jc9$Qx~L0+&B1%O1-SDN#XU``C%@>=2C z=kquCV>LNxZ8@*6m6{hJH+lz)lRPhoD!>TNg+O+w^%x1S88hLoQzQ(og}NaWd)?Vi z9sTeUxYYoKi0u>yS#vfh2ERP<90oR4!GwTz>^Vs+rTF`! zQzij9N!CYUQEiiO+IuO*2f6khtT~v2uB4JY{aigD{13WdM%t*or^Iluou0B(1M|5Q z%k_JaMpsZmjS>y!pr5`aJ3Nm;NTW&rZ^rXzgktpZT$e?L&IqGr(?#c59*5%|*%$#o zo9O#_GwfW+qxscGF;H|Y(hS>uY_i}sMp#tE7wG9E@(|)VBV$=(E*@ejIcr!Zk-458 zxqylT?1ziYl#R38Q%IW6GYClYIS(x}G(Y$m(EJBrU-m0O^T(b{-b9-3s~0iwLHvG^ zj-FkTJx)}~U`RXkyXs#d^rF8a`(ayg4|ahBWFEBVhj|UM-wEsiI4D`Us1kmP1jx-< zRc_9raT%==xksu{LGzZcu7tjYShGf$(ep{6&D?ekR8k~b>dObSTA>qDi<$y2Dqc=8 z$(<}NGEy!6Seyk9$`~hSfg(N#rBuMgE?G_8<~2#Zp8CS1zMf+qCz+`CQ%-)r2 z^}O>0iOgXs({U)nsyTWd#2&EXGXtq*mxx|a^>9R1C3O zs*S8ZiU3nVQAf#@556h$Qv)!SJTevP>NwN}1?uZq&quK(39c^~F>fm^N9&B_kB#z} z6c`IT*{+fZ_&Kv7h`Jp*MP!P!cf>J!)>I8VJALKWOG|en&Zn;_D>J0UW#y%nFf$t0?gQ z$qi&!;eQWQDc19kVcaR6|0<>YOjapbM2pbhL=oqykDG9!(JDxMNbI}N_)vuo<^?6c zXOxm7(tqIN@Mx%3cifPa7LYVXq|I7`vtiLdmi{)V2b!GT$E6z+ED%LC}AE1$+8~P6T6v0(FELtgy_KJ&l}%+h%)bYXQcbx}oMk8P(mu z*m)hNAQ4FQkB2fG0lTF34b+{Ks1E@5eDw&n&KC}%$9@YJ8o0w;csH852NRRV-c>ZX zka>lZG)SkZ;Un*hof07JM$7B(X2ti~lY!i*#GY)?5KadYbqTTa>)a9%Z(dWM;#z1p z7a%{E5M?S+)8gqyLpKcv!P&%Y_>&^74fqSH5{jj0bwX{6FJf^vVR0RvAP$K@B-|W{ zgLyBf9_|+bJB;y@;bi6@awV31xwttUgFN75aGJ^M!O5J8^pQmTuh$-aAMNZUv5fYR z%rS<*f8UrH0)XE*?O|T!RHDfLpmZ0YC?Flr-{|N+=uFmp6{Z{6oi;k%I6dv5AsQdR zDzRA(fw_lzHfl&DO1C@aY#kZWQ@acFwTB! zqFI2MlhH3uwW=T9vZ($jRG9m4>cV&n^Y@swxpq^irc<}tMcpb6Awk{mfZ@fcW%)Lu zbBz}tkU8UG3Rl6()fc6u!(wr@Szmza32ItB1KdGaECwz3%>skrXwP(zfDgyfYv{e( zz_>WJj??U$rkN~JuW4V-+B9l>ibwV!F&Qf3#?E!X%{l5`U=DQKWLP+Vf?+AUi2FTf zRq7RxjqwZ2nG5CiAhYy1n{rO2AUD@o%GJ;R|3S~OrGn9^Y-Va4kIXTC8jiW(bAp~< z5cHI6*p*{Q9oR*!j-ijywLsy=Zit8VL~q=L#^ad4v(xmda6S;HH=Z}g5?fwjt9}?9 z8bhplkrG9=U_U11|H%X(G;tU#JBaOdB({+1(H=iU`;1C#Z$~+3#y6eOVi2p7jmUHp z^2}8oy)Fz_7SBI6R-OKGZC1kLM<^Nrg*mw~(De*c2Q_^VJanOY?(M%i)b!&M{0#c> z=474?0BeSFnR#Jo2pfz^WM{G#|H-Y>%8#=%WI}958avJmwSxGBW7I$=X;BS<03u(< zm1t@x2e1cFq+I-EAk`yU&7wGZg}N8ogR75e9HyC*KXH~e)#WqCJ31iOs$HU+qE5-= z1SV{oz6?pt!j|PE|AOP-0{EpPlosHV@@Csn%8RAd|0#m{0)SCy;Viw$P&!iXU`etJ+kP}H_U z&PP}7u2An6+aaq2fDxIj>?@pIkgvKq8&t#vW3S*QVM*!xgJVn#A1w5#5T#MD@atwH zlbG;~^^+FZPJ}r@bd2@2`E&8}0I&9HYT(yTkDtRsL#N zL}r&h%j_|yo*DDWtXSDLiDDl);(&76Ny2E--CdirgNJ64yfg#beDE{J#t}X_MvaUf z+T{Z)k4HN+*E*$w18rJY8Qf+1oTEtP+Xcrf##>b*{K{=QW?U!dv z>Ap^sS;+5#2to^acr|Duu-9DwB6;lQ$1+DG97HyB3b^(*z8sD)Hv7?O6g$~NknFKg5#=UawY?I zagOv6y_Cjz4>a|If{ZqPB7$F!HaXtCI#XOd8y=ZeV_;HG)7}i6*dw?hULW$x$8}yvnaj|y%SRpc$ zyU>5l#^v~Is870!eaz8%YGdboYakMh4~HUmi?~aql7=BTBhry$~Sq-GD$6U<63T2M#d02#0CWYkQTD z8Q4JLENCIZe1l~c*_y&34#;kh-E26b8A<%<&G8CR&b|d_;ezzwASBrqvb!0Fb@Tp| zTCFqFDhMh8g)~-v)!V~hu>OjQ?v)!@+D>gX%#c=)Gq;|CZovx0U zhLg=@N$CUIYCk!M?2Y9(XOOF*tyQvyH(Hqu13qS%li@PIDrK(9*rC73d2c0J)hw=a zg5lx~P6NVhS)6L-mNtAlpVVgH*-6T<}JbuyG#qQ8^VHL!N zLpCj9Eo%2j)XkuQaMxzjR0wxP&Yj0K3~(K60nu3LrD#;l!w?#AgnzK8JIfraMQM)b z7mXEvIq6H1BY8$8n2Z=tEK_a5)3dPVd@rn;VM!Kd3_IfbQufIT*=<@1LwvFx6_IOX z$ds!o&0v|-4mNF79LRy8-HmGm*bBUIi$@$_F)?#ucol5?anHq?44$313hn+P!8T?&?G~L1C~RGD)jCNh6UVJVK`YL(&9851=*u~Q90PifUBzjq9T=Ywo)nX z)40eE249^ECNQcRv0XwwUB|d;0BB)`!#b1+%~jqk0|}wo1Bt=Ga7f~3MF*-`Gz~+* z9Banb1gl9?8V>Pup$?$BdaaQA8L%?&#DGU^$$=$zLbn2q)TlK7pj0U|4(X? z4wY#`#-`OUeU+;xQ1-KxX+*8TW=&Eej1!)bP1941P995Dj^k|3N=~|{gI%n?1Yv?l z2QI{RV4QOZ(K?9@Uh~kZm8Mmj^@YF}7^{}XGo$KJ9#eS;s#+a8A{ZzWr8#T>X4M#j z#CYx<6IGg_$Ubh&Y-jSJgGA44#~gy|c{9aoG!(PD|uCrRrj&Omf;1NJwNDP4vi?FR~?y99hI@M^=#8`!2ar^D`Oo}Rt}aTdyUC;aFN z)HO{a>|h!zQjIw2LP6=SL9C#|!G3sfFg%K;5C%s1JT=0HHXjuIi+M7uvPD;_A4AkC zsiG9aYfQOF(yU_5dVgGZHt4%K!>Yz4uCiguoTsU*BI$;LM`SCo6NQnQjJ)_PkL~#T zKE5L&4h~Q`3mz+2?e#FCQ8+(S_~wl${3}Ft z-skz4K{U=CXkd6eb1-gBYNoJqAujEMbTS!N`AF+M23d=ZgGmUdScuSDr>@RMRkIor zMpaqf`A@9FLx|($DOU@k^Qsl@6@?HOyzT8)oN5}a->$~RVkWvBtUh+)Hbj~_WrABy ze%EX>4yRyJbYFMkwjFY=u%)huEZ&6!Q+ytDT@e|QmfS4IUQ>*osfHV*%VtJ8vE>+y z*py@i`2rb+IJPDjfT7yS#Zpo?xrJvDP`lJzTUxb?Q*fbr7<+AGGoL{z?9O^OtOape zhdFK+%^jR38@-D;zKrO8WJ`v@IPn&A6)dcf7>*pl2rE^ep|EJqf5jz7H^QD8O!v7E z4{!_v(3`A*`csZr5RX|bGwV_-s*9z>q?p#T*!+UmkKTl&(ZyhY=0wFu-oN#$-y~--8jpa z{5Tr>01skSL%f8!3?gcg<;I$CLz{n_qhhpUd*%3Dqxq%kXR1A6stUpqC409&eK#-W zwCC?`Gq;&wf3Mu~gS&ayGB}bMdYMXH1?2&U{(M>TkD&_e%0?OARd+FLK18(3fjAIC z{OOsIJb@>K+z|*t*dpKSaFo)j>28ulGj)V8ms@K|8DTBNmKYHuQ;nVPL>5m>kk*hd z8Z%)sJAA=}ndz;TWkw%NgBk#5k0{%w?M&sXj2WEL2XQW#O1^{zC*@uB>$mLW1^Umk zzvnE#O8{7kWGq&i=ZP{%uF zKQfN>g>2qBn=LnZCu9O_DG93Kig9Ni5Qz2>h8C|8PI0o_U@u;{vnv_RAv6mN=E`9q zAf9Fs6J}IAt(Ch`!M*r3Om!Z)OOhIQc@w!R>YZk<(sSn;>bgRBVqbNJjuX!(<^PB& zDC{#qqC%Hq=(F!52Id342^L4udf&HmLS+on{dflJLN( zBf9N;n(eg3Gn7#p$DUe?OH0*lRBV)!M?^|Y9lD??sGWM7;SR}Dv*md0RX|P|&+O(3 zHK}Q9TrkGD#5DAbwNV}%3W{G0gBNB1c0iKjLBvL@XD?9$r-nP|en9pIOcphIG+Ln| zfOTQ0ZU~aa-g59yw2w(b8;MqH47I7$?;nC@t8%f}ZGn1`Q?;Kk2Rr>hh)B<`9}#(7 zNW@7b|1pVH4m}B9p>w7rW#r`J2ncA)DHkYDY6X!q&t=VOISZ9xu^xnL>?KC%3$lrp zAyeCEAAym`wH&J7M6RrnHGbI@Fjt6IMM(Yk!V!G&6%LWgx-0G4kmGs!xi<6ajSq*)13-bIAmdIWa!kwswJRSz4`;-^gZ-tgtmK-Rfa$r{-Cnvu-i7Q%J7SXd( zWMHPE0IU(wKTrT(2;ZwAHF1HjNeBU#5lIlZrnH^!W{?9>86HOISCN9rVMfSg)-qii zgXc?#68chJ3JfoY$#wg=ejigZ&oSlfp3d%6pMXQIg6p_|xoJqS-r|0Nn z5aQo~4Y7bA{8u!X4J5SaLy@?Efrdbhrs#{Rd9Gw>6x5h2b+gXrxy`d!n>Cpm(wp9f zcI0Yi1{Wq#?aUHN%R`@w!_-j|TC*6+X&MZ)wqA-`0JY0%2$J;>VxllO;YteEJ%YEa zA;yLG1s07|m?qj=)2&t2iM>Nz-R+6Jtvy(BPYm~TFQdQlUDn<;kl3=kX2ZrSmaV&V zXU+0u4VSG8zF5}O)jKqtFy>avU_&vOz#ju92Gc`(F`F@^mag8ev^nS4jDkHW)O-Od z&IN49A-){-s&FW&p0B4s{eYt^aYvG@5^>weY##erbq<8i6wKOy)e7>SKB7GEGZ9bKJ?)&WR!@T%?@>TMg0 z@9@xZo~QF(+K%FUFW*tb*T{*fm9GPnTc-GaX(Ruj&AaE#s6-s_QQ0`u@#D*!~Z*Dcc= z+SZMAOPHh8U8f@IMPLY?x*fJ1N|2f7_-#%>}0Ym9W@00oJ{zsMtszkWPg8tD+fYAd!7P$|E{>+k2cp7#aUiY{W%D@H2{|r%)sF4_UL6emw58 zA`LiZ4_~tw(a6QDDn3{yG57(ZV5o5OkYVLbz~47S zTu8iO#JHntc(7xz>kO#zos_IH)YwpAG#%R=4QGfFsd5cy<{Uv^U?wmI%`eLLPyT92 zio?8(?=zSRVzF~#RSROV$|W(#i>f?&-+lMVqWSSRvB0CK2cD#L_os_k;1N!)lzZS; ztGrFOqP#yW@)yNG7!$F|n7OxkNQPF$8$Pt+uRo`gdfQ+}AWsf<^e@9bUHiIv$>4yc z84u@!iP&&H6L^VtW~_mPm6`EIrW!|Is8yg|WDQ8&gl#ZnjMS+<@ZM82{K}ZLyqRo9X?adI<{t?njuP^xu_J89kU2#-rdRysY@OuP zF6qRZ{iyWQ{lC8b)P1)4>A|+M)=yxzg$ptxM>>c-*R1`8=(z~G4wGARrkh09eoRR1 zE%QHP@8B$tCQ7hAe9-U>{3(Ubuw!y&lum z_}dT)zI6IPxDoqV#KqwvzR8W)J(x;e7cSxOh!Xy;G~%H*3lRrWt?l6g9vV@=PfG!z z?R-;4%HZCCtOmTFYFF5GOoe%Id^s0`u*sr$x%L-epWzL0bwg4(sW-XbuOH}2XASS8 zBbxQi?e{GDGaXA;cd>x5=E9zNSa9WeSb&jP?7MGHzn{6n3<~~qYj<}R6}F2miNOO{ z=nPRdp>ZLFRg|p&DqM_K!0kqJfmX8k^g$T|Z`N!vlF&WKaxTK|19sGhq;QAcoR0Fc zNZk3rq=#5G%o9QB9+%R+S>z*^yyc@0SvYJez@{#>Mn@Gk^+CTpc`5Wgup=l`t#N79 z&%ddynnggCqg7YXeB@l{zPTL&3aT|IE^07I^}r6S4#mE{8Txfx`B@s%ljrM#rNZU( zx3;$rqy`5)`)=v$ZAlGxrCYEWf6(h`9lXx#9OxVB_qJWOeP_#Ntp0bkc6Z&7@-|+v zW7m$b$JQ%0uMflPn=V`581~qD#g_Fuw>O2oT3R3lw~0{!G8||<;I*`vWwjP(Z6Nuz zrn~xjy{4hQ!Iteqy0xus-u^1bB+k?gnsy?{BJJmXni6>xADub@hp=L0~&N)3{`UU-VNmq9|HLwE= zX3E=)ruZ8fl`p zaw2B1>Fv$E9epl?w!I#3y>&2Dg!=uhUEQsFyHlntTi4k#?Ca`CZ$Xo-Z|!ay>Ne=Q zy>BRu1(2QVS~jH8skXFjGkjwMP^+fa!Su%7G%yXl(AsUgi+w2=;`)GbgO1t35!lz= zjzck8y1QG@uY!jR&YV-y($v@2?+r@x1;xCidk9$JQrtYaJvE4;*-qU&NMtgFg{O-b zphl1gt0^VxX&r7ENU`KD=FVXt)A~O46S~gyr^K~gD+M*92e_Xe8t6^6%g6~;BOBK< zjU}TpyYWKM`o3N)&)Y`c*=N6FZv`c>gUJ;)+@yU&18u3zW~{LB1wFQ7WanUqO?O>O zkR#hHC%e%ySl`o*8uzqz^#UhYWs9X|D75q-8ARCMMGFH%lm^+&rsbqBhkAQj`@Ob( zL%r9vNLWsXXX6V#xvt)!jG%o8IZ(t+t-bBt7$(5R{-LzDx2spEuET#aKZ76X?us099&5U~2f-c4w zq|imoMm?s941wKDuZy%dhlb*yt${vAv=O&0)wMsh0Y+}QBr>Q8T0&9H-WF0^6D=UOru%mG_4jr6bsjKdiyhnsT9gfYT!Z<^P&`*AX%ELG z$W)o`YZ2~a44wf4+1b*1JJ+{tyn?enf33gl@~u0)jlI%VgyFw#ebaVt`^Fs`w_mYw zL$!zZ`pdSoY*=@x{bJnUD>}0ED%j{V0eTB(c4DTayjhymjX# zP4$;ra6|phdL-DE>TlVJjlV#DhmYIR{dQDr+qsRi#kRgd@I2@+ePjKG?Hk_`@%dYdHMPkdd}pkbudZLA%;wys}y`Ho%o^K~pl8|QREu?$-Rq<3RekRw3vY#Po9 zY+v7C+RIS$mVP@=yLlsAl;XA2hMD_epda0HNX$h8SO=j}A6 z`e`AX^Llc}aFTg&D__Zu-YvGFNkS9RiL+KwUDN?A1~uK|$|*TzGDei0!=v>e5U*{Zt)dPP3NY-qxY^0W#vQeXGMg=eO^@LuTtU4w zijgbp*}TG?;R*)N?EzLezmX^!w7BgxkN5&LY-msrD}rXFIJ9$E8s8PHWoK(A8aLA* zsQAv|roOi8a*$U1O~+B<3}{w}SY(pS8FATU$@OGNMhgmc=6bM`SW&h)D|XtoJ0tcp z&nv96r+p?;#h#zG;o)VyeW_tg#OXwOA7r+~{#DC*61{yL{eeNfcj?y4qxCzYHSy&& z@v7HnefR&{+U^Y**T4CF+j7aamdm$ptB2BPef`$Uwr*Yz$~Z{5+6x73uYYSxbxQ}% zQW?_|j2AhzjoY^(fmC}}M~B4Sc^Q47Yf25bwxwTpRQlCw+%xaq-;fCqt8AO{UooP{ zfv|bUj?I^Dt=~$0%-AF2Y{i1+yAaPW;CwIdU~yrQ!0__QyF3q?=uyL?@IQPtmI=oQ zUkm@$SRBBCukt-%x?FfF{Fwh*JapxFMk~)<@IUcR6UK1DbR~HBO&G2(&Oeg(9^bP5PlbqAsGz^*j^hD zFykGbw-CQ=pNy7nH{v}EL>ny~#=jE*^KQz76aG0CnZ}C$Bm%Cv#e}mQgpce;-A_^u z#(Nd<9t4gRpClgJa1JcLp3Y9MzW6R*@Q`72jA!d?zqu1_wKn6A<~Q;9%}Y0WUX6rh zaFp%Fu)BhBSYKRzMBh5$o$5C9*t+5w?~2qH6IWSw$rmPkvm_0J{|ux5a1wP#-Lk&l zP#is)fBQtH@ept_w_jN13FzpjvH5YIq?y4L=Etx(DDw&lGx=G6cuART{aFu*f2rp^ zj=ZwUvA%fD(TTT9P3-sOI7vR-SN8j_!INdJFP`y^NTwy$o0^!mWIlALGU8>*JO{81 zyHdh}cCIg`1(z2N-%|6LRBK)XGaS6?*IV_)<86KJe^(C1n4Lw)@ODr4i8w_t4GyR5ibX;;bEwe9vq zZd~9XOThA4e8Ep?%W&I=!!}47nSMcWUBBEfVc9r-R4^mE{V{A%=8-tZKFsxB8_Yr0 zKU|im#LtX38}@R)=k1oTOgU{ByuH;Y32T-xDVxxQ+;K&C_e6|Sj8zOtX*a@mb$Z^B z@VCIa+;3UGdl1*d(W54xP+J9QF}x)0c?O3w<+tBH2wT-A$tP7)PuJ zae?r*oH@zHL$Jh)2Jv1_0YC6Nr#4PN0gblt@JT=u3{Km4M+3aE z@Wa8Fx8FUQgI6}*wh*qcPA>;-#Cj4w;_8^8UC|)yYdDy64}NFWE0|-Mez;GV-iwnl z-&}@t{cPM|T!uZKHuS*4-XSwLS-28qBOSBwiD5IoSx0_f(&l-0<9B`Wg!lLuyf)9( zt)6$k_-Am{ezWHt**v55e;RvQlJZT4_A`%sY_$mc+dRrK7!FDNOgq`I8E^Hx*K+c= zVMnjE^kC$7Pdgqi6Bb1}EXRcF>~|qt4UJL8`5O4vcutwvcDem>2=jhxN-t&t6m_-L1 z?`6N^`5a3^<-kwjXKeV=LmB*Gx^xWVH-ytGz;g;s&B|wE@sgvHZZCLO{vDv5tQX_H zcp>J^k#SvG?TFhS8Byk}v~0f5BF#G`Zm93FX!&Z_mb~Bl5aL_9K)hjjcq8|c3G~nO zmks0f!FS3xnJ`-q-sYP>vTa>G@tL>wB;mZE^5s$5!S*q45KPMWHsi+DnOEjLH}boz z_OWH;C1_ug@@Msn!#Cb7#{AfqVO*wP6A1c}!={gIn^}KeFvZ`w{=7|UQ^=p~$aHx9 z(;o59w4+Un*E6AOTw1whA^a@T;Ds`%w#+kxd5=t$`A*uLe!LZCgv<1~=Rrb5=e&9G|IPXSy zXk?$dacaxOg-f*_O5rEVr$L&6mf(qT1Q{26M5r9n#`4t{Wsy1`li- z^ZZqIiG}e~+T6nJq401Yv0Nw0fD4#ws_@&Ei{H_oZXO=O;qM6lBnW4HSVjx4#_upb z+PL{>3;t#wGA@rwY?ip8euJ9Ah9fADbF#vtEVIq)Jo(<>Np2Y#?_T`jiEYFKTQ}?f z!jWuzV!n*e6WK13_@R6O+i;$qmX`i^{UAbuO_!&F?GELaTdpX=R#X7TQ^0kJ7s_V? zWsY!r`%cfg58wRzcF&uHymQlJ-bWG6(`VR^>jIfKHy+#JQN-iX9uJ%Zhu1+;&;6GD z{1U$9=?zPTZiLExiPaH}EF1G&I1PP`ADc$bO&h%#(xg+xh3s= z&;*N*qs7~ac>Bf??;zrFcT>KUZ|rgKAmR;=Bi_@9cjy%HSl(9=k6UhtYonFF9369X z9O)zxk6TQD@*~n=y1Nk`ML0y6QNs@+oSPmdj1hh>!XFwV96{cb_(R)&Lr2_r9+4O0 zzKB0Gw@>1C7|#Iy#^tua+C$=lV=m=A!NDLLA*VbL1h_{7KOD^ ztQX;l89>505;9JCxG6B?lweZE14mJ30Q^$Y^BFJYfmshZB^v*Xhw`Rm0Q^!i3xmI^ zu;ne4aMUWwAIif-4mTm+!e$apPqr|r1aQ5`!XUVC!^IW`L4rFz#ljefaNu{Nd@GrW zAs0D#CcV8)r8az)zz;ciw!lAeFsU92JJrUAFbB8E!Q=)&n;bk};G+(X3jC0RV*)?r z;7Wm?cklv%Uv=<8f%D63{)+^j;o!vrFLCfW0#`Yhvkmxb2cIkOS_gBagU56EL7;-$ zhtKN-e%RsfdV%k8@iz$kAqQ_1_+AHJBJeQ>Un=nZ4&Eg20}kFS@PiHp z;{*3G2R91*kb|29e%Qfa_TY{?m|TYEJ>p;}#NZxv@HT-Tb1;MjxW^p~1`h5s4&EW~ zU%BzRQ{W3+_~il@xc0k3;7_>rd#k{|6F(d zZ|XJZlt_k{v&}FAoDzTPALx|VA#dt_=#;O@5)HP|*BiJ;{3#b2xL4kD4B8<+gjqPQH_|DQ;*g&~Gr(^Xf6D1}iVHGu zlp*MpHz;rFRq2$MmN)e#~%@bwmly|-PVbBKfu)yU8Z2&`PgcBJV zZ{>lJCT!3K@Y@BZ{*X?I6$gG8v;lmh_`l@fn*^p#f=+p00^xXZB%SgO$@`(*@&bH| z{5WFJ2=HNnsUxCO-aF*Y^+h@*5+B;r!MBS4oqObk@OR1&>V)Z(cbmK^+tVr0bfWzY zngPCD{Ha@}Q{KDeO`e`kd3VTrb-TO(-zh(ycJR9ermRM%y!XhPYXWr2`z?7>XGf<3 z%Mj{Z4g6ktbIs1c?~^z6%?AE$c~ehl;Jf8bdm013U*25TH}D7K&2=aP|Bk$=hc@s% z@}_>-z#o+NAqRg*;MW}dVS#yO5}lG28nc#S;NKO0>L(0*Ox|4UH}HM(USWm>zQ12! z>euL$_j~f5V1^0c2Lz@Lh)#JQkvG>O=#=-Mys5jRQ{G4AO`Q;(@;)Z-mmU0Zfhlv- zDeob9Kjh#~2pkMMgg-1W*Cy$d_xtjuj*CvoDxlF#82FRozsC$ygg+uM*AeNI_bGXE z9hFW6oGjNy4g6_&b8W=HkI9?zs)7GN-a8%qxWHU{rBmJ?%A0GRbjtgTypx6u0RAI^ zX|qD7yeH&Mn-en;iTFfob1Dr@Sx9n`N;Jpde+`)e{O97|WJu+_kZL~oi3g7z9#P%9Q@Y;)Bc4{d4D5su07Hz?{DSJbviobeO=y9IQSa^)8>ax zdEb;bZ9nLg_jmH%=HO=q=DH)D^8Q}lk2?5U0#lDor@ViVcgfB20{oo(pgxdJdEb^d z^-6Tg`;NRR`_n1!ALY%pDmvvoFYjO)0Q^q^FFjSNrY8RR z0#i3?;H3f|a_};Nk2*LmFm;wDenQ}T99$*vy$-Gx_;4>@>+z_gb( z;VT8EU9f>y2~1mB179F8ZDI|)T43718u&tiX#;EEiv*_4tAQ^Tm^Nkx=ISqOY#m%H zFl{&JlvgJ(*F_DyM&RSF{A&e%#KHB30GQ~|?)~T&Q}Nrsk3-Z5DnxB6O6wTyf#;NLZ*Kn4~4V8 zz7&GLm=pgQ!p`qUzxX%&uHA1w$OC`M?=8RT0cLwN2jPUVnZUF9Lf?yd#d*+Qn$MB! z1c`59mT)D)Q#t9khtgyE!y&jH@s9`kKBm6~@RK>|TbSwdds`k4@w*W}T)#UA2afHP zTYuKq%KskZf2Q{}`+=uNr1#6>^QrLn{W;}j`K)~DdGD9<9qh6NeE%u&^AMwk`uhVp z@ac}P2SzEMrGK8c(mz%E{IdCfYLxs}2lNXom#57CY`4c}M=6h;zhMn5^yI049uq!Q z`<(6aePxvL+4;%yR=wfn`Q|9)vGXxjD1G9)oi9D_f;YT;-yNlVc7FD}3#EK^eum}2 zDa-fE;`=M3l*jS|o_Dd7$LbS2=o3i49(DBei8q`+_zDFGoSmO6zY9*{l!acdfSy<>mSzSw!xHWBi4V zzLW^PvFnRyZwa^SJ+#WW1m6=TTKRzayD%=q&%4?iMt#0f1fEK>K37Y8 ztDp6}PYC?=Qk(wO@;%n0183r6{nNor->xTlSWja9R{!jI_Y1saiH*Nk(pwvX8GmO8 zmiB0|@sG&&PlaHHTY1#;7RmUs`e)DkxWr%kHv7GStv(Kx022Ouz<+w)0`Dl=gK#-M z@d2|u+k*8uT6`0(a_|y??RvB4CA{Ck_k=N~@O?tU?fNM#1b-jlgw1%|AmOWBdgpqd zLpawHNfLeRhGBkoeUZCk2;22n&)X=lwGW^b9K-E;tmj=Ku(eNs#jL<~J)hS3&mcd- zroIa$+^!#c-kLXjeEti{W1XenR{jO0l>W8rHMIPCqxq|sM=76Ozkp;;5ykTdFlJGS zJizRaZGeq?Sn%DhN6@lnI^vh6Nr@T%QHj3?uyKz{e7oM@{lDVA2R^Q<%KyC5LW>}6 zZ24Ot)(#egG)dDo1;n;#q0tmV6H0-?%VcJf44upj^QTP!F@+Y&AJ_7;F0cX?Eo+sk zML@*`DJn}>i)E zT;Ftkg|NQD^bKA3N1m%C{E5*L&3s)CBf3fWL$-gsNy6)VFkwEJ^LP1b4gaF>`Fxgn z`i0-VutanGI{!p;oaqnk_~1CP7oATdI!gFY*!JGgx?V!`ki@V17l_UfTK6xo*TDJH z{Xs+@c-QTZ<^A4(%Ks2e=Y}SDw7%$kA=(3xU*`*nju!d%Sox0@ev_pq2!F0ab9#Js z%RILk{oDTVHYp#SABJWm{E2H7KU(6~^%TN-3hQsc_J=={@VZ`0Sg&RNvK|fp8R0Lm z`Kgikbp3>|e!}>Twtst4@VcHrSWjU7CTmZ>6TZ%$VJ1Z4)Aa_zdIRHkTKw+?uk)Ei z9~QjMw_^9T(7HZ^o>jtcweme7;dT8KIT8M}tjcF--G4y(Wk0Bw1W_#25On9!M zUtPb1XJO*A_Pz61Q;Ro9?0NO5mUC$(}XL9&cgY`+KSsvX_K=fJRuj|wJKP!CQ??H%|!|y#;`IiY_ z_Yd&SXy(6e+s~VYuj{is6Uh8v8wq~=Q24svfan(C7lQo-OmqHpeGs0H@aI~4J3(mO zuSL`<^jOP}PzUUT>G6oiqloZzKNr!*gEoye;h8q!k9*hcd$5Xq>wX(P z1<3k*fID+}E*E|2{t==Zg`etG{*A)d^(;OOAmMF$c%ay`uGiuA3kkn&jfQ_)!s~h` zT3+G5X4|7Z!q@e3!g@K!KVa?cN5a?jAEIL={n55RJXX@z{a{305}s-`{VoZAqC<21 zI~&Ea)_7-4@H$3J;C{*k9w!t;4R^CV69 zQ%f|5j~}4)a$1Y>OMuSq&;HYL!S6h<#FzZOuS9ctn=#%o&vHp`my+0T$NaI@CN2HV(i3Y~>e)ulxJ(6$atA zH7UPG__|+=uwRVB@3~0%R|#L&bBW$3_PEp52Se-r2clm}_%7Q%GzuNJ^bDcs3&EPFP zTWH3#~reu}%mKOXg)hvcI` zvpkDzegAJMUtOPvr!VEZ+m`P^(%$HPCc=Iu4u7ki&-fP!ulvae`^lKU&iY4p3SalD z5%#MwKiJlZABO&p)!%vVy8iC3qCZ`K#rRp|*Zn+%{XCrigM#&5rn!FWepkYNSLW}Y zi+|)tsY0Rey+Gspl;Cy0EMH*4c->!upOU|=ixr;}yzW0mP6WShx$=jEuls{}R*mD+ z{V9k};(N;W2YrIq{eVbW@UQ1IzAeJn{jr4ou^iuy^OSFB-A{!RWWv||<9teu@w$JU z=q#bPTKj4jTKA6=oh`KPA17KukH8+7HuF16gg?!O|1kXwe5S`D9gjZzuG{N>Rt$zeoO_gnzyfxKW@PpY6s!@~jiQ?)N52oA}O9ep>jtADgfro5TNRiSk#P@Yg6k zP2^qf&@8X+rzN^w!f)?a{OuB6_fHb`PjdVV?E1jN!tcCV@gI=*yBwP1k6U`8@Us>4 zvLOxspAtXz_t%;?bA;COLqtait>+bpI^K1A^2TUhOZ|uLPbBP5Y-hHonE(6zAO}{- z&sbZ&wbEYl*=F;6?Oo5`p;hvy`xOcM6(iuEZTs7orF;vvzkONkYxf$>|0uDaHyxVo zOZUGL_P;W%=Na%hREcluSsFeseBGZ7&sg{y?R>eR^?VA^`R}^EPOZ>awf!8r|DUk` zpX=l9gvw{=AzOb={$JnUv6Yi@?EA0n_gGXR50{Ug7a^P%=>XrQS1{g*|EenCbw3+c zw!F_&;U5(2zb5S0X8qJVG^gL>&?DJDqx+2s`;9C2-~7Gx{jcfojtcpz*@K=J;v276 z-Zm@WzY2Y#olj2vujl`7wTG{cKps7hML3Ve^4$Cp{3B27J^R{xJm{-k(!t4j@0kjIHG9?bCPeqV z=jHidBgn6w-y)pf`rj_UzqS6nJc9h{c{0LzviCZ_e;Pr4yR5%*y!T$`m-bg%HvU~T z`|Y#&J>fmi@3;}Im|y=cNee zrMP|np`D*G^m^+*o<<)*d`$B&+N0C{=Jw?8-5)q-1oEu2`mcM>_5b<^+B-e3f&DXo zbAJC`eR?C%XRX!ely^OU2aX_rn{57OyzBX!ID-6bw)ty%*YkJu2=X^}wf1rU^*7h& zAr9({&;DL}Jb489)$^`|^RC=prR;p~Pu}zV&#%Zo``3Ct4>$6AXIJp6`4bziW~K6T zn9Of%tf2M&9fI_g{t@d#&#z%WpLc#mddy#A+w)T>20q`v(}njQZrx|T-p9kY@H4&9 z+Hd19`^{9uKL}dy){TD=6Nc!8)*Zf^EEd9Gi5TD+UL9}{U_yo*hxpqDD%3<;S za0Kz`eH*-yoa0;5rSchiowesvg@1#kKRPVEpN$|rz3%`k84};dqNaDRl(*i;ft`QC z-yT=~4a3qKiF|sW2hpb`zU2vx@6*HLd-|{B|9S9dVt>#gL@^5YA;|oe-7oY#i9hAg z%wKc0rgx~+pY;wc{2}GRN1=071g|8Vwc)ec&JN-r8 z6K((c*s%B}k03t1e*inXB)(hieEwdMU+<$JdR+L2+x>%&3xDg7%KV)0cR4icPtSAX zJmj$cY3c~__mqwAd5M3tEsy7i$y+yq`1F1Sod1>herV-=WmtT(M-bn38~zUx-yVmq z>_6s?AU?g{f#_9_xiB-E*L?4 zdcOqG8%AF?zBh)&7au`t@RZcmzQe191h->MPB zce(X<#tyUpD@PE1gAG4!SorlL2tVHT7l#ZBfBOi+7i{=R!@_^LB0Sf3y*~o$zuvbh z_|^O)J^v3+MAkp`{6Efj4NH&9!}VXkhxjMq{4qCyH8_v_Q_$WJpX_4#S^7`VuVl@g z$~8D|vxo60&#A)y3;hxFT?jl1^c0-8AA^k#cjwIch#KtQm<;;gP@ks>{tpxZ&FhUk zq?&;B#yZeG+9MPG6mLH0+i>2hPw;opxuD(n9Tw+l3%r!(@ML%#*h=ixZM2{;dT#-Zi%yaN6_q*pKL zJxvFWL;neT887q%??}*xE!Frx=0!mBezwsP-z=&F?ds>F6?7};B7~hR@x4vwgFYJl z4{!0S!FjbfXx`6e^1F;K0j5# z@1{!pf2LZq7c>aJKOF~pmx*5Nu zuA!x%U3q&z?*xyZ@idxNfgXqWjD6I4>nrfLft~~VJO=n0oIiRPH1E$c`8$htfYy80 zYeuc2!?CybPQ=IdQbRMmUx3f&PmTSYM9+dw2Kk>tCwTlVms>2p-unY+H@|O#zB6X- z7_S+1J?)Q-J`H2%?}OA}KkuQOaa4K!hwW!7=)sSh``c?qT|y0@d4G<{ZwH+M`YYI< z%isB^!G7FxnYQ|UoqW(2V!siJ5d7QeQqT`u`+J{vBj{JI)b{dKx&`z&tVf#W^f+i&-mVGd?d{Xxk13k_+iOPML(hSJ665O^ zB)(6P2YtKY|8xlCvHEQC4hEk#;(t6`9}WY3iPir{ykkN0{E8``Mz0a{b8ECc8s)Ws zUTfQb3Ecob@2585&!yX(@HOb~?*cv8ZSM518Fek)1A5HS*ptWdQWyOe z_3MKue>78|r+7aCen>lhH60L z^SiQdsRkuE4fKsk^=JN(nn0sJXSmqsX`qRP!Nc}?7U&1HevR5e%RrwU*l!KagY|*_ z9P$gbAphgM3~0CfE(85o+e+Cmmd|#vc zL4OeaTfNZ#L63n>!G4hj%5Nt90`wcfeuOC)ukHrT_aPa+M}Gu8802>fzKrq~Xg;sc z_A&wI^$!?dUfwko^wlVcajVUEy$1LBO#%O5rMJQt17>R?vMme@%2D z^RHCp{Ei&CQ?_)*cSTQAwKf|F(Ic;`3suciUeZvTHZXt(|PEa*wlkFnPedbfg}*#i3z zdHU(T3j7a1Z$sStu>PI^{kZjK*3z#*f706HSnnm!S6!(7=S=Ty&|+T_et#MR`?%2d zSO3Ci-RPAB&zy4pKSOgsKRjT*9aMvq&jRh{-v?cUGrmLe+e=qe@c#icpKk#h`uqgj z9`X4SLoepN=wYb(f@^Tz`{AMPuGGTHxK${{-_lF zBj^VZH$Pk-z6yGhwde2Bw?PjgJ#-UdKifgii5i!$hOVKfL9e|^+v7jUH;Oo}t@wWe z;YL&N&q4W#{m}=!3Ft^y+xGZL`XK06it1l|i%tja+Sd}$i!agnht1@Jz76?7HI)3M zL7#*0C~~~Jmo5X%_hoSVHvyyGYe8STTFdKqbTjA&7h_B%`pVN+K)=xu*bl}R-vzyG z64fHO*u%r1k2sfaM&S4_qo0C)(bk`XyeqAxXjdN*(C6jUf4Ga9L63odu|UE4BZGD;Mr9q?3s6}v*w*dO#3)KG~qH91O-G=gpzNX+j(C0zl z2m3Yp{w93`bSu)IFX?}u9sqsbLX7D}ziE0D^ryj}EBqhOuR!zt3ot*F&l&P9Be#7T z4MS_U`K_ZvK|f~e|54sapy$m-pTqWxS)E0oc|E08;;W_eKp%Xu_Qy9-8uTU5$H|iZ zPwA7OdHvBt{w84kaV_Z8w){@=t_SV<1Gj*7>&F(*Zu#5~n&;DueqVX#5zs%k_HmH+ z@1O^)Jk9hg&~xJ2KHMPRHA>j}G0}Sq{Chx~{`ClN^br_KI{xeXK=b;aN$;a{Ea-=) z!vEfn_0dhogZ>c0vwmxEzJ4y~Ypp(RrsbfISPG_;&!u!R=*Jg9pF(HpGSIx!H*USIlnHJN%tgs{rdXm`lkB&`hD=4%6Rcacd^$`rh76~UPrsTbGX>k zO~>FHkawmMf+=elBq;~ zdVeyO%f$MU+35qZ8I99d&Zw)epWdBJ%l~zC)A3&_**(2C7Mq?;0uh_uTsNbxVS1sj z*xx;U<*bwXr>8SL+3B%dAz7FCKaD@l@#hNpLb0a@qPW@|i23e5NVr22tkHHXDD3Ms1ALOzUPI_fB zR{Gr^E96p2W;3}0esj6`{TXB+lLMI;h$XUY-W&y#k}DLmK4U=kN0V&z-I+`wm5Ig^ zIX{-kCGe)Ln90vCz3oV(<4Y3xEFwv`=ye{sHdQ8XP-C33{kNU*xub7st;R5V}kQ<+TG2P088d-kj*^R7SNtFWd9N@wB; zE@eQP>u1iSLZ-mQ>%`SmZ}L$rBvUMXE`wj`UcV6SPI0!D7`k)5KR=23RX7tdwk~j9 z&x^;;EcSP1OtwX)z9{QEmGTS8eguj3XAy08G4C5jJduy(l3A$U&%-pJc3PE777~6p zTcf^WL82*?F`|MV=J8LzC6$QgKy_rJu>^5p`u))~%$G~C9pqwU9i@O7m|P+#Q_c!& zE0&AZ&6+WzfispHsLUHsOC*mAVC}KOnP}Zu)I7l&dJ}9jRv7+`MkU{$%;!y$*lEau ze@3Fv2CM9V#*2AVW^CmM;TPk{mHFfh)W^Eur=MSuMENCG*82shsjPCErcP=L`SF$g zale4#K|2{uM7xuIF@<3LnK<6`7gPD38Au^t>^47ok^}jke3BE5=KB3ue>UIK$YEot zOY=$n6_;O$OPCiU6s`P4^Co|}cICPJ{T?UL z74Z*NktEt($gDy%c*W}CzoKIPAu8q{M#cPVRg7a4cz>cl)|Z0C2)v`UaBEi*)t0^s5 zJg>z@@B8R4*m7VrMwN(@O95uaf5i}_L5$)ZLgO75El`W1x%lbPVyfUomhb6D3*DP4 zCWsr6LNvdE{Q_eEelg9uff+{QeordeixSEw<3%)!d1+KSbG-$BF=9-{&}wu_?Vle_ zub_^>d}k63RJl?X!&>tT`?G~XqjoMD&OxH!rxS^I z0xHO({^BpoD+R^fQKxN4Z8Yu0RH`G9LsyqLJ(ub49O#6cHWV77VJ$V@QOCk1EoUum zu(?9>gB+OtDBbOM527Wac?(Kqb7m&J7!h-C(3*C%EH;Y*fSZ&?(}G5G0OgYJ&YP}_ zbKY*8rqj{-_LZ7&7~TTz5_=QrM2@u%8$|KsFHPhSPk%BUcqP(BS|ub3t+`8#xpua+ zl=80tNn{D?8oyYafB_7)vR^4(9cp=E02Z*g^-O=!!g=j}N9*|ugPJ5J0$b{VJ!=QT zmMT{22hD8{nyy}m7en`xhHGG~Q`!jp<|Mg3EluRQ(P%D4w}HgU8)^lm<08B%hQ?Ac zl>1O|vIXw9!s>!v6lG74zTO5abck4JT#9=i;fQ6U}vfHeP23+Qt2&B$2k|ikAmicLI>;z@uEA5Cj&1e%{nMERS=yS zSWqID&A|>~DY+HUo#}Hs`jR~bHZ!z3v0_R_8l~W!1L*v@@nJ{QbUFyRu(gy;bj@&6 z#3779PW1H6rIrq6-#MVYasmpRW%cKy(xJa2)4l-+HO3OTbRyo?7St^|cR{CvM@=&g zm1(L;J?5Yf%VO+codNa;=b@=l8(o--!aBq@p)$1CF~sSKa`T(8NG2e#lY?)zy zb2H0TFsE(h0v=&lw(s{AxHN47EETtk;yVVW##SaGyXm5u*g#N$hU;K2ojm}*2QCB5 z9o|2itm;!V$trD)%RmX8BYT-JQPZ7q&EPhtqjMg5VQF;yzzMTPf#jsYfNbdH5r8We z42P>#PcD%_al=-`XY%0?#ELm|WCKPRX=LFIwRg5V4Mu0Q7s8kZM^wzsW-^cd%(Mk; zqY%n?F=+p}Z!EVpjNrw8p?s#8izWPIoZ1&#HJi3;rlrqZy11otNt^3sumT;+X~Q_h zq|JiC)lK$SRB=b?E&V*XU|P?f#^j|S7Pq&}!}#Nz*0u$p#APL4eL_DLPiM0E;=r=< zv5Ohj1f9RQTHM@-BV!Ctx(06fgSRcwLadMLD|;6(-k_Z~IbnYrBPI3*%S=($1A20T2F%HXSVL9R@i|shpn@pFo#qI;l#Bm);8pROT>J)Yf zUC1c7Ci)2WGO&=xe=d0M!%0IGsCfxIke^_n~vX! zDhZDlt;Pz{6iBPODghR~5`$$-7NHj?cUu?0U4&~Zh8r}!otbPVmFXQcg~e8Gr9UU1 zV7~(11#+r!`stPZND}?LQzAA9Pkxw2t_8KKkkI}*mdOr^Li}t-rtyqZDT7n-DY-EH zg#%e+JQ3%%k=u9~{{~}LR2wzxpffh5R`R=8E2bK@pS7gZ&7L1LtC%-~Llp>aG@)%8 z3LtR_i>Y0B3ptz81RFD7nNksUFXltfB|l(I%rznJnTk+TXTeG zpdJdxDdyiVgVWM9SWumfbJm(?uhJBnV;^YOq~p?BJ70YceZkduAx{UMIiD6dqdiUC zH>GXzDP}2c=c>MF!Hn(HBa*2o+sZ9T@X)g4Wnq*NOTYn93zr51z9=k`%e*AGl!DQ< zDG(W~+jxUQGEP=daDh!31G6dgG#1e3z9Lae8DCR%XR= z#+xxEj@HqP;?;PJt;S_a3>6lWbJE-+X7z!%=f*f$3OeXWt(Ol|M(GqXu?$H#tyDWA-MW#H^X&^B70l zZxOqQw#M(5K}Q9+J%WIerKn-yEz{3eIN4abj3|+-FiIg;`sJ69ZS1H8Yx}E~hn( zAyiUEvv3x~gDrJyX4%GgdTd6e1u*Qy%n$aXNy6Vk&iw7uUzKij#mZO{)oFKGC-WtB z^Oh{GOAI9A160R@D4}^xE!hq82hH6G*W@~9sVw*%td9j06sI6v2@5#E@|WUx%`5ng zT$&N(Y});o?gm=|RYMWoTZL^blwMnxFWO7Ym5ma%|Z0eWN~DUVW+H96lth8ugbcPNJAh3=T=;$NJEhS zvQ`O$yGR4X;GC2(lIci8AV%4HG-HtlBTA$p5W!vbh%^KOh%(vvkj0xw1BBs3s;$OE z8Um??uaZO>1L>p-DO)XxGzKD8tZhUZ13}AX+aisDl%hEldLbWa3s#Ro0AQZyh&OgyQ;Du~Po3aiwBL}mmMX_pbf%9}CN zp!<$s`HWvgu+|ose`zKt(qyeH=s0Xc9%-_6HmpyHG#N1>O~|t7Sc)ka8Ah6_*ACaWEn?gMxA!=m?f4MYmEym80s&OlyMfR9|FfAaJP-u*0AT)~h8#TkRcI zP>$LFl{m8kB?NP9ky(M{k}H`;jm!$9wi%6JXlMsuR2u`X@=aTq}eHpG(&2B6={Zy)I{gZgx(fxX7G9U3Der+>HAI>GF{|sz>9yijwE3)}+YGM&pq=sx09- z-fd(~pq|K_a{0@~IFUIjxE(bHqZC_ z6j{-ENxW4dE#3|c?b-z#A1m^(Atjhv+U1iLU^v2?bymF7Lbmy~qW~~f2~x_e1F@?H zc8svkvZG|o-HsuvO#lLDHNr!)U{OQO0Blu@QM|EJyKMvfKtb^JR0$Q+IN;dw zW@o-`p}5OyK~2AaCcQVHtN#22wb(0%6$Z2sltM>I`?mQtNJQ6Af?eg z*s45RDNLT+Q87@eJBxD0ieRh0xN4$Wv)>jJoteDBt3V_8rCQK(V5`*?E_n4SzA>U| z>yQAc7L0Z47A-KKgP=VSmb8Wq?Al3wbk@P$_<%sF17x3vmUvSpugoUmrAnz8N4v*c z5XFwbR-xTQ_%~Q;4uMQ&%EmOy;JOO&vFigP7*&E+E}oggYl!Vi2Mf`@yn!9Ric0Km z4?|#8Ldg&epmhP5ssht?q1`UqR|0@)#1@rrR<*!Vz1TGlyi;YA65H4G2m+K;r1My1 z+t`3mHI<@tR{Jp8Q=M5G6&FdSGr+a&3j2!MuGpDP0EVl_S)2vmYREQ{ftEBs&g?4S zfxhrd)g#mSx&(svsvm^%Vr?LtkvY<3lVmEL!zLGe07c+>M* zuhSM~yIE63z(8<}*de9n(mIt5)~j?@se#qPb+#zrt;$wvX?4v7Oe>i5(^g>h4S`S@ zhR=f!BUYV4ap1FA6cpf7c$v^Dvu_C%EpTim=P(JOQU*kbwRTdtmgt`+iCpP z!U@~w1xO$eerd7Db`{WSU)EHDT8VuY;Ho^9i);p)?7-DBvgMDih~?q&O$X+N0D+i+ z$c@%><6chpvtgRYDJtF`hc{ZAN_*$3((bQCKr6dhTE`m| z+-yHZbJJMz*kn_Kyi(C+2dlhMk$K^m?b<8=BQ!)dWm3mNJ58t4A2wPS%oaWS8KqrE zh(}Ghe9aA0aVmVUB?@nB83)@I@X87r?7PD&E2-Iv#8No^mG)~vN64e9@EphR%hoD`O?JA%Nl72mpKrI`l1B?35Al9r{}J^+T+56sD6HxFJ6 zs}yJwWNg%E9WkrvvVCrtgjEG-t&rxnk=-)mdP!FiybNSUC>4&gkR8Me2&IjR^{XoO zvI3 z;A#Q$(F~A*#Q3GnobFR_E3*1X&fEsKCc1Ws(3L7c-gVO{xGJ_P2!VtB5n!s&4wJ1O z&TgZ1o@_anHalP%UBxeXy5$=_0VyfN?0dm0)qu1HprHaSW9vgz?3@5f>pSPNV#6x9 zDt@UufQWcsMR3#imOD;-_JL(a2rXl?7M!OvIlzlLEt`}qE}6=!hu zQQo)lLVq)__V@eKDSD9C;r+n*&A1D2q2Vk({2M$P$4@}(Z)RzUI9BXf8z+5Z*Si!|%HJ6dj_=vna>#zPu>`Yn zoa^A)aGw+7a7}=HG~Kj=+Y#U{x2RIOgTUcGk%R9;Uo>Gq>Z*eKv=blS!?PJU$4qVh zHaa-Ie}Qq+s>Js#2Um-8`(e244vz18Vq9&N_?~ree6LLy?hOaW_XULEYG7bmZkq$# zEN~pI2_%#568jJbO-mF05{RFIKDrI<*0^x-of!bk&M$g zI8OcjCkMAEh);PgZXD`9OhN3P?+t82J6;WUbkLk|Q_&7wdkAi}gX`P}uEW7C+Xt@8 z!SOu@Vd-)k#$|&)a-U5Y?m7p@_Zo!ZZg+5f`@ntI!SOw1Ve$Rg!DaV><9nu54!&0* zEWVc=+`v9?T$mak-+K}k-vkFYv=7`7z^T3Py*z6|?4ZtxZyj*!LU64Pj_>gZ!zCQt z`hDQ~o&0S8ZUfSVs_X-{JXbmKodz7&BUBmt=9QYI4fnc(<9i{)aEFX3*}<**z#Zq{_+FZ@_|9-}eBVbH zZn=ZQU0tELOC8*%ec*0%aR0my+}9l3=6&F{J2<{aEKH8yI=C(S!2Q9&@x85K@r^;_ zuJv;3K5&OQIKGE3EWSDicke!M3mn|H_JLdK;P}2w_OIA(_0iwm4sJH$<9eh##_I2a zgBusr59PTyz9&%i!uM>lpI8ldr-QpGkfR#zyAJL<`@sF&!QHuBf;I6YL4)$m>Y)BuC@01d5Jlb*GvEwO~`}oc}eKda$Ik;`O*KXTs)p5UYaQuDXvGY8+~n|ucDHO7GMUZ-NJ91RX`=OWBqEQ0>3;6CBt z25`^xz{fq>R0Y@R;3i{IWOAD)ceGXJkMDC=Irux_4=ncN?z>9d^$xBc_j%Qy<;k61 zmAE?{9M4y*Y4_x=#Y)_R4sILnbKG_|%A<-Ld>_2#kH3q(XNf0w8CJ&kqJxv~RpG+1 ziB;lz+rjZYZxhe)_)<{H1X#=M1Q&-%rNc20e^VoKaPuA9 z#AQf#nJ0J5Dpcb;-@)N}NnDm!9anI0dw|;$g1gSa?K&TA^!c9L-CddPRtLB30+h!E z)p3tGIQ~x7=H;H;O{wu|6@A{p@%OOST!?lCL>++7ZizoR_Rjeem@eD^uH@i9zx#XQz!)=ucDzddj(2c-f!hn*4OMWR4({?E^yfX*aVs6%*j}{by`J0^ ztWj!te9pnG2W~xZYZQdPYNvNOxQTtRt3Hp09Gu3-_vEX*8-Uvof_vG)O-v%bq$l4_ z(I_=OjEQV~>w#Mzf~$3K2VIQ22`{c5-^U!>I^foY;1UjQ^a|MTit6#Lad7-Sv!M_i z->0v7;qQ*US%FhMf7!wD_tpn6DOyma;IHcCZU?sqxIMsStKfDzxaIx0^Rd4=?*BWu z9l-4X4#j65P51q{P*de-N~7P$L}@kLR0nq}aJPowS{xjIFK%?EdVJ?NxD;?H;NmuS zCB0ni;C2GH6S%G_xN99;Jrq};t&ZE|;MN1TJ_PrD2e%ivy}+T_w~y-Y=MJt7i!E)J zRLAXcaGQbK3>>;c`)GV)4=I%gu9YRqRmUCg;Fj^dw;{OG9o$ynwuaz(9o$&lYdSVx zp03*Sl@5--f7w-mQ#t<8!F>m~?*PZwtLmfiJ?h}bqhgFNz`s%u{%U+LI=DD+ap2mk z;Kq$F>F-|P?hV0x*ujm);?(G3_4pbbTqkgyA-F{jZWC~ufNQIgzdi@I7r4D4xSJf@ zsVi|0>q_|dRpPs&gd4vGxHTcT`%5_50o;xd+%pbt;wrS`tE#8_M+dhYxaA?Z4@@YP z2Y*j-QwVOlgX8ZY?y113y)1NaO#^7J2CC<;!@*q++~vS6sG>jL!EFO>TL|t`4sP@y z>}9Zed|z;I{5{4+z|D8kRXM)p;BEl!2H@s8IJNsH9NZ4zc7)(wc5nw>ivIG_>hZnd z;M#y|3&D-4DV5s|z}*mnJH)~50B#3x7`EC+<%l@AvA9=w>}Az)r#QF;z%2;DEpu=~ zzzv1qvJUP6;2sFUUFzWYJD9JB;BIno{5|TX%d5-rWe1l9E(_erRx2exY@37I0^Anh znjM_#?-ve^zni%`1oxtYn~eL_Cx6nDZ<=Y88sA$Et{u4c5Zpw}F{yvB2DmjLxJC!Z z-&y_+a5FSf{N*_K!5q7dZx3*LfNL}?`B&@5Vh2}?d+}?p@a!G~2C5t@99%na?IE~T z4sHmzp%C1S4sI)OTSIWSIk?{d_nQzL=2oq|)$KP?$^4$sCPT=aQlm~ymLUA+%z!2sw9Gs?mii0~5xD!Kg7dg0P zz%2{GUF_i20Jo+Br+QiK;I;y{wF0O4`>ca|3b?02aGM?6*wtvSR#%tz+YYV?xF+CE zpwgrH+u`84fa?NoS_x+D`FRJo4!Ct8xOW`fR^YaV;EtM9Dz{z0?Fzv)IXHao5ufm` zp1-9IZW?gYLU3sZ*A85J2<|fuj=vW?5Q4kI!SQ!?H-_Nub#U8(+a7{@)WPw0arcJc zo^)`BUxj(Dt1vHGrQH7D;7$eZ)DYa^hnC8t3%ITj+{q4Z4RC8JaHE1ebT~Nvp6=!f zoZ5ZD!SQ!;cZA>u92|fDc5evodI!hfwVk-8x?aBE;F^JJ2JRR~e=5gg4vxRuy)*>J z-wp8)o|jMxz!iX-?8G-Z`2D7XTMyj&5Zu(mO7U$0Zc7MmfrHx)-1ZRM3J13vxZNSR zs~sFZZ;y|~c=9bV6-D*3$-zwqZZdF(D+qr_2frV2a81B9h2Vbe;M#y|3&FkM;Nrl= zLvZ^eGg=<}J>ttNa4N^K4vxP&ya6~Ak$n_b@8Grow*@#fb@owtKjGlE0k8*m5N*h=;7UmV;H z;C6)Io^o)zfZJ7p)BOF}!R-cacLh%Ma@dija@z~s-U^(?H^afb3EZ0%IF0XY2RHT_ z_&L{<%d7Df9Na|UCWhdyad5T3)mGp%-J2ZTiNKu*9H!vy!)*#bUvhBGz%>Im*0AJX z&EJC#ZZ2?hLvX)xaEpLjRDsj{z3SlFfore8X}Sj=RVt5Vz%8r5X?zg}*9BZx2yT{x z>jSPY1b2pm%L11T!JX&e27ns~!Cma&hJYIi!CmU$)&aLJ1b4lITMyj&5Zvb-+|9t< z44mqW3t0914F`8CaJN?AG|c@DZX<9TLvXts+$P{Qh2UOvaGQbK9D;kp!CiSF+~*5D zn|D`^iEvi5zkGiI-?PH}q{`^x>Kxp4gGAS1-lrOFzJvSf<@g37<^`(Z&UbLfV7z(^ z#;etEmpQn%F&=yyR=elT5EhP!t8SULlF(MNIr1Mm}X*Z=?k diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.hex b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.hex deleted file mode 100644 index 0c5189c63..000000000 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.hex +++ /dev/null @@ -1,2507 +0,0 @@ -:020000040000fa -:10000000f07f0020857600001f7e0000ff7f00004b -:1000100000000000000000000000000000000000e0 -:10002000000000000000000000000000ab7c0000a9 -:100030000000000000000000ab7c000035860000de -:10004000ab7c0000ab7c0000ab7c0000ab7c000014 -:10005000097b0000ab7c0000ab7c0000ab7c0000a7 -:10006000ab7c000011630000ab7c0000ab7c0000a7 -:10007000ab7c0000ab7c0000ab7c0000ab7c0000e4 -:10008000ab7c0000ab7c0000cd7a0000ab7c0000b4 -:10009000ab7c0000ab7c0000ab7c0000ab7c0000c4 -:1000a000ab7c0000ab7c0000ab7c0000ab7c0000b4 -:020000040000fa -:1000b000f8b5c046f8bc08bc9e467047657600009f -:1000c000f8b5c046f8bc08bc9e4670473d760000b7 -:020000040000fa -:0800d000a84900000100000036 -:020000040000fa -:1000d800f0b5de4657464e464546e0b585b0039036 -:1000e8000e0001921c000eab1b789a460fab1b78d2 -:1000f8009b46c34b1a881b889bb2092b09d8002939 -:1001080007d0c04b1b68c04a934202d2bf4a9342f1 -:1001180003d2bf49bf4806f037fbbf4b1968002917 -:1001280006d00722b94808f06ffabb4b00221a60c4 -:10013800002008f0cdfab94b1b78012b00d14ee115 -:10014800012008f0c5faae4b1b889bb2082b00d9da -:10015800e0e2002008f0bcfaaa4b1d682800b04b6a -:100168001f687f1bbbb29946ae4b1b685b1b029393 -:100178004a46a14500d2221c92b2a9188c46aa4927 -:100188008c4500d962e1029b1b041b0c6246d21805 -:100198008a4200d98ee1a54b1b68984200d8c2e17b -:1001a800a34b1b68984202d89a4200d3bee1954bf4 -:1001b800614619609b4b1a603a04120c914b1b68fc -:1001c8009b18974a1360904aa846934200d3b2e11d -:1001d8008c4b1b684a46062a00d8b1e10722290041 -:1001e8009946180008f010fa012008f071fa4846fc -:1001f80007303a04120c073ae91d08f005fa032201 -:100208003100404608f000fa5346012b00d0a1e126 -:100218005b46002b00d11ee24346d81ca21ff11cee -:1002280008f0f2f94444e31e019a1a70a31e170a53 -:100238001f70013c5b4623705346002b2bd07d4b2f -:100248001b889bb2002b0bd07b4b1b686f4a9342d9 -:1002580002d36d4a934203d378496e4806f094fa64 -:10026800002008f035fa734b1b889b00724a9b5894 -:10027800002b03d07249674806f086fa6d4a138846 -:100288009b006d4940465850138801339bb2138038 -:10029800012008f01dfa664b012252421a60664b93 -:1002a8001c68002c2fd02500584b9c4202d3564b7b -:1002b8009c4204d33c21ff31564806f065fa514b65 -:1002c8001b68ab4200d3d4e1002008f001fa4d4b83 -:1002d8001e68a61b012008f0fbf9554b1a68494b0c -:1002e8001b689a4200d8d1e1002008f0f1f9504b80 -:1002f8001d68444b1b68ed1a012008f0e9f9ae426d -:1003080001d24b4b1c604f4b1c68002c2fd0250092 -:100318003e4b9c4202d33c4b9c4204d33c21ff31d0 -:100328003c4806f031fa374b1b68ab4200d3bbe1bf -:10033800002008f0cdf9334b1e68a61b012008f0f9 -:10034800c7f93b4b1a682f4b1b689a4200d8b8e193 -:10035800002008f0bdf9364b1d682a4b1b68ed1ac2 -:10036800012008f0b5f9ae4201d2314b1c60364b82 -:100378001c68002c00d1d5e12500244b9c4202d3f7 -:10038800214b9c4204d33c21ff31224806f0fcf962 -:100398001c4b1b68ab4200d3a1e1002008f098f980 -:1003a800184b1e68a61b012008f092f9204b1a680a -:1003b800144b1b689a4200d89ee1002008f088f987 -:1003c8001b4b1d680f4b1b68ed1a012008f080f9c4 -:1003d8000020ae4200d39ee1154b1c609be10f4b01 -:1003e80000221a700f4b1968064b186800f0b6f90e -:1003f800002800d1a4e6f721064806f0c5f99fe6d3 -:10040800aa13002064130020090d0020740b00209b -:1004180065050000b07e000060130020a90f0020d1 -:100428006c13002068130020080d002078130020aa -:1004380074130020a8130020201200209706000043 -:1004480099060000a8110020ac0f0020b84b1b68cb -:100458009846984201d88b4222d9b64b1b689c46d5 -:10046800984201d899421bd2029b1b04180cb24b2c -:1004780019188918434501d8414516d2634501d852 -:10048800614512d2d218ad4b1a603b041b0c9b1865 -:10049800ab490b601218ab4b1a60a74b984697e60e -:1004a800012008f015f9ff2035e1012008f010f9c6 -:1004b800ff2030e19e4a1268904690421ad99d4a20 -:1004c8001268904206d8944523d2404500d82be1c3 -:1004d800914219d29849cb18414501d843451dd2bc -:1004e800914201d8934219d2944a93491160954a8e -:1004f800136061e694450cd28e4a12689042e2d9a4 -:100508004045e7d84145e5d3012008f0e1f8ff2050 -:1005180001e1012008f0dcf8ff20fce0012008f0f0 -:10052800d7f8ff20f7e09a4200d239e6012008f018 -:10053800cff8ff20efe08449844806f025f947e624 -:100548003a04120c2900180008f05ef8012008f09f -:10055800bff854e6002008f0bbf87d4a11887d4baf -:10056800090159188c80118809014046c850118822 -:100578000901591803988860108851464d1ea941f1 -:10058800c9b200011b18197313889bb2002b0cd039 -:100598006f4a138801339bb2138013889bb2092bcf -:1005a80053d8012008f094f832e66a4b1d68002df4 -:1005b800eed02f00604b9d4202d3674b9d4204d37f -:1005c8003c21ff31614806f0dff85c4b1b68bb42f9 -:1005d8001fd2002008f07cf8584b1b68eb1a99468c -:1005e800012008f075f8534b1a68544b1b689a425f -:1005f8001dd9002008f06cf84e4b1a684f4b1f6845 -:10060800d71b012008f064f8b945c1d2494b1d60d9 -:10061800bee7002008f05cf8484b1a682b009633b8 -:10062800ff339b1a9946012008f052f8dbe70020b7 -:1006380008f04ef83f4b1b689633ff333f4a176864 -:10064800df1b012008f044f8dee7ce21c9003f484f -:1006580006f09af8a5e74346d81c621ff11c07f07c -:10066800d3ff4444a31e019a1a70013c170a27704d -:10067800e2e5002008f02cf8304b1b68260096367f -:10068800ff36f61a012008f023f826e6002008f0c5 -:100698001ff8284b1d689635ff35284b1b68ed1a47 -:1006a800012008f015f82ae6002008f011f8234b7d -:1006b8001b6826009636ff36f61a012008f008f85f -:1006c8003fe6002008f004f81a4b1d689635ff3500 -:1006d8001a4b1b68ed1a012007f0faff43e60020c9 -:1006e80007f0f6ff154b1b6826009636ff36f61afc -:1006f800012007f0edff59e6002007f0e9ff0d4b58 -:100708001d689635ff350d4b1b68ed1a012007f063 -:10071800dfff5de6ff2005b03cbc90469946a24647 -:10072800ab46f0bd0020f6e7414500d2d0e6ebe647 -:100738007813002074130020740b00206413002029 -:100748006c130020681300203d060000b07e0000f6 -:0c075800aa130020ac0f0020090d0020a7 -:020000040000fa -:10076400f8b5de4657464e464546e0b50e00d74b33 -:10077400994200d90be3d64b1b68050083420dd385 -:100784008b420bd8d24b00221a60d24b1a681379d1 -:10079400ff2b03d0013313716423d370ce4b1b683a -:1007a40000209d4200d9f3e2b34200d9f0e2c94be4 -:1007b4001b686422da70c94b9a469b4667e00020a6 -:1007c40007f088ffc64b1a6823009633ff339b1a41 -:1007d4009846012007f07effd1e0002007f07aff61 -:1007e400bd4b1f689637ff37bd4b1b68ff1a0120ae -:1007f40007f070ffd5e0002007f06cffb84b1a68d3 -:1008040023009633ff339b1a9846012007f062ffba -:10081400eae0002007f05effaf4b1f689637ff3712 -:10082400af4b1b68ff1a012007f054ffeee03c2198 -:10083400ff31ac4805f0aaffa94b1b68bb4200d3ab -:10084400f7e0002007f046ffa54b1b68e31a984623 -:10085400012007f03fffa04b1a68a14b1b689a4286 -:1008640000d8f4e0002007f035ff9b4b1f689c4b39 -:100874001b68ff1a012007f02dffb84501d2964be3 -:100884001c60944b1a681379ff2b00d0ede053469b -:100894001b68ab4200d256e25b461b68b34200d9e8 -:1008a40051e2914b1b889bb2002b00d14be28e4b43 -:1008b4001b889bb2002b04d08b4b1b889bb20a2b4a -:1008c40004d9e7218900874805f060ff864b1b881f -:1008d4009bb2002b17d00024804b9846824b99463c -:1008e400002007f0f7fe671ce400fb004444434487 -:1008f40006cb06c4012007f0edfebcb24b461b88b4 -:100904009bb29c42ecd3002007f0e4fe764b1b889c -:100914009bb2002b0dd0744a1388013b9bb2138009 -:1009240011886e4bc9000020c8501288d2009b1851 -:100934005860012007f0cefe674b012252421a6034 -:100944006a4b1c68002c30d02700694b9c4202d3b0 -:10095400684b9c4204d33c21ff31624805f016ffea -:100964005f4b1b68bb4200d329e7002007f0b2feaf -:100974005b4b1b68e31a9846012007f0abfe564b0d -:100984001a68574b1b689a4200d826e7002007f0e4 -:10099400a1fe514b1f68524b1b68ff1a012007f040 -:1009a40099feb84501d24c4b1c604c4b1c68002c82 -:1009b40030d027004e4b9c4202d34e4b9c4204d372 -:1009c4003c21ff31474805f0e1fe454b1b68bb4223 -:1009d40000d310e7002007f07dfe414b1b68e31aab -:1009e4009846012007f076fe3b4b1a683c4b1b6887 -:1009f4009a4200d80de7002007f06cfe364b1f68c2 -:100a0400374b1b68ff1a012007f064feb84501d27a -:100a1400314b1c60384b1c68002c00d131e7270097 -:100a2400334b9c4200d202e7324b9c4200d203e794 -:100a3400fde6002007f04efe294b1a68230096338a -:100a4400ff339b1a9846012007f044fe03e7002079 -:100a540007f040fe204b1f689637ff37204b1b687a -:100a6400ff1a012007f036fe07e7013313716423f0 -:100a7400d3700ce7002007f02dfe194b1a682300f1 -:100a84009633ff339b1a9b46012007f023fedce0dc -:100a9400002007f01ffe104b1b689633ff33104aeb -:100aa40012689b1a9a46012007f014fee0e0002029 -:100ab40007f010fe0a4b1a6823009633ff339b1a83 -:100ac4009b46012007f006fef5e0c046080d002015 -:100ad400781300207013002074130020a811002044 -:100ae40064130020b07e0000a61300202012002012 -:100af400740b0020090d0020ac0f0020002007f02b -:100b0400e9fda84b1b689633ff33a74a12689b1a6a -:100b14009a46012007f0defde0e03c21ff31a348c6 -:100b240005f034fea04b1b68534500d3e9e00020d8 -:100b340007f0d0fd9c4b1b68e31a9b46012007f08d -:100b4400c9fd984b1a68984b1b689a4200d8e6e096 -:100b5400002007f0bffd934b1b68934a12689b1a51 -:100b64009a46012007f0b6fdd34501d28d4b1c6097 -:100b74008f4b1a681379ff2b00d0dfe03b689d424e -:100b840000d9e5e0b34200d9e2e043461b889bb2ba -:100b9400002b00d1dce04b461b889bb20a2b04d807 -:100ba400844b1b889bb2002b04d1d32189007f483e -:100bb40005f0ecfd7f4b1b889bb2002b16d0002464 -:100bc4007d4b9a467b4b9b46012007f083fd00201a -:100bd40007f080fd631c9a0051465258a4006250ed -:100be4009cb25b461b889bb29c42edd3714a13882e -:100bf400013b9bb2138013886f4c9b0000221a5157 -:100c0400012007f067fd674b012252421a602468f5 -:100c1400002c31d0a246694b9c4202d3684b9c42c3 -:100c240004d33c21ff31614805f0b0fd5e4b1b68e5 -:100c3400534500d31ee7002007f04cfd5a4b1b68b8 -:100c4400e31a9b46012007f045fd564b1a68564ba4 -:100c54001b689a4200d81be7002007f03bfd514b6c -:100c64001b68514a12689b1a9a46012007f032fd0c -:100c7400d34501d24b4b1c60524b1c68002c31d025 -:100c8400a2464e4b9c4202d34d4b9c4204d33c2182 -:100c9400ff31464805f07afd434b1b68534500d3aa -:100ca40005e7002007f016fd3f4b1b68e31a9b463f -:100cb400012007f00ffd3b4b1a683b4b1b689a421f -:100cc40000d81be7002007f005fd364b1b68364aa9 -:100cd40012689b1a9a46012007f0fcfcd34501d206 -:100ce400304b1c60384b1c68002c00d140e7a246f6 -:100cf400324b9c4200d210e7314b9c4200d211e7a8 -:100d04000be7002007f0e6fc274b1a682300963314 -:100d1400ff339b1a9b46012007f0dcfc11e70020ff -:100d240007f0d8fc1f4b1b689633ff331e4a12682a -:100d34009b1a9a46012007f0cdfc15e70133137185 -:100d44006423d3701ae71c4f1a4b9846994615e74b -:100d54001d4c27001d4b9846154b99462368ab4202 -:100d64001cd33b68b3421bd843461b889bb2002b61 -:100d74000bd002f037fe4b461a681379ff2bedd0e7 -:100d8400013313716423d370e8e7002000e0ff20ef -:100d94003cbc90469946a246ab46f8bd0020f7e716 -:100da4000020f5e77413002064130020b07e0000d7 -:100db40070130020a813002020120020740b0020c0 -:100dc400090d0020a8110020ac0f0020aa13002058 -:020000040000fa -:100dd400f0b5de4657464e464546e0b5c9b000afcd -:100de40004000e0007f0aefc050007f06dfc8a233a -:100df40008229446bc44634400221a80b3780e321d -:100e04001a4215d133781b09727812011a432378d8 -:100e1400617809021943a3781b041943e3781b067c -:100e24000b4319785b781b020b439a4200d091e282 -:100e34003379043bdab2152a00d994e29300e44ae8 -:100e4400d3589f46b3781b09f0780001184305f086 -:100e5400dbfdff207fe27279b3791b02134342d09a -:100e64000020022b00d076e207f078f98a230822ca -:100e7400ba18d518f11d0222280007f0c7fb2b88e9 -:100e84009946012b00d187e0d24b1b880022002b0e -:100e940025d0d14dcf4b9a4613019b1a9b009b182a -:100ea400595d8846eb18597809028c4641466046dc -:100eb40001438846997809048c46414660460143bb -:100ec400db781b060b434946891889b21970090a55 -:100ed4005970013292b253461b889342dcd81900f0 -:100ee400484605f039ff90230822ba18d218823bed -:100ef400137193780f218b4301210b439370b178c5 -:100f04000909f3781b010b431b0110880f210140d1 -:100f14000b4313806b467b60ae4d2a880132162347 -:100f240053430733db08db006a46d31a9d46e84681 -:100f340007f010fc0100684607f07cfa2b88002bb0 -:100f440072d000250120a44b9b4616239a46a14b40 -:100f54009946461cb6b22901491b890049195944ce -:100f640053465843404406f025fa0135adb23000eb -:100f74004b461b88ab42ecd8162373439bb24246c4 -:100f8400902108208446bc446144200004f0c0ff42 -:100f94007b689d460020dee18a2308229446bc44f7 -:100fa4006344063a1a808b4b1b88002b37d00022ef -:100fb400002399468848874b9a4605e0013292b24d -:100fc40053461b8893422ad913019b1a9b009b18f2 -:100fd400195c8846c318597809028c46414665460f -:100fe40029438846997809048c4641466546294335 -:100ff400db781b060b4319788846597809028c461e -:101004004146654629430129d8d04946023189b26f -:101014001970090a597001239c46e144cee719006e -:10102400012005f099fe5ee70126a5e71623584343 -:10103400a84680447379b5792d021d43454407f0d1 -:1010440081fbdc239b009c46604485420fd84246ca -:101054003100200003f03afc03000020002b00dce8 -:1010640079e106f0c3fa06f0d9fe002073e19a2173 -:1010740049005a4805f08afbe9e77279b3791b0203 -:101084001343ff20002b00d065e113333b73bb7a7d -:101094000f229343bb72210030310c3a0f23f8180e -:1010a40007f0b4fa03237b730023bb73b2781209ed -:1010b400f3781b0113431b0139890f220a401343a0 -:1010c4003b810823f918200006f022fb002042e1ae -:1010d4007279b3791b021343ff20002b00d03ae14d -:1010e40014333b73bb7a0f229343bb720c3a3c49d3 -:1010f4000f23f81807f08afa03237b730023bb73ca -:10110400b2781209f3781b0113431b0139890f22aa -:101114000a4013433b810823f918200006f0f8fa2b -:10112400002018e17279b3791b021343ff20002bce -:1011340000d010e111333b73bb7a0f229343bb728f -:101144000c237b730023bb73b2781209f3781b0161 -:1011540013431b0139890f220a4013433b81214b5e -:101164001968214b1a68214b1b68f973080a3874f3 -:10117400080c7874090eb974fa74110a3975110cd3 -:101184007975120eba75fb751a0a3a761a02120e9e -:101194007a761b0ebb760823f918200006f0b8fafd -:1011a4000020d8e07279b3791b0213430020002b8e -:1011b40000d0d0e007f04cfa03000020012b00d946 -:1011c400c9e00b4b186803f0b3f80020c3e0c04635 -:1011d400a87100009c130020780e0020507e0000af -:1011e40094130020acf7ff1fb0f7ff1fb4f7ff1fe5 -:1011f400501300207279b3791b021343ff20002b94 -:1012040000d0a8e015333b73bb7a0f229343bb7223 -:1012140007237b730023bb73b2781209f3781b0195 -:1012240013431b0139890f220a4013433b814f4961 -:101234004f4b1a680a609b888b803723e35c8b7161 -:1012440007220f23f81807f0e1f90823f918200002 -:1012540006f05efa00207ee02500183510220021f9 -:10126400280007f005fa7279b3791b021343102b97 -:1012740003d9102272710022b271b31d31001631ec -:1012840002e00133994211d05a780a2af9d11a7826 -:101294000d2af6d10021200005f096fd2100083129 -:1012a4001022280007f0b2f9002054e07379b279d3 -:1012b40012021a43f37920218b43413b192be9d8bd -:1012c400002ae7d0f11d280007f0a0f9290020002a -:1012d40005f07afd00203ee07379b27912021a43d8 -:1012e400f11d8c250823fb18581907f08ff9b278e3 -:1012f4001209f3781b0113432e22a3541b0a013253 -:10130400a3541c490823fb185b19186802f0fafe61 -:1013140006f02cfe80b22c23e054000a0133e05482 -:1013240007f0def92823e054020a0133e2540302f1 -:101334001b0e2a22a354000e2b23e05400200ae0a3 -:10134400f07907f08df9002005e0300002f092fcfe -:10135400002000e0ff20bd4649b03cbc90469946c1 -:10136400a246ab46f0bdff20f5e7c046301300208f -:081374003813002000007a4448 -:020000040000fa -:10137c00a81200201c000000000000004c100020ef -:10138c007f000000000000003e130020020000005f -:10139c0000000000cb100020010000000000000045 -:1013ac00040000200008000000000000461300208c -:1013bc0002000000000000003713002001000000b4 -:1013cc0000000000c4120020040000000000000017 -:1013dc000a0d00200200000000000000481300204d -:1013ec0004000000000000004c130020040000006a -:1013fc000100000000a20000aa0f00200200000063 -:10140c000100000000080000e012002014000000a1 -:10141c000000000050130020040000000000000039 -:10142c0030130020070000000000000054130020bf -:10143c0004000000000000009813002002000000cf -:10144c00000000003813002006000000000000001f -:10145c00090d002001000000000000009a1300207c -:10146c000200000000000000f8110020280000001d -:10147c00000000009c13002002000000000000008f -:10148c00780e00203101000000000000f412002052 -:10149c001400000000000000941300200300000062 -:1014ac0001000000020000009e130020020000005a -:1014bc0000000000a013002002000000000000004b -:1014cc00040800207003000000000000c812002077 -:1014dc001800000000000000581300200400000059 -:1014ec000000000040130020060000000000000077 -:1014fc00a2130020020000000000000008130020ce -:10150c001000000000000000a413002002000000e6 -:10151c00000000005c13002004000000000000002c -:10152c0018130020100000000000000060130020c1 -:10153c000400000000000000641300200400000000 -:10154c0000000000681300200400000000000000f0 -:10155c006c1300200400000000000000a811002003 -:10156c005000000000000000a61300200200000044 -:10157c0000000000a90f0020010000000000000086 -:10158c00701300200400000000000000740b002009 -:10159c00950100000000000020120020280000002f -:1015ac0000000000a8130020020000000000000052 -:1015bc0074130020040000000000000097130020aa -:1015cc000100000000000000ac0f0020a000000093 -:1015dc0000000000aa130020020000000000000020 -:1015ec00781300200400000000000000b813002055 -:1015fc000100000000000000ac13002002000000fd -:10160c0000000000ae1300200200000000000000eb -:10161c00b01300200200000000000000b2130020f4 -:10162c000200000000000000b413002002000000c3 -:10163c00000000002813002008000000000000003b -:10164c007c1300200400000000000000cc100020df -:10165c007c00000000000000b61300200200000017 -:10166c0000000000b9130020010000000000000081 -:10167c00801300200400000000000000481200202d -:10168c002000000000000000681200202000000074 -:10169c000000000088120020200000000000000064 -:1016ac0084130020040000000100000048110020f9 -:1016bc004811002060000000010000000000000044 -:1016cc006812002088120020481200200000000040 -:1016dc0000000000000000000000000000000000fe -:1016ec0000000000000000000000000000000000ee -:1016fc0000000000000000000000000000000000de -:10170c0000000000000000000000000000000000cd -:10171c000000000000000000000000000c0d002084 -:10172c006c010000010000004300000000000000fc -:10173c00000000000000000000000000000000009d -:10174c00000000000000000043000000000000004a -:10175c00000000000000000000000000000000007d -:10176c00000000000000000043000000000000002a -:10177c00000000000000000000000000000000005d -:10178c00000000000000000043000000000000000a -:10179c00000000000000000000000000000000003d -:1017ac0000000000000000004300000000000000ea -:1017bc00000000000000000000000000000000001d -:1017cc0000000000000000004300000000000000ca -:1017dc0000000000000000000000000000000000fd -:1017ec0000000000000000004300000000000000aa -:1017fc0000000000000000000000000000000000dd -:10180c0000000000000000007d85000085830000c2 -:10181c0000000000145500003587000034870000dc -:10182c0034870000348700003487000034870000c0 -:10183c0034870000348700003487000034870000b0 -:10184c00ffffffffffffffffffffffffffff00009a -:10185c000100415343494900000000000000000012 -:10186c00000000000000000000000000000000006c -:10187c0000004153434949000000000000000000f3 -:10188c00000000000000000000000000000000004c -:10189c00000000008813002004000000000000007d -:1018ac008c13002004000000000000000000002049 -:1018bc000400000000000000901300200400000051 -:1018cc000000000000000000000000002222222284 -:020000040000fa -:1018dc0070b5bd4b1b78012b3ad0bc4b1b889bb20f -:1018ec000a2b46d0b94b1b889b00b94a9b58002b3e -:1018fc0003d0b849b84804f045ffb44b1b889bb2e1 -:10190c00002b0bd0b24b1b68b44a934202d3b44a9f -:10191c00934203d3b349b04804f034ffab4a138865 -:10192c009b00b1490868aa49585013889bb2002bf8 -:10193c0000d167e1a54a138801339bb21380ab4bee -:10194c001b689a1ed10700d5abe1a84b1a60abe11e -:10195c00a64b1968a44b1868fef7fefe002803d1ad -:10196c00994b00221a70b8e7a1499b4804f00aff72 -:10197c00f6e7964b1b889bb20a2b04d8934b1b881b -:10198c009bb2002b04d1d3218900934804f0fafeba -:10199c008e4b1b889bb2002b12d000248c4d8b4e8f -:1019ac00012006f093fe002006f090fe631c9a00c6 -:1019bc005259a40062519cb233889bb29c42efd323 -:1019cc00824a1388013b9bb213801388804c9b0086 -:1019dc0000221a51012006f079fe864b0122524258 -:1019ec001a602468002c2fd025007c4b9c4202d31b -:1019fc007b4b9c4204d33c21ff31774804f0c2fe60 -:101a0c00794b1b68ab4200d38de0002006f05efee4 -:101a1c00754b1e68a61b012006f058fe754b1a6804 -:101a2c00714b1b689a4200d88ae0002006f04efeeb -:101a3c00704b1d686c4b1b68ed1a012006f046febe -:101a4c00ae4201d26b4b1c606b4b1c68002c2dd032 -:101a5c002500624b9c4202d3614b9c4204d33c2137 -:101a6c00ff315d4804f08efe5f4b1b68ab4275d2b4 -:101a7c00002006f02bfe5c4b1e68a61b012006f016 -:101a8c0025fe5c4b1a68584b1b689a4273d9002090 -:101a9c0006f01cfe574b1d68534b1b68ed1a0120ba -:101aac0006f014feae4201d2524b1c60534b1c6824 -:101abc00002c2dd02500494b9c4202d3484b9c4214 -:101acc0004d33c21ff31444804f05cfe464b1b68b8 -:101adc00ab425ed2002006f0f9fd434b1e68a61bfc -:101aec00012006f0f3fd434b1a683f4b1b689a42ea -:101afc005cd9002006f0eafd3e4b1d683a4b1b6892 -:101b0c00ed1a012006f0e2fdae4201d2394b1c6009 -:101b1c003b4b1a681379ff2b00d1e3e601331371a9 -:101b2c0064231370dee6002006f0d0fd2e4b1b68fc -:101b3c0026009636ff36f61a012006f0c7fd6de733 -:101b4c00002006f0c3fd2b4b1d689635ff35264b48 -:101b5c001b68ed1a012006f0b9fd71e7002006f0b4 -:101b6c00b5fd214b1b6826009636ff36f61a012070 -:101b7c0006f0acfd85e7002006f0a8fd1d4b1d68a6 -:101b8c009635ff35184b1b68ed1a012006f09efdab -:101b9c0088e7002006f09afd134b1b68260096364a -:101bac00ff36f61a012006f091fd9ce7002006f0a6 -:101bbc008dfd104b1d689635ff350b4b1b68ed1ad0 -:101bcc00012006f083fd9fe7a90f0020a813002039 -:101bdc002012002052020000b07e0000740b002086 -:101bec00090d002053020000641300206c13002028 -:101bfc003702000074130020a8110020ac0f002045 -:101c0c00701300200c68002c00d193e62500314b9a -:101c1c009c4202d3304b9c4204d33c21ff312f48d1 -:101c2c0004f0b0fd2e4b1b68ab421fd2002006f017 -:101c3c004dfd2b4b1e68a61b012006f047fd294bc2 -:101c4c001a68274b1b689a421dd9002006f03efdee -:101c5c00244b1d68224b1b68ed1a012006f036fd43 -:101c6c00ae4200d366e61f4b1c6063e6002006f014 -:101c7c002dfd1b4b1b6826009636ff36f61a0120ed -:101c8c0006f024fddbe7002006f020fd154b1d6857 -:101c9c009635ff35124b1b68ed1a012006f016fd28 -:101cac00dee7013b104a13600f4b1b6809330f4ae8 -:101cbc0093420ad80c4b1b68094a136009330c4a2f -:101ccc0013600c4b01221a7070bd074b014a1a604d -:101cdc00f0e7c046740b0020090d0020b07e000018 -:101cec0064130020741300206c130020080d0020d6 -:081cfc0068130020a90f00206d -:020000040000fa -:101d0400f8b5ce46474680b507008846bb4b1b88ce -:101d14009bb20a2b30d0002006f0dcfcb74b1b88aa -:101d24009bb2092b00d963e1b44a1188b44bc900b2 -:101d34004046c8501188c9005b185f6013889bb285 -:101d4400002b00d170e1ad4c238801339bb223807a -:101d5400012006f0bffc2088642358430a2103f0c5 -:101d6400c3fac0b2a74b1b685a78824200d258709b -:101d74000cbc90469946f8bda04b1b889bb2002b27 -:101d840004d09e4b1b889bb20a2b04d9e7218900ff -:101d94009d4804f0fbfc994b1b889bb2002b16d08a -:101da4000024974e954b9946002006f093fc651c41 -:101db400e300ea00f318b21803ca03c3012006f0d3 -:101dc40089fcacb24b461b889bb29c42ecd30020ee -:101dd40006f080fc894b1b889bb2002b0dd0874af0 -:101de4001388013b9bb213801188854bc9000020e6 -:101df400c8501288d2009b185860012006f06afc73 -:101e0400824b012252421a60814b1c68002c2fd055 -:101e14002500804b9c4202d37f4b9c4204d33c213f -:101e2400ff31794804f0b2fc7c4b1b68ab4200d311 -:101e34008de0002006f04efc784b1e68a61b0120a6 -:101e440006f048fc714b1a68744b1b689a4200d820 -:101e54008ae0002006f03efc6c4b1d686f4b1b684b -:101e6400ed1a012006f036fcae4201d2674b1c602d -:101e7400634b1c68002c2dd02500664b9c4202d37a -:101e8400654b9c4204d33c21ff315f4804f07efc47 -:101e9400624b1b68ab4275d2002006f01bfc5f4b03 -:101ea4001e68a61b012006f015fc584b1a685b4bf4 -:101eb4001b689a4273d9002006f00cfc534b1d6832 -:101ec400564b1b68ed1a012006f004fcae4201d209 -:101ed4004e4b1c60524b1c68002c2dd025004d4be2 -:101ee4009c4202d34c4b9c4204d33c21ff314648d4 -:101ef40004f04cfc494b1b68ab425ed2002006f058 -:101f0400e9fb464b1e68a61b012006f0e3fb3f4b92 -:101f14001a68424b1b689a425cd9002006f0dafb2f -:101f24003a4b1d683d4b1b68ed1a012006f0d2fbad -:101f3400ae4201d2354b1c60324b1a681379ff2b29 -:101f440000d1e8e60133137164235370e3e6002003 -:101f540006f0c0fb314b1b6826009636ff36f61a96 -:101f6400012006f0b7fb6de7002006f0b3fb274b1a -:101f74001d689635ff35294b1b68ed1a012006f0c4 -:101f8400a9fb71e7002006f0a5fb244b1b68260083 -:101f94009636ff36f61a012006f09cfb85e70020f2 -:101fa40006f098fb194b1d689635ff351b4b1b68d3 -:101fb400ed1a012006f08efb88e7002006f08afb6c -:101fc400164b1b6826009636ff36f61a012006f0db -:101fd40081fb9ce7002006f07dfb0c4b1d689635c9 -:101fe400ff350e4b1b68ed1a012006f073fb9fe7cb -:101ff4000c49054804f0cafb96e6c046a613002027 -:10200400a811002070130020b07e0000741300207b -:1020140020120020740b0020090d002064130020fe -:10202400ac0f0020d6030000274b1c68002c00d105 -:1020340089e62500254b9c4202d3254b9c4204d3c0 -:102044003c21ff31234804f0a1fb234b1b68ab4226 -:102054001fd2002006f03efb1f4b1e68a61b01206a -:1020640006f038fb1d4b1a681b4b1b689a421dd99e -:10207400002006f02ffb194b1d68174b1b68ed1a47 -:10208400012006f027fbae4200d35ce6134b1c6034 -:1020940059e6002006f01efb0f4b1b6826009636ff -:1020a400ff36f61a012006f015fbdbe7002006f0e8 -:1020b40011fb0a4b1d689635ff35074b1b68ed1a5b -:1020c400012006f007fbdee7a8110020740b0020b6 -:1020d400090d0020b07e000064130020741300205a -:020000040000fa -:1020e400f0b59db00390029104921c00002805d025 -:1020f40083690593002b01d104f002ff984b029ae7 -:102104009a4262d1039b5b680293029b9b891b07e3 -:1021140069d5029b1b690593002b64d000220aab8e -:102124000f9220325a7610329a76049f3b78002b15 -:1021340001d0252b61d1049bfd1a0cd02b00049aed -:102144000299039805f050fb431c00d17de10f9bdd -:102154005d1904930f953b78002b00d175e10122a2 -:1021640000230aad52426a6006a9543252180a93f7 -:10217400eb60ab6013707b4b0137223304933978e7 -:102184000522049806f004fa7e1c002837d12a6838 -:10219400d30604d5532306a95b182021197013070d -:1021a40004d5532306a95b182b2119703b782a2bdd -:1021b4002ed03e0000210a20eb683278771c303a9a -:1021c400092a67d9002926d12ce0674b029a9a4242 -:1021d40002d1039b9b6897e7644b029a9a4294d17d -:1021e400039bdb6890e70299039803f0fdfb00284a -:1021f40094d0012040421db0f0bd013796e7049b06 -:102204002a68c01a0123834013432b603700b6e7c2 -:1022140008cc002b01dbeb6004e05b42eb600223a3 -:1022240013432b6033782e2b07d173782a2b39d1a3 -:1022340008cc0236002b32db6b604a4f31782837ea -:102244000322380006f0a4f9002806d04023c01b5e -:1022540083402a68013613432b60424f731c3800b5 -:102264003178532606222c300493297606f090f90f -:102274002b7e06aab618692b2bd038d8582b77d0ca -:1022840023d8002b00d1ede0522606aab6183370ed -:102294000123f5e0434301219b183e008de7012310 -:1022a4005b42c9e700230a201a0001366b603178cb -:1022b400771c3039092903d9002bbed06a60bce7ea -:1022c4004243012352183e00f1e7632b27d0642bcd -:1022d400dad1221d0a9b059224681a062cd5214fb7 -:1022e400002c02da2d23644233700a255ce0732b40 -:1022f40000d1b9e008d86f2b22d0702bc4d1202391 -:102304002a6813432b6003e0752b19d0782bbbd1bb -:10231400552306aa9b18782211371a702ce05226ee -:1023240006abf61808cc337001232b61532306aa9d -:102334009b1800221a706be05b06d0d524b2cee75e -:10234400211d0a9a05912468110605d5054f0a2511 -:102354006f2b24d1082522e05206f7d5a4b2f5e765 -:1023640068120020b87d0000881200204812002066 -:10237400552206a952181370221d0a9b059224683f -:102384001a0669d50122134202d01f3213430a935d -:102394001025002c03d120230a9a9a430a9253232e -:1023a40006aa9b1800221a700b9b0c93002b03dbcc -:1023b40004220a9991430a91002c05d1532206a9bb -:1023c40052181600002b0cd0532306aa9b181e008b -:1023d4002900200003f00ef87b5c013e3370a54217 -:1023e4003ed9082d0ed101220a9b13420ad00b9b21 -:1023f40006930e9b0793079a069b934202dc3023b5 -:10240400013e3370532306aa9b189b1b059c0e9315 -:10241400294b09aa00930aa9029b039803f042fce2 -:10242400431c12d00e9b32000299039805f0dcf98c -:10243400431c0ad00a9b05939b0735d4099a0d9b2c -:10244400934200da13005a1c30d1029b9b895b062d -:1024540000d5cee60f98cee65a0693d5a4b291e7fe -:102464000400b5e72b61d3e740cc6a680021300053 -:1024740006f08ef8002801d0801b68600b9b059342 -:102484000e9353e7292206a90123521803980299af -:1024940005f0aaf9431cd8d001350d9b099a059380 -:1024a4009b1a9d42eedbc9e70025f6e70f9ad31885 -:0c24b40005920f9339e6c046ed7700005a -:020000040000fa -:1024c000f0b5d6464f464646c0b5a6b00023259384 -:1024d000249306f007f9d44b1b68c01ad34b5b79e1 -:1024e00098420bd805f02efb00280fd002f034f8ec -:1024f0000024cf4b9a46cf4b994681e006f0f2f884 -:10250000c94b1b68c01ac94b5871ebe70022002168 -:1025100002f0def9eae700229fe00027a3e00027af -:10252000a1e0be21c44804f033f90fe038797b798b -:102530001b020343b87900040343f87900061843eb -:10254000434258414042c0b2002829d03b797a79b1 -:1025500012021a43bb791b041a43fb791b0613436f -:102560004cd024a9200000f01bfb002848d13b7967 -:102570007a7912021a43bb791b041a43fb791b06b2 -:1025800013432499380098473ae0501e8241504244 -:10259000c0b2d9e7013a501e82415042c0b2d3e7df -:1025a00024a9200000f0fcfa002829d12499380041 -:1025b000fef710fc002818d03b797a7912021a43f2 -:1025c000bb791b041a43fb791b06134311d03b79db -:1025d0007a7912021a43bb791b041a43fb791b0652 -:1025e00013432499380098470ae0249800f042ffea -:1025f00006e09121904804f0cbf8e8e70134a4b25a -:1026000025a9200004f03af8ff284ad0259f534618 -:102610001888002883d0874b1b689f4200d17ae737 -:1026200001218bb2984200d877e70a0001311301eb -:102630009b1a9b009b184d465e5db0464b445e78ee -:102640003602b446464665462e439d782d042e43f9 -:10265000db781b0633439f42e3d11701bf1abf004b -:10266000bf18744bff186b46d91d00230b7002aacc -:102670001380200005f0c4fd002812d102a920001b -:1026800005f0d4fc00280cd102ab1a886b46db792c -:10269000192b00d95ae76b46db799b006749cb5869 -:1026a0009f4606f02bf8624b1b88002b00d1c7e039 -:1026b0000025604e13e02b015b1b9b005b195d4afc -:1026c000944663442c331a785b781b02134330d151 -:1026d0000135adb2564b1b88ab4200d8b0e02f009d -:1026e0002b015b1b9b005b19995df3185a78120252 -:1026f00011439a7812040a43db781b0613431a78b5 -:102700005b781b021343d6d12b015b1b9b005a192c -:10271000484b9b181a002e32002111705170023a5a -:1027200011705170283300221a705a709a70da7042 -:10273000cee705f0d7ff2b015b1b9b005b193d4ae1 -:10274000944663441c0028342278617809021143be -:10275000a27812041143e27812060a43801a2c333d -:1027600019785b781b020b439842b1d302a96246e9 -:102770002801401b80004019835c9c461018437858 -:102780001b0262461343827812041343c278120676 -:102790001a4313789c4653781b02624613431b016d -:1027a0000a8894460f226446144023430b8003009a -:1027b0002e331c785b781b0223431b014c8822407c -:1027c00013434b80f0221340012213438b702a23c2 -:1027d0000b711d3b6b4400221a705a7003794279c9 -:1027e00012021a4383791b041a43c3791b0613434d -:1027f00007d02801401b800040190e4a801802a90a -:10280000984705f06fff3b01db1b9b00db19094f6d -:10281000ff1828373870030a7b7003021b0ebb7049 -:10282000000ef87054e7c0465413002038130020ff -:102830009c130020780e0020507e0000346e0000b3 -:1028400005f050ff034b186026b01cbc904699461b -:08285000a246f0bd5413002064 -:020000040000fa -:10285800f8b543025b0ada00de4693464a02520a9a -:10286800454690464e4657464446e0b54a0047001e -:102878003f0ee400120ea1469c463e00c50fc90f4c -:10288800bc1aff2a00d177e0012082465046414019 -:102898008d4200d180e0002c51dd002a00d073e089 -:1028a8004b46002b00d1dde0013c002c0fd0ff2f60 -:1028b80000d1a5e001231b2c09dc20224946121b6c -:1028c80091404b460a00e340511e8a4113435a4641 -:1028d800d31a5a0100d4c0e09b019c09200005f0de -:1028e80069f9230005388340864200ddc4e0861b71 -:1028f8001a0020200136f240861bb3405c1ea3411b -:10290800002613435a0704d00f221a40042a00d085 -:1029180004335a0100d4a3e00136f7b2ff2e00d1e8 -:10292800a7e09b015b0a5802ff05400aed07384300 -:1029380028433cbc90469946a246ab46f8bd002cbd -:102948004fd1fe247a1c144200d099e05a46002f39 -:1029580000d000e1002a00d1f1e04a46002ae2d086 -:102968004b465a46d31a5a0100d402e14b465a46fe -:102978000d009b1a0026c5e74846002800d183e7ca -:102988008d4251d0002cdaddff2f39d080234a4602 -:10299800db041a4391468de7002c45dd002a3ad026 -:1029a800ff2f2dd080234a46db041a43914601238a -:1029b8001b2c09dc20224946121b91404b460a0079 -:1029c800e340511e8a4113435b445a0145d5013601 -:1029d800ff2e4ed001226e491a405b080b4013436c -:1029e80090e7d41b0d00002f6fd15b46002b00d160 -:1029f8008fe0013c002c00d1c2e0ff2a6cd1c44614 -:102a08006346002b35d080236246db0313435b0209 -:102a18005b0aff2787e74b46002b23d0013c002c9d -:102a280074d0ff2fc3d1ebe7002c35d1fe227e1cda -:102a3800324200d089e05a46002f6dd1002a00d1d9 -:102a4800a3e04a46002a00d16de75b464b440026c6 -:102a58005a0102d54f4a013613405a0700d053e7ae -:102a6800db089c46ff2ecbd063465b025b0af7b2bd -:102a780059e7ff27002356e7464a361a134041e72d -:102a88004b465a46d41a63016fd4002c00d025e770 -:102a980000250027002346e7d11b002f2cd0ff2a52 -:102aa800add080235846db041843834601231b29f5 -:102ab80008dc5b4620245846cb40611a8840411efa -:102ac800884103434b4416007fe7ff2a97d08023b1 -:102ad8005946db0419438b4601231b2c08dc2021b3 -:102ae8005b465846e3400c1ba040411e8841034307 -:102af80049461600cb1aece65b46002b09d0013993 -:102b08000029dfd0ff2ad1d1c44679e75b464b4480 -:102b18005be7c4461600a5e7002a00d16fe74a46de -:102b2800002a00d16ce78022d203134200d167e764 -:102b38004346134200d063e70d00c44660e74b46a6 -:102b4800002b1ad00d004346ede6ff2e91d05b46d0 -:102b58004b445b0881e7002ae1d14b46002bebd1bf -:102b680080230025db03ff27dde64b460d009c1a7a -:102b7800b4e60026002b00d06fe700250023d2e63c -:102b88004b46594616005b1aa3e64346cbe6c046b9 -:082b9800ffffff7dfffffffbc3 -:020000040000fa -:102ba000f8b504000d00b34b1968002906d00722c0 -:102bb000b14805f02dfdaf4b00221a60002005f052 -:102bc0008bfdae4b1b78012b09d0012005f084fd55 -:102bd000ab4b1b889bb2ff20a34210d8f8bda74b7c -:102be00000221a70a74b1968a74b1868fdf7bafda9 -:102bf0000028ead0f721a54803f0cafde5e7e30085 -:102c0000a34a9b58a34a13602b609d4b1b889bb221 -:102c10009c4204d29a4b1b889bb20a2b04d9e72111 -:102c200089009a4803f0b4fd954b1b889bb2a342e0 -:102c300013d9974d924e002005f04efd671ce4001d -:102c4000fb002c19eb1806cb06c4012005f044fd4f -:102c5000bcb233889bb29c42edd3002005f03cfd12 -:102c6000874b1b889bb2002b0dd0854a1388013bf4 -:102c70009bb213801188864bc9000020c85012886f -:102c8000d2009b185860012005f026fd824b0122de -:102c900052421a60814b1c68002c2fd02500764bc5 -:102ca0009c4202d37e4b9c4204d33c21ff317748a7 -:102cb00003f06efd744b1b68ab4200d386e000202e -:102cc00005f00afd704b1e68a61b012005f004fdef -:102cd000714b1a686c4b1b689a4200d883e0002045 -:102ce00005f0fafc6c4b1d68674b1b68ed1a012060 -:102cf00005f0f2fcae4201d2674b1c60644b1c68cd -:102d0000002c2dd025005c4b9c4202d3644b9c428e -:102d100004d33c21ff315d4803f03afd5a4b1b6858 -:102d2000ab426ed2002005f0d7fc574b1e68a61ba5 -:102d3000012005f0d1fc584b1a68534b1b689a428e -:102d40006cd9002005f0c8fc534b1d684e4b1b6826 -:102d5000ed1a012005f0c0fcae4201d24e4b1c60c2 -:102d6000504b1c68002c00d181e02500424b9c4256 -:102d700002d34b4b9c4204d33c21ff31434803f028 -:102d800007fd414b1b68ab4256d2002005f0a4fc66 -:102d90003d4b1e68a61b012005f09efc3e4b1a68a9 -:102da000394b1b689a4254d9002005f095fc3a4be8 -:102db0001d68354b1b68ed1a012005f08dfc0020c5 -:102dc000ae4200d30ae7344b1c6007e7002005f051 -:102dd00083fc2d4b1b6826009636ff36f61a012021 -:102de00005f07afc74e7002005f076fc2a4b1d689c -:102df0009635ff35244b1b68ed1a012005f06cfc5d -:102e000078e7002005f068fc1f4b1b68260096360b -:102e1000ff36f61a012005f05ffc8ce7002005f074 -:102e20005bfc1d4b1d689635ff35174b1b68ed1a73 -:102e3000012005f051fc8fe7002005f04dfc124bfe -:102e40001b6826009636ff36f61a012005f044fc72 -:102e5000a4e7002005f040fc0f4b1d689635ff35b8 -:102e6000094b1b68ed1a012005f036fca7e700208e -:102e7000b4e6c04660130020740b0020a90f0020a8 -:102e8000a61300206813002064130020b07e000009 -:102e9000a8110020781300207413002020120020b5 -:082ea000090d0020ac0f002019 -:020000040000fa -:102ea800f8b50400ad4b1968002906d00722ac48d4 -:102eb80005f0aafba94b00221a60002005f008fcc7 -:102ec800a84b1b78012b09d0012005f001fca64b6b -:102ed8001b889bb2ff20002b10d1f8bda14b00220c -:102ee8001a70a24b1968a24b1868fdf737fc002826 -:102ef800ead0f7219f4803f047fce5e79e4b1b68a3 -:102f08002360974dab4202d39c4a934203d39c491a -:102f1800984803f039fc944b1b889bb20a2b04d8c1 -:102f2800914b1b889bb2002b04d1d3218900914877 -:102f380003f02afc8c4b1b889bb2002b12d0002478 -:102f48008d4e894f012005f0c3fb002005f0c0fb22 -:102f5800631c9a009259a400a2519cb23b889bb270 -:102f68009c42efd3804a1388013b9bb2138013889d -:102f7800814c9b0000221a51012005f0a9fb814bce -:102f8800012252421a602468002c2ed02600a54245 -:102f980002d87a4b9c4204d33c21ff31754803f098 -:102fa800f3fb734b1b68b34200d384e0002005f0a9 -:102fb8008ffb6f4b1f68e71b012005f089fb714be6 -:102fc8001a686b4b1b689a4200d881e0002005f014 -:102fd8007ffb6c4b1e68664b1b68f61a012005f0d8 -:102fe80077fbb74201d2674b1c60674b1c68002c0b -:102ff8002cd02600a54202d8604b9c4204d33c2129 -:10300800ff315c4803f0c0fb594b1b68b3426dd2db -:10301800002005f05dfb564b1f68e71b012005f0fb -:1030280057fb584b1a68524b1b689a426bd90020c1 -:1030380005f04efb534b1e684d4b1b68f61a0120da -:1030480005f046fbb74201d24e4b1c604f4b1c6843 -:10305800002c00d180e02600a54202d8474b9c42b4 -:1030680004d33c21ff31434803f08efb404b1b68df -:10307800b34256d2002005f02bfb3d4b1e68a61b21 -:10308800012005f025fb3f4b1a68394b1b689a4213 -:1030980054d9002005f01cfb3a4b1d68344b1b68c3 -:1030a800ed1a012005f014fb0020ae4200d314e70e -:1030b800344b1c6011e7002005f00afb2c4b1b6801 -:1030c80027009637ff37ff1a012005f001fb76e746 -:1030d800002005f0fdfa2b4b1e689636ff36244b70 -:1030e8001b68f61a012005f0f3fa7ae7002005f0cc -:1030f800effa1f4b1b6827009637ff37ff1a01208e -:1031080005f0e6fa8de7002005f0e2fa1d4b1e688f -:103118009636ff36164b1b68f61a012005f0d8faca -:1031280090e7002005f0d4fa114b1b68260096366c -:10313800ff36f61a012005f0cbfaa4e7002005f0c7 -:10314800c7fa104b1d689635ff35094b1b68ed1af9 -:10315800012005f0bdfaa7e70020bee660130020b5 -:10316800740b0020a90f0020a8130020681300206a -:1031780064130020b07e000020120020090d0020fa -:103188008103000074130020a8110020ac0f002058 -:020000040000fa -:10319800f8b5de4657464e464546e0b58346a94b48 -:1031a8001b889bb2002b04d0a64b1b889bb20a2b12 -:1031b80003d9a549a54803f0e7fa0025a14b99468c -:1031c800a34b9a4637e09f4b1b889bb2984219d273 -:1031d8002c009f4e9b4b9846002005f079fa671cff -:1031e8003b019a592401a251f3189b889bb23419c8 -:1031f800a380012005f06cfafcb243461b889bb201 -:10320800a342e9d8002005f063fa8e4b1b889bb2d5 -:10321800002b0dd08b4a1388013b9bb21380118879 -:103228008b4b09010020c850128812019b18988006 -:10323800012005f04dfaa8b24b461b889bb2984274 -:103248000cd22b01524699580a7812094b781b0167 -:1032580013435b45b7d00135edb2ece77d4b012256 -:1032680052421a607c4b1c68002c2fd025007b4be7 -:103278009c4202d37a4b9c4204d33c21ff317348d1 -:1032880003f082fa774b1b68ab4200d389e0002039 -:1032980005f01efa734b1e68a61b012005f018faec -:1032a8006c4b1a686f4b1b689a4200d886e0002066 -:1032b80005f00efa674b1d686a4b1b68ed1a012072 -:1032c80005f006faae4201d2624b1c60664b1c68e0 -:1032d800002c2ed02500614b9c4202d3604b9c42af -:1032e80004d33c21ff31594803f04efa5d4b1b686b -:1032f800ab4200d370e0002005f0eaf9594b1e6894 -:10330800a61b012005f0e4f9524b1a68554b1b68bf -:103318009a426ed9002005f0dbf94e4b1d68514bdf -:103328001b68ed1a012005f0d3f9ae4201d2494bd2 -:103338001c60474b1c68002c2dd02500474b9c4235 -:1033480002d3474b9c4204d33c21ff313f4803f052 -:103358001bfa444b1b68ab4259d2002005f0b8f960 -:10336800404b1e68a61b012005f0b2f9394b1a68bc -:103378003c4b1b689a4257d9002005f0a9f9354bf8 -:103388001d68384b1b68ed1a012005f0a1f9ae4203 -:1033980001d2304b1c603cbc90469946a246ab46d5 -:1033a800f8bd002005f094f92e4b1b6826009636d0 -:1033b800ff36f61a012005f08bf971e7002005f0b9 -:1033c80087f9244b1d689635ff35264b1b68ed1a87 -:1033d800012005f07df975e7002005f079f9214b0a -:1033e8001b6826009636ff36f61a012005f070f99c -:1033f8008ae7002005f06cf9164b1d689635ff35f5 -:10340800184b1b68ed1a012005f062f98de70020c2 -:1034180005f05ef9134b1b6826009636ff36f61a40 -:10342800012005f055f9a1e7002005f051f9094bf5 -:103438001d689635ff350b4b1b68ed1a012005f00a -:1034480047f9a4e7aa130020e2060000b07e0000b6 -:10345800ac0f00207413002020120020740b0020f1 -:0c346800090d002064130020a8110020b2 -:020000040000fa -:10347400f8b5de4657464e464546e0b5824600243a -:10348400a54b9846a54b994643461b889bb2a3423d -:1034940000d83be1e3004a469b58534502d001342f -:1034a400a4b2f1e79c4b1b889bb29c4204d29a4b7a -:1034b4001b889bb20a2b04d9e7218900984803f0a2 -:1034c40065f9954b1b889bb29c4216d22700934efc -:1034d400914b9b46002005f0fdf87d1cfb00ea00a3 -:1034e400f318b21803ca03c3012005f0f3f8afb20e -:1034f4005b461b889bb29f42ecd3002005f0eaf8a0 -:10350400854b1b889bb2002b0dd0834a1388013b4b -:103514009bb213801188814bc9000020c8501288c7 -:10352400d2009b185860012005f0d4f87d4b01228d -:1035340052421a607c4b1d68002d2fd02e007b4b0d -:103544009d4202d37a4b9d4204d33c21ff317448ff -:1035540003f01cf9774b1b68b34200d385e00020cd -:1035640005f0b8f8734b1f68ef1b012005f0b2f8a3 -:103574006c4b1a686f4b1b689a4200d882e000209b -:1035840005f0a8f8674b1e686a4b1b68f61a012001 -:1035940005f0a0f8b74201d2624b1d605f4b1d6875 -:1035a400002d2dd02e00614b9d4202d3604b9d42d5 -:1035b40004d33c21ff315a4803f0e8f85d4b1b6803 -:1035c400b3426dd2002005f085f85a4b1f68ef1bfb -:1035d400012005f07ff8534b1a68564b1b689a423a -:1035e4006bd9002005f076f84e4b1e68514b1b68d2 -:1035f400f61a012005f06ef8b74201d2494b1d605e -:103604004d4b1d68002d00d13ee72e00474b9d42d7 -:1036140002d3474b9d4204d33c21ff31404803f081 -:10362400b5f8444b1b68b34255d2002005f052f85c -:10363400404b1f68ef1b012005f04cf8394b1a680a -:103644003c4b1b689a4253d9002005f043f8354b94 -:103654001e68384b1b68f61a012005f03bf8b74288 -:1036640000d311e72f4b1d600ee7002005f032f860 -:10367400304b1b682f009637ff37ff1a012005f0e7 -:1036840029f875e7002005f025f8264b1e689636c4 -:10369400ff36284b1b68f61a012005f01bf879e762 -:1036a400002005f017f8234b1b682f009637ff37cf -:1036b400ff1a012005f00ef88de7002005f00af846 -:1036c400184b1e689636ff361a4b1b68f61a0120f3 -:1036d40005f000f890e7002004f0fcff154b1b6890 -:1036e4002f009637ff37ff1a012004f0f3ffa5e7f8 -:1036f400002004f0efff0b4b1e689636ff360d4b8f -:103704001b68f61a012004f0e5ffa8e73cbc9046cc -:103714009946a246ab46f8bda6130020a811002086 -:10372400b07e00007413002020120020740b0020cf -:0c373400090d002064130020ac0f0020e1 -:020000040000fa -:10374000f8b5ce46474680b5050083781b071b0faa -:10375000dab2062a26d89b00a04ad3589f46a04a30 -:103760006423d35a9bb20026002b00d1cde09146b2 -:1037700090466427b9e09a4a6423d35a9bb2002446 -:10378000002b0fd016006427e000001b40001e3005 -:1037900080192900fef7b6fa0134a4b2f35b9bb29c -:1037a000a342f1d80cbc90469946f8bd8c4a6423dc -:1037b000d35a9bb20024002b6cd01700160051e0a6 -:1037c000874a6423d35a9bb2002b24d0d38b9bb25d -:1037d000027812094178090111438b4239d0002344 -:1037e0007f4e6424370001339bb2325b92b29a421f -:1037f00011d91800da00d21a5200ba18d28b92b23c -:103800008a42f0d1c300181a40001e30744bc01811 -:103810002900fef777fa724a7423d35c002bc1d1da -:103820007633d25a92b2297809096b781b010b437f -:103830009a42b7d06a4a7623d35ad08b181a80b2ec -:10384000c300181a40001e3080182900fef75afaeb -:10385000a8e70020d6e70134a4b26423f35a9bb250 -:10386000a34217d9e3001b1b5b00fb181a8c92b212 -:10387000297809096b781b010b439342ebd1e000d7 -:10388000001b40001e30564b9c4660442900fef74a -:1038900039fae0e7524a7423d35c002b00d081e769 -:1038a0007633d25a92b2297809096b781b010b43ff -:1038b0009a4200d176e74a4a7623d35ad08b181a17 -:1038c00080b2c300181a40001e3080182900fef78d -:1038d00019fa67e729002000fef714fa0136b6b29c -:1038e0004346db5b9bb2b3420fd9f400a41b6400d8 -:1038f0001e344c442b781b096978090119432000b8 -:1039000004f01efb0028e9d0e4e7354a7423d35cb9 -:10391000002b00d046e77633d25a92b229780909b3 -:103920006b781b010b439a4200d13be72c4a76236c -:10393000d35ad08b181a80b2c300181a40001e3018 -:1039400080182900fef7def92ce702781209437887 -:103950001b01134325d0224a12881205120d9342ef -:1039600024d01f4a7423d35c002b00d01ae776338f -:10397000d25a92b2297809096b781b010b439a42fb -:1039800000d10fe716497623ca5ac88b121a92b291 -:10399000d000801a40001e3040182900fef7b2f90e -:1039a00000e701000f48fef7adf9fbe60c4a64237f -:1039b000d35a9bb2002bd4d0002416006427e00019 -:1039c000001b40001e3080192900fef79bf90134ce -:1039d000a4b2f35b9bb2a342f1d8c2e7c884000053 -:0839e000cc100020ea100020c9 -:020000040000fa -:1039e800f8b5994b1b889bb2002b04d0964b1b88cb -:1039f8009bb20a2b03d99549954802f0c5fe924b14 -:103a08001b889bb2002b17d00024924d8e4f0020ac -:103a180004f05efe661c33015a5924016251eb180a -:103a28009b889bb22c19a380012004f051fe3b888f -:103a38009bb234009e42eadb002004f049fe824b30 -:103a48001b889bb2002b0dd07f4a1388013b9bb289 -:103a5800138011887f4b09010020c8501288120179 -:103a68009b189880012004f033fe7b4b01225242c0 -:103a78001a607a4b1c68002c2fd02500784b9c428a -:103a880002d3784b9c4204d33c21ff31704802f0aa -:103a98007bfe754b1b68ab4200d384e0002004f02a -:103aa80017fe714b1e68a61b012004f011fe6a4b1d -:103ab8001a686d4b1b689a4200d881e0002004f018 -:103ac80007fe654b1d68684b1b68ed1a012004f062 -:103ad800fffdae4201d2604b1c60644b1c68002c99 -:103ae8002ed025005e4b9c4202d35e4b9c4204d3f1 -:103af8003c21ff31564802f047fe5b4b1b68ab4246 -:103b080000d36be0002004f0e3fd574b1e68a61bb2 -:103b1800012004f0ddfd504b1a68534b1b689a4294 -:103b280069d9002004f0d4fd4b4b1d684e4b1b682f -:103b3800ed1a012004f0ccfdae4201d2464b1c60c8 -:103b4800444b1c68002c2dd02500454b9c4202d3c9 -:103b5800444b9c4204d33c21ff313d4802f014fe03 -:103b6800414b1b68ab4254d2002004f0b1fd3e4be0 -:103b78001e68a61b012004f0abfd374b1a683a4bb0 -:103b88001b689a4252d9002004f0a2fd324b1d68ee -:103b9800354b1b68ed1a012004f09afdae4201d2a4 -:103ba8002d4b1c60f8bd002004f092fd2e4b1b68c5 -:103bb80026009636ff36f61a012004f089fd76e7ce -:103bc800002004f085fd244b1d689635ff35264bf3 -:103bd8001b68ed1a012004f07bfd7ae7002004f051 -:103be80077fd214b1b6826009636ff36f61a012012 -:103bf80004f06efd8fe7002004f06afd164b1d6887 -:103c08009635ff35184b1b68ed1a012004f060fd4e -:103c180092e7002004f05cfd134b1b6826009636e3 -:103c2800ff36f61a012004f053fda6e7002004f041 -:103c38004ffd094b1d689635ff350b4b1b68ed1a78 -:103c4800012004f045fda9e7aa130020a7060000fb -:103c5800b07e0000ac0f002074130020201200205a -:103c6800740b0020090d002064130020a811002007 -:020000040000fa -:103c7800f0b5d6464f464646c0b5a2b0c379082b24 -:103c880032d89b007e4ad3589f4682781209c3785f -:103c98001b0113437b4a13804379827912021a432a -:103ca800013a92b2784b1a80784c01000831200012 -:103cb80004f0aafc2368764a1360764a934203d834 -:103cc800102003f0fffc0fe0202003f0fbfc0be0ca -:103cd8006f4b1988a220000204f050f86e4b0022a6 -:103ce8001a70122003f0eefc22b01cbc90469946d4 -:103cf800a246f0bd82781209c3781b011343614aba -:103d080013804379847924021c43013ca4b25e4b9e -:103d18001c800100083122005c4804f075fc5f4bf0 -:103d28001d88ac4210d85e4f3e885e48301822008d -:103d3800564904f069fca6193e802c1b574b1c8081 -:103d4800132003f0bffccfe7554b98461888554e13 -:103d580080194e4f2a00390004f056fc80252d01a9 -:103d6800514c32002900206803f02ef923682a00fc -:103d7800ac4663442360ff21300004f077fc474dd4 -:103d88002c88414b1b8899461b1b9a46e1191a003f -:103d9800300004f039fc434652461a8080231b0148 -:103da8009c4664444b46e41a2c80c9e78278120981 -:103db800c3781b011343334a138043798279120273 -:103dc8001a43013a92b2304b1a80010008312f4849 -:103dd80004f01afc8021344b1868324a090103f0b8 -:103de800f3f8142003f06efc7ee702f0cdfd2f4bb4 -:103df800187017236a46137193780f229343012290 -:103e080013436a4693701f4b1a8812016b46198830 -:103e18000f230b4013436a4613806b4602225a71e4 -:103e280000229a7115236a46d371107269460020e0 -:103e380003f06cfc58e7184b01221a7054e704f0a1 -:103e48004dfc1b4b18601d001a4c04f047fc2b68f6 -:103e5800c01aa042f9d9104b1b78002b03d104f0eb -:103e680073fc022806d104f09cfba220000204f097 -:103e78009bf939e7002003f0ffff04f081f933e7ed -:103e88003c8300000a0d00203e1300204c10002047 -:103e9800c4120020fe5d030037130020aa0f002083 -:103ea80046130020040000204c130020cb100020f3 -:083eb80048130020e70300009d -:020000040000fa -:103ec000f0b583b004000078c0b204f06ffb854bfe -:103ed0001a88854b1b889a4241d344d9834a10687b -:103ee000c218d2790133c318dc7924021443804b01 -:103ef0001b88a34200d0b4e004f006fc002838d1af -:103f00007a4b1a6893781b071b0f012b59d09378b3 -:103f10001b071b0f062b00d172e0744b1b681a792c -:103f2000162a00d17be0714b1b681b79012b00d155 -:103f30007fe0704b1b88a34204d16f4b1b88002b82 -:103f400000d084e0fdf7cafc6b4b1b88002b00d12e -:103f500083e0013b684a1380664b1c8092e0644911 -:103f6000200004f035f85f4a13880133138003b052 -:103f7000f0bd5e4b1d686979ab791b0219430139ad -:103f800069180822684604f043fb5c4b1a685b68ba -:103f9000009e019f9f4211d801d196420ed8921bdc -:103fa000bb4156490a604b606879ab791b021843e4 -:103fb00001382818082204f02bfba1e70022002377 -:103fc000efe71178090953781b010b434c4868212e -:103fd000415ac9008b4200dc99e701006820085a69 -:103fe000c0001b1a013b9bb2d8080918663109783a -:103ff000c9b2072003401941cb0700d487e70be083 -:104000003f4b19880905090d1078000953781b01e9 -:104010000343994200d080e704f064fa7de7db793e -:10402000092b00d07fe7002003f02aff04f0acf852 -:1040300079e704f0d1f8324b00221a76032003f01e -:1040400061fc002004f00efb04f0c4fa1ae002f058 -:1040500021fc2b4b2b4a9a6089e7264b00221a80c1 -:1040600010e0274a137b10210b43137383781b073f -:104070001b0f012b0ad083781b071b0f062b22d0a6 -:1040800002f008fc1e4b1f4a9a6070e70278120982 -:1040900043781b0113431a4968228a5ad20093427b -:1040a000e9dd0a006821515ac9005b1a013b9bb245 -:1040b000d908521866321278d2b207210b401a4141 -:1040c000d307d8d50ae00e4b1a881205120d0178d5 -:1040d000090943781b010b439a42d1d104f002fa3b -:1040e000cee7c046ae130020b013002064130020ba -:1040f000ac130020b4130020b213002028130020ba -:08410000cc100020175600004e -:020000040000fa -:10410800f0b54f464646d64644024500c0b58846f7 -:10411800640a2d0ec70f002d49d0ff2d4fd08023e4 -:10412800e400db041c43002399469a467f3d43463e -:1041380042465e02d20f5b00760a1b0e904646d0be -:10414800ff2b12d080220020f600d2047f3b1643ba -:10415800ed186a1c434694464a467b400f2a00d90c -:1041680074e0704992008a589746ff35002e54d162 -:104178004a4602231a4391460220eae7434634009e -:1041880082465246022a2ad0032a00d1c3e0012ad5 -:1041980000d082e0002200246402d205600adb0716 -:1041a800104318431cbc90469946a246f0bd002c0b -:1041b80027d104239946033b00259a46b7e7002cec -:1041c80019d108239946063bff259a46afe7002eea -:1041d80008d14a4601231a4391460120b9e7ff2234 -:1041e8000024d9e7300003f0e5fc431f2d1a9e4058 -:1041f800763d0020ade70c239946093bff259a46fa -:1042080095e7200003f0d6fc7625431f9c40002349 -:104218006d422d1a99469a4689e74a4603231a435e -:104228009146032095e73b00abe780240023e40395 -:10423800ff22b1e78023db031c4245d01e4243d155 -:1042480033435c02640a4346ff22a5e7200c24049a -:10425800210c0f00320c3604360c77435143464389 -:10426800504389193a0c5218964203d980214902c1 -:10427800884640443f0411043f0cc9198c01661e4e -:10428800b441890e2143140c2418a4010c432201c3 -:104298003cd50122610814400c4360467f30002859 -:1042a8001add620704d00f222240042a00d0043409 -:1042b800220103d560461c4a80301440fe288edc5b -:1042c800a401640ac2b267e78020c0030443640201 -:1042d800640a3b00ff225fe70122101a1b2800dd59 -:1042e80058e762469e3221009440c140621e9441c4 -:1042f8000c43620704d00f222240042a00d0043461 -:10430800620105d4a401640a002245e7ac46c4e76b -:104318000122002440e78022d20314436402640a85 -:0c432800ff2239e74c7a0000fffffff78e -:020000040000fa -:10433400f0b5de4657464e464546e0b5abb00500ff -:10434400002004f0fbf928786b781b020343a8785b -:1043540000040343e8780006184300f02fff04002c -:1043640000220021002000f0b1fa03f0f7fe02f071 -:1043740045ff02ab0022da8084420fd9002c0dd015 -:10438400002398460f339a461d2702ab9c46674488 -:1043940002236a4613716d4b9b4699e002f05aff63 -:1043a400061e36d0012703e00137bfb2be4230d328 -:1043b400380003f055f803f0f3f8b842f4d03800ad -:1043c40003f04ef80100102204a804f01ff938008d -:1043d40003f046f8012103f019f802230193380091 -:1043e40003f03ef803f0dcf8b842ddd0380003f007 -:1043f40037f8102204a904f009f9380003f030f862 -:1044040001994b1cdbb29a4603f000f85346019322 -:10441400e5e704f01df903282ad008aa0e23137136 -:1044240093780f218b4306210b439370012c1fd9e2 -:104434000223984602271600444b994643461a0124 -:1044440031880f230b40134333804b461b881622bd -:1044540053439bb23e4a3100280001f059fd013715 -:10446400bfb2434601331b051b0d9846bc42e5d23f -:1044740004f0eef803281ad008ab1988102252422f -:104484000a431a809a780f218a4303210a439a70b7 -:1044940002221a711d2302aa9446634400221a7050 -:1044a4005a7008a9280003f033f90028f9d103f061 -:1044b400b5fc2bb03cbc90469946a246ab46f0bd39 -:1044c40002f09cfe844200d868e7444500d165e7c9 -:1044d400434601339bb2984608ae0d233371b3783b -:1044e4005246934306221343b370013003013088cc -:1044f40052461040184330806b461b793b700023b2 -:104504007b7002f0a7fe02ab991d013008800222e5 -:104514001f209c46604404f079f85b461b889bb2dc -:1045240099463100280003f0f3f804f0d9f80600a6 -:1045340004f0d6f8801b0e2800d92fe7fdf7beff44 -:10454400024b1b889bb29945f2d0b9e79e13002019 -:044554000408002037 -:020000040000fa -:10455800f0b5a5b06c4a6d23d35c002b05d100f0f3 -:104568008dfd00232393684db3e004f0b7f8664b44 -:104578001b6fc01a654b9842f1d9634b00226d211d -:104588005a541a6701395a54e9e77279b3791b0208 -:104598001343022b2dd0042b60d0002b00d098e0c1 -:1045a8005b490b8801339bb20b8001af00233b7141 -:1045b80009336b4402221a7000225a70b278120929 -:1045c800f3781b0113431b0138880f220240134361 -:1045d8003b80bb780f22934306221343bb70022211 -:1045e8000b20684404f010f83900200001f010f89e -:1045f8006fe0454b187f0736013040009c46604409 -:104608000222310004f000f8022231006b46981ca7 -:1046180003f0faff3c4b1b881b051b0d6a461380f1 -:1046280001af00233b7109336b4404221a70002246 -:104638005a703a880f2313403b80bb780f2293436c -:1046480006221343bb70042269460b20684403f01a -:10465800dbff3900200000f0dbff3ae02a4b1b8823 -:104668001b0517d1f11d0422684603f0cdff6b46e8 -:104678005a882b881205120d1b0b1b0313432b8022 -:104688002b7f6a4612885b00eb185a80200001f0e5 -:104698009ffd1ee01c4b1b881b0b1b031a4a138033 -:1046a800002001f0b3f8dde7174b00226d215a54c2 -:1046b8001a676c326c3999541fe003f07dffff28ac -:1046c800fbd0f11d042201a803f09eff019800f021 -:1046d8002bfc23a8fef7e4fb002812d1239e300010 -:1046e80001f0f6f904003379012bf2d0002b00d148 -:1046f8004be7022bd8d0032bdfd02398fff71cf809 -:10470800e7e725b0f0bdc046cc100020b80b00008c -:04471800b6130020b4 -:020000040000fa -:10471c00f0b5ce46474680b583b08046160001936f -:10472c00634b1f883c01e41ba400e419614b9946c0 -:10473c00e51888b202f0a6fc4b461855030a6b70bc -:10474c00030cab70000ee87042462a71120a6a71b3 -:10475c0042461202120eaa714246100ee8713178ce -:10476c00297200290cd0280008300123d9b2f25c40 -:10477c00c254002a04d00131c9b201330f2bf5d138 -:10478c004c4a3b01db1b9b00db19d3185918002347 -:10479c000b72230018339846904410220021404697 -:1047ac0003f062ff424b1b881801c018ff239b02c9 -:1047bc009c4660444246102103f03eff4346197864 -:1047cc0020230a009a431300413bdab21923934287 -:1047dc009b415b424a4251410b4343d1230030334e -:1047ec0034495b180022002018705a709a703b01f3 -:1047fc00db1b9b00df19c8190200303201ab1e789d -:10480c00167001325e78167001329b7813702a4b49 -:10481c00013213701e0a56701e0c96701b0ed3704c -:10482c007b5c427812021a4383781b041a43c378c8 -:10483c001b061343373464181a009c72230ad37274 -:10484c0023021b0e1373240e5473194a138801335d -:10485c009bb21380052b26d8280003b00cbc9046c5 -:10486c009946f0bd32783b01db1b9b00db191149eb -:10487c00cb181a76002a0cd0280018300123dab293 -:10488c00f15cc154002904d00132d2b201330f2b98 -:10489c00f5d13b01db1b9b00db190649cb189a18a1 -:1048ac00002313769ae70549054801f06bffd3e71f -:1048bc009c130020780e00203813002059020000b1 -:0448cc00507e00001a -:020000040000fa -:1048d000f8b5ce46474680b506000c009046002845 -:1048e00019d0002929d04346002b2bd0574b1988cb -:1048f000002900d1a3e0564b9e4200d17de0554aed -:10490000002301339bb2994221d010003d30b242c6 -:1049100020d00200f5e7504a0023136053609360f3 -:10492000d36013614d4a136053609360d360136189 -:104930004b4a1380012040425be04a494a4801f05b -:1049400027ffd0e74949484801f022ffcee7012080 -:1049500040424ee0464a934200d173e099469a00a5 -:104960003e495258002a06d19b006179a279120271 -:104970000a433a495a506279a3791b0213434a46c3 -:10498000920036495258934239d8354b1b88002b38 -:1049900006d0803b6179a27912020a43934233dc4c -:1049a0006279a3791b0213431f1c9bb2802b00d991 -:1049b0008027bfb2284e4b469d00ab594344180098 -:1049c000e11d3a0003f024feab599c466744af5109 -:1049d0006279a3791b021343214a13801f4beb58c2 -:1049e0009f421bd86279a3791b0213430020802bbe -:1049f0001ad90cbc90469946f8bd0023aee71d4974 -:104a0000194801f0c5fec0e74b469e000023124a3c -:104a1000b350134a138001204042eae7ce218900b7 -:104a2000114801f0b5fedde74b469e0000230a4a1f -:104a3000b3500b4a1380094ab058b350d9e701204c -:104a40004042d6e701204042d3e7c0469c130020f5 -:104a5000780e0020b50e0020e0120020f412002095 -:104a60009813002009030000507e00000a03000094 -:084a7000ffff00001903000024 -:020000040000fa -:104a7800f0b557464e464546de46e0b5040083b0dd -:104a88000d00924699468b4230d82dd04946504663 -:104a980003f058fd29000600200003f053fd331ae7 -:104aa8009846203b9b4633d45a4653469340424649 -:104ab8001f00534693401e00af423ad8af4200d180 -:104ac8007be05b46a41bbd41002b00da78e00022a6 -:104ad80000230092019301235a4693400193012336 -:104ae80042469340009328e08242cfd90022002317 -:104af800009201930c9b002b01d01c605d60009814 -:104b0800019903b03cbc90469946a246ab46f0bd1d -:104b1800424620239b1a5246da40414613004a4631 -:104b28008a40170042461f43534693401e00af4237 -:104b3800c4d900220023009201934346002bd9d008 -:104b4800fb079c46614672080a437b0846460ee00e -:104b5800ab4201d1a2420cd8a41a9d4101202419cc -:104b68006d410021013e24184d41002e06d0ab4274 -:104b7800eed9013e24196d41002ef8d10098019913 -:104b88005b4600196941002b25db2b005a46444639 -:104b9800d3402a00e2401c005b461500002b2bdbab -:104ba80026005f46be40330026004746be4032001e -:104bb800801a9941009001919ce7a342b9d880e7f7 -:104bc8004246202300219b1a0022009101920122d3 -:104bd800da40019283e7424620239b1a2a00464680 -:104be8009a402300f340444613432a00e2401c0045 -:104bf8005b461500002bd3da2023424626009b1a79 -:104c0800de402f00b4464646b74066463b00334375 -:044c1800cae7c046e1 -:020000040000fa -:104c1c0070b5010083781b071b0fdab2062a00d986 -:104c2c009de09b005f4ad3589f465f4a6423d35a4a -:104c3c009bb2002b55d003781b0940780001184318 -:104c4c00138c9bb2984200d18be00022564d642409 -:104c5c002e00013292b22b5b9bb2934241d9d3000e -:104c6c009b1a5b00f3181b8c9bb28342f1d1022080 -:104c7c0054e04d4a137b1020834313730a781209b6 -:104c8c004b781b01134348486822825ad200934246 -:104c9c0010dd02006820105ac000c0431b189bb2e4 -:104cac00d808121866321278d2b2072003401a4183 -:104cbc00d30711d43c4a7423d05cc0b2002852d123 -:104ccc000233d25a92b28c782409cb781b0123433d -:104cdc009a4223d0023021e0334a7823d05cc0b210 -:104cec001ce0314a7423d05cc0b200283dd10233a1 -:104cfc00d25a92b28c782409cb781b0123439a4266 -:104d0c000cd002300ae003781b09407800011843ec -:104d1c00264b9c46604443425841400070bd224a99 -:104d2c00137b1020834313730a7812094b781b01f1 -:104d3c0013431ed11c4b1b7f022b03d01a4b5b7fe2 -:104d4c00002b02d0184b1b8819e0174a7833d05c23 -:104d5c00c0b2e3e7144a7823d05cc0b2dee700208f -:104d6c00dce70220dae70020d8e70020d6e70020b5 -:104d7c00d4e70d4a12881205120d9342ead00a4a62 -:104d8c007423d05cc0b20028f1d10233d25a92b253 -:104d9c008c782409cb781b0123439a42bed0023075 -:104dac00bce7c046ac840000cc10002001f0ffff33 -:020000040000fa -:104dbc0070b584b00023039309336b440a226a4410 -:104dcc0003a901a801f03ef8002801d004b070bd81 -:104ddc0003f038fa0028f9d101998b7aca7a1202b9 -:104dec001a430b7b1b041a434b7b1b0613434a4a87 -:104dfc001278d2b21978914204d3474a1278d2b2bf -:104e0c00092a2bd9444a117819701378dbb2092b73 -:104e1c0024d9424b5b7e002b09d001990398027870 -:104e2c00120943781b0113430b721b0a4b720023ac -:104e3c00394a1370394a5376039a13781b09507800 -:104e4c0000011843fef7a2f909236b440a226a44b5 -:104e5c0003a901a800f0f6ffff28b7d0039a9178b8 -:104e6c000f230b40012b26d00124062b23d003f05b -:104e7c00e9f90028aad1294d2c7601232b7403f0d3 -:104e8c00cafb002003f022fc254bab60012003f091 -:104e9c001dfc039b6b61180003f030fc002803d051 -:104eac001d4b1b78002b15d00a236b4419880398d3 -:104ebc0001f03cf98ae709236b441b780224002b90 -:104ecc00d5d013781b09547824011c4363425c41f0 -:104edc000134cce7039802f011fa039e7379b4798c -:104eec0024021c4325000935adb2023d751902227e -:104efc002900684603f086fb6b461a88023ca0b278 -:104f0c003018092102f0aefe6b46991c0880022273 -:104f1c00280003f077fbc7e7b9130020cc10002062 -:044f2c00c15b000065 -:020000040000fa -:104f300070b505003f4b404a5a80404a136a04212d -:104f40000b4313623e4c23680226b3432360010bdc -:104f500000053c4a002302f059fd404280b2a08186 -:104f6000394b2360394b636023683343236022004d -:104f7000d369002bfcd1324b00249c7504229a7516 -:104f8000334bc22080001a5832491140c02212020d -:104f90000a431a50802292001a602900294800f022 -:104fa000a5f980b22c4b1880224b2c4a5a80234af8 -:104fb000116adb0c0b431362294b1c801a00d37b54 -:104fc0005bb2002bfbdb264a602313805c3b5371f2 -:104fd000214b198889b20b035b1a9b005b1a9b005b -:104fe000013b9bb213820020507301235373184b73 -:104ff000c424a4001a591b491140c02212040a43b8 -:105000001a518022d2021a600c4a536920210b43a4 -:105010005361154a154b5a631549996315495961ee -:105020003f2158541449596414491180144a1a8074 -:1050300070bdc046000c0040144000000004004059 -:1050400000080042006cdc02040112400002030070 -:1050500000e100e0ff00ffffa41300201b40000060 -:10506000002c0042ffff00ff081300200048004111 -:105070001813002081818181000280000904000052 -:04508000020f00001b -:020000040000fa -:1050840010b5424b1888642358430a2100f02cf9c8 -:10509400c0b23f4b1b681a78824200d218703d4b55 -:1050a4001888642358430a2100f01ef9c0b2384b13 -:1050b4001b689a78824200d29870002003f00afba1 -:1050c400354b1b685a1c46d0344a934202d3344aa7 -:1050d400934204d30821ff31324801f057fb2e4b91 -:1050e4001868314b1c68a0422ed9041b012003f020 -:1050f400f1fa6006001b80000019c000001b80004c -:105104002a4b9c4660449621ff3100f0edf8c0b272 -:105114001f4b1b68da78824200d2d870244b19687e -:10512400002906d007221d4803f070fa204b002204 -:105134001a60002003f0cefa1e4b1b78012b15d009 -:10514400012003f0c7fa10bd9630ff30041b012084 -:1051540003f0c0facde7184b18689630ff30124bb5 -:105164001c68041b012003f0b5fac2e7114b0022ae -:105174001a700d4b1968104b1868fbf7f1fa0028e8 -:10518400ded0f721074801f001fbd9e7a81300207e -:1051940070130020aa13002074130020740b002045 -:1051a400090d0020b07e000068130020349e00002a -:0c51b40060130020a90f002064130020ed -:020000040000fa -:1051c000f0b5de4657464e464546e0b5a3b006006c -:1051d000434a6c23d35cdbb20020012b78d8002536 -:1051e0006b465f1d0023984624e03d4c6d23012251 -:1051f000e25403f077fa20676c230222e254384a23 -:105200006c23d35c032b62d013881b0b1b0301217f -:105210000b4313800122334b1a8001233370002388 -:105220007370300000f0d8ffff2846d1042d48d815 -:105230000135edb26b461a8810235b4213436a4670 -:10524000138093780f229343032213436a4693708b -:105250000123137143463b707b700024204b9a4618 -:105260006c23994653464a469b5cdbb2012bc6d859 -:105270006946300000f0d0f903f0a2f90028fbd114 -:1052800000f0c8fa03f02efa834603f02bfa5b46cf -:10529000c01a0128f9d90134e4b203f0ebf8002870 -:1052a000e0d1052cded80e4a13881b0b1b0313809c -:1052b00003f090f9042ca2d897e70a4b188880b223 -:1052c00006e01c21ff31084801f062fab0e7002037 -:1052d00023b03cbc90469946a246ab46f0bdc046c2 -:0c52e000cc100020b61300205880000005 -:020000040000fa -:1052ec00002243088b4274d303098b425fd3030a19 -:1052fc008b4244d3030b8b4228d3030c8b420dd32c -:10530c00ff22090212ba030c8b4202d312120902b9 -:10531c0065d0030b8b4219d300e0090ac30b8b42f7 -:10532c0001d3cb03c01a5241830b8b4201d38b03a5 -:10533c00c01a5241430b8b4201d34b03c01a52414a -:10534c00030b8b4201d30b03c01a5241c30a8b428d -:10535c0001d3cb02c01a5241830a8b4201d38b0278 -:10536c00c01a5241430a8b4201d34b02c01a52411c -:10537c00030a8b4201d30b02c01a5241cdd2c3098e -:10538c008b4201d3cb01c01a524183098b4201d30a -:10539c008b01c01a524143098b4201d34b01c01af5 -:1053ac00524103098b4201d30b01c01a5241c3086d -:1053bc008b4201d3cb00c01a524183088b4201d3dc -:1053cc008b00c01a524143088b4201d34b00c01ac8 -:1053dc005241411a00d20146524110467047ffe734 -:1053ec0001b5002003f0d4f902bdc0460029f7d066 -:0453fc0076e7704799 -:020000040000fa -:10540000f7b58a8905000c0013075dd44b68002ba3 -:1054100004dc0b6c002b01dc0020febde76a002fd2 -:10542000fad000232e682b6080235b011a4034d011 -:10543000606da3895b0706d56368c01a636b002b98 -:1054400001d0236cc01a0200216a00232800e76af9 -:10545000b847a189431c06d12b681d2b31d82c4a93 -:10546000da40d3072dd50023636023692360cb0482 -:1054700005d5431c02d12b68002b00d16065616b00 -:105480002e600029c8d023004433994202d028005e -:1054900001f01cf800206063bfe70123216a2800a7 -:1054a000b847431cc5d12b68002bc2d01d2b01d09f -:1054b000162b01d12e60afe74023a2891343a381ad -:1054c000abe740230b43fae70f69002fa4d00b682a -:1054d0000f60db1b01930023920700d14b69a3608f -:1054e000019b002b00dc97e7019b3a00216a280012 -:1054f000a66ab047002806dc40230120a28940426a -:105500001343a38189e7019b3f181b1a0193e7e727 -:045510000100402036 -:020000040000fa -:10551400002020202020202020202828282828207f -:105524002020202020202020202020202020202077 -:1055340020881010101010101010101010101010df -:1055440010040404040404040404041010101010cf -:105554001010414141414141010101010101010199 -:1055640001010101010101010101010110101010eb -:10557400101042424242424202020202020202026b -:1055840002020202020202020202020210101010bf -:1055940020000000000000000000000000000000e7 -:1055a40000000000000000000000000000000000f7 -:1055b40000000000000000000000000000000000e7 -:1055c40000000000000000000000000000000000d7 -:1055d40000000000000000000000000000000000c7 -:1055e40000000000000000000000000000000000b7 -:1055f40000000000000000000000000000000000a7 -:105604000000000000000000000000000000000096 -:015614000095 -:020000040000fa -:025616007047db -:020000040000fa -:10561800f0b5c64600b584b005000c000b79292bff -:105628004dd823780f22934323702a786b781b0276 -:1056380013434bd01b051b0d0f221a401101a078f4 -:105648000f2202400a43a2701b09e3706379a27912 -:1056580012021a43161c92b2802a00d98026b6b2ca -:10566800330009339bb29846200003f049f8310013 -:10567800002800d14146023989b2234a200002f0ad -:10568800f3fa03902000fff7c5fa0700a2780f236a -:105698001340012b1fd00022062b1cd00192009032 -:1056a8004346039a21002800faf712fdff2802d08a -:1056b8000020012f24d104b004bc9046f0bd134a49 -:1056c8006c23d35c012bacd0ff20f4e70f4b1b8875 -:1056d8001b051b0db0e7002f05d02278120963784f -:1056e8001b01134305d1094a7823d35c0022022bfe -:1056f800d4d1064b1a7bd2b20a36b3b29846cde75c -:10570800fff758fb0020d6e7ffff0000cc10002071 -:020000040000fa -:1057180070b5354b354a5a8035498b694022134359 -:105728008b61344b4720002119541d5c40263543ba -:105738001d543930986058613a3819541c5c344308 -:105748001c549a605a6104329954985c042420438a -:10575800985410259d61123a985c0324204398546c -:1057680045201954195c0126012421431954995cd8 -:10577800302001439954204c082323706670a3708d -:105788000133e37026716371e279a3795b08d20172 -:105798009b181a4a944663441a78d2b21a700020a9 -:1057a80001f034f8e279a3795b08d2019b18134a17 -:1057b800944663441a78d2b21a70012001f026f890 -:1057c8000f4ac12189005358ff2083433f380343c0 -:1057d800535015600b4a137802210b4313700a4883 -:1057e800fff7a2fb70bdc046000c0040054000005a -:1057f80000040040004400414013002030440041b0 -:0c58080000e100e00018004040420f00ea -:020000040000fa -:1058140070b50400284a6423d35a9bb2002b0ed0df -:105824000022254900256420d3009b1a5b00cb1875 -:10583400dd830132d2b20b5a9bb29342f4d81f4b90 -:105844001f4a13601f4a136009331f4a136000255f -:105854001e4b1d80282200211d4802f009ff1d4b0c -:105864001d80502200211c4802f002ff1b4b1d80aa -:10587400a02200211a4802f0fbfe1a4b1d601a4bad -:105884001d601a4b012252421a600022184b1a70f2 -:10589400002c01d0174b1c6002f04afe064b762206 -:1058a40000219952753a74315a5404315a540022e1 -:1058b400114b1a7070bdc046cc100020740b002030 -:1058c400641300206c13002068130020a813002028 -:1058d40020120020a6130020a8110020aa130020e3 -:1058e400ac0f0020601300207813002074130020f4 -:0c58f400a90f0020701300209713002063 -:020000040000fa -:1059000010b504000078c0b202f050fe2f4a138890 -:1059100001339bb21380032b1bd0072b27d0012b05 -:1059200004d02b49200002f053fb10bd01f0def93a -:1059300008225242d31780185941264b18605960eb -:10594000254b09321a7400221a76214b013a1a802b -:10595000e7e7224b1868fff761f90028e1d1204bf7 -:10596000198800f0d1fe1c4b1e4a9a60dde7174be8 -:1059700000221a80184b1c4a9a60184b1b685a79ef -:10598000997909020a43802a11d85a799b791b0216 -:105990001343134a1380104b1b7b5b060dd4104b33 -:1059a00019880029bdd0012000f0aefeb9e70c4bec -:1059b00080221a8001f07cfcede7094b1988002059 -:1059c00000f0a2fe044b074a9a60aee7ae13002037 -:1059d000ac13002028130020cc10002064130020fa -:0c59e000b013002017560000c13e00006c -:020000040000fa -:1059ec00364b70b51d6806000c00002d05d0ab6958 -:1059fc00002b02d1280001f07ffa314b9c420fd1d1 -:105a0c006c680c23e25e93b219072dd4d90611d41d -:105a1c0009230120336037331343a381404270bd07 -:105a2c00284b9c4201d1ac68ebe7274b9c42e8d158 -:105a3c00ec68e6e75b0713d5616b002908d02300ff -:105a4c004433994202d0300000f03afd00236363e6 -:105a5c002422a3899343a3810023636023692360d9 -:105a6c000823a2891343a3812369002b0bd1a02106 -:105a7c008022a389890092000b40934203d021001d -:105a8c00300000f0d3fc0123a289134011d0002375 -:105a9c00a36063695b42a361002023698342bed18a -:105aac000c23e25e1306bad540231343a3810138bd -:105abc00b5e7920700d46369a360ede78413002077 -:0c5acc0068120020881200204812002000 -:020000040000fa -:105ad80070b583781b071b0fdab2062a03d89b0020 -:105ae800324ad3589f4600205ae0314a6423d35a99 -:105af8009bb2002b55d003781b0941780901194343 -:105b0800138c9bb2994246d00023150064241600da -:105b180001339bb22a5b92b29a423ed91800da004e -:105b2800d21a5200b218128c92b28a42f0d1c30033 -:105b3800181a40001e301e4bc01831e01c4a64235e -:105b4800d35a9bb2002b2ed003781b094178090148 -:105b58001943d38b9bb2994219d0002315006424b2 -:105b6800160001339bb22a5b92b29a4211d91800ef -:105b7800da00d21a5200b218d28b92b28a42f0d10d -:105b8800c300181a40001e30094bc01808e0002056 -:105b9800f6e7002004e00020c9e7002000e00548ff -:105ba80070bd0020fce70020fae7c04690840000a2 -:085bb800cc100020ea100020cf -:020000040000fa -:105bc000f8b50700304b5869304a11884b1c9bb21e -:105bd00013803a78d2b2415c914217d12a4a127ca2 -:105be000002a13d0284a127b52060fd4042b33d13b -:105bf000002002f005fa002001f062fe224b1b7e1d -:105c0000022b3cd0204b224a9a6029e01e4b0122f5 -:105c10005a76002001f04efc1c4b1b88012b0ed93c -:105c20000024194e194d736918782018c0b202f07b -:105c3000bdfc0134e4b22b88013b9c42f3db387895 -:105c4000c0b202f0b3fc104b114a9a6002221a76dd -:105c50000e4b1b88022b04d80e49380002f0b8f90d -:105c6000f8bd0d4b1868fef7d9ff0028f4d10b4b97 -:105c7000198800f049fd044b094a9a60f0e7024b8d -:105c8000084a9a60ece7c046cc100020ae13002012 -:105c900001590000ac13002064130020b013002051 -:085ca00017560000e17e000030 -:020000040000fa -:105ca800f7b5150001938a680b6900900c009342c0 -:105cb80000da130022002b6043321278002a01d048 -:105cc80001332b6023689b0602d52b6802332b60b7 -:105cd800062723681f4027d0230043331b785a1e0a -:105ce80093412268920630d42200019943320098e9 -:105cf800089eb047431c25d0062320682a68e1681f -:105d080003400025042b03d18d1aeb43db171d40fc -:105d1800a3682269934201dd9b1aed180027bd4252 -:105d280020d1002010e00137e3682a689b1abb42a3 -:105d3800d2dd22000123193201990098089eb0474c -:105d4800431cf0d101204042febd3020e118433110 -:105d5800087021005a1c45310978a21843320233d1 -:105d68001170c1e7220001231a3201990098089e98 -:0a5d7800b047431ce6d00137d1e725 -:020000040000fa -:025d8200704768 -:020000040000fa -:105d8400f8b505000e001400002804d08369002b28 -:105d940001d101f0b5f8294b9c4234d16c68a36958 -:105da400a360a3891b0738d52369002b35d00c23a6 -:105db400e25e80239b01f7b2f6b21a4236d0236822 -:105dc4002269981a6369834205dc2100280001f0e6 -:105dd400c5fa002827d1a3680130013ba3602368da -:105de4005a1c22601f706369834204d0a389db07b5 -:105df40007d50a2e05d12100280001f0affa0028aa -:105e040011d13000f8bd0e4b9c4201d1ac68c6e7fd -:105e14000c4b9c42c3d1ec68c1e721002800fff77a -:105e2400e3fd0028c3d001267642eae71343a381a9 -:105e3400226e054b13402366c1e7c046681200205a -:0c5e44008812002048120020ffdfffff42 -:020000040000fa -:105e5000f8b506000f0015001c00244b1b889bb2f0 -:105e6000092b1fd8224b1968002906d00722214888 -:105e700002f0cefb1e4b00221a60002002f02cfc28 -:105e80001d4b1b78012b12d0012002f025fc1b4b6f -:105e90001b78002b1bd1154b1b889bb2ff20002bbe -:105ea00018d1f8bd1649174800f072fcdae7124b1a -:105eb00000221a70144b1968144b1868faf752fc38 -:105ec0000028e1d0f7210f4800f062fcdce702f087 -:105ed00083f9e0e70e4b1a683a609a882a809a683c -:105ee00032601b7b23700020dbe7c046aa13002032 -:105ef00060130020740b0020a90f002097130020ce -:105f00000b070000b07e000068130020641300201f -:045f1000ac0f0020b2 -:020000040000fa -:105f1400f0b5de4657464e464546e0b583b00090a0 -:105f24000c0001929b46012399465b46802b08d9bd -:105f3400da09d1010123594500db00239bb29946bc -:105f4400914400239a460025f427ff3707e045448f -:105f5400adb2534601339bb29a4699452ad05b466b -:105f64005b1b80229046802b03dc5b465b1b9bb251 -:105f74009846e01d019b5919424602f047fb5b46d7 -:105f84005b1b9bb263711b0aa37102f0a9fb0600a1 -:105f94002100009801f0bcfbff28d8d1fcf78efa51 -:105fa40002f09efb801bb842f2d90649064800f075 -:105fb400edfbede703b03cbc90469946a246ab46e8 -:0c5fc400f0bdc046eb020000507e000063 -:020000040000fa -:105fd000f8b50323cd1c9d43083506000c2d1fd2b8 -:105fe0000c25a9421ed8300002f0e0fb25490a68c2 -:105ff0001400002c1ad1244f3b68002b04d121003f -:10600000300002f0d1f938602900300002f0ccf9fc -:10601000431c2ad10c233000336002f0c8fb03e09c -:10602000002ddeda0c2333600020f8bd23685b1bf3 -:1060300018d40b2b03d92360e418256003e06368b0 -:10604000a2420dd10b60300002f0b1fb200007220c -:106050000b30231d9043c21ae7d01b1aa350e4e76c -:106060005360f0e722006468c3e70323c41c9c4329 -:10607000a042e2d0211a300002f096f9431cdcd194 -:0c608000c8e7c046881300208c130020e5 -:020000040000fa -:10608c00f0b5c64600b582b0254b1b889bb2002be1 -:10609c0042d00024234f16263a0021490ce0db2184 -:1060ac0021484900103000f06dfb19e00134a4b216 -:1060bc000b889bb2a3422fd9019433006343db5d61 -:1060cc00012bf3d133006343d3185d789b781b020b -:1060dc002b438342ead1124b1b889bb2a342ded9dd -:1060ec0016277c430e4b98461a880e4ea019019d1c -:1060fc000135521b7a431634a11902f083fa434638 -:10610c001b88013b9bb24246138010887843801950 -:10611c001622002102f0a8fa02b004bc9046f0bd91 -:0c612c009e130020040800207c78000076 -:020000040000fa -:1061380070b504001d480122037e1342fcd04b1e9b -:106148009bb21b4a1380012917d81a4d1a482b886d -:10615800028a92b219015b1a18498c466344934229 -:10616800f5da012001f0a2f92278104b1a850222f3 -:106178009a75142001f0a0fb70bd114b1c600c4bec -:1061880000221a8064180f4b5c600f4a9a6059808d -:10619800012001f08bf90d4940228b5c022003435a -:1061a8008b543e3a014b9a75e3e7c046000800421b -:1061b800a2130020a4130020002c0042feff0000c0 -:1061c8005c13002008130020280800420048004102 -:020000040000fa -:1061d800f0b5a3b00400244d244e00f05bfe002867 -:1061e80040d10023237263726b469b780f2293433e -:1061f800062213436a46937012880f231340102215 -:1062080013436a461380002313716b4600225a71a8 -:106218009a7169462000fff7fbf902f0cdf9ff28d3 -:10622800fbd0227a637a1b0213430bd00e4a137fea -:106238005b00d318012149425980022313770023b8 -:106248005377cae702f04afa07006b7f002bc4d0e5 -:10625800fef77ef902f042fac01bb042f5d9ff20e2 -:1062680023b0f0bd0020fbe7cc100020b80b0000e5 -:020000040000fa -:10627800f0b5420046024d024c00c30f760a120eda -:106288006d0a240ec80fff2a1fd0ff2c10d0002a39 -:106298001fd171427141002c01d1002d1ed000295f -:1062a8000ed183421ed00221581e08400138f0bd8d -:1062b800002d26d1002af4d1714271410029f0d075 -:1062c8000028f4d101204042f1e7002e19d1ff2c1b -:1062d800eed0002ce5d1002de3d1e4e70020002e1c -:1062e800e5d0e0e7a24205dceadbae4202d8e7d31c -:1062f8000020dce741424141484202210840013880 -:08630800d5e702204042d2e774 -:020000040000fa -:1063100000b583b0142001f0d3fa1f4b1b7e5b073e -:1063200016d51d4b9b7d5b0712d51b4b1b8d6a46fb -:10633000d01d0370194b9b689847194b1b889bb263 -:10634000002b0ed1144b07225a8301321a7615e026 -:10635000114b5b8b9b0704d5104a137b40210b43e9 -:1063600013730d4b1b7e9b0703d50b4b9b7d9b072c -:1063700006d4094b07225a8301321a7603b000bdb6 -:10638000002001f097f8012001f03afe024b0222b2 -:106390001a761a75ede7c04600080042cc100020be -:0463a000a213002024 -:020000040000fa -:1063a400f0b5420046024d024c00c30f760a120ead -:1063b4006d0a240ec80fff2a0dd0ff2c0fd0002a1f -:1063c40023d171427141002c0fd1002d0dd1002039 -:1063d400002e14d00de0002e10d1ff2c15d1002d6d -:1063e4000cd1002a03d171427141002908d18342a2 -:1063f40010d00221581e0840013800e00220f0bdf0 -:106404000028fcd101204042f9e7002cefd1002df7 -:10641400edd1eee7a24205dcf2dbae4202d8efd3c7 -:106424000020ece741424141484202210840013842 -:04643400e5e7c04692 -:020000040000fa -:10643800f7b502268b8905000c00334206d00b0005 -:1064480047330b600b6101234b61f7bd01ab6a4613 -:1064580001f07cf8009907002800fff7b5fd002837 -:106468000ed10c22a35e9a05efd4032293431e4358 -:1064780023004733236023610123a6816361e4e796 -:106488000f4bab628023a28920601343a381009b3a -:1064980020616361019b002b0dd00e23e15e280073 -:1064a80001f0b4ff002806d00322a38993431a0001 -:1064b80001231343a381a0893843a081c5e7c046bf -:0464c80085860000c5 -:020000040000fa -:1064cc0070b50500002910d00c1f2368002b00dad2 -:1064dc00e418280002f064f91d4a1368002b05d15a -:1064ec0063601460280002f05cf970bda34209d906 -:1064fc00216860188342f3d118685b6841182160e9 -:10650c00eee713005a68002a01d0a242f9d91968a3 -:10651c005818a0420bd120680918581819608242eb -:10652c00e0d110685268411819605a60dae7a0424d -:10653c0002d90c232b60d5e721686018824203d165 -:10654c00106852684118216062605c60cae7c046fe -:04655c008813002080 -:020000040000fa -:10656000f0b5c6461f4a204b00b50021934203d226 -:10657000197001339342fbd10b231c4a9c46083b04 -:1065800098461368546819000026214311d017005b -:1065900091680c3700290fd11a19002c03d01e70f6 -:1065a00001339342fbd13a00136854681900214328 -:1065b000edd104bc9046f0bd6146c91a1d195118b1 -:1065c000002c05d05a1c505c187013009542f9d16c -:1065d000434623405a1e9341a4081c19a4003f19a6 -:1065e0003a00e1e704000020000000207c130000d6 -:020000040000fa -:1065f000f0b5194ca54405000f0016000400ff215a -:106600008022d2008902684602f002f8134bff2272 -:106610005202da61124a1a801249d9611a8012496b -:10662000d9611a801149d9611a80114be818684460 -:106630003a00310001f0ecff6a4628004030117842 -:1066400002c401328442fad16d08044bdd61094a6b -:106650001a80094b9d44f0bdfcfbffff0040004148 -:1066600002a5ffff80fe010000ff010080ff010086 -:0c66700000fcfbff04a5ffff0404000079 -:020000040000fa -:10667c0070b504000d00194b1968002906d00722cb -:10668c00174801f0bfff154b00221a60002002f0e2 -:10669c001df8144b1b78012b09d0012002f016f8c1 -:1066ac00114b1b889bb2ff20a34210d870bd0d4b21 -:1066bc0000221a700d4b19680d4b1868faf74cf83c -:1066cc000028ead0f7210b4800f05cf8e5e7e4007d -:1066dc00094b1c1963682b600020e7e7601300204e -:1066ec00740b0020a90f0020a613002068130020b3 -:0c66fc0064130020b07e0000a8110020f4 -:020000040000fa -:10670800012804d0174b1a68174b1a607047154bad -:106718001b6809315818154a90421ad8114b1b6842 -:106728005918134a1160134a126893420dd89142be -:106738000bd3104b00221a600f4b1a681379ff2bea -:1067480003d0013313716423d3700c4b01221a70e8 -:10675800dce70b4a13600b4b024a13600733024a0b -:106768001360dbe7641300206c130020080d002081 -:10677800681300207813002070130020a90f002050 -:0867880060130020740b0020d7 -:020000040000fa -:1067900010b5a4b00400019101f01cff0020fff728 -:1067a00039f802ab9a780f218a4303210a439a7081 -:1067b0001988102252420a431a8004221a712000ba -:1067c00001f077ff031d0d226a449bb213701b0a70 -:1067d0005370042201a90f20684401f019ff200022 -:1067e00001f067ff020021001320684401f010ff50 -:1067f00002a9002000f08eff0028f9d101992000a5 -:1068000001f08bfe01f0dcfeff28fbd0002001f040 -:0468100063fffee73d -:020000040000fa -:1068140030b51c49430018180c186278405cd2014a -:10682400194b9c466244131840330021197019789f -:106834000125294319701978042529431970012366 -:1068440083405361a478072c16d8a00000239b0032 -:106854000e4a944663449a69072181408a439a61a7 -:106864009d69012211008140294399611300a340cd -:1068740062461361d36030bd2000083880000123d4 -:10688400e5e7c046401300200044004100180040e2 -:020000040000fa -:1068940010b5174b1b78012b0fd0164b1b68164aeb -:1068a40013600933154a1360154a934216d2154be7 -:1068b400104a12689a4217d010bd0d4b00221a706c -:1068c4000d4b19680b4b1868f9f74aff0028e4d000 -:1068d400d02149000c48fff759ffdee7b821ff310a -:1068e4000948fff753ffe2e7084b00221a60e3e789 -:1068f400a90f0020641300206c13002068130020eb -:10690400090d0020740b0020b07e000060130020ed -:020000040000fa -:10691400194b00229a619a8c80218a439a841a0026 -:106924001023d1680b42fcd0144b1a68920e3f2af4 -:106934001fd0134b1b689b059b0d920213430e4af9 -:1069440093621023d1680b42fcd00b4b02229a8431 -:106954001a001023d1680b42fcd00a4b0a4a5a6031 -:106964001a0053785bb2002bfbdb034b00221a6244 -:106974007047203adde7c0460008004024608000ec -:0c69840028608000000c004000070100ab -:020000040000fa -:10699000f0b5d64600b584b0002302aad37102aa8e -:1069a00093710632184b1b68002b27d0a2252d02ad -:1069b0000027154e019215e0e3005246da4013001d -:1069c00002aa9371072202abd91d019801f00efab9 -:1069d0000137631cdbb2032b08d904350a4b1b6853 -:1069e000bb420bd92b689a46002400e0013433687f -:1069f000bb42e1d8631cdbb2032bf7d902abd879d9 -:0c6a000004b004bc9246f0bdc41200209b -:020000040000fa -:106a0c00f8b51c4b1b889bb2002b31d000231a4dc0 -:106a1c0016240f27174e05e001339bb2328892b231 -:106a2c009a4225d922005a43525d022af4d12200ff -:106a3c005a4311498c466244517892783a4012027a -:106a4c000a438242e8d101339bb216225a43614673 -:106a5c00525c012a0cd1654616265e438c1962786d -:106a6c00a07800021043fff70bfb725d012af6d0f1 -:0c6a7c00f8bdc0469e1300200408002056 -:020000040000fa -:106a880030b51b49430018180c186278405cd201d5 -:106a9800184b9c466244131840330021197019782a -:106aa80001252943197019780425294319700123f0 -:106ab80083405361a178072915d8880000239b00db -:106ac8000d4a944663449a6907248440a2439a6114 -:106ad8009c690222824022439a6101238b406246cc -:106ae8001361d36030bd0800083880000123e6e751 -:0c6af80040130020004400410018004042 -:020000040000fa -:106b0400f0b5c64600b51a4e430018183518ab78d0 -:106b1400012422009a40174b9a601a616a78875db3 -:106b2400d201154b9c4662449046d3194033002150 -:106b34001970197802229446624611431970197823 -:106b4400042294466246114319702300bb40424616 -:106b54005360815d6b788c40db01074a9446634443 -:106b64005c611b6acb400120184004bc9046f0bd18 -:0c6b7400401300200018004000440041c5 -:020000040000fa -:106b8000f8b51c4b07001e68b369002b02d130001a -:106b900000f0b8f94836b4687368013b04d533682f -:106ba000002b1cd03668f6e70c22a55e002d14d110 -:106bb0002000114b256625606560a560e3602561b6 -:106bc0006561a56108222900583001f053fd656315 -:106bd000a563a564e5642000f8bd6434dde7042105 -:106be000380001f04ffa041e3060dbd10c233b600b -:0c6bf000f1e7c046a08700000100ffff95 -:020000040000fa -:106bfc00f0b585b001900e00140001f045fd0128a0 -:106c0c000bd1731efe2b08d8050002ab1e7100279a -:106c1c00af4212d1300005b0f0bd23003200583322 -:106c2c0003a9019801f054fa0500431cefd140234d -:106c3c00a2891343a3810600ece703abd95da368db -:106c4c00013ba360002b04daa269934207db0a29fb -:106c5c0005d023685a1c226019700137d8e722002e -:0c6c6c000198fff789f8431cf7d1e4e71a -:020000040000fa -:106c78008446081c6146ffe71fb5fff78ffb002815 -:106c880001d40021c8421fbd10b500f037fc4042b6 -:106c9800013010bd10b5fff781fb002801db002093 -:106ca80010bd012010bdc04610b5fff777fb0028c6 -:106cb80001dd002010bd012010bdc04610b5fff752 -:106cc800d7fa002801dc002010bd012010bdc04605 -:106cd80010b5fff7cdfa002801da002010bd012019 -:046ce80010bdc046d5 -:020000040000fa -:106cec00f0b5184b5e689b68f61ab3009e19b60097 -:106cfc00154b1e60154a12680025140019695a6953 -:106d0c00641a95419c60dd60e30e690119436001d2 -:106d1c00001ba941c70d4b023b43420212196b41a8 -:106d2c0010001900970e8b013b438201121a8b4104 -:106d3c0010001900001969410023320080185941d4 -:106d4c00f0bdc04610e000e0c8120020581300202f -:020000040000fa -:106d5c00f0b5ce46474680b5421ed41707232340d4 -:106d6c009b18db109bb2154c6822a352002921d032 -:106d7c0000226827072399460125e35bdb00db43f0 -:106d8c00c318d3189bb2de08b446a4446626b0469a -:106d9c00c44466463678b0464e4633402e009e407c -:106dac00330046463343dbb266463370013292b24f -:106dbc009142e2d10cbc90469946f0bdcc1000201b -:020000040000fa -:106dcc0070b5154b1d88002d21d0144b98421cd04a -:106ddc00134c002301339bb29d4205d022003d325f -:106dec00844203d01400f5e7ff200de00d4a9342d6 -:106dfc000fd01801c018ff239b029c4660440a0068 -:106e0c001021fff7effb002070bd0023f1e7ff20fe -:106e1c00fae7ff20f8e7c0469c130020780e00200c -:086e2c00b50e0020ffff00007d -:020000040000fa -:106e340022250000222500004c2500002225000008 -:106e44002c2500004c2500004c2500004c2500009a -:106e54004c2500004c2500004c2500004c2500006a -:106e64004c25000048250000482500004825000066 -:106e7400482500008a250000482500008a250000d6 -:106e84008a2500008a250000482500004c250000c2 -:086e94004c25000094250000cc -:020000040000fa -:106e9c0010b5184b1b7f022b0dd0164b5b889bb289 -:106eac00002b0fd0134b9b889bb2002b14d001f0fe -:106ebc00b5f9ff2010bd0f4b1b881b051b0d012bbb -:106ecc00f5d1eae7002000f0adf800280ed1094b0f -:106edc00012252425a80e5e7012000f0a3f8002875 -:106eec0006d1044b012252429a80e0e70020e1e7f0 -:086efc000020dfe7cc100020ac -:020000040000fa -:106f0400836913b50400002b28d18364c36403652b -:106f1400134b144a1b6882620193984201d10123e6 -:106f240083612000fff72afe60602000fff726fe41 -:106f3400a0602000fff722fe0022e06004216068c8 -:106f440000f076fc01220921a06800f071fc022205 -:106f54001221e06800f06cfc0123a36113bdc0465c -:086f6400a087000085860000f3 -:020000040000fa -:106f6c00f8b50600144c002700256423e75223884b -:106f7c001b0b1b03238023881b051b0d23802574ef -:106f8c00657625760d4b0e4a1a6001f0cdfa01f0ac -:106f9c0025fb3000fef738fcfef7b8fb01f014fbc4 -:106fac002573237b0f22134323736d23e55427672b -:106fbc00013be554f8bdc046cc1000207c130020ea -:046fcc0040420f0030 -:020000040000fa -:106fd000f0b5ce46474680b58946134d01242b7d3a -:106fe0002342fcd000244f460f4d104b98460126fb -:106ff00005e01c0043462b802b7d3342fcd0a1458d -:107000000ed913195908e9611b6808c0231d4034c3 -:107010009f42eed9d15802c00433a342f8d1e9e728 -:107020000cbc90469946f0bd0040004104a5ffff0e -:020000040000fa -:1070300070b5040000f0cafc01f054fb050001f03b -:1070400051fb401b0128fad92000fff7e3fb01f0b8 -:1070500049fb401b0228fad962000b4b9b18012206 -:1070600052425a802000fff74dfd002800d170bd2c -:107070002000fff709fd0122044b1a70024b1c7718 -:107080005a770120f3e7c046cc100020b813002047 -:020000040000fa -:1070900010b5164b64215c5ae200121b52009a187c -:1070a0001084585ac200121a52009a180020d08335 -:1070b0005c5ae200121b52009a18d084585ac2003f -:1070c000121a52009a181000148d00241485528d43 -:1070d000002242855a5a92b2501c80b25852d000b7 -:1070e000801a40001e30181810bdc046cc10002079 -:020000040000fa -:1070f00070b5134b1b78002b14d0012b1ad0fbf763 -:10710000dff9104b1b88002b13d000240e4e0d4dc1 -:10711000e300f3185b6898470134a4b22b88a342bc -:10712000f6d806e000f0fafd00f030fc044b012236 -:107130001a7070bdfbf7c4f901f0e2f9f9e7c04637 -:0c714000090d00209a130020f811002017 -:020000040000fa -:10714c0010b5144b1b7e012b06d0124b1b7e022b51 -:10715c000ad0fdf72dfe10bd00230f4a13700d4a07 -:10716c005376fcf73bfcf4e70b4a13780133dbb2a4 -:10717c0013701078074c23881b051b0d01335843e3 -:10718c001423584380b200f095fb01232374002391 -:0c719c002376e0e7cc100020b91300209f -:020000040000fa -:1071a800480e00006a1300006a1300006a1300000a -:1071b8006a1300006a1300006a1300006a130000d3 -:1071c8006a1300005a0e0000301000005c12000024 -:1071d800dc12000028110000a81100007e10000039 -:1071e800d4100000f81100004e1300006a130000cc -:0871f8006a13000044130000bb -:020000040000fa -:10720000f0b5134b188880b200281fd0002300204f -:10721000104e16240f270e4d05e001339bb22a882d -:1072200092b29a4212d922005a43925d022af4d1b4 -:1072300022005a4307498c466244517892783a407a -:1072400012020a438242e8dd1000e6e7f0bdc046c4 -:087250009e1300200408002039 -:020000040000fa -:10725800f0b5134b188880b2002820d000230020f6 -:10726800104f16240e4d06e0b0b201339bb22a88a7 -:1072780092b29a4213d922005a43d25d012af4d11c -:1072880026005e43074a944666447178b278120233 -:107298000a43161c92b28242e6d2061ce4e7f0bd0d -:0872a8009e13002004080020e1 -:020000040000fa -:1072b00010b5114b1a685379927912021343802b3f -:1072c00014d90e4b1b88002b0fd10b4b1a68537926 -:1072d000917909020b43db0908490b8051799279b6 -:1072e0004a0602d00133054a138010bd04490548ff -:1072f000fff74efae5e7c04664130020b213002002 -:0873000082020000107f000072 -:020000040000fa -:10730800f0b585b0427983791b02134309339bb2e8 -:1073180000240025009401950a3bc4180822210086 -:1073280002a801f071f9fff7ddfc029e039fb94244 -:107338000dd80ad00020002100900191082269464a -:10734800200001f061f905b0f0bdb042f2d9fff7b5 -:08735800c9fc801bb941efe7fd -:020000040000fa -:107360000b6970b505000c00002b01d1002070bd29 -:10737000002804d08369002b01d1fff7c3fd0b4b1c -:107380009c4209d16c680c22a35e002beed0210038 -:107390002800fef735f8eae7054b9c4201d1ac68be -:1073a000f1e7044b9c42eed1ec68ece76812002058 -:0873b0008812002048120020a1 -:020000040000fa -:1073b80010b50a784b781b0213438a7812041343da -:1073c800ca7812061a439478d3781b022343c370f1 -:1073d8001b0a03710b784a7812021a438b781b0434 -:1073e8001a43cb781b0613431a785b784270837074 -:1073f80001230370002318310630ca5cc2540133dc -:06740800102bfad110bdab -:020000040000fa -:02740e007047c5 -:020000040000fa -:1074100070b504000d0009290dd9022663290bd986 -:1074200004300b22002101f025f905220c4920002f -:1074300001f0eef810e00126200001f03af90f23e8 -:107440009b1b984209d90022e25405492b002200d7 -:107450000831200000f0d0fb70bd00232354f4e776 -:047460007c78000034 -:020000040000fa -:10746400f0b5114b1b881149002216270e4e05e07a -:10747400013233889bb21631934213db0b78012b14 -:10748400f6d13d005543094b9c4665446c78ab7876 -:107494001b0223438342ebd116205043063062463d -:1074a400801800e00020f0bd9e1300200408002096 -:020000040000fa -:1074b400012815d00f4b442200219954995c0420d3 -:1074c40001439954343a9a6130325a610a48835cd0 -:1074d40002218b438354094b1975383a1a76704745 -:1074e400044b442200219954995c01439954043a71 -:1074f4009a61f4e70044004100480041000800425a -:020000040000fa -:1075040070b542004e024c0045026d0a120ec30fc4 -:10751400760a240ec90fff2a0fd0ff2c11d00120a8 -:10752400a24200d070bdb542fcd18b420dd0002ade -:10753400f8d12800451ea841f4e70120002df1d11f -:10754400ebe70120002eedd1e9e70020eae7c04691 -:020000040000fa -:1075540070b50e001d000e23c95e90b01400002902 -:1075640007da00232b60b3891b0611d48023db00c8 -:107574000fe001aa00f03aff0028f2dbf022029ba0 -:1075840012021340054a9b185a4253412b60ede7ff -:1075940040230020236010b070bdc04600e0ffff10 -:020000040000fa -:1075a400f8b505000f4b1b880f4c00260d4f05e066 -:1075b40001363b889bb21634b34211db2378012b8e -:1075c400f6d1a01d290001f017f80028f0d11623e8 -:1075d4007343054ef6187378b0780002184300e040 -:0c75e4000020f8bd9e13002004080020c9 -:020000040000fa -:1075f000f0b50f4a0023140016270e480be03d009b -:107600005d4365196e78a978090231430180013321 -:107610001632282b08d09db211780129efd000290d -:10762000f5d1054b1d80f0bd034b27221a80fae7e8 -:0c76300004080020a01300209e1300207e -:020000040000fa -:10763c0010b5064c2378002b07d1054b002b02d03c -:10764c00044800e000bf0123237010bda8120020e5 -:10765c000000000000000000044b10b5002b03d00c -:10766c000349044800e000bf10bdc0460000000004 -:08767c00ac1200200000000028 -:020000040000fa -:1076840010b50a4b98470a4b9847fef767ff094b1a -:10769400ff229343084a9360084b9847084b984746 -:1076a400084b984700f0fcfffee7c0465f810000ee -:1076b4005f8100000000000000ed00e0a5770000fd -:0876c4005f8100005f810000fe -:020000040000fa -:1076cc0010b5a2b017236a46137193780f22934317 -:1076dc0001210b436a4693700a4b1a8812016b46c0 -:1076ec001c880f23234013436a4613806b46517149 -:1076fc0000229a716b46d8716946002000f004f89c -:08770c0022b010bd0a0d00209f -:020000040000fa -:1077140010b5002819d0027843781b021a438378e5 -:107724001b041343c07800061843027843781b02f5 -:10773400134302d10b79292b09d8fdf76bffff38ce -:10774400434258414042c0b210bd0248e3e7012021 -:08775400fae7c046780e0020a0 -:020000040000fa -:10775c0010b504000e4b1b78012b02d0002b11d05e -:10776c0010bd00220a4b1a700a4b5a775b889bb2e9 -:10777c00002bf5d0074b9b889bb2002bf0d000f070 -:10778c004dfdede700f01cf9024b1c77e8e7c04615 -:08779c00b8130020cc100020fe -:020000040000fa -:1077a40070b500260c4d0d4c641ba410a64209d1e3 -:1077b4000026f8f77bfc0a4d0a4c641ba410a64271 -:1077c40005d170bdb300eb5898470136eee7b3001e -:1077d400eb5898470136f2e7bc000000bc000000fb -:0877e400bc000000c000000021 -:020000040000fa -:1077ec00f8b50d00096e06001400d718890418d5d9 -:1077fc009f08bf00d719bc4201d1002008e02a0025 -:10780c0002cc300000f021fe431cf4d10120404298 -:10781c00f8bd21782a00300000f086fc0134431cae -:08782c00f4d0bc42f5d1e8e7fd -:020000040000fa -:10783400002310b504000360436083608181036604 -:10784400c28103614361836119000822583000f04a -:107854000fff054b24626362044ba362044be36293 -:10786400044b236310bdc04679820000e57c000010 -:08787400b1800000158700003f -:020000040000fa -:10787c006572726f720000002573256400000000b1 -:10788c002e2e2f2e2e2f2e2e2f2e2e2f2e2e2f2e07 -:10789c002e2f456e67696e652f436f72652f73725d -:1078ac00632f726f7574696e675f7461626c652e9d -:0478bc006300c0465f -:020000040000fa -:1078c0000d4ac0235b008021c902d1500b4a803b86 -:1078d000ff3b93731188013399431180002809d02d -:1078e000074b1b884343db439bb21382138802215f -:1078f0000b4313807047c04600e100e0002c0042bb -:04790000a4130020ac -:020000040000fa -:1079040070b50400012814d0002809d003280cd82d -:107914000b4d6d230122ea5400f0e2fe286704e0d7 -:10792400074b00226d215a541a67054a6c23d4541c -:1079340070bd034b00226d215a541a67f5e7c04607 -:04794400cc10002043 -:020000040000fa -:10794800f7b504000700002601914834002c01d146 -:107958003000febd6368a5680093009b013b00935f -:1079680001d52468f2e7ab89012b08d90e22ab5e5a -:10797800013304d029003800019b98470643643539 -:02798800ebe72b -:020000040000fa -:02798a00704744 -:020000040000fa -:10798c0010b582b001ab02221a7000225a709a70a4 -:10799c00019b0a4a00210020fcf7bafe00f0a2fe6f -:1079ac00040000f0d3fe0470240a0f221440437824 -:1079bc0093431c43447002b010bdc04624860000a3 -:020000040000fa -:1079cc0030b50c49430018180b189c78012215008f -:1079dc00a540094ca56025615b78405cdb0107493b -:1079ec008c4663441918403100240c7082409a6014 -:1079fc009a6130bd40130020001800400044004143 -:020000040000fa -:107a0c00002b11d1002a0fd1002900d1002802d05f -:107a1c000021c943081c07b4024802a14018029077 -:107a2c0003bdc0466d0d000003b4684601b5029855 -:107a3c00fdf71cf8019b9e4602b00cbc7047c0467b -:020000040000fa -:107a4c005442000086410000864100008441000041 -:107a5c008a4100008a41000032420000844100004b -:107a6c008a410000324200008a410000844100003b -:107a7c002e4200002e4200002e4200003c4200002c -:020000040000fa -:107a8c0041024200c30f490a120e00207e2a03d97c -:107a9c009d2a02d9094a9818704780200004014396 -:107aac00952a07dc9620821ad1404842002bf3d14c -:107abc000800f1e7963a9140f7e7c046ffffff7fd9 -:020000040000fa -:107acc0010b50c4b9b7bdb0706d50a4b01229a7336 -:107adc00094b1b7c012b00d010bd00f03bfc002897 -:107aec00fad1fff7e1fc012000f084fa00f042f833 -:0c7afc00f2e7c046002c0042cc10002035 -:020000040000fa -:107b080010b50c4b1a691a690b4b997801238b40f5 -:107b1800134209d1074b1a69074b597901238b4046 -:107b28000120134201d110bd0020024a1361fff762 -:0c7b380011fef8e7001800404013002088 -:020000040000fa -:107b440010b50c4b1b78ff20002b00d110bd0a4b45 -:107b54001b881b0504d1074b00221a700020f5e78f -:107b6400054a13881b0b1b0313800020fdf750feee -:0c7b7400f1e7c04697130020cc10002061 -:020000040000fa -:107b800010b50b4b9a680b4b9a4209d0084b9a6878 -:107b9000094b9a4204d0064a137b20210b431373ee -:107ba000fef778fe00f082f8fff7d0fa10bdc0466d -:0c7bb000cc100020015900001756000006 -:020000040000fa -:107bbc001c2101231b04984201d3000c10391b0a11 -:107bcc00984201d3000a08391b09984201d30009d5 -:107bdc00043902a2105c40187047c046040302022c -:0c7bec0001010101000000000000000089 -:020000040000fa -:107bf8000eb410b500249bb00a4b1daa02ca069306 -:107c08000393094b0190059001a8049319940092dd -:107c180000f0a4fc019b1c701bb010bc08bc03b096 -:0c7c28001847c046ffffff7f0802ffff67 -:020000040000fa -:107c340070b50c1e0ed0002a0cd01500022801d9f4 -:107c4400280070bd084b002b06d01100200000e076 -:107c540000bff5e70025f3e78e1820780134fff71d -:0c7c640092feb442f9d1ebe700000000f2 -:020000040000fa -:107c7000f0b5002917d0002607270fe07a40013b16 -:107c8000dbb2002b06d05400a4b215b22200002da6 -:107c9000f5daf3e70136b3b2994204d9835d1b02ea -:0a7ca0005a400823efe71000f0bd82 -:020000040000fa -:027caa00fee7f3 -:020000040000fa -:107cac0010b5094b00221a80084b013a1a80084b78 -:107cbc0000221a741a7b40218a431a73054a9a606f -:107ccc00012000f0a8fc10bdae130020ac13002066 -:087cdc00cc100020015900004a -:020000040000fa -:107ce400f8b51f008b8905000c001600db0505d5cf -:107cf4000e23c95e0022022300f0e4faa389054a98 -:107d040028001340a38132000e23e15e3b0000f003 -:087d1400c5faf8bdffefffff07 -:020000040000fa -:107d1c0010b50023094a1380094c2360a38000f09e -:107d2c0011f82000fff71cf900f0d6fc040000f05d -:107d3c00d3fc001b0128fad910bdc0469c130020af -:047d4c0038130020c8 -:020000040000fa -:107d500010b5094b00221a609a60084a5a60062240 -:107d60001a601a6801210a431a60054b82225a6080 -:107d700000f0d4fb10bdc04610e000e07fbb000067 -:047d8000004000417e -:020000040000fa -:107d840030b5a2200002094b0122094dff24a402b0 -:107d9400197d1142fcd04108d9611d80197d114221 -:107da400fcd00130ff30a042f2d130bd0040004190 -:047db40002a5ffff26 -:020000040000fa -:107db8003031323334353637383941424344454619 -:107dc80000303132333435363738396162636465af -:107dd8006600232d302b2000686c4c0065666745d3 -:037de8004647000b -:020000040000fa -:107dec0030b50b78007858400002120295b2082387 -:107dfc0005e06a401000013bdbb2002b06d04200cc -:107e0c0092b204b21000002cf5daf2e7000a087006 -:027e1c0030bd77 -:020000040000fa -:027e1e00fee77d -:020000040000fa -:107e2000084b00221a609a80074b1988002908d055 -:107e3000064a00230020107001339bb23d328b4272 -:107e4000f9d17047381300209c130020af0e00209a -:020000040000fa -:107e50002e2e2f2e2e2f2e2e2f2e2e2f2e2e2f2e3d -:107e60002e2f456e67696e652f436f72652f737293 -:107e7000632f6c756f735f656e67696e652e630047 -:020000040000fa -:107e8000074bfc214902d961064a1a80064a02437f -:107e9000fc2080020260d961044a1a807047c04603 -:107ea0000040004102a5ffff00ffffff04a5ffff08 -:020000040000fa -:107eb0002e2e2f2e2e2f2e2e2f2e2e2f2e2e2f2edd -:107ec0002e2f4e6574776f726b2f526f6275732f02 -:107ed0007372632f6d73675f616c6c6f632e6300e9 -:020000040000fa -:107ee00082b00378dbb201aa13701378db0604d4e6 -:107ef00013781b071b0f0f2b04d0044b02221a769a -:107f000002b07047014b01221a76f9e7cc1000202d -:020000040000fa -:107f10002e2e2f2e2e2f2e2e2f2e2e2f2e2e2f2e7c -:107f20002e2f4e6574776f726b2f526f6275732fa1 -:107f30007372632f726563657074696f6e2e630070 -:020000040000fa -:107f400010b50379447924021c430dd08279c3799a -:107f50001b021343994209d000230133dbb29ab2ca -:107f6000a242fad3002010bd0020fce70120fae76e -:020000040000fa -:107f70009e2110b5c905041cfef7aefe002803d1f2 -:107f8000201cfff783fd10bd9e21201cc905faf7b8 -:107f900063fcfff77bfd80231b069c466044f2e7f1 -:020000040000fa -:107fa000084a1368002b09d007491818884202d8dc -:107fb00010601800704701235b42fae7034b13601f -:107fc000f2e7c04690130020c0150020c013002027 -:020000040000fa -:107fd00030b5007800020b8858400823072505e0db -:107fe0006a401000013bdbb2002b06d0420092b287 -:0e7ff00004b21000002cf5daf2e7088030bd74 -:020000040000fa -:027ffe00fee79c -:020000040000fa -:10800000012803d0084b04221a757047064b1b7ecb -:108010005b0705d5044b04211a8d1a7e0a42fbd159 -:0c802000014b04229a75f0e700080042b2 -:020000040000fa -:10802c00084b1b889bb2ff22834201d8100070477b -:10803c00c000054bc258507993791b0203430b8047 -:0c804c000022f3e7a6130020a81100207a -:020000040000fa -:108058002e2e2f2e2e2f2e2e2f2e2e2f2e2e2f2e33 -:108068002e2f4e6574776f726b2f526f6275732f58 -:0c8078007372632f726f6275732e6300c9 -:020000040000fa -:1080840070b564254a1e55430e0029007031fdf772 -:108094009dff041e08d000212a00016046600c30b8 -:0c80a400a060643200f0e4fa200070bd1f -:020000040000fa -:1080b00070b50c000e25495f00f006f9a389421c3b -:1080c00003d1054a1340a38170bd8022520113439e -:0c80d000a3816065f8e7c046ffefffffea -:020000040000fa -:1080dc007fb51d00084b0400e0331e682b000029ff -:1080ec0001d10a0001a9b047431c03d100232b6026 -:0c80fc008a33236004b070bd0c0d00201e -:020000040000fa -:1081080070b500290fd0002a0dd01500002808d11d -:108118000c008e18012000f03bfb20700134b442a3 -:0c812800f8d1280070bd0025fbe7c04620 -:020000040000fa -:10813400936810b5013b9360002b04da9469a34261 -:1081440007db0a2905d01368581c10601970080051 -:0a81540010bdfdf715fe0100f9e76c -:020000040000fa -:02815e00704768 -:020000040000fa -:1081600010b5dc2292000021044800f083fa0023bd -:10817000034a1380034a138010bdc0460408002040 -:08818000a01300209e13002053 -:020000040000fa -:10818800064b00221a605a609a60bff34f8f044b67 -:10819800044ada60bff34f8fc046fde710e000e005 -:0881a80000ed00e00400fa05ff -:020000040000fa -:1081b00010b5416872b6064b00221a605a609a6088 -:1081c000044b9860036883f3088862b6884710bd43 -:0881d00010e000e000ed00e00a -:020000040000fa -:1081d80010b5064b01221a70054b00221a80a032f6 -:1081e8000021044800f042fa10bdc0469713002051 -:0881f800aa130020ac0f0020c7 -:020000040000fa -:10820000074b1b889bb2ff22834201d810007047a6 -:10821000c000044bc3581b790b700022f6e7c04620 -:08822000a6130020a8110020a4 -:020000040000fa -:1082280010b5074a0023537702211177054a1370c6 -:108238000020fef7ebfa0120fef7e8fa10bdc04671 -:08824800cc100020b813002047 -:020000040000fa -:1082500010b5084b1b7c012b03d1064b187cc0b218 -:1082600010bd00f07df8034a137c0343dbb21374a6 -:08827000f3e7c046cc1000202a -:020000040000fa -:1082780070b50c000e25495f00f036f8002803dbc6 -:10828800636d1b18636570bda389024a1340a381ff -:08829800f9e7c046ffefffff0c -:020000040000fa -:1082a00070b50500080011000022064c22601a007b -:1082b00000f06afa431c03d12368002b00d02b6026 -:0882c00070bdc0460000002063 -:020000040000fa -:1082c80070b50500080011000022064c22601a0053 -:1082d80000f04efa431c03d12368002b00d02b601a -:0882e80070bdc046000000203b -:020000040000fa -:1082f00070b50500080011000022064c22601a002b -:1083000000f03efa431c03d12368002b00d02b6001 -:0883100070bdc0460000002012 -:020000040000fa -:1083180010b5074b06225a60fff775f8fef7f6fa14 -:1083280000f0caf9fdf729fd00f002fa10bdc046b9 -:0483380000400041c0 -:020000040000fa -:10833c00f03c0000f03c0000463e0000923c000087 -:10834c00d83c0000fc3c0000b43d0000f23d0000b5 -:04835c003e3e0000a1 -:020000040000fa -:1083600010b5074b187e0823184000d110bd044bf0 -:1083700008221a761420fff7a3fa0120f6e7c04678 -:0483800000080042af -:020000040000fa -:1083840082b0002900d101a9101e06d0002b06d00e -:1083940013780b601078431e984102b07047022096 -:0483a4004042fae772 -:020000040000fa -:1083a800002370b5064c050008002360fff7f4fdb4 -:1083b800431c03d12368002b00d02b6070bdc0463e -:0483c8000000002091 -:020000040000fa -:1083cc00002370b5064c05000800236000f0c2f9cc -:1083dc00431c03d12368002b00d02b6070bdc0461a -:0483ec00000000206d -:020000040000fa -:1083f000002370b5064c050008001100236000f052 -:10840000b3f9431c03d12368002b00d02b6070bd4f -:048410000000002048 -:020000040000fa -:10841400002370b5064c05000800236000f0a6f99f -:10842400431c03d12368002b00d02b6070bdc046d1 -:048434000000002024 -:020000040000fa -:1084380070b504000d001622002100f017f9022380 -:0e8448002370601c0622290000f0def870bdd3 -:020000040000fa -:1084560010b50c23d45e80239b011c4204d11c431f -:0e8466009481146e23431366fef7c5fb10bd10 -:020000040000fa -:10847400044b1868044bc01a431e98414042c0b2d2 -:0c8484007047c0466c130020740b0020f1 -:020000040000fa -:10849000445b0000445b0000f25a0000a65b000051 -:0c84a000ee5a0000a65b0000a65b000086 -:020000040000fa -:1084ac00884c00007e4c0000364c0000124d000041 -:0c84bc006a4d0000344d00002a4d000005 -:020000040000fa -:1084c800c0370000c0370000ac3700007637000026 -:0c84d8005e3700004a3900004a390000fd -:020000040000fa -:1084e40010b50020fff78afd034c01212000fdf7a1 -:0c84f40021fe0f23237010bdd8100020c3 -:020000040000fa -:1085000010b500f025f9012800d010bd00f04df89d -:0a851000a2200002fff74cfef7e77f -:020000040000fa -:02851a007047a8 -:020000040000fa -:10851c00034b1a68034b1a6100225a617047c0461c -:08852c0058130020c8120020c2 -:020000040000fa -:10853400044b002268210020585202395a54013158 -:088544005a547047cc100020ce -:020000040000fa -:10854c0010b5002903d1fff733fb203002e0081ce3 -:08855c00fff72efb10bdc04625 -:020000040000fa -:1085640010b513000a00010002480068f9f7b8fdcd -:0885740010bdc0468413002075 -:020000040000fa -:10857c000b1e04d0ff2a04d98a2303608b3b1800fe -:08858c0070470a700123fae7b1 -:020000040000fa -:10859400c9b28218904201d10020704703788b42ff -:0685a400fbd00130f6e7f8 -:020000040000fa -:0285aa00704718 -:020000040000fa -:1085ac00034b1a6810701a6801321a607047c04683 -:0485bc006c1300201c -:020000040000fa -:1085c000034b188880b2431e98414042c0b27047a6 -:0485d000aa130020ca -:020000040000fa -:1085d40010b5fff727fe024b00225a809a8010bd87 -:0485e400cc10002097 -:020000040000fa -:1085e800024b00221a73024a9a607047cc1000208e -:0485f8000159000025 -:020000040000fa -:1085fc0002780b78002a03d0013001319a42f7d06f -:04860c00d01a7047c9 -:020000040000fa -:10861000002310b59a4200d110bdcc5cc454013384 -:02862000f8e779 -:020000040000fa -:0286220070479f -:020000040000fa -:10862400626f6f745f736572766963650000c0463c -:020000040000fa -:10863400024a1368013313607047c0465813002080 -:020000040000fa -:1086440010b513000a0001001800fff7dfff10bd8a -:020000040000fa -:10865400024a6c23d05cc0b27047c046cc100020e4 -:020000040000fa -:108664000130c0b2014a7823d0547047cc100020a6 -:020000040000fa -:1086740003001218934200d1704719700133f9e7cf -:020000040000fa -:1086840010b50249fff75ef910bdc04661730000e2 -:020000040000fa -:108694009423024a5b00d05c7047c0460c0d002056 -:020000040000fa -:0e86a40010b50020fff736fefef720fdfce7c4 -:020000040000fa -:0e86b2000023c25c0133002afbd1581e704722 -:020000040000fa -:0c86c000014b82225a60704700400041cc -:020000040000fa -:0c86cc00014b188880b270479e130020fc -:020000040000fa -:0c86d800012801d072b6704762b6fce7c2 -:020000040000fa -:0c86e400014b18687047c0465813002076 -:020000040000fa -:0c86f000fc239b021868000a80b270474f -:020000040000fa -:0c86fc00014b00221a6070477813002028 -:020000040000fa -:0c8708000079183843425841c0b2704755 -:020000040000fa -:0c87140010b50e23c95efff757fe10bd24 -:020000040000fa -:0c87200080239b0100204b607047c04686 -:020000040000fa -:0b872c004300504f53495800002e003e -:020000040000fa -:08873800bff35f8f62b67047ca -:020000040000fa -:0887400010b5fff78fff10bd1b -:020000040000fa -:088748000048704704080020fe -:020000040000fa -:08875000fc239b02187870471e -:020000040000fa -:0887580000487047cc1000201e -:020000040000fa -:0887600010b500f015f810bd82 -:020000040000fa -:0887680010b5fff7d9ff10bda9 -:020000040000fa -:0887700010b500f017f810bd70 -:020000040000fa -:0887780010b500f015f810bd6a -:020000040000fa -:0887800010b5fff7c1fc10bdac -:020000040000fa -:0887880010b5fff753fa10bd14 -:020000040000fa -:08879000012040427047c04681 -:020000040000fa -:048798000020704706 -:020000040000fa -:04879c007047c0461c -:020000040000fa -:0487a000481100205c -:020000040000fa -:0487a40001207047f9 -:020000040000fa -:0487a80000207047f6 -:020000040000fa -:0287ac00704714 -:020000040000fa -:0287ae00704712 -:020000040000fa -:0200000400807a -:0440000077c700d8a6 -:020000040000fa -:0200000400807a -:044004005c00ffff5e -:00000001FF diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map deleted file mode 100644 index 204138e17..000000000 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.map +++ /dev/null @@ -1,3864 +0,0 @@ -Archive member included to satisfy reference by file (symbol) - -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - build/luos_bootloader/production/_ext/1137593668/startup_xc32.o (__pic32c_data_initialization) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivsi3.o) - build/luos_bootloader/production/_ext/1857845632/robus_hal.o (__aeabi_uidiv) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_divsi3.o) - build/luos_bootloader/production/_ext/1555399743/luos_engine.o (__aeabi_idiv) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_dvmd_tls.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivsi3.o) (__aeabi_idiv0) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_aeabi_uldivmod.o) - build/luos_bootloader/production/_ext/1857845632/robus_hal.o (__aeabi_uldivmod) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - build/luos_bootloader/production/_ext/1555399743/luos_engine.o (__aeabi_f2uiz) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_aeabi_uldivmod.o) (__udivmoddi4) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - build/luos_bootloader/production/_ext/1555399743/luos_engine.o (__aeabi_fmul) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) (__aeabi_fsub) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) (__aeabi_f2iz) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) (__aeabi_fcmpge) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzsi2.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) (__clzsi2) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzdi2.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) (__clzdi2) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) (__eqsf2) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) (__gesf2) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) (__lesf2) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-sprintf.cdnopsuxX.o) - (_sprintf_cdnopsuxX) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-init.o) - build/luos_bootloader/production/_ext/1137593668/startup_xc32.o (__libc_init_array) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memcpy-stub.o) - build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o (memcpy) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memset.o) - build/luos_bootloader/production/_ext/1342350994/bootloader_core.o (memset) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strcmp.o) - build/luos_bootloader/production/_ext/1555399743/routing_table.o (strcmp) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strlen.o) - build/luos_bootloader/production/_ext/1555399743/luos_utils.o (strlen) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strstr.o) - build/luos_bootloader/production/_ext/1555399743/routing_table.o (strstr) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-sprintf.cdnopsuxX.o) (_vfprintf_cdnopsuxX) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-__ssfputs.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) (__ssfputs_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) (__sinit) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fputwc.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-__ssfputs.o) (_fputwc_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fwalk.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) (_fwalk_reent) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-impure.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) (_global_impure_ptr) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fputwc.o) (__locale_mb_cur_max) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mbtowc_r.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) (__ascii_mbtowc) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memchr-stub.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) (memchr) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-mallocr.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) (_malloc_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-vfprintf_i.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) (_printf_common) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-sbrkr.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-mallocr.o) (_sbrk_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) (__sread) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wbuf.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-__ssfputs.o) (__swbuf_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wcrtomb.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fputwc.o) (_wcrtomb_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wctomb_r.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) (__ascii_wctomb) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-writer.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) (_write_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wsetup.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) (__swsetup_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-closer.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) (_close_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-ctype_.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) (_ctype_) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fflush.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) (_fflush_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-lseekr.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) (_lseek_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-makebuf.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wsetup.o) (__smakebuf_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mlock.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-mallocr.o) (__malloc_lock) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-freer.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wsetup.o) (_free_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-readr.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) (_read_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-reent.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-sbrkr.o) (errno) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fstatr.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-makebuf.o) (_fstat_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-isattyr.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-makebuf.o) (_isatty_r) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-closer.o) (_close) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fstatr.o) (_fstat) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-isattyr.o) (_isatty) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-lseekr.o) (_lseek) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-readr.o) (_read) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-sbrkr.o) (_sbrk) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-writer.o) (_write) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) (close) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) (fstat) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) (isatty) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) (lseek) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) (read) -c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) (write) - -Allocating common symbols -Common symbol size file - -errno 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-reent.o) - -Microchip PIC32 Memory-Usage Report - -ROM Program-Memory Usage -section address length [bytes] (dec) Description -------- ---------- ------------------------- ----------- -.vectors 0 0xb0 176 -.text 0xb0 0x20 32 App's exec code -.ARM.exidx 0xd0 0x8 8 -.text.MsgAlloc_SetTxTas 0xd8 0x68c 1676 -.text.MsgAlloc_ClearMsg 0x764 0x670 1648 -.text.Luos_MsgHandler 0xdd4 0x5a8 1448 -.dinit 0x137c 0x560 1376 -.text.MsgAlloc_EndMsg 0x18dc 0x428 1064 -.text.MsgAlloc_LuosTask 0x1d04 0x3e0 992 -.text._vfprintf_r_cdnop 0x20e4 0x3dc 988 -.text.Luos_Loop 0x24c0 0x398 920 -.text 0x2858 0x348 840 App's exec code -.text.MsgAlloc_PullMsgF 0x2ba0 0x308 776 -.text.MsgAlloc_PullMsgT 0x2ea8 0x2f0 752 -.text.MsgAlloc_PullServ 0x3198 0x2dc 732 -.text.MsgAlloc_ClearMsg 0x3474 0x2cc 716 -.text.Recep_InterpretMs 0x3740 0x2a8 680 -.text.MsgAlloc_PullMsgF 0x39e8 0x290 656 -.text.LuosBootloader_Ms 0x3c78 0x248 584 -.text.Recep_GetData 0x3ec0 0x248 584 -.text 0x4108 0x22c 556 App's exec code -.text.RoutingTB_DetectS 0x4334 0x224 548 -.text.Robus_Loop 0x4558 0x1c4 452 -.text.Luos_CreateServic 0x471c 0x1b4 436 -.text.Luos_ReceiveData 0x48d0 0x1a8 424 -.text 0x4a78 0x1a4 420 App's exec code -.text.Recep_NodeConcern 0x4c1c 0x1a0 416 -.text.Transmit_Process 0x4dbc 0x174 372 -.text.RobusHAL_ComInit 0x4f30 0x154 340 -.text.MsgAlloc_loop 0x5084 0x13c 316 -.text.Robus_TopologyDet 0x51c0 0x12c 300 -.text 0x52ec 0x114 276 App's exec code -.text.__sflush_r 0x5400 0x114 276 -.rodata._ctype_ 0x5514 0x101 257 -.text.Recep_Drop 0x5616 0x2 2 -.text.Robus_SendMsg 0x5618 0x100 256 -.text.RobusHAL_Init 0x5718 0xfc 252 -.text.MsgAlloc_Init 0x5814 0xec 236 -.text.Recep_GetHeader 0x5900 0xec 236 -.text.__swsetup_r 0x59ec 0xec 236 -.text.Recep_GetConcerne 0x5ad8 0xe8 232 -.text.Recep_GetCollisio 0x5bc0 0xe8 232 -.text._printf_common 0x5ca8 0xda 218 -.text.EVSYS_Initialize 0x5d82 0x2 2 -.text.__swbuf_r 0x5d84 0xcc 204 -.text.MsgAlloc_GetTxTas 0x5e50 0xc4 196 -.text.Luos_SendData 0x5f14 0xbc 188 -.text._malloc_r 0x5fd0 0xbc 188 -.text.RoutingTB_RemoveO 0x608c 0xac 172 -.text.RobusHAL_ComTrans 0x6138 0xa0 160 -.text.Robus_DetectNextN 0x61d8 0xa0 160 -.text 0x6278 0x98 152 App's exec code -.text.SERCOM0_Handler 0x6310 0x94 148 -.text 0x63a4 0x94 148 App's exec code -.text.__smakebuf_r 0x6438 0x94 148 -.text._free_r 0x64cc 0x94 148 -.text.__pic32c_data_ini 0x6560 0x90 144 -.text.LuosHAL_FlashWrit 0x65f0 0x8c 140 -.text.MsgAlloc_LookAtLu 0x667c 0x8c 140 -.text.MsgAlloc_ValidHea 0x6708 0x88 136 -.text.Luos_assert 0x6790 0x84 132 -.text.RobusHAL_SetPTPDe 0x6814 0x80 128 -.text.MsgAlloc_InvalidM 0x6894 0x80 128 -.text.CLOCK_Initialize 0x6914 0x7c 124 -.text.compute_crc 0x6990 0x7c 124 -.text.RoutingTB_RemoveN 0x6a0c 0x7c 124 -.text.RobusHAL_SetPTPRe 0x6a88 0x7c 124 -.text.RobusHAL_GetPTPSt 0x6b04 0x7c 124 -.text.__sfp 0x6b80 0x7c 124 -.text.__fputwc 0x6bfc 0x7c 124 -.text 0x6c78 0x74 116 App's exec code -.text.LuosHAL_GetTimest 0x6cec 0x70 112 -.text.Robus_ShiftMaskCa 0x6d5c 0x70 112 -.text.Luos_SaveAlias 0x6dcc 0x68 104 -.rodata.Luos_Loop 0x6e34 0x68 104 -.text.PortMng_PokeNextP 0x6e9c 0x68 104 -.text.__sinit 0x6f04 0x68 104 -.text.Robus_Init 0x6f6c 0x64 100 -.text.LuosHAL_ProgramFl 0x6fd0 0x60 96 -.text.PortMng_PokePort 0x7030 0x60 96 -.text.Robus_ServiceCrea 0x7090 0x60 96 -.text.Luos_Run 0x70f0 0x5c 92 -.text.Transmit_End 0x714c 0x5c 92 -.rodata.Luos_MsgHandler 0x71a8 0x58 88 -.text.RoutingTB_BigestN 0x7200 0x58 88 -.text.RoutingTB_BigestI 0x7258 0x58 88 -.text.Recep_ComputeMsgN 0x72b0 0x58 88 -.text.Timestamp_TagMsg 0x7308 0x58 88 -.text._fflush_r 0x7360 0x58 88 -.text.RoutingTB_Convert 0x73b8 0x56 86 -.text.PORT_Initialize 0x740e 0x2 2 -.text.RoutingTB_AddNumT 0x7410 0x54 84 -.text.RoutingTB_AliasFr 0x7464 0x50 80 -.text.RobusHAL_SetTxSta 0x74b4 0x50 80 -.text 0x7504 0x50 80 App's exec code -.text.__swhatbuf_r 0x7554 0x50 80 -.text.RoutingTB_IDFromA 0x75a4 0x4c 76 -.text.RoutingTB_Compute 0x75f0 0x4c 76 -.text 0x763c 0x48 72 App's exec code -.text.Reset_Handler 0x7684 0x48 72 -.text.LuosBootloader_Se 0x76cc 0x48 72 -.text.Luos_SendMsg 0x7714 0x48 72 -.text.PortMng_PtpHandle 0x775c 0x48 72 -.text.__libc_init_array 0x77a4 0x48 72 -.text.__ssfputs_r 0x77ec 0x48 72 -.text.std 0x7834 0x48 72 -.rodata 0x787c 0x44 68 Read-only const -.text.RobusHAL_ResetTim 0x78c0 0x44 68 -.text.Robus_SetNodeDete 0x7904 0x44 68 -.text._fwalk_reent 0x7948 0x42 66 -.text._mon_putc 0x798a 0x2 2 -.text.LuosBootloader_In 0x798c 0x40 64 -.text.RobusHAL_PushPTP 0x79cc 0x40 64 -.text 0x7a0c 0x40 64 App's exec code -.rodata 0x7a4c 0x40 64 Read-only const -.text 0x7a8c 0x40 64 App's exec code -.text.TC3_Handler 0x7acc 0x3c 60 -.text.EIC_Handler 0x7b08 0x3c 60 -.text.MsgAlloc_IsResete 0x7b44 0x3c 60 -.text.Recep_Timeout 0x7b80 0x3c 60 -.text 0x7bbc 0x3c 60 App's exec code -.text._sprintf_cdnopsux 0x7bf8 0x3c 60 -.text.write 0x7c34 0x3c 60 -.text.ll_crc_compute 0x7c70 0x3a 58 -.text.Dummy_Handler 0x7caa 0x2 2 -.text.Recep_Reset 0x7cac 0x38 56 -.text.__swrite 0x7ce4 0x38 56 -.text.Luos_Init 0x7d1c 0x34 52 -.text.LuosHAL_Init 0x7d50 0x34 52 -.text.LuosHAL_EraseMemo 0x7d84 0x34 52 -.rodata 0x7db8 0x33 51 Read-only const -.text.crc8 0x7dec 0x32 50 -.text.NonMaskableInt_Ha 0x7e1e 0x2 2 -.text.Luos_ResetStatist 0x7e20 0x30 48 -.rodata 0x7e50 0x30 48 Read-only const -.text.LuosHAL_SetMode 0x7e80 0x30 48 -.rodata 0x7eb0 0x30 48 Read-only const -.text.Recep_CatchAck 0x7ee0 0x30 48 -.rodata 0x7f10 0x30 48 Read-only const -.text.Trgt_MulticastTar 0x7f40 0x30 48 -.text 0x7f70 0x30 48 App's exec code -.text._sbrk 0x7fa0 0x30 48 -.text.RobusHAL_ComputeC 0x7fd0 0x2e 46 -.text.HardFault_Handler 0x7ffe 0x2 2 -.text.RobusHAL_SetRxSta 0x8000 0x2c 44 -.text.MsgAlloc_GetLuosT 0x802c 0x2c 44 -.rodata 0x8058 0x2c 44 Read-only const -.text.__sfmoreglue 0x8084 0x2c 44 -.text.__sseek 0x80b0 0x2c 44 -.text._wcrtomb_r 0x80dc 0x2c 44 -.text.read 0x8108 0x2c 44 -.text.__sfputc_r 0x8134 0x2a 42 -.text.Dummy_App_Func 0x815e 0x2 2 -.text.RoutingTB_Erase 0x8160 0x28 40 -.text.LuosHAL_Reboot 0x8188 0x28 40 -.text.LuosHAL_JumpToApp 0x81b0 0x28 40 -.text.MsgAlloc_Reset 0x81d8 0x28 40 -.text.MsgAlloc_GetLuosT 0x8200 0x28 40 -.text.PortMng_Reset 0x8228 0x28 40 -.text.Transmit_GetLockS 0x8250 0x28 40 -.text.__sread 0x8278 0x28 40 -.text._write_r 0x82a0 0x28 40 -.text._lseek_r 0x82c8 0x28 40 -.text._read_r 0x82f0 0x28 40 -.text.SYS_Initialize 0x8318 0x24 36 -.rodata.LuosBootloader_ 0x833c 0x24 36 -.text.RobusHAL_GetTxLoc 0x8360 0x24 36 -.text.__ascii_mbtowc 0x8384 0x24 36 -.text._sbrk_r 0x83a8 0x24 36 -.text._close_r 0x83cc 0x24 36 -.text._fstat_r 0x83f0 0x24 36 -.text._isatty_r 0x8414 0x24 36 -.text.RoutingTB_Convert 0x8438 0x1e 30 -.text._fputwc_r 0x8456 0x1e 30 -.text.MsgAlloc_IsEmpty 0x8474 0x1c 28 -.rodata.Recep_GetConcer 0x8490 0x1c 28 -.rodata.Recep_NodeConce 0x84ac 0x1c 28 -.rodata.Recep_Interpret 0x84c8 0x1c 28 -.text.Transmit_SendAck 0x84e4 0x1c 28 -.text.LuosBootloader_Lo 0x8500 0x1a 26 -.text.node_assert 0x851a 0x2 2 -.text.LuosHAL_StartTime 0x851c 0x18 24 -.text.Robus_MaskInit 0x8534 0x18 24 -.text 0x854c 0x18 24 App's exec code -.text._vfprintf_cdnopsu 0x8564 0x18 24 -.text.__ascii_wctomb 0x857c 0x18 24 -.text.memchr 0x8594 0x16 22 -.text.LuosHAL_DeInit 0x85aa 0x2 2 -.text.MsgAlloc_SetData 0x85ac 0x14 20 -.text.MsgAlloc_TxAllCom 0x85c0 0x14 20 -.text.PortMng_Init 0x85d4 0x14 20 -.text.Recep_Init 0x85e8 0x14 20 -.text 0x85fc 0x14 20 App's exec code -.text.memcpy 0x8610 0x12 18 -.text.RobusHAL_SetRxDet 0x8622 0x2 2 -.rodata 0x8624 0x10 16 Read-only const -.text.SysTick_Handler 0x8634 0x10 16 -.text.LuosHAL_FlashRead 0x8644 0x10 16 -.text.Robus_IsNodeDetec 0x8654 0x10 16 -.text.Robus_SetVerboseM 0x8664 0x10 16 -.text.memset 0x8674 0x10 16 -.text._cleanup_r 0x8684 0x10 16 -.text.__locale_mb_cur_m 0x8694 0x10 16 -.text.main 0x86a4 0xe 14 -.text 0x86b2 0xe 14 App's exec code -.text.NVMCTRL_Initializ 0x86c0 0xc 12 -.text.RoutingTB_GetLast 0x86cc 0xc 12 -.text.LuosHAL_SetIrqSta 0x86d8 0xc 12 -.text.LuosHAL_GetSystic 0x86e4 0xc 12 -.text.LuosHAL_GetNodeID 0x86f0 0xc 12 -.text.MsgAlloc_UsedMsgE 0x86fc 0xc 12 -.text.Timestamp_IsTimes 0x8708 0xc 12 -.text.__sclose 0x8714 0xc 12 -.text.fstat 0x8720 0xc 12 -.rodata 0x872c 0xb 11 Read-only const -.text.NVIC_Initialize 0x8738 0x8 8 -.text.Luos_SetVerboseMo 0x8740 0x8 8 -.text.RoutingTB_Get 0x8748 0x8 8 -.text.LuosHAL_GetMode 0x8750 0x8 8 -.text.Node_Get 0x8758 0x8 8 -.text._close 0x8760 0x8 8 -.text._fstat 0x8768 0x8 8 -.text._isatty 0x8770 0x8 8 -.text._lseek 0x8778 0x8 8 -.text._read 0x8780 0x8 8 -.text._write 0x8788 0x8 8 -.text.close 0x8790 0x8 8 -.text._mon_getc 0x8798 0x4 4 -.text 0x879c 0x4 4 App's exec code -.rodata._global_impure_ 0x87a0 0x4 4 -.text.isatty 0x87a4 0x4 4 -.text.lseek 0x87a8 0x4 4 -.text.__malloc_lock 0x87ac 0x2 2 -.text.__malloc_unlock 0x87ae 0x2 2 - Total ROM used : 0x87ad 34733 84.8% of 0xa000 - -------------------------------------------------------------------------- - Total Program Memory used : 0x87ad 34733 84.8% of 0xa000 - -------------------------------------------------------------------------- - - -RAM Data-Memory Usage -section address length [bytes] (dec) Description -------- ---------- ------------------------- ----------- -.bss 0x20000000 0x4 4 Uninitialized data -.bss.data_buff 0x20000004 0x800 2048 -.bss.routing_table 0x20000804 0x370 880 -.bss.msg_buffer 0x20000b74 0x195 405 -.bss.node_state.8055 0x20000d09 0x1 1 -.bss.source_id 0x20000d0a 0x2 2 -.data.__global_locale 0x20000d0c 0x16c 364 -.bss.service_table 0x20000e78 0x131 305 -.bss.mem_clear_needed 0x20000fa9 0x1 1 -.data.residual_space 0x20000faa 0x2 2 -.bss.tx_tasks 0x20000fac 0xa0 160 -.bss.bootloader_data 0x2000104c 0x7f 127 -.bss.crc 0x200010cb 0x1 1 -.bss.ctx 0x200010cc 0x7c 124 -.data.impure_data 0x20001148 0x60 96 -.bss.luos_tasks 0x200011a8 0x50 80 -.bss.package_table 0x200011f8 0x28 40 -.bss.msg_tasks 0x20001220 0x28 40 -.bss.__sf_fake_stderr 0x20001248 0x20 32 -.bss.__sf_fake_stdin 0x20001268 0x20 32 -.bss.__sf_fake_stdout 0x20001288 0x20 32 -.bss 0x200012a8 0x1c 28 Uninitialized data -.bss.nb_bytes 0x200012c4 0x4 4 -.bss.ll_timestamp 0x200012c8 0x18 24 -.bss.data_size.7939 0x200012e0 0x14 20 -.bss.total_data_size.79 0x200012f4 0x14 20 -.bss.descriptor_section 0x20001308 0x10 16 -.bss.write_back_section 0x20001318 0x10 16 -.bss.ll_rx_timestamp 0x20001328 0x8 8 -.bss.general_stats 0x20001330 0x7 7 -.bss.load_flag 0x20001337 0x1 1 -.bss.luos_stats 0x20001338 0x6 6 -.bss.bootloader_data_si 0x2000133e 0x2 2 -.bss.PTP 0x20001340 0x6 6 -.bss.data_index 0x20001346 0x2 2 -.bss.tickstart 0x20001348 0x4 4 -.data.flash_addr 0x2000134c 0x4 4 -.bss.detection_service 0x20001350 0x4 4 -.bss.last_loop_date.776 0x20001354 0x4 4 -.bss.tick 0x20001358 0x4 4 -.bss.tx_data 0x2000135c 0x4 4 -.bss.copy_task_pointer 0x20001360 0x4 4 -.bss.current_msg 0x20001364 0x4 4 -.bss.data_end_estimatio 0x20001368 0x4 4 -.bss.data_ptr 0x2000136c 0x4 4 -.bss.mem_stat 0x20001370 0x4 4 -.bss.oldest_msg 0x20001374 0x4 4 -.bss.used_msg 0x20001378 0x4 4 -.bss.baudrate 0x2000137c 0x4 4 -.bss 0x20001380 0x4 4 Uninitialized data -.data._impure_ptr 0x20001384 0x4 4 -.bss.__malloc_free_list 0x20001388 0x4 4 -.bss.__malloc_sbrk_star 0x2000138c 0x4 4 -.bss 0x20001390 0x4 4 Uninitialized data -.data.luos_version 0x20001394 0x3 3 -.bss.reset_needed 0x20001397 0x1 1 -.bss.last_msg_size.7941 0x20001398 0x2 2 -.bss.package_number 0x2000139a 0x2 2 -.bss.service_number 0x2000139c 0x2 2 -.bss.last_routing_table 0x2000139e 0x2 2 -.bss.last_service 0x200013a0 0x2 2 -.bss.data_size_to_trans 0x200013a2 0x2 2 -.bss.timoutclockcnt 0x200013a4 0x2 2 -.bss.luos_tasks_stack_i 0x200013a6 0x2 2 -.bss.msg_tasks_stack_id 0x200013a8 0x2 2 -.bss.tx_tasks_stack_id 0x200013aa 0x2 2 -.bss.crc_val 0x200013ac 0x2 2 -.bss.data_count 0x200013ae 0x2 2 -.bss.data_size 0x200013b0 0x2 2 -.bss.large_data_num 0x200013b2 0x2 2 -.bss.last_crc.6331 0x200013b4 0x2 2 -.bss.last_node 0x200013b6 0x2 2 -.bss.Port_ExpectedState 0x200013b8 0x1 1 -.bss.nbrRetry 0x200013b9 0x1 1 - Total RAM used : 0x13ba 5050 15.4% of 0x8000 - -------------------------------------------------------------------------- - Total Data Memory used : 0x13ba 5050 15.4% of 0x8000 - -------------------------------------------------------------------------- - - -Dynamic Data-Memory Reservation -section address length [bytes] (dec) Description -------- ---------- ------------------------- ----------- -heap 0x200013c0 0x200 512 Reserved for heap -stack 0x200015d8 0x6a18 27160 Reserved for stack - - -------------------------------------------------------------------------- - -Discarded input sections - - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crti.o - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crti.o - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crti.o - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crti.o - .xc_stack_usage - 0x00000000 0x26 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crti.o - .data 0x00000000 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtbegin.o - .xc_stack_usage - 0x00000000 0x3c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtbegin.o - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtbegin.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/903266522/plib_clock.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/903266522/plib_clock.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/903266522/plib_clock.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/901117036/plib_evsys.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/901117036/plib_evsys.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/901117036/plib_evsys.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .text.NVIC_INT_Enable - 0x00000000 0x8 build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .text.NVIC_INT_Disable - 0x00000000 0x12 build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .text.NVIC_INT_Restore - 0x00000000 0x14 build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .text.NVMCTRL_CacheInvalidate - 0x00000000 0x10 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .text.NVMCTRL_Read - 0x00000000 0x10 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .text.NVMCTRL_PageWrite - 0x00000000 0x30 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .text.NVMCTRL_RowErase - 0x00000000 0x18 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .text.NVMCTRL_ErrorGet - 0x00000000 0x28 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .text.NVMCTRL_IsBusy - 0x00000000 0x14 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .text.NVMCTRL_RegionLock - 0x00000000 0x14 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .text.NVMCTRL_RegionUnlock - 0x00000000 0x14 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .text.PORT_GroupRead - 0x00000000 0x4 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .text.PORT_GroupWrite - 0x00000000 0xc build/luos_bootloader/production/_ext/1968410007/plib_port.o - .text.PORT_GroupLatchRead - 0x00000000 0x4 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .text.PORT_GroupSet - 0x00000000 0x4 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .text.PORT_GroupClear - 0x00000000 0x4 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .text.PORT_GroupToggle - 0x00000000 0x4 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .text.PORT_GroupInputEnable - 0x00000000 0x4 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .text.PORT_GroupOutputEnable - 0x00000000 0x4 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .text.PORT_PinPeripheralFunctionConfig - 0x00000000 0x48 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .text.PORT_PinGPIOConfig - 0x00000000 0x20 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/initialization.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/initialization.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/initialization.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/interrupts.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/interrupts.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/interrupts.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/exceptions.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/exceptions.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/exceptions.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o - .text._exit 0x00000000 0x2 build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o - .debug_info 0x00000000 0xf60 build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o - .debug_abbrev 0x00000000 0x1cc build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o - .debug_loc 0x00000000 0x15 build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o - .debug_aranges - 0x00000000 0x20 build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o - .debug_ranges 0x00000000 0x10 build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o - .debug_line 0x00000000 0x14b build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o - .debug_str 0x00000000 0xe build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o - .comment 0x00000000 0x54 build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o - .debug_frame 0x00000000 0x20 build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o - .ARM.attributes - 0x00000000 0x2c build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1360937237/main.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1360937237/main.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1360937237/main.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - .text.LuosBootloader_SaveNodeID - 0x00000000 0x18 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_ServicesClear - 0x00000000 0x14 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Streaming_Receive - 0x00000000 0x3c build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_SendBaudrate - 0x00000000 0x5a build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_SetExternId - 0x00000000 0x54 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_NbrAvailableMsg - 0x00000000 0x8 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_GetSystick - 0x00000000 0x8 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_TxComplete - 0x00000000 0x8 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_Flush - 0x00000000 0x8 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Streaming_SendSize - 0x00000000 0xb8 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Streaming_Send - 0x00000000 0x1c build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_ReadMsg - 0x00000000 0x44 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_ReadFromService - 0x00000000 0xa0 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_IsDetected - 0x00000000 0x10 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_SetFilterState - 0x00000000 0x1c build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_AddPackage - 0x00000000 0x20 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_SetID - 0x00000000 0x38 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text.Luos_Detect - 0x00000000 0x58 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .bss.boot_run 0x00000000 0x1 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .bss.boot_start_date - 0x00000000 0x4 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .bss.routing_table_pt - 0x00000000 0x4 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .data.launch_boot_flag - 0x00000000 0x1 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/luos_utils.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/luos_utils.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/luos_utils.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .text.ProfileCore_Handler - 0x00000000 0x88 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .text.ProfileCore_GetFromService - 0x00000000 0x1e build/luos_bootloader/production/_ext/1555399743/profile_core.o - .text.ProfileCore_GetNew - 0x00000000 0xb0 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .text.ProfileCore_OverrideConnectHandler - 0x00000000 0xc build/luos_bootloader/production/_ext/1555399743/profile_core.o - .text.ProfileCore_StartService - 0x00000000 0x5c build/luos_bootloader/production/_ext/1555399743/profile_core.o - .rodata 0x00000000 0x34 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .bss.available_index - 0x00000000 0x2 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .bss.head_profile_index - 0x00000000 0x2 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .bss.override_connect_handler - 0x00000000 0x1 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .bss.profile_table - 0x00000000 0x78 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .debug_info 0x00000000 0x1cf1 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .debug_abbrev 0x00000000 0x382 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .debug_loc 0x00000000 0x323 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .debug_aranges - 0x00000000 0x40 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .debug_ranges 0x00000000 0x48 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .debug_line 0x00000000 0x3c7 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .debug_str 0x00000000 0x90 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .comment 0x00000000 0x54 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .debug_frame 0x00000000 0x90 build/luos_bootloader/production/_ext/1555399743/profile_core.o - .ARM.attributes - 0x00000000 0x2c build/luos_bootloader/production/_ext/1555399743/profile_core.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/routing_table.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/routing_table.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/routing_table.o - .text.RoutingTB_GetServiceIndex - 0x00000000 0x58 build/luos_bootloader/production/_ext/1555399743/routing_table.o - .text.RoutingTB_NodeIDFromID - 0x00000000 0x44 build/luos_bootloader/production/_ext/1555399743/routing_table.o - .text.RoutingTB_GetLastService - 0x00000000 0xc build/luos_bootloader/production/_ext/1555399743/routing_table.o - .text.RTFilter_InitCheck - 0x00000000 0x2c build/luos_bootloader/production/_ext/1555399743/routing_table.o - .text.RTFilter_Reset - 0x00000000 0x60 build/luos_bootloader/production/_ext/1555399743/routing_table.o - .text.RTFilter_ID - 0x00000000 0x68 build/luos_bootloader/production/_ext/1555399743/routing_table.o - .text.RTFilter_Type - 0x00000000 0x70 build/luos_bootloader/production/_ext/1555399743/routing_table.o - .text.RTFilter_Node - 0x00000000 0x70 build/luos_bootloader/production/_ext/1555399743/routing_table.o - .text.RTFilter_Alias - 0x00000000 0x6c build/luos_bootloader/production/_ext/1555399743/routing_table.o - .text.RTFilter_Service - 0x00000000 0x9c build/luos_bootloader/production/_ext/1555399743/routing_table.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/streaming.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/streaming.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Streaming_CreateChannel - 0x00000000 0x38 build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Streaming_ResetChannel - 0x00000000 0x8 build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Streaming_GetAvailableSampleNB - 0x00000000 0x48 build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Streaming_PutSample - 0x00000000 0x8c build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Streaming_GetSample - 0x00000000 0x70 build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Streaming_GetAvailableSampleNBUntilEndBuffer - 0x00000000 0x3c build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Streaming_AddAvailableSampleNB - 0x00000000 0x4c build/luos_bootloader/production/_ext/1555399743/streaming.o - .text.Streaming_RmvAvailableSampleNB - 0x00000000 0x34 build/luos_bootloader/production/_ext/1555399743/streaming.o - .rodata 0x00000000 0x30 build/luos_bootloader/production/_ext/1555399743/streaming.o - .debug_info 0x00000000 0x15eb build/luos_bootloader/production/_ext/1555399743/streaming.o - .debug_abbrev 0x00000000 0x2a6 build/luos_bootloader/production/_ext/1555399743/streaming.o - .debug_loc 0x00000000 0x78c build/luos_bootloader/production/_ext/1555399743/streaming.o - .debug_aranges - 0x00000000 0x58 build/luos_bootloader/production/_ext/1555399743/streaming.o - .debug_ranges 0x00000000 0x48 build/luos_bootloader/production/_ext/1555399743/streaming.o - .debug_line 0x00000000 0x472 build/luos_bootloader/production/_ext/1555399743/streaming.o - .debug_str 0x00000000 0x59 build/luos_bootloader/production/_ext/1555399743/streaming.o - .comment 0x00000000 0x54 build/luos_bootloader/production/_ext/1555399743/streaming.o - .debug_frame 0x00000000 0x108 build/luos_bootloader/production/_ext/1555399743/streaming.o - .ARM.attributes - 0x00000000 0x2c build/luos_bootloader/production/_ext/1555399743/streaming.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .text.LuosHAL_StopTimestamp - 0x00000000 0x18 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .text.LuosHAL_SaveNodeID - 0x00000000 0x38 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .text.MsgAlloc_GetLuosTaskSourceId - 0x00000000 0x30 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .text.MsgAlloc_LuosTasksNbr - 0x00000000 0xc build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .text.MsgAlloc_PullMsg - 0x00000000 0x340 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/port_manager.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/port_manager.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/port_manager.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/reception.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/reception.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/reception.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/robus.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/robus.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/robus.o - .text.Robus_ServicesClear - 0x00000000 0x1c build/luos_bootloader/production/_ext/1000620745/robus.o - .text.Robus_Flush - 0x00000000 0x24 build/luos_bootloader/production/_ext/1000620745/robus.o - .text.Robus_SetFilterState - 0x00000000 0x18 build/luos_bootloader/production/_ext/1000620745/robus.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/target.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/target.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/target.o - .text.Trgt_AddMulticastTarget - 0x00000000 0x1e build/luos_bootloader/production/_ext/1000620745/target.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/timestamp.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/timestamp.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/timestamp.o - .text.Timestamp_GetToken - 0x00000000 0x24 build/luos_bootloader/production/_ext/1000620745/timestamp.o - .text.Timestamp_Tag - 0x00000000 0x38 build/luos_bootloader/production/_ext/1000620745/timestamp.o - .text.Timestamp_EncodeMsg - 0x00000000 0x84 build/luos_bootloader/production/_ext/1000620745/timestamp.o - .text.Timestamp_DecodeMsg - 0x00000000 0x2a build/luos_bootloader/production/_ext/1000620745/timestamp.o - .bss.token_list_head - 0x00000000 0x4 build/luos_bootloader/production/_ext/1000620745/timestamp.o - .text 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/transmission.o - .data 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/transmission.o - .bss 0x00000000 0x0 build/luos_bootloader/production/_ext/1000620745/transmission.o - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - .xc_stack_usage - 0x00000000 0x2a c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivsi3.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivsi3.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivsi3.o) - .xc_stack_usage - 0x00000000 0x35 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivsi3.o) - .text 0x00000000 0x1d4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_divsi3.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_divsi3.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_divsi3.o) - .debug_frame 0x00000000 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_divsi3.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_divsi3.o) - .xc_stack_usage - 0x00000000 0x33 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_divsi3.o) - .debug_line 0x00000000 0xaf c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_divsi3.o) - .debug_info 0x00000000 0x26 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_divsi3.o) - .debug_abbrev 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_divsi3.o) - .debug_aranges - 0x00000000 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_divsi3.o) - .debug_str 0x00000000 0xee c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_divsi3.o) - .ARM.attributes - 0x00000000 0x1e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_divsi3.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_dvmd_tls.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_dvmd_tls.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_dvmd_tls.o) - .xc_stack_usage - 0x00000000 0x36 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_dvmd_tls.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_aeabi_uldivmod.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_aeabi_uldivmod.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_aeabi_uldivmod.o) - .xc_stack_usage - 0x00000000 0x1e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_aeabi_uldivmod.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - .xc_stack_usage - 0x00000000 0x1a c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - .xc_stack_usage - 0x00000000 0x1a c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - .ARM.extab 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - .xc_stack_usage - 0x00000000 0x1a c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - .xc_stack_usage - 0x00000000 0x1a c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - .xc_stack_usage - 0x00000000 0x1a c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) - .xc_stack_usage - 0x00000000 0xc7 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzsi2.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzsi2.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzsi2.o) - .xc_stack_usage - 0x00000000 0x16 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzsi2.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzdi2.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzdi2.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzdi2.o) - .xc_stack_usage - 0x00000000 0x16 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzdi2.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - .xc_stack_usage - 0x00000000 0x15 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - .xc_stack_usage - 0x00000000 0x15 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - .xc_stack_usage - 0x00000000 0x15 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-sprintf.cdnopsuxX.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-sprintf.cdnopsuxX.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-sprintf.cdnopsuxX.o) - .xc_stack_usage - 0x00000000 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-sprintf.cdnopsuxX.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-sprintf.cdnopsuxX.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-init.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-init.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-init.o) - .xc_stack_usage - 0x00000000 0x1f c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-init.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-init.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memcpy-stub.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memcpy-stub.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memcpy-stub.o) - .xc_stack_usage - 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memcpy-stub.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memcpy-stub.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memset.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memset.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memset.o) - .xc_stack_usage - 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memset.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memset.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strcmp.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strcmp.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strcmp.o) - .xc_stack_usage - 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strcmp.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strlen.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strlen.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strlen.o) - .xc_stack_usage - 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strlen.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strstr.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strstr.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strstr.o) - .xc_stack_usage - 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strstr.o) - .text.strstr 0x00000000 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strstr.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strstr.o) - .comment 0x00000000 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strstr.o) - .ARM.attributes - 0x00000000 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strstr.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) - .xc_stack_usage - 0x00000000 0x60 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) - .text.__printf_float - 0x00000000 0x6 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-__ssfputs.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-__ssfputs.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-__ssfputs.o) - .xc_stack_usage - 0x00000000 0x31 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-__ssfputs.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-__ssfputs.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - .xc_stack_usage - 0x00000000 0x81 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - .text._cleanup - 0x00000000 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fputwc.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fputwc.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fputwc.o) - .xc_stack_usage - 0x00000000 0x41 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fputwc.o) - .text.fputwc 0x00000000 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fputwc.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fputwc.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fwalk.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fwalk.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fwalk.o) - .xc_stack_usage - 0x00000000 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fwalk.o) - .text._fwalk 0x00000000 0x38 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fwalk.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fwalk.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-impure.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-impure.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-impure.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-impure.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) - .xc_stack_usage - 0x00000000 0x52 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) - .text._setlocale_r - 0x00000000 0x3c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) - .text.setlocale - 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) - .bss._PathLocale - 0x00000000 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mbtowc_r.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mbtowc_r.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mbtowc_r.o) - .xc_stack_usage - 0x00000000 0x33 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mbtowc_r.o) - .text._mbtowc_r - 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mbtowc_r.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mbtowc_r.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memchr-stub.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memchr-stub.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memchr-stub.o) - .xc_stack_usage - 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memchr-stub.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memchr-stub.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-mallocr.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-mallocr.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-mallocr.o) - .xc_stack_usage - 0x00000000 0x17 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-mallocr.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-mallocr.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-vfprintf_i.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-vfprintf_i.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-vfprintf_i.o) - .xc_stack_usage - 0x00000000 0x33 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-vfprintf_i.o) - .text._printf_i - 0x00000000 0x210 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-vfprintf_i.o) - .rodata 0x00000000 0x22 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-vfprintf_i.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-vfprintf_i.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-sbrkr.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-sbrkr.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-sbrkr.o) - .xc_stack_usage - 0x00000000 0x15 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-sbrkr.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-sbrkr.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) - .xc_stack_usage - 0x00000000 0x6e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) - .text.__seofread - 0x00000000 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wbuf.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wbuf.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wbuf.o) - .xc_stack_usage - 0x00000000 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wbuf.o) - .text.__swbuf 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wbuf.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wbuf.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wcrtomb.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wcrtomb.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wcrtomb.o) - .xc_stack_usage - 0x00000000 0x2d c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wcrtomb.o) - .text.wcrtomb 0x00000000 0x18 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wcrtomb.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wcrtomb.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wctomb_r.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wctomb_r.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wctomb_r.o) - .xc_stack_usage - 0x00000000 0x33 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wctomb_r.o) - .text._wctomb_r - 0x00000000 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wctomb_r.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wctomb_r.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-writer.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-writer.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-writer.o) - .xc_stack_usage - 0x00000000 0x16 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-writer.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-writer.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wsetup.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wsetup.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wsetup.o) - .xc_stack_usage - 0x00000000 0x19 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wsetup.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wsetup.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-closer.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-closer.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-closer.o) - .xc_stack_usage - 0x00000000 0x16 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-closer.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-closer.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-ctype_.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-ctype_.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-ctype_.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-ctype_.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fflush.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fflush.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fflush.o) - .xc_stack_usage - 0x00000000 0x43 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fflush.o) - .text.fflush 0x00000000 0x28 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fflush.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fflush.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-lseekr.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-lseekr.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-lseekr.o) - .xc_stack_usage - 0x00000000 0x16 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-lseekr.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-lseekr.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-makebuf.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-makebuf.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-makebuf.o) - .xc_stack_usage - 0x00000000 0x34 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-makebuf.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-makebuf.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mlock.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mlock.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mlock.o) - .xc_stack_usage - 0x00000000 0x38 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mlock.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mlock.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-freer.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-freer.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-freer.o) - .xc_stack_usage - 0x00000000 0x15 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-freer.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-freer.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-readr.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-readr.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-readr.o) - .xc_stack_usage - 0x00000000 0x15 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-readr.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-readr.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-reent.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-reent.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-reent.o) - .xc_stack_usage - 0x00000000 0x36 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-reent.o) - .text.cleanup_glue - 0x00000000 0x1a c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-reent.o) - .text._reclaim_reent - 0x00000000 0xcc c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-reent.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-reent.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fstatr.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fstatr.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fstatr.o) - .xc_stack_usage - 0x00000000 0x16 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fstatr.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fstatr.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-isattyr.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-isattyr.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-isattyr.o) - .xc_stack_usage - 0x00000000 0x17 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-isattyr.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-isattyr.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .xc_stack_usage - 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .xc_stack_usage - 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .xc_stack_usage - 0x00000000 0x15 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .xc_stack_usage - 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .xc_stack_usage - 0x00000000 0x13 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - .xc_stack_usage - 0x00000000 0x13 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .xc_stack_usage - 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .xc_stack_usage - 0x00000000 0x13 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .gnu.warning.closestub - 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - .xc_stack_usage - 0x00000000 0x13 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - .xc_stack_usage - 0x00000000 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - .xc_stack_usage - 0x00000000 0x13 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .xc_stack_usage - 0x00000000 0x12 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - .xc_stack_usage - 0x00000000 0x13 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtend.o - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtend.o - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtend.o - .eh_frame 0x00000000 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtend.o - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtend.o - .comment 0x00000000 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtend.o - .ARM.attributes - 0x00000000 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtend.o - .text 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtn.o - .data 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtn.o - .bss 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtn.o - .xc_stack_usage.hdr - 0x00000000 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtn.o - -Memory Configuration - -Name Origin Length Attributes -rom 0x00000000 0x0000a000 xrl -ram 0x20000000 0x00008000 xw !r -config_00804000 0x00804000 0x00000004 -config_00804004 0x00804004 0x00000004 -*default* 0x00000000 0xffffffff - -Linker script and memory map - -LOAD c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crti.o -LOAD c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtbegin.o -LOAD build/luos_bootloader/production/_ext/903266522/plib_clock.o -LOAD build/luos_bootloader/production/_ext/901117036/plib_evsys.o -LOAD build/luos_bootloader/production/_ext/1968463158/plib_nvic.o -LOAD build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o -LOAD build/luos_bootloader/production/_ext/1968410007/plib_port.o -LOAD build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o -LOAD build/luos_bootloader/production/_ext/1137593668/initialization.o -LOAD build/luos_bootloader/production/_ext/1137593668/interrupts.o -LOAD build/luos_bootloader/production/_ext/1137593668/exceptions.o -LOAD build/luos_bootloader/production/_ext/1137593668/startup_xc32.o -LOAD build/luos_bootloader/production/_ext/1137593668/libc_syscalls.o -LOAD build/luos_bootloader/production/_ext/1360937237/main.o -LOAD build/luos_bootloader/production/_ext/1342350994/bootloader_core.o -LOAD build/luos_bootloader/production/_ext/1555399743/luos_engine.o -LOAD build/luos_bootloader/production/_ext/1555399743/luos_utils.o -LOAD build/luos_bootloader/production/_ext/1555399743/profile_core.o -LOAD build/luos_bootloader/production/_ext/1555399743/routing_table.o -LOAD build/luos_bootloader/production/_ext/1555399743/streaming.o -LOAD build/luos_bootloader/production/_ext/1234256160/luos_hal.o -LOAD build/luos_bootloader/production/_ext/1857845632/robus_hal.o -LOAD build/luos_bootloader/production/_ext/1000620745/msg_alloc.o -LOAD build/luos_bootloader/production/_ext/1000620745/port_manager.o -LOAD build/luos_bootloader/production/_ext/1000620745/reception.o -LOAD build/luos_bootloader/production/_ext/1000620745/robus.o -LOAD build/luos_bootloader/production/_ext/1000620745/target.o -LOAD build/luos_bootloader/production/_ext/1000620745/timestamp.o -LOAD build/luos_bootloader/production/_ext/1000620745/transmission.o - 0x00000001 __MPLAB_BUILD = 0x1 - 0x0000a000 __rom_end = (ORIGIN (rom) + LENGTH (rom)) - 0x20008000 __ram_end = (ORIGIN (ram) + LENGTH (ram)) - -.config_00804000 - 0x00804000 0x4 - *(.config_00804000) - .config_00804000 - 0x00804000 0x4 build/luos_bootloader/production/_ext/1137593668/initialization.o - 0x00804000 __config_00804000 - -.config_00804004 - 0x00804004 0x4 - *(.config_00804004) - .config_00804004 - 0x00804004 0x4 build/luos_bootloader/production/_ext/1137593668/initialization.o - 0x00804004 __config_00804004 - -.vectors 0x00000000 0xb0 - 0x00000000 . = ALIGN (0x4) - 0x00000000 _sfixed = . - *(.vectors .vectors.* .vectors_default .vectors_default.*) - .vectors 0x00000000 0xb0 build/luos_bootloader/production/_ext/1137593668/interrupts.o - 0x00000000 exception_table - *(.isr_vector) - *(.reset*) - *(.after_vectors) - -.text 0x000000b0 0x20 - 0x000000b0 . = ALIGN (0x4) - *(.glue_7t) - .glue_7t 0x000000b0 0x0 linker stubs - *(.glue_7) - .glue_7 0x000000b0 0x0 linker stubs - *(.gnu.linkonce.r.*) - *(.ARM.extab* .gnu.linkonce.armextab.*) - 0x000000b0 . = ALIGN (0x4) - *(.init) - .init 0x000000b0 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crti.o - 0x000000b0 _init - .init 0x000000b4 0x8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtn.o - 0x000000bc . = ALIGN (0x4) - 0x000000bc __preinit_array_start = . - *(.preinit_array) - 0x000000bc __preinit_array_end = . - 0x000000bc . = ALIGN (0x4) - 0x000000bc __init_array_start = . - *(SORT_BY_NAME(.init_array.*)) - *(.init_array) - .init_array 0x000000bc 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtbegin.o - 0x000000c0 __init_array_end = . - 0x000000c0 . = ALIGN (0x4) - *crtbegin.o(.ctors) - *(EXCLUDE_FILE(*crtend.o) .ctors) - *(SORT_BY_NAME(.ctors.*)) - *crtend.o(.ctors) - 0x000000c0 . = ALIGN (0x4) - *(.fini) - .fini 0x000000c0 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crti.o - 0x000000c0 _fini - .fini 0x000000c4 0x8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtn.o - 0x000000cc . = ALIGN (0x4) - 0x000000cc __fini_array_start = . - *(.fini_array) - .fini_array 0x000000cc 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtbegin.o - *(SORT_BY_NAME(.fini_array.*)) - 0x000000d0 __fini_array_end = . - *crtbegin.o(.dtors) - *(EXCLUDE_FILE(*crtend.o) .dtors) - *(SORT_BY_NAME(.dtors.*)) - *crtend.o(.dtors) - 0x000000d0 . = ALIGN (0x4) - 0x000000d0 _efixed = . - [!provide] PROVIDE (__exidx_start = .) - -.ARM.exidx 0x000000d0 0x8 - *(.ARM.exidx* .gnu.linkonce.armexidx.*) - .ARM.exidx 0x000000d0 0x8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - [!provide] PROVIDE (__exidx_end = .) - 0x000000d8 . = ALIGN (0x4) - 0x000000d8 _etext = . - -.bss 0x20000000 0x4 - 0x20000000 . = ALIGN (0x4) - 0x20000000 __bss_start__ = . - 0x20000000 _sbss = . - 0x20000000 _szero = . - *(COMMON) - COMMON 0x20000000 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-reent.o) - 0x20000000 errno - 0x20000004 . = ALIGN (0x4) - 0x20000004 __bss_end__ = . - 0x20000004 _ebss = . - 0x20000004 _ezero = . - 0x20000004 . = ALIGN (0x4) - 0x20000004 _end = . - 0x20007fff _ram_end_ = ((ORIGIN (ram) + LENGTH (ram)) - 0x1) - 0x00000200 _min_heap_size = 0x200 -START GROUP -LOAD c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a -LOAD c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a -LOAD c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libm_nano.a -LOAD c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a -END GROUP -LOAD c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtend.o -LOAD c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtn.o -OUTPUT(dist/luos_bootloader/production/luos_bootloader_samd21j18a.X.production.elf elf32-littlearm) -LOAD stack -LOAD data_init - -.ARM.attributes - 0x00000000 0x28 - .ARM.attributes - 0x00000000 0x1e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crti.o - .ARM.attributes - 0x0000001e 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtbegin.o - .ARM.attributes - 0x0000004a 0x2c build/luos_bootloader/production/_ext/903266522/plib_clock.o - .ARM.attributes - 0x00000076 0x2c build/luos_bootloader/production/_ext/901117036/plib_evsys.o - .ARM.attributes - 0x000000a2 0x2c build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .ARM.attributes - 0x000000ce 0x2c build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .ARM.attributes - 0x000000fa 0x2c build/luos_bootloader/production/_ext/1968410007/plib_port.o - .ARM.attributes - 0x00000126 0x2c build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - .ARM.attributes - 0x00000152 0x2c build/luos_bootloader/production/_ext/1137593668/initialization.o - .ARM.attributes - 0x0000017e 0x2c build/luos_bootloader/production/_ext/1137593668/interrupts.o - .ARM.attributes - 0x000001aa 0x2c build/luos_bootloader/production/_ext/1137593668/exceptions.o - .ARM.attributes - 0x000001d6 0x2c build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - .ARM.attributes - 0x00000202 0x2c build/luos_bootloader/production/_ext/1360937237/main.o - .ARM.attributes - 0x0000022e 0x2c build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - .ARM.attributes - 0x0000025a 0x2c build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .ARM.attributes - 0x00000286 0x2c build/luos_bootloader/production/_ext/1555399743/luos_utils.o - .ARM.attributes - 0x000002b2 0x2c build/luos_bootloader/production/_ext/1555399743/routing_table.o - .ARM.attributes - 0x000002de 0x2c build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .ARM.attributes - 0x0000030a 0x2c build/luos_bootloader/production/_ext/1857845632/robus_hal.o - .ARM.attributes - 0x00000336 0x2c build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .ARM.attributes - 0x00000362 0x2c build/luos_bootloader/production/_ext/1000620745/port_manager.o - .ARM.attributes - 0x0000038e 0x2c build/luos_bootloader/production/_ext/1000620745/reception.o - .ARM.attributes - 0x000003ba 0x2c build/luos_bootloader/production/_ext/1000620745/robus.o - .ARM.attributes - 0x000003e6 0x2c build/luos_bootloader/production/_ext/1000620745/target.o - .ARM.attributes - 0x00000412 0x2c build/luos_bootloader/production/_ext/1000620745/timestamp.o - .ARM.attributes - 0x0000043e 0x2c build/luos_bootloader/production/_ext/1000620745/transmission.o - .ARM.attributes - 0x0000046a 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - .ARM.attributes - 0x00000496 0x1e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivsi3.o) - .ARM.attributes - 0x000004b4 0x1e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_dvmd_tls.o) - .ARM.attributes - 0x000004d2 0x1e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_aeabi_uldivmod.o) - .ARM.attributes - 0x000004f0 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - .ARM.attributes - 0x0000051c 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - .ARM.attributes - 0x00000548 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - .ARM.attributes - 0x00000574 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - .ARM.attributes - 0x000005a0 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - .ARM.attributes - 0x000005cc 0x1e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) - .ARM.attributes - 0x000005ea 0x1e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzsi2.o) - .ARM.attributes - 0x00000608 0x1e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzdi2.o) - .ARM.attributes - 0x00000626 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - .ARM.attributes - 0x00000652 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - .ARM.attributes - 0x0000067e 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - .ARM.attributes - 0x000006aa 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-sprintf.cdnopsuxX.o) - .ARM.attributes - 0x000006d6 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-init.o) - .ARM.attributes - 0x00000702 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memcpy-stub.o) - .ARM.attributes - 0x0000072e 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memset.o) - .ARM.attributes - 0x0000075a 0x1c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strcmp.o) - .ARM.attributes - 0x00000776 0x1c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strlen.o) - .ARM.attributes - 0x00000792 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) - .ARM.attributes - 0x000007be 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-__ssfputs.o) - .ARM.attributes - 0x000007ea 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - .ARM.attributes - 0x00000816 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fputwc.o) - .ARM.attributes - 0x00000842 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fwalk.o) - .ARM.attributes - 0x0000086e 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-impure.o) - .ARM.attributes - 0x0000089a 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) - .ARM.attributes - 0x000008c6 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mbtowc_r.o) - .ARM.attributes - 0x000008f2 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memchr-stub.o) - .ARM.attributes - 0x0000091e 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-mallocr.o) - .ARM.attributes - 0x0000094a 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-vfprintf_i.o) - .ARM.attributes - 0x00000976 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-sbrkr.o) - .ARM.attributes - 0x000009a2 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) - .ARM.attributes - 0x000009ce 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wbuf.o) - .ARM.attributes - 0x000009fa 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wcrtomb.o) - .ARM.attributes - 0x00000a26 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wctomb_r.o) - .ARM.attributes - 0x00000a52 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-writer.o) - .ARM.attributes - 0x00000a7e 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wsetup.o) - .ARM.attributes - 0x00000aaa 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-closer.o) - .ARM.attributes - 0x00000ad6 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-ctype_.o) - .ARM.attributes - 0x00000b02 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fflush.o) - .ARM.attributes - 0x00000b2e 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-lseekr.o) - .ARM.attributes - 0x00000b5a 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-makebuf.o) - .ARM.attributes - 0x00000b86 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mlock.o) - .ARM.attributes - 0x00000bb2 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-freer.o) - .ARM.attributes - 0x00000bde 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-readr.o) - .ARM.attributes - 0x00000c0a 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-reent.o) - .ARM.attributes - 0x00000c36 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fstatr.o) - .ARM.attributes - 0x00000c62 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-isattyr.o) - .ARM.attributes - 0x00000c8e 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .ARM.attributes - 0x00000cba 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .ARM.attributes - 0x00000ce6 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .ARM.attributes - 0x00000d12 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .ARM.attributes - 0x00000d3e 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .ARM.attributes - 0x00000d6a 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - .ARM.attributes - 0x00000d96 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .ARM.attributes - 0x00000dc2 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .ARM.attributes - 0x00000dee 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - .ARM.attributes - 0x00000e1a 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - .ARM.attributes - 0x00000e46 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - .ARM.attributes - 0x00000e72 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .ARM.attributes - 0x00000e9e 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - .ARM.attributes - 0x00000eca 0x1e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtn.o - -.comment 0x00000000 0x53 - .comment 0x00000000 0x53 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtbegin.o - 0x54 (size before relaxing) - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/903266522/plib_clock.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/901117036/plib_evsys.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1137593668/initialization.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1137593668/interrupts.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1137593668/exceptions.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1360937237/main.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1555399743/luos_utils.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1555399743/routing_table.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1000620745/port_manager.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1000620745/reception.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1000620745/robus.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1000620745/target.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1000620745/timestamp.o - .comment 0x00000053 0x54 build/luos_bootloader/production/_ext/1000620745/transmission.o - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-sprintf.cdnopsuxX.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-init.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memcpy-stub.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memset.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-__ssfputs.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fputwc.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fwalk.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-impure.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mbtowc_r.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memchr-stub.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-mallocr.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-vfprintf_i.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-sbrkr.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wbuf.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wcrtomb.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wctomb_r.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-writer.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wsetup.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-closer.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-ctype_.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fflush.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-lseekr.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-makebuf.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mlock.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-freer.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-readr.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-reent.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fstatr.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-isattyr.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .comment 0x00000053 0x54 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - -.debug_info 0x00000000 0x2bf09 - .debug_info 0x00000000 0x8d9 build/luos_bootloader/production/_ext/903266522/plib_clock.o - .debug_info 0x000008d9 0x37b build/luos_bootloader/production/_ext/901117036/plib_evsys.o - .debug_info 0x00000c54 0x5ba build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .debug_info 0x0000120e 0x1403 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .debug_info 0x00002611 0xd99 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .debug_info 0x000033aa 0x30c build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - .debug_info 0x000036b6 0x635 build/luos_bootloader/production/_ext/1137593668/initialization.o - .debug_info 0x00003ceb 0x8d8 build/luos_bootloader/production/_ext/1137593668/interrupts.o - .debug_info 0x000045c3 0x396 build/luos_bootloader/production/_ext/1137593668/exceptions.o - .debug_info 0x00004959 0x521 build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - .debug_info 0x00004e7a 0xf3b build/luos_bootloader/production/_ext/1360937237/main.o - .debug_info 0x00005db5 0x218d build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - .debug_info 0x00007f42 0x3eb1 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .debug_info 0x0000bdf3 0x13a0 build/luos_bootloader/production/_ext/1555399743/luos_utils.o - .debug_info 0x0000d193 0x3266 build/luos_bootloader/production/_ext/1555399743/routing_table.o - .debug_info 0x000103f9 0x1c61 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .debug_info 0x0001205a 0x2e9e build/luos_bootloader/production/_ext/1857845632/robus_hal.o - .debug_info 0x00014ef8 0x5b58 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .debug_info 0x0001aa50 0xcce build/luos_bootloader/production/_ext/1000620745/port_manager.o - .debug_info 0x0001b71e 0x263c build/luos_bootloader/production/_ext/1000620745/reception.o - .debug_info 0x0001dd5a 0x269d build/luos_bootloader/production/_ext/1000620745/robus.o - .debug_info 0x000203f7 0xa3a build/luos_bootloader/production/_ext/1000620745/target.o - .debug_info 0x00020e31 0x1759 build/luos_bootloader/production/_ext/1000620745/timestamp.o - .debug_info 0x0002258a 0x1c62 build/luos_bootloader/production/_ext/1000620745/transmission.o - .debug_info 0x000241ec 0x2c3 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - .debug_info 0x000244af 0x26 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivsi3.o) - .debug_info 0x000244d5 0x26 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_dvmd_tls.o) - .debug_info 0x000244fb 0x26 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_aeabi_uldivmod.o) - .debug_info 0x00024521 0x1b5e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - .debug_info 0x0002607f 0x1c12 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - .debug_info 0x00027c91 0x6e2 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - .debug_info 0x00028373 0x63e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - .debug_info 0x000289b1 0x441 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - .debug_info 0x00028df2 0x26 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) - .debug_info 0x00028e18 0x26 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzsi2.o) - .debug_info 0x00028e3e 0x26 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzdi2.o) - .debug_info 0x00028e64 0x491 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - .debug_info 0x000292f5 0x4c3 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - .debug_info 0x000297b8 0x4c3 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - .debug_info 0x00029c7b 0x2aa c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .debug_info 0x00029f25 0x2aa c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .debug_info 0x0002a1cf 0x2ac c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .debug_info 0x0002a47b 0x2aa c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .debug_info 0x0002a725 0x2a8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .debug_info 0x0002a9cd 0x2a6 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - .debug_info 0x0002ac73 0x2aa c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .debug_info 0x0002af1d 0x2a7 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .debug_info 0x0002b1c4 0x2a7 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - .debug_info 0x0002b46b 0x2a9 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - .debug_info 0x0002b714 0x2a7 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - .debug_info 0x0002b9bb 0x2a6 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .debug_info 0x0002bc61 0x2a8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - -.debug_abbrev 0x00000000 0x5084 - .debug_abbrev 0x00000000 0x12d build/luos_bootloader/production/_ext/903266522/plib_clock.o - .debug_abbrev 0x0000012d 0x3b build/luos_bootloader/production/_ext/901117036/plib_evsys.o - .debug_abbrev 0x00000168 0x118 build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .debug_abbrev 0x00000280 0x2a7 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .debug_abbrev 0x00000527 0x1c7 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .debug_abbrev 0x000006ee 0x80 build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - .debug_abbrev 0x0000076e 0xda build/luos_bootloader/production/_ext/1137593668/initialization.o - .debug_abbrev 0x00000848 0xa6 build/luos_bootloader/production/_ext/1137593668/interrupts.o - .debug_abbrev 0x000008ee 0x3e build/luos_bootloader/production/_ext/1137593668/exceptions.o - .debug_abbrev 0x0000092c 0x11f build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - .debug_abbrev 0x00000a4b 0x1f1 build/luos_bootloader/production/_ext/1360937237/main.o - .debug_abbrev 0x00000c3c 0x4d8 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - .debug_abbrev 0x00001114 0x673 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .debug_abbrev 0x00001787 0x2bc build/luos_bootloader/production/_ext/1555399743/luos_utils.o - .debug_abbrev 0x00001a43 0x547 build/luos_bootloader/production/_ext/1555399743/routing_table.o - .debug_abbrev 0x00001f8a 0x52b build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .debug_abbrev 0x000024b5 0x4a7 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - .debug_abbrev 0x0000295c 0x572 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .debug_abbrev 0x00002ece 0x1e5 build/luos_bootloader/production/_ext/1000620745/port_manager.o - .debug_abbrev 0x000030b3 0x483 build/luos_bootloader/production/_ext/1000620745/reception.o - .debug_abbrev 0x00003536 0x597 build/luos_bootloader/production/_ext/1000620745/robus.o - .debug_abbrev 0x00003acd 0x17b build/luos_bootloader/production/_ext/1000620745/target.o - .debug_abbrev 0x00003c48 0x384 build/luos_bootloader/production/_ext/1000620745/timestamp.o - .debug_abbrev 0x00003fcc 0x32d build/luos_bootloader/production/_ext/1000620745/transmission.o - .debug_abbrev 0x000042f9 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - .debug_abbrev 0x00004327 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivsi3.o) - .debug_abbrev 0x0000433b 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_dvmd_tls.o) - .debug_abbrev 0x0000434f 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_aeabi_uldivmod.o) - .debug_abbrev 0x00004363 0x130 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - .debug_abbrev 0x00004493 0x157 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - .debug_abbrev 0x000045ea 0x161 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - .debug_abbrev 0x0000474b 0x172 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - .debug_abbrev 0x000048bd 0x153 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - .debug_abbrev 0x00004a10 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) - .debug_abbrev 0x00004a24 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzsi2.o) - .debug_abbrev 0x00004a38 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzdi2.o) - .debug_abbrev 0x00004a4c 0x14a c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - .debug_abbrev 0x00004b96 0x14c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - .debug_abbrev 0x00004ce2 0x14c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - .debug_abbrev 0x00004e2e 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .debug_abbrev 0x00004e5c 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .debug_abbrev 0x00004e8a 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .debug_abbrev 0x00004eb8 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .debug_abbrev 0x00004ee6 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .debug_abbrev 0x00004f14 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - .debug_abbrev 0x00004f42 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .debug_abbrev 0x00004f70 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .debug_abbrev 0x00004f9e 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - .debug_abbrev 0x00004fcc 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - .debug_abbrev 0x00004ffa 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - .debug_abbrev 0x00005028 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .debug_abbrev 0x00005056 0x2e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - -.debug_loc 0x00000000 0xa1c8 - .debug_loc 0x00000000 0x8e build/luos_bootloader/production/_ext/903266522/plib_clock.o - .debug_loc 0x0000008e 0x2e build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .debug_loc 0x000000bc 0x228 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .debug_loc 0x000002e4 0x226 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .debug_loc 0x0000050a 0x25 build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - .debug_loc 0x0000052f 0x45 build/luos_bootloader/production/_ext/1137593668/initialization.o - .debug_loc 0x00000574 0x20 build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - .debug_loc 0x00000594 0x20 build/luos_bootloader/production/_ext/1360937237/main.o - .debug_loc 0x000005b4 0x575 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - .debug_loc 0x00000b29 0x1b97 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .debug_loc 0x000026c0 0x64 build/luos_bootloader/production/_ext/1555399743/luos_utils.o - .debug_loc 0x00002724 0xebb build/luos_bootloader/production/_ext/1555399743/routing_table.o - .debug_loc 0x000035df 0x631 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .debug_loc 0x00003c10 0x792 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - .debug_loc 0x000043a2 0x256c build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .debug_loc 0x0000690e 0x253 build/luos_bootloader/production/_ext/1000620745/port_manager.o - .debug_loc 0x00006b61 0x87f build/luos_bootloader/production/_ext/1000620745/reception.o - .debug_loc 0x000073e0 0x7f2 build/luos_bootloader/production/_ext/1000620745/robus.o - .debug_loc 0x00007bd2 0x107 build/luos_bootloader/production/_ext/1000620745/target.o - .debug_loc 0x00007cd9 0x3ad build/luos_bootloader/production/_ext/1000620745/timestamp.o - .debug_loc 0x00008086 0x2f6 build/luos_bootloader/production/_ext/1000620745/transmission.o - .debug_loc 0x0000837c 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - .debug_loc 0x00008390 0x62 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - .debug_loc 0x000083f2 0x41c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - .debug_loc 0x0000880e 0x8ef c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - .debug_loc 0x000090fd 0x8e2 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - .debug_loc 0x000099df 0xf4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - .debug_loc 0x00009ad3 0x166 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - .debug_loc 0x00009c39 0x27d c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - .debug_loc 0x00009eb6 0x272 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - .debug_loc 0x0000a128 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .debug_loc 0x0000a13c 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .debug_loc 0x0000a150 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .debug_loc 0x0000a164 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .debug_loc 0x0000a178 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .debug_loc 0x0000a18c 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .debug_loc 0x0000a1a0 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .debug_loc 0x0000a1b4 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - -.debug_aranges 0x00000000 0xc08 - .debug_aranges - 0x00000000 0x20 build/luos_bootloader/production/_ext/903266522/plib_clock.o - .debug_aranges - 0x00000020 0x20 build/luos_bootloader/production/_ext/901117036/plib_evsys.o - .debug_aranges - 0x00000040 0x38 build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .debug_aranges - 0x00000078 0x60 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .debug_aranges - 0x000000d8 0x70 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .debug_aranges - 0x00000148 0x28 build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - .debug_aranges - 0x00000170 0x20 build/luos_bootloader/production/_ext/1137593668/initialization.o - .debug_aranges - 0x00000190 0x20 build/luos_bootloader/production/_ext/1137593668/interrupts.o - .debug_aranges - 0x000001b0 0x28 build/luos_bootloader/production/_ext/1137593668/exceptions.o - .debug_aranges - 0x000001d8 0x28 build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - .debug_aranges - 0x00000200 0x20 build/luos_bootloader/production/_ext/1360937237/main.o - .debug_aranges - 0x00000220 0x50 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - .debug_aranges - 0x00000270 0xf8 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .debug_aranges - 0x00000368 0x28 build/luos_bootloader/production/_ext/1555399743/luos_utils.o - .debug_aranges - 0x00000390 0xd8 build/luos_bootloader/production/_ext/1555399743/routing_table.o - .debug_aranges - 0x00000468 0xa8 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .debug_aranges - 0x00000510 0x98 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - .debug_aranges - 0x000005a8 0xe8 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .debug_aranges - 0x00000690 0x40 build/luos_bootloader/production/_ext/1000620745/port_manager.o - .debug_aranges - 0x000006d0 0x78 build/luos_bootloader/production/_ext/1000620745/reception.o - .debug_aranges - 0x00000748 0x90 build/luos_bootloader/production/_ext/1000620745/robus.o - .debug_aranges - 0x000007d8 0x28 build/luos_bootloader/production/_ext/1000620745/target.o - .debug_aranges - 0x00000800 0x48 build/luos_bootloader/production/_ext/1000620745/timestamp.o - .debug_aranges - 0x00000848 0x40 build/luos_bootloader/production/_ext/1000620745/transmission.o - .debug_aranges - 0x00000888 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - .debug_aranges - 0x000008a8 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivsi3.o) - .debug_aranges - 0x000008c8 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_dvmd_tls.o) - .debug_aranges - 0x000008e8 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_aeabi_uldivmod.o) - .debug_aranges - 0x00000908 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - .debug_aranges - 0x00000928 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - .debug_aranges - 0x00000948 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - .debug_aranges - 0x00000968 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - .debug_aranges - 0x00000988 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - .debug_aranges - 0x000009a8 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) - .debug_aranges - 0x000009c8 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzsi2.o) - .debug_aranges - 0x000009e8 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzdi2.o) - .debug_aranges - 0x00000a08 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - .debug_aranges - 0x00000a28 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - .debug_aranges - 0x00000a48 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - .debug_aranges - 0x00000a68 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .debug_aranges - 0x00000a88 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .debug_aranges - 0x00000aa8 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .debug_aranges - 0x00000ac8 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .debug_aranges - 0x00000ae8 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .debug_aranges - 0x00000b08 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - .debug_aranges - 0x00000b28 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .debug_aranges - 0x00000b48 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .debug_aranges - 0x00000b68 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - .debug_aranges - 0x00000b88 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - .debug_aranges - 0x00000ba8 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - .debug_aranges - 0x00000bc8 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .debug_aranges - 0x00000be8 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - -.debug_ranges 0x00000000 0x19b0 - .debug_ranges 0x00000000 0x28 build/luos_bootloader/production/_ext/903266522/plib_clock.o - .debug_ranges 0x00000028 0x10 build/luos_bootloader/production/_ext/901117036/plib_evsys.o - .debug_ranges 0x00000038 0x28 build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .debug_ranges 0x00000060 0x50 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .debug_ranges 0x000000b0 0x60 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .debug_ranges 0x00000110 0x18 build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - .debug_ranges 0x00000128 0x10 build/luos_bootloader/production/_ext/1137593668/initialization.o - .debug_ranges 0x00000138 0x10 build/luos_bootloader/production/_ext/1137593668/interrupts.o - .debug_ranges 0x00000148 0x18 build/luos_bootloader/production/_ext/1137593668/exceptions.o - .debug_ranges 0x00000160 0x18 build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - .debug_ranges 0x00000178 0x10 build/luos_bootloader/production/_ext/1360937237/main.o - .debug_ranges 0x00000188 0x88 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - .debug_ranges 0x00000210 0x2c0 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .debug_ranges 0x000004d0 0x18 build/luos_bootloader/production/_ext/1555399743/luos_utils.o - .debug_ranges 0x000004e8 0x158 build/luos_bootloader/production/_ext/1555399743/routing_table.o - .debug_ranges 0x00000640 0x98 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .debug_ranges 0x000006d8 0xd0 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - .debug_ranges 0x000007a8 0xb08 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .debug_ranges 0x000012b0 0x48 build/luos_bootloader/production/_ext/1000620745/port_manager.o - .debug_ranges 0x000012f8 0x128 build/luos_bootloader/production/_ext/1000620745/reception.o - .debug_ranges 0x00001420 0x118 build/luos_bootloader/production/_ext/1000620745/robus.o - .debug_ranges 0x00001538 0x18 build/luos_bootloader/production/_ext/1000620745/target.o - .debug_ranges 0x00001550 0x38 build/luos_bootloader/production/_ext/1000620745/timestamp.o - .debug_ranges 0x00001588 0x78 build/luos_bootloader/production/_ext/1000620745/transmission.o - .debug_ranges 0x00001600 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - .debug_ranges 0x00001610 0x58 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - .debug_ranges 0x00001668 0x198 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - .debug_ranges 0x00001800 0x30 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - .debug_ranges 0x00001830 0x58 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - .debug_ranges 0x00001888 0x58 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - .debug_ranges 0x000018e0 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .debug_ranges 0x000018f0 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .debug_ranges 0x00001900 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .debug_ranges 0x00001910 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .debug_ranges 0x00001920 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .debug_ranges 0x00001930 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - .debug_ranges 0x00001940 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .debug_ranges 0x00001950 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .debug_ranges 0x00001960 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - .debug_ranges 0x00001970 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - .debug_ranges 0x00001980 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - .debug_ranges 0x00001990 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .debug_ranges 0x000019a0 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - -.debug_line 0x00000000 0xbc3b - .debug_line 0x00000000 0x216 build/luos_bootloader/production/_ext/903266522/plib_clock.o - .debug_line 0x00000216 0x6e build/luos_bootloader/production/_ext/901117036/plib_evsys.o - .debug_line 0x00000284 0x26a build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .debug_line 0x000004ee 0x343 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .debug_line 0x00000831 0x2c3 build/luos_bootloader/production/_ext/1968410007/plib_port.o - .debug_line 0x00000af4 0x85 build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - .debug_line 0x00000b79 0x27e build/luos_bootloader/production/_ext/1137593668/initialization.o - .debug_line 0x00000df7 0x10c build/luos_bootloader/production/_ext/1137593668/interrupts.o - .debug_line 0x00000f03 0x76 build/luos_bootloader/production/_ext/1137593668/exceptions.o - .debug_line 0x00000f79 0x1ab build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - .debug_line 0x00001124 0x192 build/luos_bootloader/production/_ext/1360937237/main.o - .debug_line 0x000012b6 0x69d build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - .debug_line 0x00001953 0x127e build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .debug_line 0x00002bd1 0x2dc build/luos_bootloader/production/_ext/1555399743/luos_utils.o - .debug_line 0x00002ead 0xc6f build/luos_bootloader/production/_ext/1555399743/routing_table.o - .debug_line 0x00003b1c 0x714 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .debug_line 0x00004230 0xaf1 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - .debug_line 0x00004d21 0x2955 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .debug_line 0x00007676 0x398 build/luos_bootloader/production/_ext/1000620745/port_manager.o - .debug_line 0x00007a0e 0xcaa build/luos_bootloader/production/_ext/1000620745/reception.o - .debug_line 0x000086b8 0xa35 build/luos_bootloader/production/_ext/1000620745/robus.o - .debug_line 0x000090ed 0x1c8 build/luos_bootloader/production/_ext/1000620745/target.o - .debug_line 0x000092b5 0x445 build/luos_bootloader/production/_ext/1000620745/timestamp.o - .debug_line 0x000096fa 0x4ef build/luos_bootloader/production/_ext/1000620745/transmission.o - .debug_line 0x00009be9 0x132 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - .debug_line 0x00009d1b 0xa8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivsi3.o) - .debug_line 0x00009dc3 0x9c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_dvmd_tls.o) - .debug_line 0x00009e5f 0xa7 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_aeabi_uldivmod.o) - .debug_line 0x00009f06 0x2cb c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - .debug_line 0x0000a1d1 0x3d7 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - .debug_line 0x0000a5a8 0x279 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - .debug_line 0x0000a821 0x314 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - .debug_line 0x0000ab35 0x154 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - .debug_line 0x0000ac89 0xb1 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) - .debug_line 0x0000ad3a 0xb0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzsi2.o) - .debug_line 0x0000adea 0xa6 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzdi2.o) - .debug_line 0x0000ae90 0x179 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - .debug_line 0x0000b009 0x1a8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - .debug_line 0x0000b1b1 0x1a4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - .debug_line 0x0000b355 0xa2 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .debug_line 0x0000b3f7 0xa2 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .debug_line 0x0000b499 0xa3 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .debug_line 0x0000b53c 0xa2 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .debug_line 0x0000b5de 0xa1 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .debug_line 0x0000b67f 0xb5 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - .debug_line 0x0000b734 0xa2 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .debug_line 0x0000b7d6 0xa1 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .debug_line 0x0000b877 0x10c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - .debug_line 0x0000b983 0x9d c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - .debug_line 0x0000ba20 0x9e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - .debug_line 0x0000babe 0xb8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .debug_line 0x0000bb76 0xc5 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - -.debug_str 0x00000000 0x1636 - .debug_str 0x00000000 0x0 build/luos_bootloader/production/_ext/903266522/plib_clock.o - .debug_str 0x00000000 0x0 build/luos_bootloader/production/_ext/901117036/plib_evsys.o - .debug_str 0x00000000 0x0 build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .debug_str 0x00000000 0x1f build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .debug_str 0x0000001f 0xb build/luos_bootloader/production/_ext/1968410007/plib_port.o - .debug_str 0x0000002a 0x0 build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - .debug_str 0x0000002a 0x55 build/luos_bootloader/production/_ext/1137593668/initialization.o - .debug_str 0x0000007f 0x0 build/luos_bootloader/production/_ext/1137593668/interrupts.o - .debug_str 0x0000007f 0x0 build/luos_bootloader/production/_ext/1137593668/exceptions.o - .debug_str 0x0000007f 0x2f build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - .debug_str 0x000000ae 0x26 build/luos_bootloader/production/_ext/1360937237/main.o - .debug_str 0x000000d4 0x113 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - .debug_str 0x000001e7 0x491 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .debug_str 0x00000678 0x61 build/luos_bootloader/production/_ext/1555399743/luos_utils.o - .debug_str 0x000006d9 0x14d build/luos_bootloader/production/_ext/1555399743/routing_table.o - .debug_str 0x00000826 0x3a build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .debug_str 0x00000860 0x1b5 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - .debug_str 0x00000a15 0x7b build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .debug_str 0x00000a90 0x71 build/luos_bootloader/production/_ext/1000620745/port_manager.o - .debug_str 0x00000b01 0x1c2 build/luos_bootloader/production/_ext/1000620745/reception.o - .debug_str 0x00000cc3 0x1a9 build/luos_bootloader/production/_ext/1000620745/robus.o - .debug_str 0x00000e6c 0xb build/luos_bootloader/production/_ext/1000620745/target.o - .debug_str 0x00000e77 0x3a build/luos_bootloader/production/_ext/1000620745/timestamp.o - .debug_str 0x00000eb1 0x110 build/luos_bootloader/production/_ext/1000620745/transmission.o - .debug_str 0x00000fc1 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - .debug_str 0x00000fc1 0xee c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivsi3.o) - .debug_str 0x000010af 0xee c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_dvmd_tls.o) - .debug_str 0x0000119d 0xee c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_aeabi_uldivmod.o) - .debug_str 0x0000128b 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - .debug_str 0x0000128b 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - .debug_str 0x0000128b 0x30 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - .debug_str 0x000012bb 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - .debug_str 0x000012e7 0x13 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - .debug_str 0x000012fa 0xee c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) - .debug_str 0x000013e8 0xee c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzsi2.o) - .debug_str 0x000014d6 0xee c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzdi2.o) - .debug_str 0x000015c4 0x26 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - .debug_str 0x000015ea 0x26 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - .debug_str 0x00001610 0x26 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - .debug_str 0x00001636 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .debug_str 0x00001636 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .debug_str 0x00001636 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .debug_str 0x00001636 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .debug_str 0x00001636 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .debug_str 0x00001636 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - .debug_str 0x00001636 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .debug_str 0x00001636 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .debug_str 0x00001636 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - .debug_str 0x00001636 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - .debug_str 0x00001636 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - .debug_str 0x00001636 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .debug_str 0x00001636 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - -.debug_frame 0x00000000 0x1914 - .debug_frame 0x00000000 0x20 build/luos_bootloader/production/_ext/903266522/plib_clock.o - .debug_frame 0x00000020 0x20 build/luos_bootloader/production/_ext/901117036/plib_evsys.o - .debug_frame 0x00000040 0x50 build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - .debug_frame 0x00000090 0xb8 build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - .debug_frame 0x00000148 0xcc build/luos_bootloader/production/_ext/1968410007/plib_port.o - .debug_frame 0x00000214 0x30 build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - .debug_frame 0x00000244 0x28 build/luos_bootloader/production/_ext/1137593668/initialization.o - .debug_frame 0x0000026c 0x20 build/luos_bootloader/production/_ext/1137593668/interrupts.o - .debug_frame 0x0000028c 0x30 build/luos_bootloader/production/_ext/1137593668/exceptions.o - .debug_frame 0x000002bc 0x38 build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - .debug_frame 0x000002f4 0x28 build/luos_bootloader/production/_ext/1360937237/main.o - .debug_frame 0x0000031c 0xe8 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - .debug_frame 0x00000404 0x358 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - .debug_frame 0x0000075c 0x3c build/luos_bootloader/production/_ext/1555399743/luos_utils.o - .debug_frame 0x00000798 0x2bc build/luos_bootloader/production/_ext/1555399743/routing_table.o - .debug_frame 0x00000a54 0x194 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - .debug_frame 0x00000be8 0x198 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - .debug_frame 0x00000d80 0x2cc build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - .debug_frame 0x0000104c 0x8c build/luos_bootloader/production/_ext/1000620745/port_manager.o - .debug_frame 0x000010d8 0x144 build/luos_bootloader/production/_ext/1000620745/reception.o - .debug_frame 0x0000121c 0x1a4 build/luos_bootloader/production/_ext/1000620745/robus.o - .debug_frame 0x000013c0 0x38 build/luos_bootloader/production/_ext/1000620745/target.o - .debug_frame 0x000013f8 0xa4 build/luos_bootloader/production/_ext/1000620745/timestamp.o - .debug_frame 0x0000149c 0x98 build/luos_bootloader/production/_ext/1000620745/transmission.o - .debug_frame 0x00001534 0x34 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - .debug_frame 0x00001568 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivsi3.o) - .debug_frame 0x00001588 0x28 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - .debug_frame 0x000015b0 0x3c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - .debug_frame 0x000015ec 0x38 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - .debug_frame 0x00001624 0x3c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - .debug_frame 0x00001660 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - .debug_frame 0x00001680 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - .debug_frame 0x000016ac 0x30 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - .debug_frame 0x000016dc 0x30 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - .debug_frame 0x0000170c 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strcmp.o) - .debug_frame 0x0000172c 0x28 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - .debug_frame 0x00001754 0x28 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - .debug_frame 0x0000177c 0x28 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - .debug_frame 0x000017a4 0x28 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - .debug_frame 0x000017cc 0x28 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - .debug_frame 0x000017f4 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - .debug_frame 0x00001814 0x28 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - .debug_frame 0x0000183c 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - .debug_frame 0x0000185c 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - .debug_frame 0x0000187c 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - .debug_frame 0x0000189c 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - .debug_frame 0x000018bc 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - .debug_frame 0x000018e8 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - -.stack 0x200015d8 0x100 - .stack 0x200015d8 0x100 stack - -.bss.data_buff%1 - 0x20000004 0x800 - .bss.data_buff - 0x20000004 0x800 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - 0x20000004 data_buff - -.bss.routing_table%2 - 0x20000804 0x370 - .bss.routing_table - 0x20000804 0x370 build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x20000804 routing_table - -.bss.msg_buffer%3 - 0x20000b74 0x195 - .bss.msg_buffer - 0x20000b74 0x195 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x20000b74 msg_buffer - -.data.__global_locale%4 - 0x20000d0c 0x16c - .data.__global_locale - 0x20000d0c 0x16c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) - 0x20000d0c __global_locale - -.bss.service_table%5 - 0x20000e78 0x131 - .bss.service_table - 0x20000e78 0x131 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x20000e78 service_table - -.bss.tx_tasks%6 - 0x20000fac 0xa0 - .bss.tx_tasks 0x20000fac 0xa0 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x20000fac tx_tasks - -.bss.bootloader_data%7 - 0x2000104c 0x7f - .bss.bootloader_data - 0x2000104c 0x7f build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - -.bss.ctx%8 0x200010cc 0x7c - .bss.ctx 0x200010cc 0x7c build/luos_bootloader/production/_ext/1000620745/robus.o - 0x200010cc ctx - -.data.impure_data%9 - 0x20001148 0x60 - .data.impure_data - 0x20001148 0x60 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-impure.o) - -.bss.luos_tasks%10 - 0x200011a8 0x50 - .bss.luos_tasks - 0x200011a8 0x50 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x200011a8 luos_tasks - -.bss.package_table%11 - 0x200011f8 0x28 - .bss.package_table - 0x200011f8 0x28 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x200011f8 package_table - -.bss.msg_tasks%12 - 0x20001220 0x28 - .bss.msg_tasks - 0x20001220 0x28 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x20001220 msg_tasks - -.bss.__sf_fake_stderr%13 - 0x20001248 0x20 - .bss.__sf_fake_stderr - 0x20001248 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - 0x20001248 __sf_fake_stderr - -.bss.__sf_fake_stdin%14 - 0x20001268 0x20 - .bss.__sf_fake_stdin - 0x20001268 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - 0x20001268 __sf_fake_stdin - -.bss.__sf_fake_stdout%15 - 0x20001288 0x20 - .bss.__sf_fake_stdout - 0x20001288 0x20 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - 0x20001288 __sf_fake_stdout - -.bss%16 0x200012a8 0x1c - .bss 0x200012a8 0x1c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtbegin.o - -.bss.ll_timestamp%17 - 0x200012c8 0x18 - .bss.ll_timestamp - 0x200012c8 0x18 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - -.bss.data_size.7939%18 - 0x200012e0 0x14 - .bss.data_size.7939 - 0x200012e0 0x14 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - -.bss.total_data_size.7940%19 - 0x200012f4 0x14 - .bss.total_data_size.7940 - 0x200012f4 0x14 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - -.bss.descriptor_section%20 - 0x20001308 0x10 - .bss.descriptor_section - 0x20001308 0x10 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - -.bss.write_back_section%21 - 0x20001318 0x10 - .bss.write_back_section - 0x20001318 0x10 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - -.bss.ll_rx_timestamp%22 - 0x20001328 0x8 - .bss.ll_rx_timestamp - 0x20001328 0x8 build/luos_bootloader/production/_ext/1000620745/reception.o - -.bss.general_stats%23 - 0x20001330 0x7 - .bss.general_stats - 0x20001330 0x7 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x20001330 general_stats - -.bss.luos_stats%24 - 0x20001338 0x6 - .bss.luos_stats - 0x20001338 0x6 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x20001338 luos_stats - -.bss.PTP%25 0x20001340 0x6 - .bss.PTP 0x20001340 0x6 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x20001340 PTP - -.bss.nb_bytes%26 - 0x200012c4 0x4 - .bss.nb_bytes 0x200012c4 0x4 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - 0x200012c4 nb_bytes - -.bss.tickstart%27 - 0x20001348 0x4 - .bss.tickstart - 0x20001348 0x4 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - 0x20001348 tickstart - -.data.flash_addr%28 - 0x2000134c 0x4 - .data.flash_addr - 0x2000134c 0x4 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - 0x2000134c flash_addr - -.bss.detection_service%29 - 0x20001350 0x4 - .bss.detection_service - 0x20001350 0x4 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x20001350 detection_service - -.bss.last_loop_date.7764%30 - 0x20001354 0x4 - .bss.last_loop_date.7764 - 0x20001354 0x4 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - -.bss.tick%31 0x20001358 0x4 - .bss.tick 0x20001358 0x4 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x20001358 tick - -.bss.tx_data%32 - 0x2000135c 0x4 - .bss.tx_data 0x2000135c 0x4 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x2000135c tx_data - -.bss.copy_task_pointer%33 - 0x20001360 0x4 - .bss.copy_task_pointer - 0x20001360 0x4 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x20001360 copy_task_pointer - -.bss.current_msg%34 - 0x20001364 0x4 - .bss.current_msg - 0x20001364 0x4 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x20001364 current_msg - -.bss.data_end_estimation%35 - 0x20001368 0x4 - .bss.data_end_estimation - 0x20001368 0x4 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x20001368 data_end_estimation - -.bss.data_ptr%36 - 0x2000136c 0x4 - .bss.data_ptr 0x2000136c 0x4 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x2000136c data_ptr - -.bss.mem_stat%37 - 0x20001370 0x4 - .bss.mem_stat 0x20001370 0x4 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x20001370 mem_stat - -.bss.oldest_msg%38 - 0x20001374 0x4 - .bss.oldest_msg - 0x20001374 0x4 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x20001374 oldest_msg - -.bss.used_msg%39 - 0x20001378 0x4 - .bss.used_msg 0x20001378 0x4 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x20001378 used_msg - -.bss.baudrate%40 - 0x2000137c 0x4 - .bss.baudrate 0x2000137c 0x4 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x2000137c baudrate - -.bss%41 0x20001380 0x4 - .bss 0x20001380 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - -.data._impure_ptr%42 - 0x20001384 0x4 - .data._impure_ptr - 0x20001384 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-impure.o) - 0x20001384 _impure_ptr - -.bss.__malloc_free_list%43 - 0x20001388 0x4 - .bss.__malloc_free_list - 0x20001388 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-mallocr.o) - 0x20001388 __malloc_free_list - -.bss.__malloc_sbrk_start%44 - 0x2000138c 0x4 - .bss.__malloc_sbrk_start - 0x2000138c 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-mallocr.o) - 0x2000138c __malloc_sbrk_start - -.bss%45 0x20001390 0x4 - .bss 0x20001390 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - -.data.luos_version%46 - 0x20001394 0x3 - .data.luos_version - 0x20001394 0x3 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x20001394 luos_version - -.bss.bootloader_data_size%47 - 0x2000133e 0x2 - .bss.bootloader_data_size - 0x2000133e 0x2 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - -.bss.data_index%48 - 0x20001346 0x2 - .bss.data_index - 0x20001346 0x2 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - 0x20001346 data_index - -.bss.source_id%49 - 0x20000d0a 0x2 - .bss.source_id - 0x20000d0a 0x2 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - 0x20000d0a source_id - -.data.residual_space%50 - 0x20000faa 0x2 - .data.residual_space - 0x20000faa 0x2 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - 0x20000faa residual_space - -.bss.last_msg_size.7941%51 - 0x20001398 0x2 - .bss.last_msg_size.7941 - 0x20001398 0x2 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - -.bss.package_number%52 - 0x2000139a 0x2 - .bss.package_number - 0x2000139a 0x2 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x2000139a package_number - -.bss.service_number%53 - 0x2000139c 0x2 - .bss.service_number - 0x2000139c 0x2 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x2000139c service_number - -.bss.last_routing_table_entry%54 - 0x2000139e 0x2 - .bss.last_routing_table_entry - 0x2000139e 0x2 build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x2000139e last_routing_table_entry - -.bss.last_service%55 - 0x200013a0 0x2 - .bss.last_service - 0x200013a0 0x2 build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x200013a0 last_service - -.bss.data_size_to_transmit%56 - 0x200013a2 0x2 - .bss.data_size_to_transmit - 0x200013a2 0x2 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x200013a2 data_size_to_transmit - -.bss.timoutclockcnt%57 - 0x200013a4 0x2 - .bss.timoutclockcnt - 0x200013a4 0x2 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x200013a4 timoutclockcnt - -.bss.luos_tasks_stack_id%58 - 0x200013a6 0x2 - .bss.luos_tasks_stack_id - 0x200013a6 0x2 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x200013a6 luos_tasks_stack_id - -.bss.msg_tasks_stack_id%59 - 0x200013a8 0x2 - .bss.msg_tasks_stack_id - 0x200013a8 0x2 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x200013a8 msg_tasks_stack_id - -.bss.tx_tasks_stack_id%60 - 0x200013aa 0x2 - .bss.tx_tasks_stack_id - 0x200013aa 0x2 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x200013aa tx_tasks_stack_id - -.bss.crc_val%61 - 0x200013ac 0x2 - .bss.crc_val 0x200013ac 0x2 build/luos_bootloader/production/_ext/1000620745/reception.o - 0x200013ac crc_val - -.bss.data_count%62 - 0x200013ae 0x2 - .bss.data_count - 0x200013ae 0x2 build/luos_bootloader/production/_ext/1000620745/reception.o - 0x200013ae data_count - -.bss.data_size%63 - 0x200013b0 0x2 - .bss.data_size - 0x200013b0 0x2 build/luos_bootloader/production/_ext/1000620745/reception.o - 0x200013b0 data_size - -.bss.large_data_num%64 - 0x200013b2 0x2 - .bss.large_data_num - 0x200013b2 0x2 build/luos_bootloader/production/_ext/1000620745/reception.o - 0x200013b2 large_data_num - -.bss.last_crc.6331%65 - 0x200013b4 0x2 - .bss.last_crc.6331 - 0x200013b4 0x2 build/luos_bootloader/production/_ext/1000620745/reception.o - -.bss.last_node%66 - 0x200013b6 0x2 - .bss.last_node - 0x200013b6 0x2 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x200013b6 last_node - -.bss.crc%67 0x200010cb 0x1 - .bss.crc 0x200010cb 0x1 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - 0x200010cb crc - -.bss.load_flag%68 - 0x20001337 0x1 - .bss.load_flag - 0x20001337 0x1 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - 0x20001337 load_flag - -.bss.node_state.8055%69 - 0x20000d09 0x1 - .bss.node_state.8055 - 0x20000d09 0x1 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - -.bss.mem_clear_needed%70 - 0x20000fa9 0x1 - .bss.mem_clear_needed - 0x20000fa9 0x1 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x20000fa9 mem_clear_needed - -.bss.reset_needed%71 - 0x20001397 0x1 - .bss.reset_needed - 0x20001397 0x1 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x20001397 reset_needed - -.bss.Port_ExpectedState%72 - 0x200013b8 0x1 - .bss.Port_ExpectedState - 0x200013b8 0x1 build/luos_bootloader/production/_ext/1000620745/port_manager.o - 0x200013b8 Port_ExpectedState - -.bss.nbrRetry%73 - 0x200013b9 0x1 - .bss.nbrRetry 0x200013b9 0x1 build/luos_bootloader/production/_ext/1000620745/transmission.o - 0x200013b9 nbrRetry - -.eh_frame%z1 0x00000000 0x0 - .eh_frame 0x00000000 0x0 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtbegin.o - -.text.MsgAlloc_SetTxTask%74 - 0x000000d8 0x68c - .text.MsgAlloc_SetTxTask - 0x000000d8 0x68c build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x000000d8 MsgAlloc_SetTxTask - -.text.MsgAlloc_ClearMsgSpace%75 - 0x00000764 0x670 - .text.MsgAlloc_ClearMsgSpace - 0x00000764 0x670 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - -.text.Luos_MsgHandler%76 - 0x00000dd4 0x5a8 - .text.Luos_MsgHandler - 0x00000dd4 0x5a8 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - -.dinit%77 0x0000137c 0x560 - .dinit 0x0000137c 0x560 data_init - -.text.MsgAlloc_EndMsg%78 - 0x000018dc 0x428 - .text.MsgAlloc_EndMsg - 0x000018dc 0x428 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x000018dc MsgAlloc_EndMsg - -.text.MsgAlloc_LuosTaskAlloc%79 - 0x00001d04 0x3e0 - .text.MsgAlloc_LuosTaskAlloc - 0x00001d04 0x3e0 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x00001d04 MsgAlloc_LuosTaskAlloc - -.text._vfprintf_r_cdnopsuxX%80 - 0x000020e4 0x3dc - .text._vfprintf_r_cdnopsuxX - 0x000020e4 0x3dc c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) - 0x000020e4 _vfprintf_r_cdnopsuxX - -.text.Luos_Loop%81 - 0x000024c0 0x398 - .text.Luos_Loop - 0x000024c0 0x398 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x000024c0 Luos_Loop - -.text%82 0x00002858 0x348 - .text 0x00002858 0x348 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(subsf3.o) - 0x00002858 __aeabi_fsub - -.text.MsgAlloc_PullMsgFromLuosTask%83 - 0x00002ba0 0x308 - .text.MsgAlloc_PullMsgFromLuosTask - 0x00002ba0 0x308 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x00002ba0 MsgAlloc_PullMsgFromLuosTask - -.text.MsgAlloc_PullMsgToInterpret%84 - 0x00002ea8 0x2f0 - .text.MsgAlloc_PullMsgToInterpret - 0x00002ea8 0x2f0 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x00002ea8 MsgAlloc_PullMsgToInterpret - -.text.MsgAlloc_PullServiceFromTxTask%85 - 0x00003198 0x2dc - .text.MsgAlloc_PullServiceFromTxTask - 0x00003198 0x2dc build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x00003198 MsgAlloc_PullServiceFromTxTask - -.text.MsgAlloc_ClearMsgFromLuosTasks%86 - 0x00003474 0x2cc - .text.MsgAlloc_ClearMsgFromLuosTasks - 0x00003474 0x2cc build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x00003474 MsgAlloc_ClearMsgFromLuosTasks - -.text.Recep_InterpretMsgProtocol%87 - 0x00003740 0x2a8 - .text.Recep_InterpretMsgProtocol - 0x00003740 0x2a8 build/luos_bootloader/production/_ext/1000620745/reception.o - 0x00003740 Recep_InterpretMsgProtocol - -.text.MsgAlloc_PullMsgFromTxTask%88 - 0x000039e8 0x290 - .text.MsgAlloc_PullMsgFromTxTask - 0x000039e8 0x290 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x000039e8 MsgAlloc_PullMsgFromTxTask - -.text.LuosBootloader_MsgHandler%89 - 0x00003c78 0x248 - .text.LuosBootloader_MsgHandler - 0x00003c78 0x248 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - 0x00003c78 LuosBootloader_MsgHandler - -.text.Recep_GetData%90 - 0x00003ec0 0x248 - .text.Recep_GetData - 0x00003ec0 0x248 build/luos_bootloader/production/_ext/1000620745/reception.o - 0x00003ec0 Recep_GetData - -.text%91 0x00004108 0x22c - .text 0x00004108 0x22c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - 0x00004108 __aeabi_fmul - -.text.RoutingTB_DetectServices%92 - 0x00004334 0x224 - .text.RoutingTB_DetectServices - 0x00004334 0x224 build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x00004334 RoutingTB_DetectServices - -.text.Robus_Loop%93 - 0x00004558 0x1c4 - .text.Robus_Loop - 0x00004558 0x1c4 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x00004558 Robus_Loop - -.text.Luos_CreateService%94 - 0x0000471c 0x1b4 - .text.Luos_CreateService - 0x0000471c 0x1b4 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x0000471c Luos_CreateService - -.text.Luos_ReceiveData%95 - 0x000048d0 0x1a8 - .text.Luos_ReceiveData - 0x000048d0 0x1a8 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x000048d0 Luos_ReceiveData - -.text%96 0x00004a78 0x1a4 - .text 0x00004a78 0x1a4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivmoddi4.o) - 0x00004a78 __udivmoddi4 - -.text.Recep_NodeConcerned%97 - 0x00004c1c 0x1a0 - .text.Recep_NodeConcerned - 0x00004c1c 0x1a0 build/luos_bootloader/production/_ext/1000620745/reception.o - 0x00004c1c Recep_NodeConcerned - -.text.Transmit_Process%98 - 0x00004dbc 0x174 - .text.Transmit_Process - 0x00004dbc 0x174 build/luos_bootloader/production/_ext/1000620745/transmission.o - 0x00004dbc Transmit_Process - -.text.RobusHAL_ComInit%99 - 0x00004f30 0x154 - .text.RobusHAL_ComInit - 0x00004f30 0x154 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x00004f30 RobusHAL_ComInit - -.text.MsgAlloc_loop%100 - 0x00005084 0x13c - .text.MsgAlloc_loop - 0x00005084 0x13c build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x00005084 MsgAlloc_loop - -.text.Robus_TopologyDetection%101 - 0x000051c0 0x12c - .text.Robus_TopologyDetection - 0x000051c0 0x12c build/luos_bootloader/production/_ext/1000620745/robus.o - 0x000051c0 Robus_TopologyDetection - -.text%102 0x000052ec 0x114 - .text 0x000052ec 0x114 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_udivsi3.o) - 0x000052ec __aeabi_uidiv - 0x000052ec __udivsi3 - 0x000053f8 __aeabi_uidivmod - -.text.__sflush_r%103 - 0x00005400 0x114 - .text.__sflush_r - 0x00005400 0x114 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fflush.o) - 0x00005400 __sflush_r - -.rodata._ctype_%104 - 0x00005514 0x101 - .rodata._ctype_ - 0x00005514 0x101 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-ctype_.o) - 0x00005514 _ctype_ - -.text.Robus_SendMsg%105 - 0x00005618 0x100 - .text.Robus_SendMsg - 0x00005618 0x100 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x00005618 Robus_SendMsg - -.text.RobusHAL_Init%106 - 0x00005718 0xfc - .text.RobusHAL_Init - 0x00005718 0xfc build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x00005718 RobusHAL_Init - -.text.MsgAlloc_Init%107 - 0x00005814 0xec - .text.MsgAlloc_Init - 0x00005814 0xec build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x00005814 MsgAlloc_Init - -.text.Recep_GetHeader%108 - 0x00005900 0xec - .text.Recep_GetHeader - 0x00005900 0xec build/luos_bootloader/production/_ext/1000620745/reception.o - 0x00005900 Recep_GetHeader - -.text.__swsetup_r%109 - 0x000059ec 0xec - .text.__swsetup_r - 0x000059ec 0xec c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wsetup.o) - 0x000059ec __swsetup_r - -.text.Recep_GetConcernedLLService%110 - 0x00005ad8 0xe8 - .text.Recep_GetConcernedLLService - 0x00005ad8 0xe8 build/luos_bootloader/production/_ext/1000620745/reception.o - 0x00005ad8 Recep_GetConcernedLLService - -.text.Recep_GetCollision%111 - 0x00005bc0 0xe8 - .text.Recep_GetCollision - 0x00005bc0 0xe8 build/luos_bootloader/production/_ext/1000620745/reception.o - 0x00005bc0 Recep_GetCollision - -.text._printf_common%112 - 0x00005ca8 0xda - .text._printf_common - 0x00005ca8 0xda c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-vfprintf_i.o) - 0x00005ca8 _printf_common - -.text.__swbuf_r%113 - 0x00005d84 0xcc - .text.__swbuf_r - 0x00005d84 0xcc c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wbuf.o) - 0x00005d84 __swbuf_r - -.text.MsgAlloc_GetTxTask%114 - 0x00005e50 0xc4 - .text.MsgAlloc_GetTxTask - 0x00005e50 0xc4 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x00005e50 MsgAlloc_GetTxTask - -.text.Luos_SendData%115 - 0x00005f14 0xbc - .text.Luos_SendData - 0x00005f14 0xbc build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x00005f14 Luos_SendData - -.text._malloc_r%116 - 0x00005fd0 0xbc - .text._malloc_r - 0x00005fd0 0xbc c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-mallocr.o) - 0x00005fd0 _malloc_r - -.text.RoutingTB_RemoveOnRoutingTable%117 - 0x0000608c 0xac - .text.RoutingTB_RemoveOnRoutingTable - 0x0000608c 0xac build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x0000608c RoutingTB_RemoveOnRoutingTable - -.text.RobusHAL_ComTransmit%118 - 0x00006138 0xa0 - .text.RobusHAL_ComTransmit - 0x00006138 0xa0 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x00006138 RobusHAL_ComTransmit - -.text.Robus_DetectNextNodes%119 - 0x000061d8 0xa0 - .text.Robus_DetectNextNodes - 0x000061d8 0xa0 build/luos_bootloader/production/_ext/1000620745/robus.o - -.text%120 0x00006278 0x98 - .text 0x00006278 0x98 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(gesf2.o) - 0x00006278 __gesf2 - 0x00006278 __gtsf2 - -.text.SERCOM0_Handler%121 - 0x00006310 0x94 - .text.SERCOM0_Handler - 0x00006310 0x94 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x00006310 SERCOM0_Handler - -.text%122 0x000063a4 0x94 - .text 0x000063a4 0x94 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(lesf2.o) - 0x000063a4 __ltsf2 - 0x000063a4 __lesf2 - -.text.__smakebuf_r%123 - 0x00006438 0x94 - .text.__smakebuf_r - 0x00006438 0x94 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-makebuf.o) - 0x00006438 __smakebuf_r - -.text._free_r%124 - 0x000064cc 0x94 - .text._free_r 0x000064cc 0x94 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-nano-freer.o) - 0x000064cc _free_r - -.text.__pic32c_data_initialization%125 - 0x00006560 0x90 - .text.__pic32c_data_initialization - 0x00006560 0x90 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(data_init.o) - 0x00006560 __pic32c_data_initialization - -.text.LuosHAL_FlashWriteLuosMemoryInfo%126 - 0x000065f0 0x8c - .text.LuosHAL_FlashWriteLuosMemoryInfo - 0x000065f0 0x8c build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x000065f0 LuosHAL_FlashWriteLuosMemoryInfo - -.text.MsgAlloc_LookAtLuosTask%127 - 0x0000667c 0x8c - .text.MsgAlloc_LookAtLuosTask - 0x0000667c 0x8c build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x0000667c MsgAlloc_LookAtLuosTask - -.text.MsgAlloc_ValidHeader%128 - 0x00006708 0x88 - .text.MsgAlloc_ValidHeader - 0x00006708 0x88 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x00006708 MsgAlloc_ValidHeader - -.text.Luos_assert%129 - 0x00006790 0x84 - .text.Luos_assert - 0x00006790 0x84 build/luos_bootloader/production/_ext/1555399743/luos_utils.o - 0x00006790 Luos_assert - -.text.RobusHAL_SetPTPDefaultState%130 - 0x00006814 0x80 - .text.RobusHAL_SetPTPDefaultState - 0x00006814 0x80 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x00006814 RobusHAL_SetPTPDefaultState - -.text.MsgAlloc_InvalidMsg%131 - 0x00006894 0x80 - .text.MsgAlloc_InvalidMsg - 0x00006894 0x80 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x00006894 MsgAlloc_InvalidMsg - -.text.CLOCK_Initialize%132 - 0x00006914 0x7c - .text.CLOCK_Initialize - 0x00006914 0x7c build/luos_bootloader/production/_ext/903266522/plib_clock.o - 0x00006914 CLOCK_Initialize - -.text.compute_crc%133 - 0x00006990 0x7c - .text.compute_crc - 0x00006990 0x7c build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - 0x00006990 compute_crc - -.text.RoutingTB_RemoveNode%134 - 0x00006a0c 0x7c - .text.RoutingTB_RemoveNode - 0x00006a0c 0x7c build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x00006a0c RoutingTB_RemoveNode - -.text.RobusHAL_SetPTPReverseState%135 - 0x00006a88 0x7c - .text.RobusHAL_SetPTPReverseState - 0x00006a88 0x7c build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x00006a88 RobusHAL_SetPTPReverseState - -.text.RobusHAL_GetPTPState%136 - 0x00006b04 0x7c - .text.RobusHAL_GetPTPState - 0x00006b04 0x7c build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x00006b04 RobusHAL_GetPTPState - -.text.__sfp%137 - 0x00006b80 0x7c - .text.__sfp 0x00006b80 0x7c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - 0x00006b80 __sfp - -.text.__fputwc%138 - 0x00006bfc 0x7c - .text.__fputwc - 0x00006bfc 0x7c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fputwc.o) - 0x00006bfc __fputwc - -.text%139 0x00006c78 0x74 - .text 0x00006c78 0x74 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_arm_cmpsf2.o) - 0x00006c78 __aeabi_cfrcmple - 0x00006c80 __aeabi_cfcmpeq - 0x00006c80 __aeabi_cfcmple - 0x00006c90 __aeabi_fcmpeq - 0x00006c9c __aeabi_fcmplt - 0x00006cb0 __aeabi_fcmple - 0x00006cc4 __aeabi_fcmpgt - 0x00006cd8 __aeabi_fcmpge - -.text.LuosHAL_GetTimestamp%140 - 0x00006cec 0x70 - .text.LuosHAL_GetTimestamp - 0x00006cec 0x70 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x00006cec LuosHAL_GetTimestamp - -.text.Robus_ShiftMaskCalculation%141 - 0x00006d5c 0x70 - .text.Robus_ShiftMaskCalculation - 0x00006d5c 0x70 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x00006d5c Robus_ShiftMaskCalculation - -.text.Luos_SaveAlias%142 - 0x00006dcc 0x68 - .text.Luos_SaveAlias - 0x00006dcc 0x68 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - -.rodata.Luos_Loop%143 - 0x00006e34 0x68 - .rodata.Luos_Loop - 0x00006e34 0x68 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - -.text.PortMng_PokeNextPort%144 - 0x00006e9c 0x68 - .text.PortMng_PokeNextPort - 0x00006e9c 0x68 build/luos_bootloader/production/_ext/1000620745/port_manager.o - 0x00006e9c PortMng_PokeNextPort - -.text.__sinit%145 - 0x00006f04 0x68 - .text.__sinit 0x00006f04 0x68 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - 0x00006f04 __sinit - -.text.Robus_Init%146 - 0x00006f6c 0x64 - .text.Robus_Init - 0x00006f6c 0x64 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x00006f6c Robus_Init - -.text.LuosHAL_ProgramFlash%147 - 0x00006fd0 0x60 - .text.LuosHAL_ProgramFlash - 0x00006fd0 0x60 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x00006fd0 LuosHAL_ProgramFlash - -.text.PortMng_PokePort%148 - 0x00007030 0x60 - .text.PortMng_PokePort - 0x00007030 0x60 build/luos_bootloader/production/_ext/1000620745/port_manager.o - 0x00007030 PortMng_PokePort - -.text.Robus_ServiceCreate%149 - 0x00007090 0x60 - .text.Robus_ServiceCreate - 0x00007090 0x60 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x00007090 Robus_ServiceCreate - -.text.Luos_Run%150 - 0x000070f0 0x5c - .text.Luos_Run - 0x000070f0 0x5c build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x000070f0 Luos_Run - -.text.Transmit_End%151 - 0x0000714c 0x5c - .text.Transmit_End - 0x0000714c 0x5c build/luos_bootloader/production/_ext/1000620745/transmission.o - 0x0000714c Transmit_End - -.rodata.Luos_MsgHandler%152 - 0x000071a8 0x58 - .rodata.Luos_MsgHandler - 0x000071a8 0x58 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - -.text.RoutingTB_BigestNodeID%153 - 0x00007200 0x58 - .text.RoutingTB_BigestNodeID - 0x00007200 0x58 build/luos_bootloader/production/_ext/1555399743/routing_table.o - -.text.RoutingTB_BigestID%154 - 0x00007258 0x58 - .text.RoutingTB_BigestID - 0x00007258 0x58 build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x00007258 RoutingTB_BigestID - -.text.Recep_ComputeMsgNumber%155 - 0x000072b0 0x58 - .text.Recep_ComputeMsgNumber - 0x000072b0 0x58 build/luos_bootloader/production/_ext/1000620745/reception.o - 0x000072b0 Recep_ComputeMsgNumber - -.text.Timestamp_TagMsg%156 - 0x00007308 0x58 - .text.Timestamp_TagMsg - 0x00007308 0x58 build/luos_bootloader/production/_ext/1000620745/timestamp.o - 0x00007308 Timestamp_TagMsg - -.text._fflush_r%157 - 0x00007360 0x58 - .text._fflush_r - 0x00007360 0x58 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fflush.o) - 0x00007360 _fflush_r - -.text.RoutingTB_ConvertServiceToRoutingTable%158 - 0x000073b8 0x56 - .text.RoutingTB_ConvertServiceToRoutingTable - 0x000073b8 0x56 build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x000073b8 RoutingTB_ConvertServiceToRoutingTable - -.text.RoutingTB_AddNumToAlias%159 - 0x00007410 0x54 - .text.RoutingTB_AddNumToAlias - 0x00007410 0x54 build/luos_bootloader/production/_ext/1555399743/routing_table.o - -.text.RoutingTB_AliasFromId%160 - 0x00007464 0x50 - .text.RoutingTB_AliasFromId - 0x00007464 0x50 build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x00007464 RoutingTB_AliasFromId - -.text.RobusHAL_SetTxState%161 - 0x000074b4 0x50 - .text.RobusHAL_SetTxState - 0x000074b4 0x50 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x000074b4 RobusHAL_SetTxState - -.text%162 0x00007504 0x50 - .text 0x00007504 0x50 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(eqsf2.o) - 0x00007504 __eqsf2 - 0x00007504 __nesf2 - -.text.__swhatbuf_r%163 - 0x00007554 0x50 - .text.__swhatbuf_r - 0x00007554 0x50 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-makebuf.o) - 0x00007554 __swhatbuf_r - -.text.RoutingTB_IDFromAlias%164 - 0x000075a4 0x4c - .text.RoutingTB_IDFromAlias - 0x000075a4 0x4c build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x000075a4 RoutingTB_IDFromAlias - -.text.RoutingTB_ComputeRoutingTableEntryNB%165 - 0x000075f0 0x4c - .text.RoutingTB_ComputeRoutingTableEntryNB - 0x000075f0 0x4c build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x000075f0 RoutingTB_ComputeRoutingTableEntryNB - -.text%166 0x0000763c 0x48 - .text 0x0000763c 0x48 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp/crtbegin.o - -.text.Reset_Handler%167 - 0x00007684 0x48 - .text.Reset_Handler - 0x00007684 0x48 build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - 0x00007684 Reset_Handler - -.text.LuosBootloader_SendResponse%168 - 0x000076cc 0x48 - .text.LuosBootloader_SendResponse - 0x000076cc 0x48 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - -.text.Luos_SendMsg%169 - 0x00007714 0x48 - .text.Luos_SendMsg - 0x00007714 0x48 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x00007714 Luos_SendMsg - -.text.PortMng_PtpHandler%170 - 0x0000775c 0x48 - .text.PortMng_PtpHandler - 0x0000775c 0x48 build/luos_bootloader/production/_ext/1000620745/port_manager.o - 0x0000775c PortMng_PtpHandler - -.text.__libc_init_array%171 - 0x000077a4 0x48 - .text.__libc_init_array - 0x000077a4 0x48 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-init.o) - 0x000077a4 __libc_init_array - -.text.__ssfputs_r%172 - 0x000077ec 0x48 - .text.__ssfputs_r - 0x000077ec 0x48 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-__ssfputs.o) - 0x000077ec __ssfputs_r - -.text.std%173 0x00007834 0x48 - .text.std 0x00007834 0x48 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - -.rodata%174 0x0000787c 0x44 - .rodata 0x0000787c 0x44 build/luos_bootloader/production/_ext/1555399743/routing_table.o - -.text.RobusHAL_ResetTimeout%175 - 0x000078c0 0x44 - .text.RobusHAL_ResetTimeout - 0x000078c0 0x44 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x000078c0 RobusHAL_ResetTimeout - -.text.Node_SetState%176 - 0x00007904 0x44 - .text.Node_SetState - 0x00007904 0x44 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x00007904 Node_SetState - -.text._fwalk_reent%177 - 0x00007948 0x42 - .text._fwalk_reent - 0x00007948 0x42 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fwalk.o) - 0x00007948 _fwalk_reent - -.text.LuosBootloader_Init%178 - 0x0000798c 0x40 - .text.LuosBootloader_Init - 0x0000798c 0x40 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - 0x0000798c LuosBootloader_Init - -.text.RobusHAL_PushPTP%179 - 0x000079cc 0x40 - .text.RobusHAL_PushPTP - 0x000079cc 0x40 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x000079cc RobusHAL_PushPTP - -.text%180 0x00007a0c 0x40 - .text 0x00007a0c 0x40 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_aeabi_uldivmod.o) - 0x00007a0c __aeabi_uldivmod - -.rodata%181 0x00007a4c 0x40 - .rodata 0x00007a4c 0x40 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(mulsf3.o) - -.text%182 0x00007a8c 0x40 - .text 0x00007a8c 0x40 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(fixsfsi.o) - 0x00007a8c __aeabi_f2iz - -.text.TC3_Handler%183 - 0x00007acc 0x3c - .text.TC3_Handler - 0x00007acc 0x3c build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x00007acc TC3_Handler - -.text.EIC_Handler%184 - 0x00007b08 0x3c - .text.EIC_Handler - 0x00007b08 0x3c build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x00007b08 EIC_Handler - -.text.MsgAlloc_IsReseted%185 - 0x00007b44 0x3c - .text.MsgAlloc_IsReseted - 0x00007b44 0x3c build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x00007b44 MsgAlloc_IsReseted - -.text.Recep_Timeout%186 - 0x00007b80 0x3c - .text.Recep_Timeout - 0x00007b80 0x3c build/luos_bootloader/production/_ext/1000620745/reception.o - 0x00007b80 Recep_Timeout - -.text%187 0x00007bbc 0x3c - .text 0x00007bbc 0x3c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzsi2.o) - 0x00007bbc __clzsi2 - -.text._sprintf_cdnopsuxX%188 - 0x00007bf8 0x3c - .text._sprintf_cdnopsuxX - 0x00007bf8 0x3c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-sprintf.cdnopsuxX.o) - 0x00007bf8 _sprintf_cdnopsuxX - 0x00007bf8 __sprintf_dis - -.text.write%189 - 0x00007c34 0x3c - .text.write 0x00007c34 0x3c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(write.o) - 0x00007c34 write - -.text.ll_crc_compute%190 - 0x00007c70 0x3a - .text.ll_crc_compute - 0x00007c70 0x3a build/luos_bootloader/production/_ext/1000620745/transmission.o - 0x00007c70 ll_crc_compute - -.text.Recep_Reset%191 - 0x00007cac 0x38 - .text.Recep_Reset - 0x00007cac 0x38 build/luos_bootloader/production/_ext/1000620745/reception.o - 0x00007cac Recep_Reset - -.text.__swrite%192 - 0x00007ce4 0x38 - .text.__swrite - 0x00007ce4 0x38 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) - 0x00007ce4 __swrite - -.text.Luos_Init%193 - 0x00007d1c 0x34 - .text.Luos_Init - 0x00007d1c 0x34 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x00007d1c Luos_Init - -.text.LuosHAL_Init%194 - 0x00007d50 0x34 - .text.LuosHAL_Init - 0x00007d50 0x34 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x00007d50 LuosHAL_Init - -.text.LuosHAL_EraseMemory%195 - 0x00007d84 0x34 - .text.LuosHAL_EraseMemory - 0x00007d84 0x34 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x00007d84 LuosHAL_EraseMemory - -.rodata%196 0x00007db8 0x33 - .rodata 0x00007db8 0x33 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) - -.text.crc8%197 0x00007dec 0x32 - .text.crc8 0x00007dec 0x32 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - 0x00007dec crc8 - -.text.Luos_ResetStatistic%198 - 0x00007e20 0x30 - .text.Luos_ResetStatistic - 0x00007e20 0x30 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x00007e20 Luos_ResetStatistic - -.rodata%199 0x00007e50 0x30 - .rodata 0x00007e50 0x30 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - -.text.LuosHAL_SetMode%200 - 0x00007e80 0x30 - .text.LuosHAL_SetMode - 0x00007e80 0x30 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x00007e80 LuosHAL_SetMode - -.rodata%201 0x00007eb0 0x30 - .rodata 0x00007eb0 0x30 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - -.text.Recep_CatchAck%202 - 0x00007ee0 0x30 - .text.Recep_CatchAck - 0x00007ee0 0x30 build/luos_bootloader/production/_ext/1000620745/reception.o - 0x00007ee0 Recep_CatchAck - -.rodata%203 0x00007f10 0x30 - .rodata 0x00007f10 0x30 build/luos_bootloader/production/_ext/1000620745/reception.o - -.text.Trgt_MulticastTargetBank%204 - 0x00007f40 0x30 - .text.Trgt_MulticastTargetBank - 0x00007f40 0x30 build/luos_bootloader/production/_ext/1000620745/target.o - 0x00007f40 Trgt_MulticastTargetBank - -.text%205 0x00007f70 0x30 - .text 0x00007f70 0x30 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_fixunssfsi.o) - 0x00007f70 __fixunssfsi - 0x00007f70 __aeabi_f2uiz - -.text._sbrk%206 - 0x00007fa0 0x30 - .text._sbrk 0x00007fa0 0x30 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(sbrk.o) - 0x00007fa0 _sbrk - -.text.RobusHAL_ComputeCRC%207 - 0x00007fd0 0x2e - .text.RobusHAL_ComputeCRC - 0x00007fd0 0x2e build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x00007fd0 RobusHAL_ComputeCRC - -.text.RobusHAL_SetRxState%208 - 0x00008000 0x2c - .text.RobusHAL_SetRxState - 0x00008000 0x2c build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x00008000 RobusHAL_SetRxState - -.text.MsgAlloc_GetLuosTaskSize%209 - 0x0000802c 0x2c - .text.MsgAlloc_GetLuosTaskSize - 0x0000802c 0x2c build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x0000802c MsgAlloc_GetLuosTaskSize - -.rodata%210 0x00008058 0x2c - .rodata 0x00008058 0x2c build/luos_bootloader/production/_ext/1000620745/robus.o - -.text.__sfmoreglue%211 - 0x00008084 0x2c - .text.__sfmoreglue - 0x00008084 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - 0x00008084 __sfmoreglue - -.text.__sseek%212 - 0x000080b0 0x2c - .text.__sseek 0x000080b0 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) - 0x000080b0 __sseek - -.text._wcrtomb_r%213 - 0x000080dc 0x2c - .text._wcrtomb_r - 0x000080dc 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wcrtomb.o) - 0x000080dc _wcrtomb_r - -.text.read%214 0x00008108 0x2c - .text.read 0x00008108 0x2c c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(read.o) - 0x00008108 read - -.text.__sfputc_r%215 - 0x00008134 0x2a - .text.__sfputc_r - 0x00008134 0x2a c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-__ssfputs.o) - -.text.RoutingTB_Erase%216 - 0x00008160 0x28 - .text.RoutingTB_Erase - 0x00008160 0x28 build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x00008160 RoutingTB_Erase - -.text.LuosHAL_Reboot%217 - 0x00008188 0x28 - .text.LuosHAL_Reboot - 0x00008188 0x28 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x00008188 LuosHAL_Reboot - -.text.LuosHAL_JumpToApp%218 - 0x000081b0 0x28 - .text.LuosHAL_JumpToApp - 0x000081b0 0x28 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x000081b0 LuosHAL_JumpToApp - -.text.MsgAlloc_Reset%219 - 0x000081d8 0x28 - .text.MsgAlloc_Reset - 0x000081d8 0x28 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x000081d8 MsgAlloc_Reset - -.text.MsgAlloc_GetLuosTaskCmd%220 - 0x00008200 0x28 - .text.MsgAlloc_GetLuosTaskCmd - 0x00008200 0x28 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x00008200 MsgAlloc_GetLuosTaskCmd - -.text.PortMng_Reset%221 - 0x00008228 0x28 - .text.PortMng_Reset - 0x00008228 0x28 build/luos_bootloader/production/_ext/1000620745/port_manager.o - -.text.Transmit_GetLockStatus%222 - 0x00008250 0x28 - .text.Transmit_GetLockStatus - 0x00008250 0x28 build/luos_bootloader/production/_ext/1000620745/transmission.o - -.text.__sread%223 - 0x00008278 0x28 - .text.__sread 0x00008278 0x28 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) - 0x00008278 __sread - -.text._write_r%224 - 0x000082a0 0x28 - .text._write_r - 0x000082a0 0x28 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-writer.o) - 0x000082a0 _write_r - -.text._lseek_r%225 - 0x000082c8 0x28 - .text._lseek_r - 0x000082c8 0x28 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-lseekr.o) - 0x000082c8 _lseek_r - -.text._read_r%226 - 0x000082f0 0x28 - .text._read_r 0x000082f0 0x28 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-readr.o) - 0x000082f0 _read_r - -.text.SYS_Initialize%227 - 0x00008318 0x24 - .text.SYS_Initialize - 0x00008318 0x24 build/luos_bootloader/production/_ext/1137593668/initialization.o - 0x00008318 SYS_Initialize - -.rodata.LuosBootloader_MsgHandler%228 - 0x0000833c 0x24 - .rodata.LuosBootloader_MsgHandler - 0x0000833c 0x24 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - -.text.RobusHAL_GetTxLockState%229 - 0x00008360 0x24 - .text.RobusHAL_GetTxLockState - 0x00008360 0x24 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x00008360 RobusHAL_GetTxLockState - -.text.__ascii_mbtowc%230 - 0x00008384 0x24 - .text.__ascii_mbtowc - 0x00008384 0x24 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mbtowc_r.o) - 0x00008384 __ascii_mbtowc - -.text._sbrk_r%231 - 0x000083a8 0x24 - .text._sbrk_r 0x000083a8 0x24 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-sbrkr.o) - 0x000083a8 _sbrk_r - -.text._close_r%232 - 0x000083cc 0x24 - .text._close_r - 0x000083cc 0x24 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-closer.o) - 0x000083cc _close_r - -.text._fstat_r%233 - 0x000083f0 0x24 - .text._fstat_r - 0x000083f0 0x24 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fstatr.o) - 0x000083f0 _fstat_r - -.text._isatty_r%234 - 0x00008414 0x24 - .text._isatty_r - 0x00008414 0x24 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-isattyr.o) - 0x00008414 _isatty_r - -.text.RoutingTB_ConvertNodeToRoutingTable%235 - 0x00008438 0x1e - .text.RoutingTB_ConvertNodeToRoutingTable - 0x00008438 0x1e build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x00008438 RoutingTB_ConvertNodeToRoutingTable - -.text._fputwc_r%236 - 0x00008456 0x1e - .text._fputwc_r - 0x00008456 0x1e c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-fputwc.o) - 0x00008456 _fputwc_r - -.text.MsgAlloc_IsEmpty%237 - 0x00008474 0x1c - .text.MsgAlloc_IsEmpty - 0x00008474 0x1c build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x00008474 MsgAlloc_IsEmpty - -.rodata.Recep_GetConcernedLLService%238 - 0x00008490 0x1c - .rodata.Recep_GetConcernedLLService - 0x00008490 0x1c build/luos_bootloader/production/_ext/1000620745/reception.o - -.rodata.Recep_NodeConcerned%239 - 0x000084ac 0x1c - .rodata.Recep_NodeConcerned - 0x000084ac 0x1c build/luos_bootloader/production/_ext/1000620745/reception.o - -.rodata.Recep_InterpretMsgProtocol%240 - 0x000084c8 0x1c - .rodata.Recep_InterpretMsgProtocol - 0x000084c8 0x1c build/luos_bootloader/production/_ext/1000620745/reception.o - -.text.Transmit_SendAck%241 - 0x000084e4 0x1c - .text.Transmit_SendAck - 0x000084e4 0x1c build/luos_bootloader/production/_ext/1000620745/transmission.o - 0x000084e4 Transmit_SendAck - -.text.LuosBootloader_Loop%242 - 0x00008500 0x1a - .text.LuosBootloader_Loop - 0x00008500 0x1a build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - 0x00008500 LuosBootloader_Loop - -.text.LuosHAL_StartTimestamp%243 - 0x0000851c 0x18 - .text.LuosHAL_StartTimestamp - 0x0000851c 0x18 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x0000851c LuosHAL_StartTimestamp - -.text.Robus_MaskInit%244 - 0x00008534 0x18 - .text.Robus_MaskInit - 0x00008534 0x18 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x00008534 Robus_MaskInit - -.text%245 0x0000854c 0x18 - .text 0x0000854c 0x18 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_clzdi2.o) - 0x0000854c __clzdi2 - -.text._vfprintf_cdnopsuxX%246 - 0x00008564 0x18 - .text._vfprintf_cdnopsuxX - 0x00008564 0x18 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(_lib_a-nano-vfprintf.cdnopsuxX.o) - 0x00008564 _vfprintf_cdnopsuxX - -.text.__ascii_wctomb%247 - 0x0000857c 0x18 - .text.__ascii_wctomb - 0x0000857c 0x18 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-wctomb_r.o) - 0x0000857c __ascii_wctomb - -.text.memchr%248 - 0x00008594 0x16 - .text.memchr 0x00008594 0x16 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memchr-stub.o) - 0x00008594 memchr - -.text.MsgAlloc_SetData%249 - 0x000085ac 0x14 - .text.MsgAlloc_SetData - 0x000085ac 0x14 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x000085ac MsgAlloc_SetData - -.text.MsgAlloc_TxAllComplete%250 - 0x000085c0 0x14 - .text.MsgAlloc_TxAllComplete - 0x000085c0 0x14 build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x000085c0 MsgAlloc_TxAllComplete - -.text.PortMng_Init%251 - 0x000085d4 0x14 - .text.PortMng_Init - 0x000085d4 0x14 build/luos_bootloader/production/_ext/1000620745/port_manager.o - 0x000085d4 PortMng_Init - -.text.Recep_Init%252 - 0x000085e8 0x14 - .text.Recep_Init - 0x000085e8 0x14 build/luos_bootloader/production/_ext/1000620745/reception.o - 0x000085e8 Recep_Init - -.text%253 0x000085fc 0x14 - .text 0x000085fc 0x14 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strcmp.o) - 0x000085fc strcmp - -.text.memcpy%254 - 0x00008610 0x12 - .text.memcpy 0x00008610 0x12 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memcpy-stub.o) - 0x00008610 memcpy - -.rodata%255 0x00008624 0x10 - .rodata 0x00008624 0x10 build/luos_bootloader/production/_ext/1342350994/bootloader_core.o - -.text.SysTick_Handler%256 - 0x00008634 0x10 - .text.SysTick_Handler - 0x00008634 0x10 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x00008634 SysTick_Handler - -.text.LuosHAL_FlashReadLuosMemoryInfo%257 - 0x00008644 0x10 - .text.LuosHAL_FlashReadLuosMemoryInfo - 0x00008644 0x10 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x00008644 LuosHAL_FlashReadLuosMemoryInfo - -.text.Node_GetState%258 - 0x00008654 0x10 - .text.Node_GetState - 0x00008654 0x10 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x00008654 Node_GetState - -.text.Robus_SetVerboseMode%259 - 0x00008664 0x10 - .text.Robus_SetVerboseMode - 0x00008664 0x10 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x00008664 Robus_SetVerboseMode - -.text.memset%260 - 0x00008674 0x10 - .text.memset 0x00008674 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-memset.o) - 0x00008674 memset - -.text._cleanup_r%261 - 0x00008684 0x10 - .text._cleanup_r - 0x00008684 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-findfp.o) - 0x00008684 _cleanup_r - -.text.__locale_mb_cur_max%262 - 0x00008694 0x10 - .text.__locale_mb_cur_max - 0x00008694 0x10 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) - 0x00008694 __locale_mb_cur_max - -.text.main%263 0x000086a4 0xe - .text.main 0x000086a4 0xe build/luos_bootloader/production/_ext/1360937237/main.o - 0x000086a4 main - -.text%264 0x000086b2 0xe - .text 0x000086b2 0xe c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-strlen.o) - 0x000086b2 strlen - -.text.NVMCTRL_Initialize%265 - 0x000086c0 0xc - .text.NVMCTRL_Initialize - 0x000086c0 0xc build/luos_bootloader/production/_ext/1001328808/plib_nvmctrl.o - 0x000086c0 NVMCTRL_Initialize - -.text.RoutingTB_GetLastEntry%266 - 0x000086cc 0xc - .text.RoutingTB_GetLastEntry - 0x000086cc 0xc build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x000086cc RoutingTB_GetLastEntry - -.text.LuosHAL_SetIrqState%267 - 0x000086d8 0xc - .text.LuosHAL_SetIrqState - 0x000086d8 0xc build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x000086d8 LuosHAL_SetIrqState - -.text.LuosHAL_GetSystick%268 - 0x000086e4 0xc - .text.LuosHAL_GetSystick - 0x000086e4 0xc build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x000086e4 LuosHAL_GetSystick - -.text.LuosHAL_GetNodeID%269 - 0x000086f0 0xc - .text.LuosHAL_GetNodeID - 0x000086f0 0xc build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x000086f0 LuosHAL_GetNodeID - -.text.MsgAlloc_UsedMsgEnd%270 - 0x000086fc 0xc - .text.MsgAlloc_UsedMsgEnd - 0x000086fc 0xc build/luos_bootloader/production/_ext/1000620745/msg_alloc.o - 0x000086fc MsgAlloc_UsedMsgEnd - -.text.Luos_IsMsgTimstamped%271 - 0x00008708 0xc - .text.Luos_IsMsgTimstamped - 0x00008708 0xc build/luos_bootloader/production/_ext/1000620745/timestamp.o - 0x00008708 Luos_IsMsgTimstamped - -.text.__sclose%272 - 0x00008714 0xc - .text.__sclose - 0x00008714 0xc c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-stdio.o) - 0x00008714 __sclose - -.text.fstat%273 - 0x00008720 0xc - .text.fstat 0x00008720 0xc c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(fstat.o) - 0x00008720 fstat - -.rodata%274 0x0000872c 0xb - .rodata 0x0000872c 0xb c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-locale.o) - -.text.NVIC_Initialize%275 - 0x00008738 0x8 - .text.NVIC_Initialize - 0x00008738 0x8 build/luos_bootloader/production/_ext/1968463158/plib_nvic.o - 0x00008738 NVIC_Initialize - -.text.Luos_SetVerboseMode%276 - 0x00008740 0x8 - .text.Luos_SetVerboseMode - 0x00008740 0x8 build/luos_bootloader/production/_ext/1555399743/luos_engine.o - 0x00008740 Luos_SetVerboseMode - -.text.RoutingTB_Get%277 - 0x00008748 0x8 - .text.RoutingTB_Get - 0x00008748 0x8 build/luos_bootloader/production/_ext/1555399743/routing_table.o - 0x00008748 RoutingTB_Get - -.text.LuosHAL_GetMode%278 - 0x00008750 0x8 - .text.LuosHAL_GetMode - 0x00008750 0x8 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x00008750 LuosHAL_GetMode - -.text.Node_Get%279 - 0x00008758 0x8 - .text.Node_Get - 0x00008758 0x8 build/luos_bootloader/production/_ext/1000620745/robus.o - 0x00008758 Node_Get - -.text._close%280 - 0x00008760 0x8 - .text._close 0x00008760 0x8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_close.o) - 0x00008760 _close - -.text._fstat%281 - 0x00008768 0x8 - .text._fstat 0x00008768 0x8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_fstat.o) - 0x00008768 _fstat - -.text._isatty%282 - 0x00008770 0x8 - .text._isatty 0x00008770 0x8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_isatty.o) - 0x00008770 _isatty - -.text._lseek%283 - 0x00008778 0x8 - .text._lseek 0x00008778 0x8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_lseek.o) - 0x00008778 _lseek - -.text._read%284 - 0x00008780 0x8 - .text._read 0x00008780 0x8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_read.o) - 0x00008780 _read - -.text._write%285 - 0x00008788 0x8 - .text._write 0x00008788 0x8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(_write.o) - 0x00008788 _write - -.text.close%286 - 0x00008790 0x8 - .text.close 0x00008790 0x8 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(close.o) - 0x00008790 close - -.text._mon_getc%287 - 0x00008798 0x4 - .text._mon_getc - 0x00008798 0x4 build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - 0x00008798 _mon_getc - -.text%288 0x0000879c 0x4 - .text 0x0000879c 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/thumb/v6-m/nofp\libgcc.a(_dvmd_tls.o) - 0x0000879c __aeabi_idiv0 - 0x0000879c __aeabi_ldiv0 - -.rodata._global_impure_ptr%289 - 0x000087a0 0x4 - .rodata._global_impure_ptr - 0x000087a0 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-impure.o) - 0x000087a0 _global_impure_ptr - -.text.isatty%290 - 0x000087a4 0x4 - .text.isatty 0x000087a4 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(isatty.o) - 0x000087a4 isatty - -.text.lseek%291 - 0x000087a8 0x4 - .text.lseek 0x000087a8 0x4 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libpic32c.a(lseek.o) - 0x000087a8 lseek - -.text.EVSYS_Initialize%292 - 0x00005d82 0x2 - .text.EVSYS_Initialize - 0x00005d82 0x2 build/luos_bootloader/production/_ext/901117036/plib_evsys.o - 0x00005d82 EVSYS_Initialize - -.text.PORT_Initialize%293 - 0x0000740e 0x2 - .text.PORT_Initialize - 0x0000740e 0x2 build/luos_bootloader/production/_ext/1968410007/plib_port.o - 0x0000740e PORT_Initialize - -.text._mon_putc%294 - 0x0000798a 0x2 - .text._mon_putc - 0x0000798a 0x2 build/luos_bootloader/production/_ext/1426513406/xc32_monitor.o - 0x0000798a _mon_putc - -.text.Dummy_Handler%295 - 0x00007caa 0x2 - .text.Dummy_Handler - 0x00007caa 0x2 build/luos_bootloader/production/_ext/1137593668/interrupts.o - 0x00007caa SVCall_Handler - 0x00007caa DMAC_Handler - 0x00007caa AC_Handler - 0x00007caa PendSV_Handler - 0x00007caa TC7_Handler - 0x00007caa SERCOM1_Handler - 0x00007caa ADC_Handler - 0x00007caa TCC1_Handler - 0x00007caa SERCOM2_Handler - 0x00007caa TCC0_Handler - 0x00007caa RTC_Handler - 0x00007caa TC6_Handler - 0x00007caa WDT_Handler - 0x00007caa TC4_Handler - 0x00007caa USB_Handler - 0x00007caa Dummy_Handler - 0x00007caa PM_Handler - 0x00007caa SERCOM5_Handler - 0x00007caa TCC2_Handler - 0x00007caa EVSYS_Handler - 0x00007caa SERCOM3_Handler - 0x00007caa SERCOM4_Handler - 0x00007caa I2S_Handler - 0x00007caa NVMCTRL_Handler - 0x00007caa DAC_Handler - 0x00007caa PTC_Handler - 0x00007caa TC5_Handler - 0x00007caa SYSCTRL_Handler - -.text.NonMaskableInt_Handler%296 - 0x00007e1e 0x2 - .text.NonMaskableInt_Handler - 0x00007e1e 0x2 build/luos_bootloader/production/_ext/1137593668/exceptions.o - 0x00007e1e NonMaskableInt_Handler - -.text.HardFault_Handler%297 - 0x00007ffe 0x2 - .text.HardFault_Handler - 0x00007ffe 0x2 build/luos_bootloader/production/_ext/1137593668/exceptions.o - 0x00007ffe HardFault_Handler - -.text.Dummy_App_Func%298 - 0x0000815e 0x2 - .text.Dummy_App_Func - 0x0000815e 0x2 build/luos_bootloader/production/_ext/1137593668/startup_xc32.o - 0x0000815e _on_reset - 0x0000815e _on_bootstrap - 0x0000815e __xc32_on_reset - 0x0000815e Dummy_App_Func - 0x0000815e __xc32_on_bootstrap - -.text.node_assert%299 - 0x0000851a 0x2 - .text.node_assert - 0x0000851a 0x2 build/luos_bootloader/production/_ext/1555399743/luos_utils.o - 0x0000851a node_assert - -.text.LuosHAL_DeInit%300 - 0x000085aa 0x2 - .text.LuosHAL_DeInit - 0x000085aa 0x2 build/luos_bootloader/production/_ext/1234256160/luos_hal.o - 0x000085aa LuosHAL_DeInit - -.text.RobusHAL_SetRxDetecPin%301 - 0x00008622 0x2 - .text.RobusHAL_SetRxDetecPin - 0x00008622 0x2 build/luos_bootloader/production/_ext/1857845632/robus_hal.o - 0x00008622 RobusHAL_SetRxDetecPin - -.text.Recep_Drop%302 - 0x00005616 0x2 - .text.Recep_Drop - 0x00005616 0x2 build/luos_bootloader/production/_ext/1000620745/reception.o - 0x00005616 Recep_Drop - -.text.__malloc_lock%303 - 0x000087ac 0x2 - .text.__malloc_lock - 0x000087ac 0x2 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mlock.o) - 0x000087ac __malloc_lock - -.text.__malloc_unlock%304 - 0x000087ae 0x2 - .text.__malloc_unlock - 0x000087ae 0x2 c:/program files/microchip/xc32/v3.00/bin/bin/../../lib/gcc/pic32c/8.3.1/../../../../pic32c/lib/thumb/v6-m/nofp\libc_nano.a(lib_a-mlock.o) - 0x000087ae __malloc_unlock diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/memoryfile.xml b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/memoryfile.xml deleted file mode 100644 index b9a2446b3..000000000 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/luos_bootloader_samd21j18a.X/dist/luos_bootloader/production/memoryfile.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - bytes - 40960 - 34733 - 6227 - - - bytes - 32768 - 5050 - 27718 - - - From 1e817d2343d9149f0fe642c852a9b3045f3c300a Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 19 Apr 2023 17:03:37 +0200 Subject: [PATCH 052/150] Move CRC_SIZE definition from Alloc to robus config --- engine/IO/inc/msg_alloc.h | 1 - network/robus/robus_config.h | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/IO/inc/msg_alloc.h b/engine/IO/inc/msg_alloc.h index 8e86aef14..f29e3b5e5 100644 --- a/engine/IO/inc/msg_alloc.h +++ b/engine/IO/inc/msg_alloc.h @@ -13,7 +13,6 @@ /******************************************************************************* * Definitions ******************************************************************************/ -#define CRC_SIZE 2 /******************************************************************************* * Variables diff --git a/network/robus/robus_config.h b/network/robus/robus_config.h index f3b57aa85..b0a81f9be 100644 --- a/network/robus/robus_config.h +++ b/network/robus/robus_config.h @@ -21,4 +21,6 @@ #define NBR_RETRY 10 #endif +#define CRC_SIZE 2 + #endif /* _ROBUS_CONFIG_H_ */ From b9144c2cca60ab44f27ce7c2df4b4e58fef14a4f Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 18 Apr 2023 11:39:52 +0200 Subject: [PATCH 053/150] Engine TX is passed to LuosIO RX normal process --- engine/IO/inc/_luos_phy.h | 21 + engine/IO/inc/filter.h | 3 +- engine/IO/inc/luos_io.h | 13 +- engine/IO/inc/luos_phy.h | 65 +- engine/IO/inc/msg_alloc.h | 45 +- engine/IO/inc/struct_io.h | 47 - engine/IO/inc/struct_phy.h | 36 + engine/IO/src/filter.c | 28 +- engine/IO/src/luos_io.c | 373 ++++- engine/IO/src/luos_phy.c | 471 +++++- engine/IO/src/msg_alloc.c | 1229 ++------------- engine/OD/od_linear.h | 1 - engine/OD/od_time.h | 106 +- engine/bootloader/bootloader_core.c | 8 +- engine/bootloader/bootloader_core.h | 4 +- engine/core/inc/_timestamp.h | 2 +- engine/core/inc/luos_engine.h | 11 +- engine/core/inc/luos_list.h | 8 +- engine/core/inc/profile_core.h | 4 +- engine/core/inc/routing_table.h | 2 +- engine/core/inc/service.h | 22 +- engine/core/inc/stats.h | 21 + engine/core/inc/struct_engine.h | 1 - engine/core/inc/struct_luos.h | 50 +- engine/core/inc/time_luos.h | 120 ++ engine/core/src/luos_engine.c | 432 +---- engine/core/src/luos_utils.c | 6 +- engine/core/src/profile_core.c | 2 +- engine/core/src/pub_sub.c | 6 +- engine/core/src/routing_table.c | 13 +- engine/core/src/service.c | 110 +- .../{IO/inc/_luos_io.h => core/src/stats.c} | 34 +- engine/core/src/streaming.c | 6 +- engine/core/src/timestamp.c | 20 +- engine/profiles/motor/profile_motor.c | 4 +- .../servo_motor/profile_servo_motor.c | 4 +- engine/profiles/state/profile_state.c | 4 +- engine/profiles/voltage/profile_voltage.c | 4 +- .../apps/alarm_controller/alarm_controller.c | 4 +- .../biometric-security/biometric_security.c | 6 +- .../apps/start_controller/start_controller.c | 4 +- .../bldc_simple_foc/lib/motor/motor.cpp | 6 +- .../Arduino/button/lib/button/button.c | 4 +- .../fingerprint/lib/Fingerprint/fingerprint.c | 4 +- examples/projects/Arduino/lcd/lib/Lcd/lcd.c | 6 +- examples/projects/Arduino/led/lib/led/led.c | 4 +- .../servo_motor/lib/Servo_motor/servo_motor.c | 6 +- .../stepper_simple_foc/lib/motor/motor.cpp | 6 +- .../projects/ESP32/button/lib/button/button.c | 4 +- .../ESP32/button_arduino/lib/button/button.c | 4 +- examples/projects/ESP32/led/lib/led/led.c | 4 +- .../barometer/lib/barometer/BMP280.c | 6 +- .../dc_motor/lib/DC_motor/dc_motor.c | 4 +- .../lib/Potentiometer/potentiometer.c | 4 +- .../NUCLEO-F401RE/button/lib/Button/button.c | 4 +- .../dc_motor/lib/DC_motor/dc_motor.c | 4 +- .../projects/NUCLEO-F401RE/led/lib/Led/led.c | 4 +- .../lib/Potentiometer/potentiometer.c | 4 +- .../NUCLEO-F410RB/button/lib/Button/button.c | 4 +- .../dc_motor/lib/DC_motor/dc_motor.c | 4 +- .../projects/NUCLEO-F410RB/led/lib/Led/led.c | 4 +- .../lib/Potentiometer/potentiometer.c | 4 +- .../NUCLEO-G431KB/button/lib/Button/button.c | 4 +- .../dc_motor/lib/DC_motor/dc_motor.c | 4 +- .../lib/Potentiometer/potentiometer.c | 4 +- .../NUCLEO-G474RE/button/lib/Button/button.c | 4 +- .../NUCLEO-L432KC/button/lib/Button/button.c | 4 +- .../dc_motor/lib/DC_motor/dc_motor.c | 4 +- .../fingerprint/lib/Fingerprint/fingerprint.c | 4 +- .../projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.c | 6 +- .../projects/NUCLEO-L432KC/led/lib/Led/led.c | 4 +- .../lib/Potentiometer/potentiometer.c | 4 +- .../NUCLEO-L432KC/servo/lib/Servo/servo.c | 6 +- .../SAMD21XPLAINED/button/lib/button/button.c | 4 +- .../button/lib/Button/button.c | 4 +- .../button/lib/Button/button.c | 4 +- .../lib/Led_Fader/led_fader.c | 4 +- .../projects/l0/button_freertos/lib/Led/led.c | 4 +- .../lib/Controller_motor/controller_motor.c | 6 +- .../l0/dc_motor/lib/DC_motor/dc_motor.c | 4 +- .../lib/Detection_Button/detection_button.c | 6 +- .../ledstrip_position/lib/Distance/distance.c | 4 +- .../lib/LedStrip_Position/ledstrip_position.c | 6 +- .../lib/motor_copy/motor_copy.c | 6 +- .../motor_demo_app/lib/run_motor/run_motor.c | 6 +- .../l0/distance/lib/Distance/distance.c | 4 +- examples/projects/l0/dxl/lib/Dxl/dxl.c | 4 +- .../fingerprint/lib/Fingerprint/fingerprint.c | 4 +- .../projects/l0/gpio/lib/Gpio_dev/gpio_dev.c | 4 +- examples/projects/l0/imu/lib/Imu/imu.c | 4 +- examples/projects/l0/lcd/lib/Lcd/lcd.c | 6 +- examples/projects/l0/led/lib/Led/led.c | 4 +- .../l0/led_fader/lib/Led_Fader/led_fader.c | 4 +- .../l0/led_strip/lib/Led_strip/led_strip.c | 4 +- .../lib/Light_sensor/light_sensor.c | 4 +- examples/projects/l0/load/lib/Load/load.c | 4 +- .../lib/Potentiometer/potentiometer.c | 4 +- examples/projects/l0/servo/lib/Servo/servo.c | 4 +- .../projects/l0/stepper/lib/Stepper/stepper.c | 4 +- examples/projects/native/led/lib/Led/led.c | 6 +- .../native/ping_pong/lib/PingPong/ping_pong.c | 4 +- .../native/ping_pong/lib/PingPong/scoring.c | 6 +- .../native/ping_pong/lib/PingPong/scoring.h | 4 +- network/robus/HAL/ATSAMD21/robus_hal_config.h | 5 + .../HAL/ATSAMD21_ARDUINO/robus_hal_config.h | 1 + .../HAL/ATSAMD21_MBED/robus_hal_config.h | 1 + network/robus/HAL/ESP32/robus_hal_config.h | 3 +- network/robus/HAL/NATIVE/robus_hal_config.h | 1 + network/robus/HAL/STM32F0/robus_hal_config.h | 3 +- network/robus/HAL/STM32F4/robus_hal_config.h | 3 +- network/robus/HAL/STM32G4/robus_hal_config.h | 1 + network/robus/HAL/STM32L0/robus_hal_config.h | 3 +- network/robus/HAL/STM32L4/robus_hal_config.h | 1 + network/robus/HAL/STUB/robus_hal_config.h | 1 + network/robus/HAL/template/robus_hal_config.h | 1 + network/robus/inc/reception.h | 2 - network/robus/inc/robus.h | 2 - network/robus/inc/transmission.h | 25 +- network/robus/src/reception.c | 29 +- network/robus/src/robus.c | 90 +- network/robus/src/transmission.c | 103 +- test/_resources/Scenarios/default_scenario.c | 12 +- test/_resources/Unity/unit_test.h | 3 +- test/example_build.py | 1 - test/test_luos/main.c | 8 +- test/test_msg_alloc/main.c | 38 +- test/test_msg_alloc/main.h | 42 +- test/test_msg_alloc/unit_test_mem_alloc.c | 770 +++++++++ .../unit_test_mem_alloc_generic.c | 1395 ----------------- .../unit_test_mem_alloc_static.c | 1018 ------------ test/test_msg_alloc/unit_test_mem_alloc_tx.c | 601 ------- test/test_timestamp/main.c | 2 +- tool_services/gate/TinyJSON/bootloader_ex.h | 3 +- tool_services/gate/TinyJSON/convert.c | 17 +- tool_services/gate/convert.h | 1 - tool_services/gate/data_manager.c | 58 +- tool_services/inspector/data_manager.c | 20 +- tool_services/pipe/pipe.c | 4 +- 138 files changed, 2541 insertions(+), 5355 deletions(-) create mode 100644 engine/IO/inc/_luos_phy.h delete mode 100644 engine/IO/inc/struct_io.h create mode 100644 engine/IO/inc/struct_phy.h create mode 100644 engine/core/inc/stats.h create mode 100644 engine/core/inc/time_luos.h rename engine/{IO/inc/_luos_io.h => core/src/stats.c} (61%) create mode 100644 test/test_msg_alloc/unit_test_mem_alloc.c delete mode 100644 test/test_msg_alloc/unit_test_mem_alloc_generic.c delete mode 100644 test/test_msg_alloc/unit_test_mem_alloc_static.c delete mode 100644 test/test_msg_alloc/unit_test_mem_alloc_tx.c diff --git a/engine/IO/inc/_luos_phy.h b/engine/IO/inc/_luos_phy.h new file mode 100644 index 000000000..ec83bbb14 --- /dev/null +++ b/engine/IO/inc/_luos_phy.h @@ -0,0 +1,21 @@ +/****************************************************************************** + * @file phy.h + * @brief This file have to be imported by phy layers to interract with Luos + * @author Nicolas Rabault + * @version 0.0.0 + ******************************************************************************/ +#ifndef _PRIVATE_LUOS_PHY_H_ +#define _PRIVATE_LUOS_PHY_H_ + +#include "luos_phy.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +void Phy_Init(void); +void Phy_Reset(void); +void Phy_Loop(void); +luos_phy_t *Phy_Get(uint8_t id, PHY_CB phy_cb); + +#endif /* _PRIVATE_LUOS_PHY_H_ */ diff --git a/engine/IO/inc/filter.h b/engine/IO/inc/filter.h index 26aae2651..016faa4e4 100644 --- a/engine/IO/inc/filter.h +++ b/engine/IO/inc/filter.h @@ -9,7 +9,6 @@ #include #include -#include "struct_io.h" #include "struct_luos.h" /******************************************************************************* @@ -33,6 +32,6 @@ void Filter_RmTopic(uint16_t topic_id); bool Filter_ServiceID(uint16_t service_id); bool Filter_Topic(uint16_t topic_id); bool Filter_Type(uint16_t type_id); -luos_localhost_t Filter_GetLocalhost(header_t *header); +uint8_t Filter_GetPhyTarget(header_t *header); #endif /* _FILTER_H_ */ diff --git a/engine/IO/inc/luos_io.h b/engine/IO/inc/luos_io.h index 6d5d38af3..2c8bfb91a 100644 --- a/engine/IO/inc/luos_io.h +++ b/engine/IO/inc/luos_io.h @@ -8,6 +8,7 @@ #define _LUOSIO_H_ #include "struct_luos.h" +#include "struct_phy.h" /******************************************************************************* * Definitions @@ -22,8 +23,18 @@ ******************************************************************************/ // generic functions -void LuosIO_Init(memory_stats_t *memory_stats); +void LuosIO_Init(void); void LuosIO_Loop(void); uint16_t LuosIO_TopologyDetection(service_t *service); +error_return_t LuosIO_Send(service_t *service, msg_t *msg); + +// Job management +error_return_t LuosIO_TryToGetJob(uint16_t job_id, phy_job_t **job); +void LuosIO_RmJob(phy_job_t *job); +uint16_t LuosIO_GetJobNb(void); +error_return_t LuosIO_TxAllComplete(void); + +// Specific phy treatment +error_return_t Phy_TxAllComplete(void); #endif /* _LUOSIO_H_ */ diff --git a/engine/IO/inc/luos_phy.h b/engine/IO/inc/luos_phy.h index 3a26e1723..d18987a1f 100644 --- a/engine/IO/inc/luos_phy.h +++ b/engine/IO/inc/luos_phy.h @@ -8,30 +8,27 @@ #define _LUOS_PHY_H_ #include -#include "struct_luos.h" -#include "struct_io.h" +#include +#include "struct_phy.h" +#include "time_luos.h" +#include "luos_utils.h" +#include "luos_hal.h" /******************************************************************************* * Definitions ******************************************************************************/ /****************************************************************************** - * @struct luos_luos_phy_t - * @brief the data structure allowing the phy to interract with LuosIO + * @struct phy_target_t + * @brief Transmit message direction ******************************************************************************/ -typedef struct -{ - // This is allowing to access the data as data or message - union - { - uint8_t *data_pt; // Start pointer of the data on msg_buffer. - msg_t *msg_pt; // Pointer to the message. - }; - uint16_t size; // size of the data. - void *phy_data; // Phy developpers can use this pointer to store any data they need. -} phy_tx_job_t; +typedef uint8_t phy_target_t; -typedef struct luos_luos_phy_t +/****************************************************************************** + * @struct luos_phy_t + * @brief the data structure allowing the phy to interract with LuosIO + ******************************************************************************/ +typedef struct luos_phy_t { // *************** RX information *************** volatile int64_t rx_timestamp; // Timestamp of the last received message. We will use it to compute the date based on received latency. @@ -43,26 +40,42 @@ typedef struct luos_luos_phy_t }; volatile uint16_t received_data; // Number of bytes already received. volatile uint16_t rx_size; // Size of data to receive. - struct __attribute__((__packed__)) + struct { volatile uint8_t rx_alloc_job : 1; // If true, Luosio_Loop funciton will need to filter already received data, if filter is ok, set rx_keep, alloc needed space, move *rx_data to point at the good place on allocator, put the number of bytes remaining on rx_size, and copy already received data in the allocated space. volatile uint8_t rx_keep : 1; // True if we want to keep the received data. + volatile uint8_t rx_ack : 1; // True if we need to generate an acknoledgement for this message. }; // RX Private data - luos_localhost_t rx_phy_filter; // The phy concerned by this message. + phy_target_t rx_phy_filter; // The phy concerned by this message. // *************** TX informations *************** - phy_tx_job_t tx_job[MAX_MSG_NB]; // List of phy tx jobs to send. - uint8_t tx_job_nb; // Number of tx jobs to send. + // Jobs are stores from the newest to the oldest to optimize pulling time allowing to do it in IRQ. + // So adding a job is done by moving all job up and adding the new one at 0, then add 1 to job_nb. + phy_job_t job[MAX_MSG_NB]; // List of phy jobs to send. + uint8_t job_nb; // Number of jobs to send. + + void (*phy_cb)(struct luos_phy_t *phy_ptr, phy_job_t *job); // Callback } luos_phy_t; -void Phy_Init(void); -void Phy_Loop(void); -luos_phy_t *Phy_Create(void); +typedef void (*PHY_CB)(luos_phy_t *phy_ptr, phy_job_t *job); + +// Phy creation +luos_phy_t *Phy_Create(PHY_CB phy_cb); // Use it to reference your phy to Luos. + +// Rx management +void Phy_ComputeHeader(luos_phy_t *phy_ptr); // After receiving the first 7 bytes (the header) call this function to compute how you should manage the incoming message. +void Phy_ValidMsg(luos_phy_t *phy_ptr); // After receiving as much valid bytes as phy_ptr.rx_size, call this function to validate the message. + +// Tx management +time_luos_t Phy_ComputeTimestamp(phy_job_t *job); +uint16_t Phy_GetNodeId(void); -void Phy_Send(luos_phy_t *phy_ptr, uint8_t *data, uint16_t size); -void Phy_Computeheader(luos_phy_t *phy_ptr); -void Phy_ValidMsg(luos_phy_t *phy_ptr); +// Job management +void Phy_DeadTargetSpotted(luos_phy_t *phy_ptr, phy_job_t *job); // If some messages failed to be sent, call this function to consider the target as dead +phy_job_t *Phy_GetJob(luos_phy_t *phy_ptr); // Use it to get the next job to send. +void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to remove a job from your phy job list when it's done. +uint16_t Phy_GetJobNbr(luos_phy_t *phy_ptr); // Use it to get the number of job you currently have to send on your phy_ptr.job list. #endif /* _LUOS_PHY_H_ */ diff --git a/engine/IO/inc/msg_alloc.h b/engine/IO/inc/msg_alloc.h index f29e3b5e5..8a99a115b 100644 --- a/engine/IO/inc/msg_alloc.h +++ b/engine/IO/inc/msg_alloc.h @@ -8,53 +8,18 @@ #define _MSGALLOC_H_ #include "struct_luos.h" -#include "struct_io.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ /******************************************************************************* * Functions ******************************************************************************/ -// generic functions +// Generic functions void MsgAlloc_Init(memory_stats_t *memory_stats); -void MsgAlloc_loop(void); - -// msg buffering functions -uint8_t *MsgAlloc_Alloc(uint16_t data_size); +void MsgAlloc_Loop(void); +// Msg buffering functions +uint8_t *MsgAlloc_Alloc(uint16_t data_size, uint8_t phy_filter); +void MsgAlloc_Free(uint8_t phy_id, const uint8_t *data); error_return_t MsgAlloc_IsEmpty(void); -void MsgAlloc_UsedMsgEnd(void); -void MsgAlloc_Reset(void); -error_return_t MsgAlloc_IsReseted(void); - -// msg interpretation task stack -error_return_t MsgAlloc_PullMsgToInterpret(msg_t **returned_msg); - -// Luos task stack -void MsgAlloc_LuosTaskAlloc(service_t *service_concerned_by_current_msg, msg_t *concerned_msg); - -// Luos task research and pull -error_return_t MsgAlloc_PullMsg(service_t *target_service, msg_t **returned_msg); -error_return_t MsgAlloc_PullMsgFromLuosTask(uint16_t luos_task_id, msg_t **returned_msg); -error_return_t MsgAlloc_LookAtLuosTask(uint16_t luos_task_id, service_t **allocated_service); -error_return_t MsgAlloc_GetLuosTaskSourceId(uint16_t luos_task_id, uint16_t *source_id); -error_return_t MsgAlloc_GetLuosTaskCmd(uint16_t luos_task_id, uint8_t *cmd); -error_return_t MsgAlloc_GetLuosTaskSize(uint16_t luos_task_id, uint16_t *size); -uint16_t MsgAlloc_LuosTasksNbr(void); -void MsgAlloc_ClearMsgFromLuosTasks(msg_t *msg); - -// Tx tasks create, get and consume -error_return_t MsgAlloc_SetTxTask(service_t *service_pt, uint8_t *data, uint16_t crc, uint16_t size, luos_localhost_t localhost, uint8_t ack); -void MsgAlloc_PullMsgFromTxTask(void); -void MsgAlloc_PullServiceFromTxTask(uint16_t service_id); -error_return_t MsgAlloc_GetTxTask(service_t **service_pt, uint8_t **data, uint16_t *size); -error_return_t MsgAlloc_TxAllComplete(void); #endif /* _MSGALLOC_H_ */ diff --git a/engine/IO/inc/struct_io.h b/engine/IO/inc/struct_io.h deleted file mode 100644 index 37751a41f..000000000 --- a/engine/IO/inc/struct_io.h +++ /dev/null @@ -1,47 +0,0 @@ -/****************************************************************************** - * @file struct_io - * @brief io level structures - * @author Luos - * @version 0.0.0 - ******************************************************************************/ -#ifndef _STRUCT_IO_H_ -#define _STRUCT_IO_H_ - -#include -#include "engine_config.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/****************************************************************************** - * @struct luos_localhost_t - * @brief Transmit message direction - ******************************************************************************/ -typedef enum -{ - EXTERNALHOST, // This message is for an external service - LOCALHOST, // This message is for an internal service only - MULTIHOST // This message is for an internal and an external service -} luos_localhost_t; - -typedef enum -{ - // protocol level command - WRITE_NODE_ID, /*!< Get and save a new given node ID. */ - START_DETECTION, /*!< Start a detection*/ - END_DETECTION, /*!< Detect the end of a detection*/ - ASSERT, /*!< Node Assert message (only broadcast with a source as a node */ - - /*!< Compatibility area*/ - // ROBUS_PROTOCOL_NB = 13, -} robus_cmd_t; - -typedef enum -{ - // Protocol version - BASE_PROTOCOL = PROTOCOL_REVISION, - TIMESTAMP_PROTOCOL, -} robus_protocol_t; - -#endif /* _STRUCT_IO_H_ */ diff --git a/engine/IO/inc/struct_phy.h b/engine/IO/inc/struct_phy.h new file mode 100644 index 000000000..e14b7753c --- /dev/null +++ b/engine/IO/inc/struct_phy.h @@ -0,0 +1,36 @@ +/****************************************************************************** + * @file phy.h + * @brief This file have to be imported by phy layers to interract with Luos + * @author Nicolas Rabault + * @version 0.0.0 + ******************************************************************************/ +#ifndef _STRUCT_PHY_H_ +#define _STRUCT_PHY_H_ + +#include +#include +#include "struct_luos.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +/****************************************************************************** + * @struct phy_job_t + * @brief Definition of a phy job (task to do by the phy) + ******************************************************************************/ +typedef struct +{ + // This is allowing to access the data as data pointer or message + union + { + const uint8_t *data_pt; // Start pointer of the data on msg_buffer. + const msg_t *msg_pt; // Pointer to the message. + }; + uint16_t size; // size of the data. + bool ack; // True if we want to receive a message acknoledgement. + bool timestamp; // True if this job is timestamped. + void *phy_data; // Phy developpers can use this pointer to store any data they need. +} phy_job_t; + +#endif /* _STRUCT_PHY_H_ */ diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c index 7082a1825..d531e218e 100644 --- a/engine/IO/src/filter.c +++ b/engine/IO/src/filter.c @@ -4,7 +4,6 @@ * @author Luos * @version 0.0.0 ******************************************************************************/ - #include "filter.h" #include "luos_utils.h" #include "luos_hal.h" @@ -121,7 +120,7 @@ _CRITICAL bool Filter_ServiceID(uint16_t service_id) if ((service_id > (8 * filter_ctx.IDShiftMask))) // IDMask aligned byte { - // Calcul ID mask for ID receive + // Calcul ID mask for ID received compare = ((service_id - 1) - ((8 * filter_ctx.IDShiftMask))); // Check if compare and internal mask match if ((filter_ctx.IDMask[compare / 8] & (1 << (compare % 8))) != 0) @@ -179,7 +178,7 @@ _CRITICAL bool Filter_Type(uint16_t type_id) * @return None * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL luos_localhost_t Filter_GetLocalhost(header_t *header) +_CRITICAL uint8_t Filter_GetPhyTarget(header_t *header) { // Find if we are concerned by this message. // check if we need to filter all the messages @@ -191,38 +190,45 @@ _CRITICAL luos_localhost_t Filter_GetLocalhost(header_t *header) // Check all service id if (Filter_ServiceID(header->target)) { - return LOCALHOST; + // This concerns Luos phy only + return 0x01; } break; case TYPE: if (Filter_Type(header->target)) { - return MULTIHOST; + // This concerns Luos phy and Robus + return 0x01 | (0x01 << 1); } break; case BROADCAST: if (header->target == BROADCAST_VAL) { - return MULTIHOST; + // This concerns Luos phy and Robus + return 0x01 | (0x01 << 1); } break; case NODEIDACK: case NODEID: - if ((header->target == Node_Get()->node_id)) + if (header->target == Node_Get()->node_id) { - return LOCALHOST; + // This concerns Luos phy only + return 0x01; } break; case TOPIC: if (Filter_Topic(header->target)) { - return MULTIHOST; + // This concerns Luos phy and Robus + return 0x01 | (0x01 << 1); } break; default: - return EXTERNALHOST; + // This concerns Robus only + return 0x01 << 1; break; } - return EXTERNALHOST; + // This concerns Robus only + return 0x01 << 1; } diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 1390d7ae8..9497d5d5a 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -1,23 +1,23 @@ /****************************************************************************** * @file luos_io.c - * @brief Interface file between Luos and a physical layer + * @brief Interface file between Luos and phy. This is also managing all protocol messages. * @author Luos * @version 0.0.0 ******************************************************************************/ #include #include "luos_io.h" -#include "transmission.h" -#include "reception.h" #include "msg_alloc.h" -#include "robus.h" #include "service.h" #include "filter.h" -#include "node.h" #include "luos_utils.h" #include "luos_hal.h" #include "luos_engine.h" #include "bootloader_core.h" +#include "_luos_phy.h" +#include "stats.h" + +#include "robus.h" /******************************************************************************* * Definitions @@ -38,11 +38,19 @@ typedef struct __attribute__((__packed__)) static error_return_t LuosIO_StartTopologyDetection(service_t *service); static error_return_t LuosIO_DetectNextNodes(service_t *service); +static void LuosIO_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job); +static error_return_t LuosIO_ConsumeMsg(const msg_t *input); +static void LuosIO_TransmitLocalRoutingTable(service_t *service, msg_t *routeTB_msg); /******************************************************************************* * Variables ******************************************************************************/ volatile uint16_t last_node = 0; +luos_phy_t *luos_phy; +service_filter_t service_filter[MAX_MSG_NB]; // Service filter table. Each of these filter will be linked with jobs. +uint8_t service_filter_index = 0; // Index of the next service filter to use. +service_t *detection_service = NULL; +bool Flag_DetectServices = false; /******************************************************************************* * Functions @@ -53,15 +61,22 @@ volatile uint16_t last_node = 0; * @param None * @return None ******************************************************************************/ -void LuosIO_Init(memory_stats_t *memory_stats) +void LuosIO_Init(void) { // Init filter Filter_IdInit(); Filter_TopicInit(); - + Stats_Init(); + memory_stats_t *memory_stats = Stats_GetMemory(); // Clear message allocation buffer table MsgAlloc_Init(memory_stats); + // Init Phy + Phy_Init(); + + // Get the Luos phy struct, Luos always use the first phy + luos_phy = Phy_Get(0, LuosIO_MsgHandler); + // Init Robus Robus_Init(); } @@ -74,8 +89,85 @@ void LuosIO_Init(memory_stats_t *memory_stats) void LuosIO_Loop(void) { // Execute message allocation tasks - MsgAlloc_loop(); + MsgAlloc_Loop(); + Phy_Loop(); + Robus_Loop(); + if (Flag_DetectServices == true) + { + Flag_DetectServices = false; + // Set the detection launcher id to 1 + detection_service->id = 1; + // Generate the filters + Service_GenerateId(1); + RoutingTB_DetectServices(detection_service); + } +} + +/****************************************************************************** + * @brief manage a message reception + * @param None + * @return None + ******************************************************************************/ +static void LuosIO_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job) +{ + // Check if this message is a protocol one + if (LuosIO_ConsumeMsg(job->msg_pt) == FAILED) + { + // If not create a service filter for this job. + service_filter[service_filter_index] = Service_GetFilter(job->msg_pt); + job->phy_data = &service_filter[service_filter_index]; + service_filter_index++; + if (service_filter_index >= MAX_MSG_NB) + { + service_filter_index = 0; + } + } + else + { + // This message was a protocol one, we can remove it. + Phy_RmJob(luos_phy, job); + } +} + +/****************************************************************************** + * @brief Send a message to the network + * @param service pointer to the service + * @param msg pointer to the message + * @return error return + ******************************************************************************/ +error_return_t LuosIO_Send(service_t *service, msg_t *msg) +{ + error_return_t error = SUCCEED; + + // *************************************************** + // Don't send luos messages if the network is down + // *************************************************** + if ((msg->header.cmd >= LUOS_LAST_RESERVED_CMD) && (Node_GetState() != DETECTION_OK)) + { + return PROHIBITED; + } + + // Save message information in the Luosphy struct + luos_phy->rx_buffer_base = (uint8_t *)msg; + luos_phy->rx_data = luos_phy->rx_buffer_base; + // For now let just consider that we received the header allowing us to compute the message things based on it. + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_keep = true; // Tell phy that we want to keep this message + Phy_ComputeHeader(luos_phy); + // The header computation give us how many byte we need to have. + // Just update the received data to the full message size. + luos_phy->received_data = luos_phy->rx_size; + // Validate the message to allocate it and generate tasks. + Phy_ValidMsg(luos_phy); + if (luos_phy->rx_data == NULL) + { + // The message wasn't kept, there is no more space on the buffer, or the message is corrupted. + // Return a failure to notify user. + return FAILED; + } + // Execute phy loop to dispatch the allocated message. Phy_Loop(); + return error; } /****************************************************************************** @@ -132,7 +224,6 @@ static error_return_t LuosIO_StartTopologyDetection(service_t *service) msg_t msg; uint8_t try_nbr = 0; - msg.header.config = BASE_PROTOCOL; msg.header.target = BROADCAST_VAL; msg.header.target_mode = BROADCAST; msg.header.cmd = START_DETECTION; @@ -147,14 +238,16 @@ static error_return_t LuosIO_StartTopologyDetection(service_t *service) // Load the message to send Luos_SendMsg(service, &msg); // Wait until message is actually transmitted - while (MsgAlloc_TxAllComplete() != SUCCEED) + while (Phy_TxAllComplete() != SUCCEED) ; // Reinit services id Service_ClearId(); // Reinit msg alloc MsgAlloc_Init(NULL); + // Reinit service filter + Filter_IdInit(); // Reinit Phy - Phy_Init(); + Phy_Reset(); // Wait 2ms to be sure all previous messages are received and treated by other nodes uint32_t start_tick = LuosHAL_GetSystick(); while (LuosHAL_GetSystick() - start_tick < 2) @@ -178,13 +271,19 @@ static error_return_t LuosIO_StartTopologyDetection(service_t *service) * @param msg pointer to the reeived message * @return error_return_t SUCCEED if the message have been consumed. ******************************************************************************/ -error_return_t LuosIO_MsgHandler(msg_t *input) +error_return_t LuosIO_ConsumeMsg(const msg_t *input) { msg_t output_msg; node_bootstrap_t node_bootstrap; - service_t *service = Service_GetConcerned(&input->header); + time_luos_t time; + service_t *service = Service_GetConcerned(&input->header); + dead_target_t *dead_target = (dead_target_t *)input->data; + uint16_t base_id = 0; + routing_table_t *route_tab = &RoutingTB_Get()[RoutingTB_GetLastEntry()]; + switch (input->header.cmd) { + //**************************************** detection section **************************************** case WRITE_NODE_ID: // Depending on the size of the received data we have to do different things switch (input->header.size) @@ -227,8 +326,10 @@ error_return_t LuosIO_MsgHandler(msg_t *input) Service_ClearId(); // Reinit msg alloc MsgAlloc_Init(NULL); + // Reinit service filter + Filter_IdInit(); // Reinit Phy - Phy_Init(); + Phy_Reset(); } // This is a node bootstrap information. memcpy((void *)&node_bootstrap.unmap[0], (void *)&input->data[0], sizeof(node_bootstrap_t)); @@ -236,33 +337,171 @@ error_return_t LuosIO_MsgHandler(msg_t *input) Robus_SaveNodeID(node_bootstrap.prev_nodeid); // Continue the topology detection on our other ports. LuosIO_DetectNextNodes(service); + break; default: + LUOS_ASSERT(0); break; } + // This message have been consumed return SUCCEED; break; - case BOOTLOADER_CMD: - if (input->data[0] == BOOTLOADER_RESET) + + case LOCAL_RTB: + // Depending on the size of this message we have to make different operations + // If size is 0 someone ask to get local_route table back + // If size is 2 someone ask us to generate a local route table based on the given service ID then send local route table back. + switch (input->header.size) { - LuosHAL_SetMode((uint8_t)BOOT_MODE); - LuosHAL_Reboot(); - // This message have been consumed - return SUCCEED; + case 2: + // generate local ID + RoutingTB_Erase(); + memcpy(&base_id, &input->data[0], sizeof(uint16_t)); + Service_GenerateId(base_id); + case 0: + // send back a local routing table + output_msg.header.cmd = RTB; + output_msg.header.target_mode = SERVICEIDACK; + output_msg.header.target = input->header.source; + LuosIO_TransmitLocalRoutingTable(0, &output_msg); + break; + default: + LUOS_ASSERT(0); + break; } - return FAILED; + return SUCCEED; break; + + case RTB: + // We are receiving a rouiting table + // Check routing table overflow + LUOS_ASSERT(((uintptr_t)route_tab + input->header.size) <= ((uintptr_t)RoutingTB_Get() + (sizeof(routing_table_t) * MAX_RTB_ENTRY))); + if (Luos_ReceiveData(service, input, (void *)route_tab) > 0) + { + // route table section reception complete + RoutingTB_ComputeRoutingTableEntryNB(); + Luos_ResetStatistic(); + } + return SUCCEED; + break; + case START_DETECTION: - MsgAlloc_Reset(); + Phy_Reset(); + MsgAlloc_Init(NULL); Node_SetState(EXTERNAL_DETECTION); + Service_ClearId(); + // Reset the data reception context + Luos_ReceiveData(NULL, NULL, NULL); Robus_ResetNodeID(); // This message have been consumed return SUCCEED; break; + case END_DETECTION: // Detect end of detection Node_SetState(DETECTION_OK); return FAILED; break; + + case ASK_DETECTION: + if (input->header.size == 0) + { + if (Node_GetState() < LOCAL_DETECTION) + { + detection_service = service; + Flag_DetectServices = true; + } + } + return SUCCEED; + break; + + //**************************************** failure section **************************************** + case ASSERT: + // A service assert remove all services of the asserted node in routing table + RoutingTB_RemoveNode(input->header.source); + // This assert information could be usefull for services, do not remove it. + return FAILED; + break; + + case DEADTARGET: + if (dead_target->node_id != 0) + { + RoutingTB_RemoveNode(dead_target->node_id); + } + if (dead_target->service_id != 0) + { + RoutingTB_RemoveService(dead_target->service_id); + } + // This assert information could be usefull for services, do not remove it. + return FAILED; + break; + + //**************************************** info section ********************************************** + + case REVISION: + if (input->header.size == 0) + { + output_msg.header.cmd = REVISION; + output_msg.header.target_mode = SERVICEID; + memcpy(output_msg.data, service->revision.unmap, sizeof(revision_t)); + output_msg.header.size = sizeof(revision_t); + output_msg.header.target = input->header.source; + Luos_SendMsg(service, &output_msg); + return SUCCEED; + } + break; + + case LUOS_REVISION: + if (input->header.size == 0) + { + const revision_t *luos_version = Luos_GetVersion(); + output_msg.header.cmd = LUOS_REVISION; + output_msg.header.target_mode = SERVICEID; + output_msg.header.size = sizeof(revision_t); + output_msg.header.target = input->header.source; + memcpy(output_msg.data, &luos_version->unmap, sizeof(revision_t)); + Luos_SendMsg(service, &output_msg); + return SUCCEED; + } + break; + + case LUOS_STATISTICS: + if (input->header.size == 0) + { + output_msg.header.cmd = LUOS_STATISTICS; + output_msg.header.target_mode = SERVICEID; + output_msg.header.size = sizeof(general_stats_t); + output_msg.header.target = input->header.source; + general_stats_t *general_stats = Stats_Get(); + memcpy(&general_stats->service_stat, service->statistics.unmap, sizeof(service_stats_t)); + memcpy(output_msg.data, &general_stats->unmap, sizeof(general_stats_t)); + Luos_SendMsg(service, &output_msg); + return SUCCEED; + } + break; + //**************************************** service section **************************************** + + case WRITE_ALIAS: + // Save this alias into the service + Luos_UpdateAlias(service, (const char *)input->data, input->header.size); + // Send this message to user + return FAILED; + break; + + case UPDATE_PUB: + // this service need to be auto updated + TimeOD_TimeFromMsg(&time, input); + service->auto_refresh.target = input->header.source; + service->auto_refresh.time_ms = (uint16_t)TimeOD_TimeTo_ms(time); + service->auto_refresh.last_update = LuosHAL_GetSystick(); + return SUCCEED; + break; + //**************************************** bootloader section **************************************** + case BOOTLOADER_CMD: + // send data to the bootloader + LuosBootloader_MsgHandler(input); + return SUCCEED; + break; + default: return FAILED; break; @@ -270,6 +509,28 @@ error_return_t LuosIO_MsgHandler(msg_t *input) return FAILED; } +/****************************************************************************** + * @brief Transmit local RTB to network + * @param service + * @param routeTB_msg : Loca RTB message to transmit + * @return none + ******************************************************************************/ +static inline void LuosIO_TransmitLocalRoutingTable(service_t *service, msg_t *routeTB_msg) +{ + uint16_t entry_nb = 0; + routing_table_t local_routing_table[Service_GetNumber() + 1]; + + // start by saving node entry + RoutingTB_ConvertNodeToRoutingTable(&local_routing_table[entry_nb], Node_Get()); + entry_nb++; + // save services entry + for (uint16_t i = 0; i < Service_GetNumber(); i++) + { + RoutingTB_ConvertServiceToRoutingTable((routing_table_t *)&local_routing_table[entry_nb++], &Service_GetTable()[i]); + } + Luos_SendData(service, routeTB_msg, (void *)local_routing_table, (entry_nb * sizeof(routing_table_t))); +} + /****************************************************************************** * @brief run the procedure allowing to detect the next nodes on the next physical layer port. * @param service pointer to the detecting service @@ -281,8 +542,6 @@ static error_return_t LuosIO_DetectNextNodes(service_t *service) while (Robus_FindNeighbour() == SUCCEED) { // There is someone here - // Clear spotted dead service detection - service->dead_service_spotted = 0; // Ask an ID to the detector service. msg_t msg; msg.header.config = BASE_PROTOCOL; @@ -292,17 +551,8 @@ static error_return_t LuosIO_DetectNextNodes(service_t *service) msg.header.size = 0; Luos_SendMsg(service, &msg); // Wait the end of transmission - while (MsgAlloc_TxAllComplete() == FAILED) + while (Phy_TxAllComplete() == FAILED) ; - // Check if there is a failure on transmission - if (service->dead_service_spotted != 0) - { - // Message transmission failure - // Consider this port unconnected by sending a 0xFFFF node id meaning that this port is not connected - Robus_SaveNodeID(0xFFFF); - continue; - } - // When Robus loop will receive the reply it will store and manage the new node_id and send it to the next node. // We just have to wait the end of the treatment of the entire branch uint32_t start_tick = LuosHAL_GetSystick(); @@ -318,3 +568,58 @@ static error_return_t LuosIO_DetectNextNodes(service_t *service) } return SUCCEED; } + +/****************************************************************************** + * @brief try to get a job from the job list. + * @param job_id the id of the job to get + * @param job pointer to the job pointer + * @return SUCEED if the job is available, FAILED if not. + ******************************************************************************/ +error_return_t LuosIO_TryToGetJob(uint16_t job_id, phy_job_t **job) +{ + LUOS_ASSERT(job != NULL); + MSGALLOC_MUTEX_LOCK + if (job_id < luos_phy->job_nb) + { + *job = &luos_phy->job[job_id]; + MSGALLOC_MUTEX_UNLOCK + return SUCCEED; + } + MSGALLOC_MUTEX_UNLOCK + return FAILED; +} + +/****************************************************************************** + * @brief remove a job from the job list. + * @param job pointer to the job to remove + * @return None. + ******************************************************************************/ +void LuosIO_RmJob(phy_job_t *job) +{ + // Be sure every service has finished to use this job + if (*(service_filter_t *)job->phy_data != 0) + { + // This job is still used by a service, we can't remove it now + return; + } + Phy_RmJob(luos_phy, job); +} + +/****************************************************************************** + * @brief get the number of job in the job list. + * @param None. + * @return the number of job in the job list. + ******************************************************************************/ +uint16_t LuosIO_GetJobNb(void) +{ + return luos_phy->job_nb; +} + +/****************************************************************************** + * @brief define is theire is something waiting to be sent or not + * @return Succeed if nothing is waiting to be sent + ******************************************************************************/ +error_return_t LuosIO_TxAllComplete(void) +{ + return Phy_TxAllComplete(); +} diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 475adf518..67cd09567 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -5,38 +5,89 @@ * @version 0.0.0 ******************************************************************************/ +/****************************************************************************** + * + * Phy receive messages from Luos and any other phy and dispatch all received messages to all phys + * + ************************************************* RX timeline representation ************************************************* + * ------------------+------------------------------------------------------------------------------------------------------------------+ + * | +---+-----------------+-----------------------+------------+---+ | + * Phy RX bus | | ? | Header | data | Timestamp | ? | | + * | +---+-----------------+-----------------------+------------+---+ | + * ------------------+-----------------------|----------------------------------------|-------------------------------------------------+ + * | V V | + * | +-------------------+ +--------------+ | + * IRQ | | Phy_ComputeHeader | | Phy_ValidMsg | | + * | +-------------------+ +--------------+ | + * | [Phy status updated]--+ | | + * ------------------+----------------------------------------------|-----------------------------|-------------------------------------+ + * | V | | + * | +-----------+ | +--------------+ | + * Loop |.......................| |..| Phy_alloc |.....| | |.....| Phy_Dispatch |.............| + * | +-----------+ | +--------------+ | + * | | ^ | | + * ------------------+----------------------------------------------------------------------------|--------|---------|------------------+ + * | V | | | + * | +--------+ | +------------+ | + * Generated | | io_job | +->| Phy[0].Job | | + * tasks | +--------+ | +------------+ | + * | | +------------+ | + * (Each generated | +->| Phy[1].Job | | + * job is inserted | | +------------+ | + * in a job table) | | +------------+ | + * | +->| Phy[3].Job | | + * | | +------------+ | + * | | +------------+ | + * | +->| Phy[x].Job | | + * | +------------+ | + * ------------------+------------------------------------------------------------------------------------------------------------------+ + * + ******************************************************************************/ + #include #include "luos_phy.h" +#include "_luos_phy.h" #include "filter.h" #include "msg_alloc.h" -#include "engine_config.h" #include "luos_hal.h" -#include "node.h" #include "_timestamp.h" -#include "robus.h" #include "luos_io.h" -#include "_luos_io.h" -#include "service.h" +// #include "service.h" /******************************************************************************* * Definitions ******************************************************************************/ +#define PHY_NB 2 + typedef struct __attribute__((__packed__)) { uint64_t timestamp; msg_t *alloc_msg; - luos_localhost_t phy_filter; -} luos_phy_job_t; + phy_target_t phy_filter; + uint16_t size; +} IO_job_t; typedef struct { - luos_phy_t phy; - luos_phy_job_t phy_job[MAX_MSG_NB]; - volatile uint16_t phy_job_nb; + // ******************** Phy management ******************** + luos_phy_t phy[PHY_NB]; // phy[0] is the local phy, phy[1] is the remote phy. + uint8_t phy_nb; // Number of phy instantiated in the phy_ctx.phy array. + + // ******************** job management ******************** + // io_jobs are stores from the newest to the oldest. + // This will add time in IRQ when we will pull a job but allow to keep pointers constant. + IO_job_t io_job[MAX_MSG_NB]; // Table of all the io_jobs to dispatch. + volatile uint16_t io_job_nb; // Number of io_jobs in the io_job table. + phy_job_t failed_job[4]; // Table of all the failed jobs we have to deal with. + uint8_t failed_job_nb; // Number of failed jobs in the failed_job table. } luos_phy_ctx_t; static void Phy_alloc(luos_phy_t *phy); static void Phy_Dispatch(void); +static void Phy_ManageFailedJob(void); +static phy_job_t *Phy_AddJob(luos_phy_t *phy_ptr, phy_job_t *phy_job); +static int Phy_GetJobId(luos_phy_t *phy_ptr, phy_job_t *job); +static int Phy_GetPhyId(luos_phy_t *phy_ptr); /******************************************************************************* * Variables @@ -48,83 +99,83 @@ luos_phy_ctx_t phy_ctx; ******************************************************************************/ /****************************************************************************** - * @brief POhy initialization + * @brief Phy initialization * @param None * @return None ******************************************************************************/ void Phy_Init(void) { - // Put everything to 0 - memset((void *)phy_ctx.phy_job, 0, sizeof(phy_ctx.phy_job)); - phy_ctx.phy_job_nb = 0; + Phy_Reset(); + phy_ctx.phy_nb = 1; } /****************************************************************************** - * @brief Phy loop + * @brief Reset the phy * @param None * @return None ******************************************************************************/ -void Phy_Loop(void) +void Phy_Reset(void) { - // Manage received data allocation - if (phy_ctx.phy.rx_alloc_job) + // Put everything to 0 + memset((void *)phy_ctx.io_job, 0, sizeof(phy_ctx.io_job)); + phy_ctx.io_job_nb = 0; + memset((void *)phy_ctx.failed_job, 0, sizeof(phy_ctx.failed_job)); + phy_ctx.failed_job_nb = 0; + for (uint8_t i = 0; i < phy_ctx.phy_nb; i++) { - Phy_alloc(&phy_ctx.phy); + memset((void *)&phy_ctx.phy[i].job, 0, sizeof(phy_ctx.phy[0].job)); + phy_ctx.phy[i].job_nb = 0; } - // Manage complete message received dispatching - Phy_Dispatch(); - Robus_Loop(); } /****************************************************************************** - * @brief Instanciate a physical layer + * @brief Phy loop * @param None * @return None ******************************************************************************/ -luos_phy_t *Phy_Create(void) +void Phy_Loop(void) { - return &phy_ctx.phy; + // Manage received data allocation + // This is only needed for Robus for now. + if (phy_ctx.phy[1].rx_alloc_job) + { + Phy_alloc(phy_ctx.phy); + } + // Manage complete message received dispatching + Phy_Dispatch(); + Phy_ManageFailedJob(); + // Compute phy job statistics + /* + uint8_t stat = (uint8_t)((job nbr * 100) / (MAX_MSG_NB)); + if (stat > mem_stat->rx_msg_stack_ratio) + { + memory_stats_t mem_stat->rx_msg_stack_ratio = stat; + }*/ } /****************************************************************************** - * @brief Send data on the physical layer - * @param data Data to send - * @param size Size of the data to send + * @brief Instanciate a physical layer + * @param phy_cb callback to call when we want to transmit a message * @return None ******************************************************************************/ -void Phy_Send(luos_phy_t *phy_ptr, uint8_t *data, uint16_t size) +luos_phy_t *Phy_Create(PHY_CB phy_cb) { + LUOS_ASSERT((phy_ctx.phy_nb < PHY_NB) && (phy_ctx.phy_nb > 0)); + return Phy_Get(phy_ctx.phy_nb++, phy_cb); } /****************************************************************************** - * @brief Consider the message as valid - * @param phy_ptr Pointer to the phy concerned by the allocation + * @brief return the local physical layer + * @param id of the phy we want + * @param phy_cb callback to call when we want to transmit a message * @return None ******************************************************************************/ -_CRITICAL void Phy_ValidMsg(luos_phy_t *phy_ptr) +luos_phy_t *Phy_Get(uint8_t id, PHY_CB phy_cb) { - LUOS_ASSERT(phy_ptr != NULL); - // Check if the allocation of the received message have been done - if (phy_ptr->rx_alloc_job) - { - // We did not allocate the received data yet - // This can happen if we did not had the time to execute Phy_Loop function before the end of the message reception or if this phy get the complete mgs in one time. - Phy_alloc(phy_ptr); - } - if (phy_ptr->rx_keep == true) - { - // Now we can create a phy_job to dispatch the tx_job later - LUOS_ASSERT(phy_ctx.phy_job_nb < MAX_MSG_NB); - LuosHAL_SetIrqState(false); - phy_ctx.phy_job[phy_ctx.phy_job_nb].timestamp = phy_ptr->rx_timestamp; - phy_ctx.phy_job[phy_ctx.phy_job_nb].alloc_msg = (msg_t *)phy_ptr->rx_data; - phy_ctx.phy_job[phy_ctx.phy_job_nb].phy_filter = phy_ptr->rx_phy_filter; - phy_ctx.phy_job_nb++; - // Then reset the phy to receive the next message - phy_ptr->rx_data = phy_ptr->rx_buffer_base; - phy_ptr->received_data = 0; - LuosHAL_SetIrqState(true); - } + // Set the callback + phy_ctx.phy[id].phy_cb = phy_cb; + // Return the phy pointer + return &phy_ctx.phy[id]; } /****************************************************************************** @@ -132,7 +183,7 @@ _CRITICAL void Phy_ValidMsg(luos_phy_t *phy_ptr) * @param phy_ptr Pointer to the phy concerned by this message * @return None ******************************************************************************/ -inline void Phy_Computeheader(luos_phy_t *phy_ptr) +inline void Phy_ComputeHeader(luos_phy_t *phy_ptr) { // Compute the size of the data to allocate @@ -145,24 +196,88 @@ inline void Phy_Computeheader(luos_phy_t *phy_ptr) { phy_ptr->rx_size = ((header_t *)phy_ptr->rx_buffer_base)->size + sizeof(header_t); // We need to check if we have a timestamped message and increase the data size if yes - if (Luos_IsMsgTimstamped((msg_t *)(phy_ptr->rx_data)) == true) // TODO move it to TX + if (Luos_IsMsgTimstamped((msg_t *)(phy_ptr->rx_data)) == true) { phy_ptr->rx_size += sizeof(time_luos_t); } } // Compute the phy concerned by this message - phy_ptr->rx_phy_filter = Filter_GetLocalhost((header_t *)phy_ptr->rx_buffer_base); - if (phy_ptr->rx_phy_filter != EXTERNALHOST) + phy_ptr->rx_phy_filter = Filter_GetPhyTarget((header_t *)phy_ptr->rx_buffer_base); + // Remove the phy asking to compute the header to avoid to retransmit it, except for Luos because Luos can do localhost. + uint32_t index = Phy_GetPhyId(phy_ptr); + if (index != 0) + { + // remove the phy asking to compute the header, except if it is Luos because Luos can do localhost. + phy_ptr->rx_phy_filter &= ~(0x01 << index); + } + if (phy_ptr->rx_phy_filter != 0) { + // Someone need to receive this message phy_ptr->rx_keep = true; phy_ptr->rx_alloc_job = true; + phy_ptr->rx_ack = ((((header_t *)phy_ptr->rx_buffer_base)->target_mode == SERVICEIDACK) || (((header_t *)phy_ptr->rx_buffer_base)->target_mode == NODEIDACK)); } else { + // No one need to receive this message phy_ptr->rx_keep = false; phy_ptr->rx_alloc_job = false; + phy_ptr->rx_ack = false; + return; + } +} + +/****************************************************************************** + * @brief Consider the message as valid + * @param phy_ptr Pointer to the phy concerned by the allocation + * @return None + ******************************************************************************/ +_CRITICAL void Phy_ValidMsg(luos_phy_t *phy_ptr) +{ + LUOS_ASSERT(phy_ptr != NULL); + // Check if the allocation of the received message have been done + if (phy_ptr->rx_alloc_job) + { + // We did not allocate the received data yet + // This can happen if we did not had the time to execute Phy_Loop function before the end of the message reception or if this phy get the complete mgs in one time. + Phy_alloc(phy_ptr); } + if (phy_ptr->rx_keep == true) + { + // Now we can create a phy_job to dispatch the tx_job later + LUOS_ASSERT(phy_ctx.io_job_nb < MAX_MSG_NB); + LuosHAL_SetIrqState(false); + phy_ctx.io_job[phy_ctx.io_job_nb].timestamp = phy_ptr->rx_timestamp; + phy_ctx.io_job[phy_ctx.io_job_nb].alloc_msg = (msg_t *)phy_ptr->rx_data; + phy_ctx.io_job[phy_ctx.io_job_nb].phy_filter = phy_ptr->rx_phy_filter; + phy_ctx.io_job[phy_ctx.io_job_nb].size = phy_ptr->rx_size; + phy_ctx.io_job_nb++; + // Then reset the phy to receive the next message + phy_ptr->rx_data = phy_ptr->rx_buffer_base; + phy_ptr->received_data = 0; + LuosHAL_SetIrqState(true); + } +} + +/****************************************************************************** + * @brief Compute the timestamp to send with the message + * @param job Pointer to the job concerned by this message + * @return None + ******************************************************************************/ +time_luos_t Phy_ComputeTimestamp(phy_job_t *job) +{ + LUOS_ASSERT((job != NULL) && (job->msg_pt != NULL) && (job->timestamp == true)); + return Timestamp_ConvertToLatency(job->msg_pt); +} + +/****************************************************************************** + * @brief return the node id + * @return Node ID value + ******************************************************************************/ +uint16_t Phy_GetNodeId(void) +{ + return Node_Get()->node_id; } /****************************************************************************** @@ -188,7 +303,6 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) LUOS_ASSERT(phy_ptr->rx_data == phy_ptr->rx_buffer_base); LuosHAL_SetIrqState(true); - // Now we can check if we need to store the received data if (phy_ptr->rx_keep) { @@ -200,10 +314,18 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) uint16_t phy_stored_data_size = phy_ptr->received_data; phy_ptr->rx_alloc_job = false; // Now allocate it - rx_data = MsgAlloc_Alloc(phy_ptr->rx_size); - // Assert if the allocation failed. We don't allow to loose a RX message. - LUOS_ASSERT(rx_data != NULL); + rx_data = MsgAlloc_Alloc(phy_ptr->rx_size, (uint8_t)phy_ptr->rx_phy_filter); phy_ptr->rx_data = rx_data; + // Assert if the allocation failed. We don't allow to loose a message comming from outside. + if ((phy_ptr == &phy_ctx.phy[0]) && (rx_data == NULL)) + { + // We don't successfully allocated the message. + // This is luos trying to send something, return and Luos will wait... + LuosHAL_SetIrqState(true); + phy_ptr->rx_keep = false; + return; + } + LUOS_ASSERT(rx_data != NULL); // Job is done LuosHAL_SetIrqState(true); copy_from = (void *)phy_ptr->rx_buffer_base; @@ -235,37 +357,220 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) ******************************************************************************/ static void Phy_Dispatch(void) { - // Interpreat received messages and create luos task for it. - while (phy_ctx.phy_job_nb) + static bool running = false; + int i = 0; + if (running) + { + return; + } + running = true; + // Interpreat received messages and create tasks for it. + LuosHAL_SetIrqState(false); + while (i < phy_ctx.io_job_nb) { - // Get the oldest job - LuosHAL_SetIrqState(false); - luos_phy_job_t job = phy_ctx.phy_job[--phy_ctx.phy_job_nb]; LuosHAL_SetIrqState(true); + // Get the oldest job + IO_job_t *job = &phy_ctx.io_job[i]; + i++; // If message is timestamped, convert the latency to date - if (Luos_IsMsgTimstamped(job.alloc_msg)) + if (Luos_IsMsgTimstamped(job->alloc_msg)) { - // This conversion also remove the timestamp from the message size. - Timestamp_ConvertToDate(job.alloc_msg, job.timestamp); + Timestamp_ConvertToDate(job->alloc_msg, job->timestamp); } - // Check if this message is a protocol one - if (LuosIO_MsgHandler(job.alloc_msg) == FAILED) + // Network phy first then Luos in the end + for (int y = phy_ctx.phy_nb - 1; y >= 0; y--) { - // If not create luos tasks for all services. - Service_AllocMsg(job.alloc_msg); - // Later this service level dispatch will need to be done in core. - // LuosIO shoudn't care about service level, and should just list the message as a task to do on the Luos side. + // Loop in all phys + if ((job->phy_filter >> y) & 0x01) + { + // Phy[y] is concerned by this message. + // Generate the job and put it in the phy queue + phy_job_t phy_job; + phy_job.msg_pt = job->alloc_msg; + phy_job.size = job->size; + phy_job.ack = ((job->alloc_msg->header.target_mode == NODEIDACK) || (job->alloc_msg->header.target_mode == SERVICEIDACK)); + phy_job.timestamp = Luos_IsMsgTimstamped(job->alloc_msg); + + // Write the job in the phy queue and get back the pointer to it + phy_job_t *job_ptr = Phy_AddJob(&phy_ctx.phy[y], &phy_job); + // Notify this phy that a job is available and give it the concerned job on his queue + phy_ctx.phy[y].phy_cb(&phy_ctx.phy[y], job_ptr); + } } + LuosHAL_SetIrqState(false); + } + phy_ctx.io_job_nb = 0; + LuosHAL_SetIrqState(true); + running = false; +} + +/****************************************************************************** + * @brief Manage a failed trasmit job. + * @param phy_ptr pointer to the phy that failed to send a message. + * @param job pointer to the job that failed. + * @return None + ******************************************************************************/ +_CRITICAL void Phy_DeadTargetSpotted(luos_phy_t *phy_ptr, phy_job_t *job) +{ + // A phy failed to send a message, we need to be sure that our node don't try to contact this target again. + LUOS_ASSERT(job->msg_pt->header.target_mode == NODEIDACK || job->msg_pt->header.target_mode == SERVICEIDACK || job->msg_pt->header.target_mode == NODEID || job->msg_pt->header.target_mode == SERVICEID); + // Store the job in the dead service spotted list + phy_ctx.failed_job[phy_ctx.failed_job_nb++] = *job; + + // Remove all job targeting this target on this phy job queue; + for (int i = 0; i < phy_ptr->job_nb; i++) + { + if ((phy_ptr->job[i].msg_pt->header.target == job->msg_pt->header.target) && (phy_ptr->job[i].msg_pt->header.target_mode == job->msg_pt->header.target_mode)) + { + // This job is targeting the dead target, remove it from the queue + phy_ptr->job_nb--; + for (int j = i; j < phy_ptr->job_nb; j++) + { + phy_ptr->job[j] = phy_ptr->job[j + 1]; + } + } + } +} + +/****************************************************************************** + * @brief Manage a failed trasmit job. + * @param None + * @return None + ******************************************************************************/ +static void Phy_ManageFailedJob(void) +{ + // This is allowing to avoid recursive call to this function + static bool managing_failed_job = false; + // Check if we have failed job to manage + if ((phy_ctx.failed_job_nb != 0) && (managing_failed_job == false)) + { + managing_failed_job = true; + // We have failed jobs to manage + for (int i = 0; i < phy_ctx.failed_job_nb; i++) + { + // Create a broadcast message to inform everyone that this target is dead + msg_t dead_msg; + dead_msg.header.cmd = DEADTARGET; + dead_msg.header.target_mode = BROADCAST; + dead_msg.header.target = BROADCAST_VAL; + dead_msg.header.size = sizeof(dead_target_t); + + dead_target_t *dead_target = (dead_target_t *)dead_msg.data; + if (phy_ctx.failed_job[i].msg_pt->header.target_mode == NODEIDACK || phy_ctx.failed_job[i].msg_pt->header.target_mode == NODEID) + { + dead_target->node_id = phy_ctx.failed_job[i].msg_pt->header.target; + dead_target->service_id = 0; + } + else + { + dead_target->node_id = 0; + dead_target->service_id = phy_ctx.failed_job[i].msg_pt->header.target; + } + Luos_SendMsg(0, &dead_msg); + } + phy_ctx.failed_job_nb = 0; + managing_failed_job = false; + } +} + +/****************************************************************************** + * @brief Add a job to the phy queue + * @param phy_ptr Phy to add the job to + * @param phy_job Job to add + * @return None + ******************************************************************************/ +static phy_job_t *Phy_AddJob(luos_phy_t *phy_ptr, phy_job_t *phy_job) +{ + // Check if the phy queue is full + LUOS_ASSERT((phy_job != NULL) && (phy_ptr != NULL)); + LUOS_ASSERT(phy_ptr->job_nb < MAX_MSG_NB); + // Add the job to the queue + LuosHAL_SetIrqState(false); + phy_ptr->job[phy_ptr->job_nb++] = *phy_job; + LuosHAL_SetIrqState(true); + return &phy_ptr->job[phy_ptr->job_nb - 1]; +} + +/****************************************************************************** + * @brief Get the oldest job from the phy queue + * @param phy_ptr Phy to get the job from + * @return Job pointer + ******************************************************************************/ +_CRITICAL inline phy_job_t *Phy_GetJob(luos_phy_t *phy_ptr) +{ + LUOS_ASSERT(phy_ptr != NULL); + if (phy_ptr->job_nb == 0) + { + return NULL; } - // Localhost message are still stored on the MsgAlloc msg_task buffer, we have to deal with it too. - msg_t *msg; - while (MsgAlloc_PullMsgToInterpret(&msg) == SUCCEED) + return &phy_ptr->job[0]; +} + +/****************************************************************************** + * @brief Get the job id from the job pointer + * @param phy_ptr Phy to get the job id from + * @param job Job pointer + * @return Job id + ******************************************************************************/ +inline int Phy_GetJobId(luos_phy_t *phy_ptr, phy_job_t *job) +{ + return (((uintptr_t)job - (uintptr_t)phy_ptr->job) / sizeof(phy_job_t)); +} + +inline int Phy_GetPhyId(luos_phy_t *phy_ptr) +{ + return ((uintptr_t)phy_ptr - (uintptr_t)phy_ctx.phy) / sizeof(luos_phy_t); +} + +/****************************************************************************** + * @brief Remove the oldest job from the phy queue + * @param phy_ptr Phy to remove the job from + * @return None + ******************************************************************************/ +_CRITICAL void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job) +{ + LUOS_ASSERT((phy_ptr != NULL) && (job != NULL)); + if (phy_ptr->job_nb == 0) + { + return; + } + // We potentially need to free this message from msg allocator + // Get the Phy index + int phy_index = Phy_GetPhyId(phy_ptr); + MsgAlloc_Free(phy_index, job->data_pt); + + // Remove the job from the queue + uint8_t id = Phy_GetJobId(phy_ptr, job); + for (int i = id; i < phy_ptr->job_nb; i++) + { + phy_ptr->job[i] = phy_ptr->job[i + 1]; + } + phy_ptr->job_nb--; +} + +/****************************************************************************** + * @brief Get the number of job in the phy queue + * @param phy_ptr Phy to get the number of job from + * @return Number of job + ******************************************************************************/ +_CRITICAL inline uint16_t Phy_GetJobNbr(luos_phy_t *phy_ptr) +{ + return phy_ptr->job_nb; +} + +/****************************************************************************** + * @brief define is there is something waiting to be sent or not + * @return Succeed if nothing is waiting to be sent + ******************************************************************************/ +error_return_t Phy_TxAllComplete(void) +{ + // We don't check the first phy because it is Luos + for (int i = 1; i < phy_ctx.phy_nb; i++) { - // Check if this message is a protocol one - if (LuosIO_MsgHandler(msg) == FAILED) + if (Phy_GetJobNbr(&phy_ctx.phy[i]) != 0) { - // If not create luos tasks for all services. - Service_AllocMsg(msg); + return FAILED; } } + return SUCCEED; } diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index be2b20449..937bf9496 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -44,89 +44,49 @@ #include #include -#include #include "msg_alloc.h" #include "luos_hal.h" #include "luos_utils.h" -#include "node.h" -#include "filter.h" -#include "struct_luos.h" /******************************************************************************* * Definitions ******************************************************************************/ - -/****************************************************************************** - * @struct luos_task_t - * @brief Message allocator loger structure. - * - * This structure is used to link services and messages into the allocator. - * - ******************************************************************************/ typedef struct { - msg_t *msg_pt; /*!< Start pointer of the msg on msg_buffer. */ - service_t *service_pt; /*!< Pointer to the concerned service. */ -} luos_task_t; + uint8_t *data; // Pointer to the first byte of the message. + uint8_t phy_filter; // Physical filter of the message. +} alloc_slot_t; -typedef struct -{ - uint8_t *data_pt; /*!< Start pointer of the data on msg_buffer. */ - uint16_t size; /*!< size of the data. */ - service_t *service_pt; /*!< Pointer to the transmitting service. */ -} tx_task_t; /******************************************************************************* * Variables ******************************************************************************/ -memory_stats_t *mem_stat = NULL; -volatile bool reset_needed = false; +memory_stats_t *mem_stat = NULL; // msg buffering volatile uint8_t msg_buffer[MSG_BUFFER_SIZE]; /*!< Memory space used to save and alloc messages. */ volatile uint8_t *data_ptr; /*!< Pointer to the next data able to be written into msgbuffer. */ -volatile msg_t *oldest_msg = NULL; /*!< The oldest message among all the stacks. */ -volatile msg_t *used_msg = NULL; /*!< Message curently used by luos loop. */ - -// msg interpretation task stack -volatile msg_t *msg_tasks[MAX_MSG_NB]; /*!< ready message table. */ -volatile uint16_t msg_tasks_stack_id; /*!< Next writen msg_tasks id. */ - -// Luos task stack -volatile luos_task_t luos_tasks[MAX_MSG_NB]; /*!< Message allocation table. */ -volatile uint16_t luos_tasks_stack_id; /*!< Next writen luos_tasks id. */ - -// Tx task stack -volatile tx_task_t tx_tasks[MAX_MSG_NB]; /*!< Message to transmit allocation table. */ -volatile uint16_t tx_tasks_stack_id; /*!< Next writen tx_tasks id. */ +alloc_slot_t alloc_slots[MAX_MSG_NB]; /*!< Slots used to save the index of the first byte of a message. */ +volatile uint16_t alloc_slot_index; /*!< Index of the next slot able to be written. */ /******************************************************************************* * Functions ******************************************************************************/ -// msg buffering -_CRITICAL static inline error_return_t MsgAlloc_DoWeHaveSpace(void *to); +// Pack allocated messages +static inline void MsgAlloc_SlotPack(void); -// Allocator task stack -_CRITICAL static inline error_return_t MsgAlloc_ClearMsgSpace(void *from, void *to); +// msg buffering +_CRITICAL static inline error_return_t MsgAlloc_DoWeHaveSpaceUntilBufferEnd(void *to); // Allocator task stack TX check space static inline error_return_t MsgAlloc_CheckMsgSpace(void *from, void *to); -// msg interpretation task stack -_CRITICAL static inline void MsgAlloc_ClearMsgTask(void); - -// Luos task stack -_CRITICAL static inline void MsgAlloc_ClearLuosTask(uint16_t luos_task_id); - // Available buffer space evaluation static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void); -// Check if this message is the oldest -_CRITICAL static inline void MsgAlloc_OldestMsgCandidate(msg_t *oldest_stack_msg_pt); - -// Find the oldest message curretly stored -_CRITICAL static inline void MsgAlloc_FindNewOldestMsg(void); +// Find get the oldest message +_CRITICAL static inline uint8_t *MsgAlloc_GetOldestMsg(void); /******************************************************************************* * Functions --> generic @@ -140,53 +100,75 @@ _CRITICAL static inline void MsgAlloc_FindNewOldestMsg(void); void MsgAlloc_Init(memory_stats_t *memory_stats) { //******** Init global vars pointers ********** - msg_tasks_stack_id = 0; - memset((void *)msg_tasks, 0, sizeof(msg_tasks)); - luos_tasks_stack_id = 0; - memset((void *)luos_tasks, 0, sizeof(luos_tasks)); - tx_tasks_stack_id = 0; - memset((void *)tx_tasks, 0, sizeof(tx_tasks)); LuosHAL_SetIrqState(false); - data_ptr = (uint8_t *)&msg_buffer[0]; - used_msg = NULL; - oldest_msg = (msg_t *)INT_MAX; + data_ptr = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 0; + memset((void *)alloc_slots, 0, sizeof(alloc_slots)); LuosHAL_SetIrqState(true); if (memory_stats != NULL) { mem_stat = memory_stats; } - Filter_IdInit(); // Mask filter for service ID - // Reset have been made - reset_needed = false; } + /****************************************************************************** * @brief execute some things out of IRQ * @param None * @return None ******************************************************************************/ -void MsgAlloc_loop(void) +void MsgAlloc_Loop(void) { - // Compute memory stats for msg task memory usage - uint8_t stat = 0; - // Compute memory stats for rx msg task memory usage - stat = (uint8_t)(((uintptr_t)msg_tasks_stack_id * 100) / (MAX_MSG_NB)); - if (stat > mem_stat->rx_msg_stack_ratio) - { - mem_stat->rx_msg_stack_ratio = stat; - } - // Compute memory stats for tx msg task memory usage - stat = (uint8_t)(((uintptr_t)tx_tasks_stack_id * 100) / (MAX_MSG_NB)); - if (stat > mem_stat->tx_msg_stack_ratio) - { - mem_stat->tx_msg_stack_ratio = stat; - } + // Pack the list of allocated messages + MsgAlloc_SlotPack(); // Compute buffer occupation rate - stat = (uint8_t)(((MSG_BUFFER_SIZE - MsgAlloc_BufferAvailableSpaceComputation()) * 100) / (MSG_BUFFER_SIZE)); + uint8_t stat = 0; + stat = (uint8_t)(((MSG_BUFFER_SIZE - MsgAlloc_BufferAvailableSpaceComputation()) * 100) / (MSG_BUFFER_SIZE)); if (stat > mem_stat->buffer_occupation_ratio) { mem_stat->buffer_occupation_ratio = stat; } } + +/****************************************************************************** + * @brief re-organize the list of allocated messages + * @param None + * @return None + ******************************************************************************/ +static inline void MsgAlloc_SlotPack(void) +{ + LUOS_ASSERT(alloc_slot_index <= MAX_MSG_NB); + // Pack the list of allocated messages + uint16_t i = 0; + uint16_t decay = 0; + LuosHAL_SetIrqState(false); + for (i = 0; i < alloc_slot_index; i++) + { + if (alloc_slots[i].data == 0) + { + decay++; + } + else + { + if (decay == 0) + { + continue; + } + if (i < MAX_MSG_NB) + { + alloc_slots[i - decay] = alloc_slots[i]; + alloc_slots[i].data = 0; + } + else + { + + alloc_slots[i - decay].data = 0; + } + } + } + alloc_slot_index -= decay; + LuosHAL_SetIrqState(true); +} + /****************************************************************************** * @brief compute remaing space on msg_buffer. * @param None @@ -195,9 +177,11 @@ void MsgAlloc_loop(void) static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void) { uint32_t stack_free_space = 0; + LUOS_ASSERT(((uintptr_t)data_ptr >= (uintptr_t)&msg_buffer[0]) && ((uintptr_t)data_ptr < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE])); LuosHAL_SetIrqState(false); - if ((uintptr_t)oldest_msg != INT_MAX) + uint8_t *oldest_msg = MsgAlloc_GetOldestMsg(); + if (oldest_msg != NULL) { LUOS_ASSERT(((uintptr_t)oldest_msg >= (uintptr_t)&msg_buffer[0]) && ((uintptr_t)oldest_msg < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE])); // There is some tasks @@ -211,7 +195,7 @@ static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void) // | | // |<-----Free space---->| // | | - // data_ptr oldest_task + // data_ptr oldest_msg // stack_free_space = (uintptr_t)oldest_msg - (uintptr_t)data_ptr; LuosHAL_SetIrqState(true); @@ -228,7 +212,7 @@ static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void) // <-Free space->| |<-Free space-> // | | // | | - // oldest_task data_ptr + // oldest_msg data_ptr // stack_free_space = ((uintptr_t)oldest_msg - (uintptr_t)&msg_buffer[0]) + ((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - (uintptr_t)data_ptr); LuosHAL_SetIrqState(true); @@ -236,84 +220,37 @@ static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void) } else { - // There is no task yet just compute the actual reception + // There is nothing allocated stack_free_space = MSG_BUFFER_SIZE; LuosHAL_SetIrqState(true); } return stack_free_space; } + /****************************************************************************** - * @brief save the given msg as oldest if it is - * @param oldest_stack_msg_pt : the oldest message of a stack + * @brief update the new oldest message if we need to + * @param removed_msg : the freshly oldest removed message of the stack * @return None * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL static inline void MsgAlloc_OldestMsgCandidate(msg_t *oldest_stack_msg_pt) +_CRITICAL static inline uint8_t *MsgAlloc_GetOldestMsg(void) { - if ((uintptr_t)oldest_stack_msg_pt > 0) + LUOS_ASSERT(alloc_slot_index <= MAX_MSG_NB); + // Get the oldest message + if (alloc_slot_index == 0) { - LUOS_ASSERT(((uintptr_t)oldest_stack_msg_pt >= (uintptr_t)&msg_buffer[0]) && ((uintptr_t)oldest_stack_msg_pt < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE])); - // recompute oldest_stack_msg_pt into delta byte from current message - uint32_t stack_delta_space; - if ((uintptr_t)oldest_stack_msg_pt > (uintptr_t)data_ptr) - { - // The oldest task is between `data_ptr` and the end of the buffer - LuosHAL_SetIrqState(false); - stack_delta_space = (uintptr_t)oldest_stack_msg_pt - (uintptr_t)data_ptr; - LuosHAL_SetIrqState(true); - } - else - { - // The oldest task is between the begin of the buffer and `data_ptr` - // we have to decay it to be able to define delta - LuosHAL_SetIrqState(false); - stack_delta_space = ((uintptr_t)oldest_stack_msg_pt - (uintptr_t)&msg_buffer[0]) + ((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - (uintptr_t)data_ptr); - LuosHAL_SetIrqState(true); - } - // recompute oldest_msg into delta byte from current message - uintptr_t oldest_msg_delta_space; - if ((uintptr_t)oldest_msg > (uintptr_t)data_ptr) - { - // The oldest msg is between `data_ptr` and the end of the buffer - LuosHAL_SetIrqState(false); - oldest_msg_delta_space = (uintptr_t)oldest_msg - (uintptr_t)data_ptr; - LuosHAL_SetIrqState(true); - } - else - { - // The oldest msg is between the begin of the buffer and `data_ptr` - // we have to decay it to be able to define delta - LuosHAL_SetIrqState(false); - oldest_msg_delta_space = ((uintptr_t)oldest_msg - (uintptr_t)&msg_buffer[0]) + ((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - (uintptr_t)data_ptr); - LuosHAL_SetIrqState(true); - } - // Compare deltas - if (stack_delta_space < oldest_msg_delta_space) + // There is no message allocated + return NULL; + } + for (int i = 0; i < alloc_slot_index; i++) + { + if (alloc_slots[i].data != NULL) { - // This one is the new oldest message - oldest_msg = oldest_stack_msg_pt; + return alloc_slots[i].data; } } -} -/****************************************************************************** - * @brief update the new oldest message if we need to - * @param removed_msg : the freshly oldest removed message of the stack - * @return None - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL static inline void MsgAlloc_FindNewOldestMsg(void) -{ - // Reinit the value - oldest_msg = (msg_t *)INT_MAX; - MSGALLOC_MUTEX_LOCK - // start parsing tasks to find the oldest message - // check it on msg_tasks - MsgAlloc_OldestMsgCandidate((msg_t *)msg_tasks[0]); - // check it on luos_tasks - MsgAlloc_OldestMsgCandidate(luos_tasks[0].msg_pt); - // check it on tx_tasks - MsgAlloc_OldestMsgCandidate((msg_t *)tx_tasks[0].data_pt); - MSGALLOC_MUTEX_UNLOCK + // There is no message allocated + return NULL; } /******************************************************************************* @@ -327,8 +264,9 @@ _CRITICAL static inline void MsgAlloc_FindNewOldestMsg(void) * @return error_return_t * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL static inline error_return_t MsgAlloc_DoWeHaveSpace(void *to) +_CRITICAL static inline error_return_t MsgAlloc_DoWeHaveSpaceUntilBufferEnd(void *to) { + LUOS_ASSERT((uintptr_t)to >= (uintptr_t)&msg_buffer[0]); if ((uintptr_t)to > ((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE - 1])) { // We reach msg_buffer end. @@ -348,19 +286,27 @@ _CRITICAL static inline error_return_t MsgAlloc_DoWeHaveSpace(void *to) /****************************************************************************** * @brief Allocate a new message * @param uint16_t data_size - * @return None + * @param phy_target_t phy_filter + * @return uint8_t * : pointer to the allocated message * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL uint8_t *MsgAlloc_Alloc(uint16_t data_size) +_CRITICAL uint8_t *MsgAlloc_Alloc(uint16_t data_size, uint8_t phy_filter) { + LUOS_ASSERT((data_size > 0) + && (phy_filter != 0) + && (data_size <= MSG_BUFFER_SIZE)); uint8_t *returned_ptr; // Check data ptr alignement if ((uintptr_t)data_ptr % 2 == 1) { data_ptr++; + if (data_ptr == &msg_buffer[MSG_BUFFER_SIZE]) + { + data_ptr = &msg_buffer[0]; + } } // Check if we have space for the message - if (MsgAlloc_DoWeHaveSpace((void *)(data_ptr + data_size)) == FAILED) + if (MsgAlloc_DoWeHaveSpaceUntilBufferEnd((void *)(data_ptr + data_size)) == FAILED) { // // We don't have the space to store the message : @@ -378,6 +324,13 @@ _CRITICAL uint8_t *MsgAlloc_Alloc(uint16_t data_size) // data_ptr data_end // + // Check if we dont jump any messages + if (MsgAlloc_CheckMsgSpace((void *)data_ptr, (void *)&msg_buffer[MSG_BUFFER_SIZE - 1]) != SUCCEED) + { + // We don't have the space to store the message, return NULL to indicate that there is no more space + return NULL; + } + // We don't have the space to store the message, move data_ptr to the beginning of the buffer returned_ptr = (uint8_t *)&msg_buffer[0]; } @@ -385,145 +338,73 @@ _CRITICAL uint8_t *MsgAlloc_Alloc(uint16_t data_size) { returned_ptr = (uint8_t *)data_ptr; } - // Check if we have space for the message, assert if we don't + // Check if we have space for the message if (MsgAlloc_CheckMsgSpace((void *)returned_ptr, (void *)((uintptr_t)returned_ptr + data_size)) != SUCCEED) { // We don't have the space to store the message, return NULL to indicate that there is no more space return NULL; } - // We consider this space as occupied, move data to the next available space + // We consider this space as occupied, save its reference into the alloc_slots + alloc_slots[alloc_slot_index].data = returned_ptr; + alloc_slots[alloc_slot_index].phy_filter = phy_filter; + alloc_slot_index++; + // Move data to the next available space data_ptr = (uint8_t *)((uintptr_t)returned_ptr + data_size); return returned_ptr; } + /****************************************************************************** - * @brief No message in buffer receive since initialization - * @param None - * @return msg_t* sucess or fail if good init - ******************************************************************************/ -error_return_t MsgAlloc_IsEmpty(void) -{ - if (data_ptr == &msg_buffer[0]) - { - return SUCCEED; - } - else - { - return FAILED; - } -} -/****************************************************************************** - * @brief Reset msg_alloc tx_tasks to avoid sending messages - * @param None + * @brief Free a message + * @param uint8_t phy_id : id of the phy that free the message + * @param uint8_t *data : pointer to the message to free * @return None * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL void MsgAlloc_Reset(void) +_CRITICAL void MsgAlloc_Free(uint8_t phy_id, const uint8_t *data) { - // We will need to reset - - MSGALLOC_MUTEX_LOCK - reset_needed = true; - tx_tasks_stack_id = 0; - memset((void *)tx_tasks, 0, sizeof(tx_tasks)); - MSGALLOC_MUTEX_UNLOCK -} -/****************************************************************************** - * @brief Check if we need to reset Msg alloc - * @param None - * @return SUCCEED or FAILED if msg alloc is reset or not - ******************************************************************************/ -error_return_t MsgAlloc_IsReseted(void) -{ - // Check if we need to reset everything due to detection reset - if (reset_needed) + LUOS_ASSERT(data != NULL); + // Find the slot where the data is stored + for (int i = 0; i < alloc_slot_index; i++) { - if (Node_Get()->node_id != 0) + if (alloc_slots[i].data == data) { - Node_Get()->node_id = 0; - // We need to reset MsgAlloc - MsgAlloc_Init(NULL); + // This is the one we are looking for + // Remove the phy_id from the phy_filter + // Assert if this phy have already been freed + LUOS_ASSERT(alloc_slots[i].phy_filter & (0x01 << phy_id)); + alloc_slots[i].phy_filter &= ~(0x01 << phy_id); + // Check if the phy_filter is empty + if (alloc_slots[i].phy_filter == 0) + { + // This message is not used anymore, free it + alloc_slots[i].data = NULL; + } + return; } - reset_needed = false; - return SUCCEED; } - return FAILED; + // If you pass here, the message have been freed already. + // You probably are in detection and the reset detection reseted the allocator before this free. } -/******************************************************************************* - * Functions --> Allocator task stack - ******************************************************************************/ - /****************************************************************************** - * @brief prepare a buffer space to be usable by cleaning remaining messages and prepare pointers - * @param from : start of the memory space to clean - * @param to : start of the memory space to clean - * @return error_return_t - * _CRITICAL function call in IRQ + * @brief No message in buffer receive since initialization + * @param None + * @return msg_t* sucess or fail if good init ******************************************************************************/ -_CRITICAL static inline error_return_t MsgAlloc_ClearMsgSpace(void *from, void *to) +error_return_t MsgAlloc_IsEmpty(void) { - //******** Check if there is sufficient space on the buffer ********** - if (MsgAlloc_DoWeHaveSpace(to) == FAILED) - { - // We reach msg_buffer end return an error - return FAILED; - } - //******** Prepare a memory space to be writable ********** - - // check if there is a msg traitement pending - if (((uintptr_t)used_msg >= (uintptr_t)from) && ((uintptr_t)used_msg <= (uintptr_t)to)) + LUOS_ASSERT(alloc_slot_index <= MSG_BUFFER_SIZE); + if (alloc_slot_index == 0) { - used_msg = NULL; - // This message is in the space we want to use, clear the task - if (mem_stat->msg_drop_number < 0xFF) - { - mem_stat->msg_drop_number++; - mem_stat->buffer_occupation_ratio = 100; - } + return SUCCEED; } - // check if there is a msg in the space we need - // Start by checking if the oldest message is out of scope - if (((uintptr_t)oldest_msg >= (uintptr_t)from) && ((uintptr_t)oldest_msg <= (uintptr_t)to)) + else { - // We have to drop some messages for sure - mem_stat->buffer_occupation_ratio = 100; - while (((uintptr_t)luos_tasks[0].msg_pt >= (uintptr_t)from) && ((uintptr_t)luos_tasks[0].msg_pt <= (uintptr_t)to) && (luos_tasks_stack_id > 0)) - { - // This message is in the space we want to use, clear all the Luos task - MsgAlloc_ClearLuosTask(0); - if (mem_stat->msg_drop_number < 0xFF) - { - mem_stat->msg_drop_number++; - mem_stat->buffer_occupation_ratio = 100; - } - } - // check if there is no msg between from and to on msg_tasks - while (((uintptr_t)msg_tasks[0] >= (uintptr_t)from) && ((uintptr_t)msg_tasks[0] <= (uintptr_t)to) && (msg_tasks_stack_id > 0)) - { - // This message is in the space we want to use, clear all the message task - MsgAlloc_ClearMsgTask(); - if (mem_stat->msg_drop_number < 0xFF) - { - mem_stat->msg_drop_number++; - mem_stat->buffer_occupation_ratio = 100; - } - } - // check if there is no msg between from and to on tx_tasks - while (((uintptr_t)tx_tasks[0].data_pt >= (uintptr_t)from) && ((uintptr_t)tx_tasks[0].data_pt <= (uintptr_t)to) && (tx_tasks_stack_id > 0)) - { - // This message is in the space we want to use, clear all the Tx task - MsgAlloc_PullMsgFromTxTask(); - if (mem_stat->msg_drop_number < 0xFF) - { - mem_stat->msg_drop_number++; - mem_stat->buffer_occupation_ratio = 100; - } - } + return FAILED; } - // if we go here there is no reason to continue because newest messages can't overlap the memory zone. - return SUCCEED; } + /****************************************************************************** * @brief Check if there is space in buffer * @param from : start of the memory space to check @@ -532,8 +413,13 @@ _CRITICAL static inline error_return_t MsgAlloc_ClearMsgSpace(void *from, void * ******************************************************************************/ static inline error_return_t MsgAlloc_CheckMsgSpace(void *from, void *to) { - if ((((uintptr_t)used_msg >= (uintptr_t)from) && ((uintptr_t)used_msg <= (uintptr_t)to)) - || (((uintptr_t)oldest_msg >= (uintptr_t)from) && ((uintptr_t)oldest_msg <= (uintptr_t)to))) + LUOS_ASSERT(((uintptr_t)from < (uintptr_t)to) + && ((uintptr_t)from >= (uintptr_t)&msg_buffer[0]) + && ((uintptr_t)from < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE]) + && ((uintptr_t)to >= (uintptr_t)&msg_buffer[0]) + && ((uintptr_t)to < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE])); + uint8_t *oldest_msg = MsgAlloc_GetOldestMsg(); + if ((((uintptr_t)oldest_msg >= (uintptr_t)from) && ((uintptr_t)oldest_msg <= (uintptr_t)to))) { // FAILED CASES : // @@ -544,821 +430,8 @@ static inline error_return_t MsgAlloc_CheckMsgSpace(void *from, void *to) // | | | // from | to // | - // "used_msg" - // or "oldest_msg" - // - return FAILED; - } - return SUCCEED; -} -/******************************************************************************* - * Functions --> msg interpretation task stack - ******************************************************************************/ - -/****************************************************************************** - * @brief Clear a slot. This action is due to an error - * @param None - * @return None - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL static inline void MsgAlloc_ClearMsgTask(void) -{ - LUOS_ASSERT((msg_tasks_stack_id <= MAX_MSG_NB) && (msg_tasks_stack_id > 0)); - - // - // msg_tasks init state msg_tasks ending state - // +---------+ +---------+ - // | MSG_1 | | MSG_2 | - // +---------+ +---------+ - // | MSG_2 | | MSG_3 | - // +---------+ +---------+ - // | etc... | | etc... |<--msg_tasks_stack_id - // +---------+ +---------+ - // | Last |<--msg_tasks_stack_id | 0 | <--- Last message is cleared - // +---------+ +---------+ - // | etc... | | etc... | - // +---------+ +---------+ - // - MSGALLOC_MUTEX_LOCK - for (uint16_t rm = 0; rm < msg_tasks_stack_id; rm++) - { - LuosHAL_SetIrqState(true); - LuosHAL_SetIrqState(false); - LUOS_ASSERT((msg_tasks[rm] != 0)); - msg_tasks[rm] = msg_tasks[rm + 1]; - } - - msg_tasks_stack_id--; - msg_tasks[msg_tasks_stack_id] = 0; - - LuosHAL_SetIrqState(true); - MSGALLOC_MUTEX_UNLOCK - MsgAlloc_FindNewOldestMsg(); -} -/****************************************************************************** - * @brief Pull a message that is not interpreted by the phy yet - * @param returned_msg : The message pointer. - * @return error_return_t - ******************************************************************************/ -error_return_t MsgAlloc_PullMsgToInterpret(msg_t **returned_msg) -{ - if (msg_tasks_stack_id > 0) - { - // Case SUCCEED + // "oldest_msg" // - // msg_tasks init state msg_tasks ending state - // +---------+ +---------+ - // | MSG_1 | | MSG_2 |<--"returned_msg" points to 1st message of msg_tasks - // |---------| |---------| - // | MSG_2 | | MSG_3 | - // |---------| |---------| - // | etc... | | etc... | - // |---------| |---------|<--msg_tasks_stack_id - // | LAST | | 0 | - // +---------+<--msg_tasks_stack_id +---------+ - // - *returned_msg = (msg_t *)msg_tasks[0]; - LUOS_ASSERT(((uintptr_t)*returned_msg >= (uintptr_t)&msg_buffer[0]) && ((uintptr_t)*returned_msg < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE])); - MsgAlloc_ClearMsgTask(); - return SUCCEED; - } - // At this point we don't find any message for this service - return FAILED; -} - -/******************************************************************************* - * Functions --> Luos task stack - ******************************************************************************/ - -/****************************************************************************** - * @brief Notify the end of the usage of the message. - * @param returned_msg : The message pointer. - * @return None - ******************************************************************************/ -void MsgAlloc_UsedMsgEnd(void) -{ - used_msg = NULL; -} -/****************************************************************************** - * @brief Clear a slot. This action is due to an error - * @param None - * @return None - ******************************************************************************/ -_CRITICAL static inline void MsgAlloc_ClearLuosTask(uint16_t luos_task_id) -{ - LUOS_ASSERT((luos_task_id < luos_tasks_stack_id) && (luos_tasks_stack_id <= MAX_MSG_NB)); - // - // Start to clear from "luos_task_id" - // - // Luos_tasks init state Luos_tasks ending state - // +---------+ +---------+ - // | MSG_1 | | MSG_1 | - // +---------+ +---------+ - // | MSG_2 | | MSG_2 | - // +---------+ +---------+ - // | etc... | | etc... | - // +---------+ +---------+ - // | Msg X |<--luos_task_id | 0 |<--luos_tasks_stack_id - // +---------+ +---------+ - // | etc... | | 0 | - // |---------| |---------| - // | LAST | | 0 | - // +---------+ +---------+ - // | 0 |<--luos_tasks_stack_id | 0 | - // +---------+ |---------| - // - MSGALLOC_MUTEX_LOCK - for (uint16_t rm = luos_task_id; rm < luos_tasks_stack_id; rm++) - { - LuosHAL_SetIrqState(false); - luos_tasks[rm] = luos_tasks[rm + 1]; - LuosHAL_SetIrqState(true); - } - LuosHAL_SetIrqState(false); - if (luos_tasks_stack_id != 0) - { - luos_tasks_stack_id--; - luos_tasks[luos_tasks_stack_id].msg_pt = 0; - luos_tasks[luos_tasks_stack_id].service_pt = 0; - } - LuosHAL_SetIrqState(true); - MSGALLOC_MUTEX_UNLOCK - MsgAlloc_FindNewOldestMsg(); -} -/****************************************************************************** - * @brief Alloc luos task - * @param service_concerned_by_current_msg concerned services - * @param service_concerned_by_current_msg concerned msg - * @return None - ******************************************************************************/ -void MsgAlloc_LuosTaskAlloc(service_t *service_concerned_by_current_msg, msg_t *concerned_msg) -{ - // Find a free slot - if (luos_tasks_stack_id == MAX_MSG_NB) - { - // There is no more space on the luos_tasks, remove the oldest msg. - MsgAlloc_ClearLuosTask(0); - if (mem_stat->msg_drop_number < 0xFF) - { - mem_stat->msg_drop_number++; - mem_stat->engine_msg_stack_ratio = 100; - } - } - // Fill the informations of the message in this slot - MSGALLOC_MUTEX_LOCK - LuosHAL_SetIrqState(false); - LUOS_ASSERT(luos_tasks_stack_id < MAX_MSG_NB); - luos_tasks[luos_tasks_stack_id].msg_pt = concerned_msg; - luos_tasks[luos_tasks_stack_id].service_pt = service_concerned_by_current_msg; - if (luos_tasks_stack_id == 0) - { - // This is the first message in the stack, so it could be the oldest one. - MsgAlloc_OldestMsgCandidate(luos_tasks[0].msg_pt); - } - luos_tasks_stack_id++; - LuosHAL_SetIrqState(true); - MSGALLOC_MUTEX_UNLOCK - // Luos task memory usage - uint8_t stat = (uint8_t)(((uintptr_t)luos_tasks_stack_id * 100) / (MAX_MSG_NB)); - if (stat > mem_stat->engine_msg_stack_ratio) - { - mem_stat->engine_msg_stack_ratio = stat; - } -} - -/******************************************************************************* - * Functions --> Luos tasks find and consume - ******************************************************************************/ - -/****************************************************************************** - * @brief Pull a message allocated to a specific service - * @param target_service : The service concerned by this message - * @param returned_msg : The message pointer. - * @return error_return_t - ******************************************************************************/ -error_return_t MsgAlloc_PullMsg(service_t *target_service, msg_t **returned_msg) -{ - // - // Pull a message from a specific service - // - // For example, there are 4 messages in buffer and required service is in task 3 : - // luos_tasks_stack_id = 3 : function will search in messages 1, 2 & 3 - // - // - // msg_buffer msg_buffer after pull - // +------------------------+ +------------------------+ - // |------------------------| |------------------------| - // +--^---^---^---^---------+ +--^---^---^---^---------+ - // | | | | | | | | - // Msg: 1 2 3 4 1 2 | 4 - // used_msg - // returned_msg - // - // - // luos_tasks luos_tasks - // +---------+ +---------+ - // | MSG_1 |\ | MSG_1 | - // |---------| | |---------| - // | MSG_2 | | | MSG_2 | - // |---------| | |---------| - // | MSG_3 | | | MSG_4 |<-- third message pulled is cleared - // |---------| | |---------| - // | MSG_4 | |<--luos_tasks_stack_id | 0 | - // |---------| / |---------| - // | 0 | | 0 | - // |---------| |---------| - // | etc... | | etc... | - // +---------+ +---------+ - // - // find the oldest message allocated to this service - for (uint16_t i = 0; i < luos_tasks_stack_id; i++) - { - if (luos_tasks[i].service_pt == target_service) - { - *returned_msg = luos_tasks[i].msg_pt; - // Clear the slot by sliding others to the left on it - used_msg = *returned_msg; - MsgAlloc_ClearLuosTask(i); - return SUCCEED; - } - } - // At this point we don't find any message for this service - // - // luos_tasks - // +---------+ - // | MSG_1 | - // |---------| - // | MSG_2 |<--luos_tasks_stack_id - // |---------| - // | MSG_3 |\_ - // |---------| | - // | etc... | | <-- search these IDs - // |---------| | (function return FAILED if ID > luos_tasks_stack_id) - // | Last | _| - // +---------+/ - // - return FAILED; -} -/****************************************************************************** - * @brief Pull a message allocated to a specific luos task - * @param luos_task_id : Id of the allocator luos task - * @param returned_msg : The message pointer. - * @return error_return_t - ******************************************************************************/ -error_return_t MsgAlloc_PullMsgFromLuosTask(uint16_t luos_task_id, msg_t **returned_msg) -{ - // - // msg_buffer example : msg_buffer after pulling message D2 - // +------------------------+ +------------------------+ - // |------------------------| |------------------------| - // +--^-------^-------^-----+ +--^-------^-------^-----+ - // | | | | | | - // Msg: 1 2 ... LAST 1 2 ... LAST - // used_msg - // returned_msg - // - // luos_tasks luos_tasks - // +---------+ +---------+ - // | MSG_1 | | MSG_1 | - // |---------| |---------| - // | MSG_2 | | MSG_3 | - // |---------| |---------| - // | MSG_3 | | MSG_4 | - // |---------| |---------| - // | etc... | | etc... | - // |---------| |---------| - // | LAST | | 0 | - // +---------+ +---------+ - // - // find the oldest message allocated to this service - if (luos_task_id < luos_tasks_stack_id) - { - used_msg = luos_tasks[luos_task_id].msg_pt; - *returned_msg = (msg_t *)used_msg; - // Clear the slot by sliding others to the left on it - MsgAlloc_ClearLuosTask(luos_task_id); - return SUCCEED; - } - // At this point we don't find any message for this service - // - // luos_tasks - // +---------+ - // | MSG_1 | - // |---------| - // | MSG_2 |<--luos_tasks_stack_id - // |---------| - // | MSG_3 |\_ - // |---------| | - // | etc... | | <-- search these IDs - // |---------| | (function return FAILED if ID > luos_tasks_stack_id) - // | Last | _| - // +---------+/ - // - return FAILED; -} -/****************************************************************************** - * @brief get back the service who received the oldest message - * @param allocated_service : Return the service concerned by the oldest message - * @param luos_task_id : Id of the allocator slot - * @return error_return_t : Fail is there is no more message available. - ******************************************************************************/ -error_return_t MsgAlloc_LookAtLuosTask(uint16_t luos_task_id, service_t **allocated_service) -{ - // - // luos_tasks - // +---------+ - // | MSG_1 | - // |---------| - // | MSG_2 |<-- if searching this ID : fills service pointer associated to D 2 Luos Task - // |---------| - // | MSG_3 |<--luos_tasks_stack_id - // |---------| - // | 0 | - // |---------| - // | etc... | - // |---------| - // | 0 | - // +---------+ - // - MSGALLOC_MUTEX_LOCK - if (luos_task_id < luos_tasks_stack_id) - { - *allocated_service = luos_tasks[luos_task_id].service_pt; - MSGALLOC_MUTEX_UNLOCK - return SUCCEED; - } - // - // luos_tasks - // +---------+ - // | MSG_1 | - // |---------| - // | MSG_2 |<--luos_tasks_stack_id - // |---------| - // | MSG_3 |\_ - // |---------| | - // | etc... | | <-- search these IDs - // |---------| | (function return FAILED if ID > luos_tasks_stack_id) - // | Last | _| - // +---------+/ - // - MSGALLOC_MUTEX_UNLOCK - return FAILED; -} -/****************************************************************************** - * @brief get back a specific slot message command - * @param luos_task_id : Id of the allocator slot - * @param cmd : The pointer filled with the cmd value. - * @return error_return_t : Fail is there is no more message available. - ******************************************************************************/ -error_return_t MsgAlloc_GetLuosTaskCmd(uint16_t luos_task_id, uint8_t *cmd) -{ - // - // luos_tasks - // +---------+ - // | MSG_1 || - // |---------|<--luos_tasks_stack_id : fills CMD header pointer - // | MSG_2 | - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // - MSGALLOC_MUTEX_LOCK - if (luos_task_id < luos_tasks_stack_id) - { - *cmd = luos_tasks[luos_task_id].msg_pt->header.cmd; - MSGALLOC_MUTEX_UNLOCK - return SUCCEED; - } - // - // luos_tasks - // +---------+ - // | MSG_1 | - // |---------| - // | MSG_2 |<--luos_tasks_stack_id - // |---------| - // | MSG_3 |\_ - // |---------| | - // | etc... | | <-- search these IDs - // |---------| | (function return FAILED if ID > luos_tasks_stack_id) - // | Last | _| - // +---------+/ - // - MSGALLOC_MUTEX_UNLOCK - return FAILED; -} -/****************************************************************************** - * @brief get back a specific slot message command - * @param luos_task_id : Id of the allocator slot - * @param cmd : The pointer filled with the cmd value. - * @return error_return_t : Fail is there is no more message available. - ******************************************************************************/ -error_return_t MsgAlloc_GetLuosTaskSourceId(uint16_t luos_task_id, uint16_t *source_id) -{ - // - // luos_tasks - // +---------+ - // | MSG_1 | - // |---------|<--luos_tasks_stack_id : fills SOURCE header pointer - // | MSG_2 | - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // - MSGALLOC_MUTEX_LOCK - if (luos_task_id < luos_tasks_stack_id) - { - *source_id = luos_tasks[luos_task_id].msg_pt->header.source; - MSGALLOC_MUTEX_UNLOCK - return SUCCEED; - } - // - // luos_tasks - // +---------+ - // | MSG_1 | - // |---------| - // | MSG_2 |<--luos_tasks_stack_id - // |---------| - // | MSG_3 |\_ - // |---------| | - // | etc... | | <-- search these IDs - // |---------| | (function return FAILED if ID > luos_tasks_stack_id) - // | Last | _| - // +---------+/ - // - MSGALLOC_MUTEX_UNLOCK - return FAILED; -} -/****************************************************************************** - * @brief get back a specific slot message command - * @param luos_task_id : Id of the allocator slot - * @param size : The pointer filled with the size value. - * @return error_return_t : Fail is there is no more message available. - ******************************************************************************/ -error_return_t MsgAlloc_GetLuosTaskSize(uint16_t luos_task_id, uint16_t *size) -{ - // - // luos_tasks - // +---------+ - // | MSG_1 | - // |---------|<--luos_tasks_stack_id : fills SIZE header pointer - // | MSG_2 | - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // - MSGALLOC_MUTEX_LOCK - if (luos_task_id < luos_tasks_stack_id) - { - *size = luos_tasks[luos_task_id].msg_pt->header.size; - MSGALLOC_MUTEX_UNLOCK - return SUCCEED; - } - // - // luos_tasks - // +---------+ - // | MSG_1 | - // |---------| - // | MSG_2 |<--luos_tasks_stack_id - // |---------| - // | MSG_3 |\_ - // |---------| | - // | etc... | | <-- search these IDs - // |---------| | (function return FAILED if ID > luos_tasks_stack_id) - // | Last | _| - // +---------+/ - // - MSGALLOC_MUTEX_UNLOCK - return FAILED; -} -/****************************************************************************** - * @brief return the number of allocated messages - * @param None - * @return the number of messages - ******************************************************************************/ -uint16_t MsgAlloc_LuosTasksNbr(void) -{ - return (uint16_t)luos_tasks_stack_id; -} -/****************************************************************************** - * @brief Clear a specific message in Luos Tasks - * @param None - * @return the number of messages - ******************************************************************************/ -void MsgAlloc_ClearMsgFromLuosTasks(msg_t *msg) -{ - // - // Example with message to clean = MSG_2 - // - // msg_buffer - // +-------------------------------------------------------------+ - // |--| 1 | 2 |----| 3 |------------ | X |--------| - // +--^-----^--------^------------------------^------------------+ - // | | | | - // | | | | - // | | | | - // | | | Luos_tasks init state | Luos_tasks ending state - // | | | +---------+ | +---------+ - // +-----|--------|-->| MSG_1 | | | MSG_1 | - // | | |---------| | |---------| - // +--------|-->| MSG_2 | | | MSG_3 | - // | |---------| | |---------| - // +-->| MSG_3 | | | etc... | - // |---------| | |---------| - // | etc... | | | Last | - // |---------| | |---------| - // | Last |<---------+ | 0 | - // +---------+ +---------+ - // - uint16_t id = 0; - while (id < luos_tasks_stack_id) - { - if (luos_tasks[id].msg_pt == msg) - { - MsgAlloc_ClearLuosTask(id); - } - else - { - id++; - } - } - // If message to clean is not in Luos_tasks : nothing is done - // - // msg_buffer - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // +----------^^................^---------------^----------------+ - // || | | - // || Luos_tasks | msg to clean - // || +---------+ | - // +|->| MSG_1 | | - // | |---------| | - // +->| MSG_2 | | - // |---------| | - // | etc... | | - // |---------| | - // | Last |<--+ - // +---------+ - // -} -/******************************************************************************* - * Functions --> Tx tasks create, get and consume - ******************************************************************************/ - -/****************************************************************************** - * @brief copy a message to transmit into msg_buffer and create a Tx task - * @param data to transmit - * @param size of the data to transmit - * @return None - ******************************************************************************/ -error_return_t MsgAlloc_SetTxTask(service_t *service_pt, uint8_t *data, uint16_t crc, uint16_t size, luos_localhost_t localhost, uint8_t ack) -{ - LUOS_ASSERT((tx_tasks_stack_id >= 0) && (tx_tasks_stack_id < MAX_MSG_NB) && ((uintptr_t)data > 0)); - void *tx_msg = 0; - - // Then compute if we have space into the TX_message buffer stack - if (tx_tasks_stack_id >= MAX_MSG_NB - 1) - { - return FAILED; - } - MSGALLOC_MUTEX_LOCK - - LuosHAL_SetIrqState(false); - // Alloc the space for the message - tx_msg = (void *)MsgAlloc_Alloc(size); - if (tx_msg == NULL) - { - MSGALLOC_MUTEX_UNLOCK - return FAILED; - } - LuosHAL_SetIrqState(true); - - // Copy the tx msg into the buffer - memcpy((void *)tx_msg, (void *)data, size); - -#ifndef VERBOSE_LOCALHOST - if (localhost != LOCALHOST) - { -#endif - // if VERBOSE_LOCALHOST is defined : Create a tx task to transmit on network for all localhost mode (including LOCALHOST) - // if VERBOSE_LOCALHOST is NOT defined : create a tx task to transmit on network, except for LOCALHOST - // - // Now we are ready to transmit, we can create the tx task - LuosHAL_SetIrqState(false); - tx_tasks[tx_tasks_stack_id].size = size; - tx_tasks[tx_tasks_stack_id].data_pt = (uint8_t *)tx_msg; - tx_tasks[tx_tasks_stack_id].service_pt = service_pt; - tx_tasks_stack_id++; - LUOS_ASSERT(tx_tasks_stack_id < MAX_MSG_NB); - LuosHAL_SetIrqState(true); - // Check if last tx task is the oldest msg of the buffer - if (tx_tasks_stack_id == 0) - { - MsgAlloc_OldestMsgCandidate((msg_t *)tx_tasks[0].data_pt); - } -#ifndef VERBOSE_LOCALHOST - } -#endif - - // Write the CRC and the ACK if needed - if (ack != 0) - { - // Write the CRC and Ack - ((char *)tx_msg)[size - 3] = (uint8_t)(crc); - ((char *)tx_msg)[size - 2] = (uint8_t)(crc >> 8); - ((char *)tx_msg)[size - 1] = ack; - } - else - { - // Write the CRC only - ((char *)tx_msg)[size - 2] = (uint8_t)(crc); - ((char *)tx_msg)[size - 1] = (uint8_t)(crc >> 8); - } - MSGALLOC_MUTEX_UNLOCK - - // manage localhost (exclude EXTERNALHOST) - if (localhost != EXTERNALHOST) - { - // This is a localhost (LOCALHOST or MULTIHOST) message copy it as a message task - LUOS_ASSERT(!(msg_tasks_stack_id > 0) || (((uintptr_t)msg_tasks[0] >= (uintptr_t)&msg_buffer[0]) && ((uintptr_t)msg_tasks[0] < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE]))); - MSGALLOC_MUTEX_LOCK - LuosHAL_SetIrqState(false); - LUOS_ASSERT(msg_tasks[msg_tasks_stack_id] == 0); - msg_tasks[msg_tasks_stack_id] = tx_msg; - LUOS_ASSERT((msg_tasks[msg_tasks_stack_id] != 0)); - msg_tasks_stack_id++; - LuosHAL_SetIrqState(true); - MSGALLOC_MUTEX_UNLOCK - } - MsgAlloc_FindNewOldestMsg(); - return SUCCEED; -} -/****************************************************************************** - * @brief remove a transmit message task - * @param None - * @return None - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL void MsgAlloc_PullMsgFromTxTask(void) -{ - if (tx_tasks_stack_id != 0) - { - LUOS_ASSERT((tx_tasks_stack_id > 0) && (tx_tasks_stack_id <= MAX_MSG_NB)); - // - // - // tx_tasks tx_tasks tx_tasks - // +---------+ +---------+ +---------+<--tx_tasks_stack_id = 0 - // | Tx1 | | Tx2 | | 0 | - // |---------| |---------| |---------| - // | Tx2 | | Tx3 | | 0 | - // |---------| |---------| |---------| - // | Tx3 | | Tx4 | | 0 | - // |---------| |---------| |---------| - // | etc... | | etc... | etc... | etc... | - // |---------| |---------| |---------| - // | etc... | tx_tasks_stack_id-->| etc... | | 0 | - // |---------| |---------| |---------| - // tx_tasks_stack_id-->| LAST | | 0 | | 0 | - // +---------+ +---------+ +---------+ - // - // Decay tasks - for (int i = 0; i < tx_tasks_stack_id; i++) - { - LuosHAL_SetIrqState(false); - tx_tasks[i].data_pt = tx_tasks[i + 1].data_pt; - tx_tasks[i].size = tx_tasks[i + 1].size; - LuosHAL_SetIrqState(true); - } - LuosHAL_SetIrqState(false); - if (tx_tasks_stack_id != 0) - { - tx_tasks_stack_id--; - tx_tasks[tx_tasks_stack_id].data_pt = 0; - tx_tasks[tx_tasks_stack_id].size = 0; - } - LuosHAL_SetIrqState(true); - MsgAlloc_FindNewOldestMsg(); - } -} -/****************************************************************************** - * @brief remove all transmit task of a specific service - * @param None - * @return None - ******************************************************************************/ -void MsgAlloc_PullServiceFromTxTask(uint16_t service_id) -{ - // - // Remove a Tx message from a specific service by analyzing "target" in header (for example service is in tx task Tx2) - // tx_tasks_stack_id = 3 : function will search in messages Tx1, Tx2 & Tx3 - // - // tx_tasks tx_tasks - // +---------+ +---------+ - // | Tx1 |\ | Tx1 | - // |---------| | |---------| - // | Tx2 | | | Tx3 |<-- messaged Tx2 has been is cleared - // |---------| | |---------| - // | Tx3 |/ | Tx4 | - // |---------|<--tx_tasks_stack_id |---------| - // | etc... | | etc... | - // |---------| |---------| - // | LAST | | 0 | - // +---------+ +---------+ - // - LUOS_ASSERT((tx_tasks_stack_id > 0) && (tx_tasks_stack_id <= MAX_MSG_NB)); - uint8_t task_id = 0; - // check all task - while (task_id < tx_tasks_stack_id) - { - if (((msg_t *)tx_tasks[task_id].data_pt)->header.target == service_id) - { - // Decay tasks - for (uint8_t i = task_id; i < tx_tasks_stack_id; i++) - { - LuosHAL_SetIrqState(false); - tx_tasks[i].data_pt = tx_tasks[i + 1].data_pt; - tx_tasks[i].size = tx_tasks[i + 1].size; - LuosHAL_SetIrqState(true); - } - LuosHAL_SetIrqState(false); - if (tx_tasks_stack_id != 0) - { - tx_tasks_stack_id--; - tx_tasks[tx_tasks_stack_id].data_pt = 0; - tx_tasks[tx_tasks_stack_id].size = 0; - } - LuosHAL_SetIrqState(true); - } - else - { - task_id++; - } - } - MsgAlloc_FindNewOldestMsg(); -} -/****************************************************************************** - * @brief return a message to transmit - * @param service_pt service sending this data - * @param data to send - * @param size of the data to send - * @param localhost is this message a localhost one - * @return error_return_t : Fail is there is no more message available. - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL error_return_t MsgAlloc_GetTxTask(service_t **service_pt, uint8_t **data, uint16_t *size) -{ - LUOS_ASSERT(tx_tasks_stack_id < MAX_MSG_NB); - - // - // example if luos_tasks_stack_id = 0 - // luos_tasks - // +---------+ - // | MSG_1 | - // |---------|<--luos_tasks_stack_id : tx_tasks[0] is filled with pointers (service, data, size & localhost) - // | MSG_2 | - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // - LuosHAL_SetIrqState(false); - if (tx_tasks_stack_id > 0) - { - *data = tx_tasks[0].data_pt; - *size = tx_tasks[0].size; - *service_pt = tx_tasks[0].service_pt; - LuosHAL_SetIrqState(true); - return SUCCEED; - } - LuosHAL_SetIrqState(true); - // - // luos_tasks - // +---------+<--luos_tasks_stack_id (no message, function return FAILED) - // | MSG_1 | - // |---------| - // | MSG_2 | - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // - return FAILED; -} -/****************************************************************************** - * @brief check if there is uncomplete tx_tasks - * @param None - * @return error_return_t : Fail is there is untransmitted message. - ******************************************************************************/ -_CRITICAL error_return_t MsgAlloc_TxAllComplete(void) -{ - if (tx_tasks_stack_id > 0) - { return FAILED; } return SUCCEED; diff --git a/engine/OD/od_linear.h b/engine/OD/od_linear.h index aac85d89a..b25e9f517 100644 --- a/engine/OD/od_linear.h +++ b/engine/OD/od_linear.h @@ -7,7 +7,6 @@ #ifndef OD_OD_LINEAR_H_ #define OD_OD_LINEAR_H_ -#include "struct_io.h" #include "string.h" /******************************************************************************* diff --git a/engine/OD/od_time.h b/engine/OD/od_time.h index 480f0a425..c95779f17 100644 --- a/engine/OD/od_time.h +++ b/engine/OD/od_time.h @@ -8,114 +8,10 @@ #define OD_OD_TIME_H_ #include +#include "time_luos.h" /******************************************************************************* * Definitions ******************************************************************************/ -typedef struct -{ - double _private; -} time_luos_t; - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Function - ******************************************************************************/ -// time values are stored in seconds (s) -//******** Conversions *********** - -// sec -static inline double TimeOD_TimeTo_s(time_luos_t self) -{ - return self._private; -} - -static inline time_luos_t TimeOD_TimeFrom_s(double sec) -{ - time_luos_t self; - self._private = sec; - return self; -} - -// ms -static inline double TimeOD_TimeTo_ms(time_luos_t self) -{ - return self._private * 1000.0f; -} - -static inline time_luos_t TimeOD_TimeFrom_ms(double ms) -{ - time_luos_t self; - self._private = ms / 1000.0f; - return self; -} - -// µs -static inline double TimeOD_TimeTo_us(time_luos_t self) -{ - return self._private * 1000000.0f; -} - -static inline time_luos_t TimeOD_TimeFrom_us(double us) -{ - time_luos_t self; - self._private = us / 1000000.0f; - return self; -} - -// ns -static inline double TimeOD_TimeTo_ns(time_luos_t self) -{ - return self._private * 1000000000.0f; -} - -static inline time_luos_t TimeOD_TimeFrom_ns(double ns) -{ - time_luos_t self; - self._private = ns / 1000000000.0f; - return self; -} - -// min -static inline double TimeOD_TimeTo_min(time_luos_t self) -{ - return self._private / 60.0f; -} - -static inline time_luos_t TimeOD_TimeFrom_min(double min) -{ - time_luos_t self; - self._private = min * 60.0f; - return self; -} - -// hour -static inline double TimeOD_TimeTo_h(time_luos_t self) -{ - return self._private / 3600.0f; -} - -static inline time_luos_t TimeOD_TimeFrom_h(double hour) -{ - time_luos_t self; - self._private = hour * 3600.0f; - return self; -} - -// day -static inline double TimeOD_TimeTo_day(time_luos_t self) -{ - return self._private / 86400.0f; -} - -static inline time_luos_t TimeOD_TimeFrom_day(double day) -{ - time_luos_t self; - self._private = day * 86400.0f; - return self; -} //******** Messages management *********** static inline void TimeOD_TimeToMsg(const time_luos_t *const self, msg_t *const msg) diff --git a/engine/bootloader/bootloader_core.c b/engine/bootloader/bootloader_core.c index 609e3c95c..0a90dc5a7 100644 --- a/engine/bootloader/bootloader_core.c +++ b/engine/bootloader/bootloader_core.c @@ -366,7 +366,7 @@ void LuosBootloader_Loop(void) * @param input : Pointer to message received from luos network * @return None ******************************************************************************/ -void LuosBootloader_MsgHandler(msg_t *input) +void LuosBootloader_MsgHandler(const msg_t *input) { bootloader_cmd = input->data[0]; @@ -467,7 +467,11 @@ void LuosBootloader_MsgHandler(msg_t *input) } break; #endif + case BOOTLOADER_RESET: + LuosHAL_SetMode((uint8_t)BOOT_MODE); + LuosHAL_Reboot(); + break; default: break; } -} \ No newline at end of file +} diff --git a/engine/bootloader/bootloader_core.h b/engine/bootloader/bootloader_core.h index 2ee7bab12..2f2d7f949 100644 --- a/engine/bootloader/bootloader_core.h +++ b/engine/bootloader/bootloader_core.h @@ -64,9 +64,9 @@ void LuosBootloader_Loop(void); /****************************************************************************** * @brief function used by Luos to send message to the bootloader ******************************************************************************/ -void LuosBootloader_MsgHandler(msg_t *); +void LuosBootloader_MsgHandler(const msg_t *input); #ifndef BOOTLOADER void LuosBootloader_JumpToBootloader(void); #endif -#endif /* BOOTLOADER_H */ \ No newline at end of file +#endif /* BOOTLOADER_H */ diff --git a/engine/core/inc/_timestamp.h b/engine/core/inc/_timestamp.h index d07d87211..d87685fe3 100644 --- a/engine/core/inc/_timestamp.h +++ b/engine/core/inc/_timestamp.h @@ -14,7 +14,7 @@ ******************************************************************************/ void Timestamp_EncodeMsg(msg_t *msg, time_luos_t timestamp); -void Timestamp_ConvertToLatency(msg_t *msg); +time_luos_t Timestamp_ConvertToLatency(const msg_t *msg); void Timestamp_ConvertToDate(msg_t *msg, uint64_t reception_date); #endif /* __TIMESTAMP_H_ */ diff --git a/engine/core/inc/luos_engine.h b/engine/core/inc/luos_engine.h index 86246ebdf..0f3474d57 100644 --- a/engine/core/inc/luos_engine.h +++ b/engine/core/inc/luos_engine.h @@ -29,6 +29,7 @@ void Luos_Init(void); void Luos_Loop(void); void Luos_ResetStatistic(void); +const revision_t *Luos_GetVersion(void); // ***************** Node management ***************** uint32_t Luos_GetSystick(void); @@ -53,11 +54,11 @@ void Luos_Flush(void); #include "streaming.h" void Luos_SendStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream); void Luos_SendStreamingSize(service_t *service, msg_t *msg, streaming_channel_t *stream, uint32_t max_size); -error_return_t Luos_ReceiveStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream); +error_return_t Luos_ReceiveStreaming(service_t *service, const msg_t *msg, streaming_channel_t *stream); // *** Timestamping management (in file `timestamp.c`)*** time_luos_t Luos_Timestamp(void); -bool Luos_IsMsgTimstamped(msg_t *msg); +bool Luos_IsMsgTimstamped(const msg_t *msg); time_luos_t Luos_GetMsgTimestamp(msg_t *msg); error_return_t Luos_SendTimestampMsg(service_t *service, msg_t *msg, time_luos_t timestamp); @@ -67,15 +68,15 @@ error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic); // *** Big data management *** void Luos_SendData(service_t *service, msg_t *msg, void *bin_data, uint16_t size); -int Luos_ReceiveData(service_t *service, msg_t *msg, void *bin_data); +int Luos_ReceiveData(service_t *service, const msg_t *msg, void *bin_data); // *** Basic transmission management *** error_return_t Luos_SendMsg(service_t *service, msg_t *msg); error_return_t Luos_TxComplete(void); // *** Polling reception management *** -error_return_t Luos_ReadMsg(service_t *service, msg_t **returned_msg); -error_return_t Luos_ReadFromService(service_t *service, int16_t id, msg_t **returned_msg); +error_return_t Luos_ReadMsg(service_t *service, msg_t *msg_to_write); +error_return_t Luos_ReadFromService(service_t *service, uint16_t id, msg_t *msg_to_write); uint16_t Luos_NbrAvailableMsg(void); #endif /* LUOS_ENGINE_H */ diff --git a/engine/core/inc/luos_list.h b/engine/core/inc/luos_list.h index c2f8e20c7..70ecdfd89 100644 --- a/engine/core/inc/luos_list.h +++ b/engine/core/inc/luos_list.h @@ -34,7 +34,7 @@ typedef enum typedef enum { - // Common register for all services + // Generic cmd UNKNOWN_CMD = LUOS_LAST_RESERVED_CMD, // set or get some undefined data (change size of msg to set or get) GET_CMD = UNKNOWN_CMD, // retrocompatibility SET_CMD, // retrocompatibility @@ -53,6 +53,8 @@ typedef enum FORCE, // force_t (Newton N) MOMENT, // moment_t (Newton meter N.m) CONTROL, // control_mode (control_mode_t) + TEXT, // ASCII string + PRESSURE, // pressure_t (Pa) // Configuration commands REGISTER, // a register data [reg_add, data[]] @@ -93,10 +95,6 @@ typedef enum PARAMETERS, // depend on the service, can be : servo_parameters_t, imu_report_t, motor_mode_t ERROR_CMD, - // Retrocompatibility zone - TEXT, // ASCII string - PRESSURE, // pressure_t (Pa) - // compatibility area LUOS_LAST_STD_CMD = 128 } luos_cmd_t; diff --git a/engine/core/inc/profile_core.h b/engine/core/inc/profile_core.h index 03c5378b1..ad5d8d26c 100644 --- a/engine/core/inc/profile_core.h +++ b/engine/core/inc/profile_core.h @@ -17,7 +17,7 @@ typedef struct profile_ops { void (*Init)(void *); - void (*Handler)(service_t *, msg_t *); + void (*Handler)(service_t *, const msg_t *); SERVICE_CB Callback; } profile_ops_t; @@ -47,4 +47,4 @@ profile_core_t *ProfileCore_GetNew(bool); void ProfileCore_OverrideConnectHandler(void); service_t *ProfileCore_StartService(SERVICE_CB, const char *, revision_t); -#endif /* PROFILE_CORE_H_ */ \ No newline at end of file +#endif /* PROFILE_CORE_H_ */ diff --git a/engine/core/inc/routing_table.h b/engine/core/inc/routing_table.h index 055feeeb9..1b228b142 100644 --- a/engine/core/inc/routing_table.h +++ b/engine/core/inc/routing_table.h @@ -77,7 +77,7 @@ void RoutingTB_DetectServices(service_t *service); void RoutingTB_ConvertNodeToRoutingTable(routing_table_t *entry, node_t *node); void RoutingTB_ConvertServiceToRoutingTable(routing_table_t *entry, service_t *service); void RoutingTB_RemoveNode(uint16_t nodeid); -void RoutingTB_RemoveOnRoutingTable(uint16_t id); +void RoutingTB_RemoveService(uint16_t id); void RoutingTB_Erase(void); routing_table_t *RoutingTB_Get(void); uint16_t RoutingTB_GetLastService(void); diff --git a/engine/core/inc/service.h b/engine/core/inc/service.h index db19c5198..423a9aa1a 100644 --- a/engine/core/inc/service.h +++ b/engine/core/inc/service.h @@ -8,6 +8,22 @@ #define _SERVICE_H_ #include "struct_luos.h" +#include "luos_io.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ +#if (MAX_SERVICE_NUMBER <= 8) +typedef uint8_t service_filter_t; +#elif (MAX_SERVICE_NUMBER <= 16) +typedef uint16_t service_filter_t; +#elif (MAX_SERVICE_NUMBER <= 32) +typedef uint32_t service_filter_t; +#elif (MAX_SERVICE_NUMBER <= 64) +typedef uint64_t service_filter_t; +#else + #error "MAX_SERVICE_NUMBER is too high" +#endif /******************************************************************************* * Function @@ -19,10 +35,12 @@ void Service_ResetStatistics(void); void Service_GenerateId(uint16_t base_id); void Service_ClearId(void); uint16_t Service_GetIndex(service_t *service); +void Service_RmAutoUpdateTarget(uint16_t service_id); void Service_AutoUpdateManager(void); +error_return_t Service_Deliver(phy_job_t *job); // IO related functions -service_t *Service_GetConcerned(header_t *header); -void Service_AllocMsg(msg_t *msg); +service_t *Service_GetConcerned(const header_t *header); +service_filter_t Service_GetFilter(const msg_t *msg); #endif /* _SERVICE_H_ */ diff --git a/engine/core/inc/stats.h b/engine/core/inc/stats.h new file mode 100644 index 000000000..5017d2d39 --- /dev/null +++ b/engine/core/inc/stats.h @@ -0,0 +1,21 @@ +/****************************************************************************** + * @file pub_sub.h + * @brief multicast referencing description + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _STATS_H_ +#define _STATS_H_ + +#include "struct_stat.h" + +/******************************************************************************* + * Function + ******************************************************************************/ +void Stats_Init(void); + +general_stats_t *Stats_Get(void); +memory_stats_t *Stats_GetMemory(void); +luos_stats_t *Stats_GetLuos(void); + +#endif /* _PUB_SUB_H_ */ diff --git a/engine/core/inc/struct_engine.h b/engine/core/inc/struct_engine.h index 982239f0b..1982ec8b5 100644 --- a/engine/core/inc/struct_engine.h +++ b/engine/core/inc/struct_engine.h @@ -8,7 +8,6 @@ #define __ENGINE_STRUCT_H #include -#include "struct_io.h" /******************************************************************************* * Definitions diff --git a/engine/core/inc/struct_luos.h b/engine/core/inc/struct_luos.h index 2e5c315f5..696ac92ec 100644 --- a/engine/core/inc/struct_luos.h +++ b/engine/core/inc/struct_luos.h @@ -15,6 +15,13 @@ * Definitions ******************************************************************************/ +typedef enum +{ + // Protocol version + BASE_PROTOCOL = PROTOCOL_REVISION, + TIMESTAMP_PROTOCOL, +} protocol_t; + /****************************************************************************** * This enum list all CMD reserved to Luos * please refer to the documentation @@ -22,11 +29,16 @@ typedef enum { // Luos specific registers - LOCAL_RTB = ROBUS_PROTOCOL_NB, // Ask(size == 0), generate(size == 2) a local routing_table. - RTB, // Receive a routing_table. - WRITE_ALIAS, // Get and save a new given alias. - UPDATE_PUB, // Ask to update a sensor value each time duration to the sender - ASK_DETECTION, // Ask Luos to launch a detection + WRITE_NODE_ID, // Get and save a new given node ID. + START_DETECTION, // Start a detection + END_DETECTION, // Detect the end of a detection + LOCAL_RTB, // Ask(size == 0), generate(size == 2) a local routing_table. + RTB, // Receive a routing_table. + WRITE_ALIAS, // Get and save a new given alias. + UPDATE_PUB, // Ask to update a sensor value each time duration to the sender + ASK_DETECTION, // Ask Luos to launch a detection + DEADTARGET, // Send a dead target message + ASSERT, // Node Assert message (only broadcast with a source as a node) // Revision management REVISION, // service sends its firmware revision @@ -101,13 +113,32 @@ typedef struct __attribute__((__packed__)) * This structure is used to manage services timed auto update * please refer to the documentation ******************************************************************************/ -typedef struct __attribute__((__packed__)) timed_update_t +typedef struct timed_update_t { uint32_t last_update; uint16_t time_ms; uint16_t target; } timed_update_t; +/****************************************************************************** + * This structure is used to manage dead target message + * Service_id or node_id can be set to 0 to ignore it. + * Only 1 of those 2 can have a value indicating if the dead target is a service or a node. + * please refer to the documentation + ******************************************************************************/ +typedef struct __attribute__((__packed__)) dead_target_t +{ + union + { + struct __attribute__((__packed__)) + { + uint16_t service_id; + uint16_t node_id; + }; + uint8_t unmap[4]; + }; +} dead_target_t; + /****************************************************************************** * This structure is used to manage read or write access * please refer to the documentation @@ -151,10 +182,9 @@ typedef struct service_t uint8_t alias[MAX_ALIAS_SIZE]; /*!< service alias. */ revision_t revision; /*!< service firmware version. */ access_t access; /*!< service read write access. */ - uint16_t dead_service_spotted; /*!< The ID of a service that don't reply to a lot of ACK msg */ // Callback - void (*service_cb)(struct service_t *service, msg_t *msg); + void (*service_cb)(struct service_t *service, const msg_t *msg); // Statistics service_stats_t statistics; /*!< service level statistics. */ @@ -167,6 +197,6 @@ typedef struct service_t } service_t; -typedef void (*SERVICE_CB)(service_t *service, msg_t *msg); +typedef void (*SERVICE_CB)(service_t *service, const msg_t *msg); -#endif /*__LUOS_STRUCT_H */ \ No newline at end of file +#endif /*__LUOS_STRUCT_H */ diff --git a/engine/core/inc/time_luos.h b/engine/core/inc/time_luos.h new file mode 100644 index 000000000..6ff874915 --- /dev/null +++ b/engine/core/inc/time_luos.h @@ -0,0 +1,120 @@ +/****************************************************************************** + * @file OD_time + * @brief object dictionnary time + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef TIME_LUOS_H_ +#define TIME_LUOS_H_ + +#include +/******************************************************************************* + * Definitions + ******************************************************************************/ +typedef struct +{ + double _private; +} time_luos_t; + +/******************************************************************************* + * Variables + ******************************************************************************/ + +/******************************************************************************* + * Function + ******************************************************************************/ +// time values are stored in seconds (s) +//******** Conversions *********** + +// sec +static inline double TimeOD_TimeTo_s(time_luos_t self) +{ + return self._private; +} + +static inline time_luos_t TimeOD_TimeFrom_s(double sec) +{ + time_luos_t self; + self._private = sec; + return self; +} + +// ms +static inline double TimeOD_TimeTo_ms(time_luos_t self) +{ + return self._private * 1000.0f; +} + +static inline time_luos_t TimeOD_TimeFrom_ms(double ms) +{ + time_luos_t self; + self._private = ms / 1000.0f; + return self; +} + +// µs +static inline double TimeOD_TimeTo_us(time_luos_t self) +{ + return self._private * 1000000.0f; +} + +static inline time_luos_t TimeOD_TimeFrom_us(double us) +{ + time_luos_t self; + self._private = us / 1000000.0f; + return self; +} + +// ns +static inline double TimeOD_TimeTo_ns(time_luos_t self) +{ + return self._private * 1000000000.0f; +} + +static inline time_luos_t TimeOD_TimeFrom_ns(double ns) +{ + time_luos_t self; + self._private = ns / 1000000000.0f; + return self; +} + +// min +static inline double TimeOD_TimeTo_min(time_luos_t self) +{ + return self._private / 60.0f; +} + +static inline time_luos_t TimeOD_TimeFrom_min(double min) +{ + time_luos_t self; + self._private = min * 60.0f; + return self; +} + +// hour +static inline double TimeOD_TimeTo_h(time_luos_t self) +{ + return self._private / 3600.0f; +} + +static inline time_luos_t TimeOD_TimeFrom_h(double hour) +{ + time_luos_t self; + self._private = hour * 3600.0f; + return self; +} + +// day +static inline double TimeOD_TimeTo_day(time_luos_t self) +{ + return self._private / 86400.0f; +} + +static inline time_luos_t TimeOD_TimeFrom_day(double day) +{ + time_luos_t self; + self._private = day * 86400.0f; + return self; +} + +#endif /* TIME_LUOS_H_ */ diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index b88bd5690..4bc35f325 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -4,11 +4,8 @@ * @author Luos * @version 0.0.0 ******************************************************************************/ -#include "luos_engine.h" #include -#include -#include "msg_alloc.h" -#include "robus.h" +#include "luos_engine.h" #include "luos_hal.h" #include "bootloader_core.h" #include "_timestamp.h" @@ -16,25 +13,18 @@ #include "service.h" #include "struct_engine.h" #include "luos_io.h" +#include "stats.h" /******************************************************************************* * Variables ******************************************************************************/ -revision_t luos_version = {.major = 3, .minor = 0, .build = 0}; +const revision_t luos_version = {.major = 3, .minor = 0, .build = 0}; package_t package_table[MAX_SERVICE_NUMBER]; uint16_t package_number = 0; -service_t *detection_service; -uint8_t Flag_DetectServices = 0; - -luos_stats_t luos_stats; -general_stats_t general_stats; /******************************************************************************* * Function ******************************************************************************/ -static error_return_t Luos_MsgHandler(service_t *service, msg_t *input); -static void Luos_TransmitLocalRoutingTable(service_t *service, msg_t *routeTB_msg); -static error_return_t Luos_IsALuosCmd(service_t *service, uint8_t cmd, uint16_t size); static error_return_t Luos_Send(service_t *service, msg_t *msg); static inline void Luos_PackageInit(void); static inline void Luos_PackageLoop(void); @@ -48,9 +38,8 @@ void Luos_Init(void) { Service_Init(); Node_Init(); - memset(&luos_stats.unmap[0], 0, sizeof(luos_stats_t)); LuosHAL_Init(); - LuosIO_Init(&luos_stats.memory); + LuosIO_Init(); #ifdef WITH_BOOTLOADER if (APP_START_ADDRESS == (uint32_t)FLASH_BASE) @@ -70,9 +59,8 @@ void Luos_Init(void) void Luos_Loop(void) { static uint32_t last_loop_date; - uint16_t remaining_msg_number = 0; - service_t *oldest_service = NULL; - msg_t *returned_msg = NULL; + uint16_t remaining_job_number = 0; + phy_job_t *job; #ifdef WITH_BOOTLOADER // After 3 Luos_Loop, consider this application as safe and write a flag to let the booloader know it can jump to the application safely. @@ -87,99 +75,41 @@ void Luos_Loop(void) } #endif - // check loop call time stat - if ((LuosHAL_GetSystick() - last_loop_date) > luos_stats.max_loop_time_ms) - { - luos_stats.max_loop_time_ms = LuosHAL_GetSystick() - last_loop_date; - } - if (MsgAlloc_IsReseted() == SUCCEED) + // Check loop call time stat + // Get node stats + luos_stats_t *luos_stats = Stats_GetLuos(); + if ((LuosHAL_GetSystick() - last_loop_date) > luos_stats->max_loop_time_ms) { - // We receive a reset detection - // Reset services ID - Service_ClearId(); - // Reset the data reception context - Luos_ReceiveData(NULL, NULL, NULL); + luos_stats->max_loop_time_ms = LuosHAL_GetSystick() - last_loop_date; } Node_Loop(); LuosIO_Loop(); - // look at all received messages + // Look at all received jobs LUOS_MUTEX_LOCK - while (MsgAlloc_LookAtLuosTask(remaining_msg_number, &oldest_service) != FAILED) + while (LuosIO_TryToGetJob(remaining_job_number, &job) != FAILED) { - // There is a message available, check if this is a Luos Command - uint8_t cmd = 0; - uint16_t size = 0; - // There is a possibility to receive in IT a START_DETECTION so check task before doing any treatement - if ((MsgAlloc_GetLuosTaskCmd(remaining_msg_number, &cmd) != SUCCEED) || (MsgAlloc_GetLuosTaskSize(remaining_msg_number, &size) != SUCCEED)) + // We got a job + // Try to deliver it to the services + if (Service_Deliver(job) == FAILED) { - break; - } - // check if this msg cmd should be consumed by Luos_MsgHandler - if (Luos_IsALuosCmd(oldest_service, cmd, size) == SUCCEED) - { - if (MsgAlloc_PullMsgFromLuosTask(remaining_msg_number, &returned_msg) == SUCCEED) - { - // Be sure the content of this message need to be managed by Luos and do it if it is. - if (Luos_MsgHandler((service_t *)oldest_service, returned_msg) == SUCCEED) - { - // Luos CMD are generic for all services and have to be executed only once - // Clear all luos tasks related to this message (in case of multicast message) - MsgAlloc_ClearMsgFromLuosTasks(returned_msg); - } - else - { - // Here we should not have polling services. - LUOS_ASSERT(oldest_service->service_cb != 0); - // This message is for the user, pass it to the user. - oldest_service->service_cb(oldest_service, returned_msg); - } - } + // Some services wasn't able to get this job, they are in polling mode keep it for later. +#ifndef BOOTLOADER + remaining_job_number++; +#endif } else { - // This message is for a service - // check if this service have a callback? - if (oldest_service->service_cb != 0) - { - // This service have a callback pull the message - if (MsgAlloc_PullMsgFromLuosTask(remaining_msg_number, &returned_msg) == SUCCEED) - { - // This message is for the user, pass it to the user. - oldest_service->service_cb(oldest_service, returned_msg); - } - } - else - { -#ifdef BOOTLOADER - if (MsgAlloc_PullMsgFromLuosTask(remaining_msg_number, &returned_msg) == SUCCEED) - { - LuosBootloader_MsgHandler(returned_msg); - } -#else - remaining_msg_number++; -#endif - } + // Services consume this job. remove it + LuosIO_RmJob(job); } } LUOS_MUTEX_UNLOCK - // finish msg used - MsgAlloc_UsedMsgEnd(); // manage timed auto update Service_AutoUpdateManager(); // save loop date last_loop_date = LuosHAL_GetSystick(); - - if (Flag_DetectServices == 1) - { - - Flag_DetectServices = 0; - // Set the detection launcher id to 1 - detection_service->id = 1; - // Generate the filters - Service_GenerateId(1); - RoutingTB_DetectServices(detection_service); - } } + /****************************************************************************** * @brief Luos clear statistic * @param None @@ -187,215 +117,19 @@ void Luos_Loop(void) ******************************************************************************/ void Luos_ResetStatistic(void) { - memset(&luos_stats.unmap[0], 0, sizeof(luos_stats_t)); + luos_stats_t *luos_stats = Stats_GetLuos(); + memset(&luos_stats->unmap[0], 0, sizeof(luos_stats_t)); void Service_ResetStatistics(void); } -/****************************************************************************** - * @brief Check if this command concern luos - * @param service : Pointer to the service - * @param cmd : The command value - * @param size : The size of the received message - * @return SUCCEED : If the command if for Luos, else FAILED - ******************************************************************************/ -static error_return_t Luos_IsALuosCmd(service_t *service, uint8_t cmd, uint16_t size) -{ - switch (cmd) - { - case WRITE_NODE_ID: - case START_DETECTION: - // ERROR - LUOS_ASSERT(0); - break; - case ASSERT: - if (service->service_cb != 0) - { - return SUCCEED; - } - else - { - return FAILED; - } - break; - case LOCAL_RTB: - case RTB: - case WRITE_ALIAS: - case UPDATE_PUB: - case ASK_DETECTION: - return SUCCEED; - break; - - case REVISION: - case LUOS_REVISION: - case LUOS_STATISTICS: - if (size == 0) - { - return SUCCEED; - } - break; - case BOOTLOADER_CMD: - return SUCCEED; - break; - default: - return FAILED; - break; - } - return FAILED; -} -/****************************************************************************** - * @brief Handling message for Luos library - * @param service - * @param input : Message received - * @return SUCCEED : If the messaged is consumed, else FAILED - ******************************************************************************/ -static error_return_t Luos_MsgHandler(service_t *service, msg_t *input) -{ - error_return_t consume = FAILED; - msg_t output_msg; - routing_table_t *route_tab = &RoutingTB_Get()[RoutingTB_GetLastEntry()]; - time_luos_t time; - uint16_t base_id = 0; - - if (((input->header.target_mode == SERVICEIDACK) || (input->header.target_mode == SERVICEID)) && (input->header.target != service->id)) - { - return FAILED; - } - - switch (input->header.cmd) - { - case ASSERT: - // a service assert remove all services of the asserted node in routing table - RoutingTB_RemoveNode(input->header.source); - // This assert information could be usefull for services, do not remove it. - consume = FAILED; - break; - case LOCAL_RTB: - // Depending on the size of this message we have to make different operations - // If size is 0 someone ask to get local_route table back - // If size is 2 someone ask us to generate a local route table based on the given service ID then send local route table back. - switch (input->header.size) - { - case 2: - // generate local ID - RoutingTB_Erase(); - memcpy(&base_id, &input->data[0], sizeof(uint16_t)); - Service_GenerateId(base_id); - case 0: - // send back a local routing table - output_msg.header.cmd = RTB; - output_msg.header.target_mode = SERVICEIDACK; - output_msg.header.target = input->header.source; - Luos_TransmitLocalRoutingTable(service, &output_msg); - break; - } - consume = SUCCEED; - break; - case RTB: - // Check routing table overflow - LUOS_ASSERT(((uintptr_t)route_tab + input->header.size) <= ((uintptr_t)RoutingTB_Get() + (sizeof(routing_table_t) * MAX_RTB_ENTRY))); - if (Luos_ReceiveData(service, input, (void *)route_tab) > 0) - { - // route table section reception complete - RoutingTB_ComputeRoutingTableEntryNB(); - Luos_ResetStatistic(); - } - consume = SUCCEED; - break; - case REVISION: - if (input->header.size == 0) - { - msg_t output; - output.header.cmd = REVISION; - output.header.target_mode = SERVICEID; - memcpy(output.data, service->revision.unmap, sizeof(revision_t)); - output.header.size = sizeof(revision_t); - output.header.target = input->header.source; - Luos_SendMsg(service, &output); - consume = SUCCEED; - } - break; - case LUOS_REVISION: - if (input->header.size == 0) - { - msg_t output; - output.header.cmd = LUOS_REVISION; - output.header.target_mode = SERVICEID; - memcpy(output.data, &luos_version.unmap, sizeof(revision_t)); - output.header.size = sizeof(revision_t); - output.header.target = input->header.source; - Luos_SendMsg(service, &output); - consume = SUCCEED; - } - break; - case ASK_DETECTION: - if (input->header.size == 0) - { - if (Node_GetState() < LOCAL_DETECTION) - { - Flag_DetectServices = 1; - } - } - consume = SUCCEED; - break; - case LUOS_STATISTICS: - if (input->header.size == 0) - { - msg_t output; - output.header.cmd = LUOS_STATISTICS; - output.header.target_mode = SERVICEID; - output.header.size = sizeof(general_stats_t); - output.header.target = input->header.source; - memcpy(&general_stats.node_stat, &luos_stats.unmap, sizeof(luos_stats_t)); - memcpy(&general_stats.service_stat, service->statistics.unmap, sizeof(service_stats_t)); - memcpy(output.data, &general_stats.unmap, sizeof(general_stats_t)); - Luos_SendMsg(service, &output); - consume = SUCCEED; - } - break; - case WRITE_ALIAS: - // Save this alias into the service - Luos_UpdateAlias(service, (const char *)input->data, input->header.size); - // Send this message to user - consume = FAILED; - break; - case UPDATE_PUB: - // this service need to be auto updated - TimeOD_TimeFromMsg(&time, input); - service->auto_refresh.target = input->header.source; - service->auto_refresh.time_ms = (uint16_t)TimeOD_TimeTo_ms(time); - service->auto_refresh.last_update = LuosHAL_GetSystick(); - consume = SUCCEED; - break; - case BOOTLOADER_CMD: - // send data to the bootloader - LuosBootloader_MsgHandler(input); - consume = SUCCEED; - break; - default: - break; - } - return consume; -} /****************************************************************************** - * @brief Transmit local RTB to network - * @param service - * @param routeTB_msg : Loca RTB message to transmit - * @return none + * @brief return the Luos version + * @param None + * @return Luos version ******************************************************************************/ -static void Luos_TransmitLocalRoutingTable(service_t *service, msg_t *routeTB_msg) +const revision_t *Luos_GetVersion(void) { - uint16_t entry_nb = 0; - routing_table_t local_routing_table[Service_GetNumber() + 1]; - - // start by saving node entry - RoutingTB_ConvertNodeToRoutingTable(&local_routing_table[entry_nb], Node_Get()); - entry_nb++; - // save services entry - for (uint16_t i = 0; i < Service_GetNumber(); i++) - { - RoutingTB_ConvertServiceToRoutingTable((routing_table_t *)&local_routing_table[entry_nb++], &Service_GetTable()[i]); - } - Luos_SendData(service, routeTB_msg, (void *)local_routing_table, (entry_nb * sizeof(routing_table_t))); + return &luos_version; } /****************************************************************************** @@ -455,7 +189,7 @@ static error_return_t Luos_Send(service_t *service, msg_t *msg) { msg->header.source = Node_Get()->node_id; } - if (Robus_SetTxTask(service, msg) == FAILED) + if (LuosIO_Send(service, msg) == FAILED) { return FAILED; } @@ -465,27 +199,38 @@ static error_return_t Luos_Send(service_t *service, msg_t *msg) /****************************************************************************** * @brief Read last message from buffer for a specifig service * @param service : Who receives the message we are looking for - * @param returned_msg : Oldest message of the service + * @param msg_to_write : Message to write * @return SUCCEED : If the message is passed to the user, else FAILED ******************************************************************************/ -error_return_t Luos_ReadMsg(service_t *service, msg_t **returned_msg) +error_return_t Luos_ReadMsg(service_t *service, msg_t *msg_to_write) { - error_return_t error = SUCCEED; + uint8_t service_index = Service_GetIndex(service); + int remaining_job_number = 0; + phy_job_t *job; LUOS_MUTEX_LOCK - while (error == SUCCEED) + while (LuosIO_TryToGetJob(remaining_job_number, &job) != FAILED) { - error = MsgAlloc_PullMsg(service, returned_msg); - // check if the content of this message need to be managed by Luos and do it if it is. - if (error == SUCCEED) + // We got a job + // Check if our service is concerned by this job + if (((*(uint8_t *)job->phy_data) >> service_index) & 0x01) { - if (Luos_MsgHandler(service, *returned_msg) == FAILED) + // This job is for our service, copy the job message to the user message + if (Luos_IsMsgTimstamped(job->msg_pt) == true) { - LUOS_MUTEX_UNLOCK - // This message is for the user, pass it to the user. - return SUCCEED; + memcpy(msg_to_write, job->msg_pt, sizeof(header_t) + job->msg_pt->header.size + sizeof(time_luos_t)); } + else + { + memcpy(msg_to_write, job->msg_pt, sizeof(header_t) + job->msg_pt->header.size); + } + // Remove this service from the job filter + *(uint8_t *)job->phy_data &= ~(1 << service_index); + // Services consume this job. try to remove it + LuosIO_RmJob(job); + LUOS_MUTEX_UNLOCK + return SUCCEED; } - MsgAlloc_ClearMsgFromLuosTasks(*returned_msg); + remaining_job_number++; } LUOS_MUTEX_UNLOCK return FAILED; @@ -494,49 +239,38 @@ error_return_t Luos_ReadMsg(service_t *service, msg_t **returned_msg) * @brief Read last msg from buffer from a specific id service * @param service : Who receive the message we are looking for * @param id : Who sent the message we are looking for - * @param returned_msg : Oldest message of the service + * @param msg_to_write : Message to write * @return FAILED if no message available ******************************************************************************/ -error_return_t Luos_ReadFromService(service_t *service, short id, msg_t **returned_msg) +error_return_t Luos_ReadFromService(service_t *service, uint16_t id, msg_t *msg_to_write) { - uint16_t remaining_msg_number = 0; - service_t *oldest_service = NULL; - error_return_t error = SUCCEED; + uint16_t remaining_job_number = 0; + phy_job_t *job; + uint8_t service_index = Service_GetIndex(service); LUOS_MUTEX_LOCK - while (MsgAlloc_LookAtLuosTask(remaining_msg_number, &oldest_service) != FAILED) + while (LuosIO_TryToGetJob(remaining_job_number, &job) != FAILED) { - // Check if this message is for us - if (oldest_service == service) + // We got a job + // Check if our service is concerned by this job + if ((*(service_filter_t *)job->phy_data >> service_index & 0x01) && (job->msg_pt->header.source == id)) { - // Check the source id - uint16_t source = 0; -#ifdef LUOS_ASSERTION - LUOS_ASSERT(MsgAlloc_GetLuosTaskSourceId(remaining_msg_number, &source) == SUCCEED); -#else - MsgAlloc_GetLuosTaskSourceId(remaining_msg_number, &source); -#endif - if (source == id) + // This job is for our service, copy the job message to the user message + if (Luos_IsMsgTimstamped(job->msg_pt) == true) { - // Source id of this message match, get it and treat it. - error = MsgAlloc_PullMsgFromLuosTask(remaining_msg_number, returned_msg); - // check if the content of this message need to be managed by Luos and do it if it is. - if ((Luos_MsgHandler(service, *returned_msg) == FAILED) & (error == SUCCEED)) - { - // This message is for the user, pass it to the user. - LUOS_MUTEX_UNLOCK - return SUCCEED; - } - MsgAlloc_ClearMsgFromLuosTasks(*returned_msg); + memcpy(msg_to_write, job->msg_pt, sizeof(header_t) + job->msg_pt->header.size + sizeof(time_luos_t)); } else { - remaining_msg_number++; + memcpy(msg_to_write, job->msg_pt, sizeof(header_t) + job->msg_pt->header.size); } + // Remove this service from the job filter + *(service_filter_t *)job->phy_data &= ~(1 << service_index); + // Services consume this job. try to remove it + LuosIO_RmJob(job); + LUOS_MUTEX_UNLOCK + return SUCCEED; } - else - { - remaining_msg_number++; - } + remaining_job_number++; } LUOS_MUTEX_UNLOCK return FAILED; @@ -598,7 +332,7 @@ void Luos_SendData(service_t *service, msg_t *msg, void *bin_data, uint16_t size * @param bin_data : Pointer to data * @return Valid data received (negative values are errors) ******************************************************************************/ -int Luos_ReceiveData(service_t *service, msg_t *msg, void *bin_data) +int Luos_ReceiveData(service_t *service, const msg_t *msg, void *bin_data) { // Manage buffer session (one per service) static uint32_t data_size[MAX_SERVICE_NUMBER] = {0}; @@ -613,16 +347,9 @@ int Luos_ReceiveData(service_t *service, msg_t *msg, void *bin_data) last_msg_size = 0; return -1; } - - LUOS_ASSERT(msg != 0); - LUOS_ASSERT(bin_data != 0); + LUOS_ASSERT((msg != 0) && (bin_data != 0)); uint16_t id = Service_GetIndex(service); - // check good service index - if (id == 0xFFFF) - { - return -1; - } // store total size of a msg if (total_data_size[id] == 0) @@ -682,7 +409,7 @@ int Luos_ReceiveData(service_t *service, msg_t *msg, void *bin_data) ******************************************************************************/ uint16_t Luos_NbrAvailableMsg(void) { - return MsgAlloc_LuosTasksNbr(); + return LuosIO_GetJobNb(); } /****************************************************************************** * @brief Check if all Tx message are complete @@ -691,7 +418,7 @@ uint16_t Luos_NbrAvailableMsg(void) ******************************************************************************/ error_return_t Luos_TxComplete(void) { - return MsgAlloc_TxAllComplete(); + return LuosIO_TxAllComplete(); } /****************************************************************************** * @brief Register a new package @@ -787,7 +514,7 @@ void Luos_Detect(service_t *service) if (Node_GetState() < LOCAL_DETECTION) { - if (Node_GetState() == NO_DETECTION) + if (service->id == 0) { // We don't have any ID yet, let's create one at least for the detector // Reset filters @@ -799,7 +526,6 @@ void Luos_Detect(service_t *service) } // Send ask detection message - detection_service = service; detect_msg.header.target_mode = SERVICEIDACK; detect_msg.header.cmd = ASK_DETECTION; detect_msg.header.size = 0; diff --git a/engine/core/src/luos_utils.c b/engine/core/src/luos_utils.c index 74191c68b..5496fdcb2 100644 --- a/engine/core/src/luos_utils.c +++ b/engine/core/src/luos_utils.c @@ -4,13 +4,14 @@ * @author Luos * @version 0.0.0 ******************************************************************************/ +#include #include "luos_utils.h" #include "luos_engine.h" #include "port_manager.h" #include "string.h" #include "luos_hal.h" #include "msg_alloc.h" -#include +#include "filter.h" #ifdef WITH_BOOTLOADER #include "bootloader_core.h" #endif @@ -45,6 +46,7 @@ _CRITICAL void Luos_assert(char *file, uint32_t line) PortMng_Init(); // completely reinit the allocator MsgAlloc_Init(NULL); + Filter_IdInit(); // Mask filter for service ID msg_t msg; msg.header.target_mode = BROADCAST; msg.header.target = BROADCAST_VAL; @@ -56,7 +58,7 @@ _CRITICAL void Luos_assert(char *file, uint32_t line) ; node_assert(file, line); // wait for the transmission to finish before killing IRQ - while (MsgAlloc_TxAllComplete() == FAILED) + while (Luos_TxComplete() == FAILED) ; #ifdef WITH_BOOTLOADER // We're in a failed app, diff --git a/engine/core/src/profile_core.c b/engine/core/src/profile_core.c index 9e6a21ea5..4adbd4d51 100644 --- a/engine/core/src/profile_core.c +++ b/engine/core/src/profile_core.c @@ -76,7 +76,7 @@ void ProfileCore_OverrideConnectHandler(void) * @param msg : Messaged received * @return None ******************************************************************************/ -static void ProfileCore_Handler(service_t *service, msg_t *msg) +static void ProfileCore_Handler(service_t *service, const msg_t *msg) { profile_core_t *head_profile = ProfileCore_GetFromService(service); diff --git a/engine/core/src/pub_sub.c b/engine/core/src/pub_sub.c index 60d134df4..92aab9eb1 100644 --- a/engine/core/src/pub_sub.c +++ b/engine/core/src/pub_sub.c @@ -4,10 +4,10 @@ * @author Luos * @version 0.0.0 ******************************************************************************/ -#include "pub_sub.h" -#include "luos_engine.h" #include #include +#include "pub_sub.h" +#include "luos_utils.h" #include "filter.h" #include "service.h" /******************************************************************************* @@ -106,4 +106,4 @@ error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic) Filter_RmTopic(topic); } return err; -} \ No newline at end of file +} diff --git a/engine/core/src/routing_table.c b/engine/core/src/routing_table.c index 228f9c1c8..d500f4f72 100644 --- a/engine/core/src/routing_table.c +++ b/engine/core/src/routing_table.c @@ -4,16 +4,16 @@ * @author Luos * @version 0.0.0 ******************************************************************************/ -#include - #include #include #include #include +#include "routing_table.h" #include "luos_hal.h" #include "luos_engine.h" #include "struct_engine.h" #include "luos_io.h" +#include "service.h" /******************************************************************************* * Definitions @@ -428,7 +428,7 @@ void RoutingTB_RemoveNode(uint16_t nodeid) // We find our node remove all services while (routing_table[i].mode == SERVICE) { - RoutingTB_RemoveOnRoutingTable(routing_table[i].id); + RoutingTB_RemoveService(routing_table[i].id); } return; } @@ -440,12 +440,13 @@ void RoutingTB_RemoveNode(uint16_t nodeid) * @param id : Id of service * @return None ******************************************************************************/ -void RoutingTB_RemoveOnRoutingTable(uint16_t id) +void RoutingTB_RemoveService(uint16_t serviceid) { - // find the service + Service_RmAutoUpdateTarget(serviceid); + // Find the service for (uint16_t i = 0; i < last_routing_table_entry; i++) { - if ((routing_table[i].mode == SERVICE) && (routing_table[i].id == id)) + if ((routing_table[i].mode == SERVICE) && (routing_table[i].id == serviceid)) { LUOS_ASSERT(i < last_routing_table_entry); memcpy(&routing_table[i], &routing_table[i + 1], sizeof(routing_table_t) * (last_routing_table_entry - (i + 1))); diff --git a/engine/core/src/service.c b/engine/core/src/service.c index 4ca6a4084..04e5c695e 100644 --- a/engine/core/src/service.c +++ b/engine/core/src/service.c @@ -7,13 +7,11 @@ #include #include "service.h" #include "filter.h" -#include "luos_list.h" #include "node.h" #include "luos_utils.h" #include "luos_hal.h" -#include "msg_alloc.h" #include "pub_sub.h" -#include "robus.h" +#include "luos_engine.h" /******************************************************************************* * Definitions @@ -119,17 +117,28 @@ void Service_ClearId(void) * @return Service id the service list ******************************************************************************/ uint16_t Service_GetIndex(service_t *service) +{ + LUOS_ASSERT((service >= service_ctx.list) && (service < &service_ctx.list[service_ctx.number])); + return (service - service_ctx.list) / sizeof(service_t); +} + +/****************************************************************************** + * @brief Remove all services auto update targetting this service_id + * @param service_id + * @return None + ******************************************************************************/ +void Service_RmAutoUpdateTarget(uint16_t service_id) { for (uint16_t i = 0; i < service_ctx.number; i++) { - if (service == &service_ctx.list[i]) + if (service_ctx.list[i].auto_refresh.target == service_id) { - return i; + service_ctx.list[i].auto_refresh.target = 0; + service_ctx.list[i].auto_refresh.time_ms = 0; + service_ctx.list[i].auto_refresh.last_update = 0; } } - return 0xFFFF; } - /****************************************************************************** * @brief Auto update call for services * @param none @@ -153,13 +162,6 @@ void Service_AutoUpdateManager(void) // check if there is a timed update setted and if it's time to update it. if (service_ctx.list[i].auto_refresh.time_ms) { - if (service_ctx.list[i].dead_service_spotted == service_ctx.list[i].auto_refresh.target) - { - service_ctx.list[i].auto_refresh.target = 0; - service_ctx.list[i].auto_refresh.time_ms = 0; - service_ctx.list[i].auto_refresh.last_update = 0; - continue; - } if ((LuosHAL_GetSystick() - service_ctx.list[i].auto_refresh.last_update) >= service_ctx.list[i].auto_refresh.time_ms) { // This service need to send an update @@ -179,8 +181,7 @@ void Service_AutoUpdateManager(void) { if (Node_GetState() == DETECTION_OK) { - // Directly transmit the message in Localhost - Robus_SetTxTask(&service_ctx.list[i], &updt_msg); + Luos_SendMsg(&service_ctx.list[i], &updt_msg); } } service_ctx.list[i].auto_refresh.last_update = LuosHAL_GetSystick(); @@ -195,7 +196,7 @@ void Service_AutoUpdateManager(void) * @param header of message * @return service pointer ******************************************************************************/ -service_t *Service_GetConcerned(header_t *header) +service_t *Service_GetConcerned(const header_t *header) { uint16_t i = 0; LUOS_ASSERT(header); @@ -237,13 +238,51 @@ service_t *Service_GetConcerned(header_t *header) } /****************************************************************************** - * @brief Parse msg to find all services concerned and allocate them + * @brief Parse all services targeted by this job and call their callback + * @param job pointer + * @return FAILED if some services are not reachable + ******************************************************************************/ +error_return_t Service_Deliver(phy_job_t *job) +{ + // The job we are receiving is comming from Luos. + // This means that this job already contain a service filter. + // We just have to loop in the service list, filter it, call the callback and remove it from the service filter. + error_return_t error = SUCCEED; + LUOS_ASSERT(job); + service_filter_t *service_filter = (service_filter_t *)job->phy_data; + for (int i = 0; i < service_ctx.number; i++) + { + if (((*service_filter) >> i) & 0x01) + { + // This service is concerned by this job. + // Check if he have a callback. + if (service_ctx.list[i].service_cb != 0) + { + // Call the callback. + service_ctx.list[i].service_cb(&service_ctx.list[i], job->msg_pt); + // Remove this service from the filter. + *service_filter &= ~(0x01 << i); + } + else + { + // This service have no callback. Send the message to the service. + // We will have to keep this job for later, we will have to return failed in the end. + error = FAILED; + } + } + } + return error; +} + +/****************************************************************************** + * @brief Parse msg to find all services concerned and generate a filter of concerned services * @param msg pointer * @return None ******************************************************************************/ -void Service_AllocMsg(msg_t *msg) +service_filter_t Service_GetFilter(const msg_t *msg) { - uint16_t i = 0; + uint16_t i = 0; + service_filter_t filter = 0; // Find if we are concerned by this message. switch (msg->header.target_mode) @@ -255,11 +294,10 @@ void Service_AllocMsg(msg_t *msg) { if (msg->header.target == service_ctx.list[i].id) { - MsgAlloc_LuosTaskAlloc(&service_ctx.list[i], msg); + filter |= (1 << i); break; } } - return; break; case TYPE: // Check all service type @@ -267,49 +305,42 @@ void Service_AllocMsg(msg_t *msg) { if (msg->header.target == service_ctx.list[i].type) { - MsgAlloc_LuosTaskAlloc(&service_ctx.list[i], msg); + filter |= (1 << i); } } - return; break; case BROADCAST: for (i = 0; i < service_ctx.number; i++) { - MsgAlloc_LuosTaskAlloc(&service_ctx.list[i], msg); + filter |= (1 << i); } - return; break; case TOPIC: for (i = 0; i < service_ctx.number; i++) { if (PubSub_IsTopicSubscribed(&service_ctx.list[i], msg->header.target)) { - // TODO manage multiple slave concerned - MsgAlloc_LuosTaskAlloc(&service_ctx.list[i], msg); + filter |= (1 << i); } } - return; break; case NODEIDACK: case NODEID: - if (msg->header.target == DEFAULTID) // on default ID it's always a luos command create only one task - { - MsgAlloc_LuosTaskAlloc(&service_ctx.list[0], msg); - return; - } - // check if the message is really for the node or it is a service that has no filter + LUOS_ASSERT(msg->header.target != DEFAULTID); + // check if the message is for the node if (msg->header.target == Node_Get()->node_id) { + // Give it to all services for (i = 0; i < service_ctx.number; i++) { - MsgAlloc_LuosTaskAlloc(&service_ctx.list[i], msg); + filter |= (1 << i); } } - return; break; default: break; } + return filter; } /****************************************************************************** @@ -329,8 +360,6 @@ service_t *Luos_CreateService(SERVICE_CB service_cb, uint8_t type, const char *a service->type = type; // Initialise the service id, TODO the ID could be stored in EEprom, the default ID could be set in factory... service->id = DEFAULTID; - // Initialize dead service detection - service->dead_service_spotted = 0; // Clear stats service->statistics.max_retry = 0; // Clear topic number @@ -421,6 +450,7 @@ error_return_t Luos_UpdateAlias(service_t *service, const char *alias, uint16_t memcpy(service->alias, clean_alias, MAX_ALIAS_SIZE); return SUCCEED; } + /****************************************************************************** * @brief Clear list of service * @param none @@ -432,4 +462,4 @@ void Luos_ServicesClear(void) // Clear service table memset((void *)service_ctx.list, 0, sizeof(service_t) * MAX_SERVICE_NUMBER); -} \ No newline at end of file +} diff --git a/engine/IO/inc/_luos_io.h b/engine/core/src/stats.c similarity index 61% rename from engine/IO/inc/_luos_io.h rename to engine/core/src/stats.c index b8ff046bb..bbf5545dd 100644 --- a/engine/IO/inc/_luos_io.h +++ b/engine/core/src/stats.c @@ -1,14 +1,11 @@ /****************************************************************************** - * @file luos_io.c - * @brief Interface file between Luos and a physical layer + * @file stats + * @brief manage statistics of Luos * @author Luos * @version 0.0.0 ******************************************************************************/ -#ifndef _PRIVATE_LUOSIO_H_ -#define _PRIVATE_LUOSIO_H_ - -#include "struct_luos.h" - +#include +#include "stats.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -16,11 +13,28 @@ /******************************************************************************* * Variables ******************************************************************************/ +general_stats_t general_stats; /******************************************************************************* - * Functions + * Function ******************************************************************************/ -error_return_t LuosIO_MsgHandler(msg_t *input); +void Stats_Init(void) +{ + memset(&general_stats, 0, sizeof(general_stats_t)); +} + +general_stats_t *Stats_Get(void) +{ + return &general_stats; +} + +memory_stats_t *Stats_GetMemory(void) +{ + return &general_stats.node_stat.memory; +} -#endif /* _PRIVATE_LUOSIO_H_ */ \ No newline at end of file +luos_stats_t *Stats_GetLuos(void) +{ + return &general_stats.node_stat; +} diff --git a/engine/core/src/streaming.c b/engine/core/src/streaming.c index ef7eeaa9d..36db3eaa6 100644 --- a/engine/core/src/streaming.c +++ b/engine/core/src/streaming.c @@ -87,7 +87,7 @@ uint16_t Streaming_PutSample(streaming_channel_t *stream, const void *data, uint * @param stream : Streaming channel pointer * @param data : A pointer of data * @param size : data size - * @return None + * @return Number of dample available in buffer ******************************************************************************/ uint16_t Streaming_GetSample(streaming_channel_t *stream, void *data, uint16_t size) { @@ -284,7 +284,7 @@ void Luos_SendStreamingSize(service_t *service, msg_t *msg, streaming_channel_t * @param stream : Streaming channel pointer * @return error ******************************************************************************/ -error_return_t Luos_ReceiveStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream) +error_return_t Luos_ReceiveStreaming(service_t *service, const msg_t *msg, streaming_channel_t *stream) { // Get chunk size unsigned short chunk_size = 0; @@ -303,4 +303,4 @@ error_return_t Luos_ReceiveStreaming(service_t *service, msg_t *msg, streaming_c return SUCCEED; } return FAILED; -} \ No newline at end of file +} diff --git a/engine/core/src/timestamp.c b/engine/core/src/timestamp.c index ee1f5d6be..c1fd55e71 100644 --- a/engine/core/src/timestamp.c +++ b/engine/core/src/timestamp.c @@ -4,9 +4,9 @@ * @author Luos * @version 0.0.0 ******************************************************************************/ +#include #include "_timestamp.h" #include "luos_hal.h" -#include "string.h" #include "struct_luos.h" /******************************* Description of Timestamp process ************************************ * @@ -67,7 +67,7 @@ time_luos_t Luos_Timestamp(void) * @param msg : Message to check * @return boolean it "True" if message is timestamped ******************************************************************************/ -_CRITICAL inline bool Luos_IsMsgTimstamped(msg_t *msg) +_CRITICAL inline bool Luos_IsMsgTimstamped(const msg_t *msg) { return (msg->header.config == TIMESTAMP_PROTOCOL); } @@ -107,22 +107,14 @@ void Timestamp_EncodeMsg(msg_t *msg, time_luos_t timestamp) * @param msg : Message that will be sent * @return None ******************************************************************************/ -_CRITICAL void Timestamp_ConvertToLatency(msg_t *msg) +_CRITICAL time_luos_t Timestamp_ConvertToLatency(const msg_t *msg) { - static time_luos_t timestamp_date = {0.0f}; - static msg_t *last_msg = NULL; - if (last_msg != msg) - { - // This is a new message, backup the timestamp date - memcpy(×tamp_date, &msg->data[msg->header.size], sizeof(time_luos_t)); - // Keep the message pointer to know if we already manage this one or not. - last_msg = msg; - } + time_luos_t timestamp_date; + memcpy(×tamp_date, &msg->data[msg->header.size], sizeof(time_luos_t)); // Compute the latency from date time_luos_t latency = TimeOD_TimeFrom_s(TimeOD_TimeTo_s(timestamp_date) - TimeOD_TimeTo_s(Luos_Timestamp())); - // Write latency on the message - memcpy(&msg->data[msg->header.size], &latency, sizeof(time_luos_t)); + return latency; } /****************************************************************************** diff --git a/engine/profiles/motor/profile_motor.c b/engine/profiles/motor/profile_motor.c index cbf08e4df..554336cb8 100644 --- a/engine/profiles/motor/profile_motor.c +++ b/engine/profiles/motor/profile_motor.c @@ -13,7 +13,7 @@ * @param msg : The received message * @return None ******************************************************************************/ -void ProfileMotor_Handler(service_t *service, msg_t *msg) +void ProfileMotor_Handler(service_t *service, const msg_t *msg) { profile_core_t *profile = ProfileCore_GetFromService(service); profile_motor_t *profile_motor = (profile_motor_t *)profile->profile_data; @@ -119,4 +119,4 @@ service_t *ProfileMotor_CreateService(profile_motor_t *profile_motor, SERVICE_CB // Start service with the linked profile return ProfileCore_StartService(callback, alias, revision); -} \ No newline at end of file +} diff --git a/engine/profiles/servo_motor/profile_servo_motor.c b/engine/profiles/servo_motor/profile_servo_motor.c index b2e800bf0..efa2bab5e 100644 --- a/engine/profiles/servo_motor/profile_servo_motor.c +++ b/engine/profiles/servo_motor/profile_servo_motor.c @@ -28,7 +28,7 @@ void ProfileServo_Init(void *handler) * @param msg : The received message * @return None ******************************************************************************/ -void ProfileServo_Handler(service_t *service, msg_t *msg) +void ProfileServo_Handler(service_t *service, const msg_t *msg) { // get profile informations from service profile_core_t *profile = ProfileCore_GetFromService(service); @@ -301,4 +301,4 @@ service_t *ProfileServo_CreateService(profile_servo_motor_t *profile_servo_motor // Start service with the linked profile return ProfileCore_StartService(callback, alias, revision); -} \ No newline at end of file +} diff --git a/engine/profiles/state/profile_state.c b/engine/profiles/state/profile_state.c index 70d963250..aa6f1e927 100644 --- a/engine/profiles/state/profile_state.c +++ b/engine/profiles/state/profile_state.c @@ -12,7 +12,7 @@ * @param msg : The received message * @return None ******************************************************************************/ -void ProfileState_Handler(service_t *service, msg_t *msg) +void ProfileState_Handler(service_t *service, const msg_t *msg) { profile_core_t *profile = ProfileCore_GetFromService(service); profile_state_t *profile_state = (profile_state_t *)profile->profile_data; @@ -82,4 +82,4 @@ service_t *ProfileState_CreateService(profile_state_t *profile_state, SERVICE_CB // Start profile return ProfileCore_StartService(callback, alias, revision); -} \ No newline at end of file +} diff --git a/engine/profiles/voltage/profile_voltage.c b/engine/profiles/voltage/profile_voltage.c index 2aef8aaf7..e78177693 100644 --- a/engine/profiles/voltage/profile_voltage.c +++ b/engine/profiles/voltage/profile_voltage.c @@ -12,7 +12,7 @@ * @param msg : The received message * @return None ******************************************************************************/ -void ProfileVoltage_Handler(service_t *service, msg_t *msg) +void ProfileVoltage_Handler(service_t *service, const msg_t *msg) { profile_core_t *profile = ProfileCore_GetFromService(service); profile_voltage_t *voltage_profile = (profile_voltage_t *)profile->profile_data; @@ -105,4 +105,4 @@ service_t *ProfileVoltage_CreateService(profile_voltage_t *profile_voltage, SERV // Start profile return ProfileCore_StartService(callback, alias, revision); -} \ No newline at end of file +} diff --git a/examples/apps/alarm_controller/alarm_controller.c b/examples/apps/alarm_controller/alarm_controller.c index 66a3ee03b..13ab83c9b 100644 --- a/examples/apps/alarm_controller/alarm_controller.c +++ b/examples/apps/alarm_controller/alarm_controller.c @@ -20,7 +20,7 @@ uint8_t end_detection = 0; /******************************************************************************* * Function ******************************************************************************/ -static void AlarmController_MsgHandler(service_t *service, msg_t *msg); +static void AlarmController_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -206,7 +206,7 @@ void AlarmController_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void AlarmController_MsgHandler(service_t *service, msg_t *msg) +static void AlarmController_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GYRO_3D) { diff --git a/examples/apps/biometric-security/biometric_security.c b/examples/apps/biometric-security/biometric_security.c index d14830467..63c762753 100644 --- a/examples/apps/biometric-security/biometric_security.c +++ b/examples/apps/biometric-security/biometric_security.c @@ -8,7 +8,7 @@ * @version 0.0.0 ******************************************************************************/ -//#include "product_config.h" //if your are using it into a project you need to uncomment this line +// #include "product_config.h" //if your are using it into a project you need to uncomment this line #include "biometric_security.h" /******************************************************************************* @@ -38,7 +38,7 @@ uint8_t fingerprint_busy = 0; /******************************************************************************* * Functions ******************************************************************************/ -void BiometricSecurity_MsgHandler(service_t *service, msg_t *msg); +void BiometricSecurity_MsgHandler(service_t *service, const msg_t *msg); uint8_t BiometricSecurity_SetServoPosition(void); uint8_t BiometricSecurity_CheckFingerprint(void); @@ -114,7 +114,7 @@ void BiometricSecurity_Loop(void) * @param msg * @return None ******************************************************************************/ -void BiometricSecurity_MsgHandler(service_t *service, msg_t *msg) +void BiometricSecurity_MsgHandler(service_t *service, const msg_t *msg) { search_result_t result; RTFilter_Type(RTFilter_Reset(&result), STATE_TYPE); diff --git a/examples/apps/start_controller/start_controller.c b/examples/apps/start_controller/start_controller.c index 0ff313568..f849233f5 100644 --- a/examples/apps/start_controller/start_controller.c +++ b/examples/apps/start_controller/start_controller.c @@ -32,7 +32,7 @@ uint8_t end_detection = 0; /******************************************************************************* * Function ******************************************************************************/ -static void StartController_MsgHandler(service_t *service, msg_t *msg); +static void StartController_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -242,7 +242,7 @@ void StartController_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void StartController_MsgHandler(service_t *service, msg_t *msg) +static void StartController_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == IO_STATE) { diff --git a/examples/projects/Arduino/bldc_simple_foc/lib/motor/motor.cpp b/examples/projects/Arduino/bldc_simple_foc/lib/motor/motor.cpp index 6591e809e..565b75bea 100644 --- a/examples/projects/Arduino/bldc_simple_foc/lib/motor/motor.cpp +++ b/examples/projects/Arduino/bldc_simple_foc/lib/motor/motor.cpp @@ -56,7 +56,7 @@ float velocity_tickstart = 0.0; /******************************************************************************* * Function ******************************************************************************/ -static void Motor_MsgHandler(service_t *service, msg_t *msg); +static void Motor_MsgHandler(service_t *service, const msg_t *msg); void Motor_TrajectoryCallback(void); float Motor_getVelocity(void); /****************************************************************************** @@ -228,7 +228,7 @@ void Motor_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Motor_MsgHandler(service_t *service, msg_t *msg) +static void Motor_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == PARAMETERS) { @@ -341,4 +341,4 @@ float Motor_getVelocity(void) } return vel; -} \ No newline at end of file +} diff --git a/examples/projects/Arduino/button/lib/button/button.c b/examples/projects/Arduino/button/lib/button/button.c index c465b37a8..942701102 100644 --- a/examples/projects/Arduino/button/lib/button/button.c +++ b/examples/projects/Arduino/button/lib/button/button.c @@ -18,7 +18,7 @@ /******************************************************************************* * Function ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg); +static void Button_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init * @param None @@ -44,7 +44,7 @@ void Button_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg) +static void Button_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint.c b/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint.c index c44298497..727eafc1b 100644 --- a/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint.c +++ b/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint.c @@ -33,7 +33,7 @@ static service_t *service_fingerprint; /******************************************************************************* * Functions ******************************************************************************/ -void Fingerprint_MsgHandler(service_t *service, msg_t *msg); +void Fingerprint_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -64,7 +64,7 @@ void Fingerprint_Loop(void) * @param msg * @return None ******************************************************************************/ -void Fingerprint_MsgHandler(service_t *service, msg_t *msg) +void Fingerprint_MsgHandler(service_t *service, const msg_t *msg) { msg_t pub_msg; pub_msg.header.target = msg->header.source; diff --git a/examples/projects/Arduino/lcd/lib/Lcd/lcd.c b/examples/projects/Arduino/lcd/lib/Lcd/lcd.c index 2d5330e47..2e58d9653 100644 --- a/examples/projects/Arduino/lcd/lib/Lcd/lcd.c +++ b/examples/projects/Arduino/lcd/lib/Lcd/lcd.c @@ -27,7 +27,7 @@ uint8_t i = 0; /******************************************************************************* * Functions ******************************************************************************/ -void Lcd_MsgHandler(service_t *service, msg_t *msg); +void Lcd_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief Service init must be call in project init @@ -75,7 +75,7 @@ void Lcd_Loop(void) * @param msg * @return None ******************************************************************************/ -void Lcd_MsgHandler(service_t *service, msg_t *msg) +void Lcd_MsgHandler(service_t *service, const msg_t *msg) { switch (msg->header.cmd) { @@ -114,4 +114,4 @@ void Lcd_MsgHandler(service_t *service, msg_t *msg) } break; } -} \ No newline at end of file +} diff --git a/examples/projects/Arduino/led/lib/led/led.c b/examples/projects/Arduino/led/lib/led/led.c index 400dbd283..4c067da66 100644 --- a/examples/projects/Arduino/led/lib/led/led.c +++ b/examples/projects/Arduino/led/lib/led/led.c @@ -17,7 +17,7 @@ /******************************************************************************* * Function ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg); +static void Led_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -45,7 +45,7 @@ void Led_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg) +static void Led_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == IO_STATE) { diff --git a/examples/projects/Arduino/servo_motor/lib/Servo_motor/servo_motor.c b/examples/projects/Arduino/servo_motor/lib/Servo_motor/servo_motor.c index 4f72e9c66..44c54af19 100644 --- a/examples/projects/Arduino/servo_motor/lib/Servo_motor/servo_motor.c +++ b/examples/projects/Arduino/servo_motor/lib/Servo_motor/servo_motor.c @@ -21,7 +21,7 @@ static service_t *service_servo; /******************************************************************************* * Functions ******************************************************************************/ -static void Servo_MsgHandler(service_t *service, msg_t *msg); +static void Servo_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -52,7 +52,7 @@ void Servo_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Servo_MsgHandler(service_t *service, msg_t *msg) +static void Servo_MsgHandler(service_t *service, const msg_t *msg) { servo_motor_t servo; if (msg->header.cmd == ANGULAR_POSITION) @@ -67,4 +67,4 @@ static void Servo_MsgHandler(service_t *service, msg_t *msg) memcpy((void *)servo.param.unmap, msg->data, sizeof(servo_parameters_t)); ServoDrv_Parameter(servo.param); } -} \ No newline at end of file +} diff --git a/examples/projects/Arduino/stepper_simple_foc/lib/motor/motor.cpp b/examples/projects/Arduino/stepper_simple_foc/lib/motor/motor.cpp index a809743a5..762d0c89f 100644 --- a/examples/projects/Arduino/stepper_simple_foc/lib/motor/motor.cpp +++ b/examples/projects/Arduino/stepper_simple_foc/lib/motor/motor.cpp @@ -47,7 +47,7 @@ float tickstart = 0.0; /******************************************************************************* * Function ******************************************************************************/ -static void Motor_MsgHandler(service_t *service, msg_t *msg); +static void Motor_MsgHandler(service_t *service, const msg_t *msg); void Motor_TrajectoryCallback(void); /****************************************************************************** * @brief init must be call in project init @@ -192,7 +192,7 @@ void Motor_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Motor_MsgHandler(service_t *service, msg_t *msg) +static void Motor_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == PARAMETERS) { @@ -283,4 +283,4 @@ void Motor_TrajectoryCallback(void) motion_target_position = AngularOD_PositionTo_deg(servo_motor.target_angular_position); } last_position = AngularOD_PositionFrom_deg(motion_target_position); -} \ No newline at end of file +} diff --git a/examples/projects/ESP32/button/lib/button/button.c b/examples/projects/ESP32/button/lib/button/button.c index 94753304c..d9962f4a6 100644 --- a/examples/projects/ESP32/button/lib/button/button.c +++ b/examples/projects/ESP32/button/lib/button/button.c @@ -22,7 +22,7 @@ /******************************************************************************* * Function ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg); +static void Button_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init * @param None @@ -57,7 +57,7 @@ void Button_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg) +static void Button_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/ESP32/button_arduino/lib/button/button.c b/examples/projects/ESP32/button_arduino/lib/button/button.c index 6ceab3928..8a6826edb 100644 --- a/examples/projects/ESP32/button_arduino/lib/button/button.c +++ b/examples/projects/ESP32/button_arduino/lib/button/button.c @@ -18,7 +18,7 @@ /******************************************************************************* * Function ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg); +static void Button_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init * @param None @@ -44,7 +44,7 @@ void Button_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg) +static void Button_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/ESP32/led/lib/led/led.c b/examples/projects/ESP32/led/lib/led/led.c index 3da53a1a4..41f776e58 100644 --- a/examples/projects/ESP32/led/lib/led/led.c +++ b/examples/projects/ESP32/led/lib/led/led.c @@ -28,7 +28,7 @@ uint8_t Led_last_state = 0; /******************************************************************************* * Function ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg); +static void Led_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init * @param None @@ -69,7 +69,7 @@ void Led_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg) +static void Led_MsgHandler(service_t *service, const msg_t *msg) { #ifdef CONFIG_IDF_TARGET_ESP32 if (msg->header.cmd == IO_STATE) diff --git a/examples/projects/NUCLEO-F072RB/barometer/lib/barometer/BMP280.c b/examples/projects/NUCLEO-F072RB/barometer/lib/barometer/BMP280.c index 7f3ec5a38..b6268550b 100644 --- a/examples/projects/NUCLEO-F072RB/barometer/lib/barometer/BMP280.c +++ b/examples/projects/NUCLEO-F072RB/barometer/lib/barometer/BMP280.c @@ -86,10 +86,10 @@ float Pressure_temp2 = 0; float Temperature = 0; pressure_t Pressure = {0.0}; -static void BMP280_MsgHandler(service_t *service, msg_t *msg); +static void BMP280_MsgHandler(service_t *service, const msg_t *msg); /* Receive and reply to an external Message */ -static void BMP280_MsgHandler(service_t *service, msg_t *msg) +static void BMP280_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { @@ -286,4 +286,4 @@ void BMP280_Loop() Var14_P = ((float)Pressure9) * Pressure_temp2 * Pressure_temp2 / 2147483648; Var24_P = Pressure_temp2 * ((float)Pressure8) / 32768; Pressure = PressureOD_PressureFrom_Pa(Pressure_temp2 + (Var14_P + Var24_P + ((float)Pressure7)) / 16); -} \ No newline at end of file +} diff --git a/examples/projects/NUCLEO-F072RB/dc_motor/lib/DC_motor/dc_motor.c b/examples/projects/NUCLEO-F072RB/dc_motor/lib/DC_motor/dc_motor.c index ed1e4c111..037034b57 100644 --- a/examples/projects/NUCLEO-F072RB/dc_motor/lib/DC_motor/dc_motor.c +++ b/examples/projects/NUCLEO-F072RB/dc_motor/lib/DC_motor/dc_motor.c @@ -19,7 +19,7 @@ service_t *MotorDCservice2; /******************************************************************************* * Function ******************************************************************************/ -static void MotorDC_MsgHandler(service_t *service, msg_t *msg); +static void MotorDC_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -48,7 +48,7 @@ void MotorDC_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void MotorDC_MsgHandler(service_t *service, msg_t *msg) +static void MotorDC_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == RATIO) { diff --git a/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.c b/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.c index bb4784c93..dad36ccd2 100644 --- a/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.c +++ b/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.c @@ -20,7 +20,7 @@ time_luos_t angle_timestamp; /******************************************************************************* * Function ******************************************************************************/ -static void Potentiometer_MsgHandler(service_t *service, msg_t *msg); +static void Potentiometer_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -54,7 +54,7 @@ void Potentiometer_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Potentiometer_MsgHandler(service_t *service, msg_t *msg) +static void Potentiometer_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/NUCLEO-F401RE/button/lib/Button/button.c b/examples/projects/NUCLEO-F401RE/button/lib/Button/button.c index f9d3d893b..6a14d2cbf 100644 --- a/examples/projects/NUCLEO-F401RE/button/lib/Button/button.c +++ b/examples/projects/NUCLEO-F401RE/button/lib/Button/button.c @@ -18,7 +18,7 @@ /******************************************************************************* * Function ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg); +static void Button_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init * @param None @@ -44,7 +44,7 @@ void Button_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg) +static void Button_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/NUCLEO-F401RE/dc_motor/lib/DC_motor/dc_motor.c b/examples/projects/NUCLEO-F401RE/dc_motor/lib/DC_motor/dc_motor.c index ed1e4c111..037034b57 100644 --- a/examples/projects/NUCLEO-F401RE/dc_motor/lib/DC_motor/dc_motor.c +++ b/examples/projects/NUCLEO-F401RE/dc_motor/lib/DC_motor/dc_motor.c @@ -19,7 +19,7 @@ service_t *MotorDCservice2; /******************************************************************************* * Function ******************************************************************************/ -static void MotorDC_MsgHandler(service_t *service, msg_t *msg); +static void MotorDC_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -48,7 +48,7 @@ void MotorDC_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void MotorDC_MsgHandler(service_t *service, msg_t *msg) +static void MotorDC_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == RATIO) { diff --git a/examples/projects/NUCLEO-F401RE/led/lib/Led/led.c b/examples/projects/NUCLEO-F401RE/led/lib/Led/led.c index cc8365a55..3dd99095a 100644 --- a/examples/projects/NUCLEO-F401RE/led/lib/Led/led.c +++ b/examples/projects/NUCLEO-F401RE/led/lib/Led/led.c @@ -19,7 +19,7 @@ uint8_t Led_last_state = 0; /******************************************************************************* * Function ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg); +static void Led_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -48,7 +48,7 @@ void Led_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg) +static void Led_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == IO_STATE) { diff --git a/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.c b/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.c index d14040dce..4889042e2 100644 --- a/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.c +++ b/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.c @@ -20,7 +20,7 @@ time_luos_t angle_timestamp; /******************************************************************************* * Function ******************************************************************************/ -static void Potentiometer_MsgHandler(service_t *service, msg_t *msg); +static void Potentiometer_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -54,7 +54,7 @@ void Potentiometer_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Potentiometer_MsgHandler(service_t *service, msg_t *msg) +static void Potentiometer_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/NUCLEO-F410RB/button/lib/Button/button.c b/examples/projects/NUCLEO-F410RB/button/lib/Button/button.c index f9d3d893b..6a14d2cbf 100644 --- a/examples/projects/NUCLEO-F410RB/button/lib/Button/button.c +++ b/examples/projects/NUCLEO-F410RB/button/lib/Button/button.c @@ -18,7 +18,7 @@ /******************************************************************************* * Function ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg); +static void Button_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init * @param None @@ -44,7 +44,7 @@ void Button_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg) +static void Button_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/NUCLEO-F410RB/dc_motor/lib/DC_motor/dc_motor.c b/examples/projects/NUCLEO-F410RB/dc_motor/lib/DC_motor/dc_motor.c index ed1e4c111..037034b57 100644 --- a/examples/projects/NUCLEO-F410RB/dc_motor/lib/DC_motor/dc_motor.c +++ b/examples/projects/NUCLEO-F410RB/dc_motor/lib/DC_motor/dc_motor.c @@ -19,7 +19,7 @@ service_t *MotorDCservice2; /******************************************************************************* * Function ******************************************************************************/ -static void MotorDC_MsgHandler(service_t *service, msg_t *msg); +static void MotorDC_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -48,7 +48,7 @@ void MotorDC_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void MotorDC_MsgHandler(service_t *service, msg_t *msg) +static void MotorDC_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == RATIO) { diff --git a/examples/projects/NUCLEO-F410RB/led/lib/Led/led.c b/examples/projects/NUCLEO-F410RB/led/lib/Led/led.c index b94b83038..50ac3232c 100644 --- a/examples/projects/NUCLEO-F410RB/led/lib/Led/led.c +++ b/examples/projects/NUCLEO-F410RB/led/lib/Led/led.c @@ -18,7 +18,7 @@ uint8_t Led_last_state = 0; /******************************************************************************* * Function ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg); +static void Led_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -44,7 +44,7 @@ void Led_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg) +static void Led_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == IO_STATE) { diff --git a/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.c b/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.c index bb4784c93..dad36ccd2 100644 --- a/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.c +++ b/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.c @@ -20,7 +20,7 @@ time_luos_t angle_timestamp; /******************************************************************************* * Function ******************************************************************************/ -static void Potentiometer_MsgHandler(service_t *service, msg_t *msg); +static void Potentiometer_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -54,7 +54,7 @@ void Potentiometer_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Potentiometer_MsgHandler(service_t *service, msg_t *msg) +static void Potentiometer_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/NUCLEO-G431KB/button/lib/Button/button.c b/examples/projects/NUCLEO-G431KB/button/lib/Button/button.c index f9d3d893b..6a14d2cbf 100644 --- a/examples/projects/NUCLEO-G431KB/button/lib/Button/button.c +++ b/examples/projects/NUCLEO-G431KB/button/lib/Button/button.c @@ -18,7 +18,7 @@ /******************************************************************************* * Function ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg); +static void Button_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init * @param None @@ -44,7 +44,7 @@ void Button_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg) +static void Button_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/NUCLEO-G431KB/dc_motor/lib/DC_motor/dc_motor.c b/examples/projects/NUCLEO-G431KB/dc_motor/lib/DC_motor/dc_motor.c index ed1e4c111..037034b57 100644 --- a/examples/projects/NUCLEO-G431KB/dc_motor/lib/DC_motor/dc_motor.c +++ b/examples/projects/NUCLEO-G431KB/dc_motor/lib/DC_motor/dc_motor.c @@ -19,7 +19,7 @@ service_t *MotorDCservice2; /******************************************************************************* * Function ******************************************************************************/ -static void MotorDC_MsgHandler(service_t *service, msg_t *msg); +static void MotorDC_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -48,7 +48,7 @@ void MotorDC_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void MotorDC_MsgHandler(service_t *service, msg_t *msg) +static void MotorDC_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == RATIO) { diff --git a/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.c b/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.c index bb4784c93..dad36ccd2 100644 --- a/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.c +++ b/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.c @@ -20,7 +20,7 @@ time_luos_t angle_timestamp; /******************************************************************************* * Function ******************************************************************************/ -static void Potentiometer_MsgHandler(service_t *service, msg_t *msg); +static void Potentiometer_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -54,7 +54,7 @@ void Potentiometer_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Potentiometer_MsgHandler(service_t *service, msg_t *msg) +static void Potentiometer_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/NUCLEO-G474RE/button/lib/Button/button.c b/examples/projects/NUCLEO-G474RE/button/lib/Button/button.c index 0d2016a2f..39e1a943f 100644 --- a/examples/projects/NUCLEO-G474RE/button/lib/Button/button.c +++ b/examples/projects/NUCLEO-G474RE/button/lib/Button/button.c @@ -18,7 +18,7 @@ /******************************************************************************* * Function ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg); +static void Button_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init * @param None @@ -43,7 +43,7 @@ void Button_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg) +static void Button_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/NUCLEO-L432KC/button/lib/Button/button.c b/examples/projects/NUCLEO-L432KC/button/lib/Button/button.c index f9d3d893b..6a14d2cbf 100644 --- a/examples/projects/NUCLEO-L432KC/button/lib/Button/button.c +++ b/examples/projects/NUCLEO-L432KC/button/lib/Button/button.c @@ -18,7 +18,7 @@ /******************************************************************************* * Function ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg); +static void Button_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init * @param None @@ -44,7 +44,7 @@ void Button_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg) +static void Button_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/NUCLEO-L432KC/dc_motor/lib/DC_motor/dc_motor.c b/examples/projects/NUCLEO-L432KC/dc_motor/lib/DC_motor/dc_motor.c index ed1e4c111..037034b57 100644 --- a/examples/projects/NUCLEO-L432KC/dc_motor/lib/DC_motor/dc_motor.c +++ b/examples/projects/NUCLEO-L432KC/dc_motor/lib/DC_motor/dc_motor.c @@ -19,7 +19,7 @@ service_t *MotorDCservice2; /******************************************************************************* * Function ******************************************************************************/ -static void MotorDC_MsgHandler(service_t *service, msg_t *msg); +static void MotorDC_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -48,7 +48,7 @@ void MotorDC_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void MotorDC_MsgHandler(service_t *service, msg_t *msg) +static void MotorDC_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == RATIO) { diff --git a/examples/projects/NUCLEO-L432KC/fingerprint/lib/Fingerprint/fingerprint.c b/examples/projects/NUCLEO-L432KC/fingerprint/lib/Fingerprint/fingerprint.c index 312df824a..b9484b750 100644 --- a/examples/projects/NUCLEO-L432KC/fingerprint/lib/Fingerprint/fingerprint.c +++ b/examples/projects/NUCLEO-L432KC/fingerprint/lib/Fingerprint/fingerprint.c @@ -32,7 +32,7 @@ static service_t *service_fingerprint; /******************************************************************************* * Functions ******************************************************************************/ -void Fingerprint_MsgHandler(service_t *service, msg_t *msg); +void Fingerprint_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -63,7 +63,7 @@ void Fingerprint_Loop(void) * @param msg * @return None ******************************************************************************/ -void Fingerprint_MsgHandler(service_t *service, msg_t *msg) +void Fingerprint_MsgHandler(service_t *service, const msg_t *msg) { msg_t pub_msg; pub_msg.header.target = msg->header.source; diff --git a/examples/projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.c b/examples/projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.c index 12af3b433..acde8e422 100644 --- a/examples/projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.c +++ b/examples/projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.c @@ -27,7 +27,7 @@ uint8_t i = 0; /******************************************************************************* * Functions ******************************************************************************/ -void Lcd_MsgHandler(service_t *service, msg_t *msg); +void Lcd_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief Service init must be call in project init @@ -75,7 +75,7 @@ void Lcd_Loop(void) * @param msg * @return None ******************************************************************************/ -void Lcd_MsgHandler(service_t *service, msg_t *msg) +void Lcd_MsgHandler(service_t *service, const msg_t *msg) { switch (msg->header.cmd) { @@ -114,4 +114,4 @@ void Lcd_MsgHandler(service_t *service, msg_t *msg) } break; } -} \ No newline at end of file +} diff --git a/examples/projects/NUCLEO-L432KC/led/lib/Led/led.c b/examples/projects/NUCLEO-L432KC/led/lib/Led/led.c index 4683c1e77..bcb1cdf06 100644 --- a/examples/projects/NUCLEO-L432KC/led/lib/Led/led.c +++ b/examples/projects/NUCLEO-L432KC/led/lib/Led/led.c @@ -18,7 +18,7 @@ uint8_t Led_last_state = 0; /******************************************************************************* * Function ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg); +static void Led_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -45,7 +45,7 @@ void Led_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg) +static void Led_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.c b/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.c index bb4784c93..dad36ccd2 100644 --- a/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.c +++ b/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.c @@ -20,7 +20,7 @@ time_luos_t angle_timestamp; /******************************************************************************* * Function ******************************************************************************/ -static void Potentiometer_MsgHandler(service_t *service, msg_t *msg); +static void Potentiometer_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -54,7 +54,7 @@ void Potentiometer_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Potentiometer_MsgHandler(service_t *service, msg_t *msg) +static void Potentiometer_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/NUCLEO-L432KC/servo/lib/Servo/servo.c b/examples/projects/NUCLEO-L432KC/servo/lib/Servo/servo.c index 5a8bcd527..101565866 100644 --- a/examples/projects/NUCLEO-L432KC/servo/lib/Servo/servo.c +++ b/examples/projects/NUCLEO-L432KC/servo/lib/Servo/servo.c @@ -22,7 +22,7 @@ static service_t *service_servo; /******************************************************************************* * Functions ******************************************************************************/ -static void Servo_MsgHandler(service_t *service, msg_t *msg); +static void Servo_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -53,7 +53,7 @@ void Servo_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Servo_MsgHandler(service_t *service, msg_t *msg) +static void Servo_MsgHandler(service_t *service, const msg_t *msg) { servo_t servo; if (msg->header.cmd == ANGULAR_POSITION) @@ -68,4 +68,4 @@ static void Servo_MsgHandler(service_t *service, msg_t *msg) memcpy((void *)servo.param.unmap, msg->data, sizeof(servo_parameters_t)); ServoDrv_Parameter(servo.param); } -} \ No newline at end of file +} diff --git a/examples/projects/SAMD21XPLAINED/button/lib/button/button.c b/examples/projects/SAMD21XPLAINED/button/lib/button/button.c index af99840e4..953f5cd3f 100644 --- a/examples/projects/SAMD21XPLAINED/button/lib/button/button.c +++ b/examples/projects/SAMD21XPLAINED/button/lib/button/button.c @@ -19,7 +19,7 @@ /******************************************************************************* * Function ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg); +static void Button_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init * @param None @@ -44,7 +44,7 @@ void Button_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg) +static void Button_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/STM32F4-discovery/button/lib/Button/button.c b/examples/projects/STM32F4-discovery/button/lib/Button/button.c index f9d3d893b..6a14d2cbf 100644 --- a/examples/projects/STM32F4-discovery/button/lib/Button/button.c +++ b/examples/projects/STM32F4-discovery/button/lib/Button/button.c @@ -18,7 +18,7 @@ /******************************************************************************* * Function ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg); +static void Button_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init * @param None @@ -44,7 +44,7 @@ void Button_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg) +static void Button_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/STM32L4S5_discovery/button/lib/Button/button.c b/examples/projects/STM32L4S5_discovery/button/lib/Button/button.c index f9d3d893b..6a14d2cbf 100644 --- a/examples/projects/STM32L4S5_discovery/button/lib/Button/button.c +++ b/examples/projects/STM32L4S5_discovery/button/lib/Button/button.c @@ -18,7 +18,7 @@ /******************************************************************************* * Function ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg); +static void Button_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init * @param None @@ -44,7 +44,7 @@ void Button_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Button_MsgHandler(service_t *service, msg_t *msg) +static void Button_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/led_fader.c b/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/led_fader.c index e4b35878d..009f14a13 100644 --- a/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/led_fader.c +++ b/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/led_fader.c @@ -32,7 +32,7 @@ volatile float coef[3] = {0.0}; /******************************************************************************* * Function ******************************************************************************/ -static void LedFader_MsgHandler(service_t *service, msg_t *msg); +static void LedFader_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief package init must be call in project init * @param None @@ -89,7 +89,7 @@ void LedFader_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -void LedFader_MsgHandler(service_t *service, msg_t *msg) +void LedFader_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == COLOR) { diff --git a/examples/projects/l0/button_freertos/lib/Led/led.c b/examples/projects/l0/button_freertos/lib/Led/led.c index 7134c50cc..4958d2372 100644 --- a/examples/projects/l0/button_freertos/lib/Led/led.c +++ b/examples/projects/l0/button_freertos/lib/Led/led.c @@ -20,7 +20,7 @@ /******************************************************************************* * Function ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg); +static void Led_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief package init must be call in project init @@ -50,7 +50,7 @@ void Led_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg) +static void Led_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == IO_STATE) { diff --git a/examples/projects/l0/controller_motor/lib/Controller_motor/controller_motor.c b/examples/projects/l0/controller_motor/lib/Controller_motor/controller_motor.c index 30667ecba..c5238bf54 100644 --- a/examples/projects/l0/controller_motor/lib/Controller_motor/controller_motor.c +++ b/examples/projects/l0/controller_motor/lib/Controller_motor/controller_motor.c @@ -50,7 +50,7 @@ char speed_bootstrap = 0; /******************************************************************************* * Function ******************************************************************************/ -static void ControllerMotor_MsgHandler(service_t *service, msg_t *msg); +static void ControllerMotor_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -248,7 +248,7 @@ void ControllerMotor_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void ControllerMotor_MsgHandler(service_t *service, msg_t *msg) +static void ControllerMotor_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { @@ -363,4 +363,4 @@ void HAL_SYSTICK_Motor_Callback(void) motion_target_position = AngularOD_PositionTo_deg(servo_motor.target_angular_position); } last_position = AngularOD_PositionFrom_deg(motion_target_position); -} \ No newline at end of file +} diff --git a/examples/projects/l0/dc_motor/lib/DC_motor/dc_motor.c b/examples/projects/l0/dc_motor/lib/DC_motor/dc_motor.c index ed1e4c111..037034b57 100644 --- a/examples/projects/l0/dc_motor/lib/DC_motor/dc_motor.c +++ b/examples/projects/l0/dc_motor/lib/DC_motor/dc_motor.c @@ -19,7 +19,7 @@ service_t *MotorDCservice2; /******************************************************************************* * Function ******************************************************************************/ -static void MotorDC_MsgHandler(service_t *service, msg_t *msg); +static void MotorDC_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -48,7 +48,7 @@ void MotorDC_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void MotorDC_MsgHandler(service_t *service, msg_t *msg) +static void MotorDC_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == RATIO) { diff --git a/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.c b/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.c index 32810d513..34301a656 100644 --- a/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.c +++ b/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.c @@ -23,7 +23,7 @@ uint32_t last_detection_date_ms = 0; /******************************************************************************* * Function ******************************************************************************/ -static void DetectionButton_MsgHandler(service_t *service, msg_t *msg); +static void DetectionButton_MsgHandler(service_t *service, const msg_t *msg); static void Setup_button(void); /****************************************************************************** @@ -72,7 +72,7 @@ void DetectionButton_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void DetectionButton_MsgHandler(service_t *service, msg_t *msg) +static void DetectionButton_MsgHandler(service_t *service, const msg_t *msg) { static uint8_t last_btn_state = 0; if (msg->header.cmd == IO_STATE) @@ -111,4 +111,4 @@ void Setup_button(void) Luos_Loop(); } } -} \ No newline at end of file +} diff --git a/examples/projects/l0/demo/ledstrip_position/lib/Distance/distance.c b/examples/projects/l0/demo/ledstrip_position/lib/Distance/distance.c index 449df3433..e2f5c06bc 100644 --- a/examples/projects/l0/demo/ledstrip_position/lib/Distance/distance.c +++ b/examples/projects/l0/demo/ledstrip_position/lib/Distance/distance.c @@ -21,7 +21,7 @@ bool new_data_ready = false; /******************************************************************************* * Function ******************************************************************************/ -static void Distance_MsgHandler(service_t *service, msg_t *msg); +static void Distance_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -54,7 +54,7 @@ void Distance_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Distance_MsgHandler(service_t *service, msg_t *msg) +static void Distance_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.c b/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.c index 51a05a83c..5270721bf 100644 --- a/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.c +++ b/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.c @@ -44,7 +44,7 @@ bool end_detection = false; /******************************************************************************* * Function ******************************************************************************/ -static void LedStripPosition_MsgHandler(service_t *service, msg_t *msg); +static void LedStripPosition_MsgHandler(service_t *service, const msg_t *msg); static void distance_filtering(void); static void distance_frame_compute(void); static void glowing_fade(float target); @@ -150,7 +150,7 @@ void LedStripPosition_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void LedStripPosition_MsgHandler(service_t *service, msg_t *msg) +static void LedStripPosition_MsgHandler(service_t *service, const msg_t *msg) { search_result_t services_list; RTFilter_Reset(&services_list); @@ -523,4 +523,4 @@ void sort_motors(void) // Parse routing table to find motors RTFilter_Type(RTFilter_Reset(&result), SERVO_MOTOR_TYPE); motor_found = result.result_nbr; -} \ No newline at end of file +} diff --git a/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.c b/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.c index 06b68e633..abf95af80 100644 --- a/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.c +++ b/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.c @@ -28,7 +28,7 @@ bool end_detection = false; /******************************************************************************* * Function ******************************************************************************/ -static void MotorCopy_EventHandler(service_t *service, msg_t *msg); +static void MotorCopy_EventHandler(service_t *service, const msg_t *msg); static void Motor_init(uint16_t id); static void motor_set(uint8_t motor_target, angular_position_t position); static void sort_motors(void); @@ -129,7 +129,7 @@ void MotorCopy_Loop(void) } } -void MotorCopy_EventHandler(service_t *service, msg_t *msg) +void MotorCopy_EventHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == ANGULAR_POSITION) { @@ -238,4 +238,4 @@ static void sort_motors(void) break; } } -} \ No newline at end of file +} diff --git a/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.c b/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.c index 9ffa9013f..7e1b7eec3 100644 --- a/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.c +++ b/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.c @@ -41,7 +41,7 @@ float trajectory[NB_POINT_IN_TRAJECTORY]; /******************************************************************************* * Function ******************************************************************************/ -static void RunMotor_EventHandler(service_t *service, msg_t *msg); +static void RunMotor_EventHandler(service_t *service, const msg_t *msg); static void motor_init(uint8_t motor_target); static void motor_SendTrajectory(uint8_t motor_target); static void motor_stream(uint8_t motor_target, control_type_t control); @@ -106,7 +106,7 @@ void RunMotor_Loop(void) } } -void RunMotor_EventHandler(service_t *service, msg_t *msg) +void RunMotor_EventHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == SET_CMD) { @@ -277,4 +277,4 @@ void compute_trajectory(void) // compute sinus trajectory trajectory[index] = sin(M_PI / 180 * angle_deg) * MAX_ANGLE; } -} \ No newline at end of file +} diff --git a/examples/projects/l0/distance/lib/Distance/distance.c b/examples/projects/l0/distance/lib/Distance/distance.c index b408d013c..57dc0d8ad 100644 --- a/examples/projects/l0/distance/lib/Distance/distance.c +++ b/examples/projects/l0/distance/lib/Distance/distance.c @@ -22,7 +22,7 @@ time_luos_t distance_timestamp; /******************************************************************************* * Function ******************************************************************************/ -static void Distance_MsgHandler(service_t *service, msg_t *msg); +static void Distance_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -56,7 +56,7 @@ void Distance_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Distance_MsgHandler(service_t *service, msg_t *msg) +static void Distance_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/l0/dxl/lib/Dxl/dxl.c b/examples/projects/l0/dxl/lib/Dxl/dxl.c index 99a7e79d0..3c4741a70 100644 --- a/examples/projects/l0/dxl/lib/Dxl/dxl.c +++ b/examples/projects/l0/dxl/lib/Dxl/dxl.c @@ -37,7 +37,7 @@ volatile float measurement_buf[BUFFER_SIZE]; /******************************************************************************* * Function ******************************************************************************/ -static void Dxl_MsgHandler(service_t *service, msg_t *msg); +static void Dxl_MsgHandler(service_t *service, const msg_t *msg); static void discover_dxl(void); static int find_id(service_t *service); @@ -137,7 +137,7 @@ void Dxl_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Dxl_MsgHandler(service_t *service, msg_t *msg) +static void Dxl_MsgHandler(service_t *service, const msg_t *msg) { int index = find_id(service); diff --git a/examples/projects/l0/fingerprint/lib/Fingerprint/fingerprint.c b/examples/projects/l0/fingerprint/lib/Fingerprint/fingerprint.c index 655f0a124..fdf15a57e 100644 --- a/examples/projects/l0/fingerprint/lib/Fingerprint/fingerprint.c +++ b/examples/projects/l0/fingerprint/lib/Fingerprint/fingerprint.c @@ -33,7 +33,7 @@ static service_t *service_fingerprint; /******************************************************************************* * Functions ******************************************************************************/ -void Fingerprint_MsgHandler(service_t *service, msg_t *msg); +void Fingerprint_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -64,7 +64,7 @@ void Fingerprint_Loop(void) * @param msg * @return None ******************************************************************************/ -void Fingerprint_MsgHandler(service_t *service, msg_t *msg) +void Fingerprint_MsgHandler(service_t *service, const msg_t *msg) { msg_t pub_msg; pub_msg.header.target = msg->header.source; diff --git a/examples/projects/l0/gpio/lib/Gpio_dev/gpio_dev.c b/examples/projects/l0/gpio/lib/Gpio_dev/gpio_dev.c index 10421ad1f..734b3904d 100644 --- a/examples/projects/l0/gpio/lib/Gpio_dev/gpio_dev.c +++ b/examples/projects/l0/gpio/lib/Gpio_dev/gpio_dev.c @@ -23,7 +23,7 @@ profile_voltage_t analog[ANALOG_NB]; /******************************************************************************* * Function ******************************************************************************/ -static void GpioDev_callback(service_t *service, msg_t *msg); +static void GpioDev_callback(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -85,7 +85,7 @@ void GpioDev_Loop(void) * @param None * @return None ******************************************************************************/ -static void GpioDev_callback(service_t *service, msg_t *msg) +static void GpioDev_callback(service_t *service, const msg_t *msg) { if (msg->header.cmd == IO_STATE) { diff --git a/examples/projects/l0/imu/lib/Imu/imu.c b/examples/projects/l0/imu/lib/Imu/imu.c index 4ada77d05..597ecd08a 100644 --- a/examples/projects/l0/imu/lib/Imu/imu.c +++ b/examples/projects/l0/imu/lib/Imu/imu.c @@ -25,7 +25,7 @@ volatile int pub = LUOS_LAST_STD_CMD; /******************************************************************************* * Function ******************************************************************************/ -static void Imu_MsgHandler(service_t *service, msg_t *msg); +static void Imu_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -238,7 +238,7 @@ void Imu_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Imu_MsgHandler(service_t *service, msg_t *msg) +static void Imu_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/l0/lcd/lib/Lcd/lcd.c b/examples/projects/l0/lcd/lib/Lcd/lcd.c index 9a2e9113d..913b63500 100644 --- a/examples/projects/l0/lcd/lib/Lcd/lcd.c +++ b/examples/projects/l0/lcd/lib/Lcd/lcd.c @@ -27,7 +27,7 @@ uint8_t i = 0; /******************************************************************************* * Functions ******************************************************************************/ -void Lcd_MsgHandler(service_t *service, msg_t *msg); +void Lcd_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief Service init must be call in project init @@ -75,7 +75,7 @@ void Lcd_Loop(void) * @param msg * @return None ******************************************************************************/ -void Lcd_MsgHandler(service_t *service, msg_t *msg) +void Lcd_MsgHandler(service_t *service, const msg_t *msg) { switch (msg->header.cmd) { @@ -114,4 +114,4 @@ void Lcd_MsgHandler(service_t *service, msg_t *msg) } break; } -} \ No newline at end of file +} diff --git a/examples/projects/l0/led/lib/Led/led.c b/examples/projects/l0/led/lib/Led/led.c index aa9fa027c..47c4eb873 100644 --- a/examples/projects/l0/led/lib/Led/led.c +++ b/examples/projects/l0/led/lib/Led/led.c @@ -20,7 +20,7 @@ /******************************************************************************* * Function ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg); +static void Led_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief package init must be call in project init @@ -50,7 +50,7 @@ void Led_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg) +static void Led_MsgHandler(service_t *service, const msg_t *msg) { color_t rgb; if (msg->header.cmd == COLOR) diff --git a/examples/projects/l0/led_fader/lib/Led_Fader/led_fader.c b/examples/projects/l0/led_fader/lib/Led_Fader/led_fader.c index 227a7ae00..283533ce4 100644 --- a/examples/projects/l0/led_fader/lib/Led_Fader/led_fader.c +++ b/examples/projects/l0/led_fader/lib/Led_Fader/led_fader.c @@ -32,7 +32,7 @@ volatile float coef[3] = {0.0}; /******************************************************************************* * Function ******************************************************************************/ -static void LedFader_MsgHandler(service_t *service, msg_t *msg); +static void LedFader_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief package init must be call in project init * @param None @@ -89,7 +89,7 @@ void LedFader_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -void LedFader_MsgHandler(service_t *service, msg_t *msg) +void LedFader_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == COLOR) { diff --git a/examples/projects/l0/led_strip/lib/Led_strip/led_strip.c b/examples/projects/l0/led_strip/lib/Led_strip/led_strip.c index 7c55dd5a0..f0e0b0c20 100644 --- a/examples/projects/l0/led_strip/lib/Led_strip/led_strip.c +++ b/examples/projects/l0/led_strip/lib/Led_strip/led_strip.c @@ -20,7 +20,7 @@ int imgsize = MAX_LED_NUMBER; /******************************************************************************* * Function ******************************************************************************/ -static void LedStrip_MsgHandler(service_t *service, msg_t *msg); +static void LedStrip_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -53,7 +53,7 @@ void LedStrip_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void LedStrip_MsgHandler(service_t *service, msg_t *msg) +static void LedStrip_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == COLOR) { diff --git a/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.c b/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.c index 56fd8a18a..e2f95a08a 100644 --- a/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.c +++ b/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.c @@ -20,7 +20,7 @@ time_luos_t lux_timestamp; /******************************************************************************* * Function ******************************************************************************/ -static void LightSensor_MsgHandler(service_t *service, msg_t *msg); +static void LightSensor_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -54,7 +54,7 @@ void LightSensor_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void LightSensor_MsgHandler(service_t *service, msg_t *msg) +static void LightSensor_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/l0/load/lib/Load/load.c b/examples/projects/l0/load/lib/Load/load.c index 6734b9cd2..5a42549f5 100644 --- a/examples/projects/l0/load/lib/Load/load.c +++ b/examples/projects/l0/load/lib/Load/load.c @@ -22,7 +22,7 @@ bool new_data_ready = false; /******************************************************************************* * Function ******************************************************************************/ -static void Load_MsgHandler(service_t *service, msg_t *msg); +static void Load_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -55,7 +55,7 @@ void Load_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Load_MsgHandler(service_t *service, msg_t *msg) +static void Load_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.c b/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.c index bb4784c93..dad36ccd2 100644 --- a/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.c +++ b/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.c @@ -20,7 +20,7 @@ time_luos_t angle_timestamp; /******************************************************************************* * Function ******************************************************************************/ -static void Potentiometer_MsgHandler(service_t *service, msg_t *msg); +static void Potentiometer_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -54,7 +54,7 @@ void Potentiometer_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Potentiometer_MsgHandler(service_t *service, msg_t *msg) +static void Potentiometer_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { diff --git a/examples/projects/l0/servo/lib/Servo/servo.c b/examples/projects/l0/servo/lib/Servo/servo.c index c7bed4ee8..52851cee8 100644 --- a/examples/projects/l0/servo/lib/Servo/servo.c +++ b/examples/projects/l0/servo/lib/Servo/servo.c @@ -18,7 +18,7 @@ static service_t *service_servo[SERVONUMBER]; /******************************************************************************* * Function ******************************************************************************/ -static void Servo_MsgHandler(service_t *service, msg_t *msg); +static void Servo_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -50,7 +50,7 @@ void Servo_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Servo_MsgHandler(service_t *service, msg_t *msg) +static void Servo_MsgHandler(service_t *service, const msg_t *msg) { uint8_t i = 0; servo_t servo; diff --git a/examples/projects/l0/stepper/lib/Stepper/stepper.c b/examples/projects/l0/stepper/lib/Stepper/stepper.c index a2b841efa..cc55dd9d6 100644 --- a/examples/projects/l0/stepper/lib/Stepper/stepper.c +++ b/examples/projects/l0/stepper/lib/Stepper/stepper.c @@ -27,7 +27,7 @@ volatile int current_step_nb = 0; /******************************************************************************* * Function ******************************************************************************/ -static void Stepper_MsgHandler(service_t *service, msg_t *msg); +static void Stepper_MsgHandler(service_t *service, const msg_t *msg); static void compute_speed(void); /****************************************************************************** @@ -95,7 +95,7 @@ void Stepper_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Stepper_MsgHandler(service_t *service, msg_t *msg) +static void Stepper_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == PARAMETERS) { diff --git a/examples/projects/native/led/lib/Led/led.c b/examples/projects/native/led/lib/Led/led.c index e317382e1..5b7fa2ff6 100644 --- a/examples/projects/native/led/lib/Led/led.c +++ b/examples/projects/native/led/lib/Led/led.c @@ -51,7 +51,7 @@ const char led_OFF[768] = "\n" /******************************************************************************* * Function ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg); +static void Led_MsgHandler(service_t *service, const msg_t *msg); void clear_screen(void) { @@ -90,7 +90,7 @@ void Led_Loop(void) {} * @param Msg receive * @return None ******************************************************************************/ -static void Led_MsgHandler(service_t *service, msg_t *msg) +static void Led_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == IO_STATE) { @@ -126,4 +126,4 @@ static void Led_MsgHandler(service_t *service, msg_t *msg) printf(led_OFF); } } -} \ No newline at end of file +} diff --git a/examples/projects/native/ping_pong/lib/PingPong/ping_pong.c b/examples/projects/native/ping_pong/lib/PingPong/ping_pong.c index 6dfc5022e..e5b95149d 100644 --- a/examples/projects/native/ping_pong/lib/PingPong/ping_pong.c +++ b/examples/projects/native/ping_pong/lib/PingPong/ping_pong.c @@ -62,9 +62,9 @@ uint16_t last_id = 0; * Function ******************************************************************************/ -void Player_MsgHandler(service_t *service, msg_t *msg) +void Player_MsgHandler(service_t *service, const msg_t *msg) { - if ((msg->header.target_mode == TOPIC) & (msg->header.target = SCORE_TOPIC) & (msg->header.source != service->id)) + if ((msg->header.target_mode == TOPIC) & (msg->header.target == SCORE_TOPIC) & (msg->header.source != service->id)) { score_update(msg); set_screen_to(score_view); diff --git a/examples/projects/native/ping_pong/lib/PingPong/scoring.c b/examples/projects/native/ping_pong/lib/PingPong/scoring.c index 1412e402b..d3587c037 100644 --- a/examples/projects/native/ping_pong/lib/PingPong/scoring.c +++ b/examples/projects/native/ping_pong/lib/PingPong/scoring.c @@ -66,10 +66,10 @@ void score_increase(service_t *player, uint16_t winning_player_id) Luos_SendMsg(player, &msg); } -void score_update(msg_t *msg) +void score_update(const msg_t *msg) { score_t tmp_score[SCORE_TABLE_SIZE]; - msg_score_t *msg_score = (msg_score_t *)msg->data; + const msg_score_t *msg_score = (const msg_score_t *)msg->data; // Transform the message value into a score table for (int i = 0; i < score_table.player_nb; i++) { @@ -96,4 +96,4 @@ void score_update(msg_t *msg) score_table_t *get_score(void) { return &score_table; -} \ No newline at end of file +} diff --git a/examples/projects/native/ping_pong/lib/PingPong/scoring.h b/examples/projects/native/ping_pong/lib/PingPong/scoring.h index 9011e28aa..4470feca0 100644 --- a/examples/projects/native/ping_pong/lib/PingPong/scoring.h +++ b/examples/projects/native/ping_pong/lib/PingPong/scoring.h @@ -27,7 +27,7 @@ typedef struct void score_init(service_t *player, search_result_t *player_list); void score_increase(service_t *player, uint16_t winning_player_id); -void score_update(msg_t *msg); +void score_update(const msg_t *msg); score_table_t *get_score(void); -#endif /* SCORING_H */ \ No newline at end of file +#endif /* SCORING_H */ diff --git a/network/robus/HAL/ATSAMD21/robus_hal_config.h b/network/robus/HAL/ATSAMD21/robus_hal_config.h index 531b61896..7fe568a60 100644 --- a/network/robus/HAL/ATSAMD21/robus_hal_config.h +++ b/network/robus/HAL/ATSAMD21/robus_hal_config.h @@ -12,6 +12,11 @@ #include "samd21.h" +#define _CRITICAL +#define _CRITICAL +#define _CRITICAL +#define _CRITICAL +#define _CRITICAL #define DISABLE 0x00 // If your MCU do not Have DMA for tx transmit #define USE_TX_IT diff --git a/network/robus/HAL/ATSAMD21_ARDUINO/robus_hal_config.h b/network/robus/HAL/ATSAMD21_ARDUINO/robus_hal_config.h index 9ea7fc8fc..43b0db4d4 100644 --- a/network/robus/HAL/ATSAMD21_ARDUINO/robus_hal_config.h +++ b/network/robus/HAL/ATSAMD21_ARDUINO/robus_hal_config.h @@ -26,6 +26,7 @@ DEFAULT RobusHAL ARDUINO PIN CONFIGURATION | 7 | D7 | PTPB | +------------+------------------+---------------+ */ +#define _CRITICAL #define DISABLE 0x00 // If your MCU do not Have DMA for tx transmit #define USE_TX_IT diff --git a/network/robus/HAL/ATSAMD21_MBED/robus_hal_config.h b/network/robus/HAL/ATSAMD21_MBED/robus_hal_config.h index 47b534b81..6cc956272 100644 --- a/network/robus/HAL/ATSAMD21_MBED/robus_hal_config.h +++ b/network/robus/HAL/ATSAMD21_MBED/robus_hal_config.h @@ -12,6 +12,7 @@ #include "samd21.h" +#define _CRITICAL #define DISABLE 0x00 // If your MCU do not Have DMA for tx transmit #define USE_TX_IT diff --git a/network/robus/HAL/ESP32/robus_hal_config.h b/network/robus/HAL/ESP32/robus_hal_config.h index 5bac7059d..d4db4a835 100644 --- a/network/robus/HAL/ESP32/robus_hal_config.h +++ b/network/robus/HAL/ESP32/robus_hal_config.h @@ -14,7 +14,8 @@ #include "esp_attr.h" #include -#define DISABLE 0x00 +#define _CRITICAL IRAM_ATTR +#define DISABLE 0x00 #ifndef MCUFREQ #define MCUFREQ 80000000 // MCU frequence diff --git a/network/robus/HAL/NATIVE/robus_hal_config.h b/network/robus/HAL/NATIVE/robus_hal_config.h index 0a5ebc2db..9e5394e34 100644 --- a/network/robus/HAL/NATIVE/robus_hal_config.h +++ b/network/robus/HAL/NATIVE/robus_hal_config.h @@ -13,6 +13,7 @@ // STUB Value for x86 stub only #define X86_STUB 0x00 +#define _CRITICAL #define DISABLE 0x00 // If your MCU do not Have DMA for tx transmit define USE_TX_IT diff --git a/network/robus/HAL/STM32F0/robus_hal_config.h b/network/robus/HAL/STM32F0/robus_hal_config.h index 8b3566dbe..b922a0e12 100644 --- a/network/robus/HAL/STM32F0/robus_hal_config.h +++ b/network/robus/HAL/STM32F0/robus_hal_config.h @@ -12,6 +12,7 @@ #include "stm32f0xx_hal.h" +#define _CRITICAL #define DISABLE 0x00 // If your MCU do not Have DMA for tx transmit define USE_TX_IT @@ -152,4 +153,4 @@ #define LUOS_TIMER_IRQHANDLER() TIM6_DAC_IRQHandler() #endif -#endif /* _RobusHAL_CONFIG_H_ */ \ No newline at end of file +#endif /* _RobusHAL_CONFIG_H_ */ diff --git a/network/robus/HAL/STM32F4/robus_hal_config.h b/network/robus/HAL/STM32F4/robus_hal_config.h index e11fc9917..86e44f46e 100644 --- a/network/robus/HAL/STM32F4/robus_hal_config.h +++ b/network/robus/HAL/STM32F4/robus_hal_config.h @@ -12,6 +12,7 @@ #include "stm32f4xx_hal.h" +#define _CRITICAL #define DISABLE 0x00 // If your MCU do not Have DMA for tx transmit define USE_TX_IT @@ -154,4 +155,4 @@ #ifndef LUOS_TIMER_IRQHANDLER #define LUOS_TIMER_IRQHANDLER() TIM5_IRQHandler() #endif -#endif /* _RobusHAL_CONFIG_H_ */ \ No newline at end of file +#endif /* _RobusHAL_CONFIG_H_ */ diff --git a/network/robus/HAL/STM32G4/robus_hal_config.h b/network/robus/HAL/STM32G4/robus_hal_config.h index 4b2e84a4a..74277b865 100644 --- a/network/robus/HAL/STM32G4/robus_hal_config.h +++ b/network/robus/HAL/STM32G4/robus_hal_config.h @@ -12,6 +12,7 @@ #include "stm32g4xx_hal.h" +#define _CRITICAL #define DISABLE 0x00 // If your MCU do not Have DMA for tx transmit define USE_TX_IT diff --git a/network/robus/HAL/STM32L0/robus_hal_config.h b/network/robus/HAL/STM32L0/robus_hal_config.h index fe1c3cb5e..193d90d52 100644 --- a/network/robus/HAL/STM32L0/robus_hal_config.h +++ b/network/robus/HAL/STM32L0/robus_hal_config.h @@ -12,6 +12,7 @@ #include "stm32l0xx_hal.h" +#define _CRITICAL #define DISABLE 0x00 // If your MCU do not Have DMA for tx transmit define USE_TX_IT @@ -152,4 +153,4 @@ #define LUOS_TIMER_IRQHANDLER() TIM6_DAC_IRQHandler() #endif -#endif /* _RobusHAL_CONFIG_H_ */ \ No newline at end of file +#endif /* _RobusHAL_CONFIG_H_ */ diff --git a/network/robus/HAL/STM32L4/robus_hal_config.h b/network/robus/HAL/STM32L4/robus_hal_config.h index e26ca9c86..f9d0f992b 100644 --- a/network/robus/HAL/STM32L4/robus_hal_config.h +++ b/network/robus/HAL/STM32L4/robus_hal_config.h @@ -12,6 +12,7 @@ #include "stm32l4xx_hal.h" +#define _CRITICAL #define DISABLE 0x00 // If your MCU do not Have DMA for tx transmit define USE_TX_IT diff --git a/network/robus/HAL/STUB/robus_hal_config.h b/network/robus/HAL/STUB/robus_hal_config.h index 0a5ebc2db..9e5394e34 100644 --- a/network/robus/HAL/STUB/robus_hal_config.h +++ b/network/robus/HAL/STUB/robus_hal_config.h @@ -13,6 +13,7 @@ // STUB Value for x86 stub only #define X86_STUB 0x00 +#define _CRITICAL #define DISABLE 0x00 // If your MCU do not Have DMA for tx transmit define USE_TX_IT diff --git a/network/robus/HAL/template/robus_hal_config.h b/network/robus/HAL/template/robus_hal_config.h index a3964f136..76046d924 100644 --- a/network/robus/HAL/template/robus_hal_config.h +++ b/network/robus/HAL/template/robus_hal_config.h @@ -12,6 +12,7 @@ // include main sdk files relative to your MCU family +#define _CRITICAL #define DISABLE 0x00 // If your MCU do not Have DMA for tx transmit define USE_TX_IT diff --git a/network/robus/inc/reception.h b/network/robus/inc/reception.h index bfe7bb32c..5cc499685 100644 --- a/network/robus/inc/reception.h +++ b/network/robus/inc/reception.h @@ -9,8 +9,6 @@ #include #include "luos_phy.h" -#include "struct_io.h" -#include "luos_io.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/network/robus/inc/robus.h b/network/robus/inc/robus.h index 2db25fb2e..2b4e2850e 100644 --- a/network/robus/inc/robus.h +++ b/network/robus/inc/robus.h @@ -16,8 +16,6 @@ void Robus_Init(void); void Robus_Loop(void); -error_return_t Robus_SetTxTask(service_t *service, msg_t *msg); - void Robus_SaveNodeID(uint16_t nodeid); void Robus_ResetNodeID(void); bool Robus_Busy(void); diff --git a/network/robus/inc/transmission.h b/network/robus/inc/transmission.h index 82c44bf70..df1cd3f3b 100644 --- a/network/robus/inc/transmission.h +++ b/network/robus/inc/transmission.h @@ -7,8 +7,9 @@ #ifndef _TRANSMISSION_H_ #define _TRANSMISSION_H_ -#include "struct_io.h" #include +#include "luos_phy.h" +#include "robus_config.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -23,10 +24,26 @@ typedef enum typedef struct { volatile uint8_t lock; // Transmit lock state - uint8_t *data; // data to compare for collision detection - volatile transmitStatus_t status; // data to compare for collision detection + const uint8_t *data; // data to compare for collision detection + volatile transmitStatus_t status; // status of the transmission volatile uint8_t collision; // true is a collision occure during this transmission. } TxCom_t; + +typedef struct __attribute__((__packed__)) +{ + union + { + struct __attribute__((__packed__)) + { + time_luos_t timestamp; + uint16_t timestamped_crc; + }; // This form is used if there is a timestamp in the message. + uint16_t crc; // This form is used if there is no timestamp in the message. + uint8_t unmaped[sizeof(time_luos_t) + CRC_SIZE]; // This form is used to access the last part to transmit as an array of bytes. + }; + uint16_t size; +} robus_encaps_t; + /******************************************************************************* * Variables ******************************************************************************/ @@ -35,7 +52,7 @@ typedef struct * Function ******************************************************************************/ void Transmit_Init(void); -uint16_t ll_crc_compute(uint8_t *, uint16_t, uint16_t); +uint16_t ll_crc_compute(const uint8_t *data, uint16_t size, uint16_t crc_seed); void Transmit_SendAck(void); void Transmit_Process(void); void Transmit_End(void); diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index 8298ba687..d5b24e27a 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -44,8 +44,6 @@ #include #include "reception.h" #include "robus_hal.h" -#include "luos_hal.h" -#include "luos_utils.h" #include "robus.h" #include "context.h" /******************************************************************************* @@ -70,7 +68,6 @@ uint16_t crc_val = 0; // CRC value /******************************************************************************* * Function ******************************************************************************/ -static inline bool Recep_IsAckNeeded(luos_phy_t *phy_robus); static inline bool Recep_RobusShouldDrop(header_t *header); /****************************************************************************** * @brief Reception init. @@ -142,7 +139,7 @@ _CRITICAL void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data) // We complete the header reception, we need to compute all the needed values. // Compute message header size, keep, ... the result will be available in phy_robus->rx_size, ... - Phy_Computeheader(phy_robus); + Phy_ComputeHeader(phy_robus); } break; @@ -179,7 +176,7 @@ _CRITICAL void Recep_GetData(luos_phy_t *phy_robus, volatile uint8_t *data) { // Message is OK // Check if we need to send an ack - if (Recep_IsAckNeeded(phy_robus)) + if ((phy_robus->rx_ack == true) && (phy_robus->rx_keep == true)) { // Send an Ack Transmit_SendAck(); @@ -190,7 +187,7 @@ _CRITICAL void Recep_GetData(luos_phy_t *phy_robus, volatile uint8_t *data) else { ctx.rx.status.rx_error = true; - if (Recep_IsAckNeeded(phy_robus)) + if ((phy_robus->rx_ack == true) && (phy_robus->rx_keep == true)) { Transmit_SendAck(); } @@ -226,7 +223,7 @@ _CRITICAL void Recep_GetCollision(luos_phy_t *phy_robus, volatile uint8_t *data) // Save the received data into the allocator to be able to continue the reception for (uint8_t i = 0; i < data_count - 1; i++) { - Recep_GetHeader(phy_robus, &ctx.tx.data[i]); + Recep_GetHeader(phy_robus, (volatile uint8_t *)&ctx.tx.data[i]); } Recep_GetHeader(phy_robus, data); // Switch to get header. @@ -344,21 +341,3 @@ _CRITICAL static inline bool Recep_RobusShouldDrop(header_t *header) } return false; } - -/****************************************************************************** - * @brief Check if we need to send an ack - * @param None - * @return true or false - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL static inline bool Recep_IsAckNeeded(luos_phy_t *phy_robus) -{ - header_t *header = (header_t *)(phy_robus->rx_buffer_base); - // Check the mode of the message received - if (((header->target_mode == SERVICEIDACK) || (header->target_mode == NODEIDACK)) && (phy_robus->rx_keep == true)) - { - // If the message is a serviceidack or nodeidack and we keep it we need to send an ack - return true; - } - return false; -} diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index 6a313d442..44ff4edc7 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -4,24 +4,19 @@ * @author Luos * @version 0.0.0 ******************************************************************************/ -#include - #include #include +#include "robus.h" #include "transmission.h" #include "reception.h" #include "port_manager.h" #include "context.h" #include "robus_hal.h" -#include "luos_hal.h" -#include "luos_utils.h" - -#include "msg_alloc.h" -#include "luos_engine.h" -#include "filter.h" +#include "robus_config.h" /******************************************************************************* * Definitions ******************************************************************************/ +static void Robus_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job); /******************************************************************************* * Variables @@ -29,6 +24,7 @@ // Creation of the robus context. This variable is used in all files of this lib. volatile context_t ctx; luos_phy_t *phy_robus; +robus_encaps_t encaps[MAX_MSG_NB]; // Store all the CRC for each msg to transmit. /******************************************************************************* * Function @@ -51,7 +47,7 @@ void Robus_Init(void) Transmit_Init(); // Instantiate the phy struct - phy_robus = Phy_Create(); + phy_robus = Phy_Create(Robus_MsgHandler); LUOS_ASSERT(phy_robus); // Init reception @@ -69,72 +65,32 @@ void Robus_Loop(void) } /****************************************************************************** - * @brief Formalize message Set tx task and send - * @param service to send - * @param msg to send - * @return error_return_t + * @brief Robus message handler + * @param phy_ptr + * @param job + * @return None ******************************************************************************/ -error_return_t Robus_SetTxTask(service_t *service, msg_t *msg) +void Robus_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job) { - error_return_t error = SUCCEED; - uint8_t ack = 0; - uint16_t data_size = 0; - uint16_t crc_val = 0xFFFF; - // *************************************************** - // Don't send luos messages if network is down - // *************************************************** - if ((msg->header.cmd >= LUOS_LAST_RESERVED_CMD) && (Node_GetState() != DETECTION_OK)) - { - return PROHIBITED; - } - - // Compute the full message size based on the header size info. - if (msg->header.size > MAX_DATA_MSG_SIZE) - { - data_size = MAX_DATA_MSG_SIZE; - } - else - { - data_size = msg->header.size; - } - - // Check the localhost situation - luos_localhost_t localhost = Filter_GetLocalhost(&msg->header); - // Add the CRC to the total size of the message - uint16_t full_size = sizeof(header_t) + data_size + CRC_SIZE; + static uint8_t encaps_index = 0; + // Luos ask Robus to send a message - uint16_t crc_max_index = full_size; + // Compute the CRC and create the encapsulation context + encaps[encaps_index].crc = ll_crc_compute(job->data_pt, job->size, 0xFFFF); + encaps[encaps_index].size = CRC_SIZE; - if (Luos_IsMsgTimstamped(msg) == true) - { - full_size += sizeof(time_luos_t); - } - // Compute the CRC - crc_val = ll_crc_compute(&msg->stream[0], crc_max_index - CRC_SIZE, 0xFFFF); + // Save the precomputed encapsulation in the job + job->phy_data = (void *)&encaps[encaps_index]; - // Check if ACK needed - if (((msg->header.target_mode == SERVICEIDACK) || (msg->header.target_mode == NODEIDACK)) && (localhost != EXTERNALHOST)) + // Get the next encapsulation index for the next job + encaps_index++; + if (encaps_index >= MAX_MSG_NB) { - // This is a localhost message and we need to transmit a ack. Add it at the end of the data to transmit - ack = ctx.rx.status.unmap; - full_size++; + encaps_index = 0; } - // ********** Allocate the message ******************** - if (MsgAlloc_SetTxTask(service, (uint8_t *)msg->stream, crc_val, full_size, localhost, ack) == FAILED) - { - error = FAILED; - } -// **********Try to send the message******************** -#ifndef VERBOSE_LOCALHOST - if (localhost != LOCALHOST) - { -#endif - Transmit_Process(); -#ifndef VERBOSE_LOCALHOST - } -#endif - return error; + // Then, try to directly transmit... Who knows perhaps the line is free + Transmit_Process(); } /****************************************************************************** diff --git a/network/robus/src/transmission.c b/network/robus/src/transmission.c index fb326df39..45fefe952 100644 --- a/network/robus/src/transmission.c +++ b/network/robus/src/transmission.c @@ -41,17 +41,12 @@ * ************************************************************************************************************************************/ -#include - -#include "robus_hal.h" -#include "luos_hal.h" #include #include +#include "transmission.h" +#include "robus_hal.h" #include "context.h" #include "reception.h" -#include "msg_alloc.h" -#include "_timestamp.h" -#include "luos_engine.h" /******************************************************************************* * Definitions @@ -61,12 +56,12 @@ * Variables ******************************************************************************/ volatile uint8_t nbrRetry = 0; +robus_encaps_t *end = NULL; /******************************************************************************* * Function ******************************************************************************/ _CRITICAL static uint8_t Transmit_GetLockStatus(void); - /****************************************************************************** * @brief Transmit_Init * @param None @@ -104,7 +99,7 @@ _CRITICAL void Transmit_SendAck(void) * @param crc initialization value * @return crc ******************************************************************************/ -uint16_t ll_crc_compute(uint8_t *data, uint16_t size, uint16_t crc_seed) +uint16_t ll_crc_compute(const uint8_t *data, uint16_t size, uint16_t crc_seed) { uint16_t crc_val = crc_seed; for (uint16_t i = 0; i < size; i++) @@ -129,35 +124,33 @@ uint16_t ll_crc_compute(uint8_t *data, uint16_t size, uint16_t crc_seed) ******************************************************************************/ _CRITICAL void Transmit_Process() { - uint8_t *data = 0; - uint16_t size; - service_t *service_pt; - if ((MsgAlloc_GetTxTask(&service_pt, &data, &size) == SUCCEED) && (Transmit_GetLockStatus() == false)) + static uint16_t crc_val = 0; + luos_phy_t *robus_phy = Robus_GetPhy(); + phy_job_t *job = Phy_GetJob(robus_phy); + static uint8_t tx_data[sizeof(msg_t) + sizeof(robus_encaps_t)]; + // Get the message encapsulation + if ((job != NULL) && (Transmit_GetLockStatus() == false)) { + robus_encaps_t *encaps = (robus_encaps_t *)job->phy_data; // We have something to send // Check if we already try to send it multiple times and save it on stats if it is - if ((service_pt->statistics.max_retry < nbrRetry) || (nbrRetry >= NBR_RETRY)) + if (nbrRetry >= NBR_RETRY) { - service_pt->statistics.max_retry = nbrRetry; - if (nbrRetry >= NBR_RETRY) + // We failed to transmit this message. We can't allow it, there is an issue on this target. + Phy_DeadTargetSpotted(robus_phy, job); + nbrRetry = 0; + ctx.tx.collision = false; + // Try to get a new job + job = Phy_GetJob(robus_phy); + if (job == NULL) { - // We failed to transmit this message. We can't allow it, there is a issue on this target. - service_pt->dead_service_spotted = (uint16_t)(((msg_t *)data)->header.target); - nbrRetry = 0; - ctx.tx.collision = false; - // Remove all transmist messages of this specific target - MsgAlloc_PullServiceFromTxTask((uint16_t)(((msg_t *)data)->header.target)); - // Try to get a tx_task for another service - if (MsgAlloc_GetTxTask(&service_pt, &data, &size) == FAILED) - { - // Nothing to transmit anymore, just exit. - return; - } + // Nothing to transmit anymore, just exit. + return; } } - // Check if we will need an ACK for this message and compute the transmit status we will need to manage it + // Check if we will need an ACK for this message and compute the transmit status we will need to manage transmitStatus_t initial_transmit_status = TX_OK; - if (((((msg_t *)data)->header.target_mode == SERVICEIDACK) || (((msg_t *)data)->header.target_mode == NODEIDACK))) + if (job->ack == true) { // We will need to validate the good reception with a ack. // Switch the tx status as TX_NOK allowing to detect a default at the next Timeout if no ACK have been received. @@ -167,7 +160,7 @@ _CRITICAL void Transmit_Process() if (Transmit_GetLockStatus() == false) { // We are free to transmit - // We will prepare to transmit something enable tx status with precomputed value if we need ACK + // We will prepare to transmit something enable tx status with precomputed value of the initial_transmit_status ctx.tx.status = initial_transmit_status; // Lock the bus ctx.tx.lock = true; @@ -176,35 +169,38 @@ _CRITICAL void Transmit_Process() LuosHAL_SetIrqState(false); ctx.rx.callback = Recep_GetCollision; LuosHAL_SetIrqState(true); - ctx.tx.data = data; + ctx.tx.data = tx_data; + + if (!nbrRetry) + { + // This is the first time we try to send this message, we need to backup the original crc value and the job data to the TX_data buffer + crc_val = encaps->crc; + memcpy(tx_data, job->data_pt, job->size); + } // Put timestamping on data here - if (Luos_IsMsgTimstamped((msg_t *)data) && (!nbrRetry)) + if (job->timestamp) { - // Convert date to latency - Timestamp_ConvertToLatency((msg_t *)data); - // Complete the CRC computation with the latency - msg_t *msg = (msg_t *)data; - uint16_t full_size = sizeof(header_t) + msg->header.size + sizeof(time_luos_t) + CRC_SIZE; - uint16_t index_without_timestamp = sizeof(header_t) + msg->header.size; - uint16_t crc_seed = 0; - memcpy(&crc_seed, &msg->stream[full_size - CRC_SIZE], CRC_SIZE); - uint16_t crc_val = ll_crc_compute(&msg->stream[index_without_timestamp], full_size - CRC_SIZE - index_without_timestamp, crc_seed); + // Convert date to a sendable timestamp and put it on the encapsulation + encaps->timestamp = Phy_ComputeTimestamp(job); - // copy crc in message - memcpy(&msg->stream[full_size - CRC_SIZE], &crc_val, CRC_SIZE); + encaps->timestamped_crc = ll_crc_compute(encaps->unmaped, sizeof(time_luos_t), crc_val); + encaps->size = sizeof(time_luos_t) + CRC_SIZE; } // Transmit data - if (MsgAlloc_TxAllComplete() == FAILED) + if (Phy_GetJobNbr(robus_phy) != 0) { - // There is no more task to send. the network have been reseted - RobusHAL_ComTransmit(data, size); + // Add the end of the message in the end of the buffer + memcpy(&tx_data[job->size], encaps->unmaped, encaps->size); + // We still have something to send, no reset occured + RobusHAL_ComTransmit(tx_data, (job->size + encaps->size)); } } } } + /****************************************************************************** * @brief Send ID to others service on network * @param None @@ -219,6 +215,7 @@ _CRITICAL static uint8_t Transmit_GetLockStatus(void) } return ctx.tx.lock; } + /****************************************************************************** * @brief finish transmit and try to launch a new one * @param None @@ -229,19 +226,21 @@ _CRITICAL void Transmit_End(void) { if (ctx.tx.status == TX_OK) { - // A tx_task have been sucessfully transmitted + // A job have been sucessfully transmitted nbrRetry = 0; ctx.tx.collision = false; ctx.tx.status = TX_DISABLE; - // Remove the task - MsgAlloc_PullMsgFromTxTask(); + // Remove the job + luos_phy_t *robus_phy = Robus_GetPhy(); + phy_job_t *job = Phy_GetJob(robus_phy); + Phy_RmJob(robus_phy, job); } else if (ctx.tx.status == TX_NOK) { // A tx_task failed nbrRetry++; // compute a delay before retry - RobusHAL_ResetTimeout(20 * nbrRetry * (Node_Get()->node_id + 1)); + RobusHAL_ResetTimeout(20 * nbrRetry * (Phy_GetNodeId() + 1)); // Lock the trasmission to be sure no one can send something from this node. ctx.tx.lock = true; ctx.tx.status = TX_DISABLE; @@ -250,4 +249,4 @@ _CRITICAL void Transmit_End(void) ctx.tx.lock = false; // Try to send something if we need to. Transmit_Process(); -} \ No newline at end of file +} diff --git a/test/_resources/Scenarios/default_scenario.c b/test/_resources/Scenarios/default_scenario.c index aa895d96d..54cf5eba6 100644 --- a/test/_resources/Scenarios/default_scenario.c +++ b/test/_resources/Scenarios/default_scenario.c @@ -16,9 +16,9 @@ default_scenario_t default_sc; * Function ******************************************************************************/ static void Detection(service_t *service); -static void App_1_MsgHandler(service_t *service, msg_t *msg); -static void App_2_MsgHandler(service_t *service, msg_t *msg); -static void App_3_MsgHandler(service_t *service, msg_t *msg); +static void App_1_MsgHandler(service_t *service, const msg_t *msg); +static void App_2_MsgHandler(service_t *service, const msg_t *msg); +static void App_3_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief Init scenario @@ -85,7 +85,7 @@ static void Detection(service_t *service) * @param Msg receive * @return None ******************************************************************************/ -static void App_1_MsgHandler(service_t *service, msg_t *msg) +static void App_1_MsgHandler(service_t *service, const msg_t *msg) { memcpy(&default_sc.App_1.last_rx_msg, msg, sizeof(msg_t)); } @@ -96,7 +96,7 @@ static void App_1_MsgHandler(service_t *service, msg_t *msg) * @param Msg receive * @return None ******************************************************************************/ -static void App_2_MsgHandler(service_t *service, msg_t *msg) +static void App_2_MsgHandler(service_t *service, const msg_t *msg) { memcpy(&default_sc.App_2.last_rx_msg, msg, sizeof(msg_t)); } @@ -107,7 +107,7 @@ static void App_2_MsgHandler(service_t *service, msg_t *msg) * @param Msg receive * @return None ******************************************************************************/ -static void App_3_MsgHandler(service_t *service, msg_t *msg) +static void App_3_MsgHandler(service_t *service, const msg_t *msg) { memcpy(&default_sc.App_3.last_rx_msg, msg, sizeof(msg_t)); } diff --git a/test/_resources/Unity/unit_test.h b/test/_resources/Unity/unit_test.h index 7f8d759dd..0acbe0b55 100644 --- a/test/_resources/Unity/unit_test.h +++ b/test/_resources/Unity/unit_test.h @@ -9,7 +9,6 @@ #include "robus_hal.h" #include "luos_engine.h" #include "luos_utils.h" -#include "struct_io.h" #include /******************************************************************************* @@ -36,6 +35,8 @@ extern bool try_state; #define CATCH else +#define END_TRY try_state = false + /******************************************************************************* * Function ******************************************************************************/ diff --git a/test/example_build.py b/test/example_build.py index 4cb1d20f6..80405d4c2 100755 --- a/test/example_build.py +++ b/test/example_build.py @@ -48,7 +48,6 @@ def compile_example(cmd, target, example, clean): if clean: subprocess.call(cmd + " --target clean", shell=True, stdout=open(os.devnull, 'wb'), stderr=open(os.devnull, 'wb')) - print("done") if subprocess.call(cmd, shell=True, stdout=open(os.devnull, 'wb'), stderr=open(os.devnull, 'wb')): with compiled_example.get_lock(): compiled_example.value += 1 diff --git a/test/test_luos/main.c b/test/test_luos/main.c index d6b56a3f5..8d793fb14 100644 --- a/test/test_luos/main.c +++ b/test/test_luos/main.c @@ -158,8 +158,12 @@ void unittest_Luos_ReceiveData() Init_Context(); msg_t msg; uint32_t bin_data[64] = {0xDEADBEEF}; - NEW_STEP("Verify if we return an error"); - TEST_ASSERT_EQUAL(Luos_ReceiveData((service_t *)10, &msg, bin_data), -1); + TRY + { + NEW_STEP("Verify if we Assert"); + Luos_ReceiveData((service_t *)10, &msg, bin_data); + } + TEST_ASSERT_TRUE(IS_ASSERT()); } NEW_TEST_CASE("Test the regular usage"); diff --git a/test/test_msg_alloc/main.c b/test/test_msg_alloc/main.c index f3762bf3f..035763255 100644 --- a/test/test_msg_alloc/main.c +++ b/test/test_msg_alloc/main.c @@ -7,42 +7,18 @@ int main(int argc, char **argv) UNITY_BEGIN(); // Static functions - UNIT_TEST_RUN(unittest_DoWeHaveSpace); - UNIT_TEST_RUN(unittest_CheckMsgSpace); + + UNIT_TEST_RUN(unittest_SlotPack); + UNIT_TEST_RUN(unittest_GetOldestMsg); UNIT_TEST_RUN(unittest_BufferAvailableSpaceComputation); - UNIT_TEST_RUN(unittest_OldestMsgCandidate); - UNIT_TEST_RUN(unittest_ClearMsgTask); - UNIT_TEST_RUN(unittest_ClearLuosTask); - UNIT_TEST_RUN(unittest_ClearMsgSpace); + UNIT_TEST_RUN(unittest_DoWeHaveSpaceUntilBufferEnd); + UNIT_TEST_RUN(unittest_CheckMsgSpace); // Generic functions - UNIT_TEST_RUN(unittest_MsgAlloc_loop); + UNIT_TEST_RUN(unittest_MsgAlloc_Loop); UNIT_TEST_RUN(unittest_MsgAlloc_Alloc); UNIT_TEST_RUN(unittest_MsgAlloc_IsEmpty); - UNIT_TEST_RUN(unittest_MsgAlloc_UsedMsgEnd); - UNIT_TEST_RUN(unittest_MsgAlloc_GetLuosTaskSourceId); - UNIT_TEST_RUN(unittest_MsgAlloc_GetLuosTaskCmd); - UNIT_TEST_RUN(unittest_MsgAlloc_GetLuosTaskSize); - UNIT_TEST_RUN(unittest_MsgAlloc_TxAllComplete); - UNIT_TEST_RUN(unittest_MsgAlloc_PullMsgToInterpret); - UNIT_TEST_RUN(unittest_MsgAlloc_LuosTaskAlloc); - UNIT_TEST_RUN(unittest_MsgAlloc_LuosTasksNbr); - UNIT_TEST_RUN(unittest_MsgAlloc_PullMsg); - UNIT_TEST_RUN(unittest_MsgAlloc_PullMsgFromLuosTask); - UNIT_TEST_RUN(unittest_MsgAlloc_LookAtLuosTask); - UNIT_TEST_RUN(unittest_MsgAlloc_ClearMsgFromLuosTasks); - UNIT_TEST_RUN(unittest_MsgAlloc_PullMsgFromTxTask); - UNIT_TEST_RUN(unittest_MsgAlloc_PullServiceFromTxTask); - UNIT_TEST_RUN(unittest_MsgAlloc_GetTxTask); + UNIT_TEST_RUN(unittest_MsgAlloc_Free); - // Tx functions - UNIT_TEST_RUN(unittest_SetTxTask_buffer_full); - UNIT_TEST_RUN(unittest_SetTxTask_Tx_too_long); - UNIT_TEST_RUN(unittest_SetTxTask_Tx_overflow); - UNIT_TEST_RUN(unittest_SetTxTask_Tx_fit); - UNIT_TEST_RUN(unittest_SetTxTask_Task_already_exists); - UNIT_TEST_RUN(unittest_SetTxTask_ACK); - UNIT_TEST_RUN(unittest_SetTxTask_internal_localhost); - UNIT_TEST_RUN(unittest_SetTxTask_multihost); UNITY_END(); } diff --git a/test/test_msg_alloc/main.h b/test/test_msg_alloc/main.h index def9a9541..007eccbbf 100644 --- a/test/test_msg_alloc/main.h +++ b/test/test_msg_alloc/main.h @@ -2,42 +2,16 @@ #define MAIN_H // Static functions -void unittest_DoWeHaveSpace(void); -void unittest_CheckMsgSpace(void); +void unittest_SlotPack(void); +void unittest_GetOldestMsg(void); void unittest_BufferAvailableSpaceComputation(void); -void unittest_OldestMsgCandidate(void); -void unittest_ClearMsgTask(void); -void unittest_ClearLuosTask(void); -void unittest_ClearMsgSpace(void); +void unittest_DoWeHaveSpaceUntilBufferEnd(void); +void unittest_CheckMsgSpace(void); -// Generic functions -void unittest_MsgAlloc_loop(void); +// public functions +void unittest_MsgAlloc_Loop(void); void unittest_MsgAlloc_Alloc(void); void unittest_MsgAlloc_IsEmpty(void); -void unittest_MsgAlloc_UsedMsgEnd(void); -void unittest_MsgAlloc_GetLuosTaskSourceId(void); -void unittest_MsgAlloc_GetLuosTaskCmd(void); -void unittest_MsgAlloc_GetLuosTaskSize(void); -void unittest_MsgAlloc_TxAllComplete(void); -void unittest_MsgAlloc_PullMsgToInterpret(void); -void unittest_MsgAlloc_LuosTaskAlloc(void); -void unittest_MsgAlloc_LuosTasksNbr(void); -void unittest_MsgAlloc_PullMsg(void); -void unittest_MsgAlloc_PullMsgFromLuosTask(void); -void unittest_MsgAlloc_LookAtLuosTask(void); -void unittest_MsgAlloc_ClearMsgFromLuosTasks(void); -void unittest_MsgAlloc_PullMsgFromTxTask(void); -void unittest_MsgAlloc_PullServiceFromTxTask(void); -void unittest_MsgAlloc_GetTxTask(void); - -// Tx functions -void unittest_SetTxTask_buffer_full(void); -void unittest_SetTxTask_Tx_too_long(void); -void unittest_SetTxTask_Tx_overflow(void); -void unittest_SetTxTask_Tx_fit(void); -void unittest_SetTxTask_Task_already_exists(void); -void unittest_SetTxTask_ACK(void); -void unittest_SetTxTask_internal_localhost(void); -void unittest_SetTxTask_multihost(void); +void unittest_MsgAlloc_Free(void); -#endif // MAIN_H \ No newline at end of file +#endif // MAIN_H diff --git a/test/test_msg_alloc/unit_test_mem_alloc.c b/test/test_msg_alloc/unit_test_mem_alloc.c new file mode 100644 index 000000000..e9ac151f9 --- /dev/null +++ b/test/test_msg_alloc/unit_test_mem_alloc.c @@ -0,0 +1,770 @@ +#include "main.h" +#include "unit_test.h" +#include "../src/msg_alloc.c" + +/******************************************************************************* + * Static Function + ******************************************************************************/ + +void unittest_SlotPack(void) +{ + uint8_t data = 0; + // This funciton should reorganize the buffer to pack the messages + // Create a already organized buffer with a random data + + NEW_TEST_CASE("Check if we assert when allocating more than the buffer size"); + { + alloc_slot_index = MAX_MSG_NB + 1; + TRY + { + MsgAlloc_SlotPack(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check if an already organized buffer is not modified"); + { + alloc_slots[0].data = &data; + alloc_slots[1].data = &data; + alloc_slots[2].data = &data; + alloc_slots[3].data = &data; + alloc_slots[4].data = 0; + alloc_slot_index = 4; + MsgAlloc_SlotPack(); + TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[3].data); + TEST_ASSERT_EQUAL(0, alloc_slots[4].data); + TEST_ASSERT_EQUAL(4, alloc_slot_index); + } + + NEW_TEST_CASE("Check if an unorganized buffer is organized"); + { + alloc_slots[0].data = 0; + alloc_slots[1].data = &data; + alloc_slots[2].data = &data; + alloc_slots[3].data = 0; + alloc_slots[4].data = 0; + alloc_slots[5].data = 0; + alloc_slots[6].data = &data; + alloc_slots[7].data = 0; + alloc_slot_index = 8; + MsgAlloc_SlotPack(); + TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); + TEST_ASSERT_EQUAL(0, alloc_slots[3].data); + TEST_ASSERT_EQUAL(0, alloc_slots[4].data); + TEST_ASSERT_EQUAL(0, alloc_slots[5].data); + TEST_ASSERT_EQUAL(0, alloc_slots[6].data); + TEST_ASSERT_EQUAL(0, alloc_slots[7].data); + TEST_ASSERT_EQUAL(3, alloc_slot_index); + } + + NEW_TEST_CASE("Check how it's managing the buffer to it's limits"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = 0; + alloc_slots[1].data = &data; + alloc_slots[2].data = &data; + alloc_slots[3].data = 0; + alloc_slots[4].data = 0; + alloc_slots[5].data = 0; + alloc_slots[6].data = &data; + alloc_slots[MAX_MSG_NB - 1].data = &data; + alloc_slot_index = MAX_MSG_NB; + MsgAlloc_SlotPack(); + TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[3].data); + TEST_ASSERT_EQUAL(0, alloc_slots[4].data); + TEST_ASSERT_EQUAL(0, alloc_slots[5].data); + TEST_ASSERT_EQUAL(0, alloc_slots[6].data); + TEST_ASSERT_EQUAL(0, alloc_slots[7].data); + TEST_ASSERT_EQUAL(0, alloc_slots[MAX_MSG_NB - 1].data); + TEST_ASSERT_EQUAL(4, alloc_slot_index); + } +} + +void unittest_GetOldestMsg(void) +{ + NEW_TEST_CASE("Check if we assert when allocating more than the buffer size"); + { + alloc_slot_index = MAX_MSG_NB + 1; + TRY + { + MsgAlloc_GetOldestMsg(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check the behavior if we dont have any message"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + TEST_ASSERT_EQUAL(0, MsgAlloc_GetOldestMsg()); + } + + NEW_TEST_CASE("Check the behavior if we have a message in the first slot"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)0x1; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } + + NEW_TEST_CASE("Check the behavior if we have a message in another place"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[3].data = (uint8_t *)0x1; + alloc_slot_index = 4; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } + + NEW_TEST_CASE("Check the behavior if we have a message in the last slot"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x1; + alloc_slot_index = MAX_MSG_NB; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } + + NEW_TEST_CASE("Check the behavior if we have a message in the last slot and the first one"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)0x1; + alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x2; + alloc_slot_index = MAX_MSG_NB; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } + + NEW_TEST_CASE("Check the behavior if we have a message in the last slot and the first one"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)0x1; + alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x2; + alloc_slot_index = MAX_MSG_NB; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } +} + +void unittest_BufferAvailableSpaceComputation(void) +{ + // This computation is based on the computed oldest message and the data ptr + NEW_TEST_CASE("Check if we assert when data_ptr is out of the buffer"); + { + alloc_slots[0].data = 0; + TRY + { + MsgAlloc_BufferAvailableSpaceComputation(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE]; + TRY + { + MsgAlloc_BufferAvailableSpaceComputation(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check if we assert when olest_msg is out of the buffer"); + { + + TRY + { + MsgAlloc_BufferAvailableSpaceComputation(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + data_ptr = &msg_buffer[MSG_BUFFER_SIZE]; + TRY + { + MsgAlloc_BufferAvailableSpaceComputation(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + } + + NEW_TEST_CASE("Check the result if we don't have any messages"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + data_ptr = (uint8_t *)&msg_buffer[0]; + TEST_ASSERT_EQUAL(MSG_BUFFER_SIZE, MsgAlloc_BufferAvailableSpaceComputation()); + } + + NEW_TEST_CASE("Check the result in a situation we don't have to loop around the buffer end"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + data_ptr = (uint8_t *)&msg_buffer[0]; + TEST_ASSERT_EQUAL(10, MsgAlloc_BufferAvailableSpaceComputation()); + } + + NEW_TEST_CASE("Check the result in a situation we have to loop around the buffer end"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; + TEST_ASSERT_EQUAL(20, MsgAlloc_BufferAvailableSpaceComputation()); + } + + NEW_TEST_CASE("Check the result in a situation we have to loop around the buffer end and data_ptr is set to the begin of the buffer"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; + TEST_ASSERT_EQUAL(10, MsgAlloc_BufferAvailableSpaceComputation()); + } +} + +void unittest_DoWeHaveSpaceUntilBufferEnd(void) +{ + // In this specific function we may have a pointer after the end of the buffer but never before + + NEW_TEST_CASE("Check if we assert when to pointer is before the buffer"); + { + TRY + { + MsgAlloc_DoWeHaveSpaceUntilBufferEnd(0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check if it return SUCCEED when the pointer is in the buffer"); + { + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[0])); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } + + NEW_TEST_CASE("Check if it return FAILED when the pointer is after the buffer"); + { + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE])); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE + 1])); + } +} + +void unittest_CheckMsgSpace(void) +{ + NEW_TEST_CASE("Check if we assert when from pointer is after the to pointer or at the same place"); + { + TRY + { + MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[0]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[1], (uint8_t *)&msg_buffer[0]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + } + + NEW_TEST_CASE("Check if we assert when one of the pointer is out of the buffer"); + { + TRY + { + MsgAlloc_CheckMsgSpace(0, (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE + 1], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1], 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check the result if we don't have any message yet"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } + + NEW_TEST_CASE("Check the result if we have one message and the new one is before the old one"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[9])); + } + + NEW_TEST_CASE("Check the result if we have one message and the new one is after the old one"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[11], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } + + NEW_TEST_CASE("Check the result if we have one message and the new one is in the middle of the old one"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } + + NEW_TEST_CASE("Check the result if we have one message and the new one is at the end of the old one"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[10])); + } + + NEW_TEST_CASE("Check the result if we have one message and the new one is at the beginning of the old one"); + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[10], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } +} + +/******************************************************************************* + * Public Function + ******************************************************************************/ + +void unittest_MsgAlloc_Loop() +{ + NEW_TEST_CASE("Verify buffer occupation rate stat computing"); + MsgAlloc_Init(NULL); + { + // data_ptr is incremented : buffer occupation computing is verified + // + // msg_buffer + // +-------------------------------------------------------------+ + // |-------------------------------------------------------------| + // ^-------------------------^---------------------^-------------+ + // | | | + // data_ptr data_ptr data_ptr + // (0% occupation) (X% occupation) (etc...) + // + + // Init variables + //--------------- + uint32_t expected_buffer_occupation_ratio; + memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, + .engine_msg_stack_ratio = 0, + .tx_msg_stack_ratio = 0, + .buffer_occupation_ratio = 0, + .msg_drop_number = 0}; + + memset(&memory_stats, 0, sizeof(memory_stats)); + MsgAlloc_Init(&memory_stats); + data_ptr = &msg_buffer[0]; + + // Call function and Verify + //--------------------------- + // Empty buffer + expected_buffer_occupation_ratio = 0; + MsgAlloc_Loop(); + + NEW_STEP("Check that the buffer is empty"); + TEST_ASSERT_EQUAL(0, memory_stats.buffer_occupation_ratio); + + // Buffer occupation from 0 -> 100% + NEW_STEP("Check buffer is full in all cases"); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + for (uint16_t i = 1; i < MSG_BUFFER_SIZE; i++) + { + data_ptr = &msg_buffer[i]; + expected_buffer_occupation_ratio = (i * 100) / (MSG_BUFFER_SIZE); + + MsgAlloc_Loop(); + + TEST_ASSERT_EQUAL(expected_buffer_occupation_ratio, memory_stats.buffer_occupation_ratio); + } + } +} + +void unittest_MsgAlloc_Alloc() +{ + + NEW_TEST_CASE("Check if we assert when we try to allocate a message with no size and/or no phy"); + { + TRY + { + MsgAlloc_Alloc(0, 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_Alloc(1, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_Alloc(0, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check if we assert when we try to allocate a message with a size > MSG_BUFFER_SIZE"); + { + TRY + { + MsgAlloc_Alloc(MSG_BUFFER_SIZE + 1, 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check an allocation with no message already registered"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + data_ptr = &msg_buffer[0]; + TEST_ASSERT_EQUAL(&msg_buffer[0], MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check an allocation with one message already registered"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[10]; + TEST_ASSERT_EQUAL(&msg_buffer[10], MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check an allocation with two messages already registered"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slots[1].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 2; + data_ptr = &msg_buffer[20]; + TEST_ASSERT_EQUAL(&msg_buffer[20], MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check an allocation overflowing the buffer end"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; + TEST_ASSERT_EQUAL(&msg_buffer[0], MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check an allocation with a message into the space we need"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[5]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check an allocation with a message into the space we need before the end of the buffer"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 5]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 7]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check an allocation with a message into the space we need at the begining of the buffer"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[1]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check alignement correction"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[1]; + TEST_ASSERT_EQUAL(&msg_buffer[2], MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check an allocation with a message at the limit of the space we have"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[0]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[2]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[2]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 2 - (MSG_BUFFER_SIZE % 2)]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 2 - (MSG_BUFFER_SIZE % 2)]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[0]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(11, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 8]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_MsgAlloc_IsEmpty() +{ + NEW_TEST_CASE("Check if we assert when we have more slot than we can handle"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = MSG_BUFFER_SIZE + 1; + MsgAlloc_IsEmpty(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check if we return succed when we have no message"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_IsEmpty()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check if we return failed when we have a message"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_IsEmpty()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_MsgAlloc_Free(void) +{ + NEW_TEST_CASE("Check if we assert when we pass a null pointer"); + { + TRY + { + MsgAlloc_Free(0, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check if we assert when we pass a philter that is not in the list"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slots[0].phy_filter = 0x01; + alloc_slot_index = 1; + MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check if we don't assert when there is no message in the list . (This can happen in case of reset)"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check a normal free situation with the last concerned phy id"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slots[0].phy_filter = 0x01; + alloc_slot_index = 1; + MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); + TEST_ASSERT_EQUAL(0, alloc_slots[0].data); + TEST_ASSERT_EQUAL(0, alloc_slots[0].phy_filter); + TEST_ASSERT_EQUAL(1, alloc_slot_index); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check a normal free situation with the multiple phy id"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slots[0].phy_filter = 0x03; + alloc_slot_index = 1; + MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); + TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[0], alloc_slots[0].data); + TEST_ASSERT_EQUAL(0x02, alloc_slots[0].phy_filter); + TEST_ASSERT_EQUAL(1, alloc_slot_index); + MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); + TEST_ASSERT_EQUAL(0, alloc_slots[0].data); + TEST_ASSERT_EQUAL(0x00, alloc_slots[0].phy_filter); + TEST_ASSERT_EQUAL(1, alloc_slot_index); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} diff --git a/test/test_msg_alloc/unit_test_mem_alloc_generic.c b/test/test_msg_alloc/unit_test_mem_alloc_generic.c deleted file mode 100644 index 7261480e9..000000000 --- a/test/test_msg_alloc/unit_test_mem_alloc_generic.c +++ /dev/null @@ -1,1395 +0,0 @@ -#include "main.h" -#include "unit_test.h" -#include "msg_alloc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -typedef struct __attribute__((__packed__)) -{ - msg_t *msg_pt; /*!< Start pointer of the msg on msg_buffer. */ - service_t *service_pt; /*!< Pointer to the concerned service. */ -} luos_task_t; - -typedef struct -{ - uint8_t *data_pt; /*!< Start pointer of the data on msg_buffer. */ - uint16_t size; /*!< size of the data. */ - service_t *service_pt; /*!< Pointer to the transmitting service. */ -} tx_task_t; - -/******************************************************************************* - * Variables - ******************************************************************************/ -extern memory_stats_t *mem_stat; -extern volatile bool reset_needed; -extern volatile uint8_t msg_buffer[MSG_BUFFER_SIZE]; -extern volatile uint8_t *data_ptr; -extern volatile msg_t *oldest_msg; -extern volatile msg_t *used_msg; -extern volatile msg_t *msg_tasks[MAX_MSG_NB]; -extern volatile uint16_t msg_tasks_stack_id; -extern volatile luos_task_t luos_tasks[MAX_MSG_NB]; -extern volatile uint16_t luos_tasks_stack_id; -extern volatile tx_task_t tx_tasks[MAX_MSG_NB]; -extern volatile uint16_t tx_tasks_stack_id; - -/******************************************************************************* - * Function - ******************************************************************************/ -void unittest_MsgAlloc_loop() -{ - NEW_TEST_CASE("Verify Tx & Rx message tasks stat computing"); - MsgAlloc_Init(NULL); - { - // tx_tasks_stack_id is incremented : buffer occupation computing is verified - // - // tx/rx buffer - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^-------------------------^---------------------^-------------+ - // | | | - // tx/rx_tasks_stack_id tx/rx_tasks_stack_id tx/rx_tasks_stack_id - // (0% occupation) (X% occupation) (etc...) - // - - // Init variables - //--------------- - uint16_t expected_stat; - memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, - .engine_msg_stack_ratio = 0, - .tx_msg_stack_ratio = 0, - .buffer_occupation_ratio = 0, - .msg_drop_number = 0}; - - memset(&memory_stats, 0, sizeof(memory_stats)); - MsgAlloc_Init(&memory_stats); - - // Call function and Verify - //--------------------------- - // Tx and Rx stat ratio are incremented - for (msg_tasks_stack_id = 0; msg_tasks_stack_id <= MAX_MSG_NB / 2; msg_tasks_stack_id++) - { - tx_tasks_stack_id = msg_tasks_stack_id; - MsgAlloc_loop(); - expected_stat = (msg_tasks_stack_id * 100) / (MAX_MSG_NB); - NEW_STEP_IN_LOOP("Check Tx message stack ratio is correct", msg_tasks_stack_id); - TEST_ASSERT_TRUE(memory_stats.tx_msg_stack_ratio == expected_stat); - NEW_STEP_IN_LOOP("Check Rx message stack ratio is correct", msg_tasks_stack_id); - TEST_ASSERT_TRUE(memory_stats.rx_msg_stack_ratio == expected_stat); - } - // Tx and Rx stat ratio are not incremented - for (msg_tasks_stack_id = MAX_MSG_NB; msg_tasks_stack_id > MAX_MSG_NB / 2; msg_tasks_stack_id--) - { - tx_tasks_stack_id = msg_tasks_stack_id; - MsgAlloc_loop(); - NEW_STEP_IN_LOOP("Check Tx message stack ratio is not incremented", msg_tasks_stack_id); - TEST_ASSERT_TRUE(memory_stats.tx_msg_stack_ratio == 100); - NEW_STEP_IN_LOOP("Check Rx message stack ratio is not incremented", msg_tasks_stack_id); - TEST_ASSERT_TRUE(memory_stats.rx_msg_stack_ratio == 100); - } - } - - NEW_TEST_CASE("Verify buffer occupation rate stat computing"); - MsgAlloc_Init(NULL); - { - // data_ptr is incremented : buffer occupation computing is verified - // - // msg_buffer - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^-------------------------^---------------------^-------------+ - // | | | - // data_ptr data_ptr data_ptr - // (0% occupation) (X% occupation) (etc...) - // - - // Init variables - //--------------- - uint32_t expected_buffer_occupation_ratio; - memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, - .engine_msg_stack_ratio = 0, - .tx_msg_stack_ratio = 0, - .buffer_occupation_ratio = 0, - .msg_drop_number = 0}; - - memset(&memory_stats, 0, sizeof(memory_stats)); - MsgAlloc_Init(&memory_stats); - data_ptr = &msg_buffer[0]; - - // Call function and Verify - //--------------------------- - // Empty buffer - expected_buffer_occupation_ratio = 0; - MsgAlloc_loop(); - - NEW_STEP("Check buffer is empty"); - TEST_ASSERT_EQUAL(0, memory_stats.buffer_occupation_ratio); - - // Buffer occupation from 0 -> 100% - NEW_STEP("Check buffer is full in all cases"); - oldest_msg = (msg_t *)&msg_buffer[0]; - for (uint16_t i = sizeof(header_t); i < MSG_BUFFER_SIZE; i++) - { - data_ptr = &msg_buffer[0] + i; - expected_buffer_occupation_ratio = (i * 100) / (MSG_BUFFER_SIZE); - - MsgAlloc_loop(); - - TEST_ASSERT_EQUAL(expected_buffer_occupation_ratio, memory_stats.buffer_occupation_ratio); - } - } -} - -void unittest_MsgAlloc_Alloc() {} - -#define COPY_LENGTH 128 -void unittest_MsgAlloc_IsEmpty() -{ - NEW_TEST_CASE("Is Empty"); - MsgAlloc_Init(NULL); - { - // - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^-------------------------------------------------------------+ - // | - // data_ptr <= return SUCCED only if data_ptr is here (empty buffer) - // - - data_ptr = &msg_buffer[0]; - NEW_STEP("Check NO message has been received since initialization"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_IsEmpty()); - - NEW_STEP("Check message(s) has been received since initialization"); - for (uint16_t i = 1; i < MSG_BUFFER_SIZE; i++) - { - data_ptr = &msg_buffer[i]; - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_IsEmpty()); - } - } -} - -void unittest_MsgAlloc_UsedMsgEnd() -{ - NEW_TEST_CASE("Used Message End"); - MsgAlloc_Init(NULL); - { - used_msg = (msg_t *)&msg_buffer[0]; - MsgAlloc_UsedMsgEnd(); - - NEW_STEP("Check \"used message\" is reseted"); - TEST_ASSERT_NULL(used_msg); - } -} - -void unittest_MsgAlloc_PullMsgToInterpret() -{ - NEW_TEST_CASE("Case FAILED"); - MsgAlloc_Init(NULL); - { - // - // msg_tasks - // +---------+<--msg_tasks_stack_id = 0 ==> Assert - // | A 1 | - // |---------| - // | A 2 | - // |---------| - // | A 3 | - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // - - msg_t *returned_msg = NULL; - msg_tasks_stack_id = 0; - - NEW_STEP("Check function returns FAILED when \"message tasks stack id\" = 0 "); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_PullMsgToInterpret(&returned_msg)); - NEW_STEP("Check RETURNED MESSAGE is not filled"); - TEST_ASSERT_NULL(returned_msg); - } - - NEW_TEST_CASE("Case SUCCEED"); - MsgAlloc_Init(NULL); - { - // - // msg_tasks init state msg_tasks end state - // +---------+ +---------+ - // | Msg 1 | | Msg 2 |<--"returned_msg" points to 1st message of msg_tasks - // |---------| |---------| - // | Msg 2 | | Msg 3 | - // |---------| |---------| - // | etc... | | etc... | - // |---------| |---------|<--msg_tasks_stack_id - // | LAST | | 0 | - // +---------+<--msg_tasks_stack_id +---------+ - // - - msg_t *expected_message[MAX_MSG_NB]; - msg_t *returned_msg; - error_return_t result; - - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - expected_message[i] = (msg_t *)&msg_buffer[i]; - msg_tasks[i] = (msg_t *)&msg_buffer[i]; - } - - msg_tasks_stack_id = MAX_MSG_NB; - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - RESET_ASSERT(); - result = MsgAlloc_PullMsgToInterpret(&returned_msg); - NEW_STEP_IN_LOOP("Check NO assert has occured", i); - TEST_ASSERT_FALSE(IS_ASSERT()); - NEW_STEP_IN_LOOP("Check function returns SUCCEED", i); - TEST_ASSERT_EQUAL(SUCCEED, result); - NEW_STEP_IN_LOOP("Check function fills RETURNED MESSAGE pointer", i); - TEST_ASSERT_EQUAL(expected_message[i], returned_msg); - } - } -} - -void unittest_MsgAlloc_LuosTaskAlloc() -{ - NEW_TEST_CASE("No more space in luos_tasks"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks init state luos_tasks end state - // +---------+ +---------+ - // | D 1 | | D 2 |<--"D 1" is removed - // |---------| |---------| - // | D 2 | | D 3 | - // |---------| |---------| - // | etc... | | etc... | - // |---------| |---------| - // | Last | | 0 | - // +---------+<--luos_tasks_stack_id +---------+ - // - - luos_task_t expected_luos_task; - service_t service; - - // Init variables - memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, - .engine_msg_stack_ratio = 0, - .tx_msg_stack_ratio = 0, - .buffer_occupation_ratio = 0, - .msg_drop_number = 0}; - - memset(&memory_stats, 0, sizeof(memory_stats)); - MsgAlloc_Init(&memory_stats); - - luos_tasks_stack_id = MAX_MSG_NB; - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - luos_tasks[i].msg_pt = (msg_t *)&msg_buffer[i]; - } - luos_tasks[0].msg_pt = NULL; - - // Launch Test - MsgAlloc_LuosTaskAlloc(&service, (msg_t *)&msg_buffer[0]); - - // Verify - NEW_STEP("Check Luos stack occupation is 100\%"); - TEST_ASSERT_EQUAL(100, memory_stats.engine_msg_stack_ratio); - NEW_STEP("Check there is 1 dropped message"); - TEST_ASSERT_EQUAL(1, memory_stats.msg_drop_number); - NEW_STEP("Check Oldest Message is removed"); - TEST_ASSERT_EQUAL(&msg_buffer[1], luos_tasks[0].msg_pt); - } - - NEW_TEST_CASE("Allocation"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks init state luos_tasks end state - // - // +---------+<--luos_tasks_stack_id +---------+ - // | 0 | | D 1 | (msg_pt & service_pt are allocated) - // |---------| |---------| - // | 0 | | D 2 | (msg_pt & service_pt are allocated) - // |---------| |---------| - // | etc... | | etc... | - // |---------| |---------| - // | 0 | | Last | (msg_pt & service_pt are allocated) - // +---------+ luos_tasks_stack_id-->+---------+ - // - - msg_t *message; - service_t *service_concerned; - uint16_t expected_luos_tasks_stack_id; - uint8_t expected_mem_stat; - - // Init variables - memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, - .engine_msg_stack_ratio = 0, - .tx_msg_stack_ratio = 0, - .buffer_occupation_ratio = 0, - .msg_drop_number = 0}; - memset(&memory_stats, 0, sizeof(memory_stats)); - MsgAlloc_Init(&memory_stats); - - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - // Init variables - luos_tasks_stack_id = i; - expected_luos_tasks_stack_id = i + 1; - expected_mem_stat = ((i + 1) * 100 / MAX_MSG_NB); - message = (msg_t *)&msg_buffer[0]; - service_concerned = (service_t *)&msg_buffer[0]; - - // Launch Test - MsgAlloc_LuosTaskAlloc(service_concerned, message); - - // Verify - NEW_STEP_IN_LOOP("Check message pointer is allocated", i); - TEST_ASSERT_EQUAL(message, luos_tasks[i].msg_pt); - NEW_STEP_IN_LOOP("Check service pointer is allocated", i); - TEST_ASSERT_EQUAL(service_concerned, luos_tasks[i].service_pt); - NEW_STEP_IN_LOOP("Check \"luos tasks stack id\" is updated", i); - TEST_ASSERT_EQUAL(expected_luos_tasks_stack_id, luos_tasks_stack_id); - NEW_STEP_IN_LOOP("Check \"oldest message\" points to first luos task", i); - TEST_ASSERT_EQUAL(luos_tasks[0].msg_pt, oldest_msg); - NEW_STEP_IN_LOOP("Check luos stack ratio computation", i); - TEST_ASSERT_EQUAL(expected_mem_stat, memory_stats.engine_msg_stack_ratio); - } - } -} - -void unittest_MsgAlloc_LuosTasksNbr(void) -{ - NEW_TEST_CASE("Verify getter for Luos Tasks number"); - MsgAlloc_Init(NULL); - { - // Init variables - //--------------- - luos_tasks_stack_id = 0; - - // Call function and Verify - //--------------------------- - for (uint8_t i = 0; i < MAX_MSG_NB; i++) - { - NEW_STEP_IN_LOOP("Check Luos task number", i); - MsgAlloc_LuosTasksNbr(); - TEST_ASSERT_EQUAL(luos_tasks_stack_id, i); - luos_tasks_stack_id++; - } - } -} - -void unittest_MsgAlloc_PullMsg() -{ - NEW_TEST_CASE("Case FAILED : no message for the service"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks - // +---------+ - // | D 1 | - // |---------| - // | D 2 |<--luos_tasks_stack_id - // |---------| - // | D 3 |\ - // |---------| | - // | etc... | | <-- search these IDs - // |---------| | (function return FAILED if ID > luos_tasks_stack_id) - // | Last | | - // +---------+/ - // - - msg_t *returned_message; - service_t *service = (service_t *)0xFFFF; - - // Init variables - luos_tasks_stack_id = MAX_MSG_NB - 1; - for (uintptr_t i = 0; i < MAX_MSG_NB; i++) - { - luos_tasks[i].service_pt = (service_t *)i; - } - - // Launch Test & Verify - NEW_STEP("Function returns FAILED when wanted service doesn't exists"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_PullMsg(service, &returned_message)); - } - - NEW_TEST_CASE("Case SUCCEED : return oldest message for the service"); - MsgAlloc_Init(NULL); - { - // - // Pull a message from a specific service (for example service is in task D3) - // luos_tasks_stack_id = 3 : function will search in messages D1, D2 & D3 - // - // - // msg_buffer msg_buffer after pull - // +------------------------+ +------------------------+ - // |------------------------| |------------------------| - // +--^---^---^-------------+ +--^---^---^-------------+ - // | | | | | | - // D1 D2 D3 ... D1 D2 used_msg ... - // returned_msg - // - // - // luos_tasks luos_tasks - // +---------+ +---------+ - // | D 1 |\ | D 1 | - // |---------| | |---------| - // | D 2 | | | D 2 | - // |---------| | |---------| - // | D 3 |/ | 0 |<-- messaged pulled is cleared - // |---------|<--luos_tasks_stack_id |---------| - // | etc... | | etc... | - // |---------| |---------| - // | LAST | | LAST | - // +---------+ +---------+ - // - - msg_t *returned_message; - msg_t *msg_to_clear; - service_t *service; - luos_task_t expected_luos_tasks[MAX_MSG_NB]; - - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - - // Init variables - MsgAlloc_Init(NULL); - luos_tasks_stack_id = MAX_MSG_NB; - for (uint16_t j = 0; j < MAX_MSG_NB; j++) - { - luos_tasks[j].service_pt = (service_t *)&msg_buffer[j]; - luos_tasks[j].msg_pt = (msg_t *)(&msg_buffer[0] + MAX_MSG_NB + j); - expected_luos_tasks[j].msg_pt = (msg_t *)(&msg_buffer[0] + MAX_MSG_NB + j); - } - service = luos_tasks[i].service_pt; - msg_to_clear = luos_tasks[i].msg_pt; - - // Launch Test & Verify - NEW_STEP_IN_LOOP("Check function returns SUCCEED", i); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_PullMsg(service, &returned_message)); - NEW_STEP_IN_LOOP("Check message pointer is allocated", i); - TEST_ASSERT_EQUAL(expected_luos_tasks[i].msg_pt, returned_message); - NEW_STEP_IN_LOOP("Check \"used message\" is updated", i); - TEST_ASSERT_EQUAL(returned_message, used_msg); - NEW_STEP_IN_LOOP("Check luos task is cleared for required message", i); - // Verify required message has been deleted - for (uint16_t k = 0; k < MAX_MSG_NB; k++) - { - TEST_ASSERT_NOT_EQUAL(msg_to_clear, luos_tasks[k].msg_pt); - } - } - } -} - -void unittest_MsgAlloc_PullMsgFromLuosTask() -{ - NEW_TEST_CASE("Case FAILED : no message for ID"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks - // +---------+ - // | D 1 | - // |---------| - // | D 2 |<--luos_tasks_stack_id - // |---------| - // | D 3 |\ - // |---------| | - // | etc... | | <-- search these IDs - // |---------| | (function return FAILED if ID > luos_tasks_stack_id) - // | Last | | - // +---------+/ - // - - msg_t *returned_msg = NULL; - luos_tasks_stack_id = 5; - - for (uint16_t task_id = luos_tasks_stack_id; task_id < luos_tasks_stack_id + 5; task_id++) - { - NEW_STEP_IN_LOOP("Check function returns FAILED when \"luos tasks stack id\" points to a void message", task_id); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_PullMsgFromLuosTask(task_id, &returned_msg)); - } - } - - NEW_TEST_CASE("Case SUCCEED : pull all messages from Luos Tasks"); - MsgAlloc_Init(NULL); - { - // - // msg_buffer msg_buffer after 1st pull msg_buffer after 2nd pull - // +------------------------+ +------------------------+ +------------------------+ - // |------------------------| |------------------------| |------------------------| etc... - // +--^-------^-------^-----+ +--^-------^-------^-----+ +----------^-------^-----+ - // | | | | | | | | - // D1 D2 ... LAST D1 D2 ... LAST D2 ... LAST - // used_msg used_msg - // returned_msg returned_msg - // - // luos_tasks luos_tasks luos_tasks - // +---------+ +---------+ +---------+ - // | D 1 | | D 2 | | D 3 | - // |---------| |---------| |---------| - // | D 2 | | D 3 | | D 4 | - // |---------| |---------| |---------| - // | D 3 | | D 4 | | D 5 | - // |---------| |---------| |---------| - // | etc... | | etc... | | etc... | - // |---------| |---------| |---------| - // | LAST | | 0 | | 0 | - // +---------+ +---------+ +---------+ - - uint16_t task_id; - msg_t *returned_message; - msg_t *msg_to_clear; - service_t *service; - luos_task_t expected_luos_tasks[MAX_MSG_NB]; - - for (uint16_t task_id = 0; task_id < MAX_MSG_NB; task_id++) - { - // Init variables - MsgAlloc_Init(NULL); - luos_tasks_stack_id = MAX_MSG_NB; - for (uint16_t j = 0; j < MAX_MSG_NB; j++) - { - luos_tasks[j].msg_pt = (msg_t *)(&msg_buffer[0] + MAX_MSG_NB + j); - expected_luos_tasks[j].msg_pt = (msg_t *)(&msg_buffer[0] + MAX_MSG_NB + j); - } - msg_to_clear = luos_tasks[task_id].msg_pt; - - // Launch Test & Verify - NEW_STEP_IN_LOOP("Check function returns SUCCEED", task_id); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_PullMsgFromLuosTask(task_id, &returned_message)); - NEW_STEP_IN_LOOP("Check luos task message pointer is allocated", task_id); - TEST_ASSERT_EQUAL(expected_luos_tasks[task_id].msg_pt, returned_message); - NEW_STEP_IN_LOOP("Check \"used message\" is updated", task_id); - TEST_ASSERT_EQUAL(returned_message, used_msg); - NEW_STEP_IN_LOOP("Check luos task is cleared for required message", task_id); - // Verify required message has been deleted - for (uint16_t k = 0; k < MAX_MSG_NB; k++) - { - TEST_ASSERT_NOT_EQUAL(msg_to_clear, luos_tasks[k].msg_pt); - } - } - } -} - -void unittest_MsgAlloc_LookAtLuosTask() -{ - NEW_TEST_CASE("Case FAILED"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks - // +---------+ - // | D 1 | - // |---------| - // | D 2 |<--luos_tasks_stack_id - // |---------| - // | D 3 |\ - // |---------| | - // | etc... | | <-- search these IDs - // |---------| | (function return FAILED if ID > luos_tasks_stack_id) - // | Last | | - // +---------+/ - // - - uint16_t task_id; - service_t **allocated_service; - - // Init variables - luos_tasks_stack_id = 0; - task_id = luos_tasks_stack_id; - - // Call function & Verify - NEW_STEP("Check function returns FAILED when \"luos tasks stack id\" points to a void message"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_LookAtLuosTask(task_id, allocated_service)); - task_id++; - NEW_STEP("Check function returns FAILED when \"luos tasks stack id\" points to another void message"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_LookAtLuosTask(task_id, allocated_service)); - } - - NEW_TEST_CASE("Case SUCCEED"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks - // +---------+ - // | D 1 | - // |---------| - // | D 2 |<-- search this ID (function will fill service pointer associated to D 2 Luos Task) - // |---------| - // | D 3 |<--luos_tasks_stack_id - // |---------| - // | 0 | - // |---------| - // | etc... | - // |---------| - // | 0 | - // +---------+ - // - - // Init variables - service_t *oldest_service = NULL; - luos_tasks_stack_id = MAX_MSG_NB; - - for (uintptr_t i = 0; i < MAX_MSG_NB; i++) - { - luos_tasks[i].service_pt = (service_t *)i; - } - - // Call function & Verify - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - NEW_STEP_IN_LOOP("Check function returns SUCCEED", i); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_LookAtLuosTask(i, &oldest_service)); - NEW_STEP_IN_LOOP("Check if function return the service concerned by the oldest message", i); - TEST_ASSERT_EQUAL(i, oldest_service); - } - } -} - -void unittest_MsgAlloc_GetLuosTaskSourceId() -{ - NEW_TEST_CASE("Case FAILED"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks - // +---------+ - // | D 1 | - // |---------| - // | D 2 |<--luos_tasks_stack_id - // |---------| - // | D 3 |\ - // |---------| | - // | etc... | | <-- search these IDs - // |---------| | (function return FAILED if ID > luos_tasks_stack_id) - // | Last | | - // +---------+/ - // - - uint16_t task_id; - uint16_t task_id_2; - - // Init variables - luos_tasks_stack_id = MAX_MSG_NB; - task_id = luos_tasks_stack_id; - task_id_2 = luos_tasks_stack_id + 1; - - // Call function & Verify - NEW_STEP("Check function returns FAILED when required task ID points to a void message"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_GetLuosTaskSourceId(task_id, NULL)); - NEW_STEP("Check function returns FAILED when required task ID points to another void message"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_GetLuosTaskSourceId(task_id_2, NULL)); - } - - NEW_TEST_CASE("Case SUCCEED"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks - // +---------+ - // | D 1 | - // |---------|<--luos_tasks_stack_id : fills SOURCE header pointer - // | D 2 | - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // - - // Init variables - msg_t message; - uint16_t source_id = 0; - luos_tasks_stack_id = MAX_MSG_NB; - - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - message.header.source = i; - luos_tasks[i].msg_pt = &message; - - // Call function & Verify - NEW_STEP_IN_LOOP("Check function returns SUCCEED", i); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_GetLuosTaskSourceId(i, &source_id)); - NEW_STEP_IN_LOOP("Check function fills message SOURCE ID", i); - TEST_ASSERT_EQUAL(i, source_id); - } - } -} - -void unittest_MsgAlloc_GetLuosTaskCmd() -{ - NEW_TEST_CASE("FAILED"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks - // +---------+ - // | D 1 | - // |---------| - // | D 2 |<--luos_tasks_stack_id - // |---------| - // | D 3 |\ - // |---------| | - // | etc... | | <-- search these IDs - // |---------| | (function return FAILED if ID > luos_tasks_stack_id) - // | Last | | - // +---------+/ - // - - uint16_t task_id; - uint8_t command = 0xFF; - - luos_tasks_stack_id = MAX_MSG_NB; - task_id = luos_tasks_stack_id; - - NEW_STEP("Check function returns FAILED when required task ID points to a void message"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_GetLuosTaskCmd(task_id, &command)); - NEW_STEP("Check COMMAND is not filled when required task ID points to a void message"); - TEST_ASSERT_EQUAL(0xFF, command); - - task_id++; - NEW_STEP("Check function returns FAILED when required task ID points to another void message"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_GetLuosTaskCmd(task_id, &command)); - NEW_STEP("Check COMMAND is not filled when required task ID points to a void message"); - TEST_ASSERT_EQUAL(0xFF, command); - } - - NEW_TEST_CASE("SUCCEED"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks - // +---------+ - // | D 1 | - // |---------|<--luos_tasks_stack_id : fills COMMAND header pointer - // | D 2 | - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // - - msg_t message; - uint16_t task_id = 0; - uint8_t command = 0; - uint8_t expected_command = 1; - - luos_tasks_stack_id = MAX_MSG_NB; - - message.header.cmd = expected_command; - luos_tasks[task_id].msg_pt = &message; - - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_GetLuosTaskCmd(task_id, &command)); - NEW_STEP("Check function fills message COMMAND"); - TEST_ASSERT_EQUAL(expected_command, command); - } -} - -void unittest_MsgAlloc_GetLuosTaskSize() -{ - NEW_TEST_CASE("FAILED"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks - // +---------+ - // | D 1 | - // |---------| - // | D 2 |<--luos_tasks_stack_id - // |---------| - // | D 3 |\ - // |---------| | - // | etc... | | <-- search these IDs - // |---------| | (function return FAILED if ID > luos_tasks_stack_id) - // | Last | | - // +---------+/ - // - - uint16_t task_id; - uint16_t size = 0xFF; - luos_tasks_stack_id = MAX_MSG_NB; - task_id = luos_tasks_stack_id; - - NEW_STEP("Check function returns FAILED when required task ID points to a void message"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_GetLuosTaskSize(task_id, &size)); - NEW_STEP("Check SIZE is not filled when required task ID points to a void message"); - TEST_ASSERT_EQUAL(0xFF, size); - } - - NEW_TEST_CASE("SUCCEED"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks - // +---------+ - // | D 1 | - // |---------|<--luos_tasks_stack_id : fills SIZE header pointer - // | D 2 | - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // - - msg_t message; - uint16_t expected_size = 128; - uint16_t task_id = 0; - uint16_t size = 0; - - luos_tasks_stack_id = MAX_MSG_NB; - - message.header.size = expected_size; - luos_tasks[task_id].msg_pt = &message; - - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_GetLuosTaskSize(task_id, &size)); - NEW_STEP("Check function fills message SIZE"); - TEST_ASSERT_EQUAL(expected_size, size); - } -} - -void unittest_MsgAlloc_ClearMsgFromLuosTasks() -{ - NEW_TEST_CASE("No message to clear"); - MsgAlloc_Init(NULL); - { - // Message to clean is not in Luos_tasks : nothing is done - // - // msg_buffer - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // +----------^^................^---------------^----------------+ - // || | | - // || Luos_tasks | msg to clean - // || +---------+ | - // +|->| D1 | | - // | |---------| | - // +->| D2 | | - // |---------| | - // | etc... | | - // |---------| | - // | Last |<--+ - // +---------+ - // - - luos_task_t expected_luos_tasks[MAX_MSG_NB]; - msg_t message; - service_t service; - - // Init variables - luos_tasks_stack_id = 0; - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - luos_tasks[i].msg_pt = &message; - luos_tasks[i].service_pt = &service; - expected_luos_tasks[i].msg_pt = &message; - expected_luos_tasks[i].service_pt = &service; - // Call function - MsgAlloc_ClearMsgFromLuosTasks(luos_tasks[i].msg_pt); - - NEW_STEP_IN_LOOP("Check luos message pointer is not cleared", i); - TEST_ASSERT_EQUAL(expected_luos_tasks[i].msg_pt, luos_tasks[i].msg_pt); - NEW_STEP_IN_LOOP("Check luos service pointer is not cleared", i); - TEST_ASSERT_EQUAL(expected_luos_tasks[i].service_pt, luos_tasks[i].service_pt); - } - } - - NEW_TEST_CASE("Clear a specific Luos Task"); - MsgAlloc_Init(NULL); - { - // - // msg_buffer - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // +----------^^.......^..................^----------------------+ - // || | | - // || msg to clean = D2 | - // || | - // || Luos_tasks init state | - // || +---------+ | - // +|->| D1 | | - // | |---------| | - // +->| D2 | | - // |---------| | - // | etc... | | - // |---------| | - // | Last |<------------+ - // +---------+ - // - // Luos_tasks ending state - // +---------+ - // | D1 | - // |---------| - // | D3 | - // |---------| - // | etc... | - // |---------| - // | Last | - // |---------| - // | 0 | - // +---------+ - // - - msg_t *msg_to_clear; - - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - // Init variables - MsgAlloc_Init(NULL); - for (uint16_t j = 0; j < MAX_MSG_NB; j++) - { - luos_tasks[j].msg_pt = (msg_t *)&msg_buffer[j]; - } - - msg_tasks[0] = 0; - tx_tasks[0].data_pt = 0; - luos_tasks_stack_id = MAX_MSG_NB; - msg_to_clear = luos_tasks[i].msg_pt; - // Call function - MsgAlloc_ClearMsgFromLuosTasks(luos_tasks[i].msg_pt); - - // Verify required message has been deleted - for (uint16_t k = 0; k < MAX_MSG_NB; k++) - { - NEW_STEP_IN_LOOP("Check expected message is cleared for all cases", (MAX_MSG_NB * i) + k); - TEST_ASSERT_NOT_EQUAL(msg_to_clear, luos_tasks[k].msg_pt); - } - } - } -} - -void unittest_MsgAlloc_PullMsgFromTxTask() -{ - NEW_TEST_CASE("Verify assertion cases"); - MsgAlloc_Init(NULL); - { - // tx_tasks - // +---------+ - // | Tx1 | - // |---------| - // | Tx2 | - // |---------| - // | Tx3 | - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // <--tx_tasks_stack_id overflows ==> Assert - for (uint16_t i = 0; i < MAX_MSG_NB + 2; i++) - { - MsgAlloc_Init(NULL); - RESET_ASSERT(); - tx_tasks_stack_id = i; - - if (tx_tasks_stack_id > MAX_MSG_NB) - { - MsgAlloc_PullMsgFromTxTask(); - NEW_STEP_IN_LOOP("Check assert has occured when \"tx tasks stack id\" overflows", i); - TEST_ASSERT_TRUE(IS_ASSERT()); - } - else - { - MsgAlloc_PullMsgFromTxTask(); - NEW_STEP_IN_LOOP("Check NO assert has occured", i); - TEST_ASSERT_FALSE(IS_ASSERT()); - } - } - RESET_ASSERT(); - } - - NEW_TEST_CASE("Pull Tx message task"); - MsgAlloc_Init(NULL); - { - // - // - // tx_tasks tx_tasks tx_tasks - // +---------+ +---------+ +---------+ - // | Tx1 | | Tx2 | | Tx3 | - // |---------| |---------| |---------| - // | Tx2 | | Tx3 | | Tx4 | - // |---------| |---------| |---------| - // | Tx3 | | Tx4 | | Tx5 | - // |---------| |---------| |---------| - // | etc... | | etc... | | etc... | etc... - // |---------| |---------| tx_tasks_stack_id-->|---------| - // | etc... | | etc... | | 0 | - // |---------| tx_tasks_stack_id-->|---------| |---------| - // | LAST | | 0 | | 0 | - // tx_tasks_stack_id-->+---------+ +---------+ +---------+ - - tx_task_t expected_tx_tasks[MAX_MSG_NB]; - - NEW_STEP("Check Tx task data pointer are correctly allocated after pulling oldest tx task"); - NEW_STEP("Check Tx task size is correctly allocated after pulling oldest tx task"); - for (uint16_t task_id = 0; task_id < MAX_MSG_NB; task_id++) - { - for (uint16_t tasks_stack_id = task_id + 1; tasks_stack_id <= MAX_MSG_NB; tasks_stack_id++) - { - // Initialisation - MsgAlloc_Init(NULL); - tx_tasks_stack_id = tasks_stack_id; - - for (uint16_t pt_value = 0; pt_value < MAX_MSG_NB; pt_value++) - { - // Init tx_tasks pointers - tx_tasks[pt_value].data_pt = (uint8_t *)(&msg_buffer[0] + pt_value); - tx_tasks[pt_value].size = pt_value + 100; - - // Init expected pointers - if (pt_value == (tasks_stack_id - 1)) - { - expected_tx_tasks[pt_value].data_pt = 0; - expected_tx_tasks[pt_value].size = 0; - } - else if (pt_value < task_id) - { - expected_tx_tasks[pt_value].data_pt = (uint8_t *)(&msg_buffer[0] + pt_value + 1); - expected_tx_tasks[pt_value].size = pt_value + 100 + 1; - } - } - - // Launch test - MsgAlloc_PullMsgFromTxTask(); - - // Analyze test results - for (uint8_t i = 0; i < task_id; i++) - { - TEST_ASSERT_EQUAL(expected_tx_tasks[i].data_pt, tx_tasks[i].data_pt); - TEST_ASSERT_EQUAL(expected_tx_tasks[i].size, tx_tasks[i].size); - } - } - } - } - - NEW_TEST_CASE("Verify when Tx task is empty"); - MsgAlloc_Init(NULL); - { - // tx_tasks - // +---------+<--tx_tasks_stack_id = 0 ==> return - // | Tx1 | - // |---------| - // | Tx2 | - // |---------| - // | Tx3 | - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // - - NEW_STEP("Check nothing happened when \"tx tasks stack id\" = 0"); - - // Init - tx_tasks_stack_id = 0; - - for (uint8_t i = 0; i < MAX_MSG_NB; i++) - { - tx_tasks[i].data_pt = (uint8_t *)&msg_buffer[i]; - tx_tasks[i].size = i; - } - - // Call function - //--------------------------- - MsgAlloc_PullMsgFromTxTask(); - - // Verify - TEST_ASSERT_FALSE(IS_ASSERT()); - TEST_ASSERT_EQUAL(0, tx_tasks_stack_id); - for (uint8_t i = 0; i < MAX_MSG_NB; i++) - { - TEST_ASSERT_EQUAL(&msg_buffer[i], tx_tasks[i].data_pt); - TEST_ASSERT_EQUAL(i, tx_tasks[i].size); - } - } -} - -void unittest_MsgAlloc_PullServiceFromTxTask() -{ - NEW_TEST_CASE("Verify assertion cases"); - MsgAlloc_Init(NULL); - { - // - // tx_tasks - // +---------+<--tx_tasks_stack_id = 0 ==> Assert - // | Tx1 | - // |---------| - // | Tx2 | - // |---------| - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // <--tx_tasks_stack_id overflows ==> Assert - // - uint16_t service_id = 1; - - for (uint16_t i = 0; i <= MAX_MSG_NB; i++) - { - MsgAlloc_Init(NULL); - RESET_ASSERT(); - - // Init variables - //--------------- - tx_tasks_stack_id = i; - - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - msg_tasks[i] = (msg_t *)&msg_buffer[i * 20]; - msg_tasks[i]->header.target = 0; - tx_tasks[i].data_pt = (uint8_t *)msg_tasks[i]; - } - - // Call function and Verify - //--------------------------- - if (tx_tasks_stack_id == 0) - { - NEW_STEP("Check assert has occured when \"tx tasks stack id\" = 0"); - MsgAlloc_PullServiceFromTxTask(service_id); - TEST_ASSERT_TRUE(IS_ASSERT()); - } - else - { - NEW_STEP_IN_LOOP("Check correct cases", i - 1); - MsgAlloc_PullServiceFromTxTask(service_id); - TEST_ASSERT_FALSE(IS_ASSERT()); - } - } - RESET_ASSERT(); - } - - NEW_TEST_CASE("Remove Tx tasks from a service"); - MsgAlloc_Init(NULL); - { - // - // Remove a Tx message from a specific service by analizing "target" in header (for example service is in tx task Tx2) - // tx_tasks_stack_id = 3 : function will search in messages Tx1, Tx2 & Tx3 - // - // tx_tasks tx_tasks - // +---------+ +---------+ - // | Tx1 |\ | Tx1 | - // |---------| | |---------| - // | Tx2 | | | Tx3 |<-- messaged Tx2 has been is cleared - // |---------| | |---------| - // | Tx3 |/ | Tx4 | - // |---------|<--tx_tasks_stack_id |---------| - // | etc... | | etc... | - // |---------| |---------| - // | LAST | | 0 | - // +---------+ +---------+ - // - - tx_task_t expected_tx_tasks[MAX_MSG_NB]; - uint16_t service_id; - - // Init variables - //--------------- - const int task_number = 10; - tx_tasks_stack_id = task_number; - - for (uint16_t i = 0; i < task_number; i++) - { - msg_tasks[i] = (msg_t *)&msg_buffer[i * 20]; - msg_tasks[i]->header.target = i + 1; - tx_tasks[i].data_pt = (uint8_t *)msg_tasks[i]; - } - - // Remove all messages from service 15 (position 0,2,4 in buffer) - service_id = 15; - msg_tasks[0]->header.target = service_id; - msg_tasks[2]->header.target = service_id; - msg_tasks[4]->header.target = service_id; - - expected_tx_tasks[0].data_pt = tx_tasks[1].data_pt; - expected_tx_tasks[1].data_pt = tx_tasks[3].data_pt; - for (uint16_t i = 2; i < task_number - 3; i++) - { - expected_tx_tasks[i].data_pt = tx_tasks[i + 3].data_pt; - } - expected_tx_tasks[task_number - 1].data_pt = 0; - expected_tx_tasks[task_number - 2].data_pt = 0; - expected_tx_tasks[task_number - 3].data_pt = 0; - - // Call function - //--------------- - MsgAlloc_PullServiceFromTxTask(service_id); - - // Verify - //--------------- - for (uint16_t i = 0; i < task_number; i++) - { - NEW_STEP_IN_LOOP("Check Tx task message pointer are correctly allocated after pulling expected service tx task", i); - TEST_ASSERT_EQUAL(expected_tx_tasks[i].data_pt, tx_tasks[i].data_pt); - } - } -} - -void unittest_MsgAlloc_GetTxTask() -{ - NEW_TEST_CASE("Verify assertion cases"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks - // +---------+ - // | D 1 | - // |---------| - // | D 2 | - // |---------| - // | 0 | - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // <--luos_tasks_stack_id (overflows ==> Assert) - // - - for (uint8_t i = 0; i < 2; i++) - { - RESET_ASSERT(); - - // Init variables - //--------------- - service_t *service; - uint8_t *data; - uint16_t size = 128; - - tx_tasks[0].data_pt = (uint8_t *)16; - tx_tasks[0].service_pt = (service_t *)32; - tx_tasks[0].size = 128; - - tx_tasks_stack_id = MAX_MSG_NB + i; - - // Call function - //--------------- - MsgAlloc_GetTxTask(&service, &data, &size); - - // Verify - //--------------- - NEW_STEP("Check assert has occured when \"tx tasks stack id\" = max value"); - TEST_ASSERT_TRUE(IS_ASSERT()); - - // Call function - //--------------- - MsgAlloc_GetTxTask(&service, &data, &size); - - // Verify - //--------------- - NEW_STEP("Check assert has occured when \"tx tasks stack id\" overflows"); - TEST_ASSERT_TRUE(IS_ASSERT()); - } - RESET_ASSERT(); - } - - NEW_TEST_CASE("Verify there are no messages"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks - // +---------+<--luos_tasks_stack_id (no message, function return FAILED) - // | D 1 | - // |---------| - // | D 2 | - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // - - service_t *service; - uint8_t *data; - uint16_t *size; - - // Init variables - //--------------- - tx_tasks_stack_id = 0; - - // Call function & Verify - //-------------------------- - NEW_STEP("Check function returns FAILED when tx task is empty"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_GetTxTask(&service, &data, size)); - } - - NEW_TEST_CASE("Verify there is a message"); - MsgAlloc_Init(NULL); - { - // - // luos_tasks - // +---------+ - // | D 1 | - // |---------|<--luos_tasks_stack_id : tx_tasks[0] is filled with pointers (service, data, size) - // | D 2 | - // |---------| - // | etc... | - // |---------| - // | LAST | - // +---------+ - // - - service_t *service; - uint8_t *data; - uint16_t size; - - // Init variables - //--------------- - tx_tasks_stack_id = 1; - - tx_tasks[0].data_pt = (uint8_t *)16; - tx_tasks[0].service_pt = (service_t *)32; - tx_tasks[0].size = 128; - - // Call function & Verify - //-------------------------- - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_GetTxTask(&service, &data, &size)); - NEW_STEP("Check function returns expected service pointer"); - TEST_ASSERT_EQUAL(tx_tasks[0].service_pt, service); - NEW_STEP("Check function returns expected data"); - TEST_ASSERT_EQUAL(tx_tasks[0].data_pt, data); - NEW_STEP("Check function returns expected size"); - TEST_ASSERT_EQUAL(tx_tasks[0].size, size); - } -} - -void unittest_MsgAlloc_TxAllComplete() -{ - NEW_TEST_CASE("Tx All Complete"); - MsgAlloc_Init(NULL); - { - // - // Tx_tasks - // +---------+<--tx_tasks_stack_id = return SUCCESS (all messages have been transmitted) - // | Tx 1 |\ - // |---------| | - // | Tx 1 | | - // |---------| | <--tx_tasks_stack_id = return FAILED (at least one message has not been transmitted) - // | etc... | | - // |---------| | - // | Last | | - // +---------+/ - // - - tx_tasks_stack_id = 0; - NEW_STEP("Check function returns SUCCEED when \"tx tasks stack id\" = 0 "); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_TxAllComplete()); - - NEW_STEP("Check function returns FAILED when \"tx tasks stack id\" is not 0 "); - while (tx_tasks_stack_id < MSG_BUFFER_SIZE) - { - tx_tasks_stack_id++; - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_TxAllComplete()); - } - } -} diff --git a/test/test_msg_alloc/unit_test_mem_alloc_static.c b/test/test_msg_alloc/unit_test_mem_alloc_static.c deleted file mode 100644 index eef242e80..000000000 --- a/test/test_msg_alloc/unit_test_mem_alloc_static.c +++ /dev/null @@ -1,1018 +0,0 @@ -#include "main.h" -#include "unit_test.h" -#include "../src/msg_alloc.c" - -void unittest_DoWeHaveSpace(void) -{ - NEW_TEST_CASE("There is enough space"); - MsgAlloc_Init(NULL); - { - // - // msg_buffer - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^--------------^---------------------------------------------^+ - // | | | - // pointer or pointer or pointer - // - - NEW_STEP("Check function returns SUCCEED"); - for (uint16_t i = 0; i < MSG_BUFFER_SIZE; i++) - { - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_DoWeHaveSpace((void *)&msg_buffer[i])); - } - } - - NEW_TEST_CASE("there is not enough space"); - MsgAlloc_Init(NULL); - { - // - // msg_buffer - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // |-------------------------------------------------------------+ ^ - // | - // pointer - // - - NEW_STEP("Check function returns FAILED"); - for (uint16_t i = MSG_BUFFER_SIZE; i < MSG_BUFFER_SIZE + 10; i++) - { - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_DoWeHaveSpace((void *)&msg_buffer[i])); - } - } -} - -void unittest_CheckMsgSpace(void) -{ - NEW_TEST_CASE("There are no used messages in memory space checked"); - MsgAlloc_Init(NULL); - { - // Declaration of dummy message start and end pointer - uintptr_t *mem_start; - uintptr_t *mem_end; - - // Initialize pointer - used_msg = (msg_t *)&msg_buffer[sizeof(msg_t)]; - - // - // msg_buffer - // +-------------------------------------------------------------+ - // |------------------------------| MESSAGES... |------------| - // |--------------^--------------^^------------------------------+ - // | || - // start end | - // used_msg - // - // - // Init variables - //--------------- - mem_start = (uintptr_t *)used_msg - 2; - mem_end = mem_start + 1; - // Call function and Verify - //--------------------------- - NEW_STEP("Function returns SUCCEED when we check space before messages"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((void *)mem_start, (void *)mem_end)); - - // - // msg_buffer - // +-------------------------------------------------------------+ - // |--------| MESSAGES... |----------------------------------| - // |--------------------------^^--------------^------------------+ - // || | - // |start end - // used_msg - // - // - // Init variables - //--------------- - mem_start = (uintptr_t *)used_msg + 1; - mem_end = mem_start + 1; - // Call function and Verify - //--------------------------- - NEW_STEP("Function returns SUCCEED when we check space after messages"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((void *)mem_start, (void *)mem_end)); - } - - NEW_TEST_CASE("The oldest message is not in memory space checked"); - MsgAlloc_Init(NULL); - { - // Declaration of dummy message start and end pointer - uintptr_t *mem_start; - uintptr_t *mem_end; - - // Initialize pointer - oldest_msg = (msg_t *)&msg_buffer[sizeof(msg_t)]; - - // - // msg_buffer - // +-------------------------------------------------------------+ - // |------------------------------| MESSAGES... |------------| - // |--------------^--------------^^------------------------------+ - // | || - // start end | - // oldest_msg - // - // - // Init variables - //--------------- - mem_start = (uintptr_t *)oldest_msg - 2; - mem_end = mem_start + 1; - // Call function and Verify - //--------------------------- - NEW_STEP("Function returns SUCCEED when we check space before messages"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((void *)mem_start, (void *)mem_end)); - - // - // msg_buffer - // +-------------------------------------------------------------+ - // |--------| MESSAGES... |----------------------------------| - // |--------------------------^^--------------^------------------+ - // || | - // |start end - // oldest_msg - // - // - // Init variables - //--------------- - mem_start = (uintptr_t *)oldest_msg + 1; - mem_end = mem_start + 1; - // Call function and Verify - //--------------------------- - NEW_STEP("Function returns SUCCEED when we check space after messages"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((void *)mem_start, (void *)mem_end)); - } - - NEW_TEST_CASE("There are used messages in memory space checked"); - MsgAlloc_Init(NULL); - { - // Declaration of dummy message start and end pointer - uintptr_t *mem_start; - uintptr_t *mem_end; - - // Initialize pointer - used_msg = (msg_t *)&msg_buffer[sizeof(msg_t)]; - - // - // msg_buffer - // +-------------------------------------------------------------+ - // |----------------------------| MESSAGES... |--------------| - // |--------------^-------------^^-------------------------------+ - // | || - // start |end - // used_msg - // - // - // Init variables - //--------------- - mem_start = (uintptr_t *)used_msg - 1; - mem_end = mem_start + 1; - // Call function and Verify - //--------------------------- - NEW_STEP("Function returns FAILED when the end of a new message overflows begin of used message"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((void *)mem_start, (void *)mem_end)); - - // - // msg_buffer - // +-------------------------------------------------------------+ - // |--------------| MESSAGES... |----------------------------| - // |--------------^------^---------------------------------------+ - // | | - // start end - // & used_msg - // - // - // Init variables - //--------------- - mem_start = (uintptr_t *)used_msg; - mem_end = mem_start + 1; - // Call function and Verify - //--------------------------- - NEW_STEP("Function returns FAILED when the beginning of a new message overflows begin of used message"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((void *)mem_start, (void *)mem_end)); - } - - NEW_TEST_CASE("The oldest message is in memory space checked"); - MsgAlloc_Init(NULL); - { - // Declaration of dummy message start and end pointer - uintptr_t *mem_start; - uintptr_t *mem_end; - - // Initialize pointer - oldest_msg = (msg_t *)&msg_buffer[sizeof(msg_t)]; - - // - // msg_buffer - // +-------------------------------------------------------------+ - // |----------------------------| MESSAGES... |--------------| - // |--------------^-------------^^-------------------------------+ - // | || - // start |end - // oldest_msg - // - // - // Init variables - //--------------- - mem_start = (uintptr_t *)oldest_msg - 1; - mem_end = mem_start + 1; - // Call function and Verify - //--------------------------- - NEW_STEP("Function returns FAILED when the end of a new message overflows begin of oldest message"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((void *)mem_start, (void *)mem_end)); - - // - // msg_buffer - // +-------------------------------------------------------------+ - // |--------------| MESSAGES... |----------------------------| - // |--------------^------^---------------------------------------+ - // | | - // start end - // & oldest_msg - // - // - // Init variables - //--------------- - mem_start = (uintptr_t *)oldest_msg; - mem_end = mem_start + 1; - // Call function and Verify - //--------------------------- - NEW_STEP("Function returns FAILED when the beginning of a new message overflows begin of oldest message"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((void *)mem_start, (void *)mem_end)); - } -} - -void unittest_BufferAvailableSpaceComputation(void) -{ - NEW_TEST_CASE("Verify assertion cases"); - MsgAlloc_Init(NULL); - { -#define assert_nb 6 - typedef struct - { - bool expected_asserts; // if "true" : expect a Luos assert - msg_t *oldest_msg_position; // oldest_msg position in msg_buffer - } assert_scenario; - - assert_scenario assert_sc[assert_nb]; - uint32_t free_space = MSG_BUFFER_SIZE; - - // Expected Values - assert_sc[0].expected_asserts = true; - assert_sc[1].expected_asserts = false; - assert_sc[2].expected_asserts = false; - assert_sc[3].expected_asserts = false; - assert_sc[4].expected_asserts = true; - assert_sc[5].expected_asserts = true; - - assert_sc[0].oldest_msg_position = (msg_t *)&msg_buffer[0] - 1; - assert_sc[1].oldest_msg_position = (msg_t *)&msg_buffer[0]; - assert_sc[2].oldest_msg_position = (msg_t *)&msg_buffer[1]; - assert_sc[3].oldest_msg_position = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE] - 1; - assert_sc[4].oldest_msg_position = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE]; - assert_sc[5].oldest_msg_position = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE] + 1; - - // Launch test - NEW_STEP("Verify function is asserting when forbidden values are injected"); - for (uint8_t i = 0; i < assert_nb; i++) - { - RESET_ASSERT(); - oldest_msg = assert_sc[i].oldest_msg_position; - MsgAlloc_BufferAvailableSpaceComputation(); - TEST_ASSERT_EQUAL(assert_sc[i].expected_asserts, IS_ASSERT()); - } - } - - NEW_TEST_CASE("No task is available"); - MsgAlloc_Init(NULL); - { - volatile uint32_t free_space = 0; - oldest_msg = (msg_t *)INT_MAX; // No oldest message - - NEW_STEP("Check remaining space computing for all message size cases"); - for (uint16_t i = 0; i < MSG_BUFFER_SIZE - 2; i++) - { - // Init variables - //--------------- - data_ptr = (uint8_t *)&msg_buffer[i + 1]; - for (uint32_t j = 0; j < MSG_BUFFER_SIZE - 1; j++) - { - // Test is launched only if "data_ptr" doesn't overflows "msg_buffer" size - if (data_ptr < (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE]) - { - RESET_ASSERT(); - // Call function - //--------------- - free_space = MsgAlloc_BufferAvailableSpaceComputation(); - - // Verify - //--------------- - TEST_ASSERT_FALSE(IS_ASSERT()); - TEST_ASSERT_EQUAL(MSG_BUFFER_SIZE, free_space); - - data_ptr++; - } - else - { - break; - } - } - } - } - - NEW_TEST_CASE("Oldest task is between `data_ptr` and the end of message buffer"); - MsgAlloc_Init(NULL); - { - // msg_buffer - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // +------^---------------------^--------------------------------+ - // | | - // |<-----Free space---->| - // | | - // data_ptr oldest_task - - uint32_t free_space = 0; - uint32_t expected_size = 0; - oldest_msg = (msg_t *)&msg_buffer[1]; - data_ptr = (uint8_t *)oldest_msg - 1; - - NEW_STEP("Check remaining space computing for all cases"); - for (uint16_t i = 0; i < MSG_BUFFER_SIZE - 1; i++) - { - oldest_msg = (msg_t *)&msg_buffer[1]; - // for (uint8_t j = 0; j < 2; j++) - for (uint16_t j = i; j < MSG_BUFFER_SIZE - 1; j++) - { - if ((uintptr_t)oldest_msg > (uintptr_t)data_ptr) - { - RESET_ASSERT(); - expected_size = (uintptr_t)oldest_msg - (uintptr_t)data_ptr; - free_space = MsgAlloc_BufferAvailableSpaceComputation(); - TEST_ASSERT_FALSE(IS_ASSERT()); - TEST_ASSERT_EQUAL(expected_size, free_space); - } - // oldest_msg++; - oldest_msg = (msg_t *)&msg_buffer[j + 1]; - } - data_ptr++; - } - } - - NEW_TEST_CASE("Oldest task is between the begin of the buffer and current_msg`"); - MsgAlloc_Init(NULL); - { - // msg_buffer - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // +-------------^---------------------------------^-------------+ - // | | - // <-Free space->| |<-Free space-> - // | | - // | | - // oldest_task data_ptr - - uint32_t free_space = 0; - uint32_t expected_size = 0; - data_ptr = (uint8_t *)&msg_buffer[1]; - oldest_msg = (msg_t *)data_ptr - 1; - - NEW_STEP("Check remaining space computing for all cases"); - // Test remaining space computing for all cases - // while (data_end_estimation < &msg_buffer[MSG_BUFFER_SIZE]) - for (uint16_t i = 0; i < MSG_BUFFER_SIZE - 1; i++) - { - oldest_msg = (msg_t *)&msg_buffer[1]; - for (uint16_t j = 0; j < MSG_BUFFER_SIZE - 1; j++) - { - if ((uintptr_t)oldest_msg < (uintptr_t)data_ptr) - { - RESET_ASSERT(); - expected_size = (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - (uintptr_t)data_ptr; - expected_size += (uintptr_t)oldest_msg - (uintptr_t)&msg_buffer[0]; - free_space = MsgAlloc_BufferAvailableSpaceComputation(); - - TEST_ASSERT_FALSE(IS_ASSERT()); - TEST_ASSERT_EQUAL(expected_size, free_space); - } - oldest_msg = (msg_t *)&msg_buffer[j + 1]; - } - data_ptr++; - } - } -} - -void unittest_OldestMsgCandidate(void) -{ - NEW_TEST_CASE("Verify assertion cases"); - MsgAlloc_Init(NULL); - { -#define assert_nb 6 - typedef struct - { - bool expected_asserts; - msg_t *oldest_stack_msg_pt; - } assert_scenario; - - assert_scenario assert_sc[assert_nb]; - uint32_t free_space = MSG_BUFFER_SIZE; - - // Expected Values - assert_sc[0].expected_asserts = true; - assert_sc[0].oldest_stack_msg_pt = (msg_t *)&msg_buffer[0] - 1; - assert_sc[1].expected_asserts = false; - assert_sc[1].oldest_stack_msg_pt = (msg_t *)&msg_buffer[0]; - assert_sc[2].expected_asserts = false; - assert_sc[2].oldest_stack_msg_pt = (msg_t *)&msg_buffer[1]; - assert_sc[3].expected_asserts = false; - assert_sc[3].oldest_stack_msg_pt = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE - 1]; - assert_sc[4].expected_asserts = true; - assert_sc[4].oldest_stack_msg_pt = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE]; - assert_sc[5].expected_asserts = true; - assert_sc[5].oldest_stack_msg_pt = (msg_t *)&msg_buffer[MSG_BUFFER_SIZE] + 1; - - // Launch test - for (uint8_t i = 0; i < assert_nb; i++) - { - RESET_ASSERT(); - MsgAlloc_OldestMsgCandidate(assert_sc[i].oldest_stack_msg_pt); - NEW_STEP_IN_LOOP("Forbidden values are injected -> Verify function is asserting", i); - TEST_ASSERT_EQUAL(assert_sc[i].expected_asserts, IS_ASSERT()); - } - } - - NEW_TEST_CASE("Verify case \"oldest_stack_msg_pt\" is NULL"); - MsgAlloc_Init(NULL); - { - // Pass NULL pointer to MsgAlloc_OldestMsgCandidate => oldest_msg doesn't change - // - // msg_buffer - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^-------------------------------------------------------------+ - // | - // oldest_msg - - oldest_msg = (msg_t *)&msg_buffer[0]; - volatile msg_t *expected_oldest_msg = oldest_msg; - msg_t *oldest_stack_msg_pt = NULL; - - RESET_ASSERT(); - MsgAlloc_OldestMsgCandidate(oldest_stack_msg_pt); - - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - NEW_STEP("Check oldest message doesn't change"); - TEST_ASSERT_EQUAL(expected_oldest_msg, oldest_msg); - } - - NEW_TEST_CASE("Verify other cases"); - MsgAlloc_Init(NULL); - { -#define CASE 18 - msg_t *oldest_stack_msg_pt; - volatile msg_t *expected_oldest_msg; - - // Array with all possible cases - int cases[CASE][4] = {// current_msg oldest_msg oldest_stack_msg_pt expected_oldest_msg - {/* */ 0, /* */ 1, /* */ 2, /* */ 1}, - {/* */ 0, /* */ 2, /* */ 1, /* */ 1}, - {/* */ 1, /* */ 0, /* */ 2, /* */ 2}, - {/* */ 1, /* */ 2, /* */ 0, /* */ 2}, - {/* */ 2, /* */ 0, /* */ 1, /* */ 0}, - {/* */ 2, /* */ 1, /* */ 0, /* */ 0}, - {/* */ 0, /* */ 1, /* */ 0, /* */ 1}, - {/* */ 0, /* */ 2, /* */ 0, /* */ 2}, - {/* */ 1, /* */ 0, /* */ 1, /* */ 0}, - {/* */ 1, /* */ 2, /* */ 1, /* */ 2}, - {/* */ 2, /* */ 0, /* */ 2, /* */ 0}, - {/* */ 2, /* */ 1, /* */ 2, /* */ 1}, - {/* */ 0, /* */ 1, /* */ 1, /* */ 1}, - {/* */ 0, /* */ 2, /* */ 2, /* */ 2}, - {/* */ 1, /* */ 0, /* */ 0, /* */ 0}, - {/* */ 1, /* */ 2, /* */ 2, /* */ 2}, - {/* */ 2, /* */ 0, /* */ 0, /* */ 0}, - {/* */ 2, /* */ 1, /* */ 1, /* */ 1}}; - - for (uint8_t i = 0; i < CASE; i++) - { - data_ptr = (uint8_t *)&msg_buffer[cases[i][0]]; - oldest_msg = (msg_t *)&msg_buffer[cases[i][1]]; - oldest_stack_msg_pt = (msg_t *)&msg_buffer[cases[i][2]]; - expected_oldest_msg = (msg_t *)&msg_buffer[cases[i][3]]; - MsgAlloc_OldestMsgCandidate(oldest_stack_msg_pt); - NEW_STEP_IN_LOOP("Check all pointers cases", i); - TEST_ASSERT_EQUAL(expected_oldest_msg, oldest_msg); - } - } -} - -void unittest_ClearMsgSpace(void) -{ - NEW_TEST_CASE("There is not enough space in memory"); - MsgAlloc_Init(NULL); - { - // - // msg_buffer - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // |-------------------------------------------------------------+ ^ - // | - // pointer - // - void *memory_start = (void *)&msg_buffer[0]; - void *memory_end = (void *)&msg_buffer[MSG_BUFFER_SIZE]; - - NEW_STEP("Check function returns FAILED"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_ClearMsgSpace(memory_start, memory_end)); - } - - NEW_TEST_CASE("Drop used messages"); - MsgAlloc_Init(NULL); - { - // used_msg will be dropped - // - // msg_buffer - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^-------^----------^------------------------------------------+ - // | | | - // start used_msg end - - void *memory_start; - void *memory_end; - memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, - .engine_msg_stack_ratio = 0, - .tx_msg_stack_ratio = 0, - .buffer_occupation_ratio = 0, - .msg_drop_number = 0}; - - memset(&memory_stats, 0, sizeof(memory_stats)); - MsgAlloc_Init(&memory_stats); - - used_msg = (msg_t *)&msg_buffer[1]; - memory_start = (void *)&msg_buffer[0]; - memory_end = (void *)&msg_buffer[2]; - - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_ClearMsgSpace(memory_start, memory_end)); - NEW_STEP("Check buffer occupation is 100\%"); - TEST_ASSERT_EQUAL(100, memory_stats.buffer_occupation_ratio); - NEW_STEP("Check there is 1 dropped message"); - TEST_ASSERT_EQUAL(1, memory_stats.msg_drop_number); - NEW_STEP("Check used message is cleaned"); - TEST_ASSERT_NULL(used_msg); - - NEW_STEP("Check drop counter validity for all cases"); - for (uint8_t i = 1; i < 0xFF; i++) - { - used_msg = (msg_t *)&msg_buffer[1]; - MsgAlloc_ClearMsgSpace(memory_start, memory_end); - TEST_ASSERT_EQUAL(i + 1, memory_stats.msg_drop_number); - } - - used_msg = (msg_t *)&msg_buffer[1]; - memory_stats.msg_drop_number = 255; - MsgAlloc_ClearMsgSpace(memory_start, memory_end); - - NEW_STEP("Check drop counter has reached max value"); - TEST_ASSERT_EQUAL(255, memory_stats.msg_drop_number); - } - - NEW_TEST_CASE("Drop all messages from luos_tasks"); - MsgAlloc_Init(NULL); - { - // All messages of luos_tasks will be dropped - // - // Init state - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^-------------------^----------^-----------------------------^+ - // | | | | - // used_msg start oldest_msg end - // - // Luos_tasks - // +---------+ - // | Task D1 | - // |---------| - // +---------+ - // | Task D2 | - // |---------| - // +---------+ - // | etc... | - // |---------| - // +---------+ - // | LastTask| - // |---------| - - // Ending state - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^------------------------------^------------------------------+ - // | | - // used_msg oldest_msg - // - // Luos_tasks - // +---------+ - // | 0 | - // |---------| - // +---------+ - // | 0 | - // |---------| - // +---------+ - // | etc... | - // |---------| - // +---------+ - // | 0 | - // |---------| - - void *memory_start; - void *memory_end; - memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, - .engine_msg_stack_ratio = 0, - .tx_msg_stack_ratio = 0, - .buffer_occupation_ratio = 0, - .msg_drop_number = 0}; - - memset(&memory_stats, 0, sizeof(memory_stats)); - MsgAlloc_Init(&memory_stats); - - for (uint16_t i = 0; i < MAX_MSG_NB - 2; i++) - { - luos_tasks[i].msg_pt = (msg_t *)&msg_buffer[i + 2]; - luos_tasks[i].service_pt = (service_t *)&msg_buffer[i + 2]; - } - used_msg = (msg_t *)&msg_buffer[0]; - oldest_msg = (msg_t *)&msg_buffer[2]; - memory_start = (void *)&msg_buffer[1]; - memory_end = (void *)&msg_buffer[MAX_MSG_NB - 1]; - luos_tasks_stack_id = MAX_MSG_NB; - - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_ClearMsgSpace(memory_start, memory_end)); - NEW_STEP("Check buffer occupation is 100\%"); - TEST_ASSERT_EQUAL(100, memory_stats.buffer_occupation_ratio); - NEW_STEP("Check \"luos tasks stack id\" equals 2"); - TEST_ASSERT_EQUAL(2, luos_tasks_stack_id); - NEW_STEP("Check that MAX_MSG_NB - 2 messages has been dropped"); - TEST_ASSERT_EQUAL(MAX_MSG_NB - 2, memory_stats.msg_drop_number); - NEW_STEP("Check Luos Tasks are all reseted"); - for (uint16_t i = 0; i < MAX_MSG_NB - 2; i++) - { - TEST_ASSERT_EQUAL(0, luos_tasks[i].msg_pt); - TEST_ASSERT_EQUAL(0, luos_tasks[i].service_pt); - } - } - - NEW_TEST_CASE("Drop all messages from msg_tasks"); - MsgAlloc_Init(NULL); - { - // All messages of msg_tasks will be dropped - // - // Init state - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^-------------------^----------^-----------------------------^+ - // | | | | - // used_msg start oldest_msg end - // - // msg_tasks - // +---------+ - // | Task A1 | - // |---------| - // +---------+ - // | Task A2 | - // |---------| - // +---------+ - // | etc... | - // |---------| - // +---------+ - // | LastTask| - // |---------| - - // Ending state - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^------------------------------^------------------------------+ - // | | - // used_msg oldest_msg - // - // msg_tasks - // +---------+ - // | 0 | - // |---------| - // +---------+ - // | 0 | - // |---------| - // +---------+ - // | etc... | - // |---------| - // +---------+ - // | 0 | - // |---------| - - void *memory_start; - void *memory_end; - memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, - .engine_msg_stack_ratio = 0, - .tx_msg_stack_ratio = 0, - .buffer_occupation_ratio = 0, - .msg_drop_number = 0}; - - memset(&memory_stats, 0, sizeof(memory_stats)); - MsgAlloc_Init(&memory_stats); - - for (uint16_t i = 0; i < MAX_MSG_NB - 2; i++) - { - msg_tasks[i] = (msg_t *)&msg_buffer[i + 2]; - } - used_msg = (msg_t *)&msg_buffer[0]; - oldest_msg = (msg_t *)&msg_buffer[2]; - memory_start = (void *)&msg_buffer[1]; - memory_end = (void *)&msg_buffer[MAX_MSG_NB - 1]; - msg_tasks_stack_id = MAX_MSG_NB; - - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_ClearMsgSpace(memory_start, memory_end)); - NEW_STEP("Check buffer occupation is 100\%"); - TEST_ASSERT_EQUAL(100, memory_stats.buffer_occupation_ratio); - NEW_STEP("Check \"luos tasks stack id\" equals 2"); - TEST_ASSERT_EQUAL(2, msg_tasks_stack_id); - NEW_STEP("Check that MAX_MSG_NB - 2 messages has been dropped"); - TEST_ASSERT_EQUAL(MAX_MSG_NB - 2, memory_stats.msg_drop_number); - NEW_STEP("Check Message Tasks are all reseted"); - for (uint16_t i = 0; i < MAX_MSG_NB - 2; i++) - { - TEST_ASSERT_EQUAL(0, msg_tasks[i]); - } - } - - NEW_TEST_CASE("Drop all messages from tx_tasks"); - MsgAlloc_Init(NULL); - { - // All messages of tx_tasks will be dropped - // - // Init state - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^-------------------^----------^-----------------------------^+ - // | | | | - // used_msg start oldest_msg end - // - // tx_tasks - // +---------+ - // | Task E1 | - // |---------| - // +---------+ - // | Task E2 | - // |---------| - // +---------+ - // | etc... | - // |---------| - // +---------+ - // | LastTask| - // |---------| - - // Ending state - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^------------------------------^------------------------------+ - // | | - // used_msg oldest_msg - // - // tx_tasks - // +---------+ - // | 0 | - // |---------| - // +---------+ - // | 0 | - // |---------| - // +---------+ - // | etc... | - // |---------| - // +---------+ - // | 0 | - // |---------| - - void *memory_start; - void *memory_end; - memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, - .engine_msg_stack_ratio = 0, - .tx_msg_stack_ratio = 0, - .buffer_occupation_ratio = 0, - .msg_drop_number = 0}; - - memset(&memory_stats, 0, sizeof(memory_stats)); - MsgAlloc_Init(&memory_stats); - - for (uint16_t i = 0; i < MAX_MSG_NB - 2; i++) - { - tx_tasks[i].data_pt = (uint8_t *)&msg_buffer[i + 2]; - tx_tasks[i].size = (uint16_t)i; - } - used_msg = (msg_t *)&msg_buffer[0]; - oldest_msg = (msg_t *)&msg_buffer[2]; - memory_start = (void *)&msg_buffer[1]; - memory_end = (void *)&msg_buffer[MAX_MSG_NB - 1]; - tx_tasks_stack_id = MAX_MSG_NB; - - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_ClearMsgSpace(memory_start, memory_end)); - NEW_STEP("Check buffer occupation is 100\%"); - TEST_ASSERT_EQUAL(100, memory_stats.buffer_occupation_ratio); - NEW_STEP("Check \"luos tasks stack id\" equals 2"); - TEST_ASSERT_EQUAL(2, tx_tasks_stack_id); - NEW_STEP("Check that MAX_MSG_NB - 2 messages has been dropped"); - TEST_ASSERT_EQUAL(MAX_MSG_NB - 2, memory_stats.msg_drop_number); - NEW_STEP("Check Tx Tasks are all reseted"); - for (uint16_t i = 0; i < MAX_MSG_NB - 2; i++) - { - TEST_ASSERT_EQUAL(0, tx_tasks[i].data_pt); - TEST_ASSERT_EQUAL(0, tx_tasks[i].size); - } - } -} - -void unittest_ClearMsgTask(void) -{ - NEW_TEST_CASE("Clear Message Task"); - MsgAlloc_Init(NULL); - { - // Last Message Task is cleared - // - // Init state - // msg_tasks - // +---------+ - // | Task A1 | - // |---------| - // +---------+ - // | Task A2 | - // |---------| - // +---------+ - // | etc... | - // |---------| - // +---------+ - // | LastTask| - // |---------| - // - // Ending state - // - // msg_tasks - // +---------+ - // | Task A1 | - // |---------| - // +---------+ - // | Task A2 | - // |---------| - // +---------+ - // | etc... | - // |---------| - // +---------+ - // | 0 | - // |---------| - - msg_t *expected_msg_tasks[MAX_MSG_NB]; - msg_tasks_stack_id = MAX_MSG_NB; - - // To avoid assert - msg_tasks[0] = (msg_t *)&msg_buffer[0]; - luos_tasks[0].msg_pt = (msg_t *)&msg_buffer[0]; - tx_tasks[0].data_pt = (uint8_t *)&msg_buffer[0]; - - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - msg_tasks[i] = (msg_t *)(&msg_buffer[0] + i); - expected_msg_tasks[i] = (msg_t *)(&msg_buffer[0] + i + 1); - } - - // Last Msg Task must be cleared - expected_msg_tasks[MAX_MSG_NB - 1] = 0; - MsgAlloc_ClearMsgTask(); - - NEW_STEP("Check NO assert has occured"); - NEW_STEP("Check last message task is cleared in all cases"); - for (uint16_t i = 0; i < MAX_MSG_NB; i++) - { - TEST_ASSERT_FALSE(IS_ASSERT()); - TEST_ASSERT_EQUAL(expected_msg_tasks[i], msg_tasks[i]); - } - TEST_ASSERT_EQUAL(MAX_MSG_NB - 1, msg_tasks_stack_id); - } -} - -void unittest_ClearLuosTask(void) -{ - NEW_TEST_CASE("Verify assertion cases"); - MsgAlloc_Init(NULL); - { - uint16_t luos_task_id; - - for (uint16_t i = 0; i <= MAX_MSG_NB + 2; i++) - { - MsgAlloc_Init(NULL); - luos_tasks_stack_id = i; - for (uint16_t j = 0; j <= MAX_MSG_NB + 2; j++) - { - luos_task_id = j; - RESET_ASSERT(); - if ((luos_task_id >= luos_tasks_stack_id) || (luos_tasks_stack_id > MAX_MSG_NB)) - { - NEW_STEP_IN_LOOP("Check assert has occured", (MAX_MSG_NB + 2) * i + i + j); - MsgAlloc_ClearLuosTask(luos_task_id); - TEST_ASSERT_TRUE(IS_ASSERT()); - } - else - { - NEW_STEP_IN_LOOP("Check NO assert has occured", (MAX_MSG_NB + 2) * i + i + j); - MsgAlloc_ClearLuosTask(luos_task_id); - TEST_ASSERT_FALSE(IS_ASSERT()); - } - } - } - } - - NEW_TEST_CASE("Clear Luos Tasks"); - MsgAlloc_Init(NULL); - { - // Last Luos Task is cleared - // - // Init state - // Luos_tasks - // +---------+ - // | Task D1 | - // |---------| - // +---------+ - // | Task D2 | - // |---------| - // +---------+ - // | etc... | - // |---------| - // +---------+ - // | LastTask| - // |---------| - // - // Ending state - // - // Luos_tasks - // +---------+ - // | Task D1 | - // |---------| - // +---------+ - // | Task D2 | - // |---------| - // +---------+ - // | etc... | - // |---------| - // +---------+ - // | 0 | - // |---------| - - luos_task_t expected_luos_tasks[MAX_MSG_NB]; - - NEW_STEP("Check Luos Task is cleared in all cases"); - for (uint16_t task_id = 0; task_id < MAX_MSG_NB; task_id++) - { - for (uint16_t tasks_stack_id = task_id + 1; tasks_stack_id <= MAX_MSG_NB; tasks_stack_id++) - { - // Initialisation - MsgAlloc_Init(NULL); - luos_tasks_stack_id = tasks_stack_id; - - for (uint16_t pt_value = 0; pt_value < MAX_MSG_NB; pt_value++) - { - // Init luos_tasks pointers - luos_tasks[pt_value].msg_pt = (msg_t *)(&msg_buffer[0] + pt_value); - luos_tasks[pt_value].service_pt = (service_t *)(&msg_buffer[0] + pt_value); - - // Init expected pointers - if (pt_value == (tasks_stack_id - 1)) - { - expected_luos_tasks[pt_value].msg_pt = 0; - expected_luos_tasks[pt_value].service_pt = 0; - } - else if (pt_value < task_id) - { - expected_luos_tasks[pt_value].msg_pt = (msg_t *)(&msg_buffer[0] + pt_value); - expected_luos_tasks[pt_value].service_pt = (service_t *)(&msg_buffer[0] + pt_value); - } - else - { - expected_luos_tasks[pt_value].msg_pt = (msg_t *)(&msg_buffer[0] + pt_value + 1); - expected_luos_tasks[pt_value].service_pt = (service_t *)(&msg_buffer[0] + pt_value + 1); - } - } - - // Launch test - RESET_ASSERT(); - MsgAlloc_ClearLuosTask(task_id); - - // Analyze test results - for (uint8_t i = 0; i < tasks_stack_id; i++) - { - TEST_ASSERT_EQUAL(expected_luos_tasks[i].msg_pt, luos_tasks[i].msg_pt); - TEST_ASSERT_EQUAL(expected_luos_tasks[i].service_pt, luos_tasks[i].service_pt); - } - } - } - } -} diff --git a/test/test_msg_alloc/unit_test_mem_alloc_tx.c b/test/test_msg_alloc/unit_test_mem_alloc_tx.c deleted file mode 100644 index e94f295a1..000000000 --- a/test/test_msg_alloc/unit_test_mem_alloc_tx.c +++ /dev/null @@ -1,601 +0,0 @@ -#include "main.h" -#include "unit_test.h" -#include "msg_alloc.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define MSG_START 10 -#undef VERBOSE_LOCALHOST - -/******************************************************************************* - * Definitions - ******************************************************************************/ -typedef struct __attribute__((__packed__)) -{ - msg_t *msg_pt; /*!< Start pointer of the msg on msg_buffer. */ - service_t *service_pt; /*!< Pointer to the concerned service. */ -} luos_task_t; - -typedef struct -{ - uint8_t *data_pt; /*!< Start pointer of the data on msg_buffer. */ - uint16_t size; /*!< size of the data. */ - service_t *service_pt; /*!< Pointer to the transmitting service. */ -} tx_task_t; - -/******************************************************************************* - * Variables - ******************************************************************************/ -extern memory_stats_t *mem_stat; -extern volatile bool reset_needed; -extern volatile uint8_t msg_buffer[MSG_BUFFER_SIZE]; -extern volatile uint8_t *data_ptr; -extern volatile msg_t *oldest_msg; -extern volatile msg_t *used_msg; -extern volatile header_t *copy_task_pointer; -extern volatile msg_t *msg_tasks[MAX_MSG_NB]; -extern volatile uint16_t msg_tasks_stack_id; -extern volatile luos_task_t luos_tasks[MAX_MSG_NB]; -extern volatile uint16_t luos_tasks_stack_id; -extern volatile tx_task_t tx_tasks[MAX_MSG_NB]; -extern volatile uint16_t tx_tasks_stack_id; - -/******************************************************************************* - * Function - ******************************************************************************/ -void unittest_SetTxTask_buffer_full() -{ - //************************************************************** - NEW_TEST_CASE("Check if TX message buffer stack is full"); - MsgAlloc_Init(NULL); - { - // tx_tasks_stack_id = MAX_MSG_NB - // - // tx_tasks init state - // - // +---------+ - // | Tx 1 | - // |---------| - // | Tx 2 | - // |---------| - // | etc... | - // |---------| - // | Tx 10 | - // +---------+<--tx_tasks_stack_id - - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Init variables - //--------------- - uint8_t dummy_data = 1; // To avoid assert - tx_tasks_stack_id = MAX_MSG_NB - 1; - - // Call function and Verify - //--------------------------- - for (uint16_t i = MAX_MSG_NB - 1; i < MAX_MSG_NB + 2; i++) - { - RESET_ASSERT(); - NEW_STEP_IN_LOOP("Function returns FAILED when \"tx tasks stack id\" overflows", i - (MAX_MSG_NB - 1)); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, &dummy_data, crc, size, localhost, ack)); - NEW_STEP_IN_LOOP("Check NO assert has occured", i - (MAX_MSG_NB - 1)); - TEST_ASSERT_FALSE(IS_ASSERT()); - } - } -} - -void unittest_SetTxTask_Tx_too_long() -{ - //************************************************************** - NEW_TEST_CASE("Tx message doesn't fit in msg buffer"); - MsgAlloc_Init(NULL); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Tx message doesn't fit in msg buffer function should assert - // - // Tx message to copy - // +-------------------------------------------------------------+ - // |---|other msgs|-----------------------------| Tx | - // +-------------------------------------------------------------+ - // - - // Init variables - //--------------- - uint16_t tx_size = 50; - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size / 2)]; // There are only 25 bytes left in msg buffer - oldest_msg = (msg_t *)&msg_buffer[10]; // There is a task - tx_tasks_stack_id = 1; - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Check assert has occured"); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); - } -} -void unittest_SetTxTask_Tx_overflow() -{ - //************************************************************** - NEW_TEST_CASE("Tx message doesn't fit in message buffer\n" - "There is space at begin of message buffer"); - MsgAlloc_Init(NULL); - memset((void *)msg_buffer, 0, sizeof(msg_buffer)); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Tx message doesn't fit in msg buffer. - // There is space in the begining of the buffer: move messages and create Tx Task - // - // - // Tx message to copy - // +-------------------------------------------------------------+ - // |--------------------------------------------------| Tx | - // +-------------------------------------------------------------+ - // - // Init variables - //--------------- - tx_task_t expected_tx_task; - uint8_t *expected_data_ptr; - uint16_t tx_size = 50; - uint8_t tx_message[tx_size]; - ack = 0; - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size / 2)]; // There are only 25 bytes left in msg buffer - oldest_msg = (msg_t *)&msg_buffer[80]; - tx_tasks_stack_id = 1; - - expected_data_ptr = (uint8_t *)((uintptr_t)msg_buffer + tx_size); - - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)msg_buffer; - expected_tx_task.service_pt = service_pt; - - // Init Tx message - for (size_t i = 0; i < tx_size - CRC_SIZE; i++) - { - tx_message[i] = i; - } - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - - // Check pointers - NEW_STEP("Check \"tx tasks stack id\" is incremented to 2"); - TEST_ASSERT_EQUAL(2, tx_tasks_stack_id); - NEW_STEP("Check \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - - // Check Tx Tasks - tx_tasks_stack_id--; - NEW_STEP("Check Tx task \"size\" is correctly computed"); - TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); - NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); - NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL((uint8_t *)msg_buffer, tx_tasks[tx_tasks_stack_id].data_pt); - -#ifdef UNIT_TEST_DEBUG - printf("\n"); - for (uint16_t i = 0; i < MSG_BUFFER_SIZE; i++) - { - printf("%d - ", msg_buffer[i]); - } - printf("\n"); -#endif - - // Check messages - NEW_STEP("Check Tx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(tx_message, msg_buffer, tx_size - CRC_SIZE); - } -} -void unittest_SetTxTask_Tx_fit() -{ - //************************************************************** - NEW_TEST_CASE("Tx message fit in msg buffer"); - MsgAlloc_Init(NULL); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Tx message fits in msg buffer. - // - // Tx message fit - // +-------------------------------------------------------------+ - // |-------------------------------| Tx |------| - // +-------------------------------------------------------------+ - // - - // Init variables - //--------------- - uint16_t tx_size = 50; - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - (tx_size + 20)]; // There are 70 bytes left in msg buffer // Rx message = 30 bytes - oldest_msg = (msg_t *)((uintptr_t)data_ptr - tx_size); // There is a task before - tx_tasks_stack_id = 1; - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - } -} -void unittest_SetTxTask_Task_already_exists() -{ - //************************************************************** - NEW_TEST_CASE("Tx messages fit in message buffer, but there is already a task in memory"); - MsgAlloc_Init(NULL); - memset((void *)msg_buffer, 0, sizeof(msg_buffer)); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // - // Tx message hit the next task - // +-------------------------------------------------------------+ - // |------------------------| Tx |Task|--------------------| - // +-------------------------------------------------------------+ - // - - // Init variables - //--------------- - uint16_t tx_size = 50; - ack = 0; - localhost = LOCALHOST; - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - tx_size]; // Tx message = 50 bytes - data_ptr = (uint8_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty - oldest_msg = (msg_t *)&msg_buffer[(uintptr_t)data_ptr + 1]; // There is a Task - tx_tasks_stack_id = 1; - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - MsgAlloc_SetTxTask(service_pt, data, crc, tx_size, localhost, ack); - NEW_STEP("Check assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - } -} - -void unittest_SetTxTask_ACK() -{ - //************************************************************** - NEW_TEST_CASE("Ack transmission"); - MsgAlloc_Init(NULL); - memset((void *)msg_buffer, 0, sizeof(msg_buffer)); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost = EXTERNALHOST; - uint8_t ack; - - // Tx message size > Rx size currently received. - // Tx and Rx messages fit in msg buffer. - // There is space : move messages and create Tx Task - // Add Ack - // - // Tx message + Rx message to copy - // +-------------------------------------------------------------+ - // |----------------------------------| Rx |---------------------| - // |----------------------------------| Tx |-----------------| - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |----------------------------------| Tx + Ack | Rx |------| - // +-------------------------------------------------------------+ - - // Init variables - //--------------- - tx_task_t expected_tx_task; - uint8_t *expected_data_ptr; - uint16_t tx_size = 50 + sizeof(ack); - uint8_t tx_message[tx_size]; - ack = 55; - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)tx_message; // Tx message = 51 bytes - data_ptr = (uint8_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty - oldest_msg = (msg_t *)&msg_buffer[2 * tx_size + 1]; // No Task - tx_tasks_stack_id = 1; - - expected_data_ptr = (uint8_t *)((uintptr_t)data_ptr + tx_size); // Rx message will be copied after Tx message - - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)data_ptr; - expected_tx_task.service_pt = service_pt; - - // Init Tx message - for (size_t i = 0; i < tx_size - CRC_SIZE - sizeof(ack); i++) - { - tx_message[i] = i; - } - tx_message[tx_size] = ack; - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - - // Check pointers - NEW_STEP("Check \"tx tasks stack id\" is incremented to 2"); - TEST_ASSERT_EQUAL(2, tx_tasks_stack_id); - NEW_STEP("Check \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - - // Check Tx Tasks - tx_tasks_stack_id--; - NEW_STEP("Check Tx task \"size\" is correctly computed"); - TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); - NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); - NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[MSG_START], tx_tasks[tx_tasks_stack_id].data_pt); - -#ifdef UNIT_TEST_DEBUG - printf("\n"); - for (uint16_t i = 0; i < MSG_BUFFER_SIZE; i++) - { - printf("%d - ", msg_buffer[i]); - } - printf("\n"); -#endif - - // Check messages - NEW_STEP("Check ACK : good value in good memory position"); - TEST_ASSERT_EQUAL(ack, msg_buffer[MSG_START + tx_size - 1]); // Ack - NEW_STEP("Check Tx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(tx_message, (uint8_t *)&msg_buffer[MSG_START], tx_size - CRC_SIZE - 1); - } -} - -void unittest_SetTxTask_internal_localhost() -{ - //************************************************************** - NEW_TEST_CASE("Internal Localhost"); - MsgAlloc_Init(NULL); - memset((void *)msg_buffer, 0, sizeof(msg_buffer)); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost; - uint8_t ack; - - // Tx message size > Rx size currently received. - // Tx and Rx messages fit in msg buffer. - // LocalHost : Compute msg_tasks[0] - // - // Tx message + Rx message to copy - // +-------------------------------------------------------------+ - // |----------------------------------| Rx |---------------------| - // |----------------------------------| Tx |-----------------| - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |----------------------------------| Tx | Rx |------------| - // +----------------------------------^--------------------------+ - // | - // msg_tasks[0] - - // Init variables - //--------------- - tx_task_t expected_tx_task; - uint8_t *expected_data_ptr; - uint16_t tx_size = 50; - uint8_t tx_message[tx_size]; - - ack = 0; - localhost = LOCALHOST; // Localhost : to fill msg_task - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)tx_message; // Tx message = 50 bytes - data_ptr = (uint8_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty - oldest_msg = (msg_t *)&msg_buffer[2 * tx_size + 1]; // No Task - tx_tasks_stack_id = 1; - msg_tasks_stack_id = 0; - - expected_data_ptr = (uint8_t *)((uintptr_t)data_ptr + tx_size); - - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)data_ptr; - expected_tx_task.service_pt = service_pt; - - // Init Tx message - for (size_t i = 0; i < tx_size - CRC_SIZE; i++) - { - tx_message[i] = i; - } - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - - // Check pointers - NEW_STEP("Check \"tx tasks stack id\" = 1"); - TEST_ASSERT_EQUAL(1, tx_tasks_stack_id); - NEW_STEP("Check \"message tasks stack id\" = 1"); - TEST_ASSERT_EQUAL(1, msg_tasks_stack_id); - - NEW_STEP("Check \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - - // Check Tx Tasks is void - tx_tasks_stack_id--; - NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_NULL(tx_tasks[tx_tasks_stack_id].service_pt); - NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); - TEST_ASSERT_NULL(tx_tasks[tx_tasks_stack_id].data_pt); - NEW_STEP("Check Tx task \"size\" = 0"); - TEST_ASSERT_EQUAL(0, tx_tasks[tx_tasks_stack_id].size); - - // Check Message Tasks - NEW_STEP("Check \"message tasks\" points to expected message"); - TEST_ASSERT_EQUAL((msg_t *)&msg_buffer[MSG_START], msg_tasks[msg_tasks_stack_id - 1]); - -#ifdef UNIT_TEST_DEBUG - printf("\n"); - for (uint16_t i = 0; i < MSG_BUFFER_SIZE; i++) - { - printf("%d - ", msg_buffer[i]); - } - printf("\n"); -#endif - - // Check messages - NEW_STEP("Check Tx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(tx_message, (uint8_t *)&msg_buffer[MSG_START], tx_size - CRC_SIZE); - } -} - -void unittest_SetTxTask_multihost() -{ //************************************************************** - NEW_TEST_CASE("MultiHost"); - MsgAlloc_Init(NULL); - memset((void *)msg_buffer, 0, sizeof(msg_buffer)); - { - error_return_t result; - uint8_t *data; - service_t *service_pt; - uint16_t crc; - uint16_t size; - luos_localhost_t localhost; - uint8_t ack; - - // Tx message size > Rx size currently received. - // Tx and Rx messages fit in msg buffer. - // MultiHost : Compute msg_tasks[0] + tx_tasks - // - // Tx message + Rx message to copy - // +-------------------------------------------------------------+ - // |----------------------------------| Rx |---------------------| - // |----------------------------------| Tx |-----------------| - // +-------------------------------------------------------------+ - // - // msg_buffer ending state - // +-------------------------------------------------------------+ - // |----------------------------------| Tx | Rx |------------| - // +----------------------------------^--------------------------+ - // | - // msg_tasks[0] - // tx_tasks[x] - - // Init variables - //--------------- - tx_task_t expected_tx_task; - uint8_t *expected_data_ptr; - uint16_t tx_size = 50; - uint8_t tx_message[tx_size]; - - ack = 0; - localhost = MULTIHOST; - service_pt = (service_t *)msg_buffer; // Fake service value - data = (uint8_t *)tx_message; // Tx message = 50 bytes - data_ptr = (uint8_t *)&msg_buffer[MSG_START]; // msg buffer is almost empty - oldest_msg = (msg_t *)&msg_buffer[2 * tx_size + 1]; // No Task - tx_tasks_stack_id = 1; - msg_tasks_stack_id = 0; - - expected_data_ptr = (uint8_t *)((uintptr_t)data_ptr + tx_size); - - expected_tx_task.size = tx_size; - expected_tx_task.data_pt = (uint8_t *)data_ptr; - expected_tx_task.service_pt = service_pt; - - // Init Tx message - for (size_t i = 0; i < tx_size - CRC_SIZE; i++) - { - tx_message[i] = i; - } - - // Call function and Verify - //--------------------------- - RESET_ASSERT(); - NEW_STEP("Check function returns SUCCEED"); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_SetTxTask(service_pt, tx_message, crc, tx_size, localhost, ack)); - NEW_STEP("Check NO assert has occured"); - TEST_ASSERT_FALSE(IS_ASSERT()); - - // Check pointers - NEW_STEP("Check \"tx tasks stack id\" is double incremented"); - TEST_ASSERT_EQUAL(2, tx_tasks_stack_id); // 2 incrementations : 1 for tx_tasks + 1 for message_tasks - NEW_STEP("Check \"message tasks stack id\" = 1"); - TEST_ASSERT_EQUAL(1, msg_tasks_stack_id); - - NEW_STEP("Check \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(expected_data_ptr, data_ptr); - - // Check Tx Tasks AND Message Tasks - tx_tasks_stack_id--; - NEW_STEP("Check Tx task \"size\" is correctly computed"); - TEST_ASSERT_EQUAL(tx_size, tx_tasks[tx_tasks_stack_id].size); - NEW_STEP("Check Tx task \"service pointer\" is correctly computed"); - TEST_ASSERT_EQUAL(service_pt, tx_tasks[tx_tasks_stack_id].service_pt); - NEW_STEP("Check Tx task \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[MSG_START], tx_tasks[tx_tasks_stack_id].data_pt); - NEW_STEP("Check message task \"data pointer\" is correctly computed"); - TEST_ASSERT_EQUAL((msg_t *)&msg_buffer[MSG_START], msg_tasks[msg_tasks_stack_id - 1]); - -#ifdef UNIT_TEST_DEBUG - printf("\n"); - for (uint16_t i = 0; i < MSG_BUFFER_SIZE; i++) - { - printf("%d - ", msg_buffer[i]); - } - printf("\n"); -#endif - - // Check messages - NEW_STEP("Check Tx message integrity : correct values in correct memory position"); - TEST_ASSERT_EQUAL_MEMORY(tx_message, (uint8_t *)&msg_buffer[MSG_START], tx_size - CRC_SIZE); - } -} diff --git a/test/test_timestamp/main.c b/test/test_timestamp/main.c index 8059e9e2c..fed8a6f78 100644 --- a/test/test_timestamp/main.c +++ b/test/test_timestamp/main.c @@ -5,7 +5,7 @@ extern volatile uint8_t msg_buffer[MSG_BUFFER_SIZE]; extern default_scenario_t default_sc; -static void MessageHandler(service_t *service, msg_t *msg) +static void MessageHandler(service_t *service, const msg_t *msg) { default_sc.App_1.last_rx_msg.header.config = msg->header.config; default_sc.App_1.last_rx_msg.header.size = msg->header.size; diff --git a/tool_services/gate/TinyJSON/bootloader_ex.h b/tool_services/gate/TinyJSON/bootloader_ex.h index ab1aef3c7..fe5531d51 100644 --- a/tool_services/gate/TinyJSON/bootloader_ex.h +++ b/tool_services/gate/TinyJSON/bootloader_ex.h @@ -7,7 +7,6 @@ #ifndef BOOTLOADER_EX_H #define BOOTLOADER_EX_H -#include "struct_io.h" #include "luos_engine.h" #include "tiny-json.h" /******************************************************************************* @@ -26,4 +25,4 @@ void Bootloader_JsonToLuos(service_t *, char *, json_t const *); uint16_t Bootloader_StartData(char *); void Bootloader_EndData(service_t *, char *, char *); -#endif /* BOOTLOADER_H */ \ No newline at end of file +#endif /* BOOTLOADER_H */ diff --git a/tool_services/gate/TinyJSON/convert.c b/tool_services/gate/TinyJSON/convert.c index daec76345..df0b7a557 100644 --- a/tool_services/gate/TinyJSON/convert.c +++ b/tool_services/gate/TinyJSON/convert.c @@ -925,21 +925,6 @@ void Convert_AssertToData(service_t *service, uint16_t source, luos_assert_t ass // Send the message to pipe PipeLink_Send(service, assert_json, strlen(assert_json)); } -// This function generate a Json about excluded services and send it. -void Convert_ExcludedServiceData(service_t *service) -{ - char json[300]; - search_result_t result; - RTFilter_ID(RTFilter_Reset(&result), service->dead_service_spotted); - if (result.result_nbr == 0) - { - // This can happen if a service is excluded during the detection. - return; - } - sprintf(json, "{\"dead_service\":\"%s\"}\n", result.result_table[0]->alias); - // Send the message to pipe - PipeLink_Send(service, json, strlen(json)); -} /******************************************************************************* * Luos routing table information to Json convertion @@ -1079,4 +1064,4 @@ const char *Convert_StringFromType(luos_type_t type) return "Unknown"; break; } -} \ No newline at end of file +} diff --git a/tool_services/gate/convert.h b/tool_services/gate/convert.h index 0f736e7a5..b97360077 100644 --- a/tool_services/gate/convert.h +++ b/tool_services/gate/convert.h @@ -38,7 +38,6 @@ void Convert_VoidData(service_t *service); // Luos default information to Data convertion void Convert_AssertToData(service_t *service, uint16_t source, luos_assert_t assertion); -void Convert_ExcludedServiceData(service_t *service); // Luos routing table information to Json convertion void Convert_RoutingTableData(service_t *service); diff --git a/tool_services/gate/data_manager.c b/tool_services/gate/data_manager.c index 2e230f85b..971c92a54 100644 --- a/tool_services/gate/data_manager.c +++ b/tool_services/gate/data_manager.c @@ -61,14 +61,6 @@ void DataManager_collect(service_t *service) // This function manage entirely data conversion void DataManager_Run(service_t *service) { - // Check if there is a dead service. - if (service->dead_service_spotted) - { - Convert_ExcludedServiceData(service); - RoutingTB_RemoveOnRoutingTable(service->dead_service_spotted); - // Reset spotted dead service - service->dead_service_spotted = 0; - } #ifdef GATE_POLLING DataManager_collect(service); #endif @@ -77,20 +69,20 @@ void DataManager_Run(service_t *service) // This function manage only commands incoming from pipe void DataManager_RunPipeOnly(service_t *service) { - msg_t *data_msg; + msg_t data_msg; while (Luos_ReadFromService(service, PipeLink_GetId(), &data_msg) == SUCCEED) { // This message is a command from pipe // Convert the received data into Luos commands static char data_cmd[GATE_BUFF_SIZE]; - if (data_msg->header.cmd == PARAMETERS) + if (data_msg.header.cmd == PARAMETERS) { uintptr_t pointer; - memcpy(&pointer, data_msg->data, sizeof(void *)); + memcpy(&pointer, data_msg.data, sizeof(void *)); PipeLink_SetDirectPipeSend((void *)pointer); continue; } - if (Luos_ReceiveData(service, data_msg, data_cmd) > 0) + if (Luos_ReceiveData(service, &data_msg, data_cmd) > 0) { // We finish to receive this data, execute the received command Convert_DataToLuos(service, data_cmd); @@ -99,7 +91,7 @@ void DataManager_RunPipeOnly(service_t *service) if (Luos_ReadMsg(service, &data_msg) == SUCCEED) { // Check if a node send a end detection - if (data_msg->header.cmd == END_DETECTION) + if (data_msg.header.cmd == END_DETECTION) { // Find a pipe PipeLink_Find(service); @@ -120,16 +112,16 @@ void DataManager_RunPipeOnly(service_t *service) // This function will create a data string for services datas void DataManager_Format(service_t *service) { - static uint32_t FirstNoReceptionDate = 0; - static uint32_t LastVoidMsg = 0; char data[GATE_BUFF_SIZE]; - char *data_ptr = data; char boot_data[GATE_BUFF_SIZE]; - char *boot_data_ptr = boot_data; - msg_t *data_msg = 0; - uint8_t data_ok = false; - uint8_t boot_data_ok = false; + msg_t data_msg; search_result_t result; + static uint32_t FirstNoReceptionDate = 0; + static uint32_t LastVoidMsg = 0; + char *data_ptr = data; + char *boot_data_ptr = boot_data; + uint8_t data_ok = false; + uint8_t boot_data_ok = false; RTFilter_Reset(&result); @@ -145,28 +137,28 @@ void DataManager_Format(service_t *service) if (Luos_ReadFromService(service, result.result_table[i]->id, &data_msg) == SUCCEED) { // check if this is an assert - if (data_msg->header.cmd == ASSERT) + if (data_msg.header.cmd == ASSERT) { luos_assert_t assertion; - memcpy(assertion.unmap, data_msg->data, data_msg->header.size); - assertion.unmap[data_msg->header.size] = '\0'; - Convert_AssertToData(service, data_msg->header.source, assertion); + memcpy(assertion.unmap, data_msg.data, data_msg.header.size); + assertion.unmap[data_msg.header.size] = '\0'; + Convert_AssertToData(service, data_msg.header.source, assertion); i++; continue; } // check if a node send a bootloader message - if (data_msg->header.cmd == BOOTLOADER_RESP) + if (data_msg.header.cmd == BOOTLOADER_RESP) { do { - boot_data_ptr += Bootloader_LuosToJson(data_msg, boot_data_ptr); - } while (Luos_ReadFromService(service, data_msg->header.source, &data_msg) == SUCCEED); + boot_data_ptr += Bootloader_LuosToJson(&data_msg, boot_data_ptr); + } while (Luos_ReadFromService(service, data_msg.header.source, &data_msg) == SUCCEED); boot_data_ok = true; i++; continue; } // check if a node send a end detection - if (data_msg->header.cmd == END_DETECTION) + if (data_msg.header.cmd == END_DETECTION) { // find a pipe PipeLink_Find(service); @@ -174,17 +166,17 @@ void DataManager_Format(service_t *service) continue; } // Check if this is a message from pipe - if (data_msg->header.source == PipeLink_GetId()) + if (data_msg.header.source == PipeLink_GetId()) { do { // This message is a command from pipe static char data_cmd[GATE_BUFF_SIZE]; // Convert the received data into Luos commands - if (Luos_ReceiveData(service, data_msg, data_cmd) > 0) + if (Luos_ReceiveData(service, &data_msg, data_cmd) > 0) { // We finish to receive this data, execute the received command - if (data_msg->header.cmd == SET_CMD) + if (data_msg.header.cmd == SET_CMD) { Convert_DataToLuos(service, data_cmd); } @@ -203,8 +195,8 @@ void DataManager_Format(service_t *service) // Convert all msgs from this service into data do { - data_ptr += Convert_MsgToData(data_msg, data_ptr); - } while (Luos_ReadFromService(service, data_msg->header.source, &data_msg) == SUCCEED); + data_ptr += Convert_MsgToData(&data_msg, data_ptr); + } while (Luos_ReadFromService(service, data_msg.header.source, &data_msg) == SUCCEED); data_ptr += Convert_EndServiceData(data_ptr); LUOS_ASSERT((data_ptr - data) < GATE_BUFF_SIZE); diff --git a/tool_services/inspector/data_manager.c b/tool_services/inspector/data_manager.c index 94e31f961..a290e3154 100644 --- a/tool_services/inspector/data_manager.c +++ b/tool_services/inspector/data_manager.c @@ -152,7 +152,7 @@ void DataManager_GetPipeMsg(service_t *service, msg_t *data_msg) void DataManager_GetServiceMsg(service_t *service) { // loop into services. - msg_t *data_msg; + msg_t data_msg; search_result_t result; uint8_t i = 0; @@ -163,21 +163,21 @@ void DataManager_GetServiceMsg(service_t *service) if (Luos_ReadFromService(service, result.result_table[i]->id, &data_msg) == SUCCEED) { // drop the messages that are destined to pipe - if (data_msg->header.target == PipeLink_GetId()) + if (data_msg.header.target == PipeLink_GetId()) { i++; continue; } // Check if this is a message from pipe - if (data_msg->header.source == PipeLink_GetId()) + if (data_msg.header.source == PipeLink_GetId()) { // treat message from pipe - DataManager_GetPipeMsg(service, data_msg); + DataManager_GetPipeMsg(service, &data_msg); i++; continue; } // check if this is an assert - if ((data_msg->header.cmd == ASSERT) && (data_msg->header.size > 0)) + if ((data_msg.header.cmd == ASSERT) && (data_msg.header.size > 0)) { if (assert_num >= MAX_ASSERT_NUMBER) { @@ -190,26 +190,26 @@ void DataManager_GetServiceMsg(service_t *service) assert_num--; } // save the assert message to the assert messages buffer - memcpy(&assert_buf[assert_num][0], data_msg->stream, sizeof(header_t) + data_msg->header.size); + memcpy(&assert_buf[assert_num][0], data_msg.stream, sizeof(header_t) + data_msg.header.size); // store the size of this message - assert_buf_size[assert_num] = sizeof(header_t) + data_msg->header.size; + assert_buf_size[assert_num] = sizeof(header_t) + data_msg.header.size; assert_num++; i++; continue; } - if (data_msg->header.cmd == END_DETECTION) + if (data_msg.header.cmd == END_DETECTION) { PipeLink_Find(service); i++; continue; } - if (data_msg->header.cmd == ASK_DETECTION) + if (data_msg.header.cmd == ASK_DETECTION) { i++; continue; } // send any other message to pipe - PipeLink_Send(service, data_msg->stream, (sizeof(uint8_t) * data_msg->header.size) + sizeof(header_t)); + PipeLink_Send(service, data_msg.stream, (sizeof(uint8_t) * data_msg.header.size) + sizeof(header_t)); } i++; } diff --git a/tool_services/pipe/pipe.c b/tool_services/pipe/pipe.c index db64d92f9..10febe874 100644 --- a/tool_services/pipe/pipe.c +++ b/tool_services/pipe/pipe.c @@ -24,7 +24,7 @@ uint8_t tx_Buffer[PIPE_TX_BUFFER_SIZE] = {0}; /******************************************************************************* * Function ******************************************************************************/ -static void Pipe_MsgHandler(service_t *service, msg_t *msg); +static void Pipe_MsgHandler(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init * @param None @@ -53,7 +53,7 @@ void Pipe_Loop(void) * @param Msg receive * @return None ******************************************************************************/ -static void Pipe_MsgHandler(service_t *service, msg_t *msg) +static void Pipe_MsgHandler(service_t *service, const msg_t *msg) { uint16_t size = 0; From 6a8f4c7a4ab51280d68446fff5a7a25ef62e55db Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 3 May 2023 09:57:48 +0200 Subject: [PATCH 054/150] Improve unit tests organization --- test/{ => tests_core}/test_luos/main.c | 0 test/{ => tests_core}/test_luos/main.h | 0 test/{ => tests_core}/test_routing_table/main.c | 0 test/{ => tests_core}/test_routing_table/main.h | 0 test/{ => tests_core}/test_timestamp/main.c | 0 test/{ => tests_core}/test_timestamp/main.h | 0 test/{ => tests_core}/test_topic/main.c | 0 test/{ => tests_core}/test_topic/main.h | 0 test/{ => tests_core}/tests_od/test_angular/main.c | 0 test/{ => tests_core}/tests_od/test_angular/main.h | 0 test/{ => tests_core}/tests_od/test_control/main.c | 0 test/{ => tests_core}/tests_od/test_control/main.h | 0 test/{ => tests_core}/tests_od/test_electric/main.c | 0 test/{ => tests_core}/tests_od/test_electric/main.h | 0 test/{ => tests_core}/tests_od/test_force/main.c | 0 test/{ => tests_core}/tests_od/test_force/main.h | 0 test/{ => tests_core}/tests_od/test_illuminance/main.c | 0 test/{ => tests_core}/tests_od/test_illuminance/main.h | 0 test/{ => tests_core}/tests_od/test_linear/main.c | 0 test/{ => tests_core}/tests_od/test_linear/main.h | 0 test/{ => tests_core}/tests_od/test_pid/main.c | 0 test/{ => tests_core}/tests_od/test_pid/main.h | 0 test/{ => tests_core}/tests_od/test_pressure/main.c | 0 test/{ => tests_core}/tests_od/test_pressure/main.h | 0 test/{ => tests_core}/tests_od/test_ratio/main.c | 0 test/{ => tests_core}/tests_od/test_ratio/main.h | 0 test/{ => tests_core}/tests_od/test_temperature/main.c | 0 test/{ => tests_core}/tests_od/test_temperature/main.h | 0 test/{ => tests_core}/tests_od/test_time/main.c | 0 test/{ => tests_core}/tests_od/test_time/main.h | 0 test/{ => tests_io}/test_msg_alloc/main.c | 0 test/{ => tests_io}/test_msg_alloc/main.h | 0 test/{ => tests_io}/test_msg_alloc/unit_test_mem_alloc.c | 0 33 files changed, 0 insertions(+), 0 deletions(-) rename test/{ => tests_core}/test_luos/main.c (100%) rename test/{ => tests_core}/test_luos/main.h (100%) rename test/{ => tests_core}/test_routing_table/main.c (100%) rename test/{ => tests_core}/test_routing_table/main.h (100%) rename test/{ => tests_core}/test_timestamp/main.c (100%) rename test/{ => tests_core}/test_timestamp/main.h (100%) rename test/{ => tests_core}/test_topic/main.c (100%) rename test/{ => tests_core}/test_topic/main.h (100%) rename test/{ => tests_core}/tests_od/test_angular/main.c (100%) rename test/{ => tests_core}/tests_od/test_angular/main.h (100%) rename test/{ => tests_core}/tests_od/test_control/main.c (100%) rename test/{ => tests_core}/tests_od/test_control/main.h (100%) rename test/{ => tests_core}/tests_od/test_electric/main.c (100%) rename test/{ => tests_core}/tests_od/test_electric/main.h (100%) rename test/{ => tests_core}/tests_od/test_force/main.c (100%) rename test/{ => tests_core}/tests_od/test_force/main.h (100%) rename test/{ => tests_core}/tests_od/test_illuminance/main.c (100%) rename test/{ => tests_core}/tests_od/test_illuminance/main.h (100%) rename test/{ => tests_core}/tests_od/test_linear/main.c (100%) rename test/{ => tests_core}/tests_od/test_linear/main.h (100%) rename test/{ => tests_core}/tests_od/test_pid/main.c (100%) rename test/{ => tests_core}/tests_od/test_pid/main.h (100%) rename test/{ => tests_core}/tests_od/test_pressure/main.c (100%) rename test/{ => tests_core}/tests_od/test_pressure/main.h (100%) rename test/{ => tests_core}/tests_od/test_ratio/main.c (100%) rename test/{ => tests_core}/tests_od/test_ratio/main.h (100%) rename test/{ => tests_core}/tests_od/test_temperature/main.c (100%) rename test/{ => tests_core}/tests_od/test_temperature/main.h (100%) rename test/{ => tests_core}/tests_od/test_time/main.c (100%) rename test/{ => tests_core}/tests_od/test_time/main.h (100%) rename test/{ => tests_io}/test_msg_alloc/main.c (100%) rename test/{ => tests_io}/test_msg_alloc/main.h (100%) rename test/{ => tests_io}/test_msg_alloc/unit_test_mem_alloc.c (100%) diff --git a/test/test_luos/main.c b/test/tests_core/test_luos/main.c similarity index 100% rename from test/test_luos/main.c rename to test/tests_core/test_luos/main.c diff --git a/test/test_luos/main.h b/test/tests_core/test_luos/main.h similarity index 100% rename from test/test_luos/main.h rename to test/tests_core/test_luos/main.h diff --git a/test/test_routing_table/main.c b/test/tests_core/test_routing_table/main.c similarity index 100% rename from test/test_routing_table/main.c rename to test/tests_core/test_routing_table/main.c diff --git a/test/test_routing_table/main.h b/test/tests_core/test_routing_table/main.h similarity index 100% rename from test/test_routing_table/main.h rename to test/tests_core/test_routing_table/main.h diff --git a/test/test_timestamp/main.c b/test/tests_core/test_timestamp/main.c similarity index 100% rename from test/test_timestamp/main.c rename to test/tests_core/test_timestamp/main.c diff --git a/test/test_timestamp/main.h b/test/tests_core/test_timestamp/main.h similarity index 100% rename from test/test_timestamp/main.h rename to test/tests_core/test_timestamp/main.h diff --git a/test/test_topic/main.c b/test/tests_core/test_topic/main.c similarity index 100% rename from test/test_topic/main.c rename to test/tests_core/test_topic/main.c diff --git a/test/test_topic/main.h b/test/tests_core/test_topic/main.h similarity index 100% rename from test/test_topic/main.h rename to test/tests_core/test_topic/main.h diff --git a/test/tests_od/test_angular/main.c b/test/tests_core/tests_od/test_angular/main.c similarity index 100% rename from test/tests_od/test_angular/main.c rename to test/tests_core/tests_od/test_angular/main.c diff --git a/test/tests_od/test_angular/main.h b/test/tests_core/tests_od/test_angular/main.h similarity index 100% rename from test/tests_od/test_angular/main.h rename to test/tests_core/tests_od/test_angular/main.h diff --git a/test/tests_od/test_control/main.c b/test/tests_core/tests_od/test_control/main.c similarity index 100% rename from test/tests_od/test_control/main.c rename to test/tests_core/tests_od/test_control/main.c diff --git a/test/tests_od/test_control/main.h b/test/tests_core/tests_od/test_control/main.h similarity index 100% rename from test/tests_od/test_control/main.h rename to test/tests_core/tests_od/test_control/main.h diff --git a/test/tests_od/test_electric/main.c b/test/tests_core/tests_od/test_electric/main.c similarity index 100% rename from test/tests_od/test_electric/main.c rename to test/tests_core/tests_od/test_electric/main.c diff --git a/test/tests_od/test_electric/main.h b/test/tests_core/tests_od/test_electric/main.h similarity index 100% rename from test/tests_od/test_electric/main.h rename to test/tests_core/tests_od/test_electric/main.h diff --git a/test/tests_od/test_force/main.c b/test/tests_core/tests_od/test_force/main.c similarity index 100% rename from test/tests_od/test_force/main.c rename to test/tests_core/tests_od/test_force/main.c diff --git a/test/tests_od/test_force/main.h b/test/tests_core/tests_od/test_force/main.h similarity index 100% rename from test/tests_od/test_force/main.h rename to test/tests_core/tests_od/test_force/main.h diff --git a/test/tests_od/test_illuminance/main.c b/test/tests_core/tests_od/test_illuminance/main.c similarity index 100% rename from test/tests_od/test_illuminance/main.c rename to test/tests_core/tests_od/test_illuminance/main.c diff --git a/test/tests_od/test_illuminance/main.h b/test/tests_core/tests_od/test_illuminance/main.h similarity index 100% rename from test/tests_od/test_illuminance/main.h rename to test/tests_core/tests_od/test_illuminance/main.h diff --git a/test/tests_od/test_linear/main.c b/test/tests_core/tests_od/test_linear/main.c similarity index 100% rename from test/tests_od/test_linear/main.c rename to test/tests_core/tests_od/test_linear/main.c diff --git a/test/tests_od/test_linear/main.h b/test/tests_core/tests_od/test_linear/main.h similarity index 100% rename from test/tests_od/test_linear/main.h rename to test/tests_core/tests_od/test_linear/main.h diff --git a/test/tests_od/test_pid/main.c b/test/tests_core/tests_od/test_pid/main.c similarity index 100% rename from test/tests_od/test_pid/main.c rename to test/tests_core/tests_od/test_pid/main.c diff --git a/test/tests_od/test_pid/main.h b/test/tests_core/tests_od/test_pid/main.h similarity index 100% rename from test/tests_od/test_pid/main.h rename to test/tests_core/tests_od/test_pid/main.h diff --git a/test/tests_od/test_pressure/main.c b/test/tests_core/tests_od/test_pressure/main.c similarity index 100% rename from test/tests_od/test_pressure/main.c rename to test/tests_core/tests_od/test_pressure/main.c diff --git a/test/tests_od/test_pressure/main.h b/test/tests_core/tests_od/test_pressure/main.h similarity index 100% rename from test/tests_od/test_pressure/main.h rename to test/tests_core/tests_od/test_pressure/main.h diff --git a/test/tests_od/test_ratio/main.c b/test/tests_core/tests_od/test_ratio/main.c similarity index 100% rename from test/tests_od/test_ratio/main.c rename to test/tests_core/tests_od/test_ratio/main.c diff --git a/test/tests_od/test_ratio/main.h b/test/tests_core/tests_od/test_ratio/main.h similarity index 100% rename from test/tests_od/test_ratio/main.h rename to test/tests_core/tests_od/test_ratio/main.h diff --git a/test/tests_od/test_temperature/main.c b/test/tests_core/tests_od/test_temperature/main.c similarity index 100% rename from test/tests_od/test_temperature/main.c rename to test/tests_core/tests_od/test_temperature/main.c diff --git a/test/tests_od/test_temperature/main.h b/test/tests_core/tests_od/test_temperature/main.h similarity index 100% rename from test/tests_od/test_temperature/main.h rename to test/tests_core/tests_od/test_temperature/main.h diff --git a/test/tests_od/test_time/main.c b/test/tests_core/tests_od/test_time/main.c similarity index 100% rename from test/tests_od/test_time/main.c rename to test/tests_core/tests_od/test_time/main.c diff --git a/test/tests_od/test_time/main.h b/test/tests_core/tests_od/test_time/main.h similarity index 100% rename from test/tests_od/test_time/main.h rename to test/tests_core/tests_od/test_time/main.h diff --git a/test/test_msg_alloc/main.c b/test/tests_io/test_msg_alloc/main.c similarity index 100% rename from test/test_msg_alloc/main.c rename to test/tests_io/test_msg_alloc/main.c diff --git a/test/test_msg_alloc/main.h b/test/tests_io/test_msg_alloc/main.h similarity index 100% rename from test/test_msg_alloc/main.h rename to test/tests_io/test_msg_alloc/main.h diff --git a/test/test_msg_alloc/unit_test_mem_alloc.c b/test/tests_io/test_msg_alloc/unit_test_mem_alloc.c similarity index 100% rename from test/test_msg_alloc/unit_test_mem_alloc.c rename to test/tests_io/test_msg_alloc/unit_test_mem_alloc.c From efd61c855a54a6f22899544428b335be77c63004 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 3 May 2023 12:25:56 +0200 Subject: [PATCH 055/150] Add filter unit test --- engine/IO/src/filter.c | 21 +- platformio.ini | 2 +- test/_resources/Unity/unit_test.h | 4 +- test/test_robus/main.c | 44 -- test/tests_io/test_filter/main.c | 718 ++++++++++++++++++ test/tests_io/test_filter/main.h | 4 + .../test_msg_alloc/unit_test_mem_alloc.c | 435 +++++++---- 7 files changed, 1036 insertions(+), 192 deletions(-) create mode 100644 test/tests_io/test_filter/main.c create mode 100644 test/tests_io/test_filter/main.h diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c index d531e218e..69c1248d0 100644 --- a/engine/IO/src/filter.c +++ b/engine/IO/src/filter.c @@ -66,8 +66,9 @@ void Filter_AddServiceId(uint16_t service_id, uint16_t service_number) //--------------------------->|__________| // Shift byte byte Mask of bit address - LUOS_ASSERT(service_id > 0); - LUOS_ASSERT(service_id <= 4096 - MAX_SERVICE_NUMBER); + LUOS_ASSERT((service_id > 0) + && (service_id <= 4096 - MAX_SERVICE_NUMBER) + && (service_number <= MAX_SERVICE_NUMBER)); Filter_IdInit(); uint16_t tempo = 0; filter_ctx.IDShiftMask = (service_id - 1) / 8; // aligned to byte @@ -87,6 +88,7 @@ void Filter_AddServiceId(uint16_t service_id, uint16_t service_number) ******************************************************************************/ void Filter_AddTopic(uint16_t topic_id) { + LUOS_ASSERT(topic_id <= LAST_TOPIC); // Add 1 to the bit corresponding to the topic in multicast mask filter_ctx.TopicMask[(topic_id / 8)] |= 1 << (topic_id - ((int)(topic_id / 8)) * 8); } @@ -98,6 +100,7 @@ void Filter_AddTopic(uint16_t topic_id) ******************************************************************************/ void Filter_RmTopic(uint16_t topic_id) { + LUOS_ASSERT(topic_id <= LAST_TOPIC); // Remove 1 to the bit corresponding to the topic in multicast mask filter_ctx.TopicMask[(topic_id / 8)] &= ~(1 << (topic_id - ((int)(topic_id / 8)) * 8)); } @@ -115,7 +118,7 @@ _CRITICAL bool Filter_ServiceID(uint16_t service_id) // In an node, service ID are consecutive // MaskID is byte field wich have the size of MAX_SERVICE_NUMBER // Shift depend od ID of first service in Node (shift = NodeID/8) - + LUOS_ASSERT(service_id <= 4096); uint16_t compare = 0; if ((service_id > (8 * filter_ctx.IDShiftMask))) // IDMask aligned byte @@ -157,10 +160,12 @@ _CRITICAL bool Filter_Topic(uint16_t topic_id) * @brief Parse all services type to find if target exists * @param type_id of message * @return bool true if there is one false if not + * We can't do this the same way other are done because identifiers don't have any continuity * _CRITICAL function call in IRQ ******************************************************************************/ _CRITICAL bool Filter_Type(uint16_t type_id) { + LUOS_ASSERT(type_id <= 4096); // Check all service type for (int i = 0; i < Service_GetNumber(); i++) { @@ -203,11 +208,8 @@ _CRITICAL uint8_t Filter_GetPhyTarget(header_t *header) } break; case BROADCAST: - if (header->target == BROADCAST_VAL) - { - // This concerns Luos phy and Robus - return 0x01 | (0x01 << 1); - } + // This concerns Luos phy and Robus + return 0x01 | (0x01 << 1); break; case NODEIDACK: case NODEID: @@ -225,10 +227,11 @@ _CRITICAL uint8_t Filter_GetPhyTarget(header_t *header) } break; default: + LUOS_ASSERT(0); // This concerns Robus only return 0x01 << 1; break; } - // This concerns Robus only + // This concerns Robus only by default return 0x01 << 1; } diff --git a/platformio.ini b/platformio.ini index 86e7b38a9..315fce0ab 100644 --- a/platformio.ini +++ b/platformio.ini @@ -32,4 +32,4 @@ build_type = debug test_build_src = true ; To debug a test, replace "test_template" by the directory test name you want to debug (example : "test_msg_alloc") -debug_test = test_msg_alloc +debug_test = tests_io/test_filter diff --git a/test/_resources/Unity/unit_test.h b/test/_resources/Unity/unit_test.h index 0acbe0b55..ea4baff4a 100644 --- a/test/_resources/Unity/unit_test.h +++ b/test/_resources/Unity/unit_test.h @@ -35,7 +35,9 @@ extern bool try_state; #define CATCH else -#define END_TRY try_state = false +#define END_TRY \ + try_state = false; \ + RESET_ASSERT() /******************************************************************************* * Function diff --git a/test/test_robus/main.c b/test/test_robus/main.c index b91a70851..f9da3a0a6 100644 --- a/test/test_robus/main.c +++ b/test/test_robus/main.c @@ -4,51 +4,9 @@ #include "context.h" #include "unit_test.h" #include "default_scenario.h" -#include "filter.h" extern default_scenario_t default_sc; -void unittest_Filter_AddServiceId() -{ - NEW_TEST_CASE("Service ID mask test"); - { - Filter_IdInit(); - - Filter_AddServiceId(7, SERVICE_NUMBER); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(7)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(7 + SERVICE_NUMBER - 1)); - - Filter_AddServiceId(8, SERVICE_NUMBER); - TEST_ASSERT_EQUAL(false, Filter_ServiceID(7)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(8)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(8 + SERVICE_NUMBER - 1)); - - Filter_AddServiceId(9, SERVICE_NUMBER); - TEST_ASSERT_EQUAL(false, Filter_ServiceID(8)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(9)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(9 + SERVICE_NUMBER - 1)); - } - - NEW_TEST_CASE("Limit 4096"); - { - Filter_IdInit(); - Filter_AddServiceId(4096 - MAX_SERVICE_NUMBER, SERVICE_NUMBER); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(4096 - MAX_SERVICE_NUMBER)); - } - - NEW_TEST_CASE("Limit 0"); - { - RESET_ASSERT(); - Filter_IdInit(); - TRY - { - Filter_AddServiceId(0, SERVICE_NUMBER); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - RESET_ASSERT(); - } -} - void unittest_Luos_Subscribe(void) { NEW_TEST_CASE("Normal Add to node topic list"); @@ -245,8 +203,6 @@ int main(int argc, char **argv) { UNITY_BEGIN(); - // Big data reception - UNIT_TEST_RUN(unittest_Filter_AddServiceId); UNIT_TEST_RUN(unittest_Luos_Subscribe); UNIT_TEST_RUN(unittest_Robus_TopicUnsubscribe); diff --git a/test/tests_io/test_filter/main.c b/test/tests_io/test_filter/main.c new file mode 100644 index 000000000..445e39a4e --- /dev/null +++ b/test/tests_io/test_filter/main.c @@ -0,0 +1,718 @@ +#include "main.h" +#include "unit_test.h" +#include "filter.h" +#include "../src/service.c" + +void unittest_Filter_ServiceId() +{ + uint16_t service_number = 10; + NEW_TEST_CASE("Basic Service ID mask test"); + { + Filter_IdInit(); + TRY + { + Filter_AddServiceId(7, service_number); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(7)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(7 + service_number - 1)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddServiceId(8, service_number); + TEST_ASSERT_EQUAL(false, Filter_ServiceID(7)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(8)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(8 + service_number - 1)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddServiceId(9, service_number); + TEST_ASSERT_EQUAL(false, Filter_ServiceID(8)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(9)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(9 + service_number - 1)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddServiceId(9, 0); + TEST_ASSERT_EQUAL(false, Filter_ServiceID(8)); + TEST_ASSERT_EQUAL(false, Filter_ServiceID(9)); + TEST_ASSERT_EQUAL(false, Filter_ServiceID(9 + service_number - 1)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + service_number = MAX_SERVICE_NUMBER; + NEW_TEST_CASE("Service ID mask test with max services"); + { + Filter_IdInit(); + + TRY + { + Filter_AddServiceId(7, service_number); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(7)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(7 + service_number - 1)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddServiceId(8, service_number); + TEST_ASSERT_EQUAL(false, Filter_ServiceID(7)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(8)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(8 + service_number - 1)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddServiceId(9, service_number); + TEST_ASSERT_EQUAL(false, Filter_ServiceID(8)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(9)); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(9 + service_number - 1)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddServiceId(9, 0); + TEST_ASSERT_EQUAL(false, Filter_ServiceID(8)); + TEST_ASSERT_EQUAL(false, Filter_ServiceID(9)); + TEST_ASSERT_EQUAL(false, Filter_ServiceID(9 + service_number - 1)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Overlap the MAX_SERVICE_NUMBER"); + { + Filter_IdInit(); + TRY + { + Filter_AddServiceId(1, MAX_SERVICE_NUMBER + 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Test the id 4096 Limit"); + { + Filter_IdInit(); + TRY + { + Filter_AddServiceId(4096 - MAX_SERVICE_NUMBER, service_number); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(4096 - MAX_SERVICE_NUMBER)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddServiceId(4096 - MAX_SERVICE_NUMBER + 1, service_number); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + + TRY + { + Filter_ServiceID(4096 + 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Test the id 0 Limit"); + { + Filter_IdInit(); + TRY + { + Filter_AddServiceId(0, service_number); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } +} + +void unittest_Filter_Topic() +{ + NEW_TEST_CASE("Test the id max Limit"); + { + Filter_TopicInit(); + TRY + { + Filter_AddTopic(LAST_TOPIC); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + Filter_TopicInit(); + TRY + { + Filter_AddTopic(LAST_TOPIC + 1); + TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC + 1)); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + + Filter_TopicInit(); + TRY + { + Filter_AddTopic(LAST_TOPIC); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + Filter_RmTopic(LAST_TOPIC); + TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + Filter_TopicInit(); + TRY + { + Filter_RmTopic(LAST_TOPIC + 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Test normal topic filtering"); + { + Filter_TopicInit(); + TRY + { + Filter_AddTopic(0); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(1)); + TEST_ASSERT_EQUAL(false, Filter_Topic(2)); + TEST_ASSERT_EQUAL(false, Filter_Topic(3)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddTopic(1); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(1)); + TEST_ASSERT_EQUAL(false, Filter_Topic(2)); + TEST_ASSERT_EQUAL(false, Filter_Topic(3)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddTopic(3); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(1)); + TEST_ASSERT_EQUAL(false, Filter_Topic(2)); + TEST_ASSERT_EQUAL(true, Filter_Topic(3)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddTopic(LAST_TOPIC); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(1)); + TEST_ASSERT_EQUAL(false, Filter_Topic(2)); + TEST_ASSERT_EQUAL(true, Filter_Topic(3)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_RmTopic(0); + TEST_ASSERT_EQUAL(false, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(1)); + TEST_ASSERT_EQUAL(false, Filter_Topic(2)); + TEST_ASSERT_EQUAL(true, Filter_Topic(3)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_RmTopic(0); + TEST_ASSERT_EQUAL(false, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(1)); + TEST_ASSERT_EQUAL(false, Filter_Topic(2)); + TEST_ASSERT_EQUAL(true, Filter_Topic(3)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_RmTopic(3); + TEST_ASSERT_EQUAL(false, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(1)); + TEST_ASSERT_EQUAL(false, Filter_Topic(2)); + TEST_ASSERT_EQUAL(false, Filter_Topic(3)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_RmTopic(1); + TEST_ASSERT_EQUAL(false, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(1)); + TEST_ASSERT_EQUAL(false, Filter_Topic(2)); + TEST_ASSERT_EQUAL(false, Filter_Topic(3)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_RmTopic(1); + TEST_ASSERT_EQUAL(false, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(1)); + TEST_ASSERT_EQUAL(false, Filter_Topic(2)); + TEST_ASSERT_EQUAL(false, Filter_Topic(3)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_RmTopic(LAST_TOPIC); + TEST_ASSERT_EQUAL(false, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(1)); + TEST_ASSERT_EQUAL(false, Filter_Topic(2)); + TEST_ASSERT_EQUAL(false, Filter_Topic(3)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_Filter_Type() +{ + + NEW_TEST_CASE("Test the id max Limit"); + { + TRY + { + Filter_Type(4096 + 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Test the result if there is no service"); + { + TRY + { + service_ctx.number = 0; + TEST_ASSERT_EQUAL(false, Filter_Type(0)); + TEST_ASSERT_EQUAL(false, Filter_Type(1)); + TEST_ASSERT_EQUAL(false, Filter_Type(2)); + TEST_ASSERT_EQUAL(false, Filter_Type(12)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Test the result on normal condition"); + { + TRY + { + service_ctx.number = 1; + service_ctx.list[0].type = 0; + TEST_ASSERT_EQUAL(true, Filter_Type(0)); + TEST_ASSERT_EQUAL(false, Filter_Type(1)); + TEST_ASSERT_EQUAL(false, Filter_Type(2)); + TEST_ASSERT_EQUAL(false, Filter_Type(12)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + service_ctx.number = 1; + service_ctx.list[0].type = 1; + TEST_ASSERT_EQUAL(false, Filter_Type(0)); + TEST_ASSERT_EQUAL(true, Filter_Type(1)); + TEST_ASSERT_EQUAL(false, Filter_Type(2)); + TEST_ASSERT_EQUAL(false, Filter_Type(12)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + service_ctx.number = 1; + service_ctx.list[0].type = 12; + TEST_ASSERT_EQUAL(false, Filter_Type(0)); + TEST_ASSERT_EQUAL(false, Filter_Type(1)); + TEST_ASSERT_EQUAL(false, Filter_Type(2)); + TEST_ASSERT_EQUAL(true, Filter_Type(12)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + service_ctx.number = 2; + service_ctx.list[0].type = 1; + service_ctx.list[1].type = 12; + TEST_ASSERT_EQUAL(false, Filter_Type(0)); + TEST_ASSERT_EQUAL(true, Filter_Type(1)); + TEST_ASSERT_EQUAL(false, Filter_Type(2)); + TEST_ASSERT_EQUAL(true, Filter_Type(12)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_Filter_GetPhyTarget() +{ + header_t header; + NEW_TEST_CASE("Test a wrong header target_mode"); + { + TRY + { + header.target_mode = 0x0f; + Filter_GetPhyTarget(&header); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Test service ID"); + { + TRY + { + Filter_AddServiceId(1, 1); + header.target_mode = SERVICEIDACK; + header.target = 1; + // We should have Luos only + TEST_ASSERT_EQUAL(0x01, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddServiceId(1, 1); + header.target_mode = SERVICEIDACK; + header.target = 2; + // We should have Robus only + TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddServiceId(1, 1); + header.target_mode = SERVICEID; + header.target = 1; + // We should have Luos only + TEST_ASSERT_EQUAL(0x01, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddServiceId(1, 1); + header.target_mode = SERVICEID; + header.target = 2; + // We should have Robus only + TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddServiceId(1, 2); + header.target_mode = SERVICEIDACK; + header.target = 2; + // We should have Luos only + TEST_ASSERT_EQUAL(0x01, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddServiceId(1, 2); + header.target_mode = SERVICEIDACK; + header.target = 3; + // We should have Robus only + TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddServiceId(1, 2); + header.target_mode = SERVICEID; + header.target = 2; + // We should have Luos only + TEST_ASSERT_EQUAL(0x01, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Filter_AddServiceId(1, 2); + header.target_mode = SERVICEID; + header.target = 3; + // We should have Robus only + TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Test Type"); + { + TRY + { + service_ctx.number = 1; + service_ctx.list[0].type = 0; + header.target_mode = TYPE; + header.target = 0; + // We should have Luos and Robus + TEST_ASSERT_EQUAL(0x03, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + service_ctx.number = 1; + service_ctx.list[0].type = 0; + header.target_mode = TYPE; + header.target = 1; + // We should have Robus only + TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Test Broadcast"); + { + TRY + { + header.target_mode = BROADCAST; + header.target = BROADCAST_VAL; + // We should have Luos and Robus + TEST_ASSERT_EQUAL(0x03, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + header.target_mode = BROADCAST; + header.target = 1; + // We should have Luos and Robus + TEST_ASSERT_EQUAL(0x03, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Test Node ID"); + { + TRY + { + Node_Get()->node_id = 1; + header.target_mode = NODEIDACK; + header.target = 1; + // We should have Luos only + TEST_ASSERT_EQUAL(0x01, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Node_Get()->node_id = 1; + header.target_mode = NODEIDACK; + header.target = 2; + // We should have Robus only + TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Node_Get()->node_id = 1; + header.target_mode = NODEID; + header.target = 1; + // We should have Luos only + TEST_ASSERT_EQUAL(0x01, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + Node_Get()->node_id = 1; + header.target_mode = NODEID; + header.target = 2; + // We should have Robus only + TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Test Topic"); + { + TRY + { + Filter_TopicInit(); + Filter_AddTopic(3); + header.target_mode = TOPIC; + header.target = 3; + // We should have Luos and Robus + TEST_ASSERT_EQUAL(0x03, Filter_GetPhyTarget(&header)); + header.target = 2; + // We should have Robus only + TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +int main(int argc, char **argv) +{ + UNITY_BEGIN(); + + UNIT_TEST_RUN(unittest_Filter_ServiceId); + UNIT_TEST_RUN(unittest_Filter_Topic); + UNIT_TEST_RUN(unittest_Filter_Type); + UNIT_TEST_RUN(unittest_Filter_GetPhyTarget); + + UNITY_END(); +} diff --git a/test/tests_io/test_filter/main.h b/test/tests_io/test_filter/main.h new file mode 100644 index 000000000..415b31450 --- /dev/null +++ b/test/tests_io/test_filter/main.h @@ -0,0 +1,4 @@ +#ifndef MAIN_H +#define MAIN_H + +#endif // MAIN_H diff --git a/test/tests_io/test_msg_alloc/unit_test_mem_alloc.c b/test/tests_io/test_msg_alloc/unit_test_mem_alloc.c index e9ac151f9..37a806604 100644 --- a/test/tests_io/test_msg_alloc/unit_test_mem_alloc.c +++ b/test/tests_io/test_msg_alloc/unit_test_mem_alloc.c @@ -25,67 +25,88 @@ void unittest_SlotPack(void) NEW_TEST_CASE("Check if an already organized buffer is not modified"); { - alloc_slots[0].data = &data; - alloc_slots[1].data = &data; - alloc_slots[2].data = &data; - alloc_slots[3].data = &data; - alloc_slots[4].data = 0; - alloc_slot_index = 4; - MsgAlloc_SlotPack(); - TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[3].data); - TEST_ASSERT_EQUAL(0, alloc_slots[4].data); - TEST_ASSERT_EQUAL(4, alloc_slot_index); + TRY + { + alloc_slots[0].data = &data; + alloc_slots[1].data = &data; + alloc_slots[2].data = &data; + alloc_slots[3].data = &data; + alloc_slots[4].data = 0; + alloc_slot_index = 4; + MsgAlloc_SlotPack(); + TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[3].data); + TEST_ASSERT_EQUAL(0, alloc_slots[4].data); + TEST_ASSERT_EQUAL(4, alloc_slot_index); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check if an unorganized buffer is organized"); { - alloc_slots[0].data = 0; - alloc_slots[1].data = &data; - alloc_slots[2].data = &data; - alloc_slots[3].data = 0; - alloc_slots[4].data = 0; - alloc_slots[5].data = 0; - alloc_slots[6].data = &data; - alloc_slots[7].data = 0; - alloc_slot_index = 8; - MsgAlloc_SlotPack(); - TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); - TEST_ASSERT_EQUAL(0, alloc_slots[3].data); - TEST_ASSERT_EQUAL(0, alloc_slots[4].data); - TEST_ASSERT_EQUAL(0, alloc_slots[5].data); - TEST_ASSERT_EQUAL(0, alloc_slots[6].data); - TEST_ASSERT_EQUAL(0, alloc_slots[7].data); - TEST_ASSERT_EQUAL(3, alloc_slot_index); + TRY + { + alloc_slots[0].data = 0; + alloc_slots[1].data = &data; + alloc_slots[2].data = &data; + alloc_slots[3].data = 0; + alloc_slots[4].data = 0; + alloc_slots[5].data = 0; + alloc_slots[6].data = &data; + alloc_slots[7].data = 0; + alloc_slot_index = 8; + MsgAlloc_SlotPack(); + TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); + TEST_ASSERT_EQUAL(0, alloc_slots[3].data); + TEST_ASSERT_EQUAL(0, alloc_slots[4].data); + TEST_ASSERT_EQUAL(0, alloc_slots[5].data); + TEST_ASSERT_EQUAL(0, alloc_slots[6].data); + TEST_ASSERT_EQUAL(0, alloc_slots[7].data); + TEST_ASSERT_EQUAL(3, alloc_slot_index); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check how it's managing the buffer to it's limits"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = 0; - alloc_slots[1].data = &data; - alloc_slots[2].data = &data; - alloc_slots[3].data = 0; - alloc_slots[4].data = 0; - alloc_slots[5].data = 0; - alloc_slots[6].data = &data; - alloc_slots[MAX_MSG_NB - 1].data = &data; - alloc_slot_index = MAX_MSG_NB; - MsgAlloc_SlotPack(); - TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[3].data); - TEST_ASSERT_EQUAL(0, alloc_slots[4].data); - TEST_ASSERT_EQUAL(0, alloc_slots[5].data); - TEST_ASSERT_EQUAL(0, alloc_slots[6].data); - TEST_ASSERT_EQUAL(0, alloc_slots[7].data); - TEST_ASSERT_EQUAL(0, alloc_slots[MAX_MSG_NB - 1].data); - TEST_ASSERT_EQUAL(4, alloc_slot_index); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = 0; + alloc_slots[1].data = &data; + alloc_slots[2].data = &data; + alloc_slots[3].data = 0; + alloc_slots[4].data = 0; + alloc_slots[5].data = 0; + alloc_slots[6].data = &data; + alloc_slots[MAX_MSG_NB - 1].data = &data; + alloc_slot_index = MAX_MSG_NB; + MsgAlloc_SlotPack(); + TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[3].data); + TEST_ASSERT_EQUAL(0, alloc_slots[4].data); + TEST_ASSERT_EQUAL(0, alloc_slots[5].data); + TEST_ASSERT_EQUAL(0, alloc_slots[6].data); + TEST_ASSERT_EQUAL(0, alloc_slots[7].data); + TEST_ASSERT_EQUAL(0, alloc_slots[MAX_MSG_NB - 1].data); + TEST_ASSERT_EQUAL(4, alloc_slot_index); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } } @@ -104,51 +125,93 @@ void unittest_GetOldestMsg(void) NEW_TEST_CASE("Check the behavior if we dont have any message"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; - TEST_ASSERT_EQUAL(0, MsgAlloc_GetOldestMsg()); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + TEST_ASSERT_EQUAL(0, MsgAlloc_GetOldestMsg()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check the behavior if we have a message in the first slot"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)0x1; - alloc_slot_index = 1; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)0x1; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check the behavior if we have a message in another place"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[3].data = (uint8_t *)0x1; - alloc_slot_index = 4; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[3].data = (uint8_t *)0x1; + alloc_slot_index = 4; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check the behavior if we have a message in the last slot"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x1; - alloc_slot_index = MAX_MSG_NB; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x1; + alloc_slot_index = MAX_MSG_NB; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check the behavior if we have a message in the last slot and the first one"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)0x1; - alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x2; - alloc_slot_index = MAX_MSG_NB; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)0x1; + alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x2; + alloc_slot_index = MAX_MSG_NB; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check the behavior if we have a message in the last slot and the first one"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)0x1; - alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x2; - alloc_slot_index = MAX_MSG_NB; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)0x1; + alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x2; + alloc_slot_index = MAX_MSG_NB; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } } @@ -190,37 +253,65 @@ void unittest_BufferAvailableSpaceComputation(void) NEW_TEST_CASE("Check the result if we don't have any messages"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; - data_ptr = (uint8_t *)&msg_buffer[0]; - TEST_ASSERT_EQUAL(MSG_BUFFER_SIZE, MsgAlloc_BufferAvailableSpaceComputation()); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + data_ptr = (uint8_t *)&msg_buffer[0]; + TEST_ASSERT_EQUAL(MSG_BUFFER_SIZE, MsgAlloc_BufferAvailableSpaceComputation()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check the result in a situation we don't have to loop around the buffer end"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - data_ptr = (uint8_t *)&msg_buffer[0]; - TEST_ASSERT_EQUAL(10, MsgAlloc_BufferAvailableSpaceComputation()); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + data_ptr = (uint8_t *)&msg_buffer[0]; + TEST_ASSERT_EQUAL(10, MsgAlloc_BufferAvailableSpaceComputation()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check the result in a situation we have to loop around the buffer end"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; - TEST_ASSERT_EQUAL(20, MsgAlloc_BufferAvailableSpaceComputation()); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; + TEST_ASSERT_EQUAL(20, MsgAlloc_BufferAvailableSpaceComputation()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check the result in a situation we have to loop around the buffer end and data_ptr is set to the begin of the buffer"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; - TEST_ASSERT_EQUAL(10, MsgAlloc_BufferAvailableSpaceComputation()); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; + TEST_ASSERT_EQUAL(10, MsgAlloc_BufferAvailableSpaceComputation()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } } @@ -240,14 +331,28 @@ void unittest_DoWeHaveSpaceUntilBufferEnd(void) NEW_TEST_CASE("Check if it return SUCCEED when the pointer is in the buffer"); { - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[0])); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + TRY + { + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[0])); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check if it return FAILED when the pointer is after the buffer"); { - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE])); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE + 1])); + TRY + { + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE])); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE + 1])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } } @@ -299,49 +404,91 @@ void unittest_CheckMsgSpace(void) NEW_TEST_CASE("Check the result if we don't have any message yet"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check the result if we have one message and the new one is before the old one"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[9])); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[9])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check the result if we have one message and the new one is after the old one"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[11], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[11], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check the result if we have one message and the new one is in the middle of the old one"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check the result if we have one message and the new one is at the end of the old one"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[10])); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[10])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } NEW_TEST_CASE("Check the result if we have one message and the new one is at the beginning of the old one"); { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[10], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[10], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } } } @@ -381,24 +528,38 @@ void unittest_MsgAlloc_Loop() // Call function and Verify //--------------------------- // Empty buffer - expected_buffer_occupation_ratio = 0; - MsgAlloc_Loop(); + TRY + { + expected_buffer_occupation_ratio = 0; + MsgAlloc_Loop(); - NEW_STEP("Check that the buffer is empty"); - TEST_ASSERT_EQUAL(0, memory_stats.buffer_occupation_ratio); + NEW_STEP("Check that the buffer is empty"); + TEST_ASSERT_EQUAL(0, memory_stats.buffer_occupation_ratio); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } - // Buffer occupation from 0 -> 100% - NEW_STEP("Check buffer is full in all cases"); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - for (uint16_t i = 1; i < MSG_BUFFER_SIZE; i++) + TRY { - data_ptr = &msg_buffer[i]; - expected_buffer_occupation_ratio = (i * 100) / (MSG_BUFFER_SIZE); + // Buffer occupation from 0 -> 100% + NEW_STEP("Check buffer is full in all cases"); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + for (uint16_t i = 1; i < MSG_BUFFER_SIZE; i++) + { + data_ptr = &msg_buffer[i]; + expected_buffer_occupation_ratio = (i * 100) / (MSG_BUFFER_SIZE); - MsgAlloc_Loop(); + MsgAlloc_Loop(); - TEST_ASSERT_EQUAL(expected_buffer_occupation_ratio, memory_stats.buffer_occupation_ratio); + TEST_ASSERT_EQUAL(expected_buffer_occupation_ratio, memory_stats.buffer_occupation_ratio); + } + } + CATCH + { + TEST_ASSERT_TRUE(false); } } } From 2610c1cfd877164a24bd1dee17b53861eb3709d3 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 3 May 2023 19:58:32 +0200 Subject: [PATCH 056/150] Add luos_phy unit test --- engine/IO/src/luos_phy.c | 65 +- test/test_robus/main.c | 1 + test/tests_io/test_filter/main.c | 1 - test/tests_io/test_filter/main.h | 4 - test/tests_io/test_phy/main.c | 1507 ++++++++++++++++++++++++++++++ 5 files changed, 1555 insertions(+), 23 deletions(-) delete mode 100644 test/tests_io/test_filter/main.h create mode 100644 test/tests_io/test_phy/main.c diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 67cd09567..18e414fd2 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -139,11 +139,11 @@ void Phy_Loop(void) // This is only needed for Robus for now. if (phy_ctx.phy[1].rx_alloc_job) { - Phy_alloc(phy_ctx.phy); + Phy_alloc(&phy_ctx.phy[1]); } + Phy_ManageFailedJob(); // Manage complete message received dispatching Phy_Dispatch(); - Phy_ManageFailedJob(); // Compute phy job statistics /* uint8_t stat = (uint8_t)((job nbr * 100) / (MAX_MSG_NB)); @@ -160,7 +160,6 @@ void Phy_Loop(void) ******************************************************************************/ luos_phy_t *Phy_Create(PHY_CB phy_cb) { - LUOS_ASSERT((phy_ctx.phy_nb < PHY_NB) && (phy_ctx.phy_nb > 0)); return Phy_Get(phy_ctx.phy_nb++, phy_cb); } @@ -172,6 +171,8 @@ luos_phy_t *Phy_Create(PHY_CB phy_cb) ******************************************************************************/ luos_phy_t *Phy_Get(uint8_t id, PHY_CB phy_cb) { + LUOS_ASSERT((id <= PHY_NB) + && (phy_cb != NULL)); // Set the callback phy_ctx.phy[id].phy_cb = phy_cb; // Return the phy pointer @@ -183,9 +184,9 @@ luos_phy_t *Phy_Get(uint8_t id, PHY_CB phy_cb) * @param phy_ptr Pointer to the phy concerned by this message * @return None ******************************************************************************/ -inline void Phy_ComputeHeader(luos_phy_t *phy_ptr) +_CRITICAL void Phy_ComputeHeader(luos_phy_t *phy_ptr) { - + LUOS_ASSERT(phy_ptr != NULL); // Compute the size of the data to allocate if (((header_t *)phy_ptr->rx_buffer_base)->size > MAX_DATA_MSG_SIZE) { @@ -195,11 +196,11 @@ inline void Phy_ComputeHeader(luos_phy_t *phy_ptr) else { phy_ptr->rx_size = ((header_t *)phy_ptr->rx_buffer_base)->size + sizeof(header_t); - // We need to check if we have a timestamped message and increase the data size if yes - if (Luos_IsMsgTimstamped((msg_t *)(phy_ptr->rx_data)) == true) - { - phy_ptr->rx_size += sizeof(time_luos_t); - } + } + // We need to check if we have a timestamped message and increase the data size if yes + if (Luos_IsMsgTimstamped((msg_t *)(phy_ptr->rx_data)) == true) + { + phy_ptr->rx_size += sizeof(time_luos_t); } // Compute the phy concerned by this message @@ -287,6 +288,7 @@ uint16_t Phy_GetNodeId(void) ******************************************************************************/ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) { + LUOS_ASSERT(phy_ptr != NULL); void *rx_data; void *copy_from; @@ -298,9 +300,10 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) return; } // Check if we receive enougth data to be able to allocate the complete message - LUOS_ASSERT((phy_ptr->received_data >= sizeof(header_t)) && (phy_ptr->received_data <= MAX_DATA_MSG_SIZE + sizeof(header_t))); - // Check if their is a mistake on the buffer allocation. In this case, the phy.rx_data was not properly set to rx_buffer_base before the data reception. - LUOS_ASSERT(phy_ptr->rx_data == phy_ptr->rx_buffer_base); + LUOS_ASSERT((phy_ptr->received_data >= sizeof(header_t)) + && (phy_ptr->received_data <= MAX_DATA_MSG_SIZE + sizeof(header_t)) + // Check if their is a mistake on the buffer allocation. In this case, the phy.rx_data was not properly set to rx_buffer_base before the data reception. + && (phy_ptr->rx_data == phy_ptr->rx_buffer_base)); LuosHAL_SetIrqState(true); // Now we can check if we need to store the received data @@ -363,7 +366,6 @@ static void Phy_Dispatch(void) { return; } - running = true; // Interpreat received messages and create tasks for it. LuosHAL_SetIrqState(false); while (i < phy_ctx.io_job_nb) @@ -372,6 +374,10 @@ static void Phy_Dispatch(void) // Get the oldest job IO_job_t *job = &phy_ctx.io_job[i]; i++; + running = false; + LUOS_ASSERT((job->alloc_msg != NULL) + && (job->size >= sizeof(header_t))); + running = true; // If message is timestamped, convert the latency to date if (Luos_IsMsgTimstamped(job->alloc_msg)) { @@ -413,14 +419,24 @@ static void Phy_Dispatch(void) _CRITICAL void Phy_DeadTargetSpotted(luos_phy_t *phy_ptr, phy_job_t *job) { // A phy failed to send a message, we need to be sure that our node don't try to contact this target again. - LUOS_ASSERT(job->msg_pt->header.target_mode == NODEIDACK || job->msg_pt->header.target_mode == SERVICEIDACK || job->msg_pt->header.target_mode == NODEID || job->msg_pt->header.target_mode == SERVICEID); + LUOS_ASSERT((job != NULL) + && (phy_ptr != NULL)); + LUOS_ASSERT((job->msg_pt != NULL) + && (job->msg_pt->header.target_mode == NODEIDACK + || job->msg_pt->header.target_mode == SERVICEIDACK + || job->msg_pt->header.target_mode == NODEID + || job->msg_pt->header.target_mode == SERVICEID)); + // Store the job in the dead service spotted list phy_ctx.failed_job[phy_ctx.failed_job_nb++] = *job; + uint16_t target = job->msg_pt->header.target; + uint16_t target_mode = job->msg_pt->header.target_mode; // Remove all job targeting this target on this phy job queue; - for (int i = 0; i < phy_ptr->job_nb; i++) + int i = 0; + while (i < phy_ptr->job_nb) { - if ((phy_ptr->job[i].msg_pt->header.target == job->msg_pt->header.target) && (phy_ptr->job[i].msg_pt->header.target_mode == job->msg_pt->header.target_mode)) + if ((phy_ptr->job[i].msg_pt->header.target == target) && (phy_ptr->job[i].msg_pt->header.target_mode == target_mode)) { // This job is targeting the dead target, remove it from the queue phy_ptr->job_nb--; @@ -429,6 +445,11 @@ _CRITICAL void Phy_DeadTargetSpotted(luos_phy_t *phy_ptr, phy_job_t *job) phy_ptr->job[j] = phy_ptr->job[j + 1]; } } + else + { + // Treat the next job + i++; + } } } @@ -514,11 +535,16 @@ _CRITICAL inline phy_job_t *Phy_GetJob(luos_phy_t *phy_ptr) ******************************************************************************/ inline int Phy_GetJobId(luos_phy_t *phy_ptr, phy_job_t *job) { + LUOS_ASSERT((phy_ptr != NULL) + && (job >= phy_ptr->job) + && (job < &phy_ptr->job[MAX_MSG_NB])); return (((uintptr_t)job - (uintptr_t)phy_ptr->job) / sizeof(phy_job_t)); } inline int Phy_GetPhyId(luos_phy_t *phy_ptr) { + LUOS_ASSERT((phy_ptr >= phy_ctx.phy) + && (phy_ptr < &phy_ctx.phy[PHY_NB])); return ((uintptr_t)phy_ptr - (uintptr_t)phy_ctx.phy) / sizeof(luos_phy_t); } @@ -529,7 +555,9 @@ inline int Phy_GetPhyId(luos_phy_t *phy_ptr) ******************************************************************************/ _CRITICAL void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job) { - LUOS_ASSERT((phy_ptr != NULL) && (job != NULL)); + LUOS_ASSERT((phy_ptr != NULL) + && (job >= phy_ptr->job) + && (job < &phy_ptr->job[MAX_MSG_NB])); if (phy_ptr->job_nb == 0) { return; @@ -555,6 +583,7 @@ _CRITICAL void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job) ******************************************************************************/ _CRITICAL inline uint16_t Phy_GetJobNbr(luos_phy_t *phy_ptr) { + LUOS_ASSERT(phy_ptr != NULL); return phy_ptr->job_nb; } diff --git a/test/test_robus/main.c b/test/test_robus/main.c index f9da3a0a6..b146d0bff 100644 --- a/test/test_robus/main.c +++ b/test/test_robus/main.c @@ -4,6 +4,7 @@ #include "context.h" #include "unit_test.h" #include "default_scenario.h" +#include "filter.h" extern default_scenario_t default_sc; diff --git a/test/tests_io/test_filter/main.c b/test/tests_io/test_filter/main.c index 445e39a4e..8c9691cbc 100644 --- a/test/tests_io/test_filter/main.c +++ b/test/tests_io/test_filter/main.c @@ -1,4 +1,3 @@ -#include "main.h" #include "unit_test.h" #include "filter.h" #include "../src/service.c" diff --git a/test/tests_io/test_filter/main.h b/test/tests_io/test_filter/main.h deleted file mode 100644 index 415b31450..000000000 --- a/test/tests_io/test_filter/main.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#endif // MAIN_H diff --git a/test/tests_io/test_phy/main.c b/test/tests_io/test_phy/main.c new file mode 100644 index 000000000..e52b31234 --- /dev/null +++ b/test/tests_io/test_phy/main.c @@ -0,0 +1,1507 @@ +#include "unit_test.h" +#include "../src/luos_phy.c" +#include "../src/msg_alloc.c" +#include "../src/luos_io.c" + +luos_phy_t *robus_phy; +uint8_t buffer[512]; +phy_job_t *Luos_handled_job = NULL; +phy_job_t *Robus_handled_job = NULL; +bool Luos_get_deadTarget = false; +bool Robus_get_deadTarget = false; + +static void phy_luos_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job) +{ + // Test dispatch re-entry protection + volatile uint16_t initial_job_nb = phy_ctx.io_job_nb; + Phy_Dispatch(); + TEST_ASSERT_EQUAL(initial_job_nb, phy_ctx.io_job_nb); + Luos_handled_job = job; + if (job->msg_pt->header.cmd == DEADTARGET) + { + Luos_get_deadTarget = true; + } +} + +static void phy_robus_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job) +{ + // Test dispatch re-entry protection + volatile uint16_t initial_job_nb = phy_ctx.io_job_nb; + Phy_Dispatch(); + TEST_ASSERT_EQUAL(initial_job_nb, phy_ctx.io_job_nb); + Robus_handled_job = job; + if (job->msg_pt->header.cmd == DEADTARGET) + { + Robus_get_deadTarget = true; + } +} + +static void phy_test_reset(void) +{ + Phy_Init(); + luos_phy = Phy_Get(0, phy_luos_MsgHandler); + TEST_ASSERT_EQUAL(&phy_ctx.phy[0], luos_phy); + TEST_ASSERT_EQUAL(1, phy_ctx.phy_nb); + robus_phy = Phy_Create(phy_robus_MsgHandler); + TEST_ASSERT_EQUAL(&phy_ctx.phy[1], robus_phy); + TEST_ASSERT_EQUAL(2, phy_ctx.phy_nb); +} + +/******************************************************************************* + * File function + ******************************************************************************/ + +void unittest_phy_alloc() +{ + NEW_TEST_CASE("Check assertion condition"); + { + TRY + { + phy_test_reset(); + Phy_alloc(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + phy_test_reset(); + luos_phy->rx_alloc_job = true; + luos_phy->received_data = sizeof(header_t) - 1; + luos_phy->rx_buffer_base = buffer; + luos_phy->rx_data = buffer; + Phy_alloc(luos_phy); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + phy_test_reset(); + luos_phy->rx_alloc_job = true; + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_buffer_base = buffer; + luos_phy->rx_data = buffer; + Phy_alloc(luos_phy); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + + TRY + { + phy_test_reset(); + luos_phy->rx_alloc_job = true; + luos_phy->received_data = MAX_DATA_MSG_SIZE + sizeof(header_t) + 1; + luos_phy->rx_buffer_base = buffer; + luos_phy->rx_data = buffer; + Phy_alloc(luos_phy); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + phy_test_reset(); + luos_phy->rx_alloc_job = true; + luos_phy->received_data = MAX_DATA_MSG_SIZE + sizeof(header_t); + luos_phy->rx_buffer_base = buffer; + luos_phy->rx_data = buffer; + Phy_alloc(luos_phy); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + + TRY + { + phy_test_reset(); + luos_phy->rx_alloc_job = true; + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_buffer_base = buffer; + luos_phy->rx_data = 0; + Phy_alloc(luos_phy); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + phy_test_reset(); + luos_phy->rx_alloc_job = true; + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_buffer_base = 0; + luos_phy->rx_data = buffer; + Phy_alloc(luos_phy); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + phy_test_reset(); + luos_phy->rx_alloc_job = false; + luos_phy->received_data = sizeof(header_t) - 1; + luos_phy->rx_buffer_base = 0; + luos_phy->rx_data = buffer; + Phy_alloc(luos_phy); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check that we don't allocate anything if we don't need to keep the data"); + { + TRY + { + phy_test_reset(); + luos_phy->rx_alloc_job = true; + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_buffer_base = buffer; + luos_phy->rx_data = buffer; + luos_phy->rx_keep = false; + Phy_alloc(luos_phy); + TEST_ASSERT_EQUAL(luos_phy->rx_buffer_base, luos_phy->rx_data); + TEST_ASSERT_EQUAL(false, luos_phy->rx_alloc_job); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check normal allocation condition"); + { + memory_stats_t memory_stats; + MsgAlloc_Init(&memory_stats); + TRY + { + phy_test_reset(); + luos_phy->rx_alloc_job = true; + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_buffer_base = buffer; + luos_phy->rx_data = buffer; + luos_phy->rx_keep = true; + // Message computed details + memcpy(buffer, "123test", sizeof("123test")); + luos_phy->rx_size = 10; + luos_phy->rx_phy_filter = 1; + Phy_alloc(luos_phy); + TEST_ASSERT_EQUAL(false, luos_phy->rx_alloc_job); + TEST_ASSERT_NOT_EQUAL(luos_phy->rx_buffer_base, luos_phy->rx_data); + TEST_ASSERT_EQUAL_STRING("123test", luos_phy->rx_data); + TEST_ASSERT_EQUAL_STRING("123test", msg_buffer); + // write the data we receive next + luos_phy->rx_data[sizeof(header_t)] = '3'; + luos_phy->rx_data[sizeof(header_t) + 1] = '2'; + luos_phy->rx_data[sizeof(header_t) + 2] = '1'; + TEST_ASSERT_EQUAL_STRING("123test321", msg_buffer); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + + TRY + { + // Allocate a second message + luos_phy->rx_alloc_job = true; + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_buffer_base = buffer; + luos_phy->rx_data = buffer; + luos_phy->rx_keep = true; + // Message computed details + memcpy(buffer, "123test", sizeof("123test")); + luos_phy->rx_size = 10; + luos_phy->rx_phy_filter = 1; + Phy_alloc(luos_phy); + TEST_ASSERT_EQUAL(false, luos_phy->rx_alloc_job); + TEST_ASSERT_NOT_EQUAL(luos_phy->rx_buffer_base, luos_phy->rx_data); + TEST_ASSERT_EQUAL_STRING("123test", luos_phy->rx_data); + TEST_ASSERT_EQUAL_STRING("123test321123test", msg_buffer); + // write the data we receive next + luos_phy->rx_data[sizeof(header_t)] = '3'; + luos_phy->rx_data[sizeof(header_t) + 1] = '2'; + luos_phy->rx_data[sizeof(header_t) + 2] = '1'; + TEST_ASSERT_EQUAL_STRING("123test321123test321", msg_buffer); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check allocation overflow"); + { + memory_stats_t memory_stats; + MsgAlloc_Init(&memory_stats); + // Put a fake message in allocation + alloc_slot_index = 1; + alloc_slots[0].data = (uint8_t *)&msg_buffer[7]; + TRY + { + phy_test_reset(); + luos_phy->rx_alloc_job = true; + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_buffer_base = buffer; + luos_phy->rx_data = buffer; + luos_phy->rx_keep = true; + // Message computed details + memcpy(buffer, "123test", sizeof("123test")); + luos_phy->rx_size = 10; + luos_phy->rx_phy_filter = 1; + Phy_alloc(luos_phy); + + TEST_ASSERT_EQUAL(false, luos_phy->rx_alloc_job); + TEST_ASSERT_EQUAL(false, luos_phy->rx_keep); + TEST_ASSERT_EQUAL_STRING(NULL, luos_phy->rx_data); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + + TRY + { + // In the same condition than the previous one we should assert in any other phy than the Luos one. + phy_test_reset(); + robus_phy->rx_alloc_job = true; + robus_phy->received_data = sizeof(header_t); + robus_phy->rx_buffer_base = buffer; + robus_phy->rx_data = buffer; + robus_phy->rx_keep = true; + // Message computed details + robus_phy->rx_size = 10; + robus_phy->rx_phy_filter = 1; + Phy_alloc(robus_phy); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } +} + +void unittest_phy_dispatch() +{ + NEW_TEST_CASE("Check re-entry protection and single dispatching with all values"); + { + TRY + { + phy_test_reset(); + // Create a fake job + phy_ctx.io_job_nb = 1; + /// Create msg data + phy_ctx.io_job[0].alloc_msg = (msg_t *)&msg_buffer[0]; + phy_ctx.io_job[0].alloc_msg->header.config = TIMESTAMP_PROTOCOL; + phy_ctx.io_job[0].alloc_msg->header.size = 3; + phy_ctx.io_job[0].alloc_msg->header.target_mode = NODEIDACK; + phy_ctx.io_job[0].size = 10; + phy_ctx.io_job[0].phy_filter = 0x01; // Target Luos phy only + phy_ctx.io_job[0].timestamp = 10; // This represent the reception date + time_luos_t timestamp_latency = TimeOD_TimeFrom_ns(10); + memcpy(&phy_ctx.io_job[0].alloc_msg->data[phy_ctx.io_job[0].alloc_msg->header.size], ×tamp_latency, sizeof(time_luos_t)); + + Phy_Dispatch(); + + TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); + TEST_ASSERT_EQUAL(1, luos_phy->job_nb); + TEST_ASSERT_EQUAL(&luos_phy->job[0], Luos_handled_job); + TEST_ASSERT_EQUAL(&msg_buffer[0], luos_phy->job[0].data_pt); + TEST_ASSERT_EQUAL(10, luos_phy->job[0].size); + TEST_ASSERT_EQUAL(true, luos_phy->job[0].ack); + TEST_ASSERT_EQUAL(true, luos_phy->job[0].timestamp); + time_luos_t timestamp_date; + memcpy(×tamp_date, &phy_ctx.io_job[0].alloc_msg->data[phy_ctx.io_job[0].alloc_msg->header.size], sizeof(time_luos_t)); + TEST_ASSERT_FLOAT_WITHIN(1.0, 20.0, TimeOD_TimeTo_ns(timestamp_date)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check re-entry protection and multiple dispatching with all values"); + { + TRY + { + phy_test_reset(); + memset(&luos_phy->job[0], 0, sizeof(phy_job_t)); + luos_phy->job_nb = 0; + + // Create a fake job + phy_ctx.io_job_nb = 1; + /// Create msg data + phy_ctx.io_job[0].alloc_msg = (msg_t *)&msg_buffer[0]; + phy_ctx.io_job[0].alloc_msg->header.config = TIMESTAMP_PROTOCOL; + phy_ctx.io_job[0].alloc_msg->header.size = 3; + phy_ctx.io_job[0].alloc_msg->header.target_mode = NODEIDACK; + phy_ctx.io_job[0].size = 10; + phy_ctx.io_job[0].phy_filter = 0x03; // Target Luos and Robus phy + phy_ctx.io_job[0].timestamp = 10; // This represent the reception date + time_luos_t timestamp_latency = TimeOD_TimeFrom_ns(10); + memcpy(&phy_ctx.io_job[0].alloc_msg->data[phy_ctx.io_job[0].alloc_msg->header.size], ×tamp_latency, sizeof(time_luos_t)); + + Phy_Dispatch(); + + time_luos_t timestamp_date; + TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); + + TEST_ASSERT_EQUAL(1, luos_phy->job_nb); + TEST_ASSERT_EQUAL(&luos_phy->job[0], Luos_handled_job); + TEST_ASSERT_EQUAL(&msg_buffer[0], luos_phy->job[0].data_pt); + TEST_ASSERT_EQUAL(10, luos_phy->job[0].size); + TEST_ASSERT_EQUAL(true, luos_phy->job[0].ack); + TEST_ASSERT_EQUAL(true, luos_phy->job[0].timestamp); + memcpy(×tamp_date, &luos_phy->job[0].msg_pt->data[luos_phy->job[0].msg_pt->header.size], sizeof(time_luos_t)); + TEST_ASSERT_FLOAT_WITHIN(1.0, 20.0, TimeOD_TimeTo_ns(timestamp_date)); + + TEST_ASSERT_EQUAL(1, robus_phy->job_nb); + TEST_ASSERT_EQUAL(&robus_phy->job[0], Robus_handled_job); + TEST_ASSERT_EQUAL(&msg_buffer[0], robus_phy->job[0].data_pt); + TEST_ASSERT_EQUAL(10, robus_phy->job[0].size); + TEST_ASSERT_EQUAL(true, robus_phy->job[0].ack); + TEST_ASSERT_EQUAL(true, robus_phy->job[0].timestamp); + memcpy(×tamp_date, &robus_phy->job[0].msg_pt->data[robus_phy->job[0].msg_pt->header.size], sizeof(time_luos_t)); + TEST_ASSERT_FLOAT_WITHIN(1.0, 20.0, TimeOD_TimeTo_ns(timestamp_date)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Try to dispatch corrupted jobs"); + { + TRY + { + phy_test_reset(); + // Create a fake job + phy_ctx.io_job_nb = 1; + /// Create msg data + phy_ctx.io_job[0].alloc_msg = 0; + phy_ctx.io_job[0].size = 10; + phy_ctx.io_job[0].phy_filter = 0x01; // Target Luos phy only + phy_ctx.io_job[0].timestamp = 10; // This represent the reception date + + Phy_Dispatch(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + phy_test_reset(); + // Create a fake job + phy_ctx.io_job_nb = 1; + /// Create msg data + phy_ctx.io_job[0].alloc_msg = (msg_t *)&msg_buffer[0]; + phy_ctx.io_job[0].alloc_msg->header.config = TIMESTAMP_PROTOCOL; + phy_ctx.io_job[0].alloc_msg->header.size = 3; + phy_ctx.io_job[0].alloc_msg->header.target_mode = NODEIDACK; + phy_ctx.io_job[0].size = 0; + phy_ctx.io_job[0].phy_filter = 0x01; // Target Luos phy only + phy_ctx.io_job[0].timestamp = 10; // This represent the reception date + time_luos_t timestamp_latency = TimeOD_TimeFrom_ns(10); + memcpy(&phy_ctx.io_job[0].alloc_msg->data[phy_ctx.io_job[0].alloc_msg->header.size], ×tamp_latency, sizeof(time_luos_t)); + + Phy_Dispatch(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } +} + +void unittest_phy_deadTarget() +{ + NEW_TEST_CASE("Check DeadTargetSpotted assertion conditions"); + { + TRY + { + phy_test_reset(); + // Create a fake phy job + luos_phy->job_nb = 1; + luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; + Phy_DeadTargetSpotted(luos_phy, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + phy_test_reset(); + // Create a fake phy job + luos_phy->job_nb = 1; + luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; + Phy_DeadTargetSpotted(0, &luos_phy->job[0]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + phy_test_reset(); + // Create a fake phy job + luos_phy->job_nb = 1; + luos_phy->job[0].data_pt = 0; + Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + phy_test_reset(); + // Create a fake phy job + luos_phy->job_nb = 1; + luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; + msg_t *msg = (msg_t *)msg_buffer; + msg->header.target_mode = 0x0f; + Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check DeadTargetSpotted failed job creation"); + { + TRY + { + phy_test_reset(); + // Create a fake phy job + luos_phy->job_nb = 1; + luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; + msg_t *msg = (msg_t *)msg_buffer; + msg->header.target_mode = NODEIDACK; + msg->header.target = 1; + + TEST_ASSERT_EQUAL(0, phy_ctx.failed_job_nb); + Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); + TEST_ASSERT_EQUAL(1, phy_ctx.failed_job_nb); + TEST_ASSERT_EQUAL(msg_buffer, phy_ctx.failed_job[0].data_pt); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check DeadTargetSpotted phy job removal"); + { + TRY + { + phy_test_reset(); + // Create a fake phy job + luos_phy->job_nb = 3; + luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; + luos_phy->job[1].data_pt = (uint8_t *)&msg_buffer[20]; // This is a different target, it should not be removed + luos_phy->job[2].data_pt = (uint8_t *)msg_buffer; + msg_t *msg = (msg_t *)msg_buffer; + msg->header.target_mode = NODEIDACK; + msg->header.target = 1; + + TEST_ASSERT_EQUAL(0, phy_ctx.failed_job_nb); + Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); + TEST_ASSERT_EQUAL(1, phy_ctx.failed_job_nb); + TEST_ASSERT_EQUAL(msg_buffer, phy_ctx.failed_job[0].data_pt); + TEST_ASSERT_EQUAL(1, luos_phy->job_nb); + TEST_ASSERT_EQUAL(&msg_buffer[20], luos_phy->job[0].data_pt); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + + TRY + { + phy_test_reset(); + // Create a fake phy job + luos_phy->job_nb = 3; + luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; + luos_phy->job[1].data_pt = (uint8_t *)msg_buffer; // All jobs should be removed + luos_phy->job[2].data_pt = (uint8_t *)msg_buffer; + msg_t *msg = (msg_t *)msg_buffer; + msg->header.target_mode = NODEIDACK; + msg->header.target = 1; + + TEST_ASSERT_EQUAL(0, phy_ctx.failed_job_nb); + Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); + TEST_ASSERT_EQUAL(1, phy_ctx.failed_job_nb); + TEST_ASSERT_EQUAL(msg_buffer, phy_ctx.failed_job[0].data_pt); + TEST_ASSERT_EQUAL(0, luos_phy->job_nb); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check Failed job management and user notification"); + { + TRY + { + phy_test_reset(); + memory_stats_t memory_stats; + MsgAlloc_Init(&memory_stats); + // Create a fake phy job + luos_phy->job_nb = 3; + luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; + luos_phy->job[1].data_pt = (uint8_t *)&msg_buffer[20]; // This is a different target, it should not be removed + luos_phy->job[2].data_pt = (uint8_t *)msg_buffer; + msg_t *msg = (msg_t *)msg_buffer; + msg->header.target_mode = NODEIDACK; + msg->header.target = 1; + + TEST_ASSERT_EQUAL(0, phy_ctx.failed_job_nb); + Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); + TEST_ASSERT_EQUAL(msg_buffer, phy_ctx.failed_job[0].data_pt); + TEST_ASSERT_EQUAL(1, luos_phy->job_nb); + TEST_ASSERT_EQUAL(&msg_buffer[20], luos_phy->job[0].data_pt); + + TEST_ASSERT_EQUAL(1, phy_ctx.failed_job_nb); + TEST_ASSERT_EQUAL(false, Luos_get_deadTarget); + TEST_ASSERT_EQUAL(false, Robus_get_deadTarget); + Phy_ManageFailedJob(); + TEST_ASSERT_EQUAL(0, phy_ctx.failed_job_nb); + Phy_Dispatch(); // Deal with messages + TEST_ASSERT_EQUAL(true, Luos_get_deadTarget); + TEST_ASSERT_EQUAL(true, Robus_get_deadTarget); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_phy_loop() +{ + + NEW_TEST_CASE("Check allocation"); + { + memory_stats_t memory_stats; + MsgAlloc_Init(&memory_stats); + TRY + { + phy_test_reset(); + robus_phy->rx_alloc_job = true; + robus_phy->received_data = sizeof(header_t); + robus_phy->rx_buffer_base = buffer; + robus_phy->rx_data = buffer; + robus_phy->rx_keep = true; + // Message computed details + robus_phy->rx_size = 10; + robus_phy->rx_phy_filter = 1; + Phy_Loop(); + TEST_ASSERT_EQUAL(false, robus_phy->rx_alloc_job); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check dispatching and Failed job management"); + { + TRY + { + phy_test_reset(); + memory_stats_t memory_stats; + MsgAlloc_Init(&memory_stats); + // Create a fake phy job + luos_phy->job_nb = 3; + luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; + luos_phy->job[1].data_pt = (uint8_t *)&msg_buffer[20]; // This is a different target, it should not be removed + luos_phy->job[2].data_pt = (uint8_t *)msg_buffer; + msg_t *msg = (msg_t *)msg_buffer; + msg->header.target_mode = NODEIDACK; + msg->header.target = 1; + Luos_get_deadTarget = false; + Robus_get_deadTarget = false; + + Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); + + TEST_ASSERT_EQUAL(1, phy_ctx.failed_job_nb); + Phy_Loop(); + TEST_ASSERT_EQUAL(0, phy_ctx.failed_job_nb); + TEST_ASSERT_EQUAL(true, Luos_get_deadTarget); + TEST_ASSERT_EQUAL(true, Robus_get_deadTarget); + Luos_get_deadTarget = false; + Robus_get_deadTarget = false; + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_phy_ComputeHeader() +{ + NEW_TEST_CASE("Check ComputeHeader assertion conditions"); + { + TRY + { + Phy_ComputeHeader(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check ComputeHeader for a non timestamped message needed by Luos"); + { + TRY + { + phy_test_reset(); + // Create a fake service with id 1 + Filter_AddServiceId(1, 1); + + msg_t msg; + msg.header.config = BASE_PROTOCOL; + msg.header.target_mode = SERVICEIDACK; + msg.header.target = 1; + msg.header.cmd = IO_STATE; + msg.header.size = 1; + msg.data[0] = 0xAE; + + // Save message information in the Luos phy struct + // Luos can target himself. + luos_phy->rx_buffer_base = (uint8_t *)&msg; + luos_phy->rx_data = luos_phy->rx_buffer_base; + // For now let just consider that we received the header allowing us to compute the message things based on it. + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_keep = true; // Tell phy that we want to keep this message + luos_phy->rx_ack = false; + luos_phy->rx_alloc_job = false; + luos_phy->rx_size = 0; + luos_phy->rx_phy_filter = 0x00; + Phy_ComputeHeader(luos_phy); + TEST_ASSERT_EQUAL(msg.header.size + sizeof(header_t), luos_phy->rx_size); + TEST_ASSERT_EQUAL(true, luos_phy->rx_keep); + TEST_ASSERT_EQUAL(true, luos_phy->rx_ack); + TEST_ASSERT_EQUAL(true, luos_phy->rx_alloc_job); + TEST_ASSERT_EQUAL(0x01, luos_phy->rx_phy_filter); // A luos service is targeted + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check ComputeHeader for a timestamped message needed by Luos"); + { + TRY + { + phy_test_reset(); + // Create a fake service with id 1 + Filter_AddServiceId(1, 1); + + msg_t msg; + msg.header.config = TIMESTAMP_PROTOCOL; + msg.header.target_mode = SERVICEIDACK; + msg.header.target = 1; + msg.header.cmd = IO_STATE; + msg.header.size = 1; + msg.data[0] = 0xAE; + + // Save message information in the Luos phy struct + // Luos can target himself. + luos_phy->rx_buffer_base = (uint8_t *)&msg; + luos_phy->rx_data = luos_phy->rx_buffer_base; + // For now let just consider that we received the header allowing us to compute the message things based on it. + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_keep = true; // Tell phy that we want to keep this message + luos_phy->rx_ack = false; + luos_phy->rx_alloc_job = false; + luos_phy->rx_size = 0; + luos_phy->rx_phy_filter = 0x00; + Phy_ComputeHeader(luos_phy); + TEST_ASSERT_EQUAL(msg.header.size + sizeof(header_t) + sizeof(time_luos_t), luos_phy->rx_size); + TEST_ASSERT_EQUAL(true, luos_phy->rx_keep); + TEST_ASSERT_EQUAL(true, luos_phy->rx_ack); + TEST_ASSERT_EQUAL(true, luos_phy->rx_alloc_job); + TEST_ASSERT_EQUAL(0x01, luos_phy->rx_phy_filter); // A luos service is targeted + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check ComputeHeader for a non timestamped large message needed by Luos"); + { + TRY + { + phy_test_reset(); + // Create a fake service with id 1 + Filter_AddServiceId(1, 1); + + msg_t msg; + msg.header.config = BASE_PROTOCOL; + msg.header.target_mode = SERVICEID; + msg.header.target = 1; + msg.header.cmd = IO_STATE; + msg.header.size = 600; + msg.data[0] = 0xAE; + + // Save message information in the Luos phy struct + // Luos can target himself. + luos_phy->rx_buffer_base = (uint8_t *)&msg; + luos_phy->rx_data = luos_phy->rx_buffer_base; + // For now let just consider that we received the header allowing us to compute the message things based on it. + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_keep = true; // Tell phy that we want to keep this message + luos_phy->rx_ack = false; + luos_phy->rx_alloc_job = false; + luos_phy->rx_size = 0; + luos_phy->rx_phy_filter = 0x00; + Phy_ComputeHeader(luos_phy); + TEST_ASSERT_EQUAL(MAX_DATA_MSG_SIZE + sizeof(header_t), luos_phy->rx_size); + TEST_ASSERT_EQUAL(true, luos_phy->rx_keep); + TEST_ASSERT_EQUAL(false, luos_phy->rx_ack); + TEST_ASSERT_EQUAL(true, luos_phy->rx_alloc_job); + TEST_ASSERT_EQUAL(0x01, luos_phy->rx_phy_filter); // A luos service is targeted + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check ComputeHeader for a timestamped large message needed by Luos"); + { + TRY + { + phy_test_reset(); + // Create a fake service with id 1 + Filter_AddServiceId(1, 1); + + msg_t msg; + msg.header.config = TIMESTAMP_PROTOCOL; + msg.header.target_mode = SERVICEIDACK; + msg.header.target = 1; + msg.header.cmd = IO_STATE; + msg.header.size = 600; + msg.data[0] = 0xAE; + + // Save message information in the Luos phy struct + // Luos can target himself. + luos_phy->rx_buffer_base = (uint8_t *)&msg; + luos_phy->rx_data = luos_phy->rx_buffer_base; + // For now let just consider that we received the header allowing us to compute the message things based on it. + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_keep = true; // Tell phy that we want to keep this message + luos_phy->rx_ack = false; + luos_phy->rx_alloc_job = false; + luos_phy->rx_size = 0; + luos_phy->rx_phy_filter = 0x00; + Phy_ComputeHeader(luos_phy); + TEST_ASSERT_EQUAL(MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t), luos_phy->rx_size); + TEST_ASSERT_EQUAL(true, luos_phy->rx_keep); + TEST_ASSERT_EQUAL(true, luos_phy->rx_ack); + TEST_ASSERT_EQUAL(true, luos_phy->rx_alloc_job); + TEST_ASSERT_EQUAL(0x01, luos_phy->rx_phy_filter); // A luos service is targeted + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check ComputeHeader for a timestamped large message needed by Robus"); + { + TRY + { + phy_test_reset(); + // Create a fake service with id 1 + Filter_AddServiceId(1, 1); + + msg_t msg; + msg.header.config = TIMESTAMP_PROTOCOL; + msg.header.target_mode = NODEIDACK; + msg.header.target = 2; + msg.header.cmd = IO_STATE; + msg.header.size = 600; + msg.data[0] = 0xAE; + + // Save message information in the Luos phy struct + luos_phy->rx_buffer_base = (uint8_t *)&msg; + luos_phy->rx_data = luos_phy->rx_buffer_base; + // For now let just consider that we received the header allowing us to compute the message things based on it. + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_keep = true; // Tell phy that we want to keep this message + luos_phy->rx_ack = false; + luos_phy->rx_alloc_job = false; + luos_phy->rx_size = 0; + luos_phy->rx_phy_filter = 0x00; + Phy_ComputeHeader(luos_phy); + TEST_ASSERT_EQUAL(MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t), luos_phy->rx_size); + TEST_ASSERT_EQUAL(true, luos_phy->rx_keep); + TEST_ASSERT_EQUAL(true, luos_phy->rx_ack); + TEST_ASSERT_EQUAL(true, luos_phy->rx_alloc_job); + TEST_ASSERT_EQUAL(0x02, luos_phy->rx_phy_filter); // A Robus node is targeted + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check ComputeHeader for a timestamped large message not needed by any phy"); + { + TRY + { + phy_test_reset(); + // Create a fake service with id 1 + Filter_AddServiceId(1, 1); + + msg_t msg; + msg.header.config = TIMESTAMP_PROTOCOL; + msg.header.target_mode = NODEIDACK; + msg.header.target = 2; + msg.header.cmd = IO_STATE; + msg.header.size = 600; + msg.data[0] = 0xAE; + + // Save message information in the Luos phy struct + // Robus cannot target himself. + robus_phy->rx_buffer_base = (uint8_t *)&msg; + robus_phy->rx_data = robus_phy->rx_buffer_base; + // For now let just consider that we received the header allowing us to compute the message things based on it. + robus_phy->received_data = sizeof(header_t); + robus_phy->rx_keep = true; // Tell phy that we want to keep this message + robus_phy->rx_ack = false; + robus_phy->rx_alloc_job = false; + robus_phy->rx_size = 0; + robus_phy->rx_phy_filter = 0x00; + Phy_ComputeHeader(robus_phy); + TEST_ASSERT_EQUAL(MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t), luos_phy->rx_size); + TEST_ASSERT_EQUAL(false, robus_phy->rx_keep); + TEST_ASSERT_EQUAL(false, robus_phy->rx_ack); + TEST_ASSERT_EQUAL(false, robus_phy->rx_alloc_job); + TEST_ASSERT_EQUAL(0x00, robus_phy->rx_phy_filter); // No service is targeted + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_phy_ValidMsg() +{ + NEW_TEST_CASE("Check ValidMsg assertion conditions"); + { + TRY + { + Phy_ValidMsg(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check ValidMsg job creation"); + { + TRY + { + phy_test_reset(); + + msg_t msg; + // Save message information in the Luos phy struct + // Robus cannot target himself. + luos_phy->rx_buffer_base = (uint8_t *)&msg; + luos_phy->rx_data = msg_buffer; + // For now let just consider that we received the header allowing us to compute the message things based on it. + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_keep = true; // Tell phy that we want to keep this message + luos_phy->rx_ack = true; + luos_phy->rx_alloc_job = false; + luos_phy->rx_size = MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t); + luos_phy->rx_phy_filter = 0x02; // A Robus node is targeted + luos_phy->rx_timestamp = 10; + + TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); + Phy_ValidMsg(luos_phy); + TEST_ASSERT_EQUAL(1, phy_ctx.io_job_nb); + TEST_ASSERT_EQUAL(10, phy_ctx.io_job[0].timestamp); + TEST_ASSERT_EQUAL(msg_buffer, phy_ctx.io_job[0].alloc_msg); + TEST_ASSERT_EQUAL(0x02, phy_ctx.io_job[0].phy_filter); + TEST_ASSERT_EQUAL(MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t), phy_ctx.io_job[0].size); + TEST_ASSERT_EQUAL(0, luos_phy->received_data); + TEST_ASSERT_EQUAL(luos_phy->rx_buffer_base, luos_phy->rx_data); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check that ValidMsg don't create job if we don't need it"); + { + TRY + { + phy_test_reset(); + + msg_t msg; + // Save message information in the Luos phy struct + // Robus cannot target himself. + luos_phy->rx_buffer_base = (uint8_t *)&msg; + luos_phy->rx_data = msg_buffer; + // For now let just consider that we received the header allowing us to compute the message things based on it. + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_keep = false; + luos_phy->rx_ack = true; + luos_phy->rx_alloc_job = false; + luos_phy->rx_size = MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t); + luos_phy->rx_phy_filter = 0x02; // A Robus node is targeted + luos_phy->rx_timestamp = 10; + + TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); + Phy_ValidMsg(luos_phy); + TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check ValidMsg allocation"); + { + TRY + { + phy_test_reset(); + memory_stats_t memory_stats; + MsgAlloc_Init(&memory_stats); + + msg_t msg; + // Save message information in the Luos phy struct + // Robus cannot target himself. + luos_phy->rx_buffer_base = (uint8_t *)&msg; + luos_phy->rx_data = (uint8_t *)&msg; + // For now let just consider that we received the header allowing us to compute the message things based on it. + luos_phy->received_data = sizeof(header_t); + luos_phy->rx_keep = true; // Tell phy that we want to keep this message + luos_phy->rx_ack = true; + luos_phy->rx_alloc_job = true; + luos_phy->rx_size = MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t); + luos_phy->rx_phy_filter = 0x02; // A Robus node is targeted + luos_phy->rx_timestamp = 10; + + TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); + Phy_ValidMsg(luos_phy); + TEST_ASSERT_EQUAL(1, phy_ctx.io_job_nb); + TEST_ASSERT_EQUAL(10, phy_ctx.io_job[0].timestamp); + TEST_ASSERT_EQUAL(false, luos_phy->rx_alloc_job); + TEST_ASSERT_EQUAL(msg_buffer, phy_ctx.io_job[0].alloc_msg); + TEST_ASSERT_EQUAL(0x02, phy_ctx.io_job[0].phy_filter); + TEST_ASSERT_EQUAL(MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t), phy_ctx.io_job[0].size); + TEST_ASSERT_EQUAL(0, luos_phy->received_data); + TEST_ASSERT_EQUAL(luos_phy->rx_buffer_base, luos_phy->rx_data); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_phy_ComputeTimestamp() +{ + NEW_TEST_CASE("Check ComputeTimestamp assertion conditions"); + { + TRY + { + Phy_ComputeTimestamp(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + phy_job_t job; + job.timestamp = false; + job.data_pt = (uint8_t *)msg_buffer; + Phy_ComputeTimestamp(&job); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + phy_job_t job; + job.timestamp = true; + job.data_pt = NULL; + Phy_ComputeTimestamp(&job); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check ComputeTimestamp normal conditions"); + { + TRY + { + phy_test_reset(); + memory_stats_t memory_stats; + MsgAlloc_Init(&memory_stats); + + phy_job_t job; + job.timestamp = true; + job.data_pt = (uint8_t *)msg_buffer; + + msg_t *msg = (msg_t *)msg_buffer; + msg->header.config = TIMESTAMP_PROTOCOL; + msg->header.target_mode = SERVICEIDACK; + msg->header.target = 1; + msg->header.cmd = IO_STATE; + msg->header.size = 1; + msg->data[0] = 0xAE; + + time_luos_t timestamp = TimeOD_TimeFrom_ns(10); + memcpy(&msg->data[msg->header.size], ×tamp, sizeof(time_luos_t)); + + time_luos_t resulting_latency = Phy_ComputeTimestamp(&job); + + TEST_ASSERT_EQUAL(0xAE, job.msg_pt->data[0]); + TEST_ASSERT_NOT_EQUAL(TimeOD_TimeTo_ns(timestamp), TimeOD_TimeTo_ns(resulting_latency)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_phy_GetNodeId() +{ + NEW_TEST_CASE("Check GetNodeId "); + { + TRY + { + uint16_t node_id = Phy_GetNodeId(); + TEST_ASSERT_EQUAL(Node_Get()->node_id, node_id); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_phy_AddJob() +{ + NEW_TEST_CASE("Check AddJob assertion conditions"); + { + TRY + { + phy_job_t phy_job; + luos_phy->job_nb = 0; + phy_job_t *resulting_job = Phy_AddJob(luos_phy, NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + phy_job_t phy_job; + luos_phy->job_nb = 0; + phy_job_t *resulting_job = Phy_AddJob(NULL, &phy_job); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + phy_job_t phy_job; + luos_phy->job_nb = MAX_MSG_NB; + phy_job_t *resulting_job = Phy_AddJob(luos_phy, &phy_job); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check AddJob normal conditions"); + { + TRY + { + phy_job_t phy_job; + luos_phy->job_nb = 0; + phy_job_t *resulting_job = Phy_AddJob(luos_phy, &phy_job); + TEST_ASSERT_EQUAL(&luos_phy->job[0], resulting_job); + TEST_ASSERT_EQUAL(1, luos_phy->job_nb); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + phy_job_t phy_job; + luos_phy->job_nb = 3; + phy_job_t *resulting_job = Phy_AddJob(luos_phy, &phy_job); + TEST_ASSERT_EQUAL(&luos_phy->job[3], resulting_job); + TEST_ASSERT_EQUAL(4, luos_phy->job_nb); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_phy_GetJob() +{ + NEW_TEST_CASE("Check GetJob assertion conditions"); + { + TRY + { + luos_phy->job_nb = 0; + phy_job_t *resulting_job = Phy_GetJob(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check GetJob normal conditions"); + { + TRY + { + luos_phy->job_nb = 0; + phy_job_t *resulting_job = Phy_GetJob(luos_phy); + TEST_ASSERT_EQUAL(NULL, resulting_job); + TEST_ASSERT_EQUAL(0, luos_phy->job_nb); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + luos_phy->job_nb = 1; + phy_job_t *resulting_job = Phy_GetJob(luos_phy); + TEST_ASSERT_EQUAL(&luos_phy->job[0], resulting_job); + TEST_ASSERT_EQUAL(1, luos_phy->job_nb); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + luos_phy->job_nb = 3; + phy_job_t *resulting_job = Phy_GetJob(luos_phy); + TEST_ASSERT_EQUAL(&luos_phy->job[0], resulting_job); + TEST_ASSERT_EQUAL(3, luos_phy->job_nb); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_phy_GetJobId() +{ + NEW_TEST_CASE("Check GetJobId assertion conditions"); + { + TRY + { + int value = Phy_GetJobId(NULL, &luos_phy->job[0]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + int value = Phy_GetJobId(luos_phy, NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + int value = Phy_GetJobId(luos_phy, &luos_phy->job[MAX_MSG_NB]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check GetJobId normal conditions"); + { + TRY + { + for (int i = 0; i < MAX_MSG_NB; i++) + { + int value = Phy_GetJobId(luos_phy, &luos_phy->job[i]); + TEST_ASSERT_EQUAL(i, value); + } + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + luos_phy->job_nb = 1; + phy_job_t *resulting_job = Phy_GetJob(luos_phy); + TEST_ASSERT_EQUAL(&luos_phy->job[0], resulting_job); + TEST_ASSERT_EQUAL(1, luos_phy->job_nb); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + luos_phy->job_nb = 3; + phy_job_t *resulting_job = Phy_GetJob(luos_phy); + TEST_ASSERT_EQUAL(&luos_phy->job[0], resulting_job); + TEST_ASSERT_EQUAL(3, luos_phy->job_nb); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_phy_GetPhyId() +{ + NEW_TEST_CASE("Check GetPhyId assertion conditions"); + { + TRY + { + int value = Phy_GetPhyId(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + int value = Phy_GetPhyId(&phy_ctx.phy[PHY_NB]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check GetPhyId normal conditions"); + { + TRY + { + for (int i = 0; i < PHY_NB; i++) + { + int value = Phy_GetPhyId(&phy_ctx.phy[i]); + TEST_ASSERT_EQUAL(i, value); + } + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_phy_RmJob() +{ + NEW_TEST_CASE("Check RmJob assertion conditions"); + { + TRY + { + Phy_RmJob(NULL, &luos_phy->job[0]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + Phy_RmJob(luos_phy, NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + Phy_RmJob(luos_phy, &luos_phy->job[MAX_MSG_NB]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check RmJob normal conditions"); + { + + phy_test_reset(); + memory_stats_t memory_stats; + MsgAlloc_Init(&memory_stats); + TRY + { + luos_phy->job_nb = 0; + Phy_RmJob(luos_phy, &luos_phy->job[0]); + TEST_ASSERT_EQUAL(0, luos_phy->job_nb); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + for (int i = 0; i < PHY_NB; i++) + { + luos_phy->job_nb = i + 1; + luos_phy->job[i].data_pt = (uint8_t *)&msg_buffer[i]; + Phy_RmJob(luos_phy, &luos_phy->job[i]); + TEST_ASSERT_EQUAL(i, luos_phy->job_nb); + TEST_ASSERT_EQUAL(NULL, luos_phy->job[i].data_pt); + } + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + for (int i = 0; i < PHY_NB - 1; i++) + { + luos_phy->job_nb = i + 2; + luos_phy->job[i].data_pt = (uint8_t *)&msg_buffer[i]; + luos_phy->job[i + 1].data_pt = (uint8_t *)&msg_buffer[i + 1]; + Phy_RmJob(luos_phy, &luos_phy->job[i]); + TEST_ASSERT_EQUAL(i + 1, luos_phy->job_nb); + TEST_ASSERT_EQUAL(&msg_buffer[i + 1], luos_phy->job[i].data_pt); + } + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_phy_GetJobNbr() +{ + NEW_TEST_CASE("Check GetJobNbr assertion conditions"); + { + TRY + { + uint16_t value = Phy_GetJobNbr(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check GetPhyId normal conditions"); + { + TRY + { + for (int i = 0; i < MAX_MSG_NB; i++) + { + luos_phy->job_nb = i; + uint16_t value = Phy_GetJobNbr(luos_phy); + TEST_ASSERT_EQUAL(i, value); + } + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_phy_TxAllComplete() +{ + NEW_TEST_CASE("Check TxAllComplete normal conditions"); + { + TRY + { + luos_phy->job_nb = 1; + robus_phy->job_nb = 1; + error_return_t result = Phy_TxAllComplete(); + TEST_ASSERT_EQUAL(FAILED, result); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + luos_phy->job_nb = 0; + robus_phy->job_nb = 1; + error_return_t result = Phy_TxAllComplete(); + TEST_ASSERT_EQUAL(FAILED, result); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + luos_phy->job_nb = 1; + robus_phy->job_nb = 0; + error_return_t result = Phy_TxAllComplete(); + TEST_ASSERT_EQUAL(SUCCEED, result); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +int main(int argc, char **argv) +{ + UNITY_BEGIN(); + + UNIT_TEST_RUN(unittest_phy_alloc); + UNIT_TEST_RUN(unittest_phy_dispatch); + UNIT_TEST_RUN(unittest_phy_deadTarget); + UNIT_TEST_RUN(unittest_phy_loop); + UNIT_TEST_RUN(unittest_phy_ComputeHeader); + UNIT_TEST_RUN(unittest_phy_ValidMsg); + UNIT_TEST_RUN(unittest_phy_ComputeTimestamp); + UNIT_TEST_RUN(unittest_phy_GetNodeId); + UNIT_TEST_RUN(unittest_phy_AddJob); + UNIT_TEST_RUN(unittest_phy_GetJob); + UNIT_TEST_RUN(unittest_phy_GetJobId); + UNIT_TEST_RUN(unittest_phy_GetPhyId); + UNIT_TEST_RUN(unittest_phy_RmJob); + UNIT_TEST_RUN(unittest_phy_GetJobNbr); + UNIT_TEST_RUN(unittest_phy_TxAllComplete); + + UNITY_END(); +} From 18638874bd580444b642225f15a914ab8657955b Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 5 May 2023 16:31:15 +0200 Subject: [PATCH 057/150] Add luos_io unit test --- engine/IO/src/luos_io.c | 26 +- test/tests_io/test_luos_io/main.c | 992 ++++++++++++++++++++++++++++++ 2 files changed, 1007 insertions(+), 11 deletions(-) create mode 100644 test/tests_io/test_luos_io/main.c diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 9497d5d5a..8fa5be12a 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -94,12 +94,14 @@ void LuosIO_Loop(void) Robus_Loop(); if (Flag_DetectServices == true) { + LUOS_ASSERT(detection_service != NULL); Flag_DetectServices = false; // Set the detection launcher id to 1 detection_service->id = 1; // Generate the filters Service_GenerateId(1); RoutingTB_DetectServices(detection_service); + detection_service = NULL; } } @@ -110,6 +112,9 @@ void LuosIO_Loop(void) ******************************************************************************/ static void LuosIO_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job) { + LUOS_ASSERT((phy_ptr == luos_phy) + && (job >= luos_phy->job) + && (job < &luos_phy->job[MAX_MSG_NB])); // Check if this message is a protocol one if (LuosIO_ConsumeMsg(job->msg_pt) == FAILED) { @@ -273,6 +278,7 @@ static error_return_t LuosIO_StartTopologyDetection(service_t *service) ******************************************************************************/ error_return_t LuosIO_ConsumeMsg(const msg_t *input) { + LUOS_ASSERT(input != NULL); msg_t output_msg; node_bootstrap_t node_bootstrap; time_luos_t time; @@ -292,7 +298,6 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) // Someone asking us a new node id (we are the detecting service) // Increase the number of node_nb and send it back last_node++; - output_msg.header.config = BASE_PROTOCOL; output_msg.header.cmd = WRITE_NODE_ID; output_msg.header.size = sizeof(uint16_t); output_msg.header.target = input->header.source; @@ -310,7 +315,6 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) Robus_SaveNodeID(node_bootstrap.nodeid); // Now we can send it to the next node node_bootstrap.prev_nodeid = Node_Get()->node_id; - output_msg.header.config = BASE_PROTOCOL; output_msg.header.cmd = WRITE_NODE_ID; output_msg.header.size = sizeof(node_bootstrap_t); output_msg.header.target = 0; @@ -403,13 +407,10 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) break; case ASK_DETECTION: - if (input->header.size == 0) + if (Node_GetState() < LOCAL_DETECTION) { - if (Node_GetState() < LOCAL_DETECTION) - { - detection_service = service; - Flag_DetectServices = true; - } + detection_service = service; + Flag_DetectServices = true; } return SUCCEED; break; @@ -442,9 +443,9 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) { output_msg.header.cmd = REVISION; output_msg.header.target_mode = SERVICEID; + output_msg.header.size = sizeof(revision_t); + output_msg.header.target = input->header.source; memcpy(output_msg.data, service->revision.unmap, sizeof(revision_t)); - output_msg.header.size = sizeof(revision_t); - output_msg.header.target = input->header.source; Luos_SendMsg(service, &output_msg); return SUCCEED; } @@ -488,7 +489,7 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) break; case UPDATE_PUB: - // this service need to be auto updated + // This service need to be auto updated TimeOD_TimeFromMsg(&time, input); service->auto_refresh.target = input->header.source; service->auto_refresh.time_ms = (uint16_t)TimeOD_TimeTo_ms(time); @@ -517,6 +518,7 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) ******************************************************************************/ static inline void LuosIO_TransmitLocalRoutingTable(service_t *service, msg_t *routeTB_msg) { + LUOS_ASSERT(routeTB_msg != NULL); uint16_t entry_nb = 0; routing_table_t local_routing_table[Service_GetNumber() + 1]; @@ -596,6 +598,8 @@ error_return_t LuosIO_TryToGetJob(uint16_t job_id, phy_job_t **job) ******************************************************************************/ void LuosIO_RmJob(phy_job_t *job) { + LUOS_ASSERT((job >= luos_phy->job) + && (job < &luos_phy->job[luos_phy->job_nb])); // Be sure every service has finished to use this job if (*(service_filter_t *)job->phy_data != 0) { diff --git a/test/tests_io/test_luos_io/main.c b/test/tests_io/test_luos_io/main.c new file mode 100644 index 000000000..f4480ab3a --- /dev/null +++ b/test/tests_io/test_luos_io/main.c @@ -0,0 +1,992 @@ +#include "unit_test.h" +#include "../src/luos_io.c" +#include "../src/luos_phy.c" +#include "../src/msg_alloc.c" +#include "../src/service.c" +#include "../src/routing_table.c" + +phy_job_t *Luos_handled_job = NULL; +phy_job_t *Robus_handled_job = NULL; + +static void phy_luos_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job) +{ + Luos_handled_job = job; +} + +static void phy_robus_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job) +{ + Robus_handled_job = job; +} + +static void luosIO_reset_overlap_callback(void) +{ + LuosIO_Init(); + // Overlap the normal callbacks + luos_phy = Phy_Get(0, phy_luos_MsgHandler); + Phy_Get(1, phy_robus_MsgHandler); + TEST_ASSERT_EQUAL(&phy_ctx.phy[0], luos_phy); +} + +/******************************************************************************* + * File function + ******************************************************************************/ + +void unittest_luosIO_init() +{ + NEW_TEST_CASE("Basic init test"); + { + TRY + { + luos_phy = NULL; + LuosIO_Init(); + TEST_ASSERT_EQUAL(&phy_ctx.phy[0], luos_phy); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_luosIO_loop() +{ + NEW_TEST_CASE("Check that allocation treatment is done in loop"); + { + TRY + { + LuosIO_Init(); + alloc_slot_index = 3; + LuosIO_Loop(); + TEST_ASSERT_EQUAL(0, alloc_slot_index); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check that phy treatment is done in loop"); + { + TRY + { + LuosIO_Init(); + phy_ctx.phy[1].rx_alloc_job = true; + phy_ctx.phy[1].received_data = sizeof(header_t); + phy_ctx.phy[1].rx_buffer_base = (uint8_t *)msg_buffer; + phy_ctx.phy[1].rx_data = (uint8_t *)msg_buffer; + phy_ctx.phy[1].rx_keep = true; + // Message computed details + phy_ctx.phy[1].rx_size = 10; + phy_ctx.phy[1].rx_phy_filter = 1; + LuosIO_Loop(); + TEST_ASSERT_EQUAL(false, phy_ctx.phy[1].rx_alloc_job); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check detection assertion condition in loop"); + { + TRY + { + LuosIO_Init(); + Flag_DetectServices = true; + detection_service = NULL; + LuosIO_Loop(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check that the detection treatment is done in loop"); + { + TRY + { + LuosIO_Init(); + Flag_DetectServices = true; + detection_service = &service_ctx.list[0]; + LuosIO_Loop(); + TEST_ASSERT_EQUAL(NULL, detection_service); + TEST_ASSERT_EQUAL(false, Flag_DetectServices); + TEST_ASSERT_EQUAL(1, service_ctx.list[0].id); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_luosIO_TransmitLocalRoutingTable() +{ + NEW_TEST_CASE("Check assert condition for TransmitLocalRoutingTable"); + { + TRY + { + LuosIO_Init(); + LuosIO_TransmitLocalRoutingTable(NULL, NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check that the routing table is sent"); + { + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + Luos_handled_job = NULL; + Node_Get()->node_id = 1; + service_ctx.number = 2; + msg.header.cmd = RTB; + msg.header.target_mode = NODEIDACK; + msg.header.target = 1; + + LuosIO_TransmitLocalRoutingTable(NULL, &msg); + TEST_ASSERT_NOT_EQUAL(NULL, Luos_handled_job); + TEST_ASSERT_EQUAL(RTB, Luos_handled_job->msg_pt->header.cmd); + TEST_ASSERT_EQUAL(1, Luos_handled_job->msg_pt->header.target); + TEST_ASSERT_EQUAL(3 * sizeof(routing_table_t), Luos_handled_job->msg_pt->header.size); + TEST_ASSERT_EQUAL(NODEIDACK, Luos_handled_job->msg_pt->header.target_mode); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_luosIO_ConsumeMsg() +{ + NEW_TEST_CASE("Check assert condition for ConsumeMsg"); + { + TRY + { + LuosIO_Init(); + LuosIO_ConsumeMsg(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check WRITE_NODE_ID size 0 treatment (node id generation)"); + { + TRY + { + luosIO_reset_overlap_callback(); + Luos_handled_job = NULL; + last_node = 1; + Node_Get()->node_id = 1; + msg_t msg; + msg.header.cmd = WRITE_NODE_ID; + msg.header.size = 0; + msg.header.source = 1; + + LuosIO_ConsumeMsg(&msg); + + TEST_ASSERT_EQUAL(2, last_node); + // Check received message content + TEST_ASSERT_NOT_EQUAL(NULL, Luos_handled_job); + TEST_ASSERT_EQUAL(WRITE_NODE_ID, Luos_handled_job->msg_pt->header.cmd); + TEST_ASSERT_EQUAL(sizeof(uint16_t), Luos_handled_job->msg_pt->header.size); + TEST_ASSERT_EQUAL(msg.header.source, Luos_handled_job->msg_pt->header.target); + TEST_ASSERT_EQUAL(NODEIDACK, Luos_handled_job->msg_pt->header.target_mode); + TEST_ASSERT_EQUAL(1, service_ctx.list[0].id); + uint16_t id; + memcpy((void *)&id, (void *)Luos_handled_job->msg_pt->data, sizeof(uint16_t)); + TEST_ASSERT_EQUAL(2, id); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check WRITE_NODE_ID size 2 treatment (node id received from the detector)"); + { + TRY + { + luosIO_reset_overlap_callback(); + Luos_handled_job = NULL; + Robus_handled_job = NULL; + Node_Get()->node_id = 1; + msg_t msg; + msg.header.cmd = WRITE_NODE_ID; + msg.header.size = 2; + msg.header.source = 1; + uint16_t id = 2; + memcpy((void *)msg.data, (void *)&id, sizeof(uint16_t)); + + LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(NULL, Luos_handled_job); + TEST_ASSERT_NOT_EQUAL(NULL, Robus_handled_job); + TEST_ASSERT_EQUAL(WRITE_NODE_ID, Robus_handled_job->msg_pt->header.cmd); + TEST_ASSERT_EQUAL(sizeof(node_bootstrap_t), Robus_handled_job->msg_pt->header.size); + TEST_ASSERT_EQUAL(0, Robus_handled_job->msg_pt->header.target); + TEST_ASSERT_EQUAL(NODEIDACK, Robus_handled_job->msg_pt->header.target_mode); + node_bootstrap_t node_bootstrap; + memcpy((void *)&node_bootstrap, (void *)Robus_handled_job->msg_pt->data, sizeof(node_bootstrap_t)); + TEST_ASSERT_EQUAL(2, node_bootstrap.nodeid); + TEST_ASSERT_EQUAL(1, node_bootstrap.prev_nodeid); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check WRITE_NODE_ID sizeof node_bootstrap_t treatment (nodereceiving it's id and the previous one)"); + { + TRY + { + luosIO_reset_overlap_callback(); + Luos_handled_job = NULL; + Robus_handled_job = NULL; + Node_Get()->node_id = 0; + msg_t msg; + msg.header.cmd = WRITE_NODE_ID; + msg.header.size = sizeof(node_bootstrap_t); + msg.header.source = 1; + + node_bootstrap_t node_bootstrap; + node_bootstrap.nodeid = 2; + node_bootstrap.prev_nodeid = 1; + memcpy((void *)msg.data, (void *)&node_bootstrap, sizeof(node_bootstrap_t)); + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(SUCCEED, ret_val); + TEST_ASSERT_EQUAL(NULL, Luos_handled_job); + TEST_ASSERT_EQUAL(NULL, Robus_handled_job); + TEST_ASSERT_EQUAL(2, Node_Get()->node_id); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check LOCAL_RTB assert condition"); + { + TRY + { + luosIO_reset_overlap_callback(); + Luos_handled_job = NULL; + last_node = 1; + Node_Get()->node_id = 1; + msg_t msg; + msg.header.cmd = LOCAL_RTB; + msg.header.size = 3; + msg.header.source = 1; + + LuosIO_ConsumeMsg(&msg); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check LOCAL_RTB size 0 treatment (send of the local rtb)"); + { + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + Luos_handled_job = NULL; + Robus_handled_job = NULL; + Node_Get()->node_id = 1; + service_ctx.number = 2; + service_ctx.list[0].id = 1; + // Generate the filters + Service_GenerateId(1); + + msg.header.cmd = LOCAL_RTB; + msg.header.size = 0; + msg.header.source = 1; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(SUCCEED, ret_val); + TEST_ASSERT_NOT_EQUAL(NULL, Luos_handled_job); + TEST_ASSERT_EQUAL(NULL, Robus_handled_job); + TEST_ASSERT_EQUAL(RTB, Luos_handled_job->msg_pt->header.cmd); + TEST_ASSERT_EQUAL(1, Luos_handled_job->msg_pt->header.target); + TEST_ASSERT_EQUAL(3 * sizeof(routing_table_t), Luos_handled_job->msg_pt->header.size); + TEST_ASSERT_EQUAL(SERVICEIDACK, Luos_handled_job->msg_pt->header.target_mode); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check LOCAL_RTB size 2 treatment (generation of service id + send of local rtb)"); + { + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + Luos_handled_job = NULL; + Robus_handled_job = NULL; + Node_Get()->node_id = 1; + service_ctx.number = 2; + service_ctx.list[0].id = 1; + // Generate the filters + Service_GenerateId(1); + + msg.header.cmd = LOCAL_RTB; + msg.header.size = 2; + msg.header.source = 1; + uint16_t first_id = 1; + memcpy((void *)msg.data, (void *)&first_id, sizeof(uint16_t)); + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(SUCCEED, ret_val); + TEST_ASSERT_NOT_EQUAL(NULL, Luos_handled_job); + TEST_ASSERT_EQUAL(NULL, Robus_handled_job); + TEST_ASSERT_EQUAL(RTB, Luos_handled_job->msg_pt->header.cmd); + TEST_ASSERT_EQUAL(1, Luos_handled_job->msg_pt->header.target); + TEST_ASSERT_EQUAL(3 * sizeof(routing_table_t), Luos_handled_job->msg_pt->header.size); + TEST_ASSERT_EQUAL(SERVICEIDACK, Luos_handled_job->msg_pt->header.target_mode); + routing_table_t rtb[3]; + memcpy((void *)rtb, (void *)Luos_handled_job->msg_pt->data, 3 * sizeof(routing_table_t)); + TEST_ASSERT_EQUAL(NODE, rtb[0].mode); + TEST_ASSERT_EQUAL(SERVICE, rtb[1].mode); + TEST_ASSERT_EQUAL(SERVICE, rtb[2].mode); + TEST_ASSERT_EQUAL(1, rtb[1].id); + TEST_ASSERT_EQUAL(2, rtb[2].id); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check START_DETECTION"); + { + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + phy_ctx.io_job_nb = 3; + alloc_slot_index = 3; + Node_SetState(DETECTION_OK); + service_ctx.list[0].id = 1; + service_ctx.list[1].id = 2; + + msg.header.cmd = START_DETECTION; + msg.header.size = 0; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(SUCCEED, ret_val); + TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); + TEST_ASSERT_EQUAL(0, alloc_slot_index); + TEST_ASSERT_EQUAL(EXTERNAL_DETECTION, Node_GetState()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check END_DETECTION"); + { + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + Node_SetState(EXTERNAL_DETECTION); + service_ctx.list[0].id = 1; + service_ctx.list[1].id = 2; + + msg.header.cmd = END_DETECTION; + msg.header.size = 0; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(FAILED, ret_val); + TEST_ASSERT_EQUAL(DETECTION_OK, Node_GetState()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check ASK_DETECTION"); + { + // No detection running + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + Node_SetState(NO_DETECTION); + detection_service = NULL; + msg.header.cmd = ASK_DETECTION; + msg.header.target_mode = BROADCAST; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(SUCCEED, ret_val); + TEST_ASSERT_EQUAL(true, Flag_DetectServices); + TEST_ASSERT_EQUAL(&service_ctx.list[0], detection_service); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + // Detection running + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + Node_SetState(LOCAL_DETECTION); + detection_service = NULL; + Flag_DetectServices = false; + msg.header.cmd = ASK_DETECTION; + msg.header.target_mode = BROADCAST; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(SUCCEED, ret_val); + TEST_ASSERT_EQUAL(false, Flag_DetectServices); + TEST_ASSERT_EQUAL(NULL, detection_service); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check ASSERT"); + { + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + detection_service = NULL; + msg.header.cmd = ASSERT; + msg.header.target_mode = BROADCAST; + msg.header.source = 1; + + routing_table_t *rtb = RoutingTB_Get(); + rtb[0].mode = NODE; + rtb[0].node_id = 1; + rtb[1].mode = SERVICE; + rtb[1].id = 1; + last_routing_table_entry = 2; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(FAILED, ret_val); + TEST_ASSERT_EQUAL(1, last_routing_table_entry); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check DEADTARGET"); + { + // Dead node + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + detection_service = NULL; + msg.header.cmd = DEADTARGET; + msg.header.target_mode = BROADCAST; + msg.header.source = 1; + msg.header.size = sizeof(dead_target_t); + + dead_target_t *dead_target = (dead_target_t *)msg.data; + dead_target->node_id = 1; + dead_target->service_id = 0; + + routing_table_t *rtb = RoutingTB_Get(); + rtb[0].mode = NODE; + rtb[0].node_id = 1; + rtb[1].mode = SERVICE; + rtb[1].id = 1; + last_routing_table_entry = 2; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(FAILED, ret_val); + TEST_ASSERT_EQUAL(1, last_routing_table_entry); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + // Dead service + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + detection_service = NULL; + msg.header.cmd = DEADTARGET; + msg.header.target_mode = BROADCAST; + msg.header.source = 1; + msg.header.size = sizeof(dead_target_t); + + dead_target_t *dead_target = (dead_target_t *)msg.data; + dead_target->node_id = 0; + dead_target->service_id = 1; + + routing_table_t *rtb = RoutingTB_Get(); + rtb[0].mode = NODE; + rtb[0].node_id = 1; + rtb[1].mode = SERVICE; + rtb[1].id = 1; + last_routing_table_entry = 2; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(FAILED, ret_val); + TEST_ASSERT_EQUAL(1, last_routing_table_entry); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check REVISION"); + { + // User send a revivision message with a revision on it + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + msg.header.cmd = REVISION; + msg.header.target_mode = BROADCAST; + msg.header.source = 1; + msg.header.size = 2; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(FAILED, ret_val); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + // manage a revision request + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + Luos_handled_job = NULL; + Robus_handled_job = NULL; + + Node_Get()->node_id = 1; + service_ctx.number = 2; + service_ctx.list[0].id = 1; + // Generate the filters + Service_GenerateId(1); + + msg.header.cmd = REVISION; + msg.header.target_mode = BROADCAST; + msg.header.source = 1; + msg.header.size = 0; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(SUCCEED, ret_val); + TEST_ASSERT_NOT_EQUAL(NULL, Luos_handled_job); + revision_t revision; + memcpy(&revision, Luos_handled_job->msg_pt->data, sizeof(revision_t)); + TEST_ASSERT_EQUAL(service_ctx.list[0].revision.major, revision.major); + TEST_ASSERT_EQUAL(sizeof(revision_t), Luos_handled_job->msg_pt->header.size); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check LUOS_REVISION"); + { + // User send a revivision message with a revision on it + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + msg.header.cmd = LUOS_REVISION; + msg.header.target_mode = BROADCAST; + msg.header.source = 1; + msg.header.size = 2; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(FAILED, ret_val); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + // manage a revision request + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + Luos_handled_job = NULL; + Robus_handled_job = NULL; + + Node_Get()->node_id = 1; + service_ctx.number = 2; + service_ctx.list[0].id = 1; + // Generate the filters + Service_GenerateId(1); + + msg.header.cmd = LUOS_REVISION; + msg.header.target_mode = BROADCAST; + msg.header.source = 1; + msg.header.size = 0; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(SUCCEED, ret_val); + TEST_ASSERT_NOT_EQUAL(NULL, Luos_handled_job); + revision_t revision; + memcpy(&revision, Luos_handled_job->msg_pt->data, sizeof(revision_t)); + const revision_t *luos_version = Luos_GetVersion(); + TEST_ASSERT_EQUAL(luos_version->major, revision.major); + TEST_ASSERT_EQUAL(sizeof(revision_t), Luos_handled_job->msg_pt->header.size); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check LUOS_STATISTICS"); + { + // User send a revivision message with a revision on it + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + msg.header.cmd = LUOS_STATISTICS; + msg.header.target_mode = BROADCAST; + msg.header.source = 1; + msg.header.size = 2; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(FAILED, ret_val); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + // manage a revision request + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + Luos_handled_job = NULL; + Robus_handled_job = NULL; + + Node_Get()->node_id = 1; + service_ctx.number = 2; + service_ctx.list[0].id = 1; + // Generate the filters + Service_GenerateId(1); + + msg.header.cmd = WRITE_ALIAS; + msg.header.target_mode = BROADCAST; + msg.header.source = 1; + memcpy(msg.data, "test", 4); + msg.header.size = 4; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(FAILED, ret_val); + TEST_ASSERT_EQUAL_STRING("test", service_ctx.list[0].alias); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check UPDATE_PUB"); + { + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + Luos_handled_job = NULL; + Robus_handled_job = NULL; + + Node_Get()->node_id = 1; + service_ctx.number = 2; + service_ctx.list[0].id = 1; + service_ctx.list[0].auto_refresh.target = 0; + service_ctx.list[0].auto_refresh.time_ms = 0; + service_ctx.list[0].auto_refresh.last_update = 0; + // Generate the filters + Service_GenerateId(1); + + msg.header.target_mode = BROADCAST; + msg.header.source = 1; + time_luos_t time = TimeOD_TimeFrom_s(1); + TimeOD_TimeToMsg(&time, &msg); + msg.header.cmd = UPDATE_PUB; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(SUCCEED, ret_val); + TEST_ASSERT_EQUAL(1, service_ctx.list[0].auto_refresh.target); + TEST_ASSERT_EQUAL((uint16_t)TimeOD_TimeTo_ms(time), service_ctx.list[0].auto_refresh.time_ms); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check BOOTLOADER_CMD"); + { + // User send a revivision message with a revision on it + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + msg.header.cmd = BOOTLOADER_CMD; + msg.header.target_mode = BROADCAST; + msg.header.source = 1; + msg.header.size = 0; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(SUCCEED, ret_val); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check any other cmd"); + { + for (uint8_t i = LUOS_LAST_RESERVED_CMD; i < 0xFF; i++) + { + TRY + { + msg_t msg; + luosIO_reset_overlap_callback(); + msg.header.cmd = i; + msg.header.target_mode = BROADCAST; + msg.header.source = 1; + msg.header.size = 0; + + error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + + // Check received message content + TEST_ASSERT_EQUAL(FAILED, ret_val); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + } +} + +void unittest_luosIO_DetectNextNodes() +{ + NEW_TEST_CASE("This function is highly intricated with Robus for now. It makes it difficult to test. We will keep it for later"); + { + } +} + +void unittest_luosIO_TryToGetJob() +{ + NEW_TEST_CASE("Check assert condition for TryToGetJob"); + { + TRY + { + LuosIO_Init(); + LuosIO_TryToGetJob(0, NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check TryToGetJob"); + { + for (uint8_t i = 0; i < 2; i++) + { + TRY + { + LuosIO_Init(); + phy_job_t *job = NULL; + luos_phy->job_nb = 2; + luos_phy->job[0].data_pt = (uint8_t *)&msg_buffer[0]; + luos_phy->job[1].data_pt = (uint8_t *)&msg_buffer[1]; + + error_return_t returned_val = LuosIO_TryToGetJob(i, &job); + + TEST_ASSERT_EQUAL(SUCCEED, returned_val); + TEST_ASSERT_EQUAL(&msg_buffer[i], job->data_pt); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + TRY + { + LuosIO_Init(); + phy_job_t *job = NULL; + luos_phy->job_nb = 2; + luos_phy->job[0].data_pt = (uint8_t *)&msg_buffer[0]; + luos_phy->job[1].data_pt = (uint8_t *)&msg_buffer[1]; + + error_return_t returned_val = LuosIO_TryToGetJob(2, &job); + + TEST_ASSERT_EQUAL(FAILED, returned_val); + TEST_ASSERT_EQUAL(NULL, job); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_luosIO_RmJob() +{ + NEW_TEST_CASE("Check assert condition for RmJob"); + { + TRY + { + LuosIO_Init(); + LuosIO_RmJob(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + LuosIO_Init(); + luos_phy->job_nb = 3; + LuosIO_RmJob(&luos_phy->job[luos_phy->job_nb]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check RmJob"); + { + TRY + { + LuosIO_Init(); + service_filter[0] = 0x00; + service_filter[1] = 0x01; + phy_job_t *job = NULL; + luos_phy->job_nb = 2; + luos_phy->job[0].data_pt = (uint8_t *)&msg_buffer[0]; + luos_phy->job[0].phy_data = &service_filter[0]; + luos_phy->job[1].data_pt = (uint8_t *)&msg_buffer[1]; + luos_phy->job[1].phy_data = &service_filter[1]; + + LuosIO_RmJob(&luos_phy->job[0]); + TEST_ASSERT_EQUAL(1, luos_phy->job_nb); + TEST_ASSERT_EQUAL(&msg_buffer[1], luos_phy->job[0].data_pt); + + // Job 2 is not removed because service_filter is not equal to 0x00 + LuosIO_RmJob(&luos_phy->job[0]); + TEST_ASSERT_EQUAL(1, luos_phy->job_nb); + TEST_ASSERT_EQUAL(&msg_buffer[1], luos_phy->job[0].data_pt); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_luosIO_GetJobNb() +{ + NEW_TEST_CASE("Check GetJobNb"); + { + TRY + { + LuosIO_Init(); + luos_phy->job_nb = 3; + + uint16_t jobNb = LuosIO_GetJobNb(); + TEST_ASSERT_EQUAL(luos_phy->job_nb, jobNb); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +int main(int argc, char **argv) +{ + UNITY_BEGIN(); + + UNIT_TEST_RUN(unittest_luosIO_init); + UNIT_TEST_RUN(unittest_luosIO_loop); + UNIT_TEST_RUN(unittest_luosIO_TransmitLocalRoutingTable); + UNIT_TEST_RUN(unittest_luosIO_ConsumeMsg); + UNIT_TEST_RUN(unittest_luosIO_DetectNextNodes); + UNIT_TEST_RUN(unittest_luosIO_TryToGetJob); + UNIT_TEST_RUN(unittest_luosIO_RmJob); + UNIT_TEST_RUN(unittest_luosIO_GetJobNb); + + UNITY_END(); +} From a34d44db156c89003fcd67b5935e7a7e31403c21 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 5 May 2023 17:30:38 +0200 Subject: [PATCH 058/150] Improve UNIT_TEST_RUN macro to correctly manage function name passing to unity. --- platformio.ini | 2 +- test/_resources/Unity/unit_test.c | 17 +---------------- test/_resources/Unity/unit_test.h | 8 +++++++- test/tests_core/test_topic/main.c | 2 +- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/platformio.ini b/platformio.ini index 315fce0ab..99c0e2b68 100644 --- a/platformio.ini +++ b/platformio.ini @@ -32,4 +32,4 @@ build_type = debug test_build_src = true ; To debug a test, replace "test_template" by the directory test name you want to debug (example : "test_msg_alloc") -debug_test = tests_io/test_filter +debug_test = tests_io/test_msg_alloc diff --git a/test/_resources/Unity/unit_test.c b/test/_resources/Unity/unit_test.c index 42b14d326..6984c2e5c 100644 --- a/test/_resources/Unity/unit_test.c +++ b/test/_resources/Unity/unit_test.c @@ -27,21 +27,6 @@ bool try_state = false; * Function ******************************************************************************/ -/****************************************************************************** - * @brief Launch a unit test - * @param None - * @return None - ******************************************************************************/ -void RUN(const char *name, void (*function)(void)) -{ - printf("\n\n===============================================================================================================\n"); - printf("Unit test function : %s\n", name); - printf("===============================================================================================================\n"); - - test_case_number = 0; - RUN_TEST(function); -} - /****************************************************************************** * @brief Start a new test case * @param title (test description title) @@ -150,4 +135,4 @@ void setUp(void) void tearDown(void) { -} \ No newline at end of file +} diff --git a/test/_resources/Unity/unit_test.h b/test/_resources/Unity/unit_test.h index ea4baff4a..6375e4149 100644 --- a/test/_resources/Unity/unit_test.h +++ b/test/_resources/Unity/unit_test.h @@ -24,9 +24,15 @@ extern jmp_buf err_ctx; extern bool try_state; +extern uint16_t test_case_number; #ifndef UNIT_TEST_RUN - #define UNIT_TEST_RUN(f) RUN(#f, f) + #define UNIT_TEST_RUN(f) \ + printf("\n\n===============================================================================================================\n"); \ + printf("Unit test function : %s\n", #f); \ + printf("===============================================================================================================\n"); \ + test_case_number = 0; \ + RUN_TEST(f) #endif #define TRY \ diff --git a/test/tests_core/test_topic/main.c b/test/tests_core/test_topic/main.c index a13432548..2cfba349f 100644 --- a/test/tests_core/test_topic/main.c +++ b/test/tests_core/test_topic/main.c @@ -129,4 +129,4 @@ int main(int argc, char **argv) UNIT_TEST_RUN(unittest_Luos_Unsubscribe); UNITY_END(); -} \ No newline at end of file +} From 24753d3d23b0a945e00874fb02e47f9a31a57930 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 5 May 2023 19:25:21 +0200 Subject: [PATCH 059/150] Improve pub_sub unit tests --- engine/IO/src/filter.c | 6 +- engine/core/src/pub_sub.c | 14 +- test/test_robus/main.c | 211 ------------- test/test_robus/main.h | 6 - test/tests_core/test_pub_sub/main.c | 454 ++++++++++++++++++++++++++++ test/tests_core/test_topic/main.c | 132 -------- test/tests_core/test_topic/main.h | 4 - test/tests_io/test_filter/main.c | 50 +-- 8 files changed, 488 insertions(+), 389 deletions(-) delete mode 100644 test/test_robus/main.c delete mode 100644 test/test_robus/main.h create mode 100644 test/tests_core/test_pub_sub/main.c delete mode 100644 test/tests_core/test_topic/main.c delete mode 100644 test/tests_core/test_topic/main.h diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c index 69c1248d0..d0a2ecca8 100644 --- a/engine/IO/src/filter.c +++ b/engine/IO/src/filter.c @@ -88,7 +88,7 @@ void Filter_AddServiceId(uint16_t service_id, uint16_t service_number) ******************************************************************************/ void Filter_AddTopic(uint16_t topic_id) { - LUOS_ASSERT(topic_id <= LAST_TOPIC); + LUOS_ASSERT(topic_id < LAST_TOPIC); // Add 1 to the bit corresponding to the topic in multicast mask filter_ctx.TopicMask[(topic_id / 8)] |= 1 << (topic_id - ((int)(topic_id / 8)) * 8); } @@ -100,7 +100,7 @@ void Filter_AddTopic(uint16_t topic_id) ******************************************************************************/ void Filter_RmTopic(uint16_t topic_id) { - LUOS_ASSERT(topic_id <= LAST_TOPIC); + LUOS_ASSERT(topic_id < LAST_TOPIC); // Remove 1 to the bit corresponding to the topic in multicast mask filter_ctx.TopicMask[(topic_id / 8)] &= ~(1 << (topic_id - ((int)(topic_id / 8)) * 8)); } @@ -144,7 +144,7 @@ _CRITICAL bool Filter_Topic(uint16_t topic_id) { uint8_t compare = 0; // Make sure there is a topic that can be received by the node - if (topic_id <= LAST_TOPIC) + if (topic_id < LAST_TOPIC) { compare = topic_id - ((topic_id / 8) * 8); // Search if topic exists in mask diff --git a/engine/core/src/pub_sub.c b/engine/core/src/pub_sub.c index 92aab9eb1..ebbe41f1f 100644 --- a/engine/core/src/pub_sub.c +++ b/engine/core/src/pub_sub.c @@ -30,6 +30,8 @@ ******************************************************************************/ uint8_t PubSub_IsTopicSubscribed(service_t *service, uint16_t topic_id) { + LUOS_ASSERT((topic_id < LAST_TOPIC) + && (service != NULL)); unsigned char i; for (i = 0; i < service->last_topic_position; i++) { @@ -48,8 +50,8 @@ uint8_t PubSub_IsTopicSubscribed(service_t *service, uint16_t topic_id) error_return_t Luos_Subscribe(service_t *service, uint16_t topic) { // Assert if we add a topic that is greater than the max topic value - LUOS_ASSERT(topic <= LAST_TOPIC); - LUOS_ASSERT(service != 0); + LUOS_ASSERT((topic < LAST_TOPIC) + && (service != 0)); // Put this topic in the multicast bank Filter_AddTopic(topic); @@ -72,8 +74,8 @@ error_return_t Luos_Subscribe(service_t *service, uint16_t topic) ******************************************************************************/ error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic) { - LUOS_ASSERT(topic <= LAST_TOPIC); - LUOS_ASSERT(service != 0); + LUOS_ASSERT((topic < LAST_TOPIC) + && (service != 0)); error_return_t err = FAILED; // Delete topic from service list @@ -81,10 +83,6 @@ error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic) { if (service->topic_list[i] == topic) { - if (service->last_topic_position >= LAST_TOPIC) - { - break; - } memcpy(&service->topic_list[i], &service->topic_list[i + 1], service->last_topic_position - i); service->last_topic_position--; err = SUCCEED; diff --git a/test/test_robus/main.c b/test/test_robus/main.c deleted file mode 100644 index b146d0bff..000000000 --- a/test/test_robus/main.c +++ /dev/null @@ -1,211 +0,0 @@ -#include -#include "main.h" -#include "robus.h" -#include "context.h" -#include "unit_test.h" -#include "default_scenario.h" -#include "filter.h" - -extern default_scenario_t default_sc; - -void unittest_Luos_Subscribe(void) -{ - NEW_TEST_CASE("Normal Add to node topic list"); - { - // Init default scenario context - Init_Context(); - - Luos_Subscribe(default_sc.App_1.app, 0); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(6)); - TEST_ASSERT_EQUAL(false, Filter_Topic(18)); - Luos_Subscribe(default_sc.App_1.app, 4); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(true, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(6)); - TEST_ASSERT_EQUAL(false, Filter_Topic(18)); - Luos_Subscribe(default_sc.App_1.app, 6); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(true, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(6)); - TEST_ASSERT_EQUAL(false, Filter_Topic(18)); - Luos_Subscribe(default_sc.App_1.app, 18); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(true, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(6)); - TEST_ASSERT_EQUAL(true, Filter_Topic(18)); - } - NEW_TEST_CASE("Assert when adding last topic"); - { - // Init default scenario context - Init_Context(); - - RESET_ASSERT(); - - Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC); - TEST_ASSERT_FALSE(IS_ASSERT()); - - TRY - { - Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC + 1); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - } - NEW_TEST_CASE("Add same topic multiple times"); - { - // Init default scenario context - Init_Context(); - - Luos_Subscribe(default_sc.App_1.app, 0); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - Luos_Subscribe(default_sc.App_2.app, 0); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - Luos_Subscribe(default_sc.App_3.app, 0); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - - Luos_Subscribe(default_sc.App_1.app, 4); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(true, Filter_Topic(4)); - Luos_Subscribe(default_sc.App_2.app, 4); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(true, Filter_Topic(4)); - Luos_Subscribe(default_sc.App_3.app, 4); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(true, Filter_Topic(4)); - } -} - -void unittest_Robus_TopicUnsubscribe(void) -{ - NEW_TEST_CASE("Remove from an empty list"); - { - // Init default scenario context - Init_Context(); - - error_return_t err = Luos_Unsubscribe(default_sc.App_1.app, 3); - TEST_ASSERT_EQUAL(FAILED, err); - } - NEW_TEST_CASE("Normal Remove from topic list"); - { - // Init default scenario context - Init_Context(); - - Luos_Subscribe(default_sc.App_1.app, 0); - Luos_Subscribe(default_sc.App_1.app, 4); - Luos_Subscribe(default_sc.App_1.app, 6); - Luos_Subscribe(default_sc.App_1.app, 18); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(true, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(6)); - TEST_ASSERT_EQUAL(true, Filter_Topic(18)); - - Luos_Unsubscribe(default_sc.App_1.app, 4); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(6)); - TEST_ASSERT_EQUAL(true, Filter_Topic(18)); - - Luos_Unsubscribe(default_sc.App_1.app, 0); - TEST_ASSERT_EQUAL(false, Filter_Topic(0)); - TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(6)); - TEST_ASSERT_EQUAL(true, Filter_Topic(18)); - - Luos_Unsubscribe(default_sc.App_1.app, 6); - TEST_ASSERT_EQUAL(false, Filter_Topic(0)); - TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(6)); - TEST_ASSERT_EQUAL(true, Filter_Topic(18)); - - Luos_Unsubscribe(default_sc.App_1.app, 18); - TEST_ASSERT_EQUAL(false, Filter_Topic(0)); - TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(6)); - TEST_ASSERT_EQUAL(false, Filter_Topic(18)); - } - NEW_TEST_CASE("Demand to remove last topic"); - { - // Init default scenario context - Init_Context(); - Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC - 1); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); - Luos_Unsubscribe(default_sc.App_1.app, LAST_TOPIC - 1); - TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC - 1)); - error_return_t err = Luos_Unsubscribe(default_sc.App_1.app, LAST_TOPIC); - TEST_ASSERT_EQUAL(err, FAILED); - } - NEW_TEST_CASE("Remove multiple times same topic"); - { - // Init default scenario context - Init_Context(); - Luos_Subscribe(default_sc.App_1.app, 0); - Luos_Subscribe(default_sc.App_1.app, 4); - Luos_Subscribe(default_sc.App_2.app, 4); - Luos_Subscribe(default_sc.App_3.app, 4); - Luos_Subscribe(default_sc.App_2.app, 6); - Luos_Subscribe(default_sc.App_3.app, 6); - Luos_Subscribe(default_sc.App_1.app, 18); - Luos_Subscribe(default_sc.App_2.app, 18); - - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(true, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(6)); - TEST_ASSERT_EQUAL(true, Filter_Topic(18)); - - Luos_Unsubscribe(default_sc.App_1.app, 4); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(true, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(6)); - TEST_ASSERT_EQUAL(true, Filter_Topic(18)); - - Luos_Unsubscribe(default_sc.App_2.app, 4); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(true, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(6)); - TEST_ASSERT_EQUAL(true, Filter_Topic(18)); - - Luos_Unsubscribe(default_sc.App_3.app, 4); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(6)); - TEST_ASSERT_EQUAL(true, Filter_Topic(18)); - - Luos_Unsubscribe(default_sc.App_2.app, 6); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(6)); - TEST_ASSERT_EQUAL(true, Filter_Topic(18)); - - Luos_Unsubscribe(default_sc.App_3.app, 6); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(6)); - TEST_ASSERT_EQUAL(true, Filter_Topic(18)); - - Luos_Unsubscribe(default_sc.App_1.app, 18); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(6)); - TEST_ASSERT_EQUAL(true, Filter_Topic(18)); - - Luos_Unsubscribe(default_sc.App_2.app, 18); - TEST_ASSERT_EQUAL(true, Filter_Topic(0)); - TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(6)); - TEST_ASSERT_EQUAL(false, Filter_Topic(18)); - } -} - -int main(int argc, char **argv) -{ - UNITY_BEGIN(); - - UNIT_TEST_RUN(unittest_Luos_Subscribe); - UNIT_TEST_RUN(unittest_Robus_TopicUnsubscribe); - - UNITY_END(); -} diff --git a/test/test_robus/main.h b/test/test_robus/main.h deleted file mode 100644 index 29d5b83a3..000000000 --- a/test/test_robus/main.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#define SERVICE_NUMBER 5 - -#endif // MAIN_H \ No newline at end of file diff --git a/test/tests_core/test_pub_sub/main.c b/test/tests_core/test_pub_sub/main.c new file mode 100644 index 000000000..f0de19953 --- /dev/null +++ b/test/tests_core/test_pub_sub/main.c @@ -0,0 +1,454 @@ +#include "context.h" +#include "pub_sub.h" +#include +#include "unit_test.h" +#include +#include "filter.h" + +extern default_scenario_t default_sc; + +void unittest_PubSub_IsTopicSubscribed(void) +{ + NEW_TEST_CASE("Test IsTopicSubscribed assert conditions"); + { + TRY + { + PubSub_IsTopicSubscribed(NULL, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + // Init default scenario context + Init_Context(); + PubSub_IsTopicSubscribed(default_sc.App_1.app, LAST_TOPIC); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Search Topics"); + { + TRY + { + // Init default scenario context + Init_Context(); + Luos_Subscribe(default_sc.App_1.app, 1); + Luos_Subscribe(default_sc.App_2.app, 18); + + TEST_ASSERT_TRUE(PubSub_IsTopicSubscribed(default_sc.App_1.app, 1)); + TEST_ASSERT_FALSE(PubSub_IsTopicSubscribed(default_sc.App_2.app, 1)); + TEST_ASSERT_FALSE(PubSub_IsTopicSubscribed(default_sc.App_1.app, 18)); + TEST_ASSERT_TRUE(PubSub_IsTopicSubscribed(default_sc.App_2.app, 18)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_Luos_Subscribe(void) +{ + + NEW_TEST_CASE("Test Subscribe assert conditions"); + { + TRY + { + Luos_Subscribe(NULL, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + // Init default scenario context + Init_Context(); + Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Add random Topics"); + { + TRY + { + // Init default scenario context + Init_Context(); + + TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, 1)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, 2)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC - 1)); + TEST_ASSERT_EQUAL(3, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(1, default_sc.App_1.app->topic_list[0]); + TEST_ASSERT_EQUAL(2, default_sc.App_1.app->topic_list[1]); + TEST_ASSERT_EQUAL(LAST_TOPIC - 1, default_sc.App_1.app->topic_list[2]); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Add max topics number"); + { + TRY + { + // Init default scenario context + Init_Context(); + + for (uint8_t i = 0; i < LAST_TOPIC; i++) + { + TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, i)); + TEST_ASSERT_EQUAL(i + 1, default_sc.App_1.app->last_topic_position); + } + + TEST_ASSERT_EQUAL(LAST_TOPIC, default_sc.App_1.app->last_topic_position); + + TEST_ASSERT_TRUE(PubSub_IsTopicSubscribed(default_sc.App_1.app, LAST_TOPIC - 1)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Normal Add to node topic list"); + { + TRY + { + // Init default scenario context + Init_Context(); + + Luos_Subscribe(default_sc.App_1.app, 0); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(6)); + TEST_ASSERT_EQUAL(false, Filter_Topic(18)); + Luos_Subscribe(default_sc.App_1.app, 4); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(6)); + TEST_ASSERT_EQUAL(false, Filter_Topic(18)); + Luos_Subscribe(default_sc.App_1.app, 6); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(false, Filter_Topic(18)); + Luos_Subscribe(default_sc.App_1.app, 18); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Assert when adding last topic"); + { + // Init default scenario context + Init_Context(); + + RESET_ASSERT(); + + Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC - 1); + TEST_ASSERT_FALSE(IS_ASSERT()); + + TRY + { + Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + } + + NEW_TEST_CASE("Add same topic multiple times"); + { + TRY + { + // Init default scenario context + Init_Context(); + + Luos_Subscribe(default_sc.App_1.app, 0); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + Luos_Subscribe(default_sc.App_2.app, 0); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + Luos_Subscribe(default_sc.App_3.app, 0); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + + Luos_Subscribe(default_sc.App_1.app, 4); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + Luos_Subscribe(default_sc.App_2.app, 4); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + Luos_Subscribe(default_sc.App_3.app, 4); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Luos_Unsubscribe(void) +{ + NEW_TEST_CASE("Remove from an empty list"); + { + TRY + { + // Init default scenario context + Init_Context(); + + error_return_t err = Luos_Unsubscribe(default_sc.App_1.app, 3); + TEST_ASSERT_EQUAL(FAILED, err); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Normal Remove from topic list"); + { + TRY + { + // Init default scenario context + Init_Context(); + + Luos_Subscribe(default_sc.App_1.app, 0); + Luos_Subscribe(default_sc.App_1.app, 4); + Luos_Subscribe(default_sc.App_1.app, 6); + Luos_Subscribe(default_sc.App_1.app, 18); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + + Luos_Unsubscribe(default_sc.App_1.app, 4); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + + Luos_Unsubscribe(default_sc.App_1.app, 0); + TEST_ASSERT_EQUAL(false, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + + Luos_Unsubscribe(default_sc.App_1.app, 6); + TEST_ASSERT_EQUAL(false, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + + Luos_Unsubscribe(default_sc.App_1.app, 18); + TEST_ASSERT_EQUAL(false, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(6)); + TEST_ASSERT_EQUAL(false, Filter_Topic(18)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Demand to remove last topic"); + { + TRY + { + // Init default scenario context + Init_Context(); + Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC - 1); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); + Luos_Unsubscribe(default_sc.App_1.app, LAST_TOPIC - 1); + TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC - 1)); + error_return_t err = Luos_Unsubscribe(default_sc.App_1.app, LAST_TOPIC - 1); + TEST_ASSERT_EQUAL(err, FAILED); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Remove multiple times same topic"); + { + TRY + { + // Init default scenario context + Init_Context(); + Luos_Subscribe(default_sc.App_1.app, 0); + Luos_Subscribe(default_sc.App_1.app, 4); + Luos_Subscribe(default_sc.App_2.app, 4); + Luos_Subscribe(default_sc.App_3.app, 4); + Luos_Subscribe(default_sc.App_2.app, 6); + Luos_Subscribe(default_sc.App_3.app, 6); + Luos_Subscribe(default_sc.App_1.app, 18); + Luos_Subscribe(default_sc.App_2.app, 18); + + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + + Luos_Unsubscribe(default_sc.App_1.app, 4); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + + Luos_Unsubscribe(default_sc.App_2.app, 4); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(true, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + + Luos_Unsubscribe(default_sc.App_3.app, 4); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + + Luos_Unsubscribe(default_sc.App_2.app, 6); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(true, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + + Luos_Unsubscribe(default_sc.App_3.app, 6); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + + Luos_Unsubscribe(default_sc.App_1.app, 18); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(6)); + TEST_ASSERT_EQUAL(true, Filter_Topic(18)); + + Luos_Unsubscribe(default_sc.App_2.app, 18); + TEST_ASSERT_EQUAL(true, Filter_Topic(0)); + TEST_ASSERT_EQUAL(false, Filter_Topic(4)); + TEST_ASSERT_EQUAL(false, Filter_Topic(6)); + TEST_ASSERT_EQUAL(false, Filter_Topic(18)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Remove random topics"); + { + TRY + { + // Init default scenario context + Init_Context(); + + Luos_Subscribe(default_sc.App_1.app, 2); + Luos_Subscribe(default_sc.App_1.app, 7); + Luos_Subscribe(default_sc.App_1.app, 17); + TEST_ASSERT_EQUAL(3, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(2, default_sc.App_1.app->topic_list[0]); + TEST_ASSERT_EQUAL(7, default_sc.App_1.app->topic_list[1]); + TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[2]); + + TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 7)); + TEST_ASSERT_EQUAL(2, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(2, default_sc.App_1.app->topic_list[0]); + TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[1]); + + TEST_ASSERT_EQUAL(FAILED, Luos_Unsubscribe(default_sc.App_1.app, 18)); + TEST_ASSERT_EQUAL(2, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(2, default_sc.App_1.app->topic_list[0]); + TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[1]); + + TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 17)); + TEST_ASSERT_EQUAL(1, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(2, default_sc.App_1.app->topic_list[0]); + + TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 2)); + TEST_ASSERT_EQUAL(0, default_sc.App_1.app->last_topic_position); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Remove same topic"); + { + TRY + { + // Init default scenario context + Init_Context(); + + Luos_Subscribe(default_sc.App_1.app, 2); + Luos_Subscribe(default_sc.App_1.app, 17); + + TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 2)); + TEST_ASSERT_EQUAL(1, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[0]); + + TEST_ASSERT_EQUAL(FAILED, Luos_Unsubscribe(default_sc.App_1.app, 2)); + TEST_ASSERT_EQUAL(1, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[0]); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Last topic position is already removed"); + { + TRY + { + // Init default scenario context + Init_Context(); + + Luos_Subscribe(default_sc.App_1.app, 2); + default_sc.App_1.app->last_topic_position = LAST_TOPIC; + TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 2)); + TEST_ASSERT_EQUAL(FAILED, Luos_Unsubscribe(default_sc.App_1.app, 2)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +int main(int argc, char **argv) +{ + UNITY_BEGIN(); + + UNIT_TEST_RUN(unittest_PubSub_IsTopicSubscribed); + UNIT_TEST_RUN(unittest_Luos_Subscribe); + UNIT_TEST_RUN(unittest_Luos_Unsubscribe); + + UNITY_END(); +} diff --git a/test/tests_core/test_topic/main.c b/test/tests_core/test_topic/main.c deleted file mode 100644 index 2cfba349f..000000000 --- a/test/tests_core/test_topic/main.c +++ /dev/null @@ -1,132 +0,0 @@ -#include "main.h" -#include "robus.h" -#include "context.h" -#include "pub_sub.h" -#include -#include - -extern default_scenario_t default_sc; - -void unittest_PubSub_IsTopicSubscribed(void) -{ - NEW_TEST_CASE("Search Topics"); - { - // Init default scenario context - Init_Context(); - Luos_Subscribe(default_sc.App_1.app, 1); - Luos_Subscribe(default_sc.App_2.app, 18); - - TEST_ASSERT_TRUE(PubSub_IsTopicSubscribed(default_sc.App_1.app, 1)); - TEST_ASSERT_FALSE(PubSub_IsTopicSubscribed(default_sc.App_2.app, 1)); - TEST_ASSERT_FALSE(PubSub_IsTopicSubscribed(default_sc.App_1.app, 18)); - TEST_ASSERT_TRUE(PubSub_IsTopicSubscribed(default_sc.App_2.app, 18)); - } -} - -void unittest_Luos_Subscribe(void) -{ - NEW_TEST_CASE("Add random Topics"); - { - // Init default scenario context - Init_Context(); - - TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, 1)); - - TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, 18)); - TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, 27)); - TEST_ASSERT_EQUAL(3, default_sc.App_1.app->last_topic_position); - TEST_ASSERT_EQUAL(1, default_sc.App_1.app->topic_list[0]); - TEST_ASSERT_EQUAL(18, default_sc.App_1.app->topic_list[1]); - TEST_ASSERT_EQUAL(27, default_sc.App_1.app->topic_list[2]); - } - NEW_TEST_CASE("Add max topics number"); - { - // Init default scenario context - Init_Context(); - - for (uint8_t i = 0; i < LAST_TOPIC; i++) - { - TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, i)); - TEST_ASSERT_EQUAL(i + 1, default_sc.App_1.app->last_topic_position); - } - - TEST_ASSERT_EQUAL(FAILED, Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC)); - TEST_ASSERT_EQUAL(LAST_TOPIC, default_sc.App_1.app->last_topic_position); - - TEST_ASSERT_FALSE(PubSub_IsTopicSubscribed(default_sc.App_1.app, LAST_TOPIC)); - } -} - -void unittest_Luos_Unsubscribe(void) -{ - NEW_TEST_CASE("Remove random topics"); - { - // Init default scenario context - Init_Context(); - - Luos_Subscribe(default_sc.App_1.app, 2); - Luos_Subscribe(default_sc.App_1.app, 7); - Luos_Subscribe(default_sc.App_1.app, 17); - TEST_ASSERT_EQUAL(3, default_sc.App_1.app->last_topic_position); - TEST_ASSERT_EQUAL(2, default_sc.App_1.app->topic_list[0]); - TEST_ASSERT_EQUAL(7, default_sc.App_1.app->topic_list[1]); - TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[2]); - - TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 7)); - TEST_ASSERT_EQUAL(2, default_sc.App_1.app->last_topic_position); - TEST_ASSERT_EQUAL(2, default_sc.App_1.app->topic_list[0]); - TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[1]); - - TEST_ASSERT_EQUAL(FAILED, Luos_Unsubscribe(default_sc.App_1.app, 18)); - TEST_ASSERT_EQUAL(2, default_sc.App_1.app->last_topic_position); - TEST_ASSERT_EQUAL(2, default_sc.App_1.app->topic_list[0]); - TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[1]); - - TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 17)); - TEST_ASSERT_EQUAL(1, default_sc.App_1.app->last_topic_position); - TEST_ASSERT_EQUAL(2, default_sc.App_1.app->topic_list[0]); - - TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 2)); - TEST_ASSERT_EQUAL(0, default_sc.App_1.app->last_topic_position); - } - NEW_TEST_CASE("Remove same topic"); - { - // Init default scenario context - Init_Context(); - - Luos_Subscribe(default_sc.App_1.app, 2); - Luos_Subscribe(default_sc.App_1.app, 17); - - TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 2)); - TEST_ASSERT_EQUAL(1, default_sc.App_1.app->last_topic_position); - TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[0]); - - TEST_ASSERT_EQUAL(FAILED, Luos_Unsubscribe(default_sc.App_1.app, 2)); - TEST_ASSERT_EQUAL(1, default_sc.App_1.app->last_topic_position); - TEST_ASSERT_EQUAL(17, default_sc.App_1.app->topic_list[0]); - } - - NEW_TEST_CASE("Last topic position is corrupted"); - { - // Init default scenario context - Init_Context(); - - Luos_Subscribe(default_sc.App_1.app, 2); - default_sc.App_1.app->last_topic_position = LAST_TOPIC - 1; - TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 2)); - - Luos_Subscribe(default_sc.App_1.app, 2); - default_sc.App_1.app->last_topic_position = LAST_TOPIC; - TEST_ASSERT_EQUAL(FAILED, Luos_Unsubscribe(default_sc.App_1.app, 2)); - } -} -int main(int argc, char **argv) -{ - UNITY_BEGIN(); - - UNIT_TEST_RUN(unittest_PubSub_IsTopicSubscribed); - UNIT_TEST_RUN(unittest_Luos_Subscribe); - UNIT_TEST_RUN(unittest_Luos_Unsubscribe); - - UNITY_END(); -} diff --git a/test/tests_core/test_topic/main.h b/test/tests_core/test_topic/main.h deleted file mode 100644 index 56f0a9bb3..000000000 --- a/test/tests_core/test_topic/main.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#endif // MAIN_H \ No newline at end of file diff --git a/test/tests_io/test_filter/main.c b/test/tests_io/test_filter/main.c index 8c9691cbc..b8ed62c91 100644 --- a/test/tests_io/test_filter/main.c +++ b/test/tests_io/test_filter/main.c @@ -166,8 +166,8 @@ void unittest_Filter_Topic() Filter_TopicInit(); TRY { - Filter_AddTopic(LAST_TOPIC); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + Filter_AddTopic(LAST_TOPIC - 1); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); } CATCH { @@ -177,18 +177,18 @@ void unittest_Filter_Topic() Filter_TopicInit(); TRY { - Filter_AddTopic(LAST_TOPIC + 1); - TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC + 1)); + Filter_AddTopic(LAST_TOPIC); + TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC)); } TEST_ASSERT_TRUE(IS_ASSERT()); Filter_TopicInit(); TRY { - Filter_AddTopic(LAST_TOPIC); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); - Filter_RmTopic(LAST_TOPIC); - TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC)); + Filter_AddTopic(LAST_TOPIC - 1); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); + Filter_RmTopic(LAST_TOPIC - 1); + TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC - 1)); } CATCH { @@ -198,7 +198,7 @@ void unittest_Filter_Topic() Filter_TopicInit(); TRY { - Filter_RmTopic(LAST_TOPIC + 1); + Filter_RmTopic(LAST_TOPIC); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -215,7 +215,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(false, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC)); + TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC - 1)); } CATCH { @@ -230,7 +230,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(false, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC)); + TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC - 1)); } CATCH { @@ -245,7 +245,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(true, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC)); + TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC - 1)); } CATCH { @@ -254,13 +254,13 @@ void unittest_Filter_Topic() TRY { - Filter_AddTopic(LAST_TOPIC); + Filter_AddTopic(LAST_TOPIC - 1); TEST_ASSERT_EQUAL(true, Filter_Topic(0)); TEST_ASSERT_EQUAL(true, Filter_Topic(1)); TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(true, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); } CATCH { @@ -275,7 +275,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(true, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); } CATCH { @@ -290,7 +290,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(true, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); } CATCH { @@ -305,7 +305,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(false, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); } CATCH { @@ -320,7 +320,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(false, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); } CATCH { @@ -335,7 +335,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(false, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC)); + TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); } CATCH { @@ -344,13 +344,13 @@ void unittest_Filter_Topic() TRY { - Filter_RmTopic(LAST_TOPIC); + Filter_RmTopic(LAST_TOPIC - 1); TEST_ASSERT_EQUAL(false, Filter_Topic(0)); TEST_ASSERT_EQUAL(false, Filter_Topic(1)); TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(false, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC)); + TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC - 1)); } CATCH { @@ -708,10 +708,10 @@ int main(int argc, char **argv) { UNITY_BEGIN(); - UNIT_TEST_RUN(unittest_Filter_ServiceId); - UNIT_TEST_RUN(unittest_Filter_Topic); - UNIT_TEST_RUN(unittest_Filter_Type); - UNIT_TEST_RUN(unittest_Filter_GetPhyTarget); + RUN_TEST(unittest_Filter_ServiceId); + RUN_TEST(unittest_Filter_Topic); + RUN_TEST(unittest_Filter_Type); + RUN_TEST(unittest_Filter_GetPhyTarget); UNITY_END(); } From 04aa84466827f1089d9826ee549db313549756d5 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 29 May 2023 11:37:32 +0200 Subject: [PATCH 060/150] Remove useless main.h Od tests files --- test/tests_core/tests_od/test_angular/main.h | 4 ---- test/tests_core/tests_od/test_control/main.h | 4 ---- test/tests_core/tests_od/test_electric/main.h | 4 ---- test/tests_core/tests_od/test_force/main.h | 4 ---- test/tests_core/tests_od/test_illuminance/main.h | 4 ---- test/tests_core/tests_od/test_linear/main.h | 4 ---- test/tests_core/tests_od/test_pid/main.h | 4 ---- test/tests_core/tests_od/test_pressure/main.h | 4 ---- test/tests_core/tests_od/test_ratio/main.h | 4 ---- test/tests_core/tests_od/test_temperature/main.h | 4 ---- test/tests_core/tests_od/test_time/main.h | 4 ---- 11 files changed, 44 deletions(-) delete mode 100644 test/tests_core/tests_od/test_angular/main.h delete mode 100644 test/tests_core/tests_od/test_control/main.h delete mode 100644 test/tests_core/tests_od/test_electric/main.h delete mode 100644 test/tests_core/tests_od/test_force/main.h delete mode 100644 test/tests_core/tests_od/test_illuminance/main.h delete mode 100644 test/tests_core/tests_od/test_linear/main.h delete mode 100644 test/tests_core/tests_od/test_pid/main.h delete mode 100644 test/tests_core/tests_od/test_pressure/main.h delete mode 100644 test/tests_core/tests_od/test_ratio/main.h delete mode 100644 test/tests_core/tests_od/test_temperature/main.h delete mode 100644 test/tests_core/tests_od/test_time/main.h diff --git a/test/tests_core/tests_od/test_angular/main.h b/test/tests_core/tests_od/test_angular/main.h deleted file mode 100644 index 56f0a9bb3..000000000 --- a/test/tests_core/tests_od/test_angular/main.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#endif // MAIN_H \ No newline at end of file diff --git a/test/tests_core/tests_od/test_control/main.h b/test/tests_core/tests_od/test_control/main.h deleted file mode 100644 index 56f0a9bb3..000000000 --- a/test/tests_core/tests_od/test_control/main.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#endif // MAIN_H \ No newline at end of file diff --git a/test/tests_core/tests_od/test_electric/main.h b/test/tests_core/tests_od/test_electric/main.h deleted file mode 100644 index 56f0a9bb3..000000000 --- a/test/tests_core/tests_od/test_electric/main.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#endif // MAIN_H \ No newline at end of file diff --git a/test/tests_core/tests_od/test_force/main.h b/test/tests_core/tests_od/test_force/main.h deleted file mode 100644 index 56f0a9bb3..000000000 --- a/test/tests_core/tests_od/test_force/main.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#endif // MAIN_H \ No newline at end of file diff --git a/test/tests_core/tests_od/test_illuminance/main.h b/test/tests_core/tests_od/test_illuminance/main.h deleted file mode 100644 index 56f0a9bb3..000000000 --- a/test/tests_core/tests_od/test_illuminance/main.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#endif // MAIN_H \ No newline at end of file diff --git a/test/tests_core/tests_od/test_linear/main.h b/test/tests_core/tests_od/test_linear/main.h deleted file mode 100644 index 56f0a9bb3..000000000 --- a/test/tests_core/tests_od/test_linear/main.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#endif // MAIN_H \ No newline at end of file diff --git a/test/tests_core/tests_od/test_pid/main.h b/test/tests_core/tests_od/test_pid/main.h deleted file mode 100644 index 56f0a9bb3..000000000 --- a/test/tests_core/tests_od/test_pid/main.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#endif // MAIN_H \ No newline at end of file diff --git a/test/tests_core/tests_od/test_pressure/main.h b/test/tests_core/tests_od/test_pressure/main.h deleted file mode 100644 index 56f0a9bb3..000000000 --- a/test/tests_core/tests_od/test_pressure/main.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#endif // MAIN_H \ No newline at end of file diff --git a/test/tests_core/tests_od/test_ratio/main.h b/test/tests_core/tests_od/test_ratio/main.h deleted file mode 100644 index 56f0a9bb3..000000000 --- a/test/tests_core/tests_od/test_ratio/main.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#endif // MAIN_H \ No newline at end of file diff --git a/test/tests_core/tests_od/test_temperature/main.h b/test/tests_core/tests_od/test_temperature/main.h deleted file mode 100644 index 56f0a9bb3..000000000 --- a/test/tests_core/tests_od/test_temperature/main.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#endif // MAIN_H \ No newline at end of file diff --git a/test/tests_core/tests_od/test_time/main.h b/test/tests_core/tests_od/test_time/main.h deleted file mode 100644 index 56f0a9bb3..000000000 --- a/test/tests_core/tests_od/test_time/main.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#endif // MAIN_H \ No newline at end of file From fafe8825380be068ad32acb8d3354223db0b651a Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 31 May 2023 11:17:27 +0200 Subject: [PATCH 061/150] Improve timestamp unit tests --- engine/core/src/timestamp.c | 8 +- test/tests_core/test_timestamp/main.c | 101 ++++++++++++++++++++++---- test/tests_core/test_timestamp/main.h | 7 -- 3 files changed, 93 insertions(+), 23 deletions(-) delete mode 100644 test/tests_core/test_timestamp/main.h diff --git a/engine/core/src/timestamp.c b/engine/core/src/timestamp.c index c1fd55e71..6407a3d3b 100644 --- a/engine/core/src/timestamp.c +++ b/engine/core/src/timestamp.c @@ -62,6 +62,7 @@ time_luos_t Luos_Timestamp(void) { return TimeOD_TimeFrom_ns((double)LuosHAL_GetTimestamp()); } + /****************************************************************************** * @brief Check if the message is a timestamp message * @param msg : Message to check @@ -69,8 +70,10 @@ time_luos_t Luos_Timestamp(void) ******************************************************************************/ _CRITICAL inline bool Luos_IsMsgTimstamped(const msg_t *msg) { + LUOS_ASSERT(msg != NULL); return (msg->header.config == TIMESTAMP_PROTOCOL); } + /****************************************************************************** * @brief Get the timestamp associated to a message * @param msg : Message to get the timestamp from @@ -78,6 +81,7 @@ _CRITICAL inline bool Luos_IsMsgTimstamped(const msg_t *msg) ******************************************************************************/ time_luos_t Luos_GetMsgTimestamp(msg_t *msg) { + LUOS_ASSERT(msg != NULL); time_luos_t timestamp = {0.0f}; if (Luos_IsMsgTimstamped(msg)) { @@ -96,6 +100,7 @@ time_luos_t Luos_GetMsgTimestamp(msg_t *msg) ******************************************************************************/ void Timestamp_EncodeMsg(msg_t *msg, time_luos_t timestamp) { + LUOS_ASSERT(msg != NULL); // Update message header protocol msg->header.config = TIMESTAMP_PROTOCOL; // Timestamp is at the end of the message copy it @@ -109,7 +114,7 @@ void Timestamp_EncodeMsg(msg_t *msg, time_luos_t timestamp) ******************************************************************************/ _CRITICAL time_luos_t Timestamp_ConvertToLatency(const msg_t *msg) { - + LUOS_ASSERT(msg != NULL); time_luos_t timestamp_date; memcpy(×tamp_date, &msg->data[msg->header.size], sizeof(time_luos_t)); // Compute the latency from date @@ -125,6 +130,7 @@ _CRITICAL time_luos_t Timestamp_ConvertToLatency(const msg_t *msg) ******************************************************************************/ _CRITICAL inline void Timestamp_ConvertToDate(msg_t *msg, uint64_t reception_date) { + LUOS_ASSERT(msg != NULL); time_luos_t timestamp_latency = {0.0f}; // Get latency memcpy(×tamp_latency, &msg->data[msg->header.size], sizeof(time_luos_t)); diff --git a/test/tests_core/test_timestamp/main.c b/test/tests_core/test_timestamp/main.c index fed8a6f78..e1f60cd09 100644 --- a/test/tests_core/test_timestamp/main.c +++ b/test/tests_core/test_timestamp/main.c @@ -1,17 +1,74 @@ -#include "main.h" #include -#include +#include "default_scenario.h" +#include "_timestamp.h" extern volatile uint8_t msg_buffer[MSG_BUFFER_SIZE]; extern default_scenario_t default_sc; -static void MessageHandler(service_t *service, const msg_t *msg) +void unittest_Luos_IsMsgTimstamped(void) { - default_sc.App_1.last_rx_msg.header.config = msg->header.config; - default_sc.App_1.last_rx_msg.header.size = msg->header.size; - for (uint16_t i = 0; i < default_sc.App_1.last_rx_msg.header.size; i++) + NEW_TEST_CASE("Test Luos_IsMsgTimstamped assert conditions"); { - default_sc.App_1.last_rx_msg.data[i] = msg->data[i]; + TRY + { + Luos_IsMsgTimstamped(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } +} + +void unittest_Luos_GetMsgTimestamp(void) +{ + NEW_TEST_CASE("Test Luos_GetMsgTimestamp assert conditions"); + { + TRY + { + Luos_GetMsgTimestamp(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } +} + +void unittest_Timestamp_EncodeMsg(void) +{ + NEW_TEST_CASE("Test Timestamp_EncodeMsg assert conditions"); + { + TRY + { + time_luos_t timestamp; + Timestamp_EncodeMsg(NULL, timestamp); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } +} + +void unittest_Timestamp_ConvertToLatency(void) +{ + NEW_TEST_CASE("Test Timestamp_ConvertToLatency assert conditions"); + { + TRY + { + Timestamp_ConvertToLatency(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } +} + +void unittest_Timestamp_ConvertToDate(void) +{ + NEW_TEST_CASE("Test Timestamp_ConvertToDate assert conditions"); + { + TRY + { + uint64_t reception_date; + Timestamp_ConvertToDate(NULL, reception_date); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; } } @@ -43,7 +100,7 @@ void unittest_Timestamp() NEW_STEP("Transmit timestamps"); // Init scenario context - // Init default scenario context + // Init default scenario context Init_Context(); Luos_Loop(); @@ -55,30 +112,39 @@ void unittest_Timestamp() msg.header.cmd = IO_STATE; msg.data[0] = true; - // Send the 1st message to receiver with both the 1st timestamp + // Send the 1st message to receiver with the 1st timestamp TEST_ASSERT_EQUAL(SUCCEED, Luos_SendTimestampMsg(default_sc.App_1.app, &msg, event_a_timestamp)); Luos_Loop(); - // Get the message received msg_t *rx_msg; rx_msg = &default_sc.App_2.last_rx_msg; uint64_t low_level_rx_timestamp; + // Check the message size + TEST_ASSERT_EQUAL(msg.header.size, rx_msg->header.size); + // Check that the message is timestamped + TEST_ASSERT_EQUAL(true, Luos_IsMsgTimstamped(rx_msg)); // Get back the 1st timestamp time_luos_t rx_event_a_timestamp = Luos_GetMsgTimestamp(rx_msg); - // Send the 2nd message to receiver with both the 2nd timestamp - msg.header.size = 1; + TEST_ASSERT_FALSE(IS_ASSERT()); + + // Send the 2nd message to receiver with the 2nd timestamp + msg.header.size = 2; TEST_ASSERT_EQUAL(SUCCEED, Luos_SendTimestampMsg(default_sc.App_1.app, &msg, event_b_timestamp)); Luos_Loop(); - // Get the message received rx_msg = &default_sc.App_2.last_rx_msg; + // Check the message size + TEST_ASSERT_EQUAL(msg.header.size, rx_msg->header.size); + // Check that the message is timestamped + TEST_ASSERT_EQUAL(true, Luos_IsMsgTimstamped(rx_msg)); // Get back the 2nd timestamp time_luos_t rx_event_b_timestamp = Luos_GetMsgTimestamp(rx_msg); + TEST_ASSERT_FALSE(IS_ASSERT()); // check the time elapsed between the two events - time_elapsed = TimeOD_TimeFrom_s(TimeOD_TimeTo_s(rx_event_b_timestamp) - TimeOD_TimeTo_s(rx_event_a_timestamp)); + time_luos_t time_elapsed2 = TimeOD_TimeFrom_s(TimeOD_TimeTo_s(rx_event_b_timestamp) - TimeOD_TimeTo_s(rx_event_a_timestamp)); // Verify - TEST_ASSERT_EQUAL(((TimeOD_TimeTo_ms(time_elapsed) > 1.15) && (TimeOD_TimeTo_ms(time_elapsed) < 1.25)), true); + TEST_ASSERT_EQUAL(TimeOD_TimeTo_ms(time_elapsed2), TimeOD_TimeTo_ms(time_elapsed)); } } @@ -87,6 +153,11 @@ int main(int argc, char **argv) UNITY_BEGIN(); // Timestamp function + UNIT_TEST_RUN(unittest_Luos_IsMsgTimstamped); + UNIT_TEST_RUN(unittest_Luos_GetMsgTimestamp); + UNIT_TEST_RUN(unittest_Timestamp_EncodeMsg); + UNIT_TEST_RUN(unittest_Timestamp_ConvertToLatency); + UNIT_TEST_RUN(unittest_Timestamp_ConvertToDate); UNIT_TEST_RUN(unittest_Timestamp); UNITY_END(); diff --git a/test/tests_core/test_timestamp/main.h b/test/tests_core/test_timestamp/main.h deleted file mode 100644 index 8c6c524cd..000000000 --- a/test/tests_core/test_timestamp/main.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -// Sreaming functions -void unittest_Timestamp(void); - -#endif // MAIN_H \ No newline at end of file From 20625646799ffc8ed1b2aea806133c6ac0d878f9 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 31 May 2023 15:13:03 +0200 Subject: [PATCH 062/150] Improve routing table unit tests --- engine/core/inc/routing_table.h | 1 - engine/core/src/routing_table.c | 106 ++-- test/tests_core/test_routing_table/main.c | 704 +++++++++++++++++++--- test/tests_core/test_routing_table/main.h | 11 - 4 files changed, 702 insertions(+), 120 deletions(-) delete mode 100644 test/tests_core/test_routing_table/main.h diff --git a/engine/core/inc/routing_table.h b/engine/core/inc/routing_table.h index 1b228b142..9ddf32e52 100644 --- a/engine/core/inc/routing_table.h +++ b/engine/core/inc/routing_table.h @@ -80,7 +80,6 @@ void RoutingTB_RemoveNode(uint16_t nodeid); void RoutingTB_RemoveService(uint16_t id); void RoutingTB_Erase(void); routing_table_t *RoutingTB_Get(void); -uint16_t RoutingTB_GetLastService(void); uint16_t *RoutingTB_GetLastNode(void); uint16_t RoutingTB_GetLastEntry(void); diff --git a/engine/core/src/routing_table.c b/engine/core/src/routing_table.c index d500f4f72..f5c879a71 100644 --- a/engine/core/src/routing_table.c +++ b/engine/core/src/routing_table.c @@ -15,15 +15,13 @@ #include "luos_io.h" #include "service.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ /******************************************************************************* * Variables ******************************************************************************/ routing_table_t routing_table[MAX_RTB_ENTRY]; volatile uint16_t last_service = 0; volatile uint16_t last_routing_table_entry = 0; + /******************************************************************************* * Function ******************************************************************************/ @@ -47,6 +45,7 @@ static void RoutingTB_SendEndDetection(service_t *service); ******************************************************************************/ uint16_t RoutingTB_IDFromAlias(char *alias) { + LUOS_ASSERT(alias); if (*alias != -1) { for (int i = 0; i <= last_routing_table_entry; i++) @@ -62,6 +61,7 @@ uint16_t RoutingTB_IDFromAlias(char *alias) } return 0; } + /****************************************************************************** * @brief Return a Nodeid from service id * @param id : Id of service @@ -69,7 +69,9 @@ uint16_t RoutingTB_IDFromAlias(char *alias) ******************************************************************************/ uint16_t RoutingTB_NodeIDFromID(uint16_t id) { - for (int32_t i = (int32_t)RoutingTB_GetServiceIndex(id); i >= 0; i--) + LUOS_ASSERT(id != 0); // Services can't have id 0. + // In RTB, node are always before service, so we can search backward and start just before the service index. + for (int16_t i = RoutingTB_GetServiceIndex(id) - 1; i >= 0; i--) { if (routing_table[i].mode == NODE) { @@ -78,6 +80,7 @@ uint16_t RoutingTB_NodeIDFromID(uint16_t id) } return 0; } + /****************************************************************************** * @brief Return service Alias from ID * @param id : Id service look at @@ -85,6 +88,7 @@ uint16_t RoutingTB_NodeIDFromID(uint16_t id) ******************************************************************************/ char *RoutingTB_AliasFromId(uint16_t id) { + LUOS_ASSERT(id != 0); // Services can't have id 0. for (int i = 0; i <= last_routing_table_entry; i++) { if (routing_table[i].mode == SERVICE) @@ -97,6 +101,7 @@ char *RoutingTB_AliasFromId(uint16_t id) } return (char *)0; } + /****************************************************************************** * @brief Return bigest service ID in list * @param None @@ -104,19 +109,9 @@ char *RoutingTB_AliasFromId(uint16_t id) ******************************************************************************/ uint16_t RoutingTB_BigestID(void) { - uint16_t max_id = 0; - for (uint16_t i = 0; i < last_routing_table_entry; i++) - { - if (routing_table[i].mode == SERVICE) - { - if (routing_table[i].id > max_id) - { - max_id = routing_table[i].id; - } - } - } - return max_id; + return (uint16_t)last_service; } + /****************************************************************************** * @brief Return bigest node ID in list * @param None @@ -124,27 +119,24 @@ uint16_t RoutingTB_BigestID(void) ******************************************************************************/ static uint16_t RoutingTB_BigestNodeID(void) { - uint16_t max_id = 0; - for (uint16_t i = 0; i < last_routing_table_entry; i++) + for (int32_t i = last_routing_table_entry; i >= 0; i--) { if (routing_table[i].mode == NODE) { - if (routing_table[i].node_id > max_id) - { - max_id = routing_table[i].node_id; - } + return routing_table[i].node_id; } } - return max_id; + return 0; } /****************************************************************************** * @brief Get Index of service on the routing table - * @param id : Routing table id - * @return Index + * @param id : service id + * @return Routing table Index ******************************************************************************/ uint16_t RoutingTB_GetServiceIndex(uint16_t id) { + LUOS_ASSERT(id != 0); // Services can't have id 0. for (uint8_t i = 0; i < last_routing_table_entry; i++) { if (routing_table[i].mode == SERVICE && routing_table[i].id == id) @@ -179,6 +171,7 @@ void RoutingTB_ComputeRoutingTableEntryNB(void) // Routing table space is full. last_routing_table_entry = MAX_RTB_ENTRY - 1; } + /****************************************************************************** * @brief Manage service name increment to never have same alias * @param alias : Alias to change @@ -187,6 +180,7 @@ void RoutingTB_ComputeRoutingTableEntryNB(void) ******************************************************************************/ static void RoutingTB_AddNumToAlias(char *alias, uint8_t num) { + LUOS_ASSERT(alias); uint8_t intsize = 1; if (num > 9) { @@ -213,6 +207,7 @@ static void RoutingTB_AddNumToAlias(char *alias, uint8_t num) char *alias_copy = alias; sprintf(alias, "%s%d", alias_copy, num); } + /****************************************************************************** * @brief Time out to receive en route table from * @param service : Service receive @@ -221,6 +216,7 @@ static void RoutingTB_AddNumToAlias(char *alias, uint8_t num) ******************************************************************************/ bool RoutingTB_WaitRoutingTable(service_t *service, msg_t *intro_msg) { + LUOS_ASSERT((service != 0) && (intro_msg != 0)); const uint8_t timeout = 15; // timeout in ms const uint16_t entry_bkp = last_routing_table_entry; Luos_SendMsg(service, intro_msg); @@ -236,6 +232,7 @@ bool RoutingTB_WaitRoutingTable(service_t *service, msg_t *intro_msg) } return false; } + /****************************************************************************** * @brief Generate Complete route table with local route table receive * @param service : Service in node @@ -244,6 +241,7 @@ bool RoutingTB_WaitRoutingTable(service_t *service, msg_t *intro_msg) ******************************************************************************/ static void RoutingTB_Generate(service_t *service, uint16_t nb_node) { + LUOS_ASSERT(service); // Asks for introduction for every found node (even the one detecting). uint16_t try_nb = 0; uint16_t last_node_id = RoutingTB_BigestNodeID(); @@ -294,6 +292,7 @@ static void RoutingTB_Generate(service_t *service, uint16_t nb_node) } } } + /****************************************************************************** * @brief Send the complete route table to each node on the network * @param service : Service who send @@ -302,6 +301,7 @@ static void RoutingTB_Generate(service_t *service, uint16_t nb_node) ******************************************************************************/ static void RoutingTB_Share(service_t *service, uint16_t nb_node) { + LUOS_ASSERT(service); // Make sure that the detection is not interrupted if (Node_GetState() == EXTERNAL_DETECTION) { @@ -339,6 +339,7 @@ static void RoutingTB_Share(service_t *service, uint16_t nb_node) ******************************************************************************/ void RoutingTB_SendEndDetection(service_t *service) { + LUOS_ASSERT(service); // Make sure that the detection is not interrupted if (Node_GetState() == EXTERNAL_DETECTION) { @@ -363,6 +364,7 @@ void RoutingTB_SendEndDetection(service_t *service) ******************************************************************************/ void RoutingTB_DetectServices(service_t *service) { + LUOS_ASSERT(service); // Starts the topology detection. uint16_t nb_node = LuosIO_TopologyDetection(service); // Clear data reception state @@ -378,6 +380,7 @@ void RoutingTB_DetectServices(service_t *service) // Clear statistic of node who start the detction Luos_ResetStatistic(); } + /****************************************************************************** * @brief Entry in routable node with associate service * @param entry : Route table @@ -386,12 +389,14 @@ void RoutingTB_DetectServices(service_t *service) ******************************************************************************/ void RoutingTB_ConvertNodeToRoutingTable(routing_table_t *entry, node_t *node) { + LUOS_ASSERT((node != NULL) && (entry != NULL)); // Check if the NBR_PORT config is too high to fit into routing table. LUOS_ASSERT(sizeof(node_t) <= (sizeof(routing_table_t) - 1)); memset(entry, 0, sizeof(routing_table_t)); entry->mode = NODE; memcpy(entry->unmap_data, node->unmap, sizeof(node_t)); } + /****************************************************************************** * @brief Entry in routable service associate to a node * @param entry : Route table @@ -400,6 +405,7 @@ void RoutingTB_ConvertNodeToRoutingTable(routing_table_t *entry, node_t *node) ******************************************************************************/ void RoutingTB_ConvertServiceToRoutingTable(routing_table_t *entry, service_t *service) { + LUOS_ASSERT((service != NULL) && (entry != NULL)); entry->type = service->type; entry->id = service->id; entry->mode = SERVICE; @@ -408,6 +414,7 @@ void RoutingTB_ConvertServiceToRoutingTable(routing_table_t *entry, service_t *s entry->alias[i] = service->alias[i]; } } + /****************************************************************************** * @brief Remove an entire node * @param nodeid : Node id to remove from RTB @@ -415,7 +422,8 @@ void RoutingTB_ConvertServiceToRoutingTable(routing_table_t *entry, service_t *s ******************************************************************************/ void RoutingTB_RemoveNode(uint16_t nodeid) { - // instead of removing a node just remove all the service in it to make it unusable + LUOS_ASSERT(nodeid != 0); + // Instead of removing a node just remove all the service in it to make it unusable // We could add a param (CONTROL for example) to declare the node as STOP // find the node for (uint16_t i = 0; i < last_routing_table_entry; i++) @@ -425,7 +433,7 @@ void RoutingTB_RemoveNode(uint16_t nodeid) if (routing_table[i].node_id == nodeid) { i++; - // We find our node remove all services + // We foundd our node remove all services in it while (routing_table[i].mode == SERVICE) { RoutingTB_RemoveService(routing_table[i].id); @@ -435,6 +443,7 @@ void RoutingTB_RemoveNode(uint16_t nodeid) } } } + /****************************************************************************** * @brief Remove an entry from routing_table * @param id : Id of service @@ -442,6 +451,7 @@ void RoutingTB_RemoveNode(uint16_t nodeid) ******************************************************************************/ void RoutingTB_RemoveService(uint16_t serviceid) { + LUOS_ASSERT(serviceid != 0); Service_RmAutoUpdateTarget(serviceid); // Find the service for (uint16_t i = 0; i < last_routing_table_entry; i++) @@ -452,10 +462,23 @@ void RoutingTB_RemoveService(uint16_t serviceid) memcpy(&routing_table[i], &routing_table[i + 1], sizeof(routing_table_t) * (last_routing_table_entry - (i + 1))); last_routing_table_entry--; memset(&routing_table[last_routing_table_entry], 0, sizeof(routing_table_t)); + if (serviceid == last_service) + { + last_service = 0; + for (uint16_t i = last_routing_table_entry; i > 0; i--) + { + if (routing_table[i].mode == SERVICE) + { + last_service = routing_table[i].id; + break; + } + } + } return; } } } + /****************************************************************************** * @brief Erase routing_table * @param None @@ -467,6 +490,7 @@ void RoutingTB_Erase(void) last_service = 0; last_routing_table_entry = 0; } + /****************************************************************************** * @brief Get routing_table * @param None @@ -476,15 +500,7 @@ routing_table_t *RoutingTB_Get(void) { return routing_table; } -/****************************************************************************** - * @brief Return the last ID registered into the routing_table - * @param None - * @return Last service ID - ******************************************************************************/ -uint16_t RoutingTB_GetLastService(void) -{ - return (uint16_t)last_service; -} + /****************************************************************************** * @brief Return the last ID registered into the routing_table * @param None @@ -501,9 +517,9 @@ uint16_t RoutingTB_GetLastEntry(void) * @param result : Pointer to search result structure * @return SUCCEED : If the result address is available, else FAILED ******************************************************************************/ - error_return_t RTFilter_InitCheck(search_result_t *result) { + LUOS_ASSERT(result != NULL); // check if we fund the address of the result in routing table if ((result->result_table[0] >= &routing_table[0]) && (result->result_table[0] <= &routing_table[last_routing_table_entry - 1])) { @@ -511,6 +527,7 @@ error_return_t RTFilter_InitCheck(search_result_t *result) } return FAILED; } + /****************************************************************************** * @brief Initialize the Result table pointers * @param result : Pointer to result table @@ -518,6 +535,7 @@ error_return_t RTFilter_InitCheck(search_result_t *result) ******************************************************************************/ search_result_t *RTFilter_Reset(search_result_t *result) { + LUOS_ASSERT(result != NULL); // the initialization is to keep a pointer to all the servicesentries of the routing table result->result_nbr = 0; for (uint8_t i = 0; i < last_routing_table_entry; i++) @@ -530,6 +548,7 @@ search_result_t *RTFilter_Reset(search_result_t *result) } return result; } + /****************************************************************************** * @brief Find the service with a specific Id * @param result : Pointer to previous result research structure @@ -538,6 +557,7 @@ search_result_t *RTFilter_Reset(search_result_t *result) ******************************************************************************/ search_result_t *RTFilter_ID(search_result_t *result, uint16_t id) { + LUOS_ASSERT((result != NULL) && (id != 0)); uint8_t entry_nbr = 0; // Check result pointer LUOS_ASSERT(result != 0); @@ -563,6 +583,7 @@ search_result_t *RTFilter_ID(search_result_t *result, uint16_t id) // return a pointer to the search structure return (result); } + /****************************************************************************** * @brief Search all the services with the same type * @param result : Pointer to previous result research structure @@ -571,6 +592,7 @@ search_result_t *RTFilter_ID(search_result_t *result, uint16_t id) ******************************************************************************/ search_result_t *RTFilter_Type(search_result_t *result, luos_type_t type) { + LUOS_ASSERT((result != NULL)); uint8_t entry_nbr = 0; // Check result pointer LUOS_ASSERT(result != 0); @@ -596,6 +618,7 @@ search_result_t *RTFilter_Type(search_result_t *result, luos_type_t type) // return a pointer to the search structure return (result); } + /****************************************************************************** * @brief Search all the services of the same node * @param result : Pointer to previous result research structure @@ -604,6 +627,7 @@ search_result_t *RTFilter_Type(search_result_t *result, luos_type_t type) ******************************************************************************/ search_result_t *RTFilter_Node(search_result_t *result, uint16_t node_id) { + LUOS_ASSERT((result != NULL) && (node_id != 0)); uint8_t entry_nbr = 0; // Check result pointer LUOS_ASSERT(result != 0); @@ -631,8 +655,15 @@ search_result_t *RTFilter_Node(search_result_t *result, uint16_t node_id) return (result); } +/****************************************************************************** + * @brief Search all the services with the same alias + * @param result : Pointer to previous result research structure + * @param alias : Alias that we want to find + * @return New result research structure + ******************************************************************************/ search_result_t *RTFilter_Alias(search_result_t *result, char *alias) { + LUOS_ASSERT((result != NULL) && (alias != 0)); uint8_t entry_nbr = 0; // Check result pointer LUOS_ASSERT(result != 0); @@ -668,6 +699,7 @@ search_result_t *RTFilter_Alias(search_result_t *result, char *alias) ******************************************************************************/ search_result_t *RTFilter_Service(search_result_t *result, service_t *service) { + LUOS_ASSERT((result != NULL) && (service != 0)); uint8_t entry_nbr = 0; // Check result pointer LUOS_ASSERT(result != 0); diff --git a/test/tests_core/test_routing_table/main.c b/test/tests_core/test_routing_table/main.c index fda93c220..f44e5a633 100644 --- a/test/tests_core/test_routing_table/main.c +++ b/test/tests_core/test_routing_table/main.c @@ -1,11 +1,507 @@ -#include "main.h" #include #include +#include "routing_table.c" extern default_scenario_t default_sc; +void unittest_RoutingTB_IDFromAlias(void) +{ + NEW_TEST_CASE("Test RoutingTB_IDFromAlias assert conditions"); + { + TRY + { + RoutingTB_IDFromAlias(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("check RoutingTB_IDFromAlias return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + + TEST_ASSERT_EQUAL(1, RoutingTB_IDFromAlias("Dummy_App_1")); + TEST_ASSERT_EQUAL(2, RoutingTB_IDFromAlias("Dummy_App_2")); + TEST_ASSERT_EQUAL(3, RoutingTB_IDFromAlias("Dummy_App_3")); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RoutingTB_GetServiceIndex(void) +{ + NEW_TEST_CASE("Test RoutingTB_GetServiceIndex assert conditions"); + { + TRY + { + RoutingTB_GetServiceIndex(0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("check RoutingTB_GetServiceIndex return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + + TEST_ASSERT_EQUAL(1, RoutingTB_GetServiceIndex(1)); + TEST_ASSERT_EQUAL(2, RoutingTB_GetServiceIndex(2)); + TEST_ASSERT_EQUAL(3, RoutingTB_GetServiceIndex(3)); + TEST_ASSERT_EQUAL(0, RoutingTB_GetServiceIndex(4)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RoutingTB_NodeIDFromID(void) +{ + NEW_TEST_CASE("Test RoutingTB_NodeIDFromID assert conditions"); + { + TRY + { + RoutingTB_NodeIDFromID(0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("check RoutingTB_NodeIDFromID return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + + TEST_ASSERT_EQUAL(1, RoutingTB_NodeIDFromID(1)); + TEST_ASSERT_EQUAL(1, RoutingTB_NodeIDFromID(2)); + TEST_ASSERT_EQUAL(1, RoutingTB_NodeIDFromID(3)); + TEST_ASSERT_EQUAL(0, RoutingTB_NodeIDFromID(4)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RoutingTB_ComputeRoutingTableEntryNB(void) +{ + NEW_TEST_CASE("check RoutingTB_NodeIDFromID return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + TEST_ASSERT_EQUAL(4, last_routing_table_entry); // 3 services + 1 nodes + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RoutingTB_AliasFromId(void) +{ + NEW_TEST_CASE("Test RoutingTB_AliasFromId assert conditions"); + { + TRY + { + RoutingTB_AliasFromId(0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("check RoutingTB_AliasFromId return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + + TEST_ASSERT_EQUAL_STRING("Dummy_App_1", RoutingTB_AliasFromId(1)); + TEST_ASSERT_EQUAL_STRING("Dummy_App_2", RoutingTB_AliasFromId(2)); + TEST_ASSERT_EQUAL_STRING("Dummy_App_3", RoutingTB_AliasFromId(3)); + TEST_ASSERT_EQUAL_STRING(0, RoutingTB_AliasFromId(4)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RoutingTB_BigestID(void) +{ + NEW_TEST_CASE("check RoutingTB_BigestID return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + + TEST_ASSERT_EQUAL(3, RoutingTB_BigestID()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RoutingTB_BigestNodeID(void) +{ + NEW_TEST_CASE("check RoutingTB_BigestNodeID return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + + TEST_ASSERT_EQUAL(1, RoutingTB_BigestNodeID()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RoutingTB_AddNumToAlias(void) +{ + NEW_TEST_CASE("Test RoutingTB_AddNumToAlias assert conditions"); + { + TRY + { + RoutingTB_AddNumToAlias(NULL, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("check RoutingTB_AddNumToAlias return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + + char alias[MAX_ALIAS_SIZE] = "Dummy_App"; + RoutingTB_AddNumToAlias(alias, 1); + TEST_ASSERT_EQUAL_STRING("Dummy_App1", alias); + RoutingTB_AddNumToAlias(alias, 2); + TEST_ASSERT_EQUAL_STRING("Dummy_App12", alias); + RoutingTB_AddNumToAlias(alias, 3); + TEST_ASSERT_EQUAL_STRING("Dummy_App123", alias); + + char alias_big[MAX_ALIAS_SIZE] = "Dummy_App123456"; + RoutingTB_AddNumToAlias(alias_big, 1); + TEST_ASSERT_EQUAL_STRING("Dummy_App123451", alias_big); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RoutingTB_ConvertNodeToRoutingTable(void) +{ + NEW_TEST_CASE("Test RoutingTB_ConvertNodeToRoutingTable assert conditions"); + { + TRY + { + node_t node; + RoutingTB_ConvertNodeToRoutingTable(NULL, &node); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + routing_table_t entry; + RoutingTB_ConvertNodeToRoutingTable(&entry, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("check RoutingTB_ConvertNodeToRoutingTable return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + + routing_table_t entry; + node_t node; + node.certified = false; + node.node_id = 10; + node.node_info = 20; + node.port_table[0] = 30; + node.port_table[1] = 40; + + RoutingTB_ConvertNodeToRoutingTable(&entry, &node); + TEST_ASSERT_EQUAL(NODE, entry.mode); + TEST_ASSERT_EQUAL(false, entry.certified); + TEST_ASSERT_EQUAL(10, entry.node_id); + TEST_ASSERT_EQUAL(20, entry.node_info); + TEST_ASSERT_EQUAL(30, entry.port_table[0]); + TEST_ASSERT_EQUAL(40, entry.port_table[1]); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RoutingTB_ConvertServiceToRoutingTable(void) +{ + NEW_TEST_CASE("Test RoutingTB_ConvertServiceToRoutingTable assert conditions"); + { + TRY + { + service_t service; + RoutingTB_ConvertServiceToRoutingTable(NULL, &service); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + routing_table_t entry; + RoutingTB_ConvertServiceToRoutingTable(&entry, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("check RoutingTB_ConvertServiceToRoutingTable return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + + routing_table_t entry; + service_t service; + service.id = 10; + strcpy(service.alias, "Dummy_App"); + service.type = DISTANCE_TYPE; + + RoutingTB_ConvertServiceToRoutingTable(&entry, &service); + TEST_ASSERT_EQUAL(SERVICE, entry.mode); + TEST_ASSERT_EQUAL(10, entry.id); + TEST_ASSERT_EQUAL_STRING("Dummy_App", entry.alias); + TEST_ASSERT_EQUAL(DISTANCE_TYPE, entry.type); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RoutingTB_RemoveService(void) +{ + NEW_TEST_CASE("Test RoutingTB_RemoveService assert conditions"); + { + TRY + { + RoutingTB_RemoveService(0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("check RoutingTB_RemoveService return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + + RoutingTB_RemoveService(2); + TEST_ASSERT_EQUAL(3, last_routing_table_entry); + TEST_ASSERT_EQUAL(1, routing_table[1].id); + TEST_ASSERT_EQUAL(3, routing_table[2].id); + TEST_ASSERT_EQUAL(0, routing_table[3].id); + TEST_ASSERT_EQUAL(3, last_service); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + + TRY + { + // Init default scenario context + Init_Context(); + + RoutingTB_RemoveService(3); + TEST_ASSERT_EQUAL(3, last_routing_table_entry); + TEST_ASSERT_EQUAL(1, routing_table[1].id); + TEST_ASSERT_EQUAL(2, routing_table[2].id); + TEST_ASSERT_EQUAL(0, routing_table[3].id); + TEST_ASSERT_EQUAL(2, last_service); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RoutingTB_RemoveNode(void) +{ + NEW_TEST_CASE("Test RoutingTB_RemoveNode assert conditions"); + { + TRY + { + RoutingTB_RemoveNode(0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("check RoutingTB_RemoveNode return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + RoutingTB_RemoveNode(1); + TEST_ASSERT_EQUAL(1, last_routing_table_entry); + TEST_ASSERT_EQUAL(0, routing_table[1].id); + TEST_ASSERT_EQUAL(0, last_service); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RoutingTB_Erase(void) +{ + NEW_TEST_CASE("check RoutingTB_Erase return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + RoutingTB_Erase(); + TEST_ASSERT_EQUAL(0, last_routing_table_entry); + TEST_ASSERT_EQUAL(0, last_service); + TEST_ASSERT_EQUAL(0, routing_table[0].id); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RoutingTB_Get(void) +{ + NEW_TEST_CASE("check RoutingTB_Get return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + TEST_ASSERT_EQUAL(routing_table, RoutingTB_Get()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RoutingTB_GetLastEntry(void) +{ + NEW_TEST_CASE("check RoutingTB_GetLastEntry return value"); + { + TRY + { + // Init default scenario context + Init_Context(); + TEST_ASSERT_EQUAL(last_routing_table_entry, RoutingTB_GetLastEntry()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_RTFilter_InitCheck(void) +{ + NEW_TEST_CASE("Test RTFilter_InitCheck assert conditions"); + { + TRY + { + RTFilter_InitCheck(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test the result initialization check function"); + { + // Init default scenario context + Init_Context(); + // Init variables + search_result_t result; + + NEW_STEP("Verify that we have not initialized the result"); + TEST_ASSERT_EQUAL(FAILED, RTFilter_InitCheck(&result)); + + NEW_STEP("Verify that we have initialized the result"); + RTFilter_Reset(&result); + TEST_ASSERT_EQUAL(SUCCEED, RTFilter_InitCheck(&result)); + } +} + void unittest_RTFilter_Reset(void) { + NEW_TEST_CASE("Test RTFilter_Reset assert conditions"); + { + TRY + { + RTFilter_Reset(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } NEW_TEST_CASE("Test the services in the result table"); { uint32_t ExpectedServiceNB; @@ -39,31 +535,65 @@ void unittest_RTFilter_Reset(void) } } -void unittest_RTFilter_InitCheck(void) +void unittest_RTFilter_ID(void) { - NEW_TEST_CASE("Test the result initialization check function"); + NEW_TEST_CASE("Test RTFilter_ID assert conditions"); { + TRY + { + RTFilter_ID(NULL, 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + search_result_t result; + RTFilter_ID(&result, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test the id filtering result number"); + { + uint32_t ExpectedServiceNB; + // Init default scenario context Init_Context(); // Init variables + ExpectedServiceNB = 1; search_result_t result; - uint8_t value; + // Add samples - NEW_STEP("Verify that we have not initialized the result"); - value = RTFilter_InitCheck(&result); - // Verify - TEST_ASSERT_EQUAL(FAILED, value); + NEW_STEP("Verify that we have 1 service with this exact id"); + RTFilter_ID(RTFilter_Reset(&result), 2); + TEST_ASSERT_EQUAL(ExpectedServiceNB, result.result_nbr); - NEW_STEP("Verify that we have initialized the result"); - RTFilter_Reset(&result); - value = RTFilter_InitCheck(&result); - // Verify - TEST_ASSERT_EQUAL(SUCCEED, value); + NEW_STEP("Verify that we have the right id"); + TEST_ASSERT_EQUAL(2, result.result_table[0]->id); + + NEW_STEP("Verify that we have no service with id bigger than 3"); + ExpectedServiceNB = 0; + RTFilter_ID(RTFilter_Reset(&result), 4); + TEST_ASSERT_EQUAL(ExpectedServiceNB, result.result_nbr); + + NEW_STEP("Verify that we have no service with id 0"); + ExpectedServiceNB = 0; + RTFilter_ID(RTFilter_Reset(&result), 0); + TEST_ASSERT_EQUAL(ExpectedServiceNB, result.result_nbr); } } void unittest_RTFilter_Type(void) { + NEW_TEST_CASE("Test RTFilter_Type assert conditions"); + { + TRY + { + RTFilter_Type(NULL, VOID_TYPE); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } NEW_TEST_CASE("Test the type filtering without initialization"); { RESET_ASSERT(); @@ -137,6 +667,22 @@ void unittest_RTFilter_Type(void) void unittest_RTFilter_Node(void) { + NEW_TEST_CASE("Test RTFilter_Node assert conditions"); + { + TRY + { + RTFilter_Node(NULL, 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + search_result_t result; + RTFilter_Node(&result, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } NEW_TEST_CASE("Test the node filtering result number"); { uint32_t ExpectedServiceNB; @@ -159,67 +705,24 @@ void unittest_RTFilter_Node(void) } } -void unittest_RTFilter_ID(void) -{ - NEW_TEST_CASE("Test the id filtering result number"); - { - uint32_t ExpectedServiceNB; - - // Init default scenario context - Init_Context(); - // Init variables - ExpectedServiceNB = 1; - search_result_t result; - // Add samples - - NEW_STEP("Verify that we have 1 service with this exact id"); - RTFilter_ID(RTFilter_Reset(&result), 2); - TEST_ASSERT_EQUAL(ExpectedServiceNB, result.result_nbr); - - NEW_STEP("Verify that we have the right id"); - TEST_ASSERT_EQUAL(2, result.result_table[0]->id); - - NEW_STEP("Verify that we have no service with id bigger than 3"); - ExpectedServiceNB = 0; - RTFilter_ID(RTFilter_Reset(&result), 4); - TEST_ASSERT_EQUAL(ExpectedServiceNB, result.result_nbr); - - NEW_STEP("Verify that we have no service with id 0"); - ExpectedServiceNB = 0; - RTFilter_ID(RTFilter_Reset(&result), 0); - TEST_ASSERT_EQUAL(ExpectedServiceNB, result.result_nbr); - } -} - -void unittest_RTFilter_Service(void) +void unittest_RTFilter_Alias() { - NEW_TEST_CASE("Test the id filtering result number"); + NEW_TEST_CASE("Test RTFilter_Alias assert conditions"); { - uint32_t ExpectedServiceNB; - - // Init default scenario context - Init_Context(); - ExpectedServiceNB = 1; - search_result_t result; - // Add samples - - NEW_STEP("Verify that we have 1 service found with this pointer"); - RTFilter_Service(RTFilter_Reset(&result), default_sc.App_3.app); - TEST_ASSERT_EQUAL(ExpectedServiceNB, result.result_nbr); - - NEW_STEP("Verify that we have assert if we put 0 at service pointer"); - // Init variables - ExpectedServiceNB = 0; - RTFilter_Reset(&result); - result.result_nbr = 0; - - RTFilter_Service(&result, 0); + TRY + { + RTFilter_Alias(NULL, "Dummy"); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + search_result_t result; + RTFilter_Alias(&result, NULL); + } TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; } -} - -void unittest_RTFilter_Alias() -{ NEW_TEST_CASE("Test the alias filtering result number"); { uint32_t ExpectedServiceNB; @@ -270,11 +773,70 @@ void unittest_RTFilter_Alias() TEST_ASSERT_EQUAL(ExpectedServiceNB, result.result_nbr); } } + +void unittest_RTFilter_Service(void) +{ + NEW_TEST_CASE("Test RTFilter_Service assert conditions"); + { + TRY + { + service_t service; + RTFilter_Service(NULL, &service); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + search_result_t result; + RTFilter_Service(&result, NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test the id filtering result number"); + { + uint32_t ExpectedServiceNB; + + // Init default scenario context + Init_Context(); + ExpectedServiceNB = 1; + search_result_t result; + // Add samples + + NEW_STEP("Verify that we have 1 service found with this pointer"); + RTFilter_Service(RTFilter_Reset(&result), default_sc.App_3.app); + TEST_ASSERT_EQUAL(ExpectedServiceNB, result.result_nbr); + + NEW_STEP("Verify that we have assert if we put 0 at service pointer"); + // Init variables + ExpectedServiceNB = 0; + RTFilter_Reset(&result); + result.result_nbr = 0; + + RTFilter_Service(&result, 0); + TEST_ASSERT_TRUE(IS_ASSERT()); + } +} + int main(int argc, char **argv) { UNITY_BEGIN(); - // Streaming functions + UNIT_TEST_RUN(unittest_RoutingTB_IDFromAlias); + UNIT_TEST_RUN(unittest_RoutingTB_GetServiceIndex); + UNIT_TEST_RUN(unittest_RoutingTB_NodeIDFromID); + UNIT_TEST_RUN(unittest_RoutingTB_AliasFromId); + UNIT_TEST_RUN(unittest_RoutingTB_BigestID); + UNIT_TEST_RUN(unittest_RoutingTB_BigestNodeID); + UNIT_TEST_RUN(unittest_RoutingTB_ComputeRoutingTableEntryNB); + UNIT_TEST_RUN(unittest_RoutingTB_AddNumToAlias); + UNIT_TEST_RUN(unittest_RoutingTB_ConvertNodeToRoutingTable); + UNIT_TEST_RUN(unittest_RoutingTB_ConvertServiceToRoutingTable); + UNIT_TEST_RUN(unittest_RoutingTB_RemoveService); + UNIT_TEST_RUN(unittest_RoutingTB_RemoveNode); + UNIT_TEST_RUN(unittest_RoutingTB_Erase); + UNIT_TEST_RUN(unittest_RoutingTB_Get); + UNIT_TEST_RUN(unittest_RoutingTB_GetLastEntry); UNIT_TEST_RUN(unittest_RTFilter_Reset); UNIT_TEST_RUN(unittest_RTFilter_InitCheck); UNIT_TEST_RUN(unittest_RTFilter_Type); diff --git a/test/tests_core/test_routing_table/main.h b/test/tests_core/test_routing_table/main.h deleted file mode 100644 index f3bf1968f..000000000 --- a/test/tests_core/test_routing_table/main.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -// Sreaming functions -void unittest_RTFilter_Reset(void); -void unittest_RTFilter_InitCheck(void); -void unittest_RTFilter_Type(void); -void unittest_RTFilter_Node(void); -void unittest_RTFilter_Alias(void); - -#endif // MAIN_H \ No newline at end of file From df9d4a37a208ec0ca4a2d7109abb9089e04868ef Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 31 May 2023 17:34:51 +0200 Subject: [PATCH 063/150] Add streaming unit test --- engine/core/src/streaming.c | 29 +- test/tests_core/test_luos/main.c | 120 ----- test/tests_core/test_streaming/main.c | 715 ++++++++++++++++++++++++++ 3 files changed, 735 insertions(+), 129 deletions(-) create mode 100644 test/tests_core/test_streaming/main.c diff --git a/engine/core/src/streaming.c b/engine/core/src/streaming.c index 36db3eaa6..427034be7 100644 --- a/engine/core/src/streaming.c +++ b/engine/core/src/streaming.c @@ -8,13 +8,6 @@ #include "luos_engine.h" #include "streaming.h" #include "luos_utils.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ /******************************************************************************* * Function @@ -30,7 +23,7 @@ streaming_channel_t Streaming_CreateChannel(const void *ring_buffer, uint16_t ring_buffer_size, uint8_t data_size) { streaming_channel_t stream; - LUOS_ASSERT((ring_buffer != NULL) || (ring_buffer_size > 0) || (data_size > 0)); + LUOS_ASSERT((ring_buffer != NULL) && (ring_buffer_size > 0) && (data_size > 0)); // Save ring buffer informations stream.ring_buffer = (void *)ring_buffer; stream.data_size = data_size; @@ -41,6 +34,7 @@ streaming_channel_t Streaming_CreateChannel(const void *ring_buffer, uint16_t ri stream.sample_ptr = stream.ring_buffer; return stream; } + /****************************************************************************** * @brief Re initialize a streaming channel. * @param stream : Streaming channel pointer @@ -48,9 +42,11 @@ streaming_channel_t Streaming_CreateChannel(const void *ring_buffer, uint16_t ri ******************************************************************************/ void Streaming_ResetChannel(streaming_channel_t *stream) { + LUOS_ASSERT(stream != NULL); stream->data_ptr = stream->ring_buffer; stream->sample_ptr = stream->ring_buffer; } + /****************************************************************************** * @brief Set data into ring buffer. * @param stream : Streaming channel pointer @@ -60,6 +56,7 @@ void Streaming_ResetChannel(streaming_channel_t *stream) ******************************************************************************/ uint16_t Streaming_PutSample(streaming_channel_t *stream, const void *data, uint16_t size) { + LUOS_ASSERT((stream != NULL) && (data != NULL) && (size > 0)); // check if we exceed ring buffer capacity LUOS_ASSERT((Streaming_GetAvailableSampleNB(stream) + size) <= (stream->end_ring_buffer - stream->ring_buffer)); if (((size * stream->data_size) + stream->data_ptr) >= stream->end_ring_buffer) @@ -82,6 +79,7 @@ uint16_t Streaming_PutSample(streaming_channel_t *stream, const void *data, uint } return Streaming_GetAvailableSampleNB(stream); } + /****************************************************************************** * @brief Copy a sample from ring buffer to a data. * @param stream : Streaming channel pointer @@ -91,6 +89,7 @@ uint16_t Streaming_PutSample(streaming_channel_t *stream, const void *data, uint ******************************************************************************/ uint16_t Streaming_GetSample(streaming_channel_t *stream, void *data, uint16_t size) { + LUOS_ASSERT((stream != NULL) && (data != NULL) && (size > 0)); uint16_t nb_available_samples = Streaming_GetAvailableSampleNB(stream); if (nb_available_samples >= size) { @@ -121,6 +120,7 @@ uint16_t Streaming_GetSample(streaming_channel_t *stream, void *data, uint16_t s } return nb_available_samples; } + /****************************************************************************** * @brief Return the number of available samples * @param stream : Streaming channel pointer @@ -128,6 +128,7 @@ uint16_t Streaming_GetSample(streaming_channel_t *stream, void *data, uint16_t s ******************************************************************************/ uint16_t Streaming_GetAvailableSampleNB(streaming_channel_t *stream) { + LUOS_ASSERT(stream != NULL); int32_t nb_available_sample = (stream->data_ptr - stream->sample_ptr) / stream->data_size; if (nb_available_sample < 0) { @@ -137,6 +138,7 @@ uint16_t Streaming_GetAvailableSampleNB(streaming_channel_t *stream) LUOS_ASSERT(nb_available_sample >= 0); return (uint16_t)nb_available_sample; } + /****************************************************************************** * @brief Get sample number availabled in buffer * @param stream : Streaming channel pointer @@ -144,6 +146,7 @@ uint16_t Streaming_GetAvailableSampleNB(streaming_channel_t *stream) ******************************************************************************/ uint16_t Streaming_GetAvailableSampleNBUntilEndBuffer(streaming_channel_t *stream) { + LUOS_ASSERT(stream != NULL); int32_t nb_available_sample = (stream->data_ptr - stream->sample_ptr) / stream->data_size; if (nb_available_sample < 0) { @@ -153,6 +156,7 @@ uint16_t Streaming_GetAvailableSampleNBUntilEndBuffer(streaming_channel_t *strea LUOS_ASSERT(nb_available_sample >= 0); return (uint16_t)nb_available_sample; } + /****************************************************************************** * @brief Set a number of sample available in buffer * @param stream : Streaming channel pointer @@ -161,6 +165,7 @@ uint16_t Streaming_GetAvailableSampleNBUntilEndBuffer(streaming_channel_t *strea ******************************************************************************/ uint16_t Streaming_AddAvailableSampleNB(streaming_channel_t *stream, uint16_t size) { + LUOS_ASSERT(stream != NULL); LUOS_ASSERT((uint32_t)(Streaming_GetAvailableSampleNB(stream) + size) < (uint32_t)(stream->end_ring_buffer - stream->ring_buffer)); if (((size * stream->data_size) + stream->data_ptr) >= stream->end_ring_buffer) { @@ -174,6 +179,7 @@ uint16_t Streaming_AddAvailableSampleNB(streaming_channel_t *stream, uint16_t si } return Streaming_GetAvailableSampleNB(stream); } + /****************************************************************************** * @brief Remove a specific number of samples in buffer * @param stream : Streaming channel pointer @@ -182,6 +188,7 @@ uint16_t Streaming_AddAvailableSampleNB(streaming_channel_t *stream, uint16_t si ******************************************************************************/ uint16_t Streaming_RmvAvailableSampleNB(streaming_channel_t *stream, uint16_t size) { + LUOS_ASSERT(stream != NULL); LUOS_ASSERT(Streaming_GetAvailableSampleNB(stream) >= size); // Check if we exceed ring buffer capacity if (((size * stream->data_size) + stream->sample_ptr) > stream->end_ring_buffer) @@ -215,8 +222,9 @@ void Luos_SendStreaming(service_t *service, msg_t *msg, streaming_channel_t *str // Compute number of message needed to send available datas on ring buffer Luos_SendStreamingSize(service, msg, stream, Streaming_GetAvailableSampleNB(stream)); } + /****************************************************************************** - * @brief Send a number of datas of a streaming channel + * @brief Send a number of datas of a streaming channel to transmit * @param service : Who send * @param msg : Message to send * @param stream : Streaming channel pointer @@ -225,6 +233,7 @@ void Luos_SendStreaming(service_t *service, msg_t *msg, streaming_channel_t *str ******************************************************************************/ void Luos_SendStreamingSize(service_t *service, msg_t *msg, streaming_channel_t *stream, uint32_t max_size) { + LUOS_ASSERT((service != NULL) && (msg != NULL) && (stream != NULL)); // Compute number of message needed to send available datas on ring buffer int msg_number = 1; int data_size = Streaming_GetAvailableSampleNB(stream); @@ -277,6 +286,7 @@ void Luos_SendStreamingSize(service_t *service, msg_t *msg, streaming_channel_t } } } + /****************************************************************************** * @brief Receive a streaming channel datas * @param service : Who send @@ -286,6 +296,7 @@ void Luos_SendStreamingSize(service_t *service, msg_t *msg, streaming_channel_t ******************************************************************************/ error_return_t Luos_ReceiveStreaming(service_t *service, const msg_t *msg, streaming_channel_t *stream) { + LUOS_ASSERT((service != NULL) && (msg != NULL) && (stream != NULL)); // Get chunk size unsigned short chunk_size = 0; if (msg->header.size > MAX_DATA_MSG_SIZE) diff --git a/test/tests_core/test_luos/main.c b/test/tests_core/test_luos/main.c index 8d793fb14..8c09ccf65 100644 --- a/test/tests_core/test_luos/main.c +++ b/test/tests_core/test_luos/main.c @@ -5,124 +5,6 @@ extern default_scenario_t default_sc; -void unittest_Luos_SendStreamingStreamingSize() -{ - NEW_TEST_CASE("Sample size sent to streaming < Available samples"); - { - uint32_t ExpectedMaxSize; - msg_t tx_msg; - tx_msg.header.target = 2; - tx_msg.header.target_mode = SERVICEIDACK; - tx_msg.header.cmd = DEFAULT_CMD; - uint8_t Streaming_Buffer[Streaming_BUFFER_SIZE] = {0}; - streaming_channel_t streamChannel = Streaming_CreateChannel(Streaming_Buffer, Streaming_BUFFER_SIZE, 1); - - // Init default scenario context - Init_Context(); - // Init variable - ExpectedMaxSize = 1; - // Add samples - Streaming_AddAvailableSampleNB(&streamChannel, 2); - - NEW_STEP("Verify 1 byte is received when stream channels size is 2"); - Luos_SendStreamingSize(default_sc.App_1.app, &tx_msg, &streamChannel, 1); - Luos_Loop(); - // Verify - TEST_ASSERT_EQUAL(ExpectedMaxSize, default_sc.App_2.last_rx_msg.header.size); - } - - NEW_TEST_CASE("Sample size sent to streaming = available samples"); - { - uint32_t ExpectedMaxSize; - msg_t tx_msg; - tx_msg.header.target = 2; - tx_msg.header.target_mode = SERVICEIDACK; - tx_msg.header.cmd = DEFAULT_CMD; - uint8_t Streaming_Buffer[Streaming_BUFFER_SIZE] = {0}; - streaming_channel_t streamChannel = Streaming_CreateChannel(Streaming_Buffer, Streaming_BUFFER_SIZE, 1); - - // Init default scenario context - Init_Context(); - // Init variable - ExpectedMaxSize = 2; - // Add samples - Streaming_AddAvailableSampleNB(&streamChannel, 2); - - NEW_STEP("Verify 2 byte are received when stream channels size is 2"); - Luos_SendStreamingSize(default_sc.App_1.app, &tx_msg, &streamChannel, 2); - Luos_Loop(); - // Verify - TEST_ASSERT_EQUAL(ExpectedMaxSize, default_sc.App_2.last_rx_msg.header.size); - } - - NEW_TEST_CASE("Sample size sent to streaming > available samples"); - { - uint32_t ExpectedMaxSize; - msg_t tx_msg; - tx_msg.header.target = 2; - tx_msg.header.target_mode = SERVICEIDACK; - tx_msg.header.cmd = DEFAULT_CMD; - uint8_t Streaming_Buffer[Streaming_BUFFER_SIZE] = {0}; - streaming_channel_t streamChannel = Streaming_CreateChannel(Streaming_Buffer, Streaming_BUFFER_SIZE, 1); - - // Init default scenario context - Init_Context(); - - // Init variable - ExpectedMaxSize = 2; - - NEW_STEP("Verify 2 byte are received when we try to send 3 bytes"); - // Add samples - Streaming_AddAvailableSampleNB(&streamChannel, 2); - Luos_SendStreamingSize(default_sc.App_1.app, &tx_msg, &streamChannel, 3); - Luos_Loop(); - // Verify - TEST_ASSERT_EQUAL(ExpectedMaxSize, default_sc.App_2.last_rx_msg.header.size); - } - - NEW_TEST_CASE("Limit test"); - { - uint32_t ExpectedMaxSize; - msg_t tx_msg; - tx_msg.header.target = 2; - tx_msg.header.target_mode = SERVICEIDACK; - tx_msg.header.cmd = DEFAULT_CMD; - uint8_t Streaming_Buffer[Streaming_BUFFER_SIZE] = {0}; - streaming_channel_t streamChannel = Streaming_CreateChannel(Streaming_Buffer, Streaming_BUFFER_SIZE, 1); - - // Init default scenario context - Init_Context(); - - // Init variable test case - - NEW_STEP("Try to send 0 byte : it does nothing"); - - // Init variable new step - ExpectedMaxSize = 0; - tx_msg.header.target = 3; - - // Add samples - Streaming_AddAvailableSampleNB(&streamChannel, 2); - Luos_SendStreamingSize(default_sc.App_1.app, &tx_msg, &streamChannel, 0); - Luos_Loop(); - // Verify - TEST_ASSERT_EQUAL(ExpectedMaxSize, default_sc.App_3.last_rx_msg.header.size); - - NEW_STEP("try to send 128 byte the max size of a msg"); - - // Init variable - ExpectedMaxSize = 128; - tx_msg.header.target = 2; - - // Add samples - Streaming_AddAvailableSampleNB(&streamChannel, 128); - Luos_SendStreamingSize(default_sc.App_1.app, &tx_msg, &streamChannel, 128); - Luos_Loop(); - // Verify - TEST_ASSERT_EQUAL(ExpectedMaxSize, default_sc.App_2.last_rx_msg.header.size); - } -} - void unittest_Luos_ReceiveData() { NEW_TEST_CASE("Try to send a void message argument"); @@ -222,8 +104,6 @@ int main(int argc, char **argv) // Big data reception UNIT_TEST_RUN(unittest_Luos_ReceiveData); - // Streaming functions - UNIT_TEST_RUN(unittest_Luos_SendStreamingStreamingSize); UNITY_END(); } diff --git a/test/tests_core/test_streaming/main.c b/test/tests_core/test_streaming/main.c new file mode 100644 index 000000000..23aec6773 --- /dev/null +++ b/test/tests_core/test_streaming/main.c @@ -0,0 +1,715 @@ +#include "context.h" +#include "pub_sub.h" +#include +#include "unit_test.h" +#include +#include "filter.h" + +extern default_scenario_t default_sc; +streaming_channel_t rxchannel = {0}; + +static void MessageHandler(service_t *service, const msg_t *msg) +{ + if (msg->header.cmd == IO_STATE) + { + Luos_ReceiveStreaming(service, msg, &rxchannel); + } +} + +void unittest_Streaming_CreateChannel(void) +{ + uint8_t buffer[100]; + NEW_TEST_CASE("Test Streaming_CreateChannel assert conditions"); + { + TRY + { + // Test assert conditions + Streaming_CreateChannel(NULL, 100, 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + // Test assert conditions + Streaming_CreateChannel(buffer, 0, 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + // Test assert conditions + Streaming_CreateChannel(buffer, 100, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Test Streaming_CreateChannel"); + { + TRY + { + streaming_channel_t channel = {0}; + channel = Streaming_CreateChannel(buffer, 100, 1); + TEST_ASSERT_EQUAL(buffer, channel.data_ptr); + TEST_ASSERT_EQUAL(buffer, channel.ring_buffer); + TEST_ASSERT_EQUAL(1, channel.data_size); + TEST_ASSERT_EQUAL(100, channel.end_ring_buffer - channel.ring_buffer); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_Streaming_ResetChannel(void) +{ + uint8_t buffer[100]; + NEW_TEST_CASE("Test Streaming_ResetChannel assert conditions"); + { + TRY + { + // Test assert conditions + Streaming_ResetChannel(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Test Streaming_ResetChannel"); + { + TRY + { + streaming_channel_t channel = {0}; + channel = Streaming_CreateChannel(buffer, 100, 1); + channel.data_ptr = buffer + 10; + channel.sample_ptr = buffer + 30; + Streaming_ResetChannel(&channel); + TEST_ASSERT_EQUAL(buffer, channel.data_ptr); + TEST_ASSERT_EQUAL(buffer, channel.ring_buffer); + TEST_ASSERT_EQUAL(buffer, channel.sample_ptr); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_Streaming_PutSample(void) +{ + uint8_t buffer[100]; + streaming_channel_t channel = {0}; + channel = Streaming_CreateChannel(buffer, 100, 1); + NEW_TEST_CASE("Test Streaming_PutSample assert conditions"); + { + TRY + { + // Test assert conditions + Streaming_PutSample(NULL, buffer, 10); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + // Test assert conditions + Streaming_PutSample(&channel, NULL, 10); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + // Test assert conditions + Streaming_PutSample(&channel, buffer, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + // Test assert conditions + Streaming_PutSample(&channel, buffer, 101); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + // Test assert conditions + Streaming_PutSample(&channel, buffer, 100); + } + TEST_ASSERT_FALSE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Test Streaming_PutSample simple case"); + { + uint8_t data[3] = {10, 20, 30}; + TRY + { + TEST_ASSERT_EQUAL(1, Streaming_PutSample(&channel, data, 1)); + TEST_ASSERT_EQUAL(channel.ring_buffer + 1, channel.data_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer, channel.sample_ptr); + TEST_ASSERT_EQUAL(10, *(uint8_t *)(channel.sample_ptr)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + TRY + { + TEST_ASSERT_EQUAL(2, Streaming_PutSample(&channel, data + 1, 1)); + TEST_ASSERT_EQUAL(channel.ring_buffer + 2, channel.data_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer, channel.sample_ptr); + TEST_ASSERT_EQUAL(10, *(uint8_t *)(channel.sample_ptr)); + TEST_ASSERT_EQUAL(20, *(uint8_t *)(channel.sample_ptr + 1)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + TRY + { + TEST_ASSERT_EQUAL(4, Streaming_PutSample(&channel, data + 1, 2)); + TEST_ASSERT_EQUAL(channel.ring_buffer + 4, channel.data_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer, channel.sample_ptr); + TEST_ASSERT_EQUAL(10, *(uint8_t *)(channel.sample_ptr)); + TEST_ASSERT_EQUAL(20, *(uint8_t *)(channel.sample_ptr + 1)); + TEST_ASSERT_EQUAL(20, *(uint8_t *)(channel.sample_ptr + 2)); + TEST_ASSERT_EQUAL(30, *(uint8_t *)(channel.sample_ptr + 3)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Test Streaming_PutSample buffer loop case"); + { + uint8_t data[3] = {10, 20, 30}; + TRY + { + Streaming_ResetChannel(&channel); + channel.sample_ptr = channel.ring_buffer + 98; + channel.data_ptr = channel.ring_buffer + 98; + TEST_ASSERT_EQUAL(3, Streaming_PutSample(&channel, data, 3)); + TEST_ASSERT_EQUAL(30, buffer[0]); + TEST_ASSERT_EQUAL(10, buffer[98]); + TEST_ASSERT_EQUAL(20, buffer[99]); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_Streaming_GetSample(void) +{ + uint8_t buffer[100]; + streaming_channel_t channel = {0}; + channel = Streaming_CreateChannel(buffer, 100, 1); + NEW_TEST_CASE("Test Streaming_GetSample assert conditions"); + { + TRY + { + // Test assert conditions + Streaming_GetSample(NULL, buffer, 10); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + // Test assert conditions + Streaming_GetSample(&channel, NULL, 10); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + // Test assert conditions + Streaming_GetSample(&channel, buffer, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test Streaming_GetSample simple case"); + { + uint8_t data[3] = {10, 20, 30}; + uint8_t result[3]; + TRY + { + TEST_ASSERT_EQUAL(1, Streaming_PutSample(&channel, data, 1)); + TEST_ASSERT_EQUAL(channel.ring_buffer + 1, channel.data_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer, channel.sample_ptr); + TEST_ASSERT_EQUAL(10, *(uint8_t *)(channel.sample_ptr)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + TRY + { + TEST_ASSERT_EQUAL(0, Streaming_GetSample(&channel, result, 1)); + TEST_ASSERT_EQUAL(channel.ring_buffer + 1, channel.data_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer + 1, channel.sample_ptr); + TEST_ASSERT_EQUAL(10, result[0]); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + TRY + { + TEST_ASSERT_EQUAL(1, Streaming_PutSample(&channel, data + 1, 1)); + TEST_ASSERT_EQUAL(channel.ring_buffer + 2, channel.data_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer + 1, channel.sample_ptr); + TEST_ASSERT_EQUAL(20, *(uint8_t *)(channel.sample_ptr)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + TRY + { + TEST_ASSERT_EQUAL(0, Streaming_GetSample(&channel, result, 1)); + TEST_ASSERT_EQUAL(channel.ring_buffer + 2, channel.data_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer + 2, channel.sample_ptr); + TEST_ASSERT_EQUAL(20, result[0]); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + TRY + { + TEST_ASSERT_EQUAL(2, Streaming_PutSample(&channel, data + 1, 2)); + TEST_ASSERT_EQUAL(channel.ring_buffer + 4, channel.data_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer + 2, channel.sample_ptr); + TEST_ASSERT_EQUAL(20, *(uint8_t *)(channel.sample_ptr)); + TEST_ASSERT_EQUAL(30, *(uint8_t *)(channel.sample_ptr + 1)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + TRY + { + TEST_ASSERT_EQUAL(0, Streaming_GetSample(&channel, result, 2)); + TEST_ASSERT_EQUAL(channel.ring_buffer + 4, channel.data_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer + 4, channel.sample_ptr); + TEST_ASSERT_EQUAL(20, result[0]); + TEST_ASSERT_EQUAL(30, result[1]); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + NEW_TEST_CASE("Test Streaming_GetSample buffer loop case"); + { + uint8_t data[3] = {10, 20, 30}; + uint8_t result[2]; + TRY + { + Streaming_ResetChannel(&channel); + channel.sample_ptr = channel.ring_buffer + 98; + channel.data_ptr = channel.ring_buffer + 98; + TEST_ASSERT_EQUAL(3, Streaming_PutSample(&channel, data, 3)); + TEST_ASSERT_EQUAL(30, buffer[0]); + TEST_ASSERT_EQUAL(10, buffer[98]); + TEST_ASSERT_EQUAL(20, buffer[99]); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + TRY + { + TEST_ASSERT_EQUAL(0, Streaming_GetSample(&channel, result, 3)); + TEST_ASSERT_EQUAL(channel.ring_buffer + 1, channel.data_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer + 1, channel.sample_ptr); + TEST_ASSERT_EQUAL(10, result[0]); + TEST_ASSERT_EQUAL(20, result[1]); + TEST_ASSERT_EQUAL(30, result[2]); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + NEW_TEST_CASE("Test Streaming_GetSample no sample available"); + { + uint8_t data[3] = {10, 20, 30}; + uint8_t result[2]; + TRY + { + Streaming_ResetChannel(&channel); + TEST_ASSERT_EQUAL(0, Streaming_GetSample(&channel, result, 3)); + TEST_ASSERT_EQUAL(channel.ring_buffer, channel.data_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer, channel.sample_ptr); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_Streaming_GetAvailableSampleNB(void) +{ + uint8_t buffer[100]; + streaming_channel_t channel = {0}; + channel = Streaming_CreateChannel(buffer, 100, 1); + NEW_TEST_CASE("Test Streaming_GetAvailableSampleNB assert conditions"); + { + TRY + { + // Test assert conditions + Streaming_GetAvailableSampleNB(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test Streaming_GetAvailableSampleNB simple case"); + { + uint8_t data[3] = {10, 20, 30}; + TRY + { + TEST_ASSERT_EQUAL(0, Streaming_GetAvailableSampleNB(&channel)); + TEST_ASSERT_EQUAL(1, Streaming_PutSample(&channel, data, 1)); + TEST_ASSERT_EQUAL(1, Streaming_GetAvailableSampleNB(&channel)); + TEST_ASSERT_EQUAL(2, Streaming_PutSample(&channel, data + 1, 1)); + TEST_ASSERT_EQUAL(2, Streaming_GetAvailableSampleNB(&channel)); + TEST_ASSERT_EQUAL(4, Streaming_PutSample(&channel, data + 1, 2)); + TEST_ASSERT_EQUAL(4, Streaming_GetAvailableSampleNB(&channel)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + NEW_TEST_CASE("Test Streaming_GetAvailableSampleNB buffer loop case"); + { + uint8_t data[3] = {10, 20, 30}; + TRY + { + Streaming_ResetChannel(&channel); + channel.sample_ptr = channel.ring_buffer + 98; + channel.data_ptr = channel.ring_buffer + 98; + TEST_ASSERT_EQUAL(3, Streaming_PutSample(&channel, data, 3)); + TEST_ASSERT_EQUAL(3, Streaming_GetAvailableSampleNB(&channel)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_Streaming_GetAvailableSampleNBUntilEndBuffer(void) +{ + uint8_t buffer[100]; + streaming_channel_t channel = {0}; + channel = Streaming_CreateChannel(buffer, 100, 1); + NEW_TEST_CASE("Test Streaming_GetAvailableSampleNBUntilEndBuffer assert conditions"); + { + TRY + { + // Test assert conditions + Streaming_GetAvailableSampleNBUntilEndBuffer(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test Streaming_GetAvailableSampleNBUntilEndBuffer simple case"); + { + uint8_t data[3] = {10, 20, 30}; + TRY + { + TEST_ASSERT_EQUAL(0, Streaming_GetAvailableSampleNBUntilEndBuffer(&channel)); + TEST_ASSERT_EQUAL(1, Streaming_PutSample(&channel, data, 1)); + TEST_ASSERT_EQUAL(1, Streaming_GetAvailableSampleNBUntilEndBuffer(&channel)); + TEST_ASSERT_EQUAL(2, Streaming_PutSample(&channel, data + 1, 1)); + TEST_ASSERT_EQUAL(2, Streaming_GetAvailableSampleNBUntilEndBuffer(&channel)); + TEST_ASSERT_EQUAL(4, Streaming_PutSample(&channel, data + 1, 2)); + TEST_ASSERT_EQUAL(4, Streaming_GetAvailableSampleNBUntilEndBuffer(&channel)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + NEW_TEST_CASE("Test Streaming_GetAvailableSampleNBUntilEndBuffer buffer loop case"); + { + uint8_t data[3] = {10, 20, 30}; + TRY + { + Streaming_ResetChannel(&channel); + channel.sample_ptr = channel.ring_buffer + 98; + channel.data_ptr = channel.ring_buffer + 98; + TEST_ASSERT_EQUAL(3, Streaming_PutSample(&channel, data, 3)); + TEST_ASSERT_EQUAL(2, Streaming_GetAvailableSampleNBUntilEndBuffer(&channel)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_Streaming_AddAvailableSampleNB(void) +{ + uint8_t buffer[100]; + streaming_channel_t channel = {0}; + channel = Streaming_CreateChannel(buffer, 100, 1); + NEW_TEST_CASE("Test Streaming_AddAvailableSampleNB assert conditions"); + { + TRY + { + // Test assert conditions + Streaming_AddAvailableSampleNB(NULL, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + // Test assert conditions + Streaming_AddAvailableSampleNB(&channel, 101); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test Streaming_AddAvailableSampleNB simple case"); + { + uint8_t data[3] = {10, 20, 30}; + TRY + { + TEST_ASSERT_EQUAL(0, Streaming_AddAvailableSampleNB(&channel, 0)); + TEST_ASSERT_EQUAL(1, Streaming_AddAvailableSampleNB(&channel, 1)); + TEST_ASSERT_EQUAL(2, Streaming_AddAvailableSampleNB(&channel, 1)); + TEST_ASSERT_EQUAL(4, Streaming_AddAvailableSampleNB(&channel, 2)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + NEW_TEST_CASE("Test Streaming_AddAvailableSampleNB buffer loop case"); + { + uint8_t buffer[100]; + streaming_channel_t channel = {0}; + channel = Streaming_CreateChannel(buffer, 100, 1); + uint8_t data[3] = {10, 20, 30}; + TRY + { + Streaming_ResetChannel(&channel); + channel.sample_ptr = channel.ring_buffer + 98; + channel.data_ptr = channel.ring_buffer + 98; + TEST_ASSERT_EQUAL(2, Streaming_AddAvailableSampleNB(&channel, 2)); + TEST_ASSERT_EQUAL(channel.ring_buffer + 98, channel.sample_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer, channel.data_ptr); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + TRY + { + Streaming_ResetChannel(&channel); + channel.sample_ptr = channel.ring_buffer + 98; + channel.data_ptr = channel.ring_buffer + 98; + TEST_ASSERT_EQUAL(3, Streaming_AddAvailableSampleNB(&channel, 3)); + TEST_ASSERT_EQUAL(channel.ring_buffer + 98, channel.sample_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer + 1, channel.data_ptr); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_Streaming_RmvAvailableSampleNB(void) +{ + uint8_t buffer[100]; + streaming_channel_t channel = {0}; + channel = Streaming_CreateChannel(buffer, 100, 1); + NEW_TEST_CASE("Test Streaming_RmvAvailableSampleNB assert conditions"); + { + TRY + { + // Test assert conditions + Streaming_RmvAvailableSampleNB(NULL, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + // Test assert conditions + Streaming_RmvAvailableSampleNB(&channel, 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test Streaming_RmvAvailableSampleNB simple case"); + { + uint8_t data[3] = {10, 20, 30}; + TRY + { + TEST_ASSERT_EQUAL(0, Streaming_RmvAvailableSampleNB(&channel, 0)); + TEST_ASSERT_EQUAL(1, Streaming_AddAvailableSampleNB(&channel, 1)); + TEST_ASSERT_EQUAL(0, Streaming_RmvAvailableSampleNB(&channel, 1)); + TEST_ASSERT_EQUAL(2, Streaming_AddAvailableSampleNB(&channel, 2)); + TEST_ASSERT_EQUAL(0, Streaming_RmvAvailableSampleNB(&channel, 2)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + NEW_TEST_CASE("Test Streaming_RmvAvailableSampleNB buffer loop case"); + { + TRY + { + Streaming_ResetChannel(&channel); + channel.sample_ptr = channel.ring_buffer + 98; + channel.data_ptr = channel.ring_buffer + 98; + TEST_ASSERT_EQUAL(3, Streaming_AddAvailableSampleNB(&channel, 3)); + TEST_ASSERT_EQUAL(0, Streaming_RmvAvailableSampleNB(&channel, 3)); + TEST_ASSERT_EQUAL(channel.ring_buffer + 1, channel.sample_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer + 1, channel.data_ptr); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + TRY + { + Streaming_ResetChannel(&channel); + channel.sample_ptr = channel.ring_buffer + 98; + channel.data_ptr = channel.ring_buffer + 98; + TEST_ASSERT_EQUAL(2, Streaming_AddAvailableSampleNB(&channel, 2)); + TEST_ASSERT_EQUAL(0, Streaming_RmvAvailableSampleNB(&channel, 2)); + TEST_ASSERT_EQUAL(channel.ring_buffer, channel.sample_ptr); + TEST_ASSERT_EQUAL(channel.ring_buffer, channel.data_ptr); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_Luos_Send_and_receive_Streaming(void) +{ + uint8_t buffer[200]; + uint8_t rxbuffer[200]; + streaming_channel_t channel = {0}; + channel = Streaming_CreateChannel(buffer, 200, 1); + rxchannel = Streaming_CreateChannel(buffer, 200, 1); + Init_Context(); + NEW_TEST_CASE("Test Luos_SendStreamingSize assert conditions"); + { + msg_t msg; + TRY + { + // Test assert conditions + Luos_SendStreamingSize(NULL, &msg, &channel, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + // Test assert conditions + Luos_SendStreamingSize(default_sc.App_1.app, NULL, &channel, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + // Test assert conditions + Luos_SendStreamingSize(default_sc.App_1.app, &msg, NULL, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + // Test assert conditions + Luos_ReceiveStreaming(NULL, &msg, &channel); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + // Test assert conditions + Luos_ReceiveStreaming(default_sc.App_1.app, NULL, &channel); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + // Test assert conditions + Luos_ReceiveStreaming(default_sc.App_1.app, &msg, NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test send receive streaming"); + { + revision_t revision = {.major = 1, .minor = 0, .build = 0}; + service_t *service = Luos_CreateService(MessageHandler, VOID_TYPE, "Test_App", revision); + // Detection + Luos_Detect(service); + do + { + Luos_Loop(); + } while (!Luos_IsDetected()); + msg_t msg; + msg.header.target = service->id; + msg.header.target_mode = SERVICEIDACK; + msg.header.cmd = IO_STATE; + TRY + { + TEST_ASSERT_EQUAL(1, Streaming_AddAvailableSampleNB(&channel, 1)); + Luos_SendStreamingSize(default_sc.App_1.app, &msg, &channel, 1); + Luos_Loop(); + TEST_ASSERT_EQUAL(1, Streaming_GetAvailableSampleNB(&rxchannel)); + + TEST_ASSERT_EQUAL(2, Streaming_AddAvailableSampleNB(&channel, 2)); + Luos_SendStreamingSize(default_sc.App_1.app, &msg, &channel, 2); + Luos_Loop(); + TEST_ASSERT_EQUAL(3, Streaming_GetAvailableSampleNB(&rxchannel)); + + TEST_ASSERT_EQUAL(150, Streaming_AddAvailableSampleNB(&channel, 150)); + Luos_SendStreamingSize(default_sc.App_1.app, &msg, &channel, 150); + Luos_Loop(); + TEST_ASSERT_EQUAL(153, Streaming_GetAvailableSampleNB(&rxchannel)); + + // Check buffer loop + Streaming_RmvAvailableSampleNB(&rxchannel, 153); + TEST_ASSERT_EQUAL(150, Streaming_AddAvailableSampleNB(&channel, 150)); + Luos_SendStreamingSize(default_sc.App_1.app, &msg, &channel, 150); + Luos_Loop(); + TEST_ASSERT_EQUAL(150, Streaming_GetAvailableSampleNB(&rxchannel)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +int main(int argc, char **argv) +{ + UNITY_BEGIN(); + + UNIT_TEST_RUN(unittest_Streaming_CreateChannel); + UNIT_TEST_RUN(unittest_Streaming_ResetChannel); + UNIT_TEST_RUN(unittest_Streaming_PutSample); + UNIT_TEST_RUN(unittest_Streaming_GetSample); + UNIT_TEST_RUN(unittest_Streaming_GetAvailableSampleNB); + UNIT_TEST_RUN(unittest_Streaming_GetAvailableSampleNBUntilEndBuffer); + UNIT_TEST_RUN(unittest_Streaming_AddAvailableSampleNB); + UNIT_TEST_RUN(unittest_Streaming_RmvAvailableSampleNB); + UNIT_TEST_RUN(unittest_Luos_Send_and_receive_Streaming); + + UNITY_END(); +} From 1953b6556603e23b26f8a80c982131d9aef64ed0 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 1 Jun 2023 11:17:02 +0200 Subject: [PATCH 064/150] Add service unit test --- engine/core/src/service.c | 18 +- test/tests_core/test_service/main.c | 546 ++++++++++++++++++++++++++++ 2 files changed, 558 insertions(+), 6 deletions(-) create mode 100644 test/tests_core/test_service/main.c diff --git a/engine/core/src/service.c b/engine/core/src/service.c index 04e5c695e..2abbb0f6f 100644 --- a/engine/core/src/service.c +++ b/engine/core/src/service.c @@ -75,7 +75,7 @@ void Service_ResetStatistics(void) } /****************************************************************************** - * @brief API to generate a service ID + * @brief API to generate all service ID * @param baseId : base ID of the services, this value will be increased for eeach services * @return None ******************************************************************************/ @@ -119,7 +119,7 @@ void Service_ClearId(void) uint16_t Service_GetIndex(service_t *service) { LUOS_ASSERT((service >= service_ctx.list) && (service < &service_ctx.list[service_ctx.number])); - return (service - service_ctx.list) / sizeof(service_t); + return ((uintptr_t)service - (uintptr_t)service_ctx.list) / sizeof(service_t); } /****************************************************************************** @@ -139,6 +139,7 @@ void Service_RmAutoUpdateTarget(uint16_t service_id) } } } + /****************************************************************************** * @brief Auto update call for services * @param none @@ -146,7 +147,7 @@ void Service_RmAutoUpdateTarget(uint16_t service_id) ******************************************************************************/ void Service_AutoUpdateManager(void) { - // check all services timed_update_t contexts + // Check all services timed_update_t contexts for (uint16_t i = 0; i < service_ctx.number; i++) { // check if services have an actual ID. If not, we are in detection mode and should reset the auto refresh @@ -281,6 +282,7 @@ error_return_t Service_Deliver(phy_job_t *job) ******************************************************************************/ service_filter_t Service_GetFilter(const msg_t *msg) { + LUOS_ASSERT(msg); uint16_t i = 0; service_filter_t filter = 0; @@ -400,14 +402,14 @@ service_t *Luos_CreateService(SERVICE_CB service_cb, uint8_t type, const char *a } /****************************************************************************** - * @brief Store alias name service in flash - * @param service : Service to store + * @brief Change a service alias name (this name is not persistent, please check How to have flexible and resilient aliases => https://www.luos.io/tutorials/resilient-alias) + * @param service : Service to store the alias in * @param alias : Alias to store * @return SUCCEED : If the alias is correctly updated ******************************************************************************/ error_return_t Luos_UpdateAlias(service_t *service, const char *alias, uint16_t size) { - + LUOS_ASSERT(service && alias); if ((size == 0) || (alias[0] == '\0')) { // This is a void alias just replace it with the default alias, write it @@ -440,6 +442,10 @@ error_return_t Luos_UpdateAlias(service_t *service, const char *alias, uint16_t case ' ': clean_alias[i] = '_'; break; + case '\0': + // This is the end of the string + size = i + 1; + break; default: // This is a wrong character, don't do anything and return FAILED return FAILED; diff --git a/test/tests_core/test_service/main.c b/test/tests_core/test_service/main.c new file mode 100644 index 000000000..b0c768919 --- /dev/null +++ b/test/tests_core/test_service/main.c @@ -0,0 +1,546 @@ +#include "service.h" +#include "service.c" +#include +#include "unit_test.h" +#include + +extern default_scenario_t default_sc; + +void unittest_Service_Init(void) +{ + uint8_t buffer[100]; + NEW_TEST_CASE("Test Service_Init"); + { + TRY + { + service_ctx.number = 10; + Service_Init(); + TEST_ASSERT_EQUAL(0, service_ctx.number); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Service_GetTable(void) +{ + NEW_TEST_CASE("Test Service_GetTable"); + { + TRY + { + TEST_ASSERT_EQUAL(service_ctx.list, Service_GetTable()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Service_GetNumber(void) +{ + NEW_TEST_CASE("Test Service_GetNumber"); + { + TRY + { + TEST_ASSERT_EQUAL(service_ctx.number, Service_GetNumber()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Service_ResetStatistics(void) +{ + NEW_TEST_CASE("Test Service_ResetStatistics"); + { + TRY + { + service_ctx.number = 10; + service_ctx.list[0].statistics.max_retry = 5; + service_ctx.list[9].statistics.max_retry = 9; + Service_ResetStatistics(); + TEST_ASSERT_EQUAL(0, service_ctx.list[0].statistics.max_retry); + TEST_ASSERT_EQUAL(0, service_ctx.list[9].statistics.max_retry); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Service_GenerateId(void) +{ + NEW_TEST_CASE("Test Service_GenerateId assert conditions"); + TRY + { + Service_GenerateId(0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + NEW_TEST_CASE("Test Service_GenerateId"); + { + TRY + { + service_ctx.number = 10; + Service_GenerateId(1); // This is a special case, because detector already saved his ID so the first id will be 2 + for (uint16_t i = 0; i < service_ctx.number; i++) + { + if (service_ctx.list[i].id != 1) + { + TEST_ASSERT_EQUAL(i + 2, service_ctx.list[i].id); + } + } + + // Force the first one to have id 1 + service_ctx.list[0].id = 1; + Service_GenerateId(1); // This is a special case, because detector already saved his ID so the first id will be 2 + for (uint16_t i = 0; i < service_ctx.number; i++) + { + if (service_ctx.list[i].id != 1) + { + TEST_ASSERT_EQUAL(i + 1, service_ctx.list[i].id); + } + } + + service_ctx.list[0].id = 0; + Service_GenerateId(5); + for (uint16_t i = 0; i < service_ctx.number; i++) + { + if (service_ctx.list[i].id != 1) + { + TEST_ASSERT_EQUAL(i + 5, service_ctx.list[i].id); + } + } + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Service_ClearId(void) +{ + NEW_TEST_CASE("Test Service_ClearId"); + { + TRY + { + service_ctx.number = 10; + for (uint16_t i = 0; i < service_ctx.number; i++) + { + service_ctx.list[i].id = i + 1; + } + Service_ClearId(); + for (uint16_t i = 0; i < service_ctx.number; i++) + { + TEST_ASSERT_EQUAL(0, service_ctx.list[i].id); + } + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Service_GetIndex(void) +{ + + NEW_TEST_CASE("Test Service_GetIndex assert conditions"); + { + TRY + { + + service_ctx.number = 10; + Service_GetIndex(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + + service_ctx.number = 10; + Service_GetIndex(service_ctx.list - 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + service_ctx.number = 10; + Service_GetIndex(&service_ctx.list[11]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test Service_GetIndex"); + { + TRY + { + service_ctx.number = 10; + TEST_ASSERT_EQUAL(0, Service_GetIndex(&service_ctx.list[0])); + TEST_ASSERT_EQUAL(1, Service_GetIndex(&service_ctx.list[1])); + TEST_ASSERT_EQUAL(2, Service_GetIndex(&service_ctx.list[2])); + TEST_ASSERT_EQUAL(3, Service_GetIndex(&service_ctx.list[3])); + TEST_ASSERT_EQUAL(4, Service_GetIndex(&service_ctx.list[4])); + TEST_ASSERT_EQUAL(5, Service_GetIndex(&service_ctx.list[5])); + TEST_ASSERT_EQUAL(6, Service_GetIndex(&service_ctx.list[6])); + TEST_ASSERT_EQUAL(7, Service_GetIndex(&service_ctx.list[7])); + TEST_ASSERT_EQUAL(8, Service_GetIndex(&service_ctx.list[8])); + TEST_ASSERT_EQUAL(9, Service_GetIndex(&service_ctx.list[9])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Service_RmAutoUpdateTarget(void) +{ + NEW_TEST_CASE("Test Service_RmAutoUpdateTarget"); + { + TRY + { + service_ctx.number = 10; + service_ctx.list[2].auto_refresh.target = 2; + service_ctx.list[2].auto_refresh.time_ms = 20; + service_ctx.list[2].auto_refresh.last_update = 30; + Service_RmAutoUpdateTarget(2); + TEST_ASSERT_EQUAL(0, service_ctx.list[2].auto_refresh.target); + TEST_ASSERT_EQUAL(0, service_ctx.list[2].auto_refresh.time_ms); + TEST_ASSERT_EQUAL(0, service_ctx.list[2].auto_refresh.last_update); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Service_AutoUpdateManager(void) +{ + NEW_TEST_CASE("Test Service_AutoUpdateManager"); + { + TRY + { + // Init default scenario context + Init_Context(); + Luos_Loop(); + service_ctx.list[2].auto_refresh.target = 1; + service_ctx.list[2].auto_refresh.time_ms = 10; + service_ctx.list[2].auto_refresh.last_update = 30; + Service_AutoUpdateManager(); + TEST_ASSERT_NOT_EQUAL(30, service_ctx.list[2].auto_refresh.last_update); + TEST_ASSERT_EQUAL(GET_CMD, default_sc.App_3.last_rx_msg.header.cmd); + TEST_ASSERT_EQUAL(1, default_sc.App_3.last_rx_msg.header.source); + TEST_ASSERT_EQUAL(3, default_sc.App_3.last_rx_msg.header.target); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Service_GetConcerned(void) +{ + NEW_TEST_CASE("Test Service_GetConcerned assert conditions"); + { + TRY + { + Service_GetConcerned(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test Service_GetConcerned"); + { + TRY + { + header_t header; + header.target_mode = SERVICEIDACK; + header.target = default_sc.App_3.app->id; + header.source = default_sc.App_2.app->id; + TEST_ASSERT_EQUAL(default_sc.App_3.app, Service_GetConcerned(&header)); + + header.target_mode = SERVICEID; + header.target = default_sc.App_3.app->id; + header.source = default_sc.App_2.app->id; + TEST_ASSERT_EQUAL(default_sc.App_3.app, Service_GetConcerned(&header)); + + header.target_mode = TYPE; + header.target = default_sc.App_3.app->type; + header.source = default_sc.App_2.app->id; + // It will be the first service because all type are the same... + TEST_ASSERT_EQUAL(default_sc.App_1.app, Service_GetConcerned(&header)); + + header.target_mode = BROADCAST; + header.target = default_sc.App_3.app->id; + header.source = default_sc.App_2.app->id; + TEST_ASSERT_EQUAL(default_sc.App_1.app, Service_GetConcerned(&header)); + + header.target_mode = NODEIDACK; + header.target = default_sc.App_3.app->id; + header.source = default_sc.App_2.app->id; + TEST_ASSERT_EQUAL(default_sc.App_1.app, Service_GetConcerned(&header)); + + header.target_mode = NODEID; + header.target = default_sc.App_3.app->id; + header.source = default_sc.App_2.app->id; + TEST_ASSERT_EQUAL(default_sc.App_1.app, Service_GetConcerned(&header)); + + header.target_mode = TOPIC; + header.target = default_sc.App_3.app->id; + header.source = default_sc.App_2.app->id; + TEST_ASSERT_EQUAL(NULL, Service_GetConcerned(&header)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Service_GetFilter(void) +{ + NEW_TEST_CASE("Test Service_GetFilter assert conditions"); + { + TRY + { + Service_GetFilter(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test Service_GetFilter"); + { + TRY + { + msg_t msg; + msg.header.target_mode = SERVICEIDACK; + msg.header.target = default_sc.App_3.app->id; + TEST_ASSERT_EQUAL(0b00000100, Service_GetFilter(&msg)); + + msg.header.target_mode = SERVICEID; + msg.header.target = default_sc.App_3.app->id; + TEST_ASSERT_EQUAL(0b00000100, Service_GetFilter(&msg)); + + msg.header.target_mode = TYPE; + msg.header.target = default_sc.App_3.app->type; + // It will be the first service because all type are the same... + TEST_ASSERT_EQUAL(0b00000111, Service_GetFilter(&msg)); + + msg.header.target_mode = BROADCAST; + msg.header.target = default_sc.App_3.app->id; + TEST_ASSERT_EQUAL(0b00000111, Service_GetFilter(&msg)); + + msg.header.target_mode = NODEIDACK; + msg.header.target = 1; + TEST_ASSERT_EQUAL(0b00000111, Service_GetFilter(&msg)); + + msg.header.target_mode = NODEID; + msg.header.target = 1; + TEST_ASSERT_EQUAL(0b00000111, Service_GetFilter(&msg)); + + msg.header.target_mode = TOPIC; + msg.header.target = default_sc.App_3.app->id; + TEST_ASSERT_EQUAL(0b00000000, Service_GetFilter(&msg)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Service_Deliver(void) +{ + NEW_TEST_CASE("Test Service_Deliver assert conditions"); + { + TRY + { + Service_Deliver(NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test Service_Deliver"); + { + TRY + { + // Init default scenario context + Init_Context(); + Luos_Loop(); + // Send a message to the service + phy_job_t job; + msg_t msg; + msg.header.target_mode = NODEID; + msg.header.target = 1; + msg.header.source = 4; + msg.header.cmd = GET_CMD; + msg.header.size = 0; + job.msg_pt = &msg; + + service_filter_t filter = Service_GetFilter(&msg); + TEST_ASSERT_EQUAL(0b00000111, filter); + job.phy_data = &filter; + TEST_ASSERT_EQUAL(SUCCEED, Service_Deliver(&job)); + // All services consume this message + TEST_ASSERT_EQUAL(0b00000000, filter); + // Check that all services received the message + TEST_ASSERT_EQUAL(4, default_sc.App_1.last_rx_msg.header.source); + TEST_ASSERT_EQUAL(4, default_sc.App_2.last_rx_msg.header.source); + TEST_ASSERT_EQUAL(4, default_sc.App_3.last_rx_msg.header.source); + + // Add a new service with no callback + revision_t revision = {.major = 1, .minor = 0, .build = 0}; + default_sc.App_1.app = Luos_CreateService(NULL, VOID_TYPE, "Test_App", revision); + Luos_Detect(default_sc.App_1.app); + do + { + Luos_Loop(); + } while (!Luos_IsDetected()); + + filter = Service_GetFilter(&msg); + TEST_ASSERT_EQUAL(0b00001111, filter); + job.phy_data = &filter; + TEST_ASSERT_EQUAL(FAILED, Service_Deliver(&job)); + // All services consume this message + TEST_ASSERT_EQUAL(0b00001000, filter); + // Check that all services received the message + TEST_ASSERT_EQUAL(4, default_sc.App_1.last_rx_msg.header.source); + TEST_ASSERT_EQUAL(4, default_sc.App_2.last_rx_msg.header.source); + TEST_ASSERT_EQUAL(4, default_sc.App_3.last_rx_msg.header.source); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Luos_UpdateAlias(void) +{ + NEW_TEST_CASE("Test Luos_UpdateAlias assert conditions"); + { + Init_Context(); + Luos_Loop(); + char new_alias[16] = "new_alias"; + TRY + { + Luos_UpdateAlias(NULL, new_alias, 16); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + Luos_UpdateAlias(default_sc.App_1.app, NULL, 16); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test Luos_UpdateAlias"); + { + Init_Context(); + Luos_Loop(); + char new_alias[40] = "new_alias1"; + TRY + { + TEST_ASSERT_EQUAL(SUCCEED, Luos_UpdateAlias(default_sc.App_1.app, new_alias, 16)); + TEST_ASSERT_EQUAL_STRING(new_alias, default_sc.App_1.app->alias); + + strcpy(new_alias, "new alias"); + TEST_ASSERT_EQUAL(SUCCEED, Luos_UpdateAlias(default_sc.App_1.app, new_alias, strlen(new_alias))); + TEST_ASSERT_EQUAL_STRING("new_alias", default_sc.App_1.app->alias); + + strcpy(new_alias, "new_alias!"); + TEST_ASSERT_EQUAL(FAILED, Luos_UpdateAlias(default_sc.App_1.app, new_alias, strlen(new_alias))); + TEST_ASSERT_EQUAL_STRING("new_alias", default_sc.App_1.app->alias); + + strcpy(new_alias, "new_alias_with_a_very_long_size"); + TEST_ASSERT_EQUAL(SUCCEED, Luos_UpdateAlias(default_sc.App_1.app, new_alias, strlen(new_alias))); + TEST_ASSERT_EQUAL_STRING("new_alias_with_", default_sc.App_1.app->alias); + + strcpy(new_alias, "new_alias"); + TEST_ASSERT_EQUAL(SUCCEED, Luos_UpdateAlias(default_sc.App_1.app, new_alias, 0)); + TEST_ASSERT_EQUAL_STRING(default_sc.App_1.app->default_alias, default_sc.App_1.app->alias); + + strcpy(new_alias, "new_alias"); + TEST_ASSERT_EQUAL(SUCCEED, Luos_UpdateAlias(default_sc.App_1.app, new_alias, strlen(new_alias))); + TEST_ASSERT_EQUAL_STRING("new_alias", default_sc.App_1.app->alias); + + new_alias[0] = '\0'; + TEST_ASSERT_EQUAL(SUCCEED, Luos_UpdateAlias(default_sc.App_1.app, new_alias, 16)); + TEST_ASSERT_EQUAL_STRING(default_sc.App_1.app->default_alias, default_sc.App_1.app->alias); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Luos_ServicesClear(void) +{ + NEW_TEST_CASE("Test Luos_ServicesClear"); + { + Init_Context(); + Luos_Loop(); + TRY + { + Luos_ServicesClear(); + TEST_ASSERT_EQUAL(0, service_ctx.number); + TEST_ASSERT_EQUAL(0, service_ctx.list[0].id); + TEST_ASSERT_EQUAL(0, service_ctx.list[3].id); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +int main(int argc, char **argv) +{ + UNITY_BEGIN(); + + UNIT_TEST_RUN(unittest_Service_Init); + UNIT_TEST_RUN(unittest_Service_GetTable); + UNIT_TEST_RUN(unittest_Service_GetNumber); + UNIT_TEST_RUN(unittest_Service_ResetStatistics); + UNIT_TEST_RUN(unittest_Service_GenerateId); + UNIT_TEST_RUN(unittest_Service_ClearId); + UNIT_TEST_RUN(unittest_Service_GetIndex); + UNIT_TEST_RUN(unittest_Service_RmAutoUpdateTarget); + UNIT_TEST_RUN(unittest_Service_AutoUpdateManager); + UNIT_TEST_RUN(unittest_Service_GetConcerned); + UNIT_TEST_RUN(unittest_Service_GetFilter); + UNIT_TEST_RUN(unittest_Service_Deliver); + UNIT_TEST_RUN(unittest_Luos_UpdateAlias); + UNIT_TEST_RUN(unittest_Luos_ServicesClear); + + UNITY_END(); +} From 02b1f2ac9a35ca8abae0135693e11fe8bbf4c223 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 1 Jun 2023 16:02:44 +0200 Subject: [PATCH 065/150] Add node unit test --- engine/core/inc/node.h | 6 +- engine/core/src/node.c | 10 +- test/tests_core/test_node/main.c | 180 +++++++++++++++++++++++++++++++ 3 files changed, 189 insertions(+), 7 deletions(-) create mode 100644 test/tests_core/test_node/main.c diff --git a/engine/core/inc/node.h b/engine/core/inc/node.h index 60549ac06..34ccb0708 100644 --- a/engine/core/inc/node.h +++ b/engine/core/inc/node.h @@ -6,6 +6,10 @@ ******************************************************************************/ #ifndef __NODE_H_ #define __NODE_H_ + +#include +#include "engine_config.h" + /******************************************************************************* * Definitions ******************************************************************************/ @@ -48,4 +52,4 @@ node_t *Node_Get(void); node_state_t Node_GetState(void); void Node_SetState(node_state_t); -#endif /* __NODE_H_ */ \ No newline at end of file +#endif /* __NODE_H_ */ diff --git a/engine/core/src/node.c b/engine/core/src/node.c index 491161c32..d51283fbc 100644 --- a/engine/core/src/node.c +++ b/engine/core/src/node.c @@ -79,7 +79,7 @@ void Node_Loop(void) // if timeout is reached, go back to link-down state if (Luos_GetSystick() - node_ctx.timeout > DETECTION_TIMEOUT_MS) { - node_ctx.state = NO_DETECTION; + Node_SetState(NO_DETECTION); } } } @@ -90,11 +90,12 @@ void Node_Loop(void) * @return None * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL inline void Node_SetState(node_state_t state) +void Node_SetState(node_state_t state) { switch (state) { case NO_DETECTION: + case DETECTION_OK: node_ctx.timeout_run = false; node_ctx.timeout = 0; break; @@ -103,11 +104,8 @@ _CRITICAL inline void Node_SetState(node_state_t state) node_ctx.timeout_run = true; node_ctx.timeout = Luos_GetSystick(); break; - case DETECTION_OK: - node_ctx.timeout_run = false; - node_ctx.timeout = 0; - break; default: + LUOS_ASSERT(false); break; } node_ctx.state = state; diff --git a/test/tests_core/test_node/main.c b/test/tests_core/test_node/main.c new file mode 100644 index 000000000..161c87da7 --- /dev/null +++ b/test/tests_core/test_node/main.c @@ -0,0 +1,180 @@ +#include "node.c" +#include +#include "unit_test.h" +#include + +extern default_scenario_t default_sc; + +void unittest_Node_Get(void) +{ + NEW_TEST_CASE("Test Node_Get"); + { + TRY + { + TEST_ASSERT_EQUAL(&node_ctx.info, Node_Get()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Node_GetState(void) +{ + NEW_TEST_CASE("Test Node_GetState"); + { + TRY + { + TEST_ASSERT_EQUAL(node_ctx.state, Node_GetState()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Node_Init(void) +{ + NEW_TEST_CASE("Test Node_Init"); + { + TRY + { + node_ctx.info.node_id = 10; + node_ctx.info.certified = true; + node_ctx.info.node_info = 1; + node_ctx.timeout_run = true; + node_ctx.timeout = 1; + Node_Init(); + TEST_ASSERT_EQUAL(DEFAULTID, node_ctx.info.node_id); + TEST_ASSERT_EQUAL(false, node_ctx.info.certified); + TEST_ASSERT_EQUAL(0, node_ctx.info.node_info); + TEST_ASSERT_EQUAL(false, node_ctx.timeout_run); + TEST_ASSERT_EQUAL(0, node_ctx.timeout); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Node_SetState(void) +{ + NEW_TEST_CASE("Test Node_SetState assert condition"); + { + TRY + { + Node_SetState(EXTERNAL_DETECTION + 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test Node_SetState"); + { + TRY + { + + node_ctx.state = LOCAL_DETECTION; + node_ctx.timeout_run = false; + node_ctx.timeout = 1; + Node_SetState(NO_DETECTION); + TEST_ASSERT_EQUAL(0, node_ctx.timeout); + TEST_ASSERT_EQUAL(false, node_ctx.timeout_run); + TEST_ASSERT_EQUAL(NO_DETECTION, node_ctx.state); + + node_ctx.state = LOCAL_DETECTION; + node_ctx.timeout_run = false; + node_ctx.timeout = 1; + Node_SetState(DETECTION_OK); + TEST_ASSERT_EQUAL(0, node_ctx.timeout); + TEST_ASSERT_EQUAL(false, node_ctx.timeout_run); + TEST_ASSERT_EQUAL(DETECTION_OK, node_ctx.state); + + node_ctx.state = NO_DETECTION; + node_ctx.timeout_run = true; + node_ctx.timeout = 1; + Node_SetState(LOCAL_DETECTION); + TEST_ASSERT_NOT_EQUAL(0, node_ctx.timeout); + TEST_ASSERT_EQUAL(true, node_ctx.timeout_run); + TEST_ASSERT_EQUAL(LOCAL_DETECTION, node_ctx.state); + + node_ctx.state = NO_DETECTION; + node_ctx.timeout_run = true; + node_ctx.timeout = 1; + Node_SetState(EXTERNAL_DETECTION); + TEST_ASSERT_NOT_EQUAL(0, node_ctx.timeout); + TEST_ASSERT_EQUAL(true, node_ctx.timeout_run); + TEST_ASSERT_EQUAL(EXTERNAL_DETECTION, node_ctx.state); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Node_Loop(void) +{ + NEW_TEST_CASE("Test Node_Loop"); + { + TRY + { + node_ctx.state = LOCAL_DETECTION; + node_ctx.timeout_run = true; + node_ctx.timeout = 1; + // wait some time to trigger the timeout condition + while (Luos_GetSystick() - node_ctx.timeout <= DETECTION_TIMEOUT_MS) + ; + Node_Loop(); + TEST_ASSERT_EQUAL(0, node_ctx.timeout); + TEST_ASSERT_EQUAL(false, node_ctx.timeout_run); + TEST_ASSERT_EQUAL(NO_DETECTION, node_ctx.state); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Luos_IsDetected(void) +{ + NEW_TEST_CASE("Test Luos_IsDetected"); + TRY + { + node_ctx.state = NO_DETECTION; + TEST_ASSERT_EQUAL(false, Luos_IsDetected()); + node_ctx.state = LOCAL_DETECTION; + TEST_ASSERT_EQUAL(false, Luos_IsDetected()); + node_ctx.state = EXTERNAL_DETECTION; + TEST_ASSERT_EQUAL(false, Luos_IsDetected()); + node_ctx.state = DETECTION_OK; + TEST_ASSERT_EQUAL(true, Luos_IsDetected()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; +} + +int main(int argc, char **argv) +{ + UNITY_BEGIN(); + + UNIT_TEST_RUN(unittest_Node_Get); + UNIT_TEST_RUN(unittest_Node_GetState); + UNIT_TEST_RUN(unittest_Node_Init); + UNIT_TEST_RUN(unittest_Node_SetState); + UNIT_TEST_RUN(unittest_Node_Loop); + UNIT_TEST_RUN(unittest_Luos_IsDetected); + + UNITY_END(); +} From b157634021694ee67fb18c8180d0ae2ef002bf2e Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 1 Jun 2023 16:03:28 +0200 Subject: [PATCH 066/150] Remove unused Luos_SetFilterState function --- engine/core/inc/luos_engine.h | 1 - engine/core/src/node.c | 12 ------------ tool_services/inspector/data_manager.c | 4 ++-- tool_services/inspector/inspector.c | 2 +- 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/engine/core/inc/luos_engine.h b/engine/core/inc/luos_engine.h index 0f3474d57..707cc218e 100644 --- a/engine/core/inc/luos_engine.h +++ b/engine/core/inc/luos_engine.h @@ -34,7 +34,6 @@ const revision_t *Luos_GetVersion(void); // ***************** Node management ***************** uint32_t Luos_GetSystick(void); bool Luos_IsDetected(void); -void Luos_SetFilterState(uint8_t state, service_t *service); // ***************** Package management ***************** void Luos_AddPackage(void (*Init)(void), void (*Loop)(void)); diff --git a/engine/core/src/node.c b/engine/core/src/node.c index d51283fbc..fe8f2cee0 100644 --- a/engine/core/src/node.c +++ b/engine/core/src/node.c @@ -130,15 +130,3 @@ bool Luos_IsDetected(void) { return (node_ctx.state == DETECTION_OK); } - -/****************************************************************************** - * @brief Function that changes the filter value - * @param state : Put to "1" if we want to disable the filter , "0" to enable - * @param service - * @return None - ******************************************************************************/ -void Luos_SetFilterState(uint8_t state, service_t *service) -{ - // Enable or disable the filter for a given service - // This function have been disabled since 3.0.0 -} \ No newline at end of file diff --git a/tool_services/inspector/data_manager.c b/tool_services/inspector/data_manager.c index a290e3154..97d610cea 100644 --- a/tool_services/inspector/data_manager.c +++ b/tool_services/inspector/data_manager.c @@ -94,13 +94,13 @@ void DataManager_GetPipeMsg(service_t *service, msg_t *data_msg) if (data_msg->data[7] == true) { // check if data is true so that the inspector needs to start - Luos_SetFilterState(false, service); + // Luos_SetFilterState(false, service); inspector_state = STARTED; } else { // if we receive a false we should reactivate the filtering - inspector stopped - Luos_SetFilterState(true, service); + // Luos_SetFilterState(true, service); inspector_state = STOPPED; } break; diff --git a/tool_services/inspector/inspector.c b/tool_services/inspector/inspector.c index 8183b2303..4b5edaff2 100644 --- a/tool_services/inspector/inspector.c +++ b/tool_services/inspector/inspector.c @@ -56,6 +56,6 @@ void Inspector_Loop(void) // if the network is not yet detected reset the pipe id pipe_id = 0; // send to Luos a flag in order to filter the messages - Luos_SetFilterState(true, inspector); + // Luos_SetFilterState(true, inspector); } } From 91cbec526b125a07dc6bfe9dfb332985678cf4b8 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 5 Jun 2023 13:28:22 +0200 Subject: [PATCH 067/150] Fix some warnings --- engine/core/src/routing_table.c | 11 ++++------- .../NUCLEO-L073RZ/gate_serialcom/node_config.h | 4 ++-- .../NUCLEO-L432KC/gpio/lib/Gpio_dev/gpio_dev.c | 8 ++++---- .../STM32L4S5_discovery/gate_serialcom/node_config.h | 12 ++++++------ examples/projects/native/gate_wscom/node_config.h | 4 ++-- network/robus/HAL/ESP32/luos_engine/CMakeLists.txt | 10 +++++++++- tool_services/pipe/SERIAL/serial_protocol.h | 4 ++-- 7 files changed, 29 insertions(+), 24 deletions(-) diff --git a/engine/core/src/routing_table.c b/engine/core/src/routing_table.c index f5c879a71..b417ba5a9 100644 --- a/engine/core/src/routing_table.c +++ b/engine/core/src/routing_table.c @@ -46,16 +46,13 @@ static void RoutingTB_SendEndDetection(service_t *service); uint16_t RoutingTB_IDFromAlias(char *alias) { LUOS_ASSERT(alias); - if (*alias != -1) + for (int i = 0; i <= last_routing_table_entry; i++) { - for (int i = 0; i <= last_routing_table_entry; i++) + if (routing_table[i].mode == SERVICE) { - if (routing_table[i].mode == SERVICE) + if (strcmp(routing_table[i].alias, alias) == 0) { - if (strcmp(routing_table[i].alias, alias) == 0) - { - return routing_table[i].id; - } + return routing_table[i].id; } } } diff --git a/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h b/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h index e560d2acb..cc23fa12b 100644 --- a/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h @@ -109,8 +109,8 @@ * :-------------------------|------------------------------------------------------ * MAX_RTB_ENTRY | 40 | max number entry in routing table * GATE_BUFF_SIZE | 1024 | Json receive buffer size - * PIPE_TO_LUOS_BUFFER_SIZE | 1024 | Receive pipe buffer size - * LUOS_TO_PIPE_BUFFER_SIZE | 2048 | Transmit pipe buffer size + * PIPE_RX_BUFFER_SIZE | 1024 | Receive pipe buffer size + * PIPE_TX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ #define MAX_RTB_ENTRY 40 diff --git a/examples/projects/NUCLEO-L432KC/gpio/lib/Gpio_dev/gpio_dev.c b/examples/projects/NUCLEO-L432KC/gpio/lib/Gpio_dev/gpio_dev.c index cc23084b5..7370db245 100644 --- a/examples/projects/NUCLEO-L432KC/gpio/lib/Gpio_dev/gpio_dev.c +++ b/examples/projects/NUCLEO-L432KC/gpio/lib/Gpio_dev/gpio_dev.c @@ -30,8 +30,8 @@ service_t *pin[9]; /******************************************************************************* * Function ******************************************************************************/ -static void rx_digit_write_cb(service_t *service, msg_t *msg); -static void rx_digit_read_cb(service_t *service, msg_t *msg); +static void rx_digit_write_cb(service_t *service, const msg_t *msg); +static void rx_digit_read_cb(service_t *service, const msg_t *msg); /****************************************************************************** * @brief init must be call in project init @@ -63,7 +63,7 @@ void GpioDev_Loop(void) { } -static void rx_digit_read_cb(service_t *service, msg_t *msg) +static void rx_digit_read_cb(service_t *service, const msg_t *msg) { if (msg->header.cmd == GET_CMD) { @@ -107,7 +107,7 @@ static void rx_digit_read_cb(service_t *service, msg_t *msg) } } -static void rx_digit_write_cb(service_t *service, msg_t *msg) +static void rx_digit_write_cb(service_t *service, const msg_t *msg) { if (msg->header.cmd == IO_STATE) { diff --git a/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h b/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h index 85c0bed2a..200c21575 100644 --- a/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h +++ b/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h @@ -172,14 +172,14 @@ * :-------------------------|------------------------------------------------------ * MAX_RTB_ENTRY | 40 | max number entry in routing table * GATE_BUFF_SIZE | 1024 | Json receive buffer size - * PIPE_TO_LUOS_BUFFER_SIZE | 1024 | Receive pipe buffer size - * LUOS_TO_PIPE_BUFFER_SIZE | 2048 | Transmit pipe buffer size + * PIPE_RX_BUFFER_SIZE | 1024 | Receive pipe buffer size + * PIPE_TX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 -#define GATE_BUFF_SIZE 1024 -#define PIPE_TO_LUOS_BUFFER_SIZE 1024 -#define LUOS_TO_PIPE_BUFFER_SIZE 2048 +#define MAX_RTB_ENTRY 40 +#define GATE_BUFF_SIZE 1024 +#define PIPE_RX_BUFFER_SIZE 1024 +#define PIPE_TX_BUFFER_SIZE 2048 /******************************************************************************* * OTHER GATE PARAMETERS diff --git a/examples/projects/native/gate_wscom/node_config.h b/examples/projects/native/gate_wscom/node_config.h index a369c17e0..749bd8af9 100644 --- a/examples/projects/native/gate_wscom/node_config.h +++ b/examples/projects/native/gate_wscom/node_config.h @@ -101,8 +101,8 @@ * :-------------------------|------------------------------------------------------ * MAX_RTB_ENTRY | 40 | max number entry in routing table * GATE_BUFF_SIZE | 1024 | Json receive buffer size - * PIPE_TO_LUOS_BUFFER_SIZE | 1024 | Receive pipe buffer size - * LUOS_TO_PIPE_BUFFER_SIZE | 2048 | Transmit pipe buffer size + * PIPE_RX_BUFFER_SIZE | 1024 | Receive pipe buffer size + * PIPE_TX_BUFFER_SIZE | 2048 | Transmit pipe buffer size * INIT_TIME | 150 | Wait init time before first detection ******************************************************************************/ #define MAX_RTB_ENTRY 40 diff --git a/network/robus/HAL/ESP32/luos_engine/CMakeLists.txt b/network/robus/HAL/ESP32/luos_engine/CMakeLists.txt index fa82b2a68..eb286ed18 100644 --- a/network/robus/HAL/ESP32/luos_engine/CMakeLists.txt +++ b/network/robus/HAL/ESP32/luos_engine/CMakeLists.txt @@ -1,12 +1,19 @@ set(srcs "../../../../../engine/core/src/luos_engine.c" "../../../../../engine/core/src/luos_utils.c" + "../../../../../engine/core/src/node.c" "../../../../../engine/core/src/profile_core.c" + "../../../../../engine/core/src/pub_sub.c" "../../../../../engine/core/src/routing_table.c" + "../../../../../engine/core/src/service.c" + "../../../../../engine/core/src/stats.c" "../../../../../engine/core/src/streaming.c" "../../../../../engine/core/src/timestamp.c" "../../../../../engine/bootloader/bootloader_core.c" "../../../../../engine/HAL/ESP32/luos_hal.c" - "../../../src/msg_alloc.c" + "../../../../../engine/IO/src/msg_alloc.c" + "../../../../../engine/IO/src/luos_phy.c" + "../../../../../engine/IO/src/luos_io.c" + "../../../../../engine/IO/src/filter.c" "../../../src/port_manager.c" "../../../src/reception.c" "../../../src/robus.c" @@ -15,6 +22,7 @@ set(srcs "../../../../../engine/core/src/luos_engine.c" "../../../HAL/ESP32/robus_hal.c") set(inc "../../../../../engine/core/inc" + "../../../../../engine/IO/inc" "../../../../../engine/OD" "../../../../../engine/HAL/ESP32" "../../../../../engine/bootloader" diff --git a/tool_services/pipe/SERIAL/serial_protocol.h b/tool_services/pipe/SERIAL/serial_protocol.h index 17633d721..d2639e47f 100644 --- a/tool_services/pipe/SERIAL/serial_protocol.h +++ b/tool_services/pipe/SERIAL/serial_protocol.h @@ -79,7 +79,7 @@ static inline void SerialProtocol_CreateTxMsg(void) { size_to_update = (uint8_t *)((int)serialTx_StreamChannel->end_ring_buffer - 2); } - else if (serialTx_StreamChannel->data_ptr == serialTx_StreamChannel->ring_buffer + serialTx_StreamChannel->data_size) + else if ((uintptr_t)serialTx_StreamChannel->data_ptr == (uintptr_t)serialTx_StreamChannel->ring_buffer + (uintptr_t)serialTx_StreamChannel->data_size) { size_to_update = (uint8_t *)((int)serialTx_StreamChannel->end_ring_buffer - 1); } @@ -185,4 +185,4 @@ static inline uint8_t SerialProtocol_IsMsgComplete(uint16_t *size) } } return false; -} \ No newline at end of file +} From da5e7be7ff71dd0188ba2ac5f58cd140eba55f14 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 5 Jun 2023 13:29:18 +0200 Subject: [PATCH 068/150] Move compilation error using `example_build.py` to err.log file --- test/example_build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/example_build.py b/test/example_build.py index 80405d4c2..aee638086 100755 --- a/test/example_build.py +++ b/test/example_build.py @@ -48,7 +48,7 @@ def compile_example(cmd, target, example, clean): if clean: subprocess.call(cmd + " --target clean", shell=True, stdout=open(os.devnull, 'wb'), stderr=open(os.devnull, 'wb')) - if subprocess.call(cmd, shell=True, stdout=open(os.devnull, 'wb'), stderr=open(os.devnull, 'wb')): + if subprocess.call(cmd, shell=True, stdout=open(os.devnull, 'wb'), stderr=open("err.log", 'wb')): with compiled_example.get_lock(): compiled_example.value += 1 value = FAIL+"FAILED " + str(join(target, example) + ENDC) From 9c053e4e7accea0f1f9d8bb118c45f8bad62836f Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 6 Jun 2023 11:13:38 +0200 Subject: [PATCH 069/150] Fix some windows unit_test compilation optimization mistakes --- test/tests_core/test_node/main.c | 2 +- test/tests_core/test_routing_table/main.c | 2 +- test/tests_io/test_phy/main.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/tests_core/test_node/main.c b/test/tests_core/test_node/main.c index 161c87da7..5dccc73a1 100644 --- a/test/tests_core/test_node/main.c +++ b/test/tests_core/test_node/main.c @@ -99,7 +99,7 @@ void unittest_Node_SetState(void) node_ctx.timeout_run = true; node_ctx.timeout = 1; Node_SetState(LOCAL_DETECTION); - TEST_ASSERT_NOT_EQUAL(0, node_ctx.timeout); + TEST_ASSERT_NOT_EQUAL(0, (volatile uint32_t)node_ctx.timeout); TEST_ASSERT_EQUAL(true, node_ctx.timeout_run); TEST_ASSERT_EQUAL(LOCAL_DETECTION, node_ctx.state); diff --git a/test/tests_core/test_routing_table/main.c b/test/tests_core/test_routing_table/main.c index f44e5a633..82e816615 100644 --- a/test/tests_core/test_routing_table/main.c +++ b/test/tests_core/test_routing_table/main.c @@ -480,7 +480,7 @@ void unittest_RTFilter_InitCheck(void) // Init default scenario context Init_Context(); // Init variables - search_result_t result; + search_result_t result = {0}; NEW_STEP("Verify that we have not initialized the result"); TEST_ASSERT_EQUAL(FAILED, RTFilter_InitCheck(&result)); diff --git a/test/tests_io/test_phy/main.c b/test/tests_io/test_phy/main.c index e52b31234..aca26df63 100644 --- a/test/tests_io/test_phy/main.c +++ b/test/tests_io/test_phy/main.c @@ -1084,10 +1084,10 @@ void unittest_phy_ComputeTimestamp() msg->header.size = 1; msg->data[0] = 0xAE; - time_luos_t timestamp = TimeOD_TimeFrom_ns(10); + volatile time_luos_t timestamp = TimeOD_TimeFrom_ns(10); memcpy(&msg->data[msg->header.size], ×tamp, sizeof(time_luos_t)); - time_luos_t resulting_latency = Phy_ComputeTimestamp(&job); + volatile time_luos_t resulting_latency = Phy_ComputeTimestamp(&job); TEST_ASSERT_EQUAL(0xAE, job.msg_pt->data[0]); TEST_ASSERT_NOT_EQUAL(TimeOD_TimeTo_ns(timestamp), TimeOD_TimeTo_ns(resulting_latency)); From c82d9c6a76444f593332bfec5a7399fd29221bb9 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 6 Jun 2023 11:48:31 +0200 Subject: [PATCH 070/150] Improve luos_engine unit test --- engine/core/src/luos_engine.c | 37 +- test/tests_core/test_luos/main.c | 603 +++++++++-- test/tests_core/test_luos/main.h | 7 - test/tests_io/test_msg_alloc/main.c | 956 +++++++++++++++++- test/tests_io/test_msg_alloc/main.h | 17 - .../test_msg_alloc/unit_test_mem_alloc.c | 931 ----------------- 6 files changed, 1521 insertions(+), 1030 deletions(-) delete mode 100644 test/tests_core/test_luos/main.h delete mode 100644 test/tests_io/test_msg_alloc/main.h delete mode 100644 test/tests_io/test_msg_alloc/unit_test_mem_alloc.c diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 4bc35f325..276d7263c 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -140,6 +140,7 @@ const revision_t *Luos_GetVersion(void) ******************************************************************************/ error_return_t Luos_SendMsg(service_t *service, msg_t *msg) { + LUOS_ASSERT(msg != 0); // set protocol version msg->header.config = BASE_PROTOCOL; return Luos_Send(service, msg); @@ -168,6 +169,7 @@ error_return_t Luos_SendTimestampMsg(service_t *service, msg_t *msg, time_luos_t ******************************************************************************/ static error_return_t Luos_Send(service_t *service, msg_t *msg) { + LUOS_ASSERT(msg != 0); if (service == 0) { // There is no service specified here, take the first one @@ -197,13 +199,14 @@ static error_return_t Luos_Send(service_t *service, msg_t *msg) } /****************************************************************************** - * @brief Read last message from buffer for a specifig service - * @param service : Who receives the message we are looking for - * @param msg_to_write : Message to write - * @return SUCCEED : If the message is passed to the user, else FAILED + * @brief Read last message + * @param service : The service asking for a message + * @param msg_to_write : Message where the received message will be copied + * @return SUCCEED : If a message is passed to the user, else FAILED ******************************************************************************/ error_return_t Luos_ReadMsg(service_t *service, msg_t *msg_to_write) { + LUOS_ASSERT((msg_to_write != 0) && (service != 0)); uint8_t service_index = Service_GetIndex(service); int remaining_job_number = 0; phy_job_t *job; @@ -214,14 +217,19 @@ error_return_t Luos_ReadMsg(service_t *service, msg_t *msg_to_write) // Check if our service is concerned by this job if (((*(uint8_t *)job->phy_data) >> service_index) & 0x01) { + uint16_t msg_size = job->msg_pt->header.size; // This job is for our service, copy the job message to the user message + if (msg_size > MAX_DATA_MSG_SIZE) + { + msg_size = MAX_DATA_MSG_SIZE; + } if (Luos_IsMsgTimstamped(job->msg_pt) == true) { - memcpy(msg_to_write, job->msg_pt, sizeof(header_t) + job->msg_pt->header.size + sizeof(time_luos_t)); + memcpy(msg_to_write, job->msg_pt, sizeof(header_t) + msg_size + sizeof(time_luos_t)); } else { - memcpy(msg_to_write, job->msg_pt, sizeof(header_t) + job->msg_pt->header.size); + memcpy(msg_to_write, job->msg_pt, sizeof(header_t) + msg_size); } // Remove this service from the job filter *(uint8_t *)job->phy_data &= ~(1 << service_index); @@ -235,15 +243,18 @@ error_return_t Luos_ReadMsg(service_t *service, msg_t *msg_to_write) LUOS_MUTEX_UNLOCK return FAILED; } + /****************************************************************************** - * @brief Read last msg from buffer from a specific id service - * @param service : Who receive the message we are looking for + * @brief Read last msg from a specific service id + * @param service : The service asking for a message * @param id : Who sent the message we are looking for - * @param msg_to_write : Message to write - * @return FAILED if no message available + * @param msg_to_write : Message where the received message will be copied + * @return SUCCEED : If a message is passed to the user, else FAILED ******************************************************************************/ error_return_t Luos_ReadFromService(service_t *service, uint16_t id, msg_t *msg_to_write) { + + LUOS_ASSERT((msg_to_write != 0) && (service != 0) && (id != 0)); uint16_t remaining_job_number = 0; phy_job_t *job; uint8_t service_index = Service_GetIndex(service); @@ -275,6 +286,7 @@ error_return_t Luos_ReadFromService(service_t *service, uint16_t id, msg_t *msg_ LUOS_MUTEX_UNLOCK return FAILED; } + /****************************************************************************** * @brief Send large among of data and formating to send into multiple msg * @param service : Who send @@ -285,6 +297,7 @@ error_return_t Luos_ReadFromService(service_t *service, uint16_t id, msg_t *msg_ ******************************************************************************/ void Luos_SendData(service_t *service, msg_t *msg, void *bin_data, uint16_t size) { + LUOS_ASSERT((msg != 0) && (bin_data != 0) && (size != 0)); // Compute number of message needed to send this data uint16_t msg_number = 1; uint16_t sent_size = 0; @@ -325,6 +338,7 @@ void Luos_SendData(service_t *service, msg_t *msg, void *bin_data, uint16_t size sent_size = sent_size + chunk_size; } } + /****************************************************************************** * @brief Receive a multi msg data * @param service : who receive @@ -402,6 +416,7 @@ int Luos_ReceiveData(service_t *service, const msg_t *msg, void *bin_data) } return 0; } + /****************************************************************************** * @brief Return the number of messages available * @param None @@ -411,6 +426,7 @@ uint16_t Luos_NbrAvailableMsg(void) { return LuosIO_GetJobNb(); } + /****************************************************************************** * @brief Check if all Tx message are complete * @param None @@ -420,6 +436,7 @@ error_return_t Luos_TxComplete(void) { return LuosIO_TxAllComplete(); } + /****************************************************************************** * @brief Register a new package * @param Init : Init function name diff --git a/test/tests_core/test_luos/main.c b/test/tests_core/test_luos/main.c index 8c09ccf65..1b51992ac 100644 --- a/test/tests_core/test_luos/main.c +++ b/test/tests_core/test_luos/main.c @@ -1,100 +1,570 @@ -#include "main.h" #include #include -#define Streaming_BUFFER_SIZE 1024 +#include "luos_engine.c" extern default_scenario_t default_sc; -void unittest_Luos_ReceiveData() +// Init and Loop are used and tested in the default scenario + +void unittest_Luos_GetVersion(void) { - NEW_TEST_CASE("Try to send a void message argument"); + NEW_TEST_CASE("Test Luos_GetVersion"); { - // Init default scenario context - Init_Context(); - revision_t revision = {.major = 1, .minor = 0, .build = 0}; - service_t *service = Luos_CreateService(0, VOID_TYPE, "Dummy_App", revision); - uint32_t bin_data[64] = {0xDEADBEEF}; + TRY + { + const revision_t *rev = Luos_GetVersion(); + TEST_ASSERT_EQUAL(&luos_version, rev); + } + } +} + +void unittest_Luos_Send(void) +{ + NEW_TEST_CASE("Test Luos_Send assert conditions"); + { + TRY + { + NEW_STEP("Try to send a void message argument"); + Luos_Send(NULL, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test Luos_Send normal conditions"); + { + TRY + { + NEW_STEP("Try to send in a prohibited condition"); + // Init default scenario context + Init_Context(); + // fake detection condition + default_sc.App_3.app->id = 0; + msg_t msg; + msg.header.target = default_sc.App_2.app->id; + msg.header.target_mode = SERVICEIDACK; + msg.header.cmd = LUOS_LAST_RESERVED_CMD + 1; + msg.header.size = 0; + TEST_ASSERT_EQUAL(PROHIBITED, Luos_Send(default_sc.App_3.app, &msg)); + + NEW_STEP("Try to send with no service and check if the first service is used"); + // Init default scenario context + Init_Context(); + TEST_ASSERT_EQUAL(SUCCEED, Luos_Send(NULL, &msg)); + TEST_ASSERT_EQUAL(default_sc.App_1.app->id, msg.header.source); + Luos_Loop(); + TEST_ASSERT_EQUAL(default_sc.App_1.app->id, default_sc.App_2.last_rx_msg.header.source); + + NEW_STEP("Try to send with a not configured service"); + // Init default scenario context + Init_Context(); + default_sc.App_3.app->id = 0; + msg.header.cmd = LUOS_LAST_RESERVED_CMD - 1; + TEST_ASSERT_EQUAL(SUCCEED, Luos_Send(default_sc.App_3.app, &msg)); + TEST_ASSERT_EQUAL(Node_Get()->node_id, msg.header.source); + Luos_Loop(); + TEST_ASSERT_EQUAL(Node_Get()->node_id, default_sc.App_2.last_rx_msg.header.source); - NEW_STEP("Verify if we assert"); - RESET_ASSERT(); - TEST_ASSERT_EQUAL(Luos_ReceiveData(NULL, 0, bin_data), -1); - RESET_ASSERT(); + NEW_STEP("Try to do a normal send"); + // Init default scenario context + Init_Context(); + TEST_ASSERT_EQUAL(SUCCEED, Luos_Send(default_sc.App_3.app, &msg)); + TEST_ASSERT_EQUAL(default_sc.App_3.app->id, msg.header.source); + Luos_Loop(); + TEST_ASSERT_EQUAL(default_sc.App_3.app->id, default_sc.App_2.last_rx_msg.header.source); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; } +} - NEW_TEST_CASE("Try to send a void table argument"); +void unittest_Luos_SendMsg(void) +{ + NEW_TEST_CASE("Test Luos_SendMsg assert conditions"); { - // Init default scenario context - Init_Context(); - revision_t revision = {.major = 1, .minor = 0, .build = 0}; - service_t *service = Luos_CreateService(0, VOID_TYPE, "Dummy_App", revision); - msg_t msg; - NEW_STEP("Verify function returns -1"); - Luos_ReceiveData(service, &msg, 0); + TRY + { + Luos_SendMsg(NULL, 0); + } TEST_ASSERT_TRUE(IS_ASSERT()); - RESET_ASSERT(); + END_TRY; + } + NEW_TEST_CASE("Test Luos_SendMsg normal conditions"); + { + + TRY + { + // Init default scenario context + Init_Context(); + msg_t msg; + msg.header.target = default_sc.App_2.app->id; + msg.header.target_mode = SERVICEIDACK; + msg.header.cmd = LUOS_LAST_RESERVED_CMD + 1; + msg.header.size = 0; + TEST_ASSERT_EQUAL(SUCCEED, Luos_SendMsg(default_sc.App_3.app, &msg)); + TEST_ASSERT_EQUAL(default_sc.App_3.app->id, msg.header.source); + TEST_ASSERT_EQUAL(BASE_PROTOCOL, msg.header.config); + Luos_Loop(); + TEST_ASSERT_EQUAL(default_sc.App_3.app->id, default_sc.App_2.last_rx_msg.header.source); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; } +} - NEW_TEST_CASE("Try to send a shity service argument"); +void unittest_Luos_SendTimestampMsg(void) +{ + NEW_TEST_CASE("Test Luos_SendTimestampMsg assert conditions"); { - // Init default scenario context - Init_Context(); - msg_t msg; - uint32_t bin_data[64] = {0xDEADBEEF}; TRY { - NEW_STEP("Verify if we Assert"); - Luos_ReceiveData((service_t *)10, &msg, bin_data); + time_luos_t timestamp; + Luos_SendTimestampMsg(NULL, 0, timestamp); } TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; } + NEW_TEST_CASE("Test Luos_SendTimestampMsg normal conditions"); + { - NEW_TEST_CASE("Test the regular usage"); + TRY + { + // Init default scenario context + Init_Context(); + msg_t msg; + msg.header.target = default_sc.App_2.app->id; + msg.header.target_mode = SERVICEIDACK; + msg.header.cmd = LUOS_LAST_RESERVED_CMD + 1; + msg.header.size = 0; + + time_luos_t timestamp = TimeOD_TimeFrom_s(2); + TEST_ASSERT_EQUAL(SUCCEED, Luos_SendTimestampMsg(default_sc.App_3.app, &msg, timestamp)); + TEST_ASSERT_EQUAL(default_sc.App_3.app->id, msg.header.source); + TEST_ASSERT_EQUAL(TIMESTAMP_PROTOCOL, msg.header.config); + Luos_Loop(); + TEST_ASSERT_EQUAL(default_sc.App_3.app->id, default_sc.App_2.last_rx_msg.header.source); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Luos_ReadMsg(void) +{ + NEW_TEST_CASE("Test Luos_ReadMsg assert conditions"); { - // Init default scenario context - Init_Context(); - revision_t revision = {.major = 1, .minor = 0, .build = 0}; - service_t *service = Luos_CreateService(0, VOID_TYPE, "Dummy_App", revision); + TRY + { + NEW_STEP("Try to missspecify the service pointer"); + msg_t msg; + Luos_ReadMsg(NULL, &msg); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + NEW_STEP("Try to miss-specify the service pointer"); + revision_t revision = {.major = 1, .minor = 0, .build = 0}; + service_t *service = Luos_CreateService(0, STATE_TYPE, "mycustom_service", revision); + Luos_ReadMsg(service, NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test Luos_ReadMsg normal conditions"); + { + TRY + { + // Init default scenario context + Init_Context(); + revision_t revision = {.major = 1, .minor = 0, .build = 0}; + service_t *service = Luos_CreateService(0, STATE_TYPE, "mycustom_service", revision); + Luos_Detect(default_sc.App_1.app); + do + { + Luos_Loop(); + } while (!Luos_IsDetected()); + + NEW_STEP("Check end detection reception"); + msg_t rx_msg; + TEST_ASSERT_EQUAL(SUCCEED, Luos_ReadMsg(service, &rx_msg)); + + NEW_STEP("Check normal reception"); + msg_t msg; + msg.header.target = service->id; + msg.header.target_mode = SERVICEIDACK; + msg.header.cmd = LUOS_LAST_RESERVED_CMD + 1; + msg.header.size = 0; + TEST_ASSERT_EQUAL(SUCCEED, Luos_SendMsg(default_sc.App_3.app, &msg)); + Luos_Loop(); + TEST_ASSERT_EQUAL(SUCCEED, Luos_ReadMsg(service, &rx_msg)); + TEST_ASSERT_EQUAL(msg.header.source, rx_msg.header.source); + TEST_ASSERT_EQUAL(rx_msg.header.config, msg.header.config); + + NEW_STEP("Try receive but no message available"); + TEST_ASSERT_EQUAL(FAILED, Luos_ReadMsg(service, &rx_msg)); + + NEW_STEP("Check timestamped reception"); + time_luos_t timestamp = TimeOD_TimeFrom_s(2); + TEST_ASSERT_EQUAL(SUCCEED, Luos_SendTimestampMsg(default_sc.App_3.app, &msg, timestamp)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_ReadMsg(service, &rx_msg)); + TEST_ASSERT_EQUAL(msg.header.source, rx_msg.header.source); + TEST_ASSERT_EQUAL(rx_msg.header.config, msg.header.config); + time_luos_t rx_timestamp = Luos_GetMsgTimestamp(&rx_msg); + TEST_ASSERT_EQUAL(TimeOD_TimeTo_s(timestamp), TimeOD_TimeTo_s(rx_timestamp)); + + NEW_STEP("Try receive but no message available"); + TEST_ASSERT_EQUAL(FAILED, Luos_ReadMsg(service, &rx_msg)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Luos_ReadFromService(void) +{ + + NEW_TEST_CASE("Test Luos_ReadFromService assert conditions"); + { + TRY + { + NEW_STEP("Try to missspecify the service pointer"); + msg_t msg; + Luos_ReadFromService(NULL, 1, &msg); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + NEW_STEP("Try to miss-specify the service pointer"); + revision_t revision = {.major = 1, .minor = 0, .build = 0}; + service_t *service = Luos_CreateService(0, STATE_TYPE, "mycustom_service", revision); + Luos_ReadFromService(service, 1, NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + NEW_STEP("Try to miss-specify the targeted service id"); + revision_t revision = {.major = 1, .minor = 0, .build = 0}; + service_t *service = Luos_CreateService(0, STATE_TYPE, "mycustom_service", revision); + msg_t msg; + Luos_ReadFromService(service, 0, &msg); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Test Luos_ReadFromService normal conditions"); + { + TRY + { + // Init default scenario context + Init_Context(); + revision_t revision = {.major = 1, .minor = 0, .build = 0}; + service_t *service = Luos_CreateService(0, STATE_TYPE, "mycustom_service", revision); + Luos_Detect(default_sc.App_1.app); + do + { + Luos_Loop(); + } while (!Luos_IsDetected()); + + NEW_STEP("Check end detection reception"); + msg_t rx_msg; + TEST_ASSERT_EQUAL(FAILED, Luos_ReadFromService(service, 2, &rx_msg)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_ReadFromService(service, 1, &rx_msg)); + + NEW_STEP("Check normal reception"); + msg_t msg; + msg.header.target = service->id; + msg.header.target_mode = SERVICEIDACK; + msg.header.cmd = LUOS_LAST_RESERVED_CMD + 1; + msg.header.size = 0; + TEST_ASSERT_EQUAL(SUCCEED, Luos_SendMsg(default_sc.App_3.app, &msg)); + Luos_Loop(); + TEST_ASSERT_EQUAL(FAILED, Luos_ReadFromService(service, 1, &rx_msg)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_ReadFromService(service, 3, &rx_msg)); + TEST_ASSERT_EQUAL(msg.header.source, rx_msg.header.source); + TEST_ASSERT_EQUAL(rx_msg.header.config, msg.header.config); + + NEW_STEP("Try receive but no message available"); + TEST_ASSERT_EQUAL(FAILED, Luos_ReadFromService(service, 3, &rx_msg)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Luos_Send_ReceiveData() +{ + NEW_TEST_CASE("Test Luos_SendData assert condition"); + { + revision_t revision = {.major = 1, .minor = 0, .build = 0}; + service_t *service = Luos_CreateService(0, VOID_TYPE, "Dummy_App", revision); + uint32_t bin_data[64] = {0xDEADBEEF}; msg_t msg; - uint8_t bin_data[256] = {0}; - NEW_STEP("Verify that the first message return 0 meaning message is not completely received"); - // Set first message - msg.header.size = 256; - memset(msg.data, 0xAA, 128); - TEST_ASSERT_EQUAL(Luos_ReceiveData(service, &msg, bin_data), 0); + NEW_STEP("Try to send a void message argument"); + { + TRY + { + Luos_SendData(service, 0, bin_data, 10); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_STEP("Try to send a void table argument"); + { + TRY + { + Luos_SendData(service, &msg, NULL, 10); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_STEP("Try to send a shity size"); + { + TRY + { + Luos_SendData(service, &msg, bin_data, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + } + NEW_TEST_CASE("Test Luos_ReceiveData assert condition"); + { + revision_t revision = {.major = 1, .minor = 0, .build = 0}; + service_t *service = Luos_CreateService(0, VOID_TYPE, "Dummy_App", revision); + uint32_t bin_data[64] = {0xDEADBEEF}; + msg_t msg; + + NEW_STEP("Try to send a void message argument"); + { + TRY + { + Luos_ReceiveData(service, 0, bin_data); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_STEP("Try to send a void table argument"); + { + TRY + { + Luos_ReceiveData(service, &msg, NULL); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_STEP("Try to send a shity service argument"); + { + TRY + { + Luos_ReceiveData((service_t *)10, &msg, bin_data); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_STEP("Try to send a shity service pointer"); + { + TRY + { + TEST_ASSERT_EQUAL(-1, Luos_ReceiveData(NULL, &msg, bin_data)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + } + + NEW_TEST_CASE("Test the regular usage"); + { + TRY + { + // Init default scenario context + Init_Context(); + revision_t revision = {.major = 1, .minor = 0, .build = 0}; + service_t *service = Luos_CreateService(0, VOID_TYPE, "Dummy_App", revision); + Luos_Detect(default_sc.App_1.app); + do + { + Luos_Loop(); + } while (!Luos_IsDetected()); + msg_t msg; + uint8_t tx_data[256] = {0}; + uint8_t rx_data[256] = {0}; + msg_t rx_msg; + // Catch the end of detection + Luos_ReadMsg(service, &rx_msg); + + NEW_STEP("Verify that the first message return 0 meaning message is not completely received"); + { + // Set first message + memset(tx_data, 0xAA, 256); + msg.header.target = service->id; + msg.header.target_mode = SERVICEIDACK; + msg.header.cmd = LUOS_LAST_RESERVED_CMD + 1; + msg.header.size = 0; + Luos_SendData(default_sc.App_1.app, &msg, tx_data, 256); + TEST_ASSERT_EQUAL(SUCCEED, Luos_ReadMsg(service, &rx_msg)); + TEST_ASSERT_EQUAL(256, rx_msg.header.size); + TEST_ASSERT_EQUAL(0, Luos_ReceiveData(service, &rx_msg, rx_data)); + } - NEW_STEP("Verify that the second message return 256 byte received"); - msg.header.size = 128; - TEST_ASSERT_EQUAL(Luos_ReceiveData(service, &msg, bin_data), 256); + NEW_STEP("Verify that the second message return 256 byte received"); + { + TEST_ASSERT_EQUAL(SUCCEED, Luos_ReadMsg(service, &rx_msg)); + TEST_ASSERT_EQUAL(128, rx_msg.header.size); + TEST_ASSERT_EQUAL(256, Luos_ReceiveData(service, &rx_msg, rx_data)); + } - NEW_STEP("Check if the data is OK"); - for (int i = 0; i < 256; i++) + NEW_STEP("Check if the data is OK"); + { + for (int i = 0; i < 256; i++) + { + TEST_ASSERT_EQUAL(rx_data[i], 0xAA); + } + } + } + CATCH { - TEST_ASSERT_EQUAL(bin_data[i], 0xAA); + TEST_ASSERT_TRUE(false); } + END_TRY; + } + + NEW_TEST_CASE("Try to break the message"); + { + TRY + { + // Init default scenario context + Init_Context(); + revision_t revision = {.major = 1, .minor = 0, .build = 0}; + service_t *service = Luos_CreateService(0, VOID_TYPE, "Dummy_App", revision); + Luos_Detect(default_sc.App_1.app); + do + { + Luos_Loop(); + } while (!Luos_IsDetected()); + msg_t msg; + uint8_t tx_data[380] = {0}; + uint8_t rx_data[380] = {0}; + msg_t rx_msg; + // Catch the end of detection + TEST_ASSERT_EQUAL(SUCCEED, Luos_ReadMsg(service, &rx_msg)); + + NEW_STEP("Check that the first message return 0 meaning message is not completely received"); + { + // Set first message + msg.header.target = service->id; + msg.header.target_mode = SERVICEIDACK; + msg.header.cmd = LUOS_LAST_RESERVED_CMD + 1; + msg.header.size = 0; + Luos_SendData(default_sc.App_1.app, &msg, tx_data, 380); + TEST_ASSERT_EQUAL(SUCCEED, Luos_ReadMsg(service, &rx_msg)); + TEST_ASSERT_EQUAL(380, rx_msg.header.size); + TEST_ASSERT_EQUAL(0, Luos_ReceiveData(service, &rx_msg, rx_data)); + } + + NEW_STEP("Remove the second message but receive the second one and check if the data manager reset"); + { + TEST_ASSERT_EQUAL(SUCCEED, Luos_ReadMsg(service, &rx_msg)); + TEST_ASSERT_EQUAL(252, rx_msg.header.size); + TEST_ASSERT_EQUAL(SUCCEED, Luos_ReadMsg(service, &rx_msg)); + TEST_ASSERT_EQUAL(124, rx_msg.header.size); + TEST_ASSERT_EQUAL(-1, Luos_ReceiveData(service, &rx_msg, rx_data)); + } + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; } NEW_TEST_CASE("Try to send a void service argument to reset the data reception"); { - // Init default scenario context - Init_Context(); - revision_t revision = {.major = 1, .minor = 0, .build = 0}; - service_t *service = Luos_CreateService(0, VOID_TYPE, "Dummy_App", revision); - msg_t msg; - uint8_t bin_data[256] = {0}; + TRY + { + // Init default scenario context + Init_Context(); + revision_t revision = {.major = 1, .minor = 0, .build = 0}; + service_t *service = Luos_CreateService(0, VOID_TYPE, "Dummy_App", revision); + msg_t msg; + uint8_t bin_data[256] = {0}; - NEW_STEP("Verify that the first message return 0 meaning message is not completely received"); - // Set first message - msg.header.size = 256; - memset(msg.data, 0xAA, 128); - TEST_ASSERT_EQUAL(Luos_ReceiveData(service, &msg, bin_data), 0); + NEW_STEP("Verify that the first message return 0 meaning message is not completely received"); + // Set first message + msg.header.size = 256; + memset(msg.data, 0xAA, 128); + TEST_ASSERT_EQUAL(Luos_ReceiveData(service, &msg, bin_data), 0); - NEW_STEP("Verify if we return an error which mean the data reception have been reseted"); - TEST_ASSERT_EQUAL(Luos_ReceiveData(0, &msg, bin_data), -1); + NEW_STEP("Verify if we return an error which mean the data reception have been reseted"); + TEST_ASSERT_EQUAL(Luos_ReceiveData(0, &msg, bin_data), -1); - NEW_STEP("Verify that the second message return 128 byte received half of the transmitted data because we reset it in the middle"); - msg.header.size = 128; - TEST_ASSERT_EQUAL(Luos_ReceiveData(service, &msg, bin_data), 128); + NEW_STEP("Verify that the second message return 128 byte received half of the transmitted data because we reset it in the middle"); + msg.header.size = 128; + TEST_ASSERT_EQUAL(Luos_ReceiveData(service, &msg, bin_data), 128); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} + +void unittest_Luos_NbrAvailableMsg(void) +{ + + NEW_TEST_CASE("Test the regular usage"); + { + TRY + { + // Init default scenario context + Init_Context(); + revision_t revision = {.major = 1, .minor = 0, .build = 0}; + service_t *service = Luos_CreateService(0, VOID_TYPE, "Dummy_App", revision); + Luos_Detect(default_sc.App_1.app); + do + { + Luos_Loop(); + } while (!Luos_IsDetected()); + msg_t msg; + uint8_t tx_data[256] = {0}; + uint8_t rx_data[256] = {0}; + msg_t rx_msg; + // Catch the end of detection + TEST_ASSERT_EQUAL(1, Luos_NbrAvailableMsg()); + TEST_ASSERT_EQUAL(SUCCEED, Luos_ReadMsg(service, &rx_msg)); + TEST_ASSERT_EQUAL(0, Luos_NbrAvailableMsg()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; } } @@ -103,7 +573,14 @@ int main(int argc, char **argv) UNITY_BEGIN(); // Big data reception - UNIT_TEST_RUN(unittest_Luos_ReceiveData); + UNIT_TEST_RUN(unittest_Luos_GetVersion); + UNIT_TEST_RUN(unittest_Luos_Send); + UNIT_TEST_RUN(unittest_Luos_SendMsg); + UNIT_TEST_RUN(unittest_Luos_SendTimestampMsg); + UNIT_TEST_RUN(unittest_Luos_ReadMsg); + UNIT_TEST_RUN(unittest_Luos_ReadFromService); + UNIT_TEST_RUN(unittest_Luos_Send_ReceiveData); + UNIT_TEST_RUN(unittest_Luos_NbrAvailableMsg); UNITY_END(); } diff --git a/test/tests_core/test_luos/main.h b/test/tests_core/test_luos/main.h deleted file mode 100644 index 486ae2f27..000000000 --- a/test/tests_core/test_luos/main.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -// Sreaming functions -void unittest_Luos_SendStreamingStreamingSize(void); - -#endif //MAIN_H \ No newline at end of file diff --git a/test/tests_io/test_msg_alloc/main.c b/test/tests_io/test_msg_alloc/main.c index 035763255..e2f61a01c 100644 --- a/test/tests_io/test_msg_alloc/main.c +++ b/test/tests_io/test_msg_alloc/main.c @@ -1,6 +1,958 @@ -#include "main.h" #include "unit_test.h" -#include "msg_alloc.h" +#include "../src/msg_alloc.c" + +void unittest_SlotPack(void) +{ + uint8_t data = 0; + // This funciton should reorganize the buffer to pack the messages + // Create a already organized buffer with a random data + + NEW_TEST_CASE("Check if we assert when allocating more than the buffer size"); + { + alloc_slot_index = MAX_MSG_NB + 1; + TRY + { + MsgAlloc_SlotPack(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check if an already organized buffer is not modified"); + { + TRY + { + alloc_slots[0].data = &data; + alloc_slots[1].data = &data; + alloc_slots[2].data = &data; + alloc_slots[3].data = &data; + alloc_slots[4].data = 0; + alloc_slot_index = 4; + MsgAlloc_SlotPack(); + TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[3].data); + TEST_ASSERT_EQUAL(0, alloc_slots[4].data); + TEST_ASSERT_EQUAL(4, alloc_slot_index); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check if an unorganized buffer is organized"); + { + TRY + { + alloc_slots[0].data = 0; + alloc_slots[1].data = &data; + alloc_slots[2].data = &data; + alloc_slots[3].data = 0; + alloc_slots[4].data = 0; + alloc_slots[5].data = 0; + alloc_slots[6].data = &data; + alloc_slots[7].data = 0; + alloc_slot_index = 8; + MsgAlloc_SlotPack(); + TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); + TEST_ASSERT_EQUAL(0, alloc_slots[3].data); + TEST_ASSERT_EQUAL(0, alloc_slots[4].data); + TEST_ASSERT_EQUAL(0, alloc_slots[5].data); + TEST_ASSERT_EQUAL(0, alloc_slots[6].data); + TEST_ASSERT_EQUAL(0, alloc_slots[7].data); + TEST_ASSERT_EQUAL(3, alloc_slot_index); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check how it's managing the buffer to it's limits"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = 0; + alloc_slots[1].data = &data; + alloc_slots[2].data = &data; + alloc_slots[3].data = 0; + alloc_slots[4].data = 0; + alloc_slots[5].data = 0; + alloc_slots[6].data = &data; + alloc_slots[MAX_MSG_NB - 1].data = &data; + alloc_slot_index = MAX_MSG_NB; + MsgAlloc_SlotPack(); + TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); + TEST_ASSERT_EQUAL(&data, alloc_slots[3].data); + TEST_ASSERT_EQUAL(0, alloc_slots[4].data); + TEST_ASSERT_EQUAL(0, alloc_slots[5].data); + TEST_ASSERT_EQUAL(0, alloc_slots[6].data); + TEST_ASSERT_EQUAL(0, alloc_slots[7].data); + TEST_ASSERT_EQUAL(0, alloc_slots[MAX_MSG_NB - 1].data); + TEST_ASSERT_EQUAL(4, alloc_slot_index); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_GetOldestMsg(void) +{ + NEW_TEST_CASE("Check if we assert when allocating more than the buffer size"); + { + alloc_slot_index = MAX_MSG_NB + 1; + TRY + { + MsgAlloc_GetOldestMsg(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check the behavior if we dont have any message"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + TEST_ASSERT_EQUAL(0, MsgAlloc_GetOldestMsg()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check the behavior if we have a message in the first slot"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)0x1; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check the behavior if we have a message in another place"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[3].data = (uint8_t *)0x1; + alloc_slot_index = 4; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check the behavior if we have a message in the last slot"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x1; + alloc_slot_index = MAX_MSG_NB; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check the behavior if we have a message in the last slot and the first one"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)0x1; + alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x2; + alloc_slot_index = MAX_MSG_NB; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check the behavior if we have a message in the last slot and the first one"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)0x1; + alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x2; + alloc_slot_index = MAX_MSG_NB; + TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_BufferAvailableSpaceComputation(void) +{ + // This computation is based on the computed oldest message and the data ptr + NEW_TEST_CASE("Check if we assert when data_ptr is out of the buffer"); + { + alloc_slots[0].data = 0; + TRY + { + MsgAlloc_BufferAvailableSpaceComputation(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE]; + TRY + { + MsgAlloc_BufferAvailableSpaceComputation(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check if we assert when olest_msg is out of the buffer"); + { + + TRY + { + MsgAlloc_BufferAvailableSpaceComputation(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + data_ptr = &msg_buffer[MSG_BUFFER_SIZE]; + TRY + { + MsgAlloc_BufferAvailableSpaceComputation(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + } + + NEW_TEST_CASE("Check the result if we don't have any messages"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + data_ptr = (uint8_t *)&msg_buffer[0]; + TEST_ASSERT_EQUAL(MSG_BUFFER_SIZE, MsgAlloc_BufferAvailableSpaceComputation()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check the result in a situation we don't have to loop around the buffer end"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + data_ptr = (uint8_t *)&msg_buffer[0]; + TEST_ASSERT_EQUAL(10, MsgAlloc_BufferAvailableSpaceComputation()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check the result in a situation we have to loop around the buffer end"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; + TEST_ASSERT_EQUAL(20, MsgAlloc_BufferAvailableSpaceComputation()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check the result in a situation we have to loop around the buffer end and data_ptr is set to the begin of the buffer"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; + TEST_ASSERT_EQUAL(10, MsgAlloc_BufferAvailableSpaceComputation()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_DoWeHaveSpaceUntilBufferEnd(void) +{ + // In this specific function we may have a pointer after the end of the buffer but never before + + NEW_TEST_CASE("Check if we assert when to pointer is before the buffer"); + { + TRY + { + MsgAlloc_DoWeHaveSpaceUntilBufferEnd(0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check if it return SUCCEED when the pointer is in the buffer"); + { + TRY + { + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[0])); + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check if it return FAILED when the pointer is after the buffer"); + { + TRY + { + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE])); + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE + 1])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_CheckMsgSpace(void) +{ + NEW_TEST_CASE("Check if we assert when from pointer is after the to pointer or at the same place"); + { + TRY + { + MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[0]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[1], (uint8_t *)&msg_buffer[0]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + } + + NEW_TEST_CASE("Check if we assert when one of the pointer is out of the buffer"); + { + TRY + { + MsgAlloc_CheckMsgSpace(0, (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE + 1], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1], 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check the result if we don't have any message yet"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check the result if we have one message and the new one is before the old one"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[9])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check the result if we have one message and the new one is after the old one"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[11], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check the result if we have one message and the new one is in the middle of the old one"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check the result if we have one message and the new one is at the end of the old one"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[10])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check the result if we have one message and the new one is at the beginning of the old one"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[10], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_MsgAlloc_Loop() +{ + NEW_TEST_CASE("Verify buffer occupation rate stat computing"); + MsgAlloc_Init(NULL); + { + // data_ptr is incremented : buffer occupation computing is verified + // + // msg_buffer + // +-------------------------------------------------------------+ + // |-------------------------------------------------------------| + // ^-------------------------^---------------------^-------------+ + // | | | + // data_ptr data_ptr data_ptr + // (0% occupation) (X% occupation) (etc...) + // + + // Init variables + //--------------- + uint32_t expected_buffer_occupation_ratio; + memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, + .engine_msg_stack_ratio = 0, + .tx_msg_stack_ratio = 0, + .buffer_occupation_ratio = 0, + .msg_drop_number = 0}; + + memset(&memory_stats, 0, sizeof(memory_stats)); + MsgAlloc_Init(&memory_stats); + data_ptr = &msg_buffer[0]; + + // Call function and Verify + //--------------------------- + // Empty buffer + TRY + { + expected_buffer_occupation_ratio = 0; + MsgAlloc_Loop(); + + NEW_STEP("Check that the buffer is empty"); + TEST_ASSERT_EQUAL(0, memory_stats.buffer_occupation_ratio); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + // Buffer occupation from 0 -> 100% + NEW_STEP("Check buffer is full in all cases"); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + for (uint16_t i = 1; i < MSG_BUFFER_SIZE; i++) + { + data_ptr = &msg_buffer[i]; + expected_buffer_occupation_ratio = (i * 100) / (MSG_BUFFER_SIZE); + + MsgAlloc_Loop(); + + TEST_ASSERT_EQUAL(expected_buffer_occupation_ratio, memory_stats.buffer_occupation_ratio); + } + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_MsgAlloc_Alloc() +{ + + NEW_TEST_CASE("Check if we assert when we try to allocate a message with no size and/or no phy"); + { + TRY + { + MsgAlloc_Alloc(0, 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_Alloc(1, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_Alloc(0, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check if we assert when we try to allocate a message with a size > MSG_BUFFER_SIZE"); + { + TRY + { + MsgAlloc_Alloc(MSG_BUFFER_SIZE + 1, 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check an allocation with no message already registered"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + data_ptr = &msg_buffer[0]; + TEST_ASSERT_EQUAL(&msg_buffer[0], MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check an allocation with one message already registered"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[10]; + TEST_ASSERT_EQUAL(&msg_buffer[10], MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check an allocation with two messages already registered"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slots[1].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 2; + data_ptr = &msg_buffer[20]; + TEST_ASSERT_EQUAL(&msg_buffer[20], MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check an allocation overflowing the buffer end"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; + TEST_ASSERT_EQUAL(&msg_buffer[0], MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check an allocation with a message into the space we need"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[5]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check an allocation with a message into the space we need before the end of the buffer"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 5]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 7]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check an allocation with a message into the space we need at the begining of the buffer"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[1]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check alignement correction"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[1]; + TEST_ASSERT_EQUAL(&msg_buffer[2], MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check alignement correction limits by looping on it"); + { + volatile int i; + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = 0; + alloc_slot_index = 0; + data_ptr = &msg_buffer[0]; + for (i = 0; i < 600; i++) + { + volatile uint8_t *data; + data = MsgAlloc_Alloc(7, 0x01); + // Check if the data pointer moved accordingly => 7 + 1 for alignement + if (((i + 1) * 8) >= MSG_BUFFER_SIZE) + { + TEST_ASSERT_EQUAL((i * 8) - MSG_BUFFER_SIZE + (MSG_BUFFER_SIZE - (8 * (int)(MSG_BUFFER_SIZE / 8))), ((uintptr_t)data) - (uintptr_t)&msg_buffer[0]); + } + else + { + TEST_ASSERT_EQUAL((i * 8), ((uintptr_t)data) - (uintptr_t)&msg_buffer[0]); + } + MsgAlloc_Free(0, (const uint8_t *)data); + // Sort the allocator + MsgAlloc_Loop(); + } + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check an allocation with a message at the limit of the space we have"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[0]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[2]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[2]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 2 - (MSG_BUFFER_SIZE % 2)]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 2 - (MSG_BUFFER_SIZE % 2)]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[0]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(11, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 8]; + TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_MsgAlloc_IsEmpty() +{ + NEW_TEST_CASE("Check if we assert when we have more slot than we can handle"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = MSG_BUFFER_SIZE + 1; + MsgAlloc_IsEmpty(); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check if we return succed when we have no message"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_IsEmpty()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } + + NEW_TEST_CASE("Check if we return failed when we have a message"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slot_index = 1; + TEST_ASSERT_EQUAL(FAILED, MsgAlloc_IsEmpty()); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_MsgAlloc_Free(void) +{ + NEW_TEST_CASE("Check if we assert when we pass a null pointer"); + { + TRY + { + MsgAlloc_Free(0, 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check if we assert when we pass a philter that is not in the list"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slots[0].phy_filter = 0x01; + alloc_slot_index = 1; + MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check if we don't assert when there is no message in the list . (This can happen in case of reset)"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slot_index = 0; + MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check a normal free situation with the last concerned phy id"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slots[0].phy_filter = 0x01; + alloc_slot_index = 1; + MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); + TEST_ASSERT_EQUAL(0, alloc_slots[0].data); + TEST_ASSERT_EQUAL(0, alloc_slots[0].phy_filter); + TEST_ASSERT_EQUAL(1, alloc_slot_index); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Check a normal free situation with the multiple phy id"); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slots[0].phy_filter = 0x03; + alloc_slot_index = 1; + MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); + TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[0], alloc_slots[0].data); + TEST_ASSERT_EQUAL(0x02, alloc_slots[0].phy_filter); + TEST_ASSERT_EQUAL(1, alloc_slot_index); + MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); + TEST_ASSERT_EQUAL(0, alloc_slots[0].data); + TEST_ASSERT_EQUAL(0x00, alloc_slots[0].phy_filter); + TEST_ASSERT_EQUAL(1, alloc_slot_index); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } +} int main(int argc, char **argv) { diff --git a/test/tests_io/test_msg_alloc/main.h b/test/tests_io/test_msg_alloc/main.h deleted file mode 100644 index 007eccbbf..000000000 --- a/test/tests_io/test_msg_alloc/main.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -// Static functions -void unittest_SlotPack(void); -void unittest_GetOldestMsg(void); -void unittest_BufferAvailableSpaceComputation(void); -void unittest_DoWeHaveSpaceUntilBufferEnd(void); -void unittest_CheckMsgSpace(void); - -// public functions -void unittest_MsgAlloc_Loop(void); -void unittest_MsgAlloc_Alloc(void); -void unittest_MsgAlloc_IsEmpty(void); -void unittest_MsgAlloc_Free(void); - -#endif // MAIN_H diff --git a/test/tests_io/test_msg_alloc/unit_test_mem_alloc.c b/test/tests_io/test_msg_alloc/unit_test_mem_alloc.c deleted file mode 100644 index 37a806604..000000000 --- a/test/tests_io/test_msg_alloc/unit_test_mem_alloc.c +++ /dev/null @@ -1,931 +0,0 @@ -#include "main.h" -#include "unit_test.h" -#include "../src/msg_alloc.c" - -/******************************************************************************* - * Static Function - ******************************************************************************/ - -void unittest_SlotPack(void) -{ - uint8_t data = 0; - // This funciton should reorganize the buffer to pack the messages - // Create a already organized buffer with a random data - - NEW_TEST_CASE("Check if we assert when allocating more than the buffer size"); - { - alloc_slot_index = MAX_MSG_NB + 1; - TRY - { - MsgAlloc_SlotPack(); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Check if an already organized buffer is not modified"); - { - TRY - { - alloc_slots[0].data = &data; - alloc_slots[1].data = &data; - alloc_slots[2].data = &data; - alloc_slots[3].data = &data; - alloc_slots[4].data = 0; - alloc_slot_index = 4; - MsgAlloc_SlotPack(); - TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[3].data); - TEST_ASSERT_EQUAL(0, alloc_slots[4].data); - TEST_ASSERT_EQUAL(4, alloc_slot_index); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check if an unorganized buffer is organized"); - { - TRY - { - alloc_slots[0].data = 0; - alloc_slots[1].data = &data; - alloc_slots[2].data = &data; - alloc_slots[3].data = 0; - alloc_slots[4].data = 0; - alloc_slots[5].data = 0; - alloc_slots[6].data = &data; - alloc_slots[7].data = 0; - alloc_slot_index = 8; - MsgAlloc_SlotPack(); - TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); - TEST_ASSERT_EQUAL(0, alloc_slots[3].data); - TEST_ASSERT_EQUAL(0, alloc_slots[4].data); - TEST_ASSERT_EQUAL(0, alloc_slots[5].data); - TEST_ASSERT_EQUAL(0, alloc_slots[6].data); - TEST_ASSERT_EQUAL(0, alloc_slots[7].data); - TEST_ASSERT_EQUAL(3, alloc_slot_index); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check how it's managing the buffer to it's limits"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = 0; - alloc_slots[1].data = &data; - alloc_slots[2].data = &data; - alloc_slots[3].data = 0; - alloc_slots[4].data = 0; - alloc_slots[5].data = 0; - alloc_slots[6].data = &data; - alloc_slots[MAX_MSG_NB - 1].data = &data; - alloc_slot_index = MAX_MSG_NB; - MsgAlloc_SlotPack(); - TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[3].data); - TEST_ASSERT_EQUAL(0, alloc_slots[4].data); - TEST_ASSERT_EQUAL(0, alloc_slots[5].data); - TEST_ASSERT_EQUAL(0, alloc_slots[6].data); - TEST_ASSERT_EQUAL(0, alloc_slots[7].data); - TEST_ASSERT_EQUAL(0, alloc_slots[MAX_MSG_NB - 1].data); - TEST_ASSERT_EQUAL(4, alloc_slot_index); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } -} - -void unittest_GetOldestMsg(void) -{ - NEW_TEST_CASE("Check if we assert when allocating more than the buffer size"); - { - alloc_slot_index = MAX_MSG_NB + 1; - TRY - { - MsgAlloc_GetOldestMsg(); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Check the behavior if we dont have any message"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; - TEST_ASSERT_EQUAL(0, MsgAlloc_GetOldestMsg()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the behavior if we have a message in the first slot"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)0x1; - alloc_slot_index = 1; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the behavior if we have a message in another place"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[3].data = (uint8_t *)0x1; - alloc_slot_index = 4; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the behavior if we have a message in the last slot"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x1; - alloc_slot_index = MAX_MSG_NB; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the behavior if we have a message in the last slot and the first one"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)0x1; - alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x2; - alloc_slot_index = MAX_MSG_NB; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the behavior if we have a message in the last slot and the first one"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)0x1; - alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x2; - alloc_slot_index = MAX_MSG_NB; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } -} - -void unittest_BufferAvailableSpaceComputation(void) -{ - // This computation is based on the computed oldest message and the data ptr - NEW_TEST_CASE("Check if we assert when data_ptr is out of the buffer"); - { - alloc_slots[0].data = 0; - TRY - { - MsgAlloc_BufferAvailableSpaceComputation(); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE]; - TRY - { - MsgAlloc_BufferAvailableSpaceComputation(); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Check if we assert when olest_msg is out of the buffer"); - { - - TRY - { - MsgAlloc_BufferAvailableSpaceComputation(); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - data_ptr = &msg_buffer[MSG_BUFFER_SIZE]; - TRY - { - MsgAlloc_BufferAvailableSpaceComputation(); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - } - - NEW_TEST_CASE("Check the result if we don't have any messages"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; - data_ptr = (uint8_t *)&msg_buffer[0]; - TEST_ASSERT_EQUAL(MSG_BUFFER_SIZE, MsgAlloc_BufferAvailableSpaceComputation()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the result in a situation we don't have to loop around the buffer end"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - data_ptr = (uint8_t *)&msg_buffer[0]; - TEST_ASSERT_EQUAL(10, MsgAlloc_BufferAvailableSpaceComputation()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the result in a situation we have to loop around the buffer end"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; - TEST_ASSERT_EQUAL(20, MsgAlloc_BufferAvailableSpaceComputation()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the result in a situation we have to loop around the buffer end and data_ptr is set to the begin of the buffer"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; - TEST_ASSERT_EQUAL(10, MsgAlloc_BufferAvailableSpaceComputation()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } -} - -void unittest_DoWeHaveSpaceUntilBufferEnd(void) -{ - // In this specific function we may have a pointer after the end of the buffer but never before - - NEW_TEST_CASE("Check if we assert when to pointer is before the buffer"); - { - TRY - { - MsgAlloc_DoWeHaveSpaceUntilBufferEnd(0); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Check if it return SUCCEED when the pointer is in the buffer"); - { - TRY - { - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[0])); - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check if it return FAILED when the pointer is after the buffer"); - { - TRY - { - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE])); - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_DoWeHaveSpaceUntilBufferEnd((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE + 1])); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } -} - -void unittest_CheckMsgSpace(void) -{ - NEW_TEST_CASE("Check if we assert when from pointer is after the to pointer or at the same place"); - { - TRY - { - MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[0]); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - TRY - { - MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[1], (uint8_t *)&msg_buffer[0]); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - } - - NEW_TEST_CASE("Check if we assert when one of the pointer is out of the buffer"); - { - TRY - { - MsgAlloc_CheckMsgSpace(0, (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1]); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - TRY - { - MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1]); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - TRY - { - MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE + 1], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1]); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - TRY - { - MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE]); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - TRY - { - MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1], 0); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Check the result if we don't have any message yet"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the result if we have one message and the new one is before the old one"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[9])); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the result if we have one message and the new one is after the old one"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[11], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the result if we have one message and the new one is in the middle of the old one"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the result if we have one message and the new one is at the end of the old one"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[10])); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the result if we have one message and the new one is at the beginning of the old one"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[10], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } -} - -/******************************************************************************* - * Public Function - ******************************************************************************/ - -void unittest_MsgAlloc_Loop() -{ - NEW_TEST_CASE("Verify buffer occupation rate stat computing"); - MsgAlloc_Init(NULL); - { - // data_ptr is incremented : buffer occupation computing is verified - // - // msg_buffer - // +-------------------------------------------------------------+ - // |-------------------------------------------------------------| - // ^-------------------------^---------------------^-------------+ - // | | | - // data_ptr data_ptr data_ptr - // (0% occupation) (X% occupation) (etc...) - // - - // Init variables - //--------------- - uint32_t expected_buffer_occupation_ratio; - memory_stats_t memory_stats = {.rx_msg_stack_ratio = 0, - .engine_msg_stack_ratio = 0, - .tx_msg_stack_ratio = 0, - .buffer_occupation_ratio = 0, - .msg_drop_number = 0}; - - memset(&memory_stats, 0, sizeof(memory_stats)); - MsgAlloc_Init(&memory_stats); - data_ptr = &msg_buffer[0]; - - // Call function and Verify - //--------------------------- - // Empty buffer - TRY - { - expected_buffer_occupation_ratio = 0; - MsgAlloc_Loop(); - - NEW_STEP("Check that the buffer is empty"); - TEST_ASSERT_EQUAL(0, memory_stats.buffer_occupation_ratio); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - // Buffer occupation from 0 -> 100% - NEW_STEP("Check buffer is full in all cases"); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - for (uint16_t i = 1; i < MSG_BUFFER_SIZE; i++) - { - data_ptr = &msg_buffer[i]; - expected_buffer_occupation_ratio = (i * 100) / (MSG_BUFFER_SIZE); - - MsgAlloc_Loop(); - - TEST_ASSERT_EQUAL(expected_buffer_occupation_ratio, memory_stats.buffer_occupation_ratio); - } - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } -} - -void unittest_MsgAlloc_Alloc() -{ - - NEW_TEST_CASE("Check if we assert when we try to allocate a message with no size and/or no phy"); - { - TRY - { - MsgAlloc_Alloc(0, 1); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - TRY - { - MsgAlloc_Alloc(1, 0); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - TRY - { - MsgAlloc_Alloc(0, 0); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Check if we assert when we try to allocate a message with a size > MSG_BUFFER_SIZE"); - { - TRY - { - MsgAlloc_Alloc(MSG_BUFFER_SIZE + 1, 1); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Check an allocation with no message already registered"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; - data_ptr = &msg_buffer[0]; - TEST_ASSERT_EQUAL(&msg_buffer[0], MsgAlloc_Alloc(10, 0x01)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check an allocation with one message already registered"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[10]; - TEST_ASSERT_EQUAL(&msg_buffer[10], MsgAlloc_Alloc(10, 0x01)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check an allocation with two messages already registered"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slots[1].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 2; - data_ptr = &msg_buffer[20]; - TEST_ASSERT_EQUAL(&msg_buffer[20], MsgAlloc_Alloc(10, 0x01)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check an allocation overflowing the buffer end"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; - TEST_ASSERT_EQUAL(&msg_buffer[0], MsgAlloc_Alloc(10, 0x01)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check an allocation with a message into the space we need"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[5]; - TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check an allocation with a message into the space we need before the end of the buffer"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 5]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 7]; - TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check an allocation with a message into the space we need at the begining of the buffer"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; - TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); - - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[1]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; - TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check alignement correction"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[1]; - TEST_ASSERT_EQUAL(&msg_buffer[2], MsgAlloc_Alloc(10, 0x01)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check an allocation with a message at the limit of the space we have"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[0]; - TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[2]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[2]; - TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 2 - (MSG_BUFFER_SIZE % 2)]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 2 - (MSG_BUFFER_SIZE % 2)]; - TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[0]; - TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(11, 0x01)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 8]; - TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } -} - -void unittest_MsgAlloc_IsEmpty() -{ - NEW_TEST_CASE("Check if we assert when we have more slot than we can handle"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = MSG_BUFFER_SIZE + 1; - MsgAlloc_IsEmpty(); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Check if we return succed when we have no message"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; - TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_IsEmpty()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check if we return failed when we have a message"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - TEST_ASSERT_EQUAL(FAILED, MsgAlloc_IsEmpty()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } -} - -void unittest_MsgAlloc_Free(void) -{ - NEW_TEST_CASE("Check if we assert when we pass a null pointer"); - { - TRY - { - MsgAlloc_Free(0, 0); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Check if we assert when we pass a philter that is not in the list"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slots[0].phy_filter = 0x01; - alloc_slot_index = 1; - MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Check if we don't assert when there is no message in the list . (This can happen in case of reset)"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; - MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - END_TRY; - } - - NEW_TEST_CASE("Check a normal free situation with the last concerned phy id"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slots[0].phy_filter = 0x01; - alloc_slot_index = 1; - MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); - TEST_ASSERT_EQUAL(0, alloc_slots[0].data); - TEST_ASSERT_EQUAL(0, alloc_slots[0].phy_filter); - TEST_ASSERT_EQUAL(1, alloc_slot_index); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - END_TRY; - } - - NEW_TEST_CASE("Check a normal free situation with the multiple phy id"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slots[0].phy_filter = 0x03; - alloc_slot_index = 1; - MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); - TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[0], alloc_slots[0].data); - TEST_ASSERT_EQUAL(0x02, alloc_slots[0].phy_filter); - TEST_ASSERT_EQUAL(1, alloc_slot_index); - MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); - TEST_ASSERT_EQUAL(0, alloc_slots[0].data); - TEST_ASSERT_EQUAL(0x00, alloc_slots[0].phy_filter); - TEST_ASSERT_EQUAL(1, alloc_slot_index); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - END_TRY; - } -} From 6405a1bb7dcfc7bcb2e4f21e3e1f61b543f6ab44 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 6 Jun 2023 17:33:21 +0200 Subject: [PATCH 071/150] Exclude some test for windows because it fail to execute it --- test/tests_core/test_node/main.c | 6 +++++- test/tests_io/test_phy/main.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test/tests_core/test_node/main.c b/test/tests_core/test_node/main.c index 5dccc73a1..c58bd0a88 100644 --- a/test/tests_core/test_node/main.c +++ b/test/tests_core/test_node/main.c @@ -99,7 +99,9 @@ void unittest_Node_SetState(void) node_ctx.timeout_run = true; node_ctx.timeout = 1; Node_SetState(LOCAL_DETECTION); +#ifndef _WIN32 TEST_ASSERT_NOT_EQUAL(0, (volatile uint32_t)node_ctx.timeout); +#endif TEST_ASSERT_EQUAL(true, node_ctx.timeout_run); TEST_ASSERT_EQUAL(LOCAL_DETECTION, node_ctx.state); @@ -107,7 +109,9 @@ void unittest_Node_SetState(void) node_ctx.timeout_run = true; node_ctx.timeout = 1; Node_SetState(EXTERNAL_DETECTION); - TEST_ASSERT_NOT_EQUAL(0, node_ctx.timeout); +#ifndef _WIN32 + TEST_ASSERT_NOT_EQUAL(0, (volatile uint32_t)node_ctx.timeout); +#endif TEST_ASSERT_EQUAL(true, node_ctx.timeout_run); TEST_ASSERT_EQUAL(EXTERNAL_DETECTION, node_ctx.state); } diff --git a/test/tests_io/test_phy/main.c b/test/tests_io/test_phy/main.c index aca26df63..645461d57 100644 --- a/test/tests_io/test_phy/main.c +++ b/test/tests_io/test_phy/main.c @@ -1090,7 +1090,9 @@ void unittest_phy_ComputeTimestamp() volatile time_luos_t resulting_latency = Phy_ComputeTimestamp(&job); TEST_ASSERT_EQUAL(0xAE, job.msg_pt->data[0]); +#ifndef _WIN32 TEST_ASSERT_NOT_EQUAL(TimeOD_TimeTo_ns(timestamp), TimeOD_TimeTo_ns(resulting_latency)); +#endif } CATCH { From e9910d0e1784cb3658d8cd27b3dd609ad1cf27f8 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 5 Jun 2023 10:17:46 +0200 Subject: [PATCH 072/150] Enable test coverage report --- .github/workflows/build.yml | 11 +++++++++++ .gitignore | 3 +++ platformio.ini | 3 ++- source_filter_script.py | 9 +++++++-- test/code_coverage.py | 5 +++++ 5 files changed, 28 insertions(+), 3 deletions(-) create mode 100755 test/code_coverage.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81e547de2..1840bd926 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,6 +44,16 @@ jobs: # Run Unit tests platformio test -vvv + - if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get install -y lcov + lcov -d .pio/build/native/ -c -o lcov.info + lcov --remove lcov.info '*/usr/*' '*/Platforms/*' '*/bootloader/*' '*/.pio/*' '*/HAL/*' '*/test/*' -o lcov.info + + - if: matrix.os == 'ubuntu-latest' + name: Coveralls + uses: coverallsapp/github-action@v2 + unit-tests: name: Unit tests needs: tests-run @@ -51,6 +61,7 @@ jobs: steps: - run: echo "Tests succeed!" + code-format: name: Code format runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 54745e067..e4450ea08 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,9 @@ **/.gitignore *.out *.log +*.info +*.profraw +cov/* /examples/projects/NUCLEO-G431KB/button/.mxproject /examples/projects/NUCLEO-G431KB/button/Button.gpdsc /examples/projects/NUCLEO-L432KC/button/Button.gpdsc diff --git a/platformio.ini b/platformio.ini index 99c0e2b68..efd7d324a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -23,10 +23,11 @@ lib_extra_dirs = $PROJECT_DIR/../ build_unflags = -Os build_flags = - -O1 + -O0 -include ./test/_resources/node_config.h -DUNIT_TEST -D LUOSHAL=STUB + --coverage build_type = debug test_build_src = true diff --git a/source_filter_script.py b/source_filter_script.py index 629f4e5a9..7c208ab38 100644 --- a/source_filter_script.py +++ b/source_filter_script.py @@ -125,6 +125,11 @@ if resources.is_dir(): env.Append(CPPPATH=[(resources.path)]) + if (current_os == 'Darwin'): + env.Append(LINKFLAGS=["--coverage"]) + + if (current_os == 'Linux') or (current_os == 'Windows'): + env.Append(LINKFLAGS=["-lgcov", "--coverage", "-fprofile-arcs"]) # CODE COVERAGE WILL BE ADDED SOON # if (current_os == 'Linux') or (current_os == 'Darwin') or (current_os == 'Windows'): # env.Append(LINKFLAGS=["-lgcov"]) @@ -136,9 +141,9 @@ # env.Execute(".pio/build/native/program test/"+file) # env.Execute("lcov -d .pio/build/native/ -c -o lcov.info") # env.Execute( - # "lcov --remove lcov.info '*/tool-unity/*' '*/test/*' -o filtered_lcov.info") + # "lcov --remove lcov.info '*/Platforms/*' '*/bootloader/*' '*/.pio/*' '*/HAL/*' '*/test/*' -o filtered_lcov.info") # env.Execute( - # "genhtml -o cov/ --demangle-cpp filtered_lcov.info") + # "genhtml filtered_lcov.info -o cov/ --demangle-cpp") # Generate code coverage when testing workflow is ended # env.AddPostAction(".pio/build/native/program", generateCoverageInfo) diff --git a/test/code_coverage.py b/test/code_coverage.py new file mode 100755 index 000000000..675188bce --- /dev/null +++ b/test/code_coverage.py @@ -0,0 +1,5 @@ +#!/usr/bin/env python +import os +os.system("lcov -d .pio/build/native/ -c -o lcov.info") +os.system("lcov --remove lcov.info '*/Platforms/*' '*/bootloader/*' '*/.pio/*' '*/HAL/*' '*/test/*' -o filtered_lcov.info") +os.system("genhtml filtered_lcov.info -o cov/ --demangle-cpp") From 51f8a9f8d402d0cf872f0b70707a9fad9adb0a7c Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 9 Jun 2023 10:47:51 +0200 Subject: [PATCH 073/150] Minor code cleanup. --- engine/IO/src/filter.c | 2 -- engine/IO/src/luos_phy.c | 7 +++---- engine/IO/src/msg_alloc.c | 8 ++++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c index d0a2ecca8..5e051b6f5 100644 --- a/engine/IO/src/filter.c +++ b/engine/IO/src/filter.c @@ -228,8 +228,6 @@ _CRITICAL uint8_t Filter_GetPhyTarget(header_t *header) break; default: LUOS_ASSERT(0); - // This concerns Robus only - return 0x01 << 1; break; } // This concerns Robus only by default diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 18e414fd2..24b8e5d1a 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -319,16 +319,15 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) // Now allocate it rx_data = MsgAlloc_Alloc(phy_ptr->rx_size, (uint8_t)phy_ptr->rx_phy_filter); phy_ptr->rx_data = rx_data; - // Assert if the allocation failed. We don't allow to loose a message comming from outside. if ((phy_ptr == &phy_ctx.phy[0]) && (rx_data == NULL)) { - // We don't successfully allocated the message. - // This is luos trying to send something, return and Luos will wait... + // We don't successfully allocated the message we are trying to send. + // return and the transmitter will be able to wait to get more space... LuosHAL_SetIrqState(true); phy_ptr->rx_keep = false; return; } - LUOS_ASSERT(rx_data != NULL); + LUOS_ASSERT(rx_data != NULL); // Assert if the allocation failed. We don't allow to loose a message comming from outside. // Job is done LuosHAL_SetIrqState(true); copy_from = (void *)phy_ptr->rx_buffer_base; diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 937bf9496..0e35637c5 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -77,10 +77,10 @@ volatile uint16_t alloc_slot_index; /*!< Index of the next slot able to be wri static inline void MsgAlloc_SlotPack(void); // msg buffering -_CRITICAL static inline error_return_t MsgAlloc_DoWeHaveSpaceUntilBufferEnd(void *to); +_CRITICAL static inline error_return_t MsgAlloc_DoWeHaveSpaceUntilBufferEnd(const void *to); // Allocator task stack TX check space -static inline error_return_t MsgAlloc_CheckMsgSpace(void *from, void *to); +static inline error_return_t MsgAlloc_CheckMsgSpace(const void *from, const void *to); // Available buffer space evaluation static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void); @@ -264,7 +264,7 @@ _CRITICAL static inline uint8_t *MsgAlloc_GetOldestMsg(void) * @return error_return_t * _CRITICAL function call in IRQ ******************************************************************************/ -_CRITICAL static inline error_return_t MsgAlloc_DoWeHaveSpaceUntilBufferEnd(void *to) +_CRITICAL static inline error_return_t MsgAlloc_DoWeHaveSpaceUntilBufferEnd(const void *to) { LUOS_ASSERT((uintptr_t)to >= (uintptr_t)&msg_buffer[0]); if ((uintptr_t)to > ((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE - 1])) @@ -411,7 +411,7 @@ error_return_t MsgAlloc_IsEmpty(void) * @param to : stop of the memory space to check * @return error_return_t ******************************************************************************/ -static inline error_return_t MsgAlloc_CheckMsgSpace(void *from, void *to) +static inline error_return_t MsgAlloc_CheckMsgSpace(const void *from, const void *to) { LUOS_ASSERT(((uintptr_t)from < (uintptr_t)to) && ((uintptr_t)from >= (uintptr_t)&msg_buffer[0]) From 15819d3deb3f8a483ba9ebdc3362301f62bb90c8 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 9 Jun 2023 10:48:16 +0200 Subject: [PATCH 074/150] Fix a missing node init in case of detection start message reception --- engine/IO/src/luos_io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 8fa5be12a..0d0734b2d 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -391,6 +391,7 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) case START_DETECTION: Phy_Reset(); MsgAlloc_Init(NULL); + Node_Init(); Node_SetState(EXTERNAL_DETECTION); Service_ClearId(); // Reset the data reception context From 2566b111b113766d955e776d6a9f0b3960acd9d3 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 9 Jun 2023 10:55:00 +0200 Subject: [PATCH 075/150] [Gate]Update data_manager to avoid to avoid hazardous function access asserting on the new Luos_engine version. --- tool_services/gate/data_manager.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/tool_services/gate/data_manager.c b/tool_services/gate/data_manager.c index 971c92a54..b25220a33 100644 --- a/tool_services/gate/data_manager.c +++ b/tool_services/gate/data_manager.c @@ -70,22 +70,25 @@ void DataManager_Run(service_t *service) void DataManager_RunPipeOnly(service_t *service) { msg_t data_msg; - while (Luos_ReadFromService(service, PipeLink_GetId(), &data_msg) == SUCCEED) + if (PipeLink_GetId() != 0) { - // This message is a command from pipe - // Convert the received data into Luos commands - static char data_cmd[GATE_BUFF_SIZE]; - if (data_msg.header.cmd == PARAMETERS) + while (Luos_ReadFromService(service, PipeLink_GetId(), &data_msg) == SUCCEED) { - uintptr_t pointer; - memcpy(&pointer, data_msg.data, sizeof(void *)); - PipeLink_SetDirectPipeSend((void *)pointer); - continue; - } - if (Luos_ReceiveData(service, &data_msg, data_cmd) > 0) - { - // We finish to receive this data, execute the received command - Convert_DataToLuos(service, data_cmd); + // This message is a command from pipe + // Convert the received data into Luos commands + static char data_cmd[GATE_BUFF_SIZE]; + if (data_msg.header.cmd == PARAMETERS) + { + uintptr_t pointer; + memcpy(&pointer, data_msg.data, sizeof(void *)); + PipeLink_SetDirectPipeSend((void *)pointer); + continue; + } + if (Luos_ReceiveData(service, &data_msg, data_cmd) > 0) + { + // We finish to receive this data, execute the received command + Convert_DataToLuos(service, data_cmd); + } } } if (Luos_ReadMsg(service, &data_msg) == SUCCEED) From a4356470cc6364f301ec2ca5af433ba2176f6979 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 9 Jun 2023 10:55:29 +0200 Subject: [PATCH 076/150] Secure job removal --- engine/IO/src/luos_io.c | 6 +++++- engine/IO/src/luos_phy.c | 7 ++----- test/tests_io/test_phy/main.c | 19 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 0d0734b2d..551928653 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -130,7 +130,11 @@ static void LuosIO_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job) else { // This message was a protocol one, we can remove it. - Phy_RmJob(luos_phy, job); + // When we receive a start detection we reset everything so we don't need to remove the message anymore. + if (luos_phy->job_nb != 0) + { + Phy_RmJob(luos_phy, job); + } } } diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 24b8e5d1a..a39875863 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -556,11 +556,8 @@ _CRITICAL void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job) { LUOS_ASSERT((phy_ptr != NULL) && (job >= phy_ptr->job) - && (job < &phy_ptr->job[MAX_MSG_NB])); - if (phy_ptr->job_nb == 0) - { - return; - } + && (job < &phy_ptr->job[MAX_MSG_NB]) + && (phy_ptr->job_nb != 0)); // We potentially need to free this message from msg allocator // Get the Phy index int phy_index = Phy_GetPhyId(phy_ptr); diff --git a/test/tests_io/test_phy/main.c b/test/tests_io/test_phy/main.c index 645461d57..0bb767af5 100644 --- a/test/tests_io/test_phy/main.c +++ b/test/tests_io/test_phy/main.c @@ -1359,6 +1359,15 @@ void unittest_phy_RmJob() } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; + + TRY + { + luos_phy->job_nb = 0; + Phy_RmJob(luos_phy, &luos_phy->job[0]); + TEST_ASSERT_EQUAL(0, luos_phy->job_nb); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; } NEW_TEST_CASE("Check RmJob normal conditions"); @@ -1367,16 +1376,6 @@ void unittest_phy_RmJob() phy_test_reset(); memory_stats_t memory_stats; MsgAlloc_Init(&memory_stats); - TRY - { - luos_phy->job_nb = 0; - Phy_RmJob(luos_phy, &luos_phy->job[0]); - TEST_ASSERT_EQUAL(0, luos_phy->job_nb); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } TRY { From 5eebf1dadd45e7e45305fc4d6f21f156f7ba23fc Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 9 Jun 2023 13:13:32 +0200 Subject: [PATCH 077/150] Fix a memory leak in case of dead target --- engine/IO/src/luos_phy.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index a39875863..550a54c27 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -438,11 +438,7 @@ _CRITICAL void Phy_DeadTargetSpotted(luos_phy_t *phy_ptr, phy_job_t *job) if ((phy_ptr->job[i].msg_pt->header.target == target) && (phy_ptr->job[i].msg_pt->header.target_mode == target_mode)) { // This job is targeting the dead target, remove it from the queue - phy_ptr->job_nb--; - for (int j = i; j < phy_ptr->job_nb; j++) - { - phy_ptr->job[j] = phy_ptr->job[j + 1]; - } + Phy_RmJob(phy_ptr, &phy_ptr->job[i]); } else { From 4399fb0713b597b7380f6235f20e0bedb71cc4bb Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 9 Jun 2023 13:23:08 +0200 Subject: [PATCH 078/150] Separate allocation and referencing of the allocation avoiding memory leak in case of corrupted reception. --- engine/IO/inc/msg_alloc.h | 1 + engine/IO/src/luos_phy.c | 3 ++ engine/IO/src/msg_alloc.c | 15 +++++--- test/tests_io/test_msg_alloc/main.c | 56 ++++++++++++++++++++++++++--- 4 files changed, 66 insertions(+), 9 deletions(-) diff --git a/engine/IO/inc/msg_alloc.h b/engine/IO/inc/msg_alloc.h index 8a99a115b..4f23511c3 100644 --- a/engine/IO/inc/msg_alloc.h +++ b/engine/IO/inc/msg_alloc.h @@ -19,6 +19,7 @@ void MsgAlloc_Loop(void); // Msg buffering functions uint8_t *MsgAlloc_Alloc(uint16_t data_size, uint8_t phy_filter); +void MsgAlloc_Reference(uint8_t *rx_data, uint8_t phy_filter); void MsgAlloc_Free(uint8_t phy_id, const uint8_t *data); error_return_t MsgAlloc_IsEmpty(void); diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 550a54c27..5a59b86fe 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -246,6 +246,9 @@ _CRITICAL void Phy_ValidMsg(luos_phy_t *phy_ptr) } if (phy_ptr->rx_keep == true) { + // This message is ok we can reference it in the allocator + MsgAlloc_Reference((uint8_t *)phy_ptr->rx_data, (uint8_t)phy_ptr->rx_phy_filter); + // Now we can create a phy_job to dispatch the tx_job later LUOS_ASSERT(phy_ctx.io_job_nb < MAX_MSG_NB); LuosHAL_SetIrqState(false); diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 0e35637c5..906ed3f36 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -344,16 +344,21 @@ _CRITICAL uint8_t *MsgAlloc_Alloc(uint16_t data_size, uint8_t phy_filter) // We don't have the space to store the message, return NULL to indicate that there is no more space return NULL; } - - // We consider this space as occupied, save its reference into the alloc_slots - alloc_slots[alloc_slot_index].data = returned_ptr; - alloc_slots[alloc_slot_index].phy_filter = phy_filter; - alloc_slot_index++; + // We consider this space as occupied // Move data to the next available space data_ptr = (uint8_t *)((uintptr_t)returned_ptr + data_size); return returned_ptr; } +_CRITICAL void MsgAlloc_Reference(uint8_t *rx_data, uint8_t phy_filter) +{ + LUOS_ASSERT((rx_data < &msg_buffer[MSG_BUFFER_SIZE]) && (rx_data >= &msg_buffer[0]) && (phy_filter != 0) && (alloc_slot_index < MAX_MSG_NB)); + // Reference a space into the alloc_slots + alloc_slots[alloc_slot_index].data = rx_data; + alloc_slots[alloc_slot_index].phy_filter = phy_filter; + alloc_slot_index++; +} + /****************************************************************************** * @brief Free a message * @param uint8_t phy_id : id of the phy that free the message diff --git a/test/tests_io/test_msg_alloc/main.c b/test/tests_io/test_msg_alloc/main.c index e2f61a01c..596f2a320 100644 --- a/test/tests_io/test_msg_alloc/main.c +++ b/test/tests_io/test_msg_alloc/main.c @@ -744,9 +744,9 @@ void unittest_MsgAlloc_Alloc() { TEST_ASSERT_EQUAL((i * 8), ((uintptr_t)data) - (uintptr_t)&msg_buffer[0]); } - MsgAlloc_Free(0, (const uint8_t *)data); - // Sort the allocator - MsgAlloc_Loop(); + // MsgAlloc_Free(0, (const uint8_t *)data); + // // Sort the allocator + // MsgAlloc_Loop(); } } CATCH @@ -824,7 +824,54 @@ void unittest_MsgAlloc_Alloc() } } -void unittest_MsgAlloc_IsEmpty() +void unittest_MsgAlloc_Reference(void) +{ + + NEW_TEST_CASE("Check if we assert when we try to reference a message with a bad data and/or no phy"); + { + + memset(alloc_slots, 0, sizeof(alloc_slots)); + TRY + { + MsgAlloc_Reference((uint8_t *)(msg_buffer - 1), 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_Reference((uint8_t *)&msg_buffer[MSG_BUFFER_SIZE], 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + TRY + { + MsgAlloc_Reference((uint8_t *)&msg_buffer[0], 0); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + TRY + { + alloc_slot_index = MAX_MSG_NB; + MsgAlloc_Reference((uint8_t *)&msg_buffer[0], 1); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + NEW_TEST_CASE("Check normal referencing condition"); + { + TRY + { + alloc_slot_index = 0; + MsgAlloc_Reference((uint8_t *)&msg_buffer[0], 1); + TEST_ASSERT_EQUAL(&msg_buffer[0], alloc_slots[0].data); + TEST_ASSERT_EQUAL(1, alloc_slot_index); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + +void unittest_MsgAlloc_IsEmpty(void) { NEW_TEST_CASE("Check if we assert when we have more slot than we can handle"); { @@ -969,6 +1016,7 @@ int main(int argc, char **argv) // Generic functions UNIT_TEST_RUN(unittest_MsgAlloc_Loop); UNIT_TEST_RUN(unittest_MsgAlloc_Alloc); + UNIT_TEST_RUN(unittest_MsgAlloc_Reference); UNIT_TEST_RUN(unittest_MsgAlloc_IsEmpty); UNIT_TEST_RUN(unittest_MsgAlloc_Free); From 89fc79d2d9ecf3e3952562341618d1233292ec66 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 12 Jun 2023 14:12:29 +0200 Subject: [PATCH 079/150] Move data_ptr in alloc if there is no space for at least a header. --- engine/IO/src/msg_alloc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 906ed3f36..2625b86ba 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -300,7 +300,7 @@ _CRITICAL uint8_t *MsgAlloc_Alloc(uint16_t data_size, uint8_t phy_filter) if ((uintptr_t)data_ptr % 2 == 1) { data_ptr++; - if (data_ptr == &msg_buffer[MSG_BUFFER_SIZE]) + if ((uintptr_t)data_ptr >= (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE - -sizeof(header_t)]) { data_ptr = &msg_buffer[0]; } @@ -347,6 +347,11 @@ _CRITICAL uint8_t *MsgAlloc_Alloc(uint16_t data_size, uint8_t phy_filter) // We consider this space as occupied // Move data to the next available space data_ptr = (uint8_t *)((uintptr_t)returned_ptr + data_size); + // Move the data_ptr to the begin of the buffer if we don't have space for at least a header + if ((uintptr_t)data_ptr >= (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE - sizeof(header_t)]) + { + data_ptr = &msg_buffer[0]; + } return returned_ptr; } From ba1cce500b5c97a0db1231f23777127a8bccb0a5 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 12 Jun 2023 16:38:10 +0200 Subject: [PATCH 080/150] Secure job.phy_data initialization avoiding data-race during the creation of the job. --- engine/IO/src/luos_phy.c | 1 + network/robus/src/robus.c | 2 ++ network/robus/src/transmission.c | 26 +++++++++++++++----------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 5a59b86fe..e78e4748f 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -398,6 +398,7 @@ static void Phy_Dispatch(void) phy_job.size = job->size; phy_job.ack = ((job->alloc_msg->header.target_mode == NODEIDACK) || (job->alloc_msg->header.target_mode == SERVICEIDACK)); phy_job.timestamp = Luos_IsMsgTimstamped(job->alloc_msg); + phy_job.phy_data = NULL; // Write the job in the phy queue and get back the pointer to it phy_job_t *job_ptr = Phy_AddJob(&phy_ctx.phy[y], &phy_job); diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index 44ff4edc7..f811cdd37 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -80,7 +80,9 @@ void Robus_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job) encaps[encaps_index].size = CRC_SIZE; // Save the precomputed encapsulation in the job + LuosHAL_SetIrqState(false); job->phy_data = (void *)&encaps[encaps_index]; + LuosHAL_SetIrqState(true); // Get the next encapsulation index for the next job encaps_index++; diff --git a/network/robus/src/transmission.c b/network/robus/src/transmission.c index 45fefe952..405d7f441 100644 --- a/network/robus/src/transmission.c +++ b/network/robus/src/transmission.c @@ -56,7 +56,6 @@ * Variables ******************************************************************************/ volatile uint8_t nbrRetry = 0; -robus_encaps_t *end = NULL; /******************************************************************************* * Function @@ -129,9 +128,10 @@ _CRITICAL void Transmit_Process() phy_job_t *job = Phy_GetJob(robus_phy); static uint8_t tx_data[sizeof(msg_t) + sizeof(robus_encaps_t)]; // Get the message encapsulation - if ((job != NULL) && (Transmit_GetLockStatus() == false)) + if ((job != NULL) && (Transmit_GetLockStatus() == false) && (job->phy_data != 0)) { - robus_encaps_t *encaps = (robus_encaps_t *)job->phy_data; + LUOS_ASSERT((job->phy_data != NULL) && (job->size != 0) && (job->size < sizeof(msg_t))); + robus_encaps_t *jobEncaps = (robus_encaps_t *)job->phy_data; // We have something to send // Check if we already try to send it multiple times and save it on stats if it is if (nbrRetry >= NBR_RETRY) @@ -174,8 +174,10 @@ _CRITICAL void Transmit_Process() if (!nbrRetry) { // This is the first time we try to send this message, we need to backup the original crc value and the job data to the TX_data buffer - crc_val = encaps->crc; + crc_val = jobEncaps->crc; memcpy(tx_data, job->data_pt, job->size); + // Add the end of the message in the end of the buffer + memcpy(&tx_data[job->size], jobEncaps->unmaped, jobEncaps->size); } // Put timestamping on data here @@ -183,19 +185,20 @@ _CRITICAL void Transmit_Process() { // Convert date to a sendable timestamp and put it on the encapsulation - encaps->timestamp = Phy_ComputeTimestamp(job); + jobEncaps->timestamp = Phy_ComputeTimestamp(job); - encaps->timestamped_crc = ll_crc_compute(encaps->unmaped, sizeof(time_luos_t), crc_val); - encaps->size = sizeof(time_luos_t) + CRC_SIZE; + jobEncaps->timestamped_crc = ll_crc_compute(jobEncaps->unmaped, sizeof(time_luos_t), crc_val); + jobEncaps->size = sizeof(time_luos_t) + CRC_SIZE; + // Add the end of the message in the end of the buffer + memcpy(&tx_data[job->size], jobEncaps->unmaped, jobEncaps->size); } // Transmit data if (Phy_GetJobNbr(robus_phy) != 0) { - // Add the end of the message in the end of the buffer - memcpy(&tx_data[job->size], encaps->unmaped, encaps->size); + LUOS_ASSERT((job->size + jobEncaps->size) >= 9); // We still have something to send, no reset occured - RobusHAL_ComTransmit(tx_data, (job->size + encaps->size)); + RobusHAL_ComTransmit(tx_data, (job->size + jobEncaps->size)); } } } @@ -233,6 +236,7 @@ _CRITICAL void Transmit_End(void) // Remove the job luos_phy_t *robus_phy = Robus_GetPhy(); phy_job_t *job = Phy_GetJob(robus_phy); + job->phy_data = 0; Phy_RmJob(robus_phy, job); } else if (ctx.tx.status == TX_NOK) @@ -241,7 +245,7 @@ _CRITICAL void Transmit_End(void) nbrRetry++; // compute a delay before retry RobusHAL_ResetTimeout(20 * nbrRetry * (Phy_GetNodeId() + 1)); - // Lock the trasmission to be sure no one can send something from this node. + // Lock the trasmission to be sure no one can send something from this node until next timeout. ctx.tx.lock = true; ctx.tx.status = TX_DISABLE; return; From eb234a44fb62caa282b10d1d7e847d09a38e1d2d Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 12 Jun 2023 17:04:56 +0200 Subject: [PATCH 081/150] Avoid potential job removal when system have been reseted during a transmission --- network/robus/src/transmission.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/network/robus/src/transmission.c b/network/robus/src/transmission.c index 405d7f441..a6df7e588 100644 --- a/network/robus/src/transmission.c +++ b/network/robus/src/transmission.c @@ -128,7 +128,7 @@ _CRITICAL void Transmit_Process() phy_job_t *job = Phy_GetJob(robus_phy); static uint8_t tx_data[sizeof(msg_t) + sizeof(robus_encaps_t)]; // Get the message encapsulation - if ((job != NULL) && (Transmit_GetLockStatus() == false) && (job->phy_data != 0)) + if ((job != NULL) && (Transmit_GetLockStatus() == false) && (job->phy_data != NULL)) { LUOS_ASSERT((job->phy_data != NULL) && (job->size != 0) && (job->size < sizeof(msg_t))); robus_encaps_t *jobEncaps = (robus_encaps_t *)job->phy_data; @@ -236,8 +236,12 @@ _CRITICAL void Transmit_End(void) // Remove the job luos_phy_t *robus_phy = Robus_GetPhy(); phy_job_t *job = Phy_GetJob(robus_phy); - job->phy_data = 0; - Phy_RmJob(robus_phy, job); + // We may had a reset during this transmission, so we need to check if we still have something to transmit + if (robus_phy->job_nb > 0) + { + job->phy_data = 0; + Phy_RmJob(robus_phy, job); + } } else if (ctx.tx.status == TX_NOK) { From 8b3d34a0ec46a27aa6ef1677f9dc201a1dac5dda Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 12 Jun 2023 17:18:00 +0200 Subject: [PATCH 082/150] Fix phy_data protection --- network/robus/src/transmission.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/robus/src/transmission.c b/network/robus/src/transmission.c index a6df7e588..6c6d2d35d 100644 --- a/network/robus/src/transmission.c +++ b/network/robus/src/transmission.c @@ -130,7 +130,7 @@ _CRITICAL void Transmit_Process() // Get the message encapsulation if ((job != NULL) && (Transmit_GetLockStatus() == false) && (job->phy_data != NULL)) { - LUOS_ASSERT((job->phy_data != NULL) && (job->size != 0) && (job->size < sizeof(msg_t))); + LUOS_ASSERT((job->phy_data != NULL) && (job->size != 0) && (job->size <= sizeof(msg_t))); robus_encaps_t *jobEncaps = (robus_encaps_t *)job->phy_data; // We have something to send // Check if we already try to send it multiple times and save it on stats if it is From 4621de79c8d64a2fb72a90da84c120eac8290340 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 12 Jun 2023 17:19:24 +0200 Subject: [PATCH 083/150] Avoid assert in case of corrupted message reception. Properly trash it. --- engine/IO/src/filter.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c index 5e051b6f5..ebfeb537b 100644 --- a/engine/IO/src/filter.c +++ b/engine/IO/src/filter.c @@ -227,7 +227,9 @@ _CRITICAL uint8_t Filter_GetPhyTarget(header_t *header) } break; default: - LUOS_ASSERT(0); + // We can be here in case of corrupted message. + // In this case nobody is concerned by this message. + return 0x00; break; } // This concerns Robus only by default From 503222971360c567db111979a21ec038118b76fc Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 12 Jun 2023 18:16:25 +0200 Subject: [PATCH 084/150] Fix daisy chained detection infinite loop due to msg_dispatch recursive call protection. --- engine/IO/src/luos_io.c | 12 ++++++++---- engine/IO/src/luos_phy.c | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 551928653..d1be5b727 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -37,7 +37,7 @@ typedef struct __attribute__((__packed__)) } node_bootstrap_t; static error_return_t LuosIO_StartTopologyDetection(service_t *service); -static error_return_t LuosIO_DetectNextNodes(service_t *service); +static error_return_t LuosIO_DetectNextNodes(service_t *service, bool wait_for_answer); static void LuosIO_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job); static error_return_t LuosIO_ConsumeMsg(const msg_t *input); static void LuosIO_TransmitLocalRoutingTable(service_t *service, msg_t *routeTB_msg); @@ -211,7 +211,7 @@ uint16_t LuosIO_TopologyDetection(service_t *service) // Setup sending service id service->id = 1; - if (LuosIO_DetectNextNodes(service) == FAILED) + if (LuosIO_DetectNextNodes(service, true) == FAILED) { // check the number of retry we made LUOS_ASSERT((redetect_nb <= 4)); @@ -344,7 +344,7 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) Node_Get()->node_id = node_bootstrap.nodeid; Robus_SaveNodeID(node_bootstrap.prev_nodeid); // Continue the topology detection on our other ports. - LuosIO_DetectNextNodes(service); + LuosIO_DetectNextNodes(service, false); break; default: LUOS_ASSERT(0); @@ -543,7 +543,7 @@ static inline void LuosIO_TransmitLocalRoutingTable(service_t *service, msg_t *r * @param service pointer to the detecting service * @return None. ******************************************************************************/ -static error_return_t LuosIO_DetectNextNodes(service_t *service) +static error_return_t LuosIO_DetectNextNodes(service_t *service, bool wait_for_answer) { // Lets try to poke other nodes while (Robus_FindNeighbour() == SUCCEED) @@ -557,6 +557,10 @@ static error_return_t LuosIO_DetectNextNodes(service_t *service) msg.header.cmd = WRITE_NODE_ID; msg.header.size = 0; Luos_SendMsg(service, &msg); + if (wait_for_answer == false) + { + return SUCCEED; + } // Wait the end of transmission while (Phy_TxAllComplete() == FAILED) ; diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index e78e4748f..ae2528e06 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -322,6 +322,7 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) // Now allocate it rx_data = MsgAlloc_Alloc(phy_ptr->rx_size, (uint8_t)phy_ptr->rx_phy_filter); phy_ptr->rx_data = rx_data; + // Check if this message is a luos transmission and if allocation succeed if ((phy_ptr == &phy_ctx.phy[0]) && (rx_data == NULL)) { // We don't successfully allocated the message we are trying to send. From b63d8c39221ffe96fe81c957b4f64009f325674a Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 12 Jun 2023 19:21:32 +0200 Subject: [PATCH 085/150] !fix corrupted messages --- test/tests_io/test_filter/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tests_io/test_filter/main.c b/test/tests_io/test_filter/main.c index b8ed62c91..c0f1522c0 100644 --- a/test/tests_io/test_filter/main.c +++ b/test/tests_io/test_filter/main.c @@ -459,7 +459,7 @@ void unittest_Filter_GetPhyTarget() header.target_mode = 0x0f; Filter_GetPhyTarget(&header); } - TEST_ASSERT_TRUE(IS_ASSERT()); + TEST_ASSERT_TRUE(!IS_ASSERT()); END_TRY; } From c174d4818088eb68c4ca66268ab1e8286c583d45 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 13 Jun 2023 17:21:25 +0200 Subject: [PATCH 086/150] Modify job management to avoid any job pointer movement allowing to share jobs to functions. --- engine/IO/inc/luos_io.h | 2 +- engine/IO/inc/luos_phy.h | 13 +- engine/IO/src/luos_io.c | 12 +- engine/IO/src/luos_phy.c | 96 +++++++++-- engine/core/src/luos_engine.c | 28 +--- test/tests_io/test_luos_io/main.c | 57 +++---- test/tests_io/test_phy/main.c | 254 +++++++++++++++++++++++------- 7 files changed, 327 insertions(+), 135 deletions(-) diff --git a/engine/IO/inc/luos_io.h b/engine/IO/inc/luos_io.h index 2c8bfb91a..36b24dd0e 100644 --- a/engine/IO/inc/luos_io.h +++ b/engine/IO/inc/luos_io.h @@ -29,7 +29,7 @@ uint16_t LuosIO_TopologyDetection(service_t *service); error_return_t LuosIO_Send(service_t *service, msg_t *msg); // Job management -error_return_t LuosIO_TryToGetJob(uint16_t job_id, phy_job_t **job); +error_return_t LuosIO_GetNextJob(phy_job_t **job); void LuosIO_RmJob(phy_job_t *job); uint16_t LuosIO_GetJobNb(void); error_return_t LuosIO_TxAllComplete(void); diff --git a/engine/IO/inc/luos_phy.h b/engine/IO/inc/luos_phy.h index d18987a1f..aca89ffcd 100644 --- a/engine/IO/inc/luos_phy.h +++ b/engine/IO/inc/luos_phy.h @@ -51,10 +51,12 @@ typedef struct luos_phy_t phy_target_t rx_phy_filter; // The phy concerned by this message. // *************** TX informations *************** - // Jobs are stores from the newest to the oldest to optimize pulling time allowing to do it in IRQ. - // So adding a job is done by moving all job up and adding the new one at 0, then add 1 to job_nb. - phy_job_t job[MAX_MSG_NB]; // List of phy jobs to send. - uint8_t job_nb; // Number of jobs to send. + // Jobs are used to send messages. during the message send phy may save a job pointer so we cann't move any job in the job list. + // When a job is created we have to guarantee that the job will stay. So we have to manage it as a circular buffer. + phy_job_t job[MAX_MSG_NB]; // List of phy jobs to send. + uint8_t job_nb; // Number of jobs to send. + uint16_t oldest_job_index; // Index of the oldest job. + uint16_t available_job_index; // Index of the next available job. void (*phy_cb)(struct luos_phy_t *phy_ptr, phy_job_t *job); // Callback } luos_phy_t; @@ -74,7 +76,8 @@ uint16_t Phy_GetNodeId(void); // Job management void Phy_DeadTargetSpotted(luos_phy_t *phy_ptr, phy_job_t *job); // If some messages failed to be sent, call this function to consider the target as dead -phy_job_t *Phy_GetJob(luos_phy_t *phy_ptr); // Use it to get the next job to send. +phy_job_t *Phy_GetJob(luos_phy_t *phy_ptr); // Use it to get the first job to send. +phy_job_t *Phy_GetNextJob(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to get the next job to send. void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to remove a job from your phy job list when it's done. uint16_t Phy_GetJobNbr(luos_phy_t *phy_ptr); // Use it to get the number of job you currently have to send on your phy_ptr.job list. diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index d1be5b727..b47b93ce3 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -586,13 +586,14 @@ static error_return_t LuosIO_DetectNextNodes(service_t *service, bool wait_for_a * @param job pointer to the job pointer * @return SUCEED if the job is available, FAILED if not. ******************************************************************************/ -error_return_t LuosIO_TryToGetJob(uint16_t job_id, phy_job_t **job) +error_return_t LuosIO_GetNextJob(phy_job_t **job) { LUOS_ASSERT(job != NULL); MSGALLOC_MUTEX_LOCK - if (job_id < luos_phy->job_nb) + phy_job_t *the_job = Phy_GetNextJob(luos_phy, *job); + *job = the_job; + if (the_job != NULL) { - *job = &luos_phy->job[job_id]; MSGALLOC_MUTEX_UNLOCK return SUCCEED; } @@ -607,8 +608,9 @@ error_return_t LuosIO_TryToGetJob(uint16_t job_id, phy_job_t **job) ******************************************************************************/ void LuosIO_RmJob(phy_job_t *job) { - LUOS_ASSERT((job >= luos_phy->job) - && (job < &luos_phy->job[luos_phy->job_nb])); + LUOS_ASSERT((job >= &luos_phy->job[0]) + && (job < &luos_phy->job[MAX_MSG_NB]) + && (job->phy_data != NULL)); // Be sure every service has finished to use this job if (*(service_filter_t *)job->phy_data != 0) { diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index ae2528e06..4263b32a9 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -124,7 +124,9 @@ void Phy_Reset(void) for (uint8_t i = 0; i < phy_ctx.phy_nb; i++) { memset((void *)&phy_ctx.phy[i].job, 0, sizeof(phy_ctx.phy[0].job)); - phy_ctx.phy[i].job_nb = 0; + phy_ctx.phy[i].job_nb = 0; + phy_ctx.phy[i].oldest_job_index = 0; + phy_ctx.phy[i].available_job_index = 0; } } @@ -437,18 +439,22 @@ _CRITICAL void Phy_DeadTargetSpotted(luos_phy_t *phy_ptr, phy_job_t *job) uint16_t target_mode = job->msg_pt->header.target_mode; // Remove all job targeting this target on this phy job queue; - int i = 0; - while (i < phy_ptr->job_nb) + + int i = phy_ptr->oldest_job_index; + while (i != phy_ptr->available_job_index) { - if ((phy_ptr->job[i].msg_pt->header.target == target) && (phy_ptr->job[i].msg_pt->header.target_mode == target_mode)) + if (phy_ptr->job[i].msg_pt != NULL) { - // This job is targeting the dead target, remove it from the queue - Phy_RmJob(phy_ptr, &phy_ptr->job[i]); + if ((phy_ptr->job[i].msg_pt->header.target == target) && (phy_ptr->job[i].msg_pt->header.target_mode == target_mode)) + { + // This job is targeting the dead target, remove it from the queue + Phy_RmJob(phy_ptr, &phy_ptr->job[i]); + } } - else + i++; + if (i >= MAX_MSG_NB) { - // Treat the next job - i++; + i = 0; } } } @@ -506,10 +512,17 @@ static phy_job_t *Phy_AddJob(luos_phy_t *phy_ptr, phy_job_t *phy_job) LUOS_ASSERT((phy_job != NULL) && (phy_ptr != NULL)); LUOS_ASSERT(phy_ptr->job_nb < MAX_MSG_NB); // Add the job to the queue + phy_job_t *returned_job = &phy_ptr->job[phy_ptr->available_job_index]; LuosHAL_SetIrqState(false); - phy_ptr->job[phy_ptr->job_nb++] = *phy_job; + phy_ptr->job[phy_ptr->available_job_index++] = *phy_job; + if (phy_ptr->available_job_index >= MAX_MSG_NB) + { + phy_ptr->available_job_index = 0; + } + LUOS_ASSERT(phy_ptr->available_job_index != phy_ptr->oldest_job_index); + phy_ptr->job_nb++; LuosHAL_SetIrqState(true); - return &phy_ptr->job[phy_ptr->job_nb - 1]; + return returned_job; } /****************************************************************************** @@ -524,7 +537,39 @@ _CRITICAL inline phy_job_t *Phy_GetJob(luos_phy_t *phy_ptr) { return NULL; } - return &phy_ptr->job[0]; + return &phy_ptr->job[phy_ptr->oldest_job_index]; +} + +/****************************************************************************** + * @brief Get the next job from the phy queue + * @param phy_ptr Phy to get the job from + * @return Job pointer + ******************************************************************************/ +_CRITICAL phy_job_t *Phy_GetNextJob(luos_phy_t *phy_ptr, phy_job_t *job) +{ + LUOS_ASSERT(phy_ptr != NULL); + if (job == NULL) + { + return Phy_GetJob(phy_ptr); + } + if (phy_ptr->job_nb == 0) + { + return NULL; + } + int job_id = Phy_GetJobId(phy_ptr, job); + do + { + job_id++; + if (job_id >= MAX_MSG_NB) + { + job_id = 0; + } + if (job_id == phy_ptr->available_job_index) + { + return NULL; + } + } while (phy_ptr->job[job_id].msg_pt == NULL); + return &phy_ptr->job[job_id]; } /****************************************************************************** @@ -541,6 +586,11 @@ inline int Phy_GetJobId(luos_phy_t *phy_ptr, phy_job_t *job) return (((uintptr_t)job - (uintptr_t)phy_ptr->job) / sizeof(phy_job_t)); } +/****************************************************************************** + * @brief Get the phy id from the phy pointer + * @param phy_ptr Phy pointer + * @return Phy id + ******************************************************************************/ inline int Phy_GetPhyId(luos_phy_t *phy_ptr) { LUOS_ASSERT((phy_ptr >= phy_ctx.phy) @@ -564,13 +614,27 @@ _CRITICAL void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job) int phy_index = Phy_GetPhyId(phy_ptr); MsgAlloc_Free(phy_index, job->data_pt); - // Remove the job from the queue + // Clear this job values + memset(job, 0, sizeof(phy_job_t)); + // Remove the job from the list + phy_ptr->job_nb--; uint8_t id = Phy_GetJobId(phy_ptr, job); - for (int i = id; i < phy_ptr->job_nb; i++) + if (id == phy_ptr->oldest_job_index) { - phy_ptr->job[i] = phy_ptr->job[i + 1]; + // We are removing the oldest job + while (phy_ptr->oldest_job_index != phy_ptr->available_job_index) + { + phy_ptr->oldest_job_index++; + if (phy_ptr->oldest_job_index >= MAX_MSG_NB) + { + phy_ptr->oldest_job_index = 0; + } + if (phy_ptr->job[phy_ptr->oldest_job_index].data_pt != NULL) + { + break; + } + } } - phy_ptr->job_nb--; } /****************************************************************************** diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 276d7263c..00faf4fc4 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -59,8 +59,7 @@ void Luos_Init(void) void Luos_Loop(void) { static uint32_t last_loop_date; - uint16_t remaining_job_number = 0; - phy_job_t *job; + phy_job_t *job = NULL; #ifdef WITH_BOOTLOADER // After 3 Luos_Loop, consider this application as safe and write a flag to let the booloader know it can jump to the application safely. @@ -86,18 +85,11 @@ void Luos_Loop(void) LuosIO_Loop(); // Look at all received jobs LUOS_MUTEX_LOCK - while (LuosIO_TryToGetJob(remaining_job_number, &job) != FAILED) + while (LuosIO_GetNextJob(&job) != FAILED) { // We got a job // Try to deliver it to the services - if (Service_Deliver(job) == FAILED) - { - // Some services wasn't able to get this job, they are in polling mode keep it for later. -#ifndef BOOTLOADER - remaining_job_number++; -#endif - } - else + if (Service_Deliver(job) != FAILED) { // Services consume this job. remove it LuosIO_RmJob(job); @@ -207,11 +199,10 @@ static error_return_t Luos_Send(service_t *service, msg_t *msg) error_return_t Luos_ReadMsg(service_t *service, msg_t *msg_to_write) { LUOS_ASSERT((msg_to_write != 0) && (service != 0)); - uint8_t service_index = Service_GetIndex(service); - int remaining_job_number = 0; - phy_job_t *job; + uint8_t service_index = Service_GetIndex(service); + phy_job_t *job = NULL; LUOS_MUTEX_LOCK - while (LuosIO_TryToGetJob(remaining_job_number, &job) != FAILED) + while (LuosIO_GetNextJob(&job) != FAILED) { // We got a job // Check if our service is concerned by this job @@ -238,7 +229,6 @@ error_return_t Luos_ReadMsg(service_t *service, msg_t *msg_to_write) LUOS_MUTEX_UNLOCK return SUCCEED; } - remaining_job_number++; } LUOS_MUTEX_UNLOCK return FAILED; @@ -255,11 +245,10 @@ error_return_t Luos_ReadFromService(service_t *service, uint16_t id, msg_t *msg_ { LUOS_ASSERT((msg_to_write != 0) && (service != 0) && (id != 0)); - uint16_t remaining_job_number = 0; - phy_job_t *job; + phy_job_t *job = NULL; uint8_t service_index = Service_GetIndex(service); LUOS_MUTEX_LOCK - while (LuosIO_TryToGetJob(remaining_job_number, &job) != FAILED) + while (LuosIO_GetNextJob(&job) != FAILED) { // We got a job // Check if our service is concerned by this job @@ -281,7 +270,6 @@ error_return_t Luos_ReadFromService(service_t *service, uint16_t id, msg_t *msg_ LUOS_MUTEX_UNLOCK return SUCCEED; } - remaining_job_number++; } LUOS_MUTEX_UNLOCK return FAILED; diff --git a/test/tests_io/test_luos_io/main.c b/test/tests_io/test_luos_io/main.c index f4480ab3a..00dfcc95e 100644 --- a/test/tests_io/test_luos_io/main.c +++ b/test/tests_io/test_luos_io/main.c @@ -844,32 +844,34 @@ void unittest_luosIO_DetectNextNodes() } } -void unittest_luosIO_TryToGetJob() +void unittest_luosIO_GetNextJob() { - NEW_TEST_CASE("Check assert condition for TryToGetJob"); + NEW_TEST_CASE("Check assert condition for GetNextJob"); { TRY { LuosIO_Init(); - LuosIO_TryToGetJob(0, NULL); + LuosIO_GetNextJob(NULL); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; } - NEW_TEST_CASE("Check TryToGetJob"); + NEW_TEST_CASE("Check GetNextJob"); { + LuosIO_Init(); + phy_job_t *job = NULL; + luos_phy->job_nb = 2; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 2; for (uint8_t i = 0; i < 2; i++) { TRY { - LuosIO_Init(); - phy_job_t *job = NULL; - luos_phy->job_nb = 2; luos_phy->job[0].data_pt = (uint8_t *)&msg_buffer[0]; luos_phy->job[1].data_pt = (uint8_t *)&msg_buffer[1]; - error_return_t returned_val = LuosIO_TryToGetJob(i, &job); + error_return_t returned_val = LuosIO_GetNextJob(&job); TEST_ASSERT_EQUAL(SUCCEED, returned_val); TEST_ASSERT_EQUAL(&msg_buffer[i], job->data_pt); @@ -883,13 +885,7 @@ void unittest_luosIO_TryToGetJob() TRY { - LuosIO_Init(); - phy_job_t *job = NULL; - luos_phy->job_nb = 2; - luos_phy->job[0].data_pt = (uint8_t *)&msg_buffer[0]; - luos_phy->job[1].data_pt = (uint8_t *)&msg_buffer[1]; - - error_return_t returned_val = LuosIO_TryToGetJob(2, &job); + error_return_t returned_val = LuosIO_GetNextJob(&job); TEST_ASSERT_EQUAL(FAILED, returned_val); TEST_ASSERT_EQUAL(NULL, job); @@ -917,7 +913,9 @@ void unittest_luosIO_RmJob() TRY { LuosIO_Init(); - luos_phy->job_nb = 3; + luos_phy->job_nb = 3; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 3; LuosIO_RmJob(&luos_phy->job[luos_phy->job_nb]); } TEST_ASSERT_TRUE(IS_ASSERT()); @@ -929,23 +927,26 @@ void unittest_luosIO_RmJob() TRY { LuosIO_Init(); - service_filter[0] = 0x00; - service_filter[1] = 0x01; - phy_job_t *job = NULL; - luos_phy->job_nb = 2; - luos_phy->job[0].data_pt = (uint8_t *)&msg_buffer[0]; - luos_phy->job[0].phy_data = &service_filter[0]; - luos_phy->job[1].data_pt = (uint8_t *)&msg_buffer[1]; - luos_phy->job[1].phy_data = &service_filter[1]; + service_filter[0] = 0x00; + service_filter[1] = 0x01; + phy_job_t *job = NULL; + luos_phy->job_nb = 2; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 2; + luos_phy->job[0].data_pt = (uint8_t *)&msg_buffer[0]; + luos_phy->job[0].phy_data = &service_filter[0]; + luos_phy->job[1].data_pt = (uint8_t *)&msg_buffer[1]; + luos_phy->job[1].phy_data = &service_filter[1]; LuosIO_RmJob(&luos_phy->job[0]); TEST_ASSERT_EQUAL(1, luos_phy->job_nb); - TEST_ASSERT_EQUAL(&msg_buffer[1], luos_phy->job[0].data_pt); + TEST_ASSERT_EQUAL(NULL, luos_phy->job[0].data_pt); + TEST_ASSERT_EQUAL(&msg_buffer[1], luos_phy->job[1].data_pt); // Job 2 is not removed because service_filter is not equal to 0x00 - LuosIO_RmJob(&luos_phy->job[0]); + LuosIO_RmJob(&luos_phy->job[1]); TEST_ASSERT_EQUAL(1, luos_phy->job_nb); - TEST_ASSERT_EQUAL(&msg_buffer[1], luos_phy->job[0].data_pt); + TEST_ASSERT_EQUAL(&msg_buffer[1], luos_phy->job[1].data_pt); } CATCH { @@ -984,7 +985,7 @@ int main(int argc, char **argv) UNIT_TEST_RUN(unittest_luosIO_TransmitLocalRoutingTable); UNIT_TEST_RUN(unittest_luosIO_ConsumeMsg); UNIT_TEST_RUN(unittest_luosIO_DetectNextNodes); - UNIT_TEST_RUN(unittest_luosIO_TryToGetJob); + UNIT_TEST_RUN(unittest_luosIO_GetNextJob); UNIT_TEST_RUN(unittest_luosIO_RmJob); UNIT_TEST_RUN(unittest_luosIO_GetJobNb); diff --git a/test/tests_io/test_phy/main.c b/test/tests_io/test_phy/main.c index 0bb767af5..1aab3e2b1 100644 --- a/test/tests_io/test_phy/main.c +++ b/test/tests_io/test_phy/main.c @@ -337,7 +337,9 @@ void unittest_phy_dispatch() { phy_test_reset(); memset(&luos_phy->job[0], 0, sizeof(phy_job_t)); - luos_phy->job_nb = 0; + luos_phy->job_nb = 0; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 0; // Create a fake job phy_ctx.io_job_nb = 1; @@ -358,6 +360,8 @@ void unittest_phy_dispatch() TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); TEST_ASSERT_EQUAL(1, luos_phy->job_nb); + TEST_ASSERT_EQUAL(0, luos_phy->oldest_job_index); + TEST_ASSERT_EQUAL(1, luos_phy->available_job_index); TEST_ASSERT_EQUAL(&luos_phy->job[0], Luos_handled_job); TEST_ASSERT_EQUAL(&msg_buffer[0], luos_phy->job[0].data_pt); TEST_ASSERT_EQUAL(10, luos_phy->job[0].size); @@ -480,11 +484,13 @@ void unittest_phy_deadTarget() { phy_test_reset(); // Create a fake phy job - luos_phy->job_nb = 1; - luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; - msg_t *msg = (msg_t *)msg_buffer; - msg->header.target_mode = NODEIDACK; - msg->header.target = 1; + luos_phy->job_nb = 1; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 1; + luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; + msg_t *msg = (msg_t *)msg_buffer; + msg->header.target_mode = NODEIDACK; + msg->header.target = 1; TEST_ASSERT_EQUAL(0, phy_ctx.failed_job_nb); Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); @@ -504,20 +510,24 @@ void unittest_phy_deadTarget() { phy_test_reset(); // Create a fake phy job - luos_phy->job_nb = 3; - luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; - luos_phy->job[1].data_pt = (uint8_t *)&msg_buffer[20]; // This is a different target, it should not be removed - luos_phy->job[2].data_pt = (uint8_t *)msg_buffer; - msg_t *msg = (msg_t *)msg_buffer; - msg->header.target_mode = NODEIDACK; - msg->header.target = 1; + luos_phy->job_nb = 3; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 3; + luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; + luos_phy->job[1].data_pt = (uint8_t *)&msg_buffer[20]; // This is a different target, it should not be removed + luos_phy->job[2].data_pt = (uint8_t *)msg_buffer; + msg_t *msg = (msg_t *)msg_buffer; + msg->header.target_mode = NODEIDACK; + msg->header.target = 1; TEST_ASSERT_EQUAL(0, phy_ctx.failed_job_nb); Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); TEST_ASSERT_EQUAL(1, phy_ctx.failed_job_nb); TEST_ASSERT_EQUAL(msg_buffer, phy_ctx.failed_job[0].data_pt); TEST_ASSERT_EQUAL(1, luos_phy->job_nb); - TEST_ASSERT_EQUAL(&msg_buffer[20], luos_phy->job[0].data_pt); + TEST_ASSERT_EQUAL(NULL, luos_phy->job[0].data_pt); + TEST_ASSERT_EQUAL(&msg_buffer[20], luos_phy->job[1].data_pt); + TEST_ASSERT_EQUAL(NULL, luos_phy->job[2].data_pt); } CATCH { @@ -529,19 +539,23 @@ void unittest_phy_deadTarget() { phy_test_reset(); // Create a fake phy job - luos_phy->job_nb = 3; - luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; - luos_phy->job[1].data_pt = (uint8_t *)msg_buffer; // All jobs should be removed - luos_phy->job[2].data_pt = (uint8_t *)msg_buffer; - msg_t *msg = (msg_t *)msg_buffer; - msg->header.target_mode = NODEIDACK; - msg->header.target = 1; + luos_phy->job_nb = 3; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 3; + luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; + luos_phy->job[1].data_pt = (uint8_t *)msg_buffer; // All jobs should be removed + luos_phy->job[2].data_pt = (uint8_t *)msg_buffer; + msg_t *msg = (msg_t *)msg_buffer; + msg->header.target_mode = NODEIDACK; + msg->header.target = 1; TEST_ASSERT_EQUAL(0, phy_ctx.failed_job_nb); Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); TEST_ASSERT_EQUAL(1, phy_ctx.failed_job_nb); TEST_ASSERT_EQUAL(msg_buffer, phy_ctx.failed_job[0].data_pt); TEST_ASSERT_EQUAL(0, luos_phy->job_nb); + TEST_ASSERT_EQUAL(3, luos_phy->oldest_job_index); + TEST_ASSERT_EQUAL(3, luos_phy->available_job_index); } CATCH { @@ -558,19 +572,23 @@ void unittest_phy_deadTarget() memory_stats_t memory_stats; MsgAlloc_Init(&memory_stats); // Create a fake phy job - luos_phy->job_nb = 3; - luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; - luos_phy->job[1].data_pt = (uint8_t *)&msg_buffer[20]; // This is a different target, it should not be removed - luos_phy->job[2].data_pt = (uint8_t *)msg_buffer; - msg_t *msg = (msg_t *)msg_buffer; - msg->header.target_mode = NODEIDACK; - msg->header.target = 1; + luos_phy->job_nb = 3; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 3; + luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; + luos_phy->job[1].data_pt = (uint8_t *)&msg_buffer[20]; // This is a different target, it should not be removed + luos_phy->job[2].data_pt = (uint8_t *)msg_buffer; + msg_t *msg = (msg_t *)msg_buffer; + msg->header.target_mode = NODEIDACK; + msg->header.target = 1; TEST_ASSERT_EQUAL(0, phy_ctx.failed_job_nb); Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); TEST_ASSERT_EQUAL(msg_buffer, phy_ctx.failed_job[0].data_pt); TEST_ASSERT_EQUAL(1, luos_phy->job_nb); - TEST_ASSERT_EQUAL(&msg_buffer[20], luos_phy->job[0].data_pt); + TEST_ASSERT_EQUAL(NULL, luos_phy->job[0].data_pt); + TEST_ASSERT_EQUAL(&msg_buffer[20], luos_phy->job[1].data_pt); + TEST_ASSERT_EQUAL(NULL, luos_phy->job[2].data_pt); TEST_ASSERT_EQUAL(1, phy_ctx.failed_job_nb); TEST_ASSERT_EQUAL(false, Luos_get_deadTarget); @@ -1085,7 +1103,7 @@ void unittest_phy_ComputeTimestamp() msg->data[0] = 0xAE; volatile time_luos_t timestamp = TimeOD_TimeFrom_ns(10); - memcpy(&msg->data[msg->header.size], ×tamp, sizeof(time_luos_t)); + memcpy(&msg->data[msg->header.size], (void *)×tamp, sizeof(time_luos_t)); volatile time_luos_t resulting_latency = Phy_ComputeTimestamp(&job); @@ -1167,10 +1185,14 @@ void unittest_phy_AddJob() TRY { phy_job_t phy_job; - luos_phy->job_nb = 3; - phy_job_t *resulting_job = Phy_AddJob(luos_phy, &phy_job); + luos_phy->job_nb = 3; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 3; + phy_job_t *resulting_job = Phy_AddJob(luos_phy, &phy_job); TEST_ASSERT_EQUAL(&luos_phy->job[3], resulting_job); TEST_ASSERT_EQUAL(4, luos_phy->job_nb); + TEST_ASSERT_EQUAL(4, luos_phy->available_job_index); + TEST_ASSERT_EQUAL(0, luos_phy->oldest_job_index); } CATCH { @@ -1196,8 +1218,10 @@ void unittest_phy_GetJob() { TRY { - luos_phy->job_nb = 0; - phy_job_t *resulting_job = Phy_GetJob(luos_phy); + luos_phy->job_nb = 0; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 0; + phy_job_t *resulting_job = Phy_GetJob(luos_phy); TEST_ASSERT_EQUAL(NULL, resulting_job); TEST_ASSERT_EQUAL(0, luos_phy->job_nb); } @@ -1208,8 +1232,10 @@ void unittest_phy_GetJob() TRY { - luos_phy->job_nb = 1; - phy_job_t *resulting_job = Phy_GetJob(luos_phy); + luos_phy->job_nb = 1; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 1; + phy_job_t *resulting_job = Phy_GetJob(luos_phy); TEST_ASSERT_EQUAL(&luos_phy->job[0], resulting_job); TEST_ASSERT_EQUAL(1, luos_phy->job_nb); } @@ -1220,8 +1246,10 @@ void unittest_phy_GetJob() TRY { - luos_phy->job_nb = 3; - phy_job_t *resulting_job = Phy_GetJob(luos_phy); + luos_phy->job_nb = 3; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 3; + phy_job_t *resulting_job = Phy_GetJob(luos_phy); TEST_ASSERT_EQUAL(&luos_phy->job[0], resulting_job); TEST_ASSERT_EQUAL(3, luos_phy->job_nb); } @@ -1232,6 +1260,74 @@ void unittest_phy_GetJob() } } +void unittest_phy_GetNextJob() +{ + NEW_TEST_CASE("Check GetNextJob assertion conditions"); + { + TRY + { + luos_phy->job_nb = 0; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 0; + phy_job_t *job = NULL; + phy_job_t *resulting_job = Phy_GetNextJob(NULL, job); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + } + + NEW_TEST_CASE("Check GetNextJob normal conditions"); + { + TRY + { + luos_phy->job_nb = 0; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 0; + phy_job_t *job = NULL; + job = Phy_GetNextJob(luos_phy, job); + TEST_ASSERT_EQUAL(NULL, job); + TEST_ASSERT_EQUAL(0, luos_phy->job_nb); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + phy_job_t *job = NULL; + TRY + { + luos_phy->job_nb = 1; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 1; + luos_phy->job[0].msg_pt = &msg_buffer[0]; + job = Phy_GetNextJob(luos_phy, job); + TEST_ASSERT_EQUAL(&luos_phy->job[0], job); + TEST_ASSERT_EQUAL(1, luos_phy->job_nb); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + + TRY + { + luos_phy->job_nb = 3; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 3; + luos_phy->job[0].msg_pt = &msg_buffer[0]; + luos_phy->job[1].msg_pt = &msg_buffer[1]; + luos_phy->job[2].msg_pt = &msg_buffer[2]; + job = Phy_GetNextJob(luos_phy, job); + TEST_ASSERT_EQUAL(&luos_phy->job[1], job); + TEST_ASSERT_EQUAL(3, luos_phy->job_nb); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + } +} + void unittest_phy_GetJobId() { NEW_TEST_CASE("Check GetJobId assertion conditions"); @@ -1379,12 +1475,14 @@ void unittest_phy_RmJob() TRY { - for (int i = 0; i < PHY_NB; i++) + for (int i = 0; i < MAX_MSG_NB - 1; i++) { - luos_phy->job_nb = i + 1; - luos_phy->job[i].data_pt = (uint8_t *)&msg_buffer[i]; + luos_phy->job_nb = 1; + luos_phy->oldest_job_index = i; + luos_phy->available_job_index = i + 1; + luos_phy->job[i].data_pt = (uint8_t *)&msg_buffer[i]; Phy_RmJob(luos_phy, &luos_phy->job[i]); - TEST_ASSERT_EQUAL(i, luos_phy->job_nb); + TEST_ASSERT_EQUAL(0, luos_phy->job_nb); TEST_ASSERT_EQUAL(NULL, luos_phy->job[i].data_pt); } } @@ -1392,22 +1490,47 @@ void unittest_phy_RmJob() { TEST_ASSERT_TRUE(false); } + } +} - TRY +void unittest_add_and_remove_jobs(void) +{ + NEW_TEST_CASE("Try to add and remove jobs massively"); + { + Phy_Init(); + for (int i = 0; i < MAX_MSG_NB - 1; i++) { - for (int i = 0; i < PHY_NB - 1; i++) + for (int y = 0; y <= i; y++) { - luos_phy->job_nb = i + 2; - luos_phy->job[i].data_pt = (uint8_t *)&msg_buffer[i]; - luos_phy->job[i + 1].data_pt = (uint8_t *)&msg_buffer[i + 1]; - Phy_RmJob(luos_phy, &luos_phy->job[i]); - TEST_ASSERT_EQUAL(i + 1, luos_phy->job_nb); - TEST_ASSERT_EQUAL(&msg_buffer[i + 1], luos_phy->job[i].data_pt); + phy_job_t job; + job.data_pt = (uint8_t *)&msg_buffer[0]; + Phy_AddJob(luos_phy, &job); + TEST_ASSERT_EQUAL(y + 1, luos_phy->job_nb); + } + for (int y = 0; y <= i; y++) + { + phy_job_t *job_get = Phy_GetJob(luos_phy); + Phy_RmJob(luos_phy, job_get); + TEST_ASSERT_EQUAL(i - y, luos_phy->job_nb); + } + for (int y = 0; y <= i; y++) + { + phy_job_t job; + job.data_pt = (uint8_t *)&msg_buffer[0]; + Phy_AddJob(luos_phy, &job); + TEST_ASSERT_EQUAL(y + 1, luos_phy->job_nb); + } + for (int y = i; y >= 0; y--) + { + uint16_t get_id = luos_phy->oldest_job_index + y; + if (get_id >= MAX_MSG_NB) + { + get_id -= MAX_MSG_NB; + } + phy_job_t *job_get = &luos_phy->job[get_id]; + Phy_RmJob(luos_phy, job_get); + TEST_ASSERT_EQUAL(y, luos_phy->job_nb); } - } - CATCH - { - TEST_ASSERT_TRUE(false); } } } @@ -1448,9 +1571,14 @@ void unittest_phy_TxAllComplete() { TRY { - luos_phy->job_nb = 1; - robus_phy->job_nb = 1; - error_return_t result = Phy_TxAllComplete(); + luos_phy->job_nb = 1; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 1; + robus_phy->job_nb = 1; + robus_phy->oldest_job_index = 0; + robus_phy->available_job_index = 1; + phy_ctx.phy_nb = 2; + error_return_t result = Phy_TxAllComplete(); TEST_ASSERT_EQUAL(FAILED, result); } CATCH @@ -1460,9 +1588,13 @@ void unittest_phy_TxAllComplete() TRY { - luos_phy->job_nb = 0; - robus_phy->job_nb = 1; - error_return_t result = Phy_TxAllComplete(); + luos_phy->job_nb = 0; + luos_phy->oldest_job_index = 0; + luos_phy->available_job_index = 0; + robus_phy->job_nb = 1; + robus_phy->oldest_job_index = 0; + robus_phy->available_job_index = 1; + error_return_t result = Phy_TxAllComplete(); TEST_ASSERT_EQUAL(FAILED, result); } CATCH @@ -1498,9 +1630,11 @@ int main(int argc, char **argv) UNIT_TEST_RUN(unittest_phy_GetNodeId); UNIT_TEST_RUN(unittest_phy_AddJob); UNIT_TEST_RUN(unittest_phy_GetJob); + UNIT_TEST_RUN(unittest_phy_GetNextJob); UNIT_TEST_RUN(unittest_phy_GetJobId); UNIT_TEST_RUN(unittest_phy_GetPhyId); UNIT_TEST_RUN(unittest_phy_RmJob); + UNIT_TEST_RUN(unittest_add_and_remove_jobs); UNIT_TEST_RUN(unittest_phy_GetJobNbr); UNIT_TEST_RUN(unittest_phy_TxAllComplete); From 2000d4bb1d675d4c729a643c5b05ba6d1fde99ee Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 13 Jun 2023 17:21:59 +0200 Subject: [PATCH 087/150] Clear auto-refresh when we clear service IDs. --- engine/core/src/service.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/core/src/service.c b/engine/core/src/service.c index 2abbb0f6f..16ec1a777 100644 --- a/engine/core/src/service.c +++ b/engine/core/src/service.c @@ -107,7 +107,10 @@ void Service_ClearId(void) { for (uint16_t i = 0; i < service_ctx.number; i++) { - service_ctx.list[i].id = DEFAULTID; + service_ctx.list[i].id = DEFAULTID; + service_ctx.list[i].auto_refresh.target = 0; + service_ctx.list[i].auto_refresh.time_ms = 0; + service_ctx.list[i].auto_refresh.last_update = 0; } } From 4323a23e6cf05a463a6d71573022bafac8208036 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 15 Jun 2023 11:18:22 +0200 Subject: [PATCH 088/150] Modify aloc slots management avoiding pointer movement and limiting IRQ disabling. --- engine/IO/src/luos_phy.c | 2 +- engine/IO/src/msg_alloc.c | 137 +++---- test/tests_io/test_luos_io/main.c | 17 - test/tests_io/test_msg_alloc/main.c | 548 ++++++++++++---------------- test/tests_io/test_phy/main.c | 14 +- 5 files changed, 296 insertions(+), 422 deletions(-) diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 4263b32a9..c98f6c5d0 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -367,7 +367,7 @@ static void Phy_Dispatch(void) { static bool running = false; int i = 0; - if (running) + if ((running) || (phy_ctx.io_job_nb == 0)) { return; } diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 2625b86ba..57f19e589 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -66,16 +66,15 @@ memory_stats_t *mem_stat = NULL; volatile uint8_t msg_buffer[MSG_BUFFER_SIZE]; /*!< Memory space used to save and alloc messages. */ volatile uint8_t *data_ptr; /*!< Pointer to the next data able to be written into msgbuffer. */ -alloc_slot_t alloc_slots[MAX_MSG_NB]; /*!< Slots used to save the index of the first byte of a message. */ -volatile uint16_t alloc_slot_index; /*!< Index of the next slot able to be written. */ +alloc_slot_t alloc_slots[MAX_MSG_NB]; /*!< Slots used to save the index of the first byte of a message. */ +volatile uint8_t alloc_nb; // Number of referenced allocations. +volatile uint16_t oldest_alloc_slot; // Index of the oldest allocation. +volatile uint16_t available_alloc_slot; // Index of the next available allocation slot. /******************************************************************************* * Functions ******************************************************************************/ -// Pack allocated messages -static inline void MsgAlloc_SlotPack(void); - // msg buffering _CRITICAL static inline error_return_t MsgAlloc_DoWeHaveSpaceUntilBufferEnd(const void *to); @@ -85,9 +84,6 @@ static inline error_return_t MsgAlloc_CheckMsgSpace(const void *from, const void // Available buffer space evaluation static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void); -// Find get the oldest message -_CRITICAL static inline uint8_t *MsgAlloc_GetOldestMsg(void); - /******************************************************************************* * Functions --> generic ******************************************************************************/ @@ -101,8 +97,10 @@ void MsgAlloc_Init(memory_stats_t *memory_stats) { //******** Init global vars pointers ********** LuosHAL_SetIrqState(false); - data_ptr = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 0; + data_ptr = (uint8_t *)&msg_buffer[0]; + alloc_nb = 0; + oldest_alloc_slot = 0; + available_alloc_slot = 0; memset((void *)alloc_slots, 0, sizeof(alloc_slots)); LuosHAL_SetIrqState(true); if (memory_stats != NULL) @@ -118,8 +116,6 @@ void MsgAlloc_Init(memory_stats_t *memory_stats) ******************************************************************************/ void MsgAlloc_Loop(void) { - // Pack the list of allocated messages - MsgAlloc_SlotPack(); // Compute buffer occupation rate uint8_t stat = 0; stat = (uint8_t)(((MSG_BUFFER_SIZE - MsgAlloc_BufferAvailableSpaceComputation()) * 100) / (MSG_BUFFER_SIZE)); @@ -129,46 +125,6 @@ void MsgAlloc_Loop(void) } } -/****************************************************************************** - * @brief re-organize the list of allocated messages - * @param None - * @return None - ******************************************************************************/ -static inline void MsgAlloc_SlotPack(void) -{ - LUOS_ASSERT(alloc_slot_index <= MAX_MSG_NB); - // Pack the list of allocated messages - uint16_t i = 0; - uint16_t decay = 0; - LuosHAL_SetIrqState(false); - for (i = 0; i < alloc_slot_index; i++) - { - if (alloc_slots[i].data == 0) - { - decay++; - } - else - { - if (decay == 0) - { - continue; - } - if (i < MAX_MSG_NB) - { - alloc_slots[i - decay] = alloc_slots[i]; - alloc_slots[i].data = 0; - } - else - { - - alloc_slots[i - decay].data = 0; - } - } - } - alloc_slot_index -= decay; - LuosHAL_SetIrqState(true); -} - /****************************************************************************** * @brief compute remaing space on msg_buffer. * @param None @@ -180,12 +136,14 @@ static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void) LUOS_ASSERT(((uintptr_t)data_ptr >= (uintptr_t)&msg_buffer[0]) && ((uintptr_t)data_ptr < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE])); LuosHAL_SetIrqState(false); - uint8_t *oldest_msg = MsgAlloc_GetOldestMsg(); + uint8_t *oldest_msg = alloc_slots[oldest_alloc_slot].data; + uint8_t *data_ptr_snapshot = (uint8_t *)data_ptr; + LuosHAL_SetIrqState(true); if (oldest_msg != NULL) { LUOS_ASSERT(((uintptr_t)oldest_msg >= (uintptr_t)&msg_buffer[0]) && ((uintptr_t)oldest_msg < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE])); // There is some tasks - if ((uintptr_t)oldest_msg > (uintptr_t)data_ptr) + if ((uintptr_t)oldest_msg > (uintptr_t)data_ptr_snapshot) { // The oldest task is between `data_ptr` and the end of the buffer // msg_buffer @@ -197,8 +155,7 @@ static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void) // | | // data_ptr oldest_msg // - stack_free_space = (uintptr_t)oldest_msg - (uintptr_t)data_ptr; - LuosHAL_SetIrqState(true); + stack_free_space = (uintptr_t)oldest_msg - (uintptr_t)data_ptr_snapshot; } else { @@ -214,45 +171,17 @@ static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void) // | | // oldest_msg data_ptr // - stack_free_space = ((uintptr_t)oldest_msg - (uintptr_t)&msg_buffer[0]) + ((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - (uintptr_t)data_ptr); - LuosHAL_SetIrqState(true); + stack_free_space = ((uintptr_t)oldest_msg - (uintptr_t)&msg_buffer[0]) + ((uintptr_t)&msg_buffer[MSG_BUFFER_SIZE] - (uintptr_t)data_ptr_snapshot); } } else { // There is nothing allocated stack_free_space = MSG_BUFFER_SIZE; - LuosHAL_SetIrqState(true); } return stack_free_space; } -/****************************************************************************** - * @brief update the new oldest message if we need to - * @param removed_msg : the freshly oldest removed message of the stack - * @return None - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL static inline uint8_t *MsgAlloc_GetOldestMsg(void) -{ - LUOS_ASSERT(alloc_slot_index <= MAX_MSG_NB); - // Get the oldest message - if (alloc_slot_index == 0) - { - // There is no message allocated - return NULL; - } - for (int i = 0; i < alloc_slot_index; i++) - { - if (alloc_slots[i].data != NULL) - { - return alloc_slots[i].data; - } - } - // There is no message allocated - return NULL; -} - /******************************************************************************* * Functions --> msg buffering ******************************************************************************/ @@ -357,11 +286,16 @@ _CRITICAL uint8_t *MsgAlloc_Alloc(uint16_t data_size, uint8_t phy_filter) _CRITICAL void MsgAlloc_Reference(uint8_t *rx_data, uint8_t phy_filter) { - LUOS_ASSERT((rx_data < &msg_buffer[MSG_BUFFER_SIZE]) && (rx_data >= &msg_buffer[0]) && (phy_filter != 0) && (alloc_slot_index < MAX_MSG_NB)); + LUOS_ASSERT((rx_data < &msg_buffer[MSG_BUFFER_SIZE]) && (rx_data >= &msg_buffer[0]) && (phy_filter != 0) && (alloc_nb < MAX_MSG_NB)); // Reference a space into the alloc_slots - alloc_slots[alloc_slot_index].data = rx_data; - alloc_slots[alloc_slot_index].phy_filter = phy_filter; - alloc_slot_index++; + alloc_slots[available_alloc_slot].data = rx_data; + alloc_slots[available_alloc_slot].phy_filter = phy_filter; + alloc_nb++; + available_alloc_slot++; + if (available_alloc_slot >= MAX_MSG_NB) + { + available_alloc_slot = 0; + } } /****************************************************************************** @@ -375,7 +309,8 @@ _CRITICAL void MsgAlloc_Free(uint8_t phy_id, const uint8_t *data) { LUOS_ASSERT(data != NULL); // Find the slot where the data is stored - for (int i = 0; i < alloc_slot_index; i++) + int i = oldest_alloc_slot; + while (i != available_alloc_slot) { if (alloc_slots[i].data == data) { @@ -389,9 +324,26 @@ _CRITICAL void MsgAlloc_Free(uint8_t phy_id, const uint8_t *data) { // This message is not used anymore, free it alloc_slots[i].data = NULL; + alloc_nb--; + if (i == oldest_alloc_slot) + { + do + { + oldest_alloc_slot++; + if (oldest_alloc_slot >= MAX_MSG_NB) + { + oldest_alloc_slot = 0; + } + } while ((alloc_slots[oldest_alloc_slot].data == NULL) && (oldest_alloc_slot != available_alloc_slot)); + } } return; } + i++; + if (i >= MAX_MSG_NB) + { + i = 0; + } } // If you pass here, the message have been freed already. // You probably are in detection and the reset detection reseted the allocator before this free. @@ -404,8 +356,7 @@ _CRITICAL void MsgAlloc_Free(uint8_t phy_id, const uint8_t *data) ******************************************************************************/ error_return_t MsgAlloc_IsEmpty(void) { - LUOS_ASSERT(alloc_slot_index <= MSG_BUFFER_SIZE); - if (alloc_slot_index == 0) + if (alloc_nb == 0) { return SUCCEED; } @@ -428,7 +379,7 @@ static inline error_return_t MsgAlloc_CheckMsgSpace(const void *from, const void && ((uintptr_t)from < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE]) && ((uintptr_t)to >= (uintptr_t)&msg_buffer[0]) && ((uintptr_t)to < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE])); - uint8_t *oldest_msg = MsgAlloc_GetOldestMsg(); + uint8_t *oldest_msg = alloc_slots[oldest_alloc_slot].data; if ((((uintptr_t)oldest_msg >= (uintptr_t)from) && ((uintptr_t)oldest_msg <= (uintptr_t)to))) { // FAILED CASES : diff --git a/test/tests_io/test_luos_io/main.c b/test/tests_io/test_luos_io/main.c index 00dfcc95e..cf59f4685 100644 --- a/test/tests_io/test_luos_io/main.c +++ b/test/tests_io/test_luos_io/main.c @@ -51,21 +51,6 @@ void unittest_luosIO_init() void unittest_luosIO_loop() { - NEW_TEST_CASE("Check that allocation treatment is done in loop"); - { - TRY - { - LuosIO_Init(); - alloc_slot_index = 3; - LuosIO_Loop(); - TEST_ASSERT_EQUAL(0, alloc_slot_index); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - END_TRY; - } NEW_TEST_CASE("Check that phy treatment is done in loop"); { @@ -387,7 +372,6 @@ void unittest_luosIO_ConsumeMsg() msg_t msg; luosIO_reset_overlap_callback(); phy_ctx.io_job_nb = 3; - alloc_slot_index = 3; Node_SetState(DETECTION_OK); service_ctx.list[0].id = 1; service_ctx.list[1].id = 2; @@ -400,7 +384,6 @@ void unittest_luosIO_ConsumeMsg() // Check received message content TEST_ASSERT_EQUAL(SUCCEED, ret_val); TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); - TEST_ASSERT_EQUAL(0, alloc_slot_index); TEST_ASSERT_EQUAL(EXTERNAL_DETECTION, Node_GetState()); } CATCH diff --git a/test/tests_io/test_msg_alloc/main.c b/test/tests_io/test_msg_alloc/main.c index 596f2a320..e50b30156 100644 --- a/test/tests_io/test_msg_alloc/main.c +++ b/test/tests_io/test_msg_alloc/main.c @@ -1,215 +1,6 @@ #include "unit_test.h" #include "../src/msg_alloc.c" -void unittest_SlotPack(void) -{ - uint8_t data = 0; - // This funciton should reorganize the buffer to pack the messages - // Create a already organized buffer with a random data - - NEW_TEST_CASE("Check if we assert when allocating more than the buffer size"); - { - alloc_slot_index = MAX_MSG_NB + 1; - TRY - { - MsgAlloc_SlotPack(); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Check if an already organized buffer is not modified"); - { - TRY - { - alloc_slots[0].data = &data; - alloc_slots[1].data = &data; - alloc_slots[2].data = &data; - alloc_slots[3].data = &data; - alloc_slots[4].data = 0; - alloc_slot_index = 4; - MsgAlloc_SlotPack(); - TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[3].data); - TEST_ASSERT_EQUAL(0, alloc_slots[4].data); - TEST_ASSERT_EQUAL(4, alloc_slot_index); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check if an unorganized buffer is organized"); - { - TRY - { - alloc_slots[0].data = 0; - alloc_slots[1].data = &data; - alloc_slots[2].data = &data; - alloc_slots[3].data = 0; - alloc_slots[4].data = 0; - alloc_slots[5].data = 0; - alloc_slots[6].data = &data; - alloc_slots[7].data = 0; - alloc_slot_index = 8; - MsgAlloc_SlotPack(); - TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); - TEST_ASSERT_EQUAL(0, alloc_slots[3].data); - TEST_ASSERT_EQUAL(0, alloc_slots[4].data); - TEST_ASSERT_EQUAL(0, alloc_slots[5].data); - TEST_ASSERT_EQUAL(0, alloc_slots[6].data); - TEST_ASSERT_EQUAL(0, alloc_slots[7].data); - TEST_ASSERT_EQUAL(3, alloc_slot_index); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check how it's managing the buffer to it's limits"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = 0; - alloc_slots[1].data = &data; - alloc_slots[2].data = &data; - alloc_slots[3].data = 0; - alloc_slots[4].data = 0; - alloc_slots[5].data = 0; - alloc_slots[6].data = &data; - alloc_slots[MAX_MSG_NB - 1].data = &data; - alloc_slot_index = MAX_MSG_NB; - MsgAlloc_SlotPack(); - TEST_ASSERT_EQUAL(&data, alloc_slots[0].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[1].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[2].data); - TEST_ASSERT_EQUAL(&data, alloc_slots[3].data); - TEST_ASSERT_EQUAL(0, alloc_slots[4].data); - TEST_ASSERT_EQUAL(0, alloc_slots[5].data); - TEST_ASSERT_EQUAL(0, alloc_slots[6].data); - TEST_ASSERT_EQUAL(0, alloc_slots[7].data); - TEST_ASSERT_EQUAL(0, alloc_slots[MAX_MSG_NB - 1].data); - TEST_ASSERT_EQUAL(4, alloc_slot_index); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } -} - -void unittest_GetOldestMsg(void) -{ - NEW_TEST_CASE("Check if we assert when allocating more than the buffer size"); - { - alloc_slot_index = MAX_MSG_NB + 1; - TRY - { - MsgAlloc_GetOldestMsg(); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Check the behavior if we dont have any message"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; - TEST_ASSERT_EQUAL(0, MsgAlloc_GetOldestMsg()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the behavior if we have a message in the first slot"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)0x1; - alloc_slot_index = 1; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the behavior if we have a message in another place"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[3].data = (uint8_t *)0x1; - alloc_slot_index = 4; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the behavior if we have a message in the last slot"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x1; - alloc_slot_index = MAX_MSG_NB; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the behavior if we have a message in the last slot and the first one"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)0x1; - alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x2; - alloc_slot_index = MAX_MSG_NB; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Check the behavior if we have a message in the last slot and the first one"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)0x1; - alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)0x2; - alloc_slot_index = MAX_MSG_NB; - TEST_ASSERT_EQUAL((uint8_t *)0x1, MsgAlloc_GetOldestMsg()); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } -} - void unittest_BufferAvailableSpaceComputation(void) { // This computation is based on the computed oldest message and the data ptr @@ -251,8 +42,10 @@ void unittest_BufferAvailableSpaceComputation(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; - data_ptr = (uint8_t *)&msg_buffer[0]; + alloc_nb = 0; + oldest_alloc_slot = 0; + available_alloc_slot = 0; + data_ptr = (uint8_t *)&msg_buffer[0]; TEST_ASSERT_EQUAL(MSG_BUFFER_SIZE, MsgAlloc_BufferAvailableSpaceComputation()); } CATCH @@ -266,9 +59,11 @@ void unittest_BufferAvailableSpaceComputation(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - data_ptr = (uint8_t *)&msg_buffer[0]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = (uint8_t *)&msg_buffer[0]; TEST_ASSERT_EQUAL(10, MsgAlloc_BufferAvailableSpaceComputation()); } CATCH @@ -282,9 +77,11 @@ void unittest_BufferAvailableSpaceComputation(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; TEST_ASSERT_EQUAL(20, MsgAlloc_BufferAvailableSpaceComputation()); } CATCH @@ -298,9 +95,11 @@ void unittest_BufferAvailableSpaceComputation(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; TEST_ASSERT_EQUAL(10, MsgAlloc_BufferAvailableSpaceComputation()); } CATCH @@ -402,7 +201,9 @@ void unittest_CheckMsgSpace(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; + alloc_nb = 0; + oldest_alloc_slot = 0; + available_alloc_slot = 0; TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); } CATCH @@ -416,8 +217,10 @@ void unittest_CheckMsgSpace(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[9])); } CATCH @@ -431,8 +234,13 @@ void unittest_CheckMsgSpace(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_nb = 0; + oldest_alloc_slot = 0; + available_alloc_slot = 0; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[11], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); } CATCH @@ -446,8 +254,10 @@ void unittest_CheckMsgSpace(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); } CATCH @@ -461,8 +271,10 @@ void unittest_CheckMsgSpace(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[10])); } CATCH @@ -476,8 +288,10 @@ void unittest_CheckMsgSpace(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[10], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); } CATCH @@ -536,8 +350,10 @@ void unittest_MsgAlloc_Loop() { // Buffer occupation from 0 -> 100% NEW_STEP("Check buffer is full in all cases"); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; for (uint16_t i = 1; i < MSG_BUFFER_SIZE; i++) { data_ptr = &msg_buffer[i]; @@ -593,8 +409,10 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; - data_ptr = &msg_buffer[0]; + alloc_nb = 0; + oldest_alloc_slot = 0; + available_alloc_slot = 0; + data_ptr = &msg_buffer[0]; TEST_ASSERT_EQUAL(&msg_buffer[0], MsgAlloc_Alloc(10, 0x01)); } CATCH @@ -608,9 +426,11 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[10]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = &msg_buffer[10]; TEST_ASSERT_EQUAL(&msg_buffer[10], MsgAlloc_Alloc(10, 0x01)); } CATCH @@ -624,10 +444,12 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slots[1].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 2; - data_ptr = &msg_buffer[20]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slots[1].data = (uint8_t *)&msg_buffer[10]; + alloc_nb = 2; + oldest_alloc_slot = 0; + available_alloc_slot = 2; + data_ptr = &msg_buffer[20]; TEST_ASSERT_EQUAL(&msg_buffer[20], MsgAlloc_Alloc(10, 0x01)); } CATCH @@ -641,9 +463,11 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; TEST_ASSERT_EQUAL(&msg_buffer[0], MsgAlloc_Alloc(10, 0x01)); } CATCH @@ -657,9 +481,11 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[5]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = &msg_buffer[5]; TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); } CATCH @@ -673,9 +499,11 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 5]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 7]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 5]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 7]; TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); } CATCH @@ -689,15 +517,19 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[1]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[1]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); } CATCH @@ -711,9 +543,11 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[1]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = &msg_buffer[1]; TEST_ASSERT_EQUAL(&msg_buffer[2], MsgAlloc_Alloc(10, 0x01)); } CATCH @@ -728,9 +562,11 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = 0; - alloc_slot_index = 0; - data_ptr = &msg_buffer[0]; + alloc_slots[0].data = 0; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = &msg_buffer[0]; for (i = 0; i < 600; i++) { volatile uint8_t *data; @@ -760,9 +596,11 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[0]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = &msg_buffer[0]; TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); } CATCH @@ -773,9 +611,11 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[2]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[2]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[2]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = &msg_buffer[2]; TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); } CATCH @@ -786,9 +626,11 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 2 - (MSG_BUFFER_SIZE % 2)]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 2 - (MSG_BUFFER_SIZE % 2)]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 2 - (MSG_BUFFER_SIZE % 2)]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 2 - (MSG_BUFFER_SIZE % 2)]; TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); } CATCH @@ -799,9 +641,11 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[0]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = &msg_buffer[0]; TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(11, 0x01)); } CATCH @@ -812,9 +656,11 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; - data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 8]; + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 8]; TEST_ASSERT_EQUAL(0, MsgAlloc_Alloc(10, 0x01)); } CATCH @@ -849,7 +695,9 @@ void unittest_MsgAlloc_Reference(void) END_TRY; TRY { - alloc_slot_index = MAX_MSG_NB; + alloc_nb = MAX_MSG_NB; + oldest_alloc_slot = 0; + available_alloc_slot = MAX_MSG_NB; MsgAlloc_Reference((uint8_t *)&msg_buffer[0], 1); } TEST_ASSERT_TRUE(IS_ASSERT()); @@ -859,10 +707,12 @@ void unittest_MsgAlloc_Reference(void) { TRY { - alloc_slot_index = 0; + alloc_nb = 0; + oldest_alloc_slot = 0; + available_alloc_slot = 0; MsgAlloc_Reference((uint8_t *)&msg_buffer[0], 1); TEST_ASSERT_EQUAL(&msg_buffer[0], alloc_slots[0].data); - TEST_ASSERT_EQUAL(1, alloc_slot_index); + TEST_ASSERT_EQUAL(1, alloc_nb); } CATCH { @@ -873,24 +723,14 @@ void unittest_MsgAlloc_Reference(void) void unittest_MsgAlloc_IsEmpty(void) { - NEW_TEST_CASE("Check if we assert when we have more slot than we can handle"); - { - TRY - { - memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = MSG_BUFFER_SIZE + 1; - MsgAlloc_IsEmpty(); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - NEW_TEST_CASE("Check if we return succed when we have no message"); { TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; + alloc_nb = 0; + oldest_alloc_slot = 0; + available_alloc_slot = 0; TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_IsEmpty()); } CATCH @@ -904,8 +744,10 @@ void unittest_MsgAlloc_IsEmpty(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_slot_index = 1; + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; TEST_ASSERT_EQUAL(FAILED, MsgAlloc_IsEmpty()); } CATCH @@ -934,7 +776,9 @@ void unittest_MsgAlloc_Free(void) memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; alloc_slots[0].phy_filter = 0x01; - alloc_slot_index = 1; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); } TEST_ASSERT_TRUE(IS_ASSERT()); @@ -946,8 +790,13 @@ void unittest_MsgAlloc_Free(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_slot_index = 0; + alloc_nb = 0; + oldest_alloc_slot = 0; + available_alloc_slot = 0; MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); + TEST_ASSERT_EQUAL(0, alloc_nb); + TEST_ASSERT_EQUAL(0, oldest_alloc_slot); + TEST_ASSERT_EQUAL(0, available_alloc_slot); } CATCH { @@ -963,11 +812,14 @@ void unittest_MsgAlloc_Free(void) memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; alloc_slots[0].phy_filter = 0x01; - alloc_slot_index = 1; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); TEST_ASSERT_EQUAL(0, alloc_slots[0].data); TEST_ASSERT_EQUAL(0, alloc_slots[0].phy_filter); - TEST_ASSERT_EQUAL(1, alloc_slot_index); + TEST_ASSERT_EQUAL(1, oldest_alloc_slot); + TEST_ASSERT_EQUAL(1, available_alloc_slot); } CATCH { @@ -983,15 +835,103 @@ void unittest_MsgAlloc_Free(void) memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; alloc_slots[0].phy_filter = 0x03; - alloc_slot_index = 1; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[0], alloc_slots[0].data); TEST_ASSERT_EQUAL(0x02, alloc_slots[0].phy_filter); - TEST_ASSERT_EQUAL(1, alloc_slot_index); + TEST_ASSERT_EQUAL(1, alloc_nb); + TEST_ASSERT_EQUAL(0, oldest_alloc_slot); + TEST_ASSERT_EQUAL(1, available_alloc_slot); MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); TEST_ASSERT_EQUAL(0, alloc_slots[0].data); TEST_ASSERT_EQUAL(0x00, alloc_slots[0].phy_filter); - TEST_ASSERT_EQUAL(1, alloc_slot_index); + TEST_ASSERT_EQUAL(0, alloc_nb); + TEST_ASSERT_EQUAL(1, oldest_alloc_slot); + TEST_ASSERT_EQUAL(1, available_alloc_slot); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + NEW_TEST_CASE("Try to free a message that is not the oldest one."); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; + alloc_slots[0].phy_filter = 0x01; + alloc_slots[1].data = (uint8_t *)&msg_buffer[1]; + alloc_slots[1].phy_filter = 0x01; + alloc_nb = 2; + oldest_alloc_slot = 0; + available_alloc_slot = 2; + MsgAlloc_Free(0, (uint8_t *)&msg_buffer[1]); + TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[0], alloc_slots[0].data); + TEST_ASSERT_EQUAL(1, alloc_nb); + TEST_ASSERT_EQUAL(0, oldest_alloc_slot); + TEST_ASSERT_EQUAL(2, available_alloc_slot); + MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); + TEST_ASSERT_EQUAL(0, alloc_slots[0].data); + TEST_ASSERT_EQUAL(0, alloc_nb); + TEST_ASSERT_EQUAL(2, oldest_alloc_slot); + TEST_ASSERT_EQUAL(2, available_alloc_slot); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + + NEW_TEST_CASE("Try to free a message that is not the oldest one with a buffer loop."); + { + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)&msg_buffer[0]; + alloc_slots[MAX_MSG_NB - 1].phy_filter = 0x01; + alloc_slots[0].data = (uint8_t *)&msg_buffer[1]; + alloc_slots[0].phy_filter = 0x01; + alloc_nb = 2; + oldest_alloc_slot = MAX_MSG_NB - 1; + available_alloc_slot = 1; + MsgAlloc_Free(0, (uint8_t *)&msg_buffer[1]); + TEST_ASSERT_EQUAL(1, alloc_nb); + TEST_ASSERT_EQUAL(MAX_MSG_NB - 1, oldest_alloc_slot); + TEST_ASSERT_EQUAL(1, available_alloc_slot); + MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); + TEST_ASSERT_EQUAL(0, alloc_nb); + TEST_ASSERT_EQUAL(1, oldest_alloc_slot); + TEST_ASSERT_EQUAL(1, available_alloc_slot); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + + TRY + { + memset(alloc_slots, 0, sizeof(alloc_slots)); + alloc_slots[MAX_MSG_NB - 1].data = (uint8_t *)&msg_buffer[0]; + alloc_slots[MAX_MSG_NB - 1].phy_filter = 0x01; + alloc_slots[0].data = (uint8_t *)&msg_buffer[1]; + alloc_slots[0].phy_filter = 0x01; + alloc_nb = 2; + oldest_alloc_slot = MAX_MSG_NB - 1; + available_alloc_slot = 1; + MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); + TEST_ASSERT_EQUAL(1, alloc_nb); + TEST_ASSERT_EQUAL(0, oldest_alloc_slot); + TEST_ASSERT_EQUAL(1, available_alloc_slot); + MsgAlloc_Free(0, (uint8_t *)&msg_buffer[1]); + TEST_ASSERT_EQUAL(0, alloc_nb); + TEST_ASSERT_EQUAL(1, oldest_alloc_slot); + TEST_ASSERT_EQUAL(1, available_alloc_slot); } CATCH { @@ -1007,8 +947,6 @@ int main(int argc, char **argv) // Static functions - UNIT_TEST_RUN(unittest_SlotPack); - UNIT_TEST_RUN(unittest_GetOldestMsg); UNIT_TEST_RUN(unittest_BufferAvailableSpaceComputation); UNIT_TEST_RUN(unittest_DoWeHaveSpaceUntilBufferEnd); UNIT_TEST_RUN(unittest_CheckMsgSpace); diff --git a/test/tests_io/test_phy/main.c b/test/tests_io/test_phy/main.c index 1aab3e2b1..7eb7bc92e 100644 --- a/test/tests_io/test_phy/main.c +++ b/test/tests_io/test_phy/main.c @@ -246,8 +246,10 @@ void unittest_phy_alloc() memory_stats_t memory_stats; MsgAlloc_Init(&memory_stats); // Put a fake message in allocation - alloc_slot_index = 1; - alloc_slots[0].data = (uint8_t *)&msg_buffer[7]; + alloc_nb = 1; + oldest_alloc_slot = 0; + available_alloc_slot = 1; + alloc_slots[0].data = (uint8_t *)&msg_buffer[7]; TRY { phy_test_reset(); @@ -1299,7 +1301,7 @@ void unittest_phy_GetNextJob() luos_phy->job_nb = 1; luos_phy->oldest_job_index = 0; luos_phy->available_job_index = 1; - luos_phy->job[0].msg_pt = &msg_buffer[0]; + luos_phy->job[0].data_pt = (const uint8_t *)&msg_buffer[0]; job = Phy_GetNextJob(luos_phy, job); TEST_ASSERT_EQUAL(&luos_phy->job[0], job); TEST_ASSERT_EQUAL(1, luos_phy->job_nb); @@ -1314,9 +1316,9 @@ void unittest_phy_GetNextJob() luos_phy->job_nb = 3; luos_phy->oldest_job_index = 0; luos_phy->available_job_index = 3; - luos_phy->job[0].msg_pt = &msg_buffer[0]; - luos_phy->job[1].msg_pt = &msg_buffer[1]; - luos_phy->job[2].msg_pt = &msg_buffer[2]; + luos_phy->job[0].data_pt = (const uint8_t *)&msg_buffer[0]; + luos_phy->job[1].data_pt = (const uint8_t *)&msg_buffer[1]; + luos_phy->job[2].data_pt = (const uint8_t *)&msg_buffer[2]; job = Phy_GetNextJob(luos_phy, job); TEST_ASSERT_EQUAL(&luos_phy->job[1], job); TEST_ASSERT_EQUAL(3, luos_phy->job_nb); From 89ba9a0bc52d02f5e1ef1dd5f0710bc53b0ab1a8 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 16 Jun 2023 10:46:54 +0200 Subject: [PATCH 089/150] Secure detection start occuring durring a transmission --- engine/IO/src/luos_io.c | 9 +++++++++ network/robus/src/robus.c | 2 ++ network/robus/src/transmission.c | 8 +++++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index b47b93ce3..1134d0c96 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -259,6 +259,15 @@ static error_return_t LuosIO_StartTopologyDetection(service_t *service) Phy_Reset(); // Wait 2ms to be sure all previous messages are received and treated by other nodes uint32_t start_tick = LuosHAL_GetSystick(); + while (LuosHAL_GetSystick() - start_tick < 2) + ; + // Resend the message just to be sure that no other messages were revceived during the reset. + Luos_SendMsg(service, &msg); + // Wait until message is actually transmitted + while (Phy_TxAllComplete() != SUCCEED) + ; + // Wait 2ms to be sure all previous messages are received and treated by other nodes + start_tick = LuosHAL_GetSystick(); while (LuosHAL_GetSystick() - start_tick < 2) ; try_nbr++; diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index f811cdd37..ce8ddf1ae 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -113,6 +113,8 @@ void Robus_SaveNodeID(uint16_t nodeid) void Robus_ResetNodeID(void) { PortMng_Init(); + Recep_Reset(); + Transmit_Init(); } /****************************************************************************** diff --git a/network/robus/src/transmission.c b/network/robus/src/transmission.c index 6c6d2d35d..4e9e5f137 100644 --- a/network/robus/src/transmission.c +++ b/network/robus/src/transmission.c @@ -74,6 +74,8 @@ void Transmit_Init(void) ctx.tx.collision = false; // Init Tx status ctx.tx.status = TX_DISABLE; + // Init the transmission retry counter + nbrRetry = 0; } /****************************************************************************** * @brief Transmit an ACK @@ -194,12 +196,16 @@ _CRITICAL void Transmit_Process() } // Transmit data - if (Phy_GetJobNbr(robus_phy) != 0) + if (Phy_GetJob(robus_phy) == job) { LUOS_ASSERT((job->size + jobEncaps->size) >= 9); // We still have something to send, no reset occured RobusHAL_ComTransmit(tx_data, (job->size + jobEncaps->size)); } + else + { + nbrRetry = 0; + } } } } From db157789fc10358863845193bb61ee425f55bf46 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 16 Jun 2023 10:48:58 +0200 Subject: [PATCH 090/150] Secure job and alloc slot management from dataraces and reduce IRQ off time --- engine/IO/src/luos_io.c | 2 ++ engine/IO/src/luos_phy.c | 35 +++++++++------------ engine/IO/src/msg_alloc.c | 26 ++++++++-------- test/tests_io/test_msg_alloc/main.c | 48 ----------------------------- test/tests_io/test_phy/main.c | 1 - 5 files changed, 30 insertions(+), 82 deletions(-) diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 1134d0c96..ec15c1f28 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -163,6 +163,7 @@ error_return_t LuosIO_Send(service_t *service, msg_t *msg) luos_phy->received_data = sizeof(header_t); luos_phy->rx_keep = true; // Tell phy that we want to keep this message Phy_ComputeHeader(luos_phy); + LUOS_ASSERT(luos_phy->rx_keep == true); // The header computation give us how many byte we need to have. // Just update the received data to the full message size. luos_phy->received_data = luos_phy->rx_size; @@ -271,6 +272,7 @@ static error_return_t LuosIO_StartTopologyDetection(service_t *service) while (LuosHAL_GetSystick() - start_tick < 2) ; try_nbr++; + } while ((MsgAlloc_IsEmpty() != SUCCEED) || (try_nbr > 5)); // Reinit our node id Node_Get()->node_id = 0; diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index c98f6c5d0..757e08276 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -254,15 +254,17 @@ _CRITICAL void Phy_ValidMsg(luos_phy_t *phy_ptr) // Now we can create a phy_job to dispatch the tx_job later LUOS_ASSERT(phy_ctx.io_job_nb < MAX_MSG_NB); LuosHAL_SetIrqState(false); - phy_ctx.io_job[phy_ctx.io_job_nb].timestamp = phy_ptr->rx_timestamp; - phy_ctx.io_job[phy_ctx.io_job_nb].alloc_msg = (msg_t *)phy_ptr->rx_data; - phy_ctx.io_job[phy_ctx.io_job_nb].phy_filter = phy_ptr->rx_phy_filter; - phy_ctx.io_job[phy_ctx.io_job_nb].size = phy_ptr->rx_size; - phy_ctx.io_job_nb++; + uint16_t my_job = phy_ctx.io_job_nb++; + LuosHAL_SetIrqState(true); + // Now copy the data in the job + phy_ctx.io_job[my_job].timestamp = phy_ptr->rx_timestamp; + phy_ctx.io_job[my_job].alloc_msg = (msg_t *)phy_ptr->rx_data; + phy_ctx.io_job[my_job].phy_filter = phy_ptr->rx_phy_filter; + phy_ctx.io_job[my_job].size = phy_ptr->rx_size; + // Then reset the phy to receive the next message phy_ptr->rx_data = phy_ptr->rx_buffer_base; phy_ptr->received_data = 0; - LuosHAL_SetIrqState(true); } } @@ -324,18 +326,17 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) // Now allocate it rx_data = MsgAlloc_Alloc(phy_ptr->rx_size, (uint8_t)phy_ptr->rx_phy_filter); phy_ptr->rx_data = rx_data; + LuosHAL_SetIrqState(true); // Check if this message is a luos transmission and if allocation succeed if ((phy_ptr == &phy_ctx.phy[0]) && (rx_data == NULL)) { // We don't successfully allocated the message we are trying to send. // return and the transmitter will be able to wait to get more space... - LuosHAL_SetIrqState(true); phy_ptr->rx_keep = false; return; } LUOS_ASSERT(rx_data != NULL); // Assert if the allocation failed. We don't allow to loose a message comming from outside. // Job is done - LuosHAL_SetIrqState(true); copy_from = (void *)phy_ptr->rx_buffer_base; // Now we can copy the data already received @@ -346,15 +347,8 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) } else { - LuosHAL_SetIrqState(false); - if (phy_ptr->rx_alloc_job) - { - // Job is done - phy_ptr->rx_alloc_job = false; - LuosHAL_SetIrqState(true); - return; - } - LuosHAL_SetIrqState(true); + // We don't want to keep it so we don't allocate it. + phy_ptr->rx_alloc_job = false; } } @@ -512,16 +506,17 @@ static phy_job_t *Phy_AddJob(luos_phy_t *phy_ptr, phy_job_t *phy_job) LUOS_ASSERT((phy_job != NULL) && (phy_ptr != NULL)); LUOS_ASSERT(phy_ptr->job_nb < MAX_MSG_NB); // Add the job to the queue - phy_job_t *returned_job = &phy_ptr->job[phy_ptr->available_job_index]; LuosHAL_SetIrqState(false); - phy_ptr->job[phy_ptr->available_job_index++] = *phy_job; + phy_job_t *returned_job = &phy_ptr->job[phy_ptr->available_job_index++]; if (phy_ptr->available_job_index >= MAX_MSG_NB) { phy_ptr->available_job_index = 0; } LUOS_ASSERT(phy_ptr->available_job_index != phy_ptr->oldest_job_index); - phy_ptr->job_nb++; LuosHAL_SetIrqState(true); + phy_ptr->job_nb++; + // Copy the actual job data to the allocated job + *returned_job = *phy_job; return returned_job; } diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 57f19e589..13bed5337 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -67,7 +67,6 @@ volatile uint8_t msg_buffer[MSG_BUFFER_SIZE]; /*!< Memory space used to save and volatile uint8_t *data_ptr; /*!< Pointer to the next data able to be written into msgbuffer. */ alloc_slot_t alloc_slots[MAX_MSG_NB]; /*!< Slots used to save the index of the first byte of a message. */ -volatile uint8_t alloc_nb; // Number of referenced allocations. volatile uint16_t oldest_alloc_slot; // Index of the oldest allocation. volatile uint16_t available_alloc_slot; // Index of the next available allocation slot. @@ -98,7 +97,6 @@ void MsgAlloc_Init(memory_stats_t *memory_stats) //******** Init global vars pointers ********** LuosHAL_SetIrqState(false); data_ptr = (uint8_t *)&msg_buffer[0]; - alloc_nb = 0; oldest_alloc_slot = 0; available_alloc_slot = 0; memset((void *)alloc_slots, 0, sizeof(alloc_slots)); @@ -139,6 +137,7 @@ static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void) uint8_t *oldest_msg = alloc_slots[oldest_alloc_slot].data; uint8_t *data_ptr_snapshot = (uint8_t *)data_ptr; LuosHAL_SetIrqState(true); + if (oldest_msg != NULL) { LUOS_ASSERT(((uintptr_t)oldest_msg >= (uintptr_t)&msg_buffer[0]) && ((uintptr_t)oldest_msg < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE])); @@ -221,6 +220,7 @@ _CRITICAL static inline error_return_t MsgAlloc_DoWeHaveSpaceUntilBufferEnd(cons ******************************************************************************/ _CRITICAL uint8_t *MsgAlloc_Alloc(uint16_t data_size, uint8_t phy_filter) { + // This function is always called with IRQ disabled. LUOS_ASSERT((data_size > 0) && (phy_filter != 0) && (data_size <= MSG_BUFFER_SIZE)); @@ -229,11 +229,8 @@ _CRITICAL uint8_t *MsgAlloc_Alloc(uint16_t data_size, uint8_t phy_filter) if ((uintptr_t)data_ptr % 2 == 1) { data_ptr++; - if ((uintptr_t)data_ptr >= (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE - -sizeof(header_t)]) - { - data_ptr = &msg_buffer[0]; - } } + // Check if we have space for the message if (MsgAlloc_DoWeHaveSpaceUntilBufferEnd((void *)(data_ptr + data_size)) == FAILED) { @@ -286,16 +283,18 @@ _CRITICAL uint8_t *MsgAlloc_Alloc(uint16_t data_size, uint8_t phy_filter) _CRITICAL void MsgAlloc_Reference(uint8_t *rx_data, uint8_t phy_filter) { - LUOS_ASSERT((rx_data < &msg_buffer[MSG_BUFFER_SIZE]) && (rx_data >= &msg_buffer[0]) && (phy_filter != 0) && (alloc_nb < MAX_MSG_NB)); + LUOS_ASSERT((rx_data < &msg_buffer[MSG_BUFFER_SIZE]) && (rx_data >= &msg_buffer[0]) && (phy_filter != 0)); // Reference a space into the alloc_slots - alloc_slots[available_alloc_slot].data = rx_data; - alloc_slots[available_alloc_slot].phy_filter = phy_filter; - alloc_nb++; - available_alloc_slot++; + LuosHAL_SetIrqState(false); + uint16_t my_slot = available_alloc_slot++; if (available_alloc_slot >= MAX_MSG_NB) { available_alloc_slot = 0; } + LUOS_ASSERT(available_alloc_slot != oldest_alloc_slot); + LuosHAL_SetIrqState(true); + alloc_slots[my_slot].data = rx_data; + alloc_slots[my_slot].phy_filter = phy_filter; } /****************************************************************************** @@ -318,13 +317,13 @@ _CRITICAL void MsgAlloc_Free(uint8_t phy_id, const uint8_t *data) // Remove the phy_id from the phy_filter // Assert if this phy have already been freed LUOS_ASSERT(alloc_slots[i].phy_filter & (0x01 << phy_id)); + LuosHAL_SetIrqState(false); alloc_slots[i].phy_filter &= ~(0x01 << phy_id); // Check if the phy_filter is empty if (alloc_slots[i].phy_filter == 0) { // This message is not used anymore, free it alloc_slots[i].data = NULL; - alloc_nb--; if (i == oldest_alloc_slot) { do @@ -337,6 +336,7 @@ _CRITICAL void MsgAlloc_Free(uint8_t phy_id, const uint8_t *data) } while ((alloc_slots[oldest_alloc_slot].data == NULL) && (oldest_alloc_slot != available_alloc_slot)); } } + LuosHAL_SetIrqState(true); return; } i++; @@ -356,7 +356,7 @@ _CRITICAL void MsgAlloc_Free(uint8_t phy_id, const uint8_t *data) ******************************************************************************/ error_return_t MsgAlloc_IsEmpty(void) { - if (alloc_nb == 0) + if (oldest_alloc_slot == available_alloc_slot) { return SUCCEED; } diff --git a/test/tests_io/test_msg_alloc/main.c b/test/tests_io/test_msg_alloc/main.c index e50b30156..91abc1be7 100644 --- a/test/tests_io/test_msg_alloc/main.c +++ b/test/tests_io/test_msg_alloc/main.c @@ -42,7 +42,6 @@ void unittest_BufferAvailableSpaceComputation(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_nb = 0; oldest_alloc_slot = 0; available_alloc_slot = 0; data_ptr = (uint8_t *)&msg_buffer[0]; @@ -60,7 +59,6 @@ void unittest_BufferAvailableSpaceComputation(void) { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = (uint8_t *)&msg_buffer[0]; @@ -78,7 +76,6 @@ void unittest_BufferAvailableSpaceComputation(void) { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; @@ -96,7 +93,6 @@ void unittest_BufferAvailableSpaceComputation(void) { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; @@ -201,7 +197,6 @@ void unittest_CheckMsgSpace(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_nb = 0; oldest_alloc_slot = 0; available_alloc_slot = 0; TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); @@ -218,7 +213,6 @@ void unittest_CheckMsgSpace(void) { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[9])); @@ -235,10 +229,8 @@ void unittest_CheckMsgSpace(void) { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_nb = 0; oldest_alloc_slot = 0; available_alloc_slot = 0; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[11], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); @@ -255,7 +247,6 @@ void unittest_CheckMsgSpace(void) { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); @@ -272,7 +263,6 @@ void unittest_CheckMsgSpace(void) { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[0], (uint8_t *)&msg_buffer[10])); @@ -289,7 +279,6 @@ void unittest_CheckMsgSpace(void) { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; TEST_ASSERT_EQUAL(FAILED, MsgAlloc_CheckMsgSpace((uint8_t *)&msg_buffer[10], (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 1])); @@ -351,7 +340,6 @@ void unittest_MsgAlloc_Loop() // Buffer occupation from 0 -> 100% NEW_STEP("Check buffer is full in all cases"); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; for (uint16_t i = 1; i < MSG_BUFFER_SIZE; i++) @@ -409,7 +397,6 @@ void unittest_MsgAlloc_Alloc() TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_nb = 0; oldest_alloc_slot = 0; available_alloc_slot = 0; data_ptr = &msg_buffer[0]; @@ -427,7 +414,6 @@ void unittest_MsgAlloc_Alloc() { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = &msg_buffer[10]; @@ -446,7 +432,6 @@ void unittest_MsgAlloc_Alloc() memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; alloc_slots[1].data = (uint8_t *)&msg_buffer[10]; - alloc_nb = 2; oldest_alloc_slot = 0; available_alloc_slot = 2; data_ptr = &msg_buffer[20]; @@ -464,7 +449,6 @@ void unittest_MsgAlloc_Alloc() { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 10]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; @@ -482,7 +466,6 @@ void unittest_MsgAlloc_Alloc() { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = &msg_buffer[5]; @@ -500,7 +483,6 @@ void unittest_MsgAlloc_Alloc() { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 5]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 7]; @@ -518,7 +500,6 @@ void unittest_MsgAlloc_Alloc() { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; @@ -526,7 +507,6 @@ void unittest_MsgAlloc_Alloc() memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[1]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 5]; @@ -544,7 +524,6 @@ void unittest_MsgAlloc_Alloc() { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = &msg_buffer[1]; @@ -563,7 +542,6 @@ void unittest_MsgAlloc_Alloc() { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = 0; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = &msg_buffer[0]; @@ -597,7 +575,6 @@ void unittest_MsgAlloc_Alloc() { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = &msg_buffer[0]; @@ -612,7 +589,6 @@ void unittest_MsgAlloc_Alloc() { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[2]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = &msg_buffer[2]; @@ -627,7 +603,6 @@ void unittest_MsgAlloc_Alloc() { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[MSG_BUFFER_SIZE - 2 - (MSG_BUFFER_SIZE % 2)]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 2 - (MSG_BUFFER_SIZE % 2)]; @@ -642,7 +617,6 @@ void unittest_MsgAlloc_Alloc() { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[10]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = &msg_buffer[0]; @@ -657,7 +631,6 @@ void unittest_MsgAlloc_Alloc() { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; data_ptr = &msg_buffer[MSG_BUFFER_SIZE - 8]; @@ -695,7 +668,6 @@ void unittest_MsgAlloc_Reference(void) END_TRY; TRY { - alloc_nb = MAX_MSG_NB; oldest_alloc_slot = 0; available_alloc_slot = MAX_MSG_NB; MsgAlloc_Reference((uint8_t *)&msg_buffer[0], 1); @@ -707,12 +679,10 @@ void unittest_MsgAlloc_Reference(void) { TRY { - alloc_nb = 0; oldest_alloc_slot = 0; available_alloc_slot = 0; MsgAlloc_Reference((uint8_t *)&msg_buffer[0], 1); TEST_ASSERT_EQUAL(&msg_buffer[0], alloc_slots[0].data); - TEST_ASSERT_EQUAL(1, alloc_nb); } CATCH { @@ -728,7 +698,6 @@ void unittest_MsgAlloc_IsEmpty(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_nb = 0; oldest_alloc_slot = 0; available_alloc_slot = 0; TEST_ASSERT_EQUAL(SUCCEED, MsgAlloc_IsEmpty()); @@ -745,7 +714,6 @@ void unittest_MsgAlloc_IsEmpty(void) { memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; TEST_ASSERT_EQUAL(FAILED, MsgAlloc_IsEmpty()); @@ -776,7 +744,6 @@ void unittest_MsgAlloc_Free(void) memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; alloc_slots[0].phy_filter = 0x01; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); @@ -790,11 +757,9 @@ void unittest_MsgAlloc_Free(void) TRY { memset(alloc_slots, 0, sizeof(alloc_slots)); - alloc_nb = 0; oldest_alloc_slot = 0; available_alloc_slot = 0; MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); - TEST_ASSERT_EQUAL(0, alloc_nb); TEST_ASSERT_EQUAL(0, oldest_alloc_slot); TEST_ASSERT_EQUAL(0, available_alloc_slot); } @@ -812,7 +777,6 @@ void unittest_MsgAlloc_Free(void) memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; alloc_slots[0].phy_filter = 0x01; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); @@ -835,19 +799,16 @@ void unittest_MsgAlloc_Free(void) memset(alloc_slots, 0, sizeof(alloc_slots)); alloc_slots[0].data = (uint8_t *)&msg_buffer[0]; alloc_slots[0].phy_filter = 0x03; - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[0], alloc_slots[0].data); TEST_ASSERT_EQUAL(0x02, alloc_slots[0].phy_filter); - TEST_ASSERT_EQUAL(1, alloc_nb); TEST_ASSERT_EQUAL(0, oldest_alloc_slot); TEST_ASSERT_EQUAL(1, available_alloc_slot); MsgAlloc_Free(1, (uint8_t *)&msg_buffer[0]); TEST_ASSERT_EQUAL(0, alloc_slots[0].data); TEST_ASSERT_EQUAL(0x00, alloc_slots[0].phy_filter); - TEST_ASSERT_EQUAL(0, alloc_nb); TEST_ASSERT_EQUAL(1, oldest_alloc_slot); TEST_ASSERT_EQUAL(1, available_alloc_slot); } @@ -866,17 +827,14 @@ void unittest_MsgAlloc_Free(void) alloc_slots[0].phy_filter = 0x01; alloc_slots[1].data = (uint8_t *)&msg_buffer[1]; alloc_slots[1].phy_filter = 0x01; - alloc_nb = 2; oldest_alloc_slot = 0; available_alloc_slot = 2; MsgAlloc_Free(0, (uint8_t *)&msg_buffer[1]); TEST_ASSERT_EQUAL((uint8_t *)&msg_buffer[0], alloc_slots[0].data); - TEST_ASSERT_EQUAL(1, alloc_nb); TEST_ASSERT_EQUAL(0, oldest_alloc_slot); TEST_ASSERT_EQUAL(2, available_alloc_slot); MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); TEST_ASSERT_EQUAL(0, alloc_slots[0].data); - TEST_ASSERT_EQUAL(0, alloc_nb); TEST_ASSERT_EQUAL(2, oldest_alloc_slot); TEST_ASSERT_EQUAL(2, available_alloc_slot); } @@ -896,15 +854,12 @@ void unittest_MsgAlloc_Free(void) alloc_slots[MAX_MSG_NB - 1].phy_filter = 0x01; alloc_slots[0].data = (uint8_t *)&msg_buffer[1]; alloc_slots[0].phy_filter = 0x01; - alloc_nb = 2; oldest_alloc_slot = MAX_MSG_NB - 1; available_alloc_slot = 1; MsgAlloc_Free(0, (uint8_t *)&msg_buffer[1]); - TEST_ASSERT_EQUAL(1, alloc_nb); TEST_ASSERT_EQUAL(MAX_MSG_NB - 1, oldest_alloc_slot); TEST_ASSERT_EQUAL(1, available_alloc_slot); MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); - TEST_ASSERT_EQUAL(0, alloc_nb); TEST_ASSERT_EQUAL(1, oldest_alloc_slot); TEST_ASSERT_EQUAL(1, available_alloc_slot); } @@ -921,15 +876,12 @@ void unittest_MsgAlloc_Free(void) alloc_slots[MAX_MSG_NB - 1].phy_filter = 0x01; alloc_slots[0].data = (uint8_t *)&msg_buffer[1]; alloc_slots[0].phy_filter = 0x01; - alloc_nb = 2; oldest_alloc_slot = MAX_MSG_NB - 1; available_alloc_slot = 1; MsgAlloc_Free(0, (uint8_t *)&msg_buffer[0]); - TEST_ASSERT_EQUAL(1, alloc_nb); TEST_ASSERT_EQUAL(0, oldest_alloc_slot); TEST_ASSERT_EQUAL(1, available_alloc_slot); MsgAlloc_Free(0, (uint8_t *)&msg_buffer[1]); - TEST_ASSERT_EQUAL(0, alloc_nb); TEST_ASSERT_EQUAL(1, oldest_alloc_slot); TEST_ASSERT_EQUAL(1, available_alloc_slot); } diff --git a/test/tests_io/test_phy/main.c b/test/tests_io/test_phy/main.c index 7eb7bc92e..bc2098a0d 100644 --- a/test/tests_io/test_phy/main.c +++ b/test/tests_io/test_phy/main.c @@ -246,7 +246,6 @@ void unittest_phy_alloc() memory_stats_t memory_stats; MsgAlloc_Init(&memory_stats); // Put a fake message in allocation - alloc_nb = 1; oldest_alloc_slot = 0; available_alloc_slot = 1; alloc_slots[0].data = (uint8_t *)&msg_buffer[7]; From db962742c52c24aa55fab7bf0d79d6eccacf3033 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 16 Jun 2023 19:51:29 +0200 Subject: [PATCH 091/150] bootloader cleanup --- engine/IO/src/luos_io.c | 5 +- engine/bootloader/bootloader_core.c | 221 ++++++++++++++-------------- engine/bootloader/bootloader_core.h | 1 - test/tests_io/test_luos_io/main.c | 2 +- 4 files changed, 113 insertions(+), 116 deletions(-) diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index ec15c1f28..b975a774d 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -514,9 +514,8 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) break; //**************************************** bootloader section **************************************** case BOOTLOADER_CMD: - // send data to the bootloader - LuosBootloader_MsgHandler(input); - return SUCCEED; + // TODO add here the bootloader command used in application avoiding to include bootloader files. + return FAILED; break; default: diff --git a/engine/bootloader/bootloader_core.c b/engine/bootloader/bootloader_core.c index 0a90dc5a7..d0d4c13ac 100644 --- a/engine/bootloader/bootloader_core.c +++ b/engine/bootloader/bootloader_core.c @@ -24,7 +24,6 @@ /******************************************************************************* * Variables ******************************************************************************/ -static bootloader_cmd_t bootloader_cmd; #ifdef BOOTLOADER // variables use to save binary data in flash @@ -38,7 +37,6 @@ uint16_t residual_space = (uint16_t)BUFFER_SIZE; uint32_t nb_bytes = 0; uint8_t crc = 0; bool load_flag = false; -uint16_t source_id = 0; // used to save source_id, ie gate_id uint32_t tickstart = 0; #ifndef BOOTLOADER_UPDATER @@ -57,8 +55,9 @@ static inline uint8_t LuosBootloader_IsEnoughSpace(uint32_t); static inline void LuosBootloader_EraseMemory(void); static inline void LuosBootloader_ProcessData(void); static inline void LuosBootloader_SaveLastData(void); -static void LuosBootloader_SendResponse(bootloader_cmd_t); -static void LuosBootloader_SendCrc(bootloader_cmd_t, uint8_t); +static void LuosBootloader_SendResponse(service_t *service, uint16_t source_id, bootloader_cmd_t response); +static void LuosBootloader_SendCrc(service_t *service, uint16_t source_id, bootloader_cmd_t, uint8_t); +static void LuosBootloader_MsgHandler(service_t *service, const msg_t *input); #endif /****************************************************************************** @@ -91,9 +90,9 @@ void LuosBootloader_Init(void) { revision_t version = {.major = 2, .minor = 0, .build = 0}; #ifdef BOOTLOADER_UPDATER - Luos_CreateService(0, VOID_TYPE, "boot_updater", version); + Luos_CreateService(LuosBootloader_MsgHandler, VOID_TYPE, "boot_updater", version); #else - Luos_CreateService(0, VOID_TYPE, "boot_service", version); + Luos_CreateService(LuosBootloader_MsgHandler, VOID_TYPE, "boot_service", version); #endif // set ID node saved in flash @@ -315,7 +314,7 @@ uint8_t compute_crc(void) * @param data : The crc value * @return None ******************************************************************************/ -void LuosBootloader_SendCrc(bootloader_cmd_t response, uint8_t data) +void LuosBootloader_SendCrc(service_t *service, uint16_t source_id, bootloader_cmd_t response, uint8_t data) { msg_t ready_msg; ready_msg.header.cmd = BOOTLOADER_RESP; @@ -328,7 +327,7 @@ void LuosBootloader_SendCrc(bootloader_cmd_t response, uint8_t data) uint32_t tick = LuosHAL_GetSystick(); while (LuosHAL_GetSystick() - tick < node->node_id) ; - Luos_SendMsg(0, &ready_msg); + Luos_SendMsg(service, &ready_msg); } /****************************************************************************** @@ -336,7 +335,7 @@ void LuosBootloader_SendCrc(bootloader_cmd_t response, uint8_t data) * @param response : The type of crc message * @return None ******************************************************************************/ -void LuosBootloader_SendResponse(bootloader_cmd_t response) +void LuosBootloader_SendResponse(service_t *service, uint16_t source_id, bootloader_cmd_t response) { msg_t ready_msg; ready_msg.header.cmd = BOOTLOADER_RESP; @@ -348,7 +347,7 @@ void LuosBootloader_SendResponse(bootloader_cmd_t response) uint32_t tick = LuosHAL_GetSystick(); while (LuosHAL_GetSystick() - tick < node->node_id) ; - Luos_SendMsg(0, &ready_msg); + Luos_SendMsg(service, &ready_msg); } /****************************************************************************** @@ -363,115 +362,115 @@ void LuosBootloader_Loop(void) /****************************************************************************** * @brief Message handler called from luos library + * @param service : Pointer to the service which received the message * @param input : Pointer to message received from luos network * @return None ******************************************************************************/ -void LuosBootloader_MsgHandler(const msg_t *input) +void LuosBootloader_MsgHandler(service_t *service, const msg_t *input) { - bootloader_cmd = input->data[0]; - - switch (bootloader_cmd) + if (input->header.cmd == BOOTLOADER_CMD) { + switch (input->data[0]) + { #ifdef WITH_BOOTLOADER - case BOOTLOADER_START: - // We're in the app, - // set bootloader mode, save node ID and reboot - LuosBootloader_JumpToBootloader(); - break; + case BOOTLOADER_START: + // We're in the app, + // set bootloader mode, save node ID and reboot + LuosBootloader_JumpToBootloader(); + break; #endif #ifdef BOOTLOADER - // we're in the bootloader, - // process cmd and data - case BOOTLOADER_READY: - source_id = input->header.source; - bootloader_data_size = input->header.size - 2 * sizeof(char); - Luos_Subscribe(0, (uint16_t)input->data[1]); - memcpy(bootloader_data, &(input->data[2]), bootloader_data_size); - - LuosHAL_SetMode((uint8_t)BOOT_MODE); - - // save binary length - memcpy(&nb_bytes, &bootloader_data[0], sizeof(uint32_t)); - // check free space in flash - if (LuosBootloader_IsEnoughSpace(nb_bytes) == SUCCEED) - { - // send READY response - LuosBootloader_SendResponse(BOOTLOADER_READY_RESP); - } - else - { - // send ERROR response - LuosBootloader_SendResponse(BOOTLOADER_ERROR_SIZE); - } - break; - - case BOOTLOADER_ERASE: - // erase flash memory - LuosBootloader_EraseMemory(); - // reset load flag - load_flag = false; - // send ERASE response - LuosBootloader_SendResponse(BOOTLOADER_ERASE_RESP); - break; - - case BOOTLOADER_BIN_CHUNK: - source_id = input->header.source; - bootloader_data_size = input->header.size - sizeof(char); - memcpy(bootloader_data, &(input->data[1]), bootloader_data_size); - - // handle binary data - LuosBootloader_ProcessData(); - // send ack to the Host - LuosBootloader_SendResponse(BOOTLOADER_BIN_CHUNK_RESP); - break; - - case BOOTLOADER_BIN_END: - source_id = input->header.source; - bootloader_data_size = input->header.size - sizeof(char); - memcpy(bootloader_data, &(input->data[1]), bootloader_data_size); - - // save the current page in flash memory - LuosBootloader_SaveLastData(); - // send ack to the Host - LuosBootloader_SendResponse(BOOTLOADER_BIN_END_RESP); - break; - - case BOOTLOADER_CRC_TEST: - crc = compute_crc(); - // send ack to the Host - LuosBootloader_SendCrc(BOOTLOADER_CRC_RESP, crc); - break; - - case BOOTLOADER_APP_SAVED: - // set load flag - load_flag = true; - Luos_Unsubscribe(0, input->header.target); - break; - - case BOOTLOADER_STOP: - // wait for the command to be send to all nodes - tickstart = LuosHAL_GetSystick(); - while ((LuosHAL_GetSystick() - tickstart) < 1000) - ; - // save bootloader mode in flash - if (load_flag || (LuosBootloader_GetMode() == APP_RELOAD_MODE)) - { - // boot the application programmed in dedicated flash partition - LuosBootloader_DeInit(); - LuosBootloader_JumpToApp(); - } - else - { - // reboot the node - LuosHAL_Reboot(); - } - break; + // we're in the bootloader, + // process cmd and data + case BOOTLOADER_READY: + bootloader_data_size = input->header.size - 2 * sizeof(char); + Luos_Subscribe(service, (uint16_t)input->data[1]); + memcpy(bootloader_data, &(input->data[2]), bootloader_data_size); // why? + + LuosHAL_SetMode((uint8_t)BOOT_MODE); + + // save binary length + memcpy(&nb_bytes, &bootloader_data[0], sizeof(uint32_t)); + // check free space in flash + if (LuosBootloader_IsEnoughSpace(nb_bytes) == SUCCEED) + { + // send READY response + LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_READY_RESP); + } + else + { + // send ERROR response + LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_ERROR_SIZE); + } + break; + + case BOOTLOADER_ERASE: + // erase flash memory + LuosBootloader_EraseMemory(); + // reset load flag + load_flag = false; + // send ERASE response + LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_ERASE_RESP); + break; + + case BOOTLOADER_BIN_CHUNK: + bootloader_data_size = input->header.size - sizeof(char); + memcpy(bootloader_data, &(input->data[1]), bootloader_data_size); + + // handle binary data + LuosBootloader_ProcessData(); + + // send ack to the Host + LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_BIN_CHUNK_RESP); + break; + + case BOOTLOADER_BIN_END: + bootloader_data_size = input->header.size - sizeof(char); + memcpy(bootloader_data, &(input->data[1]), bootloader_data_size); + + // save the current page in flash memory + LuosBootloader_SaveLastData(); + // send ack to the Host + LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_BIN_END_RESP); + break; + + case BOOTLOADER_CRC_TEST: + crc = compute_crc(); + // send ack to the Host + LuosBootloader_SendCrc(service, input->header.source, BOOTLOADER_CRC_RESP, crc); + break; + + case BOOTLOADER_APP_SAVED: + // set load flag + load_flag = true; + Luos_Unsubscribe(service, input->header.target); + break; + + case BOOTLOADER_STOP: + // wait for the command to be send to all nodes + tickstart = LuosHAL_GetSystick(); + while ((LuosHAL_GetSystick() - tickstart) < 1000) + ; + // save bootloader mode in flash + if (load_flag || (LuosBootloader_GetMode() == APP_RELOAD_MODE)) + { + // boot the application programmed in dedicated flash partition + LuosBootloader_DeInit(); + LuosBootloader_JumpToApp(); + } + else + { + // reboot the node + LuosHAL_Reboot(); + } + break; #endif - case BOOTLOADER_RESET: - LuosHAL_SetMode((uint8_t)BOOT_MODE); - LuosHAL_Reboot(); - break; - default: - break; + case BOOTLOADER_RESET: + LuosHAL_SetMode((uint8_t)BOOT_MODE); + LuosHAL_Reboot(); + break; + default: + break; + } } } diff --git a/engine/bootloader/bootloader_core.h b/engine/bootloader/bootloader_core.h index 2f2d7f949..5cb68e47c 100644 --- a/engine/bootloader/bootloader_core.h +++ b/engine/bootloader/bootloader_core.h @@ -64,7 +64,6 @@ void LuosBootloader_Loop(void); /****************************************************************************** * @brief function used by Luos to send message to the bootloader ******************************************************************************/ -void LuosBootloader_MsgHandler(const msg_t *input); #ifndef BOOTLOADER void LuosBootloader_JumpToBootloader(void); #endif diff --git a/test/tests_io/test_luos_io/main.c b/test/tests_io/test_luos_io/main.c index cf59f4685..114566a53 100644 --- a/test/tests_io/test_luos_io/main.c +++ b/test/tests_io/test_luos_io/main.c @@ -785,7 +785,7 @@ void unittest_luosIO_ConsumeMsg() error_return_t ret_val = LuosIO_ConsumeMsg(&msg); // Check received message content - TEST_ASSERT_EQUAL(SUCCEED, ret_val); + TEST_ASSERT_EQUAL(FAILED, ret_val); } CATCH { From ae735549345640934d9648ab52900862076cf10b Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 20 Jun 2023 19:44:53 +0200 Subject: [PATCH 092/150] Separate Robus and Update detection allowing up to 254 phy with 254 port each. --- engine/IO/inc/_luos_phy.h | 5 +- engine/IO/inc/luos_io.h | 3 +- engine/IO/inc/luos_phy.h | 57 +---- engine/IO/inc/struct_phy.h | 59 +++++ engine/IO/src/filter.c | 4 +- engine/IO/src/luos_io.c | 237 +++++++++--------- engine/IO/src/luos_phy.c | 183 +++++++++++++- engine/OD/od_control.h | 1 + engine/OD/od_pid.h | 1 + engine/core/inc/luos.h | 4 +- engine/core/inc/node.h | 9 +- engine/core/inc/routing_table.h | 4 +- engine/core/inc/struct_luos.h | 4 +- engine/core/src/node.c | 23 ++ engine/core/src/routing_table.c | 19 +- engine/engine_config.h | 16 +- .../apps/alarm_controller/alarm_controller.h | 1 + .../biometric-security/biometric_security.h | 3 +- .../apps/start_controller/start_controller.h | 1 + .../Arduino/bldc_simple_foc/node_config.h | 1 + .../Arduino/bldc_simple_foc/src/SimpleFOC.cpp | 2 + .../Arduino/button/lib/button/button.h | 1 + .../projects/Arduino/button/node_config.h | 1 + .../projects/Arduino/button/src/Button.cpp | 2 + .../fingerprint/lib/Fingerprint/fingerprint.h | 3 +- .../lib/Fingerprint/fingerprint_drv.h | 3 +- .../Arduino/fingerprint/node_config.h | 1 + .../Arduino/fingerprint/src/Fingerprint.cpp | 2 + .../Arduino/gate_serialcom/node_config.h | 1 + .../gate_serialcom/src/Gate_SerialCom.cpp | 2 + .../Arduino/inspector_serialcom/node_config.h | 1 + .../src/Inspector_SerialCom.cpp | 2 + examples/projects/Arduino/lcd/lib/Lcd/lcd.h | 1 + examples/projects/Arduino/lcd/node_config.h | 1 + examples/projects/Arduino/lcd/src/Lcd.cpp | 2 + examples/projects/Arduino/led/lib/led/led.h | 1 + examples/projects/Arduino/led/node_config.h | 1 + examples/projects/Arduino/led/src/led.cpp | 2 + .../servo_motor/lib/Servo_motor/servo_drv.h | 3 +- .../Arduino/servo_motor/node_config.h | 1 + .../Arduino/servo_motor/src/Servo_motor.cpp | 2 + .../Arduino/stepper_simple_foc/node_config.h | 1 + .../stepper_simple_foc/src/SimpleFOC.cpp | 2 + .../projects/ESP32/button/lib/button/button.h | 1 + examples/projects/ESP32/button/node_config.h | 1 + examples/projects/ESP32/button/src/main.c | 2 + .../ESP32/button_arduino/lib/button/button.h | 1 + .../ESP32/button_arduino/node_config.h | 1 + .../ESP32/button_arduino/src/main.cpp | 2 + .../ESP32/gate_serialcom/node_config.h | 1 + .../projects/ESP32/gate_serialcom/src/main.c | 2 + .../gate_serialcom_arduino/node_config.h | 1 + .../ESP32/gate_serialcom_arduino/src/main.cpp | 2 + .../projects/ESP32/gate_wscom/node_config.h | 1 + examples/projects/ESP32/gate_wscom/src/main.c | 2 + .../ESP32/gate_wscom_arduino/node_config.h | 1 + .../ESP32/gate_wscom_arduino/src/main.cpp | 2 + examples/projects/ESP32/led/lib/led/led.h | 1 + examples/projects/ESP32/led/node_config.h | 1 + examples/projects/ESP32/led/src/main.c | 4 +- .../barometer/lib/barometer/BMP280.h | 3 +- .../NUCLEO-F072RB/barometer/node_config.h | 1 + .../NUCLEO-F072RB/barometer/src/main.c | 2 + .../NUCLEO-F072RB/bootloader/node_config.h | 1 + .../NUCLEO-F072RB/bootloader/src/main.c | 4 + .../NUCLEO-F072RB/button/node_config.h | 1 + .../projects/NUCLEO-F072RB/button/src/main.c | 2 + .../dc_motor/lib/DC_motor/dc_motor_drv.h | 1 + .../NUCLEO-F072RB/dc_motor/node_config.h | 1 + .../NUCLEO-F072RB/dc_motor/src/main.c | 2 + .../gate_serialcom/node_config.h | 1 + .../NUCLEO-F072RB/gate_serialcom/src/main.c | 2 + .../inspector_serialcom/node_config.h | 1 + .../inspector_serialcom/src/main.c | 2 + .../lib/Potentiometer/potentiometer.h | 1 + .../lib/Potentiometer/potentiometer_drv.h | 3 +- .../NUCLEO-F072RB/potentiometer/node_config.h | 1 + .../NUCLEO-F072RB/potentiometer/src/main.c | 2 + .../NUCLEO-F401RE/bootloader/node_config.h | 1 + .../NUCLEO-F401RE/bootloader/src/main.c | 3 + .../NUCLEO-F401RE/button/lib/Button/button.h | 1 + .../NUCLEO-F401RE/button/node_config.h | 1 + .../projects/NUCLEO-F401RE/button/src/main.c | 2 + .../dc_motor/lib/DC_motor/dc_motor_drv.h | 1 + .../NUCLEO-F401RE/dc_motor/node_config.h | 1 + .../NUCLEO-F401RE/dc_motor/src/main.c | 2 + .../gate_serialcom/node_config.h | 1 + .../NUCLEO-F401RE/gate_serialcom/src/main.c | 2 + .../inspector_serialcom/node_config.h | 1 + .../inspector_serialcom/src/main.c | 2 + .../projects/NUCLEO-F401RE/led/lib/Led/led.h | 1 + .../led/lib/alias_save/alias_save.c | 3 +- .../projects/NUCLEO-F401RE/led/node_config.h | 1 + .../projects/NUCLEO-F401RE/led/src/main.c | 2 + .../lib/Potentiometer/potentiometer.h | 1 + .../lib/Potentiometer/potentiometer_drv.h | 3 +- .../NUCLEO-F401RE/potentiometer/node_config.h | 1 + .../NUCLEO-F401RE/potentiometer/src/main.c | 2 + .../NUCLEO-F410RB/bootloader/node_config.h | 1 + .../NUCLEO-F410RB/bootloader/src/main.c | 3 + .../NUCLEO-F410RB/button/lib/Button/button.h | 1 + .../NUCLEO-F410RB/button/node_config.h | 1 + .../projects/NUCLEO-F410RB/button/src/main.c | 2 + .../dc_motor/lib/DC_motor/dc_motor_drv.h | 1 + .../NUCLEO-F410RB/dc_motor/node_config.h | 1 + .../NUCLEO-F410RB/dc_motor/src/main.c | 2 + .../gate_serialcom/node_config.h | 1 + .../NUCLEO-F410RB/gate_serialcom/src/main.c | 2 + .../inspector_serialcom/node_config.h | 1 + .../inspector_serialcom/src/main.c | 2 + .../projects/NUCLEO-F410RB/led/lib/Led/led.h | 1 + .../projects/NUCLEO-F410RB/led/node_config.h | 1 + .../projects/NUCLEO-F410RB/led/src/main.c | 2 + .../lib/Potentiometer/potentiometer.h | 1 + .../lib/Potentiometer/potentiometer_drv.h | 3 +- .../NUCLEO-F410RB/potentiometer/node_config.h | 1 + .../NUCLEO-F410RB/potentiometer/src/main.c | 2 + .../NUCLEO-G431KB/bootloader/node_config.h | 1 + .../NUCLEO-G431KB/bootloader/src/main.c | 4 + .../NUCLEO-G431KB/button/lib/Button/button.h | 1 + .../NUCLEO-G431KB/button/node_config.h | 1 + .../projects/NUCLEO-G431KB/button/src/main.c | 2 + .../dc_motor/lib/DC_motor/dc_motor_drv.h | 1 + .../NUCLEO-G431KB/dc_motor/node_config.h | 1 + .../NUCLEO-G431KB/dc_motor/src/main.c | 2 + .../gate_serialcom/node_config.h | 1 + .../NUCLEO-G431KB/gate_serialcom/src/main.c | 2 + .../inspector_serialcom/node_config.h | 1 + .../inspector_serialcom/src/main.c | 2 + .../lib/Potentiometer/potentiometer.h | 1 + .../lib/Potentiometer/potentiometer_drv.h | 3 +- .../NUCLEO-G431KB/potentiometer/node_config.h | 1 + .../NUCLEO-G431KB/potentiometer/src/main.c | 2 + .../NUCLEO-G474RE/bootloader/node_config.h | 1 + .../NUCLEO-G474RE/bootloader/src/main.c | 4 + .../NUCLEO-G474RE/button/lib/Button/button.h | 1 + .../NUCLEO-G474RE/button/node_config.h | 1 + .../projects/NUCLEO-G474RE/button/src/main.c | 2 + .../gate_serialcom/node_config.h | 1 + .../NUCLEO-G474RE/gate_serialcom/src/main.c | 2 + .../inspector_serialcom/node_config.h | 1 + .../inspector_serialcom/src/main.c | 2 + .../NUCLEO-L073RZ/bootloader/node_config.h | 1 + .../NUCLEO-L073RZ/bootloader/src/main.c | 4 + .../NUCLEO-L073RZ/button/node_config.h | 1 + .../projects/NUCLEO-L073RZ/button/src/main.c | 2 + .../gate_serialcom/node_config.h | 1 + .../NUCLEO-L073RZ/gate_serialcom/src/main.c | 2 + .../NUCLEO-L432KC/bootloader/node_config.h | 1 + .../NUCLEO-L432KC/bootloader/src/main.c | 4 + .../NUCLEO-L432KC/button/lib/Button/button.h | 1 + .../NUCLEO-L432KC/button/node_config.h | 1 + .../projects/NUCLEO-L432KC/button/src/main.c | 2 + .../dc_motor/lib/DC_motor/dc_motor_drv.h | 1 + .../NUCLEO-L432KC/dc_motor/node_config.h | 1 + .../NUCLEO-L432KC/dc_motor/src/main.c | 2 + .../fingerprint/lib/Fingerprint/fingerprint.h | 3 +- .../NUCLEO-L432KC/fingerprint/node_config.h | 1 + .../NUCLEO-L432KC/fingerprint/src/main.c | 2 + .../gate_serialcom/node_config.h | 1 + .../NUCLEO-L432KC/gate_serialcom/src/main.c | 2 + .../gpio/lib/Gpio_dev/gpio_dev.h | 1 + .../projects/NUCLEO-L432KC/gpio/node_config.h | 1 + .../projects/NUCLEO-L432KC/gpio/src/main.c | 2 + .../inspector_serialcom/node_config.h | 1 + .../inspector_serialcom/src/main.c | 2 + .../projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.h | 1 + .../projects/NUCLEO-L432KC/lcd/node_config.h | 1 + .../projects/NUCLEO-L432KC/lcd/src/main.c | 2 + .../projects/NUCLEO-L432KC/led/lib/Led/led.h | 1 + .../projects/NUCLEO-L432KC/led/node_config.h | 1 + .../projects/NUCLEO-L432KC/led/src/main.c | 2 + .../lib/Potentiometer/potentiometer.h | 1 + .../lib/Potentiometer/potentiometer_drv.h | 3 +- .../NUCLEO-L432KC/potentiometer/node_config.h | 1 + .../NUCLEO-L432KC/potentiometer/src/main.c | 2 + .../NUCLEO-L432KC/servo/lib/Servo/servo_drv.h | 1 + .../NUCLEO-L432KC/servo/node_config.h | 1 + .../projects/NUCLEO-L432KC/servo/src/main.c | 2 + .../Bootloader/firmware/src/main.c | 3 + .../SAMD21XPLAINED/button/lib/button/button.h | 1 + .../SAMD21XPLAINED/button/node_config.h | 1 + .../projects/SAMD21XPLAINED/button/src/main.c | 4 +- .../bootloader/node_config.h | 1 + .../STM32F4-discovery/bootloader/src/main.c | 4 + .../button/lib/Button/button.h | 1 + .../STM32F4-discovery/button/node_config.h | 1 + .../STM32F4-discovery/button/src/main.c | 2 + .../gate_serialcom/node_config.h | 1 + .../gate_serialcom/src/main.c | 2 + .../inspector_serialcom/node_config.h | 1 + .../inspector_serialcom/src/main.c | 2 + .../bootloader/node_config.h | 1 + .../STM32L4S5_discovery/bootloader/src/main.c | 4 + .../button/lib/Button/button.h | 1 + .../STM32L4S5_discovery/button/node_config.h | 1 + .../STM32L4S5_discovery/button/src/main.c | 2 + .../gate_serialcom/node_config.h | 1 + .../gate_serialcom/src/main.c | 2 + .../lib/Led_Fader/led_fader.h | 1 + .../lib/Led_Fader/ledfader_drv.h | 3 +- .../bike_alarm/alarm_controller/node_config.h | 1 + .../l0/bike_alarm/alarm_controller/src/main.c | 2 + .../bike_alarm/start_controller/node_config.h | 1 + .../l0/bike_alarm/start_controller/src/main.c | 2 + examples/projects/l0/bootloader/node_config.h | 1 + examples/projects/l0/bootloader/src/main.c | 4 + examples/projects/l0/button/node_config.h | 1 + examples/projects/l0/button/src/main.c | 2 + .../projects/l0/button_freertos/lib/Led/led.h | 1 + .../l0/button_freertos/lib/Led/led_drv.h | 3 +- .../projects/l0/button_freertos/node_config.h | 1 + .../l0/button_freertos/src/freertos.c | 2 + .../l0/controller_motor/node_config.h | 1 + .../projects/l0/controller_motor/src/main.c | 2 + .../l0/dc_motor/lib/DC_motor/dc_motor_drv.h | 1 + examples/projects/l0/dc_motor/node_config.h | 1 + examples/projects/l0/dc_motor/src/main.c | 2 + .../lib/Detection_Button/detection_button.h | 1 + .../l0/demo/detection_button/node_config.h | 1 + .../l0/demo/detection_button/src/main.c | 2 + .../ledstrip_position/lib/Distance/distance.h | 1 + .../lib/Distance/vl53l0x_drv.h | 1 + .../lib/LedStrip_Position/ledstrip_position.h | 1 + .../l0/demo/ledstrip_position/node_config.h | 1 + .../l0/demo/ledstrip_position/src/main.c | 2 + .../lib/motor_copy/motor_copy.h | 1 + .../l0/demo/motor_copy_app/node_config.h | 1 + .../l0/demo/motor_copy_app/src/main.c | 2 + .../motor_demo_app/lib/run_motor/run_motor.h | 1 + .../l0/demo/motor_demo_app/node_config.h | 1 + .../l0/demo/motor_demo_app/src/main.c | 2 + examples/projects/l0/demo/product_config.h | 3 +- .../l0/distance/lib/Distance/distance.h | 1 + .../l0/distance/lib/Distance/vl53l0x_drv.h | 1 + examples/projects/l0/distance/node_config.h | 1 + examples/projects/l0/distance/src/main.c | 2 + examples/projects/l0/dxl/lib/Dxl/dxl.h | 1 + examples/projects/l0/dxl/node_config.h | 1 + examples/projects/l0/dxl/src/main.c | 2 + .../fingerprint/lib/Fingerprint/fingerprint.h | 3 +- .../projects/l0/fingerprint/node_config.h | 1 + examples/projects/l0/fingerprint/src/main.c | 2 + .../projects/l0/gate_serialcom/node_config.h | 1 + .../projects/l0/gate_serialcom/src/main.c | 2 + examples/projects/l0/gpio/node_config.h | 1 + examples/projects/l0/gpio/src/main.c | 2 + examples/projects/l0/imu/lib/Imu/imu.h | 1 + .../l0/imu/lib/Imu/mpu_configuration.c | 1 + .../l0/imu/lib/Imu/mpu_configuration.h | 1 + examples/projects/l0/imu/node_config.h | 1 + examples/projects/l0/imu/src/main.c | 2 + .../l0/inspector_serialcom/node_config.h | 1 + .../l0/inspector_serialcom/src/main.c | 2 + examples/projects/l0/lcd/lib/Lcd/lcd.h | 1 + examples/projects/l0/lcd/node_config.h | 1 + examples/projects/l0/lcd/src/main.c | 2 + examples/projects/l0/led/lib/Led/led.h | 1 + examples/projects/l0/led/lib/Led/led_drv.h | 3 +- examples/projects/l0/led/node_config.h | 1 + examples/projects/l0/led/src/main.c | 2 + .../l0/led_fader/lib/Led_Fader/led_fader.h | 1 + .../l0/led_fader/lib/Led_Fader/ledfader_drv.h | 3 +- examples/projects/l0/led_fader/node_config.h | 1 + examples/projects/l0/led_fader/src/main.c | 2 + .../l0/led_strip/lib/Led_strip/led_strip.h | 1 + .../led_strip/lib/Led_strip/led_strip_drv.h | 3 +- examples/projects/l0/led_strip/node_config.h | 1 + examples/projects/l0/led_strip/src/main.c | 2 + .../lib/Light_sensor/light_sensor.h | 1 + .../lib/Light_sensor/light_sensor_drv.h | 3 +- .../projects/l0/light_sensor/node_config.h | 1 + examples/projects/l0/light_sensor/src/main.c | 2 + .../projects/l0/load/lib/Load/HX711/HX711.h | 1 + examples/projects/l0/load/lib/Load/load.h | 1 + examples/projects/l0/load/node_config.h | 1 + examples/projects/l0/load/src/main.c | 2 + .../lib/Potentiometer/potentiometer.h | 1 + .../lib/Potentiometer/potentiometer_drv.h | 3 +- .../projects/l0/potentiometer/node_config.h | 1 + examples/projects/l0/potentiometer/src/main.c | 2 + .../projects/l0/power_switch/node_config.h | 1 + examples/projects/l0/power_switch/src/main.c | 2 + .../projects/l0/servo/lib/Servo/servo_drv.h | 1 + examples/projects/l0/servo/node_config.h | 1 + examples/projects/l0/servo/src/main.c | 2 + examples/projects/l0/stepper/node_config.h | 1 + examples/projects/l0/stepper/src/main.c | 2 + examples/projects/native/button/node_config.h | 1 + examples/projects/native/button/src/main.c | 4 +- .../projects/native/gate_wscom/node_config.h | 1 + .../projects/native/gate_wscom/src/main.c | 4 +- examples/projects/native/led/lib/Led/led.h | 1 + examples/projects/native/led/node_config.h | 1 + examples/projects/native/led/src/main.c | 4 +- .../native/ping_pong/lib/PingPong/graph.c | 3 +- .../native/ping_pong/lib/PingPong/scoring.h | 1 + .../projects/native/ping_pong/node_config.h | 1 + examples/projects/native/ping_pong/src/main.c | 4 +- network/robus/HAL/NATIVE/robus_hal.c | 1 + network/robus/inc/_robus.h | 18 ++ network/robus/inc/context.h | 2 +- network/robus/inc/port_manager.h | 6 +- network/robus/inc/reception.h | 3 +- network/robus/inc/robus.h | 7 - network/robus/inc/transmission.h | 3 +- network/robus/robus_config.h | 4 + network/robus/selftest/selftest.c | 1 + network/robus/selftest/selftest.h | 1 + network/robus/src/port_manager.c | 87 +++---- network/robus/src/reception.c | 28 --- network/robus/src/robus.c | 37 +-- test/_resources/Scenarios/default_scenario.c | 2 + test/_resources/Unity/unit_test.h | 1 + test/tests_core/test_routing_table/main.c | 14 +- test/tests_io/test_luos_io/main.c | 206 +++++++++++---- test/tests_io/test_phy/main.c | 13 +- tool_services/gate/TinyJSON/convert.c | 39 +-- tool_services/gate/data_manager.h | 2 +- tool_services/inspector/inspector.h | 2 - tool_services/pipe/pipe.c | 4 +- tool_services/pipe/pipe.h | 2 - 322 files changed, 1135 insertions(+), 437 deletions(-) create mode 100644 network/robus/inc/_robus.h diff --git a/engine/IO/inc/_luos_phy.h b/engine/IO/inc/_luos_phy.h index ec83bbb14..1ae38eb31 100644 --- a/engine/IO/inc/_luos_phy.h +++ b/engine/IO/inc/_luos_phy.h @@ -15,7 +15,10 @@ void Phy_Init(void); void Phy_Reset(void); +void Phy_ResetAll(void); +bool Phy_Busy(void); void Phy_Loop(void); -luos_phy_t *Phy_Get(uint8_t id, PHY_CB phy_cb); +luos_phy_t *Phy_Get(uint8_t id, JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY reset_phy); +error_return_t Phy_FindNextNode(void); // Use it to find the next node as a master. #endif /* _PRIVATE_LUOS_PHY_H_ */ diff --git a/engine/IO/inc/luos_io.h b/engine/IO/inc/luos_io.h index 36b24dd0e..ac2da676c 100644 --- a/engine/IO/inc/luos_io.h +++ b/engine/IO/inc/luos_io.h @@ -25,7 +25,7 @@ // generic functions void LuosIO_Init(void); void LuosIO_Loop(void); -uint16_t LuosIO_TopologyDetection(service_t *service); +uint16_t LuosIO_TopologyDetection(service_t *service, connection_t *connection_table); error_return_t LuosIO_Send(service_t *service, msg_t *msg); // Job management @@ -36,5 +36,6 @@ error_return_t LuosIO_TxAllComplete(void); // Specific phy treatment error_return_t Phy_TxAllComplete(void); +port_t *Phy_GetTopologysource(void); #endif /* _LUOSIO_H_ */ diff --git a/engine/IO/inc/luos_phy.h b/engine/IO/inc/luos_phy.h index aca89ffcd..20d722d57 100644 --- a/engine/IO/inc/luos_phy.h +++ b/engine/IO/inc/luos_phy.h @@ -17,54 +17,17 @@ /******************************************************************************* * Definitions ******************************************************************************/ - -/****************************************************************************** - * @struct phy_target_t - * @brief Transmit message direction - ******************************************************************************/ -typedef uint8_t phy_target_t; - -/****************************************************************************** - * @struct luos_phy_t - * @brief the data structure allowing the phy to interract with LuosIO - ******************************************************************************/ -typedef struct luos_phy_t -{ - // *************** RX information *************** - volatile int64_t rx_timestamp; // Timestamp of the last received message. We will use it to compute the date based on received latency. - uint8_t *rx_buffer_base; // Pointer to the base of the buffer where we will store the begining of received data. - union - { - volatile uint8_t *rx_data; // Pointer to write received bytes. - volatile msg_t *rx_msg; // Pointer to the message where we will write received bytes. - }; - volatile uint16_t received_data; // Number of bytes already received. - volatile uint16_t rx_size; // Size of data to receive. - struct - { - volatile uint8_t rx_alloc_job : 1; // If true, Luosio_Loop funciton will need to filter already received data, if filter is ok, set rx_keep, alloc needed space, move *rx_data to point at the good place on allocator, put the number of bytes remaining on rx_size, and copy already received data in the allocated space. - volatile uint8_t rx_keep : 1; // True if we want to keep the received data. - volatile uint8_t rx_ack : 1; // True if we need to generate an acknoledgement for this message. - }; - - // RX Private data - phy_target_t rx_phy_filter; // The phy concerned by this message. - - // *************** TX informations *************** - // Jobs are used to send messages. during the message send phy may save a job pointer so we cann't move any job in the job list. - // When a job is created we have to guarantee that the job will stay. So we have to manage it as a circular buffer. - phy_job_t job[MAX_MSG_NB]; // List of phy jobs to send. - uint8_t job_nb; // Number of jobs to send. - uint16_t oldest_job_index; // Index of the oldest job. - uint16_t available_job_index; // Index of the next available job. - - void (*phy_cb)(struct luos_phy_t *phy_ptr, phy_job_t *job); // Callback -} luos_phy_t; - -typedef void (*PHY_CB)(luos_phy_t *phy_ptr, phy_job_t *job); +typedef void (*JOB_CB)(luos_phy_t *phy_ptr, phy_job_t *job); +typedef error_return_t (*RUN_TOPO)(luos_phy_t *phy_ptr, uint8_t *portId); +typedef void (*RESET_PHY)(luos_phy_t *phy_ptr); // Phy creation -luos_phy_t *Phy_Create(PHY_CB phy_cb); // Use it to reference your phy to Luos. +luos_phy_t *Phy_Create(JOB_CB phy_cb, RUN_TOPO run_topo, RESET_PHY reset_phy); // Use it to reference your phy to Luos. + +// Topology management +void Phy_FindNextNodeJob(void); // Use it to find the next node that need to be detected accross phys. +void Phy_Topologysource(luos_phy_t *phy_ptr, uint8_t port_id); // The phy will call this function when a new node is detected on a specific port. +void Phy_TopologyDone(luos_phy_t *phy_ptr); // The phy will call this function when all its port detection are done. // Rx management void Phy_ComputeHeader(luos_phy_t *phy_ptr); // After receiving the first 7 bytes (the header) call this function to compute how you should manage the incoming message. @@ -79,6 +42,6 @@ void Phy_DeadTargetSpotted(luos_phy_t *phy_ptr, phy_job_t *job); // If some mess phy_job_t *Phy_GetJob(luos_phy_t *phy_ptr); // Use it to get the first job to send. phy_job_t *Phy_GetNextJob(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to get the next job to send. void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to remove a job from your phy job list when it's done. -uint16_t Phy_GetJobNbr(luos_phy_t *phy_ptr); // Use it to get the number of job you currently have to send on your phy_ptr.job list. +volatile uint16_t Phy_GetJobNbr(luos_phy_t *phy_ptr); // Use it to get the number of job you currently have to send on your phy_ptr.job list. #endif /* _LUOS_PHY_H_ */ diff --git a/engine/IO/inc/struct_phy.h b/engine/IO/inc/struct_phy.h index e14b7753c..bb4663198 100644 --- a/engine/IO/inc/struct_phy.h +++ b/engine/IO/inc/struct_phy.h @@ -33,4 +33,63 @@ typedef struct void *phy_data; // Phy developpers can use this pointer to store any data they need. } phy_job_t; +/****************************************************************************** + * @struct phy_target_t + * @brief Transmit message direction + ******************************************************************************/ +typedef uint8_t phy_target_t; + +/****************************************************************************** + * @struct luos_phy_t + * @brief the data structure allowing the phy to interract with LuosIO + ******************************************************************************/ +typedef struct luos_phy_t +{ + // *************** RX information *************** + volatile int64_t rx_timestamp; // Timestamp of the last received message. We will use it to compute the date based on received latency. + uint8_t *rx_buffer_base; // Pointer to the base of the buffer where we will store the begining of received data. + union + { + volatile uint8_t *rx_data; // Pointer to write received bytes. + volatile msg_t *rx_msg; // Pointer to the message where we will write received bytes. + }; + volatile uint16_t received_data; // Number of bytes already received. + volatile uint16_t rx_size; // Size of data to receive. + struct + { + volatile uint8_t rx_alloc_job : 1; // If true, Luosio_Loop funciton will need to filter already received data, if filter is ok, set rx_keep, alloc needed space, move *rx_data to point at the good place on allocator, put the number of bytes remaining on rx_size, and copy already received data in the allocated space. + volatile uint8_t rx_keep : 1; // True if we want to keep the received data. + volatile uint8_t rx_ack : 1; // True if we need to generate an acknoledgement for this message. + }; + + // RX Private data + phy_target_t rx_phy_filter; // The phy concerned by this message. + + // *************** TX informations *************** + // Jobs are used to send messages. during the message send phy may save a job pointer so we cann't move any job in the job list. + // When a job is created we have to guarantee that the job will stay. So we have to manage it as a circular buffer. + phy_job_t job[MAX_MSG_NB]; // List of phy jobs to send. + volatile uint8_t job_nb; // Number of jobs to send. + uint16_t oldest_job_index; // Index of the oldest job. + uint16_t available_job_index; // Index of the next available job. + + void (*job_cb)(struct luos_phy_t *phy_ptr, phy_job_t *job); // Callback + error_return_t (*run_topo)(struct luos_phy_t *phy_ptr, uint8_t *portId); // try to find another node on branches, return success if a node is found and the id of the port were we detect this node. + void (*reset_phy)(struct luos_phy_t *phy_ptr); // Reset the phy transmission reception and topology. + +} luos_phy_t; + +typedef struct __attribute__((__packed__)) +{ + uint16_t node_id; + uint8_t phy_id; + uint8_t port_id; +} port_t; + +typedef struct __attribute__((__packed__)) +{ + port_t parent; + port_t child; +} connection_t; + #endif /* _STRUCT_PHY_H_ */ diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c index ebfeb537b..5b633e847 100644 --- a/engine/IO/src/filter.c +++ b/engine/IO/src/filter.c @@ -213,7 +213,9 @@ _CRITICAL uint8_t Filter_GetPhyTarget(header_t *header) break; case NODEIDACK: case NODEID: - if (header->target == Node_Get()->node_id) + // If the target is our node and our node ave a node_id or if we don't have a node_id and we are waiting for one. + if (((header->target == Node_Get()->node_id) && (header->target != 0)) + || ((header->target == 0) && (Node_WaitId() == true))) { // This concerns Luos phy only return 0x01; diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index b975a774d..70d0384f4 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -14,38 +14,27 @@ #include "luos_hal.h" #include "luos_engine.h" #include "bootloader_core.h" +#include "robus.h" #include "_luos_phy.h" #include "stats.h" -#include "robus.h" - /******************************************************************************* * Definitions ******************************************************************************/ - -typedef struct __attribute__((__packed__)) -{ - union - { - struct __attribute__((__packed__)) - { - uint16_t prev_nodeid; - uint16_t nodeid; - }; - uint8_t unmap[sizeof(uint16_t) * 2]; - }; -} node_bootstrap_t; - static error_return_t LuosIO_StartTopologyDetection(service_t *service); -static error_return_t LuosIO_DetectNextNodes(service_t *service, bool wait_for_answer); -static void LuosIO_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job); +static error_return_t LuosIO_DetectNextNodes(service_t *service); static error_return_t LuosIO_ConsumeMsg(const msg_t *input); static void LuosIO_TransmitLocalRoutingTable(service_t *service, msg_t *routeTB_msg); +// Phy_callbacks +static void LuosIO_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job); +error_return_t LuosIO_RunTopo(luos_phy_t *phy_ptr, uint8_t *portId); + /******************************************************************************* * Variables ******************************************************************************/ -volatile uint16_t last_node = 0; +volatile uint16_t last_node = 0; +connection_t *connection_table_ptr = NULL; luos_phy_t *luos_phy; service_filter_t service_filter[MAX_MSG_NB]; // Service filter table. Each of these filter will be linked with jobs. uint8_t service_filter_index = 0; // Index of the next service filter to use. @@ -56,6 +45,23 @@ bool Flag_DetectServices = false; * Functions ******************************************************************************/ +error_return_t LuosIO_RunTopo(luos_phy_t *phy_ptr, uint8_t *portId) +{ + // This function should not be called because Luos can't run a topology. + LUOS_ASSERT(0); + return FAILED; +} + +void LuosIO_Reset(luos_phy_t *phy_ptr) +{ + MsgAlloc_Init(NULL); + Node_Init(); + Node_SetState(EXTERNAL_DETECTION); + Service_ClearId(); + // Reset the data reception context + Luos_ReceiveData(NULL, NULL, NULL); +} + /****************************************************************************** * @brief Init the interface file. * @param None @@ -75,10 +81,7 @@ void LuosIO_Init(void) Phy_Init(); // Get the Luos phy struct, Luos always use the first phy - luos_phy = Phy_Get(0, LuosIO_MsgHandler); - - // Init Robus - Robus_Init(); + luos_phy = Phy_Get(0, LuosIO_MsgHandler, LuosIO_RunTopo, LuosIO_Reset); } /****************************************************************************** @@ -91,7 +94,6 @@ void LuosIO_Loop(void) // Execute message allocation tasks MsgAlloc_Loop(); Phy_Loop(); - Robus_Loop(); if (Flag_DetectServices == true) { LUOS_ASSERT(detection_service != NULL); @@ -185,14 +187,16 @@ error_return_t LuosIO_Send(service_t *service, msg_t *msg) * @param service pointer to the detecting service * @return The number of detected node. ******************************************************************************/ -uint16_t LuosIO_TopologyDetection(service_t *service) +uint16_t LuosIO_TopologyDetection(service_t *service, connection_t *connection_table) { - uint8_t redetect_nb = 0; - bool detect_enabled = true; + uint8_t redetect_nb = 0; + bool detect_enabled = true; + connection_table_ptr = connection_table; // If a detection is in progress, don't do an another detection and return 0 if (Node_GetState() >= LOCAL_DETECTION) { + connection_table_ptr = NULL; return 0; } while (detect_enabled) @@ -204,6 +208,7 @@ uint16_t LuosIO_TopologyDetection(service_t *service) // Make sure that the detection is not interrupted if (Node_GetState() == EXTERNAL_DETECTION) { + connection_table_ptr = NULL; return 0; } // Setup local node @@ -211,8 +216,11 @@ uint16_t LuosIO_TopologyDetection(service_t *service) last_node = 1; // Setup sending service id service->id = 1; + // Consider this node as ready + // Clear the nodeID waiting flag + Node_WaitId(); - if (LuosIO_DetectNextNodes(service, true) == FAILED) + if (LuosIO_DetectNextNodes(service) == FAILED) { // check the number of retry we made LUOS_ASSERT((redetect_nb <= 4)); @@ -221,6 +229,7 @@ uint16_t LuosIO_TopologyDetection(service_t *service) detect_enabled = true; } } + connection_table_ptr = NULL; return last_node; } @@ -250,14 +259,8 @@ static error_return_t LuosIO_StartTopologyDetection(service_t *service) // Wait until message is actually transmitted while (Phy_TxAllComplete() != SUCCEED) ; - // Reinit services id - Service_ClearId(); - // Reinit msg alloc - MsgAlloc_Init(NULL); - // Reinit service filter - Filter_IdInit(); - // Reinit Phy - Phy_Reset(); + // Reinit Phy (this will call LuosIO_Reset) + Phy_ResetAll(); // Wait 2ms to be sure all previous messages are received and treated by other nodes uint32_t start_tick = LuosHAL_GetSystick(); while (LuosHAL_GetSystick() - start_tick < 2) @@ -276,8 +279,6 @@ static error_return_t LuosIO_StartTopologyDetection(service_t *service) } while ((MsgAlloc_IsEmpty() != SUCCEED) || (try_nbr > 5)); // Reinit our node id Node_Get()->node_id = 0; - // Clear any saved node id on physical layer ports - Robus_ResetNodeID(); if (try_nbr < 5) { Node_SetState(LOCAL_DETECTION); @@ -295,7 +296,6 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) { LUOS_ASSERT(input != NULL); msg_t output_msg; - node_bootstrap_t node_bootstrap; time_luos_t time; service_t *service = Service_GetConcerned(&input->header); dead_target_t *dead_target = (dead_target_t *)input->data; @@ -305,66 +305,84 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) switch (input->header.cmd) { //**************************************** detection section **************************************** - case WRITE_NODE_ID: - // Depending on the size of the received data we have to do different things - switch (input->header.size) + // Only the master node should receive this message + case CONNECTION_DATA: + LUOS_ASSERT(connection_table_ptr != NULL); + if (input->header.size == sizeof(port_t)) { - case 0: - // Someone asking us a new node id (we are the detecting service) - // Increase the number of node_nb and send it back - last_node++; - output_msg.header.cmd = WRITE_NODE_ID; - output_msg.header.size = sizeof(uint16_t); - output_msg.header.target = input->header.source; - output_msg.header.target_mode = NODEIDACK; - memcpy(output_msg.data, (void *)&last_node, sizeof(uint16_t)); - Luos_SendMsg(service, &output_msg); - break; - case 2: - // This is a node id for the next node. - // This is a reply to our request to generate the next node id. - // This node_id is the one after the currently poked branch. - // Extract the node id from the received data - memcpy((void *)&node_bootstrap.nodeid, (void *)&input->data[0], sizeof(uint16_t)); - // We need to save this node ID as a connection to a port - Robus_SaveNodeID(node_bootstrap.nodeid); - // Now we can send it to the next node - node_bootstrap.prev_nodeid = Node_Get()->node_id; - output_msg.header.cmd = WRITE_NODE_ID; - output_msg.header.size = sizeof(node_bootstrap_t); - output_msg.header.target = 0; - output_msg.header.target_mode = NODEIDACK; - memcpy((void *)&output_msg.data[0], (void *)&node_bootstrap.unmap[0], sizeof(node_bootstrap_t)); - Luos_SendMsg(service, &output_msg); - break; - case sizeof(node_bootstrap_t): - if (Node_Get()->node_id != 0) - { - Node_Get()->node_id = 0; - // Reinit service id - Service_ClearId(); - // Reinit msg alloc - MsgAlloc_Init(NULL); - // Reinit service filter - Filter_IdInit(); - // Reinit Phy - Phy_Reset(); - } - // This is a node bootstrap information. - memcpy((void *)&node_bootstrap.unmap[0], (void *)&input->data[0], sizeof(node_bootstrap_t)); - Node_Get()->node_id = node_bootstrap.nodeid; - Robus_SaveNodeID(node_bootstrap.prev_nodeid); - // Continue the topology detection on our other ports. - LuosIO_DetectNextNodes(service, false); - break; - default: - LUOS_ASSERT(0); - break; + // This is a partial connection information (only the output part) + // Save it we will receive the input part later + memcpy(&connection_table_ptr[last_node++].parent, input->data, sizeof(port_t)); + // Now send the new generated node_id + output_msg.header.cmd = NODE_ID; + output_msg.header.size = sizeof(uint16_t); + output_msg.header.target = 0; // We target the node_id 0 becanse the node receiving this message don't have a node_id yet. This node need to be the only one to receive it. + output_msg.header.target_mode = NODEIDACK; + memcpy(output_msg.data, (void *)&last_node, sizeof(uint16_t)); + Luos_SendMsg(service, &output_msg); + } + else + { + // We receive this because a node port have a static mapping of it's connectivity, so we have to save it and consider it as detected nodes. + // Check that we receive a full connection information + LUOS_ASSERT(input->header.size % sizeof(connection_t) == 0); + memcpy(&connection_table_ptr[last_node], input->data, input->header.size); + last_node += input->header.size / sizeof(connection_t); + // Check that node id are continuous + LUOS_ASSERT(connection_table_ptr[last_node - 1].child.node_id == last_node); } // This message have been consumed return SUCCEED; break; + // Only the master node should receive this message + case PORT_DATA: + LUOS_ASSERT(connection_table_ptr != NULL); + // This is the last part (input port) of a connection_ data + // Check that we receive a full port information + LUOS_ASSERT(input->header.size == sizeof(port_t) + && (connection_table_ptr[last_node - 1].parent.node_id != 0xFFFF)); + memcpy(&connection_table_ptr[last_node - 1].child, input->data, sizeof(port_t)); + // This message have been consumed + return SUCCEED; + break; + + case NODE_ID: + LUOS_ASSERT(input->header.size == sizeof(uint16_t)); + // This is our new node id. + if (Node_Get()->node_id != 0) + { + // We didn't received the start detection message + // Reinit our node id + Node_Get()->node_id = 0; + // A phy have already been detected, so we can't reset everything + // Just reset LuosIO and Phy jobs. + LuosIO_Reset(luos_phy); + // Reinit Phy + Phy_Reset(); + } + // Save our new node id + // We have to do it this way because Node_Get()->node_id is a bitfield and input->data is not well aligned. + uint16_t node_id; + memcpy(&node_id, input->data, sizeof(uint16_t)); + Node_Get()->node_id = node_id; + // Now we need to send back the input part of the connection data. + port_t *input_port = Phy_GetTopologysource(); + input_port->node_id = Node_Get()->node_id; + + output_msg.header.target_mode = NODEIDACK; + output_msg.header.target = 1; + output_msg.header.cmd = PORT_DATA; + output_msg.header.size = sizeof(port_t); + memcpy(output_msg.data, input_port, sizeof(port_t)); + Luos_SendMsg(service, &output_msg); + // This message can't be send directly to avoid dispatch re-entrance issue. + // To be able to send this message then run the detection of the other nodes we need to make it later on the LuosIO_Loop, so we put a flag for it. + Phy_FindNextNodeJob(); + // This message have been consumed + return SUCCEED; + break; + case LOCAL_RTB: // Depending on the size of this message we have to make different operations // If size is 0 someone ask to get local_route table back @@ -391,7 +409,7 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) break; case RTB: - // We are receiving a rouiting table + // We are receiving a routing table // Check routing table overflow LUOS_ASSERT(((uintptr_t)route_tab + input->header.size) <= ((uintptr_t)RoutingTB_Get() + (sizeof(routing_table_t) * MAX_RTB_ENTRY))); if (Luos_ReceiveData(service, input, (void *)route_tab) > 0) @@ -404,14 +422,8 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) break; case START_DETECTION: - Phy_Reset(); - MsgAlloc_Init(NULL); - Node_Init(); - Node_SetState(EXTERNAL_DETECTION); - Service_ClearId(); - // Reset the data reception context - Luos_ReceiveData(NULL, NULL, NULL); - Robus_ResetNodeID(); + // Reset All phy + Phy_ResetAll(); // This message have been consumed return SUCCEED; break; @@ -553,31 +565,18 @@ static inline void LuosIO_TransmitLocalRoutingTable(service_t *service, msg_t *r * @param service pointer to the detecting service * @return None. ******************************************************************************/ -static error_return_t LuosIO_DetectNextNodes(service_t *service, bool wait_for_answer) +static error_return_t LuosIO_DetectNextNodes(service_t *service) { - // Lets try to poke other nodes - while (Robus_FindNeighbour() == SUCCEED) + // Lets try to find other nodes + while (Phy_FindNextNode() == SUCCEED) { - // There is someone here - // Ask an ID to the detector service. - msg_t msg; - msg.header.config = BASE_PROTOCOL; - msg.header.target_mode = NODEIDACK; - msg.header.target = 1; - msg.header.cmd = WRITE_NODE_ID; - msg.header.size = 0; - Luos_SendMsg(service, &msg); - if (wait_for_answer == false) - { - return SUCCEED; - } // Wait the end of transmission while (Phy_TxAllComplete() == FAILED) ; // When Robus loop will receive the reply it will store and manage the new node_id and send it to the next node. // We just have to wait the end of the treatment of the entire branch uint32_t start_tick = LuosHAL_GetSystick(); - while (Robus_Busy()) + while (Phy_Busy()) { LuosIO_Loop(); if (LuosHAL_GetSystick() - start_tick > DETECTION_TIMEOUT_MS) diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 757e08276..68394ab36 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -73,6 +73,12 @@ typedef struct luos_phy_t phy[PHY_NB]; // phy[0] is the local phy, phy[1] is the remote phy. uint8_t phy_nb; // Number of phy instantiated in the phy_ctx.phy array. + // ******************** Topology management ******************** + port_t topology_source; // The source port. Where we receive the topological detection signal from. + uint32_t topology_done; // We put bits to 1 when a phy ended the topology detection. + bool topology_running; // We put bits to 1 when a phy is running the topology detection. + bool find_next_node_job; + // ******************** job management ******************** // io_jobs are stores from the newest to the oldest. // This will add time in IRQ when we will pull a job but allow to keep pointers constant. @@ -110,7 +116,7 @@ void Phy_Init(void) } /****************************************************************************** - * @brief Reset the phy + * @brief Reset the phy context * @param None * @return None ******************************************************************************/ @@ -128,6 +134,35 @@ void Phy_Reset(void) phy_ctx.phy[i].oldest_job_index = 0; phy_ctx.phy[i].available_job_index = 0; } + memset((void *)&phy_ctx.topology_source, 0xFFFF, sizeof(phy_ctx.topology_source)); + phy_ctx.topology_done = 0; + phy_ctx.topology_running = false; + phy_ctx.find_next_node_job = false; +} + +/****************************************************************************** + * @brief Reset the phy context and all the phy instances + * @param None + * @return None + ******************************************************************************/ +void Phy_ResetAll(void) +{ + Phy_Reset(); + // Now call the reset fuction of each phy + for (uint8_t i = 0; i < phy_ctx.phy_nb; i++) + { + phy_ctx.phy[i].reset_phy(&phy_ctx.phy[i]); + } +} + +/****************************************************************************** + * @brief Check if a phy is actually detecting nodes on one of its port + * @param None + * @return None + ******************************************************************************/ +bool Phy_Busy(void) +{ + return phy_ctx.topology_running; } /****************************************************************************** @@ -146,6 +181,15 @@ void Phy_Loop(void) Phy_ManageFailedJob(); // Manage complete message received dispatching Phy_Dispatch(); + // Check if we need to find the next node + if (phy_ctx.find_next_node_job == true) + { + phy_ctx.find_next_node_job = false; + // Wait for the node to send all its messages. + while (Phy_TxAllComplete() == FAILED) + ; + Phy_FindNextNode(); + } // Compute phy job statistics /* uint8_t stat = (uint8_t)((job nbr * 100) / (MAX_MSG_NB)); @@ -160,23 +204,142 @@ void Phy_Loop(void) * @param phy_cb callback to call when we want to transmit a message * @return None ******************************************************************************/ -luos_phy_t *Phy_Create(PHY_CB phy_cb) +luos_phy_t *Phy_Create(JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY reset_phy) +{ + return Phy_Get(phy_ctx.phy_nb++, job_cb, run_topo, reset_phy); +} + +/****************************************************************************** + * @brief save a flag allowing to run a new discovering outside of IRQ (because this function is very long and can't be run in IRQ) + * @return None + ******************************************************************************/ +_CRITICAL void Phy_FindNextNodeJob(void) +{ + phy_ctx.find_next_node_job = true; +} +/****************************************************************************** + * @brief Try to find the next node connected a phy port + * @return SUCCESS if a node is found, FAILED if not + ******************************************************************************/ +error_return_t Phy_FindNextNode(void) +{ + // Loop through all the phys except Luos and check if they need to be detected + // We have to make the source phy the last one to check because it is the one that will send back the token when all its ports will be detected. + // So we need to finish detections of all other phys before checking the source phy. + for (uint8_t i = 1; i < phy_ctx.phy_nb; i++) + { + if ((!(phy_ctx.topology_done & (1 << i))) && (phy_ctx.topology_source.phy_id != i)) + { + // This phy still have port to detect + uint8_t port_id; + // Check if a node is connected + phy_ctx.topology_running = true; + if (phy_ctx.phy[i].run_topo(&phy_ctx.phy[i], &port_id) == SUCCEED) + { + port_t output_port; + output_port.node_id = Node_Get()->node_id; + output_port.port_id = port_id; + output_port.phy_id = i; + + // We find a new node on this specific output_port + // Send the output_port information to master as a partial CONNECTION_DATA and ask it to generate and send a new node_id. + msg_t msg; + msg.header.target_mode = NODEIDACK; + msg.header.target = 1; + msg.header.cmd = CONNECTION_DATA; + msg.header.size = sizeof(port_t); + memcpy(msg.data, &output_port, sizeof(port_t)); + Luos_SendMsg(0, &msg); + return SUCCEED; + } + phy_ctx.topology_running = false; + } + } + // We checked all the phys except the source one. + // Check if the source phy still have port to detect + if (phy_ctx.topology_done != (1 << phy_ctx.phy_nb) - 2) + { + // We still have a phy to detect. This must be the source phy. + // Check that only the source phy and the luos phy are not detected. + LUOS_ASSERT((phy_ctx.topology_done | (1 << phy_ctx.topology_source.phy_id)) == ((1 << phy_ctx.phy_nb) - 2)); + uint8_t port_id; + // Check if a node is connected + phy_ctx.topology_running = true; + if (phy_ctx.phy[phy_ctx.topology_source.phy_id].run_topo(&phy_ctx.phy[phy_ctx.topology_source.phy_id], &port_id) == SUCCEED) + { + port_t output_port; + output_port.node_id = Node_Get()->node_id; + output_port.port_id = port_id; + output_port.phy_id = phy_ctx.topology_source.phy_id; + + // We find a new node on this specific output_port + // Send the output_port information to master as a partial CONNECTION_DATA and ask it to generate and send a new node_id. + msg_t msg; + msg.header.target_mode = NODEIDACK; + msg.header.target = 1; + msg.header.cmd = CONNECTION_DATA; + msg.header.size = sizeof(port_t); + memcpy(msg.data, &output_port, sizeof(port_t)); + Luos_SendMsg(0, &msg); + return SUCCEED; + } + phy_ctx.topology_running = false; + } + // This is the end of detection for our node. + return FAILED; +} + +/****************************************************************************** + * @brief A phy port have been detected + * @param phy_ptr pointer on the phy which have been detected + * @param port_id id of the port detected in the phy + * @return None + ******************************************************************************/ +void Phy_Topologysource(luos_phy_t *phy_ptr, uint8_t port_id) +{ + LUOS_ASSERT((phy_ptr != NULL) + && (port_id < 0xFF)); + // This port is the source of a topology request. it become the input port. + // We have to save it in the node context. + phy_ctx.topology_source.phy_id = Phy_GetPhyId(phy_ptr); + phy_ctx.topology_source.port_id = port_id; + phy_ctx.topology_source.node_id = 0xFFFF; + // We don't have the node id yet, we will fill it out when we will receive it from the master. + // Put a flag to indicate that we are waiting for a node id. + Node_WillGetId(); +} + +void Phy_TopologyDone(luos_phy_t *phy_ptr) +{ + LUOS_ASSERT(phy_ptr != NULL); + phy_ctx.topology_done = (1 << Phy_GetPhyId(phy_ptr)); + phy_ctx.topology_running = false; +} + +/****************************************************************************** + * @brief A phy port have been detected + * @return pointer on the input port + ******************************************************************************/ +port_t *Phy_GetTopologysource(void) { - return Phy_Get(phy_ctx.phy_nb++, phy_cb); + return &phy_ctx.topology_source; } /****************************************************************************** - * @brief return the local physical layer + * @brief return the local physical layer (only used by LuosIO, this function is private) * @param id of the phy we want * @param phy_cb callback to call when we want to transmit a message * @return None ******************************************************************************/ -luos_phy_t *Phy_Get(uint8_t id, PHY_CB phy_cb) +luos_phy_t *Phy_Get(uint8_t id, JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY reset_phy) { LUOS_ASSERT((id <= PHY_NB) - && (phy_cb != NULL)); - // Set the callback - phy_ctx.phy[id].phy_cb = phy_cb; + && (job_cb != NULL) + && (run_topo != NULL)); + // Set the callbacks + phy_ctx.phy[id].job_cb = job_cb; + phy_ctx.phy[id].run_topo = run_topo; + phy_ctx.phy[id].reset_phy = reset_phy; // Return the phy pointer return &phy_ctx.phy[id]; } @@ -400,7 +563,7 @@ static void Phy_Dispatch(void) // Write the job in the phy queue and get back the pointer to it phy_job_t *job_ptr = Phy_AddJob(&phy_ctx.phy[y], &phy_job); // Notify this phy that a job is available and give it the concerned job on his queue - phy_ctx.phy[y].phy_cb(&phy_ctx.phy[y], job_ptr); + phy_ctx.phy[y].job_cb(&phy_ctx.phy[y], job_ptr); } } LuosHAL_SetIrqState(false); @@ -637,7 +800,7 @@ _CRITICAL void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job) * @param phy_ptr Phy to get the number of job from * @return Number of job ******************************************************************************/ -_CRITICAL inline uint16_t Phy_GetJobNbr(luos_phy_t *phy_ptr) +_CRITICAL inline volatile uint16_t Phy_GetJobNbr(luos_phy_t *phy_ptr) { LUOS_ASSERT(phy_ptr != NULL); return phy_ptr->job_nb; diff --git a/engine/OD/od_control.h b/engine/OD/od_control.h index af74ad13d..b998eca51 100644 --- a/engine/OD/od_control.h +++ b/engine/OD/od_control.h @@ -8,6 +8,7 @@ #define OD_OD_CONTROL_H_ #include "luos_engine.h" +#include "robus.h" #include /******************************************************************************* diff --git a/engine/OD/od_pid.h b/engine/OD/od_pid.h index dff3709b4..9b747e419 100644 --- a/engine/OD/od_pid.h +++ b/engine/OD/od_pid.h @@ -8,6 +8,7 @@ #define OD_OD_PID_H_ #include "luos_engine.h" +#include "robus.h" #include /******************************************************************************* diff --git a/engine/core/inc/luos.h b/engine/core/inc/luos.h index 427043d01..9091d69dd 100644 --- a/engine/core/inc/luos.h +++ b/engine/core/inc/luos.h @@ -4,5 +4,5 @@ * @author Luos ******************************************************************************/ -#error 'luos.h' inclusion is deprecated since luos_engine@2.3.1, replace it by '#include "luos_engine.h"', see: www.github.com/Luos-io/luos_engine/commit/d3cc1618956907fc5a657ef07535ad9d5caa4f57 for more information. -#include "luos_engine.h" \ No newline at end of file +#error 'luos.h' inclusion is deprecated since luos_engine@2.3.1, replace it by '#include "luos_engine.h" +#include "luos_engine.h" diff --git a/engine/core/inc/node.h b/engine/core/inc/node.h index 34ccb0708..0433354b7 100644 --- a/engine/core/inc/node.h +++ b/engine/core/inc/node.h @@ -9,6 +9,7 @@ #include #include "engine_config.h" +#include "struct_phy.h" /******************************************************************************* * Definitions @@ -35,11 +36,11 @@ typedef struct __attribute__((__packed__)) { uint16_t node_id : 12; /*!< Node id */ uint16_t certified : 4; /*!< True if the node have a certificate */ - uint8_t node_info; }; - uint16_t port_table[NBR_PORT]; /*!< Phisical port connections */ + uint8_t node_info; + connection_t connection; }; - uint8_t unmap[NBR_PORT + 3]; /*!< Uncmaped form. */ + uint8_t unmap[sizeof(connection_t) + 3]; /*!< Uncmaped form. */ }; } node_t; @@ -49,6 +50,8 @@ typedef struct __attribute__((__packed__)) void Node_Init(void); void Node_Loop(void); node_t *Node_Get(void); +void Node_WillGetId(void); +bool Node_WaitId(void); node_state_t Node_GetState(void); void Node_SetState(node_state_t); diff --git a/engine/core/inc/routing_table.h b/engine/core/inc/routing_table.h index 9ddf32e52..a50dfb946 100644 --- a/engine/core/inc/routing_table.h +++ b/engine/core/inc/routing_table.h @@ -49,9 +49,9 @@ typedef struct __attribute__((__packed__)) uint16_t certified : 4; // True if the node have a certificate uint8_t node_info; // node info can contain info such as the saving of routing table }; - uint16_t port_table[(MAX_ALIAS_SIZE + 2 + 2 + sizeof(uint8_t) - 2) / 2]; // Node link table + connection_t connection; // Node connection source }; - uint8_t unmap_data[MAX_ALIAS_SIZE + 2 + 2 + sizeof(uint8_t)]; + uint8_t unmap_data[MAX_ALIAS_SIZE + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint8_t)]; }; } routing_table_t; diff --git a/engine/core/inc/struct_luos.h b/engine/core/inc/struct_luos.h index 696ac92ec..daaa155f7 100644 --- a/engine/core/inc/struct_luos.h +++ b/engine/core/inc/struct_luos.h @@ -29,7 +29,9 @@ typedef enum typedef enum { // Luos specific registers - WRITE_NODE_ID, // Get and save a new given node ID. + NODE_ID, // Get and save a new given node ID. + CONNECTION_DATA, // Message containing connection_t information or part of it (output port_t). + PORT_DATA, // Message containing port_t information. This is used to complete the input part of a partial CONNECTION_DATA. START_DETECTION, // Start a detection END_DETECTION, // Detect the end of a detection LOCAL_RTB, // Ask(size == 0), generate(size == 2) a local routing_table. diff --git a/engine/core/src/node.c b/engine/core/src/node.c index fe8f2cee0..b452dd5aa 100644 --- a/engine/core/src/node.c +++ b/engine/core/src/node.c @@ -16,6 +16,7 @@ typedef struct node_t info; node_state_t state; bool timeout_run; + bool wait_id; // A flag to indicate that wr are about to reeive a node_id uint32_t timeout; } node_ctx_t; @@ -38,6 +39,27 @@ node_t *Node_Get(void) return (node_t *)&node_ctx.info; } +/****************************************************************************** + * @brief indicate to the node that it is waiting for a node ID + * @return None + ******************************************************************************/ +void Node_WillGetId(void) +{ + node_ctx.wait_id = true; +} + +/****************************************************************************** + * @brief check if node is actually expecting an ID to come + * @param None + * @return bool + ******************************************************************************/ +bool Node_WaitId(void) +{ + bool return_value = node_ctx.wait_id; + node_ctx.wait_id = false; + return return_value; +} + /****************************************************************************** * @brief get network_state value * @param None @@ -65,6 +87,7 @@ void Node_Init(void) node_ctx.node_info |= 1 << 0; #endif Node_SetState(NO_DETECTION); + node_ctx.wait_id = false; } /****************************************************************************** diff --git a/engine/core/src/routing_table.c b/engine/core/src/routing_table.c index b417ba5a9..89d3104f3 100644 --- a/engine/core/src/routing_table.c +++ b/engine/core/src/routing_table.c @@ -32,7 +32,7 @@ static uint16_t RoutingTB_BigestNodeID(void); uint16_t RoutingTB_GetServiceIndex(uint16_t id); bool RoutingTB_WaitRoutingTable(service_t *service, msg_t *intro_msg); -static void RoutingTB_Generate(service_t *service, uint16_t nb_node); +static void RoutingTB_Generate(service_t *service, uint16_t nb_node, connection_t *connection_table); static void RoutingTB_Share(service_t *service, uint16_t nb_node); static void RoutingTB_SendEndDetection(service_t *service); @@ -236,7 +236,7 @@ bool RoutingTB_WaitRoutingTable(service_t *service, msg_t *intro_msg) * @param nb_node : Node number on network * @return None ******************************************************************************/ -static void RoutingTB_Generate(service_t *service, uint16_t nb_node) +static void RoutingTB_Generate(service_t *service, uint16_t nb_node, connection_t *connection_table) { LUOS_ASSERT(service); // Asks for introduction for every found node (even the one detecting). @@ -255,6 +255,8 @@ static void RoutingTB_Generate(service_t *service, uint16_t nb_node) intro_msg.header.size = 2; last_service_id = RoutingTB_BigestID() + 1; memcpy(intro_msg.data, &last_service_id, sizeof(uint16_t)); + // save the current last routing table entry allowing us to easily write the connection informations later + uint16_t rtb_next_node_index = RoutingTB_GetLastEntry(); // Ask to introduce and wait for a reply if (!RoutingTB_WaitRoutingTable(service, &intro_msg)) { @@ -262,7 +264,11 @@ static void RoutingTB_Generate(service_t *service, uint16_t nb_node) nb_node = last_node_id; break; } - last_node_id = RoutingTB_BigestNodeID(); + // The node answer don't include connection because the node don't know it yet + // add this information to the routing table + LUOS_ASSERT(routing_table[rtb_next_node_index].mode == NODE); + routing_table[rtb_next_node_index].connection = connection_table[last_node_id]; + last_node_id = RoutingTB_BigestNodeID(); } // Check Alias duplication. uint16_t nb_service = RoutingTB_BigestID(); @@ -362,14 +368,17 @@ void RoutingTB_SendEndDetection(service_t *service) void RoutingTB_DetectServices(service_t *service) { LUOS_ASSERT(service); + // Create a connetion list to store all the connection describing the topology + connection_t connection_table[MAX_NODE_NUMBER]; + memset(connection_table, 0xFFFFFFFF, sizeof(connection_table)); // Starts the topology detection. - uint16_t nb_node = LuosIO_TopologyDetection(service); + uint16_t nb_node = LuosIO_TopologyDetection(service, connection_table); // Clear data reception state Luos_ReceiveData(NULL, NULL, NULL); // Clear the routing table. RoutingTB_Erase(); // Generate the routing_table - RoutingTB_Generate(service, nb_node); + RoutingTB_Generate(service, nb_node, connection_table); // We have a complete routing table now share it with others. RoutingTB_Share(service, nb_node); // Send a message to indicate the end of the detection diff --git a/engine/engine_config.h b/engine/engine_config.h index 23e346126..6be6fa98f 100644 --- a/engine/engine_config.h +++ b/engine/engine_config.h @@ -10,22 +10,26 @@ /******************************************************************************* * Definitions ******************************************************************************/ -#define LUOS_LAST_RESERVED_CMD 42 // Last Luos reserved command -#define ROBUS_PROTOCOL_NB 13 // Number of Robus protocol command -#define ALIAS_SIZE 15 // Number of max char for service alias +#define LUOS_LAST_RESERVED_CMD 42 // Last Luos reserved command +#define ROBUS_PROTOCOL_NB 13 // Number of Robus protocol command +#define ALIAS_SIZE 15 // Number of max char for service alias +#define MAX_ALIAS_SIZE 16 #define DETECTION_TIMEOUT_MS 10000 // Timeout used to detect a failed detection #define BOOT_TIMEOUT 1000 #define DEFAULTID 0x00 #define PROTOCOL_REVISION 0 #define BROADCAST_VAL 0x0FFF -#define MAX_ALIAS_SIZE 16 #define MAX_DATA_MSG_SIZE 128 #ifndef MAX_SERVICE_NUMBER #define MAX_SERVICE_NUMBER 5 #endif +#ifndef MAX_NODE_NUMBER + #define MAX_NODE_NUMBER 20 +#endif + #ifndef MAX_RTB_ENTRY #define MAX_RTB_ENTRY 40 #endif @@ -46,10 +50,6 @@ #define MAX_MSG_NB 2 * MAX_SERVICE_NUMBER #endif -#ifndef NBR_PORT - #define NBR_PORT 2 -#endif - #ifndef LAST_TOPIC #define LAST_TOPIC 20 #endif diff --git a/examples/apps/alarm_controller/alarm_controller.h b/examples/apps/alarm_controller/alarm_controller.h index d5be9ae2c..e9a7b934f 100644 --- a/examples/apps/alarm_controller/alarm_controller.h +++ b/examples/apps/alarm_controller/alarm_controller.h @@ -8,6 +8,7 @@ #define ALARM_CONTROLLER_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/apps/biometric-security/biometric_security.h b/examples/apps/biometric-security/biometric_security.h index bd2c974e8..811c318cf 100644 --- a/examples/apps/biometric-security/biometric_security.h +++ b/examples/apps/biometric-security/biometric_security.h @@ -11,6 +11,7 @@ #define BIOMETRIC_SECURITY_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions @@ -26,4 +27,4 @@ void BiometricSecurity_Init(void); void BiometricSecurity_Loop(void); -#endif /* BIOMETRIC_SECURITY_H */ \ No newline at end of file +#endif /* BIOMETRIC_SECURITY_H */ diff --git a/examples/apps/start_controller/start_controller.h b/examples/apps/start_controller/start_controller.h index c237cbbb0..c8397fba6 100644 --- a/examples/apps/start_controller/start_controller.h +++ b/examples/apps/start_controller/start_controller.h @@ -8,6 +8,7 @@ #define START_CONTROLLER_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/Arduino/bldc_simple_foc/node_config.h b/examples/projects/Arduino/bldc_simple_foc/node_config.h index f31eedab6..6e43f2e33 100644 --- a/examples/projects/Arduino/bldc_simple_foc/node_config.h +++ b/examples/projects/Arduino/bldc_simple_foc/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/Arduino/bldc_simple_foc/src/SimpleFOC.cpp b/examples/projects/Arduino/bldc_simple_foc/src/SimpleFOC.cpp index eb520f68d..924a9033f 100644 --- a/examples/projects/Arduino/bldc_simple_foc/src/SimpleFOC.cpp +++ b/examples/projects/Arduino/bldc_simple_foc/src/SimpleFOC.cpp @@ -7,6 +7,7 @@ extern "C" #endif #include "luos_engine.h" +#include "robus.h" #ifdef __cplusplus } @@ -20,6 +21,7 @@ extern "C" void setup() { Luos_Init(); + Robus_Init(); Motor_Init(); } /****************************************************************************** diff --git a/examples/projects/Arduino/button/lib/button/button.h b/examples/projects/Arduino/button/lib/button/button.h index 19367b3fb..64d92f652 100644 --- a/examples/projects/Arduino/button/lib/button/button.h +++ b/examples/projects/Arduino/button/lib/button/button.h @@ -8,6 +8,7 @@ #define BUTTON_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/Arduino/button/node_config.h b/examples/projects/Arduino/button/node_config.h index 8f7265358..056ce9509 100644 --- a/examples/projects/Arduino/button/node_config.h +++ b/examples/projects/Arduino/button/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/Arduino/button/src/Button.cpp b/examples/projects/Arduino/button/src/Button.cpp index c0edf7df3..93080432c 100644 --- a/examples/projects/Arduino/button/src/Button.cpp +++ b/examples/projects/Arduino/button/src/Button.cpp @@ -6,6 +6,7 @@ extern "C" #endif #include "luos_engine.h" +#include "robus.h" #include "button.h" #ifdef __cplusplus @@ -20,6 +21,7 @@ extern "C" void setup() { Luos_Init(); + Robus_Init(); Button_Init(); } /****************************************************************************** diff --git a/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint.h b/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint.h index 57175717b..ded9ac68f 100644 --- a/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint.h +++ b/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint.h @@ -11,6 +11,7 @@ #define FINGERPRINT_H_ #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions @@ -26,4 +27,4 @@ void Fingerprint_Init(void); void Fingerprint_Loop(void); -#endif /* FINGERPRINT_H_ */ \ No newline at end of file +#endif /* FINGERPRINT_H_ */ diff --git a/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint_drv.h b/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint_drv.h index 091e5ee29..be8182923 100644 --- a/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint_drv.h +++ b/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint_drv.h @@ -11,6 +11,7 @@ #define FINGERPRINT_DRV_H_ #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions @@ -43,4 +44,4 @@ uint8_t FingerprintDrv_Enroll(void); uint8_t FingerprintDrv_CheckAuth(void); uint8_t FingerprintDrv_DeleteAll(void); -#endif /* FINGERPRINT_DRV_H_ */ \ No newline at end of file +#endif /* FINGERPRINT_DRV_H_ */ diff --git a/examples/projects/Arduino/fingerprint/node_config.h b/examples/projects/Arduino/fingerprint/node_config.h index 8f7265358..056ce9509 100644 --- a/examples/projects/Arduino/fingerprint/node_config.h +++ b/examples/projects/Arduino/fingerprint/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/Arduino/fingerprint/src/Fingerprint.cpp b/examples/projects/Arduino/fingerprint/src/Fingerprint.cpp index 3ee2ed449..cbadecb74 100644 --- a/examples/projects/Arduino/fingerprint/src/Fingerprint.cpp +++ b/examples/projects/Arduino/fingerprint/src/Fingerprint.cpp @@ -6,6 +6,7 @@ extern "C" #endif #include "luos_engine.h" +#include "robus.h" #include "fingerprint.h" #ifdef __cplusplus @@ -20,6 +21,7 @@ extern "C" void setup() { Luos_Init(); + Robus_Init(); Fingerprint_Init(); } /****************************************************************************** diff --git a/examples/projects/Arduino/gate_serialcom/node_config.h b/examples/projects/Arduino/gate_serialcom/node_config.h index 0dc7b8a08..b2fd0f8f2 100644 --- a/examples/projects/Arduino/gate_serialcom/node_config.h +++ b/examples/projects/Arduino/gate_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/Arduino/gate_serialcom/src/Gate_SerialCom.cpp b/examples/projects/Arduino/gate_serialcom/src/Gate_SerialCom.cpp index ebee0868e..c97fb2e9c 100644 --- a/examples/projects/Arduino/gate_serialcom/src/Gate_SerialCom.cpp +++ b/examples/projects/Arduino/gate_serialcom/src/Gate_SerialCom.cpp @@ -9,6 +9,7 @@ extern "C" #include #include #include "luos_engine.h" +#include "robus.h" #ifdef __cplusplus } @@ -18,6 +19,7 @@ void setup() { Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); } diff --git a/examples/projects/Arduino/inspector_serialcom/node_config.h b/examples/projects/Arduino/inspector_serialcom/node_config.h index f4cca9037..8f21d5357 100644 --- a/examples/projects/Arduino/inspector_serialcom/node_config.h +++ b/examples/projects/Arduino/inspector_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/Arduino/inspector_serialcom/src/Inspector_SerialCom.cpp b/examples/projects/Arduino/inspector_serialcom/src/Inspector_SerialCom.cpp index 826ab373b..46592bb80 100644 --- a/examples/projects/Arduino/inspector_serialcom/src/Inspector_SerialCom.cpp +++ b/examples/projects/Arduino/inspector_serialcom/src/Inspector_SerialCom.cpp @@ -9,6 +9,7 @@ extern "C" #include #include #include "luos_engine.h" +#include "robus.h" #ifdef __cplusplus } @@ -18,6 +19,7 @@ void setup() { Luos_Init(); + Robus_Init(); Inspector_Init(); Pipe_Init(); } diff --git a/examples/projects/Arduino/lcd/lib/Lcd/lcd.h b/examples/projects/Arduino/lcd/lib/Lcd/lcd.h index 96a6f8518..9b5d05d67 100644 --- a/examples/projects/Arduino/lcd/lib/Lcd/lcd.h +++ b/examples/projects/Arduino/lcd/lib/Lcd/lcd.h @@ -10,6 +10,7 @@ #define LCD_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/Arduino/lcd/node_config.h b/examples/projects/Arduino/lcd/node_config.h index 8f7265358..056ce9509 100644 --- a/examples/projects/Arduino/lcd/node_config.h +++ b/examples/projects/Arduino/lcd/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/Arduino/lcd/src/Lcd.cpp b/examples/projects/Arduino/lcd/src/Lcd.cpp index 1c4ebf303..83ad115f1 100644 --- a/examples/projects/Arduino/lcd/src/Lcd.cpp +++ b/examples/projects/Arduino/lcd/src/Lcd.cpp @@ -6,6 +6,7 @@ extern "C" #endif #include "luos_engine.h" +#include "robus.h" #include "lcd.h" #ifdef __cplusplus @@ -20,6 +21,7 @@ extern "C" void setup() { Luos_Init(); + Robus_Init(); Lcd_Init(); } /****************************************************************************** diff --git a/examples/projects/Arduino/led/lib/led/led.h b/examples/projects/Arduino/led/lib/led/led.h index 64026325c..4a8a99bf4 100644 --- a/examples/projects/Arduino/led/lib/led/led.h +++ b/examples/projects/Arduino/led/lib/led/led.h @@ -8,6 +8,7 @@ #define LED_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/Arduino/led/node_config.h b/examples/projects/Arduino/led/node_config.h index 8f7265358..056ce9509 100644 --- a/examples/projects/Arduino/led/node_config.h +++ b/examples/projects/Arduino/led/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/Arduino/led/src/led.cpp b/examples/projects/Arduino/led/src/led.cpp index eefb8a77a..a879f45c8 100644 --- a/examples/projects/Arduino/led/src/led.cpp +++ b/examples/projects/Arduino/led/src/led.cpp @@ -6,6 +6,7 @@ extern "C" #endif #include "luos_engine.h" +#include "robus.h" #include "led.h" #ifdef __cplusplus @@ -20,6 +21,7 @@ extern "C" void setup() { Luos_Init(); + Robus_Init(); Led_Init(); } /****************************************************************************** diff --git a/examples/projects/Arduino/servo_motor/lib/Servo_motor/servo_drv.h b/examples/projects/Arduino/servo_motor/lib/Servo_motor/servo_drv.h index 01f5b9162..dbf92462b 100644 --- a/examples/projects/Arduino/servo_motor/lib/Servo_motor/servo_drv.h +++ b/examples/projects/Arduino/servo_motor/lib/Servo_motor/servo_drv.h @@ -10,6 +10,7 @@ #define SERVO_DRV_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions @@ -48,4 +49,4 @@ void ServoDrv_Init(void); uint8_t ServoDrv_SetPosition(angular_position_t angle); uint8_t ServoDrv_Parameter(servo_parameters_t param); -#endif /* SERVO_DRV_H*/ \ No newline at end of file +#endif /* SERVO_DRV_H*/ diff --git a/examples/projects/Arduino/servo_motor/node_config.h b/examples/projects/Arduino/servo_motor/node_config.h index 8f7265358..056ce9509 100644 --- a/examples/projects/Arduino/servo_motor/node_config.h +++ b/examples/projects/Arduino/servo_motor/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/Arduino/servo_motor/src/Servo_motor.cpp b/examples/projects/Arduino/servo_motor/src/Servo_motor.cpp index 63c52bfdc..a85e4691b 100644 --- a/examples/projects/Arduino/servo_motor/src/Servo_motor.cpp +++ b/examples/projects/Arduino/servo_motor/src/Servo_motor.cpp @@ -6,6 +6,7 @@ extern "C" #endif #include "luos_engine.h" +#include "robus.h" #include "servo_motor.h" #ifdef __cplusplus @@ -20,6 +21,7 @@ extern "C" void setup() { Luos_Init(); + Robus_Init(); Servo_Init(); } /****************************************************************************** diff --git a/examples/projects/Arduino/stepper_simple_foc/node_config.h b/examples/projects/Arduino/stepper_simple_foc/node_config.h index d7c1c11f6..3bbad9405 100644 --- a/examples/projects/Arduino/stepper_simple_foc/node_config.h +++ b/examples/projects/Arduino/stepper_simple_foc/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/Arduino/stepper_simple_foc/src/SimpleFOC.cpp b/examples/projects/Arduino/stepper_simple_foc/src/SimpleFOC.cpp index 7b99ffea7..54e5b557f 100644 --- a/examples/projects/Arduino/stepper_simple_foc/src/SimpleFOC.cpp +++ b/examples/projects/Arduino/stepper_simple_foc/src/SimpleFOC.cpp @@ -9,6 +9,7 @@ extern "C" #endif #include "luos_engine.h" +#include "robus.h" #ifdef __cplusplus } @@ -22,6 +23,7 @@ extern "C" void setup() { Luos_Init(); + Robus_Init(); Motor_Init(); } /****************************************************************************** diff --git a/examples/projects/ESP32/button/lib/button/button.h b/examples/projects/ESP32/button/lib/button/button.h index 29464d5e3..510616eca 100644 --- a/examples/projects/ESP32/button/lib/button/button.h +++ b/examples/projects/ESP32/button/lib/button/button.h @@ -8,6 +8,7 @@ #define BUTTON_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/ESP32/button/node_config.h b/examples/projects/ESP32/button/node_config.h index c5fd72009..c943cc773 100644 --- a/examples/projects/ESP32/button/node_config.h +++ b/examples/projects/ESP32/button/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 diff --git a/examples/projects/ESP32/button/src/main.c b/examples/projects/ESP32/button/src/main.c index 184197668..43d1137f4 100644 --- a/examples/projects/ESP32/button/src/main.c +++ b/examples/projects/ESP32/button/src/main.c @@ -7,11 +7,13 @@ CONDITIONS OF ANY KIND, either express or implied. */ #include "luos_engine.h" +#include "robus.h" #include "button.h" void app_main(void) { Luos_Init(); + Robus_Init(); Button_Init(); while (1) diff --git a/examples/projects/ESP32/button_arduino/lib/button/button.h b/examples/projects/ESP32/button_arduino/lib/button/button.h index 29464d5e3..510616eca 100644 --- a/examples/projects/ESP32/button_arduino/lib/button/button.h +++ b/examples/projects/ESP32/button_arduino/lib/button/button.h @@ -8,6 +8,7 @@ #define BUTTON_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/ESP32/button_arduino/node_config.h b/examples/projects/ESP32/button_arduino/node_config.h index c5fd72009..c943cc773 100644 --- a/examples/projects/ESP32/button_arduino/node_config.h +++ b/examples/projects/ESP32/button_arduino/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 diff --git a/examples/projects/ESP32/button_arduino/src/main.cpp b/examples/projects/ESP32/button_arduino/src/main.cpp index 2eb132a35..c4c0bc049 100644 --- a/examples/projects/ESP32/button_arduino/src/main.cpp +++ b/examples/projects/ESP32/button_arduino/src/main.cpp @@ -6,6 +6,7 @@ extern "C" #endif #include "luos_engine.h" +#include "robus.h" #include "button.h" #ifdef __cplusplus @@ -20,6 +21,7 @@ extern "C" void setup() { Luos_Init(); + Robus_Init(); Button_Init(); } /****************************************************************************** diff --git a/examples/projects/ESP32/gate_serialcom/node_config.h b/examples/projects/ESP32/gate_serialcom/node_config.h index d83aab5fd..dd56027d0 100644 --- a/examples/projects/ESP32/gate_serialcom/node_config.h +++ b/examples/projects/ESP32/gate_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 diff --git a/examples/projects/ESP32/gate_serialcom/src/main.c b/examples/projects/ESP32/gate_serialcom/src/main.c index b26a7357a..283f95390 100644 --- a/examples/projects/ESP32/gate_serialcom/src/main.c +++ b/examples/projects/ESP32/gate_serialcom/src/main.c @@ -1,11 +1,13 @@ #include "luos_engine.h" +#include "robus.h" #include "pipe.h" #include "gate.h" void app_main(void) { Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); diff --git a/examples/projects/ESP32/gate_serialcom_arduino/node_config.h b/examples/projects/ESP32/gate_serialcom_arduino/node_config.h index f6f07673e..c0fb39334 100644 --- a/examples/projects/ESP32/gate_serialcom_arduino/node_config.h +++ b/examples/projects/ESP32/gate_serialcom_arduino/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 diff --git a/examples/projects/ESP32/gate_serialcom_arduino/src/main.cpp b/examples/projects/ESP32/gate_serialcom_arduino/src/main.cpp index 27a7bd528..8b6383ed5 100644 --- a/examples/projects/ESP32/gate_serialcom_arduino/src/main.cpp +++ b/examples/projects/ESP32/gate_serialcom_arduino/src/main.cpp @@ -6,6 +6,7 @@ extern "C" #endif #include "luos_engine.h" +#include "robus.h" #include "pipe.h" #include "gate.h" @@ -21,6 +22,7 @@ extern "C" void setup() { Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); } diff --git a/examples/projects/ESP32/gate_wscom/node_config.h b/examples/projects/ESP32/gate_wscom/node_config.h index 95402b6cb..438723a60 100644 --- a/examples/projects/ESP32/gate_wscom/node_config.h +++ b/examples/projects/ESP32/gate_wscom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 diff --git a/examples/projects/ESP32/gate_wscom/src/main.c b/examples/projects/ESP32/gate_wscom/src/main.c index b26a7357a..283f95390 100644 --- a/examples/projects/ESP32/gate_wscom/src/main.c +++ b/examples/projects/ESP32/gate_wscom/src/main.c @@ -1,11 +1,13 @@ #include "luos_engine.h" +#include "robus.h" #include "pipe.h" #include "gate.h" void app_main(void) { Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); diff --git a/examples/projects/ESP32/gate_wscom_arduino/node_config.h b/examples/projects/ESP32/gate_wscom_arduino/node_config.h index 6697457db..c86f144f4 100644 --- a/examples/projects/ESP32/gate_wscom_arduino/node_config.h +++ b/examples/projects/ESP32/gate_wscom_arduino/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 diff --git a/examples/projects/ESP32/gate_wscom_arduino/src/main.cpp b/examples/projects/ESP32/gate_wscom_arduino/src/main.cpp index 27a7bd528..8b6383ed5 100644 --- a/examples/projects/ESP32/gate_wscom_arduino/src/main.cpp +++ b/examples/projects/ESP32/gate_wscom_arduino/src/main.cpp @@ -6,6 +6,7 @@ extern "C" #endif #include "luos_engine.h" +#include "robus.h" #include "pipe.h" #include "gate.h" @@ -21,6 +22,7 @@ extern "C" void setup() { Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); } diff --git a/examples/projects/ESP32/led/lib/led/led.h b/examples/projects/ESP32/led/lib/led/led.h index 392ff0240..a0cf02055 100644 --- a/examples/projects/ESP32/led/lib/led/led.h +++ b/examples/projects/ESP32/led/lib/led/led.h @@ -8,6 +8,7 @@ #define LED_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/ESP32/led/node_config.h b/examples/projects/ESP32/led/node_config.h index c5fd72009..c943cc773 100644 --- a/examples/projects/ESP32/led/node_config.h +++ b/examples/projects/ESP32/led/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 diff --git a/examples/projects/ESP32/led/src/main.c b/examples/projects/ESP32/led/src/main.c index 94c1ea1f0..3ab197bf1 100644 --- a/examples/projects/ESP32/led/src/main.c +++ b/examples/projects/ESP32/led/src/main.c @@ -1,9 +1,11 @@ #include "luos_engine.h" +#include "robus.h" #include "led.h" void app_main(void) { Luos_Init(); + Robus_Init(); Led_Init(); while (1) @@ -11,4 +13,4 @@ void app_main(void) Luos_Loop(); Led_Loop(); } -} \ No newline at end of file +} diff --git a/examples/projects/NUCLEO-F072RB/barometer/lib/barometer/BMP280.h b/examples/projects/NUCLEO-F072RB/barometer/lib/barometer/BMP280.h index 355ba4d79..7cfb417c6 100644 --- a/examples/projects/NUCLEO-F072RB/barometer/lib/barometer/BMP280.h +++ b/examples/projects/NUCLEO-F072RB/barometer/lib/barometer/BMP280.h @@ -2,8 +2,9 @@ #define __BMP280_H__ #include "SPI_Driver.h" #include "luos_engine.h" +#include "robus.h" void BMP280_Init(); void BMP280_Loop(); -#endif \ No newline at end of file +#endif diff --git a/examples/projects/NUCLEO-F072RB/barometer/node_config.h b/examples/projects/NUCLEO-F072RB/barometer/node_config.h index 69903b5fa..2fc863673 100644 --- a/examples/projects/NUCLEO-F072RB/barometer/node_config.h +++ b/examples/projects/NUCLEO-F072RB/barometer/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 diff --git a/examples/projects/NUCLEO-F072RB/barometer/src/main.c b/examples/projects/NUCLEO-F072RB/barometer/src/main.c index 70573f599..ce9534c64 100644 --- a/examples/projects/NUCLEO-F072RB/barometer/src/main.c +++ b/examples/projects/NUCLEO-F072RB/barometer/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "BMP280.h" void SystemClock_Config(void); @@ -34,6 +35,7 @@ int main(void) SystemClock_Config(); MX_GPIO_Init(); Luos_Init(); + Robus_Init(); BMP280_Init(); while (1) diff --git a/examples/projects/NUCLEO-F072RB/bootloader/node_config.h b/examples/projects/NUCLEO-F072RB/bootloader/node_config.h index 0e1ee0e81..0d73ae7aa 100644 --- a/examples/projects/NUCLEO-F072RB/bootloader/node_config.h +++ b/examples/projects/NUCLEO-F072RB/bootloader/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F072RB/bootloader/src/main.c b/examples/projects/NUCLEO-F072RB/bootloader/src/main.c index cf416baf3..99af476e5 100644 --- a/examples/projects/NUCLEO-F072RB/bootloader/src/main.c +++ b/examples/projects/NUCLEO-F072RB/bootloader/src/main.c @@ -24,6 +24,8 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" +#include "bootloader_core.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -87,6 +89,8 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ + LUOS_ADD_PACKAGE(LuosBootloader) + LUOS_ADD_PACKAGE(Robus) while (1) { LUOS_RUN() diff --git a/examples/projects/NUCLEO-F072RB/button/node_config.h b/examples/projects/NUCLEO-F072RB/button/node_config.h index a08135f1d..a191b492d 100644 --- a/examples/projects/NUCLEO-F072RB/button/node_config.h +++ b/examples/projects/NUCLEO-F072RB/button/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F072RB/button/src/main.c b/examples/projects/NUCLEO-F072RB/button/src/main.c index 4bf18e77e..a6fa48094 100644 --- a/examples/projects/NUCLEO-F072RB/button/src/main.c +++ b/examples/projects/NUCLEO-F072RB/button/src/main.c @@ -25,6 +25,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "button.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Button_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F072RB/dc_motor/lib/DC_motor/dc_motor_drv.h b/examples/projects/NUCLEO-F072RB/dc_motor/lib/DC_motor/dc_motor_drv.h index a09e2341d..c101e7f81 100644 --- a/examples/projects/NUCLEO-F072RB/dc_motor/lib/DC_motor/dc_motor_drv.h +++ b/examples/projects/NUCLEO-F072RB/dc_motor/lib/DC_motor/dc_motor_drv.h @@ -8,6 +8,7 @@ #define DC_MOTOR_DRV_H #include "luos_engine.h" +#include "robus.h" #include "stm32f0xx_hal.h" /******************************************************************************* * Definitions diff --git a/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h b/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h index cd69b45fc..e005456e0 100644 --- a/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F072RB/dc_motor/src/main.c b/examples/projects/NUCLEO-F072RB/dc_motor/src/main.c index ffdc94856..4691dadc3 100644 --- a/examples/projects/NUCLEO-F072RB/dc_motor/src/main.c +++ b/examples/projects/NUCLEO-F072RB/dc_motor/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "dc_motor.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); MotorDC_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F072RB/gate_serialcom/node_config.h b/examples/projects/NUCLEO-F072RB/gate_serialcom/node_config.h index ff1cdd1d4..f6e95bcd2 100644 --- a/examples/projects/NUCLEO-F072RB/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F072RB/gate_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 diff --git a/examples/projects/NUCLEO-F072RB/gate_serialcom/src/main.c b/examples/projects/NUCLEO-F072RB/gate_serialcom/src/main.c index f0f70a922..81f960717 100644 --- a/examples/projects/NUCLEO-F072RB/gate_serialcom/src/main.c +++ b/examples/projects/NUCLEO-F072RB/gate_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "pipe.h" #include "gate.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h index ec408797e..9d0e413fa 100644 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/main.c index af528d067..cb5939a8f 100644 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/main.c +++ b/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "pipe.h" #include "inspector.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Inspector_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.h b/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.h index 8cf5566d8..65a31b04d 100644 --- a/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.h +++ b/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.h @@ -2,6 +2,7 @@ #define POTENTIOMETER_H #include "luos_engine.h" +#include "robus.h" #include "potentiometer_drv.h" /******************************************************************************* diff --git a/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer_drv.h b/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer_drv.h index 5e6a360ff..bfdaf2ef3 100644 --- a/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer_drv.h +++ b/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer_drv.h @@ -7,6 +7,7 @@ #include "main.h" #include "analog.h" #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -31,4 +32,4 @@ ******************************************************************************/ void PotentiometerDrv_Init(void); -angular_position_t PotentiometerDrv_Read(void); \ No newline at end of file +angular_position_t PotentiometerDrv_Read(void); diff --git a/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h b/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h index bd2dd44be..0e964aac5 100644 --- a/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F072RB/potentiometer/src/main.c b/examples/projects/NUCLEO-F072RB/potentiometer/src/main.c index 9abd7096a..d1f007892 100644 --- a/examples/projects/NUCLEO-F072RB/potentiometer/src/main.c +++ b/examples/projects/NUCLEO-F072RB/potentiometer/src/main.c @@ -25,6 +25,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "potentiometer.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Potentiometer_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F401RE/bootloader/node_config.h b/examples/projects/NUCLEO-F401RE/bootloader/node_config.h index c3c3ffdf5..230da0845 100644 --- a/examples/projects/NUCLEO-F401RE/bootloader/node_config.h +++ b/examples/projects/NUCLEO-F401RE/bootloader/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F401RE/bootloader/src/main.c b/examples/projects/NUCLEO-F401RE/bootloader/src/main.c index fcbed0142..9c2200e74 100644 --- a/examples/projects/NUCLEO-F401RE/bootloader/src/main.c +++ b/examples/projects/NUCLEO-F401RE/bootloader/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -90,6 +91,8 @@ int main(void) /* Infinite loop */ /* USER CODE BEGIN WHILE */ + LUOS_ADD_PACKAGE(LuosBootloader) + LUOS_ADD_PACKAGE(Robus) // launch bootloader app while (1) { diff --git a/examples/projects/NUCLEO-F401RE/button/lib/Button/button.h b/examples/projects/NUCLEO-F401RE/button/lib/Button/button.h index 29464d5e3..510616eca 100644 --- a/examples/projects/NUCLEO-F401RE/button/lib/Button/button.h +++ b/examples/projects/NUCLEO-F401RE/button/lib/Button/button.h @@ -8,6 +8,7 @@ #define BUTTON_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F401RE/button/node_config.h b/examples/projects/NUCLEO-F401RE/button/node_config.h index 6dfb410fd..2f61b7924 100644 --- a/examples/projects/NUCLEO-F401RE/button/node_config.h +++ b/examples/projects/NUCLEO-F401RE/button/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F401RE/button/src/main.c b/examples/projects/NUCLEO-F401RE/button/src/main.c index 75d9ae0ff..2194bbf36 100644 --- a/examples/projects/NUCLEO-F401RE/button/src/main.c +++ b/examples/projects/NUCLEO-F401RE/button/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "button.h" /* USER CODE END Includes */ @@ -87,6 +88,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Button_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F401RE/dc_motor/lib/DC_motor/dc_motor_drv.h b/examples/projects/NUCLEO-F401RE/dc_motor/lib/DC_motor/dc_motor_drv.h index f080352d4..e089b1f1f 100644 --- a/examples/projects/NUCLEO-F401RE/dc_motor/lib/DC_motor/dc_motor_drv.h +++ b/examples/projects/NUCLEO-F401RE/dc_motor/lib/DC_motor/dc_motor_drv.h @@ -8,6 +8,7 @@ #define DC_MOTOR_DRV_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h b/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h index f4ffa6f0e..997e5d960 100644 --- a/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F401RE/dc_motor/src/main.c b/examples/projects/NUCLEO-F401RE/dc_motor/src/main.c index 013e73e34..ae85a7966 100644 --- a/examples/projects/NUCLEO-F401RE/dc_motor/src/main.c +++ b/examples/projects/NUCLEO-F401RE/dc_motor/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "dc_motor.h" /* USER CODE END Includes */ @@ -89,6 +90,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); MotorDC_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F401RE/gate_serialcom/node_config.h b/examples/projects/NUCLEO-F401RE/gate_serialcom/node_config.h index fa7b67c4d..30971136d 100644 --- a/examples/projects/NUCLEO-F401RE/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F401RE/gate_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F401RE/gate_serialcom/src/main.c b/examples/projects/NUCLEO-F401RE/gate_serialcom/src/main.c index 027a6ffc6..12e1fc2c7 100644 --- a/examples/projects/NUCLEO-F401RE/gate_serialcom/src/main.c +++ b/examples/projects/NUCLEO-F401RE/gate_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h index 3fde59dc9..c155b6677 100644 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/main.c index ad57d8212..cdb7b5d41 100644 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/main.c +++ b/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "inspector.h" #include "pipe.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Inspector_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F401RE/led/lib/Led/led.h b/examples/projects/NUCLEO-F401RE/led/lib/Led/led.h index 64026325c..4a8a99bf4 100644 --- a/examples/projects/NUCLEO-F401RE/led/lib/Led/led.h +++ b/examples/projects/NUCLEO-F401RE/led/lib/Led/led.h @@ -8,6 +8,7 @@ #define LED_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/NUCLEO-F401RE/led/lib/alias_save/alias_save.c b/examples/projects/NUCLEO-F401RE/led/lib/alias_save/alias_save.c index c67048e4a..994c1e7a4 100644 --- a/examples/projects/NUCLEO-F401RE/led/lib/alias_save/alias_save.c +++ b/examples/projects/NUCLEO-F401RE/led/lib/alias_save/alias_save.c @@ -7,6 +7,7 @@ #include "main.h" #include "alias_save.h" #include "luos_engine.h" +#include "robus.h" #include "string.h" /******************************************************************************* @@ -87,4 +88,4 @@ static void Alias_FlashPageErase(void) HAL_FLASH_Unlock(); HAL_FLASHEx_Erase(&s_eraseinit, §or_error); HAL_FLASH_Lock(); -} \ No newline at end of file +} diff --git a/examples/projects/NUCLEO-F401RE/led/node_config.h b/examples/projects/NUCLEO-F401RE/led/node_config.h index 6dfb410fd..2f61b7924 100644 --- a/examples/projects/NUCLEO-F401RE/led/node_config.h +++ b/examples/projects/NUCLEO-F401RE/led/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F401RE/led/src/main.c b/examples/projects/NUCLEO-F401RE/led/src/main.c index b7d8c3d98..9d3d7daac 100644 --- a/examples/projects/NUCLEO-F401RE/led/src/main.c +++ b/examples/projects/NUCLEO-F401RE/led/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "led.h" /* USER CODE END Includes */ @@ -87,6 +88,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Led_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.h b/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.h index 8cf5566d8..65a31b04d 100644 --- a/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.h +++ b/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.h @@ -2,6 +2,7 @@ #define POTENTIOMETER_H #include "luos_engine.h" +#include "robus.h" #include "potentiometer_drv.h" /******************************************************************************* diff --git a/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer_drv.h b/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer_drv.h index 5940e8520..5d41c5a65 100644 --- a/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer_drv.h +++ b/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer_drv.h @@ -7,6 +7,7 @@ #include "main.h" #include "analog.h" #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -33,4 +34,4 @@ ******************************************************************************/ void PotentiometerDrv_Init(void); -angular_position_t PotentiometerDrv_Read(void); \ No newline at end of file +angular_position_t PotentiometerDrv_Read(void); diff --git a/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h b/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h index 85f50fc13..b8b47bc7f 100644 --- a/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F401RE/potentiometer/src/main.c b/examples/projects/NUCLEO-F401RE/potentiometer/src/main.c index 2931e1c09..85d52815f 100644 --- a/examples/projects/NUCLEO-F401RE/potentiometer/src/main.c +++ b/examples/projects/NUCLEO-F401RE/potentiometer/src/main.c @@ -25,6 +25,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "potentiometer.h" /* USER CODE END Includes */ @@ -90,6 +91,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Potentiometer_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F410RB/bootloader/node_config.h b/examples/projects/NUCLEO-F410RB/bootloader/node_config.h index f2c1ff38d..d764c20cf 100644 --- a/examples/projects/NUCLEO-F410RB/bootloader/node_config.h +++ b/examples/projects/NUCLEO-F410RB/bootloader/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F410RB/bootloader/src/main.c b/examples/projects/NUCLEO-F410RB/bootloader/src/main.c index 435e02e8e..5f6bfccc3 100644 --- a/examples/projects/NUCLEO-F410RB/bootloader/src/main.c +++ b/examples/projects/NUCLEO-F410RB/bootloader/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -90,6 +91,8 @@ int main(void) /* Infinite loop */ /* USER CODE BEGIN WHILE */ + LUOS_ADD_PACKAGE(LuosBootloader) + LUOS_ADD_PACKAGE(Robus) // launch bootloader app while (1) { diff --git a/examples/projects/NUCLEO-F410RB/button/lib/Button/button.h b/examples/projects/NUCLEO-F410RB/button/lib/Button/button.h index 29464d5e3..510616eca 100644 --- a/examples/projects/NUCLEO-F410RB/button/lib/Button/button.h +++ b/examples/projects/NUCLEO-F410RB/button/lib/Button/button.h @@ -8,6 +8,7 @@ #define BUTTON_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F410RB/button/node_config.h b/examples/projects/NUCLEO-F410RB/button/node_config.h index d90ae6816..9d5ee10ae 100644 --- a/examples/projects/NUCLEO-F410RB/button/node_config.h +++ b/examples/projects/NUCLEO-F410RB/button/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F410RB/button/src/main.c b/examples/projects/NUCLEO-F410RB/button/src/main.c index 10d0083a7..5d2e9fff9 100644 --- a/examples/projects/NUCLEO-F410RB/button/src/main.c +++ b/examples/projects/NUCLEO-F410RB/button/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "button.h" /* USER CODE END Includes */ @@ -87,6 +88,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Button_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F410RB/dc_motor/lib/DC_motor/dc_motor_drv.h b/examples/projects/NUCLEO-F410RB/dc_motor/lib/DC_motor/dc_motor_drv.h index f080352d4..e089b1f1f 100644 --- a/examples/projects/NUCLEO-F410RB/dc_motor/lib/DC_motor/dc_motor_drv.h +++ b/examples/projects/NUCLEO-F410RB/dc_motor/lib/DC_motor/dc_motor_drv.h @@ -8,6 +8,7 @@ #define DC_MOTOR_DRV_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h b/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h index f4ffa6f0e..997e5d960 100644 --- a/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F410RB/dc_motor/src/main.c b/examples/projects/NUCLEO-F410RB/dc_motor/src/main.c index 013e73e34..ae85a7966 100644 --- a/examples/projects/NUCLEO-F410RB/dc_motor/src/main.c +++ b/examples/projects/NUCLEO-F410RB/dc_motor/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "dc_motor.h" /* USER CODE END Includes */ @@ -89,6 +90,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); MotorDC_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F410RB/gate_serialcom/node_config.h b/examples/projects/NUCLEO-F410RB/gate_serialcom/node_config.h index 127363770..70a84c3d8 100644 --- a/examples/projects/NUCLEO-F410RB/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F410RB/gate_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F410RB/gate_serialcom/src/main.c b/examples/projects/NUCLEO-F410RB/gate_serialcom/src/main.c index 8abeece16..c60886695 100644 --- a/examples/projects/NUCLEO-F410RB/gate_serialcom/src/main.c +++ b/examples/projects/NUCLEO-F410RB/gate_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h index 52406e55e..560662e5b 100644 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/main.c index cd34f4f44..d6bdde600 100644 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/main.c +++ b/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "inspector.h" #include "pipe.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Inspector_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F410RB/led/lib/Led/led.h b/examples/projects/NUCLEO-F410RB/led/lib/Led/led.h index 64026325c..4a8a99bf4 100644 --- a/examples/projects/NUCLEO-F410RB/led/lib/Led/led.h +++ b/examples/projects/NUCLEO-F410RB/led/lib/Led/led.h @@ -8,6 +8,7 @@ #define LED_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/NUCLEO-F410RB/led/node_config.h b/examples/projects/NUCLEO-F410RB/led/node_config.h index e5f5c7d09..00cc3c093 100644 --- a/examples/projects/NUCLEO-F410RB/led/node_config.h +++ b/examples/projects/NUCLEO-F410RB/led/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F410RB/led/src/main.c b/examples/projects/NUCLEO-F410RB/led/src/main.c index 019371828..b1320fa24 100644 --- a/examples/projects/NUCLEO-F410RB/led/src/main.c +++ b/examples/projects/NUCLEO-F410RB/led/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "led.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Led_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.h b/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.h index 8cf5566d8..65a31b04d 100644 --- a/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.h +++ b/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.h @@ -2,6 +2,7 @@ #define POTENTIOMETER_H #include "luos_engine.h" +#include "robus.h" #include "potentiometer_drv.h" /******************************************************************************* diff --git a/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer_drv.h b/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer_drv.h index 5940e8520..5d41c5a65 100644 --- a/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer_drv.h +++ b/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer_drv.h @@ -7,6 +7,7 @@ #include "main.h" #include "analog.h" #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -33,4 +34,4 @@ ******************************************************************************/ void PotentiometerDrv_Init(void); -angular_position_t PotentiometerDrv_Read(void); \ No newline at end of file +angular_position_t PotentiometerDrv_Read(void); diff --git a/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h b/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h index 85f50fc13..b8b47bc7f 100644 --- a/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-F410RB/potentiometer/src/main.c b/examples/projects/NUCLEO-F410RB/potentiometer/src/main.c index 2931e1c09..85d52815f 100644 --- a/examples/projects/NUCLEO-F410RB/potentiometer/src/main.c +++ b/examples/projects/NUCLEO-F410RB/potentiometer/src/main.c @@ -25,6 +25,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "potentiometer.h" /* USER CODE END Includes */ @@ -90,6 +91,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Potentiometer_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-G431KB/bootloader/node_config.h b/examples/projects/NUCLEO-G431KB/bootloader/node_config.h index 114000d6a..28fbda3ff 100644 --- a/examples/projects/NUCLEO-G431KB/bootloader/node_config.h +++ b/examples/projects/NUCLEO-G431KB/bootloader/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-G431KB/bootloader/src/main.c b/examples/projects/NUCLEO-G431KB/bootloader/src/main.c index 45f74ba98..2d6b44374 100644 --- a/examples/projects/NUCLEO-G431KB/bootloader/src/main.c +++ b/examples/projects/NUCLEO-G431KB/bootloader/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" /* USER CODE END Includes */ @@ -89,6 +90,9 @@ int main(void) /* Infinite loop */ /* USER CODE BEGIN WHILE */ + + LUOS_ADD_PACKAGE(LuosBootloader) + LUOS_ADD_PACKAGE(Robus) while (1) { /* USER CODE END WHILE */ diff --git a/examples/projects/NUCLEO-G431KB/button/lib/Button/button.h b/examples/projects/NUCLEO-G431KB/button/lib/Button/button.h index 29464d5e3..510616eca 100644 --- a/examples/projects/NUCLEO-G431KB/button/lib/Button/button.h +++ b/examples/projects/NUCLEO-G431KB/button/lib/Button/button.h @@ -8,6 +8,7 @@ #define BUTTON_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-G431KB/button/node_config.h b/examples/projects/NUCLEO-G431KB/button/node_config.h index 4963397df..53251109f 100644 --- a/examples/projects/NUCLEO-G431KB/button/node_config.h +++ b/examples/projects/NUCLEO-G431KB/button/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-G431KB/button/src/main.c b/examples/projects/NUCLEO-G431KB/button/src/main.c index cffc3f6e7..e4911eaef 100644 --- a/examples/projects/NUCLEO-G431KB/button/src/main.c +++ b/examples/projects/NUCLEO-G431KB/button/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "button.h" /* USER CODE END Includes */ @@ -87,6 +88,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Button_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-G431KB/dc_motor/lib/DC_motor/dc_motor_drv.h b/examples/projects/NUCLEO-G431KB/dc_motor/lib/DC_motor/dc_motor_drv.h index c3f9d0fac..8a103f2b1 100644 --- a/examples/projects/NUCLEO-G431KB/dc_motor/lib/DC_motor/dc_motor_drv.h +++ b/examples/projects/NUCLEO-G431KB/dc_motor/lib/DC_motor/dc_motor_drv.h @@ -8,6 +8,7 @@ #define DC_MOTOR_DRV_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h b/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h index 301d275a9..1900fb99e 100644 --- a/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-G431KB/dc_motor/src/main.c b/examples/projects/NUCLEO-G431KB/dc_motor/src/main.c index 653f6f387..2492edb17 100644 --- a/examples/projects/NUCLEO-G431KB/dc_motor/src/main.c +++ b/examples/projects/NUCLEO-G431KB/dc_motor/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "dc_motor.h" /* USER CODE END Includes */ @@ -89,6 +90,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); MotorDC_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-G431KB/gate_serialcom/node_config.h b/examples/projects/NUCLEO-G431KB/gate_serialcom/node_config.h index 4d7f5e207..83173ee64 100644 --- a/examples/projects/NUCLEO-G431KB/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-G431KB/gate_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-G431KB/gate_serialcom/src/main.c b/examples/projects/NUCLEO-G431KB/gate_serialcom/src/main.c index fec2c5056..be3929a79 100644 --- a/examples/projects/NUCLEO-G431KB/gate_serialcom/src/main.c +++ b/examples/projects/NUCLEO-G431KB/gate_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h index 26e0de2ad..50c7c3240 100644 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/main.c index 851e01674..6395f48b5 100644 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/main.c +++ b/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "inspector.h" #include "pipe.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Inspector_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.h b/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.h index 8cf5566d8..65a31b04d 100644 --- a/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.h +++ b/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.h @@ -2,6 +2,7 @@ #define POTENTIOMETER_H #include "luos_engine.h" +#include "robus.h" #include "potentiometer_drv.h" /******************************************************************************* diff --git a/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer_drv.h b/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer_drv.h index 47a003ec5..a92f6ce7e 100644 --- a/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer_drv.h +++ b/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer_drv.h @@ -7,6 +7,7 @@ #include "main.h" #include "analog.h" #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -33,4 +34,4 @@ ******************************************************************************/ void PotentiometerDrv_Init(void); -angular_position_t PotentiometerDrv_Read(void); \ No newline at end of file +angular_position_t PotentiometerDrv_Read(void); diff --git a/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h b/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h index 301d275a9..1900fb99e 100644 --- a/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-G431KB/potentiometer/src/main.c b/examples/projects/NUCLEO-G431KB/potentiometer/src/main.c index fe74c39ea..1c713fa5a 100644 --- a/examples/projects/NUCLEO-G431KB/potentiometer/src/main.c +++ b/examples/projects/NUCLEO-G431KB/potentiometer/src/main.c @@ -25,6 +25,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "potentiometer.h" /* USER CODE END Includes */ @@ -90,6 +91,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Potentiometer_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-G474RE/bootloader/node_config.h b/examples/projects/NUCLEO-G474RE/bootloader/node_config.h index 114000d6a..28fbda3ff 100644 --- a/examples/projects/NUCLEO-G474RE/bootloader/node_config.h +++ b/examples/projects/NUCLEO-G474RE/bootloader/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-G474RE/bootloader/src/main.c b/examples/projects/NUCLEO-G474RE/bootloader/src/main.c index 3164486bf..068a8584c 100644 --- a/examples/projects/NUCLEO-G474RE/bootloader/src/main.c +++ b/examples/projects/NUCLEO-G474RE/bootloader/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -89,6 +90,9 @@ int main(void) /* Infinite loop */ /* USER CODE BEGIN WHILE */ + + LUOS_ADD_PACKAGE(LuosBootloader) + LUOS_ADD_PACKAGE(Robus) while (1) { /* USER CODE END WHILE */ diff --git a/examples/projects/NUCLEO-G474RE/button/lib/Button/button.h b/examples/projects/NUCLEO-G474RE/button/lib/Button/button.h index 29464d5e3..510616eca 100644 --- a/examples/projects/NUCLEO-G474RE/button/lib/Button/button.h +++ b/examples/projects/NUCLEO-G474RE/button/lib/Button/button.h @@ -8,6 +8,7 @@ #define BUTTON_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-G474RE/button/node_config.h b/examples/projects/NUCLEO-G474RE/button/node_config.h index ef25ed2ee..0603cb86e 100644 --- a/examples/projects/NUCLEO-G474RE/button/node_config.h +++ b/examples/projects/NUCLEO-G474RE/button/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-G474RE/button/src/main.c b/examples/projects/NUCLEO-G474RE/button/src/main.c index 1b67f1f18..7b4875771 100644 --- a/examples/projects/NUCLEO-G474RE/button/src/main.c +++ b/examples/projects/NUCLEO-G474RE/button/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "button.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ LUOS_ADD_PACKAGE(Button) + LUOS_ADD_PACKAGE(Robus) /* USER CODE END 2 */ /* Infinite loop */ diff --git a/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h b/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h index 4d7f5e207..83173ee64 100644 --- a/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-G474RE/gate_serialcom/src/main.c b/examples/projects/NUCLEO-G474RE/gate_serialcom/src/main.c index 608131123..0c61c6ed3 100644 --- a/examples/projects/NUCLEO-G474RE/gate_serialcom/src/main.c +++ b/examples/projects/NUCLEO-G474RE/gate_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ @@ -89,6 +90,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h index 26e0de2ad..50c7c3240 100644 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/main.c index c1ade5033..443355d49 100644 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/main.c +++ b/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "inspector.h" #include "pipe.h" /* USER CODE END Includes */ @@ -89,6 +90,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Inspector_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h b/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h index 159752726..0e7056282 100644 --- a/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h @@ -39,6 +39,7 @@ * :---------------------|------------------------------------------------------ * DEFAULTBAUDRATE | 1000000 | Robus Network Baudrate b/s * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c b/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c index 51821d4e8..5854b5813 100644 --- a/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c +++ b/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c @@ -22,6 +22,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -89,6 +90,9 @@ int main(void) /* Infinite loop */ /* USER CODE BEGIN WHILE */ + + LUOS_ADD_PACKAGE(LuosBootloader) + LUOS_ADD_PACKAGE(Robus) while (1) { LUOS_RUN() diff --git a/examples/projects/NUCLEO-L073RZ/button/node_config.h b/examples/projects/NUCLEO-L073RZ/button/node_config.h index b8c8a0bc4..2c230b3e1 100644 --- a/examples/projects/NUCLEO-L073RZ/button/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/button/node_config.h @@ -39,6 +39,7 @@ * :---------------------|------------------------------------------------------ * DEFAULTBAUDRATE | 1000000 | Robus Network Baudrate b/s * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-L073RZ/button/src/main.c b/examples/projects/NUCLEO-L073RZ/button/src/main.c index fffdc840a..4da9c3f10 100644 --- a/examples/projects/NUCLEO-L073RZ/button/src/main.c +++ b/examples/projects/NUCLEO-L073RZ/button/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "button.h" /* USER CODE END Includes */ @@ -81,6 +82,7 @@ int main(void) /* USER CODE BEGIN SysInit */ Luos_Init(); + Robus_Init(); Button_Init(); /* USER CODE END SysInit */ diff --git a/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h b/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h index cc23fa12b..96b0111e3 100644 --- a/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-L073RZ/gate_serialcom/src/main.c b/examples/projects/NUCLEO-L073RZ/gate_serialcom/src/main.c index 753a6bf3d..df86c8475 100644 --- a/examples/projects/NUCLEO-L073RZ/gate_serialcom/src/main.c +++ b/examples/projects/NUCLEO-L073RZ/gate_serialcom/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ @@ -82,6 +83,7 @@ int main(void) /* USER CODE BEGIN SysInit */ Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); /* USER CODE END SysInit */ diff --git a/examples/projects/NUCLEO-L432KC/bootloader/node_config.h b/examples/projects/NUCLEO-L432KC/bootloader/node_config.h index 36f2f9fe9..bbf53e225 100644 --- a/examples/projects/NUCLEO-L432KC/bootloader/node_config.h +++ b/examples/projects/NUCLEO-L432KC/bootloader/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-L432KC/bootloader/src/main.c b/examples/projects/NUCLEO-L432KC/bootloader/src/main.c index ebeb62c5a..0c2c71353 100644 --- a/examples/projects/NUCLEO-L432KC/bootloader/src/main.c +++ b/examples/projects/NUCLEO-L432KC/bootloader/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -85,6 +86,9 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ + + LUOS_ADD_PACKAGE(LuosBootloader) + LUOS_ADD_PACKAGE(Robus) while (1) { LUOS_RUN() diff --git a/examples/projects/NUCLEO-L432KC/button/lib/Button/button.h b/examples/projects/NUCLEO-L432KC/button/lib/Button/button.h index 29464d5e3..510616eca 100644 --- a/examples/projects/NUCLEO-L432KC/button/lib/Button/button.h +++ b/examples/projects/NUCLEO-L432KC/button/lib/Button/button.h @@ -8,6 +8,7 @@ #define BUTTON_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-L432KC/button/node_config.h b/examples/projects/NUCLEO-L432KC/button/node_config.h index 4963397df..53251109f 100644 --- a/examples/projects/NUCLEO-L432KC/button/node_config.h +++ b/examples/projects/NUCLEO-L432KC/button/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-L432KC/button/src/main.c b/examples/projects/NUCLEO-L432KC/button/src/main.c index 59951d8f6..5a6a34f20 100644 --- a/examples/projects/NUCLEO-L432KC/button/src/main.c +++ b/examples/projects/NUCLEO-L432KC/button/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "button.h" /* USER CODE END Includes */ @@ -87,6 +88,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Button_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-L432KC/dc_motor/lib/DC_motor/dc_motor_drv.h b/examples/projects/NUCLEO-L432KC/dc_motor/lib/DC_motor/dc_motor_drv.h index 7cab2dda4..f7bf4d2f1 100644 --- a/examples/projects/NUCLEO-L432KC/dc_motor/lib/DC_motor/dc_motor_drv.h +++ b/examples/projects/NUCLEO-L432KC/dc_motor/lib/DC_motor/dc_motor_drv.h @@ -8,6 +8,7 @@ #define DC_MOTOR_DRV_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h b/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h index 4963397df..53251109f 100644 --- a/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-L432KC/dc_motor/src/main.c b/examples/projects/NUCLEO-L432KC/dc_motor/src/main.c index bda5fe95b..b05842cb5 100644 --- a/examples/projects/NUCLEO-L432KC/dc_motor/src/main.c +++ b/examples/projects/NUCLEO-L432KC/dc_motor/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "dc_motor.h" /* USER CODE END Includes */ @@ -89,6 +90,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); MotorDC_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-L432KC/fingerprint/lib/Fingerprint/fingerprint.h b/examples/projects/NUCLEO-L432KC/fingerprint/lib/Fingerprint/fingerprint.h index d74f65ec1..855d00010 100644 --- a/examples/projects/NUCLEO-L432KC/fingerprint/lib/Fingerprint/fingerprint.h +++ b/examples/projects/NUCLEO-L432KC/fingerprint/lib/Fingerprint/fingerprint.h @@ -11,6 +11,7 @@ #define FINGERPRINT_H_ #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions @@ -26,4 +27,4 @@ void Fingerprint_Init(void); void Fingerprint_Loop(void); -#endif /* FINGERPRINT_H_ */ \ No newline at end of file +#endif /* FINGERPRINT_H_ */ diff --git a/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h b/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h index 4963397df..53251109f 100644 --- a/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h +++ b/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-L432KC/fingerprint/src/main.c b/examples/projects/NUCLEO-L432KC/fingerprint/src/main.c index 3bc31d23d..82e521743 100644 --- a/examples/projects/NUCLEO-L432KC/fingerprint/src/main.c +++ b/examples/projects/NUCLEO-L432KC/fingerprint/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "fingerprint.h" /* USER CODE END Includes */ @@ -85,6 +86,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Fingerprint_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h b/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h index 4d7f5e207..83173ee64 100644 --- a/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-L432KC/gate_serialcom/src/main.c b/examples/projects/NUCLEO-L432KC/gate_serialcom/src/main.c index 053fa74b8..ba64b4c2d 100644 --- a/examples/projects/NUCLEO-L432KC/gate_serialcom/src/main.c +++ b/examples/projects/NUCLEO-L432KC/gate_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-L432KC/gpio/lib/Gpio_dev/gpio_dev.h b/examples/projects/NUCLEO-L432KC/gpio/lib/Gpio_dev/gpio_dev.h index 8c9bf4915..a6db26b14 100644 --- a/examples/projects/NUCLEO-L432KC/gpio/lib/Gpio_dev/gpio_dev.h +++ b/examples/projects/NUCLEO-L432KC/gpio/lib/Gpio_dev/gpio_dev.h @@ -8,6 +8,7 @@ #define GPIO_DEV_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-L432KC/gpio/node_config.h b/examples/projects/NUCLEO-L432KC/gpio/node_config.h index 0fec68848..22f3dad59 100644 --- a/examples/projects/NUCLEO-L432KC/gpio/node_config.h +++ b/examples/projects/NUCLEO-L432KC/gpio/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-L432KC/gpio/src/main.c b/examples/projects/NUCLEO-L432KC/gpio/src/main.c index 764089734..5f392593e 100644 --- a/examples/projects/NUCLEO-L432KC/gpio/src/main.c +++ b/examples/projects/NUCLEO-L432KC/gpio/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "gpio_dev.h" /* USER CODE END Includes */ @@ -87,6 +88,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); GpioDev_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h index 26e0de2ad..50c7c3240 100644 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/main.c index a7807b1cc..9059dc0d7 100644 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/main.c +++ b/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "inspector.h" #include "pipe.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Inspector_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.h b/examples/projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.h index 39cba35ea..741816125 100644 --- a/examples/projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.h +++ b/examples/projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.h @@ -11,6 +11,7 @@ #define LCD_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/NUCLEO-L432KC/lcd/node_config.h b/examples/projects/NUCLEO-L432KC/lcd/node_config.h index 4963397df..53251109f 100644 --- a/examples/projects/NUCLEO-L432KC/lcd/node_config.h +++ b/examples/projects/NUCLEO-L432KC/lcd/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-L432KC/lcd/src/main.c b/examples/projects/NUCLEO-L432KC/lcd/src/main.c index ecf5f1444..4c3bc32eb 100644 --- a/examples/projects/NUCLEO-L432KC/lcd/src/main.c +++ b/examples/projects/NUCLEO-L432KC/lcd/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "lcd.h" /* USER CODE END Includes */ @@ -86,6 +87,7 @@ int main(void) /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Lcd_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-L432KC/led/lib/Led/led.h b/examples/projects/NUCLEO-L432KC/led/lib/Led/led.h index 64026325c..4a8a99bf4 100644 --- a/examples/projects/NUCLEO-L432KC/led/lib/Led/led.h +++ b/examples/projects/NUCLEO-L432KC/led/lib/Led/led.h @@ -8,6 +8,7 @@ #define LED_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/NUCLEO-L432KC/led/node_config.h b/examples/projects/NUCLEO-L432KC/led/node_config.h index 4963397df..53251109f 100644 --- a/examples/projects/NUCLEO-L432KC/led/node_config.h +++ b/examples/projects/NUCLEO-L432KC/led/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-L432KC/led/src/main.c b/examples/projects/NUCLEO-L432KC/led/src/main.c index 4ffb40ac0..0ee3e3c4b 100644 --- a/examples/projects/NUCLEO-L432KC/led/src/main.c +++ b/examples/projects/NUCLEO-L432KC/led/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "led.h" /* USER CODE END Includes */ @@ -87,6 +88,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Led_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.h b/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.h index 8cf5566d8..65a31b04d 100644 --- a/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.h +++ b/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.h @@ -2,6 +2,7 @@ #define POTENTIOMETER_H #include "luos_engine.h" +#include "robus.h" #include "potentiometer_drv.h" /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer_drv.h b/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer_drv.h index 951f0f958..cd754f270 100644 --- a/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer_drv.h +++ b/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer_drv.h @@ -7,6 +7,7 @@ #include "main.h" #include "analog.h" #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -33,4 +34,4 @@ ******************************************************************************/ void PotentiometerDrv_Init(void); -angular_position_t PotentiometerDrv_Read(void); \ No newline at end of file +angular_position_t PotentiometerDrv_Read(void); diff --git a/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h b/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h index 4963397df..53251109f 100644 --- a/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-L432KC/potentiometer/src/main.c b/examples/projects/NUCLEO-L432KC/potentiometer/src/main.c index 1573e9a94..19658cbab 100644 --- a/examples/projects/NUCLEO-L432KC/potentiometer/src/main.c +++ b/examples/projects/NUCLEO-L432KC/potentiometer/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "potentiometer.h" /* USER CODE END Includes */ @@ -89,6 +90,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Potentiometer_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/NUCLEO-L432KC/servo/lib/Servo/servo_drv.h b/examples/projects/NUCLEO-L432KC/servo/lib/Servo/servo_drv.h index d9d11c2bc..34fc74db7 100644 --- a/examples/projects/NUCLEO-L432KC/servo/lib/Servo/servo_drv.h +++ b/examples/projects/NUCLEO-L432KC/servo/lib/Servo/servo_drv.h @@ -11,6 +11,7 @@ #define SERVO_DRV_H #include "luos_engine.h" +#include "robus.h" #include "luos_hal.h" /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/servo/node_config.h b/examples/projects/NUCLEO-L432KC/servo/node_config.h index 4963397df..53251109f 100644 --- a/examples/projects/NUCLEO-L432KC/servo/node_config.h +++ b/examples/projects/NUCLEO-L432KC/servo/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/NUCLEO-L432KC/servo/src/main.c b/examples/projects/NUCLEO-L432KC/servo/src/main.c index b990c691f..ff111dfa8 100644 --- a/examples/projects/NUCLEO-L432KC/servo/src/main.c +++ b/examples/projects/NUCLEO-L432KC/servo/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "servo.h" /* USER CODE END Includes */ @@ -85,6 +86,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Servo_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c index 4828a1d47..9e44fbfa6 100644 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c +++ b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c @@ -28,6 +28,7 @@ #include "definitions.h" // SYS function prototypes #include "luos_engine.h" +#include "robus.h" // ***************************************************************************** // ***************************************************************************** @@ -40,6 +41,8 @@ int main(void) /* Initialize all modules */ SYS_Initialize(NULL); + LUOS_ADD_PACKAGE(LuosBootloader) + LUOS_ADD_PACKAGE(Robus) // launch bootloader app while (1) { diff --git a/examples/projects/SAMD21XPLAINED/button/lib/button/button.h b/examples/projects/SAMD21XPLAINED/button/lib/button/button.h index 29464d5e3..510616eca 100644 --- a/examples/projects/SAMD21XPLAINED/button/lib/button/button.h +++ b/examples/projects/SAMD21XPLAINED/button/lib/button/button.h @@ -8,6 +8,7 @@ #define BUTTON_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/SAMD21XPLAINED/button/node_config.h b/examples/projects/SAMD21XPLAINED/button/node_config.h index 8f7265358..056ce9509 100644 --- a/examples/projects/SAMD21XPLAINED/button/node_config.h +++ b/examples/projects/SAMD21XPLAINED/button/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/SAMD21XPLAINED/button/src/main.c b/examples/projects/SAMD21XPLAINED/button/src/main.c index cb91f0293..db62a9707 100644 --- a/examples/projects/SAMD21XPLAINED/button/src/main.c +++ b/examples/projects/SAMD21XPLAINED/button/src/main.c @@ -9,6 +9,7 @@ #include "device.h" #include "luos_engine.h" +#include "robus.h" #include "button.h" void SetSystemClock_48Mhz(void); @@ -19,6 +20,7 @@ int main() SetSystemClock_48Mhz(); Luos_Init(); + Robus_Init(); Button_Init(); while (1) @@ -116,4 +118,4 @@ void SetSystemClock_48Mhz(void) /* Wait for the write to complete */ while (GCLK->STATUS.bit.SYNCBUSY) ; -} \ No newline at end of file +} diff --git a/examples/projects/STM32F4-discovery/bootloader/node_config.h b/examples/projects/STM32F4-discovery/bootloader/node_config.h index c37fdf8be..f6a8050cf 100644 --- a/examples/projects/STM32F4-discovery/bootloader/node_config.h +++ b/examples/projects/STM32F4-discovery/bootloader/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/STM32F4-discovery/bootloader/src/main.c b/examples/projects/STM32F4-discovery/bootloader/src/main.c index 0ef89e5bc..746ba4fd0 100644 --- a/examples/projects/STM32F4-discovery/bootloader/src/main.c +++ b/examples/projects/STM32F4-discovery/bootloader/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -88,6 +89,9 @@ int main(void) /* Infinite loop */ /* USER CODE BEGIN WHILE */ + + LUOS_ADD_PACKAGE(LuosBootloader) + LUOS_ADD_PACKAGE(Robus) while (1) { /* USER CODE END WHILE */ diff --git a/examples/projects/STM32F4-discovery/button/lib/Button/button.h b/examples/projects/STM32F4-discovery/button/lib/Button/button.h index 29464d5e3..510616eca 100644 --- a/examples/projects/STM32F4-discovery/button/lib/Button/button.h +++ b/examples/projects/STM32F4-discovery/button/lib/Button/button.h @@ -8,6 +8,7 @@ #define BUTTON_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/STM32F4-discovery/button/node_config.h b/examples/projects/STM32F4-discovery/button/node_config.h index 985459256..20edd3990 100644 --- a/examples/projects/STM32F4-discovery/button/node_config.h +++ b/examples/projects/STM32F4-discovery/button/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/STM32F4-discovery/button/src/main.c b/examples/projects/STM32F4-discovery/button/src/main.c index c53e28d12..7f047b829 100644 --- a/examples/projects/STM32F4-discovery/button/src/main.c +++ b/examples/projects/STM32F4-discovery/button/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "button.h" /* USER CODE END Includes */ @@ -87,6 +88,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Button_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/STM32F4-discovery/gate_serialcom/node_config.h b/examples/projects/STM32F4-discovery/gate_serialcom/node_config.h index 1baa7a66b..b33ba6c90 100644 --- a/examples/projects/STM32F4-discovery/gate_serialcom/node_config.h +++ b/examples/projects/STM32F4-discovery/gate_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/STM32F4-discovery/gate_serialcom/src/main.c b/examples/projects/STM32F4-discovery/gate_serialcom/src/main.c index e1fc8cb9e..7234e75f4 100644 --- a/examples/projects/STM32F4-discovery/gate_serialcom/src/main.c +++ b/examples/projects/STM32F4-discovery/gate_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h b/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h index cafc07dc3..d4ccaa925 100644 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h +++ b/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/src/main.c b/examples/projects/STM32F4-discovery/inspector_serialcom/src/main.c index 509fda99f..fa99fcefb 100644 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/src/main.c +++ b/examples/projects/STM32F4-discovery/inspector_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "inspector.h" #include "pipe.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Inspector_Init(); Pipe_Init(); diff --git a/examples/projects/STM32L4S5_discovery/bootloader/node_config.h b/examples/projects/STM32L4S5_discovery/bootloader/node_config.h index 155578137..2d7560a79 100644 --- a/examples/projects/STM32L4S5_discovery/bootloader/node_config.h +++ b/examples/projects/STM32L4S5_discovery/bootloader/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/STM32L4S5_discovery/bootloader/src/main.c b/examples/projects/STM32L4S5_discovery/bootloader/src/main.c index 20fa055f3..ab2cccd9c 100644 --- a/examples/projects/STM32L4S5_discovery/bootloader/src/main.c +++ b/examples/projects/STM32L4S5_discovery/bootloader/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -86,6 +87,9 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ + + LUOS_ADD_PACKAGE(LuosBootloader) + LUOS_ADD_PACKAGE(Robus) while (1) { LUOS_RUN() diff --git a/examples/projects/STM32L4S5_discovery/button/lib/Button/button.h b/examples/projects/STM32L4S5_discovery/button/lib/Button/button.h index 29464d5e3..510616eca 100644 --- a/examples/projects/STM32L4S5_discovery/button/lib/Button/button.h +++ b/examples/projects/STM32L4S5_discovery/button/lib/Button/button.h @@ -8,6 +8,7 @@ #define BUTTON_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/STM32L4S5_discovery/button/node_config.h b/examples/projects/STM32L4S5_discovery/button/node_config.h index a42afcefd..aa20ab42f 100644 --- a/examples/projects/STM32L4S5_discovery/button/node_config.h +++ b/examples/projects/STM32L4S5_discovery/button/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/STM32L4S5_discovery/button/src/main.c b/examples/projects/STM32L4S5_discovery/button/src/main.c index 1205598eb..e3c397281 100644 --- a/examples/projects/STM32L4S5_discovery/button/src/main.c +++ b/examples/projects/STM32L4S5_discovery/button/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "button.h" /* USER CODE END Includes */ @@ -87,6 +88,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Button_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h b/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h index 200c21575..bc9e029c7 100644 --- a/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h +++ b/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/STM32L4S5_discovery/gate_serialcom/src/main.c b/examples/projects/STM32L4S5_discovery/gate_serialcom/src/main.c index acc88952e..a5c2b7bc0 100644 --- a/examples/projects/STM32L4S5_discovery/gate_serialcom/src/main.c +++ b/examples/projects/STM32L4S5_discovery/gate_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/led_fader.h b/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/led_fader.h index e6dd7780f..e458e3b98 100644 --- a/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/led_fader.h +++ b/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/led_fader.h @@ -8,6 +8,7 @@ #define LED_FADER_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/ledfader_drv.h b/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/ledfader_drv.h index d36dbdfb1..d60f8b180 100644 --- a/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/ledfader_drv.h +++ b/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/ledfader_drv.h @@ -8,6 +8,7 @@ #define LEDFADER_DRV_H #include "luos_engine.h" +#include "robus.h" #include "stm32f0xx_hal.h" #include "stm32f0xx_ll_exti.h" #include "stm32f0xx_ll_system.h" @@ -47,4 +48,4 @@ void LedFaderDrv_Init(); void LedFaderDrv_Write(color_t *rgb); -#endif /* LEDFADER_DRV_H */ \ No newline at end of file +#endif /* LEDFADER_DRV_H */ diff --git a/examples/projects/l0/bike_alarm/alarm_controller/node_config.h b/examples/projects/l0/bike_alarm/alarm_controller/node_config.h index a363f0023..596ffe4c5 100644 --- a/examples/projects/l0/bike_alarm/alarm_controller/node_config.h +++ b/examples/projects/l0/bike_alarm/alarm_controller/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/bike_alarm/alarm_controller/src/main.c b/examples/projects/l0/bike_alarm/alarm_controller/src/main.c index 754a29031..3797937a1 100644 --- a/examples/projects/l0/bike_alarm/alarm_controller/src/main.c +++ b/examples/projects/l0/bike_alarm/alarm_controller/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "led_fader.h" #include "alarm_controller.h" /* USER CODE END Includes */ @@ -90,6 +91,7 @@ int main(void) /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); LedFader_Init(); AlarmController_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/bike_alarm/start_controller/node_config.h b/examples/projects/l0/bike_alarm/start_controller/node_config.h index 4f0e60e9d..d0bdfb1bb 100644 --- a/examples/projects/l0/bike_alarm/start_controller/node_config.h +++ b/examples/projects/l0/bike_alarm/start_controller/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/bike_alarm/start_controller/src/main.c b/examples/projects/l0/bike_alarm/start_controller/src/main.c index 41b16d190..36f1b51df 100644 --- a/examples/projects/l0/bike_alarm/start_controller/src/main.c +++ b/examples/projects/l0/bike_alarm/start_controller/src/main.c @@ -27,6 +27,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "button.h" /* USER CODE END Includes */ @@ -93,6 +94,7 @@ int main(void) MX_USART1_UART_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Button_Init(); StartController_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/bootloader/node_config.h b/examples/projects/l0/bootloader/node_config.h index 4eb86040c..5c42741a9 100644 --- a/examples/projects/l0/bootloader/node_config.h +++ b/examples/projects/l0/bootloader/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/bootloader/src/main.c b/examples/projects/l0/bootloader/src/main.c index 342a658a9..a987a8b4d 100644 --- a/examples/projects/l0/bootloader/src/main.c +++ b/examples/projects/l0/bootloader/src/main.c @@ -24,6 +24,8 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" +#include "bootloader_core.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -86,6 +88,8 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ + LUOS_ADD_PACKAGE(LuosBootloader) + LUOS_ADD_PACKAGE(Robus) while (1) { LUOS_RUN() diff --git a/examples/projects/l0/button/node_config.h b/examples/projects/l0/button/node_config.h index a08135f1d..a191b492d 100644 --- a/examples/projects/l0/button/node_config.h +++ b/examples/projects/l0/button/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/button/src/main.c b/examples/projects/l0/button/src/main.c index f74a2f726..5f25fe81a 100644 --- a/examples/projects/l0/button/src/main.c +++ b/examples/projects/l0/button/src/main.c @@ -26,6 +26,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "button.h" /* USER CODE END Includes */ @@ -90,6 +91,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Button_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/button_freertos/lib/Led/led.h b/examples/projects/l0/button_freertos/lib/Led/led.h index 64026325c..4a8a99bf4 100644 --- a/examples/projects/l0/button_freertos/lib/Led/led.h +++ b/examples/projects/l0/button_freertos/lib/Led/led.h @@ -8,6 +8,7 @@ #define LED_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/button_freertos/lib/Led/led_drv.h b/examples/projects/l0/button_freertos/lib/Led/led_drv.h index 1223a84d9..52740a857 100644 --- a/examples/projects/l0/button_freertos/lib/Led/led_drv.h +++ b/examples/projects/l0/button_freertos/lib/Led/led_drv.h @@ -8,6 +8,7 @@ #define LED_DRV_H #include "luos_engine.h" +#include "robus.h" #include "stm32f0xx_hal.h" #include "stm32f0xx_ll_exti.h" #include "stm32f0xx_ll_system.h" @@ -28,4 +29,4 @@ void LedDrv_Init(); void LedDrv_Write(uint8_t value); -#endif /* LED_DRV_H */ \ No newline at end of file +#endif /* LED_DRV_H */ diff --git a/examples/projects/l0/button_freertos/node_config.h b/examples/projects/l0/button_freertos/node_config.h index e0f2d81da..2862baca5 100644 --- a/examples/projects/l0/button_freertos/node_config.h +++ b/examples/projects/l0/button_freertos/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/button_freertos/src/freertos.c b/examples/projects/l0/button_freertos/src/freertos.c index 7e9f603fd..93c27d049 100644 --- a/examples/projects/l0/button_freertos/src/freertos.c +++ b/examples/projects/l0/button_freertos/src/freertos.c @@ -3,6 +3,7 @@ #include "cmsis_os.h" #include "luos_engine.h" +#include "robus.h" #include "button.h" #include "led.h" @@ -35,6 +36,7 @@ void Firmware_Init(void) { // Initialization of LuosTask Luos_Init(); + Robus_Init(); Button_Init(); Led_Init(); diff --git a/examples/projects/l0/controller_motor/node_config.h b/examples/projects/l0/controller_motor/node_config.h index a7fa0ecc3..bd2f26522 100644 --- a/examples/projects/l0/controller_motor/node_config.h +++ b/examples/projects/l0/controller_motor/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/controller_motor/src/main.c b/examples/projects/l0/controller_motor/src/main.c index 2a2b992ab..b1269c31a 100644 --- a/examples/projects/l0/controller_motor/src/main.c +++ b/examples/projects/l0/controller_motor/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "controller_motor.h" /* USER CODE END Includes */ @@ -86,6 +87,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); ControllerMotor_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/dc_motor/lib/DC_motor/dc_motor_drv.h b/examples/projects/l0/dc_motor/lib/DC_motor/dc_motor_drv.h index a09e2341d..c101e7f81 100644 --- a/examples/projects/l0/dc_motor/lib/DC_motor/dc_motor_drv.h +++ b/examples/projects/l0/dc_motor/lib/DC_motor/dc_motor_drv.h @@ -8,6 +8,7 @@ #define DC_MOTOR_DRV_H #include "luos_engine.h" +#include "robus.h" #include "stm32f0xx_hal.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/dc_motor/node_config.h b/examples/projects/l0/dc_motor/node_config.h index cd69b45fc..e005456e0 100644 --- a/examples/projects/l0/dc_motor/node_config.h +++ b/examples/projects/l0/dc_motor/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/dc_motor/src/main.c b/examples/projects/l0/dc_motor/src/main.c index 4e069b361..d5540c373 100644 --- a/examples/projects/l0/dc_motor/src/main.c +++ b/examples/projects/l0/dc_motor/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "dc_motor.h" /* USER CODE END Includes */ @@ -89,6 +90,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); MotorDC_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.h b/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.h index 813595aad..7be366d3b 100644 --- a/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.h +++ b/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.h @@ -8,6 +8,7 @@ #define START_CONTROLLER_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/demo/detection_button/node_config.h b/examples/projects/l0/demo/detection_button/node_config.h index 951da282c..2822eb9c3 100644 --- a/examples/projects/l0/demo/detection_button/node_config.h +++ b/examples/projects/l0/demo/detection_button/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/demo/detection_button/src/main.c b/examples/projects/l0/demo/detection_button/src/main.c index 62915aaa4..fb9ae0b45 100644 --- a/examples/projects/l0/demo/detection_button/src/main.c +++ b/examples/projects/l0/demo/detection_button/src/main.c @@ -26,6 +26,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "button.h" #include "detection_button.h" /* USER CODE END Includes */ @@ -93,6 +94,7 @@ int main(void) MX_USART1_UART_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Button_Init(); DetectionButton_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/demo/ledstrip_position/lib/Distance/distance.h b/examples/projects/l0/demo/ledstrip_position/lib/Distance/distance.h index a7b5182f5..bf5d4eff1 100644 --- a/examples/projects/l0/demo/ledstrip_position/lib/Distance/distance.h +++ b/examples/projects/l0/demo/ledstrip_position/lib/Distance/distance.h @@ -8,6 +8,7 @@ #define DISTANCE_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/l0/demo/ledstrip_position/lib/Distance/vl53l0x_drv.h b/examples/projects/l0/demo/ledstrip_position/lib/Distance/vl53l0x_drv.h index a9a3044bf..d5ee34a83 100644 --- a/examples/projects/l0/demo/ledstrip_position/lib/Distance/vl53l0x_drv.h +++ b/examples/projects/l0/demo/ledstrip_position/lib/Distance/vl53l0x_drv.h @@ -10,6 +10,7 @@ #include "stdbool.h" #include "stm32f0xx_hal.h" #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.h b/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.h index e59128e87..a3d0adb41 100644 --- a/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.h +++ b/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.h @@ -8,6 +8,7 @@ #define LedStripPosition #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/demo/ledstrip_position/node_config.h b/examples/projects/l0/demo/ledstrip_position/node_config.h index 575c9d858..ac78e0ec8 100644 --- a/examples/projects/l0/demo/ledstrip_position/node_config.h +++ b/examples/projects/l0/demo/ledstrip_position/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/demo/ledstrip_position/src/main.c b/examples/projects/l0/demo/ledstrip_position/src/main.c index a503be881..6edae715d 100644 --- a/examples/projects/l0/demo/ledstrip_position/src/main.c +++ b/examples/projects/l0/demo/ledstrip_position/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "distance.h" #include "ledstrip_position.h" /* USER CODE END Includes */ @@ -90,6 +91,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Distance_Init(); LedStripPosition_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.h b/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.h index ca4d5d977..497978932 100644 --- a/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.h +++ b/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.h @@ -8,6 +8,7 @@ #define MOTOR_COPY_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/demo/motor_copy_app/node_config.h b/examples/projects/l0/demo/motor_copy_app/node_config.h index 054413a1a..df7ef7d8c 100644 --- a/examples/projects/l0/demo/motor_copy_app/node_config.h +++ b/examples/projects/l0/demo/motor_copy_app/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/demo/motor_copy_app/src/main.c b/examples/projects/l0/demo/motor_copy_app/src/main.c index fdbce11ac..7064e79fb 100644 --- a/examples/projects/l0/demo/motor_copy_app/src/main.c +++ b/examples/projects/l0/demo/motor_copy_app/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "motor_copy.h" /* USER CODE END Includes */ @@ -86,6 +87,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); MotorCopy_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.h b/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.h index 3848ef44f..485a5f3ff 100644 --- a/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.h +++ b/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.h @@ -8,6 +8,7 @@ #define RUN_MOTOR_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/demo/motor_demo_app/node_config.h b/examples/projects/l0/demo/motor_demo_app/node_config.h index 054413a1a..df7ef7d8c 100644 --- a/examples/projects/l0/demo/motor_demo_app/node_config.h +++ b/examples/projects/l0/demo/motor_demo_app/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/demo/motor_demo_app/src/main.c b/examples/projects/l0/demo/motor_demo_app/src/main.c index b6c2efd8c..1a8656f77 100644 --- a/examples/projects/l0/demo/motor_demo_app/src/main.c +++ b/examples/projects/l0/demo/motor_demo_app/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "run_motor.h" /* USER CODE END Includes */ @@ -86,6 +87,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); RunMotor_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/demo/product_config.h b/examples/projects/l0/demo/product_config.h index 42c1013f8..e284a9071 100644 --- a/examples/projects/l0/demo/product_config.h +++ b/examples/projects/l0/demo/product_config.h @@ -7,6 +7,7 @@ #ifndef PRODUCT_CONFIG_H #define PRODUCT_CONFIG_H #include "luos_engine.h" +#include "robus.h" enum { @@ -38,4 +39,4 @@ typedef struct ledstrip_position_OperationMode_t parameter; // Default value is DISTANCE_DISPLAY } ledstrip_position_Parameter_t; -#endif // PRODUCT_CONFIG_H \ No newline at end of file +#endif // PRODUCT_CONFIG_H diff --git a/examples/projects/l0/distance/lib/Distance/distance.h b/examples/projects/l0/distance/lib/Distance/distance.h index a7b5182f5..bf5d4eff1 100644 --- a/examples/projects/l0/distance/lib/Distance/distance.h +++ b/examples/projects/l0/distance/lib/Distance/distance.h @@ -8,6 +8,7 @@ #define DISTANCE_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/l0/distance/lib/Distance/vl53l0x_drv.h b/examples/projects/l0/distance/lib/Distance/vl53l0x_drv.h index a9a3044bf..d5ee34a83 100644 --- a/examples/projects/l0/distance/lib/Distance/vl53l0x_drv.h +++ b/examples/projects/l0/distance/lib/Distance/vl53l0x_drv.h @@ -10,6 +10,7 @@ #include "stdbool.h" #include "stm32f0xx_hal.h" #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/l0/distance/node_config.h b/examples/projects/l0/distance/node_config.h index bd2dd44be..0e964aac5 100644 --- a/examples/projects/l0/distance/node_config.h +++ b/examples/projects/l0/distance/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/distance/src/main.c b/examples/projects/l0/distance/src/main.c index a5bb637de..3c67f8f62 100644 --- a/examples/projects/l0/distance/src/main.c +++ b/examples/projects/l0/distance/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "distance.h" /* USER CODE END Includes */ @@ -89,6 +90,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Distance_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/dxl/lib/Dxl/dxl.h b/examples/projects/l0/dxl/lib/Dxl/dxl.h index 899bb0a80..39bc01bab 100644 --- a/examples/projects/l0/dxl/lib/Dxl/dxl.h +++ b/examples/projects/l0/dxl/lib/Dxl/dxl.h @@ -8,6 +8,7 @@ #define DXL_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/dxl/node_config.h b/examples/projects/l0/dxl/node_config.h index 8390fac1a..e7c266871 100644 --- a/examples/projects/l0/dxl/node_config.h +++ b/examples/projects/l0/dxl/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/dxl/src/main.c b/examples/projects/l0/dxl/src/main.c index 560352279..1e52558ae 100644 --- a/examples/projects/l0/dxl/src/main.c +++ b/examples/projects/l0/dxl/src/main.c @@ -28,6 +28,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "dxl.h" /* USER CODE END Includes */ @@ -97,6 +98,7 @@ int main(void) MX_RTC_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Dxl_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/fingerprint/lib/Fingerprint/fingerprint.h b/examples/projects/l0/fingerprint/lib/Fingerprint/fingerprint.h index 702848c19..0a4b0bf37 100644 --- a/examples/projects/l0/fingerprint/lib/Fingerprint/fingerprint.h +++ b/examples/projects/l0/fingerprint/lib/Fingerprint/fingerprint.h @@ -11,6 +11,7 @@ #define FINGERPRINT_H_ #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions @@ -26,4 +27,4 @@ void Fingerprint_Init(void); void Fingerprint_Loop(void); -#endif /* FINGERPRINT_H_ */ \ No newline at end of file +#endif /* FINGERPRINT_H_ */ diff --git a/examples/projects/l0/fingerprint/node_config.h b/examples/projects/l0/fingerprint/node_config.h index bd2dd44be..0e964aac5 100644 --- a/examples/projects/l0/fingerprint/node_config.h +++ b/examples/projects/l0/fingerprint/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/fingerprint/src/main.c b/examples/projects/l0/fingerprint/src/main.c index 743fa94f2..8d5e0d2d2 100644 --- a/examples/projects/l0/fingerprint/src/main.c +++ b/examples/projects/l0/fingerprint/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "fingerprint.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Fingerprint_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/gate_serialcom/node_config.h b/examples/projects/l0/gate_serialcom/node_config.h index 012118c0f..ab8acc44f 100644 --- a/examples/projects/l0/gate_serialcom/node_config.h +++ b/examples/projects/l0/gate_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/gate_serialcom/src/main.c b/examples/projects/l0/gate_serialcom/src/main.c index f515c71df..931c947e6 100644 --- a/examples/projects/l0/gate_serialcom/src/main.c +++ b/examples/projects/l0/gate_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "pipe.h" #include "gate.h" /* USER CODE END Includes */ @@ -90,6 +91,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Gate_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/gpio/node_config.h b/examples/projects/l0/gpio/node_config.h index e9b4768e3..c4c0396e1 100644 --- a/examples/projects/l0/gpio/node_config.h +++ b/examples/projects/l0/gpio/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/gpio/src/main.c b/examples/projects/l0/gpio/src/main.c index af6cc030d..d82c4a012 100644 --- a/examples/projects/l0/gpio/src/main.c +++ b/examples/projects/l0/gpio/src/main.c @@ -26,6 +26,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "gpio_dev.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); GpioDev_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/imu/lib/Imu/imu.h b/examples/projects/l0/imu/lib/Imu/imu.h index b35e2252d..bf7873ebd 100644 --- a/examples/projects/l0/imu/lib/Imu/imu.h +++ b/examples/projects/l0/imu/lib/Imu/imu.h @@ -8,6 +8,7 @@ #define IMU_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/imu/lib/Imu/mpu_configuration.c b/examples/projects/l0/imu/lib/Imu/mpu_configuration.c index 481a7a25a..60b66ea65 100644 --- a/examples/projects/l0/imu/lib/Imu/mpu_configuration.c +++ b/examples/projects/l0/imu/lib/Imu/mpu_configuration.c @@ -1,5 +1,6 @@ #include #include "luos_engine.h" +#include "robus.h" #include "invensense.h" #include "invensense_adv.h" #include "mpu.h" diff --git a/examples/projects/l0/imu/lib/Imu/mpu_configuration.h b/examples/projects/l0/imu/lib/Imu/mpu_configuration.h index a8d0e1202..3cb025958 100644 --- a/examples/projects/l0/imu/lib/Imu/mpu_configuration.h +++ b/examples/projects/l0/imu/lib/Imu/mpu_configuration.h @@ -2,6 +2,7 @@ #define __MPU_SETUP_H__ #include "luos_engine.h" +#include "robus.h" #include #include #include diff --git a/examples/projects/l0/imu/node_config.h b/examples/projects/l0/imu/node_config.h index 562862b4b..c042ad0c3 100644 --- a/examples/projects/l0/imu/node_config.h +++ b/examples/projects/l0/imu/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/imu/src/main.c b/examples/projects/l0/imu/src/main.c index 217dd3d0c..f607c2824 100644 --- a/examples/projects/l0/imu/src/main.c +++ b/examples/projects/l0/imu/src/main.c @@ -47,6 +47,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "imu.h" /* USER CODE END Includes */ @@ -114,6 +115,7 @@ int main(void) MX_I2C2_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Imu_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/inspector_serialcom/node_config.h b/examples/projects/l0/inspector_serialcom/node_config.h index ec408797e..9d0e413fa 100644 --- a/examples/projects/l0/inspector_serialcom/node_config.h +++ b/examples/projects/l0/inspector_serialcom/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/inspector_serialcom/src/main.c b/examples/projects/l0/inspector_serialcom/src/main.c index d964cedea..79d7838de 100644 --- a/examples/projects/l0/inspector_serialcom/src/main.c +++ b/examples/projects/l0/inspector_serialcom/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "pipe.h" #include "inspector.h" /* USER CODE END Includes */ @@ -90,6 +91,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Inspector_Init(); Pipe_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/lcd/lib/Lcd/lcd.h b/examples/projects/l0/lcd/lib/Lcd/lcd.h index bb8361213..c371e7648 100644 --- a/examples/projects/l0/lcd/lib/Lcd/lcd.h +++ b/examples/projects/l0/lcd/lib/Lcd/lcd.h @@ -11,6 +11,7 @@ #define LCD_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/lcd/node_config.h b/examples/projects/l0/lcd/node_config.h index bd2dd44be..0e964aac5 100644 --- a/examples/projects/l0/lcd/node_config.h +++ b/examples/projects/l0/lcd/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/lcd/src/main.c b/examples/projects/l0/lcd/src/main.c index 99a217196..32cda4486 100644 --- a/examples/projects/l0/lcd/src/main.c +++ b/examples/projects/l0/lcd/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "lcd.h" /* USER CODE END Includes */ @@ -88,6 +89,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Lcd_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/led/lib/Led/led.h b/examples/projects/l0/led/lib/Led/led.h index 64026325c..4a8a99bf4 100644 --- a/examples/projects/l0/led/lib/Led/led.h +++ b/examples/projects/l0/led/lib/Led/led.h @@ -8,6 +8,7 @@ #define LED_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/led/lib/Led/led_drv.h b/examples/projects/l0/led/lib/Led/led_drv.h index 3b23ed9df..845ab495e 100644 --- a/examples/projects/l0/led/lib/Led/led_drv.h +++ b/examples/projects/l0/led/lib/Led/led_drv.h @@ -8,6 +8,7 @@ #define LED_DRV_H #include "luos_engine.h" +#include "robus.h" #include "stm32f0xx_hal.h" #include "stm32f0xx_ll_exti.h" #include "stm32f0xx_ll_system.h" @@ -47,4 +48,4 @@ void LedDrv_Init(); void LedDrv_Write(color_t *rgb); -#endif /* LED_DRV_H */ \ No newline at end of file +#endif /* LED_DRV_H */ diff --git a/examples/projects/l0/led/node_config.h b/examples/projects/l0/led/node_config.h index bd2dd44be..0e964aac5 100644 --- a/examples/projects/l0/led/node_config.h +++ b/examples/projects/l0/led/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/led/src/main.c b/examples/projects/l0/led/src/main.c index 36b570f42..ef26a1e4e 100644 --- a/examples/projects/l0/led/src/main.c +++ b/examples/projects/l0/led/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "led.h" /* USER CODE END Includes */ @@ -87,6 +88,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Led_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/led_fader/lib/Led_Fader/led_fader.h b/examples/projects/l0/led_fader/lib/Led_Fader/led_fader.h index e6dd7780f..e458e3b98 100644 --- a/examples/projects/l0/led_fader/lib/Led_Fader/led_fader.h +++ b/examples/projects/l0/led_fader/lib/Led_Fader/led_fader.h @@ -8,6 +8,7 @@ #define LED_FADER_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/led_fader/lib/Led_Fader/ledfader_drv.h b/examples/projects/l0/led_fader/lib/Led_Fader/ledfader_drv.h index d36dbdfb1..d60f8b180 100644 --- a/examples/projects/l0/led_fader/lib/Led_Fader/ledfader_drv.h +++ b/examples/projects/l0/led_fader/lib/Led_Fader/ledfader_drv.h @@ -8,6 +8,7 @@ #define LEDFADER_DRV_H #include "luos_engine.h" +#include "robus.h" #include "stm32f0xx_hal.h" #include "stm32f0xx_ll_exti.h" #include "stm32f0xx_ll_system.h" @@ -47,4 +48,4 @@ void LedFaderDrv_Init(); void LedFaderDrv_Write(color_t *rgb); -#endif /* LEDFADER_DRV_H */ \ No newline at end of file +#endif /* LEDFADER_DRV_H */ diff --git a/examples/projects/l0/led_fader/node_config.h b/examples/projects/l0/led_fader/node_config.h index bd2dd44be..0e964aac5 100644 --- a/examples/projects/l0/led_fader/node_config.h +++ b/examples/projects/l0/led_fader/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/led_fader/src/main.c b/examples/projects/l0/led_fader/src/main.c index 9395ba3f8..6a9bcbeef 100644 --- a/examples/projects/l0/led_fader/src/main.c +++ b/examples/projects/l0/led_fader/src/main.c @@ -23,6 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "led_fader.h" /* USER CODE END Includes */ @@ -87,6 +88,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); LedFader_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/led_strip/lib/Led_strip/led_strip.h b/examples/projects/l0/led_strip/lib/Led_strip/led_strip.h index 7210152a5..b86ed3feb 100644 --- a/examples/projects/l0/led_strip/lib/Led_strip/led_strip.h +++ b/examples/projects/l0/led_strip/lib/Led_strip/led_strip.h @@ -8,6 +8,7 @@ #define LED_STRIP_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/led_strip/lib/Led_strip/led_strip_drv.h b/examples/projects/l0/led_strip/lib/Led_strip/led_strip_drv.h index 4a4e893f5..9459e047d 100644 --- a/examples/projects/l0/led_strip/lib/Led_strip/led_strip_drv.h +++ b/examples/projects/l0/led_strip/lib/Led_strip/led_strip_drv.h @@ -7,6 +7,7 @@ #include "main.h" #include "tim.h" #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -19,4 +20,4 @@ * Function ******************************************************************************/ void LedStripDrv_Init(void); -void LedStripDrv_Write(color_t *matrix); \ No newline at end of file +void LedStripDrv_Write(color_t *matrix); diff --git a/examples/projects/l0/led_strip/node_config.h b/examples/projects/l0/led_strip/node_config.h index 941b64d64..06230d3e5 100644 --- a/examples/projects/l0/led_strip/node_config.h +++ b/examples/projects/l0/led_strip/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/led_strip/src/main.c b/examples/projects/l0/led_strip/src/main.c index 7f8249894..c5c41f174 100644 --- a/examples/projects/l0/led_strip/src/main.c +++ b/examples/projects/l0/led_strip/src/main.c @@ -28,6 +28,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "led_strip.h" /* USER CODE END Includes */ @@ -96,6 +97,7 @@ int main(void) MX_TIM2_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); LedStrip_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.h b/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.h index 889b0b020..d68dba091 100644 --- a/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.h +++ b/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.h @@ -8,6 +8,7 @@ #define LIGHT_SENSOR_H #include "luos_engine.h" +#include "robus.h" #include "light_sensor_drv.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor_drv.h b/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor_drv.h index 096058c9b..6fb513491 100644 --- a/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor_drv.h +++ b/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor_drv.h @@ -15,6 +15,7 @@ #include "analog.h" #include "main.h" #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -43,4 +44,4 @@ void LightSensorDrv_Init(void); illuminance_t LightSensorDrv_Read(void); -#endif /* LIGHT_SENSOR_DRV */ \ No newline at end of file +#endif /* LIGHT_SENSOR_DRV */ diff --git a/examples/projects/l0/light_sensor/node_config.h b/examples/projects/l0/light_sensor/node_config.h index bd2dd44be..0e964aac5 100644 --- a/examples/projects/l0/light_sensor/node_config.h +++ b/examples/projects/l0/light_sensor/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/light_sensor/src/main.c b/examples/projects/l0/light_sensor/src/main.c index e5baed065..787b3e0c2 100644 --- a/examples/projects/l0/light_sensor/src/main.c +++ b/examples/projects/l0/light_sensor/src/main.c @@ -26,6 +26,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "light_sensor.h" /* USER CODE END Includes */ @@ -92,6 +93,7 @@ int main(void) MX_USART1_UART_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); LightSensor_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/load/lib/Load/HX711/HX711.h b/examples/projects/l0/load/lib/Load/HX711/HX711.h index 9b8649629..023e3917b 100644 --- a/examples/projects/l0/load/lib/Load/HX711/HX711.h +++ b/examples/projects/l0/load/lib/Load/HX711/HX711.h @@ -10,6 +10,7 @@ #include "stm32f0xx_hal.h" #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/l0/load/lib/Load/load.h b/examples/projects/l0/load/lib/Load/load.h index 5d96531c6..385f896e0 100644 --- a/examples/projects/l0/load/lib/Load/load.h +++ b/examples/projects/l0/load/lib/Load/load.h @@ -8,6 +8,7 @@ #define LOAD_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/load/node_config.h b/examples/projects/l0/load/node_config.h index bd2dd44be..0e964aac5 100644 --- a/examples/projects/l0/load/node_config.h +++ b/examples/projects/l0/load/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/load/src/main.c b/examples/projects/l0/load/src/main.c index b7e297baf..72acd0320 100644 --- a/examples/projects/l0/load/src/main.c +++ b/examples/projects/l0/load/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "load.h" /* USER CODE END Includes */ @@ -89,6 +90,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Load_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.h b/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.h index 8cf5566d8..65a31b04d 100644 --- a/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.h +++ b/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.h @@ -2,6 +2,7 @@ #define POTENTIOMETER_H #include "luos_engine.h" +#include "robus.h" #include "potentiometer_drv.h" /******************************************************************************* diff --git a/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer_drv.h b/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer_drv.h index 5e6a360ff..bfdaf2ef3 100644 --- a/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer_drv.h +++ b/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer_drv.h @@ -7,6 +7,7 @@ #include "main.h" #include "analog.h" #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ @@ -31,4 +32,4 @@ ******************************************************************************/ void PotentiometerDrv_Init(void); -angular_position_t PotentiometerDrv_Read(void); \ No newline at end of file +angular_position_t PotentiometerDrv_Read(void); diff --git a/examples/projects/l0/potentiometer/node_config.h b/examples/projects/l0/potentiometer/node_config.h index bd2dd44be..0e964aac5 100644 --- a/examples/projects/l0/potentiometer/node_config.h +++ b/examples/projects/l0/potentiometer/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/potentiometer/src/main.c b/examples/projects/l0/potentiometer/src/main.c index 4ba3e3695..1fbbb6476 100644 --- a/examples/projects/l0/potentiometer/src/main.c +++ b/examples/projects/l0/potentiometer/src/main.c @@ -26,6 +26,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "potentiometer.h" /* USER CODE END Includes */ @@ -92,6 +93,7 @@ int main(void) MX_USART1_UART_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Potentiometer_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/power_switch/node_config.h b/examples/projects/l0/power_switch/node_config.h index a08135f1d..a191b492d 100644 --- a/examples/projects/l0/power_switch/node_config.h +++ b/examples/projects/l0/power_switch/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/power_switch/src/main.c b/examples/projects/l0/power_switch/src/main.c index 22bdfa2cf..06ed428ca 100644 --- a/examples/projects/l0/power_switch/src/main.c +++ b/examples/projects/l0/power_switch/src/main.c @@ -26,6 +26,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "power_switch.h" /* USER CODE END Includes */ @@ -90,6 +91,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); PowerSwitch_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/servo/lib/Servo/servo_drv.h b/examples/projects/l0/servo/lib/Servo/servo_drv.h index 7f12e8bec..afd8b0924 100644 --- a/examples/projects/l0/servo/lib/Servo/servo_drv.h +++ b/examples/projects/l0/servo/lib/Servo/servo_drv.h @@ -9,6 +9,7 @@ #include "stm32f0xx_hal.h" #include "luos_engine.h" +#include "robus.h" #include "luos_hal.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/servo/node_config.h b/examples/projects/l0/servo/node_config.h index 540c3c059..7a554101a 100644 --- a/examples/projects/l0/servo/node_config.h +++ b/examples/projects/l0/servo/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/servo/src/main.c b/examples/projects/l0/servo/src/main.c index 36abd03c8..2386861fb 100644 --- a/examples/projects/l0/servo/src/main.c +++ b/examples/projects/l0/servo/src/main.c @@ -24,6 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "servo.h" /* USER CODE END Includes */ @@ -89,6 +90,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Servo_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/l0/stepper/node_config.h b/examples/projects/l0/stepper/node_config.h index a08135f1d..a191b492d 100644 --- a/examples/projects/l0/stepper/node_config.h +++ b/examples/projects/l0/stepper/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * MAX_RTB_ENTRY | 40 | Max entries in the routing table diff --git a/examples/projects/l0/stepper/src/main.c b/examples/projects/l0/stepper/src/main.c index 30963d41f..598bfc8c6 100644 --- a/examples/projects/l0/stepper/src/main.c +++ b/examples/projects/l0/stepper/src/main.c @@ -27,6 +27,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" +#include "robus.h" #include "stepper.h" /* USER CODE END Includes */ @@ -94,6 +95,7 @@ int main(void) MX_TIM3_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Stepper_Init(); /* USER CODE END 2 */ diff --git a/examples/projects/native/button/node_config.h b/examples/projects/native/button/node_config.h index 00a4f1ea4..bf418c0b4 100644 --- a/examples/projects/native/button/node_config.h +++ b/examples/projects/native/button/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 diff --git a/examples/projects/native/button/src/main.c b/examples/projects/native/button/src/main.c index f2e414f5a..790d3f117 100644 --- a/examples/projects/native/button/src/main.c +++ b/examples/projects/native/button/src/main.c @@ -1,13 +1,15 @@ #include "luos_engine.h" +#include "robus.h" #include "button.h" int main(void) { Luos_Init(); + Robus_Init(); Button_Init(); while (1) { Luos_Loop(); Button_Loop(); } -} \ No newline at end of file +} diff --git a/examples/projects/native/gate_wscom/node_config.h b/examples/projects/native/gate_wscom/node_config.h index 749bd8af9..cc9e21a84 100644 --- a/examples/projects/native/gate_wscom/node_config.h +++ b/examples/projects/native/gate_wscom/node_config.h @@ -40,6 +40,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 diff --git a/examples/projects/native/gate_wscom/src/main.c b/examples/projects/native/gate_wscom/src/main.c index 41f4894f1..d95e277eb 100644 --- a/examples/projects/native/gate_wscom/src/main.c +++ b/examples/projects/native/gate_wscom/src/main.c @@ -1,4 +1,5 @@ #include "luos_engine.h" +#include "robus.h" #include "pipe.h" #include "gate.h" #include @@ -16,6 +17,7 @@ void *Gate_Pipe_LoopThread(void *vargp) int main(void) { Luos_Init(); + Robus_Init(); Pipe_Init(); Gate_Init(); // Create a thread to convert messages into Json and steam them using Websocket @@ -25,4 +27,4 @@ int main(void) { Luos_Loop(); } -} \ No newline at end of file +} diff --git a/examples/projects/native/led/lib/Led/led.h b/examples/projects/native/led/lib/Led/led.h index 5efb98688..604a8829a 100644 --- a/examples/projects/native/led/lib/Led/led.h +++ b/examples/projects/native/led/lib/Led/led.h @@ -8,6 +8,7 @@ #define LED_H #include "luos_engine.h" +#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/native/led/node_config.h b/examples/projects/native/led/node_config.h index 00a4f1ea4..bf418c0b4 100644 --- a/examples/projects/native/led/node_config.h +++ b/examples/projects/native/led/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 diff --git a/examples/projects/native/led/src/main.c b/examples/projects/native/led/src/main.c index f9e6ad715..f76bdba6b 100644 --- a/examples/projects/native/led/src/main.c +++ b/examples/projects/native/led/src/main.c @@ -1,13 +1,15 @@ #include "luos_engine.h" +#include "robus.h" #include "led.h" int main(void) { Luos_Init(); + Robus_Init(); Led_Init(); while (1) { Luos_Loop(); Led_Loop(); } -} \ No newline at end of file +} diff --git a/examples/projects/native/ping_pong/lib/PingPong/graph.c b/examples/projects/native/ping_pong/lib/PingPong/graph.c index dd57553dc..a48cf9d40 100644 --- a/examples/projects/native/ping_pong/lib/PingPong/graph.c +++ b/examples/projects/native/ping_pong/lib/PingPong/graph.c @@ -6,6 +6,7 @@ #include #include #include "luos_engine.h" +#include "robus.h" #include "game_anim.h" #include "scoring.h" @@ -194,4 +195,4 @@ void score_view(void) printf("\n\tSomeone just lost...\n"); need_update = false; } -} \ No newline at end of file +} diff --git a/examples/projects/native/ping_pong/lib/PingPong/scoring.h b/examples/projects/native/ping_pong/lib/PingPong/scoring.h index 4470feca0..fce4edd61 100644 --- a/examples/projects/native/ping_pong/lib/PingPong/scoring.h +++ b/examples/projects/native/ping_pong/lib/PingPong/scoring.h @@ -8,6 +8,7 @@ #define SCORING_H #include "luos_engine.h" +#include "robus.h" #define SCORE_TOPIC 1 #define SCORE_CMD LUOS_LAST_STD_CMD + 1 diff --git a/examples/projects/native/ping_pong/node_config.h b/examples/projects/native/ping_pong/node_config.h index 889fba9c6..f1cdf8ff6 100644 --- a/examples/projects/native/ping_pong/node_config.h +++ b/examples/projects/native/ping_pong/node_config.h @@ -38,6 +38,7 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 diff --git a/examples/projects/native/ping_pong/src/main.c b/examples/projects/native/ping_pong/src/main.c index 3a6470fb0..17b351006 100644 --- a/examples/projects/native/ping_pong/src/main.c +++ b/examples/projects/native/ping_pong/src/main.c @@ -1,4 +1,5 @@ #include "luos_engine.h" +#include "robus.h" #include "ping_pong.h" #include @@ -14,6 +15,7 @@ void *PingPong_LoopThread(void *vargp) int main(void) { Luos_Init(); + Robus_Init(); PingPong_Init(); pthread_t thread_id; pthread_create(&thread_id, NULL, PingPong_LoopThread, NULL); @@ -21,4 +23,4 @@ int main(void) { Luos_Loop(); } -} \ No newline at end of file +} diff --git a/network/robus/HAL/NATIVE/robus_hal.c b/network/robus/HAL/NATIVE/robus_hal.c index af4c1d014..c0a1f5bb1 100644 --- a/network/robus/HAL/NATIVE/robus_hal.c +++ b/network/robus/HAL/NATIVE/robus_hal.c @@ -20,6 +20,7 @@ #include #include #include "luos_engine.h" +#include "robus.h" #include "luos_hal.h" /******************************************************************************* diff --git a/network/robus/inc/_robus.h b/network/robus/inc/_robus.h new file mode 100644 index 000000000..3ecbd4761 --- /dev/null +++ b/network/robus/inc/_robus.h @@ -0,0 +1,18 @@ +/****************************************************************************** + * @file robus + * @brief User functionalities of the robus communication protocol + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef __ROBUS_H_ +#define __ROBUS_H_ + +#include +#include "luos_phy.h" + +/******************************************************************************* + * Function + ******************************************************************************/ +luos_phy_t *Robus_GetPhy(void); + +#endif /* __ROBUS_H_ */ diff --git a/network/robus/inc/context.h b/network/robus/inc/context.h index b4c65ac40..4e79144fe 100644 --- a/network/robus/inc/context.h +++ b/network/robus/inc/context.h @@ -7,7 +7,7 @@ #ifndef _CONTEXT_H_ #define _CONTEXT_H_ -#include +#include <_robus.h> #include "robus_config.h" #include "port_manager.h" #include "reception.h" diff --git a/network/robus/inc/port_manager.h b/network/robus/inc/port_manager.h index bf7bcc644..6b8b0c3d7 100644 --- a/network/robus/inc/port_manager.h +++ b/network/robus/inc/port_manager.h @@ -7,7 +7,7 @@ #ifndef _PORTMANAGER_H_ #define _PORTMANAGER_H_ -#include +#include <_robus.h> /******************************************************************************* * Definitions @@ -27,10 +27,8 @@ typedef struct ******************************************************************************/ void PortMng_Init(void); void PortMng_PtpHandler(uint8_t PortNbr); -uint8_t PortMng_PokePort(uint8_t PortNbr); -error_return_t PortMng_PokeNextPort(void); +error_return_t PortMng_PokeNextPort(uint8_t *portId); uint8_t PortMng_PortPokedStatus(void); -void PortMng_SaveNodeID(uint16_t nodeid); bool PortMng_Busy(void); #endif /* _PORTMANAGER_H_ */ diff --git a/network/robus/inc/reception.h b/network/robus/inc/reception.h index 5cc499685..25ccf749d 100644 --- a/network/robus/inc/reception.h +++ b/network/robus/inc/reception.h @@ -7,8 +7,7 @@ #ifndef _RECEPTION_H_ #define _RECEPTION_H_ -#include -#include "luos_phy.h" +#include "_robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/network/robus/inc/robus.h b/network/robus/inc/robus.h index 2b4e2850e..21a696573 100644 --- a/network/robus/inc/robus.h +++ b/network/robus/inc/robus.h @@ -7,7 +7,6 @@ #ifndef _ROBUS_H_ #define _ROBUS_H_ -#include #include "luos_phy.h" /******************************************************************************* @@ -16,10 +15,4 @@ void Robus_Init(void); void Robus_Loop(void); -void Robus_SaveNodeID(uint16_t nodeid); -void Robus_ResetNodeID(void); -bool Robus_Busy(void); -error_return_t Robus_FindNeighbour(void); -luos_phy_t *Robus_GetPhy(void); - #endif /* _ROBUS_H_ */ diff --git a/network/robus/inc/transmission.h b/network/robus/inc/transmission.h index df1cd3f3b..d910a4453 100644 --- a/network/robus/inc/transmission.h +++ b/network/robus/inc/transmission.h @@ -7,8 +7,7 @@ #ifndef _TRANSMISSION_H_ #define _TRANSMISSION_H_ -#include -#include "luos_phy.h" +#include "_robus.h" #include "robus_config.h" /******************************************************************************* * Definitions diff --git a/network/robus/robus_config.h b/network/robus/robus_config.h index b0a81f9be..b4e0a1003 100644 --- a/network/robus/robus_config.h +++ b/network/robus/robus_config.h @@ -21,6 +21,10 @@ #define NBR_RETRY 10 #endif +#ifndef NBR_PORT + #define NBR_PORT 2 +#endif + #define CRC_SIZE 2 #endif /* _ROBUS_CONFIG_H_ */ diff --git a/network/robus/selftest/selftest.c b/network/robus/selftest/selftest.c index 7cac5f195..0667c0991 100644 --- a/network/robus/selftest/selftest.c +++ b/network/robus/selftest/selftest.c @@ -45,6 +45,7 @@ void selftest_SetRxFlag(void) void selftest_init(void) { Luos_Init(); + Robus_Init(); revision_t revision = {.major = 1, .minor = 0, .build = 0}; Luos_CreateService(NULL, VOID_TYPE, "Selftest", revision); diff --git a/network/robus/selftest/selftest.h b/network/robus/selftest/selftest.h index ca82f1cd6..ad50af925 100644 --- a/network/robus/selftest/selftest.h +++ b/network/robus/selftest/selftest.h @@ -8,6 +8,7 @@ #define SELFTEST_H #include "luos_engine.h" +#include "robus.h" void selftest_SetRxFlag(void); void selftest_run(void (*ok_callback)(void), void (*ko_callback)(void)); diff --git a/network/robus/src/port_manager.c b/network/robus/src/port_manager.c index 23d72b1e5..347e2f6a6 100644 --- a/network/robus/src/port_manager.c +++ b/network/robus/src/port_manager.c @@ -39,7 +39,6 @@ #include "context.h" #include "robus_hal.h" #include "luos_hal.h" -#include "node.h" /******************************************************************************* * Definitions @@ -47,16 +46,19 @@ typedef enum { POKE, - RELEASE + RELEASE, + PUSHING } PortState_t; /******************************************************************************* * Variables ******************************************************************************/ PortState_t Port_ExpectedState = POKE; +uint32_t port_detected = 0; /******************************************************************************* * Function ******************************************************************************/ _CRITICAL static void PortMng_Reset(void); +uint8_t PortMng_PokePort(uint8_t PortNbr); /****************************************************************************** * @brief init the portManager state machine * @param None @@ -65,11 +67,6 @@ _CRITICAL static void PortMng_Reset(void); _CRITICAL void PortMng_Init(void) { PortMng_Reset(); - // Reinit port table - for (uint8_t port = 0; port < NBR_PORT; port++) - { - Node_Get()->port_table[port] = 0; - } } /****************************************************************************** * @brief PTP interrupt handler @@ -84,20 +81,28 @@ _CRITICAL void PortMng_PtpHandler(uint8_t PortNbr) Port_ExpectedState = POKE; ctx.port.keepLine = false; // Check if every line have been poked and poke it if not - for (uint8_t port = 0; port < NBR_PORT; port++) + if (port_detected == (1 << NBR_PORT) - 1) { - if (Node_Get()->port_table[port] == 0) - { - return; - } + // All ports have been detected + // We can consider our phy as done. Notify it to the phy manager + Phy_TopologyDone(Robus_GetPhy()); + // Reset the port state + PortMng_Reset(); } - PortMng_Reset(); + // Ask Luos_phy to find another node + Phy_FindNextNodeJob(); } else if (Port_ExpectedState == POKE) { - // we receive a poke, pull the line to notify your presence + // We just received a poke + // Pull the line to notify your presence RobusHAL_PushPTP(PortNbr); + // Save this port as detected + port_detected |= 1 << PortNbr; ctx.port.activ = PortNbr; + // This port become the topology source of this node + // Notify luos_phy about it + Phy_Topologysource(Robus_GetPhy(), PortNbr); } } /****************************************************************************** @@ -107,6 +112,9 @@ _CRITICAL void PortMng_PtpHandler(uint8_t PortNbr) ******************************************************************************/ uint8_t PortMng_PokePort(uint8_t PortNbr) { + Port_ExpectedState = PUSHING; + // We can consider this port as detected + port_detected |= 1 << PortNbr; // Push the ptp line RobusHAL_PushPTP(PortNbr); // Wait a little just to be sure everyone can read it @@ -117,12 +125,10 @@ uint8_t PortMng_PokePort(uint8_t PortNbr) RobusHAL_SetPTPDefaultState(PortNbr); while (LuosHAL_GetSystick() - start_tick < 3) ; - // Save port as empty by default - Node_Get()->port_table[PortNbr] = 0xFFFF; // Read the line state if (RobusHAL_GetPTPState(PortNbr)) { - // Someone reply, reverse the detection to wake up on line release + // Someone reply, reverse the detection to wake up on release condition RobusHAL_SetPTPReverseState(PortNbr); Port_ExpectedState = RELEASE; // Port poked by node @@ -130,35 +136,36 @@ uint8_t PortMng_PokePort(uint8_t PortNbr) ctx.port.keepLine = true; return 1; } + Port_ExpectedState = POKE; // Nobodies reply to our poke return 0; } + /****************************************************************************** * @brief being poked so poke next node to * @param None * @return true if a port have been poke else false ******************************************************************************/ -error_return_t PortMng_PokeNextPort(void) +error_return_t PortMng_PokeNextPort(uint8_t *portId) { - if ((ctx.port.activ != NBR_PORT) || (Node_Get()->node_id == 1)) + for (uint8_t port = 0; port < NBR_PORT; port++) { - for (uint8_t port = 0; port < NBR_PORT; port++) + if (!(port_detected & (1 << port))) { - if (Node_Get()->port_table[port] == 0) + // This port have not been poked + if (PortMng_PokePort(port)) { - // this port have not been poked - if (PortMng_PokePort(port)) - { - return SUCCEED; - } - else - { - // nobody is here - Node_Get()->port_table[port] = 0xFFFF; - } + // Poke succeed, we have a node here, return the port id + *portId = port; + return SUCCEED; } + // Poke failed, consider this port as detected and continue + port_detected |= 1 << port; } } + // We check all port and no one reply, we can consider our phy detection as done. + // Notify it to the phy manager + Phy_TopologyDone(Robus_GetPhy()); PortMng_Reset(); return FAILED; } @@ -178,23 +185,7 @@ _CRITICAL void PortMng_Reset(void) { RobusHAL_SetPTPDefaultState(port); } -} - -/****************************************************************************** - * @brief save node id on the port table - * @param node id - * @return None - ******************************************************************************/ -void PortMng_SaveNodeID(uint16_t nodeid) -{ - Node_Get()->port_table[ctx.port.activ] = nodeid; - if (nodeid == 0xFFFF) - { - // This means no that we failed to reach the next node - // Consider this port unconnected - ctx.port.activ = NBR_PORT; - ctx.port.keepLine = false; - } + port_detected = 0; } bool PortMng_Busy(void) diff --git a/network/robus/src/reception.c b/network/robus/src/reception.c index d5b24e27a..aaf89f0e3 100644 --- a/network/robus/src/reception.c +++ b/network/robus/src/reception.c @@ -68,7 +68,6 @@ uint16_t crc_val = 0; // CRC value /******************************************************************************* * Function ******************************************************************************/ -static inline bool Recep_RobusShouldDrop(header_t *header); /****************************************************************************** * @brief Reception init. * @param None @@ -131,12 +130,6 @@ _CRITICAL void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data) ctx.rx.callback = Recep_GetData; if (ctx.rx.status.rx_framing_error == false) { - if (Recep_RobusShouldDrop((header_t *)data_rx) == true) - { - ctx.rx.callback = Recep_Drop; - return; - } - // We complete the header reception, we need to compute all the needed values. // Compute message header size, keep, ... the result will be available in phy_robus->rx_size, ... Phy_ComputeHeader(phy_robus); @@ -320,24 +313,3 @@ _CRITICAL void Recep_CatchAck(luos_phy_t *phy_robus, volatile uint8_t *data) ctx.tx.status = TX_NOK; } } -/****************************************************************************** - * @brief Define if we should drop this message before Luos get it - * @param header of message - * @return true or false - * warning : this function can be redefined only for mock testing purpose - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL static inline bool Recep_RobusShouldDrop(header_t *header) -{ - // During detection we receive node ID messages, we need to keep them only if PTP allow us to keep them. - // Find if we should remove this message. - if (header->target_mode == NODEIDACK) - { - if ((header->target == 0) && ((ctx.port.activ == NBR_PORT) || (PortMng_Busy() == true))) - { - // If a no port is activ or we are waiting for a release of a PTP we drop node ID 1 message - return true; - } - } - return false; -} diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index ce8ddf1ae..d2ea97e96 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -16,7 +16,10 @@ /******************************************************************************* * Definitions ******************************************************************************/ -static void Robus_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job); +// Phy callback definitions +static void Robus_JobHandler(luos_phy_t *phy_ptr, phy_job_t *job); +static error_return_t Robus_RunTopology(luos_phy_t *phy_ptr, uint8_t *portId); +static void Robus_Reset(luos_phy_t *phy_ptr); /******************************************************************************* * Variables @@ -47,7 +50,7 @@ void Robus_Init(void) Transmit_Init(); // Instantiate the phy struct - phy_robus = Phy_Create(Robus_MsgHandler); + phy_robus = Phy_Create(Robus_JobHandler, Robus_RunTopology, Robus_Reset); LUOS_ASSERT(phy_robus); // Init reception @@ -70,7 +73,7 @@ void Robus_Loop(void) * @param job * @return None ******************************************************************************/ -void Robus_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job) +void Robus_JobHandler(luos_phy_t *phy_ptr, phy_job_t *job) { static uint8_t encaps_index = 0; // Luos ask Robus to send a message @@ -95,46 +98,26 @@ void Robus_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job) Transmit_Process(); } -/****************************************************************************** - * @brief Save a node id in the port table - * @param nodeid to save - * @return None. - ******************************************************************************/ -void Robus_SaveNodeID(uint16_t nodeid) -{ - PortMng_SaveNodeID(nodeid); -} - /****************************************************************************** * @brief Reset the node id of the port table - * @param None + * @param phy_ptr not used * @return None. ******************************************************************************/ -void Robus_ResetNodeID(void) +void Robus_Reset(luos_phy_t *phy_ptr) { PortMng_Init(); Recep_Reset(); Transmit_Init(); } -/****************************************************************************** - * @brief Is Robus busy - * @param None - * @return nodeid. - ******************************************************************************/ -bool Robus_Busy(void) -{ - return PortMng_Busy(); -} - /****************************************************************************** * @brief Find the next neighbour on this phy * @param None * @return error_return_t ******************************************************************************/ -error_return_t Robus_FindNeighbour(void) +error_return_t Robus_RunTopology(luos_phy_t *phy_ptr, uint8_t *portId) { - return PortMng_PokeNextPort(); + return PortMng_PokeNextPort(portId); } /****************************************************************************** diff --git a/test/_resources/Scenarios/default_scenario.c b/test/_resources/Scenarios/default_scenario.c index 54cf5eba6..6eb0b3d44 100644 --- a/test/_resources/Scenarios/default_scenario.c +++ b/test/_resources/Scenarios/default_scenario.c @@ -32,6 +32,7 @@ void Init_Context(void) Luos_ServicesClear(); RoutingTB_Erase(); // Delete RTB Luos_Init(); + Robus_Init(); if (IS_ASSERT()) { printf("[FATAL] Can't reset scenario context\n"); @@ -41,6 +42,7 @@ void Init_Context(void) RESET_ASSERT(); Luos_Init(); + Robus_Init(); // Create services revision_t revision = {.major = 1, .minor = 0, .build = 0}; diff --git a/test/_resources/Unity/unit_test.h b/test/_resources/Unity/unit_test.h index 6375e4149..19fec4537 100644 --- a/test/_resources/Unity/unit_test.h +++ b/test/_resources/Unity/unit_test.h @@ -8,6 +8,7 @@ #include "luos_hal.h" #include "robus_hal.h" #include "luos_engine.h" +#include "robus.h" #include "luos_utils.h" #include diff --git a/test/tests_core/test_routing_table/main.c b/test/tests_core/test_routing_table/main.c index 82e816615..d53dce182 100644 --- a/test/tests_core/test_routing_table/main.c +++ b/test/tests_core/test_routing_table/main.c @@ -255,19 +255,19 @@ void unittest_RoutingTB_ConvertNodeToRoutingTable(void) routing_table_t entry; node_t node; - node.certified = false; - node.node_id = 10; - node.node_info = 20; - node.port_table[0] = 30; - node.port_table[1] = 40; + node.certified = false; + node.node_id = 10; + node.node_info = 20; + node.connection.parent.node_id = 30; + node.connection.child.node_id = 40; RoutingTB_ConvertNodeToRoutingTable(&entry, &node); TEST_ASSERT_EQUAL(NODE, entry.mode); TEST_ASSERT_EQUAL(false, entry.certified); TEST_ASSERT_EQUAL(10, entry.node_id); TEST_ASSERT_EQUAL(20, entry.node_info); - TEST_ASSERT_EQUAL(30, entry.port_table[0]); - TEST_ASSERT_EQUAL(40, entry.port_table[1]); + TEST_ASSERT_EQUAL(30, entry.connection.parent.node_id); + TEST_ASSERT_EQUAL(40, entry.connection.child.node_id); } CATCH { diff --git a/test/tests_io/test_luos_io/main.c b/test/tests_io/test_luos_io/main.c index 114566a53..2071aee2e 100644 --- a/test/tests_io/test_luos_io/main.c +++ b/test/tests_io/test_luos_io/main.c @@ -18,12 +18,21 @@ static void phy_robus_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job) Robus_handled_job = job; } +error_return_t topo_cb(luos_phy_t *phy_ptr, uint8_t *portId) +{ + return SUCCEED; +} + +void reset_cb(luos_phy_t *phy_ptr) +{ +} + static void luosIO_reset_overlap_callback(void) { LuosIO_Init(); // Overlap the normal callbacks - luos_phy = Phy_Get(0, phy_luos_MsgHandler); - Phy_Get(1, phy_robus_MsgHandler); + luos_phy = Phy_Get(0, phy_luos_MsgHandler, topo_cb, reset_cb); + Phy_Get(1, phy_robus_MsgHandler, topo_cb, reset_cb); TEST_ASSERT_EQUAL(&phy_ctx.phy[0], luos_phy); } @@ -151,6 +160,8 @@ void unittest_luosIO_TransmitLocalRoutingTable() void unittest_luosIO_ConsumeMsg() { + connection_t con_table[5]; + NEW_TEST_CASE("Check assert condition for ConsumeMsg"); { TRY @@ -160,34 +171,96 @@ void unittest_luosIO_ConsumeMsg() } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; + + TRY + { + LuosIO_Init(); + msg_t msg; + msg.header.cmd = CONNECTION_DATA; + connection_table_ptr = NULL; + LuosIO_ConsumeMsg(&msg); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + LuosIO_Init(); + msg_t msg; + msg.header.cmd = PORT_DATA; + connection_table_ptr = NULL; + LuosIO_ConsumeMsg(&msg); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + LuosIO_Init(); + msg_t msg; + msg.header.cmd = PORT_DATA; + msg.header.size = 0; + connection_table_ptr = con_table; + con_table[0].parent.node_id = 1; + LuosIO_ConsumeMsg(&msg); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + LuosIO_Init(); + msg_t msg; + msg.header.cmd = PORT_DATA; + msg.header.size = sizeof(port_t); + connection_table_ptr = con_table; + con_table[last_node - 1].parent.node_id = 0xFFFF; + LuosIO_ConsumeMsg(&msg); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + LuosIO_Init(); + msg_t msg; + msg.header.cmd = PORT_DATA; + msg.header.size = sizeof(connection_t) + 1; + connection_table_ptr = con_table; + con_table[last_node].parent.node_id = 20; + LuosIO_ConsumeMsg(&msg); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; } - NEW_TEST_CASE("Check WRITE_NODE_ID size 0 treatment (node id generation)"); + NEW_TEST_CASE("Check CONNECTION_DATA size of a port_ treatment (topology retriving)"); { TRY { luosIO_reset_overlap_callback(); - Luos_handled_job = NULL; last_node = 1; Node_Get()->node_id = 1; msg_t msg; - msg.header.cmd = WRITE_NODE_ID; - msg.header.size = 0; - msg.header.source = 1; + msg.header.cmd = CONNECTION_DATA; + msg.header.size = sizeof(port_t); + port_t port; + port.node_id = 1; + port.phy_id = 2; + port.port_id = 3; + memcpy(msg.data, &port, sizeof(port_t)); + memset(connection_table_ptr, 0xFF, sizeof(connection_t) * 2); LuosIO_ConsumeMsg(&msg); - TEST_ASSERT_EQUAL(2, last_node); - // Check received message content - TEST_ASSERT_NOT_EQUAL(NULL, Luos_handled_job); - TEST_ASSERT_EQUAL(WRITE_NODE_ID, Luos_handled_job->msg_pt->header.cmd); - TEST_ASSERT_EQUAL(sizeof(uint16_t), Luos_handled_job->msg_pt->header.size); - TEST_ASSERT_EQUAL(msg.header.source, Luos_handled_job->msg_pt->header.target); - TEST_ASSERT_EQUAL(NODEIDACK, Luos_handled_job->msg_pt->header.target_mode); - TEST_ASSERT_EQUAL(1, service_ctx.list[0].id); - uint16_t id; - memcpy((void *)&id, (void *)Luos_handled_job->msg_pt->data, sizeof(uint16_t)); - TEST_ASSERT_EQUAL(2, id); + + TEST_ASSERT_EQUAL(1, connection_table_ptr[1].parent.node_id); + TEST_ASSERT_EQUAL(2, connection_table_ptr[1].parent.phy_id); + TEST_ASSERT_EQUAL(3, connection_table_ptr[1].parent.port_id); + + TEST_ASSERT_EQUAL(0xFFFF, connection_table_ptr[0].parent.node_id); + TEST_ASSERT_EQUAL(0xFF, connection_table_ptr[0].parent.phy_id); + TEST_ASSERT_EQUAL(0xFF, connection_table_ptr[0].parent.port_id); } CATCH { @@ -196,34 +269,47 @@ void unittest_luosIO_ConsumeMsg() END_TRY; } - NEW_TEST_CASE("Check WRITE_NODE_ID size 2 treatment (node id received from the detector)"); + NEW_TEST_CASE("Check CONNECTION_DATA size of a connection_t treatment (topology retriving)"); { TRY { luosIO_reset_overlap_callback(); - Luos_handled_job = NULL; - Robus_handled_job = NULL; + last_node = 1; Node_Get()->node_id = 1; msg_t msg; - msg.header.cmd = WRITE_NODE_ID; - msg.header.size = 2; - msg.header.source = 1; - uint16_t id = 2; - memcpy((void *)msg.data, (void *)&id, sizeof(uint16_t)); + msg.header.cmd = CONNECTION_DATA; + msg.header.size = 2 * sizeof(connection_t); + connection_t con[2]; + con[0].parent.node_id = 2; + con[0].parent.phy_id = 1; + con[0].parent.port_id = 3; + con[0].child.node_id = 4; + con[0].child.phy_id = 5; + con[0].child.port_id = 6; + con[1].parent.node_id = 7; + con[1].parent.phy_id = 8; + con[1].parent.port_id = 9; + con[1].child.node_id = 3; + con[1].child.phy_id = 11; + con[1].child.port_id = 12; + + memcpy(msg.data, con, 2 * sizeof(connection_t)); + memset(connection_table_ptr, 0xFF, sizeof(connection_t) * 2); LuosIO_ConsumeMsg(&msg); + TEST_ASSERT_EQUAL(3, last_node); - // Check received message content - TEST_ASSERT_EQUAL(NULL, Luos_handled_job); - TEST_ASSERT_NOT_EQUAL(NULL, Robus_handled_job); - TEST_ASSERT_EQUAL(WRITE_NODE_ID, Robus_handled_job->msg_pt->header.cmd); - TEST_ASSERT_EQUAL(sizeof(node_bootstrap_t), Robus_handled_job->msg_pt->header.size); - TEST_ASSERT_EQUAL(0, Robus_handled_job->msg_pt->header.target); - TEST_ASSERT_EQUAL(NODEIDACK, Robus_handled_job->msg_pt->header.target_mode); - node_bootstrap_t node_bootstrap; - memcpy((void *)&node_bootstrap, (void *)Robus_handled_job->msg_pt->data, sizeof(node_bootstrap_t)); - TEST_ASSERT_EQUAL(2, node_bootstrap.nodeid); - TEST_ASSERT_EQUAL(1, node_bootstrap.prev_nodeid); + TEST_ASSERT_EQUAL(2, connection_table_ptr[1].parent.node_id); + TEST_ASSERT_EQUAL(1, connection_table_ptr[1].parent.phy_id); + TEST_ASSERT_EQUAL(3, connection_table_ptr[1].parent.port_id); + + TEST_ASSERT_EQUAL(3, connection_table_ptr[2].child.node_id); + TEST_ASSERT_EQUAL(11, connection_table_ptr[2].child.phy_id); + TEST_ASSERT_EQUAL(12, connection_table_ptr[2].child.port_id); + + TEST_ASSERT_EQUAL(0xFFFF, connection_table_ptr[0].parent.node_id); + TEST_ASSERT_EQUAL(0xFF, connection_table_ptr[0].parent.phy_id); + TEST_ASSERT_EQUAL(0xFF, connection_table_ptr[0].parent.port_id); } CATCH { @@ -232,7 +318,7 @@ void unittest_luosIO_ConsumeMsg() END_TRY; } - NEW_TEST_CASE("Check WRITE_NODE_ID sizeof node_bootstrap_t treatment (nodereceiving it's id and the previous one)"); + NEW_TEST_CASE("Check NODE_ID reception"); { TRY { @@ -241,18 +327,14 @@ void unittest_luosIO_ConsumeMsg() Robus_handled_job = NULL; Node_Get()->node_id = 0; msg_t msg; - msg.header.cmd = WRITE_NODE_ID; - msg.header.size = sizeof(node_bootstrap_t); + msg.header.cmd = NODE_ID; + msg.header.size = 2; msg.header.source = 1; - - node_bootstrap_t node_bootstrap; - node_bootstrap.nodeid = 2; - node_bootstrap.prev_nodeid = 1; - memcpy((void *)msg.data, (void *)&node_bootstrap, sizeof(node_bootstrap_t)); + uint16_t node_id = 2; + memcpy(msg.data, &node_id, sizeof(uint16_t)); error_return_t ret_val = LuosIO_ConsumeMsg(&msg); - // Check received message content TEST_ASSERT_EQUAL(SUCCEED, ret_val); TEST_ASSERT_EQUAL(NULL, Luos_handled_job); TEST_ASSERT_EQUAL(NULL, Robus_handled_job); @@ -265,6 +347,37 @@ void unittest_luosIO_ConsumeMsg() END_TRY; } + NEW_TEST_CASE("Check PORT_DATA treatment (topology retriving)"); + { + TRY + { + luosIO_reset_overlap_callback(); + Luos_handled_job = NULL; + last_node = 2; + connection_table_ptr[1].parent.node_id = 2; + Node_Get()->node_id = 1; + msg_t msg; + msg.header.cmd = PORT_DATA; + msg.header.size = sizeof(port_t); + port_t port; + port.node_id = 1; + port.phy_id = 2; + port.port_id = 3; + memcpy(msg.data, &port, sizeof(port_t)); + + LuosIO_ConsumeMsg(&msg); + + TEST_ASSERT_EQUAL(1, connection_table_ptr[1].child.node_id); + TEST_ASSERT_EQUAL(2, connection_table_ptr[1].child.phy_id); + TEST_ASSERT_EQUAL(3, connection_table_ptr[1].child.port_id); + } + CATCH + { + TEST_ASSERT_TRUE(false); + } + END_TRY; + } + NEW_TEST_CASE("Check LOCAL_RTB assert condition"); { TRY @@ -384,7 +497,6 @@ void unittest_luosIO_ConsumeMsg() // Check received message content TEST_ASSERT_EQUAL(SUCCEED, ret_val); TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); - TEST_ASSERT_EQUAL(EXTERNAL_DETECTION, Node_GetState()); } CATCH { diff --git a/test/tests_io/test_phy/main.c b/test/tests_io/test_phy/main.c index bc2098a0d..dc42cddac 100644 --- a/test/tests_io/test_phy/main.c +++ b/test/tests_io/test_phy/main.c @@ -36,13 +36,22 @@ static void phy_robus_MsgHandler(luos_phy_t *phy_ptr, phy_job_t *job) } } +error_return_t topo_cb(luos_phy_t *phy_ptr, uint8_t *portId) +{ + return SUCCEED; +} + +void reset_cb(luos_phy_t *phy_ptr) +{ +} + static void phy_test_reset(void) { Phy_Init(); - luos_phy = Phy_Get(0, phy_luos_MsgHandler); + luos_phy = Phy_Get(0, phy_luos_MsgHandler, reset_cb, topo_cb); TEST_ASSERT_EQUAL(&phy_ctx.phy[0], luos_phy); TEST_ASSERT_EQUAL(1, phy_ctx.phy_nb); - robus_phy = Phy_Create(phy_robus_MsgHandler); + robus_phy = Phy_Create(phy_robus_MsgHandler, reset_cb, topo_cb); TEST_ASSERT_EQUAL(&phy_ctx.phy[1], robus_phy); TEST_ASSERT_EQUAL(2, phy_ctx.phy_nb); } diff --git a/tool_services/gate/TinyJSON/convert.c b/tool_services/gate/TinyJSON/convert.c index df0b7a557..07bd8a6ce 100644 --- a/tool_services/gate/TinyJSON/convert.c +++ b/tool_services/gate/TinyJSON/convert.c @@ -947,34 +947,15 @@ void Convert_RoutingTableData(service_t *service) { sprintf(json_ptr, "{\"node_id\":%d", routing_table[i].node_id); json_ptr += strlen(json_ptr); - if (routing_table[i].certified) - { - sprintf(json_ptr, ",\"certified\":true"); - json_ptr += strlen(json_ptr); - } - else - { - sprintf(json_ptr, ",\"certified\":false"); - json_ptr += strlen(json_ptr); - } - sprintf(json_ptr, ",\"port_table\":["); - json_ptr += strlen(json_ptr); - // Port loop - for (int port = 0; port < 4; port++) - { - if (routing_table[i].port_table[port]) - { - sprintf(json_ptr, "%d,", routing_table[i].port_table[port]); - json_ptr += strlen(json_ptr); - } - else - { - // remove the last "," char - *(--json_ptr) = '\0'; - break; - } - } - sprintf(json_ptr, "],\"services\":["); + + sprintf(json_ptr, ",\"con\":{\"child\":[%d,%d,%d],\"parent\":[%d,%d,%d]},\"services\":[", + routing_table[i].connection.child.node_id, + routing_table[i].connection.child.phy_id, + routing_table[i].connection.child.port_id, + routing_table[i].connection.parent.node_id, + routing_table[i].connection.parent.phy_id, + routing_table[i].connection.parent.port_id); + json_ptr += strlen(json_ptr); i++; // Services loop @@ -1004,6 +985,8 @@ void Convert_RoutingTableData(service_t *service) *(--json_ptr) = '\0'; // End the Json message sprintf(json_ptr, "]}\n"); + // Run loop before to flush residual msg on the pipe + Luos_Loop(); // reset all the msg in pipe link PipeLink_Reset(service); // call Luos loop to generap a Luos Task with this msg diff --git a/tool_services/gate/data_manager.h b/tool_services/gate/data_manager.h index c94219496..f0c62a3c7 100644 --- a/tool_services/gate/data_manager.h +++ b/tool_services/gate/data_manager.h @@ -41,4 +41,4 @@ void DataManager_Run(service_t *service); // This function manage only commande incoming from pipe void DataManager_RunPipeOnly(service_t *service); -#endif /* DATA_MNGR_H */ \ No newline at end of file +#endif /* DATA_MNGR_H */ diff --git a/tool_services/inspector/inspector.h b/tool_services/inspector/inspector.h index ea33a9e67..11ee3ca60 100644 --- a/tool_services/inspector/inspector.h +++ b/tool_services/inspector/inspector.h @@ -6,8 +6,6 @@ #ifndef INSPECTOR_H #define INSPECTOR_H -#include "luos_engine.h" - /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/tool_services/pipe/pipe.c b/tool_services/pipe/pipe.c index 10febe874..12aeeec30 100644 --- a/tool_services/pipe/pipe.c +++ b/tool_services/pipe/pipe.c @@ -4,10 +4,11 @@ * @author Luos * @version 0.1.0 ******************************************************************************/ +#include +#include "luos_engine.h" #include "pipe.h" #include "_pipe.h" #include "pipe_com.h" -#include /******************************************************************************* * Definitions @@ -101,6 +102,7 @@ static void Pipe_MsgHandler(service_t *service, const msg_t *msg) { tx_StreamChannel.data_ptr = tx_StreamChannel.ring_buffer; tx_StreamChannel.sample_ptr = tx_StreamChannel.data_ptr; + rx_StreamChannel.data_ptr = rx_StreamChannel.ring_buffer; rx_StreamChannel.sample_ptr = rx_StreamChannel.data_ptr; PipeCom_Init(); diff --git a/tool_services/pipe/pipe.h b/tool_services/pipe/pipe.h index 90c07fd4e..e600661af 100644 --- a/tool_services/pipe/pipe.h +++ b/tool_services/pipe/pipe.h @@ -7,8 +7,6 @@ #ifndef PIPE_H #define PIPE_H -#include "luos_engine.h" - /******************************************************************************* * Function ******************************************************************************/ From 713ff72de89512f243c98ea19b19cda6a6ba3ac6 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 26 Jun 2023 13:08:04 +0200 Subject: [PATCH 093/150] Simplify bootloader to make it a standard service and be less intricate in Luos --- engine/IO/src/luos_io.c | 19 +- engine/bootloader/bootloader_core.c | 301 ++++++++---------- engine/bootloader/bootloader_core.h | 41 --- engine/core/inc/luos_utils.h | 3 +- engine/core/inc/struct_luos.h | 25 +- engine/core/src/luos_engine.c | 9 - engine/core/src/luos_utils.c | 22 +- .../NUCLEO-F401RE/bootloader/src/main.c | 1 + .../NUCLEO-F410RB/bootloader/src/main.c | 1 + .../NUCLEO-G431KB/bootloader/src/main.c | 2 +- .../NUCLEO-G474RE/bootloader/src/main.c | 1 + .../NUCLEO-L073RZ/bootloader/src/main.c | 1 + .../NUCLEO-L432KC/bootloader/src/main.c | 1 + .../Bootloader/firmware/src/main.c | 1 + .../STM32F4-discovery/bootloader/src/main.c | 1 + .../STM32L4S5_discovery/bootloader/src/main.c | 1 + test/tests_io/test_luos_io/main.c | 2 +- tool_services/gate/TinyJSON/bootloader_ex.c | 222 ++++++------- tool_services/gate/data_manager.c | 2 +- 19 files changed, 298 insertions(+), 358 deletions(-) diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 70d0384f4..0a08aee8a 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -13,7 +13,6 @@ #include "luos_utils.h" #include "luos_hal.h" #include "luos_engine.h" -#include "bootloader_core.h" #include "robus.h" #include "_luos_phy.h" #include "stats.h" @@ -524,12 +523,22 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) service->auto_refresh.last_update = LuosHAL_GetSystick(); return SUCCEED; break; - //**************************************** bootloader section **************************************** - case BOOTLOADER_CMD: - // TODO add here the bootloader command used in application avoiding to include bootloader files. - return FAILED; + //**************************************** bootloader section **************************************** + + case BOOTLOADER_RESET: + LuosHAL_SetMode((uint8_t)BOOT_MODE); + LuosHAL_Reboot(); + return SUCCEED; break; +#ifdef WITH_BOOTLOADER + case BOOTLOADER_START: + // We're in the app, + // set bootloader mode, save node ID and reboot + Luos_JumpToBootloader(); + return SUCCEED; + break; +#endif default: return FAILED; break; diff --git a/engine/bootloader/bootloader_core.c b/engine/bootloader/bootloader_core.c index d0d4c13ac..d61819236 100644 --- a/engine/bootloader/bootloader_core.c +++ b/engine/bootloader/bootloader_core.c @@ -1,6 +1,6 @@ /****************************************************************************** - * @file Bootloader - * @brief Bootloader functionnalities for luos framework + * @file luos_bootloader + * @brief This file contains a service acting as a bootloader for Luos * @author Luos * @version 0.0.0 ******************************************************************************/ @@ -19,25 +19,14 @@ #ifdef BOOTLOADER #define MAX_FRAME_SIZE (MAX_DATA_MSG_SIZE - 1) #define BUFFER_SIZE 0x800 // 2kB buffer to store received data -#endif /******************************************************************************* * Variables ******************************************************************************/ - -#ifdef BOOTLOADER -// variables use to save binary data in flash -static uint8_t bootloader_data[MAX_FRAME_SIZE]; -static uint16_t bootloader_data_size = 0; - +// Variables used to manage current data to write and page location uint32_t flash_addr = APP_START_ADDRESS; uint8_t data_buff[(uint16_t)BUFFER_SIZE]; -uint16_t data_index = 0; -uint16_t residual_space = (uint16_t)BUFFER_SIZE; -uint32_t nb_bytes = 0; -uint8_t crc = 0; -bool load_flag = false; -uint32_t tickstart = 0; +uint32_t nb_bytes = 0; #ifndef BOOTLOADER_UPDATER // Create a variable of the size of mode flash value allowing to init the shared flash section @@ -51,36 +40,14 @@ static uint8_t LuosBootloader_GetMode(void); static void LuosBootloader_DeInit(void); static void LuosBootloader_JumpToApp(void); static void LuosBootloader_SetNodeID(void); -static inline uint8_t LuosBootloader_IsEnoughSpace(uint32_t); -static inline void LuosBootloader_EraseMemory(void); -static inline void LuosBootloader_ProcessData(void); -static inline void LuosBootloader_SaveLastData(void); -static void LuosBootloader_SendResponse(service_t *service, uint16_t source_id, bootloader_cmd_t response); -static void LuosBootloader_SendCrc(service_t *service, uint16_t source_id, bootloader_cmd_t, uint8_t); +static uint8_t LuosBootloader_IsEnoughSpace(uint32_t); +static void LuosBootloader_EraseMemory(void); +static void LuosBootloader_ProcessData(uint8_t *data, uint32_t data_size); +static void LuosBootloader_SaveLastData(void); +static void LuosBootloader_SendResponse(service_t *service, uint16_t source_id, uint16_t response_cmd); +static void LuosBootloader_SendCrc(service_t *service, uint16_t source_id, uint16_t response_cmd, uint8_t data); static void LuosBootloader_MsgHandler(service_t *service, const msg_t *input); -#endif -/****************************************************************************** - * @brief Save node id in flash - * @param None - * @return None - ******************************************************************************/ -void LuosBootloader_JumpToBootloader(void) -{ - // Set bootlaoder mode - LuosHAL_SetMode((uint8_t)APP_RELOAD_MODE); - - // Save node id in flash - node_t *node = Node_Get(); - uint16_t node_id = node->node_id; - - LuosHAL_SaveNodeID(node_id); - - // Reset the MCU - LuosHAL_Reboot(); -} - -#ifdef BOOTLOADER /****************************************************************************** * @brief Create a service to signal a bootloader node * @param None @@ -164,7 +131,7 @@ void LuosBootloader_SetNodeID(void) * @param binary_size : The size of the binary to flash * @return None ******************************************************************************/ -uint8_t LuosBootloader_IsEnoughSpace(uint32_t binary_size) +inline uint8_t LuosBootloader_IsEnoughSpace(uint32_t binary_size) { #ifdef BOOTLOADER_UPDATER uint32_t free_space = BOOT_START_ADDRESS - APP_START_ADDRESS - 1; @@ -186,7 +153,7 @@ uint8_t LuosBootloader_IsEnoughSpace(uint32_t binary_size) * @param None * @return None ******************************************************************************/ -void LuosBootloader_EraseMemory(void) +inline void LuosBootloader_EraseMemory(void) { LuosHAL_EraseMemory(APP_START_ADDRESS, nb_bytes); } @@ -196,36 +163,38 @@ void LuosBootloader_EraseMemory(void) * @param None * @return None ******************************************************************************/ -void LuosBootloader_ProcessData(void) +inline void LuosBootloader_ProcessData(uint8_t *data, uint32_t data_size) { - if (residual_space >= bootloader_data_size) + static uint16_t data_index = 0; + static uint16_t residual_space = (uint16_t)BUFFER_SIZE; + if (residual_space >= data_size) { - // there is enough space in the current page - // fill the current page with data - memcpy(&data_buff[data_index], bootloader_data, bootloader_data_size); + // There is enough space in the current page to save the complete data + // Fill the current page with data + memcpy(&data_buff[data_index], data, data_size); - // update data_index and residual_space - data_index += bootloader_data_size; - residual_space -= bootloader_data_size; + // Update data_index and residual_space for the next chunk of data + data_index += data_size; + residual_space -= data_size; } else { - // complete the current page buffer - memcpy(&data_buff[data_index], bootloader_data, residual_space); + // Complete the current page buffer + memcpy(&data_buff[data_index], data, residual_space); - // save the completed page in flash memory + // Save the completed page in flash LuosHAL_ProgramFlash(flash_addr, (uint16_t)BUFFER_SIZE, data_buff); - // prepare next page buffer + // Prepare the next page buffer flash_addr += BUFFER_SIZE; data_index = 0; memset(data_buff, 0xFF, (uint16_t)BUFFER_SIZE); - // copy the remaining data in the new page buffer - memcpy(&data_buff[data_index], &bootloader_data[residual_space], bootloader_data_size - residual_space); + // Copy the remaining data in the new page buffer + memcpy(&data_buff[data_index], &data[residual_space], data_size - residual_space); - // update data_index and residual_space - data_index = bootloader_data_size - residual_space; + // Update data_index and residual_space + data_index = data_size - residual_space; residual_space = (uint16_t)BUFFER_SIZE - data_index; } } @@ -235,7 +204,7 @@ void LuosBootloader_ProcessData(void) * @param None * @return None ******************************************************************************/ -void LuosBootloader_SaveLastData(void) +inline void LuosBootloader_SaveLastData(void) { LuosHAL_ProgramFlash(flash_addr, (uint16_t)BUFFER_SIZE, data_buff); } @@ -314,15 +283,14 @@ uint8_t compute_crc(void) * @param data : The crc value * @return None ******************************************************************************/ -void LuosBootloader_SendCrc(service_t *service, uint16_t source_id, bootloader_cmd_t response, uint8_t data) +void LuosBootloader_SendCrc(service_t *service, uint16_t source_id, uint16_t response_cmd, uint8_t data) { msg_t ready_msg; - ready_msg.header.cmd = BOOTLOADER_RESP; + ready_msg.header.cmd = response_cmd; ready_msg.header.target_mode = SERVICEIDACK; ready_msg.header.target = source_id; - ready_msg.header.size = 2 * sizeof(uint8_t); - ready_msg.data[0] = response; - ready_msg.data[1] = data; + ready_msg.header.size = sizeof(uint8_t); + ready_msg.data[0] = data; node_t *node = Node_Get(); uint32_t tick = LuosHAL_GetSystick(); while (LuosHAL_GetSystick() - tick < node->node_id) @@ -335,14 +303,13 @@ void LuosBootloader_SendCrc(service_t *service, uint16_t source_id, bootloader_c * @param response : The type of crc message * @return None ******************************************************************************/ -void LuosBootloader_SendResponse(service_t *service, uint16_t source_id, bootloader_cmd_t response) +void LuosBootloader_SendResponse(service_t *service, uint16_t source_id, uint16_t response_cmd) { msg_t ready_msg; - ready_msg.header.cmd = BOOTLOADER_RESP; + ready_msg.header.cmd = response_cmd; ready_msg.header.target_mode = SERVICEIDACK; ready_msg.header.target = source_id; - ready_msg.header.size = sizeof(uint8_t); - ready_msg.data[0] = response; + ready_msg.header.size = 0; node_t *node = Node_Get(); uint32_t tick = LuosHAL_GetSystick(); while (LuosHAL_GetSystick() - tick < node->node_id) @@ -358,7 +325,6 @@ void LuosBootloader_SendResponse(service_t *service, uint16_t source_id, bootloa void LuosBootloader_Loop(void) { } -#endif /****************************************************************************** * @brief Message handler called from luos library @@ -368,109 +334,96 @@ void LuosBootloader_Loop(void) ******************************************************************************/ void LuosBootloader_MsgHandler(service_t *service, const msg_t *input) { - if (input->header.cmd == BOOTLOADER_CMD) + static uint8_t crc = 0; + static bool load_flag = false; + uint8_t bootloader_data[MAX_FRAME_SIZE]; + uint32_t tickstart; + + switch (input->header.cmd) { - switch (input->data[0]) - { -#ifdef WITH_BOOTLOADER - case BOOTLOADER_START: - // We're in the app, - // set bootloader mode, save node ID and reboot - LuosBootloader_JumpToBootloader(); - break; -#endif -#ifdef BOOTLOADER - // we're in the bootloader, - // process cmd and data - case BOOTLOADER_READY: - bootloader_data_size = input->header.size - 2 * sizeof(char); - Luos_Subscribe(service, (uint16_t)input->data[1]); - memcpy(bootloader_data, &(input->data[2]), bootloader_data_size); // why? - - LuosHAL_SetMode((uint8_t)BOOT_MODE); - - // save binary length - memcpy(&nb_bytes, &bootloader_data[0], sizeof(uint32_t)); - // check free space in flash - if (LuosBootloader_IsEnoughSpace(nb_bytes) == SUCCEED) - { - // send READY response - LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_READY_RESP); - } - else - { - // send ERROR response - LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_ERROR_SIZE); - } - break; - - case BOOTLOADER_ERASE: - // erase flash memory - LuosBootloader_EraseMemory(); - // reset load flag - load_flag = false; - // send ERASE response - LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_ERASE_RESP); - break; - - case BOOTLOADER_BIN_CHUNK: - bootloader_data_size = input->header.size - sizeof(char); - memcpy(bootloader_data, &(input->data[1]), bootloader_data_size); - - // handle binary data - LuosBootloader_ProcessData(); - - // send ack to the Host - LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_BIN_CHUNK_RESP); - break; - - case BOOTLOADER_BIN_END: - bootloader_data_size = input->header.size - sizeof(char); - memcpy(bootloader_data, &(input->data[1]), bootloader_data_size); - - // save the current page in flash memory - LuosBootloader_SaveLastData(); - // send ack to the Host - LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_BIN_END_RESP); - break; - - case BOOTLOADER_CRC_TEST: - crc = compute_crc(); - // send ack to the Host - LuosBootloader_SendCrc(service, input->header.source, BOOTLOADER_CRC_RESP, crc); - break; - - case BOOTLOADER_APP_SAVED: - // set load flag - load_flag = true; - Luos_Unsubscribe(service, input->header.target); - break; - - case BOOTLOADER_STOP: - // wait for the command to be send to all nodes - tickstart = LuosHAL_GetSystick(); - while ((LuosHAL_GetSystick() - tickstart) < 1000) - ; - // save bootloader mode in flash - if (load_flag || (LuosBootloader_GetMode() == APP_RELOAD_MODE)) - { - // boot the application programmed in dedicated flash partition - LuosBootloader_DeInit(); - LuosBootloader_JumpToApp(); - } - else - { - // reboot the node - LuosHAL_Reboot(); - } - break; -#endif - case BOOTLOADER_RESET: - LuosHAL_SetMode((uint8_t)BOOT_MODE); + // we're in the bootloader, + // process cmd and data + case BOOTLOADER_READY: + // Subscribe to the flash topic + Luos_Subscribe(service, (uint16_t)input->data[0]); + // Reset the bootloader in boot mode + LuosHAL_SetMode((uint8_t)BOOT_MODE); + // Save binary length + memcpy(&nb_bytes, &input->data[1], sizeof(uint32_t)); + + // Check the free space in flash + if (LuosBootloader_IsEnoughSpace(nb_bytes) == SUCCEED) + { + // Send READY response + LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_READY); + } + else + { + // Send ERROR response + LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_ERROR_SIZE); + } + break; + + case BOOTLOADER_ERASE: + // Erase flash memory + LuosBootloader_EraseMemory(); + // Reset load flag indicating that there is no apps anymore + load_flag = false; + // Send ERASE response + LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_ERASE); + break; + + case BOOTLOADER_BIN_CHUNK: + memcpy(bootloader_data, input->data, input->header.size); + + // Handle binary data + LuosBootloader_ProcessData(bootloader_data, input->header.size); + + // Send ack to the Host + LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_BIN_CHUNK); + break; + + case BOOTLOADER_BIN_END: + // The binary download is complete + // Save the current page in flash memory even if it's not complete + LuosBootloader_SaveLastData(); + + // Send ack to the Host + LuosBootloader_SendResponse(service, input->header.source, BOOTLOADER_BIN_END); + break; + + case BOOTLOADER_CRC: + crc = compute_crc(); + // Send an ack to the Host + LuosBootloader_SendCrc(service, input->header.source, BOOTLOADER_CRC, crc); + break; + + case BOOTLOADER_APP_SAVED: + // set load flag indicating that there is an app in flash + load_flag = true; + Luos_Unsubscribe(service, input->header.target); + break; + + case BOOTLOADER_STOP: + // wait for the command to be send to all nodes + tickstart = LuosHAL_GetSystick(); + while ((LuosHAL_GetSystick() - tickstart) < 1000) + ; + // save bootloader mode in flash depending if we actually have an app in flash and need to reload it + if (load_flag || (LuosBootloader_GetMode() == APP_RELOAD_MODE)) + { + // boot the application programmed in dedicated flash partition + LuosBootloader_DeInit(); + LuosBootloader_JumpToApp(); + } + else + { + // reboot the node LuosHAL_Reboot(); - break; - default: - break; - } + } + break; + default: + break; } } +#endif diff --git a/engine/bootloader/bootloader_core.h b/engine/bootloader/bootloader_core.h index 5cb68e47c..94ce51579 100644 --- a/engine/bootloader/bootloader_core.h +++ b/engine/bootloader/bootloader_core.h @@ -9,44 +9,6 @@ #include "struct_luos.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -typedef enum -{ - BOOT_MODE, - JUMP_TO_APP_MODE, - APP_RELOAD_MODE, -} bootloader_mode_t; - -#define BOOTLOADER_RCV_COMMAND 0x01 -#define BOOTLOADER_SND_COMMAND 0x10 -#define BOOTLOADER_ERROR_COMMAND 0x20 -typedef enum -{ - BOOTLOADER_IDLE, - BOOTLOADER_START = BOOTLOADER_RCV_COMMAND, - BOOTLOADER_STOP, - BOOTLOADER_READY, - BOOTLOADER_ERASE, - BOOTLOADER_BIN_CHUNK, - BOOTLOADER_BIN_END, - BOOTLOADER_CRC_TEST, - BOOTLOADER_APP_SAVED, - BOOTLOADER_RESET, - BOOTLOADER_READY_RESP = BOOTLOADER_SND_COMMAND, - BOOTLOADER_BIN_HEADER_RESP, - BOOTLOADER_ERASE_RESP, - BOOTLOADER_BIN_CHUNK_RESP, - BOOTLOADER_BIN_END_RESP, - BOOTLOADER_CRC_RESP, - BOOTLOADER_ERROR_SIZE = BOOTLOADER_ERROR_COMMAND, -} bootloader_cmd_t; - -/******************************************************************************* - * Variables - ******************************************************************************/ - /******************************************************************************* * Function ******************************************************************************/ @@ -64,8 +26,5 @@ void LuosBootloader_Loop(void); /****************************************************************************** * @brief function used by Luos to send message to the bootloader ******************************************************************************/ -#ifndef BOOTLOADER -void LuosBootloader_JumpToBootloader(void); -#endif #endif /* BOOTLOADER_H */ diff --git a/engine/core/inc/luos_utils.h b/engine/core/inc/luos_utils.h index 8d83aa377..aab906f2e 100644 --- a/engine/core/inc/luos_utils.h +++ b/engine/core/inc/luos_utils.h @@ -43,5 +43,6 @@ typedef struct __attribute__((__packed__)) void Luos_assert(char *file, uint32_t line); void node_assert(char *file, uint32_t line); +void Luos_JumpToBootloader(void); -#endif /* LUOS_UTILS_H */ \ No newline at end of file +#endif /* LUOS_UTILS_H */ diff --git a/engine/core/inc/struct_luos.h b/engine/core/inc/struct_luos.h index daaa155f7..76a17eb98 100644 --- a/engine/core/inc/struct_luos.h +++ b/engine/core/inc/struct_luos.h @@ -47,14 +47,33 @@ typedef enum LUOS_REVISION, // service sends its luos revision LUOS_STATISTICS, // service sends its luos revision - // bootloader command and response - BOOTLOADER_CMD, - BOOTLOADER_RESP, + // Bootloader specific command + BOOTLOADER_START, + BOOTLOADER_STOP, + BOOTLOADER_RESET, + BOOTLOADER_READY, + BOOTLOADER_ERASE, + BOOTLOADER_BIN_CHUNK, + BOOTLOADER_BIN_END, + BOOTLOADER_CRC, + BOOTLOADER_APP_SAVED, + BOOTLOADER_ERROR_SIZE, // compatibility area // LUOS_LAST_RESERVED_CMD = 42 } reserved_luos_cmd_t; +/****************************************************************************** + * This enum list all bootloader states + * please refer to the documentation + ******************************************************************************/ +typedef enum +{ + BOOT_MODE, + JUMP_TO_APP_MODE, + APP_RELOAD_MODE, +} bootloader_mode_t; + /****************************************************************************** * @enum target_mode_t * @brief This enum list all target mode. diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 00faf4fc4..be1345251 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -7,7 +7,6 @@ #include #include "luos_engine.h" #include "luos_hal.h" -#include "bootloader_core.h" #include "_timestamp.h" #include "filter.h" #include "service.h" @@ -489,22 +488,14 @@ void Luos_Run(void) if (!node_run) { Luos_Init(); -#ifdef BOOTLOADER - LuosBootloader_Init(); -#else Luos_PackageInit(); -#endif // go to run state after initialization node_run = true; } else { Luos_Loop(); -#ifdef BOOTLOADER - LuosBootloader_Loop(); -#else Luos_PackageLoop(); -#endif } } diff --git a/engine/core/src/luos_utils.c b/engine/core/src/luos_utils.c index 5496fdcb2..44bf0ea6c 100644 --- a/engine/core/src/luos_utils.c +++ b/engine/core/src/luos_utils.c @@ -12,9 +12,6 @@ #include "luos_hal.h" #include "msg_alloc.h" #include "filter.h" -#ifdef WITH_BOOTLOADER - #include "bootloader_core.h" -#endif /******************************************************************************* * Function @@ -31,6 +28,23 @@ __attribute__((weak)) void node_assert(char *file, uint32_t line) return; } +/****************************************************************************** + * @brief Jump to bootloader by restarting the MCU + * @param None + * @return None + ******************************************************************************/ +void Luos_JumpToBootloader(void) +{ + // Set bootlaoder mode + LuosHAL_SetMode((uint8_t)APP_RELOAD_MODE); + + // Save the current node id in flash to be ready to be reloaded + LuosHAL_SaveNodeID(Node_Get()->node_id); + + // Reset the MCU + LuosHAL_Reboot(); +} + #ifndef UNIT_TEST /****************************************************************************** * @brief Luos assertion management @@ -65,7 +79,7 @@ _CRITICAL void Luos_assert(char *file, uint32_t line) // Restart this node in bootloader mode instead of don't do anything // We will come back on this app after a reboot. // Set bootloader mode, save node ID and reboot - LuosBootloader_JumpToBootloader(); + Luos_JumpToBootloader(); #endif LuosHAL_SetIrqState(false); while (1) diff --git a/examples/projects/NUCLEO-F401RE/bootloader/src/main.c b/examples/projects/NUCLEO-F401RE/bootloader/src/main.c index 9c2200e74..bf538f5a0 100644 --- a/examples/projects/NUCLEO-F401RE/bootloader/src/main.c +++ b/examples/projects/NUCLEO-F401RE/bootloader/src/main.c @@ -24,6 +24,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" +#include "bootloader_core.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/NUCLEO-F410RB/bootloader/src/main.c b/examples/projects/NUCLEO-F410RB/bootloader/src/main.c index 5f6bfccc3..c488d03b7 100644 --- a/examples/projects/NUCLEO-F410RB/bootloader/src/main.c +++ b/examples/projects/NUCLEO-F410RB/bootloader/src/main.c @@ -24,6 +24,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" +#include "bootloader_core.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/NUCLEO-G431KB/bootloader/src/main.c b/examples/projects/NUCLEO-G431KB/bootloader/src/main.c index 2d6b44374..be1f6e168 100644 --- a/examples/projects/NUCLEO-G431KB/bootloader/src/main.c +++ b/examples/projects/NUCLEO-G431KB/bootloader/src/main.c @@ -24,7 +24,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" - +#include "bootloader_core.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/NUCLEO-G474RE/bootloader/src/main.c b/examples/projects/NUCLEO-G474RE/bootloader/src/main.c index 068a8584c..22b7244f6 100644 --- a/examples/projects/NUCLEO-G474RE/bootloader/src/main.c +++ b/examples/projects/NUCLEO-G474RE/bootloader/src/main.c @@ -24,6 +24,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" +#include "bootloader_core.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c b/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c index 5854b5813..737508aee 100644 --- a/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c +++ b/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c @@ -23,6 +23,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" +#include "bootloader_core.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/NUCLEO-L432KC/bootloader/src/main.c b/examples/projects/NUCLEO-L432KC/bootloader/src/main.c index 0c2c71353..f33430472 100644 --- a/examples/projects/NUCLEO-L432KC/bootloader/src/main.c +++ b/examples/projects/NUCLEO-L432KC/bootloader/src/main.c @@ -24,6 +24,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" +#include "bootloader_core.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c index 9e44fbfa6..f91e2bbb4 100644 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c +++ b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c @@ -29,6 +29,7 @@ #include "luos_engine.h" #include "robus.h" +#include "bootloader_core.h" // ***************************************************************************** // ***************************************************************************** diff --git a/examples/projects/STM32F4-discovery/bootloader/src/main.c b/examples/projects/STM32F4-discovery/bootloader/src/main.c index 746ba4fd0..f94e33851 100644 --- a/examples/projects/STM32F4-discovery/bootloader/src/main.c +++ b/examples/projects/STM32F4-discovery/bootloader/src/main.c @@ -24,6 +24,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" +#include "bootloader_core.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/STM32L4S5_discovery/bootloader/src/main.c b/examples/projects/STM32L4S5_discovery/bootloader/src/main.c index ab2cccd9c..a34a4ecfd 100644 --- a/examples/projects/STM32L4S5_discovery/bootloader/src/main.c +++ b/examples/projects/STM32L4S5_discovery/bootloader/src/main.c @@ -24,6 +24,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" +#include "bootloader_core.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/test/tests_io/test_luos_io/main.c b/test/tests_io/test_luos_io/main.c index 2071aee2e..15664a515 100644 --- a/test/tests_io/test_luos_io/main.c +++ b/test/tests_io/test_luos_io/main.c @@ -889,7 +889,7 @@ void unittest_luosIO_ConsumeMsg() { msg_t msg; luosIO_reset_overlap_callback(); - msg.header.cmd = BOOTLOADER_CMD; + msg.header.cmd = BOOTLOADER_START; msg.header.target_mode = BROADCAST; msg.header.source = 1; msg.header.size = 0; diff --git a/tool_services/gate/TinyJSON/bootloader_ex.c b/tool_services/gate/TinyJSON/bootloader_ex.c index 9a09cbb9e..30f80360c 100644 --- a/tool_services/gate/TinyJSON/bootloader_ex.c +++ b/tool_services/gate/TinyJSON/bootloader_ex.c @@ -41,32 +41,32 @@ uint16_t Bootloader_StartData(char *data) ******************************************************************************/ uint16_t Bootloader_LuosToJson(msg_t *msg, char *data) { - uint8_t response_cmd = msg->data[0]; - uint16_t node_id = RoutingTB_NodeIDFromID(msg->header.source); + uint16_t response_cmd = msg->header.cmd; + uint16_t node_id = RoutingTB_NodeIDFromID(msg->header.source); switch (response_cmd) { - case BOOTLOADER_READY_RESP: - sprintf(data, "{\"response\":%d,\"node\":%d},", BOOTLOADER_READY_RESP, node_id); + case BOOTLOADER_READY: + sprintf(data, "{\"response\":\"ready\",\"node\":%d},", node_id); break; - case BOOTLOADER_ERASE_RESP: - sprintf(data, "{\"response\":%d,\"node\":%d},", BOOTLOADER_ERASE_RESP, node_id); + case BOOTLOADER_ERASE: + sprintf(data, "{\"response\":\"erase\",\"node\":%d},", node_id); break; - case BOOTLOADER_BIN_CHUNK_RESP: - sprintf(data, "{\"response\":%d,\"node\":%d},", BOOTLOADER_BIN_CHUNK_RESP, node_id); + case BOOTLOADER_BIN_CHUNK: + sprintf(data, "{\"response\":\"bin_chunk\",\"node\":%d},", node_id); break; - case BOOTLOADER_BIN_END_RESP: - sprintf(data, "{\"response\":%d,\"node\":%d},", BOOTLOADER_BIN_END_RESP, node_id); + case BOOTLOADER_BIN_END: + sprintf(data, "{\"response\":\"bin_end\",\"node\":%d},", node_id); break; - case BOOTLOADER_CRC_RESP: - sprintf(data, "{\"response\":%d,\"crc_value\":%d,\"node\":%d},", BOOTLOADER_CRC_RESP, msg->data[1], node_id); + case BOOTLOADER_CRC: + sprintf(data, "{\"response\":\"crc\",\"crc_value\":%d,\"node\":%d},", msg->data[0], node_id); break; case BOOTLOADER_ERROR_SIZE: - sprintf(data, "{\"response\":%d,\"node\":%d},", BOOTLOADER_ERROR_SIZE, node_id); + sprintf(data, "{\"response\":\"error_size\",\"node\":%d},", node_id); break; default: @@ -96,130 +96,116 @@ void Bootloader_JsonToLuos(service_t *service, char *bin_data, json_t const *boo { if (json_getType(json_getProperty(bootloader_json, "command")) == JSON_OBJ) { - // get "command" json object + // Get "command" json object json_t const *command_item = json_getProperty(bootloader_json, "command"); - // parse all relevant values in json object - uint16_t type = (uint16_t)json_getReal(json_getProperty(command_item, "type")); + // Parse all relevant values in json object + const char *type = json_getPropertyValue(command_item, "type"); uint8_t topic_target = (uint8_t)json_getReal(json_getProperty(command_item, "topic")); uint16_t node_id = (uint16_t)json_getReal(json_getProperty(command_item, "node")); - // create a message to send to nodes + // Create a message to send to nodes msg_t boot_msg; - + boot_msg.header.size = 0; if (node_id == 0) { boot_msg.header.target = (uint16_t)topic_target; // topic - boot_msg.header.cmd = BOOTLOADER_CMD; // bootloader cmd boot_msg.header.target_mode = TOPIC; // msg send to the node } else { - boot_msg.header.target = node_id; // node_id to send the message - boot_msg.header.cmd = BOOTLOADER_CMD; // bootloader cmd - boot_msg.header.target_mode = NODEIDACK; // msg send to the node + boot_msg.header.target = node_id; // node_id to send the message + boot_msg.header.target_mode = NODEIDACK; // msg send to the node } uint32_t binary_size = 0; json_t *item = NULL; - switch (type) + if (strcmp(type, "start") == 0) { - case BOOTLOADER_START: - boot_msg.header.size = sizeof(char); - boot_msg.data[0] = BOOTLOADER_START; - Luos_SendMsg(service, &boot_msg); - break; - - case BOOTLOADER_STOP: - // send stop command to bootloader app - boot_msg.header.size = sizeof(char); - boot_msg.data[0] = BOOTLOADER_STOP; - Luos_SendMsg(service, &boot_msg); - break; - - case BOOTLOADER_READY: - // find binary size in json header - binary_size = (uint32_t)json_getReal(json_getProperty(command_item, "size")); - - // send ready command to bootloader app - boot_msg.header.size = 2 * sizeof(char) + sizeof(uint32_t); - boot_msg.data[0] = BOOTLOADER_READY; - boot_msg.data[1] = topic_target; - memcpy(&(boot_msg.data[2]), &binary_size, sizeof(uint32_t)); - Luos_SendMsg(service, &boot_msg); - break; - - case BOOTLOADER_ERASE: - // send erase command to bootloader app - boot_msg.header.size = sizeof(char); - boot_msg.data[0] = BOOTLOADER_ERASE; - Luos_SendMsg(service, &boot_msg); - break; - - case BOOTLOADER_BIN_CHUNK: - // find binary size in json header - item = (json_t *)json_getProperty(command_item, "size"); - if (json_getType(item) == JSON_ARRAY) - { - binary_size = (uint32_t)json_getInteger(json_getChild(item)); - } - else - { - binary_size = (uint32_t)json_getReal(item); - } - - // send bin chunk command to bootloader app - boot_msg.data[0] = BOOTLOADER_BIN_CHUNK; - int i = 0; - // find the first \r of the current buf - for (i = 0; i < GATE_BUFF_SIZE; i++) - { - if (bin_data[i] == '\n') - { - i++; - break; - } - } - if (i < GATE_BUFF_SIZE - 1) + boot_msg.header.cmd = BOOTLOADER_START; + Luos_SendMsg(service, &boot_msg); + } + else if (strcmp(type, "stop") == 0) + { + // Send stop command to bootloader app + boot_msg.header.cmd = BOOTLOADER_STOP; + Luos_SendMsg(service, &boot_msg); + } + else if (strcmp(type, "ready") == 0) + { + // Find binary size in json header + binary_size = (uint32_t)json_getReal(json_getProperty(command_item, "size")); + + // Send ready command to bootloader app + boot_msg.header.size = sizeof(char) + sizeof(uint32_t); + boot_msg.header.cmd = BOOTLOADER_READY; + boot_msg.data[0] = topic_target; + memcpy(&(boot_msg.data[1]), &binary_size, sizeof(uint32_t)); + Luos_SendMsg(service, &boot_msg); + } + else if (strcmp(type, "erase") == 0) + { + // Send erase command to bootloader app + boot_msg.header.cmd = BOOTLOADER_ERASE; + Luos_SendMsg(service, &boot_msg); + } + else if (strcmp(type, "bin_chunk") == 0) + { + // Find binary size in json header + item = (json_t *)json_getProperty(command_item, "size"); + if (json_getType(item) == JSON_ARRAY) + { + binary_size = (uint32_t)json_getInteger(json_getChild(item)); + } + else + { + binary_size = (uint32_t)json_getReal(item); + } + + // Send bin chunk command to bootloader app + boot_msg.header.cmd = BOOTLOADER_BIN_CHUNK; + int i = 0; + // Find the first \r of the current buf + for (i = 0; i < GATE_BUFF_SIZE; i++) + { + if (bin_data[i] == '\n') { - boot_msg.header.size = binary_size + sizeof(char); - memcpy(&(boot_msg.data[1]), &bin_data[i], binary_size); - Luos_SendMsg(service, &boot_msg); + i++; + break; } - break; - - case BOOTLOADER_BIN_END: - // send bin end command to bootloader app - boot_msg.header.size = sizeof(char); - boot_msg.data[0] = BOOTLOADER_BIN_END; - Luos_SendMsg(service, &boot_msg); - break; - - case BOOTLOADER_CRC_TEST: - // send crc test command to bootloader app - boot_msg.header.size = sizeof(char); - boot_msg.data[0] = BOOTLOADER_CRC_TEST; - Luos_SendMsg(service, &boot_msg); - break; - - case BOOTLOADER_APP_SAVED: - // send app saved command to bootloader app - boot_msg.header.size = sizeof(char); - boot_msg.data[0] = BOOTLOADER_APP_SAVED; - Luos_SendMsg(service, &boot_msg); - break; - - case BOOTLOADER_RESET: - // send rescue command to nodes - boot_msg.header.target = BROADCAST_VAL; - boot_msg.header.target_mode = BROADCAST; - boot_msg.header.cmd = BOOTLOADER_CMD; // bootloader cmd - boot_msg.header.size = sizeof(char); - boot_msg.data[0] = BOOTLOADER_RESET; + } + if (i < GATE_BUFF_SIZE - 1) + { + boot_msg.header.size = binary_size; + memcpy(boot_msg.data, &bin_data[i], binary_size); Luos_SendMsg(service, &boot_msg); - break; - - default: - break; + } + } + else if (strcmp(type, "bin_end") == 0) + { + // Send bin end command to bootloader app + boot_msg.header.cmd = BOOTLOADER_BIN_END; + Luos_SendMsg(service, &boot_msg); + } + else if (strcmp(type, "crc") == 0) + { + // Send crc test command to bootloader app + boot_msg.header.cmd = BOOTLOADER_CRC; + Luos_SendMsg(service, &boot_msg); + } + else if (strcmp(type, "app_saved") == 0) + { + // send app saved command to bootloader app + boot_msg.header.cmd = BOOTLOADER_APP_SAVED; + Luos_SendMsg(service, &boot_msg); + } + else if (strcmp(type, "reset") == 0) + { + // send rescue command to nodes + boot_msg.header.target = BROADCAST_VAL; + boot_msg.header.target_mode = BROADCAST; + boot_msg.header.cmd = BOOTLOADER_RESET; // bootloader cmd + boot_msg.header.size = 0; + Luos_SendMsg(service, &boot_msg); } } -} \ No newline at end of file +} diff --git a/tool_services/gate/data_manager.c b/tool_services/gate/data_manager.c index b25220a33..670578a9e 100644 --- a/tool_services/gate/data_manager.c +++ b/tool_services/gate/data_manager.c @@ -150,7 +150,7 @@ void DataManager_Format(service_t *service) continue; } // check if a node send a bootloader message - if (data_msg.header.cmd == BOOTLOADER_RESP) + if (data_msg.header.cmd >= BOOTLOADER_START && data_msg.header.cmd <= BOOTLOADER_ERROR_SIZE) { do { From dbf29d954e89c3744cecfc4951aebac129dff840 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 26 Jun 2023 17:11:14 +0200 Subject: [PATCH 094/150] Rename `bootloader_core` into `luos_bootloader` --- engine/bootloader/{bootloader_core.c => luos_bootloader.c} | 2 +- engine/bootloader/{bootloader_core.h => luos_bootloader.h} | 0 examples/projects/NUCLEO-F072RB/bootloader/src/main.c | 2 +- examples/projects/NUCLEO-F401RE/bootloader/src/main.c | 2 +- examples/projects/NUCLEO-F410RB/bootloader/src/main.c | 2 +- examples/projects/NUCLEO-G431KB/bootloader/src/main.c | 2 +- examples/projects/NUCLEO-G474RE/bootloader/src/main.c | 2 +- examples/projects/NUCLEO-L073RZ/bootloader/src/main.c | 2 +- examples/projects/NUCLEO-L432KC/bootloader/src/main.c | 2 +- examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c | 2 +- examples/projects/STM32F4-discovery/bootloader/src/main.c | 2 +- examples/projects/STM32L4S5_discovery/bootloader/src/main.c | 2 +- examples/projects/l0/bootloader/src/main.c | 2 +- tool_services/gate/TinyJSON/bootloader_ex.c | 2 +- 14 files changed, 13 insertions(+), 13 deletions(-) rename engine/bootloader/{bootloader_core.c => luos_bootloader.c} (99%) rename engine/bootloader/{bootloader_core.h => luos_bootloader.h} (100%) diff --git a/engine/bootloader/bootloader_core.c b/engine/bootloader/luos_bootloader.c similarity index 99% rename from engine/bootloader/bootloader_core.c rename to engine/bootloader/luos_bootloader.c index d61819236..73dc4c69a 100644 --- a/engine/bootloader/bootloader_core.c +++ b/engine/bootloader/luos_bootloader.c @@ -8,7 +8,7 @@ #include #include -#include "bootloader_core.h" +#include "luos_bootloader.h" #include "luos_hal.h" #include "luos_engine.h" #include "routing_table.h" diff --git a/engine/bootloader/bootloader_core.h b/engine/bootloader/luos_bootloader.h similarity index 100% rename from engine/bootloader/bootloader_core.h rename to engine/bootloader/luos_bootloader.h diff --git a/examples/projects/NUCLEO-F072RB/bootloader/src/main.c b/examples/projects/NUCLEO-F072RB/bootloader/src/main.c index 99af476e5..e28b42e18 100644 --- a/examples/projects/NUCLEO-F072RB/bootloader/src/main.c +++ b/examples/projects/NUCLEO-F072RB/bootloader/src/main.c @@ -25,7 +25,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" -#include "bootloader_core.h" +#include "luos_bootloader.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/NUCLEO-F401RE/bootloader/src/main.c b/examples/projects/NUCLEO-F401RE/bootloader/src/main.c index bf538f5a0..372e76128 100644 --- a/examples/projects/NUCLEO-F401RE/bootloader/src/main.c +++ b/examples/projects/NUCLEO-F401RE/bootloader/src/main.c @@ -24,7 +24,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" -#include "bootloader_core.h" +#include "luos_bootloader.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/NUCLEO-F410RB/bootloader/src/main.c b/examples/projects/NUCLEO-F410RB/bootloader/src/main.c index c488d03b7..1749fecb5 100644 --- a/examples/projects/NUCLEO-F410RB/bootloader/src/main.c +++ b/examples/projects/NUCLEO-F410RB/bootloader/src/main.c @@ -24,7 +24,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" -#include "bootloader_core.h" +#include "luos_bootloader.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/NUCLEO-G431KB/bootloader/src/main.c b/examples/projects/NUCLEO-G431KB/bootloader/src/main.c index be1f6e168..c3d7bcba1 100644 --- a/examples/projects/NUCLEO-G431KB/bootloader/src/main.c +++ b/examples/projects/NUCLEO-G431KB/bootloader/src/main.c @@ -24,7 +24,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" -#include "bootloader_core.h" +#include "luos_bootloader.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/NUCLEO-G474RE/bootloader/src/main.c b/examples/projects/NUCLEO-G474RE/bootloader/src/main.c index 22b7244f6..715c3bf7b 100644 --- a/examples/projects/NUCLEO-G474RE/bootloader/src/main.c +++ b/examples/projects/NUCLEO-G474RE/bootloader/src/main.c @@ -24,7 +24,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" -#include "bootloader_core.h" +#include "luos_bootloader.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c b/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c index 737508aee..7eaa0d61a 100644 --- a/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c +++ b/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c @@ -23,7 +23,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" -#include "bootloader_core.h" +#include "luos_bootloader.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/NUCLEO-L432KC/bootloader/src/main.c b/examples/projects/NUCLEO-L432KC/bootloader/src/main.c index f33430472..4c6f10682 100644 --- a/examples/projects/NUCLEO-L432KC/bootloader/src/main.c +++ b/examples/projects/NUCLEO-L432KC/bootloader/src/main.c @@ -24,7 +24,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" -#include "bootloader_core.h" +#include "luos_bootloader.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c index f91e2bbb4..b92775db2 100644 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c +++ b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c @@ -29,7 +29,7 @@ #include "luos_engine.h" #include "robus.h" -#include "bootloader_core.h" +#include "luos_bootloader.h" // ***************************************************************************** // ***************************************************************************** diff --git a/examples/projects/STM32F4-discovery/bootloader/src/main.c b/examples/projects/STM32F4-discovery/bootloader/src/main.c index f94e33851..0d7e560f4 100644 --- a/examples/projects/STM32F4-discovery/bootloader/src/main.c +++ b/examples/projects/STM32F4-discovery/bootloader/src/main.c @@ -24,7 +24,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" -#include "bootloader_core.h" +#include "luos_bootloader.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/STM32L4S5_discovery/bootloader/src/main.c b/examples/projects/STM32L4S5_discovery/bootloader/src/main.c index a34a4ecfd..b44fbf951 100644 --- a/examples/projects/STM32L4S5_discovery/bootloader/src/main.c +++ b/examples/projects/STM32L4S5_discovery/bootloader/src/main.c @@ -24,7 +24,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" -#include "bootloader_core.h" +#include "luos_bootloader.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/examples/projects/l0/bootloader/src/main.c b/examples/projects/l0/bootloader/src/main.c index a987a8b4d..fde761701 100644 --- a/examples/projects/l0/bootloader/src/main.c +++ b/examples/projects/l0/bootloader/src/main.c @@ -25,7 +25,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "robus.h" -#include "bootloader_core.h" +#include "luos_bootloader.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/tool_services/gate/TinyJSON/bootloader_ex.c b/tool_services/gate/TinyJSON/bootloader_ex.c index 30f80360c..ce7b462e4 100644 --- a/tool_services/gate/TinyJSON/bootloader_ex.c +++ b/tool_services/gate/TinyJSON/bootloader_ex.c @@ -7,7 +7,7 @@ #include #include #include "bootloader_ex.h" -#include "bootloader_core.h" +#include "luos_bootloader.h" #include "gate_config.h" #include "pipe_link.h" #include "routing_table.h" From baaa76a07f2c0c2ad11e0fa09ccab23154d697a5 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 4 Jul 2023 14:45:31 +0200 Subject: [PATCH 095/150] Fix some typo --- engine/IO/inc/luos_phy.h | 1 - engine/IO/src/filter.c | 10 +++++----- engine/IO/src/luos_io.c | 3 +-- engine/IO/src/luos_phy.c | 18 ++++-------------- engine/OD/od_control.h | 1 - engine/OD/od_pid.h | 1 - engine/engine_config.h | 1 - network/robus/src/robus.c | 2 +- test/tests_io/test_phy/main.c | 31 ------------------------------- 9 files changed, 11 insertions(+), 57 deletions(-) diff --git a/engine/IO/inc/luos_phy.h b/engine/IO/inc/luos_phy.h index 20d722d57..2044cbfd3 100644 --- a/engine/IO/inc/luos_phy.h +++ b/engine/IO/inc/luos_phy.h @@ -42,6 +42,5 @@ void Phy_DeadTargetSpotted(luos_phy_t *phy_ptr, phy_job_t *job); // If some mess phy_job_t *Phy_GetJob(luos_phy_t *phy_ptr); // Use it to get the first job to send. phy_job_t *Phy_GetNextJob(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to get the next job to send. void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to remove a job from your phy job list when it's done. -volatile uint16_t Phy_GetJobNbr(luos_phy_t *phy_ptr); // Use it to get the number of job you currently have to send on your phy_ptr.job list. #endif /* _LUOS_PHY_H_ */ diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c index 5b633e847..50bafcbee 100644 --- a/engine/IO/src/filter.c +++ b/engine/IO/src/filter.c @@ -203,17 +203,17 @@ _CRITICAL uint8_t Filter_GetPhyTarget(header_t *header) if (Filter_Type(header->target)) { - // This concerns Luos phy and Robus + // This concerns Luos phy and external phy return 0x01 | (0x01 << 1); } break; case BROADCAST: - // This concerns Luos phy and Robus + // This concerns Luos phy and external phy return 0x01 | (0x01 << 1); break; case NODEIDACK: case NODEID: - // If the target is our node and our node ave a node_id or if we don't have a node_id and we are waiting for one. + // If the target is our node and our node have a node_id or if we don't have a node_id and we are waiting for one. if (((header->target == Node_Get()->node_id) && (header->target != 0)) || ((header->target == 0) && (Node_WaitId() == true))) { @@ -224,7 +224,7 @@ _CRITICAL uint8_t Filter_GetPhyTarget(header_t *header) case TOPIC: if (Filter_Topic(header->target)) { - // This concerns Luos phy and Robus + // This concerns Luos phy and external phy return 0x01 | (0x01 << 1); } break; @@ -234,6 +234,6 @@ _CRITICAL uint8_t Filter_GetPhyTarget(header_t *header) return 0x00; break; } - // This concerns Robus only by default + // This concerns external phy only by default return 0x01 << 1; } diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 0a08aee8a..bfba20652 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -13,7 +13,6 @@ #include "luos_utils.h" #include "luos_hal.h" #include "luos_engine.h" -#include "robus.h" #include "_luos_phy.h" #include "stats.h" @@ -582,7 +581,7 @@ static error_return_t LuosIO_DetectNextNodes(service_t *service) // Wait the end of transmission while (Phy_TxAllComplete() == FAILED) ; - // When Robus loop will receive the reply it will store and manage the new node_id and send it to the next node. + // When phy loop will receive the reply it will store and manage the new node_id and send it to the next node. // We just have to wait the end of the treatment of the entire branch uint32_t start_tick = LuosHAL_GetSystick(); while (Phy_Busy()) diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 68394ab36..6d6043a95 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -79,7 +79,7 @@ typedef struct bool topology_running; // We put bits to 1 when a phy is running the topology detection. bool find_next_node_job; - // ******************** job management ******************** + // ******************** Job management ******************** // io_jobs are stores from the newest to the oldest. // This will add time in IRQ when we will pull a job but allow to keep pointers constant. IO_job_t io_job[MAX_MSG_NB]; // Table of all the io_jobs to dispatch. @@ -173,7 +173,7 @@ bool Phy_Busy(void) void Phy_Loop(void) { // Manage received data allocation - // This is only needed for Robus for now. + // This is only needed for external phy for now. if (phy_ctx.phy[1].rx_alloc_job) { Phy_alloc(&phy_ctx.phy[1]); @@ -795,17 +795,6 @@ _CRITICAL void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job) } } -/****************************************************************************** - * @brief Get the number of job in the phy queue - * @param phy_ptr Phy to get the number of job from - * @return Number of job - ******************************************************************************/ -_CRITICAL inline volatile uint16_t Phy_GetJobNbr(luos_phy_t *phy_ptr) -{ - LUOS_ASSERT(phy_ptr != NULL); - return phy_ptr->job_nb; -} - /****************************************************************************** * @brief define is there is something waiting to be sent or not * @return Succeed if nothing is waiting to be sent @@ -815,7 +804,8 @@ error_return_t Phy_TxAllComplete(void) // We don't check the first phy because it is Luos for (int i = 1; i < phy_ctx.phy_nb; i++) { - if (Phy_GetJobNbr(&phy_ctx.phy[i]) != 0) + LUOS_ASSERT(&phy_ctx.phy[i] != NULL); + if (phy_ctx.phy[i].job_nb != 0) { return FAILED; } diff --git a/engine/OD/od_control.h b/engine/OD/od_control.h index b998eca51..af74ad13d 100644 --- a/engine/OD/od_control.h +++ b/engine/OD/od_control.h @@ -8,7 +8,6 @@ #define OD_OD_CONTROL_H_ #include "luos_engine.h" -#include "robus.h" #include /******************************************************************************* diff --git a/engine/OD/od_pid.h b/engine/OD/od_pid.h index 9b747e419..dff3709b4 100644 --- a/engine/OD/od_pid.h +++ b/engine/OD/od_pid.h @@ -8,7 +8,6 @@ #define OD_OD_PID_H_ #include "luos_engine.h" -#include "robus.h" #include /******************************************************************************* diff --git a/engine/engine_config.h b/engine/engine_config.h index 6be6fa98f..2c0b791cb 100644 --- a/engine/engine_config.h +++ b/engine/engine_config.h @@ -11,7 +11,6 @@ * Definitions ******************************************************************************/ #define LUOS_LAST_RESERVED_CMD 42 // Last Luos reserved command -#define ROBUS_PROTOCOL_NB 13 // Number of Robus protocol command #define ALIAS_SIZE 15 // Number of max char for service alias #define MAX_ALIAS_SIZE 16 #define DETECTION_TIMEOUT_MS 10000 // Timeout used to detect a failed detection diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index d2ea97e96..c897a99dc 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -99,7 +99,7 @@ void Robus_JobHandler(luos_phy_t *phy_ptr, phy_job_t *job) } /****************************************************************************** - * @brief Reset the node id of the port table + * @brief Reset Robus * @param phy_ptr not used * @return None. ******************************************************************************/ diff --git a/test/tests_io/test_phy/main.c b/test/tests_io/test_phy/main.c index dc42cddac..ed1ce02dc 100644 --- a/test/tests_io/test_phy/main.c +++ b/test/tests_io/test_phy/main.c @@ -1545,36 +1545,6 @@ void unittest_add_and_remove_jobs(void) } } -void unittest_phy_GetJobNbr() -{ - NEW_TEST_CASE("Check GetJobNbr assertion conditions"); - { - TRY - { - uint16_t value = Phy_GetJobNbr(NULL); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Check GetPhyId normal conditions"); - { - TRY - { - for (int i = 0; i < MAX_MSG_NB; i++) - { - luos_phy->job_nb = i; - uint16_t value = Phy_GetJobNbr(luos_phy); - TEST_ASSERT_EQUAL(i, value); - } - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } -} - void unittest_phy_TxAllComplete() { NEW_TEST_CASE("Check TxAllComplete normal conditions"); @@ -1645,7 +1615,6 @@ int main(int argc, char **argv) UNIT_TEST_RUN(unittest_phy_GetPhyId); UNIT_TEST_RUN(unittest_phy_RmJob); UNIT_TEST_RUN(unittest_add_and_remove_jobs); - UNIT_TEST_RUN(unittest_phy_GetJobNbr); UNIT_TEST_RUN(unittest_phy_TxAllComplete); UNITY_END(); From 5f7044a02fa63396e3b0078a01817013bc3355a9 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 4 Jul 2023 14:55:54 +0200 Subject: [PATCH 096/150] Change IRQ management allowing phy to reference specific IRQ management functions. Luos being a phy, it also reference LuosHAL_SetIrqState functions. ESPHAL can also reference a hardware specific function allowing to deal with hardware specificities. --- engine/HAL/ATSAMD21/luos_hal.c | 2 +- engine/HAL/ATSAMD21/luos_hal.h | 2 +- engine/HAL/ATSAMD21_ARDUINO/luos_hal.c | 4 +- engine/HAL/ATSAMD21_ARDUINO/luos_hal.h | 2 +- engine/HAL/ATSAMD21_MBED/luos_hal.c | 4 +- engine/HAL/ATSAMD21_MBED/luos_hal.h | 2 +- engine/HAL/ESP32/luos_hal.c | 6 +- engine/HAL/ESP32/luos_hal.h | 2 +- engine/HAL/NATIVE/luos_hal.c | 2 +- engine/HAL/NATIVE/luos_hal.h | 2 +- engine/HAL/STM32F0/luos_hal.c | 2 +- engine/HAL/STM32F0/luos_hal.h | 2 +- engine/HAL/STM32F4/luos_hal.c | 2 +- engine/HAL/STM32F4/luos_hal.h | 2 +- engine/HAL/STM32G4/luos_hal.c | 2 +- engine/HAL/STM32G4/luos_hal.h | 2 +- engine/HAL/STM32L0/luos_hal.c | 2 +- engine/HAL/STM32L0/luos_hal.h | 2 +- engine/HAL/STM32L4/luos_hal.c | 2 +- engine/HAL/STM32L4/luos_hal.h | 2 +- engine/HAL/STUB/luos_hal.c | 2 +- engine/HAL/STUB/luos_hal.h | 2 +- engine/HAL/template/luos_hal.c | 2 +- engine/HAL/template/luos_hal.h | 2 +- engine/IO/inc/luos_phy.h | 5 ++ engine/IO/src/luos_io.c | 2 + engine/IO/src/luos_phy.c | 78 +++++++++++++++---- engine/IO/src/msg_alloc.c | 18 ++--- engine/core/inc/luos_engine.h | 1 + engine/core/src/luos_engine.c | 11 +++ engine/core/src/luos_utils.c | 5 +- .../servo_motor/profile_servo_motor.c | 13 ++-- .../lib/Controller_motor/controller_motor.c | 9 +-- network/robus/HAL/ESP32/robus_hal.c | 6 +- network/robus/HAL/ESP32/robus_hal.h | 2 +- network/robus/src/robus.c | 4 +- network/robus/src/transmission.c | 4 +- 37 files changed, 141 insertions(+), 73 deletions(-) diff --git a/engine/HAL/ATSAMD21/luos_hal.c b/engine/HAL/ATSAMD21/luos_hal.c index 361fc5e02..911c69100 100644 --- a/engine/HAL/ATSAMD21/luos_hal.c +++ b/engine/HAL/ATSAMD21/luos_hal.c @@ -53,7 +53,7 @@ void LuosHAL_Init(void) * @param Enable : Set to "True" to enable IRQ, "False" otherwise * @return None ******************************************************************************/ -_CRITICAL void LuosHAL_SetIrqState(uint8_t Enable) +_CRITICAL void LuosHAL_SetIrqState(bool Enable) { if (Enable == true) { diff --git a/engine/HAL/ATSAMD21/luos_hal.h b/engine/HAL/ATSAMD21/luos_hal.h index b2d4351ef..8f52c55e2 100644 --- a/engine/HAL/ATSAMD21/luos_hal.h +++ b/engine/HAL/ATSAMD21/luos_hal.h @@ -39,7 +39,7 @@ typedef struct ll_timestamp * Function ******************************************************************************/ void LuosHAL_Init(void); -void LuosHAL_SetIrqState(uint8_t Enable); +void LuosHAL_SetIrqState(bool Enable); uint32_t LuosHAL_GetSystick(void); // bootloader functions diff --git a/engine/HAL/ATSAMD21_ARDUINO/luos_hal.c b/engine/HAL/ATSAMD21_ARDUINO/luos_hal.c index 0fe4792e6..025d4dcd5 100644 --- a/engine/HAL/ATSAMD21_ARDUINO/luos_hal.c +++ b/engine/HAL/ATSAMD21_ARDUINO/luos_hal.c @@ -53,7 +53,7 @@ void LuosHAL_Init(void) * @param Enable : Set to "True" to enable IRQ, "False" otherwise * @return None ******************************************************************************/ -_CRITICAL void LuosHAL_SetIrqState(uint8_t Enable) +_CRITICAL void LuosHAL_SetIrqState(bool Enable) { if (Enable == true) { @@ -208,4 +208,4 @@ void LuosHAL_JumpToApp(uint32_t app_addr) uint8_t LuosHAL_GetMode(void) { } -#endif \ No newline at end of file +#endif diff --git a/engine/HAL/ATSAMD21_ARDUINO/luos_hal.h b/engine/HAL/ATSAMD21_ARDUINO/luos_hal.h index 9d20ec67a..633f3ca82 100644 --- a/engine/HAL/ATSAMD21_ARDUINO/luos_hal.h +++ b/engine/HAL/ATSAMD21_ARDUINO/luos_hal.h @@ -39,7 +39,7 @@ typedef struct ll_timestamp * Function ******************************************************************************/ void LuosHAL_Init(void); -void LuosHAL_SetIrqState(uint8_t Enable); +void LuosHAL_SetIrqState(bool Enable); uint32_t LuosHAL_GetSystick(void); // bootloader functions diff --git a/engine/HAL/ATSAMD21_MBED/luos_hal.c b/engine/HAL/ATSAMD21_MBED/luos_hal.c index c294fdaf1..a4848cd05 100644 --- a/engine/HAL/ATSAMD21_MBED/luos_hal.c +++ b/engine/HAL/ATSAMD21_MBED/luos_hal.c @@ -50,7 +50,7 @@ void LuosHAL_Init(void) * @param Enable : Set to "True" to enable IRQ, "False" otherwise * @return None ******************************************************************************/ -_CRITICAL void LuosHAL_SetIrqState(uint8_t Enable) +_CRITICAL void LuosHAL_SetIrqState(bool Enable) { if (Enable == true) { @@ -273,4 +273,4 @@ void LuosHAL_JumpToApp(uint32_t app_addr) uint8_t LuosHAL_GetMode(void) { } -#endif \ No newline at end of file +#endif diff --git a/engine/HAL/ATSAMD21_MBED/luos_hal.h b/engine/HAL/ATSAMD21_MBED/luos_hal.h index 7a5af2028..1339001c5 100644 --- a/engine/HAL/ATSAMD21_MBED/luos_hal.h +++ b/engine/HAL/ATSAMD21_MBED/luos_hal.h @@ -40,7 +40,7 @@ typedef struct ll_timestamp * Function ******************************************************************************/ void LuosHAL_Init(void); -void LuosHAL_SetIrqState(uint8_t Enable); +void LuosHAL_SetIrqState(bool Enable); uint32_t LuosHAL_GetSystick(void); void LuosHAL_FlashWriteLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data); void LuosHAL_FlashReadLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data); diff --git a/engine/HAL/ESP32/luos_hal.c b/engine/HAL/ESP32/luos_hal.c index a16ef61d5..6cbf903b5 100644 --- a/engine/HAL/ESP32/luos_hal.c +++ b/engine/HAL/ESP32/luos_hal.c @@ -6,7 +6,6 @@ * @version 0.0.0 ******************************************************************************/ #include "luos_hal.h" -#include "robus_hal.h" #include #include @@ -63,9 +62,10 @@ void LuosHAL_Init(void) * @param Enable : Set to "True" to enable IRQ, "False" otherwise * @return None ******************************************************************************/ -_CRITICAL void LuosHAL_SetIrqState(uint8_t Enable) +_CRITICAL void LuosHAL_SetIrqState(bool Enable) { - RobusHAL_SetIrqState(Enable); + // We don't do anything here because we don't have any IRQ to disable on ESP + // Network will disable appropriate IRQ. } /****************************************************************************** * @brief Luos HAL general systick tick at 1ms initialize diff --git a/engine/HAL/ESP32/luos_hal.h b/engine/HAL/ESP32/luos_hal.h index 248fa3a5c..4879fa6d5 100644 --- a/engine/HAL/ESP32/luos_hal.h +++ b/engine/HAL/ESP32/luos_hal.h @@ -39,7 +39,7 @@ typedef struct ll_timestamp * Function ******************************************************************************/ void LuosHAL_Init(void); -void LuosHAL_SetIrqState(uint8_t Enable); +void LuosHAL_SetIrqState(bool Enable); uint32_t LuosHAL_GetSystick(void); void LuosHAL_FlashWriteLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data); void LuosHAL_FlashReadLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data); diff --git a/engine/HAL/NATIVE/luos_hal.c b/engine/HAL/NATIVE/luos_hal.c index b0b1b22a5..d4e4f3815 100644 --- a/engine/HAL/NATIVE/luos_hal.c +++ b/engine/HAL/NATIVE/luos_hal.c @@ -49,7 +49,7 @@ void LuosHAL_Init(void) * @param None * @return None ******************************************************************************/ -void LuosHAL_SetIrqState(uint8_t Enable) +void LuosHAL_SetIrqState(bool Enable) { } diff --git a/engine/HAL/NATIVE/luos_hal.h b/engine/HAL/NATIVE/luos_hal.h index e6529c5f5..7b9197938 100644 --- a/engine/HAL/NATIVE/luos_hal.h +++ b/engine/HAL/NATIVE/luos_hal.h @@ -31,7 +31,7 @@ * Function ******************************************************************************/ void LuosHAL_Init(void); -void LuosHAL_SetIrqState(uint8_t Enable); +void LuosHAL_SetIrqState(bool Enable); uint32_t LuosHAL_GetSystick(void); void LuosHAL_FlashWriteLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data); void LuosHAL_FlashReadLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data); diff --git a/engine/HAL/STM32F0/luos_hal.c b/engine/HAL/STM32F0/luos_hal.c index 38a5f4bdd..e17e14c16 100644 --- a/engine/HAL/STM32F0/luos_hal.c +++ b/engine/HAL/STM32F0/luos_hal.c @@ -53,7 +53,7 @@ void LuosHAL_Init(void) * @param Enable : Set to "True" to enable IRQ, "False" otherwise * @return None ******************************************************************************/ -_CRITICAL void LuosHAL_SetIrqState(uint8_t Enable) +_CRITICAL void LuosHAL_SetIrqState(bool Enable) { if (Enable == true) { diff --git a/engine/HAL/STM32F0/luos_hal.h b/engine/HAL/STM32F0/luos_hal.h index 71eddf65e..ed025b244 100644 --- a/engine/HAL/STM32F0/luos_hal.h +++ b/engine/HAL/STM32F0/luos_hal.h @@ -38,7 +38,7 @@ typedef struct ll_timestamp * Function ******************************************************************************/ void LuosHAL_Init(void); -void LuosHAL_SetIrqState(uint8_t Enable); +void LuosHAL_SetIrqState(bool Enable); uint32_t LuosHAL_GetSystick(void); // bootloader functions diff --git a/engine/HAL/STM32F4/luos_hal.c b/engine/HAL/STM32F4/luos_hal.c index 41ce61169..b9663aa79 100644 --- a/engine/HAL/STM32F4/luos_hal.c +++ b/engine/HAL/STM32F4/luos_hal.c @@ -54,7 +54,7 @@ void LuosHAL_Init(void) * @param Enable : Set to "True" to enable IRQ, "False" otherwise * @return None ******************************************************************************/ -_CRITICAL void LuosHAL_SetIrqState(uint8_t Enable) +_CRITICAL void LuosHAL_SetIrqState(bool Enable) { if (Enable == true) { diff --git a/engine/HAL/STM32F4/luos_hal.h b/engine/HAL/STM32F4/luos_hal.h index 4f0d99f0c..7620be074 100644 --- a/engine/HAL/STM32F4/luos_hal.h +++ b/engine/HAL/STM32F4/luos_hal.h @@ -37,7 +37,7 @@ typedef struct ll_timestamp * Function ******************************************************************************/ void LuosHAL_Init(void); -void LuosHAL_SetIrqState(uint8_t Enable); +void LuosHAL_SetIrqState(bool Enable); uint32_t LuosHAL_GetSystick(void); // bootloader functions diff --git a/engine/HAL/STM32G4/luos_hal.c b/engine/HAL/STM32G4/luos_hal.c index 866a3483c..aee4a330b 100644 --- a/engine/HAL/STM32G4/luos_hal.c +++ b/engine/HAL/STM32G4/luos_hal.c @@ -51,7 +51,7 @@ void LuosHAL_Init(void) * @param Enable : Set to "True" to enable IRQ, "False" otherwise * @return None ******************************************************************************/ -_CRITICAL void LuosHAL_SetIrqState(uint8_t Enable) +_CRITICAL void LuosHAL_SetIrqState(bool Enable) { if (Enable == true) { diff --git a/engine/HAL/STM32G4/luos_hal.h b/engine/HAL/STM32G4/luos_hal.h index e5299e624..c4ca99bbf 100644 --- a/engine/HAL/STM32G4/luos_hal.h +++ b/engine/HAL/STM32G4/luos_hal.h @@ -41,7 +41,7 @@ typedef struct ll_timestamp * Function ******************************************************************************/ void LuosHAL_Init(void); -void LuosHAL_SetIrqState(uint8_t Enable); +void LuosHAL_SetIrqState(bool Enable); uint32_t LuosHAL_GetSystick(void); // bootloader functions diff --git a/engine/HAL/STM32L0/luos_hal.c b/engine/HAL/STM32L0/luos_hal.c index d655faf69..bf3de181d 100644 --- a/engine/HAL/STM32L0/luos_hal.c +++ b/engine/HAL/STM32L0/luos_hal.c @@ -53,7 +53,7 @@ void LuosHAL_Init(void) * @param Enable : Set to "True" to enable IRQ, "False" otherwise * @return None ******************************************************************************/ -void LuosHAL_SetIrqState(uint8_t Enable) +void LuosHAL_SetIrqState(bool Enable) { if (Enable == true) { diff --git a/engine/HAL/STM32L0/luos_hal.h b/engine/HAL/STM32L0/luos_hal.h index 71eddf65e..ed025b244 100644 --- a/engine/HAL/STM32L0/luos_hal.h +++ b/engine/HAL/STM32L0/luos_hal.h @@ -38,7 +38,7 @@ typedef struct ll_timestamp * Function ******************************************************************************/ void LuosHAL_Init(void); -void LuosHAL_SetIrqState(uint8_t Enable); +void LuosHAL_SetIrqState(bool Enable); uint32_t LuosHAL_GetSystick(void); // bootloader functions diff --git a/engine/HAL/STM32L4/luos_hal.c b/engine/HAL/STM32L4/luos_hal.c index e7af5b7ab..64bf46e69 100644 --- a/engine/HAL/STM32L4/luos_hal.c +++ b/engine/HAL/STM32L4/luos_hal.c @@ -51,7 +51,7 @@ void LuosHAL_Init(void) * @param Enable : Set to "True" to enable IRQ, "False" otherwise * @return None ******************************************************************************/ -_CRITICAL void LuosHAL_SetIrqState(uint8_t Enable) +_CRITICAL void LuosHAL_SetIrqState(bool Enable) { if (Enable == true) { diff --git a/engine/HAL/STM32L4/luos_hal.h b/engine/HAL/STM32L4/luos_hal.h index ebed1cc3f..dd5a269c0 100644 --- a/engine/HAL/STM32L4/luos_hal.h +++ b/engine/HAL/STM32L4/luos_hal.h @@ -41,7 +41,7 @@ typedef struct ll_timestamp * Function ******************************************************************************/ void LuosHAL_Init(void); -void LuosHAL_SetIrqState(uint8_t Enable); +void LuosHAL_SetIrqState(bool Enable); uint32_t LuosHAL_GetSystick(void); // bootloader functions diff --git a/engine/HAL/STUB/luos_hal.c b/engine/HAL/STUB/luos_hal.c index 9c2de270d..8c78960da 100644 --- a/engine/HAL/STUB/luos_hal.c +++ b/engine/HAL/STUB/luos_hal.c @@ -45,7 +45,7 @@ void LuosHAL_Init(void) * @param None * @return None ******************************************************************************/ -void LuosHAL_SetIrqState(uint8_t Enable) +void LuosHAL_SetIrqState(bool Enable) { } diff --git a/engine/HAL/STUB/luos_hal.h b/engine/HAL/STUB/luos_hal.h index 39cc24abf..3a4d225a0 100644 --- a/engine/HAL/STUB/luos_hal.h +++ b/engine/HAL/STUB/luos_hal.h @@ -27,7 +27,7 @@ * Function ******************************************************************************/ void LuosHAL_Init(void); -void LuosHAL_SetIrqState(uint8_t Enable); +void LuosHAL_SetIrqState(bool Enable); uint32_t LuosHAL_GetSystick(void); void LuosHAL_FlashWriteLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data); void LuosHAL_FlashReadLuosMemoryInfo(uint32_t addr, uint16_t size, uint8_t *data); diff --git a/engine/HAL/template/luos_hal.c b/engine/HAL/template/luos_hal.c index ce5a83cd4..f9958fa73 100644 --- a/engine/HAL/template/luos_hal.c +++ b/engine/HAL/template/luos_hal.c @@ -54,7 +54,7 @@ void LuosHAL_Init(void) * @param Enable : Set to "True" to enable IRQ, "False" otherwise * @return None ******************************************************************************/ -void LuosHAL_SetIrqState(uint8_t Enable) +void LuosHAL_SetIrqState(bool Enable) { /************************************************************************* * This function turn on and off all the IRQ in the MCU allowing atomic diff --git a/engine/HAL/template/luos_hal.h b/engine/HAL/template/luos_hal.h index 80ceb03a4..3fddd712e 100644 --- a/engine/HAL/template/luos_hal.h +++ b/engine/HAL/template/luos_hal.h @@ -37,7 +37,7 @@ typedef struct ll_timestamp * Function ******************************************************************************/ void LuosHAL_Init(void); -void LuosHAL_SetIrqState(uint8_t Enable); +void LuosHAL_SetIrqState(bool Enable); uint32_t LuosHAL_GetSystick(void); // timestamp functions diff --git a/engine/IO/inc/luos_phy.h b/engine/IO/inc/luos_phy.h index 2044cbfd3..7d817e966 100644 --- a/engine/IO/inc/luos_phy.h +++ b/engine/IO/inc/luos_phy.h @@ -20,6 +20,11 @@ typedef void (*JOB_CB)(luos_phy_t *phy_ptr, phy_job_t *job); typedef error_return_t (*RUN_TOPO)(luos_phy_t *phy_ptr, uint8_t *portId); typedef void (*RESET_PHY)(luos_phy_t *phy_ptr); +typedef void (*IRQ_STATE)(bool state); + +// Irq management +void Phy_SetIrqStateFunciton(IRQ_STATE irq_state); // Use it to reference your phy specific Irq state management to Luos. +void Phy_SetIrqState(bool state); // Use it to globally enable/disable all the phy irq. // Phy creation luos_phy_t *Phy_Create(JOB_CB phy_cb, RUN_TOPO run_topo, RESET_PHY reset_phy); // Use it to reference your phy to Luos. diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index bfba20652..775ae7d28 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -80,6 +80,8 @@ void LuosIO_Init(void) // Get the Luos phy struct, Luos always use the first phy luos_phy = Phy_Get(0, LuosIO_MsgHandler, LuosIO_RunTopo, LuosIO_Reset); + // Set the irq management function + Phy_SetIrqStateFunciton(LuosHAL_SetIrqState); } /****************************************************************************** diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 6d6043a95..328949487 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -70,8 +70,9 @@ typedef struct __attribute__((__packed__)) typedef struct { // ******************** Phy management ******************** - luos_phy_t phy[PHY_NB]; // phy[0] is the local phy, phy[1] is the remote phy. - uint8_t phy_nb; // Number of phy instantiated in the phy_ctx.phy array. + luos_phy_t phy[PHY_NB]; // phy[0] is the local phy, phy[1] is the remote phy. + uint8_t phy_nb; // Number of phy instantiated in the phy_ctx.phy array. + IRQ_STATE phy_irq_states[PHY_NB]; // Store the irq state functions of phys aving one. // ******************** Topology management ******************** port_t topology_source; // The source port. Where we receive the topological detection signal from. @@ -113,6 +114,7 @@ void Phy_Init(void) { Phy_Reset(); phy_ctx.phy_nb = 1; + memset(phy_ctx.phy_irq_states, 0, sizeof(phy_ctx.phy_irq_states)); } /****************************************************************************** @@ -209,6 +211,50 @@ luos_phy_t *Phy_Create(JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY reset_phy) return Phy_Get(phy_ctx.phy_nb++, job_cb, run_topo, reset_phy); } +/****************************************************************************** + * @brief Reference a specific irq state function to a physical layer + * @param irq_state function pointer to the IRQ state function + * @return None + ******************************************************************************/ +void Phy_SetIrqStateFunciton(IRQ_STATE irq_state) +{ + int i = 0; + while (phy_ctx.phy_irq_states[i] != NULL) + { + i++; + if (i >= PHY_NB) + { + // We exceed the number of phy + LUOS_ASSERT(0); + return; + } + } + // Save the function pointer + phy_ctx.phy_irq_states[i] = irq_state; +} + +/****************************************************************************** + * @brief Run all the phy irq state function referenced + * @param state state of the IRQ + * @return None + ******************************************************************************/ +void Phy_SetIrqState(bool state) +{ + // Loop int the phy_irq_states and call each function referenced + int i = 0; + while (phy_ctx.phy_irq_states[i] != NULL) + { + phy_ctx.phy_irq_states[i](state); + i++; + if (i >= PHY_NB) + { + // We exceed the number of phy + LUOS_ASSERT(0); + return; + } + } +} + /****************************************************************************** * @brief save a flag allowing to run a new discovering outside of IRQ (because this function is very long and can't be run in IRQ) * @return None @@ -416,9 +462,9 @@ _CRITICAL void Phy_ValidMsg(luos_phy_t *phy_ptr) // Now we can create a phy_job to dispatch the tx_job later LUOS_ASSERT(phy_ctx.io_job_nb < MAX_MSG_NB); - LuosHAL_SetIrqState(false); + Phy_SetIrqState(false); uint16_t my_job = phy_ctx.io_job_nb++; - LuosHAL_SetIrqState(true); + Phy_SetIrqState(true); // Now copy the data in the job phy_ctx.io_job[my_job].timestamp = phy_ptr->rx_timestamp; phy_ctx.io_job[my_job].alloc_msg = (msg_t *)phy_ptr->rx_data; @@ -462,11 +508,11 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) void *rx_data; void *copy_from; - LuosHAL_SetIrqState(false); + Phy_SetIrqState(false); // Check if this phy really need to alloc if (phy_ptr->rx_alloc_job == false) { - LuosHAL_SetIrqState(true); + Phy_SetIrqState(true); return; } // Check if we receive enougth data to be able to allocate the complete message @@ -474,14 +520,14 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) && (phy_ptr->received_data <= MAX_DATA_MSG_SIZE + sizeof(header_t)) // Check if their is a mistake on the buffer allocation. In this case, the phy.rx_data was not properly set to rx_buffer_base before the data reception. && (phy_ptr->rx_data == phy_ptr->rx_buffer_base)); - LuosHAL_SetIrqState(true); + Phy_SetIrqState(true); // Now we can check if we need to store the received data if (phy_ptr->rx_keep) { // We need to store the received data. // Update the informations allowing reception to continue and directly copy the data into the allocated buffer - LuosHAL_SetIrqState(false); + Phy_SetIrqState(false); if (phy_ptr->rx_alloc_job) { uint16_t phy_stored_data_size = phy_ptr->received_data; @@ -489,7 +535,7 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) // Now allocate it rx_data = MsgAlloc_Alloc(phy_ptr->rx_size, (uint8_t)phy_ptr->rx_phy_filter); phy_ptr->rx_data = rx_data; - LuosHAL_SetIrqState(true); + Phy_SetIrqState(true); // Check if this message is a luos transmission and if allocation succeed if ((phy_ptr == &phy_ctx.phy[0]) && (rx_data == NULL)) { @@ -506,7 +552,7 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) memcpy(rx_data, copy_from, phy_stored_data_size); return; } - LuosHAL_SetIrqState(true); + Phy_SetIrqState(true); } else { @@ -529,10 +575,10 @@ static void Phy_Dispatch(void) return; } // Interpreat received messages and create tasks for it. - LuosHAL_SetIrqState(false); + Phy_SetIrqState(false); while (i < phy_ctx.io_job_nb) { - LuosHAL_SetIrqState(true); + Phy_SetIrqState(true); // Get the oldest job IO_job_t *job = &phy_ctx.io_job[i]; i++; @@ -566,10 +612,10 @@ static void Phy_Dispatch(void) phy_ctx.phy[y].job_cb(&phy_ctx.phy[y], job_ptr); } } - LuosHAL_SetIrqState(false); + Phy_SetIrqState(false); } phy_ctx.io_job_nb = 0; - LuosHAL_SetIrqState(true); + Phy_SetIrqState(true); running = false; } @@ -669,14 +715,14 @@ static phy_job_t *Phy_AddJob(luos_phy_t *phy_ptr, phy_job_t *phy_job) LUOS_ASSERT((phy_job != NULL) && (phy_ptr != NULL)); LUOS_ASSERT(phy_ptr->job_nb < MAX_MSG_NB); // Add the job to the queue - LuosHAL_SetIrqState(false); + Phy_SetIrqState(false); phy_job_t *returned_job = &phy_ptr->job[phy_ptr->available_job_index++]; if (phy_ptr->available_job_index >= MAX_MSG_NB) { phy_ptr->available_job_index = 0; } LUOS_ASSERT(phy_ptr->available_job_index != phy_ptr->oldest_job_index); - LuosHAL_SetIrqState(true); + Phy_SetIrqState(true); phy_ptr->job_nb++; // Copy the actual job data to the allocated job *returned_job = *phy_job; diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 13bed5337..60e1cbf33 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -45,7 +45,7 @@ #include #include #include "msg_alloc.h" -#include "luos_hal.h" +#include "luos_phy.h" #include "luos_utils.h" /******************************************************************************* @@ -95,12 +95,12 @@ static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void); void MsgAlloc_Init(memory_stats_t *memory_stats) { //******** Init global vars pointers ********** - LuosHAL_SetIrqState(false); + Phy_SetIrqState(false); data_ptr = (uint8_t *)&msg_buffer[0]; oldest_alloc_slot = 0; available_alloc_slot = 0; memset((void *)alloc_slots, 0, sizeof(alloc_slots)); - LuosHAL_SetIrqState(true); + Phy_SetIrqState(true); if (memory_stats != NULL) { mem_stat = memory_stats; @@ -133,10 +133,10 @@ static inline uint32_t MsgAlloc_BufferAvailableSpaceComputation(void) uint32_t stack_free_space = 0; LUOS_ASSERT(((uintptr_t)data_ptr >= (uintptr_t)&msg_buffer[0]) && ((uintptr_t)data_ptr < (uintptr_t)&msg_buffer[MSG_BUFFER_SIZE])); - LuosHAL_SetIrqState(false); + Phy_SetIrqState(false); uint8_t *oldest_msg = alloc_slots[oldest_alloc_slot].data; uint8_t *data_ptr_snapshot = (uint8_t *)data_ptr; - LuosHAL_SetIrqState(true); + Phy_SetIrqState(true); if (oldest_msg != NULL) { @@ -285,14 +285,14 @@ _CRITICAL void MsgAlloc_Reference(uint8_t *rx_data, uint8_t phy_filter) { LUOS_ASSERT((rx_data < &msg_buffer[MSG_BUFFER_SIZE]) && (rx_data >= &msg_buffer[0]) && (phy_filter != 0)); // Reference a space into the alloc_slots - LuosHAL_SetIrqState(false); + Phy_SetIrqState(false); uint16_t my_slot = available_alloc_slot++; if (available_alloc_slot >= MAX_MSG_NB) { available_alloc_slot = 0; } LUOS_ASSERT(available_alloc_slot != oldest_alloc_slot); - LuosHAL_SetIrqState(true); + Phy_SetIrqState(true); alloc_slots[my_slot].data = rx_data; alloc_slots[my_slot].phy_filter = phy_filter; } @@ -317,7 +317,7 @@ _CRITICAL void MsgAlloc_Free(uint8_t phy_id, const uint8_t *data) // Remove the phy_id from the phy_filter // Assert if this phy have already been freed LUOS_ASSERT(alloc_slots[i].phy_filter & (0x01 << phy_id)); - LuosHAL_SetIrqState(false); + Phy_SetIrqState(false); alloc_slots[i].phy_filter &= ~(0x01 << phy_id); // Check if the phy_filter is empty if (alloc_slots[i].phy_filter == 0) @@ -336,7 +336,7 @@ _CRITICAL void MsgAlloc_Free(uint8_t phy_id, const uint8_t *data) } while ((alloc_slots[oldest_alloc_slot].data == NULL) && (oldest_alloc_slot != available_alloc_slot)); } } - LuosHAL_SetIrqState(true); + Phy_SetIrqState(true); return; } i++; diff --git a/engine/core/inc/luos_engine.h b/engine/core/inc/luos_engine.h index 707cc218e..43f9f3390 100644 --- a/engine/core/inc/luos_engine.h +++ b/engine/core/inc/luos_engine.h @@ -30,6 +30,7 @@ void Luos_Init(void); void Luos_Loop(void); void Luos_ResetStatistic(void); const revision_t *Luos_GetVersion(void); +void Luos_SetIrqState(bool state); // ***************** Node management ***************** uint32_t Luos_GetSystick(void); diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index be1345251..4e67499f3 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -12,6 +12,7 @@ #include "service.h" #include "struct_engine.h" #include "luos_io.h" +#include "luos_phy.h" #include "stats.h" /******************************************************************************* @@ -123,6 +124,16 @@ const revision_t *Luos_GetVersion(void) return &luos_version; } +/****************************************************************************** + * @brief enable or disable IRQ + * @param state : true to enable, false to disable + * @return None + ******************************************************************************/ +void Luos_SetIrqState(bool state) +{ + Phy_SetIrqState(state); +} + /****************************************************************************** * @brief Send msg through network * @param Service : Who send diff --git a/engine/core/src/luos_utils.c b/engine/core/src/luos_utils.c index 44bf0ea6c..6be1d9b30 100644 --- a/engine/core/src/luos_utils.c +++ b/engine/core/src/luos_utils.c @@ -12,6 +12,7 @@ #include "luos_hal.h" #include "msg_alloc.h" #include "filter.h" +#include "luos_phy.h" /******************************************************************************* * Function @@ -57,7 +58,7 @@ _CRITICAL void Luos_assert(char *file, uint32_t line) { // prepare a message as a node. // To do that we have to reset the service ID and clear PTP states to unlock others. - PortMng_Init(); + Luos_Init(); // completely reinit the allocator MsgAlloc_Init(NULL); Filter_IdInit(); // Mask filter for service ID @@ -81,7 +82,7 @@ _CRITICAL void Luos_assert(char *file, uint32_t line) // Set bootloader mode, save node ID and reboot Luos_JumpToBootloader(); #endif - LuosHAL_SetIrqState(false); + Phy_SetIrqState(false); while (1) { } diff --git a/engine/profiles/servo_motor/profile_servo_motor.c b/engine/profiles/servo_motor/profile_servo_motor.c index efa2bab5e..66bf67468 100644 --- a/engine/profiles/servo_motor/profile_servo_motor.c +++ b/engine/profiles/servo_motor/profile_servo_motor.c @@ -5,7 +5,6 @@ * @version 0.0.0 ******************************************************************************/ #include "profile_servo_motor.h" -#include "luos_hal.h" /****************************************************************************** * @brief Initialization function @@ -53,9 +52,9 @@ void ProfileServo_Handler(service_t *service, const msg_t *msg) } else { - LuosHAL_SetIrqState(false); + Luos_SetIrqState(false); AngularOD_PositionToMsg((angular_position_t *)&servo_motor_profile->angular_position, &pub_msg); - LuosHAL_SetIrqState(true); + Luos_SetIrqState(true); Luos_SendMsg(service, &pub_msg); } } @@ -111,10 +110,10 @@ void ProfileServo_Handler(service_t *service, const msg_t *msg) case REINIT: { // set state to 0 - LuosHAL_SetIrqState(false); + Luos_SetIrqState(false); servo_motor_profile->angular_position = AngularOD_PositionFrom_deg(0.0); servo_motor_profile->target_angular_position = AngularOD_PositionFrom_deg(0.0); - LuosHAL_SetIrqState(true); + Luos_SetIrqState(true); } break; case DIMENSION: @@ -131,9 +130,9 @@ void ProfileServo_Handler(service_t *service, const msg_t *msg) if (msg->header.size == sizeof(angular_position_t)) { // set the motor target angular position - LuosHAL_SetIrqState(false); + Luos_SetIrqState(false); AngularOD_PositionFromMsg((angular_position_t *)&servo_motor_profile->target_angular_position, msg); - LuosHAL_SetIrqState(true); + Luos_SetIrqState(true); } else { diff --git a/examples/projects/l0/controller_motor/lib/Controller_motor/controller_motor.c b/examples/projects/l0/controller_motor/lib/Controller_motor/controller_motor.c index c5238bf54..8c72b362c 100644 --- a/examples/projects/l0/controller_motor/lib/Controller_motor/controller_motor.c +++ b/examples/projects/l0/controller_motor/lib/Controller_motor/controller_motor.c @@ -8,7 +8,6 @@ #include "ll_motor.h" #include "profile_servo_motor.h" -#include "luos_hal.h" #include "stdbool.h" #include "math.h" #include @@ -259,11 +258,11 @@ static void ControllerMotor_MsgHandler(service_t *service, const msg_t *msg) ll_motor_enable(servo_motor.mode.mode_compliant == 0); if (servo_motor.mode.mode_compliant == 0) { - LuosHAL_SetIrqState(false); + Luos_SetIrqState(false); last_position = servo_motor.angular_position; errAngleSum = 0.0; lastErrAngle = 0.0; - LuosHAL_SetIrqState(true); + Luos_SetIrqState(true); } return; } @@ -281,9 +280,9 @@ static void ControllerMotor_MsgHandler(service_t *service, const msg_t *msg) if ((servo_motor.mode.mode_angular_position | servo_motor.mode.mode_angular_position) && (msg->header.size == sizeof(angular_position_t))) { // set the motor target angular position - LuosHAL_SetIrqState(false); + Luos_SetIrqState(false); last_position = servo_motor.angular_position; - LuosHAL_SetIrqState(true); + Luos_SetIrqState(true); } return; } diff --git a/network/robus/HAL/ESP32/robus_hal.c b/network/robus/HAL/ESP32/robus_hal.c index 4a590f902..13f000502 100644 --- a/network/robus/HAL/ESP32/robus_hal.c +++ b/network/robus/HAL/ESP32/robus_hal.c @@ -104,6 +104,9 @@ void RobusHAL_Init(void) // Com Initialization RobusHAL_ComInit(DEFAULTBAUDRATE); + + // Reference the IRQ manafement function of Robus + Phy_SetIrqStateFunciton(RobusHAL_SetIrqState); } /****************************************************************************** @@ -119,7 +122,7 @@ void RobusHAL_Loop(void) * @param None * @return None ******************************************************************************/ -_CRITICAL void RobusHAL_SetIrqState(uint8_t Enable) +_CRITICAL void RobusHAL_SetIrqState(bool Enable) { static volatile uint8_t irq_mutex = true; @@ -621,6 +624,7 @@ _CRITICAL void RobusHAL_ComputeCRC(uint8_t *data, uint8_t *crc) for (uint8_t j = 0; j < 8; ++j) { uint16_t mix = *(uint16_t *)crc & 0x8000; + *(uint16_t *)crc = (*(uint16_t *)crc << 1); if (mix) *(uint16_t *)crc = *(uint16_t *)crc ^ 0x0007; diff --git a/network/robus/HAL/ESP32/robus_hal.h b/network/robus/HAL/ESP32/robus_hal.h index 33e440abf..3c4fa7c4d 100644 --- a/network/robus/HAL/ESP32/robus_hal.h +++ b/network/robus/HAL/ESP32/robus_hal.h @@ -30,5 +30,5 @@ void RobusHAL_SetPTPReverseState(uint8_t PTPNbr); void RobusHAL_PushPTP(uint8_t PTPNbr); uint8_t RobusHAL_GetPTPState(uint8_t PTPNbr); void RobusHAL_ComputeCRC(uint8_t *data, uint8_t *crc); -void RobusHAL_SetIrqState(uint8_t Enable); +void RobusHAL_SetIrqState(bool Enable); #endif /* _RobusHAL_H_ */ diff --git a/network/robus/src/robus.c b/network/robus/src/robus.c index c897a99dc..576ab8b9b 100644 --- a/network/robus/src/robus.c +++ b/network/robus/src/robus.c @@ -83,9 +83,9 @@ void Robus_JobHandler(luos_phy_t *phy_ptr, phy_job_t *job) encaps[encaps_index].size = CRC_SIZE; // Save the precomputed encapsulation in the job - LuosHAL_SetIrqState(false); + Phy_SetIrqState(false); job->phy_data = (void *)&encaps[encaps_index]; - LuosHAL_SetIrqState(true); + Phy_SetIrqState(true); // Get the next encapsulation index for the next job encaps_index++; diff --git a/network/robus/src/transmission.c b/network/robus/src/transmission.c index 4e9e5f137..66b773fe6 100644 --- a/network/robus/src/transmission.c +++ b/network/robus/src/transmission.c @@ -168,9 +168,9 @@ _CRITICAL void Transmit_Process() ctx.tx.lock = true; RobusHAL_SetRxDetecPin(false); // Switch reception in collision detection mode - LuosHAL_SetIrqState(false); + Phy_SetIrqState(false); ctx.rx.callback = Recep_GetCollision; - LuosHAL_SetIrqState(true); + Phy_SetIrqState(true); ctx.tx.data = tx_data; if (!nbrRetry) From 5973869639ee5f143b956e296a5aea4f20a2372e Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 4 Jul 2023 17:40:14 +0200 Subject: [PATCH 097/150] Make Robus an independant package --- .github/workflows/pio_release.yml | 27 ++++++++- engine/HAL/ATSAMD21/luos_hal.h | 3 +- engine/HAL/ATSAMD21_ARDUINO/luos_hal.h | 3 +- engine/HAL/ATSAMD21_MBED/luos_hal.h | 3 +- engine/HAL/ESP32/luos_hal.h | 3 +- engine/HAL/NATIVE/luos_hal.h | 3 +- engine/HAL/STM32F0/luos_hal.h | 3 +- engine/HAL/STM32F4/luos_hal.c | 4 +- engine/HAL/STM32F4/luos_hal.h | 3 +- engine/HAL/STM32G4/luos_hal.h | 3 +- engine/HAL/STM32L0/luos_hal.h | 3 +- engine/HAL/STM32L4/luos_hal.h | 3 +- engine/HAL/STUB/luos_hal.h | 3 +- engine/HAL/template/luos_hal.h | 3 +- engine/core/src/luos_utils.c | 1 - .../apps/alarm_controller/alarm_controller.h | 2 +- .../biometric-security/biometric_security.h | 2 +- .../apps/start_controller/start_controller.h | 2 +- .../Arduino/bldc_simple_foc/platformio.ini | 5 +- .../Arduino/bldc_simple_foc/src/SimpleFOC.cpp | 2 +- .../Arduino/button/lib/button/button.h | 1 - .../projects/Arduino/button/platformio.ini | 5 +- .../projects/Arduino/button/src/Button.cpp | 2 +- .../fingerprint/lib/Fingerprint/fingerprint.h | 2 +- .../lib/Fingerprint/fingerprint_drv.h | 2 +- .../Arduino/fingerprint/platformio.ini | 5 +- .../Arduino/fingerprint/src/Fingerprint.cpp | 2 +- .../Arduino/gate_serialcom/platformio.ini | 2 + .../gate_serialcom/src/Gate_SerialCom.cpp | 2 +- .../inspector_serialcom/platformio.ini | 2 + .../src/Inspector_SerialCom.cpp | 2 +- examples/projects/Arduino/lcd/lib/Lcd/lcd.h | 2 +- examples/projects/Arduino/lcd/platformio.ini | 5 +- examples/projects/Arduino/lcd/src/Lcd.cpp | 2 +- examples/projects/Arduino/led/lib/led/led.h | 2 +- examples/projects/Arduino/led/platformio.ini | 5 +- examples/projects/Arduino/led/src/led.cpp | 2 +- .../servo_motor/lib/Servo_motor/servo_drv.h | 2 +- .../Arduino/servo_motor/platformio.ini | 5 +- .../Arduino/servo_motor/src/Servo_motor.cpp | 2 +- .../Arduino/stepper_simple_foc/platformio.ini | 5 +- .../stepper_simple_foc/src/SimpleFOC.cpp | 2 +- .../projects/ESP32/button/lib/button/button.h | 2 +- examples/projects/ESP32/button/platformio.ini | 5 +- examples/projects/ESP32/button/src/main.c | 2 +- .../ESP32/button_arduino/lib/button/button.h | 2 +- .../ESP32/button_arduino/platformio.ini | 5 +- .../ESP32/button_arduino/src/main.cpp | 2 +- .../ESP32/gate_serialcom/platformio.ini | 2 + .../projects/ESP32/gate_serialcom/src/main.c | 2 +- .../gate_serialcom_arduino/platformio.ini | 2 + .../ESP32/gate_serialcom_arduino/src/main.cpp | 2 +- .../projects/ESP32/gate_wscom/platformio.ini | 2 + examples/projects/ESP32/gate_wscom/src/main.c | 2 +- .../ESP32/gate_wscom_arduino/platformio.ini | 2 + .../ESP32/gate_wscom_arduino/src/main.cpp | 2 +- examples/projects/ESP32/led/lib/led/led.h | 2 +- examples/projects/ESP32/led/platformio.ini | 5 +- examples/projects/ESP32/led/src/main.c | 2 +- .../barometer/lib/barometer/BMP280.h | 2 +- .../NUCLEO-F072RB/barometer/platformio.ini | 2 + .../NUCLEO-F072RB/barometer/src/main.c | 2 +- .../NUCLEO-F072RB/bootloader/platformio.ini | 5 +- .../NUCLEO-F072RB/bootloader/src/main.c | 2 +- .../NUCLEO-F072RB/button/platformio.ini | 5 +- .../projects/NUCLEO-F072RB/button/src/main.c | 2 +- .../dc_motor/lib/DC_motor/dc_motor_drv.h | 2 +- .../NUCLEO-F072RB/dc_motor/platformio.ini | 5 +- .../NUCLEO-F072RB/dc_motor/src/main.c | 2 +- .../gate_serialcom/platformio.ini | 2 + .../NUCLEO-F072RB/gate_serialcom/src/main.c | 2 +- .../inspector_serialcom/platformio.ini | 2 + .../inspector_serialcom/src/main.c | 2 +- .../lib/Potentiometer/potentiometer.h | 2 +- .../lib/Potentiometer/potentiometer_drv.h | 2 +- .../potentiometer/platformio.ini | 5 +- .../NUCLEO-F072RB/potentiometer/src/main.c | 2 +- .../NUCLEO-F401RE/bootloader/platformio.ini | 5 +- .../NUCLEO-F401RE/bootloader/src/main.c | 2 +- .../NUCLEO-F401RE/button/lib/Button/button.h | 2 +- .../NUCLEO-F401RE/button/platformio.ini | 5 +- .../projects/NUCLEO-F401RE/button/src/main.c | 2 +- .../dc_motor/lib/DC_motor/dc_motor_drv.h | 2 +- .../NUCLEO-F401RE/dc_motor/platformio.ini | 5 +- .../NUCLEO-F401RE/dc_motor/src/main.c | 2 +- .../gate_serialcom/platformio.ini | 2 + .../NUCLEO-F401RE/gate_serialcom/src/main.c | 2 +- .../inspector_serialcom/platformio.ini | 2 + .../inspector_serialcom/src/main.c | 2 +- .../projects/NUCLEO-F401RE/led/lib/Led/led.h | 2 +- .../led/lib/alias_save/alias_save.c | 4 +- .../led/lib/alias_save/alias_save.h | 4 +- .../projects/NUCLEO-F401RE/led/platformio.ini | 5 +- .../projects/NUCLEO-F401RE/led/src/main.c | 2 +- .../lib/Potentiometer/potentiometer.h | 2 +- .../lib/Potentiometer/potentiometer_drv.h | 2 +- .../potentiometer/platformio.ini | 5 +- .../NUCLEO-F401RE/potentiometer/src/main.c | 2 +- .../NUCLEO-F410RB/bootloader/platformio.ini | 5 +- .../NUCLEO-F410RB/bootloader/src/main.c | 2 +- .../NUCLEO-F410RB/button/lib/Button/button.h | 2 +- .../NUCLEO-F410RB/button/platformio.ini | 5 +- .../projects/NUCLEO-F410RB/button/src/main.c | 2 +- .../dc_motor/lib/DC_motor/dc_motor_drv.h | 2 +- .../NUCLEO-F410RB/dc_motor/platformio.ini | 5 +- .../NUCLEO-F410RB/dc_motor/src/main.c | 2 +- .../gate_serialcom/platformio.ini | 2 + .../NUCLEO-F410RB/gate_serialcom/src/main.c | 2 +- .../inspector_serialcom/platformio.ini | 2 + .../inspector_serialcom/src/main.c | 2 +- .../projects/NUCLEO-F410RB/led/lib/Led/led.h | 2 +- .../projects/NUCLEO-F410RB/led/platformio.ini | 5 +- .../projects/NUCLEO-F410RB/led/src/main.c | 2 +- .../lib/Potentiometer/potentiometer.h | 2 +- .../lib/Potentiometer/potentiometer_drv.h | 2 +- .../potentiometer/platformio.ini | 5 +- .../NUCLEO-F410RB/potentiometer/src/main.c | 2 +- .../NUCLEO-G431KB/bootloader/platformio.ini | 5 +- .../NUCLEO-G431KB/bootloader/src/main.c | 2 +- .../NUCLEO-G431KB/button/lib/Button/button.h | 1 - .../NUCLEO-G431KB/button/platformio.ini | 5 +- .../projects/NUCLEO-G431KB/button/src/main.c | 2 +- .../dc_motor/lib/DC_motor/dc_motor_drv.h | 2 +- .../NUCLEO-G431KB/dc_motor/platformio.ini | 5 +- .../NUCLEO-G431KB/dc_motor/src/main.c | 2 +- .../gate_serialcom/platformio.ini | 2 + .../NUCLEO-G431KB/gate_serialcom/src/main.c | 2 +- .../inspector_serialcom/platformio.ini | 2 + .../inspector_serialcom/src/main.c | 2 +- .../lib/Potentiometer/potentiometer.h | 2 +- .../lib/Potentiometer/potentiometer_drv.h | 2 +- .../potentiometer/platformio.ini | 5 +- .../NUCLEO-G431KB/potentiometer/src/main.c | 2 +- .../NUCLEO-G474RE/bootloader/platformio.ini | 5 +- .../NUCLEO-G474RE/bootloader/src/main.c | 2 +- .../NUCLEO-G474RE/button/lib/Button/button.h | 2 +- .../NUCLEO-G474RE/button/platformio.ini | 7 ++- .../projects/NUCLEO-G474RE/button/src/main.c | 2 +- .../gate_serialcom/platformio.ini | 2 + .../NUCLEO-G474RE/gate_serialcom/src/main.c | 2 +- .../inspector_serialcom/platformio.ini | 2 + .../inspector_serialcom/src/main.c | 2 +- .../NUCLEO-L073RZ/bootloader/platformio.ini | 5 +- .../NUCLEO-L073RZ/bootloader/src/main.c | 2 +- .../NUCLEO-L073RZ/button/platformio.ini | 5 +- .../projects/NUCLEO-L073RZ/button/src/main.c | 2 +- .../gate_serialcom/platformio.ini | 2 + .../NUCLEO-L073RZ/gate_serialcom/src/main.c | 2 +- .../NUCLEO-L432KC/bootloader/platformio.ini | 6 +- .../NUCLEO-L432KC/bootloader/src/main.c | 2 +- .../NUCLEO-L432KC/button/lib/Button/button.h | 2 +- .../NUCLEO-L432KC/button/platformio.ini | 5 +- .../projects/NUCLEO-L432KC/button/src/main.c | 2 +- .../dc_motor/lib/DC_motor/dc_motor_drv.h | 2 +- .../NUCLEO-L432KC/dc_motor/platformio.ini | 5 +- .../NUCLEO-L432KC/dc_motor/src/main.c | 2 +- .../fingerprint/lib/Fingerprint/fingerprint.h | 2 +- .../NUCLEO-L432KC/fingerprint/platformio.ini | 5 +- .../NUCLEO-L432KC/fingerprint/src/main.c | 2 +- .../gate_serialcom/platformio.ini | 2 + .../NUCLEO-L432KC/gate_serialcom/src/main.c | 2 +- .../gpio/lib/Gpio_dev/gpio_dev.h | 2 +- .../NUCLEO-L432KC/gpio/platformio.ini | 5 +- .../projects/NUCLEO-L432KC/gpio/src/main.c | 2 +- .../inspector_serialcom/platformio.ini | 2 + .../inspector_serialcom/src/main.c | 2 +- .../projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.h | 2 +- .../projects/NUCLEO-L432KC/lcd/platformio.ini | 5 +- .../projects/NUCLEO-L432KC/lcd/src/main.c | 2 +- .../projects/NUCLEO-L432KC/led/lib/Led/led.h | 2 +- .../projects/NUCLEO-L432KC/led/platformio.ini | 5 +- .../projects/NUCLEO-L432KC/led/src/main.c | 2 +- .../lib/Potentiometer/potentiometer.h | 2 +- .../lib/Potentiometer/potentiometer_drv.h | 2 +- .../potentiometer/platformio.ini | 5 +- .../NUCLEO-L432KC/potentiometer/src/main.c | 2 +- .../NUCLEO-L432KC/servo/lib/Servo/servo_drv.h | 2 +- .../NUCLEO-L432KC/servo/platformio.ini | 5 +- .../projects/NUCLEO-L432KC/servo/src/main.c | 2 +- .../Bootloader/firmware/src/main.c | 2 +- .../SAMD21XPLAINED/button/lib/button/button.h | 2 +- .../SAMD21XPLAINED/button/platformio.ini | 5 +- .../projects/SAMD21XPLAINED/button/src/main.c | 2 +- .../bootloader/platformio.ini | 6 +- .../STM32F4-discovery/bootloader/src/main.c | 2 +- .../button/lib/Button/button.h | 2 +- .../STM32F4-discovery/button/platformio.ini | 10 +++- .../STM32F4-discovery/button/src/main.c | 2 +- .../gate_serialcom/platformio.ini | 4 ++ .../gate_serialcom/src/main.c | 2 +- .../inspector_serialcom/platformio.ini | 4 ++ .../inspector_serialcom/src/main.c | 2 +- .../bootloader/platformio.ini | 5 +- .../STM32L4S5_discovery/bootloader/src/main.c | 2 +- .../button/lib/Button/button.h | 2 +- .../STM32L4S5_discovery/button/platformio.ini | 5 +- .../STM32L4S5_discovery/button/src/main.c | 2 +- .../gate_serialcom/platformio.ini | 2 + .../gate_serialcom/src/main.c | 2 +- .../lib/Led_Fader/led_fader.h | 2 +- .../lib/Led_Fader/ledfader_drv.h | 2 +- .../alarm_controller/platformio.ini | 2 + .../l0/bike_alarm/alarm_controller/src/main.c | 2 +- .../start_controller/platformio.ini | 2 + .../l0/bike_alarm/start_controller/src/main.c | 2 +- .../projects/l0/bootloader/platformio.ini | 5 +- examples/projects/l0/bootloader/src/main.c | 2 +- examples/projects/l0/button/platformio.ini | 5 +- examples/projects/l0/button/src/main.c | 2 +- .../projects/l0/button_freertos/lib/Led/led.h | 2 +- .../l0/button_freertos/lib/Led/led_drv.h | 2 +- .../l0/button_freertos/platformio.ini | 6 +- .../l0/button_freertos/src/freertos.c | 2 +- .../l0/controller_motor/platformio.ini | 5 +- .../projects/l0/controller_motor/src/main.c | 2 +- .../l0/dc_motor/lib/DC_motor/dc_motor_drv.h | 2 +- examples/projects/l0/dc_motor/platformio.ini | 5 +- examples/projects/l0/dc_motor/src/main.c | 2 +- .../lib/Detection_Button/detection_button.h | 2 +- .../l0/demo/detection_button/platformio.ini | 2 + .../l0/demo/detection_button/src/main.c | 2 +- .../ledstrip_position/lib/Distance/distance.h | 2 +- .../lib/Distance/vl53l0x_drv.h | 2 +- .../lib/LedStrip_Position/ledstrip_position.h | 2 +- .../l0/demo/ledstrip_position/platformio.ini | 2 + .../l0/demo/ledstrip_position/src/main.c | 2 +- .../lib/motor_copy/motor_copy.h | 2 +- .../l0/demo/motor_copy_app/platformio.ini | 5 +- .../l0/demo/motor_copy_app/src/main.c | 2 +- .../motor_demo_app/lib/run_motor/run_motor.h | 2 +- .../l0/demo/motor_demo_app/platformio.ini | 5 +- .../l0/demo/motor_demo_app/src/main.c | 2 +- examples/projects/l0/demo/product_config.h | 2 +- .../l0/distance/lib/Distance/distance.h | 2 +- .../l0/distance/lib/Distance/vl53l0x_drv.h | 2 +- examples/projects/l0/distance/platformio.ini | 5 +- examples/projects/l0/distance/src/main.c | 2 +- examples/projects/l0/dxl/lib/Dxl/dxl.h | 2 +- examples/projects/l0/dxl/platformio.ini | 5 +- examples/projects/l0/dxl/src/main.c | 2 +- .../fingerprint/lib/Fingerprint/fingerprint.h | 2 +- .../projects/l0/fingerprint/platformio.ini | 5 +- examples/projects/l0/fingerprint/src/main.c | 2 +- .../projects/l0/gate_serialcom/platformio.ini | 2 + .../projects/l0/gate_serialcom/src/main.c | 2 +- examples/projects/l0/gpio/platformio.ini | 5 +- examples/projects/l0/gpio/src/main.c | 2 +- examples/projects/l0/imu/lib/Imu/imu.h | 2 +- .../l0/imu/lib/Imu/mpu_configuration.c | 2 +- .../l0/imu/lib/Imu/mpu_configuration.h | 2 +- examples/projects/l0/imu/platformio.ini | 5 +- examples/projects/l0/imu/src/main.c | 2 +- .../l0/inspector_serialcom/platformio.ini | 2 + .../l0/inspector_serialcom/src/main.c | 2 +- examples/projects/l0/lcd/lib/Lcd/lcd.h | 2 +- examples/projects/l0/lcd/platformio.ini | 5 +- examples/projects/l0/lcd/src/main.c | 2 +- examples/projects/l0/led/lib/Led/led.h | 2 +- examples/projects/l0/led/lib/Led/led_drv.h | 2 +- examples/projects/l0/led/platformio.ini | 5 +- examples/projects/l0/led/src/main.c | 2 +- .../l0/led_fader/lib/Led_Fader/led_fader.h | 2 +- .../l0/led_fader/lib/Led_Fader/ledfader_drv.h | 2 +- examples/projects/l0/led_fader/platformio.ini | 5 +- examples/projects/l0/led_fader/src/main.c | 2 +- .../l0/led_strip/lib/Led_strip/led_strip.h | 2 +- .../led_strip/lib/Led_strip/led_strip_drv.h | 2 +- examples/projects/l0/led_strip/platformio.ini | 5 +- examples/projects/l0/led_strip/src/main.c | 2 +- .../lib/Light_sensor/light_sensor.h | 2 +- .../lib/Light_sensor/light_sensor_drv.h | 2 +- .../projects/l0/light_sensor/platformio.ini | 5 +- examples/projects/l0/light_sensor/src/main.c | 2 +- .../projects/l0/load/lib/Load/HX711/HX711.h | 2 +- examples/projects/l0/load/lib/Load/load.h | 2 +- examples/projects/l0/load/platformio.ini | 5 +- examples/projects/l0/load/src/main.c | 2 +- .../lib/Potentiometer/potentiometer.h | 2 +- .../lib/Potentiometer/potentiometer_drv.h | 2 +- .../projects/l0/potentiometer/platformio.ini | 5 +- examples/projects/l0/potentiometer/src/main.c | 2 +- .../projects/l0/power_switch/platformio.ini | 5 +- examples/projects/l0/power_switch/src/main.c | 2 +- .../projects/l0/servo/lib/Servo/servo_drv.h | 2 +- examples/projects/l0/servo/platformio.ini | 5 +- examples/projects/l0/servo/src/main.c | 2 +- examples/projects/l0/stepper/platformio.ini | 5 +- examples/projects/l0/stepper/src/main.c | 2 +- .../projects/native/button/platformio.ini | 5 +- examples/projects/native/button/src/main.c | 2 +- .../projects/native/gate_wscom/platformio.ini | 2 + .../projects/native/gate_wscom/src/main.c | 2 +- examples/projects/native/led/lib/Led/led.h | 1 - examples/projects/native/led/platformio.ini | 5 +- examples/projects/native/led/src/main.c | 2 +- .../native/ping_pong/lib/PingPong/graph.c | 1 - .../ping_pong/lib/PingPong/library.json | 4 +- .../native/ping_pong/lib/PingPong/scoring.h | 1 - .../projects/native/ping_pong/platformio.ini | 5 +- examples/projects/native/ping_pong/src/main.c | 3 +- library.json | 14 ++--- .../HAL/ATSAMD21/robus_hal.c | 0 .../HAL/ATSAMD21/robus_hal.h | 0 .../HAL/ATSAMD21/robus_hal_config.h | 0 .../HAL/ATSAMD21/samd21.h | 0 .../HAL/ATSAMD21_ARDUINO/board_config.h | 0 .../HAL/ATSAMD21_ARDUINO/robus_hal.c | 0 .../HAL/ATSAMD21_ARDUINO/robus_hal.h | 0 .../HAL/ATSAMD21_ARDUINO/robus_hal_config.h | 0 .../HAL/ATSAMD21_MBED/robus_hal.c | 0 .../HAL/ATSAMD21_MBED/robus_hal.h | 0 .../HAL/ATSAMD21_MBED/robus_hal_config.h | 0 .../HAL/ATSAMD21_MBED/samd21.h | 0 .../HAL/ESP32/board_config.h | 0 .../HAL/ESP32/luos_engine/CMakeLists.txt | 0 .../HAL/ESP32/luos_engine/linker.lf | 0 .../HAL/ESP32/robus_hal.c | 0 .../HAL/ESP32/robus_hal.h | 0 .../HAL/ESP32/robus_hal_config.h | 0 .../HAL/NATIVE/hal_script.py | 0 .../HAL/NATIVE/robus_hal.c | 2 +- .../HAL/NATIVE/robus_hal.h | 0 .../HAL/NATIVE/robus_hal_config.h | 0 .../{robus => robus_network}/HAL/README.md | 0 .../HAL/STM32F0/robus_hal.c | 0 .../HAL/STM32F0/robus_hal.h | 0 .../HAL/STM32F0/robus_hal_config.h | 0 .../HAL/STM32F4/robus_hal.c | 0 .../HAL/STM32F4/robus_hal.h | 0 .../HAL/STM32F4/robus_hal_config.h | 0 .../HAL/STM32G4/robus_hal.c | 0 .../HAL/STM32G4/robus_hal.h | 0 .../HAL/STM32G4/robus_hal_config.h | 0 .../HAL/STM32L0/robus_hal.c | 0 .../HAL/STM32L0/robus_hal.h | 0 .../HAL/STM32L0/robus_hal_config.h | 0 .../HAL/STM32L4/robus_hal.c | 0 .../HAL/STM32L4/robus_hal.h | 0 .../HAL/STM32L4/robus_hal_config.h | 0 .../HAL/STUB/robus_hal.c | 0 .../HAL/STUB/robus_hal.h | 0 .../HAL/STUB/robus_hal_config.h | 0 .../HAL/template/robus_hal.c | 0 .../HAL/template/robus_hal.h | 0 .../HAL/template/robus_hal_config.h | 0 .../inc/_robus_network.h} | 0 .../{robus => robus_network}/inc/context.h | 2 +- .../inc/port_manager.h | 2 +- .../{robus => robus_network}/inc/reception.h | 2 +- .../inc/robus_network.h} | 0 .../inc/transmission.h | 2 +- network/robus_network/library.json | 23 ++++++++ .../{robus => robus_network}/robus_config.h | 0 .../robus_network/robus_select_hal_script.py | 58 +++++++++++++++++++ .../selftest/selftest.c | 0 .../selftest/selftest.h | 2 +- .../src/port_manager.c | 0 .../{robus => robus_network}/src/reception.c | 2 +- network/{robus => robus_network}/src/robus.c | 2 +- .../src/transmission.c | 0 platformio.ini | 7 ++- source_filter_script.py | 19 ++---- test/_resources/Unity/unit_test.h | 3 +- test/_resources/node_config.h | 3 +- 364 files changed, 699 insertions(+), 311 deletions(-) rename network/{robus => robus_network}/HAL/ATSAMD21/robus_hal.c (100%) rename network/{robus => robus_network}/HAL/ATSAMD21/robus_hal.h (100%) rename network/{robus => robus_network}/HAL/ATSAMD21/robus_hal_config.h (100%) rename network/{robus => robus_network}/HAL/ATSAMD21/samd21.h (100%) rename network/{robus => robus_network}/HAL/ATSAMD21_ARDUINO/board_config.h (100%) rename network/{robus => robus_network}/HAL/ATSAMD21_ARDUINO/robus_hal.c (100%) rename network/{robus => robus_network}/HAL/ATSAMD21_ARDUINO/robus_hal.h (100%) rename network/{robus => robus_network}/HAL/ATSAMD21_ARDUINO/robus_hal_config.h (100%) rename network/{robus => robus_network}/HAL/ATSAMD21_MBED/robus_hal.c (100%) rename network/{robus => robus_network}/HAL/ATSAMD21_MBED/robus_hal.h (100%) rename network/{robus => robus_network}/HAL/ATSAMD21_MBED/robus_hal_config.h (100%) rename network/{robus => robus_network}/HAL/ATSAMD21_MBED/samd21.h (100%) rename network/{robus => robus_network}/HAL/ESP32/board_config.h (100%) rename network/{robus => robus_network}/HAL/ESP32/luos_engine/CMakeLists.txt (100%) rename network/{robus => robus_network}/HAL/ESP32/luos_engine/linker.lf (100%) rename network/{robus => robus_network}/HAL/ESP32/robus_hal.c (100%) rename network/{robus => robus_network}/HAL/ESP32/robus_hal.h (100%) rename network/{robus => robus_network}/HAL/ESP32/robus_hal_config.h (100%) rename network/{robus => robus_network}/HAL/NATIVE/hal_script.py (100%) rename network/{robus => robus_network}/HAL/NATIVE/robus_hal.c (99%) rename network/{robus => robus_network}/HAL/NATIVE/robus_hal.h (100%) rename network/{robus => robus_network}/HAL/NATIVE/robus_hal_config.h (100%) rename network/{robus => robus_network}/HAL/README.md (100%) rename network/{robus => robus_network}/HAL/STM32F0/robus_hal.c (100%) rename network/{robus => robus_network}/HAL/STM32F0/robus_hal.h (100%) rename network/{robus => robus_network}/HAL/STM32F0/robus_hal_config.h (100%) rename network/{robus => robus_network}/HAL/STM32F4/robus_hal.c (100%) rename network/{robus => robus_network}/HAL/STM32F4/robus_hal.h (100%) rename network/{robus => robus_network}/HAL/STM32F4/robus_hal_config.h (100%) rename network/{robus => robus_network}/HAL/STM32G4/robus_hal.c (100%) rename network/{robus => robus_network}/HAL/STM32G4/robus_hal.h (100%) rename network/{robus => robus_network}/HAL/STM32G4/robus_hal_config.h (100%) rename network/{robus => robus_network}/HAL/STM32L0/robus_hal.c (100%) rename network/{robus => robus_network}/HAL/STM32L0/robus_hal.h (100%) rename network/{robus => robus_network}/HAL/STM32L0/robus_hal_config.h (100%) rename network/{robus => robus_network}/HAL/STM32L4/robus_hal.c (100%) rename network/{robus => robus_network}/HAL/STM32L4/robus_hal.h (100%) rename network/{robus => robus_network}/HAL/STM32L4/robus_hal_config.h (100%) rename network/{robus => robus_network}/HAL/STUB/robus_hal.c (100%) rename network/{robus => robus_network}/HAL/STUB/robus_hal.h (100%) rename network/{robus => robus_network}/HAL/STUB/robus_hal_config.h (100%) rename network/{robus => robus_network}/HAL/template/robus_hal.c (100%) rename network/{robus => robus_network}/HAL/template/robus_hal.h (100%) rename network/{robus => robus_network}/HAL/template/robus_hal_config.h (100%) rename network/{robus/inc/_robus.h => robus_network/inc/_robus_network.h} (100%) rename network/{robus => robus_network}/inc/context.h (97%) rename network/{robus => robus_network}/inc/port_manager.h (97%) rename network/{robus => robus_network}/inc/reception.h (98%) rename network/{robus/inc/robus.h => robus_network/inc/robus_network.h} (100%) rename network/{robus => robus_network}/inc/transmission.h (98%) create mode 100644 network/robus_network/library.json rename network/{robus => robus_network}/robus_config.h (100%) create mode 100644 network/robus_network/robus_select_hal_script.py rename network/{robus => robus_network}/selftest/selftest.c (100%) rename network/{robus => robus_network}/selftest/selftest.h (94%) rename network/{robus => robus_network}/src/port_manager.c (100%) rename network/{robus => robus_network}/src/reception.c (99%) rename network/{robus => robus_network}/src/robus.c (99%) rename network/{robus => robus_network}/src/transmission.c (100%) diff --git a/.github/workflows/pio_release.yml b/.github/workflows/pio_release.yml index 283beacc8..02b511303 100644 --- a/.github/workflows/pio_release.yml +++ b/.github/workflows/pio_release.yml @@ -203,4 +203,29 @@ jobs: pio package pack pio package publish --owner luos --non-interactive - cd ../.. \ No newline at end of file + cd ../.. + + deploy_robus: + needs: check_valid_tag + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install platformio + - name: publish robus network + env: + PLATFORMIO_AUTH_TOKEN: ${{ secrets.PIO_TOKEN }} + run: | + # ***** Robus network publication ***** + cd network/robus_network + # We don't publish examples with this one. + + pio package pack + pio package publish --owner luos --non-interactive + cd ../.. diff --git a/engine/HAL/ATSAMD21/luos_hal.h b/engine/HAL/ATSAMD21/luos_hal.h index 8f52c55e2..5cc8c1498 100644 --- a/engine/HAL/ATSAMD21/luos_hal.h +++ b/engine/HAL/ATSAMD21/luos_hal.h @@ -9,7 +9,8 @@ #define _LUOSHAL_H_ #include -#include +#include +#include "luos_hal_config.h" /******************************************************************************* * Definitions diff --git a/engine/HAL/ATSAMD21_ARDUINO/luos_hal.h b/engine/HAL/ATSAMD21_ARDUINO/luos_hal.h index 633f3ca82..d1a4da706 100644 --- a/engine/HAL/ATSAMD21_ARDUINO/luos_hal.h +++ b/engine/HAL/ATSAMD21_ARDUINO/luos_hal.h @@ -9,7 +9,8 @@ #define _LUOSHAL_H_ #include -#include +#include +#include "luos_hal_config.h" /******************************************************************************* * Definitions diff --git a/engine/HAL/ATSAMD21_MBED/luos_hal.h b/engine/HAL/ATSAMD21_MBED/luos_hal.h index 1339001c5..27490509a 100644 --- a/engine/HAL/ATSAMD21_MBED/luos_hal.h +++ b/engine/HAL/ATSAMD21_MBED/luos_hal.h @@ -9,7 +9,8 @@ #define _LUOSHAL_H_ #include -#include +#include +#include "luos_hal_config.h" /******************************************************************************* * Definitions diff --git a/engine/HAL/ESP32/luos_hal.h b/engine/HAL/ESP32/luos_hal.h index 4879fa6d5..e46e2189d 100644 --- a/engine/HAL/ESP32/luos_hal.h +++ b/engine/HAL/ESP32/luos_hal.h @@ -10,7 +10,8 @@ #include #include -#include +#include +#include "luos_hal_config.h" /******************************************************************************* * Definitions diff --git a/engine/HAL/NATIVE/luos_hal.h b/engine/HAL/NATIVE/luos_hal.h index 7b9197938..048a0b86f 100644 --- a/engine/HAL/NATIVE/luos_hal.h +++ b/engine/HAL/NATIVE/luos_hal.h @@ -9,7 +9,8 @@ #define _LUOSHAL_H_ #include -#include +#include +#include "luos_hal_config.h" /******************************************************************************* * Definitions diff --git a/engine/HAL/STM32F0/luos_hal.h b/engine/HAL/STM32F0/luos_hal.h index ed025b244..585376cfe 100644 --- a/engine/HAL/STM32F0/luos_hal.h +++ b/engine/HAL/STM32F0/luos_hal.h @@ -10,7 +10,8 @@ #include #include -#include +#include +#include "luos_hal_config.h" /******************************************************************************* * Definitions diff --git a/engine/HAL/STM32F4/luos_hal.c b/engine/HAL/STM32F4/luos_hal.c index b9663aa79..05decfa0a 100644 --- a/engine/HAL/STM32F4/luos_hal.c +++ b/engine/HAL/STM32F4/luos_hal.c @@ -9,8 +9,6 @@ #include #include -#include "reception.h" -#include "context.h" // MCU dependencies this HAL is for family STM32F4 you can find // the HAL stm32cubeF4 on ST web site @@ -311,7 +309,7 @@ void LuosHAL_EraseMemory(uint32_t address, uint16_t size) /****************************************************************************** * @brief Programm flash memory - * @param address : Start address + * @param address : Start address * @param size :: Data size * @param data : Pointer to data * @return diff --git a/engine/HAL/STM32F4/luos_hal.h b/engine/HAL/STM32F4/luos_hal.h index 7620be074..834e312b6 100644 --- a/engine/HAL/STM32F4/luos_hal.h +++ b/engine/HAL/STM32F4/luos_hal.h @@ -9,7 +9,8 @@ #define _LUOSHAL_H_ #include -#include +#include +#include "luos_hal_config.h" /******************************************************************************* * Definitions diff --git a/engine/HAL/STM32G4/luos_hal.h b/engine/HAL/STM32G4/luos_hal.h index c4ca99bbf..a15ffcd97 100644 --- a/engine/HAL/STM32G4/luos_hal.h +++ b/engine/HAL/STM32G4/luos_hal.h @@ -9,7 +9,8 @@ #define _LUOSHAL_H_ #include -#include +#include +#include "luos_hal_config.h" /******************************************************************************* * Definitions diff --git a/engine/HAL/STM32L0/luos_hal.h b/engine/HAL/STM32L0/luos_hal.h index ed025b244..585376cfe 100644 --- a/engine/HAL/STM32L0/luos_hal.h +++ b/engine/HAL/STM32L0/luos_hal.h @@ -10,7 +10,8 @@ #include #include -#include +#include +#include "luos_hal_config.h" /******************************************************************************* * Definitions diff --git a/engine/HAL/STM32L4/luos_hal.h b/engine/HAL/STM32L4/luos_hal.h index dd5a269c0..c5d384281 100644 --- a/engine/HAL/STM32L4/luos_hal.h +++ b/engine/HAL/STM32L4/luos_hal.h @@ -9,7 +9,8 @@ #define _LUOSHAL_H_ #include -#include +#include +#include "luos_hal_config.h" /******************************************************************************* * Definitions diff --git a/engine/HAL/STUB/luos_hal.h b/engine/HAL/STUB/luos_hal.h index 3a4d225a0..57ae667a3 100644 --- a/engine/HAL/STUB/luos_hal.h +++ b/engine/HAL/STUB/luos_hal.h @@ -9,7 +9,8 @@ #define _LUOSHAL_H_ #include -#include +#include +#include "luos_hal_config.h" /******************************************************************************* * Definitions diff --git a/engine/HAL/template/luos_hal.h b/engine/HAL/template/luos_hal.h index 3fddd712e..fdf3fa0c3 100644 --- a/engine/HAL/template/luos_hal.h +++ b/engine/HAL/template/luos_hal.h @@ -9,7 +9,8 @@ #define _LUOSHAL_H_ #include -#include +#include +#include "luos_hal_config.h" /******************************************************************************* * Definitions diff --git a/engine/core/src/luos_utils.c b/engine/core/src/luos_utils.c index 6be1d9b30..31ffd4281 100644 --- a/engine/core/src/luos_utils.c +++ b/engine/core/src/luos_utils.c @@ -7,7 +7,6 @@ #include #include "luos_utils.h" #include "luos_engine.h" -#include "port_manager.h" #include "string.h" #include "luos_hal.h" #include "msg_alloc.h" diff --git a/examples/apps/alarm_controller/alarm_controller.h b/examples/apps/alarm_controller/alarm_controller.h index e9a7b934f..f174d4f3c 100644 --- a/examples/apps/alarm_controller/alarm_controller.h +++ b/examples/apps/alarm_controller/alarm_controller.h @@ -8,7 +8,7 @@ #define ALARM_CONTROLLER_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/apps/biometric-security/biometric_security.h b/examples/apps/biometric-security/biometric_security.h index 811c318cf..5295232e4 100644 --- a/examples/apps/biometric-security/biometric_security.h +++ b/examples/apps/biometric-security/biometric_security.h @@ -11,7 +11,7 @@ #define BIOMETRIC_SECURITY_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/apps/start_controller/start_controller.h b/examples/apps/start_controller/start_controller.h index c8397fba6..6fe730e50 100644 --- a/examples/apps/start_controller/start_controller.h +++ b/examples/apps/start_controller/start_controller.h @@ -8,7 +8,7 @@ #define START_CONTROLLER_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/Arduino/bldc_simple_foc/platformio.ini b/examples/projects/Arduino/bldc_simple_foc/platformio.ini index de67301e1..baf4ea7be 100644 --- a/examples/projects/Arduino/bldc_simple_foc/platformio.ini +++ b/examples/projects/Arduino/bldc_simple_foc/platformio.ini @@ -15,12 +15,15 @@ framework = arduino platform_packages = framework-arduino-samd@https://github.com/Luos-io/Arduino_core.git lib_archive = false build_unflags = -Os -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ build_flags = -O1 -include node_config.h -DLUOSHAL=ATSAMD21_ARDUINO lib_deps = luos_engine@^3.0.0 + robus_network SimpleFOC_Motor askuric/Simple FOC@^2.2.1 diff --git a/examples/projects/Arduino/bldc_simple_foc/src/SimpleFOC.cpp b/examples/projects/Arduino/bldc_simple_foc/src/SimpleFOC.cpp index 924a9033f..5552a43e8 100644 --- a/examples/projects/Arduino/bldc_simple_foc/src/SimpleFOC.cpp +++ b/examples/projects/Arduino/bldc_simple_foc/src/SimpleFOC.cpp @@ -7,7 +7,7 @@ extern "C" #endif #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #ifdef __cplusplus } diff --git a/examples/projects/Arduino/button/lib/button/button.h b/examples/projects/Arduino/button/lib/button/button.h index 64d92f652..19367b3fb 100644 --- a/examples/projects/Arduino/button/lib/button/button.h +++ b/examples/projects/Arduino/button/lib/button/button.h @@ -8,7 +8,6 @@ #define BUTTON_H #include "luos_engine.h" -#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/Arduino/button/platformio.ini b/examples/projects/Arduino/button/platformio.ini index 908bf67b0..1ce8c45dd 100644 --- a/examples/projects/Arduino/button/platformio.ini +++ b/examples/projects/Arduino/button/platformio.ini @@ -24,7 +24,9 @@ default_envs = zero [env] -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ lib_ldf_mode =off platform = atmelsam framework = arduino @@ -35,6 +37,7 @@ build_flags = -D LUOSHAL=ATSAMD21_ARDUINO lib_deps = luos_engine@^3.0.0 + robus_network Button diff --git a/examples/projects/Arduino/button/src/Button.cpp b/examples/projects/Arduino/button/src/Button.cpp index 93080432c..e6a55c41d 100644 --- a/examples/projects/Arduino/button/src/Button.cpp +++ b/examples/projects/Arduino/button/src/Button.cpp @@ -6,7 +6,7 @@ extern "C" #endif #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" #ifdef __cplusplus diff --git a/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint.h b/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint.h index ded9ac68f..949b40047 100644 --- a/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint.h +++ b/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint.h @@ -11,7 +11,7 @@ #define FINGERPRINT_H_ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint_drv.h b/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint_drv.h index be8182923..f1236f7a3 100644 --- a/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint_drv.h +++ b/examples/projects/Arduino/fingerprint/lib/Fingerprint/fingerprint_drv.h @@ -11,7 +11,7 @@ #define FINGERPRINT_DRV_H_ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/Arduino/fingerprint/platformio.ini b/examples/projects/Arduino/fingerprint/platformio.ini index 781fdf74d..eb7286570 100644 --- a/examples/projects/Arduino/fingerprint/platformio.ini +++ b/examples/projects/Arduino/fingerprint/platformio.ini @@ -9,7 +9,9 @@ ; https://docs.platformio.org/page/projectconf.html [env:zero] -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ lib_ldf_mode =off platform = atmelsam board = mkrzero @@ -22,5 +24,6 @@ build_flags = -D LUOSHAL=ATSAMD21_ARDUINO lib_deps = luos_engine@^3.0.0 + robus_network Fingerprint adafruit/Adafruit Fingerprint Sensor Library diff --git a/examples/projects/Arduino/fingerprint/src/Fingerprint.cpp b/examples/projects/Arduino/fingerprint/src/Fingerprint.cpp index cbadecb74..925d5b3b5 100644 --- a/examples/projects/Arduino/fingerprint/src/Fingerprint.cpp +++ b/examples/projects/Arduino/fingerprint/src/Fingerprint.cpp @@ -6,7 +6,7 @@ extern "C" #endif #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "fingerprint.h" #ifdef __cplusplus diff --git a/examples/projects/Arduino/gate_serialcom/platformio.ini b/examples/projects/Arduino/gate_serialcom/platformio.ini index 37f3e59b3..6d63ca1b0 100644 --- a/examples/projects/Arduino/gate_serialcom/platformio.ini +++ b/examples/projects/Arduino/gate_serialcom/platformio.ini @@ -26,6 +26,7 @@ default_envs = zero [env] lib_extra_dirs = $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ $PROJECT_DIR/../../../../tool_services/ lib_ldf_mode =off platform = atmelsam @@ -40,6 +41,7 @@ build_flags = -D PIPEHAL=ARDUINO lib_deps = luos_engine@^3.0.0 + robus_network Gate Pipe diff --git a/examples/projects/Arduino/gate_serialcom/src/Gate_SerialCom.cpp b/examples/projects/Arduino/gate_serialcom/src/Gate_SerialCom.cpp index c97fb2e9c..c2984e608 100644 --- a/examples/projects/Arduino/gate_serialcom/src/Gate_SerialCom.cpp +++ b/examples/projects/Arduino/gate_serialcom/src/Gate_SerialCom.cpp @@ -9,7 +9,7 @@ extern "C" #include #include #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #ifdef __cplusplus } diff --git a/examples/projects/Arduino/inspector_serialcom/platformio.ini b/examples/projects/Arduino/inspector_serialcom/platformio.ini index df7796fda..faccca291 100644 --- a/examples/projects/Arduino/inspector_serialcom/platformio.ini +++ b/examples/projects/Arduino/inspector_serialcom/platformio.ini @@ -28,6 +28,7 @@ default_envs = zero [env] lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ + $PROJECT_DIR/../../../../network/ $PROJECT_DIR/../../../../../ lib_ldf_mode =off platform = atmelsam @@ -42,6 +43,7 @@ build_flags = -D PIPEHAL=ARDUINO lib_deps = luos_engine@^3.0.0 + robus_network Inspector Pipe diff --git a/examples/projects/Arduino/inspector_serialcom/src/Inspector_SerialCom.cpp b/examples/projects/Arduino/inspector_serialcom/src/Inspector_SerialCom.cpp index 46592bb80..05d9dea4b 100644 --- a/examples/projects/Arduino/inspector_serialcom/src/Inspector_SerialCom.cpp +++ b/examples/projects/Arduino/inspector_serialcom/src/Inspector_SerialCom.cpp @@ -9,7 +9,7 @@ extern "C" #include #include #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #ifdef __cplusplus } diff --git a/examples/projects/Arduino/lcd/lib/Lcd/lcd.h b/examples/projects/Arduino/lcd/lib/Lcd/lcd.h index 9b5d05d67..f124ad84e 100644 --- a/examples/projects/Arduino/lcd/lib/Lcd/lcd.h +++ b/examples/projects/Arduino/lcd/lib/Lcd/lcd.h @@ -10,7 +10,7 @@ #define LCD_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/Arduino/lcd/platformio.ini b/examples/projects/Arduino/lcd/platformio.ini index 7fc829f52..204acb1d3 100644 --- a/examples/projects/Arduino/lcd/platformio.ini +++ b/examples/projects/Arduino/lcd/platformio.ini @@ -9,7 +9,9 @@ ; https://docs.platformio.org/page/projectconf.html [env:zero] -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ lib_ldf_mode =off platform = atmelsam board = mkrzero @@ -22,5 +24,6 @@ build_flags = -D LUOSHAL=ATSAMD21_ARDUINO lib_deps = luos_engine@^3.0.0 + robus_network Lcd arduino-libraries/LiquidCrystal diff --git a/examples/projects/Arduino/lcd/src/Lcd.cpp b/examples/projects/Arduino/lcd/src/Lcd.cpp index 83ad115f1..abe3f9636 100644 --- a/examples/projects/Arduino/lcd/src/Lcd.cpp +++ b/examples/projects/Arduino/lcd/src/Lcd.cpp @@ -6,7 +6,7 @@ extern "C" #endif #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "lcd.h" #ifdef __cplusplus diff --git a/examples/projects/Arduino/led/lib/led/led.h b/examples/projects/Arduino/led/lib/led/led.h index 4a8a99bf4..e606ea77c 100644 --- a/examples/projects/Arduino/led/lib/led/led.h +++ b/examples/projects/Arduino/led/lib/led/led.h @@ -8,7 +8,7 @@ #define LED_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/Arduino/led/platformio.ini b/examples/projects/Arduino/led/platformio.ini index 6d0df747a..86a753ab2 100644 --- a/examples/projects/Arduino/led/platformio.ini +++ b/examples/projects/Arduino/led/platformio.ini @@ -24,7 +24,9 @@ default_envs = zero [env] -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ lib_ldf_mode =off platform = atmelsam framework = arduino @@ -35,6 +37,7 @@ build_flags = -D LUOSHAL=ATSAMD21_ARDUINO lib_deps = luos_engine@^3.0.0 + robus_network Led diff --git a/examples/projects/Arduino/led/src/led.cpp b/examples/projects/Arduino/led/src/led.cpp index a879f45c8..b005406a1 100644 --- a/examples/projects/Arduino/led/src/led.cpp +++ b/examples/projects/Arduino/led/src/led.cpp @@ -6,7 +6,7 @@ extern "C" #endif #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "led.h" #ifdef __cplusplus diff --git a/examples/projects/Arduino/servo_motor/lib/Servo_motor/servo_drv.h b/examples/projects/Arduino/servo_motor/lib/Servo_motor/servo_drv.h index dbf92462b..9bd58947c 100644 --- a/examples/projects/Arduino/servo_motor/lib/Servo_motor/servo_drv.h +++ b/examples/projects/Arduino/servo_motor/lib/Servo_motor/servo_drv.h @@ -10,7 +10,7 @@ #define SERVO_DRV_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/Arduino/servo_motor/platformio.ini b/examples/projects/Arduino/servo_motor/platformio.ini index 1cff8c025..7a8a02f76 100644 --- a/examples/projects/Arduino/servo_motor/platformio.ini +++ b/examples/projects/Arduino/servo_motor/platformio.ini @@ -24,7 +24,9 @@ default_envs = zero [env] -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ lib_ldf_mode =off platform = atmelsam framework = arduino @@ -35,6 +37,7 @@ build_flags = -D LUOSHAL=ATSAMD21_ARDUINO lib_deps = luos_engine@^3.0.0 + robus_network arduino-libraries/Servo@^1.1.8 servo_motor diff --git a/examples/projects/Arduino/servo_motor/src/Servo_motor.cpp b/examples/projects/Arduino/servo_motor/src/Servo_motor.cpp index a85e4691b..e8be7fa1f 100644 --- a/examples/projects/Arduino/servo_motor/src/Servo_motor.cpp +++ b/examples/projects/Arduino/servo_motor/src/Servo_motor.cpp @@ -6,7 +6,7 @@ extern "C" #endif #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "servo_motor.h" #ifdef __cplusplus diff --git a/examples/projects/Arduino/stepper_simple_foc/platformio.ini b/examples/projects/Arduino/stepper_simple_foc/platformio.ini index 552cc4a09..11dd13e37 100644 --- a/examples/projects/Arduino/stepper_simple_foc/platformio.ini +++ b/examples/projects/Arduino/stepper_simple_foc/platformio.ini @@ -15,12 +15,15 @@ framework = arduino platform_packages = framework-arduino-samd@https://github.com/Luos-io/Arduino_core.git lib_archive = false build_unflags = -Os -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ build_flags = -O1 -include node_config.h -D LUOSHAL=ATSAMD21_ARDUINO lib_deps = luos_engine@^3.0.0 + robus_network SimpleFOC_Stepper askuric/Simple FOC@^2.2.1 diff --git a/examples/projects/Arduino/stepper_simple_foc/src/SimpleFOC.cpp b/examples/projects/Arduino/stepper_simple_foc/src/SimpleFOC.cpp index 54e5b557f..da7fac285 100644 --- a/examples/projects/Arduino/stepper_simple_foc/src/SimpleFOC.cpp +++ b/examples/projects/Arduino/stepper_simple_foc/src/SimpleFOC.cpp @@ -9,7 +9,7 @@ extern "C" #endif #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #ifdef __cplusplus } diff --git a/examples/projects/ESP32/button/lib/button/button.h b/examples/projects/ESP32/button/lib/button/button.h index 510616eca..391034b43 100644 --- a/examples/projects/ESP32/button/lib/button/button.h +++ b/examples/projects/ESP32/button/lib/button/button.h @@ -8,7 +8,7 @@ #define BUTTON_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/ESP32/button/platformio.ini b/examples/projects/ESP32/button/platformio.ini index 7cb793ba9..95c4afe72 100644 --- a/examples/projects/ESP32/button/platformio.ini +++ b/examples/projects/ESP32/button/platformio.ini @@ -13,7 +13,9 @@ default_envs = esp32dev [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ framework = espidf platform = espressif32@^5.3.0 build_unflags = -Os @@ -23,6 +25,7 @@ build_flags = -O1 lib_deps = luos_engine@^3.0.0 + robus_network button [env:esp32dev] diff --git a/examples/projects/ESP32/button/src/main.c b/examples/projects/ESP32/button/src/main.c index 43d1137f4..6bd58ae07 100644 --- a/examples/projects/ESP32/button/src/main.c +++ b/examples/projects/ESP32/button/src/main.c @@ -7,7 +7,7 @@ CONDITIONS OF ANY KIND, either express or implied. */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" void app_main(void) diff --git a/examples/projects/ESP32/button_arduino/lib/button/button.h b/examples/projects/ESP32/button_arduino/lib/button/button.h index 510616eca..391034b43 100644 --- a/examples/projects/ESP32/button_arduino/lib/button/button.h +++ b/examples/projects/ESP32/button_arduino/lib/button/button.h @@ -8,7 +8,7 @@ #define BUTTON_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/ESP32/button_arduino/platformio.ini b/examples/projects/ESP32/button_arduino/platformio.ini index 68640c929..2f6407f58 100644 --- a/examples/projects/ESP32/button_arduino/platformio.ini +++ b/examples/projects/ESP32/button_arduino/platformio.ini @@ -13,7 +13,9 @@ default_envs = esp32dev [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = espressif32@^5.3.0 framework = arduino, espidf build_unflags = -Os @@ -23,6 +25,7 @@ build_flags = -O1 lib_deps = luos_engine@^3.0.0 + robus_network button [env:esp32dev] diff --git a/examples/projects/ESP32/button_arduino/src/main.cpp b/examples/projects/ESP32/button_arduino/src/main.cpp index c4c0bc049..be1325fcc 100644 --- a/examples/projects/ESP32/button_arduino/src/main.cpp +++ b/examples/projects/ESP32/button_arduino/src/main.cpp @@ -6,7 +6,7 @@ extern "C" #endif #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" #ifdef __cplusplus diff --git a/examples/projects/ESP32/gate_serialcom/platformio.ini b/examples/projects/ESP32/gate_serialcom/platformio.ini index 8f63cc0dc..ac24a9816 100644 --- a/examples/projects/ESP32/gate_serialcom/platformio.ini +++ b/examples/projects/ESP32/gate_serialcom/platformio.ini @@ -15,6 +15,7 @@ default_envs = esp32dev lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ $PROJECT_DIR/../../../../tool_services/ platform = espressif32@^5.3.0 framework = espidf @@ -28,6 +29,7 @@ build_flags = -O1 lib_deps = luos_engine@^3.0.0 + robus_network Gate Pipe diff --git a/examples/projects/ESP32/gate_serialcom/src/main.c b/examples/projects/ESP32/gate_serialcom/src/main.c index 283f95390..c2a21a948 100644 --- a/examples/projects/ESP32/gate_serialcom/src/main.c +++ b/examples/projects/ESP32/gate_serialcom/src/main.c @@ -1,6 +1,6 @@ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "pipe.h" #include "gate.h" diff --git a/examples/projects/ESP32/gate_serialcom_arduino/platformio.ini b/examples/projects/ESP32/gate_serialcom_arduino/platformio.ini index 6e9f1a8b8..93dc5a7c1 100644 --- a/examples/projects/ESP32/gate_serialcom_arduino/platformio.ini +++ b/examples/projects/ESP32/gate_serialcom_arduino/platformio.ini @@ -15,6 +15,7 @@ default_envs = esp32dev lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ $PROJECT_DIR/../../../../tool_services/ platform = espressif32@^5.3.0 framework = arduino, espidf @@ -28,6 +29,7 @@ build_flags = -O1 lib_deps = luos_engine@^3.0.0 + robus_network Gate Pipe diff --git a/examples/projects/ESP32/gate_serialcom_arduino/src/main.cpp b/examples/projects/ESP32/gate_serialcom_arduino/src/main.cpp index 8b6383ed5..ac21a5e91 100644 --- a/examples/projects/ESP32/gate_serialcom_arduino/src/main.cpp +++ b/examples/projects/ESP32/gate_serialcom_arduino/src/main.cpp @@ -6,7 +6,7 @@ extern "C" #endif #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "pipe.h" #include "gate.h" diff --git a/examples/projects/ESP32/gate_wscom/platformio.ini b/examples/projects/ESP32/gate_wscom/platformio.ini index 381a07616..6dd7bf6eb 100644 --- a/examples/projects/ESP32/gate_wscom/platformio.ini +++ b/examples/projects/ESP32/gate_wscom/platformio.ini @@ -15,6 +15,7 @@ default_envs = esp32dev lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ $PROJECT_DIR/../../../../tool_services/ platform = espressif32@^5.3.0 framework = espidf @@ -28,6 +29,7 @@ build_flags = -O1 lib_deps = luos_engine + robus_network Gate Pipe diff --git a/examples/projects/ESP32/gate_wscom/src/main.c b/examples/projects/ESP32/gate_wscom/src/main.c index 283f95390..c2a21a948 100644 --- a/examples/projects/ESP32/gate_wscom/src/main.c +++ b/examples/projects/ESP32/gate_wscom/src/main.c @@ -1,6 +1,6 @@ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "pipe.h" #include "gate.h" diff --git a/examples/projects/ESP32/gate_wscom_arduino/platformio.ini b/examples/projects/ESP32/gate_wscom_arduino/platformio.ini index 4142fb168..be521e201 100644 --- a/examples/projects/ESP32/gate_wscom_arduino/platformio.ini +++ b/examples/projects/ESP32/gate_wscom_arduino/platformio.ini @@ -15,6 +15,7 @@ default_envs = esp32dev lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ $PROJECT_DIR/../../../../tool_services/ platform = espressif32@^5.3.0 framework = arduino, espidf @@ -28,6 +29,7 @@ build_flags = -O1 lib_deps = luos_engine + robus_network Gate Pipe diff --git a/examples/projects/ESP32/gate_wscom_arduino/src/main.cpp b/examples/projects/ESP32/gate_wscom_arduino/src/main.cpp index 8b6383ed5..ac21a5e91 100644 --- a/examples/projects/ESP32/gate_wscom_arduino/src/main.cpp +++ b/examples/projects/ESP32/gate_wscom_arduino/src/main.cpp @@ -6,7 +6,7 @@ extern "C" #endif #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "pipe.h" #include "gate.h" diff --git a/examples/projects/ESP32/led/lib/led/led.h b/examples/projects/ESP32/led/lib/led/led.h index a0cf02055..d277b08b9 100644 --- a/examples/projects/ESP32/led/lib/led/led.h +++ b/examples/projects/ESP32/led/lib/led/led.h @@ -8,7 +8,7 @@ #define LED_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/ESP32/led/platformio.ini b/examples/projects/ESP32/led/platformio.ini index 3dc151cd2..972985785 100644 --- a/examples/projects/ESP32/led/platformio.ini +++ b/examples/projects/ESP32/led/platformio.ini @@ -13,7 +13,9 @@ default_envs = esp32dev [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ framework = espidf platform = espressif32@^5.3.0 build_unflags = -Os @@ -23,6 +25,7 @@ build_flags = -O1 lib_deps = luos_engine@^3.0.0 + robus_network led [env:esp32dev] diff --git a/examples/projects/ESP32/led/src/main.c b/examples/projects/ESP32/led/src/main.c index 3ab197bf1..033bb7c60 100644 --- a/examples/projects/ESP32/led/src/main.c +++ b/examples/projects/ESP32/led/src/main.c @@ -1,5 +1,5 @@ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "led.h" void app_main(void) diff --git a/examples/projects/NUCLEO-F072RB/barometer/lib/barometer/BMP280.h b/examples/projects/NUCLEO-F072RB/barometer/lib/barometer/BMP280.h index 7cfb417c6..9d3563ef3 100644 --- a/examples/projects/NUCLEO-F072RB/barometer/lib/barometer/BMP280.h +++ b/examples/projects/NUCLEO-F072RB/barometer/lib/barometer/BMP280.h @@ -2,7 +2,7 @@ #define __BMP280_H__ #include "SPI_Driver.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" void BMP280_Init(); void BMP280_Loop(); diff --git a/examples/projects/NUCLEO-F072RB/barometer/platformio.ini b/examples/projects/NUCLEO-F072RB/barometer/platformio.ini index 89766d243..38eb09b70 100644 --- a/examples/projects/NUCLEO-F072RB/barometer/platformio.ini +++ b/examples/projects/NUCLEO-F072RB/barometer/platformio.ini @@ -25,9 +25,11 @@ build_flags = -DLUOSHAL=STM32F0 lib_deps = luos_engine@^3.0.0 + robus_network barometer lib_extra_dirs = $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-F072RB/barometer/src/main.c b/examples/projects/NUCLEO-F072RB/barometer/src/main.c index ce9534c64..ddb8f70d1 100644 --- a/examples/projects/NUCLEO-F072RB/barometer/src/main.c +++ b/examples/projects/NUCLEO-F072RB/barometer/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "BMP280.h" void SystemClock_Config(void); diff --git a/examples/projects/NUCLEO-F072RB/bootloader/platformio.ini b/examples/projects/NUCLEO-F072RB/bootloader/platformio.ini index 97f0ff483..a4aaf4315 100644 --- a/examples/projects/NUCLEO-F072RB/bootloader/platformio.ini +++ b/examples/projects/NUCLEO-F072RB/bootloader/platformio.ini @@ -13,10 +13,13 @@ default_envs = nucleo_f072rb [env] platform = ststm32 board = nucleo_f072rb -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network [env:nucleo_f072rb] board_build.ldscript = linker/custom_bootloader_script.ld diff --git a/examples/projects/NUCLEO-F072RB/bootloader/src/main.c b/examples/projects/NUCLEO-F072RB/bootloader/src/main.c index e28b42e18..24e3a531c 100644 --- a/examples/projects/NUCLEO-F072RB/bootloader/src/main.c +++ b/examples/projects/NUCLEO-F072RB/bootloader/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_bootloader.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F072RB/button/platformio.ini b/examples/projects/NUCLEO-F072RB/button/platformio.ini index d3d17ca6e..935de08f2 100644 --- a/examples/projects/NUCLEO-F072RB/button/platformio.ini +++ b/examples/projects/NUCLEO-F072RB/button/platformio.ini @@ -13,12 +13,15 @@ default_envs = nucleo_f072rb [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f072rb framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Button debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-F072RB/button/src/main.c b/examples/projects/NUCLEO-F072RB/button/src/main.c index a6fa48094..c504a1061 100644 --- a/examples/projects/NUCLEO-F072RB/button/src/main.c +++ b/examples/projects/NUCLEO-F072RB/button/src/main.c @@ -25,7 +25,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F072RB/dc_motor/lib/DC_motor/dc_motor_drv.h b/examples/projects/NUCLEO-F072RB/dc_motor/lib/DC_motor/dc_motor_drv.h index c101e7f81..7b07fbcdf 100644 --- a/examples/projects/NUCLEO-F072RB/dc_motor/lib/DC_motor/dc_motor_drv.h +++ b/examples/projects/NUCLEO-F072RB/dc_motor/lib/DC_motor/dc_motor_drv.h @@ -8,7 +8,7 @@ #define DC_MOTOR_DRV_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "stm32f0xx_hal.h" /******************************************************************************* * Definitions diff --git a/examples/projects/NUCLEO-F072RB/dc_motor/platformio.ini b/examples/projects/NUCLEO-F072RB/dc_motor/platformio.ini index 9fa4ce4fb..a1d14e443 100644 --- a/examples/projects/NUCLEO-F072RB/dc_motor/platformio.ini +++ b/examples/projects/NUCLEO-F072RB/dc_motor/platformio.ini @@ -13,12 +13,15 @@ default_envs = nucleo_f072rb [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f072rb framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network DC_motor debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-F072RB/dc_motor/src/main.c b/examples/projects/NUCLEO-F072RB/dc_motor/src/main.c index 4691dadc3..9df6d67b3 100644 --- a/examples/projects/NUCLEO-F072RB/dc_motor/src/main.c +++ b/examples/projects/NUCLEO-F072RB/dc_motor/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "dc_motor.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F072RB/gate_serialcom/platformio.ini b/examples/projects/NUCLEO-F072RB/gate_serialcom/platformio.ini index 6b4a847b4..75cc366a2 100644 --- a/examples/projects/NUCLEO-F072RB/gate_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-F072RB/gate_serialcom/platformio.ini @@ -16,11 +16,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f072rb framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Pipe Gate debug_tool = stlink diff --git a/examples/projects/NUCLEO-F072RB/gate_serialcom/src/main.c b/examples/projects/NUCLEO-F072RB/gate_serialcom/src/main.c index 81f960717..de628a1a6 100644 --- a/examples/projects/NUCLEO-F072RB/gate_serialcom/src/main.c +++ b/examples/projects/NUCLEO-F072RB/gate_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "pipe.h" #include "gate.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-F072RB/inspector_serialcom/platformio.ini index a9f2ccdc1..a41be0c2a 100644 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-F072RB/inspector_serialcom/platformio.ini @@ -16,11 +16,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f072rb framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Inspector Pipe debug_tool = stlink diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/main.c index cb5939a8f..960d5fb1b 100644 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/main.c +++ b/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "pipe.h" #include "inspector.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.h b/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.h index 65a31b04d..f169709f5 100644 --- a/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.h +++ b/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer.h @@ -2,7 +2,7 @@ #define POTENTIOMETER_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "potentiometer_drv.h" /******************************************************************************* diff --git a/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer_drv.h b/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer_drv.h index bfdaf2ef3..d85c49424 100644 --- a/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer_drv.h +++ b/examples/projects/NUCLEO-F072RB/potentiometer/lib/Potentiometer/potentiometer_drv.h @@ -7,7 +7,7 @@ #include "main.h" #include "analog.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F072RB/potentiometer/platformio.ini b/examples/projects/NUCLEO-F072RB/potentiometer/platformio.ini index ce51dbf59..8dd3b9485 100644 --- a/examples/projects/NUCLEO-F072RB/potentiometer/platformio.ini +++ b/examples/projects/NUCLEO-F072RB/potentiometer/platformio.ini @@ -13,12 +13,15 @@ default_envs = nucleo_f072rb [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f072rb framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Potentiometer debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-F072RB/potentiometer/src/main.c b/examples/projects/NUCLEO-F072RB/potentiometer/src/main.c index d1f007892..ecf01b4cd 100644 --- a/examples/projects/NUCLEO-F072RB/potentiometer/src/main.c +++ b/examples/projects/NUCLEO-F072RB/potentiometer/src/main.c @@ -25,7 +25,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "potentiometer.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F401RE/bootloader/platformio.ini b/examples/projects/NUCLEO-F401RE/bootloader/platformio.ini index 47514092f..20b46fb7c 100644 --- a/examples/projects/NUCLEO-F401RE/bootloader/platformio.ini +++ b/examples/projects/NUCLEO-F401RE/bootloader/platformio.ini @@ -13,10 +13,13 @@ default_envs = nucleo_f401re [env] platform = ststm32 board = nucleo_f401re -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network [env:nucleo_f401re] board_build.ldscript = linker/custom_bootloader_script.ld diff --git a/examples/projects/NUCLEO-F401RE/bootloader/src/main.c b/examples/projects/NUCLEO-F401RE/bootloader/src/main.c index 372e76128..60d1881a8 100644 --- a/examples/projects/NUCLEO-F401RE/bootloader/src/main.c +++ b/examples/projects/NUCLEO-F401RE/bootloader/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_bootloader.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F401RE/button/lib/Button/button.h b/examples/projects/NUCLEO-F401RE/button/lib/Button/button.h index 510616eca..391034b43 100644 --- a/examples/projects/NUCLEO-F401RE/button/lib/Button/button.h +++ b/examples/projects/NUCLEO-F401RE/button/lib/Button/button.h @@ -8,7 +8,7 @@ #define BUTTON_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F401RE/button/platformio.ini b/examples/projects/NUCLEO-F401RE/button/platformio.ini index 3c207d496..a5858e7cc 100644 --- a/examples/projects/NUCLEO-F401RE/button/platformio.ini +++ b/examples/projects/NUCLEO-F401RE/button/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_f401re [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f401re framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Button debug_tool = stlink diff --git a/examples/projects/NUCLEO-F401RE/button/src/main.c b/examples/projects/NUCLEO-F401RE/button/src/main.c index 2194bbf36..bf478866e 100644 --- a/examples/projects/NUCLEO-F401RE/button/src/main.c +++ b/examples/projects/NUCLEO-F401RE/button/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F401RE/dc_motor/lib/DC_motor/dc_motor_drv.h b/examples/projects/NUCLEO-F401RE/dc_motor/lib/DC_motor/dc_motor_drv.h index e089b1f1f..c49674597 100644 --- a/examples/projects/NUCLEO-F401RE/dc_motor/lib/DC_motor/dc_motor_drv.h +++ b/examples/projects/NUCLEO-F401RE/dc_motor/lib/DC_motor/dc_motor_drv.h @@ -8,7 +8,7 @@ #define DC_MOTOR_DRV_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F401RE/dc_motor/platformio.ini b/examples/projects/NUCLEO-F401RE/dc_motor/platformio.ini index 937296bfa..c3fc7fd55 100644 --- a/examples/projects/NUCLEO-F401RE/dc_motor/platformio.ini +++ b/examples/projects/NUCLEO-F401RE/dc_motor/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_f401re [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f401re framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network DC_motor debug_tool = stlink diff --git a/examples/projects/NUCLEO-F401RE/dc_motor/src/main.c b/examples/projects/NUCLEO-F401RE/dc_motor/src/main.c index ae85a7966..0b824be86 100644 --- a/examples/projects/NUCLEO-F401RE/dc_motor/src/main.c +++ b/examples/projects/NUCLEO-F401RE/dc_motor/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "dc_motor.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F401RE/gate_serialcom/platformio.ini b/examples/projects/NUCLEO-F401RE/gate_serialcom/platformio.ini index a027f30fd..3004779cc 100644 --- a/examples/projects/NUCLEO-F401RE/gate_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-F401RE/gate_serialcom/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f401re framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Gate Pipe debug_tool = stlink diff --git a/examples/projects/NUCLEO-F401RE/gate_serialcom/src/main.c b/examples/projects/NUCLEO-F401RE/gate_serialcom/src/main.c index 12e1fc2c7..e4dca0335 100644 --- a/examples/projects/NUCLEO-F401RE/gate_serialcom/src/main.c +++ b/examples/projects/NUCLEO-F401RE/gate_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-F401RE/inspector_serialcom/platformio.ini index 76b198b3c..650b9b073 100644 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-F401RE/inspector_serialcom/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f401re framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Inspector Pipe debug_tool = stlink diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/main.c index cdb7b5d41..76048bce7 100644 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/main.c +++ b/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "inspector.h" #include "pipe.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F401RE/led/lib/Led/led.h b/examples/projects/NUCLEO-F401RE/led/lib/Led/led.h index 4a8a99bf4..e606ea77c 100644 --- a/examples/projects/NUCLEO-F401RE/led/lib/Led/led.h +++ b/examples/projects/NUCLEO-F401RE/led/lib/Led/led.h @@ -8,7 +8,7 @@ #define LED_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/NUCLEO-F401RE/led/lib/alias_save/alias_save.c b/examples/projects/NUCLEO-F401RE/led/lib/alias_save/alias_save.c index 994c1e7a4..2d5ac2943 100644 --- a/examples/projects/NUCLEO-F401RE/led/lib/alias_save/alias_save.c +++ b/examples/projects/NUCLEO-F401RE/led/lib/alias_save/alias_save.c @@ -7,7 +7,7 @@ #include "main.h" #include "alias_save.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "string.h" /******************************************************************************* @@ -35,7 +35,7 @@ int Alias_read(int slot, char *alias) * @param size the size of the alias * @return none ******************************************************************************/ -void Alias_write(int slot, char *alias, size_t size) +void Alias_write(int slot, const uint8_t *alias, size_t size) { if (size > MAX_ALIAS_SIZE) { diff --git a/examples/projects/NUCLEO-F401RE/led/lib/alias_save/alias_save.h b/examples/projects/NUCLEO-F401RE/led/lib/alias_save/alias_save.h index e18aa2c06..694bcb14c 100644 --- a/examples/projects/NUCLEO-F401RE/led/lib/alias_save/alias_save.h +++ b/examples/projects/NUCLEO-F401RE/led/lib/alias_save/alias_save.h @@ -7,6 +7,8 @@ #ifndef ALIAS_SAVE_H #define ALIAS_SAVE_H +#include + /******************************************************************************* * FLASH CONFIG ******************************************************************************/ @@ -24,6 +26,6 @@ * Function ******************************************************************************/ int Alias_read(int slot, char *alias); -void Alias_write(int slot, char *alias, size_t size); +void Alias_write(int slot, const uint8_t *alias, size_t size); #endif /* ALIAS_SAVE_H */ diff --git a/examples/projects/NUCLEO-F401RE/led/platformio.ini b/examples/projects/NUCLEO-F401RE/led/platformio.ini index 70a224174..e52e2e13d 100644 --- a/examples/projects/NUCLEO-F401RE/led/platformio.ini +++ b/examples/projects/NUCLEO-F401RE/led/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_f401re [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f401re framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Led debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-F401RE/led/src/main.c b/examples/projects/NUCLEO-F401RE/led/src/main.c index 9d3d7daac..c5d9ee593 100644 --- a/examples/projects/NUCLEO-F401RE/led/src/main.c +++ b/examples/projects/NUCLEO-F401RE/led/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "led.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.h b/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.h index 65a31b04d..f169709f5 100644 --- a/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.h +++ b/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer.h @@ -2,7 +2,7 @@ #define POTENTIOMETER_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "potentiometer_drv.h" /******************************************************************************* diff --git a/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer_drv.h b/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer_drv.h index 5d41c5a65..9b5f007ab 100644 --- a/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer_drv.h +++ b/examples/projects/NUCLEO-F401RE/potentiometer/lib/Potentiometer/potentiometer_drv.h @@ -7,7 +7,7 @@ #include "main.h" #include "analog.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F401RE/potentiometer/platformio.ini b/examples/projects/NUCLEO-F401RE/potentiometer/platformio.ini index df9c27d63..8b5d6260d 100644 --- a/examples/projects/NUCLEO-F401RE/potentiometer/platformio.ini +++ b/examples/projects/NUCLEO-F401RE/potentiometer/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_f401re [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f401re framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Potentiometer debug_tool = stlink diff --git a/examples/projects/NUCLEO-F401RE/potentiometer/src/main.c b/examples/projects/NUCLEO-F401RE/potentiometer/src/main.c index 85d52815f..319d6bd8a 100644 --- a/examples/projects/NUCLEO-F401RE/potentiometer/src/main.c +++ b/examples/projects/NUCLEO-F401RE/potentiometer/src/main.c @@ -25,7 +25,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "potentiometer.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F410RB/bootloader/platformio.ini b/examples/projects/NUCLEO-F410RB/bootloader/platformio.ini index 7efc94d10..ca1bb4c50 100644 --- a/examples/projects/NUCLEO-F410RB/bootloader/platformio.ini +++ b/examples/projects/NUCLEO-F410RB/bootloader/platformio.ini @@ -14,9 +14,12 @@ default_envs = nucleo_f410rb platform = ststm32 board = nucleo_f410rb framework = stm32cube -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ lib_deps = luos_engine@^3.0.0 + robus_network [env:nucleo_f410rb] board_build.ldscript = linker/custom_bootloader_script.ld diff --git a/examples/projects/NUCLEO-F410RB/bootloader/src/main.c b/examples/projects/NUCLEO-F410RB/bootloader/src/main.c index 1749fecb5..268966241 100644 --- a/examples/projects/NUCLEO-F410RB/bootloader/src/main.c +++ b/examples/projects/NUCLEO-F410RB/bootloader/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_bootloader.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F410RB/button/lib/Button/button.h b/examples/projects/NUCLEO-F410RB/button/lib/Button/button.h index 510616eca..391034b43 100644 --- a/examples/projects/NUCLEO-F410RB/button/lib/Button/button.h +++ b/examples/projects/NUCLEO-F410RB/button/lib/Button/button.h @@ -8,7 +8,7 @@ #define BUTTON_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F410RB/button/platformio.ini b/examples/projects/NUCLEO-F410RB/button/platformio.ini index ab21b2b1c..6888aeb54 100644 --- a/examples/projects/NUCLEO-F410RB/button/platformio.ini +++ b/examples/projects/NUCLEO-F410RB/button/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_f410rb [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f410rb framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Button debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-F410RB/button/src/main.c b/examples/projects/NUCLEO-F410RB/button/src/main.c index 5d2e9fff9..51006c3a4 100644 --- a/examples/projects/NUCLEO-F410RB/button/src/main.c +++ b/examples/projects/NUCLEO-F410RB/button/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F410RB/dc_motor/lib/DC_motor/dc_motor_drv.h b/examples/projects/NUCLEO-F410RB/dc_motor/lib/DC_motor/dc_motor_drv.h index e089b1f1f..c49674597 100644 --- a/examples/projects/NUCLEO-F410RB/dc_motor/lib/DC_motor/dc_motor_drv.h +++ b/examples/projects/NUCLEO-F410RB/dc_motor/lib/DC_motor/dc_motor_drv.h @@ -8,7 +8,7 @@ #define DC_MOTOR_DRV_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F410RB/dc_motor/platformio.ini b/examples/projects/NUCLEO-F410RB/dc_motor/platformio.ini index 937296bfa..c3fc7fd55 100644 --- a/examples/projects/NUCLEO-F410RB/dc_motor/platformio.ini +++ b/examples/projects/NUCLEO-F410RB/dc_motor/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_f401re [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f401re framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network DC_motor debug_tool = stlink diff --git a/examples/projects/NUCLEO-F410RB/dc_motor/src/main.c b/examples/projects/NUCLEO-F410RB/dc_motor/src/main.c index ae85a7966..0b824be86 100644 --- a/examples/projects/NUCLEO-F410RB/dc_motor/src/main.c +++ b/examples/projects/NUCLEO-F410RB/dc_motor/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "dc_motor.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F410RB/gate_serialcom/platformio.ini b/examples/projects/NUCLEO-F410RB/gate_serialcom/platformio.ini index 3c6e9e32d..3afd56fd3 100644 --- a/examples/projects/NUCLEO-F410RB/gate_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-F410RB/gate_serialcom/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f410rb framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Gate Pipe debug_tool = stlink diff --git a/examples/projects/NUCLEO-F410RB/gate_serialcom/src/main.c b/examples/projects/NUCLEO-F410RB/gate_serialcom/src/main.c index c60886695..8ec03f025 100644 --- a/examples/projects/NUCLEO-F410RB/gate_serialcom/src/main.c +++ b/examples/projects/NUCLEO-F410RB/gate_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-F410RB/inspector_serialcom/platformio.ini index af9a65d6c..895c19f58 100644 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-F410RB/inspector_serialcom/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f410rb framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Inspector Pipe debug_tool = stlink diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/main.c index d6bdde600..117d8e1d8 100644 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/main.c +++ b/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "inspector.h" #include "pipe.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F410RB/led/lib/Led/led.h b/examples/projects/NUCLEO-F410RB/led/lib/Led/led.h index 4a8a99bf4..e606ea77c 100644 --- a/examples/projects/NUCLEO-F410RB/led/lib/Led/led.h +++ b/examples/projects/NUCLEO-F410RB/led/lib/Led/led.h @@ -8,7 +8,7 @@ #define LED_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/NUCLEO-F410RB/led/platformio.ini b/examples/projects/NUCLEO-F410RB/led/platformio.ini index 56e116a0a..f9289d4e0 100644 --- a/examples/projects/NUCLEO-F410RB/led/platformio.ini +++ b/examples/projects/NUCLEO-F410RB/led/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_f401re [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f401re framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Led debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-F410RB/led/src/main.c b/examples/projects/NUCLEO-F410RB/led/src/main.c index b1320fa24..bf2475be6 100644 --- a/examples/projects/NUCLEO-F410RB/led/src/main.c +++ b/examples/projects/NUCLEO-F410RB/led/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "led.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.h b/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.h index 65a31b04d..f169709f5 100644 --- a/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.h +++ b/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer.h @@ -2,7 +2,7 @@ #define POTENTIOMETER_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "potentiometer_drv.h" /******************************************************************************* diff --git a/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer_drv.h b/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer_drv.h index 5d41c5a65..9b5f007ab 100644 --- a/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer_drv.h +++ b/examples/projects/NUCLEO-F410RB/potentiometer/lib/Potentiometer/potentiometer_drv.h @@ -7,7 +7,7 @@ #include "main.h" #include "analog.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F410RB/potentiometer/platformio.ini b/examples/projects/NUCLEO-F410RB/potentiometer/platformio.ini index df9c27d63..8b5d6260d 100644 --- a/examples/projects/NUCLEO-F410RB/potentiometer/platformio.ini +++ b/examples/projects/NUCLEO-F410RB/potentiometer/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_f401re [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_f401re framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Potentiometer debug_tool = stlink diff --git a/examples/projects/NUCLEO-F410RB/potentiometer/src/main.c b/examples/projects/NUCLEO-F410RB/potentiometer/src/main.c index 85d52815f..319d6bd8a 100644 --- a/examples/projects/NUCLEO-F410RB/potentiometer/src/main.c +++ b/examples/projects/NUCLEO-F410RB/potentiometer/src/main.c @@ -25,7 +25,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "potentiometer.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-G431KB/bootloader/platformio.ini b/examples/projects/NUCLEO-G431KB/bootloader/platformio.ini index 621573734..9b500d707 100644 --- a/examples/projects/NUCLEO-G431KB/bootloader/platformio.ini +++ b/examples/projects/NUCLEO-G431KB/bootloader/platformio.ini @@ -13,10 +13,13 @@ default_envs = nucleo_g431kb [env] platform = ststm32 board = nucleo_g431kb -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network [env:nucleo_g431kb] board_build.ldscript = linker/custom_bootloader_script.ld diff --git a/examples/projects/NUCLEO-G431KB/bootloader/src/main.c b/examples/projects/NUCLEO-G431KB/bootloader/src/main.c index c3d7bcba1..884e4bb5e 100644 --- a/examples/projects/NUCLEO-G431KB/bootloader/src/main.c +++ b/examples/projects/NUCLEO-G431KB/bootloader/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_bootloader.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-G431KB/button/lib/Button/button.h b/examples/projects/NUCLEO-G431KB/button/lib/Button/button.h index 510616eca..29464d5e3 100644 --- a/examples/projects/NUCLEO-G431KB/button/lib/Button/button.h +++ b/examples/projects/NUCLEO-G431KB/button/lib/Button/button.h @@ -8,7 +8,6 @@ #define BUTTON_H #include "luos_engine.h" -#include "robus.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-G431KB/button/platformio.ini b/examples/projects/NUCLEO-G431KB/button/platformio.ini index 1fb02c21e..5313a69a9 100644 --- a/examples/projects/NUCLEO-G431KB/button/platformio.ini +++ b/examples/projects/NUCLEO-G431KB/button/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_g431kb [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_g431kb framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Button debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-G431KB/button/src/main.c b/examples/projects/NUCLEO-G431KB/button/src/main.c index e4911eaef..11a4c21f7 100644 --- a/examples/projects/NUCLEO-G431KB/button/src/main.c +++ b/examples/projects/NUCLEO-G431KB/button/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-G431KB/dc_motor/lib/DC_motor/dc_motor_drv.h b/examples/projects/NUCLEO-G431KB/dc_motor/lib/DC_motor/dc_motor_drv.h index 8a103f2b1..f4e4e205f 100644 --- a/examples/projects/NUCLEO-G431KB/dc_motor/lib/DC_motor/dc_motor_drv.h +++ b/examples/projects/NUCLEO-G431KB/dc_motor/lib/DC_motor/dc_motor_drv.h @@ -8,7 +8,7 @@ #define DC_MOTOR_DRV_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-G431KB/dc_motor/platformio.ini b/examples/projects/NUCLEO-G431KB/dc_motor/platformio.ini index 0dfe7e8f0..320c83a89 100644 --- a/examples/projects/NUCLEO-G431KB/dc_motor/platformio.ini +++ b/examples/projects/NUCLEO-G431KB/dc_motor/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_g431kb [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_g431kb framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network DC_motor debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-G431KB/dc_motor/src/main.c b/examples/projects/NUCLEO-G431KB/dc_motor/src/main.c index 2492edb17..8994a8291 100644 --- a/examples/projects/NUCLEO-G431KB/dc_motor/src/main.c +++ b/examples/projects/NUCLEO-G431KB/dc_motor/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "dc_motor.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-G431KB/gate_serialcom/platformio.ini b/examples/projects/NUCLEO-G431KB/gate_serialcom/platformio.ini index 808e26baf..05a3243ba 100644 --- a/examples/projects/NUCLEO-G431KB/gate_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-G431KB/gate_serialcom/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_g431kb framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Gate Pipe debug_tool = stlink diff --git a/examples/projects/NUCLEO-G431KB/gate_serialcom/src/main.c b/examples/projects/NUCLEO-G431KB/gate_serialcom/src/main.c index be3929a79..eb0a1b250 100644 --- a/examples/projects/NUCLEO-G431KB/gate_serialcom/src/main.c +++ b/examples/projects/NUCLEO-G431KB/gate_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-G431KB/inspector_serialcom/platformio.ini index 6db1297eb..fe5677cd5 100644 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-G431KB/inspector_serialcom/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_g431kb framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Inspector Pipe debug_tool = stlink diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/main.c index 6395f48b5..7f1079a30 100644 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/main.c +++ b/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "inspector.h" #include "pipe.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.h b/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.h index 65a31b04d..f169709f5 100644 --- a/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.h +++ b/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer.h @@ -2,7 +2,7 @@ #define POTENTIOMETER_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "potentiometer_drv.h" /******************************************************************************* diff --git a/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer_drv.h b/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer_drv.h index a92f6ce7e..5bacb60a6 100644 --- a/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer_drv.h +++ b/examples/projects/NUCLEO-G431KB/potentiometer/lib/Potentiometer/potentiometer_drv.h @@ -7,7 +7,7 @@ #include "main.h" #include "analog.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-G431KB/potentiometer/platformio.ini b/examples/projects/NUCLEO-G431KB/potentiometer/platformio.ini index 26406429e..e0f4852e1 100644 --- a/examples/projects/NUCLEO-G431KB/potentiometer/platformio.ini +++ b/examples/projects/NUCLEO-G431KB/potentiometer/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_g431kb [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_g431kb framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Potentiometer debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-G431KB/potentiometer/src/main.c b/examples/projects/NUCLEO-G431KB/potentiometer/src/main.c index 1c713fa5a..bb9cbc3ba 100644 --- a/examples/projects/NUCLEO-G431KB/potentiometer/src/main.c +++ b/examples/projects/NUCLEO-G431KB/potentiometer/src/main.c @@ -25,7 +25,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "potentiometer.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-G474RE/bootloader/platformio.ini b/examples/projects/NUCLEO-G474RE/bootloader/platformio.ini index 51d0f955a..dc1c83a12 100644 --- a/examples/projects/NUCLEO-G474RE/bootloader/platformio.ini +++ b/examples/projects/NUCLEO-G474RE/bootloader/platformio.ini @@ -13,10 +13,13 @@ default_envs = nucleo_g474re [env] platform = ststm32 board = nucleo_g474re -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-G474RE/bootloader/src/main.c b/examples/projects/NUCLEO-G474RE/bootloader/src/main.c index 715c3bf7b..5f2baeff3 100644 --- a/examples/projects/NUCLEO-G474RE/bootloader/src/main.c +++ b/examples/projects/NUCLEO-G474RE/bootloader/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_bootloader.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-G474RE/button/lib/Button/button.h b/examples/projects/NUCLEO-G474RE/button/lib/Button/button.h index 510616eca..391034b43 100644 --- a/examples/projects/NUCLEO-G474RE/button/lib/Button/button.h +++ b/examples/projects/NUCLEO-G474RE/button/lib/Button/button.h @@ -8,7 +8,7 @@ #define BUTTON_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-G474RE/button/platformio.ini b/examples/projects/NUCLEO-G474RE/button/platformio.ini index 246e734a1..b6d6dac6f 100644 --- a/examples/projects/NUCLEO-G474RE/button/platformio.ini +++ b/examples/projects/NUCLEO-G474RE/button/platformio.ini @@ -13,12 +13,15 @@ default_envs = nucleo_g474re [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_g474re framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Button debug_tool = stlink upload_protocol = stlink @@ -45,4 +48,4 @@ build_flags = upload_protocol = custom upload_flags = -t2 -upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE \ No newline at end of file +upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE diff --git a/examples/projects/NUCLEO-G474RE/button/src/main.c b/examples/projects/NUCLEO-G474RE/button/src/main.c index 7b4875771..a4a3f3b8b 100644 --- a/examples/projects/NUCLEO-G474RE/button/src/main.c +++ b/examples/projects/NUCLEO-G474RE/button/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-G474RE/gate_serialcom/platformio.ini b/examples/projects/NUCLEO-G474RE/gate_serialcom/platformio.ini index f755a2de4..704eda036 100644 --- a/examples/projects/NUCLEO-G474RE/gate_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-G474RE/gate_serialcom/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_g474re framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Gate Pipe debug_tool = stlink diff --git a/examples/projects/NUCLEO-G474RE/gate_serialcom/src/main.c b/examples/projects/NUCLEO-G474RE/gate_serialcom/src/main.c index 0c61c6ed3..fde95516b 100644 --- a/examples/projects/NUCLEO-G474RE/gate_serialcom/src/main.c +++ b/examples/projects/NUCLEO-G474RE/gate_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-G474RE/inspector_serialcom/platformio.ini index df83df4c6..f543507c2 100644 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-G474RE/inspector_serialcom/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_g474re framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Inspector Pipe upload_protocol = stlink diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/main.c index 443355d49..aed1ea40e 100644 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/main.c +++ b/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "inspector.h" #include "pipe.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-L073RZ/bootloader/platformio.ini b/examples/projects/NUCLEO-L073RZ/bootloader/platformio.ini index bb890a482..9cf6fec6f 100644 --- a/examples/projects/NUCLEO-L073RZ/bootloader/platformio.ini +++ b/examples/projects/NUCLEO-L073RZ/bootloader/platformio.ini @@ -13,10 +13,13 @@ default_envs = nucleo_l073rz [env] platform = ststm32 board = nucleo_l073rz -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network [env:nucleo_l073rz] board_build.ldscript = linker/custom_bootloader_script.ld diff --git a/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c b/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c index 7eaa0d61a..b5a9142b2 100644 --- a/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c +++ b/examples/projects/NUCLEO-L073RZ/bootloader/src/main.c @@ -22,7 +22,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_bootloader.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-L073RZ/button/platformio.ini b/examples/projects/NUCLEO-L073RZ/button/platformio.ini index ef6b5e13f..7825620d7 100644 --- a/examples/projects/NUCLEO-L073RZ/button/platformio.ini +++ b/examples/projects/NUCLEO-L073RZ/button/platformio.ini @@ -13,12 +13,15 @@ default_envs = nucleo_l073rz [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_l073rz framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Button debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-L073RZ/button/src/main.c b/examples/projects/NUCLEO-L073RZ/button/src/main.c index 4da9c3f10..9f4313f94 100644 --- a/examples/projects/NUCLEO-L073RZ/button/src/main.c +++ b/examples/projects/NUCLEO-L073RZ/button/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-L073RZ/gate_serialcom/platformio.ini b/examples/projects/NUCLEO-L073RZ/gate_serialcom/platformio.ini index aadcc8373..75de242d5 100644 --- a/examples/projects/NUCLEO-L073RZ/gate_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-L073RZ/gate_serialcom/platformio.ini @@ -16,11 +16,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_l073rz framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Pipe Gate debug_tool = stlink diff --git a/examples/projects/NUCLEO-L073RZ/gate_serialcom/src/main.c b/examples/projects/NUCLEO-L073RZ/gate_serialcom/src/main.c index df86c8475..25c3887e6 100644 --- a/examples/projects/NUCLEO-L073RZ/gate_serialcom/src/main.c +++ b/examples/projects/NUCLEO-L073RZ/gate_serialcom/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-L432KC/bootloader/platformio.ini b/examples/projects/NUCLEO-L432KC/bootloader/platformio.ini index 9564fa0bb..1e90565a6 100644 --- a/examples/projects/NUCLEO-L432KC/bootloader/platformio.ini +++ b/examples/projects/NUCLEO-L432KC/bootloader/platformio.ini @@ -14,7 +14,9 @@ default_envs = nucleo_l432kc [env] platform = ststm32 board = nucleo_l432kc -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ framework = stm32cube [env:nucleo_l432kc] @@ -29,6 +31,7 @@ build_flags = -DBOOTLOADER lib_deps = luos_engine@^3.0.0 + robus_network debug_tool = stlink upload_protocol = stlink @@ -45,6 +48,7 @@ build_flags = -DBOOTLOADER_UPDATER lib_deps = luos_engine@^3.0.0 + robus_network upload_protocol = custom upload_flags = -t2 diff --git a/examples/projects/NUCLEO-L432KC/bootloader/src/main.c b/examples/projects/NUCLEO-L432KC/bootloader/src/main.c index 4c6f10682..2b0c56eff 100644 --- a/examples/projects/NUCLEO-L432KC/bootloader/src/main.c +++ b/examples/projects/NUCLEO-L432KC/bootloader/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_bootloader.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-L432KC/button/lib/Button/button.h b/examples/projects/NUCLEO-L432KC/button/lib/Button/button.h index 510616eca..391034b43 100644 --- a/examples/projects/NUCLEO-L432KC/button/lib/Button/button.h +++ b/examples/projects/NUCLEO-L432KC/button/lib/Button/button.h @@ -8,7 +8,7 @@ #define BUTTON_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-L432KC/button/platformio.ini b/examples/projects/NUCLEO-L432KC/button/platformio.ini index b07142bb5..391e4a2f0 100644 --- a/examples/projects/NUCLEO-L432KC/button/platformio.ini +++ b/examples/projects/NUCLEO-L432KC/button/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_l432kc [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_l432kc framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Button debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-L432KC/button/src/main.c b/examples/projects/NUCLEO-L432KC/button/src/main.c index 5a6a34f20..8b8a35b29 100644 --- a/examples/projects/NUCLEO-L432KC/button/src/main.c +++ b/examples/projects/NUCLEO-L432KC/button/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-L432KC/dc_motor/lib/DC_motor/dc_motor_drv.h b/examples/projects/NUCLEO-L432KC/dc_motor/lib/DC_motor/dc_motor_drv.h index f7bf4d2f1..2656c0a20 100644 --- a/examples/projects/NUCLEO-L432KC/dc_motor/lib/DC_motor/dc_motor_drv.h +++ b/examples/projects/NUCLEO-L432KC/dc_motor/lib/DC_motor/dc_motor_drv.h @@ -8,7 +8,7 @@ #define DC_MOTOR_DRV_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-L432KC/dc_motor/platformio.ini b/examples/projects/NUCLEO-L432KC/dc_motor/platformio.ini index a17e8232a..998d0e7d1 100644 --- a/examples/projects/NUCLEO-L432KC/dc_motor/platformio.ini +++ b/examples/projects/NUCLEO-L432KC/dc_motor/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_l432kc [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_l432kc framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network DC_motor debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-L432KC/dc_motor/src/main.c b/examples/projects/NUCLEO-L432KC/dc_motor/src/main.c index b05842cb5..42f4ce23f 100644 --- a/examples/projects/NUCLEO-L432KC/dc_motor/src/main.c +++ b/examples/projects/NUCLEO-L432KC/dc_motor/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "dc_motor.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-L432KC/fingerprint/lib/Fingerprint/fingerprint.h b/examples/projects/NUCLEO-L432KC/fingerprint/lib/Fingerprint/fingerprint.h index 855d00010..73c3629f1 100644 --- a/examples/projects/NUCLEO-L432KC/fingerprint/lib/Fingerprint/fingerprint.h +++ b/examples/projects/NUCLEO-L432KC/fingerprint/lib/Fingerprint/fingerprint.h @@ -11,7 +11,7 @@ #define FINGERPRINT_H_ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/NUCLEO-L432KC/fingerprint/platformio.ini b/examples/projects/NUCLEO-L432KC/fingerprint/platformio.ini index 51be7125b..ff32808b1 100644 --- a/examples/projects/NUCLEO-L432KC/fingerprint/platformio.ini +++ b/examples/projects/NUCLEO-L432KC/fingerprint/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_l432kc [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_l432kc framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Fingerprint debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-L432KC/fingerprint/src/main.c b/examples/projects/NUCLEO-L432KC/fingerprint/src/main.c index 82e521743..e6e3f59f0 100644 --- a/examples/projects/NUCLEO-L432KC/fingerprint/src/main.c +++ b/examples/projects/NUCLEO-L432KC/fingerprint/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "fingerprint.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-L432KC/gate_serialcom/platformio.ini b/examples/projects/NUCLEO-L432KC/gate_serialcom/platformio.ini index 28ed9c0dc..23054fa03 100644 --- a/examples/projects/NUCLEO-L432KC/gate_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-L432KC/gate_serialcom/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_l432kc framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Gate Pipe debug_tool = stlink diff --git a/examples/projects/NUCLEO-L432KC/gate_serialcom/src/main.c b/examples/projects/NUCLEO-L432KC/gate_serialcom/src/main.c index ba64b4c2d..2bc10acef 100644 --- a/examples/projects/NUCLEO-L432KC/gate_serialcom/src/main.c +++ b/examples/projects/NUCLEO-L432KC/gate_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-L432KC/gpio/lib/Gpio_dev/gpio_dev.h b/examples/projects/NUCLEO-L432KC/gpio/lib/Gpio_dev/gpio_dev.h index a6db26b14..4170a1385 100644 --- a/examples/projects/NUCLEO-L432KC/gpio/lib/Gpio_dev/gpio_dev.h +++ b/examples/projects/NUCLEO-L432KC/gpio/lib/Gpio_dev/gpio_dev.h @@ -8,7 +8,7 @@ #define GPIO_DEV_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-L432KC/gpio/platformio.ini b/examples/projects/NUCLEO-L432KC/gpio/platformio.ini index 64e20c7fe..3c77cb9b8 100644 --- a/examples/projects/NUCLEO-L432KC/gpio/platformio.ini +++ b/examples/projects/NUCLEO-L432KC/gpio/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_l432kc [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_l432kc framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Gpio_dev debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-L432KC/gpio/src/main.c b/examples/projects/NUCLEO-L432KC/gpio/src/main.c index 5f392593e..b6029cd82 100644 --- a/examples/projects/NUCLEO-L432KC/gpio/src/main.c +++ b/examples/projects/NUCLEO-L432KC/gpio/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "gpio_dev.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-L432KC/inspector_serialcom/platformio.ini index 3e89293a8..88e341e7c 100644 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/platformio.ini +++ b/examples/projects/NUCLEO-L432KC/inspector_serialcom/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_l432kc framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Inspector Pipe debug_tool = stlink diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/main.c index 9059dc0d7..810ff43ed 100644 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/main.c +++ b/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "inspector.h" #include "pipe.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.h b/examples/projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.h index 741816125..d3cd88f21 100644 --- a/examples/projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.h +++ b/examples/projects/NUCLEO-L432KC/lcd/lib/Lcd/lcd.h @@ -11,7 +11,7 @@ #define LCD_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/NUCLEO-L432KC/lcd/platformio.ini b/examples/projects/NUCLEO-L432KC/lcd/platformio.ini index 5f7e275b6..90a1eeae8 100644 --- a/examples/projects/NUCLEO-L432KC/lcd/platformio.ini +++ b/examples/projects/NUCLEO-L432KC/lcd/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_l432kc [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_l432kc framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Lcd debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-L432KC/lcd/src/main.c b/examples/projects/NUCLEO-L432KC/lcd/src/main.c index 4c3bc32eb..75bd8a120 100644 --- a/examples/projects/NUCLEO-L432KC/lcd/src/main.c +++ b/examples/projects/NUCLEO-L432KC/lcd/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "lcd.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-L432KC/led/lib/Led/led.h b/examples/projects/NUCLEO-L432KC/led/lib/Led/led.h index 4a8a99bf4..e606ea77c 100644 --- a/examples/projects/NUCLEO-L432KC/led/lib/Led/led.h +++ b/examples/projects/NUCLEO-L432KC/led/lib/Led/led.h @@ -8,7 +8,7 @@ #define LED_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/NUCLEO-L432KC/led/platformio.ini b/examples/projects/NUCLEO-L432KC/led/platformio.ini index 6acd49743..8615ff8b5 100644 --- a/examples/projects/NUCLEO-L432KC/led/platformio.ini +++ b/examples/projects/NUCLEO-L432KC/led/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_l432kc [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_l432kc framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Led debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-L432KC/led/src/main.c b/examples/projects/NUCLEO-L432KC/led/src/main.c index 0ee3e3c4b..d5a6060dd 100644 --- a/examples/projects/NUCLEO-L432KC/led/src/main.c +++ b/examples/projects/NUCLEO-L432KC/led/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "led.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.h b/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.h index 65a31b04d..f169709f5 100644 --- a/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.h +++ b/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer.h @@ -2,7 +2,7 @@ #define POTENTIOMETER_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "potentiometer_drv.h" /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer_drv.h b/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer_drv.h index cd754f270..69da0f299 100644 --- a/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer_drv.h +++ b/examples/projects/NUCLEO-L432KC/potentiometer/lib/Potentiometer/potentiometer_drv.h @@ -7,7 +7,7 @@ #include "main.h" #include "analog.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-L432KC/potentiometer/platformio.ini b/examples/projects/NUCLEO-L432KC/potentiometer/platformio.ini index 876357195..20d755ee6 100644 --- a/examples/projects/NUCLEO-L432KC/potentiometer/platformio.ini +++ b/examples/projects/NUCLEO-L432KC/potentiometer/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_l432kc [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_l432kc framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Potentiometer debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-L432KC/potentiometer/src/main.c b/examples/projects/NUCLEO-L432KC/potentiometer/src/main.c index 19658cbab..16903d283 100644 --- a/examples/projects/NUCLEO-L432KC/potentiometer/src/main.c +++ b/examples/projects/NUCLEO-L432KC/potentiometer/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "potentiometer.h" /* USER CODE END Includes */ diff --git a/examples/projects/NUCLEO-L432KC/servo/lib/Servo/servo_drv.h b/examples/projects/NUCLEO-L432KC/servo/lib/Servo/servo_drv.h index 34fc74db7..4ef7dfd9e 100644 --- a/examples/projects/NUCLEO-L432KC/servo/lib/Servo/servo_drv.h +++ b/examples/projects/NUCLEO-L432KC/servo/lib/Servo/servo_drv.h @@ -11,7 +11,7 @@ #define SERVO_DRV_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_hal.h" /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/servo/platformio.ini b/examples/projects/NUCLEO-L432KC/servo/platformio.ini index daf1b5cae..76e65f198 100644 --- a/examples/projects/NUCLEO-L432KC/servo/platformio.ini +++ b/examples/projects/NUCLEO-L432KC/servo/platformio.ini @@ -12,12 +12,15 @@ default_envs = nucleo_l432kc [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = nucleo_l432kc framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Servo debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-L432KC/servo/src/main.c b/examples/projects/NUCLEO-L432KC/servo/src/main.c index ff111dfa8..db8f5c7f9 100644 --- a/examples/projects/NUCLEO-L432KC/servo/src/main.c +++ b/examples/projects/NUCLEO-L432KC/servo/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "servo.h" /* USER CODE END Includes */ diff --git a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c index b92775db2..3b40f8b50 100644 --- a/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c +++ b/examples/projects/SAMD21XPLAINED/Bootloader/firmware/src/main.c @@ -28,7 +28,7 @@ #include "definitions.h" // SYS function prototypes #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_bootloader.h" // ***************************************************************************** diff --git a/examples/projects/SAMD21XPLAINED/button/lib/button/button.h b/examples/projects/SAMD21XPLAINED/button/lib/button/button.h index 510616eca..391034b43 100644 --- a/examples/projects/SAMD21XPLAINED/button/lib/button/button.h +++ b/examples/projects/SAMD21XPLAINED/button/lib/button/button.h @@ -8,7 +8,7 @@ #define BUTTON_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/SAMD21XPLAINED/button/platformio.ini b/examples/projects/SAMD21XPLAINED/button/platformio.ini index d3e27c72b..d34a27b14 100644 --- a/examples/projects/SAMD21XPLAINED/button/platformio.ini +++ b/examples/projects/SAMD21XPLAINED/button/platformio.ini @@ -9,7 +9,9 @@ ; https://docs.platformio.org/page/projectconf.html [env:samd21_xpro] -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ lib_ldf_mode =off platform = atmelsam board = samd21_xpro @@ -23,4 +25,5 @@ build_flags = -D__SAMD21J18A__ lib_deps = luos_engine@^3.0.0 + robus_network Button diff --git a/examples/projects/SAMD21XPLAINED/button/src/main.c b/examples/projects/SAMD21XPLAINED/button/src/main.c index db62a9707..347491afa 100644 --- a/examples/projects/SAMD21XPLAINED/button/src/main.c +++ b/examples/projects/SAMD21XPLAINED/button/src/main.c @@ -9,7 +9,7 @@ #include "device.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" void SetSystemClock_48Mhz(void); diff --git a/examples/projects/STM32F4-discovery/bootloader/platformio.ini b/examples/projects/STM32F4-discovery/bootloader/platformio.ini index bc6f7dbb7..3d0645b0b 100644 --- a/examples/projects/STM32F4-discovery/bootloader/platformio.ini +++ b/examples/projects/STM32F4-discovery/bootloader/platformio.ini @@ -12,11 +12,15 @@ default_envs = STM32F4-discovery [env] platform = ststm32 -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ + $PROJECT_DIR/../../../../network/ board = disco_f407vg framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network [env:STM32F4-discovery] board_build.ldscript = linker/custom_bootloader_script.ld diff --git a/examples/projects/STM32F4-discovery/bootloader/src/main.c b/examples/projects/STM32F4-discovery/bootloader/src/main.c index 0d7e560f4..165d82227 100644 --- a/examples/projects/STM32F4-discovery/bootloader/src/main.c +++ b/examples/projects/STM32F4-discovery/bootloader/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_bootloader.h" /* USER CODE END Includes */ diff --git a/examples/projects/STM32F4-discovery/button/lib/Button/button.h b/examples/projects/STM32F4-discovery/button/lib/Button/button.h index 510616eca..391034b43 100644 --- a/examples/projects/STM32F4-discovery/button/lib/Button/button.h +++ b/examples/projects/STM32F4-discovery/button/lib/Button/button.h @@ -8,7 +8,7 @@ #define BUTTON_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/STM32F4-discovery/button/platformio.ini b/examples/projects/STM32F4-discovery/button/platformio.ini index 773dc370f..9811ddecc 100644 --- a/examples/projects/STM32F4-discovery/button/platformio.ini +++ b/examples/projects/STM32F4-discovery/button/platformio.ini @@ -12,7 +12,9 @@ default_envs = STM32F4-discovery [env:STM32F4-discovery] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = disco_f407vg framework = stm32cube @@ -25,13 +27,16 @@ build_flags = -DLUOSHAL=STM32F4 lib_deps = luos_engine@^3.0.0 + robus_network Button debug_tool = stlink [env:STM32F4_discovery_with_bootloader] lib_ldf_mode =off board_build.ldscript = linker/custom_app_script.ld -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = disco_f407vg framework = stm32cube @@ -45,6 +50,7 @@ build_flags = -DLUOSHAL=STM32F4 lib_deps = luos_engine@^3.0.0 + robus_network Button upload_protocol = custom upload_flags = diff --git a/examples/projects/STM32F4-discovery/button/src/main.c b/examples/projects/STM32F4-discovery/button/src/main.c index 7f047b829..6898c0877 100644 --- a/examples/projects/STM32F4-discovery/button/src/main.c +++ b/examples/projects/STM32F4-discovery/button/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" /* USER CODE END Includes */ diff --git a/examples/projects/STM32F4-discovery/gate_serialcom/platformio.ini b/examples/projects/STM32F4-discovery/gate_serialcom/platformio.ini index 34925cbf4..e03829e81 100644 --- a/examples/projects/STM32F4-discovery/gate_serialcom/platformio.ini +++ b/examples/projects/STM32F4-discovery/gate_serialcom/platformio.ini @@ -28,8 +28,10 @@ build_flags = lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ lib_deps = luos_engine@^3.0.0 + robus_network Gate Pipe debug_tool = stlink @@ -41,6 +43,7 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ board = disco_f407vg framework = stm32cube build_unflags = -Os @@ -56,6 +59,7 @@ build_flags = -DLUOSHAL=STM32F4 lib_deps = luos_engine@^3.0.0 + robus_network Gate Pipe upload_protocol = custom diff --git a/examples/projects/STM32F4-discovery/gate_serialcom/src/main.c b/examples/projects/STM32F4-discovery/gate_serialcom/src/main.c index 7234e75f4..73a331ec9 100644 --- a/examples/projects/STM32F4-discovery/gate_serialcom/src/main.c +++ b/examples/projects/STM32F4-discovery/gate_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/platformio.ini b/examples/projects/STM32F4-discovery/inspector_serialcom/platformio.ini index 311d7613c..6f1a6a041 100644 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/platformio.ini +++ b/examples/projects/STM32F4-discovery/inspector_serialcom/platformio.ini @@ -28,8 +28,10 @@ build_flags = lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ lib_deps = luos_engine@^3.0.0 + robus_network Inspector Pipe debug_tool = stlink @@ -40,6 +42,7 @@ board_build.ldscript = linker/custom_app_script.ld lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = disco_f407vg framework = stm32cube @@ -55,6 +58,7 @@ build_flags = -DLUOSHAL=STM32F4 lib_deps = luos_engine@^3.0.0 + robus_network Inspector Pipe upload_protocol = custom diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/src/main.c b/examples/projects/STM32F4-discovery/inspector_serialcom/src/main.c index fa99fcefb..747208dd3 100644 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/src/main.c +++ b/examples/projects/STM32F4-discovery/inspector_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "inspector.h" #include "pipe.h" /* USER CODE END Includes */ diff --git a/examples/projects/STM32L4S5_discovery/bootloader/platformio.ini b/examples/projects/STM32L4S5_discovery/bootloader/platformio.ini index 8014d75d4..6197201e9 100644 --- a/examples/projects/STM32L4S5_discovery/bootloader/platformio.ini +++ b/examples/projects/STM32L4S5_discovery/bootloader/platformio.ini @@ -13,10 +13,13 @@ default_envs = disco_l4s5i_iot01a [env] platform = ststm32 board = disco_l4s5i_iot01a -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network [env:disco_l4s5i_iot01a] board_build.ldscript = linker/custom_bootloader_script.ld diff --git a/examples/projects/STM32L4S5_discovery/bootloader/src/main.c b/examples/projects/STM32L4S5_discovery/bootloader/src/main.c index b44fbf951..fcd4f7f4b 100644 --- a/examples/projects/STM32L4S5_discovery/bootloader/src/main.c +++ b/examples/projects/STM32L4S5_discovery/bootloader/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_bootloader.h" /* USER CODE END Includes */ diff --git a/examples/projects/STM32L4S5_discovery/button/lib/Button/button.h b/examples/projects/STM32L4S5_discovery/button/lib/Button/button.h index 510616eca..391034b43 100644 --- a/examples/projects/STM32L4S5_discovery/button/lib/Button/button.h +++ b/examples/projects/STM32L4S5_discovery/button/lib/Button/button.h @@ -8,7 +8,7 @@ #define BUTTON_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/STM32L4S5_discovery/button/platformio.ini b/examples/projects/STM32L4S5_discovery/button/platformio.ini index 83004b65f..57ed156bf 100644 --- a/examples/projects/STM32L4S5_discovery/button/platformio.ini +++ b/examples/projects/STM32L4S5_discovery/button/platformio.ini @@ -12,12 +12,15 @@ default_envs = disco_l4s5i_iot01a [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = disco_l4s5i_iot01a framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Button debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/STM32L4S5_discovery/button/src/main.c b/examples/projects/STM32L4S5_discovery/button/src/main.c index e3c397281..1c42ed63b 100644 --- a/examples/projects/STM32L4S5_discovery/button/src/main.c +++ b/examples/projects/STM32L4S5_discovery/button/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" /* USER CODE END Includes */ diff --git a/examples/projects/STM32L4S5_discovery/gate_serialcom/platformio.ini b/examples/projects/STM32L4S5_discovery/gate_serialcom/platformio.ini index 3aa58bb3a..e14e3877e 100644 --- a/examples/projects/STM32L4S5_discovery/gate_serialcom/platformio.ini +++ b/examples/projects/STM32L4S5_discovery/gate_serialcom/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = disco_l4s5i_iot01a framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Gate Pipe debug_tool = stlink diff --git a/examples/projects/STM32L4S5_discovery/gate_serialcom/src/main.c b/examples/projects/STM32L4S5_discovery/gate_serialcom/src/main.c index a5c2b7bc0..a1389a501 100644 --- a/examples/projects/STM32L4S5_discovery/gate_serialcom/src/main.c +++ b/examples/projects/STM32L4S5_discovery/gate_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "gate.h" #include "pipe.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/led_fader.h b/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/led_fader.h index e458e3b98..f7b91d2d0 100644 --- a/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/led_fader.h +++ b/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/led_fader.h @@ -8,7 +8,7 @@ #define LED_FADER_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/ledfader_drv.h b/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/ledfader_drv.h index d60f8b180..b31fac54c 100644 --- a/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/ledfader_drv.h +++ b/examples/projects/l0/bike_alarm/alarm_controller/lib/Led_Fader/ledfader_drv.h @@ -8,7 +8,7 @@ #define LEDFADER_DRV_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "stm32f0xx_hal.h" #include "stm32f0xx_ll_exti.h" #include "stm32f0xx_ll_system.h" diff --git a/examples/projects/l0/bike_alarm/alarm_controller/platformio.ini b/examples/projects/l0/bike_alarm/alarm_controller/platformio.ini index 04b86b349..9fc6db28e 100644 --- a/examples/projects/l0/bike_alarm/alarm_controller/platformio.ini +++ b/examples/projects/l0/bike_alarm/alarm_controller/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../apps/ $PROJECT_DIR/../../../../../../ + $PROJECT_DIR/../../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network alarm_controller Led_Fader debug_tool = stlink diff --git a/examples/projects/l0/bike_alarm/alarm_controller/src/main.c b/examples/projects/l0/bike_alarm/alarm_controller/src/main.c index 3797937a1..d4efd55a5 100644 --- a/examples/projects/l0/bike_alarm/alarm_controller/src/main.c +++ b/examples/projects/l0/bike_alarm/alarm_controller/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "led_fader.h" #include "alarm_controller.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/bike_alarm/start_controller/platformio.ini b/examples/projects/l0/bike_alarm/start_controller/platformio.ini index d3d1ab48e..f3ceed612 100644 --- a/examples/projects/l0/bike_alarm/start_controller/platformio.ini +++ b/examples/projects/l0/bike_alarm/start_controller/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../apps/ $PROJECT_DIR/../../../../../../ + $PROJECT_DIR/../../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Button start_controller debug_tool = stlink diff --git a/examples/projects/l0/bike_alarm/start_controller/src/main.c b/examples/projects/l0/bike_alarm/start_controller/src/main.c index 36f1b51df..6fd21f948 100644 --- a/examples/projects/l0/bike_alarm/start_controller/src/main.c +++ b/examples/projects/l0/bike_alarm/start_controller/src/main.c @@ -27,7 +27,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/bootloader/platformio.ini b/examples/projects/l0/bootloader/platformio.ini index 1240d9adb..a17f313f8 100644 --- a/examples/projects/l0/bootloader/platformio.ini +++ b/examples/projects/l0/bootloader/platformio.ini @@ -15,9 +15,12 @@ default_envs = l0 platform = ststm32 board = l0 framework = stm32cube -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ lib_deps = luos_engine@^3.0.0 + robus_network [env:l0] board_build.ldscript = linker/custom_bootloader_script.ld diff --git a/examples/projects/l0/bootloader/src/main.c b/examples/projects/l0/bootloader/src/main.c index fde761701..7198af518 100644 --- a/examples/projects/l0/bootloader/src/main.c +++ b/examples/projects/l0/bootloader/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_bootloader.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/button/platformio.ini b/examples/projects/l0/button/platformio.ini index 77798e51c..17077b40a 100644 --- a/examples/projects/l0/button/platformio.ini +++ b/examples/projects/l0/button/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Button debug_tool = stlink diff --git a/examples/projects/l0/button/src/main.c b/examples/projects/l0/button/src/main.c index 5f25fe81a..49cdb2ca3 100644 --- a/examples/projects/l0/button/src/main.c +++ b/examples/projects/l0/button/src/main.c @@ -26,7 +26,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/button_freertos/lib/Led/led.h b/examples/projects/l0/button_freertos/lib/Led/led.h index 4a8a99bf4..e606ea77c 100644 --- a/examples/projects/l0/button_freertos/lib/Led/led.h +++ b/examples/projects/l0/button_freertos/lib/Led/led.h @@ -8,7 +8,7 @@ #define LED_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/button_freertos/lib/Led/led_drv.h b/examples/projects/l0/button_freertos/lib/Led/led_drv.h index 52740a857..53254d44d 100644 --- a/examples/projects/l0/button_freertos/lib/Led/led_drv.h +++ b/examples/projects/l0/button_freertos/lib/Led/led_drv.h @@ -8,7 +8,7 @@ #define LED_DRV_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "stm32f0xx_hal.h" #include "stm32f0xx_ll_exti.h" #include "stm32f0xx_ll_system.h" diff --git a/examples/projects/l0/button_freertos/platformio.ini b/examples/projects/l0/button_freertos/platformio.ini index c07be097a..331829692 100644 --- a/examples/projects/l0/button_freertos/platformio.ini +++ b/examples/projects/l0/button_freertos/platformio.ini @@ -12,12 +12,16 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Button CMSIS_RTOS_V2 bojit/PlatformIO-FreeRTOS diff --git a/examples/projects/l0/button_freertos/src/freertos.c b/examples/projects/l0/button_freertos/src/freertos.c index 93c27d049..774ecc630 100644 --- a/examples/projects/l0/button_freertos/src/freertos.c +++ b/examples/projects/l0/button_freertos/src/freertos.c @@ -3,7 +3,7 @@ #include "cmsis_os.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" #include "led.h" diff --git a/examples/projects/l0/controller_motor/platformio.ini b/examples/projects/l0/controller_motor/platformio.ini index deeab9b3e..d6a5074f3 100644 --- a/examples/projects/l0/controller_motor/platformio.ini +++ b/examples/projects/l0/controller_motor/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Controller_motor debug_tool = stlink diff --git a/examples/projects/l0/controller_motor/src/main.c b/examples/projects/l0/controller_motor/src/main.c index b1269c31a..bbe7522ca 100644 --- a/examples/projects/l0/controller_motor/src/main.c +++ b/examples/projects/l0/controller_motor/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "controller_motor.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/dc_motor/lib/DC_motor/dc_motor_drv.h b/examples/projects/l0/dc_motor/lib/DC_motor/dc_motor_drv.h index c101e7f81..7b07fbcdf 100644 --- a/examples/projects/l0/dc_motor/lib/DC_motor/dc_motor_drv.h +++ b/examples/projects/l0/dc_motor/lib/DC_motor/dc_motor_drv.h @@ -8,7 +8,7 @@ #define DC_MOTOR_DRV_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "stm32f0xx_hal.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/dc_motor/platformio.ini b/examples/projects/l0/dc_motor/platformio.ini index 36fa0eebc..21727f870 100644 --- a/examples/projects/l0/dc_motor/platformio.ini +++ b/examples/projects/l0/dc_motor/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network DC_motor debug_tool = stlink diff --git a/examples/projects/l0/dc_motor/src/main.c b/examples/projects/l0/dc_motor/src/main.c index d5540c373..41c917fc1 100644 --- a/examples/projects/l0/dc_motor/src/main.c +++ b/examples/projects/l0/dc_motor/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "dc_motor.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.h b/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.h index 7be366d3b..0c67d9d5b 100644 --- a/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.h +++ b/examples/projects/l0/demo/detection_button/lib/Detection_Button/detection_button.h @@ -8,7 +8,7 @@ #define START_CONTROLLER_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/demo/detection_button/platformio.ini b/examples/projects/l0/demo/detection_button/platformio.ini index db86e74c6..53888074a 100644 --- a/examples/projects/l0/demo/detection_button/platformio.ini +++ b/examples/projects/l0/demo/detection_button/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../apps/ $PROJECT_DIR/../../../../../../ + $PROJECT_DIR/../../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network detection_button Button debug_tool = stlink diff --git a/examples/projects/l0/demo/detection_button/src/main.c b/examples/projects/l0/demo/detection_button/src/main.c index fb9ae0b45..2e0518d32 100644 --- a/examples/projects/l0/demo/detection_button/src/main.c +++ b/examples/projects/l0/demo/detection_button/src/main.c @@ -26,7 +26,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" #include "detection_button.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/demo/ledstrip_position/lib/Distance/distance.h b/examples/projects/l0/demo/ledstrip_position/lib/Distance/distance.h index bf5d4eff1..061dca47d 100644 --- a/examples/projects/l0/demo/ledstrip_position/lib/Distance/distance.h +++ b/examples/projects/l0/demo/ledstrip_position/lib/Distance/distance.h @@ -8,7 +8,7 @@ #define DISTANCE_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/l0/demo/ledstrip_position/lib/Distance/vl53l0x_drv.h b/examples/projects/l0/demo/ledstrip_position/lib/Distance/vl53l0x_drv.h index d5ee34a83..1f0c68b37 100644 --- a/examples/projects/l0/demo/ledstrip_position/lib/Distance/vl53l0x_drv.h +++ b/examples/projects/l0/demo/ledstrip_position/lib/Distance/vl53l0x_drv.h @@ -10,7 +10,7 @@ #include "stdbool.h" #include "stm32f0xx_hal.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.h b/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.h index a3d0adb41..82e59ceb6 100644 --- a/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.h +++ b/examples/projects/l0/demo/ledstrip_position/lib/LedStrip_Position/ledstrip_position.h @@ -8,7 +8,7 @@ #define LedStripPosition #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/demo/ledstrip_position/platformio.ini b/examples/projects/l0/demo/ledstrip_position/platformio.ini index 5b2b36243..1dc8768fb 100644 --- a/examples/projects/l0/demo/ledstrip_position/platformio.ini +++ b/examples/projects/l0/demo/ledstrip_position/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../apps/ $PROJECT_DIR/../../../../../../ + $PROJECT_DIR/../../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network ledstrip_position distance debug_tool = stlink diff --git a/examples/projects/l0/demo/ledstrip_position/src/main.c b/examples/projects/l0/demo/ledstrip_position/src/main.c index 6edae715d..2441dd861 100644 --- a/examples/projects/l0/demo/ledstrip_position/src/main.c +++ b/examples/projects/l0/demo/ledstrip_position/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "distance.h" #include "ledstrip_position.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.h b/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.h index 497978932..5ccb60306 100644 --- a/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.h +++ b/examples/projects/l0/demo/motor_copy_app/lib/motor_copy/motor_copy.h @@ -8,7 +8,7 @@ #define MOTOR_COPY_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/demo/motor_copy_app/platformio.ini b/examples/projects/l0/demo/motor_copy_app/platformio.ini index 419cbdea5..84a5803a3 100644 --- a/examples/projects/l0/demo/motor_copy_app/platformio.ini +++ b/examples/projects/l0/demo/motor_copy_app/platformio.ini @@ -13,12 +13,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../../ + $PROJECT_DIR/../../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network motor_copy debug_tool = stlink diff --git a/examples/projects/l0/demo/motor_copy_app/src/main.c b/examples/projects/l0/demo/motor_copy_app/src/main.c index 7064e79fb..23d2d3b6d 100644 --- a/examples/projects/l0/demo/motor_copy_app/src/main.c +++ b/examples/projects/l0/demo/motor_copy_app/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "motor_copy.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.h b/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.h index 485a5f3ff..a0cbe1689 100644 --- a/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.h +++ b/examples/projects/l0/demo/motor_demo_app/lib/run_motor/run_motor.h @@ -8,7 +8,7 @@ #define RUN_MOTOR_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/demo/motor_demo_app/platformio.ini b/examples/projects/l0/demo/motor_demo_app/platformio.ini index fe8738469..1fe314b90 100644 --- a/examples/projects/l0/demo/motor_demo_app/platformio.ini +++ b/examples/projects/l0/demo/motor_demo_app/platformio.ini @@ -13,12 +13,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../../ + $PROJECT_DIR/../../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network run_motor debug_tool = stlink diff --git a/examples/projects/l0/demo/motor_demo_app/src/main.c b/examples/projects/l0/demo/motor_demo_app/src/main.c index 1a8656f77..257a5a317 100644 --- a/examples/projects/l0/demo/motor_demo_app/src/main.c +++ b/examples/projects/l0/demo/motor_demo_app/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "run_motor.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/demo/product_config.h b/examples/projects/l0/demo/product_config.h index e284a9071..cc50d6aa4 100644 --- a/examples/projects/l0/demo/product_config.h +++ b/examples/projects/l0/demo/product_config.h @@ -7,7 +7,7 @@ #ifndef PRODUCT_CONFIG_H #define PRODUCT_CONFIG_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" enum { diff --git a/examples/projects/l0/distance/lib/Distance/distance.h b/examples/projects/l0/distance/lib/Distance/distance.h index bf5d4eff1..061dca47d 100644 --- a/examples/projects/l0/distance/lib/Distance/distance.h +++ b/examples/projects/l0/distance/lib/Distance/distance.h @@ -8,7 +8,7 @@ #define DISTANCE_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/l0/distance/lib/Distance/vl53l0x_drv.h b/examples/projects/l0/distance/lib/Distance/vl53l0x_drv.h index d5ee34a83..1f0c68b37 100644 --- a/examples/projects/l0/distance/lib/Distance/vl53l0x_drv.h +++ b/examples/projects/l0/distance/lib/Distance/vl53l0x_drv.h @@ -10,7 +10,7 @@ #include "stdbool.h" #include "stm32f0xx_hal.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/l0/distance/platformio.ini b/examples/projects/l0/distance/platformio.ini index 24e83b80b..681a3bed1 100644 --- a/examples/projects/l0/distance/platformio.ini +++ b/examples/projects/l0/distance/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Distance debug_tool = stlink diff --git a/examples/projects/l0/distance/src/main.c b/examples/projects/l0/distance/src/main.c index 3c67f8f62..642dc2f18 100644 --- a/examples/projects/l0/distance/src/main.c +++ b/examples/projects/l0/distance/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "distance.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/dxl/lib/Dxl/dxl.h b/examples/projects/l0/dxl/lib/Dxl/dxl.h index 39bc01bab..3ff639527 100644 --- a/examples/projects/l0/dxl/lib/Dxl/dxl.h +++ b/examples/projects/l0/dxl/lib/Dxl/dxl.h @@ -8,7 +8,7 @@ #define DXL_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/dxl/platformio.ini b/examples/projects/l0/dxl/platformio.ini index d0f1b6431..7ca224034 100644 --- a/examples/projects/l0/dxl/platformio.ini +++ b/examples/projects/l0/dxl/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Dxl debug_tool = stlink diff --git a/examples/projects/l0/dxl/src/main.c b/examples/projects/l0/dxl/src/main.c index 1e52558ae..6483d7567 100644 --- a/examples/projects/l0/dxl/src/main.c +++ b/examples/projects/l0/dxl/src/main.c @@ -28,7 +28,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "dxl.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/fingerprint/lib/Fingerprint/fingerprint.h b/examples/projects/l0/fingerprint/lib/Fingerprint/fingerprint.h index 0a4b0bf37..89577a452 100644 --- a/examples/projects/l0/fingerprint/lib/Fingerprint/fingerprint.h +++ b/examples/projects/l0/fingerprint/lib/Fingerprint/fingerprint.h @@ -11,7 +11,7 @@ #define FINGERPRINT_H_ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/fingerprint/platformio.ini b/examples/projects/l0/fingerprint/platformio.ini index bfc2b5814..7cc1245b2 100644 --- a/examples/projects/l0/fingerprint/platformio.ini +++ b/examples/projects/l0/fingerprint/platformio.ini @@ -13,12 +13,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Fingerprint debug_tool = stlink diff --git a/examples/projects/l0/fingerprint/src/main.c b/examples/projects/l0/fingerprint/src/main.c index 8d5e0d2d2..9045e308f 100644 --- a/examples/projects/l0/fingerprint/src/main.c +++ b/examples/projects/l0/fingerprint/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "fingerprint.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/gate_serialcom/platformio.ini b/examples/projects/l0/gate_serialcom/platformio.ini index 848c22558..08675e8ff 100644 --- a/examples/projects/l0/gate_serialcom/platformio.ini +++ b/examples/projects/l0/gate_serialcom/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Pipe Gate debug_tool = stlink diff --git a/examples/projects/l0/gate_serialcom/src/main.c b/examples/projects/l0/gate_serialcom/src/main.c index 931c947e6..02288f479 100644 --- a/examples/projects/l0/gate_serialcom/src/main.c +++ b/examples/projects/l0/gate_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "pipe.h" #include "gate.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/gpio/platformio.ini b/examples/projects/l0/gpio/platformio.ini index 796611b68..1f63f5dcf 100644 --- a/examples/projects/l0/gpio/platformio.ini +++ b/examples/projects/l0/gpio/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../network/ + $PROJECT_DIR/../../../../../ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Gpio_dev debug_tool = stlink diff --git a/examples/projects/l0/gpio/src/main.c b/examples/projects/l0/gpio/src/main.c index d82c4a012..67b1c8c72 100644 --- a/examples/projects/l0/gpio/src/main.c +++ b/examples/projects/l0/gpio/src/main.c @@ -26,7 +26,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "gpio_dev.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/imu/lib/Imu/imu.h b/examples/projects/l0/imu/lib/Imu/imu.h index bf7873ebd..4bec85306 100644 --- a/examples/projects/l0/imu/lib/Imu/imu.h +++ b/examples/projects/l0/imu/lib/Imu/imu.h @@ -8,7 +8,7 @@ #define IMU_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/imu/lib/Imu/mpu_configuration.c b/examples/projects/l0/imu/lib/Imu/mpu_configuration.c index 60b66ea65..e53f5fda6 100644 --- a/examples/projects/l0/imu/lib/Imu/mpu_configuration.c +++ b/examples/projects/l0/imu/lib/Imu/mpu_configuration.c @@ -1,6 +1,6 @@ #include #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "invensense.h" #include "invensense_adv.h" #include "mpu.h" diff --git a/examples/projects/l0/imu/lib/Imu/mpu_configuration.h b/examples/projects/l0/imu/lib/Imu/mpu_configuration.h index 3cb025958..10af26034 100644 --- a/examples/projects/l0/imu/lib/Imu/mpu_configuration.h +++ b/examples/projects/l0/imu/lib/Imu/mpu_configuration.h @@ -2,7 +2,7 @@ #define __MPU_SETUP_H__ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include #include #include diff --git a/examples/projects/l0/imu/platformio.ini b/examples/projects/l0/imu/platformio.ini index 294442d8d..37729645f 100644 --- a/examples/projects/l0/imu/platformio.ini +++ b/examples/projects/l0/imu/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Imu debug_tool = stlink diff --git a/examples/projects/l0/imu/src/main.c b/examples/projects/l0/imu/src/main.c index f607c2824..9272d969c 100644 --- a/examples/projects/l0/imu/src/main.c +++ b/examples/projects/l0/imu/src/main.c @@ -47,7 +47,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "imu.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/inspector_serialcom/platformio.ini b/examples/projects/l0/inspector_serialcom/platformio.ini index a7deab40d..776b3eb22 100644 --- a/examples/projects/l0/inspector_serialcom/platformio.ini +++ b/examples/projects/l0/inspector_serialcom/platformio.ini @@ -15,11 +15,13 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Pipe Inspector debug_tool = stlink diff --git a/examples/projects/l0/inspector_serialcom/src/main.c b/examples/projects/l0/inspector_serialcom/src/main.c index 79d7838de..5e840ac2a 100644 --- a/examples/projects/l0/inspector_serialcom/src/main.c +++ b/examples/projects/l0/inspector_serialcom/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "pipe.h" #include "inspector.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/lcd/lib/Lcd/lcd.h b/examples/projects/l0/lcd/lib/Lcd/lcd.h index c371e7648..502449b5f 100644 --- a/examples/projects/l0/lcd/lib/Lcd/lcd.h +++ b/examples/projects/l0/lcd/lib/Lcd/lcd.h @@ -11,7 +11,7 @@ #define LCD_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/lcd/platformio.ini b/examples/projects/l0/lcd/platformio.ini index 4f3b2a79e..9efb7ad63 100644 --- a/examples/projects/l0/lcd/platformio.ini +++ b/examples/projects/l0/lcd/platformio.ini @@ -13,12 +13,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Lcd debug_tool = stlink diff --git a/examples/projects/l0/lcd/src/main.c b/examples/projects/l0/lcd/src/main.c index 32cda4486..c58db43d0 100644 --- a/examples/projects/l0/lcd/src/main.c +++ b/examples/projects/l0/lcd/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "lcd.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/led/lib/Led/led.h b/examples/projects/l0/led/lib/Led/led.h index 4a8a99bf4..e606ea77c 100644 --- a/examples/projects/l0/led/lib/Led/led.h +++ b/examples/projects/l0/led/lib/Led/led.h @@ -8,7 +8,7 @@ #define LED_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/led/lib/Led/led_drv.h b/examples/projects/l0/led/lib/Led/led_drv.h index 845ab495e..a5970428e 100644 --- a/examples/projects/l0/led/lib/Led/led_drv.h +++ b/examples/projects/l0/led/lib/Led/led_drv.h @@ -8,7 +8,7 @@ #define LED_DRV_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "stm32f0xx_hal.h" #include "stm32f0xx_ll_exti.h" #include "stm32f0xx_ll_system.h" diff --git a/examples/projects/l0/led/platformio.ini b/examples/projects/l0/led/platformio.ini index 9910d533e..ffd0fa36f 100644 --- a/examples/projects/l0/led/platformio.ini +++ b/examples/projects/l0/led/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Led debug_tool = stlink diff --git a/examples/projects/l0/led/src/main.c b/examples/projects/l0/led/src/main.c index ef26a1e4e..5b0514c57 100644 --- a/examples/projects/l0/led/src/main.c +++ b/examples/projects/l0/led/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "led.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/led_fader/lib/Led_Fader/led_fader.h b/examples/projects/l0/led_fader/lib/Led_Fader/led_fader.h index e458e3b98..f7b91d2d0 100644 --- a/examples/projects/l0/led_fader/lib/Led_Fader/led_fader.h +++ b/examples/projects/l0/led_fader/lib/Led_Fader/led_fader.h @@ -8,7 +8,7 @@ #define LED_FADER_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/led_fader/lib/Led_Fader/ledfader_drv.h b/examples/projects/l0/led_fader/lib/Led_Fader/ledfader_drv.h index d60f8b180..b31fac54c 100644 --- a/examples/projects/l0/led_fader/lib/Led_Fader/ledfader_drv.h +++ b/examples/projects/l0/led_fader/lib/Led_Fader/ledfader_drv.h @@ -8,7 +8,7 @@ #define LEDFADER_DRV_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "stm32f0xx_hal.h" #include "stm32f0xx_ll_exti.h" #include "stm32f0xx_ll_system.h" diff --git a/examples/projects/l0/led_fader/platformio.ini b/examples/projects/l0/led_fader/platformio.ini index 3a4930d6b..998653c89 100644 --- a/examples/projects/l0/led_fader/platformio.ini +++ b/examples/projects/l0/led_fader/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Led_Fader debug_tool = stlink diff --git a/examples/projects/l0/led_fader/src/main.c b/examples/projects/l0/led_fader/src/main.c index 6a9bcbeef..099939a54 100644 --- a/examples/projects/l0/led_fader/src/main.c +++ b/examples/projects/l0/led_fader/src/main.c @@ -23,7 +23,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "led_fader.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/led_strip/lib/Led_strip/led_strip.h b/examples/projects/l0/led_strip/lib/Led_strip/led_strip.h index b86ed3feb..c0dfdb5ed 100644 --- a/examples/projects/l0/led_strip/lib/Led_strip/led_strip.h +++ b/examples/projects/l0/led_strip/lib/Led_strip/led_strip.h @@ -8,7 +8,7 @@ #define LED_STRIP_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/led_strip/lib/Led_strip/led_strip_drv.h b/examples/projects/l0/led_strip/lib/Led_strip/led_strip_drv.h index 9459e047d..b30b55ad1 100644 --- a/examples/projects/l0/led_strip/lib/Led_strip/led_strip_drv.h +++ b/examples/projects/l0/led_strip/lib/Led_strip/led_strip_drv.h @@ -7,7 +7,7 @@ #include "main.h" #include "tim.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/l0/led_strip/platformio.ini b/examples/projects/l0/led_strip/platformio.ini index 44cdd5196..717bb6508 100644 --- a/examples/projects/l0/led_strip/platformio.ini +++ b/examples/projects/l0/led_strip/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Led_strip debug_tool = stlink diff --git a/examples/projects/l0/led_strip/src/main.c b/examples/projects/l0/led_strip/src/main.c index c5c41f174..fe4711ca9 100644 --- a/examples/projects/l0/led_strip/src/main.c +++ b/examples/projects/l0/led_strip/src/main.c @@ -28,7 +28,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "led_strip.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.h b/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.h index d68dba091..d89813f7a 100644 --- a/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.h +++ b/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor.h @@ -8,7 +8,7 @@ #define LIGHT_SENSOR_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "light_sensor_drv.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor_drv.h b/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor_drv.h index 6fb513491..687a977e1 100644 --- a/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor_drv.h +++ b/examples/projects/l0/light_sensor/lib/Light_sensor/light_sensor_drv.h @@ -15,7 +15,7 @@ #include "analog.h" #include "main.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/l0/light_sensor/platformio.ini b/examples/projects/l0/light_sensor/platformio.ini index 13a47da13..21ec5a56b 100644 --- a/examples/projects/l0/light_sensor/platformio.ini +++ b/examples/projects/l0/light_sensor/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Light_sensor debug_tool = stlink diff --git a/examples/projects/l0/light_sensor/src/main.c b/examples/projects/l0/light_sensor/src/main.c index 787b3e0c2..6cd099915 100644 --- a/examples/projects/l0/light_sensor/src/main.c +++ b/examples/projects/l0/light_sensor/src/main.c @@ -26,7 +26,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "light_sensor.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/load/lib/Load/HX711/HX711.h b/examples/projects/l0/load/lib/Load/HX711/HX711.h index 023e3917b..d303e45d1 100644 --- a/examples/projects/l0/load/lib/Load/HX711/HX711.h +++ b/examples/projects/l0/load/lib/Load/HX711/HX711.h @@ -10,7 +10,7 @@ #include "stm32f0xx_hal.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/l0/load/lib/Load/load.h b/examples/projects/l0/load/lib/Load/load.h index 385f896e0..53cc162e7 100644 --- a/examples/projects/l0/load/lib/Load/load.h +++ b/examples/projects/l0/load/lib/Load/load.h @@ -8,7 +8,7 @@ #define LOAD_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/load/platformio.ini b/examples/projects/l0/load/platformio.ini index 6244dff3e..d0d9f447f 100644 --- a/examples/projects/l0/load/platformio.ini +++ b/examples/projects/l0/load/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Load debug_tool = stlink diff --git a/examples/projects/l0/load/src/main.c b/examples/projects/l0/load/src/main.c index 72acd0320..43fda7571 100644 --- a/examples/projects/l0/load/src/main.c +++ b/examples/projects/l0/load/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "load.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.h b/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.h index 65a31b04d..f169709f5 100644 --- a/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.h +++ b/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer.h @@ -2,7 +2,7 @@ #define POTENTIOMETER_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "potentiometer_drv.h" /******************************************************************************* diff --git a/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer_drv.h b/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer_drv.h index bfdaf2ef3..d85c49424 100644 --- a/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer_drv.h +++ b/examples/projects/l0/potentiometer/lib/Potentiometer/potentiometer_drv.h @@ -7,7 +7,7 @@ #include "main.h" #include "analog.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/l0/potentiometer/platformio.ini b/examples/projects/l0/potentiometer/platformio.ini index 63583470a..8b0c9cb5a 100644 --- a/examples/projects/l0/potentiometer/platformio.ini +++ b/examples/projects/l0/potentiometer/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Potentiometer debug_tool = stlink diff --git a/examples/projects/l0/potentiometer/src/main.c b/examples/projects/l0/potentiometer/src/main.c index 1fbbb6476..6c9610970 100644 --- a/examples/projects/l0/potentiometer/src/main.c +++ b/examples/projects/l0/potentiometer/src/main.c @@ -26,7 +26,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "potentiometer.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/power_switch/platformio.ini b/examples/projects/l0/power_switch/platformio.ini index 011402c5a..8c36ed190 100644 --- a/examples/projects/l0/power_switch/platformio.ini +++ b/examples/projects/l0/power_switch/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Power_switch debug_tool = stlink diff --git a/examples/projects/l0/power_switch/src/main.c b/examples/projects/l0/power_switch/src/main.c index 06ed428ca..d7492570c 100644 --- a/examples/projects/l0/power_switch/src/main.c +++ b/examples/projects/l0/power_switch/src/main.c @@ -26,7 +26,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "power_switch.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/servo/lib/Servo/servo_drv.h b/examples/projects/l0/servo/lib/Servo/servo_drv.h index afd8b0924..f5100b5cb 100644 --- a/examples/projects/l0/servo/lib/Servo/servo_drv.h +++ b/examples/projects/l0/servo/lib/Servo/servo_drv.h @@ -9,7 +9,7 @@ #include "stm32f0xx_hal.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_hal.h" /******************************************************************************* * Definitions diff --git a/examples/projects/l0/servo/platformio.ini b/examples/projects/l0/servo/platformio.ini index facff1a76..6695e2b23 100644 --- a/examples/projects/l0/servo/platformio.ini +++ b/examples/projects/l0/servo/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Servo debug_tool = stlink diff --git a/examples/projects/l0/servo/src/main.c b/examples/projects/l0/servo/src/main.c index 2386861fb..8388a0217 100644 --- a/examples/projects/l0/servo/src/main.c +++ b/examples/projects/l0/servo/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "servo.h" /* USER CODE END Includes */ diff --git a/examples/projects/l0/stepper/platformio.ini b/examples/projects/l0/stepper/platformio.ini index cd3939b60..10c535e08 100644 --- a/examples/projects/l0/stepper/platformio.ini +++ b/examples/projects/l0/stepper/platformio.ini @@ -12,12 +12,15 @@ default_envs = l0 [env] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = ststm32 board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 + robus_network Stepper debug_tool = stlink diff --git a/examples/projects/l0/stepper/src/main.c b/examples/projects/l0/stepper/src/main.c index 598bfc8c6..32ffff370 100644 --- a/examples/projects/l0/stepper/src/main.c +++ b/examples/projects/l0/stepper/src/main.c @@ -27,7 +27,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "stepper.h" /* USER CODE END Includes */ diff --git a/examples/projects/native/button/platformio.ini b/examples/projects/native/button/platformio.ini index dbfef1b3d..122ef09b3 100644 --- a/examples/projects/native/button/platformio.ini +++ b/examples/projects/native/button/platformio.ini @@ -12,10 +12,13 @@ default_envs = native [env:native] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = native lib_deps = Button + robus_network build_unflags = -Os build_flags = -I inc diff --git a/examples/projects/native/button/src/main.c b/examples/projects/native/button/src/main.c index 790d3f117..93434b569 100644 --- a/examples/projects/native/button/src/main.c +++ b/examples/projects/native/button/src/main.c @@ -1,5 +1,5 @@ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "button.h" int main(void) diff --git a/examples/projects/native/gate_wscom/platformio.ini b/examples/projects/native/gate_wscom/platformio.ini index 1faeb2286..cd2b02bcd 100644 --- a/examples/projects/native/gate_wscom/platformio.ini +++ b/examples/projects/native/gate_wscom/platformio.ini @@ -15,9 +15,11 @@ lib_ldf_mode =off lib_extra_dirs = $PROJECT_DIR/../../../../tool_services/ $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = native lib_deps = luos_engine@^3.0.0 + robus_network Pipe Gate build_unflags = -Os diff --git a/examples/projects/native/gate_wscom/src/main.c b/examples/projects/native/gate_wscom/src/main.c index d95e277eb..fe7365b54 100644 --- a/examples/projects/native/gate_wscom/src/main.c +++ b/examples/projects/native/gate_wscom/src/main.c @@ -1,5 +1,5 @@ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "pipe.h" #include "gate.h" #include diff --git a/examples/projects/native/led/lib/Led/led.h b/examples/projects/native/led/lib/Led/led.h index 604a8829a..5efb98688 100644 --- a/examples/projects/native/led/lib/Led/led.h +++ b/examples/projects/native/led/lib/Led/led.h @@ -8,7 +8,6 @@ #define LED_H #include "luos_engine.h" -#include "robus.h" /******************************************************************************* * Definitions diff --git a/examples/projects/native/led/platformio.ini b/examples/projects/native/led/platformio.ini index be0929fde..fa191afac 100644 --- a/examples/projects/native/led/platformio.ini +++ b/examples/projects/native/led/platformio.ini @@ -12,10 +12,13 @@ default_envs = native [env:native] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = native lib_deps = Led + robus_network build_unflags = -Os build_flags = -I inc diff --git a/examples/projects/native/led/src/main.c b/examples/projects/native/led/src/main.c index f76bdba6b..ba4fb4c5f 100644 --- a/examples/projects/native/led/src/main.c +++ b/examples/projects/native/led/src/main.c @@ -1,5 +1,5 @@ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "led.h" int main(void) diff --git a/examples/projects/native/ping_pong/lib/PingPong/graph.c b/examples/projects/native/ping_pong/lib/PingPong/graph.c index a48cf9d40..7a6ac5cd3 100644 --- a/examples/projects/native/ping_pong/lib/PingPong/graph.c +++ b/examples/projects/native/ping_pong/lib/PingPong/graph.c @@ -6,7 +6,6 @@ #include #include #include "luos_engine.h" -#include "robus.h" #include "game_anim.h" #include "scoring.h" diff --git a/examples/projects/native/ping_pong/lib/PingPong/library.json b/examples/projects/native/ping_pong/lib/PingPong/library.json index b2a974863..dd9b1873b 100644 --- a/examples/projects/native/ping_pong/lib/PingPong/library.json +++ b/examples/projects/native/ping_pong/lib/PingPong/library.json @@ -8,7 +8,7 @@ "url": "https://luos.io" }, "dependencies": { - "luos_engine": "^3.0.0" + "luos_engine": "^3.0.0" }, "licence": "MIT" -} \ No newline at end of file +} diff --git a/examples/projects/native/ping_pong/lib/PingPong/scoring.h b/examples/projects/native/ping_pong/lib/PingPong/scoring.h index fce4edd61..4470feca0 100644 --- a/examples/projects/native/ping_pong/lib/PingPong/scoring.h +++ b/examples/projects/native/ping_pong/lib/PingPong/scoring.h @@ -8,7 +8,6 @@ #define SCORING_H #include "luos_engine.h" -#include "robus.h" #define SCORE_TOPIC 1 #define SCORE_CMD LUOS_LAST_STD_CMD + 1 diff --git a/examples/projects/native/ping_pong/platformio.ini b/examples/projects/native/ping_pong/platformio.ini index 78a6f2da0..d73c1127f 100644 --- a/examples/projects/native/ping_pong/platformio.ini +++ b/examples/projects/native/ping_pong/platformio.ini @@ -12,10 +12,13 @@ default_envs = native [env:native] lib_ldf_mode =off -lib_extra_dirs = $PROJECT_DIR/../../../../../ +lib_extra_dirs = + $PROJECT_DIR/../../../../../ + $PROJECT_DIR/../../../../network/ platform = native lib_deps = PingPong + robus_network build_unflags = -Os build_flags = -I inc diff --git a/examples/projects/native/ping_pong/src/main.c b/examples/projects/native/ping_pong/src/main.c index 17b351006..a9ff780a7 100644 --- a/examples/projects/native/ping_pong/src/main.c +++ b/examples/projects/native/ping_pong/src/main.c @@ -1,5 +1,5 @@ #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "ping_pong.h" #include @@ -22,5 +22,6 @@ int main(void) while (1) { Luos_Loop(); + Robus_Loop(); } } diff --git a/library.json b/library.json index 3bacb32ea..2cb839ea0 100644 --- a/library.json +++ b/library.json @@ -1,7 +1,7 @@ { "name": "luos_engine", - "keywords": "robus,network,microservice,luos,operating system,os,embedded,communication,service,ST,luos engine", - "description": "Luos engine turns your embedded system into services like microservices architecture does it in software.", + "keywords": "network,microservice,luos,operating system,os,embedded,communication,service,ST,luos engine", + "description": "Luos engine is the framework allowing to create software microservices architecture for hardware devices.", "version": "3.0.0", "authors": { "name": "Luos", @@ -13,9 +13,6 @@ "build": { "srcDir": "engine/core/src", "flags": [ - "-I network/robus", - "-I network/robus/inc", - "-I network/robus/selftest", "-I engine", "-I engine/OD", "-I engine/core/inc", @@ -36,20 +33,23 @@ "include": [ "examples/apps/*", "examples/projects/Arduino/*", + "examples/projects/ESP32/*", "examples/projects/l0/*", + "examples/projects/native/*", "examples/projects/NUCLEO-F072RB/*", "examples/projects/NUCLEO-F401RE/*", "examples/projects/NUCLEO-F410RB/*", "examples/projects/NUCLEO-G431KB/*", "examples/projects/NUCLEO-G474RE/*", + "examples/projects/NUCLEO-L073RZ/*", "examples/projects/NUCLEO-L432KC/*", "examples/projects/STM32F4-discovery/*", + "examples/projects/STM32L4S5-discovery/*", "examples/README.md", "engine/*", - "network/*", "source_filter_script.py", "LICENSE", "README.md" ] } -} \ No newline at end of file +} diff --git a/network/robus/HAL/ATSAMD21/robus_hal.c b/network/robus_network/HAL/ATSAMD21/robus_hal.c similarity index 100% rename from network/robus/HAL/ATSAMD21/robus_hal.c rename to network/robus_network/HAL/ATSAMD21/robus_hal.c diff --git a/network/robus/HAL/ATSAMD21/robus_hal.h b/network/robus_network/HAL/ATSAMD21/robus_hal.h similarity index 100% rename from network/robus/HAL/ATSAMD21/robus_hal.h rename to network/robus_network/HAL/ATSAMD21/robus_hal.h diff --git a/network/robus/HAL/ATSAMD21/robus_hal_config.h b/network/robus_network/HAL/ATSAMD21/robus_hal_config.h similarity index 100% rename from network/robus/HAL/ATSAMD21/robus_hal_config.h rename to network/robus_network/HAL/ATSAMD21/robus_hal_config.h diff --git a/network/robus/HAL/ATSAMD21/samd21.h b/network/robus_network/HAL/ATSAMD21/samd21.h similarity index 100% rename from network/robus/HAL/ATSAMD21/samd21.h rename to network/robus_network/HAL/ATSAMD21/samd21.h diff --git a/network/robus/HAL/ATSAMD21_ARDUINO/board_config.h b/network/robus_network/HAL/ATSAMD21_ARDUINO/board_config.h similarity index 100% rename from network/robus/HAL/ATSAMD21_ARDUINO/board_config.h rename to network/robus_network/HAL/ATSAMD21_ARDUINO/board_config.h diff --git a/network/robus/HAL/ATSAMD21_ARDUINO/robus_hal.c b/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.c similarity index 100% rename from network/robus/HAL/ATSAMD21_ARDUINO/robus_hal.c rename to network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.c diff --git a/network/robus/HAL/ATSAMD21_ARDUINO/robus_hal.h b/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.h similarity index 100% rename from network/robus/HAL/ATSAMD21_ARDUINO/robus_hal.h rename to network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.h diff --git a/network/robus/HAL/ATSAMD21_ARDUINO/robus_hal_config.h b/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal_config.h similarity index 100% rename from network/robus/HAL/ATSAMD21_ARDUINO/robus_hal_config.h rename to network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal_config.h diff --git a/network/robus/HAL/ATSAMD21_MBED/robus_hal.c b/network/robus_network/HAL/ATSAMD21_MBED/robus_hal.c similarity index 100% rename from network/robus/HAL/ATSAMD21_MBED/robus_hal.c rename to network/robus_network/HAL/ATSAMD21_MBED/robus_hal.c diff --git a/network/robus/HAL/ATSAMD21_MBED/robus_hal.h b/network/robus_network/HAL/ATSAMD21_MBED/robus_hal.h similarity index 100% rename from network/robus/HAL/ATSAMD21_MBED/robus_hal.h rename to network/robus_network/HAL/ATSAMD21_MBED/robus_hal.h diff --git a/network/robus/HAL/ATSAMD21_MBED/robus_hal_config.h b/network/robus_network/HAL/ATSAMD21_MBED/robus_hal_config.h similarity index 100% rename from network/robus/HAL/ATSAMD21_MBED/robus_hal_config.h rename to network/robus_network/HAL/ATSAMD21_MBED/robus_hal_config.h diff --git a/network/robus/HAL/ATSAMD21_MBED/samd21.h b/network/robus_network/HAL/ATSAMD21_MBED/samd21.h similarity index 100% rename from network/robus/HAL/ATSAMD21_MBED/samd21.h rename to network/robus_network/HAL/ATSAMD21_MBED/samd21.h diff --git a/network/robus/HAL/ESP32/board_config.h b/network/robus_network/HAL/ESP32/board_config.h similarity index 100% rename from network/robus/HAL/ESP32/board_config.h rename to network/robus_network/HAL/ESP32/board_config.h diff --git a/network/robus/HAL/ESP32/luos_engine/CMakeLists.txt b/network/robus_network/HAL/ESP32/luos_engine/CMakeLists.txt similarity index 100% rename from network/robus/HAL/ESP32/luos_engine/CMakeLists.txt rename to network/robus_network/HAL/ESP32/luos_engine/CMakeLists.txt diff --git a/network/robus/HAL/ESP32/luos_engine/linker.lf b/network/robus_network/HAL/ESP32/luos_engine/linker.lf similarity index 100% rename from network/robus/HAL/ESP32/luos_engine/linker.lf rename to network/robus_network/HAL/ESP32/luos_engine/linker.lf diff --git a/network/robus/HAL/ESP32/robus_hal.c b/network/robus_network/HAL/ESP32/robus_hal.c similarity index 100% rename from network/robus/HAL/ESP32/robus_hal.c rename to network/robus_network/HAL/ESP32/robus_hal.c diff --git a/network/robus/HAL/ESP32/robus_hal.h b/network/robus_network/HAL/ESP32/robus_hal.h similarity index 100% rename from network/robus/HAL/ESP32/robus_hal.h rename to network/robus_network/HAL/ESP32/robus_hal.h diff --git a/network/robus/HAL/ESP32/robus_hal_config.h b/network/robus_network/HAL/ESP32/robus_hal_config.h similarity index 100% rename from network/robus/HAL/ESP32/robus_hal_config.h rename to network/robus_network/HAL/ESP32/robus_hal_config.h diff --git a/network/robus/HAL/NATIVE/hal_script.py b/network/robus_network/HAL/NATIVE/hal_script.py similarity index 100% rename from network/robus/HAL/NATIVE/hal_script.py rename to network/robus_network/HAL/NATIVE/hal_script.py diff --git a/network/robus/HAL/NATIVE/robus_hal.c b/network/robus_network/HAL/NATIVE/robus_hal.c similarity index 99% rename from network/robus/HAL/NATIVE/robus_hal.c rename to network/robus_network/HAL/NATIVE/robus_hal.c index c0a1f5bb1..dd1667409 100644 --- a/network/robus/HAL/NATIVE/robus_hal.c +++ b/network/robus_network/HAL/NATIVE/robus_hal.c @@ -20,7 +20,7 @@ #include #include #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_hal.h" /******************************************************************************* diff --git a/network/robus/HAL/NATIVE/robus_hal.h b/network/robus_network/HAL/NATIVE/robus_hal.h similarity index 100% rename from network/robus/HAL/NATIVE/robus_hal.h rename to network/robus_network/HAL/NATIVE/robus_hal.h diff --git a/network/robus/HAL/NATIVE/robus_hal_config.h b/network/robus_network/HAL/NATIVE/robus_hal_config.h similarity index 100% rename from network/robus/HAL/NATIVE/robus_hal_config.h rename to network/robus_network/HAL/NATIVE/robus_hal_config.h diff --git a/network/robus/HAL/README.md b/network/robus_network/HAL/README.md similarity index 100% rename from network/robus/HAL/README.md rename to network/robus_network/HAL/README.md diff --git a/network/robus/HAL/STM32F0/robus_hal.c b/network/robus_network/HAL/STM32F0/robus_hal.c similarity index 100% rename from network/robus/HAL/STM32F0/robus_hal.c rename to network/robus_network/HAL/STM32F0/robus_hal.c diff --git a/network/robus/HAL/STM32F0/robus_hal.h b/network/robus_network/HAL/STM32F0/robus_hal.h similarity index 100% rename from network/robus/HAL/STM32F0/robus_hal.h rename to network/robus_network/HAL/STM32F0/robus_hal.h diff --git a/network/robus/HAL/STM32F0/robus_hal_config.h b/network/robus_network/HAL/STM32F0/robus_hal_config.h similarity index 100% rename from network/robus/HAL/STM32F0/robus_hal_config.h rename to network/robus_network/HAL/STM32F0/robus_hal_config.h diff --git a/network/robus/HAL/STM32F4/robus_hal.c b/network/robus_network/HAL/STM32F4/robus_hal.c similarity index 100% rename from network/robus/HAL/STM32F4/robus_hal.c rename to network/robus_network/HAL/STM32F4/robus_hal.c diff --git a/network/robus/HAL/STM32F4/robus_hal.h b/network/robus_network/HAL/STM32F4/robus_hal.h similarity index 100% rename from network/robus/HAL/STM32F4/robus_hal.h rename to network/robus_network/HAL/STM32F4/robus_hal.h diff --git a/network/robus/HAL/STM32F4/robus_hal_config.h b/network/robus_network/HAL/STM32F4/robus_hal_config.h similarity index 100% rename from network/robus/HAL/STM32F4/robus_hal_config.h rename to network/robus_network/HAL/STM32F4/robus_hal_config.h diff --git a/network/robus/HAL/STM32G4/robus_hal.c b/network/robus_network/HAL/STM32G4/robus_hal.c similarity index 100% rename from network/robus/HAL/STM32G4/robus_hal.c rename to network/robus_network/HAL/STM32G4/robus_hal.c diff --git a/network/robus/HAL/STM32G4/robus_hal.h b/network/robus_network/HAL/STM32G4/robus_hal.h similarity index 100% rename from network/robus/HAL/STM32G4/robus_hal.h rename to network/robus_network/HAL/STM32G4/robus_hal.h diff --git a/network/robus/HAL/STM32G4/robus_hal_config.h b/network/robus_network/HAL/STM32G4/robus_hal_config.h similarity index 100% rename from network/robus/HAL/STM32G4/robus_hal_config.h rename to network/robus_network/HAL/STM32G4/robus_hal_config.h diff --git a/network/robus/HAL/STM32L0/robus_hal.c b/network/robus_network/HAL/STM32L0/robus_hal.c similarity index 100% rename from network/robus/HAL/STM32L0/robus_hal.c rename to network/robus_network/HAL/STM32L0/robus_hal.c diff --git a/network/robus/HAL/STM32L0/robus_hal.h b/network/robus_network/HAL/STM32L0/robus_hal.h similarity index 100% rename from network/robus/HAL/STM32L0/robus_hal.h rename to network/robus_network/HAL/STM32L0/robus_hal.h diff --git a/network/robus/HAL/STM32L0/robus_hal_config.h b/network/robus_network/HAL/STM32L0/robus_hal_config.h similarity index 100% rename from network/robus/HAL/STM32L0/robus_hal_config.h rename to network/robus_network/HAL/STM32L0/robus_hal_config.h diff --git a/network/robus/HAL/STM32L4/robus_hal.c b/network/robus_network/HAL/STM32L4/robus_hal.c similarity index 100% rename from network/robus/HAL/STM32L4/robus_hal.c rename to network/robus_network/HAL/STM32L4/robus_hal.c diff --git a/network/robus/HAL/STM32L4/robus_hal.h b/network/robus_network/HAL/STM32L4/robus_hal.h similarity index 100% rename from network/robus/HAL/STM32L4/robus_hal.h rename to network/robus_network/HAL/STM32L4/robus_hal.h diff --git a/network/robus/HAL/STM32L4/robus_hal_config.h b/network/robus_network/HAL/STM32L4/robus_hal_config.h similarity index 100% rename from network/robus/HAL/STM32L4/robus_hal_config.h rename to network/robus_network/HAL/STM32L4/robus_hal_config.h diff --git a/network/robus/HAL/STUB/robus_hal.c b/network/robus_network/HAL/STUB/robus_hal.c similarity index 100% rename from network/robus/HAL/STUB/robus_hal.c rename to network/robus_network/HAL/STUB/robus_hal.c diff --git a/network/robus/HAL/STUB/robus_hal.h b/network/robus_network/HAL/STUB/robus_hal.h similarity index 100% rename from network/robus/HAL/STUB/robus_hal.h rename to network/robus_network/HAL/STUB/robus_hal.h diff --git a/network/robus/HAL/STUB/robus_hal_config.h b/network/robus_network/HAL/STUB/robus_hal_config.h similarity index 100% rename from network/robus/HAL/STUB/robus_hal_config.h rename to network/robus_network/HAL/STUB/robus_hal_config.h diff --git a/network/robus/HAL/template/robus_hal.c b/network/robus_network/HAL/template/robus_hal.c similarity index 100% rename from network/robus/HAL/template/robus_hal.c rename to network/robus_network/HAL/template/robus_hal.c diff --git a/network/robus/HAL/template/robus_hal.h b/network/robus_network/HAL/template/robus_hal.h similarity index 100% rename from network/robus/HAL/template/robus_hal.h rename to network/robus_network/HAL/template/robus_hal.h diff --git a/network/robus/HAL/template/robus_hal_config.h b/network/robus_network/HAL/template/robus_hal_config.h similarity index 100% rename from network/robus/HAL/template/robus_hal_config.h rename to network/robus_network/HAL/template/robus_hal_config.h diff --git a/network/robus/inc/_robus.h b/network/robus_network/inc/_robus_network.h similarity index 100% rename from network/robus/inc/_robus.h rename to network/robus_network/inc/_robus_network.h diff --git a/network/robus/inc/context.h b/network/robus_network/inc/context.h similarity index 97% rename from network/robus/inc/context.h rename to network/robus_network/inc/context.h index 4e79144fe..69eee25f3 100644 --- a/network/robus/inc/context.h +++ b/network/robus_network/inc/context.h @@ -7,7 +7,7 @@ #ifndef _CONTEXT_H_ #define _CONTEXT_H_ -#include <_robus.h> +#include <_robus_network.h> #include "robus_config.h" #include "port_manager.h" #include "reception.h" diff --git a/network/robus/inc/port_manager.h b/network/robus_network/inc/port_manager.h similarity index 97% rename from network/robus/inc/port_manager.h rename to network/robus_network/inc/port_manager.h index 6b8b0c3d7..a71ba3a73 100644 --- a/network/robus/inc/port_manager.h +++ b/network/robus_network/inc/port_manager.h @@ -7,7 +7,7 @@ #ifndef _PORTMANAGER_H_ #define _PORTMANAGER_H_ -#include <_robus.h> +#include <_robus_network.h> /******************************************************************************* * Definitions diff --git a/network/robus/inc/reception.h b/network/robus_network/inc/reception.h similarity index 98% rename from network/robus/inc/reception.h rename to network/robus_network/inc/reception.h index 25ccf749d..f04abef0a 100644 --- a/network/robus/inc/reception.h +++ b/network/robus_network/inc/reception.h @@ -7,7 +7,7 @@ #ifndef _RECEPTION_H_ #define _RECEPTION_H_ -#include "_robus.h" +#include "_robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/network/robus/inc/robus.h b/network/robus_network/inc/robus_network.h similarity index 100% rename from network/robus/inc/robus.h rename to network/robus_network/inc/robus_network.h diff --git a/network/robus/inc/transmission.h b/network/robus_network/inc/transmission.h similarity index 98% rename from network/robus/inc/transmission.h rename to network/robus_network/inc/transmission.h index d910a4453..a86a963d9 100644 --- a/network/robus/inc/transmission.h +++ b/network/robus_network/inc/transmission.h @@ -7,7 +7,7 @@ #ifndef _TRANSMISSION_H_ #define _TRANSMISSION_H_ -#include "_robus.h" +#include "_robus_network.h" #include "robus_config.h" /******************************************************************************* * Definitions diff --git a/network/robus_network/library.json b/network/robus_network/library.json new file mode 100644 index 000000000..5a692189a --- /dev/null +++ b/network/robus_network/library.json @@ -0,0 +1,23 @@ +{ + "name": "robus_network", + "keywords": "robus,network,microservice,luos,operating system,os,embedded,communication,service", + "description": "A very handy half duplex serial network interface specialy crafted and optimized for Luos.", + "version": "3.0.0", + "authors": { + "name": "Luos", + "url": "https://luos.io" + }, + "homepage": "https://luos.io", + "license": "MIT", + "headers": "robus_network.h", + "build": { + "extraScript": "robus_select_hal_script.py" + }, + "dependencies": { + "luos_engine": "^3.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/Luos-io/luos_engine" + } +} diff --git a/network/robus/robus_config.h b/network/robus_network/robus_config.h similarity index 100% rename from network/robus/robus_config.h rename to network/robus_network/robus_config.h diff --git a/network/robus_network/robus_select_hal_script.py b/network/robus_network/robus_select_hal_script.py new file mode 100644 index 000000000..ced9b644f --- /dev/null +++ b/network/robus_network/robus_select_hal_script.py @@ -0,0 +1,58 @@ +#!/usr/bin/python +from os import path +import sys +import click +from os.path import join, realpath +Import('env') + +click.secho("Robus network build configuration:", underline=True) +# Find the appropriate hal +find_HAL = False +envdefs = env['CPPDEFINES'].copy() +for item in envdefs: + if isinstance(item, tuple) and item[0] == "ROBUSHAL": + find_HAL = True + if (path.exists("HAL/" + item[1])): + click.secho( + "\t* %s HAL selected for Robus network." % item[1], fg="green") + if (path.exists("HAL/" + item[1] + "/hal_script.py")): + # This is an extra script dedicated to this HAL, run it + hal_script_path = realpath("HAL/" + item[1] + "/hal_script.py") + env.SConscript(hal_script_path, exports="env") + click.secho("") + + else: + click.secho("\t* %s Robus network HAL not found" % + item[1], fg="red") + click.secho("") + + env.Append(CPPPATH=[realpath("HAL/" + item[1])]) + env.Append(CPPPATH=[realpath("inc/")]) + env.Append(CPPPATH=[realpath(".")]) + env.Append( + SRC_FILTER=["+<*.c>, +<../HAL/%s/*.c>, ++<../HAL/%s/*.cpp>" % (item[1], item[1])]) + +if (find_HAL == False): + for item in envdefs: + if isinstance(item, tuple) and item[0] == "LUOSHAL": + find_HAL = True + if (path.exists("HAL/" + item[1])): + click.secho( + "\t* %s HAL selected for Robus network." % item[1], fg="green") + if (path.exists("HAL/" + item[1] + "/hal_script.py")): + # This is an extra script dedicated to this HAL, run it + hal_script_path = realpath( + "HAL/" + item[1] + "/hal_script.py") + env.SConscript(hal_script_path, exports="env") + click.secho("") + + else: + click.secho("\t* %s Robus network HAL not found" % + item[1], fg="red") + click.secho("") + + env.Append(CPPPATH=[realpath("HAL/" + item[1])]) + env.Append(CPPPATH=[realpath("inc/")]) + env.Append(CPPPATH=[realpath(".")]) + env.Append( + SRC_FILTER=["+<*.c>, +<../HAL/%s/*.c>, ++<../HAL/%s/*.cpp>" % (item[1], item[1])]) diff --git a/network/robus/selftest/selftest.c b/network/robus_network/selftest/selftest.c similarity index 100% rename from network/robus/selftest/selftest.c rename to network/robus_network/selftest/selftest.c diff --git a/network/robus/selftest/selftest.h b/network/robus_network/selftest/selftest.h similarity index 94% rename from network/robus/selftest/selftest.h rename to network/robus_network/selftest/selftest.h index ad50af925..cb72ce73e 100644 --- a/network/robus/selftest/selftest.h +++ b/network/robus_network/selftest/selftest.h @@ -8,7 +8,7 @@ #define SELFTEST_H #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" void selftest_SetRxFlag(void); void selftest_run(void (*ok_callback)(void), void (*ko_callback)(void)); diff --git a/network/robus/src/port_manager.c b/network/robus_network/src/port_manager.c similarity index 100% rename from network/robus/src/port_manager.c rename to network/robus_network/src/port_manager.c diff --git a/network/robus/src/reception.c b/network/robus_network/src/reception.c similarity index 99% rename from network/robus/src/reception.c rename to network/robus_network/src/reception.c index aaf89f0e3..987fc393a 100644 --- a/network/robus/src/reception.c +++ b/network/robus_network/src/reception.c @@ -44,7 +44,7 @@ #include #include "reception.h" #include "robus_hal.h" -#include "robus.h" +#include "robus_network.h" #include "context.h" /******************************************************************************* * Definitions diff --git a/network/robus/src/robus.c b/network/robus_network/src/robus.c similarity index 99% rename from network/robus/src/robus.c rename to network/robus_network/src/robus.c index 576ab8b9b..4faf22f3e 100644 --- a/network/robus/src/robus.c +++ b/network/robus_network/src/robus.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include #include -#include "robus.h" +#include "robus_network.h" #include "transmission.h" #include "reception.h" #include "port_manager.h" diff --git a/network/robus/src/transmission.c b/network/robus_network/src/transmission.c similarity index 100% rename from network/robus/src/transmission.c rename to network/robus_network/src/transmission.c diff --git a/platformio.ini b/platformio.ini index efd7d324a..a9c82b9a1 100644 --- a/platformio.ini +++ b/platformio.ini @@ -17,9 +17,12 @@ platform = native lib_deps= throwtheswitch/Unity + robus_network test_framework = unity -lib_extra_dirs = $PROJECT_DIR/../ +lib_extra_dirs = + $PROJECT_DIR/network/ # include the folder hosting robus_network + $PROJECT_DIR/../ # include the folder hosting Luos_engine build_unflags = -Os build_flags = @@ -33,4 +36,4 @@ build_type = debug test_build_src = true ; To debug a test, replace "test_template" by the directory test name you want to debug (example : "test_msg_alloc") -debug_test = tests_io/test_msg_alloc +debug_test = tests_core/tests_od/test_pressure diff --git a/source_filter_script.py b/source_filter_script.py index 7c208ab38..2ae3fbbbd 100644 --- a/source_filter_script.py +++ b/source_filter_script.py @@ -38,7 +38,8 @@ # install pyluos try: import pyluos - env.Execute("$PYTHONEXE -m pip install pyluos --upgrade --quiet") + # env.Execute( + # "$PYTHONEXE -m pip install pyluos --upgrade --quiet") except ImportError: # module doesn't exist, deal with it. env.Execute("$PYTHONEXE -m pip install pyluos") pass @@ -53,9 +54,7 @@ luos_telemetry["pyluos_rev"] = "none" sources = ["+<*.c>", - "+<../../../network/robus/src/*.c>", "+<../../IO/src/*.c>", - "+<../../../network/robus/selftest/*.c>", "+<../../profiles/state/*.c>", "+<../../profiles/motor/*.c>", "+<../../profiles/servo_motor/*.c>", @@ -69,16 +68,11 @@ for item in envdefs: if (isinstance(item, tuple) and item[0] == "LUOSHAL") and (find_HAL == False): find_HAL = True - if (path.exists("network/robus/HAL/" + item[1]) and path.exists("engine/HAL/" + item[1])): + if (path.exists("engine/HAL/" + item[1])): if not visited_key in global_env: click.secho( - "\t* %s HAL selected for Luos and Robus." % item[1], fg="green") + "\t* %s HAL selected for luos_engine." % item[1], fg="green") luos_telemetry["luos_hal"] = item[1] - if (path.exists("network/robus/HAL/" + item[1] + "/hal_script.py")): - # This is an extra script dedicated to this HAL, run it - hal_script_path = realpath( - "network/robus/HAL/" + item[1] + "/hal_script.py") - env.SConscript(hal_script_path, exports="env") if (path.exists("engine/HAL/" + item[1] + "/hal_script.py")): # This is an extra script dedicated to this HAL, run it hal_script_path = realpath( @@ -88,10 +82,7 @@ if not visited_key in global_env: click.secho("\t* %s HAL not found" % item[1], fg="red") luos_telemetry["luos_hal"] = "invalid" + str(item[1]) - env.Append(CPPPATH=[realpath("network/robus/HAL/" + item[1])]) env.Append(CPPPATH=[realpath("engine/HAL/" + item[1])]) - env.Append( - SRC_FILTER=["+<../../../network/robus/HAL/%s/*.c>" % item[1]]) env.Append(SRC_FILTER=["+<../../HAL/%s/*.c>" % item[1]]) if (item == 'NOTELEMETRY'): telemetry = False @@ -118,7 +109,7 @@ if (item == 'UNIT_TEST'): click.secho("Native unit testing:", underline=True) current_os = pf.system() - click.secho("\t* Native Mock HAL for %s is selected for Luos and Robus." % + click.secho("\t* Native Mock HAL for %s is selected for Luos." % current_os, fg="green") env.Append(SRC_FILTER=["+<../../../test/_resources/*>"]) for resources in scandir(getcwd() + "/test/_resources"): diff --git a/test/_resources/Unity/unit_test.h b/test/_resources/Unity/unit_test.h index 19fec4537..5cc79304c 100644 --- a/test/_resources/Unity/unit_test.h +++ b/test/_resources/Unity/unit_test.h @@ -6,9 +6,8 @@ #include #include "../../../.pio/libdeps/native/Unity/src/unity.h" #include "luos_hal.h" -#include "robus_hal.h" #include "luos_engine.h" -#include "robus.h" +#include "robus_network.h" #include "luos_utils.h" #include diff --git a/test/_resources/node_config.h b/test/_resources/node_config.h index dac293479..3573b6828 100644 --- a/test/_resources/node_config.h +++ b/test/_resources/node_config.h @@ -12,8 +12,7 @@ * with your need concerning among of data transiting through the network * or network speed for example * - * Luos libraries can be use with a lot a MCU family. Luos compagny give you - * a default configuration, for specific MCU family, in robus_hal_config.h. + * Luos libraries can be use with a lot a MCU family. * This configuration can be modify here to fit with you design by * preprocessor definitions of MCU Hardware needs * From dc6f2585967db273ac0b4591001ae823aab65b4f Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 5 Jul 2023 19:04:38 +0200 Subject: [PATCH 098/150] Modify master detection to be non-blocking. This allows networks to manage reception and send in loop. --- engine/IO/inc/luos_io.h | 2 +- engine/IO/src/luos_io.c | 289 +++++++++++++++++++----------- engine/core/inc/routing_table.h | 2 +- engine/core/src/routing_table.c | 248 +++++++++++++++---------- test/tests_io/test_luos_io/main.c | 19 -- 5 files changed, 342 insertions(+), 218 deletions(-) diff --git a/engine/IO/inc/luos_io.h b/engine/IO/inc/luos_io.h index ac2da676c..473e5857b 100644 --- a/engine/IO/inc/luos_io.h +++ b/engine/IO/inc/luos_io.h @@ -25,7 +25,7 @@ // generic functions void LuosIO_Init(void); void LuosIO_Loop(void); -uint16_t LuosIO_TopologyDetection(service_t *service, connection_t *connection_table); +int LuosIO_TopologyDetection(service_t *service, connection_t *connection_table); error_return_t LuosIO_Send(service_t *service, msg_t *msg); // Job management diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 775ae7d28..59ff104c3 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -19,8 +19,8 @@ /******************************************************************************* * Definitions ******************************************************************************/ -static error_return_t LuosIO_StartTopologyDetection(service_t *service); -static error_return_t LuosIO_DetectNextNodes(service_t *service); +static int LuosIO_StartTopologyDetection(service_t *service); +static int LuosIO_DetectNextNodes(service_t *service); static error_return_t LuosIO_ConsumeMsg(const msg_t *input); static void LuosIO_TransmitLocalRoutingTable(service_t *service, msg_t *routeTB_msg); @@ -91,6 +91,7 @@ void LuosIO_Init(void) ******************************************************************************/ void LuosIO_Loop(void) { + static bool detec_state_machine = false; // Execute message allocation tasks MsgAlloc_Loop(); Phy_Loop(); @@ -102,8 +103,18 @@ void LuosIO_Loop(void) detection_service->id = 1; // Generate the filters Service_GenerateId(1); - RoutingTB_DetectServices(detection_service); - detection_service = NULL; + // Turn on the infinite loop to perform the detection + detec_state_machine = true; + } + if (detec_state_machine == true) + { + // Check if the detection is finished + if (RoutingTB_DetectServices(detection_service)) + { + // Turn off the infinite loop + detec_state_machine = false; + detection_service = NULL; + } } } @@ -187,47 +198,75 @@ error_return_t LuosIO_Send(service_t *service, msg_t *msg) * @param service pointer to the detecting service * @return The number of detected node. ******************************************************************************/ -uint16_t LuosIO_TopologyDetection(service_t *service, connection_t *connection_table) +int LuosIO_TopologyDetection(service_t *service, connection_t *connection_table) { - uint8_t redetect_nb = 0; - bool detect_enabled = true; - connection_table_ptr = connection_table; + static uint8_t redetect_nb = 0; + static uint8_t detect_state_machine = 0; + int result; - // If a detection is in progress, don't do an another detection and return 0 - if (Node_GetState() >= LOCAL_DETECTION) + switch (detect_state_machine) { - connection_table_ptr = NULL; - return 0; - } - while (detect_enabled) - { - detect_enabled = false; - - // Reset all detection state of services on the network to start a new detection - LuosIO_StartTopologyDetection(service); - // Make sure that the detection is not interrupted - if (Node_GetState() == EXTERNAL_DETECTION) - { - connection_table_ptr = NULL; - return 0; - } - // Setup local node - Node_Get()->node_id = 1; - last_node = 1; - // Setup sending service id - service->id = 1; - // Consider this node as ready - // Clear the nodeID waiting flag - Node_WaitId(); - - if (LuosIO_DetectNextNodes(service) == FAILED) - { - // check the number of retry we made - LUOS_ASSERT((redetect_nb <= 4)); - // Detection fail, restart it - redetect_nb++; - detect_enabled = true; - } + case 0: + connection_table_ptr = connection_table; + // If a detection is in progress, don't do an another detection and return 0 + if (Node_GetState() >= LOCAL_DETECTION) + { + connection_table_ptr = NULL; + return -1; + } + detect_state_machine++; + case 1: + // Reset all detection state of services on the network to start a new detection + result = LuosIO_StartTopologyDetection(service); + if (result <= 0) + { + return result; + } + detect_state_machine++; + case 2: + // Make sure that the detection is not interrupted + if (Node_GetState() == EXTERNAL_DETECTION) + { + connection_table_ptr = NULL; + return -1; + } + // Setup local node + Node_Get()->node_id = 1; + last_node = 1; + // Setup sending service id + service->id = 1; + // Consider this node as ready + // Clear the nodeID waiting flag + Node_WaitId(); + detect_state_machine++; + case 3: + // results: + // -1 : detection failed + // 0 : detection in progress + // 1 : detection finished + result = LuosIO_DetectNextNodes(service); + if (result == -1) + { + // check the number of retry we made + LUOS_ASSERT((redetect_nb <= 4)); + // Detection fail, restart it + redetect_nb++; + // Go back to stage 1 + detect_state_machine = 1; + return 0; + } + if (result == 0) + { + // Detection in progress + return 0; + } + // We finished the topology detection + detect_state_machine = 0; + redetect_nb = 0; + break; + default: + LUOS_ASSERT(0); + break; } connection_table_ptr = NULL; return last_node; @@ -238,53 +277,80 @@ uint16_t LuosIO_TopologyDetection(service_t *service, connection_t *connection_t * @param service pointer to the detecting service * @return The number of detected node. ******************************************************************************/ -static error_return_t LuosIO_StartTopologyDetection(service_t *service) +static int LuosIO_StartTopologyDetection(service_t *service) { + static uint8_t detect_state_machine = 0; + static uint32_t start_tick; msg_t msg; - uint8_t try_nbr = 0; - msg.header.target = BROADCAST_VAL; - msg.header.target_mode = BROADCAST; - msg.header.cmd = START_DETECTION; - msg.header.size = 0; - do - { - // If a detection is in progress, don't do an another detection and return 0 - if (Node_GetState() >= LOCAL_DETECTION) - { - return 0; - } - // Load the message to send - Luos_SendMsg(service, &msg); - // Wait until message is actually transmitted - while (Phy_TxAllComplete() != SUCCEED) - ; - // Reinit Phy (this will call LuosIO_Reset) - Phy_ResetAll(); - // Wait 2ms to be sure all previous messages are received and treated by other nodes - uint32_t start_tick = LuosHAL_GetSystick(); - while (LuosHAL_GetSystick() - start_tick < 2) - ; - // Resend the message just to be sure that no other messages were revceived during the reset. - Luos_SendMsg(service, &msg); - // Wait until message is actually transmitted - while (Phy_TxAllComplete() != SUCCEED) - ; - // Wait 2ms to be sure all previous messages are received and treated by other nodes - start_tick = LuosHAL_GetSystick(); - while (LuosHAL_GetSystick() - start_tick < 2) - ; - try_nbr++; - - } while ((MsgAlloc_IsEmpty() != SUCCEED) || (try_nbr > 5)); - // Reinit our node id - Node_Get()->node_id = 0; - if (try_nbr < 5) + switch (detect_state_machine) { - Node_SetState(LOCAL_DETECTION); - return SUCCEED; + case 0: + // If a detection is in progress, don't do an another detection and return 0 + if (Node_GetState() >= LOCAL_DETECTION) + { + return -1; + } + // Load the message to send + msg.header.target = BROADCAST_VAL; + msg.header.target_mode = BROADCAST; + msg.header.cmd = START_DETECTION; + msg.header.size = 0; + Luos_SendMsg(service, &msg); + detect_state_machine++; + case 1: + // Wait until the message is transmitted + if (Phy_TxAllComplete() != SUCCEED) + { + return 0; + } + detect_state_machine++; + case 2: + // Reinit Phy (this will call LuosIO_Reset) + Phy_ResetAll(); + // Wait 2ms to be sure all previous messages are received and treated by other nodes + start_tick = LuosHAL_GetSystick(); + detect_state_machine++; + case 3: + // Wait 2ms for the other to manage the message + if (LuosHAL_GetSystick() - start_tick < 2) + { + return 0; + } + detect_state_machine++; + case 4: + // Resend the message just to be sure that no other messages were revceived during the reset. + msg.header.target = BROADCAST_VAL; + msg.header.target_mode = BROADCAST; + msg.header.cmd = START_DETECTION; + msg.header.size = 0; + Luos_SendMsg(service, &msg); + detect_state_machine++; + case 5: + // Wait until the message is transmitted + if (Phy_TxAllComplete() != SUCCEED) + { + return 0; + } + start_tick = LuosHAL_GetSystick(); + detect_state_machine++; + case 6: + // Wait 2ms to be sure all previous messages are received and treated by other nodes + if (LuosHAL_GetSystick() - start_tick < 2) + { + return 0; + } + + // Reinit our node id + Node_Get()->node_id = 0; + Node_SetState(LOCAL_DETECTION); + detect_state_machine = 0; + return 1; + default: + LUOS_ASSERT(0); + break; } - return FAILED; + return -1; } /****************************************************************************** @@ -575,28 +641,49 @@ static inline void LuosIO_TransmitLocalRoutingTable(service_t *service, msg_t *r * @param service pointer to the detecting service * @return None. ******************************************************************************/ -static error_return_t LuosIO_DetectNextNodes(service_t *service) +static int LuosIO_DetectNextNodes(service_t *service) { - // Lets try to find other nodes - while (Phy_FindNextNode() == SUCCEED) + static uint8_t detect_state_machine = 0; + static uint32_t start_tick; + + switch (detect_state_machine) { - // Wait the end of transmission - while (Phy_TxAllComplete() == FAILED) - ; - // When phy loop will receive the reply it will store and manage the new node_id and send it to the next node. - // We just have to wait the end of the treatment of the entire branch - uint32_t start_tick = LuosHAL_GetSystick(); - while (Phy_Busy()) - { - LuosIO_Loop(); - if (LuosHAL_GetSystick() - start_tick > DETECTION_TIMEOUT_MS) + case 0: + // Lets try to find other nodes + if (Phy_FindNextNode() != SUCCEED) { - // Topology detection is too long, we should abort it and restart - return FAILED; + // No more nodes to detect + return 1; } - } + detect_state_machine++; + case 1: + // Wait the end of transmission + if (Phy_TxAllComplete() == FAILED) + { + // Transmission is not finished + return 0; + } + start_tick = LuosHAL_GetSystick(); + detect_state_machine++; + case 2: + // When phy loop will receive the reply it will store and manage the new node_id and send it to the next node. + // We just have to wait the end of the treatment of the entire branch + if (Phy_Busy()) + { + if (LuosHAL_GetSystick() - start_tick > DETECTION_TIMEOUT_MS) + { + // Topology detection is too long, we should abort it and restart + return -1; + } + return 0; + } + detect_state_machine = 0; + return 1; + default: + LUOS_ASSERT(0); + break; } - return SUCCEED; + return -1; } /****************************************************************************** diff --git a/engine/core/inc/routing_table.h b/engine/core/inc/routing_table.h index a50dfb946..1b0890497 100644 --- a/engine/core/inc/routing_table.h +++ b/engine/core/inc/routing_table.h @@ -73,7 +73,7 @@ uint16_t RoutingTB_NodeIDFromID(uint16_t id); // ********************* routing_table management tools ************************ void RoutingTB_ComputeRoutingTableEntryNB(void); -void RoutingTB_DetectServices(service_t *service); +bool RoutingTB_DetectServices(service_t *service); void RoutingTB_ConvertNodeToRoutingTable(routing_table_t *entry, node_t *node); void RoutingTB_ConvertServiceToRoutingTable(routing_table_t *entry, service_t *service); void RoutingTB_RemoveNode(uint16_t nodeid); diff --git a/engine/core/src/routing_table.c b/engine/core/src/routing_table.c index 89d3104f3..f07433caf 100644 --- a/engine/core/src/routing_table.c +++ b/engine/core/src/routing_table.c @@ -30,9 +30,8 @@ uint16_t RoutingTB_IDFromAlias(char *alias); char *RoutingTB_AliasFromId(uint16_t id); static uint16_t RoutingTB_BigestNodeID(void); uint16_t RoutingTB_GetServiceIndex(uint16_t id); -bool RoutingTB_WaitRoutingTable(service_t *service, msg_t *intro_msg); -static void RoutingTB_Generate(service_t *service, uint16_t nb_node, connection_t *connection_table); +static int RoutingTB_Generate(service_t *service, uint16_t nb_node, connection_t *connection_table); static void RoutingTB_Share(service_t *service, uint16_t nb_node); static void RoutingTB_SendEndDetection(service_t *service); @@ -155,7 +154,7 @@ void RoutingTB_ComputeRoutingTableEntryNB(void) { for (uint16_t i = 0; i < MAX_RTB_ENTRY; i++) { - if (routing_table[i].mode == SERVICE) + if ((routing_table[i].mode == SERVICE) && (last_service < routing_table[i].id)) { last_service = routing_table[i].id; } @@ -205,95 +204,111 @@ static void RoutingTB_AddNumToAlias(char *alias, uint8_t num) sprintf(alias, "%s%d", alias_copy, num); } -/****************************************************************************** - * @brief Time out to receive en route table from - * @param service : Service receive - * @param intro_msg : into route table message - * @return None - ******************************************************************************/ -bool RoutingTB_WaitRoutingTable(service_t *service, msg_t *intro_msg) -{ - LUOS_ASSERT((service != 0) && (intro_msg != 0)); - const uint8_t timeout = 15; // timeout in ms - const uint16_t entry_bkp = last_routing_table_entry; - Luos_SendMsg(service, intro_msg); - uint32_t timestamp = LuosHAL_GetSystick(); - while ((LuosHAL_GetSystick() - timestamp) < timeout) - { - // If this request is for a service in this board allow him to respond. - Luos_Loop(); - if (entry_bkp != last_routing_table_entry) - { - return true; - } - } - return false; -} - /****************************************************************************** * @brief Generate Complete route table with local route table receive * @param service : Service in node * @param nb_node : Node number on network * @return None ******************************************************************************/ -static void RoutingTB_Generate(service_t *service, uint16_t nb_node, connection_t *connection_table) +static int RoutingTB_Generate(service_t *service, uint16_t nb_node, connection_t *connection_table) { LUOS_ASSERT(service); // Asks for introduction for every found node (even the one detecting). - uint16_t try_nb = 0; - uint16_t last_node_id = RoutingTB_BigestNodeID(); - uint16_t last_service_id = 0; + uint16_t try_nb = 0; + static uint16_t last_node_id = 0; + uint16_t last_service_id = 0; msg_t intro_msg; - while ((last_node_id < nb_node) && (try_nb < nb_node)) + uint16_t nb_service; + static uint16_t rtb_next_node_index; + static uint8_t detect_state_machine = 0; + static uint16_t entry_bkp; + static uint32_t timestamp; + + switch (detect_state_machine) { - try_nb++; - intro_msg.header.cmd = LOCAL_RTB; - intro_msg.header.target_mode = NODEIDACK; - // Target next unknown node - intro_msg.header.target = last_node_id + 1; - // set the first service id it can use - intro_msg.header.size = 2; - last_service_id = RoutingTB_BigestID() + 1; - memcpy(intro_msg.data, &last_service_id, sizeof(uint16_t)); - // save the current last routing table entry allowing us to easily write the connection informations later - uint16_t rtb_next_node_index = RoutingTB_GetLastEntry(); - // Ask to introduce and wait for a reply - if (!RoutingTB_WaitRoutingTable(service, &intro_msg)) - { - // We don't get the answer - nb_node = last_node_id; + case 0: + if ((last_node_id >= nb_node) || (try_nb >= nb_node)) + { + // Go to check alias duplication step + detect_state_machine = 2; + return 0; + } + try_nb++; + intro_msg.header.cmd = LOCAL_RTB; + intro_msg.header.target_mode = NODEIDACK; + // Target next unknown node + intro_msg.header.target = last_node_id + 1; + // set the first service id it can use + intro_msg.header.size = 2; + last_service_id = RoutingTB_BigestID() + 1; + memcpy(intro_msg.data, &last_service_id, sizeof(uint16_t)); + // save the current last routing table entry allowing us to easily write the connection informations later + rtb_next_node_index = RoutingTB_GetLastEntry(); + entry_bkp = last_routing_table_entry; + Luos_SendMsg(service, &intro_msg); + timestamp = LuosHAL_GetSystick(); + detect_state_machine++; + case 1: + if ((LuosHAL_GetSystick() - timestamp) >= 200) + { + // Time out is reached + // We don't get the answer + nb_node = last_node_id; + // Go directly to Alias duplication check + detect_state_machine = 2; + return 0; + } + // If this request is for a service in this board allow him to respond. + if (entry_bkp == last_routing_table_entry) + { + // We don't get the answer yet + return 0; + } + // We get the answer + // The node answer don't include connection because the node don't know it yet + // add this information to the routing table + LUOS_ASSERT(routing_table[rtb_next_node_index].mode == NODE); + routing_table[rtb_next_node_index].connection = connection_table[last_node_id]; + last_node_id = RoutingTB_BigestNodeID(); + // Go back to step 0 to ask the routing table of the next node + detect_state_machine = 0; + return 0; break; - } - // The node answer don't include connection because the node don't know it yet - // add this information to the routing table - LUOS_ASSERT(routing_table[rtb_next_node_index].mode == NODE); - routing_table[rtb_next_node_index].connection = connection_table[last_node_id]; - last_node_id = RoutingTB_BigestNodeID(); - } - // Check Alias duplication. - uint16_t nb_service = RoutingTB_BigestID(); - for (uint16_t id = 1; id <= nb_service; id++) - { - int32_t found_id = RoutingTB_IDFromAlias(RoutingTB_AliasFromId(id)); - if ((found_id != id) & (found_id != -1)) - { - // The found_id don't match with the actual ID of the service because the alias already exist - // Find the new alias to give him - uint8_t annotation = 1; - char base_alias[MAX_ALIAS_SIZE] = {0}; - memcpy(base_alias, RoutingTB_AliasFromId(id), MAX_ALIAS_SIZE); - // Add a number after alias in routing table - RoutingTB_AddNumToAlias(RoutingTB_AliasFromId(id), annotation++); - // check another time if this alias is already used - while (RoutingTB_IDFromAlias(RoutingTB_AliasFromId(id)) != id) + case 2: + // Check Alias duplication. + nb_service = RoutingTB_BigestID(); + for (uint16_t id = 1; id <= nb_service; id++) { - // This alias is already used. - // Remove the number previously setuped by overwriting it with the base_alias - memcpy(RoutingTB_AliasFromId(id), base_alias, MAX_ALIAS_SIZE); - RoutingTB_AddNumToAlias(RoutingTB_AliasFromId(id), annotation++); + int32_t found_id = RoutingTB_IDFromAlias(RoutingTB_AliasFromId(id)); + if ((found_id != id) & (found_id != -1)) + { + // The found_id don't match with the actual ID of the service because the alias already exist + // Find the new alias to give him + uint8_t annotation = 1; + char base_alias[MAX_ALIAS_SIZE] = {0}; + memcpy(base_alias, RoutingTB_AliasFromId(id), MAX_ALIAS_SIZE); + // Add a number after alias in routing table + RoutingTB_AddNumToAlias(RoutingTB_AliasFromId(id), annotation++); + // check another time if this alias is already used + while (RoutingTB_IDFromAlias(RoutingTB_AliasFromId(id)) != id) + { + // This alias is already used. + // Remove the number previously setuped by overwriting it with the base_alias + memcpy(RoutingTB_AliasFromId(id), base_alias, MAX_ALIAS_SIZE); + RoutingTB_AddNumToAlias(RoutingTB_AliasFromId(id), annotation++); + } + } } - } + detect_state_machine = 0; + last_node_id = 0; + return 1; + break; + default: + LUOS_ASSERT(0); + break; } + LUOS_ASSERT(0); + return -1; } /****************************************************************************** @@ -363,28 +378,69 @@ void RoutingTB_SendEndDetection(service_t *service) * If multiple services have the same name it will be changed with a number in it * Automatically at the end this function create a list of sensors id * @param service : Service who send - * @return None + * @return return true if the detection is complete ******************************************************************************/ -void RoutingTB_DetectServices(service_t *service) +bool RoutingTB_DetectServices(service_t *service) { LUOS_ASSERT(service); - // Create a connetion list to store all the connection describing the topology - connection_t connection_table[MAX_NODE_NUMBER]; - memset(connection_table, 0xFFFFFFFF, sizeof(connection_table)); - // Starts the topology detection. - uint16_t nb_node = LuosIO_TopologyDetection(service, connection_table); - // Clear data reception state - Luos_ReceiveData(NULL, NULL, NULL); - // Clear the routing table. - RoutingTB_Erase(); - // Generate the routing_table - RoutingTB_Generate(service, nb_node, connection_table); - // We have a complete routing table now share it with others. - RoutingTB_Share(service, nb_node); - // Send a message to indicate the end of the detection - RoutingTB_SendEndDetection(service); - // Clear statistic of node who start the detction - Luos_ResetStatistic(); + static uint8_t detect_state_machine = 0; + static uint16_t nb_node = 0; + static connection_t connection_table[MAX_NODE_NUMBER]; + int result; + switch (detect_state_machine) + { + case 0: + // Create a connetion list to store all the connection describing the topology + memset(connection_table, 0xFF, sizeof(connection_table)); + detect_state_machine++; + case 1: + result = LuosIO_TopologyDetection(service, connection_table); + if (result == 0) + { + // No node detected meaning that the detection is not finished + return false; + } + if (result < 0) + { + // another detection is in progress, stop this one + detect_state_machine = 0; + return true; + } + nb_node = (uint16_t)result; + // Clear data reception state + Luos_ReceiveData(NULL, NULL, NULL); + // Clear the routing table. + RoutingTB_Erase(); + detect_state_machine++; + case 2: + // Generate the routing_table + result = RoutingTB_Generate(service, nb_node, connection_table); + if (result == 0) + { + // RTB generation not finished + return false; + } + if (result < 0) + { + // another detection is in progress, stop this one + detect_state_machine = 0; + return true; + } + // We have a complete routing table now share it with others. + RoutingTB_Share(service, nb_node); + // Send a message to indicate the end of the detection + RoutingTB_SendEndDetection(service); + // Clear statistic of node who start the detction + Luos_ResetStatistic(); + detect_state_machine = 0; + return true; + break; + default: + LUOS_ASSERT(0); + break; + } + LUOS_ASSERT(0); + return false; } /****************************************************************************** diff --git a/test/tests_io/test_luos_io/main.c b/test/tests_io/test_luos_io/main.c index 15664a515..4c91ed2b0 100644 --- a/test/tests_io/test_luos_io/main.c +++ b/test/tests_io/test_luos_io/main.c @@ -96,25 +96,6 @@ void unittest_luosIO_loop() TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; } - - NEW_TEST_CASE("Check that the detection treatment is done in loop"); - { - TRY - { - LuosIO_Init(); - Flag_DetectServices = true; - detection_service = &service_ctx.list[0]; - LuosIO_Loop(); - TEST_ASSERT_EQUAL(NULL, detection_service); - TEST_ASSERT_EQUAL(false, Flag_DetectServices); - TEST_ASSERT_EQUAL(1, service_ctx.list[0].id); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - END_TRY; - } } void unittest_luosIO_TransmitLocalRoutingTable() From 8c7a6de3e00b9f471d0d5b6400aae83c94f3ed4f Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 10 Jul 2023 16:52:31 +0200 Subject: [PATCH 099/150] Add a Pure Arduino Luos HAL --- engine/HAL/ARDUINO/luos_hal.c | 190 +++++++++++++++++++++++++++ engine/HAL/ARDUINO/luos_hal.h | 49 +++++++ engine/HAL/ARDUINO/luos_hal_config.h | 38 ++++++ 3 files changed, 277 insertions(+) create mode 100644 engine/HAL/ARDUINO/luos_hal.c create mode 100644 engine/HAL/ARDUINO/luos_hal.h create mode 100644 engine/HAL/ARDUINO/luos_hal_config.h diff --git a/engine/HAL/ARDUINO/luos_hal.c b/engine/HAL/ARDUINO/luos_hal.c new file mode 100644 index 000000000..359527279 --- /dev/null +++ b/engine/HAL/ARDUINO/luos_hal.c @@ -0,0 +1,190 @@ +/****************************************************************************** + * @file luosHAL + * @brief Luos Hardware Abstration Layer. Describe Low layer fonction + * @MCU Family ATSAMD21 + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#include "luos_hal.h" + +#include +#include + +// MCU dependencies this HAL is for family Atmel ATSAMD21 you can find + +/******************************************************************************* + * Definitions + ******************************************************************************/ +#define DEFAULT_TIMEOUT 30 +#define TIMEOUT_ACK DEFAULT_TIMEOUT / 4 +/******************************************************************************* + * Variables + ******************************************************************************/ + +// timestamp variable +uint64_t start_offset; +/******************************************************************************* + * Function + ******************************************************************************/ +static void LuosHAL_SystickInit(void); +static void LuosHAL_FlashInit(void); + +/////////////////////////Luos Library Needed function/////////////////////////// + +/****************************************************************************** + * @brief Luos HAL general initialisation + * @param None + * @return None + ******************************************************************************/ +void LuosHAL_Init(void) +{ + // Systick Initialization + LuosHAL_SystickInit(); + + // Flash Initialization + LuosHAL_FlashInit(); + + // start timestamp + LuosHAL_StartTimestamp(); +} +/****************************************************************************** + * @brief Luos HAL general disable IRQ + * @param Enable : Set to "True" to enable IRQ, "False" otherwise + * @return None + ******************************************************************************/ +_CRITICAL void LuosHAL_SetIrqState(bool Enable) +{ +} +/****************************************************************************** + * @brief Luos HAL general systick tick at 1ms initialize + * @param None + * @return Tick Counter + ******************************************************************************/ +static void LuosHAL_SystickInit(void) +{ +} +/****************************************************************************** + * @brief Luos HAL general systick tick at 1ms + * @param None + * @return Tick Counter + ******************************************************************************/ +_CRITICAL uint32_t LuosHAL_GetSystick(void) +{ + return millis(); +} + +/****************************************************************************** + * @brief Luos GetTimestamp + * @param None + * @return uint64_t + ******************************************************************************/ +_CRITICAL uint64_t LuosHAL_GetTimestamp(void) +{ + return micros() * 1000 - start_offset; +} + +/****************************************************************************** + * @brief Luos start Timestamp + * @param None + * @return None + ******************************************************************************/ +_CRITICAL void LuosHAL_StartTimestamp(void) +{ + start_offset = LuosHAL_GetSystick(); +} + +/****************************************************************************** + * @brief Luos stop Timestamp + * @param None + * @return None + ******************************************************************************/ +_CRITICAL void LuosHAL_StopTimestamp(void) +{ + start_offset = 0; +} + +/****************************************************************************** + * @brief Flash Initialisation + * @param None + * @return None + ******************************************************************************/ +static void LuosHAL_FlashInit(void) +{ +} +/****************************************************************************** + * @brief Set boot mode in shared flash memory + * @param None + * @return + ******************************************************************************/ +_CRITICAL void LuosHAL_SetMode(uint8_t mode) +{ +} + +/****************************************************************************** + * @brief Save node ID in shared flash memory + * @param node_id + * @return + ******************************************************************************/ +_CRITICAL void LuosHAL_SaveNodeID(uint16_t node_id) +{ +} + +/****************************************************************************** + * @brief Software reboot the microprocessor + * @param None + * @return + ******************************************************************************/ +void LuosHAL_Reboot(void) +{ +} + +#ifdef BOOTLOADER +/****************************************************************************** + * @brief Get node id saved in flash memory + * @param Address + * @return node_id + ******************************************************************************/ +uint16_t LuosHAL_GetNodeID(void) +{ +} + +/****************************************************************************** + * @brief Programm flash memory + * @param address : Start address + * @param size :: Data size + * @param data : Pointer to data + * @return + ******************************************************************************/ +void LuosHAL_ProgramFlash(uint32_t address, uint8_t page, uint16_t size, uint8_t *data) +{ +} + +/****************************************************************************** + * @brief DeInit Bootloader peripherals + * @param None + * @return + ******************************************************************************/ +void LuosHAL_DeInit(void) +{ +} + +/****************************************************************************** + * @brief DeInit Bootloader peripherals + * @param None + * @return + ******************************************************************************/ +typedef void (*pFunction)(void); /*!< Function pointer definition */ + +void LuosHAL_JumpToApp(uint32_t app_addr) +{ +} + +/****************************************************************************** + * @brief Return bootloader mode saved in flash + * @param None + * @return + ******************************************************************************/ +uint8_t LuosHAL_GetMode(void) +{ +} +#endif diff --git a/engine/HAL/ARDUINO/luos_hal.h b/engine/HAL/ARDUINO/luos_hal.h new file mode 100644 index 000000000..b9e626394 --- /dev/null +++ b/engine/HAL/ARDUINO/luos_hal.h @@ -0,0 +1,49 @@ +/****************************************************************************** + * @file luosHAL + * @brief Luos Hardware Abstration Layer. Describe Low layer fonction + * @MCU Family ATSAMD21 + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _LUOSHAL_H_ +#define _LUOSHAL_H_ + +#include +#include +#include "luos_hal_config.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ +#define _CRITICAL + +/******************************************************************************* + * Variables + ******************************************************************************/ + +/******************************************************************************* + * Function + ******************************************************************************/ +void LuosHAL_Init(void); +void LuosHAL_SetIrqState(bool Enable); +uint32_t LuosHAL_GetSystick(void); + +// bootloader functions +void LuosHAL_SetMode(uint8_t mode); +void LuosHAL_Reboot(void); +void LuosHAL_SaveNodeID(uint16_t); + +#ifdef BOOTLOADER_CONFIG +void LuosHAL_DeInit(void); +void LuosHAL_JumpToApp(uint32_t); +uint8_t LuosHAL_GetMode(void); +uint16_t LuosHAL_GetNodeID(void); +void LuosHAL_ProgramFlash(uint32_t, uint8_t, uint16_t, uint8_t *); +#endif + +// timestamp functions +uint64_t LuosHAL_GetTimestamp(void); +void LuosHAL_StartTimestamp(void); +void LuosHAL_StopTimestamp(void); + +#endif /* _LUOSHAL_H_ */ diff --git a/engine/HAL/ARDUINO/luos_hal_config.h b/engine/HAL/ARDUINO/luos_hal_config.h new file mode 100644 index 000000000..ff2264f50 --- /dev/null +++ b/engine/HAL/ARDUINO/luos_hal_config.h @@ -0,0 +1,38 @@ +/****************************************************************************** + * @file luosHAL_Config + * @brief This file allow you to configure LuosHAL according to your design + * this is the default configuration created by Luos team for this MCU Family + * Do not modify this file if you want to ovewrite change define in you project + * @MCU Family ATSAMD21 + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _LUOSHAL_CONFIG_H_ +#define _LUOSHAL_CONFIG_H_ + +#include + +#endif + +/******************************************************************************* + * DEFINE THREAD MUTEX LOCKING AND UNLOCKING FUNCTIONS + ******************************************************************************/ +#ifndef MSGALLOC_MUTEX_LOCK +#define MSGALLOC_MUTEX_LOCK +#endif +#ifndef MSGALLOC_MUTEX_UNLOCK +#define MSGALLOC_MUTEX_UNLOCK +#endif + +#ifndef LUOS_MUTEX_LOCK +#define LUOS_MUTEX_LOCK +#endif +#ifndef LUOS_MUTEX_UNLOCK +#define LUOS_MUTEX_UNLOCK +#endif + +/******************************************************************************* + * BOOTLOADER CONFIG + ******************************************************************************/ + +#endif /* _LUOSHAL_CONFIG_H_ */ From ca1574215084410a291f5cef71782248317e4bf4 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 13 Jul 2023 12:41:47 +0200 Subject: [PATCH 100/150] Secure Pipe using Serial for STM32G4 clock configuration --- tool_services/pipe/SERIAL/NUCLEO-G431/pipe_com.h | 14 ++++++++++++-- tool_services/pipe/SERIAL/NUCLEO-G474/pipe_com.h | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/tool_services/pipe/SERIAL/NUCLEO-G431/pipe_com.h b/tool_services/pipe/SERIAL/NUCLEO-G431/pipe_com.h index 5e3cd228f..f4bfe255b 100644 --- a/tool_services/pipe/SERIAL/NUCLEO-G431/pipe_com.h +++ b/tool_services/pipe/SERIAL/NUCLEO-G431/pipe_com.h @@ -38,14 +38,24 @@ #define PIPE_COM_IRQ USART2_IRQn #define PIPE_COM_IRQHANDLER() USART2_IRQHandler() - #define PIPE_RX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); + #define PIPE_RX_DMA_CLOCK_ENABLE() \ + do \ + { \ + __HAL_RCC_DMA1_CLK_ENABLE(); \ + __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ + } while (0U) #define PIPE_RX_DMA DMA1 #define PIPE_RX_DMA_CHANNEL LL_DMA_CHANNEL_3 #define PIPE_RX_DMA_REQUEST LL_DMAMUX_REQ_USART2_RX #define PIPE_RX_DMA_TC(PIPE_RX_DMA) LL_DMA_IsActiveFlag_TC3(PIPE_RX_DMA) #define PIPE_RX_DMA_CLEAR_TC(PIPE_RX_DMA) LL_DMA_ClearFlag_TC3(PIPE_RX_DMA) - #define PIPE_TX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); + #define PIPE_TX_DMA_CLOCK_ENABLE() \ + do \ + { \ + __HAL_RCC_DMA1_CLK_ENABLE(); \ + __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ + } while (0U) #define PIPE_TX_DMA DMA1 #define PIPE_TX_DMA_CHANNEL LL_DMA_CHANNEL_4 #define PIPE_TX_DMA_REQUEST LL_DMAMUX_REQ_USART2_TX diff --git a/tool_services/pipe/SERIAL/NUCLEO-G474/pipe_com.h b/tool_services/pipe/SERIAL/NUCLEO-G474/pipe_com.h index db6ec258e..d98df92a6 100644 --- a/tool_services/pipe/SERIAL/NUCLEO-G474/pipe_com.h +++ b/tool_services/pipe/SERIAL/NUCLEO-G474/pipe_com.h @@ -38,14 +38,24 @@ #define PIPE_COM_IRQ LPUART1_IRQn #define PIPE_COM_IRQHANDLER() LPUART1_IRQHandler() - #define PIPE_RX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); + #define PIPE_RX_DMA_CLOCK_ENABLE() \ + do \ + { \ + __HAL_RCC_DMA1_CLK_ENABLE(); \ + __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ + } while (0U) #define PIPE_RX_DMA DMA1 #define PIPE_RX_DMA_CHANNEL LL_DMA_CHANNEL_3 #define PIPE_RX_DMA_REQUEST LL_DMAMUX_REQ_LPUART1_RX #define PIPE_RX_DMA_TC(PIPE_RX_DMA) LL_DMA_IsActiveFlag_TC3(PIPE_RX_DMA) #define PIPE_RX_DMA_CLEAR_TC(PIPE_RX_DMA) LL_DMA_ClearFlag_TC3(PIPE_RX_DMA) - #define PIPE_TX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); + #define PIPE_TX_DMA_CLOCK_ENABLE() \ + do \ + { \ + __HAL_RCC_DMA1_CLK_ENABLE(); \ + __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ + } while (0U) #define PIPE_TX_DMA DMA1 #define PIPE_TX_DMA_CHANNEL LL_DMA_CHANNEL_4 #define PIPE_TX_DMA_REQUEST LL_DMAMUX_REQ_LPUART1_TX From c1f8950eb10bea5fda2dc9d680bff9e6275be798 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 17 Jul 2023 17:01:11 +0200 Subject: [PATCH 101/150] Optimize freeRTOS example to fit in RAM --- examples/projects/l0/button_freertos/node_config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/projects/l0/button_freertos/node_config.h b/examples/projects/l0/button_freertos/node_config.h index 2862baca5..a191b492d 100644 --- a/examples/projects/l0/button_freertos/node_config.h +++ b/examples/projects/l0/button_freertos/node_config.h @@ -45,8 +45,8 @@ * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 5 -#define MAX_PROFILE_NUMBER 5 +#define MAX_SERVICE_NUMBER 1 +#define MAX_PROFILE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* From 071816369e61a3150729431a3b8ea90fb61094ee Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 4 Jul 2023 17:57:51 +0200 Subject: [PATCH 102/150] Create a serial_network --- .github/workflows/pio_release.yml | 25 + engine/HAL/ARDUINO/luos_hal_config.h | 10 +- engine/IO/src/luos_io.c | 2 +- .../projects/l0/button/lib/Button/button.c | 5 +- examples/projects/l0/button/platformio.ini | 1 + examples/projects/l0/button/src/main.c | 5 +- examples/projects/l0/gpio/platformio.ini | 1 + examples/projects/l0/gpio/src/main.c | 5 +- .../HAL/ARDUINO/serial_network_hal.cpp | 70 +++ .../HAL/ARDUINO/serial_network_hal.h | 54 ++ .../HAL/NATIVE/serial_network_hal.c | 352 +++++++++++++ .../HAL/NATIVE/serial_network_hal.h | 19 + .../HAL/STM32F0/serial_network_hal.c | 221 ++++++++ .../HAL/STM32F0/serial_network_hal.h | 54 ++ .../HAL/STM32F4/serial_network_hal.c | 224 +++++++++ .../HAL/STM32F4/serial_network_hal.h | 54 ++ .../HAL/STM32G431/serial_network_hal.c | 227 +++++++++ .../HAL/STM32G431/serial_network_hal.h | 65 +++ .../HAL/STM32G474/serial_network_hal.c | 227 +++++++++ .../HAL/STM32G474/serial_network_hal.h | 66 +++ .../HAL/STM32L4/serial_network_hal.c | 223 ++++++++ .../HAL/STM32L4/serial_network_hal.h | 54 ++ .../HAL/template/serial_network_hal.c | 99 ++++ .../HAL/template/serial_network_hal.h | 19 + network/serial_network/inc/_serial_network.h | 17 + network/serial_network/inc/serial_network.h | 25 + network/serial_network/library.json | 23 + .../serial_select_hal_script.py | 56 +++ network/serial_network/src/serial_network.c | 476 ++++++++++++++++++ 29 files changed, 2666 insertions(+), 13 deletions(-) create mode 100644 network/serial_network/HAL/ARDUINO/serial_network_hal.cpp create mode 100644 network/serial_network/HAL/ARDUINO/serial_network_hal.h create mode 100644 network/serial_network/HAL/NATIVE/serial_network_hal.c create mode 100644 network/serial_network/HAL/NATIVE/serial_network_hal.h create mode 100644 network/serial_network/HAL/STM32F0/serial_network_hal.c create mode 100644 network/serial_network/HAL/STM32F0/serial_network_hal.h create mode 100644 network/serial_network/HAL/STM32F4/serial_network_hal.c create mode 100644 network/serial_network/HAL/STM32F4/serial_network_hal.h create mode 100644 network/serial_network/HAL/STM32G431/serial_network_hal.c create mode 100644 network/serial_network/HAL/STM32G431/serial_network_hal.h create mode 100644 network/serial_network/HAL/STM32G474/serial_network_hal.c create mode 100644 network/serial_network/HAL/STM32G474/serial_network_hal.h create mode 100644 network/serial_network/HAL/STM32L4/serial_network_hal.c create mode 100644 network/serial_network/HAL/STM32L4/serial_network_hal.h create mode 100644 network/serial_network/HAL/template/serial_network_hal.c create mode 100644 network/serial_network/HAL/template/serial_network_hal.h create mode 100644 network/serial_network/inc/_serial_network.h create mode 100644 network/serial_network/inc/serial_network.h create mode 100644 network/serial_network/library.json create mode 100644 network/serial_network/serial_select_hal_script.py create mode 100644 network/serial_network/src/serial_network.c diff --git a/.github/workflows/pio_release.yml b/.github/workflows/pio_release.yml index 02b511303..63d4fea65 100644 --- a/.github/workflows/pio_release.yml +++ b/.github/workflows/pio_release.yml @@ -229,3 +229,28 @@ jobs: pio package pack pio package publish --owner luos --non-interactive cd ../.. + + deploy_serial: + needs: check_valid_tag + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v1 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install platformio + - name: publish robus network + env: + PLATFORMIO_AUTH_TOKEN: ${{ secrets.PIO_TOKEN }} + run: | + # ***** Serial network publication ***** + cd network/serial_network + # We don't publish examples with this one. + + pio package pack + pio package publish --owner luos --non-interactive + cd ../.. diff --git a/engine/HAL/ARDUINO/luos_hal_config.h b/engine/HAL/ARDUINO/luos_hal_config.h index ff2264f50..7400cc2cb 100644 --- a/engine/HAL/ARDUINO/luos_hal_config.h +++ b/engine/HAL/ARDUINO/luos_hal_config.h @@ -12,23 +12,21 @@ #include -#endif - /******************************************************************************* * DEFINE THREAD MUTEX LOCKING AND UNLOCKING FUNCTIONS ******************************************************************************/ #ifndef MSGALLOC_MUTEX_LOCK -#define MSGALLOC_MUTEX_LOCK + #define MSGALLOC_MUTEX_LOCK #endif #ifndef MSGALLOC_MUTEX_UNLOCK -#define MSGALLOC_MUTEX_UNLOCK + #define MSGALLOC_MUTEX_UNLOCK #endif #ifndef LUOS_MUTEX_LOCK -#define LUOS_MUTEX_LOCK + #define LUOS_MUTEX_LOCK #endif #ifndef LUOS_MUTEX_UNLOCK -#define LUOS_MUTEX_UNLOCK + #define LUOS_MUTEX_UNLOCK #endif /******************************************************************************* diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 59ff104c3..91608074a 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -247,7 +247,7 @@ int LuosIO_TopologyDetection(service_t *service, connection_t *connection_table) result = LuosIO_DetectNextNodes(service); if (result == -1) { - // check the number of retry we made + // Check the number of retry we made LUOS_ASSERT((redetect_nb <= 4)); // Detection fail, restart it redetect_nb++; diff --git a/examples/projects/l0/button/lib/Button/button.c b/examples/projects/l0/button/lib/Button/button.c index 34213ea07..b061ccc31 100644 --- a/examples/projects/l0/button/lib/Button/button.c +++ b/examples/projects/l0/button/lib/Button/button.c @@ -36,7 +36,8 @@ void Button_Init(void) // Profile configuration button.access = READ_ONLY_ACCESS; // Service creation following state profile - ProfileState_CreateService(&button, 0, "button", revision); + service_t *service = ProfileState_CreateService(&button, 0, "button", revision); + Luos_Detect(service); } /****************************************************************************** @@ -47,4 +48,4 @@ void Button_Init(void) void Button_Loop(void) { ll_button_read(&button.state); -} \ No newline at end of file +} diff --git a/examples/projects/l0/button/platformio.ini b/examples/projects/l0/button/platformio.ini index 17077b40a..995f62e3a 100644 --- a/examples/projects/l0/button/platformio.ini +++ b/examples/projects/l0/button/platformio.ini @@ -22,6 +22,7 @@ lib_deps = luos_engine@^3.0.0 robus_network Button + serial_network debug_tool = stlink [env:l0] diff --git a/examples/projects/l0/button/src/main.c b/examples/projects/l0/button/src/main.c index 49cdb2ca3..e1cdc439c 100644 --- a/examples/projects/l0/button/src/main.c +++ b/examples/projects/l0/button/src/main.c @@ -26,7 +26,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus_network.h" +#include "serial_network.h" #include "button.h" /* USER CODE END Includes */ @@ -91,7 +91,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); - Robus_Init(); + Serial_Init(); Button_Init(); /* USER CODE END 2 */ @@ -100,6 +100,7 @@ int main(void) while (1) { Luos_Loop(); + Serial_Loop(); Button_Loop(); /* USER CODE END WHILE */ diff --git a/examples/projects/l0/gpio/platformio.ini b/examples/projects/l0/gpio/platformio.ini index 1f63f5dcf..b4d1dafeb 100644 --- a/examples/projects/l0/gpio/platformio.ini +++ b/examples/projects/l0/gpio/platformio.ini @@ -22,6 +22,7 @@ lib_deps = luos_engine@^3.0.0 robus_network Gpio_dev + serial_network debug_tool = stlink [env:l0] diff --git a/examples/projects/l0/gpio/src/main.c b/examples/projects/l0/gpio/src/main.c index 67b1c8c72..f85701902 100644 --- a/examples/projects/l0/gpio/src/main.c +++ b/examples/projects/l0/gpio/src/main.c @@ -26,7 +26,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus_network.h" +#include "serial_network.h" #include "gpio_dev.h" /* USER CODE END Includes */ @@ -89,7 +89,7 @@ int main(void) /* Initialize all configured peripherals */ /* USER CODE BEGIN 2 */ Luos_Init(); - Robus_Init(); + Serial_Init(); GpioDev_Init(); /* USER CODE END 2 */ @@ -98,6 +98,7 @@ int main(void) while (1) { Luos_Loop(); + Serial_Loop(); GpioDev_Loop(); /* USER CODE END WHILE */ diff --git a/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp b/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp new file mode 100644 index 000000000..a29ceb9c2 --- /dev/null +++ b/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp @@ -0,0 +1,70 @@ +/****************************************************************************** + * @file serial_hal + * @brief serial communication hardware abstraction layer + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#include + +#ifdef __cplusplus +extern "C" +{ +#endif +#include "serial_network_hal.h" +#include "_serial_network.h" +#ifdef __cplusplus +} +#endif +/******************************************************************************* + * Definitions + ******************************************************************************/ +#ifndef SERIAL_COM_DEFAULTBAUDRATE + #define SERIAL_COM_DEFAULTBAUDRATE 1000000 +#endif + +/******************************************************************************* + * Function + ******************************************************************************/ + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param None + * @return None + * ****************************************************************************/ +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) +{ + Serial.begin(SERIAL_COM_DEFAULTBAUDRATE); +} + +/****************************************************************************** + * @brief Loop of the Serial communication + * @param None + * @return None + ******************************************************************************/ +void SerialHAL_Loop(void) +{ + uint8_t data = 0; + while (Serial.available() > 0) + { + data = Serial.read(); + Serial_ReceptionAdd(&data, 1); + } +} + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param data pointer of the data to send + * @param size size of the data to send + * @return None + ******************************************************************************/ +void SerialHAL_Send(uint8_t *data, uint16_t size) +{ + Serial.write(data, size); +} + +uint8_t SerialHAL_GetPort(void) +{ + // We may return the serial port number here + // For now let's just consider that the port is 0 + return 0; +} diff --git a/network/serial_network/HAL/ARDUINO/serial_network_hal.h b/network/serial_network/HAL/ARDUINO/serial_network_hal.h new file mode 100644 index 000000000..e53eadaf2 --- /dev/null +++ b/network/serial_network/HAL/ARDUINO/serial_network_hal.h @@ -0,0 +1,54 @@ +/****************************************************************************** + * @file serial_hal + * @brief hardware abstraction layer of serial communication driver for luos framework + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#ifndef _SERIAL_HAL_H_ +#define _SERIAL_HAL_H_ + +#include "stdint.h" + +// SERIAL_CONFIG need to be define in your node_config.h if you want to redefine +// SERIAL configuration usart or DMA If you need change something in this configuration +// you must redefine all the configuration in you node_config.h +#ifndef SERIAL_CONFIG + #define SERIAL_TX_CLK() __HAL_RCC_GPIOB_CLK_ENABLE() + #define SERIAL_TX_PIN GPIO_PIN_10 + #define SERIAL_TX_PORT GPIOB + #define SERIAL_TX_AF GPIO_AF4_USART3 + + #define SERIAL_RX_CLK() __HAL_RCC_GPIOB_CLK_ENABLE() + #define SERIAL_RX_PIN GPIO_PIN_11 + #define SERIAL_RX_PORT GPIOB + #define SERIAL_RX_AF GPIO_AF4_USART3 + + #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART3_CLK_ENABLE() + #define SERIAL_COM USART3 + #define SERIAL_COM_IRQ USART3_4_IRQn + #define SERIAL_COM_IRQHANDLER() USART3_4_IRQHandler() + + #define SERIAL_RX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() + #define SERIAL_RX_DMA DMA1 + #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_6 + #define SERIAL_RX_DMA_REQUEST LL_SYSCFG_USART3_RMP_DMA1CH67 + #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC6(SERIAL_RX_DMA) + #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC6(SERIAL_RX_DMA) + + #define SERIAL_TX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() + #define SERIAL_TX_DMA DMA1 + #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_7 + #define SERIAL_TX_DMA_REQUEST LL_SYSCFG_USART3_RMP_DMA1CH67 + #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC7(SERIAL_TX_DMA) + #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC7(SERIAL_TX_DMA) + #define SERIAL_TX_DMA_IRQ DMA1_Channel4_5_6_7_IRQn + #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel4_5_6_7_IRQHandler() +#endif + +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); +void SerialHAL_Loop(void); +void SerialHAL_Send(uint8_t *data, uint16_t size); +uint8_t SerialHAL_GetPort(void); // Return the port number of the serial communication + +#endif /* _SERIAL_HAL_H_ */ diff --git a/network/serial_network/HAL/NATIVE/serial_network_hal.c b/network/serial_network/HAL/NATIVE/serial_network_hal.c new file mode 100644 index 000000000..cbdff8e63 --- /dev/null +++ b/network/serial_network/HAL/NATIVE/serial_network_hal.c @@ -0,0 +1,352 @@ +/****************************************************************************** + * @file serial_hal + * @brief serial communication hardware abstraction layer + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#include "serial_network_hal.h" +#include "_serial_network.h" +#include +#include +#include +#include "luos_utils.h" + +#ifdef _WIN32 + #include +#else + #include + #include + #include + #include + #include +#endif + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +#ifndef SERIAL_COM_DEFAULTBAUDRATE + #define SERIAL_COM_DEFAULTBAUDRATE 1000000 +#endif + +/******************************************************************************* + * Variables + ******************************************************************************/ +static uint32_t rx_buffer_size; +#ifdef _WIN32 +HANDLE hSerial; +#else +int serial_port; +#endif + +char portname[128]; + +/******************************************************************************* + * Function + ******************************************************************************/ + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param None + * @return None + * ****************************************************************************/ +char *stripStr(char *string) +{ + // non_space_count to keep the frequency of non space characters + int ok_char_count = 0; + + // Traverse a string and if it is non space or carriage return character then, place it at index non_space_count + for (int i = 0; string[i] != '\0'; i++) + { + if ((string[i] != ' ') && (string[i] != '\n') && (string[i] != '\r')) + { + // This character is OK + string[ok_char_count] = string[i]; + ok_char_count++; // non_space_count incremented + } + } + // Finally placing final character at the string end + string[ok_char_count] = '\0'; + return string; +} + +#ifdef _WIN32 +void set_serial_raw_mode(HANDLE hSerial) +{ + DCB dcbSerialParams = {0}; + dcbSerialParams.DCBlength = sizeof(dcbSerialParams); + + if (!GetCommState(hSerial, &dcbSerialParams)) + { + perror("Error getting serial port state"); + LUOS_ASSERT(0); + return; + } + + dcbSerialParams.BaudRate = SERIAL_NETWORK_BAUDRATE; + dcbSerialParams.ByteSize = 8; + dcbSerialParams.StopBits = ONESTOPBIT; + dcbSerialParams.Parity = NOPARITY; + dcbSerialParams.fBinary = TRUE; + dcbSerialParams.fRtsControl = RTS_CONTROL_DISABLE; + dcbSerialParams.fOutxCtsFlow = FALSE; + dcbSerialParams.fDtrControl = DTR_CONTROL_DISABLE; + dcbSerialParams.fOutxDsrFlow = FALSE; + dcbSerialParams.fOutX = FALSE; + dcbSerialParams.fInX = FALSE; + // dcbSerialParams.XonChar = 17; // ASCII XON (Ctrl-Q) + // dcbSerialParams.XoffChar = 19; // ASCII XOFF (Ctrl-S) + + if (!SetCommState(hSerial, &dcbSerialParams)) + { + perror("Error setting serial port state"); + LUOS_ASSERT(0); + return; + } + + COMMTIMEOUTS timeouts = {0}; + timeouts.ReadIntervalTimeout = MAXDWORD; + timeouts.ReadTotalTimeoutConstant = 0; + timeouts.ReadTotalTimeoutMultiplier = 0; + timeouts.WriteTotalTimeoutConstant = 0; + timeouts.WriteTotalTimeoutMultiplier = 0; + + if (!SetCommTimeouts(hSerial, &timeouts)) + { + perror("Error setting serial port timeouts"); + LUOS_ASSERT(0); + return; + } + + // Setup a 4k buffer + if (!SetupComm(hSerial, 4096, 4096)) + { + perror("Error setting serial port buffer size"); + return; + } +} +#else +void set_termios_raw_mode(struct termios *tty) +{ + tty->c_cflag |= (CLOCAL | CREAD); + tty->c_lflag &= ~(ICANON | ECHO | ECHOE | ECHOK | ECHONL | ISIG | IEXTEN); + #ifdef ECHOCTL + tty->c_lflag &= ~ECHOCTL; // netbsd workaround for Erk + #endif + #ifdef ECHOKE + tty->c_lflag &= ~ECHOKE; // netbsd workaround for Erk + #endif + tty->c_oflag &= ~(OPOST | ONLCR | OCRNL); + tty->c_iflag &= ~(INLCR | IGNCR | ICRNL | IGNBRK); + #ifdef IUCLC + tty->c_iflag &= ~IUCLC; + #endif + #ifdef PARMRK + tty->c_iflag &= ~PARMRK; + #endif + + tty->c_cflag |= CS8; + tty->c_cflag &= ~(CSTOPB); + tty->c_cflag &= ~(PARENB | PARODD); + + #ifdef CMSPAR + tty->c_cflag &= ~CMSPAR; + #endif + + #ifdef IXANY + tty->c_iflag &= ~(IXON | IXOFF | IXANY); + #else + tty->c_iflag &= ~(IXON | IXOFF); + #endif + + #ifdef CRTSCTS + tty->c_cflag &= ~(CRTSCTS); + #elif defined(CNEW_RTSCTS) + tty->c_cflag &= ~(CNEW_RTSCTS); + #endif + + tty->c_cc[VMIN] = 0; + tty->c_cc[VTIME] = 0; +} +#endif + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param None + * @return None + * ****************************************************************************/ +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) +{ + rx_buffer_size = buffer_size; + // Init the serial peripheral + +#ifndef SERIAL_PORT + #ifdef _WIN32 + printf("Please enter the serial port name (ex: COM1): "); + #else + printf("Please enter the serial port name (ex: /dev/ttyUSB0): "); + #endif + fgets(portname, sizeof(portname), stdin); +#else + printf("Using default serial port: %s\n", SERIAL_PORT); + memcpy(portname, SERIAL_PORT, strlen(SERIAL_PORT)); +#endif + stripStr(portname); + printf("Connection on serial port %s at %d baud\n", portname, SERIAL_COM_DEFAULTBAUDRATE); + +// Open the serial port +#ifdef _WIN32 + HANDLE hSerial; + hSerial = CreateFile( + portname, + GENERIC_READ | GENERIC_WRITE, + 0, // exclusive access + NULL, // no security + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, + 0); + if (hSerial == INVALID_HANDLE_VALUE) + { + printf("Error opening serial port\n"); + LUOS_ASSERT(0); + } + // Set serial port parameters + set_serial_raw_mode(hSerial); + + // DCB dcbSerialParams = {0}; + // dcbSerialParams.DCBlength = sizeof(dcbSerialParams); + // if (!GetCommState(hSerial, &dcbSerialParams)) + // { + // printf("Error getting serial port state\n"); + // CloseHandle(hSerial); + // LUOS_ASSERT(0); + // } + // dcbSerialParams.BaudRate = SERIAL_NETWORK_BAUDRATE; + // dcbSerialParams.ByteSize = 8; + // dcbSerialParams.StopBits = ONESTOPBIT; + // dcbSerialParams.Parity = NOPARITY; + // if (!SetCommState(hSerial, &dcbSerialParams)) + // { + // printf("Error setting serial port state\n"); + // CloseHandle(hSerial); + // LUOS_ASSERT(0); + // } +#else + serial_port = open(portname, O_RDWR | O_NOCTTY | O_NONBLOCK); + if (serial_port < 0) + { + printf("Error opening serial port\n"); + printf("Error code: %d\n", errno); + LUOS_ASSERT(0); + while (1) + ; + } + struct termios tty; + memset(&tty, 0, sizeof(tty)); + if (tcgetattr(serial_port, &tty) != 0) + { + printf("Error getting serial port attributes\n"); + printf("Error code: %d\n", errno); + close(serial_port); + LUOS_ASSERT(0); + } + + // Set raw mode without any special handling of input/output + // cfmakeraw(&tty); + set_termios_raw_mode(&tty); + + // Set output/ input to be non-blocking + // tty.c_cc[VMIN] = 0; + // tty.c_cc[VTIME] = 0; + + if (tcsetattr(serial_port, TCSANOW, &tty) != 0) + { + printf("Error setting serial port attributes\n"); + printf("Error code: %d\n", errno); + close(serial_port); + LUOS_ASSERT(0); + } + tcflush(serial_port, TCIOFLUSH); + + // Bypass baudrate speed limitations of termios by using ioctl + #define IOSSIOSPEED 0x80045402 + speed_t speed = SERIAL_COM_DEFAULTBAUDRATE; + if (ioctl(serial_port, IOSSIOSPEED, &speed) < 0) + { + printf("Error setting baudrate attributes\n"); + printf("Error code: %d\n", errno); + close(serial_port); + LUOS_ASSERT(0); + } +#endif +} + +/****************************************************************************** + * @brief Loop of the Serial communication + * @param None + * @return None + ******************************************************************************/ +void SerialHAL_Loop(void) +{ + char recvData[1000]; +#ifdef _WIN32 + DWORD bytesRead; + if (!ReadFile(hSerial, recvData, sizeof(recvData), &bytesRead, NULL)) + { + printf("Error reading from serial port\n"); + CloseHandle(hSerial); + LUOS_ASSERT(0); + } +#else + ssize_t bytesRead; + bytesRead = read(serial_port, recvData, sizeof(recvData)); +#endif + if (bytesRead > 0) + { + Serial_ReceptionAdd((uint8_t *)recvData, (uint32_t)bytesRead); + } +} + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param data pointer of the data to send + * @param size size of the data to send + * @return None + ******************************************************************************/ +void SerialHAL_Send(uint8_t *data, uint16_t size) +{ +#ifdef _WIN32 + DWORD bytesWritten; + if (!WriteFile(hSerial, data, size, &bytesWritten, NULL)) + { + printf("Error writing to serial port\n"); + CloseHandle(hSerial); + LUOS_ASSERT(0); + } +#else + + // Check if the output buffer is full + int bytes_in_buffer; + ssize_t bytesWritten; + ioctl(serial_port, TIOCOUTQ, &bytes_in_buffer); + printf("%d bytes present before adding %d other.\n", bytes_in_buffer, size); + bytesWritten = write(serial_port, data, size); + LUOS_ASSERT(bytesWritten == size); + // tcdrain(serial_port); + if (bytesWritten < 0) + { + printf("Error writing to serial port\n"); + close(serial_port); + LUOS_ASSERT(0); + } +#endif + Serial_TransmissionEnd(); +} + +uint8_t SerialHAL_GetPort(void) +{ + // We may return the COM port number here + // For now let's just consider that the port is 0 + return 0; +} diff --git a/network/serial_network/HAL/NATIVE/serial_network_hal.h b/network/serial_network/HAL/NATIVE/serial_network_hal.h new file mode 100644 index 000000000..3af2174ef --- /dev/null +++ b/network/serial_network/HAL/NATIVE/serial_network_hal.h @@ -0,0 +1,19 @@ +/****************************************************************************** + * @file serial_hal + * @brief hardware abstraction layer of serial communication driver for luos framework + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#ifndef _SERIAL_HAL_H_ +#define _SERIAL_HAL_H_ + +#include "stdint.h" +#include "stdbool.h" + +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); // Init the serial communication +void SerialHAL_Loop(void); // Do your loop stuff if needed +void SerialHAL_Send(uint8_t *data, uint16_t size); // Send data trough the DMA +uint8_t SerialHAL_GetPort(void); // Return the port number of the serial communication + +#endif /* _SERIAL_HAL_H_ */ diff --git a/network/serial_network/HAL/STM32F0/serial_network_hal.c b/network/serial_network/HAL/STM32F0/serial_network_hal.c new file mode 100644 index 000000000..f0b721fe8 --- /dev/null +++ b/network/serial_network/HAL/STM32F0/serial_network_hal.c @@ -0,0 +1,221 @@ +/****************************************************************************** + * @file serial_hal + * @brief serial communication hardware abstraction layer + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#include "serial_network_hal.h" +#include "_serial_network.h" +#include "stm32f0xx_hal.h" +#include "stm32f0xx_ll_usart.h" +#include "stm32f0xx_ll_dma.h" +#include "stm32f0xx_ll_gpio.h" +#include "stm32f0xx_ll_dma.h" +#include "stm32f0xx_ll_system.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ +#ifndef SERIAL_COM_DEFAULTBAUDRATE + #define SERIAL_COM_DEFAULTBAUDRATE 1000000 +#endif + +/******************************************************************************* + * Variables + ******************************************************************************/ +static uint32_t rx_buffer_size; +volatile uint16_t RX_PrevPointerPosition = 0; + +/******************************************************************************* + * Function + ******************************************************************************/ + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param None + * @return None + * ****************************************************************************/ +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) +{ + rx_buffer_size = buffer_size; + RX_PrevPointerPosition = 0; + + LL_USART_DeInit(SERIAL_COM); + /////////////////////////////// + // GPIO SERIAL Init + /////////////////////////////// + SERIAL_TX_CLK(); + SERIAL_RX_CLK(); + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + + // TX + GPIO_InitStruct.Pin = SERIAL_TX_PIN; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = SERIAL_TX_AF; + HAL_GPIO_Init(SERIAL_TX_PORT, &GPIO_InitStruct); + // RX + GPIO_InitStruct.Pin = SERIAL_RX_PIN; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = SERIAL_RX_AF; + HAL_GPIO_Init(SERIAL_RX_PORT, &GPIO_InitStruct); + + /////////////////////////////// + // USART SERIAL Init + /////////////////////////////// + SERIAL_COM_CLOCK_ENABLE(); + + LL_USART_InitTypeDef USART_InitStruct; + // Initialise USART3 + LL_USART_Disable(SERIAL_COM); + USART_InitStruct.BaudRate = SERIAL_COM_DEFAULTBAUDRATE; + USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; + USART_InitStruct.StopBits = LL_USART_STOPBITS_1; + USART_InitStruct.Parity = LL_USART_PARITY_NONE; + USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX_RX; + USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; + USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; + while (LL_USART_Init(SERIAL_COM, &USART_InitStruct) != SUCCESS) + ; + LL_USART_Enable(SERIAL_COM); + + LL_USART_ClearFlag_IDLE(SERIAL_COM); + LL_USART_EnableIT_IDLE(SERIAL_COM); + + HAL_NVIC_EnableIRQ(SERIAL_COM_IRQ); + HAL_NVIC_SetPriority(SERIAL_COM_IRQ, 1, 1); + + RX_PrevPointerPosition = 0; + + __HAL_RCC_DMA1_CLK_ENABLE(); + + /////////////////////////////// + // DMA SERIAL Init + /////////////////////////////// + SERIAL_RX_DMA_CLOCK_ENABLE(); + SERIAL_TX_DMA_CLOCK_ENABLE(); + + // RX DMA + LL_DMA_DisableChannel(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + LL_DMA_SetDataTransferDirection(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_DIRECTION_PERIPH_TO_MEMORY); + LL_DMA_SetChannelPriorityLevel(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MODE_CIRCULAR); + LL_DMA_SetPeriphIncMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); + LL_SYSCFG_SetRemapDMA_USART(SERIAL_RX_DMA_REQUEST); + + // Prepare buffer + LL_DMA_SetPeriphAddress(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, (uint32_t)&SERIAL_COM->RDR); + LL_DMA_SetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, buffer_size); + LL_DMA_SetMemoryAddress(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, (uint32_t)rx_buffer); + LL_USART_EnableDMAReq_RX(SERIAL_COM); + LL_DMA_EnableChannel(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + // TX DMA + LL_DMA_SetDataTransferDirection(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); + LL_DMA_SetChannelPriorityLevel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MODE_NORMAL); + LL_DMA_SetPeriphIncMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); + LL_SYSCFG_SetRemapDMA_USART(SERIAL_TX_DMA_REQUEST); + + // Prepare buffer + LL_DMA_SetPeriphAddress(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, (uint32_t)&SERIAL_COM->TDR); + LL_USART_EnableDMAReq_TX(SERIAL_COM); + HAL_NVIC_EnableIRQ(SERIAL_TX_DMA_IRQ); + HAL_NVIC_SetPriority(SERIAL_TX_DMA_IRQ, 1, 1); + + LL_DMA_EnableIT_TC(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); +} + +/****************************************************************************** + * @brief Loop of the Serial communication + * @param None + * @return None + ******************************************************************************/ +void SerialHAL_Loop(void) +{ +} + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param data pointer of the data to send + * @param size size of the data to send + * @return None + ******************************************************************************/ +void SerialHAL_Send(uint8_t *data, uint16_t size) +{ + LL_DMA_DisableChannel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); + LL_DMA_SetMemoryAddress(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, (uint32_t)data); + LL_DMA_SetDataLength(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, size); + LL_DMA_EnableChannel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); +} + +/****************************************************************************** + * @brief RX Serial IRQ handler + * @param None + * @return None + ******************************************************************************/ +void SERIAL_COM_IRQHANDLER() +{ + uint16_t size = 0; + uint16_t RX_PointerPosition = 0; + + // check if we receive an IDLE on usart3 + if (LL_USART_IsActiveFlag_IDLE(SERIAL_COM)) + { + LL_USART_ClearFlag_IDLE(SERIAL_COM); + if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) + { + return; + } + + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; + // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy + Serial_ReceptionEnd(size); + } +} + +/****************************************************************************** + * @brief TX DMA IRQ handler + * @param None + * @return None + ******************************************************************************/ +void SERIAL_TX_DMA_IRQHANDLER() +{ + // Check if TX DMA is finished + if (SERIAL_TX_DMA_TC(SERIAL_TX_DMA) != RESET) + { + // Clear the DMA irq flags + SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA); + // Call the callback managing the end of the transmission + Serial_TransmissionEnd(); + } +} + +uint8_t SerialHAL_GetPort(void) +{ + // We may return the USARt peeripheral number as port number + // For now let's just consider that the port is 0 + return 0; +} diff --git a/network/serial_network/HAL/STM32F0/serial_network_hal.h b/network/serial_network/HAL/STM32F0/serial_network_hal.h new file mode 100644 index 000000000..e53eadaf2 --- /dev/null +++ b/network/serial_network/HAL/STM32F0/serial_network_hal.h @@ -0,0 +1,54 @@ +/****************************************************************************** + * @file serial_hal + * @brief hardware abstraction layer of serial communication driver for luos framework + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#ifndef _SERIAL_HAL_H_ +#define _SERIAL_HAL_H_ + +#include "stdint.h" + +// SERIAL_CONFIG need to be define in your node_config.h if you want to redefine +// SERIAL configuration usart or DMA If you need change something in this configuration +// you must redefine all the configuration in you node_config.h +#ifndef SERIAL_CONFIG + #define SERIAL_TX_CLK() __HAL_RCC_GPIOB_CLK_ENABLE() + #define SERIAL_TX_PIN GPIO_PIN_10 + #define SERIAL_TX_PORT GPIOB + #define SERIAL_TX_AF GPIO_AF4_USART3 + + #define SERIAL_RX_CLK() __HAL_RCC_GPIOB_CLK_ENABLE() + #define SERIAL_RX_PIN GPIO_PIN_11 + #define SERIAL_RX_PORT GPIOB + #define SERIAL_RX_AF GPIO_AF4_USART3 + + #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART3_CLK_ENABLE() + #define SERIAL_COM USART3 + #define SERIAL_COM_IRQ USART3_4_IRQn + #define SERIAL_COM_IRQHANDLER() USART3_4_IRQHandler() + + #define SERIAL_RX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() + #define SERIAL_RX_DMA DMA1 + #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_6 + #define SERIAL_RX_DMA_REQUEST LL_SYSCFG_USART3_RMP_DMA1CH67 + #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC6(SERIAL_RX_DMA) + #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC6(SERIAL_RX_DMA) + + #define SERIAL_TX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() + #define SERIAL_TX_DMA DMA1 + #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_7 + #define SERIAL_TX_DMA_REQUEST LL_SYSCFG_USART3_RMP_DMA1CH67 + #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC7(SERIAL_TX_DMA) + #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC7(SERIAL_TX_DMA) + #define SERIAL_TX_DMA_IRQ DMA1_Channel4_5_6_7_IRQn + #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel4_5_6_7_IRQHandler() +#endif + +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); +void SerialHAL_Loop(void); +void SerialHAL_Send(uint8_t *data, uint16_t size); +uint8_t SerialHAL_GetPort(void); // Return the port number of the serial communication + +#endif /* _SERIAL_HAL_H_ */ diff --git a/network/serial_network/HAL/STM32F4/serial_network_hal.c b/network/serial_network/HAL/STM32F4/serial_network_hal.c new file mode 100644 index 000000000..52dcd9ec6 --- /dev/null +++ b/network/serial_network/HAL/STM32F4/serial_network_hal.c @@ -0,0 +1,224 @@ +/****************************************************************************** + * @file serial_hal + * @brief serial communication hardware abstraction layer + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#include "serial_network_hal.h" +#include "_serial_network.h" +#include "stm32f4xx_hal.h" +#include "stm32f4xx_ll_usart.h" +#include "stm32f4xx_ll_gpio.h" +#include "stm32f4xx_ll_exti.h" +#include "stm32f4xx_ll_dma.h" +#include "stm32f4xx_ll_system.h" +#include "stm32f4xx_hal.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ +#ifndef SERIAL_COM_DEFAULTBAUDRATE + #define SERIAL_COM_DEFAULTBAUDRATE 1000000 +#endif + +/******************************************************************************* + * Variables + ******************************************************************************/ +static uint32_t rx_buffer_size; +volatile uint16_t RX_PrevPointerPosition = 0; + +/******************************************************************************* + * Function + ******************************************************************************/ + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param None + * @return None + * ****************************************************************************/ +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) +{ + rx_buffer_size = buffer_size; + RX_PrevPointerPosition = 0; + + LL_USART_DeInit(SERIAL_COM); + /////////////////////////////// + // GPIO SERIAL Init + /////////////////////////////// + SERIAL_TX_CLK(); + SERIAL_RX_CLK(); + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + + // TX + GPIO_InitStruct.Pin = SERIAL_TX_PIN; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = SERIAL_TX_AF; + HAL_GPIO_Init(SERIAL_TX_PORT, &GPIO_InitStruct); + // RX + GPIO_InitStruct.Pin = SERIAL_RX_PIN; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = SERIAL_RX_AF; + HAL_GPIO_Init(SERIAL_RX_PORT, &GPIO_InitStruct); + + /////////////////////////////// + // USART SERIAL Init + /////////////////////////////// + SERIAL_COM_CLOCK_ENABLE(); + + LL_USART_InitTypeDef USART_InitStruct; + // Initialise USART3 + LL_USART_Disable(SERIAL_COM); + USART_InitStruct.BaudRate = SERIAL_COM_DEFAULTBAUDRATE; + USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; + USART_InitStruct.StopBits = LL_USART_STOPBITS_1; + USART_InitStruct.Parity = LL_USART_PARITY_NONE; + USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX_RX; + USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; + USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; + while (LL_USART_Init(SERIAL_COM, &USART_InitStruct) != SUCCESS) + ; + LL_USART_Enable(SERIAL_COM); + + LL_USART_ClearFlag_IDLE(SERIAL_COM); + LL_USART_EnableIT_IDLE(SERIAL_COM); + + HAL_NVIC_EnableIRQ(SERIAL_COM_IRQ); + HAL_NVIC_SetPriority(SERIAL_COM_IRQ, 1, 1); + + RX_PrevPointerPosition = 0; + + /////////////////////////////// + // DMA SERIAL Init + /////////////////////////////// + LL_DMA_DeInit(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + LL_DMA_DeInit(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); + + SERIAL_RX_DMA_CLOCK_ENABLE(); + SERIAL_TX_DMA_CLOCK_ENABLE(); + + // RX DMA + LL_DMA_DisableStream(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + LL_DMA_SetChannelSelection(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, SERIAL_TX_DMA_REQUEST); + LL_DMA_SetDataTransferDirection(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_DIRECTION_PERIPH_TO_MEMORY); + LL_DMA_SetStreamPriorityLevel(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MODE_CIRCULAR); + LL_DMA_SetPeriphIncMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); + + // Prepare buffer + LL_DMA_SetPeriphAddress(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, (uint32_t)&SERIAL_COM->DR); + LL_DMA_SetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, buffer_size); + LL_DMA_SetMemoryAddress(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, (uint32_t)rx_buffer); + LL_USART_EnableDMAReq_RX(SERIAL_COM); + LL_DMA_EnableStream(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + // TX DMA + LL_DMA_DisableStream(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); + LL_DMA_SetChannelSelection(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, SERIAL_TX_DMA_REQUEST); + LL_DMA_SetDataTransferDirection(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); + LL_DMA_SetStreamPriorityLevel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MODE_NORMAL); + LL_DMA_SetPeriphIncMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); + + // Prepare buffer + LL_DMA_SetPeriphAddress(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, (uint32_t)&SERIAL_COM->DR); + LL_USART_EnableDMAReq_TX(SERIAL_COM); + HAL_NVIC_EnableIRQ(SERIAL_TX_DMA_IRQ); + HAL_NVIC_SetPriority(SERIAL_TX_DMA_IRQ, 1, 1); + + LL_DMA_EnableIT_TC(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); +} + +/****************************************************************************** + * @brief Loop of the Serial communication + * @param None + * @return None + ******************************************************************************/ +void SerialHAL_Loop(void) +{ +} + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param data pointer of the data to send + * @param size size of the data to send + * @return None + ******************************************************************************/ +void SerialHAL_Send(uint8_t *data, uint16_t size) +{ + LL_DMA_DisableStream(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); + LL_DMA_SetMemoryAddress(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, (uint32_t)data); + LL_DMA_SetDataLength(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, size); + LL_DMA_EnableStream(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); +} + +/****************************************************************************** + * @brief RX Serial IRQ handler + * @param None + * @return None + ******************************************************************************/ +void SERIAL_COM_IRQHANDLER() +{ + uint16_t size = 0; + uint16_t RX_PointerPosition = 0; + + // check if we receive an IDLE on usart3 + if (LL_USART_IsActiveFlag_IDLE(SERIAL_COM)) + { + LL_USART_ClearFlag_IDLE(SERIAL_COM); + if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) + { + return; + } + + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; + // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy + Serial_ReceptionEnd(size); + } +} + +/****************************************************************************** + * @brief TX DMA IRQ handler + * @param None + * @return None + ******************************************************************************/ +void SERIAL_TX_DMA_IRQHANDLER() +{ + // Check if TX DMA is finished + if ((SERIAL_TX_DMA_TC(SERIAL_TX_DMA) != RESET) && (LL_DMA_IsEnabledIT_TC(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL) != RESET)) + { + // Clear the DMA irq flags + SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA); + // Call the callback managing the end of the transmission + Serial_TransmissionEnd(); + } +} + +uint8_t SerialHAL_GetPort(void) +{ + // We may return the USARt peeripheral number as port number + // For now let's just consider that the port is 0 + return 0; +} diff --git a/network/serial_network/HAL/STM32F4/serial_network_hal.h b/network/serial_network/HAL/STM32F4/serial_network_hal.h new file mode 100644 index 000000000..27b596ddf --- /dev/null +++ b/network/serial_network/HAL/STM32F4/serial_network_hal.h @@ -0,0 +1,54 @@ +/****************************************************************************** + * @file serial_hal + * @brief hardware abstraction layer of serial communication driver for luos framework + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#ifndef _SERIAL_HAL_H_ +#define _SERIAL_HAL_H_ + +#include "stdint.h" + +// SERIAL_CONFIG need to be define in your node_config.h if you want to redefine +// SERIAL configuration usart or DMA If you need change something in this configuration +// you must redefine all the configuration in you node_config.h +#ifndef SERIAL_CONFIG + #define SERIAL_TX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); + #define SERIAL_TX_PIN GPIO_PIN_2 + #define SERIAL_TX_PORT GPIOA + #define SERIAL_TX_AF GPIO_AF7_USART2 + + #define SERIAL_RX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); + #define SERIAL_RX_PIN GPIO_PIN_3 + #define SERIAL_RX_PORT GPIOA + #define SERIAL_RX_AF GPIO_AF7_USART2 + + #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE() + #define SERIAL_COM USART2 + #define SERIAL_COM_IRQ USART2_IRQn + #define SERIAL_COM_IRQHANDLER() USART2_IRQHandler() + + #define SERIAL_RX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); + #define SERIAL_RX_DMA DMA1 + #define SERIAL_RX_DMA_CHANNEL LL_DMA_STREAM_5 + #define SERIAL_RX_DMA_REQUEST LL_DMA_CHANNEL_4 + #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC5(SERIAL_RX_DMA) + #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC5(SERIAL_RX_DMA) + + #define SERIAL_TX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); + #define SERIAL_TX_DMA DMA1 + #define SERIAL_TX_DMA_CHANNEL LL_DMA_STREAM_6 + #define SERIAL_TX_DMA_REQUEST LL_DMA_CHANNEL_4 + #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC6(SERIAL_TX_DMA) + #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC6(SERIAL_TX_DMA) + #define SERIAL_TX_DMA_IRQ DMA1_Stream6_IRQn + #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Stream6_IRQHandler() +#endif + +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); +void SerialHAL_Loop(void); +void SerialHAL_Send(uint8_t *data, uint16_t size); +uint8_t SerialHAL_GetPort(void); // Return the port number of the serial communication + +#endif /* _SERIAL_HAL_H_ */ diff --git a/network/serial_network/HAL/STM32G431/serial_network_hal.c b/network/serial_network/HAL/STM32G431/serial_network_hal.c new file mode 100644 index 000000000..5ef7ad973 --- /dev/null +++ b/network/serial_network/HAL/STM32G431/serial_network_hal.c @@ -0,0 +1,227 @@ +/****************************************************************************** + * @file serial_hal + * @brief serial communication hardware abstraction layer + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#include "serial_network_hal.h" +#include "_serial_network.h" +#include "luos_utils.h" +#include "stm32g4xx_hal.h" +#include "stm32g4xx_ll_usart.h" +#include "stm32g4xx_ll_gpio.h" +#include "stm32g4xx_ll_exti.h" +#include "stm32g4xx_ll_dma.h" +#include "stm32g4xx_ll_system.h" +#include "stm32g4xx_hal.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ +#ifndef SERIAL_COM_DEFAULTBAUDRATE + #define SERIAL_COM_DEFAULTBAUDRATE 1000000 +#endif + +/******************************************************************************* + * Variables + ******************************************************************************/ +static uint32_t rx_buffer_size; +volatile uint16_t RX_PrevPointerPosition = 0; + +/******************************************************************************* + * Function + ******************************************************************************/ + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param None + * @return None + * ****************************************************************************/ +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) +{ + LUOS_ASSERT(rx_buffer); + rx_buffer_size = buffer_size; + RX_PrevPointerPosition = 0; + + LL_USART_DeInit(SERIAL_COM); + /////////////////////////////// + // GPIO SERIAL Init + /////////////////////////////// + SERIAL_TX_CLK(); + SERIAL_RX_CLK(); + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + + // TX + GPIO_InitStruct.Pin = SERIAL_TX_PIN; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = SERIAL_TX_AF; + HAL_GPIO_Init(SERIAL_TX_PORT, &GPIO_InitStruct); + // RX + GPIO_InitStruct.Pin = SERIAL_RX_PIN; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = SERIAL_RX_AF; + HAL_GPIO_Init(SERIAL_RX_PORT, &GPIO_InitStruct); + + /////////////////////////////// + // USART SERIAL Init + /////////////////////////////// + SERIAL_COM_CLOCK_ENABLE(); + + LL_USART_InitTypeDef USART_InitStruct; + // Initialise USART3 + LL_USART_Disable(SERIAL_COM); + USART_InitStruct.BaudRate = SERIAL_COM_DEFAULTBAUDRATE; + USART_InitStruct.PrescalerValue = LL_USART_PRESCALER_DIV1; + USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; + USART_InitStruct.StopBits = LL_USART_STOPBITS_1; + USART_InitStruct.Parity = LL_USART_PARITY_NONE; + USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX_RX; + USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; + USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; + while (LL_USART_Init(SERIAL_COM, &USART_InitStruct) != SUCCESS) + ; + LL_USART_Enable(SERIAL_COM); + + LL_USART_ClearFlag_IDLE(SERIAL_COM); + LL_USART_EnableIT_IDLE(SERIAL_COM); + + HAL_NVIC_EnableIRQ(SERIAL_COM_IRQ); + HAL_NVIC_SetPriority(SERIAL_COM_IRQ, 1, 1); + + /////////////////////////////// + // DMA SERIAL Init + /////////////////////////////// + LL_DMA_DeInit(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + LL_DMA_DeInit(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); + + SERIAL_RX_DMA_CLOCK_ENABLE(); + SERIAL_TX_DMA_CLOCK_ENABLE(); + + // Pipe to Luos + LL_DMA_DisableChannel(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + LL_DMA_SetDataTransferDirection(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_DIRECTION_PERIPH_TO_MEMORY); + LL_DMA_SetChannelPriorityLevel(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MODE_CIRCULAR); + LL_DMA_SetPeriphIncMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); + LL_DMA_SetPeriphRequest(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, SERIAL_RX_DMA_REQUEST); + + // Prepare buffer + LL_DMA_SetPeriphAddress(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, (uint32_t)&SERIAL_COM->RDR); + LL_DMA_SetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, rx_buffer_size); + LL_DMA_SetMemoryAddress(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, (uint32_t)rx_buffer); + LL_USART_EnableDMAReq_RX(SERIAL_COM); + LL_DMA_EnableChannel(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + // Luos to Pipe + LL_DMA_SetDataTransferDirection(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); + LL_DMA_SetChannelPriorityLevel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MODE_NORMAL); + LL_DMA_SetPeriphIncMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); + LL_DMA_SetPeriphRequest(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, SERIAL_TX_DMA_REQUEST); + + // Prepare buffer + LL_DMA_SetPeriphAddress(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, (uint32_t)&SERIAL_COM->TDR); + LL_USART_EnableDMAReq_TX(SERIAL_COM); + HAL_NVIC_EnableIRQ(SERIAL_TX_DMA_IRQ); + HAL_NVIC_SetPriority(SERIAL_TX_DMA_IRQ, 1, 1); + + LL_DMA_EnableIT_TC(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); +} + +/****************************************************************************** + * @brief Loop of the Serial communication + * @param None + * @return None + ******************************************************************************/ +void SerialHAL_Loop(void) +{ +} + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param data pointer of the data to send + * @param size size of the data to send + * @return None + ******************************************************************************/ +void SerialHAL_Send(uint8_t *data, uint16_t size) +{ + LL_DMA_DisableChannel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); + LL_DMA_SetMemoryAddress(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, (uint32_t)data); + LL_DMA_SetDataLength(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, size); + LL_DMA_EnableChannel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); +} + +/****************************************************************************** + * @brief RX Serial IRQ handler + * @param None + * @return None + ******************************************************************************/ +void SERIAL_COM_IRQHANDLER() +{ + uint16_t size = 0; + uint16_t RX_PointerPosition = 0; + + // check if we receive an IDLE on usart3 + if (LL_USART_IsActiveFlag_IDLE(SERIAL_COM)) + { + LL_USART_ClearFlag_IDLE(SERIAL_COM); + if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) + { + return; + } + + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; + if (size != 0) + { + // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy + Serial_ReceptionEnd(size); + } + } +} + +/****************************************************************************** + * @brief TX DMA IRQ handler + * @param None + * @return None + ******************************************************************************/ +void SERIAL_TX_DMA_IRQHANDLER() +{ + // Check if TX DMA is finished + if ((SERIAL_TX_DMA_TC(SERIAL_TX_DMA) != RESET) && (LL_DMA_IsEnabledIT_TC(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL) != RESET)) + { + // Clear the DMA irq flags + SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA); + // Call the callback managing the end of the transmission + Serial_TransmissionEnd(); + } +} + +uint8_t SerialHAL_GetPort(void) +{ + // We may return the USARt peeripheral number as port number + // For now let's just consider that the port is 0 + return 0; +} diff --git a/network/serial_network/HAL/STM32G431/serial_network_hal.h b/network/serial_network/HAL/STM32G431/serial_network_hal.h new file mode 100644 index 000000000..97bf5099f --- /dev/null +++ b/network/serial_network/HAL/STM32G431/serial_network_hal.h @@ -0,0 +1,65 @@ +/****************************************************************************** + * @file serial_hal + * @brief hardware abstraction layer of serial communication driver for luos framework + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#ifndef _SERIAL_HAL_H_ +#define _SERIAL_HAL_H_ + +#include "stdint.h" + +// SERIAL_CONFIG need to be define in your node_config.h if you want to redefine +// SERIAL configuration usart or DMA If you need change something in this configuration +// you must redefine all the configuration in you node_config.h + +#ifndef SERIAL_CONFIG + #define SERIAL_TX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); + #define SERIAL_TX_PIN GPIO_PIN_2 + #define SERIAL_TX_PORT GPIOA + #define SERIAL_TX_AF GPIO_AF7_USART2 + + #define SERIAL_RX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); + #define SERIAL_RX_PIN GPIO_PIN_3 + #define SERIAL_RX_PORT GPIOA + #define SERIAL_RX_AF GPIO_AF7_USART2 + + #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE() + #define SERIAL_COM USART2 + #define SERIAL_COM_IRQ USART2_IRQn + #define SERIAL_COM_IRQHANDLER() USART2_IRQHandler() + + #define SERIAL_RX_DMA_CLOCK_ENABLE() \ + do \ + { \ + __HAL_RCC_DMA1_CLK_ENABLE(); \ + __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ + } while (0U) + #define SERIAL_RX_DMA DMA1 + #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_3 + #define SERIAL_RX_DMA_REQUEST LL_DMAMUX_REQ_USART2_RX + #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC3(SERIAL_RX_DMA) + #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC3(SERIAL_RX_DMA) + + #define SERIAL_TX_DMA_CLOCK_ENABLE() \ + do \ + { \ + __HAL_RCC_DMA1_CLK_ENABLE(); \ + __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ + } while (0U) + #define SERIAL_TX_DMA DMA1 + #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_4 + #define SERIAL_TX_DMA_REQUEST LL_DMAMUX_REQ_USART2_TX + #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC4(SERIAL_TX_DMA) + #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC4(SERIAL_TX_DMA) + #define SERIAL_TX_DMA_IRQ DMA1_Channel4_IRQn + #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel4_IRQHandler() +#endif + +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); +void SerialHAL_Loop(void); +void SerialHAL_Send(uint8_t *data, uint16_t size); +uint8_t SerialHAL_GetPort(void); // Return the port number of the serial communication + +#endif /* _SERIAL_HAL_H_ */ diff --git a/network/serial_network/HAL/STM32G474/serial_network_hal.c b/network/serial_network/HAL/STM32G474/serial_network_hal.c new file mode 100644 index 000000000..74d4863da --- /dev/null +++ b/network/serial_network/HAL/STM32G474/serial_network_hal.c @@ -0,0 +1,227 @@ +/****************************************************************************** + * @file serial_hal + * @brief serial communication hardware abstraction layer + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#include "serial_network_hal.h" +#include "_serial_network.h" +#include "luos_utils.h" +#include "stm32g4xx_hal.h" +#include "stm32g4xx_ll_lpuart.h" +#include "stm32g4xx_ll_gpio.h" +#include "stm32g4xx_ll_exti.h" +#include "stm32g4xx_ll_dma.h" +#include "stm32g4xx_ll_system.h" +#include "stm32g4xx_hal.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ +#ifndef SERIAL_COM_DEFAULTBAUDRATE + #define SERIAL_COM_DEFAULTBAUDRATE 1000000 +#endif + +/******************************************************************************* + * Variables + ******************************************************************************/ +static uint32_t rx_buffer_size; +volatile uint16_t RX_PrevPointerPosition = 0; + +/******************************************************************************* + * Function + ******************************************************************************/ + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param None + * @return None + * ****************************************************************************/ +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) +{ + LUOS_ASSERT(rx_buffer); + rx_buffer_size = buffer_size; + RX_PrevPointerPosition = 0; + + LL_LPUART_DeInit(SERIAL_COM); + /////////////////////////////// + // GPIO SERIAL Init + /////////////////////////////// + SERIAL_TX_CLK(); + SERIAL_RX_CLK(); + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + + // TX + GPIO_InitStruct.Pin = SERIAL_TX_PIN; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = SERIAL_TX_AF; + HAL_GPIO_Init(SERIAL_TX_PORT, &GPIO_InitStruct); + // RX + GPIO_InitStruct.Pin = SERIAL_RX_PIN; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_NOPULL; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = SERIAL_RX_AF; + HAL_GPIO_Init(SERIAL_RX_PORT, &GPIO_InitStruct); + + /////////////////////////////// + // USART SERIAL Init + /////////////////////////////// + SERIAL_COM_CLOCK_ENABLE(); + + LL_LPUART_InitTypeDef LPUART_InitStruct; + // Initialise USART3 + LL_LPUART_Disable(SERIAL_COM); + LPUART_InitStruct.BaudRate = SERIAL_COM_DEFAULTBAUDRATE; + LPUART_InitStruct.PrescalerValue = LL_LPUART_PRESCALER_DIV1; + LPUART_InitStruct.DataWidth = LL_LPUART_DATAWIDTH_8B; + LPUART_InitStruct.StopBits = LL_LPUART_STOPBITS_1; + LPUART_InitStruct.Parity = LL_LPUART_PARITY_NONE; + LPUART_InitStruct.TransferDirection = LL_LPUART_DIRECTION_TX_RX; + LPUART_InitStruct.HardwareFlowControl = LL_LPUART_HWCONTROL_NONE; + // LPUART_InitStruct.OverSampling = LL_LPUART_OVERSAMPLING_16; + while (LL_LPUART_Init(SERIAL_COM, &LPUART_InitStruct) != SUCCESS) + ; + LL_LPUART_Enable(SERIAL_COM); + + LL_LPUART_ClearFlag_IDLE(SERIAL_COM); + LL_LPUART_EnableIT_IDLE(SERIAL_COM); + + HAL_NVIC_EnableIRQ(SERIAL_COM_IRQ); + HAL_NVIC_SetPriority(SERIAL_COM_IRQ, 1, 1); + + /////////////////////////////// + // DMA SERIAL Init + /////////////////////////////// + LL_DMA_DeInit(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + LL_DMA_DeInit(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); + + SERIAL_RX_DMA_CLOCK_ENABLE(); + SERIAL_TX_DMA_CLOCK_ENABLE(); + + // RX DMA + LL_DMA_DisableChannel(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + LL_DMA_SetDataTransferDirection(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_DIRECTION_PERIPH_TO_MEMORY); + LL_DMA_SetChannelPriorityLevel(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MODE_CIRCULAR); + LL_DMA_SetPeriphIncMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); + LL_DMA_SetPeriphRequest(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, SERIAL_RX_DMA_REQUEST); + + // Prepare buffer + LL_DMA_SetPeriphAddress(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, (uint32_t)&SERIAL_COM->RDR); + LL_DMA_SetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, buffer_size); + LL_DMA_SetMemoryAddress(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, (uint32_t)rx_buffer); + LL_LPUART_EnableDMAReq_RX(SERIAL_COM); + LL_DMA_EnableChannel(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + // TX DMA + LL_DMA_SetDataTransferDirection(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); + LL_DMA_SetChannelPriorityLevel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MODE_NORMAL); + LL_DMA_SetPeriphIncMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); + LL_DMA_SetPeriphRequest(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, SERIAL_TX_DMA_REQUEST); + + // Prepare buffer + LL_DMA_SetPeriphAddress(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, (uint32_t)&SERIAL_COM->TDR); + LL_LPUART_EnableDMAReq_TX(SERIAL_COM); + HAL_NVIC_EnableIRQ(SERIAL_TX_DMA_IRQ); + HAL_NVIC_SetPriority(SERIAL_TX_DMA_IRQ, 1, 1); + + LL_DMA_EnableIT_TC(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); +} + +/****************************************************************************** + * @brief Loop of the Serial communication + * @param None + * @return None + ******************************************************************************/ +void SerialHAL_Loop(void) +{ +} + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param data pointer of the data to send + * @param size size of the data to send + * @return None + ******************************************************************************/ +void SerialHAL_Send(uint8_t *data, uint16_t size) +{ + LL_DMA_DisableChannel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); + LL_DMA_SetMemoryAddress(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, (uint32_t)data); + LL_DMA_SetDataLength(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, size); + LL_DMA_EnableChannel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); +} + +/****************************************************************************** + * @brief RX Serial IRQ handler + * @param None + * @return None + ******************************************************************************/ +void SERIAL_COM_IRQHANDLER() +{ + uint16_t size = 0; + uint16_t RX_PointerPosition = 0; + + // check if we receive an IDLE on usart3 + if (LL_LPUART_IsActiveFlag_IDLE(SERIAL_COM)) + { + LL_LPUART_ClearFlag_IDLE(SERIAL_COM); + if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) + { + return; + } + + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; + if (size != 0) + { + // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy + Serial_ReceptionEnd(size); + } + } +} + +/****************************************************************************** + * @brief TX DMA IRQ handler + * @param None + * @return None + ******************************************************************************/ +void SERIAL_TX_DMA_IRQHANDLER() +{ + // Check if TX DMA is finished + if ((SERIAL_TX_DMA_TC(SERIAL_TX_DMA) != RESET) && (LL_DMA_IsEnabledIT_TC(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL) != RESET)) + { + // Clear the DMA irq flags + SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA); + // Call the callback managing the end of the transmission + Serial_TransmissionEnd(); + } +} + +uint8_t SerialHAL_GetPort(void) +{ + // We may return the USARt peeripheral number as port number + // For now let's just consider that the port is 0 + return 0; +} diff --git a/network/serial_network/HAL/STM32G474/serial_network_hal.h b/network/serial_network/HAL/STM32G474/serial_network_hal.h new file mode 100644 index 000000000..9d10933b2 --- /dev/null +++ b/network/serial_network/HAL/STM32G474/serial_network_hal.h @@ -0,0 +1,66 @@ +/****************************************************************************** + * @file serial_hal + * @brief hardware abstraction layer of serial communication driver for luos framework + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#ifndef _SERIAL_HAL_H_ +#define _SERIAL_HAL_H_ + +#include "stdint.h" + +// SERIAL_CONFIG need to be define in your node_config.h if you want to redefine +// SERIAL configuration usart or DMA If you need change something in this configuration +// you must redefine all the configuration in you node_config.h + +// Nucleo G474RE configuration +#ifndef SERIAL_CONFIG + #define SERIAL_TX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); + #define SERIAL_TX_PIN GPIO_PIN_2 + #define SERIAL_TX_PORT GPIOA + #define SERIAL_TX_AF GPIO_AF12_LPUART1 + + #define SERIAL_RX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); + #define SERIAL_RX_PIN GPIO_PIN_3 + #define SERIAL_RX_PORT GPIOA + #define SERIAL_RX_AF GPIO_AF12_LPUART1 + + #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_LPUART1_CLK_ENABLE() + #define SERIAL_COM LPUART1 + #define SERIAL_COM_IRQ LPUART1_IRQn + #define SERIAL_COM_IRQHANDLER() LPUART1_IRQHandler() + + #define SERIAL_RX_DMA_CLOCK_ENABLE() \ + do \ + { \ + __HAL_RCC_DMA1_CLK_ENABLE(); \ + __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ + } while (0U) + #define SERIAL_RX_DMA DMA1 + #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_3 + #define SERIAL_RX_DMA_REQUEST LL_DMAMUX_REQ_LPUART1_RX + #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC3(SERIAL_RX_DMA) + #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC3(SERIAL_RX_DMA) + + #define SERIAL_TX_DMA_CLOCK_ENABLE() \ + do \ + { \ + __HAL_RCC_DMA1_CLK_ENABLE(); \ + __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ + } while (0U) + #define SERIAL_TX_DMA DMA1 + #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_4 + #define SERIAL_TX_DMA_REQUEST LL_DMAMUX_REQ_LPUART1_TX + #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC4(SERIAL_TX_DMA) + #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC4(SERIAL_TX_DMA) + #define SERIAL_TX_DMA_IRQ DMA1_Channel4_IRQn + #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel4_IRQHandler() +#endif + +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); +void SerialHAL_Loop(void); +void SerialHAL_Send(uint8_t *data, uint16_t size); +uint8_t SerialHAL_GetPort(void); // Return the port number of the serial communication + +#endif /* _SERIAL_HAL_H_ */ diff --git a/network/serial_network/HAL/STM32L4/serial_network_hal.c b/network/serial_network/HAL/STM32L4/serial_network_hal.c new file mode 100644 index 000000000..b496ca016 --- /dev/null +++ b/network/serial_network/HAL/STM32L4/serial_network_hal.c @@ -0,0 +1,223 @@ +/****************************************************************************** + * @file serial_hal + * @brief serial communication hardware abstraction layer + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#include "serial_network_hal.h" +#include "_serial_network.h" +#include "stm32l4xx_hal.h" +#include "stm32l4xx_ll_usart.h" +#include "stm32l4xx_ll_gpio.h" +#include "stm32l4xx_ll_exti.h" +#include "stm32l4xx_ll_dma.h" +#include "stm32l4xx_ll_system.h" +#include "stm32l4xx_hal.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ +#ifndef SERIAL_COM_DEFAULTBAUDRATE + #define SERIAL_COM_DEFAULTBAUDRATE 1000000 +#endif + +/******************************************************************************* + * Variables + ******************************************************************************/ +static uint32_t rx_buffer_size; +volatile uint16_t RX_PrevPointerPosition = 0; + +/******************************************************************************* + * Function + ******************************************************************************/ + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param None + * @return None + * ****************************************************************************/ +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) +{ + rx_buffer_size = buffer_size; + RX_PrevPointerPosition = 0; + + LL_USART_DeInit(SERIAL_COM); + /////////////////////////////// + // GPIO SERIAL Init + /////////////////////////////// + SERIAL_TX_CLK(); + SERIAL_RX_CLK(); + + GPIO_InitTypeDef GPIO_InitStruct = {0}; + + // TX + GPIO_InitStruct.Pin = SERIAL_TX_PIN; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = SERIAL_TX_AF; + HAL_GPIO_Init(SERIAL_TX_PORT, &GPIO_InitStruct); + // RX + GPIO_InitStruct.Pin = SERIAL_RX_PIN; + GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; + GPIO_InitStruct.Pull = GPIO_PULLUP; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; + GPIO_InitStruct.Alternate = SERIAL_RX_AF; + HAL_GPIO_Init(SERIAL_RX_PORT, &GPIO_InitStruct); + + /////////////////////////////// + // USART SERIAL Init + /////////////////////////////// + SERIAL_COM_CLOCK_ENABLE(); + + LL_USART_InitTypeDef USART_InitStruct; + // Initialise USART3 + LL_USART_Disable(SERIAL_COM); + USART_InitStruct.BaudRate = SERIAL_COM_DEFAULTBAUDRATE; + USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; + USART_InitStruct.StopBits = LL_USART_STOPBITS_1; + USART_InitStruct.Parity = LL_USART_PARITY_NONE; + USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX_RX; + USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; + USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; + while (LL_USART_Init(SERIAL_COM, &USART_InitStruct) != SUCCESS) + ; + LL_USART_Enable(SERIAL_COM); + + LL_USART_ClearFlag_IDLE(SERIAL_COM); + LL_USART_EnableIT_IDLE(SERIAL_COM); + + HAL_NVIC_EnableIRQ(SERIAL_COM_IRQ); + HAL_NVIC_SetPriority(SERIAL_COM_IRQ, 1, 1); + + RX_PrevPointerPosition = 0; + + /////////////////////////////// + // DMA SERIAL Init + /////////////////////////////// + LL_DMA_DeInit(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + LL_DMA_DeInit(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); + + SERIAL_RX_DMA_CLOCK_ENABLE(); + SERIAL_TX_DMA_CLOCK_ENABLE(); + + // RX DMA + LL_DMA_DisableChannel(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + LL_DMA_SetDataTransferDirection(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_DIRECTION_PERIPH_TO_MEMORY); + LL_DMA_SetChannelPriorityLevel(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MODE_CIRCULAR); + LL_DMA_SetPeriphIncMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); + LL_DMA_SetPeriphRequest(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, SERIAL_RX_DMA_REQUEST); + + // Prepare buffer + LL_DMA_SetPeriphAddress(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, (uint32_t)&SERIAL_COM->RDR); + LL_DMA_SetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, buffer_size); + LL_DMA_SetMemoryAddress(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL, (uint32_t)rx_buffer); + LL_USART_EnableDMAReq_RX(SERIAL_COM); + LL_DMA_EnableChannel(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + // TX DMA + LL_DMA_SetDataTransferDirection(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); + LL_DMA_SetChannelPriorityLevel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MODE_NORMAL); + LL_DMA_SetPeriphIncMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); + LL_DMA_SetPeriphRequest(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, SERIAL_TX_DMA_REQUEST); + + // Prepare buffer + LL_DMA_SetPeriphAddress(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, (uint32_t)&SERIAL_COM->TDR); + LL_USART_EnableDMAReq_TX(SERIAL_COM); + HAL_NVIC_EnableIRQ(SERIAL_TX_DMA_IRQ); + HAL_NVIC_SetPriority(SERIAL_TX_DMA_IRQ, 1, 1); + + LL_DMA_EnableIT_TC(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); +} + +/****************************************************************************** + * @brief Loop of the Serial communication + * @param None + * @return None + ******************************************************************************/ +void SerialHAL_Loop(void) +{ +} + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param data pointer of the data to send + * @param size size of the data to send + * @return None + ******************************************************************************/ +void SerialHAL_Send(uint8_t *data, uint16_t size) +{ + LL_DMA_DisableChannel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); + LL_DMA_SetMemoryAddress(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, (uint32_t)data); + LL_DMA_SetDataLength(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL, size); + LL_DMA_EnableChannel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); +} + +/****************************************************************************** + * @brief RX Serial IRQ handler + * @param None + * @return None + ******************************************************************************/ +void SERIAL_COM_IRQHANDLER() +{ + uint16_t size = 0; + uint16_t RX_PointerPosition = 0; + + // check if we receive an IDLE on usart3 + if (LL_USART_IsActiveFlag_IDLE(SERIAL_COM)) + { + LL_USART_ClearFlag_IDLE(SERIAL_COM); + if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) + { + return; + } + + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; + // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy + Serial_ReceptionEnd(size); + } +} + +/****************************************************************************** + * @brief TX DMA IRQ handler + * @param None + * @return None + ******************************************************************************/ +void SERIAL_TX_DMA_IRQHANDLER() +{ + // Check if TX DMA is finished + if ((SERIAL_TX_DMA_TC(SERIAL_TX_DMA) != RESET) && (LL_DMA_IsEnabledIT_TC(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL) != RESET)) + { + // Clear the DMA irq flags + SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA); + // Call the callback managing the end of the transmission + Serial_TransmissionEnd(); + } +} + +uint8_t SerialHAL_GetPort(void) +{ + // We may return the USARt peeripheral number as port number + // For now let's just consider that the port is 0 + return 0; +} diff --git a/network/serial_network/HAL/STM32L4/serial_network_hal.h b/network/serial_network/HAL/STM32L4/serial_network_hal.h new file mode 100644 index 000000000..ae33d2ff4 --- /dev/null +++ b/network/serial_network/HAL/STM32L4/serial_network_hal.h @@ -0,0 +1,54 @@ +/****************************************************************************** + * @file serial_hal + * @brief hardware abstraction layer of serial communication driver for luos framework + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#ifndef _SERIAL_HAL_H_ +#define _SERIAL_HAL_H_ + +#include "stdint.h" + +// SERIAL_CONFIG need to be define in your node_config.h if you want to redefine +// SERIAL configuration usart or DMA If you need change something in this configuration +// you must redefine all the configuration in you node_config.h +#ifndef SERIAL_CONFIG + #define SERIAL_TX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); + #define SERIAL_TX_PIN GPIO_PIN_2 + #define SERIAL_TX_PORT GPIOA + #define SERIAL_TX_AF GPIO_AF7_USART2 + + #define SERIAL_RX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); + #define SERIAL_RX_PIN GPIO_PIN_15 + #define SERIAL_RX_PORT GPIOA + #define SERIAL_RX_AF GPIO_AF3_USART2 + + #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE() + #define SERIAL_COM USART2 + #define SERIAL_COM_IRQ USART2_IRQn + #define SERIAL_COM_IRQHANDLER() USART2_IRQHandler() + + #define SERIAL_RX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); + #define SERIAL_RX_DMA DMA1 + #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_6 + #define SERIAL_RX_DMA_REQUEST LL_DMA_REQUEST_2 + #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC6(SERIAL_RX_DMA) + #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC6(SERIAL_RX_DMA) + + #define SERIAL_TX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); + #define SERIAL_TX_DMA DMA1 + #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_7 + #define SERIAL_TX_DMA_REQUEST LL_DMA_REQUEST_2 + #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC7(SERIAL_TX_DMA) + #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC7(SERIAL_TX_DMA) + #define SERIAL_TX_DMA_IRQ DMA1_Channel7_IRQn + #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel7_IRQHandler() +#endif + +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); +void SerialHAL_Loop(void); +void SerialHAL_Send(uint8_t *data, uint16_t size); +uint8_t SerialHAL_GetPort(void); // Return the port number of the serial communication + +#endif /* _SERIAL_HAL_H_ */ diff --git a/network/serial_network/HAL/template/serial_network_hal.c b/network/serial_network/HAL/template/serial_network_hal.c new file mode 100644 index 000000000..7997b0214 --- /dev/null +++ b/network/serial_network/HAL/template/serial_network_hal.c @@ -0,0 +1,99 @@ +/****************************************************************************** + * @file serial_hal + * @brief serial communication hardware abstraction layer + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#include "serial_network_hal.h" +#include "_serial_network.h" +// TODO: Include the needed files + +/******************************************************************************* + * Definitions + ******************************************************************************/ +#ifndef SERIAL_COM_DEFAULTBAUDRATE + #define SERIAL_COM_DEFAULTBAUDRATE 1000000 +#endif + +/******************************************************************************* + * Variables + ******************************************************************************/ +static uint32_t rx_buffer_size; +// TODO: Declare the needed variables + +/******************************************************************************* + * Function + ******************************************************************************/ + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param None + * @return None + * ****************************************************************************/ +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) +{ + rx_buffer_size = buffer_size; + // Init the serial peripheral + // TODO: Init the used usart peripheral using the SERIAL_COM_DEFAULTBAUDRATE baudrate. + // TODO: Init TX pin with the given pin and port and set it as tx for the usart. Select the appropriate alternate function. + // TODO: Init the Serial TX DMA interface, use it in normal mode and make it raise an IRQ when finished. + + // TODO: Init RX pin with the given pin and port and set it as rx for the usart. Select the appropriate alternate function. + // TODO: Init the serial RX DMA interface to move RX bytes in the rx_buffer, use it in circular mode and make it loop on buffer_size. Do not make it raise an IRQ when finished. + // TODO: Enable the serial RX Idle IRQ to raise an interrupt when a the RX line is idle +} + +/****************************************************************************** + * @brief Loop of the Serial communication + * @param None + * @return None + ******************************************************************************/ +void SerialHAL_Loop(void) +{ + // If you want to receive data here, you can. +} + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param data pointer of the data to send + * @param size size of the data to send + * @return None + ******************************************************************************/ +void SerialHAL_Send(uint8_t *data, uint16_t size) +{ + // TODO: Start the DMA transfert to transmit data from data[0] to data[size] +} + +/****************************************************************************** + * @brief RX Serial IRQ handler + * @param None + * @return None + ******************************************************************************/ +void SERIAL_COM_IRQHANDLER(void) +{ + // Check if this IRQ is due to RX Idle + if (/*TODO: Check if this IRQ means that RX is Idle*/) + { + // TODO: Clear the RX idle IRQ flag + uint32_t received_data = rx_buffer_size - /* TODO: Get the size of the data received by the DMA*/; + // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy + Serial_ReceptionEnd(received_data); + } +} + +/****************************************************************************** + * @brief TX DMA IRQ handler + * @param None + * @return None + ******************************************************************************/ +void SERIAL_TX_DMA_IRQHANDLER() +{ + // Check if TX DMA is finished + if (/* TODO: Check if this irq means that TX DMA is finished*/) + { + // TODO: Clear the DMA irq flags + // Call the callback managing the end of the transmission + Serial_TransmissionEnd(); + } +} diff --git a/network/serial_network/HAL/template/serial_network_hal.h b/network/serial_network/HAL/template/serial_network_hal.h new file mode 100644 index 000000000..3af2174ef --- /dev/null +++ b/network/serial_network/HAL/template/serial_network_hal.h @@ -0,0 +1,19 @@ +/****************************************************************************** + * @file serial_hal + * @brief hardware abstraction layer of serial communication driver for luos framework + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#ifndef _SERIAL_HAL_H_ +#define _SERIAL_HAL_H_ + +#include "stdint.h" +#include "stdbool.h" + +void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); // Init the serial communication +void SerialHAL_Loop(void); // Do your loop stuff if needed +void SerialHAL_Send(uint8_t *data, uint16_t size); // Send data trough the DMA +uint8_t SerialHAL_GetPort(void); // Return the port number of the serial communication + +#endif /* _SERIAL_HAL_H_ */ diff --git a/network/serial_network/inc/_serial_network.h b/network/serial_network/inc/_serial_network.h new file mode 100644 index 000000000..e2dde95d7 --- /dev/null +++ b/network/serial_network/inc/_serial_network.h @@ -0,0 +1,17 @@ +/****************************************************************************** + * @file _serial_network.h + * @brief Private serial communication driver functions for luos framework + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +#ifndef __SERIAL_H_ +#define __SERIAL_H_ + +#include + +void Serial_TransmissionEnd(void); +void Serial_ReceptionAdd(uint8_t *data, uint32_t size); +void Serial_ReceptionEnd(uint32_t size); + +#endif /* __SERIAL_H_ */ diff --git a/network/serial_network/inc/serial_network.h b/network/serial_network/inc/serial_network.h new file mode 100644 index 000000000..453bcabc9 --- /dev/null +++ b/network/serial_network/inc/serial_network.h @@ -0,0 +1,25 @@ +/****************************************************************************** + * @file serial_network.h + * @brief serial communication driver for luos framework + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _LUOS_SERIAL_H_ +#define _LUOS_SERIAL_H_ + +#include "luos_phy.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ +#ifndef SERIAL_TX_BUFFER_SIZE + #define SERIAL_RX_BUFFER_SIZE 512 +#endif + +/******************************************************************************* + * Function + ******************************************************************************/ +void Serial_Init(void); +void Serial_Loop(void); + +#endif /* _LUOS_SERIAL_H_ */ diff --git a/network/serial_network/library.json b/network/serial_network/library.json new file mode 100644 index 000000000..e1a8def38 --- /dev/null +++ b/network/serial_network/library.json @@ -0,0 +1,23 @@ +{ + "name": "serial_network", + "keywords": "serial,network,microservice,luos,operating system,os,embedded,communication,service,ST,cJSON", + "description": "A serial network interface dedicated to Luos.", + "version": "1.0.0", + "authors": { + "name": "Luos", + "url": "https://luos.io" + }, + "homepage": "https://luos.io", + "license": "MIT", + "headers": "serial_network.h", + "build": { + "extraScript": "serial_select_hal_script.py" + }, + "dependencies": { + "luos_engine": "^3.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/Luos-io/luos_engine" + } +} diff --git a/network/serial_network/serial_select_hal_script.py b/network/serial_network/serial_select_hal_script.py new file mode 100644 index 000000000..efd6ea182 --- /dev/null +++ b/network/serial_network/serial_select_hal_script.py @@ -0,0 +1,56 @@ +#!/usr/bin/python +from os import path +import sys +import click +from os.path import join, realpath +Import('env') + +click.secho("Serial network build configuration:", underline=True) +# Find the appropriate hal +find_HAL = False +envdefs = env['CPPDEFINES'].copy() +for item in envdefs: + if isinstance(item, tuple) and item[0] == "SERIALHAL": + find_HAL = True + if (path.exists("HAL/" + item[1])): + click.secho( + "\t* %s HAL selected for Serial network." % item[1], fg="green") + if (path.exists("HAL/" + item[1] + "/hal_script.py")): + # This is an extra script dedicated to this HAL, run it + hal_script_path = realpath("HAL/" + item[1] + "/hal_script.py") + env.SConscript(hal_script_path, exports="env") + click.secho("") + + else: + click.secho("\t* %s Serial network HAL not found" % + item[1], fg="red") + click.secho("") + + env.Append(CPPPATH=[realpath("HAL/" + item[1])]) + env.Append(CPPPATH=[realpath("inc/")]) + env.Append( + SRC_FILTER=["+<*.c>, +<../HAL/%s/*.c>, ++<../HAL/%s/*.cpp>" % (item[1], item[1])]) + +if (find_HAL == False): + for item in envdefs: + if isinstance(item, tuple) and item[0] == "LUOSHAL": + find_HAL = True + if (path.exists("HAL/" + item[1])): + click.secho( + "\t* %s HAL selected for Serial network." % item[1], fg="green") + if (path.exists("HAL/" + item[1] + "/hal_script.py")): + # This is an extra script dedicated to this HAL, run it + hal_script_path = realpath( + "HAL/" + item[1] + "/hal_script.py") + env.SConscript(hal_script_path, exports="env") + click.secho("") + + else: + click.secho("\t* %s Serial network HAL not found" % + item[1], fg="red") + click.secho("") + + env.Append(CPPPATH=[realpath("HAL/" + item[1])]) + env.Append(CPPPATH=[realpath("inc/")]) + env.Append( + SRC_FILTER=["+<*.c>, +<../HAL/%s/*.c>, ++<../HAL/%s/*.cpp>" % (item[1], item[1])]) diff --git a/network/serial_network/src/serial_network.c b/network/serial_network/src/serial_network.c new file mode 100644 index 000000000..89a2ea33a --- /dev/null +++ b/network/serial_network/src/serial_network.c @@ -0,0 +1,476 @@ +/****************************************************************************** + * @file serial_network.c + * @brief serial communication driver for Luos library + * @author Luos + * @version 0.0.0 + ******************************************************************************/ + +/****************************************************************************** + * # Serial Topology management algorythm: + * +------------+--------------+ +--------------+------------+ + * | 1st node (master) | | 2nd node | + * +------------+--------------+ +--------------+------------+ + * | luos_phy |serial_network| |serial_network| luos_phy | + * +------------+--------------+ +--------------+------------+ + * | ping ---+--> ping | -------> | ping ---+->phy_source| + * | <-+--------------+---msgs---+--------------+-> | + * | | | | | ping others| + * | topo_done <+-- de-ping | <------- | de-ping <-+--- ping | + * | ping others| | | |------+->topo_done | + * +------------+--------------+ +--------------+------------+ + * The ping and de-ping are the exact same request and reply sequence. The only difference is the direction of the message. + * ping : SerialHeader_t + SERIAL_FOOTER --> answer : SerialHeader_t + 1 byte + SERIAL_FOOTER + * + * # Serial protocol: + * ---------------------------------------------------------------------- + * | SERIAL_HEADER | size | data | SERIAL_FOOTER | + * ---------------------------------------------------------------------- + * | SerialHeader_t | + ******************************************************************************/ + +#include "luos_phy.h" +#include "serial_network.h" +#include "_serial_network.h" +#include "serial_network_hal.h" + +/******************************************************************************* + * Definitions + ******************************************************************************/ +#define SERIAL_HEADER 0x7E +#define SERIAL_FOOTER 0x81 + +// Phy callback definitions +static void Serial_JobHandler(luos_phy_t *phy_ptr, phy_job_t *job); +static error_return_t Serial_RunTopology(luos_phy_t *phy_ptr, uint8_t *portId); +static void Serial_Reset(luos_phy_t *phy_ptr); +static void Serial_Send(void); + +typedef struct __attribute__((__packed__)) +{ + uint8_t header; + uint16_t size; +} SerialHeader_t; + +/******************************************************************************* + * Variables + ******************************************************************************/ +luos_phy_t *phy_serial; +volatile bool sending = false; // This flag is true when TX is busy +volatile bool wait_reception = false; // This flag is true when we are waiting for a reply to a ping + +uint8_t TX_data[sizeof(msg_t) + sizeof(SerialHeader_t) + 1]; // This buffer is used to prepare the message to send +uint8_t RX_data[SERIAL_RX_BUFFER_SIZE]; // This buffer is used to store received bytes and used as ring buffer +uint32_t rx_size = 0; +bool we_initiate_ping = false; +bool next_ping_is_deping = false; + +/******************************************************************************* + * Function + ******************************************************************************/ + +/****************************************************************************** + * @brief Initialisation of the Serial communication + * @param None + * @return None + ******************************************************************************/ +void Serial_Init(void) +{ + // Instantiate the phy struct + phy_serial = Phy_Create(Serial_JobHandler, Serial_RunTopology, Serial_Reset); + LUOS_ASSERT(phy_serial); + + Serial_Reset(phy_serial); + SerialHAL_Init(RX_data, SERIAL_RX_BUFFER_SIZE); + + phy_serial->rx_timestamp = 0; + phy_serial->rx_buffer_base = RX_data; + phy_serial->rx_data = RX_data; // In our case we don't need to use this pointer because we use DMA to receive complete messages in one time. + phy_serial->rx_keep = true; +} + +/****************************************************************************** + * @brief Reset the serial communication variables + * @return None + ******************************************************************************/ +void Serial_Reset(luos_phy_t *phy_ptr) +{ + // Init the serial communication variables + sending = false; + wait_reception = false; + rx_size = 0; + we_initiate_ping = false; + next_ping_is_deping = false; +} + +/****************************************************************************** + * @brief Function called to move the rx buffer pointer + * @param size size to move the pointer + * @return None + ******************************************************************************/ +static void Serial_MoveRxPtr(uint8_t size) +{ + // Move the rx buffer pointer + LUOS_ASSERT(rx_size >= size); + Phy_SetIrqState(false); + phy_serial->rx_buffer_base += size; + if (phy_serial->rx_buffer_base >= RX_data + sizeof(RX_data)) + { + // We are at the end of the buffer, we need to go back to the beginning + phy_serial->rx_buffer_base = RX_data + (phy_serial->rx_buffer_base - (RX_data + sizeof(RX_data))); + } + phy_serial->rx_data = phy_serial->rx_buffer_base; + rx_size -= size; + Phy_SetIrqState(true); +} + +/****************************************************************************** + * @brief Loop of the Serial communication + * @param None + * @return None + ******************************************************************************/ +void Serial_Loop(void) +{ + SerialHAL_Loop(); + + // Manage received data + while (rx_size > 0) + { + /*********************************************** + * 1 - Receive the header and check if the message is complete + *********************************************/ + if (rx_size < sizeof(SerialHeader_t)) + { + // We don't receive the complete header yet. + return; + } + SerialHeader_t header; + // Check if the header address is after the end of the buffer + if (((uintptr_t)RX_data + sizeof(RX_data)) - ((uintptr_t)(phy_serial->rx_buffer_base)) < sizeof(SerialHeader_t)) + { + // Header is cut by the end of the buffer + // We need to go back to the beginning of the buffer + uint8_t buffer_end_size = ((uintptr_t)RX_data + sizeof(RX_data)) - (uintptr_t)(phy_serial->rx_buffer_base); + memcpy(&header, phy_serial->rx_buffer_base, buffer_end_size); + memcpy(&header + buffer_end_size, RX_data, sizeof(SerialHeader_t) - buffer_end_size); + } + else + { + // Header is continuous + memcpy(&header, phy_serial->rx_buffer_base, sizeof(SerialHeader_t)); + } + // Now we have the complete header, check if we receive the complete message + if (rx_size < header.size + sizeof(SerialHeader_t) + 1) + { + // We don't receive the complete message yet. + return; + } + /*********************************************** + * 2 - Receive the message + *********************************************/ + uint8_t *footer_position = &phy_serial->rx_buffer_base[header.size + sizeof(SerialHeader_t)]; + // Check if the footer address is after the end of the buffer + if ((uintptr_t)footer_position >= (uintptr_t)RX_data + sizeof(RX_data)) + { + // We need to go back to the beginning of the buffer + footer_position = (uint8_t *)((uintptr_t)RX_data + ((uintptr_t)footer_position - ((uintptr_t)RX_data + sizeof(RX_data)))); + } + while ((header.header != SERIAL_HEADER) || (*footer_position != SERIAL_FOOTER)) + { + // This is not a correct message, we need to go to the next byte + Serial_MoveRxPtr(1); + if (rx_size == 0) + { + // We don't have data to parse anymore + return; + } + } + if (rx_size < sizeof(SerialHeader_t)) + { + // We don't receive the complete message yet. + return; + } + /*********************************************** + * 3 - Process the message + *********************************************/ + if ((header.size > sizeof(msg_t)) || (header.size < sizeof(header_t))) + { + // This is not a standars message. + if (header.size == 0) + { + // This is a ping or a de-ping message + // - The ping message indicate that a master node is looking for this one + // - The de-ping message indicate that we are the master node. We already ping this node by calling Serial_RunTopology and we need to consider this branch as done + + // message reply to it + sending = true; + Phy_SetIrqState(true); + // We can send the message + // Add the encapsulation to the message + SerialHeader_t header_rply; + header_rply.header = SERIAL_HEADER; + // By adding 1 data, this message will be received but not interpreted + header_rply.size = 1; + memcpy(TX_data, &header_rply, sizeof(SerialHeader_t)); + TX_data[sizeof(SerialHeader_t)] = 0; + TX_data[sizeof(SerialHeader_t) + 1] = SERIAL_FOOTER; + + // Send the message + SerialHAL_Send(TX_data, sizeof(SerialHeader_t) + 2); + + // Did we receive this ping from a master node or are we the node that initiate the ping? + if (we_initiate_ping == false) + { + // We receive this ping from a master node + // This port become the topology source of this node + // Notify luos_phy about it + Phy_Topologysource(phy_serial, SerialHAL_GetPort()); + // The next ping we send will be a deping + next_ping_is_deping = true; + } + else + { + // We already ping this node, we need to consider this branch as done + Phy_TopologyDone(phy_serial); + we_initiate_ping = false; + } + } + // This is not a correct message, we need to trash it + Serial_MoveRxPtr(header.size + sizeof(SerialHeader_t) + 1); + } + else + { + // This message is correct and have actual data to parse, we can process it + // First, we need to remove the header encapsulation + Serial_MoveRxPtr(sizeof(SerialHeader_t)); + + uint8_t continuous_data[header.size]; + uint8_t *rx_buffer_base_bkp = phy_serial->rx_buffer_base; + // Check if the message is continuous in the buffer + if (phy_serial->rx_buffer_base + header.size > RX_data + sizeof(RX_data)) + { + // The message is not continuous in the buffer, we need to move it + uint8_t size = RX_data + sizeof(RX_data) - phy_serial->rx_buffer_base; + memcpy(continuous_data, phy_serial->rx_buffer_base, size); + memcpy(continuous_data + size, RX_data, header.size - size); + phy_serial->rx_buffer_base = continuous_data; + phy_serial->rx_data = continuous_data; + } + // The phy manager will need the data to be continuous in memory, so we need to move it + + // Give only the header to begin + phy_serial->received_data = sizeof(header_t); + Phy_ComputeHeader(phy_serial); + if (phy_serial->rx_keep == true) + { + // Header compute ask us to keep this message, to give it to an other phy. We already have the complete message, we can give it + phy_serial->received_data = header.size; + // We want to keep this message, we can validate it + Phy_ValidMsg(phy_serial); + if (phy_serial->rx_data == NULL) + { + // The message wasn't kept, there is no more space on the buffer, or the message is corrupted. + // This is a critical failure + LUOS_ASSERT(0); + } + } + phy_serial->rx_buffer_base = rx_buffer_base_bkp; + // The message have been consumed, we can move the rx buffer pointer + Serial_MoveRxPtr(header.size + 1); + } + } +} + +/****************************************************************************** + * @brief Serial job handler + * @param phy_ptr + * @param job + * @return None + ******************************************************************************/ +void Serial_JobHandler(luos_phy_t *phy_ptr, phy_job_t *job) +{ + // Try to directly transmit... Who knows perhaps the line is free + Serial_Send(); +} + +/****************************************************************************** + * @brief We finished to send the message, try to send another one + * @param None + * @return None + ******************************************************************************/ +_CRITICAL void Serial_TransmissionEnd(void) +{ + sending = false; + // We transmitted this message, we can remove it then send another one + // We may had a reset during this transmission, so we need to check if we still have something to transmit + if (phy_serial->job_nb > 0) + { + phy_job_t *job = Phy_GetJob(phy_serial); + job->phy_data = 0; + Phy_RmJob(phy_serial, job); + Serial_Send(); + } +} + +/****************************************************************************** + * @brief Try to send a message + * @param None + * @return None + * ****************************************************************************/ +_CRITICAL void Serial_Send(void) +{ + phy_job_t *job = Phy_GetJob(phy_serial); + if (job == NULL) + { + return; + } + Phy_SetIrqState(false); + if (sending == false) + { + sending = true; + Phy_SetIrqState(true); + // We can send the message + // Add the encapsulation to the message + SerialHeader_t header; + header.header = SERIAL_HEADER; + header.size = job->size; + memcpy(TX_data, &header, sizeof(SerialHeader_t)); + memcpy(TX_data + sizeof(SerialHeader_t), job->msg_pt, sizeof(msg_t)); + if (job->timestamp) + { + // Convert date to a sendable timestamp and put it in the end of the message + time_luos_t timestamp = Phy_ComputeMsgTimestamp(job); + memcpy(&TX_data[sizeof(SerialHeader_t) + job->size - +sizeof(timestamp)], ×tamp, sizeof(time_luos_t)); + TX_data[sizeof(SerialHeader_t) + job->size] = SERIAL_FOOTER; + } + else + { + TX_data[sizeof(SerialHeader_t) + job->size] = SERIAL_FOOTER; + // Send the message + } + SerialHAL_Send(TX_data, job->size + sizeof(SerialHeader_t) + 1); + } + Phy_SetIrqState(true); +} + +/****************************************************************************** + * @brief Store received data in the rx buffer + * @param data data to store + * @param size size of the data + * @return None + *****************************************************************************/ +_CRITICAL void Serial_ReceptionAdd(uint8_t *data, uint32_t size) +{ + if (rx_size == 0) + { + // This is probably the first data we received for this message, we need to timestamp the reception date. + // Watch out, if the loop is executed very slowly we may receive multiple messages in the same loop. This could result in a wrong timestamp for the second message. Their is no way to avoid this problem, so we need to accept it. Anyway we even didn't have any way to store multiple timestamp... + phy_serial->rx_timestamp = TimeOD_TimeFrom_ns(TimeOD_TimeTo_ns(Phy_GetTimestamp()) - (size * (uint32_t)10 * (uint32_t)1000000000 / (uint32_t)SERIAL_NETWORK_BAUDRATE)); // now - (nbr_byte * 10bits * (1s in ns) / baudrate) + } + uint32_t copy_size = (uintptr_t)&RX_data + sizeof(RX_data) - (uintptr_t)phy_serial->rx_buffer_base + rx_size; + if (copy_size > size) + { + copy_size = size; + } + memcpy(phy_serial->rx_buffer_base + rx_size, data, copy_size); + if (copy_size < size) + { + memcpy(RX_data, data + copy_size, size - copy_size); + } + rx_size += size; + if ((wait_reception == true) && (size >= sizeof(SerialHeader_t) + 1)) + { + // We received the answer of a topology ping, just indicate that we receive it + wait_reception = false; + } +} + +/****************************************************************************** + * @brief Reception end callback + * @param None + * @return None + ******************************************************************************/ +_CRITICAL void Serial_ReceptionEnd(uint32_t size) +{ + // Reception is finished, we can parse the message + rx_size += size; + // We consider this as the end of a complete message + // If we received multiple messages in this call, this could result in a wrong timestamp for the second message. Their is no way to avoid this problem, so we need to accept it. + phy_serial->rx_timestamp = TimeOD_TimeFrom_ns(TimeOD_TimeTo_ns(Phy_GetTimestamp()) - (rx_size * (uint32_t)10 * (uint32_t)1000000000 / (uint32_t)SERIAL_NETWORK_BAUDRATE)); // now - (nbr_byte * 10bits * (1s in ns) / baudrate) + LUOS_ASSERT(rx_size < sizeof(RX_data)); + if ((wait_reception == true) && (size >= sizeof(SerialHeader_t) + 1)) + { + // We received the answer of a topology ping, just indicate that we receive it + wait_reception = false; + } +} + +/****************************************************************************** + * @brief Find the next neighbour on this phy + * @param None + * @return error_return_t + ******************************************************************************/ +error_return_t Serial_RunTopology(luos_phy_t *phy_ptr, uint8_t *portId) +{ + // Send a ping message + + // While the transmission is not availble, we wait + while (sending == true) + ; + Phy_SetIrqState(false); + if (sending == false) + { + sending = true; + Phy_SetIrqState(true); + // We can send the message + // Add the encapsulation to the message + SerialHeader_t header; + header.header = SERIAL_HEADER; + header.size = 0; + memcpy(TX_data, &header, sizeof(SerialHeader_t)); + TX_data[sizeof(SerialHeader_t)] = SERIAL_FOOTER; + + // Send the message + SerialHAL_Send(TX_data, sizeof(SerialHeader_t) + 1); + } + else + { + Phy_SetIrqState(true); + LUOS_ASSERT(0); + } + + // Now we have to wait for the answer during max 200 ms + wait_reception = true; + uint32_t timeout = LuosHAL_GetSystick() + 200; + while ((wait_reception == true) && (LuosHAL_GetSystick() < timeout)) + { + // Treat potential received data + Serial_Loop(); + } + // Check if we received the answer + if (wait_reception == false) + { + // We received the answer + // We have to find out if this ping was a ping or a de-ping + if (next_ping_is_deping == true) + { + // This was a de-ping, we need to consider this branch as done + Phy_TopologyDone(phy_serial); + next_ping_is_deping = false; + return FAILED; + } + else + { + // We have to wait a de-ping to consider this branch as done + // Save a flag to indicate that we initiate a ping + we_initiate_ping = true; + return SUCCEED; + } + } + else + { + // We didn't receive the answer, consider this branch as done + we_initiate_ping = false; + Phy_TopologyDone(phy_serial); + return FAILED; + } +} From c3ddb9be75a3d51e0c258ea2877ee23e01c8b621 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 7 Jul 2023 14:33:02 +0200 Subject: [PATCH 103/150] OK serial test with Native gate and L0 button --- examples/projects/l0/button/lib/Button/button.c | 3 +-- examples/projects/l0/button/platformio.ini | 1 - examples/projects/native/gate_wscom/platformio.ini | 2 +- examples/projects/native/gate_wscom/src/main.c | 11 +++++++---- examples/projects/native/led/platformio.ini | 2 +- examples/projects/native/led/src/main.c | 5 +++-- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/examples/projects/l0/button/lib/Button/button.c b/examples/projects/l0/button/lib/Button/button.c index b061ccc31..3005acb65 100644 --- a/examples/projects/l0/button/lib/Button/button.c +++ b/examples/projects/l0/button/lib/Button/button.c @@ -36,8 +36,7 @@ void Button_Init(void) // Profile configuration button.access = READ_ONLY_ACCESS; // Service creation following state profile - service_t *service = ProfileState_CreateService(&button, 0, "button", revision); - Luos_Detect(service); + ProfileState_CreateService(&button, 0, "button", revision); } /****************************************************************************** diff --git a/examples/projects/l0/button/platformio.ini b/examples/projects/l0/button/platformio.ini index 995f62e3a..421c5d9c1 100644 --- a/examples/projects/l0/button/platformio.ini +++ b/examples/projects/l0/button/platformio.ini @@ -20,7 +20,6 @@ board = l0 framework = stm32cube lib_deps = luos_engine@^3.0.0 - robus_network Button serial_network debug_tool = stlink diff --git a/examples/projects/native/gate_wscom/platformio.ini b/examples/projects/native/gate_wscom/platformio.ini index cd2b02bcd..d76767f39 100644 --- a/examples/projects/native/gate_wscom/platformio.ini +++ b/examples/projects/native/gate_wscom/platformio.ini @@ -19,7 +19,7 @@ lib_extra_dirs = platform = native lib_deps = luos_engine@^3.0.0 - robus_network + serial_network Pipe Gate build_unflags = -Os diff --git a/examples/projects/native/gate_wscom/src/main.c b/examples/projects/native/gate_wscom/src/main.c index fe7365b54..161e248b1 100644 --- a/examples/projects/native/gate_wscom/src/main.c +++ b/examples/projects/native/gate_wscom/src/main.c @@ -1,5 +1,5 @@ #include "luos_engine.h" -#include "robus_network.h" +#include "serial_network.h" #include "pipe.h" #include "gate.h" #include @@ -17,14 +17,17 @@ void *Gate_Pipe_LoopThread(void *vargp) int main(void) { Luos_Init(); - Robus_Init(); + Serial_Init(); Pipe_Init(); Gate_Init(); // Create a thread to convert messages into Json and steam them using Websocket - pthread_t thread_id; - pthread_create(&thread_id, NULL, Gate_Pipe_LoopThread, NULL); + // pthread_t thread_id; + // pthread_create(&thread_id, NULL, Gate_Pipe_LoopThread, NULL); while (1) { Luos_Loop(); + Serial_Loop(); + Pipe_Loop(); + Gate_Loop(); } } diff --git a/examples/projects/native/led/platformio.ini b/examples/projects/native/led/platformio.ini index fa191afac..9264d26e6 100644 --- a/examples/projects/native/led/platformio.ini +++ b/examples/projects/native/led/platformio.ini @@ -18,7 +18,7 @@ lib_extra_dirs = platform = native lib_deps = Led - robus_network + serial_network build_unflags = -Os build_flags = -I inc diff --git a/examples/projects/native/led/src/main.c b/examples/projects/native/led/src/main.c index ba4fb4c5f..1ec6286cb 100644 --- a/examples/projects/native/led/src/main.c +++ b/examples/projects/native/led/src/main.c @@ -1,15 +1,16 @@ #include "luos_engine.h" -#include "robus_network.h" +#include "serial_network.h" #include "led.h" int main(void) { Luos_Init(); - Robus_Init(); + Serial_Init(); Led_Init(); while (1) { Luos_Loop(); + Serial_Loop(); Led_Loop(); } } From 5a721dafb98d1b8babc40c19e158fe9e797302f0 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 11 Jul 2023 13:05:19 +0200 Subject: [PATCH 104/150] OK serial test with native gate and G474 and G431 button --- .../NUCLEO-G431KB/button/platformio.ini | 4 +- .../projects/NUCLEO-G431KB/button/src/main.c | 5 +- .../NUCLEO-G474RE/button/lib/Button/button.h | 1 - .../NUCLEO-G474RE/button/platformio.ini | 4 +- .../projects/NUCLEO-G474RE/button/src/gpio.c | 71 ++-- .../projects/NUCLEO-G474RE/button/src/main.c | 7 +- .../button/src/stm32g4xx_hal_msp.c | 58 +-- .../NUCLEO-G474RE/button/src/stm32g4xx_it.c | 118 +++--- .../button/src/system_stm32g4xx.c | 362 +++++++++--------- 9 files changed, 317 insertions(+), 313 deletions(-) diff --git a/examples/projects/NUCLEO-G431KB/button/platformio.ini b/examples/projects/NUCLEO-G431KB/button/platformio.ini index 5313a69a9..2b77f463a 100644 --- a/examples/projects/NUCLEO-G431KB/button/platformio.ini +++ b/examples/projects/NUCLEO-G431KB/button/platformio.ini @@ -20,7 +20,7 @@ board = nucleo_g431kb framework = stm32cube lib_deps = luos_engine@^3.0.0 - robus_network + serial_network Button debug_tool = stlink upload_protocol = stlink @@ -33,6 +33,7 @@ build_flags = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DLUOSHAL=STM32G4 + -DSERIALHAL=STM32G431 [env:nucleo_g431kb_with_bootloader] board_build.ldscript = linker/custom_Luos_bootloader_script.ld @@ -44,6 +45,7 @@ build_flags = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DLUOSHAL=STM32G4 + -DSERIALHAL=STM32G431 upload_protocol = custom upload_flags = -t2 diff --git a/examples/projects/NUCLEO-G431KB/button/src/main.c b/examples/projects/NUCLEO-G431KB/button/src/main.c index 11a4c21f7..d46289bfd 100644 --- a/examples/projects/NUCLEO-G431KB/button/src/main.c +++ b/examples/projects/NUCLEO-G431KB/button/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus_network.h" +#include "serial_network.h" #include "button.h" /* USER CODE END Includes */ @@ -88,7 +88,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); - Robus_Init(); + Serial_Init(); Button_Init(); /* USER CODE END 2 */ @@ -100,6 +100,7 @@ int main(void) /* USER CODE BEGIN 3 */ Luos_Loop(); + Serial_Loop(); Button_Loop(); } /* USER CODE END 3 */ diff --git a/examples/projects/NUCLEO-G474RE/button/lib/Button/button.h b/examples/projects/NUCLEO-G474RE/button/lib/Button/button.h index 391034b43..29464d5e3 100644 --- a/examples/projects/NUCLEO-G474RE/button/lib/Button/button.h +++ b/examples/projects/NUCLEO-G474RE/button/lib/Button/button.h @@ -8,7 +8,6 @@ #define BUTTON_H #include "luos_engine.h" -#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-G474RE/button/platformio.ini b/examples/projects/NUCLEO-G474RE/button/platformio.ini index b6d6dac6f..af333b60a 100644 --- a/examples/projects/NUCLEO-G474RE/button/platformio.ini +++ b/examples/projects/NUCLEO-G474RE/button/platformio.ini @@ -21,7 +21,7 @@ board = nucleo_g474re framework = stm32cube lib_deps = luos_engine@^3.0.0 - robus_network + serial_network Button debug_tool = stlink upload_protocol = stlink @@ -34,6 +34,7 @@ build_flags = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DLUOSHAL=STM32G4 + -DSERIALHAL=STM32G474 [env:nucleo_g474re_with_bootloader] board_build.ldscript = linker/custom_Luos_bootloader_script.ld @@ -45,6 +46,7 @@ build_flags = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DLUOSHAL=STM32G4 + -DSERIALHAL=STM32G474 upload_protocol = custom upload_flags = -t2 diff --git a/examples/projects/NUCLEO-G474RE/button/src/gpio.c b/examples/projects/NUCLEO-G474RE/button/src/gpio.c index bfbead5c8..cefdc6b51 100644 --- a/examples/projects/NUCLEO-G474RE/button/src/gpio.c +++ b/examples/projects/NUCLEO-G474RE/button/src/gpio.c @@ -1,21 +1,21 @@ /** - ****************************************************************************** - * @file gpio.c - * @brief This file provides code for the configuration - * of all used GPIO pins. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ + ****************************************************************************** + * @file gpio.c + * @brief This file provides code for the configuration + * of all used GPIO pins. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ /* Includes ------------------------------------------------------------------*/ #include "gpio.h" @@ -32,32 +32,31 @@ /* USER CODE END 1 */ /** Configure pins -*/ + */ void MX_GPIO_Init(void) { - GPIO_InitTypeDef GPIO_InitStruct = {0}; + GPIO_InitTypeDef GPIO_InitStruct = {0}; - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); + /* GPIO Ports Clock Enable */ + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET); + /*Configure GPIO pin Output Level */ + HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET); - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = BTN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(BTN_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = LED_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_PULLDOWN; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct); + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = BTN_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; + GPIO_InitStruct.Pull = GPIO_NOPULL; + HAL_GPIO_Init(BTN_GPIO_Port, &GPIO_InitStruct); + /*Configure GPIO pin : PtPin */ + GPIO_InitStruct.Pin = LED_Pin; + GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; + GPIO_InitStruct.Pull = GPIO_PULLDOWN; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; + HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct); } /* USER CODE BEGIN 2 */ diff --git a/examples/projects/NUCLEO-G474RE/button/src/main.c b/examples/projects/NUCLEO-G474RE/button/src/main.c index a4a3f3b8b..0aeda414e 100644 --- a/examples/projects/NUCLEO-G474RE/button/src/main.c +++ b/examples/projects/NUCLEO-G474RE/button/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus_network.h" +#include "serial_network.h" #include "button.h" /* USER CODE END Includes */ @@ -89,7 +89,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ LUOS_ADD_PACKAGE(Button) - LUOS_ADD_PACKAGE(Robus) + LUOS_ADD_PACKAGE(Serial) /* USER CODE END 2 */ /* Infinite loop */ @@ -135,7 +135,8 @@ void SystemClock_Config(void) } /** Initializes the CPU, AHB and APB buses clocks */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK + | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; diff --git a/examples/projects/NUCLEO-G474RE/button/src/stm32g4xx_hal_msp.c b/examples/projects/NUCLEO-G474RE/button/src/stm32g4xx_hal_msp.c index bcb709652..0096a09b3 100644 --- a/examples/projects/NUCLEO-G474RE/button/src/stm32g4xx_hal_msp.c +++ b/examples/projects/NUCLEO-G474RE/button/src/stm32g4xx_hal_msp.c @@ -1,22 +1,22 @@ /* USER CODE BEGIN Header */ /** - ****************************************************************************** - * @file stm32g4xx_hal_msp.c - * @brief This file provides code for the MSP Initialization - * and de-Initialization codes. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ + ****************************************************************************** + * @file stm32g4xx_hal_msp.c + * @brief This file provides code for the MSP Initialization + * and de-Initialization codes. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2021 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ @@ -59,26 +59,26 @@ /* USER CODE END 0 */ /** - * Initializes the Global MSP. - */ + * Initializes the Global MSP. + */ void HAL_MspInit(void) { - /* USER CODE BEGIN MspInit 0 */ + /* USER CODE BEGIN MspInit 0 */ - /* USER CODE END MspInit 0 */ + /* USER CODE END MspInit 0 */ - __HAL_RCC_SYSCFG_CLK_ENABLE(); - __HAL_RCC_PWR_CLK_ENABLE(); + __HAL_RCC_SYSCFG_CLK_ENABLE(); + __HAL_RCC_PWR_CLK_ENABLE(); - /* System interrupt init*/ + /* System interrupt init*/ - /** Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral - */ - //HAL_PWREx_DisableUCPDDeadBattery(); + /** Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral + */ + // HAL_PWREx_DisableUCPDDeadBattery(); - /* USER CODE BEGIN MspInit 1 */ + /* USER CODE BEGIN MspInit 1 */ - /* USER CODE END MspInit 1 */ + /* USER CODE END MspInit 1 */ } /* USER CODE BEGIN 1 */ diff --git a/examples/projects/NUCLEO-G474RE/button/src/stm32g4xx_it.c b/examples/projects/NUCLEO-G474RE/button/src/stm32g4xx_it.c index 4cbb9db25..2e52f9297 100644 --- a/examples/projects/NUCLEO-G474RE/button/src/stm32g4xx_it.c +++ b/examples/projects/NUCLEO-G474RE/button/src/stm32g4xx_it.c @@ -69,14 +69,14 @@ */ void NMI_Handler(void) { - /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ - - /* USER CODE END NonMaskableInt_IRQn 0 */ - /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ - while (1) - { - } - /* USER CODE END NonMaskableInt_IRQn 1 */ + /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ + + /* USER CODE END NonMaskableInt_IRQn 0 */ + /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ + while (1) + { + } + /* USER CODE END NonMaskableInt_IRQn 1 */ } /** @@ -84,14 +84,14 @@ void NMI_Handler(void) */ void HardFault_Handler(void) { - /* USER CODE BEGIN HardFault_IRQn 0 */ - - /* USER CODE END HardFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_HardFault_IRQn 0 */ - /* USER CODE END W1_HardFault_IRQn 0 */ - } + /* USER CODE BEGIN HardFault_IRQn 0 */ + + /* USER CODE END HardFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_HardFault_IRQn 0 */ + /* USER CODE END W1_HardFault_IRQn 0 */ + } } /** @@ -99,14 +99,14 @@ void HardFault_Handler(void) */ void MemManage_Handler(void) { - /* USER CODE BEGIN MemoryManagement_IRQn 0 */ - - /* USER CODE END MemoryManagement_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ - /* USER CODE END W1_MemoryManagement_IRQn 0 */ - } + /* USER CODE BEGIN MemoryManagement_IRQn 0 */ + + /* USER CODE END MemoryManagement_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ + /* USER CODE END W1_MemoryManagement_IRQn 0 */ + } } /** @@ -114,14 +114,14 @@ void MemManage_Handler(void) */ void BusFault_Handler(void) { - /* USER CODE BEGIN BusFault_IRQn 0 */ - - /* USER CODE END BusFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_BusFault_IRQn 0 */ - /* USER CODE END W1_BusFault_IRQn 0 */ - } + /* USER CODE BEGIN BusFault_IRQn 0 */ + + /* USER CODE END BusFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_BusFault_IRQn 0 */ + /* USER CODE END W1_BusFault_IRQn 0 */ + } } /** @@ -129,14 +129,14 @@ void BusFault_Handler(void) */ void UsageFault_Handler(void) { - /* USER CODE BEGIN UsageFault_IRQn 0 */ - - /* USER CODE END UsageFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ - /* USER CODE END W1_UsageFault_IRQn 0 */ - } + /* USER CODE BEGIN UsageFault_IRQn 0 */ + + /* USER CODE END UsageFault_IRQn 0 */ + while (1) + { + /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ + /* USER CODE END W1_UsageFault_IRQn 0 */ + } } /** @@ -144,12 +144,12 @@ void UsageFault_Handler(void) */ void SVC_Handler(void) { - /* USER CODE BEGIN SVCall_IRQn 0 */ + /* USER CODE BEGIN SVCall_IRQn 0 */ - /* USER CODE END SVCall_IRQn 0 */ - /* USER CODE BEGIN SVCall_IRQn 1 */ + /* USER CODE END SVCall_IRQn 0 */ + /* USER CODE BEGIN SVCall_IRQn 1 */ - /* USER CODE END SVCall_IRQn 1 */ + /* USER CODE END SVCall_IRQn 1 */ } /** @@ -157,12 +157,12 @@ void SVC_Handler(void) */ void DebugMon_Handler(void) { - /* USER CODE BEGIN DebugMonitor_IRQn 0 */ + /* USER CODE BEGIN DebugMonitor_IRQn 0 */ - /* USER CODE END DebugMonitor_IRQn 0 */ - /* USER CODE BEGIN DebugMonitor_IRQn 1 */ + /* USER CODE END DebugMonitor_IRQn 0 */ + /* USER CODE BEGIN DebugMonitor_IRQn 1 */ - /* USER CODE END DebugMonitor_IRQn 1 */ + /* USER CODE END DebugMonitor_IRQn 1 */ } /** @@ -170,12 +170,12 @@ void DebugMon_Handler(void) */ void PendSV_Handler(void) { - /* USER CODE BEGIN PendSV_IRQn 0 */ + /* USER CODE BEGIN PendSV_IRQn 0 */ - /* USER CODE END PendSV_IRQn 0 */ - /* USER CODE BEGIN PendSV_IRQn 1 */ + /* USER CODE END PendSV_IRQn 0 */ + /* USER CODE BEGIN PendSV_IRQn 1 */ - /* USER CODE END PendSV_IRQn 1 */ + /* USER CODE END PendSV_IRQn 1 */ } /** @@ -183,13 +183,13 @@ void PendSV_Handler(void) */ void SysTick_Handler(void) { - /* USER CODE BEGIN SysTick_IRQn 0 */ + /* USER CODE BEGIN SysTick_IRQn 0 */ - /* USER CODE END SysTick_IRQn 0 */ - HAL_IncTick(); - /* USER CODE BEGIN SysTick_IRQn 1 */ + /* USER CODE END SysTick_IRQn 0 */ + HAL_IncTick(); + /* USER CODE BEGIN SysTick_IRQn 1 */ - /* USER CODE END SysTick_IRQn 1 */ + /* USER CODE END SysTick_IRQn 1 */ } /******************************************************************************/ @@ -203,12 +203,12 @@ void SysTick_Handler(void) /* USER CODE BEGIN 1 */ void EXTI9_5_IRQHandler(void) { - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_5); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_5); } void EXTI4_IRQHandler(void) { - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_4); + HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_4); } /* USER CODE END 1 */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G474RE/button/src/system_stm32g4xx.c b/examples/projects/NUCLEO-G474RE/button/src/system_stm32g4xx.c index 3dd84e854..0c74693cf 100644 --- a/examples/projects/NUCLEO-G474RE/button/src/system_stm32g4xx.c +++ b/examples/projects/NUCLEO-G474RE/button/src/system_stm32g4xx.c @@ -1,80 +1,80 @@ /** - ****************************************************************************** - * @file system_stm32g4xx.c - * @author MCD Application Team - * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File - * - * This file provides two functions and one global variable to be called from - * user application: - * - SystemInit(): This function is called at startup just after reset and - * before branch to main program. This call is made inside - * the "startup_stm32g4xx.s" file. - * - * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick - * timer or configure other parameters. - * - * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must - * be called whenever the core clock is changed - * during program execution. - * - * After each device reset the HSI (16 MHz) is used as system clock source. - * Then SystemInit() function is called, in "startup_stm32g4xx.s" file, to - * configure the system clock before to branch to main program. - * - * This file configures the system clock as follows: - *============================================================================= - *----------------------------------------------------------------------------- - * System Clock source | HSI - *----------------------------------------------------------------------------- - * SYSCLK(Hz) | 16000000 - *----------------------------------------------------------------------------- - * HCLK(Hz) | 16000000 - *----------------------------------------------------------------------------- - * AHB Prescaler | 1 - *----------------------------------------------------------------------------- - * APB1 Prescaler | 1 - *----------------------------------------------------------------------------- - * APB2 Prescaler | 1 - *----------------------------------------------------------------------------- - * PLL_M | 1 - *----------------------------------------------------------------------------- - * PLL_N | 16 - *----------------------------------------------------------------------------- - * PLL_P | 7 - *----------------------------------------------------------------------------- - * PLL_Q | 2 - *----------------------------------------------------------------------------- - * PLL_R | 2 - *----------------------------------------------------------------------------- - * Require 48MHz for RNG | Disabled - *----------------------------------------------------------------------------- - *============================================================================= - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2019 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ + ****************************************************************************** + * @file system_stm32g4xx.c + * @author MCD Application Team + * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File + * + * This file provides two functions and one global variable to be called from + * user application: + * - SystemInit(): This function is called at startup just after reset and + * before branch to main program. This call is made inside + * the "startup_stm32g4xx.s" file. + * + * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used + * by the user application to setup the SysTick + * timer or configure other parameters. + * + * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must + * be called whenever the core clock is changed + * during program execution. + * + * After each device reset the HSI (16 MHz) is used as system clock source. + * Then SystemInit() function is called, in "startup_stm32g4xx.s" file, to + * configure the system clock before to branch to main program. + * + * This file configures the system clock as follows: + *============================================================================= + *----------------------------------------------------------------------------- + * System Clock source | HSI + *----------------------------------------------------------------------------- + * SYSCLK(Hz) | 16000000 + *----------------------------------------------------------------------------- + * HCLK(Hz) | 16000000 + *----------------------------------------------------------------------------- + * AHB Prescaler | 1 + *----------------------------------------------------------------------------- + * APB1 Prescaler | 1 + *----------------------------------------------------------------------------- + * APB2 Prescaler | 1 + *----------------------------------------------------------------------------- + * PLL_M | 1 + *----------------------------------------------------------------------------- + * PLL_N | 16 + *----------------------------------------------------------------------------- + * PLL_P | 7 + *----------------------------------------------------------------------------- + * PLL_Q | 2 + *----------------------------------------------------------------------------- + * PLL_R | 2 + *----------------------------------------------------------------------------- + * Require 48MHz for RNG | Disabled + *----------------------------------------------------------------------------- + *============================================================================= + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ /** @addtogroup CMSIS - * @{ - */ + * @{ + */ /** @addtogroup stm32g4xx_system - * @{ - */ + * @{ + */ /** @addtogroup STM32G4xx_System_Private_Includes - * @{ - */ + * @{ + */ #include "stm32g4xx.h" @@ -87,43 +87,43 @@ #endif /* HSI_VALUE */ /** - * @} - */ + * @} + */ /** @addtogroup STM32G4xx_System_Private_TypesDefinitions - * @{ - */ + * @{ + */ /** - * @} - */ + * @} + */ /** @addtogroup STM32G4xx_System_Private_Defines - * @{ - */ + * @{ + */ /************************* Miscellaneous Configuration ************************/ /*!< Uncomment the following line if you need to relocate your vector Table in Internal SRAM. */ /* #define VECT_TAB_SRAM */ -#define VECT_TAB_OFFSET 0x08000000UL /*!< Vector Table base offset field. \ +#define VECT_TAB_OFFSET 0x00UL /*!< Vector Table base offset field. \ This value must be a multiple of 0x200. */ - /******************************************************************************/ - /** - * @} - */ + /******************************************************************************/ + /** + * @} + */ /** @addtogroup STM32G4xx_System_Private_Macros - * @{ - */ + * @{ + */ /** - * @} - */ + * @} + */ /** @addtogroup STM32G4xx_System_Private_Variables - * @{ - */ + * @{ + */ /* The SystemCoreClock variable is updated in three ways: 1) by calling CMSIS function SystemCoreClockUpdate() 2) by calling HAL API function HAL_RCC_GetHCLKFreq() @@ -135,135 +135,135 @@ uint32_t SystemCoreClock = HSI_VALUE; const uint8_t AHBPrescTable[16] = {0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U, 6U, 7U, 8U, 9U}; -const uint8_t APBPrescTable[8] = {0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U}; +const uint8_t APBPrescTable[8] = {0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U}; /** - * @} - */ + * @} + */ /** @addtogroup STM32G4xx_System_Private_FunctionPrototypes - * @{ - */ + * @{ + */ /** - * @} - */ + * @} + */ /** @addtogroup STM32G4xx_System_Private_Functions - * @{ - */ + * @{ + */ /** - * @brief Setup the microcontroller system. - * @param None - * @retval None - */ + * @brief Setup the microcontroller system. + * @param None + * @retval None + */ void SystemInit(void) { /* FPU settings ------------------------------------------------------------*/ #if (__FPU_PRESENT == 1) && (__FPU_USED == 1) - SCB->CPACR |= ((3UL << (10 * 2)) | (3UL << (11 * 2))); /* set CP10 and CP11 Full Access */ + SCB->CPACR |= ((3UL << (10 * 2)) | (3UL << (11 * 2))); /* set CP10 and CP11 Full Access */ #endif - /* Configure the Vector Table location add offset address ------------------*/ + /* Configure the Vector Table location add offset address ------------------*/ #ifdef VECT_TAB_SRAM - SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ + SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ #else - SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ + SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ #endif } /** - * @brief Update SystemCoreClock variable according to Clock Register Values. - * The SystemCoreClock variable contains the core clock (HCLK), it can - * be used by the user application to setup the SysTick timer or configure - * other parameters. - * - * @note Each time the core clock (HCLK) changes, this function must be called - * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined - * constant and the selected clock source: - * - * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**) - * - * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***) - * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * - * (**) HSI_VALUE is a constant defined in stm32g4xx_hal.h file (default value - * 16 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * - * (***) HSE_VALUE is a constant defined in stm32g4xx_hal.h file (default value - * 8 MHz), user has to ensure that HSE_VALUE is same as the real - * frequency of the crystal used. Otherwise, this function may - * have wrong result. - * - * - The result of this function could be not correct when using fractional - * value for HSE crystal. - * - * @param None - * @retval None - */ + * @brief Update SystemCoreClock variable according to Clock Register Values. + * The SystemCoreClock variable contains the core clock (HCLK), it can + * be used by the user application to setup the SysTick timer or configure + * other parameters. + * + * @note Each time the core clock (HCLK) changes, this function must be called + * to update SystemCoreClock variable value. Otherwise, any configuration + * based on this variable will be incorrect. + * + * @note - The system frequency computed by this function is not the real + * frequency in the chip. It is calculated based on the predefined + * constant and the selected clock source: + * + * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**) + * + * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***) + * + * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***) + * or HSI_VALUE(*) multiplied/divided by the PLL factors. + * + * (**) HSI_VALUE is a constant defined in stm32g4xx_hal.h file (default value + * 16 MHz) but the real value may vary depending on the variations + * in voltage and temperature. + * + * (***) HSE_VALUE is a constant defined in stm32g4xx_hal.h file (default value + * 8 MHz), user has to ensure that HSE_VALUE is same as the real + * frequency of the crystal used. Otherwise, this function may + * have wrong result. + * + * - The result of this function could be not correct when using fractional + * value for HSE crystal. + * + * @param None + * @retval None + */ void SystemCoreClockUpdate(void) { - uint32_t tmp, pllvco, pllr, pllsource, pllm; + uint32_t tmp, pllvco, pllr, pllsource, pllm; - /* Get SYSCLK source -------------------------------------------------------*/ - switch (RCC->CFGR & RCC_CFGR_SWS) - { - case 0x04: /* HSI used as system clock source */ - SystemCoreClock = HSI_VALUE; - break; + /* Get SYSCLK source -------------------------------------------------------*/ + switch (RCC->CFGR & RCC_CFGR_SWS) + { + case 0x04: /* HSI used as system clock source */ + SystemCoreClock = HSI_VALUE; + break; - case 0x08: /* HSE used as system clock source */ - SystemCoreClock = HSE_VALUE; - break; + case 0x08: /* HSE used as system clock source */ + SystemCoreClock = HSE_VALUE; + break; - case 0x0C: /* PLL used as system clock source */ - /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLLM) * PLLN + case 0x0C: /* PLL used as system clock source */ + /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLLM) * PLLN SYSCLK = PLL_VCO / PLLR */ - pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC); - pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> 4) + 1U; - if (pllsource == 0x02UL) /* HSI used as PLL clock source */ - { - pllvco = (HSI_VALUE / pllm); - } - else /* HSE used as PLL clock source */ - { - pllvco = (HSE_VALUE / pllm); - } - pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 8); - pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> 25) + 1U) * 2U; - SystemCoreClock = pllvco / pllr; - break; + pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC); + pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> 4) + 1U; + if (pllsource == 0x02UL) /* HSI used as PLL clock source */ + { + pllvco = (HSI_VALUE / pllm); + } + else /* HSE used as PLL clock source */ + { + pllvco = (HSE_VALUE / pllm); + } + pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 8); + pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> 25) + 1U) * 2U; + SystemCoreClock = pllvco / pllr; + break; - default: - break; - } - /* Compute HCLK clock frequency --------------------------------------------*/ - /* Get HCLK prescaler */ - tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; - /* HCLK clock frequency */ - SystemCoreClock >>= tmp; + default: + break; + } + /* Compute HCLK clock frequency --------------------------------------------*/ + /* Get HCLK prescaler */ + tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; + /* HCLK clock frequency */ + SystemCoreClock >>= tmp; } /** - * @} - */ + * @} + */ /** - * @} - */ + * @} + */ /** - * @} - */ + * @} + */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ From d60e27ea525abbbc7712780e4205c20d2ffc0198 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 11 Jul 2023 14:38:12 +0200 Subject: [PATCH 105/150] OK serial test with Native gate and STM32L4 button --- examples/projects/NUCLEO-L432KC/button/lib/Button/button.h | 1 - examples/projects/NUCLEO-L432KC/button/platformio.ini | 2 +- examples/projects/NUCLEO-L432KC/button/src/main.c | 5 +++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/projects/NUCLEO-L432KC/button/lib/Button/button.h b/examples/projects/NUCLEO-L432KC/button/lib/Button/button.h index 391034b43..29464d5e3 100644 --- a/examples/projects/NUCLEO-L432KC/button/lib/Button/button.h +++ b/examples/projects/NUCLEO-L432KC/button/lib/Button/button.h @@ -8,7 +8,6 @@ #define BUTTON_H #include "luos_engine.h" -#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-L432KC/button/platformio.ini b/examples/projects/NUCLEO-L432KC/button/platformio.ini index 391e4a2f0..195f52fc1 100644 --- a/examples/projects/NUCLEO-L432KC/button/platformio.ini +++ b/examples/projects/NUCLEO-L432KC/button/platformio.ini @@ -20,7 +20,7 @@ board = nucleo_l432kc framework = stm32cube lib_deps = luos_engine@^3.0.0 - robus_network + serial_network Button debug_tool = stlink upload_protocol = stlink diff --git a/examples/projects/NUCLEO-L432KC/button/src/main.c b/examples/projects/NUCLEO-L432KC/button/src/main.c index 8b8a35b29..020569afe 100644 --- a/examples/projects/NUCLEO-L432KC/button/src/main.c +++ b/examples/projects/NUCLEO-L432KC/button/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus_network.h" +#include "serial_network.h" #include "button.h" /* USER CODE END Includes */ @@ -88,7 +88,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); - Robus_Init(); + Serial_Init(); Button_Init(); /* USER CODE END 2 */ @@ -100,6 +100,7 @@ int main(void) /* USER CODE BEGIN 3 */ Luos_Loop(); + Serial_Loop(); Button_Loop(); } /* USER CODE END 3 */ From 60f86afd92856c260f5e6a40214ebdb7fabaecc4 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 11 Jul 2023 14:54:35 +0200 Subject: [PATCH 106/150] OK serial test with Native gate and STM32F4 button --- examples/projects/NUCLEO-F401RE/button/lib/Button/button.h | 1 - examples/projects/NUCLEO-F401RE/button/platformio.ini | 2 +- examples/projects/NUCLEO-F401RE/button/src/main.c | 5 +++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/projects/NUCLEO-F401RE/button/lib/Button/button.h b/examples/projects/NUCLEO-F401RE/button/lib/Button/button.h index 391034b43..29464d5e3 100644 --- a/examples/projects/NUCLEO-F401RE/button/lib/Button/button.h +++ b/examples/projects/NUCLEO-F401RE/button/lib/Button/button.h @@ -8,7 +8,6 @@ #define BUTTON_H #include "luos_engine.h" -#include "robus_network.h" /******************************************************************************* * Definitions ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F401RE/button/platformio.ini b/examples/projects/NUCLEO-F401RE/button/platformio.ini index a5858e7cc..46caa33d0 100644 --- a/examples/projects/NUCLEO-F401RE/button/platformio.ini +++ b/examples/projects/NUCLEO-F401RE/button/platformio.ini @@ -20,7 +20,7 @@ board = nucleo_f401re framework = stm32cube lib_deps = luos_engine@^3.0.0 - robus_network + serial_network Button debug_tool = stlink diff --git a/examples/projects/NUCLEO-F401RE/button/src/main.c b/examples/projects/NUCLEO-F401RE/button/src/main.c index bf478866e..ccc5ae691 100644 --- a/examples/projects/NUCLEO-F401RE/button/src/main.c +++ b/examples/projects/NUCLEO-F401RE/button/src/main.c @@ -24,7 +24,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ #include "luos_engine.h" -#include "robus_network.h" +#include "serial_network.h" #include "button.h" /* USER CODE END Includes */ @@ -88,7 +88,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); - Robus_Init(); + Serial_Init(); Button_Init(); /* USER CODE END 2 */ @@ -100,6 +100,7 @@ int main(void) /* USER CODE BEGIN 3 */ Luos_Loop(); + Serial_Loop(); Button_Loop(); } /* USER CODE END 3 */ From 418b4173537f3f9b2f827b3bfe1f1abc3c3b55af Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 10 Jul 2023 16:52:49 +0200 Subject: [PATCH 107/150] OK serial test with Native gate and Arduino button and led, fix #440 --- examples/projects/Arduino/button/platformio.ini | 10 ++++------ examples/projects/Arduino/button/src/Button.cpp | 5 +++-- examples/projects/Arduino/led/lib/led/led.h | 1 - examples/projects/Arduino/led/platformio.ini | 5 +++-- examples/projects/Arduino/led/src/led.cpp | 5 +++-- .../serial_network/HAL/ARDUINO/serial_network_hal.cpp | 2 ++ network/serial_network/HAL/NATIVE/serial_network_hal.c | 1 + 7 files changed, 16 insertions(+), 13 deletions(-) diff --git a/examples/projects/Arduino/button/platformio.ini b/examples/projects/Arduino/button/platformio.ini index 1ce8c45dd..64af7d27f 100644 --- a/examples/projects/Arduino/button/platformio.ini +++ b/examples/projects/Arduino/button/platformio.ini @@ -24,7 +24,7 @@ default_envs = zero [env] -lib_extra_dirs = +lib_extra_dirs = $PROJECT_DIR/../../../../../ $PROJECT_DIR/../../../../network/ lib_ldf_mode =off @@ -34,17 +34,15 @@ build_unflags = -Os build_flags = -O1 -include node_config.h - -D LUOSHAL=ATSAMD21_ARDUINO + -D LUOSHAL=ARDUINO + -D SERIAL_COM_DEFAULTBAUDRATE=115200 lib_deps = luos_engine@^3.0.0 - robus_network + serial_network Button - [env:zero] board = mkrzero -platform_packages = framework-arduino-samd@https://github.com/Luos-io/Arduino_core.git - [env:seed] board = seeed_xiao diff --git a/examples/projects/Arduino/button/src/Button.cpp b/examples/projects/Arduino/button/src/Button.cpp index e6a55c41d..489371785 100644 --- a/examples/projects/Arduino/button/src/Button.cpp +++ b/examples/projects/Arduino/button/src/Button.cpp @@ -6,7 +6,7 @@ extern "C" #endif #include "luos_engine.h" -#include "robus_network.h" +#include "serial_network.h" #include "button.h" #ifdef __cplusplus @@ -21,7 +21,7 @@ extern "C" void setup() { Luos_Init(); - Robus_Init(); + Serial_Init(); Button_Init(); } /****************************************************************************** @@ -32,5 +32,6 @@ void setup() void loop() { Luos_Loop(); + Serial_Loop(); Button_Loop(); } diff --git a/examples/projects/Arduino/led/lib/led/led.h b/examples/projects/Arduino/led/lib/led/led.h index e606ea77c..64026325c 100644 --- a/examples/projects/Arduino/led/lib/led/led.h +++ b/examples/projects/Arduino/led/lib/led/led.h @@ -8,7 +8,6 @@ #define LED_H #include "luos_engine.h" -#include "robus_network.h" /******************************************************************************* * Definitions diff --git a/examples/projects/Arduino/led/platformio.ini b/examples/projects/Arduino/led/platformio.ini index 86a753ab2..a380de2e2 100644 --- a/examples/projects/Arduino/led/platformio.ini +++ b/examples/projects/Arduino/led/platformio.ini @@ -35,15 +35,16 @@ build_flags = -O1 -include node_config.h -D LUOSHAL=ATSAMD21_ARDUINO + -D SERIALHAL=ARDUINO lib_deps = luos_engine@^3.0.0 - robus_network + serial_network Led [env:zero] board = mkrzero -platform_packages = framework-arduino-samd@https://github.com/Luos-io/Arduino_core.git +; platform_packages = framework-arduino-samd@https://github.com/Luos-io/Arduino_core.git [env:seed] diff --git a/examples/projects/Arduino/led/src/led.cpp b/examples/projects/Arduino/led/src/led.cpp index b005406a1..57cfad0ba 100644 --- a/examples/projects/Arduino/led/src/led.cpp +++ b/examples/projects/Arduino/led/src/led.cpp @@ -6,7 +6,7 @@ extern "C" #endif #include "luos_engine.h" -#include "robus_network.h" +#include "serial_network.h" #include "led.h" #ifdef __cplusplus @@ -21,7 +21,7 @@ extern "C" void setup() { Luos_Init(); - Robus_Init(); + Serial_Init(); Led_Init(); } /****************************************************************************** @@ -32,5 +32,6 @@ void setup() void loop() { Luos_Loop(); + Serial_Loop(); Led_Loop(); } diff --git a/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp b/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp index a29ceb9c2..cc73d2507 100644 --- a/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp +++ b/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp @@ -60,6 +60,8 @@ void SerialHAL_Loop(void) void SerialHAL_Send(uint8_t *data, uint16_t size) { Serial.write(data, size); + // Call the callback managing the end of the transmission + Serial_TransmissionEnd(); } uint8_t SerialHAL_GetPort(void) diff --git a/network/serial_network/HAL/NATIVE/serial_network_hal.c b/network/serial_network/HAL/NATIVE/serial_network_hal.c index cbdff8e63..821b55e56 100644 --- a/network/serial_network/HAL/NATIVE/serial_network_hal.c +++ b/network/serial_network/HAL/NATIVE/serial_network_hal.c @@ -280,6 +280,7 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) LUOS_ASSERT(0); } #endif + sleep(2); } /****************************************************************************** From c4c709481a9c2b3bba884a6bb3603498aeb1947d Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 18 Jul 2023 14:22:44 +0200 Subject: [PATCH 108/150] Improve Luos configuration parameters --- engine/IO/src/filter.c | 12 ++--- engine/core/inc/service.h | 10 ++-- engine/core/inc/struct_luos.h | 2 +- engine/core/src/luos_engine.c | 6 +-- engine/core/src/profile_core.c | 4 +- engine/core/src/pub_sub.c | 8 +-- engine/core/src/routing_table.c | 6 +-- engine/core/src/service.c | 8 +-- engine/engine_config.h | 46 ++++++++-------- .../Arduino/bldc_simple_foc/node_config.h | 9 ++-- .../projects/Arduino/button/node_config.h | 9 ++-- .../Arduino/fingerprint/node_config.h | 9 ++-- .../Arduino/gate_serialcom/node_config.h | 17 +++--- .../Arduino/inspector_serialcom/node_config.h | 13 ++--- examples/projects/Arduino/lcd/node_config.h | 9 ++-- examples/projects/Arduino/led/node_config.h | 9 ++-- .../Arduino/servo_motor/node_config.h | 9 ++-- .../Arduino/stepper_simple_foc/node_config.h | 9 ++-- examples/projects/ESP32/button/node_config.h | 7 +-- .../ESP32/button_arduino/node_config.h | 7 +-- .../ESP32/gate_serialcom/node_config.h | 8 +-- .../gate_serialcom_arduino/node_config.h | 8 +-- .../projects/ESP32/gate_wscom/node_config.h | 8 +-- .../ESP32/gate_wscom_arduino/node_config.h | 10 ++-- examples/projects/ESP32/led/node_config.h | 7 +-- .../NUCLEO-F072RB/barometer/node_config.h | 4 +- .../NUCLEO-F072RB/bootloader/node_config.h | 7 +-- .../NUCLEO-F072RB/button/node_config.h | 11 ++-- .../NUCLEO-F072RB/dc_motor/node_config.h | 9 ++-- .../gate_serialcom/node_config.h | 10 ++-- .../inspector_serialcom/node_config.h | 9 ++-- .../NUCLEO-F072RB/potentiometer/node_config.h | 9 ++-- .../NUCLEO-F401RE/bootloader/node_config.h | 7 +-- .../NUCLEO-F401RE/button/node_config.h | 9 ++-- .../NUCLEO-F401RE/dc_motor/node_config.h | 9 ++-- .../gate_serialcom/node_config.h | 13 ++--- .../inspector_serialcom/node_config.h | 13 ++--- .../projects/NUCLEO-F401RE/led/node_config.h | 9 ++-- .../NUCLEO-F401RE/potentiometer/node_config.h | 9 ++-- .../NUCLEO-F410RB/bootloader/node_config.h | 9 ++-- .../NUCLEO-F410RB/button/node_config.h | 9 ++-- .../NUCLEO-F410RB/dc_motor/node_config.h | 9 ++-- .../gate_serialcom/node_config.h | 13 ++--- .../inspector_serialcom/node_config.h | 13 ++--- .../projects/NUCLEO-F410RB/led/node_config.h | 9 ++-- .../NUCLEO-F410RB/potentiometer/node_config.h | 9 ++-- .../NUCLEO-G431KB/bootloader/node_config.h | 7 +-- .../NUCLEO-G431KB/button/node_config.h | 9 ++-- .../NUCLEO-G431KB/dc_motor/node_config.h | 9 ++-- .../gate_serialcom/node_config.h | 13 ++--- .../inspector_serialcom/node_config.h | 13 ++--- .../NUCLEO-G431KB/potentiometer/node_config.h | 9 ++-- .../NUCLEO-G474RE/bootloader/node_config.h | 7 +-- .../NUCLEO-G474RE/button/node_config.h | 7 +-- .../gate_serialcom/node_config.h | 13 ++--- .../inspector_serialcom/node_config.h | 13 ++--- .../NUCLEO-L073RZ/bootloader/node_config.h | 7 +-- .../NUCLEO-L073RZ/button/node_config.h | 11 ++-- .../gate_serialcom/node_config.h | 13 ++--- .../NUCLEO-L432KC/bootloader/node_config.h | 7 +-- .../NUCLEO-L432KC/button/node_config.h | 9 ++-- .../NUCLEO-L432KC/dc_motor/node_config.h | 9 ++-- .../NUCLEO-L432KC/fingerprint/node_config.h | 9 ++-- .../gate_serialcom/node_config.h | 13 ++--- .../projects/NUCLEO-L432KC/gpio/node_config.h | 9 ++-- .../inspector_serialcom/node_config.h | 13 ++--- .../projects/NUCLEO-L432KC/lcd/node_config.h | 9 ++-- .../projects/NUCLEO-L432KC/led/node_config.h | 9 ++-- .../NUCLEO-L432KC/potentiometer/node_config.h | 9 ++-- .../NUCLEO-L432KC/servo/node_config.h | 9 ++-- .../SAMD21XPLAINED/button/node_config.h | 9 ++-- .../bootloader/node_config.h | 9 ++-- .../STM32F4-discovery/button/node_config.h | 9 ++-- .../gate_serialcom/node_config.h | 13 ++--- .../inspector_serialcom/node_config.h | 13 ++--- .../bootloader/node_config.h | 9 ++-- .../STM32L4S5_discovery/button/node_config.h | 9 ++-- .../gate_serialcom/node_config.h | 13 ++--- .../bike_alarm/alarm_controller/node_config.h | 7 +-- .../bike_alarm/start_controller/node_config.h | 7 +-- examples/projects/l0/bootloader/node_config.h | 9 ++-- examples/projects/l0/button/node_config.h | 11 ++-- .../projects/l0/button_freertos/node_config.h | 13 ++--- .../l0/controller_motor/node_config.h | 11 ++-- examples/projects/l0/dc_motor/node_config.h | 9 ++-- .../l0/demo/detection_button/node_config.h | 7 +-- .../l0/demo/ledstrip_position/node_config.h | 9 ++-- .../l0/demo/motor_copy_app/node_config.h | 11 ++-- .../l0/demo/motor_demo_app/node_config.h | 11 ++-- examples/projects/l0/distance/node_config.h | 9 ++-- examples/projects/l0/dxl/lib/Dxl/dxl.c | 12 ++--- examples/projects/l0/dxl/node_config.h | 11 ++-- .../projects/l0/fingerprint/node_config.h | 9 ++-- .../projects/l0/gate_serialcom/node_config.h | 13 ++--- examples/projects/l0/gpio/node_config.h | 11 ++-- examples/projects/l0/imu/node_config.h | 9 ++-- .../l0/inspector_serialcom/node_config.h | 9 ++-- examples/projects/l0/lcd/node_config.h | 9 ++-- examples/projects/l0/led/node_config.h | 9 ++-- examples/projects/l0/led_fader/node_config.h | 9 ++-- examples/projects/l0/led_strip/node_config.h | 9 ++-- .../projects/l0/light_sensor/node_config.h | 9 ++-- examples/projects/l0/load/node_config.h | 9 ++-- .../projects/l0/potentiometer/node_config.h | 9 ++-- .../projects/l0/power_switch/node_config.h | 11 ++-- examples/projects/l0/servo/node_config.h | 9 ++-- examples/projects/l0/stepper/node_config.h | 11 ++-- examples/projects/native/button/node_config.h | 8 +-- .../projects/native/gate_wscom/node_config.h | 12 ++--- examples/projects/native/led/node_config.h | 8 +-- .../projects/native/ping_pong/node_config.h | 16 +++--- test/_resources/node_config.h | 6 +-- test/tests_core/test_pub_sub/main.c | 30 +++++------ test/tests_io/test_filter/main.c | 54 +++++++++---------- 114 files changed, 639 insertions(+), 546 deletions(-) diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c index 50bafcbee..db34aaf6a 100644 --- a/engine/IO/src/filter.c +++ b/engine/IO/src/filter.c @@ -67,8 +67,8 @@ void Filter_AddServiceId(uint16_t service_id, uint16_t service_number) // Shift byte byte Mask of bit address LUOS_ASSERT((service_id > 0) - && (service_id <= 4096 - MAX_SERVICE_NUMBER) - && (service_number <= MAX_SERVICE_NUMBER)); + && (service_id <= 4096 - MAX_LOCAL_SERVICE_NUMBER) + && (service_number <= MAX_LOCAL_SERVICE_NUMBER)); Filter_IdInit(); uint16_t tempo = 0; filter_ctx.IDShiftMask = (service_id - 1) / 8; // aligned to byte @@ -88,7 +88,7 @@ void Filter_AddServiceId(uint16_t service_id, uint16_t service_number) ******************************************************************************/ void Filter_AddTopic(uint16_t topic_id) { - LUOS_ASSERT(topic_id < LAST_TOPIC); + LUOS_ASSERT(topic_id < MAX_LOCAL_TOPIC_NUMBER); // Add 1 to the bit corresponding to the topic in multicast mask filter_ctx.TopicMask[(topic_id / 8)] |= 1 << (topic_id - ((int)(topic_id / 8)) * 8); } @@ -100,7 +100,7 @@ void Filter_AddTopic(uint16_t topic_id) ******************************************************************************/ void Filter_RmTopic(uint16_t topic_id) { - LUOS_ASSERT(topic_id < LAST_TOPIC); + LUOS_ASSERT(topic_id < MAX_LOCAL_TOPIC_NUMBER); // Remove 1 to the bit corresponding to the topic in multicast mask filter_ctx.TopicMask[(topic_id / 8)] &= ~(1 << (topic_id - ((int)(topic_id / 8)) * 8)); } @@ -116,7 +116,7 @@ _CRITICAL bool Filter_ServiceID(uint16_t service_id) //--------------------------->|__________| // Shift byte byte Mask of bit address // In an node, service ID are consecutive - // MaskID is byte field wich have the size of MAX_SERVICE_NUMBER + // MaskID is byte field wich have the size of MAX_LOCAL_SERVICE_NUMBER // Shift depend od ID of first service in Node (shift = NodeID/8) LUOS_ASSERT(service_id <= 4096); uint16_t compare = 0; @@ -144,7 +144,7 @@ _CRITICAL bool Filter_Topic(uint16_t topic_id) { uint8_t compare = 0; // Make sure there is a topic that can be received by the node - if (topic_id < LAST_TOPIC) + if (topic_id < MAX_LOCAL_TOPIC_NUMBER) { compare = topic_id - ((topic_id / 8) * 8); // Search if topic exists in mask diff --git a/engine/core/inc/service.h b/engine/core/inc/service.h index 423a9aa1a..c390e37a9 100644 --- a/engine/core/inc/service.h +++ b/engine/core/inc/service.h @@ -13,16 +13,16 @@ /******************************************************************************* * Definitions ******************************************************************************/ -#if (MAX_SERVICE_NUMBER <= 8) +#if (MAX_LOCAL_SERVICE_NUMBER <= 8) typedef uint8_t service_filter_t; -#elif (MAX_SERVICE_NUMBER <= 16) +#elif (MAX_LOCAL_SERVICE_NUMBER <= 16) typedef uint16_t service_filter_t; -#elif (MAX_SERVICE_NUMBER <= 32) +#elif (MAX_LOCAL_SERVICE_NUMBER <= 32) typedef uint32_t service_filter_t; -#elif (MAX_SERVICE_NUMBER <= 64) +#elif (MAX_LOCAL_SERVICE_NUMBER <= 64) typedef uint64_t service_filter_t; #else - #error "MAX_SERVICE_NUMBER is too high" + #error "MAX_LOCAL_SERVICE_NUMBER is too high" #endif /******************************************************************************* diff --git a/engine/core/inc/struct_luos.h b/engine/core/inc/struct_luos.h index 76a17eb98..320f91c6c 100644 --- a/engine/core/inc/struct_luos.h +++ b/engine/core/inc/struct_luos.h @@ -212,7 +212,7 @@ typedef struct service_t // Private Variables uint16_t last_topic_position; /*!< Position pointer of the last topic added. */ - uint16_t topic_list[LAST_TOPIC]; /*!< multicast target bank. */ + uint16_t topic_list[MAX_LOCAL_TOPIC_NUMBER]; /*!< multicast target bank. */ timed_update_t auto_refresh; /*!< service auto refresh context. */ void *profile_context; /*!< Pointer to the profile context. */ diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 4e67499f3..70bdc92fc 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -19,7 +19,7 @@ * Variables ******************************************************************************/ const revision_t luos_version = {.major = 3, .minor = 0, .build = 0}; -package_t package_table[MAX_SERVICE_NUMBER]; +package_t package_table[MAX_LOCAL_SERVICE_NUMBER]; uint16_t package_number = 0; /******************************************************************************* @@ -347,8 +347,8 @@ void Luos_SendData(service_t *service, msg_t *msg, void *bin_data, uint16_t size int Luos_ReceiveData(service_t *service, const msg_t *msg, void *bin_data) { // Manage buffer session (one per service) - static uint32_t data_size[MAX_SERVICE_NUMBER] = {0}; - static uint32_t total_data_size[MAX_SERVICE_NUMBER] = {0}; + static uint32_t data_size[MAX_LOCAL_SERVICE_NUMBER] = {0}; + static uint32_t total_data_size[MAX_LOCAL_SERVICE_NUMBER] = {0}; static uint16_t last_msg_size = 0; // When this function receive a data from a NULL service it is an error and we should reinit the reception state diff --git a/engine/core/src/profile_core.c b/engine/core/src/profile_core.c index 4adbd4d51..bc51c465d 100644 --- a/engine/core/src/profile_core.c +++ b/engine/core/src/profile_core.c @@ -8,7 +8,7 @@ #include "profile_core.h" // static initialization of profile table -profile_core_t profile_table[MAX_PROFILE_NUMBER]; +profile_core_t profile_table[MAX_LOCAL_PROFILE_NUMBER]; uint16_t available_index = 0; uint16_t head_profile_index = 0; @@ -39,7 +39,7 @@ profile_core_t *ProfileCore_GetNew(bool profile_mode) head_profile_index = available_index; // update available profile index - LUOS_ASSERT(available_index <= (MAX_PROFILE_NUMBER - 1)); + LUOS_ASSERT(available_index <= (MAX_LOCAL_PROFILE_NUMBER - 1)); available_index += 1; new_profile = &profile_table[available_index - 1]; diff --git a/engine/core/src/pub_sub.c b/engine/core/src/pub_sub.c index ebbe41f1f..d034a2c76 100644 --- a/engine/core/src/pub_sub.c +++ b/engine/core/src/pub_sub.c @@ -30,7 +30,7 @@ ******************************************************************************/ uint8_t PubSub_IsTopicSubscribed(service_t *service, uint16_t topic_id) { - LUOS_ASSERT((topic_id < LAST_TOPIC) + LUOS_ASSERT((topic_id < MAX_LOCAL_TOPIC_NUMBER) && (service != NULL)); unsigned char i; for (i = 0; i < service->last_topic_position; i++) @@ -50,14 +50,14 @@ uint8_t PubSub_IsTopicSubscribed(service_t *service, uint16_t topic_id) error_return_t Luos_Subscribe(service_t *service, uint16_t topic) { // Assert if we add a topic that is greater than the max topic value - LUOS_ASSERT((topic < LAST_TOPIC) + LUOS_ASSERT((topic < MAX_LOCAL_TOPIC_NUMBER) && (service != 0)); // Put this topic in the multicast bank Filter_AddTopic(topic); // Check if target exists or if we reached the maximum topics number - if ((PubSub_IsTopicSubscribed(service, topic) == false) && (service->last_topic_position < LAST_TOPIC)) + if ((PubSub_IsTopicSubscribed(service, topic) == false) && (service->last_topic_position < MAX_LOCAL_TOPIC_NUMBER)) { service->topic_list[service->last_topic_position] = topic; service->last_topic_position++; @@ -74,7 +74,7 @@ error_return_t Luos_Subscribe(service_t *service, uint16_t topic) ******************************************************************************/ error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic) { - LUOS_ASSERT((topic < LAST_TOPIC) + LUOS_ASSERT((topic < MAX_LOCAL_TOPIC_NUMBER) && (service != 0)); error_return_t err = FAILED; diff --git a/engine/core/src/routing_table.c b/engine/core/src/routing_table.c index f07433caf..8b4646623 100644 --- a/engine/core/src/routing_table.c +++ b/engine/core/src/routing_table.c @@ -186,14 +186,14 @@ static void RoutingTB_AddNumToAlias(char *alias, uint8_t num) if (num > 99) // only 2 digit are alowed when add alias number { // This is probably a mistake, put an error into the alias - memset(alias, 0, ALIAS_SIZE); + memset(alias, 0, MAX_ALIAS_SIZE - 1); memcpy(alias, "error", strlen("error")); return; } // Change size to fit into 15 characters - if (strlen(alias) > (ALIAS_SIZE - intsize)) + if (strlen(alias) > (MAX_ALIAS_SIZE - 1 - intsize)) { - alias[(ALIAS_SIZE - intsize)] = '\0'; + alias[(MAX_ALIAS_SIZE - 1 - intsize)] = '\0'; } else { diff --git a/engine/core/src/service.c b/engine/core/src/service.c index 16ec1a777..6496d3d35 100644 --- a/engine/core/src/service.c +++ b/engine/core/src/service.c @@ -18,7 +18,7 @@ ******************************************************************************/ typedef struct { - service_t list[MAX_SERVICE_NUMBER]; + service_t list[MAX_LOCAL_SERVICE_NUMBER]; uint16_t number; } service_ctx_t; @@ -369,7 +369,7 @@ service_t *Luos_CreateService(SERVICE_CB service_cb, uint8_t type, const char *a service->statistics.max_retry = 0; // Clear topic number service->last_topic_position = 0; - for (uint16_t i = 0; i < LAST_TOPIC; i++) + for (uint16_t i = 0; i < MAX_LOCAL_TOPIC_NUMBER; i++) { service->topic_list[i] = 0; } @@ -400,7 +400,7 @@ service_t *Luos_CreateService(SERVICE_CB service_cb, uint8_t type, const char *a } service_ctx.number++; - LUOS_ASSERT(service_ctx.number <= MAX_SERVICE_NUMBER); + LUOS_ASSERT(service_ctx.number <= MAX_LOCAL_SERVICE_NUMBER); return service; } @@ -470,5 +470,5 @@ void Luos_ServicesClear(void) service_ctx.number = 0; // Clear service table - memset((void *)service_ctx.list, 0, sizeof(service_t) * MAX_SERVICE_NUMBER); + memset((void *)service_ctx.list, 0, sizeof(service_t) * MAX_LOCAL_SERVICE_NUMBER); } diff --git a/engine/engine_config.h b/engine/engine_config.h index 2c0b791cb..3127461e9 100644 --- a/engine/engine_config.h +++ b/engine/engine_config.h @@ -10,51 +10,53 @@ /******************************************************************************* * Definitions ******************************************************************************/ -#define LUOS_LAST_RESERVED_CMD 42 // Last Luos reserved command -#define ALIAS_SIZE 15 // Number of max char for service alias -#define MAX_ALIAS_SIZE 16 -#define DETECTION_TIMEOUT_MS 10000 // Timeout used to detect a failed detection -#define BOOT_TIMEOUT 1000 -#define DEFAULTID 0x00 -#define PROTOCOL_REVISION 0 -#define BROADCAST_VAL 0x0FFF +#define LUOS_LAST_RESERVED_CMD 42 // Last Luos reserved command +#define MAX_ALIAS_SIZE 16 // Number of max char for service alias +#define DETECTION_TIMEOUT_MS 10000 // Timeout used to detect a failed detection +#define DEFAULTID 0x00 // The default ID of a Luos service +#define PROTOCOL_REVISION 0 // The Luos protocol revision +#define BROADCAST_VAL 0x0FFF // The broadcast target value +#define MAX_DATA_MSG_SIZE 128 // The maximum size of a data message -#define MAX_DATA_MSG_SIZE 128 +#ifndef MAX_LOCAL_SERVICE_NUMBER + #define MAX_LOCAL_SERVICE_NUMBER 5 // The maximum number of local services +#endif #ifndef MAX_SERVICE_NUMBER - #define MAX_SERVICE_NUMBER 5 + #define MAX_SERVICE_NUMBER 20 // The maximum number of services in the complete architecture #endif #ifndef MAX_NODE_NUMBER - #define MAX_NODE_NUMBER 20 + #define MAX_NODE_NUMBER 20 // The maximum number of nodes in the complete architecture #endif -#ifndef MAX_RTB_ENTRY - #define MAX_RTB_ENTRY 40 +#ifdef MAX_RTB_ENTRY + #error 'MAX_RTB_ENTRY' configuration is deprecated and have been replaced by MAX_NODE_NUMBER and MAX_SERVICE_NUMBER. MAX_RTB_ENTRY is now automatically calculated by the engine based on these values. #endif +#define MAX_RTB_ENTRY (MAX_NODE_NUMBER + MAX_SERVICE_NUMBER) #ifdef MAX_CONTAINER_NUMBER - #error 'MAX_CONTAINER_NUMBER' is deprecated since luos_engine@2.0.0, replace it by 'MAX_SERVICE_NUMBER', see: www.github.com/Luos-io/luos_engine/releases/tag/2.0.0 for more information. + #error 'MAX_CONTAINER_NUMBER' is deprecated since luos_engine@2.0.0, replace it by 'MAX_LOCAL_SERVICE_NUMBER', see: www.github.com/Luos-io/luos_engine/releases/tag/2.0.0 for more information. #endif -#ifndef MAX_PROFILE_NUMBER - #define MAX_PROFILE_NUMBER MAX_SERVICE_NUMBER +#ifndef MAX_LOCAL_PROFILE_NUMBER + #define MAX_LOCAL_PROFILE_NUMBER MAX_LOCAL_SERVICE_NUMBER // The maximum number of profile in the node #endif #ifndef MSG_BUFFER_SIZE - #define MSG_BUFFER_SIZE 3 * sizeof(msg_t) + #define MSG_BUFFER_SIZE 3 * sizeof(msg_t) // The size of the message buffer #endif #ifndef MAX_MSG_NB - #define MAX_MSG_NB 2 * MAX_SERVICE_NUMBER + #define MAX_MSG_NB 2 * MAX_LOCAL_SERVICE_NUMBER // The maximum number of message referenced by Luos #endif -#ifndef LAST_TOPIC - #define LAST_TOPIC 20 +#ifndef MAX_LOCAL_TOPIC_NUMBER + #define MAX_LOCAL_TOPIC_NUMBER 20 // The maximum number of topic in the node #endif // Tab of byte. + 2 for overlap ID because aligned to byte -#define ID_MASK_SIZE ((MAX_SERVICE_NUMBER / 8) + 2) -#define TOPIC_MASK_SIZE ((LAST_TOPIC / 8) + 2) +#define ID_MASK_SIZE ((MAX_LOCAL_SERVICE_NUMBER / 8) + 2) +#define TOPIC_MASK_SIZE ((MAX_LOCAL_TOPIC_NUMBER / 8) + 2) #endif /* _ENGINE_CONFIG_H_ */ diff --git a/examples/projects/Arduino/bldc_simple_foc/node_config.h b/examples/projects/Arduino/bldc_simple_foc/node_config.h index 6e43f2e33..42aebae5b 100644 --- a/examples/projects/Arduino/bldc_simple_foc/node_config.h +++ b/examples/projects/Arduino/bldc_simple_foc/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MAX_MSG_NB 5 #define ARDUINO_PTPA_PIN 19 diff --git a/examples/projects/Arduino/button/node_config.h b/examples/projects/Arduino/button/node_config.h index 056ce9509..82621f87b 100644 --- a/examples/projects/Arduino/button/node_config.h +++ b/examples/projects/Arduino/button/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/Arduino/fingerprint/node_config.h b/examples/projects/Arduino/fingerprint/node_config.h index 056ce9509..82621f87b 100644 --- a/examples/projects/Arduino/fingerprint/node_config.h +++ b/examples/projects/Arduino/fingerprint/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/Arduino/gate_serialcom/node_config.h b/examples/projects/Arduino/gate_serialcom/node_config.h index b2fd0f8f2..afef8d159 100644 --- a/examples/projects/Arduino/gate_serialcom/node_config.h +++ b/examples/projects/Arduino/gate_serialcom/node_config.h @@ -37,18 +37,19 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 1024 -#define MAX_MSG_NB 30 +#define MAX_LOCAL_SERVICE_NUMBER 2 +#define MSG_BUFFER_SIZE 1024 +#define MAX_MSG_NB 30 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -93,13 +94,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/Arduino/inspector_serialcom/node_config.h b/examples/projects/Arduino/inspector_serialcom/node_config.h index 8f21d5357..0eba5c73a 100644 --- a/examples/projects/Arduino/inspector_serialcom/node_config.h +++ b/examples/projects/Arduino/inspector_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 1024 #define MAX_MSG_NB 30 //#define NODETECTION @@ -94,13 +95,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/Arduino/lcd/node_config.h b/examples/projects/Arduino/lcd/node_config.h index 056ce9509..82621f87b 100644 --- a/examples/projects/Arduino/lcd/node_config.h +++ b/examples/projects/Arduino/lcd/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/Arduino/led/node_config.h b/examples/projects/Arduino/led/node_config.h index 056ce9509..82621f87b 100644 --- a/examples/projects/Arduino/led/node_config.h +++ b/examples/projects/Arduino/led/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/Arduino/servo_motor/node_config.h b/examples/projects/Arduino/servo_motor/node_config.h index 056ce9509..82621f87b 100644 --- a/examples/projects/Arduino/servo_motor/node_config.h +++ b/examples/projects/Arduino/servo_motor/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/Arduino/stepper_simple_foc/node_config.h b/examples/projects/Arduino/stepper_simple_foc/node_config.h index 3bbad9405..a8cc0fee0 100644 --- a/examples/projects/Arduino/stepper_simple_foc/node_config.h +++ b/examples/projects/Arduino/stepper_simple_foc/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MAX_MSG_NB 5 #define ARDUINO_PTPA_PIN 19 diff --git a/examples/projects/ESP32/button/node_config.h b/examples/projects/ESP32/button/node_config.h index c943cc773..0cc8afa85 100644 --- a/examples/projects/ESP32/button/node_config.h +++ b/examples/projects/ESP32/button/node_config.h @@ -37,10 +37,10 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ @@ -98,7 +98,8 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size diff --git a/examples/projects/ESP32/button_arduino/node_config.h b/examples/projects/ESP32/button_arduino/node_config.h index c943cc773..0cc8afa85 100644 --- a/examples/projects/ESP32/button_arduino/node_config.h +++ b/examples/projects/ESP32/button_arduino/node_config.h @@ -37,10 +37,10 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ @@ -98,7 +98,8 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size diff --git a/examples/projects/ESP32/gate_serialcom/node_config.h b/examples/projects/ESP32/gate_serialcom/node_config.h index dd56027d0..ca1360ea5 100644 --- a/examples/projects/ESP32/gate_serialcom/node_config.h +++ b/examples/projects/ESP32/gate_serialcom/node_config.h @@ -37,10 +37,10 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ @@ -99,13 +99,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size * INIT_TIME | 150 | Wait init time before first detection ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 2048 #define PIPE_RX_BUFFER_SIZE 2048 #define PIPE_TX_BUFFER_SIZE 4096 diff --git a/examples/projects/ESP32/gate_serialcom_arduino/node_config.h b/examples/projects/ESP32/gate_serialcom_arduino/node_config.h index c0fb39334..4bddb2297 100644 --- a/examples/projects/ESP32/gate_serialcom_arduino/node_config.h +++ b/examples/projects/ESP32/gate_serialcom_arduino/node_config.h @@ -37,10 +37,10 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ @@ -99,13 +99,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size * INIT_TIME | 150 | Wait init time before first detection ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 2048 #define PIPE_RX_BUFFER_SIZE 2048 #define PIPE_TX_BUFFER_SIZE 4096 diff --git a/examples/projects/ESP32/gate_wscom/node_config.h b/examples/projects/ESP32/gate_wscom/node_config.h index 438723a60..66d17c0eb 100644 --- a/examples/projects/ESP32/gate_wscom/node_config.h +++ b/examples/projects/ESP32/gate_wscom/node_config.h @@ -37,10 +37,10 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ @@ -98,13 +98,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size * INIT_TIME | 150 | Wait init time before first detection ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 2048 diff --git a/examples/projects/ESP32/gate_wscom_arduino/node_config.h b/examples/projects/ESP32/gate_wscom_arduino/node_config.h index c86f144f4..b17b8b8ed 100644 --- a/examples/projects/ESP32/gate_wscom_arduino/node_config.h +++ b/examples/projects/ESP32/gate_wscom_arduino/node_config.h @@ -37,15 +37,15 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MAX_MSG_NB 20 #define MSG_BUFFER_SIZE 1024 #define DEFAULTBAUDRATE 500000 @@ -100,13 +100,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size * INIT_TIME | 150 | Wait init time before first detection ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 2048 #define PIPE_RX_BUFFER_SIZE 2048 #define PIPE_TX_BUFFER_SIZE 4096 diff --git a/examples/projects/ESP32/led/node_config.h b/examples/projects/ESP32/led/node_config.h index c943cc773..0cc8afa85 100644 --- a/examples/projects/ESP32/led/node_config.h +++ b/examples/projects/ESP32/led/node_config.h @@ -37,10 +37,10 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ @@ -98,7 +98,8 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size diff --git a/examples/projects/NUCLEO-F072RB/barometer/node_config.h b/examples/projects/NUCLEO-F072RB/barometer/node_config.h index 2fc863673..3afe576e5 100644 --- a/examples/projects/NUCLEO-F072RB/barometer/node_config.h +++ b/examples/projects/NUCLEO-F072RB/barometer/node_config.h @@ -37,10 +37,10 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F072RB/bootloader/node_config.h b/examples/projects/NUCLEO-F072RB/bootloader/node_config.h index 0d73ae7aa..d2b89921b 100644 --- a/examples/projects/NUCLEO-F072RB/bootloader/node_config.h +++ b/examples/projects/NUCLEO-F072RB/bootloader/node_config.h @@ -37,11 +37,12 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F072RB/button/node_config.h b/examples/projects/NUCLEO-F072RB/button/node_config.h index a191b492d..65e537ff3 100644 --- a/examples/projects/NUCLEO-F072RB/button/node_config.h +++ b/examples/projects/NUCLEO-F072RB/button/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 -#define MAX_PROFILE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 +#define MAX_LOCAL_PROFILE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h b/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h index e005456e0..cdb64ba3e 100644 --- a/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MAX_MSG_NB 5 #define MSG_BUFFER_SIZE 512 diff --git a/examples/projects/NUCLEO-F072RB/gate_serialcom/node_config.h b/examples/projects/NUCLEO-F072RB/gate_serialcom/node_config.h index f6e95bcd2..fe9254f27 100644 --- a/examples/projects/NUCLEO-F072RB/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F072RB/gate_serialcom/node_config.h @@ -37,15 +37,15 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 @@ -99,13 +99,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h index 9d0e413fa..6fd9a9666 100644 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 #define NODETECTION diff --git a/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h b/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h index 0e964aac5..45b5aa221 100644 --- a/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-F401RE/bootloader/node_config.h b/examples/projects/NUCLEO-F401RE/bootloader/node_config.h index 230da0845..247bb6179 100644 --- a/examples/projects/NUCLEO-F401RE/bootloader/node_config.h +++ b/examples/projects/NUCLEO-F401RE/bootloader/node_config.h @@ -37,11 +37,12 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F401RE/button/node_config.h b/examples/projects/NUCLEO-F401RE/button/node_config.h index 2f61b7924..0642f73db 100644 --- a/examples/projects/NUCLEO-F401RE/button/node_config.h +++ b/examples/projects/NUCLEO-F401RE/button/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h b/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h index 997e5d960..992ebdf6d 100644 --- a/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MAX_MSG_NB 5 #define MSG_BUFFER_SIZE 512 diff --git a/examples/projects/NUCLEO-F401RE/gate_serialcom/node_config.h b/examples/projects/NUCLEO-F401RE/gate_serialcom/node_config.h index 30971136d..e4313a688 100644 --- a/examples/projects/NUCLEO-F401RE/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F401RE/gate_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 @@ -129,13 +130,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h index c155b6677..b6f574d4f 100644 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 @@ -128,13 +129,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/NUCLEO-F401RE/led/node_config.h b/examples/projects/NUCLEO-F401RE/led/node_config.h index 2f61b7924..0642f73db 100644 --- a/examples/projects/NUCLEO-F401RE/led/node_config.h +++ b/examples/projects/NUCLEO-F401RE/led/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h b/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h index b8b47bc7f..acb38ebe4 100644 --- a/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-F410RB/bootloader/node_config.h b/examples/projects/NUCLEO-F410RB/bootloader/node_config.h index d764c20cf..82f8b41bf 100644 --- a/examples/projects/NUCLEO-F410RB/bootloader/node_config.h +++ b/examples/projects/NUCLEO-F410RB/bootloader/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 10 #define MAX_BUFFER_SIZE 512 diff --git a/examples/projects/NUCLEO-F410RB/button/node_config.h b/examples/projects/NUCLEO-F410RB/button/node_config.h index 9d5ee10ae..ee5ae8c4f 100644 --- a/examples/projects/NUCLEO-F410RB/button/node_config.h +++ b/examples/projects/NUCLEO-F410RB/button/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h b/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h index 997e5d960..992ebdf6d 100644 --- a/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MAX_MSG_NB 5 #define MSG_BUFFER_SIZE 512 diff --git a/examples/projects/NUCLEO-F410RB/gate_serialcom/node_config.h b/examples/projects/NUCLEO-F410RB/gate_serialcom/node_config.h index 70a84c3d8..319e114f4 100644 --- a/examples/projects/NUCLEO-F410RB/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F410RB/gate_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 @@ -128,13 +129,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h index 560662e5b..52b6a3e4e 100644 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 #define NODETECTION @@ -129,13 +130,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/NUCLEO-F410RB/led/node_config.h b/examples/projects/NUCLEO-F410RB/led/node_config.h index 00cc3c093..ed05a94eb 100644 --- a/examples/projects/NUCLEO-F410RB/led/node_config.h +++ b/examples/projects/NUCLEO-F410RB/led/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h b/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h index b8b47bc7f..acb38ebe4 100644 --- a/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-G431KB/bootloader/node_config.h b/examples/projects/NUCLEO-G431KB/bootloader/node_config.h index 28fbda3ff..9f5087f4b 100644 --- a/examples/projects/NUCLEO-G431KB/bootloader/node_config.h +++ b/examples/projects/NUCLEO-G431KB/bootloader/node_config.h @@ -37,11 +37,12 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ diff --git a/examples/projects/NUCLEO-G431KB/button/node_config.h b/examples/projects/NUCLEO-G431KB/button/node_config.h index 53251109f..e5b8fbb94 100644 --- a/examples/projects/NUCLEO-G431KB/button/node_config.h +++ b/examples/projects/NUCLEO-G431KB/button/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h b/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h index 1900fb99e..66a880967 100644 --- a/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-G431KB/gate_serialcom/node_config.h b/examples/projects/NUCLEO-G431KB/gate_serialcom/node_config.h index 83173ee64..c3b26eaab 100644 --- a/examples/projects/NUCLEO-G431KB/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-G431KB/gate_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 @@ -100,13 +101,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h index 50c7c3240..67894ac88 100644 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 #define NODETECTION @@ -101,13 +102,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h b/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h index 1900fb99e..66a880967 100644 --- a/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-G474RE/bootloader/node_config.h b/examples/projects/NUCLEO-G474RE/bootloader/node_config.h index 28fbda3ff..9f5087f4b 100644 --- a/examples/projects/NUCLEO-G474RE/bootloader/node_config.h +++ b/examples/projects/NUCLEO-G474RE/bootloader/node_config.h @@ -37,11 +37,12 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ diff --git a/examples/projects/NUCLEO-G474RE/button/node_config.h b/examples/projects/NUCLEO-G474RE/button/node_config.h index 0603cb86e..7492a3cdc 100644 --- a/examples/projects/NUCLEO-G474RE/button/node_config.h +++ b/examples/projects/NUCLEO-G474RE/button/node_config.h @@ -37,11 +37,12 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ diff --git a/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h b/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h index 83173ee64..c3b26eaab 100644 --- a/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 @@ -100,13 +101,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h index 50c7c3240..67894ac88 100644 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 #define NODETECTION @@ -101,13 +102,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h b/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h index 0e7056282..c78e5d531 100644 --- a/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h @@ -38,11 +38,12 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * DEFAULTBAUDRATE | 1000000 | Robus Network Baudrate b/s - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ diff --git a/examples/projects/NUCLEO-L073RZ/button/node_config.h b/examples/projects/NUCLEO-L073RZ/button/node_config.h index 2c230b3e1..34b869ac6 100644 --- a/examples/projects/NUCLEO-L073RZ/button/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/button/node_config.h @@ -38,17 +38,18 @@ * Define | Default Value | Description * :---------------------|------------------------------------------------------ * DEFAULTBAUDRATE | 1000000 | Robus Network Baudrate b/s - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define DEFAULTBAUDRATE 500000 -#define MAX_SERVICE_NUMBER 1 -#define MAX_PROFILE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 +#define MAX_LOCAL_PROFILE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h b/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h index 96b0111e3..379489262 100644 --- a/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define DEFAULTBAUDRATE 500000 -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 @@ -108,13 +109,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_RX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_TX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 2048 diff --git a/examples/projects/NUCLEO-L432KC/bootloader/node_config.h b/examples/projects/NUCLEO-L432KC/bootloader/node_config.h index bbf53e225..dc3397a15 100644 --- a/examples/projects/NUCLEO-L432KC/bootloader/node_config.h +++ b/examples/projects/NUCLEO-L432KC/bootloader/node_config.h @@ -37,11 +37,12 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ diff --git a/examples/projects/NUCLEO-L432KC/button/node_config.h b/examples/projects/NUCLEO-L432KC/button/node_config.h index 53251109f..e5b8fbb94 100644 --- a/examples/projects/NUCLEO-L432KC/button/node_config.h +++ b/examples/projects/NUCLEO-L432KC/button/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h b/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h index 53251109f..e5b8fbb94 100644 --- a/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h b/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h index 53251109f..e5b8fbb94 100644 --- a/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h +++ b/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h b/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h index 83173ee64..c3b26eaab 100644 --- a/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 @@ -100,13 +101,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/NUCLEO-L432KC/gpio/node_config.h b/examples/projects/NUCLEO-L432KC/gpio/node_config.h index 22f3dad59..9591f5bfc 100644 --- a/examples/projects/NUCLEO-L432KC/gpio/node_config.h +++ b/examples/projects/NUCLEO-L432KC/gpio/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 10 +#define MAX_LOCAL_SERVICE_NUMBER 10 #define MSG_BUFFER_SIZE 512 #define MAX_MSG_NB 30 diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h index 50c7c3240..67894ac88 100644 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 #define NODETECTION @@ -101,13 +102,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/NUCLEO-L432KC/lcd/node_config.h b/examples/projects/NUCLEO-L432KC/lcd/node_config.h index 53251109f..e5b8fbb94 100644 --- a/examples/projects/NUCLEO-L432KC/lcd/node_config.h +++ b/examples/projects/NUCLEO-L432KC/lcd/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/led/node_config.h b/examples/projects/NUCLEO-L432KC/led/node_config.h index 53251109f..e5b8fbb94 100644 --- a/examples/projects/NUCLEO-L432KC/led/node_config.h +++ b/examples/projects/NUCLEO-L432KC/led/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h b/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h index 53251109f..e5b8fbb94 100644 --- a/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/servo/node_config.h b/examples/projects/NUCLEO-L432KC/servo/node_config.h index 53251109f..e5b8fbb94 100644 --- a/examples/projects/NUCLEO-L432KC/servo/node_config.h +++ b/examples/projects/NUCLEO-L432KC/servo/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/SAMD21XPLAINED/button/node_config.h b/examples/projects/SAMD21XPLAINED/button/node_config.h index 056ce9509..82621f87b 100644 --- a/examples/projects/SAMD21XPLAINED/button/node_config.h +++ b/examples/projects/SAMD21XPLAINED/button/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/STM32F4-discovery/bootloader/node_config.h b/examples/projects/STM32F4-discovery/bootloader/node_config.h index f6a8050cf..8a12a52ed 100644 --- a/examples/projects/STM32F4-discovery/bootloader/node_config.h +++ b/examples/projects/STM32F4-discovery/bootloader/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 10 #define MAX_BUFFER_SIZE 1024 diff --git a/examples/projects/STM32F4-discovery/button/node_config.h b/examples/projects/STM32F4-discovery/button/node_config.h index 20edd3990..75ec245b5 100644 --- a/examples/projects/STM32F4-discovery/button/node_config.h +++ b/examples/projects/STM32F4-discovery/button/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/STM32F4-discovery/gate_serialcom/node_config.h b/examples/projects/STM32F4-discovery/gate_serialcom/node_config.h index b33ba6c90..ed5848b56 100644 --- a/examples/projects/STM32F4-discovery/gate_serialcom/node_config.h +++ b/examples/projects/STM32F4-discovery/gate_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 @@ -103,13 +104,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h b/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h index d4ccaa925..74d43887f 100644 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h +++ b/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 #define NODETECTION @@ -104,13 +105,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/STM32L4S5_discovery/bootloader/node_config.h b/examples/projects/STM32L4S5_discovery/bootloader/node_config.h index 2d7560a79..3994ace3a 100644 --- a/examples/projects/STM32L4S5_discovery/bootloader/node_config.h +++ b/examples/projects/STM32L4S5_discovery/bootloader/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/STM32L4S5_discovery/button/node_config.h b/examples/projects/STM32L4S5_discovery/button/node_config.h index aa20ab42f..d0e9dd6c6 100644 --- a/examples/projects/STM32L4S5_discovery/button/node_config.h +++ b/examples/projects/STM32L4S5_discovery/button/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h b/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h index bc9e029c7..3ed90f79d 100644 --- a/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h +++ b/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 @@ -171,13 +172,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_RX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_TX_BUFFER_SIZE | 2048 | Transmit pipe buffer size ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 2048 diff --git a/examples/projects/l0/bike_alarm/alarm_controller/node_config.h b/examples/projects/l0/bike_alarm/alarm_controller/node_config.h index 596ffe4c5..62806095a 100644 --- a/examples/projects/l0/bike_alarm/alarm_controller/node_config.h +++ b/examples/projects/l0/bike_alarm/alarm_controller/node_config.h @@ -37,11 +37,12 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ diff --git a/examples/projects/l0/bike_alarm/start_controller/node_config.h b/examples/projects/l0/bike_alarm/start_controller/node_config.h index d0bdfb1bb..40e8116a8 100644 --- a/examples/projects/l0/bike_alarm/start_controller/node_config.h +++ b/examples/projects/l0/bike_alarm/start_controller/node_config.h @@ -37,11 +37,12 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ diff --git a/examples/projects/l0/bootloader/node_config.h b/examples/projects/l0/bootloader/node_config.h index 5c42741a9..93e49a820 100644 --- a/examples/projects/l0/bootloader/node_config.h +++ b/examples/projects/l0/bootloader/node_config.h @@ -37,18 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node - * MAX_NODE_NUMBER. | 20 | Node number in the device + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 20 -#define MAX_RTB_ENTRY 80 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/button/node_config.h b/examples/projects/l0/button/node_config.h index a191b492d..65e537ff3 100644 --- a/examples/projects/l0/button/node_config.h +++ b/examples/projects/l0/button/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 -#define MAX_PROFILE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 +#define MAX_LOCAL_PROFILE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/l0/button_freertos/node_config.h b/examples/projects/l0/button_freertos/node_config.h index a191b492d..327eaf5e6 100644 --- a/examples/projects/l0/button_freertos/node_config.h +++ b/examples/projects/l0/button_freertos/node_config.h @@ -37,17 +37,18 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 -#define MAX_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_LOCAL_SERVICE_NUMBER 1 +#define MAX_LOCAL_PROFILE_NUMBER 1 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/controller_motor/node_config.h b/examples/projects/l0/controller_motor/node_config.h index bd2f26522..b960b0213 100644 --- a/examples/projects/l0/controller_motor/node_config.h +++ b/examples/projects/l0/controller_motor/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 -#define MAX_PROFILE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 1 +#define MAX_LOCAL_PROFILE_NUMBER 2 #define MAX_MSG_NB 30 #define MSG_BUFFER_SIZE 1024 diff --git a/examples/projects/l0/dc_motor/node_config.h b/examples/projects/l0/dc_motor/node_config.h index e005456e0..cdb64ba3e 100644 --- a/examples/projects/l0/dc_motor/node_config.h +++ b/examples/projects/l0/dc_motor/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MAX_MSG_NB 5 #define MSG_BUFFER_SIZE 512 diff --git a/examples/projects/l0/demo/detection_button/node_config.h b/examples/projects/l0/demo/detection_button/node_config.h index 2822eb9c3..bf59ddef9 100644 --- a/examples/projects/l0/demo/detection_button/node_config.h +++ b/examples/projects/l0/demo/detection_button/node_config.h @@ -37,11 +37,12 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ diff --git a/examples/projects/l0/demo/ledstrip_position/node_config.h b/examples/projects/l0/demo/ledstrip_position/node_config.h index ac78e0ec8..28ff8ae4a 100644 --- a/examples/projects/l0/demo/ledstrip_position/node_config.h +++ b/examples/projects/l0/demo/ledstrip_position/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MAX_MSG_NB 30 #define MAX_BUFFER_SIZE 1024 diff --git a/examples/projects/l0/demo/motor_copy_app/node_config.h b/examples/projects/l0/demo/motor_copy_app/node_config.h index df7ef7d8c..40fe8ad1a 100644 --- a/examples/projects/l0/demo/motor_copy_app/node_config.h +++ b/examples/projects/l0/demo/motor_copy_app/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 5 -#define MAX_PROFILE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 5 +#define MAX_LOCAL_PROFILE_NUMBER 2 #define MAX_MSG_NB 30 #define MSG_BUFFER_SIZE 1024 diff --git a/examples/projects/l0/demo/motor_demo_app/node_config.h b/examples/projects/l0/demo/motor_demo_app/node_config.h index df7ef7d8c..40fe8ad1a 100644 --- a/examples/projects/l0/demo/motor_demo_app/node_config.h +++ b/examples/projects/l0/demo/motor_demo_app/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 5 -#define MAX_PROFILE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 5 +#define MAX_LOCAL_PROFILE_NUMBER 2 #define MAX_MSG_NB 30 #define MSG_BUFFER_SIZE 1024 diff --git a/examples/projects/l0/distance/node_config.h b/examples/projects/l0/distance/node_config.h index 0e964aac5..45b5aa221 100644 --- a/examples/projects/l0/distance/node_config.h +++ b/examples/projects/l0/distance/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/l0/dxl/lib/Dxl/dxl.c b/examples/projects/l0/dxl/lib/Dxl/dxl.c index 3c4741a70..543c472ae 100644 --- a/examples/projects/l0/dxl/lib/Dxl/dxl.c +++ b/examples/projects/l0/dxl/lib/Dxl/dxl.c @@ -28,7 +28,7 @@ typedef struct unsigned char id; } dxl_t; -dxl_t dxl[MAX_SERVICE_NUMBER]; +dxl_t dxl[MAX_LOCAL_SERVICE_NUMBER]; volatile float trajectory_buf[BUFFER_SIZE]; volatile float measurement_buf[BUFFER_SIZE]; @@ -60,8 +60,8 @@ void Dxl_Init(void) void Dxl_Loop(void) { static int index = 0; - static uint32_t last_temp[MAX_SERVICE_NUMBER] = {0}; - static uint32_t last_sample[MAX_SERVICE_NUMBER] = {0}; + static uint32_t last_temp[MAX_LOCAL_SERVICE_NUMBER] = {0}; + static uint32_t last_sample[MAX_LOCAL_SERVICE_NUMBER] = {0}; // check motor values one by one // Get motor info if (dxl[index].id == 0) @@ -411,8 +411,8 @@ static void discover_dxl(void) // Clear service table Luos_ServicesClear(); // Clear local tables - memset((void *)dxl, 0, sizeof(dxl_t) * MAX_SERVICE_NUMBER); - for (dxl_id = 0; dxl_id < MAX_SERVICE_NUMBER; dxl_id++) + memset((void *)dxl, 0, sizeof(dxl_t) * MAX_LOCAL_SERVICE_NUMBER); + for (dxl_id = 0; dxl_id < MAX_LOCAL_SERVICE_NUMBER; dxl_id++) { memset(&dxl[dxl_id].dxl_motor, 0, sizeof(profile_servo_motor_t)); } @@ -493,7 +493,7 @@ static int find_id(service_t *service) { profile_core_t *profile = (profile_core_t *)service->profile_context; int i = 0; - for (i = 0; i <= MAX_SERVICE_NUMBER; i++) + for (i = 0; i <= MAX_LOCAL_SERVICE_NUMBER; i++) { if ((uint32_t)profile->profile_data == (uint32_t)&dxl[i].dxl_motor) return i; diff --git a/examples/projects/l0/dxl/node_config.h b/examples/projects/l0/dxl/node_config.h index e7c266871..826cf8105 100644 --- a/examples/projects/l0/dxl/node_config.h +++ b/examples/projects/l0/dxl/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 10 -#define MAX_PROFILE_NUMBER 20 +#define MAX_LOCAL_SERVICE_NUMBER 10 +#define MAX_LOCAL_PROFILE_NUMBER 20 #define MAX_MSG_NB 30 #define MSG_BUFFER_SIZE 512 diff --git a/examples/projects/l0/fingerprint/node_config.h b/examples/projects/l0/fingerprint/node_config.h index 0e964aac5..45b5aa221 100644 --- a/examples/projects/l0/fingerprint/node_config.h +++ b/examples/projects/l0/fingerprint/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/l0/gate_serialcom/node_config.h b/examples/projects/l0/gate_serialcom/node_config.h index ab8acc44f..aad78e990 100644 --- a/examples/projects/l0/gate_serialcom/node_config.h +++ b/examples/projects/l0/gate_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 1024 #define MAX_MSG_NB 40 /******************************************************************************* @@ -99,13 +100,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size * INIT_TIME | 150 | Wait init time before first detection ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 1024 #define PIPE_TX_BUFFER_SIZE 1024 #define PIPE_RX_BUFFER_SIZE 2048 diff --git a/examples/projects/l0/gpio/node_config.h b/examples/projects/l0/gpio/node_config.h index c4c0396e1..7fe7991c3 100644 --- a/examples/projects/l0/gpio/node_config.h +++ b/examples/projects/l0/gpio/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 9 -#define MAX_PROFILE_NUMBER 9 +#define MAX_LOCAL_SERVICE_NUMBER 9 +#define MAX_LOCAL_PROFILE_NUMBER 9 #define MSG_BUFFER_SIZE 512 /******************************************************************************* diff --git a/examples/projects/l0/imu/node_config.h b/examples/projects/l0/imu/node_config.h index c042ad0c3..202c62497 100644 --- a/examples/projects/l0/imu/node_config.h +++ b/examples/projects/l0/imu/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 10 #define MSG_BUFFER_SIZE 1024 diff --git a/examples/projects/l0/inspector_serialcom/node_config.h b/examples/projects/l0/inspector_serialcom/node_config.h index 9d0e413fa..6fd9a9666 100644 --- a/examples/projects/l0/inspector_serialcom/node_config.h +++ b/examples/projects/l0/inspector_serialcom/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 +#define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 #define NODETECTION diff --git a/examples/projects/l0/lcd/node_config.h b/examples/projects/l0/lcd/node_config.h index 0e964aac5..45b5aa221 100644 --- a/examples/projects/l0/lcd/node_config.h +++ b/examples/projects/l0/lcd/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/l0/led/node_config.h b/examples/projects/l0/led/node_config.h index 0e964aac5..45b5aa221 100644 --- a/examples/projects/l0/led/node_config.h +++ b/examples/projects/l0/led/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/l0/led_fader/node_config.h b/examples/projects/l0/led_fader/node_config.h index 0e964aac5..45b5aa221 100644 --- a/examples/projects/l0/led_fader/node_config.h +++ b/examples/projects/l0/led_fader/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/l0/led_strip/node_config.h b/examples/projects/l0/led_strip/node_config.h index 06230d3e5..4c7d98934 100644 --- a/examples/projects/l0/led_strip/node_config.h +++ b/examples/projects/l0/led_strip/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 30 #define MAX_BUFFER_SIZE 1024 diff --git a/examples/projects/l0/light_sensor/node_config.h b/examples/projects/l0/light_sensor/node_config.h index 0e964aac5..45b5aa221 100644 --- a/examples/projects/l0/light_sensor/node_config.h +++ b/examples/projects/l0/light_sensor/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/l0/load/node_config.h b/examples/projects/l0/load/node_config.h index 0e964aac5..45b5aa221 100644 --- a/examples/projects/l0/load/node_config.h +++ b/examples/projects/l0/load/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/l0/potentiometer/node_config.h b/examples/projects/l0/potentiometer/node_config.h index 0e964aac5..45b5aa221 100644 --- a/examples/projects/l0/potentiometer/node_config.h +++ b/examples/projects/l0/potentiometer/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/l0/power_switch/node_config.h b/examples/projects/l0/power_switch/node_config.h index a191b492d..65e537ff3 100644 --- a/examples/projects/l0/power_switch/node_config.h +++ b/examples/projects/l0/power_switch/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 -#define MAX_PROFILE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 +#define MAX_LOCAL_PROFILE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/l0/servo/node_config.h b/examples/projects/l0/servo/node_config.h index 7a554101a..24a31ae48 100644 --- a/examples/projects/l0/servo/node_config.h +++ b/examples/projects/l0/servo/node_config.h @@ -37,15 +37,16 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 4 +#define MAX_LOCAL_SERVICE_NUMBER 4 #define MAX_MSG_NB 10 #define MSG_BUFFER_SIZE 512 diff --git a/examples/projects/l0/stepper/node_config.h b/examples/projects/l0/stepper/node_config.h index a191b492d..65e537ff3 100644 --- a/examples/projects/l0/stepper/node_config.h +++ b/examples/projects/l0/stepper/node_config.h @@ -37,16 +37,17 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer - * MAX_RTB_ENTRY | 40 | Max entries in the routing table + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 -#define MAX_PROFILE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 +#define MAX_LOCAL_PROFILE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/native/button/node_config.h b/examples/projects/native/button/node_config.h index bf418c0b4..084b12960 100644 --- a/examples/projects/native/button/node_config.h +++ b/examples/projects/native/button/node_config.h @@ -37,15 +37,15 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 -#define MAX_PROFILE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 +#define MAX_LOCAL_PROFILE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/native/gate_wscom/node_config.h b/examples/projects/native/gate_wscom/node_config.h index cc9e21a84..46aa0f3b7 100644 --- a/examples/projects/native/gate_wscom/node_config.h +++ b/examples/projects/native/gate_wscom/node_config.h @@ -39,15 +39,15 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 2 -#define MAX_PROFILE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 2 +#define MAX_LOCAL_PROFILE_NUMBER 1 #define MAX_MSG_NB 200 /******************************************************************************* @@ -100,13 +100,13 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_RX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_TX_BUFFER_SIZE | 2048 | Transmit pipe buffer size * INIT_TIME | 150 | Wait init time before first detection ******************************************************************************/ -#define MAX_RTB_ENTRY 40 #define GATE_BUFF_SIZE 65000 #define PIPE_RX_BUFFER_SIZE 65000 #define PIPE_TX_BUFFER_SIZE 65000 diff --git a/examples/projects/native/led/node_config.h b/examples/projects/native/led/node_config.h index bf418c0b4..084b12960 100644 --- a/examples/projects/native/led/node_config.h +++ b/examples/projects/native/led/node_config.h @@ -37,15 +37,15 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 -#define MAX_PROFILE_NUMBER 1 +#define MAX_LOCAL_SERVICE_NUMBER 1 +#define MAX_LOCAL_PROFILE_NUMBER 1 #define MAX_MSG_NB 5 /******************************************************************************* diff --git a/examples/projects/native/ping_pong/node_config.h b/examples/projects/native/ping_pong/node_config.h index f1cdf8ff6..97912b290 100644 --- a/examples/projects/native/ping_pong/node_config.h +++ b/examples/projects/native/ping_pong/node_config.h @@ -37,17 +37,19 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node - * MAX_NODE_NUMBER. | 20 | Node number in the device + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 1 -#define MAX_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 -#define MAX_RTB_ENTRY 100 +#define MAX_LOCAL_SERVICE_NUMBER 1 +#define MAX_LOCAL_PROFILE_NUMBER 1 +#define MAX_MSG_NB 5 +#define MAX_NODE_NB 50 +#define MAX_SERVICE_NUMBER 50 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/test/_resources/node_config.h b/test/_resources/node_config.h index 3573b6828..c82573e2d 100644 --- a/test/_resources/node_config.h +++ b/test/_resources/node_config.h @@ -32,14 +32,14 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * MAX_SERVICE_NUMBER | 5 | Service number in the node + * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_SERVICE_NUMBER | Message number in Luos buffer + * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MAX_SERVICE_NUMBER 25 +#define MAX_LOCAL_SERVICE_NUMBER 25 #define MSG_BUFFER_SIZE 25 * sizeof(msg_t) #define MAX_MSG_NB 100 diff --git a/test/tests_core/test_pub_sub/main.c b/test/tests_core/test_pub_sub/main.c index f0de19953..05cd88b37 100644 --- a/test/tests_core/test_pub_sub/main.c +++ b/test/tests_core/test_pub_sub/main.c @@ -22,7 +22,7 @@ void unittest_PubSub_IsTopicSubscribed(void) { // Init default scenario context Init_Context(); - PubSub_IsTopicSubscribed(default_sc.App_1.app, LAST_TOPIC); + PubSub_IsTopicSubscribed(default_sc.App_1.app, MAX_LOCAL_TOPIC_NUMBER); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -65,7 +65,7 @@ void unittest_Luos_Subscribe(void) { // Init default scenario context Init_Context(); - Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC); + Luos_Subscribe(default_sc.App_1.app, MAX_LOCAL_TOPIC_NUMBER); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -79,11 +79,11 @@ void unittest_Luos_Subscribe(void) TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, 1)); TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, 2)); - TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC - 1)); + TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, MAX_LOCAL_TOPIC_NUMBER - 1)); TEST_ASSERT_EQUAL(3, default_sc.App_1.app->last_topic_position); TEST_ASSERT_EQUAL(1, default_sc.App_1.app->topic_list[0]); TEST_ASSERT_EQUAL(2, default_sc.App_1.app->topic_list[1]); - TEST_ASSERT_EQUAL(LAST_TOPIC - 1, default_sc.App_1.app->topic_list[2]); + TEST_ASSERT_EQUAL(MAX_LOCAL_TOPIC_NUMBER - 1, default_sc.App_1.app->topic_list[2]); } CATCH { @@ -99,15 +99,15 @@ void unittest_Luos_Subscribe(void) // Init default scenario context Init_Context(); - for (uint8_t i = 0; i < LAST_TOPIC; i++) + for (uint8_t i = 0; i < MAX_LOCAL_TOPIC_NUMBER; i++) { TEST_ASSERT_EQUAL(SUCCEED, Luos_Subscribe(default_sc.App_1.app, i)); TEST_ASSERT_EQUAL(i + 1, default_sc.App_1.app->last_topic_position); } - TEST_ASSERT_EQUAL(LAST_TOPIC, default_sc.App_1.app->last_topic_position); + TEST_ASSERT_EQUAL(MAX_LOCAL_TOPIC_NUMBER, default_sc.App_1.app->last_topic_position); - TEST_ASSERT_TRUE(PubSub_IsTopicSubscribed(default_sc.App_1.app, LAST_TOPIC - 1)); + TEST_ASSERT_TRUE(PubSub_IsTopicSubscribed(default_sc.App_1.app, MAX_LOCAL_TOPIC_NUMBER - 1)); } CATCH { @@ -158,12 +158,12 @@ void unittest_Luos_Subscribe(void) RESET_ASSERT(); - Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC - 1); + Luos_Subscribe(default_sc.App_1.app, MAX_LOCAL_TOPIC_NUMBER - 1); TEST_ASSERT_FALSE(IS_ASSERT()); TRY { - Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC); + Luos_Subscribe(default_sc.App_1.app, MAX_LOCAL_TOPIC_NUMBER); } TEST_ASSERT_TRUE(IS_ASSERT()); } @@ -275,11 +275,11 @@ void unittest_Luos_Unsubscribe(void) { // Init default scenario context Init_Context(); - Luos_Subscribe(default_sc.App_1.app, LAST_TOPIC - 1); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); - Luos_Unsubscribe(default_sc.App_1.app, LAST_TOPIC - 1); - TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC - 1)); - error_return_t err = Luos_Unsubscribe(default_sc.App_1.app, LAST_TOPIC - 1); + Luos_Subscribe(default_sc.App_1.app, MAX_LOCAL_TOPIC_NUMBER - 1); + TEST_ASSERT_EQUAL(true, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); + Luos_Unsubscribe(default_sc.App_1.app, MAX_LOCAL_TOPIC_NUMBER - 1); + TEST_ASSERT_EQUAL(false, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); + error_return_t err = Luos_Unsubscribe(default_sc.App_1.app, MAX_LOCAL_TOPIC_NUMBER - 1); TEST_ASSERT_EQUAL(err, FAILED); } CATCH @@ -430,7 +430,7 @@ void unittest_Luos_Unsubscribe(void) Init_Context(); Luos_Subscribe(default_sc.App_1.app, 2); - default_sc.App_1.app->last_topic_position = LAST_TOPIC; + default_sc.App_1.app->last_topic_position = MAX_LOCAL_TOPIC_NUMBER; TEST_ASSERT_EQUAL(SUCCEED, Luos_Unsubscribe(default_sc.App_1.app, 2)); TEST_ASSERT_EQUAL(FAILED, Luos_Unsubscribe(default_sc.App_1.app, 2)); } diff --git a/test/tests_io/test_filter/main.c b/test/tests_io/test_filter/main.c index c0f1522c0..a17091bd0 100644 --- a/test/tests_io/test_filter/main.c +++ b/test/tests_io/test_filter/main.c @@ -56,7 +56,7 @@ void unittest_Filter_ServiceId() } } - service_number = MAX_SERVICE_NUMBER; + service_number = MAX_LOCAL_SERVICE_NUMBER; NEW_TEST_CASE("Service ID mask test with max services"); { Filter_IdInit(); @@ -109,12 +109,12 @@ void unittest_Filter_ServiceId() } } - NEW_TEST_CASE("Overlap the MAX_SERVICE_NUMBER"); + NEW_TEST_CASE("Overlap the MAX_LOCAL_SERVICE_NUMBER"); { Filter_IdInit(); TRY { - Filter_AddServiceId(1, MAX_SERVICE_NUMBER + 1); + Filter_AddServiceId(1, MAX_LOCAL_SERVICE_NUMBER + 1); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -125,8 +125,8 @@ void unittest_Filter_ServiceId() Filter_IdInit(); TRY { - Filter_AddServiceId(4096 - MAX_SERVICE_NUMBER, service_number); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(4096 - MAX_SERVICE_NUMBER)); + Filter_AddServiceId(4096 - MAX_LOCAL_SERVICE_NUMBER, service_number); + TEST_ASSERT_EQUAL(true, Filter_ServiceID(4096 - MAX_LOCAL_SERVICE_NUMBER)); } CATCH { @@ -135,7 +135,7 @@ void unittest_Filter_ServiceId() TRY { - Filter_AddServiceId(4096 - MAX_SERVICE_NUMBER + 1, service_number); + Filter_AddServiceId(4096 - MAX_LOCAL_SERVICE_NUMBER + 1, service_number); } TEST_ASSERT_TRUE(IS_ASSERT()); @@ -166,8 +166,8 @@ void unittest_Filter_Topic() Filter_TopicInit(); TRY { - Filter_AddTopic(LAST_TOPIC - 1); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); + Filter_AddTopic(MAX_LOCAL_TOPIC_NUMBER - 1); + TEST_ASSERT_EQUAL(true, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); } CATCH { @@ -177,18 +177,18 @@ void unittest_Filter_Topic() Filter_TopicInit(); TRY { - Filter_AddTopic(LAST_TOPIC); - TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC)); + Filter_AddTopic(MAX_LOCAL_TOPIC_NUMBER); + TEST_ASSERT_EQUAL(false, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER)); } TEST_ASSERT_TRUE(IS_ASSERT()); Filter_TopicInit(); TRY { - Filter_AddTopic(LAST_TOPIC - 1); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); - Filter_RmTopic(LAST_TOPIC - 1); - TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC - 1)); + Filter_AddTopic(MAX_LOCAL_TOPIC_NUMBER - 1); + TEST_ASSERT_EQUAL(true, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); + Filter_RmTopic(MAX_LOCAL_TOPIC_NUMBER - 1); + TEST_ASSERT_EQUAL(false, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); } CATCH { @@ -198,7 +198,7 @@ void unittest_Filter_Topic() Filter_TopicInit(); TRY { - Filter_RmTopic(LAST_TOPIC); + Filter_RmTopic(MAX_LOCAL_TOPIC_NUMBER); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -215,7 +215,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(false, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC - 1)); + TEST_ASSERT_EQUAL(false, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); } CATCH { @@ -230,7 +230,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(false, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC - 1)); + TEST_ASSERT_EQUAL(false, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); } CATCH { @@ -245,7 +245,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(true, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC - 1)); + TEST_ASSERT_EQUAL(false, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); } CATCH { @@ -254,13 +254,13 @@ void unittest_Filter_Topic() TRY { - Filter_AddTopic(LAST_TOPIC - 1); + Filter_AddTopic(MAX_LOCAL_TOPIC_NUMBER - 1); TEST_ASSERT_EQUAL(true, Filter_Topic(0)); TEST_ASSERT_EQUAL(true, Filter_Topic(1)); TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(true, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); + TEST_ASSERT_EQUAL(true, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); } CATCH { @@ -275,7 +275,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(true, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); + TEST_ASSERT_EQUAL(true, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); } CATCH { @@ -290,7 +290,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(true, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); + TEST_ASSERT_EQUAL(true, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); } CATCH { @@ -305,7 +305,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(false, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); + TEST_ASSERT_EQUAL(true, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); } CATCH { @@ -320,7 +320,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(false, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); + TEST_ASSERT_EQUAL(true, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); } CATCH { @@ -335,7 +335,7 @@ void unittest_Filter_Topic() TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(false, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(true, Filter_Topic(LAST_TOPIC - 1)); + TEST_ASSERT_EQUAL(true, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); } CATCH { @@ -344,13 +344,13 @@ void unittest_Filter_Topic() TRY { - Filter_RmTopic(LAST_TOPIC - 1); + Filter_RmTopic(MAX_LOCAL_TOPIC_NUMBER - 1); TEST_ASSERT_EQUAL(false, Filter_Topic(0)); TEST_ASSERT_EQUAL(false, Filter_Topic(1)); TEST_ASSERT_EQUAL(false, Filter_Topic(2)); TEST_ASSERT_EQUAL(false, Filter_Topic(3)); TEST_ASSERT_EQUAL(false, Filter_Topic(4)); - TEST_ASSERT_EQUAL(false, Filter_Topic(LAST_TOPIC - 1)); + TEST_ASSERT_EQUAL(false, Filter_Topic(MAX_LOCAL_TOPIC_NUMBER - 1)); } CATCH { From e74f10a4e2ddc2f763330766e699bcf6974e03cb Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 18 Jul 2023 17:52:50 +0200 Subject: [PATCH 109/150] Hide uselees routing function to users --- engine/IO/src/luos_io.c | 1 + engine/core/inc/_routing_table.h | 33 ++++++++++++++++++++ engine/core/inc/routing_table.h | 14 --------- engine/core/src/routing_table.c | 1 + test/_resources/Scenarios/default_scenario.c | 1 + 5 files changed, 36 insertions(+), 14 deletions(-) create mode 100644 engine/core/inc/_routing_table.h diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 91608074a..f6bf1783e 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -13,6 +13,7 @@ #include "luos_utils.h" #include "luos_hal.h" #include "luos_engine.h" +#include "_routing_table.h" #include "_luos_phy.h" #include "stats.h" diff --git a/engine/core/inc/_routing_table.h b/engine/core/inc/_routing_table.h new file mode 100644 index 000000000..39d0d8c9c --- /dev/null +++ b/engine/core/inc/_routing_table.h @@ -0,0 +1,33 @@ +/****************************************************************************** + * @file routingTable + * @brief routing table description function + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef ROUTING_TABLE +#define ROUTING_TABLE + +#include "struct_luos.h" +#include "luos_list.h" +#include "node.h" +#include "routing_table.h" + +/******************************************************************************* + * Function + ******************************************************************************/ +// ********************* routing_table search tools ************************ +uint16_t RoutingTB_NodeIDFromID(uint16_t id); + +// ********************* routing_table management tools ************************ +void RoutingTB_ComputeRoutingTableEntryNB(void); +bool RoutingTB_DetectServices(service_t *service); +void RoutingTB_ConvertNodeToRoutingTable(routing_table_t *entry, node_t *node); +void RoutingTB_ConvertServiceToRoutingTable(routing_table_t *entry, service_t *service); +void RoutingTB_RemoveNode(uint16_t nodeid); +void RoutingTB_RemoveService(uint16_t id); +void RoutingTB_Erase(void); +routing_table_t *RoutingTB_Get(void); +uint16_t *RoutingTB_GetLastNode(void); +uint16_t RoutingTB_GetLastEntry(void); + +#endif /* ROUTING_TABLE */ diff --git a/engine/core/inc/routing_table.h b/engine/core/inc/routing_table.h index 1b0890497..952a3e43b 100644 --- a/engine/core/inc/routing_table.h +++ b/engine/core/inc/routing_table.h @@ -68,20 +68,6 @@ typedef struct /******************************************************************************* * Function ******************************************************************************/ -// ********************* routing_table search tools ************************ -uint16_t RoutingTB_NodeIDFromID(uint16_t id); - -// ********************* routing_table management tools ************************ -void RoutingTB_ComputeRoutingTableEntryNB(void); -bool RoutingTB_DetectServices(service_t *service); -void RoutingTB_ConvertNodeToRoutingTable(routing_table_t *entry, node_t *node); -void RoutingTB_ConvertServiceToRoutingTable(routing_table_t *entry, service_t *service); -void RoutingTB_RemoveNode(uint16_t nodeid); -void RoutingTB_RemoveService(uint16_t id); -void RoutingTB_Erase(void); -routing_table_t *RoutingTB_Get(void); -uint16_t *RoutingTB_GetLastNode(void); -uint16_t RoutingTB_GetLastEntry(void); // ********************* routing table filtering ******************************** error_return_t RTFilter_InitCheck(search_result_t *result); diff --git a/engine/core/src/routing_table.c b/engine/core/src/routing_table.c index 8b4646623..be3e42636 100644 --- a/engine/core/src/routing_table.c +++ b/engine/core/src/routing_table.c @@ -9,6 +9,7 @@ #include #include #include "routing_table.h" +#include "_routing_table.h" #include "luos_hal.h" #include "luos_engine.h" #include "struct_engine.h" diff --git a/test/_resources/Scenarios/default_scenario.c b/test/_resources/Scenarios/default_scenario.c index 6eb0b3d44..ac5e0be21 100644 --- a/test/_resources/Scenarios/default_scenario.c +++ b/test/_resources/Scenarios/default_scenario.c @@ -6,6 +6,7 @@ ******************************************************************************/ #include #include "default_scenario.h" +#include "_routing_table.h" /******************************************************************************* * Variables From 80100f457a7c131460a8f457c702da1061ff6e16 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 19 Jul 2023 11:53:16 +0200 Subject: [PATCH 110/150] Improve Robus configuration flags naming --- .../Arduino/bldc_simple_foc/node_config.h | 22 +-- .../projects/Arduino/button/node_config.h | 24 +-- .../Arduino/fingerprint/node_config.h | 24 +-- .../Arduino/gate_serialcom/node_config.h | 22 +-- .../Arduino/inspector_serialcom/node_config.h | 28 ++-- examples/projects/Arduino/lcd/node_config.h | 24 +-- examples/projects/Arduino/led/node_config.h | 22 +-- .../Arduino/servo_motor/node_config.h | 24 +-- .../Arduino/stepper_simple_foc/node_config.h | 32 ++-- examples/projects/ESP32/button/node_config.h | 22 +-- .../ESP32/button_arduino/node_config.h | 22 +-- .../ESP32/gate_serialcom/node_config.h | 22 +-- .../gate_serialcom_arduino/node_config.h | 22 +-- .../projects/ESP32/gate_wscom/node_config.h | 22 +-- .../ESP32/gate_wscom_arduino/node_config.h | 28 ++-- examples/projects/ESP32/led/node_config.h | 22 +-- .../NUCLEO-F072RB/barometer/node_config.h | 22 +-- .../NUCLEO-F072RB/bootloader/node_config.h | 22 +-- .../NUCLEO-F072RB/button/node_config.h | 22 +-- .../NUCLEO-F072RB/dc_motor/node_config.h | 26 ++-- .../gate_serialcom/node_config.h | 26 ++-- .../inspector_serialcom/node_config.h | 26 ++-- .../NUCLEO-F072RB/potentiometer/node_config.h | 24 +-- .../NUCLEO-F401RE/bootloader/node_config.h | 30 ++-- .../NUCLEO-F401RE/button/node_config.h | 30 ++-- .../NUCLEO-F401RE/dc_motor/node_config.h | 26 ++-- .../gate_serialcom/node_config.h | 34 ++--- .../inspector_serialcom/node_config.h | 34 ++--- .../projects/NUCLEO-F401RE/led/node_config.h | 32 ++-- .../NUCLEO-F401RE/potentiometer/node_config.h | 24 +-- .../NUCLEO-F410RB/bootloader/node_config.h | 34 ++--- .../NUCLEO-F410RB/button/node_config.h | 30 ++-- .../NUCLEO-F410RB/dc_motor/node_config.h | 26 ++-- .../gate_serialcom/node_config.h | 34 ++--- .../inspector_serialcom/node_config.h | 34 ++--- .../projects/NUCLEO-F410RB/led/node_config.h | 32 ++-- .../NUCLEO-F410RB/potentiometer/node_config.h | 24 +-- .../NUCLEO-G431KB/bootloader/node_config.h | 22 +-- .../NUCLEO-G431KB/button/node_config.h | 22 +-- .../NUCLEO-G431KB/dc_motor/node_config.h | 24 +-- .../gate_serialcom/node_config.h | 26 ++-- .../inspector_serialcom/node_config.h | 26 ++-- .../NUCLEO-G431KB/potentiometer/node_config.h | 24 +-- .../NUCLEO-G474RE/bootloader/node_config.h | 22 +-- .../button/include/luos_hal_configuration.h | 24 +-- .../NUCLEO-G474RE/button/node_config.h | 22 +-- .../gate_serialcom/node_config.h | 22 +-- .../inspector_serialcom/node_config.h | 26 ++-- .../NUCLEO-L073RZ/bootloader/node_config.h | 22 +-- .../NUCLEO-L073RZ/button/node_config.h | 22 +-- .../gate_serialcom/node_config.h | 28 ++-- .../NUCLEO-L432KC/bootloader/node_config.h | 22 +-- .../NUCLEO-L432KC/button/node_config.h | 22 +-- .../NUCLEO-L432KC/dc_motor/node_config.h | 24 +-- .../NUCLEO-L432KC/fingerprint/node_config.h | 24 +-- .../gate_serialcom/node_config.h | 22 +-- .../projects/NUCLEO-L432KC/gpio/node_config.h | 26 ++-- .../inspector_serialcom/node_config.h | 26 ++-- .../projects/NUCLEO-L432KC/lcd/node_config.h | 24 +-- .../projects/NUCLEO-L432KC/led/node_config.h | 22 +-- .../NUCLEO-L432KC/potentiometer/node_config.h | 24 +-- .../NUCLEO-L432KC/servo/node_config.h | 24 +-- .../SAMD21XPLAINED/button/node_config.h | 22 +-- .../bootloader/node_config.h | 26 ++-- .../STM32F4-discovery/button/node_config.h | 22 +-- .../gate_serialcom/node_config.h | 26 ++-- .../inspector_serialcom/node_config.h | 26 ++-- .../bootloader/node_config.h | 40 ++--- .../STM32L4S5_discovery/button/node_config.h | 42 ++--- .../gate_serialcom/node_config.h | 42 ++--- .../bike_alarm/alarm_controller/node_config.h | 22 +-- .../bike_alarm/start_controller/node_config.h | 22 +-- examples/projects/l0/bootloader/node_config.h | 22 +-- examples/projects/l0/button/node_config.h | 22 +-- .../projects/l0/button_freertos/node_config.h | 22 +-- .../l0/controller_motor/node_config.h | 26 ++-- examples/projects/l0/dc_motor/node_config.h | 26 ++-- .../l0/demo/detection_button/node_config.h | 22 +-- .../l0/demo/ledstrip_position/node_config.h | 26 ++-- .../l0/demo/motor_copy_app/node_config.h | 26 ++-- .../l0/demo/motor_demo_app/node_config.h | 26 ++-- examples/projects/l0/distance/node_config.h | 24 +-- examples/projects/l0/dxl/node_config.h | 26 ++-- .../projects/l0/fingerprint/node_config.h | 24 +-- .../projects/l0/gate_serialcom/node_config.h | 22 +-- examples/projects/l0/gpio/node_config.h | 24 +-- examples/projects/l0/imu/node_config.h | 26 ++-- .../l0/inspector_serialcom/node_config.h | 22 +-- examples/projects/l0/lcd/node_config.h | 24 +-- examples/projects/l0/led/node_config.h | 22 +-- examples/projects/l0/led_fader/node_config.h | 24 +-- examples/projects/l0/led_strip/node_config.h | 22 +-- .../projects/l0/light_sensor/node_config.h | 24 +-- examples/projects/l0/load/node_config.h | 24 +-- .../projects/l0/potentiometer/node_config.h | 24 +-- .../projects/l0/power_switch/node_config.h | 24 +-- examples/projects/l0/servo/node_config.h | 26 ++-- examples/projects/l0/stepper/node_config.h | 24 +-- examples/projects/native/button/node_config.h | 24 +-- .../projects/native/gate_wscom/node_config.h | 24 +-- examples/projects/native/led/node_config.h | 24 +-- .../projects/native/ping_pong/node_config.h | 22 +-- .../robus_network/HAL/ATSAMD21/robus_hal.c | 144 +++++++++--------- .../HAL/ATSAMD21/robus_hal_config.h | 48 +++--- .../HAL/ATSAMD21_ARDUINO/board_config.h | 30 ++-- .../HAL/ATSAMD21_ARDUINO/robus_hal.c | 144 +++++++++--------- .../HAL/ATSAMD21_ARDUINO/robus_hal_config.h | 48 +++--- .../HAL/ATSAMD21_MBED/robus_hal.c | 144 +++++++++--------- .../HAL/ATSAMD21_MBED/robus_hal_config.h | 48 +++--- .../robus_network/HAL/ESP32/board_config.h | 2 +- network/robus_network/HAL/ESP32/robus_hal.c | 26 ++-- .../HAL/ESP32/robus_hal_config.h | 12 +- network/robus_network/HAL/NATIVE/robus_hal.h | 2 +- .../HAL/NATIVE/robus_hal_config.h | 48 +++--- network/robus_network/HAL/STM32F0/robus_hal.c | 138 ++++++++--------- .../HAL/STM32F0/robus_hal_config.h | 48 +++--- network/robus_network/HAL/STM32F4/robus_hal.c | 144 +++++++++--------- .../HAL/STM32F4/robus_hal_config.h | 52 +++---- network/robus_network/HAL/STM32G4/robus_hal.c | 138 ++++++++--------- .../HAL/STM32G4/robus_hal_config.h | 48 +++--- network/robus_network/HAL/STM32L0/robus_hal.c | 138 ++++++++--------- .../HAL/STM32L0/robus_hal_config.h | 48 +++--- network/robus_network/HAL/STM32L4/robus_hal.c | 138 ++++++++--------- .../HAL/STM32L4/robus_hal_config.h | 48 +++--- .../robus_network/HAL/STUB/robus_hal_config.h | 48 +++--- .../robus_network/HAL/template/robus_hal.c | 6 +- .../HAL/template/robus_hal_config.h | 44 +++--- test/_resources/node_config.h | 7 +- tool_services/gate/TinyJSON/bootloader_ex.c | 2 +- tool_services/gate/TinyJSON/convert.c | 1 + tool_services/gate/pipe_link.c | 1 + 131 files changed, 2161 insertions(+), 2158 deletions(-) diff --git a/examples/projects/Arduino/bldc_simple_foc/node_config.h b/examples/projects/Arduino/bldc_simple_foc/node_config.h index 42aebae5b..3fe08e2a5 100644 --- a/examples/projects/Arduino/bldc_simple_foc/node_config.h +++ b/examples/projects/Arduino/bldc_simple_foc/node_config.h @@ -72,19 +72,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * FLASH_SECTOR | FLASH page size * PAGE_SIZE | FLASH page size diff --git a/examples/projects/Arduino/button/node_config.h b/examples/projects/Arduino/button/node_config.h index 82621f87b..961af2512 100644 --- a/examples/projects/Arduino/button/node_config.h +++ b/examples/projects/Arduino/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * FLASH_SECTOR | FLASH page size * PAGE_SIZE | FLASH page size diff --git a/examples/projects/Arduino/fingerprint/node_config.h b/examples/projects/Arduino/fingerprint/node_config.h index 82621f87b..961af2512 100644 --- a/examples/projects/Arduino/fingerprint/node_config.h +++ b/examples/projects/Arduino/fingerprint/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * FLASH_SECTOR | FLASH page size * PAGE_SIZE | FLASH page size diff --git a/examples/projects/Arduino/gate_serialcom/node_config.h b/examples/projects/Arduino/gate_serialcom/node_config.h index afef8d159..6d70ccedc 100644 --- a/examples/projects/Arduino/gate_serialcom/node_config.h +++ b/examples/projects/Arduino/gate_serialcom/node_config.h @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * FLASH_SECTOR | FLASH page size * PAGE_SIZE | FLASH page size diff --git a/examples/projects/Arduino/inspector_serialcom/node_config.h b/examples/projects/Arduino/inspector_serialcom/node_config.h index 0eba5c73a..42567b221 100644 --- a/examples/projects/Arduino/inspector_serialcom/node_config.h +++ b/examples/projects/Arduino/inspector_serialcom/node_config.h @@ -48,9 +48,9 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 1024 -#define MAX_MSG_NB 30 -//#define NODETECTION +#define MSG_BUFFER_SIZE 1024 +#define MAX_MSG_NB 30 +// #define NODETECTION /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -71,19 +71,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * FLASH_SECTOR | FLASH page size * PAGE_SIZE | FLASH page size diff --git a/examples/projects/Arduino/lcd/node_config.h b/examples/projects/Arduino/lcd/node_config.h index 82621f87b..961af2512 100644 --- a/examples/projects/Arduino/lcd/node_config.h +++ b/examples/projects/Arduino/lcd/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * FLASH_SECTOR | FLASH page size * PAGE_SIZE | FLASH page size diff --git a/examples/projects/Arduino/led/node_config.h b/examples/projects/Arduino/led/node_config.h index 82621f87b..dc8a32407 100644 --- a/examples/projects/Arduino/led/node_config.h +++ b/examples/projects/Arduino/led/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * FLASH_SECTOR | FLASH page size * PAGE_SIZE | FLASH page size diff --git a/examples/projects/Arduino/servo_motor/node_config.h b/examples/projects/Arduino/servo_motor/node_config.h index 82621f87b..961af2512 100644 --- a/examples/projects/Arduino/servo_motor/node_config.h +++ b/examples/projects/Arduino/servo_motor/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * FLASH_SECTOR | FLASH page size * PAGE_SIZE | FLASH page size diff --git a/examples/projects/Arduino/stepper_simple_foc/node_config.h b/examples/projects/Arduino/stepper_simple_foc/node_config.h index a8cc0fee0..9d6b1d679 100644 --- a/examples/projects/Arduino/stepper_simple_foc/node_config.h +++ b/examples/projects/Arduino/stepper_simple_foc/node_config.h @@ -48,20 +48,20 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 #define ARDUINO_PTPA_PIN 19 #define ARDUINO_PTPB_PIN 7 -#define LUOS_TIMER_LOCK_ENABLE() \ +#define ROBUS_TIMER_LOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_TC4_TC5_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ PM->APBCMASK.reg |= PM_APBCMASK_TC4; \ } while (0U) -#define LUOS_TIMER TC4 -#define LUOS_TIMER_IRQ TC4_IRQn -#define LUOS_TIMER_IRQHANDLER() TC4_Handler() +#define ROBUS_TIMER TC4 +#define ROBUS_TIMER_IRQ TC4_IRQn +#define ROBUS_TIMER_IRQHANDLER() TC4_Handler() /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -82,19 +82,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * FLASH_SECTOR | FLASH page size * PAGE_SIZE | FLASH page size diff --git a/examples/projects/ESP32/button/node_config.h b/examples/projects/ESP32/button/node_config.h index 0cc8afa85..cb3e1a007 100644 --- a/examples/projects/ESP32/button/node_config.h +++ b/examples/projects/ESP32/button/node_config.h @@ -67,19 +67,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/ESP32/button_arduino/node_config.h b/examples/projects/ESP32/button_arduino/node_config.h index 0cc8afa85..cb3e1a007 100644 --- a/examples/projects/ESP32/button_arduino/node_config.h +++ b/examples/projects/ESP32/button_arduino/node_config.h @@ -67,19 +67,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/ESP32/gate_serialcom/node_config.h b/examples/projects/ESP32/gate_serialcom/node_config.h index ca1360ea5..8bdeb7443 100644 --- a/examples/projects/ESP32/gate_serialcom/node_config.h +++ b/examples/projects/ESP32/gate_serialcom/node_config.h @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/ESP32/gate_serialcom_arduino/node_config.h b/examples/projects/ESP32/gate_serialcom_arduino/node_config.h index 4bddb2297..f52aa9d51 100644 --- a/examples/projects/ESP32/gate_serialcom_arduino/node_config.h +++ b/examples/projects/ESP32/gate_serialcom_arduino/node_config.h @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/ESP32/gate_wscom/node_config.h b/examples/projects/ESP32/gate_wscom/node_config.h index 66d17c0eb..a0cc2e465 100644 --- a/examples/projects/ESP32/gate_wscom/node_config.h +++ b/examples/projects/ESP32/gate_wscom/node_config.h @@ -67,19 +67,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/ESP32/gate_wscom_arduino/node_config.h b/examples/projects/ESP32/gate_wscom_arduino/node_config.h index b17b8b8ed..0e035363b 100644 --- a/examples/projects/ESP32/gate_wscom_arduino/node_config.h +++ b/examples/projects/ESP32/gate_wscom_arduino/node_config.h @@ -46,9 +46,9 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MAX_MSG_NB 20 -#define MSG_BUFFER_SIZE 1024 -#define DEFAULTBAUDRATE 500000 +#define MAX_MSG_NB 20 +#define MSG_BUFFER_SIZE 1024 +#define DEFAULTBAUDRATE 500000 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/ESP32/led/node_config.h b/examples/projects/ESP32/led/node_config.h index 0cc8afa85..cb3e1a007 100644 --- a/examples/projects/ESP32/led/node_config.h +++ b/examples/projects/ESP32/led/node_config.h @@ -67,19 +67,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-F072RB/barometer/node_config.h b/examples/projects/NUCLEO-F072RB/barometer/node_config.h index 3afe576e5..bb12fbb4d 100644 --- a/examples/projects/NUCLEO-F072RB/barometer/node_config.h +++ b/examples/projects/NUCLEO-F072RB/barometer/node_config.h @@ -64,19 +64,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * FLASH_SECTOR | FLASH page size * PAGE_SIZE | FLASH page size diff --git a/examples/projects/NUCLEO-F072RB/bootloader/node_config.h b/examples/projects/NUCLEO-F072RB/bootloader/node_config.h index d2b89921b..6a6669822 100644 --- a/examples/projects/NUCLEO-F072RB/bootloader/node_config.h +++ b/examples/projects/NUCLEO-F072RB/bootloader/node_config.h @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * BOOT_START_ADDRESS | * SHARED_MEMORY_ADDRESS | diff --git a/examples/projects/NUCLEO-F072RB/button/node_config.h b/examples/projects/NUCLEO-F072RB/button/node_config.h index 65e537ff3..a2f0f9305 100644 --- a/examples/projects/NUCLEO-F072RB/button/node_config.h +++ b/examples/projects/NUCLEO-F072RB/button/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h b/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h index cdb64ba3e..2d45ceb93 100644 --- a/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h @@ -47,8 +47,8 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MAX_MSG_NB 5 -#define MSG_BUFFER_SIZE 512 +#define MAX_MSG_NB 5 +#define MSG_BUFFER_SIZE 512 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-F072RB/gate_serialcom/node_config.h b/examples/projects/NUCLEO-F072RB/gate_serialcom/node_config.h index fe9254f27..c8afde3c1 100644 --- a/examples/projects/NUCLEO-F072RB/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F072RB/gate_serialcom/node_config.h @@ -46,8 +46,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h index 6fd9a9666..cbd40e31d 100644 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 #define NODETECTION /******************************************************************************* @@ -71,19 +71,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h b/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h index 45b5aa221..591039463 100644 --- a/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-F401RE/bootloader/node_config.h b/examples/projects/NUCLEO-F401RE/bootloader/node_config.h index 247bb6179..4ab69e4ed 100644 --- a/examples/projects/NUCLEO-F401RE/bootloader/node_config.h +++ b/examples/projects/NUCLEO-F401RE/bootloader/node_config.h @@ -67,19 +67,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* @@ -102,10 +102,10 @@ /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE() -#define LUOS_TIMER TIM3 -#define LUOS_TIMER_IRQ TIM3_IRQn -#define LUOS_TIMER_IRQHANDLER() TIM3_IRQHandler() +#define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE() +#define ROBUS_TIMER TIM3 +#define ROBUS_TIMER_IRQ TIM3_IRQn +#define ROBUS_TIMER_IRQHANDLER() TIM3_IRQHandler() /******************************************************************************* * FLASH CONFIGURATION FOR APP WITH BOOTLOADER diff --git a/examples/projects/NUCLEO-F401RE/button/node_config.h b/examples/projects/NUCLEO-F401RE/button/node_config.h index 0642f73db..e7818dc34 100644 --- a/examples/projects/NUCLEO-F401RE/button/node_config.h +++ b/examples/projects/NUCLEO-F401RE/button/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* @@ -104,10 +104,10 @@ /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE() -#define LUOS_TIMER TIM3 -#define LUOS_TIMER_IRQ TIM3_IRQn -#define LUOS_TIMER_IRQHANDLER() TIM3_IRQHandler() +#define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE() +#define ROBUS_TIMER TIM3 +#define ROBUS_TIMER_IRQ TIM3_IRQn +#define ROBUS_TIMER_IRQHANDLER() TIM3_IRQHandler() /******************************************************************************* * FLASH CONFIGURATION FOR APP WITH BOOTLOADER diff --git a/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h b/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h index 992ebdf6d..d0c06e415 100644 --- a/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h @@ -47,8 +47,8 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MAX_MSG_NB 5 -#define MSG_BUFFER_SIZE 512 +#define MAX_MSG_NB 5 +#define MSG_BUFFER_SIZE 512 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-F401RE/gate_serialcom/node_config.h b/examples/projects/NUCLEO-F401RE/gate_serialcom/node_config.h index e4313a688..77027fb1d 100644 --- a/examples/projects/NUCLEO-F401RE/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F401RE/gate_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ @@ -106,10 +106,10 @@ /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE() -#define LUOS_TIMER TIM3 -#define LUOS_TIMER_IRQ TIM3_IRQn -#define LUOS_TIMER_IRQHANDLER() TIM3_IRQHandler() +#define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE() +#define ROBUS_TIMER TIM3 +#define ROBUS_TIMER_IRQ TIM3_IRQn +#define ROBUS_TIMER_IRQHANDLER() TIM3_IRQHandler() /******************************************************************************* * FLASH CONFIGURATION FOR APP WITH BOOTLOADER diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h index b6f574d4f..49f211a3d 100644 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* @@ -105,10 +105,10 @@ /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE() -#define LUOS_TIMER TIM3 -#define LUOS_TIMER_IRQ TIM3_IRQn -#define LUOS_TIMER_IRQHANDLER() TIM3_IRQHandler() +#define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE() +#define ROBUS_TIMER TIM3 +#define ROBUS_TIMER_IRQ TIM3_IRQn +#define ROBUS_TIMER_IRQHANDLER() TIM3_IRQHandler() /******************************************************************************* * FLASH CONFIGURATION FOR APP WITH BOOTLOADER diff --git a/examples/projects/NUCLEO-F401RE/led/node_config.h b/examples/projects/NUCLEO-F401RE/led/node_config.h index 0642f73db..b36051575 100644 --- a/examples/projects/NUCLEO-F401RE/led/node_config.h +++ b/examples/projects/NUCLEO-F401RE/led/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* @@ -104,10 +104,10 @@ /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE() -#define LUOS_TIMER TIM3 -#define LUOS_TIMER_IRQ TIM3_IRQn -#define LUOS_TIMER_IRQHANDLER() TIM3_IRQHandler() +#define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE() +#define ROBUS_TIMER TIM3 +#define ROBUS_TIMER_IRQ TIM3_IRQn +#define ROBUS_TIMER_IRQHANDLER() TIM3_IRQHandler() /******************************************************************************* * FLASH CONFIGURATION FOR APP WITH BOOTLOADER diff --git a/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h b/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h index acb38ebe4..cb4b3a6eb 100644 --- a/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-F410RB/bootloader/node_config.h b/examples/projects/NUCLEO-F410RB/bootloader/node_config.h index 82f8b41bf..2fbdfedc5 100644 --- a/examples/projects/NUCLEO-F410RB/bootloader/node_config.h +++ b/examples/projects/NUCLEO-F410RB/bootloader/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 10 -#define MAX_BUFFER_SIZE 512 +#define MAX_MSG_NB 10 +#define MAX_BUFFER_SIZE 512 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* @@ -104,10 +104,10 @@ /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM5_CLK_ENABLE() -#define LUOS_TIMER TIM5 -#define LUOS_TIMER_IRQ TIM5_IRQn -#define LUOS_TIMER_IRQHANDLER() TIM5_IRQHandler() +#define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM5_CLK_ENABLE() +#define ROBUS_TIMER TIM5 +#define ROBUS_TIMER_IRQ TIM5_IRQn +#define ROBUS_TIMER_IRQHANDLER() TIM5_IRQHandler() /******************************************************************************* * FLASH CONFIGURATION FOR APP WITH BOOTLOADER diff --git a/examples/projects/NUCLEO-F410RB/button/node_config.h b/examples/projects/NUCLEO-F410RB/button/node_config.h index ee5ae8c4f..863662eeb 100644 --- a/examples/projects/NUCLEO-F410RB/button/node_config.h +++ b/examples/projects/NUCLEO-F410RB/button/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* @@ -104,10 +104,10 @@ /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM5_CLK_ENABLE() -#define LUOS_TIMER TIM5 -#define LUOS_TIMER_IRQ TIM5_IRQn -#define LUOS_TIMER_IRQHANDLER() TIM5_IRQHandler() +#define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM5_CLK_ENABLE() +#define ROBUS_TIMER TIM5 +#define ROBUS_TIMER_IRQ TIM5_IRQn +#define ROBUS_TIMER_IRQHANDLER() TIM5_IRQHandler() /******************************************************************************* * FLASH CONFIGURATION FOR APP WITH BOOTLOADER diff --git a/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h b/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h index 992ebdf6d..d0c06e415 100644 --- a/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h @@ -47,8 +47,8 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MAX_MSG_NB 5 -#define MSG_BUFFER_SIZE 512 +#define MAX_MSG_NB 5 +#define MSG_BUFFER_SIZE 512 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-F410RB/gate_serialcom/node_config.h b/examples/projects/NUCLEO-F410RB/gate_serialcom/node_config.h index 319e114f4..9ad10a3a0 100644 --- a/examples/projects/NUCLEO-F410RB/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F410RB/gate_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* @@ -105,10 +105,10 @@ /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM5_CLK_ENABLE() -#define LUOS_TIMER TIM5 -#define LUOS_TIMER_IRQ TIM5_IRQn -#define LUOS_TIMER_IRQHANDLER() TIM5_IRQHandler() +#define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM5_CLK_ENABLE() +#define ROBUS_TIMER TIM5 +#define ROBUS_TIMER_IRQ TIM5_IRQn +#define ROBUS_TIMER_IRQHANDLER() TIM5_IRQHandler() /******************************************************************************* * FLASH CONFIGURATION FOR APP WITH BOOTLOADER diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h index 52b6a3e4e..dabe2928f 100644 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 #define NODETECTION /******************************************************************************* @@ -71,19 +71,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* @@ -106,10 +106,10 @@ /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM5_CLK_ENABLE() -#define LUOS_TIMER TIM5 -#define LUOS_TIMER_IRQ TIM5_IRQn -#define LUOS_TIMER_IRQHANDLER() TIM5_IRQHandler() +#define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM5_CLK_ENABLE() +#define ROBUS_TIMER TIM5 +#define ROBUS_TIMER_IRQ TIM5_IRQn +#define ROBUS_TIMER_IRQHANDLER() TIM5_IRQHandler() /******************************************************************************* * FLASH CONFIGURATION FOR APP WITH BOOTLOADER diff --git a/examples/projects/NUCLEO-F410RB/led/node_config.h b/examples/projects/NUCLEO-F410RB/led/node_config.h index ed05a94eb..8ffbb4fd2 100644 --- a/examples/projects/NUCLEO-F410RB/led/node_config.h +++ b/examples/projects/NUCLEO-F410RB/led/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * FLASH_SECTOR | FLASH page size * PAGE_SIZE | FLASH page size @@ -108,10 +108,10 @@ /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE() -#define LUOS_TIMER TIM3 -#define LUOS_TIMER_IRQ TIM3_IRQn -#define LUOS_TIMER_IRQHANDLER() TIM3_IRQHandler() +#define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE() +#define ROBUS_TIMER TIM3 +#define ROBUS_TIMER_IRQ TIM3_IRQn +#define ROBUS_TIMER_IRQHANDLER() TIM3_IRQHandler() /******************************************************************************* * FLASH CONFIG ******************************************************************************/ diff --git a/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h b/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h index acb38ebe4..cb4b3a6eb 100644 --- a/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-G431KB/bootloader/node_config.h b/examples/projects/NUCLEO-G431KB/bootloader/node_config.h index 9f5087f4b..69376eb0f 100644 --- a/examples/projects/NUCLEO-G431KB/bootloader/node_config.h +++ b/examples/projects/NUCLEO-G431KB/bootloader/node_config.h @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-G431KB/button/node_config.h b/examples/projects/NUCLEO-G431KB/button/node_config.h index e5b8fbb94..be4afa01d 100644 --- a/examples/projects/NUCLEO-G431KB/button/node_config.h +++ b/examples/projects/NUCLEO-G431KB/button/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h b/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h index 66a880967..2135215e6 100644 --- a/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-G431KB/gate_serialcom/node_config.h b/examples/projects/NUCLEO-G431KB/gate_serialcom/node_config.h index c3b26eaab..7c26bd8bb 100644 --- a/examples/projects/NUCLEO-G431KB/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-G431KB/gate_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h index 67894ac88..528815815 100644 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 #define NODETECTION /******************************************************************************* @@ -71,19 +71,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h b/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h index 66a880967..2135215e6 100644 --- a/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-G474RE/bootloader/node_config.h b/examples/projects/NUCLEO-G474RE/bootloader/node_config.h index 9f5087f4b..69376eb0f 100644 --- a/examples/projects/NUCLEO-G474RE/bootloader/node_config.h +++ b/examples/projects/NUCLEO-G474RE/bootloader/node_config.h @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-G474RE/button/include/luos_hal_configuration.h b/examples/projects/NUCLEO-G474RE/button/include/luos_hal_configuration.h index 136a68a06..8ce04ed3a 100644 --- a/examples/projects/NUCLEO-G474RE/button/include/luos_hal_configuration.h +++ b/examples/projects/NUCLEO-G474RE/button/include/luos_hal_configuration.h @@ -14,12 +14,12 @@ * PINOUT CONFIG ******************************************************************************/ #ifndef PORT_CLOCK_ENABLE -#define PORT_CLOCK_ENABLE() \ - do \ - { \ - __HAL_RCC_GPIOB_CLK_ENABLE(); \ - __HAL_RCC_GPIOC_CLK_ENABLE(); \ - } while (0U) + #define PORT_CLOCK_ENABLE() \ + do \ + { \ + __HAL_RCC_GPIOB_CLK_ENABLE(); \ + __HAL_RCC_GPIOC_CLK_ENABLE(); \ + } while (0U) #endif // PTP pin definition @@ -49,14 +49,14 @@ /******************************************************************************* * COM CONFIG ******************************************************************************/ -#define LUOS_COM_CLOCK_ENABLE() __HAL_RCC_USART3_CLK_ENABLE() -#define LUOS_COM USART3 -#define LUOS_COM_IRQ USART3_IRQn -#define LUOS_COM_IRQHANDLER() USART3_IRQHandler() +#define ROBUS_COM_CLOCK_ENABLE() __HAL_RCC_USART3_CLK_ENABLE() +#define ROBUS_COM USART3 +#define ROBUS_COM_IRQ USART3_IRQn +#define ROBUS_COM_IRQHANDLER() USART3_IRQHandler() /******************************************************************************* * FLASH CONFIG ******************************************************************************/ -#define LUOS_DMA_REQUEST LL_DMAMUX_REQ_USART3_TX +#define ROBUS_DMA_REQUEST LL_DMAMUX_REQ_USART3_TX -#endif /* _LUOSHAL_CONFIGURATION_H_ */ \ No newline at end of file +#endif /* _LUOSHAL_CONFIGURATION_H_ */ diff --git a/examples/projects/NUCLEO-G474RE/button/node_config.h b/examples/projects/NUCLEO-G474RE/button/node_config.h index 7492a3cdc..078ca55e5 100644 --- a/examples/projects/NUCLEO-G474RE/button/node_config.h +++ b/examples/projects/NUCLEO-G474RE/button/node_config.h @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h b/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h index c3b26eaab..3902eff35 100644 --- a/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h index 67894ac88..528815815 100644 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 #define NODETECTION /******************************************************************************* @@ -71,19 +71,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h b/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h index c78e5d531..e76188fac 100644 --- a/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-L073RZ/button/node_config.h b/examples/projects/NUCLEO-L073RZ/button/node_config.h index 34b869ac6..45905739d 100644 --- a/examples/projects/NUCLEO-L073RZ/button/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/button/node_config.h @@ -71,19 +71,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * FLASH_SECTOR | FLASH page size * PAGE_SIZE | FLASH page size diff --git a/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h b/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h index 379489262..f6624b543 100644 --- a/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h @@ -46,10 +46,10 @@ * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define DEFAULTBAUDRATE 500000 +#define DEFAULTBAUDRATE 500000 #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/bootloader/node_config.h b/examples/projects/NUCLEO-L432KC/bootloader/node_config.h index dc3397a15..beb3f8c6f 100644 --- a/examples/projects/NUCLEO-L432KC/bootloader/node_config.h +++ b/examples/projects/NUCLEO-L432KC/bootloader/node_config.h @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/button/node_config.h b/examples/projects/NUCLEO-L432KC/button/node_config.h index e5b8fbb94..be4afa01d 100644 --- a/examples/projects/NUCLEO-L432KC/button/node_config.h +++ b/examples/projects/NUCLEO-L432KC/button/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h b/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h index e5b8fbb94..1fc4cdf75 100644 --- a/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h b/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h index e5b8fbb94..1fc4cdf75 100644 --- a/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h +++ b/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h b/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h index c3b26eaab..3902eff35 100644 --- a/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/gpio/node_config.h b/examples/projects/NUCLEO-L432KC/gpio/node_config.h index 9591f5bfc..b8a46d675 100644 --- a/examples/projects/NUCLEO-L432KC/gpio/node_config.h +++ b/examples/projects/NUCLEO-L432KC/gpio/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 10 -#define MSG_BUFFER_SIZE 512 -#define MAX_MSG_NB 30 +#define MSG_BUFFER_SIZE 512 +#define MAX_MSG_NB 30 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h index 67894ac88..528815815 100644 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h +++ b/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 #define NODETECTION /******************************************************************************* @@ -71,19 +71,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/lcd/node_config.h b/examples/projects/NUCLEO-L432KC/lcd/node_config.h index e5b8fbb94..1fc4cdf75 100644 --- a/examples/projects/NUCLEO-L432KC/lcd/node_config.h +++ b/examples/projects/NUCLEO-L432KC/lcd/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/led/node_config.h b/examples/projects/NUCLEO-L432KC/led/node_config.h index e5b8fbb94..be4afa01d 100644 --- a/examples/projects/NUCLEO-L432KC/led/node_config.h +++ b/examples/projects/NUCLEO-L432KC/led/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h b/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h index e5b8fbb94..1fc4cdf75 100644 --- a/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/NUCLEO-L432KC/servo/node_config.h b/examples/projects/NUCLEO-L432KC/servo/node_config.h index e5b8fbb94..1fc4cdf75 100644 --- a/examples/projects/NUCLEO-L432KC/servo/node_config.h +++ b/examples/projects/NUCLEO-L432KC/servo/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/SAMD21XPLAINED/button/node_config.h b/examples/projects/SAMD21XPLAINED/button/node_config.h index 82621f87b..dc8a32407 100644 --- a/examples/projects/SAMD21XPLAINED/button/node_config.h +++ b/examples/projects/SAMD21XPLAINED/button/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * FLASH_SECTOR | FLASH page size * PAGE_SIZE | FLASH page size diff --git a/examples/projects/STM32F4-discovery/bootloader/node_config.h b/examples/projects/STM32F4-discovery/bootloader/node_config.h index 8a12a52ed..62688c38a 100644 --- a/examples/projects/STM32F4-discovery/bootloader/node_config.h +++ b/examples/projects/STM32F4-discovery/bootloader/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 10 -#define MAX_BUFFER_SIZE 1024 +#define MAX_MSG_NB 10 +#define MAX_BUFFER_SIZE 1024 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/STM32F4-discovery/button/node_config.h b/examples/projects/STM32F4-discovery/button/node_config.h index 75ec245b5..7e4f40773 100644 --- a/examples/projects/STM32F4-discovery/button/node_config.h +++ b/examples/projects/STM32F4-discovery/button/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/STM32F4-discovery/gate_serialcom/node_config.h b/examples/projects/STM32F4-discovery/gate_serialcom/node_config.h index ed5848b56..683421362 100644 --- a/examples/projects/STM32F4-discovery/gate_serialcom/node_config.h +++ b/examples/projects/STM32F4-discovery/gate_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h b/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h index 74d43887f..bb0b229f0 100644 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h +++ b/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 #define NODETECTION /******************************************************************************* @@ -71,19 +71,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/STM32L4S5_discovery/bootloader/node_config.h b/examples/projects/STM32L4S5_discovery/bootloader/node_config.h index 3994ace3a..b08e09cb1 100644 --- a/examples/projects/STM32L4S5_discovery/bootloader/node_config.h +++ b/examples/projects/STM32L4S5_discovery/bootloader/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ #define MCUFREQ 120000000 // MCU frequence #define TIMERDIV 1 // clock divider for timer clock chosen @@ -125,23 +125,23 @@ * COM CONFIG ******************************************************************************/ -#define LUOS_COM_CLOCK_ENABLE() __HAL_RCC_UART4_CLK_ENABLE() -#define LUOS_COM UART4 -#define LUOS_COM_IRQ UART4_IRQn -#define LUOS_COM_IRQHANDLER() UART4_IRQHandler() +#define ROBUS_COM_CLOCK_ENABLE() __HAL_RCC_UART4_CLK_ENABLE() +#define ROBUS_COM UART4 +#define ROBUS_COM_IRQ UART4_IRQn +#define ROBUS_COM_IRQHANDLER() UART4_IRQHandler() /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#define LUOS_DMA_CLOCK_ENABLE() \ +#define ROBUS_DMA_CLOCK_ENABLE() \ do \ { \ __HAL_RCC_DMA1_CLK_ENABLE(); \ __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ } while (0U) -#define LUOS_DMA DMA1 -#define LUOS_DMA_CHANNEL LL_DMA_CHANNEL_1 -#define LUOS_DMA_REQUEST LL_DMAMUX_REQ_UART4_TX +#define ROBUS_DMA DMA1 +#define ROBUS_DMA_CHANNEL LL_DMA_CHANNEL_1 +#define ROBUS_DMA_REQUEST LL_DMAMUX_REQ_UART4_TX /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ diff --git a/examples/projects/STM32L4S5_discovery/button/node_config.h b/examples/projects/STM32L4S5_discovery/button/node_config.h index d0e9dd6c6..76d572167 100644 --- a/examples/projects/STM32L4S5_discovery/button/node_config.h +++ b/examples/projects/STM32L4S5_discovery/button/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler - - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler + + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ #define MCUFREQ 120000000 // MCU frequence #define TIMERDIV 1 // clock divider for timer clock chosen @@ -125,23 +125,23 @@ * COM CONFIG ******************************************************************************/ -#define LUOS_COM_CLOCK_ENABLE() __HAL_RCC_UART4_CLK_ENABLE() -#define LUOS_COM UART4 -#define LUOS_COM_IRQ UART4_IRQn -#define LUOS_COM_IRQHANDLER() UART4_IRQHandler() +#define ROBUS_COM_CLOCK_ENABLE() __HAL_RCC_UART4_CLK_ENABLE() +#define ROBUS_COM UART4 +#define ROBUS_COM_IRQ UART4_IRQn +#define ROBUS_COM_IRQHANDLER() UART4_IRQHandler() /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#define LUOS_DMA_CLOCK_ENABLE() \ +#define ROBUS_DMA_CLOCK_ENABLE() \ do \ { \ __HAL_RCC_DMA1_CLK_ENABLE(); \ __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ } while (0U) -#define LUOS_DMA DMA1 -#define LUOS_DMA_CHANNEL LL_DMA_CHANNEL_1 -#define LUOS_DMA_REQUEST LL_DMAMUX_REQ_UART4_TX +#define ROBUS_DMA DMA1 +#define ROBUS_DMA_CHANNEL LL_DMA_CHANNEL_1 +#define ROBUS_DMA_REQUEST LL_DMAMUX_REQ_UART4_TX /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ diff --git a/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h b/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h index 3ed90f79d..52a9f2309 100644 --- a/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h +++ b/examples/projects/STM32L4S5_discovery/gate_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ #define MCUFREQ 120000000 // MCU frequence #define TIMERDIV 1 // clock divider for timer clock chosen @@ -126,23 +126,23 @@ * COM CONFIG ******************************************************************************/ -#define LUOS_COM_CLOCK_ENABLE() __HAL_RCC_UART4_CLK_ENABLE() -#define LUOS_COM UART4 -#define LUOS_COM_IRQ UART4_IRQn -#define LUOS_COM_IRQHANDLER() UART4_IRQHandler() +#define ROBUS_COM_CLOCK_ENABLE() __HAL_RCC_UART4_CLK_ENABLE() +#define ROBUS_COM UART4 +#define ROBUS_COM_IRQ UART4_IRQn +#define ROBUS_COM_IRQHANDLER() UART4_IRQHandler() /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#define LUOS_DMA_CLOCK_ENABLE() \ +#define ROBUS_DMA_CLOCK_ENABLE() \ do \ { \ __HAL_RCC_DMA1_CLK_ENABLE(); \ __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ } while (0U) -#define LUOS_DMA DMA1 -#define LUOS_DMA_CHANNEL LL_DMA_CHANNEL_1 -#define LUOS_DMA_REQUEST LL_DMAMUX_REQ_UART4_TX +#define ROBUS_DMA DMA1 +#define ROBUS_DMA_CHANNEL LL_DMA_CHANNEL_1 +#define ROBUS_DMA_REQUEST LL_DMAMUX_REQ_UART4_TX /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ diff --git a/examples/projects/l0/bike_alarm/alarm_controller/node_config.h b/examples/projects/l0/bike_alarm/alarm_controller/node_config.h index 62806095a..2ca36271e 100644 --- a/examples/projects/l0/bike_alarm/alarm_controller/node_config.h +++ b/examples/projects/l0/bike_alarm/alarm_controller/node_config.h @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/bike_alarm/start_controller/node_config.h b/examples/projects/l0/bike_alarm/start_controller/node_config.h index 40e8116a8..4be7b60c0 100644 --- a/examples/projects/l0/bike_alarm/start_controller/node_config.h +++ b/examples/projects/l0/bike_alarm/start_controller/node_config.h @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/bootloader/node_config.h b/examples/projects/l0/bootloader/node_config.h index 93e49a820..0efac10c1 100644 --- a/examples/projects/l0/bootloader/node_config.h +++ b/examples/projects/l0/bootloader/node_config.h @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/button/node_config.h b/examples/projects/l0/button/node_config.h index 65e537ff3..a2f0f9305 100644 --- a/examples/projects/l0/button/node_config.h +++ b/examples/projects/l0/button/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/button_freertos/node_config.h b/examples/projects/l0/button_freertos/node_config.h index 327eaf5e6..52cb97eab 100644 --- a/examples/projects/l0/button_freertos/node_config.h +++ b/examples/projects/l0/button_freertos/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/controller_motor/node_config.h b/examples/projects/l0/controller_motor/node_config.h index b960b0213..7ca9b39d9 100644 --- a/examples/projects/l0/controller_motor/node_config.h +++ b/examples/projects/l0/controller_motor/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 2 -#define MAX_MSG_NB 30 -#define MSG_BUFFER_SIZE 1024 +#define MAX_MSG_NB 30 +#define MSG_BUFFER_SIZE 1024 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/dc_motor/node_config.h b/examples/projects/l0/dc_motor/node_config.h index cdb64ba3e..2d45ceb93 100644 --- a/examples/projects/l0/dc_motor/node_config.h +++ b/examples/projects/l0/dc_motor/node_config.h @@ -47,8 +47,8 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MAX_MSG_NB 5 -#define MSG_BUFFER_SIZE 512 +#define MAX_MSG_NB 5 +#define MSG_BUFFER_SIZE 512 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/demo/detection_button/node_config.h b/examples/projects/l0/demo/detection_button/node_config.h index bf59ddef9..e91918143 100644 --- a/examples/projects/l0/demo/detection_button/node_config.h +++ b/examples/projects/l0/demo/detection_button/node_config.h @@ -67,19 +67,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/demo/ledstrip_position/node_config.h b/examples/projects/l0/demo/ledstrip_position/node_config.h index 28ff8ae4a..1eda203e0 100644 --- a/examples/projects/l0/demo/ledstrip_position/node_config.h +++ b/examples/projects/l0/demo/ledstrip_position/node_config.h @@ -47,8 +47,8 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MAX_MSG_NB 30 -#define MAX_BUFFER_SIZE 1024 +#define MAX_MSG_NB 30 +#define MAX_BUFFER_SIZE 1024 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/demo/motor_copy_app/node_config.h b/examples/projects/l0/demo/motor_copy_app/node_config.h index 40fe8ad1a..b136b8113 100644 --- a/examples/projects/l0/demo/motor_copy_app/node_config.h +++ b/examples/projects/l0/demo/motor_copy_app/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 5 #define MAX_LOCAL_PROFILE_NUMBER 2 -#define MAX_MSG_NB 30 -#define MSG_BUFFER_SIZE 1024 +#define MAX_MSG_NB 30 +#define MSG_BUFFER_SIZE 1024 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/demo/motor_demo_app/node_config.h b/examples/projects/l0/demo/motor_demo_app/node_config.h index 40fe8ad1a..b136b8113 100644 --- a/examples/projects/l0/demo/motor_demo_app/node_config.h +++ b/examples/projects/l0/demo/motor_demo_app/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 5 #define MAX_LOCAL_PROFILE_NUMBER 2 -#define MAX_MSG_NB 30 -#define MSG_BUFFER_SIZE 1024 +#define MAX_MSG_NB 30 +#define MSG_BUFFER_SIZE 1024 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/distance/node_config.h b/examples/projects/l0/distance/node_config.h index 45b5aa221..591039463 100644 --- a/examples/projects/l0/distance/node_config.h +++ b/examples/projects/l0/distance/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/dxl/node_config.h b/examples/projects/l0/dxl/node_config.h index 826cf8105..299aadc6c 100644 --- a/examples/projects/l0/dxl/node_config.h +++ b/examples/projects/l0/dxl/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 10 #define MAX_LOCAL_PROFILE_NUMBER 20 -#define MAX_MSG_NB 30 -#define MSG_BUFFER_SIZE 512 +#define MAX_MSG_NB 30 +#define MSG_BUFFER_SIZE 512 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/fingerprint/node_config.h b/examples/projects/l0/fingerprint/node_config.h index 45b5aa221..591039463 100644 --- a/examples/projects/l0/fingerprint/node_config.h +++ b/examples/projects/l0/fingerprint/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/gate_serialcom/node_config.h b/examples/projects/l0/gate_serialcom/node_config.h index aad78e990..225647240 100644 --- a/examples/projects/l0/gate_serialcom/node_config.h +++ b/examples/projects/l0/gate_serialcom/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/gpio/node_config.h b/examples/projects/l0/gpio/node_config.h index 7fe7991c3..5a5763ef5 100644 --- a/examples/projects/l0/gpio/node_config.h +++ b/examples/projects/l0/gpio/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 9 #define MAX_LOCAL_PROFILE_NUMBER 9 -#define MSG_BUFFER_SIZE 512 +#define MSG_BUFFER_SIZE 512 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/imu/node_config.h b/examples/projects/l0/imu/node_config.h index 202c62497..1e4692a87 100644 --- a/examples/projects/l0/imu/node_config.h +++ b/examples/projects/l0/imu/node_config.h @@ -47,8 +47,8 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 10 -#define MSG_BUFFER_SIZE 1024 +#define MAX_MSG_NB 10 +#define MSG_BUFFER_SIZE 1024 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * FLASH_SECTOR | FLASH page size * PAGE_SIZE | FLASH page size diff --git a/examples/projects/l0/inspector_serialcom/node_config.h b/examples/projects/l0/inspector_serialcom/node_config.h index 6fd9a9666..f4c20c348 100644 --- a/examples/projects/l0/inspector_serialcom/node_config.h +++ b/examples/projects/l0/inspector_serialcom/node_config.h @@ -71,19 +71,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/lcd/node_config.h b/examples/projects/l0/lcd/node_config.h index 45b5aa221..591039463 100644 --- a/examples/projects/l0/lcd/node_config.h +++ b/examples/projects/l0/lcd/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/led/node_config.h b/examples/projects/l0/led/node_config.h index 45b5aa221..d11f59555 100644 --- a/examples/projects/l0/led/node_config.h +++ b/examples/projects/l0/led/node_config.h @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/led_fader/node_config.h b/examples/projects/l0/led_fader/node_config.h index 45b5aa221..591039463 100644 --- a/examples/projects/l0/led_fader/node_config.h +++ b/examples/projects/l0/led_fader/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/led_strip/node_config.h b/examples/projects/l0/led_strip/node_config.h index 4c7d98934..c8510269e 100644 --- a/examples/projects/l0/led_strip/node_config.h +++ b/examples/projects/l0/led_strip/node_config.h @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/light_sensor/node_config.h b/examples/projects/l0/light_sensor/node_config.h index 45b5aa221..591039463 100644 --- a/examples/projects/l0/light_sensor/node_config.h +++ b/examples/projects/l0/light_sensor/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/load/node_config.h b/examples/projects/l0/load/node_config.h index 45b5aa221..591039463 100644 --- a/examples/projects/l0/load/node_config.h +++ b/examples/projects/l0/load/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/potentiometer/node_config.h b/examples/projects/l0/potentiometer/node_config.h index 45b5aa221..591039463 100644 --- a/examples/projects/l0/potentiometer/node_config.h +++ b/examples/projects/l0/potentiometer/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -68,19 +68,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/power_switch/node_config.h b/examples/projects/l0/power_switch/node_config.h index 65e537ff3..52cb97eab 100644 --- a/examples/projects/l0/power_switch/node_config.h +++ b/examples/projects/l0/power_switch/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/servo/node_config.h b/examples/projects/l0/servo/node_config.h index 24a31ae48..b668ab2c1 100644 --- a/examples/projects/l0/servo/node_config.h +++ b/examples/projects/l0/servo/node_config.h @@ -47,8 +47,8 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 4 -#define MAX_MSG_NB 10 -#define MSG_BUFFER_SIZE 512 +#define MAX_MSG_NB 10 +#define MSG_BUFFER_SIZE 512 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/l0/stepper/node_config.h b/examples/projects/l0/stepper/node_config.h index 65e537ff3..52cb97eab 100644 --- a/examples/projects/l0/stepper/node_config.h +++ b/examples/projects/l0/stepper/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/native/button/node_config.h b/examples/projects/native/button/node_config.h index 084b12960..2b7a9f49e 100644 --- a/examples/projects/native/button/node_config.h +++ b/examples/projects/native/button/node_config.h @@ -46,7 +46,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -67,19 +67,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/native/gate_wscom/node_config.h b/examples/projects/native/gate_wscom/node_config.h index 46aa0f3b7..94e496935 100644 --- a/examples/projects/native/gate_wscom/node_config.h +++ b/examples/projects/native/gate_wscom/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 200 +#define MAX_MSG_NB 200 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -69,19 +69,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/native/led/node_config.h b/examples/projects/native/led/node_config.h index 084b12960..2b7a9f49e 100644 --- a/examples/projects/native/led/node_config.h +++ b/examples/projects/native/led/node_config.h @@ -46,7 +46,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -67,19 +67,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler ******************************************************************************/ /******************************************************************************* diff --git a/examples/projects/native/ping_pong/node_config.h b/examples/projects/native/ping_pong/node_config.h index 97912b290..7ee6b3d71 100644 --- a/examples/projects/native/ping_pong/node_config.h +++ b/examples/projects/native/ping_pong/node_config.h @@ -70,19 +70,19 @@ * COM_RX | Rx USART Com Pin/Port/Alternate * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - * LUOS_COM_CLOCK_ENABLE | Enable clock for USART - * LUOS_COM | USART number - * LUOS_COM_IRQ | USART IRQ number - * LUOS_COM_IRQHANDLER | Callback function for USART IRQ handler + * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART + * ROBUS_COM | USART number + * ROBUS_COM_IRQ | USART IRQ number + * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - * LUOS_DMA_CLOCK_ENABLE | Enable clock for DMA - * LUOS_DMA | DMA number - * LUOS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) + * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA + * ROBUS_DMA | DMA number + * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - * LUOS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * LUOS_TIMER | Timer number - * LUOS_TIMER_IRQ | Timer IRQ number - * LUOS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler + * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer + * ROBUS_TIMER | Timer number + * ROBUS_TIMER_IRQ | Timer IRQ number + * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler * * WS_BROKER_ADDR | The broker adress in native mode. Default value is "ws://127.0.0.1:8000" ******************************************************************************/ diff --git a/network/robus_network/HAL/ATSAMD21/robus_hal.c b/network/robus_network/HAL/ATSAMD21/robus_hal.c index 9636840ab..e5d78d37d 100644 --- a/network/robus_network/HAL/ATSAMD21/robus_hal.c +++ b/network/robus_network/HAL/ATSAMD21/robus_hal.c @@ -85,56 +85,56 @@ void RobusHAL_ComInit(uint32_t Baudrate) { uint32_t baud = 0; // initialize clock - LUOS_COM_CLOCK_ENABLE(); + ROBUS_COM_CLOCK_ENABLE(); /* Disable the USART before configurations */ - LUOS_COM->USART_INT.SERCOM_CTRLA &= ~SERCOM_USART_INT_CTRLA_ENABLE_Msk; + ROBUS_COM->USART_INT.SERCOM_CTRLA &= ~SERCOM_USART_INT_CTRLA_ENABLE_Msk; /* Configure Baud Rate */ baud = 65536 - ((uint64_t)65536 * 16 * Baudrate) / MCUFREQ; - LUOS_COM->USART_INT.SERCOM_BAUD = SERCOM_USART_INT_BAUD_BAUD(baud); + ROBUS_COM->USART_INT.SERCOM_BAUD = SERCOM_USART_INT_BAUD_BAUD(baud); // Configures USART Clock Mode/ TXPO and RXPO/ Data Order/ Standby Mode/ Sampling rate/ IBON - LUOS_COM->USART_INT.SERCOM_CTRLA = SERCOM_USART_INT_CTRLA_MODE_USART_INT_CLK | SERCOM_USART_INT_CTRLA_RXPO(COM_RX_POS) + ROBUS_COM->USART_INT.SERCOM_CTRLA = SERCOM_USART_INT_CTRLA_MODE_USART_INT_CLK | SERCOM_USART_INT_CTRLA_RXPO(COM_RX_POS) | SERCOM_USART_INT_CTRLA_TXPO(COM_TX_POS) | SERCOM_USART_INT_CTRLA_DORD_Msk | SERCOM_USART_INT_CTRLA_IBON_Msk | SERCOM_USART_INT_CTRLA_FORM(0x0) | SERCOM_USART_INT_CTRLA_SAMPR(0); // Configures RXEN/ TXEN/ CHSIZE/ Parity/ Stop bits - LUOS_COM->USART_INT.SERCOM_CTRLB = SERCOM_USART_INT_CTRLB_CHSIZE_8_BIT | SERCOM_USART_INT_CTRLB_SBMODE_1_BIT + ROBUS_COM->USART_INT.SERCOM_CTRLB = SERCOM_USART_INT_CTRLB_CHSIZE_8_BIT | SERCOM_USART_INT_CTRLB_SBMODE_1_BIT | SERCOM_USART_INT_CTRLB_RXEN_Msk | SERCOM_USART_INT_CTRLB_TXEN_Msk | SERCOM_USART_INT_CTRLB_SFDE_Msk; /* Enable the UART after the configurations */ - LUOS_COM->USART_INT.SERCOM_CTRLA |= SERCOM_USART_INT_CTRLA_ENABLE_Msk; + ROBUS_COM->USART_INT.SERCOM_CTRLA |= SERCOM_USART_INT_CTRLA_ENABLE_Msk; /* Wait for sync */ - while (LUOS_COM->USART_INT.SERCOM_SYNCBUSY) + while (ROBUS_COM->USART_INT.SERCOM_SYNCBUSY) ; /* Clean IT */ - LUOS_COM->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_RESETVALUE; + ROBUS_COM->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_RESETVALUE; /* Enable Receive Complete interrupt */ - LUOS_COM->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_RXC_Msk; + ROBUS_COM->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_RXC_Msk; - NVIC_SetPriority(LUOS_COM_IRQ, 3); - NVIC_EnableIRQ(LUOS_COM_IRQ); + NVIC_SetPriority(ROBUS_COM_IRQ, 3); + NVIC_EnableIRQ(ROBUS_COM_IRQ); // Timeout Initialization timoutclockcnt = MCUFREQ / Baudrate; RobusHAL_TimeoutInit(); #ifndef USE_TX_IT - LUOS_DMA_CLOCK_ENABLE(); + ROBUS_DMA_CLOCK_ENABLE(); - LUOS_DMA->DMAC_BASEADDR = (uint32_t)&descriptor_section; - LUOS_DMA->DMAC_WRBADDR = (uint32_t)&write_back_section; - LUOS_DMA->DMAC_PRICTRL0 = DMAC_PRICTRL0_LVLPRI0(1UL) | DMAC_PRICTRL0_RRLVLEN0_Msk | DMAC_PRICTRL0_LVLPRI1(1UL) | DMAC_PRICTRL0_RRLVLEN1_Msk | DMAC_PRICTRL0_LVLPRI2(1UL) | DMAC_PRICTRL0_RRLVLEN2_Msk | DMAC_PRICTRL0_LVLPRI3(1UL) | DMAC_PRICTRL0_RRLVLEN3_Msk; - LUOS_DMA->DMAC_CHID = LUOS_DMA_CHANNEL; // DMA Channel - LUOS_DMA->DMAC_CHCTRLB = DMAC_CHCTRLB_TRIGACT(2) | DMAC_CHCTRLB_TRIGSRC(LUOS_DMA_TRIGGER) | DMAC_CHCTRLB_LVL(0); + ROBUS_DMA->DMAC_BASEADDR = (uint32_t)&descriptor_section; + ROBUS_DMA->DMAC_WRBADDR = (uint32_t)&write_back_section; + ROBUS_DMA->DMAC_PRICTRL0 = DMAC_PRICTRL0_LVLPRI0(1UL) | DMAC_PRICTRL0_RRLVLEN0_Msk | DMAC_PRICTRL0_LVLPRI1(1UL) | DMAC_PRICTRL0_RRLVLEN1_Msk | DMAC_PRICTRL0_LVLPRI2(1UL) | DMAC_PRICTRL0_RRLVLEN2_Msk | DMAC_PRICTRL0_LVLPRI3(1UL) | DMAC_PRICTRL0_RRLVLEN3_Msk; + ROBUS_DMA->DMAC_CHID = ROBUS_DMA_CHANNEL; // DMA Channel + ROBUS_DMA->DMAC_CHCTRLB = DMAC_CHCTRLB_TRIGACT(2) | DMAC_CHCTRLB_TRIGSRC(ROBUS_DMA_TRIGGER) | DMAC_CHCTRLB_LVL(0); descriptor_section.DMAC_BTCTRL = DMAC_BTCTRL_BLOCKACT_INT | DMAC_BTCTRL_BEATSIZE_BYTE | DMAC_BTCTRL_VALID_Msk | DMAC_BTCTRL_SRCINC_Msk; - LUOS_DMA->DMAC_CTRL = DMAC_CTRL_DMAENABLE_Msk | DMAC_CTRL_LVLEN0_Msk | DMAC_CTRL_LVLEN1_Msk | DMAC_CTRL_LVLEN2_Msk | DMAC_CTRL_LVLEN3_Msk; + ROBUS_DMA->DMAC_CTRL = DMAC_CTRL_DMAENABLE_Msk | DMAC_CTRL_LVLEN0_Msk | DMAC_CTRL_LVLEN1_Msk | DMAC_CTRL_LVLEN2_Msk | DMAC_CTRL_LVLEN3_Msk; #endif } /****************************************************************************** @@ -166,13 +166,13 @@ _CRITICAL void RobusHAL_SetTxState(uint8_t Enable) // Stop current transmit operation data_size_to_transmit = 0; // Disable Transmission empty buffer interrupt - LUOS_COM->USART_INT.SERCOM_INTENCLR = SERCOM_USART_INT_INTENCLR_DRE_Msk; // disable IT + ROBUS_COM->USART_INT.SERCOM_INTENCLR = SERCOM_USART_INT_INTENCLR_DRE_Msk; // disable IT #else - LUOS_DMA->DMAC_CHCTRLA &= ~DMAC_CHCTRLA_ENABLE_Msk; + ROBUS_DMA->DMAC_CHCTRLA &= ~DMAC_CHCTRLA_ENABLE_Msk; #endif // Disable Transmission complete interrupt - LUOS_COM->USART_INT.SERCOM_INTENCLR = SERCOM_USART_INT_INTENCLR_TXC_Msk; // disable IT - LUOS_COM->USART_INT.SERCOM_INTFLAG = SERCOM_USART_INT_INTFLAG_RXS_Msk; + ROBUS_COM->USART_INT.SERCOM_INTENCLR = SERCOM_USART_INT_INTENCLR_TXC_Msk; // disable IT + ROBUS_COM->USART_INT.SERCOM_INTFLAG = SERCOM_USART_INT_INTFLAG_RXS_Msk; } } @@ -185,15 +185,15 @@ _CRITICAL void RobusHAL_SetRxState(uint8_t Enable) { if (Enable == true) { - while ((LUOS_COM->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTFLAG_RXC_Msk) == SERCOM_USART_INT_INTFLAG_RXC_Msk) + while ((ROBUS_COM->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTFLAG_RXC_Msk) == SERCOM_USART_INT_INTFLAG_RXC_Msk) { - LUOS_COM->USART_INT.SERCOM_DATA; // clear data buffer + ROBUS_COM->USART_INT.SERCOM_DATA; // clear data buffer } - LUOS_COM->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_RXC_Msk; + ROBUS_COM->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_RXC_Msk; } else { - LUOS_COM->USART_INT.SERCOM_INTENCLR = SERCOM_USART_INT_INTENCLR_RXC_Msk; + ROBUS_COM->USART_INT.SERCOM_INTENCLR = SERCOM_USART_INT_INTENCLR_RXC_Msk; } } /****************************************************************************** @@ -201,31 +201,31 @@ _CRITICAL void RobusHAL_SetRxState(uint8_t Enable) * @param None * @return None ******************************************************************************/ -_CRITICAL void LUOS_COM_IRQHANDLER() +_CRITICAL void ROBUS_COM_IRQHANDLER() { // Reset timeout to it's default value RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); // reception management - if (((LUOS_COM->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTFLAG_RXC_Msk) == SERCOM_USART_INT_INTFLAG_RXC_Msk) && ((LUOS_COM->USART_INT.SERCOM_INTENSET & SERCOM_USART_INT_INTENSET_RXC_Msk) == SERCOM_USART_INT_INTENSET_RXC_Msk)) + if (((ROBUS_COM->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTFLAG_RXC_Msk) == SERCOM_USART_INT_INTFLAG_RXC_Msk) && ((ROBUS_COM->USART_INT.SERCOM_INTENSET & SERCOM_USART_INT_INTENSET_RXC_Msk) == SERCOM_USART_INT_INTENSET_RXC_Msk)) { // clean start bit detection - uint8_t data = LUOS_COM->USART_INT.SERCOM_DATA; + uint8_t data = ROBUS_COM->USART_INT.SERCOM_DATA; Recep_data(&data); if (data_size_to_transmit == 0) { - LUOS_COM->USART_INT.SERCOM_STATUS = SERCOM_USART_INT_STATUS_PERR_Msk | SERCOM_USART_INT_STATUS_FERR_Msk | SERCOM_USART_INT_STATUS_BUFOVF_Msk; - LUOS_COM->USART_INT.SERCOM_INTFLAG = SERCOM_USART_INT_INTFLAG_RXS_Msk; + ROBUS_COM->USART_INT.SERCOM_STATUS = SERCOM_USART_INT_STATUS_PERR_Msk | SERCOM_USART_INT_STATUS_FERR_Msk | SERCOM_USART_INT_STATUS_BUFOVF_Msk; + ROBUS_COM->USART_INT.SERCOM_INTFLAG = SERCOM_USART_INT_INTFLAG_RXS_Msk; return; } } - else if ((LUOS_COM->USART_INT.SERCOM_STATUS & SERCOM_USART_INT_STATUS_FERR_Msk) == SERCOM_USART_INT_STATUS_FERR_Msk) + else if ((ROBUS_COM->USART_INT.SERCOM_STATUS & SERCOM_USART_INT_STATUS_FERR_Msk) == SERCOM_USART_INT_STATUS_FERR_Msk) { ctx.rx.status.rx_framing_error = true; } // Transmission management - if (((LUOS_COM->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTFLAG_TXC_Msk) == SERCOM_USART_INT_INTFLAG_TXC_Msk) && ((LUOS_COM->USART_INT.SERCOM_INTENSET & SERCOM_USART_INT_INTENSET_TXC_Msk) == SERCOM_USART_INT_INTENSET_TXC_Msk)) + if (((ROBUS_COM->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTFLAG_TXC_Msk) == SERCOM_USART_INT_INTFLAG_TXC_Msk) && ((ROBUS_COM->USART_INT.SERCOM_INTENSET & SERCOM_USART_INT_INTENSET_TXC_Msk) == SERCOM_USART_INT_INTENSET_TXC_Msk)) { // Transmission complete data_size_to_transmit = 0; @@ -233,28 +233,28 @@ _CRITICAL void LUOS_COM_IRQHANDLER() RobusHAL_SetTxState(false); RobusHAL_SetRxState(true); // Disable transmission complete IRQ - LUOS_COM->USART_INT.SERCOM_INTFLAG = SERCOM_USART_INT_INTFLAG_TXC_Msk; // clear flag - LUOS_COM->USART_INT.SERCOM_INTENCLR = SERCOM_USART_INT_INTENCLR_TXC_Msk; // disable IT + ROBUS_COM->USART_INT.SERCOM_INTFLAG = SERCOM_USART_INT_INTFLAG_TXC_Msk; // clear flag + ROBUS_COM->USART_INT.SERCOM_INTENCLR = SERCOM_USART_INT_INTENCLR_TXC_Msk; // disable IT } #ifdef USE_TX_IT - else if (((LUOS_COM->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTFLAG_DRE_Msk) == SERCOM_USART_INT_INTFLAG_DRE_Msk) && ((LUOS_COM->USART_INT.SERCOM_INTENSET & SERCOM_USART_INT_INTENSET_DRE_Msk) == SERCOM_USART_INT_INTENSET_DRE_Msk)) + else if (((ROBUS_COM->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTFLAG_DRE_Msk) == SERCOM_USART_INT_INTFLAG_DRE_Msk) && ((ROBUS_COM->USART_INT.SERCOM_INTENSET & SERCOM_USART_INT_INTENSET_DRE_Msk) == SERCOM_USART_INT_INTENSET_DRE_Msk)) { // Transmit buffer empty (this is a software DMA) data_size_to_transmit--; - LUOS_COM->USART_INT.SERCOM_DATA = *(tx_data++); + ROBUS_COM->USART_INT.SERCOM_DATA = *(tx_data++); if (data_size_to_transmit == 0) { // Transmission complete, stop loading data and watch for the end of transmission // Disable Transmission empty buffer interrupt - LUOS_COM->USART_INT.SERCOM_INTFLAG = SERCOM_USART_INT_INTFLAG_DRE_Msk; // clear flag - LUOS_COM->USART_INT.SERCOM_INTENCLR = SERCOM_USART_INT_INTENCLR_DRE_Msk; // disable IT + ROBUS_COM->USART_INT.SERCOM_INTFLAG = SERCOM_USART_INT_INTFLAG_DRE_Msk; // clear flag + ROBUS_COM->USART_INT.SERCOM_INTENCLR = SERCOM_USART_INT_INTENCLR_DRE_Msk; // disable IT // Enable Transmission complete interrupt - LUOS_COM->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_TXC_Msk; // disable IT + ROBUS_COM->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_TXC_Msk; // disable IT } } #endif - LUOS_COM->USART_INT.SERCOM_STATUS = SERCOM_USART_INT_STATUS_PERR_Msk | SERCOM_USART_INT_STATUS_FERR_Msk | SERCOM_USART_INT_STATUS_BUFOVF_Msk; - LUOS_COM->USART_INT.SERCOM_INTFLAG = SERCOM_USART_INT_INTFLAG_RXS_Msk; + ROBUS_COM->USART_INT.SERCOM_STATUS = SERCOM_USART_INT_STATUS_PERR_Msk | SERCOM_USART_INT_STATUS_FERR_Msk | SERCOM_USART_INT_STATUS_BUFOVF_Msk; + ROBUS_COM->USART_INT.SERCOM_INTFLAG = SERCOM_USART_INT_INTFLAG_RXS_Msk; } /****************************************************************************** * @brief Process data transmit @@ -263,7 +263,7 @@ _CRITICAL void LUOS_COM_IRQHANDLER() ******************************************************************************/ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) { - while ((LUOS_COM->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTFLAG_DRE_Msk) != SERCOM_USART_INT_INTFLAG_DRE_Msk) + while ((ROBUS_COM->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTFLAG_DRE_Msk) != SERCOM_USART_INT_INTFLAG_DRE_Msk) ; // Disable RX detec pin if needed @@ -277,20 +277,20 @@ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) tx_data = data; #ifdef USE_TX_IT // Send the first byte - LUOS_COM->USART_INT.SERCOM_DATA = *(tx_data++); + ROBUS_COM->USART_INT.SERCOM_DATA = *(tx_data++); // Enable Transmission empty buffer interrupt to transmit next datas - LUOS_COM->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_DRE_Msk; // enable IT + ROBUS_COM->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_DRE_Msk; // enable IT // Disable Transmission complete interrupt - LUOS_COM->USART_INT.SERCOM_INTENCLR = SERCOM_USART_INT_INTENCLR_TXC_Msk; // disable IT + ROBUS_COM->USART_INT.SERCOM_INTENCLR = SERCOM_USART_INT_INTENCLR_TXC_Msk; // disable IT #else data_size_to_transmit = 0; // to not check IT TC during collision descriptor_section.DMAC_SRCADDR = (uint32_t)(data + size); - descriptor_section.DMAC_DSTADDR = (uint32_t)&LUOS_COM->USART_INT.SERCOM_DATA; + descriptor_section.DMAC_DSTADDR = (uint32_t)&ROBUS_COM->USART_INT.SERCOM_DATA; descriptor_section.DMAC_BTCNT = size; // Enable TX RobusHAL_SetTxState(true); - LUOS_DMA->DMAC_CHCTRLA |= DMAC_CHCTRLA_ENABLE_Msk; - LUOS_COM->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_TXC_Msk; // enable IT + ROBUS_DMA->DMAC_CHCTRLA |= DMAC_CHCTRLA_ENABLE_Msk; + ROBUS_COM->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_TXC_Msk; // enable IT #endif } else @@ -298,14 +298,14 @@ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) // Wait before send ack data_size_to_transmit = 1; // This is a patch du to difference MCU frequency - while (LUOS_TIMER->COUNT16.TC_COUNT < (0xFFFF - (timoutclockcnt * (DEFAULT_TIMEOUT - TIMEOUT_ACK)))) + while (ROBUS_TIMER->COUNT16.TC_COUNT < (0xFFFF - (timoutclockcnt * (DEFAULT_TIMEOUT - TIMEOUT_ACK)))) ; // Enable TX RobusHAL_SetTxState(true); // Transmit the only byte we have - LUOS_COM->USART_INT.SERCOM_DATA = *data; + ROBUS_COM->USART_INT.SERCOM_DATA = *data; // Enable Transmission complete interrupt because we only have one. - LUOS_COM->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_TXC_Msk; // enable IT + ROBUS_COM->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENSET_TXC_Msk; // enable IT } RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); } @@ -337,9 +337,9 @@ _CRITICAL void RobusHAL_SetRxDetecPin(uint8_t Enable) _CRITICAL uint8_t RobusHAL_GetTxLockState(void) { uint8_t result = false; - if ((LUOS_COM->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTFLAG_RXS_Msk) == SERCOM_USART_INT_INTFLAG_RXS_Msk) + if ((ROBUS_COM->USART_INT.SERCOM_INTFLAG & SERCOM_USART_INT_INTFLAG_RXS_Msk) == SERCOM_USART_INT_INTFLAG_RXS_Msk) { - LUOS_COM->USART_INT.SERCOM_INTFLAG = SERCOM_USART_INT_INTFLAG_RXS_Msk; + ROBUS_COM->USART_INT.SERCOM_INTFLAG = SERCOM_USART_INT_INTFLAG_RXS_Msk; RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); result = true; } @@ -370,22 +370,22 @@ _CRITICAL uint8_t RobusHAL_GetTxLockState(void) static void RobusHAL_TimeoutInit(void) { // initialize clock - LUOS_TIMER_CLOCK_ENABLE(); + ROBUS_TIMER_CLOCK_ENABLE(); - LUOS_TIMER->COUNT16.TC_CTRLA = TC_CTRLA_RESETVALUE; - while ((LUOS_TIMER->COUNT16.TC_STATUS & TC_STATUS_SYNCBUSY_Msk)) + ROBUS_TIMER->COUNT16.TC_CTRLA = TC_CTRLA_RESETVALUE; + while ((ROBUS_TIMER->COUNT16.TC_STATUS & TC_STATUS_SYNCBUSY_Msk)) ; /* Configure counter mode & prescaler */ - LUOS_TIMER->COUNT16.TC_CTRLA = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV1 | TC_CTRLA_WAVEGEN_MPWM; - LUOS_TIMER->COUNT16.TC_CTRLBSET = TC_CTRLBSET_ONESHOT_Msk; + ROBUS_TIMER->COUNT16.TC_CTRLA = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV1 | TC_CTRLA_WAVEGEN_MPWM; + ROBUS_TIMER->COUNT16.TC_CTRLBSET = TC_CTRLBSET_ONESHOT_Msk; - LUOS_TIMER->COUNT16.TC_COUNT = 0xFFFF - (timoutclockcnt * DEFAULT_TIMEOUT); + ROBUS_TIMER->COUNT16.TC_COUNT = 0xFFFF - (timoutclockcnt * DEFAULT_TIMEOUT); /* Clear all interrupt flags */ - LUOS_TIMER->COUNT16.TC_INTENSET = TC_INTENSET_RESETVALUE; - LUOS_TIMER->COUNT16.TC_INTENSET = TC_INTENSET_OVF_Msk; + ROBUS_TIMER->COUNT16.TC_INTENSET = TC_INTENSET_RESETVALUE; + ROBUS_TIMER->COUNT16.TC_INTENSET = TC_INTENSET_OVF_Msk; - NVIC_SetPriority(LUOS_TIMER_IRQ, 3); - NVIC_EnableIRQ(LUOS_TIMER_IRQ); + NVIC_SetPriority(ROBUS_TIMER_IRQ, 3); + NVIC_EnableIRQ(ROBUS_TIMER_IRQ); } /****************************************************************************** * @brief Luos Timeout for Rx communication @@ -394,13 +394,13 @@ static void RobusHAL_TimeoutInit(void) ******************************************************************************/ _CRITICAL void RobusHAL_ResetTimeout(uint16_t nbrbit) { - NVIC_ClearPendingIRQ(LUOS_TIMER_IRQ); // clear IT pending - LUOS_TIMER->COUNT16.TC_INTFLAG = TC_INTFLAG_OVF_Msk; // clear flag - LUOS_TIMER->COUNT16.TC_CTRLA &= ~TC_CTRLA_ENABLE_Msk; + NVIC_ClearPendingIRQ(ROBUS_TIMER_IRQ); // clear IT pending + ROBUS_TIMER->COUNT16.TC_INTFLAG = TC_INTFLAG_OVF_Msk; // clear flag + ROBUS_TIMER->COUNT16.TC_CTRLA &= ~TC_CTRLA_ENABLE_Msk; if (nbrbit != 0) { - LUOS_TIMER->COUNT16.TC_COUNT = 0xFFFF - (timoutclockcnt * nbrbit); - LUOS_TIMER->COUNT16.TC_CTRLA |= TC_CTRLA_ENABLE_Msk; + ROBUS_TIMER->COUNT16.TC_COUNT = 0xFFFF - (timoutclockcnt * nbrbit); + ROBUS_TIMER->COUNT16.TC_CTRLA |= TC_CTRLA_ENABLE_Msk; } } /****************************************************************************** @@ -408,11 +408,11 @@ _CRITICAL void RobusHAL_ResetTimeout(uint16_t nbrbit) * @param None * @return None ******************************************************************************/ -_CRITICAL void LUOS_TIMER_IRQHANDLER() +_CRITICAL void ROBUS_TIMER_IRQHANDLER() { - if ((LUOS_TIMER->COUNT16.TC_INTFLAG & TC_INTFLAG_OVF_Msk) == TC_INTFLAG_OVF_Msk) + if ((ROBUS_TIMER->COUNT16.TC_INTFLAG & TC_INTFLAG_OVF_Msk) == TC_INTFLAG_OVF_Msk) { - LUOS_TIMER->COUNT16.TC_INTFLAG = TC_INTFLAG_OVF_Msk; // clear + ROBUS_TIMER->COUNT16.TC_INTFLAG = TC_INTFLAG_OVF_Msk; // clear if ((ctx.tx.lock == true) && (RobusHAL_GetTxLockState() == false)) { RobusHAL_SetTxState(false); diff --git a/network/robus_network/HAL/ATSAMD21/robus_hal_config.h b/network/robus_network/HAL/ATSAMD21/robus_hal_config.h index 7fe568a60..1c23d065c 100644 --- a/network/robus_network/HAL/ATSAMD21/robus_hal_config.h +++ b/network/robus_network/HAL/ATSAMD21/robus_hal_config.h @@ -119,61 +119,61 @@ /******************************************************************************* * COM CONFIG ******************************************************************************/ -#ifndef LUOS_COM_CLOCK_ENABLE - #define LUOS_COM_CLOCK_ENABLE() \ +#ifndef ROBUS_COM_CLOCK_ENABLE + #define ROBUS_COM_CLOCK_ENABLE() \ do \ { \ GCLK_REGS->GCLK_CLKCTRL = GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_SERCOM0_CORE_Val) | GCLK_CLKCTRL_GEN(0x0) | GCLK_CLKCTRL_CLKEN_Msk; \ PM_REGS->PM_APBCMASK |= PM_APBCMASK_SERCOM0_Msk; \ } while (0U) #endif -#ifndef LUOS_COM - #define LUOS_COM SERCOM0_REGS +#ifndef ROBUS_COM + #define ROBUS_COM SERCOM0_REGS #endif -#ifndef LUOS_COM_IRQ - #define LUOS_COM_IRQ SERCOM0_IRQn +#ifndef ROBUS_COM_IRQ + #define ROBUS_COM_IRQ SERCOM0_IRQn #endif -#ifndef LUOS_COM_IRQHANDLER - #define LUOS_COM_IRQHANDLER() SERCOM0_Handler() +#ifndef ROBUS_COM_IRQHANDLER + #define ROBUS_COM_IRQHANDLER() SERCOM0_Handler() #endif /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#ifndef LUOS_DMA_CLOCK_ENABLE - #define LUOS_DMA_CLOCK_ENABLE() \ +#ifndef ROBUS_DMA_CLOCK_ENABLE + #define ROBUS_DMA_CLOCK_ENABLE() \ do \ { \ PM_REGS->PM_AHBMASK |= PM_AHBMASK_DMAC_Msk; \ } while (0U) #endif -#ifndef LUOS_DMA - #define LUOS_DMA DMAC_REGS +#ifndef ROBUS_DMA + #define ROBUS_DMA DMAC_REGS #endif -#ifndef LUOS_DMA_TRIGGER - #define LUOS_DMA_TRIGGER 2 +#ifndef ROBUS_DMA_TRIGGER + #define ROBUS_DMA_TRIGGER 2 #endif -#ifndef LUOS_DMA_CHANNEL - #define LUOS_DMA_CHANNEL 0 +#ifndef ROBUS_DMA_CHANNEL + #define ROBUS_DMA_CHANNEL 0 #endif /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#ifndef LUOS_TIMER_CLOCK_ENABLE - #define LUOS_TIMER_CLOCK_ENABLE() \ +#ifndef ROBUS_TIMER_CLOCK_ENABLE + #define ROBUS_TIMER_CLOCK_ENABLE() \ do \ { \ GCLK_REGS->GCLK_CLKCTRL = GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_TCC2_TC3_Val) | GCLK_CLKCTRL_GEN(0x0) | GCLK_CLKCTRL_CLKEN_Msk; \ PM_REGS->PM_APBCMASK |= PM_APBCMASK_TC3_Msk; \ } while (0U) #endif -#ifndef LUOS_TIMER - #define LUOS_TIMER TC3_REGS +#ifndef ROBUS_TIMER + #define ROBUS_TIMER TC3_REGS #endif -#ifndef LUOS_TIMER_IRQ - #define LUOS_TIMER_IRQ TC3_IRQn +#ifndef ROBUS_TIMER_IRQ + #define ROBUS_TIMER_IRQ TC3_IRQn #endif -#ifndef LUOS_TIMER_IRQHANDLER - #define LUOS_TIMER_IRQHANDLER() TC3_Handler() +#ifndef ROBUS_TIMER_IRQHANDLER + #define ROBUS_TIMER_IRQHANDLER() TC3_Handler() #endif #endif /* _RobusHAL_CONFIG_H_ */ diff --git a/network/robus_network/HAL/ATSAMD21_ARDUINO/board_config.h b/network/robus_network/HAL/ATSAMD21_ARDUINO/board_config.h index dfc684e43..d02698489 100644 --- a/network/robus_network/HAL/ATSAMD21_ARDUINO/board_config.h +++ b/network/robus_network/HAL/ATSAMD21_ARDUINO/board_config.h @@ -13,46 +13,46 @@ #include #if defined(ARDUINO_SAMD_ZERO) - #define LUOS_COM_CLOCK_ENABLE() \ + #define ROBUS_COM_CLOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_SERCOM0_CORE_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ PM->APBCMASK.reg |= PM_APBCMASK_SERCOM0; \ } while (0U) - #define LUOS_COM SERCOM0 - #define LUOS_COM_IRQ SERCOM0_IRQn - #define LUOS_COM_IRQHANDLER() SERCOM0_Handler() - #define LUOS_DMA_TRIGGER 2 + #define ROBUS_COM SERCOM0 + #define ROBUS_COM_IRQ SERCOM0_IRQn + #define ROBUS_COM_IRQHANDLER() SERCOM0_Handler() + #define ROBUS_DMA_TRIGGER 2 #endif #if (defined(ARDUINO_SAMD_MKR1000) || defined(ARDUINO_SAMD_MKRWIFI1010) || defined(ARDUINO_SAMD_MKRFox1200) \ || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) || defined(ARDUINO_SAMD_MKRGSM1400) \ || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRZERO) || defined(ARDUINO_SAMD_NANO_33_IOT) \ || defined(SAMD_MKRVIDOR4000)) - #define LUOS_COM_CLOCK_ENABLE() \ + #define ROBUS_COM_CLOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_SERCOM5_CORE_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ PM->APBCMASK.reg |= PM_APBCMASK_SERCOM5; \ } while (0U) - #define LUOS_COM SERCOM5 - #define LUOS_COM_IRQ SERCOM5_IRQn - #define LUOS_COM_IRQHANDLER() SERCOM5_Handler() - #define LUOS_DMA_TRIGGER 12 + #define ROBUS_COM SERCOM5 + #define ROBUS_COM_IRQ SERCOM5_IRQn + #define ROBUS_COM_IRQHANDLER() SERCOM5_Handler() + #define ROBUS_DMA_TRIGGER 12 #endif #if defined(SEEED_XIAO_M0) - #define LUOS_COM_CLOCK_ENABLE() \ + #define ROBUS_COM_CLOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_SERCOM4_CORE_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ PM->APBCMASK.reg |= PM_APBCMASK_SERCOM4; \ } while (0U) - #define LUOS_COM SERCOM4 - #define LUOS_COM_IRQ SERCOM4_IRQn - #define LUOS_COM_IRQHANDLER() SERCOM4_Handler() - #define LUOS_DMA_TRIGGER SERCOM4_DMAC_ID_TX + #define ROBUS_COM SERCOM4 + #define ROBUS_COM_IRQ SERCOM4_IRQn + #define ROBUS_COM_IRQHANDLER() SERCOM4_Handler() + #define ROBUS_DMA_TRIGGER SERCOM4_DMAC_ID_TX #define COM_TX_POS 0 // PAD0 #define COM_RX_POS 1 // PAD1 diff --git a/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.c b/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.c index 9667c916f..6ca7b35ac 100644 --- a/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.c +++ b/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.c @@ -89,56 +89,56 @@ void RobusHAL_ComInit(uint32_t Baudrate) { uint32_t baud = 0; // initialize clock - LUOS_COM_CLOCK_ENABLE(); + ROBUS_COM_CLOCK_ENABLE(); /* Disable the USART before configurations */ - LUOS_COM->USART.CTRLA.reg &= ~SERCOM_USART_CTRLA_ENABLE; + ROBUS_COM->USART.CTRLA.reg &= ~SERCOM_USART_CTRLA_ENABLE; /* Configure Baud Rate */ baud = 65536 - ((uint64_t)65536 * 16 * Baudrate) / MCUFREQ; - LUOS_COM->USART.BAUD.reg = SERCOM_USART_BAUD_BAUD(baud); + ROBUS_COM->USART.BAUD.reg = SERCOM_USART_BAUD_BAUD(baud); // Configures USART Clock Mode/ TXPO and RXPO/ Data Order/ Standby Mode/ Sampling rate/ IBON - LUOS_COM->USART.CTRLA.reg = SERCOM_USART_CTRLA_MODE_USART_INT_CLK | SERCOM_USART_CTRLA_RXPO(COM_RX_POS) + ROBUS_COM->USART.CTRLA.reg = SERCOM_USART_CTRLA_MODE_USART_INT_CLK | SERCOM_USART_CTRLA_RXPO(COM_RX_POS) | SERCOM_USART_CTRLA_TXPO(COM_TX_POS) | SERCOM_USART_CTRLA_DORD | SERCOM_USART_CTRLA_IBON | SERCOM_USART_CTRLA_FORM(0x0) | SERCOM_USART_CTRLA_SAMPR(0); // Configures RXEN/ TXEN/ CHSIZE/ Parity/ Stop bits - LUOS_COM->USART.CTRLB.reg = SERCOM_USART_CTRLB_CHSIZE(0) | SERCOM_USART_CTRLB_SBMODE + ROBUS_COM->USART.CTRLB.reg = SERCOM_USART_CTRLB_CHSIZE(0) | SERCOM_USART_CTRLB_SBMODE | SERCOM_USART_CTRLB_RXEN | SERCOM_USART_CTRLB_TXEN | SERCOM_USART_CTRLB_SFDE; /* Enable the UART after the configurations */ - LUOS_COM->USART.CTRLA.reg |= SERCOM_USART_CTRLA_ENABLE; + ROBUS_COM->USART.CTRLA.reg |= SERCOM_USART_CTRLA_ENABLE; /* Wait for sync */ - while (LUOS_COM->USART.SYNCBUSY.bit.ENABLE) + while (ROBUS_COM->USART.SYNCBUSY.bit.ENABLE) ; /* Clean IT */ - LUOS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_RESETVALUE; + ROBUS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_RESETVALUE; /* Enable Receive Complete interrupt */ - LUOS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_RXC; + ROBUS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_RXC; - NVIC_SetPriority(LUOS_COM_IRQ, 3); - NVIC_EnableIRQ(LUOS_COM_IRQ); + NVIC_SetPriority(ROBUS_COM_IRQ, 3); + NVIC_EnableIRQ(ROBUS_COM_IRQ); // Timeout Initialization timoutclockcnt = MCUFREQ / Baudrate; RobusHAL_TimeoutInit(); #ifndef USE_TX_IT - LUOS_DMA_CLOCK_ENABLE(); + ROBUS_DMA_CLOCK_ENABLE(); - LUOS_DMA->BASEADDR.reg = (uint32_t)&descriptor_section; - LUOS_DMA->WRBADDR.reg = (uint32_t)&write_back_section; - LUOS_DMA->PRICTRL0.reg = DMAC_PRICTRL0_LVLPRI0(1UL) | DMAC_PRICTRL0_RRLVLEN0 | DMAC_PRICTRL0_LVLPRI1(1UL) | DMAC_PRICTRL0_RRLVLEN1 | DMAC_PRICTRL0_LVLPRI2(1UL) | DMAC_PRICTRL0_RRLVLEN2 | DMAC_PRICTRL0_LVLPRI3(1UL) | DMAC_PRICTRL0_RRLVLEN3; - LUOS_DMA->CHID.reg = LUOS_DMA_CHANNEL; // DMA Channel - LUOS_DMA->CHCTRLB.reg = DMAC_CHCTRLB_TRIGACT(2) | DMAC_CHCTRLB_TRIGSRC(LUOS_DMA_TRIGGER) | DMAC_CHCTRLB_LVL(0); + ROBUS_DMA->BASEADDR.reg = (uint32_t)&descriptor_section; + ROBUS_DMA->WRBADDR.reg = (uint32_t)&write_back_section; + ROBUS_DMA->PRICTRL0.reg = DMAC_PRICTRL0_LVLPRI0(1UL) | DMAC_PRICTRL0_RRLVLEN0 | DMAC_PRICTRL0_LVLPRI1(1UL) | DMAC_PRICTRL0_RRLVLEN1 | DMAC_PRICTRL0_LVLPRI2(1UL) | DMAC_PRICTRL0_RRLVLEN2 | DMAC_PRICTRL0_LVLPRI3(1UL) | DMAC_PRICTRL0_RRLVLEN3; + ROBUS_DMA->CHID.reg = ROBUS_DMA_CHANNEL; // DMA Channel + ROBUS_DMA->CHCTRLB.reg = DMAC_CHCTRLB_TRIGACT(2) | DMAC_CHCTRLB_TRIGSRC(ROBUS_DMA_TRIGGER) | DMAC_CHCTRLB_LVL(0); descriptor_section.BTCTRL.reg = DMAC_BTCTRL_BLOCKACT_INT | DMAC_BTCTRL_BEATSIZE_BYTE | DMAC_BTCTRL_VALID | DMAC_BTCTRL_SRCINC; - LUOS_DMA->CTRL.reg = DMAC_CTRL_DMAENABLE | DMAC_CTRL_LVLEN0 | DMAC_CTRL_LVLEN1 | DMAC_CTRL_LVLEN2 | DMAC_CTRL_LVLEN3; + ROBUS_DMA->CTRL.reg = DMAC_CTRL_DMAENABLE | DMAC_CTRL_LVLEN0 | DMAC_CTRL_LVLEN1 | DMAC_CTRL_LVLEN2 | DMAC_CTRL_LVLEN3; #endif } /****************************************************************************** @@ -170,13 +170,13 @@ _CRITICAL void RobusHAL_SetTxState(uint8_t Enable) // Stop current transmit operation data_size_to_transmit = 0; // Disable Transmission empty buffer interrupt - LUOS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_DRE; // disable IT + ROBUS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_DRE; // disable IT #else - LUOS_DMA->CHCTRLA.reg &= ~DMAC_CHCTRLA_ENABLE; + ROBUS_DMA->CHCTRLA.reg &= ~DMAC_CHCTRLA_ENABLE; #endif // Disable Transmission complete interrupt - LUOS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_TXC; // disable IT - LUOS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start + ROBUS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_TXC; // disable IT + ROBUS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start } } /****************************************************************************** @@ -188,15 +188,15 @@ _CRITICAL void RobusHAL_SetRxState(uint8_t Enable) { if (Enable == true) { - while ((LUOS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_RXC) == SERCOM_USART_INTFLAG_RXC) + while ((ROBUS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_RXC) == SERCOM_USART_INTFLAG_RXC) { - LUOS_COM->USART.DATA.reg; + ROBUS_COM->USART.DATA.reg; } - LUOS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_RXC; + ROBUS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_RXC; } else { - LUOS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_RXC; + ROBUS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_RXC; } } /****************************************************************************** @@ -204,31 +204,31 @@ _CRITICAL void RobusHAL_SetRxState(uint8_t Enable) * @param None * @return None ******************************************************************************/ -_CRITICAL void LUOS_COM_IRQHANDLER() +_CRITICAL void ROBUS_COM_IRQHANDLER() { // Reset timeout to it's default value RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); // reception management - if (((LUOS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_RXC) == SERCOM_USART_INTFLAG_RXC) && ((LUOS_COM->USART.INTENSET.reg & SERCOM_USART_INTENSET_RXC) == SERCOM_USART_INTENSET_RXC)) + if (((ROBUS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_RXC) == SERCOM_USART_INTFLAG_RXC) && ((ROBUS_COM->USART.INTENSET.reg & SERCOM_USART_INTENSET_RXC) == SERCOM_USART_INTENSET_RXC)) { // clean start bit detection - uint8_t data = LUOS_COM->USART.DATA.reg; + uint8_t data = ROBUS_COM->USART.DATA.reg; Recep_data(&data); if (data_size_to_transmit == 0) { - LUOS_COM->USART.STATUS.reg = SERCOM_USART_STATUS_PERR | SERCOM_USART_STATUS_FERR | SERCOM_USART_STATUS_BUFOVF; - LUOS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start + ROBUS_COM->USART.STATUS.reg = SERCOM_USART_STATUS_PERR | SERCOM_USART_STATUS_FERR | SERCOM_USART_STATUS_BUFOVF; + ROBUS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start return; } } - else if ((LUOS_COM->USART.STATUS.reg & SERCOM_USART_STATUS_FERR) == SERCOM_USART_STATUS_FERR) // check error on ligne + else if ((ROBUS_COM->USART.STATUS.reg & SERCOM_USART_STATUS_FERR) == SERCOM_USART_STATUS_FERR) // check error on ligne { ctx.rx.status.rx_framing_error = true; } // Transmission management - if (((LUOS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_TXC) == SERCOM_USART_INTFLAG_TXC) && ((LUOS_COM->USART.INTENSET.reg & SERCOM_USART_INTENSET_TXC) == SERCOM_USART_INTENSET_TXC)) + if (((ROBUS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_TXC) == SERCOM_USART_INTFLAG_TXC) && ((ROBUS_COM->USART.INTENSET.reg & SERCOM_USART_INTENSET_TXC) == SERCOM_USART_INTENSET_TXC)) { // Transmission complete data_size_to_transmit = 0; @@ -236,28 +236,28 @@ _CRITICAL void LUOS_COM_IRQHANDLER() RobusHAL_SetTxState(false); RobusHAL_SetRxState(true); // Disable transmission complete IRQ - LUOS_COM->USART.INTFLAG.reg = SERCOM_USART_INTFLAG_TXC; // clear flag - LUOS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_TXC; // disable IT + ROBUS_COM->USART.INTFLAG.reg = SERCOM_USART_INTFLAG_TXC; // clear flag + ROBUS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_TXC; // disable IT } #ifdef USE_TX_IT - else if (((LUOS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_DRE) == SERCOM_USART_INTFLAG_DRE) && ((LUOS_COM->USART.INTENSET.reg & SERCOM_USART_INTENSET_DRE) == SERCOM_USART_INTENSET_DRE)) + else if (((ROBUS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_DRE) == SERCOM_USART_INTFLAG_DRE) && ((ROBUS_COM->USART.INTENSET.reg & SERCOM_USART_INTENSET_DRE) == SERCOM_USART_INTENSET_DRE)) { // Transmit buffer empty (this is a software DMA) data_size_to_transmit--; - LUOS_COM->USART.DATA.reg = *(tx_data++); + ROBUS_COM->USART.DATA.reg = *(tx_data++); if (data_size_to_transmit == 0) { // Transmission complete, stop loading data and watch for the end of transmission // Disable Transmission empty buffer interrupt - LUOS_COM->USART.INTFLAG.reg = SERCOM_USART_INTFLAG_DRE; // clear flag - LUOS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_DRE; // disable IT + ROBUS_COM->USART.INTFLAG.reg = SERCOM_USART_INTFLAG_DRE; // clear flag + ROBUS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_DRE; // disable IT // Enable Transmission complete interrupt - LUOS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_TXC; // disable IT + ROBUS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_TXC; // disable IT } } #endif - LUOS_COM->USART.STATUS.reg = SERCOM_USART_STATUS_PERR | SERCOM_USART_STATUS_FERR | SERCOM_USART_STATUS_BUFOVF; - LUOS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start + ROBUS_COM->USART.STATUS.reg = SERCOM_USART_STATUS_PERR | SERCOM_USART_STATUS_FERR | SERCOM_USART_STATUS_BUFOVF; + ROBUS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start } /****************************************************************************** * @brief Process data transmit @@ -266,7 +266,7 @@ _CRITICAL void LUOS_COM_IRQHANDLER() ******************************************************************************/ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) { - while ((LUOS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_DRE) != SERCOM_USART_INTFLAG_DRE) + while ((ROBUS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_DRE) != SERCOM_USART_INTFLAG_DRE) ; // Disable RX detec pin if needed @@ -280,20 +280,20 @@ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) tx_data = data; #ifdef USE_TX_IT // Send the first byte - LUOS_COM->USART.DATA.reg = *(tx_data++); + ROBUS_COM->USART.DATA.reg = *(tx_data++); // Enable Transmission empty buffer interrupt to transmit next datas - LUOS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_DRE; // enable IT + ROBUS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_DRE; // enable IT // Disable Transmission complete interrupt - LUOS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_TXC; // disable IT + ROBUS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_TXC; // disable IT #else data_size_to_transmit = 0; // to not check IT TC during collision descriptor_section.SRCADDR.reg = (uint32_t)(data + size); - descriptor_section.DSTADDR.reg = (uint32_t)&LUOS_COM->USART.DATA.reg; + descriptor_section.DSTADDR.reg = (uint32_t)&ROBUS_COM->USART.DATA.reg; descriptor_section.BTCNT.reg = size; // Enable TX RobusHAL_SetTxState(true); - LUOS_DMA->CHCTRLA.reg |= DMAC_CHCTRLA_ENABLE; - LUOS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_TXC; // enable IT + ROBUS_DMA->CHCTRLA.reg |= DMAC_CHCTRLA_ENABLE; + ROBUS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_TXC; // enable IT #endif } else @@ -301,14 +301,14 @@ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) // Wait before send ack data_size_to_transmit = 0; // This is a patch du to difference MCU frequency - while (LUOS_TIMER->COUNT16.COUNT.reg < (0xFFFF - (timoutclockcnt * (DEFAULT_TIMEOUT - TIMEOUT_ACK)))) + while (ROBUS_TIMER->COUNT16.COUNT.reg < (0xFFFF - (timoutclockcnt * (DEFAULT_TIMEOUT - TIMEOUT_ACK)))) ; // Enable TX RobusHAL_SetTxState(true); // Transmit the only byte we have - LUOS_COM->USART.DATA.reg = *data; + ROBUS_COM->USART.DATA.reg = *data; // Enable Transmission complete interrupt because we only have one. - LUOS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_TXC; // enable IT + ROBUS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_TXC; // enable IT } RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); } @@ -340,9 +340,9 @@ _CRITICAL void RobusHAL_SetRxDetecPin(uint8_t Enable) _CRITICAL uint8_t RobusHAL_GetTxLockState(void) { uint8_t result = false; - if (LUOS_COM->USART.INTFLAG.bit.RXS == 1) + if (ROBUS_COM->USART.INTFLAG.bit.RXS == 1) { - LUOS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start + ROBUS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); result = true; } @@ -373,22 +373,22 @@ _CRITICAL uint8_t RobusHAL_GetTxLockState(void) static void RobusHAL_TimeoutInit(void) { // initialize clock - LUOS_TIMER_LOCK_ENABLE(); + ROBUS_TIMER_CLOCK_ENABLE(); - LUOS_TIMER->COUNT16.CTRLA.reg = TC_CTRLA_RESETVALUE; - while ((LUOS_TIMER->COUNT16.STATUS.reg & TC_STATUS_SYNCBUSY)) + ROBUS_TIMER->COUNT16.CTRLA.reg = TC_CTRLA_RESETVALUE; + while ((ROBUS_TIMER->COUNT16.STATUS.reg & TC_STATUS_SYNCBUSY)) ; /* Configure counter mode & prescaler */ - LUOS_TIMER->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV1 | TC_CTRLA_WAVEGEN_MPWM; - LUOS_TIMER->COUNT16.CTRLBSET.bit.ONESHOT = 1; + ROBUS_TIMER->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV1 | TC_CTRLA_WAVEGEN_MPWM; + ROBUS_TIMER->COUNT16.CTRLBSET.bit.ONESHOT = 1; - LUOS_TIMER->COUNT16.COUNT.reg = 0xFFFF - (timoutclockcnt * DEFAULT_TIMEOUT); + ROBUS_TIMER->COUNT16.COUNT.reg = 0xFFFF - (timoutclockcnt * DEFAULT_TIMEOUT); /* Clear all interrupt flags */ - LUOS_TIMER->COUNT16.INTENSET.reg = TC_INTENSET_RESETVALUE; - LUOS_TIMER->COUNT16.INTENSET.reg = TC_INTENSET_OVF; + ROBUS_TIMER->COUNT16.INTENSET.reg = TC_INTENSET_RESETVALUE; + ROBUS_TIMER->COUNT16.INTENSET.reg = TC_INTENSET_OVF; - NVIC_SetPriority(LUOS_TIMER_IRQ, 3); - NVIC_EnableIRQ(LUOS_TIMER_IRQ); + NVIC_SetPriority(ROBUS_TIMER_IRQ, 3); + NVIC_EnableIRQ(ROBUS_TIMER_IRQ); } /****************************************************************************** * @brief Luos Timeout for Rx communication @@ -397,13 +397,13 @@ static void RobusHAL_TimeoutInit(void) ******************************************************************************/ _CRITICAL void RobusHAL_ResetTimeout(uint16_t nbrbit) { - NVIC_ClearPendingIRQ(LUOS_TIMER_IRQ); // clear IT pending - LUOS_TIMER->COUNT16.INTFLAG.bit.OVF = 1; - LUOS_TIMER->COUNT16.CTRLA.reg &= ~TC_CTRLA_ENABLE; + NVIC_ClearPendingIRQ(ROBUS_TIMER_IRQ); // clear IT pending + ROBUS_TIMER->COUNT16.INTFLAG.bit.OVF = 1; + ROBUS_TIMER->COUNT16.CTRLA.reg &= ~TC_CTRLA_ENABLE; if (nbrbit != 0) { - LUOS_TIMER->COUNT16.COUNT.reg = 0xFFFF - (timoutclockcnt * nbrbit); - LUOS_TIMER->COUNT16.CTRLA.reg |= TC_CTRLA_ENABLE; + ROBUS_TIMER->COUNT16.COUNT.reg = 0xFFFF - (timoutclockcnt * nbrbit); + ROBUS_TIMER->COUNT16.CTRLA.reg |= TC_CTRLA_ENABLE; } } /****************************************************************************** @@ -411,11 +411,11 @@ _CRITICAL void RobusHAL_ResetTimeout(uint16_t nbrbit) * @param None * @return None ******************************************************************************/ -_CRITICAL void LUOS_TIMER_IRQHANDLER() +_CRITICAL void ROBUS_TIMER_IRQHANDLER() { - if (LUOS_TIMER->COUNT16.INTFLAG.bit.OVF == 1) + if (ROBUS_TIMER->COUNT16.INTFLAG.bit.OVF == 1) { - LUOS_TIMER->COUNT16.INTFLAG.bit.OVF = 1; + ROBUS_TIMER->COUNT16.INTFLAG.bit.OVF = 1; if ((ctx.tx.lock == true) && (RobusHAL_GetTxLockState() == false)) { RobusHAL_SetTxState(false); diff --git a/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal_config.h b/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal_config.h index 43b0db4d4..57394f36e 100644 --- a/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal_config.h +++ b/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal_config.h @@ -142,61 +142,61 @@ DEFAULT RobusHAL ARDUINO PIN CONFIGURATION /******************************************************************************* * COM CONFIG ******************************************************************************/ -#ifndef LUOS_COM_CLOCK_ENABLE - #define LUOS_COM_CLOCK_ENABLE() \ +#ifndef ROBUS_COM_CLOCK_ENABLE + #define ROBUS_COM_CLOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_SERCOM0_CORE_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ PM->APBCMASK.reg |= PM_APBCMASK_SERCOM0; \ } while (0U) #endif -#ifndef LUOS_COM - #define LUOS_COM SERCOM0 +#ifndef ROBUS_COM + #define ROBUS_COM SERCOM0 #endif -#ifndef LUOS_COM_IRQ - #define LUOS_COM_IRQ SERCOM0_IRQn +#ifndef ROBUS_COM_IRQ + #define ROBUS_COM_IRQ SERCOM0_IRQn #endif -#ifndef LUOS_COM_IRQHANDLER - #define LUOS_COM_IRQHANDLER() SERCOM0_Handler() +#ifndef ROBUS_COM_IRQHANDLER + #define ROBUS_COM_IRQHANDLER() SERCOM0_Handler() #endif /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#ifndef LUOS_DMA_CLOCK_ENABLE - #define LUOS_DMA_CLOCK_ENABLE() \ +#ifndef ROBUS_DMA_CLOCK_ENABLE + #define ROBUS_DMA_CLOCK_ENABLE() \ do \ { \ PM->APBCMASK.reg |= PM_AHBMASK_DMAC; \ } while (0U) #endif -#ifndef LUOS_DMA - #define LUOS_DMA DMAC +#ifndef ROBUS_DMA + #define ROBUS_DMA DMAC #endif -#ifndef LUOS_DMA_TRIGGER - #define LUOS_DMA_TRIGGER 2 +#ifndef ROBUS_DMA_TRIGGER + #define ROBUS_DMA_TRIGGER 2 #endif -#ifndef LUOS_DMA_CHANNEL - #define LUOS_DMA_CHANNEL 0 +#ifndef ROBUS_DMA_CHANNEL + #define ROBUS_DMA_CHANNEL 0 #endif /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#ifndef LUOS_TIMER_LOCK_ENABLE - #define LUOS_TIMER_LOCK_ENABLE() \ +#ifndef ROBUS_TIMER_CLOCK_ENABLE + #define ROBUS_TIMER_CLOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_TCC2_TC3_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ PM->APBCMASK.reg |= PM_APBCMASK_TC3; \ } while (0U) #endif -#ifndef LUOS_TIMER - #define LUOS_TIMER TC3 +#ifndef ROBUS_TIMER + #define ROBUS_TIMER TC3 #endif -#ifndef LUOS_TIMER_IRQ - #define LUOS_TIMER_IRQ TC3_IRQn +#ifndef ROBUS_TIMER_IRQ + #define ROBUS_TIMER_IRQ TC3_IRQn #endif -#ifndef LUOS_TIMER_IRQHANDLER - #define LUOS_TIMER_IRQHANDLER() TC3_Handler() +#ifndef ROBUS_TIMER_IRQHANDLER + #define ROBUS_TIMER_IRQHANDLER() TC3_Handler() #endif #endif /* _RobusHAL_CONFIG_H_ */ diff --git a/network/robus_network/HAL/ATSAMD21_MBED/robus_hal.c b/network/robus_network/HAL/ATSAMD21_MBED/robus_hal.c index 9549a0d4e..3939d22f6 100644 --- a/network/robus_network/HAL/ATSAMD21_MBED/robus_hal.c +++ b/network/robus_network/HAL/ATSAMD21_MBED/robus_hal.c @@ -87,41 +87,41 @@ void RobusHAL_ComInit(uint32_t Baudrate) uint32_t baud = 0; // initialize clock - LUOS_COM_CLOCK_ENABLE(); + ROBUS_COM_CLOCK_ENABLE(); /* Disable the USART before configurations */ - LUOS_COM->USART.CTRLA.reg &= ~SERCOM_USART_CTRLA_ENABLE; + ROBUS_COM->USART.CTRLA.reg &= ~SERCOM_USART_CTRLA_ENABLE; /* Configure Baud Rate */ baud = 65536 - ((uint64_t)65536 * 16 * Baudrate) / MCUFREQ; - LUOS_COM->USART.BAUD.reg = SERCOM_USART_BAUD_BAUD(baud); + ROBUS_COM->USART.BAUD.reg = SERCOM_USART_BAUD_BAUD(baud); // Configures USART Clock Mode/ TXPO and RXPO/ Data Order/ Standby Mode/ Sampling rate/ IBON - LUOS_COM->USART.CTRLA.reg = SERCOM_USART_CTRLA_MODE_USART_INT_CLK | SERCOM_USART_CTRLA_RXPO(COM_RX_POS) + ROBUS_COM->USART.CTRLA.reg = SERCOM_USART_CTRLA_MODE_USART_INT_CLK | SERCOM_USART_CTRLA_RXPO(COM_RX_POS) | SERCOM_USART_CTRLA_TXPO(COM_TX_POS) | SERCOM_USART_CTRLA_DORD | SERCOM_USART_CTRLA_IBON | SERCOM_USART_CTRLA_FORM(0x0) | SERCOM_USART_CTRLA_SAMPR(0); // Configures RXEN/ TXEN/ CHSIZE/ Parity/ Stop bits - LUOS_COM->USART.CTRLB.reg = SERCOM_USART_CTRLB_CHSIZE(0) | SERCOM_USART_CTRLB_SBMODE + ROBUS_COM->USART.CTRLB.reg = SERCOM_USART_CTRLB_CHSIZE(0) | SERCOM_USART_CTRLB_SBMODE | SERCOM_USART_CTRLB_RXEN | SERCOM_USART_CTRLB_TXEN | SERCOM_USART_CTRLB_SFDE; /* Enable the UART after the configurations */ - LUOS_COM->USART.CTRLA.reg |= SERCOM_USART_CTRLA_ENABLE; + ROBUS_COM->USART.CTRLA.reg |= SERCOM_USART_CTRLA_ENABLE; /* Wait for sync */ - // while (LUOS_COM->USART.SYNCBUSY.bit.ENABLE) + // while (ROBUS_COM->USART.SYNCBUSY.bit.ENABLE) // ; /* Clean IT */ - LUOS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_RESETVALUE; + ROBUS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_RESETVALUE; /* Enable Receive Complete interrupt */ - LUOS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_RXC; + ROBUS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_RXC; - NVIC_SetPriority(LUOS_COM_IRQ, 3); - NVIC_EnableIRQ(LUOS_COM_IRQ); + NVIC_SetPriority(ROBUS_COM_IRQ, 3); + NVIC_EnableIRQ(ROBUS_COM_IRQ); // Timeout Initialization timoutclockcnt @@ -129,15 +129,15 @@ void RobusHAL_ComInit(uint32_t Baudrate) RobusHAL_TimeoutInit(); #ifndef USE_TX_IT - LUOS_DMA_CLOCK_ENABLE(); + ROBUS_DMA_CLOCK_ENABLE(); - LUOS_DMA->BASEADDR.reg = (uint32_t)&descriptor_section; - LUOS_DMA->WRBADDR.reg = (uint32_t)&write_back_section; - LUOS_DMA->PRICTRL0.reg = DMAC_PRICTRL0_LVLPRI0(1UL) | DMAC_PRICTRL0_RRLVLEN0 | DMAC_PRICTRL0_LVLPRI1(1UL) | DMAC_PRICTRL0_RRLVLEN1 | DMAC_PRICTRL0_LVLPRI2(1UL) | DMAC_PRICTRL0_RRLVLEN2 | DMAC_PRICTRL0_LVLPRI3(1UL) | DMAC_PRICTRL0_RRLVLEN3; - LUOS_DMA->CHID.reg = LUOS_DMA_CHANNEL; // DMA Channel - LUOS_DMA->CHCTRLB.reg = DMAC_CHCTRLB_TRIGACT(2) | DMAC_CHCTRLB_TRIGSRC(LUOS_DMA_TRIGGER) | DMAC_CHCTRLB_LVL(0); + ROBUS_DMA->BASEADDR.reg = (uint32_t)&descriptor_section; + ROBUS_DMA->WRBADDR.reg = (uint32_t)&write_back_section; + ROBUS_DMA->PRICTRL0.reg = DMAC_PRICTRL0_LVLPRI0(1UL) | DMAC_PRICTRL0_RRLVLEN0 | DMAC_PRICTRL0_LVLPRI1(1UL) | DMAC_PRICTRL0_RRLVLEN1 | DMAC_PRICTRL0_LVLPRI2(1UL) | DMAC_PRICTRL0_RRLVLEN2 | DMAC_PRICTRL0_LVLPRI3(1UL) | DMAC_PRICTRL0_RRLVLEN3; + ROBUS_DMA->CHID.reg = ROBUS_DMA_CHANNEL; // DMA Channel + ROBUS_DMA->CHCTRLB.reg = DMAC_CHCTRLB_TRIGACT(2) | DMAC_CHCTRLB_TRIGSRC(ROBUS_DMA_TRIGGER) | DMAC_CHCTRLB_LVL(0); descriptor_section.BTCTRL.reg = DMAC_BTCTRL_BLOCKACT_INT | DMAC_BTCTRL_BEATSIZE_BYTE | DMAC_BTCTRL_VALID | DMAC_BTCTRL_SRCINC; - LUOS_DMA->CTRL.reg = DMAC_CTRL_DMAENABLE | DMAC_CTRL_LVLEN0 | DMAC_CTRL_LVLEN1 | DMAC_CTRL_LVLEN2 | DMAC_CTRL_LVLEN3; + ROBUS_DMA->CTRL.reg = DMAC_CTRL_DMAENABLE | DMAC_CTRL_LVLEN0 | DMAC_CTRL_LVLEN1 | DMAC_CTRL_LVLEN2 | DMAC_CTRL_LVLEN3; #endif } /****************************************************************************** @@ -169,13 +169,13 @@ _CRITICAL void RobusHAL_SetTxState(uint8_t Enable) // Stop current transmit operation data_size_to_transmit = 0; // Disable Transmission empty buffer interrupt - LUOS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_DRE; // disable IT + ROBUS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_DRE; // disable IT #else - LUOS_DMA->CHCTRLA.reg &= ~DMAC_CHCTRLA_ENABLE; + ROBUS_DMA->CHCTRLA.reg &= ~DMAC_CHCTRLA_ENABLE; #endif // Disable Transmission complete interrupt - LUOS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_TXC; // disable IT - LUOS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start + ROBUS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_TXC; // disable IT + ROBUS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start } } /****************************************************************************** @@ -187,15 +187,15 @@ _CRITICAL void RobusHAL_SetRxState(uint8_t Enable) { if (Enable == true) { - while ((LUOS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_RXC) == SERCOM_USART_INTFLAG_RXC) + while ((ROBUS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_RXC) == SERCOM_USART_INTFLAG_RXC) { - LUOS_COM->USART.DATA.reg; + ROBUS_COM->USART.DATA.reg; } - LUOS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_RXC; + ROBUS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_RXC; } else { - LUOS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_RXC; + ROBUS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_RXC; } } /****************************************************************************** @@ -203,31 +203,31 @@ _CRITICAL void RobusHAL_SetRxState(uint8_t Enable) * @param None * @return None ******************************************************************************/ -_CRITICAL void LUOS_COM_IRQHANDLER() +_CRITICAL void ROBUS_COM_IRQHANDLER() { // Reset timeout to it's default value RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); // reception management - if (((LUOS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_RXC) == SERCOM_USART_INTFLAG_RXC) && ((LUOS_COM->USART.INTENSET.reg & SERCOM_USART_INTENSET_RXC) == SERCOM_USART_INTENSET_RXC)) + if (((ROBUS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_RXC) == SERCOM_USART_INTFLAG_RXC) && ((ROBUS_COM->USART.INTENSET.reg & SERCOM_USART_INTENSET_RXC) == SERCOM_USART_INTENSET_RXC)) { // clean start bit detection - uint8_t data = LUOS_COM->USART.DATA.reg; + uint8_t data = ROBUS_COM->USART.DATA.reg; Recep_data(&data); if (data_size_to_transmit == 0) { - LUOS_COM->USART.STATUS.reg = SERCOM_USART_STATUS_PERR | SERCOM_USART_STATUS_FERR | SERCOM_USART_STATUS_BUFOVF; - LUOS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start + ROBUS_COM->USART.STATUS.reg = SERCOM_USART_STATUS_PERR | SERCOM_USART_STATUS_FERR | SERCOM_USART_STATUS_BUFOVF; + ROBUS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start return; } } - else if ((LUOS_COM->USART.STATUS.reg & SERCOM_USART_STATUS_FERR) == SERCOM_USART_STATUS_FERR) // check error on ligne + else if ((ROBUS_COM->USART.STATUS.reg & SERCOM_USART_STATUS_FERR) == SERCOM_USART_STATUS_FERR) // check error on ligne { ctx.rx.status.rx_framing_error = true; } // Transmission management - if (((LUOS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_TXC) == SERCOM_USART_INTFLAG_TXC) && ((LUOS_COM->USART.INTENSET.reg & SERCOM_USART_INTENSET_TXC) == SERCOM_USART_INTENSET_TXC)) + if (((ROBUS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_TXC) == SERCOM_USART_INTFLAG_TXC) && ((ROBUS_COM->USART.INTENSET.reg & SERCOM_USART_INTENSET_TXC) == SERCOM_USART_INTENSET_TXC)) { // Transmission complete data_size_to_transmit = 0; @@ -235,28 +235,28 @@ _CRITICAL void LUOS_COM_IRQHANDLER() RobusHAL_SetTxState(false); RobusHAL_SetRxState(true); // Disable transmission complete IRQ - LUOS_COM->USART.INTFLAG.reg = SERCOM_USART_INTFLAG_TXC; // clear flag - LUOS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_TXC; // disable IT + ROBUS_COM->USART.INTFLAG.reg = SERCOM_USART_INTFLAG_TXC; // clear flag + ROBUS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_TXC; // disable IT } #ifdef USE_TX_IT - else if (((LUOS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_DRE) == SERCOM_USART_INTFLAG_DRE) && ((LUOS_COM->USART.INTENSET.reg & SERCOM_USART_INTENSET_DRE) == SERCOM_USART_INTENSET_DRE)) + else if (((ROBUS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_DRE) == SERCOM_USART_INTFLAG_DRE) && ((ROBUS_COM->USART.INTENSET.reg & SERCOM_USART_INTENSET_DRE) == SERCOM_USART_INTENSET_DRE)) { // Transmit buffer empty (this is a software DMA) data_size_to_transmit--; - LUOS_COM->USART.DATA.reg = *(tx_data++); + ROBUS_COM->USART.DATA.reg = *(tx_data++); if (data_size_to_transmit == 0) { // Transmission complete, stop loading data and watch for the end of transmission // Disable Transmission empty buffer interrupt - LUOS_COM->USART.INTFLAG.reg = SERCOM_USART_INTFLAG_DRE; // clear flag - LUOS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_DRE; // disable IT + ROBUS_COM->USART.INTFLAG.reg = SERCOM_USART_INTFLAG_DRE; // clear flag + ROBUS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_DRE; // disable IT // Enable Transmission complete interrupt - LUOS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_TXC; // disable IT + ROBUS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_TXC; // disable IT } } #endif - LUOS_COM->USART.STATUS.reg = SERCOM_USART_STATUS_PERR | SERCOM_USART_STATUS_FERR | SERCOM_USART_STATUS_BUFOVF; - LUOS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start + ROBUS_COM->USART.STATUS.reg = SERCOM_USART_STATUS_PERR | SERCOM_USART_STATUS_FERR | SERCOM_USART_STATUS_BUFOVF; + ROBUS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start } /****************************************************************************** * @brief Process data transmit @@ -265,7 +265,7 @@ _CRITICAL void LUOS_COM_IRQHANDLER() ******************************************************************************/ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) { - while ((LUOS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_DRE) != SERCOM_USART_INTFLAG_DRE) + while ((ROBUS_COM->USART.INTFLAG.reg & SERCOM_USART_INTFLAG_DRE) != SERCOM_USART_INTFLAG_DRE) ; // Disable RX detec pin if needed @@ -279,20 +279,20 @@ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) tx_data = data; #ifdef USE_TX_IT // Send the first byte - LUOS_COM->USART.DATA.reg = *(tx_data++); + ROBUS_COM->USART.DATA.reg = *(tx_data++); // Enable Transmission empty buffer interrupt to transmit next datas - LUOS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_DRE; // enable IT + ROBUS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_DRE; // enable IT // Disable Transmission complete interrupt - LUOS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_TXC; // disable IT + ROBUS_COM->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_TXC; // disable IT #else data_size_to_transmit = 0; // to not check IT TC during collision descriptor_section.SRCADDR.reg = (uint32_t)(data + size); - descriptor_section.DSTADDR.reg = (uint32_t)&LUOS_COM->USART.DATA.reg; + descriptor_section.DSTADDR.reg = (uint32_t)&ROBUS_COM->USART.DATA.reg; descriptor_section.BTCNT.reg = size; // Enable TX RobusHAL_SetTxState(true); - LUOS_DMA->CHCTRLA.reg |= DMAC_CHCTRLA_ENABLE; - LUOS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_TXC; // enable IT + ROBUS_DMA->CHCTRLA.reg |= DMAC_CHCTRLA_ENABLE; + ROBUS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_TXC; // enable IT #endif } else @@ -300,14 +300,14 @@ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) // Wait before send ack data_size_to_transmit = 0; // This is a patch du to difference MCU frequency - while (LUOS_TIMER->COUNT16.COUNT.reg < (0xFFFF - (timoutclockcnt * (DEFAULT_TIMEOUT - TIMEOUT_ACK)))) + while (ROBUS_TIMER->COUNT16.COUNT.reg < (0xFFFF - (timoutclockcnt * (DEFAULT_TIMEOUT - TIMEOUT_ACK)))) ; // Enable TX RobusHAL_SetTxState(true); // Transmit the only byte we have - LUOS_COM->USART.DATA.reg = *data; + ROBUS_COM->USART.DATA.reg = *data; // Enable Transmission complete interrupt because we only have one. - LUOS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_TXC; // enable IT + ROBUS_COM->USART.INTENSET.reg = SERCOM_USART_INTENSET_TXC; // enable IT } RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); } @@ -339,9 +339,9 @@ _CRITICAL void RobusHAL_SetRxDetecPin(uint8_t Enable) _CRITICAL uint8_t RobusHAL_GetTxLockState(void) { uint8_t result = false; - if (LUOS_COM->USART.INTFLAG.bit.RXS == 1) + if (ROBUS_COM->USART.INTFLAG.bit.RXS == 1) { - LUOS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start + ROBUS_COM->USART.INTFLAG.bit.RXS = 1; // clear flag rx start RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); result = true; } @@ -372,22 +372,22 @@ _CRITICAL uint8_t RobusHAL_GetTxLockState(void) static void RobusHAL_TimeoutInit(void) { // initialize clock - LUOS_TIMER_LOCK_ENABLE(); + ROBUS_TIMER_CLOCK_ENABLE(); - LUOS_TIMER->COUNT16.CTRLA.reg = TC_CTRLA_RESETVALUE; - while ((LUOS_TIMER->COUNT16.STATUS.reg & TC_STATUS_SYNCBUSY)) + ROBUS_TIMER->COUNT16.CTRLA.reg = TC_CTRLA_RESETVALUE; + while ((ROBUS_TIMER->COUNT16.STATUS.reg & TC_STATUS_SYNCBUSY)) ; /* Configure counter mode & prescaler */ - LUOS_TIMER->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV1 | TC_CTRLA_WAVEGEN_MPWM; - LUOS_TIMER->COUNT16.CTRLBSET.bit.ONESHOT = 1; + ROBUS_TIMER->COUNT16.CTRLA.reg = TC_CTRLA_MODE_COUNT16 | TC_CTRLA_PRESCALER_DIV1 | TC_CTRLA_WAVEGEN_MPWM; + ROBUS_TIMER->COUNT16.CTRLBSET.bit.ONESHOT = 1; - LUOS_TIMER->COUNT16.COUNT.reg = 0xFFFF - (timoutclockcnt * DEFAULT_TIMEOUT); + ROBUS_TIMER->COUNT16.COUNT.reg = 0xFFFF - (timoutclockcnt * DEFAULT_TIMEOUT); /* Clear all interrupt flags */ - LUOS_TIMER->COUNT16.INTENSET.reg = TC_INTENSET_RESETVALUE; - LUOS_TIMER->COUNT16.INTENSET.reg = TC_INTENSET_OVF; + ROBUS_TIMER->COUNT16.INTENSET.reg = TC_INTENSET_RESETVALUE; + ROBUS_TIMER->COUNT16.INTENSET.reg = TC_INTENSET_OVF; - NVIC_SetPriority(LUOS_TIMER_IRQ, 3); - NVIC_EnableIRQ(LUOS_TIMER_IRQ); + NVIC_SetPriority(ROBUS_TIMER_IRQ, 3); + NVIC_EnableIRQ(ROBUS_TIMER_IRQ); } /****************************************************************************** * @brief Luos Timeout for Rx communication @@ -396,13 +396,13 @@ static void RobusHAL_TimeoutInit(void) ******************************************************************************/ _CRITICAL void RobusHAL_ResetTimeout(uint16_t nbrbit) { - NVIC_ClearPendingIRQ(LUOS_TIMER_IRQ); // clear IT pending - LUOS_TIMER->COUNT16.INTFLAG.bit.OVF = 1; - LUOS_TIMER->COUNT16.CTRLA.reg &= ~TC_CTRLA_ENABLE; + NVIC_ClearPendingIRQ(ROBUS_TIMER_IRQ); // clear IT pending + ROBUS_TIMER->COUNT16.INTFLAG.bit.OVF = 1; + ROBUS_TIMER->COUNT16.CTRLA.reg &= ~TC_CTRLA_ENABLE; if (nbrbit != 0) { - LUOS_TIMER->COUNT16.COUNT.reg = 0xFFFF - (timoutclockcnt * nbrbit); - LUOS_TIMER->COUNT16.CTRLA.reg |= TC_CTRLA_ENABLE; + ROBUS_TIMER->COUNT16.COUNT.reg = 0xFFFF - (timoutclockcnt * nbrbit); + ROBUS_TIMER->COUNT16.CTRLA.reg |= TC_CTRLA_ENABLE; } } /****************************************************************************** @@ -410,11 +410,11 @@ _CRITICAL void RobusHAL_ResetTimeout(uint16_t nbrbit) * @param None * @return None ******************************************************************************/ -_CRITICAL void LUOS_TIMER_IRQHANDLER() +_CRITICAL void ROBUS_TIMER_IRQHANDLER() { - if (LUOS_TIMER->COUNT16.INTFLAG.bit.OVF == 1) + if (ROBUS_TIMER->COUNT16.INTFLAG.bit.OVF == 1) { - LUOS_TIMER->COUNT16.INTFLAG.bit.OVF = 1; + ROBUS_TIMER->COUNT16.INTFLAG.bit.OVF = 1; if ((ctx.tx.lock == true) && (RobusHAL_GetTxLockState() == false)) { RobusHAL_SetTxState(false); diff --git a/network/robus_network/HAL/ATSAMD21_MBED/robus_hal_config.h b/network/robus_network/HAL/ATSAMD21_MBED/robus_hal_config.h index 6cc956272..149382460 100644 --- a/network/robus_network/HAL/ATSAMD21_MBED/robus_hal_config.h +++ b/network/robus_network/HAL/ATSAMD21_MBED/robus_hal_config.h @@ -115,62 +115,62 @@ /******************************************************************************* * COM CONFIG ******************************************************************************/ -#ifndef LUOS_COM_CLOCK_ENABLE - #define LUOS_COM_CLOCK_ENABLE() \ +#ifndef ROBUS_COM_CLOCK_ENABLE + #define ROBUS_COM_CLOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_SERCOM0_CORE_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ PM->APBCMASK.reg |= PM_APBCMASK_SERCOM0; \ } while (0U) #endif -#ifndef LUOS_COM - #define LUOS_COM SERCOM0 +#ifndef ROBUS_COM + #define ROBUS_COM SERCOM0 #endif -#ifndef LUOS_COM_IRQ - #define LUOS_COM_IRQ SERCOM0_IRQn +#ifndef ROBUS_COM_IRQ + #define ROBUS_COM_IRQ SERCOM0_IRQn #endif -#ifndef LUOS_COM_IRQHANDLER +#ifndef ROBUS_COM_IRQHANDLER - #define LUOS_COM_IRQHANDLER() SERCOM0_Handler() + #define ROBUS_COM_IRQHANDLER() SERCOM0_Handler() #endif /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#ifndef LUOS_DMA_CLOCK_ENABLE - #define LUOS_DMA_CLOCK_ENABLE() \ +#ifndef ROBUS_DMA_CLOCK_ENABLE + #define ROBUS_DMA_CLOCK_ENABLE() \ do \ { \ PM->APBCMASK.reg |= PM_AHBMASK_DMAC; \ } while (0U) #endif -#ifndef LUOS_DMA - #define LUOS_DMA DMAC +#ifndef ROBUS_DMA + #define ROBUS_DMA DMAC #endif -#ifndef LUOS_DMA_TRIGGER - #define LUOS_DMA_TRIGGER 2 +#ifndef ROBUS_DMA_TRIGGER + #define ROBUS_DMA_TRIGGER 2 #endif -#ifndef LUOS_DMA_CHANNEL - #define LUOS_DMA_CHANNEL 0 +#ifndef ROBUS_DMA_CHANNEL + #define ROBUS_DMA_CHANNEL 0 #endif /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#ifndef LUOS_TIMER_LOCK_ENABLE - #define LUOS_TIMER_LOCK_ENABLE() \ +#ifndef ROBUS_TIMER_CLOCK_ENABLE + #define ROBUS_TIMER_CLOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_TCC2_TC3_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ PM->APBCMASK.reg |= PM_APBCMASK_TC3; \ } while (0U) #endif -#ifndef LUOS_TIMER - #define LUOS_TIMER TC3 +#ifndef ROBUS_TIMER + #define ROBUS_TIMER TC3 #endif -#ifndef LUOS_TIMER_IRQ - #define LUOS_TIMER_IRQ TC3_IRQn +#ifndef ROBUS_TIMER_IRQ + #define ROBUS_TIMER_IRQ TC3_IRQn #endif -#ifndef LUOS_TIMER_IRQHANDLER - #define LUOS_TIMER_IRQHANDLER() TC3_Handler() +#ifndef ROBUS_TIMER_IRQHANDLER + #define ROBUS_TIMER_IRQHANDLER() TC3_Handler() #endif #endif /* _RobusHAL_CONFIG_H_ */ diff --git a/network/robus_network/HAL/ESP32/board_config.h b/network/robus_network/HAL/ESP32/board_config.h index 2a23d5b91..7f2f2b0d5 100644 --- a/network/robus_network/HAL/ESP32/board_config.h +++ b/network/robus_network/HAL/ESP32/board_config.h @@ -22,7 +22,7 @@ #define COM_TX_PIN GPIO_NUM_10 #define COM_RX_PIN GPIO_NUM_9 // this pin should pin pull up to vcc if no internal pull up - #define LUOS_TIMER_GROUP TIMER_GROUP_1 + #define ROBUS_TIMER_GROUP TIMER_GROUP_1 #elif CONFIG_IDF_TARGET_ESP32C3 #define PTPA_PIN GPIO_NUM_6 diff --git a/network/robus_network/HAL/ESP32/robus_hal.c b/network/robus_network/HAL/ESP32/robus_hal.c index 13f000502..39689fb07 100644 --- a/network/robus_network/HAL/ESP32/robus_hal.c +++ b/network/robus_network/HAL/ESP32/robus_hal.c @@ -67,14 +67,14 @@ gpio_config_t PinConfig; static uart_isr_handle_t handle_console; uart_hal_context_t uart_hal_context = { - .dev = UART_LL_GET_HW(LUOS_COM)}; + .dev = UART_LL_GET_HW(ROBUS_COM)}; gpio_hal_context_t gpio_hal_context = { .dev = GPIO_HAL_GET_HW(GPIO_PORT_0)}; timer_hal_context_t timeout_hal_context = { - .dev = TIMER_LL_GET_HW(LUOS_TIMER_GROUP), - .idx = LUOS_TIMER, + .dev = TIMER_LL_GET_HW(ROBUS_TIMER_GROUP), + .idx = ROBUS_TIMER, }; /******************************************************************************* @@ -170,19 +170,19 @@ void RobusHAL_ComInit(uint32_t Baudrate) .source_clk = UART_SCLK_APB, }; - if (uart_is_driver_installed(LUOS_COM) == true) + if (uart_is_driver_installed(ROBUS_COM) == true) { - ESP_ERROR_CHECK(uart_driver_delete(LUOS_COM)); + ESP_ERROR_CHECK(uart_driver_delete(ROBUS_COM)); } - ESP_ERROR_CHECK(uart_driver_install(LUOS_COM, RX_BUFFER_SIZE, TX_BUFFER_SIZE, 0, NULL, ESP_INTR_FLAG_IRAM)); - ESP_ERROR_CHECK(uart_param_config(LUOS_COM, &uart_config)); - ESP_ERROR_CHECK(uart_set_pin(LUOS_COM, COM_TX_PIN, COM_RX_PIN, GPIO_NUM_NC, GPIO_NUM_NC)); + ESP_ERROR_CHECK(uart_driver_install(ROBUS_COM, RX_BUFFER_SIZE, TX_BUFFER_SIZE, 0, NULL, ESP_INTR_FLAG_IRAM)); + ESP_ERROR_CHECK(uart_param_config(ROBUS_COM, &uart_config)); + ESP_ERROR_CHECK(uart_set_pin(ROBUS_COM, COM_TX_PIN, COM_RX_PIN, GPIO_NUM_NC, GPIO_NUM_NC)); uart_hal_set_rxfifo_full_thr(&uart_hal_context, 1); uart_hal_rxfifo_rst(&uart_hal_context); uart_hal_txfifo_rst(&uart_hal_context); - ESP_ERROR_CHECK(uart_isr_free(LUOS_COM)); - ESP_ERROR_CHECK(uart_isr_register(LUOS_COM, &RobusHAL_ComIrqHandler, NULL, ESP_INTR_FLAG_IRAM, &handle_console)); + ESP_ERROR_CHECK(uart_isr_free(ROBUS_COM)); + ESP_ERROR_CHECK(uart_isr_register(ROBUS_COM, &RobusHAL_ComIrqHandler, NULL, ESP_INTR_FLAG_IRAM, &handle_console)); uart_hal_disable_intr_mask(&uart_hal_context, UART_LL_INTR_MASK); @@ -208,7 +208,7 @@ _CRITICAL void RobusHAL_SetTxState(uint8_t Enable) if (Enable == true) { // Put Tx in push pull - esp_rom_gpio_connect_out_signal(COM_TX_PIN, UART_PERIPH_SIGNAL(LUOS_COM, SOC_UART_TX_PIN_IDX), 0, 0); + esp_rom_gpio_connect_out_signal(COM_TX_PIN, UART_PERIPH_SIGNAL(ROBUS_COM, SOC_UART_TX_PIN_IDX), 0, 0); if (TX_EN_PIN != DISABLE) { gpio_hal_set_level(&gpio_hal_context, TX_EN_PIN, 1); @@ -400,8 +400,8 @@ static void RobusHAL_TimeoutInit(void) Timeout.counter_dir = TIMER_COUNT_UP; /*!< Counter direction */ Timeout.auto_reload = TIMER_AUTORELOAD_EN; /*!< Timer auto-reload */ Timeout.divider = Timer_Prescaler - 1; /*!< Counter clock divider. The divider's range is from from 2 to 65536. */ - timer_init(LUOS_TIMER_GROUP, LUOS_TIMER, &Timeout); - timer_isr_callback_add(LUOS_TIMER_GROUP, LUOS_TIMER, &RobusHAL_TimeoutIrqHandler, NULL, ESP_INTR_FLAG_IRAM); + timer_init(ROBUS_TIMER_GROUP, ROBUS_TIMER, &Timeout); + timer_isr_callback_add(ROBUS_TIMER_GROUP, ROBUS_TIMER, &RobusHAL_TimeoutIrqHandler, NULL, ESP_INTR_FLAG_IRAM); timer_hal_set_alarm_value(&timeout_hal_context, DEFAULT_TIMEOUT); RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); } diff --git a/network/robus_network/HAL/ESP32/robus_hal_config.h b/network/robus_network/HAL/ESP32/robus_hal_config.h index d4db4a835..c08a61edf 100644 --- a/network/robus_network/HAL/ESP32/robus_hal_config.h +++ b/network/robus_network/HAL/ESP32/robus_hal_config.h @@ -66,17 +66,17 @@ /******************************************************************************* * COM CONFIG ******************************************************************************/ -#ifndef LUOS_COM - #define LUOS_COM UART_NUM_1 +#ifndef ROBUS_COM + #define ROBUS_COM UART_NUM_1 #endif /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#ifndef LUOS_TIMER_GROUP - #define LUOS_TIMER_GROUP TIMER_GROUP_0 +#ifndef ROBUS_TIMER_GROUP + #define ROBUS_TIMER_GROUP TIMER_GROUP_0 #endif -#ifndef LUOS_TIMER - #define LUOS_TIMER TIMER_0 +#ifndef ROBUS_TIMER + #define ROBUS_TIMER TIMER_0 #endif #endif /* _LUOSHAL_CONFIG_H_ */ diff --git a/network/robus_network/HAL/NATIVE/robus_hal.h b/network/robus_network/HAL/NATIVE/robus_hal.h index 8bad92a03..e7a070210 100644 --- a/network/robus_network/HAL/NATIVE/robus_hal.h +++ b/network/robus_network/HAL/NATIVE/robus_hal.h @@ -14,7 +14,7 @@ /******************************************************************************* * Definitions ******************************************************************************/ -#define LUOS_UUID ((uint32_t *)0x00000001) +#define ROBUS_UUID ((uint32_t *)0x00000001) #define ADDRESS_ALIASES_FLASH ADDRESS_LAST_PAGE_FLASH #define ADDRESS_BOOT_FLAG_FLASH (ADDRESS_LAST_PAGE_FLASH + PAGE_SIZE) - 4 diff --git a/network/robus_network/HAL/NATIVE/robus_hal_config.h b/network/robus_network/HAL/NATIVE/robus_hal_config.h index 9e5394e34..6a54c1961 100644 --- a/network/robus_network/HAL/NATIVE/robus_hal_config.h +++ b/network/robus_network/HAL/NATIVE/robus_hal_config.h @@ -107,49 +107,49 @@ /******************************************************************************* * COM CONFIG ******************************************************************************/ -#ifndef LUOS_COM_CLOCK_ENABLE - #define LUOS_COM_CLOCK_ENABLE() X86_STUB +#ifndef ROBUS_COM_CLOCK_ENABLE + #define ROBUS_COM_CLOCK_ENABLE() X86_STUB #endif -#ifndef LUOS_COM - #define LUOS_COM X86_STUB // STUB +#ifndef ROBUS_COM + #define ROBUS_COM X86_STUB // STUB #endif -#ifndef LUOS_COM_IRQ - #define LUOS_COM_IRQ X86_STUB // STUB +#ifndef ROBUS_COM_IRQ + #define ROBUS_COM_IRQ X86_STUB // STUB #endif -#ifndef LUOS_COM_IRQHANDLER - #define LUOS_COM_IRQHANDLER() // STUB +#ifndef ROBUS_COM_IRQHANDLER + #define ROBUS_COM_IRQHANDLER() // STUB #endif /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#ifndef LUOS_DMA_CLOCK_ENABLE - #define LUOS_DMA_CLOCK_ENABLE() X86_STUB +#ifndef ROBUS_DMA_CLOCK_ENABLE + #define ROBUS_DMA_CLOCK_ENABLE() X86_STUB #endif -#ifndef LUOS_DMA - #define LUOS_DMA X86_STUB // STUB +#ifndef ROBUS_DMA + #define ROBUS_DMA X86_STUB // STUB #endif -#ifndef LUOS_DMA_CHANNEL - #define LUOS_DMA_CHANNEL X86_STUB // STUB +#ifndef ROBUS_DMA_CHANNEL + #define ROBUS_DMA_CHANNEL X86_STUB // STUB #endif -#ifndef LUOS_DMA_REMAP - #define LUOS_DMA_REMAP X86_STUB // STUB +#ifndef ROBUS_DMA_REMAP + #define ROBUS_DMA_REMAP X86_STUB // STUB #endif /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#ifndef LUOS_TIMER_CLOCK_ENABLE - #define LUOS_TIMER_LOCK_ENABLE() // STUB +#ifndef ROBUS_TIMER_CLOCK_ENABLE + #define ROBUS_TIMER_CLOCK_ENABLE() // STUB #endif -#ifndef LUOS_TIMER - #define LUOS_TIMER X86_STUB // STUB +#ifndef ROBUS_TIMER + #define ROBUS_TIMER X86_STUB // STUB #endif -#ifndef LUOS_TIMER_IRQ - #define LUOS_TIMER_IRQ X86_STUB // STUB +#ifndef ROBUS_TIMER_IRQ + #define ROBUS_TIMER_IRQ X86_STUB // STUB #endif -#ifndef LUOS_TIMER_IRQHANDLER - #define LUOS_TIMER_IRQHANDLER() x86_Timer_IRQHandler() +#ifndef ROBUS_TIMER_IRQHANDLER + #define ROBUS_TIMER_IRQHANDLER() x86_Timer_IRQHandler() #endif #endif /* _ROBUSHAL_CONFIG_H_ */ diff --git a/network/robus_network/HAL/STM32F0/robus_hal.c b/network/robus_network/HAL/STM32F0/robus_hal.c index d53a24652..b04b833c0 100644 --- a/network/robus_network/HAL/STM32F0/robus_hal.c +++ b/network/robus_network/HAL/STM32F0/robus_hal.c @@ -89,12 +89,12 @@ void RobusHAL_Loop(void) ******************************************************************************/ void RobusHAL_ComInit(uint32_t Baudrate) { - LUOS_COM_CLOCK_ENABLE(); + ROBUS_COM_CLOCK_ENABLE(); LL_USART_InitTypeDef USART_InitStruct; // Initialise USART1 - LL_USART_Disable(LUOS_COM); + LL_USART_Disable(ROBUS_COM); USART_InitStruct.BaudRate = Baudrate; USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; USART_InitStruct.StopBits = LL_USART_STOPBITS_1; @@ -102,32 +102,32 @@ void RobusHAL_ComInit(uint32_t Baudrate) USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX_RX; USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; - while (LL_USART_Init(LUOS_COM, &USART_InitStruct) != SUCCESS) + while (LL_USART_Init(ROBUS_COM, &USART_InitStruct) != SUCCESS) ; - LL_USART_Enable(LUOS_COM); + LL_USART_Enable(ROBUS_COM); // Enable Reception interrupt - LL_USART_EnableIT_RXNE(LUOS_COM); + LL_USART_EnableIT_RXNE(ROBUS_COM); - HAL_NVIC_EnableIRQ(LUOS_COM_IRQ); - HAL_NVIC_SetPriority(LUOS_COM_IRQ, 0, 1); + HAL_NVIC_EnableIRQ(ROBUS_COM_IRQ); + HAL_NVIC_SetPriority(ROBUS_COM_IRQ, 0, 1); // Timeout Initialization Timer_Prescaler = (MCUFREQ / Baudrate) / TIMERDIV; RobusHAL_TimeoutInit(); #ifndef USE_TX_IT - LUOS_DMA_CLOCK_ENABLE(); - - LL_DMA_SetDataTransferDirection(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); - LL_DMA_SetChannelPriorityLevel(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); - LL_DMA_SetMode(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_MODE_NORMAL); - LL_DMA_SetPeriphIncMode(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); - LL_DMA_SetMemoryIncMode(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); - LL_DMA_SetPeriphSize(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); - LL_DMA_SetMemorySize(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); - LL_SYSCFG_SetRemapDMA_USART(LUOS_DMA_REMAP); - LL_DMA_SetPeriphAddress(LUOS_DMA, LUOS_DMA_CHANNEL, (uint32_t)&LUOS_COM->TDR); + ROBUS_DMA_CLOCK_ENABLE(); + + LL_DMA_SetDataTransferDirection(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); + LL_DMA_SetChannelPriorityLevel(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_MODE_NORMAL); + LL_DMA_SetPeriphIncMode(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); + LL_SYSCFG_SetRemapDMA_USART(ROBUS_DMA_REMAP); + LL_DMA_SetPeriphAddress(ROBUS_DMA, ROBUS_DMA_CHANNEL, (uint32_t)&ROBUS_COM->TDR); #endif } /****************************************************************************** @@ -158,13 +158,13 @@ _CRITICAL void RobusHAL_SetTxState(uint8_t Enable) // Stop current transmit operation data_size_to_transmit = 0; // Disable Transmission empty buffer interrupt - LL_USART_DisableIT_TXE(LUOS_COM); + LL_USART_DisableIT_TXE(ROBUS_COM); #else - LL_USART_DisableDMAReq_TX(LUOS_COM); - LL_DMA_DisableChannel(LUOS_DMA, LUOS_DMA_CHANNEL); + LL_USART_DisableDMAReq_TX(ROBUS_COM); + LL_DMA_DisableChannel(ROBUS_DMA, ROBUS_DMA_CHANNEL); #endif // Disable Transmission complete interrupt - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); } } /****************************************************************************** @@ -176,14 +176,14 @@ _CRITICAL void RobusHAL_SetRxState(uint8_t Enable) { if (Enable == true) { - LL_USART_RequestRxDataFlush(LUOS_COM); // Clear data register - LL_USART_EnableDirectionRx(LUOS_COM); - LL_USART_EnableIT_RXNE(LUOS_COM); // Enable Rx IT + LL_USART_RequestRxDataFlush(ROBUS_COM); // Clear data register + LL_USART_EnableDirectionRx(ROBUS_COM); + LL_USART_EnableIT_RXNE(ROBUS_COM); // Enable Rx IT } else { - LL_USART_DisableDirectionRx(LUOS_COM); - LL_USART_DisableIT_RXNE(LUOS_COM); // Disable Rx IT + LL_USART_DisableDirectionRx(ROBUS_COM); + LL_USART_DisableIT_RXNE(ROBUS_COM); // Disable Rx IT } } /****************************************************************************** @@ -191,31 +191,31 @@ _CRITICAL void RobusHAL_SetRxState(uint8_t Enable) * @param None * @return None ******************************************************************************/ -_CRITICAL void LUOS_COM_IRQHANDLER() +_CRITICAL void ROBUS_COM_IRQHANDLER() { // Reset timeout to it's default value RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); // reception management - if ((LL_USART_IsActiveFlag_RXNE(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_RXNE(LUOS_COM) != RESET)) + if ((LL_USART_IsActiveFlag_RXNE(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_RXNE(ROBUS_COM) != RESET)) { // We receive a byte - uint8_t data = LL_USART_ReceiveData8(LUOS_COM); + uint8_t data = LL_USART_ReceiveData8(ROBUS_COM); Recep_data(&data); // send reception byte to state machine if (data_size_to_transmit == 0) { - LUOS_COM->ICR = 0xFFFFFFFF; + ROBUS_COM->ICR = 0xFFFFFFFF; return; } } - else if (LL_USART_IsActiveFlag_FE(LUOS_COM) != RESET) + else if (LL_USART_IsActiveFlag_FE(ROBUS_COM) != RESET) { // Framing ERROR ctx.rx.status.rx_framing_error = true; } // Transmission management - if ((LL_USART_IsActiveFlag_TC(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_TC(LUOS_COM) != RESET)) + if ((LL_USART_IsActiveFlag_TC(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_TC(ROBUS_COM) != RESET)) { // Transmission complete data_size_to_transmit = 0; @@ -223,26 +223,26 @@ _CRITICAL void LUOS_COM_IRQHANDLER() RobusHAL_SetTxState(false); RobusHAL_SetRxState(true); // Disable transmission complete IRQ - LL_USART_ClearFlag_TC(LUOS_COM); - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_ClearFlag_TC(ROBUS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); } #ifdef USE_TX_IT - else if ((LL_USART_IsActiveFlag_TXE(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_TXE(LUOS_COM) != RESET)) + else if ((LL_USART_IsActiveFlag_TXE(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_TXE(ROBUS_COM) != RESET)) { // Transmit buffer empty (this is a software DMA) data_size_to_transmit--; - LL_USART_TransmitData8(LUOS_COM, *(tx_data++)); + LL_USART_TransmitData8(ROBUS_COM, *(tx_data++)); if (data_size_to_transmit == 0) { // Transmission complete, stop loading data and watch for the end of transmission // Disable Transmission empty buffer interrupt - LL_USART_DisableIT_TXE(LUOS_COM); + LL_USART_DisableIT_TXE(ROBUS_COM); // Enable Transmission complete interrupt - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); } } #endif - LUOS_COM->ICR = 0xFFFFFFFF; + ROBUS_COM->ICR = 0xFFFFFFFF; } /****************************************************************************** * @brief Process data transmit @@ -251,7 +251,7 @@ _CRITICAL void LUOS_COM_IRQHANDLER() ******************************************************************************/ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) { - while (LL_USART_IsActiveFlag_TXE(LUOS_COM) == RESET) + while (LL_USART_IsActiveFlag_TXE(ROBUS_COM) == RESET) ; // Disable RX detec pin if needed @@ -265,27 +265,27 @@ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) tx_data = data; #ifdef USE_TX_IT // Send the first byte - LL_USART_TransmitData8(LUOS_COM, *(tx_data++)); + LL_USART_TransmitData8(ROBUS_COM, *(tx_data++)); // Enable Transmission empty buffer interrupt to transmit next datas - LL_USART_EnableIT_TXE(LUOS_COM); + LL_USART_EnableIT_TXE(ROBUS_COM); // Disable Transmission complete interrupt - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); #else data_size_to_transmit = 0; // Reset this value avoiding to check IT TC during collision // Disable DMA to load new length to be tranmitted - LL_DMA_DisableChannel(LUOS_DMA, LUOS_DMA_CHANNEL); + LL_DMA_DisableChannel(ROBUS_DMA, ROBUS_DMA_CHANNEL); // configure address to be transmitted by DMA - LL_DMA_SetMemoryAddress(LUOS_DMA, LUOS_DMA_CHANNEL, (uint32_t)data); + LL_DMA_SetMemoryAddress(ROBUS_DMA, ROBUS_DMA_CHANNEL, (uint32_t)data); // set length to be tranmitted - LL_DMA_SetDataLength(LUOS_DMA, LUOS_DMA_CHANNEL, size); + LL_DMA_SetDataLength(ROBUS_DMA, ROBUS_DMA_CHANNEL, size); // set request DMA - LL_USART_EnableDMAReq_TX(LUOS_COM); + LL_USART_EnableDMAReq_TX(ROBUS_COM); // Enable TX RobusHAL_SetTxState(true); // Enable DMA again - LL_DMA_EnableChannel(LUOS_DMA, LUOS_DMA_CHANNEL); + LL_DMA_EnableChannel(ROBUS_DMA, ROBUS_DMA_CHANNEL); // enable transmit complete - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); #endif } else @@ -293,14 +293,14 @@ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) data_size_to_transmit = 1; // wait before send ack // this is a patch du to difference MCU frequency - while (LL_TIM_GetCounter(LUOS_TIMER) < TIMEOUT_ACK) + while (LL_TIM_GetCounter(ROBUS_TIMER) < TIMEOUT_ACK) ; // Enable TX RobusHAL_SetTxState(true); // Transmit the only byte we have - LL_USART_TransmitData8(LUOS_COM, *data); + LL_USART_TransmitData8(ROBUS_COM, *data); // Enable Transmission complete interrupt because we only have one. - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); } RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); } @@ -334,7 +334,7 @@ _CRITICAL uint8_t RobusHAL_GetTxLockState(void) uint8_t result = false; #ifdef USART_ISR_BUSY - if (LL_USART_IsActiveFlag_BUSY(LUOS_COM) == true) + if (LL_USART_IsActiveFlag_BUSY(ROBUS_COM) == true) { RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); result = true; @@ -367,18 +367,18 @@ static void RobusHAL_TimeoutInit(void) LL_TIM_InitTypeDef TimerInit = {0}; // initialize clock - LUOS_TIMER_CLOCK_ENABLE(); + ROBUS_TIMER_CLOCK_ENABLE(); TimerInit.Autoreload = DEFAULT_TIMEOUT; TimerInit.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1; TimerInit.CounterMode = LL_TIM_COUNTERMODE_UP; TimerInit.Prescaler = Timer_Prescaler - 1; TimerInit.RepetitionCounter = 0; - while (LL_TIM_Init(LUOS_TIMER, &TimerInit) != SUCCESS) + while (LL_TIM_Init(ROBUS_TIMER, &TimerInit) != SUCCESS) ; - LL_TIM_EnableIT_UPDATE(LUOS_TIMER); - HAL_NVIC_SetPriority(LUOS_TIMER_IRQ, 0, 2); - HAL_NVIC_EnableIRQ(LUOS_TIMER_IRQ); + LL_TIM_EnableIT_UPDATE(ROBUS_TIMER); + HAL_NVIC_SetPriority(ROBUS_TIMER_IRQ, 0, 2); + HAL_NVIC_EnableIRQ(ROBUS_TIMER_IRQ); } /****************************************************************************** * @brief Luos Timeout communication @@ -387,14 +387,14 @@ static void RobusHAL_TimeoutInit(void) ******************************************************************************/ _CRITICAL void RobusHAL_ResetTimeout(uint16_t nbrbit) { - LL_TIM_DisableCounter(LUOS_TIMER); - NVIC_ClearPendingIRQ(LUOS_TIMER_IRQ); // Clear IT pending NVIC - LL_TIM_ClearFlag_UPDATE(LUOS_TIMER); - LL_TIM_SetCounter(LUOS_TIMER, 0); // Reset counter + LL_TIM_DisableCounter(ROBUS_TIMER); + NVIC_ClearPendingIRQ(ROBUS_TIMER_IRQ); // Clear IT pending NVIC + LL_TIM_ClearFlag_UPDATE(ROBUS_TIMER); + LL_TIM_SetCounter(ROBUS_TIMER, 0); // Reset counter if (nbrbit != 0) { - LL_TIM_SetAutoReload(LUOS_TIMER, nbrbit); // reload value - LL_TIM_EnableCounter(LUOS_TIMER); + LL_TIM_SetAutoReload(ROBUS_TIMER, nbrbit); // reload value + LL_TIM_EnableCounter(ROBUS_TIMER); } } /****************************************************************************** @@ -402,12 +402,12 @@ _CRITICAL void RobusHAL_ResetTimeout(uint16_t nbrbit) * @param None * @return None ******************************************************************************/ -_CRITICAL void LUOS_TIMER_IRQHANDLER() +_CRITICAL void ROBUS_TIMER_IRQHANDLER() { - if (LL_TIM_IsActiveFlag_UPDATE(LUOS_TIMER) != RESET) + if (LL_TIM_IsActiveFlag_UPDATE(ROBUS_TIMER) != RESET) { - LL_TIM_ClearFlag_UPDATE(LUOS_TIMER); - LL_TIM_DisableCounter(LUOS_TIMER); + LL_TIM_ClearFlag_UPDATE(ROBUS_TIMER); + LL_TIM_DisableCounter(ROBUS_TIMER); if ((ctx.tx.lock == true) && (RobusHAL_GetTxLockState() == false)) { // Enable RX detection pin if needed diff --git a/network/robus_network/HAL/STM32F0/robus_hal_config.h b/network/robus_network/HAL/STM32F0/robus_hal_config.h index b922a0e12..d0cebac4f 100644 --- a/network/robus_network/HAL/STM32F0/robus_hal_config.h +++ b/network/robus_network/HAL/STM32F0/robus_hal_config.h @@ -109,48 +109,48 @@ /******************************************************************************* * COM CONFIG ******************************************************************************/ -#ifndef LUOS_COM_CLOCK_ENABLE - #define LUOS_COM_CLOCK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE() +#ifndef ROBUS_COM_CLOCK_ENABLE + #define ROBUS_COM_CLOCK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE() #endif -#ifndef LUOS_COM - #define LUOS_COM USART1 +#ifndef ROBUS_COM + #define ROBUS_COM USART1 #endif -#ifndef LUOS_COM_IRQ - #define LUOS_COM_IRQ USART1_IRQn +#ifndef ROBUS_COM_IRQ + #define ROBUS_COM_IRQ USART1_IRQn #endif -#ifndef LUOS_COM_IRQHANDLER - #define LUOS_COM_IRQHANDLER() USART1_IRQHandler() +#ifndef ROBUS_COM_IRQHANDLER + #define ROBUS_COM_IRQHANDLER() USART1_IRQHandler() #endif /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#ifndef LUOS_DMA_CLOCK_ENABLE - #define LUOS_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); +#ifndef ROBUS_DMA_CLOCK_ENABLE + #define ROBUS_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); #endif -#ifndef LUOS_DMA - #define LUOS_DMA DMA1 +#ifndef ROBUS_DMA + #define ROBUS_DMA DMA1 #endif -#ifndef LUOS_DMA_CHANNEL - #define LUOS_DMA_CHANNEL LL_DMA_CHANNEL_2 +#ifndef ROBUS_DMA_CHANNEL + #define ROBUS_DMA_CHANNEL LL_DMA_CHANNEL_2 #endif -#ifndef LUOS_DMA_REMAP - #define LUOS_DMA_REMAP 0 +#ifndef ROBUS_DMA_REMAP + #define ROBUS_DMA_REMAP 0 #endif /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#ifndef LUOS_TIMER_CLOCK_ENABLE - #define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM6_CLK_ENABLE() +#ifndef ROBUS_TIMER_CLOCK_ENABLE + #define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM6_CLK_ENABLE() #endif -#ifndef LUOS_TIMER - #define LUOS_TIMER TIM6 +#ifndef ROBUS_TIMER + #define ROBUS_TIMER TIM6 #endif -#ifndef LUOS_TIMER_IRQ - #define LUOS_TIMER_IRQ TIM6_IRQn +#ifndef ROBUS_TIMER_IRQ + #define ROBUS_TIMER_IRQ TIM6_IRQn #endif -#ifndef LUOS_TIMER_IRQHANDLER - #define LUOS_TIMER_IRQHANDLER() TIM6_DAC_IRQHandler() +#ifndef ROBUS_TIMER_IRQHANDLER + #define ROBUS_TIMER_IRQHANDLER() TIM6_DAC_IRQHandler() #endif #endif /* _RobusHAL_CONFIG_H_ */ diff --git a/network/robus_network/HAL/STM32F4/robus_hal.c b/network/robus_network/HAL/STM32F4/robus_hal.c index 49985e5e6..484ba00c5 100644 --- a/network/robus_network/HAL/STM32F4/robus_hal.c +++ b/network/robus_network/HAL/STM32F4/robus_hal.c @@ -90,12 +90,12 @@ void RobusHAL_Loop(void) ******************************************************************************/ void RobusHAL_ComInit(uint32_t Baudrate) { - LUOS_COM_CLOCK_ENABLE(); + ROBUS_COM_CLOCK_ENABLE(); LL_USART_InitTypeDef USART_InitStruct; // Initialise USART - LL_USART_Disable(LUOS_COM); + LL_USART_Disable(ROBUS_COM); USART_InitStruct.BaudRate = Baudrate; USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; USART_InitStruct.StopBits = LL_USART_STOPBITS_1; @@ -103,33 +103,33 @@ void RobusHAL_ComInit(uint32_t Baudrate) USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX_RX; USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; - while (LL_USART_Init(LUOS_COM, &USART_InitStruct) != SUCCESS) + while (LL_USART_Init(ROBUS_COM, &USART_InitStruct) != SUCCESS) ; - LL_USART_Enable(LUOS_COM); + LL_USART_Enable(ROBUS_COM); // Enable Reception interrupt - LL_USART_EnableIT_RXNE(LUOS_COM); + LL_USART_EnableIT_RXNE(ROBUS_COM); - HAL_NVIC_EnableIRQ(LUOS_COM_IRQ); - HAL_NVIC_SetPriority(LUOS_COM_IRQ, 0, 1); + HAL_NVIC_EnableIRQ(ROBUS_COM_IRQ); + HAL_NVIC_SetPriority(ROBUS_COM_IRQ, 0, 1); // Timeout Initialization Timer_Prescaler = (MCUFREQ / Baudrate) / TIMERDIV; RobusHAL_TimeoutInit(); #ifndef USE_TX_IT - LUOS_DMA_CLOCK_ENABLE(); - - LL_DMA_SetChannelSelection(LUOS_DMA, LUOS_DMA_STREAM, LUOS_DMA_CHANNEL); - LL_DMA_SetDataTransferDirection(LUOS_DMA, LUOS_DMA_STREAM, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); - LL_DMA_SetStreamPriorityLevel(LUOS_DMA, LUOS_DMA_STREAM, LL_DMA_PRIORITY_LOW); - LL_DMA_SetMode(LUOS_DMA, LUOS_DMA_STREAM, LL_DMA_MODE_NORMAL); - LL_DMA_SetPeriphIncMode(LUOS_DMA, LUOS_DMA_STREAM, LL_DMA_PERIPH_NOINCREMENT); - LL_DMA_SetMemoryIncMode(LUOS_DMA, LUOS_DMA_STREAM, LL_DMA_MEMORY_INCREMENT); - LL_DMA_SetPeriphSize(LUOS_DMA, LUOS_DMA_STREAM, LL_DMA_PDATAALIGN_BYTE); - LL_DMA_SetMemorySize(LUOS_DMA, LUOS_DMA_STREAM, LL_DMA_MDATAALIGN_BYTE); - LL_DMA_DisableFifoMode(LUOS_DMA, LUOS_DMA_STREAM); - LL_DMA_SetPeriphAddress(LUOS_DMA, LUOS_DMA_STREAM, (uint32_t)&LUOS_COM->DR); + ROBUS_DMA_CLOCK_ENABLE(); + + LL_DMA_SetChannelSelection(ROBUS_DMA, ROBUS_DMA_STREAM, ROBUS_DMA_CHANNEL); + LL_DMA_SetDataTransferDirection(ROBUS_DMA, ROBUS_DMA_STREAM, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); + LL_DMA_SetStreamPriorityLevel(ROBUS_DMA, ROBUS_DMA_STREAM, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(ROBUS_DMA, ROBUS_DMA_STREAM, LL_DMA_MODE_NORMAL); + LL_DMA_SetPeriphIncMode(ROBUS_DMA, ROBUS_DMA_STREAM, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(ROBUS_DMA, ROBUS_DMA_STREAM, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(ROBUS_DMA, ROBUS_DMA_STREAM, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(ROBUS_DMA, ROBUS_DMA_STREAM, LL_DMA_MDATAALIGN_BYTE); + LL_DMA_DisableFifoMode(ROBUS_DMA, ROBUS_DMA_STREAM); + LL_DMA_SetPeriphAddress(ROBUS_DMA, ROBUS_DMA_STREAM, (uint32_t)&ROBUS_COM->DR); #endif } /****************************************************************************** @@ -160,13 +160,13 @@ _CRITICAL void RobusHAL_SetTxState(uint8_t Enable) // Stop current transmit operation data_size_to_transmit = 0; // Disable Transmission empty buffer interrupt - LL_USART_DisableIT_TXE(LUOS_COM); + LL_USART_DisableIT_TXE(ROBUS_COM); #else - LL_USART_DisableDMAReq_TX(LUOS_COM); - LL_DMA_DisableStream(LUOS_DMA, LUOS_DMA_STREAM); + LL_USART_DisableDMAReq_TX(ROBUS_COM); + LL_DMA_DisableStream(ROBUS_DMA, ROBUS_DMA_STREAM); #endif // Disable Transmission complete interrupt - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); } } /****************************************************************************** @@ -178,14 +178,14 @@ _CRITICAL void RobusHAL_SetRxState(uint8_t Enable) { if (Enable == true) { - LL_USART_ReceiveData8(LUOS_COM); // empty buffer - LL_USART_EnableDirectionRx(LUOS_COM); - LL_USART_EnableIT_RXNE(LUOS_COM); // Enable Rx IT + LL_USART_ReceiveData8(ROBUS_COM); // empty buffer + LL_USART_EnableDirectionRx(ROBUS_COM); + LL_USART_EnableIT_RXNE(ROBUS_COM); // Enable Rx IT } else { - LL_USART_DisableDirectionRx(LUOS_COM); - LL_USART_DisableIT_RXNE(LUOS_COM); // Disable Rx IT + LL_USART_DisableDirectionRx(ROBUS_COM); + LL_USART_DisableIT_RXNE(ROBUS_COM); // Disable Rx IT } } /****************************************************************************** @@ -193,30 +193,30 @@ _CRITICAL void RobusHAL_SetRxState(uint8_t Enable) * @param None * @return None ******************************************************************************/ -_CRITICAL void LUOS_COM_IRQHANDLER() +_CRITICAL void ROBUS_COM_IRQHANDLER() { // Reset timeout to it's default value RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); // reception management - if ((LL_USART_IsActiveFlag_RXNE(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_RXNE(LUOS_COM) != RESET)) + if ((LL_USART_IsActiveFlag_RXNE(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_RXNE(ROBUS_COM) != RESET)) { // We receive a byte - uint8_t data = LL_USART_ReceiveData8(LUOS_COM); + uint8_t data = LL_USART_ReceiveData8(ROBUS_COM); Recep_data(&data); // send reception byte to state machine if (data_size_to_transmit == 0) { - LUOS_COM->SR = 0xFFFFFFFF; + ROBUS_COM->SR = 0xFFFFFFFF; return; } } - else if (LL_USART_IsActiveFlag_FE(LUOS_COM) != RESET) + else if (LL_USART_IsActiveFlag_FE(ROBUS_COM) != RESET) { // Framing ERROR ctx.rx.status.rx_framing_error = true; } // Transmission management - if ((LL_USART_IsActiveFlag_TC(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_TC(LUOS_COM) != RESET)) + if ((LL_USART_IsActiveFlag_TC(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_TC(ROBUS_COM) != RESET)) { // Transmission complete data_size_to_transmit = 0; @@ -224,26 +224,26 @@ _CRITICAL void LUOS_COM_IRQHANDLER() RobusHAL_SetTxState(false); RobusHAL_SetRxState(true); // Disable transmission complete IRQ - LL_USART_ClearFlag_TC(LUOS_COM); - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_ClearFlag_TC(ROBUS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); } #ifdef USE_TX_IT - else if ((LL_USART_IsActiveFlag_TXE(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_TXE(LUOS_COM) != RESET)) + else if ((LL_USART_IsActiveFlag_TXE(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_TXE(ROBUS_COM) != RESET)) { // Transmit buffer empty (this is a software DMA) data_size_to_transmit--; - LL_USART_TransmitData8(LUOS_COM, *(tx_data++)); + LL_USART_TransmitData8(ROBUS_COM, *(tx_data++)); if (data_size_to_transmit == 0) { // Transmission complete, stop loading data and watch for the end of transmission // Disable Transmission empty buffer interrupt - LL_USART_DisableIT_TXE(LUOS_COM); + LL_USART_DisableIT_TXE(ROBUS_COM); // Enable Transmission complete interrupt - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); } } #endif - LUOS_COM->SR = 0xFFFFFFFF; + ROBUS_COM->SR = 0xFFFFFFFF; } /****************************************************************************** * @brief Process data transmit @@ -252,7 +252,7 @@ _CRITICAL void LUOS_COM_IRQHANDLER() ******************************************************************************/ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) { - while (LL_USART_IsActiveFlag_TXE(LUOS_COM) == RESET) + while (LL_USART_IsActiveFlag_TXE(ROBUS_COM) == RESET) ; // Disable RX detec pin if needed @@ -266,30 +266,30 @@ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) tx_data = data; #ifdef USE_TX_IT // Send the first byte - LL_USART_TransmitData8(LUOS_COM, *(tx_data++)); + LL_USART_TransmitData8(ROBUS_COM, *(tx_data++)); // Enable Transmission empty buffer interrupt to transmit next datas - LL_USART_EnableIT_TXE(LUOS_COM); + LL_USART_EnableIT_TXE(ROBUS_COM); // Disable Transmission complete interrupt - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); #else data_size_to_transmit = 0; // to not check IT TC during collision // Disable DMA to load new length to be tranmitted - LL_DMA_DisableStream(LUOS_DMA, LUOS_DMA_STREAM); + LL_DMA_DisableStream(ROBUS_DMA, ROBUS_DMA_STREAM); // Configure address to be transmitted by DMA - LL_DMA_SetMemoryAddress(LUOS_DMA, LUOS_DMA_STREAM, (uint32_t)data); + LL_DMA_SetMemoryAddress(ROBUS_DMA, ROBUS_DMA_STREAM, (uint32_t)data); // Set length to be tranmitted - LL_DMA_SetDataLength(LUOS_DMA, LUOS_DMA_STREAM, size); + LL_DMA_SetDataLength(ROBUS_DMA, ROBUS_DMA_STREAM, size); // Set request DMA - LL_USART_EnableDMAReq_TX(LUOS_COM); + LL_USART_EnableDMAReq_TX(ROBUS_COM); // clear flag shity way must be change - LUOS_DMA->HIFCR = 0xFFFFFFFF; - LUOS_DMA->LIFCR = 0xFFFFFFFF; + ROBUS_DMA->HIFCR = 0xFFFFFFFF; + ROBUS_DMA->LIFCR = 0xFFFFFFFF; // Enable TX RobusHAL_SetTxState(true); // Enable DMA again - LL_DMA_EnableStream(LUOS_DMA, LUOS_DMA_STREAM); + LL_DMA_EnableStream(ROBUS_DMA, ROBUS_DMA_STREAM); // Enable transmit complete - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); #endif } else @@ -297,14 +297,14 @@ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) // Wait before send ack data_size_to_transmit = 1; // This is a patch du to difference MCU frequency - while (LL_TIM_GetCounter(LUOS_TIMER) < TIMEOUT_ACK) + while (LL_TIM_GetCounter(ROBUS_TIMER) < TIMEOUT_ACK) ; // Enable TX RobusHAL_SetTxState(true); // Transmit the only byte we have - LL_USART_TransmitData8(LUOS_COM, *data); + LL_USART_TransmitData8(ROBUS_COM, *data); // Enable Transmission complete interrupt because we only have one. - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); } RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); } @@ -338,7 +338,7 @@ _CRITICAL uint8_t RobusHAL_GetTxLockState(void) uint8_t result = false; #ifdef USART_ISR_BUSY - if (LL_USART_IsActiveFlag_BUSY(LUOS_COM) == true) + if (LL_USART_IsActiveFlag_BUSY(ROBUS_COM) == true) { RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); result = true; @@ -371,18 +371,18 @@ static void RobusHAL_TimeoutInit(void) LL_TIM_InitTypeDef TimerInit = {0}; // initialize clock - LUOS_TIMER_CLOCK_ENABLE(); + ROBUS_TIMER_CLOCK_ENABLE(); TimerInit.Autoreload = DEFAULT_TIMEOUT; TimerInit.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1; TimerInit.CounterMode = LL_TIM_COUNTERMODE_UP; TimerInit.Prescaler = Timer_Prescaler - 1; TimerInit.RepetitionCounter = 0; - while (LL_TIM_Init(LUOS_TIMER, &TimerInit) != SUCCESS) + while (LL_TIM_Init(ROBUS_TIMER, &TimerInit) != SUCCESS) ; - LL_TIM_EnableIT_UPDATE(LUOS_TIMER); - HAL_NVIC_SetPriority(LUOS_TIMER_IRQ, 0, 2); - HAL_NVIC_EnableIRQ(LUOS_TIMER_IRQ); + LL_TIM_EnableIT_UPDATE(ROBUS_TIMER); + HAL_NVIC_SetPriority(ROBUS_TIMER_IRQ, 0, 2); + HAL_NVIC_EnableIRQ(ROBUS_TIMER_IRQ); } /****************************************************************************** * @brief Luos Timeout for Rx communication @@ -391,14 +391,14 @@ static void RobusHAL_TimeoutInit(void) ******************************************************************************/ _CRITICAL void RobusHAL_ResetTimeout(uint16_t nbrbit) { - LL_TIM_DisableCounter(LUOS_TIMER); - NVIC_ClearPendingIRQ(LUOS_TIMER_IRQ); // Clear IT pending NVIC - LL_TIM_ClearFlag_UPDATE(LUOS_TIMER); - LL_TIM_SetCounter(LUOS_TIMER, 0); // Reset counter + LL_TIM_DisableCounter(ROBUS_TIMER); + NVIC_ClearPendingIRQ(ROBUS_TIMER_IRQ); // Clear IT pending NVIC + LL_TIM_ClearFlag_UPDATE(ROBUS_TIMER); + LL_TIM_SetCounter(ROBUS_TIMER, 0); // Reset counter if (nbrbit != 0) { - LL_TIM_SetAutoReload(LUOS_TIMER, nbrbit); // reload value - LL_TIM_EnableCounter(LUOS_TIMER); + LL_TIM_SetAutoReload(ROBUS_TIMER, nbrbit); // reload value + LL_TIM_EnableCounter(ROBUS_TIMER); } } /****************************************************************************** @@ -406,12 +406,12 @@ _CRITICAL void RobusHAL_ResetTimeout(uint16_t nbrbit) * @param None * @return None ******************************************************************************/ -_CRITICAL void LUOS_TIMER_IRQHANDLER() +_CRITICAL void ROBUS_TIMER_IRQHANDLER() { - if (LL_TIM_IsActiveFlag_UPDATE(LUOS_TIMER) != RESET) + if (LL_TIM_IsActiveFlag_UPDATE(ROBUS_TIMER) != RESET) { - LL_TIM_ClearFlag_UPDATE(LUOS_TIMER); - LL_TIM_DisableCounter(LUOS_TIMER); + LL_TIM_ClearFlag_UPDATE(ROBUS_TIMER); + LL_TIM_DisableCounter(ROBUS_TIMER); if ((ctx.tx.lock == true) && (RobusHAL_GetTxLockState() == false)) { // Enable RX detection pin if needed diff --git a/network/robus_network/HAL/STM32F4/robus_hal_config.h b/network/robus_network/HAL/STM32F4/robus_hal_config.h index 86e44f46e..0f130fa89 100644 --- a/network/robus_network/HAL/STM32F4/robus_hal_config.h +++ b/network/robus_network/HAL/STM32F4/robus_hal_config.h @@ -110,49 +110,49 @@ /******************************************************************************* * COM CONFIG ******************************************************************************/ -#ifndef LUOS_COM_CLOCK_ENABLE - #define LUOS_COM_CLOCK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE() +#ifndef ROBUS_COM_CLOCK_ENABLE + #define ROBUS_COM_CLOCK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE() #endif -#ifndef LUOS_COM - #define LUOS_COM USART1 +#ifndef ROBUS_COM + #define ROBUS_COM USART1 #endif -#ifndef LUOS_COM_IRQ - #define LUOS_COM_IRQ USART1_IRQn +#ifndef ROBUS_COM_IRQ + #define ROBUS_COM_IRQ USART1_IRQn #endif -#ifndef LUOS_COM_IRQHANDLER - #define LUOS_COM_IRQHANDLER() USART1_IRQHandler() +#ifndef ROBUS_COM_IRQHANDLER + #define ROBUS_COM_IRQHANDLER() USART1_IRQHandler() #endif /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#ifndef LUOS_DMA_CLOCK_ENABLE - #define LUOS_DMA_CLOCK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE(); +#ifndef ROBUS_DMA_CLOCK_ENABLE + #define ROBUS_DMA_CLOCK_ENABLE() __HAL_RCC_DMA2_CLK_ENABLE(); #endif -#ifndef LUOS_DMA - #define LUOS_DMA DMA2 +#ifndef ROBUS_DMA + #define ROBUS_DMA DMA2 #endif -#ifndef LUOS_DMA_STREAM - #define LUOS_DMA_STREAM LL_DMA_STREAM_7 +#ifndef ROBUS_DMA_STREAM + #define ROBUS_DMA_STREAM LL_DMA_STREAM_7 #endif -#ifndef LUOS_DMA_CHANNEL - #define LUOS_DMA_CHANNEL LL_DMA_CHANNEL_4 +#ifndef ROBUS_DMA_CHANNEL + #define ROBUS_DMA_CHANNEL LL_DMA_CHANNEL_4 #endif -#ifndef LUOS_DMA_REMAP - #define LUOS_DMA_REMAP 0 +#ifndef ROBUS_DMA_REMAP + #define ROBUS_DMA_REMAP 0 #endif /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#ifndef LUOS_TIMER_CLOCK_ENABLE - #define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM5_CLK_ENABLE() +#ifndef ROBUS_TIMER_CLOCK_ENABLE + #define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM5_CLK_ENABLE() #endif -#ifndef LUOS_TIMER - #define LUOS_TIMER TIM5 +#ifndef ROBUS_TIMER + #define ROBUS_TIMER TIM5 #endif -#ifndef LUOS_TIMER_IRQ - #define LUOS_TIMER_IRQ TIM5_IRQn +#ifndef ROBUS_TIMER_IRQ + #define ROBUS_TIMER_IRQ TIM5_IRQn #endif -#ifndef LUOS_TIMER_IRQHANDLER - #define LUOS_TIMER_IRQHANDLER() TIM5_IRQHandler() +#ifndef ROBUS_TIMER_IRQHANDLER + #define ROBUS_TIMER_IRQHANDLER() TIM5_IRQHandler() #endif #endif /* _RobusHAL_CONFIG_H_ */ diff --git a/network/robus_network/HAL/STM32G4/robus_hal.c b/network/robus_network/HAL/STM32G4/robus_hal.c index dc70622c2..d1800a356 100644 --- a/network/robus_network/HAL/STM32G4/robus_hal.c +++ b/network/robus_network/HAL/STM32G4/robus_hal.c @@ -91,12 +91,12 @@ void RobusHAL_Loop(void) ******************************************************************************/ void RobusHAL_ComInit(uint32_t Baudrate) { - LUOS_COM_CLOCK_ENABLE(); + ROBUS_COM_CLOCK_ENABLE(); LL_USART_InitTypeDef USART_InitStruct; // Initialise USART1 - LL_USART_Disable(LUOS_COM); + LL_USART_Disable(ROBUS_COM); USART_InitStruct.BaudRate = Baudrate; USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; USART_InitStruct.StopBits = LL_USART_STOPBITS_1; @@ -104,32 +104,32 @@ void RobusHAL_ComInit(uint32_t Baudrate) USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX_RX; USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; - while (LL_USART_Init(LUOS_COM, &USART_InitStruct) != SUCCESS) + while (LL_USART_Init(ROBUS_COM, &USART_InitStruct) != SUCCESS) ; - LL_USART_Enable(LUOS_COM); + LL_USART_Enable(ROBUS_COM); // Enable Reception interrupt - LL_USART_EnableIT_RXNE(LUOS_COM); + LL_USART_EnableIT_RXNE(ROBUS_COM); - HAL_NVIC_EnableIRQ(LUOS_COM_IRQ); - HAL_NVIC_SetPriority(LUOS_COM_IRQ, 0, 1); + HAL_NVIC_EnableIRQ(ROBUS_COM_IRQ); + HAL_NVIC_SetPriority(ROBUS_COM_IRQ, 0, 1); // Timeout Initialization Timer_Prescaler = (MCUFREQ / Baudrate) / TIMERDIV; RobusHAL_TimeoutInit(); #ifndef USE_TX_IT - LUOS_DMA_CLOCK_ENABLE(); - - LL_DMA_SetPeriphRequest(LUOS_DMA, LUOS_DMA_CHANNEL, LUOS_DMA_REQUEST); - LL_DMA_SetDataTransferDirection(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); - LL_DMA_SetChannelPriorityLevel(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); - LL_DMA_SetMode(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_MODE_NORMAL); - LL_DMA_SetPeriphIncMode(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); - LL_DMA_SetMemoryIncMode(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); - LL_DMA_SetPeriphSize(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); - LL_DMA_SetMemorySize(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); - LL_DMA_SetPeriphAddress(LUOS_DMA, LUOS_DMA_CHANNEL, (uint32_t)&LUOS_COM->TDR); + ROBUS_DMA_CLOCK_ENABLE(); + + LL_DMA_SetPeriphRequest(ROBUS_DMA, ROBUS_DMA_CHANNEL, ROBUS_DMA_REQUEST); + LL_DMA_SetDataTransferDirection(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); + LL_DMA_SetChannelPriorityLevel(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_MODE_NORMAL); + LL_DMA_SetPeriphIncMode(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); + LL_DMA_SetPeriphAddress(ROBUS_DMA, ROBUS_DMA_CHANNEL, (uint32_t)&ROBUS_COM->TDR); #endif } /****************************************************************************** @@ -160,13 +160,13 @@ _CRITICAL void RobusHAL_SetTxState(uint8_t Enable) // Stop current transmit operation data_size_to_transmit = 0; // Disable Transmission empty buffer interrupt - LL_USART_DisableIT_TXE(LUOS_COM); + LL_USART_DisableIT_TXE(ROBUS_COM); #else - LL_USART_DisableDMAReq_TX(LUOS_COM); - LL_DMA_DisableChannel(LUOS_DMA, LUOS_DMA_CHANNEL); + LL_USART_DisableDMAReq_TX(ROBUS_COM); + LL_DMA_DisableChannel(ROBUS_DMA, ROBUS_DMA_CHANNEL); #endif // Disable Transmission complete interrupt - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); } } /****************************************************************************** @@ -178,14 +178,14 @@ _CRITICAL void RobusHAL_SetRxState(uint8_t Enable) { if (Enable == true) { - LL_USART_RequestRxDataFlush(LUOS_COM); // Clear data register - LL_USART_EnableDirectionRx(LUOS_COM); - LL_USART_EnableIT_RXNE(LUOS_COM); // Enable Rx IT + LL_USART_RequestRxDataFlush(ROBUS_COM); // Clear data register + LL_USART_EnableDirectionRx(ROBUS_COM); + LL_USART_EnableIT_RXNE(ROBUS_COM); // Enable Rx IT } else { - LL_USART_DisableDirectionRx(LUOS_COM); - LL_USART_DisableIT_RXNE(LUOS_COM); // Disable Rx IT + LL_USART_DisableDirectionRx(ROBUS_COM); + LL_USART_DisableIT_RXNE(ROBUS_COM); // Disable Rx IT } } /****************************************************************************** @@ -193,30 +193,30 @@ _CRITICAL void RobusHAL_SetRxState(uint8_t Enable) * @param None * @return None ******************************************************************************/ -_CRITICAL void LUOS_COM_IRQHANDLER() +_CRITICAL void ROBUS_COM_IRQHANDLER() { // Reset timeout to it's default value RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); // reception management - if ((LL_USART_IsActiveFlag_RXNE(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_RXNE(LUOS_COM) != RESET)) + if ((LL_USART_IsActiveFlag_RXNE(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_RXNE(ROBUS_COM) != RESET)) { // We receive a byte - uint8_t data = LL_USART_ReceiveData8(LUOS_COM); + uint8_t data = LL_USART_ReceiveData8(ROBUS_COM); Recep_data(&data); // send reception byte to state machine if (data_size_to_transmit == 0) { - LUOS_COM->ICR = 0xFFFFFFFF; + ROBUS_COM->ICR = 0xFFFFFFFF; return; } } - else if (LL_USART_IsActiveFlag_FE(LUOS_COM) != RESET) + else if (LL_USART_IsActiveFlag_FE(ROBUS_COM) != RESET) { // Framing ERROR ctx.rx.status.rx_framing_error = true; } // Transmission management - if ((LL_USART_IsActiveFlag_TC(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_TC(LUOS_COM) != RESET)) + if ((LL_USART_IsActiveFlag_TC(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_TC(ROBUS_COM) != RESET)) { // Transmission complete data_size_to_transmit = 0; @@ -224,26 +224,26 @@ _CRITICAL void LUOS_COM_IRQHANDLER() RobusHAL_SetTxState(false); RobusHAL_SetRxState(true); // Disable transmission complete IRQ - LL_USART_ClearFlag_TC(LUOS_COM); - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_ClearFlag_TC(ROBUS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); } #ifdef USE_TX_IT - else if ((LL_USART_IsActiveFlag_TXE(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_TXE(LUOS_COM) != RESET)) + else if ((LL_USART_IsActiveFlag_TXE(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_TXE(ROBUS_COM) != RESET)) { // Transmit buffer empty (this is a software DMA) data_size_to_transmit--; - LL_USART_TransmitData8(LUOS_COM, *(tx_data++)); + LL_USART_TransmitData8(ROBUS_COM, *(tx_data++)); if (data_size_to_transmit == 0) { // Transmission complete, stop loading data and watch for the end of transmission // Disable Transmission empty buffer interrupt - LL_USART_DisableIT_TXE(LUOS_COM); + LL_USART_DisableIT_TXE(ROBUS_COM); // Enable Transmission complete interrupt - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); } } #endif - LUOS_COM->ICR = 0xFFFFFFFF; + ROBUS_COM->ICR = 0xFFFFFFFF; } /****************************************************************************** * @brief Process data transmit @@ -252,7 +252,7 @@ _CRITICAL void LUOS_COM_IRQHANDLER() ******************************************************************************/ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) { - while (LL_USART_IsActiveFlag_TXE(LUOS_COM) == RESET) + while (LL_USART_IsActiveFlag_TXE(ROBUS_COM) == RESET) ; // Disable RX detec pin if needed @@ -266,27 +266,27 @@ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) tx_data = data; #ifdef USE_TX_IT // Send the first byte - LL_USART_TransmitData8(LUOS_COM, *(tx_data++)); + LL_USART_TransmitData8(ROBUS_COM, *(tx_data++)); // Enable Transmission empty buffer interrupt to transmit next datas - LL_USART_EnableIT_TXE(LUOS_COM); + LL_USART_EnableIT_TXE(ROBUS_COM); // Disable Transmission complete interrupt - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); #else data_size_to_transmit = 0; // to not check IT TC during collision // Disable DMA to load new length to be tranmitted - LL_DMA_DisableChannel(LUOS_DMA, LUOS_DMA_CHANNEL); + LL_DMA_DisableChannel(ROBUS_DMA, ROBUS_DMA_CHANNEL); // configure address to be transmitted by DMA - LL_DMA_SetMemoryAddress(LUOS_DMA, LUOS_DMA_CHANNEL, (uint32_t)data); + LL_DMA_SetMemoryAddress(ROBUS_DMA, ROBUS_DMA_CHANNEL, (uint32_t)data); // set length to be tranmitted - LL_DMA_SetDataLength(LUOS_DMA, LUOS_DMA_CHANNEL, size); + LL_DMA_SetDataLength(ROBUS_DMA, ROBUS_DMA_CHANNEL, size); // set request DMA - LL_USART_EnableDMAReq_TX(LUOS_COM); + LL_USART_EnableDMAReq_TX(ROBUS_COM); // Enable TX RobusHAL_SetTxState(true); // Enable DMA again - LL_DMA_EnableChannel(LUOS_DMA, LUOS_DMA_CHANNEL); + LL_DMA_EnableChannel(ROBUS_DMA, ROBUS_DMA_CHANNEL); // enable transmit complete - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); #endif } else @@ -294,14 +294,14 @@ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) // Wait before send ack data_size_to_transmit = 1; // This is a patch du to difference MCU frequency - while (LL_TIM_GetCounter(LUOS_TIMER) < TIMEOUT_ACK) + while (LL_TIM_GetCounter(ROBUS_TIMER) < TIMEOUT_ACK) ; // Enable TX RobusHAL_SetTxState(true); // Transmit the only byte we have - LL_USART_TransmitData8(LUOS_COM, *data); + LL_USART_TransmitData8(ROBUS_COM, *data); // Enable Transmission complete interrupt because we only have one. - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); } RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); } @@ -335,7 +335,7 @@ _CRITICAL uint8_t RobusHAL_GetTxLockState(void) uint8_t result = false; #ifdef USART_ISR_BUSY - if (LL_USART_IsActiveFlag_BUSY(LUOS_COM) == true) + if (LL_USART_IsActiveFlag_BUSY(ROBUS_COM) == true) { RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); result = true; @@ -368,18 +368,18 @@ static void RobusHAL_TimeoutInit(void) LL_TIM_InitTypeDef TimerInit = {0}; // initialize clock - LUOS_TIMER_CLOCK_ENABLE(); + ROBUS_TIMER_CLOCK_ENABLE(); TimerInit.Autoreload = DEFAULT_TIMEOUT; TimerInit.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1; TimerInit.CounterMode = LL_TIM_COUNTERMODE_UP; TimerInit.Prescaler = Timer_Prescaler - 1; TimerInit.RepetitionCounter = 0; - while (LL_TIM_Init(LUOS_TIMER, &TimerInit) != SUCCESS) + while (LL_TIM_Init(ROBUS_TIMER, &TimerInit) != SUCCESS) ; - LL_TIM_EnableIT_UPDATE(LUOS_TIMER); - HAL_NVIC_SetPriority(LUOS_TIMER_IRQ, 0, 2); - HAL_NVIC_EnableIRQ(LUOS_TIMER_IRQ); + LL_TIM_EnableIT_UPDATE(ROBUS_TIMER); + HAL_NVIC_SetPriority(ROBUS_TIMER_IRQ, 0, 2); + HAL_NVIC_EnableIRQ(ROBUS_TIMER_IRQ); } /****************************************************************************** * @brief Luos Timeout communication @@ -388,14 +388,14 @@ static void RobusHAL_TimeoutInit(void) ******************************************************************************/ _CRITICAL void RobusHAL_ResetTimeout(uint16_t nbrbit) { - LL_TIM_DisableCounter(LUOS_TIMER); - NVIC_ClearPendingIRQ(LUOS_TIMER_IRQ); // Clear IT pending NVIC - LL_TIM_ClearFlag_UPDATE(LUOS_TIMER); - LL_TIM_SetCounter(LUOS_TIMER, 0); // Reset counter + LL_TIM_DisableCounter(ROBUS_TIMER); + NVIC_ClearPendingIRQ(ROBUS_TIMER_IRQ); // Clear IT pending NVIC + LL_TIM_ClearFlag_UPDATE(ROBUS_TIMER); + LL_TIM_SetCounter(ROBUS_TIMER, 0); // Reset counter if (nbrbit != 0) { - LL_TIM_SetAutoReload(LUOS_TIMER, nbrbit); // reload value - LL_TIM_EnableCounter(LUOS_TIMER); + LL_TIM_SetAutoReload(ROBUS_TIMER, nbrbit); // reload value + LL_TIM_EnableCounter(ROBUS_TIMER); } } /****************************************************************************** @@ -403,12 +403,12 @@ _CRITICAL void RobusHAL_ResetTimeout(uint16_t nbrbit) * @param None * @return None ******************************************************************************/ -_CRITICAL void LUOS_TIMER_IRQHANDLER() +_CRITICAL void ROBUS_TIMER_IRQHANDLER() { - if (LL_TIM_IsActiveFlag_UPDATE(LUOS_TIMER) != RESET) + if (LL_TIM_IsActiveFlag_UPDATE(ROBUS_TIMER) != RESET) { - LL_TIM_ClearFlag_UPDATE(LUOS_TIMER); - LL_TIM_DisableCounter(LUOS_TIMER); + LL_TIM_ClearFlag_UPDATE(ROBUS_TIMER); + LL_TIM_DisableCounter(ROBUS_TIMER); if ((ctx.tx.lock == true) && (RobusHAL_GetTxLockState() == false)) { // Enable RX detection pin if needed diff --git a/network/robus_network/HAL/STM32G4/robus_hal_config.h b/network/robus_network/HAL/STM32G4/robus_hal_config.h index 74277b865..d4ada2cdc 100644 --- a/network/robus_network/HAL/STM32G4/robus_hal_config.h +++ b/network/robus_network/HAL/STM32G4/robus_hal_config.h @@ -109,52 +109,52 @@ /******************************************************************************* * COM CONFIG ******************************************************************************/ -#ifndef LUOS_COM_CLOCK_ENABLE - #define LUOS_COM_CLOCK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE() +#ifndef ROBUS_COM_CLOCK_ENABLE + #define ROBUS_COM_CLOCK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE() #endif -#ifndef LUOS_COM - #define LUOS_COM USART1 +#ifndef ROBUS_COM + #define ROBUS_COM USART1 #endif -#ifndef LUOS_COM_IRQ - #define LUOS_COM_IRQ USART1_IRQn +#ifndef ROBUS_COM_IRQ + #define ROBUS_COM_IRQ USART1_IRQn #endif -#ifndef LUOS_COM_IRQHANDLER - #define LUOS_COM_IRQHANDLER() USART1_IRQHandler() +#ifndef ROBUS_COM_IRQHANDLER + #define ROBUS_COM_IRQHANDLER() USART1_IRQHandler() #endif /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#ifndef LUOS_DMA_CLOCK_ENABLE - #define LUOS_DMA_CLOCK_ENABLE() \ +#ifndef ROBUS_DMA_CLOCK_ENABLE + #define ROBUS_DMA_CLOCK_ENABLE() \ do \ { \ __HAL_RCC_DMA1_CLK_ENABLE(); \ __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ } while (0U) #endif -#ifndef LUOS_DMA - #define LUOS_DMA DMA1 +#ifndef ROBUS_DMA + #define ROBUS_DMA DMA1 #endif -#ifndef LUOS_DMA_CHANNEL - #define LUOS_DMA_CHANNEL LL_DMA_CHANNEL_1 +#ifndef ROBUS_DMA_CHANNEL + #define ROBUS_DMA_CHANNEL LL_DMA_CHANNEL_1 #endif -#ifndef LUOS_DMA_REQUEST - #define LUOS_DMA_REQUEST LL_DMAMUX_REQ_USART1_TX +#ifndef ROBUS_DMA_REQUEST + #define ROBUS_DMA_REQUEST LL_DMAMUX_REQ_USART1_TX #endif /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#ifndef LUOS_TIMER_CLOCK_ENABLE - #define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM7_CLK_ENABLE() +#ifndef ROBUS_TIMER_CLOCK_ENABLE + #define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM7_CLK_ENABLE() #endif -#ifndef LUOS_TIMER - #define LUOS_TIMER TIM7 +#ifndef ROBUS_TIMER + #define ROBUS_TIMER TIM7 #endif -#ifndef LUOS_TIMER_IRQ - #define LUOS_TIMER_IRQ TIM7_DAC_IRQn +#ifndef ROBUS_TIMER_IRQ + #define ROBUS_TIMER_IRQ TIM7_DAC_IRQn #endif -#ifndef LUOS_TIMER_IRQHANDLER - #define LUOS_TIMER_IRQHANDLER() TIM7_DAC_IRQHandler() +#ifndef ROBUS_TIMER_IRQHANDLER + #define ROBUS_TIMER_IRQHANDLER() TIM7_DAC_IRQHandler() #endif #endif /* _RobusHAL_CONFIG_H_ */ diff --git a/network/robus_network/HAL/STM32L0/robus_hal.c b/network/robus_network/HAL/STM32L0/robus_hal.c index 5a25f9417..285122905 100644 --- a/network/robus_network/HAL/STM32L0/robus_hal.c +++ b/network/robus_network/HAL/STM32L0/robus_hal.c @@ -89,12 +89,12 @@ void RobusHAL_Loop(void) ******************************************************************************/ void RobusHAL_ComInit(uint32_t Baudrate) { - LUOS_COM_CLOCK_ENABLE(); + ROBUS_COM_CLOCK_ENABLE(); LL_USART_InitTypeDef USART_InitStruct; // Initialise USART1 - LL_USART_Disable(LUOS_COM); + LL_USART_Disable(ROBUS_COM); USART_InitStruct.BaudRate = Baudrate; USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; USART_InitStruct.StopBits = LL_USART_STOPBITS_1; @@ -102,32 +102,32 @@ void RobusHAL_ComInit(uint32_t Baudrate) USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX_RX; USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; - while (LL_USART_Init(LUOS_COM, &USART_InitStruct) != SUCCESS) + while (LL_USART_Init(ROBUS_COM, &USART_InitStruct) != SUCCESS) ; - LL_USART_Enable(LUOS_COM); + LL_USART_Enable(ROBUS_COM); // Enable Reception interrupt - LL_USART_EnableIT_RXNE(LUOS_COM); + LL_USART_EnableIT_RXNE(ROBUS_COM); - HAL_NVIC_EnableIRQ(LUOS_COM_IRQ); - HAL_NVIC_SetPriority(LUOS_COM_IRQ, 0, 1); + HAL_NVIC_EnableIRQ(ROBUS_COM_IRQ); + HAL_NVIC_SetPriority(ROBUS_COM_IRQ, 0, 1); // Timeout Initialization Timer_Prescaler = (MCUFREQ / Baudrate) / TIMERDIV; RobusHAL_TimeoutInit(); #ifndef USE_TX_IT - LUOS_DMA_CLOCK_ENABLE(); - - LL_DMA_SetPeriphRequest(LUOS_DMA, LUOS_DMA_CHANNEL, LUOS_DMA_REQUEST); - LL_DMA_SetDataTransferDirection(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); - LL_DMA_SetChannelPriorityLevel(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); - LL_DMA_SetMode(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_MODE_NORMAL); - LL_DMA_SetPeriphIncMode(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); - LL_DMA_SetMemoryIncMode(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); - LL_DMA_SetPeriphSize(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); - LL_DMA_SetMemorySize(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); - LL_DMA_SetPeriphAddress(LUOS_DMA, LUOS_DMA_CHANNEL, (uint32_t)&LUOS_COM->TDR); + ROBUS_DMA_CLOCK_ENABLE(); + + LL_DMA_SetPeriphRequest(ROBUS_DMA, ROBUS_DMA_CHANNEL, ROBUS_DMA_REQUEST); + LL_DMA_SetDataTransferDirection(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); + LL_DMA_SetChannelPriorityLevel(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_MODE_NORMAL); + LL_DMA_SetPeriphIncMode(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); + LL_DMA_SetPeriphAddress(ROBUS_DMA, ROBUS_DMA_CHANNEL, (uint32_t)&ROBUS_COM->TDR); #endif } /****************************************************************************** @@ -158,13 +158,13 @@ void RobusHAL_SetTxState(uint8_t Enable) // Stop current transmit operation data_size_to_transmit = 0; // Disable Transmission empty buffer interrupt - LL_USART_DisableIT_TXE(LUOS_COM); + LL_USART_DisableIT_TXE(ROBUS_COM); #else - LL_USART_DisableDMAReq_TX(LUOS_COM); - LL_DMA_DisableChannel(LUOS_DMA, LUOS_DMA_CHANNEL); + LL_USART_DisableDMAReq_TX(ROBUS_COM); + LL_DMA_DisableChannel(ROBUS_DMA, ROBUS_DMA_CHANNEL); #endif // Disable Transmission complete interrupt - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); } } /****************************************************************************** @@ -176,14 +176,14 @@ void RobusHAL_SetRxState(uint8_t Enable) { if (Enable == true) { - LL_USART_RequestRxDataFlush(LUOS_COM); // Clear data register - LL_USART_EnableDirectionRx(LUOS_COM); - LL_USART_EnableIT_RXNE(LUOS_COM); // Enable Rx IT + LL_USART_RequestRxDataFlush(ROBUS_COM); // Clear data register + LL_USART_EnableDirectionRx(ROBUS_COM); + LL_USART_EnableIT_RXNE(ROBUS_COM); // Enable Rx IT } else { - LL_USART_DisableDirectionRx(LUOS_COM); - LL_USART_DisableIT_RXNE(LUOS_COM); // Disable Rx IT + LL_USART_DisableDirectionRx(ROBUS_COM); + LL_USART_DisableIT_RXNE(ROBUS_COM); // Disable Rx IT } } /****************************************************************************** @@ -191,31 +191,31 @@ void RobusHAL_SetRxState(uint8_t Enable) * @param None * @return None ******************************************************************************/ -void LUOS_COM_IRQHANDLER() +void ROBUS_COM_IRQHANDLER() { // Reset timeout to it's default value RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); // reception management - if ((LL_USART_IsActiveFlag_RXNE(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_RXNE(LUOS_COM) != RESET)) + if ((LL_USART_IsActiveFlag_RXNE(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_RXNE(ROBUS_COM) != RESET)) { // We receive a byte - uint8_t data = LL_USART_ReceiveData8(LUOS_COM); + uint8_t data = LL_USART_ReceiveData8(ROBUS_COM); Recep_data(&data); // send reception byte to state machine if (data_size_to_transmit == 0) { - LUOS_COM->ICR = 0xFFFFFFFF; + ROBUS_COM->ICR = 0xFFFFFFFF; return; } } - else if (LL_USART_IsActiveFlag_FE(LUOS_COM) != RESET) + else if (LL_USART_IsActiveFlag_FE(ROBUS_COM) != RESET) { // Framing ERROR ctx.rx.status.rx_framing_error = true; } // Transmission management - if ((LL_USART_IsActiveFlag_TC(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_TC(LUOS_COM) != RESET)) + if ((LL_USART_IsActiveFlag_TC(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_TC(ROBUS_COM) != RESET)) { // Transmission complete data_size_to_transmit = 0; @@ -223,26 +223,26 @@ void LUOS_COM_IRQHANDLER() RobusHAL_SetTxState(false); RobusHAL_SetRxState(true); // Disable transmission complete IRQ - LL_USART_ClearFlag_TC(LUOS_COM); - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_ClearFlag_TC(ROBUS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); } #ifdef USE_TX_IT - else if ((LL_USART_IsActiveFlag_TXE(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_TXE(LUOS_COM) != RESET)) + else if ((LL_USART_IsActiveFlag_TXE(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_TXE(ROBUS_COM) != RESET)) { // Transmit buffer empty (this is a software DMA) data_size_to_transmit--; - LL_USART_TransmitData8(LUOS_COM, *(tx_data++)); + LL_USART_TransmitData8(ROBUS_COM, *(tx_data++)); if (data_size_to_transmit == 0) { // Transmission complete, stop loading data and watch for the end of transmission // Disable Transmission empty buffer interrupt - LL_USART_DisableIT_TXE(LUOS_COM); + LL_USART_DisableIT_TXE(ROBUS_COM); // Enable Transmission complete interrupt - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); } } #endif - LUOS_COM->ICR = 0xFFFFFFFF; + ROBUS_COM->ICR = 0xFFFFFFFF; } /****************************************************************************** * @brief Process data transmit @@ -251,7 +251,7 @@ void LUOS_COM_IRQHANDLER() ******************************************************************************/ void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) { - while (LL_USART_IsActiveFlag_TXE(LUOS_COM) == RESET) + while (LL_USART_IsActiveFlag_TXE(ROBUS_COM) == RESET) ; // Disable RX detec pin if needed @@ -265,27 +265,27 @@ void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) tx_data = data; #ifdef USE_TX_IT // Send the first byte - LL_USART_TransmitData8(LUOS_COM, *(tx_data++)); + LL_USART_TransmitData8(ROBUS_COM, *(tx_data++)); // Enable Transmission empty buffer interrupt to transmit next datas - LL_USART_EnableIT_TXE(LUOS_COM); + LL_USART_EnableIT_TXE(ROBUS_COM); // Disable Transmission complete interrupt - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); #else data_size_to_transmit = 0; // Reset this value avoiding to check IT TC during collision // Disable DMA to load new length to be tranmitted - LL_DMA_DisableChannel(LUOS_DMA, LUOS_DMA_CHANNEL); + LL_DMA_DisableChannel(ROBUS_DMA, ROBUS_DMA_CHANNEL); // configure address to be transmitted by DMA - LL_DMA_SetMemoryAddress(LUOS_DMA, LUOS_DMA_CHANNEL, (uint32_t)data); + LL_DMA_SetMemoryAddress(ROBUS_DMA, ROBUS_DMA_CHANNEL, (uint32_t)data); // set length to be tranmitted - LL_DMA_SetDataLength(LUOS_DMA, LUOS_DMA_CHANNEL, size); + LL_DMA_SetDataLength(ROBUS_DMA, ROBUS_DMA_CHANNEL, size); // set request DMA - LL_USART_EnableDMAReq_TX(LUOS_COM); + LL_USART_EnableDMAReq_TX(ROBUS_COM); // Enable TX RobusHAL_SetTxState(true); // Enable DMA again - LL_DMA_EnableChannel(LUOS_DMA, LUOS_DMA_CHANNEL); + LL_DMA_EnableChannel(ROBUS_DMA, ROBUS_DMA_CHANNEL); // enable transmit complete - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); #endif } else @@ -293,14 +293,14 @@ void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) // wait before send ack data_size_to_transmit = 1; // this is a patch du to difference MCU frequency - while (LL_TIM_GetCounter(LUOS_TIMER) < TIMEOUT_ACK) + while (LL_TIM_GetCounter(ROBUS_TIMER) < TIMEOUT_ACK) ; // Enable TX RobusHAL_SetTxState(true); // Transmit the only byte we have - LL_USART_TransmitData8(LUOS_COM, *data); + LL_USART_TransmitData8(ROBUS_COM, *data); // Enable Transmission complete interrupt because we only have one. - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); } RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); } @@ -334,7 +334,7 @@ uint8_t RobusHAL_GetTxLockState(void) uint8_t result = false; #ifdef USART_ISR_BUSY - if (LL_USART_IsActiveFlag_BUSY(LUOS_COM) == true) + if (LL_USART_IsActiveFlag_BUSY(ROBUS_COM) == true) { RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); result = true; @@ -367,17 +367,17 @@ static void RobusHAL_TimeoutInit(void) LL_TIM_InitTypeDef TimerInit = {0}; // initialize clock - LUOS_TIMER_CLOCK_ENABLE(); + ROBUS_TIMER_CLOCK_ENABLE(); TimerInit.Autoreload = DEFAULT_TIMEOUT; TimerInit.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1; TimerInit.CounterMode = LL_TIM_COUNTERMODE_UP; TimerInit.Prescaler = Timer_Prescaler - 1; - while (LL_TIM_Init(LUOS_TIMER, &TimerInit) != SUCCESS) + while (LL_TIM_Init(ROBUS_TIMER, &TimerInit) != SUCCESS) ; - LL_TIM_EnableIT_UPDATE(LUOS_TIMER); - HAL_NVIC_SetPriority(LUOS_TIMER_IRQ, 0, 2); - HAL_NVIC_EnableIRQ(LUOS_TIMER_IRQ); + LL_TIM_EnableIT_UPDATE(ROBUS_TIMER); + HAL_NVIC_SetPriority(ROBUS_TIMER_IRQ, 0, 2); + HAL_NVIC_EnableIRQ(ROBUS_TIMER_IRQ); } /****************************************************************************** * @brief Luos Timeout communication @@ -386,14 +386,14 @@ static void RobusHAL_TimeoutInit(void) ******************************************************************************/ void RobusHAL_ResetTimeout(uint16_t nbrbit) { - LL_TIM_DisableCounter(LUOS_TIMER); - NVIC_ClearPendingIRQ(LUOS_TIMER_IRQ); // Clear IT pending NVIC - LL_TIM_ClearFlag_UPDATE(LUOS_TIMER); - LL_TIM_SetCounter(LUOS_TIMER, 0); // Reset counter + LL_TIM_DisableCounter(ROBUS_TIMER); + NVIC_ClearPendingIRQ(ROBUS_TIMER_IRQ); // Clear IT pending NVIC + LL_TIM_ClearFlag_UPDATE(ROBUS_TIMER); + LL_TIM_SetCounter(ROBUS_TIMER, 0); // Reset counter if (nbrbit != 0) { - LL_TIM_SetAutoReload(LUOS_TIMER, nbrbit); // reload value - LL_TIM_EnableCounter(LUOS_TIMER); + LL_TIM_SetAutoReload(ROBUS_TIMER, nbrbit); // reload value + LL_TIM_EnableCounter(ROBUS_TIMER); } } /****************************************************************************** @@ -401,12 +401,12 @@ void RobusHAL_ResetTimeout(uint16_t nbrbit) * @param None * @return None ******************************************************************************/ -void LUOS_TIMER_IRQHANDLER() +void ROBUS_TIMER_IRQHANDLER() { - if (LL_TIM_IsActiveFlag_UPDATE(LUOS_TIMER) != RESET) + if (LL_TIM_IsActiveFlag_UPDATE(ROBUS_TIMER) != RESET) { - LL_TIM_ClearFlag_UPDATE(LUOS_TIMER); - LL_TIM_DisableCounter(LUOS_TIMER); + LL_TIM_ClearFlag_UPDATE(ROBUS_TIMER); + LL_TIM_DisableCounter(ROBUS_TIMER); if ((ctx.tx.lock == true) && (RobusHAL_GetTxLockState() == false)) { // Enable RX detection pin if needed diff --git a/network/robus_network/HAL/STM32L0/robus_hal_config.h b/network/robus_network/HAL/STM32L0/robus_hal_config.h index 193d90d52..d7d4664f1 100644 --- a/network/robus_network/HAL/STM32L0/robus_hal_config.h +++ b/network/robus_network/HAL/STM32L0/robus_hal_config.h @@ -109,48 +109,48 @@ /******************************************************************************* * COM CONFIG ******************************************************************************/ -#ifndef LUOS_COM_CLOCK_ENABLE - #define LUOS_COM_CLOCK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE() +#ifndef ROBUS_COM_CLOCK_ENABLE + #define ROBUS_COM_CLOCK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE() #endif -#ifndef LUOS_COM - #define LUOS_COM USART1 +#ifndef ROBUS_COM + #define ROBUS_COM USART1 #endif -#ifndef LUOS_COM_IRQ - #define LUOS_COM_IRQ USART1_IRQn +#ifndef ROBUS_COM_IRQ + #define ROBUS_COM_IRQ USART1_IRQn #endif -#ifndef LUOS_COM_IRQHANDLER - #define LUOS_COM_IRQHANDLER() USART1_IRQHandler() +#ifndef ROBUS_COM_IRQHANDLER + #define ROBUS_COM_IRQHANDLER() USART1_IRQHandler() #endif /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#ifndef LUOS_DMA_CLOCK_ENABLE - #define LUOS_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); +#ifndef ROBUS_DMA_CLOCK_ENABLE + #define ROBUS_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); #endif -#ifndef LUOS_DMA - #define LUOS_DMA DMA1 +#ifndef ROBUS_DMA + #define ROBUS_DMA DMA1 #endif -#ifndef LUOS_DMA_CHANNEL - #define LUOS_DMA_CHANNEL LL_DMA_CHANNEL_2 +#ifndef ROBUS_DMA_CHANNEL + #define ROBUS_DMA_CHANNEL LL_DMA_CHANNEL_2 #endif -#ifndef LUOS_DMA_REQUEST - #define LUOS_DMA_REQUEST LL_DMA_REQUEST_3 +#ifndef ROBUS_DMA_REQUEST + #define ROBUS_DMA_REQUEST LL_DMA_REQUEST_3 #endif /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#ifndef LUOS_TIMER_CLOCK_ENABLE - #define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM6_CLK_ENABLE() +#ifndef ROBUS_TIMER_CLOCK_ENABLE + #define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM6_CLK_ENABLE() #endif -#ifndef LUOS_TIMER - #define LUOS_TIMER TIM6 +#ifndef ROBUS_TIMER + #define ROBUS_TIMER TIM6 #endif -#ifndef LUOS_TIMER_IRQ - #define LUOS_TIMER_IRQ TIM6_IRQn +#ifndef ROBUS_TIMER_IRQ + #define ROBUS_TIMER_IRQ TIM6_IRQn #endif -#ifndef LUOS_TIMER_IRQHANDLER - #define LUOS_TIMER_IRQHANDLER() TIM6_DAC_IRQHandler() +#ifndef ROBUS_TIMER_IRQHANDLER + #define ROBUS_TIMER_IRQHANDLER() TIM6_DAC_IRQHandler() #endif #endif /* _RobusHAL_CONFIG_H_ */ diff --git a/network/robus_network/HAL/STM32L4/robus_hal.c b/network/robus_network/HAL/STM32L4/robus_hal.c index aadc29a1f..5f8d7ec1f 100644 --- a/network/robus_network/HAL/STM32L4/robus_hal.c +++ b/network/robus_network/HAL/STM32L4/robus_hal.c @@ -91,12 +91,12 @@ void RobusHAL_Loop(void) ******************************************************************************/ void RobusHAL_ComInit(uint32_t Baudrate) { - LUOS_COM_CLOCK_ENABLE(); + ROBUS_COM_CLOCK_ENABLE(); LL_USART_InitTypeDef USART_InitStruct; // Initialise USART1 - LL_USART_Disable(LUOS_COM); + LL_USART_Disable(ROBUS_COM); USART_InitStruct.BaudRate = Baudrate; USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; USART_InitStruct.StopBits = LL_USART_STOPBITS_1; @@ -104,32 +104,32 @@ void RobusHAL_ComInit(uint32_t Baudrate) USART_InitStruct.TransferDirection = LL_USART_DIRECTION_TX_RX; USART_InitStruct.HardwareFlowControl = LL_USART_HWCONTROL_NONE; USART_InitStruct.OverSampling = LL_USART_OVERSAMPLING_16; - while (LL_USART_Init(LUOS_COM, &USART_InitStruct) != SUCCESS) + while (LL_USART_Init(ROBUS_COM, &USART_InitStruct) != SUCCESS) ; - LL_USART_Enable(LUOS_COM); + LL_USART_Enable(ROBUS_COM); // Enable Reception interrupt - LL_USART_EnableIT_RXNE(LUOS_COM); + LL_USART_EnableIT_RXNE(ROBUS_COM); - HAL_NVIC_EnableIRQ(LUOS_COM_IRQ); - HAL_NVIC_SetPriority(LUOS_COM_IRQ, 0, 1); + HAL_NVIC_EnableIRQ(ROBUS_COM_IRQ); + HAL_NVIC_SetPriority(ROBUS_COM_IRQ, 0, 1); // Timeout Initialization Timer_Prescaler = (MCUFREQ / Baudrate) / TIMERDIV; RobusHAL_TimeoutInit(); #ifndef USE_TX_IT - LUOS_DMA_CLOCK_ENABLE(); - - LL_DMA_SetPeriphRequest(LUOS_DMA, LUOS_DMA_CHANNEL, LUOS_DMA_REQUEST); - LL_DMA_SetDataTransferDirection(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); - LL_DMA_SetChannelPriorityLevel(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); - LL_DMA_SetMode(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_MODE_NORMAL); - LL_DMA_SetPeriphIncMode(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); - LL_DMA_SetMemoryIncMode(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); - LL_DMA_SetPeriphSize(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); - LL_DMA_SetMemorySize(LUOS_DMA, LUOS_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); - LL_DMA_SetPeriphAddress(LUOS_DMA, LUOS_DMA_CHANNEL, (uint32_t)&LUOS_COM->TDR); + ROBUS_DMA_CLOCK_ENABLE(); + + LL_DMA_SetPeriphRequest(ROBUS_DMA, ROBUS_DMA_CHANNEL, ROBUS_DMA_REQUEST); + LL_DMA_SetDataTransferDirection(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_DIRECTION_MEMORY_TO_PERIPH); + LL_DMA_SetChannelPriorityLevel(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_PRIORITY_LOW); + LL_DMA_SetMode(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_MODE_NORMAL); + LL_DMA_SetPeriphIncMode(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_PERIPH_NOINCREMENT); + LL_DMA_SetMemoryIncMode(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_MEMORY_INCREMENT); + LL_DMA_SetPeriphSize(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_PDATAALIGN_BYTE); + LL_DMA_SetMemorySize(ROBUS_DMA, ROBUS_DMA_CHANNEL, LL_DMA_MDATAALIGN_BYTE); + LL_DMA_SetPeriphAddress(ROBUS_DMA, ROBUS_DMA_CHANNEL, (uint32_t)&ROBUS_COM->TDR); #endif } /****************************************************************************** @@ -160,13 +160,13 @@ _CRITICAL void RobusHAL_SetTxState(uint8_t Enable) // Stop current transmit operation data_size_to_transmit = 0; // Disable Transmission empty buffer interrupt - LL_USART_DisableIT_TXE(LUOS_COM); + LL_USART_DisableIT_TXE(ROBUS_COM); #else - LL_USART_DisableDMAReq_TX(LUOS_COM); - LL_DMA_DisableChannel(LUOS_DMA, LUOS_DMA_CHANNEL); + LL_USART_DisableDMAReq_TX(ROBUS_COM); + LL_DMA_DisableChannel(ROBUS_DMA, ROBUS_DMA_CHANNEL); #endif // Disable Transmission complete interrupt - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); } } /****************************************************************************** @@ -178,14 +178,14 @@ _CRITICAL void RobusHAL_SetRxState(uint8_t Enable) { if (Enable == true) { - LL_USART_RequestRxDataFlush(LUOS_COM); // Clear data register - LL_USART_EnableDirectionRx(LUOS_COM); - LL_USART_EnableIT_RXNE(LUOS_COM); // Enable Rx IT + LL_USART_RequestRxDataFlush(ROBUS_COM); // Clear data register + LL_USART_EnableDirectionRx(ROBUS_COM); + LL_USART_EnableIT_RXNE(ROBUS_COM); // Enable Rx IT } else { - LL_USART_DisableDirectionRx(LUOS_COM); - LL_USART_DisableIT_RXNE(LUOS_COM); // Disable Rx IT + LL_USART_DisableDirectionRx(ROBUS_COM); + LL_USART_DisableIT_RXNE(ROBUS_COM); // Disable Rx IT } } /****************************************************************************** @@ -193,30 +193,30 @@ _CRITICAL void RobusHAL_SetRxState(uint8_t Enable) * @param None * @return None ******************************************************************************/ -_CRITICAL void LUOS_COM_IRQHANDLER() +_CRITICAL void ROBUS_COM_IRQHANDLER() { // Reset timeout to it's default value RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); // reception management - if ((LL_USART_IsActiveFlag_RXNE(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_RXNE(LUOS_COM) != RESET)) + if ((LL_USART_IsActiveFlag_RXNE(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_RXNE(ROBUS_COM) != RESET)) { // We receive a byte - uint8_t data = LL_USART_ReceiveData8(LUOS_COM); + uint8_t data = LL_USART_ReceiveData8(ROBUS_COM); Recep_data(&data); // send reception byte to state machine if (data_size_to_transmit == 0) { - LUOS_COM->ICR = 0xFFFFFFFF; + ROBUS_COM->ICR = 0xFFFFFFFF; return; } } - else if (LL_USART_IsActiveFlag_FE(LUOS_COM) != RESET) + else if (LL_USART_IsActiveFlag_FE(ROBUS_COM) != RESET) { // Framing ERROR ctx.rx.status.rx_framing_error = true; } // Transmission management - if ((LL_USART_IsActiveFlag_TC(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_TC(LUOS_COM) != RESET)) + if ((LL_USART_IsActiveFlag_TC(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_TC(ROBUS_COM) != RESET)) { // Transmission complete data_size_to_transmit = 0; @@ -224,26 +224,26 @@ _CRITICAL void LUOS_COM_IRQHANDLER() RobusHAL_SetTxState(false); RobusHAL_SetRxState(true); // Disable transmission complete IRQ - LL_USART_ClearFlag_TC(LUOS_COM); - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_ClearFlag_TC(ROBUS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); } #ifdef USE_TX_IT - else if ((LL_USART_IsActiveFlag_TXE(LUOS_COM) != RESET) && (LL_USART_IsEnabledIT_TXE(LUOS_COM) != RESET)) + else if ((LL_USART_IsActiveFlag_TXE(ROBUS_COM) != RESET) && (LL_USART_IsEnabledIT_TXE(ROBUS_COM) != RESET)) { // Transmit buffer empty (this is a software DMA) data_size_to_transmit--; - LL_USART_TransmitData8(LUOS_COM, *(tx_data++)); + LL_USART_TransmitData8(ROBUS_COM, *(tx_data++)); if (data_size_to_transmit == 0) { // Transmission complete, stop loading data and watch for the end of transmission // Disable Transmission empty buffer interrupt - LL_USART_DisableIT_TXE(LUOS_COM); + LL_USART_DisableIT_TXE(ROBUS_COM); // Enable Transmission complete interrupt - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); } } #endif - LUOS_COM->ICR = 0xFFFFFFFF; + ROBUS_COM->ICR = 0xFFFFFFFF; } /****************************************************************************** * @brief Process data transmit @@ -252,7 +252,7 @@ _CRITICAL void LUOS_COM_IRQHANDLER() ******************************************************************************/ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) { - while (LL_USART_IsActiveFlag_TXE(LUOS_COM) == RESET) + while (LL_USART_IsActiveFlag_TXE(ROBUS_COM) == RESET) ; // Disable RX detec pin if needed @@ -266,27 +266,27 @@ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) tx_data = data; #ifdef USE_TX_IT // Send the first byte - LL_USART_TransmitData8(LUOS_COM, *(tx_data++)); + LL_USART_TransmitData8(ROBUS_COM, *(tx_data++)); // Enable Transmission empty buffer interrupt to transmit next datas - LL_USART_EnableIT_TXE(LUOS_COM); + LL_USART_EnableIT_TXE(ROBUS_COM); // Disable Transmission complete interrupt - LL_USART_DisableIT_TC(LUOS_COM); + LL_USART_DisableIT_TC(ROBUS_COM); #else data_size_to_transmit = 0; // to not check IT TC during collision // Disable DMA to load new length to be tranmitted - LL_DMA_DisableChannel(LUOS_DMA, LUOS_DMA_CHANNEL); + LL_DMA_DisableChannel(ROBUS_DMA, ROBUS_DMA_CHANNEL); // configure address to be transmitted by DMA - LL_DMA_SetMemoryAddress(LUOS_DMA, LUOS_DMA_CHANNEL, (uint32_t)data); + LL_DMA_SetMemoryAddress(ROBUS_DMA, ROBUS_DMA_CHANNEL, (uint32_t)data); // set length to be tranmitted - LL_DMA_SetDataLength(LUOS_DMA, LUOS_DMA_CHANNEL, size); + LL_DMA_SetDataLength(ROBUS_DMA, ROBUS_DMA_CHANNEL, size); // set request DMA - LL_USART_EnableDMAReq_TX(LUOS_COM); + LL_USART_EnableDMAReq_TX(ROBUS_COM); // Enable TX RobusHAL_SetTxState(true); // Enable DMA again - LL_DMA_EnableChannel(LUOS_DMA, LUOS_DMA_CHANNEL); + LL_DMA_EnableChannel(ROBUS_DMA, ROBUS_DMA_CHANNEL); // enable transmit complete - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); #endif } else @@ -294,14 +294,14 @@ _CRITICAL void RobusHAL_ComTransmit(uint8_t *data, uint16_t size) // Wait before send ack data_size_to_transmit = 1; // This is a patch du to difference MCU frequency - while (LL_TIM_GetCounter(LUOS_TIMER) < TIMEOUT_ACK) + while (LL_TIM_GetCounter(ROBUS_TIMER) < TIMEOUT_ACK) ; // Enable TX RobusHAL_SetTxState(true); // Transmit the only byte we have - LL_USART_TransmitData8(LUOS_COM, *data); + LL_USART_TransmitData8(ROBUS_COM, *data); // Enable Transmission complete interrupt because we only have one. - LL_USART_EnableIT_TC(LUOS_COM); + LL_USART_EnableIT_TC(ROBUS_COM); } RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); } @@ -335,7 +335,7 @@ _CRITICAL uint8_t RobusHAL_GetTxLockState(void) uint8_t result = false; #ifdef USART_ISR_BUSY - if (LL_USART_IsActiveFlag_BUSY(LUOS_COM) == true) + if (LL_USART_IsActiveFlag_BUSY(ROBUS_COM) == true) { RobusHAL_ResetTimeout(DEFAULT_TIMEOUT); result = true; @@ -368,18 +368,18 @@ static void RobusHAL_TimeoutInit(void) LL_TIM_InitTypeDef TimerInit = {0}; // initialize clock - LUOS_TIMER_CLOCK_ENABLE(); + ROBUS_TIMER_CLOCK_ENABLE(); TimerInit.Autoreload = DEFAULT_TIMEOUT; TimerInit.ClockDivision = LL_TIM_CLOCKDIVISION_DIV1; TimerInit.CounterMode = LL_TIM_COUNTERMODE_UP; TimerInit.Prescaler = Timer_Prescaler - 1; TimerInit.RepetitionCounter = 0; - while (LL_TIM_Init(LUOS_TIMER, &TimerInit) != SUCCESS) + while (LL_TIM_Init(ROBUS_TIMER, &TimerInit) != SUCCESS) ; - LL_TIM_EnableIT_UPDATE(LUOS_TIMER); - HAL_NVIC_SetPriority(LUOS_TIMER_IRQ, 0, 2); - HAL_NVIC_EnableIRQ(LUOS_TIMER_IRQ); + LL_TIM_EnableIT_UPDATE(ROBUS_TIMER); + HAL_NVIC_SetPriority(ROBUS_TIMER_IRQ, 0, 2); + HAL_NVIC_EnableIRQ(ROBUS_TIMER_IRQ); } /****************************************************************************** * @brief Luos Timeout communication @@ -388,14 +388,14 @@ static void RobusHAL_TimeoutInit(void) ******************************************************************************/ _CRITICAL void RobusHAL_ResetTimeout(uint16_t nbrbit) { - LL_TIM_DisableCounter(LUOS_TIMER); - NVIC_ClearPendingIRQ(LUOS_TIMER_IRQ); // Clear IT pending NVIC - LL_TIM_ClearFlag_UPDATE(LUOS_TIMER); - LL_TIM_SetCounter(LUOS_TIMER, 0); // Reset counter + LL_TIM_DisableCounter(ROBUS_TIMER); + NVIC_ClearPendingIRQ(ROBUS_TIMER_IRQ); // Clear IT pending NVIC + LL_TIM_ClearFlag_UPDATE(ROBUS_TIMER); + LL_TIM_SetCounter(ROBUS_TIMER, 0); // Reset counter if (nbrbit != 0) { - LL_TIM_SetAutoReload(LUOS_TIMER, nbrbit); // reload value - LL_TIM_EnableCounter(LUOS_TIMER); + LL_TIM_SetAutoReload(ROBUS_TIMER, nbrbit); // reload value + LL_TIM_EnableCounter(ROBUS_TIMER); } } /****************************************************************************** @@ -403,12 +403,12 @@ _CRITICAL void RobusHAL_ResetTimeout(uint16_t nbrbit) * @param None * @return None ******************************************************************************/ -_CRITICAL void LUOS_TIMER_IRQHANDLER() +_CRITICAL void ROBUS_TIMER_IRQHANDLER() { - if (LL_TIM_IsActiveFlag_UPDATE(LUOS_TIMER) != RESET) + if (LL_TIM_IsActiveFlag_UPDATE(ROBUS_TIMER) != RESET) { - LL_TIM_ClearFlag_UPDATE(LUOS_TIMER); - LL_TIM_DisableCounter(LUOS_TIMER); + LL_TIM_ClearFlag_UPDATE(ROBUS_TIMER); + LL_TIM_DisableCounter(ROBUS_TIMER); if ((ctx.tx.lock == true) && (RobusHAL_GetTxLockState() == false)) { // Enable RX detection pin if needed diff --git a/network/robus_network/HAL/STM32L4/robus_hal_config.h b/network/robus_network/HAL/STM32L4/robus_hal_config.h index f9d0f992b..c7bdfb362 100644 --- a/network/robus_network/HAL/STM32L4/robus_hal_config.h +++ b/network/robus_network/HAL/STM32L4/robus_hal_config.h @@ -108,46 +108,46 @@ /******************************************************************************* * COM CONFIG ******************************************************************************/ -#ifndef LUOS_COM_CLOCK_ENABLE - #define LUOS_COM_CLOCK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE() +#ifndef ROBUS_COM_CLOCK_ENABLE + #define ROBUS_COM_CLOCK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE() #endif -#ifndef LUOS_COM - #define LUOS_COM USART1 +#ifndef ROBUS_COM + #define ROBUS_COM USART1 #endif -#ifndef LUOS_COM_IRQ - #define LUOS_COM_IRQ USART1_IRQn +#ifndef ROBUS_COM_IRQ + #define ROBUS_COM_IRQ USART1_IRQn #endif -#ifndef LUOS_COM_IRQHANDLER - #define LUOS_COM_IRQHANDLER() USART1_IRQHandler() +#ifndef ROBUS_COM_IRQHANDLER + #define ROBUS_COM_IRQHANDLER() USART1_IRQHandler() #endif /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#ifndef LUOS_DMA_CLOCK_ENABLE - #define LUOS_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); +#ifndef ROBUS_DMA_CLOCK_ENABLE + #define ROBUS_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); #endif -#ifndef LUOS_DMA - #define LUOS_DMA DMA1 +#ifndef ROBUS_DMA + #define ROBUS_DMA DMA1 #endif -#ifndef LUOS_DMA_CHANNEL - #define LUOS_DMA_CHANNEL LL_DMA_CHANNEL_4 +#ifndef ROBUS_DMA_CHANNEL + #define ROBUS_DMA_CHANNEL LL_DMA_CHANNEL_4 #endif -#ifndef LUOS_DMA_REQUEST - #define LUOS_DMA_REQUEST LL_DMA_REQUEST_2 +#ifndef ROBUS_DMA_REQUEST + #define ROBUS_DMA_REQUEST LL_DMA_REQUEST_2 #endif /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#ifndef LUOS_TIMER_CLOCK_ENABLE - #define LUOS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM7_CLK_ENABLE() +#ifndef ROBUS_TIMER_CLOCK_ENABLE + #define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM7_CLK_ENABLE() #endif -#ifndef LUOS_TIMER - #define LUOS_TIMER TIM7 +#ifndef ROBUS_TIMER + #define ROBUS_TIMER TIM7 #endif -#ifndef LUOS_TIMER_IRQ - #define LUOS_TIMER_IRQ TIM7_IRQn +#ifndef ROBUS_TIMER_IRQ + #define ROBUS_TIMER_IRQ TIM7_IRQn #endif -#ifndef LUOS_TIMER_IRQHANDLER - #define LUOS_TIMER_IRQHANDLER() TIM7_IRQHandler() +#ifndef ROBUS_TIMER_IRQHANDLER + #define ROBUS_TIMER_IRQHANDLER() TIM7_IRQHandler() #endif #endif /* _RobusHAL_CONFIG_H_ */ diff --git a/network/robus_network/HAL/STUB/robus_hal_config.h b/network/robus_network/HAL/STUB/robus_hal_config.h index 9e5394e34..6a54c1961 100644 --- a/network/robus_network/HAL/STUB/robus_hal_config.h +++ b/network/robus_network/HAL/STUB/robus_hal_config.h @@ -107,49 +107,49 @@ /******************************************************************************* * COM CONFIG ******************************************************************************/ -#ifndef LUOS_COM_CLOCK_ENABLE - #define LUOS_COM_CLOCK_ENABLE() X86_STUB +#ifndef ROBUS_COM_CLOCK_ENABLE + #define ROBUS_COM_CLOCK_ENABLE() X86_STUB #endif -#ifndef LUOS_COM - #define LUOS_COM X86_STUB // STUB +#ifndef ROBUS_COM + #define ROBUS_COM X86_STUB // STUB #endif -#ifndef LUOS_COM_IRQ - #define LUOS_COM_IRQ X86_STUB // STUB +#ifndef ROBUS_COM_IRQ + #define ROBUS_COM_IRQ X86_STUB // STUB #endif -#ifndef LUOS_COM_IRQHANDLER - #define LUOS_COM_IRQHANDLER() // STUB +#ifndef ROBUS_COM_IRQHANDLER + #define ROBUS_COM_IRQHANDLER() // STUB #endif /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#ifndef LUOS_DMA_CLOCK_ENABLE - #define LUOS_DMA_CLOCK_ENABLE() X86_STUB +#ifndef ROBUS_DMA_CLOCK_ENABLE + #define ROBUS_DMA_CLOCK_ENABLE() X86_STUB #endif -#ifndef LUOS_DMA - #define LUOS_DMA X86_STUB // STUB +#ifndef ROBUS_DMA + #define ROBUS_DMA X86_STUB // STUB #endif -#ifndef LUOS_DMA_CHANNEL - #define LUOS_DMA_CHANNEL X86_STUB // STUB +#ifndef ROBUS_DMA_CHANNEL + #define ROBUS_DMA_CHANNEL X86_STUB // STUB #endif -#ifndef LUOS_DMA_REMAP - #define LUOS_DMA_REMAP X86_STUB // STUB +#ifndef ROBUS_DMA_REMAP + #define ROBUS_DMA_REMAP X86_STUB // STUB #endif /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#ifndef LUOS_TIMER_CLOCK_ENABLE - #define LUOS_TIMER_LOCK_ENABLE() // STUB +#ifndef ROBUS_TIMER_CLOCK_ENABLE + #define ROBUS_TIMER_CLOCK_ENABLE() // STUB #endif -#ifndef LUOS_TIMER - #define LUOS_TIMER X86_STUB // STUB +#ifndef ROBUS_TIMER + #define ROBUS_TIMER X86_STUB // STUB #endif -#ifndef LUOS_TIMER_IRQ - #define LUOS_TIMER_IRQ X86_STUB // STUB +#ifndef ROBUS_TIMER_IRQ + #define ROBUS_TIMER_IRQ X86_STUB // STUB #endif -#ifndef LUOS_TIMER_IRQHANDLER - #define LUOS_TIMER_IRQHANDLER() x86_Timer_IRQHandler() +#ifndef ROBUS_TIMER_IRQHANDLER + #define ROBUS_TIMER_IRQHANDLER() x86_Timer_IRQHandler() #endif #endif /* _ROBUSHAL_CONFIG_H_ */ diff --git a/network/robus_network/HAL/template/robus_hal.c b/network/robus_network/HAL/template/robus_hal.c index ba0ee0e45..3cee9b0f0 100644 --- a/network/robus_network/HAL/template/robus_hal.c +++ b/network/robus_network/HAL/template/robus_hal.c @@ -210,7 +210,7 @@ void RobusHAL_SetRxState(uint8_t Enable) * @param None * @return None ******************************************************************************/ -void LUOS_COM_IRQHANDLER() +void ROBUS_COM_IRQHANDLER() { /************************************************************************* @@ -468,7 +468,7 @@ void RobusHAL_ResetTimeout(uint16_t nbrbit) * @param None * @return None ******************************************************************************/ -void LUOS_TIMER_IRQHANDLER() +void ROBUS_TIMER_IRQHANDLER() { /************************************************************************* * This is the callback function when a timout IRQ is raised. @@ -728,4 +728,4 @@ void RobusHAL_ComputeCRC(uint8_t *data, uint8_t *crc) } } #endif -} \ No newline at end of file +} diff --git a/network/robus_network/HAL/template/robus_hal_config.h b/network/robus_network/HAL/template/robus_hal_config.h index 76046d924..0e07ffe46 100644 --- a/network/robus_network/HAL/template/robus_hal_config.h +++ b/network/robus_network/HAL/template/robus_hal_config.h @@ -105,44 +105,44 @@ /******************************************************************************* * COM CONFIG ******************************************************************************/ -#ifndef LUOS_COM_CLOCK_ENABLE - #define LUOS_COM_CLOCK_ENABLE +#ifndef ROBUS_COM_CLOCK_ENABLE + #define ROBUS_COM_CLOCK_ENABLE #endif -#ifndef LUOS_COM - #define LUOS_COM +#ifndef ROBUS_COM + #define ROBUS_COM #endif -#ifndef LUOS_COM_IRQ - #define LUOS_COM_IRQ +#ifndef ROBUS_COM_IRQ + #define ROBUS_COM_IRQ #endif -#ifndef LUOS_COM_IRQHANDLER - #define LUOS_COM_IRQHANDLER() +#ifndef ROBUS_COM_IRQHANDLER + #define ROBUS_COM_IRQHANDLER() #endif /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#ifndef LUOS_DMA_CLOCK_ENABLE - #define LUOS_DMA_CLOCK_ENABLE +#ifndef ROBUS_DMA_CLOCK_ENABLE + #define ROBUS_DMA_CLOCK_ENABLE #endif -#ifndef LUOS_DMA - #define LUOS_DMA +#ifndef ROBUS_DMA + #define ROBUS_DMA #endif -#ifndef LUOS_DMA_CHANNEL - #define LUOS_DMA_CHANNEL +#ifndef ROBUS_DMA_CHANNEL + #define ROBUS_DMA_CHANNEL #endif /******************************************************************************* * COM TIMEOUT CONFIG ******************************************************************************/ -#ifndef LUOS_TIMER_LOCK_ENABLE - #define LUOS_TIMER_LOCK_ENABLE +#ifndef ROBUS_TIMER_CLOCK_ENABLE + #define ROBUS_TIMER_CLOCK_ENABLE #endif -#ifndef LUOS_TIMER - #define LUOS_TIMER +#ifndef ROBUS_TIMER + #define ROBUS_TIMER #endif -#ifndef LUOS_TIMER_IRQ - #define LUOS_TIMER_IRQ +#ifndef ROBUS_TIMER_IRQ + #define ROBUS_TIMER_IRQ #endif -#ifndef LUOS_TIMER_IRQHANDLER - #define LUOS_TIMER_IRQHANDLER() +#ifndef ROBUS_TIMER_IRQHANDLER + #define ROBUS_TIMER_IRQHANDLER() #endif #endif /* _RobusHAL_CONFIG_H_ */ diff --git a/test/_resources/node_config.h b/test/_resources/node_config.h index c82573e2d..6efcf7d6c 100644 --- a/test/_resources/node_config.h +++ b/test/_resources/node_config.h @@ -40,8 +40,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 25 -#define MSG_BUFFER_SIZE 25 * sizeof(msg_t) -#define MAX_MSG_NB 100 +#define MSG_BUFFER_SIZE 25 * sizeof(msg_t) +#define MAX_MSG_NB 100 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -86,7 +86,8 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | Node number in the device + * MAX_SERVICE_NUMBER | 20 | Service number in the device * GATE_BUFF_SIZE | 1024 | Json receive buffer size * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size diff --git a/tool_services/gate/TinyJSON/bootloader_ex.c b/tool_services/gate/TinyJSON/bootloader_ex.c index ce7b462e4..761ffc925 100644 --- a/tool_services/gate/TinyJSON/bootloader_ex.c +++ b/tool_services/gate/TinyJSON/bootloader_ex.c @@ -10,7 +10,7 @@ #include "luos_bootloader.h" #include "gate_config.h" #include "pipe_link.h" -#include "routing_table.h" +#include "_routing_table.h" /******************************************************************************* * Definitions diff --git a/tool_services/gate/TinyJSON/convert.c b/tool_services/gate/TinyJSON/convert.c index 07bd8a6ce..a07b5768d 100644 --- a/tool_services/gate/TinyJSON/convert.c +++ b/tool_services/gate/TinyJSON/convert.c @@ -14,6 +14,7 @@ #include "data_manager.h" #include "tiny-json.h" #include "bootloader_ex.h" +#include "_routing_table.h" #define MAX_JSON_FIELDS 50 diff --git a/tool_services/gate/pipe_link.c b/tool_services/gate/pipe_link.c index 94d4f845f..0af5fcecb 100644 --- a/tool_services/gate/pipe_link.c +++ b/tool_services/gate/pipe_link.c @@ -5,6 +5,7 @@ ******************************************************************************/ #include "pipe_link.h" #include "streaming.h" +#include "_routing_table.h" /******************************************************************************* * Definitions ******************************************************************************/ From 98154182557d637147e1613fb0bfc3eabfaf4f2b Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 19 Jul 2023 15:16:49 +0200 Subject: [PATCH 111/150] Add a serial_hal_config.h file --- .../HAL/ARDUINO/serial_hal_config.h | 102 ++++++++++++++++ .../HAL/ARDUINO/serial_network_hal.h | 37 +----- .../HAL/STM32F0/serial_hal_config.h | 102 ++++++++++++++++ .../HAL/STM32F0/serial_network_hal.h | 37 +----- .../HAL/STM32F4/serial_hal_config.h | 102 ++++++++++++++++ .../HAL/STM32F4/serial_network_hal.h | 37 +----- .../HAL/STM32G431/serial_hal_config.h | 112 ++++++++++++++++++ .../HAL/STM32G431/serial_network_hal.h | 48 +------- .../HAL/STM32G474/serial_hal_config.h | 112 ++++++++++++++++++ .../HAL/STM32G474/serial_network_hal.h | 49 +------- .../HAL/STM32L4/serial_hal_config.h | 102 ++++++++++++++++ .../HAL/STM32L4/serial_network_hal.h | 37 +----- .../HAL/template/serial_hal_config.h | 102 ++++++++++++++++ .../HAL/template/serial_network_hal.h | 2 +- 14 files changed, 741 insertions(+), 240 deletions(-) create mode 100644 network/serial_network/HAL/ARDUINO/serial_hal_config.h create mode 100644 network/serial_network/HAL/STM32F0/serial_hal_config.h create mode 100644 network/serial_network/HAL/STM32F4/serial_hal_config.h create mode 100644 network/serial_network/HAL/STM32G431/serial_hal_config.h create mode 100644 network/serial_network/HAL/STM32G474/serial_hal_config.h create mode 100644 network/serial_network/HAL/STM32L4/serial_hal_config.h create mode 100644 network/serial_network/HAL/template/serial_hal_config.h diff --git a/network/serial_network/HAL/ARDUINO/serial_hal_config.h b/network/serial_network/HAL/ARDUINO/serial_hal_config.h new file mode 100644 index 000000000..fe8d1d9dc --- /dev/null +++ b/network/serial_network/HAL/ARDUINO/serial_hal_config.h @@ -0,0 +1,102 @@ +/****************************************************************************** + * @file serial_hal_config + * @brief This file allow you to configure serial_hal according to your design + * this is the default configuration created by Luos team for this MCU Family + * Do not modify this file. + * If you want to ovewrite some, overlap the defines in your node_config.h + * @MCU Family ARDUINO + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _SERIAL_HAL_CONFIG_H_ +#define _SERIAL_HAL_CONFIG_H_ + +// TX Pinout +#ifndef SERIAL_TX_CLK + #define SERIAL_TX_CLK() __HAL_RCC_GPIOB_CLK_ENABLE() +#endif +#ifndef SERIAL_TX_PIN + #define SERIAL_TX_PIN GPIO_PIN_10 +#endif +#ifndef SERIAL_TX_PORT + #define SERIAL_TX_PORT GPIOB +#endif +#ifndef SERIAL_TX_AF + #define SERIAL_TX_AF GPIO_AF4_USART3 +#endif + +// RX Pinout +#ifndef SERIAL_RX_CLK + #define SERIAL_RX_CLK() __HAL_RCC_GPIOB_CLK_ENABLE() +#endif +#ifndef SERIAL_RX_PIN + #define SERIAL_RX_PIN GPIO_PIN_11 +#endif +#ifndef SERIAL_RX_PORT + #define SERIAL_RX_PORT GPIOB +#endif +#ifndef SERIAL_RX_AF + #define SERIAL_RX_AF GPIO_AF4_USART3 +#endif + +// USART configuration +#ifndef SERIAL_COM_CLOCK_ENABLE + #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART3_CLK_ENABLE() +#endif +#ifndef SERIAL_COM + #define SERIAL_COM USART3 +#endif +#ifndef SERIAL_COM_IRQ + #define SERIAL_COM_IRQ USART3_4_IRQn +#endif +#ifndef SERIAL_COM_IRQHANDLER + #define SERIAL_COM_IRQHANDLER() USART3_4_IRQHandler() +#endif + +// RX DMA configuration +#ifndef SERIAL_RX_DMA_CLOCK_ENABLE + #define SERIAL_RX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() +#endif +#ifndef SERIAL_RX_DMA + #define SERIAL_RX_DMA DMA1 +#endif +#ifndef SERIAL_RX_DMA_CHANNEL + #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_6 +#endif +#ifndef SERIAL_RX_DMA_REQUEST + #define SERIAL_RX_DMA_REQUEST LL_SYSCFG_USART3_RMP_DMA1CH67 +#endif +#ifndef SERIAL_RX_DMA_TC + #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC6(SERIAL_RX_DMA) +#endif +#ifndef SERIAL_RX_DMA_CLEAR_TC + #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC6(SERIAL_RX_DMA) +#endif + +// TX DMA configuration +#ifndef SERIAL_TX_DMA_CLOCK_ENABLE + #define SERIAL_TX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() +#endif +#ifndef SERIAL_TX_DMA + #define SERIAL_TX_DMA DMA1 +#endif +#ifndef SERIAL_TX_DMA_CHANNEL + #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_7 +#endif +#ifndef SERIAL_TX_DMA_REQUEST + #define SERIAL_TX_DMA_REQUEST LL_SYSCFG_USART3_RMP_DMA1CH67 +#endif +#ifndef SERIAL_TX_DMA_TC + #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC7(SERIAL_TX_DMA) +#endif +#ifndef SERIAL_TX_DMA_CLEAR_TC + #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC7(SERIAL_TX_DMA) +#endif +#ifndef SERIAL_TX_DMA_IRQ + #define SERIAL_TX_DMA_IRQ DMA1_Channel4_5_6_7_IRQn +#endif +#ifndef SERIAL_TX_DMA_IRQHANDLER + #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel4_5_6_7_IRQHandler() +#endif + +#endif /* _SERIAL_HAL_CONFIG_H_ */ diff --git a/network/serial_network/HAL/ARDUINO/serial_network_hal.h b/network/serial_network/HAL/ARDUINO/serial_network_hal.h index e53eadaf2..db1d5d2b7 100644 --- a/network/serial_network/HAL/ARDUINO/serial_network_hal.h +++ b/network/serial_network/HAL/ARDUINO/serial_network_hal.h @@ -9,42 +9,7 @@ #define _SERIAL_HAL_H_ #include "stdint.h" - -// SERIAL_CONFIG need to be define in your node_config.h if you want to redefine -// SERIAL configuration usart or DMA If you need change something in this configuration -// you must redefine all the configuration in you node_config.h -#ifndef SERIAL_CONFIG - #define SERIAL_TX_CLK() __HAL_RCC_GPIOB_CLK_ENABLE() - #define SERIAL_TX_PIN GPIO_PIN_10 - #define SERIAL_TX_PORT GPIOB - #define SERIAL_TX_AF GPIO_AF4_USART3 - - #define SERIAL_RX_CLK() __HAL_RCC_GPIOB_CLK_ENABLE() - #define SERIAL_RX_PIN GPIO_PIN_11 - #define SERIAL_RX_PORT GPIOB - #define SERIAL_RX_AF GPIO_AF4_USART3 - - #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART3_CLK_ENABLE() - #define SERIAL_COM USART3 - #define SERIAL_COM_IRQ USART3_4_IRQn - #define SERIAL_COM_IRQHANDLER() USART3_4_IRQHandler() - - #define SERIAL_RX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() - #define SERIAL_RX_DMA DMA1 - #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_6 - #define SERIAL_RX_DMA_REQUEST LL_SYSCFG_USART3_RMP_DMA1CH67 - #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC6(SERIAL_RX_DMA) - #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC6(SERIAL_RX_DMA) - - #define SERIAL_TX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() - #define SERIAL_TX_DMA DMA1 - #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_7 - #define SERIAL_TX_DMA_REQUEST LL_SYSCFG_USART3_RMP_DMA1CH67 - #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC7(SERIAL_TX_DMA) - #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC7(SERIAL_TX_DMA) - #define SERIAL_TX_DMA_IRQ DMA1_Channel4_5_6_7_IRQn - #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel4_5_6_7_IRQHandler() -#endif +#include "serial_hal_config.h" void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); void SerialHAL_Loop(void); diff --git a/network/serial_network/HAL/STM32F0/serial_hal_config.h b/network/serial_network/HAL/STM32F0/serial_hal_config.h new file mode 100644 index 000000000..46ea253d2 --- /dev/null +++ b/network/serial_network/HAL/STM32F0/serial_hal_config.h @@ -0,0 +1,102 @@ +/****************************************************************************** + * @file serial_hal_config + * @brief This file allow you to configure serial_hal according to your design + * this is the default configuration created by Luos team for this MCU Family + * Do not modify this file. + * If you want to ovewrite some, overlap the defines in your node_config.h + * @MCU Family STM32FO + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _SERIAL_HAL_CONFIG_H_ +#define _SERIAL_HAL_CONFIG_H_ + +// TX Pinout +#ifndef SERIAL_TX_CLK + #define SERIAL_TX_CLK() __HAL_RCC_GPIOB_CLK_ENABLE() +#endif +#ifndef SERIAL_TX_PIN + #define SERIAL_TX_PIN GPIO_PIN_10 +#endif +#ifndef SERIAL_TX_PORT + #define SERIAL_TX_PORT GPIOB +#endif +#ifndef SERIAL_TX_AF + #define SERIAL_TX_AF GPIO_AF4_USART3 +#endif + +// RX Pinout +#ifndef SERIAL_RX_CLK + #define SERIAL_RX_CLK() __HAL_RCC_GPIOB_CLK_ENABLE() +#endif +#ifndef SERIAL_RX_PIN + #define SERIAL_RX_PIN GPIO_PIN_11 +#endif +#ifndef SERIAL_RX_PORT + #define SERIAL_RX_PORT GPIOB +#endif +#ifndef SERIAL_RX_AF + #define SERIAL_RX_AF GPIO_AF4_USART3 +#endif + +// USART configuration +#ifndef SERIAL_COM_CLOCK_ENABLE + #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART3_CLK_ENABLE() +#endif +#ifndef SERIAL_COM_CLOCK_DISABLE + #define SERIAL_COM USART3 +#endif +#ifndef SERIAL_COM_IRQ + #define SERIAL_COM_IRQ USART3_4_IRQn +#endif +#ifndef SERIAL_COM_IRQHANDLER + #define SERIAL_COM_IRQHANDLER() USART3_4_IRQHandler() +#endif + +// RX DMA configuration +#ifndef SERIAL_RX_DMA_CLOCK_ENABLE + #define SERIAL_RX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() +#endif +#ifndef SERIAL_RX_DMA + #define SERIAL_RX_DMA DMA1 +#endif +#ifndef SERIAL_RX_DMA_CHANNEL + #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_6 +#endif +#ifndef SERIAL_RX_DMA_REQUEST + #define SERIAL_RX_DMA_REQUEST LL_SYSCFG_USART3_RMP_DMA1CH67 +#endif +#ifndef SERIAL_RX_DMA_TC + #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC6(SERIAL_RX_DMA) +#endif +#ifndef SERIAL_RX_DMA_CLEAR_TC + #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC6(SERIAL_RX_DMA) +#endif + +// TX DMA configuration +#ifndef SERIAL_TX_DMA_CLOCK_ENABLE + #define SERIAL_TX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() +#endif +#ifndef SERIAL_TX_DMA + #define SERIAL_TX_DMA DMA1 +#endif +#ifndef SERIAL_TX_DMA_CHANNEL + #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_7 +#endif +#ifndef SERIAL_TX_DMA_REQUEST + #define SERIAL_TX_DMA_REQUEST LL_SYSCFG_USART3_RMP_DMA1CH67 +#endif +#ifndef SERIAL_TX_DMA_TC + #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC7(SERIAL_TX_DMA) +#endif +#ifndef SERIAL_TX_DMA_CLEAR_TC + #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC7(SERIAL_TX_DMA) +#endif +#ifndef SERIAL_TX_DMA_IRQ + #define SERIAL_TX_DMA_IRQ DMA1_Channel4_5_6_7_IRQn +#endif +#ifndef SERIAL_TX_DMA_IRQHANDLER + #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel4_5_6_7_IRQHandler() +#endif + +#endif /* _SERIAL_HAL_CONFIG_H_ */ diff --git a/network/serial_network/HAL/STM32F0/serial_network_hal.h b/network/serial_network/HAL/STM32F0/serial_network_hal.h index e53eadaf2..db1d5d2b7 100644 --- a/network/serial_network/HAL/STM32F0/serial_network_hal.h +++ b/network/serial_network/HAL/STM32F0/serial_network_hal.h @@ -9,42 +9,7 @@ #define _SERIAL_HAL_H_ #include "stdint.h" - -// SERIAL_CONFIG need to be define in your node_config.h if you want to redefine -// SERIAL configuration usart or DMA If you need change something in this configuration -// you must redefine all the configuration in you node_config.h -#ifndef SERIAL_CONFIG - #define SERIAL_TX_CLK() __HAL_RCC_GPIOB_CLK_ENABLE() - #define SERIAL_TX_PIN GPIO_PIN_10 - #define SERIAL_TX_PORT GPIOB - #define SERIAL_TX_AF GPIO_AF4_USART3 - - #define SERIAL_RX_CLK() __HAL_RCC_GPIOB_CLK_ENABLE() - #define SERIAL_RX_PIN GPIO_PIN_11 - #define SERIAL_RX_PORT GPIOB - #define SERIAL_RX_AF GPIO_AF4_USART3 - - #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART3_CLK_ENABLE() - #define SERIAL_COM USART3 - #define SERIAL_COM_IRQ USART3_4_IRQn - #define SERIAL_COM_IRQHANDLER() USART3_4_IRQHandler() - - #define SERIAL_RX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() - #define SERIAL_RX_DMA DMA1 - #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_6 - #define SERIAL_RX_DMA_REQUEST LL_SYSCFG_USART3_RMP_DMA1CH67 - #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC6(SERIAL_RX_DMA) - #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC6(SERIAL_RX_DMA) - - #define SERIAL_TX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() - #define SERIAL_TX_DMA DMA1 - #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_7 - #define SERIAL_TX_DMA_REQUEST LL_SYSCFG_USART3_RMP_DMA1CH67 - #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC7(SERIAL_TX_DMA) - #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC7(SERIAL_TX_DMA) - #define SERIAL_TX_DMA_IRQ DMA1_Channel4_5_6_7_IRQn - #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel4_5_6_7_IRQHandler() -#endif +#include "serial_hal_config.h" void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); void SerialHAL_Loop(void); diff --git a/network/serial_network/HAL/STM32F4/serial_hal_config.h b/network/serial_network/HAL/STM32F4/serial_hal_config.h new file mode 100644 index 000000000..daa8fbf0f --- /dev/null +++ b/network/serial_network/HAL/STM32F4/serial_hal_config.h @@ -0,0 +1,102 @@ +/****************************************************************************** + * @file serial_hal_config + * @brief This file allow you to configure serial_hal according to your design + * this is the default configuration created by Luos team for this MCU Family + * Do not modify this file. + * If you want to ovewrite some, overlap the defines in your node_config.h + * @MCU Family STM32F4 + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _SERIAL_HAL_CONFIG_H_ +#define _SERIAL_HAL_CONFIG_H_ + +// TX Pinout +#ifndef SERIAL_TX_CLK + #define SERIAL_TX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); +#endif +#ifndef SERIAL_TX_PIN + #define SERIAL_TX_PIN GPIO_PIN_2 +#endif +#ifndef SERIAL_TX_PORT + #define SERIAL_TX_PORT GPIOA +#endif +#ifndef SERIAL_TX_AF + #define SERIAL_TX_AF GPIO_AF7_USART2 +#endif + +// RX Pinout +#ifndef SERIAL_RX_CLK + #define SERIAL_RX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); +#endif +#ifndef SERIAL_RX_PIN + #define SERIAL_RX_PIN GPIO_PIN_3 +#endif +#ifndef SERIAL_RX_PORT + #define SERIAL_RX_PORT GPIOA +#endif +#ifndef SERIAL_RX_AF + #define SERIAL_RX_AF GPIO_AF7_USART2 +#endif + +// USART configuration +#ifndef SERIAL_COM_CLOCK_ENABLE + #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE() +#endif +#ifndef SERIAL_COM + #define SERIAL_COM USART2 +#endif +#ifndef SERIAL_COM_IRQ + #define SERIAL_COM_IRQ USART2_IRQn +#endif +#ifndef SERIAL_COM_IRQHANDLER + #define SERIAL_COM_IRQHANDLER() USART2_IRQHandler() +#endif + +// RX DMA configuration +#ifndef SERIAL_RX_DMA_CLOCK_ENABLE + #define SERIAL_RX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); +#endif +#ifndef SERIAL_RX_DMA + #define SERIAL_RX_DMA DMA1 +#endif +#ifndef SERIAL_RX_DMA_CHANNEL + #define SERIAL_RX_DMA_CHANNEL LL_DMA_STREAM_5 +#endif +#ifndef SERIAL_RX_DMA_REQUEST + #define SERIAL_RX_DMA_REQUEST LL_DMA_CHANNEL_4 +#endif +#ifndef SERIAL_RX_DMA_TC + #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC5(SERIAL_RX_DMA) +#endif +#ifndef SERIAL_RX_DMA_CLEAR_TC + #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC5(SERIAL_RX_DMA) +#endif + +// TX DMA configuration +#ifndef SERIAL_TX_DMA_CLOCK_ENABLE + #define SERIAL_TX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); +#endif +#ifndef SERIAL_TX_DMA + #define SERIAL_TX_DMA DMA1 +#endif +#ifndef SERIAL_TX_DMA_CHANNEL + #define SERIAL_TX_DMA_CHANNEL LL_DMA_STREAM_6 +#endif +#ifndef SERIAL_TX_DMA_REQUEST + #define SERIAL_TX_DMA_REQUEST LL_DMA_CHANNEL_4 +#endif +#ifndef SERIAL_TX_DMA_TC + #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC6(SERIAL_TX_DMA) +#endif +#ifndef SERIAL_TX_DMA_CLEAR_TC + #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC6(SERIAL_TX_DMA) +#endif +#ifndef SERIAL_TX_DMA_IRQ + #define SERIAL_TX_DMA_IRQ DMA1_Stream6_IRQn +#endif +#ifndef SERIAL_TX_DMA_IRQHANDLER + #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Stream6_IRQHandler() +#endif + +#endif /* _SERIAL_HAL_CONFIG_H_ */ diff --git a/network/serial_network/HAL/STM32F4/serial_network_hal.h b/network/serial_network/HAL/STM32F4/serial_network_hal.h index 27b596ddf..db1d5d2b7 100644 --- a/network/serial_network/HAL/STM32F4/serial_network_hal.h +++ b/network/serial_network/HAL/STM32F4/serial_network_hal.h @@ -9,42 +9,7 @@ #define _SERIAL_HAL_H_ #include "stdint.h" - -// SERIAL_CONFIG need to be define in your node_config.h if you want to redefine -// SERIAL configuration usart or DMA If you need change something in this configuration -// you must redefine all the configuration in you node_config.h -#ifndef SERIAL_CONFIG - #define SERIAL_TX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); - #define SERIAL_TX_PIN GPIO_PIN_2 - #define SERIAL_TX_PORT GPIOA - #define SERIAL_TX_AF GPIO_AF7_USART2 - - #define SERIAL_RX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); - #define SERIAL_RX_PIN GPIO_PIN_3 - #define SERIAL_RX_PORT GPIOA - #define SERIAL_RX_AF GPIO_AF7_USART2 - - #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE() - #define SERIAL_COM USART2 - #define SERIAL_COM_IRQ USART2_IRQn - #define SERIAL_COM_IRQHANDLER() USART2_IRQHandler() - - #define SERIAL_RX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); - #define SERIAL_RX_DMA DMA1 - #define SERIAL_RX_DMA_CHANNEL LL_DMA_STREAM_5 - #define SERIAL_RX_DMA_REQUEST LL_DMA_CHANNEL_4 - #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC5(SERIAL_RX_DMA) - #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC5(SERIAL_RX_DMA) - - #define SERIAL_TX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); - #define SERIAL_TX_DMA DMA1 - #define SERIAL_TX_DMA_CHANNEL LL_DMA_STREAM_6 - #define SERIAL_TX_DMA_REQUEST LL_DMA_CHANNEL_4 - #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC6(SERIAL_TX_DMA) - #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC6(SERIAL_TX_DMA) - #define SERIAL_TX_DMA_IRQ DMA1_Stream6_IRQn - #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Stream6_IRQHandler() -#endif +#include "serial_hal_config.h" void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); void SerialHAL_Loop(void); diff --git a/network/serial_network/HAL/STM32G431/serial_hal_config.h b/network/serial_network/HAL/STM32G431/serial_hal_config.h new file mode 100644 index 000000000..78a6a096c --- /dev/null +++ b/network/serial_network/HAL/STM32G431/serial_hal_config.h @@ -0,0 +1,112 @@ +/****************************************************************************** + * @file serial_hal_config + * @brief This file allow you to configure serial_hal according to your design + * this is the default configuration created by Luos team for this MCU Family + * Do not modify this file. + * If you want to ovewrite some, overlap the defines in your node_config.h + * @MCU Family STM32F431 + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _SERIAL_HAL_CONFIG_H_ +#define _SERIAL_HAL_CONFIG_H_ + +// TX Pinout +#ifndef SERIAL_TX_CLK + #define SERIAL_TX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); +#endif +#ifndef SERIAL_TX_PIN + #define SERIAL_TX_PIN GPIO_PIN_2 +#endif +#ifndef SERIAL_TX_PORT + #define SERIAL_TX_PORT GPIOA +#endif +#ifndef SERIAL_TX_AF + #define SERIAL_TX_AF GPIO_AF7_USART2 +#endif + +// RX Pinout +#ifndef SERIAL_RX_CLK + #define SERIAL_RX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); +#endif +#ifndef SERIAL_RX_PIN + #define SERIAL_RX_PIN GPIO_PIN_3 +#endif +#ifndef SERIAL_RX_PORT + #define SERIAL_RX_PORT GPIOA +#endif +#ifndef SERIAL_RX_AF + #define SERIAL_RX_AF GPIO_AF7_USART2 +#endif + +// USART configuration +#ifndef SERIAL_COM_CLOCK_ENABLE + #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE() +#endif +#ifndef SERIAL_COM + #define SERIAL_COM USART2 +#endif +#ifndef SERIAL_COM_IRQ + #define SERIAL_COM_IRQ USART2_IRQn +#endif +#ifndef SERIAL_COM_IRQHANDLER + #define SERIAL_COM_IRQHANDLER() USART2_IRQHandler() +#endif + +// RX DMA configuration +#ifndef SERIAL_RX_DMA_CLOCK_ENABLE + #define SERIAL_RX_DMA_CLOCK_ENABLE() \ + do \ + { \ + __HAL_RCC_DMA1_CLK_ENABLE(); \ + __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ + } while (0U) +#endif +#ifndef SERIAL_RX_DMA + #define SERIAL_RX_DMA DMA1 +#endif +#ifndef SERIAL_RX_DMA_CHANNEL + #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_3 +#endif +#ifndef SERIAL_RX_DMA_REQUEST + #define SERIAL_RX_DMA_REQUEST LL_DMAMUX_REQ_USART2_RX +#endif +#ifndef SERIAL_RX_DMA_TC + #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC3(SERIAL_RX_DMA) +#endif +#ifndef SERIAL_RX_DMA_CLEAR_TC + #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC3(SERIAL_RX_DMA) +#endif + +// TX DMA configuration +#ifndef SERIAL_TX_DMA_CLOCK_ENABLE + #define SERIAL_TX_DMA_CLOCK_ENABLE() \ + do \ + { \ + __HAL_RCC_DMA1_CLK_ENABLE(); \ + __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ + } while (0U) +#endif +#ifndef SERIAL_TX_DMA + #define SERIAL_TX_DMA DMA1 +#endif +#ifndef SERIAL_TX_DMA_CHANNEL + #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_4 +#endif +#ifndef SERIAL_TX_DMA_REQUEST + #define SERIAL_TX_DMA_REQUEST LL_DMAMUX_REQ_USART2_TX +#endif +#ifndef SERIAL_TX_DMA_TC + #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC4(SERIAL_TX_DMA) +#endif +#ifndef SERIAL_TX_DMA_CLEAR_TC + #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC4(SERIAL_TX_DMA) +#endif +#ifndef SERIAL_TX_DMA_IRQ + #define SERIAL_TX_DMA_IRQ DMA1_Channel4_IRQn +#endif +#ifndef SERIAL_TX_DMA_IRQHANDLER + #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel4_IRQHandler() +#endif + +#endif /* _SERIAL_HAL_CONFIG_H_ */ diff --git a/network/serial_network/HAL/STM32G431/serial_network_hal.h b/network/serial_network/HAL/STM32G431/serial_network_hal.h index 97bf5099f..db1d5d2b7 100644 --- a/network/serial_network/HAL/STM32G431/serial_network_hal.h +++ b/network/serial_network/HAL/STM32G431/serial_network_hal.h @@ -9,53 +9,7 @@ #define _SERIAL_HAL_H_ #include "stdint.h" - -// SERIAL_CONFIG need to be define in your node_config.h if you want to redefine -// SERIAL configuration usart or DMA If you need change something in this configuration -// you must redefine all the configuration in you node_config.h - -#ifndef SERIAL_CONFIG - #define SERIAL_TX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); - #define SERIAL_TX_PIN GPIO_PIN_2 - #define SERIAL_TX_PORT GPIOA - #define SERIAL_TX_AF GPIO_AF7_USART2 - - #define SERIAL_RX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); - #define SERIAL_RX_PIN GPIO_PIN_3 - #define SERIAL_RX_PORT GPIOA - #define SERIAL_RX_AF GPIO_AF7_USART2 - - #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE() - #define SERIAL_COM USART2 - #define SERIAL_COM_IRQ USART2_IRQn - #define SERIAL_COM_IRQHANDLER() USART2_IRQHandler() - - #define SERIAL_RX_DMA_CLOCK_ENABLE() \ - do \ - { \ - __HAL_RCC_DMA1_CLK_ENABLE(); \ - __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ - } while (0U) - #define SERIAL_RX_DMA DMA1 - #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_3 - #define SERIAL_RX_DMA_REQUEST LL_DMAMUX_REQ_USART2_RX - #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC3(SERIAL_RX_DMA) - #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC3(SERIAL_RX_DMA) - - #define SERIAL_TX_DMA_CLOCK_ENABLE() \ - do \ - { \ - __HAL_RCC_DMA1_CLK_ENABLE(); \ - __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ - } while (0U) - #define SERIAL_TX_DMA DMA1 - #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_4 - #define SERIAL_TX_DMA_REQUEST LL_DMAMUX_REQ_USART2_TX - #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC4(SERIAL_TX_DMA) - #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC4(SERIAL_TX_DMA) - #define SERIAL_TX_DMA_IRQ DMA1_Channel4_IRQn - #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel4_IRQHandler() -#endif +#include "serial_hal_config.h" void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); void SerialHAL_Loop(void); diff --git a/network/serial_network/HAL/STM32G474/serial_hal_config.h b/network/serial_network/HAL/STM32G474/serial_hal_config.h new file mode 100644 index 000000000..05243322f --- /dev/null +++ b/network/serial_network/HAL/STM32G474/serial_hal_config.h @@ -0,0 +1,112 @@ +/****************************************************************************** + * @file serial_hal_config + * @brief This file allow you to configure serial_hal according to your design + * this is the default configuration created by Luos team for this MCU Family + * Do not modify this file. + * If you want to ovewrite some, overlap the defines in your node_config.h + * @MCU Family STM32F474 + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _SERIAL_HAL_CONFIG_H_ +#define _SERIAL_HAL_CONFIG_H_ + +// TX Pinout +#ifndef SERIAL_TX_CLK + #define SERIAL_TX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); +#endif +#ifndef SERIAL_TX_PIN + #define SERIAL_TX_PIN GPIO_PIN_2 +#endif +#ifndef SERIAL_TX_PORT + #define SERIAL_TX_PORT GPIOA +#endif +#ifndef SERIAL_TX_AF + #define SERIAL_TX_AF GPIO_AF12_LPUART1 +#endif + +// RX Pinout +#ifndef SERIAL_RX_CLK + #define SERIAL_RX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); +#endif +#ifndef SERIAL_RX_PIN + #define SERIAL_RX_PIN GPIO_PIN_3 +#endif +#ifndef SERIAL_RX_PORT + #define SERIAL_RX_PORT GPIOA +#endif +#ifndef SERIAL_RX_AF + #define SERIAL_RX_AF GPIO_AF12_LPUART1 +#endif + +// USART configuration +#ifndef SERIAL_COM_CLOCK_ENABLE + #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_LPUART1_CLK_ENABLE() +#endif +#ifndef SERIAL_COM + #define SERIAL_COM LPUART1 +#endif +#ifndef SERIAL_COM_IRQ + #define SERIAL_COM_IRQ LPUART1_IRQn +#endif +#ifndef SERIAL_COM_IRQHANDLER + #define SERIAL_COM_IRQHANDLER() LPUART1_IRQHandler() +#endif + +// RX DMA configuration +#ifndef SERIAL_RX_DMA_CLOCK_ENABLE + #define SERIAL_RX_DMA_CLOCK_ENABLE() \ + do \ + { \ + __HAL_RCC_DMA1_CLK_ENABLE(); \ + __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ + } while (0U) +#endif +#ifndef SERIAL_RX_DMA + #define SERIAL_RX_DMA DMA1 +#endif +#ifndef SERIAL_RX_DMA_CHANNEL + #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_3 +#endif +#ifndef SERIAL_RX_DMA_REQUEST + #define SERIAL_RX_DMA_REQUEST LL_DMAMUX_REQ_LPUART1_RX +#endif +#ifndef SERIAL_RX_DMA_TC + #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC3(SERIAL_RX_DMA) +#endif +#ifndef SERIAL_RX_DMA_CLEAR_TC + #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC3(SERIAL_RX_DMA) +#endif + +// TX DMA configuration +#ifndef SERIAL_TX_DMA_CLOCK_ENABLE + #define SERIAL_TX_DMA_CLOCK_ENABLE() \ + do \ + { \ + __HAL_RCC_DMA1_CLK_ENABLE(); \ + __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ + } while (0U) +#endif +#ifndef SERIAL_TX_DMA + #define SERIAL_TX_DMA DMA1 +#endif +#ifndef SERIAL_TX_DMA_CHANNEL + #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_4 +#endif +#ifndef SERIAL_TX_DMA_REQUEST + #define SERIAL_TX_DMA_REQUEST LL_DMAMUX_REQ_LPUART1_TX +#endif +#ifndef SERIAL_TX_DMA_TC + #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC4(SERIAL_TX_DMA) +#endif +#ifndef SERIAL_TX_DMA_CLEAR_TC + #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC4(SERIAL_TX_DMA) +#endif +#ifndef SERIAL_TX_DMA_IRQ + #define SERIAL_TX_DMA_IRQ DMA1_Channel4_IRQn +#endif +#ifndef SERIAL_TX_DMA_IRQHANDLER + #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel4_IRQHandler() +#endif + +#endif /* _SERIAL_HAL_CONFIG_H_ */ diff --git a/network/serial_network/HAL/STM32G474/serial_network_hal.h b/network/serial_network/HAL/STM32G474/serial_network_hal.h index 9d10933b2..db1d5d2b7 100644 --- a/network/serial_network/HAL/STM32G474/serial_network_hal.h +++ b/network/serial_network/HAL/STM32G474/serial_network_hal.h @@ -9,54 +9,7 @@ #define _SERIAL_HAL_H_ #include "stdint.h" - -// SERIAL_CONFIG need to be define in your node_config.h if you want to redefine -// SERIAL configuration usart or DMA If you need change something in this configuration -// you must redefine all the configuration in you node_config.h - -// Nucleo G474RE configuration -#ifndef SERIAL_CONFIG - #define SERIAL_TX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); - #define SERIAL_TX_PIN GPIO_PIN_2 - #define SERIAL_TX_PORT GPIOA - #define SERIAL_TX_AF GPIO_AF12_LPUART1 - - #define SERIAL_RX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); - #define SERIAL_RX_PIN GPIO_PIN_3 - #define SERIAL_RX_PORT GPIOA - #define SERIAL_RX_AF GPIO_AF12_LPUART1 - - #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_LPUART1_CLK_ENABLE() - #define SERIAL_COM LPUART1 - #define SERIAL_COM_IRQ LPUART1_IRQn - #define SERIAL_COM_IRQHANDLER() LPUART1_IRQHandler() - - #define SERIAL_RX_DMA_CLOCK_ENABLE() \ - do \ - { \ - __HAL_RCC_DMA1_CLK_ENABLE(); \ - __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ - } while (0U) - #define SERIAL_RX_DMA DMA1 - #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_3 - #define SERIAL_RX_DMA_REQUEST LL_DMAMUX_REQ_LPUART1_RX - #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC3(SERIAL_RX_DMA) - #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC3(SERIAL_RX_DMA) - - #define SERIAL_TX_DMA_CLOCK_ENABLE() \ - do \ - { \ - __HAL_RCC_DMA1_CLK_ENABLE(); \ - __HAL_RCC_DMAMUX1_CLK_ENABLE(); \ - } while (0U) - #define SERIAL_TX_DMA DMA1 - #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_4 - #define SERIAL_TX_DMA_REQUEST LL_DMAMUX_REQ_LPUART1_TX - #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC4(SERIAL_TX_DMA) - #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC4(SERIAL_TX_DMA) - #define SERIAL_TX_DMA_IRQ DMA1_Channel4_IRQn - #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel4_IRQHandler() -#endif +#include "serial_hal_config.h" void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); void SerialHAL_Loop(void); diff --git a/network/serial_network/HAL/STM32L4/serial_hal_config.h b/network/serial_network/HAL/STM32L4/serial_hal_config.h new file mode 100644 index 000000000..4cce7927f --- /dev/null +++ b/network/serial_network/HAL/STM32L4/serial_hal_config.h @@ -0,0 +1,102 @@ +/****************************************************************************** + * @file serial_hal_config + * @brief This file allow you to configure serial_hal according to your design + * this is the default configuration created by Luos team for this MCU Family + * Do not modify this file. + * If you want to ovewrite some, overlap the defines in your node_config.h + * @MCU Family STM32L4 + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _SERIAL_HAL_CONFIG_H_ +#define _SERIAL_HAL_CONFIG_H_ + +// TX Pinout +#ifndef SERIAL_TX_CLK + #define SERIAL_TX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); +#endif +#ifndef SERIAL_TX_PIN + #define SERIAL_TX_PIN GPIO_PIN_2 +#endif +#ifndef SERIAL_TX_PORT + #define SERIAL_TX_PORT GPIOA +#endif +#ifndef SERIAL_TX_AF + #define SERIAL_TX_AF GPIO_AF7_USART2 +#endif + +// RX Pinout +#ifndef SERIAL_RX_CLK + #define SERIAL_RX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); +#endif +#ifndef SERIAL_RX_PIN + #define SERIAL_RX_PIN GPIO_PIN_15 +#endif +#ifndef SERIAL_RX_PORT + #define SERIAL_RX_PORT GPIOA +#endif +#ifndef SERIAL_RX_AF + #define SERIAL_RX_AF GPIO_AF3_USART2 +#endif + +// USART configuration +#ifndef SERIAL_COM_CLOCK_ENABLE + #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE() +#endif +#ifndef SERIAL_COM + #define SERIAL_COM USART2 +#endif +#ifndef SERIAL_COM_IRQ + #define SERIAL_COM_IRQ USART2_IRQn +#endif +#ifndef SERIAL_COM_IRQHANDLER + #define SERIAL_COM_IRQHANDLER() USART2_IRQHandler() +#endif + +// RX DMA configuration +#ifndef SERIAL_RX_DMA_CLOCK_ENABLE + #define SERIAL_RX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() +#endif +#ifndef SERIAL_RX_DMA + #define SERIAL_RX_DMA DMA1 +#endif +#ifndef SERIAL_RX_DMA_CHANNEL + #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_6 +#endif +#ifndef SERIAL_RX_DMA_REQUEST + #define SERIAL_RX_DMA_REQUEST LL_DMA_REQUEST_2 +#endif +#ifndef SERIAL_RX_DMA_TC + #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC6(SERIAL_RX_DMA) +#endif +#ifndef SERIAL_RX_DMA_CLEAR_TC + #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC6(SERIAL_RX_DMA) +#endif + +// TX DMA configuration +#ifndef SERIAL_TX_DMA_CLOCK_ENABLE + #define SERIAL_TX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE() +#endif +#ifndef SERIAL_TX_DMA + #define SERIAL_TX_DMA DMA1 +#endif +#ifndef SERIAL_TX_DMA_CHANNEL + #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_7 +#endif +#ifndef SERIAL_TX_DMA_REQUEST + #define SERIAL_TX_DMA_REQUEST LL_DMA_REQUEST_2 +#endif +#ifndef SERIAL_TX_DMA_TC + #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC7(SERIAL_TX_DMA) +#endif +#ifndef SERIAL_TX_DMA_CLEAR_TC + #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC7(SERIAL_TX_DMA) +#endif +#ifndef SERIAL_TX_DMA_IRQ + #define SERIAL_TX_DMA_IRQ DMA1_Channel7_IRQn +#endif +#ifndef SERIAL_TX_DMA_IRQHANDLER + #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel7_IRQHandler() +#endif + +#endif /* _SERIAL_HAL_CONFIG_H_ */ diff --git a/network/serial_network/HAL/STM32L4/serial_network_hal.h b/network/serial_network/HAL/STM32L4/serial_network_hal.h index ae33d2ff4..db1d5d2b7 100644 --- a/network/serial_network/HAL/STM32L4/serial_network_hal.h +++ b/network/serial_network/HAL/STM32L4/serial_network_hal.h @@ -9,42 +9,7 @@ #define _SERIAL_HAL_H_ #include "stdint.h" - -// SERIAL_CONFIG need to be define in your node_config.h if you want to redefine -// SERIAL configuration usart or DMA If you need change something in this configuration -// you must redefine all the configuration in you node_config.h -#ifndef SERIAL_CONFIG - #define SERIAL_TX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); - #define SERIAL_TX_PIN GPIO_PIN_2 - #define SERIAL_TX_PORT GPIOA - #define SERIAL_TX_AF GPIO_AF7_USART2 - - #define SERIAL_RX_CLK() __HAL_RCC_GPIOA_CLK_ENABLE(); - #define SERIAL_RX_PIN GPIO_PIN_15 - #define SERIAL_RX_PORT GPIOA - #define SERIAL_RX_AF GPIO_AF3_USART2 - - #define SERIAL_COM_CLOCK_ENABLE() __HAL_RCC_USART2_CLK_ENABLE() - #define SERIAL_COM USART2 - #define SERIAL_COM_IRQ USART2_IRQn - #define SERIAL_COM_IRQHANDLER() USART2_IRQHandler() - - #define SERIAL_RX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); - #define SERIAL_RX_DMA DMA1 - #define SERIAL_RX_DMA_CHANNEL LL_DMA_CHANNEL_6 - #define SERIAL_RX_DMA_REQUEST LL_DMA_REQUEST_2 - #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) LL_DMA_IsActiveFlag_TC6(SERIAL_RX_DMA) - #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) LL_DMA_ClearFlag_TC6(SERIAL_RX_DMA) - - #define SERIAL_TX_DMA_CLOCK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE(); - #define SERIAL_TX_DMA DMA1 - #define SERIAL_TX_DMA_CHANNEL LL_DMA_CHANNEL_7 - #define SERIAL_TX_DMA_REQUEST LL_DMA_REQUEST_2 - #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) LL_DMA_IsActiveFlag_TC7(SERIAL_TX_DMA) - #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) LL_DMA_ClearFlag_TC7(SERIAL_TX_DMA) - #define SERIAL_TX_DMA_IRQ DMA1_Channel7_IRQn - #define SERIAL_TX_DMA_IRQHANDLER() DMA1_Channel7_IRQHandler() -#endif +#include "serial_hal_config.h" void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); void SerialHAL_Loop(void); diff --git a/network/serial_network/HAL/template/serial_hal_config.h b/network/serial_network/HAL/template/serial_hal_config.h new file mode 100644 index 000000000..d2f20f664 --- /dev/null +++ b/network/serial_network/HAL/template/serial_hal_config.h @@ -0,0 +1,102 @@ +/****************************************************************************** + * @file serial_hal_config + * @brief This file allow you to configure serial_hal according to your design + * this is the default configuration created by Luos team for this MCU Family + * Do not modify this file. + * If you want to ovewrite some, overlap the defines in your node_config.h + * @MCU Family TEMPLATE + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _SERIAL_HAL_CONFIG_H_ +#define _SERIAL_HAL_CONFIG_H_ + +// TX Pinout +#ifndef SERIAL_TX_CLK + #define SERIAL_TX_CLK() DEFAULT_CLK_PORT_ENABLE(); +#endif +#ifndef SERIAL_TX_PIN + #define SERIAL_TX_PIN GPIO_PIN +#endif +#ifndef SERIAL_TX_PORT + #define SERIAL_TX_PORT GPIO_PORT +#endif +#ifndef SERIAL_TX_AF + #define SERIAL_TX_AF GPIO_AF +#endif + +// RX Pinout +#ifndef SERIAL_RX_CLK + #define SERIAL_RX_CLK() DEFAULT_CLK_PORT_ENABLE(); +#endif +#ifndef SERIAL_RX_PIN + #define SERIAL_RX_PIN GPIO_PIN +#endif +#ifndef SERIAL_RX_PORT + #define SERIAL_RX_PORT GPIO_PORT +#endif +#ifndef SERIAL_RX_AF + #define SERIAL_RX_AF GPIO_AF +#endif + +// USART configuration +#ifndef SERIAL_COM_CLOCK_ENABLE + #define SERIAL_COM_CLOCK_ENABLE() DEFAULT_CLK_SERIAL_ENABLE() +#endif +#ifndef SERIAL_COM + #define SERIAL_COM USART +#endif +#ifndef SERIAL_COM_IRQ + #define SERIAL_COM_IRQ USART_IRQn +#endif +#ifndef SERIAL_COM_IRQHANDLER + #define SERIAL_COM_IRQHANDLER() USART_IRQHandler() +#endif + +// RX DMA configuration +#ifndef SERIAL_RX_DMA_CLOCK_ENABLE + #define SERIAL_RX_DMA_CLOCK_ENABLE() DEFAULT_CLK_DMA_ENABLE() +#endif +#ifndef SERIAL_RX_DMA + #define SERIAL_RX_DMA DMA +#endif +#ifndef SERIAL_RX_DMA_CHANNEL + #define SERIAL_RX_DMA_CHANNEL DMA_CHANNEL +#endif +#ifndef SERIAL_RX_DMA_REQUEST + #define SERIAL_RX_DMA_REQUEST DMA_REQUEST +#endif +#ifndef SERIAL_RX_DMA_TC + #define SERIAL_RX_DMA_TC(SERIAL_RX_DMA) TRANSFERT_COMPLETE(SERIAL_RX_DMA) +#endif +#ifndef SERIAL_RX_DMA_CLEAR_TC + #define SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA) TRANSFERT_COMPLETE_CLEAR(SERIAL_RX_DMA) +#endif + +// TX DMA configuration +#ifndef SERIAL_TX_DMA_CLOCK_ENABLE + #define SERIAL_TX_DMA_CLOCK_ENABLE() DEFAULT_CLK_DMA_ENABLE() +#endif +#ifndef SERIAL_TX_DMA + #define SERIAL_TX_DMA DMA +#endif +#ifndef SERIAL_TX_DMA_CHANNEL + #define SERIAL_TX_DMA_CHANNEL DMA_CHANNEL +#endif +#ifndef SERIAL_TX_DMA_REQUEST + #define SERIAL_TX_DMA_REQUEST DMA_REQUEST +#endif +#ifndef SERIAL_TX_DMA_TC + #define SERIAL_TX_DMA_TC(SERIAL_TX_DMA) TRANSFERT_COMPLETE(SERIAL_TX_DMA) +#endif +#ifndef SERIAL_TX_DMA_CLEAR_TC + #define SERIAL_TX_DMA_CLEAR_TC(SERIAL_TX_DMA) TRANSFERT_COMPLETE_CLEAR(SERIAL_TX_DMA) +#endif +#ifndef SERIAL_TX_DMA_IRQ + #define SERIAL_TX_DMA_IRQ DMA_IRQn +#endif +#ifndef SERIAL_TX_DMA_IRQHANDLER + #define SERIAL_TX_DMA_IRQHANDLER() DMA_Channel_IRQHandler() +#endif + +#endif /* _SERIAL_HAL_CONFIG_H_ */ diff --git a/network/serial_network/HAL/template/serial_network_hal.h b/network/serial_network/HAL/template/serial_network_hal.h index 3af2174ef..c37b40455 100644 --- a/network/serial_network/HAL/template/serial_network_hal.h +++ b/network/serial_network/HAL/template/serial_network_hal.h @@ -9,7 +9,7 @@ #define _SERIAL_HAL_H_ #include "stdint.h" -#include "stdbool.h" +#include "serial_hal_config.h" void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size); // Init the serial communication void SerialHAL_Loop(void); // Do your loop stuff if needed From 6ed4ed211494f575ef10f202868da02be917daaf Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 19 Jul 2023 19:13:31 +0200 Subject: [PATCH 112/150] Improve luos_phy.h public interface and adapt robus and Serial --- engine/IO/inc/_luos_phy.h | 3 +- engine/IO/inc/luos_phy.h | 20 ++++---- engine/IO/inc/struct_phy.h | 5 +- engine/IO/src/luos_io.c | 2 +- engine/IO/src/luos_phy.c | 55 ++++++++++++++++++--- network/robus_network/src/port_manager.c | 6 +-- network/robus_network/src/reception.c | 12 ++--- network/robus_network/src/robus.c | 3 +- network/robus_network/src/transmission.c | 6 +-- network/serial_network/src/serial_network.c | 8 +-- test/tests_io/test_phy/main.c | 32 ++++++------ 11 files changed, 97 insertions(+), 55 deletions(-) diff --git a/engine/IO/inc/_luos_phy.h b/engine/IO/inc/_luos_phy.h index 1ae38eb31..9e80860c0 100644 --- a/engine/IO/inc/_luos_phy.h +++ b/engine/IO/inc/_luos_phy.h @@ -19,6 +19,7 @@ void Phy_ResetAll(void); bool Phy_Busy(void); void Phy_Loop(void); luos_phy_t *Phy_Get(uint8_t id, JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY reset_phy); -error_return_t Phy_FindNextNode(void); // Use it to find the next node as a master. +error_return_t Phy_FindNextNode(void); // Use it to find the next node as a master. +phy_job_t *Phy_GetNextJob(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to get the next job to send. #endif /* _PRIVATE_LUOS_PHY_H_ */ diff --git a/engine/IO/inc/luos_phy.h b/engine/IO/inc/luos_phy.h index 7d817e966..ea189c0d5 100644 --- a/engine/IO/inc/luos_phy.h +++ b/engine/IO/inc/luos_phy.h @@ -27,25 +27,27 @@ void Phy_SetIrqStateFunciton(IRQ_STATE irq_state); // Use it to reference your p void Phy_SetIrqState(bool state); // Use it to globally enable/disable all the phy irq. // Phy creation -luos_phy_t *Phy_Create(JOB_CB phy_cb, RUN_TOPO run_topo, RESET_PHY reset_phy); // Use it to reference your phy to Luos. +luos_phy_t *Phy_Create(JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY reset_phy); // Use it to reference your phy to Luos. // Topology management -void Phy_FindNextNodeJob(void); // Use it to find the next node that need to be detected accross phys. -void Phy_Topologysource(luos_phy_t *phy_ptr, uint8_t port_id); // The phy will call this function when a new node is detected on a specific port. +void Phy_TopologyNext(void); // Use it to find the next node that need to be detected accross phys. +void Phy_TopologySource(luos_phy_t *phy_ptr, uint8_t port_id); // The phy will call this function when a new node is detected on a specific port. void Phy_TopologyDone(luos_phy_t *phy_ptr); // The phy will call this function when all its port detection are done. // Rx management void Phy_ComputeHeader(luos_phy_t *phy_ptr); // After receiving the first 7 bytes (the header) call this function to compute how you should manage the incoming message. void Phy_ValidMsg(luos_phy_t *phy_ptr); // After receiving as much valid bytes as phy_ptr.rx_size, call this function to validate the message. +void Phy_ResetMsg(luos_phy_t *phy_ptr); // Call this function to reset the rx process. // Tx management -time_luos_t Phy_ComputeTimestamp(phy_job_t *job); -uint16_t Phy_GetNodeId(void); +time_luos_t Phy_ComputeMsgTimestamp(phy_job_t *job); // Use it to compute the timestamp of the message to send. +time_luos_t Phy_GetTimestamp(void); // Use it to get the current timestamp. +uint16_t Phy_GetNodeId(void); // Use it to get your current node id. (This can be used to compute priority or controled latency avoiding infinite collision condition) // Job management -void Phy_DeadTargetSpotted(luos_phy_t *phy_ptr, phy_job_t *job); // If some messages failed to be sent, call this function to consider the target as dead -phy_job_t *Phy_GetJob(luos_phy_t *phy_ptr); // Use it to get the first job to send. -phy_job_t *Phy_GetNextJob(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to get the next job to send. -void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to remove a job from your phy job list when it's done. +void Phy_FailedJob(luos_phy_t *phy_ptr, phy_job_t *job); // If some messages failed to be sent, call this function to consider the target as dead +phy_job_t *Phy_GetJob(luos_phy_t *phy_ptr); // Use it to get the first job to send. +void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to remove a job from your phy job list when it's done. +uint16_t Phy_GetJobNumber(luos_phy_t *phy_ptr); // Use it to get the number of job to send. #endif /* _LUOS_PHY_H_ */ diff --git a/engine/IO/inc/struct_phy.h b/engine/IO/inc/struct_phy.h index bb4663198..29d1cad63 100644 --- a/engine/IO/inc/struct_phy.h +++ b/engine/IO/inc/struct_phy.h @@ -10,6 +10,7 @@ #include #include #include "struct_luos.h" +#include "time_luos.h" /******************************************************************************* * Definitions @@ -46,8 +47,8 @@ typedef uint8_t phy_target_t; typedef struct luos_phy_t { // *************** RX information *************** - volatile int64_t rx_timestamp; // Timestamp of the last received message. We will use it to compute the date based on received latency. - uint8_t *rx_buffer_base; // Pointer to the base of the buffer where we will store the begining of received data. + volatile time_luos_t rx_timestamp; // Timestamp of the last received message. We will use it to compute the date based on received latency. + uint8_t *rx_buffer_base; // Pointer to the base of the buffer where we will store the begining of received data. union { volatile uint8_t *rx_data; // Pointer to write received bytes. diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index f6bf1783e..f407b74b5 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -445,7 +445,7 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) Luos_SendMsg(service, &output_msg); // This message can't be send directly to avoid dispatch re-entrance issue. // To be able to send this message then run the detection of the other nodes we need to make it later on the LuosIO_Loop, so we put a flag for it. - Phy_FindNextNodeJob(); + Phy_TopologyNext(); // This message have been consumed return SUCCEED; break; diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 328949487..c540cb3f6 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -203,7 +203,9 @@ void Phy_Loop(void) /****************************************************************************** * @brief Instanciate a physical layer - * @param phy_cb callback to call when we want to transmit a message + * @param job_cb callback to call when we want to transmit a message + * @param run_topo callback to call when we want to run the topology detection + * @param reset_phy callback to call when we want to reset the phy * @return None ******************************************************************************/ luos_phy_t *Phy_Create(JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY reset_phy) @@ -259,7 +261,7 @@ void Phy_SetIrqState(bool state) * @brief save a flag allowing to run a new discovering outside of IRQ (because this function is very long and can't be run in IRQ) * @return None ******************************************************************************/ -_CRITICAL void Phy_FindNextNodeJob(void) +_CRITICAL void Phy_TopologyNext(void) { phy_ctx.find_next_node_job = true; } @@ -341,7 +343,7 @@ error_return_t Phy_FindNextNode(void) * @param port_id id of the port detected in the phy * @return None ******************************************************************************/ -void Phy_Topologysource(luos_phy_t *phy_ptr, uint8_t port_id) +void Phy_TopologySource(luos_phy_t *phy_ptr, uint8_t port_id) { LUOS_ASSERT((phy_ptr != NULL) && (port_id < 0xFF)); @@ -374,7 +376,9 @@ port_t *Phy_GetTopologysource(void) /****************************************************************************** * @brief return the local physical layer (only used by LuosIO, this function is private) * @param id of the phy we want - * @param phy_cb callback to call when we want to transmit a message + * @param job_cb callback to call when we want to transmit a message + * @param run_topo callback to call when we want to run a topology detection + * @param reset_phy callback to call when we want to reset the phy * @return None ******************************************************************************/ luos_phy_t *Phy_Get(uint8_t id, JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY reset_phy) @@ -466,7 +470,7 @@ _CRITICAL void Phy_ValidMsg(luos_phy_t *phy_ptr) uint16_t my_job = phy_ctx.io_job_nb++; Phy_SetIrqState(true); // Now copy the data in the job - phy_ctx.io_job[my_job].timestamp = phy_ptr->rx_timestamp; + phy_ctx.io_job[my_job].timestamp = (uint64_t)TimeOD_TimeTo_ns(phy_ptr->rx_timestamp); phy_ctx.io_job[my_job].alloc_msg = (msg_t *)phy_ptr->rx_data; phy_ctx.io_job[my_job].phy_filter = phy_ptr->rx_phy_filter; phy_ctx.io_job[my_job].size = phy_ptr->rx_size; @@ -477,17 +481,41 @@ _CRITICAL void Phy_ValidMsg(luos_phy_t *phy_ptr) } } +/****************************************************************************** + * @brief Consider the message as failed and reset the phy + * @param phy_ptr Pointer to the phy concerned by the allocation + * @return None + ******************************************************************************/ +_CRITICAL void Phy_ResetMsg(luos_phy_t *phy_ptr) +{ + phy_ptr->received_data = 0; + phy_ptr->rx_size = 0; + phy_ptr->rx_keep = true; + phy_ptr->rx_alloc_job = false; + phy_ptr->rx_data = phy_ptr->rx_buffer_base; +} + /****************************************************************************** * @brief Compute the timestamp to send with the message * @param job Pointer to the job concerned by this message * @return None ******************************************************************************/ -time_luos_t Phy_ComputeTimestamp(phy_job_t *job) +time_luos_t Phy_ComputeMsgTimestamp(phy_job_t *job) { LUOS_ASSERT((job != NULL) && (job->msg_pt != NULL) && (job->timestamp == true)); return Timestamp_ConvertToLatency(job->msg_pt); } +/****************************************************************************** + * @brief Get the current timestamp + * @param None + * @return Timestamp value + ******************************************************************************/ +_CRITICAL time_luos_t Phy_GetTimestamp(void) +{ + return TimeOD_TimeFrom_ns((double)LuosHAL_GetTimestamp()); +} + /****************************************************************************** * @brief return the node id * @return Node ID value @@ -625,7 +653,7 @@ static void Phy_Dispatch(void) * @param job pointer to the job that failed. * @return None ******************************************************************************/ -_CRITICAL void Phy_DeadTargetSpotted(luos_phy_t *phy_ptr, phy_job_t *job) +_CRITICAL void Phy_FailedJob(luos_phy_t *phy_ptr, phy_job_t *job) { // A phy failed to send a message, we need to be sure that our node don't try to contact this target again. LUOS_ASSERT((job != NULL) @@ -734,7 +762,7 @@ static phy_job_t *Phy_AddJob(luos_phy_t *phy_ptr, phy_job_t *phy_job) * @param phy_ptr Phy to get the job from * @return Job pointer ******************************************************************************/ -_CRITICAL inline phy_job_t *Phy_GetJob(luos_phy_t *phy_ptr) +inline phy_job_t *Phy_GetJob(luos_phy_t *phy_ptr) { LUOS_ASSERT(phy_ptr != NULL); if (phy_ptr->job_nb == 0) @@ -841,6 +869,17 @@ _CRITICAL void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job) } } +/****************************************************************************** + * @brief Get the number of job in the phy queue + * @param phy_ptr Phy to get the job number from + * @return None + ******************************************************************************/ +inline uint16_t Phy_GetJobNumber(luos_phy_t *phy_ptr) +{ + LUOS_ASSERT(phy_ptr != NULL); + return phy_ptr->job_nb; +} + /****************************************************************************** * @brief define is there is something waiting to be sent or not * @return Succeed if nothing is waiting to be sent diff --git a/network/robus_network/src/port_manager.c b/network/robus_network/src/port_manager.c index 347e2f6a6..5bff7d5fc 100644 --- a/network/robus_network/src/port_manager.c +++ b/network/robus_network/src/port_manager.c @@ -90,7 +90,7 @@ _CRITICAL void PortMng_PtpHandler(uint8_t PortNbr) PortMng_Reset(); } // Ask Luos_phy to find another node - Phy_FindNextNodeJob(); + Phy_TopologyNext(); } else if (Port_ExpectedState == POKE) { @@ -102,7 +102,7 @@ _CRITICAL void PortMng_PtpHandler(uint8_t PortNbr) ctx.port.activ = PortNbr; // This port become the topology source of this node // Notify luos_phy about it - Phy_Topologysource(Robus_GetPhy(), PortNbr); + Phy_TopologySource(Robus_GetPhy(), PortNbr); } } /****************************************************************************** @@ -143,7 +143,7 @@ uint8_t PortMng_PokePort(uint8_t PortNbr) /****************************************************************************** * @brief being poked so poke next node to - * @param None + * @param portId pointer to the port id * @return true if a port have been poke else false ******************************************************************************/ error_return_t PortMng_PokeNextPort(uint8_t *portId) diff --git a/network/robus_network/src/reception.c b/network/robus_network/src/reception.c index 987fc393a..390eeb6e7 100644 --- a/network/robus_network/src/reception.c +++ b/network/robus_network/src/reception.c @@ -76,12 +76,11 @@ uint16_t crc_val = 0; // CRC value void Recep_Init(luos_phy_t *phy_robus) { LUOS_ASSERT(phy_robus != NULL); - LUOS_ASSERT(phy_robus->rx_alloc_job == false); // Initialize the reception state machine ctx.rx.status.unmap = 0; ctx.rx.callback = Recep_GetHeader; ctx.rx.status.identifier = 0xF; - phy_robus->rx_timestamp = 0; + phy_robus->rx_timestamp = TimeOD_TimeFrom_s(0.0); phy_robus->rx_buffer_base = data_rx; phy_robus->rx_data = data_rx; phy_robus->rx_keep = true; @@ -104,7 +103,7 @@ _CRITICAL void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data) // When we catch the first byte we timestamp the msg // We remove the time of the first byte to get the exact reception date. // 1 byte is 10 bits and we convert it to nanoseconds - phy_robus->rx_timestamp = LuosHAL_GetTimestamp() - ((uint32_t)10 * (uint32_t)1000000000 / (uint32_t)DEFAULTBAUDRATE); + phy_robus->rx_timestamp = TimeOD_TimeFrom_ns(TimeOD_TimeTo_ns(Phy_GetTimestamp()) - ((uint32_t)10 * (uint32_t)1000000000 / (uint32_t)DEFAULTBAUDRATE)); // Declare Robus as busy ctx.tx.lock = true; @@ -281,11 +280,8 @@ _CRITICAL void Recep_Timeout(void) ******************************************************************************/ _CRITICAL void Recep_Reset(void) { - luos_phy_t *phy_robus = Robus_GetPhy(); - phy_robus->received_data = 0; - phy_robus->rx_size = 0; - phy_robus->rx_keep = true; - phy_robus->rx_alloc_job = false; + luos_phy_t *phy_robus = Robus_GetPhy(); + Phy_ResetMsg(phy_robus); crc_val = 0xFFFF; ctx.rx.status.rx_framing_error = false; ctx.rx.status.rx_error = false; diff --git a/network/robus_network/src/robus.c b/network/robus_network/src/robus.c index 4faf22f3e..dc2c5003d 100644 --- a/network/robus_network/src/robus.c +++ b/network/robus_network/src/robus.c @@ -112,7 +112,8 @@ void Robus_Reset(luos_phy_t *phy_ptr) /****************************************************************************** * @brief Find the next neighbour on this phy - * @param None + * @param phy_ptr + * @param portId pointer to the portId of the next node * @return error_return_t ******************************************************************************/ error_return_t Robus_RunTopology(luos_phy_t *phy_ptr, uint8_t *portId) diff --git a/network/robus_network/src/transmission.c b/network/robus_network/src/transmission.c index 66b773fe6..c1b463ac8 100644 --- a/network/robus_network/src/transmission.c +++ b/network/robus_network/src/transmission.c @@ -139,7 +139,7 @@ _CRITICAL void Transmit_Process() if (nbrRetry >= NBR_RETRY) { // We failed to transmit this message. We can't allow it, there is an issue on this target. - Phy_DeadTargetSpotted(robus_phy, job); + Phy_FailedJob(robus_phy, job); nbrRetry = 0; ctx.tx.collision = false; // Try to get a new job @@ -187,7 +187,7 @@ _CRITICAL void Transmit_Process() { // Convert date to a sendable timestamp and put it on the encapsulation - jobEncaps->timestamp = Phy_ComputeTimestamp(job); + jobEncaps->timestamp = Phy_ComputeMsgTimestamp(job); jobEncaps->timestamped_crc = ll_crc_compute(jobEncaps->unmaped, sizeof(time_luos_t), crc_val); jobEncaps->size = sizeof(time_luos_t) + CRC_SIZE; @@ -243,7 +243,7 @@ _CRITICAL void Transmit_End(void) luos_phy_t *robus_phy = Robus_GetPhy(); phy_job_t *job = Phy_GetJob(robus_phy); // We may had a reset during this transmission, so we need to check if we still have something to transmit - if (robus_phy->job_nb > 0) + if (Phy_GetJobNumber(robus_phy) > 0) { job->phy_data = 0; Phy_RmJob(robus_phy, job); diff --git a/network/serial_network/src/serial_network.c b/network/serial_network/src/serial_network.c index 89a2ea33a..1ab634d89 100644 --- a/network/serial_network/src/serial_network.c +++ b/network/serial_network/src/serial_network.c @@ -82,7 +82,8 @@ void Serial_Init(void) Serial_Reset(phy_serial); SerialHAL_Init(RX_data, SERIAL_RX_BUFFER_SIZE); - phy_serial->rx_timestamp = 0; + phy_serial->rx_timestamp = TimeOD_TimeFrom_s(0.0); + ; phy_serial->rx_buffer_base = RX_data; phy_serial->rx_data = RX_data; // In our case we don't need to use this pointer because we use DMA to receive complete messages in one time. phy_serial->rx_keep = true; @@ -223,7 +224,7 @@ void Serial_Loop(void) // We receive this ping from a master node // This port become the topology source of this node // Notify luos_phy about it - Phy_Topologysource(phy_serial, SerialHAL_GetPort()); + Phy_TopologySource(phy_serial, SerialHAL_GetPort()); // The next ping we send will be a deping next_ping_is_deping = true; } @@ -302,7 +303,7 @@ _CRITICAL void Serial_TransmissionEnd(void) sending = false; // We transmitted this message, we can remove it then send another one // We may had a reset during this transmission, so we need to check if we still have something to transmit - if (phy_serial->job_nb > 0) + if (Phy_GetJobNumber(phy_serial) > 0) { phy_job_t *job = Phy_GetJob(phy_serial); job->phy_data = 0; @@ -377,6 +378,7 @@ _CRITICAL void Serial_ReceptionAdd(uint8_t *data, uint32_t size) memcpy(RX_data, data + copy_size, size - copy_size); } rx_size += size; + LUOS_ASSERT(rx_size < sizeof(RX_data)); if ((wait_reception == true) && (size >= sizeof(SerialHeader_t) + 1)) { // We received the answer of a topology ping, just indicate that we receive it diff --git a/test/tests_io/test_phy/main.c b/test/tests_io/test_phy/main.c index ed1ce02dc..c94eecf0d 100644 --- a/test/tests_io/test_phy/main.c +++ b/test/tests_io/test_phy/main.c @@ -447,7 +447,7 @@ void unittest_phy_deadTarget() // Create a fake phy job luos_phy->job_nb = 1; luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; - Phy_DeadTargetSpotted(luos_phy, 0); + Phy_FailedJob(luos_phy, 0); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -458,7 +458,7 @@ void unittest_phy_deadTarget() // Create a fake phy job luos_phy->job_nb = 1; luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; - Phy_DeadTargetSpotted(0, &luos_phy->job[0]); + Phy_FailedJob(0, &luos_phy->job[0]); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -469,7 +469,7 @@ void unittest_phy_deadTarget() // Create a fake phy job luos_phy->job_nb = 1; luos_phy->job[0].data_pt = 0; - Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); + Phy_FailedJob(luos_phy, &luos_phy->job[0]); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -482,7 +482,7 @@ void unittest_phy_deadTarget() luos_phy->job[0].data_pt = (uint8_t *)msg_buffer; msg_t *msg = (msg_t *)msg_buffer; msg->header.target_mode = 0x0f; - Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); + Phy_FailedJob(luos_phy, &luos_phy->job[0]); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -503,7 +503,7 @@ void unittest_phy_deadTarget() msg->header.target = 1; TEST_ASSERT_EQUAL(0, phy_ctx.failed_job_nb); - Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); + Phy_FailedJob(luos_phy, &luos_phy->job[0]); TEST_ASSERT_EQUAL(1, phy_ctx.failed_job_nb); TEST_ASSERT_EQUAL(msg_buffer, phy_ctx.failed_job[0].data_pt); } @@ -531,7 +531,7 @@ void unittest_phy_deadTarget() msg->header.target = 1; TEST_ASSERT_EQUAL(0, phy_ctx.failed_job_nb); - Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); + Phy_FailedJob(luos_phy, &luos_phy->job[0]); TEST_ASSERT_EQUAL(1, phy_ctx.failed_job_nb); TEST_ASSERT_EQUAL(msg_buffer, phy_ctx.failed_job[0].data_pt); TEST_ASSERT_EQUAL(1, luos_phy->job_nb); @@ -560,7 +560,7 @@ void unittest_phy_deadTarget() msg->header.target = 1; TEST_ASSERT_EQUAL(0, phy_ctx.failed_job_nb); - Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); + Phy_FailedJob(luos_phy, &luos_phy->job[0]); TEST_ASSERT_EQUAL(1, phy_ctx.failed_job_nb); TEST_ASSERT_EQUAL(msg_buffer, phy_ctx.failed_job[0].data_pt); TEST_ASSERT_EQUAL(0, luos_phy->job_nb); @@ -593,7 +593,7 @@ void unittest_phy_deadTarget() msg->header.target = 1; TEST_ASSERT_EQUAL(0, phy_ctx.failed_job_nb); - Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); + Phy_FailedJob(luos_phy, &luos_phy->job[0]); TEST_ASSERT_EQUAL(msg_buffer, phy_ctx.failed_job[0].data_pt); TEST_ASSERT_EQUAL(1, luos_phy->job_nb); TEST_ASSERT_EQUAL(NULL, luos_phy->job[0].data_pt); @@ -663,7 +663,7 @@ void unittest_phy_loop() Luos_get_deadTarget = false; Robus_get_deadTarget = false; - Phy_DeadTargetSpotted(luos_phy, &luos_phy->job[0]); + Phy_FailedJob(luos_phy, &luos_phy->job[0]); TEST_ASSERT_EQUAL(1, phy_ctx.failed_job_nb); Phy_Loop(); @@ -969,7 +969,7 @@ void unittest_phy_ValidMsg() luos_phy->rx_alloc_job = false; luos_phy->rx_size = MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t); luos_phy->rx_phy_filter = 0x02; // A Robus node is targeted - luos_phy->rx_timestamp = 10; + luos_phy->rx_timestamp = TimeOD_TimeFrom_ns(10.0f); TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); Phy_ValidMsg(luos_phy); @@ -1006,7 +1006,7 @@ void unittest_phy_ValidMsg() luos_phy->rx_alloc_job = false; luos_phy->rx_size = MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t); luos_phy->rx_phy_filter = 0x02; // A Robus node is targeted - luos_phy->rx_timestamp = 10; + luos_phy->rx_timestamp = TimeOD_TimeFrom_ns(10.0f); TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); Phy_ValidMsg(luos_phy); @@ -1039,7 +1039,7 @@ void unittest_phy_ValidMsg() luos_phy->rx_alloc_job = true; luos_phy->rx_size = MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t); luos_phy->rx_phy_filter = 0x02; // A Robus node is targeted - luos_phy->rx_timestamp = 10; + luos_phy->rx_timestamp = TimeOD_TimeFrom_ns(10.0f); TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); Phy_ValidMsg(luos_phy); @@ -1066,7 +1066,7 @@ void unittest_phy_ComputeTimestamp() { TRY { - Phy_ComputeTimestamp(NULL); + Phy_ComputeMsgTimestamp(NULL); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -1076,7 +1076,7 @@ void unittest_phy_ComputeTimestamp() phy_job_t job; job.timestamp = false; job.data_pt = (uint8_t *)msg_buffer; - Phy_ComputeTimestamp(&job); + Phy_ComputeMsgTimestamp(&job); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -1086,7 +1086,7 @@ void unittest_phy_ComputeTimestamp() phy_job_t job; job.timestamp = true; job.data_pt = NULL; - Phy_ComputeTimestamp(&job); + Phy_ComputeMsgTimestamp(&job); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -1115,7 +1115,7 @@ void unittest_phy_ComputeTimestamp() volatile time_luos_t timestamp = TimeOD_TimeFrom_ns(10); memcpy(&msg->data[msg->header.size], (void *)×tamp, sizeof(time_luos_t)); - volatile time_luos_t resulting_latency = Phy_ComputeTimestamp(&job); + volatile time_luos_t resulting_latency = Phy_ComputeMsgTimestamp(&job); TEST_ASSERT_EQUAL(0xAE, job.msg_pt->data[0]); #ifndef _WIN32 From 54d2280935bd84d90c031c0b6890392833086de5 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 28 Aug 2023 14:58:47 +0200 Subject: [PATCH 113/150] !fix multi-phy --- engine/IO/inc/luos_phy.h | 2 +- engine/IO/inc/struct_phy.h | 4 ++-- engine/IO/src/luos_phy.c | 6 +++--- network/robus_network/src/reception.c | 4 ++-- network/serial_network/src/serial_network.c | 7 +++---- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/engine/IO/inc/luos_phy.h b/engine/IO/inc/luos_phy.h index ea189c0d5..41035872a 100644 --- a/engine/IO/inc/luos_phy.h +++ b/engine/IO/inc/luos_phy.h @@ -41,7 +41,7 @@ void Phy_ResetMsg(luos_phy_t *phy_ptr); // Call this function to reset the // Tx management time_luos_t Phy_ComputeMsgTimestamp(phy_job_t *job); // Use it to compute the timestamp of the message to send. -time_luos_t Phy_GetTimestamp(void); // Use it to get the current timestamp. +uint64_t Phy_GetTimestamp(void); // Use it to get the current timestamp in ns. uint16_t Phy_GetNodeId(void); // Use it to get your current node id. (This can be used to compute priority or controled latency avoiding infinite collision condition) // Job management diff --git a/engine/IO/inc/struct_phy.h b/engine/IO/inc/struct_phy.h index 29d1cad63..f390b85aa 100644 --- a/engine/IO/inc/struct_phy.h +++ b/engine/IO/inc/struct_phy.h @@ -47,8 +47,8 @@ typedef uint8_t phy_target_t; typedef struct luos_phy_t { // *************** RX information *************** - volatile time_luos_t rx_timestamp; // Timestamp of the last received message. We will use it to compute the date based on received latency. - uint8_t *rx_buffer_base; // Pointer to the base of the buffer where we will store the begining of received data. + volatile uint64_t rx_timestamp; // Timestamp of the last received message. We will use it to compute the date based on received latency. This value need to be stored in ns. + uint8_t *rx_buffer_base; // Pointer to the base of the buffer where we will store the begining of received data. union { volatile uint8_t *rx_data; // Pointer to write received bytes. diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index c540cb3f6..e90f71e66 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -470,7 +470,7 @@ _CRITICAL void Phy_ValidMsg(luos_phy_t *phy_ptr) uint16_t my_job = phy_ctx.io_job_nb++; Phy_SetIrqState(true); // Now copy the data in the job - phy_ctx.io_job[my_job].timestamp = (uint64_t)TimeOD_TimeTo_ns(phy_ptr->rx_timestamp); + phy_ctx.io_job[my_job].timestamp = phy_ptr->rx_timestamp; phy_ctx.io_job[my_job].alloc_msg = (msg_t *)phy_ptr->rx_data; phy_ctx.io_job[my_job].phy_filter = phy_ptr->rx_phy_filter; phy_ctx.io_job[my_job].size = phy_ptr->rx_size; @@ -511,9 +511,9 @@ time_luos_t Phy_ComputeMsgTimestamp(phy_job_t *job) * @param None * @return Timestamp value ******************************************************************************/ -_CRITICAL time_luos_t Phy_GetTimestamp(void) +_CRITICAL uint64_t Phy_GetTimestamp(void) { - return TimeOD_TimeFrom_ns((double)LuosHAL_GetTimestamp()); + return LuosHAL_GetTimestamp(); } /****************************************************************************** diff --git a/network/robus_network/src/reception.c b/network/robus_network/src/reception.c index 390eeb6e7..684e2b323 100644 --- a/network/robus_network/src/reception.c +++ b/network/robus_network/src/reception.c @@ -80,7 +80,7 @@ void Recep_Init(luos_phy_t *phy_robus) ctx.rx.status.unmap = 0; ctx.rx.callback = Recep_GetHeader; ctx.rx.status.identifier = 0xF; - phy_robus->rx_timestamp = TimeOD_TimeFrom_s(0.0); + phy_robus->rx_timestamp = 0; phy_robus->rx_buffer_base = data_rx; phy_robus->rx_data = data_rx; phy_robus->rx_keep = true; @@ -103,7 +103,7 @@ _CRITICAL void Recep_GetHeader(luos_phy_t *phy_robus, volatile uint8_t *data) // When we catch the first byte we timestamp the msg // We remove the time of the first byte to get the exact reception date. // 1 byte is 10 bits and we convert it to nanoseconds - phy_robus->rx_timestamp = TimeOD_TimeFrom_ns(TimeOD_TimeTo_ns(Phy_GetTimestamp()) - ((uint32_t)10 * (uint32_t)1000000000 / (uint32_t)DEFAULTBAUDRATE)); + phy_robus->rx_timestamp = Phy_GetTimestamp() - ((uint32_t)10 * (uint32_t)1000000000 / (uint32_t)ROBUS_NETWORK_BAUDRATE); // Declare Robus as busy ctx.tx.lock = true; diff --git a/network/serial_network/src/serial_network.c b/network/serial_network/src/serial_network.c index 1ab634d89..ea72e2a12 100644 --- a/network/serial_network/src/serial_network.c +++ b/network/serial_network/src/serial_network.c @@ -82,8 +82,7 @@ void Serial_Init(void) Serial_Reset(phy_serial); SerialHAL_Init(RX_data, SERIAL_RX_BUFFER_SIZE); - phy_serial->rx_timestamp = TimeOD_TimeFrom_s(0.0); - ; + phy_serial->rx_timestamp = 0; phy_serial->rx_buffer_base = RX_data; phy_serial->rx_data = RX_data; // In our case we don't need to use this pointer because we use DMA to receive complete messages in one time. phy_serial->rx_keep = true; @@ -365,7 +364,7 @@ _CRITICAL void Serial_ReceptionAdd(uint8_t *data, uint32_t size) { // This is probably the first data we received for this message, we need to timestamp the reception date. // Watch out, if the loop is executed very slowly we may receive multiple messages in the same loop. This could result in a wrong timestamp for the second message. Their is no way to avoid this problem, so we need to accept it. Anyway we even didn't have any way to store multiple timestamp... - phy_serial->rx_timestamp = TimeOD_TimeFrom_ns(TimeOD_TimeTo_ns(Phy_GetTimestamp()) - (size * (uint32_t)10 * (uint32_t)1000000000 / (uint32_t)SERIAL_NETWORK_BAUDRATE)); // now - (nbr_byte * 10bits * (1s in ns) / baudrate) + phy_serial->rx_timestamp = Phy_GetTimestamp() - (size * (uint32_t)10 * (uint32_t)1000000000 / (uint32_t)SERIAL_NETWORK_BAUDRATE); // now - (nbr_byte * 10bits * (1s in ns) / baudrate) } uint32_t copy_size = (uintptr_t)&RX_data + sizeof(RX_data) - (uintptr_t)phy_serial->rx_buffer_base + rx_size; if (copy_size > size) @@ -397,7 +396,7 @@ _CRITICAL void Serial_ReceptionEnd(uint32_t size) rx_size += size; // We consider this as the end of a complete message // If we received multiple messages in this call, this could result in a wrong timestamp for the second message. Their is no way to avoid this problem, so we need to accept it. - phy_serial->rx_timestamp = TimeOD_TimeFrom_ns(TimeOD_TimeTo_ns(Phy_GetTimestamp()) - (rx_size * (uint32_t)10 * (uint32_t)1000000000 / (uint32_t)SERIAL_NETWORK_BAUDRATE)); // now - (nbr_byte * 10bits * (1s in ns) / baudrate) + phy_serial->rx_timestamp = Phy_GetTimestamp() - (rx_size * (uint32_t)10 * (uint32_t)1000000000 / (uint32_t)SERIAL_NETWORK_BAUDRATE); // now - (nbr_byte * 10bits * (1s in ns) / baudrate) LUOS_ASSERT(rx_size < sizeof(RX_data)); if ((wait_reception == true) && (size >= sizeof(SerialHeader_t) + 1)) { From 23837317a7acc53d04e68e8257226776e52380f0 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 28 Aug 2023 14:59:26 +0200 Subject: [PATCH 114/150] Improve C++ compatibility by making it natively compilable in a C++ env --- engine/IO/inc/luos_phy.h | 79 +++++++------ engine/core/inc/luos_engine.h | 104 +++++++++--------- .../Arduino/led/lib/led/{led.c => led.cpp} | 5 +- examples/projects/Arduino/led/src/led.cpp | 10 -- network/robus_network/inc/robus_network.h | 17 ++- network/serial_network/inc/serial_network.h | 17 ++- tool_services/gate/gate.h | 29 +++-- tool_services/pipe/pipe.h | 18 ++- 8 files changed, 156 insertions(+), 123 deletions(-) rename examples/projects/Arduino/led/lib/led/{led.c => led.cpp} (95%) diff --git a/engine/IO/inc/luos_phy.h b/engine/IO/inc/luos_phy.h index 41035872a..590372dc4 100644 --- a/engine/IO/inc/luos_phy.h +++ b/engine/IO/inc/luos_phy.h @@ -6,6 +6,10 @@ ******************************************************************************/ #ifndef _LUOS_PHY_H_ #define _LUOS_PHY_H_ +#ifdef __cplusplus +extern "C" +{ +#endif #include #include @@ -14,40 +18,43 @@ #include "luos_utils.h" #include "luos_hal.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -typedef void (*JOB_CB)(luos_phy_t *phy_ptr, phy_job_t *job); -typedef error_return_t (*RUN_TOPO)(luos_phy_t *phy_ptr, uint8_t *portId); -typedef void (*RESET_PHY)(luos_phy_t *phy_ptr); -typedef void (*IRQ_STATE)(bool state); - -// Irq management -void Phy_SetIrqStateFunciton(IRQ_STATE irq_state); // Use it to reference your phy specific Irq state management to Luos. -void Phy_SetIrqState(bool state); // Use it to globally enable/disable all the phy irq. - -// Phy creation -luos_phy_t *Phy_Create(JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY reset_phy); // Use it to reference your phy to Luos. - -// Topology management -void Phy_TopologyNext(void); // Use it to find the next node that need to be detected accross phys. -void Phy_TopologySource(luos_phy_t *phy_ptr, uint8_t port_id); // The phy will call this function when a new node is detected on a specific port. -void Phy_TopologyDone(luos_phy_t *phy_ptr); // The phy will call this function when all its port detection are done. - -// Rx management -void Phy_ComputeHeader(luos_phy_t *phy_ptr); // After receiving the first 7 bytes (the header) call this function to compute how you should manage the incoming message. -void Phy_ValidMsg(luos_phy_t *phy_ptr); // After receiving as much valid bytes as phy_ptr.rx_size, call this function to validate the message. -void Phy_ResetMsg(luos_phy_t *phy_ptr); // Call this function to reset the rx process. - -// Tx management -time_luos_t Phy_ComputeMsgTimestamp(phy_job_t *job); // Use it to compute the timestamp of the message to send. -uint64_t Phy_GetTimestamp(void); // Use it to get the current timestamp in ns. -uint16_t Phy_GetNodeId(void); // Use it to get your current node id. (This can be used to compute priority or controled latency avoiding infinite collision condition) - -// Job management -void Phy_FailedJob(luos_phy_t *phy_ptr, phy_job_t *job); // If some messages failed to be sent, call this function to consider the target as dead -phy_job_t *Phy_GetJob(luos_phy_t *phy_ptr); // Use it to get the first job to send. -void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to remove a job from your phy job list when it's done. -uint16_t Phy_GetJobNumber(luos_phy_t *phy_ptr); // Use it to get the number of job to send. - + /******************************************************************************* + * Definitions + ******************************************************************************/ + typedef void (*JOB_CB)(luos_phy_t *phy_ptr, phy_job_t *job); + typedef error_return_t (*RUN_TOPO)(luos_phy_t *phy_ptr, uint8_t *portId); + typedef void (*RESET_PHY)(luos_phy_t *phy_ptr); + typedef void (*IRQ_STATE)(bool state); + + // Irq management + void Phy_SetIrqStateFunciton(IRQ_STATE irq_state); // Use it to reference your phy specific Irq state management to Luos. + void Phy_SetIrqState(bool state); // Use it to globally enable/disable all the phy irq. + + // Phy creation + luos_phy_t *Phy_Create(JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY reset_phy); // Use it to reference your phy to Luos. + + // Topology management + void Phy_TopologyNext(void); // Use it to find the next node that need to be detected accross phys. + void Phy_TopologySource(luos_phy_t *phy_ptr, uint8_t port_id); // The phy will call this function when a new node is detected on a specific port. + void Phy_TopologyDone(luos_phy_t *phy_ptr); // The phy will call this function when all its port detection are done. + + // Rx management + void Phy_ComputeHeader(luos_phy_t *phy_ptr); // After receiving the first 7 bytes (the header) call this function to compute how you should manage the incoming message. + void Phy_ValidMsg(luos_phy_t *phy_ptr); // After receiving as much valid bytes as phy_ptr.rx_size, call this function to validate the message. + void Phy_ResetMsg(luos_phy_t *phy_ptr); // Call this function to reset the rx process. + + // Tx management + time_luos_t Phy_ComputeMsgTimestamp(phy_job_t *job); // Use it to compute the timestamp of the message to send. + uint64_t Phy_GetTimestamp(void); // Use it to get the current timestamp in ns. + uint16_t Phy_GetNodeId(void); // Use it to get your current node id. (This can be used to compute priority or controled latency avoiding infinite collision condition) + + // Job management + void Phy_FailedJob(luos_phy_t *phy_ptr, phy_job_t *job); // If some messages failed to be sent, call this function to consider the target as dead + phy_job_t *Phy_GetJob(luos_phy_t *phy_ptr); // Use it to get the first job to send. + void Phy_RmJob(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to remove a job from your phy job list when it's done. + uint16_t Phy_GetJobNumber(luos_phy_t *phy_ptr); // Use it to get the number of job to send. + +#ifdef __cplusplus +} +#endif #endif /* _LUOS_PHY_H_ */ diff --git a/engine/core/inc/luos_engine.h b/engine/core/inc/luos_engine.h index 43f9f3390..771af4739 100644 --- a/engine/core/inc/luos_engine.h +++ b/engine/core/inc/luos_engine.h @@ -5,7 +5,10 @@ ******************************************************************************/ #ifndef LUOS_ENGINE_H #define LUOS_ENGINE_H - +#ifdef __cplusplus +extern "C" +{ +#endif #include #include #include "luos_utils.h" @@ -23,60 +26,63 @@ #define LUOS_RUN() Luos_Run(); -/******************************************************************************* - * Function - ******************************************************************************/ -void Luos_Init(void); -void Luos_Loop(void); -void Luos_ResetStatistic(void); -const revision_t *Luos_GetVersion(void); -void Luos_SetIrqState(bool state); + /******************************************************************************* + * Function + ******************************************************************************/ + void Luos_Init(void); + void Luos_Loop(void); + void Luos_ResetStatistic(void); + const revision_t *Luos_GetVersion(void); + void Luos_SetIrqState(bool state); -// ***************** Node management ***************** -uint32_t Luos_GetSystick(void); -bool Luos_IsDetected(void); + // ***************** Node management ***************** + uint32_t Luos_GetSystick(void); + bool Luos_IsDetected(void); -// ***************** Package management ***************** -void Luos_AddPackage(void (*Init)(void), void (*Loop)(void)); -void Luos_Run(void); + // ***************** Package management ***************** + void Luos_AddPackage(void (*Init)(void), void (*Loop)(void)); + void Luos_Run(void); -// ***************** Service management ***************** -service_t *Luos_CreateService(SERVICE_CB service_cb, uint8_t type, const char *alias, revision_t revision); -error_return_t Luos_UpdateAlias(service_t *service, const char *alias, uint16_t size); -void Luos_Detect(service_t *service); -void Luos_ServicesClear(void); + // ***************** Service management ***************** + service_t *Luos_CreateService(SERVICE_CB service_cb, uint8_t type, const char *alias, revision_t revision); + error_return_t Luos_UpdateAlias(service_t *service, const char *alias, uint16_t size); + void Luos_Detect(service_t *service); + void Luos_ServicesClear(void); -// ***************** Messaging management ***************** + // ***************** Messaging management ***************** -void Luos_Flush(void); + void Luos_Flush(void); // *** Streaming management *** #include "streaming.h" -void Luos_SendStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream); -void Luos_SendStreamingSize(service_t *service, msg_t *msg, streaming_channel_t *stream, uint32_t max_size); -error_return_t Luos_ReceiveStreaming(service_t *service, const msg_t *msg, streaming_channel_t *stream); - -// *** Timestamping management (in file `timestamp.c`)*** -time_luos_t Luos_Timestamp(void); -bool Luos_IsMsgTimstamped(const msg_t *msg); -time_luos_t Luos_GetMsgTimestamp(msg_t *msg); -error_return_t Luos_SendTimestampMsg(service_t *service, msg_t *msg, time_luos_t timestamp); - -// *** Pub/Sub management (in file `pub_sub.c`)*** -error_return_t Luos_Subscribe(service_t *service, uint16_t topic); -error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic); - -// *** Big data management *** -void Luos_SendData(service_t *service, msg_t *msg, void *bin_data, uint16_t size); -int Luos_ReceiveData(service_t *service, const msg_t *msg, void *bin_data); - -// *** Basic transmission management *** -error_return_t Luos_SendMsg(service_t *service, msg_t *msg); -error_return_t Luos_TxComplete(void); - -// *** Polling reception management *** -error_return_t Luos_ReadMsg(service_t *service, msg_t *msg_to_write); -error_return_t Luos_ReadFromService(service_t *service, uint16_t id, msg_t *msg_to_write); -uint16_t Luos_NbrAvailableMsg(void); - + void Luos_SendStreaming(service_t *service, msg_t *msg, streaming_channel_t *stream); + void Luos_SendStreamingSize(service_t *service, msg_t *msg, streaming_channel_t *stream, uint32_t max_size); + error_return_t Luos_ReceiveStreaming(service_t *service, const msg_t *msg, streaming_channel_t *stream); + + // *** Timestamping management (in file `timestamp.c`)*** + time_luos_t Luos_Timestamp(void); + bool Luos_IsMsgTimstamped(const msg_t *msg); + time_luos_t Luos_GetMsgTimestamp(msg_t *msg); + error_return_t Luos_SendTimestampMsg(service_t *service, msg_t *msg, time_luos_t timestamp); + + // *** Pub/Sub management (in file `pub_sub.c`)*** + error_return_t Luos_Subscribe(service_t *service, uint16_t topic); + error_return_t Luos_Unsubscribe(service_t *service, uint16_t topic); + + // *** Big data management *** + void Luos_SendData(service_t *service, msg_t *msg, void *bin_data, uint16_t size); + int Luos_ReceiveData(service_t *service, const msg_t *msg, void *bin_data); + + // *** Basic transmission management *** + error_return_t Luos_SendMsg(service_t *service, msg_t *msg); + error_return_t Luos_TxComplete(void); + + // *** Polling reception management *** + error_return_t Luos_ReadMsg(service_t *service, msg_t *msg_to_write); + error_return_t Luos_ReadFromService(service_t *service, uint16_t id, msg_t *msg_to_write); + uint16_t Luos_NbrAvailableMsg(void); + +#ifdef __cplusplus +} +#endif #endif /* LUOS_ENGINE_H */ diff --git a/examples/projects/Arduino/led/lib/led/led.c b/examples/projects/Arduino/led/lib/led/led.cpp similarity index 95% rename from examples/projects/Arduino/led/lib/led/led.c rename to examples/projects/Arduino/led/lib/led/led.cpp index 4c067da66..4a5ee993c 100644 --- a/examples/projects/Arduino/led/lib/led/led.c +++ b/examples/projects/Arduino/led/lib/led/led.cpp @@ -28,7 +28,10 @@ void Led_Init(void) { pinMode(LED_BUILTIN, OUTPUT); - revision_t revision = {.major = 1, .minor = 0, .build = 0}; + revision_t revision; + revision.major = 1; + revision.minor = 0; + revision.build = 0; Luos_CreateService(Led_MsgHandler, STATE_TYPE, "led_mod", revision); } /****************************************************************************** diff --git a/examples/projects/Arduino/led/src/led.cpp b/examples/projects/Arduino/led/src/led.cpp index 57cfad0ba..9a285d875 100644 --- a/examples/projects/Arduino/led/src/led.cpp +++ b/examples/projects/Arduino/led/src/led.cpp @@ -1,18 +1,8 @@ #include - -#ifdef __cplusplus -extern "C" -{ -#endif - #include "luos_engine.h" #include "serial_network.h" #include "led.h" -#ifdef __cplusplus -} -#endif - /****************************************************************************** * @brief Setup ardiuno * @param None diff --git a/network/robus_network/inc/robus_network.h b/network/robus_network/inc/robus_network.h index 21a696573..93a46b1c2 100644 --- a/network/robus_network/inc/robus_network.h +++ b/network/robus_network/inc/robus_network.h @@ -7,12 +7,19 @@ #ifndef _ROBUS_H_ #define _ROBUS_H_ +#ifdef __cplusplus +extern "C" +{ +#endif #include "luos_phy.h" -/******************************************************************************* - * Function - ******************************************************************************/ -void Robus_Init(void); -void Robus_Loop(void); + /******************************************************************************* + * Function + ******************************************************************************/ + void Robus_Init(void); + void Robus_Loop(void); +#ifdef __cplusplus +} +#endif #endif /* _ROBUS_H_ */ diff --git a/network/serial_network/inc/serial_network.h b/network/serial_network/inc/serial_network.h index 453bcabc9..c323fd9a1 100644 --- a/network/serial_network/inc/serial_network.h +++ b/network/serial_network/inc/serial_network.h @@ -7,6 +7,10 @@ #ifndef _LUOS_SERIAL_H_ #define _LUOS_SERIAL_H_ +#ifdef __cplusplus +extern "C" +{ +#endif #include "luos_phy.h" /******************************************************************************* @@ -16,10 +20,13 @@ #define SERIAL_RX_BUFFER_SIZE 512 #endif -/******************************************************************************* - * Function - ******************************************************************************/ -void Serial_Init(void); -void Serial_Loop(void); + /******************************************************************************* + * Function + ******************************************************************************/ + void Serial_Init(void); + void Serial_Loop(void); +#ifdef __cplusplus +} +#endif #endif /* _LUOS_SERIAL_H_ */ diff --git a/tool_services/gate/gate.h b/tool_services/gate/gate.h index 4b4c42705..a68348311 100644 --- a/tool_services/gate/gate.h +++ b/tool_services/gate/gate.h @@ -5,18 +5,25 @@ ******************************************************************************/ #ifndef GATE_H #define GATE_H +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* + * Definitions + ******************************************************************************/ -/******************************************************************************* - * Definitions - ******************************************************************************/ + /******************************************************************************* + * Variables + ******************************************************************************/ -/******************************************************************************* - * Variables - ******************************************************************************/ + /******************************************************************************* + * Function + ******************************************************************************/ + void Gate_Init(void); + void Gate_Loop(void); -/******************************************************************************* - * Function - ******************************************************************************/ -void Gate_Init(void); -void Gate_Loop(void); +#ifdef __cplusplus +} +#endif #endif /* GATE_H */ diff --git a/tool_services/pipe/pipe.h b/tool_services/pipe/pipe.h index e600661af..15d010b0c 100644 --- a/tool_services/pipe/pipe.h +++ b/tool_services/pipe/pipe.h @@ -6,11 +6,17 @@ ******************************************************************************/ #ifndef PIPE_H #define PIPE_H +#ifdef __cplusplus +extern "C" +{ +#endif + /******************************************************************************* + * Function + ******************************************************************************/ + void Pipe_Init(void); + void Pipe_Loop(void); -/******************************************************************************* - * Function - ******************************************************************************/ -void Pipe_Init(void); -void Pipe_Loop(void); - +#ifdef __cplusplus +} +#endif #endif /* PIPE_H */ From 1a0bf0077824d1bc41e786b885f7a1aa822c28da Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 2 Aug 2023 17:37:07 +0200 Subject: [PATCH 115/150] Remove networks from coverage, networks are very difficult to unit test, they are to close from hardware. --- .github/workflows/build.yml | 2 +- test/code_coverage.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1840bd926..df44c1148 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: run: | sudo apt-get install -y lcov lcov -d .pio/build/native/ -c -o lcov.info - lcov --remove lcov.info '*/usr/*' '*/Platforms/*' '*/bootloader/*' '*/.pio/*' '*/HAL/*' '*/test/*' -o lcov.info + lcov --remove lcov.info '*/usr/*' '*/Platforms/*' '*/bootloader/*' '*/.pio/*' '*/HAL/*' '*/test/*' '*/network/*' -o lcov.info - if: matrix.os == 'ubuntu-latest' name: Coveralls diff --git a/test/code_coverage.py b/test/code_coverage.py index 675188bce..984068fc5 100755 --- a/test/code_coverage.py +++ b/test/code_coverage.py @@ -1,5 +1,5 @@ #!/usr/bin/env python import os os.system("lcov -d .pio/build/native/ -c -o lcov.info") -os.system("lcov --remove lcov.info '*/Platforms/*' '*/bootloader/*' '*/.pio/*' '*/HAL/*' '*/test/*' -o filtered_lcov.info") +os.system("lcov --remove lcov.info '*/Platforms/*' '*/bootloader/*' '*/.pio/*' '*/HAL/*' '*/test/*' '*/network/*' -o filtered_lcov.info") os.system("genhtml filtered_lcov.info -o cov/ --demangle-cpp") From 085e4962fa152b9aecebbbe342dab829517a8532 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Wed, 2 Aug 2023 19:05:38 +0200 Subject: [PATCH 116/150] Fix format --- engine/core/inc/struct_luos.h | 6 ++--- engine/core/src/luos_engine.c | 2 +- .../Arduino/bldc_simple_foc/node_config.h | 2 +- examples/projects/Arduino/led/node_config.h | 2 +- .../NUCLEO-F072RB/button/node_config.h | 2 +- .../NUCLEO-F401RE/button/node_config.h | 2 +- .../NUCLEO-F410RB/button/node_config.h | 2 +- .../NUCLEO-G431KB/button/node_config.h | 2 +- .../gate_serialcom/node_config.h | 4 +-- .../NUCLEO-L073RZ/button/node_config.h | 4 +-- .../NUCLEO-L432KC/button/node_config.h | 2 +- .../gate_serialcom/node_config.h | 4 +-- .../projects/NUCLEO-L432KC/led/node_config.h | 2 +- .../SAMD21XPLAINED/button/node_config.h | 2 +- .../STM32F4-discovery/button/node_config.h | 2 +- .../STM32L4S5_discovery/button/node_config.h | 4 +-- examples/projects/l0/button/node_config.h | 2 +- examples/projects/l0/dxl/lib/Dxl/dxl.c | 2 +- .../projects/l0/gate_serialcom/node_config.h | 4 +-- .../l0/inspector_serialcom/node_config.h | 4 +-- examples/projects/l0/led/node_config.h | 2 +- examples/projects/l0/led_strip/node_config.h | 4 +-- .../robus_network/HAL/ATSAMD21/robus_hal.c | 27 ++++++++++--------- .../HAL/ATSAMD21/robus_hal_config.h | 6 ++--- .../HAL/ATSAMD21_ARDUINO/board_config.h | 10 +++---- .../HAL/ATSAMD21_ARDUINO/robus_hal.c | 27 ++++++++++--------- .../HAL/ATSAMD21_ARDUINO/robus_hal_config.h | 6 ++--- .../HAL/ATSAMD21_MBED/robus_hal.c | 27 ++++++++++--------- .../HAL/ATSAMD21_MBED/robus_hal_config.h | 6 ++--- network/robus_network/HAL/NATIVE/robus_hal.c | 3 ++- .../HAL/NATIVE/robus_hal_config.h | 2 +- network/robus_network/HAL/STM32F0/robus_hal.c | 1 + network/robus_network/HAL/STM32F4/robus_hal.c | 1 + network/robus_network/HAL/STM32G4/robus_hal.c | 1 + .../HAL/STM32G4/robus_hal_config.h | 2 +- network/robus_network/HAL/STM32L0/robus_hal.c | 1 + network/robus_network/HAL/STM32L4/robus_hal.c | 1 + network/robus_network/HAL/STUB/robus_hal.c | 3 ++- .../robus_network/HAL/STUB/robus_hal_config.h | 2 +- .../robus_network/HAL/template/robus_hal.c | 1 + 40 files changed, 100 insertions(+), 89 deletions(-) diff --git a/engine/core/inc/struct_luos.h b/engine/core/inc/struct_luos.h index 320f91c6c..4fd734858 100644 --- a/engine/core/inc/struct_luos.h +++ b/engine/core/inc/struct_luos.h @@ -211,10 +211,10 @@ typedef struct service_t service_stats_t statistics; /*!< service level statistics. */ // Private Variables - uint16_t last_topic_position; /*!< Position pointer of the last topic added. */ + uint16_t last_topic_position; /*!< Position pointer of the last topic added. */ uint16_t topic_list[MAX_LOCAL_TOPIC_NUMBER]; /*!< multicast target bank. */ - timed_update_t auto_refresh; /*!< service auto refresh context. */ - void *profile_context; /*!< Pointer to the profile context. */ + timed_update_t auto_refresh; /*!< service auto refresh context. */ + void *profile_context; /*!< Pointer to the profile context. */ } service_t; diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index 70bdc92fc..c61658836 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -349,7 +349,7 @@ int Luos_ReceiveData(service_t *service, const msg_t *msg, void *bin_data) // Manage buffer session (one per service) static uint32_t data_size[MAX_LOCAL_SERVICE_NUMBER] = {0}; static uint32_t total_data_size[MAX_LOCAL_SERVICE_NUMBER] = {0}; - static uint16_t last_msg_size = 0; + static uint16_t last_msg_size = 0; // When this function receive a data from a NULL service it is an error and we should reinit the reception state if (service == NULL) diff --git a/examples/projects/Arduino/bldc_simple_foc/node_config.h b/examples/projects/Arduino/bldc_simple_foc/node_config.h index 3fe08e2a5..1cd23bf71 100644 --- a/examples/projects/Arduino/bldc_simple_foc/node_config.h +++ b/examples/projects/Arduino/bldc_simple_foc/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 #define ARDUINO_PTPA_PIN 19 #define ARDUINO_PTPB_PIN 7 diff --git a/examples/projects/Arduino/led/node_config.h b/examples/projects/Arduino/led/node_config.h index dc8a32407..961af2512 100644 --- a/examples/projects/Arduino/led/node_config.h +++ b/examples/projects/Arduino/led/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-F072RB/button/node_config.h b/examples/projects/NUCLEO-F072RB/button/node_config.h index a2f0f9305..52cb97eab 100644 --- a/examples/projects/NUCLEO-F072RB/button/node_config.h +++ b/examples/projects/NUCLEO-F072RB/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-F401RE/button/node_config.h b/examples/projects/NUCLEO-F401RE/button/node_config.h index e7818dc34..b36051575 100644 --- a/examples/projects/NUCLEO-F401RE/button/node_config.h +++ b/examples/projects/NUCLEO-F401RE/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-F410RB/button/node_config.h b/examples/projects/NUCLEO-F410RB/button/node_config.h index 863662eeb..5c758889b 100644 --- a/examples/projects/NUCLEO-F410RB/button/node_config.h +++ b/examples/projects/NUCLEO-F410RB/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-G431KB/button/node_config.h b/examples/projects/NUCLEO-G431KB/button/node_config.h index be4afa01d..1fc4cdf75 100644 --- a/examples/projects/NUCLEO-G431KB/button/node_config.h +++ b/examples/projects/NUCLEO-G431KB/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h b/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h index 3902eff35..7c26bd8bb 100644 --- a/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-G474RE/gate_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-L073RZ/button/node_config.h b/examples/projects/NUCLEO-L073RZ/button/node_config.h index 45905739d..3f899fc25 100644 --- a/examples/projects/NUCLEO-L073RZ/button/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/button/node_config.h @@ -47,10 +47,10 @@ * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define DEFAULTBAUDRATE 500000 +#define DEFAULTBAUDRATE 500000 #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-L432KC/button/node_config.h b/examples/projects/NUCLEO-L432KC/button/node_config.h index be4afa01d..1fc4cdf75 100644 --- a/examples/projects/NUCLEO-L432KC/button/node_config.h +++ b/examples/projects/NUCLEO-L432KC/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h b/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h index 3902eff35..7c26bd8bb 100644 --- a/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-L432KC/gate_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-L432KC/led/node_config.h b/examples/projects/NUCLEO-L432KC/led/node_config.h index be4afa01d..1fc4cdf75 100644 --- a/examples/projects/NUCLEO-L432KC/led/node_config.h +++ b/examples/projects/NUCLEO-L432KC/led/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/SAMD21XPLAINED/button/node_config.h b/examples/projects/SAMD21XPLAINED/button/node_config.h index dc8a32407..961af2512 100644 --- a/examples/projects/SAMD21XPLAINED/button/node_config.h +++ b/examples/projects/SAMD21XPLAINED/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/STM32F4-discovery/button/node_config.h b/examples/projects/STM32F4-discovery/button/node_config.h index 7e4f40773..029832089 100644 --- a/examples/projects/STM32F4-discovery/button/node_config.h +++ b/examples/projects/STM32F4-discovery/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/STM32L4S5_discovery/button/node_config.h b/examples/projects/STM32L4S5_discovery/button/node_config.h index 76d572167..b80c9ab38 100644 --- a/examples/projects/STM32L4S5_discovery/button/node_config.h +++ b/examples/projects/STM32L4S5_discovery/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION @@ -132,7 +132,7 @@ /******************************************************************************* * DMA CONFIG ******************************************************************************/ -#define ROBUS_DMA_CLOCK_ENABLE() \ +#define ROBUS_DMA_CLOCK_ENABLE() \ do \ { \ __HAL_RCC_DMA1_CLK_ENABLE(); \ diff --git a/examples/projects/l0/button/node_config.h b/examples/projects/l0/button/node_config.h index a2f0f9305..52cb97eab 100644 --- a/examples/projects/l0/button/node_config.h +++ b/examples/projects/l0/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/dxl/lib/Dxl/dxl.c b/examples/projects/l0/dxl/lib/Dxl/dxl.c index 543c472ae..14eb2966e 100644 --- a/examples/projects/l0/dxl/lib/Dxl/dxl.c +++ b/examples/projects/l0/dxl/lib/Dxl/dxl.c @@ -59,7 +59,7 @@ void Dxl_Init(void) ******************************************************************************/ void Dxl_Loop(void) { - static int index = 0; + static int index = 0; static uint32_t last_temp[MAX_LOCAL_SERVICE_NUMBER] = {0}; static uint32_t last_sample[MAX_LOCAL_SERVICE_NUMBER] = {0}; // check motor values one by one diff --git a/examples/projects/l0/gate_serialcom/node_config.h b/examples/projects/l0/gate_serialcom/node_config.h index 225647240..68c0cdd4c 100644 --- a/examples/projects/l0/gate_serialcom/node_config.h +++ b/examples/projects/l0/gate_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 1024 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 1024 +#define MAX_MSG_NB 40 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION ******************************************************************************* diff --git a/examples/projects/l0/inspector_serialcom/node_config.h b/examples/projects/l0/inspector_serialcom/node_config.h index f4c20c348..cbd40e31d 100644 --- a/examples/projects/l0/inspector_serialcom/node_config.h +++ b/examples/projects/l0/inspector_serialcom/node_config.h @@ -48,8 +48,8 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 +#define MSG_BUFFER_SIZE 2048 +#define MAX_MSG_NB 40 #define NODETECTION /******************************************************************************* diff --git a/examples/projects/l0/led/node_config.h b/examples/projects/l0/led/node_config.h index d11f59555..591039463 100644 --- a/examples/projects/l0/led/node_config.h +++ b/examples/projects/l0/led/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 5 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/led_strip/node_config.h b/examples/projects/l0/led_strip/node_config.h index c8510269e..7803dcc79 100644 --- a/examples/projects/l0/led_strip/node_config.h +++ b/examples/projects/l0/led_strip/node_config.h @@ -47,8 +47,8 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 30 -#define MAX_BUFFER_SIZE 1024 +#define MAX_MSG_NB 30 +#define MAX_BUFFER_SIZE 1024 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/network/robus_network/HAL/ATSAMD21/robus_hal.c b/network/robus_network/HAL/ATSAMD21/robus_hal.c index e5d78d37d..d83631384 100644 --- a/network/robus_network/HAL/ATSAMD21/robus_hal.c +++ b/network/robus_network/HAL/ATSAMD21/robus_hal.c @@ -91,19 +91,19 @@ void RobusHAL_ComInit(uint32_t Baudrate) ROBUS_COM->USART_INT.SERCOM_CTRLA &= ~SERCOM_USART_INT_CTRLA_ENABLE_Msk; /* Configure Baud Rate */ - baud = 65536 - ((uint64_t)65536 * 16 * Baudrate) / MCUFREQ; + baud = 65536 - ((uint64_t)65536 * 16 * Baudrate) / MCUFREQ; ROBUS_COM->USART_INT.SERCOM_BAUD = SERCOM_USART_INT_BAUD_BAUD(baud); // Configures USART Clock Mode/ TXPO and RXPO/ Data Order/ Standby Mode/ Sampling rate/ IBON ROBUS_COM->USART_INT.SERCOM_CTRLA = SERCOM_USART_INT_CTRLA_MODE_USART_INT_CLK | SERCOM_USART_INT_CTRLA_RXPO(COM_RX_POS) - | SERCOM_USART_INT_CTRLA_TXPO(COM_TX_POS) | SERCOM_USART_INT_CTRLA_DORD_Msk - | SERCOM_USART_INT_CTRLA_IBON_Msk | SERCOM_USART_INT_CTRLA_FORM(0x0) - | SERCOM_USART_INT_CTRLA_SAMPR(0); + | SERCOM_USART_INT_CTRLA_TXPO(COM_TX_POS) | SERCOM_USART_INT_CTRLA_DORD_Msk + | SERCOM_USART_INT_CTRLA_IBON_Msk | SERCOM_USART_INT_CTRLA_FORM(0x0) + | SERCOM_USART_INT_CTRLA_SAMPR(0); // Configures RXEN/ TXEN/ CHSIZE/ Parity/ Stop bits ROBUS_COM->USART_INT.SERCOM_CTRLB = SERCOM_USART_INT_CTRLB_CHSIZE_8_BIT | SERCOM_USART_INT_CTRLB_SBMODE_1_BIT - | SERCOM_USART_INT_CTRLB_RXEN_Msk | SERCOM_USART_INT_CTRLB_TXEN_Msk - | SERCOM_USART_INT_CTRLB_SFDE_Msk; + | SERCOM_USART_INT_CTRLB_RXEN_Msk | SERCOM_USART_INT_CTRLB_TXEN_Msk + | SERCOM_USART_INT_CTRLB_SFDE_Msk; /* Enable the UART after the configurations */ ROBUS_COM->USART_INT.SERCOM_CTRLA |= SERCOM_USART_INT_CTRLA_ENABLE_Msk; @@ -128,13 +128,13 @@ void RobusHAL_ComInit(uint32_t Baudrate) #ifndef USE_TX_IT ROBUS_DMA_CLOCK_ENABLE(); - ROBUS_DMA->DMAC_BASEADDR = (uint32_t)&descriptor_section; - ROBUS_DMA->DMAC_WRBADDR = (uint32_t)&write_back_section; - ROBUS_DMA->DMAC_PRICTRL0 = DMAC_PRICTRL0_LVLPRI0(1UL) | DMAC_PRICTRL0_RRLVLEN0_Msk | DMAC_PRICTRL0_LVLPRI1(1UL) | DMAC_PRICTRL0_RRLVLEN1_Msk | DMAC_PRICTRL0_LVLPRI2(1UL) | DMAC_PRICTRL0_RRLVLEN2_Msk | DMAC_PRICTRL0_LVLPRI3(1UL) | DMAC_PRICTRL0_RRLVLEN3_Msk; - ROBUS_DMA->DMAC_CHID = ROBUS_DMA_CHANNEL; // DMA Channel - ROBUS_DMA->DMAC_CHCTRLB = DMAC_CHCTRLB_TRIGACT(2) | DMAC_CHCTRLB_TRIGSRC(ROBUS_DMA_TRIGGER) | DMAC_CHCTRLB_LVL(0); + ROBUS_DMA->DMAC_BASEADDR = (uint32_t)&descriptor_section; + ROBUS_DMA->DMAC_WRBADDR = (uint32_t)&write_back_section; + ROBUS_DMA->DMAC_PRICTRL0 = DMAC_PRICTRL0_LVLPRI0(1UL) | DMAC_PRICTRL0_RRLVLEN0_Msk | DMAC_PRICTRL0_LVLPRI1(1UL) | DMAC_PRICTRL0_RRLVLEN1_Msk | DMAC_PRICTRL0_LVLPRI2(1UL) | DMAC_PRICTRL0_RRLVLEN2_Msk | DMAC_PRICTRL0_LVLPRI3(1UL) | DMAC_PRICTRL0_RRLVLEN3_Msk; + ROBUS_DMA->DMAC_CHID = ROBUS_DMA_CHANNEL; // DMA Channel + ROBUS_DMA->DMAC_CHCTRLB = DMAC_CHCTRLB_TRIGACT(2) | DMAC_CHCTRLB_TRIGSRC(ROBUS_DMA_TRIGGER) | DMAC_CHCTRLB_LVL(0); descriptor_section.DMAC_BTCTRL = DMAC_BTCTRL_BLOCKACT_INT | DMAC_BTCTRL_BEATSIZE_BYTE | DMAC_BTCTRL_VALID_Msk | DMAC_BTCTRL_SRCINC_Msk; - ROBUS_DMA->DMAC_CTRL = DMAC_CTRL_DMAENABLE_Msk | DMAC_CTRL_LVLEN0_Msk | DMAC_CTRL_LVLEN1_Msk | DMAC_CTRL_LVLEN2_Msk | DMAC_CTRL_LVLEN3_Msk; + ROBUS_DMA->DMAC_CTRL = DMAC_CTRL_DMAENABLE_Msk | DMAC_CTRL_LVLEN0_Msk | DMAC_CTRL_LVLEN1_Msk | DMAC_CTRL_LVLEN2_Msk | DMAC_CTRL_LVLEN3_Msk; #endif } /****************************************************************************** @@ -676,7 +676,8 @@ _CRITICAL void RobusHAL_ComputeCRC(uint8_t *data, uint8_t *crc) *(uint16_t *)crc ^= dbyte << 8; for (uint8_t j = 0; j < 8; ++j) { - uint16_t mix = *(uint16_t *)crc & 0x8000; + uint16_t mix = *(uint16_t *)crc & 0x8000; + *(uint16_t *)crc = (*(uint16_t *)crc << 1); if (mix) *(uint16_t *)crc = *(uint16_t *)crc ^ 0x0007; diff --git a/network/robus_network/HAL/ATSAMD21/robus_hal_config.h b/network/robus_network/HAL/ATSAMD21/robus_hal_config.h index 1c23d065c..87224b356 100644 --- a/network/robus_network/HAL/ATSAMD21/robus_hal_config.h +++ b/network/robus_network/HAL/ATSAMD21/robus_hal_config.h @@ -120,7 +120,7 @@ * COM CONFIG ******************************************************************************/ #ifndef ROBUS_COM_CLOCK_ENABLE - #define ROBUS_COM_CLOCK_ENABLE() \ + #define ROBUS_COM_CLOCK_ENABLE() \ do \ { \ GCLK_REGS->GCLK_CLKCTRL = GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_SERCOM0_CORE_Val) | GCLK_CLKCTRL_GEN(0x0) | GCLK_CLKCTRL_CLKEN_Msk; \ @@ -140,7 +140,7 @@ * DMA CONFIG ******************************************************************************/ #ifndef ROBUS_DMA_CLOCK_ENABLE - #define ROBUS_DMA_CLOCK_ENABLE() \ + #define ROBUS_DMA_CLOCK_ENABLE() \ do \ { \ PM_REGS->PM_AHBMASK |= PM_AHBMASK_DMAC_Msk; \ @@ -159,7 +159,7 @@ * COM TIMEOUT CONFIG ******************************************************************************/ #ifndef ROBUS_TIMER_CLOCK_ENABLE - #define ROBUS_TIMER_CLOCK_ENABLE() \ + #define ROBUS_TIMER_CLOCK_ENABLE() \ do \ { \ GCLK_REGS->GCLK_CLKCTRL = GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_TCC2_TC3_Val) | GCLK_CLKCTRL_GEN(0x0) | GCLK_CLKCTRL_CLKEN_Msk; \ diff --git a/network/robus_network/HAL/ATSAMD21_ARDUINO/board_config.h b/network/robus_network/HAL/ATSAMD21_ARDUINO/board_config.h index d02698489..b3b40bd19 100644 --- a/network/robus_network/HAL/ATSAMD21_ARDUINO/board_config.h +++ b/network/robus_network/HAL/ATSAMD21_ARDUINO/board_config.h @@ -13,7 +13,7 @@ #include #if defined(ARDUINO_SAMD_ZERO) - #define ROBUS_COM_CLOCK_ENABLE() \ + #define ROBUS_COM_CLOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_SERCOM0_CORE_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ @@ -29,7 +29,7 @@ || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) || defined(ARDUINO_SAMD_MKRGSM1400) \ || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRZERO) || defined(ARDUINO_SAMD_NANO_33_IOT) \ || defined(SAMD_MKRVIDOR4000)) - #define ROBUS_COM_CLOCK_ENABLE() \ + #define ROBUS_COM_CLOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_SERCOM5_CORE_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ @@ -43,7 +43,7 @@ #endif #if defined(SEEED_XIAO_M0) - #define ROBUS_COM_CLOCK_ENABLE() \ + #define ROBUS_COM_CLOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_SERCOM4_CORE_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ @@ -53,8 +53,8 @@ #define ROBUS_COM_IRQ SERCOM4_IRQn #define ROBUS_COM_IRQHANDLER() SERCOM4_Handler() #define ROBUS_DMA_TRIGGER SERCOM4_DMAC_ID_TX - #define COM_TX_POS 0 // PAD0 - #define COM_RX_POS 1 // PAD1 + #define COM_TX_POS 0 // PAD0 + #define COM_RX_POS 1 // PAD1 #define ARDUINO_PTPA_PIN 1 #define ARDUINO_PTPB_PIN 2 diff --git a/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.c b/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.c index 6ca7b35ac..ec5944d38 100644 --- a/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.c +++ b/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.c @@ -95,19 +95,19 @@ void RobusHAL_ComInit(uint32_t Baudrate) ROBUS_COM->USART.CTRLA.reg &= ~SERCOM_USART_CTRLA_ENABLE; /* Configure Baud Rate */ - baud = 65536 - ((uint64_t)65536 * 16 * Baudrate) / MCUFREQ; + baud = 65536 - ((uint64_t)65536 * 16 * Baudrate) / MCUFREQ; ROBUS_COM->USART.BAUD.reg = SERCOM_USART_BAUD_BAUD(baud); // Configures USART Clock Mode/ TXPO and RXPO/ Data Order/ Standby Mode/ Sampling rate/ IBON ROBUS_COM->USART.CTRLA.reg = SERCOM_USART_CTRLA_MODE_USART_INT_CLK | SERCOM_USART_CTRLA_RXPO(COM_RX_POS) - | SERCOM_USART_CTRLA_TXPO(COM_TX_POS) | SERCOM_USART_CTRLA_DORD - | SERCOM_USART_CTRLA_IBON | SERCOM_USART_CTRLA_FORM(0x0) - | SERCOM_USART_CTRLA_SAMPR(0); + | SERCOM_USART_CTRLA_TXPO(COM_TX_POS) | SERCOM_USART_CTRLA_DORD + | SERCOM_USART_CTRLA_IBON | SERCOM_USART_CTRLA_FORM(0x0) + | SERCOM_USART_CTRLA_SAMPR(0); // Configures RXEN/ TXEN/ CHSIZE/ Parity/ Stop bits ROBUS_COM->USART.CTRLB.reg = SERCOM_USART_CTRLB_CHSIZE(0) | SERCOM_USART_CTRLB_SBMODE - | SERCOM_USART_CTRLB_RXEN | SERCOM_USART_CTRLB_TXEN - | SERCOM_USART_CTRLB_SFDE; + | SERCOM_USART_CTRLB_RXEN | SERCOM_USART_CTRLB_TXEN + | SERCOM_USART_CTRLB_SFDE; /* Enable the UART after the configurations */ ROBUS_COM->USART.CTRLA.reg |= SERCOM_USART_CTRLA_ENABLE; @@ -132,13 +132,13 @@ void RobusHAL_ComInit(uint32_t Baudrate) #ifndef USE_TX_IT ROBUS_DMA_CLOCK_ENABLE(); - ROBUS_DMA->BASEADDR.reg = (uint32_t)&descriptor_section; - ROBUS_DMA->WRBADDR.reg = (uint32_t)&write_back_section; - ROBUS_DMA->PRICTRL0.reg = DMAC_PRICTRL0_LVLPRI0(1UL) | DMAC_PRICTRL0_RRLVLEN0 | DMAC_PRICTRL0_LVLPRI1(1UL) | DMAC_PRICTRL0_RRLVLEN1 | DMAC_PRICTRL0_LVLPRI2(1UL) | DMAC_PRICTRL0_RRLVLEN2 | DMAC_PRICTRL0_LVLPRI3(1UL) | DMAC_PRICTRL0_RRLVLEN3; - ROBUS_DMA->CHID.reg = ROBUS_DMA_CHANNEL; // DMA Channel - ROBUS_DMA->CHCTRLB.reg = DMAC_CHCTRLB_TRIGACT(2) | DMAC_CHCTRLB_TRIGSRC(ROBUS_DMA_TRIGGER) | DMAC_CHCTRLB_LVL(0); + ROBUS_DMA->BASEADDR.reg = (uint32_t)&descriptor_section; + ROBUS_DMA->WRBADDR.reg = (uint32_t)&write_back_section; + ROBUS_DMA->PRICTRL0.reg = DMAC_PRICTRL0_LVLPRI0(1UL) | DMAC_PRICTRL0_RRLVLEN0 | DMAC_PRICTRL0_LVLPRI1(1UL) | DMAC_PRICTRL0_RRLVLEN1 | DMAC_PRICTRL0_LVLPRI2(1UL) | DMAC_PRICTRL0_RRLVLEN2 | DMAC_PRICTRL0_LVLPRI3(1UL) | DMAC_PRICTRL0_RRLVLEN3; + ROBUS_DMA->CHID.reg = ROBUS_DMA_CHANNEL; // DMA Channel + ROBUS_DMA->CHCTRLB.reg = DMAC_CHCTRLB_TRIGACT(2) | DMAC_CHCTRLB_TRIGSRC(ROBUS_DMA_TRIGGER) | DMAC_CHCTRLB_LVL(0); descriptor_section.BTCTRL.reg = DMAC_BTCTRL_BLOCKACT_INT | DMAC_BTCTRL_BEATSIZE_BYTE | DMAC_BTCTRL_VALID | DMAC_BTCTRL_SRCINC; - ROBUS_DMA->CTRL.reg = DMAC_CTRL_DMAENABLE | DMAC_CTRL_LVLEN0 | DMAC_CTRL_LVLEN1 | DMAC_CTRL_LVLEN2 | DMAC_CTRL_LVLEN3; + ROBUS_DMA->CTRL.reg = DMAC_CTRL_DMAENABLE | DMAC_CTRL_LVLEN0 | DMAC_CTRL_LVLEN1 | DMAC_CTRL_LVLEN2 | DMAC_CTRL_LVLEN3; #endif } /****************************************************************************** @@ -645,7 +645,8 @@ _CRITICAL void RobusHAL_ComputeCRC(uint8_t *data, uint8_t *crc) *(uint16_t *)crc ^= dbyte << 8; for (uint8_t j = 0; j < 8; ++j) { - uint16_t mix = *(uint16_t *)crc & 0x8000; + uint16_t mix = *(uint16_t *)crc & 0x8000; + *(uint16_t *)crc = (*(uint16_t *)crc << 1); if (mix) *(uint16_t *)crc = *(uint16_t *)crc ^ 0x0007; diff --git a/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal_config.h b/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal_config.h index 57394f36e..0d1db5264 100644 --- a/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal_config.h +++ b/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal_config.h @@ -143,7 +143,7 @@ DEFAULT RobusHAL ARDUINO PIN CONFIGURATION * COM CONFIG ******************************************************************************/ #ifndef ROBUS_COM_CLOCK_ENABLE - #define ROBUS_COM_CLOCK_ENABLE() \ + #define ROBUS_COM_CLOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_SERCOM0_CORE_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ @@ -163,7 +163,7 @@ DEFAULT RobusHAL ARDUINO PIN CONFIGURATION * DMA CONFIG ******************************************************************************/ #ifndef ROBUS_DMA_CLOCK_ENABLE - #define ROBUS_DMA_CLOCK_ENABLE() \ + #define ROBUS_DMA_CLOCK_ENABLE() \ do \ { \ PM->APBCMASK.reg |= PM_AHBMASK_DMAC; \ @@ -182,7 +182,7 @@ DEFAULT RobusHAL ARDUINO PIN CONFIGURATION * COM TIMEOUT CONFIG ******************************************************************************/ #ifndef ROBUS_TIMER_CLOCK_ENABLE - #define ROBUS_TIMER_CLOCK_ENABLE() \ + #define ROBUS_TIMER_CLOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_TCC2_TC3_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ diff --git a/network/robus_network/HAL/ATSAMD21_MBED/robus_hal.c b/network/robus_network/HAL/ATSAMD21_MBED/robus_hal.c index 3939d22f6..016a79224 100644 --- a/network/robus_network/HAL/ATSAMD21_MBED/robus_hal.c +++ b/network/robus_network/HAL/ATSAMD21_MBED/robus_hal.c @@ -93,19 +93,19 @@ void RobusHAL_ComInit(uint32_t Baudrate) ROBUS_COM->USART.CTRLA.reg &= ~SERCOM_USART_CTRLA_ENABLE; /* Configure Baud Rate */ - baud = 65536 - ((uint64_t)65536 * 16 * Baudrate) / MCUFREQ; + baud = 65536 - ((uint64_t)65536 * 16 * Baudrate) / MCUFREQ; ROBUS_COM->USART.BAUD.reg = SERCOM_USART_BAUD_BAUD(baud); // Configures USART Clock Mode/ TXPO and RXPO/ Data Order/ Standby Mode/ Sampling rate/ IBON ROBUS_COM->USART.CTRLA.reg = SERCOM_USART_CTRLA_MODE_USART_INT_CLK | SERCOM_USART_CTRLA_RXPO(COM_RX_POS) - | SERCOM_USART_CTRLA_TXPO(COM_TX_POS) | SERCOM_USART_CTRLA_DORD - | SERCOM_USART_CTRLA_IBON | SERCOM_USART_CTRLA_FORM(0x0) - | SERCOM_USART_CTRLA_SAMPR(0); + | SERCOM_USART_CTRLA_TXPO(COM_TX_POS) | SERCOM_USART_CTRLA_DORD + | SERCOM_USART_CTRLA_IBON | SERCOM_USART_CTRLA_FORM(0x0) + | SERCOM_USART_CTRLA_SAMPR(0); // Configures RXEN/ TXEN/ CHSIZE/ Parity/ Stop bits ROBUS_COM->USART.CTRLB.reg = SERCOM_USART_CTRLB_CHSIZE(0) | SERCOM_USART_CTRLB_SBMODE - | SERCOM_USART_CTRLB_RXEN | SERCOM_USART_CTRLB_TXEN - | SERCOM_USART_CTRLB_SFDE; + | SERCOM_USART_CTRLB_RXEN | SERCOM_USART_CTRLB_TXEN + | SERCOM_USART_CTRLB_SFDE; /* Enable the UART after the configurations */ ROBUS_COM->USART.CTRLA.reg |= SERCOM_USART_CTRLA_ENABLE; @@ -131,13 +131,13 @@ void RobusHAL_ComInit(uint32_t Baudrate) #ifndef USE_TX_IT ROBUS_DMA_CLOCK_ENABLE(); - ROBUS_DMA->BASEADDR.reg = (uint32_t)&descriptor_section; - ROBUS_DMA->WRBADDR.reg = (uint32_t)&write_back_section; - ROBUS_DMA->PRICTRL0.reg = DMAC_PRICTRL0_LVLPRI0(1UL) | DMAC_PRICTRL0_RRLVLEN0 | DMAC_PRICTRL0_LVLPRI1(1UL) | DMAC_PRICTRL0_RRLVLEN1 | DMAC_PRICTRL0_LVLPRI2(1UL) | DMAC_PRICTRL0_RRLVLEN2 | DMAC_PRICTRL0_LVLPRI3(1UL) | DMAC_PRICTRL0_RRLVLEN3; - ROBUS_DMA->CHID.reg = ROBUS_DMA_CHANNEL; // DMA Channel - ROBUS_DMA->CHCTRLB.reg = DMAC_CHCTRLB_TRIGACT(2) | DMAC_CHCTRLB_TRIGSRC(ROBUS_DMA_TRIGGER) | DMAC_CHCTRLB_LVL(0); + ROBUS_DMA->BASEADDR.reg = (uint32_t)&descriptor_section; + ROBUS_DMA->WRBADDR.reg = (uint32_t)&write_back_section; + ROBUS_DMA->PRICTRL0.reg = DMAC_PRICTRL0_LVLPRI0(1UL) | DMAC_PRICTRL0_RRLVLEN0 | DMAC_PRICTRL0_LVLPRI1(1UL) | DMAC_PRICTRL0_RRLVLEN1 | DMAC_PRICTRL0_LVLPRI2(1UL) | DMAC_PRICTRL0_RRLVLEN2 | DMAC_PRICTRL0_LVLPRI3(1UL) | DMAC_PRICTRL0_RRLVLEN3; + ROBUS_DMA->CHID.reg = ROBUS_DMA_CHANNEL; // DMA Channel + ROBUS_DMA->CHCTRLB.reg = DMAC_CHCTRLB_TRIGACT(2) | DMAC_CHCTRLB_TRIGSRC(ROBUS_DMA_TRIGGER) | DMAC_CHCTRLB_LVL(0); descriptor_section.BTCTRL.reg = DMAC_BTCTRL_BLOCKACT_INT | DMAC_BTCTRL_BEATSIZE_BYTE | DMAC_BTCTRL_VALID | DMAC_BTCTRL_SRCINC; - ROBUS_DMA->CTRL.reg = DMAC_CTRL_DMAENABLE | DMAC_CTRL_LVLEN0 | DMAC_CTRL_LVLEN1 | DMAC_CTRL_LVLEN2 | DMAC_CTRL_LVLEN3; + ROBUS_DMA->CTRL.reg = DMAC_CTRL_DMAENABLE | DMAC_CTRL_LVLEN0 | DMAC_CTRL_LVLEN1 | DMAC_CTRL_LVLEN2 | DMAC_CTRL_LVLEN3; #endif } /****************************************************************************** @@ -674,7 +674,8 @@ _CRITICAL void RobusHAL_ComputeCRC(uint8_t *data, uint8_t *crc) *(uint16_t *)crc ^= dbyte << 8; for (uint8_t j = 0; j < 8; ++j) { - uint16_t mix = *(uint16_t *)crc & 0x8000; + uint16_t mix = *(uint16_t *)crc & 0x8000; + *(uint16_t *)crc = (*(uint16_t *)crc << 1); if (mix) *(uint16_t *)crc = *(uint16_t *)crc ^ 0x0007; diff --git a/network/robus_network/HAL/ATSAMD21_MBED/robus_hal_config.h b/network/robus_network/HAL/ATSAMD21_MBED/robus_hal_config.h index 149382460..315123bd2 100644 --- a/network/robus_network/HAL/ATSAMD21_MBED/robus_hal_config.h +++ b/network/robus_network/HAL/ATSAMD21_MBED/robus_hal_config.h @@ -116,7 +116,7 @@ * COM CONFIG ******************************************************************************/ #ifndef ROBUS_COM_CLOCK_ENABLE - #define ROBUS_COM_CLOCK_ENABLE() \ + #define ROBUS_COM_CLOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_SERCOM0_CORE_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ @@ -137,7 +137,7 @@ * DMA CONFIG ******************************************************************************/ #ifndef ROBUS_DMA_CLOCK_ENABLE - #define ROBUS_DMA_CLOCK_ENABLE() \ + #define ROBUS_DMA_CLOCK_ENABLE() \ do \ { \ PM->APBCMASK.reg |= PM_AHBMASK_DMAC; \ @@ -156,7 +156,7 @@ * COM TIMEOUT CONFIG ******************************************************************************/ #ifndef ROBUS_TIMER_CLOCK_ENABLE - #define ROBUS_TIMER_CLOCK_ENABLE() \ + #define ROBUS_TIMER_CLOCK_ENABLE() \ do \ { \ GCLK->CLKCTRL.reg = (uint16_t)(GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_TCC2_TC3_Val) | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_CLKEN); \ diff --git a/network/robus_network/HAL/NATIVE/robus_hal.c b/network/robus_network/HAL/NATIVE/robus_hal.c index dd1667409..096981441 100644 --- a/network/robus_network/HAL/NATIVE/robus_hal.c +++ b/network/robus_network/HAL/NATIVE/robus_hal.c @@ -492,7 +492,8 @@ void RobusHAL_ComputeCRC(uint8_t *data, uint8_t *crc) *(uint16_t *)crc ^= dbyte << 8; for (uint8_t j = 0; j < 8; ++j) { - uint16_t mix = *(uint16_t *)crc & 0x8000; + uint16_t mix = *(uint16_t *)crc & 0x8000; + *(uint16_t *)crc = (*(uint16_t *)crc << 1); if (mix) *(uint16_t *)crc = *(uint16_t *)crc ^ 0x0007; diff --git a/network/robus_network/HAL/NATIVE/robus_hal_config.h b/network/robus_network/HAL/NATIVE/robus_hal_config.h index 6a54c1961..881dd2e4f 100644 --- a/network/robus_network/HAL/NATIVE/robus_hal_config.h +++ b/network/robus_network/HAL/NATIVE/robus_hal_config.h @@ -101,7 +101,7 @@ #endif #ifndef PINOUT_IRQHANDLER -//#define PINOUT_IRQHANDLER(PIN) +// #define PINOUT_IRQHANDLER(PIN) #endif /******************************************************************************* diff --git a/network/robus_network/HAL/STM32F0/robus_hal.c b/network/robus_network/HAL/STM32F0/robus_hal.c index b04b833c0..5369c211b 100644 --- a/network/robus_network/HAL/STM32F0/robus_hal.c +++ b/network/robus_network/HAL/STM32F0/robus_hal.c @@ -646,6 +646,7 @@ _CRITICAL void RobusHAL_ComputeCRC(uint8_t *data, uint8_t *crc) for (uint8_t j = 0; j < 8; ++j) { uint16_t mix = *(uint16_t *)crc & 0x8000; + *(uint16_t *)crc = (*(uint16_t *)crc << 1); if (mix) *(uint16_t *)crc = *(uint16_t *)crc ^ 0x0007; diff --git a/network/robus_network/HAL/STM32F4/robus_hal.c b/network/robus_network/HAL/STM32F4/robus_hal.c index 484ba00c5..a8bd26306 100644 --- a/network/robus_network/HAL/STM32F4/robus_hal.c +++ b/network/robus_network/HAL/STM32F4/robus_hal.c @@ -650,6 +650,7 @@ _CRITICAL void RobusHAL_ComputeCRC(uint8_t *data, uint8_t *crc) for (uint8_t j = 0; j < 8; ++j) { uint16_t mix = *(uint16_t *)crc & 0x8000; + *(uint16_t *)crc = (*(uint16_t *)crc << 1); if (mix) *(uint16_t *)crc = *(uint16_t *)crc ^ 0x0007; diff --git a/network/robus_network/HAL/STM32G4/robus_hal.c b/network/robus_network/HAL/STM32G4/robus_hal.c index d1800a356..75d22fd84 100644 --- a/network/robus_network/HAL/STM32G4/robus_hal.c +++ b/network/robus_network/HAL/STM32G4/robus_hal.c @@ -647,6 +647,7 @@ _CRITICAL void RobusHAL_ComputeCRC(uint8_t *data, uint8_t *crc) for (uint8_t j = 0; j < 8; ++j) { uint16_t mix = *(uint16_t *)crc & 0x8000; + *(uint16_t *)crc = (*(uint16_t *)crc << 1); if (mix) *(uint16_t *)crc = *(uint16_t *)crc ^ 0x0007; diff --git a/network/robus_network/HAL/STM32G4/robus_hal_config.h b/network/robus_network/HAL/STM32G4/robus_hal_config.h index d4ada2cdc..47f2b68f6 100644 --- a/network/robus_network/HAL/STM32G4/robus_hal_config.h +++ b/network/robus_network/HAL/STM32G4/robus_hal_config.h @@ -125,7 +125,7 @@ * DMA CONFIG ******************************************************************************/ #ifndef ROBUS_DMA_CLOCK_ENABLE - #define ROBUS_DMA_CLOCK_ENABLE() \ + #define ROBUS_DMA_CLOCK_ENABLE() \ do \ { \ __HAL_RCC_DMA1_CLK_ENABLE(); \ diff --git a/network/robus_network/HAL/STM32L0/robus_hal.c b/network/robus_network/HAL/STM32L0/robus_hal.c index 285122905..c08b6d6e9 100644 --- a/network/robus_network/HAL/STM32L0/robus_hal.c +++ b/network/robus_network/HAL/STM32L0/robus_hal.c @@ -645,6 +645,7 @@ void RobusHAL_ComputeCRC(uint8_t *data, uint8_t *crc) for (uint8_t j = 0; j < 8; ++j) { uint16_t mix = *(uint16_t *)crc & 0x8000; + *(uint16_t *)crc = (*(uint16_t *)crc << 1); if (mix) *(uint16_t *)crc = *(uint16_t *)crc ^ 0x0007; diff --git a/network/robus_network/HAL/STM32L4/robus_hal.c b/network/robus_network/HAL/STM32L4/robus_hal.c index 5f8d7ec1f..12c95af2b 100644 --- a/network/robus_network/HAL/STM32L4/robus_hal.c +++ b/network/robus_network/HAL/STM32L4/robus_hal.c @@ -647,6 +647,7 @@ _CRITICAL void RobusHAL_ComputeCRC(uint8_t *data, uint8_t *crc) for (uint8_t j = 0; j < 8; ++j) { uint16_t mix = *(uint16_t *)crc & 0x8000; + *(uint16_t *)crc = (*(uint16_t *)crc << 1); if (mix) *(uint16_t *)crc = *(uint16_t *)crc ^ 0x0007; diff --git a/network/robus_network/HAL/STUB/robus_hal.c b/network/robus_network/HAL/STUB/robus_hal.c index 0961c5ac6..b6cbdd824 100644 --- a/network/robus_network/HAL/STUB/robus_hal.c +++ b/network/robus_network/HAL/STUB/robus_hal.c @@ -246,7 +246,8 @@ void RobusHAL_ComputeCRC(uint8_t *data, uint8_t *crc) *(uint16_t *)crc ^= dbyte << 8; for (uint8_t j = 0; j < 8; ++j) { - uint16_t mix = *(uint16_t *)crc & 0x8000; + uint16_t mix = *(uint16_t *)crc & 0x8000; + *(uint16_t *)crc = (*(uint16_t *)crc << 1); if (mix) *(uint16_t *)crc = *(uint16_t *)crc ^ 0x0007; diff --git a/network/robus_network/HAL/STUB/robus_hal_config.h b/network/robus_network/HAL/STUB/robus_hal_config.h index 6a54c1961..881dd2e4f 100644 --- a/network/robus_network/HAL/STUB/robus_hal_config.h +++ b/network/robus_network/HAL/STUB/robus_hal_config.h @@ -101,7 +101,7 @@ #endif #ifndef PINOUT_IRQHANDLER -//#define PINOUT_IRQHANDLER(PIN) +// #define PINOUT_IRQHANDLER(PIN) #endif /******************************************************************************* diff --git a/network/robus_network/HAL/template/robus_hal.c b/network/robus_network/HAL/template/robus_hal.c index 3cee9b0f0..db006031f 100644 --- a/network/robus_network/HAL/template/robus_hal.c +++ b/network/robus_network/HAL/template/robus_hal.c @@ -722,6 +722,7 @@ void RobusHAL_ComputeCRC(uint8_t *data, uint8_t *crc) for (uint8_t j = 0; j < 8; ++j) { uint16_t mix = *(uint16_t *)crc & 0x8000; + *(uint16_t *)crc = (*(uint16_t *)crc << 1); if (mix) *(uint16_t *)crc = *(uint16_t *)crc ^ 0x0007; From 07c499848d15258e2cdca6081b00a61132e012b7 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 3 Aug 2023 18:14:23 +0200 Subject: [PATCH 117/150] Remove Inspector because we don't maintain it anymore. --- .github/workflows/pio_release.yml | 70 -- engine/core/inc/luos_list.h | 1 - .../Arduino/inspector_serialcom/node_config.h | 109 --- .../inspector_serialcom/platformio.ini | 59 -- .../src/Inspector_SerialCom.cpp | 32 - .../inspector_serialcom/README.md | 36 - .../inspector_serialcom/include/gpio.h | 50 -- .../inspector_serialcom/include/main.h | 76 -- .../include/stm32_assert.h | 54 -- .../include/stm32f0xx_hal_conf.h | 323 -------- .../include/stm32f0xx_it.h | 66 -- .../linker/custom_Luos_bootloader_script.ld | 182 ----- .../inspector_serialcom/node_config.h | 100 --- .../inspector_serialcom/platformio.ini | 58 -- .../inspector_serialcom/src/gpio.c | 66 -- .../inspector_serialcom/src/main.c | 181 ----- .../src/stm32f0xx_hal_msp.c | 84 -- .../inspector_serialcom/src/stm32f0xx_it.c | 149 ---- .../src/system_stm32f0xx.c | 331 -------- .../Inspector_SerialCom.ioc | 100 --- .../inspector_serialcom/include/gpio.h | 50 -- .../inspector_serialcom/include/main.h | 76 -- .../include/stm32f4xx_hal_conf.h | 490 ------------ .../include/stm32f4xx_it.h | 70 -- .../linker/custom_Luos_bootloader_script.ld | 175 ----- .../inspector_serialcom/node_config.h | 144 ---- .../inspector_serialcom/platformio.ini | 56 -- .../inspector_serialcom/src/gpio.c | 66 -- .../inspector_serialcom/src/main.c | 191 ----- .../src/stm32f4xx_hal_msp.c | 84 -- .../inspector_serialcom/src/stm32f4xx_it.c | 219 ------ .../src/system_stm32f4xx.c | 730 ----------------- .../Inspector_SerialCom.ioc | 103 --- .../inspector_serialcom/include/gpio.h | 50 -- .../inspector_serialcom/include/main.h | 76 -- .../include/stm32f4xx_hal_conf.h | 490 ------------ .../include/stm32f4xx_it.h | 70 -- .../linker/custom_Luos_bootloader_script.ld | 186 ----- .../inspector_serialcom/node_config.h | 144 ---- .../inspector_serialcom/platformio.ini | 56 -- .../inspector_serialcom/src/gpio.c | 66 -- .../inspector_serialcom/src/main.c | 192 ----- .../src/stm32f4xx_hal_msp.c | 84 -- .../inspector_serialcom/src/stm32f4xx_it.c | 219 ------ .../src/system_stm32f4xx.c | 730 ----------------- .../Inspector_SerialCom.ioc | 119 --- .../inspector_serialcom/include/gpio.h | 50 -- .../inspector_serialcom/include/main.h | 76 -- .../include/stm32g4xx_hal_conf.h | 382 --------- .../include/stm32g4xx_it.h | 70 -- .../linker/custom_Luos_bootloader_script.ld | 175 ----- .../inspector_serialcom/node_config.h | 116 --- .../inspector_serialcom/platformio.ini | 58 -- .../inspector_serialcom/src/gpio.c | 66 -- .../inspector_serialcom/src/main.c | 191 ----- .../src/stm32g4xx_hal_msp.c | 88 --- .../inspector_serialcom/src/stm32g4xx_it.c | 214 ----- .../src/system_stm32g4xx.c | 270 ------- .../inspector_serialcom/include/gpio.h | 50 -- .../inspector_serialcom/include/main.h | 76 -- .../include/stm32g4xx_hal_conf.h | 382 --------- .../include/stm32g4xx_it.h | 70 -- .../linker/custom_Luos_bootloader_script.ld | 175 ----- .../inspector_serialcom/node_config.h | 116 --- .../inspector_serialcom/platformio.ini | 57 -- .../inspector_serialcom/src/gpio.c | 66 -- .../inspector_serialcom/src/main.c | 192 ----- .../src/stm32g4xx_hal_msp.c | 88 --- .../inspector_serialcom/src/stm32g4xx_it.c | 214 ----- .../src/system_stm32g4xx.c | 269 ------- .../Inspector_SerialCom.ioc | 112 --- .../inspector_serialcom/include/gpio.h | 50 -- .../inspector_serialcom/include/main.h | 76 -- .../include/stm32l4xx_hal_conf.h | 484 ------------ .../include/stm32l4xx_it.h | 70 -- .../linker/custom_Luos_bootloader_script.ld | 175 ----- .../inspector_serialcom/node_config.h | 116 --- .../inspector_serialcom/platformio.ini | 56 -- .../inspector_serialcom/src/gpio.c | 66 -- .../inspector_serialcom/src/main.c | 195 ----- .../src/stm32l4xx_hal_msp.c | 84 -- .../inspector_serialcom/src/stm32l4xx_it.c | 213 ----- .../src/system_stm32l4xx.c | 336 -------- .../Inspector_SerialCom.ioc | 104 --- .../inspector_serialcom/include/gpio.h | 50 -- .../inspector_serialcom/include/main.h | 76 -- .../include/stm32f4xx_hal_conf.h | 490 ------------ .../include/stm32f4xx_it.h | 70 -- .../linker/custom_app_script.ld | 207 ----- .../inspector_serialcom/node_config.h | 119 --- .../inspector_serialcom/platformio.ini | 67 -- .../inspector_serialcom/src/gpio.c | 66 -- .../inspector_serialcom/src/main.c | 192 ----- .../src/stm32f4xx_hal_msp.c | 84 -- .../inspector_serialcom/src/stm32f4xx_it.c | 218 ------ .../src/system_stm32f4xx.c | 731 ------------------ .../projects/l0/inspector_serialcom/Pipe.ioc | 87 --- .../projects/l0/inspector_serialcom/README.md | 36 - .../l0/inspector_serialcom/boards/l0.json | 37 - .../l0/inspector_serialcom/include/gpio.h | 50 -- .../l0/inspector_serialcom/include/main.h | 76 -- .../include/stm32_assert.h | 54 -- .../include/stm32f0xx_hal_conf.h | 323 -------- .../include/stm32f0xx_it.h | 66 -- .../linker/custom_Luos_bootloader_script.ld | 182 ----- .../l0/inspector_serialcom/node_config.h | 100 --- .../l0/inspector_serialcom/platformio.ini | 45 -- .../l0/inspector_serialcom/src/gpio.c | 67 -- .../l0/inspector_serialcom/src/main.c | 184 ----- .../src/stm32f0xx_hal_msp.c | 84 -- .../l0/inspector_serialcom/src/stm32f0xx_it.c | 149 ---- .../src/system_stm32f0xx.c | 333 -------- tool_services/inspector/README.md | 29 - tool_services/inspector/data_manager.c | 225 ------ tool_services/inspector/data_manager.h | 25 - tool_services/inspector/inspector.c | 61 -- tool_services/inspector/inspector.h | 22 - tool_services/inspector/library.json | 20 - tool_services/inspector/pipe_link.c | 134 ---- tool_services/inspector/pipe_link.h | 27 - 120 files changed, 17497 deletions(-) delete mode 100644 examples/projects/Arduino/inspector_serialcom/node_config.h delete mode 100644 examples/projects/Arduino/inspector_serialcom/platformio.ini delete mode 100644 examples/projects/Arduino/inspector_serialcom/src/Inspector_SerialCom.cpp delete mode 100644 examples/projects/NUCLEO-F072RB/inspector_serialcom/README.md delete mode 100644 examples/projects/NUCLEO-F072RB/inspector_serialcom/include/gpio.h delete mode 100644 examples/projects/NUCLEO-F072RB/inspector_serialcom/include/main.h delete mode 100644 examples/projects/NUCLEO-F072RB/inspector_serialcom/include/stm32_assert.h delete mode 100644 examples/projects/NUCLEO-F072RB/inspector_serialcom/include/stm32f0xx_hal_conf.h delete mode 100644 examples/projects/NUCLEO-F072RB/inspector_serialcom/include/stm32f0xx_it.h delete mode 100644 examples/projects/NUCLEO-F072RB/inspector_serialcom/linker/custom_Luos_bootloader_script.ld delete mode 100644 examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h delete mode 100644 examples/projects/NUCLEO-F072RB/inspector_serialcom/platformio.ini delete mode 100644 examples/projects/NUCLEO-F072RB/inspector_serialcom/src/gpio.c delete mode 100644 examples/projects/NUCLEO-F072RB/inspector_serialcom/src/main.c delete mode 100644 examples/projects/NUCLEO-F072RB/inspector_serialcom/src/stm32f0xx_hal_msp.c delete mode 100644 examples/projects/NUCLEO-F072RB/inspector_serialcom/src/stm32f0xx_it.c delete mode 100644 examples/projects/NUCLEO-F072RB/inspector_serialcom/src/system_stm32f0xx.c delete mode 100644 examples/projects/NUCLEO-F401RE/inspector_serialcom/Inspector_SerialCom.ioc delete mode 100644 examples/projects/NUCLEO-F401RE/inspector_serialcom/include/gpio.h delete mode 100644 examples/projects/NUCLEO-F401RE/inspector_serialcom/include/main.h delete mode 100644 examples/projects/NUCLEO-F401RE/inspector_serialcom/include/stm32f4xx_hal_conf.h delete mode 100644 examples/projects/NUCLEO-F401RE/inspector_serialcom/include/stm32f4xx_it.h delete mode 100644 examples/projects/NUCLEO-F401RE/inspector_serialcom/linker/custom_Luos_bootloader_script.ld delete mode 100644 examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h delete mode 100644 examples/projects/NUCLEO-F401RE/inspector_serialcom/platformio.ini delete mode 100644 examples/projects/NUCLEO-F401RE/inspector_serialcom/src/gpio.c delete mode 100644 examples/projects/NUCLEO-F401RE/inspector_serialcom/src/main.c delete mode 100644 examples/projects/NUCLEO-F401RE/inspector_serialcom/src/stm32f4xx_hal_msp.c delete mode 100644 examples/projects/NUCLEO-F401RE/inspector_serialcom/src/stm32f4xx_it.c delete mode 100644 examples/projects/NUCLEO-F401RE/inspector_serialcom/src/system_stm32f4xx.c delete mode 100644 examples/projects/NUCLEO-F410RB/inspector_serialcom/Inspector_SerialCom.ioc delete mode 100644 examples/projects/NUCLEO-F410RB/inspector_serialcom/include/gpio.h delete mode 100644 examples/projects/NUCLEO-F410RB/inspector_serialcom/include/main.h delete mode 100644 examples/projects/NUCLEO-F410RB/inspector_serialcom/include/stm32f4xx_hal_conf.h delete mode 100644 examples/projects/NUCLEO-F410RB/inspector_serialcom/include/stm32f4xx_it.h delete mode 100644 examples/projects/NUCLEO-F410RB/inspector_serialcom/linker/custom_Luos_bootloader_script.ld delete mode 100644 examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h delete mode 100644 examples/projects/NUCLEO-F410RB/inspector_serialcom/platformio.ini delete mode 100644 examples/projects/NUCLEO-F410RB/inspector_serialcom/src/gpio.c delete mode 100644 examples/projects/NUCLEO-F410RB/inspector_serialcom/src/main.c delete mode 100644 examples/projects/NUCLEO-F410RB/inspector_serialcom/src/stm32f4xx_hal_msp.c delete mode 100644 examples/projects/NUCLEO-F410RB/inspector_serialcom/src/stm32f4xx_it.c delete mode 100644 examples/projects/NUCLEO-F410RB/inspector_serialcom/src/system_stm32f4xx.c delete mode 100644 examples/projects/NUCLEO-G431KB/inspector_serialcom/Inspector_SerialCom.ioc delete mode 100644 examples/projects/NUCLEO-G431KB/inspector_serialcom/include/gpio.h delete mode 100644 examples/projects/NUCLEO-G431KB/inspector_serialcom/include/main.h delete mode 100644 examples/projects/NUCLEO-G431KB/inspector_serialcom/include/stm32g4xx_hal_conf.h delete mode 100644 examples/projects/NUCLEO-G431KB/inspector_serialcom/include/stm32g4xx_it.h delete mode 100644 examples/projects/NUCLEO-G431KB/inspector_serialcom/linker/custom_Luos_bootloader_script.ld delete mode 100644 examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h delete mode 100644 examples/projects/NUCLEO-G431KB/inspector_serialcom/platformio.ini delete mode 100644 examples/projects/NUCLEO-G431KB/inspector_serialcom/src/gpio.c delete mode 100644 examples/projects/NUCLEO-G431KB/inspector_serialcom/src/main.c delete mode 100644 examples/projects/NUCLEO-G431KB/inspector_serialcom/src/stm32g4xx_hal_msp.c delete mode 100644 examples/projects/NUCLEO-G431KB/inspector_serialcom/src/stm32g4xx_it.c delete mode 100644 examples/projects/NUCLEO-G431KB/inspector_serialcom/src/system_stm32g4xx.c delete mode 100644 examples/projects/NUCLEO-G474RE/inspector_serialcom/include/gpio.h delete mode 100644 examples/projects/NUCLEO-G474RE/inspector_serialcom/include/main.h delete mode 100644 examples/projects/NUCLEO-G474RE/inspector_serialcom/include/stm32g4xx_hal_conf.h delete mode 100644 examples/projects/NUCLEO-G474RE/inspector_serialcom/include/stm32g4xx_it.h delete mode 100644 examples/projects/NUCLEO-G474RE/inspector_serialcom/linker/custom_Luos_bootloader_script.ld delete mode 100644 examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h delete mode 100644 examples/projects/NUCLEO-G474RE/inspector_serialcom/platformio.ini delete mode 100644 examples/projects/NUCLEO-G474RE/inspector_serialcom/src/gpio.c delete mode 100644 examples/projects/NUCLEO-G474RE/inspector_serialcom/src/main.c delete mode 100644 examples/projects/NUCLEO-G474RE/inspector_serialcom/src/stm32g4xx_hal_msp.c delete mode 100644 examples/projects/NUCLEO-G474RE/inspector_serialcom/src/stm32g4xx_it.c delete mode 100644 examples/projects/NUCLEO-G474RE/inspector_serialcom/src/system_stm32g4xx.c delete mode 100644 examples/projects/NUCLEO-L432KC/inspector_serialcom/Inspector_SerialCom.ioc delete mode 100644 examples/projects/NUCLEO-L432KC/inspector_serialcom/include/gpio.h delete mode 100644 examples/projects/NUCLEO-L432KC/inspector_serialcom/include/main.h delete mode 100644 examples/projects/NUCLEO-L432KC/inspector_serialcom/include/stm32l4xx_hal_conf.h delete mode 100644 examples/projects/NUCLEO-L432KC/inspector_serialcom/include/stm32l4xx_it.h delete mode 100644 examples/projects/NUCLEO-L432KC/inspector_serialcom/linker/custom_Luos_bootloader_script.ld delete mode 100644 examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h delete mode 100644 examples/projects/NUCLEO-L432KC/inspector_serialcom/platformio.ini delete mode 100644 examples/projects/NUCLEO-L432KC/inspector_serialcom/src/gpio.c delete mode 100644 examples/projects/NUCLEO-L432KC/inspector_serialcom/src/main.c delete mode 100644 examples/projects/NUCLEO-L432KC/inspector_serialcom/src/stm32l4xx_hal_msp.c delete mode 100644 examples/projects/NUCLEO-L432KC/inspector_serialcom/src/stm32l4xx_it.c delete mode 100644 examples/projects/NUCLEO-L432KC/inspector_serialcom/src/system_stm32l4xx.c delete mode 100644 examples/projects/STM32F4-discovery/inspector_serialcom/Inspector_SerialCom.ioc delete mode 100644 examples/projects/STM32F4-discovery/inspector_serialcom/include/gpio.h delete mode 100644 examples/projects/STM32F4-discovery/inspector_serialcom/include/main.h delete mode 100644 examples/projects/STM32F4-discovery/inspector_serialcom/include/stm32f4xx_hal_conf.h delete mode 100644 examples/projects/STM32F4-discovery/inspector_serialcom/include/stm32f4xx_it.h delete mode 100644 examples/projects/STM32F4-discovery/inspector_serialcom/linker/custom_app_script.ld delete mode 100644 examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h delete mode 100644 examples/projects/STM32F4-discovery/inspector_serialcom/platformio.ini delete mode 100644 examples/projects/STM32F4-discovery/inspector_serialcom/src/gpio.c delete mode 100644 examples/projects/STM32F4-discovery/inspector_serialcom/src/main.c delete mode 100644 examples/projects/STM32F4-discovery/inspector_serialcom/src/stm32f4xx_hal_msp.c delete mode 100644 examples/projects/STM32F4-discovery/inspector_serialcom/src/stm32f4xx_it.c delete mode 100644 examples/projects/STM32F4-discovery/inspector_serialcom/src/system_stm32f4xx.c delete mode 100644 examples/projects/l0/inspector_serialcom/Pipe.ioc delete mode 100644 examples/projects/l0/inspector_serialcom/README.md delete mode 100644 examples/projects/l0/inspector_serialcom/boards/l0.json delete mode 100644 examples/projects/l0/inspector_serialcom/include/gpio.h delete mode 100644 examples/projects/l0/inspector_serialcom/include/main.h delete mode 100644 examples/projects/l0/inspector_serialcom/include/stm32_assert.h delete mode 100644 examples/projects/l0/inspector_serialcom/include/stm32f0xx_hal_conf.h delete mode 100644 examples/projects/l0/inspector_serialcom/include/stm32f0xx_it.h delete mode 100644 examples/projects/l0/inspector_serialcom/linker/custom_Luos_bootloader_script.ld delete mode 100644 examples/projects/l0/inspector_serialcom/node_config.h delete mode 100644 examples/projects/l0/inspector_serialcom/platformio.ini delete mode 100644 examples/projects/l0/inspector_serialcom/src/gpio.c delete mode 100644 examples/projects/l0/inspector_serialcom/src/main.c delete mode 100644 examples/projects/l0/inspector_serialcom/src/stm32f0xx_hal_msp.c delete mode 100644 examples/projects/l0/inspector_serialcom/src/stm32f0xx_it.c delete mode 100644 examples/projects/l0/inspector_serialcom/src/system_stm32f0xx.c delete mode 100644 tool_services/inspector/README.md delete mode 100644 tool_services/inspector/data_manager.c delete mode 100644 tool_services/inspector/data_manager.h delete mode 100644 tool_services/inspector/inspector.c delete mode 100644 tool_services/inspector/inspector.h delete mode 100644 tool_services/inspector/library.json delete mode 100644 tool_services/inspector/pipe_link.c delete mode 100644 tool_services/inspector/pipe_link.h diff --git a/.github/workflows/pio_release.yml b/.github/workflows/pio_release.yml index 63d4fea65..ad968f3c0 100644 --- a/.github/workflows/pio_release.yml +++ b/.github/workflows/pio_release.yml @@ -110,76 +110,6 @@ jobs: pio package publish --owner luos --non-interactive cd ../.. - deploy_inspector: - needs: check_valid_tag - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: "3.x" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install platformio - - name: publish inspector tool - env: - PLATFORMIO_AUTH_TOKEN: ${{ secrets.PIO_TOKEN }} - run: | - # ***** Inspector publication ***** - cd tool_services/inspector - mkdir examples - - # Arduino - mkdir examples/Arduino - mkdir examples/Arduino/serial - cp -r ../../examples/projects/Arduino/inspector_serialcom/* examples/Arduino/serial/ - - # l0 - mkdir examples/l0 - mkdir examples/l0/serial - cp -r ../../examples/projects/l0/inspector_serialcom/* examples/l0/serial/ - - # NUCLEO-F072RB - mkdir examples/NUCLEO-F072RB - mkdir examples/NUCLEO-F072RB/serial - cp -r ../../examples/projects/NUCLEO-F072RB/inspector_serialcom/* examples/NUCLEO-F072RB/serial/ - - # NUCLEO-F401RE - mkdir examples/NUCLEO-F401RE - mkdir examples/NUCLEO-F401RE/serial - cp -r ../../examples/projects/NUCLEO-F401RE/inspector_serialcom/* examples/NUCLEO-F401RE/serial/ - - # NUCLEO-F410RB - mkdir examples/NUCLEO-F410RB - mkdir examples/NUCLEO-F410RB/serial - cp -r ../../examples/projects/NUCLEO-F410RB/inspector_serialcom/* examples/NUCLEO-F410RB/serial/ - - # NUCLEO-G431KB - mkdir examples/NUCLEO-G431KB - mkdir examples/NUCLEO-G431KB/serial - cp -r ../../examples/projects/NUCLEO-G431KB/inspector_serialcom/* examples/NUCLEO-G431KB/serial/ - - # NUCLEO-G474RE - mkdir examples/NUCLEO-G474RE - mkdir examples/NUCLEO-G474RE/serial - cp -r ../../examples/projects/NUCLEO-G474RE/inspector_serialcom/* examples/NUCLEO-G474RE/serial/ - - # NUCLEO-L432KC - mkdir examples/NUCLEO-L432KC - mkdir examples/NUCLEO-L432KC/serial - cp -r ../../examples/projects/NUCLEO-L432KC/inspector_serialcom/* examples/NUCLEO-L432KC/serial/ - - # STM32F4-discovery - mkdir examples/STM32F4-discovery - mkdir examples/STM32F4-discovery/serial - cp -r ../../examples/projects/STM32F4-discovery/inspector_serialcom/* examples/STM32F4-discovery/serial/ - - pio package pack - pio package publish --owner luos --non-interactive - cd ../.. - deploy_pipe: needs: check_valid_tag runs-on: ubuntu-latest diff --git a/engine/core/inc/luos_list.h b/engine/core/inc/luos_list.h index 70ecdfd89..a0db8cb9d 100644 --- a/engine/core/inc/luos_list.h +++ b/engine/core/inc/luos_list.h @@ -27,7 +27,6 @@ typedef enum PIPE_TYPE, MOTOR_TYPE, SERVO_MOTOR_TYPE, - INSPECTOR_TYPE, PRESSURE_TYPE, LUOS_LAST_TYPE } luos_type_t; diff --git a/examples/projects/Arduino/inspector_serialcom/node_config.h b/examples/projects/Arduino/inspector_serialcom/node_config.h deleted file mode 100644 index 42567b221..000000000 --- a/examples/projects/Arduino/inspector_serialcom/node_config.h +++ /dev/null @@ -1,109 +0,0 @@ -/****************************************************************************** - * @file node_config.h - * @brief This file allow you to use standard preprocessor definitions to - * configure your project, Luos and Luos HAL libraries - * - * # Introduction - * This file is for the luos user. You may here configure your project and - * define your custom Luos service and custom Luos command for your product - * - * Luos libraries offer a minimal standard configuration to optimize - * memory usage. In some case you have to modify standard value to fit - * with your need concerning among of data transiting through the network - * or network speed for example - * - * Luos libraries can be use with a lot a MCU family. Luos compagny give you - * a default configuration, for specific MCU family, in robus_hal_config.h. - * This configuration can be modify here to fit with you design by - * preprocessor definitions of MCU Hardware needs - * - * # Usage - * This file should be place a the root folder of your project and include - * where build flag preprocessor definitions are define in your IDE - * -include node_config.h - * - * @author Luos - * @version 0.0.0 - ******************************************************************************/ -#ifndef _NODE_CONFIG_H_ -#define _NODE_CONFIG_H_ - -/******************************************************************************* - * PROJECT DEFINITION - *******************************************************************************/ - -/******************************************************************************* - * LUOS LIBRARY DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node - * MAX_NODE_NUMBER. | 20 | Node number in the device - * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * NBR_PORT | 2 | PTP Branch number Max 8 - * NBR_RETRY | 10 | Send Retry number in case of NACK or collision - ******************************************************************************/ - -#define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 1024 -#define MAX_MSG_NB 30 -// #define NODETECTION - -/******************************************************************************* - * LUOS HAL LIBRARY DEFINITION -******************************************************************************* - * Define | Description - * :-----------------------|----------------------------------------------- - * MCUFREQ | Put your the MCU frequency (value in Hz) - * TIMERDIV | Timer divider clock (see your clock configuration) - * USE_CRC_HW | define to 0 if there is no Module CRC in your MCU - * USE_TX_IT | define to 1 to not use DMA transfers for Luos Tx - * - * PORT_CLOCK_ENABLE | Enable clock for port - * PTPx | A,B,C,D etc. PTP Branch Pin/Port/IRQ - * TX_LOCK_DETECT | Disable by default use if not busy flag in USART Pin/Port/IRQ - * RX_EN | Rx enable for driver RS485 always on Pin/Port - * TX_EN | Tx enable for driver RS485 Pin/Port - * COM_TX | Tx USART Com Pin/Port/Alternate - * COM_RX | Rx USART Com Pin/Port/Alternate - * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - - * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART - * ROBUS_COM | USART number - * ROBUS_COM_IRQ | USART IRQ number - * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - - * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA - * ROBUS_DMA | DMA number - * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - - * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * ROBUS_TIMER | Timer number - * ROBUS_TIMER_IRQ | Timer IRQ number - * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler - - * FLASH_SECTOR | FLASH page size - * PAGE_SIZE | FLASH page size - * ADDRESS_LAST_PAGE_FLASH | Page to write alias -******************************************************************************/ - -/******************************************************************************* - * GATE SERIAL COM DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :-------------------------|------------------------------------------------------ - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * GATE_BUFF_SIZE | 1024 | Json receive buffer size - * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size - * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size - ******************************************************************************/ - -#define GATE_BUFF_SIZE 1024 -#define PIPE_TX_BUFFER_SIZE 1024 -#define PIPE_RX_BUFFER_SIZE 2048 - -#endif /* _NODE_CONFIG_H_ */ diff --git a/examples/projects/Arduino/inspector_serialcom/platformio.ini b/examples/projects/Arduino/inspector_serialcom/platformio.ini deleted file mode 100644 index faccca291..000000000 --- a/examples/projects/Arduino/inspector_serialcom/platformio.ini +++ /dev/null @@ -1,59 +0,0 @@ - - -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -; To use Arduino board -; use default_envs = zero -; change your board in field -; [env:zero] -; board = mkrzero #mkrzero, mkr1000USB or any SAMD21 based Arduino board - -; To use seeduino board -; use default_envs = seed -; change your board in field -; [env:seed] -; board = seeed_xiao or any SAMD21 based on seeduino board - -[platformio] -default_envs = zero - -[env] -lib_extra_dirs = - $PROJECT_DIR/../../../../tool_services/ - $PROJECT_DIR/../../../../network/ - $PROJECT_DIR/../../../../../ -lib_ldf_mode =off -platform = atmelsam -framework = arduino -build_unflags = -Os -build_flags = - -O1 - -include node_config.h - -D GATEFORMAT=TinyJSON - -D LUOSHAL=ATSAMD21_ARDUINO - -D PIPEMODE=SERIAL - -D PIPEHAL=ARDUINO -lib_deps = - luos_engine@^3.0.0 - robus_network - Inspector - Pipe - - -[env:zero] -board = mkrzero -platform_packages = framework-arduino-samd@https://github.com/Luos-io/Arduino_core.git - - -[env:seed] -board = seeed_xiao -platform_packages = framework-arduino-samd-seeed@https://github.com/Luos-io/Arduino_core.git - diff --git a/examples/projects/Arduino/inspector_serialcom/src/Inspector_SerialCom.cpp b/examples/projects/Arduino/inspector_serialcom/src/Inspector_SerialCom.cpp deleted file mode 100644 index 05d9dea4b..000000000 --- a/examples/projects/Arduino/inspector_serialcom/src/Inspector_SerialCom.cpp +++ /dev/null @@ -1,32 +0,0 @@ - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - -#include -#include -#include "luos_engine.h" -#include "robus_network.h" - -#ifdef __cplusplus -} -#endif - -void setup() -{ - - Luos_Init(); - Robus_Init(); - Inspector_Init(); - Pipe_Init(); -} - -void loop() -{ - Luos_Loop(); - Inspector_Loop(); - Pipe_Loop(); -} diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/README.md b/examples/projects/NUCLEO-F072RB/inspector_serialcom/README.md deleted file mode 100644 index 02fddfd8b..000000000 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/README.md +++ /dev/null @@ -1,36 +0,0 @@ -
Luos logo - -![](https://github.com/Luos-io/luos_engine/actions/workflows/build.yml/badge.svg) -[![](https://img.shields.io/github/license/Luos-io/Luos)](https://github.com/Luos-io/luos_engine/blob/master/LICENSE) - -[![](https://img.shields.io/badge/Luos-Documentation-34A3B4)](https://www.luos.io) -[![](http://certified.luos.io)](https://www.luos.io) -[![PlatformIO Registry](https://badges.registry.platformio.org/packages/luos/library/luos_engine.svg)](https://registry.platformio.org/libraries/luos_engine/luos_engine) - -[![](https://img.shields.io/discord/902486791658041364?label=Discord&logo=discord&style=social)](https://discord.gg/luos) -[![](https://img.shields.io/reddit/subreddit-subscribers/Luos?style=social)](https://www.reddit.com/r/Luos) -[![](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/Luos_io) -[![](https://img.shields.io/badge/LinkedIn-Share-0077B5?style=social&logo=linkedin)](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fgithub.com%2Fluos-io) - - - -# gate_serialcom project example :bulb: -This project demonstrate how to make and use a simple gate_serialcom through Luos. Feel free to use electronics and code example as you want. - -## How to compile the code :computer: - - 1. Download and install [Platformio](https://platformio.org/platformio-ide) - 2. Open this folder into Platformio - 3. Build (Platformio will do the rest) - -## How to open the electronic design :electric_plug: -You can open [a working example electronic design](https://github.com/Luos-io/luos_engine/tree/main/examples/hardware) with Kicad. This design use Luos_components library for more information to install and use it read [our doc](https://www.luos.io). - -## Linked driver -This project is linked to the [gate_serialcom driver](../../Drivers/gate_serialcom). - -## Don't hesitate to read [our documentation](https://www.luos.io), or to post your questions/issues on the [Luos' community](https://discord.gg/luos). :books: - -[![](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.luos.io&logo=Discourse)](https://discord.gg/luos) -[![](https://img.shields.io/badge/Luos-Documentation-34A3B4)](https://www.luos.io) -[![](https://img.shields.io/badge/LinkedIn-Follow%20us-0077B5?style=flat&logo=linkedin)](https://www.linkedin.com/company/luos) diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/gpio.h b/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/gpio.h deleted file mode 100644 index f57136410..000000000 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/gpio.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.h - * @brief This file contains all the function prototypes for - * the gpio.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __GPIO_H__ -#define __GPIO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - - void MX_GPIO_Init(void); - - /* USER CODE BEGIN Prototypes */ - - /* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif -#endif /*__ GPIO_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/main.h b/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/main.h deleted file mode 100644 index 4a040243f..000000000 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/main.h +++ /dev/null @@ -1,76 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.h - * @brief : Header for main.c file. - * This file contains the common defines of the application. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __MAIN_H -#define __MAIN_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "stm32f0xx_hal.h" - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void Error_Handler(void); - -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -/* Private defines -----------------------------------------------------------*/ -#define LED_Pin GPIO_PIN_3 -#define LED_GPIO_Port GPIOA -#define BTN_Pin GPIO_PIN_0 -#define BTN_GPIO_Port GPIOB - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - -#ifdef __cplusplus -} -#endif - -#endif /* __MAIN_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/stm32_assert.h b/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/stm32_assert.h deleted file mode 100644 index abe0ef3bd..000000000 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/stm32_assert.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - ****************************************************************************** - * @file stm32_assert.h - * @brief STM32 assert file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32_ASSERT_H -#define __STM32_ASSERT_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ -/* Includes ------------------------------------------------------------------*/ -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT - /** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((char *)__FILE__, __LINE__)) - /* Exported functions ------------------------------------------------------- */ - void assert_failed(char *file, uint32_t line); -#else -#define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32_ASSERT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/stm32f0xx_hal_conf.h b/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/stm32f0xx_hal_conf.h deleted file mode 100644 index 570433359..000000000 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/stm32f0xx_hal_conf.h +++ /dev/null @@ -1,323 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f0xx_hal_conf.h - * @brief HAL configuration file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2016 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F0xx_HAL_CONF_H -#define __STM32F0xx_HAL_CONF_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - /*#define HAL_ADC_MODULE_ENABLED */ -/*#define HAL_CRYP_MODULE_ENABLED */ -/*#define HAL_CAN_MODULE_ENABLED */ -/*#define HAL_CEC_MODULE_ENABLED */ -/*#define HAL_COMP_MODULE_ENABLED */ -/*#define HAL_CRYP_MODULE_ENABLED */ -/*#define HAL_TSC_MODULE_ENABLED */ -/*#define HAL_DAC_MODULE_ENABLED */ -/*#define HAL_I2S_MODULE_ENABLED */ -/*#define HAL_IWDG_MODULE_ENABLED */ -/*#define HAL_LCD_MODULE_ENABLED */ -/*#define HAL_LPTIM_MODULE_ENABLED */ -/*#define HAL_RNG_MODULE_ENABLED */ -/*#define HAL_RTC_MODULE_ENABLED */ -/*#define HAL_SPI_MODULE_ENABLED */ -/*#define HAL_TIM_MODULE_ENABLED */ -/*#define HAL_UART_MODULE_ENABLED */ -/*#define HAL_USART_MODULE_ENABLED */ -/*#define HAL_IRDA_MODULE_ENABLED */ -/*#define HAL_SMARTCARD_MODULE_ENABLED */ -/*#define HAL_SMBUS_MODULE_ENABLED */ -/*#define HAL_WWDG_MODULE_ENABLED */ -/*#define HAL_PCD_MODULE_ENABLED */ -//#define HAL_I2C_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_CRC_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined(HSE_VALUE) -#define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -/** - * @brief In the following line adjust the External High Speed oscillator (HSE) Startup - * Timeout value - */ -#if !defined(HSE_STARTUP_TIMEOUT) -#define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined(HSI_VALUE) -#define HSI_VALUE ((uint32_t)8000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup - * Timeout value - */ -#if !defined(HSI_STARTUP_TIMEOUT) -#define HSI_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSI start up */ -#endif /* HSI_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator for ADC (HSI14) value. - */ -#if !defined(HSI14_VALUE) -#define HSI14_VALUE ((uint32_t)14000000) /*!< Value of the Internal High Speed oscillator for ADC in Hz. \ - The real value may vary depending on the variations \ - in voltage and temperature. */ -#endif /* HSI14_VALUE */ - -/** - * @brief Internal High Speed oscillator for USB (HSI48) value. - */ -#if !defined(HSI48_VALUE) -#define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal High Speed oscillator for USB in Hz. \ - The real value may vary depending on the variations \ - in voltage and temperature. */ -#endif /* HSI48_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined(LSI_VALUE) -#define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz \ - The real value may vary depending on the variations \ - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSI) value. - */ -#if !defined(LSE_VALUE) -#define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -/** - * @brief Time out for LSE start up value in ms. - */ -#if !defined(LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0) /*!< tick interrupt priority (lowest by default) */ - /* Warning: Must be set to higher priority for HAL_Delay() */ - /* and HAL_GetTick() usage under interrupt context */ -#define USE_RTOS 0 -#define PREFETCH_ENABLE 1 -#define INSTRUCTION_CACHE_ENABLE 0 -#define DATA_CACHE_ENABLE 0 -#define USE_SPI_CRC 0U - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ -#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ -#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ -#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ -#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ -#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ -#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ -#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ -#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ -#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ -#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ -#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ -#define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */ -#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ - - /* ########################## Assert Selection ############################## */ - /** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ - /* #define USE_FULL_ASSERT 1U */ - - /* Includes ------------------------------------------------------------------*/ - /** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED -#include "stm32f0xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED -#include "stm32f0xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED -#include "stm32f0xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED -#include "stm32f0xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED -#include "stm32f0xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED -#include "stm32f0xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED -#include "stm32f0xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED -#include "stm32f0xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_COMP_MODULE_ENABLED -#include "stm32f0xx_hal_comp.h" -#endif /* HAL_COMP_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED -#include "stm32f0xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED -#include "stm32f0xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED -#include "stm32f0xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED -#include "stm32f0xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED -#include "stm32f0xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED -#include "stm32f0xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED -#include "stm32f0xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED -#include "stm32f0xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED -#include "stm32f0xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED -#include "stm32f0xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED -#include "stm32f0xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED -#include "stm32f0xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED -#include "stm32f0xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED -#include "stm32f0xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_TSC_MODULE_ENABLED -#include "stm32f0xx_hal_tsc.h" -#endif /* HAL_TSC_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED -#include "stm32f0xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED -#include "stm32f0xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED -#include "stm32f0xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT - /** - * @brief The assert_param macro is used for function's parameters check. - * @param expr If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) - /* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t *file, uint32_t line); -#else -#define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F0xx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/stm32f0xx_it.h b/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/stm32f0xx_it.h deleted file mode 100644 index bdaccb45e..000000000 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/include/stm32f0xx_it.h +++ /dev/null @@ -1,66 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f0xx_it.h - * @brief This file contains the headers of the interrupt handlers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F0xx_IT_H -#define __STM32F0xx_IT_H - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void NMI_Handler(void); - void HardFault_Handler(void); - void SVC_Handler(void); - void PendSV_Handler(void); - void SysTick_Handler(void); - /* USER CODE BEGIN EFP */ - - /* USER CODE END EFP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F0xx_IT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/linker/custom_Luos_bootloader_script.ld b/examples/projects/NUCLEO-F072RB/inspector_serialcom/linker/custom_Luos_bootloader_script.ld deleted file mode 100644 index 117ea9158..000000000 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/linker/custom_Luos_bootloader_script.ld +++ /dev/null @@ -1,182 +0,0 @@ -/** - ****************************************************************************** - * @file LinkerScript.ld - * @author Auto-generated by STM32CubeIDE - * @brief Linker script for STM32F072RBTx Device from STM32F0 series - * 128Kbytes FLASH - * 16Kbytes RAM - * - * Set heap size, stack size and stack location according - * to application requirements. - * - * Set memory bank area and size if external memory is used - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ - -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Memories definition */ -MEMORY -{ - RAM_RSVD (xrw) : ORIGIN = 0x20000000, LENGTH = 1K - RAM (xrw) : ORIGIN = 0x20000400, LENGTH = 15K - FLASH (rx) : ORIGIN = 0x0800C800, LENGTH = 78K -} - -/* Sections */ -SECTIONS -{ - /* The startup code into "FLASH" Rom type memory */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data into "FLASH" Rom type memory */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data into "FLASH" Rom type memory */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { - . = ALIGN(4); - *(.ARM.extab* .gnu.linkonce.armextab.*) - . = ALIGN(4); - } >FLASH - - .ARM : { - . = ALIGN(4); - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - . = ALIGN(4); - } >FLASH - - .preinit_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - . = ALIGN(4); - } >FLASH - - .init_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - . = ALIGN(4); - } >FLASH - - .fini_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - . = ALIGN(4); - } >FLASH - - /* Used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections into "RAM" Ram type memory */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - - } >RAM AT> FLASH - - /* Uninitialized data section into "RAM" Ram type memory */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - .boot_data : - { - *(.rsvd.data) - *(.rsvd.data*) - } > RAM_RSVD - - /* Remove information from the compiler libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h deleted file mode 100644 index cbd40e31d..000000000 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/node_config.h +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************** - * @file node_config.h - * @brief This file allow you to use standard preprocessor definitions to - * configure your project, Luos and Luos HAL libraries - * - * # Introduction - * This file is for the luos user. You may here configure your project and - * define your custom Luos service and custom Luos command for your product - * - * Luos libraries offer a minimal standard configuration to optimize - * memory usage. In some case you have to modify standard value to fit - * with your need concerning among of data transiting through the network - * or network speed for example - * - * Luos libraries can be use with a lot a MCU family. Luos compagny give you - * a default configuration, for specific MCU family, in robus_hal_config.h. - * This configuration can be modify here to fit with you design by - * preprocessor definitions of MCU Hardware needs - * - * # Usage - * This file should be place a the root folder of your project and include - * where build flag preprocessor definitions are define in your IDE - * -include node_config.h - * - * @author Luos - * @version 0.0.0 - ******************************************************************************/ -#ifndef _NODE_CONFIG_H_ -#define _NODE_CONFIG_H_ - -/******************************************************************************* - * PROJECT DEFINITION - *******************************************************************************/ - -/******************************************************************************* - * LUOS LIBRARY DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node - * MAX_NODE_NUMBER. | 20 | Node number in the device - * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * NBR_PORT | 2 | PTP Branch number Max 8 - * NBR_RETRY | 10 | Send Retry number in case of NACK or collision - ******************************************************************************/ - -#define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 -#define NODETECTION - -/******************************************************************************* - * LUOS HAL LIBRARY DEFINITION -******************************************************************************* - * Define | Description - * :-----------------------|----------------------------------------------- - * MCUFREQ | Put your the MCU frequency (value in Hz) - * TIMERDIV | Timer divider clock (see your clock configuration) - * USE_CRC_HW | define to 0 if there is no Module CRC in your MCU - * USE_TX_IT | define to 1 to not use DMA transfers for Luos Tx - * - * PORT_CLOCK_ENABLE | Enable clock for port - * PTPx | A,B,C,D etc. PTP Branch Pin/Port/IRQ - * TX_LOCK_DETECT | Disable by default use if not busy flag in USART Pin/Port/IRQ - * RX_EN | Rx enable for driver RS485 always on Pin/Port - * TX_EN | Tx enable for driver RS485 Pin/Port - * COM_TX | Tx USART Com Pin/Port/Alternate - * COM_RX | Rx USART Com Pin/Port/Alternate - * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - - * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART - * ROBUS_COM | USART number - * ROBUS_COM_IRQ | USART IRQ number - * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - - * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA - * ROBUS_DMA | DMA number - * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - - * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * ROBUS_TIMER | Timer number - * ROBUS_TIMER_IRQ | Timer IRQ number - * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler -******************************************************************************/ - -/******************************************************************************* - * FLASH CONFIGURATION FOR APP WITH BOOTLOADER - ******************************************************************************** - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * BOOT_START_ADDRESS | FLASH_BASE = 0x8000000 | Start address of Bootloader in flash - * SHARED_MEMORY_ADDRESS | 0x0800C000 | Start address of shared memory to save boot flag - * APP_START_ADDRESS | 0x0800C800 | Start address of application with bootloader - * APP_END_ADDRESS | FLASH_BANK1_END=0x0801FFFF | End address of application with bootloader - ******************************************************************************/ - -#endif /* _NODE_CONFIG_H_ */ diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-F072RB/inspector_serialcom/platformio.ini deleted file mode 100644 index a41be0c2a..000000000 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/platformio.ini +++ /dev/null @@ -1,58 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html - -[platformio] -default_envs = nucleo_f072rb - -[env] -lib_ldf_mode =off -lib_extra_dirs = - $PROJECT_DIR/../../../../tool_services/ - $PROJECT_DIR/../../../../../ - $PROJECT_DIR/../../../../network/ -platform = ststm32 -board = nucleo_f072rb -framework = stm32cube -lib_deps = - luos_engine@^3.0.0 - robus_network - Inspector - Pipe -debug_tool = stlink -upload_protocol = stlink - - -[env:nucleo_f072rb] -build_unflags = -Os -build_flags = - -include node_config.h - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32F0 - -O1 - -D PIPEMODE=SERIAL - -D PIPEHAL=NUCLEO-F0 - -[env:nucleo_f072rb_with_bootloader] -board_build.ldscript = linker/custom_Luos_bootloader_script.ld -build_unflags = -Os -build_flags = - -include node_config.h - -DWITH_BOOTLOADER - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32F0 - -O1 - -D PIPEMODE=SERIAL - -D PIPEHAL=NUCLEO-F0 -upload_protocol = custom -upload_flags = - -t2 -upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/gpio.c b/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/gpio.c deleted file mode 100644 index da527cbca..000000000 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/gpio.c +++ /dev/null @@ -1,66 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.c - * @brief This file provides code for the configuration - * of all used GPIO pins. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "gpio.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/*----------------------------------------------------------------------------*/ -/* Configure GPIO */ -/*----------------------------------------------------------------------------*/ -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** Configure pins -*/ -void MX_GPIO_Init(void) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_SET); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = LED_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = BTN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_PULLDOWN; - HAL_GPIO_Init(BTN_GPIO_Port, &GPIO_InitStruct); -} - -/* USER CODE BEGIN 2 */ - -/* USER CODE END 2 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/main.c deleted file mode 100644 index 960d5fb1b..000000000 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/main.c +++ /dev/null @@ -1,181 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.c - * @brief : Main program body - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "gpio.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -#include "luos_engine.h" -#include "robus_network.h" -#include "pipe.h" -#include "inspector.h" -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN PTD */ -/* USER CODE END PTD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -void SystemClock_Config(void); -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/** - * @brief The application entry point. - * @retval int - */ -int main(void) -{ - /* USER CODE BEGIN 1 */ - - /* USER CODE END 1 */ - - /* MCU Configuration--------------------------------------------------------*/ - - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ - HAL_Init(); - - /* USER CODE BEGIN Init */ - - /* USER CODE END Init */ - - /* Configure the system clock */ - SystemClock_Config(); - - /* USER CODE BEGIN SysInit */ - /* USER CODE END SysInit */ - - /* Initialize all configured peripherals */ - MX_GPIO_Init(); - /* USER CODE BEGIN 2 */ - Luos_Init(); - Robus_Init(); - Inspector_Init(); - Pipe_Init(); - /* USER CODE END 2 */ - - /* Infinite loop */ - /* USER CODE BEGIN WHILE */ - while (1) - { - Luos_Loop(); - Inspector_Loop(); - Pipe_Loop(); - /* USER CODE END WHILE */ - - /* USER CODE BEGIN 3 */ - } - /* USER CODE END 3 */ -} - -/** - * @brief System Clock Configuration - * @retval None - */ -void SystemClock_Config(void) -{ - RCC_OscInitTypeDef RCC_OscInitStruct = {0}; - RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; - - /** Initializes the RCC Oscillators according to the specified parameters - * in the RCC_OscInitTypeDef structure. - */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; - RCC_OscInitStruct.HSIState = RCC_HSI_ON; - RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; - RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6; - RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) - { - Error_Handler(); - } - /** Initializes the CPU, AHB and APB buses clocks - */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK - | RCC_CLOCKTYPE_PCLK1; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; - - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) - { - Error_Handler(); - } -} - -/* USER CODE BEGIN 4 */ - -/* USER CODE END 4 */ - -/** - * @brief This function is executed in case of error occurrence. - * @retval None - */ -void Error_Handler(void) -{ - /* USER CODE BEGIN Error_Handler_Debug */ - /* User can add his own implementation to report the HAL error return state */ - - /* USER CODE END Error_Handler_Debug */ -} - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t *file, uint32_t line) -{ - /* USER CODE BEGIN 6 */ - /* User can add his own implementation to report the file name and line number, - tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ - /* USER CODE END 6 */ -} -#endif /* USE_FULL_ASSERT */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/stm32f0xx_hal_msp.c b/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/stm32f0xx_hal_msp.c deleted file mode 100644 index f78d39753..000000000 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/stm32f0xx_hal_msp.c +++ /dev/null @@ -1,84 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * File Name : stm32f0xx_hal_msp.c - * Description : This file provides code for the MSP Initialization - * and de-Initialization codes. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN Define */ - -/* USER CODE END Define */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN Macro */ - -/* USER CODE END Macro */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* External functions --------------------------------------------------------*/ -/* USER CODE BEGIN ExternalFunctions */ - -/* USER CODE END ExternalFunctions */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ -/** - * Initializes the Global MSP. - */ -void HAL_MspInit(void) -{ - /* USER CODE BEGIN MspInit 0 */ - - /* USER CODE END MspInit 0 */ - - __HAL_RCC_SYSCFG_CLK_ENABLE(); - __HAL_RCC_PWR_CLK_ENABLE(); - - /* System interrupt init*/ - - /* USER CODE BEGIN MspInit 1 */ - - /* USER CODE END MspInit 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/stm32f0xx_it.c b/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/stm32f0xx_it.c deleted file mode 100644 index 15a988d39..000000000 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/stm32f0xx_it.c +++ /dev/null @@ -1,149 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f0xx_it.c - * @brief Interrupt Service Routines. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "stm32f0xx_it.h" -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* External variables --------------------------------------------------------*/ - -/* USER CODE BEGIN EV */ - -/* USER CODE END EV */ - -/******************************************************************************/ -/* Cortex-M0 Processor Interruption and Exception Handlers */ -/******************************************************************************/ -/** - * @brief This function handles Non maskable interrupt. - */ -void NMI_Handler(void) -{ - /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ - - /* USER CODE END NonMaskableInt_IRQn 0 */ - /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ - - /* USER CODE END NonMaskableInt_IRQn 1 */ -} - -/** - * @brief This function handles Hard fault interrupt. - */ -void HardFault_Handler(void) -{ - /* USER CODE BEGIN HardFault_IRQn 0 */ - - /* USER CODE END HardFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_HardFault_IRQn 0 */ - /* USER CODE END W1_HardFault_IRQn 0 */ - } -} - -/** - * @brief This function handles System service call via SWI instruction. - */ -void SVC_Handler(void) -{ - /* USER CODE BEGIN SVC_IRQn 0 */ - - /* USER CODE END SVC_IRQn 0 */ - /* USER CODE BEGIN SVC_IRQn 1 */ - - /* USER CODE END SVC_IRQn 1 */ -} - -/** - * @brief This function handles Pendable request for system service. - */ -void PendSV_Handler(void) -{ - /* USER CODE BEGIN PendSV_IRQn 0 */ - - /* USER CODE END PendSV_IRQn 0 */ - /* USER CODE BEGIN PendSV_IRQn 1 */ - - /* USER CODE END PendSV_IRQn 1 */ -} - -/** - * @brief This function handles System tick timer. - */ -void SysTick_Handler(void) -{ - /* USER CODE BEGIN SysTick_IRQn 0 */ - - /* USER CODE END SysTick_IRQn 0 */ - HAL_IncTick(); - /* USER CODE BEGIN SysTick_IRQn 1 */ - - /* USER CODE END SysTick_IRQn 1 */ -} - -/******************************************************************************/ -/* STM32F0xx Peripheral Interrupt Handlers */ -/* Add here the Interrupt Handlers for the used peripherals. */ -/* For the available peripheral interrupt handler names, */ -/* please refer to the startup file (startup_stm32f0xx.s). */ -/******************************************************************************/ - -/* USER CODE BEGIN 1 */ -void EXTI4_15_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_8); - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13); -} -/* USER CODE END 1 */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/system_stm32f0xx.c b/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/system_stm32f0xx.c deleted file mode 100644 index 050f79b2b..000000000 --- a/examples/projects/NUCLEO-F072RB/inspector_serialcom/src/system_stm32f0xx.c +++ /dev/null @@ -1,331 +0,0 @@ -/** - ****************************************************************************** - * @file system_stm32f0xx.c - * @author MCD Application Team - * @brief CMSIS Cortex-M0 Device Peripheral Access Layer System Source File. - * - * 1. This file provides two functions and one global variable to be called from - * user application: - * - SystemInit(): This function is called at startup just after reset and - * before branch to main program. This call is made inside - * the "startup_stm32f0xx.s" file. - * - * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick - * timer or configure other parameters. - * - * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must - * be called whenever the core clock is changed - * during program execution. - * - * 2. After each device reset the HSI (8 MHz) is used as system clock source. - * Then SystemInit() function is called, in "startup_stm32f0xx.s" file, to - * configure the system clock before to branch to main program. - * - * 3. This file configures the system clock as follows: - *============================================================================= - * Supported STM32F0xx device - *----------------------------------------------------------------------------- - * System Clock source | HSI - *----------------------------------------------------------------------------- - * SYSCLK(Hz) | 8000000 - *----------------------------------------------------------------------------- - * HCLK(Hz) | 8000000 - *----------------------------------------------------------------------------- - * AHB Prescaler | 1 - *----------------------------------------------------------------------------- - * APB1 Prescaler | 1 - *----------------------------------------------------------------------------- - *============================================================================= - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2016 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/** @addtogroup CMSIS - * @{ - */ - -/** @addtogroup stm32f0xx_system - * @{ - */ - -/** @addtogroup STM32F0xx_System_Private_Includes - * @{ - */ - -#include "stm32f0xx.h" - -/** - * @} - */ - -/** @addtogroup STM32F0xx_System_Private_TypesDefinitions - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32F0xx_System_Private_Defines - * @{ - */ -#if !defined(HSE_VALUE) -#define HSE_VALUE ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz. \ - This value can be provided and adapted by the user application. */ -#endif /* HSE_VALUE */ - -#if !defined(HSI_VALUE) -#define HSI_VALUE ((uint32_t)8000000) /*!< Default value of the Internal oscillator in Hz. \ - This value can be provided and adapted by the user application. */ -#endif /* HSI_VALUE */ - -#if !defined(HSI48_VALUE) -#define HSI48_VALUE ((uint32_t)48000000) /*!< Default value of the HSI48 Internal oscillator in Hz. \ - This value can be provided and adapted by the user application. */ -#endif /* HSI48_VALUE */ -/** - * @} - */ - -/** @addtogroup STM32F0xx_System_Private_Macros - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32F0xx_System_Private_Variables - * @{ - */ -/* This variable is updated in three ways: - 1) by calling CMSIS function SystemCoreClockUpdate() - 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency - Note: If you use this function to configure the system clock there is no need to - call the 2 first functions listed above, since SystemCoreClock variable is - updated automatically. - */ -uint32_t SystemCoreClock = 8000000; - -const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; -const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; - -/** - * @} - */ - -/** @addtogroup STM32F0xx_System_Private_FunctionPrototypes - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32F0xx_System_Private_Functions - * @{ - */ - -/** - * @brief Setup the microcontroller system. - * Initialize the default HSI clock source, vector table location and the PLL configuration is reset. - * @param None - * @retval None - */ -void SystemInit(void) -{ - /* Reset the RCC clock configuration to the default reset state ------------*/ - /* Set HSION bit */ - RCC->CR |= (uint32_t)0x00000001U; - -#if defined(STM32F051x8) || defined(STM32F058x8) - /* Reset SW[1:0], HPRE[3:0], PPRE[2:0], ADCPRE and MCOSEL[2:0] bits */ - RCC->CFGR &= (uint32_t)0xF8FFB80CU; -#else - /* Reset SW[1:0], HPRE[3:0], PPRE[2:0], ADCPRE, MCOSEL[2:0], MCOPRE[2:0] and PLLNODIV bits */ - RCC->CFGR &= (uint32_t)0x08FFB80CU; -#endif /* STM32F051x8 or STM32F058x8 */ - - /* Reset HSEON, CSSON and PLLON bits */ - RCC->CR &= (uint32_t)0xFEF6FFFFU; - - /* Reset HSEBYP bit */ - RCC->CR &= (uint32_t)0xFFFBFFFFU; - - /* Reset PLLSRC, PLLXTPRE and PLLMUL[3:0] bits */ - RCC->CFGR &= (uint32_t)0xFFC0FFFFU; - - /* Reset PREDIV[3:0] bits */ - RCC->CFGR2 &= (uint32_t)0xFFFFFFF0U; - -#if defined(STM32F072xB) || defined(STM32F078xx) - /* Reset USART2SW[1:0], USART1SW[1:0], I2C1SW, CECSW, USBSW and ADCSW bits */ - RCC->CFGR3 &= (uint32_t)0xFFFCFE2CU; -#elif defined(STM32F071xB) - /* Reset USART2SW[1:0], USART1SW[1:0], I2C1SW, CECSW and ADCSW bits */ - RCC->CFGR3 &= (uint32_t)0xFFFFCEACU; -#elif defined(STM32F091xC) || defined(STM32F098xx) - /* Reset USART3SW[1:0], USART2SW[1:0], USART1SW[1:0], I2C1SW, CECSW and ADCSW bits */ - RCC->CFGR3 &= (uint32_t)0xFFF0FEACU; -#elif defined(STM32F030x6) || defined(STM32F030x8) || defined(STM32F031x6) || defined(STM32F038xx) || defined(STM32F030xC) - /* Reset USART1SW[1:0], I2C1SW and ADCSW bits */ - RCC->CFGR3 &= (uint32_t)0xFFFFFEECU; -#elif defined(STM32F051x8) || defined(STM32F058xx) - /* Reset USART1SW[1:0], I2C1SW, CECSW and ADCSW bits */ - RCC->CFGR3 &= (uint32_t)0xFFFFFEACU; -#elif defined(STM32F042x6) || defined(STM32F048xx) - /* Reset USART1SW[1:0], I2C1SW, CECSW, USBSW and ADCSW bits */ - RCC->CFGR3 &= (uint32_t)0xFFFFFE2CU; -#elif defined(STM32F070x6) || defined(STM32F070xB) - /* Reset USART1SW[1:0], I2C1SW, USBSW and ADCSW bits */ - RCC->CFGR3 &= (uint32_t)0xFFFFFE6CU; - /* Set default USB clock to PLLCLK, since there is no HSI48 */ - RCC->CFGR3 |= (uint32_t)0x00000080U; -#else -#warning "No target selected" -#endif - - /* Reset HSI14 bit */ - RCC->CR2 &= (uint32_t)0xFFFFFFFEU; - - /* Disable all interrupts */ - RCC->CIR = 0x00000000U; -} - -/** - * @brief Update SystemCoreClock variable according to Clock Register Values. - * The SystemCoreClock variable contains the core clock (HCLK), it can - * be used by the user application to setup the SysTick timer or configure - * other parameters. - * - * @note Each time the core clock (HCLK) changes, this function must be called - * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined - * constant and the selected clock source: - * - * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) - * - * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) - * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * - * (*) HSI_VALUE is a constant defined in stm32f0xx_hal.h file (default value - * 8 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * - * (**) HSE_VALUE is a constant defined in stm32f0xx_hal.h file (default value - * 8 MHz), user has to ensure that HSE_VALUE is same as the real - * frequency of the crystal used. Otherwise, this function may - * have wrong result. - * - * - The result of this function could be not correct when using fractional - * value for HSE crystal. - * - * @param None - * @retval None - */ -void SystemCoreClockUpdate(void) -{ - uint32_t tmp = 0, pllmull = 0, pllsource = 0, predivfactor = 0; - - /* Get SYSCLK source -------------------------------------------------------*/ - tmp = RCC->CFGR & RCC_CFGR_SWS; - - switch (tmp) - { - case RCC_CFGR_SWS_HSI: /* HSI used as system clock */ - SystemCoreClock = HSI_VALUE; - break; - case RCC_CFGR_SWS_HSE: /* HSE used as system clock */ - SystemCoreClock = HSE_VALUE; - break; - case RCC_CFGR_SWS_PLL: /* PLL used as system clock */ - /* Get PLL clock source and multiplication factor ----------------------*/ - pllmull = RCC->CFGR & RCC_CFGR_PLLMUL; - pllsource = RCC->CFGR & RCC_CFGR_PLLSRC; - pllmull = (pllmull >> 18) + 2; - predivfactor = (RCC->CFGR2 & RCC_CFGR2_PREDIV) + 1; - - if (pllsource == RCC_CFGR_PLLSRC_HSE_PREDIV) - { - /* HSE used as PLL clock source : SystemCoreClock = HSE/PREDIV * PLLMUL */ - SystemCoreClock = (HSE_VALUE / predivfactor) * pllmull; - } -#if defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) - else if (pllsource == RCC_CFGR_PLLSRC_HSI48_PREDIV) - { - /* HSI48 used as PLL clock source : SystemCoreClock = HSI48/PREDIV * PLLMUL */ - SystemCoreClock = (HSI48_VALUE / predivfactor) * pllmull; - } -#endif /* STM32F042x6 || STM32F048xx || STM32F072xB || STM32F078xx || STM32F091xC || STM32F098xx */ - else - { -#if defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F070x6) \ - || defined(STM32F078xx) || defined(STM32F071xB) || defined(STM32F072xB) \ - || defined(STM32F070xB) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F030xC) - /* HSI used as PLL clock source : SystemCoreClock = HSI/PREDIV * PLLMUL */ - SystemCoreClock = (HSI_VALUE / predivfactor) * pllmull; -#else - /* HSI used as PLL clock source : SystemCoreClock = HSI/2 * PLLMUL */ - SystemCoreClock = (HSI_VALUE >> 1) * pllmull; -#endif /* STM32F042x6 || STM32F048xx || STM32F070x6 || \ - STM32F071xB || STM32F072xB || STM32F078xx || STM32F070xB || \ - STM32F091xC || STM32F098xx || STM32F030xC */ - } - break; - default: /* HSI used as system clock */ - SystemCoreClock = HSI_VALUE; - break; - } - /* Compute HCLK clock frequency ----------------*/ - /* Get HCLK prescaler */ - tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; - /* HCLK clock frequency */ - SystemCoreClock >>= tmp; -} - -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/Inspector_SerialCom.ioc b/examples/projects/NUCLEO-F401RE/inspector_serialcom/Inspector_SerialCom.ioc deleted file mode 100644 index 172ac950f..000000000 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/Inspector_SerialCom.ioc +++ /dev/null @@ -1,100 +0,0 @@ -#MicroXplorer Configuration settings - do not modify -File.Version=6 -GPIO.groupedBy= -KeepUserPlacement=false -Mcu.Family=STM32F4 -Mcu.IP0=NVIC -Mcu.IP1=RCC -Mcu.IP2=SYS -Mcu.IPNb=3 -Mcu.Name=STM32F401R(D-E)Tx -Mcu.Package=LQFP64 -Mcu.Pin0=PC13-ANTI_TAMP -Mcu.Pin1=PA5 -Mcu.Pin2=VP_SYS_VS_Systick -Mcu.PinsNb=3 -Mcu.ThirdPartyNb=0 -Mcu.UserConstants= -Mcu.UserName=STM32F401RETx -MxCube.Version=6.1.1 -MxDb.Version=DB.6.0.10 -NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.ForceEnableDMAVector=true -NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 -NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true -NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -PA5.GPIOParameters=GPIO_Label -PA5.GPIO_Label=LED -PA5.Locked=true -PA5.Signal=GPIO_Output -PC13-ANTI_TAMP.GPIOParameters=GPIO_Label -PC13-ANTI_TAMP.GPIO_Label=BTN -PC13-ANTI_TAMP.Locked=true -PC13-ANTI_TAMP.Signal=GPIO_Input -PinOutPanel.RotationAngle=0 -ProjectManager.AskForMigrate=true -ProjectManager.BackupPrevious=false -ProjectManager.CompilerOptimize=6 -ProjectManager.ComputerToolchain=false -ProjectManager.CoupleFile=true -ProjectManager.CustomerFirmwarePackage= -ProjectManager.DefaultFWLocation=true -ProjectManager.DeletePrevious=true -ProjectManager.DeviceId=STM32F401RETx -ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.25.2 -ProjectManager.FreePins=false -ProjectManager.HalAssertFull=false -ProjectManager.HeapSize=0x0 -ProjectManager.KeepUserCode=true -ProjectManager.LastFirmware=true -ProjectManager.LibraryCopy=1 -ProjectManager.MainLocation=Src -ProjectManager.NoMain=false -ProjectManager.PreviousToolchain= -ProjectManager.ProjectBuild=false -ProjectManager.ProjectFileName=Gate.ioc -ProjectManager.ProjectName=Gate -ProjectManager.RegisterCallBack= -ProjectManager.StackSize=0x400 -ProjectManager.TargetToolchain=Other Toolchains (GPDSC) -ProjectManager.ToolChainLocation= -ProjectManager.UnderRoot=false -ProjectManager.functionlistsort=2-SystemClock_Config-RCC-false-HAL-false -RCC.48MHZClocksFreq_Value=42000000 -RCC.AHBFreq_Value=84000000 -RCC.APB1CLKDivider=RCC_HCLK_DIV2 -RCC.APB1Freq_Value=42000000 -RCC.APB1TimFreq_Value=84000000 -RCC.APB2Freq_Value=84000000 -RCC.APB2TimFreq_Value=84000000 -RCC.CortexFreq_Value=84000000 -RCC.FCLKCortexFreq_Value=84000000 -RCC.HCLKFreq_Value=84000000 -RCC.HSE_VALUE=25000000 -RCC.HSI_VALUE=16000000 -RCC.I2SClocksFreq_Value=192000000 -RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,FCLKCortexFreq_Value,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSE_VALUE,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQCLKFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VcooutputI2S -RCC.LSE_VALUE=32768 -RCC.LSI_VALUE=32000 -RCC.MCO2PinFreq_Value=84000000 -RCC.PLLCLKFreq_Value=84000000 -RCC.PLLM=8 -RCC.PLLN=84 -RCC.PLLQCLKFreq_Value=42000000 -RCC.RTCFreq_Value=32000 -RCC.RTCHSEDivFreq_Value=12500000 -RCC.SYSCLKFreq_VALUE=84000000 -RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK -RCC.VCOI2SOutputFreq_Value=384000000 -RCC.VCOInputFreq_Value=2000000 -RCC.VCOOutputFreq_Value=168000000 -RCC.VcooutputI2S=192000000 -VP_SYS_VS_Systick.Mode=SysTick -VP_SYS_VS_Systick.Signal=SYS_VS_Systick -board=custom diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/include/gpio.h b/examples/projects/NUCLEO-F401RE/inspector_serialcom/include/gpio.h deleted file mode 100644 index f57136410..000000000 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/include/gpio.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.h - * @brief This file contains all the function prototypes for - * the gpio.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __GPIO_H__ -#define __GPIO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - - void MX_GPIO_Init(void); - - /* USER CODE BEGIN Prototypes */ - - /* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif -#endif /*__ GPIO_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/include/main.h b/examples/projects/NUCLEO-F401RE/inspector_serialcom/include/main.h deleted file mode 100644 index 57a236827..000000000 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/include/main.h +++ /dev/null @@ -1,76 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.h - * @brief : Header for main.c file. - * This file contains the common defines of the application. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __MAIN_H -#define __MAIN_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "stm32f4xx_hal.h" - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void Error_Handler(void); - -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -/* Private defines -----------------------------------------------------------*/ -#define BTN_Pin GPIO_PIN_13 -#define BTN_GPIO_Port GPIOC -#define LED_Pin GPIO_PIN_5 -#define LED_GPIO_Port GPIOA - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - -#ifdef __cplusplus -} -#endif - -#endif /* __MAIN_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/include/stm32f4xx_hal_conf.h b/examples/projects/NUCLEO-F401RE/inspector_serialcom/include/stm32f4xx_hal_conf.h deleted file mode 100644 index ac7527654..000000000 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/include/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,490 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - - /* #define HAL_ADC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -/* #define HAL_I2C_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -/* #define HAL_SPI_MODULE_ENABLED */ -/* #define HAL_TIM_MODULE_ENABLED */ -/* #define HAL_UART_MODULE_ENABLED */ -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_SMBUS_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -/* #define HAL_PCD_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined(HSE_VALUE) -#define HSE_VALUE ((uint32_t)25000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined(HSE_STARTUP_TIMEOUT) -#define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined(HSI_VALUE) -#define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined(LSI_VALUE) -#define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz \ - The real value may vary depending on the variations \ - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined(LSE_VALUE) -#define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined(LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined(EXTERNAL_CLOCK_VALUE) -#define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ -#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ -#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ -#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ -#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ -#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ -#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ -#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ -#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ -#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ -#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ -#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ -#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ -#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ -#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ -#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ -#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ -#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ -#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ -#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ -#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ -#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ -#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ -#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ -#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ -#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ -#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ -#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ -#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ -#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ -#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - - /* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - - /* ################## SPI peripheral configuration ########################## */ - - /* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - - /* Includes ------------------------------------------------------------------*/ - /** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED -#include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED -#include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED -#include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED -#include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED -#include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED -#include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED -#include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CAN_LEGACY_MODULE_ENABLED -#include "stm32f4xx_hal_can_legacy.h" -#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED -#include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED -#include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED -#include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED -#include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED -#include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED -#include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED -#include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED -#include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED -#include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED -#include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED -#include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED -#include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED -#include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED -#include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED -#include "stm32f4xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED -#include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED -#include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED -#include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED -#include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED -#include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED -#include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED -#include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED -#include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED -#include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED -#include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED -#include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED -#include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED -#include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED -#include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED -#include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED -#include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED -#include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED -#include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED -#include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED -#include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED -#include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED -#include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED -#include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED -#include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED -#include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT - /** - * @brief The assert_param macro is used for function's parameters check. - * @param expr If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) - /* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t *file, uint32_t line); -#else -#define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/include/stm32f4xx_it.h b/examples/projects/NUCLEO-F401RE/inspector_serialcom/include/stm32f4xx_it.h deleted file mode 100644 index c6fdc0092..000000000 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/include/stm32f4xx_it.h +++ /dev/null @@ -1,70 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f4xx_it.h - * @brief This file contains the headers of the interrupt handlers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_IT_H -#define __STM32F4xx_IT_H - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void NMI_Handler(void); - void HardFault_Handler(void); - void MemManage_Handler(void); - void BusFault_Handler(void); - void UsageFault_Handler(void); - void SVC_Handler(void); - void DebugMon_Handler(void); - void PendSV_Handler(void); - void SysTick_Handler(void); - /* USER CODE BEGIN EFP */ - - /* USER CODE END EFP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_IT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/linker/custom_Luos_bootloader_script.ld b/examples/projects/NUCLEO-F401RE/inspector_serialcom/linker/custom_Luos_bootloader_script.ld deleted file mode 100644 index b4cf2a95c..000000000 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/linker/custom_Luos_bootloader_script.ld +++ /dev/null @@ -1,175 +0,0 @@ -/** - ****************************************************************************** - * @file LinkerScript.ld - * @author Auto-generated by STM32CubeIDE - * @brief Linker script for STM32F401RETx Device from STM32F4 series - * 512Kbytes FLASH - * 96Kbytes RAM - * - * Set heap size, stack size and stack location according - * to application requirements. - * - * Set memory bank area and size if external memory is used - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ - -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Memories definition */ -MEMORY -{ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K - FLASH (rw) : ORIGIN = 0x08010000, LENGTH = 448K -} - -/* Sections */ -SECTIONS -{ - /* The startup code into "FLASH" Rom type memory */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data into "FLASH" Rom type memory */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data into "FLASH" Rom type memory */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { - . = ALIGN(4); - *(.ARM.extab* .gnu.linkonce.armextab.*) - . = ALIGN(4); - } >FLASH - - .ARM : { - . = ALIGN(4); - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - . = ALIGN(4); - } >FLASH - - .preinit_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - . = ALIGN(4); - } >FLASH - - .init_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - . = ALIGN(4); - } >FLASH - - .fini_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - . = ALIGN(4); - } >FLASH - - /* Used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections into "RAM" Ram type memory */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - - } >RAM AT> FLASH - - /* Uninitialized data section into "RAM" Ram type memory */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - /* Remove information from the compiler libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h deleted file mode 100644 index 49f211a3d..000000000 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/node_config.h +++ /dev/null @@ -1,144 +0,0 @@ -/****************************************************************************** - * @file node_config.h - * @brief This file allow you to use standard preprocessor definitions to - * configure your project, Luos and Luos HAL libraries - * - * # Introduction - * This file is for the luos user. You may here configure your project and - * define your custom Luos service and custom Luos command for your product - * - * Luos libraries offer a minimal standard configuration to optimize - * memory usage. In some case you have to modify standard value to fit - * with your need concerning among of data transiting through the network - * or network speed for example - * - * Luos libraries can be use with a lot a MCU family. Luos compagny give you - * a default configuration, for specific MCU family, in robus_hal_config.h. - * This configuration can be modify here to fit with you design by - * preprocessor definitions of MCU Hardware needs - * - * # Usage - * This file should be place a the root folder of your project and include - * where build flag preprocessor definitions are define in your IDE - * -include node_config.h - * - * @author Luos - * @version 0.0.0 - ******************************************************************************/ -#ifndef _NODE_CONFIG_H_ -#define _NODE_CONFIG_H_ - -/******************************************************************************* - * PROJECT DEFINITION - *******************************************************************************/ - -/******************************************************************************* - * LUOS LIBRARY DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node - * MAX_NODE_NUMBER. | 20 | Node number in the device - * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * NBR_PORT | 2 | PTP Branch number Max 8 - * NBR_RETRY | 10 | Send Retry number in case of NACK or collision - ******************************************************************************/ - -#define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 - -/******************************************************************************* - * LUOS HAL LIBRARY DEFINITION -******************************************************************************* - * Define | Description - * :-----------------------|----------------------------------------------- - * MCUFREQ | Put your the MCU frequency (value in Hz) - * TIMERDIV | Timer divider clock (see your clock configuration) - * USE_CRC_HW | define to 0 if there is no Module CRC in your MCU - * USE_TX_IT | define to 1 to not use DMA transfert for Luos Tx - * - * PORT_CLOCK_ENABLE | Enable clock for port - * PTPx | A,B,C,D etc. PTP Branch Pin/Port/IRQ - * TX_LOCK_DETECT | Disable by default use if not busy flag in USART Pin/Port/IRQ - * RX_EN | Rx enable for driver RS485 always on Pin/Port - * TX_EN | Tx enable for driver RS485 Pin/Port - * COM_TX | Tx USART Com Pin/Port/Alternate - * COM_RX | Rx USART Com Pin/Port/Alternate - * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - - * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART - * ROBUS_COM | USART number - * ROBUS_COM_IRQ | USART IRQ number - * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - - * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA - * ROBUS_DMA | DMA number - * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - - * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * ROBUS_TIMER | Timer number - * ROBUS_TIMER_IRQ | Timer IRQ number - * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler -******************************************************************************/ - -/******************************************************************************* - * MCU CONFIG - ******************************************************************************/ -#define MCUFREQ 84000000 -#define TIMERDIV 1 -/******************************************************************************* - * PINOUT CONFIG - ******************************************************************************/ - -/******************************************************************************* - * COM CONFIG - ******************************************************************************/ - -/******************************************************************************* - * COM DMA CONFIG - ******************************************************************************/ - -/******************************************************************************* - * COM TIMEOUT CONFIG - ******************************************************************************/ -#define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM3_CLK_ENABLE() -#define ROBUS_TIMER TIM3 -#define ROBUS_TIMER_IRQ TIM3_IRQn -#define ROBUS_TIMER_IRQHANDLER() TIM3_IRQHandler() - -/******************************************************************************* - * FLASH CONFIGURATION FOR APP WITH BOOTLOADER - ******************************************************************************** - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * BOOT_START_ADDRESS | FLASH_BASE = 0x8000000 | Start address of Bootloader in flash - * SHARED_MEMORY_ADDRESS | 0x0800C000 | Start address of shared memory to save boot flag - * SHARED_MEMORY_SECTOR | FLASH_SECTOR_3 | Start sector of shared memory - * APP_START_ADDRESS | 0x08010000 | Start address of application with bootloader - * APP_END_ADDRESS | FLASH_END | End address of application with bootloader - * APP_START_SECTOR | FLASH_SECTOR_4 | Start sector of application with bootloader - * APP_END_SECTOR | FLASH_SECTOR_TOTAL - 1 | last sector of application with bootloader - ******************************************************************************/ - -/******************************************************************************* - * GATE SERIAL COM DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :-------------------------|------------------------------------------------------ - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * GATE_BUFF_SIZE | 1024 | Json receive buffer size - * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size - * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size - ******************************************************************************/ - -#define GATE_BUFF_SIZE 1024 -#define PIPE_TX_BUFFER_SIZE 1024 -#define PIPE_RX_BUFFER_SIZE 2048 -#define NODETECTION - -#endif /* _NODE_CONFIG_H_ */ diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-F401RE/inspector_serialcom/platformio.ini deleted file mode 100644 index 650b9b073..000000000 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/platformio.ini +++ /dev/null @@ -1,56 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html -[platformio] -default_envs = nucleo_f401re - -[env] -lib_ldf_mode =off -lib_extra_dirs = - $PROJECT_DIR/../../../../tool_services/ - $PROJECT_DIR/../../../../../ - $PROJECT_DIR/../../../../network/ -platform = ststm32 -board = nucleo_f401re -framework = stm32cube -lib_deps = - luos_engine@^3.0.0 - robus_network - Inspector - Pipe -debug_tool = stlink -upload_protocol = stlink - -[env:nucleo_f401re] -build_unflags = -Os -build_flags = - -O1 - -include node_config.h - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32F4 - -D PIPEMODE=SERIAL - -D PIPEHAL=NUCLEO-F4 - -[env:nucleo_f401re_with_bootloader] -board_build.ldscript = linker/custom_Luos_bootloader_script.ld -build_unflags = -Os -build_flags = - -O1 - -include node_config.h - -DWITH_BOOTLOADER - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32F4 - -D PIPEMODE=SERIAL - -D PIPEHAL=NUCLEO-F4 -upload_protocol = custom -upload_flags = - -t2 -upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/gpio.c b/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/gpio.c deleted file mode 100644 index b7d87119a..000000000 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/gpio.c +++ /dev/null @@ -1,66 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.c - * @brief This file provides code for the configuration - * of all used GPIO pins. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "gpio.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/*----------------------------------------------------------------------------*/ -/* Configure GPIO */ -/*----------------------------------------------------------------------------*/ -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** Configure pins -*/ -void MX_GPIO_Init(void) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOA_CLK_ENABLE(); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = BTN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(BTN_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = LED_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct); -} - -/* USER CODE BEGIN 2 */ - -/* USER CODE END 2 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/main.c deleted file mode 100644 index 76048bce7..000000000 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/main.c +++ /dev/null @@ -1,191 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.c - * @brief : Main program body - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "gpio.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -#include "luos_engine.h" -#include "robus_network.h" -#include "inspector.h" -#include "pipe.h" -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN PTD */ -/* USER CODE END PTD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -void SystemClock_Config(void); -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/** - * @brief The application entry point. - * @retval int - */ -int main(void) -{ - /* USER CODE BEGIN 1 */ - - /* USER CODE END 1 */ - - /* MCU Configuration--------------------------------------------------------*/ - - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ - HAL_Init(); - - /* USER CODE BEGIN Init */ - - /* USER CODE END Init */ - - /* Configure the system clock */ - SystemClock_Config(); - - /* USER CODE BEGIN SysInit */ - - /* USER CODE END SysInit */ - - /* Initialize all configured peripherals */ - MX_GPIO_Init(); - /* USER CODE BEGIN 2 */ - Luos_Init(); - Robus_Init(); - Inspector_Init(); - Pipe_Init(); - /* USER CODE END 2 */ - - /* Infinite loop */ - /* USER CODE BEGIN WHILE */ - while (1) - { - /* USER CODE END WHILE */ - - /* USER CODE BEGIN 3 */ - Luos_Loop(); - Inspector_Loop(); - Pipe_Loop(); - } - /* USER CODE END 3 */ -} - -/** - * @brief System Clock Configuration - * @retval None - */ -void SystemClock_Config(void) -{ - RCC_OscInitTypeDef RCC_OscInitStruct = {0}; - RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; - - /** Configure the main internal regulator output voltage - */ - __HAL_RCC_PWR_CLK_ENABLE(); - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2); - /** Initializes the RCC Oscillators according to the specified parameters - * in the RCC_OscInitTypeDef structure. - */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; - RCC_OscInitStruct.HSIState = RCC_HSI_ON; - RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; - RCC_OscInitStruct.PLL.PLLM = 8; - RCC_OscInitStruct.PLL.PLLN = 84; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 4; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) - { - Error_Handler(); - } - /** Initializes the CPU, AHB and APB buses clocks - */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK - | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) - { - Error_Handler(); - } -} - -/* USER CODE BEGIN 4 */ - -/* USER CODE END 4 */ - -/** - * @brief This function is executed in case of error occurrence. - * @retval None - */ -void Error_Handler(void) -{ - /* USER CODE BEGIN Error_Handler_Debug */ - /* User can add his own implementation to report the HAL error return state */ - __disable_irq(); - while (1) - { - } - /* USER CODE END Error_Handler_Debug */ -} - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t *file, uint32_t line) -{ - /* USER CODE BEGIN 6 */ - /* User can add his own implementation to report the file name and line number, - ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ - /* USER CODE END 6 */ -} -#endif /* USE_FULL_ASSERT */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/stm32f4xx_hal_msp.c b/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/stm32f4xx_hal_msp.c deleted file mode 100644 index a182b75ef..000000000 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/stm32f4xx_hal_msp.c +++ /dev/null @@ -1,84 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f4xx_hal_msp.c - * @brief This file provides code for the MSP Initialization - * and de-Initialization codes. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN Define */ - -/* USER CODE END Define */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN Macro */ - -/* USER CODE END Macro */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* External functions --------------------------------------------------------*/ -/* USER CODE BEGIN ExternalFunctions */ - -/* USER CODE END ExternalFunctions */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ -/** - * Initializes the Global MSP. - */ -void HAL_MspInit(void) -{ - /* USER CODE BEGIN MspInit 0 */ - - /* USER CODE END MspInit 0 */ - - __HAL_RCC_SYSCFG_CLK_ENABLE(); - __HAL_RCC_PWR_CLK_ENABLE(); - - /* System interrupt init*/ - - /* USER CODE BEGIN MspInit 1 */ - - /* USER CODE END MspInit 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/stm32f4xx_it.c b/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/stm32f4xx_it.c deleted file mode 100644 index 0089a2909..000000000 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/stm32f4xx_it.c +++ /dev/null @@ -1,219 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f4xx_it.c - * @brief Interrupt Service Routines. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "stm32f4xx_it.h" -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* External variables --------------------------------------------------------*/ - -/* USER CODE BEGIN EV */ - -/* USER CODE END EV */ - -/******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ -/******************************************************************************/ -/** - * @brief This function handles Non maskable interrupt. - */ -void NMI_Handler(void) -{ - /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ - - /* USER CODE END NonMaskableInt_IRQn 0 */ - /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ - while (1) - { - } - /* USER CODE END NonMaskableInt_IRQn 1 */ -} - -/** - * @brief This function handles Hard fault interrupt. - */ -void HardFault_Handler(void) -{ - /* USER CODE BEGIN HardFault_IRQn 0 */ - - /* USER CODE END HardFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_HardFault_IRQn 0 */ - /* USER CODE END W1_HardFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Memory management fault. - */ -void MemManage_Handler(void) -{ - /* USER CODE BEGIN MemoryManagement_IRQn 0 */ - - /* USER CODE END MemoryManagement_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ - /* USER CODE END W1_MemoryManagement_IRQn 0 */ - } -} - -/** - * @brief This function handles Pre-fetch fault, memory access fault. - */ -void BusFault_Handler(void) -{ - /* USER CODE BEGIN BusFault_IRQn 0 */ - - /* USER CODE END BusFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_BusFault_IRQn 0 */ - /* USER CODE END W1_BusFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Undefined instruction or illegal state. - */ -void UsageFault_Handler(void) -{ - /* USER CODE BEGIN UsageFault_IRQn 0 */ - - /* USER CODE END UsageFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ - /* USER CODE END W1_UsageFault_IRQn 0 */ - } -} - -/** - * @brief This function handles System service call via SWI instruction. - */ -void SVC_Handler(void) -{ - /* USER CODE BEGIN SVCall_IRQn 0 */ - - /* USER CODE END SVCall_IRQn 0 */ - /* USER CODE BEGIN SVCall_IRQn 1 */ - - /* USER CODE END SVCall_IRQn 1 */ -} - -/** - * @brief This function handles Debug monitor. - */ -void DebugMon_Handler(void) -{ - /* USER CODE BEGIN DebugMonitor_IRQn 0 */ - - /* USER CODE END DebugMonitor_IRQn 0 */ - /* USER CODE BEGIN DebugMonitor_IRQn 1 */ - - /* USER CODE END DebugMonitor_IRQn 1 */ -} - -/** - * @brief This function handles Pendable request for system service. - */ -void PendSV_Handler(void) -{ - /* USER CODE BEGIN PendSV_IRQn 0 */ - - /* USER CODE END PendSV_IRQn 0 */ - /* USER CODE BEGIN PendSV_IRQn 1 */ - - /* USER CODE END PendSV_IRQn 1 */ -} - -/** - * @brief This function handles System tick timer. - */ -void SysTick_Handler(void) -{ - /* USER CODE BEGIN SysTick_IRQn 0 */ - - /* USER CODE END SysTick_IRQn 0 */ - HAL_IncTick(); - /* USER CODE BEGIN SysTick_IRQn 1 */ - - /* USER CODE END SysTick_IRQn 1 */ -} - -/******************************************************************************/ -/* STM32F4xx Peripheral Interrupt Handlers */ -/* Add here the Interrupt Handlers for the used peripherals. */ -/* For the available peripheral interrupt handler names, */ -/* please refer to the startup file (startup_stm32f4xx.s). */ -/******************************************************************************/ - -/* USER CODE BEGIN 1 */ -void EXTI4_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_4); -} - -void EXTI9_5_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_5); -} - -void EXTI15_10_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_10); -} -/* USER CODE END 1 */ -/* USER CODE END 1 */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/system_stm32f4xx.c b/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/system_stm32f4xx.c deleted file mode 100644 index 4bd94b338..000000000 --- a/examples/projects/NUCLEO-F401RE/inspector_serialcom/src/system_stm32f4xx.c +++ /dev/null @@ -1,730 +0,0 @@ -/** - ****************************************************************************** - * @file system_stm32f4xx.c - * @author MCD Application Team - * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File. - * - * This file provides two functions and one global variable to be called from - * user application: - * - SystemInit(): This function is called at startup just after reset and - * before branch to main program. This call is made inside - * the "startup_stm32f4xx.s" file. - * - * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick - * timer or configure other parameters. - * - * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must - * be called whenever the core clock is changed - * during program execution. - * - * - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/** @addtogroup CMSIS - * @{ - */ - -/** @addtogroup stm32f4xx_system - * @{ - */ - -/** @addtogroup STM32F4xx_System_Private_Includes - * @{ - */ - -#include "stm32f4xx.h" - -#if !defined(HSE_VALUE) -#define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined(HSI_VALUE) -#define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_TypesDefinitions - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Defines - * @{ - */ - -/************************* Miscellaneous Configuration ************************/ -/*!< Uncomment the following line if you need to use external SRAM or SDRAM as data memory */ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) \ - || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) -/* #define DATA_IN_ExtSRAM */ -#endif /* STM32F40xxx || STM32F41xxx || STM32F42xxx || STM32F43xxx || STM32F469xx || STM32F479xx || \ - STM32F412Zx || STM32F412Vx */ - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) -/* #define DATA_IN_ExtSDRAM */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || \ - STM32F479xx */ - -/*!< Uncomment the following line if you need to relocate your vector Table in - Internal SRAM. */ -/* #define VECT_TAB_SRAM */ -#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. \ - This value must be a multiple of 0x200. */ -/******************************************************************************/ -/** - * @} - */ -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Macros - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Variables - * @{ - */ -/* This variable is updated in three ways: - 1) by calling CMSIS function SystemCoreClockUpdate() - 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency - Note: If you use this function to configure the system clock; then there - is no need to call the 2 first functions listed above, since SystemCoreClock - variable is updated automatically. - */ -uint32_t SystemCoreClock = 16000000; -const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; -const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_FunctionPrototypes - * @{ - */ - -#if defined(DATA_IN_ExtSRAM) || defined(DATA_IN_ExtSDRAM) -static void SystemInit_ExtMemCtl(void); -#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Functions - * @{ - */ - -/** - * @brief Setup the microcontroller system - * Initialize the FPU setting, vector table location and External memory - * configuration. - * @param None - * @retval None - */ -void SystemInit(void) -{ -/* FPU settings ------------------------------------------------------------*/ -#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) - SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10 and CP11 Full Access */ -#endif - -#if defined(DATA_IN_ExtSRAM) || defined(DATA_IN_ExtSDRAM) - SystemInit_ExtMemCtl(); -#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ - - /* Configure the Vector Table location add offset address ------------------*/ -#ifdef VECT_TAB_SRAM - SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ -#else - SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ -#endif -} - -/** - * @brief Update SystemCoreClock variable according to Clock Register Values. - * The SystemCoreClock variable contains the core clock (HCLK), it can - * be used by the user application to setup the SysTick timer or configure - * other parameters. - * - * @note Each time the core clock (HCLK) changes, this function must be called - * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined - * constant and the selected clock source: - * - * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) - * - * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) - * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * - * (*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value - * 16 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * - * (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (its value - * depends on the application requirements), user has to ensure that HSE_VALUE - * is same as the real frequency of the crystal used. Otherwise, this function - * may have wrong result. - * - * - The result of this function could be not correct when using fractional - * value for HSE crystal. - * - * @param None - * @retval None - */ -void SystemCoreClockUpdate(void) -{ - uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; - - /* Get SYSCLK source -------------------------------------------------------*/ - tmp = RCC->CFGR & RCC_CFGR_SWS; - - switch (tmp) - { - case 0x00: /* HSI used as system clock source */ - SystemCoreClock = HSI_VALUE; - break; - case 0x04: /* HSE used as system clock source */ - SystemCoreClock = HSE_VALUE; - break; - case 0x08: /* PLL used as system clock source */ - - /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N - SYSCLK = PLL_VCO / PLL_P - */ - pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22; - pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; - - if (pllsource != 0) - { - /* HSE used as PLL clock source */ - pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); - } - else - { - /* HSI used as PLL clock source */ - pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); - } - - pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >> 16) + 1) * 2; - SystemCoreClock = pllvco / pllp; - break; - default: - SystemCoreClock = HSI_VALUE; - break; - } - /* Compute HCLK frequency --------------------------------------------------*/ - /* Get HCLK prescaler */ - tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; - /* HCLK frequency */ - SystemCoreClock >>= tmp; -} - -#if defined(DATA_IN_ExtSRAM) && defined(DATA_IN_ExtSDRAM) -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F469xx) || defined(STM32F479xx) -/** - * @brief Setup the external memory controller. - * Called in startup_stm32f4xx.s before jump to main. - * This function configures the external memories (SRAM/SDRAM) - * This SRAM/SDRAM will be used as program data memory (including heap and stack). - * @param None - * @retval None - */ -void SystemInit_ExtMemCtl(void) -{ - __IO uint32_t tmp = 0x00; - - register uint32_t tmpreg = 0, timeout = 0xFFFF; - register __IO uint32_t index; - - /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface clock */ - RCC->AHB1ENR |= 0x000001F8; - - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - - /* Connect PDx pins to FMC Alternate function */ - GPIOD->AFR[0] = 0x00CCC0CC; - GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ - GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ - GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ - GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOD->PUPDR = 0x00000000; - - /* Connect PEx pins to FMC Alternate function */ - GPIOE->AFR[0] = 0xC00CC0CC; - GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ - GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ - GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ - GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ - GPIOE->PUPDR = 0x00000000; - - /* Connect PFx pins to FMC Alternate function */ - GPIOF->AFR[0] = 0xCCCCCCCC; - GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ - GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ - GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ - GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ - GPIOF->PUPDR = 0x00000000; - - /* Connect PGx pins to FMC Alternate function */ - GPIOG->AFR[0] = 0xCCCCCCCC; - GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ - GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ - GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ - GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ - GPIOG->PUPDR = 0x00000000; - - /* Connect PHx pins to FMC Alternate function */ - GPIOH->AFR[0] = 0x00C0CC00; - GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ - GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ - GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ - GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ - GPIOH->PUPDR = 0x00000000; - - /* Connect PIx pins to FMC Alternate function */ - GPIOI->AFR[0] = 0xCCCCCCCC; - GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ - GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ - GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ - GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ - GPIOI->PUPDR = 0x00000000; - - /*-- FMC Configuration -------------------------------------------------------*/ - /* Enable the FMC interface clock */ - RCC->AHB3ENR |= 0x00000001; - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - - FMC_Bank5_6->SDCR[0] = 0x000019E4; - FMC_Bank5_6->SDTR[0] = 0x01115351; - - /* SDRAM initialization sequence */ - /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Delay */ - for (index = 0; index < 1000; index++) - ; - - /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Auto refresh command */ - FMC_Bank5_6->SDCMR = 0x00000073; - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* MRD register program */ - FMC_Bank5_6->SDCMR = 0x00046014; - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Set refresh count */ - tmpreg = FMC_Bank5_6->SDRTR; - FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C << 1)); - - /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; - FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001011; - FMC_Bank1->BTCR[3] = 0x00000201; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ -#if defined(STM32F469xx) || defined(STM32F479xx) - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001091; - FMC_Bank1->BTCR[3] = 0x00110212; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F469xx || STM32F479xx */ - - (void)(tmp); -} -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ -#elif defined(DATA_IN_ExtSRAM) || defined(DATA_IN_ExtSDRAM) -/** - * @brief Setup the external memory controller. - * Called in startup_stm32f4xx.s before jump to main. - * This function configures the external memories (SRAM/SDRAM) - * This SRAM/SDRAM will be used as program data memory (including heap and stack). - * @param None - * @retval None - */ -void SystemInit_ExtMemCtl(void) -{ - __IO uint32_t tmp = 0x00; -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) -#if defined(DATA_IN_ExtSDRAM) - register uint32_t tmpreg = 0, timeout = 0xFFFF; - register __IO uint32_t index; - -#if defined(STM32F446xx) - /* Enable GPIOA, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG interface - clock */ - RCC->AHB1ENR |= 0x0000007D; -#else - /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface - clock */ - RCC->AHB1ENR |= 0x000001F8; -#endif /* STM32F446xx */ - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - -#if defined(STM32F446xx) - /* Connect PAx pins to FMC Alternate function */ - GPIOA->AFR[0] |= 0xC0000000; - GPIOA->AFR[1] |= 0x00000000; - /* Configure PDx pins in Alternate function mode */ - GPIOA->MODER |= 0x00008000; - /* Configure PDx pins speed to 50 MHz */ - GPIOA->OSPEEDR |= 0x00008000; - /* Configure PDx pins Output type to push-pull */ - GPIOA->OTYPER |= 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOA->PUPDR |= 0x00000000; - - /* Connect PCx pins to FMC Alternate function */ - GPIOC->AFR[0] |= 0x00CC0000; - GPIOC->AFR[1] |= 0x00000000; - /* Configure PDx pins in Alternate function mode */ - GPIOC->MODER |= 0x00000A00; - /* Configure PDx pins speed to 50 MHz */ - GPIOC->OSPEEDR |= 0x00000A00; - /* Configure PDx pins Output type to push-pull */ - GPIOC->OTYPER |= 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOC->PUPDR |= 0x00000000; -#endif /* STM32F446xx */ - - /* Connect PDx pins to FMC Alternate function */ - GPIOD->AFR[0] = 0x000000CC; - GPIOD->AFR[1] = 0xCC000CCC; - /* Configure PDx pins in Alternate function mode */ - GPIOD->MODER = 0xA02A000A; - /* Configure PDx pins speed to 50 MHz */ - GPIOD->OSPEEDR = 0xA02A000A; - /* Configure PDx pins Output type to push-pull */ - GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOD->PUPDR = 0x00000000; - - /* Connect PEx pins to FMC Alternate function */ - GPIOE->AFR[0] = 0xC00000CC; - GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ - GPIOE->MODER = 0xAAAA800A; - /* Configure PEx pins speed to 50 MHz */ - GPIOE->OSPEEDR = 0xAAAA800A; - /* Configure PEx pins Output type to push-pull */ - GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ - GPIOE->PUPDR = 0x00000000; - - /* Connect PFx pins to FMC Alternate function */ - GPIOF->AFR[0] = 0xCCCCCCCC; - GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ - GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ - GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ - GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ - GPIOF->PUPDR = 0x00000000; - - /* Connect PGx pins to FMC Alternate function */ - GPIOG->AFR[0] = 0xCCCCCCCC; - GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ - GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ - GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ - GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ - GPIOG->PUPDR = 0x00000000; - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F469xx) || defined(STM32F479xx) - /* Connect PHx pins to FMC Alternate function */ - GPIOH->AFR[0] = 0x00C0CC00; - GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ - GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ - GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ - GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ - GPIOH->PUPDR = 0x00000000; - - /* Connect PIx pins to FMC Alternate function */ - GPIOI->AFR[0] = 0xCCCCCCCC; - GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ - GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ - GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ - GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ - GPIOI->PUPDR = 0x00000000; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ - - /*-- FMC Configuration -------------------------------------------------------*/ - /* Enable the FMC interface clock */ - RCC->AHB3ENR |= 0x00000001; - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - - /* Configure and enable SDRAM bank1 */ -#if defined(STM32F446xx) - FMC_Bank5_6->SDCR[0] = 0x00001954; -#else - FMC_Bank5_6->SDCR[0] = 0x000019E4; -#endif /* STM32F446xx */ - FMC_Bank5_6->SDTR[0] = 0x01115351; - - /* SDRAM initialization sequence */ - /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Delay */ - for (index = 0; index < 1000; index++) - ; - - /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Auto refresh command */ -#if defined(STM32F446xx) - FMC_Bank5_6->SDCMR = 0x000000F3; -#else - FMC_Bank5_6->SDCMR = 0x00000073; -#endif /* STM32F446xx */ - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* MRD register program */ -#if defined(STM32F446xx) - FMC_Bank5_6->SDCMR = 0x00044014; -#else - FMC_Bank5_6->SDCMR = 0x00046014; -#endif /* STM32F446xx */ - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Set refresh count */ - tmpreg = FMC_Bank5_6->SDRTR; -#if defined(STM32F446xx) - FMC_Bank5_6->SDRTR = (tmpreg | (0x0000050C << 1)); -#else - FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C << 1)); -#endif /* STM32F446xx */ - - /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; - FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); -#endif /* DATA_IN_ExtSDRAM */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */ - -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) \ - || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) - -#if defined(DATA_IN_ExtSRAM) - /*-- GPIOs Configuration -----------------------------------------------------*/ - /* Enable GPIOD, GPIOE, GPIOF and GPIOG interface clock */ - RCC->AHB1ENR |= 0x00000078; - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN); - - /* Connect PDx pins to FMC Alternate function */ - GPIOD->AFR[0] = 0x00CCC0CC; - GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ - GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ - GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ - GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOD->PUPDR = 0x00000000; - - /* Connect PEx pins to FMC Alternate function */ - GPIOE->AFR[0] = 0xC00CC0CC; - GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ - GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ - GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ - GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ - GPIOE->PUPDR = 0x00000000; - - /* Connect PFx pins to FMC Alternate function */ - GPIOF->AFR[0] = 0x00CCCCCC; - GPIOF->AFR[1] = 0xCCCC0000; - /* Configure PFx pins in Alternate function mode */ - GPIOF->MODER = 0xAA000AAA; - /* Configure PFx pins speed to 100 MHz */ - GPIOF->OSPEEDR = 0xFF000FFF; - /* Configure PFx pins Output type to push-pull */ - GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ - GPIOF->PUPDR = 0x00000000; - - /* Connect PGx pins to FMC Alternate function */ - GPIOG->AFR[0] = 0x00CCCCCC; - GPIOG->AFR[1] = 0x000000C0; - /* Configure PGx pins in Alternate function mode */ - GPIOG->MODER = 0x00085AAA; - /* Configure PGx pins speed to 100 MHz */ - GPIOG->OSPEEDR = 0x000CAFFF; - /* Configure PGx pins Output type to push-pull */ - GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ - GPIOG->PUPDR = 0x00000000; - - /*-- FMC/FSMC Configuration --------------------------------------------------*/ - /* Enable the FMC/FSMC interface clock */ - RCC->AHB3ENR |= 0x00000001; - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001011; - FMC_Bank1->BTCR[3] = 0x00000201; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ -#if defined(STM32F469xx) || defined(STM32F479xx) - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001091; - FMC_Bank1->BTCR[3] = 0x00110212; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F469xx || STM32F479xx */ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) \ - || defined(STM32F412Zx) || defined(STM32F412Vx) - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FSMCEN); - /* Configure and enable Bank1_SRAM2 */ - FSMC_Bank1->BTCR[2] = 0x00001011; - FSMC_Bank1->BTCR[3] = 0x00000201; - FSMC_Bank1E->BWTR[2] = 0x0FFFFFFF; -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F412Zx || STM32F412Vx */ - -#endif /* DATA_IN_ExtSRAM */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || \ - STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */ - (void)(tmp); -} -#endif /* DATA_IN_ExtSRAM && DATA_IN_ExtSDRAM */ -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/Inspector_SerialCom.ioc b/examples/projects/NUCLEO-F410RB/inspector_serialcom/Inspector_SerialCom.ioc deleted file mode 100644 index 45fe1a165..000000000 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/Inspector_SerialCom.ioc +++ /dev/null @@ -1,103 +0,0 @@ -#MicroXplorer Configuration settings - do not modify -File.Version=6 -GPIO.groupedBy= -KeepUserPlacement=false -Mcu.Family=STM32F4 -Mcu.IP0=NVIC -Mcu.IP1=RCC -Mcu.IP2=SYS -Mcu.IPNb=3 -Mcu.Name=STM32F410R(8-B)Tx -Mcu.Package=LQFP64 -Mcu.Pin0=PC13-ANTI_TAMP -Mcu.Pin1=PA5 -Mcu.Pin2=VP_SYS_VS_Systick -Mcu.PinsNb=3 -Mcu.ThirdPartyNb=0 -Mcu.UserConstants= -Mcu.UserName=STM32F410RBTx -MxCube.Version=6.1.1 -MxDb.Version=DB.6.0.10 -NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.ForceEnableDMAVector=true -NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 -NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true -NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -PA5.GPIOParameters=GPIO_Label -PA5.GPIO_Label=LED -PA5.Locked=true -PA5.Signal=GPIO_Output -PC13-ANTI_TAMP.GPIOParameters=GPIO_Label -PC13-ANTI_TAMP.GPIO_Label=BTN -PC13-ANTI_TAMP.Locked=true -PC13-ANTI_TAMP.Signal=GPIO_Input -PinOutPanel.RotationAngle=0 -ProjectManager.AskForMigrate=true -ProjectManager.BackupPrevious=false -ProjectManager.CompilerOptimize=6 -ProjectManager.ComputerToolchain=false -ProjectManager.CoupleFile=true -ProjectManager.CustomerFirmwarePackage= -ProjectManager.DefaultFWLocation=true -ProjectManager.DeletePrevious=true -ProjectManager.DeviceId=STM32F410RBTx -ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.25.2 -ProjectManager.FreePins=false -ProjectManager.HalAssertFull=false -ProjectManager.HeapSize=0x0 -ProjectManager.KeepUserCode=true -ProjectManager.LastFirmware=true -ProjectManager.LibraryCopy=1 -ProjectManager.MainLocation=Src -ProjectManager.NoMain=false -ProjectManager.PreviousToolchain= -ProjectManager.ProjectBuild=false -ProjectManager.ProjectFileName=Gate.ioc -ProjectManager.ProjectName=Gate -ProjectManager.RegisterCallBack= -ProjectManager.StackSize=0x400 -ProjectManager.TargetToolchain=EWARM V8.32 -ProjectManager.ToolChainLocation= -ProjectManager.UnderRoot=false -ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false -RCC.48MHZClocksFreq_Value=50000000 -RCC.AHBFreq_Value=100000000 -RCC.APB1CLKDivider=RCC_HCLK_DIV2 -RCC.APB1Freq_Value=50000000 -RCC.APB1TimFreq_Value=100000000 -RCC.APB2Freq_Value=100000000 -RCC.APB2TimFreq_Value=100000000 -RCC.CortexFreq_Value=100000000 -RCC.EthernetFreq_Value=100000000 -RCC.FCLKCortexFreq_Value=100000000 -RCC.FMPI2C1Freq_Value=50000000 -RCC.FamilyName=M -RCC.HCLKFreq_Value=100000000 -RCC.HSE_VALUE=25000000 -RCC.HSI_VALUE=16000000 -RCC.I2SClocksFreq_Value=100000000 -RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FMPI2C1Freq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LPTIM1Freq_Value,LSE_VALUE,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOInputFreq_Value,VCOOutputFreq_Value,VCOQOutputFreq_Value,VCOROutputFreq_Value -RCC.LPTIM1Freq_Value=50000000 -RCC.LSE_VALUE=32768 -RCC.LSI_VALUE=32000 -RCC.MCO2PinFreq_Value=100000000 -RCC.PLLCLKFreq_Value=100000000 -RCC.PLLM=8 -RCC.PLLN=100 -RCC.RTCFreq_Value=32000 -RCC.RTCHSEDivFreq_Value=12500000 -RCC.SYSCLKFreq_VALUE=100000000 -RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK -RCC.VCOInputFreq_Value=2000000 -RCC.VCOOutputFreq_Value=200000000 -RCC.VCOQOutputFreq_Value=50000000 -RCC.VCOROutputFreq_Value=100000000 -VP_SYS_VS_Systick.Mode=SysTick -VP_SYS_VS_Systick.Signal=SYS_VS_Systick -board=custom diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/include/gpio.h b/examples/projects/NUCLEO-F410RB/inspector_serialcom/include/gpio.h deleted file mode 100644 index f57136410..000000000 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/include/gpio.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.h - * @brief This file contains all the function prototypes for - * the gpio.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __GPIO_H__ -#define __GPIO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - - void MX_GPIO_Init(void); - - /* USER CODE BEGIN Prototypes */ - - /* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif -#endif /*__ GPIO_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/include/main.h b/examples/projects/NUCLEO-F410RB/inspector_serialcom/include/main.h deleted file mode 100644 index 57a236827..000000000 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/include/main.h +++ /dev/null @@ -1,76 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.h - * @brief : Header for main.c file. - * This file contains the common defines of the application. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __MAIN_H -#define __MAIN_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "stm32f4xx_hal.h" - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void Error_Handler(void); - -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -/* Private defines -----------------------------------------------------------*/ -#define BTN_Pin GPIO_PIN_13 -#define BTN_GPIO_Port GPIOC -#define LED_Pin GPIO_PIN_5 -#define LED_GPIO_Port GPIOA - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - -#ifdef __cplusplus -} -#endif - -#endif /* __MAIN_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/include/stm32f4xx_hal_conf.h b/examples/projects/NUCLEO-F410RB/inspector_serialcom/include/stm32f4xx_hal_conf.h deleted file mode 100644 index ac7527654..000000000 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/include/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,490 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - - /* #define HAL_ADC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -/* #define HAL_I2C_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -/* #define HAL_SPI_MODULE_ENABLED */ -/* #define HAL_TIM_MODULE_ENABLED */ -/* #define HAL_UART_MODULE_ENABLED */ -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_SMBUS_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -/* #define HAL_PCD_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined(HSE_VALUE) -#define HSE_VALUE ((uint32_t)25000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined(HSE_STARTUP_TIMEOUT) -#define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined(HSI_VALUE) -#define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined(LSI_VALUE) -#define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz \ - The real value may vary depending on the variations \ - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined(LSE_VALUE) -#define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined(LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined(EXTERNAL_CLOCK_VALUE) -#define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ -#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ -#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ -#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ -#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ -#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ -#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ -#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ -#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ -#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ -#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ -#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ -#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ -#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ -#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ -#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ -#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ -#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ -#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ -#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ -#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ -#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ -#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ -#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ -#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ -#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ -#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ -#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ -#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ -#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ -#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - - /* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - - /* ################## SPI peripheral configuration ########################## */ - - /* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - - /* Includes ------------------------------------------------------------------*/ - /** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED -#include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED -#include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED -#include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED -#include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED -#include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED -#include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED -#include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CAN_LEGACY_MODULE_ENABLED -#include "stm32f4xx_hal_can_legacy.h" -#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED -#include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED -#include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED -#include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED -#include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED -#include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED -#include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED -#include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED -#include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED -#include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED -#include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED -#include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED -#include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED -#include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED -#include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED -#include "stm32f4xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED -#include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED -#include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED -#include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED -#include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED -#include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED -#include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED -#include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED -#include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED -#include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED -#include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED -#include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED -#include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED -#include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED -#include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED -#include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED -#include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED -#include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED -#include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED -#include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED -#include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED -#include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED -#include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED -#include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED -#include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED -#include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT - /** - * @brief The assert_param macro is used for function's parameters check. - * @param expr If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) - /* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t *file, uint32_t line); -#else -#define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/include/stm32f4xx_it.h b/examples/projects/NUCLEO-F410RB/inspector_serialcom/include/stm32f4xx_it.h deleted file mode 100644 index c6fdc0092..000000000 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/include/stm32f4xx_it.h +++ /dev/null @@ -1,70 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f4xx_it.h - * @brief This file contains the headers of the interrupt handlers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_IT_H -#define __STM32F4xx_IT_H - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void NMI_Handler(void); - void HardFault_Handler(void); - void MemManage_Handler(void); - void BusFault_Handler(void); - void UsageFault_Handler(void); - void SVC_Handler(void); - void DebugMon_Handler(void); - void PendSV_Handler(void); - void SysTick_Handler(void); - /* USER CODE BEGIN EFP */ - - /* USER CODE END EFP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_IT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/linker/custom_Luos_bootloader_script.ld b/examples/projects/NUCLEO-F410RB/inspector_serialcom/linker/custom_Luos_bootloader_script.ld deleted file mode 100644 index 18f7663f6..000000000 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/linker/custom_Luos_bootloader_script.ld +++ /dev/null @@ -1,186 +0,0 @@ -/* -****************************************************************************** -** -** @file : LinkerScript.ld -** -** @author : Auto-generated by STM32CubeIDE -** -** @brief : Linker script for STM32F410RBTx Device from STM32F4 series -** 128Kbytes FLASH -** 32Kbytes RAM -** -** Set heap size, stack size and stack location according -** to application requirements. -** -** Set memory bank area and size if external memory is used -** -** Target : STMicroelectronics STM32 -** -** Distribution: The file is distributed as is, without any warranty -** of any kind. -** -****************************************************************************** -** @attention -** -**

© Copyright (c) 2021 STMicroelectronics. -** All rights reserved.

-** -** This software component is licensed by ST under BSD 3-Clause license, -** the "License"; You may not use this file except in compliance with the -** License. You may obtain a copy of the License at: -** opensource.org/licenses/BSD-3-Clause -** -****************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ - -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Memories definition */ -MEMORY -{ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K - FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 64K -} - -/* Sections */ -SECTIONS -{ - /* The startup code into "FLASH" Rom type memory */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data into "FLASH" Rom type memory */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data into "FLASH" Rom type memory */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { - . = ALIGN(4); - *(.ARM.extab* .gnu.linkonce.armextab.*) - . = ALIGN(4); - } >FLASH - - .ARM : { - . = ALIGN(4); - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - . = ALIGN(4); - } >FLASH - - .preinit_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - . = ALIGN(4); - } >FLASH - - .init_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - . = ALIGN(4); - } >FLASH - - .fini_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - . = ALIGN(4); - } >FLASH - - /* Used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections into "RAM" Ram type memory */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - *(.RamFunc) /* .RamFunc sections */ - *(.RamFunc*) /* .RamFunc* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - - } >RAM AT> FLASH - - /* Uninitialized data section into "RAM" Ram type memory */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - /* Remove information from the compiler libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h deleted file mode 100644 index dabe2928f..000000000 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/node_config.h +++ /dev/null @@ -1,144 +0,0 @@ -/****************************************************************************** - * @file node_config.h - * @brief This file allow you to use standard preprocessor definitions to - * configure your project, Luos and Luos HAL libraries - * - * # Introduction - * This file is for the luos user. You may here configure your project and - * define your custom Luos service and custom Luos command for your product - * - * Luos libraries offer a minimal standard configuration to optimize - * memory usage. In some case you have to modify standard value to fit - * with your need concerning among of data transiting through the network - * or network speed for example - * - * Luos libraries can be use with a lot a MCU family. Luos compagny give you - * a default configuration, for specific MCU family, in robus_hal_config.h. - * This configuration can be modify here to fit with you design by - * preprocessor definitions of MCU Hardware needs - * - * # Usage - * This file should be place a the root folder of your project and include - * where build flag preprocessor definitions are define in your IDE - * -include node_config.h - * - * @author Luos - * @version 0.0.0 - ******************************************************************************/ -#ifndef _NODE_CONFIG_H_ -#define _NODE_CONFIG_H_ - -/******************************************************************************* - * PROJECT DEFINITION - *******************************************************************************/ - -/******************************************************************************* - * LUOS LIBRARY DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node - * MAX_NODE_NUMBER. | 20 | Node number in the device - * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * NBR_PORT | 2 | PTP Branch number Max 8 - * NBR_RETRY | 10 | Send Retry number in case of NACK or collision - ******************************************************************************/ - -#define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 -#define NODETECTION - -/******************************************************************************* - * LUOS HAL LIBRARY DEFINITION -******************************************************************************* - * Define | Description - * :-----------------------|----------------------------------------------- - * MCUFREQ | Put your the MCU frequency (value in Hz) - * TIMERDIV | Timer divider clock (see your clock configuration) - * USE_CRC_HW | define to 0 if there is no Module CRC in your MCU - * USE_TX_IT | define to 1 to not use DMA transfert for Luos Tx - * - * PORT_CLOCK_ENABLE | Enable clock for port - * PTPx | A,B,C,D etc. PTP Branch Pin/Port/IRQ - * TX_LOCK_DETECT | Disable by default use if not busy flag in USART Pin/Port/IRQ - * RX_EN | Rx enable for driver RS485 always on Pin/Port - * TX_EN | Tx enable for driver RS485 Pin/Port - * COM_TX | Tx USART Com Pin/Port/Alternate - * COM_RX | Rx USART Com Pin/Port/Alternate - * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - - * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART - * ROBUS_COM | USART number - * ROBUS_COM_IRQ | USART IRQ number - * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - - * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA - * ROBUS_DMA | DMA number - * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - - * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * ROBUS_TIMER | Timer number - * ROBUS_TIMER_IRQ | Timer IRQ number - * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler -******************************************************************************/ - -/******************************************************************************* - * MCU CONFIG - ******************************************************************************/ -#define MCUFREQ 100000000 -#define TIMERDIV 1 -/******************************************************************************* - * PINOUT CONFIG - ******************************************************************************/ - -/******************************************************************************* - * COM CONFIG - ******************************************************************************/ - -/******************************************************************************* - * COM DMA CONFIG - ******************************************************************************/ - -/******************************************************************************* - * COM TIMEOUT CONFIG - ******************************************************************************/ -#define ROBUS_TIMER_CLOCK_ENABLE() __HAL_RCC_TIM5_CLK_ENABLE() -#define ROBUS_TIMER TIM5 -#define ROBUS_TIMER_IRQ TIM5_IRQn -#define ROBUS_TIMER_IRQHANDLER() TIM5_IRQHandler() - -/******************************************************************************* - * FLASH CONFIGURATION FOR APP WITH BOOTLOADER - ******************************************************************************** - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * BOOT_START_ADDRESS | FLASH_BASE = 0x8000000 | Start address of Bootloader in flash - * SHARED_MEMORY_ADDRESS | 0x0800C000 | Start address of shared memory to save boot flag - * SHARED_MEMORY_SECTOR | FLASH_SECTOR_3 | Start sector of shared memory - * APP_START_ADDRESS | 0x08010000 | Start address of application with bootloader - * APP_END_ADDRESS | FLASH_END | End address of application with bootloader - * APP_START_SECTOR | FLASH_SECTOR_4 | Start sector of application with bootloader - * APP_END_SECTOR | FLASH_SECTOR_TOTAL - 1 | last sector of application with bootloader - ******************************************************************************/ - -/******************************************************************************* - * GATE SERIAL COM DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :-------------------------|------------------------------------------------------ - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * GATE_BUFF_SIZE | 1024 | Json receive buffer size - * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size - * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size - ******************************************************************************/ - -#define GATE_BUFF_SIZE 1024 -#define PIPE_TX_BUFFER_SIZE 1024 -#define PIPE_RX_BUFFER_SIZE 2048 - -#endif /* _NODE_CONFIG_H_ */ diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-F410RB/inspector_serialcom/platformio.ini deleted file mode 100644 index 895c19f58..000000000 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/platformio.ini +++ /dev/null @@ -1,56 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html -[platformio] -default_envs = nucleo_f410rb - -[env] -lib_ldf_mode =off -lib_extra_dirs = - $PROJECT_DIR/../../../../tool_services/ - $PROJECT_DIR/../../../../../ - $PROJECT_DIR/../../../../network/ -platform = ststm32 -board = nucleo_f410rb -framework = stm32cube -lib_deps = - luos_engine@^3.0.0 - robus_network - Inspector - Pipe -debug_tool = stlink -upload_protocol = stlink - -[env:nucleo_f410rb] -build_unflags = -Os -build_flags = - -O1 - -include node_config.h - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32F4 - -D PIPEMODE=SERIAL - -D PIPEHAL=NUCLEO-F4 - -[env:nucleo_f410rb_with_bootloader] -board_build.ldscript = linker/custom_Luos_bootloader_script.ld -build_unflags = -Os -build_flags = - -O1 - -include node_config.h - -DWITH_BOOTLOADER - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32F4 - -D PIPEMODE=SERIAL - -D PIPEHAL=NUCLEO-F4 -upload_protocol = custom -upload_flags = - -t2 -upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/gpio.c b/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/gpio.c deleted file mode 100644 index b7d87119a..000000000 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/gpio.c +++ /dev/null @@ -1,66 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.c - * @brief This file provides code for the configuration - * of all used GPIO pins. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "gpio.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/*----------------------------------------------------------------------------*/ -/* Configure GPIO */ -/*----------------------------------------------------------------------------*/ -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** Configure pins -*/ -void MX_GPIO_Init(void) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOA_CLK_ENABLE(); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = BTN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(BTN_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = LED_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct); -} - -/* USER CODE BEGIN 2 */ - -/* USER CODE END 2 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/main.c deleted file mode 100644 index 117d8e1d8..000000000 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/main.c +++ /dev/null @@ -1,192 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.c - * @brief : Main program body - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "gpio.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -#include "luos_engine.h" -#include "robus_network.h" -#include "inspector.h" -#include "pipe.h" -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN PTD */ -/* USER CODE END PTD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -void SystemClock_Config(void); -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/** - * @brief The application entry point. - * @retval int - */ -int main(void) -{ - /* USER CODE BEGIN 1 */ - - /* USER CODE END 1 */ - - /* MCU Configuration--------------------------------------------------------*/ - - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ - HAL_Init(); - - /* USER CODE BEGIN Init */ - - /* USER CODE END Init */ - - /* Configure the system clock */ - SystemClock_Config(); - - /* USER CODE BEGIN SysInit */ - - /* USER CODE END SysInit */ - - /* Initialize all configured peripherals */ - MX_GPIO_Init(); - /* USER CODE BEGIN 2 */ - Luos_Init(); - Robus_Init(); - Inspector_Init(); - Pipe_Init(); - /* USER CODE END 2 */ - - /* Infinite loop */ - /* USER CODE BEGIN WHILE */ - while (1) - { - /* USER CODE END WHILE */ - - /* USER CODE BEGIN 3 */ - Luos_Loop(); - Inspector_Loop(); - Pipe_Loop(); - } - /* USER CODE END 3 */ -} - -/** - * @brief System Clock Configuration - * @retval None - */ -void SystemClock_Config(void) -{ - RCC_OscInitTypeDef RCC_OscInitStruct = {0}; - RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; - - /** Configure the main internal regulator output voltage - */ - __HAL_RCC_PWR_CLK_ENABLE(); - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - /** Initializes the RCC Oscillators according to the specified parameters - * in the RCC_OscInitTypeDef structure. - */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; - RCC_OscInitStruct.HSIState = RCC_HSI_ON; - RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; - RCC_OscInitStruct.PLL.PLLM = 8; - RCC_OscInitStruct.PLL.PLLN = 100; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 4; - RCC_OscInitStruct.PLL.PLLR = 2; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) - { - Error_Handler(); - } - /** Initializes the CPU, AHB and APB buses clocks - */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK - | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK) - { - Error_Handler(); - } -} - -/* USER CODE BEGIN 4 */ - -/* USER CODE END 4 */ - -/** - * @brief This function is executed in case of error occurrence. - * @retval None - */ -void Error_Handler(void) -{ - /* USER CODE BEGIN Error_Handler_Debug */ - /* User can add his own implementation to report the HAL error return state */ - __disable_irq(); - while (1) - { - } - /* USER CODE END Error_Handler_Debug */ -} - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t *file, uint32_t line) -{ - /* USER CODE BEGIN 6 */ - /* User can add his own implementation to report the file name and line number, - ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ - /* USER CODE END 6 */ -} -#endif /* USE_FULL_ASSERT */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/stm32f4xx_hal_msp.c b/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/stm32f4xx_hal_msp.c deleted file mode 100644 index a182b75ef..000000000 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/stm32f4xx_hal_msp.c +++ /dev/null @@ -1,84 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f4xx_hal_msp.c - * @brief This file provides code for the MSP Initialization - * and de-Initialization codes. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN Define */ - -/* USER CODE END Define */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN Macro */ - -/* USER CODE END Macro */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* External functions --------------------------------------------------------*/ -/* USER CODE BEGIN ExternalFunctions */ - -/* USER CODE END ExternalFunctions */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ -/** - * Initializes the Global MSP. - */ -void HAL_MspInit(void) -{ - /* USER CODE BEGIN MspInit 0 */ - - /* USER CODE END MspInit 0 */ - - __HAL_RCC_SYSCFG_CLK_ENABLE(); - __HAL_RCC_PWR_CLK_ENABLE(); - - /* System interrupt init*/ - - /* USER CODE BEGIN MspInit 1 */ - - /* USER CODE END MspInit 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/stm32f4xx_it.c b/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/stm32f4xx_it.c deleted file mode 100644 index 0089a2909..000000000 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/stm32f4xx_it.c +++ /dev/null @@ -1,219 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f4xx_it.c - * @brief Interrupt Service Routines. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "stm32f4xx_it.h" -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* External variables --------------------------------------------------------*/ - -/* USER CODE BEGIN EV */ - -/* USER CODE END EV */ - -/******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ -/******************************************************************************/ -/** - * @brief This function handles Non maskable interrupt. - */ -void NMI_Handler(void) -{ - /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ - - /* USER CODE END NonMaskableInt_IRQn 0 */ - /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ - while (1) - { - } - /* USER CODE END NonMaskableInt_IRQn 1 */ -} - -/** - * @brief This function handles Hard fault interrupt. - */ -void HardFault_Handler(void) -{ - /* USER CODE BEGIN HardFault_IRQn 0 */ - - /* USER CODE END HardFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_HardFault_IRQn 0 */ - /* USER CODE END W1_HardFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Memory management fault. - */ -void MemManage_Handler(void) -{ - /* USER CODE BEGIN MemoryManagement_IRQn 0 */ - - /* USER CODE END MemoryManagement_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ - /* USER CODE END W1_MemoryManagement_IRQn 0 */ - } -} - -/** - * @brief This function handles Pre-fetch fault, memory access fault. - */ -void BusFault_Handler(void) -{ - /* USER CODE BEGIN BusFault_IRQn 0 */ - - /* USER CODE END BusFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_BusFault_IRQn 0 */ - /* USER CODE END W1_BusFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Undefined instruction or illegal state. - */ -void UsageFault_Handler(void) -{ - /* USER CODE BEGIN UsageFault_IRQn 0 */ - - /* USER CODE END UsageFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ - /* USER CODE END W1_UsageFault_IRQn 0 */ - } -} - -/** - * @brief This function handles System service call via SWI instruction. - */ -void SVC_Handler(void) -{ - /* USER CODE BEGIN SVCall_IRQn 0 */ - - /* USER CODE END SVCall_IRQn 0 */ - /* USER CODE BEGIN SVCall_IRQn 1 */ - - /* USER CODE END SVCall_IRQn 1 */ -} - -/** - * @brief This function handles Debug monitor. - */ -void DebugMon_Handler(void) -{ - /* USER CODE BEGIN DebugMonitor_IRQn 0 */ - - /* USER CODE END DebugMonitor_IRQn 0 */ - /* USER CODE BEGIN DebugMonitor_IRQn 1 */ - - /* USER CODE END DebugMonitor_IRQn 1 */ -} - -/** - * @brief This function handles Pendable request for system service. - */ -void PendSV_Handler(void) -{ - /* USER CODE BEGIN PendSV_IRQn 0 */ - - /* USER CODE END PendSV_IRQn 0 */ - /* USER CODE BEGIN PendSV_IRQn 1 */ - - /* USER CODE END PendSV_IRQn 1 */ -} - -/** - * @brief This function handles System tick timer. - */ -void SysTick_Handler(void) -{ - /* USER CODE BEGIN SysTick_IRQn 0 */ - - /* USER CODE END SysTick_IRQn 0 */ - HAL_IncTick(); - /* USER CODE BEGIN SysTick_IRQn 1 */ - - /* USER CODE END SysTick_IRQn 1 */ -} - -/******************************************************************************/ -/* STM32F4xx Peripheral Interrupt Handlers */ -/* Add here the Interrupt Handlers for the used peripherals. */ -/* For the available peripheral interrupt handler names, */ -/* please refer to the startup file (startup_stm32f4xx.s). */ -/******************************************************************************/ - -/* USER CODE BEGIN 1 */ -void EXTI4_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_4); -} - -void EXTI9_5_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_5); -} - -void EXTI15_10_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_10); -} -/* USER CODE END 1 */ -/* USER CODE END 1 */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/system_stm32f4xx.c b/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/system_stm32f4xx.c deleted file mode 100644 index 4bd94b338..000000000 --- a/examples/projects/NUCLEO-F410RB/inspector_serialcom/src/system_stm32f4xx.c +++ /dev/null @@ -1,730 +0,0 @@ -/** - ****************************************************************************** - * @file system_stm32f4xx.c - * @author MCD Application Team - * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File. - * - * This file provides two functions and one global variable to be called from - * user application: - * - SystemInit(): This function is called at startup just after reset and - * before branch to main program. This call is made inside - * the "startup_stm32f4xx.s" file. - * - * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick - * timer or configure other parameters. - * - * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must - * be called whenever the core clock is changed - * during program execution. - * - * - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/** @addtogroup CMSIS - * @{ - */ - -/** @addtogroup stm32f4xx_system - * @{ - */ - -/** @addtogroup STM32F4xx_System_Private_Includes - * @{ - */ - -#include "stm32f4xx.h" - -#if !defined(HSE_VALUE) -#define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined(HSI_VALUE) -#define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_TypesDefinitions - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Defines - * @{ - */ - -/************************* Miscellaneous Configuration ************************/ -/*!< Uncomment the following line if you need to use external SRAM or SDRAM as data memory */ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) \ - || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) -/* #define DATA_IN_ExtSRAM */ -#endif /* STM32F40xxx || STM32F41xxx || STM32F42xxx || STM32F43xxx || STM32F469xx || STM32F479xx || \ - STM32F412Zx || STM32F412Vx */ - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) -/* #define DATA_IN_ExtSDRAM */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || \ - STM32F479xx */ - -/*!< Uncomment the following line if you need to relocate your vector Table in - Internal SRAM. */ -/* #define VECT_TAB_SRAM */ -#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. \ - This value must be a multiple of 0x200. */ -/******************************************************************************/ -/** - * @} - */ -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Macros - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Variables - * @{ - */ -/* This variable is updated in three ways: - 1) by calling CMSIS function SystemCoreClockUpdate() - 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency - Note: If you use this function to configure the system clock; then there - is no need to call the 2 first functions listed above, since SystemCoreClock - variable is updated automatically. - */ -uint32_t SystemCoreClock = 16000000; -const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; -const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_FunctionPrototypes - * @{ - */ - -#if defined(DATA_IN_ExtSRAM) || defined(DATA_IN_ExtSDRAM) -static void SystemInit_ExtMemCtl(void); -#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Functions - * @{ - */ - -/** - * @brief Setup the microcontroller system - * Initialize the FPU setting, vector table location and External memory - * configuration. - * @param None - * @retval None - */ -void SystemInit(void) -{ -/* FPU settings ------------------------------------------------------------*/ -#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) - SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10 and CP11 Full Access */ -#endif - -#if defined(DATA_IN_ExtSRAM) || defined(DATA_IN_ExtSDRAM) - SystemInit_ExtMemCtl(); -#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ - - /* Configure the Vector Table location add offset address ------------------*/ -#ifdef VECT_TAB_SRAM - SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ -#else - SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ -#endif -} - -/** - * @brief Update SystemCoreClock variable according to Clock Register Values. - * The SystemCoreClock variable contains the core clock (HCLK), it can - * be used by the user application to setup the SysTick timer or configure - * other parameters. - * - * @note Each time the core clock (HCLK) changes, this function must be called - * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined - * constant and the selected clock source: - * - * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) - * - * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) - * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * - * (*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value - * 16 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * - * (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (its value - * depends on the application requirements), user has to ensure that HSE_VALUE - * is same as the real frequency of the crystal used. Otherwise, this function - * may have wrong result. - * - * - The result of this function could be not correct when using fractional - * value for HSE crystal. - * - * @param None - * @retval None - */ -void SystemCoreClockUpdate(void) -{ - uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; - - /* Get SYSCLK source -------------------------------------------------------*/ - tmp = RCC->CFGR & RCC_CFGR_SWS; - - switch (tmp) - { - case 0x00: /* HSI used as system clock source */ - SystemCoreClock = HSI_VALUE; - break; - case 0x04: /* HSE used as system clock source */ - SystemCoreClock = HSE_VALUE; - break; - case 0x08: /* PLL used as system clock source */ - - /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N - SYSCLK = PLL_VCO / PLL_P - */ - pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22; - pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; - - if (pllsource != 0) - { - /* HSE used as PLL clock source */ - pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); - } - else - { - /* HSI used as PLL clock source */ - pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); - } - - pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >> 16) + 1) * 2; - SystemCoreClock = pllvco / pllp; - break; - default: - SystemCoreClock = HSI_VALUE; - break; - } - /* Compute HCLK frequency --------------------------------------------------*/ - /* Get HCLK prescaler */ - tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; - /* HCLK frequency */ - SystemCoreClock >>= tmp; -} - -#if defined(DATA_IN_ExtSRAM) && defined(DATA_IN_ExtSDRAM) -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F469xx) || defined(STM32F479xx) -/** - * @brief Setup the external memory controller. - * Called in startup_stm32f4xx.s before jump to main. - * This function configures the external memories (SRAM/SDRAM) - * This SRAM/SDRAM will be used as program data memory (including heap and stack). - * @param None - * @retval None - */ -void SystemInit_ExtMemCtl(void) -{ - __IO uint32_t tmp = 0x00; - - register uint32_t tmpreg = 0, timeout = 0xFFFF; - register __IO uint32_t index; - - /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface clock */ - RCC->AHB1ENR |= 0x000001F8; - - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - - /* Connect PDx pins to FMC Alternate function */ - GPIOD->AFR[0] = 0x00CCC0CC; - GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ - GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ - GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ - GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOD->PUPDR = 0x00000000; - - /* Connect PEx pins to FMC Alternate function */ - GPIOE->AFR[0] = 0xC00CC0CC; - GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ - GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ - GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ - GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ - GPIOE->PUPDR = 0x00000000; - - /* Connect PFx pins to FMC Alternate function */ - GPIOF->AFR[0] = 0xCCCCCCCC; - GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ - GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ - GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ - GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ - GPIOF->PUPDR = 0x00000000; - - /* Connect PGx pins to FMC Alternate function */ - GPIOG->AFR[0] = 0xCCCCCCCC; - GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ - GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ - GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ - GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ - GPIOG->PUPDR = 0x00000000; - - /* Connect PHx pins to FMC Alternate function */ - GPIOH->AFR[0] = 0x00C0CC00; - GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ - GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ - GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ - GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ - GPIOH->PUPDR = 0x00000000; - - /* Connect PIx pins to FMC Alternate function */ - GPIOI->AFR[0] = 0xCCCCCCCC; - GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ - GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ - GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ - GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ - GPIOI->PUPDR = 0x00000000; - - /*-- FMC Configuration -------------------------------------------------------*/ - /* Enable the FMC interface clock */ - RCC->AHB3ENR |= 0x00000001; - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - - FMC_Bank5_6->SDCR[0] = 0x000019E4; - FMC_Bank5_6->SDTR[0] = 0x01115351; - - /* SDRAM initialization sequence */ - /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Delay */ - for (index = 0; index < 1000; index++) - ; - - /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Auto refresh command */ - FMC_Bank5_6->SDCMR = 0x00000073; - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* MRD register program */ - FMC_Bank5_6->SDCMR = 0x00046014; - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Set refresh count */ - tmpreg = FMC_Bank5_6->SDRTR; - FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C << 1)); - - /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; - FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001011; - FMC_Bank1->BTCR[3] = 0x00000201; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ -#if defined(STM32F469xx) || defined(STM32F479xx) - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001091; - FMC_Bank1->BTCR[3] = 0x00110212; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F469xx || STM32F479xx */ - - (void)(tmp); -} -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ -#elif defined(DATA_IN_ExtSRAM) || defined(DATA_IN_ExtSDRAM) -/** - * @brief Setup the external memory controller. - * Called in startup_stm32f4xx.s before jump to main. - * This function configures the external memories (SRAM/SDRAM) - * This SRAM/SDRAM will be used as program data memory (including heap and stack). - * @param None - * @retval None - */ -void SystemInit_ExtMemCtl(void) -{ - __IO uint32_t tmp = 0x00; -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) -#if defined(DATA_IN_ExtSDRAM) - register uint32_t tmpreg = 0, timeout = 0xFFFF; - register __IO uint32_t index; - -#if defined(STM32F446xx) - /* Enable GPIOA, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG interface - clock */ - RCC->AHB1ENR |= 0x0000007D; -#else - /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface - clock */ - RCC->AHB1ENR |= 0x000001F8; -#endif /* STM32F446xx */ - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - -#if defined(STM32F446xx) - /* Connect PAx pins to FMC Alternate function */ - GPIOA->AFR[0] |= 0xC0000000; - GPIOA->AFR[1] |= 0x00000000; - /* Configure PDx pins in Alternate function mode */ - GPIOA->MODER |= 0x00008000; - /* Configure PDx pins speed to 50 MHz */ - GPIOA->OSPEEDR |= 0x00008000; - /* Configure PDx pins Output type to push-pull */ - GPIOA->OTYPER |= 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOA->PUPDR |= 0x00000000; - - /* Connect PCx pins to FMC Alternate function */ - GPIOC->AFR[0] |= 0x00CC0000; - GPIOC->AFR[1] |= 0x00000000; - /* Configure PDx pins in Alternate function mode */ - GPIOC->MODER |= 0x00000A00; - /* Configure PDx pins speed to 50 MHz */ - GPIOC->OSPEEDR |= 0x00000A00; - /* Configure PDx pins Output type to push-pull */ - GPIOC->OTYPER |= 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOC->PUPDR |= 0x00000000; -#endif /* STM32F446xx */ - - /* Connect PDx pins to FMC Alternate function */ - GPIOD->AFR[0] = 0x000000CC; - GPIOD->AFR[1] = 0xCC000CCC; - /* Configure PDx pins in Alternate function mode */ - GPIOD->MODER = 0xA02A000A; - /* Configure PDx pins speed to 50 MHz */ - GPIOD->OSPEEDR = 0xA02A000A; - /* Configure PDx pins Output type to push-pull */ - GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOD->PUPDR = 0x00000000; - - /* Connect PEx pins to FMC Alternate function */ - GPIOE->AFR[0] = 0xC00000CC; - GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ - GPIOE->MODER = 0xAAAA800A; - /* Configure PEx pins speed to 50 MHz */ - GPIOE->OSPEEDR = 0xAAAA800A; - /* Configure PEx pins Output type to push-pull */ - GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ - GPIOE->PUPDR = 0x00000000; - - /* Connect PFx pins to FMC Alternate function */ - GPIOF->AFR[0] = 0xCCCCCCCC; - GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ - GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ - GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ - GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ - GPIOF->PUPDR = 0x00000000; - - /* Connect PGx pins to FMC Alternate function */ - GPIOG->AFR[0] = 0xCCCCCCCC; - GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ - GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ - GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ - GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ - GPIOG->PUPDR = 0x00000000; - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F469xx) || defined(STM32F479xx) - /* Connect PHx pins to FMC Alternate function */ - GPIOH->AFR[0] = 0x00C0CC00; - GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ - GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ - GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ - GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ - GPIOH->PUPDR = 0x00000000; - - /* Connect PIx pins to FMC Alternate function */ - GPIOI->AFR[0] = 0xCCCCCCCC; - GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ - GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ - GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ - GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ - GPIOI->PUPDR = 0x00000000; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ - - /*-- FMC Configuration -------------------------------------------------------*/ - /* Enable the FMC interface clock */ - RCC->AHB3ENR |= 0x00000001; - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - - /* Configure and enable SDRAM bank1 */ -#if defined(STM32F446xx) - FMC_Bank5_6->SDCR[0] = 0x00001954; -#else - FMC_Bank5_6->SDCR[0] = 0x000019E4; -#endif /* STM32F446xx */ - FMC_Bank5_6->SDTR[0] = 0x01115351; - - /* SDRAM initialization sequence */ - /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Delay */ - for (index = 0; index < 1000; index++) - ; - - /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Auto refresh command */ -#if defined(STM32F446xx) - FMC_Bank5_6->SDCMR = 0x000000F3; -#else - FMC_Bank5_6->SDCMR = 0x00000073; -#endif /* STM32F446xx */ - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* MRD register program */ -#if defined(STM32F446xx) - FMC_Bank5_6->SDCMR = 0x00044014; -#else - FMC_Bank5_6->SDCMR = 0x00046014; -#endif /* STM32F446xx */ - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Set refresh count */ - tmpreg = FMC_Bank5_6->SDRTR; -#if defined(STM32F446xx) - FMC_Bank5_6->SDRTR = (tmpreg | (0x0000050C << 1)); -#else - FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C << 1)); -#endif /* STM32F446xx */ - - /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; - FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); -#endif /* DATA_IN_ExtSDRAM */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */ - -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) \ - || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) - -#if defined(DATA_IN_ExtSRAM) - /*-- GPIOs Configuration -----------------------------------------------------*/ - /* Enable GPIOD, GPIOE, GPIOF and GPIOG interface clock */ - RCC->AHB1ENR |= 0x00000078; - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN); - - /* Connect PDx pins to FMC Alternate function */ - GPIOD->AFR[0] = 0x00CCC0CC; - GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ - GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ - GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ - GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOD->PUPDR = 0x00000000; - - /* Connect PEx pins to FMC Alternate function */ - GPIOE->AFR[0] = 0xC00CC0CC; - GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ - GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ - GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ - GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ - GPIOE->PUPDR = 0x00000000; - - /* Connect PFx pins to FMC Alternate function */ - GPIOF->AFR[0] = 0x00CCCCCC; - GPIOF->AFR[1] = 0xCCCC0000; - /* Configure PFx pins in Alternate function mode */ - GPIOF->MODER = 0xAA000AAA; - /* Configure PFx pins speed to 100 MHz */ - GPIOF->OSPEEDR = 0xFF000FFF; - /* Configure PFx pins Output type to push-pull */ - GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ - GPIOF->PUPDR = 0x00000000; - - /* Connect PGx pins to FMC Alternate function */ - GPIOG->AFR[0] = 0x00CCCCCC; - GPIOG->AFR[1] = 0x000000C0; - /* Configure PGx pins in Alternate function mode */ - GPIOG->MODER = 0x00085AAA; - /* Configure PGx pins speed to 100 MHz */ - GPIOG->OSPEEDR = 0x000CAFFF; - /* Configure PGx pins Output type to push-pull */ - GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ - GPIOG->PUPDR = 0x00000000; - - /*-- FMC/FSMC Configuration --------------------------------------------------*/ - /* Enable the FMC/FSMC interface clock */ - RCC->AHB3ENR |= 0x00000001; - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001011; - FMC_Bank1->BTCR[3] = 0x00000201; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ -#if defined(STM32F469xx) || defined(STM32F479xx) - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001091; - FMC_Bank1->BTCR[3] = 0x00110212; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F469xx || STM32F479xx */ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) \ - || defined(STM32F412Zx) || defined(STM32F412Vx) - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FSMCEN); - /* Configure and enable Bank1_SRAM2 */ - FSMC_Bank1->BTCR[2] = 0x00001011; - FSMC_Bank1->BTCR[3] = 0x00000201; - FSMC_Bank1E->BWTR[2] = 0x0FFFFFFF; -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F412Zx || STM32F412Vx */ - -#endif /* DATA_IN_ExtSRAM */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || \ - STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */ - (void)(tmp); -} -#endif /* DATA_IN_ExtSRAM && DATA_IN_ExtSDRAM */ -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/Inspector_SerialCom.ioc b/examples/projects/NUCLEO-G431KB/inspector_serialcom/Inspector_SerialCom.ioc deleted file mode 100644 index 7b2192718..000000000 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/Inspector_SerialCom.ioc +++ /dev/null @@ -1,119 +0,0 @@ -#MicroXplorer Configuration settings - do not modify -File.Version=6 -GPIO.groupedBy= -KeepUserPlacement=false -Mcu.Family=STM32G4 -Mcu.IP0=NVIC -Mcu.IP1=RCC -Mcu.IP2=SYS -Mcu.IPNb=3 -Mcu.Name=STM32G431K(6-8-B)Tx -Mcu.Package=LQFP32 -Mcu.Pin0=PA11 -Mcu.Pin1=PB8-BOOT0 -Mcu.Pin2=VP_SYS_VS_Systick -Mcu.Pin3=VP_SYS_VS_DBSignals -Mcu.PinsNb=4 -Mcu.ThirdPartyNb=0 -Mcu.UserConstants= -Mcu.UserName=STM32G431KBTx -MxCube.Version=6.1.1 -MxDb.Version=DB.6.0.10 -NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.ForceEnableDMAVector=true -NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 -NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true -NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -PA11.GPIOParameters=GPIO_Label -PA11.GPIO_Label=BTN -PA11.Locked=true -PA11.Signal=GPIO_Input -PB8-BOOT0.GPIOParameters=GPIO_PuPd,GPIO_Label -PB8-BOOT0.GPIO_Label=LED -PB8-BOOT0.GPIO_PuPd=GPIO_PULLDOWN -PB8-BOOT0.Locked=true -PB8-BOOT0.Signal=GPIO_Output -PinOutPanel.RotationAngle=0 -ProjectManager.AskForMigrate=true -ProjectManager.BackupPrevious=false -ProjectManager.CompilerOptimize=6 -ProjectManager.ComputerToolchain=false -ProjectManager.CoupleFile=true -ProjectManager.CustomerFirmwarePackage= -ProjectManager.DefaultFWLocation=true -ProjectManager.DeletePrevious=true -ProjectManager.DeviceId=STM32G431KBTx -ProjectManager.FirmwarePackage=STM32Cube FW_G4 V1.3.0 -ProjectManager.FreePins=false -ProjectManager.HalAssertFull=false -ProjectManager.HeapSize=0x0 -ProjectManager.KeepUserCode=true -ProjectManager.LastFirmware=true -ProjectManager.LibraryCopy=1 -ProjectManager.MainLocation=Src -ProjectManager.NoMain=false -ProjectManager.PreviousToolchain= -ProjectManager.ProjectBuild=false -ProjectManager.ProjectFileName=Button.ioc -ProjectManager.ProjectName=Button -ProjectManager.RegisterCallBack= -ProjectManager.StackSize=0x400 -ProjectManager.TargetToolchain=Other Toolchains (GPDSC) -ProjectManager.ToolChainLocation= -ProjectManager.UnderRoot=false -ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false -RCC.ADC12Freq_Value=170000000 -RCC.AHBFreq_Value=170000000 -RCC.APB1Freq_Value=170000000 -RCC.APB1TimFreq_Value=170000000 -RCC.APB2Freq_Value=170000000 -RCC.APB2TimFreq_Value=170000000 -RCC.CRSFreq_Value=48000000 -RCC.CortexFreq_Value=170000000 -RCC.EXTERNAL_CLOCK_VALUE=12288000 -RCC.FCLKCortexFreq_Value=170000000 -RCC.FDCANFreq_Value=170000000 -RCC.FamilyName=M -RCC.HCLKFreq_Value=170000000 -RCC.HSE_VALUE=8000000 -RCC.HSI48_VALUE=48000000 -RCC.HSI_VALUE=16000000 -RCC.I2C1Freq_Value=170000000 -RCC.I2C2Freq_Value=170000000 -RCC.I2C3Freq_Value=170000000 -RCC.I2SFreq_Value=170000000 -RCC.IPParameters=ADC12Freq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CRSFreq_Value,CortexFreq_Value,EXTERNAL_CLOCK_VALUE,FCLKCortexFreq_Value,FDCANFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,I2SFreq_Value,LPTIM1Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLM,PLLN,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,UART4Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value -RCC.LPTIM1Freq_Value=170000000 -RCC.LPUART1Freq_Value=170000000 -RCC.LSCOPinFreq_Value=32000 -RCC.LSE_VALUE=32768 -RCC.LSI_VALUE=32000 -RCC.MCO1PinFreq_Value=16000000 -RCC.PLLM=RCC_PLLM_DIV4 -RCC.PLLN=85 -RCC.PLLPoutputFreq_Value=170000000 -RCC.PLLQoutputFreq_Value=170000000 -RCC.PLLRCLKFreq_Value=170000000 -RCC.PWRFreq_Value=170000000 -RCC.RNGFreq_Value=170000000 -RCC.SAI1Freq_Value=170000000 -RCC.SYSCLKFreq_VALUE=170000000 -RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK -RCC.UART4Freq_Value=170000000 -RCC.USART1Freq_Value=170000000 -RCC.USART2Freq_Value=170000000 -RCC.USART3Freq_Value=170000000 -RCC.USBFreq_Value=170000000 -RCC.VCOInputFreq_Value=4000000 -RCC.VCOOutputFreq_Value=340000000 -VP_SYS_VS_DBSignals.Mode=DisableDeadBatterySignals -VP_SYS_VS_DBSignals.Signal=SYS_VS_DBSignals -VP_SYS_VS_Systick.Mode=SysTick -VP_SYS_VS_Systick.Signal=SYS_VS_Systick -board=custom diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/include/gpio.h b/examples/projects/NUCLEO-G431KB/inspector_serialcom/include/gpio.h deleted file mode 100644 index f57136410..000000000 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/include/gpio.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.h - * @brief This file contains all the function prototypes for - * the gpio.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __GPIO_H__ -#define __GPIO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - - void MX_GPIO_Init(void); - - /* USER CODE BEGIN Prototypes */ - - /* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif -#endif /*__ GPIO_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/include/main.h b/examples/projects/NUCLEO-G431KB/inspector_serialcom/include/main.h deleted file mode 100644 index 07b538b28..000000000 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/include/main.h +++ /dev/null @@ -1,76 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.h - * @brief : Header for main.c file. - * This file contains the common defines of the application. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __MAIN_H -#define __MAIN_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "stm32g4xx_hal.h" - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void Error_Handler(void); - -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -/* Private defines -----------------------------------------------------------*/ -#define BTN_Pin GPIO_PIN_11 -#define BTN_GPIO_Port GPIOA -#define LED_Pin GPIO_PIN_8 -#define LED_GPIO_Port GPIOB - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - -#ifdef __cplusplus -} -#endif - -#endif /* __MAIN_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/include/stm32g4xx_hal_conf.h b/examples/projects/NUCLEO-G431KB/inspector_serialcom/include/stm32g4xx_hal_conf.h deleted file mode 100644 index 64c09f021..000000000 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/include/stm32g4xx_hal_conf.h +++ /dev/null @@ -1,382 +0,0 @@ -/** - ****************************************************************************** - * @file stm32g4xx_hal_conf.h - * @author MCD Application Team - * @brief HAL configuration file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2019 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef STM32G4xx_HAL_CONF_H -#define STM32G4xx_HAL_CONF_H - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Exported types ------------------------------------------------------------*/ - /* Exported constants --------------------------------------------------------*/ - - /* ########################## Module Selection ############################## */ - /** - * @brief This is the list of modules to be used in the HAL driver - */ - -#define HAL_MODULE_ENABLED - - /*#define HAL_ADC_MODULE_ENABLED */ -/*#define HAL_COMP_MODULE_ENABLED */ -/*#define HAL_CORDIC_MODULE_ENABLED */ -/*#define HAL_CRYP_MODULE_ENABLED */ -/*#define HAL_DAC_MODULE_ENABLED */ -/*#define HAL_FDCAN_MODULE_ENABLED */ -/*#define HAL_FMAC_MODULE_ENABLED */ -/*#define HAL_HRTIM_MODULE_ENABLED */ -/*#define HAL_IRDA_MODULE_ENABLED */ -/*#define HAL_IWDG_MODULE_ENABLED */ -/*#define HAL_I2C_MODULE_ENABLED */ -/*#define HAL_I2S_MODULE_ENABLED */ -/*#define HAL_LPTIM_MODULE_ENABLED */ -/*#define HAL_NAND_MODULE_ENABLED */ -/*#define HAL_NOR_MODULE_ENABLED */ -/*#define HAL_OPAMP_MODULE_ENABLED */ -/*#define HAL_PCD_MODULE_ENABLED */ -/*#define HAL_QSPI_MODULE_ENABLED */ -/*#define HAL_RNG_MODULE_ENABLED */ -/*#define HAL_RTC_MODULE_ENABLED */ -/*#define HAL_SAI_MODULE_ENABLED */ -/*#define HAL_SMARTCARD_MODULE_ENABLED */ -/*#define HAL_SMBUS_MODULE_ENABLED */ -/*#define HAL_SPI_MODULE_ENABLED */ -/*#define HAL_SRAM_MODULE_ENABLED */ -/*#define HAL_WWDG_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_CRC_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED - -/* ########################## Register Callbacks selection ############################## */ -/** - * @brief This is the list of modules where register callback can be used - */ -#define USE_HAL_ADC_REGISTER_CALLBACKS 0U -#define USE_HAL_COMP_REGISTER_CALLBACKS 0U -#define USE_HAL_CORDIC_REGISTER_CALLBACKS 0U -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U -#define USE_HAL_DAC_REGISTER_CALLBACKS 0U -#define USE_HAL_EXTI_REGISTER_CALLBACKS 0U -#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U -#define USE_HAL_FMAC_REGISTER_CALLBACKS 0U -#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U -#define USE_HAL_I2C_REGISTER_CALLBACKS 0U -#define USE_HAL_I2S_REGISTER_CALLBACKS 0U -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U -#define USE_HAL_NAND_REGISTER_CALLBACKS 0U -#define USE_HAL_NOR_REGISTER_CALLBACKS 0U -#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U -#define USE_HAL_PCD_REGISTER_CALLBACKS 0U -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U -#define USE_HAL_RNG_REGISTER_CALLBACKS 0U -#define USE_HAL_RTC_REGISTER_CALLBACKS 0U -#define USE_HAL_SAI_REGISTER_CALLBACKS 0U -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U -#define USE_HAL_SPI_REGISTER_CALLBACKS 0U -#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U -#define USE_HAL_TIM_REGISTER_CALLBACKS 0U -#define USE_HAL_UART_REGISTER_CALLBACKS 0U -#define USE_HAL_USART_REGISTER_CALLBACKS 0U -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U - -/* ########################## Oscillator Values adaptation ####################*/ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined(HSE_VALUE) -#define HSE_VALUE (8000000UL) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined(HSE_STARTUP_TIMEOUT) -#define HSE_STARTUP_TIMEOUT (100UL) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined(HSI_VALUE) -#define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal High Speed oscillator (HSI48) value for USB FS and RNG. - * This internal oscillator is mainly dedicated to provide a high precision clock to - * the USB peripheral by means of a special Clock Recovery System (CRS) circuitry. - * When the CRS is not used, the HSI48 RC oscillator runs on it default frequency - * which is subject to manufacturing process variations. - */ -#if !defined(HSI48_VALUE) -#define HSI48_VALUE (48000000UL) /*!< Value of the Internal High Speed oscillator for USB FS/RNG in Hz. \ - The real value my vary depending on manufacturing process variations.*/ -#endif /* HSI48_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined(LSI_VALUE) -/*!< Value of the Internal Low Speed oscillator in Hz -The real value may vary depending on the variations in voltage and temperature.*/ -#define LSI_VALUE (32000UL) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ -/** - * @brief External Low Speed oscillator (LSE) value. - * This value is used by the UART, RTC HAL module to compute the system frequency - */ -#if !defined(LSE_VALUE) -#define LSE_VALUE (32768UL) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined(LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT (5000UL) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S and SAI peripherals - * This value is used by the I2S and SAI HAL modules to compute the I2S and SAI clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined(EXTERNAL_CLOCK_VALUE) -#define EXTERNAL_CLOCK_VALUE (12288000UL) /*!< Value of the External oscillator in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - - /* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - - /* ########################### System Configuration ######################### */ - /** - * @brief This is the HAL system configuration section - */ - -#define VDD_VALUE (3300UL) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY (0UL) /*!< tick interrupt priority (lowest by default) */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 0U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - - /* ########################## Assert Selection ############################## */ - /** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ - /* #define USE_FULL_ASSERT 1U */ - - /* ################## SPI peripheral configuration ########################## */ - - /* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver - * Activated: CRC code is present inside driver - * Deactivated: CRC code cleaned from driver - */ - -#define USE_SPI_CRC 0U - - /* Includes ------------------------------------------------------------------*/ - /** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED -#include "stm32g4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED -#include "stm32g4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED -#include "stm32g4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED -#include "stm32g4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED -#include "stm32g4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_COMP_MODULE_ENABLED -#include "stm32g4xx_hal_comp.h" -#endif /* HAL_COMP_MODULE_ENABLED */ - -#ifdef HAL_CORDIC_MODULE_ENABLED -#include "stm32g4xx_hal_cordic.h" -#endif /* HAL_CORDIC_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED -#include "stm32g4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED -#include "stm32g4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED -#include "stm32g4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED -#include "stm32g4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_FDCAN_MODULE_ENABLED -#include "stm32g4xx_hal_fdcan.h" -#endif /* HAL_FDCAN_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED -#include "stm32g4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_FMAC_MODULE_ENABLED -#include "stm32g4xx_hal_fmac.h" -#endif /* HAL_FMAC_MODULE_ENABLED */ - -#ifdef HAL_HRTIM_MODULE_ENABLED -#include "stm32g4xx_hal_hrtim.h" -#endif /* HAL_HRTIM_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED -#include "stm32g4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED -#include "stm32g4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED -#include "stm32g4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED -#include "stm32g4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED -#include "stm32g4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED -#include "stm32g4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED -#include "stm32g4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_OPAMP_MODULE_ENABLED -#include "stm32g4xx_hal_opamp.h" -#endif /* HAL_OPAMP_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED -#include "stm32g4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED -#include "stm32g4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED -#include "stm32g4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED -#include "stm32g4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED -#include "stm32g4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED -#include "stm32g4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED -#include "stm32g4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED -#include "stm32g4xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED -#include "stm32g4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED -#include "stm32g4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED -#include "stm32g4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED -#include "stm32g4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED -#include "stm32g4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED -#include "stm32g4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) - /* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t *file, uint32_t line); -#else -#define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* STM32G4xx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/include/stm32g4xx_it.h b/examples/projects/NUCLEO-G431KB/inspector_serialcom/include/stm32g4xx_it.h deleted file mode 100644 index 3e1e449a2..000000000 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/include/stm32g4xx_it.h +++ /dev/null @@ -1,70 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32g4xx_it.h - * @brief This file contains the headers of the interrupt handlers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32G4xx_IT_H -#define __STM32G4xx_IT_H - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void NMI_Handler(void); - void HardFault_Handler(void); - void MemManage_Handler(void); - void BusFault_Handler(void); - void UsageFault_Handler(void); - void SVC_Handler(void); - void DebugMon_Handler(void); - void PendSV_Handler(void); - void SysTick_Handler(void); - /* USER CODE BEGIN EFP */ - - /* USER CODE END EFP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32G4xx_IT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/linker/custom_Luos_bootloader_script.ld b/examples/projects/NUCLEO-G431KB/inspector_serialcom/linker/custom_Luos_bootloader_script.ld deleted file mode 100644 index fec64429b..000000000 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/linker/custom_Luos_bootloader_script.ld +++ /dev/null @@ -1,175 +0,0 @@ -/** - ****************************************************************************** - * @file LinkerScript.ld - * @author Auto-generated by STM32CubeIDE - * @brief Linker script for STM32G431KBTx Device from STM32G4 series - * 128Kbytes FLASH - * 32Kbytes RAM - * - * Set heap size, stack size and stack location according - * to application requirements. - * - * Set memory bank area and size if external memory is used - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ - -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Memories definition */ -MEMORY -{ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K - FLASH (rx) : ORIGIN = 0x0800C800, LENGTH = 78K -} - -/* Sections */ -SECTIONS -{ - /* The startup code into "FLASH" Rom type memory */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data into "FLASH" Rom type memory */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data into "FLASH" Rom type memory */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { - . = ALIGN(4); - *(.ARM.extab* .gnu.linkonce.armextab.*) - . = ALIGN(4); - } >FLASH - - .ARM : { - . = ALIGN(4); - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - . = ALIGN(4); - } >FLASH - - .preinit_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - . = ALIGN(4); - } >FLASH - - .init_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - . = ALIGN(4); - } >FLASH - - .fini_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - . = ALIGN(4); - } >FLASH - - /* Used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections into "RAM" Ram type memory */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - - } >RAM AT> FLASH - - /* Uninitialized data section into "RAM" Ram type memory */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - /* Remove information from the compiler libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h deleted file mode 100644 index 528815815..000000000 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/node_config.h +++ /dev/null @@ -1,116 +0,0 @@ -/****************************************************************************** - * @file node_config.h - * @brief This file allow you to use standard preprocessor definitions to - * configure your project, Luos and Luos HAL libraries - * - * # Introduction - * This file is for the luos user. You may here configure your project and - * define your custom Luos service and custom Luos command for your product - * - * Luos libraries offer a minimal standard configuration to optimize - * memory usage. In some case you have to modify standard value to fit - * with your need concerning among of data transiting through the network - * or network speed for example - * - * Luos libraries can be use with a lot a MCU family. Luos compagny give you - * a default configuration, for specific MCU family, in robus_hal_config.h. - * This configuration can be modify here to fit with you design by - * preprocessor definitions of MCU Hardware needs - * - * # Usage - * This file should be place a the root folder of your project and include - * where build flag preprocessor definitions are define in your IDE - * -include node_config.h - * - * @author Luos - * @version 0.0.0 - ******************************************************************************/ -#ifndef _NODE_CONFIG_H_ -#define _NODE_CONFIG_H_ - -/******************************************************************************* - * PROJECT DEFINITION - *******************************************************************************/ - -/******************************************************************************* - * LUOS LIBRARY DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node - * MAX_NODE_NUMBER. | 20 | Node number in the device - * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * NBR_PORT | 2 | PTP Branch number Max 8 - * NBR_RETRY | 10 | Send Retry number in case of NACK or collision - ******************************************************************************/ - -#define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 -#define NODETECTION - -/******************************************************************************* - * LUOS HAL LIBRARY DEFINITION -******************************************************************************* - * Define | Description - * :-----------------------|----------------------------------------------- - * MCUFREQ | Put your the MCU frequency (value in Hz) - * TIMERDIV | Timer divider clock (see your clock configuration) - * USE_CRC_HW | define to 0 if there is no Module CRC in your MCU - * USE_TX_IT | define to 1 to not use DMA transfert for Luos Tx - * - * PORT_CLOCK_ENABLE | Enable clock for port - * PTPx | A,B,C,D etc. PTP Branch Pin/Port/IRQ - * TX_LOCK_DETECT | Disable by default use if not busy flag in USART Pin/Port/IRQ - * RX_EN | Rx enable for driver RS485 always on Pin/Port - * TX_EN | Tx enable for driver RS485 Pin/Port - * COM_TX | Tx USART Com Pin/Port/Alternate - * COM_RX | Rx USART Com Pin/Port/Alternate - * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - - * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART - * ROBUS_COM | USART number - * ROBUS_COM_IRQ | USART IRQ number - * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - - * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA - * ROBUS_DMA | DMA number - * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - - * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * ROBUS_TIMER | Timer number - * ROBUS_TIMER_IRQ | Timer IRQ number - * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler -******************************************************************************/ - -/******************************************************************************* - * FLASH CONFIGURATION FOR APP WITH BOOTLOADER - ******************************************************************************** - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * BOOT_START_ADDRESS | FLASH_BASE = 0x8000000 | Start address of Bootloader in flash - * SHARED_MEMORY_ADDRESS | 0x0800C000 | Start address of shared memory to save boot flag - * APP_START_ADDRESS | 0x0800C800 | Start address of application with bootloader - * APP_END_ADDRESS | FLASH_END | End address of application with bootloader - ******************************************************************************/ - -/******************************************************************************* - * GATE SERIAL COM DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :-------------------------|------------------------------------------------------ - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * GATE_BUFF_SIZE | 1024 | Json receive buffer size - * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size - * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size - ******************************************************************************/ - -#define GATE_BUFF_SIZE 1024 -#define PIPE_TX_BUFFER_SIZE 1024 -#define PIPE_RX_BUFFER_SIZE 2048 - -#endif /* _NODE_CONFIG_H_ */ diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-G431KB/inspector_serialcom/platformio.ini deleted file mode 100644 index fe5677cd5..000000000 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/platformio.ini +++ /dev/null @@ -1,58 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html -[platformio] -default_envs = nucleo_g431kb - -[env] -lib_ldf_mode =off -lib_extra_dirs = - $PROJECT_DIR/../../../../tool_services/ - $PROJECT_DIR/../../../../../ - $PROJECT_DIR/../../../../network/ -platform = ststm32 -board = nucleo_g431kb -framework = stm32cube -lib_deps = - luos_engine@^3.0.0 - robus_network - Inspector - Pipe -debug_tool = stlink -upload_protocol = stlink - -[env:nucleo_g431kb] -build_unflags = -Os -build_flags = - -O1 - -include node_config.h - -D GATEFORMAT=TinyJSON - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32G4 - -D PIPEMODE=SERIAL - -D PIPEHAL=NUCLEO-G431 - -[env:nucleo_g431kb_with_bootloader] -board_build.ldscript = linker/custom_Luos_bootloader_script.ld -build_unflags = -Os -build_flags = - -O1 - -include node_config.h - -DWITH_BOOTLOADER - -D GATEFORMAT=TinyJSON - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32G4 - -D PIPEMODE=SERIAL - -D PIPEHAL=NUCLEO-G431 -upload_protocol = custom -upload_flags = - -t2 -upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/gpio.c b/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/gpio.c deleted file mode 100644 index 0249ee815..000000000 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/gpio.c +++ /dev/null @@ -1,66 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.c - * @brief This file provides code for the configuration - * of all used GPIO pins. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "gpio.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/*----------------------------------------------------------------------------*/ -/* Configure GPIO */ -/*----------------------------------------------------------------------------*/ -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** Configure pins -*/ -void MX_GPIO_Init(void) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = BTN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(BTN_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = LED_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_PULLDOWN; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct); -} - -/* USER CODE BEGIN 2 */ - -/* USER CODE END 2 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/main.c deleted file mode 100644 index 7f1079a30..000000000 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/main.c +++ /dev/null @@ -1,191 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.c - * @brief : Main program body - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "gpio.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -#include "luos_engine.h" -#include "robus_network.h" -#include "inspector.h" -#include "pipe.h" -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN PTD */ -/* USER CODE END PTD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -void SystemClock_Config(void); -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/** - * @brief The application entry point. - * @retval int - */ -int main(void) -{ - /* USER CODE BEGIN 1 */ - - /* USER CODE END 1 */ - - /* MCU Configuration--------------------------------------------------------*/ - - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ - HAL_Init(); - - /* USER CODE BEGIN Init */ - - /* USER CODE END Init */ - - /* Configure the system clock */ - SystemClock_Config(); - - /* USER CODE BEGIN SysInit */ - - /* USER CODE END SysInit */ - - /* Initialize all configured peripherals */ - MX_GPIO_Init(); - /* USER CODE BEGIN 2 */ - Luos_Init(); - Robus_Init(); - Inspector_Init(); - Pipe_Init(); - /* USER CODE END 2 */ - - /* Infinite loop */ - /* USER CODE BEGIN WHILE */ - while (1) - { - /* USER CODE END WHILE */ - - /* USER CODE BEGIN 3 */ - Luos_Loop(); - Inspector_Loop(); - Pipe_Loop(); - } - /* USER CODE END 3 */ -} - -/** - * @brief System Clock Configuration - * @retval None - */ -void SystemClock_Config(void) -{ - RCC_OscInitTypeDef RCC_OscInitStruct = {0}; - RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; - - /** Configure the main internal regulator output voltage - */ - HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1_BOOST); - /** Initializes the RCC Oscillators according to the specified parameters - * in the RCC_OscInitTypeDef structure. - */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; - RCC_OscInitStruct.HSIState = RCC_HSI_ON; - RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; - RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV4; - RCC_OscInitStruct.PLL.PLLN = 85; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2; - RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) - { - Error_Handler(); - } - /** Initializes the CPU, AHB and APB buses clocks - */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK - | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK) - { - Error_Handler(); - } -} - -/* USER CODE BEGIN 4 */ - -/* USER CODE END 4 */ - -/** - * @brief This function is executed in case of error occurrence. - * @retval None - */ -void Error_Handler(void) -{ - /* USER CODE BEGIN Error_Handler_Debug */ - /* User can add his own implementation to report the HAL error return state */ - __disable_irq(); - while (1) - { - } - /* USER CODE END Error_Handler_Debug */ -} - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t *file, uint32_t line) -{ - /* USER CODE BEGIN 6 */ - /* User can add his own implementation to report the file name and line number, - ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ - /* USER CODE END 6 */ -} -#endif /* USE_FULL_ASSERT */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/stm32g4xx_hal_msp.c b/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/stm32g4xx_hal_msp.c deleted file mode 100644 index 8d592424b..000000000 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/stm32g4xx_hal_msp.c +++ /dev/null @@ -1,88 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32g4xx_hal_msp.c - * @brief This file provides code for the MSP Initialization - * and de-Initialization codes. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN Define */ - -/* USER CODE END Define */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN Macro */ - -/* USER CODE END Macro */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* External functions --------------------------------------------------------*/ -/* USER CODE BEGIN ExternalFunctions */ - -/* USER CODE END ExternalFunctions */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ -/** - * Initializes the Global MSP. - */ -void HAL_MspInit(void) -{ - /* USER CODE BEGIN MspInit 0 */ - - /* USER CODE END MspInit 0 */ - - __HAL_RCC_SYSCFG_CLK_ENABLE(); - __HAL_RCC_PWR_CLK_ENABLE(); - - /* System interrupt init*/ - - /** Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral - */ - //HAL_PWREx_DisableUCPDDeadBattery(); - - /* USER CODE BEGIN MspInit 1 */ - - /* USER CODE END MspInit 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/stm32g4xx_it.c b/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/stm32g4xx_it.c deleted file mode 100644 index f4c00b1b7..000000000 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/stm32g4xx_it.c +++ /dev/null @@ -1,214 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32g4xx_it.c - * @brief Interrupt Service Routines. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "stm32g4xx_it.h" -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* External variables --------------------------------------------------------*/ - -/* USER CODE BEGIN EV */ - -/* USER CODE END EV */ - -/******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ -/******************************************************************************/ -/** - * @brief This function handles Non maskable interrupt. - */ -void NMI_Handler(void) -{ - /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ - - /* USER CODE END NonMaskableInt_IRQn 0 */ - /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ - while (1) - { - } - /* USER CODE END NonMaskableInt_IRQn 1 */ -} - -/** - * @brief This function handles Hard fault interrupt. - */ -void HardFault_Handler(void) -{ - /* USER CODE BEGIN HardFault_IRQn 0 */ - - /* USER CODE END HardFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_HardFault_IRQn 0 */ - /* USER CODE END W1_HardFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Memory management fault. - */ -void MemManage_Handler(void) -{ - /* USER CODE BEGIN MemoryManagement_IRQn 0 */ - - /* USER CODE END MemoryManagement_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ - /* USER CODE END W1_MemoryManagement_IRQn 0 */ - } -} - -/** - * @brief This function handles Prefetch fault, memory access fault. - */ -void BusFault_Handler(void) -{ - /* USER CODE BEGIN BusFault_IRQn 0 */ - - /* USER CODE END BusFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_BusFault_IRQn 0 */ - /* USER CODE END W1_BusFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Undefined instruction or illegal state. - */ -void UsageFault_Handler(void) -{ - /* USER CODE BEGIN UsageFault_IRQn 0 */ - - /* USER CODE END UsageFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ - /* USER CODE END W1_UsageFault_IRQn 0 */ - } -} - -/** - * @brief This function handles System service call via SWI instruction. - */ -void SVC_Handler(void) -{ - /* USER CODE BEGIN SVCall_IRQn 0 */ - - /* USER CODE END SVCall_IRQn 0 */ - /* USER CODE BEGIN SVCall_IRQn 1 */ - - /* USER CODE END SVCall_IRQn 1 */ -} - -/** - * @brief This function handles Debug monitor. - */ -void DebugMon_Handler(void) -{ - /* USER CODE BEGIN DebugMonitor_IRQn 0 */ - - /* USER CODE END DebugMonitor_IRQn 0 */ - /* USER CODE BEGIN DebugMonitor_IRQn 1 */ - - /* USER CODE END DebugMonitor_IRQn 1 */ -} - -/** - * @brief This function handles Pendable request for system service. - */ -void PendSV_Handler(void) -{ - /* USER CODE BEGIN PendSV_IRQn 0 */ - - /* USER CODE END PendSV_IRQn 0 */ - /* USER CODE BEGIN PendSV_IRQn 1 */ - - /* USER CODE END PendSV_IRQn 1 */ -} - -/** - * @brief This function handles System tick timer. - */ -void SysTick_Handler(void) -{ - /* USER CODE BEGIN SysTick_IRQn 0 */ - - /* USER CODE END SysTick_IRQn 0 */ - HAL_IncTick(); - /* USER CODE BEGIN SysTick_IRQn 1 */ - - /* USER CODE END SysTick_IRQn 1 */ -} - -/******************************************************************************/ -/* STM32G4xx Peripheral Interrupt Handlers */ -/* Add here the Interrupt Handlers for the used peripherals. */ -/* For the available peripheral interrupt handler names, */ -/* please refer to the startup file (startup_stm32g4xx.s). */ -/******************************************************************************/ - -/* USER CODE BEGIN 1 */ -/* USER CODE BEGIN 1 */ -void EXTI9_5_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_5); -} - -void EXTI4_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_4); -} -/* USER CODE END 1 */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/system_stm32g4xx.c b/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/system_stm32g4xx.c deleted file mode 100644 index ff379ee75..000000000 --- a/examples/projects/NUCLEO-G431KB/inspector_serialcom/src/system_stm32g4xx.c +++ /dev/null @@ -1,270 +0,0 @@ -/** - ****************************************************************************** - * @file system_stm32g4xx.c - * @author MCD Application Team - * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File - * - * This file provides two functions and one global variable to be called from - * user application: - * - SystemInit(): This function is called at startup just after reset and - * before branch to main program. This call is made inside - * the "startup_stm32g4xx.s" file. - * - * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick - * timer or configure other parameters. - * - * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must - * be called whenever the core clock is changed - * during program execution. - * - * After each device reset the HSI (16 MHz) is used as system clock source. - * Then SystemInit() function is called, in "startup_stm32g4xx.s" file, to - * configure the system clock before to branch to main program. - * - * This file configures the system clock as follows: - *============================================================================= - *----------------------------------------------------------------------------- - * System Clock source | HSI - *----------------------------------------------------------------------------- - * SYSCLK(Hz) | 16000000 - *----------------------------------------------------------------------------- - * HCLK(Hz) | 16000000 - *----------------------------------------------------------------------------- - * AHB Prescaler | 1 - *----------------------------------------------------------------------------- - * APB1 Prescaler | 1 - *----------------------------------------------------------------------------- - * APB2 Prescaler | 1 - *----------------------------------------------------------------------------- - * PLL_M | 1 - *----------------------------------------------------------------------------- - * PLL_N | 16 - *----------------------------------------------------------------------------- - * PLL_P | 7 - *----------------------------------------------------------------------------- - * PLL_Q | 2 - *----------------------------------------------------------------------------- - * PLL_R | 2 - *----------------------------------------------------------------------------- - * Require 48MHz for RNG | Disabled - *----------------------------------------------------------------------------- - *============================================================================= - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2019 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/** @addtogroup CMSIS - * @{ - */ - -/** @addtogroup stm32g4xx_system - * @{ - */ - -/** @addtogroup STM32G4xx_System_Private_Includes - * @{ - */ - -#include "stm32g4xx.h" - -#if !defined(HSE_VALUE) -#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined(HSI_VALUE) -#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @} - */ - -/** @addtogroup STM32G4xx_System_Private_TypesDefinitions - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32G4xx_System_Private_Defines - * @{ - */ - -/************************* Miscellaneous Configuration ************************/ -/*!< Uncomment the following line if you need to relocate your vector Table in - Internal SRAM. */ -/* #define VECT_TAB_SRAM */ -#define VECT_TAB_OFFSET 0x00 -/*!< Vector Table base offset field. \ - This value must be a multiple of 0x200. */ -/******************************************************************************/ -/** - * @} - */ - -/** @addtogroup STM32G4xx_System_Private_Macros - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32G4xx_System_Private_Variables - * @{ - */ -/* The SystemCoreClock variable is updated in three ways: - 1) by calling CMSIS function SystemCoreClockUpdate() - 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency - Note: If you use this function to configure the system clock; then there - is no need to call the 2 first functions listed above, since SystemCoreClock - variable is updated automatically. - */ -uint32_t SystemCoreClock = HSI_VALUE; - -const uint8_t AHBPrescTable[16] = {0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U, 6U, 7U, 8U, 9U}; -const uint8_t APBPrescTable[8] = {0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U}; - -/** - * @} - */ - -/** @addtogroup STM32G4xx_System_Private_FunctionPrototypes - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32G4xx_System_Private_Functions - * @{ - */ - -/** - * @brief Setup the microcontroller system. - * @param None - * @retval None - */ - -void SystemInit(void) -{ -/* FPU settings ------------------------------------------------------------*/ -#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) - SCB->CPACR |= ((3UL << (10 * 2)) | (3UL << (11 * 2))); /* set CP10 and CP11 Full Access */ -#endif - - /* Configure the Vector Table location add offset address ------------------*/ -#ifdef VECT_TAB_SRAM - SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ -#else - SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ -#endif -} - -/** - * @brief Update SystemCoreClock variable according to Clock Register Values. - * The SystemCoreClock variable contains the core clock (HCLK), it can - * be used by the user application to setup the SysTick timer or configure - * other parameters. - * - * @note Each time the core clock (HCLK) changes, this function must be called - * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined - * constant and the selected clock source: - * - * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**) - * - * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***) - * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * - * (**) HSI_VALUE is a constant defined in stm32g4xx_hal.h file (default value - * 16 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * - * (***) HSE_VALUE is a constant defined in stm32g4xx_hal.h file (default value - * 8 MHz), user has to ensure that HSE_VALUE is same as the real - * frequency of the crystal used. Otherwise, this function may - * have wrong result. - * - * - The result of this function could be not correct when using fractional - * value for HSE crystal. - * - * @param None - * @retval None - */ -void SystemCoreClockUpdate(void) -{ - uint32_t tmp, pllvco, pllr, pllsource, pllm; - - /* Get SYSCLK source -------------------------------------------------------*/ - switch (RCC->CFGR & RCC_CFGR_SWS) - { - case 0x04: /* HSI used as system clock source */ - SystemCoreClock = HSI_VALUE; - break; - - case 0x08: /* HSE used as system clock source */ - SystemCoreClock = HSE_VALUE; - break; - - case 0x0C: /* PLL used as system clock source */ - /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLLM) * PLLN - SYSCLK = PLL_VCO / PLLR - */ - pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC); - pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> 4) + 1U; - if (pllsource == 0x02UL) /* HSI used as PLL clock source */ - { - pllvco = (HSI_VALUE / pllm); - } - else /* HSE used as PLL clock source */ - { - pllvco = (HSE_VALUE / pllm); - } - pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 8); - pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> 25) + 1U) * 2U; - SystemCoreClock = pllvco / pllr; - break; - - default: - break; - } - /* Compute HCLK clock frequency --------------------------------------------*/ - /* Get HCLK prescaler */ - tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; - /* HCLK clock frequency */ - SystemCoreClock >>= tmp; -} - -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/include/gpio.h b/examples/projects/NUCLEO-G474RE/inspector_serialcom/include/gpio.h deleted file mode 100644 index 1ac88aa6d..000000000 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/include/gpio.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.h - * @brief This file contains all the function prototypes for - * the gpio.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __GPIO_H__ -#define __GPIO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - - void MX_GPIO_Init(void); - - /* USER CODE BEGIN Prototypes */ - - /* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif -#endif /*__ GPIO_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/include/main.h b/examples/projects/NUCLEO-G474RE/inspector_serialcom/include/main.h deleted file mode 100644 index e01c4b85f..000000000 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/include/main.h +++ /dev/null @@ -1,76 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.h - * @brief : Header for main.c file. - * This file contains the common defines of the application. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __MAIN_H -#define __MAIN_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "stm32g4xx_hal.h" - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void Error_Handler(void); - -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -/* Private defines -----------------------------------------------------------*/ -#define BTN_Pin GPIO_PIN_11 -#define BTN_GPIO_Port GPIOA -#define LED_Pin GPIO_PIN_8 -#define LED_GPIO_Port GPIOB - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - -#ifdef __cplusplus -} -#endif - -#endif /* __MAIN_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/include/stm32g4xx_hal_conf.h b/examples/projects/NUCLEO-G474RE/inspector_serialcom/include/stm32g4xx_hal_conf.h deleted file mode 100644 index 074b94a0c..000000000 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/include/stm32g4xx_hal_conf.h +++ /dev/null @@ -1,382 +0,0 @@ -/** - ****************************************************************************** - * @file stm32g4xx_hal_conf.h - * @author MCD Application Team - * @brief HAL configuration file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2019 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef STM32G4xx_HAL_CONF_H -#define STM32G4xx_HAL_CONF_H - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Exported types ------------------------------------------------------------*/ - /* Exported constants --------------------------------------------------------*/ - - /* ########################## Module Selection ############################## */ - /** - * @brief This is the list of modules to be used in the HAL driver - */ - -#define HAL_MODULE_ENABLED - - /*#define HAL_ADC_MODULE_ENABLED */ -/*#define HAL_COMP_MODULE_ENABLED */ -/*#define HAL_CORDIC_MODULE_ENABLED */ -/*#define HAL_CRYP_MODULE_ENABLED */ -/*#define HAL_DAC_MODULE_ENABLED */ -/*#define HAL_FDCAN_MODULE_ENABLED */ -/*#define HAL_FMAC_MODULE_ENABLED */ -/*#define HAL_HRTIM_MODULE_ENABLED */ -/*#define HAL_IRDA_MODULE_ENABLED */ -/*#define HAL_IWDG_MODULE_ENABLED */ -/*#define HAL_I2C_MODULE_ENABLED */ -/*#define HAL_I2S_MODULE_ENABLED */ -/*#define HAL_LPTIM_MODULE_ENABLED */ -/*#define HAL_NAND_MODULE_ENABLED */ -/*#define HAL_NOR_MODULE_ENABLED */ -/*#define HAL_OPAMP_MODULE_ENABLED */ -/*#define HAL_PCD_MODULE_ENABLED */ -/*#define HAL_QSPI_MODULE_ENABLED */ -/*#define HAL_RNG_MODULE_ENABLED */ -/*#define HAL_RTC_MODULE_ENABLED */ -/*#define HAL_SAI_MODULE_ENABLED */ -/*#define HAL_SMARTCARD_MODULE_ENABLED */ -/*#define HAL_SMBUS_MODULE_ENABLED */ -/*#define HAL_SPI_MODULE_ENABLED */ -/*#define HAL_SRAM_MODULE_ENABLED */ -/*#define HAL_WWDG_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_CRC_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_LPUART_MODULE_ENABLED - -/* ########################## Register Callbacks selection ############################## */ -/** - * @brief This is the list of modules where register callback can be used - */ -#define USE_HAL_ADC_REGISTER_CALLBACKS 0U -#define USE_HAL_COMP_REGISTER_CALLBACKS 0U -#define USE_HAL_CORDIC_REGISTER_CALLBACKS 0U -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U -#define USE_HAL_DAC_REGISTER_CALLBACKS 0U -#define USE_HAL_EXTI_REGISTER_CALLBACKS 0U -#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U -#define USE_HAL_FMAC_REGISTER_CALLBACKS 0U -#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U -#define USE_HAL_I2C_REGISTER_CALLBACKS 0U -#define USE_HAL_I2S_REGISTER_CALLBACKS 0U -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U -#define USE_HAL_NAND_REGISTER_CALLBACKS 0U -#define USE_HAL_NOR_REGISTER_CALLBACKS 0U -#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U -#define USE_HAL_PCD_REGISTER_CALLBACKS 0U -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U -#define USE_HAL_RNG_REGISTER_CALLBACKS 0U -#define USE_HAL_RTC_REGISTER_CALLBACKS 0U -#define USE_HAL_SAI_REGISTER_CALLBACKS 0U -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U -#define USE_HAL_SPI_REGISTER_CALLBACKS 0U -#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U -#define USE_HAL_TIM_REGISTER_CALLBACKS 0U -#define USE_HAL_UART_REGISTER_CALLBACKS 0U -#define USE_HAL_USART_REGISTER_CALLBACKS 0U -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U - -/* ########################## Oscillator Values adaptation ####################*/ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined(HSE_VALUE) -#define HSE_VALUE (8000000UL) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined(HSE_STARTUP_TIMEOUT) -#define HSE_STARTUP_TIMEOUT (100UL) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined(HSI_VALUE) -#define HSI_VALUE (16000000UL) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal High Speed oscillator (HSI48) value for USB FS and RNG. - * This internal oscillator is mainly dedicated to provide a high precision clock to - * the USB peripheral by means of a special Clock Recovery System (CRS) circuitry. - * When the CRS is not used, the HSI48 RC oscillator runs on it default frequency - * which is subject to manufacturing process variations. - */ -#if !defined(HSI48_VALUE) -#define HSI48_VALUE (48000000UL) /*!< Value of the Internal High Speed oscillator for USB FS/RNG in Hz. \ - The real value my vary depending on manufacturing process variations.*/ -#endif /* HSI48_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined(LSI_VALUE) -/*!< Value of the Internal Low Speed oscillator in Hz -The real value may vary depending on the variations in voltage and temperature.*/ -#define LSI_VALUE (32000UL) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ -/** - * @brief External Low Speed oscillator (LSE) value. - * This value is used by the UART, RTC HAL module to compute the system frequency - */ -#if !defined(LSE_VALUE) -#define LSE_VALUE (32768UL) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined(LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT (5000UL) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S and SAI peripherals - * This value is used by the I2S and SAI HAL modules to compute the I2S and SAI clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined(EXTERNAL_CLOCK_VALUE) -#define EXTERNAL_CLOCK_VALUE (12288000UL) /*!< Value of the External oscillator in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - - /* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - - /* ########################### System Configuration ######################### */ - /** - * @brief This is the HAL system configuration section - */ - -#define VDD_VALUE (3300UL) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY (0UL) /*!< tick interrupt priority (lowest by default) */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 0U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - - /* ########################## Assert Selection ############################## */ - /** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ - /* #define USE_FULL_ASSERT 1U */ - - /* ################## SPI peripheral configuration ########################## */ - - /* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver - * Activated: CRC code is present inside driver - * Deactivated: CRC code cleaned from driver - */ - -#define USE_SPI_CRC 0U - - /* Includes ------------------------------------------------------------------*/ - /** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED -#include "stm32g4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED -#include "stm32g4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED -#include "stm32g4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED -#include "stm32g4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED -#include "stm32g4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_COMP_MODULE_ENABLED -#include "stm32g4xx_hal_comp.h" -#endif /* HAL_COMP_MODULE_ENABLED */ - -#ifdef HAL_CORDIC_MODULE_ENABLED -#include "stm32g4xx_hal_cordic.h" -#endif /* HAL_CORDIC_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED -#include "stm32g4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED -#include "stm32g4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED -#include "stm32g4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED -#include "stm32g4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_FDCAN_MODULE_ENABLED -#include "stm32g4xx_hal_fdcan.h" -#endif /* HAL_FDCAN_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED -#include "stm32g4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_FMAC_MODULE_ENABLED -#include "stm32g4xx_hal_fmac.h" -#endif /* HAL_FMAC_MODULE_ENABLED */ - -#ifdef HAL_HRTIM_MODULE_ENABLED -#include "stm32g4xx_hal_hrtim.h" -#endif /* HAL_HRTIM_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED -#include "stm32g4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED -#include "stm32g4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED -#include "stm32g4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED -#include "stm32g4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED -#include "stm32g4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED -#include "stm32g4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED -#include "stm32g4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_OPAMP_MODULE_ENABLED -#include "stm32g4xx_hal_opamp.h" -#endif /* HAL_OPAMP_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED -#include "stm32g4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED -#include "stm32g4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED -#include "stm32g4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED -#include "stm32g4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED -#include "stm32g4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED -#include "stm32g4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED -#include "stm32g4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED -#include "stm32g4xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED -#include "stm32g4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED -#include "stm32g4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED -#include "stm32g4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED -#include "stm32g4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED -#include "stm32g4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED -#include "stm32g4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) - /* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t *file, uint32_t line); -#else -#define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* STM32G4xx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/include/stm32g4xx_it.h b/examples/projects/NUCLEO-G474RE/inspector_serialcom/include/stm32g4xx_it.h deleted file mode 100644 index e72670b44..000000000 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/include/stm32g4xx_it.h +++ /dev/null @@ -1,70 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32g4xx_it.h - * @brief This file contains the headers of the interrupt handlers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32G4xx_IT_H -#define __STM32G4xx_IT_H - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void NMI_Handler(void); - void HardFault_Handler(void); - void MemManage_Handler(void); - void BusFault_Handler(void); - void UsageFault_Handler(void); - void SVC_Handler(void); - void DebugMon_Handler(void); - void PendSV_Handler(void); - void SysTick_Handler(void); - /* USER CODE BEGIN EFP */ - - /* USER CODE END EFP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32G4xx_IT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/linker/custom_Luos_bootloader_script.ld b/examples/projects/NUCLEO-G474RE/inspector_serialcom/linker/custom_Luos_bootloader_script.ld deleted file mode 100644 index fec64429b..000000000 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/linker/custom_Luos_bootloader_script.ld +++ /dev/null @@ -1,175 +0,0 @@ -/** - ****************************************************************************** - * @file LinkerScript.ld - * @author Auto-generated by STM32CubeIDE - * @brief Linker script for STM32G431KBTx Device from STM32G4 series - * 128Kbytes FLASH - * 32Kbytes RAM - * - * Set heap size, stack size and stack location according - * to application requirements. - * - * Set memory bank area and size if external memory is used - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ - -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Memories definition */ -MEMORY -{ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K - FLASH (rx) : ORIGIN = 0x0800C800, LENGTH = 78K -} - -/* Sections */ -SECTIONS -{ - /* The startup code into "FLASH" Rom type memory */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data into "FLASH" Rom type memory */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data into "FLASH" Rom type memory */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { - . = ALIGN(4); - *(.ARM.extab* .gnu.linkonce.armextab.*) - . = ALIGN(4); - } >FLASH - - .ARM : { - . = ALIGN(4); - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - . = ALIGN(4); - } >FLASH - - .preinit_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - . = ALIGN(4); - } >FLASH - - .init_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - . = ALIGN(4); - } >FLASH - - .fini_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - . = ALIGN(4); - } >FLASH - - /* Used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections into "RAM" Ram type memory */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - - } >RAM AT> FLASH - - /* Uninitialized data section into "RAM" Ram type memory */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - /* Remove information from the compiler libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h deleted file mode 100644 index 528815815..000000000 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/node_config.h +++ /dev/null @@ -1,116 +0,0 @@ -/****************************************************************************** - * @file node_config.h - * @brief This file allow you to use standard preprocessor definitions to - * configure your project, Luos and Luos HAL libraries - * - * # Introduction - * This file is for the luos user. You may here configure your project and - * define your custom Luos service and custom Luos command for your product - * - * Luos libraries offer a minimal standard configuration to optimize - * memory usage. In some case you have to modify standard value to fit - * with your need concerning among of data transiting through the network - * or network speed for example - * - * Luos libraries can be use with a lot a MCU family. Luos compagny give you - * a default configuration, for specific MCU family, in robus_hal_config.h. - * This configuration can be modify here to fit with you design by - * preprocessor definitions of MCU Hardware needs - * - * # Usage - * This file should be place a the root folder of your project and include - * where build flag preprocessor definitions are define in your IDE - * -include node_config.h - * - * @author Luos - * @version 0.0.0 - ******************************************************************************/ -#ifndef _NODE_CONFIG_H_ -#define _NODE_CONFIG_H_ - -/******************************************************************************* - * PROJECT DEFINITION - *******************************************************************************/ - -/******************************************************************************* - * LUOS LIBRARY DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node - * MAX_NODE_NUMBER. | 20 | Node number in the device - * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * NBR_PORT | 2 | PTP Branch number Max 8 - * NBR_RETRY | 10 | Send Retry number in case of NACK or collision - ******************************************************************************/ - -#define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 -#define NODETECTION - -/******************************************************************************* - * LUOS HAL LIBRARY DEFINITION -******************************************************************************* - * Define | Description - * :-----------------------|----------------------------------------------- - * MCUFREQ | Put your the MCU frequency (value in Hz) - * TIMERDIV | Timer divider clock (see your clock configuration) - * USE_CRC_HW | define to 0 if there is no Module CRC in your MCU - * USE_TX_IT | define to 1 to not use DMA transfert for Luos Tx - * - * PORT_CLOCK_ENABLE | Enable clock for port - * PTPx | A,B,C,D etc. PTP Branch Pin/Port/IRQ - * TX_LOCK_DETECT | Disable by default use if not busy flag in USART Pin/Port/IRQ - * RX_EN | Rx enable for driver RS485 always on Pin/Port - * TX_EN | Tx enable for driver RS485 Pin/Port - * COM_TX | Tx USART Com Pin/Port/Alternate - * COM_RX | Rx USART Com Pin/Port/Alternate - * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - - * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART - * ROBUS_COM | USART number - * ROBUS_COM_IRQ | USART IRQ number - * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - - * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA - * ROBUS_DMA | DMA number - * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - - * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * ROBUS_TIMER | Timer number - * ROBUS_TIMER_IRQ | Timer IRQ number - * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler -******************************************************************************/ - -/******************************************************************************* - * FLASH CONFIGURATION FOR APP WITH BOOTLOADER - ******************************************************************************** - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * BOOT_START_ADDRESS | FLASH_BASE = 0x8000000 | Start address of Bootloader in flash - * SHARED_MEMORY_ADDRESS | 0x0800C000 | Start address of shared memory to save boot flag - * APP_START_ADDRESS | 0x0800C800 | Start address of application with bootloader - * APP_END_ADDRESS | FLASH_END | End address of application with bootloader - ******************************************************************************/ - -/******************************************************************************* - * GATE SERIAL COM DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :-------------------------|------------------------------------------------------ - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * GATE_BUFF_SIZE | 1024 | Json receive buffer size - * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size - * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size - ******************************************************************************/ - -#define GATE_BUFF_SIZE 1024 -#define PIPE_TX_BUFFER_SIZE 1024 -#define PIPE_RX_BUFFER_SIZE 2048 - -#endif /* _NODE_CONFIG_H_ */ diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-G474RE/inspector_serialcom/platformio.ini deleted file mode 100644 index f543507c2..000000000 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/platformio.ini +++ /dev/null @@ -1,57 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html -[platformio] -default_envs = nucleo_g474re - -[env] -lib_ldf_mode =off -lib_extra_dirs = - $PROJECT_DIR/../../../../tool_services/ - $PROJECT_DIR/../../../../../ - $PROJECT_DIR/../../../../network/ -platform = ststm32 -board = nucleo_g474re -framework = stm32cube -lib_deps = - luos_engine@^3.0.0 - robus_network - Inspector - Pipe -upload_protocol = stlink - -[env:nucleo_g474re] -build_unflags = -Os -build_flags = - -O1 - -include node_config.h - -D GATEFORMAT=TinyJSON - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32G4 - -D PIPEMODE=SERIAL - -D PIPEHAL=NUCLEO-G474 - -[env:nucleo_g474re_with_bootloader] -board_build.ldscript = linker/custom_Luos_bootloader_script.ld -build_unflags = -Os -build_flags = - -O1 - -include node_config.h - -D GATEFORMAT=TinyJSON - -DWITH_BOOTLOADER - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32G4 - -D PIPEMODE=SERIAL - -D PIPEHAL=NUCLEO-G474 -upload_protocol = custom -upload_flags = - -t2 -upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/gpio.c b/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/gpio.c deleted file mode 100644 index cefdc6b51..000000000 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/gpio.c +++ /dev/null @@ -1,66 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.c - * @brief This file provides code for the configuration - * of all used GPIO pins. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "gpio.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/*----------------------------------------------------------------------------*/ -/* Configure GPIO */ -/*----------------------------------------------------------------------------*/ -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** Configure pins - */ -void MX_GPIO_Init(void) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = BTN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(BTN_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = LED_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_PULLDOWN; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct); -} - -/* USER CODE BEGIN 2 */ - -/* USER CODE END 2 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/main.c deleted file mode 100644 index aed1ea40e..000000000 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/main.c +++ /dev/null @@ -1,192 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.c - * @brief : Main program body - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "gpio.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -#include "luos_engine.h" -#include "robus_network.h" -#include "inspector.h" -#include "pipe.h" -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN PTD */ - -/* USER CODE END PTD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -void SystemClock_Config(void); -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/** - * @brief The application entry point. - * @retval int - */ -int main(void) -{ - /* USER CODE BEGIN 1 */ - - /* USER CODE END 1 */ - - /* MCU Configuration--------------------------------------------------------*/ - - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ - HAL_Init(); - - /* USER CODE BEGIN Init */ - - /* USER CODE END Init */ - - /* Configure the system clock */ - SystemClock_Config(); - - /* USER CODE BEGIN SysInit */ - - /* USER CODE END SysInit */ - - /* Initialize all configured peripherals */ - MX_GPIO_Init(); - /* USER CODE BEGIN 2 */ - Luos_Init(); - Robus_Init(); - Inspector_Init(); - Pipe_Init(); - /* USER CODE END 2 */ - - /* Infinite loop */ - /* USER CODE BEGIN WHILE */ - while (1) - { - /* USER CODE END WHILE */ - - /* USER CODE BEGIN 3 */ - Luos_Loop(); - Inspector_Loop(); - Pipe_Loop(); - } - /* USER CODE END 3 */ -} - -/** - * @brief System Clock Configuration - * @retval None - */ -void SystemClock_Config(void) -{ - RCC_OscInitTypeDef RCC_OscInitStruct = {0}; - RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; - - /** Configure the main internal regulator output voltage - */ - HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1_BOOST); - /** Initializes the RCC Oscillators according to the specified parameters - * in the RCC_OscInitTypeDef structure. - */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; - RCC_OscInitStruct.HSIState = RCC_HSI_ON; - RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; - RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV4; - RCC_OscInitStruct.PLL.PLLN = 85; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2; - RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) - { - Error_Handler(); - } - /** Initializes the CPU, AHB and APB buses clocks - */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK - | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK) - { - Error_Handler(); - } -} - -/* USER CODE BEGIN 4 */ - -/* USER CODE END 4 */ - -/** - * @brief This function is executed in case of error occurrence. - * @retval None - */ -void Error_Handler(void) -{ - /* USER CODE BEGIN Error_Handler_Debug */ - /* User can add his own implementation to report the HAL error return state */ - __disable_irq(); - while (1) - { - } - /* USER CODE END Error_Handler_Debug */ -} - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t *file, uint32_t line) -{ - /* USER CODE BEGIN 6 */ - /* User can add his own implementation to report the file name and line number, - ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ - /* USER CODE END 6 */ -} -#endif /* USE_FULL_ASSERT */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/stm32g4xx_hal_msp.c b/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/stm32g4xx_hal_msp.c deleted file mode 100644 index 0096a09b3..000000000 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/stm32g4xx_hal_msp.c +++ /dev/null @@ -1,88 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32g4xx_hal_msp.c - * @brief This file provides code for the MSP Initialization - * and de-Initialization codes. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN Define */ - -/* USER CODE END Define */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN Macro */ - -/* USER CODE END Macro */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* External functions --------------------------------------------------------*/ -/* USER CODE BEGIN ExternalFunctions */ - -/* USER CODE END ExternalFunctions */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ -/** - * Initializes the Global MSP. - */ -void HAL_MspInit(void) -{ - /* USER CODE BEGIN MspInit 0 */ - - /* USER CODE END MspInit 0 */ - - __HAL_RCC_SYSCFG_CLK_ENABLE(); - __HAL_RCC_PWR_CLK_ENABLE(); - - /* System interrupt init*/ - - /** Disable the internal Pull-Up in Dead Battery pins of UCPD peripheral - */ - // HAL_PWREx_DisableUCPDDeadBattery(); - - /* USER CODE BEGIN MspInit 1 */ - - /* USER CODE END MspInit 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/stm32g4xx_it.c b/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/stm32g4xx_it.c deleted file mode 100644 index 2e52f9297..000000000 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/stm32g4xx_it.c +++ /dev/null @@ -1,214 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32g4xx_it.c - * @brief Interrupt Service Routines. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "stm32g4xx_it.h" -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* External variables --------------------------------------------------------*/ - -/* USER CODE BEGIN EV */ - -/* USER CODE END EV */ - -/******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ -/******************************************************************************/ -/** - * @brief This function handles Non maskable interrupt. - */ -void NMI_Handler(void) -{ - /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ - - /* USER CODE END NonMaskableInt_IRQn 0 */ - /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ - while (1) - { - } - /* USER CODE END NonMaskableInt_IRQn 1 */ -} - -/** - * @brief This function handles Hard fault interrupt. - */ -void HardFault_Handler(void) -{ - /* USER CODE BEGIN HardFault_IRQn 0 */ - - /* USER CODE END HardFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_HardFault_IRQn 0 */ - /* USER CODE END W1_HardFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Memory management fault. - */ -void MemManage_Handler(void) -{ - /* USER CODE BEGIN MemoryManagement_IRQn 0 */ - - /* USER CODE END MemoryManagement_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ - /* USER CODE END W1_MemoryManagement_IRQn 0 */ - } -} - -/** - * @brief This function handles Prefetch fault, memory access fault. - */ -void BusFault_Handler(void) -{ - /* USER CODE BEGIN BusFault_IRQn 0 */ - - /* USER CODE END BusFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_BusFault_IRQn 0 */ - /* USER CODE END W1_BusFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Undefined instruction or illegal state. - */ -void UsageFault_Handler(void) -{ - /* USER CODE BEGIN UsageFault_IRQn 0 */ - - /* USER CODE END UsageFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ - /* USER CODE END W1_UsageFault_IRQn 0 */ - } -} - -/** - * @brief This function handles System service call via SWI instruction. - */ -void SVC_Handler(void) -{ - /* USER CODE BEGIN SVCall_IRQn 0 */ - - /* USER CODE END SVCall_IRQn 0 */ - /* USER CODE BEGIN SVCall_IRQn 1 */ - - /* USER CODE END SVCall_IRQn 1 */ -} - -/** - * @brief This function handles Debug monitor. - */ -void DebugMon_Handler(void) -{ - /* USER CODE BEGIN DebugMonitor_IRQn 0 */ - - /* USER CODE END DebugMonitor_IRQn 0 */ - /* USER CODE BEGIN DebugMonitor_IRQn 1 */ - - /* USER CODE END DebugMonitor_IRQn 1 */ -} - -/** - * @brief This function handles Pendable request for system service. - */ -void PendSV_Handler(void) -{ - /* USER CODE BEGIN PendSV_IRQn 0 */ - - /* USER CODE END PendSV_IRQn 0 */ - /* USER CODE BEGIN PendSV_IRQn 1 */ - - /* USER CODE END PendSV_IRQn 1 */ -} - -/** - * @brief This function handles System tick timer. - */ -void SysTick_Handler(void) -{ - /* USER CODE BEGIN SysTick_IRQn 0 */ - - /* USER CODE END SysTick_IRQn 0 */ - HAL_IncTick(); - /* USER CODE BEGIN SysTick_IRQn 1 */ - - /* USER CODE END SysTick_IRQn 1 */ -} - -/******************************************************************************/ -/* STM32G4xx Peripheral Interrupt Handlers */ -/* Add here the Interrupt Handlers for the used peripherals. */ -/* For the available peripheral interrupt handler names, */ -/* please refer to the startup file (startup_stm32g4xx.s). */ -/******************************************************************************/ - -/* USER CODE BEGIN 1 */ -/* USER CODE BEGIN 1 */ -void EXTI9_5_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_5); -} - -void EXTI4_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_4); -} -/* USER CODE END 1 */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/system_stm32g4xx.c b/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/system_stm32g4xx.c deleted file mode 100644 index 0c74693cf..000000000 --- a/examples/projects/NUCLEO-G474RE/inspector_serialcom/src/system_stm32g4xx.c +++ /dev/null @@ -1,269 +0,0 @@ -/** - ****************************************************************************** - * @file system_stm32g4xx.c - * @author MCD Application Team - * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File - * - * This file provides two functions and one global variable to be called from - * user application: - * - SystemInit(): This function is called at startup just after reset and - * before branch to main program. This call is made inside - * the "startup_stm32g4xx.s" file. - * - * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick - * timer or configure other parameters. - * - * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must - * be called whenever the core clock is changed - * during program execution. - * - * After each device reset the HSI (16 MHz) is used as system clock source. - * Then SystemInit() function is called, in "startup_stm32g4xx.s" file, to - * configure the system clock before to branch to main program. - * - * This file configures the system clock as follows: - *============================================================================= - *----------------------------------------------------------------------------- - * System Clock source | HSI - *----------------------------------------------------------------------------- - * SYSCLK(Hz) | 16000000 - *----------------------------------------------------------------------------- - * HCLK(Hz) | 16000000 - *----------------------------------------------------------------------------- - * AHB Prescaler | 1 - *----------------------------------------------------------------------------- - * APB1 Prescaler | 1 - *----------------------------------------------------------------------------- - * APB2 Prescaler | 1 - *----------------------------------------------------------------------------- - * PLL_M | 1 - *----------------------------------------------------------------------------- - * PLL_N | 16 - *----------------------------------------------------------------------------- - * PLL_P | 7 - *----------------------------------------------------------------------------- - * PLL_Q | 2 - *----------------------------------------------------------------------------- - * PLL_R | 2 - *----------------------------------------------------------------------------- - * Require 48MHz for RNG | Disabled - *----------------------------------------------------------------------------- - *============================================================================= - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2019 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/** @addtogroup CMSIS - * @{ - */ - -/** @addtogroup stm32g4xx_system - * @{ - */ - -/** @addtogroup STM32G4xx_System_Private_Includes - * @{ - */ - -#include "stm32g4xx.h" - -#if !defined(HSE_VALUE) -#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined(HSI_VALUE) -#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @} - */ - -/** @addtogroup STM32G4xx_System_Private_TypesDefinitions - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32G4xx_System_Private_Defines - * @{ - */ - -/************************* Miscellaneous Configuration ************************/ -/*!< Uncomment the following line if you need to relocate your vector Table in - Internal SRAM. */ -/* #define VECT_TAB_SRAM */ -#define VECT_TAB_OFFSET 0x00UL /*!< Vector Table base offset field. \ - This value must be a multiple of 0x200. */ - /******************************************************************************/ - /** - * @} - */ - -/** @addtogroup STM32G4xx_System_Private_Macros - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32G4xx_System_Private_Variables - * @{ - */ -/* The SystemCoreClock variable is updated in three ways: - 1) by calling CMSIS function SystemCoreClockUpdate() - 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency - Note: If you use this function to configure the system clock; then there - is no need to call the 2 first functions listed above, since SystemCoreClock - variable is updated automatically. - */ -uint32_t SystemCoreClock = HSI_VALUE; - -const uint8_t AHBPrescTable[16] = {0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U, 6U, 7U, 8U, 9U}; -const uint8_t APBPrescTable[8] = {0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U}; - -/** - * @} - */ - -/** @addtogroup STM32G4xx_System_Private_FunctionPrototypes - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32G4xx_System_Private_Functions - * @{ - */ - -/** - * @brief Setup the microcontroller system. - * @param None - * @retval None - */ - -void SystemInit(void) -{ -/* FPU settings ------------------------------------------------------------*/ -#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) - SCB->CPACR |= ((3UL << (10 * 2)) | (3UL << (11 * 2))); /* set CP10 and CP11 Full Access */ -#endif - - /* Configure the Vector Table location add offset address ------------------*/ -#ifdef VECT_TAB_SRAM - SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ -#else - SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ -#endif -} - -/** - * @brief Update SystemCoreClock variable according to Clock Register Values. - * The SystemCoreClock variable contains the core clock (HCLK), it can - * be used by the user application to setup the SysTick timer or configure - * other parameters. - * - * @note Each time the core clock (HCLK) changes, this function must be called - * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined - * constant and the selected clock source: - * - * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**) - * - * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***) - * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * - * (**) HSI_VALUE is a constant defined in stm32g4xx_hal.h file (default value - * 16 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * - * (***) HSE_VALUE is a constant defined in stm32g4xx_hal.h file (default value - * 8 MHz), user has to ensure that HSE_VALUE is same as the real - * frequency of the crystal used. Otherwise, this function may - * have wrong result. - * - * - The result of this function could be not correct when using fractional - * value for HSE crystal. - * - * @param None - * @retval None - */ -void SystemCoreClockUpdate(void) -{ - uint32_t tmp, pllvco, pllr, pllsource, pllm; - - /* Get SYSCLK source -------------------------------------------------------*/ - switch (RCC->CFGR & RCC_CFGR_SWS) - { - case 0x04: /* HSI used as system clock source */ - SystemCoreClock = HSI_VALUE; - break; - - case 0x08: /* HSE used as system clock source */ - SystemCoreClock = HSE_VALUE; - break; - - case 0x0C: /* PLL used as system clock source */ - /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLLM) * PLLN - SYSCLK = PLL_VCO / PLLR - */ - pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC); - pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> 4) + 1U; - if (pllsource == 0x02UL) /* HSI used as PLL clock source */ - { - pllvco = (HSI_VALUE / pllm); - } - else /* HSE used as PLL clock source */ - { - pllvco = (HSE_VALUE / pllm); - } - pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 8); - pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> 25) + 1U) * 2U; - SystemCoreClock = pllvco / pllr; - break; - - default: - break; - } - /* Compute HCLK clock frequency --------------------------------------------*/ - /* Get HCLK prescaler */ - tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; - /* HCLK clock frequency */ - SystemCoreClock >>= tmp; -} - -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/Inspector_SerialCom.ioc b/examples/projects/NUCLEO-L432KC/inspector_serialcom/Inspector_SerialCom.ioc deleted file mode 100644 index 685e9e08c..000000000 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/Inspector_SerialCom.ioc +++ /dev/null @@ -1,112 +0,0 @@ -#MicroXplorer Configuration settings - do not modify -File.Version=6 -GPIO.groupedBy= -KeepUserPlacement=false -Mcu.Family=STM32L4 -Mcu.IP0=NVIC -Mcu.IP1=RCC -Mcu.IP2=SYS -Mcu.IPNb=3 -Mcu.Name=STM32L432K(B-C)Ux -Mcu.Package=UFQFPN32 -Mcu.Pin0=PA11 -Mcu.Pin1=PB3 (JTDO-TRACESWO) -Mcu.Pin2=VP_SYS_VS_Systick -Mcu.PinsNb=3 -Mcu.ThirdPartyNb=0 -Mcu.UserConstants= -Mcu.UserName=STM32L432KCUx -MxCube.Version=6.1.1 -MxDb.Version=DB.6.0.10 -NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.ForceEnableDMAVector=true -NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 -NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true -NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -PA11.GPIOParameters=GPIO_Label -PA11.GPIO_Label=BTN -PA11.Locked=true -PA11.Signal=GPIO_Input -PB3\ (JTDO-TRACESWO).GPIOParameters=GPIO_PuPd,GPIO_Label -PB3\ (JTDO-TRACESWO).GPIO_Label=LED -PB3\ (JTDO-TRACESWO).GPIO_PuPd=GPIO_PULLDOWN -PB3\ (JTDO-TRACESWO).Locked=true -PB3\ (JTDO-TRACESWO).Signal=GPIO_Output -PinOutPanel.RotationAngle=0 -ProjectManager.AskForMigrate=true -ProjectManager.BackupPrevious=false -ProjectManager.CompilerOptimize=6 -ProjectManager.ComputerToolchain=false -ProjectManager.CoupleFile=true -ProjectManager.CustomerFirmwarePackage= -ProjectManager.DefaultFWLocation=true -ProjectManager.DeletePrevious=true -ProjectManager.DeviceId=STM32L432KCUx -ProjectManager.FirmwarePackage=STM32Cube FW_L4 V1.16.0 -ProjectManager.FreePins=false -ProjectManager.HalAssertFull=false -ProjectManager.HeapSize=0x0 -ProjectManager.KeepUserCode=true -ProjectManager.LastFirmware=true -ProjectManager.LibraryCopy=1 -ProjectManager.MainLocation=Src -ProjectManager.NoMain=false -ProjectManager.PreviousToolchain= -ProjectManager.ProjectBuild=false -ProjectManager.ProjectFileName=Gate.ioc -ProjectManager.ProjectName=Gate -ProjectManager.RegisterCallBack= -ProjectManager.StackSize=0x400 -ProjectManager.TargetToolchain=Other Toolchains (GPDSC) -ProjectManager.ToolChainLocation= -ProjectManager.UnderRoot=false -ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false -RCC.AHBFreq_Value=80000000 -RCC.APB1Freq_Value=80000000 -RCC.APB1TimFreq_Value=80000000 -RCC.APB2Freq_Value=80000000 -RCC.APB2TimFreq_Value=80000000 -RCC.CortexFreq_Value=80000000 -RCC.FCLKCortexFreq_Value=80000000 -RCC.FamilyName=M -RCC.HCLKFreq_Value=80000000 -RCC.HSE_VALUE=8000000 -RCC.HSI48_VALUE=48000000 -RCC.HSI_VALUE=16000000 -RCC.I2C1Freq_Value=80000000 -RCC.I2C3Freq_Value=80000000 -RCC.IPParameters=AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C3Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,MSI_VALUE,PLLN,PLLPoutputFreq_Value,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PLLSAI1PoutputFreq_Value,PLLSAI1QoutputFreq_Value,PLLSAI1RoutputFreq_Value,PWRFreq_Value,SAI1Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USART1Freq_Value,USART2Freq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAI1OutputFreq_Value -RCC.LPTIM1Freq_Value=80000000 -RCC.LPTIM2Freq_Value=80000000 -RCC.LPUART1Freq_Value=80000000 -RCC.LSCOPinFreq_Value=32000 -RCC.LSE_VALUE=32768 -RCC.LSI_VALUE=32000 -RCC.MCO1PinFreq_Value=80000000 -RCC.MSI_VALUE=4000000 -RCC.PLLN=40 -RCC.PLLPoutputFreq_Value=22857142.85714286 -RCC.PLLQoutputFreq_Value=80000000 -RCC.PLLRCLKFreq_Value=80000000 -RCC.PLLSAI1PoutputFreq_Value=4571428.571428572 -RCC.PLLSAI1QoutputFreq_Value=16000000 -RCC.PLLSAI1RoutputFreq_Value=16000000 -RCC.PWRFreq_Value=80000000 -RCC.SAI1Freq_Value=4571428.571428572 -RCC.SWPMI1Freq_Value=80000000 -RCC.SYSCLKFreq_VALUE=80000000 -RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK -RCC.USART1Freq_Value=80000000 -RCC.USART2Freq_Value=80000000 -RCC.VCOInputFreq_Value=4000000 -RCC.VCOOutputFreq_Value=160000000 -RCC.VCOSAI1OutputFreq_Value=32000000 -VP_SYS_VS_Systick.Mode=SysTick -VP_SYS_VS_Systick.Signal=SYS_VS_Systick -board=custom diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/include/gpio.h b/examples/projects/NUCLEO-L432KC/inspector_serialcom/include/gpio.h deleted file mode 100644 index f57136410..000000000 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/include/gpio.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.h - * @brief This file contains all the function prototypes for - * the gpio.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __GPIO_H__ -#define __GPIO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - - void MX_GPIO_Init(void); - - /* USER CODE BEGIN Prototypes */ - - /* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif -#endif /*__ GPIO_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/include/main.h b/examples/projects/NUCLEO-L432KC/inspector_serialcom/include/main.h deleted file mode 100644 index 677d953e4..000000000 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/include/main.h +++ /dev/null @@ -1,76 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.h - * @brief : Header for main.c file. - * This file contains the common defines of the application. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __MAIN_H -#define __MAIN_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "stm32l4xx_hal.h" - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void Error_Handler(void); - -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -/* Private defines -----------------------------------------------------------*/ -#define BTN_Pin GPIO_PIN_11 -#define BTN_GPIO_Port GPIOA -#define LED_Pin GPIO_PIN_3 -#define LED_GPIO_Port GPIOB - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - -#ifdef __cplusplus -} -#endif - -#endif /* __MAIN_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/include/stm32l4xx_hal_conf.h b/examples/projects/NUCLEO-L432KC/inspector_serialcom/include/stm32l4xx_hal_conf.h deleted file mode 100644 index 55d17eb7b..000000000 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/include/stm32l4xx_hal_conf.h +++ /dev/null @@ -1,484 +0,0 @@ -/** - ****************************************************************************** - * @file stm32l4xx_hal_conf.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32l4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef STM32L4xx_HAL_CONF_H -#define STM32L4xx_HAL_CONF_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED -/*#define HAL_ADC_MODULE_ENABLED */ -/*#define HAL_CRYP_MODULE_ENABLED */ -/*#define HAL_CAN_MODULE_ENABLED */ -/*#define HAL_COMP_MODULE_ENABLED */ -/*#define HAL_CRYP_MODULE_ENABLED */ -/*#define HAL_DAC_MODULE_ENABLED */ -/*#define HAL_DCMI_MODULE_ENABLED */ -/*#define HAL_DMA2D_MODULE_ENABLED */ -/*#define HAL_DFSDM_MODULE_ENABLED */ -/*#define HAL_DSI_MODULE_ENABLED */ -/*#define HAL_FIREWALL_MODULE_ENABLED */ -/*#define HAL_GFXMMU_MODULE_ENABLED */ -/*#define HAL_HCD_MODULE_ENABLED */ -/*#define HAL_HASH_MODULE_ENABLED */ -/*#define HAL_I2S_MODULE_ENABLED */ -/*#define HAL_IRDA_MODULE_ENABLED */ -/*#define HAL_IWDG_MODULE_ENABLED */ -/*#define HAL_LTDC_MODULE_ENABLED */ -/*#define HAL_LCD_MODULE_ENABLED */ -/*#define HAL_LPTIM_MODULE_ENABLED */ -/*#define HAL_MMC_MODULE_ENABLED */ -/*#define HAL_NAND_MODULE_ENABLED */ -/*#define HAL_NOR_MODULE_ENABLED */ -/*#define HAL_OPAMP_MODULE_ENABLED */ -/*#define HAL_OSPI_MODULE_ENABLED */ -/*#define HAL_OSPI_MODULE_ENABLED */ -/*#define HAL_PCD_MODULE_ENABLED */ -/*#define HAL_PKA_MODULE_ENABLED */ -/*#define HAL_QSPI_MODULE_ENABLED */ -/*#define HAL_QSPI_MODULE_ENABLED */ -/*#define HAL_RNG_MODULE_ENABLED */ -/*#define HAL_RTC_MODULE_ENABLED */ -/*#define HAL_SAI_MODULE_ENABLED */ -/*#define HAL_SD_MODULE_ENABLED */ -/*#define HAL_SMBUS_MODULE_ENABLED */ -/*#define HAL_SMARTCARD_MODULE_ENABLED */ -/*#define HAL_SPI_MODULE_ENABLED */ -/*#define HAL_SRAM_MODULE_ENABLED */ -/*#define HAL_SWPMI_MODULE_ENABLED */ -/*#define HAL_TSC_MODULE_ENABLED */ -/*#define HAL_WWDG_MODULE_ENABLED */ -/*#define HAL_EXTI_MODULE_ENABLED */ -/*#define HAL_PSSI_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_I2C_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_CRC_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED - -/* ########################## Oscillator Values adaptation ####################*/ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined(HSE_VALUE) -#define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined(HSE_STARTUP_TIMEOUT) -#define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal Multiple Speed oscillator (MSI) default value. - * This value is the default MSI range value after Reset. - */ -#if !defined(MSI_VALUE) -#define MSI_VALUE ((uint32_t)4000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* MSI_VALUE */ -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined(HSI_VALUE) -#define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal High Speed oscillator (HSI48) value for USB FS, SDMMC and RNG. - * This internal oscillator is mainly dedicated to provide a high precision clock to - * the USB peripheral by means of a special Clock Recovery System (CRS) circuitry. - * When the CRS is not used, the HSI48 RC oscillator runs on it default frequency - * which is subject to manufacturing process variations. - */ -#if !defined(HSI48_VALUE) -#define HSI48_VALUE ((uint32_t)48000000U) /*!< Value of the Internal High Speed oscillator for USB FS/SDMMC/RNG in Hz. \ - The real value my vary depending on manufacturing process variations.*/ -#endif /* HSI48_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined(LSI_VALUE) -#define LSI_VALUE 32000U /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz \ - The real value may vary depending on the variations \ - in voltage and temperature.*/ - -/** - * @brief External Low Speed oscillator (LSE) value. - * This value is used by the UART, RTC HAL module to compute the system frequency - */ -#if !defined(LSE_VALUE) -#define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/ -#endif /* LSE_VALUE */ - -#if !defined(LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for SAI1 peripheral - * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source - * frequency. - */ -#if !defined(EXTERNAL_SAI1_CLOCK_VALUE) -#define EXTERNAL_SAI1_CLOCK_VALUE 2097000U /*!< Value of the SAI1 External clock source in Hz*/ -#endif /* EXTERNAL_SAI1_CLOCK_VALUE */ - -/** - * @brief External clock source for SAI2 peripheral - * This value is used by the RCC HAL module to compute the SAI1 & SAI2 clock source - * frequency. - */ -#if !defined(EXTERNAL_SAI2_CLOCK_VALUE) -#define EXTERNAL_SAI2_CLOCK_VALUE 48000U /*!< Value of the SAI2 External clock source in Hz*/ -#endif /* EXTERNAL_SAI2_CLOCK_VALUE */ - - /* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - - /* ########################### System Configuration ######################### */ - /** - * @brief This is the HAL system configuration section - */ - -#define VDD_VALUE 3300U /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY 0U /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 0U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Register callback feature configuration ############### */ -/** - * @brief Set below the peripheral configuration to "1U" to add the support - * of HAL callback registration/deregistration feature for the HAL - * driver(s). This allows user application to provide specific callback - * functions thanks to HAL_PPP_RegisterCallback() rather than overwriting - * the default weak callback functions (see each stm32l4xx_hal_ppp.h file - * for possible callback identifiers defined in HAL_PPP_CallbackIDTypeDef - * for each PPP peripheral). - */ -#define USE_HAL_ADC_REGISTER_CALLBACKS 0U -#define USE_HAL_CAN_REGISTER_CALLBACKS 0U -#define USE_HAL_COMP_REGISTER_CALLBACKS 0U -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U -#define USE_HAL_DAC_REGISTER_CALLBACKS 0U -#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U -#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U -#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U -#define USE_HAL_DSI_REGISTER_CALLBACKS 0U -#define USE_HAL_GFXMMU_REGISTER_CALLBACKS 0U -#define USE_HAL_HASH_REGISTER_CALLBACKS 0U -#define USE_HAL_HCD_REGISTER_CALLBACKS 0U -#define USE_HAL_I2C_REGISTER_CALLBACKS 0U -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U -#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U -#define USE_HAL_MMC_REGISTER_CALLBACKS 0U -#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U -#define USE_HAL_OSPI_REGISTER_CALLBACKS 0U -#define USE_HAL_PCD_REGISTER_CALLBACKS 0U -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U -#define USE_HAL_RNG_REGISTER_CALLBACKS 0U -#define USE_HAL_RTC_REGISTER_CALLBACKS 0U -#define USE_HAL_SAI_REGISTER_CALLBACKS 0U -#define USE_HAL_SD_REGISTER_CALLBACKS 0U -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U -#define USE_HAL_SPI_REGISTER_CALLBACKS 0U -#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U -#define USE_HAL_TIM_REGISTER_CALLBACKS 0U -#define USE_HAL_TSC_REGISTER_CALLBACKS 0U -#define USE_HAL_UART_REGISTER_CALLBACKS 0U -#define USE_HAL_USART_REGISTER_CALLBACKS 0U -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U - - /* ################## SPI peripheral configuration ########################## */ - - /* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver - * Activated: CRC code is present inside driver - * Deactivated: CRC code cleaned from driver - */ - -#define USE_SPI_CRC 0U - - /* Includes ------------------------------------------------------------------*/ - /** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED -#include "stm32l4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED -#include "stm32l4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED -#include "stm32l4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED -#include "stm32l4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED -#include "stm32l4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED -#include "stm32l4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED -#include "stm32l4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CAN_LEGACY_MODULE_ENABLED -#include "Legacy/stm32l4xx_hal_can_legacy.h" -#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ - -#ifdef HAL_COMP_MODULE_ENABLED -#include "stm32l4xx_hal_comp.h" -#endif /* HAL_COMP_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED -#include "stm32l4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED -#include "stm32l4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED -#include "stm32l4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED -#include "stm32l4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED -#include "stm32l4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED -#include "stm32l4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED -#include "stm32l4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_GFXMMU_MODULE_ENABLED -#include "stm32l4xx_hal_gfxmmu.h" -#endif /* HAL_GFXMMU_MODULE_ENABLED */ - -#ifdef HAL_FIREWALL_MODULE_ENABLED -#include "stm32l4xx_hal_firewall.h" -#endif /* HAL_FIREWALL_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED -#include "stm32l4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED -#include "stm32l4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED -#include "stm32l4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED -#include "stm32l4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED -#include "stm32l4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED -#include "stm32l4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LCD_MODULE_ENABLED -#include "stm32l4xx_hal_lcd.h" -#endif /* HAL_LCD_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED -#include "stm32l4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED -#include "stm32l4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED -#include "stm32l4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED -#include "stm32l4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED -#include "stm32l4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_OPAMP_MODULE_ENABLED -#include "stm32l4xx_hal_opamp.h" -#endif /* HAL_OPAMP_MODULE_ENABLED */ - -#ifdef HAL_OSPI_MODULE_ENABLED -#include "stm32l4xx_hal_ospi.h" -#endif /* HAL_OSPI_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED -#include "stm32l4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_PKA_MODULE_ENABLED -#include "stm32l4xx_hal_pka.h" -#endif /* HAL_PKA_MODULE_ENABLED */ - -#ifdef HAL_PSSI_MODULE_ENABLED -#include "stm32l4xx_hal_pssi.h" -#endif /* HAL_PSSI_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED -#include "stm32l4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED -#include "stm32l4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED -#include "stm32l4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED -#include "stm32l4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED -#include "stm32l4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED -#include "stm32l4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED -#include "stm32l4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED -#include "stm32l4xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED -#include "stm32l4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED -#include "stm32l4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_SWPMI_MODULE_ENABLED -#include "stm32l4xx_hal_swpmi.h" -#endif /* HAL_SWPMI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED -#include "stm32l4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_TSC_MODULE_ENABLED -#include "stm32l4xx_hal_tsc.h" -#endif /* HAL_TSC_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED -#include "stm32l4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED -#include "stm32l4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED -#include "stm32l4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT - /** - * @brief The assert_param macro is used for function's parameters check. - * @param expr If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) - /* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t *file, uint32_t line); -#else -#define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* STM32L4xx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/include/stm32l4xx_it.h b/examples/projects/NUCLEO-L432KC/inspector_serialcom/include/stm32l4xx_it.h deleted file mode 100644 index f57963372..000000000 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/include/stm32l4xx_it.h +++ /dev/null @@ -1,70 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32l4xx_it.h - * @brief This file contains the headers of the interrupt handlers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32L4xx_IT_H -#define __STM32L4xx_IT_H - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void NMI_Handler(void); - void HardFault_Handler(void); - void MemManage_Handler(void); - void BusFault_Handler(void); - void UsageFault_Handler(void); - void SVC_Handler(void); - void DebugMon_Handler(void); - void PendSV_Handler(void); - void SysTick_Handler(void); - /* USER CODE BEGIN EFP */ - - /* USER CODE END EFP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32L4xx_IT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/linker/custom_Luos_bootloader_script.ld b/examples/projects/NUCLEO-L432KC/inspector_serialcom/linker/custom_Luos_bootloader_script.ld deleted file mode 100644 index dde7bb560..000000000 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/linker/custom_Luos_bootloader_script.ld +++ /dev/null @@ -1,175 +0,0 @@ -/** - ****************************************************************************** - * @file LinkerScript.ld - * @author Auto-generated by STM32CubeIDE - * @brief Linker script for STM32L432KCUx Device from STM32L4 series - * 256Kbytes FLASH - * 64Kbytes RAM - * - * Set heap size, stack size and stack location according - * to application requirements. - * - * Set memory bank area and size if external memory is used - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ - -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Memories definition */ -MEMORY -{ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K - FLASH (rx) : ORIGIN = 0x800C800, LENGTH = 206K -} - -/* Sections */ -SECTIONS -{ - /* The startup code into "FLASH" Rom type memory */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data into "FLASH" Rom type memory */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data into "FLASH" Rom type memory */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { - . = ALIGN(4); - *(.ARM.extab* .gnu.linkonce.armextab.*) - . = ALIGN(4); - } >FLASH - - .ARM : { - . = ALIGN(4); - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - . = ALIGN(4); - } >FLASH - - .preinit_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - . = ALIGN(4); - } >FLASH - - .init_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - . = ALIGN(4); - } >FLASH - - .fini_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - . = ALIGN(4); - } >FLASH - - /* Used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections into "RAM" Ram type memory */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - - } >RAM AT> FLASH - - /* Uninitialized data section into "RAM" Ram type memory */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - /* Remove information from the compiler libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h b/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h deleted file mode 100644 index 528815815..000000000 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/node_config.h +++ /dev/null @@ -1,116 +0,0 @@ -/****************************************************************************** - * @file node_config.h - * @brief This file allow you to use standard preprocessor definitions to - * configure your project, Luos and Luos HAL libraries - * - * # Introduction - * This file is for the luos user. You may here configure your project and - * define your custom Luos service and custom Luos command for your product - * - * Luos libraries offer a minimal standard configuration to optimize - * memory usage. In some case you have to modify standard value to fit - * with your need concerning among of data transiting through the network - * or network speed for example - * - * Luos libraries can be use with a lot a MCU family. Luos compagny give you - * a default configuration, for specific MCU family, in robus_hal_config.h. - * This configuration can be modify here to fit with you design by - * preprocessor definitions of MCU Hardware needs - * - * # Usage - * This file should be place a the root folder of your project and include - * where build flag preprocessor definitions are define in your IDE - * -include node_config.h - * - * @author Luos - * @version 0.0.0 - ******************************************************************************/ -#ifndef _NODE_CONFIG_H_ -#define _NODE_CONFIG_H_ - -/******************************************************************************* - * PROJECT DEFINITION - *******************************************************************************/ - -/******************************************************************************* - * LUOS LIBRARY DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node - * MAX_NODE_NUMBER. | 20 | Node number in the device - * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * NBR_PORT | 2 | PTP Branch number Max 8 - * NBR_RETRY | 10 | Send Retry number in case of NACK or collision - ******************************************************************************/ - -#define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 -#define NODETECTION - -/******************************************************************************* - * LUOS HAL LIBRARY DEFINITION -******************************************************************************* - * Define | Description - * :-----------------------|----------------------------------------------- - * MCUFREQ | Put your the MCU frequency (value in Hz) - * TIMERDIV | Timer divider clock (see your clock configuration) - * USE_CRC_HW | define to 0 if there is no Module CRC in your MCU - * USE_TX_IT | define to 1 to not use DMA transfert for Luos Tx - * - * PORT_CLOCK_ENABLE | Enable clock for port - * PTPx | A,B,C,D etc. PTP Branch Pin/Port/IRQ - * TX_LOCK_DETECT | Disable by default use if not busy flag in USART Pin/Port/IRQ - * RX_EN | Rx enable for driver RS485 always on Pin/Port - * TX_EN | Tx enable for driver RS485 Pin/Port - * COM_TX | Tx USART Com Pin/Port/Alternate - * COM_RX | Rx USART Com Pin/Port/Alternate - * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - - * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART - * ROBUS_COM | USART number - * ROBUS_COM_IRQ | USART IRQ number - * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - - * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA - * ROBUS_DMA | DMA number - * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - - * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * ROBUS_TIMER | Timer number - * ROBUS_TIMER_IRQ | Timer IRQ number - * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler -******************************************************************************/ - -/******************************************************************************* - * FLASH CONFIGURATION FOR APP WITH BOOTLOADER - ******************************************************************************** - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * BOOT_START_ADDRESS | FLASH_BASE = 0x8000000 | Start address of Bootloader in flash - * SHARED_MEMORY_ADDRESS | 0x0800C000 | Start address of shared memory to save boot flag - * APP_START_ADDRESS | 0x0800C800 | Start address of application with bootloader - * APP_END_ADDRESS | FLASH_END | End address of application with bootloader - ******************************************************************************/ - -/******************************************************************************* - * GATE SERIAL COM DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :-------------------------|------------------------------------------------------ - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * GATE_BUFF_SIZE | 1024 | Json receive buffer size - * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size - * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size - ******************************************************************************/ - -#define GATE_BUFF_SIZE 1024 -#define PIPE_TX_BUFFER_SIZE 1024 -#define PIPE_RX_BUFFER_SIZE 2048 - -#endif /* _NODE_CONFIG_H_ */ diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/platformio.ini b/examples/projects/NUCLEO-L432KC/inspector_serialcom/platformio.ini deleted file mode 100644 index 88e341e7c..000000000 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/platformio.ini +++ /dev/null @@ -1,56 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html -[platformio] -default_envs = nucleo_l432kc - -[env] -lib_ldf_mode =off -lib_extra_dirs = - $PROJECT_DIR/../../../../tool_services/ - $PROJECT_DIR/../../../../../ - $PROJECT_DIR/../../../../network/ -platform = ststm32 -board = nucleo_l432kc -framework = stm32cube -lib_deps = - luos_engine@^3.0.0 - robus_network - Inspector - Pipe -debug_tool = stlink -upload_protocol = stlink - -[env:nucleo_l432kc] -build_unflags = -Os -build_flags = - -O1 - -include node_config.h - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32L4 - -D PIPEMODE=SERIAL - -D PIPEHAL=NUCLEO-L4 - -[env:nucleo_l432kc_with_bootloader] -board_build.ldscript = linker/custom_Luos_bootloader_script.ld -build_unflags = -Os -build_flags = - -O1 - -include node_config.h - -DWITH_BOOTLOADER - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32L4 - -D PIPEMODE=SERIAL - -D PIPEHAL=NUCLEO-L4 -upload_protocol = custom -upload_flags = - -t2 -upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/gpio.c b/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/gpio.c deleted file mode 100644 index 0249ee815..000000000 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/gpio.c +++ /dev/null @@ -1,66 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.c - * @brief This file provides code for the configuration - * of all used GPIO pins. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "gpio.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/*----------------------------------------------------------------------------*/ -/* Configure GPIO */ -/*----------------------------------------------------------------------------*/ -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** Configure pins -*/ -void MX_GPIO_Init(void) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = BTN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(BTN_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = LED_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_PULLDOWN; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct); -} - -/* USER CODE BEGIN 2 */ - -/* USER CODE END 2 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/main.c b/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/main.c deleted file mode 100644 index 810ff43ed..000000000 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/main.c +++ /dev/null @@ -1,195 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.c - * @brief : Main program body - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "gpio.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -#include "luos_engine.h" -#include "robus_network.h" -#include "inspector.h" -#include "pipe.h" -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN PTD */ -/* USER CODE END PTD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -void SystemClock_Config(void); -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/** - * @brief The application entry point. - * @retval int - */ -int main(void) -{ - /* USER CODE BEGIN 1 */ - - /* USER CODE END 1 */ - - /* MCU Configuration--------------------------------------------------------*/ - - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ - HAL_Init(); - - /* USER CODE BEGIN Init */ - - /* USER CODE END Init */ - - /* Configure the system clock */ - SystemClock_Config(); - - /* USER CODE BEGIN SysInit */ - - /* USER CODE END SysInit */ - - /* Initialize all configured peripherals */ - MX_GPIO_Init(); - /* USER CODE BEGIN 2 */ - Luos_Init(); - Robus_Init(); - Inspector_Init(); - Pipe_Init(); - /* USER CODE END 2 */ - - /* Infinite loop */ - /* USER CODE BEGIN WHILE */ - while (1) - { - /* USER CODE END WHILE */ - - /* USER CODE BEGIN 3 */ - Luos_Loop(); - Inspector_Loop(); - Pipe_Loop(); - } - /* USER CODE END 3 */ -} - -/** - * @brief System Clock Configuration - * @retval None - */ -void SystemClock_Config(void) -{ - RCC_OscInitTypeDef RCC_OscInitStruct = {0}; - RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; - - /** Initializes the RCC Oscillators according to the specified parameters - * in the RCC_OscInitTypeDef structure. - */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI; - RCC_OscInitStruct.MSIState = RCC_MSI_ON; - RCC_OscInitStruct.MSICalibrationValue = 0; - RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI; - RCC_OscInitStruct.PLL.PLLM = 1; - RCC_OscInitStruct.PLL.PLLN = 40; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV7; - RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2; - RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) - { - Error_Handler(); - } - /** Initializes the CPU, AHB and APB buses clocks - */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK - | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK) - { - Error_Handler(); - } - /** Configure the main internal regulator output voltage - */ - if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1) != HAL_OK) - { - Error_Handler(); - } -} - -/* USER CODE BEGIN 4 */ - -/* USER CODE END 4 */ - -/** - * @brief This function is executed in case of error occurrence. - * @retval None - */ -void Error_Handler(void) -{ - /* USER CODE BEGIN Error_Handler_Debug */ - /* User can add his own implementation to report the HAL error return state */ - __disable_irq(); - while (1) - { - } - /* USER CODE END Error_Handler_Debug */ -} - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t *file, uint32_t line) -{ - /* USER CODE BEGIN 6 */ - /* User can add his own implementation to report the file name and line number, - ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ - /* USER CODE END 6 */ -} -#endif /* USE_FULL_ASSERT */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/stm32l4xx_hal_msp.c b/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/stm32l4xx_hal_msp.c deleted file mode 100644 index 1caf088bc..000000000 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/stm32l4xx_hal_msp.c +++ /dev/null @@ -1,84 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32l4xx_hal_msp.c - * @brief This file provides code for the MSP Initialization - * and de-Initialization codes. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN Define */ - -/* USER CODE END Define */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN Macro */ - -/* USER CODE END Macro */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* External functions --------------------------------------------------------*/ -/* USER CODE BEGIN ExternalFunctions */ - -/* USER CODE END ExternalFunctions */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ -/** - * Initializes the Global MSP. - */ -void HAL_MspInit(void) -{ - /* USER CODE BEGIN MspInit 0 */ - - /* USER CODE END MspInit 0 */ - - __HAL_RCC_SYSCFG_CLK_ENABLE(); - __HAL_RCC_PWR_CLK_ENABLE(); - - /* System interrupt init*/ - - /* USER CODE BEGIN MspInit 1 */ - - /* USER CODE END MspInit 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/stm32l4xx_it.c b/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/stm32l4xx_it.c deleted file mode 100644 index b297fd090..000000000 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/stm32l4xx_it.c +++ /dev/null @@ -1,213 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32l4xx_it.c - * @brief Interrupt Service Routines. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "stm32l4xx_it.h" -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* External variables --------------------------------------------------------*/ - -/* USER CODE BEGIN EV */ - -/* USER CODE END EV */ - -/******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ -/******************************************************************************/ -/** - * @brief This function handles Non maskable interrupt. - */ -void NMI_Handler(void) -{ - /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ - - /* USER CODE END NonMaskableInt_IRQn 0 */ - /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ - while (1) - { - } - /* USER CODE END NonMaskableInt_IRQn 1 */ -} - -/** - * @brief This function handles Hard fault interrupt. - */ -void HardFault_Handler(void) -{ - /* USER CODE BEGIN HardFault_IRQn 0 */ - - /* USER CODE END HardFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_HardFault_IRQn 0 */ - /* USER CODE END W1_HardFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Memory management fault. - */ -void MemManage_Handler(void) -{ - /* USER CODE BEGIN MemoryManagement_IRQn 0 */ - - /* USER CODE END MemoryManagement_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ - /* USER CODE END W1_MemoryManagement_IRQn 0 */ - } -} - -/** - * @brief This function handles Prefetch fault, memory access fault. - */ -void BusFault_Handler(void) -{ - /* USER CODE BEGIN BusFault_IRQn 0 */ - - /* USER CODE END BusFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_BusFault_IRQn 0 */ - /* USER CODE END W1_BusFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Undefined instruction or illegal state. - */ -void UsageFault_Handler(void) -{ - /* USER CODE BEGIN UsageFault_IRQn 0 */ - - /* USER CODE END UsageFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ - /* USER CODE END W1_UsageFault_IRQn 0 */ - } -} - -/** - * @brief This function handles System service call via SWI instruction. - */ -void SVC_Handler(void) -{ - /* USER CODE BEGIN SVCall_IRQn 0 */ - - /* USER CODE END SVCall_IRQn 0 */ - /* USER CODE BEGIN SVCall_IRQn 1 */ - - /* USER CODE END SVCall_IRQn 1 */ -} - -/** - * @brief This function handles Debug monitor. - */ -void DebugMon_Handler(void) -{ - /* USER CODE BEGIN DebugMonitor_IRQn 0 */ - - /* USER CODE END DebugMonitor_IRQn 0 */ - /* USER CODE BEGIN DebugMonitor_IRQn 1 */ - - /* USER CODE END DebugMonitor_IRQn 1 */ -} - -/** - * @brief This function handles Pendable request for system service. - */ -void PendSV_Handler(void) -{ - /* USER CODE BEGIN PendSV_IRQn 0 */ - - /* USER CODE END PendSV_IRQn 0 */ - /* USER CODE BEGIN PendSV_IRQn 1 */ - - /* USER CODE END PendSV_IRQn 1 */ -} - -/** - * @brief This function handles System tick timer. - */ -void SysTick_Handler(void) -{ - /* USER CODE BEGIN SysTick_IRQn 0 */ - - /* USER CODE END SysTick_IRQn 0 */ - HAL_IncTick(); - /* USER CODE BEGIN SysTick_IRQn 1 */ - - /* USER CODE END SysTick_IRQn 1 */ -} - -/******************************************************************************/ -/* STM32L4xx Peripheral Interrupt Handlers */ -/* Add here the Interrupt Handlers for the used peripherals. */ -/* For the available peripheral interrupt handler names, */ -/* please refer to the startup file (startup_stm32l4xx.s). */ -/******************************************************************************/ - -/* USER CODE BEGIN 1 */ -void EXTI9_5_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_5); -} - -void EXTI4_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_4); -} -/* USER CODE END 1 */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/system_stm32l4xx.c b/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/system_stm32l4xx.c deleted file mode 100644 index 3682d36f6..000000000 --- a/examples/projects/NUCLEO-L432KC/inspector_serialcom/src/system_stm32l4xx.c +++ /dev/null @@ -1,336 +0,0 @@ -/** - ****************************************************************************** - * @file system_stm32l4xx.c - * @author MCD Application Team - * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File - * - * This file provides two functions and one global variable to be called from - * user application: - * - SystemInit(): This function is called at startup just after reset and - * before branch to main program. This call is made inside - * the "startup_stm32l4xx.s" file. - * - * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick - * timer or configure other parameters. - * - * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must - * be called whenever the core clock is changed - * during program execution. - * - * After each device reset the MSI (4 MHz) is used as system clock source. - * Then SystemInit() function is called, in "startup_stm32l4xx.s" file, to - * configure the system clock before to branch to main program. - * - * This file configures the system clock as follows: - *============================================================================= - *----------------------------------------------------------------------------- - * System Clock source | MSI - *----------------------------------------------------------------------------- - * SYSCLK(Hz) | 4000000 - *----------------------------------------------------------------------------- - * HCLK(Hz) | 4000000 - *----------------------------------------------------------------------------- - * AHB Prescaler | 1 - *----------------------------------------------------------------------------- - * APB1 Prescaler | 1 - *----------------------------------------------------------------------------- - * APB2 Prescaler | 1 - *----------------------------------------------------------------------------- - * PLL_M | 1 - *----------------------------------------------------------------------------- - * PLL_N | 8 - *----------------------------------------------------------------------------- - * PLL_P | 7 - *----------------------------------------------------------------------------- - * PLL_Q | 2 - *----------------------------------------------------------------------------- - * PLL_R | 2 - *----------------------------------------------------------------------------- - * PLLSAI1_P | NA - *----------------------------------------------------------------------------- - * PLLSAI1_Q | NA - *----------------------------------------------------------------------------- - * PLLSAI1_R | NA - *----------------------------------------------------------------------------- - * PLLSAI2_P | NA - *----------------------------------------------------------------------------- - * PLLSAI2_Q | NA - *----------------------------------------------------------------------------- - * PLLSAI2_R | NA - *----------------------------------------------------------------------------- - * Require 48MHz for USB OTG FS, | Disabled - * SDIO and RNG clock | - *----------------------------------------------------------------------------- - *============================================================================= - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under Apache License, Version 2.0, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/Apache-2.0 - * - ****************************************************************************** - */ - -/** @addtogroup CMSIS - * @{ - */ - -/** @addtogroup stm32l4xx_system - * @{ - */ - -/** @addtogroup STM32L4xx_System_Private_Includes - * @{ - */ - -#include "stm32l4xx.h" - -#if !defined(HSE_VALUE) -#define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined(MSI_VALUE) -#define MSI_VALUE 4000000U /*!< Value of the Internal oscillator in Hz*/ -#endif /* MSI_VALUE */ - -#if !defined(HSI_VALUE) -#define HSI_VALUE 16000000U /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @} - */ - -/** @addtogroup STM32L4xx_System_Private_TypesDefinitions - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32L4xx_System_Private_Defines - * @{ - */ - -/************************* Miscellaneous Configuration ************************/ -/*!< Uncomment the following line if you need to relocate your vector Table in - Internal SRAM. */ -/* #define VECT_TAB_SRAM */ -#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. \ - This value must be a multiple of 0x200. */ -/******************************************************************************/ -/** - * @} - */ - -/** @addtogroup STM32L4xx_System_Private_Macros - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32L4xx_System_Private_Variables - * @{ - */ -/* The SystemCoreClock variable is updated in three ways: - 1) by calling CMSIS function SystemCoreClockUpdate() - 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency - Note: If you use this function to configure the system clock; then there - is no need to call the 2 first functions listed above, since SystemCoreClock - variable is updated automatically. - */ -uint32_t SystemCoreClock = 4000000U; - -const uint8_t AHBPrescTable[16] = {0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U, 6U, 7U, 8U, 9U}; -const uint8_t APBPrescTable[8] = {0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U}; -const uint32_t MSIRangeTable[12] = {100000U, 200000U, 400000U, 800000U, 1000000U, 2000000U, - 4000000U, 8000000U, 16000000U, 24000000U, 32000000U, 48000000U}; -/** - * @} - */ - -/** @addtogroup STM32L4xx_System_Private_FunctionPrototypes - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32L4xx_System_Private_Functions - * @{ - */ - -/** - * @brief Setup the microcontroller system. - * @param None - * @retval None - */ - -void SystemInit(void) -{ -/* FPU settings ------------------------------------------------------------*/ -#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) - SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10 and CP11 Full Access */ -#endif - - /* Reset the RCC clock configuration to the default reset state ------------*/ - /* Set MSION bit */ - RCC->CR |= RCC_CR_MSION; - - /* Reset CFGR register */ - RCC->CFGR = 0x00000000U; - - /* Reset HSEON, CSSON , HSION, and PLLON bits */ - RCC->CR &= 0xEAF6FFFFU; - - /* Reset PLLCFGR register */ - RCC->PLLCFGR = 0x00001000U; - - /* Reset HSEBYP bit */ - RCC->CR &= 0xFFFBFFFFU; - - /* Disable all interrupts */ - RCC->CIER = 0x00000000U; - - /* Configure the Vector Table location add offset address ------------------*/ -#ifdef VECT_TAB_SRAM - SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ -#else - SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ -#endif -} - -/** - * @brief Update SystemCoreClock variable according to Clock Register Values. - * The SystemCoreClock variable contains the core clock (HCLK), it can - * be used by the user application to setup the SysTick timer or configure - * other parameters. - * - * @note Each time the core clock (HCLK) changes, this function must be called - * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined - * constant and the selected clock source: - * - * - If SYSCLK source is MSI, SystemCoreClock will contain the MSI_VALUE(*) - * - * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(**) - * - * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(***) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(***) - * or HSI_VALUE(*) or MSI_VALUE(*) multiplied/divided by the PLL factors. - * - * (*) MSI_VALUE is a constant defined in stm32l4xx_hal.h file (default value - * 4 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * - * (**) HSI_VALUE is a constant defined in stm32l4xx_hal.h file (default value - * 16 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * - * (***) HSE_VALUE is a constant defined in stm32l4xx_hal.h file (default value - * 8 MHz), user has to ensure that HSE_VALUE is same as the real - * frequency of the crystal used. Otherwise, this function may - * have wrong result. - * - * - The result of this function could be not correct when using fractional - * value for HSE crystal. - * - * @param None - * @retval None - */ -void SystemCoreClockUpdate(void) -{ - uint32_t tmp = 0U, msirange = 0U, pllvco = 0U, pllr = 2U, pllsource = 0U, pllm = 2U; - - /* Get MSI Range frequency--------------------------------------------------*/ - if ((RCC->CR & RCC_CR_MSIRGSEL) == RESET) - { /* MSISRANGE from RCC_CSR applies */ - msirange = (RCC->CSR & RCC_CSR_MSISRANGE) >> 8U; - } - else - { /* MSIRANGE from RCC_CR applies */ - msirange = (RCC->CR & RCC_CR_MSIRANGE) >> 4U; - } - /*MSI frequency range in HZ*/ - msirange = MSIRangeTable[msirange]; - - /* Get SYSCLK source -------------------------------------------------------*/ - switch (RCC->CFGR & RCC_CFGR_SWS) - { - case 0x00: /* MSI used as system clock source */ - SystemCoreClock = msirange; - break; - - case 0x04: /* HSI used as system clock source */ - SystemCoreClock = HSI_VALUE; - break; - - case 0x08: /* HSE used as system clock source */ - SystemCoreClock = HSE_VALUE; - break; - - case 0x0C: /* PLL used as system clock source */ - /* PLL_VCO = (HSE_VALUE or HSI_VALUE or MSI_VALUE/ PLLM) * PLLN - SYSCLK = PLL_VCO / PLLR - */ - pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC); - pllm = ((RCC->PLLCFGR & RCC_PLLCFGR_PLLM) >> 4U) + 1U; - - switch (pllsource) - { - case 0x02: /* HSI used as PLL clock source */ - pllvco = (HSI_VALUE / pllm); - break; - - case 0x03: /* HSE used as PLL clock source */ - pllvco = (HSE_VALUE / pllm); - break; - - default: /* MSI used as PLL clock source */ - pllvco = (msirange / pllm); - break; - } - pllvco = pllvco * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 8U); - pllr = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLR) >> 25U) + 1U) * 2U; - SystemCoreClock = pllvco / pllr; - break; - - default: - SystemCoreClock = msirange; - break; - } - /* Compute HCLK clock frequency --------------------------------------------*/ - /* Get HCLK prescaler */ - tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4U)]; - /* HCLK clock frequency */ - SystemCoreClock >>= tmp; -} - -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/Inspector_SerialCom.ioc b/examples/projects/STM32F4-discovery/inspector_serialcom/Inspector_SerialCom.ioc deleted file mode 100644 index b4b45dc4b..000000000 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/Inspector_SerialCom.ioc +++ /dev/null @@ -1,104 +0,0 @@ -#MicroXplorer Configuration settings - do not modify -File.Version=6 -GPIO.groupedBy= -KeepUserPlacement=false -Mcu.Family=STM32F4 -Mcu.IP0=NVIC -Mcu.IP1=RCC -Mcu.IP2=SYS -Mcu.IPNb=3 -Mcu.Name=STM32F407V(E-G)Tx -Mcu.Package=LQFP100 -Mcu.Pin0=PA0-WKUP -Mcu.Pin1=PD12 -Mcu.Pin2=VP_SYS_VS_Systick -Mcu.PinsNb=3 -Mcu.ThirdPartyNb=0 -Mcu.UserConstants= -Mcu.UserName=STM32F407VGTx -MxCube.Version=6.1.1 -MxDb.Version=DB.6.0.10 -NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.ForceEnableDMAVector=true -NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 -NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true -NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -PA0-WKUP.GPIOParameters=GPIO_PuPd,GPIO_Label -PA0-WKUP.GPIO_Label=BTN -PA0-WKUP.GPIO_PuPd=GPIO_NOPULL -PA0-WKUP.Locked=true -PA0-WKUP.Signal=GPIO_Input -PD12.GPIOParameters=GPIO_Label -PD12.GPIO_Label=LED -PD12.Locked=true -PD12.Signal=GPIO_Output -PinOutPanel.RotationAngle=0 -ProjectManager.AskForMigrate=true -ProjectManager.BackupPrevious=false -ProjectManager.CompilerOptimize=6 -ProjectManager.ComputerToolchain=false -ProjectManager.CoupleFile=true -ProjectManager.CustomerFirmwarePackage= -ProjectManager.DefaultFWLocation=true -ProjectManager.DeletePrevious=true -ProjectManager.DeviceId=STM32F407VGTx -ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.25.2 -ProjectManager.FreePins=false -ProjectManager.HalAssertFull=false -ProjectManager.HeapSize=0x0 -ProjectManager.KeepUserCode=true -ProjectManager.LastFirmware=true -ProjectManager.LibraryCopy=1 -ProjectManager.MainLocation=Src -ProjectManager.NoMain=false -ProjectManager.PreviousToolchain= -ProjectManager.ProjectBuild=false -ProjectManager.ProjectFileName=Gate.ioc -ProjectManager.ProjectName=Gate -ProjectManager.RegisterCallBack= -ProjectManager.StackSize=0x400 -ProjectManager.TargetToolchain=Other Toolchains (GPDSC) -ProjectManager.ToolChainLocation= -ProjectManager.UnderRoot=false -ProjectManager.functionlistsort=2-SystemClock_Config-RCC-false-HAL-false -RCC.48MHZClocksFreq_Value=84000000 -RCC.AHBFreq_Value=168000000 -RCC.APB1CLKDivider=RCC_HCLK_DIV4 -RCC.APB1Freq_Value=42000000 -RCC.APB1TimFreq_Value=84000000 -RCC.APB2CLKDivider=RCC_HCLK_DIV2 -RCC.APB2Freq_Value=84000000 -RCC.APB2TimFreq_Value=168000000 -RCC.CortexFreq_Value=168000000 -RCC.EthernetFreq_Value=168000000 -RCC.FCLKCortexFreq_Value=168000000 -RCC.FamilyName=M -RCC.HCLKFreq_Value=168000000 -RCC.HSE_VALUE=25000000 -RCC.HSI_VALUE=16000000 -RCC.I2SClocksFreq_Value=192000000 -RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LSE_VALUE,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQCLKFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VcooutputI2S -RCC.LSE_VALUE=32768 -RCC.LSI_VALUE=32000 -RCC.MCO2PinFreq_Value=168000000 -RCC.PLLCLKFreq_Value=168000000 -RCC.PLLM=8 -RCC.PLLN=168 -RCC.PLLQCLKFreq_Value=84000000 -RCC.RTCFreq_Value=32000 -RCC.RTCHSEDivFreq_Value=12500000 -RCC.SYSCLKFreq_VALUE=168000000 -RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK -RCC.VCOI2SOutputFreq_Value=384000000 -RCC.VCOInputFreq_Value=2000000 -RCC.VCOOutputFreq_Value=336000000 -RCC.VcooutputI2S=192000000 -VP_SYS_VS_Systick.Mode=SysTick -VP_SYS_VS_Systick.Signal=SYS_VS_Systick -board=custom diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/include/gpio.h b/examples/projects/STM32F4-discovery/inspector_serialcom/include/gpio.h deleted file mode 100644 index f57136410..000000000 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/include/gpio.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.h - * @brief This file contains all the function prototypes for - * the gpio.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __GPIO_H__ -#define __GPIO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - - void MX_GPIO_Init(void); - - /* USER CODE BEGIN Prototypes */ - - /* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif -#endif /*__ GPIO_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/include/main.h b/examples/projects/STM32F4-discovery/inspector_serialcom/include/main.h deleted file mode 100644 index 08e94c8e9..000000000 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/include/main.h +++ /dev/null @@ -1,76 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.h - * @brief : Header for main.c file. - * This file contains the common defines of the application. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __MAIN_H -#define __MAIN_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "stm32f4xx_hal.h" - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void Error_Handler(void); - -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -/* Private defines -----------------------------------------------------------*/ -#define BTN_Pin GPIO_PIN_0 -#define BTN_GPIO_Port GPIOA -#define LED_Pin GPIO_PIN_12 -#define LED_GPIO_Port GPIOD - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - -#ifdef __cplusplus -} -#endif - -#endif /* __MAIN_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/include/stm32f4xx_hal_conf.h b/examples/projects/STM32F4-discovery/inspector_serialcom/include/stm32f4xx_hal_conf.h deleted file mode 100644 index ac7527654..000000000 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/include/stm32f4xx_hal_conf.h +++ /dev/null @@ -1,490 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f4xx_hal_conf_template.h - * @author MCD Application Team - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32f4xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_HAL_CONF_H -#define __STM32F4xx_HAL_CONF_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - - /* #define HAL_ADC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_CAN_MODULE_ENABLED */ -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CAN_LEGACY_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_PCCARD_MODULE_ENABLED */ -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_HASH_MODULE_ENABLED */ -/* #define HAL_I2C_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -/* #define HAL_SPI_MODULE_ENABLED */ -/* #define HAL_TIM_MODULE_ENABLED */ -/* #define HAL_UART_MODULE_ENABLED */ -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_SMBUS_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ -/* #define HAL_PCD_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_DSI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_FMPI2C_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_TIM_MODULE_ENABLED -#define HAL_UART_MODULE_ENABLED -#define HAL_USART_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined(HSE_VALUE) -#define HSE_VALUE ((uint32_t)25000000U) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined(HSE_STARTUP_TIMEOUT) -#define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined(HSI_VALUE) -#define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined(LSI_VALUE) -#define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz \ - The real value may vary depending on the variations \ - in voltage and temperature.*/ -/** - * @brief External Low Speed oscillator (LSE) value. - */ -#if !defined(LSE_VALUE) -#define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -#if !defined(LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined(EXTERNAL_CLOCK_VALUE) -#define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the External audio frequency in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0U) /*!< tick interrupt priority */ -#define USE_RTOS 0U -#define PREFETCH_ENABLE 1U -#define INSTRUCTION_CACHE_ENABLE 1U -#define DATA_CACHE_ENABLE 1U - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ -#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ -#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ -#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ -#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ -#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ -#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ -#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ -#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ -#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ -#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ -#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ -#define USE_HAL_FMPI2C_REGISTER_CALLBACKS 0U /* FMPI2C register callback disabled */ -#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ -#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ -#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */ -#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ -#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ -#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */ -#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ -#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ -#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ -#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ -#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */ -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ -#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ -#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ -#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ -#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ -#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ -#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ -#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1U */ - -/* ################## Ethernet peripheral configuration ##################### */ - -/* Section 1 : Ethernet peripheral configuration */ - -/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */ -#define MAC_ADDR0 2U -#define MAC_ADDR1 0U -#define MAC_ADDR2 0U -#define MAC_ADDR3 0U -#define MAC_ADDR4 0U -#define MAC_ADDR5 0U - -/* Definition of the Ethernet driver buffers size and count */ -#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */ -#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */ -#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */ -#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */ - -/* Section 2: PHY configuration section */ - -/* DP83848_PHY_ADDRESS Address*/ -#define DP83848_PHY_ADDRESS 0x01U -/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/ -#define PHY_RESET_DELAY ((uint32_t)0x000000FFU) -/* PHY Configuration delay */ -#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU) - -#define PHY_READ_TO ((uint32_t)0x0000FFFFU) -#define PHY_WRITE_TO ((uint32_t)0x0000FFFFU) - - /* Section 3: Common PHY Registers */ - -#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */ -#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */ - -#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */ -#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */ -#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */ -#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000U) /*!< Set the half-duplex mode at 100 Mb/s */ -#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100U) /*!< Set the full-duplex mode at 10 Mb/s */ -#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000U) /*!< Set the half-duplex mode at 10 Mb/s */ -#define PHY_AUTONEGOTIATION ((uint16_t)0x1000U) /*!< Enable auto-negotiation function */ -#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200U) /*!< Restart auto-negotiation function */ -#define PHY_POWERDOWN ((uint16_t)0x0800U) /*!< Select the power down mode */ -#define PHY_ISOLATE ((uint16_t)0x0400U) /*!< Isolate PHY from MII */ - -#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */ -#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */ -#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */ - -/* Section 4: Extended PHY Registers */ -#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */ - -#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */ -#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */ - - /* ################## SPI peripheral configuration ########################## */ - - /* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver -* Activated: CRC code is present inside driver -* Deactivated: CRC code cleaned from driver -*/ - -#define USE_SPI_CRC 0U - - /* Includes ------------------------------------------------------------------*/ - /** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED -#include "stm32f4xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED -#include "stm32f4xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED -#include "stm32f4xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED -#include "stm32f4xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED -#include "stm32f4xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED -#include "stm32f4xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED -#include "stm32f4xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CAN_LEGACY_MODULE_ENABLED -#include "stm32f4xx_hal_can_legacy.h" -#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED -#include "stm32f4xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED -#include "stm32f4xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED -#include "stm32f4xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED -#include "stm32f4xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED -#include "stm32f4xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED -#include "stm32f4xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED -#include "stm32f4xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED -#include "stm32f4xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED -#include "stm32f4xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED -#include "stm32f4xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_PCCARD_MODULE_ENABLED -#include "stm32f4xx_hal_pccard.h" -#endif /* HAL_PCCARD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED -#include "stm32f4xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED -#include "stm32f4xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED -#include "stm32f4xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED -#include "stm32f4xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED -#include "stm32f4xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED -#include "stm32f4xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED -#include "stm32f4xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED -#include "stm32f4xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED -#include "stm32f4xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED -#include "stm32f4xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED -#include "stm32f4xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED -#include "stm32f4xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED -#include "stm32f4xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED -#include "stm32f4xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED -#include "stm32f4xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED -#include "stm32f4xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED -#include "stm32f4xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED -#include "stm32f4xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED -#include "stm32f4xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED -#include "stm32f4xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED -#include "stm32f4xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED -#include "stm32f4xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED -#include "stm32f4xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED -#include "stm32f4xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_FMPI2C_MODULE_ENABLED -#include "stm32f4xx_hal_fmpi2c.h" -#endif /* HAL_FMPI2C_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED -#include "stm32f4xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED -#include "stm32f4xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED -#include "stm32f4xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED -#include "stm32f4xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT - /** - * @brief The assert_param macro is used for function's parameters check. - * @param expr If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) - /* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t *file, uint32_t line); -#else -#define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/include/stm32f4xx_it.h b/examples/projects/STM32F4-discovery/inspector_serialcom/include/stm32f4xx_it.h deleted file mode 100644 index c6fdc0092..000000000 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/include/stm32f4xx_it.h +++ /dev/null @@ -1,70 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f4xx_it.h - * @brief This file contains the headers of the interrupt handlers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F4xx_IT_H -#define __STM32F4xx_IT_H - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void NMI_Handler(void); - void HardFault_Handler(void); - void MemManage_Handler(void); - void BusFault_Handler(void); - void UsageFault_Handler(void); - void SVC_Handler(void); - void DebugMon_Handler(void); - void PendSV_Handler(void); - void SysTick_Handler(void); - /* USER CODE BEGIN EFP */ - - /* USER CODE END EFP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F4xx_IT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/linker/custom_app_script.ld b/examples/projects/STM32F4-discovery/inspector_serialcom/linker/custom_app_script.ld deleted file mode 100644 index 550179ead..000000000 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/linker/custom_app_script.ld +++ /dev/null @@ -1,207 +0,0 @@ -/* -****************************************************************************** -** -** @file : LinkerScript.ld -** -** @author : Auto-generated by STM32CubeIDE -** -** @brief : Linker script for STM32F407VGTx Device from STM32F4 series -** 1024Kbytes FLASH -** 64Kbytes CCMRAM -** 128Kbytes RAM -** -** Set heap size, stack size and stack location according -** to application requirements. -** -** Set memory bank area and size if external memory is used -** -** Target : STMicroelectronics STM32 -** -** Distribution: The file is distributed as is, without any warranty -** of any kind. -** -****************************************************************************** -** @attention -** -**

© Copyright (c) 2021 STMicroelectronics. -** All rights reserved.

-** -** This software component is licensed by ST under BSD 3-Clause license, -** the "License"; You may not use this file except in compliance with the -** License. You may obtain a copy of the License at: -** opensource.org/licenses/BSD-3-Clause -** -****************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ - -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Memories definition */ -MEMORY -{ - CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K - FLASH (rw) : ORIGIN = 0x08010000, LENGTH = 960K -} - -/* Sections */ -SECTIONS -{ - /* The startup code into "FLASH" Rom type memory */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data into "FLASH" Rom type memory */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data into "FLASH" Rom type memory */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { - . = ALIGN(4); - *(.ARM.extab* .gnu.linkonce.armextab.*) - . = ALIGN(4); - } >FLASH - - .ARM : { - . = ALIGN(4); - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - . = ALIGN(4); - } >FLASH - - .preinit_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - . = ALIGN(4); - } >FLASH - - .init_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - . = ALIGN(4); - } >FLASH - - .fini_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - . = ALIGN(4); - } >FLASH - - /* Used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections into "RAM" Ram type memory */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - *(.RamFunc) /* .RamFunc sections */ - *(.RamFunc*) /* .RamFunc* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - - } >RAM AT> FLASH - - _siccmram = LOADADDR(.ccmram); - - /* CCM-RAM section - * - * IMPORTANT NOTE! - * If initialized variables will be placed in this section, - * the startup code needs to be modified to copy the init-values. - */ - .ccmram : - { - . = ALIGN(4); - _sccmram = .; /* create a global symbol at ccmram start */ - *(.ccmram) - *(.ccmram*) - - . = ALIGN(4); - _eccmram = .; /* create a global symbol at ccmram end */ - } >CCMRAM AT> FLASH - - /* Uninitialized data section into "RAM" Ram type memory */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - /* Remove information from the compiler libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h b/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h deleted file mode 100644 index bb0b229f0..000000000 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/node_config.h +++ /dev/null @@ -1,119 +0,0 @@ -/****************************************************************************** - * @file node_config.h - * @brief This file allow you to use standard preprocessor definitions to - * configure your project, Luos and Luos HAL libraries - * - * # Introduction - * This file is for the luos user. You may here configure your project and - * define your custom Luos service and custom Luos command for your product - * - * Luos libraries offer a minimal standard configuration to optimize - * memory usage. In some case you have to modify standard value to fit - * with your need concerning among of data transiting through the network - * or network speed for example - * - * Luos libraries can be use with a lot a MCU family. Luos compagny give you - * a default configuration, for specific MCU family, in robus_hal_config.h. - * This configuration can be modify here to fit with you design by - * preprocessor definitions of MCU Hardware needs - * - * # Usage - * This file should be place a the root folder of your project and include - * where build flag preprocessor definitions are define in your IDE - * -include node_config.h - * - * @author Luos - * @version 0.0.0 - ******************************************************************************/ -#ifndef _NODE_CONFIG_H_ -#define _NODE_CONFIG_H_ - -/******************************************************************************* - * PROJECT DEFINITION - *******************************************************************************/ - -/******************************************************************************* - * LUOS LIBRARY DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node - * MAX_NODE_NUMBER. | 20 | Node number in the device - * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * NBR_PORT | 2 | PTP Branch number Max 8 - * NBR_RETRY | 10 | Send Retry number in case of NACK or collision - ******************************************************************************/ - -#define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 -#define NODETECTION - -/******************************************************************************* - * LUOS HAL LIBRARY DEFINITION -******************************************************************************* - * Define | Description - * :-----------------------|----------------------------------------------- - * MCUFREQ | Put your the MCU frequency (value in Hz) - * TIMERDIV | Timer divider clock (see your clock configuration) - * USE_CRC_HW | define to 0 if there is no Module CRC in your MCU - * USE_TX_IT | define to 1 to not use DMA transfert for Luos Tx - * - * PORT_CLOCK_ENABLE | Enable clock for port - * PTPx | A,B,C,D etc. PTP Branch Pin/Port/IRQ - * TX_LOCK_DETECT | Disable by default use if not busy flag in USART Pin/Port/IRQ - * RX_EN | Rx enable for driver RS485 always on Pin/Port - * TX_EN | Tx enable for driver RS485 Pin/Port - * COM_TX | Tx USART Com Pin/Port/Alternate - * COM_RX | Rx USART Com Pin/Port/Alternate - * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - - * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART - * ROBUS_COM | USART number - * ROBUS_COM_IRQ | USART IRQ number - * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - - * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA - * ROBUS_DMA | DMA number - * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - - * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * ROBUS_TIMER | Timer number - * ROBUS_TIMER_IRQ | Timer IRQ number - * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler -******************************************************************************/ - -/******************************************************************************* - * FLASH CONFIGURATION FOR APP WITH BOOTLOADER - ******************************************************************************** - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * BOOT_START_ADDRESS | FLASH_BASE = 0x8000000 | Start address of Bootloader in flash - * SHARED_MEMORY_ADDRESS | 0x0800C000 | Start address of shared memory to save boot flag - * SHARED_MEMORY_SECTOR | FLASH_SECTOR_3 | Start sector of shared memory - * APP_START_ADDRESS | 0x08010000 | Start address of application with bootloader - * APP_END_ADDRESS | FLASH_END | End address of application with bootloader - * APP_START_SECTOR | FLASH_SECTOR_4 | Start sector of application with bootloader - * APP_END_SECTOR | FLASH_SECTOR_TOTAL - 1 | last sector of application with bootloader - ******************************************************************************/ - -/******************************************************************************* - * GATE SERIAL COM DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :-------------------------|------------------------------------------------------ - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * GATE_BUFF_SIZE | 1024 | Json receive buffer size - * PIPE_TX_BUFFER_SIZE | 1024 | Receive pipe buffer size - * PIPE_RX_BUFFER_SIZE | 2048 | Transmit pipe buffer size - ******************************************************************************/ - -#define GATE_BUFF_SIZE 1024 -#define PIPE_TX_BUFFER_SIZE 1024 -#define PIPE_RX_BUFFER_SIZE 2048 - -#endif /* _NODE_CONFIG_H_ */ diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/platformio.ini b/examples/projects/STM32F4-discovery/inspector_serialcom/platformio.ini deleted file mode 100644 index 6f1a6a041..000000000 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/platformio.ini +++ /dev/null @@ -1,67 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html -[platformio] -default_envs = STM32F4-discovery - -[env:STM32F4-discovery] -platform = ststm32 -board = disco_f407vg -framework = stm32cube -lib_ldf_mode =off -build_unflags = -Os -build_flags = - -include node_config.h - -D GATEFORMAT=TinyJSON - -O1 - -D PIPEMODE=SERIAL - -D PIPEHAL=NUCLEO-F4 - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32F4 -lib_extra_dirs = - $PROJECT_DIR/../../../../tool_services/ - $PROJECT_DIR/../../../../../ - $PROJECT_DIR/../../../../network/ -lib_deps = - luos_engine@^3.0.0 - robus_network - Inspector - Pipe -debug_tool = stlink - -[env:STM32F4_discovery_with_bootloader] -lib_ldf_mode =off -board_build.ldscript = linker/custom_app_script.ld -lib_extra_dirs = - $PROJECT_DIR/../../../../tool_services/ - $PROJECT_DIR/../../../../../ - $PROJECT_DIR/../../../../network/ -platform = ststm32 -board = disco_f407vg -framework = stm32cube -build_unflags = -Os -build_flags = - -include node_config.h - -O1 - -D PIPEMODE=SERIAL - -D PIPEHAL=NUCLEO-F4 - -DWITH_BOOTLOADER - -DUSE_HAL_DRIVER - -DUSE_FULL_LL_DRIVER - -DLUOSHAL=STM32F4 -lib_deps = - luos_engine@^3.0.0 - robus_network - Inspector - Pipe -upload_protocol = custom -upload_flags = - -t2 -upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/src/gpio.c b/examples/projects/STM32F4-discovery/inspector_serialcom/src/gpio.c deleted file mode 100644 index 0cf15e1dd..000000000 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/src/gpio.c +++ /dev/null @@ -1,66 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.c - * @brief This file provides code for the configuration - * of all used GPIO pins. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "gpio.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/*----------------------------------------------------------------------------*/ -/* Configure GPIO */ -/*----------------------------------------------------------------------------*/ -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** Configure pins -*/ -void MX_GPIO_Init(void) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = BTN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(BTN_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = LED_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct); -} - -/* USER CODE BEGIN 2 */ - -/* USER CODE END 2 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/src/main.c b/examples/projects/STM32F4-discovery/inspector_serialcom/src/main.c deleted file mode 100644 index 747208dd3..000000000 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/src/main.c +++ /dev/null @@ -1,192 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.c - * @brief : Main program body - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "gpio.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -#include "luos_engine.h" -#include "robus_network.h" -#include "inspector.h" -#include "pipe.h" -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN PTD */ -/* USER CODE END PTD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -void SystemClock_Config(void); -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/** - * @brief The application entry point. - * @retval int - */ -int main(void) -{ - /* USER CODE BEGIN 1 */ - - /* USER CODE END 1 */ - - /* MCU Configuration--------------------------------------------------------*/ - - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ - HAL_Init(); - - /* USER CODE BEGIN Init */ - - /* USER CODE END Init */ - - /* Configure the system clock */ - SystemClock_Config(); - - /* USER CODE BEGIN SysInit */ - - /* USER CODE END SysInit */ - - /* Initialize all configured peripherals */ - MX_GPIO_Init(); - /* USER CODE BEGIN 2 */ - Luos_Init(); - Robus_Init(); - Inspector_Init(); - Pipe_Init(); - - /* USER CODE END 2 */ - - /* Infinite loop */ - /* USER CODE BEGIN WHILE */ - while (1) - { - /* USER CODE END WHILE */ - - /* USER CODE BEGIN 3 */ - Luos_Loop(); - Inspector_Loop(); - Pipe_Loop(); - } - /* USER CODE END 3 */ -} - -/** - * @brief System Clock Configuration - * @retval None - */ -void SystemClock_Config(void) -{ - RCC_OscInitTypeDef RCC_OscInitStruct = {0}; - RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; - - /** Configure the main internal regulator output voltage - */ - __HAL_RCC_PWR_CLK_ENABLE(); - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - /** Initializes the RCC Oscillators according to the specified parameters - * in the RCC_OscInitTypeDef structure. - */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; - RCC_OscInitStruct.HSIState = RCC_HSI_ON; - RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; - RCC_OscInitStruct.PLL.PLLM = 8; - RCC_OscInitStruct.PLL.PLLN = 168; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 4; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) - { - Error_Handler(); - } - /** Initializes the CPU, AHB and APB buses clocks - */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK - | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; - - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) - { - Error_Handler(); - } -} - -/* USER CODE BEGIN 4 */ - -/* USER CODE END 4 */ - -/** - * @brief This function is executed in case of error occurrence. - * @retval None - */ -void Error_Handler(void) -{ - /* USER CODE BEGIN Error_Handler_Debug */ - /* User can add his own implementation to report the HAL error return state */ - __disable_irq(); - while (1) - { - } - /* USER CODE END Error_Handler_Debug */ -} - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t *file, uint32_t line) -{ - /* USER CODE BEGIN 6 */ - /* User can add his own implementation to report the file name and line number, - ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ - /* USER CODE END 6 */ -} -#endif /* USE_FULL_ASSERT */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/src/stm32f4xx_hal_msp.c b/examples/projects/STM32F4-discovery/inspector_serialcom/src/stm32f4xx_hal_msp.c deleted file mode 100644 index a182b75ef..000000000 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/src/stm32f4xx_hal_msp.c +++ /dev/null @@ -1,84 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f4xx_hal_msp.c - * @brief This file provides code for the MSP Initialization - * and de-Initialization codes. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN Define */ - -/* USER CODE END Define */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN Macro */ - -/* USER CODE END Macro */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* External functions --------------------------------------------------------*/ -/* USER CODE BEGIN ExternalFunctions */ - -/* USER CODE END ExternalFunctions */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ -/** - * Initializes the Global MSP. - */ -void HAL_MspInit(void) -{ - /* USER CODE BEGIN MspInit 0 */ - - /* USER CODE END MspInit 0 */ - - __HAL_RCC_SYSCFG_CLK_ENABLE(); - __HAL_RCC_PWR_CLK_ENABLE(); - - /* System interrupt init*/ - - /* USER CODE BEGIN MspInit 1 */ - - /* USER CODE END MspInit 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/src/stm32f4xx_it.c b/examples/projects/STM32F4-discovery/inspector_serialcom/src/stm32f4xx_it.c deleted file mode 100644 index d6078c2f2..000000000 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/src/stm32f4xx_it.c +++ /dev/null @@ -1,218 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f4xx_it.c - * @brief Interrupt Service Routines. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "stm32f4xx_it.h" -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* External variables --------------------------------------------------------*/ - -/* USER CODE BEGIN EV */ - -/* USER CODE END EV */ - -/******************************************************************************/ -/* Cortex-M4 Processor Interruption and Exception Handlers */ -/******************************************************************************/ -/** - * @brief This function handles Non maskable interrupt. - */ -void NMI_Handler(void) -{ - /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ - - /* USER CODE END NonMaskableInt_IRQn 0 */ - /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ - while (1) - { - } - /* USER CODE END NonMaskableInt_IRQn 1 */ -} - -/** - * @brief This function handles Hard fault interrupt. - */ -void HardFault_Handler(void) -{ - /* USER CODE BEGIN HardFault_IRQn 0 */ - - /* USER CODE END HardFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_HardFault_IRQn 0 */ - /* USER CODE END W1_HardFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Memory management fault. - */ -void MemManage_Handler(void) -{ - /* USER CODE BEGIN MemoryManagement_IRQn 0 */ - - /* USER CODE END MemoryManagement_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ - /* USER CODE END W1_MemoryManagement_IRQn 0 */ - } -} - -/** - * @brief This function handles Pre-fetch fault, memory access fault. - */ -void BusFault_Handler(void) -{ - /* USER CODE BEGIN BusFault_IRQn 0 */ - - /* USER CODE END BusFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_BusFault_IRQn 0 */ - /* USER CODE END W1_BusFault_IRQn 0 */ - } -} - -/** - * @brief This function handles Undefined instruction or illegal state. - */ -void UsageFault_Handler(void) -{ - /* USER CODE BEGIN UsageFault_IRQn 0 */ - - /* USER CODE END UsageFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ - /* USER CODE END W1_UsageFault_IRQn 0 */ - } -} - -/** - * @brief This function handles System service call via SWI instruction. - */ -void SVC_Handler(void) -{ - /* USER CODE BEGIN SVCall_IRQn 0 */ - - /* USER CODE END SVCall_IRQn 0 */ - /* USER CODE BEGIN SVCall_IRQn 1 */ - - /* USER CODE END SVCall_IRQn 1 */ -} - -/** - * @brief This function handles Debug monitor. - */ -void DebugMon_Handler(void) -{ - /* USER CODE BEGIN DebugMonitor_IRQn 0 */ - - /* USER CODE END DebugMonitor_IRQn 0 */ - /* USER CODE BEGIN DebugMonitor_IRQn 1 */ - - /* USER CODE END DebugMonitor_IRQn 1 */ -} - -/** - * @brief This function handles Pendable request for system service. - */ -void PendSV_Handler(void) -{ - /* USER CODE BEGIN PendSV_IRQn 0 */ - - /* USER CODE END PendSV_IRQn 0 */ - /* USER CODE BEGIN PendSV_IRQn 1 */ - - /* USER CODE END PendSV_IRQn 1 */ -} - -/** - * @brief This function handles System tick timer. - */ -void SysTick_Handler(void) -{ - /* USER CODE BEGIN SysTick_IRQn 0 */ - - /* USER CODE END SysTick_IRQn 0 */ - HAL_IncTick(); - /* USER CODE BEGIN SysTick_IRQn 1 */ - - /* USER CODE END SysTick_IRQn 1 */ -} - -/******************************************************************************/ -/* STM32F4xx Peripheral Interrupt Handlers */ -/* Add here the Interrupt Handlers for the used peripherals. */ -/* For the available peripheral interrupt handler names, */ -/* please refer to the startup file (startup_stm32f4xx.s). */ -/******************************************************************************/ - -/* USER CODE BEGIN 1 */ -void EXTI4_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_4); -} - -void EXTI9_5_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_5); -} - -void EXTI15_10_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_10); -} -/* USER CODE END 1 */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/STM32F4-discovery/inspector_serialcom/src/system_stm32f4xx.c b/examples/projects/STM32F4-discovery/inspector_serialcom/src/system_stm32f4xx.c deleted file mode 100644 index 80a5d6644..000000000 --- a/examples/projects/STM32F4-discovery/inspector_serialcom/src/system_stm32f4xx.c +++ /dev/null @@ -1,731 +0,0 @@ -/** - ****************************************************************************** - * @file system_stm32f4xx.c - * @author MCD Application Team - * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File. - * - * This file provides two functions and one global variable to be called from - * user application: - * - SystemInit(): This function is called at startup just after reset and - * before branch to main program. This call is made inside - * the "startup_stm32f4xx.s" file. - * - * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick - * timer or configure other parameters. - * - * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must - * be called whenever the core clock is changed - * during program execution. - * - * - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2017 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/** @addtogroup CMSIS - * @{ - */ - -/** @addtogroup stm32f4xx_system - * @{ - */ - -/** @addtogroup STM32F4xx_System_Private_Includes - * @{ - */ - -#include "stm32f4xx.h" - -#if !defined(HSE_VALUE) -#define HSE_VALUE ((uint32_t)25000000) /*!< Default value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined(HSI_VALUE) -#define HSI_VALUE ((uint32_t)16000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_TypesDefinitions - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Defines - * @{ - */ - -/************************* Miscellaneous Configuration ************************/ -/*!< Uncomment the following line if you need to use external SRAM or SDRAM as data memory */ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) \ - || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) -/* #define DATA_IN_ExtSRAM */ -#endif /* STM32F40xxx || STM32F41xxx || STM32F42xxx || STM32F43xxx || STM32F469xx || STM32F479xx || \ - STM32F412Zx || STM32F412Vx */ - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) -/* #define DATA_IN_ExtSDRAM */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || \ - STM32F479xx */ - -/*!< Uncomment the following line if you need to relocate your vector Table in - Internal SRAM. */ -/* #define VECT_TAB_SRAM */ -#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field. \ - This value must be a multiple of 0x200. */ -/******************************************************************************/ -/** - * @} - */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Macros - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Variables - * @{ - */ -/* This variable is updated in three ways: - 1) by calling CMSIS function SystemCoreClockUpdate() - 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency - Note: If you use this function to configure the system clock; then there - is no need to call the 2 first functions listed above, since SystemCoreClock - variable is updated automatically. - */ -uint32_t SystemCoreClock = 16000000; -const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; -const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_FunctionPrototypes - * @{ - */ - -#if defined(DATA_IN_ExtSRAM) || defined(DATA_IN_ExtSDRAM) -static void SystemInit_ExtMemCtl(void); -#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ - -/** - * @} - */ - -/** @addtogroup STM32F4xx_System_Private_Functions - * @{ - */ - -/** - * @brief Setup the microcontroller system - * Initialize the FPU setting, vector table location and External memory - * configuration. - * @param None - * @retval None - */ -void SystemInit(void) -{ -/* FPU settings ------------------------------------------------------------*/ -#if (__FPU_PRESENT == 1) && (__FPU_USED == 1) - SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10 and CP11 Full Access */ -#endif - -#if defined(DATA_IN_ExtSRAM) || defined(DATA_IN_ExtSDRAM) - SystemInit_ExtMemCtl(); -#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */ - - /* Configure the Vector Table location add offset address ------------------*/ -#ifdef VECT_TAB_SRAM - SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ -#else - SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ -#endif -} - -/** - * @brief Update SystemCoreClock variable according to Clock Register Values. - * The SystemCoreClock variable contains the core clock (HCLK), it can - * be used by the user application to setup the SysTick timer or configure - * other parameters. - * - * @note Each time the core clock (HCLK) changes, this function must be called - * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined - * constant and the selected clock source: - * - * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) - * - * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) - * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * - * (*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value - * 16 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * - * (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (its value - * depends on the application requirements), user has to ensure that HSE_VALUE - * is same as the real frequency of the crystal used. Otherwise, this function - * may have wrong result. - * - * - The result of this function could be not correct when using fractional - * value for HSE crystal. - * - * @param None - * @retval None - */ -void SystemCoreClockUpdate(void) -{ - uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2; - - /* Get SYSCLK source -------------------------------------------------------*/ - tmp = RCC->CFGR & RCC_CFGR_SWS; - - switch (tmp) - { - case 0x00: /* HSI used as system clock source */ - SystemCoreClock = HSI_VALUE; - break; - case 0x04: /* HSE used as system clock source */ - SystemCoreClock = HSE_VALUE; - break; - case 0x08: /* PLL used as system clock source */ - - /* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N - SYSCLK = PLL_VCO / PLL_P - */ - pllsource = (RCC->PLLCFGR & RCC_PLLCFGR_PLLSRC) >> 22; - pllm = RCC->PLLCFGR & RCC_PLLCFGR_PLLM; - - if (pllsource != 0) - { - /* HSE used as PLL clock source */ - pllvco = (HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); - } - else - { - /* HSI used as PLL clock source */ - pllvco = (HSI_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> 6); - } - - pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >> 16) + 1) * 2; - SystemCoreClock = pllvco / pllp; - break; - default: - SystemCoreClock = HSI_VALUE; - break; - } - /* Compute HCLK frequency --------------------------------------------------*/ - /* Get HCLK prescaler */ - tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; - /* HCLK frequency */ - SystemCoreClock >>= tmp; -} - -#if defined(DATA_IN_ExtSRAM) && defined(DATA_IN_ExtSDRAM) -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F469xx) || defined(STM32F479xx) -/** - * @brief Setup the external memory controller. - * Called in startup_stm32f4xx.s before jump to main. - * This function configures the external memories (SRAM/SDRAM) - * This SRAM/SDRAM will be used as program data memory (including heap and stack). - * @param None - * @retval None - */ -void SystemInit_ExtMemCtl(void) -{ - __IO uint32_t tmp = 0x00; - - register uint32_t tmpreg = 0, timeout = 0xFFFF; - register __IO uint32_t index; - - /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface clock */ - RCC->AHB1ENR |= 0x000001F8; - - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - - /* Connect PDx pins to FMC Alternate function */ - GPIOD->AFR[0] = 0x00CCC0CC; - GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ - GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ - GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ - GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOD->PUPDR = 0x00000000; - - /* Connect PEx pins to FMC Alternate function */ - GPIOE->AFR[0] = 0xC00CC0CC; - GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ - GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ - GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ - GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ - GPIOE->PUPDR = 0x00000000; - - /* Connect PFx pins to FMC Alternate function */ - GPIOF->AFR[0] = 0xCCCCCCCC; - GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ - GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ - GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ - GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ - GPIOF->PUPDR = 0x00000000; - - /* Connect PGx pins to FMC Alternate function */ - GPIOG->AFR[0] = 0xCCCCCCCC; - GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ - GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ - GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ - GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ - GPIOG->PUPDR = 0x00000000; - - /* Connect PHx pins to FMC Alternate function */ - GPIOH->AFR[0] = 0x00C0CC00; - GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ - GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ - GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ - GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ - GPIOH->PUPDR = 0x00000000; - - /* Connect PIx pins to FMC Alternate function */ - GPIOI->AFR[0] = 0xCCCCCCCC; - GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ - GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ - GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ - GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ - GPIOI->PUPDR = 0x00000000; - - /*-- FMC Configuration -------------------------------------------------------*/ - /* Enable the FMC interface clock */ - RCC->AHB3ENR |= 0x00000001; - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - - FMC_Bank5_6->SDCR[0] = 0x000019E4; - FMC_Bank5_6->SDTR[0] = 0x01115351; - - /* SDRAM initialization sequence */ - /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Delay */ - for (index = 0; index < 1000; index++) - ; - - /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Auto refresh command */ - FMC_Bank5_6->SDCMR = 0x00000073; - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* MRD register program */ - FMC_Bank5_6->SDCMR = 0x00046014; - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Set refresh count */ - tmpreg = FMC_Bank5_6->SDRTR; - FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C << 1)); - - /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; - FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001011; - FMC_Bank1->BTCR[3] = 0x00000201; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ -#if defined(STM32F469xx) || defined(STM32F479xx) - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001091; - FMC_Bank1->BTCR[3] = 0x00110212; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F469xx || STM32F479xx */ - - (void)(tmp); -} -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ -#elif defined(DATA_IN_ExtSRAM) || defined(DATA_IN_ExtSDRAM) -/** - * @brief Setup the external memory controller. - * Called in startup_stm32f4xx.s before jump to main. - * This function configures the external memories (SRAM/SDRAM) - * This SRAM/SDRAM will be used as program data memory (including heap and stack). - * @param None - * @retval None - */ -void SystemInit_ExtMemCtl(void) -{ - __IO uint32_t tmp = 0x00; -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F446xx) || defined(STM32F469xx) || defined(STM32F479xx) -#if defined(DATA_IN_ExtSDRAM) - register uint32_t tmpreg = 0, timeout = 0xFFFF; - register __IO uint32_t index; - -#if defined(STM32F446xx) - /* Enable GPIOA, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG interface - clock */ - RCC->AHB1ENR |= 0x0000007D; -#else - /* Enable GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface - clock */ - RCC->AHB1ENR |= 0x000001F8; -#endif /* STM32F446xx */ - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOCEN); - -#if defined(STM32F446xx) - /* Connect PAx pins to FMC Alternate function */ - GPIOA->AFR[0] |= 0xC0000000; - GPIOA->AFR[1] |= 0x00000000; - /* Configure PDx pins in Alternate function mode */ - GPIOA->MODER |= 0x00008000; - /* Configure PDx pins speed to 50 MHz */ - GPIOA->OSPEEDR |= 0x00008000; - /* Configure PDx pins Output type to push-pull */ - GPIOA->OTYPER |= 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOA->PUPDR |= 0x00000000; - - /* Connect PCx pins to FMC Alternate function */ - GPIOC->AFR[0] |= 0x00CC0000; - GPIOC->AFR[1] |= 0x00000000; - /* Configure PDx pins in Alternate function mode */ - GPIOC->MODER |= 0x00000A00; - /* Configure PDx pins speed to 50 MHz */ - GPIOC->OSPEEDR |= 0x00000A00; - /* Configure PDx pins Output type to push-pull */ - GPIOC->OTYPER |= 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOC->PUPDR |= 0x00000000; -#endif /* STM32F446xx */ - - /* Connect PDx pins to FMC Alternate function */ - GPIOD->AFR[0] = 0x000000CC; - GPIOD->AFR[1] = 0xCC000CCC; - /* Configure PDx pins in Alternate function mode */ - GPIOD->MODER = 0xA02A000A; - /* Configure PDx pins speed to 50 MHz */ - GPIOD->OSPEEDR = 0xA02A000A; - /* Configure PDx pins Output type to push-pull */ - GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOD->PUPDR = 0x00000000; - - /* Connect PEx pins to FMC Alternate function */ - GPIOE->AFR[0] = 0xC00000CC; - GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ - GPIOE->MODER = 0xAAAA800A; - /* Configure PEx pins speed to 50 MHz */ - GPIOE->OSPEEDR = 0xAAAA800A; - /* Configure PEx pins Output type to push-pull */ - GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ - GPIOE->PUPDR = 0x00000000; - - /* Connect PFx pins to FMC Alternate function */ - GPIOF->AFR[0] = 0xCCCCCCCC; - GPIOF->AFR[1] = 0xCCCCCCCC; - /* Configure PFx pins in Alternate function mode */ - GPIOF->MODER = 0xAA800AAA; - /* Configure PFx pins speed to 50 MHz */ - GPIOF->OSPEEDR = 0xAA800AAA; - /* Configure PFx pins Output type to push-pull */ - GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ - GPIOF->PUPDR = 0x00000000; - - /* Connect PGx pins to FMC Alternate function */ - GPIOG->AFR[0] = 0xCCCCCCCC; - GPIOG->AFR[1] = 0xCCCCCCCC; - /* Configure PGx pins in Alternate function mode */ - GPIOG->MODER = 0xAAAAAAAA; - /* Configure PGx pins speed to 50 MHz */ - GPIOG->OSPEEDR = 0xAAAAAAAA; - /* Configure PGx pins Output type to push-pull */ - GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ - GPIOG->PUPDR = 0x00000000; - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F469xx) || defined(STM32F479xx) - /* Connect PHx pins to FMC Alternate function */ - GPIOH->AFR[0] = 0x00C0CC00; - GPIOH->AFR[1] = 0xCCCCCCCC; - /* Configure PHx pins in Alternate function mode */ - GPIOH->MODER = 0xAAAA08A0; - /* Configure PHx pins speed to 50 MHz */ - GPIOH->OSPEEDR = 0xAAAA08A0; - /* Configure PHx pins Output type to push-pull */ - GPIOH->OTYPER = 0x00000000; - /* No pull-up, pull-down for PHx pins */ - GPIOH->PUPDR = 0x00000000; - - /* Connect PIx pins to FMC Alternate function */ - GPIOI->AFR[0] = 0xCCCCCCCC; - GPIOI->AFR[1] = 0x00000CC0; - /* Configure PIx pins in Alternate function mode */ - GPIOI->MODER = 0x0028AAAA; - /* Configure PIx pins speed to 50 MHz */ - GPIOI->OSPEEDR = 0x0028AAAA; - /* Configure PIx pins Output type to push-pull */ - GPIOI->OTYPER = 0x00000000; - /* No pull-up, pull-down for PIx pins */ - GPIOI->PUPDR = 0x00000000; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ - - /*-- FMC Configuration -------------------------------------------------------*/ - /* Enable the FMC interface clock */ - RCC->AHB3ENR |= 0x00000001; - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - - /* Configure and enable SDRAM bank1 */ -#if defined(STM32F446xx) - FMC_Bank5_6->SDCR[0] = 0x00001954; -#else - FMC_Bank5_6->SDCR[0] = 0x000019E4; -#endif /* STM32F446xx */ - FMC_Bank5_6->SDTR[0] = 0x01115351; - - /* SDRAM initialization sequence */ - /* Clock enable command */ - FMC_Bank5_6->SDCMR = 0x00000011; - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Delay */ - for (index = 0; index < 1000; index++) - ; - - /* PALL command */ - FMC_Bank5_6->SDCMR = 0x00000012; - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Auto refresh command */ -#if defined(STM32F446xx) - FMC_Bank5_6->SDCMR = 0x000000F3; -#else - FMC_Bank5_6->SDCMR = 0x00000073; -#endif /* STM32F446xx */ - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* MRD register program */ -#if defined(STM32F446xx) - FMC_Bank5_6->SDCMR = 0x00044014; -#else - FMC_Bank5_6->SDCMR = 0x00046014; -#endif /* STM32F446xx */ - timeout = 0xFFFF; - while ((tmpreg != 0) && (timeout-- > 0)) - { - tmpreg = FMC_Bank5_6->SDSR & 0x00000020; - } - - /* Set refresh count */ - tmpreg = FMC_Bank5_6->SDRTR; -#if defined(STM32F446xx) - FMC_Bank5_6->SDRTR = (tmpreg | (0x0000050C << 1)); -#else - FMC_Bank5_6->SDRTR = (tmpreg | (0x0000027C << 1)); -#endif /* STM32F446xx */ - - /* Disable write protection */ - tmpreg = FMC_Bank5_6->SDCR[0]; - FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF); -#endif /* DATA_IN_ExtSDRAM */ -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F446xx || STM32F469xx || STM32F479xx */ - -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) \ - || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) \ - || defined(STM32F469xx) || defined(STM32F479xx) || defined(STM32F412Zx) || defined(STM32F412Vx) - -#if defined(DATA_IN_ExtSRAM) - /*-- GPIOs Configuration -----------------------------------------------------*/ - /* Enable GPIOD, GPIOE, GPIOF and GPIOG interface clock */ - RCC->AHB1ENR |= 0x00000078; - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIODEN); - - /* Connect PDx pins to FMC Alternate function */ - GPIOD->AFR[0] = 0x00CCC0CC; - GPIOD->AFR[1] = 0xCCCCCCCC; - /* Configure PDx pins in Alternate function mode */ - GPIOD->MODER = 0xAAAA0A8A; - /* Configure PDx pins speed to 100 MHz */ - GPIOD->OSPEEDR = 0xFFFF0FCF; - /* Configure PDx pins Output type to push-pull */ - GPIOD->OTYPER = 0x00000000; - /* No pull-up, pull-down for PDx pins */ - GPIOD->PUPDR = 0x00000000; - - /* Connect PEx pins to FMC Alternate function */ - GPIOE->AFR[0] = 0xC00CC0CC; - GPIOE->AFR[1] = 0xCCCCCCCC; - /* Configure PEx pins in Alternate function mode */ - GPIOE->MODER = 0xAAAA828A; - /* Configure PEx pins speed to 100 MHz */ - GPIOE->OSPEEDR = 0xFFFFC3CF; - /* Configure PEx pins Output type to push-pull */ - GPIOE->OTYPER = 0x00000000; - /* No pull-up, pull-down for PEx pins */ - GPIOE->PUPDR = 0x00000000; - - /* Connect PFx pins to FMC Alternate function */ - GPIOF->AFR[0] = 0x00CCCCCC; - GPIOF->AFR[1] = 0xCCCC0000; - /* Configure PFx pins in Alternate function mode */ - GPIOF->MODER = 0xAA000AAA; - /* Configure PFx pins speed to 100 MHz */ - GPIOF->OSPEEDR = 0xFF000FFF; - /* Configure PFx pins Output type to push-pull */ - GPIOF->OTYPER = 0x00000000; - /* No pull-up, pull-down for PFx pins */ - GPIOF->PUPDR = 0x00000000; - - /* Connect PGx pins to FMC Alternate function */ - GPIOG->AFR[0] = 0x00CCCCCC; - GPIOG->AFR[1] = 0x000000C0; - /* Configure PGx pins in Alternate function mode */ - GPIOG->MODER = 0x00085AAA; - /* Configure PGx pins speed to 100 MHz */ - GPIOG->OSPEEDR = 0x000CAFFF; - /* Configure PGx pins Output type to push-pull */ - GPIOG->OTYPER = 0x00000000; - /* No pull-up, pull-down for PGx pins */ - GPIOG->PUPDR = 0x00000000; - - /*-- FMC/FSMC Configuration --------------------------------------------------*/ - /* Enable the FMC/FSMC interface clock */ - RCC->AHB3ENR |= 0x00000001; - -#if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001011; - FMC_Bank1->BTCR[3] = 0x00000201; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ -#if defined(STM32F469xx) || defined(STM32F479xx) - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN); - /* Configure and enable Bank1_SRAM2 */ - FMC_Bank1->BTCR[2] = 0x00001091; - FMC_Bank1->BTCR[3] = 0x00110212; - FMC_Bank1E->BWTR[2] = 0x0fffffff; -#endif /* STM32F469xx || STM32F479xx */ -#if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) \ - || defined(STM32F412Zx) || defined(STM32F412Vx) - /* Delay after an RCC peripheral clock enabling */ - tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FSMCEN); - /* Configure and enable Bank1_SRAM2 */ - FSMC_Bank1->BTCR[2] = 0x00001011; - FSMC_Bank1->BTCR[3] = 0x00000201; - FSMC_Bank1E->BWTR[2] = 0x0FFFFFFF; -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F412Zx || STM32F412Vx */ - -#endif /* DATA_IN_ExtSRAM */ -#endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || \ - STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx || STM32F412Zx || STM32F412Vx */ - (void)(tmp); -} -#endif /* DATA_IN_ExtSRAM && DATA_IN_ExtSDRAM */ -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/l0/inspector_serialcom/Pipe.ioc b/examples/projects/l0/inspector_serialcom/Pipe.ioc deleted file mode 100644 index e33f09ab5..000000000 --- a/examples/projects/l0/inspector_serialcom/Pipe.ioc +++ /dev/null @@ -1,87 +0,0 @@ -#MicroXplorer Configuration settings - do not modify -File.Version=6 -KeepUserPlacement=false -Mcu.Family=STM32F0 -Mcu.IP0=NVIC -Mcu.IP1=RCC -Mcu.IP2=SYS -Mcu.IPNb=3 -Mcu.Name=STM32F072C(8-B)Ux -Mcu.Package=UFQFPN48 -Mcu.Pin0=PA3 -Mcu.Pin1=PB0 -Mcu.Pin2=VP_SYS_VS_Systick -Mcu.PinsNb=3 -Mcu.ThirdPartyNb=0 -Mcu.UserConstants= -Mcu.UserName=STM32F072CBUx -MxCube.Version=6.1.1 -MxDb.Version=DB.6.0.10 -NVIC.ForceEnableDMAVector=true -NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.SVC_IRQn=true\:0\:0\:false\:false\:true\:false\:false -NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true -PA3.GPIOParameters=PinState,GPIO_Label -PA3.GPIO_Label=LED -PA3.Locked=true -PA3.PinState=GPIO_PIN_SET -PA3.Signal=GPIO_Output -PB0.GPIOParameters=GPIO_PuPd,GPIO_Label -PB0.GPIO_Label=BTN -PB0.GPIO_PuPd=GPIO_PULLDOWN -PB0.Locked=true -PB0.Signal=GPIO_Input -PinOutPanel.RotationAngle=0 -ProjectManager.AskForMigrate=true -ProjectManager.BackupPrevious=false -ProjectManager.CompilerOptimize=3 -ProjectManager.ComputerToolchain=false -ProjectManager.CoupleFile=true -ProjectManager.CustomerFirmwarePackage= -ProjectManager.DefaultFWLocation=true -ProjectManager.DeletePrevious=true -ProjectManager.DeviceId=STM32F072CBUx -ProjectManager.FirmwarePackage=STM32Cube FW_F0 V1.11.2 -ProjectManager.FreePins=false -ProjectManager.HalAssertFull=false -ProjectManager.HeapSize=0x200 -ProjectManager.KeepUserCode=true -ProjectManager.LastFirmware=true -ProjectManager.LibraryCopy=1 -ProjectManager.MainLocation=Src -ProjectManager.NoMain=false -ProjectManager.PreviousToolchain=SW4STM32 -ProjectManager.ProjectBuild=false -ProjectManager.ProjectFileName=Pipe.ioc -ProjectManager.ProjectName=Pipe -ProjectManager.RegisterCallBack= -ProjectManager.StackSize=0x400 -ProjectManager.TargetToolchain=SW4STM32 -ProjectManager.ToolChainLocation= -ProjectManager.UnderRoot=true -ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false -RCC.AHBFreq_Value=48000000 -RCC.APB1Freq_Value=48000000 -RCC.APB1TimFreq_Value=48000000 -RCC.CECFreq_Value=32786.88524590164 -RCC.FCLKCortexFreq_Value=48000000 -RCC.FamilyName=M -RCC.HCLKFreq_Value=48000000 -RCC.HSICECFreq_Value=32786.88524590164 -RCC.I2SFreq_Value=48000000 -RCC.IPParameters=AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,CECFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSICECFreq_Value,I2SFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USART1Freq_Value,USART2Freq_Value,VCOOutput2Freq_Value -RCC.MCOFreq_Value=48000000 -RCC.PLLCLKFreq_Value=48000000 -RCC.PLLMCOFreq_Value=48000000 -RCC.PLLMUL=RCC_PLL_MUL6 -RCC.SYSCLKFreq_VALUE=48000000 -RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK -RCC.TimSysFreq_Value=48000000 -RCC.USART1Freq_Value=48000000 -RCC.USART2Freq_Value=48000000 -RCC.VCOOutput2Freq_Value=8000000 -VP_SYS_VS_Systick.Mode=SysTick -VP_SYS_VS_Systick.Signal=SYS_VS_Systick -board=custom diff --git a/examples/projects/l0/inspector_serialcom/README.md b/examples/projects/l0/inspector_serialcom/README.md deleted file mode 100644 index 960259c87..000000000 --- a/examples/projects/l0/inspector_serialcom/README.md +++ /dev/null @@ -1,36 +0,0 @@ -Luos logo - -![](https://github.com/Luos-io/luos_engine/actions/workflows/build.yml/badge.svg) -[![](https://img.shields.io/github/license/Luos-io/Luos)](https://github.com/Luos-io/luos_engine/blob/master/LICENSE) - -[![](https://img.shields.io/badge/Luos-Documentation-34A3B4)](https://www.luos.io) -[![](http://certified.luos.io)](https://luos.io) -[![PlatformIO Registry](https://badges.registry.platformio.org/packages/luos/library/luos_engine.svg)](https://registry.platformio.org/libraries/luos_engine/luos_engine) - -[![](https://img.shields.io/discord/902486791658041364?label=Discord&logo=discord&style=social)](https://discord.gg/luos) -[![](https://img.shields.io/reddit/subreddit-subscribers/Luos?style=social)](https://www.reddit.com/r/Luos) -[![](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/Luos_io) -[![](https://img.shields.io/badge/LinkedIn-Share-0077B5?style=social&logo=linkedin)](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fgithub.com%2Fluos-io) - - - -# gate_serialcom project example :bulb: -This project demonstrate how to make and use a simple gate_serialcom through Luos. Feel free to use electronics and code example as you want. - -## How to compile the code :computer: - - 1. Download and install [Platformio](https://platformio.org/platformio-ide) - 2. Open this folder into Platformio - 3. Build (Platformio will do the rest) - -## How to open the electronic design :electric_plug: -You can open [a working example electronic design](https://github.com/Luos-io/luos_engine/tree/main/examples/hardware) with Kicad. This design use Luos_components library for more information to install and use it read [our doc](https://www.luos.io/docs/luos-technology). - -## Linked driver -This project is linked to the [gate_serialcom driver](../../Drivers/gate_serialcom). - -## Don't hesitate to read [our documentation](https://www.luos.io/docs/luos-technology), or to post your questions/issues on the [Luos' community](https://discord.gg/luos). :books: - -[![](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.luos.io&logo=Discourse)](https://discord.gg/luos) -[![](https://img.shields.io/badge/Luos-Documentation-34A3B4)](https://www.luos.io) -[![](https://img.shields.io/badge/LinkedIn-Follow%20us-0077B5?style=flat&logo=linkedin)](https://www.linkedin.com/company/luos) diff --git a/examples/projects/l0/inspector_serialcom/boards/l0.json b/examples/projects/l0/inspector_serialcom/boards/l0.json deleted file mode 100644 index 49082858c..000000000 --- a/examples/projects/l0/inspector_serialcom/boards/l0.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "build": { - "cpu": "cortex-m0", - "extra_flags": [ - "-DSTM32F072xB", - "-DUSE_HAL_DRIVER", - "-DUSE_FULL_LL_DRIVER", - "-DLUOSHAL=STM32F0 " - ], - "f_cpu": "48000000L", - "mcu": "stm32f072vbt6", - "product_line": "STM32F072XB" - }, - "connectivity": [ - "can" - ], - "debug": { - "jlink_device": "STM32F072VB", - "openocd_target": "stm32f0x", - "svd_path": "STM32F072x.svd" - }, - "frameworks": [ - "stm32cube" - ], - "name": "L0", - "upload": { - "maximum_ram_size": 16384, - "maximum_size": 131072, - "protocol": "dfu", - "protocols": [ - "stlink", - "dfu" - ] - }, - "url": "https://luos.io", - "vendor": "Luos" -} \ No newline at end of file diff --git a/examples/projects/l0/inspector_serialcom/include/gpio.h b/examples/projects/l0/inspector_serialcom/include/gpio.h deleted file mode 100644 index f57136410..000000000 --- a/examples/projects/l0/inspector_serialcom/include/gpio.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.h - * @brief This file contains all the function prototypes for - * the gpio.c file - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __GPIO_H__ -#define __GPIO_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" - - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - - void MX_GPIO_Init(void); - - /* USER CODE BEGIN Prototypes */ - - /* USER CODE END Prototypes */ - -#ifdef __cplusplus -} -#endif -#endif /*__ GPIO_H__ */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/l0/inspector_serialcom/include/main.h b/examples/projects/l0/inspector_serialcom/include/main.h deleted file mode 100644 index 4a040243f..000000000 --- a/examples/projects/l0/inspector_serialcom/include/main.h +++ /dev/null @@ -1,76 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.h - * @brief : Header for main.c file. - * This file contains the common defines of the application. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __MAIN_H -#define __MAIN_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Includes ------------------------------------------------------------------*/ -#include "stm32f0xx_hal.h" - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void Error_Handler(void); - -/* USER CODE BEGIN EFP */ - -/* USER CODE END EFP */ - -/* Private defines -----------------------------------------------------------*/ -#define LED_Pin GPIO_PIN_3 -#define LED_GPIO_Port GPIOA -#define BTN_Pin GPIO_PIN_0 -#define BTN_GPIO_Port GPIOB - /* USER CODE BEGIN Private defines */ - - /* USER CODE END Private defines */ - -#ifdef __cplusplus -} -#endif - -#endif /* __MAIN_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/l0/inspector_serialcom/include/stm32_assert.h b/examples/projects/l0/inspector_serialcom/include/stm32_assert.h deleted file mode 100644 index abe0ef3bd..000000000 --- a/examples/projects/l0/inspector_serialcom/include/stm32_assert.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - ****************************************************************************** - * @file stm32_assert.h - * @brief STM32 assert file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32_ASSERT_H -#define __STM32_ASSERT_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ -/* Includes ------------------------------------------------------------------*/ -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT - /** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((char *)__FILE__, __LINE__)) - /* Exported functions ------------------------------------------------------- */ - void assert_failed(char *file, uint32_t line); -#else -#define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32_ASSERT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/l0/inspector_serialcom/include/stm32f0xx_hal_conf.h b/examples/projects/l0/inspector_serialcom/include/stm32f0xx_hal_conf.h deleted file mode 100644 index 570433359..000000000 --- a/examples/projects/l0/inspector_serialcom/include/stm32f0xx_hal_conf.h +++ /dev/null @@ -1,323 +0,0 @@ -/** - ****************************************************************************** - * @file stm32f0xx_hal_conf.h - * @brief HAL configuration file. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2016 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F0xx_HAL_CONF_H -#define __STM32F0xx_HAL_CONF_H - -#ifdef __cplusplus -extern "C" -{ -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED - /*#define HAL_ADC_MODULE_ENABLED */ -/*#define HAL_CRYP_MODULE_ENABLED */ -/*#define HAL_CAN_MODULE_ENABLED */ -/*#define HAL_CEC_MODULE_ENABLED */ -/*#define HAL_COMP_MODULE_ENABLED */ -/*#define HAL_CRYP_MODULE_ENABLED */ -/*#define HAL_TSC_MODULE_ENABLED */ -/*#define HAL_DAC_MODULE_ENABLED */ -/*#define HAL_I2S_MODULE_ENABLED */ -/*#define HAL_IWDG_MODULE_ENABLED */ -/*#define HAL_LCD_MODULE_ENABLED */ -/*#define HAL_LPTIM_MODULE_ENABLED */ -/*#define HAL_RNG_MODULE_ENABLED */ -/*#define HAL_RTC_MODULE_ENABLED */ -/*#define HAL_SPI_MODULE_ENABLED */ -/*#define HAL_TIM_MODULE_ENABLED */ -/*#define HAL_UART_MODULE_ENABLED */ -/*#define HAL_USART_MODULE_ENABLED */ -/*#define HAL_IRDA_MODULE_ENABLED */ -/*#define HAL_SMARTCARD_MODULE_ENABLED */ -/*#define HAL_SMBUS_MODULE_ENABLED */ -/*#define HAL_WWDG_MODULE_ENABLED */ -/*#define HAL_PCD_MODULE_ENABLED */ -//#define HAL_I2C_MODULE_ENABLED -#define HAL_CORTEX_MODULE_ENABLED -#define HAL_DMA_MODULE_ENABLED -#define HAL_FLASH_MODULE_ENABLED -#define HAL_GPIO_MODULE_ENABLED -#define HAL_EXTI_MODULE_ENABLED -#define HAL_PWR_MODULE_ENABLED -#define HAL_RCC_MODULE_ENABLED -#define HAL_CRC_MODULE_ENABLED - -/* ########################## HSE/HSI Values adaptation ##################### */ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined(HSE_VALUE) -#define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -/** - * @brief In the following line adjust the External High Speed oscillator (HSE) Startup - * Timeout value - */ -#if !defined(HSE_STARTUP_TIMEOUT) -#define HSE_STARTUP_TIMEOUT ((uint32_t)100) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined(HSI_VALUE) -#define HSI_VALUE ((uint32_t)8000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup - * Timeout value - */ -#if !defined(HSI_STARTUP_TIMEOUT) -#define HSI_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSI start up */ -#endif /* HSI_STARTUP_TIMEOUT */ - -/** - * @brief Internal High Speed oscillator for ADC (HSI14) value. - */ -#if !defined(HSI14_VALUE) -#define HSI14_VALUE ((uint32_t)14000000) /*!< Value of the Internal High Speed oscillator for ADC in Hz. \ - The real value may vary depending on the variations \ - in voltage and temperature. */ -#endif /* HSI14_VALUE */ - -/** - * @brief Internal High Speed oscillator for USB (HSI48) value. - */ -#if !defined(HSI48_VALUE) -#define HSI48_VALUE ((uint32_t)48000000) /*!< Value of the Internal High Speed oscillator for USB in Hz. \ - The real value may vary depending on the variations \ - in voltage and temperature. */ -#endif /* HSI48_VALUE */ - -/** - * @brief Internal Low Speed oscillator (LSI) value. - */ -#if !defined(LSI_VALUE) -#define LSI_VALUE ((uint32_t)40000) -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz \ - The real value may vary depending on the variations \ - in voltage and temperature. */ -/** - * @brief External Low Speed oscillator (LSI) value. - */ -#if !defined(LSE_VALUE) -#define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */ -#endif /* LSE_VALUE */ - -/** - * @brief Time out for LSE start up value in ms. - */ -#if !defined(LSE_STARTUP_TIMEOUT) -#define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0) /*!< tick interrupt priority (lowest by default) */ - /* Warning: Must be set to higher priority for HAL_Delay() */ - /* and HAL_GetTick() usage under interrupt context */ -#define USE_RTOS 0 -#define PREFETCH_ENABLE 1 -#define INSTRUCTION_CACHE_ENABLE 0 -#define DATA_CACHE_ENABLE 0 -#define USE_SPI_CRC 0U - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ -#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */ -#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ -#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ -#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ -#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ -#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ -#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ -#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */ -#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */ -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ -#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ -#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ -#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ -#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ -#define USE_HAL_TSC_REGISTER_CALLBACKS 0U /* TSC register callback disabled */ -#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ - - /* ########################## Assert Selection ############################## */ - /** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ - /* #define USE_FULL_ASSERT 1U */ - - /* Includes ------------------------------------------------------------------*/ - /** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED -#include "stm32f0xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED -#include "stm32f0xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED -#include "stm32f0xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED -#include "stm32f0xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED -#include "stm32f0xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED -#include "stm32f0xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_CAN_MODULE_ENABLED -#include "stm32f0xx_hal_can.h" -#endif /* HAL_CAN_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED -#include "stm32f0xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_COMP_MODULE_ENABLED -#include "stm32f0xx_hal_comp.h" -#endif /* HAL_COMP_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED -#include "stm32f0xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED -#include "stm32f0xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED -#include "stm32f0xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED -#include "stm32f0xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED -#include "stm32f0xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED -#include "stm32f0xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED -#include "stm32f0xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED -#include "stm32f0xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED -#include "stm32f0xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED -#include "stm32f0xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED -#include "stm32f0xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED -#include "stm32f0xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED -#include "stm32f0xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED -#include "stm32f0xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_TSC_MODULE_ENABLED -#include "stm32f0xx_hal_tsc.h" -#endif /* HAL_TSC_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED -#include "stm32f0xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED -#include "stm32f0xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED -#include "stm32f0xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT - /** - * @brief The assert_param macro is used for function's parameters check. - * @param expr If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ -#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) - /* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t *file, uint32_t line); -#else -#define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F0xx_HAL_CONF_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/l0/inspector_serialcom/include/stm32f0xx_it.h b/examples/projects/l0/inspector_serialcom/include/stm32f0xx_it.h deleted file mode 100644 index bdaccb45e..000000000 --- a/examples/projects/l0/inspector_serialcom/include/stm32f0xx_it.h +++ /dev/null @@ -1,66 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f0xx_it.h - * @brief This file contains the headers of the interrupt handlers. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32F0xx_IT_H -#define __STM32F0xx_IT_H - -#ifdef __cplusplus -extern "C" -{ -#endif - - /* Private includes ----------------------------------------------------------*/ - /* USER CODE BEGIN Includes */ - - /* USER CODE END Includes */ - - /* Exported types ------------------------------------------------------------*/ - /* USER CODE BEGIN ET */ - - /* USER CODE END ET */ - - /* Exported constants --------------------------------------------------------*/ - /* USER CODE BEGIN EC */ - - /* USER CODE END EC */ - - /* Exported macro ------------------------------------------------------------*/ - /* USER CODE BEGIN EM */ - - /* USER CODE END EM */ - - /* Exported functions prototypes ---------------------------------------------*/ - void NMI_Handler(void); - void HardFault_Handler(void); - void SVC_Handler(void); - void PendSV_Handler(void); - void SysTick_Handler(void); - /* USER CODE BEGIN EFP */ - - /* USER CODE END EFP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32F0xx_IT_H */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/l0/inspector_serialcom/linker/custom_Luos_bootloader_script.ld b/examples/projects/l0/inspector_serialcom/linker/custom_Luos_bootloader_script.ld deleted file mode 100644 index 117ea9158..000000000 --- a/examples/projects/l0/inspector_serialcom/linker/custom_Luos_bootloader_script.ld +++ /dev/null @@ -1,182 +0,0 @@ -/** - ****************************************************************************** - * @file LinkerScript.ld - * @author Auto-generated by STM32CubeIDE - * @brief Linker script for STM32F072RBTx Device from STM32F0 series - * 128Kbytes FLASH - * 16Kbytes RAM - * - * Set heap size, stack size and stack location according - * to application requirements. - * - * Set memory bank area and size if external memory is used - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ - -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Memories definition */ -MEMORY -{ - RAM_RSVD (xrw) : ORIGIN = 0x20000000, LENGTH = 1K - RAM (xrw) : ORIGIN = 0x20000400, LENGTH = 15K - FLASH (rx) : ORIGIN = 0x0800C800, LENGTH = 78K -} - -/* Sections */ -SECTIONS -{ - /* The startup code into "FLASH" Rom type memory */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data into "FLASH" Rom type memory */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data into "FLASH" Rom type memory */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { - . = ALIGN(4); - *(.ARM.extab* .gnu.linkonce.armextab.*) - . = ALIGN(4); - } >FLASH - - .ARM : { - . = ALIGN(4); - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - . = ALIGN(4); - } >FLASH - - .preinit_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - . = ALIGN(4); - } >FLASH - - .init_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - . = ALIGN(4); - } >FLASH - - .fini_array : - { - . = ALIGN(4); - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - . = ALIGN(4); - } >FLASH - - /* Used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections into "RAM" Ram type memory */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - - } >RAM AT> FLASH - - /* Uninitialized data section into "RAM" Ram type memory */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss section */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - .boot_data : - { - *(.rsvd.data) - *(.rsvd.data*) - } > RAM_RSVD - - /* Remove information from the compiler libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} diff --git a/examples/projects/l0/inspector_serialcom/node_config.h b/examples/projects/l0/inspector_serialcom/node_config.h deleted file mode 100644 index cbd40e31d..000000000 --- a/examples/projects/l0/inspector_serialcom/node_config.h +++ /dev/null @@ -1,100 +0,0 @@ -/****************************************************************************** - * @file node_config.h - * @brief This file allow you to use standard preprocessor definitions to - * configure your project, Luos and Luos HAL libraries - * - * # Introduction - * This file is for the luos user. You may here configure your project and - * define your custom Luos service and custom Luos command for your product - * - * Luos libraries offer a minimal standard configuration to optimize - * memory usage. In some case you have to modify standard value to fit - * with your need concerning among of data transiting through the network - * or network speed for example - * - * Luos libraries can be use with a lot a MCU family. Luos compagny give you - * a default configuration, for specific MCU family, in robus_hal_config.h. - * This configuration can be modify here to fit with you design by - * preprocessor definitions of MCU Hardware needs - * - * # Usage - * This file should be place a the root folder of your project and include - * where build flag preprocessor definitions are define in your IDE - * -include node_config.h - * - * @author Luos - * @version 0.0.0 - ******************************************************************************/ -#ifndef _NODE_CONFIG_H_ -#define _NODE_CONFIG_H_ - -/******************************************************************************* - * PROJECT DEFINITION - *******************************************************************************/ - -/******************************************************************************* - * LUOS LIBRARY DEFINITION - ******************************************************************************* - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node - * MAX_NODE_NUMBER. | 20 | Node number in the device - * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX - * MAX_MSG_NB | 2*MAX_LOCAL_SERVICE_NUMBER | Message number in Luos buffer - * MAX_NODE_NUMBER | 20 | Node number in the device - * MAX_SERVICE_NUMBER | 20 | Service number in the device - * NBR_PORT | 2 | PTP Branch number Max 8 - * NBR_RETRY | 10 | Send Retry number in case of NACK or collision - ******************************************************************************/ - -#define MAX_LOCAL_SERVICE_NUMBER 2 -#define MSG_BUFFER_SIZE 2048 -#define MAX_MSG_NB 40 -#define NODETECTION - -/******************************************************************************* - * LUOS HAL LIBRARY DEFINITION -******************************************************************************* - * Define | Description - * :-----------------------|----------------------------------------------- - * MCUFREQ | Put your the MCU frequency (value in Hz) - * TIMERDIV | Timer divider clock (see your clock configuration) - * USE_CRC_HW | define to 0 if there is no Module CRC in your MCU - * USE_TX_IT | define to 1 to not use DMA transfers for Luos Tx - * - * PORT_CLOCK_ENABLE | Enable clock for port - * PTPx | A,B,C,D etc. PTP Branch Pin/Port/IRQ - * TX_LOCK_DETECT | Disable by default use if not busy flag in USART Pin/Port/IRQ - * RX_EN | Rx enable for driver RS485 always on Pin/Port - * TX_EN | Tx enable for driver RS485 Pin/Port - * COM_TX | Tx USART Com Pin/Port/Alternate - * COM_RX | Rx USART Com Pin/Port/Alternate - * PINOUT_IRQHANDLER | Callback function for Pin IRQ handler - - * ROBUS_COM_CLOCK_ENABLE | Enable clock for USART - * ROBUS_COM | USART number - * ROBUS_COM_IRQ | USART IRQ number - * ROBUS_COM_IRQHANDLER | Callback function for USART IRQ handler - - * ROBUS_DMA_CLOCK_ENABLE | Enable clock for DMA - * ROBUS_DMA | DMA number - * ROBUS_DMA_CHANNEL | DMA channel (depending on MCU DMA may need special config) - - * ROBUS_TIMER_CLOCK_ENABLE | Enable clock for Timer - * ROBUS_TIMER | Timer number - * ROBUS_TIMER_IRQ | Timer IRQ number - * ROBUS_TIMER_IRQHANDLER | Callback function for Timer IRQ handler -******************************************************************************/ - -/******************************************************************************* - * FLASH CONFIGURATION FOR APP WITH BOOTLOADER - ******************************************************************************** - * Define | Default Value | Description - * :---------------------|------------------------------------------------------ - * BOOT_START_ADDRESS | FLASH_BASE = 0x8000000 | Start address of Bootloader in flash - * SHARED_MEMORY_ADDRESS | 0x0800C000 | Start address of shared memory to save boot flag - * APP_START_ADDRESS | 0x0800C800 | Start address of application with bootloader - * APP_END_ADDRESS | FLASH_BANK1_END=0x0801FFFF | End address of application with bootloader - ******************************************************************************/ - -#endif /* _NODE_CONFIG_H_ */ diff --git a/examples/projects/l0/inspector_serialcom/platformio.ini b/examples/projects/l0/inspector_serialcom/platformio.ini deleted file mode 100644 index 776b3eb22..000000000 --- a/examples/projects/l0/inspector_serialcom/platformio.ini +++ /dev/null @@ -1,45 +0,0 @@ -; PlatformIO Project Configuration File -; -; Build options: build flags, source filter -; Upload options: custom upload port, speed and extra flags -; Library options: dependencies, extra library storages -; Advanced options: extra scripting -; -; Please visit documentation for the other options and examples -; https://docs.platformio.org/page/projectconf.html -[platformio] -default_envs = l0 - -[env] -lib_ldf_mode =off -lib_extra_dirs = - $PROJECT_DIR/../../../../tool_services/ - $PROJECT_DIR/../../../../../ - $PROJECT_DIR/../../../../network/ -platform = ststm32 -board = l0 -framework = stm32cube -lib_deps = - luos_engine@^3.0.0 - robus_network - Pipe - Inspector -debug_tool = stlink - -[env:l0] -build_flags = - -include node_config.h - -D PIPEMODE=SERIAL - -D PIPEHAL=l0 - -[env:l0_with_bootloader] -board_build.ldscript = linker/custom_Luos_bootloader_script.ld -build_flags = - -include node_config.h - -D PIPEMODE=SERIAL - -D PIPEHAL=l0 - -DWITH_BOOTLOADER -upload_protocol = custom -upload_flags = - -t2 -upload_command = pyluos-bootloader flash $UPLOAD_PORT $UPLOAD_FLAGS -b $SOURCE diff --git a/examples/projects/l0/inspector_serialcom/src/gpio.c b/examples/projects/l0/inspector_serialcom/src/gpio.c deleted file mode 100644 index ee8efe088..000000000 --- a/examples/projects/l0/inspector_serialcom/src/gpio.c +++ /dev/null @@ -1,67 +0,0 @@ -/** - ****************************************************************************** - * @file gpio.c - * @brief This file provides code for the configuration - * of all used GPIO pins. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2021 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ - -/* Includes ------------------------------------------------------------------*/ -#include "gpio.h" - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/*----------------------------------------------------------------------------*/ -/* Configure GPIO */ -/*----------------------------------------------------------------------------*/ -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/** Configure pins -*/ -void MX_GPIO_Init(void) -{ - - GPIO_InitTypeDef GPIO_InitStruct = {0}; - - /* GPIO Ports Clock Enable */ - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - - /*Configure GPIO pin Output Level */ - HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_SET); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = LED_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct); - - /*Configure GPIO pin : PtPin */ - GPIO_InitStruct.Pin = BTN_Pin; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_PULLDOWN; - HAL_GPIO_Init(BTN_GPIO_Port, &GPIO_InitStruct); - -} - -/* USER CODE BEGIN 2 */ - -/* USER CODE END 2 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/l0/inspector_serialcom/src/main.c b/examples/projects/l0/inspector_serialcom/src/main.c deleted file mode 100644 index 5e840ac2a..000000000 --- a/examples/projects/l0/inspector_serialcom/src/main.c +++ /dev/null @@ -1,184 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file : main.c - * @brief : Main program body - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "gpio.h" - -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -#include "luos_engine.h" -#include "robus_network.h" -#include "pipe.h" -#include "inspector.h" -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN PTD */ - -/* USER CODE END PTD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ - -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -void SystemClock_Config(void); -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/** - * @brief The application entry point. - * @retval int - */ -int main(void) -{ - /* USER CODE BEGIN 1 */ - - /* USER CODE END 1 */ - - /* MCU Configuration--------------------------------------------------------*/ - - /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ - HAL_Init(); - - /* USER CODE BEGIN Init */ - - /* USER CODE END Init */ - - /* Configure the system clock */ - SystemClock_Config(); - - /* USER CODE BEGIN SysInit */ - - /* USER CODE END SysInit */ - - /* Initialize all configured peripherals */ - MX_GPIO_Init(); - /* USER CODE BEGIN 2 */ - Luos_Init(); - Robus_Init(); - Inspector_Init(); - Pipe_Init(); - /* USER CODE END 2 */ - - /* Infinite loop */ - /* USER CODE BEGIN WHILE */ - while (1) - { - Luos_Loop(); - Inspector_Loop(); - Pipe_Loop(); - /* USER CODE END WHILE */ - - /* USER CODE BEGIN 3 */ - } - /* USER CODE END 3 */ -} - -/** - * @brief System Clock Configuration - * @retval None - */ -void SystemClock_Config(void) -{ - RCC_OscInitTypeDef RCC_OscInitStruct = {0}; - RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; - RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; - - /** Initializes the RCC Oscillators according to the specified parameters - * in the RCC_OscInitTypeDef structure. - */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; - RCC_OscInitStruct.HSIState = RCC_HSI_ON; - RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; - RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6; - RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV1; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) - { - Error_Handler(); - } - /** Initializes the CPU, AHB and APB buses clocks - */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK - | RCC_CLOCKTYPE_PCLK1; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; - - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) - { - Error_Handler(); - } -} - -/* USER CODE BEGIN 4 */ - -/* USER CODE END 4 */ - -/** - * @brief This function is executed in case of error occurrence. - * @retval None - */ -void Error_Handler(void) -{ - /* USER CODE BEGIN Error_Handler_Debug */ - /* User can add his own implementation to report the HAL error return state */ - - /* USER CODE END Error_Handler_Debug */ -} - -#ifdef USE_FULL_ASSERT -/** - * @brief Reports the name of the source file and the source line number - * where the assert_param error has occurred. - * @param file: pointer to the source file name - * @param line: assert_param error line source number - * @retval None - */ -void assert_failed(uint8_t *file, uint32_t line) -{ - /* USER CODE BEGIN 6 */ - /* User can add his own implementation to report the file name and line number, - tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ - /* USER CODE END 6 */ -} -#endif /* USE_FULL_ASSERT */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/l0/inspector_serialcom/src/stm32f0xx_hal_msp.c b/examples/projects/l0/inspector_serialcom/src/stm32f0xx_hal_msp.c deleted file mode 100644 index 93b975e90..000000000 --- a/examples/projects/l0/inspector_serialcom/src/stm32f0xx_hal_msp.c +++ /dev/null @@ -1,84 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * File Name : stm32f0xx_hal_msp.c - * Description : This file provides code for the MSP Initialization - * and de-Initialization codes. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -/* USER CODE BEGIN Includes */ - -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN Define */ - -/* USER CODE END Define */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN Macro */ - -/* USER CODE END Macro */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* External functions --------------------------------------------------------*/ -/* USER CODE BEGIN ExternalFunctions */ - -/* USER CODE END ExternalFunctions */ - -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ -/** - * Initializes the Global MSP. - */ -void HAL_MspInit(void) -{ - /* USER CODE BEGIN MspInit 0 */ - - /* USER CODE END MspInit 0 */ - - __HAL_RCC_SYSCFG_CLK_ENABLE(); - __HAL_RCC_PWR_CLK_ENABLE(); - - /* System interrupt init*/ - - /* USER CODE BEGIN MspInit 1 */ - - /* USER CODE END MspInit 1 */ -} - -/* USER CODE BEGIN 1 */ - -/* USER CODE END 1 */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/l0/inspector_serialcom/src/stm32f0xx_it.c b/examples/projects/l0/inspector_serialcom/src/stm32f0xx_it.c deleted file mode 100644 index cc61c7c17..000000000 --- a/examples/projects/l0/inspector_serialcom/src/stm32f0xx_it.c +++ /dev/null @@ -1,149 +0,0 @@ -/* USER CODE BEGIN Header */ -/** - ****************************************************************************** - * @file stm32f0xx_it.c - * @brief Interrupt Service Routines. - ****************************************************************************** - * @attention - * - *

© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.

- * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause - * - ****************************************************************************** - */ -/* USER CODE END Header */ - -/* Includes ------------------------------------------------------------------*/ -#include "main.h" -#include "stm32f0xx_it.h" -/* Private includes ----------------------------------------------------------*/ -/* USER CODE BEGIN Includes */ -/* USER CODE END Includes */ - -/* Private typedef -----------------------------------------------------------*/ -/* USER CODE BEGIN TD */ - -/* USER CODE END TD */ - -/* Private define ------------------------------------------------------------*/ -/* USER CODE BEGIN PD */ - -/* USER CODE END PD */ - -/* Private macro -------------------------------------------------------------*/ -/* USER CODE BEGIN PM */ - -/* USER CODE END PM */ - -/* Private variables ---------------------------------------------------------*/ -/* USER CODE BEGIN PV */ - -/* USER CODE END PV */ - -/* Private function prototypes -----------------------------------------------*/ -/* USER CODE BEGIN PFP */ - -/* USER CODE END PFP */ - -/* Private user code ---------------------------------------------------------*/ -/* USER CODE BEGIN 0 */ - -/* USER CODE END 0 */ - -/* External variables --------------------------------------------------------*/ - -/* USER CODE BEGIN EV */ - -/* USER CODE END EV */ - -/******************************************************************************/ -/* Cortex-M0 Processor Interruption and Exception Handlers */ -/******************************************************************************/ -/** - * @brief This function handles Non maskable interrupt. - */ -void NMI_Handler(void) -{ - /* USER CODE BEGIN NonMaskableInt_IRQn 0 */ - - /* USER CODE END NonMaskableInt_IRQn 0 */ - /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ - - /* USER CODE END NonMaskableInt_IRQn 1 */ -} - -/** - * @brief This function handles Hard fault interrupt. - */ -void HardFault_Handler(void) -{ - /* USER CODE BEGIN HardFault_IRQn 0 */ - - /* USER CODE END HardFault_IRQn 0 */ - while (1) - { - /* USER CODE BEGIN W1_HardFault_IRQn 0 */ - /* USER CODE END W1_HardFault_IRQn 0 */ - } -} - -/** - * @brief This function handles System service call via SWI instruction. - */ -void SVC_Handler(void) -{ - /* USER CODE BEGIN SVC_IRQn 0 */ - - /* USER CODE END SVC_IRQn 0 */ - /* USER CODE BEGIN SVC_IRQn 1 */ - - /* USER CODE END SVC_IRQn 1 */ -} - -/** - * @brief This function handles Pendable request for system service. - */ -void PendSV_Handler(void) -{ - /* USER CODE BEGIN PendSV_IRQn 0 */ - - /* USER CODE END PendSV_IRQn 0 */ - /* USER CODE BEGIN PendSV_IRQn 1 */ - - /* USER CODE END PendSV_IRQn 1 */ -} - -/** - * @brief This function handles System tick timer. - */ -void SysTick_Handler(void) -{ - /* USER CODE BEGIN SysTick_IRQn 0 */ - - /* USER CODE END SysTick_IRQn 0 */ - HAL_IncTick(); - /* USER CODE BEGIN SysTick_IRQn 1 */ - - /* USER CODE END SysTick_IRQn 1 */ -} - -/******************************************************************************/ -/* STM32F0xx Peripheral Interrupt Handlers */ -/* Add here the Interrupt Handlers for the used peripherals. */ -/* For the available peripheral interrupt handler names, */ -/* please refer to the startup file (startup_stm32f0xx.s). */ -/******************************************************************************/ - -/* USER CODE BEGIN 1 */ -void EXTI4_15_IRQHandler(void) -{ - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_8); - HAL_GPIO_EXTI_IRQHandler(GPIO_PIN_13); -} -/* USER CODE END 1 */ -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/examples/projects/l0/inspector_serialcom/src/system_stm32f0xx.c b/examples/projects/l0/inspector_serialcom/src/system_stm32f0xx.c deleted file mode 100644 index 410809c2b..000000000 --- a/examples/projects/l0/inspector_serialcom/src/system_stm32f0xx.c +++ /dev/null @@ -1,333 +0,0 @@ -/** - ****************************************************************************** - * @file system_stm32f0xx.c - * @author MCD Application Team - * @brief CMSIS Cortex-M0 Device Peripheral Access Layer System Source File. - * - * 1. This file provides two functions and one global variable to be called from - * user application: - * - SystemInit(): This function is called at startup just after reset and - * before branch to main program. This call is made inside - * the "startup_stm32f0xx.s" file. - * - * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used - * by the user application to setup the SysTick - * timer or configure other parameters. - * - * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must - * be called whenever the core clock is changed - * during program execution. - * - * 2. After each device reset the HSI (8 MHz) is used as system clock source. - * Then SystemInit() function is called, in "startup_stm32f0xx.s" file, to - * configure the system clock before to branch to main program. - * - * 3. This file configures the system clock as follows: - *============================================================================= - * Supported STM32F0xx device - *----------------------------------------------------------------------------- - * System Clock source | HSI - *----------------------------------------------------------------------------- - * SYSCLK(Hz) | 8000000 - *----------------------------------------------------------------------------- - * HCLK(Hz) | 8000000 - *----------------------------------------------------------------------------- - * AHB Prescaler | 1 - *----------------------------------------------------------------------------- - * APB1 Prescaler | 1 - *----------------------------------------------------------------------------- - *============================================================================= - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2016 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/** @addtogroup CMSIS - * @{ - */ - -/** @addtogroup stm32f0xx_system - * @{ - */ - -/** @addtogroup STM32F0xx_System_Private_Includes - * @{ - */ - -#include "stm32f0xx.h" - -/** - * @} - */ - -/** @addtogroup STM32F0xx_System_Private_TypesDefinitions - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32F0xx_System_Private_Defines - * @{ - */ -#if !defined (HSE_VALUE) - #define HSE_VALUE ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz. - This value can be provided and adapted by the user application. */ -#endif /* HSE_VALUE */ - -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)8000000) /*!< Default value of the Internal oscillator in Hz. - This value can be provided and adapted by the user application. */ -#endif /* HSI_VALUE */ - -#if !defined (HSI48_VALUE) -#define HSI48_VALUE ((uint32_t)48000000) /*!< Default value of the HSI48 Internal oscillator in Hz. - This value can be provided and adapted by the user application. */ -#endif /* HSI48_VALUE */ -/** - * @} - */ - -/** @addtogroup STM32F0xx_System_Private_Macros - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32F0xx_System_Private_Variables - * @{ - */ - /* This variable is updated in three ways: - 1) by calling CMSIS function SystemCoreClockUpdate() - 2) by calling HAL API function HAL_RCC_GetHCLKFreq() - 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency - Note: If you use this function to configure the system clock there is no need to - call the 2 first functions listed above, since SystemCoreClock variable is - updated automatically. - */ -uint32_t SystemCoreClock = 8000000; - -const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; -const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4}; - -/** - * @} - */ - -/** @addtogroup STM32F0xx_System_Private_FunctionPrototypes - * @{ - */ - -/** - * @} - */ - -/** @addtogroup STM32F0xx_System_Private_Functions - * @{ - */ - -/** - * @brief Setup the microcontroller system. - * Initialize the default HSI clock source, vector table location and the PLL configuration is reset. - * @param None - * @retval None - */ -void SystemInit(void) -{ - /* Reset the RCC clock configuration to the default reset state ------------*/ - /* Set HSION bit */ - RCC->CR |= (uint32_t)0x00000001U; - -#if defined (STM32F051x8) || defined (STM32F058x8) - /* Reset SW[1:0], HPRE[3:0], PPRE[2:0], ADCPRE and MCOSEL[2:0] bits */ - RCC->CFGR &= (uint32_t)0xF8FFB80CU; -#else - /* Reset SW[1:0], HPRE[3:0], PPRE[2:0], ADCPRE, MCOSEL[2:0], MCOPRE[2:0] and PLLNODIV bits */ - RCC->CFGR &= (uint32_t)0x08FFB80CU; -#endif /* STM32F051x8 or STM32F058x8 */ - - /* Reset HSEON, CSSON and PLLON bits */ - RCC->CR &= (uint32_t)0xFEF6FFFFU; - - /* Reset HSEBYP bit */ - RCC->CR &= (uint32_t)0xFFFBFFFFU; - - /* Reset PLLSRC, PLLXTPRE and PLLMUL[3:0] bits */ - RCC->CFGR &= (uint32_t)0xFFC0FFFFU; - - /* Reset PREDIV[3:0] bits */ - RCC->CFGR2 &= (uint32_t)0xFFFFFFF0U; - -#if defined (STM32F072xB) || defined (STM32F078xx) - /* Reset USART2SW[1:0], USART1SW[1:0], I2C1SW, CECSW, USBSW and ADCSW bits */ - RCC->CFGR3 &= (uint32_t)0xFFFCFE2CU; -#elif defined (STM32F071xB) - /* Reset USART2SW[1:0], USART1SW[1:0], I2C1SW, CECSW and ADCSW bits */ - RCC->CFGR3 &= (uint32_t)0xFFFFCEACU; -#elif defined (STM32F091xC) || defined (STM32F098xx) - /* Reset USART3SW[1:0], USART2SW[1:0], USART1SW[1:0], I2C1SW, CECSW and ADCSW bits */ - RCC->CFGR3 &= (uint32_t)0xFFF0FEACU; -#elif defined (STM32F030x6) || defined (STM32F030x8) || defined (STM32F031x6) || defined (STM32F038xx) || defined (STM32F030xC) - /* Reset USART1SW[1:0], I2C1SW and ADCSW bits */ - RCC->CFGR3 &= (uint32_t)0xFFFFFEECU; -#elif defined (STM32F051x8) || defined (STM32F058xx) - /* Reset USART1SW[1:0], I2C1SW, CECSW and ADCSW bits */ - RCC->CFGR3 &= (uint32_t)0xFFFFFEACU; -#elif defined (STM32F042x6) || defined (STM32F048xx) - /* Reset USART1SW[1:0], I2C1SW, CECSW, USBSW and ADCSW bits */ - RCC->CFGR3 &= (uint32_t)0xFFFFFE2CU; -#elif defined (STM32F070x6) || defined (STM32F070xB) - /* Reset USART1SW[1:0], I2C1SW, USBSW and ADCSW bits */ - RCC->CFGR3 &= (uint32_t)0xFFFFFE6CU; - /* Set default USB clock to PLLCLK, since there is no HSI48 */ - RCC->CFGR3 |= (uint32_t)0x00000080U; -#else - #warning "No target selected" -#endif - - /* Reset HSI14 bit */ - RCC->CR2 &= (uint32_t)0xFFFFFFFEU; - - /* Disable all interrupts */ - RCC->CIR = 0x00000000U; - -} - -/** - * @brief Update SystemCoreClock variable according to Clock Register Values. - * The SystemCoreClock variable contains the core clock (HCLK), it can - * be used by the user application to setup the SysTick timer or configure - * other parameters. - * - * @note Each time the core clock (HCLK) changes, this function must be called - * to update SystemCoreClock variable value. Otherwise, any configuration - * based on this variable will be incorrect. - * - * @note - The system frequency computed by this function is not the real - * frequency in the chip. It is calculated based on the predefined - * constant and the selected clock source: - * - * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) - * - * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) - * - * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) - * or HSI_VALUE(*) multiplied/divided by the PLL factors. - * - * (*) HSI_VALUE is a constant defined in stm32f0xx_hal.h file (default value - * 8 MHz) but the real value may vary depending on the variations - * in voltage and temperature. - * - * (**) HSE_VALUE is a constant defined in stm32f0xx_hal.h file (default value - * 8 MHz), user has to ensure that HSE_VALUE is same as the real - * frequency of the crystal used. Otherwise, this function may - * have wrong result. - * - * - The result of this function could be not correct when using fractional - * value for HSE crystal. - * - * @param None - * @retval None - */ -void SystemCoreClockUpdate (void) -{ - uint32_t tmp = 0, pllmull = 0, pllsource = 0, predivfactor = 0; - - /* Get SYSCLK source -------------------------------------------------------*/ - tmp = RCC->CFGR & RCC_CFGR_SWS; - - switch (tmp) - { - case RCC_CFGR_SWS_HSI: /* HSI used as system clock */ - SystemCoreClock = HSI_VALUE; - break; - case RCC_CFGR_SWS_HSE: /* HSE used as system clock */ - SystemCoreClock = HSE_VALUE; - break; - case RCC_CFGR_SWS_PLL: /* PLL used as system clock */ - /* Get PLL clock source and multiplication factor ----------------------*/ - pllmull = RCC->CFGR & RCC_CFGR_PLLMUL; - pllsource = RCC->CFGR & RCC_CFGR_PLLSRC; - pllmull = ( pllmull >> 18) + 2; - predivfactor = (RCC->CFGR2 & RCC_CFGR2_PREDIV) + 1; - - if (pllsource == RCC_CFGR_PLLSRC_HSE_PREDIV) - { - /* HSE used as PLL clock source : SystemCoreClock = HSE/PREDIV * PLLMUL */ - SystemCoreClock = (HSE_VALUE/predivfactor) * pllmull; - } -#if defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx) - else if (pllsource == RCC_CFGR_PLLSRC_HSI48_PREDIV) - { - /* HSI48 used as PLL clock source : SystemCoreClock = HSI48/PREDIV * PLLMUL */ - SystemCoreClock = (HSI48_VALUE/predivfactor) * pllmull; - } -#endif /* STM32F042x6 || STM32F048xx || STM32F072xB || STM32F078xx || STM32F091xC || STM32F098xx */ - else - { -#if defined(STM32F042x6) || defined(STM32F048xx) || defined(STM32F070x6) \ - || defined(STM32F078xx) || defined(STM32F071xB) || defined(STM32F072xB) \ - || defined(STM32F070xB) || defined(STM32F091xC) || defined(STM32F098xx) || defined(STM32F030xC) - /* HSI used as PLL clock source : SystemCoreClock = HSI/PREDIV * PLLMUL */ - SystemCoreClock = (HSI_VALUE/predivfactor) * pllmull; -#else - /* HSI used as PLL clock source : SystemCoreClock = HSI/2 * PLLMUL */ - SystemCoreClock = (HSI_VALUE >> 1) * pllmull; -#endif /* STM32F042x6 || STM32F048xx || STM32F070x6 || - STM32F071xB || STM32F072xB || STM32F078xx || STM32F070xB || - STM32F091xC || STM32F098xx || STM32F030xC */ - } - break; - default: /* HSI used as system clock */ - SystemCoreClock = HSI_VALUE; - break; - } - /* Compute HCLK clock frequency ----------------*/ - /* Get HCLK prescaler */ - tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; - /* HCLK clock frequency */ - SystemCoreClock >>= tmp; -} - -/** - * @} - */ - -/** - * @} - */ - -/** - * @} - */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ - diff --git a/tool_services/inspector/README.md b/tool_services/inspector/README.md deleted file mode 100644 index 564fbcf79..000000000 --- a/tool_services/inspector/README.md +++ /dev/null @@ -1,29 +0,0 @@ -Luos logo - -[![](https://img.shields.io/github/license/Luos-io/Luos)](https://github.com/Luos-io/luos_engine/blob/master/LICENSE) - - -[![](https://img.shields.io/badge/Luos-Documentation-34A3B4)](https://www.luos.io) -[![](http://certified.luos.io)](https://luos.io) -[![PlatformIO Registry](https://badges.registry.platformio.org/packages/luos/library/Inspector.svg)](https://registry.platformio.org/libraries/luos_engine/Inspector) - - -[![](https://img.shields.io/discord/902486791658041364?label=Discord&logo=discord&style=social)](http://bit.ly/JoinLuosDiscord) -[![](https://img.shields.io/reddit/subreddit-subscribers/Luos?style=social)](https://www.reddit.com/r/Luos) -[![](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Unleash%20electronic%20devices%20as%20microservices%20thanks%20to%20Luos&https://luos.io&via=Luos_io&hashtags=embeddedsystems,electronics,microservices,api) -[![](https://img.shields.io/badge/LinkedIn-Share-0077B5?style=social&logo=linkedin)](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fgithub.com%2Fluos-io) - - -# Inspector app -A Luos service application allowing a computer to inspect a product. - - -## To learn more -This section details the features of Luos technology as an embedded development platform, following these subjects: - -* Let's test through the [Luos get started](https://www.luos.io/tutorials/get-started), to build, flash, run, and control your very first Luos code. -* The [Basics of Luos](https://www.luos.io/docs/luos-technology/basics), explaining the general concepts. -* Definition of [Nodes](https://www.luos.io/docs/luos-technology/node), and the relation between Luos and the physical world. -* Definition of [Packages](https://www.luos.io/docs/luos-technology/package), and how to make a portable and reusable development. -* Definition of [Services](https://www.luos.io/docs/luos-technology/services), how to create and declare features in your product. -* Definition of [Messages](https://www.luos.io/docs/luos-technology/message), when, why, and how to handle them, explaining the more advanced features of Luos. diff --git a/tool_services/inspector/data_manager.c b/tool_services/inspector/data_manager.c deleted file mode 100644 index 97d610cea..000000000 --- a/tool_services/inspector/data_manager.c +++ /dev/null @@ -1,225 +0,0 @@ -/****************************************************************************** - * @file data manager - * @brief data manager for inspector - * @author Luos - ******************************************************************************/ -#include "pipe_link.h" -#include "data_manager.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -#define MAX_ASSERT_NUMBER 3 -#define MAX_TOTAL_MSG_SIZE 135 -/******************************************************************************* - * Variables - ******************************************************************************/ -uint8_t inspector_state = STARTED; -// assert messages counter -uint8_t assert_num = 0; -// assert buffer for storing the messages -uint8_t assert_buf[MAX_ASSERT_NUMBER][MAX_TOTAL_MSG_SIZE]; -// table with all the complete sizes of the assert messages -uint8_t assert_buf_size[MAX_ASSERT_NUMBER] = {0}; -/******************************************************************************* - * Function - ******************************************************************************/ -/****************************************************************************** - * @brief function to send the full routing table - * @param service pointer - * @return None - ******************************************************************************/ -void DataManager_SendRoutingTB(service_t *service) -{ - search_result_t result; - uint8_t data[MAX_RTB_ENTRY * sizeof(routing_table_t)] = {0}; - - RTFilter_Service(RTFilter_Reset(&result), service); - // store the address of the RoutingTB - routing_table_t *routing_table = RoutingTB_Get(); - msg_t msg; - msg.header.config = BASE_PROTOCOL; - msg.header.target = DEFAULTID; - msg.header.target_mode = SERVICEID; - msg.header.source = result.result_table[0]->id; - msg.header.cmd = RTB; - msg.header.size = RoutingTB_GetLastEntry() * sizeof(routing_table_t); - - memcpy(data, msg.stream, sizeof(header_t)); - memcpy(&data[sizeof(header_t)], routing_table, msg.header.size); - - PipeLink_Send(service, data, msg.header.size + sizeof(header_t)); -} -/****************************************************************************** - * @brief extract the command value for the pipe messages - * @param service pointer - * @return None - ******************************************************************************/ -uint8_t DataManager_ExtractCommand(msg_t *msg) -{ - return msg->data[4]; -} -/****************************************************************************** - * @brief function to pull the external messages from the pipe - * @param service pointer - * @return None - ******************************************************************************/ -void DataManager_GetPipeMsg(service_t *service, msg_t *data_msg) -{ - int *pointer; - msg_t msg; - uint8_t cmd; - // pipe sent the streaming channel - if (data_msg->header.cmd == PARAMETERS) - { - // link the address of the streaming channel L2P - memcpy(&pointer, data_msg->data, sizeof(void *)); - PipeLink_SetDirectPipeSend((void *)pointer); - return; - } - - cmd = DataManager_ExtractCommand(data_msg); - // This message is a command from pipe - switch (cmd) - { - case ASK_DETECTION: - Luos_Detect(service); - break; - case RTB: - // first message for the inspector - // send the routing table using pipe - DataManager_SendRoutingTB(service); - break; - case CONTROL: - // if we receive a CONTROL we should desactivate or activate the filtering - if (data_msg->data[7] == true) - { - // check if data is true so that the inspector needs to start - // Luos_SetFilterState(false, service); - inspector_state = STARTED; - } - else - { - // if we receive a false we should reactivate the filtering - inspector stopped - // Luos_SetFilterState(true, service); - inspector_state = STOPPED; - } - break; - case LUOS_STATISTICS: - // extract service that we want the stats - msg.header.target = (data_msg->data[8] << 8) + data_msg->data[7]; - msg.header.target_mode = SERVICEID; - msg.header.cmd = LUOS_STATISTICS; - msg.header.size = 0; - Luos_SendMsg(service, &msg); - break; - case LUOS_REVISION: - // extract service that we want the luos revision - msg.header.target = (data_msg->data[8] << 8) + data_msg->data[7]; - msg.header.target_mode = SERVICEID; - msg.header.cmd = LUOS_REVISION; - msg.header.size = 0; - Luos_SendMsg(service, &msg); - break; - case REVISION: - // extract service that we want the firmware revision - msg.header.target = (data_msg->data[8] << 8) + data_msg->data[7]; - msg.header.target_mode = SERVICEID; - msg.header.cmd = REVISION; - msg.header.size = 0; - Luos_SendMsg(service, &msg); - break; - case ASSERT: - if (((data_msg->data[6] << 8) + data_msg->data[5]) == 0) - { - for (uint8_t i = 0; i < assert_num; i++) - { - // send all the existing assert messages - PipeLink_Send(service, &assert_buf[i][0], assert_buf_size[i]); - } - assert_num = 0; - } - // empty the assert messages buffer by turning the counter to 0 - break; - default: - break; - } -} -/****************************************************************************** - * @brief function to pull the messages from services - * @param service pointer - * @return None - ******************************************************************************/ -void DataManager_GetServiceMsg(service_t *service) -{ - // loop into services. - msg_t data_msg; - search_result_t result; - uint8_t i = 0; - - RTFilter_Reset(&result); - while (i < result.result_nbr) - { - // pull available messages - if (Luos_ReadFromService(service, result.result_table[i]->id, &data_msg) == SUCCEED) - { - // drop the messages that are destined to pipe - if (data_msg.header.target == PipeLink_GetId()) - { - i++; - continue; - } - // Check if this is a message from pipe - if (data_msg.header.source == PipeLink_GetId()) - { - // treat message from pipe - DataManager_GetPipeMsg(service, &data_msg); - i++; - continue; - } - // check if this is an assert - if ((data_msg.header.cmd == ASSERT) && (data_msg.header.size > 0)) - { - if (assert_num >= MAX_ASSERT_NUMBER) - { - // if we reached the maximum number of asserts delete the older and keep the newer - for (uint8_t j = 1; j < MAX_ASSERT_NUMBER; j++) - { - memcpy(&assert_buf[j - 1][0], &assert_buf[j][0], assert_buf_size[j]); - assert_buf_size[j - 1] = assert_buf_size[j]; - } - assert_num--; - } - // save the assert message to the assert messages buffer - memcpy(&assert_buf[assert_num][0], data_msg.stream, sizeof(header_t) + data_msg.header.size); - // store the size of this message - assert_buf_size[assert_num] = sizeof(header_t) + data_msg.header.size; - assert_num++; - i++; - continue; - } - if (data_msg.header.cmd == END_DETECTION) - { - PipeLink_Find(service); - i++; - continue; - } - if (data_msg.header.cmd == ASK_DETECTION) - { - i++; - continue; - } - // send any other message to pipe - PipeLink_Send(service, data_msg.stream, (sizeof(uint8_t) * data_msg.header.size) + sizeof(header_t)); - } - i++; - } -} -/****************************************************************************** - * @brief get if the inspector is started or stopped - * @param service pointer - * @return None - ******************************************************************************/ -uint8_t DataManager_GetInspectorState(void) -{ - return inspector_state; -} diff --git a/tool_services/inspector/data_manager.h b/tool_services/inspector/data_manager.h deleted file mode 100644 index f4ccb063c..000000000 --- a/tool_services/inspector/data_manager.h +++ /dev/null @@ -1,25 +0,0 @@ -/****************************************************************************** - * @file data manager - * @brief data manager for inspector - * @author Luos - ******************************************************************************/ -#include "inspector.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -typedef enum -{ - STOPPED, - STARTED -} insp_state_t; -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Function - ******************************************************************************/ -void DataManager_GetPipeMsg(service_t *service, msg_t *data_msg); -uint8_t DataManager_GetInspectorState(void); -void DataManager_SendRoutingTB(service_t *service); -void DataManager_GetServiceMsg(service_t *service); \ No newline at end of file diff --git a/tool_services/inspector/inspector.c b/tool_services/inspector/inspector.c deleted file mode 100644 index 4b5edaff2..000000000 --- a/tool_services/inspector/inspector.c +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** - * @file gate - * @brief Service gate - * @author Luos - ******************************************************************************/ -#include -#include -#include "inspector.h" -#include "pipe_link.h" -#include "data_manager.h" -#include "luos_list.h" - -/******************************************************************************* - * Definitions - ******************************************************************************/ -/******************************************************************************* - * Variables - ******************************************************************************/ -service_t *inspector; -static uint16_t pipe_id = 0; -/******************************************************************************* - * Function - ******************************************************************************/ -/****************************************************************************** - * @brief init must be call in project init - * @param None - * @return None - ******************************************************************************/ -void Inspector_Init(void) -{ - revision_t revision = {.major = 1, .minor = 0, .build = 0}; - // inspector service creation - inspector = Luos_CreateService(0, INSPECTOR_TYPE, "inspector", revision); -#ifndef NODETECTION - Luos_Detect(inspector); -#endif -} - -/****************************************************************************** - * @brief loop must be call in project loop - * @param None - * @return None - ******************************************************************************/ -void Inspector_Loop(void) -{ - // check if the network is detected - if (Luos_IsDetected()) - { - if (Luos_NbrAvailableMsg() > 0) - { - DataManager_GetServiceMsg(inspector); - } - } - else - { - // if the network is not yet detected reset the pipe id - pipe_id = 0; - // send to Luos a flag in order to filter the messages - // Luos_SetFilterState(true, inspector); - } -} diff --git a/tool_services/inspector/inspector.h b/tool_services/inspector/inspector.h deleted file mode 100644 index 11ee3ca60..000000000 --- a/tool_services/inspector/inspector.h +++ /dev/null @@ -1,22 +0,0 @@ -/****************************************************************************** - * @file inspector - * @brief Service inspector - * @author Luos - ******************************************************************************/ -#ifndef INSPECTOR_H -#define INSPECTOR_H - -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Function - ******************************************************************************/ -void Inspector_Init(void); -void Inspector_Loop(void); -#endif /* INSPECTOR_H */ diff --git a/tool_services/inspector/library.json b/tool_services/inspector/library.json deleted file mode 100644 index f61744ca9..000000000 --- a/tool_services/inspector/library.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "Inspector", - "keywords": "robus,network,microservice,luos,operating system,os,embedded,communication,service,ST,cJSON", - "description": "A Luos service application allowing a computer to inspect a product.", - "version": "2.0.0", - "authors": { - "name": "Luos", - "url": "https://luos.io" - }, - "homepage": "https://luos.io", - "licence": "MIT", - "headers": "inspector.h", - "dependencies": { - "luos_engine": "^3.0.0" - }, - "repository": { - "type": "git", - "url": "https://github.com/Luos-io/luos_engine" - } -} \ No newline at end of file diff --git a/tool_services/inspector/pipe_link.c b/tool_services/inspector/pipe_link.c deleted file mode 100644 index 4e646a900..000000000 --- a/tool_services/inspector/pipe_link.c +++ /dev/null @@ -1,134 +0,0 @@ -/****************************************************************************** - * @file pipe_link - * @brief Manage the communication with a pipe. - * @author Luos - ******************************************************************************/ -#include "pipe_link.h" -#include "streaming.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ -uint16_t pipe_id = 0; -streaming_channel_t *PipeDirectPutSample = NULL; - -/******************************************************************************* - * Function - ******************************************************************************/ - -/****************************************************************************** - * @brief send message to the connected pipe - * @param service pointer, data to send, size of data to send - * @return None - ******************************************************************************/ -void PipeLink_Send(service_t *service, void *data, uint32_t size) -{ - LUOS_ASSERT(pipe_id > 0); - msg_t msg; - msg.header.target = pipe_id; - msg.header.cmd = SET_CMD; - msg.header.target_mode = SERVICEIDACK; - if (PipeDirectPutSample == 0) - { - // We are not using localhost send the entire data trough the Luos network - Luos_SendData(service, &msg, data, size); - } - else - { - msg.header.config = BASE_PROTOCOL; - // We have a localhost pipe - // Copy the data directly into the local streaming channel without passing by Luos. - Streaming_PutSample(PipeDirectPutSample, data, size); - // Send a void set_cmd to strat data transmission on pipe. - msg.header.size = 0; - Luos_SendMsg(service, &msg); - } -} -/****************************************************************************** - * @brief find a pipe and get its id - * @param service pointer - * @return pipe_id - ******************************************************************************/ -uint16_t PipeLink_Find(service_t *service) -{ - search_result_t result; - uint8_t localhost = false; - // search a pipe type in localhost - RTFilter_Node(RTFilter_Type(RTFilter_Reset(&result), PIPE_TYPE), RoutingTB_NodeIDFromID(service->id)); - - if (result.result_nbr > 0) - { - // we found a pipe in the same node - localhost = true; - } - else - { - // pipe is not in the same node - RTFilter_Type(RTFilter_Reset(&result), PIPE_TYPE); - } - // keep pipe_id - pipe_id = result.result_table[0]->id; - - if (pipe_id > 0) - { - // We find one, ask it to auto-update at 1000Hz - msg_t msg; - msg.header.target = pipe_id; - msg.header.target_mode = SERVICEIDACK; - time_luos_t time = TimeOD_TimeFrom_s(0.001f); - TimeOD_TimeToMsg(&time, &msg); - msg.header.cmd = UPDATE_PUB; - while (Luos_SendMsg(service, &msg) != SUCCEED) - ; - - if (localhost) - { - // This is a localhost pipe - // Ask for a Streaming channel - msg_t msg; - msg.header.target = pipe_id; - msg.header.target_mode = SERVICEIDACK; - msg.header.cmd = PARAMETERS; - msg.header.size = 0; - while (Luos_SendMsg(service, &msg) != SUCCEED) - ; - } - } - return pipe_id; -} -/****************************************************************************** - * @brief reset the connection of pipe - * @param service pointer, msg received - * @return None - ******************************************************************************/ -void PipeLink_Reset(service_t *service) -{ - LUOS_ASSERT(pipe_id > 0); - msg_t msg; - msg.header.target = pipe_id; - msg.header.cmd = REINIT; - msg.header.target_mode = SERVICEIDACK; - msg.header.size = 0; - Luos_SendMsg(service, &msg); -} -/****************************************************************************** - * @brief set fonction to direct send in buffer if pipe is in localhost - * @param streaming channel of pipe - * @return None - ******************************************************************************/ -void PipeLink_SetDirectPipeSend(void *PipeSend) -{ - PipeDirectPutSample = PipeSend; -} -/****************************************************************************** - * @brief get id from pipe - * @param None - * @return pipe_id - ******************************************************************************/ -uint16_t PipeLink_GetId(void) -{ - return pipe_id; -} diff --git a/tool_services/inspector/pipe_link.h b/tool_services/inspector/pipe_link.h deleted file mode 100644 index 7b13a6e2f..000000000 --- a/tool_services/inspector/pipe_link.h +++ /dev/null @@ -1,27 +0,0 @@ -/****************************************************************************** - * @file pipe_link - * @brief Manage the communication with a pipe. - * @author Luos - ******************************************************************************/ -#ifndef PIPE_LINK_H -#define PIPE_LINK_H - -#include "luos_engine.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ - -/******************************************************************************* - * Variables - ******************************************************************************/ - -/******************************************************************************* - * Function - ******************************************************************************/ -void PipeLink_Send(service_t *service, void *data, uint32_t size); -uint16_t PipeLink_Find(service_t *service); -void PipeLink_Reset(service_t *service); -uint16_t PipeLink_GetId(void); -void PipeLink_SetDirectPipeSend(void *PipeSend); - -#endif /* PIPE_LINK_H */ From 9bac6bfb45f93238fd95279d1d036cfaae92b17c Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 28 Aug 2023 14:59:57 +0200 Subject: [PATCH 118/150] Make a clean BAUDRATE configuration for networks --- .../projects/Arduino/button/platformio.ini | 2 +- examples/projects/ESP32/button/node_config.h | 2 +- .../ESP32/button_arduino/node_config.h | 4 ++-- .../ESP32/gate_serialcom/node_config.h | 6 ++--- .../gate_serialcom_arduino/node_config.h | 6 ++--- .../projects/ESP32/gate_wscom/node_config.h | 4 ++-- .../ESP32/gate_wscom_arduino/node_config.h | 2 +- examples/projects/ESP32/led/node_config.h | 4 ++-- .../NUCLEO-F072RB/barometer/node_config.h | 2 +- .../NUCLEO-L073RZ/bootloader/node_config.h | 4 ++-- .../NUCLEO-L073RZ/button/node_config.h | 4 ++-- .../gate_serialcom/node_config.h | 2 +- .../robus_network/HAL/ATSAMD21/robus_hal.c | 2 +- .../HAL/ATSAMD21_ARDUINO/robus_hal.c | 2 +- .../HAL/ATSAMD21_MBED/robus_hal.c | 2 +- network/robus_network/HAL/ESP32/robus_hal.c | 4 ++-- network/robus_network/HAL/NATIVE/robus_hal.c | 2 +- network/robus_network/HAL/STM32F0/robus_hal.c | 4 ++-- network/robus_network/HAL/STM32F4/robus_hal.c | 4 ++-- network/robus_network/HAL/STM32G4/robus_hal.c | 4 ++-- network/robus_network/HAL/STM32L0/robus_hal.c | 4 ++-- network/robus_network/HAL/STM32L4/robus_hal.c | 4 ++-- network/robus_network/HAL/STUB/robus_hal.c | 2 +- .../robus_network/HAL/template/robus_hal.c | 6 ++--- network/robus_network/robus_config.h | 7 ++++-- .../HAL/ARDUINO/serial_network_hal.cpp | 8 +------ .../HAL/NATIVE/serial_network_hal.c | 12 ++-------- .../HAL/STM32F0/serial_network_hal.c | 9 ++------ .../HAL/STM32F4/serial_network_hal.c | 9 ++------ .../HAL/STM32G431/serial_network_hal.c | 9 ++------ .../HAL/STM32G474/serial_network_hal.c | 9 ++------ .../HAL/STM32L4/serial_network_hal.c | 9 ++------ .../HAL/template/serial_network_hal.c | 9 ++------ network/serial_network/inc/_serial_network.h | 1 + network/serial_network/inc/serial_network.h | 9 +++----- network/serial_network/serial_config.h | 22 +++++++++++++++++++ .../serial_select_hal_script.py | 2 ++ 37 files changed, 89 insertions(+), 108 deletions(-) create mode 100644 network/serial_network/serial_config.h diff --git a/examples/projects/Arduino/button/platformio.ini b/examples/projects/Arduino/button/platformio.ini index 64af7d27f..c3e593e05 100644 --- a/examples/projects/Arduino/button/platformio.ini +++ b/examples/projects/Arduino/button/platformio.ini @@ -35,7 +35,7 @@ build_flags = -O1 -include node_config.h -D LUOSHAL=ARDUINO - -D SERIAL_COM_DEFAULTBAUDRATE=115200 + -D ROBUS_NETWORK_BAUDRATE=115200 lib_deps = luos_engine@^3.0.0 serial_network diff --git a/examples/projects/ESP32/button/node_config.h b/examples/projects/ESP32/button/node_config.h index cb3e1a007..6d0d72f71 100644 --- a/examples/projects/ESP32/button/node_config.h +++ b/examples/projects/ESP32/button/node_config.h @@ -46,7 +46,7 @@ ******************************************************************************/ #define MSG_BUFFER_SIZE 1024 -#define DEFAULTBAUDRATE 500000 +#define ROBUS_NETWORK_BAUDRATE 500000 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/ESP32/button_arduino/node_config.h b/examples/projects/ESP32/button_arduino/node_config.h index cb3e1a007..0f0d5d4a8 100644 --- a/examples/projects/ESP32/button_arduino/node_config.h +++ b/examples/projects/ESP32/button_arduino/node_config.h @@ -45,8 +45,8 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MSG_BUFFER_SIZE 1024 -#define DEFAULTBAUDRATE 500000 +#define MSG_BUFFER_SIZE 1024 +#define ROBUS_NETWORK_BAUDRATE 500000 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/ESP32/gate_serialcom/node_config.h b/examples/projects/ESP32/gate_serialcom/node_config.h index 8bdeb7443..1308c84be 100644 --- a/examples/projects/ESP32/gate_serialcom/node_config.h +++ b/examples/projects/ESP32/gate_serialcom/node_config.h @@ -45,9 +45,9 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MSG_BUFFER_SIZE 1024 -#define PIPE_SERIAL_BAUDRATE 115200 -#define DEFAULTBAUDRATE 500000 +#define MSG_BUFFER_SIZE 1024 +#define PIPE_SERIAL_BAUDRATE 115200 +#define ROBUS_NETWORK_BAUDRATE 500000 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/ESP32/gate_serialcom_arduino/node_config.h b/examples/projects/ESP32/gate_serialcom_arduino/node_config.h index f52aa9d51..c0e0edf11 100644 --- a/examples/projects/ESP32/gate_serialcom_arduino/node_config.h +++ b/examples/projects/ESP32/gate_serialcom_arduino/node_config.h @@ -45,9 +45,9 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MSG_BUFFER_SIZE 1024 -#define PIPE_SERIAL_BAUDRATE 500000 -#define DEFAULTBAUDRATE 500000 +#define MSG_BUFFER_SIZE 1024 +#define PIPE_SERIAL_BAUDRATE 500000 +#define ROBUS_NETWORK_BAUDRATE 500000 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/ESP32/gate_wscom/node_config.h b/examples/projects/ESP32/gate_wscom/node_config.h index a0cc2e465..f199b6ef9 100644 --- a/examples/projects/ESP32/gate_wscom/node_config.h +++ b/examples/projects/ESP32/gate_wscom/node_config.h @@ -45,8 +45,8 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MSG_BUFFER_SIZE 1024 -#define DEFAULTBAUDRATE 500000 +#define MSG_BUFFER_SIZE 1024 +#define ROBUS_NETWORK_BAUDRATE 500000 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/ESP32/gate_wscom_arduino/node_config.h b/examples/projects/ESP32/gate_wscom_arduino/node_config.h index 0e035363b..887799b15 100644 --- a/examples/projects/ESP32/gate_wscom_arduino/node_config.h +++ b/examples/projects/ESP32/gate_wscom_arduino/node_config.h @@ -48,7 +48,7 @@ #define MAX_LOCAL_SERVICE_NUMBER 2 #define MAX_MSG_NB 20 #define MSG_BUFFER_SIZE 1024 -#define DEFAULTBAUDRATE 500000 +#define ROBUS_NETWORK_BAUDRATE 500000 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/ESP32/led/node_config.h b/examples/projects/ESP32/led/node_config.h index cb3e1a007..0f0d5d4a8 100644 --- a/examples/projects/ESP32/led/node_config.h +++ b/examples/projects/ESP32/led/node_config.h @@ -45,8 +45,8 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MSG_BUFFER_SIZE 1024 -#define DEFAULTBAUDRATE 500000 +#define MSG_BUFFER_SIZE 1024 +#define ROBUS_NETWORK_BAUDRATE 500000 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-F072RB/barometer/node_config.h b/examples/projects/NUCLEO-F072RB/barometer/node_config.h index bb12fbb4d..e5a271083 100644 --- a/examples/projects/NUCLEO-F072RB/barometer/node_config.h +++ b/examples/projects/NUCLEO-F072RB/barometer/node_config.h @@ -91,6 +91,6 @@ * INIT_TIME | 150 | Wait init time before first detection * ******************************************************************************/ -#define DEFAULTBAUDRATE 500000 +#define ROBUS_NETWORK_BAUDRATE 500000 #endif /* _NODE_CONFIG_H_ */ diff --git a/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h b/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h index e76188fac..f8c9f6ab0 100644 --- a/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h @@ -37,7 +37,7 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * DEFAULTBAUDRATE | 1000000 | Robus Network Baudrate b/s + * ROBUS_NETWORK_BAUDRATE | 1000000 | Robus Network Baudrate b/s * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX @@ -47,7 +47,7 @@ * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define DEFAULTBAUDRATE 500000 +#define ROBUS_NETWORK_BAUDRATE 500000 #define MSG_BUFFER_SIZE 512 /******************************************************************************* diff --git a/examples/projects/NUCLEO-L073RZ/button/node_config.h b/examples/projects/NUCLEO-L073RZ/button/node_config.h index 3f899fc25..4de9ad22e 100644 --- a/examples/projects/NUCLEO-L073RZ/button/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/button/node_config.h @@ -37,7 +37,7 @@ ******************************************************************************* * Define | Default Value | Description * :---------------------|------------------------------------------------------ - * DEFAULTBAUDRATE | 1000000 | Robus Network Baudrate b/s + * ROBUS_NETWORK_BAUDRATE | 1000000 | Robus Network Baudrate b/s * MAX_LOCAL_SERVICE_NUMBER | 5 | Service number in the node * MAX_NODE_NUMBER. | 20 | Node number in the device * MSG_BUFFER_SIZE | 3*SIZE_MSG_MAX (405 Bytes) | Size in byte of the Luos buffer TX and RX @@ -47,7 +47,7 @@ * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define DEFAULTBAUDRATE 500000 +#define ROBUS_NETWORK_BAUDRATE 500000 #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 #define MAX_MSG_NB 5 diff --git a/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h b/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h index f6624b543..328eb57b5 100644 --- a/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/gate_serialcom/node_config.h @@ -46,7 +46,7 @@ * NBR_PORT | 2 | PTP Branch number Max 8 * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define DEFAULTBAUDRATE 500000 +#define ROBUS_NETWORK_BAUDRATE 500000 #define MAX_LOCAL_SERVICE_NUMBER 2 #define MSG_BUFFER_SIZE 2048 #define MAX_MSG_NB 40 diff --git a/network/robus_network/HAL/ATSAMD21/robus_hal.c b/network/robus_network/HAL/ATSAMD21/robus_hal.c index d83631384..ef9cd21f4 100644 --- a/network/robus_network/HAL/ATSAMD21/robus_hal.c +++ b/network/robus_network/HAL/ATSAMD21/robus_hal.c @@ -65,7 +65,7 @@ void RobusHAL_Init(void) RobusHAL_CRCInit(); // Com Initialization - RobusHAL_ComInit(DEFAULTBAUDRATE); + RobusHAL_ComInit(ROBUS_NETWORK_BAUDRATE); } /****************************************************************************** diff --git a/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.c b/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.c index ec5944d38..2cae033b6 100644 --- a/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.c +++ b/network/robus_network/HAL/ATSAMD21_ARDUINO/robus_hal.c @@ -69,7 +69,7 @@ void RobusHAL_Init(void) RobusHAL_CRCInit(); // Com Initialization - RobusHAL_ComInit(DEFAULTBAUDRATE); + RobusHAL_ComInit(ROBUS_NETWORK_BAUDRATE); } /****************************************************************************** diff --git a/network/robus_network/HAL/ATSAMD21_MBED/robus_hal.c b/network/robus_network/HAL/ATSAMD21_MBED/robus_hal.c index 016a79224..f629f9edc 100644 --- a/network/robus_network/HAL/ATSAMD21_MBED/robus_hal.c +++ b/network/robus_network/HAL/ATSAMD21_MBED/robus_hal.c @@ -66,7 +66,7 @@ void RobusHAL_Init(void) RobusHAL_CRCInit(); // Com Initialization - RobusHAL_ComInit(DEFAULTBAUDRATE); + RobusHAL_ComInit(ROBUS_NETWORK_BAUDRATE); } /****************************************************************************** diff --git a/network/robus_network/HAL/ESP32/robus_hal.c b/network/robus_network/HAL/ESP32/robus_hal.c index 39689fb07..9dde9711f 100644 --- a/network/robus_network/HAL/ESP32/robus_hal.c +++ b/network/robus_network/HAL/ESP32/robus_hal.c @@ -42,7 +42,7 @@ /******************************************************************************* * Variables ******************************************************************************/ -uint32_t Timer_Prescaler = (uint32_t)(MCUFREQ / DEFAULTBAUDRATE); //(freq MCU/freq timer)/divider timer clock source +uint32_t Timer_Prescaler = (uint32_t)(MCUFREQ / ROBUS_NETWORK_BAUDRATE); //(freq MCU/freq timer)/divider timer clock source typedef struct { @@ -103,7 +103,7 @@ void RobusHAL_Init(void) RobusHAL_CRCInit(); // Com Initialization - RobusHAL_ComInit(DEFAULTBAUDRATE); + RobusHAL_ComInit(ROBUS_NETWORK_BAUDRATE); // Reference the IRQ manafement function of Robus Phy_SetIrqStateFunciton(RobusHAL_SetIrqState); diff --git a/network/robus_network/HAL/NATIVE/robus_hal.c b/network/robus_network/HAL/NATIVE/robus_hal.c index 096981441..7a41bd915 100644 --- a/network/robus_network/HAL/NATIVE/robus_hal.c +++ b/network/robus_network/HAL/NATIVE/robus_hal.c @@ -103,7 +103,7 @@ void RobusHAL_Init(void) RobusHAL_CRCInit(); // Com Initialization - RobusHAL_ComInit(DEFAULTBAUDRATE); + RobusHAL_ComInit(ROBUS_NETWORK_BAUDRATE); } /****************************************************************************** diff --git a/network/robus_network/HAL/STM32F0/robus_hal.c b/network/robus_network/HAL/STM32F0/robus_hal.c index 5369c211b..61be2e095 100644 --- a/network/robus_network/HAL/STM32F0/robus_hal.c +++ b/network/robus_network/HAL/STM32F0/robus_hal.c @@ -34,7 +34,7 @@ CRC_HandleTypeDef hcrc; #endif GPIO_InitTypeDef GPIO_InitStruct = {0}; -uint32_t Timer_Prescaler = (MCUFREQ / DEFAULTBAUDRATE) / TIMERDIV; //(freq MCU/freq timer)/divider timer clock source +uint32_t Timer_Prescaler = (MCUFREQ / ROBUS_NETWORK_BAUDRATE) / TIMERDIV; //(freq MCU/freq timer)/divider timer clock source typedef struct { @@ -71,7 +71,7 @@ void RobusHAL_Init(void) RobusHAL_CRCInit(); // Com Initialization - RobusHAL_ComInit(DEFAULTBAUDRATE); + RobusHAL_ComInit(ROBUS_NETWORK_BAUDRATE); } /****************************************************************************** diff --git a/network/robus_network/HAL/STM32F4/robus_hal.c b/network/robus_network/HAL/STM32F4/robus_hal.c index a8bd26306..2846c5671 100644 --- a/network/robus_network/HAL/STM32F4/robus_hal.c +++ b/network/robus_network/HAL/STM32F4/robus_hal.c @@ -34,7 +34,7 @@ CRC_HandleTypeDef hcrc; #endif GPIO_InitTypeDef GPIO_InitStruct = {0}; -uint32_t Timer_Prescaler = (MCUFREQ / DEFAULTBAUDRATE) / TIMERDIV; //(freq MCU/freq timer)/divider timer clock source +uint32_t Timer_Prescaler = (MCUFREQ / ROBUS_NETWORK_BAUDRATE) / TIMERDIV; //(freq MCU/freq timer)/divider timer clock source typedef struct { @@ -72,7 +72,7 @@ void RobusHAL_Init(void) RobusHAL_CRCInit(); // Com Initialization - RobusHAL_ComInit(DEFAULTBAUDRATE); + RobusHAL_ComInit(ROBUS_NETWORK_BAUDRATE); } /****************************************************************************** diff --git a/network/robus_network/HAL/STM32G4/robus_hal.c b/network/robus_network/HAL/STM32G4/robus_hal.c index 75d22fd84..448dc0287 100644 --- a/network/robus_network/HAL/STM32G4/robus_hal.c +++ b/network/robus_network/HAL/STM32G4/robus_hal.c @@ -35,7 +35,7 @@ CRC_HandleTypeDef hcrc; #endif GPIO_InitTypeDef GPIO_InitStruct = {0}; -uint32_t Timer_Prescaler = (MCUFREQ / DEFAULTBAUDRATE) / TIMERDIV; //(freq MCU/freq timer)/divider timer clock source +uint32_t Timer_Prescaler = (MCUFREQ / ROBUS_NETWORK_BAUDRATE) / TIMERDIV; //(freq MCU/freq timer)/divider timer clock source typedef struct { @@ -73,7 +73,7 @@ void RobusHAL_Init(void) RobusHAL_CRCInit(); // Com Initialization - RobusHAL_ComInit(DEFAULTBAUDRATE); + RobusHAL_ComInit(ROBUS_NETWORK_BAUDRATE); } /****************************************************************************** diff --git a/network/robus_network/HAL/STM32L0/robus_hal.c b/network/robus_network/HAL/STM32L0/robus_hal.c index c08b6d6e9..f03c2bcf7 100644 --- a/network/robus_network/HAL/STM32L0/robus_hal.c +++ b/network/robus_network/HAL/STM32L0/robus_hal.c @@ -34,7 +34,7 @@ CRC_HandleTypeDef hcrc; #endif GPIO_InitTypeDef GPIO_InitStruct = {0}; -uint32_t Timer_Prescaler = (MCUFREQ / DEFAULTBAUDRATE) / TIMERDIV; //(freq MCU/freq timer)/divider timer clock source +uint32_t Timer_Prescaler = (MCUFREQ / ROBUS_NETWORK_BAUDRATE) / TIMERDIV; //(freq MCU/freq timer)/divider timer clock source typedef struct { @@ -71,7 +71,7 @@ void RobusHAL_Init(void) RobusHAL_CRCInit(); // Com Initialization - RobusHAL_ComInit(DEFAULTBAUDRATE); + RobusHAL_ComInit(ROBUS_NETWORK_BAUDRATE); } /****************************************************************************** diff --git a/network/robus_network/HAL/STM32L4/robus_hal.c b/network/robus_network/HAL/STM32L4/robus_hal.c index 12c95af2b..b9c9910e3 100644 --- a/network/robus_network/HAL/STM32L4/robus_hal.c +++ b/network/robus_network/HAL/STM32L4/robus_hal.c @@ -35,7 +35,7 @@ CRC_HandleTypeDef hcrc; #endif GPIO_InitTypeDef GPIO_InitStruct = {0}; -uint32_t Timer_Prescaler = (MCUFREQ / DEFAULTBAUDRATE) / TIMERDIV; //(freq MCU/freq timer)/divider timer clock source +uint32_t Timer_Prescaler = (MCUFREQ / ROBUS_NETWORK_BAUDRATE) / TIMERDIV; //(freq MCU/freq timer)/divider timer clock source typedef struct { @@ -72,7 +72,7 @@ void RobusHAL_Init(void) RobusHAL_CRCInit(); // Com Initialization - RobusHAL_ComInit(DEFAULTBAUDRATE); + RobusHAL_ComInit(ROBUS_NETWORK_BAUDRATE); } /****************************************************************************** diff --git a/network/robus_network/HAL/STUB/robus_hal.c b/network/robus_network/HAL/STUB/robus_hal.c index b6cbdd824..cd1389370 100644 --- a/network/robus_network/HAL/STUB/robus_hal.c +++ b/network/robus_network/HAL/STUB/robus_hal.c @@ -59,7 +59,7 @@ void RobusHAL_Init(void) RobusHAL_CRCInit(); // Com Initialization - RobusHAL_ComInit(DEFAULTBAUDRATE); + RobusHAL_ComInit(ROBUS_NETWORK_BAUDRATE); } /****************************************************************************** diff --git a/network/robus_network/HAL/template/robus_hal.c b/network/robus_network/HAL/template/robus_hal.c index db006031f..6a0aadb07 100644 --- a/network/robus_network/HAL/template/robus_hal.c +++ b/network/robus_network/HAL/template/robus_hal.c @@ -27,7 +27,7 @@ * Variables ******************************************************************************/ //(freq MCU/freq timer)/divider timer clock source -uint32_t Timer_Prescaler = (MCUFREQ / DEFAULTBAUDRATE) / TIMERDIV; +uint32_t Timer_Prescaler = (MCUFREQ / ROBUS_NETWORK_BAUDRATE) / TIMERDIV; typedef struct { @@ -62,7 +62,7 @@ void RobusHAL_Init(void) RobusHAL_CRCInit(); // Com Initialization - RobusHAL_ComInit(DEFAULTBAUDRATE); + RobusHAL_ComInit(ROBUS_NETWORK_BAUDRATE); } /****************************************************************************** @@ -97,7 +97,7 @@ void RobusHAL_ComInit(uint32_t Baudrate) * datawith : 8 bits * stopbit : 1 bits * parity : none - * Bauderate : DEFAULTBAUDRATE + * Bauderate : ROBUS_NETWORK_BAUDRATE * * Don't forget to : * enable clock for USART diff --git a/network/robus_network/robus_config.h b/network/robus_network/robus_config.h index b4e0a1003..1d76971ad 100644 --- a/network/robus_network/robus_config.h +++ b/network/robus_network/robus_config.h @@ -13,8 +13,11 @@ #define TIMEOUT_VAL 2 -#ifndef DEFAULTBAUDRATE - #define DEFAULTBAUDRATE 1000000 +#ifdef DEFAULTBAUDRATE + #error 'DEFAULTBAUDRATE' configuration is deprecated and have been replaced by ROBUS_NETWORK_BAUDRATE. +#endif +#ifndef ROBUS_NETWORK_BAUDRATE + #define ROBUS_NETWORK_BAUDRATE 1000000 #endif #ifndef NBR_RETRY diff --git a/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp b/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp index cc73d2507..fce11b2a1 100644 --- a/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp +++ b/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp @@ -15,12 +15,6 @@ extern "C" #ifdef __cplusplus } #endif -/******************************************************************************* - * Definitions - ******************************************************************************/ -#ifndef SERIAL_COM_DEFAULTBAUDRATE - #define SERIAL_COM_DEFAULTBAUDRATE 1000000 -#endif /******************************************************************************* * Function @@ -33,7 +27,7 @@ extern "C" * ****************************************************************************/ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) { - Serial.begin(SERIAL_COM_DEFAULTBAUDRATE); + Serial.begin(SERIAL_NETWORK_BAUDRATE); } /****************************************************************************** diff --git a/network/serial_network/HAL/NATIVE/serial_network_hal.c b/network/serial_network/HAL/NATIVE/serial_network_hal.c index 821b55e56..106417977 100644 --- a/network/serial_network/HAL/NATIVE/serial_network_hal.c +++ b/network/serial_network/HAL/NATIVE/serial_network_hal.c @@ -22,14 +22,6 @@ #include #endif -/******************************************************************************* - * Definitions - ******************************************************************************/ - -#ifndef SERIAL_COM_DEFAULTBAUDRATE - #define SERIAL_COM_DEFAULTBAUDRATE 1000000 -#endif - /******************************************************************************* * Variables ******************************************************************************/ @@ -193,7 +185,7 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) memcpy(portname, SERIAL_PORT, strlen(SERIAL_PORT)); #endif stripStr(portname); - printf("Connection on serial port %s at %d baud\n", portname, SERIAL_COM_DEFAULTBAUDRATE); + printf("Connection on serial port %s at %d baud\n", portname, SERIAL_NETWORK_BAUDRATE); // Open the serial port #ifdef _WIN32 @@ -271,7 +263,7 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) // Bypass baudrate speed limitations of termios by using ioctl #define IOSSIOSPEED 0x80045402 - speed_t speed = SERIAL_COM_DEFAULTBAUDRATE; + speed_t speed = SERIAL_NETWORK_BAUDRATE; if (ioctl(serial_port, IOSSIOSPEED, &speed) < 0) { printf("Error setting baudrate attributes\n"); diff --git a/network/serial_network/HAL/STM32F0/serial_network_hal.c b/network/serial_network/HAL/STM32F0/serial_network_hal.c index f0b721fe8..2d6f0832d 100644 --- a/network/serial_network/HAL/STM32F0/serial_network_hal.c +++ b/network/serial_network/HAL/STM32F0/serial_network_hal.c @@ -14,12 +14,7 @@ #include "stm32f0xx_ll_dma.h" #include "stm32f0xx_ll_system.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -#ifndef SERIAL_COM_DEFAULTBAUDRATE - #define SERIAL_COM_DEFAULTBAUDRATE 1000000 -#endif + /******************************************************************************* * Variables @@ -73,7 +68,7 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) LL_USART_InitTypeDef USART_InitStruct; // Initialise USART3 LL_USART_Disable(SERIAL_COM); - USART_InitStruct.BaudRate = SERIAL_COM_DEFAULTBAUDRATE; + USART_InitStruct.BaudRate = SERIAL_NETWORK_BAUDRATE; USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; USART_InitStruct.StopBits = LL_USART_STOPBITS_1; USART_InitStruct.Parity = LL_USART_PARITY_NONE; diff --git a/network/serial_network/HAL/STM32F4/serial_network_hal.c b/network/serial_network/HAL/STM32F4/serial_network_hal.c index 52dcd9ec6..287710208 100644 --- a/network/serial_network/HAL/STM32F4/serial_network_hal.c +++ b/network/serial_network/HAL/STM32F4/serial_network_hal.c @@ -15,12 +15,7 @@ #include "stm32f4xx_ll_system.h" #include "stm32f4xx_hal.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -#ifndef SERIAL_COM_DEFAULTBAUDRATE - #define SERIAL_COM_DEFAULTBAUDRATE 1000000 -#endif + /******************************************************************************* * Variables @@ -74,7 +69,7 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) LL_USART_InitTypeDef USART_InitStruct; // Initialise USART3 LL_USART_Disable(SERIAL_COM); - USART_InitStruct.BaudRate = SERIAL_COM_DEFAULTBAUDRATE; + USART_InitStruct.BaudRate = SERIAL_NETWORK_BAUDRATE; USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; USART_InitStruct.StopBits = LL_USART_STOPBITS_1; USART_InitStruct.Parity = LL_USART_PARITY_NONE; diff --git a/network/serial_network/HAL/STM32G431/serial_network_hal.c b/network/serial_network/HAL/STM32G431/serial_network_hal.c index 5ef7ad973..f296216d4 100644 --- a/network/serial_network/HAL/STM32G431/serial_network_hal.c +++ b/network/serial_network/HAL/STM32G431/serial_network_hal.c @@ -16,12 +16,7 @@ #include "stm32g4xx_ll_system.h" #include "stm32g4xx_hal.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -#ifndef SERIAL_COM_DEFAULTBAUDRATE - #define SERIAL_COM_DEFAULTBAUDRATE 1000000 -#endif + /******************************************************************************* * Variables @@ -76,7 +71,7 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) LL_USART_InitTypeDef USART_InitStruct; // Initialise USART3 LL_USART_Disable(SERIAL_COM); - USART_InitStruct.BaudRate = SERIAL_COM_DEFAULTBAUDRATE; + USART_InitStruct.BaudRate = SERIAL_NETWORK_BAUDRATE; USART_InitStruct.PrescalerValue = LL_USART_PRESCALER_DIV1; USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; USART_InitStruct.StopBits = LL_USART_STOPBITS_1; diff --git a/network/serial_network/HAL/STM32G474/serial_network_hal.c b/network/serial_network/HAL/STM32G474/serial_network_hal.c index 74d4863da..2415e8111 100644 --- a/network/serial_network/HAL/STM32G474/serial_network_hal.c +++ b/network/serial_network/HAL/STM32G474/serial_network_hal.c @@ -16,12 +16,7 @@ #include "stm32g4xx_ll_system.h" #include "stm32g4xx_hal.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -#ifndef SERIAL_COM_DEFAULTBAUDRATE - #define SERIAL_COM_DEFAULTBAUDRATE 1000000 -#endif + /******************************************************************************* * Variables @@ -76,7 +71,7 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) LL_LPUART_InitTypeDef LPUART_InitStruct; // Initialise USART3 LL_LPUART_Disable(SERIAL_COM); - LPUART_InitStruct.BaudRate = SERIAL_COM_DEFAULTBAUDRATE; + LPUART_InitStruct.BaudRate = SERIAL_NETWORK_BAUDRATE; LPUART_InitStruct.PrescalerValue = LL_LPUART_PRESCALER_DIV1; LPUART_InitStruct.DataWidth = LL_LPUART_DATAWIDTH_8B; LPUART_InitStruct.StopBits = LL_LPUART_STOPBITS_1; diff --git a/network/serial_network/HAL/STM32L4/serial_network_hal.c b/network/serial_network/HAL/STM32L4/serial_network_hal.c index b496ca016..f03f0c990 100644 --- a/network/serial_network/HAL/STM32L4/serial_network_hal.c +++ b/network/serial_network/HAL/STM32L4/serial_network_hal.c @@ -15,12 +15,7 @@ #include "stm32l4xx_ll_system.h" #include "stm32l4xx_hal.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -#ifndef SERIAL_COM_DEFAULTBAUDRATE - #define SERIAL_COM_DEFAULTBAUDRATE 1000000 -#endif + /******************************************************************************* * Variables @@ -74,7 +69,7 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) LL_USART_InitTypeDef USART_InitStruct; // Initialise USART3 LL_USART_Disable(SERIAL_COM); - USART_InitStruct.BaudRate = SERIAL_COM_DEFAULTBAUDRATE; + USART_InitStruct.BaudRate = SERIAL_NETWORK_BAUDRATE; USART_InitStruct.DataWidth = LL_USART_DATAWIDTH_8B; USART_InitStruct.StopBits = LL_USART_STOPBITS_1; USART_InitStruct.Parity = LL_USART_PARITY_NONE; diff --git a/network/serial_network/HAL/template/serial_network_hal.c b/network/serial_network/HAL/template/serial_network_hal.c index 7997b0214..52ec051e7 100644 --- a/network/serial_network/HAL/template/serial_network_hal.c +++ b/network/serial_network/HAL/template/serial_network_hal.c @@ -9,12 +9,7 @@ #include "_serial_network.h" // TODO: Include the needed files -/******************************************************************************* - * Definitions - ******************************************************************************/ -#ifndef SERIAL_COM_DEFAULTBAUDRATE - #define SERIAL_COM_DEFAULTBAUDRATE 1000000 -#endif + /******************************************************************************* * Variables @@ -35,7 +30,7 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) { rx_buffer_size = buffer_size; // Init the serial peripheral - // TODO: Init the used usart peripheral using the SERIAL_COM_DEFAULTBAUDRATE baudrate. + // TODO: Init the used usart peripheral using the SERIAL_NETWORK_BAUDRATE baudrate. // TODO: Init TX pin with the given pin and port and set it as tx for the usart. Select the appropriate alternate function. // TODO: Init the Serial TX DMA interface, use it in normal mode and make it raise an IRQ when finished. diff --git a/network/serial_network/inc/_serial_network.h b/network/serial_network/inc/_serial_network.h index e2dde95d7..118b9fbe6 100644 --- a/network/serial_network/inc/_serial_network.h +++ b/network/serial_network/inc/_serial_network.h @@ -9,6 +9,7 @@ #define __SERIAL_H_ #include +#include "serial_config.h" void Serial_TransmissionEnd(void); void Serial_ReceptionAdd(uint8_t *data, uint32_t size); diff --git a/network/serial_network/inc/serial_network.h b/network/serial_network/inc/serial_network.h index c323fd9a1..f916f0c4d 100644 --- a/network/serial_network/inc/serial_network.h +++ b/network/serial_network/inc/serial_network.h @@ -13,12 +13,9 @@ extern "C" #endif #include "luos_phy.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ -#ifndef SERIAL_TX_BUFFER_SIZE - #define SERIAL_RX_BUFFER_SIZE 512 -#endif + /******************************************************************************* + * Definitions + ******************************************************************************/ /******************************************************************************* * Function diff --git a/network/serial_network/serial_config.h b/network/serial_network/serial_config.h new file mode 100644 index 000000000..90a1ace81 --- /dev/null +++ b/network/serial_network/serial_config.h @@ -0,0 +1,22 @@ +/****************************************************************************** + * @file serial_config config + * @brief config of the Luos Serial protocol + * @author Luos + * @version 0.0.0 + ******************************************************************************/ +#ifndef _SERIAL_CONFIG_H_ +#define _SERIAL_CONFIG_H_ + +/******************************************************************************* + * Definitions + ******************************************************************************/ + +#ifndef SERIAL_NETWORK_BAUDRATE + #define SERIAL_NETWORK_BAUDRATE 1000000 +#endif + +#ifndef SERIAL_RX_BUFFER_SIZE + #define SERIAL_RX_BUFFER_SIZE 512 +#endif + +#endif /* _ROBUS_CONFIG_H_ */ diff --git a/network/serial_network/serial_select_hal_script.py b/network/serial_network/serial_select_hal_script.py index efd6ea182..205f44fe8 100644 --- a/network/serial_network/serial_select_hal_script.py +++ b/network/serial_network/serial_select_hal_script.py @@ -28,6 +28,7 @@ env.Append(CPPPATH=[realpath("HAL/" + item[1])]) env.Append(CPPPATH=[realpath("inc/")]) + env.Append(CPPPATH=[realpath(".")]) env.Append( SRC_FILTER=["+<*.c>, +<../HAL/%s/*.c>, ++<../HAL/%s/*.cpp>" % (item[1], item[1])]) @@ -52,5 +53,6 @@ env.Append(CPPPATH=[realpath("HAL/" + item[1])]) env.Append(CPPPATH=[realpath("inc/")]) + env.Append(CPPPATH=[realpath(".")]) env.Append( SRC_FILTER=["+<*.c>, +<../HAL/%s/*.c>, ++<../HAL/%s/*.cpp>" % (item[1], item[1])]) From 8d2b30e5bda714f6659266828a7f6f21b2b09909 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 4 Aug 2023 17:13:11 +0200 Subject: [PATCH 119/150] Improve native timestamping precision --- engine/HAL/NATIVE/luos_hal.c | 3 ++- engine/core/inc/luos_engine.h | 2 +- engine/core/src/timestamp.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/engine/HAL/NATIVE/luos_hal.c b/engine/HAL/NATIVE/luos_hal.c index d4e4f3815..3771e3873 100644 --- a/engine/HAL/NATIVE/luos_hal.c +++ b/engine/HAL/NATIVE/luos_hal.c @@ -101,7 +101,8 @@ uint64_t LuosHAL_GetTimestamp(void) #else clock_gettime(CLOCK_MONOTONIC, &time); #endif - return time.tv_nsec; + volatile uint64_t timestamp = time.tv_nsec + time.tv_sec * 1000000000; + return timestamp; } /****************************************************************************** diff --git a/engine/core/inc/luos_engine.h b/engine/core/inc/luos_engine.h index 771af4739..e9460055c 100644 --- a/engine/core/inc/luos_engine.h +++ b/engine/core/inc/luos_engine.h @@ -62,7 +62,7 @@ extern "C" // *** Timestamping management (in file `timestamp.c`)*** time_luos_t Luos_Timestamp(void); bool Luos_IsMsgTimstamped(const msg_t *msg); - time_luos_t Luos_GetMsgTimestamp(msg_t *msg); + time_luos_t Luos_GetMsgTimestamp(const msg_t *msg); error_return_t Luos_SendTimestampMsg(service_t *service, msg_t *msg, time_luos_t timestamp); // *** Pub/Sub management (in file `pub_sub.c`)*** diff --git a/engine/core/src/timestamp.c b/engine/core/src/timestamp.c index 6407a3d3b..9edd0ca84 100644 --- a/engine/core/src/timestamp.c +++ b/engine/core/src/timestamp.c @@ -79,7 +79,7 @@ _CRITICAL inline bool Luos_IsMsgTimstamped(const msg_t *msg) * @param msg : Message to get the timestamp from * @return time_luos_t ******************************************************************************/ -time_luos_t Luos_GetMsgTimestamp(msg_t *msg) +time_luos_t Luos_GetMsgTimestamp(const msg_t *msg) { LUOS_ASSERT(msg != NULL); time_luos_t timestamp = {0.0f}; From c641f20ca211919a711fec74dfbedc1bbc3dbab9 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 11 Aug 2023 11:55:25 +0200 Subject: [PATCH 120/150] Enable multi-phy capabilities --- engine/IO/inc/_luos_phy.h | 7 + engine/IO/inc/filter.h | 5 - engine/IO/inc/struct_phy.h | 11 +- engine/IO/src/filter.c | 157 -------- engine/IO/src/luos_io.c | 56 ++- engine/IO/src/luos_phy.c | 336 ++++++++++++++++-- engine/IO/src/msg_alloc.c | 6 + engine/core/inc/struct_luos.h | 3 + engine/core/src/luos_engine.c | 6 +- engine/core/src/luos_utils.c | 5 +- engine/core/src/routing_table.c | 297 +++++++++++++++- engine/core/src/service.c | 4 +- engine/engine_config.h | 6 + .../Arduino/bldc_simple_foc/node_config.h | 2 +- .../projects/Arduino/button/node_config.h | 2 +- .../Arduino/fingerprint/node_config.h | 2 +- examples/projects/Arduino/lcd/node_config.h | 2 +- examples/projects/Arduino/led/node_config.h | 2 +- .../Arduino/servo_motor/node_config.h | 2 +- .../Arduino/stepper_simple_foc/node_config.h | 2 +- .../NUCLEO-F072RB/button/node_config.h | 2 +- .../NUCLEO-F072RB/dc_motor/node_config.h | 2 +- .../NUCLEO-F072RB/potentiometer/node_config.h | 2 +- .../NUCLEO-F401RE/button/node_config.h | 2 +- .../NUCLEO-F401RE/dc_motor/node_config.h | 2 +- .../projects/NUCLEO-F401RE/led/node_config.h | 2 +- .../NUCLEO-F401RE/potentiometer/node_config.h | 2 +- .../NUCLEO-F410RB/button/node_config.h | 2 +- .../NUCLEO-F410RB/dc_motor/node_config.h | 2 +- .../projects/NUCLEO-F410RB/led/node_config.h | 2 +- .../NUCLEO-F410RB/potentiometer/node_config.h | 2 +- .../NUCLEO-G431KB/button/node_config.h | 2 +- .../NUCLEO-G431KB/dc_motor/node_config.h | 2 +- .../NUCLEO-G431KB/potentiometer/node_config.h | 2 +- .../NUCLEO-L073RZ/button/node_config.h | 2 +- .../NUCLEO-L432KC/button/node_config.h | 2 +- .../NUCLEO-L432KC/dc_motor/node_config.h | 2 +- .../NUCLEO-L432KC/fingerprint/node_config.h | 2 +- .../projects/NUCLEO-L432KC/lcd/node_config.h | 2 +- .../projects/NUCLEO-L432KC/led/node_config.h | 2 +- .../NUCLEO-L432KC/potentiometer/node_config.h | 2 +- .../NUCLEO-L432KC/servo/node_config.h | 2 +- .../SAMD21XPLAINED/button/node_config.h | 2 +- .../STM32F4-discovery/button/node_config.h | 2 +- .../bootloader/node_config.h | 2 +- .../STM32L4S5_discovery/button/node_config.h | 2 +- examples/projects/l0/button/node_config.h | 2 +- examples/projects/l0/button/platformio.ini | 1 + examples/projects/l0/button/src/main.c | 3 + .../projects/l0/button_freertos/node_config.h | 2 +- examples/projects/l0/dc_motor/node_config.h | 2 +- examples/projects/l0/distance/node_config.h | 2 +- .../projects/l0/fingerprint/node_config.h | 2 +- examples/projects/l0/lcd/node_config.h | 2 +- examples/projects/l0/led/node_config.h | 2 +- examples/projects/l0/led_fader/node_config.h | 2 +- .../projects/l0/light_sensor/node_config.h | 2 +- examples/projects/l0/load/node_config.h | 2 +- .../projects/l0/potentiometer/node_config.h | 2 +- .../projects/l0/power_switch/node_config.h | 2 +- examples/projects/l0/stepper/node_config.h | 2 +- examples/projects/native/button/node_config.h | 2 +- examples/projects/native/led/node_config.h | 2 +- .../projects/native/ping_pong/node_config.h | 2 +- test/tests_io/test_filter/main.c | 134 +++---- test/tests_io/test_phy/main.c | 12 +- 66 files changed, 815 insertions(+), 332 deletions(-) diff --git a/engine/IO/inc/_luos_phy.h b/engine/IO/inc/_luos_phy.h index 9e80860c0..71566a0dd 100644 --- a/engine/IO/inc/_luos_phy.h +++ b/engine/IO/inc/_luos_phy.h @@ -19,7 +19,14 @@ void Phy_ResetAll(void); bool Phy_Busy(void); void Phy_Loop(void); luos_phy_t *Phy_Get(uint8_t id, JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY reset_phy); +luos_phy_t *Phy_GetPhyFromId(uint8_t phy_id); error_return_t Phy_FindNextNode(void); // Use it to find the next node as a master. phy_job_t *Phy_GetNextJob(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to get the next job to send. +// Filtering initialization +void Phy_FiltersInit(void); +void Phy_AddLocalServices(uint16_t service_id, uint16_t service_number); +bool Phy_FilterType(uint16_t type_id); +void Phy_IndexSet(uint8_t *index, uint16_t id); +void Phy_ResetAllNeeded(void); #endif /* _PRIVATE_LUOS_PHY_H_ */ diff --git a/engine/IO/inc/filter.h b/engine/IO/inc/filter.h index 016faa4e4..7e4cba6f2 100644 --- a/engine/IO/inc/filter.h +++ b/engine/IO/inc/filter.h @@ -24,14 +24,9 @@ ******************************************************************************/ // generic functions -void Filter_IdInit(void); void Filter_TopicInit(void); -void Filter_AddServiceId(uint16_t service_id, uint16_t service_number); void Filter_AddTopic(uint16_t topic_id); void Filter_RmTopic(uint16_t topic_id); -bool Filter_ServiceID(uint16_t service_id); bool Filter_Topic(uint16_t topic_id); -bool Filter_Type(uint16_t type_id); -uint8_t Filter_GetPhyTarget(header_t *header); #endif /* _FILTER_H_ */ diff --git a/engine/IO/inc/struct_phy.h b/engine/IO/inc/struct_phy.h index f390b85aa..a11226a72 100644 --- a/engine/IO/inc/struct_phy.h +++ b/engine/IO/inc/struct_phy.h @@ -63,8 +63,11 @@ typedef struct luos_phy_t volatile uint8_t rx_ack : 1; // True if we need to generate an acknoledgement for this message. }; - // RX Private data - phy_target_t rx_phy_filter; // The phy concerned by this message. + // *** RX Private data *** + // Filters + phy_target_t rx_phy_filter; // The phy concerned by this message. Each bit represent a phy. + uint8_t services[MAX_SERVICE_NUMBER / 8 + 1]; // Store the indexation data of the phy. This is allowing to filter message based on service index. + uint8_t nodes[MAX_NODE_NUMBER / 8 + 1]; // Store the indexation data of the phy. This is allowing to filter message based on node index. // *************** TX informations *************** // Jobs are used to send messages. during the message send phy may save a job pointer so we cann't move any job in the job list. @@ -74,10 +77,12 @@ typedef struct luos_phy_t uint16_t oldest_job_index; // Index of the oldest job. uint16_t available_job_index; // Index of the next available job. + // *************** Phy filters *************** + + // *************** Phy callbacks *************** void (*job_cb)(struct luos_phy_t *phy_ptr, phy_job_t *job); // Callback error_return_t (*run_topo)(struct luos_phy_t *phy_ptr, uint8_t *portId); // try to find another node on branches, return success if a node is found and the id of the port were we detect this node. void (*reset_phy)(struct luos_phy_t *phy_ptr); // Reset the phy transmission reception and topology. - } luos_phy_t; typedef struct __attribute__((__packed__)) diff --git a/engine/IO/src/filter.c b/engine/IO/src/filter.c index db34aaf6a..36c55e9b2 100644 --- a/engine/IO/src/filter.c +++ b/engine/IO/src/filter.c @@ -7,7 +7,6 @@ #include "filter.h" #include "luos_utils.h" #include "luos_hal.h" -#include "service.h" #include "node.h" /******************************************************************************* @@ -15,8 +14,6 @@ ******************************************************************************/ typedef struct { - uint8_t IDMask[ID_MASK_SIZE]; - uint16_t IDShiftMask; uint8_t TopicMask[TOPIC_MASK_SIZE]; /*!< multicast target bank. */ } filter_ctx_t; @@ -29,21 +26,6 @@ filter_ctx_t filter_ctx; * Functions ******************************************************************************/ -/****************************************************************************** - * @brief Reset Masks - * @param None - * @return None - ******************************************************************************/ -void Filter_IdInit(void) -{ - // Id mask init - filter_ctx.IDShiftMask = 0; - for (uint16_t i = 0; i < ID_MASK_SIZE; i++) - { - filter_ctx.IDMask[i] = 0; - } -} - void Filter_TopicInit(void) { // Multicast mask init @@ -53,34 +35,6 @@ void Filter_TopicInit(void) } } -/****************************************************************************** - * @brief ID Mask calculation - * @param service_id ID of the first service - * @param service_number Number of the services on the node - * @return None - ******************************************************************************/ -void Filter_AddServiceId(uint16_t service_id, uint16_t service_number) -{ - // 4096 bit address 512 byte possible - // Create a mask of only possibility in the node - //--------------------------->|__________| - // Shift byte byte Mask of bit address - - LUOS_ASSERT((service_id > 0) - && (service_id <= 4096 - MAX_LOCAL_SERVICE_NUMBER) - && (service_number <= MAX_LOCAL_SERVICE_NUMBER)); - Filter_IdInit(); - uint16_t tempo = 0; - filter_ctx.IDShiftMask = (service_id - 1) / 8; // aligned to byte - - // Create a mask of bit corresponding to ID number in the node - for (uint16_t i = 0; i < service_number; i++) - { - tempo = (((service_id - 1) + i) - (8 * filter_ctx.IDShiftMask)); - filter_ctx.IDMask[tempo / 8] |= 1 << ((tempo) % 8); - } -} - /****************************************************************************** * @brief Add a Topic on the Mask * @param topic_id @@ -105,35 +59,6 @@ void Filter_RmTopic(uint16_t topic_id) filter_ctx.TopicMask[(topic_id / 8)] &= ~(1 << (topic_id - ((int)(topic_id / 8)) * 8)); } -/****************************************************************************** - * @brief Parse msg to find a service concerne - * @param header of message - * @return None - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL bool Filter_ServiceID(uint16_t service_id) -{ - //--------------------------->|__________| - // Shift byte byte Mask of bit address - // In an node, service ID are consecutive - // MaskID is byte field wich have the size of MAX_LOCAL_SERVICE_NUMBER - // Shift depend od ID of first service in Node (shift = NodeID/8) - LUOS_ASSERT(service_id <= 4096); - uint16_t compare = 0; - - if ((service_id > (8 * filter_ctx.IDShiftMask))) // IDMask aligned byte - { - // Calcul ID mask for ID received - compare = ((service_id - 1) - ((8 * filter_ctx.IDShiftMask))); - // Check if compare and internal mask match - if ((filter_ctx.IDMask[compare / 8] & (1 << (compare % 8))) != 0) - { - return true; - } - } - return false; -} - /****************************************************************************** * @brief Parse multicast mask to find if target exists * @param topic_id of message @@ -155,85 +80,3 @@ _CRITICAL bool Filter_Topic(uint16_t topic_id) } return false; } - -/****************************************************************************** - * @brief Parse all services type to find if target exists - * @param type_id of message - * @return bool true if there is one false if not - * We can't do this the same way other are done because identifiers don't have any continuity - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL bool Filter_Type(uint16_t type_id) -{ - LUOS_ASSERT(type_id <= 4096); - // Check all service type - for (int i = 0; i < Service_GetNumber(); i++) - { - if (type_id == Service_GetTable()[i].type) - { - return true; - } - } - return false; -} - -/****************************************************************************** - * @brief Parse msg to find a service concerne - * @param header of message - * @return None - * _CRITICAL function call in IRQ - ******************************************************************************/ -_CRITICAL uint8_t Filter_GetPhyTarget(header_t *header) -{ - // Find if we are concerned by this message. - // check if we need to filter all the messages - - switch (header->target_mode) - { - case SERVICEIDACK: - case SERVICEID: - // Check all service id - if (Filter_ServiceID(header->target)) - { - // This concerns Luos phy only - return 0x01; - } - break; - case TYPE: - - if (Filter_Type(header->target)) - { - // This concerns Luos phy and external phy - return 0x01 | (0x01 << 1); - } - break; - case BROADCAST: - // This concerns Luos phy and external phy - return 0x01 | (0x01 << 1); - break; - case NODEIDACK: - case NODEID: - // If the target is our node and our node have a node_id or if we don't have a node_id and we are waiting for one. - if (((header->target == Node_Get()->node_id) && (header->target != 0)) - || ((header->target == 0) && (Node_WaitId() == true))) - { - // This concerns Luos phy only - return 0x01; - } - break; - case TOPIC: - if (Filter_Topic(header->target)) - { - // This concerns Luos phy and external phy - return 0x01 | (0x01 << 1); - } - break; - default: - // We can be here in case of corrupted message. - // In this case nobody is concerned by this message. - return 0x00; - break; - } - // This concerns external phy only by default - return 0x01 << 1; -} diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index f407b74b5..39860b09b 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -69,7 +69,7 @@ void LuosIO_Reset(luos_phy_t *phy_ptr) void LuosIO_Init(void) { // Init filter - Filter_IdInit(); + Phy_FiltersInit(); Filter_TopicInit(); Stats_Init(); memory_stats_t *memory_stats = Stats_GetMemory(); @@ -233,7 +233,10 @@ int LuosIO_TopologyDetection(service_t *service, connection_t *connection_table) } // Setup local node Node_Get()->node_id = 1; - last_node = 1; + // Add this node id in the Luos phy filter allowing us to receive node messages + memset(luos_phy->nodes, 0, sizeof(luos_phy->nodes)); + Phy_IndexSet(luos_phy->nodes, 1); + last_node = 1; // Setup sending service id service->id = 1; // Consider this node as ready @@ -344,6 +347,7 @@ static int LuosIO_StartTopologyDetection(service_t *service) // Reinit our node id Node_Get()->node_id = 0; + memset(luos_phy->nodes, 0, sizeof(luos_phy->nodes)); Node_SetState(LOCAL_DETECTION); detect_state_machine = 0; return 1; @@ -368,6 +372,7 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) dead_target_t *dead_target = (dead_target_t *)input->data; uint16_t base_id = 0; routing_table_t *route_tab = &RoutingTB_Get()[RoutingTB_GetLastEntry()]; + static luos_phy_t *phy_ptr = NULL; switch (input->header.cmd) { @@ -383,7 +388,7 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) // Now send the new generated node_id output_msg.header.cmd = NODE_ID; output_msg.header.size = sizeof(uint16_t); - output_msg.header.target = 0; // We target the node_id 0 becanse the node receiving this message don't have a node_id yet. This node need to be the only one to receive it. + output_msg.header.target = 0; // We target the node_id 0 because the node receiving this message don't have a node_id yet. This node need to be the only one to receive it. output_msg.header.target_mode = NODEIDACK; memcpy(output_msg.data, (void *)&last_node, sizeof(uint16_t)); Luos_SendMsg(service, &output_msg); @@ -422,6 +427,7 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) // We didn't received the start detection message // Reinit our node id Node_Get()->node_id = 0; + memset(luos_phy->nodes, 0, sizeof(luos_phy->nodes)); // A phy have already been detected, so we can't reset everything // Just reset LuosIO and Phy jobs. LuosIO_Reset(luos_phy); @@ -433,6 +439,9 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) uint16_t node_id; memcpy(&node_id, input->data, sizeof(uint16_t)); Node_Get()->node_id = node_id; + // Add this node id in the Luos phy filter allowing us to receive node messages + memset(luos_phy->nodes, 0, sizeof(luos_phy->nodes)); + Phy_IndexSet(luos_phy->nodes, node_id); // Now we need to send back the input part of the connection data. port_t *input_port = Phy_GetTopologysource(); input_port->node_id = Node_Get()->node_id; @@ -464,7 +473,7 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) case 0: // send back a local routing table output_msg.header.cmd = RTB; - output_msg.header.target_mode = SERVICEIDACK; + output_msg.header.target_mode = NODEIDACK; output_msg.header.target = input->header.source; LuosIO_TransmitLocalRoutingTable(0, &output_msg); break; @@ -488,9 +497,46 @@ error_return_t LuosIO_ConsumeMsg(const msg_t *input) return SUCCEED; break; + case PHY_ID: + // We receive a phy id. We have to save it, because we will need it to save the indexes in the good phy. + base_id = 0; + memcpy(&base_id, input->data, sizeof(uint8_t)); + phy_ptr = Phy_GetPhyFromId((uint8_t)base_id); + // This message have been consumed + return SUCCEED; + break; + + case NODE_INDEXES: + // We are receiving a node index table + LUOS_ASSERT(phy_ptr != NULL); + base_id = Luos_ReceiveData(service, input, (void *)phy_ptr->nodes); + if (base_id > 0) + { + LUOS_ASSERT(base_id <= sizeof(phy_ptr->nodes)); // The MAX_NODE_NUMBER of the detecting node is bigger than the one we have + // We finished to receive the phy indexes + phy_ptr = NULL; + } + // This message have been consumed + return SUCCEED; + break; + + case SERVICE_INDEXES: + // We are receiving a service index table + LUOS_ASSERT(phy_ptr != NULL); + base_id = Luos_ReceiveData(service, input, (void *)phy_ptr->services); + if (base_id > 0) + { + LUOS_ASSERT(base_id <= sizeof(phy_ptr->services)); // The MAX_SERVICE_NUMBER of the detecting node is bigger than the one we have + // We finished to receive the phy indexes + phy_ptr = NULL; + } + // This message have been consumed + return SUCCEED; + break; + case START_DETECTION: // Reset All phy - Phy_ResetAll(); + Phy_ResetAllNeeded(); // This message have been consumed return SUCCEED; break; diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index e90f71e66..86d76afef 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -47,17 +47,16 @@ #include #include "luos_phy.h" #include "_luos_phy.h" -#include "filter.h" #include "msg_alloc.h" #include "luos_hal.h" #include "_timestamp.h" #include "luos_io.h" -// #include "service.h" +#include "service.h" +#include "filter.h" /******************************************************************************* * Definitions ******************************************************************************/ -#define PHY_NB 2 typedef struct __attribute__((__packed__)) { @@ -75,10 +74,11 @@ typedef struct IRQ_STATE phy_irq_states[PHY_NB]; // Store the irq state functions of phys aving one. // ******************** Topology management ******************** - port_t topology_source; // The source port. Where we receive the topological detection signal from. - uint32_t topology_done; // We put bits to 1 when a phy ended the topology detection. - bool topology_running; // We put bits to 1 when a phy is running the topology detection. - bool find_next_node_job; + port_t topology_source; // The source port. Where we receive the topological detection signal from. + uint32_t topology_done; // We put this bits to 1 when a phy ended the topology detection. + bool topology_running; // We put this bits to 1 when a phy is running the topology detection. + bool find_next_node_job; // We put this bits to 1 to indicate that we will need to find another node. + bool resetAllNeed; // We put this bits to 1 to indicate that we will need to reset all the nodes. We need it to avoid to reset all phy at reset message reception, allowing the phy's to send their reset message. // ******************** Job management ******************** // io_jobs are stores from the newest to the oldest. @@ -95,6 +95,10 @@ static void Phy_ManageFailedJob(void); static phy_job_t *Phy_AddJob(luos_phy_t *phy_ptr, phy_job_t *phy_job); static int Phy_GetJobId(luos_phy_t *phy_ptr, phy_job_t *job); static int Phy_GetPhyId(luos_phy_t *phy_ptr); +// Filtering functions +static bool Phy_IndexFilter(uint8_t *index, uint16_t id); +static bool Phy_Need(luos_phy_t *phy_ptr, header_t *header); +static phy_target_t Phy_ComputeTargets(luos_phy_t *phy_ptr, header_t *header); /******************************************************************************* * Variables @@ -113,7 +117,8 @@ luos_phy_ctx_t phy_ctx; void Phy_Init(void) { Phy_Reset(); - phy_ctx.phy_nb = 1; + phy_ctx.phy_nb = 1; // Only Luos_engine can have the first place in the phy table. To be sure to have it we consider that we have it already, when it will be initialized it will take the first place. If other phy start before they will get the second slots. + // Reset all IRQ pointers memset(phy_ctx.phy_irq_states, 0, sizeof(phy_ctx.phy_irq_states)); } @@ -129,12 +134,17 @@ void Phy_Reset(void) phy_ctx.io_job_nb = 0; memset((void *)phy_ctx.failed_job, 0, sizeof(phy_ctx.failed_job)); phy_ctx.failed_job_nb = 0; - for (uint8_t i = 0; i < phy_ctx.phy_nb; i++) + phy_ctx.resetAllNeed = false; + for (uint8_t i = 0; i < PHY_NB; i++) { + Luos_SetIrqState(false); memset((void *)&phy_ctx.phy[i].job, 0, sizeof(phy_ctx.phy[0].job)); - phy_ctx.phy[i].job_nb = 0; + phy_ctx.phy[i].job_nb = 0; + Luos_SetIrqState(true); phy_ctx.phy[i].oldest_job_index = 0; phy_ctx.phy[i].available_job_index = 0; + memset((void *)&phy_ctx.phy[i].services, 0, sizeof(phy_ctx.phy[0].services)); + memset((void *)&phy_ctx.phy[i].nodes, 0, sizeof(phy_ctx.phy[0].nodes)); } memset((void *)&phy_ctx.topology_source, 0xFFFF, sizeof(phy_ctx.topology_source)); phy_ctx.topology_done = 0; @@ -142,6 +152,11 @@ void Phy_Reset(void) phy_ctx.find_next_node_job = false; } +void Phy_ResetAllNeeded(void) +{ + phy_ctx.resetAllNeed = true; +} + /****************************************************************************** * @brief Reset the phy context and all the phy instances * @param None @@ -174,12 +189,25 @@ bool Phy_Busy(void) ******************************************************************************/ void Phy_Loop(void) { + if (phy_ctx.resetAllNeed == true) + { + if (Phy_TxAllComplete() == SUCCEED) + { + Phy_ResetAll(); + phy_ctx.resetAllNeed = false; + } + else + { + // We don't do anything else, avoiding any other transmission or reception. + return; + } + } // Manage received data allocation - // This is only needed for external phy for now. if (phy_ctx.phy[1].rx_alloc_job) { Phy_alloc(&phy_ctx.phy[1]); } + // Manage failed job Phy_ManageFailedJob(); // Manage complete message received dispatching Phy_Dispatch(); @@ -210,6 +238,7 @@ void Phy_Loop(void) ******************************************************************************/ luos_phy_t *Phy_Create(JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY reset_phy) { + LUOS_ASSERT(phy_ctx.phy_nb < PHY_NB); return Phy_Get(phy_ctx.phy_nb++, job_cb, run_topo, reset_phy); } @@ -265,6 +294,7 @@ _CRITICAL void Phy_TopologyNext(void) { phy_ctx.find_next_node_job = true; } + /****************************************************************************** * @brief Try to find the next node connected a phy port * @return SUCCESS if a node is found, FAILED if not @@ -355,8 +385,18 @@ void Phy_TopologySource(luos_phy_t *phy_ptr, uint8_t port_id) // We don't have the node id yet, we will fill it out when we will receive it from the master. // Put a flag to indicate that we are waiting for a node id. Node_WillGetId(); + + // We also know that this phy is liked to the detecting node. + // To enable any communication with it we have to set the nodes and services filter of this phy allowing us to communicate with it. + Phy_IndexSet(phy_ptr->nodes, 0x01); + Phy_IndexSet(phy_ptr->services, 0x01); } +/****************************************************************************** + * @brief A phy port detection is finished + * @param phy_ptr pointer on the phy that have finished its detection + * @return None + ******************************************************************************/ void Phy_TopologyDone(luos_phy_t *phy_ptr) { LUOS_ASSERT(phy_ptr != NULL); @@ -365,7 +405,7 @@ void Phy_TopologyDone(luos_phy_t *phy_ptr) } /****************************************************************************** - * @brief A phy port have been detected + * @brief return the source port that raise the topology detection * @return pointer on the input port ******************************************************************************/ port_t *Phy_GetTopologysource(void) @@ -390,10 +430,22 @@ luos_phy_t *Phy_Get(uint8_t id, JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY rese phy_ctx.phy[id].job_cb = job_cb; phy_ctx.phy[id].run_topo = run_topo; phy_ctx.phy[id].reset_phy = reset_phy; + phy_ctx.phy[id].job_nb = 0; // Return the phy pointer return &phy_ctx.phy[id]; } +/****************************************************************************** + * @brief return a local physical layer pointer (only used by LuosIO, this function is private) + * @param id of the phy we want + * @return luos_phy_t pointer on the phy + ******************************************************************************/ +luos_phy_t *Phy_GetPhyFromId(uint8_t phy_id) +{ + LUOS_ASSERT(phy_id <= PHY_NB); + return &phy_ctx.phy[phy_id]; +} + /****************************************************************************** * @brief Compute the size of the message * @param phy_ptr Pointer to the phy concerned by this message @@ -417,17 +469,8 @@ _CRITICAL void Phy_ComputeHeader(luos_phy_t *phy_ptr) { phy_ptr->rx_size += sizeof(time_luos_t); } - - // Compute the phy concerned by this message - phy_ptr->rx_phy_filter = Filter_GetPhyTarget((header_t *)phy_ptr->rx_buffer_base); - // Remove the phy asking to compute the header to avoid to retransmit it, except for Luos because Luos can do localhost. - uint32_t index = Phy_GetPhyId(phy_ptr); - if (index != 0) - { - // remove the phy asking to compute the header, except if it is Luos because Luos can do localhost. - phy_ptr->rx_phy_filter &= ~(0x01 << index); - } - if (phy_ptr->rx_phy_filter != 0) + // Compute if we need to keep this message + if (Phy_Need(phy_ptr, (header_t *)phy_ptr->rx_buffer_base)) { // Someone need to receive this message phy_ptr->rx_keep = true; @@ -444,6 +487,157 @@ _CRITICAL void Phy_ComputeHeader(luos_phy_t *phy_ptr) } } +/****************************************************************************** + * @brief Compute if some of our phy is concerned by this message + * @param phy_ptr Pointer to the phy receiving this message + * @param header Pointer to the header of the message + * @return true if we need to keep this message, false if not + ******************************************************************************/ +bool Phy_Need(luos_phy_t *phy_ptr, header_t *header) +{ + // This function just check if we need to keep this message or not + // To avoid to spend precious computing time, instead of checking all the phy we will only check if this concern only the receiving phy. + // We need to keep this message only if the message target is not only for the phy_ptr, except if it is Luos because Luos can do localhost. + + // If this phy is Luos phy, we need to keep all the messages + if (Phy_GetPhyId(phy_ptr) == 0) + { + return true; + } + // Message is not comming from Luos phy, we need to check if the receiving phy is the only one concerned by this message. + switch (header->target_mode) + { + case BROADCAST: + case TOPIC: + case TYPE: + // This concerns Luos phy and all external phy + return true; + break; + case SERVICEIDACK: + case SERVICEID: + // If the target is not the phy_ptr, we need to keep this message + return !Phy_IndexFilter(phy_ptr->services, header->target); + break; + case NODEIDACK: + case NODEID: + // If the target is not the phy_ptr, we need to keep this message + return !Phy_IndexFilter(phy_ptr->nodes, header->target); + break; + default: + // This message is wrong, trash it. + return false; + break; + } +} + +/****************************************************************************** + * @brief Parse msg to find the targetted phy + * @param header of message + * @return None + ******************************************************************************/ +inline phy_target_t Phy_ComputeTargets(luos_phy_t *phy_ptr, header_t *header) +{ + // Find if we are concerned by this message. + // check if we need to filter all the messages + volatile phy_target_t target = 0x00; + + switch (header->target_mode) + { + case SERVICEIDACK: + case SERVICEID: + // Check all phy service id + for (int i = 0; i < phy_ctx.phy_nb; i++) + { + if (Phy_IndexFilter(phy_ctx.phy[i].services, header->target)) + { + target |= (0x01 << i); + break; + } + } + break; + case NODEIDACK: + case NODEID: + // If the target is our node and our node have a node_id or if we don't have a node_id and we are waiting for one. + if (((header->target == Node_Get()->node_id) && (header->target != 0)) + || ((header->target == 0) && (Node_WaitId() == true))) + { + // This concerns Luos phy only + if ((phy_ctx.topology_running == true) && (header->source != 1)) + { + // We are performing a topology and this message is for us. + // We need to store the node that send us this in our index allowing us to communicate with it later. + Phy_IndexSet(phy_ptr->nodes, header->source); + } + target = 0x01; + } + else + { + if (header->target == 0) + { + // This concerns all phy except Luos + for (int i = 1; i < phy_ctx.phy_nb; i++) + { + target |= (0x01 << i); + } + break; + } + else + { + // Find the concerned phy + for (int i = 1; i < phy_ctx.phy_nb; i++) + { + if (Phy_IndexFilter(phy_ctx.phy[i].nodes, header->target)) + { + target |= (0x01 << i); + break; + } + } + } + } + break; + case TYPE: + // Check if Luos_engine is concerned by this type + target = Phy_FilterType(header->target); + // We also add all the external phy + for (int i = 1; i < phy_ctx.phy_nb; i++) + { + target |= (0x01 << i); + } + break; + case BROADCAST: + // This concerns Luos phy and all external phy + for (int i = 0; i < phy_ctx.phy_nb; i++) + { + target |= (0x01 << i); + } + break; + case TOPIC: + if (Filter_Topic(header->target)) + { + // This concerns Luos + target = 0x01; + } + // We also have to add all the external phy + for (int i = 1; i < phy_ctx.phy_nb; i++) + { + target |= (0x01 << i); + } + break; + default: + // We can be here in case of corrupted message. + // In this case nobody is concerned by this message. + return 0x00; + break; + } + // Remove the phy asking to compute the header to avoid to retransmit it in the line, except for Luos because Luos can do localhost. + uint32_t index = Phy_GetPhyId(phy_ptr); + if (index != 0) + { + target &= ~(0x01 << index); + } + return target; +} + /****************************************************************************** * @brief Consider the message as valid * @param phy_ptr Pointer to the phy concerned by the allocation @@ -553,6 +747,15 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) // Now we can check if we need to store the received data if (phy_ptr->rx_keep) { + // Compute the rx_phy_filter + phy_ptr->rx_phy_filter = Phy_ComputeTargets(phy_ptr, (header_t *)phy_ptr->rx_buffer_base); + if (phy_ptr->rx_phy_filter == 0) + { + // We probably have been reseted in the meantime. Just drop the message. + phy_ptr->rx_alloc_job = false; + return; + } + // We need to store the received data. // Update the informations allowing reception to continue and directly copy the data into the allocated buffer Phy_SetIrqState(false); @@ -897,3 +1100,90 @@ error_return_t Phy_TxAllComplete(void) } return SUCCEED; } + +/******************************************************************************* + * Filtering functions + ******************************************************************************/ + +/****************************************************************************** + * @brief Reset Masks + * @param None + * @return None + ******************************************************************************/ +void Phy_FiltersInit(void) +{ + for (int i = 0; i < PHY_NB; i++) + { + // Service ID init + memset(phy_ctx.phy[i].services, 0, sizeof(phy_ctx.phy[i].services)); + // Node ID init + memset(phy_ctx.phy[i].nodes, 0, sizeof(phy_ctx.phy[i].nodes)); + } +} + +/****************************************************************************** + * @brief luos phy service ID index calculation + * @param service_id ID of the first service + * @param service_number Number of the services on the node + * @return None + ******************************************************************************/ +void Phy_AddLocalServices(uint16_t service_id, uint16_t service_number) +{ + LUOS_ASSERT((service_id > 0) + && (service_id <= 4096 - MAX_LOCAL_SERVICE_NUMBER) + && (service_number <= MAX_LOCAL_SERVICE_NUMBER)); + + // Reset Luos services filter + memset(phy_ctx.phy[0].services, 0, sizeof(phy_ctx.phy[0].services)); + // Create the bit field corresponding to ID number in the phy.services + for (uint16_t i = 0; i < service_number; i++) + { + Phy_IndexSet(phy_ctx.phy[0].services, service_id + i); + } +} + +/****************************************************************************** + * @brief check if the given id value concern this phy index + * @param index Pointer to the index of the node + * @param id id of the service concerned by this message + * @return phy concerned by this message + ******************************************************************************/ +inline bool Phy_IndexFilter(uint8_t *index, uint16_t id) +{ + LUOS_ASSERT((index != NULL) && (id <= 0x0FFF)); + uint8_t bit_index = id - 1; // Because 1 represent bit index 0. + return (index[bit_index / 8] & (1 << (bit_index % 8))); +} + +/****************************************************************************** + * @brief Set a given id value in the index + * @param index Pointer to the index of the node + * @param id id of the service concerned by this message + * @return phy concerned by this message + ******************************************************************************/ +inline void Phy_IndexSet(uint8_t *index, uint16_t id) +{ + LUOS_ASSERT((index != NULL) && (id <= 0x0FFF)); + uint8_t bit_index = id - 1; // Because 1 represent bit index 0. + index[bit_index / 8] |= 1 << (bit_index % 8); +} + +/****************************************************************************** + * @brief Parse all services type to find if target exists + * @param type_id of message + * @return bool true if there is one false if not + * We can't do this the same way others are done because identifiers don't have any continuity + ******************************************************************************/ +inline bool Phy_FilterType(uint16_t type_id) +{ + LUOS_ASSERT(type_id <= 4096); + // Check all service type + for (int i = 0; i < Service_GetNumber(); i++) + { + if (type_id == Service_GetTable()[i].type) + { + return true; + } + } + return false; +} diff --git a/engine/IO/src/msg_alloc.c b/engine/IO/src/msg_alloc.c index 60e1cbf33..72c0661d0 100644 --- a/engine/IO/src/msg_alloc.c +++ b/engine/IO/src/msg_alloc.c @@ -281,6 +281,12 @@ _CRITICAL uint8_t *MsgAlloc_Alloc(uint16_t data_size, uint8_t phy_filter) return returned_ptr; } +/****************************************************************************** + * @brief Reference a message + * @param uint8_t *rx_data + * @param phy_target_t phy_filter + * _CRITICAL function call in IRQ + ******************************************************************************/ _CRITICAL void MsgAlloc_Reference(uint8_t *rx_data, uint8_t phy_filter) { LUOS_ASSERT((rx_data < &msg_buffer[MSG_BUFFER_SIZE]) && (rx_data >= &msg_buffer[0]) && (phy_filter != 0)); diff --git a/engine/core/inc/struct_luos.h b/engine/core/inc/struct_luos.h index 4fd734858..ddb5ea08c 100644 --- a/engine/core/inc/struct_luos.h +++ b/engine/core/inc/struct_luos.h @@ -36,6 +36,9 @@ typedef enum END_DETECTION, // Detect the end of a detection LOCAL_RTB, // Ask(size == 0), generate(size == 2) a local routing_table. RTB, // Receive a routing_table. + PHY_ID, // indicate a phy id. This is used to indicate for witch phy the indexes are. + NODE_INDEXES, // Send the node indexes of a specific phy allowing us to compute the message switching (the route of the messages). + SERVICE_INDEXES, // Send the service indexes of a specific phy allowing us to compute the message switching (the route of the messages). WRITE_ALIAS, // Get and save a new given alias. UPDATE_PUB, // Ask to update a sensor value each time duration to the sender ASK_DETECTION, // Ask Luos to launch a detection diff --git a/engine/core/src/luos_engine.c b/engine/core/src/luos_engine.c index c61658836..b38473d13 100644 --- a/engine/core/src/luos_engine.c +++ b/engine/core/src/luos_engine.c @@ -12,7 +12,7 @@ #include "service.h" #include "struct_engine.h" #include "luos_io.h" -#include "luos_phy.h" +#include "_luos_phy.h" #include "stats.h" /******************************************************************************* @@ -524,12 +524,10 @@ void Luos_Detect(service_t *service) if (service->id == 0) { // We don't have any ID yet, let's create one at least for the detector - // Reset filters - Filter_IdInit(); // Set the detection launcher id to 1 service->id = 1; // Update the filter just to accept our detector id - Filter_AddServiceId(1, 1); + Phy_AddLocalServices(1, 1); } // Send ask detection message diff --git a/engine/core/src/luos_utils.c b/engine/core/src/luos_utils.c index 31ffd4281..02616780c 100644 --- a/engine/core/src/luos_utils.c +++ b/engine/core/src/luos_utils.c @@ -10,8 +10,7 @@ #include "string.h" #include "luos_hal.h" #include "msg_alloc.h" -#include "filter.h" -#include "luos_phy.h" +#include "_luos_phy.h" /******************************************************************************* * Function @@ -60,7 +59,7 @@ _CRITICAL void Luos_assert(char *file, uint32_t line) Luos_Init(); // completely reinit the allocator MsgAlloc_Init(NULL); - Filter_IdInit(); // Mask filter for service ID + Phy_FiltersInit(); // Mask filter for service ID msg_t msg; msg.header.target_mode = BROADCAST; msg.header.target = BROADCAST_VAL; diff --git a/engine/core/src/routing_table.c b/engine/core/src/routing_table.c index be3e42636..98ed59d22 100644 --- a/engine/core/src/routing_table.c +++ b/engine/core/src/routing_table.c @@ -33,8 +33,12 @@ static uint16_t RoutingTB_BigestNodeID(void); uint16_t RoutingTB_GetServiceIndex(uint16_t id); static int RoutingTB_Generate(service_t *service, uint16_t nb_node, connection_t *connection_table); -static void RoutingTB_Share(service_t *service, uint16_t nb_node); +static bool RoutingTB_Share(service_t *service, uint16_t nb_node); static void RoutingTB_SendEndDetection(service_t *service); +static void RoutingTB_ComputeNodeIndexes(service_t *service, uint16_t node_index, uint16_t nb_node, connection_t *connection_table); +static void RoutingTB_SendNodeIndexes(service_t *service, uint16_t node_id, uint8_t phy_index, uint8_t *node_indexes); +static void RoutingTB_ComputeServiceIndexes(service_t *service, uint16_t node_index); +static void RoutingTB_SendServiceIndexes(service_t *service, uint16_t node_id, uint8_t phy_index, uint8_t *service_indexes); // ************************ routing_table search tools *************************** @@ -234,6 +238,8 @@ static int RoutingTB_Generate(service_t *service, uint16_t nb_node, connection_t detect_state_machine = 2; return 0; } + // First compute the node indexes for this node and send it to it. + RoutingTB_ComputeNodeIndexes(service, last_node_id, nb_node, connection_table); try_nb++; intro_msg.header.cmd = LOCAL_RTB; intro_msg.header.target_mode = NODEIDACK; @@ -313,30 +319,38 @@ static int RoutingTB_Generate(service_t *service, uint16_t nb_node, connection_t } /****************************************************************************** - * @brief Send the complete route table to each node on the network + * @brief Send the complete route table and all indexes to each node on the network * @param service : Service who send * @param nb_node : number of nodes on network * @return None ******************************************************************************/ -static void RoutingTB_Share(service_t *service, uint16_t nb_node) +static bool RoutingTB_Share(service_t *service, uint16_t nb_node) { + static uint8_t detect_state_machine = 0; LUOS_ASSERT(service); // Make sure that the detection is not interrupted if (Node_GetState() == EXTERNAL_DETECTION) { - return; + return true; } + + if (detect_state_machine == 0) + { + // Compute local indexes + RoutingTB_ComputeServiceIndexes(service, 0); + detect_state_machine++; + return false; + } + // send route table to each nodes. Routing tables are commonly usable for each services of a node. msg_t intro_msg; intro_msg.header.cmd = RTB; intro_msg.header.target_mode = NODEIDACK; - for (uint16_t i = 2; i <= nb_node; i++) // don't send to ourself { intro_msg.header.target = i; - + // Check if this node need to get the routing table. uint16_t node_idx; - for (node_idx = i; node_idx < last_routing_table_entry; node_idx++) { if ((routing_table[node_idx].mode == NODE) && (routing_table[node_idx].node_id == i)) @@ -344,11 +358,270 @@ static void RoutingTB_Share(service_t *service, uint16_t nb_node) break; } } + RoutingTB_ComputeServiceIndexes(service, node_idx); if ((routing_table[node_idx].node_info & (1 << 0)) == 0) { Luos_SendData(service, &intro_msg, routing_table, (last_routing_table_entry * sizeof(routing_table_t))); } } + detect_state_machine = 0; + return true; +} + +/****************************************************************************** + * @brief Send the completed node indexes to a specific node + * @param service : Service who send + * @param node_id : node to send indexes + * @param phy_index : phy index in the node concerned by these indexes + * @param node_indexes : node indexes to send + * @return None + ******************************************************************************/ +void RoutingTB_SendNodeIndexes(service_t *service, uint16_t node_id, uint8_t phy_index, uint8_t *node_indexes) +{ + msg_t index_msg; + index_msg.header.target_mode = NODEIDACK; + index_msg.header.target = node_id; + LUOS_ASSERT(phy_index != 0xFF); + uint8_t data[MAX_NODE_NUMBER / 8 + 1]; + + // First we send the phy index allowing the target to know where to store the indexes + index_msg.header.cmd = PHY_ID; + Luos_SendData(service, &index_msg, &phy_index, sizeof(uint8_t)); + // Then we evaluate how many bytes we need to send the node indexes + volatile uint16_t i = 0; + for (i = (MAX_NODE_NUMBER / 8) + 1; i > 0; i--) + { + if (node_indexes[i - 1] != 0) + { + break; + } + } + // Send the node indexes + index_msg.header.cmd = NODE_INDEXES; + memcpy(data, node_indexes, i); + Luos_SendData(service, &index_msg, data, i); +} + +/****************************************************************************** + * @brief Compute indexes of nodes on the network and send it to them + * @param node_id : node id to compute indexes + * @return None + ******************************************************************************/ +void RoutingTB_ComputeNodeIndexes(service_t *service, uint16_t node_index, uint16_t nb_node, connection_t *connection_table) +{ + /* + * To get all the nodes indexes of the provided node ID, we have to parse the routing table and use the connection informations to know how to dispatch all the nodes. + * Each node is connected to all the other nodes, we "just" have to find out trough which phy we can reach them. + * Because node ID are contiguous the next node in the routing table (if it exist) will always have a connection information indicating trough which phy we can reach it. Let's say it phy 1. + * Then we will look at all the following nodes connections informations, if those informations doesn't involve our node we can consider taht they are accessible trough phy 1. + * We we encounter a node with connection informations that involve our node, this means that we completed the previous phy indexing, we can send it and start a new one for the phy described by the node connection informations. + * When we reach the end of the routing table, we have 2 options: + * - If the phy we were indexing is the same as our parent phy, we have to add all the parents nodes in the same phy indexing then send it. + * - If the phy we were indexing is different from our parent phy, we have to send the phy indexing and start a new one dedicated to the phy described by the parent node connection informations we have. + */ + uint16_t node_idx; + uint8_t nodes_indexes[MAX_NODE_NUMBER / 8 + 1] = {0}; + int node_phy = -1; + // Start from the provided node index and parse the connection table until the end. + for (node_idx = node_index + 1; node_idx < nb_node; node_idx++) + { + // Check if the connection informations involve our node. + if (connection_table[node_idx].parent.node_id == node_index + 1) + { + // This node consider our node as its parent! + // This means that we completed the previous phy indexing, we can send it and start a new one for the phy described by the node connection informations. + if (node_phy != -1) + { + // We have to send the indexes we completed. + RoutingTB_SendNodeIndexes(service, node_index + 1, node_phy, nodes_indexes); + } + + // We have to reset the indexes table and set the node_phy to the index of the concerned phy. + memset(nodes_indexes, 0, sizeof(nodes_indexes)); + node_phy = connection_table[node_idx].parent.phy_id; + } + LUOS_ASSERT(node_phy != -1); + // Add the node index to the nodes_indexes table. + uint8_t bit_index = node_idx; + nodes_indexes[bit_index / 8] |= 1 << (bit_index % 8); + } + + // We reached the end of the routing table! + // Check if the node index if the root of the routing table. If it is we just have to send the indexes and we are done. + if (node_index == 0) + { + if (node_phy != -1) + { + // We have to send the indexes we completed. + RoutingTB_SendNodeIndexes(service, node_index + 1, node_phy, nodes_indexes); + } + return; + } + // Compare the current node_phy to the current node index connection informations. + if (node_phy != connection_table[node_index].child.phy_id) + { + if (node_phy != -1) + { + // We were indexing another phy, we can consider it as done and send it. Then we have to start a new for connection_table[node_index].child.phy_id. + RoutingTB_SendNodeIndexes(service, node_index + 1, node_phy, nodes_indexes); + } + // We have to reset the indexes table and set the node_phy to the index of the concerned phy. + memset(nodes_indexes, 0, sizeof(nodes_indexes)); + node_phy = connection_table[node_index].child.phy_id; + } + + // Now we can put all the parent slots in the current indexes table. + for (node_idx = 0; node_idx < node_index; node_idx++) + { + // Add the node index to the nodes_indexes table. + uint8_t bit_index = node_idx; + nodes_indexes[bit_index / 8] |= 1 << (bit_index % 8); + } + + if (node_phy != -1) + { + // Send the last phy indexes. + RoutingTB_SendNodeIndexes(service, node_index + 1, node_phy, nodes_indexes); + } +} + +/****************************************************************************** + * @brief Send the completed service indexes to a specific node + * @param service : Service who send + * @param node_id : node to send indexes + * @param phy_index : phy index in the node concerned by these indexes + * @param node_indexes : node indexes to send + * @param service_indexes : service indexes to send + * @return None + ******************************************************************************/ +void RoutingTB_SendServiceIndexes(service_t *service, uint16_t node_id, uint8_t phy_index, uint8_t *service_indexes) +{ + msg_t index_msg; + index_msg.header.target_mode = NODEIDACK; + index_msg.header.target = node_id; + LUOS_ASSERT(phy_index != 0xFF); + uint8_t data[MAX_SERVICE_NUMBER / 8 + 1]; + + // First we send the phy index allowing the target to know where to store the indexes + index_msg.header.cmd = PHY_ID; + Luos_SendData(service, &index_msg, &phy_index, sizeof(uint8_t)); + // Then we evaluate how many bytes we need to send the node indexes + volatile uint16_t i = 0; + for (i = (MAX_SERVICE_NUMBER / 8) + 1; i > 0; i--) + { + if (service_indexes[i - 1] != 0) + { + break; + } + } + // Send the service indexes + index_msg.header.cmd = SERVICE_INDEXES; + memcpy(data, service_indexes, i); + Luos_SendData(service, &index_msg, data, i); +} + +/****************************************************************************** + * @brief Compute indexes of nodes on the network and send it to them + * @param node_id : node id to compute indexes + * @return None + ******************************************************************************/ +void RoutingTB_ComputeServiceIndexes(service_t *service, uint16_t node_index) +{ + /* + * To get all the nodes indexes of the provided node ID, we have to parse the routing table and use the connection informations to know how to dispatch all the nodes. + * Each node is connected to all the other nodes, we "just" have to find out trough which phy we can reach them. + * Because node ID are contiguous the next node in the routing table (if it exist) will always have a connection information indicating trough which phy we can reach it. Let's say it phy 1. + * Then we will look at all the following nodes connections informations, if those informations doesn't involve our node we can consider taht they are accessible trough phy 1. + * We we encounter a node with connection informations that involve our node, this means that we completed the previous phy indexing, we can send it and start a new one for the phy described by the node connection informations. + * When we reach the end of the routing table, we have 2 options: + * - If the phy we were indexing is the same as our parent phy, we have to add all the parents nodes in the same phy indexing then send it. + * - If the phy we were indexing is different from our parent phy, we have to send the phy indexing and start a new one dedicated to the phy described by the parent node connection informations we have. + */ + LUOS_ASSERT((node_index < last_routing_table_entry) && (routing_table[node_index].mode == NODE)); + uint16_t node_idx; + uint8_t services_indexes[MAX_SERVICE_NUMBER / 8 + 1] = {0}; + int node_phy = -1; + // Start from the provided node index and parse the routing table until the end. + for (node_idx = node_index + 1; node_idx < last_routing_table_entry; node_idx++) + { + switch (routing_table[node_idx].mode) + { + case NODE: + // This is a node slot, check if the connection informations involve our node. + if (routing_table[node_idx].connection.parent.node_id == routing_table[node_index].node_id) + { + // This node consider our node as its parent! + // This means that we completed the previous phy indexing, we can send it and start a new one for the phy described by the node connection informations. + if (node_phy != -1) + { + // We have to send the indexes we completed. + RoutingTB_SendServiceIndexes(service, routing_table[node_index].node_id, node_phy, services_indexes); + } + + // We have to reset the indexes table and set the node_phy to the index of the concerned phy. + memset(services_indexes, 0, sizeof(services_indexes)); + node_phy = routing_table[node_idx].connection.parent.phy_id; + } + LUOS_ASSERT(node_phy != -1); + break; + case SERVICE: + // This is a service slot. + // if a node phy is set, this service is accessible trough this phy, we have to add it to the services_indexes table. + // else this service is a local one (already referenced by Luos_engine phy), we don't care. + if (node_phy != -1) + { + // Add the service index to the services_indexes table. + uint8_t bit_index = routing_table[node_idx].id - 1; // Because 1 represent bit index 0. + services_indexes[bit_index / 8] |= 1 << (bit_index % 8); + } + break; + case CLEAR: + default: + LUOS_ASSERT(0); + break; + } + } + + // We reached the end of the routing table! + // Check if the node index is the root of the routing table. If it is we just have to send the indexes and we are done. + if (node_index == 0) + { + if (node_phy != -1) + { + // We have to send the indexes we completed. + RoutingTB_SendServiceIndexes(service, routing_table[node_index].node_id, node_phy, services_indexes); + } + return; + } + // Compare the current node_phy to the current node index connection informations. + if (node_phy != routing_table[node_index].connection.child.phy_id) + { + if (node_phy != -1) + { + // We were indexing another phy, we can consider it as done and send it. Then we have to start a new one for routing_table[node_index].connection.child.phy_id. + RoutingTB_SendServiceIndexes(service, routing_table[node_index].node_id, node_phy, services_indexes); + } + // We have to reset the indexes table and set the node_phy to the index of the concerned phy. + memset(services_indexes, 0, sizeof(services_indexes)); + node_phy = routing_table[node_index].connection.child.phy_id; + } + + // Now we can put all the parent slots in the current indexes table. + for (node_idx = 0; node_idx < node_index; node_idx++) + { + if (routing_table[node_idx].mode == SERVICE) + { + // Add the service index to the services_indexes table. + uint8_t bit_index = routing_table[node_idx].id - 1; // Because 1 represent bit index 0. + services_indexes[bit_index / 8] |= 1 << (bit_index % 8); + } + } + + if (node_phy != -1) + { + // Send the last phy indexes. + RoutingTB_SendServiceIndexes(service, routing_table[node_index].node_id, node_phy, services_indexes); + } } /****************************************************************************** @@ -427,8 +700,16 @@ bool RoutingTB_DetectServices(service_t *service) detect_state_machine = 0; return true; } + detect_state_machine++; + case 3: // We have a complete routing table now share it with others. - RoutingTB_Share(service, nb_node); + if (RoutingTB_Share(service, nb_node)) + { + detect_state_machine++; + } + return false; + break; + case 4: // Send a message to indicate the end of the detection RoutingTB_SendEndDetection(service); // Clear statistic of node who start the detction diff --git a/engine/core/src/service.c b/engine/core/src/service.c index 6496d3d35..5bec431e6 100644 --- a/engine/core/src/service.c +++ b/engine/core/src/service.c @@ -6,7 +6,7 @@ ******************************************************************************/ #include #include "service.h" -#include "filter.h" +#include "_luos_phy.h" #include "node.h" #include "luos_utils.h" #include "luos_hal.h" @@ -82,7 +82,7 @@ void Service_ResetStatistics(void) void Service_GenerateId(uint16_t base_id) { LUOS_ASSERT(base_id > 0); - Filter_AddServiceId(base_id, service_ctx.number); + Phy_AddLocalServices(base_id, service_ctx.number); if (base_id == 1) { // If base_id is 1, it means that the node is a detector. diff --git a/engine/engine_config.h b/engine/engine_config.h index 3127461e9..483b45ddc 100644 --- a/engine/engine_config.h +++ b/engine/engine_config.h @@ -30,6 +30,12 @@ #define MAX_NODE_NUMBER 20 // The maximum number of nodes in the complete architecture #endif +#ifndef LOCAL_PHY_NB + #define LOCAL_PHY_NB 1 // The number of phy layer in the node, by default we have only Luos engine + 1 phy layer +#endif + +#define PHY_NB (LOCAL_PHY_NB + 1) // The total number of phy layer in the node including Luos engine + #ifdef MAX_RTB_ENTRY #error 'MAX_RTB_ENTRY' configuration is deprecated and have been replaced by MAX_NODE_NUMBER and MAX_SERVICE_NUMBER. MAX_RTB_ENTRY is now automatically calculated by the engine based on these values. #endif diff --git a/examples/projects/Arduino/bldc_simple_foc/node_config.h b/examples/projects/Arduino/bldc_simple_foc/node_config.h index 1cd23bf71..9d348c1f0 100644 --- a/examples/projects/Arduino/bldc_simple_foc/node_config.h +++ b/examples/projects/Arduino/bldc_simple_foc/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 #define ARDUINO_PTPA_PIN 19 #define ARDUINO_PTPB_PIN 7 diff --git a/examples/projects/Arduino/button/node_config.h b/examples/projects/Arduino/button/node_config.h index 961af2512..aeab338b2 100644 --- a/examples/projects/Arduino/button/node_config.h +++ b/examples/projects/Arduino/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/Arduino/fingerprint/node_config.h b/examples/projects/Arduino/fingerprint/node_config.h index 961af2512..aeab338b2 100644 --- a/examples/projects/Arduino/fingerprint/node_config.h +++ b/examples/projects/Arduino/fingerprint/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/Arduino/lcd/node_config.h b/examples/projects/Arduino/lcd/node_config.h index 961af2512..aeab338b2 100644 --- a/examples/projects/Arduino/lcd/node_config.h +++ b/examples/projects/Arduino/lcd/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/Arduino/led/node_config.h b/examples/projects/Arduino/led/node_config.h index 961af2512..aeab338b2 100644 --- a/examples/projects/Arduino/led/node_config.h +++ b/examples/projects/Arduino/led/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/Arduino/servo_motor/node_config.h b/examples/projects/Arduino/servo_motor/node_config.h index 961af2512..aeab338b2 100644 --- a/examples/projects/Arduino/servo_motor/node_config.h +++ b/examples/projects/Arduino/servo_motor/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/Arduino/stepper_simple_foc/node_config.h b/examples/projects/Arduino/stepper_simple_foc/node_config.h index 9d6b1d679..a894818d2 100644 --- a/examples/projects/Arduino/stepper_simple_foc/node_config.h +++ b/examples/projects/Arduino/stepper_simple_foc/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 #define ARDUINO_PTPA_PIN 19 #define ARDUINO_PTPB_PIN 7 diff --git a/examples/projects/NUCLEO-F072RB/button/node_config.h b/examples/projects/NUCLEO-F072RB/button/node_config.h index 52cb97eab..099378211 100644 --- a/examples/projects/NUCLEO-F072RB/button/node_config.h +++ b/examples/projects/NUCLEO-F072RB/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h b/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h index 2d45ceb93..29161ee80 100644 --- a/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-F072RB/dc_motor/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 #define MSG_BUFFER_SIZE 512 /******************************************************************************* diff --git a/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h b/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h index 591039463..fde33ebd6 100644 --- a/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-F072RB/potentiometer/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-F401RE/button/node_config.h b/examples/projects/NUCLEO-F401RE/button/node_config.h index b36051575..0f83f737f 100644 --- a/examples/projects/NUCLEO-F401RE/button/node_config.h +++ b/examples/projects/NUCLEO-F401RE/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h b/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h index d0c06e415..f1b94d7a4 100644 --- a/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-F401RE/dc_motor/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 #define MSG_BUFFER_SIZE 512 /******************************************************************************* diff --git a/examples/projects/NUCLEO-F401RE/led/node_config.h b/examples/projects/NUCLEO-F401RE/led/node_config.h index b36051575..0f83f737f 100644 --- a/examples/projects/NUCLEO-F401RE/led/node_config.h +++ b/examples/projects/NUCLEO-F401RE/led/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h b/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h index cb4b3a6eb..c4965c1b5 100644 --- a/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-F401RE/potentiometer/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-F410RB/button/node_config.h b/examples/projects/NUCLEO-F410RB/button/node_config.h index 5c758889b..dad4d3202 100644 --- a/examples/projects/NUCLEO-F410RB/button/node_config.h +++ b/examples/projects/NUCLEO-F410RB/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h b/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h index d0c06e415..f1b94d7a4 100644 --- a/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-F410RB/dc_motor/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 #define MSG_BUFFER_SIZE 512 /******************************************************************************* diff --git a/examples/projects/NUCLEO-F410RB/led/node_config.h b/examples/projects/NUCLEO-F410RB/led/node_config.h index 8ffbb4fd2..5fb708a14 100644 --- a/examples/projects/NUCLEO-F410RB/led/node_config.h +++ b/examples/projects/NUCLEO-F410RB/led/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h b/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h index cb4b3a6eb..c4965c1b5 100644 --- a/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-F410RB/potentiometer/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-G431KB/button/node_config.h b/examples/projects/NUCLEO-G431KB/button/node_config.h index 1fc4cdf75..7dee8b88a 100644 --- a/examples/projects/NUCLEO-G431KB/button/node_config.h +++ b/examples/projects/NUCLEO-G431KB/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h b/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h index 2135215e6..97cea87da 100644 --- a/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-G431KB/dc_motor/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h b/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h index 2135215e6..97cea87da 100644 --- a/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-G431KB/potentiometer/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-L073RZ/button/node_config.h b/examples/projects/NUCLEO-L073RZ/button/node_config.h index 4de9ad22e..e35b8cb83 100644 --- a/examples/projects/NUCLEO-L073RZ/button/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/button/node_config.h @@ -50,7 +50,7 @@ #define ROBUS_NETWORK_BAUDRATE 500000 #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-L432KC/button/node_config.h b/examples/projects/NUCLEO-L432KC/button/node_config.h index 1fc4cdf75..7dee8b88a 100644 --- a/examples/projects/NUCLEO-L432KC/button/node_config.h +++ b/examples/projects/NUCLEO-L432KC/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h b/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h index 1fc4cdf75..7dee8b88a 100644 --- a/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h +++ b/examples/projects/NUCLEO-L432KC/dc_motor/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h b/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h index 1fc4cdf75..7dee8b88a 100644 --- a/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h +++ b/examples/projects/NUCLEO-L432KC/fingerprint/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-L432KC/lcd/node_config.h b/examples/projects/NUCLEO-L432KC/lcd/node_config.h index 1fc4cdf75..7dee8b88a 100644 --- a/examples/projects/NUCLEO-L432KC/lcd/node_config.h +++ b/examples/projects/NUCLEO-L432KC/lcd/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-L432KC/led/node_config.h b/examples/projects/NUCLEO-L432KC/led/node_config.h index 1fc4cdf75..7dee8b88a 100644 --- a/examples/projects/NUCLEO-L432KC/led/node_config.h +++ b/examples/projects/NUCLEO-L432KC/led/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h b/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h index 1fc4cdf75..7dee8b88a 100644 --- a/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h +++ b/examples/projects/NUCLEO-L432KC/potentiometer/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/NUCLEO-L432KC/servo/node_config.h b/examples/projects/NUCLEO-L432KC/servo/node_config.h index 1fc4cdf75..7dee8b88a 100644 --- a/examples/projects/NUCLEO-L432KC/servo/node_config.h +++ b/examples/projects/NUCLEO-L432KC/servo/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/SAMD21XPLAINED/button/node_config.h b/examples/projects/SAMD21XPLAINED/button/node_config.h index 961af2512..aeab338b2 100644 --- a/examples/projects/SAMD21XPLAINED/button/node_config.h +++ b/examples/projects/SAMD21XPLAINED/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/STM32F4-discovery/button/node_config.h b/examples/projects/STM32F4-discovery/button/node_config.h index 029832089..f085a0a56 100644 --- a/examples/projects/STM32F4-discovery/button/node_config.h +++ b/examples/projects/STM32F4-discovery/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/STM32L4S5_discovery/bootloader/node_config.h b/examples/projects/STM32L4S5_discovery/bootloader/node_config.h index b08e09cb1..9621e9fb8 100644 --- a/examples/projects/STM32L4S5_discovery/bootloader/node_config.h +++ b/examples/projects/STM32L4S5_discovery/bootloader/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/STM32L4S5_discovery/button/node_config.h b/examples/projects/STM32L4S5_discovery/button/node_config.h index b80c9ab38..e6c1d616e 100644 --- a/examples/projects/STM32L4S5_discovery/button/node_config.h +++ b/examples/projects/STM32L4S5_discovery/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/button/node_config.h b/examples/projects/l0/button/node_config.h index 52cb97eab..099378211 100644 --- a/examples/projects/l0/button/node_config.h +++ b/examples/projects/l0/button/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/button/platformio.ini b/examples/projects/l0/button/platformio.ini index 421c5d9c1..47b814210 100644 --- a/examples/projects/l0/button/platformio.ini +++ b/examples/projects/l0/button/platformio.ini @@ -22,6 +22,7 @@ lib_deps = luos_engine@^3.0.0 Button serial_network + robus_network debug_tool = stlink [env:l0] diff --git a/examples/projects/l0/button/src/main.c b/examples/projects/l0/button/src/main.c index e1cdc439c..6a9f89f84 100644 --- a/examples/projects/l0/button/src/main.c +++ b/examples/projects/l0/button/src/main.c @@ -27,6 +27,7 @@ /* USER CODE BEGIN Includes */ #include "luos_engine.h" #include "serial_network.h" +#include "robus_network.h" #include "button.h" /* USER CODE END Includes */ @@ -92,6 +93,7 @@ int main(void) /* USER CODE BEGIN 2 */ Luos_Init(); Serial_Init(); + Robus_Init(); Button_Init(); /* USER CODE END 2 */ @@ -101,6 +103,7 @@ int main(void) { Luos_Loop(); Serial_Loop(); + Robus_Loop(); Button_Loop(); /* USER CODE END WHILE */ diff --git a/examples/projects/l0/button_freertos/node_config.h b/examples/projects/l0/button_freertos/node_config.h index 52cb97eab..099378211 100644 --- a/examples/projects/l0/button_freertos/node_config.h +++ b/examples/projects/l0/button_freertos/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/dc_motor/node_config.h b/examples/projects/l0/dc_motor/node_config.h index 2d45ceb93..29161ee80 100644 --- a/examples/projects/l0/dc_motor/node_config.h +++ b/examples/projects/l0/dc_motor/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 2 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 #define MSG_BUFFER_SIZE 512 /******************************************************************************* diff --git a/examples/projects/l0/distance/node_config.h b/examples/projects/l0/distance/node_config.h index 591039463..fde33ebd6 100644 --- a/examples/projects/l0/distance/node_config.h +++ b/examples/projects/l0/distance/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/fingerprint/node_config.h b/examples/projects/l0/fingerprint/node_config.h index 591039463..fde33ebd6 100644 --- a/examples/projects/l0/fingerprint/node_config.h +++ b/examples/projects/l0/fingerprint/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/lcd/node_config.h b/examples/projects/l0/lcd/node_config.h index 591039463..fde33ebd6 100644 --- a/examples/projects/l0/lcd/node_config.h +++ b/examples/projects/l0/lcd/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/led/node_config.h b/examples/projects/l0/led/node_config.h index 591039463..fde33ebd6 100644 --- a/examples/projects/l0/led/node_config.h +++ b/examples/projects/l0/led/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/led_fader/node_config.h b/examples/projects/l0/led_fader/node_config.h index 591039463..fde33ebd6 100644 --- a/examples/projects/l0/led_fader/node_config.h +++ b/examples/projects/l0/led_fader/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/light_sensor/node_config.h b/examples/projects/l0/light_sensor/node_config.h index 591039463..fde33ebd6 100644 --- a/examples/projects/l0/light_sensor/node_config.h +++ b/examples/projects/l0/light_sensor/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/load/node_config.h b/examples/projects/l0/load/node_config.h index 591039463..fde33ebd6 100644 --- a/examples/projects/l0/load/node_config.h +++ b/examples/projects/l0/load/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/potentiometer/node_config.h b/examples/projects/l0/potentiometer/node_config.h index 591039463..fde33ebd6 100644 --- a/examples/projects/l0/potentiometer/node_config.h +++ b/examples/projects/l0/potentiometer/node_config.h @@ -47,7 +47,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/power_switch/node_config.h b/examples/projects/l0/power_switch/node_config.h index 52cb97eab..099378211 100644 --- a/examples/projects/l0/power_switch/node_config.h +++ b/examples/projects/l0/power_switch/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/l0/stepper/node_config.h b/examples/projects/l0/stepper/node_config.h index 52cb97eab..099378211 100644 --- a/examples/projects/l0/stepper/node_config.h +++ b/examples/projects/l0/stepper/node_config.h @@ -48,7 +48,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/native/button/node_config.h b/examples/projects/native/button/node_config.h index 2b7a9f49e..721108be8 100644 --- a/examples/projects/native/button/node_config.h +++ b/examples/projects/native/button/node_config.h @@ -46,7 +46,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/native/led/node_config.h b/examples/projects/native/led/node_config.h index 2b7a9f49e..721108be8 100644 --- a/examples/projects/native/led/node_config.h +++ b/examples/projects/native/led/node_config.h @@ -46,7 +46,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/examples/projects/native/ping_pong/node_config.h b/examples/projects/native/ping_pong/node_config.h index 7ee6b3d71..2fe8822c3 100644 --- a/examples/projects/native/ping_pong/node_config.h +++ b/examples/projects/native/ping_pong/node_config.h @@ -47,7 +47,7 @@ ******************************************************************************/ #define MAX_LOCAL_SERVICE_NUMBER 1 #define MAX_LOCAL_PROFILE_NUMBER 1 -#define MAX_MSG_NB 5 +#define MAX_MSG_NB 10 #define MAX_NODE_NB 50 #define MAX_SERVICE_NUMBER 50 diff --git a/test/tests_io/test_filter/main.c b/test/tests_io/test_filter/main.c index a17091bd0..7b2c7884c 100644 --- a/test/tests_io/test_filter/main.c +++ b/test/tests_io/test_filter/main.c @@ -7,10 +7,10 @@ void unittest_Filter_ServiceId() uint16_t service_number = 10; NEW_TEST_CASE("Basic Service ID mask test"); { - Filter_IdInit(); + Phy_FiltersInit(); TRY { - Filter_AddServiceId(7, service_number); + Phy_AddLocalServices(7, service_number); TEST_ASSERT_EQUAL(true, Filter_ServiceID(7)); TEST_ASSERT_EQUAL(true, Filter_ServiceID(7 + service_number - 1)); } @@ -21,7 +21,7 @@ void unittest_Filter_ServiceId() TRY { - Filter_AddServiceId(8, service_number); + Phy_AddLocalServices(8, service_number); TEST_ASSERT_EQUAL(false, Filter_ServiceID(7)); TEST_ASSERT_EQUAL(true, Filter_ServiceID(8)); TEST_ASSERT_EQUAL(true, Filter_ServiceID(8 + service_number - 1)); @@ -33,7 +33,7 @@ void unittest_Filter_ServiceId() TRY { - Filter_AddServiceId(9, service_number); + Phy_AddLocalServices(9, service_number); TEST_ASSERT_EQUAL(false, Filter_ServiceID(8)); TEST_ASSERT_EQUAL(true, Filter_ServiceID(9)); TEST_ASSERT_EQUAL(true, Filter_ServiceID(9 + service_number - 1)); @@ -45,7 +45,7 @@ void unittest_Filter_ServiceId() TRY { - Filter_AddServiceId(9, 0); + Phy_AddLocalServices(9, 0); TEST_ASSERT_EQUAL(false, Filter_ServiceID(8)); TEST_ASSERT_EQUAL(false, Filter_ServiceID(9)); TEST_ASSERT_EQUAL(false, Filter_ServiceID(9 + service_number - 1)); @@ -59,11 +59,11 @@ void unittest_Filter_ServiceId() service_number = MAX_LOCAL_SERVICE_NUMBER; NEW_TEST_CASE("Service ID mask test with max services"); { - Filter_IdInit(); + Phy_FiltersInit(); TRY { - Filter_AddServiceId(7, service_number); + Phy_AddLocalServices(7, service_number); TEST_ASSERT_EQUAL(true, Filter_ServiceID(7)); TEST_ASSERT_EQUAL(true, Filter_ServiceID(7 + service_number - 1)); } @@ -74,7 +74,7 @@ void unittest_Filter_ServiceId() TRY { - Filter_AddServiceId(8, service_number); + Phy_AddLocalServices(8, service_number); TEST_ASSERT_EQUAL(false, Filter_ServiceID(7)); TEST_ASSERT_EQUAL(true, Filter_ServiceID(8)); TEST_ASSERT_EQUAL(true, Filter_ServiceID(8 + service_number - 1)); @@ -86,7 +86,7 @@ void unittest_Filter_ServiceId() TRY { - Filter_AddServiceId(9, service_number); + Phy_AddLocalServices(9, service_number); TEST_ASSERT_EQUAL(false, Filter_ServiceID(8)); TEST_ASSERT_EQUAL(true, Filter_ServiceID(9)); TEST_ASSERT_EQUAL(true, Filter_ServiceID(9 + service_number - 1)); @@ -98,7 +98,7 @@ void unittest_Filter_ServiceId() TRY { - Filter_AddServiceId(9, 0); + Phy_AddLocalServices(9, 0); TEST_ASSERT_EQUAL(false, Filter_ServiceID(8)); TEST_ASSERT_EQUAL(false, Filter_ServiceID(9)); TEST_ASSERT_EQUAL(false, Filter_ServiceID(9 + service_number - 1)); @@ -111,10 +111,10 @@ void unittest_Filter_ServiceId() NEW_TEST_CASE("Overlap the MAX_LOCAL_SERVICE_NUMBER"); { - Filter_IdInit(); + Phy_FiltersInit(); TRY { - Filter_AddServiceId(1, MAX_LOCAL_SERVICE_NUMBER + 1); + Phy_AddLocalServices(1, MAX_LOCAL_SERVICE_NUMBER + 1); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -122,10 +122,10 @@ void unittest_Filter_ServiceId() NEW_TEST_CASE("Test the id 4096 Limit"); { - Filter_IdInit(); + Phy_FiltersInit(); TRY { - Filter_AddServiceId(4096 - MAX_LOCAL_SERVICE_NUMBER, service_number); + Phy_AddLocalServices(4096 - MAX_LOCAL_SERVICE_NUMBER, service_number); TEST_ASSERT_EQUAL(true, Filter_ServiceID(4096 - MAX_LOCAL_SERVICE_NUMBER)); } CATCH @@ -135,7 +135,7 @@ void unittest_Filter_ServiceId() TRY { - Filter_AddServiceId(4096 - MAX_LOCAL_SERVICE_NUMBER + 1, service_number); + Phy_AddLocalServices(4096 - MAX_LOCAL_SERVICE_NUMBER + 1, service_number); } TEST_ASSERT_TRUE(IS_ASSERT()); @@ -149,10 +149,10 @@ void unittest_Filter_ServiceId() NEW_TEST_CASE("Test the id 0 Limit"); { - Filter_IdInit(); + Phy_FiltersInit(); TRY { - Filter_AddServiceId(0, service_number); + Phy_AddLocalServices(0, service_number); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -366,7 +366,7 @@ void unittest_Filter_Type() { TRY { - Filter_Type(4096 + 1); + Phy_FilterType(4096 + 1); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -377,10 +377,10 @@ void unittest_Filter_Type() TRY { service_ctx.number = 0; - TEST_ASSERT_EQUAL(false, Filter_Type(0)); - TEST_ASSERT_EQUAL(false, Filter_Type(1)); - TEST_ASSERT_EQUAL(false, Filter_Type(2)); - TEST_ASSERT_EQUAL(false, Filter_Type(12)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(0)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(1)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(2)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(12)); } CATCH { @@ -394,10 +394,10 @@ void unittest_Filter_Type() { service_ctx.number = 1; service_ctx.list[0].type = 0; - TEST_ASSERT_EQUAL(true, Filter_Type(0)); - TEST_ASSERT_EQUAL(false, Filter_Type(1)); - TEST_ASSERT_EQUAL(false, Filter_Type(2)); - TEST_ASSERT_EQUAL(false, Filter_Type(12)); + TEST_ASSERT_EQUAL(true, Phy_FilterType(0)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(1)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(2)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(12)); } CATCH { @@ -408,10 +408,10 @@ void unittest_Filter_Type() { service_ctx.number = 1; service_ctx.list[0].type = 1; - TEST_ASSERT_EQUAL(false, Filter_Type(0)); - TEST_ASSERT_EQUAL(true, Filter_Type(1)); - TEST_ASSERT_EQUAL(false, Filter_Type(2)); - TEST_ASSERT_EQUAL(false, Filter_Type(12)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(0)); + TEST_ASSERT_EQUAL(true, Phy_FilterType(1)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(2)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(12)); } CATCH { @@ -422,10 +422,10 @@ void unittest_Filter_Type() { service_ctx.number = 1; service_ctx.list[0].type = 12; - TEST_ASSERT_EQUAL(false, Filter_Type(0)); - TEST_ASSERT_EQUAL(false, Filter_Type(1)); - TEST_ASSERT_EQUAL(false, Filter_Type(2)); - TEST_ASSERT_EQUAL(true, Filter_Type(12)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(0)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(1)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(2)); + TEST_ASSERT_EQUAL(true, Phy_FilterType(12)); } CATCH { @@ -437,10 +437,10 @@ void unittest_Filter_Type() service_ctx.number = 2; service_ctx.list[0].type = 1; service_ctx.list[1].type = 12; - TEST_ASSERT_EQUAL(false, Filter_Type(0)); - TEST_ASSERT_EQUAL(true, Filter_Type(1)); - TEST_ASSERT_EQUAL(false, Filter_Type(2)); - TEST_ASSERT_EQUAL(true, Filter_Type(12)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(0)); + TEST_ASSERT_EQUAL(true, Phy_FilterType(1)); + TEST_ASSERT_EQUAL(false, Phy_FilterType(2)); + TEST_ASSERT_EQUAL(true, Phy_FilterType(12)); } CATCH { @@ -449,7 +449,7 @@ void unittest_Filter_Type() } } -void unittest_Filter_GetPhyTarget() +void unittest_Phy_ComputeTargets() { header_t header; NEW_TEST_CASE("Test a wrong header target_mode"); @@ -457,7 +457,7 @@ void unittest_Filter_GetPhyTarget() TRY { header.target_mode = 0x0f; - Filter_GetPhyTarget(&header); + Phy_ComputeTargets(&header); } TEST_ASSERT_TRUE(!IS_ASSERT()); END_TRY; @@ -467,11 +467,11 @@ void unittest_Filter_GetPhyTarget() { TRY { - Filter_AddServiceId(1, 1); + Phy_AddLocalServices(1, 1); header.target_mode = SERVICEIDACK; header.target = 1; // We should have Luos only - TEST_ASSERT_EQUAL(0x01, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x01, Phy_ComputeTargets(&header)); } CATCH { @@ -480,11 +480,11 @@ void unittest_Filter_GetPhyTarget() TRY { - Filter_AddServiceId(1, 1); + Phy_AddLocalServices(1, 1); header.target_mode = SERVICEIDACK; header.target = 2; // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); } CATCH { @@ -493,11 +493,11 @@ void unittest_Filter_GetPhyTarget() TRY { - Filter_AddServiceId(1, 1); + Phy_AddLocalServices(1, 1); header.target_mode = SERVICEID; header.target = 1; // We should have Luos only - TEST_ASSERT_EQUAL(0x01, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x01, Phy_ComputeTargets(&header)); } CATCH { @@ -506,11 +506,11 @@ void unittest_Filter_GetPhyTarget() TRY { - Filter_AddServiceId(1, 1); + Phy_AddLocalServices(1, 1); header.target_mode = SERVICEID; header.target = 2; // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); } CATCH { @@ -519,11 +519,11 @@ void unittest_Filter_GetPhyTarget() TRY { - Filter_AddServiceId(1, 2); + Phy_AddLocalServices(1, 2); header.target_mode = SERVICEIDACK; header.target = 2; // We should have Luos only - TEST_ASSERT_EQUAL(0x01, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x01, Phy_ComputeTargets(&header)); } CATCH { @@ -532,11 +532,11 @@ void unittest_Filter_GetPhyTarget() TRY { - Filter_AddServiceId(1, 2); + Phy_AddLocalServices(1, 2); header.target_mode = SERVICEIDACK; header.target = 3; // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); } CATCH { @@ -545,11 +545,11 @@ void unittest_Filter_GetPhyTarget() TRY { - Filter_AddServiceId(1, 2); + Phy_AddLocalServices(1, 2); header.target_mode = SERVICEID; header.target = 2; // We should have Luos only - TEST_ASSERT_EQUAL(0x01, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x01, Phy_ComputeTargets(&header)); } CATCH { @@ -558,11 +558,11 @@ void unittest_Filter_GetPhyTarget() TRY { - Filter_AddServiceId(1, 2); + Phy_AddLocalServices(1, 2); header.target_mode = SERVICEID; header.target = 3; // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); } CATCH { @@ -579,7 +579,7 @@ void unittest_Filter_GetPhyTarget() header.target_mode = TYPE; header.target = 0; // We should have Luos and Robus - TEST_ASSERT_EQUAL(0x03, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x03, Phy_ComputeTargets(&header)); } CATCH { @@ -593,7 +593,7 @@ void unittest_Filter_GetPhyTarget() header.target_mode = TYPE; header.target = 1; // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); } CATCH { @@ -608,7 +608,7 @@ void unittest_Filter_GetPhyTarget() header.target_mode = BROADCAST; header.target = BROADCAST_VAL; // We should have Luos and Robus - TEST_ASSERT_EQUAL(0x03, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x03, Phy_ComputeTargets(&header)); } CATCH { @@ -620,7 +620,7 @@ void unittest_Filter_GetPhyTarget() header.target_mode = BROADCAST; header.target = 1; // We should have Luos and Robus - TEST_ASSERT_EQUAL(0x03, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x03, Phy_ComputeTargets(&header)); } CATCH { @@ -636,7 +636,7 @@ void unittest_Filter_GetPhyTarget() header.target_mode = NODEIDACK; header.target = 1; // We should have Luos only - TEST_ASSERT_EQUAL(0x01, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x01, Phy_ComputeTargets(&header)); } CATCH { @@ -649,7 +649,7 @@ void unittest_Filter_GetPhyTarget() header.target_mode = NODEIDACK; header.target = 2; // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); } CATCH { @@ -662,7 +662,7 @@ void unittest_Filter_GetPhyTarget() header.target_mode = NODEID; header.target = 1; // We should have Luos only - TEST_ASSERT_EQUAL(0x01, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x01, Phy_ComputeTargets(&header)); } CATCH { @@ -675,7 +675,7 @@ void unittest_Filter_GetPhyTarget() header.target_mode = NODEID; header.target = 2; // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); } CATCH { @@ -692,10 +692,10 @@ void unittest_Filter_GetPhyTarget() header.target_mode = TOPIC; header.target = 3; // We should have Luos and Robus - TEST_ASSERT_EQUAL(0x03, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x03, Phy_ComputeTargets(&header)); header.target = 2; // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Filter_GetPhyTarget(&header)); + TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); } CATCH { @@ -711,7 +711,7 @@ int main(int argc, char **argv) RUN_TEST(unittest_Filter_ServiceId); RUN_TEST(unittest_Filter_Topic); RUN_TEST(unittest_Filter_Type); - RUN_TEST(unittest_Filter_GetPhyTarget); + RUN_TEST(unittest_Phy_ComputeTargets); UNITY_END(); } diff --git a/test/tests_io/test_phy/main.c b/test/tests_io/test_phy/main.c index c94eecf0d..2305e40a2 100644 --- a/test/tests_io/test_phy/main.c +++ b/test/tests_io/test_phy/main.c @@ -699,7 +699,7 @@ void unittest_phy_ComputeHeader() { phy_test_reset(); // Create a fake service with id 1 - Filter_AddServiceId(1, 1); + Phy_AddLocalServices(1, 1); msg_t msg; msg.header.config = BASE_PROTOCOL; @@ -740,7 +740,7 @@ void unittest_phy_ComputeHeader() { phy_test_reset(); // Create a fake service with id 1 - Filter_AddServiceId(1, 1); + Phy_AddLocalServices(1, 1); msg_t msg; msg.header.config = TIMESTAMP_PROTOCOL; @@ -781,7 +781,7 @@ void unittest_phy_ComputeHeader() { phy_test_reset(); // Create a fake service with id 1 - Filter_AddServiceId(1, 1); + Phy_AddLocalServices(1, 1); msg_t msg; msg.header.config = BASE_PROTOCOL; @@ -822,7 +822,7 @@ void unittest_phy_ComputeHeader() { phy_test_reset(); // Create a fake service with id 1 - Filter_AddServiceId(1, 1); + Phy_AddLocalServices(1, 1); msg_t msg; msg.header.config = TIMESTAMP_PROTOCOL; @@ -863,7 +863,7 @@ void unittest_phy_ComputeHeader() { phy_test_reset(); // Create a fake service with id 1 - Filter_AddServiceId(1, 1); + Phy_AddLocalServices(1, 1); msg_t msg; msg.header.config = TIMESTAMP_PROTOCOL; @@ -903,7 +903,7 @@ void unittest_phy_ComputeHeader() { phy_test_reset(); // Create a fake service with id 1 - Filter_AddServiceId(1, 1); + Phy_AddLocalServices(1, 1); msg_t msg; msg.header.config = TIMESTAMP_PROTOCOL; From 45d11d17b8f70ad151c25d74228a2850ee0c5206 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 25 Aug 2023 11:19:04 +0200 Subject: [PATCH 121/150] Add a print for native assert --- engine/core/src/luos_utils.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/engine/core/src/luos_utils.c b/engine/core/src/luos_utils.c index 02616780c..01958e2d9 100644 --- a/engine/core/src/luos_utils.c +++ b/engine/core/src/luos_utils.c @@ -11,6 +11,9 @@ #include "luos_hal.h" #include "msg_alloc.h" #include "_luos_phy.h" +#if (defined _WIN32) || (defined _WIN64) || (defined __linux__) || (defined __APPLE__) || (defined __unix__) || (defined __CYGWIN__) || (defined __MINGW32__) || (defined __MINGW64__) + #include +#endif /******************************************************************************* * Function @@ -56,6 +59,10 @@ _CRITICAL void Luos_assert(char *file, uint32_t line) { // prepare a message as a node. // To do that we have to reset the service ID and clear PTP states to unlock others. + + #if (defined _WIN32) || (defined _WIN64) || (defined __linux__) || (defined __APPLE__) || (defined __unix__) || (defined __CYGWIN__) || (defined __MINGW32__) || (defined __MINGW64__) + printf("ASSERT: %s:%d\n", file, line); + #endif Luos_Init(); // completely reinit the allocator MsgAlloc_Init(NULL); From 288875b0f2168fb7d2f2c55d965b592ac735a8a0 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 25 Aug 2023 12:50:21 +0200 Subject: [PATCH 122/150] Add a trace print on Gate segfault to catch it one day perhaps. --- .../projects/native/gate_wscom/src/main.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/examples/projects/native/gate_wscom/src/main.c b/examples/projects/native/gate_wscom/src/main.c index 161e248b1..f6e5953fe 100644 --- a/examples/projects/native/gate_wscom/src/main.c +++ b/examples/projects/native/gate_wscom/src/main.c @@ -4,6 +4,12 @@ #include "gate.h" #include +#include +#include +#include +#include +#include + void *Gate_Pipe_LoopThread(void *vargp) { while (1) @@ -14,8 +20,23 @@ void *Gate_Pipe_LoopThread(void *vargp) return NULL; } +void handler(int sig) +{ + void *array[10]; + size_t size; + + // get void*'s for all entries on the stack + size = backtrace(array, 10); + + // print out all the frames to stderr + fprintf(stderr, "Error: signal %d:\n", sig); + backtrace_symbols_fd(array, size, STDERR_FILENO); + exit(1); +} + int main(void) { + signal(SIGSEGV, handler); // install our handler Luos_Init(); Serial_Init(); Pipe_Init(); From b4034baa87b999bbda8fe855f55b06195212ffe2 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 25 Aug 2023 11:22:38 +0200 Subject: [PATCH 123/150] Improve ST Serial reception by removing RX IRQ and improve function naming --- .../HAL/ARDUINO/serial_hal_config.h | 6 -- .../HAL/ARDUINO/serial_network_hal.cpp | 2 +- .../HAL/NATIVE/serial_network_hal.c | 2 +- .../HAL/STM32F0/serial_hal_config.h | 6 -- .../HAL/STM32F0/serial_network_hal.c | 65 ++++++----------- .../HAL/STM32F4/serial_hal_config.h | 6 -- .../HAL/STM32F4/serial_network_hal.c | 65 ++++++----------- .../HAL/STM32G431/serial_hal_config.h | 6 -- .../HAL/STM32G431/serial_network_hal.c | 71 +++++++------------ .../HAL/STM32G474/serial_hal_config.h | 6 -- .../HAL/STM32G474/serial_network_hal.c | 71 +++++++------------ .../HAL/STM32L4/serial_hal_config.h | 6 -- .../HAL/STM32L4/serial_network_hal.c | 65 ++++++----------- .../HAL/template/serial_hal_config.h | 6 -- .../HAL/template/serial_network_hal.c | 24 ++----- network/serial_network/inc/_serial_network.h | 4 +- network/serial_network/src/serial_network.c | 4 +- 17 files changed, 121 insertions(+), 294 deletions(-) diff --git a/network/serial_network/HAL/ARDUINO/serial_hal_config.h b/network/serial_network/HAL/ARDUINO/serial_hal_config.h index fe8d1d9dc..ecf7355c1 100644 --- a/network/serial_network/HAL/ARDUINO/serial_hal_config.h +++ b/network/serial_network/HAL/ARDUINO/serial_hal_config.h @@ -46,12 +46,6 @@ #ifndef SERIAL_COM #define SERIAL_COM USART3 #endif -#ifndef SERIAL_COM_IRQ - #define SERIAL_COM_IRQ USART3_4_IRQn -#endif -#ifndef SERIAL_COM_IRQHANDLER - #define SERIAL_COM_IRQHANDLER() USART3_4_IRQHandler() -#endif // RX DMA configuration #ifndef SERIAL_RX_DMA_CLOCK_ENABLE diff --git a/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp b/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp index fce11b2a1..a93dda83a 100644 --- a/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp +++ b/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp @@ -41,7 +41,7 @@ void SerialHAL_Loop(void) while (Serial.available() > 0) { data = Serial.read(); - Serial_ReceptionAdd(&data, 1); + Serial_ReceptionWrite(&data, 1); } } diff --git a/network/serial_network/HAL/NATIVE/serial_network_hal.c b/network/serial_network/HAL/NATIVE/serial_network_hal.c index 106417977..1a8d79cf3 100644 --- a/network/serial_network/HAL/NATIVE/serial_network_hal.c +++ b/network/serial_network/HAL/NATIVE/serial_network_hal.c @@ -297,7 +297,7 @@ void SerialHAL_Loop(void) #endif if (bytesRead > 0) { - Serial_ReceptionAdd((uint8_t *)recvData, (uint32_t)bytesRead); + Serial_ReceptionWrite((uint8_t *)recvData, (uint32_t)bytesRead); } } diff --git a/network/serial_network/HAL/STM32F0/serial_hal_config.h b/network/serial_network/HAL/STM32F0/serial_hal_config.h index 46ea253d2..a38ce9175 100644 --- a/network/serial_network/HAL/STM32F0/serial_hal_config.h +++ b/network/serial_network/HAL/STM32F0/serial_hal_config.h @@ -46,12 +46,6 @@ #ifndef SERIAL_COM_CLOCK_DISABLE #define SERIAL_COM USART3 #endif -#ifndef SERIAL_COM_IRQ - #define SERIAL_COM_IRQ USART3_4_IRQn -#endif -#ifndef SERIAL_COM_IRQHANDLER - #define SERIAL_COM_IRQHANDLER() USART3_4_IRQHandler() -#endif // RX DMA configuration #ifndef SERIAL_RX_DMA_CLOCK_ENABLE diff --git a/network/serial_network/HAL/STM32F0/serial_network_hal.c b/network/serial_network/HAL/STM32F0/serial_network_hal.c index 2d6f0832d..2bb2815cd 100644 --- a/network/serial_network/HAL/STM32F0/serial_network_hal.c +++ b/network/serial_network/HAL/STM32F0/serial_network_hal.c @@ -14,8 +14,6 @@ #include "stm32f0xx_ll_dma.h" #include "stm32f0xx_ll_system.h" - - /******************************************************************************* * Variables ******************************************************************************/ @@ -79,12 +77,6 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) ; LL_USART_Enable(SERIAL_COM); - LL_USART_ClearFlag_IDLE(SERIAL_COM); - LL_USART_EnableIT_IDLE(SERIAL_COM); - - HAL_NVIC_EnableIRQ(SERIAL_COM_IRQ); - HAL_NVIC_SetPriority(SERIAL_COM_IRQ, 1, 1); - RX_PrevPointerPosition = 0; __HAL_RCC_DMA1_CLK_ENABLE(); @@ -139,6 +131,27 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) ******************************************************************************/ void SerialHAL_Loop(void) { + uint16_t size = 0; + uint16_t RX_PointerPosition = 0; + if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) + { + return; + } + + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; + // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy + Serial_ReceptionIncrease(size); } /****************************************************************************** @@ -155,42 +168,6 @@ void SerialHAL_Send(uint8_t *data, uint16_t size) LL_DMA_EnableChannel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); } -/****************************************************************************** - * @brief RX Serial IRQ handler - * @param None - * @return None - ******************************************************************************/ -void SERIAL_COM_IRQHANDLER() -{ - uint16_t size = 0; - uint16_t RX_PointerPosition = 0; - - // check if we receive an IDLE on usart3 - if (LL_USART_IsActiveFlag_IDLE(SERIAL_COM)) - { - LL_USART_ClearFlag_IDLE(SERIAL_COM); - if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) - { - return; - } - - RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); - - if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow - { - SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); - size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; - } - else - { - size = RX_PointerPosition - RX_PrevPointerPosition; - } - RX_PrevPointerPosition = RX_PointerPosition; - // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy - Serial_ReceptionEnd(size); - } -} - /****************************************************************************** * @brief TX DMA IRQ handler * @param None diff --git a/network/serial_network/HAL/STM32F4/serial_hal_config.h b/network/serial_network/HAL/STM32F4/serial_hal_config.h index daa8fbf0f..afd509147 100644 --- a/network/serial_network/HAL/STM32F4/serial_hal_config.h +++ b/network/serial_network/HAL/STM32F4/serial_hal_config.h @@ -46,12 +46,6 @@ #ifndef SERIAL_COM #define SERIAL_COM USART2 #endif -#ifndef SERIAL_COM_IRQ - #define SERIAL_COM_IRQ USART2_IRQn -#endif -#ifndef SERIAL_COM_IRQHANDLER - #define SERIAL_COM_IRQHANDLER() USART2_IRQHandler() -#endif // RX DMA configuration #ifndef SERIAL_RX_DMA_CLOCK_ENABLE diff --git a/network/serial_network/HAL/STM32F4/serial_network_hal.c b/network/serial_network/HAL/STM32F4/serial_network_hal.c index 287710208..ff8da806a 100644 --- a/network/serial_network/HAL/STM32F4/serial_network_hal.c +++ b/network/serial_network/HAL/STM32F4/serial_network_hal.c @@ -15,8 +15,6 @@ #include "stm32f4xx_ll_system.h" #include "stm32f4xx_hal.h" - - /******************************************************************************* * Variables ******************************************************************************/ @@ -80,12 +78,6 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) ; LL_USART_Enable(SERIAL_COM); - LL_USART_ClearFlag_IDLE(SERIAL_COM); - LL_USART_EnableIT_IDLE(SERIAL_COM); - - HAL_NVIC_EnableIRQ(SERIAL_COM_IRQ); - HAL_NVIC_SetPriority(SERIAL_COM_IRQ, 1, 1); - RX_PrevPointerPosition = 0; /////////////////////////////// @@ -142,6 +134,27 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) ******************************************************************************/ void SerialHAL_Loop(void) { + uint16_t size = 0; + uint16_t RX_PointerPosition = 0; + if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) + { + return; + } + + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; + // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy + Serial_ReceptionIncrease(size); } /****************************************************************************** @@ -158,42 +171,6 @@ void SerialHAL_Send(uint8_t *data, uint16_t size) LL_DMA_EnableStream(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); } -/****************************************************************************** - * @brief RX Serial IRQ handler - * @param None - * @return None - ******************************************************************************/ -void SERIAL_COM_IRQHANDLER() -{ - uint16_t size = 0; - uint16_t RX_PointerPosition = 0; - - // check if we receive an IDLE on usart3 - if (LL_USART_IsActiveFlag_IDLE(SERIAL_COM)) - { - LL_USART_ClearFlag_IDLE(SERIAL_COM); - if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) - { - return; - } - - RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); - - if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow - { - SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); - size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; - } - else - { - size = RX_PointerPosition - RX_PrevPointerPosition; - } - RX_PrevPointerPosition = RX_PointerPosition; - // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy - Serial_ReceptionEnd(size); - } -} - /****************************************************************************** * @brief TX DMA IRQ handler * @param None diff --git a/network/serial_network/HAL/STM32G431/serial_hal_config.h b/network/serial_network/HAL/STM32G431/serial_hal_config.h index 78a6a096c..6bb47d578 100644 --- a/network/serial_network/HAL/STM32G431/serial_hal_config.h +++ b/network/serial_network/HAL/STM32G431/serial_hal_config.h @@ -46,12 +46,6 @@ #ifndef SERIAL_COM #define SERIAL_COM USART2 #endif -#ifndef SERIAL_COM_IRQ - #define SERIAL_COM_IRQ USART2_IRQn -#endif -#ifndef SERIAL_COM_IRQHANDLER - #define SERIAL_COM_IRQHANDLER() USART2_IRQHandler() -#endif // RX DMA configuration #ifndef SERIAL_RX_DMA_CLOCK_ENABLE diff --git a/network/serial_network/HAL/STM32G431/serial_network_hal.c b/network/serial_network/HAL/STM32G431/serial_network_hal.c index f296216d4..c53483b88 100644 --- a/network/serial_network/HAL/STM32G431/serial_network_hal.c +++ b/network/serial_network/HAL/STM32G431/serial_network_hal.c @@ -16,8 +16,6 @@ #include "stm32g4xx_ll_system.h" #include "stm32g4xx_hal.h" - - /******************************************************************************* * Variables ******************************************************************************/ @@ -83,12 +81,6 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) ; LL_USART_Enable(SERIAL_COM); - LL_USART_ClearFlag_IDLE(SERIAL_COM); - LL_USART_EnableIT_IDLE(SERIAL_COM); - - HAL_NVIC_EnableIRQ(SERIAL_COM_IRQ); - HAL_NVIC_SetPriority(SERIAL_COM_IRQ, 1, 1); - /////////////////////////////// // DMA SERIAL Init /////////////////////////////// @@ -142,6 +134,30 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) ******************************************************************************/ void SerialHAL_Loop(void) { + uint16_t size = 0; + uint16_t RX_PointerPosition = 0; + if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) + { + return; + } + + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; + if (size != 0) + { + // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy + Serial_ReceptionIncrease(size); + } } /****************************************************************************** @@ -158,45 +174,6 @@ void SerialHAL_Send(uint8_t *data, uint16_t size) LL_DMA_EnableChannel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); } -/****************************************************************************** - * @brief RX Serial IRQ handler - * @param None - * @return None - ******************************************************************************/ -void SERIAL_COM_IRQHANDLER() -{ - uint16_t size = 0; - uint16_t RX_PointerPosition = 0; - - // check if we receive an IDLE on usart3 - if (LL_USART_IsActiveFlag_IDLE(SERIAL_COM)) - { - LL_USART_ClearFlag_IDLE(SERIAL_COM); - if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) - { - return; - } - - RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); - - if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow - { - SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); - size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; - } - else - { - size = RX_PointerPosition - RX_PrevPointerPosition; - } - RX_PrevPointerPosition = RX_PointerPosition; - if (size != 0) - { - // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy - Serial_ReceptionEnd(size); - } - } -} - /****************************************************************************** * @brief TX DMA IRQ handler * @param None diff --git a/network/serial_network/HAL/STM32G474/serial_hal_config.h b/network/serial_network/HAL/STM32G474/serial_hal_config.h index 05243322f..ca12f7c62 100644 --- a/network/serial_network/HAL/STM32G474/serial_hal_config.h +++ b/network/serial_network/HAL/STM32G474/serial_hal_config.h @@ -46,12 +46,6 @@ #ifndef SERIAL_COM #define SERIAL_COM LPUART1 #endif -#ifndef SERIAL_COM_IRQ - #define SERIAL_COM_IRQ LPUART1_IRQn -#endif -#ifndef SERIAL_COM_IRQHANDLER - #define SERIAL_COM_IRQHANDLER() LPUART1_IRQHandler() -#endif // RX DMA configuration #ifndef SERIAL_RX_DMA_CLOCK_ENABLE diff --git a/network/serial_network/HAL/STM32G474/serial_network_hal.c b/network/serial_network/HAL/STM32G474/serial_network_hal.c index 2415e8111..9d411f880 100644 --- a/network/serial_network/HAL/STM32G474/serial_network_hal.c +++ b/network/serial_network/HAL/STM32G474/serial_network_hal.c @@ -16,8 +16,6 @@ #include "stm32g4xx_ll_system.h" #include "stm32g4xx_hal.h" - - /******************************************************************************* * Variables ******************************************************************************/ @@ -83,12 +81,6 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) ; LL_LPUART_Enable(SERIAL_COM); - LL_LPUART_ClearFlag_IDLE(SERIAL_COM); - LL_LPUART_EnableIT_IDLE(SERIAL_COM); - - HAL_NVIC_EnableIRQ(SERIAL_COM_IRQ); - HAL_NVIC_SetPriority(SERIAL_COM_IRQ, 1, 1); - /////////////////////////////// // DMA SERIAL Init /////////////////////////////// @@ -142,6 +134,30 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) ******************************************************************************/ void SerialHAL_Loop(void) { + uint16_t size = 0; + uint16_t RX_PointerPosition = 0; + if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) + { + return; + } + + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; + if (size != 0) + { + // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy + Serial_ReceptionIncrease(size); + } } /****************************************************************************** @@ -158,45 +174,6 @@ void SerialHAL_Send(uint8_t *data, uint16_t size) LL_DMA_EnableChannel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); } -/****************************************************************************** - * @brief RX Serial IRQ handler - * @param None - * @return None - ******************************************************************************/ -void SERIAL_COM_IRQHANDLER() -{ - uint16_t size = 0; - uint16_t RX_PointerPosition = 0; - - // check if we receive an IDLE on usart3 - if (LL_LPUART_IsActiveFlag_IDLE(SERIAL_COM)) - { - LL_LPUART_ClearFlag_IDLE(SERIAL_COM); - if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) - { - return; - } - - RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); - - if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow - { - SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); - size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; - } - else - { - size = RX_PointerPosition - RX_PrevPointerPosition; - } - RX_PrevPointerPosition = RX_PointerPosition; - if (size != 0) - { - // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy - Serial_ReceptionEnd(size); - } - } -} - /****************************************************************************** * @brief TX DMA IRQ handler * @param None diff --git a/network/serial_network/HAL/STM32L4/serial_hal_config.h b/network/serial_network/HAL/STM32L4/serial_hal_config.h index 4cce7927f..9b709d223 100644 --- a/network/serial_network/HAL/STM32L4/serial_hal_config.h +++ b/network/serial_network/HAL/STM32L4/serial_hal_config.h @@ -46,12 +46,6 @@ #ifndef SERIAL_COM #define SERIAL_COM USART2 #endif -#ifndef SERIAL_COM_IRQ - #define SERIAL_COM_IRQ USART2_IRQn -#endif -#ifndef SERIAL_COM_IRQHANDLER - #define SERIAL_COM_IRQHANDLER() USART2_IRQHandler() -#endif // RX DMA configuration #ifndef SERIAL_RX_DMA_CLOCK_ENABLE diff --git a/network/serial_network/HAL/STM32L4/serial_network_hal.c b/network/serial_network/HAL/STM32L4/serial_network_hal.c index f03f0c990..d0f78dc30 100644 --- a/network/serial_network/HAL/STM32L4/serial_network_hal.c +++ b/network/serial_network/HAL/STM32L4/serial_network_hal.c @@ -15,8 +15,6 @@ #include "stm32l4xx_ll_system.h" #include "stm32l4xx_hal.h" - - /******************************************************************************* * Variables ******************************************************************************/ @@ -80,12 +78,6 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) ; LL_USART_Enable(SERIAL_COM); - LL_USART_ClearFlag_IDLE(SERIAL_COM); - LL_USART_EnableIT_IDLE(SERIAL_COM); - - HAL_NVIC_EnableIRQ(SERIAL_COM_IRQ); - HAL_NVIC_SetPriority(SERIAL_COM_IRQ, 1, 1); - RX_PrevPointerPosition = 0; /////////////////////////////// @@ -141,6 +133,27 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) ******************************************************************************/ void SerialHAL_Loop(void) { + uint16_t size = 0; + uint16_t RX_PointerPosition = 0; + if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) + { + return; + } + + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); + + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; + // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy + Serial_ReceptionIncrease(size); } /****************************************************************************** @@ -157,42 +170,6 @@ void SerialHAL_Send(uint8_t *data, uint16_t size) LL_DMA_EnableChannel(SERIAL_TX_DMA, SERIAL_TX_DMA_CHANNEL); } -/****************************************************************************** - * @brief RX Serial IRQ handler - * @param None - * @return None - ******************************************************************************/ -void SERIAL_COM_IRQHANDLER() -{ - uint16_t size = 0; - uint16_t RX_PointerPosition = 0; - - // check if we receive an IDLE on usart3 - if (LL_USART_IsActiveFlag_IDLE(SERIAL_COM)) - { - LL_USART_ClearFlag_IDLE(SERIAL_COM); - if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) - { - return; - } - - RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); - - if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow - { - SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); - size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; - } - else - { - size = RX_PointerPosition - RX_PrevPointerPosition; - } - RX_PrevPointerPosition = RX_PointerPosition; - // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy - Serial_ReceptionEnd(size); - } -} - /****************************************************************************** * @brief TX DMA IRQ handler * @param None diff --git a/network/serial_network/HAL/template/serial_hal_config.h b/network/serial_network/HAL/template/serial_hal_config.h index d2f20f664..0f2b5595c 100644 --- a/network/serial_network/HAL/template/serial_hal_config.h +++ b/network/serial_network/HAL/template/serial_hal_config.h @@ -46,12 +46,6 @@ #ifndef SERIAL_COM #define SERIAL_COM USART #endif -#ifndef SERIAL_COM_IRQ - #define SERIAL_COM_IRQ USART_IRQn -#endif -#ifndef SERIAL_COM_IRQHANDLER - #define SERIAL_COM_IRQHANDLER() USART_IRQHandler() -#endif // RX DMA configuration #ifndef SERIAL_RX_DMA_CLOCK_ENABLE diff --git a/network/serial_network/HAL/template/serial_network_hal.c b/network/serial_network/HAL/template/serial_network_hal.c index 52ec051e7..e7cd032a4 100644 --- a/network/serial_network/HAL/template/serial_network_hal.c +++ b/network/serial_network/HAL/template/serial_network_hal.c @@ -35,8 +35,7 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) // TODO: Init the Serial TX DMA interface, use it in normal mode and make it raise an IRQ when finished. // TODO: Init RX pin with the given pin and port and set it as rx for the usart. Select the appropriate alternate function. - // TODO: Init the serial RX DMA interface to move RX bytes in the rx_buffer, use it in circular mode and make it loop on buffer_size. Do not make it raise an IRQ when finished. - // TODO: Enable the serial RX Idle IRQ to raise an interrupt when a the RX line is idle + // TODO: Init the serial RX DMA interface to move RX bytes in the rx_buffer, use it in circular mode and make it loop on buffer_size. Do not make it raise ayn IRQ. } /****************************************************************************** @@ -46,7 +45,9 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) ******************************************************************************/ void SerialHAL_Loop(void) { - // If you want to receive data here, you can. + // Here youhave to manage your received data, you choose between those function depending on your reception methods : + // - Write the received data into the buffer using Serial_ReceptionWrite function. This is usefull if your hardware have a dedicated buffer + // - Increse the reception pointer using Serial_ReceptionIncrease function. This is used if your hardware directly write into the rx_buffer } /****************************************************************************** @@ -60,23 +61,6 @@ void SerialHAL_Send(uint8_t *data, uint16_t size) // TODO: Start the DMA transfert to transmit data from data[0] to data[size] } -/****************************************************************************** - * @brief RX Serial IRQ handler - * @param None - * @return None - ******************************************************************************/ -void SERIAL_COM_IRQHANDLER(void) -{ - // Check if this IRQ is due to RX Idle - if (/*TODO: Check if this IRQ means that RX is Idle*/) - { - // TODO: Clear the RX idle IRQ flag - uint32_t received_data = rx_buffer_size - /* TODO: Get the size of the data received by the DMA*/; - // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy - Serial_ReceptionEnd(received_data); - } -} - /****************************************************************************** * @brief TX DMA IRQ handler * @param None diff --git a/network/serial_network/inc/_serial_network.h b/network/serial_network/inc/_serial_network.h index 118b9fbe6..fbeca4baa 100644 --- a/network/serial_network/inc/_serial_network.h +++ b/network/serial_network/inc/_serial_network.h @@ -12,7 +12,7 @@ #include "serial_config.h" void Serial_TransmissionEnd(void); -void Serial_ReceptionAdd(uint8_t *data, uint32_t size); -void Serial_ReceptionEnd(uint32_t size); +void Serial_ReceptionWrite(uint8_t *data, uint32_t size); +void Serial_ReceptionIncrease(uint32_t size); #endif /* __SERIAL_H_ */ diff --git a/network/serial_network/src/serial_network.c b/network/serial_network/src/serial_network.c index ea72e2a12..3eeaf512a 100644 --- a/network/serial_network/src/serial_network.c +++ b/network/serial_network/src/serial_network.c @@ -358,7 +358,7 @@ _CRITICAL void Serial_Send(void) * @param size size of the data * @return None *****************************************************************************/ -_CRITICAL void Serial_ReceptionAdd(uint8_t *data, uint32_t size) +_CRITICAL void Serial_ReceptionWrite(uint8_t *data, uint32_t size) { if (rx_size == 0) { @@ -390,7 +390,7 @@ _CRITICAL void Serial_ReceptionAdd(uint8_t *data, uint32_t size) * @param None * @return None ******************************************************************************/ -_CRITICAL void Serial_ReceptionEnd(uint32_t size) +_CRITICAL void Serial_ReceptionIncrease(uint32_t size) { // Reception is finished, we can parse the message rx_size += size; From 1dae1354039ea9a2aa7a5886fd2798fa54162e94 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 25 Aug 2023 12:56:21 +0200 Subject: [PATCH 124/150] Remove telemetry --- README.md | 4 -- .../robus_network/robus_select_hal_script.py | 1 + source_filter_script.py | 41 ------------------- 3 files changed, 1 insertion(+), 45 deletions(-) diff --git a/README.md b/README.md index 93f1e731f..933a318eb 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,3 @@ Luos proposes organized and effective development practices, guaranteeing develo * → Try on your own with the [get started](https://www.luos.io/tutorials/get-started) * → Consult the full [documentation](https://www.luos.io/docs) - -## Disclaimer -Using Platformio, this library compilation send some anonymous information to Luos allowing to improve Luos_engine experience. -To disable the telemetry please add "-DNOTELEMETRY" as a compilation flag on your platformio.ini file. diff --git a/network/robus_network/robus_select_hal_script.py b/network/robus_network/robus_select_hal_script.py index ced9b644f..f2b58fcd1 100644 --- a/network/robus_network/robus_select_hal_script.py +++ b/network/robus_network/robus_select_hal_script.py @@ -5,6 +5,7 @@ from os.path import join, realpath Import('env') +click.secho("") click.secho("Robus network build configuration:", underline=True) # Find the appropriate hal find_HAL = False diff --git a/source_filter_script.py b/source_filter_script.py index 2ae3fbbbd..dec404727 100644 --- a/source_filter_script.py +++ b/source_filter_script.py @@ -10,24 +10,6 @@ from os.path import join, realpath Import("env") -telemetry = True -luos_telemetry = {"telemetry_type": "luos_engine_build", - "mac": hex(uuid.getnode()), - "system": sys.platform, - "unix_time": env.get("UNIX_TIME"), - "platform": env.get("PIOPLATFORM"), - "project_path": env.get("PROJECT_DIR")} - -if (env.get("BOARD_MCU") != None): - luos_telemetry["mcu"] = env.get("BOARD_MCU") -if (env.get("BOARD_F_CPU") != None): - luos_telemetry["f_cpu"] = env.get("BOARD_F_CPU") - -try: - luos_telemetry["framework"] = env.get("PIOFRAMEWORK")[0] -except: - pass - # Check if this script have been already executed during this compilation visited_key = "__LUOS_CORE_SCRIPT_CALLED" global_env = DefaultEnvironment() @@ -47,11 +29,9 @@ from pyluos import version click.secho("\t* Pyluos revision " + str(version.version) + " ready.", fg="green") - luos_telemetry["pyluos_rev"] = str(version.version) except ImportError: # module doesn't exist, deal with it. click.secho( "\t* Pyluos install failed. Platformio will be unable to use bootloader flash feature.", fg="red") - luos_telemetry["pyluos_rev"] = "none" sources = ["+<*.c>", "+<../../IO/src/*.c>", @@ -72,7 +52,6 @@ if not visited_key in global_env: click.secho( "\t* %s HAL selected for luos_engine." % item[1], fg="green") - luos_telemetry["luos_hal"] = item[1] if (path.exists("engine/HAL/" + item[1] + "/hal_script.py")): # This is an extra script dedicated to this HAL, run it hal_script_path = realpath( @@ -81,28 +60,8 @@ else: if not visited_key in global_env: click.secho("\t* %s HAL not found" % item[1], fg="red") - luos_telemetry["luos_hal"] = "invalid" + str(item[1]) env.Append(CPPPATH=[realpath("engine/HAL/" + item[1])]) env.Append(SRC_FILTER=["+<../../HAL/%s/*.c>" % item[1]]) - if (item == 'NOTELEMETRY'): - telemetry = False - - -if not visited_key in global_env: - if (telemetry == True): - click.secho("\t* Telemetry enabled.", fg="green") - try: - r = requests.post("https://monorepo-services.vercel.app/api/telemetry", - data=luos_telemetry) - if not r: - click.secho("\tX Telemetry request failed : error " + - str(r.status_code), fg="red") - except: - click.secho("\tX Telemetry request failed.", fg="red") - else: - click.secho( - "\t* Telemetry disabled, please consider enabling it by removing the 'NOTELEMETRY' flag to help Luos_engine improve.", fg="red") - click.secho("") # Native only => we should put this on a specific script on engine/HAL/STUB for item in env.ParseFlags(env['BUILD_FLAGS'])["CPPDEFINES"]: From db3424529d5123c9c429854f6560c51379affe99 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 25 Aug 2023 15:36:44 +0200 Subject: [PATCH 125/150] Manage multi-message in one Serial burst --- network/serial_network/src/serial_network.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/network/serial_network/src/serial_network.c b/network/serial_network/src/serial_network.c index 3eeaf512a..4c428c77a 100644 --- a/network/serial_network/src/serial_network.c +++ b/network/serial_network/src/serial_network.c @@ -276,6 +276,12 @@ void Serial_Loop(void) phy_serial->rx_buffer_base = rx_buffer_base_bkp; // The message have been consumed, we can move the rx buffer pointer Serial_MoveRxPtr(header.size + 1); + // If we still have data in the buffer after this message we need to move the phy_serial->rx_timestamp accordingly allowing the next message to be correctly timed. + if (rx_size > 0) + { + // Add to the original timestamp value the time needed to receive all the bytes of the current message. + phy_serial->rx_timestamp += (header.size + sizeof(SerialHeader_t) + 1) * (uint32_t)10 * (uint32_t)1000000000 / (uint32_t)SERIAL_NETWORK_BAUDRATE; + } } } } From a9af94360b004b608db0c8843a87ea435adaf0db Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 25 Aug 2023 16:34:33 +0200 Subject: [PATCH 126/150] Allow synchronized nodes to manage timestamping without any differential computation, fix #444 --- engine/IO/inc/luos_phy.h | 7 ++-- engine/IO/inc/struct_phy.h | 1 + engine/IO/src/luos_phy.c | 23 +++++++++++-- network/robus_network/src/transmission.c | 2 +- network/serial_network/src/serial_network.c | 2 +- test/tests_io/test_phy/main.c | 36 ++++++++++++++------- 6 files changed, 53 insertions(+), 18 deletions(-) diff --git a/engine/IO/inc/luos_phy.h b/engine/IO/inc/luos_phy.h index 590372dc4..e93471dd3 100644 --- a/engine/IO/inc/luos_phy.h +++ b/engine/IO/inc/luos_phy.h @@ -32,6 +32,7 @@ extern "C" // Phy creation luos_phy_t *Phy_Create(JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY reset_phy); // Use it to reference your phy to Luos. + void Phy_DisableSynchro(luos_phy_t *phy_ptr); // Use it to disable the luos synchronisation mechanism with this phy. // Topology management void Phy_TopologyNext(void); // Use it to find the next node that need to be detected accross phys. @@ -44,9 +45,9 @@ extern "C" void Phy_ResetMsg(luos_phy_t *phy_ptr); // Call this function to reset the rx process. // Tx management - time_luos_t Phy_ComputeMsgTimestamp(phy_job_t *job); // Use it to compute the timestamp of the message to send. - uint64_t Phy_GetTimestamp(void); // Use it to get the current timestamp in ns. - uint16_t Phy_GetNodeId(void); // Use it to get your current node id. (This can be used to compute priority or controled latency avoiding infinite collision condition) + time_luos_t Phy_ComputeMsgTimestamp(luos_phy_t *phy_ptr, phy_job_t *job); // Use it to compute the timestamp of the message to send. + uint64_t Phy_GetTimestamp(void); // Use it to get the current timestamp in ns. + uint16_t Phy_GetNodeId(void); // Use it to get your current node id. (This can be used to compute priority or controled latency avoiding infinite collision condition) // Job management void Phy_FailedJob(luos_phy_t *phy_ptr, phy_job_t *job); // If some messages failed to be sent, call this function to consider the target as dead diff --git a/engine/IO/inc/struct_phy.h b/engine/IO/inc/struct_phy.h index a11226a72..8dfa2e4b2 100644 --- a/engine/IO/inc/struct_phy.h +++ b/engine/IO/inc/struct_phy.h @@ -61,6 +61,7 @@ typedef struct luos_phy_t volatile uint8_t rx_alloc_job : 1; // If true, Luosio_Loop funciton will need to filter already received data, if filter is ok, set rx_keep, alloc needed space, move *rx_data to point at the good place on allocator, put the number of bytes remaining on rx_size, and copy already received data in the allocated space. volatile uint8_t rx_keep : 1; // True if we want to keep the received data. volatile uint8_t rx_ack : 1; // True if we need to generate an acknoledgement for this message. + uint8_t enable_synchro : 1; // True if we want Luos to manage time synchronisation for this phy. }; // *** RX Private data *** diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 86d76afef..b0404564f 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -431,10 +431,22 @@ luos_phy_t *Phy_Get(uint8_t id, JOB_CB job_cb, RUN_TOPO run_topo, RESET_PHY rese phy_ctx.phy[id].run_topo = run_topo; phy_ctx.phy[id].reset_phy = reset_phy; phy_ctx.phy[id].job_nb = 0; + // By default enable synchronisation for all phys + phy_ctx.phy[id].enable_synchro = true; // Return the phy pointer return &phy_ctx.phy[id]; } +/****************************************************************************** + * @brief Disable synchronisation for a specific phy. Use it if your network already manage synchronisation. + * @param phy_ptr pointer on the phy we want to disable synchronisation + * @return None + ******************************************************************************/ +void Phy_DisableSynchro(luos_phy_t *phy_ptr) +{ + phy_ptr->enable_synchro = false; +} + /****************************************************************************** * @brief return a local physical layer pointer (only used by LuosIO, this function is private) * @param id of the phy we want @@ -694,9 +706,16 @@ _CRITICAL void Phy_ResetMsg(luos_phy_t *phy_ptr) * @param job Pointer to the job concerned by this message * @return None ******************************************************************************/ -time_luos_t Phy_ComputeMsgTimestamp(phy_job_t *job) +time_luos_t Phy_ComputeMsgTimestamp(luos_phy_t *phy_ptr, phy_job_t *job) { - LUOS_ASSERT((job != NULL) && (job->msg_pt != NULL) && (job->timestamp == true)); + LUOS_ASSERT((job != NULL) && (job->msg_pt != NULL) && (job->timestamp == true) && (phy_ptr != NULL)); + if (phy_ptr->enable_synchro == false) + { + // We don't want to synchronize this phy, just return the timestamp + time_luos_t timestamp_date; + memcpy(×tamp_date, &job->msg_pt->data[job->msg_pt->header.size], sizeof(time_luos_t)); + return timestamp_date; + } return Timestamp_ConvertToLatency(job->msg_pt); } diff --git a/network/robus_network/src/transmission.c b/network/robus_network/src/transmission.c index c1b463ac8..1e4498fb8 100644 --- a/network/robus_network/src/transmission.c +++ b/network/robus_network/src/transmission.c @@ -187,7 +187,7 @@ _CRITICAL void Transmit_Process() { // Convert date to a sendable timestamp and put it on the encapsulation - jobEncaps->timestamp = Phy_ComputeMsgTimestamp(job); + jobEncaps->timestamp = Phy_ComputeMsgTimestamp(robus_phy, job); jobEncaps->timestamped_crc = ll_crc_compute(jobEncaps->unmaped, sizeof(time_luos_t), crc_val); jobEncaps->size = sizeof(time_luos_t) + CRC_SIZE; diff --git a/network/serial_network/src/serial_network.c b/network/serial_network/src/serial_network.c index 4c428c77a..42955246a 100644 --- a/network/serial_network/src/serial_network.c +++ b/network/serial_network/src/serial_network.c @@ -344,7 +344,7 @@ _CRITICAL void Serial_Send(void) if (job->timestamp) { // Convert date to a sendable timestamp and put it in the end of the message - time_luos_t timestamp = Phy_ComputeMsgTimestamp(job); + time_luos_t timestamp = Phy_ComputeMsgTimestamp(phy_serial, job); memcpy(&TX_data[sizeof(SerialHeader_t) + job->size - +sizeof(timestamp)], ×tamp, sizeof(time_luos_t)); TX_data[sizeof(SerialHeader_t) + job->size] = SERIAL_FOOTER; } diff --git a/test/tests_io/test_phy/main.c b/test/tests_io/test_phy/main.c index 2305e40a2..2ba19b3f3 100644 --- a/test/tests_io/test_phy/main.c +++ b/test/tests_io/test_phy/main.c @@ -699,7 +699,7 @@ void unittest_phy_ComputeHeader() { phy_test_reset(); // Create a fake service with id 1 - Phy_AddLocalServices(1, 1); + Phy_AddLocalServices(1, 1); msg_t msg; msg.header.config = BASE_PROTOCOL; @@ -740,7 +740,7 @@ void unittest_phy_ComputeHeader() { phy_test_reset(); // Create a fake service with id 1 - Phy_AddLocalServices(1, 1); + Phy_AddLocalServices(1, 1); msg_t msg; msg.header.config = TIMESTAMP_PROTOCOL; @@ -781,7 +781,7 @@ void unittest_phy_ComputeHeader() { phy_test_reset(); // Create a fake service with id 1 - Phy_AddLocalServices(1, 1); + Phy_AddLocalServices(1, 1); msg_t msg; msg.header.config = BASE_PROTOCOL; @@ -822,7 +822,7 @@ void unittest_phy_ComputeHeader() { phy_test_reset(); // Create a fake service with id 1 - Phy_AddLocalServices(1, 1); + Phy_AddLocalServices(1, 1); msg_t msg; msg.header.config = TIMESTAMP_PROTOCOL; @@ -863,7 +863,7 @@ void unittest_phy_ComputeHeader() { phy_test_reset(); // Create a fake service with id 1 - Phy_AddLocalServices(1, 1); + Phy_AddLocalServices(1, 1); msg_t msg; msg.header.config = TIMESTAMP_PROTOCOL; @@ -903,7 +903,7 @@ void unittest_phy_ComputeHeader() { phy_test_reset(); // Create a fake service with id 1 - Phy_AddLocalServices(1, 1); + Phy_AddLocalServices(1, 1); msg_t msg; msg.header.config = TIMESTAMP_PROTOCOL; @@ -1066,7 +1066,16 @@ void unittest_phy_ComputeTimestamp() { TRY { - Phy_ComputeMsgTimestamp(NULL); + phy_job_t job; + Phy_ComputeMsgTimestamp(NULL, &job); + } + TEST_ASSERT_TRUE(IS_ASSERT()); + END_TRY; + + TRY + { + luos_phy phy; + Phy_ComputeMsgTimestamp(luos_phy, NULL); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -1076,7 +1085,7 @@ void unittest_phy_ComputeTimestamp() phy_job_t job; job.timestamp = false; job.data_pt = (uint8_t *)msg_buffer; - Phy_ComputeMsgTimestamp(&job); + Phy_ComputeMsgTimestamp(luos_phy, &job); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -1086,7 +1095,7 @@ void unittest_phy_ComputeTimestamp() phy_job_t job; job.timestamp = true; job.data_pt = NULL; - Phy_ComputeMsgTimestamp(&job); + Phy_ComputeMsgTimestamp(luos_phy, &job); } TEST_ASSERT_TRUE(IS_ASSERT()); END_TRY; @@ -1115,11 +1124,16 @@ void unittest_phy_ComputeTimestamp() volatile time_luos_t timestamp = TimeOD_TimeFrom_ns(10); memcpy(&msg->data[msg->header.size], (void *)×tamp, sizeof(time_luos_t)); - volatile time_luos_t resulting_latency = Phy_ComputeMsgTimestamp(&job); + volatile time_luos_t resulting_latency = Phy_ComputeMsgTimestamp(luos_phy, &job); - TEST_ASSERT_EQUAL(0xAE, job.msg_pt->data[0]); #ifndef _WIN32 TEST_ASSERT_NOT_EQUAL(TimeOD_TimeTo_ns(timestamp), TimeOD_TimeTo_ns(resulting_latency)); +#endif + Phy_DisableSynchro(luos_phy); + resulting_latency = Phy_ComputeMsgTimestamp(luos_phy, &job); + +#ifndef _WIN32 + TEST_ASSERT_EQUAL(TimeOD_TimeTo_ns(timestamp), TimeOD_TimeTo_ns(resulting_latency)); #endif } CATCH From e25326c465e16290711c4df090c59ae4f3ec6a8a Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 28 Aug 2023 18:17:06 +0200 Subject: [PATCH 127/150] [OD] rename the `_private` var into `raw` to explicitely allow users to perform calculations with `raw` instead of converting it each time. --- engine/OD/od_angular.h | 32 +++++----- engine/OD/od_electric.h | 30 +++++----- engine/OD/od_force.h | 52 ++++++++-------- engine/OD/od_illuminance.h | 6 +- engine/OD/od_linear.h | 60 +++++++++---------- engine/OD/od_pressure.h | 16 ++--- engine/OD/od_ratio.h | 6 +- engine/OD/od_temperature.h | 14 ++--- engine/core/inc/time_luos.h | 30 +++++----- test/tests_core/tests_od/test_angular/main.c | 22 +++---- test/tests_core/tests_od/test_electric/main.c | 24 ++++---- test/tests_core/tests_od/test_force/main.c | 32 +++++----- .../tests_od/test_illuminance/main.c | 6 +- test/tests_core/tests_od/test_linear/main.c | 36 +++++------ test/tests_core/tests_od/test_pressure/main.c | 10 ++-- test/tests_core/tests_od/test_ratio/main.c | 6 +- .../tests_od/test_temperature/main.c | 10 ++-- test/tests_core/tests_od/test_time/main.c | 18 +++--- 18 files changed, 205 insertions(+), 205 deletions(-) diff --git a/engine/OD/od_angular.h b/engine/OD/od_angular.h index c5c196726..e2e607cfd 100644 --- a/engine/OD/od_angular.h +++ b/engine/OD/od_angular.h @@ -13,12 +13,12 @@ ******************************************************************************/ typedef struct { - float _private; + float raw; } angular_position_t; typedef struct { - float _private; + float raw; } angular_speed_t; /******************************************************************************* @@ -34,39 +34,39 @@ typedef struct // deg static inline float AngularOD_PositionTo_deg(angular_position_t self) { - return self._private; + return self.raw; } static inline angular_position_t AngularOD_PositionFrom_deg(float deg) { angular_position_t self; - self._private = deg; + self.raw = deg; return self; } // rev static inline float AngularOD_PositionTo_rev(angular_position_t self) { - return self._private / 360.0f; + return self.raw / 360.0f; } static inline angular_position_t AngularOD_PositionFrom_rev(float rev) { angular_position_t self; - self._private = rev * 360.0f; + self.raw = rev * 360.0f; return self; } // rad static inline float AngularOD_PositionTo_rad(angular_position_t self) { - return (self._private * 2.0f * 3.141592653589793f) / 360.0f; + return (self.raw * 2.0f * 3.141592653589793f) / 360.0f; } static inline angular_position_t AngularOD_PositionFrom_rad(float rad) { angular_position_t self; - self._private = (rad * 360.0f) / (2.0f * 3.141592653589793f); + self.raw = (rad * 360.0f) / (2.0f * 3.141592653589793f); return self; } @@ -93,52 +93,52 @@ static inline void AngularOD_PositionFromMsg(angular_position_t *const self, con // deg_s static inline float AngularOD_SpeedTo_deg_s(angular_speed_t self) { - return self._private; + return self.raw; } static inline angular_speed_t AngularOD_SpeedFrom_deg_s(float deg) { angular_speed_t self; - self._private = deg; + self.raw = deg; return self; } // rev_s static inline float AngularOD_SpeedTo_rev_s(angular_speed_t self) { - return self._private / 360.0f; + return self.raw / 360.0f; } static inline angular_speed_t AngularOD_SpeedFrom_rev_s(float rev_s) { angular_speed_t self; - self._private = rev_s * 360.0f; + self.raw = rev_s * 360.0f; return self; } // rev_min static inline float AngularOD_SpeedTo_rev_min(angular_speed_t self) { - return self._private * 60.0f / 360.0f; + return self.raw * 60.0f / 360.0f; } static inline angular_speed_t AngularOD_SpeedFrom_rev_min(float rev_min) { angular_speed_t self; - self._private = rev_min * 360.0f / 60.0f; + self.raw = rev_min * 360.0f / 60.0f; return self; } // rad_s static inline float AngularOD_SpeedTo_rad_s(angular_speed_t self) { - return (self._private * 2.0f * 3.141592653589793f) / 360.0f; + return (self.raw * 2.0f * 3.141592653589793f) / 360.0f; } static inline angular_speed_t AngularOD_SpeedFrom_rad_s(float rad_s) { angular_speed_t self; - self._private = (rad_s * 360.0f) / (2.0f * 3.141592653589793f); + self.raw = (rad_s * 360.0f) / (2.0f * 3.141592653589793f); return self; } diff --git a/engine/OD/od_electric.h b/engine/OD/od_electric.h index ee166a140..d125c6f50 100644 --- a/engine/OD/od_electric.h +++ b/engine/OD/od_electric.h @@ -13,17 +13,17 @@ ******************************************************************************/ typedef struct { - float _private; + float raw; } voltage_t; typedef struct { - float _private; + float raw; } current_t; typedef struct { - float _private; + float raw; } power_t; /******************************************************************************* * Variables @@ -38,26 +38,26 @@ typedef struct // mv static inline float ElectricOD_VoltageTo_mV(voltage_t self) { - return self._private * 1000.0f; + return self.raw * 1000.0f; } static inline voltage_t ElectricOD_VoltageFrom_mV(float mv) { voltage_t self; - self._private = mv / 1000.0f; + self.raw = mv / 1000.0f; return self; } // v static inline float ElectricOD_VoltageTo_V(voltage_t self) { - return self._private; + return self.raw; } static inline voltage_t ElectricOD_VoltageFrom_V(float v) { voltage_t self; - self._private = v; + self.raw = v; return self; } @@ -84,26 +84,26 @@ static inline void ElectricOD_VoltageFromMsg(voltage_t *const self, const msg_t // ma static inline float ElectricOD_CurrentTo_mA(current_t self) { - return self._private * 1000.0f; + return self.raw * 1000.0f; } static inline current_t ElectricOD_CurrentFrom_mA(float ma) { current_t self; - self._private = ma / 1000.0f; + self.raw = ma / 1000.0f; return self; } // A static inline float ElectricOD_CurrentTo_A(current_t self) { - return self._private; + return self.raw; } static inline current_t ElectricOD_CurrentFrom_A(float a) { current_t self; - self._private = a; + self.raw = a; return self; } @@ -130,26 +130,26 @@ static inline void ElectricOD_CurrentFromMsg(current_t *const self, const msg_t // mw static inline float ElectricOD_PowerTo_mW(power_t self) { - return self._private * 1000.0f; + return self.raw * 1000.0f; } static inline power_t ElectricOD_PowerFrom_mW(float mw) { power_t self; - self._private = mw / 1000.0f; + self.raw = mw / 1000.0f; return self; } // A static inline float ElectricOD_PowerTo_W(power_t self) { - return self._private; + return self.raw; } static inline power_t ElectricOD_PowerFrom_W(float w) { power_t self; - self._private = w; + self.raw = w; return self; } diff --git a/engine/OD/od_force.h b/engine/OD/od_force.h index ad76fddc4..070cc1317 100644 --- a/engine/OD/od_force.h +++ b/engine/OD/od_force.h @@ -13,12 +13,12 @@ ******************************************************************************/ typedef struct { - float _private; + float raw; } moment_t; typedef struct { - float _private; + float raw; } force_t; /******************************************************************************* * Variables @@ -34,104 +34,104 @@ typedef struct // N.mm static inline float ForceOD_MomentTo_N_mm(moment_t self) { - return self._private * 1000.0f; + return self.raw * 1000.0f; } static inline moment_t ForceOD_MomentFrom_N_mm(float n_mm) { moment_t self; - self._private = n_mm / 1000.0f; + self.raw = n_mm / 1000.0f; return self; } // N.cm static inline float ForceOD_MomentTo_N_cm(moment_t self) { - return self._private * 100.0f; + return self.raw * 100.0f; } static inline moment_t ForceOD_MomentFrom_N_cm(float n_cm) { moment_t self; - self._private = n_cm / 100.0f; + self.raw = n_cm / 100.0f; return self; } // N.m static inline float ForceOD_MomentTo_N_m(moment_t self) { - return self._private; + return self.raw; } static inline moment_t ForceOD_MomentFrom_N_m(float n_m) { moment_t self; - self._private = n_m; + self.raw = n_m; return self; } // kgf.mm static inline float ForceOD_MomentTo_kgf_mm(moment_t self) { - return self._private * 101.97f; + return self.raw * 101.97f; } static inline moment_t ForceOD_MomentFrom_kgf_mm(float kgf_mm) { moment_t self; - self._private = kgf_mm / 101.97f; + self.raw = kgf_mm / 101.97f; return self; } // kgf.cm static inline float ForceOD_MomentTo_kgf_cm(moment_t self) { - return self._private * 10.2f; + return self.raw * 10.2f; } static inline moment_t ForceOD_MomentFrom_kgf_cm(float kgf_cm) { moment_t self; - self._private = kgf_cm / 10.2f; + self.raw = kgf_cm / 10.2f; return self; } // kgf.m static inline float ForceOD_MomentTo_kgf_m(moment_t self) { - return self._private * 0.102f; + return self.raw * 0.102f; } static inline moment_t ForceOD_MomentFrom_kgf_m(float kgf_m) { moment_t self; - self._private = kgf_m / 0.102f; + self.raw = kgf_m / 0.102f; return self; } // ozf.in static inline float ForceOD_MomentTo_ozf_in(moment_t self) { - return self._private * 141.612f; + return self.raw * 141.612f; } static inline moment_t ForceOD_MomentFrom_ozf_in(float ozf_in) { moment_t self; - self._private = ozf_in / 141.612f; + self.raw = ozf_in / 141.612f; return self; } // lbf.in static inline float ForceOD_MomentTo_lbf_in(moment_t self) { - return self._private * 8.851f; + return self.raw * 8.851f; } static inline moment_t ForceOD_MomentFrom_lbf_in(float lbf_in) { moment_t self; - self._private = lbf_in / 8.851f; + self.raw = lbf_in / 8.851f; return self; } @@ -158,52 +158,52 @@ static inline void ForceOD_MomentFromMsg(moment_t *const self, const msg_t *cons // N static inline float ForceOD_ForceTo_N(force_t self) { - return self._private; + return self.raw; } static inline force_t ForceOD_ForceFrom_N(float n) { force_t self; - self._private = n; + self.raw = n; return self; } // kgf static inline float ForceOD_ForceTo_kgf(force_t self) { - return self._private * 0.102f; + return self.raw * 0.102f; } static inline force_t ForceOD_ForceFrom_kgf(float kgf) { force_t self; - self._private = kgf / 0.102f; + self.raw = kgf / 0.102f; return self; } // ozf static inline float ForceOD_ForceTo_ozf(force_t self) { - return self._private * 3.5969430896f; + return self.raw * 3.5969430896f; } static inline force_t ForceOD_ForceFrom_ozf(float ozf) { force_t self; - self._private = ozf / 3.5969430896f; + self.raw = ozf / 3.5969430896f; return self; } // lbf static inline float ForceOD_ForceTo_lbf(force_t self) { - return self._private * 0.2248089431f; + return self.raw * 0.2248089431f; } static inline force_t ForceOD_ForceFrom_lbf(float lbf) { force_t self; - self._private = lbf / 0.2248089431f; + self.raw = lbf / 0.2248089431f; return self; } diff --git a/engine/OD/od_illuminance.h b/engine/OD/od_illuminance.h index 210fbf1ec..2e06d06f1 100644 --- a/engine/OD/od_illuminance.h +++ b/engine/OD/od_illuminance.h @@ -13,7 +13,7 @@ ******************************************************************************/ typedef struct { - float _private; + float raw; } illuminance_t; // GPIO struct @@ -44,13 +44,13 @@ typedef struct __attribute__((__packed__)) // lx static inline float IlluminanceOD_IlluminanceTo_Lux(illuminance_t self) { - return self._private; + return self.raw; } static inline illuminance_t IlluminanceOD_IlluminanceFrom_Lux(float lx) { illuminance_t self; - self._private = lx; + self.raw = lx; return self; } diff --git a/engine/OD/od_linear.h b/engine/OD/od_linear.h index b25e9f517..6428f9be3 100644 --- a/engine/OD/od_linear.h +++ b/engine/OD/od_linear.h @@ -14,12 +14,12 @@ ******************************************************************************/ typedef struct { - float _private; + float raw; } linear_position_t; typedef struct { - float _private; + float raw; } linear_speed_t; /******************************************************************************* @@ -35,117 +35,117 @@ typedef struct // nm static inline float LinearOD_PositionTo_nm(linear_position_t self) { - return self._private * 1000000000.0f; + return self.raw * 1000000000.0f; } static inline linear_position_t LinearOD_PositionFrom_nm(float nm) { linear_position_t self; - self._private = nm / 1000000000.0f; + self.raw = nm / 1000000000.0f; return self; } // um static inline float LinearOD_PositionTo_um(linear_position_t self) { - return self._private * 1000000.0f; + return self.raw * 1000000.0f; } static inline linear_position_t LinearOD_PositionFrom_um(float um) { linear_position_t self; - self._private = um / 1000000.0f; + self.raw = um / 1000000.0f; return self; } // mm static inline float LinearOD_PositionTo_mm(linear_position_t self) { - return self._private * 1000.0f; + return self.raw * 1000.0f; } static inline linear_position_t LinearOD_PositionFrom_mm(float mm) { linear_position_t self; - self._private = mm / 1000.0f; + self.raw = mm / 1000.0f; return self; } // cm static inline float LinearOD_PositionTo_cm(linear_position_t self) { - return self._private * 100.0f; + return self.raw * 100.0f; } static inline linear_position_t LinearOD_PositionFrom_cm(float cm) { linear_position_t self; - self._private = cm / 100.0f; + self.raw = cm / 100.0f; return self; } // m static inline float LinearOD_PositionTo_m(linear_position_t self) { - return self._private; + return self.raw; } static inline linear_position_t LinearOD_PositionFrom_m(float m) { linear_position_t self; - self._private = m; + self.raw = m; return self; } // km static inline float LinearOD_PositionTo_km(linear_position_t self) { - return self._private / 1000.0f; + return self.raw / 1000.0f; } static inline linear_position_t LinearOD_PositionFrom_km(float km) { linear_position_t self; - self._private = km * 1000.0f; + self.raw = km * 1000.0f; return self; } // inch static inline float LinearOD_PositionTo_in(linear_position_t self) { - return self._private * 39.37007874015748f; + return self.raw * 39.37007874015748f; } static inline linear_position_t LinearOD_PositionFrom_in(float in) { linear_position_t self; - self._private = in / 39.37007874015748f; + self.raw = in / 39.37007874015748f; return self; } // foot static inline float LinearOD_PositionTo_ft(linear_position_t self) { - return self._private * 3.28084f; + return self.raw * 3.28084f; } static inline linear_position_t LinearOD_PositionFrom_ft(float ft) { linear_position_t self; - self._private = ft / 3.28084f; + self.raw = ft / 3.28084f; return self; } // mile static inline float LinearOD_PositionTo_mi(linear_position_t self) { - return self._private / 1609.344f; + return self.raw / 1609.344f; } static inline linear_position_t LinearOD_PositionFrom_mi(float mi) { linear_position_t self; - self._private = mi * 1609.344f; + self.raw = mi * 1609.344f; return self; } @@ -172,66 +172,66 @@ static inline void LinearOD_PositionFromMsg(linear_position_t *const self, const // mm_s static inline float LinearOD_SpeedTo_mm_s(linear_speed_t self) { - return self._private * 1000.0f; + return self.raw * 1000.0f; } static inline linear_speed_t LinearOD_SpeedFrom_mm_s(float mm_s) { linear_speed_t self; - self._private = mm_s / 1000.0f; + self.raw = mm_s / 1000.0f; return self; } // m_s static inline float LinearOD_SpeedTo_m_s(linear_speed_t self) { - return self._private; + return self.raw; } static inline linear_speed_t LinearOD_SpeedFrom_m_s(float m_s) { linear_speed_t self; - self._private = m_s; + self.raw = m_s; return self; } // km_h static inline float LinearOD_SpeedTo_km_h(linear_speed_t self) { - return (self._private * 3600.0f) / 1000.0f; + return (self.raw * 3600.0f) / 1000.0f; } static inline linear_speed_t LinearOD_SpeedFrom_km_h(float km_h) { linear_speed_t self; - self._private = (km_h * 1000.0f) / 3600.0f; + self.raw = (km_h * 1000.0f) / 3600.0f; return self; } // in_s static inline float LinearOD_SpeedTo_in_s(linear_speed_t self) { - return self._private * 39.37007874015748; + return self.raw * 39.37007874015748; } static inline linear_speed_t LinearOD_SpeedFrom_in_s(float in_s) { linear_speed_t self; - self._private = in_s / 39.37007874015748; + self.raw = in_s / 39.37007874015748; return self; } // mi_h static inline float LinearOD_SpeedTo_mi_h(linear_speed_t self) { - return self._private * 2.23694f; + return self.raw * 2.23694f; } static inline linear_speed_t LinearOD_SpeedFrom_mi_h(float mi_h) { linear_speed_t self; - self._private = mi_h / 2.23694f; + self.raw = mi_h / 2.23694f; return self; } diff --git a/engine/OD/od_pressure.h b/engine/OD/od_pressure.h index b429787d5..d0be87258 100644 --- a/engine/OD/od_pressure.h +++ b/engine/OD/od_pressure.h @@ -13,7 +13,7 @@ ******************************************************************************/ typedef struct { - float _private; + float raw; } pressure_t; /******************************************************************************* @@ -29,39 +29,39 @@ typedef struct // Pa static inline float PressureOD_PressureTo_Pa(pressure_t self) { - return self._private; + return self.raw; } static inline pressure_t PressureOD_PressureFrom_Pa(float Pa) { pressure_t self; - self._private = Pa; + self.raw = Pa; return self; } // Bars static inline float PressureOD_PressureTo_Bars(pressure_t self) { - return self._private / 100000.0f; + return self.raw / 100000.0f; } static inline pressure_t PressureOD_PressureFrom_Bars(float Bars) { pressure_t self; - self._private = Bars * (float)100000.0f; + self.raw = Bars * (float)100000.0f; return self; } // hPa static inline float PressureOD_PressureTo_hPa(pressure_t self) { - return self._private / (float)100.0f; + return self.raw / (float)100.0f; } static inline pressure_t PressureOD_PressureFrom_hPa(float hPa) { pressure_t self; - self._private = hPa * 100.0f; + self.raw = hPa * 100.0f; return self; } @@ -82,4 +82,4 @@ static inline void PressureOD_PressureFromMsg(pressure_t *const self, const msg_ memcpy(self, msg->data, msg->header.size); } -#endif /* OD_OD_PRESSURE_H_ */ \ No newline at end of file +#endif /* OD_OD_PRESSURE_H_ */ diff --git a/engine/OD/od_ratio.h b/engine/OD/od_ratio.h index 7c6cd1998..47c391431 100644 --- a/engine/OD/od_ratio.h +++ b/engine/OD/od_ratio.h @@ -13,7 +13,7 @@ ******************************************************************************/ typedef struct { - float _private; + float raw; } ratio_t; /******************************************************************************* @@ -29,13 +29,13 @@ typedef struct // percentage static inline float RatioOD_RatioTo_Percent(ratio_t self) { - return self._private; + return self.raw; } static inline ratio_t RatioOD_RatioFrom_Percent(float percentage) { ratio_t self; - self._private = percentage; + self.raw = percentage; return self; } diff --git a/engine/OD/od_temperature.h b/engine/OD/od_temperature.h index d95b6df0c..e3344013a 100644 --- a/engine/OD/od_temperature.h +++ b/engine/OD/od_temperature.h @@ -13,7 +13,7 @@ ******************************************************************************/ typedef struct { - float _private; + float raw; } temperature_t; /******************************************************************************* @@ -29,39 +29,39 @@ typedef struct // °C static inline float TemperatureOD_TemperatureTo_deg_c(temperature_t self) { - return self._private; + return self.raw; } static inline temperature_t TemperatureOD_TemperatureFrom_deg_c(float deg_c) { temperature_t self; - self._private = deg_c; + self.raw = deg_c; return self; } // °F static inline float TemperatureOD_TemperatureTo_deg_f(temperature_t self) { - return self._private * 1.8f + 32.0f; + return self.raw * 1.8f + 32.0f; } static inline temperature_t TemperatureOD_TemperatureFrom_deg_f(float deg_f) { temperature_t self; - self._private = (deg_f - 32.0f) / 1.8f; + self.raw = (deg_f - 32.0f) / 1.8f; return self; } // °K static inline float TemperatureOD_TemperatureTo_deg_k(temperature_t self) { - return self._private + 273.15f; + return self.raw + 273.15f; } static inline temperature_t TemperatureOD_TemperatureFrom_deg_k(float deg_k) { temperature_t self; - self._private = deg_k - 273.15f; + self.raw = deg_k - 273.15f; return self; } diff --git a/engine/core/inc/time_luos.h b/engine/core/inc/time_luos.h index 6ff874915..9598906d6 100644 --- a/engine/core/inc/time_luos.h +++ b/engine/core/inc/time_luos.h @@ -13,7 +13,7 @@ ******************************************************************************/ typedef struct { - double _private; + double raw; } time_luos_t; /******************************************************************************* @@ -29,91 +29,91 @@ typedef struct // sec static inline double TimeOD_TimeTo_s(time_luos_t self) { - return self._private; + return self.raw; } static inline time_luos_t TimeOD_TimeFrom_s(double sec) { time_luos_t self; - self._private = sec; + self.raw = sec; return self; } // ms static inline double TimeOD_TimeTo_ms(time_luos_t self) { - return self._private * 1000.0f; + return self.raw * 1000.0f; } static inline time_luos_t TimeOD_TimeFrom_ms(double ms) { time_luos_t self; - self._private = ms / 1000.0f; + self.raw = ms / 1000.0f; return self; } // µs static inline double TimeOD_TimeTo_us(time_luos_t self) { - return self._private * 1000000.0f; + return self.raw * 1000000.0f; } static inline time_luos_t TimeOD_TimeFrom_us(double us) { time_luos_t self; - self._private = us / 1000000.0f; + self.raw = us / 1000000.0f; return self; } // ns static inline double TimeOD_TimeTo_ns(time_luos_t self) { - return self._private * 1000000000.0f; + return self.raw * 1000000000.0f; } static inline time_luos_t TimeOD_TimeFrom_ns(double ns) { time_luos_t self; - self._private = ns / 1000000000.0f; + self.raw = ns / 1000000000.0f; return self; } // min static inline double TimeOD_TimeTo_min(time_luos_t self) { - return self._private / 60.0f; + return self.raw / 60.0f; } static inline time_luos_t TimeOD_TimeFrom_min(double min) { time_luos_t self; - self._private = min * 60.0f; + self.raw = min * 60.0f; return self; } // hour static inline double TimeOD_TimeTo_h(time_luos_t self) { - return self._private / 3600.0f; + return self.raw / 3600.0f; } static inline time_luos_t TimeOD_TimeFrom_h(double hour) { time_luos_t self; - self._private = hour * 3600.0f; + self.raw = hour * 3600.0f; return self; } // day static inline double TimeOD_TimeTo_day(time_luos_t self) { - return self._private / 86400.0f; + return self.raw / 86400.0f; } static inline time_luos_t TimeOD_TimeFrom_day(double day) { time_luos_t self; - self._private = day * 86400.0f; + self.raw = day * 86400.0f; return self; } diff --git a/test/tests_core/tests_od/test_angular/main.c b/test/tests_core/tests_od/test_angular/main.c index 8061db23f..673c877b6 100644 --- a/test/tests_core/tests_od/test_angular/main.c +++ b/test/tests_core/tests_od/test_angular/main.c @@ -11,13 +11,13 @@ void unittest_Od_angularPosition(void) NEW_STEP("Angular position FROM deg test"); angular_pos = AngularOD_PositionFrom_deg(90); - TEST_ASSERT_EQUAL((uint32_t)angular_pos_ref._private, (uint32_t)angular_pos._private); + TEST_ASSERT_EQUAL((uint32_t)angular_pos_ref.raw, (uint32_t)angular_pos.raw); NEW_STEP("Angular position FROM rev test"); angular_pos = AngularOD_PositionFrom_rev(0.25); - TEST_ASSERT_EQUAL((uint32_t)angular_pos_ref._private, (uint32_t)angular_pos._private); + TEST_ASSERT_EQUAL((uint32_t)angular_pos_ref.raw, (uint32_t)angular_pos.raw); NEW_STEP("Angular position FROM rad test"); angular_pos = AngularOD_PositionFrom_rad(1.5707963267948966); - TEST_ASSERT_EQUAL((uint32_t)angular_pos_ref._private, (uint32_t)angular_pos._private); + TEST_ASSERT_EQUAL((uint32_t)angular_pos_ref.raw, (uint32_t)angular_pos.raw); } NEW_TEST_CASE("Angular position TO test"); { @@ -45,12 +45,12 @@ void unittest_Od_angularPosition(void) msg_ref.header.size = sizeof(angular_position_t); memcpy(msg_ref.data, &angular_pos_ref, sizeof(angular_position_t)); AngularOD_PositionFromMsg(&angular_pos, &msg_ref); - TEST_ASSERT_EQUAL((uint32_t)angular_pos_ref._private, (uint32_t)angular_pos._private); + TEST_ASSERT_EQUAL((uint32_t)angular_pos_ref.raw, (uint32_t)angular_pos.raw); NEW_STEP("Angular position msg conversion TO test"); AngularOD_PositionToMsg(&angular_pos_ref, &msg); TEST_ASSERT_EQUAL(msg_ref.header.cmd, msg.header.cmd); TEST_ASSERT_EQUAL(msg_ref.header.size, msg.header.size); - TEST_ASSERT_EQUAL((uint32_t)((angular_position_t *)msg_ref.data)->_private, (uint32_t)((angular_position_t *)msg.data)->_private); + TEST_ASSERT_EQUAL((uint32_t)((angular_position_t *)msg_ref.data)->raw, (uint32_t)((angular_position_t *)msg.data)->raw); } NEW_TEST_CASE("Angular position msg conversion wrong values test"); { @@ -93,16 +93,16 @@ void unittest_Od_angularSpeed(void) NEW_STEP("Angular speed FROM deg/s test"); angular_speed = AngularOD_SpeedFrom_deg_s(90); - TEST_ASSERT_EQUAL((uint32_t)angular_speed_ref._private, (uint32_t)angular_speed._private); + TEST_ASSERT_EQUAL((uint32_t)angular_speed_ref.raw, (uint32_t)angular_speed.raw); NEW_STEP("Angular speed FROM rev/s test"); angular_speed = AngularOD_SpeedFrom_rev_s(0.25); - TEST_ASSERT_EQUAL((uint32_t)angular_speed_ref._private, (uint32_t)angular_speed._private); + TEST_ASSERT_EQUAL((uint32_t)angular_speed_ref.raw, (uint32_t)angular_speed.raw); NEW_STEP("Angular speed FROM rev/min test"); angular_speed = AngularOD_SpeedFrom_rev_min(0.25 * 60); - TEST_ASSERT_EQUAL((uint32_t)angular_speed_ref._private, (uint32_t)angular_speed._private); + TEST_ASSERT_EQUAL((uint32_t)angular_speed_ref.raw, (uint32_t)angular_speed.raw); NEW_STEP("Angular speed FROM rad/s test"); angular_speed = AngularOD_SpeedFrom_rad_s(1.5707963267948966); - TEST_ASSERT_EQUAL((uint32_t)angular_speed_ref._private, (uint32_t)angular_speed._private); + TEST_ASSERT_EQUAL((uint32_t)angular_speed_ref.raw, (uint32_t)angular_speed.raw); } NEW_TEST_CASE("Angular speed TO test"); { @@ -133,12 +133,12 @@ void unittest_Od_angularSpeed(void) msg_ref.header.size = sizeof(angular_speed_t); memcpy(msg_ref.data, &angular_speed_ref, sizeof(angular_speed_t)); AngularOD_SpeedFromMsg(&angular_speed, &msg_ref); - TEST_ASSERT_EQUAL((uint32_t)angular_speed_ref._private, (uint32_t)angular_speed._private); + TEST_ASSERT_EQUAL((uint32_t)angular_speed_ref.raw, (uint32_t)angular_speed.raw); NEW_STEP("Angular speed msg conversion TO test"); AngularOD_SpeedToMsg(&angular_speed_ref, &msg); TEST_ASSERT_EQUAL(msg_ref.header.cmd, msg.header.cmd); TEST_ASSERT_EQUAL(msg_ref.header.size, msg.header.size); - TEST_ASSERT_EQUAL((uint32_t)((angular_speed_t *)msg_ref.data)->_private, (uint32_t)((angular_speed_t *)msg.data)->_private); + TEST_ASSERT_EQUAL((uint32_t)((angular_speed_t *)msg_ref.data)->raw, (uint32_t)((angular_speed_t *)msg.data)->raw); } NEW_TEST_CASE("Angular speed msg conversion wrong values test"); { diff --git a/test/tests_core/tests_od/test_electric/main.c b/test/tests_core/tests_od/test_electric/main.c index f2e7645f1..74ba00e88 100644 --- a/test/tests_core/tests_od/test_electric/main.c +++ b/test/tests_core/tests_od/test_electric/main.c @@ -11,10 +11,10 @@ void unittest_Od_electricVoltage(void) NEW_STEP("Electric voltage FROM V test"); voltage = ElectricOD_VoltageFrom_V(1.0); - TEST_ASSERT_EQUAL((uint32_t)voltage_ref._private, (uint32_t)voltage._private); + TEST_ASSERT_EQUAL((uint32_t)voltage_ref.raw, (uint32_t)voltage.raw); NEW_STEP("Electric voltage FROM mV test"); voltage = ElectricOD_VoltageFrom_mV(1000); - TEST_ASSERT_EQUAL((uint32_t)voltage_ref._private, (uint32_t)voltage._private); + TEST_ASSERT_EQUAL((uint32_t)voltage_ref.raw, (uint32_t)voltage.raw); } NEW_TEST_CASE("Electric voltage TO test"); { @@ -39,12 +39,12 @@ void unittest_Od_electricVoltage(void) msg_ref.header.size = sizeof(voltage_t); memcpy(msg_ref.data, &voltage_ref, sizeof(voltage_t)); ElectricOD_VoltageFromMsg(&voltage, &msg_ref); - TEST_ASSERT_EQUAL((uint32_t)voltage_ref._private, (uint32_t)voltage._private); + TEST_ASSERT_EQUAL((uint32_t)voltage_ref.raw, (uint32_t)voltage.raw); NEW_STEP("Electric voltage msg conversion TO test"); ElectricOD_VoltageToMsg(&voltage_ref, &msg); TEST_ASSERT_EQUAL(msg_ref.header.cmd, msg.header.cmd); TEST_ASSERT_EQUAL(msg_ref.header.size, msg.header.size); - TEST_ASSERT_EQUAL((uint32_t)((voltage_t *)msg_ref.data)->_private, (uint32_t)((voltage_t *)msg.data)->_private); + TEST_ASSERT_EQUAL((uint32_t)((voltage_t *)msg_ref.data)->raw, (uint32_t)((voltage_t *)msg.data)->raw); } NEW_TEST_CASE("Electric voltage msg conversion wrong values test"); { @@ -87,10 +87,10 @@ void unittest_Od_electricCurrent(void) NEW_STEP("Electric current FROM A test"); current = ElectricOD_CurrentFrom_A(1.0); - TEST_ASSERT_EQUAL((uint32_t)current_ref._private, (uint32_t)current._private); + TEST_ASSERT_EQUAL((uint32_t)current_ref.raw, (uint32_t)current.raw); NEW_STEP("Electric current FROM mA test"); current = ElectricOD_CurrentFrom_mA(1000); - TEST_ASSERT_EQUAL((uint32_t)current_ref._private, (uint32_t)current._private); + TEST_ASSERT_EQUAL((uint32_t)current_ref.raw, (uint32_t)current.raw); } NEW_TEST_CASE("Electric current TO test"); { @@ -115,12 +115,12 @@ void unittest_Od_electricCurrent(void) msg_ref.header.size = sizeof(current_t); memcpy(msg_ref.data, ¤t_ref, sizeof(current_t)); ElectricOD_CurrentFromMsg(¤t, &msg_ref); - TEST_ASSERT_EQUAL((uint32_t)current_ref._private, (uint32_t)current._private); + TEST_ASSERT_EQUAL((uint32_t)current_ref.raw, (uint32_t)current.raw); NEW_STEP("Electric current msg conversion TO test"); ElectricOD_CurrentToMsg(¤t_ref, &msg); TEST_ASSERT_EQUAL(msg_ref.header.cmd, msg.header.cmd); TEST_ASSERT_EQUAL(msg_ref.header.size, msg.header.size); - TEST_ASSERT_EQUAL((uint32_t)((current_t *)msg_ref.data)->_private, (uint32_t)((current_t *)msg.data)->_private); + TEST_ASSERT_EQUAL((uint32_t)((current_t *)msg_ref.data)->raw, (uint32_t)((current_t *)msg.data)->raw); } NEW_TEST_CASE("Electric current msg conversion wrong values test"); { @@ -163,10 +163,10 @@ void unittest_Od_electricPower(void) NEW_STEP("Electric power FROM W test"); power = ElectricOD_PowerFrom_W(1.0); - TEST_ASSERT_EQUAL((uint32_t)power_ref._private, (uint32_t)power._private); + TEST_ASSERT_EQUAL((uint32_t)power_ref.raw, (uint32_t)power.raw); NEW_STEP("Electric power FROM mW test"); power = ElectricOD_PowerFrom_mW(1000); - TEST_ASSERT_EQUAL((uint32_t)power_ref._private, (uint32_t)power._private); + TEST_ASSERT_EQUAL((uint32_t)power_ref.raw, (uint32_t)power.raw); } NEW_TEST_CASE("Electric power TO test"); { @@ -191,12 +191,12 @@ void unittest_Od_electricPower(void) msg_ref.header.size = sizeof(power_t); memcpy(msg_ref.data, &power_ref, sizeof(power_t)); ElectricOD_PowerFromMsg(&power, &msg_ref); - TEST_ASSERT_EQUAL((uint32_t)power_ref._private, (uint32_t)power._private); + TEST_ASSERT_EQUAL((uint32_t)power_ref.raw, (uint32_t)power.raw); NEW_STEP("Electric power msg conversion TO test"); ElectricOD_PowerToMsg(&power_ref, &msg); TEST_ASSERT_EQUAL(msg_ref.header.cmd, msg.header.cmd); TEST_ASSERT_EQUAL(msg_ref.header.size, msg.header.size); - TEST_ASSERT_EQUAL((uint32_t)((power_t *)msg_ref.data)->_private, (uint32_t)((power_t *)msg.data)->_private); + TEST_ASSERT_EQUAL((uint32_t)((power_t *)msg_ref.data)->raw, (uint32_t)((power_t *)msg.data)->raw); } NEW_TEST_CASE("Electric power msg conversion wrong values test"); { diff --git a/test/tests_core/tests_od/test_force/main.c b/test/tests_core/tests_od/test_force/main.c index 028da1a33..4af7b8522 100644 --- a/test/tests_core/tests_od/test_force/main.c +++ b/test/tests_core/tests_od/test_force/main.c @@ -11,28 +11,28 @@ void unittest_Od_forceMoment(void) NEW_STEP("Force moment FROM Nm test"); moment = ForceOD_MomentFrom_N_m(90.5); - TEST_ASSERT_EQUAL((uint32_t)moment_ref._private, (uint32_t)moment._private); + TEST_ASSERT_EQUAL((uint32_t)moment_ref.raw, (uint32_t)moment.raw); NEW_STEP("Force moment FROM Nmm test"); moment = ForceOD_MomentFrom_N_mm(90500); - TEST_ASSERT_EQUAL((uint32_t)moment_ref._private, (uint32_t)moment._private); + TEST_ASSERT_EQUAL((uint32_t)moment_ref.raw, (uint32_t)moment.raw); NEW_STEP("Force moment FROM Ncm test"); moment = ForceOD_MomentFrom_N_cm(9050); - TEST_ASSERT_EQUAL((uint32_t)moment_ref._private, (uint32_t)moment._private); + TEST_ASSERT_EQUAL((uint32_t)moment_ref.raw, (uint32_t)moment.raw); NEW_STEP("Force moment FROM Kgf/mm test"); moment = ForceOD_MomentFrom_kgf_mm(9228.43172745); - TEST_ASSERT_EQUAL((uint32_t)moment_ref._private, (uint32_t)moment._private); + TEST_ASSERT_EQUAL((uint32_t)moment_ref.raw, (uint32_t)moment.raw); NEW_STEP("Force moment FROM Kgf/cm test"); moment = ForceOD_MomentFrom_kgf_cm(922.843172745); - TEST_ASSERT_EQUAL((uint32_t)moment_ref._private, (uint32_t)moment._private); + TEST_ASSERT_EQUAL((uint32_t)moment_ref.raw, (uint32_t)moment.raw); NEW_STEP("Force moment FROM Kgf/m test"); moment = ForceOD_MomentFrom_kgf_m(9.22843172745); - TEST_ASSERT_EQUAL((uint32_t)moment_ref._private, (uint32_t)moment._private); + TEST_ASSERT_EQUAL((uint32_t)moment_ref.raw, (uint32_t)moment.raw); NEW_STEP("Force moment FROM ozf/in test"); moment = ForceOD_MomentFrom_ozf_in(12815.87956868); - TEST_ASSERT_EQUAL((uint32_t)moment_ref._private, (uint32_t)moment._private); + TEST_ASSERT_EQUAL((uint32_t)moment_ref.raw, (uint32_t)moment.raw); NEW_STEP("Force moment FROM lbf/in test"); moment = ForceOD_MomentFrom_lbf_in(800.9924635902); - TEST_ASSERT_EQUAL((uint32_t)moment_ref._private, (uint32_t)moment._private); + TEST_ASSERT_EQUAL((uint32_t)moment_ref.raw, (uint32_t)moment.raw); } NEW_TEST_CASE("Force moment TO test"); { @@ -75,12 +75,12 @@ void unittest_Od_forceMoment(void) msg_ref.header.size = sizeof(moment_t); memcpy(msg_ref.data, &moment_ref, sizeof(moment_t)); ForceOD_MomentFromMsg(&moment, &msg_ref); - TEST_ASSERT_EQUAL((uint32_t)moment_ref._private, (uint32_t)moment._private); + TEST_ASSERT_EQUAL((uint32_t)moment_ref.raw, (uint32_t)moment.raw); NEW_STEP("Force moment msg conversion TO test"); ForceOD_MomentToMsg(&moment_ref, &msg); TEST_ASSERT_EQUAL(msg_ref.header.cmd, msg.header.cmd); TEST_ASSERT_EQUAL(msg_ref.header.size, msg.header.size); - TEST_ASSERT_EQUAL((uint32_t)((moment_t *)msg_ref.data)->_private, (uint32_t)((moment_t *)msg.data)->_private); + TEST_ASSERT_EQUAL((uint32_t)((moment_t *)msg_ref.data)->raw, (uint32_t)((moment_t *)msg.data)->raw); } NEW_TEST_CASE("Force moment msg conversion wrong values test"); { @@ -123,16 +123,16 @@ void unittest_Od_forceForce(void) NEW_STEP("Force force FROM N test"); force = ForceOD_ForceFrom_N(90.5); - TEST_ASSERT_EQUAL((uint32_t)force_ref._private, (uint32_t)force._private); + TEST_ASSERT_EQUAL((uint32_t)force_ref.raw, (uint32_t)force.raw); NEW_STEP("Force force FROM Kgf test"); force = ForceOD_ForceFrom_kgf(9.22843172745); - TEST_ASSERT_EQUAL((uint32_t)force_ref._private, (uint32_t)force._private); + TEST_ASSERT_EQUAL((uint32_t)force_ref.raw, (uint32_t)force.raw); NEW_STEP("Force force FROM ozf test"); force = ForceOD_ForceFrom_ozf(325.52334961); - TEST_ASSERT_EQUAL((uint32_t)force_ref._private, (uint32_t)force._private); + TEST_ASSERT_EQUAL((uint32_t)force_ref.raw, (uint32_t)force.raw); NEW_STEP("Force force FROM lbf test"); force = ForceOD_ForceFrom_lbf(20.345209351); - TEST_ASSERT_EQUAL((uint32_t)force_ref._private, (uint32_t)force._private); + TEST_ASSERT_EQUAL((uint32_t)force_ref.raw, (uint32_t)force.raw); } NEW_TEST_CASE("Force force TO test"); { @@ -163,12 +163,12 @@ void unittest_Od_forceForce(void) msg_ref.header.size = sizeof(force_t); memcpy(msg_ref.data, &force_ref, sizeof(force_t)); ForceOD_ForceFromMsg(&force, &msg_ref); - TEST_ASSERT_EQUAL((uint32_t)force_ref._private, (uint32_t)force._private); + TEST_ASSERT_EQUAL((uint32_t)force_ref.raw, (uint32_t)force.raw); NEW_STEP("Force force msg conversion TO test"); ForceOD_ForceToMsg(&force_ref, &msg); TEST_ASSERT_EQUAL(msg_ref.header.cmd, msg.header.cmd); TEST_ASSERT_EQUAL(msg_ref.header.size, msg.header.size); - TEST_ASSERT_EQUAL((uint32_t)((force_t *)msg_ref.data)->_private, (uint32_t)((force_t *)msg.data)->_private); + TEST_ASSERT_EQUAL((uint32_t)((force_t *)msg_ref.data)->raw, (uint32_t)((force_t *)msg.data)->raw); } NEW_TEST_CASE("Force force msg conversion wrong values test"); { diff --git a/test/tests_core/tests_od/test_illuminance/main.c b/test/tests_core/tests_od/test_illuminance/main.c index 82ea80b8a..91423cd96 100644 --- a/test/tests_core/tests_od/test_illuminance/main.c +++ b/test/tests_core/tests_od/test_illuminance/main.c @@ -11,7 +11,7 @@ void unittest_Od_illuminance_illuminance(void) NEW_STEP("Illuminance FROM lux test"); illuminance = IlluminanceOD_IlluminanceFrom_Lux(100); - TEST_ASSERT_EQUAL((uint32_t)illuminance_ref._private, (uint32_t)illuminance._private); + TEST_ASSERT_EQUAL((uint32_t)illuminance_ref.raw, (uint32_t)illuminance.raw); } NEW_TEST_CASE("Illuminance TO test"); { @@ -33,12 +33,12 @@ void unittest_Od_illuminance_illuminance(void) msg_ref.header.size = sizeof(illuminance_t); memcpy(msg_ref.data, &illuminance_ref, sizeof(illuminance_t)); IlluminanceOD_IlluminanceFromMsg(&illuminance, &msg_ref); - TEST_ASSERT_EQUAL((uint32_t)illuminance_ref._private, (uint32_t)illuminance._private); + TEST_ASSERT_EQUAL((uint32_t)illuminance_ref.raw, (uint32_t)illuminance.raw); NEW_STEP("Illuminance msg conversion TO test"); IlluminanceOD_IlluminanceToMsg(&illuminance_ref, &msg); TEST_ASSERT_EQUAL(msg_ref.header.cmd, msg.header.cmd); TEST_ASSERT_EQUAL(msg_ref.header.size, msg.header.size); - TEST_ASSERT_EQUAL((uint32_t)((illuminance_t *)msg_ref.data)->_private, (uint32_t)((illuminance_t *)msg.data)->_private); + TEST_ASSERT_EQUAL((uint32_t)((illuminance_t *)msg_ref.data)->raw, (uint32_t)((illuminance_t *)msg.data)->raw); } NEW_TEST_CASE("Illuminance msg conversion wrong values test"); { diff --git a/test/tests_core/tests_od/test_linear/main.c b/test/tests_core/tests_od/test_linear/main.c index fea2b96ed..f386ce8bc 100644 --- a/test/tests_core/tests_od/test_linear/main.c +++ b/test/tests_core/tests_od/test_linear/main.c @@ -11,31 +11,31 @@ void unittest_Od_linearPosition(void) NEW_STEP("Linear position FROM m test"); linear_pos = LinearOD_PositionFrom_m(90); - TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref._private, (uint32_t)linear_pos._private); + TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref.raw, (uint32_t)linear_pos.raw); NEW_STEP("Linear position FROM nm test"); linear_pos = LinearOD_PositionFrom_nm(90000000000); - TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref._private, (uint32_t)linear_pos._private); + TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref.raw, (uint32_t)linear_pos.raw); NEW_STEP("Linear position FROM um test"); linear_pos = LinearOD_PositionFrom_um(90000000); - TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref._private, (uint32_t)linear_pos._private); + TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref.raw, (uint32_t)linear_pos.raw); NEW_STEP("Linear position FROM mm test"); linear_pos = LinearOD_PositionFrom_mm(90000); - TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref._private, (uint32_t)linear_pos._private); + TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref.raw, (uint32_t)linear_pos.raw); NEW_STEP("Linear position FROM cm test"); linear_pos = LinearOD_PositionFrom_cm(9000); - TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref._private, (uint32_t)linear_pos._private); + TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref.raw, (uint32_t)linear_pos.raw); NEW_STEP("Linear position FROM km test"); linear_pos = LinearOD_PositionFrom_km(0.09); - TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref._private, (uint32_t)linear_pos._private); + TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref.raw, (uint32_t)linear_pos.raw); NEW_STEP("Linear position FROM in test"); linear_pos = LinearOD_PositionFrom_in(3543.31); - TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref._private, (uint32_t)linear_pos._private); + TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref.raw, (uint32_t)linear_pos.raw); NEW_STEP("Linear position FROM ft test"); linear_pos = LinearOD_PositionFrom_ft(295.275833333); - TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref._private, (uint32_t)linear_pos._private); + TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref.raw, (uint32_t)linear_pos.raw); NEW_STEP("Linear position FROM mi test"); linear_pos = LinearOD_PositionFrom_mi(0.05592345328276514954); - TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref._private, (uint32_t)linear_pos._private); + TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref.raw, (uint32_t)linear_pos.raw); } NEW_TEST_CASE("Linear position TO test"); { @@ -81,12 +81,12 @@ void unittest_Od_linearPosition(void) msg_ref.header.size = sizeof(linear_position_t); memcpy(msg_ref.data, &linear_pos_ref, sizeof(linear_position_t)); LinearOD_PositionFromMsg(&linear_pos, &msg_ref); - TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref._private, (uint32_t)linear_pos._private); + TEST_ASSERT_EQUAL((uint32_t)linear_pos_ref.raw, (uint32_t)linear_pos.raw); NEW_STEP("Linear position msg conversion TO test"); LinearOD_PositionToMsg(&linear_pos_ref, &msg); TEST_ASSERT_EQUAL(msg_ref.header.cmd, msg.header.cmd); TEST_ASSERT_EQUAL(msg_ref.header.size, msg.header.size); - TEST_ASSERT_EQUAL((uint32_t)((linear_position_t *)msg_ref.data)->_private, (uint32_t)((linear_position_t *)msg.data)->_private); + TEST_ASSERT_EQUAL((uint32_t)((linear_position_t *)msg_ref.data)->raw, (uint32_t)((linear_position_t *)msg.data)->raw); } NEW_TEST_CASE("Linear position msg conversion wrong values test"); { @@ -129,19 +129,19 @@ void unittest_Od_linearSpeed(void) NEW_STEP("Linear speed FROM m/s test"); linear_speed = LinearOD_SpeedFrom_m_s(90.5); - TEST_ASSERT_EQUAL((uint32_t)linear_speed_ref._private, (uint32_t)linear_speed._private); + TEST_ASSERT_EQUAL((uint32_t)linear_speed_ref.raw, (uint32_t)linear_speed.raw); NEW_STEP("Linear speed FROM mm/s test"); linear_speed = LinearOD_SpeedFrom_mm_s(90500); - TEST_ASSERT_EQUAL((uint32_t)linear_speed_ref._private, (uint32_t)linear_speed._private); + TEST_ASSERT_EQUAL((uint32_t)linear_speed_ref.raw, (uint32_t)linear_speed.raw); NEW_STEP("Linear speed FROM km/h test"); linear_speed = LinearOD_SpeedFrom_km_h(324); - TEST_ASSERT_EQUAL((uint32_t)linear_speed_ref._private, (uint32_t)linear_speed._private); + TEST_ASSERT_EQUAL((uint32_t)linear_speed_ref.raw, (uint32_t)linear_speed.raw); NEW_STEP("Linear speed FROM in/s test"); linear_speed = LinearOD_SpeedFrom_in_s(3543.307086614173); - TEST_ASSERT_EQUAL((uint32_t)linear_speed_ref._private, (uint32_t)linear_speed._private); + TEST_ASSERT_EQUAL((uint32_t)linear_speed_ref.raw, (uint32_t)linear_speed.raw); NEW_STEP("Linear speed FROM mph test"); linear_speed = LinearOD_SpeedFrom_mi_h(202.4427); - TEST_ASSERT_EQUAL((uint32_t)linear_speed_ref._private, (uint32_t)linear_speed._private); + TEST_ASSERT_EQUAL((uint32_t)linear_speed_ref.raw, (uint32_t)linear_speed.raw); } NEW_TEST_CASE("Linear speed TO test"); { @@ -175,12 +175,12 @@ void unittest_Od_linearSpeed(void) msg_ref.header.size = sizeof(linear_speed_t); memcpy(msg_ref.data, &linear_speed_ref, sizeof(linear_speed_t)); LinearOD_SpeedFromMsg(&linear_speed, &msg_ref); - TEST_ASSERT_EQUAL((uint32_t)linear_speed_ref._private, (uint32_t)linear_speed._private); + TEST_ASSERT_EQUAL((uint32_t)linear_speed_ref.raw, (uint32_t)linear_speed.raw); NEW_STEP("Linear speed msg conversion TO test"); LinearOD_SpeedToMsg(&linear_speed_ref, &msg); TEST_ASSERT_EQUAL(msg_ref.header.cmd, msg.header.cmd); TEST_ASSERT_EQUAL(msg_ref.header.size, msg.header.size); - TEST_ASSERT_EQUAL((uint32_t)((linear_speed_t *)msg_ref.data)->_private, (uint32_t)((linear_speed_t *)msg.data)->_private); + TEST_ASSERT_EQUAL((uint32_t)((linear_speed_t *)msg_ref.data)->raw, (uint32_t)((linear_speed_t *)msg.data)->raw); } NEW_TEST_CASE("Linear speed msg conversion wrong values test"); { diff --git a/test/tests_core/tests_od/test_pressure/main.c b/test/tests_core/tests_od/test_pressure/main.c index f414bfdb5..728d9bb52 100644 --- a/test/tests_core/tests_od/test_pressure/main.c +++ b/test/tests_core/tests_od/test_pressure/main.c @@ -11,13 +11,13 @@ void unittest_Od_pressure(void) NEW_STEP("Pressure FROM Pa test"); pressure = PressureOD_PressureFrom_Pa(1000.0f); - TEST_ASSERT_EQUAL((uint32_t)pressure_ref._private, (uint32_t)pressure._private); + TEST_ASSERT_EQUAL((uint32_t)pressure_ref.raw, (uint32_t)pressure.raw); NEW_STEP("Pressure FROM bars test"); pressure = PressureOD_PressureFrom_Bars(0.01f); - TEST_ASSERT_EQUAL((uint32_t)pressure_ref._private, (uint32_t)pressure._private); + TEST_ASSERT_EQUAL((uint32_t)pressure_ref.raw, (uint32_t)pressure.raw); NEW_STEP("Pressure FROM hPa test"); pressure = PressureOD_PressureFrom_hPa(10.0f); - TEST_ASSERT_EQUAL((uint32_t)pressure_ref._private, (uint32_t)pressure._private); + TEST_ASSERT_EQUAL((uint32_t)pressure_ref.raw, (uint32_t)pressure.raw); } NEW_TEST_CASE("Pressure TO test"); { @@ -45,12 +45,12 @@ void unittest_Od_pressure(void) msg_ref.header.size = sizeof(pressure_t); memcpy(msg_ref.data, &pressure_ref, sizeof(pressure_t)); PressureOD_PressureFromMsg(&pressure, &msg_ref); - TEST_ASSERT_EQUAL((uint32_t)pressure_ref._private, (uint32_t)pressure._private); + TEST_ASSERT_EQUAL((uint32_t)pressure_ref.raw, (uint32_t)pressure.raw); NEW_STEP("Pressure msg conversion TO test"); PressureOD_PressureToMsg(&pressure_ref, &msg); TEST_ASSERT_EQUAL(msg_ref.header.cmd, msg.header.cmd); TEST_ASSERT_EQUAL(msg_ref.header.size, msg.header.size); - TEST_ASSERT_EQUAL((uint32_t)((pressure_t *)msg_ref.data)->_private, (uint32_t)((pressure_t *)msg.data)->_private); + TEST_ASSERT_EQUAL((uint32_t)((pressure_t *)msg_ref.data)->raw, (uint32_t)((pressure_t *)msg.data)->raw); } NEW_TEST_CASE("Pressure msg conversion wrong values test"); { diff --git a/test/tests_core/tests_od/test_ratio/main.c b/test/tests_core/tests_od/test_ratio/main.c index e25d879d1..203c037cf 100644 --- a/test/tests_core/tests_od/test_ratio/main.c +++ b/test/tests_core/tests_od/test_ratio/main.c @@ -11,7 +11,7 @@ void unittest_Od_ratio(void) NEW_STEP("Ratio FROM Percent test"); ratio = RatioOD_RatioFrom_Percent(95.0f); - TEST_ASSERT_EQUAL((uint32_t)ratio_ref._private, (uint32_t)ratio._private); + TEST_ASSERT_EQUAL((uint32_t)ratio_ref.raw, (uint32_t)ratio.raw); } NEW_TEST_CASE("Ratio TO test"); { @@ -33,12 +33,12 @@ void unittest_Od_ratio(void) msg_ref.header.size = sizeof(ratio_t); memcpy(msg_ref.data, &ratio_ref, sizeof(ratio_t)); RatioOD_RatioFromMsg(&ratio, &msg_ref); - TEST_ASSERT_EQUAL((uint32_t)ratio_ref._private, (uint32_t)ratio._private); + TEST_ASSERT_EQUAL((uint32_t)ratio_ref.raw, (uint32_t)ratio.raw); NEW_STEP("Ratio msg conversion TO test"); RatioOD_RatioToMsg(&ratio_ref, &msg); TEST_ASSERT_EQUAL(msg_ref.header.cmd, msg.header.cmd); TEST_ASSERT_EQUAL(msg_ref.header.size, msg.header.size); - TEST_ASSERT_EQUAL((uint32_t)((ratio_t *)msg_ref.data)->_private, (uint32_t)((ratio_t *)msg.data)->_private); + TEST_ASSERT_EQUAL((uint32_t)((ratio_t *)msg_ref.data)->raw, (uint32_t)((ratio_t *)msg.data)->raw); } NEW_TEST_CASE("Ratio msg conversion wrong values test"); { diff --git a/test/tests_core/tests_od/test_temperature/main.c b/test/tests_core/tests_od/test_temperature/main.c index 86f4e448c..60ed70796 100644 --- a/test/tests_core/tests_od/test_temperature/main.c +++ b/test/tests_core/tests_od/test_temperature/main.c @@ -11,13 +11,13 @@ void unittest_Od_temperature(void) NEW_STEP("Temperature FROM degree C test"); temperature = TemperatureOD_TemperatureFrom_deg_c(1000.0f); - TEST_ASSERT_EQUAL((uint32_t)temperature_ref._private, (uint32_t)temperature._private); + TEST_ASSERT_EQUAL((uint32_t)temperature_ref.raw, (uint32_t)temperature.raw); NEW_STEP("Temperature FROM degree F test"); temperature = TemperatureOD_TemperatureFrom_deg_f(1832.0f); - TEST_ASSERT_EQUAL((uint32_t)temperature_ref._private, (uint32_t)temperature._private); + TEST_ASSERT_EQUAL((uint32_t)temperature_ref.raw, (uint32_t)temperature.raw); NEW_STEP("Temperature FROM degree K test"); temperature = TemperatureOD_TemperatureFrom_deg_k(1273.15f); - TEST_ASSERT_EQUAL((uint32_t)temperature_ref._private, (uint32_t)temperature._private); + TEST_ASSERT_EQUAL((uint32_t)temperature_ref.raw, (uint32_t)temperature.raw); } NEW_TEST_CASE("Temperature TO test"); { @@ -45,12 +45,12 @@ void unittest_Od_temperature(void) msg_ref.header.size = sizeof(temperature_t); memcpy(msg_ref.data, &temperature_ref, sizeof(temperature_t)); TemperatureOD_TemperatureFromMsg(&temperature, &msg_ref); - TEST_ASSERT_EQUAL((uint32_t)temperature_ref._private, (uint32_t)temperature._private); + TEST_ASSERT_EQUAL((uint32_t)temperature_ref.raw, (uint32_t)temperature.raw); NEW_STEP("Temperature msg conversion TO test"); TemperatureOD_TemperatureToMsg(&temperature_ref, &msg); TEST_ASSERT_EQUAL(msg_ref.header.cmd, msg.header.cmd); TEST_ASSERT_EQUAL(msg_ref.header.size, msg.header.size); - TEST_ASSERT_EQUAL((uint32_t)((temperature_t *)msg_ref.data)->_private, (uint32_t)((temperature_t *)msg.data)->_private); + TEST_ASSERT_EQUAL((uint32_t)((temperature_t *)msg_ref.data)->raw, (uint32_t)((temperature_t *)msg.data)->raw); } NEW_TEST_CASE("Temperature msg conversion wrong values test"); { diff --git a/test/tests_core/tests_od/test_time/main.c b/test/tests_core/tests_od/test_time/main.c index ee2ca69dc..febf03999 100644 --- a/test/tests_core/tests_od/test_time/main.c +++ b/test/tests_core/tests_od/test_time/main.c @@ -11,25 +11,25 @@ void unittest_Od_time(void) NEW_STEP("Time FROM seconds test"); time = TimeOD_TimeFrom_s(1000.5f); - TEST_ASSERT_EQUAL((uint32_t)time_ref._private, (uint32_t)time._private); + TEST_ASSERT_EQUAL((uint32_t)time_ref.raw, (uint32_t)time.raw); NEW_STEP("Time FROM ms test"); time = TimeOD_TimeFrom_ms(1000500.0f); - TEST_ASSERT_EQUAL((uint32_t)time_ref._private, (uint32_t)time._private); + TEST_ASSERT_EQUAL((uint32_t)time_ref.raw, (uint32_t)time.raw); NEW_STEP("Time FROM us test"); time = TimeOD_TimeFrom_us(1000500000.0f); - TEST_ASSERT_EQUAL((uint32_t)time_ref._private, (uint32_t)time._private); + TEST_ASSERT_EQUAL((uint32_t)time_ref.raw, (uint32_t)time.raw); NEW_STEP("Time FROM ns test"); time = TimeOD_TimeFrom_ns(1000500000000.0f); - TEST_ASSERT_EQUAL((uint32_t)time_ref._private, (uint32_t)time._private); + TEST_ASSERT_EQUAL((uint32_t)time_ref.raw, (uint32_t)time.raw); NEW_STEP("Time FROM min test"); time = TimeOD_TimeFrom_min(16.675f); - TEST_ASSERT_EQUAL((uint32_t)time_ref._private, (uint32_t)time._private); + TEST_ASSERT_EQUAL((uint32_t)time_ref.raw, (uint32_t)time.raw); NEW_STEP("Time FROM hour test"); time = TimeOD_TimeFrom_h(0.2779166666666667f); - TEST_ASSERT_EQUAL((uint32_t)time_ref._private, (uint32_t)time._private); + TEST_ASSERT_EQUAL((uint32_t)time_ref.raw, (uint32_t)time.raw); NEW_STEP("Time FROM day test"); time = TimeOD_TimeFrom_day(0.0115798611f); - TEST_ASSERT_EQUAL((uint32_t)time_ref._private, (uint32_t)time._private); + TEST_ASSERT_EQUAL((uint32_t)time_ref.raw, (uint32_t)time.raw); } NEW_TEST_CASE("Time TO test"); { @@ -69,12 +69,12 @@ void unittest_Od_time(void) msg_ref.header.size = sizeof(time_luos_t); memcpy(msg_ref.data, &time_ref, sizeof(time_luos_t)); TimeOD_TimeFromMsg(&time, &msg_ref); - TEST_ASSERT_EQUAL((uint32_t)time_ref._private, (uint32_t)time._private); + TEST_ASSERT_EQUAL((uint32_t)time_ref.raw, (uint32_t)time.raw); NEW_STEP("Time msg conversion TO test"); TimeOD_TimeToMsg(&time, &msg); TEST_ASSERT_EQUAL(msg_ref.header.cmd, msg.header.cmd); TEST_ASSERT_EQUAL(msg_ref.header.size, msg.header.size); - TEST_ASSERT_EQUAL((uint32_t)time_ref._private, (uint32_t)time._private); + TEST_ASSERT_EQUAL((uint32_t)time_ref.raw, (uint32_t)time.raw); } NEW_TEST_CASE("Time msg conversion wrong values test"); { From 1e967606878e1b24eb7e85f98b7027f9b452a16b Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 28 Aug 2023 18:17:41 +0200 Subject: [PATCH 128/150] Fix some OD warnings on `Controller_motor` example --- .../lib/Controller_motor/ll_motor.c | 32 +++++++++---------- .../lib/Controller_motor/ll_motor.h | 10 +++--- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/examples/projects/l0/controller_motor/lib/Controller_motor/ll_motor.c b/examples/projects/l0/controller_motor/lib/Controller_motor/ll_motor.c index cebd728c4..7d55b9476 100644 --- a/examples/projects/l0/controller_motor/lib/Controller_motor/ll_motor.c +++ b/examples/projects/l0/controller_motor/lib/Controller_motor/ll_motor.c @@ -205,16 +205,16 @@ void ll_motor_enable(char state) ******************************************************************************/ void ll_motor_Command(uint16_t mode, float ratio) { - float current = ll_motor_GetCurrent(); - float currentfactor = 1.0f; - currentfactor = *motor_parameters.limit_current / (current * 2); + current_t current = ElectricOD_CurrentFrom_A(ll_motor_GetCurrent()); + float currentfactor; + currentfactor = motor_parameters.limit_current->raw / (current.raw * 2.0f); static float surpCurrentSum = 0.0; - float surpCurrent = current - *motor_parameters.limit_current; + const float surpCurrent = current.raw - motor_parameters.limit_current->raw; surpCurrentSum += surpCurrent; // If surpCurrentSum > 0 do a real coef if (surpCurrentSum > 0.0) { - currentfactor = *motor_parameters.limit_current / (*motor_parameters.limit_current + (surpCurrentSum / 1.5)); + currentfactor = motor_parameters.limit_current->raw / (motor_parameters.limit_current->raw + (surpCurrentSum / 1.5)); } else { @@ -228,10 +228,10 @@ void ll_motor_Command(uint16_t mode, float ratio) } // limit power value - if (ratio < -*motor_parameters.limit_ratio) - ratio = -*motor_parameters.limit_ratio; - if (ratio > *motor_parameters.limit_ratio) - ratio = *motor_parameters.limit_ratio; + if (ratio < -motor_parameters.limit_ratio->raw) + ratio = -motor_parameters.limit_ratio->raw; + if (ratio > motor_parameters.limit_ratio->raw) + ratio = motor_parameters.limit_ratio->raw; // transform power ratio to timer value uint16_t pulse; @@ -278,7 +278,7 @@ float ll_motor_GetAngularPosition(void) ******************************************************************************/ float ll_motor_GetLinearPosition(float angular_position) { - return angular_position / 360.0 * M_PI * (*motor_parameters.wheel_diameter); + return angular_position / 360.0 * M_PI * LinearOD_PositionTo_m(*motor_parameters.wheel_diameter); } /****************************************************************************** @@ -294,11 +294,11 @@ void ll_motor_config(motor_config_t motor_config) motor_parameters.limit_ratio = motor_config.limit_ratio; motor_parameters.limit_current = motor_config.limit_current; - // default motor configuration + // Default motor configuration *motor_parameters.motor_reduction = 131; *motor_parameters.resolution = 16; - *motor_parameters.wheel_diameter = 0.100f; - // default motor hardware limits - *motor_parameters.limit_ratio = 100.0; - *motor_parameters.limit_current = 6.0; -} \ No newline at end of file + *motor_parameters.wheel_diameter = LinearOD_PositionFrom_m(0.100f); + // Default motor hardware limits + *motor_parameters.limit_ratio = RatioOD_RatioFrom_Percent(100.0f); + *motor_parameters.limit_current = ElectricOD_CurrentFrom_A(6.0f); +} diff --git a/examples/projects/l0/controller_motor/lib/Controller_motor/ll_motor.h b/examples/projects/l0/controller_motor/lib/Controller_motor/ll_motor.h index 086199e29..b51e53187 100644 --- a/examples/projects/l0/controller_motor/lib/Controller_motor/ll_motor.h +++ b/examples/projects/l0/controller_motor/lib/Controller_motor/ll_motor.h @@ -7,7 +7,7 @@ #ifndef _LL_MOTOR_H #define _LL_MOTOR_H -#include "float.h" +#include "luos_engine.h" #include "stdio.h" /******************************************************************************* @@ -44,11 +44,11 @@ typedef struct motor_config // motor configuration float *motor_reduction; float *resolution; - float *wheel_diameter; + linear_position_t *wheel_diameter; // hardware limits - float *limit_ratio; - float *limit_current; + ratio_t *limit_ratio; + current_t *limit_current; } motor_config_t; /******************************************************************************* * Variables @@ -65,4 +65,4 @@ float ll_motor_GetAngularPosition(void); float ll_motor_GetLinearPosition(float); void ll_motor_config(motor_config_t); -#endif /* _LL_MOTOR_H */ \ No newline at end of file +#endif /* _LL_MOTOR_H */ From 82001f81693f68a71b4737d19ec74f5d39ec1f57 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 28 Aug 2023 18:39:27 +0200 Subject: [PATCH 129/150] Add a user_context pointer on services and apply it on DXL example --- engine/core/inc/struct_luos.h | 1 + examples/projects/l0/dxl/lib/Dxl/dxl.c | 104 +++++++++++-------------- 2 files changed, 47 insertions(+), 58 deletions(-) diff --git a/engine/core/inc/struct_luos.h b/engine/core/inc/struct_luos.h index ddb5ea08c..c85f3065d 100644 --- a/engine/core/inc/struct_luos.h +++ b/engine/core/inc/struct_luos.h @@ -206,6 +206,7 @@ typedef struct service_t uint8_t alias[MAX_ALIAS_SIZE]; /*!< service alias. */ revision_t revision; /*!< service firmware version. */ access_t access; /*!< service read write access. */ + void *user_context; /*!< Pointer to the user context. */ // Callback void (*service_cb)(struct service_t *service, const msg_t *msg); diff --git a/examples/projects/l0/dxl/lib/Dxl/dxl.c b/examples/projects/l0/dxl/lib/Dxl/dxl.c index 14eb2966e..7064f2995 100644 --- a/examples/projects/l0/dxl/lib/Dxl/dxl.c +++ b/examples/projects/l0/dxl/lib/Dxl/dxl.c @@ -39,7 +39,6 @@ volatile float measurement_buf[BUFFER_SIZE]; ******************************************************************************/ static void Dxl_MsgHandler(service_t *service, const msg_t *msg); static void discover_dxl(void); -static int find_id(service_t *service); /****************************************************************************** * @brief init must be call in project init @@ -131,6 +130,7 @@ void Dxl_Loop(void) } index++; } + /****************************************************************************** * @brief Msg handler call back when a msg receive for this service * @param Service destination @@ -139,12 +139,11 @@ void Dxl_Loop(void) ******************************************************************************/ static void Dxl_MsgHandler(service_t *service, const msg_t *msg) { - int index = find_id(service); - + dxl_t *my_dxl = (dxl_t *)service->user_context; if (msg->header.cmd == GET_CMD) { // if a temperature have been send stop temperature transmission to make it one shot - dxl[index].dxl_motor.motor.mode.temperature = 0; + my_dxl->dxl_motor.motor.mode.temperature = 0; } if (msg->header.cmd == REGISTER) { @@ -166,7 +165,7 @@ static void Dxl_MsgHandler(service_t *service, const msg_t *msg) else { volatile char baud = 3; // Default value for 1000000 for MX/XL - if (dxl[index].model == AX12 || dxl[index].model == AX18) + if (my_dxl->model == AX12 || my_dxl->model == AX18) { baud = 1; // Default value for 1000000 for AX switch (val) @@ -253,7 +252,7 @@ static void Dxl_MsgHandler(service_t *service, const msg_t *msg) else { // else reset a specific ID - servo_factory_reset(dxl[index].id, DXL_TIMEOUT); + servo_factory_reset(my_dxl->id, DXL_TIMEOUT); } } else @@ -262,11 +261,11 @@ static void Dxl_MsgHandler(service_t *service, const msg_t *msg) char size = get_register_size(reg); if (size == 2) { - servo_set_raw_word(dxl[index].id, reg, (uint16_t)val, DXL_TIMEOUT); + servo_set_raw_word(my_dxl->id, reg, (uint16_t)val, DXL_TIMEOUT); } else { - servo_set_raw_byte(dxl[index].id, reg, (uint8_t)val, DXL_TIMEOUT); + servo_set_raw_byte(my_dxl->id, reg, (uint8_t)val, DXL_TIMEOUT); } } @@ -279,8 +278,8 @@ static void Dxl_MsgHandler(service_t *service, const msg_t *msg) // check address integrity if (id < 255) { - servo_set_raw_byte(dxl[index].id, SERVO_REGISTER_ID, id, DXL_TIMEOUT); - dxl[index].id = id; + servo_set_raw_byte(my_dxl->id, SERVO_REGISTER_ID, id, DXL_TIMEOUT); + my_dxl->id = id; } return; } @@ -292,16 +291,16 @@ static void Dxl_MsgHandler(service_t *service, const msg_t *msg) if ((msg->header.cmd == ANGULAR_POSITION) && (msg->header.size == sizeof(float))) { int pos; - if (dxl[index].model == AX12 || dxl[index].model == AX18 || dxl[index].model == XL320) + if (my_dxl->model == AX12 || my_dxl->model == AX18 || my_dxl->model == XL320) { - pos = (int)((1024 - 1) * ((300 / 2 + AngularOD_PositionTo_deg(dxl[index].dxl_motor.target_angular_position)) / 300)); + pos = (int)((1024 - 1) * ((300 / 2 + AngularOD_PositionTo_deg(my_dxl->dxl_motor.target_angular_position)) / 300)); } else { - pos = (int)((4096 - 1) * ((360 / 2 + AngularOD_PositionTo_deg(dxl[index].dxl_motor.target_angular_position)) / 360)); + pos = (int)((4096 - 1) * ((360 / 2 + AngularOD_PositionTo_deg(my_dxl->dxl_motor.target_angular_position)) / 360)); } int retry = 0; - while ((servo_set_raw_word(dxl[index].id, SERVO_REGISTER_GOAL_ANGLE, pos, DXL_TIMEOUT) != SERVO_NO_ERROR) && (retry < 10)) + while ((servo_set_raw_word(my_dxl->id, SERVO_REGISTER_GOAL_ANGLE, pos, DXL_TIMEOUT) != SERVO_NO_ERROR) && (retry < 10)) { retry++; } @@ -309,46 +308,46 @@ static void Dxl_MsgHandler(service_t *service, const msg_t *msg) } if (msg->header.cmd == RATIO_LIMIT) { - unsigned short limit = (unsigned short)(RatioOD_RatioTo_Percent(dxl[index].dxl_motor.motor.power) * 1023.0 / 100.0); - servo_set_raw_word(dxl[index].id, SERVO_REGISTER_TORQUE_LIMIT, limit, DXL_TIMEOUT); + unsigned short limit = (unsigned short)(RatioOD_RatioTo_Percent(my_dxl->dxl_motor.motor.power) * 1023.0 / 100.0); + servo_set_raw_word(my_dxl->id, SERVO_REGISTER_TORQUE_LIMIT, limit, DXL_TIMEOUT); return; } if (msg->header.cmd == PID) { - if (dxl[index].model >= MX12) + if (my_dxl->model >= MX12) { // clamp PID values for (int i = 0; i < 3; i++) { - if (dxl[index].dxl_motor.position_pid.table[i] > 254.0) - dxl[index].dxl_motor.position_pid.table[i] = 254.0; - if (dxl[index].dxl_motor.position_pid.table[i] < 0.0) - dxl[index].dxl_motor.position_pid.table[i] = 0.0; + if (my_dxl->dxl_motor.position_pid.table[i] > 254.0) + my_dxl->dxl_motor.position_pid.table[i] = 254.0; + if (my_dxl->dxl_motor.position_pid.table[i] < 0.0) + my_dxl->dxl_motor.position_pid.table[i] = 0.0; } - servo_set_raw_byte(dxl[index].id, SERVO_REGISTER_P_GAIN, (char)dxl[index].dxl_motor.position_pid.p, DXL_TIMEOUT); - servo_set_raw_byte(dxl[index].id, SERVO_REGISTER_I_GAIN, (char)dxl[index].dxl_motor.position_pid.i, DXL_TIMEOUT); - servo_set_raw_byte(dxl[index].id, SERVO_REGISTER_D_GAIN, (char)dxl[index].dxl_motor.position_pid.d, DXL_TIMEOUT); + servo_set_raw_byte(my_dxl->id, SERVO_REGISTER_P_GAIN, (char)my_dxl->dxl_motor.position_pid.p, DXL_TIMEOUT); + servo_set_raw_byte(my_dxl->id, SERVO_REGISTER_I_GAIN, (char)my_dxl->dxl_motor.position_pid.i, DXL_TIMEOUT); + servo_set_raw_byte(my_dxl->id, SERVO_REGISTER_D_GAIN, (char)my_dxl->dxl_motor.position_pid.d, DXL_TIMEOUT); } return; } if (msg->header.cmd == ANGULAR_POSITION_LIMIT) { - if (dxl[index].model == AX12 || dxl[index].model == AX18 || dxl[index].model == XL320) + if (my_dxl->model == AX12 || my_dxl->model == AX18 || my_dxl->model == XL320) { - int pos = (int)((1024 - 1) * ((300 / 2 + AngularOD_PositionTo_deg(dxl[index].dxl_motor.limit_angular_position[0])) / 300)); - servo_set_raw_word(dxl[index].id, SERVO_REGISTER_MIN_ANGLE, pos, DXL_TIMEOUT); + int pos = (int)((1024 - 1) * ((300 / 2 + AngularOD_PositionTo_deg(my_dxl->dxl_motor.limit_angular_position[0])) / 300)); + servo_set_raw_word(my_dxl->id, SERVO_REGISTER_MIN_ANGLE, pos, DXL_TIMEOUT); HAL_Delay(1); - pos = (int)((1024 - 1) * ((300 / 2 + AngularOD_PositionTo_deg(dxl[index].dxl_motor.limit_angular_position[1])) / 300)); - servo_set_raw_word(dxl[index].id, SERVO_REGISTER_MAX_ANGLE, pos, DXL_TIMEOUT); + pos = (int)((1024 - 1) * ((300 / 2 + AngularOD_PositionTo_deg(my_dxl->dxl_motor.limit_angular_position[1])) / 300)); + servo_set_raw_word(my_dxl->id, SERVO_REGISTER_MAX_ANGLE, pos, DXL_TIMEOUT); } else { - int pos = (int)((4096 - 1) * ((360 / 2 + AngularOD_PositionTo_deg(dxl[index].dxl_motor.limit_angular_position[0])) / 360)); - servo_set_raw_word(dxl[index].id, SERVO_REGISTER_MIN_ANGLE, pos, DXL_TIMEOUT); + int pos = (int)((4096 - 1) * ((360 / 2 + AngularOD_PositionTo_deg(my_dxl->dxl_motor.limit_angular_position[0])) / 360)); + servo_set_raw_word(my_dxl->id, SERVO_REGISTER_MIN_ANGLE, pos, DXL_TIMEOUT); HAL_Delay(1); - pos = (int)((4096 - 1) * ((360 / 2 + AngularOD_PositionTo_deg(dxl[index].dxl_motor.limit_angular_position[1])) / 360)); - servo_set_raw_word(dxl[index].id, SERVO_REGISTER_MAX_ANGLE, pos, DXL_TIMEOUT); + pos = (int)((4096 - 1) * ((360 / 2 + AngularOD_PositionTo_deg(my_dxl->dxl_motor.limit_angular_position[1])) / 360)); + servo_set_raw_word(my_dxl->id, SERVO_REGISTER_MAX_ANGLE, pos, DXL_TIMEOUT); } return; } @@ -356,18 +355,18 @@ static void Dxl_MsgHandler(service_t *service, const msg_t *msg) { // Set the direction bit - int direction = (AngularOD_SpeedTo_deg_s(dxl[index].dxl_motor.target_angular_speed) < 0) << 10; + int direction = (AngularOD_SpeedTo_deg_s(my_dxl->dxl_motor.target_angular_speed) < 0) << 10; // find the speed factor and compute the max speed float speed_factor = 0.111; - if (dxl[index].model == MX12 || dxl[index].model == MX64 || dxl[index].model == MX106) + if (my_dxl->model == MX12 || my_dxl->model == MX64 || my_dxl->model == MX106) { speed_factor = 0.114; } float speed_max = 1023.0 * speed_factor * 360.0 / 60.0; // Maximisation - dxl[index].dxl_motor.target_angular_speed = AngularOD_SpeedFrom_deg_s(fminf(fmaxf(AngularOD_SpeedTo_deg_s(dxl[index].dxl_motor.target_angular_speed), -speed_max), speed_max)); - int speed = direction + (int)(fabs(AngularOD_SpeedTo_deg_s(dxl[index].dxl_motor.target_angular_speed)) / (speed_factor * 360.0 / 60.0)); - servo_set_raw_word(dxl[index].id, SERVO_REGISTER_MOVING_SPEED, speed, DXL_TIMEOUT); + my_dxl->dxl_motor.target_angular_speed = AngularOD_SpeedFrom_deg_s(fminf(fmaxf(AngularOD_SpeedTo_deg_s(my_dxl->dxl_motor.target_angular_speed), -speed_max), speed_max)); + int speed = direction + (int)(fabs(AngularOD_SpeedTo_deg_s(my_dxl->dxl_motor.target_angular_speed)) / (speed_factor * 360.0 / 60.0)); + servo_set_raw_word(my_dxl->id, SERVO_REGISTER_MOVING_SPEED, speed, DXL_TIMEOUT); return; } if (msg->header.cmd == PARAMETERS) @@ -375,25 +374,25 @@ static void Dxl_MsgHandler(service_t *service, const msg_t *msg) // Some motors need some time to manage all of those. Just try it multiple times. // set compliance uint8_t retry = 0; - while ((servo_set_raw_byte(dxl[index].id, SERVO_REGISTER_TORQUE_ENABLE, (dxl[index].dxl_motor.mode.mode_compliant == 0), DXL_TIMEOUT) != SERVO_NO_ERROR) && (retry < 10)) + while ((servo_set_raw_byte(my_dxl->id, SERVO_REGISTER_TORQUE_ENABLE, (my_dxl->dxl_motor.mode.mode_compliant == 0), DXL_TIMEOUT) != SERVO_NO_ERROR) && (retry < 10)) { retry++; } - if (!dxl[index].dxl_motor.mode.mode_compliant) + if (!my_dxl->dxl_motor.mode.mode_compliant) { // If we are not compliant set current position as target position - dxl[index].dxl_motor.target_angular_position = dxl[index].dxl_motor.angular_position; + my_dxl->dxl_motor.target_angular_position = my_dxl->dxl_motor.angular_position; int pos; - if (dxl[index].model == AX12 || dxl[index].model == AX18 || dxl[index].model == XL320) + if (my_dxl->model == AX12 || my_dxl->model == AX18 || my_dxl->model == XL320) { - pos = (int)((1024 - 1) * ((300 / 2 + AngularOD_PositionTo_deg(dxl[index].dxl_motor.target_angular_position)) / 300)); + pos = (int)((1024 - 1) * ((300 / 2 + AngularOD_PositionTo_deg(my_dxl->dxl_motor.target_angular_position)) / 300)); } else { - pos = (int)((4096 - 1) * ((360 / 2 + AngularOD_PositionTo_deg(dxl[index].dxl_motor.target_angular_position)) / 360)); + pos = (int)((4096 - 1) * ((360 / 2 + AngularOD_PositionTo_deg(my_dxl->dxl_motor.target_angular_position)) / 360)); } retry = 0; - while ((servo_set_raw_word(dxl[index].id, SERVO_REGISTER_GOAL_ANGLE, pos, DXL_TIMEOUT) != SERVO_NO_ERROR) && (retry < 10)) + while ((servo_set_raw_word(my_dxl->id, SERVO_REGISTER_GOAL_ANGLE, pos, DXL_TIMEOUT) != SERVO_NO_ERROR) && (retry < 10)) { retry++; } @@ -462,7 +461,8 @@ static void discover_dxl(void) dxl[dxl_index].id = dxl_id; // ************** Service creation ***************** - ProfileServo_CreateService(&dxl[dxl_index].dxl_motor, Dxl_MsgHandler, alias, revision); + service_t *service = ProfileServo_CreateService(&dxl[dxl_index].dxl_motor, Dxl_MsgHandler, alias, revision); + service->user_context = (void *)&dxl[dxl_index]; servo_get_raw_word(dxl_id, SERVO_REGISTER_MODEL_NUMBER, (uint16_t *)&dxl[dxl_index].model, DXL_TIMEOUT); // put a delay on motor response servo_set_raw_byte(dxl_id, SERVO_REGISTER_RETURN_DELAY_TIME, 10, DXL_TIMEOUT); @@ -488,15 +488,3 @@ static void discover_dxl(void) Luos_CreateService(Dxl_MsgHandler, VOID_TYPE, "void_dxl", revision); } } - -static int find_id(service_t *service) -{ - profile_core_t *profile = (profile_core_t *)service->profile_context; - int i = 0; - for (i = 0; i <= MAX_LOCAL_SERVICE_NUMBER; i++) - { - if ((uint32_t)profile->profile_data == (uint32_t)&dxl[i].dxl_motor) - return i; - } - return i; -} From 1802b42bfba86734c2a6622ca6021a98c18bd946 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 29 Aug 2023 16:48:33 +0200 Subject: [PATCH 130/150] Fix Serial HAL for Native on Linux and windows, fix #442 --- engine/core/src/luos_utils.c | 9 +- .../projects/native/gate_wscom/src/main.c | 17 ++- .../HAL/NATIVE/serial_network_hal.c | 118 ++++++++++++------ 3 files changed, 95 insertions(+), 49 deletions(-) diff --git a/engine/core/src/luos_utils.c b/engine/core/src/luos_utils.c index 01958e2d9..b009a9966 100644 --- a/engine/core/src/luos_utils.c +++ b/engine/core/src/luos_utils.c @@ -5,6 +5,7 @@ * @version 0.0.0 ******************************************************************************/ #include +#include #include "luos_utils.h" #include "luos_engine.h" #include "string.h" @@ -60,9 +61,6 @@ _CRITICAL void Luos_assert(char *file, uint32_t line) // prepare a message as a node. // To do that we have to reset the service ID and clear PTP states to unlock others. - #if (defined _WIN32) || (defined _WIN64) || (defined __linux__) || (defined __APPLE__) || (defined __unix__) || (defined __CYGWIN__) || (defined __MINGW32__) || (defined __MINGW64__) - printf("ASSERT: %s:%d\n", file, line); - #endif Luos_Init(); // completely reinit the allocator MsgAlloc_Init(NULL); @@ -88,6 +86,11 @@ _CRITICAL void Luos_assert(char *file, uint32_t line) Luos_JumpToBootloader(); #endif Phy_SetIrqState(false); + + #if (defined _WIN32) || (defined _WIN64) || (defined __linux__) || (defined __APPLE__) || (defined __unix__) || (defined __CYGWIN__) || (defined __MINGW32__) || (defined __MINGW64__) + printf("ASSERT: %s:%d\n", file, line); + exit(1); + #endif while (1) { } diff --git a/examples/projects/native/gate_wscom/src/main.c b/examples/projects/native/gate_wscom/src/main.c index f6e5953fe..c82b80661 100644 --- a/examples/projects/native/gate_wscom/src/main.c +++ b/examples/projects/native/gate_wscom/src/main.c @@ -4,11 +4,13 @@ #include "gate.h" #include -#include -#include -#include -#include -#include +#ifndef WIN32 + #include + #include + #include + #include + #include +#endif void *Gate_Pipe_LoopThread(void *vargp) { @@ -19,7 +21,7 @@ void *Gate_Pipe_LoopThread(void *vargp) } return NULL; } - +#ifndef _WIN32 void handler(int sig) { void *array[10]; @@ -33,10 +35,13 @@ void handler(int sig) backtrace_symbols_fd(array, size, STDERR_FILENO); exit(1); } +#endif int main(void) { +#ifndef _WIN32 signal(SIGSEGV, handler); // install our handler +#endif Luos_Init(); Serial_Init(); Pipe_Init(); diff --git a/network/serial_network/HAL/NATIVE/serial_network_hal.c b/network/serial_network/HAL/NATIVE/serial_network_hal.c index 1a8d79cf3..6fe1092ff 100644 --- a/network/serial_network/HAL/NATIVE/serial_network_hal.c +++ b/network/serial_network/HAL/NATIVE/serial_network_hal.c @@ -20,6 +20,9 @@ #include #include #include + #ifdef __linux__ + #include + #endif #endif /******************************************************************************* @@ -64,35 +67,28 @@ char *stripStr(char *string) } #ifdef _WIN32 -void set_serial_raw_mode(HANDLE hSerial) +void set_serial_raw_mode() { - DCB dcbSerialParams = {0}; - dcbSerialParams.DCBlength = sizeof(dcbSerialParams); + DCB dcb; + SecureZeroMemory(&dcb, sizeof(DCB)); + dcb.DCBlength = sizeof(DCB); - if (!GetCommState(hSerial, &dcbSerialParams)) + if (!GetCommState(hSerial, &dcb)) { - perror("Error getting serial port state"); + printf("GetCommState failed with error %d.\n", GetLastError()); LUOS_ASSERT(0); return; } - dcbSerialParams.BaudRate = SERIAL_NETWORK_BAUDRATE; - dcbSerialParams.ByteSize = 8; - dcbSerialParams.StopBits = ONESTOPBIT; - dcbSerialParams.Parity = NOPARITY; - dcbSerialParams.fBinary = TRUE; - dcbSerialParams.fRtsControl = RTS_CONTROL_DISABLE; - dcbSerialParams.fOutxCtsFlow = FALSE; - dcbSerialParams.fDtrControl = DTR_CONTROL_DISABLE; - dcbSerialParams.fOutxDsrFlow = FALSE; - dcbSerialParams.fOutX = FALSE; - dcbSerialParams.fInX = FALSE; - // dcbSerialParams.XonChar = 17; // ASCII XON (Ctrl-Q) - // dcbSerialParams.XoffChar = 19; // ASCII XOFF (Ctrl-S) - - if (!SetCommState(hSerial, &dcbSerialParams)) + dcb.BaudRate = SERIAL_NETWORK_BAUDRATE; + dcb.ByteSize = 8; + dcb.StopBits = ONESTOPBIT; + dcb.Parity = NOPARITY; + dcb.fBinary = TRUE; + + if (!SetCommState(hSerial, &dcb)) { - perror("Error setting serial port state"); + printf("SetCommState failed with error %d.\n", GetLastError()); LUOS_ASSERT(0); return; } @@ -179,7 +175,7 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) #else printf("Please enter the serial port name (ex: /dev/ttyUSB0): "); #endif - fgets(portname, sizeof(portname), stdin); + char *unused = fgets(portname, sizeof(portname), stdin); #else printf("Using default serial port: %s\n", SERIAL_PORT); memcpy(portname, SERIAL_PORT, strlen(SERIAL_PORT)); @@ -189,41 +185,41 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) // Open the serial port #ifdef _WIN32 - HANDLE hSerial; hSerial = CreateFile( portname, GENERIC_READ | GENERIC_WRITE, 0, // exclusive access NULL, // no security OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, - 0); + 0, // not overlapped I/O + NULL); if (hSerial == INVALID_HANDLE_VALUE) { - printf("Error opening serial port\n"); + printf("CreateFile failed with error %d.\n", GetLastError()); LUOS_ASSERT(0); } // Set serial port parameters - set_serial_raw_mode(hSerial); + set_serial_raw_mode(); - // DCB dcbSerialParams = {0}; - // dcbSerialParams.DCBlength = sizeof(dcbSerialParams); - // if (!GetCommState(hSerial, &dcbSerialParams)) + // DCB dcb = {0}; + // dcb.DCBlength = sizeof(dcb); + // if (!GetCommState(hSerial, &dcb)) // { // printf("Error getting serial port state\n"); // CloseHandle(hSerial); // LUOS_ASSERT(0); // } - // dcbSerialParams.BaudRate = SERIAL_NETWORK_BAUDRATE; - // dcbSerialParams.ByteSize = 8; - // dcbSerialParams.StopBits = ONESTOPBIT; - // dcbSerialParams.Parity = NOPARITY; - // if (!SetCommState(hSerial, &dcbSerialParams)) + // dcb.BaudRate = SERIAL_NETWORK_BAUDRATE; + // dcb.ByteSize = 8; + // dcb.StopBits = ONESTOPBIT; + // dcb.Parity = NOPARITY; + // if (!SetCommState(hSerial, &dcb)) // { // printf("Error setting serial port state\n"); // CloseHandle(hSerial); // LUOS_ASSERT(0); // } + Sleep(2); #else serial_port = open(portname, O_RDWR | O_NOCTTY | O_NONBLOCK); if (serial_port < 0) @@ -251,6 +247,10 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) // Set output/ input to be non-blocking // tty.c_cc[VMIN] = 0; // tty.c_cc[VTIME] = 0; + // #if defined(__linux__) + // tty.c_ispeed = SERIAL_NETWORK_BAUDRATE; + // tty.c_ospeed = SERIAL_NETWORK_BAUDRATE; + // #endif if (tcsetattr(serial_port, TCSANOW, &tty) != 0) { @@ -261,8 +261,9 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) } tcflush(serial_port, TCIOFLUSH); - // Bypass baudrate speed limitations of termios by using ioctl - #define IOSSIOSPEED 0x80045402 + #if defined(__APPLE__) + // Bypass baudrate speed limitations of termios by using ioctl + #define IOSSIOSPEED 0x80045402 speed_t speed = SERIAL_NETWORK_BAUDRATE; if (ioctl(serial_port, IOSSIOSPEED, &speed) < 0) { @@ -271,8 +272,45 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) close(serial_port); LUOS_ASSERT(0); } -#endif + #else + // Set the baudrate + struct termios2 + { + tcflag_t c_iflag; + tcflag_t c_oflag; + tcflag_t c_cflag; + tcflag_t c_lflag; + cc_t c_line; + cc_t c_cc[19]; + speed_t c_ispeed; + speed_t c_ospeed; + }; + + // Get current serial port settings + struct termios2 serial_settings; + if (ioctl(serial_port, TCGETS2, &serial_settings) != 0) + { + perror("Error getting current settings"); + close(serial_port); + LUOS_ASSERT(0); + } + + // Set new baud rate + #define BOTHER 0x1000 + serial_settings.c_cflag &= ~CBAUD; // Clear existing baud rate settings + serial_settings.c_cflag |= BOTHER; // Set custom baud rate + serial_settings.c_ispeed = SERIAL_NETWORK_BAUDRATE; // Input baud rate + serial_settings.c_ospeed = SERIAL_NETWORK_BAUDRATE; // Output baud rate + + if (ioctl(serial_port, TCSETS2, &serial_settings) != 0) + { + perror("Error setting baud rate"); + close(serial_port); + LUOS_ASSERT(0); + } + #endif sleep(2); +#endif } /****************************************************************************** @@ -287,7 +325,7 @@ void SerialHAL_Loop(void) DWORD bytesRead; if (!ReadFile(hSerial, recvData, sizeof(recvData), &bytesRead, NULL)) { - printf("Error reading from serial port\n"); + printf("Error reading from serial port, ERROR_CODE : %d\n", GetLastError()); CloseHandle(hSerial); LUOS_ASSERT(0); } @@ -313,7 +351,7 @@ void SerialHAL_Send(uint8_t *data, uint16_t size) DWORD bytesWritten; if (!WriteFile(hSerial, data, size, &bytesWritten, NULL)) { - printf("Error writing to serial port\n"); + printf("Error writing to serial port, ERROR_CODE : %d\n", GetLastError()); CloseHandle(hSerial); LUOS_ASSERT(0); } From f0de0439bf135ca4dac99c1ed212c2c0d9138a8a Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 31 Aug 2023 10:49:40 +0200 Subject: [PATCH 131/150] Improve compilation messaging presentation --- .../robus_network/robus_select_hal_script.py | 2 -- .../serial_select_hal_script.py | 3 +-- source_filter_script.py | 20 +------------------ 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/network/robus_network/robus_select_hal_script.py b/network/robus_network/robus_select_hal_script.py index f2b58fcd1..23f1981fc 100644 --- a/network/robus_network/robus_select_hal_script.py +++ b/network/robus_network/robus_select_hal_script.py @@ -45,12 +45,10 @@ hal_script_path = realpath( "HAL/" + item[1] + "/hal_script.py") env.SConscript(hal_script_path, exports="env") - click.secho("") else: click.secho("\t* %s Robus network HAL not found" % item[1], fg="red") - click.secho("") env.Append(CPPPATH=[realpath("HAL/" + item[1])]) env.Append(CPPPATH=[realpath("inc/")]) diff --git a/network/serial_network/serial_select_hal_script.py b/network/serial_network/serial_select_hal_script.py index 205f44fe8..6ac38b248 100644 --- a/network/serial_network/serial_select_hal_script.py +++ b/network/serial_network/serial_select_hal_script.py @@ -5,6 +5,7 @@ from os.path import join, realpath Import('env') +click.secho("") click.secho("Serial network build configuration:", underline=True) # Find the appropriate hal find_HAL = False @@ -44,12 +45,10 @@ hal_script_path = realpath( "HAL/" + item[1] + "/hal_script.py") env.SConscript(hal_script_path, exports="env") - click.secho("") else: click.secho("\t* %s Serial network HAL not found" % item[1], fg="red") - click.secho("") env.Append(CPPPATH=[realpath("HAL/" + item[1])]) env.Append(CPPPATH=[realpath("inc/")]) diff --git a/source_filter_script.py b/source_filter_script.py index dec404727..8a61a440e 100644 --- a/source_filter_script.py +++ b/source_filter_script.py @@ -66,6 +66,7 @@ # Native only => we should put this on a specific script on engine/HAL/STUB for item in env.ParseFlags(env['BUILD_FLAGS'])["CPPDEFINES"]: if (item == 'UNIT_TEST'): + click.secho("") click.secho("Native unit testing:", underline=True) current_os = pf.system() click.secho("\t* Native Mock HAL for %s is selected for Luos." % @@ -80,25 +81,6 @@ if (current_os == 'Linux') or (current_os == 'Windows'): env.Append(LINKFLAGS=["-lgcov", "--coverage", "-fprofile-arcs"]) - # CODE COVERAGE WILL BE ADDED SOON - # if (current_os == 'Linux') or (current_os == 'Darwin') or (current_os == 'Windows'): - # env.Append(LINKFLAGS=["-lgcov"]) - # env.Append(LINKFLAGS=["--coverage"]) - # env.Append(LINKFLAGS=["-fprofile-arcs"]) - - # def generateCoverageInfo(source, target, env): - # for file in os.listdir("test"): - # env.Execute(".pio/build/native/program test/"+file) - # env.Execute("lcov -d .pio/build/native/ -c -o lcov.info") - # env.Execute( - # "lcov --remove lcov.info '*/Platforms/*' '*/bootloader/*' '*/.pio/*' '*/HAL/*' '*/test/*' -o filtered_lcov.info") - # env.Execute( - # "genhtml filtered_lcov.info -o cov/ --demangle-cpp") - - # Generate code coverage when testing workflow is ended - # env.AddPostAction(".pio/build/native/program", generateCoverageInfo) - # else: - # click.echo("Unit tests are not supported on your os ", current_os) break if not visited_key in global_env: From 38bc6511fcf34753b5612f523bbba784b70496f6 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 31 Aug 2023 12:53:55 +0200 Subject: [PATCH 132/150] Remove some useless reset on detetion and increase some timing allowing native to always perform as expected. --- engine/IO/src/luos_io.c | 10 ++++------ test/tests_core/test_routing_table/main.c | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index 39860b09b..b312d0708 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -310,13 +310,11 @@ static int LuosIO_StartTopologyDetection(service_t *service) } detect_state_machine++; case 2: - // Reinit Phy (this will call LuosIO_Reset) - Phy_ResetAll(); - // Wait 2ms to be sure all previous messages are received and treated by other nodes + // Wait 2ms to be sure all previous messages are received and treated by nodes start_tick = LuosHAL_GetSystick(); detect_state_machine++; case 3: - // Wait 2ms for the other to manage the message + // Wait 2ms for all nodes to manage the message if (LuosHAL_GetSystick() - start_tick < 2) { return 0; @@ -339,8 +337,8 @@ static int LuosIO_StartTopologyDetection(service_t *service) start_tick = LuosHAL_GetSystick(); detect_state_machine++; case 6: - // Wait 2ms to be sure all previous messages are received and treated by other nodes - if (LuosHAL_GetSystick() - start_tick < 2) + // Wait 10ms to be sure all previous messages are received and treated by all the nodes + if (LuosHAL_GetSystick() - start_tick < 10) { return 0; } diff --git a/test/tests_core/test_routing_table/main.c b/test/tests_core/test_routing_table/main.c index d53dce182..b624b99ae 100644 --- a/test/tests_core/test_routing_table/main.c +++ b/test/tests_core/test_routing_table/main.c @@ -307,7 +307,7 @@ void unittest_RoutingTB_ConvertServiceToRoutingTable(void) routing_table_t entry; service_t service; service.id = 10; - strcpy(service.alias, "Dummy_App"); + strcpy((char *)service.alias, "Dummy_App"); service.type = DISTANCE_TYPE; RoutingTB_ConvertServiceToRoutingTable(&entry, &service); From e98e9900758c164c61f19254d12e10bcee0f558f Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 31 Aug 2023 17:38:57 +0200 Subject: [PATCH 133/150] Fix the detection flag init --- engine/IO/src/luos_io.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engine/IO/src/luos_io.c b/engine/IO/src/luos_io.c index b312d0708..4f13fc0e1 100644 --- a/engine/IO/src/luos_io.c +++ b/engine/IO/src/luos_io.c @@ -83,6 +83,9 @@ void LuosIO_Init(void) luos_phy = Phy_Get(0, LuosIO_MsgHandler, LuosIO_RunTopo, LuosIO_Reset); // Set the irq management function Phy_SetIrqStateFunciton(LuosHAL_SetIrqState); + + // Detection init + Flag_DetectServices = false; } /****************************************************************************** @@ -310,6 +313,8 @@ static int LuosIO_StartTopologyDetection(service_t *service) } detect_state_machine++; case 2: + // Reinit Phy (this will call LuosIO_Reset) + Phy_ResetAll(); // Wait 2ms to be sure all previous messages are received and treated by nodes start_tick = LuosHAL_GetSystick(); detect_state_machine++; From 44c03ffd893672ac42d11a706048c9bac4b74eca Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 31 Aug 2023 17:39:41 +0200 Subject: [PATCH 134/150] Fix and remove deprecated unit test --- test/tests_io/test_filter/main.c | 414 ------------------------------ test/tests_io/test_luos_io/main.c | 118 +-------- test/tests_io/test_phy/main.c | 33 +-- 3 files changed, 21 insertions(+), 544 deletions(-) diff --git a/test/tests_io/test_filter/main.c b/test/tests_io/test_filter/main.c index 7b2c7884c..f318dcca5 100644 --- a/test/tests_io/test_filter/main.c +++ b/test/tests_io/test_filter/main.c @@ -2,163 +2,6 @@ #include "filter.h" #include "../src/service.c" -void unittest_Filter_ServiceId() -{ - uint16_t service_number = 10; - NEW_TEST_CASE("Basic Service ID mask test"); - { - Phy_FiltersInit(); - TRY - { - Phy_AddLocalServices(7, service_number); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(7)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(7 + service_number - 1)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Phy_AddLocalServices(8, service_number); - TEST_ASSERT_EQUAL(false, Filter_ServiceID(7)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(8)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(8 + service_number - 1)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Phy_AddLocalServices(9, service_number); - TEST_ASSERT_EQUAL(false, Filter_ServiceID(8)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(9)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(9 + service_number - 1)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Phy_AddLocalServices(9, 0); - TEST_ASSERT_EQUAL(false, Filter_ServiceID(8)); - TEST_ASSERT_EQUAL(false, Filter_ServiceID(9)); - TEST_ASSERT_EQUAL(false, Filter_ServiceID(9 + service_number - 1)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - service_number = MAX_LOCAL_SERVICE_NUMBER; - NEW_TEST_CASE("Service ID mask test with max services"); - { - Phy_FiltersInit(); - - TRY - { - Phy_AddLocalServices(7, service_number); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(7)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(7 + service_number - 1)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Phy_AddLocalServices(8, service_number); - TEST_ASSERT_EQUAL(false, Filter_ServiceID(7)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(8)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(8 + service_number - 1)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Phy_AddLocalServices(9, service_number); - TEST_ASSERT_EQUAL(false, Filter_ServiceID(8)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(9)); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(9 + service_number - 1)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Phy_AddLocalServices(9, 0); - TEST_ASSERT_EQUAL(false, Filter_ServiceID(8)); - TEST_ASSERT_EQUAL(false, Filter_ServiceID(9)); - TEST_ASSERT_EQUAL(false, Filter_ServiceID(9 + service_number - 1)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Overlap the MAX_LOCAL_SERVICE_NUMBER"); - { - Phy_FiltersInit(); - TRY - { - Phy_AddLocalServices(1, MAX_LOCAL_SERVICE_NUMBER + 1); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Test the id 4096 Limit"); - { - Phy_FiltersInit(); - TRY - { - Phy_AddLocalServices(4096 - MAX_LOCAL_SERVICE_NUMBER, service_number); - TEST_ASSERT_EQUAL(true, Filter_ServiceID(4096 - MAX_LOCAL_SERVICE_NUMBER)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Phy_AddLocalServices(4096 - MAX_LOCAL_SERVICE_NUMBER + 1, service_number); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - - TRY - { - Filter_ServiceID(4096 + 1); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Test the id 0 Limit"); - { - Phy_FiltersInit(); - TRY - { - Phy_AddLocalServices(0, service_number); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } -} - void unittest_Filter_Topic() { NEW_TEST_CASE("Test the id max Limit"); @@ -449,269 +292,12 @@ void unittest_Filter_Type() } } -void unittest_Phy_ComputeTargets() -{ - header_t header; - NEW_TEST_CASE("Test a wrong header target_mode"); - { - TRY - { - header.target_mode = 0x0f; - Phy_ComputeTargets(&header); - } - TEST_ASSERT_TRUE(!IS_ASSERT()); - END_TRY; - } - - NEW_TEST_CASE("Test service ID"); - { - TRY - { - Phy_AddLocalServices(1, 1); - header.target_mode = SERVICEIDACK; - header.target = 1; - // We should have Luos only - TEST_ASSERT_EQUAL(0x01, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Phy_AddLocalServices(1, 1); - header.target_mode = SERVICEIDACK; - header.target = 2; - // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Phy_AddLocalServices(1, 1); - header.target_mode = SERVICEID; - header.target = 1; - // We should have Luos only - TEST_ASSERT_EQUAL(0x01, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Phy_AddLocalServices(1, 1); - header.target_mode = SERVICEID; - header.target = 2; - // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Phy_AddLocalServices(1, 2); - header.target_mode = SERVICEIDACK; - header.target = 2; - // We should have Luos only - TEST_ASSERT_EQUAL(0x01, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Phy_AddLocalServices(1, 2); - header.target_mode = SERVICEIDACK; - header.target = 3; - // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Phy_AddLocalServices(1, 2); - header.target_mode = SERVICEID; - header.target = 2; - // We should have Luos only - TEST_ASSERT_EQUAL(0x01, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Phy_AddLocalServices(1, 2); - header.target_mode = SERVICEID; - header.target = 3; - // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Test Type"); - { - TRY - { - service_ctx.number = 1; - service_ctx.list[0].type = 0; - header.target_mode = TYPE; - header.target = 0; - // We should have Luos and Robus - TEST_ASSERT_EQUAL(0x03, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - service_ctx.number = 1; - service_ctx.list[0].type = 0; - header.target_mode = TYPE; - header.target = 1; - // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Test Broadcast"); - { - TRY - { - header.target_mode = BROADCAST; - header.target = BROADCAST_VAL; - // We should have Luos and Robus - TEST_ASSERT_EQUAL(0x03, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - header.target_mode = BROADCAST; - header.target = 1; - // We should have Luos and Robus - TEST_ASSERT_EQUAL(0x03, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Test Node ID"); - { - TRY - { - Node_Get()->node_id = 1; - header.target_mode = NODEIDACK; - header.target = 1; - // We should have Luos only - TEST_ASSERT_EQUAL(0x01, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Node_Get()->node_id = 1; - header.target_mode = NODEIDACK; - header.target = 2; - // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Node_Get()->node_id = 1; - header.target_mode = NODEID; - header.target = 1; - // We should have Luos only - TEST_ASSERT_EQUAL(0x01, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - - TRY - { - Node_Get()->node_id = 1; - header.target_mode = NODEID; - header.target = 2; - // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } - - NEW_TEST_CASE("Test Topic"); - { - TRY - { - Filter_TopicInit(); - Filter_AddTopic(3); - header.target_mode = TOPIC; - header.target = 3; - // We should have Luos and Robus - TEST_ASSERT_EQUAL(0x03, Phy_ComputeTargets(&header)); - header.target = 2; - // We should have Robus only - TEST_ASSERT_EQUAL(0x02, Phy_ComputeTargets(&header)); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - } -} - int main(int argc, char **argv) { UNITY_BEGIN(); - RUN_TEST(unittest_Filter_ServiceId); RUN_TEST(unittest_Filter_Topic); RUN_TEST(unittest_Filter_Type); - RUN_TEST(unittest_Phy_ComputeTargets); UNITY_END(); } diff --git a/test/tests_io/test_luos_io/main.c b/test/tests_io/test_luos_io/main.c index 4c91ed2b0..c6cae4a31 100644 --- a/test/tests_io/test_luos_io/main.c +++ b/test/tests_io/test_luos_io/main.c @@ -215,119 +215,6 @@ void unittest_luosIO_ConsumeMsg() END_TRY; } - NEW_TEST_CASE("Check CONNECTION_DATA size of a port_ treatment (topology retriving)"); - { - TRY - { - luosIO_reset_overlap_callback(); - last_node = 1; - Node_Get()->node_id = 1; - msg_t msg; - msg.header.cmd = CONNECTION_DATA; - msg.header.size = sizeof(port_t); - port_t port; - port.node_id = 1; - port.phy_id = 2; - port.port_id = 3; - memcpy(msg.data, &port, sizeof(port_t)); - memset(connection_table_ptr, 0xFF, sizeof(connection_t) * 2); - - LuosIO_ConsumeMsg(&msg); - TEST_ASSERT_EQUAL(2, last_node); - - TEST_ASSERT_EQUAL(1, connection_table_ptr[1].parent.node_id); - TEST_ASSERT_EQUAL(2, connection_table_ptr[1].parent.phy_id); - TEST_ASSERT_EQUAL(3, connection_table_ptr[1].parent.port_id); - - TEST_ASSERT_EQUAL(0xFFFF, connection_table_ptr[0].parent.node_id); - TEST_ASSERT_EQUAL(0xFF, connection_table_ptr[0].parent.phy_id); - TEST_ASSERT_EQUAL(0xFF, connection_table_ptr[0].parent.port_id); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - END_TRY; - } - - NEW_TEST_CASE("Check CONNECTION_DATA size of a connection_t treatment (topology retriving)"); - { - TRY - { - luosIO_reset_overlap_callback(); - last_node = 1; - Node_Get()->node_id = 1; - msg_t msg; - msg.header.cmd = CONNECTION_DATA; - msg.header.size = 2 * sizeof(connection_t); - connection_t con[2]; - con[0].parent.node_id = 2; - con[0].parent.phy_id = 1; - con[0].parent.port_id = 3; - con[0].child.node_id = 4; - con[0].child.phy_id = 5; - con[0].child.port_id = 6; - con[1].parent.node_id = 7; - con[1].parent.phy_id = 8; - con[1].parent.port_id = 9; - con[1].child.node_id = 3; - con[1].child.phy_id = 11; - con[1].child.port_id = 12; - - memcpy(msg.data, con, 2 * sizeof(connection_t)); - memset(connection_table_ptr, 0xFF, sizeof(connection_t) * 2); - - LuosIO_ConsumeMsg(&msg); - TEST_ASSERT_EQUAL(3, last_node); - - TEST_ASSERT_EQUAL(2, connection_table_ptr[1].parent.node_id); - TEST_ASSERT_EQUAL(1, connection_table_ptr[1].parent.phy_id); - TEST_ASSERT_EQUAL(3, connection_table_ptr[1].parent.port_id); - - TEST_ASSERT_EQUAL(3, connection_table_ptr[2].child.node_id); - TEST_ASSERT_EQUAL(11, connection_table_ptr[2].child.phy_id); - TEST_ASSERT_EQUAL(12, connection_table_ptr[2].child.port_id); - - TEST_ASSERT_EQUAL(0xFFFF, connection_table_ptr[0].parent.node_id); - TEST_ASSERT_EQUAL(0xFF, connection_table_ptr[0].parent.phy_id); - TEST_ASSERT_EQUAL(0xFF, connection_table_ptr[0].parent.port_id); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - END_TRY; - } - - NEW_TEST_CASE("Check NODE_ID reception"); - { - TRY - { - luosIO_reset_overlap_callback(); - Luos_handled_job = NULL; - Robus_handled_job = NULL; - Node_Get()->node_id = 0; - msg_t msg; - msg.header.cmd = NODE_ID; - msg.header.size = 2; - msg.header.source = 1; - uint16_t node_id = 2; - memcpy(msg.data, &node_id, sizeof(uint16_t)); - - error_return_t ret_val = LuosIO_ConsumeMsg(&msg); - - TEST_ASSERT_EQUAL(SUCCEED, ret_val); - TEST_ASSERT_EQUAL(NULL, Luos_handled_job); - TEST_ASSERT_EQUAL(NULL, Robus_handled_job); - TEST_ASSERT_EQUAL(2, Node_Get()->node_id); - } - CATCH - { - TEST_ASSERT_TRUE(false); - } - END_TRY; - } - NEW_TEST_CASE("Check PORT_DATA treatment (topology retriving)"); { TRY @@ -405,7 +292,7 @@ void unittest_luosIO_ConsumeMsg() TEST_ASSERT_EQUAL(RTB, Luos_handled_job->msg_pt->header.cmd); TEST_ASSERT_EQUAL(1, Luos_handled_job->msg_pt->header.target); TEST_ASSERT_EQUAL(3 * sizeof(routing_table_t), Luos_handled_job->msg_pt->header.size); - TEST_ASSERT_EQUAL(SERVICEIDACK, Luos_handled_job->msg_pt->header.target_mode); + TEST_ASSERT_EQUAL(NODEIDACK, Luos_handled_job->msg_pt->header.target_mode); } CATCH { @@ -443,7 +330,7 @@ void unittest_luosIO_ConsumeMsg() TEST_ASSERT_EQUAL(RTB, Luos_handled_job->msg_pt->header.cmd); TEST_ASSERT_EQUAL(1, Luos_handled_job->msg_pt->header.target); TEST_ASSERT_EQUAL(3 * sizeof(routing_table_t), Luos_handled_job->msg_pt->header.size); - TEST_ASSERT_EQUAL(SERVICEIDACK, Luos_handled_job->msg_pt->header.target_mode); + TEST_ASSERT_EQUAL(NODEIDACK, Luos_handled_job->msg_pt->header.target_mode); routing_table_t rtb[3]; memcpy((void *)rtb, (void *)Luos_handled_job->msg_pt->data, 3 * sizeof(routing_table_t)); TEST_ASSERT_EQUAL(NODE, rtb[0].mode); @@ -474,6 +361,7 @@ void unittest_luosIO_ConsumeMsg() msg.header.size = 0; error_return_t ret_val = LuosIO_ConsumeMsg(&msg); + Luos_Loop(); // Start detection will reset on the next loop. // Check received message content TEST_ASSERT_EQUAL(SUCCEED, ret_val); diff --git a/test/tests_io/test_phy/main.c b/test/tests_io/test_phy/main.c index 2ba19b3f3..750693b0a 100644 --- a/test/tests_io/test_phy/main.c +++ b/test/tests_io/test_phy/main.c @@ -2,6 +2,7 @@ #include "../src/luos_phy.c" #include "../src/msg_alloc.c" #include "../src/luos_io.c" +#include luos_phy_t *robus_phy; uint8_t buffer[512]; @@ -48,6 +49,7 @@ void reset_cb(luos_phy_t *phy_ptr) static void phy_test_reset(void) { Phy_Init(); + // Init default scenario context luos_phy = Phy_Get(0, phy_luos_MsgHandler, reset_cb, topo_cb); TEST_ASSERT_EQUAL(&phy_ctx.phy[0], luos_phy); TEST_ASSERT_EQUAL(1, phy_ctx.phy_nb); @@ -725,7 +727,6 @@ void unittest_phy_ComputeHeader() TEST_ASSERT_EQUAL(true, luos_phy->rx_keep); TEST_ASSERT_EQUAL(true, luos_phy->rx_ack); TEST_ASSERT_EQUAL(true, luos_phy->rx_alloc_job); - TEST_ASSERT_EQUAL(0x01, luos_phy->rx_phy_filter); // A luos service is targeted } CATCH { @@ -766,7 +767,6 @@ void unittest_phy_ComputeHeader() TEST_ASSERT_EQUAL(true, luos_phy->rx_keep); TEST_ASSERT_EQUAL(true, luos_phy->rx_ack); TEST_ASSERT_EQUAL(true, luos_phy->rx_alloc_job); - TEST_ASSERT_EQUAL(0x01, luos_phy->rx_phy_filter); // A luos service is targeted } CATCH { @@ -807,7 +807,6 @@ void unittest_phy_ComputeHeader() TEST_ASSERT_EQUAL(true, luos_phy->rx_keep); TEST_ASSERT_EQUAL(false, luos_phy->rx_ack); TEST_ASSERT_EQUAL(true, luos_phy->rx_alloc_job); - TEST_ASSERT_EQUAL(0x01, luos_phy->rx_phy_filter); // A luos service is targeted } CATCH { @@ -848,7 +847,6 @@ void unittest_phy_ComputeHeader() TEST_ASSERT_EQUAL(true, luos_phy->rx_keep); TEST_ASSERT_EQUAL(true, luos_phy->rx_ack); TEST_ASSERT_EQUAL(true, luos_phy->rx_alloc_job); - TEST_ASSERT_EQUAL(0x01, luos_phy->rx_phy_filter); // A luos service is targeted } CATCH { @@ -888,7 +886,6 @@ void unittest_phy_ComputeHeader() TEST_ASSERT_EQUAL(true, luos_phy->rx_keep); TEST_ASSERT_EQUAL(true, luos_phy->rx_ack); TEST_ASSERT_EQUAL(true, luos_phy->rx_alloc_job); - TEST_ASSERT_EQUAL(0x02, luos_phy->rx_phy_filter); // A Robus node is targeted } CATCH { @@ -926,10 +923,9 @@ void unittest_phy_ComputeHeader() robus_phy->rx_phy_filter = 0x00; Phy_ComputeHeader(robus_phy); TEST_ASSERT_EQUAL(MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t), luos_phy->rx_size); - TEST_ASSERT_EQUAL(false, robus_phy->rx_keep); - TEST_ASSERT_EQUAL(false, robus_phy->rx_ack); - TEST_ASSERT_EQUAL(false, robus_phy->rx_alloc_job); - TEST_ASSERT_EQUAL(0x00, robus_phy->rx_phy_filter); // No service is targeted + TEST_ASSERT_EQUAL(true, robus_phy->rx_keep); // By default at this stage we don't check all the node so we consider this as valid + TEST_ASSERT_EQUAL(true, robus_phy->rx_ack); + TEST_ASSERT_EQUAL(true, robus_phy->rx_alloc_job); } CATCH { @@ -969,7 +965,7 @@ void unittest_phy_ValidMsg() luos_phy->rx_alloc_job = false; luos_phy->rx_size = MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t); luos_phy->rx_phy_filter = 0x02; // A Robus node is targeted - luos_phy->rx_timestamp = TimeOD_TimeFrom_ns(10.0f); + luos_phy->rx_timestamp = 10; TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); Phy_ValidMsg(luos_phy); @@ -1006,7 +1002,7 @@ void unittest_phy_ValidMsg() luos_phy->rx_alloc_job = false; luos_phy->rx_size = MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t); luos_phy->rx_phy_filter = 0x02; // A Robus node is targeted - luos_phy->rx_timestamp = TimeOD_TimeFrom_ns(10.0f); + luos_phy->rx_timestamp = 10; TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); Phy_ValidMsg(luos_phy); @@ -1024,10 +1020,17 @@ void unittest_phy_ValidMsg() TRY { phy_test_reset(); + Init_Context(); memory_stats_t memory_stats; MsgAlloc_Init(&memory_stats); msg_t msg; + msg.header.config = TIMESTAMP_PROTOCOL; + msg.header.target_mode = SERVICEIDACK; + msg.header.target = 2; + msg.header.cmd = IO_STATE; + msg.header.size = 600; + msg.data[0] = 0xAE; // Save message information in the Luos phy struct // Robus cannot target himself. luos_phy->rx_buffer_base = (uint8_t *)&msg; @@ -1038,8 +1041,8 @@ void unittest_phy_ValidMsg() luos_phy->rx_ack = true; luos_phy->rx_alloc_job = true; luos_phy->rx_size = MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t); - luos_phy->rx_phy_filter = 0x02; // A Robus node is targeted - luos_phy->rx_timestamp = TimeOD_TimeFrom_ns(10.0f); + luos_phy->rx_phy_filter = 0x00; + luos_phy->rx_timestamp = 10; TEST_ASSERT_EQUAL(0, phy_ctx.io_job_nb); Phy_ValidMsg(luos_phy); @@ -1047,10 +1050,11 @@ void unittest_phy_ValidMsg() TEST_ASSERT_EQUAL(10, phy_ctx.io_job[0].timestamp); TEST_ASSERT_EQUAL(false, luos_phy->rx_alloc_job); TEST_ASSERT_EQUAL(msg_buffer, phy_ctx.io_job[0].alloc_msg); - TEST_ASSERT_EQUAL(0x02, phy_ctx.io_job[0].phy_filter); + TEST_ASSERT_EQUAL(0x01, phy_ctx.io_job[0].phy_filter); TEST_ASSERT_EQUAL(MAX_DATA_MSG_SIZE + sizeof(header_t) + sizeof(time_luos_t), phy_ctx.io_job[0].size); TEST_ASSERT_EQUAL(0, luos_phy->received_data); TEST_ASSERT_EQUAL(luos_phy->rx_buffer_base, luos_phy->rx_data); + TEST_ASSERT_EQUAL(0x01, luos_phy->rx_phy_filter); // A Robus node is targeted } CATCH { @@ -1074,7 +1078,6 @@ void unittest_phy_ComputeTimestamp() TRY { - luos_phy phy; Phy_ComputeMsgTimestamp(luos_phy, NULL); } TEST_ASSERT_TRUE(IS_ASSERT()); From 317431776eae1c31feadda5be2cc53655a13496c Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 31 Aug 2023 17:51:06 +0200 Subject: [PATCH 135/150] Fix some code format --- examples/projects/ESP32/button/node_config.h | 2 +- examples/projects/NUCLEO-L073RZ/bootloader/node_config.h | 2 +- network/serial_network/HAL/template/serial_network_hal.c | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/projects/ESP32/button/node_config.h b/examples/projects/ESP32/button/node_config.h index 6d0d72f71..0f0d5d4a8 100644 --- a/examples/projects/ESP32/button/node_config.h +++ b/examples/projects/ESP32/button/node_config.h @@ -45,7 +45,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ -#define MSG_BUFFER_SIZE 1024 +#define MSG_BUFFER_SIZE 1024 #define ROBUS_NETWORK_BAUDRATE 500000 /******************************************************************************* diff --git a/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h b/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h index f8c9f6ab0..f8cbea49b 100644 --- a/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h +++ b/examples/projects/NUCLEO-L073RZ/bootloader/node_config.h @@ -48,7 +48,7 @@ * NBR_RETRY | 10 | Send Retry number in case of NACK or collision ******************************************************************************/ #define ROBUS_NETWORK_BAUDRATE 500000 -#define MSG_BUFFER_SIZE 512 +#define MSG_BUFFER_SIZE 512 /******************************************************************************* * LUOS HAL LIBRARY DEFINITION diff --git a/network/serial_network/HAL/template/serial_network_hal.c b/network/serial_network/HAL/template/serial_network_hal.c index e7cd032a4..7f44411eb 100644 --- a/network/serial_network/HAL/template/serial_network_hal.c +++ b/network/serial_network/HAL/template/serial_network_hal.c @@ -9,8 +9,6 @@ #include "_serial_network.h" // TODO: Include the needed files - - /******************************************************************************* * Variables ******************************************************************************/ From 43c9a0851ad032562ee2d542a1c62e539a4be40d Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 5 Sep 2023 16:40:41 +0200 Subject: [PATCH 136/150] Fix a typo --- engine/core/inc/luos.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/core/inc/luos.h b/engine/core/inc/luos.h index 9091d69dd..9d33006af 100644 --- a/engine/core/inc/luos.h +++ b/engine/core/inc/luos.h @@ -4,5 +4,5 @@ * @author Luos ******************************************************************************/ -#error 'luos.h' inclusion is deprecated since luos_engine@2.3.1, replace it by '#include "luos_engine.h" +#error 'luos.h' inclusion is deprecated since luos_engine@2.3.1, replace it by '#include "luos_engine.h"` #include "luos_engine.h" From c152eaaf45917bba4144893f6deac2a78d945680 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 5 Sep 2023 16:41:39 +0200 Subject: [PATCH 137/150] Secure Robus initialization by setting Callback before enabling the hardware. This avoid a potential IRQ to broke the code. --- network/robus_network/inc/reception.h | 3 ++- network/robus_network/src/reception.c | 18 +++++++++++++----- network/robus_network/src/robus.c | 7 +++++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/network/robus_network/inc/reception.h b/network/robus_network/inc/reception.h index f04abef0a..d76082660 100644 --- a/network/robus_network/inc/reception.h +++ b/network/robus_network/inc/reception.h @@ -49,7 +49,8 @@ void Recep_Drop(luos_phy_t *phy_robus, volatile uint8_t *data); // Callbacks send void Recep_CatchAck(luos_phy_t *phy_robus, volatile uint8_t *data); -void Recep_Init(luos_phy_t *phy_robus); +void Recep_Init(void); +void Recep_PhyInit(luos_phy_t *phy_robus); void Recep_EndMsg(void); void Recep_Reset(void); void Recep_Timeout(void); diff --git a/network/robus_network/src/reception.c b/network/robus_network/src/reception.c index 684e2b323..82f112e8c 100644 --- a/network/robus_network/src/reception.c +++ b/network/robus_network/src/reception.c @@ -73,13 +73,21 @@ uint16_t crc_val = 0; // CRC value * @param None * @return None ******************************************************************************/ -void Recep_Init(luos_phy_t *phy_robus) +void Recep_Init() { - LUOS_ASSERT(phy_robus != NULL); // Initialize the reception state machine - ctx.rx.status.unmap = 0; - ctx.rx.callback = Recep_GetHeader; - ctx.rx.status.identifier = 0xF; + ctx.rx.status.unmap = 0; + ctx.rx.callback = Recep_GetHeader; + ctx.rx.status.identifier = 0xF; +} +/****************************************************************************** + * @brief Reception init. + * @param None + * @return None + ******************************************************************************/ +void Recep_PhyInit(luos_phy_t *phy_robus) +{ + LUOS_ASSERT(phy_robus != NULL); phy_robus->rx_timestamp = 0; phy_robus->rx_buffer_base = data_rx; phy_robus->rx_data = data_rx; diff --git a/network/robus_network/src/robus.c b/network/robus_network/src/robus.c index dc2c5003d..afa7365f9 100644 --- a/network/robus_network/src/robus.c +++ b/network/robus_network/src/robus.c @@ -49,12 +49,15 @@ void Robus_Init(void) // Init transmission Transmit_Init(); + // Init Receiption + Recep_Init(); + // Instantiate the phy struct phy_robus = Phy_Create(Robus_JobHandler, Robus_RunTopology, Robus_Reset); LUOS_ASSERT(phy_robus); - // Init reception - Recep_Init(phy_robus); + // Init reception of the phy + Recep_PhyInit(phy_robus); } /****************************************************************************** From 7b83495c93686a842b3a1532e682a5a534f0aeaf Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 5 Sep 2023 17:36:19 +0200 Subject: [PATCH 138/150] [Gate] Allow user to put custom conversion on project lib --- tool_services/gate/select_format_script.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tool_services/gate/select_format_script.py b/tool_services/gate/select_format_script.py index f2fa9b5bb..020f712b3 100644 --- a/tool_services/gate/select_format_script.py +++ b/tool_services/gate/select_format_script.py @@ -14,11 +14,18 @@ if (path.exists(item[1])): click.secho("\t* %s translation format selected." % item[1], fg="green") + env.Append(CPPPATH=[realpath(item[1])]) + env.Replace(SRC_FILTER=["+<*.c>, +<%s>" % item[1]]) + elif (path.exists(env.get("PROJECT_DIR")+"/lib/"+item[1])): + click.secho("\t* %s translation format selected." % + item[1], fg="green") + env.Append( + CPPPATH=[realpath(env.get("PROJECT_DIR")+"/lib/"+item[1])]) + env.Replace(SRC_FILTER=["+<*.c>, +<%s>" % + env.get("PROJECT_DIR")+"/lib/"+item[1]]) else: click.secho("\t* %s translation format not found." % item[1], fg="red") - env.Append(CPPPATH=[realpath(item[1])]) - env.Replace(SRC_FILTER=["+<*.c>, +<%s>" % item[1]]) break if find_format == False: From c36ddaccfb8a635af1e72f5dacd3408d11d77f8a Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 11 Sep 2023 13:27:56 +0200 Subject: [PATCH 139/150] Fix assert infinite re-entrance on Gate --- tool_services/pipe/pipe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tool_services/pipe/pipe.c b/tool_services/pipe/pipe.c index 12aeeec30..5b7b2efc0 100644 --- a/tool_services/pipe/pipe.c +++ b/tool_services/pipe/pipe.c @@ -115,6 +115,7 @@ void node_assert(char *file, uint32_t line) // manage self crashing scenario char json[512]; sprintf(json, "{\"assert\":{\"node_id\":1,\"file\":\"%s\",\"line\":%d}}\n", file, (unsigned int)line); + Streaming_ResetChannel(&tx_StreamChannel); Streaming_PutSample(&tx_StreamChannel, json, strlen(json)); // Send the message From bf0ac489cc2a567cdd52c4a30fd574d97a9e9175 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 11 Sep 2023 17:15:51 +0200 Subject: [PATCH 140/150] Avoid asserts appening sometime during the reset_detection --- engine/IO/src/luos_phy.c | 1 + engine/core/src/routing_table.c | 6 +++++- test/tests_core/test_routing_table/main.c | 10 ---------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index b0404564f..1536dae0f 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -772,6 +772,7 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) { // We probably have been reseted in the meantime. Just drop the message. phy_ptr->rx_alloc_job = false; + phy_ptr->rx_keep = false; return; } diff --git a/engine/core/src/routing_table.c b/engine/core/src/routing_table.c index 98ed59d22..11563d78f 100644 --- a/engine/core/src/routing_table.c +++ b/engine/core/src/routing_table.c @@ -766,7 +766,11 @@ void RoutingTB_ConvertServiceToRoutingTable(routing_table_t *entry, service_t *s ******************************************************************************/ void RoutingTB_RemoveNode(uint16_t nodeid) { - LUOS_ASSERT(nodeid != 0); + if (nodeid == 0) + { + // This mean that a node crashed before detection, we don't have to remove it. + return; + } // Instead of removing a node just remove all the service in it to make it unusable // We could add a param (CONTROL for example) to declare the node as STOP // find the node diff --git a/test/tests_core/test_routing_table/main.c b/test/tests_core/test_routing_table/main.c index b624b99ae..d6c1b34de 100644 --- a/test/tests_core/test_routing_table/main.c +++ b/test/tests_core/test_routing_table/main.c @@ -378,16 +378,6 @@ void unittest_RoutingTB_RemoveService(void) void unittest_RoutingTB_RemoveNode(void) { - NEW_TEST_CASE("Test RoutingTB_RemoveNode assert conditions"); - { - TRY - { - RoutingTB_RemoveNode(0); - } - TEST_ASSERT_TRUE(IS_ASSERT()); - END_TRY; - } - NEW_TEST_CASE("check RoutingTB_RemoveNode return value"); { TRY From 31943f23423c4ab194608364b9e7294ad81c8e46 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 11 Sep 2023 17:19:05 +0200 Subject: [PATCH 141/150] Clean Native Serial HAL --- .../HAL/NATIVE/serial_network_hal.c | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/network/serial_network/HAL/NATIVE/serial_network_hal.c b/network/serial_network/HAL/NATIVE/serial_network_hal.c index 6fe1092ff..bad7d3365 100644 --- a/network/serial_network/HAL/NATIVE/serial_network_hal.c +++ b/network/serial_network/HAL/NATIVE/serial_network_hal.c @@ -201,24 +201,6 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) // Set serial port parameters set_serial_raw_mode(); - // DCB dcb = {0}; - // dcb.DCBlength = sizeof(dcb); - // if (!GetCommState(hSerial, &dcb)) - // { - // printf("Error getting serial port state\n"); - // CloseHandle(hSerial); - // LUOS_ASSERT(0); - // } - // dcb.BaudRate = SERIAL_NETWORK_BAUDRATE; - // dcb.ByteSize = 8; - // dcb.StopBits = ONESTOPBIT; - // dcb.Parity = NOPARITY; - // if (!SetCommState(hSerial, &dcb)) - // { - // printf("Error setting serial port state\n"); - // CloseHandle(hSerial); - // LUOS_ASSERT(0); - // } Sleep(2); #else serial_port = open(portname, O_RDWR | O_NOCTTY | O_NONBLOCK); @@ -227,8 +209,6 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) printf("Error opening serial port\n"); printf("Error code: %d\n", errno); LUOS_ASSERT(0); - while (1) - ; } struct termios tty; memset(&tty, 0, sizeof(tty)); @@ -241,17 +221,8 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) } // Set raw mode without any special handling of input/output - // cfmakeraw(&tty); set_termios_raw_mode(&tty); - // Set output/ input to be non-blocking - // tty.c_cc[VMIN] = 0; - // tty.c_cc[VTIME] = 0; - // #if defined(__linux__) - // tty.c_ispeed = SERIAL_NETWORK_BAUDRATE; - // tty.c_ospeed = SERIAL_NETWORK_BAUDRATE; - // #endif - if (tcsetattr(serial_port, TCSANOW, &tty) != 0) { printf("Error setting serial port attributes\n"); @@ -361,10 +332,8 @@ void SerialHAL_Send(uint8_t *data, uint16_t size) int bytes_in_buffer; ssize_t bytesWritten; ioctl(serial_port, TIOCOUTQ, &bytes_in_buffer); - printf("%d bytes present before adding %d other.\n", bytes_in_buffer, size); bytesWritten = write(serial_port, data, size); LUOS_ASSERT(bytesWritten == size); - // tcdrain(serial_port); if (bytesWritten < 0) { printf("Error writing to serial port\n"); From 85c080053948170575fae2f94d0e8ce8ceca82c9 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Mon, 11 Sep 2023 17:32:02 +0200 Subject: [PATCH 142/150] Secure potential RX segfault if the RX buffer is smaller than the receiving datas. --- network/serial_network/src/serial_network.c | 1 + 1 file changed, 1 insertion(+) diff --git a/network/serial_network/src/serial_network.c b/network/serial_network/src/serial_network.c index 42955246a..3a8db4107 100644 --- a/network/serial_network/src/serial_network.c +++ b/network/serial_network/src/serial_network.c @@ -366,6 +366,7 @@ _CRITICAL void Serial_Send(void) *****************************************************************************/ _CRITICAL void Serial_ReceptionWrite(uint8_t *data, uint32_t size) { + LUOS_ASSERT((size < sizeof(RX_data)) && (data != NULL)); if (rx_size == 0) { // This is probably the first data we received for this message, we need to timestamp the reception date. From 6f958b4e5e7382aa93dc3ed36ec99722da9946c0 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 12 Sep 2023 17:15:51 +0200 Subject: [PATCH 143/150] Fix Gate compilation on windows --- tool_services/gate/select_format_script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool_services/gate/select_format_script.py b/tool_services/gate/select_format_script.py index 020f712b3..7417d0203 100644 --- a/tool_services/gate/select_format_script.py +++ b/tool_services/gate/select_format_script.py @@ -22,7 +22,7 @@ env.Append( CPPPATH=[realpath(env.get("PROJECT_DIR")+"/lib/"+item[1])]) env.Replace(SRC_FILTER=["+<*.c>, +<%s>" % - env.get("PROJECT_DIR")+"/lib/"+item[1]]) + (env.get("PROJECT_DIR")+"/lib/"+item[1])]) else: click.secho("\t* %s translation format not found." % item[1], fg="red") From 7fb67375948032f5ec0ab51419062da443855db1 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 12 Sep 2023 17:47:32 +0200 Subject: [PATCH 144/150] Fix a small datarace on RX --- engine/IO/src/luos_phy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/IO/src/luos_phy.c b/engine/IO/src/luos_phy.c index 1536dae0f..6c0096996 100644 --- a/engine/IO/src/luos_phy.c +++ b/engine/IO/src/luos_phy.c @@ -766,6 +766,12 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) // Now we can check if we need to store the received data if (phy_ptr->rx_keep) { + Phy_SetIrqState(false); + if (phy_ptr->rx_alloc_job == false) + { + Phy_SetIrqState(true); + return; + } // Compute the rx_phy_filter phy_ptr->rx_phy_filter = Phy_ComputeTargets(phy_ptr, (header_t *)phy_ptr->rx_buffer_base); if (phy_ptr->rx_phy_filter == 0) @@ -778,7 +784,6 @@ _CRITICAL static void Phy_alloc(luos_phy_t *phy_ptr) // We need to store the received data. // Update the informations allowing reception to continue and directly copy the data into the allocated buffer - Phy_SetIrqState(false); if (phy_ptr->rx_alloc_job) { uint16_t phy_stored_data_size = phy_ptr->received_data; From b32fa7ce25be39776344d9d412514e30ed1e24a3 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 12 Sep 2023 17:56:54 +0200 Subject: [PATCH 145/150] Improve serial Loop on ST MCU --- .../HAL/STM32F0/serial_network_hal.c | 28 +++++++++---------- .../HAL/STM32F4/serial_network_hal.c | 28 +++++++++---------- .../HAL/STM32G431/serial_network_hal.c | 27 ++++++++---------- .../HAL/STM32G474/serial_network_hal.c | 28 ++++++++----------- .../HAL/STM32L4/serial_network_hal.c | 28 +++++++++---------- 5 files changed, 61 insertions(+), 78 deletions(-) diff --git a/network/serial_network/HAL/STM32F0/serial_network_hal.c b/network/serial_network/HAL/STM32F0/serial_network_hal.c index 2bb2815cd..34f66a071 100644 --- a/network/serial_network/HAL/STM32F0/serial_network_hal.c +++ b/network/serial_network/HAL/STM32F0/serial_network_hal.c @@ -133,25 +133,23 @@ void SerialHAL_Loop(void) { uint16_t size = 0; uint16_t RX_PointerPosition = 0; - if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) - { - return; - } RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); - - if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow - { - SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); - size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; - } - else + if (RX_PointerPosition != RX_PrevPointerPosition) { - size = RX_PointerPosition - RX_PrevPointerPosition; + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; + // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy + Serial_ReceptionIncrease(size); } - RX_PrevPointerPosition = RX_PointerPosition; - // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy - Serial_ReceptionIncrease(size); } /****************************************************************************** diff --git a/network/serial_network/HAL/STM32F4/serial_network_hal.c b/network/serial_network/HAL/STM32F4/serial_network_hal.c index ff8da806a..4b21d53af 100644 --- a/network/serial_network/HAL/STM32F4/serial_network_hal.c +++ b/network/serial_network/HAL/STM32F4/serial_network_hal.c @@ -136,25 +136,23 @@ void SerialHAL_Loop(void) { uint16_t size = 0; uint16_t RX_PointerPosition = 0; - if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) - { - return; - } RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); - - if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow - { - SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); - size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; - } - else + if (RX_PointerPosition != RX_PrevPointerPosition) { - size = RX_PointerPosition - RX_PrevPointerPosition; + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; + // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy + Serial_ReceptionIncrease(size); } - RX_PrevPointerPosition = RX_PointerPosition; - // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy - Serial_ReceptionIncrease(size); } /****************************************************************************** diff --git a/network/serial_network/HAL/STM32G431/serial_network_hal.c b/network/serial_network/HAL/STM32G431/serial_network_hal.c index c53483b88..05b93944a 100644 --- a/network/serial_network/HAL/STM32G431/serial_network_hal.c +++ b/network/serial_network/HAL/STM32G431/serial_network_hal.c @@ -136,25 +136,20 @@ void SerialHAL_Loop(void) { uint16_t size = 0; uint16_t RX_PointerPosition = 0; - if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) - { - return; - } RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); - - if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow - { - SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); - size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; - } - else - { - size = RX_PointerPosition - RX_PrevPointerPosition; - } - RX_PrevPointerPosition = RX_PointerPosition; - if (size != 0) + if (RX_PointerPosition != RX_PrevPointerPosition) { + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy Serial_ReceptionIncrease(size); } diff --git a/network/serial_network/HAL/STM32G474/serial_network_hal.c b/network/serial_network/HAL/STM32G474/serial_network_hal.c index 9d411f880..726eceb51 100644 --- a/network/serial_network/HAL/STM32G474/serial_network_hal.c +++ b/network/serial_network/HAL/STM32G474/serial_network_hal.c @@ -136,30 +136,24 @@ void SerialHAL_Loop(void) { uint16_t size = 0; uint16_t RX_PointerPosition = 0; - if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) - { - return; - } RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); - - if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow - { - SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); - size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; - } - else - { - size = RX_PointerPosition - RX_PrevPointerPosition; - } - RX_PrevPointerPosition = RX_PointerPosition; - if (size != 0) + if (RX_PointerPosition != RX_PrevPointerPosition) { + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy Serial_ReceptionIncrease(size); } } - /****************************************************************************** * @brief Initialisation of the Serial communication * @param data pointer of the data to send diff --git a/network/serial_network/HAL/STM32L4/serial_network_hal.c b/network/serial_network/HAL/STM32L4/serial_network_hal.c index d0f78dc30..71ae31a07 100644 --- a/network/serial_network/HAL/STM32L4/serial_network_hal.c +++ b/network/serial_network/HAL/STM32L4/serial_network_hal.c @@ -135,25 +135,23 @@ void SerialHAL_Loop(void) { uint16_t size = 0; uint16_t RX_PointerPosition = 0; - if (LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL) == 0) - { - return; - } RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); - - if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow - { - SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); - size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; - } - else + if (RX_PointerPosition != RX_PrevPointerPosition) { - size = RX_PointerPosition - RX_PrevPointerPosition; + if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow + { + SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); + size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; + } + else + { + size = RX_PointerPosition - RX_PrevPointerPosition; + } + RX_PrevPointerPosition = RX_PointerPosition; + // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy + Serial_ReceptionIncrease(size); } - RX_PrevPointerPosition = RX_PointerPosition; - // Send the received data and size to the serial stack to deencapsulate it and send it to luos_phy - Serial_ReceptionIncrease(size); } /****************************************************************************** From 3c3e8cebdffb77165512a846129850a91651be63 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 12 Sep 2023 18:17:30 +0200 Subject: [PATCH 146/150] Fix Serial --- network/serial_network/HAL/NATIVE/serial_network_hal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/serial_network/HAL/NATIVE/serial_network_hal.c b/network/serial_network/HAL/NATIVE/serial_network_hal.c index bad7d3365..1a9a861ab 100644 --- a/network/serial_network/HAL/NATIVE/serial_network_hal.c +++ b/network/serial_network/HAL/NATIVE/serial_network_hal.c @@ -333,13 +333,13 @@ void SerialHAL_Send(uint8_t *data, uint16_t size) ssize_t bytesWritten; ioctl(serial_port, TIOCOUTQ, &bytes_in_buffer); bytesWritten = write(serial_port, data, size); - LUOS_ASSERT(bytesWritten == size); if (bytesWritten < 0) { printf("Error writing to serial port\n"); close(serial_port); LUOS_ASSERT(0); } + LUOS_ASSERT(bytesWritten == size); #endif Serial_TransmissionEnd(); } From 23428f6e6661cf0bb7067364b7045f9570e3e3bc Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Tue, 12 Sep 2023 18:18:18 +0200 Subject: [PATCH 147/150] Fix Native Gate node_config --- examples/projects/native/gate_wscom/node_config.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/projects/native/gate_wscom/node_config.h b/examples/projects/native/gate_wscom/node_config.h index 94e496935..c789f57da 100644 --- a/examples/projects/native/gate_wscom/node_config.h +++ b/examples/projects/native/gate_wscom/node_config.h @@ -107,10 +107,10 @@ * PIPE_TX_BUFFER_SIZE | 2048 | Transmit pipe buffer size * INIT_TIME | 150 | Wait init time before first detection ******************************************************************************/ -#define GATE_BUFF_SIZE 65000 -#define PIPE_RX_BUFFER_SIZE 65000 -#define PIPE_TX_BUFFER_SIZE 65000 -#define INIT_TIME 150 -#define GATE_REFRESH_TIME_S 0.05f - +#define GATE_BUFF_SIZE 65000 +#define PIPE_RX_BUFFER_SIZE 65000 +#define PIPE_TX_BUFFER_SIZE 65000 +#define SERIAL_RX_BUFFER_SIZE 65000 +#define INIT_TIME 150 +#define GATE_REFRESH_TIME_S 0.05f #endif /* _NODE_CONFIG_H_ */ From 25f9ee3d3985ad71b5ffb7e52e41d4d144582195 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 14 Sep 2023 10:48:35 +0200 Subject: [PATCH 148/150] Fix a Robus reception byte count mistake making big messages potentially crash. --- network/robus_network/src/reception.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/network/robus_network/src/reception.c b/network/robus_network/src/reception.c index 82f112e8c..473479e6a 100644 --- a/network/robus_network/src/reception.c +++ b/network/robus_network/src/reception.c @@ -181,6 +181,8 @@ _CRITICAL void Recep_GetData(luos_phy_t *phy_robus, volatile uint8_t *data) // Send an Ack Transmit_SendAck(); } + // Remove the CRC additional byte + phy_robus->received_data--; // Valid the message Phy_ValidMsg(phy_robus); } From a74df885670cc58a16a8b0183d90d05618b90984 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 14 Sep 2023 14:04:48 +0200 Subject: [PATCH 149/150] [SERIAL] Fix STM HAL DMA received size computation datarace in case of DATA RX during computation. --- network/serial_network/HAL/STM32F0/serial_network_hal.c | 3 +++ network/serial_network/HAL/STM32F4/serial_network_hal.c | 3 +++ network/serial_network/HAL/STM32G431/serial_network_hal.c | 3 +++ network/serial_network/HAL/STM32G474/serial_network_hal.c | 3 +++ network/serial_network/HAL/STM32L4/serial_network_hal.c | 3 +++ 5 files changed, 15 insertions(+) diff --git a/network/serial_network/HAL/STM32F0/serial_network_hal.c b/network/serial_network/HAL/STM32F0/serial_network_hal.c index 34f66a071..705d6a573 100644 --- a/network/serial_network/HAL/STM32F0/serial_network_hal.c +++ b/network/serial_network/HAL/STM32F0/serial_network_hal.c @@ -139,6 +139,9 @@ void SerialHAL_Loop(void) { if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow { + // Recompute the RX_PointerPosition to be sure to get the DMA buffer after the overflow. + // If the RX_PointerPosition was taken just before the overflow we may compute this with a wrong value. + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; } diff --git a/network/serial_network/HAL/STM32F4/serial_network_hal.c b/network/serial_network/HAL/STM32F4/serial_network_hal.c index 4b21d53af..cb38b3706 100644 --- a/network/serial_network/HAL/STM32F4/serial_network_hal.c +++ b/network/serial_network/HAL/STM32F4/serial_network_hal.c @@ -142,6 +142,9 @@ void SerialHAL_Loop(void) { if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow { + // Recompute the RX_PointerPosition to be sure to get the DMA buffer after the overflow. + // If the RX_PointerPosition was taken just before the overflow we may compute this with a wrong value. + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; } diff --git a/network/serial_network/HAL/STM32G431/serial_network_hal.c b/network/serial_network/HAL/STM32G431/serial_network_hal.c index 05b93944a..035565c34 100644 --- a/network/serial_network/HAL/STM32G431/serial_network_hal.c +++ b/network/serial_network/HAL/STM32G431/serial_network_hal.c @@ -142,6 +142,9 @@ void SerialHAL_Loop(void) { if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow { + // Recompute the RX_PointerPosition to be sure to get the DMA buffer after the overflow. + // If the RX_PointerPosition was taken just before the overflow we may compute this with a wrong value. + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; } diff --git a/network/serial_network/HAL/STM32G474/serial_network_hal.c b/network/serial_network/HAL/STM32G474/serial_network_hal.c index 726eceb51..589048861 100644 --- a/network/serial_network/HAL/STM32G474/serial_network_hal.c +++ b/network/serial_network/HAL/STM32G474/serial_network_hal.c @@ -142,6 +142,9 @@ void SerialHAL_Loop(void) { if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow { + // Recompute the RX_PointerPosition to be sure to get the DMA buffer after the overflow. + // If the RX_PointerPosition was taken just before the overflow we may compute this with a wrong value. + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; } diff --git a/network/serial_network/HAL/STM32L4/serial_network_hal.c b/network/serial_network/HAL/STM32L4/serial_network_hal.c index 71ae31a07..60ac5ac66 100644 --- a/network/serial_network/HAL/STM32L4/serial_network_hal.c +++ b/network/serial_network/HAL/STM32L4/serial_network_hal.c @@ -141,6 +141,9 @@ void SerialHAL_Loop(void) { if (SERIAL_RX_DMA_TC(SERIAL_RX_DMA) != RESET) // DMA buffer overflow { + // Recompute the RX_PointerPosition to be sure to get the DMA buffer after the overflow. + // If the RX_PointerPosition was taken just before the overflow we may compute this with a wrong value. + RX_PointerPosition = rx_buffer_size - LL_DMA_GetDataLength(SERIAL_RX_DMA, SERIAL_RX_DMA_CHANNEL); SERIAL_RX_DMA_CLEAR_TC(SERIAL_RX_DMA); size = (rx_buffer_size - RX_PrevPointerPosition) + RX_PointerPosition; } From bd5778f20c547265d7464f81604b9b6f647d69a9 Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Thu, 14 Sep 2023 16:44:14 +0200 Subject: [PATCH 150/150] [SERIAL] Secure messy RX interpretation --- network/serial_network/src/serial_network.c | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/network/serial_network/src/serial_network.c b/network/serial_network/src/serial_network.c index 3a8db4107..887d7a5b8 100644 --- a/network/serial_network/src/serial_network.c +++ b/network/serial_network/src/serial_network.c @@ -130,11 +130,17 @@ static void Serial_MoveRxPtr(uint8_t size) ******************************************************************************/ void Serial_Loop(void) { + static uint32_t timeout_systick = 0; SerialHAL_Loop(); // Manage received data while (rx_size > 0) { + if (*phy_serial->rx_buffer_base != SERIAL_HEADER) + { + Serial_MoveRxPtr(1); + continue; + } /*********************************************** * 1 - Receive the header and check if the message is complete *********************************************/ @@ -158,15 +164,37 @@ void Serial_Loop(void) // Header is continuous memcpy(&header, phy_serial->rx_buffer_base, sizeof(SerialHeader_t)); } + if (header.size >= sizeof(msg_t)) + { + // This data seems to be corrupted or at least we can't receive it with our buffer size, drop it. + Serial_MoveRxPtr(1); + } // Now we have the complete header, check if we receive the complete message if (rx_size < header.size + sizeof(SerialHeader_t) + 1) { // We don't receive the complete message yet. + // Manage a timeout to be sure we are not looking for a wrong message + if (timeout_systick == 0) + { + // Start the timeout counter + timeout_systick = LuosHAL_GetSystick(); + } + else + { + // We already start the timeout + if ((LuosHAL_GetSystick() - timeout_systick) > 100) + { + // We spend the 100ms timeout, remove the byte + Serial_MoveRxPtr(1); + timeout_systick = 0; + } + } return; } /*********************************************** * 2 - Receive the message *********************************************/ + timeout_systick = 0; uint8_t *footer_position = &phy_serial->rx_buffer_base[header.size + sizeof(SerialHeader_t)]; // Check if the footer address is after the end of the buffer if ((uintptr_t)footer_position >= (uintptr_t)RX_data + sizeof(RX_data))