Skip to content

Commit

Permalink
Merge pull request #1901 from OlegHahm/hwtimer_irq_fixup
Browse files Browse the repository at this point in the history
core: eliminate warning in hwtimer
  • Loading branch information
OlegHahm committed Oct 30, 2014
2 parents c6ff614 + 4885690 commit 3d0be08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 3 additions & 9 deletions core/hwtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,12 @@ static int _hwtimer_set(unsigned long offset, void (*callback)(void*), void *ptr

unsigned state;

if (!inISR()) {
state = disableIRQ();
}
state = disableIRQ();

int n = lifo_get(lifo);

if (n == -1) {
if (!inISR()) {
restoreIRQ(state);
}
restoreIRQ(state);

puts("No hwtimer left.");
return -1;
Expand All @@ -179,9 +175,7 @@ static int _hwtimer_set(unsigned long offset, void (*callback)(void*), void *ptr

lpm_prevent_sleep++;

if (!inISR()) {
restoreIRQ(state);
}
restoreIRQ(state);

return n;
}
Expand Down
3 changes: 3 additions & 0 deletions core/include/arch/irq_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
* This file acts as a wrapper between the kernels interrupt interface and the architecture
* dependent implementation of the interfaces.
*
* @note All functions in this module have to be implemented in a way that it
* is safe to call them from within the context of an ISR.
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/

Expand Down

0 comments on commit 3d0be08

Please sign in to comment.