Merge branch 'development'

This commit is contained in:
Peter Johnson
2024-04-21 20:15:51 -07:00
149 changed files with 2211 additions and 2189 deletions

View File

@@ -20,6 +20,7 @@
#endif
#include <atomic>
#include <bit>
#include <cstdio>
#include <cstdlib>
#include <cstring>
@@ -822,8 +823,7 @@ void DataLog::AppendFloat(int entry, float value, int64_t timestamp) {
[[unlikely]] return;
}
uint8_t* buf = StartRecord(entry, timestamp, 4, 4);
if constexpr (wpi::support::endian::system_endianness() ==
wpi::support::little) {
if constexpr (std::endian::native == std::endian::little) {
std::memcpy(buf, &value, 4);
} else {
wpi::support::endian::write32le(buf, wpi::bit_cast<uint32_t>(value));
@@ -839,8 +839,7 @@ void DataLog::AppendDouble(int entry, double value, int64_t timestamp) {
[[unlikely]] return;
}
uint8_t* buf = StartRecord(entry, timestamp, 8, 8);
if constexpr (wpi::support::endian::system_endianness() ==
wpi::support::little) {
if constexpr (std::endian::native == std::endian::little) {
std::memcpy(buf, &value, 8);
} else {
wpi::support::endian::write64le(buf, wpi::bit_cast<uint64_t>(value));
@@ -909,8 +908,7 @@ void DataLog::AppendBooleanArray(int entry, std::span<const uint8_t> arr,
void DataLog::AppendIntegerArray(int entry, std::span<const int64_t> arr,
int64_t timestamp) {
if constexpr (wpi::support::endian::system_endianness() ==
wpi::support::little) {
if constexpr (std::endian::native == std::endian::little) {
AppendRaw(entry,
{reinterpret_cast<const uint8_t*>(arr.data()), arr.size() * 8},
timestamp);
@@ -942,8 +940,7 @@ void DataLog::AppendIntegerArray(int entry, std::span<const int64_t> arr,
void DataLog::AppendFloatArray(int entry, std::span<const float> arr,
int64_t timestamp) {
if constexpr (wpi::support::endian::system_endianness() ==
wpi::support::little) {
if constexpr (std::endian::native == std::endian::little) {
AppendRaw(entry,
{reinterpret_cast<const uint8_t*>(arr.data()), arr.size() * 4},
timestamp);
@@ -975,8 +972,7 @@ void DataLog::AppendFloatArray(int entry, std::span<const float> arr,
void DataLog::AppendDoubleArray(int entry, std::span<const double> arr,
int64_t timestamp) {
if constexpr (wpi::support::endian::system_endianness() ==
wpi::support::little) {
if constexpr (std::endian::native == std::endian::little) {
AppendRaw(entry,
{reinterpret_cast<const uint8_t*>(arr.data()), arr.size() * 8},
timestamp);