mirror of
https://github.com/okalachev/flix.git
synced 2025-07-27 17:49:33 +00:00
Minor cleanups
This commit is contained in:
parent
482bb8ed71
commit
8e629e3eea
@ -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);
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
// Utility functions
|
||||
|
||||
#include "math.h"
|
||||
#include <math.h>
|
||||
#include <soc/soc.h>
|
||||
#include <soc/rtc_cntl_reg.h>
|
||||
|
||||
@ -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) {
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user