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

Gps snapshot 1 #158

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
build fix
  • Loading branch information
rtlopez committed Feb 18, 2025
commit 79e597ff4df6b222adcfecd390d91c5ab21b048d
4 changes: 3 additions & 1 deletion lib/Espfc/src/Connect/MspProcessor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "Connect/MspProcessor.hpp"
#include "Hardware.h"
#include <platform.h>
#include <algorithm>
#include <limits>
#if defined(ESPFC_MULTI_CORE) && defined(ESPFC_FREE_RTOS)
#include <driver/timer.h>
#endif
Expand Down Expand Up @@ -1470,7 +1472,7 @@ void MspProcessor::processCommand(MspMessage& m, MspResponse& r, Device::SerialD
r.writeU8(_model.state.gps.numSats); //gpsSol.numSat
r.writeU32(_model.state.gps.location.raw.lat); // lat
r.writeU32(_model.state.gps.location.raw.lon); // lon
r.writeU16(std::clamp(_model.state.gps.location.raw.height / 1000, 0, UINT16_MAX)); // height [m]
r.writeU16(std::clamp((int)_model.state.gps.location.raw.height / 1000, 0, (int)std::numeric_limits<uint16_t>::max())); // height [m]
r.writeU16(_model.state.gps.velocity.raw.groundSpeed / 10); // cm/s
r.writeU16(_model.state.gps.velocity.raw.heading / 10000); // deg * 10
// Added in API version 1.44
Expand Down
20 changes: 19 additions & 1 deletion lib/Espfc/src/Device/SerialDeviceAdapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,28 @@ inline bool SerialDeviceAdapter<WiFiClient>::isTxFifoEmpty()
}

template<>
inline void SerialDeviceAdapter<WiFiClient>::updateBadRate(int baud) {};
inline void SerialDeviceAdapter<WiFiClient>::updateBadRate(int baud) {}

#endif

#if defined(ESP32C3) || defined(ESP32S3)
template<>
inline void SerialDeviceAdapter<HWCDC>::updateBadRate(int baud) {}
#endif

#if defined(ESP32S2)
template<>
inline void SerialDeviceAdapter<USBCDC>::updateBadRate(int baud) {}
#endif

#if defined(ARCH_RP2040)
template<>
inline void SerialDeviceAdapter<SerialUART>::updateBadRate(int baud) {}

template<>
inline void SerialDeviceAdapter<SerialUSB>::updateBadRate(int baud) {}
#endif

}

}
Expand Down