style: reformat sources with clang-format 14.0.6

This commit is contained in:
liu weikai
2026-02-22 09:42:58 +08:00
parent 6f126458d8
commit bbd5b8c08c
6 changed files with 107 additions and 60 deletions
+2 -1
View File
@@ -1953,7 +1953,8 @@ void TLoRaPagerBoard::shutdown(bool save_data)
LORA_CS,
LORA_RST,
LORA_BUSY,
LORA_IRQ};
LORA_IRQ
};
for (auto pin : pins)
{
@@ -57,9 +57,9 @@ static const uint64_t K[80] = {
/* Various logical functions */
#define ROR64c(x, y) \
(((((x) & UINT64_C(0xFFFFFFFFFFFFFFFF)) >> ((uint64_t)(y) & UINT64_C(63))) | \
((x) << ((uint64_t)(64 - ((y) & UINT64_C(63)))))) & \
#define ROR64c(x, y) \
(((((x)&UINT64_C(0xFFFFFFFFFFFFFFFF)) >> ((uint64_t)(y)&UINT64_C(63))) | \
((x) << ((uint64_t)(64 - ((y)&UINT64_C(63)))))) & \
UINT64_C(0xFFFFFFFFFFFFFFFF))
#define STORE64H(x, y) \
@@ -71,7 +71,7 @@ static const uint64_t K[80] = {
(y)[4] = (unsigned char)(((x) >> 24) & 255); \
(y)[5] = (unsigned char)(((x) >> 16) & 255); \
(y)[6] = (unsigned char)(((x) >> 8) & 255); \
(y)[7] = (unsigned char)((x) & 255); \
(y)[7] = (unsigned char)((x)&255); \
}
#define LOAD64H(x, y) \
@@ -85,7 +85,7 @@ static const uint64_t K[80] = {
#define Ch(x, y, z) (z ^ (x & (y ^ z)))
#define Maj(x, y, z) (((x | y) & z) | (x & y))
#define S(x, n) ROR64c(x, n)
#define R(x, n) (((x) & UINT64_C(0xFFFFFFFFFFFFFFFF)) >> ((uint64_t)n))
#define R(x, n) (((x)&UINT64_C(0xFFFFFFFFFFFFFFFF)) >> ((uint64_t)n))
#define Sigma0(x) (S(x, 28) ^ S(x, 34) ^ S(x, 39))
#define Sigma1(x) (S(x, 14) ^ S(x, 18) ^ S(x, 41))
#define Gamma0(x) (S(x, 1) ^ S(x, 8) ^ R(x, 7))
@@ -61,97 +61,137 @@
/// Default Horizontal codes. When composition of text is know beforehand, the other hcodes in this section can be used to achieve
/// more compression.
#define USX_HCODES_DFLT \
(const unsigned char[]){ \
0x00, 0x40, 0x80, 0xC0, 0xE0}
#define USX_HCODES_DFLT \
(const unsigned char[]) \
{ \
0x00, 0x40, 0x80, 0xC0, 0xE0 \
}
/// Length of each default hcode
#define USX_HCODE_LENS_DFLT \
(const unsigned char[]){ \
2, 2, 2, 3, 3}
#define USX_HCODE_LENS_DFLT \
(const unsigned char[]) \
{ \
2, 2, 2, 3, 3 \
}
/// Horizontal codes preset for English Alphabet content only
#define USX_HCODES_ALPHA_ONLY \
(const unsigned char[]){ \
0x00, 0x00, 0x00, 0x00, 0x00}
#define USX_HCODES_ALPHA_ONLY \
(const unsigned char[]) \
{ \
0x00, 0x00, 0x00, 0x00, 0x00 \
}
/// Length of each Alpha only hcode
#define USX_HCODE_LENS_ALPHA_ONLY \
(const unsigned char[]){ \
0, 0, 0, 0, 0}
(const unsigned char[]) \
{ \
0, 0, 0, 0, 0 \
}
/// Horizontal codes preset for Alpha Numeric content only
#define USX_HCODES_ALPHA_NUM_ONLY \
(const unsigned char[]){ \
0x00, 0x00, 0x80, 0x00, 0x00}
#define USX_HCODES_ALPHA_NUM_ONLY \
(const unsigned char[]) \
{ \
0x00, 0x00, 0x80, 0x00, 0x00 \
}
/// Length of each Alpha numeric hcode
#define USX_HCODE_LENS_ALPHA_NUM_ONLY \
(const unsigned char[]){ \
1, 0, 1, 0, 0}
(const unsigned char[]) \
{ \
1, 0, 1, 0, 0 \
}
/// Horizontal codes preset for Alpha Numeric and Symbol content only
#define USX_HCODES_ALPHA_NUM_SYM_ONLY \
(const unsigned char[]){ \
0x00, 0x80, 0xC0, 0x00, 0x00}
(const unsigned char[]) \
{ \
0x00, 0x80, 0xC0, 0x00, 0x00 \
}
/// Length of each Alpha numeric and symbol hcodes
#define USX_HCODE_LENS_ALPHA_NUM_SYM_ONLY \
(const unsigned char[]){ \
1, 2, 2, 0, 0}
(const unsigned char[]) \
{ \
1, 2, 2, 0, 0 \
}
/// Horizontal codes preset favouring Alphabet content
#define USX_HCODES_FAVOR_ALPHA \
(const unsigned char[]){ \
0x00, 0x80, 0xA0, 0xC0, 0xE0}
#define USX_HCODES_FAVOR_ALPHA \
(const unsigned char[]) \
{ \
0x00, 0x80, 0xA0, 0xC0, 0xE0 \
}
/// Length of each hcode favouring Alpha content
#define USX_HCODE_LENS_FAVOR_ALPHA \
(const unsigned char[]){ \
1, 3, 3, 3, 3}
(const unsigned char[]) \
{ \
1, 3, 3, 3, 3 \
}
/// Horizontal codes preset favouring repeating sequences
#define USX_HCODES_FAVOR_DICT \
(const unsigned char[]){ \
0x00, 0x40, 0xC0, 0x80, 0xE0}
#define USX_HCODES_FAVOR_DICT \
(const unsigned char[]) \
{ \
0x00, 0x40, 0xC0, 0x80, 0xE0 \
}
/// Length of each hcode favouring repeating sequences
#define USX_HCODE_LENS_FAVOR_DICT \
(const unsigned char[]){ \
2, 2, 3, 2, 3}
(const unsigned char[]) \
{ \
2, 2, 3, 2, 3 \
}
/// Horizontal codes preset favouring symbols
#define USX_HCODES_FAVOR_SYM \
(const unsigned char[]){ \
0x80, 0x00, 0xA0, 0xC0, 0xE0}
#define USX_HCODES_FAVOR_SYM \
(const unsigned char[]) \
{ \
0x80, 0x00, 0xA0, 0xC0, 0xE0 \
}
/// Length of each hcode favouring symbols
#define USX_HCODE_LENS_FAVOR_SYM \
(const unsigned char[]){ \
3, 1, 3, 3, 3}
(const unsigned char[]) \
{ \
3, 1, 3, 3, 3 \
}
// #define USX_HCODES_FAVOR_UMLAUT {0x00, 0x40, 0xE0, 0xC0, 0x80}
// #define USX_HCODE_LENS_FAVOR_UMLAUT {2, 2, 3, 3, 2}
/// Horizontal codes preset favouring umlaut letters
#define USX_HCODES_FAVOR_UMLAUT \
(const unsigned char[]){ \
0x80, 0xA0, 0xC0, 0xE0, 0x00}
#define USX_HCODES_FAVOR_UMLAUT \
(const unsigned char[]) \
{ \
0x80, 0xA0, 0xC0, 0xE0, 0x00 \
}
/// Length of each hcode favouring umlaut letters
#define USX_HCODE_LENS_FAVOR_UMLAUT \
(const unsigned char[]){ \
3, 3, 3, 3, 1}
(const unsigned char[]) \
{ \
3, 3, 3, 3, 1 \
}
/// Horizontal codes preset for no repeating sequences
#define USX_HCODES_NO_DICT \
(const unsigned char[]){ \
0x00, 0x40, 0x80, 0x00, 0xC0}
#define USX_HCODES_NO_DICT \
(const unsigned char[]) \
{ \
0x00, 0x40, 0x80, 0x00, 0xC0 \
}
/// Length of each hcode for no repeating sequences
#define USX_HCODE_LENS_NO_DICT \
(const unsigned char[]){ \
2, 2, 2, 0, 2}
(const unsigned char[]) \
{ \
2, 2, 2, 0, 2 \
}
/// Horizontal codes preset for no Unicode characters
#define USX_HCODES_NO_UNI \
(const unsigned char[]){ \
0x00, 0x40, 0x80, 0xC0, 0x00}
#define USX_HCODES_NO_UNI \
(const unsigned char[]) \
{ \
0x00, 0x40, 0x80, 0xC0, 0x00 \
}
/// Length of each hcode for no Unicode characters
#define USX_HCODE_LENS_NO_UNI \
(const unsigned char[]){ \
2, 2, 2, 2, 0}
(const unsigned char[]) \
{ \
2, 2, 2, 2, 0 \
}
extern const char* USX_FREQ_SEQ_DFLT[];
extern const char* USX_FREQ_SEQ_TXT[];
+6 -2
View File
@@ -91,7 +91,9 @@ bool TrackRecorder::ensureDir() const
String TrackRecorder::makeTrackPath() const
{
time_t now = time(nullptr);
struct tm tm_utc{};
struct tm tm_utc
{
};
char time_buf[32] = {0};
if (now > 0 && gmtime_r(&now, &tm_utc))
{
@@ -114,7 +116,9 @@ String TrackRecorder::isoTime(time_t t)
{
t = time(nullptr);
}
struct tm tm_utc{};
struct tm tm_utc
{
};
char buf[32] = {0};
if (t > 0 && gmtime_r(&t, &tm_utc))
{
+1 -1
View File
@@ -703,7 +703,7 @@ void sstv_task(void*)
}
auto* mono_buf = static_cast<int16_t*>(malloc(kSamplesPerBlock * sizeof(int16_t)));
auto* resampled = static_cast<int16_t*>(malloc(kResampleMaxOut * sizeof(int16_t)));
auto* line_rgb = static_cast<uint8_t (*)[4]>(malloc(320 * 4));
auto* line_rgb = static_cast<uint8_t(*)[4]>(malloc(320 * 4));
if (!mono_buf || !resampled || !line_rgb)
{
free(line_rgb);
+3 -1
View File
@@ -138,7 +138,9 @@ std::string iso_time(time_t t)
{
t = time(nullptr);
}
struct tm tm_utc{};
struct tm tm_utc
{
};
char buf[32] = {0};
if (t > 0 && gmtime_r(&t, &tm_utc))
{