diff --git a/.github/workflows/example_build.py b/.github/workflows/example_build.py new file mode 100755 index 0000000..0c54edd --- /dev/null +++ b/.github/workflows/example_build.py @@ -0,0 +1,109 @@ +#!/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 = '.' + +# Compute the number of examples +nb_example = 0 +compiled_example = None +examples_success = None +examples_failed = None + +if os.path.isdir(exampledir): + for example in os.listdir(exampledir): + example_path = join(realpath(exampledir), 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, example, clean): + global compiled_example + 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("err.log", 'wb')): + with compiled_example.get_lock(): + compiled_example.value += 1 + value = FAIL+"FAILED " + str(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(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 example in os.listdir(exampledir): + example_path = join(exampledir, example) + cmd = "platformio run -d " + example_path + if (exists(join(example_path, "platformio.ini"))): + pool.apply_async( + compile_example, args=(cmd, 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") diff --git a/Apps/Blinker_app/blinker.c b/Apps/Blinker_app/blinker.c index 2170060..4f07ddb 100644 --- a/Apps/Blinker_app/blinker.c +++ b/Apps/Blinker_app/blinker.c @@ -14,7 +14,7 @@ volatile time_luos_t blinktime; unsigned long my_time; // Used to keep track of time volatile control_t control_app; -static void Blinker_MsgHandler(service_t *service, msg_t *msg); +static void Blinker_MsgHandler(service_t *service, const msg_t *msg); void Blinker_Init(void) { @@ -70,7 +70,7 @@ void Blinker_Loop(void) } } -static void Blinker_MsgHandler(service_t *service, msg_t *msg) +static void Blinker_MsgHandler(service_t *service, const msg_t *msg) { if (msg->header.cmd == CONTROL) { @@ -83,4 +83,4 @@ static void Blinker_MsgHandler(service_t *service, msg_t *msg) TimeOD_TimeFromMsg((time_luos_t *)&blinktime, msg); return; } -} \ No newline at end of file +} diff --git a/Apps/Blinker_app/blinker.h b/Apps/Blinker_app/blinker.h index dbab335..ee630d7 100644 --- a/Apps/Blinker_app/blinker.h +++ b/Apps/Blinker_app/blinker.h @@ -1,20 +1,27 @@ #ifndef BOOTLOADER_H #define BOOTLOADER_H +#ifdef __cplusplus +extern "C" +{ +#endif #include "luos_engine.h" -/******************************************************************************* - * Definitions - ******************************************************************************/ + /******************************************************************************* + * Definitions + ******************************************************************************/ -/******************************************************************************* - * Variables - ******************************************************************************/ + /******************************************************************************* + * Variables + ******************************************************************************/ -/******************************************************************************* - * Function - ******************************************************************************/ -void Blinker_Init(void); -void Blinker_Loop(void); + /******************************************************************************* + * Function + ******************************************************************************/ + void Blinker_Init(void); + void Blinker_Loop(void); -#endif /* LED_H */ \ No newline at end of file +#ifdef __cplusplus +} +#endif +#endif /* LED_H */ diff --git a/Arduino/lib/Led/led.c b/Arduino/lib/Led/led.cpp similarity index 89% rename from Arduino/lib/Led/led.c rename to Arduino/lib/Led/led.cpp index c7c9c4a..e7c97c8 100644 --- a/Arduino/lib/Led/led.c +++ b/Arduino/lib/Led/led.cpp @@ -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 @@ -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", revision); } /****************************************************************************** @@ -43,7 +46,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/Arduino/platformio.ini b/Arduino/platformio.ini index 7f6c940..0c4a489 100644 --- a/Arduino/platformio.ini +++ b/Arduino/platformio.ini @@ -33,18 +33,19 @@ build_flags = -O1 -include node_config.h -D LUOSHAL=ATSAMD21_ARDUINO + -D ROBUSHAL=ATSAMD21_ARDUINO -D GATEFORMAT=TinyJSON -D PIPEMODE=SERIAL -D PIPEHAL=ARDUINO lib_deps = - luos_engine@^2.9.2 + luos/luos_engine@^3.0.0 + luos/robus_network Led Blinker_App - Pipe - Gate - Inspector + luos/Pipe + luos/Gate lib_extra_dirs = - $PROJECT_DIR/../Apps + ../Apps lib diff --git a/Arduino/src/Arduino.cpp b/Arduino/src/Arduino.cpp index a4468c2..b967d8d 100644 --- a/Arduino/src/Arduino.cpp +++ b/Arduino/src/Arduino.cpp @@ -1,19 +1,10 @@ #include - -#ifdef __cplusplus -extern "C" -{ -#endif - #include "luos_engine.h" #include "led.h" #include "blinker.h" #include "pipe.h" #include "gate.h" - -#ifdef __cplusplus -} -#endif +#include "robus_network.h" /****************************************************************************** * @brief Setup ardiuno @@ -23,6 +14,7 @@ extern "C" void setup() { Luos_Init(); + Robus_Init(); Led_Init(); Pipe_Init(); Gate_Init(); @@ -36,6 +28,7 @@ void setup() void loop() { Luos_Loop(); + Robus_Loop(); Led_Loop(); Pipe_Loop(); Gate_Loop(); diff --git a/ESP32-DevKit/lib/Led/CMakeLists.txt b/ESP32-DevKit/lib/Led/CMakeLists.txt index 24b42b3..3e03f41 100644 --- a/ESP32-DevKit/lib/Led/CMakeLists.txt +++ b/ESP32-DevKit/lib/Led/CMakeLists.txt @@ -1,7 +1,7 @@ -set(srcs "led.c") +set(srcs "led") -set(inc ".") +set(inc ".") -idf_component_register( SRCS ${srcs} - INCLUDE_DIRS ${inc} - REQUIRES luos_engine led_strip) +idf_component_register(SRCS ${srcs} + INCLUDE_DIRS ${inc} + REQUIRES luos_engine) diff --git a/ESP32-DevKit/lib/Led/README.md b/ESP32-DevKit/lib/Led/README.md index e8a6a72..e8bf85f 100644 --- a/ESP32-DevKit/lib/Led/README.md +++ b/ESP32-DevKit/lib/Led/README.md @@ -7,12 +7,12 @@ https://github.com/Luos-io/examples/blob/master/LICENSE) [![](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) -# Button driver -Driver for using a push button in your projects with Luos. +# Led driver +Driver for using a led in your projects with Luos. # Linked project -This driver is linked to the [Button project](../../Projects/button). +This driver is linked to the [led project](../../Projects/led). [![](https://img.shields.io/discourse/topics?server=https%3A%2F%2Fcommunity.luos.io&logo=Discourse)](https://community.luos.io) -[![](https://img.shields.io/badge/Luos-Documentation-34A3B4)](https://docs.luos.io) +[![](https://img.shields.io/badge/Luos-Documentation-34A3B4)](https://www.luos.io/docs/) [![](https://img.shields.io/badge/LinkedIn-Follow%20us-0077B5?style=flat&logo=linkedin)](https://www.linkedin.com/company/luos) diff --git a/ESP32-DevKit/lib/Led/led.h b/ESP32-DevKit/lib/Led/led.h index 392ff02..5bea935 100644 --- a/ESP32-DevKit/lib/Led/led.h +++ b/ESP32-DevKit/lib/Led/led.h @@ -1,11 +1,11 @@ /****************************************************************************** - * @file led - * @brief driver example a simple led + * @file button + * @brief driver example a simple button * @author Luos * @version 0.0.0 ******************************************************************************/ -#ifndef LED_H -#define LED_H +#ifndef BUTTON_H +#define BUTTON_H #include "luos_engine.h" /******************************************************************************* @@ -22,4 +22,4 @@ void Led_Init(void); void Led_Loop(void); -#endif /* LED_H */ +#endif /* BUTTON_H */ diff --git a/ESP32-DevKit/lib/Led/library.json b/ESP32-DevKit/lib/Led/library.json index c000340..bd4e1c1 100644 --- a/ESP32-DevKit/lib/Led/library.json +++ b/ESP32-DevKit/lib/Led/library.json @@ -1,7 +1,7 @@ { "name": "led", - "keywords": "robus,network,microservice,luos,operating system,os,embedded,communication,container,ST", - "description": "a simple button driver", + "keywords": "robus,network,microservice,luos,operating system,os,embedded,communication,service,ST", + "description": "a simple led driver", "version": "1.0.0", "authors": { "name": "Luos", @@ -9,6 +9,6 @@ }, "licence": "MIT", "dependencies": { - "luos/luos_engine": "^2.9.0" + "luos_engine": "^3.0.0" } -} \ No newline at end of file +} diff --git a/ESP32-DevKit/lib/Led/led.c b/ESP32-DevKit/lib/led/led.cpp similarity index 52% rename from ESP32-DevKit/lib/Led/led.c rename to ESP32-DevKit/lib/led/led.cpp index e98155e..d43fd24 100644 --- a/ESP32-DevKit/lib/Led/led.c +++ b/ESP32-DevKit/lib/led/led.cpp @@ -4,31 +4,21 @@ * @author Luos * @version 0.0.0 ******************************************************************************/ +#include #include "led.h" -#include "driver/gpio.h" - -#ifndef CONFIG_IDF_TARGET_ESP32 -#include "led_strip.h" -#endif /******************************************************************************* * Definitions ******************************************************************************/ -#ifdef CONFIG_IDF_TARGET_ESP32 -#define LED_GPIO (GPIO_NUM_18) -#else -#define LED_GPIO (GPIO_NUM_8) -static led_strip_t *pStrip_a; -#endif +#define LED_PIN 18 /******************************************************************************* * Variables ******************************************************************************/ -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 @@ -36,24 +26,12 @@ static void Led_MsgHandler(service_t *service, msg_t *msg); ******************************************************************************/ void Led_Init(void) { - revision_t revision = {.major = 1, .minor = 0, .build = 0}; -#ifdef CONFIG_IDF_TARGET_ESP32 - gpio_config_t LedConfig; - - gpio_reset_pin(LED_GPIO); - LedConfig.intr_type = GPIO_INTR_DISABLE; - LedConfig.mode = GPIO_MODE_OUTPUT; - LedConfig.pin_bit_mask = (1ULL << LED_GPIO); - LedConfig.pull_down_en = GPIO_PULLDOWN_DISABLE; - LedConfig.pull_up_en = GPIO_PULLUP_DISABLE; - gpio_config(&LedConfig); + revision_t revision; + revision.major = 1; + revision.minor = 0; + revision.build = 0; + pinMode(LED_PIN, OUTPUT); Luos_CreateService(Led_MsgHandler, STATE_TYPE, "led", revision); -#else - pStrip_a = led_strip_init(0, LED_GPIO, 1); - pStrip_a->set_pixel(pStrip_a, 0, 0, 0, 0); - pStrip_a->refresh(pStrip_a, 50); - Luos_CreateService(Led_MsgHandler, COLOR_TYPE, "led_rgb", revision); -#endif } /****************************************************************************** * @brief loop must be call in project loop @@ -69,26 +47,17 @@ 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) { - if (msg->data[0] != Led_last_state) + if (msg->data[0] == 0) { - Led_last_state = msg->data[0]; - gpio_set_level(LED_GPIO, Led_last_state); + digitalWrite(LED_PIN, false); + } + else + { + digitalWrite(LED_PIN, true); } } -#else - color_t rgb; - if (msg->header.cmd == COLOR) - { - IlluminanceOD_ColorFromMsg((color_t *)&rgb, msg); - /* Set the LED pixel using RGB from 0 (0%) to 255 (100%) for each color */ - pStrip_a->set_pixel(pStrip_a, 0, rgb.r, rgb.g, rgb.b); - /* Refresh the strip to send data */ - pStrip_a->refresh(pStrip_a, 50); - } -#endif } diff --git a/ESP32-DevKit/node_config.h b/ESP32-DevKit/node_config.h index d83aab5..f207c2d 100644 --- a/ESP32-DevKit/node_config.h +++ b/ESP32-DevKit/node_config.h @@ -44,9 +44,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 @@ -98,13 +98,12 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | max number of node in the network * 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/ESP32-DevKit/platformio.ini b/ESP32-DevKit/platformio.ini index 9ec3ad7..105274d 100644 --- a/ESP32-DevKit/platformio.ini +++ b/ESP32-DevKit/platformio.ini @@ -20,18 +20,19 @@ build_flags = -O1 -include node_config.h -D LUOSHAL=ESP32 + -D ROBUSHAL=ESP32 -D GATEFORMAT=TinyJSON -D PIPEMODE=SERIAL -D PIPEHAL=ARDUINO lib_deps = - luos_engine@^2.9.2 + luos/luos_engine@^3.0.0 + luos/robus_network Led Blinker_App - Pipe - Gate - Inspector + luos/Pipe + luos/Gate lib_extra_dirs = - $PROJECT_DIR/../Apps + ../Apps lib [env:esp32dev] diff --git a/ESP32-DevKit/sdkconfig.esp32-c3-devkitm-1 b/ESP32-DevKit/sdkconfig.esp32-c3-devkitm-1 index 9b8363b..51bb557 100644 --- a/ESP32-DevKit/sdkconfig.esp32-c3-devkitm-1 +++ b/ESP32-DevKit/sdkconfig.esp32-c3-devkitm-1 @@ -53,6 +53,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 @@ -105,6 +106,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 @@ -141,22 +145,21 @@ CONFIG_PARTITION_TABLE_MD5=y # # Arduino Configuration # +CONFIG_ARDUINO_VARIANT="esp32c3" CONFIG_ENABLE_ARDUINO_DEPENDS=y CONFIG_AUTOSTART_ARDUINO=y -# CONFIG_ARDUINO_RUN_CORE0 is not set -CONFIG_ARDUINO_RUN_CORE1=y -# CONFIG_ARDUINO_RUN_NO_AFFINITY is not set -CONFIG_ARDUINO_RUNNING_CORE=1 +CONFIG_ARDUINO_RUN_CORE0=y +CONFIG_ARDUINO_RUNNING_CORE=0 CONFIG_ARDUINO_LOOP_STACK_SIZE=8192 -# CONFIG_ARDUINO_EVENT_RUN_CORE0 is not set -CONFIG_ARDUINO_EVENT_RUN_CORE1=y -# CONFIG_ARDUINO_EVENT_RUN_NO_AFFINITY is not set -CONFIG_ARDUINO_EVENT_RUNNING_CORE=1 -# 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_EVENT_RUN_CORE0=y +CONFIG_ARDUINO_EVENT_RUNNING_CORE=0 +CONFIG_ARDUINO_SERIAL_EVENT_RUN_CORE0=y +CONFIG_ARDUINO_SERIAL_EVENT_TASK_RUNNING_CORE=0 +CONFIG_ARDUINO_SERIAL_EVENT_TASK_STACK_SIZE=2048 +CONFIG_ARDUINO_SERIAL_EVENT_TASK_PRIORITY=24 +CONFIG_ARDUINO_UDP_RUN_CORE0=y +CONFIG_ARDUINO_UDP_RUNNING_CORE=0 CONFIG_ARDUINO_UDP_TASK_PRIORITY=3 -CONFIG_ARDUINO_UDP_RUNNING_CORE=1 # CONFIG_ARDUINO_ISR_IRAM is not set CONFIG_DISABLE_HAL_LOCKS=y @@ -302,8 +305,8 @@ CONFIG_EFUSE_MAX_BLK_LEN=256 # CONFIG_ESP_TLS_USING_MBEDTLS=y CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y -# 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 @@ -318,6 +321,7 @@ CONFIG_ESP32C3_DEFAULT_CPU_FREQ_MHZ=160 # CONFIG_ESP32C3_REV_MIN_1 is not set # CONFIG_ESP32C3_REV_MIN_2 is not set CONFIG_ESP32C3_REV_MIN_3=y +# CONFIG_ESP32C3_REV_MIN_4 is not set CONFIG_ESP32C3_REV_MIN=3 CONFIG_ESP32C3_DEBUG_OCDAWARE=y CONFIG_ESP32C3_BROWNOUT_DET=y @@ -480,6 +484,13 @@ CONFIG_ESP_PHY_ENABLE_USB=y CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y # 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 # @@ -525,6 +536,7 @@ CONFIG_ESP_INT_WDT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=3000 # CONFIG_ESP_TASK_WDT is not set CONFIG_ESP_PANIC_HANDLER_IRAM=y +# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y # end of ESP System Settings @@ -568,6 +580,7 @@ CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_GCMP_SUPPORT 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 # @@ -684,7 +697,6 @@ CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y # CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set CONFIG_FREERTOS_DEBUG_OCDAWARE=y CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y -# CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set # end of FreeRTOS # @@ -910,6 +922,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 @@ -1061,6 +1074,7 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y # # NVS # +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set # end of NVS # @@ -1197,7 +1211,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 @@ -1214,6 +1227,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 # @@ -1226,6 +1240,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 @@ -1296,19 +1312,18 @@ CONFIG_ESP32H2_MEMPROT_FEATURE=y CONFIG_ESP32H2_MEMPROT_FEATURE_LOCK=y CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 -CONFIG_MAIN_TASK_STACK_SIZE=3584 -CONFIG_CONSOLE_UART_DEFAULT=y -# CONFIG_CONSOLE_UART_CUSTOM is not set +CONFIG_MAIN_TASK_STACK_SIZE=4096 +# CONFIG_CONSOLE_UART_DEFAULT is not set +CONFIG_CONSOLE_UART_CUSTOM=y # CONFIG_ESP_CONSOLE_UART_NONE is not set CONFIG_CONSOLE_UART=y CONFIG_CONSOLE_UART_NUM=0 -CONFIG_CONSOLE_UART_BAUDRATE=115200 +CONFIG_CONSOLE_UART_TX_GPIO=21 +CONFIG_CONSOLE_UART_RX_GPIO=20 +CONFIG_CONSOLE_UART_BAUDRATE=1000000 CONFIG_INT_WDT=y -CONFIG_INT_WDT_TIMEOUT_MS=300 -CONFIG_TASK_WDT=y -# CONFIG_TASK_WDT_PANIC is not set -CONFIG_TASK_WDT_TIMEOUT_S=5 -CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_INT_WDT_TIMEOUT_MS=3000 +# CONFIG_TASK_WDT is not set # CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set CONFIG_TIMER_TASK_STACK_SIZE=3584 # CONFIG_EXTERNAL_COEX_ENABLE is not set @@ -1368,5 +1383,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/ESP32-DevKit/sdkconfig.esp32dev b/ESP32-DevKit/sdkconfig.esp32dev index 2c86f13..1defa74 100644 --- a/ESP32-DevKit/sdkconfig.esp32dev +++ b/ESP32-DevKit/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 # @@ -606,6 +624,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 # @@ -955,6 +974,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 @@ -1106,6 +1126,7 @@ CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y # # NVS # +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set # end of NVS # @@ -1243,7 +1264,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 @@ -1260,6 +1280,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 # @@ -1272,6 +1293,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 @@ -1444,5 +1467,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/ESP32-DevKit/src/main.cpp b/ESP32-DevKit/src/main.cpp index a4468c2..ab40612 100644 --- a/ESP32-DevKit/src/main.cpp +++ b/ESP32-DevKit/src/main.cpp @@ -1,20 +1,12 @@ #include - -#ifdef __cplusplus -extern "C" -{ -#endif - #include "luos_engine.h" #include "led.h" +#include "robus_network.h" + #include "blinker.h" #include "pipe.h" #include "gate.h" -#ifdef __cplusplus -} -#endif - /****************************************************************************** * @brief Setup ardiuno * @param None @@ -23,6 +15,7 @@ extern "C" void setup() { Luos_Init(); + Robus_Init(); Led_Init(); Pipe_Init(); Gate_Init(); @@ -36,6 +29,7 @@ void setup() void loop() { Luos_Loop(); + Robus_Loop(); Led_Loop(); Pipe_Loop(); Gate_Loop(); diff --git a/NUCLEO-F072RB/lib/Led/led.c b/NUCLEO-F072RB/lib/Led/led.c index 166dd1a..99f0814 100644 --- a/NUCLEO-F072RB/lib/Led/led.c +++ b/NUCLEO-F072RB/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 @@ -42,7 +42,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/NUCLEO-F072RB/platformio.ini b/NUCLEO-F072RB/platformio.ini index d420437..d39c6f4 100644 --- a/NUCLEO-F072RB/platformio.ini +++ b/NUCLEO-F072RB/platformio.ini @@ -24,17 +24,18 @@ build_flags = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DLUOSHAL=STM32F0 + -DROBUSHAL=STM32F0 -D PIPEMODE=SERIAL -D PIPEHAL=NUCLEO-F0 lib_deps = - luos_engine@^2.9.2 + luos/luos_engine@^3.0.0 + luos/robus_network Led Blinker_App - Pipe - Gate - Inspector + luos/Pipe + luos/Gate lib_extra_dirs = - $PROJECT_DIR/../Apps + ../Apps lib debug_tool = stlink upload_protocol = stlink diff --git a/NUCLEO-F072RB/src/main.c b/NUCLEO-F072RB/src/main.c index 5b9cb48..313d908 100644 --- a/NUCLEO-F072RB/src/main.c +++ b/NUCLEO-F072RB/src/main.c @@ -28,6 +28,7 @@ #include "led.h" #include "luos_engine.h" #include "pipe.h" +#include "robus_network.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -92,6 +93,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Led_Init(); Pipe_Init(); Gate_Init(); @@ -103,6 +105,7 @@ int main(void) while (1) { Luos_Loop(); + Robus_Loop(); Led_Loop(); Pipe_Loop(); Gate_Loop(); diff --git a/NUCLEO-F401RE/lib/Led/led.c b/NUCLEO-F401RE/lib/Led/led.c index 166dd1a..99f0814 100644 --- a/NUCLEO-F401RE/lib/Led/led.c +++ b/NUCLEO-F401RE/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 @@ -42,7 +42,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/NUCLEO-F401RE/platformio.ini b/NUCLEO-F401RE/platformio.ini index 7ebb3b9..7369cae 100644 --- a/NUCLEO-F401RE/platformio.ini +++ b/NUCLEO-F401RE/platformio.ini @@ -24,17 +24,18 @@ build_flags = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DLUOSHAL=STM32F4 + -DROBUSHAL=STM32F4 -D PIPEMODE=SERIAL -D PIPEHAL=NUCLEO-F4 lib_deps = - luos_engine@^2.9.2 + luos/luos_engine@^3.0.0 + luos/robus_network Led Blinker_App - Pipe - Gate - Inspector + luos/Pipe + luos/Gate lib_extra_dirs = - $PROJECT_DIR/../Apps + ../Apps lib debug_tool = stlink upload_protocol = stlink diff --git a/NUCLEO-F401RE/src/main.c b/NUCLEO-F401RE/src/main.c index 752955c..4f8b210 100644 --- a/NUCLEO-F401RE/src/main.c +++ b/NUCLEO-F401RE/src/main.c @@ -28,6 +28,7 @@ #include "led.h" #include "luos_engine.h" #include "pipe.h" +#include "robus_network.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -91,6 +92,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Led_Init(); Pipe_Init(); Gate_Init(); @@ -105,6 +107,7 @@ int main(void) /* USER CODE BEGIN 3 */ Luos_Loop(); + Robus_Loop(); Led_Loop(); Pipe_Loop(); Gate_Loop(); diff --git a/NUCLEO-F410RB/lib/Led/led.c b/NUCLEO-F410RB/lib/Led/led.c index 166dd1a..99f0814 100644 --- a/NUCLEO-F410RB/lib/Led/led.c +++ b/NUCLEO-F410RB/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 @@ -42,7 +42,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/NUCLEO-F410RB/platformio.ini b/NUCLEO-F410RB/platformio.ini index a6fe4f7..6cbdece 100644 --- a/NUCLEO-F410RB/platformio.ini +++ b/NUCLEO-F410RB/platformio.ini @@ -24,17 +24,18 @@ build_flags = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DLUOSHAL=STM32F4 + -DROBUSHAL=STM32F4 -D PIPEMODE=SERIAL -D PIPEHAL=NUCLEO-F4 lib_deps = - luos_engine@^2.9.2 + luos/luos_engine@^3.0.0 + luos/robus_network Led Blinker_App - Pipe - Gate - Inspector + luos/Pipe + luos/Gate lib_extra_dirs = - $PROJECT_DIR/../Apps + ../Apps lib debug_tool = stlink upload_protocol = stlink diff --git a/NUCLEO-F410RB/src/main.c b/NUCLEO-F410RB/src/main.c index c5ddb70..0686cb1 100644 --- a/NUCLEO-F410RB/src/main.c +++ b/NUCLEO-F410RB/src/main.c @@ -28,6 +28,7 @@ #include "led.h" #include "luos_engine.h" #include "pipe.h" +#include "robus_network.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -91,6 +92,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Led_Init(); Pipe_Init(); Gate_Init(); @@ -105,6 +107,7 @@ int main(void) /* USER CODE BEGIN 3 */ Luos_Loop(); + Robus_Loop(); Led_Loop(); Pipe_Loop(); Gate_Loop(); diff --git a/NUCLEO-G431KB/lib/Led/led.c b/NUCLEO-G431KB/lib/Led/led.c index 166dd1a..99f0814 100644 --- a/NUCLEO-G431KB/lib/Led/led.c +++ b/NUCLEO-G431KB/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 @@ -42,7 +42,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/NUCLEO-G431KB/platformio.ini b/NUCLEO-G431KB/platformio.ini index 08e3afa..960ebdc 100644 --- a/NUCLEO-G431KB/platformio.ini +++ b/NUCLEO-G431KB/platformio.ini @@ -24,15 +24,16 @@ build_flags = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DLUOSHAL=STM32G4 + -DROBUSHAL=STM32G4 -D PIPEMODE=SERIAL -D PIPEHAL=NUCLEO-G431 lib_deps = - luos_engine@^2.9.2 + luos/luos_engine@^3.0.0 + luos/robus_network Led Blinker_App - Pipe - Gate - Inspector + luos/Pipe + luos/Gate lib_extra_dirs = - $PROJECT_DIR/../Apps + ../Apps lib diff --git a/NUCLEO-G431KB/src/main.c b/NUCLEO-G431KB/src/main.c index 7d00e19..51f4026 100644 --- a/NUCLEO-G431KB/src/main.c +++ b/NUCLEO-G431KB/src/main.c @@ -28,6 +28,7 @@ #include "led.h" #include "luos_engine.h" #include "pipe.h" +#include "robus_network.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -91,6 +92,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Led_Init(); Pipe_Init(); Gate_Init(); @@ -105,6 +107,7 @@ int main(void) /* USER CODE BEGIN 3 */ Luos_Loop(); + Robus_Loop(); Led_Loop(); Pipe_Loop(); Gate_Loop(); diff --git a/NUCLEO-L432KC/lib/Led/led.c b/NUCLEO-L432KC/lib/Led/led.c index 166dd1a..99f0814 100644 --- a/NUCLEO-L432KC/lib/Led/led.c +++ b/NUCLEO-L432KC/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 @@ -42,7 +42,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/NUCLEO-L432KC/platformio.ini b/NUCLEO-L432KC/platformio.ini index 7bfc83e..43b8bc6 100644 --- a/NUCLEO-L432KC/platformio.ini +++ b/NUCLEO-L432KC/platformio.ini @@ -24,16 +24,18 @@ build_flags = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER -DLUOSHAL=STM32L4 + -DROBUSHAL=STM32L4 -D PIPEMODE=SERIAL -D PIPEHAL=NUCLEO-L4 lib_deps = - luos_engine@^2.9.2 + luos/luos_engine@^3.0.0 + luos/robus_network Led Blinker_App - Pipe - Gate + luos/Pipe + luos/Gate lib_extra_dirs = - $PROJECT_DIR/../Apps + ../Apps lib debug_tool = stlink upload_protocol = stlink diff --git a/NUCLEO-L432KC/src/main.c b/NUCLEO-L432KC/src/main.c index eff460e..d4bade0 100644 --- a/NUCLEO-L432KC/src/main.c +++ b/NUCLEO-L432KC/src/main.c @@ -28,7 +28,7 @@ #include "led.h" #include "luos_engine.h" #include "pipe.h" - +#include "robus_network.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -93,6 +93,7 @@ int main(void) MX_GPIO_Init(); /* USER CODE BEGIN 2 */ Luos_Init(); + Robus_Init(); Led_Init(); Pipe_Init(); Gate_Init(); @@ -107,6 +108,7 @@ int main(void) /* USER CODE BEGIN 3 */ Luos_Loop(); + Robus_Loop(); Led_Loop(); Pipe_Loop(); Gate_Loop(); diff --git a/No-Board/lib/Led/led.c b/No-Board/lib/Led/led.c index 32af6de..7cb7f5f 100644 --- a/No-Board/lib/Led/led.c +++ b/No-Board/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/No-Board/node_config.h b/No-Board/node_config.h index 95e81da..b88bb44 100644 --- a/No-Board/node_config.h +++ b/No-Board/node_config.h @@ -95,13 +95,12 @@ ******************************************************************************* * Define | Default Value | Description * :-------------------------|------------------------------------------------------ - * MAX_RTB_ENTRY | 40 | max number entry in routing table + * MAX_NODE_NUMBER | 20 | max number of node in the network * 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 * 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/No-Board/platformio.ini b/No-Board/platformio.ini index 762fd9f..9f048cf 100644 --- a/No-Board/platformio.ini +++ b/No-Board/platformio.ini @@ -26,16 +26,17 @@ build_flags = -lpthread -lm -D LUOSHAL=NATIVE + -D ROBUSHAL=NATIVE -D PIPEMODE=WS -D PIPEHAL=native lib_deps = - luos_engine@^2.9.2 + luos/luos_engine@^3.0.0 Led Blinker_App - Pipe - Gate - Inspector + luos/Pipe + luos/Gate + luos/robus_network lib_extra_dirs = ../Apps diff --git a/No-Board/src/main.c b/No-Board/src/main.c index 584f5c8..12addd3 100644 --- a/No-Board/src/main.c +++ b/No-Board/src/main.c @@ -6,6 +6,7 @@ #include "gate.h" #include "led.h" #include "luos_engine.h" +#include "robus_network.h" #include "pipe.h" /***************************************** @@ -15,6 +16,7 @@ int main(void) { Luos_Init(); + Robus_Init(); Led_Init(); Pipe_Init(); Gate_Init(); @@ -23,6 +25,7 @@ int main(void) while (1) { Luos_Loop(); + Robus_Loop(); Led_Loop(); Pipe_Loop(); Gate_Loop();