diff --git a/flix/mavlink.ino b/flix/mavlink.ino index 20813b6..3a61471 100644 --- a/flix/mavlink.ino +++ b/flix/mavlink.ino @@ -54,9 +54,9 @@ void sendMavlink() { } } -inline void sendMessage(const void *msg) { +void sendMessage(const void *msg) { uint8_t buf[MAVLINK_MAX_PACKET_LEN]; - uint16_t len = mavlink_msg_to_send_buffer(buf, (mavlink_message_t *)msg); + int len = mavlink_msg_to_send_buffer(buf, (mavlink_message_t *)msg); sendWiFi(buf, len); } diff --git a/flix/util.ino b/flix/util.ino index 97b9e85..3976783 100644 --- a/flix/util.ino +++ b/flix/util.ino @@ -3,7 +3,7 @@ // Utility functions -#include "math.h" +#include #include #include @@ -23,7 +23,7 @@ float randomFloat(float min, float max) { return min + (max - min) * (float)rand() / RAND_MAX; } -// wrap angle to [-PI, PI) +// Wrap angle to [-PI, PI) float wrapAngle(float angle) { angle = fmodf(angle, 2 * PI); if (angle > PI) { diff --git a/flix/wifi.ino b/flix/wifi.ino index 9c9b2ab..05c03df 100644 --- a/flix/wifi.ino +++ b/flix/wifi.ino @@ -22,7 +22,8 @@ void setupWiFi() { IPAddress myIP = WiFi.softAPIP(); } -inline void sendWiFi(const uint8_t *buf, size_t len) { +void sendWiFi(const uint8_t *buf, int len) { +// if (!udp.beginPacket(WIFI_UDP_IP, WIFI_UDP_PORT)) return; udp.beginPacket(WIFI_UDP_IP, WIFI_UDP_PORT); udp.write(buf, len); udp.endPacket();