Skip to content

Commit 9a81d6e

Browse files
enable BreakStringLiterals in clang-format; remove useless includes; fix image background
1 parent f1d59d0 commit 9a81d6e

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

.clang-format

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# - ReflowComments: true
44
# - MaxEmptyLinesToKeep: 1
55
# - ColumnLimit: 100
6+
# - BreakStringLiterals: true
67

78
Language: Cpp
89
# LLVM is the default style setting, used when a configuration option is not set here
@@ -59,7 +60,7 @@ BreakBeforeBraces: Attach
5960
BreakBeforeTernaryOperators: true
6061
BreakConstructorInitializers: BeforeColon
6162
BreakInheritanceList: BeforeColon
62-
BreakStringLiterals: false
63+
BreakStringLiterals: true
6364
ColumnLimit: 100
6465
# "" matches none
6566
CommentPragmas: ""

examples/rtc_memory_benchmark/rtc_memory_benchmark.ino

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Benchmark and test the APIs offered by RTCMemory.
33
* It shows the different speeds provided by RTC and flash memory.
44
***********************************************************************/
5-
#include <FS.h>
65
#include <RTCMemory.h>
76

87
void setup() {

examples/rtc_memory_with_backup/rtc_memory_with_backup.ino

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* This sketch shows how to store and retrieve a variable from
33
* RTC memory and how to backup it on flash memory.
44
********************************************************************/
5-
#include <FS.h>
65
#include <RTCMemory.h>
76

87
// Define a struct that maps what's inside the RTC memory

extras/rtc_memory_layout.drawio.png

1.33 KB
Loading

src/RTCMemory.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,12 @@ template<typename T, int N = 384> class RTCMemory {
152152
};
153153
template<typename T, int N>
154154
RTCMemory<T, N>::RTCMemory(String path, FS &fs) : ready(false), filePath(path), fileSystem(fs) {
155-
static_assert(sizeof(T) <= MAX_USER_RTC_MEMORY_SIZE, "Error: max size of user data in RTC memory is 508 Byte");
156-
static_assert(sizeof(RTCData) <= N,
157-
"Error: you reached the max user-defined memory size. You may increase dedicated RTC memory over the default limit of 384 and up to 512 bytes, but you will lose the OTA capability.");
155+
static_assert(sizeof(T) <= MAX_USER_RTC_MEMORY_SIZE, "Error: max size of user data in RTC memory "
156+
"is 508 Byte");
157+
static_assert(sizeof(RTCData) <= N, "Error: you reached the max user-defined memory size. You "
158+
"may increase dedicated RTC memory over the default limit of "
159+
"384 and up to 512 bytes, but you will lose the OTA "
160+
"capability.");
158161
}
159162

160163
template<typename T, int N> bool RTCMemory<T, N>::begin() {

0 commit comments

Comments
 (0)