mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/pm_layered: move (un)block assert for minor speedup
This commit is contained in:
parent
b61a203053
commit
f3ed268ec6
@ -77,22 +77,20 @@ void pm_set_lowest(void)
|
||||
|
||||
void pm_block(unsigned mode)
|
||||
{
|
||||
assert(pm_blocker.blockers[mode] != 255);
|
||||
|
||||
DEBUG("[pm_layered] pm_block(%d)\n", mode);
|
||||
|
||||
unsigned state = irq_disable();
|
||||
assert(pm_blocker.blockers[mode] != 255);
|
||||
pm_blocker.blockers[mode]++;
|
||||
irq_restore(state);
|
||||
}
|
||||
|
||||
void pm_unblock(unsigned mode)
|
||||
{
|
||||
assert(pm_blocker.blockers[mode] > 0);
|
||||
|
||||
DEBUG("[pm_layered] pm_unblock(%d)\n", mode);
|
||||
|
||||
unsigned state = irq_disable();
|
||||
assert(pm_blocker.blockers[mode] > 0);
|
||||
pm_blocker.blockers[mode]--;
|
||||
irq_restore(state);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user