Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
ddef0654
Commit
ddef0654
authored
May 02, 2017
by
Deomid Ryabkov
Committed by
Cesanta Bot
May 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable SNTP on CC3200
PUBLISHED_FROM=cea0fc4db21f5b68fd3e779334989fef84a1637a
parent
ac857d18
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
mongoose.c
mongoose.c
+16
-13
mongoose.h
mongoose.h
+1
-0
No files found.
mongoose.c
View file @
ddef0654
...
...
@@ -12388,21 +12388,24 @@ time_t HOSTtime() {
#endif
/* __TI_COMPILER_VERSION__ */
#ifndef __TI_COMPILER_VERSION__
int
_gettimeofday_r
(
struct
_reent
*
r
,
struct
timeval
*
tp
,
void
*
tz
p
)
{
int
_gettimeofday_r
(
struct
_reent
*
r
,
struct
timeval
*
tp
,
void
*
tz
)
{
#else
int
gettimeofday
(
struct
timeval
*
tp
,
void
*
tz
p
)
{
int
gettimeofday
(
struct
timeval
*
tp
,
void
*
tz
)
{
#endif
unsigned
long
long
r1
=
0
,
r2
;
/* Achieve two consecutive reads of the same value. */
do
{
r2
=
r1
;
r1
=
PRCMSlowClkCtrFastGet
();
}
while
(
r1
!=
r2
);
/* This is a 32768 Hz counter. */
tp
->
tv_sec
=
(
r1
>>
15
);
/* 1/32768-th of a second is 30.517578125 microseconds, approx. 31,
* but we round down so it doesn't overflow at 32767 */
tp
->
tv_usec
=
(
r1
&
0x7FFF
)
*
30
;
unsigned
long
sec
;
unsigned
short
msec
;
MAP_PRCMRTCGet
(
&
sec
,
&
msec
);
tp
->
tv_sec
=
sec
;
tp
->
tv_usec
=
((
unsigned
long
)
msec
)
*
1000
;
return
0
;
}
#ifndef __TI_COMPILER_VERSION__
int
settimeofday
(
const
struct
timeval
*
tv
,
const
struct
timezone
*
tz
)
{
#else
int
settimeofday
(
const
struct
timeval
*
tv
,
const
void
*
tz
)
{
#endif
MAP_PRCMRTCSet
(
tv
->
tv_sec
,
tv
->
tv_usec
/
1000
);
return
0
;
}
...
...
mongoose.h
View file @
ddef0654
...
...
@@ -676,6 +676,7 @@ extern "C" {
struct
SlTimeval_t
;
#define timeval SlTimeval_t
int
gettimeofday
(
struct
timeval
*
t
,
void
*
tz
);
int
settimeofday
(
const
struct
timeval
*
tv
,
const
void
*
tz
);
int
asprintf
(
char
**
strp
,
const
char
*
fmt
,
...);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment