Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
6a856cb7
Commit
6a856cb7
authored
Mar 22, 2012
by
Grzegorz Daniluk
Committed by
Alessandro Rubini
Mar 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec: filled timer functions
parent
16309bc4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
spec-timer.c
arch-spec/spec-timer.c
+20
-2
No files found.
arch-spec/spec-timer.c
View file @
6a856cb7
#include <pptp/pptp.h>
#include <pps_gen.h>
static
struct
pp_timer
spec_timers
[
PP_TIMER_ARRAY_SIZE
];
int
spec_timer_init
(
struct
pp_instance
*
ppi
)
...
...
@@ -13,7 +15,10 @@ int spec_timer_init(struct pp_instance *ppi)
int
spec_timer_start
(
uint32_t
interval
,
struct
pp_timer
*
tm
)
{
//GGDD
uint32_t
nsec
;
pps_gen_get_time
(
&
(
tm
->
start
),
&
nsec
);
tm
->
interval
=
interval
;
return
0
;
}
...
...
@@ -27,7 +32,20 @@ int spec_timer_stop(struct pp_timer *tm)
int
spec_timer_expired
(
struct
pp_timer
*
tm
)
{
//GGDD
uint32_t
now
,
nsec
;
if
(
tm
->
start
==
0
)
{
PP_PRINTF
(
"%p Warning: posix_timer_expired: timer not started
\n
"
,
tm
);
return
0
;
}
pps_gen_get_time
(
&
now
,
&
nsec
);
if
(
tm
->
start
+
tm
->
interval
<
now
)
{
tm
->
start
=
now
;
return
1
;
}
return
0
;
}
...
...
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