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
c5f8eee2
Commit
c5f8eee2
authored
12 years ago
by
Ludwig Knüpfer
Committed by
Oleg Hahm
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
make native ltc4150 posix rt independent
parent
cf2e1644
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
native/native-ltc4150.c
+21
-23
21 additions, 23 deletions
native/native-ltc4150.c
with
21 additions
and
23 deletions
native/native-ltc4150.c
+
21
−
23
View file @
c5f8eee2
...
...
@@ -26,11 +26,25 @@
#include
"cpu.h"
#include
"cpu-conf.h"
#include
"hwtimer.h"
#define native_ltc4150_startup_delay 10
static
timer_t
native_ltc4150_timer
;
static
struct
itimerspec
native_ltc4150_timer_time
;
static
int
_int_enabled
;
/**
* native ltc4150 hwtimer - interrupt handler proxy
*/
static
void
_int_handler
()
{
DEBUG
(
"ltc4150 _int_handler()
\n
"
);
ltc4150_interrupt
();
if
(
_int_enabled
==
1
)
{
if
(
hwtimer_set
(
100000
,
_int_handler
,
NULL
)
==
-
1
)
{
errx
(
1
,
"_int_handler: hwtimer_set"
);
};
}
}
/**
* unregister signal handler
...
...
@@ -38,7 +52,7 @@ static struct itimerspec native_ltc4150_timer_time;
void
ltc4150_disable_int
(
void
)
{
DEBUG
(
"ltc4150_disable_int()
\n
"
);
unregister_interrupt
(
_SIG_LTC4150
)
;
_int_enabled
=
0
;
}
/**
...
...
@@ -47,7 +61,10 @@ void ltc4150_disable_int(void)
void
ltc4150_enable_int
(
void
)
{
DEBUG
(
"ltc4150_enable_int()
\n
"
);
register_interrupt
(
_SIG_LTC4150
,
ltc4150_interrupt
);
_int_enabled
=
1
;
if
(
hwtimer_set
(
100000
,
_int_handler
,
NULL
)
==
-
1
)
{
errx
(
1
,
"ltc4150_enable_int: hwtimer_set"
);
};
}
/**
...
...
@@ -68,25 +85,6 @@ void ltc4150_arch_init(void)
ltc4150_disable_int
();
/* create timer */
sev
.
sigev_notify
=
SIGEV_SIGNAL
;
sev
.
sigev_signo
=
_SIG_LTC4150
;
sev
.
sigev_value
.
sival_ptr
=
&
native_ltc4150_timer
;
if
(
timer_create
(
CLOCK_MONOTONIC
,
&
sev
,
&
native_ltc4150_timer
)
==
-
1
)
{
err
(
1
,
"ltc4150_arch_init(): timer_create"
);
}
/* set timer */
native_ltc4150_timer_time
.
it_value
.
tv_sec
=
0
;
native_ltc4150_timer_time
.
it_value
.
tv_nsec
=
100000000
;
native_ltc4150_timer_time
.
it_interval
.
tv_sec
=
0
;
native_ltc4150_timer_time
.
it_interval
.
tv_nsec
=
100000000
;
if
(
timer_settime
(
native_ltc4150_timer
,
0
,
&
native_ltc4150_timer_time
,
NULL
)
==
-
1
)
{
err
(
1
,
"ltc4150_arch_init: timer_settime"
);
}
puts
(
"Native LTC4150 initialized."
);
}
/** @} */
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