Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdc62b19

Browse files
committed
move getLocalTime to time.cpp
1 parentb96338f commitdc62b19

File tree

2 files changed

+25
-39
lines changed

2 files changed

+25
-39
lines changed

‎cores/esp8266/time.cpp‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,28 @@
2020
* synchronisation of the two through timeshift64
2121
*/
2222

23+
#include<Arduino.h>
24+
25+
// https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-time.c
26+
27+
boolgetLocalTime(structtm * info,uint32_t ms)
28+
{
29+
uint32_t start =millis();
30+
time_t now;
31+
while((millis()-start) <= ms) {
32+
time(&now);
33+
localtime_r(&now, info);
34+
if(info->tm_year > (2016 -1900)){
35+
returntrue;
36+
}
37+
delay(10);
38+
}
39+
returnfalse;
40+
}
41+
42+
43+
#if !defined(CORE_MOCK)
44+
2345
#include<stdlib.h>
2446
#include<../include/time.h>// See issue #6714
2547
#include<sys/time.h>
@@ -33,7 +55,6 @@ extern "C" {
3355
#include<coredecls.h>
3456
#include<Schedule.h>
3557

36-
#include<Arduino.h>// configTime()
3758

3859
extern"C" {
3960

@@ -257,4 +278,6 @@ int settimeofday(const struct timeval* tv, const struct timezone* tz)
257278
return0;
258279
}
259280

260-
};
281+
};// extern "C"
282+
283+
#endif// !defined(CORE_MOCK)

‎cores/esp8266/timehelper.cpp‎

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp