1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

core: hwtimer: use disable/restoreIRQ

This commit is contained in:
Kaspar Schleiser 2014-10-27 17:44:33 +01:00
parent 0f36f8c09c
commit cbab2efe7e

View File

@ -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);
unsigned state;
if (!inISR()) {
dINT();
state = disableIRQ();
}
int n = lifo_get(lifo);
if (n == -1) {
if (!inISR()) {
eINT();
restoreIRQ(state);
}
puts("No hwtimer left.");
@ -178,7 +180,7 @@ static int _hwtimer_set(unsigned long offset, void (*callback)(void*), void *ptr
lpm_prevent_sleep++;
if (!inISR()) {
eINT();
restoreIRQ(state);
}
return n;