Skip to content

Commit 61367b2

Browse files
committed
make epoch and SECS_YR_2000 local variables
1 parent f3c832d commit 61367b2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

UNOR4USBBridge/cmds_esp_generic.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
#include "at_handler.h"
55

6-
char epoch[12]; // gettime
7-
#define SECS_YR_2000 (946684800UL) // the time at the start of y2k
8-
96
extern "C" {
107
#include "esp32-hal-tinyusb.h"
118
}
@@ -370,6 +367,8 @@ void CAtHandler::add_cmds_esp_generic() {
370367

371368
switch (parser.cmd_mode) {
372369
case chAT::CommandMode::Write: {
370+
char epoch[12]; // gettime
371+
constexpr uint32_t SECS_YR_2000 = 946684800UL; // the time at the start of y2k
373372
configTime(0, 0, "pool.ntp.org");
374373
time_t now = time(nullptr);
375374

0 commit comments

Comments
 (0)