Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
6c591c8a
Commit
6c591c8a
authored
11 years ago
by
Hauke Petersen
Browse files
Options
Downloads
Patches
Plain Diff
tests/pkg: fixed issues from #919
parent
28f267f8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/openwsn/patch.txt
+1
-1
1 addition, 1 deletion
pkg/openwsn/patch.txt
tests/test_hwtimer/main.c
+5
-5
5 additions, 5 deletions
tests/test_hwtimer/main.c
with
6 additions
and
6 deletions
pkg/openwsn/patch.txt
+
1
−
1
View file @
6c591c8a
...
@@ -34615,7 +34615,7 @@ diff -crB openwsn/opentimers.h ../../../sys/net/openwsn/opentimers.h
...
@@ -34615,7 +34615,7 @@ diff -crB openwsn/opentimers.h ../../../sys/net/openwsn/opentimers.h
!
!
! typedef void (*opentimers_cbt)(void);
! typedef void (*opentimers_cbt)(void);
!
!
! #define OPENTIMERS_HWTIMER_ID (
ARCH
_MAXTIMERS - 1)
! #define OPENTIMERS_HWTIMER_ID (
HWTIMER
_MAXTIMERS - 1)
!
!
! //=========================== typedef =========================================
! //=========================== typedef =========================================
!
!
This diff is collapsed.
Click to expand it.
tests/test_hwtimer/main.c
+
5
−
5
View file @
6c591c8a
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#define BASE_DELAY (1000UL * 1000UL)
#define BASE_DELAY (1000UL * 1000UL)
#define DELTA_DELAY (1000UL * 1000UL)
#define DELTA_DELAY (1000UL * 1000UL)
#define MSGLEN 12 // == strlen("callback %2i")
#define MSGLEN 12 // == strlen("callback %2i")
char
msg
[
MSGLEN
*
ARCH
_MAXTIMERS
];
// == [callback 1\0callback 2\0...]
char
msg
[
MSGLEN
*
HWTIMER
_MAXTIMERS
];
// == [callback 1\0callback 2\0...]
void
callback
(
void
*
ptr
)
void
callback
(
void
*
ptr
)
{
{
...
@@ -43,14 +43,14 @@ int main(void)
...
@@ -43,14 +43,14 @@ int main(void)
puts
(
""
);
puts
(
""
);
puts
(
" Timers should print
\"
callback x
\"
once when they run out."
);
puts
(
" Timers should print
\"
callback x
\"
once when they run out."
);
printf
(
" The order for x is 1, n-1, n-2, ..., 2 where n is the number of available hardware timers (%u on this platform).
\n
"
,
ARCH
_MAXTIMERS
);
printf
(
" The order for x is 1, n-1, n-2, ..., 2 where n is the number of available hardware timers (%u on this platform).
\n
"
,
HWTIMER
_MAXTIMERS
);
puts
(
" One timer should fire every second until all timers have run out."
);
puts
(
" One timer should fire every second until all timers have run out."
);
puts
(
" Additionally the message
\"
hwtimer set.
\"
should be printed once 1 second from now."
);
puts
(
" Additionally the message
\"
hwtimer set.
\"
should be printed once 1 second from now."
);
puts
(
""
);
puts
(
""
);
puts
(
"Setting timers:"
);
puts
(
"Setting timers:"
);
puts
(
""
);
puts
(
""
);
unsigned
long
delay
=
BASE_DELAY
+
((
ARCH
_MAXTIMERS
-
1
)
*
DELTA_DELAY
);
unsigned
long
delay
=
BASE_DELAY
+
((
HWTIMER
_MAXTIMERS
-
1
)
*
DELTA_DELAY
);
/* make the first timer first to fire so timers do not run out linearly */
/* make the first timer first to fire so timers do not run out linearly */
char
*
msgn
=
msg
;
char
*
msgn
=
msg
;
...
@@ -58,9 +58,9 @@ int main(void)
...
@@ -58,9 +58,9 @@ int main(void)
hwtimer_set
(
HWTIMER_TICKS
(
BASE_DELAY
),
callback
,
(
void
*
)
msgn
);
hwtimer_set
(
HWTIMER_TICKS
(
BASE_DELAY
),
callback
,
(
void
*
)
msgn
);
printf
(
"set %s
\n
"
,
msgn
);
printf
(
"set %s
\n
"
,
msgn
);
/* set up to
ARCH
_MAXTIMERS-1 because hwtimer_wait below also
/* set up to
HWTIMER
_MAXTIMERS-1 because hwtimer_wait below also
* needs a timer */
* needs a timer */
for
(
int
i
=
1
;
i
<
(
ARCH
_MAXTIMERS
-
1
);
i
++
)
{
for
(
int
i
=
1
;
i
<
(
HWTIMER
_MAXTIMERS
-
1
);
i
++
)
{
msgn
=
msg
+
(
i
*
MSGLEN
);
msgn
=
msg
+
(
i
*
MSGLEN
);
delay
-=
DELTA_DELAY
;
delay
-=
DELTA_DELAY
;
snprintf
(
msgn
,
MSGLEN
,
"callback %2x"
,
i
+
1
);
snprintf
(
msgn
,
MSGLEN
,
"callback %2x"
,
i
+
1
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment