Skip to content

Commit 3d3460d

Browse files
committed
Merge branch 'develop' into feat/arduino-3.0
2 parents 72b491a + abcf8c0 commit 3d3460d

File tree

8 files changed

+28
-29
lines changed

8 files changed

+28
-29
lines changed

.clang-format

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,9 @@ IndentWrappedFunctionNames: true
125125
InsertNewlineAtEOF: true
126126
InsertTrailingCommas: Wrapped
127127
IntegerLiteralSeparator:
128-
Binary: 4
129-
BinaryMinDigits: 9
130-
Decimal: 3
131-
DecimalMinDigits: 5
132-
Hex: 2
133-
HexMinDigits: 9
128+
Binary: 0
129+
Decimal: 0
130+
Hex: 0
134131
KeepEmptyLinesAtEOF: false
135132
KeepEmptyLinesAtTheStartOfBlocks: false
136133
LambdaBodyIndentation: OuterScope

.github/workflows/cpp-linter.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: cpp-linter
33
on:
44
pull_request:
55
types: [opened, reopened, synchronize]
6-
paths: ['**.c', '**.h', '**.cpp', '**.hpp', '.clang-format']
6+
paths: ['**.c', '**.h', '**.cpp', '**.hpp', '.clang-format', '.github/workflows/cpp-linter.yml']
77
push:
8-
paths: ['**.c', '**.h', '**.cpp', '**.hpp', '.clang-format']
8+
paths: ['**.c', '**.h', '**.cpp', '**.hpp', '.clang-format', '.github/workflows/cpp-linter.yml']
99
workflow_dispatch: # Manually invoked by user.
1010

1111
jobs:
@@ -37,10 +37,12 @@ jobs:
3737
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3838
with:
3939
style: file
40-
version: 18
41-
lines-changed-only: diff
42-
thread-comments: true
43-
file-annotations: false
40+
version: 21
41+
ignore: |
42+
.github
43+
include/serialization/_fbs
44+
thread-comments: update
45+
no-lgtm: false
4446

4547
- name: Fail fast?!
4648
if: steps.linter.outputs.checks-failed > 0

