Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed time.h import, added Arduino UNO R4 minima (USB), Arduino UNO R4 WiFi (USB and WiFi), Arduino Giga R1 (USB and WiFi) #1712

Open
wants to merge 19 commits into
base: iron
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions examples/micro-ros_publisher_wifi/micro-ros_publisher_wifi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include <std_msgs/msg/int32.h>

#if !defined(ESP32) && !defined(TARGET_PORTENTA_H7_M7) && !defined(ARDUINO_NANO_RP2040_CONNECT) && !defined(ARDUINO_WIO_TERMINAL)
#error This example is only available for Arduino Portenta, Arduino Nano RP2040 Connect, ESP32 Dev module and Wio Terminal
#if !defined(ESP32) && !defined(TARGET_PORTENTA_H7_M7) && !defined(ARDUINO_GIGA) && !defined(ARDUINO_NANO_RP2040_CONNECT) && !defined(ARDUINO_WIO_TERMINAL) && !defined(ARDUINO_UNOR4_WIFI)
#error This example is only available for Arduino Portenta, Arduino Giga R1, Arduino Nano RP2040 Connect, ESP32 Dev module, Wio Terminal and Arduino Uno R4 WiFi
#endif

rcl_publisher_t publisher;
Expand All @@ -18,7 +18,11 @@ rclc_support_t support;
rcl_allocator_t allocator;
rcl_node_t node;

#define LED_PIN 13
#ifdef ARDUINO_GIGA
gbr1 marked this conversation as resolved.
Show resolved Hide resolved
#define LED_PIN LEDR
#else
#define LED_PIN 13
#endif

#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}}
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include <std_msgs/msg/int32.h>

#if defined(ESP32) || defined(TARGET_PORTENTA_H7_M7) || defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_WIO_TERMINAL)
#if defined(ESP32) || defined(TARGET_PORTENTA_H7_M7) || defined(ARDUINO_GIGA) || defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_WIO_TERMINAL)
#define BOARD_HAS_NATIVE_WIFI
#endif

Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ paragraph=micro-ROS Arduino library
url=https://github.com/micro-ROS/micro_ros_arduino
precompiled=true
category=Other
architectures=stm32,OpenCR,Teensyduino,samd,sam,mbed,esp32,mbed_portenta
architectures=stm32,OpenCR,Teensyduino,samd,sam,mbed,esp32,mbed_portenta,mbed_giga,renesas_uno
2 changes: 1 addition & 1 deletion src/default_transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extern "C"
{
#include <stdio.h>
#include <stdbool.h>
#include <sys/time.h>
#include <time.h>

int clock_gettime(clockid_t unused, struct timespec *tp) __attribute__ ((weak));
bool arduino_transport_open(struct uxrCustomTransport * transport) __attribute__ ((weak));
Expand Down
8 changes: 5 additions & 3 deletions src/micro_ros_arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ static inline void set_microros_native_ethernet_udp_transports(byte mac[], IPAdd

#endif

#if defined(ESP32) || defined(TARGET_PORTENTA_H7_M7) || defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_WIO_TERMINAL) || defined(BOARD_WITH_ESP_AT)
#if defined(ESP32) || defined(TARGET_PORTENTA_H7_M7) || defined(ARDUINO_GIGA) || defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_WIO_TERMINAL) || defined(BOARD_WITH_ESP_AT) || defined(ARDUINO_UNOR4_WIFI)

#if defined(ESP32) || defined(TARGET_PORTENTA_H7_M7)
#if defined(ESP32) || defined(TARGET_PORTENTA_H7_M7) || defined(ARDUINO_GIGA)
#include <WiFi.h>
#include <WiFiUdp.h>
#elif defined(ARDUINO_NANO_RP2040_CONNECT)
Expand All @@ -108,6 +108,8 @@ static inline void set_microros_native_ethernet_udp_transports(byte mac[], IPAdd
#include <WiFiUdp.h>
#elif defined(BOARD_WITH_ESP_AT)
#include <WiFiEspAT.h>
#elif defined(ARDUINO_UNOR4_WIFI)
#include <WiFiS3.h>
#endif

extern "C" bool arduino_wifi_transport_open(struct uxrCustomTransport * transport);
Expand All @@ -121,7 +123,7 @@ struct micro_ros_agent_locator {
};
#endif

static inline void set_microros_wifi_transports(char * ssid, char * pass, char * agent_ip, uint agent_port){
static inline void set_microros_wifi_transports(char * ssid, char * pass, char * agent_ip, uint32_t agent_port){

#if defined(BOARD_WITH_ESP_AT)
ESP_AT_SERIAL_PORT.begin(ESP_AT_BAUDRATE);
Expand Down
6 changes: 4 additions & 2 deletions src/wifi_transport.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#if defined(ESP32) || defined(TARGET_PORTENTA_H7_M7) || defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_WIO_TERMINAL) || defined(BOARD_WITH_ESP_AT)
#if defined(ESP32) || defined(TARGET_PORTENTA_H7_M7) || defined(ARDUINO_GIGA) || defined(ARDUINO_NANO_RP2040_CONNECT) || defined(ARDUINO_WIO_TERMINAL) || defined(BOARD_WITH_ESP_AT) || defined(ARDUINO_UNOR4_WIFI)
#include <Arduino.h>


#if defined(ESP32) || defined(TARGET_PORTENTA_H7_M7)
#if defined(ESP32) || defined(TARGET_PORTENTA_H7_M7) || defined(ARDUINO_GIGA)
#include <WiFi.h>
#include <WiFiUdp.h>
#elif defined(ARDUINO_NANO_RP2040_CONNECT)
Expand All @@ -13,6 +13,8 @@
#include <WiFiUdp.h>
#elif defined(BOARD_WITH_ESP_AT)
#include <WiFiEspAT.h>
#elid defined(ARDUINO_UNOR4_WIFI)
#include <WiFiS3.h>
#endif

#include <micro_ros_arduino.h>
Expand Down