mirror of
https://github.com/vicliu624/trail-mate.git
synced 2026-07-17 09:01:55 +00:00
style: apply clang-format 14
This commit is contained in:
@@ -192,7 +192,9 @@ void MeshCorePhoneCore::operator delete(void* ptr, std::size_t) noexcept
|
||||
#endif
|
||||
|
||||
MeshCorePhoneCore::MeshCorePhoneCore(IPhoneAppFacade& app, const std::string& device_name, MeshCorePhoneHooks* hooks)
|
||||
: app_(app), device_name_(device_name), hooks_(hooks) {}
|
||||
: app_(app), device_name_(device_name), hooks_(hooks)
|
||||
{
|
||||
}
|
||||
|
||||
void MeshCorePhoneCore::reset()
|
||||
{
|
||||
|
||||
@@ -158,9 +158,9 @@ bool encodeAdminSetPrimaryCustomChannelToRadio(uint8_t* out,
|
||||
}
|
||||
|
||||
bool encodeAdminSetManualLoraConfigToRadio(uint8_t* out,
|
||||
size_t out_len,
|
||||
size_t& written,
|
||||
uint32_t packet_id)
|
||||
size_t out_len,
|
||||
size_t& written,
|
||||
uint32_t packet_id)
|
||||
{
|
||||
meshtastic_AdminMessage admin = meshtastic_AdminMessage_init_zero;
|
||||
admin.which_payload_variant = meshtastic_AdminMessage_set_config_tag;
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
#endif
|
||||
#include "ui/screens/settings/settings_page_shell.h"
|
||||
#if !defined(TRAIL_MATE_ENABLE_SSTV) || TRAIL_MATE_ENABLE_SSTV
|
||||
#include "ui/screens/sstv/sstv_page_shell.h"
|
||||
#include "ui/screens/sstv/sstv_page_runtime.h"
|
||||
#include "ui/screens/sstv/sstv_page_shell.h"
|
||||
#endif
|
||||
#if !defined(GAT562_NO_TEAM) || !GAT562_NO_TEAM
|
||||
#include "ui/screens/team/team_page_shell.h"
|
||||
|
||||
@@ -546,7 +546,8 @@ bool parse_manifest_file(const std::string& path, Manifest& out)
|
||||
{
|
||||
out.clear();
|
||||
|
||||
const bool read_ok = ::ui::fs::read_text_file_lines(path.c_str(), [&out](std::string& line) {
|
||||
const bool read_ok = ::ui::fs::read_text_file_lines(path.c_str(), [&out](std::string& line)
|
||||
{
|
||||
trim_in_place(line);
|
||||
|
||||
if (!line.empty() && line[0] != '#' && line[0] != ';')
|
||||
@@ -562,8 +563,7 @@ bool parse_manifest_file(const std::string& path, Manifest& out)
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
return true; });
|
||||
|
||||
return read_ok && !out.empty();
|
||||
}
|
||||
@@ -824,7 +824,8 @@ bool parse_ranges_file(const std::string& path, std::vector<CodepointRange>& out
|
||||
{
|
||||
out.clear();
|
||||
|
||||
const bool read_ok = ::ui::fs::read_text_file_lines(path.c_str(), [&out](std::string& line) {
|
||||
const bool read_ok = ::ui::fs::read_text_file_lines(path.c_str(), [&out](std::string& line)
|
||||
{
|
||||
std::size_t token_start = 0;
|
||||
while (token_start <= line.size())
|
||||
{
|
||||
@@ -842,8 +843,7 @@ bool parse_ranges_file(const std::string& path, std::vector<CodepointRange>& out
|
||||
}
|
||||
token_start = token_end + 1U;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
return true; });
|
||||
|
||||
normalize_ranges(out);
|
||||
return read_ok && !out.empty();
|
||||
@@ -2141,7 +2141,8 @@ bool parse_locale_strings(const std::string& path,
|
||||
{
|
||||
out.clear();
|
||||
|
||||
const bool read_ok = ::ui::fs::read_text_file_lines(path.c_str(), [&out](std::string& line) {
|
||||
const bool read_ok = ::ui::fs::read_text_file_lines(path.c_str(), [&out](std::string& line)
|
||||
{
|
||||
if (!line.empty() && line[0] != '#')
|
||||
{
|
||||
const std::size_t sep = line.find('\t');
|
||||
@@ -2155,8 +2156,7 @@ bool parse_locale_strings(const std::string& path,
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
return true; });
|
||||
|
||||
std::sort(out.begin(),
|
||||
out.end(),
|
||||
|
||||
@@ -1088,7 +1088,8 @@ bool load_gpx_track_points(const char* path, std::vector<TrackOverlayPoint>& out
|
||||
}
|
||||
|
||||
out.reserve(kMaxTrackOverlayPoints);
|
||||
const bool read_ok = read_track_file_lines(path, [&out](const std::string& line) {
|
||||
const bool read_ok = read_track_file_lines(path, [&out](const std::string& line)
|
||||
{
|
||||
if (line.find("<trkpt") != std::string::npos)
|
||||
{
|
||||
double lat = 0.0;
|
||||
@@ -1097,8 +1098,7 @@ bool load_gpx_track_points(const char* path, std::vector<TrackOverlayPoint>& out
|
||||
{
|
||||
append_track_point(out, lat, lon);
|
||||
}
|
||||
}
|
||||
});
|
||||
} });
|
||||
return read_ok && !out.empty();
|
||||
}
|
||||
|
||||
@@ -1111,7 +1111,8 @@ bool load_csv_track_points(const char* path, std::vector<TrackOverlayPoint>& out
|
||||
}
|
||||
|
||||
out.reserve(kMaxTrackOverlayPoints);
|
||||
const bool read_ok = read_track_file_lines(path, [&out](std::string line) {
|
||||
const bool read_ok = read_track_file_lines(path, [&out](std::string line)
|
||||
{
|
||||
line = trim_copy(std::move(line));
|
||||
if (!line.empty())
|
||||
{
|
||||
@@ -1135,8 +1136,7 @@ bool load_csv_track_points(const char* path, std::vector<TrackOverlayPoint>& out
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} });
|
||||
return read_ok && !out.empty();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "sys/event_bus.h"
|
||||
#include <AES.h>
|
||||
#include <Arduino.h>
|
||||
#include <esp_heap_caps.h>
|
||||
#include <Preferences.h>
|
||||
#include <RadioLib.h>
|
||||
#include <SHA256.h>
|
||||
@@ -26,6 +25,7 @@
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <esp_heap_caps.h>
|
||||
#include <limits>
|
||||
#include <new>
|
||||
#include <type_traits>
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
#include "sys/event_bus.h"
|
||||
#include "team/protocol/team_portnum.h"
|
||||
#include <Arduino.h>
|
||||
#include <esp_heap_caps.h>
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include <esp_heap_caps.h>
|
||||
#include <limits>
|
||||
#include <new>
|
||||
#include <string>
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
#include <cstdio>
|
||||
#include <esp_err.h>
|
||||
#include <esp_heap_caps.h>
|
||||
#include <nvs.h>
|
||||
#include <new>
|
||||
#include <nvs.h>
|
||||
#include <string>
|
||||
|
||||
namespace chat
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
#include "chat/time_utils.h"
|
||||
#include "platform/esp/arduino_common/app_tasks.h"
|
||||
#include <Arduino.h>
|
||||
#include <esp_heap_caps.h>
|
||||
#include <RadioLib.h>
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
#include <esp_heap_caps.h>
|
||||
#include <new>
|
||||
|
||||
namespace chat
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
#include "platform/esp/arduino_common/app_tasks.h"
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <esp_heap_caps.h>
|
||||
#include <RadioLib.h>
|
||||
#include <cstring>
|
||||
#include <esp_heap_caps.h>
|
||||
#include <new>
|
||||
|
||||
namespace platform::esp::arduino_common::mesh
|
||||
|
||||
@@ -1784,10 +1784,10 @@ bool sha256_file(const std::string& logical_path, std::string& out_hex)
|
||||
mbedtls_sha256_context ctx;
|
||||
mbedtls_sha256_init(&ctx);
|
||||
mbedtls_sha256_starts(&ctx, 0);
|
||||
const bool ok = read_file_chunks(logical_path, [&ctx](const std::uint8_t* data, std::size_t len) {
|
||||
const bool ok = read_file_chunks(logical_path, [&ctx](const std::uint8_t* data, std::size_t len)
|
||||
{
|
||||
mbedtls_sha256_update(&ctx, data, len);
|
||||
return true;
|
||||
});
|
||||
return true; });
|
||||
if (!ok)
|
||||
{
|
||||
mbedtls_sha256_free(&ctx);
|
||||
|
||||
Reference in New Issue
Block a user