include/Checksum.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ namespace OpenShock::Checksum {
5050
*/
5151
constexpr uint8_t ReverseNibble(uint8_t b)
5252
{
53-
return (0xF7'B3'D5'91'E6'A2'C4'80 >> (b * 4)) & 0xF; // Trust me bro
53+
return (0xF7B3D591E6A2C480ull >> (b * 4)) & 0xF; // Trust me bro
5454
}
5555

5656
/**
5757
* Make sure the uint8 only has its high bits (0x0F) set before using this function
5858
*/
5959
constexpr uint8_t ReverseInverseNibble(uint8_t b)
6060
{
61-
return (0x08'4C'2A'6E'19'5D'3B'7F >> (b * 4)) & 0xF; // Trust me bro
61+
return (0x084C2A6E195D3B7Full >> (b * 4)) & 0xF; // Trust me bro
6262
}
6363
} // namespace OpenShock::Checksum
6464

include/Common.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@
4545
"Let it be known that Arduino hath finally been cast aside in favor of the noble ESP-IDF! I beseech thee, kind sir or madam, wouldst thou kindly partake in the honors of expunging 'arduino-esp32' from yonder useragent aloft, and in its stead, bestow the illustrious 'ESP-IDF'?"
4646
#endif
4747

48-
#if __cplusplus >= 202'302L
48+
#if __cplusplus >= 202302L
4949
#warning "C++23 compiler detected"
50-
#elif __cplusplus >= 202'002L
50+
#elif __cplusplus >= 202002L
5151
// C++20 :3
52-
#elif __cplusplus >= 201'703L
52+
#elif __cplusplus >= 201703L
5353
#error "C++17 compiler detected, OpenShock requires a C++20 compliant compiler"
54-
#elif __cplusplus >= 201'402L
54+
#elif __cplusplus >= 201402L
5555
#error "C++14 compiler detected, OpenShock requires a C++20 compliant compiler"
56-
#elif __cplusplus >= 201'103L
56+
#elif __cplusplus >= 201103L
5757
#error "C++11 compiler detected, OpenShock requires a C++20 compliant compiler"
58-
#elif __cplusplus >= 199'711L
58+
#elif __cplusplus >= 199711L
5959
#error "C++98 compiler detected, OpenShock requires a C++20 compliant compiler"
6060
#elif __cplusplus == 1
6161
#error "Pre-C++98 compiler detected, OpenShock requires a C++20 compliant compiler"

include/serial/command_handlers/CommandEntry.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ namespace OpenShock::SerialCmds {
1616

1717
class CommandEntry {
1818
public:
19-
CommandEntry(std::string_view description, CommandHandler commandHandler);
20-
CommandEntry(std::string_view name, std::string_view description, CommandHandler commandHandler);
19+
CommandEntry(std::string_view description, CommandHandler commandHandler) noexcept;
20+
CommandEntry(std::string_view name, std::string_view description, CommandHandler commandHandler) noexcept;
2121

2222
inline std::string_view name() const { return m_name; }
2323
inline std::string_view description() const { return m_description; }

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
platformio==6.1.19
22
esptool==5.1.0
3-
cryptography==45.0.5
3+
cryptography==46.0.5

src/serial/command_handlers/CommandEntry.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
using namespace OpenShock::SerialCmds;
44

5-
CommandEntry::CommandEntry(std::string_view description, CommandHandler commandHandler)
5+
CommandEntry::CommandEntry(std::string_view description, CommandHandler commandHandler) noexcept
66
: m_description(description)
77
, m_commandHandler(commandHandler)
88
{
99
}
1010

11-
CommandEntry::CommandEntry(std::string_view name, std::string_view description, CommandHandler commandHandler)
11+
CommandEntry::CommandEntry(std::string_view name, std::string_view description, CommandHandler commandHandler) noexcept
1212
: m_name(name)
1313
, m_description(description)
1414
, m_commandHandler(commandHandler)

src/wifi/WiFiManager.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ std::vector<WiFiNetwork>::iterator _findNetwork(std::function<bool(WiFiNetwork&)
8686
}
8787
std::vector<WiFiNetwork>::iterator _findNetworkBySSID(const char* ssid, bool sortByAttractivity = true)
8888
{
89-
return _findNetwork([ssid](const WiFiNetwork& net) { return strcmp(net.ssid, ssid) == 0; }, sortByAttractivity);
89+
return _findNetwork([ssid](const WiFiNetwork& net) noexcept { return strcmp(net.ssid, ssid) == 0; }, sortByAttractivity);
9090
}
9191
std::vector<WiFiNetwork>::iterator _findNetworkByBSSID(const uint8_t (&bssid)[6])
9292
{
93-
return _findNetwork([bssid](const WiFiNetwork& net) { return memcmp(net.bssid, bssid, sizeof(bssid)) == 0; }, false);
93+
return _findNetwork([bssid](const WiFiNetwork& net) noexcept { return memcmp(net.bssid, bssid, sizeof(bssid)) == 0; }, false);
9494
}
9595
std::vector<WiFiNetwork>::iterator _findNetworkByCredentialsID(uint8_t credentialsID, bool sortByAttractivity = true)
9696
{
97-
return _findNetwork([credentialsID](const WiFiNetwork& net) { return net.credentialsID == credentialsID; }, sortByAttractivity);
97+
return _findNetwork([credentialsID](const WiFiNetwork& net) noexcept { return net.credentialsID == credentialsID; }, sortByAttractivity);
9898
}
9999

100100
bool _markNetworkAsAttempted(const uint8_t (&bssid)[6])
@@ -564,7 +564,7 @@ bool WiFiManager::GetConnectedNetwork(OpenShock::WiFiNetwork& network)
564564
return false;
565565
}
566566

567-
auto it = _findNetwork([](const WiFiNetwork& net) { return net.credentialsID == s_connectedCredentialsID; });
567+
auto it = _findNetwork([](const WiFiNetwork& net) noexcept { return net.credentialsID == s_connectedCredentialsID; });
568568
if (it == s_wifiNetworks.end()) {
569569
return false;
570570
}

0 commit comments

Comments
 (0)