Merge pull request #1883 from kaspar030/hwtimer_new_irq_api
core: hwtimer: use disable/restoreIRQ
This commit is contained in:
commit
37d8cabbe8
@ -148,15 +148,17 @@ static int _hwtimer_set(unsigned long offset, void (*callback)(void*), void *ptr
|
|||||||
{
|
{
|
||||||
DEBUG("_hwtimer_set: offset=%lu callback=%p ptr=%p absolute=%d\n", offset, callback, ptr, absolute);
|
DEBUG("_hwtimer_set: offset=%lu callback=%p ptr=%p absolute=%d\n", offset, callback, ptr, absolute);
|
||||||
|
|
||||||
|
unsigned state;
|
||||||
|
|
||||||
if (!inISR()) {
|
if (!inISR()) {
|
||||||
dINT();
|
state = disableIRQ();
|
||||||
}
|
}
|
||||||
|
|
||||||
int n = lifo_get(lifo);
|
int n = lifo_get(lifo);
|
||||||
|
|
||||||
if (n == -1) {
|
if (n == -1) {
|
||||||
if (!inISR()) {
|
if (!inISR()) {
|
||||||
eINT();
|
restoreIRQ(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
puts("No hwtimer left.");
|
puts("No hwtimer left.");
|
||||||
@ -178,7 +180,7 @@ static int _hwtimer_set(unsigned long offset, void (*callback)(void*), void *ptr
|
|||||||
lpm_prevent_sleep++;
|
lpm_prevent_sleep++;
|
||||||
|
|
||||||
if (!inISR()) {
|
if (!inISR()) {
|
||||||
eINT();
|
restoreIRQ(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
return n;
|
return n;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user