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..e8d63d3a0 100644 --- a/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp +++ b/network/serial_network/HAL/ARDUINO/serial_network_hal.cpp @@ -34,6 +34,8 @@ extern "C" void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) { Serial.begin(SERIAL_COM_DEFAULTBAUDRATE); + pinMode(LED_BUILTIN, OUTPUT); + digitalWrite(LED_BUILTIN, LOW); } /****************************************************************************** @@ -46,8 +48,10 @@ void SerialHAL_Loop(void) uint8_t data = 0; while (Serial.available() > 0) { - data = Serial.read(); + digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) + data = Serial.read(); // say what you got: Serial_ReceptionAdd(&data, 1); + digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW } } diff --git a/network/serial_network/HAL/NATIVE/serial_network_hal.c b/network/serial_network/HAL/NATIVE/serial_network_hal.c index 0d63a6ea1..52d26b14f 100644 --- a/network/serial_network/HAL/NATIVE/serial_network_hal.c +++ b/network/serial_network/HAL/NATIVE/serial_network_hal.c @@ -168,6 +168,7 @@ void SerialHAL_Init(uint8_t *rx_buffer, uint32_t buffer_size) LUOS_ASSERT(0); } #endif + sleep(2); } /******************************************************************************